hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
e7ffb07502a866daacad535d6c162c3df47ed0fa
1,075
py
Python
001-050/029-divide-two-integers.py
bbram10/leetcode-master
565f5f0cb3c9720e59a78ddf2e5e6e829c70bac6
[ "MIT" ]
134
2017-01-16T11:17:44.000Z
2022-03-16T17:13:26.000Z
001-050/029-divide-two-integers.py
bbram10/leetcode-master
565f5f0cb3c9720e59a78ddf2e5e6e829c70bac6
[ "MIT" ]
1
2019-11-18T02:10:51.000Z
2019-11-18T02:10:51.000Z
001-050/029-divide-two-integers.py
bbram10/leetcode-master
565f5f0cb3c9720e59a78ddf2e5e6e829c70bac6
[ "MIT" ]
54
2017-07-17T01:24:00.000Z
2022-02-06T05:28:44.000Z
""" STATEMENT Divide two integers without using multiplication, division and mod operator. CLARIFICATIONS - Do I have to handle 32-bit integer overflow? Yes, return the MAX_INT in that case. - Can the divisor be zero? Yes, return the MAX_INT. EXAMPLES 34/3 -> 11 COMMENTS - This solution is by tusizi in Leetcode (picked up from https://discuss.leetcode.com/topic/8714/clear-python-code) """ def divide(dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int """ sign = (dividend < 0) is (divisor < 0) dividend, divisor = abs(dividend), abs(divisor) INT_MIN, INT_MAX = -2147483648, 2147483647 if (not divisor) or (dividend < INT_MIN and divisor == -1): return INT_MAX to_return = 0 while dividend >= divisor: temp, i = divisor, 1 while dividend >= temp: dividend -= temp to_return += i i <<= 1 temp <<= 1 if not sign: to_return = -to_return return min(max(INT_MIN, to_return), INT_MAX)
27.564103
115
0.613953
169bda8b986c99b4632a5917b8d5f92925898063
688
c
C
system/bin/mount/mount.c
tonytsangzen/micro_kernel_os
e6e2bde5c64a9e703611ab47cc07a5cb6f670840
[ "Apache-2.0" ]
null
null
null
system/bin/mount/mount.c
tonytsangzen/micro_kernel_os
e6e2bde5c64a9e703611ab47cc07a5cb6f670840
[ "Apache-2.0" ]
null
null
null
system/bin/mount/mount.c
tonytsangzen/micro_kernel_os
e6e2bde5c64a9e703611ab47cc07a5cb6f670840
[ "Apache-2.0" ]
null
null
null
#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <syscall.h> #include <string.h> #include <fsinfo.h> static const char* get_cmd(char* cmd) { char* p = cmd; while(*p != 0) { if(*p == ' ') { *p = 0; break; } p++; } return cmd; } int main(int argc, char* argv[]) { (void)argc; (void)argv; printf(" MOUNT_POINT PID DRIVER\n"); int32_t i; for(i=0; i<FS_MOUNT_MAX; i++) { mount_t mnt; if(syscall2(SYS_VFS_GET_MOUNT_BY_ID, i, (int32_t)&mnt) != 0) continue; char cmd[128]; syscall3(SYS_PROC_GET_CMD, mnt.pid, (int32_t)cmd, 127); printf(" %24s %6d %s\n", mnt.org_name, mnt.pid, get_cmd(cmd)); } return 0; }
17.2
62
0.585756
beee27ab1140849d61f445ef2d6a3b859a3d7a7b
946
html
HTML
dhostCheckbox/public_html/index.html
a970032/dhost
5230aac9919f55d61e773c52622f6060d1b80e2f
[ "MIT" ]
null
null
null
dhostCheckbox/public_html/index.html
a970032/dhost
5230aac9919f55d61e773c52622f6060d1b80e2f
[ "MIT" ]
null
null
null
dhostCheckbox/public_html/index.html
a970032/dhost
5230aac9919f55d61e773c52622f6060d1b80e2f
[ "MIT" ]
null
null
null
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="//code.jquery.com/jquery-1.12.0.min.js"></script> <script src="dhostCheckbox/dhostCheckbox.js" type="text/javascript"></script> <link href="dhostCheckbox/dhostCheckbox.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(document).ready(function(){ $('#checkbox').dhostCheckbox({ 'checkedClass':'checked' }); }); </script> </head> <body> <div id="checkbox" data-value="1" class="checkbox"></div> </body> </html>
35.037037
88
0.593023
e98949fd7d1e7baece51f6eead4c47c32cff0699
225
swift
Swift
ios/Classes/data/AddressType.swift
BaseflowIT/flutter-contacts
2708c56e4e5300e8912fcb035ef8791f2fb82ffc
[ "MIT" ]
32
2018-08-31T08:55:27.000Z
2019-08-22T08:07:30.000Z
ios/Classes/data/AddressType.swift
BaseflowIT/flutter-contacts
2708c56e4e5300e8912fcb035ef8791f2fb82ffc
[ "MIT" ]
12
2018-09-17T01:34:23.000Z
2019-09-20T01:30:29.000Z
ios/Classes/data/AddressType.swift
BaseflowIT/flutter-contacts-plugin
2708c56e4e5300e8912fcb035ef8791f2fb82ffc
[ "MIT" ]
13
2018-09-25T13:18:51.000Z
2019-10-05T10:18:40.000Z
// // AddressType.swift // contacts // // Created by Maurits van Beusekom on 28/08/2018. // import Foundation enum AddressType : String, Codable { case home = "home" case work = "work" case other = "other" }
15
50
0.635556
bf105b8958e937ab72c5a75ab378a308f5082f37
2,343
lua
Lua
Modules/LootIcons.lua
Mythos/ElvUI_ChatTweaks
7ade93bfe63807d4eec7315a4192f938099af49a
[ "MIT" ]
null
null
null
Modules/LootIcons.lua
Mythos/ElvUI_ChatTweaks
7ade93bfe63807d4eec7315a4192f938099af49a
[ "MIT" ]
null
null
null
Modules/LootIcons.lua
Mythos/ElvUI_ChatTweaks
7ade93bfe63807d4eec7315a4192f938099af49a
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------- -- ElvUI Chat Tweaks By Crackpotx (US, Lightbringer) -- Based on functionality provided by Prat and/or Chatter ------------------------------------------------------------------------------- local Module = ElvUI_ChatTweaks:NewModule("Loot Icons", "AceConsole-3.0") local L = LibStub("AceLocale-3.0"):GetLocale("ElvUI_ChatTweaks", false) Module.name = L["Loot Icons"] Module.namespace = string.gsub(Module.name, " ", "") local GetItemIcon = _G["GetItemIcon"] local ChatFrame_AddMessageEventFilter = _G["ChatFrame_AddMessageEventFilter"] local ChatFrame_RemoveMessageEventFilter = _G["ChatFrame_RemoveMessageEventFilter"] local db, options local defaults = { global = { orientation = "left", size = 12, } } local function AddLootIcons(self, event, message, ...) local function IconForLink(link) local texture = GetItemIcon(link) return (db.orientation == "left") and "\124T" .. texture .. ":" .. db.size .. "\124t" .. link or link .. "\124T" .. texture .. ":" .. db.size .. "\124t" end message = message:gsub("(\124c%x+\124Hitem:.-\124h\124r)", IconForLink) return false, message, ... end function Module:OnEnable() ChatFrame_AddMessageEventFilter("CHAT_MSG_LOOT", AddLootIcons) end function Module:OnDisable() ChatFrame_RemoveMessageEventFilter("CHAT_MSG_LOOT", AddLootIcons) end function Module:OnInitialize() self.db = ElvUI_ChatTweaks.db:RegisterNamespace(Module.namespace, defaults) db = self.db.global self.debug = ElvUI_ChatTweaks.db.global.debugging end function Module:GetOptions() if not options then options = { orientation = { type = "select", order = 13, name = L["Icon Orientation"], desc = L["Icon to the left or right of the item link."], values = { ["left"] = L["Left"], ["right"] = L["Right"], }, get = function() return db.orientation end, set = function(_, value) db.orientation = value end, }, size = { type = "range", order = 14, name = L["Icon Size"], desc = L["The size of the icon in the chat frame."], get = function() return db.size end, set = function(_, value) db.size = value end, min = 8, max = 32, step = 1, }, } end return options end function Module:Info() return L["Add item icons to loot received messages."] end
30.828947
154
0.63679
6571250e8d9a31917ba9ebb87ec811f9f5cc107c
249
swift
Swift
POP Flix/POP Flix/View/Cell Movie Collection/Collection/MovieListSectionCollectionView.swift
renefx/POP-Flix
f1b45929eea37d091c97887fdc93657753321447
[ "MIT" ]
1
2020-01-08T15:32:10.000Z
2020-01-08T15:32:10.000Z
POP Flix/POP Flix/View/Cell Movie Collection/Collection/MovieListSectionCollectionView.swift
renefx/POP-Flix
f1b45929eea37d091c97887fdc93657753321447
[ "MIT" ]
null
null
null
POP Flix/POP Flix/View/Cell Movie Collection/Collection/MovieListSectionCollectionView.swift
renefx/POP-Flix
f1b45929eea37d091c97887fdc93657753321447
[ "MIT" ]
null
null
null
// // MovieListSectionCollectionView.swift // POP Flix // // Created by Renê Xavier on 24/03/19. // Copyright © 2019 Renefx. All rights reserved. // import UIKit class MovieListSectionCollectionView: UICollectionView { var section: Int? }
17.785714
56
0.722892
851604c78d5c9db52fdf9f61a50b7bf9eb46a99e
542
rs
Rust
rootfm-core/src/reverb/all_pass.rs
Kintaro/rootfm
0c535d8c108a94bae144d6d146778f93bb4626e4
[ "MIT" ]
19
2019-09-30T18:31:49.000Z
2022-02-04T18:49:03.000Z
rootfm-core/src/reverb/all_pass.rs
Kintaro/rootfm
0c535d8c108a94bae144d6d146778f93bb4626e4
[ "MIT" ]
null
null
null
rootfm-core/src/reverb/all_pass.rs
Kintaro/rootfm
0c535d8c108a94bae144d6d146778f93bb4626e4
[ "MIT" ]
1
2020-05-08T01:45:26.000Z
2020-05-08T01:45:26.000Z
use super::delay_line::DelayLine; #[derive(Copy, Clone, Debug)] pub struct AllPass { gain: f32, delay: DelayLine, } impl AllPass { pub fn new(delay: f32, gain: f32) -> AllPass { AllPass { gain, delay: DelayLine::new(delay), } } pub fn compute(&mut self, sample: f32) -> f32 { let delay = self.delay.read_delay(); let filter = sample + (self.gain * delay); let out = -self.gain * filter + delay; self.delay.write_delay(filter); out } }
21.68
51
0.549815
2ea9301715810dd0b3d77b96ecdba79b34cab48a
1,254
asm
Assembly
src/test/ref/address-of-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/ref/address-of-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/ref/address-of-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Test address-of - pass the pointer as parameter // Commodore 64 PRG executable file .file [name="address-of-1.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .segment Code main: { .label SCREEN = $400 .label b1 = 4 .label b2 = 5 .label b3 = 6 // byte b1 = 0 lda #0 sta.z b1 // byte b2 = 0 sta.z b2 // byte b3 = 0 sta.z b3 // setByte(&b1, 'c') lda #<b1 sta.z setByte.ptr lda #>b1 sta.z setByte.ptr+1 ldx #'c' jsr setByte // setByte(&b2, 'm') lda #<b2 sta.z setByte.ptr lda #>b2 sta.z setByte.ptr+1 ldx #'m' jsr setByte // setByte(&b3, 'l') lda #<b3 sta.z setByte.ptr lda #>b3 sta.z setByte.ptr+1 ldx #'l' jsr setByte // SCREEN[0] = b1 lda.z b1 sta SCREEN // SCREEN[1] = b2 lda.z b2 sta SCREEN+1 // SCREEN[2] = b3 lda.z b3 sta SCREEN+2 // } rts } // void setByte(__zp(2) char *ptr, __register(X) char b) setByte: { .label ptr = 2 // *ptr = b txa ldy #0 sta (ptr),y // } rts }
19
63
0.547847
6b766c98624229ce9c9f09af8b9095d4eff815e7
519
h
C
Plot/SpaceBackGround/Solar/SunModel.h
MJYCo-Ltd/Map
48ccc120a3c2cd3080fb046da72c7588b1faebc0
[ "MIT" ]
7
2021-11-25T02:12:09.000Z
2022-03-20T12:48:18.000Z
Plot/SpaceBackGround/Solar/SunModel.h
MJYCo-Ltd/Map
48ccc120a3c2cd3080fb046da72c7588b1faebc0
[ "MIT" ]
1
2022-03-25T20:47:21.000Z
2022-03-29T02:02:44.000Z
Plot/SpaceBackGround/Solar/SunModel.h
MJYCo-Ltd/Map
48ccc120a3c2cd3080fb046da72c7588b1faebc0
[ "MIT" ]
2
2021-12-07T06:22:47.000Z
2021-12-30T05:54:04.000Z
#ifndef SUNMODEL_H #define SUNMODEL_H #include <osg/Camera> #include <osg/MatrixTransform> #include <Math/Vector.h> class CSunModel:public osg::MatrixTransform { public: CSunModel(); /** * @brief 更新行星位置 * @param rPos */ void UpdatePostion(const Math::CVector& rPos); void SetMatrix(const osg::Matrix& rMatrix); private: bool m_bNeedUpdate; /// 是否需要更新 osg::Vec3 m_rECIPostion; /// 太阳的位置 osg::ref_ptr<osg::Camera> m_pTrans; }; #endif // SUNMODEL_H
19.222222
50
0.639692
332bc827b9397befa3b3df403d9170657a773ac3
2,372
py
Python
Cura/Cura/plugins/VersionUpgrade/VersionUpgrade34to35/__init__.py
TIAO-JI-FU/3d-printing-with-moveo-1
100ecfd1208fe1890f8bada946145d716b2298eb
[ "MIT" ]
null
null
null
Cura/Cura/plugins/VersionUpgrade/VersionUpgrade34to35/__init__.py
TIAO-JI-FU/3d-printing-with-moveo-1
100ecfd1208fe1890f8bada946145d716b2298eb
[ "MIT" ]
null
null
null
Cura/Cura/plugins/VersionUpgrade/VersionUpgrade34to35/__init__.py
TIAO-JI-FU/3d-printing-with-moveo-1
100ecfd1208fe1890f8bada946145d716b2298eb
[ "MIT" ]
null
null
null
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Any, Dict, TYPE_CHECKING from . import VersionUpgrade34to35 if TYPE_CHECKING: from UM.Application import Application upgrade = VersionUpgrade34to35.VersionUpgrade34to35() def getMetaData() -> Dict[str, Any]: return { "version_upgrade": { # From To Upgrade function ("preferences", 6000004): ("preferences", 6000005, upgrade.upgradePreferences), ("definition_changes", 4000004): ("definition_changes", 4000005, upgrade.upgradeInstanceContainer), ("quality_changes", 4000004): ("quality_changes", 4000005, upgrade.upgradeInstanceContainer), ("quality", 4000004): ("quality", 4000005, upgrade.upgradeInstanceContainer), ("user", 4000004): ("user", 4000005, upgrade.upgradeInstanceContainer), ("machine_stack", 4000004): ("machine_stack", 4000005, upgrade.upgradeStack), ("extruder_train", 4000004): ("extruder_train", 4000005, upgrade.upgradeStack), }, "sources": { "preferences": { "get_version": upgrade.getCfgVersion, "location": {"."} }, "machine_stack": { "get_version": upgrade.getCfgVersion, "location": {"./machine_instances"} }, "extruder_train": { "get_version": upgrade.getCfgVersion, "location": {"./extruders"} }, "definition_changes": { "get_version": upgrade.getCfgVersion, "location": {"./definition_changes"} }, "quality_changes": { "get_version": upgrade.getCfgVersion, "location": {"./quality_changes"} }, "quality": { "get_version": upgrade.getCfgVersion, "location": {"./quality"} }, "user": { "get_version": upgrade.getCfgVersion, "location": {"./user"} } } } def register(app: "Application") -> Dict[str, Any]: return { "version_upgrade": upgrade }
38.258065
111
0.52403
cb389f106599096449c539c6946e42118f12efb3
5,578
c
C
src/dxf_dim.c
zYg-sys/CadZinho
7bc80b6d0a1174882e80a4aef0de31bdebc74369
[ "MIT" ]
1
2021-11-15T21:03:53.000Z
2021-11-15T21:03:53.000Z
src/dxf_dim.c
zYg-sys/CadZinho
7bc80b6d0a1174882e80a4aef0de31bdebc74369
[ "MIT" ]
1
2021-11-24T09:03:18.000Z
2021-11-24T09:03:18.000Z
src/dxf_dim.c
zYg-sys/CadZinho
7bc80b6d0a1174882e80a4aef0de31bdebc74369
[ "MIT" ]
null
null
null
#include "dxf_dim.h" list_node * dxf_dim_linear_make(dxf_drawing *drawing, dxf_node * ent, double length, double scale, double an_scale, int an_format, int term_type, int tol_type, double tol_up, double tol_low) { if(!ent) return NULL; if (ent->type != DXF_ENT) return NULL; if (!ent->obj.content) return NULL; if (strcmp(ent->obj.name, "DIMENSION") != 0) return NULL; dxf_node *current = NULL, *nxt_atr = NULL, *nxt_ent = NULL, *vertex = NULL; graph_obj *curr_graph = NULL; double base_pt[3] = {0.0, 0.0, 0.0}; /* dim base point */ double an_pt[3] = {0.0, 0.0, 0.0}; /* annotation point */ /* two placement points - "measure" */ double pt0[3] = {0.0, 0.0, 0.0}; double pt1[3] = {0.0, 0.0, 0.0}; double rot = 0.0; /* dimension rotation */ int flags = 32; int an_place = 5; /* annotation placement (5 = middle center) */ dxf_node * measure = NULL; char tmp_str[21]; current = ent->obj.content->next; /* get DIMENSION parameters */ while (current){ if (current->type == DXF_ATTR){ /* DXF attibute */ switch (current->value.group){ /* dim base point */ case 10: base_pt[0] = current->value.d_data; break; case 20: base_pt[1] = current->value.d_data; break; case 30: base_pt[2] = current->value.d_data; break; /* annotation point */ case 11: an_pt[0] = current->value.d_data; break; case 21: an_pt[1] = current->value.d_data; break; case 31: an_pt[2] = current->value.d_data; break; /* two placement points - "measure" */ case 13: pt0[0] = current->value.d_data; break; case 23: pt0[1] = current->value.d_data; break; case 33: pt0[2] = current->value.d_data; break; case 14: pt1[0] = current->value.d_data; break; case 24: pt1[1] = current->value.d_data; break; case 34: pt1[2] = current->value.d_data; break; /* flags*/ case 70: flags = current->value.i_data; break; /* annotation placement */ case 71: an_place = current->value.i_data; break; /* measure */ case 42: measure = current; break; /* rotation - angle in degrees */ case 50: rot = current->value.d_data; break; case 101: strncpy(tmp_str, current->value.s_data, 20); str_upp(tmp_str); char *tmp = trimwhitespace(tmp_str); if (strcmp (tmp, "EMBEDDED OBJECT") == 0 ){ current = NULL; continue; } } } current = current->next; /* go to the next in the list */ } if ((flags & 7) > 1) return NULL; /* verify type of dimension - linear dimension */ double cosine = cos(rot*M_PI/180.0); double sine = sin(rot*M_PI/180.0); double dir = 1.0; list_node * list = list_new(NULL, FRAME_LIFE); //list_push(list, list_new((void *)curr_graph, FRAME_LIFE)); /* store entity in list */ //dxf_edit_scale (dxf_node * obj, double scale_x, double scale_y, double scale_z) /* base line */ dxf_node * obj = dxf_new_line (0.0, 0.0, 0.0, -length, 0.0, 0.0, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_rot (obj, rot); dxf_edit_move (obj, base_pt[0], base_pt[1], base_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ /* terminators */ dir = (length > 0.0) ? 1.0 : -1.0; obj = dxf_new_line (0.0, 0.0, 0.0, -scale*dir, scale*0.25, 0.0, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_rot (obj, rot); dxf_edit_move (obj, base_pt[0], base_pt[1], base_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ obj = dxf_new_line (0.0, 0.0, 0.0, -scale*dir, -scale*0.25, 0.0, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_rot (obj, rot); dxf_edit_move (obj, base_pt[0], base_pt[1], base_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ obj = dxf_new_line (-length, 0.0, 0.0, scale*dir-length, scale*0.25, 0.0, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_rot (obj, rot); dxf_edit_move (obj, base_pt[0], base_pt[1], base_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ obj = dxf_new_line (-length, 0.0, 0.0, scale*dir-length, -scale*0.25, 0.0, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_rot (obj, rot); dxf_edit_move (obj, base_pt[0], base_pt[1], base_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ /* anotation */ snprintf (tmp_str, 20, "%f", fabs(length) * an_scale); obj = dxf_new_mtext (0.0, 0.0, 0.0, 1.0, (char*[]){tmp_str}, 1, 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_attr_change(obj, 71, &an_place); dxf_edit_scale (obj, scale, scale, scale); dxf_edit_rot (obj, rot); dxf_edit_move (obj, an_pt[0], an_pt[1], an_pt[2]); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ /* extension lines */ dir = ((-sine*(base_pt[0] - pt1[0])+ cosine*(base_pt[1] - pt1[1])) > 0.0) ? 1.0 : -1.0; obj = dxf_new_line (base_pt[0], base_pt[1], base_pt[2], pt1[0], pt1[1], pt1[2], 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_move (obj, -scale * sine * 0.5 * dir, scale * cosine * 0.5 * dir, 0.0); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ obj = dxf_new_line (base_pt[0] - cosine * length, base_pt[1] - sine * length, base_pt[2], pt0[0], pt0[1], pt0[2], 0, "0", "BYBLOCK", -2, 0, FRAME_LIFE); dxf_edit_move (obj, -scale * sine * 0.5 * dir, scale * cosine * 0.5 * dir, 0.0); list_push(list, list_new((void *)obj, FRAME_LIFE)); /* store entity in list */ return list; }
33.005917
119
0.611868
da2c996aa6d2b8f0cabcb3b5495c7d4f8c0486e6
808
sql
SQL
coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/RELEASE-SCRIPTS/KC-RELEASE-4_0-SCRIPT/oracle/dml/KR_DML_01_KCCOI-107_B000.sql
smith750/kc
e411ed1a4f538a600e04f964a2ba347f5695837e
[ "ECL-2.0" ]
null
null
null
coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/RELEASE-SCRIPTS/KC-RELEASE-4_0-SCRIPT/oracle/dml/KR_DML_01_KCCOI-107_B000.sql
smith750/kc
e411ed1a4f538a600e04f964a2ba347f5695837e
[ "ECL-2.0" ]
null
null
null
coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/RELEASE-SCRIPTS/KC-RELEASE-4_0-SCRIPT/oracle/dml/KR_DML_01_KCCOI-107_B000.sql
smith750/kc
e411ed1a4f538a600e04f964a2ba347f5695837e
[ "ECL-2.0" ]
null
null
null
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR) VALUES ('Y','COI Reporter',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'Default'),sysdate,'KC-COIDISCLOSURE',SYS_GUID(),KRIM_ROLE_ID_BS_S.NEXTVAL,'COI Reporter',1) / INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR) VALUES (KRIM_PERM_ID_BS_S.NEXTVAL,(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Edit Document Section'),'KC-COIDISCLOSURE','Report Coi Disclosure','Report Coi Disclosure','Y',SYS_GUID(),1) / INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR) VALUES (KRIM_ROLE_PERM_ID_BS_S.NEXTVAL,KRIM_ROLE_ID_BS_S.CURRVAL,KRIM_PERM_ID_BS_S.CURRVAL,'Y',SYS_GUID(),1) /
73.454545
167
0.792079
6f646964d0cf9c27cdf4e4900855ff5fdc28eb9f
5,457
kt
Kotlin
app/src/main/java/top/jowanxu/wanandroidclient/presenter/HomePresenter.kt
fyhtosky/WanAndroidClient
2e4b9fd04da815093b9f68372b7cf552c5d6247e
[ "Apache-2.0" ]
null
null
null
app/src/main/java/top/jowanxu/wanandroidclient/presenter/HomePresenter.kt
fyhtosky/WanAndroidClient
2e4b9fd04da815093b9f68372b7cf552c5d6247e
[ "Apache-2.0" ]
null
null
null
app/src/main/java/top/jowanxu/wanandroidclient/presenter/HomePresenter.kt
fyhtosky/WanAndroidClient
2e4b9fd04da815093b9f68372b7cf552c5d6247e
[ "Apache-2.0" ]
null
null
null
package top.jowanxu.wanandroidclient.presenter import top.jowanxu.wanandroidclient.bean.* /** * 首页Presenter接口 */ interface HomePresenter { /** * get home list interface */ interface OnHomeListListener { /** * get home list * @param page page */ fun getHomeList(page: Int = 0) /** * get home list success * @param result result */ fun getHomeListSuccess(result: HomeListResponse) /** * get home list failed * @param errorMessage error message */ fun getHomeListFailed(errorMessage: String?) } /** * get type tree list interface */ interface OnTypeTreeListListener { /** * get type tree list */ fun getTypeTreeList() /** * get type tree list success * @param result result */ fun getTypeTreeListSuccess(result: TreeListResponse) /** * get type tree list failed * @param errorMessage error message */ fun getTypeTreeListFailed(errorMessage: String?) } /** * login Listener */ interface OnLoginListener { /** * login * @param username username * @param password password */ fun loginWanAndroid(username: String, password: String) /** * login success * @param result LoginResponse */ fun loginSuccess(result: LoginResponse) /** * login failed * @param errorMessage error message */ fun loginFailed(errorMessage: String?) } /** * register Listener */ interface OnRegisterListener { /** * register * @param username username * @param password password * @param repassword repassword */ fun registerWanAndroid(username: String, password: String, repassword: String) /** * register success * @param result LoginResponse */ fun registerSuccess(result: LoginResponse) /** * register failed * @param errorMessage error message */ fun registerFailed(errorMessage: String?) } /** * get friend list interface */ interface OnFriendListListener { /** * get friend tree list */ fun getFriendList() /** * get friend list success */ fun getFriendListSuccess(bookmarkResult: FriendListResponse?, commonResult: FriendListResponse, hotResult: HotKeyResponse) /** * get friend list failed * @param errorMessage error message */ fun getFriendListFailed(errorMessage: String?) } /** * collect article listener */ interface OnCollectArticleListener { /** * add or remove collect article * @param id article id * @param isAdd true add, false remove */ fun collectArticle(id: Int, isAdd: Boolean) /** * add collect article success * @param result HomeListResponse * @param isAdd true add, false remove */ fun collectArticleSuccess(result: HomeListResponse, isAdd: Boolean) /** * add collect article failed * @param errorMessage error message * @param isAdd true add, false remove */ fun collectArticleFailed(errorMessage: String?, isAdd: Boolean) } /** * collect outside article listener */ interface OnCollectOutsideArticleListener { /** * add or remove outside collect article * @param title article title * @param author article author * @param link article link * @param isAdd true add, false remove */ fun collectOutSideArticle(title: String, author: String, link: String, isAdd: Boolean) /** * add collect outside article success * @param result HomeListResponse * @param isAdd true add, false remove */ fun collectOutsideArticleSuccess(result: HomeListResponse, isAdd: Boolean) /** * add collect outside article failed * @param errorMessage error message * @param isAdd true add, false remove */ fun collectOutsideArticleFailed(errorMessage: String?, isAdd: Boolean) } /** * get banner listener */ interface OnBannerListener { /** * get banner */ fun getBanner() /** * get banner success * @param result BannerResponse */ fun getBannerSuccess(result: BannerResponse) /** * get banner failed * @param errorMessage error message */ fun getBannerFailed(errorMessage: String?) } /** * get friend list interface */ interface OnBookmarkListListener { /** * get friend tree list */ fun getFriendList() /** * get friend list success * @param result result */ fun getFriendListSuccess(result: FriendListResponse) /** * get friend list failed * @param errorMessage error message */ fun getFriendListFailed(errorMessage: String?) } }
24.039648
130
0.552318
2e3bd796c8b854715409a00207215c9a84428716
24
lua
Lua
resources/words/ruy.lua
terrabythia/alfabeter
da422481ba223ebc6c4ded63fed8f75605193d44
[ "MIT" ]
null
null
null
resources/words/ruy.lua
terrabythia/alfabeter
da422481ba223ebc6c4ded63fed8f75605193d44
[ "MIT" ]
null
null
null
resources/words/ruy.lua
terrabythia/alfabeter
da422481ba223ebc6c4ded63fed8f75605193d44
[ "MIT" ]
null
null
null
return {'ruys','ruyter'}
24
24
0.666667
081ffb239adf615d6d7b50659ecba86b2ba79904
2,499
swift
Swift
Source/PIX/Effects/Single/FeedbackPIX.swift
jinjorge/pixels
065fbab8aeca99c21170619da7eef28aec0cf369
[ "MIT" ]
null
null
null
Source/PIX/Effects/Single/FeedbackPIX.swift
jinjorge/pixels
065fbab8aeca99c21170619da7eef28aec0cf369
[ "MIT" ]
null
null
null
Source/PIX/Effects/Single/FeedbackPIX.swift
jinjorge/pixels
065fbab8aeca99c21170619da7eef28aec0cf369
[ "MIT" ]
null
null
null
// // FeedbackPIX.swift // Pixels // // Created by Hexagons on 2018-08-21. // Copyright © 2018 Hexagons. All rights reserved. // import CoreGraphics import Metal public class FeedbackPIX: PIXSingleEffect, PIXofaKind { var kind: PIX.Kind = .feedback override open var shader: String { return "nilPIX" } // MARK: - Private Properties var readyToFeed: Bool = false var feedReset: Bool = false // MARK: - Public Properties var feedTexture: MTLTexture? { return feedPix?.texture } public var feedActive: Bool = true { didSet { setNeedsRender() } } public var feedPix: (PIX & PIXOut)? { didSet { if feedActive { setNeedsRender() } } } public override required init() { super.init() } override public func didRender(texture: MTLTexture, force: Bool) { super.didRender(texture: texture) if feedReset { feedActive = true feedReset = false } readyToFeed = true setNeedsRender() // switch pixels.renderMode { // case .frameLoop: // setNeedsRender() // case .direct: // pixels.delay(frames: 1, done: { // self.setNeedsRender() // }) // } } public func resetFeed() { guard feedActive else { pixels.log(pix: self, .info, .effect, "Feedback reset; feed not active.") return } feedActive = false feedReset = true setNeedsRender() } required init(from decoder: Decoder) throws { fatalError("init(from:) has not been implemented") } } public extension PIXOut { // func _feed(loop: (FeedbackPIX) -> (PIX & PIXOut)) -> FeedbackPIX { // let feedbackPix = FeedbackPIX() // feedbackPix.inPix = self as? PIX & PIXOut // feedbackPix.feedPix = loop(feedbackPix) // return feedbackPix // } func _feed(_ fraction: CGFloat, loop: ((FeedbackPIX) -> (PIX & PIXOut))? = nil) -> FeedbackPIX { let feedbackPix = FeedbackPIX() feedbackPix.name = "feed:feedback" feedbackPix.inPix = self as? PIX & PIXOut let crossPix = CrossPIX() crossPix.name = "feed:cross" crossPix.inPixA = self as? PIX & PIXOut crossPix.inPixB = loop?(feedbackPix) ?? feedbackPix crossPix.fraction = fraction feedbackPix.feedPix = crossPix return feedbackPix } }
26.870968
100
0.578631
cbed2192a4eefd3eae333efea45734f4e3de9360
324
go
Go
src/cache/TCache.Get.go
Qithub-BOT/QiiTrans
9eb2a3045873c1c041f89b6f49af8aa287b8d31e
[ "MIT" ]
11
2021-07-02T23:55:08.000Z
2022-01-19T03:22:58.000Z
src/cache/TCache.Get.go
Qithub-BOT/QiiTrans
9eb2a3045873c1c041f89b6f49af8aa287b8d31e
[ "MIT" ]
17
2021-07-03T02:40:43.000Z
2022-02-08T03:38:36.000Z
src/cache/TCache.Get.go
Qithub-BOT/QiiTrans
9eb2a3045873c1c041f89b6f49af8aa287b8d31e
[ "MIT" ]
null
null
null
package cache // Get はキャッシュから key を探索し、その値を文字列で返します. // キャッシュに key がない場合はエラーを返します. func (c *TCache) Get(key string) (string, error) { if err := c.OpenDB(); err != nil { return "", err } defer c.CloseDB() // key をバイトデータにハッシュ化してキャッシュからキー探索 value, err := c.GetValueInByte(c.hash64(key)) return string(value), err }
19.058824
50
0.682099
573f80e593bf367871688bf8240ae125b44f41dd
1,003
h
C
kernel/cxx_support.h
skordal/wagtail
0acea8c530f58c5f87db8add26e5a37e4eeb2e43
[ "BSD-3-Clause" ]
null
null
null
kernel/cxx_support.h
skordal/wagtail
0acea8c530f58c5f87db8add26e5a37e4eeb2e43
[ "BSD-3-Clause" ]
null
null
null
kernel/cxx_support.h
skordal/wagtail
0acea8c530f58c5f87db8add26e5a37e4eeb2e43
[ "BSD-3-Clause" ]
1
2019-09-10T16:06:14.000Z
2019-09-10T16:06:14.000Z
// Wagtail OS // (c) Kristian Klomsten Skordal 2012 <kristian.skordal@gmail.com> // Report bugs and issues on <http://github.com/skordal/wagtail> #ifndef WAGTAIL_CXX_SUPPORT_H #define WAGTAIL_CXX_SUPPORT_H #include "kernel.h" /** Function required to use pure virtual methods. */ extern "C" void __cxa_pure_virtual(); /** * Memory copying function. This is sometimes emitted by the compiler when * default constructors are constructed. * @param dest destination. * @param src source. * @param n size of the area to copy. * @return a pointer to the destination. */ extern "C" void * memcpy(void * dest, void * src, unsigned int n); /** * Memory fill function. This is sometimes emitted by the compiler when * default constructors are construced. * @param s start of the area to fill. * @param c the byte to fill the area with. * @param n the size of the area to fill. * @return a pointer to the destination area. */ extern "C" void * memset(void * d, char c, unsigned int n); #endif
28.657143
74
0.718843
9ba87d2c2084e054cafceac174d455ccfc0ef12a
2,582
js
JavaScript
src/components/Button.js
concurrent-studio/just---design.com
3b8f55d681edb5d3bc136ffd063a994642587ec8
[ "MIT" ]
1
2021-01-29T01:39:53.000Z
2021-01-29T01:39:53.000Z
src/components/Button.js
concurrent-studio/just---design.com
3b8f55d681edb5d3bc136ffd063a994642587ec8
[ "MIT" ]
null
null
null
src/components/Button.js
concurrent-studio/just---design.com
3b8f55d681edb5d3bc136ffd063a994642587ec8
[ "MIT" ]
null
null
null
import React from "react"; import Emoji from "./Emoji.js"; import "../sass/button.component.sass" export default class Button extends React.Component { constructor(props) { super(props); this.state = { href: null } } async instagram(link) { if (navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) { if (link.includes("instagram.com/p/")) { let response = await fetch("https://api.instagram.com/oembed/?url=" + link); if (response.status === 200) { let result = await response.json(); return "instagram://media?id=" + result["media_id"] } else { return link } } else if (link.includes("instagram.com/")) { let pathname = new URL(link).pathname.split("/")[1]; return "instagram://user?username=" + pathname; } } else return link; } componentDidMount() { this.setState({ href: this.props.href }) if (this.props.href) { if (this.props.href.toLowerCase().includes("instagram")) { this.instagram(this.props.href).then((result) => this.setState({ href: result })) } } } render() { let ThisButton = ( <span> <a className="gradient-button" rel="noreferrer" target="_blank" href={this.state.href}> {this.props.text} <Emoji name={this.props.emoji_name} emoji={this.props.emoji}/>&nbsp; <span style={{fontFamily: "OfficeCodeProDMedium"}}>→</span> </a> <br/> </span> ) if (this.props.newtab === false) { ThisButton = ( <span> <a className="gradient-button" href={this.state.href}> {this.props.text} <Emoji name={this.props.emoji_name} emoji={this.props.emoji}/>&nbsp; <span style={{fontFamily: "OfficeCodeProDMedium"}}>→</span> </a> <br/> </span> ) } return ( <span> <a className="gradient-button" href={this.state.href}> {this.props.text} <Emoji name={this.props.emoji_name} emoji={this.props.emoji}/>&nbsp; <span style={{fontFamily: "OfficeCodeProDMedium"}}>→</span> </a> <br/> </span> ); } }
35.369863
110
0.481022
5abd0e60b6d6a75449eb3f14110cf16aa0c67a3f
1,286
rs
Rust
tests/jacobian/non_linear.rs
Nateckert/newton_rootfinder
e51d517b1add8e4cd81110018ca52298079bd4fb
[ "Apache-2.0", "MIT" ]
6
2020-06-19T16:12:20.000Z
2022-02-27T22:15:50.000Z
tests/jacobian/non_linear.rs
Nateckert/newton_rootfinder
e51d517b1add8e4cd81110018ca52298079bd4fb
[ "Apache-2.0", "MIT" ]
8
2020-06-05T08:52:42.000Z
2021-11-16T20:21:31.000Z
tests/jacobian/non_linear.rs
Nateckert/newton_rootfinder
e51d517b1add8e4cd81110018ca52298079bd4fb
[ "Apache-2.0", "MIT" ]
1
2022-03-10T05:35:16.000Z
2022-03-10T05:35:16.000Z
extern crate nalgebra; extern crate newton_rootfinder; use newton_rootfinder as nrf; use nrf::model::Model; use nrf::residuals; use nrf::solver::jacobian_evaluation; pub fn non_linear(inputs: &nalgebra::DVector<f64>) -> nalgebra::DVector<f64> { let mut outputs = nalgebra::DVector::zeros(2); outputs[0] = inputs[0] + 4.0 * inputs[1]; outputs[1] = inputs[0] * inputs[1]; outputs } #[test] fn jacobian_evaluation_non_linear() { let problem_size = 2; let mut user_model = nrf::model::UserModelFromFunction::new(problem_size, non_linear); let inputs = nalgebra::DVector::from_vec(vec![1.0, 2.0]); user_model.set_iteratives(&inputs); user_model.evaluate(); let stopping_residuals = vec![residuals::NormalizationMethod::Abs; problem_size]; let update_residuals = stopping_residuals.clone(); let res_config = residuals::ResidualsConfig::new(&stopping_residuals, &update_residuals); let perturbations = nalgebra::DVector::from_vec(vec![0.0001; problem_size]); let jac = jacobian_evaluation(&mut user_model, &perturbations, &res_config); assert_eq!(jac[(0, 0)], 0.9999999999976694); assert_eq!(jac[(0, 1)], 4.000000000008441); assert_eq!(jac[(1, 0)], 1.9999999999997797); assert_eq!(jac[(1, 1)], 1.0000000000021103); }
37.823529
93
0.709953
bdfbbb2c80b02c3507481fd13ea96922657963b1
1,365
rs
Rust
src/alerts.rs
apognu/unified
5275e9050a400daf1ecc5d970aac3475c5b4faf4
[ "MIT" ]
null
null
null
src/alerts.rs
apognu/unified
5275e9050a400daf1ecc5d970aac3475c5b4faf4
[ "MIT" ]
null
null
null
src/alerts.rs
apognu/unified
5275e9050a400daf1ecc5d970aac3475c5b4faf4
[ "MIT" ]
null
null
null
use chrono::NaiveDateTime; use reqwest::Method; use serde::Deserialize; use crate::{http::ApiV1, Unified, UnifiedError}; #[derive(Debug)] pub struct Alert { pub time: NaiveDateTime, pub subsystem: String, pub device: Option<String>, pub message: String, pub archived: bool, } #[derive(Deserialize)] struct RemoteAlert { time: i64, subsystem: String, sw_name: Option<String>, ap_name: Option<String>, gw_name: Option<String>, #[serde(rename = "msg")] message: String, archived: bool, } impl Unified { /// List important alerts regarding the network. pub async fn alerts(&self, site: &str, limit: Option<u64>) -> Result<Vec<Alert>, UnifiedError> { let url = match limit { Some(limit) => format!("/api/s/{}/stat/alarm?_limit={}", site, limit), None => format!("/api/s/{}/stat/alarm", site), }; let response = self.request::<ApiV1<Vec<RemoteAlert>>>(Method::GET, &url).query().await?; let events = response .into_iter() .map(|alert| { let device = alert.sw_name.or(alert.ap_name).or(alert.gw_name); Alert { time: NaiveDateTime::from_timestamp(alert.time / 1000, 0), device, subsystem: alert.subsystem.to_uppercase(), message: alert.message, archived: alert.archived, } }) .collect(); Ok(events) } }
24.375
98
0.625641
dde2ed7a2be523b85ef5d53d56618aa731d519bb
1,775
kt
Kotlin
app/src/androidTest/java/com/waryozh/simplestepcounter/ResetStepsDialogTest.kt
Waryozh/simple-step-counter
9c1d619d51c2fcdc5f041ea3a84a6ed36771a4d1
[ "MIT" ]
null
null
null
app/src/androidTest/java/com/waryozh/simplestepcounter/ResetStepsDialogTest.kt
Waryozh/simple-step-counter
9c1d619d51c2fcdc5f041ea3a84a6ed36771a4d1
[ "MIT" ]
null
null
null
app/src/androidTest/java/com/waryozh/simplestepcounter/ResetStepsDialogTest.kt
Waryozh/simple-step-counter
9c1d619d51c2fcdc5f041ea3a84a6ed36771a4d1
[ "MIT" ]
null
null
null
package com.waryozh.simplestepcounter import androidx.test.espresso.Espresso import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class ResetStepsDialogTest : MainActivityBaseTest() { @Before fun initResetStepsDialogTest() { setStepsCorrection(1000) runBlocking { repository.setStepLength(70) repository.setStepsTaken(2000) } onView(withId(R.id.tv_steps_taken)).check(matches(withText("1000"))) onView(withId(R.id.tv_distance_walked)).check(matches(withText("700"))) Espresso.openActionBarOverflowOrOptionsMenu(applicationContext) onView(withText(R.string.menu_reset_steps)).perform(click()) } @Test fun cancelDialog() { onView(withText(R.string.cancel)).perform(click()) onView(withId(R.id.tv_steps_taken)).check(matches(withText("1000"))) onView(withId(R.id.tv_distance_walked)).check(matches(withText("700"))) assertEquals(70, repository.getStepLength()) } @Test fun confirmDialog() { onView(withText(R.string.reset)).perform(click()) onView(withId(R.id.tv_steps_taken)).check(matches(withText("0"))) onView(withId(R.id.tv_distance_walked)).check(matches(withText("0"))) assertEquals(70, repository.getStepLength()) } }
36.22449
79
0.733521
095acb52756f03b05f6ebf3a6fd3b07f1ca39dee
1,849
swift
Swift
NuguCore/Sources/PlaySync/PlaySyncInfo.swift
jin-marino/nugu-ios
daf4fa204a18cfae997504a9dd9bc8cd7d880d41
[ "Apache-2.0" ]
18
2019-10-28T04:48:54.000Z
2021-12-20T07:18:30.000Z
NuguCore/Sources/PlaySync/PlaySyncInfo.swift
jin-marino/nugu-ios
daf4fa204a18cfae997504a9dd9bc8cd7d880d41
[ "Apache-2.0" ]
353
2019-10-23T11:41:03.000Z
2021-12-15T09:34:33.000Z
NuguCore/Sources/PlaySync/PlaySyncInfo.swift
jin-marino/nugu-ios
daf4fa204a18cfae997504a9dd9bc8cd7d880d41
[ "Apache-2.0" ]
23
2019-10-23T04:18:11.000Z
2022-01-19T12:35:56.000Z
// // PlaySyncInfo.swift // NuguCore // // Created by MinChul Lee on 2019/07/16. // Copyright (c) 2019 SK Telecom Co., Ltd. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // import Foundation import NuguUtils /// <#Description#> public struct PlaySyncInfo { /// <#Description#> public let playStackServiceId: String? /// <#Description#> public let dialogRequestId: String /// <#Description#> public let messageId: String /// <#Description#> public let duration: TimeIntervallic /// <#Description#> /// - Parameters: /// - playStackServiceId: <#playStackServiceId description#> /// - dialogRequestId: <#dialogRequestId description#> /// - messageId: <#messageId description#> /// - duration: <#duration description#> public init( playStackServiceId: String?, dialogRequestId: String, messageId: String, duration: TimeIntervallic ) { self.playStackServiceId = playStackServiceId self.dialogRequestId = dialogRequestId self.messageId = messageId self.duration = duration } } // MARK: - CustomStringConvertible /// :nodoc: extension PlaySyncInfo: CustomStringConvertible { public var description: String { return playStackServiceId ?? "" } }
29.349206
76
0.672796
a6929e8f8beb72af2b1cbb81b07babede6f313a2
6,787
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_12370_73.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_12370_73.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_12370_73.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r8 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0xcf7a, %rsi lea addresses_UC_ht+0x8756, %rdi nop nop nop and %r13, %r13 mov $118, %rcx rep movsw nop nop nop sub $57065, %r10 lea addresses_UC_ht+0x16a56, %rbp add $12755, %rbx and $0xffffffffffffffc0, %rbp vmovntdqa (%rbp), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $0, %xmm6, %r10 nop nop xor $50808, %rbp lea addresses_UC_ht+0x8256, %rsi lea addresses_A_ht+0x1ceba, %rdi nop dec %r8 mov $117, %rcx rep movsq nop nop nop nop xor %rbp, %rbp lea addresses_WT_ht+0xcc56, %rbx nop nop nop nop inc %rsi movups (%rbx), %xmm1 vpextrq $1, %xmm1, %rcx nop nop and %rbx, %rbx lea addresses_D_ht+0x1ebb6, %r13 add $62392, %rbx mov (%r13), %r8w nop nop nop nop nop xor %rsi, %rsi lea addresses_normal_ht+0x8d56, %r8 nop xor $6603, %r13 movl $0x61626364, (%r8) nop nop nop nop nop add %r13, %r13 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r8 push %rax push %rbx push %rdi // Store lea addresses_A+0x12656, %r8 nop nop nop xor %rax, %rax mov $0x5152535455565758, %r15 movq %r15, %xmm6 vmovups %ymm6, (%r8) nop nop nop nop nop sub %rbx, %rbx // Load lea addresses_PSE+0x6146, %r8 nop nop nop and %rdi, %rdi mov (%r8), %r11w nop nop nop nop and $42704, %r8 // Store lea addresses_UC+0x9256, %r8 nop nop nop nop nop and $56237, %rax mov $0x5152535455565758, %r13 movq %r13, (%r8) nop nop nop and $9071, %r15 // Store lea addresses_PSE+0x1ccd6, %rax nop nop nop nop add $44788, %rdi movw $0x5152, (%rax) // Exception!!! mov (0), %rax nop nop nop nop nop inc %r13 // Load lea addresses_normal+0xa056, %r13 nop cmp %r8, %r8 mov (%r13), %edi nop nop sub $43062, %rdi // Faulty Load lea addresses_normal+0x16a56, %rax nop nop add $58359, %r15 mov (%rax), %r8d lea oracles, %rax and $0xff, %r8 shlq $12, %r8 mov (%rax,%r8,1), %r8 pop %rdi pop %rbx pop %rax pop %r8 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} {'34': 12370} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
33.269608
2,999
0.655223
9c235a416859934f3d4e1fbbda96c55cf5973ef5
187
js
JavaScript
base/Command.js
JPTheWeatherMan/Tarkov-Map-Bot
3e4c33ebb46ef8e43865e6b222063f4da82109c7
[ "MIT" ]
null
null
null
base/Command.js
JPTheWeatherMan/Tarkov-Map-Bot
3e4c33ebb46ef8e43865e6b222063f4da82109c7
[ "MIT" ]
null
null
null
base/Command.js
JPTheWeatherMan/Tarkov-Map-Bot
3e4c33ebb46ef8e43865e6b222063f4da82109c7
[ "MIT" ]
null
null
null
const path = require("path"); module.exports = class Command { constructor(client, { name = null, enabled = true }) { this.client = client; this.help = { name, description }; } };
20.777778
55
0.641711
e320da84a54ba5430c969dea04b01c330e3548bc
968
kt
Kotlin
src/main/kotlin/com/greentower/seedApi/main/client/rest/controller/ClientController.kt
gabriellmandelli/seed-springboot-kotlin
cc308a111da80533356db34b53744e914172ba9c
[ "MIT" ]
3
2020-07-13T09:35:45.000Z
2020-12-09T21:02:36.000Z
src/main/kotlin/com/greentower/seedApi/main/client/rest/controller/ClientController.kt
gabriellmandelli/seed-springboot-kotlin
cc308a111da80533356db34b53744e914172ba9c
[ "MIT" ]
1
2020-08-27T00:12:14.000Z
2020-08-27T00:12:14.000Z
src/main/kotlin/com/greentower/seedApi/main/client/rest/controller/ClientController.kt
gabriellmandelli/seed-springboot-kotlin
cc308a111da80533356db34b53744e914172ba9c
[ "MIT" ]
null
null
null
package com.greentower.seedApi.main.client.rest.controller import com.greentower.seedApi.main.client.domain.entity.Client import com.greentower.seedApi.main.client.domain.exception.ClientResponseStatusMessage import com.greentower.seedApi.main.client.service.ClientService import com.greentower.seedApi.infrastructure.generic.GenericController import com.greentower.seedApi.infrastructure.util.exception.ResponseStatusExceptionToLocate import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController @RequestMapping("/client") class ClientController() : GenericController<Client>() { override fun getResponseNotFound(): ResponseStatusExceptionToLocate { return ClientResponseStatusMessage.getResponseNotFound() } @Autowired fun setService(service: ClientService){ this.service = service } }
40.333333
91
0.829545
6b4f454553e9d2b01da0f48ed0d09c91582dae65
1,018
c
C
src/memory.c
sagalpreet/Dispatcher-Simulator
28d901f018cd1935cc6b0a64a75c5cf6e616f972
[ "MIT" ]
null
null
null
src/memory.c
sagalpreet/Dispatcher-Simulator
28d901f018cd1935cc6b0a64a75c5cf6e616f972
[ "MIT" ]
null
null
null
src/memory.c
sagalpreet/Dispatcher-Simulator
28d901f018cd1935cc6b0a64a75c5cf6e616f972
[ "MIT" ]
null
null
null
#include <stdlib.h> char* duplicate_sptr(char *source) { // deep copy a string int size = 0; for (int i = 0; ; i++) { if (source[i]) size++; else break; } char *destination = (char *) calloc(size+1, sizeof(char)); for (int i = 0; i < size; i++) destination[i] = source[i]; return destination; } char** duplicate_dptr(char **source) { // deep copy an array of strings int size = 0; for (int i = 0; ; i++) { if (source[i]) size++; else break; } char **destination = (char **) calloc(size+1, sizeof(char*)); for (int i = 0; i < size; i++) destination[i] = duplicate_sptr(source[i]); return destination; } void free_sptr(char **source) { // free the space allocated to a string free(*source); } void free_dptr(char ***source) { // free the space allocated to array of strings for (int i = 0; ; i++) { if ((*source)[i] == 0) break; free_sptr(&((*source)[i])); } free(*source); }
21.659574
78
0.544204
c4abecb520b14c6cf38483b82ce65aa18f3597a5
2,974
h
C
src/parsing/preparsed-scope-data.h
bibhuk/v8Engine
b7e94287353ccb8adf76333840a2fc7bf1d00277
[ "BSD-3-Clause" ]
null
null
null
src/parsing/preparsed-scope-data.h
bibhuk/v8Engine
b7e94287353ccb8adf76333840a2fc7bf1d00277
[ "BSD-3-Clause" ]
null
null
null
src/parsing/preparsed-scope-data.h
bibhuk/v8Engine
b7e94287353ccb8adf76333840a2fc7bf1d00277
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ #define V8_PARSING_PREPARSED_SCOPE_DATA_H_ #include <unordered_map> #include <vector> #include "src/globals.h" #include "src/objects.h" namespace v8 { namespace internal { template <typename T> class Handle; /* Skipping inner functions. Consider the following code: (function eager_outer() { function lazy_inner() { let a; function skip_me() { a; } } return lazy_inner; })(); ... lazy_inner(); ... When parsing the code the first time, eager_outer is parsed and lazy_inner (and everything inside it) is preparsed. When lazy_inner is called, we don't want to parse or preparse skip_me again. Instead, we want to skip over it, since it has already been preparsed once. In order to be able to do this, we need to store the information needed for allocating the variables in lazy_inner when we preparse it, and then later do scope allocation based on that data. We need the following data for each scope in lazy_inner's scope tree: For each Variable: - is_used - maybe_assigned - has_forced_context_allocation For each Scope: - inner_scope_calls_eval_. PreParsedScopeData implements storing and restoring the above mentioned data. */ class PreParsedScopeData { public: PreParsedScopeData() {} ~PreParsedScopeData() {} // Saves the information needed for allocating the Scope's (and its // subscopes') variables. void SaveData(Scope* scope); // Restores the information needed for allocating the Scopes's (and its // subscopes') variables. void RestoreData(Scope* scope, int* index_ptr) const; void RestoreData(DeclarationScope* scope) const; FixedUint32Array* Serialize(Isolate* isolate) const; void Deserialize(Handle<FixedUint32Array> array); bool Consuming() const { return has_data_; } bool Producing() const { return !has_data_; } bool FindFunctionEnd(int start_pos, int* end_pos) const; private: friend class ScopeTestHelper; void SaveDataForVariable(Variable* var); void RestoreDataForVariable(Variable* var, int* index_ptr) const; void SaveDataForInnerScopes(Scope* scope); void RestoreDataForInnerScopes(Scope* scope, int* index_ptr) const; bool FindFunctionData(int start_pos, int* index) const; static bool ScopeNeedsData(Scope* scope); static bool IsSkippedFunctionScope(Scope* scope); // TODO(marja): Make the backing store more efficient once we know exactly // what data is needed. std::vector<byte> backing_store_; // Start pos -> (end pos, index in data) std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> function_index_; bool has_data_ = false; DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData); }; } // namespace internal } // namespace v8 #endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_
27.537037
79
0.744452
038cff9625aed52c9b61fd26e6d4a210fb47c4c6
528
lua
Lua
tests/comments/main.lua
ExE-Boss/prettier-plugin-lua
341c05fc75d65ff92b5639d8ce8a333b8239943d
[ "MIT" ]
71
2018-04-05T08:43:06.000Z
2022-03-07T17:51:12.000Z
tests/comments/main.lua
suchipi/prettier-plugin-lua
63d45f57abe20828edda91d068fd957174bbada4
[ "MIT" ]
21
2018-04-05T04:31:12.000Z
2022-01-01T15:50:10.000Z
tests/comments/main.lua
suchipi/prettier-plugin-lua
63d45f57abe20828edda91d068fd957174bbada4
[ "MIT" ]
16
2018-06-08T18:10:51.000Z
2022-03-01T09:25:56.000Z
-- line comment in chunk dosomething() -- another line comment in chunk function Function() -- line comment in Function if --[[before if conditional]] --[[another before if conditional]] true --[[after if conditional]] then -- end of if line dooo() -- end of call in if end end function Foo() -- comment in empty function body end function --[[between function keyword and name]] Bar() end function --[==[ between function keyword and name ]==] Bar() end for k,v in pairs(t) do -- comment in empty for body end
22
123
0.6875
cb1af7895e2346ca5d054faa9ca4c28ec72b4433
3,806
h
C
ppapi/c/dev/ppb_ime_input_event_dev.h
Scopetta197/chromium
b7bf8e39baadfd9089de2ebdc0c5d982de4a9820
[ "BSD-3-Clause" ]
212
2015-01-31T11:55:58.000Z
2022-02-22T06:35:11.000Z
ppapi/c/dev/ppb_ime_input_event_dev.h
Scopetta197/chromium
b7bf8e39baadfd9089de2ebdc0c5d982de4a9820
[ "BSD-3-Clause" ]
5
2015-03-27T14:29:23.000Z
2019-09-25T13:23:12.000Z
ppapi/c/dev/ppb_ime_input_event_dev.h
Scopetta197/chromium
b7bf8e39baadfd9089de2ebdc0c5d982de4a9820
[ "BSD-3-Clause" ]
221
2015-01-07T06:21:24.000Z
2022-02-11T02:51:12.000Z
/* Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* From dev/ppb_ime_input_event_dev.idl modified Wed Oct 5 14:06:02 2011. */ #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" #include "ppapi/c/pp_var.h" #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 "PPB_IMEInputEvent(Dev);0.1" #define PPB_IME_INPUT_EVENT_DEV_INTERFACE PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 /** * @file * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface. */ /** * @addtogroup Interfaces * @{ */ struct PPB_IMEInputEvent_Dev_0_1 { /** * IsIMEInputEvent() determines if a resource is an IME event. * * @param[in] resource A <code>PP_Resource</code> corresponding to an event. * * @return <code>PP_TRUE</code> if the given resource is a valid input event. */ PP_Bool (*IsIMEInputEvent)(PP_Resource resource); /** * GetText() returns the composition text as a UTF-8 string for the given IME * event. * * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME * event. * * @return A string var representing the composition text. For non-IME input * events the return value will be an undefined var. */ struct PP_Var (*GetText)(PP_Resource ime_event); /** * GetSegmentNumber() returns the number of segments in the composition text. * * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME * event. * * @return The number of segments. For events other than COMPOSITION_UPDATE, * returns 0. */ uint32_t (*GetSegmentNumber)(PP_Resource ime_event); /** * GetSegmentOffset() returns the position of the index-th segmentation point * in the composition text. The position is given by a byte-offset (not a * character-offset) of the string returned by GetText(). It always satisfies * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range * of the i-th segment, and hence GetSegmentNumber() can be a valid argument * to this function instead of an off-by-1 error. * * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME * event. * * @param[in] index An integer indicating a segment. * * @return The byte-offset of the segmentation point. If the event is not * COMPOSITION_UPDATE or index is out of range, returns 0. */ uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); /** * GetTargetSegment() returns the index of the current target segment of * composition. * * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME * event. * * @return An integer indicating the index of the target segment. When there * is no active target segment, or the event is not COMPOSITION_UPDATE, * returns -1. */ int32_t (*GetTargetSegment)(PP_Resource ime_event); /** * GetSelection() returns the range selected by caret in the composition text. * * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME * event. * * @param[out] start The start position of the current selection. * * @param[out] end The end position of the current selection. */ void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); }; typedef struct PPB_IMEInputEvent_Dev_0_1 PPB_IMEInputEvent_Dev; /** * @} */ #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */
34.288288
80
0.712559
93abb8a5e2f9937096105427b2376da48deed9b3
948
html
HTML
manuscript/page-1460/body.html
marvindanig/de-bello-gallico
338efb85a417422b947d3ca04f5b6977ff38170f
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
manuscript/page-1460/body.html
marvindanig/de-bello-gallico
338efb85a417422b947d3ca04f5b6977ff38170f
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
manuscript/page-1460/body.html
marvindanig/de-bello-gallico
338efb85a417422b947d3ca04f5b6977ff38170f
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
<div class="leaf "><div class="inner justify"><p>Anch[)i][)a]los, a city of Thrace, near the Euxine Sea, now called <em>Kenkis</em></p><p>Ancibarii, or Ansivarii, an ancient people of Lower Germany, of and about the town of <em>Ansestaet</em>, or <em>Amslim</em></p><p>Anc[=o]na, <em>Ancona</em>, a city of Italy, on the coast of Pisenum. It is supposed to derive its name from the Greek word [Greek: agkon], an angle or elbow, on account of the angular form of the promontory on which it is built. The foundation of Ancona is ascribed by Strabo to some Syracusans, who were fleeing from the tyranny of Dionysius. Livy speaks of it as a naval station of great importance in the wars of Rome with the Illyrians. We find it occupied by Caesar (C. i. 2) shortly after crossing the Rubicon; Caesar takes possession of it with a garrison of one cohort, C. i. 11</p><p>Andes, <em>Angers</em>, in France, the capital of the duchy of Anjou</p></div> </div>
86.181818
138
0.735232
3d4153c282c1ab39f44a22455de6c612fc5659be
433
rs
Rust
todo_app/src/to_do/structs/traits/get.rs
thirteenpylons/practicerust
49e211220a2d8e25b30509024fdeed3066c88dbf
[ "MIT" ]
null
null
null
todo_app/src/to_do/structs/traits/get.rs
thirteenpylons/practicerust
49e211220a2d8e25b30509024fdeed3066c88dbf
[ "MIT" ]
4
2022-01-17T00:48:14.000Z
2022-01-22T01:37:50.000Z
todo_app/src/to_do/structs/traits/get.rs
thirteenpylons/practicerust
49e211220a2d8e25b30509024fdeed3066c88dbf
[ "MIT" ]
null
null
null
use serde_json::Map; use serde_json::value::Value; pub trait Get { fn get(&self, title: &String, state: &Map<String, Value>) { let item: Option<&Value> = state.get(title); match item { Some(result) => { println!("\n\nItem: {}", title); println!("Status: {}\n\n", result); }, None => println!("item: {} was not found", title) } } }
25.470588
63
0.482679
d0e77b263e762137998f44a1cf34c0087c69f1b3
1,238
css
CSS
src/main/resources/io/github/fjossinet/rnartist/gui/css/explorer.css
fjossinet/RNArtist
d025b844f4227342b729ece3f0e1e95f9fdc718a
[ "MIT" ]
70
2020-04-24T16:41:55.000Z
2022-03-25T01:04:18.000Z
src/main/resources/io/github/fjossinet/rnartist/gui/css/explorer.css
fjossinet/RNArtist
d025b844f4227342b729ece3f0e1e95f9fdc718a
[ "MIT" ]
13
2021-01-01T12:07:05.000Z
2022-03-11T04:09:00.000Z
src/main/resources/io/github/fjossinet/rnartist/gui/css/explorer.css
fjossinet/RNArtist
d025b844f4227342b729ece3f0e1e95f9fdc718a
[ "MIT" ]
8
2021-03-23T06:55:31.000Z
2022-02-23T05:56:09.000Z
.tree-table-row-cell { -fx-background-color: -fx-table-cell-border-color, -fx-control-inner-background; -fx-background-insets: 0, 0 0 1 0; } .tree-table-row-cell:selected { -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-focus-color; -fx-background-insets: 0, 1, 2; } .tree-table-row-cell:odd { -fx-background-color: #f9f9f9; -fx-background-insets: 0, 0 0 1 0; } .tree-table-row-cell:selected .tree-table-cell { -fx-text-fill: white; } .tree-table-row-cell:empty { -fx-background-color: transparent; } .tree-table-row-cell:empty .tree-table-cell { -fx-border-width: 0px; } #layout-label { -fx-background-color: white, white; -fx-background-radius: 16.4, 15; -fx-border-radius: 15; -fx-border-width: 2; -fx-border-color: dimgrey; -fx-padding: 5; } .slider .axis { -fx-tick-label-fill: black; } .slider .axis .axis-tick-mark, .slider .axis .axis-minor-tick-mark { -fx-fill: null; -fx-stroke: black; } .no-highlight .menu-item:focused { -fx-background-color: transparent; } /*since there is a bug when one choose custom color from the color picker embedded in a context menu*/ .color-palette .hyperlink { visibility: hidden ; }
23.358491
102
0.662359
363edb346cfc198dc66b3e456df4aac50b582125
6,592
rs
Rust
nlprule/src/rule/grammar.rs
drahnr/nlprule
ae208aa911cf46c96731ed4012aba9b03fa6242e
[ "Apache-2.0", "MIT" ]
null
null
null
nlprule/src/rule/grammar.rs
drahnr/nlprule
ae208aa911cf46c96731ed4012aba9b03fa6242e
[ "Apache-2.0", "MIT" ]
null
null
null
nlprule/src/rule/grammar.rs
drahnr/nlprule
ae208aa911cf46c96731ed4012aba9b03fa6242e
[ "Apache-2.0", "MIT" ]
null
null
null
use super::engine::composition::{GraphId, MatchGraph, PosMatcher}; use crate::types::*; use crate::{ tokenizer::Tokenizer, utils::{self, regex::SerializeRegex}, }; use onig::Captures; use serde::{Deserialize, Serialize}; use std::collections::HashSet; impl std::cmp::PartialEq for Suggestion { fn eq(&self, other: &Suggestion) -> bool { let a: HashSet<&String> = self.replacements.iter().collect(); let b: HashSet<&String> = other.replacements.iter().collect(); a.intersection(&b).count() > 0 && other.start == self.start && other.end == self.end } } #[derive(Debug, Serialize, Deserialize)] pub enum Conversion { Nop, AllLower, StartLower, AllUpper, StartUpper, } impl Conversion { fn convert(&self, input: &str) -> String { match &self { Conversion::Nop => input.to_string(), Conversion::AllLower => input.to_lowercase(), Conversion::StartLower => utils::apply_to_first(input, |c| c.to_lowercase().collect()), Conversion::AllUpper => input.to_uppercase(), Conversion::StartUpper => utils::apply_to_first(input, |c| c.to_uppercase().collect()), } } } /// An example associated with a [Rule][crate::rule::Rule]. #[derive(Debug, Serialize, Deserialize)] pub struct Example { pub(crate) text: String, pub(crate) suggestion: Option<Suggestion>, } impl Example { /// Gets the text of this example. pub fn text(&self) -> &str { &self.text } /// Gets the suggestion for this example. /// * If this is `None`, the associated rule should not trigger for this example. /// * If it is `Some`, the associated rule should return a suggestion with equivalent range and suggestions. pub fn suggestion(&self) -> Option<&Suggestion> { self.suggestion.as_ref() } } #[derive(Serialize, Deserialize, Debug)] pub struct PosReplacer { pub(crate) matcher: PosMatcher, } impl PosReplacer { fn apply(&self, text: &str, tokenizer: &Tokenizer) -> Option<String> { let mut candidates: Vec<_> = tokenizer .tagger() .get_tags( text, tokenizer.options().always_add_lower_tags, tokenizer.options().use_compound_split_heuristic, ) .iter() .map(|x| { let group_words = tokenizer .tagger() .get_group_members(&x.lemma.as_ref().to_string()); let mut data = Vec::new(); for word in group_words { if let Some(i) = tokenizer .tagger() .get_tags( word, tokenizer.options().always_add_lower_tags, tokenizer.options().use_compound_split_heuristic, ) .iter() .position(|x| self.matcher.is_match(&x.pos)) { data.push((word.to_string(), i)); } } data }) .rev() .flatten() .collect(); candidates.sort_by(|(_, a), (_, b)| a.cmp(b)); if candidates.is_empty() { None } else { Some(candidates.remove(0).0) } } } #[derive(Serialize, Deserialize, Debug)] pub struct Match { pub(crate) id: GraphId, pub(crate) conversion: Conversion, pub(crate) pos_replacer: Option<PosReplacer>, pub(crate) regex_replacer: Option<(SerializeRegex, String)>, } impl Match { fn apply(&self, graph: &MatchGraph, tokenizer: &Tokenizer) -> Option<String> { let text = graph.by_id(self.id).text(graph.tokens()[0].sentence); let mut text = if let Some(replacer) = &self.pos_replacer { replacer.apply(text, tokenizer)? } else { text.to_string() }; text = if let Some((regex, replacement)) = &self.regex_replacer { regex.replace_all(&text, |caps: &Captures| { utils::dollar_replace(replacement.to_string(), caps) }) } else { text }; // TODO: maybe return a vector here and propagate accordingly Some(self.conversion.convert(&text)) } fn has_conversion(&self) -> bool { !matches!(self.conversion, Conversion::Nop) } } #[derive(Debug, Serialize, Deserialize)] pub enum SynthesizerPart { Text(String), Match(Match), } #[derive(Debug, Serialize, Deserialize)] pub struct Synthesizer { pub(crate) use_titlecase_adjust: bool, pub(crate) parts: Vec<SynthesizerPart>, } impl Synthesizer { pub fn apply( &self, graph: &MatchGraph, tokenizer: &Tokenizer, start: GraphId, _end: GraphId, ) -> Option<String> { let mut output = Vec::new(); let starts_with_conversion = match &self.parts[..] { [SynthesizerPart::Match(m), ..] => m.has_conversion(), _ => false, }; for part in &self.parts { match part { SynthesizerPart::Text(t) => output.push(t.clone()), SynthesizerPart::Match(m) => { output.push(m.apply(graph, tokenizer)?); } } } let suggestion = utils::normalize_whitespace(&output.join("")); // if the suggestion does not start with a case conversion match, make it title case if: // * at sentence start // * the replaced text is title case let make_uppercase = !starts_with_conversion && graph.groups()[graph.get_index(start)..] .iter() .find_map(|x| x.tokens(graph.tokens()).next()) .map(|first_token| { (self.use_titlecase_adjust && first_token .word .text .as_ref() .chars() .next() .expect("token must have at least one char") .is_uppercase()) || first_token.byte_span.0 == 0 }) .unwrap_or(false); if make_uppercase { Some(utils::apply_to_first(&suggestion, |x| { x.to_uppercase().collect() })) } else { Some(suggestion) } } }
30.948357
112
0.526092
8ec80c2af0d015651dca01979d64dae9b4d3b8e8
3,620
swift
Swift
NHS-COVID-19/Core/Sources/Interface/Screens/VirologyTesting/NonNegativeTestResultNoIsolationViewController.swift
faberga/covid-19-app-ios-ag-public
ee43e47aa1c082ea0bbfb0a971327dea807e4533
[ "MIT" ]
135
2020-08-13T12:37:37.000Z
2021-02-12T06:07:22.000Z
NHS-COVID-19/Core/Sources/Interface/Screens/VirologyTesting/NonNegativeTestResultNoIsolationViewController.swift
faberga/covid-19-app-ios-ag-public
ee43e47aa1c082ea0bbfb0a971327dea807e4533
[ "MIT" ]
15
2020-09-21T11:47:19.000Z
2021-01-11T17:08:29.000Z
NHS-COVID-19/Core/Sources/Interface/Screens/VirologyTesting/NonNegativeTestResultNoIsolationViewController.swift
faberga/covid-19-app-ios-ag-public
ee43e47aa1c082ea0bbfb0a971327dea807e4533
[ "MIT" ]
17
2020-08-13T13:37:38.000Z
2020-12-25T20:13:20.000Z
// // Copyright © 2020 NHSX. All rights reserved. // import Combine import Common import Localization import UIKit public protocol NonNegativeTestResultNoIsolationViewControllerInteracting { var didTapOnlineServicesLink: () -> Void { get } var didTapPrimaryButton: () -> Void { get } var didTapCancel: (() -> Void)? { get } } extension NonNegativeTestResultNoIsolationViewController { private class Content: PrimaryButtonStickyFooterScrollingContent { init(interactor: Interacting, testResultType: TestResultType) { super.init( scrollingViews: [ UIImageView(.isolationEndedWarning).styleAsDecoration(), BaseLabel().set(text: testResultType.headerText).styleAsPageHeader().centralized(), BaseLabel().set(text: testResultType.titleText).styleAsHeading().centralized(), InformationBox.indication.warning(localize(.end_of_isolation_isolate_if_have_symptom_warning)), BaseLabel().set(text: localize(.end_of_isolation_further_advice_visit)).styleAsBody(), LinkButton( title: localize(.end_of_isolation_online_services_link), action: interactor.didTapOnlineServicesLink ), ], primaryButton: ( title: testResultType.continueButtonTitle, action: interactor.didTapPrimaryButton ) ) } } } public class NonNegativeTestResultNoIsolationViewController: StickyFooterScrollingContentViewController { public enum TestResultType { case void, positive } public typealias Interacting = NonNegativeTestResultNoIsolationViewControllerInteracting private let interactor: Interacting public init(interactor: Interacting, testResultType: TestResultType = .positive) { self.interactor = interactor super.init(content: Content(interactor: interactor, testResultType: testResultType)) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override public func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if interactor.didTapCancel != nil { navigationController?.setNavigationBarHidden(false, animated: animated) navigationItem.leftBarButtonItem = UIBarButtonItem(title: localize(.cancel), style: .done, target: self, action: #selector(didTapCancel)) } else { navigationController?.setNavigationBarHidden(true, animated: animated) } } @objc func didTapCancel() { interactor.didTapCancel?() } } extension NonNegativeTestResultNoIsolationViewController.TestResultType { var headerText: String { switch self { case .positive: return localize(.end_of_isolation_positive_text_no_isolation_header) case .void: return localize(.void_test_result_no_isolation_header) } } var titleText: String { switch self { case .positive: return localize(.end_of_isolation_positive_text_no_isolation_title) case .void: return localize(.void_test_result_no_isolation_title) } } var continueButtonTitle: String { switch self { case .positive: return localize(.positive_test_results_continue) case .void: return localize(.void_test_results_continue) } } }
35.841584
149
0.650276
3e6f85041ce7fc484bbe3f8f4214d8396731772d
2,640
h
C
librmq/block.h
wx-csy/librmq
1fdacbb29939783bc840f2304052bac5b21c1a53
[ "MIT" ]
5
2020-11-24T15:16:15.000Z
2021-12-08T07:51:04.000Z
librmq/block.h
wx-csy/librmq
1fdacbb29939783bc840f2304052bac5b21c1a53
[ "MIT" ]
null
null
null
librmq/block.h
wx-csy/librmq
1fdacbb29939783bc840f2304052bac5b21c1a53
[ "MIT" ]
null
null
null
#ifndef __LIBRMQ_BLOCK_H__ #define __LIBRMQ_BLOCK_H__ #include <algorithm> #include "hardcode.h" #include "st.h" namespace librmq { template <typename T> class rmq_block { static constexpr size_t BLOCKSZ = 1024; size_t n, nr_blocks; const T *data; size_t *pref, *suf; rmq_st<T> st; void init_block(const T *data, size_t si) { size_t ptr = si * BLOCKSZ; for (int i = 0; i < BLOCKSZ; i++) { if (i) { pref[ptr + i] = data[i] < data[pref[ptr + i - 1]] ? i : pref[ptr + i - 1]; } else { pref[ptr + i] = i; } } for (int i = BLOCKSZ - 1; i >= 0; i--) { if (i == BLOCKSZ - 1) { suf[ptr + i] = i; } else { suf[ptr + i] = data[i] < data[suf[ptr + i + 1]] ? i : suf[ptr + i + 1]; } } for (int i = 0; i < BLOCKSZ; i++) pref[ptr + i] += ptr; for (int i = 0; i < BLOCKSZ; i++) suf[ptr + i] += ptr; } public: rmq_block(size_t n, const T *data) : n(n), data(data) { nr_blocks = (n + BLOCKSZ - 1) / BLOCKSZ; size_t *segdata = new size_t[nr_blocks]; pref = new size_t[nr_blocks * BLOCKSZ]; suf = new size_t[nr_blocks * BLOCKSZ]; size_t ptr = 0; for (size_t si = 0; ptr + BLOCKSZ <= n; ptr += BLOCKSZ, si++) { segdata[si] = std::min_element(data + ptr, data + ptr + BLOCKSZ) - data; init_block(data + ptr, si); } if (ptr != n) { T rdata[BLOCKSZ] = {0}; for (size_t i = 0; ptr + i < n; i++) rdata[i] = data[ptr + i]; segdata[nr_blocks - 1] = std::min_element(data + ptr, data + n) - data; init_block(rdata, nr_blocks - 1); } st.init(nr_blocks, data, segdata); } ~rmq_block() { delete[] pref; delete[] suf; } size_t query(size_t l, size_t r) { size_t lb = l / BLOCKSZ, rb = r / BLOCKSZ; if (lb != rb) { // speculative policy size_t ret = st.query(lb, std::min(nr_blocks, rb + 1)); if (ret >= l and ret < r) return ret; } else { return std::min_element(data + l, data + r) - data; } size_t lbase = lb * BLOCKSZ, rbase = rb * BLOCKSZ; size_t v = suf[l]; if (r != rbase) { size_t v2 = pref[r - 1]; if (data[v2] < data[v]) v = v2; } if (lb + 1 == rb) return v; size_t vv = st.query(lb + 1, rb); return data[vv] < data[v] ? vv : v; } }; } #endif
29.662921
84
0.462121
573c65d9e444892c52aa8797bb38e584a19ed106
151
sql
SQL
microservicio/infraestructura/src/main/resources/sql/mantenimiento/actualizar.sql
scalde44/taller
d79d1da6a87714de402bbf66ba8840ab8e4719fe
[ "Apache-2.0" ]
null
null
null
microservicio/infraestructura/src/main/resources/sql/mantenimiento/actualizar.sql
scalde44/taller
d79d1da6a87714de402bbf66ba8840ab8e4719fe
[ "Apache-2.0" ]
null
null
null
microservicio/infraestructura/src/main/resources/sql/mantenimiento/actualizar.sql
scalde44/taller
d79d1da6a87714de402bbf66ba8840ab8e4719fe
[ "Apache-2.0" ]
null
null
null
update mantenimiento set placa = :placa, cilindraje = :cilindraje, fecha_entrada = :fechaEntrada, tarifa = :tarifa, estado = :estado where id = :id
21.571429
31
0.728477
6534325409884c8b43e265c56070a9cc57567e0b
42
py
Python
examples/phobos/tests/test_std_system.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
47
2019-07-16T10:38:07.000Z
2022-03-30T16:34:24.000Z
examples/phobos/tests/test_std_system.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
199
2019-06-17T23:24:40.000Z
2021-06-16T16:41:36.000Z
examples/phobos/tests/test_std_system.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
7
2019-09-13T18:03:49.000Z
2022-01-17T03:53:00.000Z
def test_import(): import std_system
10.5
21
0.714286
f04d1937650ea1b63befb73eea4d0e4baa59f849
1,541
js
JavaScript
routes/api/apt.js
v-mauna/SLC
d551cb6181964d3879bbaad579463e39c97e1656
[ "MIT" ]
null
null
null
routes/api/apt.js
v-mauna/SLC
d551cb6181964d3879bbaad579463e39c97e1656
[ "MIT" ]
null
null
null
routes/api/apt.js
v-mauna/SLC
d551cb6181964d3879bbaad579463e39c97e1656
[ "MIT" ]
null
null
null
const router = require ("express").Router(); const mongoose =require("mongoose"); const path =require("path"); const { brotliDecompress } = require("zlib"); const db = require("../../models"); // how do i structure this? router.post("/aptform", async({ body ,user}, res,next) => { try { console.log(`user === ${user}`) body.userId = mongoose.Types.ObjectId(user._id) const aptForm = await db.Event.create(body) res.json(aptForm) } catch (error) { console.log(`Error in apt.js router: ${error.message}`) res.status(400).json(err); } }) router.put("/aptform", async({body}, res,next) => { try{ console.log(`body in aptForm request === ${body}`) const updatedForm = await Workout.findByIdAndUpdate( req.params.id, ) res.json(updatedForm) }catch(error){ console.log(`error in aptForm router put request === ${error.message}`) next(error) }}) module.exports = router const Schema = mongoose.Schema; const EventSchema = new Schema({ location: { type: String, trim: true, required: true }, contact: { type: String, trim: true, required: true }, service: { type: String, trim: true }, time:{ type: String, required: true }, day:{ type: Date, default: new Date().setDate(new Date().getDate()) }, note:{ type: String, trim: true }, userId:{ type : Schema.Types.ObjectId, ref: "User" } }); const Event = mongoose.model("event", EventSchema); module.exports = Event;
18.566265
75
0.605451
3baf6c4048880958b9e28a01c3a475a1f8f84942
2,424
h
C
OrbitGl/GpuTrack.h
karupayun/orbit
12e12f3125588c0318c2a3788a69f8b706cd1bdc
[ "BSD-2-Clause" ]
1
2020-08-10T09:59:33.000Z
2020-08-10T09:59:33.000Z
OrbitGl/GpuTrack.h
MariaSandru27/orbit
6dcc6d82405654d07094ee66c396762892379b31
[ "BSD-2-Clause" ]
null
null
null
OrbitGl/GpuTrack.h
MariaSandru27/orbit
6dcc6d82405654d07094ee66c396762892379b31
[ "BSD-2-Clause" ]
1
2020-05-20T04:32:01.000Z
2020-05-20T04:32:01.000Z
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_GL_GPU_TRACK_H_ #define ORBIT_GL_GPU_TRACK_H_ #include <map> #include <memory> #include "BlockChain.h" #include "CallstackTypes.h" #include "StringManager.h" #include "TextBox.h" #include "Threading.h" #include "Track.h" class TextRenderer; class GpuTrack : public Track { public: GpuTrack(TimeGraph* time_graph, std::shared_ptr<StringManager> string_manager, uint64_t timeline_hash); ~GpuTrack() override = default; // Pickable void Draw(GlCanvas* canvas, bool picking) override; void OnDrag(int x, int y) override; void OnTimer(const Timer& timer); // Track void UpdatePrimitives(uint64_t min_tick, uint64_t max_tick) override; Type GetType() const override { return kGpuTrack; } float GetHeight() const override; std::vector<std::shared_ptr<TimerChain>> GetTimers() override; uint32_t GetDepth() const { return depth_; } std::string GetExtraInfo(const Timer& timer); Color GetColor() const; uint32_t GetNumTimers() const { return num_timers_; } TickType GetMinTime() const { return min_time_; } TickType GetMaxTime() const { return max_time_; } const TextBox* GetFirstAfterTime(TickType time, uint32_t depth) const; const TextBox* GetFirstBeforeTime(TickType time, uint32_t depth) const; const TextBox* GetLeft(TextBox* textbox) const; const TextBox* GetRight(TextBox* textbox) const; const TextBox* GetUp(TextBox* textbox) const; const TextBox* GetDown(TextBox* textbox) const; std::vector<std::shared_ptr<TimerChain>> GetAllChains() override; bool IsCollapsable() const override { return depth_ > 1; } protected: void UpdateDepth(uint32_t depth) { if (depth > depth_) depth_ = depth; } std::shared_ptr<TimerChain> GetTimers(uint32_t depth) const; private: Color GetTimerColor(const Timer& timer, bool is_selected, bool inactive) const; void SetTimesliceText(const Timer& timer, double elapsed_us, float min_x, TextBox* text_box); protected: TextRenderer* text_renderer_ = nullptr; uint32_t depth_ = 0; uint64_t timeline_hash_; mutable Mutex mutex_; std::map<int, std::shared_ptr<TimerChain>> timers_; std::shared_ptr<StringManager> string_manager_; }; #endif // ORBIT_GL_GPU_TRACK_H_
30.683544
80
0.733086
9c1f2fe5ace29630b4695f03bc88cf817c8c3f78
3,309
js
JavaScript
tailwind.config.js
goranalkovic/simple-piano-v2
8bd31d8a0f0d9179473f5dee6feee0560662c6d9
[ "MIT" ]
1
2021-09-22T14:51:24.000Z
2021-09-22T14:51:24.000Z
tailwind.config.js
goranalkovic/simple-piano-v2
8bd31d8a0f0d9179473f5dee6feee0560662c6d9
[ "MIT" ]
null
null
null
tailwind.config.js
goranalkovic/simple-piano-v2
8bd31d8a0f0d9179473f5dee6feee0560662c6d9
[ "MIT" ]
null
null
null
const { tailwindExtractor } = require('tailwindcss/lib/lib/purgeUnusedStyles'); const colors = require('tailwindcss/colors'); module.exports = { darkMode: 'class', purge: { content: ['./src/**/*.html', './src/**/*.svelte'], options: { defaultExtractor: (content) => [ ...tailwindExtractor(content), ...[...content.matchAll(/(?:class:)*([\w\d-/:%.]+)/gm)].map( ([_match, group, ..._rest]) => group, ), ], keyframes: true, }, }, theme: { filter: { none: 'none', grayscale: 'grayscale(1)', invert: 'invert(1)', sepia: 'sepia(1)', }, backdropFilter: { none: 'none', blur: 'blur(30px)', 'blur-slight': 'blur(10px)', 'blur-saturate': 'blur(30px) saturate(125%)', 'blur-slight-saturate': 'blur(10px) saturate(125%)', }, colors: { transparent: 'transparent', current: 'currentColor', black: colors.black, white: colors.white, gray: { ...colors.gray, 150: '#ECECEF', 750: '#333338', 650: '#484850', }, red: colors.red, ocean: { 100: '#d1e2fe', 200: '#a2c5fe', 300: '#74a8fd', 400: '#458bfd', 500: '#176efc', 600: '#1258ca', 700: '#0e4297', 800: '#092c65', 900: '#051632', }, azure: { 100: '#cde4f9', 200: '#9bc9f2', 300: '#68aeec', 400: '#3693e5', 500: '#0478df', 600: '#0360b2', 700: '#024886', 800: '#023059', 900: '#01182d', }, }, fontFamily: { sans: 'Rubik, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', display: 'Inter, Rubik, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', }, extend: { width: { 4.5: '1.125rem', 30: '7.5rem', }, height: { 4.5: '1.125rem', 30: '7.5rem', }, fontSize: { xxs: '0.75rem', xs: '0.8rem', }, padding: { '2px': '2px', 6.5: '1.625rem', 9.5: '2.375rem', }, margin: { 6.5: '1.625rem', 9.5: '2.375rem', }, }, }, variants: { filter: ['responsive', 'dark'], // defaults to ['responsive'] backdropFilter: ['responsive', 'dark'], // defaults to ['responsive'] extend: { backgroundOpacity: ['dark'], scale: ['group-hover'], opacity: ['group-hover'], outline: ['dark', 'hover', 'focus-visible'], ringOpacity: ['dark', 'focus-visible'], ringWidth: ['hover', 'focus-visible'], ringOffsetWidth: ['hover', 'focus-visible'], ringOffsetColor: ['focus-visible'], height: ['hover'], borderWidth: ['focus-visible'], borderColor: ['focus-visible'], display: ['hover', 'group-hover'], padding: ['group-hover'], height: ['group-hover'], }, }, plugins: [require('tailwindcss-filters')], };
27.806723
232
0.500453
ada397135b503ef2efb7cd43001073d55d0c350c
6,194
asm
Assembly
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0_notsx.log_1_1997.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0_notsx.log_1_1997.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0_notsx.log_1_1997.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x1bb67, %rsi lea addresses_normal_ht+0x1ed67, %rdi nop nop nop nop dec %rax mov $84, %rcx rep movsw nop cmp $50366, %r13 lea addresses_WT_ht+0xf4e7, %r15 nop nop dec %rsi movb $0x61, (%r15) nop nop nop inc %rax lea addresses_WC_ht+0x227, %rsi lea addresses_normal_ht+0x3427, %rdi clflush (%rdi) nop nop nop nop sub $20989, %r8 mov $107, %rcx rep movsq nop add $8712, %rdi lea addresses_WT_ht+0x11e67, %rsi lea addresses_UC_ht+0xf067, %rdi nop xor %rbp, %rbp mov $120, %rcx rep movsb nop nop nop cmp %r13, %r13 lea addresses_A_ht+0xb29d, %r15 nop nop nop xor $14533, %rax and $0xffffffffffffffc0, %r15 vmovaps (%r15), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %r8 nop nop nop sub $41086, %r13 lea addresses_WT_ht+0x9237, %rsi nop cmp %rax, %rax mov (%rsi), %r8w sub $55680, %rax pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_RW+0xa287, %rdi clflush (%rdi) nop nop nop xor $19796, %rcx movb $0x51, (%rdi) nop nop nop add $47762, %rsi // Load lea addresses_WC+0x8961, %rcx clflush (%rcx) nop xor %rdx, %rdx mov (%rcx), %rdi sub $43194, %r8 // Store lea addresses_US+0x8eef, %r8 nop nop nop nop nop cmp $60423, %rsi movw $0x5152, (%r8) nop nop nop nop xor %rsi, %rsi // REPMOV lea addresses_A+0x1ce7, %rsi lea addresses_WC+0xc667, %rdi nop nop nop nop sub $17824, %r13 mov $48, %rcx rep movsl nop nop and $33070, %rdi // Store lea addresses_normal+0x1f667, %rdx clflush (%rdx) nop nop nop nop nop add %rdi, %rdi movb $0x51, (%rdx) nop nop nop nop cmp %r13, %r13 // Store lea addresses_normal+0x1e267, %rdi nop nop nop sub %r8, %r8 mov $0x5152535455565758, %rcx movq %rcx, (%rdi) dec %r9 // REPMOV lea addresses_D+0xbe67, %rsi lea addresses_PSE+0x9a7, %rdi mfence mov $97, %rcx rep movsb nop nop nop nop nop xor %rdx, %rdx // Store lea addresses_A+0x1c450, %rsi nop nop nop nop nop and $14344, %rcx movl $0x51525354, (%rsi) nop nop nop nop nop sub %r13, %r13 // Store mov $0x21f, %rdx nop nop nop nop nop dec %rdi movl $0x51525354, (%rdx) nop and %rdi, %rdi // Store lea addresses_WT+0x16a67, %rdx nop sub $12665, %r13 movw $0x5152, (%rdx) and $10567, %rdx // Store lea addresses_normal+0x16e67, %rsi nop nop nop nop and $19310, %rdx mov $0x5152535455565758, %rdi movq %rdi, (%rsi) nop nop nop nop nop cmp $65297, %r8 // REPMOV lea addresses_WT+0x15267, %rsi lea addresses_PSE+0x14a1, %rdi nop nop nop nop sub %r8, %r8 mov $33, %rcx rep movsl nop and %rcx, %rcx // Load lea addresses_WT+0x11be7, %rdx nop nop and $39994, %r8 mov (%rdx), %rcx // Exception!!! xor %rsi, %rsi div %rsi nop xor %rdi, %rdi // REPMOV lea addresses_normal+0x16e67, %rsi lea addresses_US+0x8c1f, %rdi nop nop nop nop nop cmp %r12, %r12 mov $59, %rcx rep movsw nop and $24433, %r13 // Faulty Load lea addresses_normal+0x16e67, %r9 nop nop nop dec %rcx mov (%r9), %si lea oracles, %rcx and $0xff, %rsi shlq $12, %rsi mov (%rcx,%rsi,1), %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}} {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_A', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_D', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}} {'src': {'type': 'addresses_WT', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 0, 'same': False}} {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal', 'congruent': 0, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_US', 'congruent': 2, 'same': False}} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'b8': 1} b8 */
19.176471
152
0.643687
b12f0516d2535d4ce430c010b995e66e7eb10c46
78
css
CSS
static/css/base.css
ZiYin-ss/python-blog2
78f30bb969fc0d2f0ddb7c1221bb2210387f2c09
[ "MIT" ]
null
null
null
static/css/base.css
ZiYin-ss/python-blog2
78f30bb969fc0d2f0ddb7c1221bb2210387f2c09
[ "MIT" ]
null
null
null
static/css/base.css
ZiYin-ss/python-blog2
78f30bb969fc0d2f0ddb7c1221bb2210387f2c09
[ "MIT" ]
null
null
null
ul{ list-style: none; } a{ color: black; } a:hover{ color: blue; }
8.666667
21
0.525641
dfec7da6c48b22824c81ca23302962b92f031538
1,107
kt
Kotlin
api/src/main/kotlin/command/CommandProvider.kt
kolton256/rainbow
7db0262ce4a8e007d7127bd142a027d2c42afc3c
[ "MIT" ]
2
2018-10-21T12:11:42.000Z
2019-02-07T12:12:30.000Z
api/src/main/kotlin/command/CommandProvider.kt
kolton256/rainbow
7db0262ce4a8e007d7127bd142a027d2c42afc3c
[ "MIT" ]
50
2020-02-24T16:25:27.000Z
2021-07-20T22:28:48.000Z
api/src/main/kotlin/command/CommandProvider.kt
kolton256/rainbow
7db0262ce4a8e007d7127bd142a027d2c42afc3c
[ "MIT" ]
5
2019-03-25T14:39:12.000Z
2020-11-21T03:34:39.000Z
package command import context.ICommandContext import util.Loggers import kotlin.reflect.KClass /** * Base provider for all commands * @param type baked type of context (because type erasure) * @param T type of context */ abstract class CommandProvider<T : ICommandContext>(val type: KClass<T>) { private val logger = Loggers.getLogger<CommandProvider<T>>() private val _commands = hashMapOf<List<String>, CommandInfo>() /** * Contains all commands except hidden */ val commands: Array<CommandInfo> get() = _commands.values.filter { !it.isHidden }.toTypedArray() /** * Gives command by name or alias */ open fun find(name: String): CommandInfo? = _commands.entries.find { name in it.key }?.value internal fun addCommand(command: CommandInfo) { if (find(command.name) == null || command.aliases.map { find(it) }.all { it == null }) { val key = command.aliases + command.name _commands[key] = command } else { logger.error("Команда с таким названием уже зарегистрирована") } } }
29.918919
96
0.65402
f29ec76cb02dfd09985046c0a9c5054f028c5e8a
1,764
sql
SQL
db/migrate/V4__fix_get_folders.sql
andrewrmiller/reimas
3c1b76971fc04b6663c47270fdcf9d9d4a56932a
[ "MIT" ]
null
null
null
db/migrate/V4__fix_get_folders.sql
andrewrmiller/reimas
3c1b76971fc04b6663c47270fdcf9d9d4a56932a
[ "MIT" ]
4
2020-04-05T23:19:05.000Z
2022-01-22T09:55:53.000Z
db/migrate/V4__fix_get_folders.sql
andrewrmiller/reimas
3c1b76971fc04b6663c47270fdcf9d9d4a56932a
[ "MIT" ]
null
null
null
DELIMITER $$ -- Fix potentially uninitialized @parent_id_compressed in pst_get_folders. DROP PROCEDURE IF EXISTS `pst_get_folders` $$ CREATE PROCEDURE `pst_get_folders`( IN p_user_id VARCHAR(254), IN p_library_id VARCHAR(36), IN p_parent_id VARCHAR(36)) this_proc:BEGIN IF p_parent_id IS NOT NULL THEN SET @parent_id_compressed = pst_compress_guid(p_parent_id); ELSE SET @parent_id_compressed = NULL; END IF; SET @library_id_compressed = pst_compress_guid(p_library_id); -- Make sure the user has permission to see pst_folders under the parent. SET @role = pst_get_user_role( p_user_id, @library_id_compressed, IF (p_parent_id IS NULL, NULL, @parent_id_compressed)); IF (@role IS NULL) THEN SELECT 1 AS err_code, /* Not Found */ 'Folder does not exist.' AS err_context; LEAVE this_proc; END IF; SELECT 0 AS err_code, NULL AS err_context; SELECT pst_expand_guid(f.library_id) AS library_id, pst_expand_guid(f.folder_id) AS folder_id, f.name, pst_expand_guid(f.parent_id) AS parent_id, f.type, f.`path`, f.file_count, f.file_size, f.file_size_sm, f.file_size_md, f.file_size_lg, f.file_size_cnv_video, f.data, f.`where`, f.order_by, ur.role AS user_role FROM pst_folders f LEFT JOIN (SELECT * FROM pst_folder_user_roles WHERE user_id = p_user_id) ur ON f.library_id = ur.library_id AND f.folder_id = ur.folder_id WHERE f.library_id = pst_compress_guid(p_library_id) AND (f.parent_id = @parent_id_compressed OR (p_parent_id IS NULL AND f.parent_id IS NULL)) ORDER BY name; END $$ DELIMITER ;
26.328358
90
0.668367
bcaf9c933345f1ced46d3fd5d3627aa380e82ef0
4,082
js
JavaScript
src/components/Detalle/Detalle.js
Ger0505/ServiciosWeb
105348f72ec805722a59cfba6b9051250ec18c62
[ "MIT" ]
null
null
null
src/components/Detalle/Detalle.js
Ger0505/ServiciosWeb
105348f72ec805722a59cfba6b9051250ec18c62
[ "MIT" ]
null
null
null
src/components/Detalle/Detalle.js
Ger0505/ServiciosWeb
105348f72ec805722a59cfba6b9051250ec18c62
[ "MIT" ]
null
null
null
import { CCardBody, CDropdown, CDropdownItem, CDropdownMenu, CDropdownToggle, CForm, CButton, CInput, CFormText, CCol, CRow } from '@coreui/react'; import React, { useState, useEffect } from 'react' import { API } from "../../helpers" const Detalle = ({ item, arrayRep, onSearch, onChange, reset }) => { const [msgError, setMsgError] = useState('') const [cantidad, setCantidad] = useState(item.cantidad) const [precio, setPrecio] = useState(item.precio) const [costoDefault, setCostoDefault] = useState(0); useEffect(()=>{ if(item.tipo === 'Garrafón') setCostoDefault(10) else if(item.tipo === 'Estacionario') setCostoDefault(10) else if(item.tipo === 'Tanque'){ if(item.descripcion === '10 Litros') setCostoDefault(10) else if(item.descripcion === '20 Litros') setCostoDefault(20) else if(item.descripcion === '30 Litros') setCostoDefault(30) else if(item.descripcion === '40 Litros') setCostoDefault(40) else if(item.descripcion === '50 Litros') setCostoDefault(50) } },[item]) const _onSubmit = async e => { e.preventDefault() let c, p = -100 try { c = parseFloat(cantidad) p = parseFloat(precio) console.log(c + " " + p); } catch (e) { setMsgError('Formato de cantidad y/o precio inválida') } if (c > 0 && p > 0) { let res = await API.getBody("ped/update", "PUT", { _id: item._id, cantidad: c, precio: p }) if (res.hasOwnProperty("status")) console.log(res.msg) setMsgError("") } else { setMsgError("Número mayor a 0 en cantidad y/o precio") } reset() } const _handlePrecio = e =>{ try { if(e.target.value === '') setPrecio(0) else setPrecio(parseInt(e.target.value)* costoDefault) } catch (err) { setPrecio(0) } } const _eliminarPedido = async () =>{ let res = await API.getData("ped/delete/" + item._id, "DELETE") if(res.code === 200) reset() else alert("Error al eliminar pedido") } return ( <CCardBody> <CForm onSubmit={_onSubmit}> <div style={{display: 'flex', flexDirection: 'row-reverse', float: 'right'}}> <CButton onClick={() => _eliminarPedido()} color="danger" shape="btn-pill" style={{marginRight: 8}}> <i class="fas fa-trash-alt"></i> Eliminar Pedido </CButton> </div> <h4>ID. {item._id}</h4> <p className=""><strong>Usuario:</strong> {item.usuario.nombre + " " + item.usuario.apellidos}</p> <p className=""> <strong>Dirección:</strong> {item.usuario.direccion}</p> <p className=""> <strong>Repartidor:</strong> {onSearch(item.repartidor?._id)} </p> <p className=""><strong>Descripción:</strong> {item.descripcion}</p> <CRow> <CCol xs="6"> <p className=""><strong>Cantidad:</strong></p> <CInput id="cantidad" name="cantidad" type="text" required value={cantidad} onChange={e => { setMsgError(''); setCantidad(e.target.value); _handlePrecio(e)}} /> </CCol> <CCol xs="6"> <p className=""><strong>Precio: </strong></p> <CInput id="precio" name="cantidad" type="text" required value={precio} onChange={e => { setMsgError(''); setPrecio(e.target.value) }} /> </CCol> </CRow> <br /> {msgError !== '' && <CFormText style={{ marginTop: '-1rem' }} className="help-block" color="danger">{msgError}</CFormText>} <CDropdown> <CDropdownToggle color="primary">Cambiar Repartidor</CDropdownToggle> <CDropdownMenu> {arrayRep.map((rep) => { return ( <CDropdownItem onClick={() => onChange(item._id, rep._id)} component="button">{`${rep.usuario.nombre} ${rep.usuario.apellidos}`}</CDropdownItem> ) })} </CDropdownMenu> </CDropdown> <br/> <CButton type="submit" color="info"> Actualizar </CButton> </CForm> </CCardBody> ) } export default Detalle;
38.149533
160
0.581333
1f9d5842a3459693ce7a09c787bec55efaa7fac6
24,978
html
HTML
content/javadoc/taverna-language/org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html
apache/incubator-taverna-site
36638f60b847168e7857597e674d9d2a040535ba
[ "Apache-2.0" ]
6
2015-07-25T15:24:40.000Z
2021-11-10T17:55:09.000Z
content/javadoc/taverna-language/org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html
apache/incubator-taverna-site
36638f60b847168e7857597e674d9d2a040535ba
[ "Apache-2.0" ]
3
2015-08-10T14:42:54.000Z
2016-01-06T17:33:07.000Z
content/javadoc/taverna-language/org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html
apache/incubator-taverna-site
36638f60b847168e7857597e674d9d2a040535ba
[ "Apache-2.0" ]
15
2015-02-09T16:41:08.000Z
2021-11-10T17:55:00.000Z
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_72-internal) on Mon Mar 14 13:22:14 GMT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>WorkflowDescriptionType (Apache Taverna Language APIs (Scufl2, Databundle) 0.15.1-incubating API)</title> <meta name="date" content="2016-03-14"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="WorkflowDescriptionType (Apache Taverna Language APIs (Scufl2, Databundle) 0.15.1-incubating API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/WorkflowDescriptionType.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/TemplateType.html" title="class in org.apache.taverna.scufl2.xml.scufl.jaxb"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WsdlType.html" title="class in org.apache.taverna.scufl2.xml.scufl.jaxb"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html" target="_top">Frames</a></li> <li><a href="WorkflowDescriptionType.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.taverna.scufl2.xml.scufl.jaxb</div> <h2 title="Class WorkflowDescriptionType" class="title">Class WorkflowDescriptionType</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>org.apache.taverna.scufl2.xml.scufl.jaxb.WorkflowDescriptionType</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">WorkflowDescriptionType</span> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block"><p>Java class for workflowDescriptionType complex type. <p>The following schema fragment specifies the expected content contained within this class. <pre> &lt;complexType name="workflowDescriptionType"&gt; &lt;simpleContent&gt; &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt; &lt;attribute name="lsid" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;/extension&gt; &lt;/simpleContent&gt; &lt;/complexType&gt; </pre></div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#author">author</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#lsid">lsid</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#title">title</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#value">value</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#WorkflowDescriptionType--">WorkflowDescriptionType</a></span>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#getAuthor--">getAuthor</a></span>()</code> <div class="block">Gets the value of the author property.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#getLsid--">getLsid</a></span>()</code> <div class="block">Gets the value of the lsid property.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#getTitle--">getTitle</a></span>()</code> <div class="block">Gets the value of the title property.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#getValue--">getValue</a></span>()</code> <div class="block">Gets the value of the value property.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#setAuthor-java.lang.String-">setAuthor</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code> <div class="block">Sets the value of the author property.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#setLsid-java.lang.String-">setLsid</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code> <div class="block">Sets the value of the lsid property.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#setTitle-java.lang.String-">setTitle</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code> <div class="block">Sets the value of the title property.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html#setValue-java.lang.String-">setValue</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code> <div class="block">Sets the value of the value property.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="value"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>value</h4> <pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value</pre> </li> </ul> <a name="lsid"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>lsid</h4> <pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> lsid</pre> </li> </ul> <a name="author"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>author</h4> <pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> author</pre> </li> </ul> <a name="title"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>title</h4> <pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> title</pre> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="WorkflowDescriptionType--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>WorkflowDescriptionType</h4> <pre>public&nbsp;WorkflowDescriptionType()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getValue--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getValue</h4> <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getValue()</pre> <div class="block">Gets the value of the value property.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>possible object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="setValue-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setValue</h4> <pre>public&nbsp;void&nbsp;setValue(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre> <div class="block">Sets the value of the value property.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - allowed object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="getLsid--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getLsid</h4> <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getLsid()</pre> <div class="block">Gets the value of the lsid property.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>possible object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="setLsid-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setLsid</h4> <pre>public&nbsp;void&nbsp;setLsid(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre> <div class="block">Sets the value of the lsid property.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - allowed object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="getAuthor--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getAuthor</h4> <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getAuthor()</pre> <div class="block">Gets the value of the author property.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>possible object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="setAuthor-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setAuthor</h4> <pre>public&nbsp;void&nbsp;setAuthor(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre> <div class="block">Sets the value of the author property.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - allowed object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="getTitle--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTitle</h4> <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getTitle()</pre> <div class="block">Gets the value of the title property.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>possible object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> <a name="setTitle-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setTitle</h4> <pre>public&nbsp;void&nbsp;setTitle(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre> <div class="block">Sets the value of the title property.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - allowed object is <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/WorkflowDescriptionType.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/TemplateType.html" title="class in org.apache.taverna.scufl2.xml.scufl.jaxb"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../../org/apache/taverna/scufl2/xml/scufl/jaxb/WsdlType.html" title="class in org.apache.taverna.scufl2.xml.scufl.jaxb"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/taverna/scufl2/xml/scufl/jaxb/WorkflowDescriptionType.html" target="_top">Frames</a></li> <li><a href="WorkflowDescriptionType.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
48.127168
1,713
0.67031
1a5a9000fb1f52867115e003250a3c25449e1bac
1,123
lua
Lua
scripts/oldschool.lua
Nonegustavo/Transformice-Lua-Scripts
d9aa3c0e37b4d618ac25647569ef3facc5552f3c
[ "MIT" ]
2
2021-01-08T15:19:58.000Z
2021-04-16T00:23:36.000Z
scripts/oldschool.lua
Nonegustavo/Transformice-Lua-Scripts
d9aa3c0e37b4d618ac25647569ef3facc5552f3c
[ "MIT" ]
null
null
null
scripts/oldschool.lua
Nonegustavo/Transformice-Lua-Scripts
d9aa3c0e37b4d618ac25647569ef3facc5552f3c
[ "MIT" ]
null
null
null
xmlLoaded=false tfm.exec.disableAutoShaman(true) function eventNewGame() if not xmlLoaded then if tfm.get.room.currentMap:find("@")~=nil then xml=tfm.get.room.xmlMapInfo.xml author=tfm.get.room.xmlMapInfo.author mapCode=tfm.get.room.xmlMapInfo.mapCode tfm.exec.disableAutoShaman(false) tfm.exec.newGame(xmlModifier(xml)) xmlLoaded=true tfm.exec.setUIMapName("<v>"..author) else tfm.exec.newGame() end else tfm.exec.disableAutoShaman(true) xmlLoaded=false end end function xmlModifier(xml) xml = xml:gsub('<P[^>]+T="[^>]+"[^>]+>','') xml = xml:gsub('T="(%d+)"', function(a) if a=='5' or a=='6' or a=='7' or a=='10' or a=='11' then return 'T="0"' else return 'T="'..a..'"' end end) xml = xml:gsub('F="(.-)"','') tfm.exec.disableAllShamanSkills(true) return xml end tfm.exec.newGame()
36.225806
154
0.49065
0cdfbe0659d37b3cc8cc00e18f2f0edb48d21d4a
3,410
py
Python
src/scs_airnow/cmd/cmd_csv_join.py
south-coast-science/scs_airnow
7f0657bd434aa3abe667f58bc971edaa00d0c24c
[ "MIT" ]
null
null
null
src/scs_airnow/cmd/cmd_csv_join.py
south-coast-science/scs_airnow
7f0657bd434aa3abe667f58bc971edaa00d0c24c
[ "MIT" ]
null
null
null
src/scs_airnow/cmd/cmd_csv_join.py
south-coast-science/scs_airnow
7f0657bd434aa3abe667f58bc971edaa00d0c24c
[ "MIT" ]
null
null
null
""" Created on 22 Feb 2019 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) source repo: scs_analysis """ import optparse # -------------------------------------------------------------------------------------------------------------------- class CmdCSVJoin(object): """unix command line handler""" def __init__(self): """ Constructor """ self.__parser = optparse.OptionParser(usage="%prog [-t TYPE] [-i] [-v] -l PREFIX PK FILENAME " "-r PREFIX PK FILENAME", version="%prog 1.0") # compulsory... self.__parser.add_option("--left", "-l", type="string", nargs=3, action="store", dest="left", help="output path prefix, primary key and filename for left-hand set") self.__parser.add_option("--right", "-r", type="string", nargs=3, action="store", dest="right", help="output path prefix, primary key and filename for right-hand set") # optional... self.__parser.add_option("--type", "-t", type="string", nargs=1, action="store", dest="type", default='INNER', help="{ 'INNER' | 'LEFT' | 'RIGHT' | 'FULL' } (default 'INNER')") self.__parser.add_option("--iso8601", "-i", action="store_true", dest="iso8601", default=False, help="interpret the primary key as an ISO 8601 datetime") self.__parser.add_option("--verbose", "-v", action="store_true", dest="verbose", default=False, help="report narrative to stderr") self.__opts, self.__args = self.__parser.parse_args() # ---------------------------------------------------------------------------------------------------------------- def is_valid(self): if self.__opts.left is None or self.__opts.right is None: return False return True # ---------------------------------------------------------------------------------------------------------------- @property def type(self): return self.__opts.type @property def left_prefix(self): return None if self.__opts.left is None else self.__opts.left[0] @property def left_pk(self): return None if self.__opts.left is None else self.__opts.left[1] @property def left_filename(self): return None if self.__opts.left is None else self.__opts.left[2] @property def right_prefix(self): return None if self.__opts.right is None else self.__opts.right[0] @property def right_pk(self): return None if self.__opts.right is None else self.__opts.right[1] @property def right_filename(self): return None if self.__opts.right is None else self.__opts.right[2] @property def iso8601(self): return self.__opts.iso8601 @property def verbose(self): return self.__opts.verbose # ---------------------------------------------------------------------------------------------------------------- def print_help(self, file): self.__parser.print_help(file) def __str__(self, *args, **kwargs): return "CmdCSVJoin:{type:%s, left:%s, right:%s, iso8601:%s, verbose:%s}" % \ (self.type, self.__opts.left, self.__opts.right, self.iso8601, self.verbose)
31.284404
118
0.509091
e732a0f3b9657c0c162617a04c72dcd3fbb9e46b
557
js
JavaScript
rnPractice/examples/example4/router/drawer/navigationConfiguration.js
ollirus/flexbox-practice
a404927875ec4998497a1b87c53b64e57bd52edb
[ "MIT" ]
null
null
null
rnPractice/examples/example4/router/drawer/navigationConfiguration.js
ollirus/flexbox-practice
a404927875ec4998497a1b87c53b64e57bd52edb
[ "MIT" ]
null
null
null
rnPractice/examples/example4/router/drawer/navigationConfiguration.js
ollirus/flexbox-practice
a404927875ec4998497a1b87c53b64e57bd52edb
[ "MIT" ]
null
null
null
import { DrawerNavigator } from 'react-navigation'; import StackNavigation from '../stack/StackNavigation'; const routeConfiguration = { PremierLeague: { screen: StackNavigation, navigationOptions: { drawer: { label: 'Premier League' }, }, }, LaLiga: { screen: StackNavigation, navigationOptions: { drawer: { label: 'La liga' }, }, }, SerieA: { screen: StackNavigation, navigationOptions: { drawer: { label: 'Serie A' }, }, }, }; export const Drawer = DrawerNavigator(routeConfiguration);
21.423077
58
0.637343
c6c4513a749136d4666a5d933859417e638e7e01
1,166
swift
Swift
PinboardTests/UserRequestsTests.swift
mono0926/mono-kit
e8510ff693873f863f70dfca53f1aa101cb66836
[ "MIT" ]
13
2017-02-11T11:20:33.000Z
2019-12-06T06:49:49.000Z
PinboardTests/UserRequestsTests.swift
mono0926/mono-kit
e8510ff693873f863f70dfca53f1aa101cb66836
[ "MIT" ]
7
2017-02-11T13:58:38.000Z
2020-03-17T22:52:23.000Z
PinboardTests/UserRequestsTests.swift
mono0926/mono-kit
e8510ff693873f863f70dfca53f1aa101cb66836
[ "MIT" ]
1
2017-02-12T21:53:12.000Z
2017-02-12T21:53:12.000Z
// // UserRequestsTests.swift // monokit // // Created by mono on 2017/02/11. // Copyright © 2017 mono. All rights reserved. // import XCTest import Lib import RxSwift import APIKit @testable import Pinboard class UserRequestsTests: XCTestCase { private let disposeBag = DisposeBag() override func setUp() { super.setUp() } override func tearDown() { super.tearDown() } func testApiToken() { let expectation = self.expectation(description: #function) let request = UserRequests.ApiToken(user: TestDataUtil.user, password: TestDataUtil.password) Session.shared.rx.response(request) .subscribe { event in switch event { case .error(let error): XCTFail(String(describing: error)) case .next(let element): logger.debug(element) XCTAssertEqual(element.result, TestDataUtil.apiToken) case .completed: expectation.fulfill() } }.addDisposableTo(disposeBag) waitForExpectations(timeout: 5, handler: nil) } }
25.347826
101
0.596913
c819ce7c275711ac777a8bb8f120b83fd844fcb7
881
swift
Swift
WPAppKit/Classes/Cocoa/UIKit/+UISwitch.swift
WHeB/WPAppKit
3b5e9e0d97f2d92c283ff12035bb154187dc7e27
[ "MIT" ]
5
2019-10-14T07:53:08.000Z
2020-11-02T05:35:54.000Z
WPAppKit/Classes/Cocoa/UIKit/+UISwitch.swift
WHeB/WPAppKit
3b5e9e0d97f2d92c283ff12035bb154187dc7e27
[ "MIT" ]
null
null
null
WPAppKit/Classes/Cocoa/UIKit/+UISwitch.swift
WHeB/WPAppKit
3b5e9e0d97f2d92c283ff12035bb154187dc7e27
[ "MIT" ]
null
null
null
// // +UISwitch.swift // WPAppKit // // Created by 王鹏 on 2020/7/16. // import UIKit public extension UISwitch { /// 系统默认颜色的开关 convenience init(target: AnyObject, action: Selector) { self.init() self.addTarget(target, action: action, for: .valueChanged) } /// 自定义颜色的开关 convenience init(onColor: UIColor, offColor: UIColor, thumbColor: UIColor, target: AnyObject, action: Selector) { self.init() self.onTintColor = onColor //设置开启状态显示的颜色 self.tintColor = offColor //设置关闭状态的颜色 self.thumbTintColor = thumbColor //滑块上小圆点的颜色 self.addTarget(target, action: action, for: .valueChanged) } func toggle(animated: Bool? = true) { setOn(!isOn, animated: animated!) } }
23.810811
66
0.550511
69d082abf2e3774d16b8c01802d6355cf3b19516
363
swift
Swift
Mvvm/Globals/DateExtensions.swift
naim-ali/Mvvm-guide
1a1ff9a1965f63778ff37377e524b19db8b1b1c1
[ "MIT" ]
null
null
null
Mvvm/Globals/DateExtensions.swift
naim-ali/Mvvm-guide
1a1ff9a1965f63778ff37377e524b19db8b1b1c1
[ "MIT" ]
null
null
null
Mvvm/Globals/DateExtensions.swift
naim-ali/Mvvm-guide
1a1ff9a1965f63778ff37377e524b19db8b1b1c1
[ "MIT" ]
null
null
null
// // DateExtensions.swift // Mvvm // // Created by Sagepath on 2/26/18. // Copyright © 2018 Sean Davis. All rights reserved. // import Foundation extension Date { func toString() -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-ddTHH:mm:ss" return dateFormatter.string(from: self) } }
18.15
56
0.641873
00457be1d238ddae2f2c0f30d51a9e0db85f4d5a
999
swift
Swift
PledgKit/Classes/LoadingViewController.swift
pledgcorporate/ecard-ios
4095c726837d40151fd272d2334c4208bf602a04
[ "MIT" ]
null
null
null
PledgKit/Classes/LoadingViewController.swift
pledgcorporate/ecard-ios
4095c726837d40151fd272d2334c4208bf602a04
[ "MIT" ]
null
null
null
PledgKit/Classes/LoadingViewController.swift
pledgcorporate/ecard-ios
4095c726837d40151fd272d2334c4208bf602a04
[ "MIT" ]
null
null
null
// // LoadingViewController.swift // // Created by Lukasz Zajdel on 08.08.2015. // Copyright (c) 2015 Gotap. All rights reserved. // import UIKit class PledgLoadingViewController: UIViewController { var viewSettings:ViewConfiguration! var loadingText:String = NSLocalizedString("Loading ...", comment: ""){ didSet{ if let loadingLabel = loadingLabel{ loadingLabel.text = loadingText } } } @IBOutlet weak var loadingLabel: UILabel!{ didSet{ loadingLabel.text = loadingText } } @IBOutlet weak var loadingIndicatorView: UIActivityIndicatorView! static func newController(loadingText:String)->PledgLoadingViewController{ let vc = UIStoryboard.podStoryboard().instantiateViewController(withIdentifier: "PledgLoadingViewController") as! PledgLoadingViewController vc.loadingText = loadingText return vc } }
24.975
148
0.642643
e5fb73a010cf21fd360c796437ffdfe28abcd0bf
1,547
kt
Kotlin
app/src/main/java/com/gnrchmt/swapi/networking/ApiClient.kt
gianrachmat/swapi-android
9e2b080c35bb19d9b172aa9ebfdf03532e4ac264
[ "MIT" ]
null
null
null
app/src/main/java/com/gnrchmt/swapi/networking/ApiClient.kt
gianrachmat/swapi-android
9e2b080c35bb19d9b172aa9ebfdf03532e4ac264
[ "MIT" ]
null
null
null
app/src/main/java/com/gnrchmt/swapi/networking/ApiClient.kt
gianrachmat/swapi-android
9e2b080c35bb19d9b172aa9ebfdf03532e4ac264
[ "MIT" ]
null
null
null
package com.gnrchmt.swapi.networking import com.gnrchmt.swapi.BuildConfig import com.gnrchmt.swapi.utils.BASE_URL import com.gnrchmt.swapi.utils.TIME_OUT import okhttp3.Interceptor import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import retrofit2.converter.scalars.ScalarsConverterFactory import java.util.concurrent.TimeUnit class ApiClient { private val log by lazy { HttpLoggingInterceptor() .setLevel(HttpLoggingInterceptor.Level.BODY) } fun mainClient(): IApi { val interceptor = Interceptor { val request = it.request().newBuilder() // add header here .build() it.proceed(request) } return createClient(IApi::class.java, interceptor) } private fun <T> createClient(clientApi: Class<T>, interceptor: Interceptor? = null): T { val client = OkHttpClient.Builder().apply { if (BuildConfig.DEBUG) addInterceptor(log) if (interceptor != null) addInterceptor(interceptor) connectTimeout(TIME_OUT, TimeUnit.SECONDS) writeTimeout(TIME_OUT, TimeUnit.SECONDS) readTimeout(TIME_OUT, TimeUnit.SECONDS) } val retrofit by lazy { Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory(ScalarsConverterFactory.create()) .client(client.build()) .build() } return retrofit.create(clientApi) } }
31.571429
92
0.646412
c1a44e24bb2e026c870eddd000c60b55385208e8
325
rs
Rust
7kyu/simple-consecutive-pairs/benches/bench.rs
lincot/rusted-katana
3979ff39d5c10f5d413debf0447d9e7588f2478f
[ "BSD-2-Clause" ]
null
null
null
7kyu/simple-consecutive-pairs/benches/bench.rs
lincot/rusted-katana
3979ff39d5c10f5d413debf0447d9e7588f2478f
[ "BSD-2-Clause" ]
null
null
null
7kyu/simple-consecutive-pairs/benches/bench.rs
lincot/rusted-katana
3979ff39d5c10f5d413debf0447d9e7588f2478f
[ "BSD-2-Clause" ]
null
null
null
#![feature(test)] extern crate test; use simple_consecutive_pairs::pairs; use test::{black_box, Bencher}; #[bench] fn bench(bencher: &mut Bencher) { let arr = black_box(&[21, 20, 22, 40, 39, -56, 30, -55, 95, 94]); bencher.iter(|| { for _ in 0..1000 { black_box(pairs(arr)); } }); }
20.3125
69
0.566154
dd72683055f3b846157b3124d841d214e507ad63
3,157
go
Go
cmd/things.go
mikehaller/iot-suite-cli
b70ce1c7acb51c2fd8371e627bb8655eb13773e2
[ "Apache-2.0" ]
4
2020-07-27T07:09:09.000Z
2021-06-11T13:38:28.000Z
cmd/things.go
mikehaller/iot-suite-cli
b70ce1c7acb51c2fd8371e627bb8655eb13773e2
[ "Apache-2.0" ]
null
null
null
cmd/things.go
mikehaller/iot-suite-cli
b70ce1c7acb51c2fd8371e627bb8655eb13773e2
[ "Apache-2.0" ]
null
null
null
package cmd import ( "github.com/mikehaller/iot-suite-cli/iotsuite" "github.com/spf13/cobra" "github.com/spf13/viper" ) func init() { rootCmd.AddCommand(thingsCmd) thingsCmd.AddCommand(searchCmd) thingsCmd.AddCommand(countCmd) thingsCmd.AddCommand(solutionCmd) thingsCmd.AddCommand(connectionsCmd) searchCmd.Flags().String("filter", "", "Filter query") viper.BindPFlag("filter", searchCmd.Flags().Lookup("filter")) searchCmd.Flags().String("fields", "thingId,attributes,features", "Filter query") viper.BindPFlag("fields", searchCmd.Flags().Lookup("fields")) searchCmd.Flags().String("namespaces", "", "Limit search to list of comma-separated namespaces") viper.BindPFlag("namespaces", searchCmd.Flags().Lookup("namespaces")) countCmd.Flags().String("filter", "", "Filter query") viper.BindPFlag("filter", countCmd.Flags().Lookup("filter")) countCmd.Flags().String("fields", "thingId,attributes,features", "Filter query") viper.BindPFlag("fields", countCmd.Flags().Lookup("fields")) countCmd.Flags().String("namespaces", "", "Limit search to list of comma-separated namespaces") viper.BindPFlag("namespaces", countCmd.Flags().Lookup("namespaces")) thingsCmd.PersistentFlags().String("solutionId", "", "The Solution Id aka Service Instance ID") viper.BindPFlag("solutionId", thingsCmd.PersistentFlags().Lookup("solutionId")) thingsCmd.PersistentFlags().String("baseurl", "https://things.eu-1.bosch-iot-suite.com", "The base url for Things API, e.g. https://things.eu-1.bosch-iot-suite.com") viper.BindPFlag("baseurl", thingsCmd.PersistentFlags().Lookup("baseurl")) } var thingsCmd = &cobra.Command{ Use: "things", Short: "Access things", Long: `Access the Things API`, } var countCmd = &cobra.Command{ Use: "count", Short: "Count number of things", Long: `Count the number of things`, Run: func(cmd *cobra.Command, args []string) { conf := iotsuite.ReadConfig() httpclient := iotsuite.InitOAuth(conf) iotsuite.ThingsCount(httpclient, viper.GetString("filter"),viper.GetString("namespaces")) }, } var searchCmd = &cobra.Command{ Use: "search", Short: "Search for things", Long: `Search for things with a filter`, Run: func(cmd *cobra.Command, args []string) { conf := iotsuite.ReadConfig() httpclient := iotsuite.InitOAuth(conf) iotsuite.Things(httpclient, viper.GetString("fields"), viper.GetString("filter"),viper.GetString("namespaces")) }, } var solutionCmd = &cobra.Command{ Use: "solution", Short: "Show the configuration of a Solution", Long: `Retrieves and displays the configuration of a Bosch IoT Things Solution`, Run: func(cmd *cobra.Command, args []string) { conf := iotsuite.ReadConfig() httpclient := iotsuite.InitOAuth(conf) iotsuite.ThingsSolution(conf, httpclient, viper.GetString("solutionId")) }, } var connectionsCmd = &cobra.Command{ Use: "connections", Short: "Show connections", Long: `Shows a list of all configured connections`, Run: func(cmd *cobra.Command, args []string) { conf := iotsuite.ReadConfig() httpclient := iotsuite.InitOAuth(conf) iotsuite.ThingsConnections(conf, httpclient, viper.GetString("solutionId")) }, }
34.692308
166
0.725689
653326363f171f61656c55ab1ac0a5e07a6afbd8
18,085
pyw
Python
quizme.pyw
dmahugh/quizme
edd5340db4524855c7e0dea0340339dafb10a78a
[ "MIT" ]
null
null
null
quizme.pyw
dmahugh/quizme
edd5340db4524855c7e0dea0340339dafb10a78a
[ "MIT" ]
null
null
null
quizme.pyw
dmahugh/quizme
edd5340db4524855c7e0dea0340339dafb10a78a
[ "MIT" ]
null
null
null
"""GUI for taking tests based on quizme-xxx.json files. """ import os import sys import json from random import randint import tkinter as tk from tkinter import font from tkinter import ttk from tkinter import filedialog from tkinter import messagebox from widgetrefs import widgets def center_window(window): """Position a window in the center of the screen. 1st parameter = window """ window.update_idletasks() width = window.winfo_screenwidth() height = window.winfo_screenheight() size = tuple(int(_) for _ in window.geometry().split('+')[0].split('x')) offsetx = width/2 - size[0]/2 offsety = height/2 - size[1]/2 window.geometry("%dx%d+%d+%d" % (size + (offsetx, offsety))) def display_help(): """Display the help screen. """ helpmsg = ( 'QuizMe is an interactive tool for testing your ability to answer\n' 'a set of multi-choice questions.\n\n' 'Use the underlined hotkeys 1-5 to select your answer, then\n' 'press C to check your answer. You can also press Enter to\n' 'check your answer.\n\n' 'To select a different question, press P, N, or R for Previous,\n' 'Next or Random. You can also use the left/right arrow keys to\n' 'move through the questions in order.\n\n' 'Have fun!') messagebox.showinfo('Help', helpmsg) def display_score(): """Display the current score (number and percent correct). """ totq = len(widgets.questions) # total questions in current topic totans = widgets.totAnswered # number of questions answered so far correct = widgets.totCorrect # number of correct answers so far perc = 0 if totans == 0 else 100*(correct/totans) title = widgets.topic + ' - {0} total questions'.format(totq) msg = "You have {0} out of {1} correct for {2:.0f}%." messagebox.showinfo(title, msg.format(correct, totans, perc)) def display_question(): """Refresh display for current question. Note: question-related state info is stored in widgets. properties. """ q_num = widgets.currentq # current question# u_answered = (q_num in widgets.answered) # whether answered u_answer = widgets.answered.get(q_num, '') # user's answer (if any) question = widgets.questions[q_num] # current question dict() q_corrnum = question['correct'] # the correct answer ('1' through '5') q_corrtext = question['answers'].get(q_corrnum, '') # text of answer u_correct = (u_answer == q_corrnum) # whether user's answer is correct widgets.lblHeader.configure(text='Topic:\n'+widgets.topic) widgets.txtQuestion.config(state="normal") widgets.txtQuestion.delete(1.0, tk.END) widgets.txtQuestion.insert(tk.END, question['question']) widgets.txtQuestion.focus_set() # set focus to the question widgets.txtQuestion.config(state="disabled") currentstate = 'disabled' if u_answered else 'normal' display_radiobuttons(rbstate=currentstate, rbselected=u_answer) # "correct answer" textbox widgets.txtCorrect.config(state="normal") widgets.txtCorrect.delete(1.0, tk.END) widgets.txtCorrect.config(bg="white") if u_answered: if u_correct: msg = '#' + u_answer + ' is CORRECT - ' + q_corrtext else: msg = '#' + u_answer + \ ' is INCORRECT - correct answer is #' + \ q_corrnum + ': ' + q_corrtext widgets.txtCorrect.insert(tk.END, msg) bgcolor = "#B1ECB1" if u_correct else "#FFC6C5" else: bgcolor = 'white' # white background if question not answered yet widgets.txtCorrect.config(bg=bgcolor) widgets.txtCorrect.config(state="disabled") widgets.txtExplanation.config(state="normal") widgets.txtExplanation.delete(1.0, tk.END) if u_answered: widgets.txtExplanation.insert(tk.END, question.get('explanation', '')) widgets.txtExplanation.config(state="disabled") image = question.get('image', '') answerimage = question.get('answerimage', '') displayedimage = answerimage if (u_answered and answerimage) else image if displayedimage: displayedimage = 'images/' + displayedimage # PhotoImage() needs a reference to avoid garbage collection widgets.image = tk.PhotoImage(file=displayedimage) widgets.lblImage.configure(image=widgets.image) else: widgets.image = None widgets.lblImage['image'] = None def display_radiobuttons(rbstate='normal', rbselected=''): """Set radiobuttons to the answer options for the current question. state = the state to set the radiobuttons to; 'normal' or 'disabled' selected = the radiobutton to select (e.g., '1', or '' for none) """ question = widgets.questions[widgets.currentq] # radiobuttons (answers) text1 = question['answers'].get('1', '') text2 = question['answers'].get('2', '') text3 = question['answers'].get('3', '') text4 = question['answers'].get('4', '') text5 = question['answers'].get('5', '') # note that we hide unused radiobuttons by lowering them in # the Z-order so that they're hidden behind widgets.rbframe if text1: widgets.answer1.configure(text='1: '+text1, state=rbstate) widgets.answer1.lift(widgets.rbframe) else: widgets.answer1.configure(text='', state='disabled') widgets.answer1.lower(widgets.rbframe) if text2: widgets.answer2.configure(text='2: '+text2, state=rbstate) widgets.answer2.lift(widgets.rbframe) else: widgets.answer2.configure(text='', state='disabled') widgets.answer2.lower(widgets.rbframe) if text3: widgets.answer3.configure(text='3: '+text3, state=rbstate) widgets.answer3.lift(widgets.rbframe) else: widgets.answer3.configure(text='', state='disabled') widgets.answer3.lower(widgets.rbframe) if text4: widgets.answer4.configure(text='4: '+text4, state=rbstate) widgets.answer4.lift(widgets.rbframe) else: widgets.answer4.configure(text='', state='disabled') widgets.answer4.lower(widgets.rbframe) if text5: widgets.answer5.configure(text='5: '+text5, state=rbstate) widgets.answer5.lift(widgets.rbframe) else: widgets.answer5.configure(text='', state='disabled') widgets.answer5.lower(widgets.rbframe) # select the user's answer (or clear selection if rbselected=='') widgets.answerSelection.set(rbselected) def initialize_score(): """Initialize/reset the total answered and total correct. """ widgets.totAnswered = 0 widgets.totCorrect = 0 widgets.answered = dict() # key=question#, value = user's answer def keystroke_bindings(): """Assign keyboard shortcuts. """ root.bind('1', lambda event: widgets.answerSelection.set('1')) root.bind('2', lambda event: widgets.answerSelection.set('2')) root.bind('3', lambda event: widgets.answerSelection.set('3')) root.bind('4', lambda event: widgets.answerSelection.set('4')) root.bind('5', lambda event: widgets.answerSelection.set('5')) root.bind('c', lambda event: save_answer()) root.bind('C', lambda event: save_answer()) root.bind('<Return>', lambda event: save_answer()) root.bind('<Left>', lambda event: move_previous()) root.bind('p', lambda event: move_previous()) root.bind('P', lambda event: move_previous()) root.bind('<Right>', lambda event: move_next()) root.bind('n', lambda event: move_next()) root.bind('N', lambda event: move_next()) root.bind('r', lambda event: move_random()) root.bind('R', lambda event: move_random()) root.bind('s', lambda event: display_score()) root.bind('S', lambda event: display_score()) root.bind('t', lambda event: select_topic(gui=True)) root.bind('T', lambda event: select_topic(gui=True)) root.bind('h', lambda event: display_help()) root.bind('H', lambda event: display_help()) root.bind('<F1>', lambda event: display_help()) root.bind("<Key-Escape>", lambda event: root.quit()) # Esc=quit def move_next(): """Move to next question. """ qnum_int = int(widgets.currentq) # convert question# to integer if qnum_int < widgets.totalquestions: widgets.currentq = str(qnum_int + 1) display_question() def move_previous(): """Move to previous question. """ qnum_int = int(widgets.currentq) # convert question# to integer if qnum_int > 1: widgets.currentq = str(qnum_int - 1) display_question() def move_random(): """Move to a random question. """ # handle the case where all questions have been answered if len(widgets.answered) == widgets.totalquestions: topic_completed() return # unanswered[] = list of remaining unanswered question numbers unanswered = [] for qnum in range(1, widgets.totalquestions+1): if str(qnum) not in widgets.answered: unanswered.append(str(qnum)) # now we select a random question# from unanswered[] random_index = randint(0, len(unanswered)-1) widgets.currentq = str(unanswered[random_index]) display_question() def pythonw_setup(): """Handle default folder location if running under pythonw.exe. The pythonw.exe launcher starts from the Windows System32 folder as the default location, which isn't typically what's desired. This function checks whether we're running under pythonw.exe, and if so sets the default folder to the location of this program. """ fullname = sys.executable nameonly = os.path.split(fullname)[1].split('.')[0].lower() if nameonly == 'pythonw': progfolder = os.path.dirname(os.path.realpath(sys.argv[0])) os.chdir(progfolder) def read_datafile(): """Read widgets.dataFile and store questions in widgets.questions. NOTE: the data file must include questions numbered 1-N with no gaps. """ with open(widgets.dataFile, 'r') as jsonfile: widgets.questions = json.load(jsonfile) widgets.currentq = '1' # current question# widgets.totalquestions = len(widgets.questions) def save_answer(): """Save the current answer and refresh displayed question. """ q_num = widgets.currentq # current question# question = widgets.questions[q_num] # current question dict() if q_num in widgets.answered: return # this question has already been answered answer = widgets.answerSelection.get() if not answer or answer not in '12345': return # an answer has not been selected # update totals widgets.totAnswered += 1 if answer == question['correct']: widgets.totCorrect += 1 widgets.answered[q_num] = answer # refresh the display based on current status display_question() # if all questions have been answered, display score if len(widgets.answered) == widgets.totalquestions: topic_completed() def select_topic(gui=True): """Select a topic (.json file). If gui=True, the quizme app window exists and will be updated if a topic is selected. Returns the selected filename (or '' if none selected), and the global widgets object's properties are updated. """ if not gui: tempwindow = tk.Tk() # create the top-level window tempwindow.withdraw() # hide the top-level window behind this dialog newtopic = filedialog.askopenfilename(title='select QuizMe file', initialdir='data', filetypes=[('JSON files', '.json')]) if not gui: tempwindow.destroy() # destroy the temporary top-level window if newtopic: # a file was selected widgets.dataFile = newtopic # by convention topic name is the part of the filename after '-' # e.g., filename = quizme-TopicName.json nameonly = os.path.basename(newtopic) nameonly = os.path.splitext(nameonly)[0] widgets.topic = nameonly widgets.currentq = '1' # start with first topic widgets.answered = {} # reset answered questions if gui: read_datafile() display_question() return newtopic def topic_completed(): """Topic has been completed, so show score and ask whether to re-start. """ messagebox.showwarning( 'Topic Completed', 'You have already answered all of the questions in this topic!') display_score() questiontext = 'Do you want to start over with this topic?' if messagebox.askyesno('Topic Completed', questiontext): initialize_score() widgets.currentq = '1' display_question() class MainApplication(ttk.Frame): """Root application class. """ def __init__(self, parent, *args, **kwargs): ttk.Frame.__init__(self, parent, *args, **kwargs) self.grid(sticky="nsew") self.parent = parent self.parent.title('QuizMe') self.parent.iconbitmap('quizme.ico') initialize_score() self.widgets_create() display_question() # display first question in selected topic # customize styles style = ttk.Style() style.configure("TButton", font=('Verdana', 12)) style.configure("TRadiobutton", font=('Verdana', 12)) keystroke_bindings() def widgets_create(self): """Create all widgets in the main application window. """ # configure resizing behavior top = self.winfo_toplevel() top.rowconfigure(1, weight=1) top.columnconfigure(0, weight=1) self.rowconfigure(1, weight=1) self.columnconfigure(0, weight=1) # create the widgets self.frm_question = FrameQuestion(self) self.frm_controls = FrameControls(self) self.frm_question.grid(row=1, column=0, sticky="w", padx=5, pady=5) self.frm_controls.grid(row=1, column=1, sticky="w", padx=5, pady=5) self.parent.columnconfigure(0, weight=1) widgets.lblImage = tk.Label(self) widgets.lblImage.place(x=511, y=50, height=300, width=300) class FrameControls(ttk.Frame): """Frame for the controls (buttons). """ def __init__(self, parent, *args, **kwargs): ttk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent widgets.lblHeader = tk.Label(self, text='Topic:\n???', font=font.Font(family="Verdana", size=12), bg="#6FD2F4", height=4, width=12) widgets.lblHeader.pack(fill=tk.Y, padx=10, pady=10, expand=True) btnpadding = dict(padx=10, pady=5) ttk.Button(self, underline=0, text="Check Answer", command=save_answer).pack(**btnpadding) ttk.Button(self, underline=0, text="Next", command=move_next).pack(**btnpadding) ttk.Button(self, underline=0, text="Previous", command=move_previous).pack(**btnpadding) ttk.Button(self, underline=0, text="Random", command=move_random).pack(**btnpadding) ttk.Button(self, underline=0, text="Score", command=display_score).pack(**btnpadding) ttk.Button(self, underline=0, text="Topic", command=lambda: select_topic(gui=True)).pack(**btnpadding) ttk.Button(self, underline=0, text="Help", command=display_help).pack(**btnpadding) class FrameQuestion(ttk.Frame): """Frame for the question, answers, and explanation. """ def __init__(self, parent, *args, **kwargs): ttk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent widgets.txtQuestion = tk.Text(self, height=2, border=0, font=font.Font(family="Verdana", size=12)) widgets.txtQuestion.pack(anchor=tk.W, padx=5, pady=5, expand=tk.Y) widgets.txtQuestion.config(state="disabled") widgets.answerSelection = tk.StringVar() # create a frame to be used for hiding/showing radiobuttons widgets.rbframe = tk.Frame(self) widgets.rbframe.pack(side="top", fill="both", expand=True) rbops = dict(variable=widgets.answerSelection, underline=0) packoptions = dict(in_=widgets.rbframe, anchor=tk.W, padx=15, pady=17) widgets.answer1 = ttk.Radiobutton(self, value='1', text="1:", **rbops) widgets.answer1.pack(**packoptions) widgets.answer2 = ttk.Radiobutton(self, value='2', text="2:", **rbops) widgets.answer2.pack(**packoptions) widgets.answer3 = ttk.Radiobutton(self, value='3', text="3:", **rbops) widgets.answer3.pack(**packoptions) widgets.answer4 = ttk.Radiobutton(self, value='4', text="4:", **rbops) widgets.answer4.pack(**packoptions) widgets.answer5 = ttk.Radiobutton(self, value='5', text="5:", **rbops) widgets.answer5.pack(**packoptions) widgets.txtCorrect = tk.Text(self, border=0, height=2, font=('Verdana', 12)) widgets.txtCorrect.pack(anchor=tk.W, padx=5, pady=8, expand=tk.Y) widgets.txtCorrect.config(state="disabled") widgets.txtExplanation = tk.Text( self, height=2, border=0, font=font.Font(family="Verdana", size=12)) widgets.txtExplanation.pack(anchor=tk.W, padx=5, pady=5, expand=tk.Y) # if running standalone, launch the app if __name__ == "__main__": pythonw_setup() filename = select_topic(gui=False) # pylint: disable=C0103 if not filename: sys.exit(0) read_datafile() # read in the selected data file root = tk.Tk() # pylint: disable=C0103 MainApplication(root) root.minsize(width=900, height=400) root.resizable(width=False, height=False) # app window not resizable root.attributes("-topmost", True) # force app window to top root.attributes("-topmost", False) root.focus_force() # give app window focus center_window(root) root.mainloop()
38.397028
80
0.648825
f0150ff2c65a0c4f5e6fe34521cca028d15290ed
170
js
JavaScript
packages/java-shell/src/test/resources/db/help.js
deriamis/mongosh
f1d40bbac736ed7b8998491c2511f5809c17efe8
[ "Apache-2.0" ]
175
2019-10-03T01:47:43.000Z
2022-03-26T20:49:00.000Z
packages/java-shell/src/test/resources/db/help.js
addaleax/mongosh
490ae2e01da6ec8a639aeca4991b2348fe5ee6f7
[ "Apache-2.0" ]
203
2020-01-14T10:24:32.000Z
2022-03-31T13:42:56.000Z
packages/java-shell/src/test/resources/db/help.js
addaleax/mongosh
490ae2e01da6ec8a639aeca4991b2348fe5ee6f7
[ "Apache-2.0" ]
24
2019-12-30T09:35:39.000Z
2022-03-16T19:07:13.000Z
// command dontCheckValue help // command dontCheckValue help() // command getArrayItem=0 extractProperty=name help // command getArrayItem=0 extractProperty=name help()
18.888889
46
0.8
ffbcdd522edce4278b434e2e9b581e36c8db1f6d
225
asm
Assembly
data/mapHeaders/OaksLab.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapHeaders/OaksLab.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapHeaders/OaksLab.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
OaksLab_h: db DOJO ; tileset db OAKS_LAB_HEIGHT, OAKS_LAB_WIDTH ; dimensions (y, x) dw OaksLab_Blocks ; blocks dw OaksLab_TextPointers ; texts dw OaksLab_Script ; scripts db 0 ; connections dw OaksLab_Object ; objects
25
55
0.773333
d0b82274dcbe2a7abf976bf06b296df7794ef533
4,028
css
CSS
style/white-theme.css
ONLYOFFICE/plugin-photoeditor
995b5f62152f86b2663ebe702f3cbeece79e3d5b
[ "Apache-2.0", "MIT" ]
2
2020-10-07T17:00:38.000Z
2021-02-22T04:47:33.000Z
style/white-theme.css
ONLYOFFICE/plugin-photoeditor
995b5f62152f86b2663ebe702f3cbeece79e3d5b
[ "Apache-2.0", "MIT" ]
3
2021-01-14T17:22:52.000Z
2022-02-06T16:45:44.000Z
style/white-theme.css
ONLYOFFICE/plugin-photoeditor
995b5f62152f86b2663ebe702f3cbeece79e3d5b
[ "Apache-2.0", "MIT" ]
7
2020-10-07T15:38:20.000Z
2022-03-31T06:51:43.000Z
.tui-image-editor-container .tui-image-editor-controls { background-color: #f1f1f1; } .tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item{ cursor: default; } #tie-btn-undo:hover,#tie-btn-redo:hover,#tie-btn-reset:hover,#tie-btn-delete:hover,#tie-btn-delete-all:hover,#tie-btn-crop:hover,#tie-btn-flip:hover,#tie-btn-rotate:hover,#tie-btn-draw:hover,#tie-btn-shape:hover,#tie-btn-icon:hover,#tie-btn-text:hover,#tie-btn-mask:hover,#tie-btn-filter:hover{ background-color: #d8dadc; cursor:pointer; } .tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item.active { background-color: #7d858c !important; } .tui-image-editor-container .tui-image-editor-submenu { background-color: rgba(226,226,226,0.96) } .tui-image-editor-container .tui-image-editor-main { top: 0px; } .tui-image-editor-container .tui-image-editor-partition > div { border-left: 1px solid #282828; } #tie-draw-line-select-button.line .tui-image-editor-button.line .svg_ic-submenu, #tie-draw-line-select-button.free .tui-image-editor-button.free .svg_ic-submenu{ background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; } #tie-crop-button .tui-image-editor-button.preset.active .svg_ic-submenu, #tie-crop-preset-button .tui-image-editor-button.preset.active .svg_ic-submenu{ background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; } #tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] .svg_ic-submenu,#tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] .svg_ic-submenu,#tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] .svg_ic-submenu,#tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] .svg_ic-submenu,#tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] .svg_ic-submenu,#tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] .svg_ic-submenu,#tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] .svg_ic-submenu,#tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] .svg_ic-submenu,#tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] .svg_ic-submenu,#tie-shape-button.rect .tui-image-editor-button.rect .svg_ic-submenu, #tie-shape-button.circle .tui-image-editor-button.circle .svg_ic-submenu,#tie-shape-button.triangle .tui-image-editor-button.triangle .svg_ic-submenu,#tie-flip-button.resetFlip .tui-image-editor-button.resetFlip .svg_ic-submenu,#tie-flip-button.flipX .tui-image-editor-button.flipX .svg_ic-submenu,#tie-flip-button.flipY .tui-image-editor-button.flipY .svg_ic-submenu { background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; } #tie-text-effect-button .tui-image-editor-button.bold.active .svg_ic-submenu, #tie-text-effect-button .tui-image-editor-button.italic.active .svg_ic-submenu, #tie-text-effect-button .tui-image-editor-button.underline.active .svg_ic-submenu{ background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-menu-text .tui-image-editor-submenu-item .center .tui-image-editor-button.center .svg_ic-submenu, .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-menu-text .tui-image-editor-submenu-item .left .tui-image-editor-button.left .svg_ic-submenu, .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-menu-text .tui-image-editor-submenu-item .right .tui-image-editor-button.right .svg_ic-submenu { background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button:hover .svg_ic-submenu { background-color: #7d858c; transition: all 0.3s ease; border-radius: 2px; }
73.236364
1,368
0.757448
c8a92524e89f80364c834a5e6b89fdd0321207c4
7,413
swift
Swift
CodeEdit/ContentView.swift
Gurpreet-Singh121/CodeEdit
ffa51e881b80b6e7a6bcc70375bd9d388fe1c5e1
[ "MIT" ]
null
null
null
CodeEdit/ContentView.swift
Gurpreet-Singh121/CodeEdit
ffa51e881b80b6e7a6bcc70375bd9d388fe1c5e1
[ "MIT" ]
null
null
null
CodeEdit/ContentView.swift
Gurpreet-Singh121/CodeEdit
ffa51e881b80b6e7a6bcc70375bd9d388fe1c5e1
[ "MIT" ]
null
null
null
// // ContentView.swift // CodeEdit // // Created by Austin Condiff on 3/10/22. // import SwiftUI import WorkspaceClient struct WorkspaceView: View { @State private var directoryURL: URL? @State private var workspaceClient: WorkspaceClient? // TODO: Create a ViewModel to hold selectedId, openFileItems, ... to pass it to subviews as an EnvironmentObject (less boilerplate parameters) @State private var selectedId: WorkspaceClient.FileId? @State private var openFileItems: [WorkspaceClient.FileItem] = [] @State private var urlInit = false @State private var showingAlert = false @State private var alertTitle = "" @State private var alertMsg = "" var tabBarHeight = 28.0 private var path: String = "" func closeFileTab(item: WorkspaceClient.FileItem) { guard let idx = openFileItems.firstIndex(of: item) else { return } let closedFileItem = openFileItems.remove(at: idx) guard closedFileItem.id == selectedId else { return } if openFileItems.isEmpty { selectedId = nil } else if idx == 0 { selectedId = openFileItems.first?.id } else { selectedId = openFileItems[idx - 1].id } } var body: some View { NavigationView { if let workspaceClient = workspaceClient, let directoryURL = directoryURL { sidebar(workspaceClient: workspaceClient, directoryURL: directoryURL) .frame(minWidth: 250) .toolbar { ToolbarItem(placement: .primaryAction) { Button(action: toggleSidebar) { Image(systemName: "sidebar.leading").imageScale(.large) } .help("Show/Hide Sidebar") } } if openFileItems.isEmpty { Text("Open file from sidebar") } else { ZStack { if let selectedId = selectedId { if let selectedItem = try? workspaceClient.getFileItem(selectedId) { WorkspaceEditorView(item: selectedItem) } } VStack { tabBar .frame(maxHeight: tabBarHeight) .background(Material.regular) Spacer() } } } } else { EmptyView() } } .toolbar { ToolbarItem(placement: .navigation) { Button(action: {}) { Image(systemName: "chevron.left").imageScale(.large) } .help("Back") } ToolbarItem(placement: .navigation) { Button(action: {}){ Image(systemName: "chevron.right").imageScale(.large) } .disabled(true) .help("Forward") } } .frame(minWidth: 800, minHeight: 600) .onOpenURL { url in urlInit = true do { self.workspaceClient = try .default( fileManager: .default, folderURL: url, ignoredFilesAndFolders: ignoredFilesAndDirectory ) self.directoryURL = url } catch { self.alertTitle = "Unable to Open Workspace" self.alertMsg = error.localizedDescription self.showingAlert = true print(error.localizedDescription) } } .alert(alertTitle, isPresented: $showingAlert, actions: { Button(action: { showingAlert = false }) { Text("OK") } }, message: { Text(alertMsg) }) } var tabBar: some View { VStack(spacing: 0.0) { ScrollView(.horizontal, showsIndicators: false) { ScrollViewReader { value in HStack(alignment: .center, spacing: 0.0) { ForEach(openFileItems, id: \.id) { item in let isActive = selectedId == item.id Button(action: { selectedId = item.id }) { HStack(spacing: 0.0) { FileTabRow(fileItem: item, isSelected: isActive) { withAnimation { closeFileTab(item: item) } } Divider() } .frame(height: tabBarHeight) .foregroundColor(isActive ? .primary : .gray) .background(isActive ? Material.bar : Material.regular) .animation(.easeOut(duration: 0.2), value: openFileItems) } .buttonStyle(.plain) .id(item.id) } } .onChange(of: selectedId) { newValue in withAnimation { value.scrollTo(newValue) } } } } Divider() .foregroundColor(.gray) .frame(height: 1.0) } } func sidebar( workspaceClient: WorkspaceClient, directoryURL: URL ) -> some View { List { Section(header: Text(directoryURL.lastPathComponent)) { OutlineGroup(workspaceClient.getFiles(), children: \.children) { item in if item.children == nil { // TODO: Add selection indicator Button(action: { withAnimation { if !openFileItems.contains(item) { openFileItems.append(item) } } selectedId = item.id }) { Label(item.url.lastPathComponent, systemImage: item.systemImage) .accentColor(.secondary) .font(.callout) } .buttonStyle(.plain) } else { Label(item.url.lastPathComponent, systemImage: item.systemImage) .accentColor(.secondary) .font(.callout) } } } } } private func toggleSidebar() { #if os(iOS) #else NSApp.keyWindow?.firstResponder?.tryToPerform(#selector(NSSplitViewController.toggleSidebar(_:)), with: nil) #endif } } struct ContentView_Previews: PreviewProvider { static var previews: some View { WorkspaceView() } }
36.880597
144
0.440308
1e5bf177c882889868c377f3a3255466ed71de55
169
css
CSS
client/src/app/app.component.css
MihailValkov/shared-trips
ae8987c14fa1fb8d945ae00c321d7d482e505361
[ "MIT" ]
1
2021-11-06T09:52:40.000Z
2021-11-06T09:52:40.000Z
client/src/app/app.component.css
MihailValkov/shared-trips
ae8987c14fa1fb8d945ae00c321d7d482e505361
[ "MIT" ]
null
null
null
client/src/app/app.component.css
MihailValkov/shared-trips
ae8987c14fa1fb8d945ae00c321d7d482e505361
[ "MIT" ]
null
null
null
:host { display: flex; flex-direction: column; } main { position: relative; min-height: 92vh; } @media (max-width: 768px) { main { margin-top: 50px; } }
12.071429
27
0.60355
397abf0a6e87080dd849df7e8eadfddfe0db4163
2,155
asm
Assembly
Sources/Elastos/Runtime/Core/carapi/invokeCallback_ievc.asm
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
7
2017-07-13T10:34:54.000Z
2021-04-16T05:40:35.000Z
Sources/Elastos/Runtime/Core/carapi/invokeCallback_ievc.asm
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/Runtime/Core/carapi/invokeCallback_ievc.asm
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
9
2017-07-13T12:33:20.000Z
2021-06-19T02:46:48.000Z
;;========================================================================= ;; Copyright (C) 2012 The Elastos Open Source Project ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. ;; You may obtain a copy of the License at ;; ;; http://www.apache.org/licenses/LICENSE-2.0 ;; ;; Unless required by applicable law or agreed to in writing, software ;; distributed under the License is distributed on an "AS IS" BASIS, ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;; See the License for the specific language governing permissions and ;; limitations under the License. ;;========================================================================= AREA |.text|,ALIGN=2,CODE, READONLY EXPORT invoke invoke mov ip, sp stmdb sp!, {r4, r5, fp, ip, lr} mov fp, ip mov r5, r0 cmp r2, #0 beq call_func mov r4, r1 sub r2, r2, #16 ; 0x10 cmp r2, #0 ; 0x0 ble setreg add r1, r1, #16 ; 0x10 mov r0, #0 ; 0x0 sub sp, sp, r2 setsp ldr r3, [r1, r0] str r3, [sp, r0] add r0, r0, #4 ; 0x4 sub r2, r2, #4 ; 0x4 cmp r2, #0 ; 0x0 bgt setsp setreg ldmia r4!, {r0, r1, r2, r3} call_func mov lr, pc mov pc, r5 ldmdb fp, {r4, r5, fp, sp, pc} END AREA |.text|,ALIGN=2,CODE, READONLY EXPORT invoke invoke mov ip, sp stmdb sp!, {r4, r5, fp, ip, lr} mov fp, ip mov r5, r0 cmp r2, #0 beq call_func mov r4, r1 sub r2, r2, #16 ; 0x10 cmp r2, #0 ; 0x0 ble setreg add r1, r1, #16 ; 0x10 mov r0, #0 ; 0x0 sub sp, sp, r2 setsp ldr r3, [r1, r0] str r3, [sp, r0] add r0, r0, #4 ; 0x4 sub r2, r2, #4 ; 0x4 cmp r2, #0 ; 0x0 bgt setsp setreg ldmia r4!, {r0, r1, r2, r3} call_func mov lr, pc mov pc, r5 ldmdb fp, {r4, r5, fp, sp, pc} END
23.423913
75
0.485847
74bab5503aa95f5539cf8b25c1d65b327961e764
415
js
JavaScript
WebService/Web/src/App.js
mgscuteri/ExampleGoWebApp
52f522cdc4382a851fb072c7dea14716276e78cc
[ "MIT" ]
1
2019-11-18T17:25:54.000Z
2019-11-18T17:25:54.000Z
WebService/Web/src/App.js
mgscuteri/ExampleGoWebApp
52f522cdc4382a851fb072c7dea14716276e78cc
[ "MIT" ]
7
2019-12-30T04:21:46.000Z
2022-03-08T23:07:11.000Z
WebService/Web/src/App.js
mgscuteri/ExampleGoWebApp
52f522cdc4382a851fb072c7dea14716276e78cc
[ "MIT" ]
null
null
null
import React, { Component } from 'react'; import ReactDOM from 'react-dom' import { Route, Link, BrowserRouter as Router } from 'react-router-dom' import './App.css'; import Navbar from './modules/site/navbar.js' import Footer from './modules/site/footer.js' class App extends Component { render() { return ( <div> <Navbar/> <Footer/> </div> ); } } export default App;
17.291667
71
0.628916
63fdeeb769910c1fdd2ebed776cf3c52092b9a01
5,424
lua
Lua
lua/core/plugins.lua
ackerr/nvim
f598fd94eaaac522c1c43b2ebec5e50e0ed072df
[ "MIT" ]
null
null
null
lua/core/plugins.lua
ackerr/nvim
f598fd94eaaac522c1c43b2ebec5e50e0ed072df
[ "MIT" ]
null
null
null
lua/core/plugins.lua
ackerr/nvim
f598fd94eaaac522c1c43b2ebec5e50e0ed072df
[ "MIT" ]
1
2022-01-28T06:49:25.000Z
2022-01-28T06:49:25.000Z
local vim = vim local fn = vim.fn -- Automatically install packer local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local packer_bootstarp if fn.empty(fn.glob(install_path)) > 0 then packer_bootstarp = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path, }) print("Installing packer close and reopen Neovim...") vim.cmd([[packadd packer.nvim]]) end local status_ok, packer = pcall(require, "packer") if not status_ok then return end -- Plugin packer.startup({ function(use) use("wbthomason/packer.nvim") use("nvim-lua/popup.nvim") use("nvim-lua/plenary.nvim") use("kyazdani42/nvim-web-devicons") -- colorscheme use({ "rebelot/kanagawa.nvim", config = function() require("kanagawa").setup() end, }) use({ "goolord/alpha-nvim", requires = { "nvim-telescope/telescope.nvim" } }) use({ "kevinhwang91/nvim-hlslens" }) use({ "tpope/vim-surround" }) use({ "tpope/vim-repeat" }) use({ "numToStr/Comment.nvim", config = function() require("Comment").setup() end, }) use({ "itchyny/vim-cursorword" }) use({ "junegunn/vim-easy-align" }) use({ "editorconfig/editorconfig-vim" }) use({ "terryma/vim-multiple-cursors" }) use({ "mg979/vim-visual-multi" }) use({ "Vimjas/vim-python-pep8-indent", ft = "python" }) use({ "norcalli/nvim-colorizer.lua", config = function() require("colorizer").setup({ "*" }) end, }) use({ "github/copilot.vim" }) use({ "lewis6991/gitsigns.nvim", event = "BufRead", config = function() require("core.gitsigns") end, }) use({ "andrewstuart/vim-kubernetes", ft = { "yaml", "yml" } }) use({ "cespare/vim-toml", ft = "toml" }) use({ "vim-test/vim-test", cmd = { "TestNearest", "TestSuite", "TestVisit", "TestFile", "TestLast" }, }) use({ "rcarriga/vim-ultest", cmd = { "UltestSummary", "ultest" }, requires = { "vim-test/vim-test" }, run = ":UpdateRemoteuseins", }) use({ "romainl/vim-cool" }) use({ "psliwka/vim-smoothie" }) use({ "wakatime/vim-wakatime" }) use({ "voldikss/vim-translator", cmd = { "TranslateW" } }) -- terminal use({ "voldikss/vim-floaterm" }) use({ "akinsho/toggleterm.nvim", tag = "v1.*" }) use({ "kyazdani42/nvim-tree.lua" }) use({ "akinsho/bufferline.nvim", tag = "v2.*", requires = "kyazdani42/nvim-web-devicons" }) use("nvim-lualine/lualine.nvim") -- lsp use("neovim/nvim-lspconfig") use("williamboman/nvim-lsp-installer") use("hrsh7th/nvim-cmp") use("hrsh7th/cmp-nvim-lsp") use({ "hrsh7th/cmp-buffer", after = "nvim-cmp" }) use({ "hrsh7th/cmp-path", after = "nvim-cmp" }) use({ "hrsh7th/cmp-cmdline", after = "nvim-cmp" }) use("windwp/nvim-autopairs") -- lsp icon use("onsails/lspkind-nvim") -- snippet. use("rafamadriz/friendly-snippets") use("L3MON4D3/LuaSnip") use({ "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" }) -- lsp format use({ "jose-elias-alvarez/null-ls.nvim", event = "BufRead", config = function() require("core.null-ls") end, }) -- syntax use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) use({ "nvim-treesitter/nvim-treesitter-textobjects", requires = { "nvim-treesitter/nvim-treesitter" } }) use({ "romgrk/nvim-treesitter-context", requires = { "nvim-treesitter/nvim-treesitter" } }) -- search use("nvim-telescope/telescope.nvim") use("nvim-telescope/telescope-project.nvim") end, config = { display = { open_fn = function() return require("packer.util").float({ border = "rounded" }) end, }, }, }) if packer_bootstarp then require("packer").sync() end vim.cmd([[ silent! colorscheme kanagawa highlight VertSplit guibg=NONE ]]) -- comment.nvim Keymap("n", "<C-_>", "gcc", { noremap = false }) Keymap("v", "<C-_>", "gc", { noremap = false }) -- vim-easy-align Keymap("x", "ga", ":EasyAlign<CR>") Keymap("n", "ga", ":EasyAlign<CR>") vim.g.easy_align_delimiters = { [">"] = { pattern = ">>\\|\\|=>\\|>", }, ["/"] = { pattern = "//\\+\\|/\\*\\|\\*/", delimiter_align = "l", ignore_groups = { "!Comment" }, }, ["#"] = { pattern = "#\\+", delimiter_align = "l", ignore_groups = { "String" }, }, } -- vim-translator Keymap("n", "<M-t>", ":TranslateW<CR>") Keymap("v", "<M-t>", ":TranslateW<CR>") -- vim-test and vim-ultest Keymap("n", "tn", ":TestNearest<CR>") Keymap("n", "tf", ":TestFile<CR>") Keymap("n", "ts", ":TestSuite<CR>") Keymap("n", "tl", ":TestLast<CR>") Keymap("n", "tg", ":TestVisit<CR>") Keymap("n", "tt", ":UltestSummary<CR>") vim.g["test#strategy"] = "floaterm" vim.g["test#python#runner"] = "pytest" vim.g["test#go#runner"] = "gotest" vim.g["ultest_use_pty"] = 1 -- github copilot vim.g.copilot_no_tab_map = true vim.g.copilot_assume_mapped = true vim.g.copilot_tab_fallback = "" -- hlslens require("hlslens").setup({ nearest_only = true, }) Keymap("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]]) Keymap("n", "N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]]) Keymap("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]]) Keymap("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]]) vim.cmd([[ aug VMlens au! au User visual_multi_start lua require('vmlens').start() au User visual_multi_exit lua require('vmlens').exit() aug END ]])
25.952153
106
0.615044
433d605b62e1fa24bfa02690f9fef50f6ee904de
636
sql
SQL
migrations/2021-06-18-223436_instances/up.sql
Xe/waifud
5fbbee43337a14a5912c6d62238392b1a6514a1f
[ "MIT" ]
50
2021-06-02T12:52:56.000Z
2022-03-07T12:49:16.000Z
migrations/2021-06-18-223436_instances/up.sql
Xe/waifud
5fbbee43337a14a5912c6d62238392b1a6514a1f
[ "MIT" ]
13
2021-06-20T01:07:23.000Z
2022-03-28T14:31:30.000Z
migrations/2021-06-18-223436_instances/up.sql
Xe/mkvm
5fbbee43337a14a5912c6d62238392b1a6514a1f
[ "MIT" ]
1
2022-02-07T04:07:00.000Z
2022-02-07T04:07:00.000Z
CREATE TABLE IF NOT EXISTS connections ( hostname TEXT NOT NULL PRIMARY KEY , connection_uri TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS instances ( id TEXT NOT NULL PRIMARY KEY , "name" TEXT UNIQUE NOT NULL , ram INTEGER NOT NULL DEFAULT 512 , cores INTEGER NOT NULL DEFAULT 2 , zvol TEXT NOT NULL , zvol_size INTEGER NOT NULL DEFAULT 25 , use_sata BOOLEAN DEFAULT FALSE , mac_address TEXT NOT NULL , owner TEXT NOT NULL , FOREIGN KEY(owner) REFERENCES connections(hostname) );
31.8
55
0.584906
f1ee301d537fa51934aa494fd8d238207ac1dabd
7,733
rb
Ruby
app/lib/omni_auth/strategies/moj_oauth2.rb
uk-gov-mirror/ministryofjustice.laa-apply-for-legal-aid
a73a4e329b342ea8bfa32b07037f0895abdd2363
[ "MIT" ]
16
2018-11-26T10:54:26.000Z
2022-02-07T16:46:42.000Z
app/lib/omni_auth/strategies/moj_oauth2.rb
uk-gov-mirror/ministryofjustice.laa-apply-for-legal-aid
a73a4e329b342ea8bfa32b07037f0895abdd2363
[ "MIT" ]
697
2018-11-02T11:53:39.000Z
2022-03-31T07:36:17.000Z
app/lib/omni_auth/strategies/moj_oauth2.rb
uk-gov-mirror/ministryofjustice.laa-apply-for-legal-aid
a73a4e329b342ea8bfa32b07037f0895abdd2363
[ "MIT" ]
10
2019-05-02T20:24:09.000Z
2021-09-17T16:23:41.000Z
require 'oauth2' require 'omniauth' require 'securerandom' require 'socket' # for SocketError require 'timeout' # for Timeout::Error # rubocop:disable Lint/MissingSuper # :nocov: module OmniAuth module Strategies # Authentication strategy for connecting with APIs constructed using # the [OAuth 2.0 Specification](http://tools.ietf.org/html/draft-ietf-oauth-v2-10). # You must generally register your application with the provider and # utilize an application id and secret in order to authenticate using # OAuth 2.0. class MojOauth2 # rubocop:disable Metrics/ClassLength include OmniAuth::Strategy include Browser::ActionController def self.inherited(subclass) OmniAuth::Strategy.included(subclass) end args %i[client_id client_secret] # rubocop:disable Layout/SpaceBeforeBrackets option :client_id, nil option :client_secret, nil option :client_options, {} option :authorize_params, {} option :authorize_options, %i[scope state] option :token_params, {} option :token_options, [] option :auth_token_params, {} option :provider_ignores_state, false option :pkce, false option :pkce_verifier, nil option :pkce_options, { code_challenge: proc { |verifier| Base64.urlsafe_encode64( Digest::SHA2.digest(verifier), padding: false ) }, code_challenge_method: 'S256' } attr_accessor :access_token def client ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(options.client_options)) end credentials do hash = { 'token' => access_token.token } hash['refresh_token'] = access_token.refresh_token if access_token.expires? && access_token.refresh_token hash['expires_at'] = access_token.expires_at if access_token.expires? hash['expires'] = access_token.expires? hash end def request_phase # rubocop:disable Metrics/AbcSize auth_params = authorize_params applicant_id = session['warden.user.applicant.key'].first.first # We save the session in the redis database here in case the user backgrounds his browser on a mobile # device while looking up the bank credentials, which would result in the session being destroyed. # # We save it under the applicant_id key AND the state key, because it will be required in two different places, # the callback phase of this class, where only the state will be available, and the gather_transactions_controller # where only the applicant_id will be available. # OauthSessionSaver.store(applicant_id, session) OauthSessionSaver.store(auth_params[:state], session) Debug.record_request(session, auth_params, callback_url, browser_details) redirect client.auth_code.authorize_url({ redirect_uri: callback_url }.merge(auth_params)) end def authorize_params # rubocop:disable Metrics/AbcSize, Metrics/MethodLength options.authorize_params[:state] = SecureRandom.hex(24) if OmniAuth.config.test_mode @env ||= {} @env['rack.session'] ||= {} end params = options.authorize_params .merge(options_for('authorize')) .merge(pkce_authorize_params) session['omniauth.pkce.verifier'] = options.pkce_verifier if options.pkce session['omniauth.state'] = params[:state] params end def token_params options.token_params.merge(options_for('token')).merge(pkce_token_params) end def callback_phase # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity # we ALWAYS restore the session even if a perfectly good one exists because if we try to do it inside an # if statement, then the path that doesn't restore the session will set it to nil. Go figure! # restored_session = OauthSessionSaver.get(state) restored_session.each { |k, v| session[k] = v } OauthSessionSaver.destroy!(state) error = request.params['error_reason'] || request.params['error'] if error Debug.record_error(session, request.params, '', browser_details) fail!(error, CallbackError.new(request.params['error'], request.params['error_description'] || request.params['error_reason'], request.params['error_uri'])) elsif !options.provider_ignores_state && (request.params['state'].to_s.empty? || request.params['state'] != session.delete('omniauth.state')) Debug.record_error(session, request.params, 'CSRF detected', browser_details) fail!(:csrf_detected, CallbackError.new(:csrf_detected, 'CSRF detected')) else self.access_token = build_access_token self.access_token = access_token.refresh! if access_token.expired? super end rescue ::OAuth2::Error, CallbackError => e fail!(:invalid_credentials, e) rescue ::Timeout::Error, ::Errno::ETIMEDOUT => e fail!(:timeout, e) rescue ::SocketError => e fail!(:failed_to_connect, e) end protected def pkce_authorize_params return {} unless options.pkce options.pkce_verifier = SecureRandom.hex(64) # NOTE: see https://tools.ietf.org/html/rfc7636#appendix-A { code_challenge: options.pkce_options[:code_challenge] .call(options.pkce_verifier), code_challenge_method: options.pkce_options[:code_challenge_method] } end def pkce_token_params return {} unless options.pkce { code_verifier: session.delete('omniauth.pkce.verifier') } end def build_access_token verifier = request.params['code'] client.auth_code.get_token(verifier, { redirect_uri: callback_url }.merge(token_params.to_hash(symbolize_keys: true)), deep_symbolize(options.auth_token_params)) end def deep_symbolize(options) options.each_with_object({}) do |(key, value), hash| hash[key.to_sym] = value.is_a?(Hash) ? deep_symbolize(value) : value end end def options_for(option) # rubocop:disable Metrics/AbcSize hash = {} options.send(:"#{option}_options").select { |key| options[key] }.each do |key| hash[key.to_sym] = if options[key].respond_to?(:call) options[key].call(env) else options[key] end end hash end private def state request.params['state'] end def browser_details browser = Browser.new( request.env['HTTP_USER_AGENT'], accept_language: request.env['HTTP_ACCEPT_LANGUAGE'] ) "#{browser.platform.name}::#{browser.name}::#{browser.full_version}" end # An error that is indicated in the OAuth 2.0 callback. # This could be a `redirect_uri_mismatch` or other class CallbackError < StandardError attr_accessor :error, :error_reason, :error_uri def initialize(error, error_reason = nil, error_uri = nil) self.error = error self.error_reason = error_reason self.error_uri = error_uri end def message [error, error_reason, error_uri].compact.join(' | ') end end end end end OmniAuth.config.add_camelization 'oauth2', 'OAuth2' # :nocov: # rubocop:enable Lint/MissingSuper
36.649289
169
0.649037
705fa830cd1b23f980fa5c453390db38c792b149
8,193
lua
Lua
Slimetasia/Scripts/NapalmTrap.lua
JasonWyx/Slimetasia
5f69deb68da740d326c8514b881583f1e608e5d5
[ "MIT" ]
null
null
null
Slimetasia/Scripts/NapalmTrap.lua
JasonWyx/Slimetasia
5f69deb68da740d326c8514b881583f1e608e5d5
[ "MIT" ]
null
null
null
Slimetasia/Scripts/NapalmTrap.lua
JasonWyx/Slimetasia
5f69deb68da740d326c8514b881583f1e608e5d5
[ "MIT" ]
null
null
null
-- VARIABLES local owner_Transform = nil local owner_meshRenderer = nil local owner_emitter = nil local owner_audioEmitter = nil local timer = 0.0 -- general timer local timer2 = 0.0 -- timer for dealing damage per tick local timer3 = 0.0 -- timer for dealing final explision -- Charge settings local isActivated = false local duration_Charge = 2.0 local aIstrue = false -- Cooldown settings local isOnCoolDown = false local duration_cooldown = 8.0 -- Flickering local color_red = Color(1, 0, 0, 1) local color_black = Color(0, 0, 0, 1) local color_orginal = Color() local isRed = false local timer_flicker = 0 local interval_flicker = 0.5 local interval_flickerMin = 0.1 local interval_reduction = 0.1 -- Shaking local shakeOriginal = Vector3() local shakeSpeed = 10 local shakeAcceleration = 25 local shakeAngleX = 0 local shakeAngleZ = 0 local shakeAngleY = 0 local shakeAngleBound = 5 local shakeDirection = 1 -- Damage --NormalSlime local damageInterval = 0.1 local damagePerTick = 0.05 local damageExplosion = 0.5 --Boss local bossDmgPerTick = 0.01 local bossDmgExplosion = 0.2 --Other Details local duration_explosion = 0.2 local canDealDamage = false local constructed = false local AOEDist = 3.0 -- CONSTRUCTOR / UPDATE / ONCOLLISIONENTER -- ============================================================================= function Constructor() owner_Transform = owner:GetComponent("Transform") owner_meshRenderer = owner:GetComponent("MeshRenderer") owner_emitter = owner:GetComponent("ParticleEmitter_Circle") owner_audioEmitter = owner:GetComponent("AudioEmitter") color_orginal = owner_meshRenderer:GetColor() end function OnUpdate(dt) if(isOnCoolDown) then timer = timer + dt if (timer >= duration_cooldown) then ResetTrap() end elseif(isActivated)then initActiveFlame() ActivateFlame(dt) UpdateShaking(dt) UpdateFlicker(dt) end if (timer3 > 0) then timer3 = timer3 - dt owner_emitter:SetEmitRate(0) end DistanceFromEnemy() end -- Trap explosion -- ============================================================================= function ActivateFlame(dt) -- If trap finished charging timer = timer + dt if (timer >= duration_Charge) then owner_emitter:SetEmitRate(50) PlayAudioAtPosition("Firecracker") explosionParticle = CreatePrefab("FirecrackerAfterburn") spawnPos = owner_Transform:GetWorldPosition() spawnPos.y = spawnPos:y() + 3.75 explosionParticle:GetComponent("Transform"):SetWorldPosition(spawnPos) owner_meshRenderer:SetColor(color_black) isActivated = false aIstrue = false isOnCoolDown = true timer = 0 timer3 = duration_explosion return end -- Update deal damage per tick if (canDealDamage) then canDealDamage = false end timer2 = timer2 + dt if (timer2 >= damageInterval) then canDealDamage = true timer2 = 0.0 end end -- Shake trap -- ============================================================================= function UpdateShaking(dt) -- Increase shake speed overtime shakeSpeed = shakeSpeed + shakeAcceleration * dt -- Move shake angle change = shakeDirection * shakeSpeed * dt shakeAngleX = shakeAngleX + change --shakeAngleZ = shakeAngleZ + change shakeAngleY = shakeAngleY + shakeSpeed * dt -- Check if reach if (shakeDirection > 0 and shakeAngleX >= shakeAngleBound) then shakeDirection = -1 shakeAngleX = shakeAngleBound --shakeAngleZ = shakeAngleBound elseif (shakeDirection < 0 and shakeAngleX <= -(shakeAngleBound+10)) then shakeDirection = 1 shakeAngleX = -(shakeAngleBound+10) --shakeAngleZ = -shakeAngleBound end -- Rotate angle vector = Vector3(shakeAngleX, 0, 0) -- Add to rotation owner_Transform:SetWorldRotation(shakeOriginal + vector) end -- Update flckering from red - white -- ============================================================================= function UpdateFlicker(dt) if (timer_flicker > 0) then timer_flicker = timer_flicker - dt else if (isRed) then owner_meshRenderer:SetColor(color_orginal) else owner_meshRenderer:SetColor(color_red) end isRed = not isRed timer_flicker = interval_flicker interval_flicker = interval_flicker - interval_reduction if (interval_flicker < interval_flickerMin) then interval_flicker = interval_flickerMin end end end -- Reset trap to make it usable again -- ============================================================================= function ResetTrap() timer = 0.0 timer2 = 0.0 timer3 = 0.0 isActivated = false isOnCoolDown = false isRed = false owner_meshRenderer:SetColor(color_orginal) owner_Transform:SetWorldRotation(shakeOriginal) owner_emitter:SetEmitRate(0) end -- Play sound -- ============================================================================= function PlayAudioAtPosition(name) --newAduioEmitter = CreatePrefab("PlayAudioAndDie") --newAduioEmitter:GetComponent("Transform"):SetWorldPosition(owner_Transform:GetWorldPosition()) --script = newAduioEmitter:GetLuaScript("PlayAudioAndDie.lua") --script:SetVariable("audioClipName", name) --script:CallFunction("PlayAudio") owner_audioEmitter:SetAndPlayAudioClip(name) end function initActiveFlame(other) if(aIstrue == false) then if(not isActivated and not isOnCoolDown) then if(other:Tag() == "Slime" or other:Tag() == "Bullet")then isActivated = true shakeOriginal = owner_Transform:GetWorldRotation() PlayAudioAtPosition("Firecracker_Fuseburn") owner_emitter:SetEmitRate(15) aIstrue = true end end end end --Damage Over Time function DOT(other) ---- Normal damage if(isActivated and other:Tag() == "Slime")then if (canDealDamage) then script = other:GetLuaScript("Health.lua") if(other:Name() == "Slime_Spawner")then damagePerTick = bossDmgPerTick end --Allow the fire to be on the enemies until dot is over enemScript = ObtainScript(other) if(enemScript ~= nil)then enemScript:SetVariable("toFlame", true) enemScript:SetVariable("onFlameTimer",0.5) end --Dmg over time as long as they are near the firecracker script:SetVariable("damage", damagePerTick) script:CallFunction("DealDamge") end end -- explosion damage if (timer3 > 0) then if(other:Tag() == "Slime")then script = other:GetLuaScript("Health.lua") if(other:Name() == "Slime_Spawner")then damageExplosion = bossDmgExplosion end --Create on fire particle on enemies enemScript = ObtainScript(other) if(enemScript ~= nil)then enemScript:SetVariable("toFlame", true) enemScript:SetVariable("onFlameTimer",0.5) end script:SetVariable("damage", damageExplosion) script:CallFunction("DealDamge") end end end function DistanceFromEnemy() slimeList = CurrentLayer():GetObjectsListByTag("Slime") slimeSize = #slimeList for i = 1, slimeSize do slimepos = slimeList[i]:GetComponent("Transform"):GetWorldPosition() if(slimepos:DistanceTo(owner_Transform:GetWorldPosition()) < AOEDist)then initActiveFlame(slimeList[i]) DOT(slimeList[i]) end end end function ObtainScript(other) enemyScript = other:GetLuaScript("Enemy_Spawner.lua") if(enemyScript ~= nil)then return enemyScript end enemyScript = other:GetLuaScript("Enemy_TourGuideBehaviour.lua") if(enemyScript ~= nil)then return enemyScript end enemyScript = other:GetLuaScript("Enemy_Kamikaze.lua") if(enemyScript ~= nil)then return enemyScript end enemyScript = other:GetLuaScript("EnemyBehavior.lua") if(enemyScript ~= nil)then return enemyScript end return nil end
29.577617
98
0.643598
f01f07544e9daefd5a962cd57dc022f845636eaa
248
js
JavaScript
Chapter12TheBrowserObjectModel/TheWindowObject/NavigatingAndOpeningWindows/PoppingUpWindows/PoppingUpWindowsExample02.js
Li-YangZhong/professional-javascript-for-web-developers
f254b6fa78eb8e47ce8eb06978fbc1c3e5aab51f
[ "MIT" ]
31
2019-10-10T00:31:02.000Z
2022-02-18T00:40:24.000Z
Chapter12TheBrowserObjectModel/TheWindowObject/NavigatingAndOpeningWindows/PoppingUpWindows/PoppingUpWindowsExample02.js
necessityOVO/professional-javascript-for-web-developers-master
f1672543430508eac489939aa242a1ac8e1d549a
[ "MIT" ]
13
2020-02-17T23:56:43.000Z
2022-01-08T03:46:17.000Z
Chapter12TheBrowserObjectModel/TheWindowObject/NavigatingAndOpeningWindows/PoppingUpWindows/PoppingUpWindowsExample02.js
necessityOVO/professional-javascript-for-web-developers-master
f1672543430508eac489939aa242a1ac8e1d549a
[ "MIT" ]
12
2020-10-18T11:04:00.000Z
2022-03-26T14:43:22.000Z
let wroxWin = window.open("http://www.wrox.com/", "wroxWindow", "height=400,width=400,top=10,left=10,resizable=yes"); // resize it wroxWin.resizeTo(500, 500); // move it wroxWin.moveTo(100, 100);
24.8
67
0.556452
994f4f225ccea36026d16995cd0570c8dd5c95b9
17,547
h
C
contrib/gnu/gmake/dist/make.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2015-08-31T15:24:31.000Z
2020-04-24T20:31:29.000Z
contrib/gnu/gmake/dist/make.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/gmake/dist/make.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2015-07-29T07:17:15.000Z
2020-11-04T06:55:37.000Z
/* Miscellaneous global declarations and portability cruft for GNU Make. Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Make; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ /* We use <config.h> instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h (which it would do because make.h was found in $srcdir). */ #include <config.h> #undef HAVE_CONFIG_H #define HAVE_CONFIG_H 1 /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include <alloca.h> # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif #endif /* Use prototypes if available. */ #if defined (__cplusplus) || defined (__STDC__) # undef PARAMS # define PARAMS(protos) protos #else /* Not C++ or ANSI C. */ # undef PARAMS # define PARAMS(protos) () #endif /* C++ or ANSI C. */ /* Specify we want GNU source code. This must be defined before any system headers are included. */ #define _GNU_SOURCE 1 #ifdef CRAY /* This must happen before #include <signal.h> so that the declaration therein is changed. */ # define signal bsdsignal #endif /* If we're compiling for the dmalloc debugger, turn off string inlining. */ #if defined(HAVE_DMALLOC_H) && defined(__GNUC__) # define __NO_STRING_INLINES #endif #include <sys/types.h> #include <sys/stat.h> #include <signal.h> #include <stdio.h> #include <ctype.h> #ifdef HAVE_SYS_TIMEB_H /* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs unless <sys/timeb.h> has been included first. Does every system have a <sys/timeb.h>? If any does not, configure should check for it. */ # include <sys/timeb.h> #endif #if TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> #else # if HAVE_SYS_TIME_H # include <sys/time.h> # else # include <time.h> # endif #endif #include <errno.h> #ifndef errno extern int errno; #endif #ifndef isblank # define isblank(c) ((c) == ' ' || (c) == '\t') #endif #ifdef HAVE_UNISTD_H # include <unistd.h> /* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */ # if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS) # define POSIX 1 # endif #endif /* Some systems define _POSIX_VERSION but are not really POSIX.1. */ #if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386))) # undef POSIX #endif #if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) # define POSIX 1 #endif #ifndef RETSIGTYPE # define RETSIGTYPE void #endif #ifndef sigmask # define sigmask(sig) (1 << ((sig) - 1)) #endif #ifndef HAVE_SA_RESTART # define SA_RESTART 0 #endif #ifdef HAVE_LIMITS_H # include <limits.h> #endif #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif #ifndef PATH_MAX # ifndef POSIX # define PATH_MAX MAXPATHLEN # endif #endif #ifndef MAXPATHLEN # define MAXPATHLEN 1024 #endif #ifdef PATH_MAX # define GET_PATH_MAX PATH_MAX # define PATH_VAR(var) char var[PATH_MAX] #else # define NEED_GET_PATH_MAX 1 # define GET_PATH_MAX (get_path_max ()) # define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX) extern unsigned int get_path_max PARAMS ((void)); #endif #ifndef CHAR_BIT # define CHAR_BIT 8 #endif /* Nonzero if the integer type T is signed. */ #define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0) /* The minimum and maximum values for the integer type T. Use ~ (t) 0, not -1, for portability to 1's complement hosts. */ #define INTEGER_TYPE_MINIMUM(t) \ (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) #define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) #ifndef CHAR_MAX # define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) #endif #ifdef STAT_MACROS_BROKEN # ifdef S_ISREG # undef S_ISREG # endif # ifdef S_ISDIR # undef S_ISDIR # endif #endif /* STAT_MACROS_BROKEN. */ #ifndef S_ISREG # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #ifndef S_ISDIR # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif #ifdef VMS # include <types.h> # include <unixlib.h> # include <unixio.h> # include <perror.h> /* Needed to use alloca on VMS. */ # include <builtins.h> #endif #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(x) # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #define UNUSED __attribute__ ((unused)) #if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) # include <stdlib.h> # include <string.h> # define ANSI_STRING 1 #else /* No standard headers. */ # ifdef HAVE_STRING_H # include <string.h> # define ANSI_STRING 1 # else # include <strings.h> # endif # ifdef HAVE_MEMORY_H # include <memory.h> # endif # ifdef HAVE_STDLIB_H # include <stdlib.h> # else extern char *malloc PARAMS ((int)); extern char *realloc PARAMS ((char *, int)); extern void free PARAMS ((char *)); extern void abort PARAMS ((void)) __attribute__ ((noreturn)); extern void exit PARAMS ((int)) __attribute__ ((noreturn)); # endif /* HAVE_STDLIB_H. */ #endif /* Standard headers. */ /* These should be in stdlib.h. Make sure we have them. */ #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE # define EXIT_FAILURE 0 #endif #ifdef ANSI_STRING # ifndef bcmp # define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) # endif # ifndef bzero # define bzero(s, n) memset ((s), 0, (n)) # endif # if defined(HAVE_MEMMOVE) && !defined(bcopy) # define bcopy(s, d, n) memmove ((d), (s), (n)) # endif #else /* Not ANSI_STRING. */ # ifndef HAVE_STRCHR # define strchr(s, c) index((s), (c)) # define strrchr(s, c) rindex((s), (c)) # endif # ifndef bcmp extern int bcmp PARAMS ((const char *, const char *, int)); # endif # ifndef bzero extern void bzero PARAMS ((char *, int)); #endif # ifndef bcopy extern void bcopy PARAMS ((const char *b1, char *b2, int)); # endif /* SCO Xenix has a buggy macro definition in <string.h>. */ #undef strerror #if !defined(__DECC) extern char *strerror PARAMS ((int errnum)); #endif #endif /* !ANSI_STRING. */ #undef ANSI_STRING #if HAVE_INTTYPES_H # include <inttypes.h> #endif #define FILE_TIMESTAMP uintmax_t #if !defined(HAVE_STRSIGNAL) extern char *strsignal PARAMS ((int signum)); #endif /* ISDIGIT offers the following features: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. NOTE! Make relies on this behavior, don't change it! - It's typically faster. POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless it's important to use the locale's definition of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) #ifndef iAPX286 # define streq(a, b) \ ((a) == (b) || \ (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) # ifdef HAVE_CASE_INSENSITIVE_FS /* This is only used on Windows/DOS platforms, so we assume strcmpi(). */ # define strieq(a, b) \ ((a) == (b) \ || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) # else # define strieq(a, b) streq(a, b) # endif #else /* Buggy compiler can't handle this. */ # define streq(a, b) (strcmp ((a), (b)) == 0) # define strieq(a, b) (strcmp ((a), (b)) == 0) #endif #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) #ifdef VMS extern int strcmpi (const char *,const char *); #endif #if defined(__GNUC__) || defined(ENUM_BITFIELDS) # define ENUM_BITFIELD(bits) :bits #else # define ENUM_BITFIELD(bits) #endif /* Handle gettext and locales. */ #if HAVE_LOCALE_H # include <locale.h> #else # define setlocale(category, locale) #endif #include <gettext.h> #define _(msgid) gettext (msgid) #define N_(msgid) gettext_noop (msgid) #define S_(msg1,msg2,num) ngettext (msg1,msg2,num) /* Handle other OSs. */ #if defined(HAVE_DOS_PATHS) # define PATH_SEPARATOR_CHAR ';' #elif defined(VMS) # define PATH_SEPARATOR_CHAR ',' #else # define PATH_SEPARATOR_CHAR ':' #endif /* This is needed for getcwd() and chdir(). */ #if defined(_MSC_VER) || defined(__BORLANDC__) # include <direct.h> #endif #ifdef WINDOWS32 # include <fcntl.h> # include <malloc.h> # define pipe(p) _pipe(p, 512, O_BINARY) # define kill(pid,sig) w32_kill(pid,sig) extern void sync_Path_environment(void); extern int kill(int pid, int sig); extern char *end_of_token_w32(char *s, char stopchar); extern int find_and_set_default_shell(char *token); /* indicates whether or not we have Bourne shell */ extern int no_default_sh_exe; /* is default_shell unixy? */ extern int unixy_shell; #endif /* WINDOWS32 */ struct floc { const char *filenm; unsigned long lineno; }; #define NILF ((struct floc *)0) #define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1) /* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use variadic versions of these functions. */ #if HAVE_STDARG_H || HAVE_VARARGS_H # if HAVE_VPRINTF || HAVE_DOPRNT # define USE_VARIADIC 1 # endif #endif #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H extern void message (int prefix, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern void error (const struct floc *flocp, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern void fatal (const struct floc *flocp, const char *fmt, ...) __attribute__ ((noreturn, __format__ (__printf__, 2, 3))); #else extern void message (); extern void error (); extern void fatal (); #endif extern void die PARAMS ((int)) __attribute__ ((noreturn)); extern void log_working_directory PARAMS ((int)); extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn)); extern void perror_with_name PARAMS ((const char *, const char *)); extern char *savestring PARAMS ((const char *, unsigned int)); extern char *concat PARAMS ((const char *, const char *, const char *)); extern char *xmalloc PARAMS ((unsigned int)); extern char *xrealloc PARAMS ((char *, unsigned int)); extern char *xstrdup PARAMS ((const char *)); extern char *find_next_token PARAMS ((char **, unsigned int *)); extern char *next_token PARAMS ((const char *)); extern char *end_of_token PARAMS ((const char *)); extern void collapse_continuations PARAMS ((char *)); extern char *lindex PARAMS ((const char *, const char *, int)); extern int alpha_compare PARAMS ((const void *, const void *)); extern void print_spaces PARAMS ((unsigned int)); extern char *find_percent PARAMS ((char *)); extern FILE *open_tmpfile PARAMS ((char **, const char *)); #ifndef NO_ARCHIVES extern int ar_name PARAMS ((char *)); extern void ar_parse_name PARAMS ((char *, char **, char **)); extern int ar_touch PARAMS ((char *)); extern time_t ar_member_date PARAMS ((char *)); #endif extern int dir_file_exists_p PARAMS ((char *, char *)); extern int file_exists_p PARAMS ((char *)); extern int file_impossible_p PARAMS ((char *)); extern void file_impossible PARAMS ((char *)); extern char *dir_name PARAMS ((char *)); extern void hash_init_directories PARAMS ((void)); extern void define_default_variables PARAMS ((void)); extern void set_default_suffixes PARAMS ((void)); extern void install_default_suffix_rules PARAMS ((void)); extern void install_default_implicit_rules PARAMS ((void)); extern void build_vpath_lists PARAMS ((void)); extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath)); extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr)); extern int gpath_search PARAMS ((char *file, unsigned int len)); extern void construct_include_path PARAMS ((char **arg_dirs)); extern void user_access PARAMS ((void)); extern void make_access PARAMS ((void)); extern void child_access PARAMS ((void)); extern void close_stdout PARAMS ((void)); extern char *strip_whitespace PARAMS ((const char **begpp, const char **endpp)); /* String caching */ extern void strcache_init PARAMS ((void)); extern void strcache_print_stats PARAMS ((const char *prefix)); extern int strcache_iscached PARAMS ((const char *str)); extern const char *strcache_add PARAMS ((const char *str)); extern const char *strcache_add_len PARAMS ((const char *str, int len)); extern int strcache_setbufsize PARAMS ((int size)); #ifdef HAVE_VFORK_H # include <vfork.h> #endif /* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, because such systems often declare them in header files anyway. */ #if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) extern long int atol (); # ifndef VMS extern long int lseek (); # endif #endif /* Not GNU C library or POSIX. */ #ifdef HAVE_GETCWD # if !defined(VMS) && !defined(__DECC) extern char *getcwd (); # endif #else extern char *getwd (); # define getcwd(buf, len) getwd (buf) #endif extern const struct floc *reading_file; extern const struct floc **expanding_var; extern char **environ; extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; extern int print_data_base_flag, question_flag, touch_flag, always_make_flag; extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; extern int print_version_flag, print_directory_flag, check_symlink_flag; extern int warn_undefined_variables_flag, posix_pedantic, not_parallel; extern int second_expansion, clock_skew_detected, rebuilding_makefiles; /* can we run commands via 'sh -c xxx' or must we use batch files? */ extern int batch_mode_shell; extern unsigned int job_slots; extern int job_fds[2]; extern int job_rfd; #ifndef NO_FLOAT extern double max_load_average; #else extern int max_load_average; #endif extern char *program; extern char *starting_directory; extern unsigned int makelevel; extern char *version_string, *remote_description, *make_host; extern unsigned int commands_started; extern int handling_fatal_signal; #ifndef MIN #define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) #endif #ifndef MAX #define MAX(_a,_b) ((_a)>(_b)?(_a):(_b)) #endif #ifdef VMS # define MAKE_SUCCESS 1 # define MAKE_TROUBLE 2 # define MAKE_FAILURE 3 #else # define MAKE_SUCCESS 0 # define MAKE_TROUBLE 1 # define MAKE_FAILURE 2 #endif /* Set up heap debugging library dmalloc. */ #ifdef HAVE_DMALLOC_H #include <dmalloc.h> #endif #ifndef initialize_main # ifdef __EMX__ # define initialize_main(pargc, pargv) \ { _wildcard(pargc, pargv); _response(pargc, pargv); } # else # define initialize_main(pargc, pargv) # endif #endif #ifdef __EMX__ # if !HAVE_STRCASECMP # define strcasecmp stricmp # endif # if !defined chdir # define chdir _chdir2 # endif # if !defined getcwd # define getcwd _getcwd2 # endif /* NO_CHDIR2 causes make not to use _chdir2() and _getcwd2() instead of chdir() and getcwd(). This avoids some error messages for the make testsuite but restricts the drive letter support. */ # ifdef NO_CHDIR2 # warning NO_CHDIR2: usage of drive letters restricted # undef chdir # undef getcwd # endif #endif #ifndef initialize_main # define initialize_main(pargc, pargv) #endif /* Some systems (like Solaris, PTX, etc.) do not support the SA_RESTART flag properly according to POSIX. So, we try to wrap common system calls with checks for EINTR. Note that there are still plenty of system calls that can fail with EINTR but this, reportedly, gets the vast majority of failure cases. If you still experience failures you'll need to either get a system where SA_RESTART works, or you need to avoid -j. */ #define EINTRLOOP(_v,_c) while (((_v)=_c)==-1 && errno==EINTR) /* While system calls that return integers are pretty consistent about returning -1 on failure and setting errno in that case, functions that return pointers are not always so well behaved. Sometimes they return NULL for expected behavior: one good example is readdir() which returns NULL at the end of the directory--and _doesn't_ reset errno. So, we have to do it ourselves here. */ #define ENULLLOOP(_v,_c) do{ errno = 0; \ while (((_v)=_c)==0 && errno==EINTR); }while(0)
28.671569
134
0.706161
49df6fae6d8b8bdddb88cf7ecec16ed2cf85d662
7,871
swift
Swift
tm155-mac/tm155-tool-x/HIDDevice.swift
Treeki/TM155-tools
24451fde5bfe0d92d448ba4c9e42e3af27782175
[ "MIT" ]
8
2018-12-17T09:08:59.000Z
2021-04-23T20:04:24.000Z
tm155-mac/tm155-tool-x/HIDDevice.swift
Treeki/TM155-tools
24451fde5bfe0d92d448ba4c9e42e3af27782175
[ "MIT" ]
null
null
null
tm155-mac/tm155-tool-x/HIDDevice.swift
Treeki/TM155-tools
24451fde5bfe0d92d448ba4c9e42e3af27782175
[ "MIT" ]
1
2020-02-24T18:21:00.000Z
2020-02-24T18:21:00.000Z
// // HIDDevice.swift // tm155-tool-x // // Created by Ash Wolf on 23/12/2018. // Copyright © 2018 Ash Wolf. All rights reserved. // import IOKit.hid import Foundation enum HIDDeviceError: Error { case ioError(IOReturn) case deviceAlreadyOpened } class HIDDevice { let base: IOHIDDevice private var registeredCallbacks = false private var inputReportBufferPointer: UnsafeMutablePointer<UInt8>? = nil private var inputReportBufferSize: Int = 0 private var featureReportBuffer: [UInt8] = [] init(_ dev: IOHIDDevice) { base = dev featureReportBuffer = [UInt8].init(repeating: 0, count: maxFeatureReportSize ?? 1024) } deinit { unregisterCallbacks() } func registerCallbacks() { if !registeredCallbacks { inputReportBufferSize = maxInputReportSize ?? 1024 inputReportBufferPointer = UnsafeMutablePointer<UInt8>.allocate(capacity: inputReportBufferSize) let removalCallback: IOHIDCallback = { context, ret, sender in print("REMOVAL CONTEXT:", context?.debugDescription, "SENDER:", sender?.debugDescription, "RET:", ret) if let context_ = context { // This will release the device let hd = Unmanaged<HIDDevice>.fromOpaque(context_).takeRetainedValue() hd.handleDisconnected() } } let reportCallback: IOHIDReportCallback = { context, ret, sender, reportType, reportID, report, reportLength in //print("REPORT CONTEXT:", context?.debugDescription, "SENDER:", sender?.debugDescription, "RET:", ret) if let context_ = context { let hd = Unmanaged<HIDDevice>.fromOpaque(context_).takeUnretainedValue() let reportData = UnsafeBufferPointer.init(start: report, count: reportLength) hd.handleInputReport([UInt8].init(reportData), id: Int(reportID)) } } // This gets released inside the removal callback let unsafeSelf = Unmanaged.passRetained(self).toOpaque() //print("ATTACHING:", unsafeSelf) IOHIDDeviceRegisterRemovalCallback(base, removalCallback, unsafeSelf) IOHIDDeviceRegisterInputReportCallback(base, inputReportBufferPointer!, inputReportBufferSize, reportCallback, unsafeSelf) registeredCallbacks = true } } func unregisterCallbacks() { if registeredCallbacks { registeredCallbacks = false let unsafeSelf = Unmanaged.passUnretained(self).toOpaque() //print("DETACHING:", unsafeSelf) IOHIDDeviceRegisterRemovalCallback(base, nil, unsafeSelf) IOHIDDeviceRegisterInputReportCallback(base, inputReportBufferPointer!, 0, nil, unsafeSelf) inputReportBufferPointer!.deallocate() } } var transport: String? { return IOHIDDeviceGetProperty(base, kIOHIDTransportKey as CFString) as? String } var vendorId: Int? { return IOHIDDeviceGetProperty(base, kIOHIDVendorIDKey as CFString) as? Int } var vendorIdSource: Int? { return IOHIDDeviceGetProperty(base, kIOHIDVendorIDSourceKey as CFString) as? Int } var productId: Int? { return IOHIDDeviceGetProperty(base, kIOHIDProductIDKey as CFString) as? Int } var versionNumber: Int? { return IOHIDDeviceGetProperty(base, kIOHIDVersionNumberKey as CFString) as? Int } var manufacturer: String? { return IOHIDDeviceGetProperty(base, kIOHIDManufacturerKey as CFString) as? String } var product: String? { return IOHIDDeviceGetProperty(base, kIOHIDProductKey as CFString) as? String } var serialNumber: String? { return IOHIDDeviceGetProperty(base, kIOHIDSerialNumberKey as CFString) as? String } var countryCode: Int? { return IOHIDDeviceGetProperty(base, kIOHIDCountryCodeKey as CFString) as? Int } var locationId: Int? { return IOHIDDeviceGetProperty(base, kIOHIDLocationIDKey as CFString) as? Int } var deviceUsage: Int? { return IOHIDDeviceGetProperty(base, kIOHIDDeviceUsageKey as CFString) as? Int } var deviceUsagePage: Int? { return IOHIDDeviceGetProperty(base, kIOHIDDeviceUsagePageKey as CFString) as? Int } var primaryUsage: Int? { return IOHIDDeviceGetProperty(base, kIOHIDPrimaryUsageKey as CFString) as? Int } var primaryUsagePage: Int? { return IOHIDDeviceGetProperty(base, kIOHIDPrimaryUsagePageKey as CFString) as? Int } var maxInputReportSize: Int? { return IOHIDDeviceGetProperty(base, kIOHIDMaxInputReportSizeKey as CFString) as? Int } var maxOutputReportSize: Int? { return IOHIDDeviceGetProperty(base, kIOHIDMaxOutputReportSizeKey as CFString) as? Int } var maxFeatureReportSize: Int? { return IOHIDDeviceGetProperty(base, kIOHIDMaxFeatureReportSizeKey as CFString) as? Int } var reportInterval: Int? { return IOHIDDeviceGetProperty(base, kIOHIDReportIntervalKey as CFString) as? Int } var reportDescriptor: Data? { return IOHIDDeviceGetProperty(base, kIOHIDReportDescriptorKey as CFString) as? Data } var deviceUsagePairs: [(Int, Int)] { let anyPairs = IOHIDDeviceGetProperty(base, kIOHIDDeviceUsagePairsKey as CFString) if let dictPairs = (anyPairs as? [Dictionary<String, AnyObject>]) { return dictPairs.map({ let usage = $0[kIOHIDDeviceUsageKey] as? Int let usagePage = $0[kIOHIDDeviceUsagePageKey] as? Int if let usage_ = usage, let usagePage_ = usagePage { return (usage_, usagePage_) } else { return (-1, -1) } }).filter({ $0 != (-1, -1) }) } else { if let usage = deviceUsage, let usagePage = deviceUsagePage { return [(usage, usagePage)] } else { return [] } } } func implementsUsage(_ usage: Int, page: Int) -> Bool { return deviceUsagePairs.contains(where: {$0 == (usage, page)}) } func setOutputReport(_ data: [UInt8], id: Int) throws { debugPrint("Output-->", id, data) let ret = data.withUnsafeBufferPointer({ ptr in IOHIDDeviceSetReport(base, kIOHIDReportTypeOutput, id, ptr.baseAddress!, ptr.count) }) if ret != KERN_SUCCESS { throw HIDDeviceError.ioError(ret) } } func setFeatureReport(_ data: [UInt8], id: Int) throws { debugPrint("Feature->", id, data) let ret = data.withUnsafeBufferPointer({ ptr in IOHIDDeviceSetReport(base, kIOHIDReportTypeFeature, id, ptr.baseAddress!, ptr.count) }) if ret != KERN_SUCCESS { throw HIDDeviceError.ioError(ret) } } func getFeatureReport(id: Int) throws -> [UInt8] { var count: CFIndex = featureReportBuffer.count let ret = featureReportBuffer.withUnsafeMutableBufferPointer({ ptr in return IOHIDDeviceGetReport(base, kIOHIDReportTypeFeature, id, ptr.baseAddress!, &count) }) if ret == KERN_SUCCESS { let data = [UInt8].init(featureReportBuffer[0 ..< Int(count)]) debugPrint("<-Feature", id, data) return data } else { throw HIDDeviceError.ioError(ret) } } open func handleInputReport(_ data: [UInt8], id: Int) { } open func handleDisconnected() { } }
37.303318
134
0.623428
ddcab4150e1a5746abced8d6e68fc8514227d81c
3,449
go
Go
internal/server/request/user_test.go
ssup2/ssup2ket-user-service
71b86320c7846669bbcdc9f09df5bc999f4b8252
[ "Apache-2.0" ]
7
2021-12-20T14:43:18.000Z
2022-01-16T23:50:43.000Z
internal/server/request/user_test.go
ssup2ket/ssup2ket-auth-service
71b86320c7846669bbcdc9f09df5bc999f4b8252
[ "Apache-2.0" ]
null
null
null
internal/server/request/user_test.go
ssup2ket/ssup2ket-auth-service
71b86320c7846669bbcdc9f09df5bc999f4b8252
[ "Apache-2.0" ]
null
null
null
package request import ( "testing" "github.com/ssup2ket/ssup2ket-auth-service/internal/test" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) type userSuite struct { suite.Suite } func TestInit(t *testing.T) { suite.Run(t, new(userSuite)) } // UserCreate func (h *userSuite) TestBindUserCreateCorrect() { err := ValidateUserCreate(test.UserLoginIDCorrect, test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.NoError(h.T(), err) } func (h *userSuite) TestBindUserCreateIDWrong() { wrongIDs := []string{test.UserLoginIDShort, test.UserLoginIDLong} for _, wrongID := range wrongIDs { err := ValidateUserCreate(wrongID, test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.Error(h.T(), err) } } func (h *userSuite) TestBindUserCreatePasswdWrong() { wrongPasswds := []string{test.UserPasswdShort, test.UserPasswdLong} for _, wrongPasswd := range wrongPasswds { err := ValidateUserCreate(test.UserLoginIDCorrect, wrongPasswd, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.Error(h.T(), err) } } func (h *userSuite) TestBindUserCreateRoleWrong() { err := ValidateUserCreate(test.UserLoginIDCorrect, test.UserPasswdCorrect, test.UserRoleWrong, test.UserPhoneWrongFormat, test.UserEmailCorrect) require.Error(h.T(), err) } func (h *userSuite) TestBindUserCreatePhoneWrong() { err := ValidateUserCreate(test.UserLoginIDCorrect, test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneWrongFormat, test.UserEmailCorrect) require.Error(h.T(), err) } func (h *userSuite) TestBindUserCreateEmailWrong() { err := ValidateUserCreate(test.UserLoginIDCorrect, test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailWrongFormat) require.Error(h.T(), err) } // UserUpdate func (h *userSuite) TestBindUserUpdateCorrect() { err := ValidateUserUpdate(test.UserIDCorrect.String(), test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.NoError(h.T(), err) } func (h *userSuite) TestBindUserUpdateUUIDWrong() { err := ValidateUserUpdate(test.UserIDWrongFormat, test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.Error(h.T(), err) } func (h *userSuite) TestBindUserUpdatePasswdWrong() { wrongPasswds := []string{test.UserPasswdShort, test.UserPasswdLong} for _, wrongPasswd := range wrongPasswds { err := ValidateUserUpdate(test.UserIDCorrect.String(), wrongPasswd, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailCorrect) require.Error(h.T(), err) } } func (h *userSuite) TestBindUserUpdateRoleWrong() { err := ValidateUserUpdate(test.UserIDCorrect.String(), test.UserPasswdCorrect, test.UserRoleWrong, test.UserPhoneWrongFormat, test.UserEmailCorrect) require.Error(h.T(), err) } func (h *userSuite) TestBindUserUpdatePhoneWrong() { err := ValidateUserUpdate(test.UserIDCorrect.String(), test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneWrongFormat, test.UserEmailCorrect) require.Error(h.T(), err) } func (h *userSuite) TestBindUserUpdateEmailWrong() { err := ValidateUserUpdate(test.UserIDCorrect.String(), test.UserPasswdCorrect, string(test.UserRoleCorrect), test.UserPhoneCorrect, test.UserEmailWrongFormat) require.Error(h.T(), err) }
38.752809
159
0.783995
32614e556340985934208e2d308d9e2a38333b8d
1,457
swift
Swift
Example/Moya-KakaJson/Douban/DoubanApi.swift
Guoxiafei/Moya-KakaJson
e11a00c2d6e8041ab87cbcb9a3fa1d5b0b260104
[ "Apache-2.0" ]
2
2020-08-05T03:11:32.000Z
2021-04-06T07:58:35.000Z
Example/Moya-KakaJson/Douban/DoubanApi.swift
Guoxiafei/Moya-KakaJson
e11a00c2d6e8041ab87cbcb9a3fa1d5b0b260104
[ "Apache-2.0" ]
null
null
null
Example/Moya-KakaJson/Douban/DoubanApi.swift
Guoxiafei/Moya-KakaJson
e11a00c2d6e8041ab87cbcb9a3fa1d5b0b260104
[ "Apache-2.0" ]
null
null
null
// /** * @Name: DoubanApi.swift * @Description: * @Author: guoxiafei * @Date: 2020/5/9 * @Copyright: Copyright © 2020 China Electronic Intelligence System Technology Co., Ltd. All rights reserved. */ import Foundation import Moya let DouBanProvider = MoyaProvider<DouBan>(plugins: []) enum DouBan { case channels //获取频道列表 case playlist(String) //获取歌曲 } extension DouBan : TargetType { var baseURL: URL { switch self { case .channels: return URL(string: "https://www.douban.com")! case .playlist: return URL(string: "https://douban.fm")! } } var path: String { switch self { case .channels: return "/j/app/radio/channels" case .playlist: return "/j/mine/playlist" } } var method: Moya.Method{ return .get } var sampleData: Data { return "{}".data(using: String.Encoding.utf8)! } var task: Task { switch self { case .playlist(let channel): var params: [String: Any] = [:] params["channel"] = channel params["type"] = "n" params["from"] = "mainsite" return .requestParameters(parameters: params, encoding: URLEncoding.default) default: return .requestPlain } } var headers: [String : String]? { return nil } }
21.746269
109
0.541524
f02d80a4afeebaf1a2e3f75631b09c3fc74059e3
2,538
py
Python
src/flask_easy/auth.py
Josephmaclean/flask-easy
64cb647b0dbcd031cb8d27cc60889e50c959e1ca
[ "MIT" ]
1
2021-12-30T12:25:05.000Z
2021-12-30T12:25:05.000Z
src/flask_easy/auth.py
Josephmaclean/flask-easy
64cb647b0dbcd031cb8d27cc60889e50c959e1ca
[ "MIT" ]
null
null
null
src/flask_easy/auth.py
Josephmaclean/flask-easy
64cb647b0dbcd031cb8d27cc60889e50c959e1ca
[ "MIT" ]
null
null
null
""" auth.py Author: Joseph Maclean Arhin """ import os import inspect from functools import wraps import jwt from flask import request from jwt.exceptions import ExpiredSignatureError, InvalidTokenError, PyJWTError from .exc import Unauthorized, ExpiredTokenException, OperationError def auth_required(other_roles=None): """auth required decorator""" def authorize_user(func): """ A wrapper to authorize an action using :param func: {function}` the function to wrap around :return: """ @wraps(func) def view_wrapper(*args, **kwargs): authorization_header = request.headers.get("Authorization") if not authorization_header: raise Unauthorized("Missing authentication token") token = authorization_header.split()[1] try: key = os.getenv("JWT_SECRET") # noqa E501 payload = jwt.decode( token, key=key, algorithms=["HS256", "RS256"] ) # noqa E501 # Get realm roles from payload available_roles = payload.get("realm_access").get("roles") # Append service name to function name to form role # generated_role = service_name + "_" + func.__name__ generated_role = "s" authorized_roles = [] if other_roles: authorized_roles = other_roles.split("|") authorized_roles.append(generated_role) if is_authorized(authorized_roles, available_roles): if "user_id" in inspect.getfullargspec(func).args: kwargs["user_id"] = payload.get( "preferred_username" ) # noqa E501 return func(*args, **kwargs) except ExpiredSignatureError as error: raise ExpiredTokenException("Token Expired") from error except InvalidTokenError as error: raise OperationError("Invalid Token") from error except PyJWTError as error: raise OperationError("Error decoding token") from error raise Unauthorized(status_code=403) return view_wrapper return authorize_user def is_authorized(access_roles, available_roles): """Check if access roles is in available roles""" for role in access_roles: if role in available_roles: return True return False
32.126582
79
0.593775
7adf8e67d42aa76cde76421b1599701d958d1b95
2,722
rs
Rust
src/design/param.rs
jobtijhuis/tydi
326c0636ac185ad97e9780d2047c44626050f1a3
[ "Apache-2.0" ]
null
null
null
src/design/param.rs
jobtijhuis/tydi
326c0636ac185ad97e9780d2047c44626050f1a3
[ "Apache-2.0" ]
26
2021-09-06T04:29:55.000Z
2022-02-16T04:23:42.000Z
src/design/param.rs
jobtijhuis/tydi
326c0636ac185ad97e9780d2047c44626050f1a3
[ "Apache-2.0" ]
1
2021-09-21T14:26:19.000Z
2021-09-21T14:26:19.000Z
use std::collections::HashMap; use std::convert::TryInto; ///! Generic parameter type use crate::design::{ParamHandle, ParamKey, ParamStoreKey}; use crate::logical::LogicalType; use crate::{Document, Error, Identify, Result, UniqueKeyBuilder}; #[derive(Debug, PartialEq)] pub enum ParameterVariant { Type(LogicalType), String(String), UInt(u32), //... } #[derive(Debug, PartialEq)] pub struct NamedParameter { key: ParamKey, item: ParameterVariant, doc: Option<String>, } impl NamedParameter { pub fn try_new( key: impl TryInto<ParamKey, Error = impl Into<Box<dyn std::error::Error>>>, item: ParameterVariant, doc: Option<&str>, ) -> Result<Self> { let key = key.try_into().map_err(Into::into)?; Ok(NamedParameter { key, item, doc: doc.map(|s| s.to_string()), }) } pub fn key(&self) -> &ParamKey { &self.key } pub fn item(&self) -> &ParameterVariant { &self.item } } impl Identify for NamedParameter { fn identifier(&self) -> &str { self.key.as_ref() } } impl Document for NamedParameter { fn doc(&self) -> Option<String> { self.doc.clone() } } #[derive(Debug, PartialEq)] pub struct ParameterStore { key: ParamStoreKey, params: HashMap<ParamKey, NamedParameter>, } impl Identify for ParameterStore { fn identifier(&self) -> &str { self.key.as_ref() } } impl ParameterStore { pub fn from_builder( key: ParamStoreKey, builder: UniqueKeyBuilder<NamedParameter>, ) -> Result<Self> { Ok(ParameterStore { key, params: builder .finish()? .into_iter() .map(|p| (p.key().clone(), p)) .collect::<HashMap<ParamKey, NamedParameter>>(), }) } pub fn add(&mut self, param: NamedParameter) -> Result<ParamHandle> { let key = param.key().clone(); match self.params.insert(param.key().clone(), param) { None => Ok(ParamHandle { lib: self.key.clone(), param: key.clone(), }), Some(_lib) => Err(Error::ProjectError(format!( "Error while adding {} to the library", key, ))), } } pub fn get(&self, key: ParamKey) -> Result<&NamedParameter> { self.params.get(&key).ok_or_else(|| { Error::LibraryError(format!( "Parameter {} not found in store {}", key, self.identifier() )) }) } pub fn key(&self) -> &ParamStoreKey { &self.key } }
24.088496
83
0.541881
08628f4fb3491dfa1c7518936fc46c9026e75086
287
lua
Lua
MMOCoreORB/bin/scripts/object/custom_content/tangible/quest/naboo_deeja_peak_research_equipment.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
18
2017-02-09T15:36:05.000Z
2021-12-21T04:22:15.000Z
MMOCoreORB/bin/scripts/object/custom_content/tangible/quest/naboo_deeja_peak_research_equipment.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
61
2016-12-30T21:51:10.000Z
2021-12-10T20:25:56.000Z
MMOCoreORB/bin/scripts/object/custom_content/tangible/quest/naboo_deeja_peak_research_equipment.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
71
2017-01-01T05:34:38.000Z
2022-03-29T01:04:00.000Z
object_tangible_quest_naboo_deeja_peak_research_equipment = object_tangible_quest_shared_naboo_deeja_peak_research_equipment:new { } ObjectTemplates:addTemplate(object_tangible_quest_naboo_deeja_peak_research_equipment, "object/tangible/quest/naboo_deeja_peak_research_equipment.iff")
47.833333
151
0.919861
c4696644edbdcb38e5a9cbf029da9b695d91ccc0
1,082
c
C
libft/src/libft/ft_circ_buffer_set_trash_callback.c
pribault/libsocket
6c18d9dd48ac52f99a70a28da36a80862d33b642
[ "MIT" ]
null
null
null
libft/src/libft/ft_circ_buffer_set_trash_callback.c
pribault/libsocket
6c18d9dd48ac52f99a70a28da36a80862d33b642
[ "MIT" ]
null
null
null
libft/src/libft/ft_circ_buffer_set_trash_callback.c
pribault/libsocket
6c18d9dd48ac52f99a70a28da36a80862d33b642
[ "MIT" ]
null
null
null
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_circ_buffer_set_trash_callback.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: pribault <pribault@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/03/28 11:49:16 by pribault #+# #+# */ /* Updated: 2018/03/28 12:48:29 by pribault ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_circ_buffer_set_trash_callback(t_circ_buffer *buffer, void (*callback)(void*, void*), void *data) { buffer->trash_callback = callback; buffer->data = data; }
51.52381
80
0.245841
b6166736ed0acc55aa566d316d5b6772f14e6759
170
rb
Ruby
lib/interface/interface.rb
Verba/sql2avro
1c4b1253ea03167ec71f3a4a88f64a169ebece60
[ "Apache-2.0" ]
1
2016-08-28T08:46:51.000Z
2016-08-28T08:46:51.000Z
lib/interface/interface.rb
Verba/sql2avro
1c4b1253ea03167ec71f3a4a88f64a169ebece60
[ "Apache-2.0" ]
null
null
null
lib/interface/interface.rb
Verba/sql2avro
1c4b1253ea03167ec71f3a4a88f64a169ebece60
[ "Apache-2.0" ]
null
null
null
class DbInterface def schema(table) raise "Return Avro JSON schema for #{table}" end def data(table) raise "Return Avro JSON data for #{table}" end end
15.454545
48
0.676471
9c5a9004f04be08c98adb10bcc91bd0ca66b6c59
8,194
js
JavaScript
genoRoller.js
jaylapham/mesesh-tools
471d5c4e5164943c680c64240b6d31a042c36771
[ "MIT" ]
null
null
null
genoRoller.js
jaylapham/mesesh-tools
471d5c4e5164943c680c64240b6d31a042c36771
[ "MIT" ]
null
null
null
genoRoller.js
jaylapham/mesesh-tools
471d5c4e5164943c680c64240b6d31a042c36771
[ "MIT" ]
null
null
null
const _ = require('lodash'); const rwc = require('random-weighted-choice'); ///////////////////////// // begin data section // ///////////////////////// const sexOptions = ["Male", "Female"]; const baseCoatOptions = [{"Sandstone": 0.47, "code":"Ss"}, {"Chestnut": 0.26, "code":"Ch"}, {"Canyon": 0.16, "code":"Ca"}, {"Onyx": 0.06, "code":"On"}, {"Ivory": 0.04, "code":"Iv"}, {"Crystal": 0.01, "code":"Cr"}]; const geneRarityMatrix = [{"Common": 0.50, "code": "c"}, {"Uncommon": 0.30, "code": "u"}, {"Rare": 0.15, "code": "r"}, {"Exotic": 0.05, "code": "e"}]; const commonGenes = [{"name": "Capelet", "code": "cl"}, {"name": "Ink Pot", "code": "ip"}, {"name": "Lion Spots", "code": "ls"}, {"name": "Pangare", "code": "pg"}, {"name": "Ringed", "code": "rn"}, {"name": "Sable", "code": "sb"}, {"name": "Saddle", "code": "sa"}, {"name": "Sandstorm", "code": "sm"}, {"name": "Shaded", "code": "sd"}, {"name": "Shadow", "code": "sh"}, {"name": "Socks", "code": "sk"}, {"name": "Spotted", "code": "sp"}, {"name": "Ticked", "code": "ti"}, {"name": "Underbelly", "code": "un"}, {"name": "Paled", "code": "pl"}, {"name": "Okapi", "code": "ok"}, {"name": "Dun", "code": "dn"}, {"name": "Shroud", "code": "shr"}]; const uncommonGenes = [{"name": "Agouti", "code": "ag"}, {"name": "Baja", "code": "ba"}, {"name": "Blotched", "code": "bd"}, {"name": "Fog", "code": "fg"}, {"name": "Margay", "code": "mg"}, {"name": "Striped", "code": "st"}, {"name": "Tiger", "code": "tg"}, {"name": "Vitiligo", "code": "vt"}, {"name": "Wolverine", "code": "wv"}, {"name": "Veined", "code": "vn"}, {"name": "Panda", "code": "pn"}, {"name": "Two-Toned", "code": "tt"}]; const rareGenes = [{"name": "Fractal", "code": "fr"}, {"name": "Leucism", "code": "lu"}, {"name": "Magister", "code": "ma"}, {"name": "Night Sky", "code": "ns"}, {"name": "Pinto", "code": "pt"}, {"name": "Roan", "code": "ro"}, {"name": "Serpente", "code": "se"}, {"name": "Stalactite", "code": "sc"}, {"name": "Stalagmite", "code": "sg"}, {"name": "Circuit Board", "code": "cb"}, {"name": "Bioluminescence", "code": "bio"}, {"name": "Cast", "code": "ca"}]; const exoticGenes = [{"name": "Albinism", "code": "al"}, {"name": "Erythrism", "code": "er"}, {"name": "Nebula", "code": "nb"}, {"name": "Oily", "code": "ol"}, {"name": "Opal", "code": "op"}, {"name": "Tropical", "code": "tr"}]; const hereditaryMutationOptions = [{"none": 0.92, "code": ""}, {"Uroderma": 0.03, "code": ""}, {"Finned": 0.03, "code": ""}, {"Elven": 0.01, "code": ""}, {"Spired": 0.01, "code": ""}]; const nonHereditaryMutationOptions = [{"none": 0.96, "code": ""}, {"Smile": 0.02, "code": ""}, {"Winged": 0.02, "code": ""}]; const abilityOptions = [{"none": 0.85, "code": ""}, {"Sharp Senses": 0.03, "code": ""}, {"Sharp Senses": 0.03, "code": ""}, {"Seal Skin": 0.03, "code": ""}, {"Second Stomach": 0.03, "code": ""}, {"Silent Slayer": 0.03, "code": ""}]; ///////////////////////// // end data section // ///////////////////////// ///////////////////////// // begin logic section // ///////////////////////// // takes array of objects like [{"none": 0.98, "code":""}, {"Uroderma": 0.01, "code":"U"}, {"Finned": 0.01, "code":"F"}], or [{"none": 0.98}, {"Uroderma": 0.01}, {"Finned": 0.01}] // returns the object {"name": "Blah", "code":"bl"} const getWeightedRandomResult = function(options) { var rwcArray = []; for (var i = 0; i < options.length; i++) { var key = Object.keys(options[i])[0]; rwcArray.push({"id": key, "weight": Math.floor(100 * options[i][key])}); } var result = rwc(rwcArray); if (Object.keys(options[0]).length > 1) { result = _.find(options, function (option) { var nameKey = Object.keys(option)[0]; return result === nameKey; }); // hacky as fuck result = {"name": Object.keys(result)[0], "code": result.code }; } else { result = {"name":result, "code":null}; } return result; }; // takes array of strings like [{"name":"white", "code":"w"}, {"name":"black", "code":"b"}, {"name":"red", "code":"r"}] // returns the object {"name": "Blah", "code":"bl"} const getEqualRandomResult = function(options) { return _.sample(options); }; const isValidGenotype = function (genotype) { return /^(\w{2}|\w{2}\W\/\/\W(\w{2}\/|\w{2}|\w{3}\/|\w{3})*)$/.test(genotype); }; const generateAvlet = function() { var avlet = {sex:null, baseCoat:null, genes:[], rarestGene: null, hereditaryMutation:null, nonHereditaryMutation:null, ability:null}; avlet.sex = getEqualRandomResult(sexOptions); avlet.baseCoat = getWeightedRandomResult(baseCoatOptions); var numGenes = _.sample([2, 3, 4, 5]); _.times(numGenes, function() { var rarity = getWeightedRandomResult(geneRarityMatrix).name; switch (rarity) { case "Common": if (avlet.rarestGene === null) { avlet.rarestGene = "Common"; } avlet = addGene(avlet, commonGenes); break; case "Uncommon": if (avlet.rarestGene !== "Exotic" && avlet.rarestGene !== "Rare") { avlet.rarestGene = "Uncommon"; } avlet = addGene(avlet, uncommonGenes); break; case "Rare": if (avlet.rarestGene !== "Exotic") { avlet.rarestGene = "Rare"; } avlet = addGene(avlet, rareGenes); break; case "Exotic": avlet.rarestGene = "Exotic"; avlet = addGene(avlet, exoticGenes); break; } }); avlet.hereditaryMutation = getWeightedRandomResult(hereditaryMutationOptions); avlet.nonHereditaryMutation = getWeightedRandomResult(nonHereditaryMutationOptions); avlet.ability = getWeightedRandomResult(abilityOptions); return avlet; }; // prevents duplicate genes const addGene = function (avlet, geneArray) { var genes = avlet.genes; var addedAGene = false; while (!addedAGene) { var gene = getEqualRandomResult(geneArray); var isDuplicate = (_.find(genes, gene) !== undefined); if (!isDuplicate) { genes.push(gene); addedAGene = true; } } avlet.genes = genes; return avlet; }; const getGenotypeString = function (avlet) { var string = ""; string += avlet.baseCoat.code + " // "; _.each(avlet.genes, function (gene) { string += gene.code + "/" }); string = string.substring(0, string.length - 1); return string; }; const getPhenotypeString = function (avlet) { var string = avlet.baseCoat.name + " with " + avlet.genes[0].name; for (var i = 1; i < avlet.genes.length; i++) { if (i === avlet.genes.length-1) { string += ", and " + avlet.genes[i].name; } else { string += ", " + avlet.genes[i].name; } } return string; }; const printAvlet = function(avlet) { var genotypeString = getGenotypeString(avlet); var phenotypeString = getPhenotypeString(avlet); if (isValidGenotype(genotypeString)) { console.log(avlet.rarestGene + " - " + avlet.sex); console.log("Geno: " + genotypeString); console.log("Pheno: " + phenotypeString); var mutationString = ""; if (avlet.hereditaryMutation.name !== "none") { mutationString += avlet.hereditaryMutation.name; } if (avlet.nonHereditaryMutation.name !== "none") { if (mutationString === "") { mutationString += avlet.nonHereditaryMutation.name; } else { mutationString = ", " + avlet.nonHereditaryMutation.name; } } if (mutationString !== "") { console.log("Mutation: " + mutationString); } if (avlet.ability.name !== "none") { console.log("Ability: " + avlet.ability.name); } } else { console.log("something went wrong with the generator! genotype appears invalid: " + getGenotypeString(avlet)); } }; ///////////////////////// // end logic section // ///////////////////////// // run printAvlet(generateAvlet());
48.77381
642
0.53051
7f764dbd8a22b6665cdf1bb46bc1ac67d0f70847
1,119
rs
Rust
src/tools/rustfmt/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs
ohno418/rust
395a09c3dafe0c7838c9ca41d2b47bb5e79a5b6d
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
66,762
2015-01-01T08:32:03.000Z
2022-03-31T23:26:40.000Z
src/tools/rustfmt/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs
maxrovskyi/rust
51558ccb8e7cea87c6d1c494abad5451e5759979
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
76,993
2015-01-01T00:06:33.000Z
2022-03-31T23:59:15.000Z
src/tools/rustfmt/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs
maxrovskyi/rust
51558ccb8e7cea87c6d1c494abad5451e5759979
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
11,787
2015-01-01T00:01:19.000Z
2022-03-31T19:03:42.000Z
// rustfmt-wrap_comments: true // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt ut labore et dolore magna aliqua. // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt ut labore et dolore magna aliqua. // * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt ut labore et dolore magna aliqua. // * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt ut labore et dolore magna aliqua. /* - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod * tempor incididunt ut labore et dolore magna aliqua. */ /* - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod * tempor incididunt ut labore et dolore magna aliqua. */ /* * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod * tempor incididunt ut labore et dolore magna aliqua. */ /* * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod * tempor incididunt ut labore et dolore magna aliqua. */
50.863636
76
0.75067
540291b9b9841da248f3a9df0075913211d93c4b
1,943
go
Go
parse/date/parse_test.go
mono83/charlie
d72b88c147b28d72352b7fdefdb7a417ca7d3cce
[ "MIT" ]
2
2018-09-15T09:39:27.000Z
2018-09-25T19:09:53.000Z
parse/date/parse_test.go
mono83/charlie
d72b88c147b28d72352b7fdefdb7a417ca7d3cce
[ "MIT" ]
22
2018-09-14T08:49:27.000Z
2019-02-10T14:05:11.000Z
parse/date/parse_test.go
mono83/charlie
d72b88c147b28d72352b7fdefdb7a417ca7d3cce
[ "MIT" ]
1
2018-09-17T18:30:53.000Z
2018-09-17T18:30:53.000Z
package date import ( "github.com/stretchr/testify/assert" "testing" "time" ) func TestPatterns(t *testing.T) { for layout, r := range patterns { t.Run("Layout "+layout, func(t *testing.T) { assert.Regexp(t, r, layout) }) } } var parseProvider = []struct { Data string Time time.Time Parsed bool }{ // Long year {"05-12-2008", date(2008, 12, 5), true}, {"05-12-2008.", date(2008, 12, 5), true}, {"05.12.2008", date(2008, 12, 5), true}, {"05.12.2008,", date(2008, 12, 5), true}, {"05/12/2008", date(2008, 12, 5), true}, {" 05-12-2008 ", date(2008, 12, 5), true}, {"foo 05.12.2008 23", date(2008, 12, 5), true}, {"2006 05/12/2008 super release.", date(2008, 12, 5), true}, // Short year {"05-12-08", date(2008, 12, 5), true}, {"05.12.08", date(2008, 12, 5), true}, {"05/12/08", date(2008, 12, 5), true}, {" 05-12-08 ", date(2008, 12, 5), true}, {"foo 05.12.08 23", date(2008, 12, 5), true}, {"2006 05/12/08 super release.", date(2008, 12, 5), true}, // False cases {"foo05-12-08", time.Time{}, false}, {" 05-12-08foo", time.Time{}, false}, {" 1205-12-200801", time.Time{}, false}, // String month cases {"September 13, 2018", date(2018, 9, 13), true}, {"Release september 13, 2018.", date(2018, 9, 13), true}, {"Release september 13, 2018, main fixes bellow", date(2018, 9, 13), true}, {"September 13 2018", date(2018, 9, 13), true}, {"September 2018", date(2018, 9, 1), true}, {"Test (September 13, 2018).", date(2018, 9, 13), true}, {"September 13, 2018", date(2018, 9, 13), true}, } func TestParse(t *testing.T) { for _, data := range parseProvider { t.Run("Parsing "+data.Data, func(t *testing.T) { res, parsed := Parse(data.Data) if assert.Equal(t, data.Parsed, parsed) { if data.Parsed { assert.Equal(t, res, data.Time) } } }) } } func date(year int, month time.Month, day int) time.Time { return time.Date(year, month, day, 0, 0, 0, 0, time.UTC) }
26.986111
76
0.597015
8e33bac8cf2bd182ae2fb7e2b7357381f18916ec
650
rake
Ruby
lib/tasks/periodic_jobs.rake
sj26/sidekiq-cronitor
e61a8af15a3d3b7db9c0033c2a178402360928d9
[ "MIT" ]
null
null
null
lib/tasks/periodic_jobs.rake
sj26/sidekiq-cronitor
e61a8af15a3d3b7db9c0033c2a178402360928d9
[ "MIT" ]
1
2020-03-10T19:56:05.000Z
2020-03-11T23:12:50.000Z
lib/tasks/periodic_jobs.rake
cronitorio/sidekiq-cronitor
e61a8af15a3d3b7db9c0033c2a178402360928d9
[ "MIT" ]
1
2017-12-01T07:44:34.000Z
2017-12-01T07:44:34.000Z
# This is a very basic/naive implementation of syncing your job schedules to be monitored # I don't have access to a Sidekiq Pro license so this is just written based on what documentation I could find # so I haven't been able to test this actually runs/works, whereas the sidekiq-scheduler version I did test. # this is really just a template/guess at what this would look like, please submit pull requests if you have fixes namespace :cronitor do namespace :sidekiq_periodic_jobs do desc 'Upload Sidekiq Pro Periodic Jobs to Cronitor' task :sync => :environment do Sidekiq::Cronitor::PeriodicJobs.sync_schedule! end end end
43.333333
114
0.769231
fe09189f423ef1ebd5418cdddb923a88150ff419
776
c
C
ITP/Atividades/ITP - Ponteiros 1 - Lista/4.c
danielhenrif/C
0280e65b9c21d5ae7cb697a8df562373c42c3a3f
[ "MIT" ]
null
null
null
ITP/Atividades/ITP - Ponteiros 1 - Lista/4.c
danielhenrif/C
0280e65b9c21d5ae7cb697a8df562373c42c3a3f
[ "MIT" ]
null
null
null
ITP/Atividades/ITP - Ponteiros 1 - Lista/4.c
danielhenrif/C
0280e65b9c21d5ae7cb697a8df562373c42c3a3f
[ "MIT" ]
1
2021-01-23T18:39:46.000Z
2021-01-23T18:39:46.000Z
#include <stdio.h> void MAXMIN(int n, int *m){ int maior = *m ,menor = *m; int i_max = 0 ,j_max = 0 ,i_min = 0 ,j_min = 0; for (int i = 0; i < n ; i++) { for (int j = 0; j < n; j++) { if(*m > maior){ maior = *m; i_max = i; j_max = j; } if(*m < menor){ menor = *m; i_min = i; j_min = j; } m++; } } printf("%d %d %d %d %d %d \n",maior,i_max, j_max, menor, i_min, j_min); } int main(){ int n; scanf("%d",&n); int matriz[n*n]; //entrada da matriz for (int i = 0; i < n*n; i++) { scanf("%d",&matriz[i]); } MAXMIN(n,matriz); return 0; }
19.4
75
0.360825
70852e58b975eb1821a51a68343a55d07416cb7a
38
c
C
sample/hello/add.c
badsaarow/docker-googletest
f8f4863af71d29c46014960fc5ccbf45bda2f327
[ "MIT" ]
null
null
null
sample/hello/add.c
badsaarow/docker-googletest
f8f4863af71d29c46014960fc5ccbf45bda2f327
[ "MIT" ]
3
2021-11-22T01:30:05.000Z
2021-11-22T02:47:48.000Z
sample/hello/add.c
badsaarow/docker-googletest
f8f4863af71d29c46014960fc5ccbf45bda2f327
[ "MIT" ]
null
null
null
int add(int a, int b) { return -1; }
12.666667
23
0.552632
0cf6042dc3345403de0c17929e41f0f3341faa0a
34
kts
Kotlin
settings.gradle.kts
RubixDev/Mastermind
c8511cc8eb084737ae09de99aa683bf40059224f
[ "MIT" ]
1
2022-01-12T18:33:46.000Z
2022-01-12T18:33:46.000Z
settings.gradle.kts
RubixDev/Mastermind
c8511cc8eb084737ae09de99aa683bf40059224f
[ "MIT" ]
null
null
null
settings.gradle.kts
RubixDev/Mastermind
c8511cc8eb084737ae09de99aa683bf40059224f
[ "MIT" ]
1
2021-04-21T10:33:45.000Z
2021-04-21T10:33:45.000Z
rootProject.name = "Mastermind"
8.5
31
0.735294
41e40478e54f866ded564ae52467b868d4a3c0b3
1,662
h
C
usr/src/head/valtools.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/head/valtools.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/head/valtools.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ #ifndef _VALTOOLS_H #define _VALTOOLS_H #ifdef __cplusplus extern "C" { #endif struct _choice_ { char *token; char *text; struct _choice_ *next; }; struct _menu_ { char *label; int attr; short longest; short nchoices; struct _choice_ *choice; char **invis; }; typedef struct _menu_ CKMENU; #define P_ABSOLUTE 0x0001 #define P_RELATIVE 0x0002 #define P_EXIST 0x0004 #define P_NEXIST 0x0008 #define P_REG 0x0010 #define P_DIR 0x0020 #define P_BLK 0x0040 #define P_CHR 0x0080 #define P_NONZERO 0x0100 #define P_READ 0x0200 #define P_WRITE 0x0400 #define P_EXEC 0x0800 #define P_CREAT 0x1000 #define CKUNNUM 0x01 #define CKALPHA 0x02 #define CKONEFLAG 0x04 #ifdef __cplusplus } #endif #endif /* _VALTOOLS_H */
22.459459
70
0.741276
e789f4789a22a8efe931140f3d2390f07fbd368f
177
js
JavaScript
src/redux/actions/email.js
Valentine-Efagene/SSR-REACT-FIREBASE
3e798fa1be48b96b21fe4ac1cc6388354f1b2c32
[ "Apache-2.0" ]
null
null
null
src/redux/actions/email.js
Valentine-Efagene/SSR-REACT-FIREBASE
3e798fa1be48b96b21fe4ac1cc6388354f1b2c32
[ "Apache-2.0" ]
null
null
null
src/redux/actions/email.js
Valentine-Efagene/SSR-REACT-FIREBASE
3e798fa1be48b96b21fe4ac1cc6388354f1b2c32
[ "Apache-2.0" ]
null
null
null
const logIn = (email) => { return { type: 'LOG_IN', payload: email, }; }; const logOut = () => { return { type: 'LOG_OUT', }; }; export { logIn, logOut };
11.8
26
0.497175
f59ca57d95a5ea31977535487adb256442d75afe
13,356
swift
Swift
Stage1st/Scene/QuoteFloor/QuoteFloorViewController.swift
tonyunreal/Stage1st-Reader
f0ed84e519adbf141d017277c76698b99488cb7b
[ "BSD-3-Clause" ]
null
null
null
Stage1st/Scene/QuoteFloor/QuoteFloorViewController.swift
tonyunreal/Stage1st-Reader
f0ed84e519adbf141d017277c76698b99488cb7b
[ "BSD-3-Clause" ]
null
null
null
Stage1st/Scene/QuoteFloor/QuoteFloorViewController.swift
tonyunreal/Stage1st-Reader
f0ed84e519adbf141d017277c76698b99488cb7b
[ "BSD-3-Clause" ]
null
null
null
// // QuoteFloorViewController.swift // Stage1st // // Created by Zheng Li on 7/12/15. // Copyright (c) 2015 Renaissance. All rights reserved. // import WebKit import CocoaLumberjack import JTSImageViewController import Photos class QuoteFloorViewController: UIViewController, ImagePresenter, UserPresenter, ContentPresenter { let viewModel: QuoteFloorViewModel lazy var webView: WKWebView = { WKWebView(frame: .zero, configuration: self.sharedWKWebViewConfiguration()) }() var presentType: PresentType = .none { didSet { switch presentType { case .none: AppEnvironment.current.eventTracker.setObjectValue("QuoteViewController", forKey: "lastViewController") case .image: AppEnvironment.current.eventTracker.setObjectValue("ImageViewController", forKey: "lastViewController") default: break } } } init(viewModel: QuoteFloorViewModel) { self.viewModel = viewModel super.init(nibName: nil, bundle: nil) automaticallyAdjustsScrollViewInsets = false webView.navigationDelegate = self webView.scrollView.backgroundColor = .clear webView.scrollView.decelerationRate = UIScrollView.DecelerationRate.normal webView.scrollView.delegate = self webView.isOpaque = false NotificationCenter.default.addObserver( self, selector: #selector(applicationWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil ) NotificationCenter.default.addObserver( self, selector: #selector(didReceivePaletteChangeNotification(_:)), name: .APPaletteDidChange, object: nil ) NotificationCenter.default.addObserver( self, selector: #selector(didReceiveUserBlockStatusDidChangedNotification(_:)), name: .UserBlockStatusDidChangedNotification, object: nil ) } required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } deinit { S1LogInfo("[QuoteFloorVC] Dealloc Begin") NotificationCenter.default.removeObserver(self) webView.configuration.userContentController.removeScriptMessageHandler(forName: "stage1st") webView.scrollView.delegate = nil webView.stopLoading() S1LogInfo("[QuoteFloorVC] Dealloced") } } // MARK: - Life Cycle extension QuoteFloorViewController { override func viewDidLoad() { super.viewDidLoad() view.addSubview(webView) webView.snp.makeConstraints({ (make) -> Void in make.top.equalTo(self.topLayoutGuide.snp.bottom) make.bottom.equalTo(self.bottomLayoutGuide.snp.top) make.leading.trailing.equalTo(self.view) }) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) presentType = .none // defer from initializer to here to make sure navigationController exist (i.e. self be added to navigation stack) // FIXME: find a way to make sure this only called once. Prefer this not work. if let colorPanRecognizer = (navigationController?.delegate as? NavigationControllerDelegate)?.colorPanRecognizer { webView.scrollView.panGestureRecognizer.require(toFail: colorPanRecognizer) } didReceivePaletteChangeNotification(nil) tryToReloadWKWebViewIfPageIsBlankDueToWebKitProcessTerminated() } @objc func applicationWillEnterForeground() { S1LogDebug("[QuoteFloorVC] \(self) will enter foreground begin") tryToReloadWKWebViewIfPageIsBlankDueToWebKitProcessTerminated() S1LogDebug("[QuoteFloorVC] \(self) will enter foreground end") } } // MARK: - Actions extension QuoteFloorViewController { override func didReceivePaletteChangeNotification(_ notification: Notification?) { view.backgroundColor = AppEnvironment.current.colorManager.colorForKey("content.background") webView.backgroundColor = AppEnvironment.current.colorManager.colorForKey("content.webview.background") setNeedsStatusBarAppearanceUpdate() if notification != nil { webView.loadHTMLString(viewModel.generatePage(with: viewModel.floors), baseURL: viewModel.baseURL) } } @objc open func didReceiveUserBlockStatusDidChangedNotification(_: Notification?) { webView.loadHTMLString(viewModel.generatePage(with: viewModel.floors), baseURL: viewModel.baseURL) } } // MARK: extension QuoteFloorViewController { func sharedWKWebViewConfiguration() -> WKWebViewConfiguration { let configuration = WKWebViewConfiguration() let userContentController = WKUserContentController() userContentController.add(GeneralScriptMessageHandler(delegate: self), name: "stage1st") configuration.userContentController = userContentController if #available(iOS 11.0, *) { configuration.setURLSchemeHandler(AppEnvironment.current.webKitImageDownloader, forURLScheme: "image") configuration.setURLSchemeHandler(AppEnvironment.current.webKitImageDownloader, forURLScheme: "images") } return configuration } } // MARK: - WKScriptMessageHandler extension QuoteFloorViewController: WebViewEventDelegate { func generalScriptMessageHandler(_: GeneralScriptMessageHandler, actionButtonTappedFor _: Int) { // actionButtonTapped(for: floorID) } } // MARK: JTSImageViewControllerInteractionsDelegate extension QuoteFloorViewController: JTSImageViewControllerInteractionsDelegate { func imageViewerDidLongPress(_ imageViewer: JTSImageViewController!, at rect: CGRect) { let imageActionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) imageActionSheet.addAction(UIAlertAction(title: NSLocalizedString("ImageViewController.ActionSheet.Save", comment: "Save"), style: .default, handler: { _ in DispatchQueue.global(qos: .background).async { PHPhotoLibrary.requestAuthorization { status in guard case .authorized = status else { S1LogError("No auth to access photo library") return } guard let imageData = imageViewer.imageData else { S1LogError("Image data is nil") return } PHPhotoLibrary.shared().performChanges({ PHAssetCreationRequest.forAsset().addResource(with: .photo, data: imageData, options: nil) }, completionHandler: { _, error in if let error = error { S1LogError("\(error)") } }) } } })) imageActionSheet.addAction(UIAlertAction(title: NSLocalizedString("ImageViewController.ActionSheet.CopyURL", comment: "Copy URL"), style: .default, handler: { _ in UIPasteboard.general.string = imageViewer.imageInfo.imageURL.absoluteString })) imageActionSheet.addAction(UIAlertAction(title: NSLocalizedString("ContentViewController.ActionSheet.Cancel", comment: "Cancel"), style: .cancel, handler: nil)) imageActionSheet.popoverPresentationController?.sourceView = imageViewer.view imageActionSheet.popoverPresentationController?.sourceRect = rect imageViewer.present(imageActionSheet, animated: true, completion: nil) } } // MARK: JTSImageViewControllerOptionsDelegate extension QuoteFloorViewController: JTSImageViewControllerOptionsDelegate { func alphaForBackgroundDimmingOverlay(inImageViewer _: JTSImageViewController!) -> CGFloat { return 0.3 } } // MARK: WKNavigationDelegate extension QuoteFloorViewController: WKNavigationDelegate { func webView(_: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { guard let url = navigationAction.request.url else { decisionHandler(.cancel) return } if url.absoluteString.hasPrefix("file://") { if url.absoluteString.hasSuffix("html") { decisionHandler(.allow) return } } // Image URL opened in image Viewer if url.absoluteString.hasSuffix(".jpg") || url.absoluteString.hasSuffix(".gif") || url.absoluteString.hasSuffix(".png") { AppEnvironment.current.eventTracker.logEvent(with: "Inspect Image", attributes: [ "type": "hijack", "source": "QuoteFloor", ]) showImageViewController(transitionSource: .offScreen, imageURL: url) decisionHandler(.cancel) return } if AppEnvironment.current.serverAddress.hasSameDomain(with: url) { // Open as S1 topic if let topic = S1Parser.extractTopicInfo(fromLink: url.absoluteString) { var topic = topic if let tracedTopic = AppEnvironment.current.dataCenter.traced(topicID: topic.topicID.intValue) { let lastViewedPage = topic.lastViewedPage topic = tracedTopic.copy() as! S1Topic if lastViewedPage != nil { topic.lastViewedPage = lastViewedPage } } AppEnvironment.current.eventTracker.logEvent(with: "Open Topic Link", attributes: [ "source": "QuoteFloor", ]) showContentViewController(topic: topic) decisionHandler(.cancel) return } } let openActionHandler: (UIAlertAction) -> Void = { [weak self] _ in guard let strongSelf = self else { return } strongSelf.presentType = .background S1LogDebug("[ContentVC] Open in Safari: \(url)") UIApplication.shared.open(url, options: [:], completionHandler: { (success) in if !success { S1LogWarn("Failed to open url: \(url)") } }) } // Fallback Open link let alertViewController = UIAlertController( title: NSLocalizedString("ContentViewController.WebView.OpenLinkAlert.Title", comment: ""), message: url.absoluteString, preferredStyle: .alert ) alertViewController.addAction(UIAlertAction( title: NSLocalizedString("ContentViewController.WebView.OpenLinkAlert.Cancel", comment: ""), style: .cancel, handler: nil) ) alertViewController.addAction(UIAlertAction( title: NSLocalizedString("ContentViewController.WebView.OpenLinkAlert.Open", comment: ""), style: .default, handler: openActionHandler) ) present(alertViewController, animated: true, completion: nil) S1LogWarn("no case match for url: \(url), fallback cancel") decisionHandler(.cancel) return } func webViewWebContentProcessDidTerminate(_: WKWebView) { S1LogError("[QuoteFloor] \(#function)") } func webView(_ webView: WKWebView, didFinish _: WKNavigation!) { DispatchQueue.main.async { [weak self] in guard let strongSelf = self else { return } strongSelf.topPositionOfMessageWithId(strongSelf.viewModel.centerFloorID, completion: { (topPosition) in let computedOffset: CGFloat = topPosition - 32.0 DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { webView.evaluateJavaScript("$('html, body').animate({ scrollTop: \(computedOffset)}, 0);", completionHandler: nil) } }) } } } // MARK: UIScrollViewDelegate extension QuoteFloorViewController: UIScrollViewDelegate { // To fix bug in WKWebView open func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { scrollView.decelerationRate = UIScrollView.DecelerationRate.normal } } // MARK: - Helper extension QuoteFloorViewController { func topPositionOfMessageWithId(_ elementID: Int, completion: @escaping (CGFloat) -> Void) { webView.s1_positionOfElement(with: "postmessage_\(elementID)") { if let rect = $0 { completion(rect.minY) } else { S1LogError("[QuoteFloorVC] Touch element ID: \(elementID) not found.") completion(0.0) } } } fileprivate func tryToReloadWKWebViewIfPageIsBlankDueToWebKitProcessTerminated() { guard let title = webView.title, title != "" else { webView.loadHTMLString(viewModel.generatePage(with: viewModel.floors), baseURL: viewModel.baseURL) return } } } // MARK: - Style extension QuoteFloorViewController { override var preferredStatusBarStyle: UIStatusBarStyle { return AppEnvironment.current.colorManager.isDarkTheme() ? .lightContent : .default } }
37.943182
171
0.648398
040e499aeaf1d9a8e53e09ac08708e1c0fd9d331
648
js
JavaScript
ui/app/components/pages/confirm-approve/confirm-approve.container.js
macman178/metamask-extension
f31e87dcd5cec09e81c741e311efc3793c9d9b98
[ "MIT" ]
null
null
null
ui/app/components/pages/confirm-approve/confirm-approve.container.js
macman178/metamask-extension
f31e87dcd5cec09e81c741e311efc3793c9d9b98
[ "MIT" ]
null
null
null
ui/app/components/pages/confirm-approve/confirm-approve.container.js
macman178/metamask-extension
f31e87dcd5cec09e81c741e311efc3793c9d9b98
[ "MIT" ]
null
null
null
import { connect } from 'react-redux' import ConfirmApprove from './confirm-approve.component' const mapStateToProps = state => { const { confirmTransaction } = state const { tokenData = {}, txData: { txParams: { to: tokenAddress } = {} } = {}, tokenProps: { tokenSymbol } = {}, } = confirmTransaction const { params = [] } = tokenData let toAddress = '' let tokenAmount = '' if (params && params.length === 2) { [{ value: toAddress }, { value: tokenAmount }] = params } return { toAddress, tokenAddress, tokenAmount, tokenSymbol, } } export default connect(mapStateToProps)(ConfirmApprove)
22.344828
59
0.631173
7f1e19ff2a04f62a5cd78e2a0bdfa1aea00f00b1
5,073
go
Go
cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go
carlosjgp/autoscaler
f4c4a77940f9dbdb45bb2a181965ab201b22aafb
[ "Apache-2.0" ]
5
2021-08-10T01:10:45.000Z
2022-01-09T06:54:10.000Z
cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go
carlosjgp/autoscaler
f4c4a77940f9dbdb45bb2a181965ab201b22aafb
[ "Apache-2.0" ]
33
2019-06-12T12:28:43.000Z
2021-03-11T13:56:05.000Z
cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go
carlosjgp/autoscaler
f4c4a77940f9dbdb45bb2a181965ab201b22aafb
[ "Apache-2.0" ]
6
2021-04-06T19:03:48.000Z
2021-08-02T09:30:57.000Z
/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package sdk import ( "context" "fmt" "time" ) // NodePool defines the nodes group deployed on OVHcloud type NodePool struct { ID string `json:"id"` ProjectID string `json:"projectId"` Name string `json:"name"` Flavor string `json:"flavor"` Status string `json:"status"` SizeStatus string `json:"sizeStatus"` Autoscale bool `json:"autoscale"` MonthlyBilled bool `json:"monthlyBilled"` AntiAffinity bool `json:"antiAffinity"` DesiredNodes uint32 `json:"desiredNodes"` MinNodes uint32 `json:"minNodes"` MaxNodes uint32 `json:"maxNodes"` CurrentNodes uint32 `json:"currentNodes"` AvailableNodes uint32 `json:"availableNodes"` UpToDateNodes uint32 `json:"upToDateNodes"` Autoscaling struct { CpuMin float32 `json:"cpuMin"` CpuMax float32 `json:"cpuMax"` MemoryMin float32 `json:"memoryMin"` MemoryMax float32 `json:"memoryMax"` ScaleDownUtilizationThreshold float32 `json:"scaleDownUtilizationThreshold"` ScaleDownUnneededTimeSeconds int32 `json:"scaleDownUnneededTimeSeconds"` ScaleDownUnreadyTimeSeconds int32 `json:"scaleDownUnreadyTimeSeconds"` } `json:"autoscaling"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } // ListNodePools allows to list all node pools available in a cluster func (c *Client) ListNodePools(ctx context.Context, projectID, clusterID string) ([]NodePool, error) { nodepools := make([]NodePool, 0) return nodepools, c.CallAPIWithContext( ctx, "GET", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool", projectID, clusterID), nil, &nodepools, nil, true, ) } // GetNodePool allows to display information for a specific node pool func (c *Client) GetNodePool(ctx context.Context, projectID string, clusterID string, poolID string) (*NodePool, error) { nodepool := &NodePool{} return nodepool, c.CallAPIWithContext( ctx, "GET", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool/%s", projectID, clusterID, poolID), nil, &nodepool, nil, true, ) } // ListNodePoolNodes allows to display nodes contained in a parent node pool func (c *Client) ListNodePoolNodes(ctx context.Context, projectID string, clusterID string, poolID string) ([]Node, error) { nodes := make([]Node, 0) return nodes, c.CallAPIWithContext( ctx, "GET", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool/%s/nodes", projectID, clusterID, poolID), nil, &nodes, nil, true, ) } // CreateNodePoolOpts defines required fields to create a node pool type CreateNodePoolOpts struct { Name *string `json:"name,omitempty"` FlavorName string `json:"flavorName"` Autoscale bool `json:"autoscale"` MonthlyBilled bool `json:"monthlyBilled"` AntiAffinity bool `json:"antiAffinity"` DesiredNodes *uint32 `json:"desiredNodes,omitempty"` MinNodes *uint32 `json:"minNodes,omitempty"` MaxNodes *uint32 `json:"maxNodes,omitempty"` } // CreateNodePool allows to creates a node pool in a cluster func (c *Client) CreateNodePool(ctx context.Context, projectID string, clusterID string, opts *CreateNodePoolOpts) (*NodePool, error) { nodepool := &NodePool{} return nodepool, c.CallAPIWithContext( ctx, "POST", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool", projectID, clusterID), opts, &nodepool, nil, true, ) } // UpdateNodePoolOpts defines required fields to update a node pool type UpdateNodePoolOpts struct { DesiredNodes *uint32 `json:"desiredNodes,omitempty"` MinNodes *uint32 `json:"minNodes,omitempty"` MaxNodes *uint32 `json:"maxNodes,omitempty"` Autoscale *bool `json:"autoscale"` NodesToRemove []string `json:"nodesToRemove,omitempty"` } // UpdateNodePool allows to update a specific node pool properties (this call is used for resize) func (c *Client) UpdateNodePool(ctx context.Context, projectID string, clusterID string, poolID string, opts *UpdateNodePoolOpts) (*NodePool, error) { nodepool := &NodePool{} return nodepool, c.CallAPIWithContext( ctx, "PUT", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool/%s", projectID, clusterID, poolID), opts, &nodepool, nil, true, ) } // DeleteNodePool allows to delete a specific node pool func (c *Client) DeleteNodePool(ctx context.Context, projectID string, clusterID string, poolID string) (*NodePool, error) { nodepool := &NodePool{} return nodepool, c.CallAPIWithContext( ctx, "DELETE", fmt.Sprintf("/cloud/project/%s/kube/%s/nodepool/%s", projectID, clusterID, poolID), nil, &nodepool, nil, true, ) }
28.661017
150
0.731126
e7bf73b1be26bc42b68af87ed6d3cdc8c52f10fa
151
kt
Kotlin
idea/testData/inspections/unusedSymbol/function/membersOfLocalClass.kt
kotlin-playground/kotlin
3ca7925138e48e065cf698418ae389dd1fd3c11b
[ "Apache-2.0" ]
null
null
null
idea/testData/inspections/unusedSymbol/function/membersOfLocalClass.kt
kotlin-playground/kotlin
3ca7925138e48e065cf698418ae389dd1fd3c11b
[ "Apache-2.0" ]
null
null
null
idea/testData/inspections/unusedSymbol/function/membersOfLocalClass.kt
kotlin-playground/kotlin
3ca7925138e48e065cf698418ae389dd1fd3c11b
[ "Apache-2.0" ]
null
null
null
fun main(args: Array<String>) { class LocalClass { fun f() { } val p = 5 } LocalClass().f() LocalClass().p }
12.583333
31
0.450331
df7d305c5136847dd98503cc02eb48b9c1a81456
633
asm
Assembly
programs/oeis/182/A182428.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/182/A182428.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/182/A182428.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A182428: a(n) = 2n(19-n). ; 0,36,68,96,120,140,156,168,176,180,180,176,168,156,140,120,96,68,36,0,-40,-84,-132,-184,-240,-300,-364,-432,-504,-580,-660,-744,-832,-924,-1020,-1120,-1224,-1332,-1444,-1560,-1680,-1804,-1932,-2064,-2200,-2340,-2484,-2632,-2784,-2940,-3100,-3264,-3432,-3604,-3780,-3960,-4144,-4332,-4524,-4720,-4920,-5124,-5332,-5544,-5760,-5980,-6204,-6432,-6664,-6900,-7140,-7384,-7632,-7884,-8140,-8400,-8664,-8932,-9204,-9480,-9760,-10044,-10332,-10624,-10920,-11220,-11524,-11832,-12144,-12460,-12780,-13104,-13432,-13764,-14100,-14440,-14784,-15132,-15484,-15840 mov $1,19 sub $1,$0 mul $1,$0 mul $1,2 mov $0,$1
70.333333
554
0.652449
50f338b2a1befe7461812b129e405c1857211f50
820
lua
Lua
scripts/vscripts/units/dummy_unit_passive.lua
windybirth/windy10v10ai
a18376d676bfb389f2e6f495526dce19001383cf
[ "MIT" ]
2
2022-03-15T06:07:36.000Z
2022-03-16T01:25:54.000Z
scripts/vscripts/units/dummy_unit_passive.lua
windybirth/windy10v10ai
a18376d676bfb389f2e6f495526dce19001383cf
[ "MIT" ]
56
2022-02-19T07:44:21.000Z
2022-03-27T12:22:26.000Z
scripts/vscripts/units/dummy_unit_passive.lua
windybirth/windy10v10ai
a18376d676bfb389f2e6f495526dce19001383cf
[ "MIT" ]
1
2022-03-28T12:25:56.000Z
2022-03-28T12:25:56.000Z
LinkLuaModifier( "modifier_dummy_unit_passive", "units/dummy_unit_passive", LUA_MODIFIER_MOTION_NONE ) dummy_unit_passive2 = dummy_unit_passive2 or class({}) modifier_dummy_unit_passive = modifier_dummy_unit_passive or class({}) function dummy_unit_passive2:Spawn() if self:GetLevel() == 0 then self:SetLevel(1) end end function dummy_unit_passive2:GetIntrinsicModifierName() return "modifier_dummy_unit_passive" end function modifier_dummy_unit_passive:CheckState() local status = { [MODIFIER_STATE_NO_HEALTH_BAR] = true, [MODIFIER_STATE_UNSELECTABLE] = true, [MODIFIER_STATE_INVULNERABLE] = true, [MODIFIER_STATE_NOT_ON_MINIMAP] = true, [MODIFIER_STATE_FLYING] = true, [MODIFIER_STATE_NO_UNIT_COLLISION] = true } return status end
30.37037
102
0.745122
0bd2387df28928ed26df35e71f8e36b2558a91f0
220
js
JavaScript
lib/index.js
redblow/wyvern-js
89a0fb779b29c139f2d85dfa9c0b625cb23ead44
[ "MIT" ]
15
2020-10-08T20:51:14.000Z
2022-03-14T13:30:12.000Z
lib/index.js
redblow/wyvern-js
89a0fb779b29c139f2d85dfa9c0b625cb23ead44
[ "MIT" ]
3
2022-01-07T00:39:42.000Z
2022-01-24T02:24:20.000Z
lib/index.js
redblow/wyvern-js
89a0fb779b29c139f2d85dfa9c0b625cb23ead44
[ "MIT" ]
38
2018-10-31T05:52:40.000Z
2022-03-31T01:02:20.000Z
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var wyvernProtocol_1 = require("./wyvernProtocol"); exports.WyvernProtocol = wyvernProtocol_1.WyvernProtocol; //# sourceMappingURL=index.js.map
44
62
0.781818
bb324f096254716bb5ea0c59976c261cbc078b1e
4,148
html
HTML
pa1-skeleton/pa1-data/9/www.stanford.edu_group_cpn_about_maps.html
yzhong94/cs276-spring-2019
a4780a9f88b8c535146040fe11bb513c91c5693b
[ "MIT" ]
null
null
null
pa1-skeleton/pa1-data/9/www.stanford.edu_group_cpn_about_maps.html
yzhong94/cs276-spring-2019
a4780a9f88b8c535146040fe11bb513c91c5693b
[ "MIT" ]
null
null
null
pa1-skeleton/pa1-data/9/www.stanford.edu_group_cpn_about_maps.html
yzhong94/cs276-spring-2019
a4780a9f88b8c535146040fe11bb513c91c5693b
[ "MIT" ]
null
null
null
stanford university center for probing the nanoscale about cpn maps and directions home about cpn research education contact us related links about cpn center overview mission statement and goals membership guidelines industrial affiliates program administration structure news and events nuggets and highlights maps and directions commitment to diversity maps and directions our location 476 lomita mall mccullough building room 126a stanford ca 94305 4045 phone 650 736 2045 fax 650 723 3044 from san francisco international airport start out going east on domestic international terminal toward airport exit 0.09 miles turn left onto airport exit 0.19 miles merge onto us 101 s toward san jose 19.38 miles exit at embarcadero road west see below for local directions from san jose international airport start out going northwest on airport blvd toward terminal c 0.19 miles turn right onto airport pkwy 0.13 miles turn left onto guadalupe pkwy ca 87 n 0.40 miles merge onto us 101 n toward san francisco 11.83 miles see below for local directions from us highway 101 north and south exit at embarcadero road west toward stanford about 2 miles from 101 north take the first right exit on the ramp from 101 south take the third right exit embarcadero turns into galvez road as you enter stanford at el camino real about 0.4 miles turn right on campus drive east after stopping at the stop sign about 0.3 miles campus drive east turns into campus drive west as it crosses palm drive continue on campus drive west the medical center will be on your right 0.59 miles at the stop sign at via ortega turn left continue until you come to the four story parking structure near the end of via ortega and panama 0.22 miles see below for parking instructions from interstate 280 north and south exit at sand hill road east toward stanford about 1.5 miles continue east turning right at the traffic signal on santa cruz avenue 0.12 miles turn left immediately at the next traffic signal onto junipero serra boulevard 0.56 miles turn left at the next traffic signal campus drive west continue around campus drive west as it curves to the right 0.59 miles turn right on via ortega continue on via ortega until you come to the four story parking structure near the end of via ortega and panama 0.22 miles see below for parking instructions from el camino real exit el camino real at university avenue drive towards the hills away from downtown palo alto university avenue becomes palm drive as you enter stanford 0.51 miles turn right on campus drive west there is a stop sign continue on campus drive west until you arrive at the stop sign at via ortega 0.59 miles then turn left continue on via ortega until you come to the four story parking structure near the end of via ortega and panama 0.22 miles see below for parking instructions parking and locating the mccullough building you may park in the visitors parking section but quarters will be needed six quarters per hour if you use the visitor parking permit you may park in a metered parking space be sure to scratch off the appropriate month date and year and hang the permit on your rearview mirror after parking your car you will need to walk to south service road which is located across the street level parking lot there are street signs indicating where south service road is located at the end of south service road you will find the mccullough building loading dock if you walk through the shipping receiving double doors you will find an elevator home about cpn research education contact us related links stanford logo ibm logo 2007 stanford university all rights reserved stanford ca 94305 650 723 2300 terms of use copyright complaints website by stanford design group center overview mission statement and goals membership guidelines industrial affiliates program administration structure news and events nuggets and highlights maps and directions commitment to diversity themes investigators cpn fellows publications and reports annual nanoprobes workshop workshop registration summer institute for middle school teachers undergraduate education graduate education other education video
2,074
4,147
0.829074
0c8b19dac043c6f1fd044d080e97281c266335ea
557
py
Python
src/tests/t_kadm5_hook.py
tizenorg/platform.upstream.krb5
a98efd0c8f97aba9d71c2130c048f1adc242772e
[ "MIT" ]
372
2016-10-28T10:50:35.000Z
2022-03-18T19:54:37.000Z
src/tests/t_kadm5_hook.py
tizenorg/platform.upstream.krb5
a98efd0c8f97aba9d71c2130c048f1adc242772e
[ "MIT" ]
317
2016-11-02T17:41:48.000Z
2021-11-08T20:28:19.000Z
src/tests/t_kadm5_hook.py
tizenorg/platform.upstream.krb5
a98efd0c8f97aba9d71c2130c048f1adc242772e
[ "MIT" ]
107
2016-11-03T19:25:16.000Z
2022-03-20T21:15:22.000Z
#!/usr/bin/python from k5test import * plugin = os.path.join(buildtop, "plugins", "kadm5_hook", "test", "kadm5_hook_test.so") hook_krb5_conf = { 'all' : { "plugins" : { "kadm5_hook" : { "module" : "test:" + plugin } } } } realm = K5Realm(krb5_conf=hook_krb5_conf, create_user=False, create_host=False) output = realm.run_kadminl ('addprinc -randkey test') if "create: stage precommit" not in output: fail('kadm5_hook test output not found') success('kadm5_hook')
24.217391
79
0.59246
e75de6a42bbced3800f1bf1a0a659c06bb985d14
9,567
js
JavaScript
sites/mip.1hai.cn/common/util.js
roccoliu/mip2-extensions-platform
78d025440ba105f3572992f69af1ed205b3c6eb8
[ "MIT" ]
null
null
null
sites/mip.1hai.cn/common/util.js
roccoliu/mip2-extensions-platform
78d025440ba105f3572992f69af1ed205b3c6eb8
[ "MIT" ]
null
null
null
sites/mip.1hai.cn/common/util.js
roccoliu/mip2-extensions-platform
78d025440ba105f3572992f69af1ed205b3c6eb8
[ "MIT" ]
null
null
null
import { CryptoJS } from './crypto.min.js' let key = CryptoJS.enc.Utf8.parse('th!s!s@p@ssw0rd;setoae$12138!@$@') // 十六位十六进制数作为密钥 let iv = CryptoJS.enc.Utf8.parse('-o@g*m,%0!si^fo1') // 十六位十六进制数作为密钥偏移量 export default { // MD5 加密 md5 (str) { return CryptoJS.MD5(str).toString() }, // AES 加密方法 encrypt (word) { let encrypted = CryptoJS.AES.encrypt(word, key, { iv: iv, mode: CryptoJS.mode.CFB, padding: CryptoJS.pad.Pkcs7 }) encrypted = encrypted.toString() encrypted = encrypted.replace(/=/g, '*') encrypted = encrypted.replace(/\+/g, '$') encrypted = encodeURIComponent(encrypted) return encrypted }, // AES 解密方法 decrypt (word) { word = word.replace(/\*/g, '=').replace(/\$/g, '+') let decrypted = CryptoJS.AES.decrypt(word, key, { iv: iv, mode: CryptoJS.mode.CFB, padding: CryptoJS.pad.Pkcs7 }) return CryptoJS.enc.Utf8.stringify(decrypted) }, // POST 加密 postParamEncrypt (key, param) { let placeParam = JSON.stringify(param) let md5Param = key + placeParam return { auth: this.md5(md5Param), des: this.encrypt(placeParam) } }, // GET 加密 getParamEncrypt (key, param) { let placeParam = param let md5Param = key + placeParam return { auth: this.md5(md5Param), des: this.encrypt(placeParam) } }, // GET & POST 加密 paramEncrypt (key, query, data) { let placeQuery = query let placeData = JSON.stringify(data) let md5Param = key + placeQuery + placeData return { auth: this.md5(md5Param) } }, // Storage getStorage (key) { return JSON.parse(localStorage.getItem(key)) }, setStorage (obj) { localStorage.setItem(obj.key, JSON.stringify(obj.data)) }, removeStorage (key) { localStorage.removeItem(key) }, // CartData getCartData () { let EhiCart = this.getStorage('EhiCart') return EhiCart }, setCartData (cartInfo) { this.setStorage({ key: 'EhiCart', data: cartInfo }) }, removeCartData () { this.removeStorage('EhiCart') }, // setCartype setCartype (cartype) { return { BrandId: cartype.BrandId, BrandName: cartype.BrandName, CarTypeId: cartype.CarTypeId, Emission: cartype.Emission, EmissionUnit: cartype.EmissionUnit, FloorPrice: cartype.FloorPrice, GearId: cartype.GearId, GearName: cartype.GearName, IsChangeStore: cartype.IsChangeStore, IsEnjoyCar: cartype.IsEnjoyCar, LevelId: cartype.LevelId, LevelName: cartype.LevelName, LocationId: cartype.LocationId, ManagerId: cartype.ManagerId, MaxPassenger: cartype.MaxPassenger, Name: cartype.Name, SmallImagePath: cartype.SmallImagePath, SortType: cartype.SortType, StructureName: cartype.StructureName, UserLevel: cartype.UserLevel, GroupId: cartype.GroupId, GroupDescription: cartype.GroupDescription } }, // 实体门店排序 physicalStore (data) { let physicalStores = [] let notPhysicalStores = [] let arr = [] data.forEach((item, index) => { if (item.IsPhysicalStore === 'Y') { physicalStores.push(item) } else { notPhysicalStores.push(item) } }) arr = physicalStores.concat(notPhysicalStores) return arr }, // 字符串替换 * 号 strReplace (str, start, end) { if (str) { let star = str.replace(/\s+/g, '') let i let replaceStar = '' let replacedStr for (i = 0; i < star.substring(start, star.length - end).length; i++) { replaceStar = replaceStar + '*' } replacedStr = star.substring(0, start) + replaceStar + star.substring(star.length - end, str.length) return replacedStr } }, // Helper /** * 当期日期前后 n 天的日期 * @param {number} s 开始时间 * @param {number} n 具体天数 * @return {string} yyyy-mm-dd */ getSpecificDate (s, n) { let d = new Date() d.setDate(d.getDate() + s + n) d = d.getFullYear() + '-' + this.formatNum(d.getMonth() + 1) + '-' + this.formatNum(d.getDate()) return d }, /** * 当期时间后 n 小时时间,不考虑分钟 * @param {number} n 具体小时 * @return {string} yyyy-mm-ddTHH:mm:00 */ getSpecificTime (n) { let d = new Date() d.setHours(d.getHours() + n) d = d.getFullYear() + '-' + this.formatNum(d.getMonth() + 1) + '-' + this.formatNum(d.getDate()) + 'T' + this.formatNum(d.getHours()) + ':' + '00' + ':' + '00' return d }, /** * 指定日期的星期 * @param {string} strDate 日期字符串 yyyy-mm-dd|yyyy-m-d * @return {string} 星期 */ getDay (strDate) { let f = strDate.replace(/-/g, '/') let w = '日一二三四五六' f = new Date(f).getDay() return '星期' + w.split('')[f] }, /** * 格式化数字,不足两位前面补 0 * @param {number} num 要格式化的数字 * @return {string} */ formatNum (num) { return num.toString().replace(/^(\d)$/, '0$1') }, /** * 将日期对象/日期字会串格式化为指定日期字符串 * @param {object|string} vArg 日期对象格式 new Date('yyyy-mm|m-dd|d HH:mm'),日期字符串格式 yyyy-mm|n-dd|d HH:mm * @function * @return {string} yyyy-mm-dd HH:mm */ formatStrDate (vArg) { switch (typeof vArg) { case 'string': let date = vArg.split(' ')[0].split(/-|\//g) let hour = vArg.split(' ')[1].split(/-|\/|:/g) return ( date[0] + '-' + this.formatNum(date[1]) + '-' + this.formatNum(date[2]) + ' ' + this.formatNum(hour[0]) + ':' + this.formatNum(hour[1]) ) case 'object': return ( vArg.getFullYear() + '-' + this.formatNum(vArg.getMonth() + 1) + '-' + this.formatNum(vArg.getDate()) + ' ' + this.formatNum(vArg.getHours()) + ':' + this.formatNum(vArg.getMinutes()) ) default: break } }, /** * 将日期格式化为指定字符串,yyyy-mm-dd HH:mm --> yyyy-mm-ddTHH:mm:00 * @param {string} str * @function * @return {string} */ formatStrWithT (str) { switch (typeof str) { case 'string': let d = str.split(' ') return d[0] + 'T' + d[1] + ':' + '00' default: break } }, /** * 将日期格式化为指定字符串,yyyy-mm-ddTHH:mm:00 --> yyyy-mm-dd HH:mm * @param {string} str * @function * @return {string} */ formatStrWithSpace (str) { switch (typeof str) { case 'string': let d = str.split('T') let last = d[1].split(':') return d[0] + ' ' + last[0] + ':' + last[1] default: break } }, /** * 格式化日期为对象 * @param {string} d 要格式的日期字符串,yyyy-mm-dd|yyyy-m-d * @return {object} {full: '2016-08-04', simply: '08月04日', week: '星期四'} */ createDate (d) { let fullD, simplyD, weekD fullD = this.formatNum(d.split('-')[0]) + '-' + this.formatNum(d.split('-')[1]) + '-' + this.formatNum(d.split('-')[2]) simplyD = this.formatNum(d.split('-')[1]) + '月' + this.formatNum(d.split('-')[2]) + '日' weekD = this.getDay(d) return { full: fullD, simply: simplyD, week: weekD } }, /** * 生成当前日期后 num 天数组 * @param {number} num 天数 * @return {array} [{full: '2016-08-04', simply: '08月04日', week: '星期四'}...] */ createDates (num) { let fullD let simplyD let weekD let i let arr = [] for (i = 0; i < num; i += 1) { fullD = this.formatNum(this.getSpecificDate(0, i).split('-')[0]) + '-' + this.formatNum(this.getSpecificDate(0, i).split('-')[1]) + '-' + this.formatNum(this.getSpecificDate(0, i).split('-')[2]) simplyD = this.formatNum(this.getSpecificDate(0, i).split('-')[1]) + '月' + this.formatNum(this.getSpecificDate(0, i).split('-')[2]) + '日' weekD = this.getDay(this.getSpecificDate(0, i)) arr.push({ full: fullD, simply: simplyD, week: weekD }) } return arr }, /** * 生成一天小时整点(可指定包含半点)数组 * @param {number} specific 是否包含半点,true/1 包含半点 * @return {array} ['00:00', '01:00',...] */ createTimes (specific) { let i let arr = [] for (i = 0; i < 24; i += 1) { if (specific) { arr.push(this.formatNum(i) + ':00') arr.push(this.formatNum(i) + ':30') } else { arr.push(this.formatNum(i) + ':00') } } return arr }, /** * 日期格式 getTime,yyyy-mm|m-dd|d HH:mm * @param {string} d '2017-01-01 00:00' * @return {number} 1483200000000 */ getTime (d) { let time = !d ? new Date() : new Date(d.replace(/-/g, '/')) return time.getTime() }, /** * 租车时间格式化 * @param {string} pickUpTime 取车时间 * @param {string} dropOffTime 还车时间 * @return {string/object} 2天/{d: '2天', h: '11小时'} */ formatRentDays (pickUpTime, dropOffTime) { let timeSpan = this.getTime(dropOffTime) - this.getTime(pickUpTime) let days = Math.floor(timeSpan / (1000 * 60 * 60 * 24)) let hours = Math.floor((timeSpan % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) return hours ? { d: days + '天', h: hours + '小时' } : days + '天' }, /** * 将 yyyy-mm-dd 转换为 yyyy/mm/dd * @param {string} d 要格式的日期字符串 * @return {string} */ formatDateCompatible (d) { return d.replace(/-/g, '/') } }
21.21286
101
0.534755
865dcbde8a393be9e8b4bac44c890e11b6e6a208
2,474
rs
Rust
gdk4/src/auto/content_serializer.rs
pbor/gtk4-rs
1c8ca479841a6af608026f95be5e28a426b35732
[ "MIT-0", "MIT" ]
null
null
null
gdk4/src/auto/content_serializer.rs
pbor/gtk4-rs
1c8ca479841a6af608026f95be5e28a426b35732
[ "MIT-0", "MIT" ]
null
null
null
gdk4/src/auto/content_serializer.rs
pbor/gtk4-rs
1c8ca479841a6af608026f95be5e28a426b35732
[ "MIT-0", "MIT" ]
null
null
null
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::translate::*; use std::fmt; glib::wrapper! { pub struct ContentSerializer(Object<ffi::GdkContentSerializer>); match fn { get_type => || ffi::gdk_content_serializer_get_type(), } } impl ContentSerializer { #[doc(alias = "gdk_content_serializer_get_cancellable")] pub fn get_cancellable(&self) -> Option<gio::Cancellable> { unsafe { from_glib_none(ffi::gdk_content_serializer_get_cancellable( self.to_glib_none().0, )) } } #[doc(alias = "gdk_content_serializer_get_gtype")] pub fn get_gtype(&self) -> glib::types::Type { unsafe { from_glib(ffi::gdk_content_serializer_get_gtype(self.to_glib_none().0)) } } #[doc(alias = "gdk_content_serializer_get_mime_type")] pub fn get_mime_type(&self) -> glib::GString { unsafe { from_glib_none(ffi::gdk_content_serializer_get_mime_type( self.to_glib_none().0, )) } } #[doc(alias = "gdk_content_serializer_get_output_stream")] pub fn get_output_stream(&self) -> gio::OutputStream { unsafe { from_glib_none(ffi::gdk_content_serializer_get_output_stream( self.to_glib_none().0, )) } } #[doc(alias = "gdk_content_serializer_get_priority")] pub fn get_priority(&self) -> i32 { unsafe { ffi::gdk_content_serializer_get_priority(self.to_glib_none().0) } } #[doc(alias = "gdk_content_serializer_get_value")] pub fn get_value(&self) -> glib::Value { unsafe { from_glib_none(ffi::gdk_content_serializer_get_value(self.to_glib_none().0)) } } #[doc(alias = "gdk_content_serializer_return_error")] pub fn return_error(&self, error: &mut glib::Error) { unsafe { ffi::gdk_content_serializer_return_error( self.to_glib_none().0, error.to_glib_none_mut().0, ); } } #[doc(alias = "gdk_content_serializer_return_success")] pub fn return_success(&self) { unsafe { ffi::gdk_content_serializer_return_success(self.to_glib_none().0); } } } impl fmt::Display for ContentSerializer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ContentSerializer") } }
30.170732
95
0.624091
39ba9f4a246ade90a89457335ace9c008b986594
336
js
JavaScript
docs/cpp_man/html/search/variables_a.js
mllg/compboost
f493bb92050e27256f7937c82af6fa65e71abe67
[ "MIT" ]
null
null
null
docs/cpp_man/html/search/variables_a.js
mllg/compboost
f493bb92050e27256f7937c82af6fa65e71abe67
[ "MIT" ]
null
null
null
docs/cpp_man/html/search/variables_a.js
mllg/compboost
f493bb92050e27256f7937c82af6fa65e71abe67
[ "MIT" ]
null
null
null
var searchData= [ ['n_5fknots',['n_knots',['../classblearner_1_1_baselearner_p_spline.html#a0ddb0d169df2cae3a22e7d0bcfd2031f',1,'blearner::BaselearnerPSpline::n_knots()'],['../classblearnerfactory_1_1_baselearner_p_spline_factory.html#a11e98fcad44d686df7be69d3176480f9',1,'blearnerfactory::BaselearnerPSplineFactory::n_knots()']]] ];
67.2
314
0.821429
d0ebcb7e7e5c365961483600d2154f4a59af7445
528
css
CSS
css/tennis-ball.css
Viglino/iconnicss
cc54b26dcdf70460fe9d2802360852ca8be4ca88
[ "MIT" ]
110
2018-01-07T08:55:27.000Z
2022-02-09T08:32:42.000Z
css/tennis-ball.css
Viglino/iconnicss
cc54b26dcdf70460fe9d2802360852ca8be4ca88
[ "MIT" ]
12
2018-06-15T08:09:45.000Z
2021-02-09T17:25:28.000Z
css/tennis-ball.css
Viglino/iconnicss
cc54b26dcdf70460fe9d2802360852ca8be4ca88
[ "MIT" ]
21
2018-05-01T07:33:58.000Z
2022-03-22T23:07:20.000Z
i.icss-tennis-ball { width: .8em; height: .8em; border-radius: 50%; background-color: transparent; box-shadow: inset 0 0 0 .07em; margin: .1em; overflow: hidden; } i.icss-tennis-ball:before { width: .8em; height: .8em; border-radius: 50%; box-shadow: inset 0 0 0 .07em; top: .5em; left: .1em; } i.icss-tennis-ball:after { width: .8em; height: .8em; border-radius: 50%; box-shadow: inset 0 0 0 .07em; top: -.5em; left: -.1em; }
20.307692
35
0.543561