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
dc18f1ee07a5c61296acc97ab83c792001ab120a
3,293
lua
Lua
core/modules/menugen/init.lua
mak-alex/awesome-multicolor
e1966abd8223fa458b847a43d885af6c4b4eae34
[ "MIT" ]
1
2020-09-23T14:28:41.000Z
2020-09-23T14:28:41.000Z
core/modules/menugen/init.lua
mak-alex/awesome-multicolor
e1966abd8223fa458b847a43d885af6c4b4eae34
[ "MIT" ]
null
null
null
core/modules/menugen/init.lua
mak-alex/awesome-multicolor
e1966abd8223fa458b847a43d885af6c4b4eae34
[ "MIT" ]
null
null
null
local FHMenuGen = { _NAME = "FH-MenuGen", _VERSION = 'FH-MenuGen v0.1.0-rc1', _URL = 'https://bitbucket.org/enlab/menugen', _MAIL = 'flashhacker1988@gmail.com', _LICENSE = [[ MIT LICENSE Copyright (c) 2015 Mikhailenko Alexandr Konstantinovich (a.k.a) Alex M.A.K Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]], _DESCRIPTION = [[ Drop-down applications menu for the awesome window manager To use this module add: mymainmenu = awful.menu.new({ items = require("menugen").build_menu(), theme = { height = 16, width = 130 }}) ]] } local menu_gen = require("menubar.menu_gen") local menu_utils = require("menubar.utils") local pairs,ipairs,table,string,next=pairs,ipairs,table,string,next module("core.modules.menugen") --Built in menubar should be checking local applications directory menu_gen.all_menu_dirs = { '/usr/share/applications/', '/usr/local/share/applications/', '~/.local/share/applications' } --Expecting an wm_name of awesome omits too many applications and tools menu_utils.wm_name = "" -- Use MenuBar Parsing Utils to build StartMenu for Awesome -- @return awful.menu compliant menu items tree function build_menu() local result = {} local menulist = menu_gen.generate() for k,v in pairs(menu_gen.all_categories) do table.insert(result, {k, {}, v["icon"] } ) end if menulist then for k, v in ipairs(menulist) do for _, cat in ipairs(result) do if cat[1] == v["category"] and v["name"] ~= '' then table.insert( cat[2] , { v["name"], v["cmdline"], v["icon"] } ) break end end end -- Cleanup Things a Bit for k,v in ipairs(result) do -- Remove Unused Categories if not next(v[2]) then table.remove(result, k) else --Sort entries Alphabetically (by Name) table.sort(v[2], function (a,b) return string.byte(a[1]) < string.byte(b[1]) end) -- Replace Category Name with nice name v[1] = menu_gen.all_categories[v[1]].name end end --Sort Categories Alphabetically Also table.sort(result, function(a,b) return string.byte(a[1]) < string.byte(b[1]) end) else result=nil end return result end
40.158537
89
0.682053
e697a1fb4985679bea105bd73c484b8573415f9d
469
tab
SQL
www/bases-examples_Linux/unimarc/def/en/charset.tab
mdama003/ABCD2
b5f93be122791ab690a4d5954a3ec866196413a5
[ "Unlicense" ]
null
null
null
www/bases-examples_Linux/unimarc/def/en/charset.tab
mdama003/ABCD2
b5f93be122791ab690a4d5954a3ec866196413a5
[ "Unlicense" ]
null
null
null
www/bases-examples_Linux/unimarc/def/en/charset.tab
mdama003/ABCD2
b5f93be122791ab690a4d5954a3ec866196413a5
[ "Unlicense" ]
null
null
null
01|ISO 646, IRV version (basic Latin set) 02|ISO Registration # 37 (basic Cyrillic set) 03|ISO 5426 (extended Latin set) 04|ISO 5427 (extended Cyrillic set) 05|ISO 5428 (Greek set) 06|ISO 6438 (African coded character set) 07|ISO 10586 (Georgian set) 08|ISO 8957 (Hebrew set) Table 1 09|ISO 8957 (Hebrew set) Table 2 10|[Reserved] 11|ISO 5426-2 (Latin characters used in minor European languages and obsolete typography) 50|ISO 10646 Level 3 (Unicode, UTF-8)
39.083333
90
0.744136
d9cd06cd6694469fef701dbffdc3da0d4444dae5
1,413
rs
Rust
tests/all/import_indexes.rs
PLSysSec/wasmtime
8082aeaa5f593d8f343c9e6f1cca111802732724
[ "Apache-2.0" ]
2
2020-07-09T12:09:23.000Z
2020-10-22T15:43:15.000Z
tests/all/import_indexes.rs
PLSysSec/wasmtime
8082aeaa5f593d8f343c9e6f1cca111802732724
[ "Apache-2.0" ]
4
2020-03-12T17:50:05.000Z
2022-02-15T01:43:05.000Z
tests/all/import_indexes.rs
PLSysSec/wasmtime
8082aeaa5f593d8f343c9e6f1cca111802732724
[ "Apache-2.0" ]
1
2022-03-20T18:43:00.000Z
2022-03-20T18:43:00.000Z
use wasmtime::*; #[test] fn same_import_names_still_distinct() -> anyhow::Result<()> { const WAT: &str = r#" (module (import "" "" (func $a (result i32))) (import "" "" (func $b (result f32))) (func (export "foo") (result i32) call $a call $b i32.trunc_f32_u i32.add) ) "#; let store = Store::default(); let module = Module::new(store.engine(), WAT)?; let imports = [ Func::new( &store, FuncType::new(Box::new([]), Box::new([ValType::I32])), |_, params, results| { assert!(params.is_empty()); assert_eq!(results.len(), 1); results[0] = 1i32.into(); Ok(()) }, ) .into(), Func::new( &store, FuncType::new(Box::new([]), Box::new([ValType::F32])), |_, params, results| { assert!(params.is_empty()); assert_eq!(results.len(), 1); results[0] = 2.0f32.into(); Ok(()) }, ) .into(), ]; let instance = Instance::new(&store, &module, &imports)?; let func = instance.get_func("foo").unwrap(); let results = func.call(&[])?; assert_eq!(results.len(), 1); match results[0] { Val::I32(n) => assert_eq!(n, 3), _ => panic!("unexpected type of return"), } Ok(()) }
25.690909
66
0.457891
71bd4a22c82a7fb2b13a5486b117161537012867
203
ts
TypeScript
example/functions/src/firebase_functions/models/addtion_request.model.ts
gpfister/firebase-emulator-unit-test
1f120dbcf2c1b09e558df24bc059dc8bd12a335d
[ "MIT" ]
null
null
null
example/functions/src/firebase_functions/models/addtion_request.model.ts
gpfister/firebase-emulator-unit-test
1f120dbcf2c1b09e558df24bc059dc8bd12a335d
[ "MIT" ]
1
2021-12-28T17:21:39.000Z
2021-12-28T17:21:39.000Z
example/functions/src/firebase_functions/models/addtion_request.model.ts
gpfister/firebase-emulator-unit-test
1f120dbcf2c1b09e558df24bc059dc8bd12a335d
[ "MIT" ]
null
null
null
/** * gp-firebase-emulator-unit-test/example/functions * * @author Greg PFISTER * @license MIT * @copyright (C) 2021, Greg PFISTER */ export type GPAdditionRequest = { a: number; b: number; }
15.615385
51
0.665025
c3ddef5a6b161e1102aadc7eebd83d9d14e64105
274
kt
Kotlin
src/main/kotlin/me/steven/indrev/items/tools/IRBasicSword.kt
shartte/Industrial-Revolution
30788828c27fed357555ec8caa92612f9bf1cbd4
[ "Apache-2.0" ]
null
null
null
src/main/kotlin/me/steven/indrev/items/tools/IRBasicSword.kt
shartte/Industrial-Revolution
30788828c27fed357555ec8caa92612f9bf1cbd4
[ "Apache-2.0" ]
null
null
null
src/main/kotlin/me/steven/indrev/items/tools/IRBasicSword.kt
shartte/Industrial-Revolution
30788828c27fed357555ec8caa92612f9bf1cbd4
[ "Apache-2.0" ]
null
null
null
package me.steven.indrev.items.tools import net.minecraft.item.SwordItem import net.minecraft.item.ToolMaterial class IRBasicSword(material: ToolMaterial, attackDamage: Int, attackSpeed: Float, settings: Settings) : SwordItem(material, attackDamage, attackSpeed, settings)
45.666667
160
0.832117
296bfafad9ff8c7a18b0d6faac1d434f8d555762
11,080
asm
Assembly
2.asm
AsadKhalil/Assembly_x86
48aa2a0ab93fd359f5f20369bb9064052c2f2884
[ "MIT" ]
null
null
null
2.asm
AsadKhalil/Assembly_x86
48aa2a0ab93fd359f5f20369bb9064052c2f2884
[ "MIT" ]
null
null
null
2.asm
AsadKhalil/Assembly_x86
48aa2a0ab93fd359f5f20369bb9064052c2f2884
[ "MIT" ]
null
null
null
[org 0x0100] jmp start ;each queue has a size of 32 words = 64 bytes = 512 bits Queue: times 512 dw 0 flag: dw 0 ;each bit of the flag is used to represent the state ;of the corresponding flag ;========================================= ;qcreate function returns the queue number ;if it finds a free queue or -1 if it ;failed. found: push word 1 jmp endqfunc notfound: push word -1 jmp endqfunc qcreate: push bp ;saving the value of bp mov bp, sp ;moving the value of sp into bp for having a reference in stack push ax ;saving thr value of ax push bx ;saving the value of bx push cx ;saving the value of cx mov bx, -64 ;initializing bx with -64 mov ax, 0 ;initializing ax with 0 mov cx, 0 ;initializing cx with 0 loop1: add bx, 64 mov ax, [Queue + bx + 62];rear cmp ax, 30 jnz skipqc mov ax, 1 jmp compare skipqc: inc ax compare: cmp ax, [Queue + bx] jnz found inc cx cmp cx, 15 jz notfound jmp loop1 endqfunc: pop cx pop bx pop ax pop bp ret ;========================================= ;========================================= ;qdestroy marks the queue as free. ;It is assumed that by marking the queue ;free means that queue is reset to empty queue ;and the its corresponding value in flag variable ;is updated. It also takes Queue number as parameter. qdestroy: push bp ;saving the value of bp mov bp, sp ;moving the value of sp into bp for having a reference in stack push ax ;saving thr value of ax push bx ;saving the value of bx push cx ;saving the value of cx push dx ;saving the value of dx ;initializing registers mov ax, 64 mov bx, 0 mov cx, 0 mov dx, 0 ;moving the parameter in bx register mov bx, [bp + 4] mul bx mov bx, ax l1: mov word [Queue + bx], 0 add bx, 2 inc cx cmp cx, 32 jnz l1 ;updating the value of this queue in the flag variable mov ax, [flag] mov bx, [bp + 4] ;moving Queue number in bx mov cx, 1 ;reseting cx register cmp cx, bx l2: rol ax, 1 inc cx cmp cx, bx jb l2 skip1: sub dx, dx ;generating zero in the carry flag rcr ax, 1 mov cx, 1 cmp cx, bx ja skip2 l3: ror ax, 1 inc cx cmp cx, bx jbe l3 skip2: mov word [flag], ax ;ending function pop dx pop cx pop bx pop ax pop bp ret 2 ;========================================= ;========================================= ;This function sets the specified bit of ;flag variable to 0. setzero: push bp mov bp, sp push ax push bx push cx push dx mov ax, [flag] mov bx, [bp + 4] mov cx, 1 ;reseting cx register cmp cx, bx ;ja skip1b l2c: rol ax, 1 inc cx cmp cx, bx jb l2c skip1b: mov dx, 5 sub dx, dx rcr ax, 1 mov cx, 1 cmp cx, bx ja skip2c l3c: ror ax, 1 inc cx cmp cx, bx jbe l3c skip2c: mov word [flag], ax ;ending function pop dx pop cx pop bx pop ax pop bp ret 2 ;========================================= ;This function sets the specified bit of ;flag variable to 1. setbit: push bp mov bp, sp push ax push bx push cx push dx mov ax, [flag] mov bx, [bp + 4] mov cx, 1 ;reseting cx register cmp cx, bx ja skip1a l2b: rol ax, 1 inc cx cmp cx, bx jbe l2b skip1a: mov dl, 5 mov dh, 10 sub dl, dh rcr ax, 1 mov cx, 1 cmp cx, bx ja skip2b l3b: ror ax, 1 inc cx cmp cx, bx jbe l3b skip2b: mov word [flag], ax ;ending function pop dx pop cx pop bx pop ax pop bp ret 2 ;========================================= ;This function returns 1 if insertion is ;possible other wise -1. checkinpos: push bp mov bp, sp push ax mov ax, 0 mov ax, [bp + 4] ;moving rear cmp ax, 30 jz skipc inc ax jmp rempart skipc: mov ax, 1 rempart: cmp ax, [bp + 6] ;comparing it with front jz notpossible mov word [bp + 8], 1 jmp endc notpossible: mov word [bp + 8], -1 endc: pop ax pop bp ret 4 ;========================================= ;========================================= ;This function checks if qremove is possible checkrempos: push bp mov bp, sp push ax mov ax, 0 mov ax, [bp + 6] ;moving front cmp ax, 30 jz skipd inc ax jmp rempart2 skipd: mov ax, 1 rempart2: cmp ax, [bp + 4] ja notpossible2 mov word [bp + 8], 1 jmp endd notpossible2: mov word [bp + 8], -1 endd: pop ax pop bp ret 4 ;========================================= ;========================================= ;This function is used to remove items from ;the circular queue. qremove: push bp ;saving the value of bp mov bp, sp ;moving the value of sp into bp for having a reference in stack push ax ;saving thr value of ax push bx ;saving the value of bx push cx ;saving the value of cx push dx ;saving the value of dx push si ;saving the value of si ;initializing registers mov ax, 64 mov bx, 0 mov cx, 0 mov dx, 0 mov si, 0 ;moving queue number in bx register mov bx, [bp + 4] mul bx mov bx, ax checkqr: sub sp, 2 mov ax, [Queue + bx] ;Queue front push ax mov cx, ax mov ax, [Queue + bx + 62] ;Queue rear push ax call checkrempos pop dx cmp dx, 1 jnz notapplicable2 jmp applicable2 notapplicable2: mov word [bp + 6], 0 jmp endrem applicable2: mov word [bp + 6], 1 mov ax, [Queue + bx] mov si, 2 mul si mov si, ax mov word [Queue + bx + si], 0 mov word ax, [Queue + bx] cmp ax, 30 jnz skipq mov ax, 1 jmp placefront skipq: inc ax placefront: mov [Queue + bx], ax checkifreset: cmp cx, [Queue + bx + 62] jnz endrem mov word[Queue + bx], 0 mov word[Queue + bx + 62], 0 push word [bp + 4] call setzero endrem: pop si pop dx pop cx pop bx pop ax pop bp ret 2 ;========================================= ;========================================= ;This function is used to add items in the ;circular queue. A real circular queue is ;dynamic but according to this question ;the circular queue is static. qadd: push bp ;saving the value of bp mov bp, sp ;moving the value of sp into bp for having a reference in stack push ax ;saving thr value of ax push bx ;saving the value of bx push cx ;saving the value of cx push dx ;saving the value of dx push si ;saving the value of si ;initializing registers mov ax, 64 mov bx, 0 mov cx, 0 mov dx, 0 mov si, 0 ;moving queue number in bx register mov bx, [bp + 4] mul bx mov bx, ax check1: sub sp, 2 mov ax, [Queue + bx] push ax mov ax, [Queue + bx + 62] push ax call checkinpos pop dx cmp dx, 1 jz applicable notapplicable: mov word [bp + 8], 0 jmp endaddfunc skipb: mov ax, 1 jmp skipad applicable: cmp word [Queue + bx + 62], 1 jnz skip4d cmp word [Queue + bx], 1 jnz skip4d push word [bp + 4] call setbit skip4d: mov ax, [Queue + bx + 62] cmp ax, 30 jz skipb inc ax skipad: mov word [Queue + bx + 62], ax mov si, 2 mul si mov si, ax mov ax, [bp + 6] ;moving data parameter in ax mov word [Queue + bx + si], ax mov word [bp + 8], 1 mov ax, [Queue + bx] cmp ax, 0 jnz endaddfunc inc ax mov [Queue + bx], ax endaddfunc: pop si pop dx pop cx pop bx pop ax pop bp ret 4 ;========================================= start: sub sp, 2 call qcreate pop dx mov ax, 2 push ax call qdestroy sub sp, 2 mov ax, 0xA ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xB ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xC ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xD ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xE ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xF ;item to add push ax mov ax, 0 ;queue number push ax call qadd sub sp, 2 call qcreate pop dx mov ax, 0xAA ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xAB ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xAC ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xAD ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xAE ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xAF ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBA ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBB ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBC ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBD ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBE ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xBF ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCA ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCB ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCC ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCD ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCE ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xCF ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDA ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDB ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDC ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDD ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDE ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xDF ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0xEA ;item to add push ax mov ax, 0 ;queue number push ax sub sp, 2 call qcreate pop dx call qadd push word 0 call qremove push word 0 call qremove push word 0 call qremove mov ax, 0x11 ;item to add push ax mov ax, 0 ;queue number push ax call qadd mov ax, 0x33 ;item to add push ax mov ax, 0 ;queue number push ax call qadd finish: mov ax, 0x04c00 int 21h
13.628536
76
0.562906
0ee622d8634aeb9000e2c294eac997e0191113bc
1,017
ts
TypeScript
src/modules/articles/useCases/createArticle/CreateArticleUseCase.ts
joao96/space-flight-news-challenge
077a47c4ee73cdde6ef7f38f7bee1a5a6d4b8f00
[ "MIT" ]
1
2022-01-30T23:33:37.000Z
2022-01-30T23:33:37.000Z
src/modules/articles/useCases/createArticle/CreateArticleUseCase.ts
joao96/space-flight-news-challenge
077a47c4ee73cdde6ef7f38f7bee1a5a6d4b8f00
[ "MIT" ]
null
null
null
src/modules/articles/useCases/createArticle/CreateArticleUseCase.ts
joao96/space-flight-news-challenge
077a47c4ee73cdde6ef7f38f7bee1a5a6d4b8f00
[ "MIT" ]
null
null
null
import { Article } from '@prisma/client'; import { AppError } from '../../../../errors/AppError'; import { ArticlesRepository } from '../../repositories/implementations/ArticlesRepository'; class CreateArticleUseCase { private articlesRepository: ArticlesRepository; constructor() { this.articlesRepository = new ArticlesRepository(); } async execute(newArticle: Article): Promise<Article> { const articleIdAlreadyExists = await this.articlesRepository.findById( newArticle.id ); if (articleIdAlreadyExists) { throw new AppError('Id already in use.'); } const articleTitleAlreadyExists = await this.articlesRepository.findByTitle( newArticle.title ); if (articleTitleAlreadyExists) { throw new AppError('Title already in use.'); } const article = await this.articlesRepository.create(newArticle); if (!article) { throw new AppError('Unable to add article.'); } return article; } } export { CreateArticleUseCase };
24.804878
91
0.695182
738b966c76b284259b7a5374a96806ec9f0e9678
1,807
rs
Rust
src/policy/expiration.rs
florianeichin/aerospike-client-rust
5c47d46ad30fe17955ee880eb113b01a7aadb4b7
[ "Apache-2.0" ]
null
null
null
src/policy/expiration.rs
florianeichin/aerospike-client-rust
5c47d46ad30fe17955ee880eb113b01a7aadb4b7
[ "Apache-2.0" ]
null
null
null
src/policy/expiration.rs
florianeichin/aerospike-client-rust
5c47d46ad30fe17955ee880eb113b01a7aadb4b7
[ "Apache-2.0" ]
null
null
null
// Copyright 2015-2018 Aerospike, Inc. // // Portions may be licensed to Aerospike, Inc. under one or more contributor // license agreements. // // 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. use std::u32; const NAMESPACE_DEFAULT: u32 = 0x00000000; const NEVER_EXPIRE: u32 = 0xFFFFFFFF; // -1 as i32 const DONT_UPDATE: u32 = 0xFFFFFFFE; // -2 as i32 /// Record expiration, also known as time-to-live (TTL). #[derive(Debug, Clone, Copy)] pub enum Expiration { /// Set the record to expire X seconds from now Seconds(u32), /// Set the record's expiry time using the default time-to-live (TTL) value for the namespace NamespaceDefault, /// Set the record to never expire. Requires Aerospike 2 server version 2.7.2 or later or /// Aerospike 3 server version 3.1.4 or later. Do not use with older servers. Never, /// Do not change the record's expiry time when updating the record; requires Aerospike server /// version 3.10.1 or later. DontUpdate, } impl From<Expiration> for u32 { fn from(exp: Expiration) -> u32 { match exp { Expiration::Seconds(secs) => secs, Expiration::NamespaceDefault => NAMESPACE_DEFAULT, Expiration::Never => NEVER_EXPIRE, Expiration::DontUpdate => DONT_UPDATE, } } }
36.14
98
0.696735
20e8768eb01ece26dbcdd8a6181de3f4950e34a8
7,243
css
CSS
docs/css/common.css
iongion/podman-desktop-companion
be572969d801e30d4d28f5953b29d792ba130b28
[ "MIT" ]
309
2021-12-06T16:04:59.000Z
2022-03-31T22:14:15.000Z
docs/css/common.css
iongion/podman-desktop-companion
be572969d801e30d4d28f5953b29d792ba130b28
[ "MIT" ]
7
2021-12-10T14:03:25.000Z
2022-03-28T14:20:45.000Z
docs/css/common.css
iongion/podman-desktop-companion
be572969d801e30d4d28f5953b29d792ba130b28
[ "MIT" ]
12
2021-12-06T16:19:49.000Z
2022-02-18T18:44:39.000Z
html, body { margin: 0; padding: 0; } .navbar { padding-top: 30px; display: flex; justify-content: space-between; text-align: center; } .logo { height: 70px; margin-left: 30px; } .header-buttons { margin-right: 30px; display: flex; align-items: center; } .header-buttons .github-button-container { margin-top: 8px; margin-left: 8px; } .intro { margin-left: 10%; margin-right: 10%; padding-top: 40px; padding-bottom: 40px; } h1 { font-size: 60px; font-family: "Montserrat", sans-serif; font-weight: 500; text-align: center; } .intro p { font-size: 20px; font-family: "Montserrat", sans-serif; font-weight: 300; line-height: 1.8em; text-align: center; margin-bottom: 2px; } .intro a { text-decoration: none; } .downloadSection { display: flex; flex-direction: row; flex-wrap: wrap; margin-top: 40px; justify-content: center; } .download { display: flex; flex-direction: column; margin-right: 15px; margin-bottom: 20px; } .downloadSection .download:last-child { margin-right: 0px; } .downloadBundles { text-align: center; } .download a.downloadButton { padding: 14px 10px 14px 10px; border-radius: 5px; text-decoration: none; font-family: "Montserrat", sans-serif; font-weight: 500; font-size: 16px; text-align: center; } ul.downloadBundles, ul.downloadBundles li { margin: 0; padding: 0; } ul.downloadBundles li { display: inline-block; padding-left: 5px; padding-right: 5px; } ul.downloadBundles li a { text-decoration: underline; } ul.downloadBundles { padding: 10px; } .content { margin-left: 15%; margin-right: 15%; padding-top: 20px; margin-top: 0; } .content h2, p, ul { font-family: "Montserrat", sans-serif; margin-top: 0px; } .content h2 { font-weight: 500; font-size: 36px; } .content p { font-weight: 300; font-size: 18px; line-height: 1.5em; } .content ul { font-weight: 300; font-size: 18px; line-height: 1.5em; margin-right: 0px; padding-left: 0px; } .content ul li { padding-bottom: 20px; } .section00 { text-align: center; padding-top: 60px; padding-bottom: 60px; } .cover { width: 100%; box-shadow: 0 10px 10px -5px; border-radius: 5px; } .section0, .section1, .section2, .section3, .section4, .section5 { display: flex; flex-direction: row; flex-wrap: wrap; width: 100%; padding-top: 60px; padding-bottom: 60px; } .column1, .column2 { display: flex; flex-direction: column; flex: 50%; justify-content: center; } .section0 .column1 h2 { padding-right: 50px; margin-right: 0px; } .section0 .column1 p { padding-right: 50px; margin-right: 0px; } .section0 .column2 h2 { padding-left: 50px; margin-left: 0px; } .section0 .column2 p { padding-left: 50px; margin-left: 0px; } .section1 .column1 h2 { padding-right: 50px; margin-right: 0px; } .section1 .column1 ul { padding-right: 50px; } .section2 .column2 h2 { padding-left: 50px; } .section2 .column2 ul { padding-left: 50px; } .section3 .column1 h2 { padding-right: 50px; margin-right: 0px; } .section3 .column1 p { padding-right: 50px; margin-right: 0px; } .section4 .column2 h2 { padding-left: 50px; } .section4 .column2 p { padding-left: 50px; } .section5 .column1 h2 { padding-right: 50px; margin-right: 0px; } .section5 .column1 p { padding-right: 50px; margin-right: 0px; } .imgPost { width: 100%; box-shadow: 0 10px 10px -5px; border-radius: 5px; } .sectionHighlightContainer { width: 100%; } .sectionHighlight { display: flex; flex-direction: row; flex-wrap: wrap; padding-top: 60px; padding-bottom: 60px; margin-left: 10%; margin-right: 10%; } .sectionHighlight .column1Highlight { display: flex; flex-direction: column; flex: 60%; } .sectionHighlight .column2Highlight { display: flex; flex-direction: column; flex: 40%; } .sectionHighlight h2, p { font-family: "Montserrat", sans-serif; margin-top: 0px; } .sectionHighlight h2 { font-weight: 500; font-size: 36px; padding-left: 50px; } .sectionHighlight p { font-weight: 300; font-size: 18px; line-height: 1.5em; padding-left: 50px; } .imgHighlight { width: 100%; } .imgHighlight2 { border-radius: 15px; opacity: 0.5; overflow: hidden; border: 1px solid #ff03f0; } .supporters { display: flex; align-items: center; justify-content: center; width: 368px; overflow: hidden; height: 40px; } .contact { display: flex; flex-direction: row; flex-wrap: wrap; width: 100%; padding-top: 60px; padding-bottom: 60px; } .beta { display: flex; flex-direction: column; flex: 65%; } .mailme { display: flex; flex-direction: column; flex: 35%; } .beta p { font-family: "Montserrat", sans-serif; font-weight: 500; font-size: 50px; padding-right: 60px; } .beta span { font-size: 90px; } .mailme { padding-top: 150px; } .mailme h2 { padding-left: 60px; margin-bottom: 0px; } .mailme p { font-weight: 300; font-size: 20px; padding-left: 60px; padding-top: 20px; } .mailme .cta { padding-left: 60px; } .mailme a { font-family: "Montserrat", sans-serif; font-size: 10px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; padding: 14px 14px 14px 14px; border-radius: 5px; display: inline-block; } .mode { margin-bottom: 30px; margin-right: 0; text-align: right; } .mode span { font-family: "Montserrat", sans-serif; font-weight: 300; font-size: 10px; text-transform: uppercase; letter-spacing: 2px; margin: 0 10px 0 0; } .mode span:last-child { margin-right: 0px; } .switch { position: relative; display: inline-block; width: 50px; height: 15px; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; border-radius: 15px; transition: 0.4s; } .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 0px; bottom: 0px; top: -2px; border-radius: 50%; transition: 0.4s; } input:checked + .slider:before { transform: translateX(26px); } .footer { display: flex; vertical-align: middle; padding-top: 15px; padding-bottom: 15px; } .footer p, ul.footerMenu li { font-family: "Montserrat", sans-serif; font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; margin: 0px; } ul.footerMenu, ul.footerMenu li { display: inline-block; } ul.footerMenu { text-align: center; flex: 1; margin: 0; } .footerMenu li { margin-right: 15px; } .footerMenu li:last-child { margin-right: 0; } .footer a { text-decoration: none; } .downloadSection .soon { text-align: center; display: inline-block; padding: 10px; } .command-line { font-family: monospace; background: #222; border: 1px solid #333; color: green; padding: 5px; display: inline-block; } .installationSection { margin: 0 auto; color: #fff; display: flex; align-items: center; justify-content: center; } .installationSection a { font-weight: normal; text-decoration: underline; } .installationSection a { margin-right: 40px; } .installationSection a:last-child { margin-right: 0; }
15.026971
42
0.658567
84f684cd53164418c3333105cab0f82d1eb3f1fb
3,885
swift
Swift
Tests/SUSpotlightImporterTest.swift
alfwatt/Sparkle
3a5c620b60f483b71f8c28573ac29bf85fda6193
[ "BSD-2-Clause" ]
1
2016-09-19T18:29:58.000Z
2016-09-19T18:29:58.000Z
Tests/SUSpotlightImporterTest.swift
alfwatt/Sparkle
3a5c620b60f483b71f8c28573ac29bf85fda6193
[ "BSD-2-Clause" ]
null
null
null
Tests/SUSpotlightImporterTest.swift
alfwatt/Sparkle
3a5c620b60f483b71f8c28573ac29bf85fda6193
[ "BSD-2-Clause" ]
null
null
null
// // SUSpotlightImporterTest.swift // Sparkle // // Created by Mayur Pawashe on 8/27/16. // Copyright © 2016 Sparkle Project. All rights reserved. // import XCTest class SUSpotlightImporterTest: XCTestCase { func testUpdatingSpotlightBundles() { let fileManager = SUFileManager.defaultManager() let tempDirectoryURL = try! fileManager.makeTemporaryDirectoryWithPreferredName("Sparkle Unit Test Data", appropriateForDirectoryURL: NSURL(fileURLWithPath: NSHomeDirectory())) let bundleDirectory = tempDirectoryURL.URLByAppendingPathComponent("bundle.app") try! fileManager.makeDirectoryAtURL(bundleDirectory) let innerDirectory = bundleDirectory.URLByAppendingPathComponent("foo") try! fileManager.makeDirectoryAtURL(innerDirectory) try! NSData().writeToURL(bundleDirectory.URLByAppendingPathComponent("bar"), options: .AtomicWrite) let importerDirectory = innerDirectory.URLByAppendingPathComponent("baz.mdimporter") try! fileManager.makeDirectoryAtURL(importerDirectory) try! fileManager.makeDirectoryAtURL(innerDirectory.URLByAppendingPathComponent("flag")) try! NSData().writeToURL(importerDirectory.URLByAppendingPathComponent("file"), options: .AtomicWrite) let oldFooDirectoryAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(innerDirectory.path!) let oldBarFileAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(bundleDirectory.URLByAppendingPathComponent("bar").path!) let oldImporterAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(importerDirectory.path!) let oldFlagAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(innerDirectory.URLByAppendingPathComponent("flag").path!) let oldFileInImporterAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(importerDirectory.URLByAppendingPathComponent("file").path!) sleep(1) // wait for clock to advance // Update spotlight bundles SUBinaryDeltaUnarchiver.updateSpotlightImportersAtBundlePath(bundleDirectory.path!) let newFooDirectoryAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(innerDirectory.path!) XCTAssertEqual((newFooDirectoryAttributes[NSFileModificationDate] as! NSDate).timeIntervalSinceDate(oldFooDirectoryAttributes[NSFileModificationDate] as! NSDate), 0) let newBarFileAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(bundleDirectory.URLByAppendingPathComponent("bar").path!) XCTAssertEqual((newBarFileAttributes[NSFileModificationDate] as! NSDate).timeIntervalSinceDate(oldBarFileAttributes[NSFileModificationDate] as! NSDate), 0) let newImporterAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(importerDirectory.path!) XCTAssertGreaterThan((newImporterAttributes[NSFileModificationDate] as! NSDate).timeIntervalSinceDate(oldImporterAttributes[NSFileModificationDate] as! NSDate), 0) let newFlagAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(innerDirectory.URLByAppendingPathComponent("flag").path!) XCTAssertEqual((newFlagAttributes[NSFileModificationDate] as! NSDate).timeIntervalSinceDate(oldFlagAttributes[NSFileModificationDate] as! NSDate), 0) let newFileInImporterAttributes = try! NSFileManager.defaultManager().attributesOfItemAtPath(importerDirectory.URLByAppendingPathComponent("file").path!) XCTAssertEqual((newFileInImporterAttributes[NSFileModificationDate] as! NSDate).timeIntervalSinceDate(oldFileInImporterAttributes[NSFileModificationDate] as! NSDate), 0) try! fileManager.removeItemAtURL(tempDirectoryURL) } }
63.688525
184
0.772201
c10be6166c599b50506c57e4f78d2ade88791ebe
4,772
rs
Rust
src/lib.rs
chrislearn/stripe-rs
3a80928395e1deb3c57dfd55082a0e43ee5d22e0
[ "Apache-2.0", "MIT" ]
203
2018-09-26T21:17:53.000Z
2022-03-29T11:30:22.000Z
src/lib.rs
chrislearn/stripe-rs
3a80928395e1deb3c57dfd55082a0e43ee5d22e0
[ "Apache-2.0", "MIT" ]
136
2018-09-26T21:37:06.000Z
2022-02-27T19:48:56.000Z
src/lib.rs
chrislearn/stripe-rs
3a80928395e1deb3c57dfd55082a0e43ee5d22e0
[ "Apache-2.0", "MIT" ]
99
2018-09-27T18:16:25.000Z
2022-03-26T22:46:03.000Z
// Copyright 2019 Wyyerd Group, LLC. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![doc(html_root_url = "https://docs.rs/stripe-rust/")] #![recursion_limit = "128"] //! This crate provides Rust bindings to the Stripe HTTP API. //! //! ## Getting Started //! //! To get started, we need to create a client: //! //! ```rust //! let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET"); //! ``` //! //! Then we can begin making requests as we'd like. Most Stripe requests accept //! many optional parameters, so we usually get the `::new(...)` with any required //! params and then set the ones we want from there. //! //! Most requests for creating or updating a Stripe object use the same Rust struct, //! so you may frequently need to refer to the [official API docs](https://stripe.com/docs/api) //! to determine which fields are required for either request. //! //! ```rust,no_run //! /* Creating a Stripe Charge */ //! //! # let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET"); //! let token = "tok_ID_FROM_CHECKOUT".parse().unwrap(); //! let mut params = stripe::CreateCharge::new(); //! // NOTE: Stripe represents currency in the lowest denominations (e.g. cents) //! params.amount = Some(1095); // e.g. $10.95 //! params.source = Some(stripe::ChargeSourceParams::Token(token)); //! //! // Example: Override currency to be in Canadian Dollars //! params.currency = Some(stripe::Currency::CAD); //! let charge = stripe::Charge::create(&client, params).unwrap(); //! println!("{:?}", charge); // => Charge { id: "ch_12345", amount: 1095, .. } //! ``` //! //! ```rust,no_run //! /* Listing Stripe Charges */ //! //! # let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET"); //! let params = stripe::ListCharges::new(); //! let charges = stripe::Charge::list(&client, params).unwrap(); //! println!("{:?}", charges); // => List { data: [Charge { id: "ch_12345", .. }] } //! ``` //! //! ### A note about async ecosystem dependencies //! //! This crate depends on `tokio=1`. Users of the `stripe-rs` async client will need //! all of their dependencies to be compatible with the >1.0 release of `tokio`. The //! `actix` framework is one notable dependency that hasn't released a stable //! version compatible with tokio 1.0 yet, so you will have to use one of their //! [beta releases](https://docs.rs/actix-web/4.0.0-beta.9/actix_web/) to make //! Stripe calls in an `actix` handler. //! //! Other libraries you depend on may also bring an outdated async runtime. You can //! track these down with `cargo tree` and search crates.io to find suitable updates: //! //! ``` sh //! cargo tree | grep "tokio v0" //! ``` #![allow(clippy::map_clone)] // N.B. not sure if this rule will break compatibility with older rust versions we might want to support #![allow(clippy::needless_pass_by_value)] #![allow(clippy::large_enum_variant)] mod client { pub mod r#async; #[cfg(feature = "blocking")] pub mod blocking; } mod error; mod ids; mod params; mod resources; // N.B. Ideally we would support both a blocking client and // an async client without a feature flag, but the originally // discussed solution requires Generic Associated Types-- // instead we provide an async client only a feature flag. // // See https://github.com/wyyerd/stripe-rs/issues/24#issuecomment-451514187 // See https://github.com/rust-lang/rust/issues/44265 pub use crate::error::{Error, ErrorCode, ErrorType, RequestError, WebhookError}; pub use crate::ids::*; pub use crate::params::{ Expandable, Headers, IdOrCreate, List, Metadata, Object, RangeBounds, RangeQuery, Timestamp, }; pub use crate::resources::*; #[cfg(feature = "blocking")] mod config { pub(crate) use crate::client::blocking::{err, ok}; pub type Client = crate::client::blocking::Client; /// An alias for `Result`. /// /// If `blocking` is enabled, defined as: /// /// ```rust,ignore /// type Response<T> = Result<T, Error>; /// ``` /// /// If the `async` feature is enabled, this type is defined as: /// /// ```rust,ignore /// type Response<T> = Box<dyn Future<Result<T, Error>>>; /// ``` /// pub type Response<T> = crate::client::blocking::Response<T>; } #[cfg(not(feature = "blocking"))] mod config { pub(crate) use crate::client::r#async::{err, ok}; pub type Client = crate::client::r#async::Client; pub type Response<T> = crate::client::r#async::Response<T>; } pub use self::config::Client; pub use self::config::Response;
36.151515
104
0.665339
84edefe29c4aee1d848afb14ee56a569f612c606
7,526
h
C
MineSweeper/Helpers/WLNetworking/Request/WLRequest.h
liuwu/MineSweeper
3e3cecda376d14bbbfc600e9f5d98744b960e3b8
[ "MIT" ]
1
2021-06-19T14:59:18.000Z
2021-06-19T14:59:18.000Z
MineSweeper/Helpers/WLNetworking/Request/WLRequest.h
liuwu/MineSweeper
3e3cecda376d14bbbfc600e9f5d98744b960e3b8
[ "MIT" ]
null
null
null
MineSweeper/Helpers/WLNetworking/Request/WLRequest.h
liuwu/MineSweeper
3e3cecda376d14bbbfc600e9f5d98744b960e3b8
[ "MIT" ]
null
null
null
// // WLRequest.h // Welian_MVP // // Created by weLian on 16/7/2. // Copyright © 2016年 杭州传送门网络科技有限公司. All rights reserved. // #import <Foundation/Foundation.h> #import "WLNetworkingConfiguration.h" #import "WLRequestCriteria.h" /// 接口返回状态类型 typedef NS_ENUM(NSUInteger, WLNetWorkingResultStateType) { /// --------- 普通的接口信息错误 ---------- WLNetWorkingResultStateTypeSuccess = 1, /// 接口调用成功 WLNetWorkingResultStateTypeError = 0, /// 接口调用失败 WLNetWorkingResultStateTypeNormal = 1001, /// 系统普通的错误,不做任何处理的 WLNetWorkingResultStateTypeNoLogin = 1010, /// 用户未登录,session过期 WLNetWorkingResultStateTypeHub = 1101, /// 需要hub提醒的,最常用的错误提醒 WLNetWorkingResultStateTypeAlert = 1102, /// 普通alert提醒的 /// ------- 服务器内部错误 ------------ WLNetWorkingResultStateTypeService = 2000, /// 服务器错误,只打印 /// ------- 程序系统级别的错误 ---------- WLNetWorkingResultStateTypeSystem = 3000, /// 系统级错误 WLNetWorkingResultStateTypeSystemLogout = 3101, /// 退出登录 WLNetWorkingResultStateTypeSystemAlertAndJump = 3102, /// 需要alert提醒,并且点击后需要跳转指定页面的 WLNetWorkingResultStateTypeSystemAlertCancelOrJump = 3103, /// 需要alert提醒,有取消、确定按钮,点击“确定”后需要跳转指定APP内页面的 }; ///网络请求的方式 typedef NS_ENUM (NSUInteger, WLErrorType){ WLErrorTypeSuccess = 0, //API请求成功且返回数据正确,此时的数据是可以直接拿来用的 WLErrorTypeNoContent, //API请求成功但返回的数据不正确。 WLErrorTypeFailed, ///网络请求失败,接口级别错误 WLErrorTypeTimeOut, ///网络请求失败,接口请求超时 WLErrorTypeNoNetWork, //网络不通。在调用API之前会判断一下当前网络是否通畅,这个也是在调用API之前验证的,和上面超时的状态是有区别的。 }; @class WLRequest; typedef void(^WLRequestCompletionBlock)(WLRequest *request); /*------------- API 请求需要实现的 -------------------------------*/ @protocol WLRequestAPIDelegate <NSObject> @required /** * 接口地址,每个接口都有自己的接口地址。 如果地址包含http,则代表完整的地址,如:图片、文件下载url地址 * * @return 接口地址 */ - (NSString *)apiMethodName; @optional /** * @author liuwu , 16-07-06 * * 接口请求的参数内容,默认为nil. * @return 参数内容 */ - (NSDictionary *)requestParams; /** * 请求方式,包括Get、Post、Head、Put、Delete、Patch,具体查看 WLRequestMethodType,默认是:Post请求 * * @return 请求方式 */ - (WLRequestMethodType)requestMethodType; /** * @author liuwu , 16-07-06 * * Request请求的SerializerType,默认以:json格式传参 * @return http 或者 Json请求 */ - (WLRequestSerializerType)requestSerializerType; /** * @author liuwu , 16-07-06 * * 请求结果返回的Response的SerializerType,默认以http方式收取数据 * @return http 或者 Json请求 */ - (WLResponseSerializerType)reponseSerializerType; /** * @author liuwu , 16-08-31 * * 请求的覆盖类型,默认运行接口允许请求 */ - (WLRequestCoverType)requestCoverType; /** * @author liuwu , 16-07-06 * * 文件下载到本地的文件夹名称,当apiMethodName返回的内容包含http时使用。默认目录:@"/LocalFile/" * @return 下载的文件夹名称 */ - (NSString *)fileFolderName; /** * @author liuwu , 16-07-06 * * 是否需要缓存,默认: NO * @return YES OR NO */ - (BOOL)shouldCache; /** * @author liuwu , 16-07-06 * * 当shouldCache为YES的时候有效。 缓存有效时间,如果过期,需要重新请求更新缓存。默认-1:需要更新缓存 * @return 缓存的有效时间 */ - (NSInteger)cacheTimeInSeconds; /** * @author liuwu , 16-07-06 * * 请求的连接超时时间,默认为60秒 * @return 网络请求超时的秒数 */ - (NSTimeInterval)requestTimeoutInterval; /** * 处理responseJSONObject,当外部访问 self.responseJSONObject 的时候就会返回这个方法处理后的数据 * * @param responseObject 输入的 responseObject ,在方法内切勿使用 self.responseJSONObject * * @return 处理后的responseJSONObject */ - (id)responseProcess:(id)responseObject; /** * 是否忽略统一的参数加工,默认为NO * * @return 返回 YES,那么 self.responseJSONObject 将返回原始的数据 */ - (BOOL)ignoreUnifiedResponseProcess; /** * 是否忽略统一的错误加工,默认为NO * * @return 返回 YES,那么将不进行统一的错误处理 */ - (BOOL)ignoreUnifiedErrorProcess; /** * 当数据返回 null 时是否删除这个字段的值,也就是为 nil,默认YES,具体查看http://honglu.me/2015/04/11/json%E4%B8%AD%E5%A4%B4%E7%96%BC%E7%9A%84null/ * 当请求的返回使用的是JsonSerializer,设置才有效 * @return YES/NO */ - (BOOL)removesKeysWithNullValues; /** 是否忽略返回数据AES256解密 @return YES则不解密处理 */ - (BOOL)ignoreDecryptAES256Value; @end ///-------- Request请求代理 ------------------ @protocol WLRequestDelegate <NSObject> @optional /// 请求成功 - (void)requestFinished:(WLRequest *)request; /// 请求失败 - (void)requestFailed:(WLRequest *)request; /// 清除请求 - (void)clearRequest; @end /** * @author liuwu , 16-07-02 * * 一个请求的内容定义 */ @interface WLRequest : NSObject /// -------------- 请求的结果数据信息 -------------------- /// 请求返回的数据 @property (nonatomic, strong) id responseJSONObject; /// 请求返回的数据 @property (nonatomic, strong) NSError *error; /// 是否已经统一处理错误信息,默认为:NO,如果统一处理错误,外面就不要处理了 @property (nonatomic, assign, readonly) BOOL isIgnoreResponseError; /// 网络请求返回的状态码 @property (nonatomic, readonly) NSInteger responseStatusCode; /// 请求结果的Headers @property (nonatomic, strong, readonly) NSDictionary *responseHeaders; /// 当前请求对应的任务 @property (nonatomic, strong) NSURLSessionTask *requestDataTask; /// 错误原因 @property (nonatomic, assign) WLErrorType errorType; /// ------------- 请求的参数内容信息 --------------------------- /// 请求的参数对象 @property (nonatomic, strong) WLRequestCriteria *requestCriteria; /// 请求的Delegate对象 @property (nonatomic, weak) id<WLRequestDelegate> delegate; /// 子类信息 @property (nonatomic, weak, readonly) id<WLRequestAPIDelegate> childApi; /// 网络状态是否可用 @property (nonatomic, assign, readonly) BOOL isReachable; /// 请求成功的回调 @property (nonatomic, copy) WLRequestCompletionBlock successCompletionBlock; /// 请求失败的回调 @property (nonatomic, copy) WLRequestCompletionBlock failureCompletionBlock; @property (nonatomic, copy) WLDownloadProgress progress; /// -------------- 请求相关的配置信息 -------------------------- /// 请求的Serializer类型,默认:AFJSONRequestSerializer @property (nonatomic, strong, readonly) AFHTTPRequestSerializer *requestSerializer; /// 返回结果的Serializer类型,默认:AFHTTPResponseSerializer @property (nonatomic, strong, readonly) AFHTTPResponseSerializer *responseSerializer; /// 请求的接口名字 @property (nonatomic, copy, readonly) NSString *apiMethodName; /// 文件下载目录 @property (nonatomic, copy, readonly) NSString *downfileFolderName; /// 文件下载目录 @property (nonatomic, strong, readonly) UIImage *updateImage; /// 请求的参数内容 @property (nonatomic, strong, readonly) NSDictionary *requestParamInfos; /// 接口请求的超时时间,默认:60秒 @property (nonatomic, assign, readonly) NSTimeInterval timeOutInterval; /// 是否忽略统一的参数加工,默认为NO @property (nonatomic, assign, readonly) BOOL ignoreUnifiedResponse; /// 是否忽略统一的参数加工,默认为NO @property (nonatomic, assign, readonly) BOOL ignoreUnifiedErrorProcess; /// 网络请求的方式 @property (nonatomic, assign, readonly) WLRequestMethodType requestMethodType; /** 是否忽略返回数据AES256解密 @return YES则不解密处理 */ @property (nonatomic, assign, readonly) BOOL ignoreDecryptAES256Value; /// 对象初始化 - (instancetype)initWithRequestCriteria:(WLRequestCriteria *)requestCriteria; - (instancetype)initWithApiMethodName:(NSString *)apiName requestParams:(NSDictionary *)requestParams; /// 添加self到请求队列中 - (void)start; /// 从请求队列中移除self - (void)stop; /// block回调开始请求 - (void)startWithCompletionBlockWithSuccess:(WLRequestCompletionBlock)success failure:(WLRequestCompletionBlock)failure; - (void)startWithCompletionBlockWithSuccess:(WLRequestCompletionBlock)success failure:(WLRequestCompletionBlock)failure progress:(WLDownloadProgress)progress; /// 把block置nil来打破循环引用 - (void)clearCompletionBlock; /// 请求失败的回调 - (void)requestFailedFilter; /// 返回的请求数据的加工数据 - (void)requestResponseJsonObjectFilter; // 请求的覆盖方式 - (WLRequestCoverType)requestCoverTypeInfo; @end
26.97491
119
0.698645
3fad05f02cc2f8efeb8e7912c8b6da761beb0468
105
c
C
src/mul_two_ints.c
ztaye3/cython_catkin_example-master
728e91d7977f929c09929bf05a9c3f9a9b5898d6
[ "MIT" ]
10
2016-06-26T07:47:12.000Z
2022-03-25T01:28:27.000Z
src/mul_two_ints.c
ztaye3/cython_catkin_example-master
728e91d7977f929c09929bf05a9c3f9a9b5898d6
[ "MIT" ]
3
2019-01-26T03:33:37.000Z
2020-06-19T10:44:12.000Z
src/mul_two_ints.c
ztaye3/cython_catkin_example-master
728e91d7977f929c09929bf05a9c3f9a9b5898d6
[ "MIT" ]
2
2018-08-24T01:15:43.000Z
2020-09-16T21:26:02.000Z
#include <stdio.h> int c_mul_two_ints(int a, int b) { printf("This is C version.\n"); return a*b; }
13.125
33
0.638095
0ee0b5af07ec54165443fb1c7b8ca38f12457362
265
ts
TypeScript
core/lib/node/globals.ts
fossabot/DeskGap
5906c469cb1e1a0002ae0089bf75bb51fe5f1115
[ "MIT" ]
null
null
null
core/lib/node/globals.ts
fossabot/DeskGap
5906c469cb1e1a0002ae0089bf75bb51fe5f1115
[ "MIT" ]
null
null
null
core/lib/node/globals.ts
fossabot/DeskGap
5906c469cb1e1a0002ae0089bf75bb51fe5f1115
[ "MIT" ]
null
null
null
import { BrowserWindow } from './browser-window'; import { WebView } from './webview'; export default { browserWindowsById: new Map<number, BrowserWindow>(), webViewsById: new Map<number, WebView>(), focusedBrowserWindow: <BrowserWindow | null>null };
29.444444
57
0.709434
744a8c38ca6732190cb1805aa545933999eb1dc4
15,150
h
C
c/include/libsbp/v4/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h
Patrick-Luo-THR/libsbp
d42e4a1e3cedf6a82b1d993b82e0da148401f80d
[ "MIT" ]
65
2015-03-25T10:28:10.000Z
2022-02-24T12:36:49.000Z
c/include/libsbp/v4/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h
Patrick-Luo-THR/libsbp
d42e4a1e3cedf6a82b1d993b82e0da148401f80d
[ "MIT" ]
654
2015-03-24T17:43:55.000Z
2022-03-31T21:42:49.000Z
c/include/libsbp/v4/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h
Patrick-Luo-THR/libsbp
d42e4a1e3cedf6a82b1d993b82e0da148401f80d
[ "MIT" ]
110
2015-03-24T17:38:35.000Z
2022-03-21T02:05:19.000Z
/* * Copyright (C) 2015-2021 Swift Navigation Inc. * Contact: https://support.swiftnav.com * * This source is subject to the license found in the file 'LICENSE' which must * be be distributed together with this source. All other rights reserved. * * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ /***************************************************************************** * Automatically generated from yaml/swiftnav/sbp/settings.yaml * with generate.py. Please do not hand edit! *****************************************************************************/ #ifndef LIBSBP_V4_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H #define LIBSBP_V4_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H #include <math.h> #include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <string.h> #include <libsbp/common.h> #include <libsbp/settings_macros.h> #include <libsbp/v4/string/sbp_string.h> #ifdef __cplusplus extern "C" { #endif /****************************************************************************** * * SBP_MSG_SETTINGS_READ_BY_INDEX_RESP * *****************************************************************************/ /** Read setting by direct index (host <= device) * * The settings message that reports the value of a setting at an index. * */ typedef struct { /** * An index into the device settings, with values ranging from 0 to * length(settings) */ u16 index; /** * A NULL-terminated and delimited string with contents * "SECTION_SETTING\0SETTING\0VALUE\0FORMAT_TYPE\0" */ sbp_string_t setting; } sbp_msg_settings_read_by_index_resp_t; /** * Initialise sbp_msg_settings_read_by_index_resp_t::setting to empty * * @param msg sbp_msg_settings_read_by_index_resp_t instance */ SBP_EXPORT void sbp_msg_settings_read_by_index_resp_setting_init( sbp_msg_settings_read_by_index_resp_t *msg); /** * Test sbp_msg_settings_read_by_index_resp_t::setting for validity * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return true is sbp_msg_settings_read_by_index_resp_t::setting is valid for * encoding purposes, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_valid( const sbp_msg_settings_read_by_index_resp_t *msg); /** * Tests 2 instances of sbp_msg_settings_read_by_index_resp_t::setting for * equality * * Returns a value with the same definitions as strcmp from the C standard * library * * @param a sbp_msg_settings_read_by_index_resp_t instance * @param b sbp_msg_settings_read_by_index_resp_t instance * @return 0 if equal, <0 if a<b, >0 if a>b */ SBP_EXPORT int sbp_msg_settings_read_by_index_resp_setting_strcmp( const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b); /** * Get the encoded size of sbp_msg_settings_read_by_index_resp_t::setting * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return Size of sbp_msg_settings_read_by_index_resp_t::setting in wire * representation */ SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_encoded_len( const sbp_msg_settings_read_by_index_resp_t *msg); /** * Query sbp_msg_settings_read_by_index_resp_t::setting for remaining space * * Returns the number of bytes (not including NULL terminator) which can be * added to sbp_msg_settings_read_by_index_resp_t::setting before it exceeds the * maximum size of the field in wire representation * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return Maximum number of bytes that can be appended to the existing string */ SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_space_remaining( const sbp_msg_settings_read_by_index_resp_t *msg); /** * Return the number of sections in * sbp_msg_settings_read_by_index_resp_t::setting * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return Number of sections in string */ SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_count_sections( const sbp_msg_settings_read_by_index_resp_t *msg); /** * Add a section to sbp_msg_settings_read_by_index_resp_t::setting * * The specified string will be appended to the field as a new section. If the * new section would end up overflowing the maximum encoded length of this field * the string will not be changed and this function will return false * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param new_str New string * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section( sbp_msg_settings_read_by_index_resp_t *msg, const char *new_str); /** * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf * style formatting * * A new section will be added to the field according to the specified printf * style format string and arguments. If the operation would end up overflowing * the maximum size of this field in wire encoding the existing contents will be * unmodified and this function will return false. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param fmt printf style format string * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_printf( sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2, 3); /** * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf * style formatting * * Identical to #sbp_msg_settings_read_by_index_resp_setting_add_section_printf * except it takes a va_list argument * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param fmt printf style format string * @param ap Argument list * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf( sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); /** * Append a string to the last section in * sbp_msg_settings_read_by_index_resp_t::setting * * If the field is currently empty this function will behave exactly like * #sbp_msg_settings_read_by_index_resp_setting_add_section * * If the field already contains one or more sections the given string will be * appended on to the last section in the string. * * If the operation would end up overflowing the maximum size of this field in * wire encoding the existing contents will be unmodified and this function will * return false. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param str New string * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append( sbp_msg_settings_read_by_index_resp_t *msg, const char *str); /** * Append a string to the last section in * sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting * * If the field is currently empty this function will behave exactly like * #sbp_msg_settings_read_by_index_resp_setting_add_section_printf * * If the field already contains one or more sections the given string will be * appended on to the last section in the string. * * If the operation would end up overflowing the maximum size of this field in * wire encoding the existing contents will be unmodified and this function will * return false. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param fmt printf style format string * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_printf( sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2, 3); /** * Append a string to the last section in * sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting * * If the field is currently empty this function will behave exactly like * #sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf * * If the field already contains one or more sections the given string will be * sppended on to the last section in the string. * * If the operation would end overflowing the maximum size of this field in wire * encoding the existing contents will be unmodified and this function will * return false. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param fmt printf style format string * @param ap Argument list * @return true on success, false otherwise */ SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_vprintf( sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); /** * Obtain a section from sbp_msg_settings_read_by_index_resp_t::setting * * Returns a pointer to the given subsection in the field. Sections are * 0-indexed, the \p section parameters must be less than the value returned * from #sbp_msg_settings_read_by_index_resp_setting_count_sections. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param section Section number * @return Pointer to C string, NULL on error */ SBP_EXPORT const char *sbp_msg_settings_read_by_index_resp_setting_get_section( const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); /** * Obtain the length of a section in * sbp_msg_settings_read_by_index_resp_t::setting * * The returned value does not include the NULL terminator. * * If the given section does not exist 0 is returned. * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @param section Section number * @return Length of section */ SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_section_strlen( const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_read_by_index_resp_t * * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return Length of on-wire representation */ static inline size_t sbp_msg_settings_read_by_index_resp_encoded_len( const sbp_msg_settings_read_by_index_resp_t *msg) { return SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_ENCODED_OVERHEAD + sbp_msg_settings_read_by_index_resp_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_read_by_index_resp_t to wire * representation * * This function encodes the given instance in to the user provided buffer. The * buffer provided to this function must be large enough to store the encoded * message otherwise it will return SBP_ENCODE_ERROR without writing anything to * the buffer. * * Specify the length of the destination buffer in the \p len parameter. If * non-null the number of bytes written to the buffer will be returned in \p * n_written. * * @param buf Destination buffer * @param len Length of \p buf * @param n_written If not null, on success will be set to the number of bytes * written to \p buf * @param msg Instance of sbp_msg_settings_read_by_index_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_encode( uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_resp_t *msg); /** * Decode an instance of sbp_msg_settings_read_by_index_resp_t from wire * representation * * This function decodes the wire representation of a * sbp_msg_settings_read_by_index_resp_t message to the given instance. The * caller must specify the length of the buffer in the \p len parameter. If * non-null the number of bytes read from the buffer will be returned in \p * n_read. * * @param buf Wire representation of the sbp_msg_settings_read_by_index_resp_t * instance * @param len Length of \p buf * @param n_read If not null, on success will be set to the number of bytes read * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_decode( const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_resp_t *msg); /** * Send an instance of sbp_msg_settings_read_by_index_resp_t with the given * write function * * An equivalent of #sbp_message_send which operates specifically on * sbp_msg_settings_read_by_index_resp_t * * The given message will be encoded to wire representation and passed in to the * given write function callback. The write callback will be called several * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id * @param msg Message to send * @param write Write function * @return SBP_OK on success, or other libsbp error code */ SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_send( sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_resp_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_by_index_resp_t * * The two instances will be compared and a value returned consistent with the * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal * A value less than 0 will be returned if \p a is considered to be less than \p * b A value greater than 0 will be returned if \p b is considered to be greater * than \p b * * @param a sbp_msg_settings_read_by_index_resp_t instance * @param b sbp_msg_settings_read_by_index_resp_t instance * @return 0, <0, >0 */ SBP_EXPORT int sbp_msg_settings_read_by_index_resp_cmp( const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b); #ifdef __cplusplus } static inline bool operator==( const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) == 0; } static inline bool operator!=( const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) != 0; } static inline bool operator<(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) < 0; } static inline bool operator<=( const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) <= 0; } static inline bool operator>(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) > 0; } static inline bool operator>=( const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) >= 0; } #endif // ifdef __cplusplus #endif /* LIBSBP_V4_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H */
37.5
80
0.771221
f77ed317e9b700c9b9cd21a15a0ddf343319bc44
222
h
C
ProfessionalC++/MilesEstimator/MilesEstimator.h
zzragida/CppExamples
d627b097efc04209aa4012f7b7f9d82858da3f2d
[ "Apache-2.0" ]
null
null
null
ProfessionalC++/MilesEstimator/MilesEstimator.h
zzragida/CppExamples
d627b097efc04209aa4012f7b7f9d82858da3f2d
[ "Apache-2.0" ]
null
null
null
ProfessionalC++/MilesEstimator/MilesEstimator.h
zzragida/CppExamples
d627b097efc04209aa4012f7b7f9d82858da3f2d
[ "Apache-2.0" ]
null
null
null
#include <iostream> class MilesEstimator { public: virtual int getMilesLeft(); virtual void setGallonsLeft(int inValue); virtual int getGallonsLeft(); private: int mGallonsLeft; virtual int getMilesPerGallon(); };
14.8
42
0.765766
09fc53982532bfcccedd06b5731efb63d599009d
409
kt
Kotlin
11-exceptions/src/com/jjh/android/lib/Genre.kt
johnehunt/kotlin-custom-course
9ea100a20c37a3e102d6ee2a7cc3c6c5b1cffafb
[ "Apache-2.0" ]
1
2021-05-16T10:24:32.000Z
2021-05-16T10:24:32.000Z
11-exceptions/src/com/jjh/android/lib/Genre.kt
johnehunt/kotlin-custom-course
9ea100a20c37a3e102d6ee2a7cc3c6c5b1cffafb
[ "Apache-2.0" ]
null
null
null
11-exceptions/src/com/jjh/android/lib/Genre.kt
johnehunt/kotlin-custom-course
9ea100a20c37a3e102d6ee2a7cc3c6c5b1cffafb
[ "Apache-2.0" ]
null
null
null
package com.jjh.android.lib sealed class Genre object Fiction : Genre() { override fun toString() = "Fiction" } object Technical : Genre() { override fun toString() = "Technical" } object History : Genre() { override fun toString() = "History" } object Detective : Genre() { override fun toString() = "Detective" } object Biography : Genre() { override fun toString() = "Biography" }
17.782609
41
0.662592
534cf1bfc92a5308416c721d422f0e934abaf364
360
kt
Kotlin
app/src/main/java/com/kroraina/easyreader/modules/rank/detail/RankDetailContract.kt
xincubate/EasyReader
10d5dd563dfb1010c7c6a3e8d9c893de7b20c1cb
[ "MIT" ]
6
2018-11-14T16:49:12.000Z
2021-01-06T11:33:22.000Z
app/src/main/java/com/kroraina/easyreader/modules/rank/detail/RankDetailContract.kt
xincubate/EasyReader
10d5dd563dfb1010c7c6a3e8d9c893de7b20c1cb
[ "MIT" ]
null
null
null
app/src/main/java/com/kroraina/easyreader/modules/rank/detail/RankDetailContract.kt
xincubate/EasyReader
10d5dd563dfb1010c7c6a3e8d9c893de7b20c1cb
[ "MIT" ]
null
null
null
package com.kroraina.easyreader.modules.rank.detail import com.kroraina.easyreader.base.mvp.BaseContract interface RankDetailContract { interface View : BaseContract.BaseView { fun finishRefresh(beans: List<RankDetailBean>) } interface Presenter : BaseContract.BasePresenter<View> { fun refreshBookBrief(billId: String) } }
24
60
0.744444
560560dcd759b32c2f509da2d00f057262f3a888
409
lua
Lua
scripts/level/seafarer.lua
sidav/shadow-of-the-wyrm
747afdeebed885b1a4f7ab42f04f9f756afd3e52
[ "MIT" ]
60
2019-08-21T04:08:41.000Z
2022-03-10T13:48:04.000Z
scripts/level/seafarer.lua
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
3
2021-03-18T15:11:14.000Z
2021-10-20T12:13:07.000Z
scripts/level/seafarer.lua
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
8
2019-11-16T06:29:05.000Z
2022-01-23T17:33:43.000Z
require('level') -- Hardy men and women of the sea, they are able to weather storms better -- than most. local function seafarer_stat_gain_fn(creature_id, level) if level % 5 == 0 then incr_hea(creature_id, is_player(creature_id)) end end -- Set up the seafarer functions. local seafarer_class_stat_fn = seafarer_stat_gain_fn level.set_class_stat_gain_level_fn("seafarer", seafarer_class_stat_fn)
25.5625
73
0.782396
cb2f42f878a7958daa1c5c1d3eb043accdccdc02
105
h
C
src/oglTools.h
DinosaurBlanket/GlPersistentMapTest
049bd95a26f8d1b7fcbfe7aeff1276e9ac9e9bed
[ "MIT" ]
null
null
null
src/oglTools.h
DinosaurBlanket/GlPersistentMapTest
049bd95a26f8d1b7fcbfe7aeff1276e9ac9e9bed
[ "MIT" ]
null
null
null
src/oglTools.h
DinosaurBlanket/GlPersistentMapTest
049bd95a26f8d1b7fcbfe7aeff1276e9ac9e9bed
[ "MIT" ]
null
null
null
GLuint createShaderProgram( const char *vertPath, const char *fragPath, const char *progName );
15
27
0.72381
41803308bb1a2eb2795fa1dd6a63783f84773555
221
h
C
base/mvdm/softpc.new/base/ccpu386/bound.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/mvdm/softpc.new/base/ccpu386/bound.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/mvdm/softpc.new/base/ccpu386/bound.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/* bound.h Define all BOUND CPU functions. */ /* static char SccsID[]="@(#)bound.h 1.4 02/09/94"; */ IMPORT VOID BOUND IPT3( IU32, op1, IU32, op2[2], IUM8, op_sz );
11.631579
52
0.475113
357e2075c1ba2bc376295cdd8f8bff7b151585d1
1,391
lua
Lua
modules/Mutex/Mutex.lua
Anaminus/roblox-library
64fb523224fd72fefadd572d252b867254b1872a
[ "Unlicense" ]
31
2020-03-30T05:44:17.000Z
2022-02-07T06:57:16.000Z
modules/Mutex/Mutex.lua
Anaminus/roblox-library
64fb523224fd72fefadd572d252b867254b1872a
[ "Unlicense" ]
2
2020-08-17T11:29:11.000Z
2021-12-13T18:04:13.000Z
modules/Mutex/Mutex.lua
Anaminus/roblox-library
64fb523224fd72fefadd572d252b867254b1872a
[ "Unlicense" ]
6
2020-07-29T21:04:01.000Z
2021-09-09T03:01:40.000Z
--@sec: Mutex --@def: function Mutex(): Mutex --@doc: Mutex is a mutual exclusion lock. local Mutex = {__index={}} --@sec: Mutex.Lock --@def: function Mutex:Lock() --@doc: Lock locks the mutex. If the lock is already in use, then the calling -- thread is blocked until the lock is available. function Mutex.__index:Lock() table.insert(self.threads, coroutine.running()) if #self.threads > 1 then coroutine.yield() end end --@sec: Mutex.Unlock --@def: function Mutex:Unlock() --@doc: Unlock unlocks the mutex. If threads are blocked by the mutex, then the -- next blocked thread will be resumed. function Mutex.__index:Unlock() local thread = table.remove(self.threads, 1) if not thread then error("attempt to unlock non-locked mutex", 2) end if #self.threads == 0 then return end thread = self.threads[1] task.defer(thread) end --@sec: Mutex.Wrap --@def: function Mutex:Wrap(func: (...any)->(...any)): (...any)->(...any) --@doc: Wrap returns a function that, when called, locks the mutex before *func* -- is called, and unlocks it after *func* returns. The new function receives and -- returns the same parameters as *func*. function Mutex.__index:Wrap(func) return function(...) self:Lock() local results = table.pack(func(...)) self:Unlock() return table.unpack(results, 1, results.n) end end return function() return setmetatable({threads = {}}, Mutex) end
27.82
80
0.700935
4d4ba4467fd38bde6c822c8665523d4cccde4749
129
sql
SQL
db/seeds.sql
m-fiks/burger
34f6583d07b945f2ce47f32a77a616053c6abf32
[ "MIT" ]
null
null
null
db/seeds.sql
m-fiks/burger
34f6583d07b945f2ce47f32a77a616053c6abf32
[ "MIT" ]
null
null
null
db/seeds.sql
m-fiks/burger
34f6583d07b945f2ce47f32a77a616053c6abf32
[ "MIT" ]
null
null
null
INSERT INTO burgers (burger_name, devoured) VALUES ("Basic", true), ("Cheesy", true), ("Hamsterdam", false), ("Baconator", false)
25.8
43
0.697674
01aa2a8d6b22dd42a8752159f27724ba399a2d34
39,059
sql
SQL
storage/database/geonames/countries/kp.sql
longtime55/5on6.pl
6d107f48862bd565b41bbc50c6b60b21e4121b5d
[ "MIT" ]
null
null
null
storage/database/geonames/countries/kp.sql
longtime55/5on6.pl
6d107f48862bd565b41bbc50c6b60b21e4121b5d
[ "MIT" ]
null
null
null
storage/database/geonames/countries/kp.sql
longtime55/5on6.pl
6d107f48862bd565b41bbc50c6b60b21e4121b5d
[ "MIT" ]
null
null
null
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64) -- -- Host: localhost Database: laraclassified -- ------------------------------------------------------ -- Server version 5.6.35 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Dumping data for table `<<prefix>>subadmin1` -- /*!40000 ALTER TABLE `<<prefix>>subadmin1` DISABLE KEYS */; INSERT INTO `<<prefix>>subadmin1` VALUES (1613,'KP.12','KP','Pyongyang','Pyongyang',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1614,'KP.15','KP','South Pyongan','South Pyongan',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1615,'KP.11','KP','P\'yŏngan-bukto','P\'yongan-bukto',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1616,'KP.09','KP','Kangwŏn-do','Kangwon-do',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1617,'KP.06','KP','Hwanghae-namdo','Hwanghae-namdo',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1618,'KP.07','KP','Hwanghae-bukto','Hwanghae-bukto',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1619,'KP.03','KP','Hamgyŏng-namdo','Hamgyong-namdo',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1620,'KP.13','KP','Yanggang-do','Yanggang-do',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1621,'KP.17','KP','Hamgyŏng-bukto','Hamgyong-bukto',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1622,'KP.01','KP','Chagang-do','Chagang-do',1); INSERT INTO `<<prefix>>subadmin1` VALUES (1623,'KP.18','KP','Rason','Rason',1); /*!40000 ALTER TABLE `<<prefix>>subadmin1` ENABLE KEYS */; -- -- Dumping data for table `<<prefix>>subadmin2` -- /*!40000 ALTER TABLE `<<prefix>>subadmin2` DISABLE KEYS */; INSERT INTO `<<prefix>>subadmin2` VALUES (19589,'KP.11.1865779','KP','KP.11','Yongch’ŏn-gun','Yongch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19590,'KP.15.1865781','KP','KP.15','Tŏkch’ŏn-si','Tokch\'on-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19591,'KP.15.1865786','KP','KP.15','Kangsŏ-guyŏk','Kangso-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19592,'KP.07.1865966','KP','KP.07','Yŏnt’an-gun','Yont\'an-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19593,'KP.07.1865975','KP','KP.07','Yŏnsan-gun','Yonsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19594,'KP.15.1866047','KP','KP.15','Nyŏngwŏn-gun','Nyongwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19595,'KP.12.1866090','KP','KP.12','Ryongsŏng-guyŏk','Ryongsong-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19596,'KP.15.1866367','KP','KP.15','Yonggang-gun','Yonggang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19597,'KP.11.1866454','KP','KP.11','Nyŏngbyŏn-gun','Nyongbyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19598,'KP.06.1866571','KP','KP.06','Yŏnan-gun','Yonan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19599,'KP.11.1866590','KP','KP.11','Yŏmju-gun','Yomju-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19600,'KP.12.1866614','KP','KP.12','Ryŏkp’o-guyŏk','Ryokp\'o-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19601,'KP.03.1866638','KP','KP.03','Yodŏk-kun','Yodok-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19602,'KP.15.1866790','KP','KP.15','Yangdŏk-kun','Yangdok-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19603,'KP.09.1866905','KP','KP.09','Wŏnsan-si','Wonsan-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19604,'KP.07.1867256','KP','KP.07','Ŭnp’a-gun','Unp\'a-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19605,'KP.11.1867275','KP','KP.11','Unjŏn-gun','Unjon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19606,'KP.06.1867379','KP','KP.06','Ŭnch’ŏn-gun','Unch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19607,'KP.06.1867428','KP','KP.06','Ŭllyul-gun','Ullyul-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19608,'KP.07.1867627','KP','KP.07','T’osan-gun','T\'osan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19609,'KP.11.1867778','KP','KP.11','Tongnim-gun','Tongnim-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19610,'KP.12.1867918','KP','KP.12','Tongdaewŏn-guyŏk','Tongdaewon-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19611,'KP.09.1867930','KP','KP.09','T’ongch’ŏn-gun','T\'ongch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19612,'KP.06.1868579','KP','KP.06','T’aet’an-gun','T\'aet\'an-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19613,'KP.12.1868593','KP','KP.12','Taesŏng-guyŏk','Taesong-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19614,'KP.15.1868812','KP','KP.15','Taedong-gun','Taedong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19615,'KP.12.1868813','KP','KP.12','Taedonggang','Taedonggang',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19616,'KP.11.1868849','KP','KP.11','T’aech’ŏn-gun','T\'aech\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19617,'KP.12.1868997','KP','KP.12','Sŭngho-guyŏk','Sungho-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19618,'KP.15.1869013','KP','KP.15','Sunch’ŏn-si','Sunch\'on-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19619,'KP.12.1869019','KP','KP.12','Sunan','Sunan',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19620,'KP.15.1869039','KP','KP.15','Sukch’ŏn-gun','Sukch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19621,'KP.07.1869140','KP','KP.07','Suan-gun','Suan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19622,'KP.12.1869227','KP','KP.12','Sŏsŏng-guyŏk','Sosong-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19623,'KP.12.1869345','KP','KP.12','Sŏn’gyo-guyŏk','Son\'gyo-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19624,'KP.07.1869433','KP','KP.07','Songnim-si','Songnim-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19625,'KP.06.1869582','KP','KP.06','Songhwa-gun','Songhwa-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19626,'KP.15.1869676','KP','KP.15','Sŏngch’ŏn-gun','Songch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19627,'KP.11.1869746','KP','KP.11','Sŏnch’ŏn-gun','Sonch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19628,'KP.07.1870041','KP','KP.07','Sŏhŭng-gun','Sohung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19629,'KP.15.1870271','KP','KP.15','Sinyang-gun','Sinyang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19630,'KP.06.1870278','KP','KP.06','Sinwŏn-gun','Sinwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19631,'KP.07.1870370','KP','KP.07','Sinp’yŏng-gun','Sinp\'yong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19632,'KP.07.1870544','KP','KP.07','Sin’gye-gun','Sin\'gye-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19633,'KP.06.1870659','KP','KP.06','Sinch’ŏn-gun','Sinch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19634,'KP.09.1870827','KP','KP.09','Sep’o-gun','Sep\'o-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19635,'KP.07.1870881','KP','KP.07','Sariwŏn-si','Sariwon-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19636,'KP.12.1870984','KP','KP.12','Sangwŏn-gun','Sangwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19637,'KP.12.1871416','KP','KP.12','Samsŏk-kuyŏk','Samsok-kuyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19638,'KP.06.1871541','KP','KP.06','Samch’ŏn-gun','Samch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19639,'KP.12.1871810','KP','KP.12','Sadong-guyŏk','Sadong-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19640,'KP.15.1871865','KP','KP.15','P’yŏngwŏn-gun','P\'yongwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19641,'KP.15.1871869','KP','KP.15','P’yŏngsŏng-si','P\'yongsong-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19642,'KP.07.1871875','KP','KP.07','P’yŏngsan-gun','P\'yongsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19643,'KP.09.1871928','KP','KP.09','P’yŏnggang-gun','P\'yonggang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19644,'KP.12.1871937','KP','KP.12','P’yŏngch’ŏn-guyŏk','P\'yongch\'on-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19645,'KP.06.1871938','KP','KP.06','Pongch’ŏn-gun','Pongch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19646,'KP.06.1871968','KP','KP.06','Pyŏksŏng-gun','Pyoksong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19647,'KP.15.1872201','KP','KP.15','Pukch’ang-gun','Pukch\'ang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19648,'KP.12.1872260','KP','KP.12','Pot’onggang-guyŏk','Pot\'onggang-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19649,'KP.09.1872294','KP','KP.09','Pŏptong-gun','Poptong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19650,'KP.07.1872337','KP','KP.07','Pongsan-gun','Pongsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19651,'KP.11.1872626','KP','KP.11','P’ihyŏn-gun','P\'ihyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19652,'KP.07.1872688','KP','KP.07','P’anmun-gun','P\'anmun-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19653,'KP.09.1872704','KP','KP.09','P’an’gyo-gun','P\'an\'gyo-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19654,'KP.11.1872819','KP','KP.11','Pakch’ŏn-gun','Pakch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19655,'KP.06.1873016','KP','KP.06','Paech’ŏn-gun','Paech\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19656,'KP.06.1873174','KP','KP.06','Ongjin-gun','Ongjin-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19657,'KP.15.1873193','KP','KP.15','Onch’ŏn-gun','Onch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19658,'KP.12.1873641','KP','KP.12','Rangnang','Rangnang',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19659,'KP.03.1873885','KP','KP.03','Nagwŏn-gun','Nagwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19660,'KP.15.1874222','KP','KP.15','Mundŏk-kun','Mundok-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19661,'KP.09.1874228','KP','KP.09','Munch’ŏn-si','Munch\'on-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19662,'KP.12.1874339','KP','KP.12','Moranbong','Moranbong',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19663,'KP.12.1874534','KP','KP.12','Man’gyŏngdae','Man\'gyongdae',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19664,'KP.15.1874668','KP','KP.15','Maengsan-gun','Maengsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19665,'KP.11.1875055','KP','KP.11','Kwaksan-gun','Kwaksan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19666,'KP.06.1875061','KP','KP.06','Kwail-gun','Kwail-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19667,'KP.11.1875101','KP','KP.11','Kusŏng-si','Kusong-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19668,'KP.03.1875280','KP','KP.03','Kŭmya-gun','Kumya-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19669,'KP.09.1875385','KP','KP.09','Kŭmgang-gun','Kumgang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19670,'KP.07.1875414','KP','KP.07','Kŭmch’ŏn-gun','Kumch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19671,'KP.11.1875509','KP','KP.11','Kujang-gun','Kujang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19672,'KP.03.1875589','KP','KP.03','Kowŏn-gun','Kowon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19673,'KP.09.1875619','KP','KP.09','Kosŏng-gun','Kosong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19674,'KP.09.1875637','KP','KP.09','Kosan-gun','Kosan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19675,'KP.07.1875793','KP','KP.07','Koksan-gun','Koksan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19676,'KP.09.1875980','KP','KP.09','Kimhwa-gun','Kimhwa-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19677,'KP.06.1876125','KP','KP.06','Kangnyŏng-gun','Kangnyong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19678,'KP.12.1876132','KP','KP.12','Kangnam-gun','Kangnam-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19679,'KP.12.1876156','KP','KP.12','Kangdong-gun','Kangdong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19680,'KP.06.1876370','KP','KP.06','Kaesŏng-si','Kaesong-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19681,'KP.06.1876380','KP','KP.06','Kaep’ung-gun','Kaep\'ung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19682,'KP.15.1876403','KP','KP.15','Kaech’ŏn-si','Kaech\'on-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19683,'KP.07.1876510','KP','KP.07','Insan-gun','Insan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19684,'KP.09.1876674','KP','KP.09','Ich’ŏn-gun','Ich\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19685,'KP.12.1876737','KP','KP.12','Hyŏngjesan-guyŏk','Hyongjesan-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19686,'KP.11.1876770','KP','KP.11','Hyangsan-gun','Hyangsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19687,'KP.07.1876874','KP','KP.07','Hwangju-gun','Hwangju-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19688,'KP.09.1877150','KP','KP.09','Hoeyang-gun','Hoeyang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19689,'KP.15.1877192','KP','KP.15','Hoech’ang-gun','Hoech\'ang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19690,'KP.03.1877442','KP','KP.03','Hamju-gun','Hamju-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19691,'KP.03.1877447','KP','KP.03','Hamhŭng-si','Hamhung-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19692,'KP.06.1877609','KP','KP.06','Haeju-si','Haeju-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19693,'KP.15.1877796','KP','KP.15','Chŭngsan-gun','Chungsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19694,'KP.12.1877859','KP','KP.12','Chung','Chung',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19695,'KP.12.1877875','KP','KP.12','Chunghwa-gun','Chunghwa-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19696,'KP.09.1878166','KP','KP.09','Ch’ŏrwŏn-gun','Ch\'orwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19697,'KP.09.1878230','KP','KP.09','Ch’ŏnnae-gun','Ch\'onnae-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19698,'KP.03.1878321','KP','KP.03','Chongpyong County','Chongpyong County',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19699,'KP.15.1878380','KP','KP.15','Ch’ŏngnam-gu','Ch\'ongnam-gu',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19700,'KP.11.1878391','KP','KP.11','Chŏngju-gun','Chongju-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19701,'KP.06.1878459','KP','KP.06','Ch’ŏngdan-gun','Ch\'ongdan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19702,'KP.11.1878581','KP','KP.11','Ch’ŏlsan-gun','Ch\'olsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19703,'KP.06.1879031','KP','KP.06','Changyŏn-gun','Changyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19704,'KP.06.1879105','KP','KP.06','Changp’ung-gun','Changp\'ung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19705,'KP.09.1879312','KP','KP.09','Ch’angdo-gun','Ch\'angdo-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19706,'KP.06.1879491','KP','KP.06','Chaeryŏng-gun','Chaeryong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19707,'KP.15.1879614','KP','KP.15','Anju-si','Anju-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19708,'KP.09.1879673','KP','KP.09','Anbyŏn-gun','Anbyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19709,'KP.06.1879681','KP','KP.06','Anak-kun','Anak-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19710,'KP.15.1883585','KP','KP.15','Hanggu-guyŏk','Hanggu-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19711,'KP.15.1883586','KP','KP.15','Waudo-guyŏk','Waudo-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19712,'KP.17.2038910','KP','KP.17','Yŏnsa-gun','Yonsa-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19713,'KP.01.2039045','KP','KP.01','Yongnim-gun','Yongnim-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19714,'KP.03.2039115','KP','KP.03','Yŏnggwang-gun','Yonggwang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19715,'KP.01.2039456','KP','KP.01','Wiwŏn-gun','Wiwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19716,'KP.01.2039499','KP','KP.01','Usi-gun','Usi-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19717,'KP.11.2039522','KP','KP.11','Unsan-gun','Unsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19718,'KP.13.2039548','KP','KP.13','Unhŭng-gun','Unhung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19719,'KP.17.2039588','KP','KP.17','Ŭndŏk-kun','Undok-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19720,'KP.11.2039624','KP','KP.11','Uiju County','Uiju County',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19721,'KP.01.2039727','KP','KP.01','Tongsin-gun','Tongsin-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19722,'KP.11.2039860','KP','KP.11','Tongch’ang-gun','Tongch\'ang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19723,'KP.03.2039905','KP','KP.03','Tŏksŏng-gun','Toksong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19724,'KP.03.2040063','KP','KP.03','Tanch’ŏn-gun','Tanch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19725,'KP.15.2040178','KP','KP.15','Taehŭng-gun','Taehung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19726,'KP.13.2040183','KP','KP.13','Taehongdan-gun','Taehongdan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19727,'KP.11.2040192','KP','KP.11','Taegwan-gun','Taegwan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19728,'KP.01.2040482','KP','KP.01','Songwŏn-gun','Songwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19729,'KP.01.2040630','KP','KP.01','Sŏnggan-gun','Songgan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19730,'KP.18.2040675','KP','KP.18','Sŏnbong-gun','Sonbong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19731,'KP.11.2040892','KP','KP.11','Sinŭiju-si','Sinuiju-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19732,'KP.03.2040953','KP','KP.03','Sinp’o-si','Sinp\'o-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19733,'KP.03.2041012','KP','KP.03','Sinhŭng-gun','Sinhung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19734,'KP.01.2041138','KP','KP.01','Sijung-gun','Sijung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19735,'KP.13.2041411','KP','KP.13','Samsu-gun','Samsu-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19736,'KP.13.2041443','KP','KP.13','Samjiyŏn-gun','Samjiyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19737,'KP.11.2041535','KP','KP.11','Sakchu-gun','Sakchu-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19738,'KP.17.2041593','KP','KP.17','Saebyŏl-gun','Saebyol-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19739,'KP.11.2041678','KP','KP.11','Pyŏktong-gun','Pyoktong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19740,'KP.17.2041700','KP','KP.17','Puryŏng-gun','Puryong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19741,'KP.13.2041726','KP','KP.13','P’ungsŏ-gun','P\'ungso-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19742,'KP.13.2041732','KP','KP.13','Kimhyŏnggwŏn-gun','Kimhyonggwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19743,'KP.03.2041812','KP','KP.03','Pukch’ŏng-gun','Pukch\'ong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19744,'KP.03.2041826','KP','KP.03','Pujŏn-gun','Pujon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19745,'KP.13.2041997','KP','KP.13','Poch’ŏn-gun','Poch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19746,'KP.13.2042211','KP','KP.13','Paegam-gun','Paegam-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19747,'KP.17.2042256','KP','KP.17','Ŏrang-gun','Orang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19748,'KP.17.2042268','KP','KP.17','Onsŏng-gun','Onsong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19749,'KP.01.2042491','KP','KP.01','Nangnim-gun','Nangnim-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19750,'KP.18.2042641','KP','KP.18','Rajin','Rajin',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19751,'KP.17.2042710','KP','KP.17','Hwasŏng-gun','Hwasong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19752,'KP.17.2042719','KP','KP.17','Myŏngch’ŏn-gun','Myongch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19753,'KP.17.2042740','KP','KP.17','Musan-gun','Musan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19754,'KP.01.2042891','KP','KP.01','Manp’o-si','Manp\'o-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19755,'KP.17.2042989','KP','KP.17','Kyŏngsŏng-gun','Kyongsong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19756,'KP.01.2043336','KP','KP.01','Kop’ung-gun','Kop\'ung-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19757,'KP.13.2043475','KP','KP.13','Kimjŏngsuk-kun','Kimjongsuk-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19758,'KP.17.2043476','KP','KP.17','Kimch’aek-si','Kimch\'aek-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19759,'KP.17.2043486','KP','KP.17','Kilchu-gun','Kilchu-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19760,'KP.13.2043532','KP','KP.13','Kapsan-gun','Kapsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19761,'KP.01.2043568','KP','KP.01','Kanggye-si','Kanggye-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19762,'KP.03.2043679','KP','KP.03','Iwŏn-gun','Iwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19763,'KP.13.2043834','KP','KP.13','Hyesan-si','Hyesan-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19764,'KP.01.2043879','KP','KP.01','Hwap’yŏng-gun','Hwap\'yong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19765,'KP.17.2043963','KP','KP.17','Hwadae-gun','Hwadae-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19766,'KP.01.2044013','KP','KP.01','Hŭich’ŏn-si','Huich\'on-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19767,'KP.13.2044027','KP','KP.13','Kimhyŏngjik-kun','Kimhyongjik-kun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19768,'KP.03.2044051','KP','KP.03','Hongwŏn-gun','Hongwon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19769,'KP.17.2044094','KP','KP.17','Hoeryŏng-si','Hoeryong-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19770,'KP.03.2044126','KP','KP.03','Hŏch’ŏn-gun','Hoch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19771,'KP.01.2044491','KP','KP.01','Chunggang-gun','Chunggang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19772,'KP.01.2044602','KP','KP.01','Ch’osan-gun','Ch\'osan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19773,'KP.11.2044670','KP','KP.11','Ch’ŏnma-gun','Ch\'onma-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19774,'KP.17.2044754','KP','KP.17','Ch’ŏngjin-si','Ch\'ongjin-si',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19775,'KP.01.2044803','KP','KP.01','Chŏnch’ŏn-gun','Chonch\'on-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19776,'KP.01.2045006','KP','KP.01','Chasŏng-gun','Chasong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19777,'KP.11.2045038','KP','KP.11','Ch’angsŏng-gun','Ch\'angsong-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19778,'KP.03.2045125','KP','KP.03','Changjin-gun','Changjin-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19779,'KP.01.2045178','KP','KP.01','Changgang-gun','Changgang-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19780,'KP.15.6258672','KP','KP.15','Ŭnsan-gun','Unsan-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19781,'KP.15.6258673','KP','KP.15','Ch’ŏllima-guyŏk','Ch\'ollima-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19782,'KP.15.6258674','KP','KP.15','Taean-guyŏk','Taean-guyok',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19783,'KP.03.6258675','KP','KP.03','Sudong-gu','Sudong-gu',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19784,'KP.11.6279118','KP','KP.11','Sindo-gun','Sindo-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19785,'KP.06.8594115','KP','KP.06','Yongyŏn-gun','Yongyon-gun',1); INSERT INTO `<<prefix>>subadmin2` VALUES (19786,'KP.12.11791938','KP','KP.12','Ŭnjŏng-guyŏk','Unjong-guyok',1); /*!40000 ALTER TABLE `<<prefix>>subadmin2` ENABLE KEYS */; -- -- Dumping data for table `<<prefix>>cities` -- /*!40000 ALTER TABLE `<<prefix>>cities` DISABLE KEYS */; INSERT INTO `<<prefix>>cities` VALUES (1866362,'KP','Yonggang-ŭp','Yonggang-up',38.8561,125.424,'P','PPL','KP.15',NULL,13440,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1866453,'KP','Yŏngbyŏn','Yongbyon',39.8133,125.804,'P','PPL','KP.11',NULL,9584,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1866569,'KP','Yŏnan-ŭp','Yonan-up',37.9089,126.161,'P','PPL','KP.06','KP.06.YŎNAN-GUN',22665,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1866587,'KP','Yŏmju-ŭp','Yomju-up',39.8933,124.598,'P','PPL','KP.11',NULL,9437,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1866923,'KP','Wŏnsan','Wonsan',39.1528,127.444,'P','PPLA','KP.09',NULL,329207,'Asia/Pyongyang',1,'2014-04-19 23:00:00','2014-04-19 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1867927,'KP','T’ongch’ŏn-ŭp','T\'ongch\'on-up',38.9539,127.892,'P','PPL','KP.09','KP.09.T’ONGCH’ŰN-GUN',20575,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1868998,'KP','Sŭngho 1-tong','Sungho 1-tong',38.9914,125.978,'P','PPL','KP.12',NULL,39841,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1869012,'KP','Sunch’ŏn','Sunch\'on',39.4317,125.933,'P','PPLA3','KP.15','KP.15.1869013',437000,'Asia/Pyongyang',1,'2017-09-25 23:00:00','2017-09-25 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1869021,'KP','Sunan','Sunan',39.1983,125.69,'P','PPL','KP.12',NULL,36671,'Asia/Pyongyang',1,'2018-01-09 23:00:00','2018-01-09 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1869446,'KP','Songnim','Songnim',38.7542,125.645,'P','PPL','KP.07',NULL,152425,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1870413,'KP','Sil-li','Sil-li',39.4947,125.474,'P','PPL','KP.15','KP.15.MUNDŎK-KUN',19463,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1870434,'KP','Sinmak','Sinmak',38.4167,126.233,'P','PPL','KP.07',NULL,18669,'Asia/Pyongyang',1,'2016-12-02 23:00:00','2016-12-02 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1870742,'KP','Sinanju','Sinanju',39.5981,125.61,'P','PPL','KP.15',NULL,15693,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1870883,'KP','Sariwŏn','Sariwon',38.5072,125.756,'P','PPLA','KP.07',NULL,310100,'Asia/Pyongyang',1,'2013-07-05 23:00:00','2013-07-05 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1871028,'KP','Sangsŏng-ni','Sangsong-ni',39.1694,126.886,'P','PPL','KP.15','KP.15.1866790',9888,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1871484,'KP','Samho-rodongjagu','Samho-rodongjagu',39.9475,127.871,'P','PPL','KP.03',NULL,19025,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1871859,'KP','Pyongyang','Pyongyang',39.0339,125.754,'P','PPLC','KP.12',NULL,3222000,'Asia/Pyongyang',1,'2016-04-08 23:00:00','2016-04-08 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1871871,'KP','P’yŏngsŏng','P\'yongsong',39.2464,125.872,'P','PPLA','KP.15',NULL,100000,'Asia/Pyongyang',1,'2013-08-03 23:00:00','2013-08-03 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1871967,'KP','Pyŏksŏng-ŭp','Pyoksong-up',38.0475,125.557,'P','PPL','KP.06',NULL,12937,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1872726,'KP','Panghyŏn-dong','Panghyon-dong',39.8872,125.241,'P','PPL','KP.11',NULL,11026,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1873172,'KP','Ongjin','Ongjin',37.9347,125.362,'P','PPL','KP.06',NULL,64247,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1873757,'KP','Namp’o','Namp\'o',38.7375,125.408,'P','PPLA2','KP.15',NULL,455000,'Asia/Pyongyang',1,'2010-08-02 23:00:00','2010-08-02 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875054,'KP','Kwaksan','Kwaksan',39.6875,125.083,'P','PPL','KP.11',NULL,10478,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875107,'KP','Kusŏng','Kusong',39.9811,125.245,'P','PPL','KP.11',NULL,30902,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875506,'KP','Kujang-ŭp','Kujang-up',39.8672,126.03,'P','PPL','KP.11',NULL,19522,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875588,'KP','Kowŏn-ŭp','Kowon-up',39.4381,127.243,'P','PPL','KP.03',NULL,21490,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875632,'KP','Kosan','Kosan',38.8558,127.418,'P','PPL','KP.09',NULL,24822,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1875790,'KP','Koksan','Koksan',38.7819,126.666,'P','PPL','KP.07',NULL,12923,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1876153,'KP','Kangdong-ŭp','Kangdong-up',39.1425,126.096,'P','PPL','KP.12',NULL,28922,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1876373,'KP','Kaesŏng','Kaesong',37.9708,126.554,'P','PPLA2','KP.06',NULL,338155,'Asia/Pyongyang',1,'2012-07-03 23:00:00','2012-07-03 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1876873,'KP','Hwangju-ŭp','Hwangju-up',38.6703,125.776,'P','PPL','KP.07',NULL,35641,'Asia/Pyongyang',1,'2017-01-04 23:00:00','2017-01-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877030,'KP','Hŭngnam','Hungnam',39.8317,127.619,'P','PPL','KP.03',NULL,346082,'Asia/Pyongyang',1,'2017-01-04 23:00:00','2017-01-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877046,'KP','Hŭkkyo-ri','Hukkyo-ri',38.7986,125.792,'P','PPL','KP.07',NULL,25437,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877148,'KP','Hoeyang','Hoeyang',38.7103,127.598,'P','PPL','KP.09',NULL,21111,'Asia/Pyongyang',1,'2012-02-27 23:00:00','2012-02-27 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877449,'KP','Hamhŭng','Hamhung',39.9183,127.536,'P','PPLA','KP.03',NULL,559056,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877615,'KP','Haeju','Haeju',38.0406,125.715,'P','PPLA','KP.06',NULL,222396,'Asia/Pyongyang',1,'2017-02-03 23:00:00','2017-02-03 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1877872,'KP','Chunghwa','Chunghwa',38.8639,125.8,'P','PPL','KP.12',NULL,19346,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1878389,'KP','Chŏngju','Chongju',39.6933,125.21,'P','PPL','KP.11',NULL,29065,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879029,'KP','Changyŏn','Changyon',38.2508,125.096,'P','PPL','KP.06',NULL,39368,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879487,'KP','Chaeryŏng-ŭp','Chaeryong-up',38.3992,125.616,'P','PPLA2','KP.06',NULL,53330,'Asia/Pyongyang',1,'2013-05-08 23:00:00','2013-05-08 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879544,'KP','Ayang-ni','Ayang-ni',38.2431,125.78,'P','PPL','KP.06',NULL,16104,'Asia/Pyongyang',1,'2017-02-03 23:00:00','2017-02-03 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879613,'KP','Anju','Anju',39.6178,125.665,'P','PPL','KP.15',NULL,50196,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879672,'KP','Anbyŏn-ŭp','Anbyon-up',39.0425,127.524,'P','PPL','KP.09',NULL,31845,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1879682,'KP','Anak','Anak',38.5108,125.494,'P','PPL','KP.07',NULL,19995,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (1932058,'KP','Sinsang-ni','Sinsang-ni',39.6503,127.406,'P','PPL','KP.03',NULL,14960,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2038854,'KP','Yuktae-dong','Yuktae-dong',40.0247,128.16,'P','PPL','KP.03',NULL,76427,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2039557,'KP','Ungsang-nodongjagu','Ungsang-nodongjagu',42.3578,130.462,'P','PPLL','KP.18','KP.18.SŎNBONG-GUN',8410,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2039623,'KP','Ŭiju','Uiju',40.1994,124.532,'P','PPL','KP.11','KP.11.2039624',50081,'Asia/Pyongyang',1,'2016-06-18 23:00:00','2016-06-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2040316,'KP','Sŭngam-nodongjagu','Sungam-nodongjagu',41.6697,129.669,'P','PPL','KP.17',NULL,11406,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2040674,'KP','Sŏnbong','Sonbong',42.3416,130.394,'P','PPL','KP.18',NULL,27331,'Asia/Pyongyang',1,'2017-07-04 23:00:00','2017-07-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2040893,'KP','Sinŭiju','Sinuiju',40.1006,124.398,'P','PPLA','KP.11','KP.11.2039624',288112,'Asia/Pyongyang',1,'2016-06-18 23:00:00','2016-06-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2041533,'KP','Sakchu-ŭp','Sakchu-up',40.3894,125.047,'P','PPL','KP.11',NULL,18001,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2041702,'KP','Puryŏng','Puryong',42.0606,129.712,'P','PPL','KP.17',NULL,12267,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2041817,'KP','Pukchil-lodongjagu','Pukchil-lodongjagu',40.2019,125.748,'P','PPL','KP.11',NULL,14129,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042249,'KP','Yŏnggwang-ŭp','Yonggwang-up',40.0183,127.455,'P','PPL','KP.03',NULL,21882,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042267,'KP','Onsŏng','Onsong',42.9572,129.993,'P','PPL','KP.17',NULL,19806,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042498,'KP','Nanam','Nanam',41.7136,129.684,'P','PPL','KP.17',NULL,34055,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042503,'KP','Namyang-dong','Namyang-dong',42.95,129.867,'P','PPL','KP.17',NULL,22218,'Asia/Pyongyang',1,'2006-01-16 23:00:00','2006-01-16 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042645,'KP','Rajin','Rajin',42.2489,130.3,'P','PPLA','KP.18',NULL,66224,'Asia/Pyongyang',1,'2017-01-04 23:00:00','2017-01-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042738,'KP','Musan-ŭp','Musan-up',42.2261,129.208,'P','PPL','KP.17',NULL,21739,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042893,'KP','Manp’o','Manp\'o',41.1547,126.289,'P','PPL','KP.01',NULL,116760,'Asia/Pyongyang',1,'2017-09-12 23:00:00','2017-09-12 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042985,'KP','Kyŏngwŏn','Kyongwon',42.8136,130.153,'P','PPL','KP.17',NULL,12650,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2042987,'KP','Kyŏngsŏng','Kyongsong',41.5878,129.606,'P','PPL','KP.17',NULL,35604,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043484,'KP','Kilju','Kilju',40.9642,129.328,'P','PPL','KP.17',NULL,63652,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043531,'KP','Kapsan-ŭp','Kapsan-up',41.0903,128.293,'P','PPL','KP.13',NULL,20406,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043572,'KP','Kanggye','Kanggye',40.9695,126.585,'P','PPLA','KP.01',NULL,209530,'Asia/Pyongyang',1,'2017-01-04 23:00:00','2017-01-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043677,'KP','Iwŏn-ŭp','Iwon-up',40.3231,128.655,'P','PPL','KP.03',NULL,26364,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043835,'KP','Hyesan-dong','Hyesan-dong',41.3976,128.179,'P','PPL','KP.13',NULL,97794,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2043837,'KP','Hyesan','Hyesan',41.4017,128.178,'P','PPLA','KP.13',NULL,192680,'Asia/Pyongyang',1,'2017-01-04 23:00:00','2017-01-04 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2044050,'KP','Hongwŏn','Hongwon',40.0253,127.956,'P','PPL','KP.03',NULL,70923,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2044091,'KP','Hoeryŏng','Hoeryong',42.4428,129.751,'P','PPLL','KP.17',NULL,43831,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2044104,'KP','Hoemul-li','Hoemul-li',41.4339,129.67,'P','PPLL','KP.17',NULL,11681,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2044149,'KP','Hau-ri','Hau-ri',41.2006,129.47,'P','PPLL','KP.17',NULL,13581,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2044757,'KP','Chongjin','Chongjin',41.7956,129.776,'P','PPLA','KP.17',NULL,327000,'Asia/Pyongyang',1,'2013-05-21 23:00:00','2013-05-21 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2045005,'KP','Chasŏng','Chasong',41.4608,126.641,'P','PPL','KP.01',NULL,12736,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2045311,'KP','Aoji-ri','Aoji-ri',42.5206,130.395,'P','PPL','KP.17',NULL,34248,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2049653,'KP','Sŭngjibaegam','Sungjibaegam',41.2428,128.799,'P','PPL','KP.13','KP.13.PAEGAM-GUN',11786,'Asia/Pyongyang',1,'2012-01-18 23:00:00','2012-01-18 23:00:00'); INSERT INTO `<<prefix>>cities` VALUES (2050500,'KP','Komusan 1-tong','Komusan 1-tong',42.1092,129.7,'P','PPL','KP.17',NULL,12242,'Asia/Pyongyang',1,'2006-01-16 23:00:00','2006-01-16 23:00:00'); /*!40000 ALTER TABLE `<<prefix>>cities` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed
116.247024
218
0.672009
65192f76bf69dd1b91580c7c3d8c5be7720e2e54
410
py
Python
peerplays/blockchainobject.py
farisshajahan/python-peerplays
260e43d39307554f5c35574fe7a6f5451a51697f
[ "MIT" ]
10
2019-03-14T03:09:42.000Z
2021-03-17T10:20:05.000Z
peerplays/blockchainobject.py
farisshajahan/python-peerplays
260e43d39307554f5c35574fe7a6f5451a51697f
[ "MIT" ]
8
2019-04-02T17:07:20.000Z
2020-04-30T08:24:01.000Z
peerplays/blockchainobject.py
farisshajahan/python-peerplays
260e43d39307554f5c35574fe7a6f5451a51697f
[ "MIT" ]
4
2019-04-02T17:00:22.000Z
2021-08-09T11:28:20.000Z
# -*- coding: utf-8 -*- from .instance import BlockchainInstance from graphenecommon.blockchainobject import ( BlockchainObject as GrapheneBlockchainObject, BlockchainObjects as GrapheneBlockchainObjects, ObjectCache, ) @BlockchainInstance.inject class BlockchainObject(GrapheneBlockchainObject): pass @BlockchainInstance.inject class BlockchainObjects(GrapheneBlockchainObjects): pass
22.777778
51
0.807317
cbbc09eb52ee7284bfb474e794a9731810c0db62
1,211
go
Go
device/edison_posix.go
xshellinc/iotit
42f4cdaafd3fdc378c6e4461889ae1cf2575f57e
[ "Apache-2.0" ]
33
2017-03-04T05:15:20.000Z
2022-03-26T06:20:58.000Z
device/edison_posix.go
xshellinc/iotit
42f4cdaafd3fdc378c6e4461889ae1cf2575f57e
[ "Apache-2.0" ]
88
2017-02-07T05:57:42.000Z
2021-07-26T22:59:42.000Z
device/edison_posix.go
xshellinc/iotit
42f4cdaafd3fdc378c6e4461889ae1cf2575f57e
[ "Apache-2.0" ]
1
2017-10-17T06:57:28.000Z
2017-10-17T06:57:28.000Z
// +build !windows package device import ( "fmt" "os" "time" log "github.com/sirupsen/logrus" "github.com/xshellinc/iotit/device/config" "github.com/xshellinc/iotit/vbox" "github.com/xshellinc/tools/dialogs" "github.com/xshellinc/tools/lib/help" ) func (d *edison) Prepare() error { if err := d.flasher.Prepare(); err != nil { return err } for !dialogs.YesNoDialog("Please unplug your Edison board. Type yes once unpluged.") { } return nil } func (d *edison) Write() error { for { script := "flashall.sh" args := []string{ fmt.Sprintf("%s@%s", vbox.VBoxUser, vbox.VBoxIP), "-p", vbox.VBoxSSHPort, config.TmpDir + script, } if err := help.ExecStandardStd("ssh", args...); err != nil { fmt.Println("[-] Can't find Intel Edison board, please try to re-connect it") if !dialogs.YesNoDialog("Type yes once connected.") { fmt.Println("Exiting with exit status 2 ...") os.Exit(2) } continue } break } if err := d.conf.Stop(d.Quiet); err != nil { log.Error(err) } job := help.NewBackgroundJob() go func() { defer job.Close() time.Sleep(120 * time.Second) }() help.WaitJobAndSpin("Your Edison board is restarting...", job) return nil }
19.852459
87
0.646573
8aecda61a11ff3fe2f5c3869da0d5b466a2cbe59
2,424
kt
Kotlin
src/main/kotlin/cn/authing/core/mgmt/WhitelistManagementClient.kt
leacode/authing-java-sdk
1f070aa067029bfd421bbb1a197cf37bde81a39f
[ "MIT" ]
9
2020-03-28T18:47:25.000Z
2022-03-10T07:46:49.000Z
src/main/kotlin/cn/authing/core/mgmt/WhitelistManagementClient.kt
leacode/authing-java-sdk
1f070aa067029bfd421bbb1a197cf37bde81a39f
[ "MIT" ]
12
2019-06-24T13:41:27.000Z
2022-03-11T10:59:10.000Z
src/main/kotlin/cn/authing/core/mgmt/WhitelistManagementClient.kt
leacode/authing-java-sdk
1f070aa067029bfd421bbb1a197cf37bde81a39f
[ "MIT" ]
11
2018-07-14T06:12:00.000Z
2022-03-03T08:30:25.000Z
package cn.authing.core.mgmt import cn.authing.core.graphql.GraphQLCall import cn.authing.core.graphql.GraphQLException import cn.authing.core.graphql.GraphQLResponse import cn.authing.core.types.* import com.google.gson.reflect.TypeToken /** * 管理注册白名单 */ class WhitelistManagementClient(private val client: ManagementClient) { /** * 获取白名单记录 */ fun list(type: WhitelistType): GraphQLCall<WhitelistResponse, List<WhiteList>> { val param = WhitelistParam(type) return client.createGraphQLCall( param.createRequest(), object : TypeToken<GraphQLResponse<WhitelistResponse>>() {}) { it.result } } /** * 添加白名单 * @param {WhitelistType} type 白名单类型,USERNAME 为用户名、Email 为邮箱、Phone 为手机号。 * @param {string[]} list 白名单列表,请注意邮箱不区分大小写。 */ fun add(param: AddWhitelistParam): GraphQLCall<AddWhitelistResponse, List<WhiteList>> { return client.createGraphQLCall( param.createRequest(), object : TypeToken<GraphQLResponse<AddWhitelistResponse>>() {}) { it.result } } /** * 移除白名单 */ fun remove(param: RemoveWhitelistParam): GraphQLCall<RemoveWhitelistResponse, List<WhiteList>> { return client.createGraphQLCall( param.createRequest(), object : TypeToken<GraphQLResponse<RemoveWhitelistResponse>>() {}) { it.result } } /** * 开启白名单 */ fun enable(type: WhitelistType): GraphQLCall<UpdateUserpoolResponse, UserPool> { return enableOrDisable(type, true) } /** * 关闭白名单 */ fun disable(type: WhitelistType): GraphQLCall<UpdateUserpoolResponse, UserPool> { return enableOrDisable(type, false) } private fun enableOrDisable(type: WhitelistType, action: Boolean): GraphQLCall<UpdateUserpoolResponse, UserPool> { val updatesWhite = RegisterWhiteListConfigInput() when (type) { WhitelistType.EMAIL -> updatesWhite.emailEnabled = action WhitelistType.PHONE -> updatesWhite.phoneEnabled = action WhitelistType.USERNAME -> updatesWhite.usernameEnabled = action else -> { throw GraphQLException(message = "不支持的白名单类型") } } val updates = UpdateUserpoolInput(whitelist = updatesWhite) return client.userpool().update(updates) } }
31.076923
118
0.643564
412f188dbc1b90d1d89641fad3a83d475ace69c7
1,338
c
C
Project/C/project/public/tools/src/t_a2b/t_a2b_date.c
renwei-release/dave
773301edd3bee6e7526e0d5587ff8af9f01e288f
[ "MIT" ]
null
null
null
Project/C/project/public/tools/src/t_a2b/t_a2b_date.c
renwei-release/dave
773301edd3bee6e7526e0d5587ff8af9f01e288f
[ "MIT" ]
null
null
null
Project/C/project/public/tools/src/t_a2b/t_a2b_date.c
renwei-release/dave
773301edd3bee6e7526e0d5587ff8af9f01e288f
[ "MIT" ]
null
null
null
/* * Copyright (c) 2022 Renwei * * This is a free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. */ #include "dave_base.h" #include "dave_tools.h" static s8 * _t_a2b_date_str(s8 *date_str, ub date_len, DateStruct *pDate) { dave_snprintf(date_str, date_len, "%04d.%02d.%02d %02d:%02d:%02d", pDate->year, pDate->month, pDate->day, pDate->hour, pDate->minute, pDate->second); return date_str; } // ===================================================================== s8 * t_a2b_date_str(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); } s8 * t_a2b_date_str_2(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); } s8 * t_a2b_date_str_3(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); } s8 * t_a2b_date_str_4(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); } s8 * t_a2b_date_str_5(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); } s8 * t_a2b_date_str_6(DateStruct *pDate) { static s8 date_str[32]; return _t_a2b_date_str(date_str, sizeof(date_str), pDate); }
18.84507
72
0.690583
adbb7ab0739cb52283d1aa1f22a6e40d1e40f022
839
rs
Rust
tools/changelog/src/stdout_tag_description_changelog.rs
lostinspiration/yew
e68060afa7421149f2d6aacace67c65c33e81fe5
[ "Apache-2.0", "MIT" ]
8,292
2017-12-24T12:34:44.000Z
2019-08-04T03:56:11.000Z
tools/changelog/src/stdout_tag_description_changelog.rs
lostinspiration/yew
e68060afa7421149f2d6aacace67c65c33e81fe5
[ "Apache-2.0", "MIT" ]
504
2017-12-24T20:53:56.000Z
2019-08-04T03:30:44.000Z
tools/changelog/src/stdout_tag_description_changelog.rs
lostinspiration/yew
e68060afa7421149f2d6aacace67c65c33e81fe5
[ "Apache-2.0", "MIT" ]
349
2017-12-24T23:37:30.000Z
2019-08-03T03:12:50.000Z
use std::io::{stdout, Write}; use anyhow::Result; pub fn stdout_tag_description_changelog(fixes_logs: &[u8], features_logs: &[u8]) -> Result<()> { let mut tag_changelog = Vec::new(); writeln!(tag_changelog, "# Changelog")?; writeln!(tag_changelog)?; if fixes_logs.is_empty() && features_logs.is_empty() { writeln!(tag_changelog, "No changes")?; writeln!(tag_changelog)?; } if !fixes_logs.is_empty() { writeln!(tag_changelog, "## 🛠 Fixes")?; writeln!(tag_changelog)?; tag_changelog.extend(fixes_logs); writeln!(tag_changelog)?; } if !features_logs.is_empty() { writeln!(tag_changelog, "## ⚡️ Features")?; writeln!(tag_changelog)?; tag_changelog.extend(features_logs); } stdout().write_all(&tag_changelog)?; Ok(()) }
25.424242
96
0.613826
6cdc253ebc5f5593dce8a5e239038e7723349db8
2,241
sql
SQL
test.sql
Sabotage123/testYii2
6dcae435589353adafd05570876feed34647b888
[ "BSD-3-Clause" ]
null
null
null
test.sql
Sabotage123/testYii2
6dcae435589353adafd05570876feed34647b888
[ "BSD-3-Clause" ]
null
null
null
test.sql
Sabotage123/testYii2
6dcae435589353adafd05570876feed34647b888
[ "BSD-3-Clause" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.0.10.10 -- http://www.phpmyadmin.net -- -- Хост: 127.0.0.1:3306 -- Время создания: Дек 19 2016 г., 01:52 -- Версия сервера: 5.5.45 -- Версия PHP: 5.5.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- База данных: `test` -- -- -------------------------------------------------------- -- -- Структура таблицы `phone` -- CREATE TABLE IF NOT EXISTS `phone` ( `id_phone` int(11) NOT NULL AUTO_INCREMENT, `number` varchar(11) NOT NULL, `id_phonbook` int(11) NOT NULL, PRIMARY KEY (`id_phone`), KEY `id_phonbook` (`id_phonbook`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=38 ; -- -- Дамп данных таблицы `phone` -- INSERT INTO `phone` (`id_phone`, `number`, `id_phonbook`) VALUES (26, '123456789', 14), (27, '123456789', 14), (28, '123456789', 14), (30, '123456789', 14), (31, '7894561230', 14), (35, '1232123123', 14), (37, '0123123123', 14); -- -------------------------------------------------------- -- -- Структура таблицы `phonebook` -- CREATE TABLE IF NOT EXISTS `phonebook` ( `id_phonbook` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(55) NOT NULL, `surname` varchar(55) NOT NULL, `patronymic` varchar(55) NOT NULL, `date` varchar(50) NOT NULL, PRIMARY KEY (`id_phonbook`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; -- -- Дамп данных таблицы `phonebook` -- INSERT INTO `phonebook` (`id_phonbook`, `name`, `surname`, `patronymic`, `date`) VALUES (14, '21331', '231231', '23123123', '2018'), (16, '123123', '3212313', '1232311232123', '19-12-16'); -- -- Ограничения внешнего ключа сохраненных таблиц -- -- -- Ограничения внешнего ключа таблицы `phone` -- ALTER TABLE `phone` ADD CONSTRAINT `phone_ibfk_1` FOREIGN KEY (`id_phonbook`) REFERENCES `phonebook` (`id_phonbook`) ON DELETE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
26.05814
117
0.65685
839861736ebaa7bd1564aa6b68d16b921df7b93e
752
swift
Swift
Sources/TraktSwift/Private classes/Resources/AuthResources.swift
martinpucik/TraktSwift
5b9915d3869db0aed4cdbbf8d99dea62eb2c1377
[ "MIT" ]
1
2020-05-02T09:44:29.000Z
2020-05-02T09:44:29.000Z
Sources/TraktSwift/Private classes/Resources/AuthResources.swift
martinpucik/TraktSwift
5b9915d3869db0aed4cdbbf8d99dea62eb2c1377
[ "MIT" ]
null
null
null
Sources/TraktSwift/Private classes/Resources/AuthResources.swift
martinpucik/TraktSwift
5b9915d3869db0aed4cdbbf8d99dea62eb2c1377
[ "MIT" ]
null
null
null
// // AuthResources.swift // TraktSwift // // Created by Martin Púčik on 24/05/2020. // import Foundation extension Resource { enum Auth {} } extension Resource.Auth { static func generateDeviceCode(clientID: String) -> Resource { Resource(path: "/oauth/device/code", method: .POST, parameters: ["client_id": clientID], clientID: clientID) } static func requestDeviceToken(deviceCodeResponse: AuthGenerateDeviceCodeResponse, clientID: String, clientSecret: String) -> Resource { Resource(path: "/oauth/device/token", method: .POST, parameters: [ "client_id": clientID, "client_secret": clientSecret, "code": deviceCodeResponse.deviceCode ], clientID: clientID) } }
27.851852
140
0.670213
74b5eb1be73800ead324953450343473c3236628
336
js
JavaScript
src/lib/snapshot-processors/010_parser-alerts.js
saiyam1814/kubevious
b11b3ca49a30febc46920b83c876dcd56ee439f1
[ "Apache-2.0" ]
null
null
null
src/lib/snapshot-processors/010_parser-alerts.js
saiyam1814/kubevious
b11b3ca49a30febc46920b83c876dcd56ee439f1
[ "Apache-2.0" ]
null
null
null
src/lib/snapshot-processors/010_parser-alerts.js
saiyam1814/kubevious
b11b3ca49a30febc46920b83c876dcd56ee439f1
[ "Apache-2.0" ]
null
null
null
module.exports = { order: 10, handler: ({logger, state}) => { state.traverseNodes((dn, node) => { var alerts = state.getAlerts(dn); for(var alert of alerts) { alert.source = { kind: 'parser' }; } }) } }
16.8
45
0.377976
0027c87fd47cc5026784618c1c25b10546379955
2,483
lua
Lua
lua-client/spec/time_api_spec.lua
dowoge/strafes-net-clients
3c5ba0b5e54501712e8f9121e818b5b80f9eab5b
[ "Unlicense" ]
null
null
null
lua-client/spec/time_api_spec.lua
dowoge/strafes-net-clients
3c5ba0b5e54501712e8f9121e818b5b80f9eab5b
[ "Unlicense" ]
null
null
null
lua-client/spec/time_api_spec.lua
dowoge/strafes-net-clients
3c5ba0b5e54501712e8f9121e818b5b80f9eab5b
[ "Unlicense" ]
null
null
null
--[[ StrafesNET Public API ### How to use To request an api key open a support request in the [issue tracker](https://issues.strafes.net/client/index.php#/types/3/issues). ### Default API request rate limits are as follows * 100 requests per minute * 3000 requests per hour ### Game IDs ``` 1 Bhop 2 Surf ``` ### Style IDs ``` 1 Autohop 2 Scroll 3 Sideways 4 Half-Sideways 5 W-Only 6 A-Only 7 Backwards ``` OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git ]] --[[ Unit tests for swagger-client.api.time_api Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) Please update as you see appropriate ]] describe("time_api", function() local swagger_client_time_api = require "swagger-client.api.time_api" -- unit tests for time_map_map_id_get describe("time_map_map_id_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_map_map_id_wr_get describe("time_map_map_id_wr_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_recent_get describe("time_recent_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_recent_wr_get describe("time_recent_wr_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_time_id_get describe("time_time_id_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_time_id_rank_get describe("time_time_id_rank_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_user_user_id_get describe("time_user_user_id_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) -- unit tests for time_user_user_id_wr_get describe("time_user_user_id_wr_get test", function() it("should work", function() -- TODO assertion here: http://olivinelabs.com/busted/#asserts end) end) end)
33.106667
384
0.703182
4154c1d7849b2da752e89f5b237532935106fdc4
1,849
c
C
DSA/revAsingleLL.c
atig05/HACKTOBERFEST-2021
a13b4a72c3c13760643f0f2aa4d5dcd8bf2c79dc
[ "MIT" ]
2
2021-10-02T16:48:56.000Z
2021-10-02T17:14:26.000Z
DSA/revAsingleLL.c
atig05/HACKTOBERFEST-2021
a13b4a72c3c13760643f0f2aa4d5dcd8bf2c79dc
[ "MIT" ]
3
2021-10-30T17:35:27.000Z
2021-10-31T13:43:04.000Z
DSA/revAsingleLL.c
atig05/HACKTOBERFEST-2021
a13b4a72c3c13760643f0f2aa4d5dcd8bf2c79dc
[ "MIT" ]
4
2021-10-30T08:55:42.000Z
2021-11-10T04:37:51.000Z
#include<stdio.h> #include<stdlib.h> struct Node { char data; struct Node * link; }; struct Node * head = NULL; void Create() { int n; struct Node *ptr, *Cptr; printf("Enter the number of nodes: "); scanf("%d",&n); if(n == 0) return; ptr = (struct Node *)calloc(1,sizeof(struct Node)); printf("Enter data: "); scanf("%d",&ptr->data); head = ptr; for(int i = 2; i <= n; i++) { Cptr = (struct Node *)calloc(1,sizeof(struct Node)); printf("Enter data: "); scanf("%d",&Cptr->data); ptr->link = Cptr; ptr = Cptr; } ptr->link = NULL; } //loop takes n iterations so has O(n) time. void Display() { struct Node * ptr; ptr = head; while(ptr->link != NULL) { printf("%d->",ptr->data); ptr = ptr->link; } printf("%d",ptr->data); printf("\n\n"); } //recursion also takes O(n) time as well as space complexity. //As recursion takes place in system stack it takes more space than looping void recursive_display(struct Node *ptr) { if(ptr != NULL) { printf("%d ",ptr->data); recursive_display(ptr->link); } } void recursive_rev_display(struct Node *ptr) { if(ptr != NULL) { recursive_rev_display(ptr->link); printf("%d ",ptr->data); } } void reverse() { struct Node *current, *next, *prev; current = head; prev = NULL; while(current != NULL) { next = current->link; current->link = prev; prev = current; current = next; } head = prev; } int main() { Create(); printf("The main list: "); Display(); recursive_display(head); printf("\n"); recursive_rev_display(head); printf("\n"); reverse(); printf("The reversed list: "); Display(); return 0; }
19.061856
75
0.541374
0ee1a5366ddfd02ca971942550aaa4db1357e45e
8,856
swift
Swift
CSRefresh/CSRefresh/CSRefreshHeaderView.swift
crash-wu/CSRefresher
34ac1cf3f1632942f0dfd9a9d56d79eee3fdaa9a
[ "MIT" ]
null
null
null
CSRefresh/CSRefresh/CSRefreshHeaderView.swift
crash-wu/CSRefresher
34ac1cf3f1632942f0dfd9a9d56d79eee3fdaa9a
[ "MIT" ]
null
null
null
CSRefresh/CSRefresh/CSRefreshHeaderView.swift
crash-wu/CSRefresher
34ac1cf3f1632942f0dfd9a9d56d79eee3fdaa9a
[ "MIT" ]
null
null
null
// // CSRefreshHeaderView.swift // CSRefresh // // Created by 吴小星 on 16/6/3. // Copyright © 2016年 crash. All rights reserved. // import UIKit class CSRefreshHeaderView: CSRefreshBaseView { //.=======================================// // MARK: 最后更新时间 // //=======================================// //.******** 时间显示条 *********/ lazy var lastUpdateTimeLabel :UILabel? = { let lable = UILabel() lable.autoresizingMask = [.FlexibleWidth] lable.font = UIFont.boldSystemFontOfSize(12) lable.backgroundColor = UIColor.clearColor() lable.textAlignment = .Center lable.textColor = UIColor(red: 150/255, green: 150/255, blue: 150/255, alpha: 1.0) self.addSubview(lable) return lable }() //.******** 时间 *********/ var lastUpdateTime : NSDate?{ get{ return objc_getAssociatedObject(self, &CSRefreshConstStruct.shareManager.LastUpdateTime) as? NSDate } set{ //归档 NSUserDefaults.standardUserDefaults().setObject(newValue, forKey: CSRefreshConstStruct.shareManager.CSRefreshHeaderTimeKey) NSUserDefaults.standardUserDefaults().synchronize() objc_setAssociatedObject(self, &CSRefreshConstStruct.shareManager.LastUpdateTime, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) //更新时间 self.updateTimeLabel() } } //.******** 更新时间 *********/ func updateTimeLabel()->Void{ let lastUpdateTmp = objc_getAssociatedObject(self, &CSRefreshConstStruct.shareManager.LastUpdateTime) as? NSDate if lastUpdateTmp == nil{ return } // 1.获得年月日 let calendar = NSCalendar.currentCalendar() let unitFlags : NSCalendarUnit = [.Year,.Month,.Day,.Hour,.Minute] let cmp1 : NSDateComponents = calendar.components(unitFlags, fromDate: lastUpdateTmp!) let cmp2 :NSDateComponents = calendar.components(unitFlags, fromDate: NSDate()) // 2.格式化日期 let formatter = NSDateFormatter() if cmp1.day == cmp2.day{ //今天 formatter.dateFormat = "今天 HH:mm" }else if cmp1.year == cmp2.year{ //今年 formatter.dateFormat = "MM-dd HH:mm" }else{ formatter.dateFormat = "yyyy-MM-dd HH:mm" } let time :String = formatter.stringFromDate(lastUpdateTmp!) self.lastUpdateTimeLabel?.text = "最后更新:" + "\(time)" } //.=======================================// // MARK: 单例 // //=======================================// static let header = CSRefreshHeaderView() private convenience init(){ self.init(frame : CGRectZero) } override init(frame: CGRect) { super.init(frame: frame) self.pullToRefreshText = CSRefreshConstStruct.shareManager.CSRefreshHeaderPullToRefresh self.releaseToRefreshText = CSRefreshConstStruct.shareManager.CSRefreshFooterReleaseToRefresh self.refreshingText = CSRefreshConstStruct.shareManager.CSRefreshHeaderRefreshing } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() let statusX :CGFloat = 0 let statusY :CGFloat = 0 let statusHeight :CGFloat = self.mj_height * 0.5 let statusWidth :CGFloat = self.mj_width // 1.状态标签 statusLabel?.frame = CGRectMake(statusX, statusY, statusWidth, statusHeight) // 2.时间标签 let lastUpdateY :CGFloat = statusHeight let lastUpdateX :CGFloat = 0 let lastUpdateHeight :CGFloat = statusHeight let lastUpdateWidth :CGFloat = statusWidth self.lastUpdateTimeLabel?.frame = CGRectMake(lastUpdateX, lastUpdateY, lastUpdateWidth, lastUpdateHeight) } override func willMoveToSuperview(newSuperview: UIView?) { super.willMoveToSuperview(newSuperview) //设置位置 self.mj_y = self.mj_y - self.mj_height } //.=======================================// // MARK: 监听UIScrollview 的contentOffset属性 // //=======================================// override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) { //没有交互就直接返回 if !self.userInteractionEnabled || (self.alpha <= 0.01 || self.hidden) { return } //如果正在刷新,直接放回 if self.state == .CSRefreshStateRefreshing { return } if CSRefreshConstStruct.shareManager.CSRefreshContentOffset == keyPath { self.adjustStateWithContentOffset() } } //.******** 调整状态 *********/ func adjustStateWithContentOffset()->Void{ //当前contentOffSet let currentOffsetY :CGFloat = self.scrollView.mj_contentOffsetY //头部控件刚好出现的offSetY let happenOffsetY :CGFloat = -(self.scrollViewOriginalInset?.top)! //如果向上滚动看不见头部控件,直接返回 if currentOffsetY >= happenOffsetY{ return } if self.scrollView.dragging { //普通状态 与即将刷新的临界点 let normal2pullingOffsetY :CGFloat = happenOffsetY - self.mj_height if self.state == .CSRefreshStateNormal && currentOffsetY < normal2pullingOffsetY { //转为即将刷新状态 self.state = .CSRefreshStatePulling }else if self.state == .CSRefreshStatePulling && currentOffsetY >= normal2pullingOffsetY { //转为普通状态 self.state = .CSRefreshStateNormal } }else if self.state == .CSRefreshStatePulling{ //手松开,开始刷新 self.state = .CSRefreshStateRefreshing } } //.******** 重写父类的state属性 *********/ override var state : CSRefreshState { get{ return super.state } set{ //如果值相同,则返回 if self.state == newValue { return } //保存旧的状态 let oldState :CSRefreshState = self.state //调用父类的方法 super.state = newValue //根据状态执行不同的操作 switch newValue { case .CSRefreshStateNormal: //下拉可以刷新 if oldState == CSRefreshState.CSRefreshStateRefreshing { //箭头翻转 self.arrowImage?.transform = CGAffineTransformIdentity //保存刷新时间 self.lastUpdateTime = NSDate() UIView.animateWithDuration(CSRefreshConstStruct.shareManager.CSRefreshSlowAnimationDuration, animations: { self.scrollView.mj_contentInsetTop = self.scrollView.mj_contentInsetTop - self.mj_height }) }else{ UIView.animateWithDuration(CSRefreshConstStruct.shareManager.CSRefreshFastAnimationDuration, animations: { self.arrowImage?.transform = CGAffineTransformIdentity }) } break case .CSRefreshStatePulling : //松开既可以刷新 UIView.animateWithDuration(CSRefreshConstStruct.shareManager.CSRefreshFastAnimationDuration, animations: { self.arrowImage?.transform = CGAffineTransformMakeRotation(CGFloat(M_PI)) }) break case .CSRefreshStateRefreshing : //正在刷新中 UIView.animateWithDuration(CSRefreshConstStruct.shareManager.CSRefreshFastAnimationDuration, animations: { //增加滚动区域 let top :CGFloat = self.scrollViewOriginalInset!.top + self.mj_height self.scrollView.mj_contentInsetTop = top //设置滚动位置 self.scrollView.mj_contentOffsetY = self.scrollView.mj_contentOffsetY - top }) break default: break } } } deinit{ } }
31.971119
157
0.523035
8cb5ca9673700d888be3756b535271891c2f8b92
1,471
sql
SQL
SQL/Lab1.sql
andrei-micuda/teme-fmi
d31c032c45e0e910d75fc05faab3681d421aac7c
[ "MIT" ]
1
2020-06-07T09:45:17.000Z
2020-06-07T09:45:17.000Z
SQL/Lab1.sql
micu01/teme-fmi
d31c032c45e0e910d75fc05faab3681d421aac7c
[ "MIT" ]
null
null
null
SQL/Lab1.sql
micu01/teme-fmi
d31c032c45e0e910d75fc05faab3681d421aac7c
[ "MIT" ]
2
2020-04-09T19:27:36.000Z
2020-06-28T17:45:14.000Z
--LAB 1 --a DESCRIBE EMPLOYEES; --c SELECT * FROM EMPLOYEES; --e SELECT EMPLOYEE_ID, FIRST_NAME || ' ' || LAST_NAME AS NAME, JOB_ID, HIRE_DATE FROM EMPLOYEES; --f SELECT LAST_NAME || ', ' || JOB_ID AS "Angajat si titlu" FROM EMPLOYEES; --g SELECT EMPLOYEE_ID || ',' || FIRST_NAME || ',' || LAST_NAME || ',' || EMAIL || ',' || PHONE_NUMBER || ',' || HIRE_DATE || ',' || JOB_ID || ',' || SALARY || ',' || COMMISSION_PCT || ',' || MANAGER_ID || ',' || DEPARTMENT_ID AS "Informatii complete" FROM EMPLOYEES; --h SELECT TO_CHAR(SYSDATE, 'DD/MM/YYYY HH24:MI') FROM DUAL; --j SELECT EMPLOYEE_ID, LAST_NAME, TO_CHAR(HIRE_DATE, 'DAY') AS "DAY HIRED" FROM EMPLOYEES; --k SELECT * FROM EMPLOYEES ORDER BY TO_CHAR(HIRE_DATE, 'YYYY'), TO_CHAR(HIRE_DATE, 'DDD'); --l SELECT LAST_NAME, SALARY FROM EMPLOYEES WHERE SALARY > 2850 ORDER BY SALARY; --m SELECT LAST_NAME, JOB_ID, HIRE_DATE FROM EMPLOYEES WHERE HIRE_DATE > TO_DATE('20-FEB-87') AND HIRE_DATE < TO_DATE('01-MAY-89'); --n SELECT FIRST_NAME || ' ' || LAST_NAME AS NAME, DEPARTMENT_ID FROM EMPLOYEES WHERE DEPARTMENT_ID IN (10, 30, 50) ORDER BY LAST_NAME; --o SELECT LAST_NAME, JOB_ID, SALARY FROM EMPLOYEES WHERE ( JOB_ID LIKE '%CLERK%' OR JOB_ID LIKE '%REP%' ) AND SALARY NOT IN (1000, 2000, 3000); --p SELECT LAST_NAME, JOB_ID FROM EMPLOYEES WHERE MANAGER_ID IS NULL; --q SELECT LAST_NAME, SALARY, COMMISSION_PCT FROM EMPLOYEES WHERE SALARY > (SALARY * COMMISSION_PCT) * 5;
20.71831
247
0.670972
5b4b54def1a93b161d88ba6d6ba2a33176a89f7c
3,100
c
C
CryptoPkg/Library/BaseCryptLibNull/Pk/CryptRsaBasicNull.c
KaoTuz/edk2-stable202108
49d9306e7bf64b2f07d8473be1f2faea49d0a012
[ "Python-2.0", "Zlib", "BSD-2-Clause", "MIT", "BSD-2-Clause-Patent", "BSD-3-Clause" ]
9
2021-07-26T17:02:51.000Z
2021-12-30T10:49:46.000Z
CryptoPkg/Library/BaseCryptLibNull/Pk/CryptRsaBasicNull.c
ESdove/edk2_exploring
34ff32b45f43d233d9696e7c8e3de68ea3000a7b
[ "Python-2.0", "Zlib", "BSD-2-Clause", "MIT", "BSD-2-Clause-Patent", "BSD-3-Clause" ]
null
null
null
CryptoPkg/Library/BaseCryptLibNull/Pk/CryptRsaBasicNull.c
ESdove/edk2_exploring
34ff32b45f43d233d9696e7c8e3de68ea3000a7b
[ "Python-2.0", "Zlib", "BSD-2-Clause", "MIT", "BSD-2-Clause-Patent", "BSD-3-Clause" ]
null
null
null
/** @file RSA Asymmetric Cipher Wrapper Null Implementation. This file implements following APIs which provide basic capabilities for RSA: 1) RsaNew 2) RsaFree 3) RsaSetKey 4) RsaPkcs1Verify Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "InternalCryptLib.h" /** Allocates and initializes one RSA context for subsequent use. @return Pointer to the RSA context that has been initialized. If the allocations fails, RsaNew() returns NULL. **/ VOID * EFIAPI RsaNew ( VOID ) { // // Allocates & Initializes RSA Context // ASSERT (FALSE); return NULL; } /** Release the specified RSA context. @param[in] RsaContext Pointer to the RSA context to be released. **/ VOID EFIAPI RsaFree ( IN VOID *RsaContext ) { // // Free RSA Context // ASSERT (FALSE); } /** Sets the tag-designated key component into the established RSA context. This function sets the tag-designated RSA key component into the established RSA context from the user-specified non-negative integer (octet string format represented in RSA PKCS#1). If BigNumber is NULL, then the specified key component in RSA context is cleared. If RsaContext is NULL, then return FALSE. @param[in, out] RsaContext Pointer to RSA context being set. @param[in] KeyTag Tag of RSA key component being set. @param[in] BigNumber Pointer to octet integer buffer. If NULL, then the specified key component in RSA context is cleared. @param[in] BnSize Size of big number buffer in bytes. If BigNumber is NULL, then it is ignored. @retval TRUE RSA key component was set successfully. @retval FALSE Invalid RSA key component tag. **/ BOOLEAN EFIAPI RsaSetKey ( IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize ) { ASSERT (FALSE); return FALSE; } /** Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1. If RsaContext is NULL, then return FALSE. If MessageHash is NULL, then return FALSE. If Signature is NULL, then return FALSE. If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE. @param[in] RsaContext Pointer to RSA context for signature verification. @param[in] MessageHash Pointer to octet message hash to be checked. @param[in] HashSize Size of the message hash in bytes. @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified. @param[in] SigSize Size of signature in bytes. @retval TRUE Valid signature encoded in PKCS1-v1_5. @retval FALSE Invalid signature or invalid RSA context. **/ BOOLEAN EFIAPI RsaPkcs1Verify ( IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize ) { ASSERT (FALSE); return FALSE; }
25.409836
90
0.676452
ea311e4bd0560e4ffa887219be017d381094ad20
1,041
swift
Swift
SwiftLog/Closure/main.swift
BigRhino/MyRhino
661043d07226f7ede716c7983ad99daec1dd246c
[ "MIT" ]
null
null
null
SwiftLog/Closure/main.swift
BigRhino/MyRhino
661043d07226f7ede716c7983ad99daec1dd246c
[ "MIT" ]
null
null
null
SwiftLog/Closure/main.swift
BigRhino/MyRhino
661043d07226f7ede716c7983ad99daec1dd246c
[ "MIT" ]
1
2018-12-18T06:46:31.000Z
2018-12-18T06:46:31.000Z
// // main.swift // Closure // // Created by iMac on 2017/11/8. // Copyright © 2017年 iMac. All rights reserved. // import Foundation let volunteerCounts = [1,340,32,2,53,77,14] func sortAsending(_ i:Int,_ j:Int) -> Bool{ return i < j } //print(volunteerCounts.sorted(by: sortAsending)) print(volunteerCounts.sorted(by: { (a, b) -> Bool in return a > b })) print(volunteerCounts.sorted(by: { i,j in i > j })) print(volunteerCounts.sorted(by: {$0 < $1})) print(volunteerCounts.map({ (number) -> Int in return number * 10 }) ) func makeTownGrand() -> (Int,Int) ->Int{ func buildRoads(byAddingLights lights:Int, toExistingLights existingLights:Int)->Int{ return lights + existingLights } return buildRoads } var stoplights = 4 let townPlanByAddingLightsToExistingLights = makeTownGrand() stoplights = townPlanByAddingLightsToExistingLights(4, stoplights) print("Knowhere has \(stoplights) stoplights.") //逃匿闭包 //当一个闭包作为函数的参数,这个闭包在函数执行返回之后,才执行,就叫做逃匿闭包
16.265625
66
0.669549
7bce60de8c54315ce98038f299b0bf9219515292
1,043
rb
Ruby
Chapter 09/circuit-oneops-1-master/components/cookbooks/compute/recipes/start.rb
PacktPublishing/Practical-OneOps
74f7e3b60051101a5560a69523b25b9868cc5bec
[ "MIT" ]
1
2018-04-11T20:26:13.000Z
2018-04-11T20:26:13.000Z
Chapter 09/circuit-oneops-1-master/components/cookbooks/compute/recipes/start.rb
PacktPublishing/Practical-OneOps
74f7e3b60051101a5560a69523b25b9868cc5bec
[ "MIT" ]
null
null
null
Chapter 09/circuit-oneops-1-master/components/cookbooks/compute/recipes/start.rb
PacktPublishing/Practical-OneOps
74f7e3b60051101a5560a69523b25b9868cc5bec
[ "MIT" ]
1
2019-12-25T15:54:18.000Z
2019-12-25T15:54:18.000Z
# Copyright 2016, Walmart Stores, Inc. # # 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. require 'fog' include_recipe "shared::set_provider" instance_id = node.workorder.ci[:ciAttributes][:instance_id] server = node.iaas_provider.servers.get instance_id if server == nil Chef::Log.error("cannot find server by name: "+server_name) return false end Chef::Log.info("server: "+server.inspect.gsub(/\n|\<|\>|\{|\}/,"")) server.start Chef::Log.info("start in progress") sleep 10 server.wait_for { ready? } Chef::Log.info("server ready")
29.8
74
0.738255
a194a3caee8d9b36967887da3041d164898f935d
2,227
c
C
NCGB/Compile/src/OBSOLETE2009/SFSGLoop.c
mcdeoliveira/NC
54b2a81ebda9e5260328f88f83f56fe8cf472ac3
[ "BSD-3-Clause" ]
103
2016-09-21T06:01:23.000Z
2022-03-27T06:52:10.000Z
NCGB/Compile/src/OBSOLETE2009/SFSGLoop.c
albinjames/NC
157a55458931a18dd1f42478872c9df0de5cc450
[ "BSD-3-Clause" ]
11
2017-03-27T13:11:42.000Z
2022-03-08T13:46:14.000Z
NCGB/Compile/src/OBSOLETE2009/SFSGLoop.c
albinjames/NC
157a55458931a18dd1f42478872c9df0de5cc450
[ "BSD-3-Clause" ]
21
2017-06-23T09:01:21.000Z
2022-02-18T06:24:00.000Z
// Mark Stankus 1999 (c) // SFSGLoop.cpp #include "GBInput.hpp" #include "stringGB.hpp" #include "Source.hpp" #include "Sink.hpp" #include "Command.hpp" #include "SFSGRules.hpp" #include "MyOstream.hpp" #include "Names.hpp" #include "Choice.hpp" #ifdef HAS_INCLUDE_NO_DOTS #include <list> #else #include <list.h> #endif void SFSGHelp(SFSGRules & polys) { bool nonzero; list<SFSGEntry*>::iterator w = polys.current(); while(!polys.isend(w)) { polys.inList(w); GBStream << '.'; nonzero = polys.dumbReduction(w,true); if(nonzero) { GBStream << "\n(" << polys.size() << "):"; #if 0 polys.markRecent(w); ++w; #endif }; }; }; void SFSGLoop(int n,SFSGRules & polys,bool & foundSomething) { GBStream << "Initial cleanup.\n"; bool todo = true; SFSGHelp(polys); while(n>=0 && todo) { GBStream << n << " iterations remaining\n"; todo = polys.fill(); SFSGHelp(polys); --n; }; }; void _SFSG(Source & so,Sink & si) { int n; stringGB sfsgname; bool b; so >> b >> n >> sfsgname; so.shouldBeEnd(); SFSGRules * p = (SFSGRules *) Names::s_lookup_error(GBStream, sfsgname.value().chars(),"SFSRules").ptr(); if(!p) DBG(); if(b) p->markAllRecent(); bool found; SFSGLoop(n,*p,found); si << found; }; AddingCommand temp1SFSG("SFSG",3,_SFSG); void _PrintSFSG(Source & so,Sink & si) { stringGB sfsgname; so >> sfsgname; so.shouldBeEnd(); SFSGRules * p = (SFSGRules *) Names::s_lookup_error(GBStream, sfsgname.value().chars(),"SFSRules").ptr(); if(!p) DBG(); GBStream << "Here is the SFSG:\n"; p->print(GBStream); }; AddingCommand temp2SFSG("PrintSFSG",1,_PrintSFSG); void _AddPolynomialsToSFSG(Source & so,Sink & si) { stringGB sfsgname; list<Polynomial> L; so >> sfsgname; GBInput(L,so); so.shouldBeEnd(); SFSGRules * p = (SFSGRules *) Names::s_lookup_error(GBStream, sfsgname.value().chars(),"SFSRules").ptr(); if(!p) DBG(); list<Polynomial>::const_iterator w = L.begin(), e = L.end(); list<SFSGEntry*>::iterator xx; while(w!=e) { xx = p->insert(*w); p->markRecent(xx); ++w; }; si.noOutput(); }; AddingCommand temp3SFSG("AddPolynomialsToSFSG",2,_AddPolynomialsToSFSG);
22.27
72
0.62775
5ac79f80d5342d525c7dd1fc1395c918597437e6
2,364
rs
Rust
src/protocol/recieve.rs
4t145/mirai-ws
49b5200d7b7a597e8fd420c630a3386a4ff701a7
[ "MIT" ]
1
2021-09-12T03:21:16.000Z
2021-09-12T03:21:16.000Z
src/protocol/recieve.rs
4t145/mirai-ws
49b5200d7b7a597e8fd420c630a3386a4ff701a7
[ "MIT" ]
null
null
null
src/protocol/recieve.rs
4t145/mirai-ws
49b5200d7b7a597e8fd420c630a3386a4ff701a7
[ "MIT" ]
null
null
null
use serde::Deserialize; use crate::protocol::common::*; #[derive(Deserialize, Debug)] #[serde(rename_all = "PascalCase", tag="type")] pub enum Msg { #[serde(rename_all = "camelCase")] FriendMessage { sender: PersonalSender, message_chain: Vec<MsgUnit> }, #[serde(rename_all = "camelCase")] GroupMessage { sender: GroupSender, message_chain: Vec<MsgUnit> }, #[serde(rename_all = "camelCase")] TempMessage { sender: GroupSender, message_chain: Vec<MsgUnit> }, #[serde(rename_all = "camelCase")] StrangerMessage { sender: PersonalSender, message_chain: Vec<MsgUnit> }, #[serde(rename_all = "camelCase")] OtherClientMessage { sender: OtherClientSender, message_chain: Vec<MsgUnit> }, #[serde(rename_all = "camelCase")] BadMessage, } impl Msg { pub fn get_sender_qq(&self) -> i64 { match self { Msg::FriendMessage { sender, message_chain:_ } => sender.id, Msg::GroupMessage { sender, message_chain:_ } => sender.id, Msg::TempMessage { sender, message_chain:_ } => sender.id, Msg::StrangerMessage { sender, message_chain:_ } => sender.id, Msg::OtherClientMessage { sender, message_chain:_ } => sender.id, _ => 0, } } } use serde_repr::Deserialize_repr; #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Resp { code: Status, msg: String, // payload: RespPayLoad } #[derive(Deserialize, Debug)] #[serde(untagged)] pub enum RespPayLoad { #[serde(rename_all = "camelCase",)] MsgResp { message_id: i64 }, NoPayLoad{} } #[derive(Deserialize_repr, Debug)] #[repr(u32)] #[serde(rename_all = "camelCase", untagged)] pub enum Status { Ok = 0, WrongVerifyKey = 1, BotNotFound = 2, SessionInvalid = 3, SessionNoAuth = 4, TargetNotFound = 5, ImageFileNotFound = 6, BotNoAuth = 10, BotMuted = 20, MessageTooLong = 30, WrongVisit = 400 } #[derive(Deserialize, Debug)] #[serde(rename_all = "PascalCase", tag="type")] pub enum Evt { #[serde(rename_all = "camelCase")] GroupRecallEvent { author_id: i64, message_id: i32, time: i32, group: GroupInfo, operator: GroupSender } }
23.64
77
0.604061
716a3822f6c767d36c73a98235d88ae97605c8de
3,637
ts
TypeScript
packages/data-model/src/readable/access-consent.ts
samurex/sai-js
182384b233514388de25954bb5628262fa792da9
[ "MIT" ]
null
null
null
packages/data-model/src/readable/access-consent.ts
samurex/sai-js
182384b233514388de25954bb5628262fa792da9
[ "MIT" ]
null
null
null
packages/data-model/src/readable/access-consent.ts
samurex/sai-js
182384b233514388de25954bb5628262fa792da9
[ "MIT" ]
null
null
null
import { DataFactory } from 'n3'; import { Memoize } from 'typescript-memoize'; import { getAllMatchingQuads } from '@janeirodigital/interop-utils'; import { INTEROP } from '@janeirodigital/interop-namespaces'; import { ReadableResource, ReadableDataConsent, ReadableAgentRegistry, ReadableDataRegistry, ReadableAgentRegistration } from '.'; import { AuthorizationAgentFactory, ImmutableAccessGrant, ImmutableDataGrant } from '..'; export class ReadableAccessConsent extends ReadableResource { factory: AuthorizationAgentFactory; async bootstrap(): Promise<void> { await this.fetchData(); } public static async build(iri: string, factory: AuthorizationAgentFactory): Promise<ReadableAccessConsent> { const instance = new ReadableAccessConsent(iri, factory); await instance.bootstrap(); return instance; } get dataConsents(): AsyncIterable<ReadableDataConsent> { const dataConsentPattern = [DataFactory.namedNode(this.iri), INTEROP.hasDataConsent, null, null]; const dataConsentIris = getAllMatchingQuads(this.dataset, ...dataConsentPattern).map((q) => q.object.value); const { factory } = this; return { async *[Symbol.asyncIterator]() { for (const iri of dataConsentIris) { yield factory.readable.dataConsent(iri); } } }; } @Memoize() get registeredBy(): string { return this.getObject('registeredBy')?.value; } @Memoize() get registeredAgent(): string { return this.getObject('registeredAgent').value; } @Memoize() get hasAccessNeedGroup(): string { return this.getObject('hasAccessNeedGroup').value; } /* * This method takes into consideration: * Scope of each DataConsent * If data consent is on issuer data (source data grants) or on someone else's data (delegated data grants) * Enusres not to create delegated gransts on data grants from the consent subject */ public async generateAccessGrant( dataRegistries: ReadableDataRegistry[], agentRegistry: ReadableAgentRegistry ): Promise<ImmutableAccessGrant> { let granteeRegistration: ReadableAgentRegistration; for await (const registration of agentRegistry.applicationRegistrations) { if (registration.registeredAgent === this.registeredAgent) { granteeRegistration = registration; break; } } if (!granteeRegistration) { for await (const registration of agentRegistry.socialAgentRegistrations) { if (registration.registeredAgent === this.registeredAgent) { granteeRegistration = registration; break; } } } // TODO (elf-pavlik) handle case where agent registration has to be created if (!granteeRegistration) throw new Error('Agent Registration not found'); const dataGrants: ImmutableDataGrant[] = []; const regularConsents: ReadableDataConsent[] = []; for await (const dataConsent of this.dataConsents) { if (dataConsent.scopeOfConsent !== INTEROP.Inherited.value) { regularConsents.push(dataConsent); } } for (const dataConsent of regularConsents) { // eslint-disable-next-line no-await-in-loop dataGrants.push(...(await dataConsent.generateDataGrants(dataRegistries, agentRegistry, granteeRegistration))); } const accessGrantIri = granteeRegistration.iriForContained(); return this.factory.immutable.accessGrant(accessGrantIri, { registeredBy: this.factory.webId, registeredWith: this.factory.agentId, registeredAgent: this.registeredAgent, hasAccessNeedGroup: this.hasAccessNeedGroup, dataGrants }); } }
33.990654
117
0.712125
ddf676716d5cd3a547b0c4f7625613e0124c6e8b
368
c
C
examples/example.c
nailujx86/ESP8266_multipart
dd4c8d7fb7f3d28b78fffe843376209cb835af05
[ "MIT" ]
3
2020-08-16T09:12:12.000Z
2021-06-02T17:01:40.000Z
examples/example.c
nailujx86/ESP8266_multipart
dd4c8d7fb7f3d28b78fffe843376209cb835af05
[ "MIT" ]
null
null
null
examples/example.c
nailujx86/ESP8266_multipart
dd4c8d7fb7f3d28b78fffe843376209cb835af05
[ "MIT" ]
null
null
null
#include<ESP8266_multipart.h> ESP8266_multipart multipart("myexampleserver.com"); // Sets the host to myexampleserver.com and the port to 80 multipart.setPort(8772); // Sets the port to 8772 int status = multipart.sendFile("/path/to/send/data/to", fileObject); /** * status == 0 -> couldn't connect to server * status != 0 -> HTTP Status Code returned by server */
40.888889
110
0.730978
a17168dc028ac0442c6c08895f329b104cc5eb86
647
c
C
lib/h2/xen/sysctl.c
sysml/chaos
81e90ef9507e5ef9713dc15b49f9b3bc6461d74c
[ "BSD-3-Clause" ]
8
2017-10-22T21:33:34.000Z
2020-09-09T03:03:44.000Z
lib/h2/xen/sysctl.c
sysml/chaos
81e90ef9507e5ef9713dc15b49f9b3bc6461d74c
[ "BSD-3-Clause" ]
3
2017-10-27T16:39:03.000Z
2021-02-01T03:24:40.000Z
lib/h2/xen/sysctl.c
sysml/chaos
81e90ef9507e5ef9713dc15b49f9b3bc6461d74c
[ "BSD-3-Clause" ]
4
2017-09-14T14:46:32.000Z
2018-02-03T15:54:05.000Z
#include <h2/xen/sysctl.h> #include <h2/xen/noxs.h> int h2_xen_sysctl_create(h2_xen_ctx* ctx, h2_guest* guest, h2_xen_dev_sysctl* sysctl) { int ret = EINVAL; #ifdef CONFIG_H2_XEN_NOXS if (ctx->noxs.active && guest->hyp.guest.xen->noxs.active) { ret = h2_xen_noxs_sysctl_create(ctx, guest, sysctl); } #endif return ret; } int h2_xen_sysctl_destroy(h2_xen_ctx* ctx, h2_guest* guest, h2_xen_dev_sysctl* sysctl) { int ret = EINVAL; #ifdef CONFIG_H2_XEN_NOXS if (ctx->noxs.active && guest->hyp.guest.xen->noxs.active) { ret = h2_xen_noxs_sysctl_destroy(ctx, guest, sysctl); } #endif return ret; }
21.566667
86
0.689335
0a27ff29e9b9936042dac65ae22685e109785dbc
196
ts
TypeScript
src/entities/Friendship.ts
danielpalmares/foodie-backend
b122ff452dbcb0759e1bc699a1fc5d80a23688e1
[ "MIT" ]
null
null
null
src/entities/Friendship.ts
danielpalmares/foodie-backend
b122ff452dbcb0759e1bc699a1fc5d80a23688e1
[ "MIT" ]
null
null
null
src/entities/Friendship.ts
danielpalmares/foodie-backend
b122ff452dbcb0759e1bc699a1fc5d80a23688e1
[ "MIT" ]
null
null
null
export class Friendship { public readonly friendship_id: string; public user_id: string; public friend_id: string; constructor(props: Friendship) { Object.assign(this, props); } }
17.818182
40
0.719388
9c143371e5916f505edae7f9cb3e57c3905e4d36
1,201
tsx
TypeScript
src/components/LayerStack.tsx
yszk0123/layer
39c3d52e821f7e9de58175ce098e079fdc96b549
[ "MIT" ]
null
null
null
src/components/LayerStack.tsx
yszk0123/layer
39c3d52e821f7e9de58175ce098e079fdc96b549
[ "MIT" ]
null
null
null
src/components/LayerStack.tsx
yszk0123/layer
39c3d52e821f7e9de58175ce098e079fdc96b549
[ "MIT" ]
null
null
null
import React from 'react'; import { Box } from 'rebass'; import { Item, ItemPosition, EMPTY_STACK } from '../Stack'; import { Layer } from './Layer'; export function LayerStack({ stack, onDropItem, onDropLayer, onAddLayer, onRemoveLayer, onAddItem, onRemoveItem, onUpdateText, }: { stack: Item[][]; onAddLayer: (layerIndex: number) => void; onRemoveLayer: (layerIndex: number) => void; onAddItem: (position: ItemPosition) => void; onRemoveItem: (position: ItemPosition) => void; onDropItem: (src: ItemPosition, dest: ItemPosition) => void; onDropLayer: (src: number, dest: number) => void; onUpdateText: (text: string, position: ItemPosition) => void; }) { return ( <Box> {(stack.length === 0 ? EMPTY_STACK : stack).map((items, i) => { return ( <Layer key={i} items={items} index={i} onAddLayer={onAddLayer} onRemoveLayer={onRemoveLayer} onAddItem={onAddItem} onRemoveItem={onRemoveItem} onDropItem={onDropItem} onDropLayer={onDropLayer} onUpdateText={onUpdateText} /> ); })} </Box> ); }
26.108696
69
0.588676
7423d521e2d2e8b66d7c3008d28851b19586f543
1,222
rs
Rust
examples/traverse_comment_tree.rs
Hyde46/reddit_api_rs
036010d95123a804a6f8100ced2d37b29c3260ec
[ "MIT" ]
4
2020-07-24T10:59:17.000Z
2021-08-31T15:27:42.000Z
src/bin.rs
Hyde46/reddit_api_rs
036010d95123a804a6f8100ced2d37b29c3260ec
[ "MIT" ]
null
null
null
src/bin.rs
Hyde46/reddit_api_rs
036010d95123a804a6f8100ced2d37b29c3260ec
[ "MIT" ]
null
null
null
extern crate rsreddit; use rsreddit::client::Reddit; use rsreddit::model::listing::Listing; use rsreddit::model::listing::ListingCollection; fn main() { // Get Comment Tree for a thread by its permalink let reddit = Reddit::default().build(); let tree = reddit .thread_by_permalink("/r/rust/comments/hwuvmf/swc_now_works_with_stable_rustc/") .unwrap(); print_comment_tree(&tree); } fn print_comment_tree(tree: &ListingCollection) { //print Thread Title println!( "Title: {}", tree.listings[0].data.children[0] .data .title .as_ref() .unwrap() ); //Print comments recursivley travers_comment_tree(&tree.listings[1], 0); } fn travers_comment_tree(comment: &Listing, tab_count: usize) { comment.data.children.iter().for_each(|c| { //Generate right amount if identation let tabs = std::iter::repeat(" ").take(tab_count).collect::<String>(); //Print comment println!("{}>{}", tabs, c.data.body.as_ref().unwrap()); //Go a level deeper if let Some(replies) = &c.data.replies { travers_comment_tree(replies, tab_count + 1); } }); }
29.095238
88
0.61293
c6c679ce5b85432a2f909cfb94f2037bad9f06cd
395
rb
Ruby
app.rb
smichaelrogers/play-alpha
0e4affbb433279ea2d7b3c68420c6f22ea97184a
[ "MIT" ]
1
2018-04-24T00:40:20.000Z
2018-04-24T00:40:20.000Z
app.rb
smichaelrogers/play-alpha
0e4affbb433279ea2d7b3c68420c6f22ea97184a
[ "MIT" ]
null
null
null
app.rb
smichaelrogers/play-alpha
0e4affbb433279ea2d7b3c68420c6f22ea97184a
[ "MIT" ]
null
null
null
require 'rubygems' require 'bundler' Bundler.require(:default, (ENV['RACK_ENV'] || 'development').to_sym) require './lib/alpha' get '/' do erb :index, layout: false end post '/search' do content_type :json @alpha = Alpha::Search.new unless params[:fen] && @alpha.load_position(params[:fen]) @alpha.load_position end @alpha.find_move(duration: 1.0) @alpha.data.to_json end
17.954545
68
0.691139
b8fce7bd545cb15a0aacbee18a9be1dc5f8f942b
1,002
sql
SQL
db/db(sql)/BACKGROUNDIMAGE.sql
whatsgirl/backend-platform
fd24cf661b11412a589e565fe364ad60b123b544
[ "Apache-2.0" ]
3
2018-05-11T08:41:07.000Z
2018-05-11T09:09:21.000Z
db/db(sql)/BACKGROUNDIMAGE.sql
whatsgirl/backend-platform
fd24cf661b11412a589e565fe364ad60b123b544
[ "Apache-2.0" ]
null
null
null
db/db(sql)/BACKGROUNDIMAGE.sql
whatsgirl/backend-platform
fd24cf661b11412a589e565fe364ad60b123b544
[ "Apache-2.0" ]
null
null
null
INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (1, 271, 134, 'background/gxzdhdd.jpg', NULL, '1'); INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (2, 271, 134, 'background/gxzdhdd.jpg', NULL, '1'); INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (3, 271, 134, 'background/gxzdhdd.jpg', NULL, '1'); INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (4, 271, 134, 'background/gxzdhdd.jpg', NULL, '1'); INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (5, 271, 134, 'background/gxzdhdd.jpg', NULL, '1'); INSERT INTO `BACKGROUNDIMAGE` (`BACKGROUNDIMAGE_ID`, `WIDTH`, `HEIGHT`, `IMAGEURL`, `IMAGEDESC`, `STATUS`) VALUES (6, 271, 134, 'background/gxzdhdd.jpg', NULL, '1');
143.142857
166
0.688623
18bbf3347a85c5e48b9759d0b3b36a9b060a4bac
430
rb
Ruby
app/helpers/safe_params_helper.rb
Peerapat132/gitlabhq
751217987b0782115140e4c2858d91a4b596463a
[ "MIT" ]
2
2019-01-30T21:24:21.000Z
2019-04-16T19:51:09.000Z
app/helpers/safe_params_helper.rb
Peerapat132/gitlabhq
751217987b0782115140e4c2858d91a4b596463a
[ "MIT" ]
42
2019-08-12T15:43:34.000Z
2022-02-26T05:02:17.000Z
app/helpers/safe_params_helper.rb
Peerapat132/gitlabhq
751217987b0782115140e4c2858d91a4b596463a
[ "MIT" ]
1
2020-11-04T05:26:10.000Z
2020-11-04T05:26:10.000Z
# frozen_string_literal: true module SafeParamsHelper # Rails 5.0 requires to permit `params` if they're used in url helpers. # Use this helper when generating links with `params.merge(...)` # rubocop: disable CodeReuse/ActiveRecord def safe_params if params.respond_to?(:permit!) params.except(:host, :port, :protocol).permit! else params end end # rubocop: enable CodeReuse/ActiveRecord end
26.875
73
0.713953
ac9d002eb188da84367dad5a649a58583ef9db26
1,711
kt
Kotlin
app/src/main/java/com/example/glidetest/api/Service.kt
dangkhai98nd/MovieApp
7ebbeab3ca4637f8178f979750861d2d7972f49f
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/example/glidetest/api/Service.kt
dangkhai98nd/MovieApp
7ebbeab3ca4637f8178f979750861d2d7972f49f
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/example/glidetest/api/Service.kt
dangkhai98nd/MovieApp
7ebbeab3ca4637f8178f979750861d2d7972f49f
[ "Apache-2.0" ]
null
null
null
package com.example.glidetest.api import com.example.glidetest.BuildConfig import com.example.glidetest.Models.ApiImages import com.example.glidetest.Models.ApiVideos import com.example.retrofittest.Models.ApiMovies import com.example.retrofittest.Models.Movie import io.reactivex.Observable import retrofit2.Call import retrofit2.http.GET import retrofit2.http.Path import retrofit2.http.Query interface Service { @GET("movie/upcoming") fun getApiMoviesUpcoming( @Query("page") page : Int = 1, @Query("api_key") api_key : String = BuildConfig.API_KEY ) : Call<ApiMovies> @GET ("movie/popular") fun getApiMoviesPopular( @Query("page") page : Int = 1, @Query("api_key") api_key : String = BuildConfig.API_KEY ) : Call<ApiMovies> @GET("movie/now_playing") fun getApiMovies( @Query("page") page : Int = 1, @Query("api_key") api_key : String = BuildConfig.API_KEY ) : Call<ApiMovies> @GET("movie/{id}") fun getApiMovieDetail(@Path("id") movieID : Int, @Query("api_key") api_key: String = BuildConfig.API_KEY ) : Call<Movie> @GET("movie/{id}/videos") fun getApiMovieVideos( @Path("id") movieID: Int, @Query("api_key") api_key: String = BuildConfig.API_KEY ) : Call<ApiVideos> @GET("/3/movie/{id}/images") // wtf??? fun getApiImages( @Path("id") movieID: Int, @Query("api_key") api_key: String = BuildConfig.API_KEY ) : Call<ApiImages> @GET("movie/now_playing") fun getApiMoviesObservable( @Query("page") page : Int = 1, @Query("api_key") api_key : String = BuildConfig.API_KEY ) : Observable<ApiMovies> }
31.109091
75
0.656341
e512e7fa32f09455c84d01d97cac03bfafb49fd8
10,326
kt
Kotlin
app/src/main/java/com/fisma/trinity/util/AppSettings.kt
linuxaddict89/trinitylauncher
75941780de6bd356ba9321021abb9e44a4bdb38c
[ "Apache-2.0" ]
1
2019-12-16T18:02:39.000Z
2019-12-16T18:02:39.000Z
app/src/main/java/com/fisma/trinity/util/AppSettings.kt
linuxaddict89/trinitylauncher
75941780de6bd356ba9321021abb9e44a4bdb38c
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/fisma/trinity/util/AppSettings.kt
linuxaddict89/trinitylauncher
75941780de6bd356ba9321021abb9e44a4bdb38c
[ "Apache-2.0" ]
null
null
null
package com.fisma.trinity.util import android.annotation.SuppressLint import android.content.Context import android.graphics.Color import androidx.core.content.ContextCompat import com.fisma.trinity.TrinityApplication import com.fisma.trinity.R import com.fisma.trinity.api.WeatherServiceProvider import com.fisma.trinity.manager.Settings import com.fisma.trinity.widgets.AppDrawerController import com.fisma.trinity.widgets.PagerIndicator import net.gsantner.opoc.preference.SharedPreferencesPropertyBackend import java.text.SimpleDateFormat import java.util.ArrayList import java.util.Locale class AppSettings(context: Context) : SharedPreferencesPropertyBackend(context, "app") { companion object { fun get(): AppSettings { return AppSettings(TrinityApplication.get() as Context) } } val desktopColumnCount: Int get() = getInt(R.string.pref_key__desktop_columns, 4) val desktopRowCount: Int get() = getInt(R.string.pref_key__desktop_rows, 6) val desktopIndicatorMode: Int get() = getIntOfStringPref(R.string.pref_key__desktop_indicator_style, PagerIndicator.Mode.DOTS) val desktopOrientationMode: Int get() = getIntOfStringPref(R.string.pref_key__desktop_orientation, 0) val desktopShowGrid: Boolean get() = getBool(R.string.pref_key__desktop_show_grid, true) val desktopFullscreen: Boolean get() = getBool(R.string.pref_key__desktop_fullscreen, false) val desktopShowIndicator: Boolean get() = getBool(R.string.pref_key__desktop_show_position_indicator, true) val desktopShowLabel: Boolean get() = getBool(R.string.pref_key__desktop_show_label, true) val searchBarEnable: Boolean get() = getBool(R.string.pref_key__search_bar_enable, true) val searchBarBaseURI: String get() = getString(R.string.pref_key__search_bar_base_uri, R.string.pref_default__search_bar_base_uri) val searchBarForceBrowser: Boolean get() = getBool(R.string.pref_key__search_bar_force_browser, false) val searchBarShouldShowHiddenApps: Boolean get() = getBool(R.string.pref_key__search_bar_show_hidden_apps, false) val userDateFormat: SimpleDateFormat @SuppressLint("SimpleDateFormat") get() { val line1 = getString(R.string.pref_key__date_bar_date_format_custom_1, rstr(R.string.pref_default__date_bar_date_format_custom_1)) val line2 = getString(R.string.pref_key__date_bar_date_format_custom_2, rstr(R.string.pref_default__date_bar_date_format_custom_2)) try { return SimpleDateFormat("$line1'\n'$line2".replace("''", ""), Locale.getDefault()) } catch (ex: Exception) { return SimpleDateFormat("'Invalid pattern''\n''Invalid Pattern'") } } val desktopDateMode: Int get() = getIntOfStringPref(R.string.pref_key__date_bar_date_format_type, 1) val desktopDateTextColor: Int get() = getInt(R.string.pref_key__date_bar_date_text_color, Color.WHITE) val desktopBackgroundColor: Int get() = getInt(R.string.pref_key__desktop_background_color, Color.TRANSPARENT) val desktopFolderColor: Int get() = getInt(R.string.pref_key__desktop_folder_color, Color.parseColor("#ff3d3d3d")) val desktopInsetColor: Int get() = getInt(R.string.pref_key__desktop_inset_color, ContextCompat.getColor(_context, R.color.transparent)) val minibarBackgroundColor: Int get() = getInt(R.string.pref_key__minibar_background_color, ContextCompat.getColor(_context, R.color.colorPrimary)) val desktopIconSize: Int get() = iconSize val dockEnable: Boolean get() = getBool(R.string.pref_key__dock_enable, true) val dockColumnCount: Int get() = getInt(R.string.pref_key__dock_columns, 5) val dockRowCount: Int get() = getInt(R.string.pref_key__dock_rows, 1) val dockShowLabel: Boolean get() = getBool(R.string.pref_key__dock_show_label, false) val dockColor: Int get() = getInt(R.string.pref_key__dock_background_color, Color.TRANSPARENT) val dockIconSize: Int get() = iconSize val drawerColumnCount: Int get() = getInt(R.string.pref_key__drawer_columns, 4) val drawerRowCount: Int get() = getInt(R.string.pref_key__drawer_rows, 6) val drawerStyle: Int get() = getIntOfStringPref(R.string.pref_key__drawer_style, AppDrawerController.Mode.GRID) val drawerShowCardView: Boolean get() = getBool(R.string.pref_key__drawer_show_card_view, true) val drawerRememberPosition: Boolean get() = getBool(R.string.pref_key__drawer_remember_position, true) val drawerShowIndicator: Boolean get() = getBool(R.string.pref_key__drawer_show_position_indicator, true) val drawerShowLabel: Boolean get() = getBool(R.string.pref_key__drawer_show_label, true) val drawerBackgroundColor: Int get() = getInt(R.string.pref_key__drawer_background_color, rcolor(R.color.darkTransparent)) val drawerCardColor: Int get() = getInt(R.string.pref_key__drawer_card_color, Color.WHITE) val drawerLabelColor: Int get() = getInt(R.string.pref_key__drawer_label_color, Color.BLACK) val drawerFastScrollColor: Int get() = getInt(R.string.pref_key__drawer_fast_scroll_color, ContextCompat.getColor(Settings.appContext(), R.color.materialRed)) val gestureFeedback: Boolean get() = getBool(R.string.pref_key__gesture_feedback, true) val gestureDockSwipeUp: Boolean get() = getBool(R.string.pref_key__gesture_quick_swipe, true) val gestureDoubleTap: Any? get() = getGesture(R.string.pref_key__gesture_double_tap) val gestureSwipeUp: Any? get() = getGesture(R.string.pref_key__gesture_swipe_up) val gestureSwipeDown: Any? get() = getGesture(R.string.pref_key__gesture_swipe_down) val gesturePinch: Any? get() = getGesture(R.string.pref_key__gesture_pinch) val gestureUnpinch: Any? get() = getGesture(R.string.pref_key__gesture_unpinch) val theme: String get() = getString(R.string.pref_key__theme, "1") val primaryColor: Int get() = getInt(R.string.pref_key__primary_color, _context.resources.getColor(R.color.colorPrimary)) val iconSize: Int get() = getInt(R.string.pref_key__icon_size, 52) var iconPack: String get() = getString(R.string.pref_key__icon_pack, "") set(value) = setString(R.string.pref_key__icon_pack, value) // invert the value because it is used as a duration val animationSpeed: Int get() = 100 - getInt(R.string.pref_key__overall_animation_speed_modifier, 84) val language: String get() = getString(R.string.pref_key__language, "") // internal preferences below here var dashboardEnable: Boolean get() = getBool(R.string.pref_key__minibar_enable, true) set(value) = setBool(R.string.pref_key__minibar_enable, value) var searchUseGrid: Boolean get() = getBool(R.string.pref_key__desktop_search_use_grid, false) set(enabled) = setBool(R.string.pref_key__desktop_search_use_grid, enabled) var hiddenAppsList: ArrayList<String> get() = getStringList(R.string.pref_key__hidden_apps) set(value) = setStringList(R.string.pref_key__hidden_apps, value) var desktopPageCurrent: Int get() = getInt(R.string.pref_key__desktop_current_position, 0) set(value) = setInt(R.string.pref_key__desktop_current_position, value) var desktopLock: Boolean get() = getBool(R.string.pref_key__desktop_lock, false) set(value) = setBool(R.string.pref_key__desktop_lock, value) // MUST be committed var appRestartRequired: Boolean get() = getBool(R.string.pref_key__queue_restart, false) @SuppressLint("ApplySharedPref") set(value) { _prefApp.edit().putBoolean(_context.getString(R.string.pref_key__queue_restart), value).commit() } var enableBlur: Boolean get() = getBool("pref_key__enable_blur", true) set(value) { _prefApp.edit().putBoolean("pref_key__enable_blur", value).commit() } var blurRadius: Float get() = getFloat("pref_key__blur_radius", 1f) set(value) { _prefApp.edit().putFloat("pref_key__blur_radius", value).commit() } /** * Weather Settings * */ var weatherProvider: WeatherServiceProvider.WeatherProvider get() = WeatherServiceProvider.WeatherProvider.valueOf(getString(R.string.pref_key__weather_provider, "OpenWeatherMap")) set(value) { _prefApp.edit().putString(context.getString(R.string.pref_key__weather_provider), value.toString()).commit() } var weatherCityName: String get() = getString(R.string.pref_key__weather_city, "Balikpapan") set(value) { _prefApp.edit().putString(context.getString(R.string.pref_key__weather_city), value).commit() } var weatherLastFetch: Long get() = getLong(R.string.pref_key__weather_last_fetch, 0) set(value) { _prefApp.edit().putLong(context.getString(R.string.pref_key__weather_last_fetch), value).commit() } var weatherForecastLastFetch: Long get() = getLong(R.string.pref_key__weather_forecast_last_fetch, 0) set(value) { _prefApp.edit().putLong(context.getString(R.string.pref_key__weather_forecast_last_fetch), value).commit() } var weatherUpdateInterval: Long get() = getLong(R.string.pref_key__weather_update_interval, 60000 /*1 minute*/) set(value) { _prefApp.edit().putLong(context.getString(R.string.pref_key__weather_update_interval), value).commit() } // MUST be committed var appFirstLaunch: Boolean get() = getBool(R.string.pref_key__first_start, true) @SuppressLint("ApplySharedPref") set(value) { _prefApp.edit().putBoolean(_context.getString(R.string.pref_key__first_start), value).commit() } fun getGesture(key: Int): Any? { // return either ActionItem or IntentUtil val result = getString(key, "") var gesture: Any? = LauncherAction.getActionItem(result) // no action was found so it must be an intent string if (gesture == null) { gesture = IntentUtil.getIntentFromString(result) if (AppManager.getInstance(_context)!!.findApp(gesture) == null) gesture = null } // reset the setting if invalid value if (gesture == null) { setString(key, null) } return gesture } @SuppressLint("ApplySharedPref") fun setAppShowIntro(value: Boolean) { // MUST be committed _prefApp.edit().putBoolean(_context.getString(R.string.pref_key__show_intro), value).commit() } }
34.535117
137
0.748596
fe0a25d8e63ab8935e62a6665f12857b6494817e
4,139
c
C
MAIN.c
incredible-India/stone-paper-game-in-c
d898d8b110fe3762d64efc2214a99f41a43c71d6
[ "Apache-2.0" ]
1
2020-11-24T07:20:07.000Z
2020-11-24T07:20:07.000Z
MAIN.c
incredible-India/stone-paper-game-in-c
d898d8b110fe3762d64efc2214a99f41a43c71d6
[ "Apache-2.0" ]
null
null
null
MAIN.c
incredible-India/stone-paper-game-in-c
d898d8b110fe3762d64efc2214a99f41a43c71d6
[ "Apache-2.0" ]
null
null
null
#include<stdio.h> #include<windows.h> #include<conio.h> #define ENTER 13 #define TAB 9 #define BKSP 8 #define ESC 27 void goback(void); void instruct(void); void gotoxy(int ,int); void game(void); int main() { char ch; gotoxy(40,12); system("color 0a"); printf("Welcome TO THIS GAME"); gotoxy(40,16); printf("PRESS ANY KEY TO CONTINUE"); getch(); read: system("cls"); gotoxy(40,12); printf("1: PLAY GAME "); gotoxy(40,16); printf("2 : <-- EXIT"); { char op; op=getch(); if(op=='1') { game(); } else if(op=='2') { system("cls"); system("color 71"); gotoxy(40,12); printf("THANX FOR VISITING US"); getch(); exit(0); } else{ printf("\a"); goto read; } } } void instruct(void) { FILE *p; p=fopen("instruct.dat","r"); char ch[100]; while(fgets(ch,9,p)!=NULL) printf("%s",ch); fclose(p); } void gotoxy(int a,int b) { COORD x; x.X=a; x.Y=b; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),x); } void game(void) { int k; char op,op2; srand(k); k=rand()%2; for(;;) { system("color 0a"); system("cls"); printf("P : PAPER\n"); printf("\nC : SCISSORE\n"); printf("\nS: STONE"); gotoxy(40,12); printf("YOUR CHOICE=> "); op=getch(); if(op=='s') { gotoxy(55,12); printf("STONE"); if(k==0) { gotoxy(43,16); printf("COMPUTER=> PAPER\n"); gotoxy(43,20); printf("YOU LOSE!!!"); system("color 0c"); }else if(k==1) { gotoxy(43,16); printf("COMPUTER=> SCISSORE\n"); gotoxy(43,20); printf("YOU won!!!"); }else { game(); }} else if(op=='p') { gotoxy(55,12); printf("PAPER"); if(k==0) { gotoxy(43,16); printf("COMPUTER=> SCISSORE\n"); gotoxy(43,20); printf("YOU LOSE!!!"); system("color 0c"); }else if(k==1) { gotoxy(43,16); printf("COMPUTER=> STONE\n"); gotoxy(43,20); printf("YOU won!!!"); }else { game(); } } else if(op=='c') { gotoxy(55,12); printf(" SCISSORE"); if(k==0) { gotoxy(43,16); printf("COMPUTER=> PAPER\n"); gotoxy(43,20); printf("YOU WIN!!!"); }else if(k==1) { gotoxy(43,16); printf("COMPUTER=> STONE\n"); gotoxy(43,20); printf("YOU LOSE!!!"); system("color 0c"); } else { game(); } }else { printf("\a"); game(); } goback(); } } void goback(void) { char ch; gotoxy(70,1); printf("PRESS <ENTER> TO CONTINUE"); gotoxy(70,3); printf(" PRESS <BACK_SPACE> TO GO BACK"); gotoxy(70,5); printf("PRESS <ESC> TO GO EXIT"); ch=getch(); if(ch==ENTER) { game(); }else if(ch==ESC) { system("cls"); system("color 72"); gotoxy(40,12); printf("BYE BYE WILL MEET AGAIN"); getch(); exit(0); }else if(ch==BKSP) { system("cls"); main(); } else{ printf("\a"); goback(); } }
18.986239
65
0.366755
c3293f1decd95f777d1b37dc6dd453265efab535
2,025
rs
Rust
src/lib.rs
Kerndog73/The-Fat-Controller
b088f611c44bea76b0b92c40f094a7e9cc0004e5
[ "Apache-2.0", "MIT" ]
28
2021-02-11T00:26:56.000Z
2022-03-25T10:40:47.000Z
src/lib.rs
Kerndog73/The-Fat-Controller
b088f611c44bea76b0b92c40f094a7e9cc0004e5
[ "Apache-2.0", "MIT" ]
4
2021-02-26T11:02:03.000Z
2022-02-05T01:33:16.000Z
src/lib.rs
Kerndog73/The-Fat-Controller
b088f611c44bea76b0b92c40f094a7e9cc0004e5
[ "Apache-2.0", "MIT" ]
1
2021-02-27T04:39:01.000Z
2021-02-27T04:39:01.000Z
//! The core of TFC is the [`Context`]. To start generating fake input events, //! you'll need to create a context. The context by itself is basically useless //! unless you import the [`traits`]. The trait methods return an [`Error`] if //! something goes wrong. Bringing these three things together, we end up with //! this. //! //! ```no_run //! use std::{thread, time::Duration}; //! use tfc::{Context, Error, traits::*}; //! //! fn main() -> Result<(), Error> { //! let mut ctx = Context::new()?; //! // For OS-specific reasons, it's necessary to wait a moment after //! // creating the context before generating events. //! thread::sleep(Duration::from_millis(10)); //! ctx.unicode_string("Hello world!") //! } //! ``` //! //! In addition to the context and its traits, there is also [`Command`]. This //! represents an action to perform on the context. It's possible to serialize a //! command, send it over a network, deserialize it and then execute it. In //! fact, this is what [TFC-server](https://crates.io/crates/tfc-server) does. mod command; #[macro_use] mod r#enum; mod command_code; mod generic_error; mod key; mod mouse_button; mod utils; pub use command::*; pub use r#enum::*; pub use command_code::*; pub use generic_error::*; pub use key::*; pub use mouse_button::*; /// A collection of traits that [`Context`] implements. pub mod traits; pub use traits::*; #[cfg(target_os = "linux")] mod linux_common; #[cfg(all(target_os = "linux", not(x11)))] mod linux_wayland; #[cfg(all(target_os = "linux", not(x11)))] pub use linux_wayland::Context; #[cfg(all(target_os = "linux", x11))] mod linux_x11; #[cfg(all(target_os = "linux", x11))] pub use linux_x11::Context; #[cfg(target_os = "macos")] mod macos; #[cfg(target_os = "macos")] pub use macos::Context; #[cfg(target_os = "windows")] mod windows; #[cfg(target_os = "windows")] pub use windows::Context; /// Convenience type alias for [`GenericError`]. pub type Error = GenericError<<Context as FallibleContext>::PlatformError>;
28.928571
80
0.678025
2da1c0ec779633142c70b9d9c5abc3faaa7a078a
4,868
lua
Lua
authentication/players.lua
violencedev/cegui-authentication
c14f3db9aee44a8dd8dcb23070ae61055779637f
[ "MIT" ]
5
2021-12-19T19:36:43.000Z
2022-02-14T18:24:32.000Z
authentication/players.lua
violencedev/cegui-authentication
c14f3db9aee44a8dd8dcb23070ae61055779637f
[ "MIT" ]
null
null
null
authentication/players.lua
violencedev/cegui-authentication
c14f3db9aee44a8dd8dcb23070ae61055779637f
[ "MIT" ]
1
2021-12-29T23:36:00.000Z
2021-12-29T23:36:00.000Z
local db = exports["database"]:getConnection() addEventHandler('onPlayerJoin', root, function() outputChatBox('#0000FF[!] #FFFFFFSunucuya hoş geldiniz!', source, 0, 255, 0, true) spawnPlayer(source, 0, 5, 0) fadeCamera(source, true, 12) triggerClientEvent(source, 'logIn:interface', source) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) setPlayerHudComponentVisible(source, "radar", false) end) addEventHandler('onResourceStart', resourceRoot, function() outputDebugString('[authentication] kullanici hesaplari yukleniyor...') dbQuery(function(qH) local results = dbPoll(qH, 0) local i = 0 for _,v in pairs(results) do i = i + 1 table.insert(accounts, {id=v.id, username=v.username, password=v.password, email=v.email, serial=v.serial, ip=v.ip}) end setElementData(root, 'toplam:ac:loaded', i) end, db, 'SELECT * FROM accounts') outputDebugString('[authentication] toplam ' .. (tostring(getElementData(root, 'toplam:ac:loaded')) or "0") .. ' hesap basariyla yuklendi.') setElementData(root, 'toplam:ac:loaded', nil) if getElementData(root, 'toplam:ac:loaded') == 0 or getElementData(root, 'toplam:ac:loaded') == false then restartResource(getThisResource()) end end) addEvent('join:to:server', true) addEventHandler('join:to:server', root, function() setCameraTarget(client, client) fadeCamera(client, true, 3) outputChatBox('#0000FF[!] #FFFFFF' .. getElementData(client, 'account:username') .. ' isimli hesaba başarıyla giriş yaptınız.', client, 0, 255, 0, true) end) addEvent('kickHimup', true) addEventHandler('kickHimup', root, function(player) kickPlayer(player, player, 'Hesabiniza baska bir yerden erisim saglandi.') end) function register_attempt(kullaniciadi, sifre) if not isUSExists(kullaniciadi) == true then if string.len(sifre) > 4 then local serial, ip = getPlayerSerial(client), getPlayerIP(client) dbExec(db, 'INSERT INTO accounts(username, password, email, serial, ip) VALUES(?, ?, ?, ?, ?)', kullaniciadi, tostring(sifre), "", getPlayerSerial(client), getPlayerIP(client)) dbQuery(function(qH) local results = dbPoll(qH, 0) local id = results[1].id outputChatBox(id) table.insert(accounts, {id=id, username=kullaniciadi, password=sifre, email="", serial=serial, ip=ip}) end, db, "SELECT * FROM accounts ORDER BY id DESC LIMIT 1") redirect_to_sw(kullaniciadi, sifre, client) end end end addEvent('register:attempt', true) addEventHandler('register:attempt', root, register_attempt) function redirect_to_sw(kullaniciadi, sifre, pl) if isAccountExists(kullaniciadi, sifre) == true then -- giriş yaptır --setElementData(client, 'id', getAccountIDFromInfo(kullaniciadi, sifre)) -- id ayarlandı setElementData(pl, 'account:username', kullaniciadi) dbQuery(function(qH) local results = dbPoll(qH, 0) for k, v in pairs(results) do if v.username == kullaniciadi then setElementData(pl, 'money', (tonumber(v.money) or 0)) end end end, db, 'SELECT * FROM accounts') --setElementData(pl, 'oynadigi:hesap', getAccountObject(kullaniciadi, sifre)) triggerClientEvent(pl, 'recome:player', client) end end addEvent('redirect:player', true) addEventHandler('redirect:player', root, redirect_to_sw) function getAccountObject(username, password) for _,v in pairs(accounts) do if v.username == username and v.password ~= password then return v end end end function getAccountIDFromInfo(username, password) for _,v in pairs(accounts) do if v.username == username then if v.password ~= password then return (v.id) end end end end function anotherOneisPlayingInThatAccount(username, password) for _,v in pairs(getElementsByType('player')) do if getElementData(v, 'id') ~= getAccountIDFromInfo(username, password) then return v end end end function isUSExists(username) for _,v in pairs(accounts) do if v.username == username then return true end end end function isAccountExists(username, password) for _,v in pairs(accounts) do if v.username == username then if tostring(v.password) == tostring(password) then return true end end end end
38.330709
189
0.63106
9bad7b6079436b1561d1aab348d9fbd5964d8686
8,011
js
JavaScript
scan-service.js
Reshift-Security/npm_plugin
64790ac0cf1056a8f0ce00a5c0ab61716c78144d
[ "MIT" ]
null
null
null
scan-service.js
Reshift-Security/npm_plugin
64790ac0cf1056a8f0ce00a5c0ab61716c78144d
[ "MIT" ]
2
2021-06-17T11:43:03.000Z
2021-06-17T15:51:25.000Z
scan-service.js
Reshift-Security/npm_plugin
64790ac0cf1056a8f0ce00a5c0ab61716c78144d
[ "MIT" ]
1
2021-06-17T03:21:25.000Z
2021-06-17T03:21:25.000Z
'use strict'; const fs = require('fs'); const request = require('request').defaults({ followRedirect: true, followAllRedirects: true, jar:true }); const urljoin = require('url-join'); const assert = require('assert'); const util = require('util'); const validUrl = require('valid-url'); const prettyMilliseconds = require('pretty-ms'); const packageInfo = require('./package.json'); const logger = require('./logger.js'); class ScanService { constructor(host, timeoutSeconds, language, logLevel){ assert(validUrl.isUri(host), 'invalid host for scan service'); this.serviceHost = host; this.serviceTimeoutMS = timeoutSeconds * 1000; this.language = language; this.serviceRequestIntervalMS = 7000; this.requester_info = util.format('%s:%s', packageInfo.name, packageInfo.version); this.log = new logger.Logger(logLevel, true, true); this.log.info(util.format('Reshift CLI version: %s', packageInfo.version)); this.log.debug(util.format('Current timezone: %s', Intl.DateTimeFormat().resolvedOptions().timeZone)); this.log.debug(util.format('Scanner service initialized for %s', language)); } sendRequest(requestOptions, parseJSON = true) { return new Promise((resolve, reject) => { request(requestOptions, (error, response, body) => { var isFailed = false; var responseCode = 1; if (error) { this.log.error("Unable to perform request to reshift server."); responseCode=521 userMessage=util.format("Connection refused: %s", this.serviceHost) isFailed = true; } else { if (response && response.statusCode >= 300) { isFailed = true; responseCode = response.statusCode; } var jsonBody = {}; var userMessage = response.statusMessage; try { jsonBody = JSON.parse(body); if (jsonBody.scanMessage) { userMessage = jsonBody.scanMessage; } } catch(e) { jsonBody = {}; userMessage = response.statusMessage; } } if (isFailed) { this.log.error(util.format('<%s> %s', responseCode, userMessage)); resolve({}); } else if (parseJSON) { resolve(jsonBody); } resolve(body); }); }); } buildRequestOptions(uri, method = 'GET', data = {}) { return { method: method, uri: uri, headers: { "Content-Type": "application/x-www-form-urlencoded" }, formData: data }; } printTotals(scanResponse) { this.log.debug('Printing scan summary results'); if (scanResponse.details) { console.log('================ Reshift Security report summary:'); console.log(util.format(' Critical: %s', scanResponse.details.critical.total)); console.log(util.format(' High: %s', scanResponse.details.high.total)); console.log(util.format(' Moderate: %s', scanResponse.details.moderate.total)); console.log(util.format(' Low: %s', scanResponse.details.low.total)); console.log('================'); } if (scanResponse.reportUrl) { console.log(util.format('View full report: %s', scanResponse.reportUrl)); } } async getScanStatus(statusUrl, token, currentStatus, attemptCounter = 1, overtimeNotice = true, tail = true) { this.log.debug('Fetching scan status...'); const executionTime = this.serviceRequestIntervalMS * attemptCounter; if (executionTime > this.serviceTimeoutMS) { if (overtimeNotice) { this.log.info('Scan is still running. Execution time is taking a little longer than expected...'); // Display notice only once overtimeNotice = false; } } assert(statusUrl, 'invalid status url'); const statusResponse = await this.sendRequest( this.buildRequestOptions( statusUrl, 'GET', { token: token }) ); if (statusResponse.scanStatus) { const scanStatus = statusResponse.scanStatus; this.log.debug(util.format('Latest scan status: %s', scanStatus)); switch(scanStatus) { case 'FAILED': this.log.error(statusResponse.scanMessage); return false; case 'COMPLETE': this.log.info('Scan completed. Login to reshift dashboard to view report details.'); this.printTotals(statusResponse); if (statusResponse.policyStatus === null) { this.log.warn('Was not able to retrieve security report summary. Login to Reshift for report details.'); } else if (!statusResponse.policyStatus) { this.log.error('RESHIFT SECURITY: Project failed security gate thresholds.'); return false; } return true; default: if (scanStatus !== currentStatus) { this.log.debug(util.format('Scan status changed %s', scanStatus)); this.log.info(util.format('%s %s', scanStatus, statusResponse.scanMessage)); } if (tail) { await new Promise(r => setTimeout(r, this.serviceRequestIntervalMS)); return await this.getScanStatus(statusUrl, token, scanStatus, attemptCounter+1, overtimeNotice); } return true; } } this.log.debug('Unable to get scan status.'); return false } async executeScan(token, projectProviderUrl, branch, commitHash, nonblocking) { assert(token, 'invalid token'); assert(branch, 'invalid request body'); assert(commitHash, 'invalid commit hash'); assert(projectProviderUrl, 'project provider url required'); this.log.debug('Scan request validated'); const requestUrl = new URL(urljoin(this.serviceHost, '/scan/')); const scanRequestOptions = this.buildRequestOptions( requestUrl.toString(), 'POST', { token: token, branch: branch, commit_hash: commitHash, project_git_url: projectProviderUrl, language: this.language, request_source: this.requester_info } ); this.log.debug('Sending scan request'); const scanResponse = await this.sendRequest(scanRequestOptions); if(scanResponse.statusUrl) { if (!!nonblocking) { this.log.info('Scan initialized, login to Reshift for report details.'); // get the scan status with no tailing to exit right away return await this.getScanStatus(scanResponse.statusUrl, token, scanResponse.scanStatus, 1, false, false); } this.log.info('Scan initialized, executing...') return await this.getScanStatus(scanResponse.statusUrl, token, scanResponse.scanStatus); } else { this.log.error(util.format('Scan was not able to start successfully. %s', scanResponse.scanMessage)); } return false; } } module.exports = { ScanService: ScanService }
41.293814
128
0.541006
cb5f84b19fd3c7aca86264e618fb3f2fe4751836
1,470
h
C
src/io/MagicData/FileReader.h
mrchipset/Xuan-Wu
0d01b9350a86e0f08f2213bc4edd134e3af2174d
[ "Apache-2.0" ]
null
null
null
src/io/MagicData/FileReader.h
mrchipset/Xuan-Wu
0d01b9350a86e0f08f2213bc4edd134e3af2174d
[ "Apache-2.0" ]
null
null
null
src/io/MagicData/FileReader.h
mrchipset/Xuan-Wu
0d01b9350a86e0f08f2213bc4edd134e3af2174d
[ "Apache-2.0" ]
null
null
null
#ifndef IO_MAGIC_FILE_READER_H #define IO_MAGIC_FILE_READER_H #include "api.h" #include <iostream> #include <filesystem> #include <fstream> #include <exception> #include <string> #include <vector> #include "FileShared.h" namespace XuanWu { class XUANWU_API FileReader { public: FileReader(); virtual ~FileReader(); bool open(const std::string& path); bool close(); FileMetaHead fileMetaHead() const; bool getFileMetaInfo(MetaInfoBase* metaInfo); uint64_t getDataFrameCount() const; bool getDataSegmentHeadList(std::vector<SegmentItemHead>& segmentItemIndex) const; bool getDataSegmentHead(uint64_t id, SegmentItemHead* headInfo) const; bool getDataSegmentMetaInfo(uint64_t id, MetaInfoBase* metaInfo); bool getDataFrame(const SegmentItemHead& headInfo, DataFrameBase* dataFrame); bool getDataFrame(uint64_t id, DataFrameBase* dataFrame); private: std::ifstream mFileHandle; FileMetaHead mFileMetaHead; FileMetaSignature mFileMetaSignature; FileCurrentStatus mFileStatus; std::vector<SegmentItemHead> mSegmentItemIndex; std::vector<uint64_t> mSegmentPosition; bool readFileMetaHead(FileMetaHead* fileMetaHead); bool readSegmentItemIndex(std::vector<SegmentItemHead>* segmentItemIndex, std::vector<uint64_t>* segmentPosition); protected: virtual bool checkSignature(FileMetaSignature* fileMetaSignature); }; } // end namespace XuanWu #endif
25.344828
86
0.74966
3ba67922b016157239ba5a32f517dd53cc875634
181
h
C
qdata/include/util/Stream_Encoder.h
jeanleflambeur/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
36
2015-03-09T16:47:14.000Z
2021-02-04T08:32:04.000Z
qdata/include/util/Stream_Encoder.h
jeanlemotan/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
42
2017-02-11T11:15:51.000Z
2019-12-28T16:00:44.000Z
qdata/include/util/Stream_Encoder.h
jeanleflambeur/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
5
2015-10-15T05:46:48.000Z
2020-05-11T17:40:36.000Z
#pragma once namespace q { namespace util { void encode_base_64(data::Sink& sink, data::Source& source); void decode_base_64(data::Sink& sink, data::Source& source); } }
18.1
62
0.690608
0c7aac81098c986f5d8ddb73b8e89765a14cd635
6,487
py
Python
tests/test_mxnet.py
haoxintong/byteps
495f1372af5f6fd4832393d5e52d4b02b42a7a03
[ "Apache-2.0" ]
1
2019-07-01T10:08:00.000Z
2019-07-01T10:08:00.000Z
tests/test_mxnet.py
haoxintong/byteps
495f1372af5f6fd4832393d5e52d4b02b42a7a03
[ "Apache-2.0" ]
null
null
null
tests/test_mxnet.py
haoxintong/byteps
495f1372af5f6fd4832393d5e52d4b02b42a7a03
[ "Apache-2.0" ]
1
2021-02-02T02:58:37.000Z
2021-02-02T02:58:37.000Z
# Copyright 2018 Uber Technologies, Inc. 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. # ============================================================================== from __future__ import absolute_import from __future__ import division from __future__ import print_function import byteps.mxnet as bps import itertools import mxnet as mx import os import unittest from mxnet.base import MXNetError from mxnet.test_utils import same has_gpu = mx.context.num_gpus() > 0 # MLSL supports only byte, float and double data types mlsl_supported_types = set(['float32', 'float64']) class MXTest: """ Tests for ops in byteps.mxnet. """ def _current_context(self): if has_gpu: return mx.gpu(bps.local_rank()) else: return mx.current_context() def filter_supported_types(self, types): if 'MLSL_ROOT' in os.environ: types = [t for t in types if t in mlsl_supported_types] return types def test_byteps_push_pull(self): """Test that the byteps_push_pull correctly sums 1D, 2D, 3D tensors.""" bps.init() size = bps.size() dtypes = self.filter_supported_types(['float32']) dims = [1] ctx = self._current_context() count = 0 shapes = [(), (17)] for dtype, dim in itertools.product(dtypes, dims): # MXNet uses gpu_id as part of the seed, so to get identical seeds # we must set a context. mx.random.seed(10 + 10 * bps.rank(), ctx=ctx) tensor = mx.nd.random.uniform(-100, 100, shape=shapes[dim], ctx=ctx) tensor = tensor.astype(dtype) print("tensor before push_pull:", tensor) bps.byteps_declare_tensor(tensor, "tensor_" + str(count)) bps.byteps_push_pull(tensor, name="tensor_"+str(count)) tensor.wait_to_read() print("tensor after push_pull:", tensor) bps.shutdown() def test_byteps_push_pull_inplace(self): """Test that the byteps_push_pull correctly sums 1D, 2D, 3D tensors.""" bps.init() size = bps.size() dtypes = self.filter_supported_types(['int32', 'int64', 'float32', 'float64']) dims = [1, 2, 3] ctx = self._current_context() count = 0 shapes = [(), (17), (17, 17), (17, 17, 17)] for dtype, dim in itertools.product(dtypes, dims): mx.random.seed(1234, ctx=ctx) tensor = mx.nd.random.uniform(-100, 100, shape=shapes[dim], ctx=ctx) tensor = tensor.astype(dtype) multiplied = tensor * size bps.byteps_declare_tensor(tensor, "tensor_" + str(count)) bps.byteps_push_pull(tensor, name= "tensor_" + str(count)) max_difference = mx.nd.max(mx.nd.subtract(tensor, multiplied)) count += 1 # Threshold for floating point equality depends on number of # ranks, since we're comparing against precise multiplication. if size <= 3 or dtype in ['int32', 'int64']: threshold = 0 elif size < 10: threshold = 1e-4 elif size < 15: threshold = 5e-4 else: break if max_difference > threshold: print("self", count, dtype, dim, max_difference, threshold) print("tensor", bps.rank(), tensor) print("multiplied", bps.rank(), multiplied) assert max_difference <= threshold, 'bps.byteps_push_pull produces \ incorrect results for self' def test_byteps_broadcast(self): """Test that the broadcast correctly broadcasts 1D, 2D, 3D tensors.""" bps.init() rank = bps.rank() size = bps.size() # This test does not apply if there is only one worker. if size == 1: return dtypes = ['int32', 'int64', 'float32', 'float64'] dims = [1, 2, 3] ctx = self._current_context() count = 0 shapes = [(), (17), (17, 17), (17, 17, 17)] root_ranks = list(range(size)) for dtype, dim, root_rank in itertools.product(dtypes, dims, root_ranks): tensor = mx.nd.ones(shapes[dim], ctx=ctx) * rank root_tensor = mx.nd.ones(shapes[dim], ctx=ctx) * root_rank tensor = tensor.astype(dtype) root_tensor = root_tensor.astype(dtype) broadcast_tensor = bps.broadcast(tensor, root_rank=root_rank, name=str(count)) if rank != root_rank: if same(tensor.asnumpy(), root_tensor.asnumpy()): print("broadcast", count, dtype, dim, mx.nd.max(tensor == root_tensor)) print("tensor", bps.rank(), tensor) print("root_tensor", bps.rank(), root_tensor) print("comparison", bps.rank(), tensor == root_tensor) assert not same(tensor.asnumpy(), root_tensor.asnumpy()), \ 'bps.broadcast modifies source tensor' if not same(broadcast_tensor.asnumpy(), root_tensor.asnumpy()): print("broadcast", count, dtype, dim) print("broadcast_tensor", bps.rank(), broadcast_tensor) print("root_tensor", bps.rank(), root_tensor) print("comparison", bps.rank(), broadcast_tensor == root_tensor) assert same(broadcast_tensor.asnumpy(), root_tensor.asnumpy()), \ 'bps.broadcast produces incorrect broadcasted tensor' if __name__ == '__main__': mxtest = MXTest() mxtest.test_byteps_push_pull()
39.554878
80
0.564668
b16709294d5b936c6499e294b5859012f53945b1
245
h
C
Source/VisualDebugger.h
Huskitch/PhysX-Mini-Golf
519a5ceeb149106f073d5e5c840f4830305d789e
[ "MIT" ]
1
2021-01-28T09:06:07.000Z
2021-01-28T09:06:07.000Z
Source/VisualDebugger.h
Huskitch/PhysX-Mini-Golf
519a5ceeb149106f073d5e5c840f4830305d789e
[ "MIT" ]
null
null
null
Source/VisualDebugger.h
Huskitch/PhysX-Mini-Golf
519a5ceeb149106f073d5e5c840f4830305d789e
[ "MIT" ]
null
null
null
#pragma once #include "MyPhysicsEngine.h" namespace VisualDebugger { using namespace physx; ///Init visualisation void Init(const char *window_name, int width=512, int height=512); ///Start visualisation void Start(); }
15.3125
68
0.693878
7fd606110f210ac73b79729939de2ecf15ee32b1
2,553
go
Go
torrent/storage.go
danalex97/nfsTorrent
1364d920aca0c1b656cd52ab1107e35801fae83f
[ "MIT" ]
1
2019-03-12T12:34:13.000Z
2019-03-12T12:34:13.000Z
torrent/storage.go
wade-welles/CacheTorrent
1364d920aca0c1b656cd52ab1107e35801fae83f
[ "MIT" ]
38
2018-04-11T08:47:07.000Z
2018-06-20T17:51:11.000Z
torrent/storage.go
wade-welles/CacheTorrent
1364d920aca0c1b656cd52ab1107e35801fae83f
[ "MIT" ]
1
2019-03-12T12:34:10.000Z
2019-03-12T12:34:10.000Z
package torrent import ( "github.com/danalex97/nfsTorrent/config" "github.com/danalex97/nfsTorrent/log" "sync" ) var pieceNumber config.Const = config.NewConst(config.StoragePieces) // Storage is a concurrent-safe piece storage module. The synchronization is // done via a read-write lock and the pieces are stored using a map. When the // download is finished it also notifies the Configuration module. type Storage interface { Have(index int) (PieceMeta, bool) Store(Piece) Pieces() []int } type storage struct { sync.RWMutex id string pieces map[int]PieceMeta // the pieces that I have completed bool // Used for logging time func() int // Used only for monitoring percents []int percentDone []bool } func NewStorage(id string, pieces []PieceMeta, time func() int) Storage { storage := new(storage) storage.id = id storage.completed = false storage.time = time storage.pieces = make(map[int]PieceMeta) for _, p := range pieces { storage.pieces[p.Index] = p } // Used only informatively. storage.percents = []int{2, 20, 50, 70} storage.percentDone = []bool{false, false, false, false} storage.checkCompleted() return storage } // Returns if I have a piece(I have it downloaded and stored). func (s *storage) Have(index int) (PieceMeta, bool) { s.RLock() defer s.RUnlock() p, ok := s.pieces[index] return p, ok } // Store a piece from a `piece` message. func (s *storage) Store(p Piece) { s.Lock() defer s.Unlock() s.pieces[p.Index] = PieceMeta{ p.Index, p.Begin, p.Piece.Size, } s.checkCompleted() } // Return a list of all indexes of the pieces currently stored. func (s *storage) Pieces() []int { s.RLock() defer s.RUnlock() pieces := []int{} for _, piece := range s.pieces { pieces = append(pieces, piece.Index) } return pieces } func (s *storage) checkCompleted() { // Only informative. for i := range s.percents { if s.percentDone[i] == false { if len(s.pieces) > pieceNumber.Int() * s.percents[i] / 100 { s.percentDone[i] = true log.Println(s.id, "Downloaded", s.percents[i], "%") } } } if len(s.pieces) >= pieceNumber.Int() && !s.completed { // Notify logger time := s.time() log.LogCompleted(log.Completed{ Id : s.id, Time : time, }) // Callback used to interact with the simulation config.Config.SharedCallback() // Notify completed log.Println(s.id, "Completed at", time, "ms") s.completed = true } }
21.275
77
0.648257
719c8a9c1dbdf6841f65747e0fe7ee95b48d8752
210
ts
TypeScript
apps/demos/src/app/rx-angular-pocs/cdk/render-strategies/scheduling/scheduler/rxa-chunked-scheduler/RxaAction.ts
andreElrico/rx-angular
cea3b3612b09e332c8cd4a1ca9635602e9686cca
[ "MIT" ]
null
null
null
apps/demos/src/app/rx-angular-pocs/cdk/render-strategies/scheduling/scheduler/rxa-chunked-scheduler/RxaAction.ts
andreElrico/rx-angular
cea3b3612b09e332c8cd4a1ca9635602e9686cca
[ "MIT" ]
229
2021-02-01T08:52:16.000Z
2022-03-23T22:05:58.000Z
apps/demos/src/app/rx-angular-pocs/cdk/render-strategies/scheduling/scheduler/rxa-chunked-scheduler/RxaAction.ts
andreElrico/rx-angular
cea3b3612b09e332c8cd4a1ca9635602e9686cca
[ "MIT" ]
null
null
null
import { priorityLevel } from '../../../../render-strategies/model'; import { PriorityAction } from '../priority-scheduler'; export class RxaAction<S> extends PriorityAction<S, priorityLevel, undefined> { }
26.25
79
0.714286
3d551225a1a45568ec3b5b594df54d6678140cd8
744
swift
Swift
dates.swift
ggaamm/swift_samples
ef9b78b5337e13d016fb2a09312c6d95afb01813
[ "MIT" ]
null
null
null
dates.swift
ggaamm/swift_samples
ef9b78b5337e13d016fb2a09312c6d95afb01813
[ "MIT" ]
null
null
null
dates.swift
ggaamm/swift_samples
ef9b78b5337e13d016fb2a09312c6d95afb01813
[ "MIT" ]
null
null
null
// date time calender var date = Date() var calendar = Calendar.current let year = calendar.component(.year, from: date) let month = calendar.component(.month, from: date) let day = calendar.component(.day, from: date) let hour = calendar.component(.hour, from:date) let minute = calendar.component(.minute, from: date) var isoD = "\(year)-\(month)-\(day)" var isoT = "\(hour):\(minute)" // after validation let dateStr = isoD + " " + isoT let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd HH:mm" dateFormatter.locale = Locale.current //dateFormatter.dateStyle = .full //dateFormatter.timeStyle = .full let aa = dateFormatter.date(from: dateStr) ?? Date.now print(aa.formatted(date: .abbreviated, time: .shortened))
32.347826
57
0.723118
a1a549a327eaf4284685ab6eb4023825fa0afa74
7,339
h
C
benchmarking/benchmark_mf.h
abreslow/morton_filter
cb7b78846c7d779c357cdbd6be22bfdf9f0b9a70
[ "MIT" ]
74
2019-04-20T22:57:41.000Z
2022-03-31T15:29:26.000Z
benchmarking/benchmark_mf.h
abreslow/morton_filter
cb7b78846c7d779c357cdbd6be22bfdf9f0b9a70
[ "MIT" ]
4
2019-04-28T12:47:52.000Z
2021-06-24T09:57:57.000Z
benchmarking/benchmark_mf.h
abreslow/morton_filter
cb7b78846c7d779c357cdbd6be22bfdf9f0b9a70
[ "MIT" ]
13
2019-04-24T00:51:25.000Z
2020-07-11T11:43:06.000Z
/* Copyright (c) 2019 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Author: Alex D. Breslow Advanced Micro Devices, Inc. AMD Research Code Source: https://github.com/AMDComputeLibraries/morton_filter VLDB 2018 Paper: https://www.vldb.org/pvldb/vol11/p1041-breslow.pdf How To Cite: Alex D. Breslow and Nuwan S. Jayasena. Morton Filters: Faster, Space-Efficient Cuckoo Filters Via Biasing, Compression, and Decoupled Logical Sparsity. PVLDB, 11(9):1041-1055, 2018 DOI: https://doi.org/10.14778/3213880.3213884 */ #ifndef _BENCHMARK_MF_H #define _BENCHMARK_MF_H #include "compressed_cuckoo_filter.h" #include "benchmark_util.h" #include "vector_types.h" #include "benchmark_mf_config.h" // bench_mf namespace parameters defined here #include "benchmark_common.h" // slot_fraction and TBD other parameters using namespace Benchmark; using Morton_Type = CompressedCuckoo::CompressedCuckooFilter< bench_mf::slots_per_bucket, bench_mf::fingerprint_len_bits, bench_mf::ota_len_bits, bench_mf::block_size_bits, // block size bench_mf::target_compression_ratio_sfp, bench_mf::read_counters_method, bench_mf::read_fingerprints_method, bench_mf::reduction_method, bench_mf::alternate_bucket_selection_method, bench_mf::morton_ota_hashing_method, bench_mf::resizing_enabled, // can the table resize? bench_mf::remap_enabled, // remapping of items from first bucket enabled bench_mf::collision_resolution_enabled, // collision resolution enabled bench_mf::morton_filter_functionality_enabled, bench_mf::block_fullness_array_enabled, // Block fullness array enabled bench_mf::handle_conflicts, // Handle conflicts on insertions enabled bench_mf::fingerprint_comparison_method >; template<uint64_t fingerprint_len_bits> double benchmark_insertions(uint64_t total_slots, double target_lf){ Morton_Type cf(total_slots); // Insert a number of keys equal to 0.1% (when slot_fraction is 0.001) // of the total slots in the table (configuration from VLDB'18 paper) // after hitting the target load factor uint64_t secondary_insert_count = to_multiple_of_batch(total_slots * slot_fraction, batch_size); std::vector<keys_t> insert_items(total_slots); std::vector<keys_t> benchmark_insert_items(secondary_insert_count); populate_with_random_numbers<keys_t>(insert_items, benchmark_insert_items, 0.0, 1); uint64_t items_to_insert_to_hit_lf_target = to_multiple_of_batch(target_lf * total_slots, batch_size); std::vector<bool> status(items_to_insert_to_hit_lf_target, false); std::vector<bool> status_benchmark(secondary_insert_count, false); // Insert up to the target load factor cf.insert_many(insert_items, status, items_to_insert_to_hit_lf_target); time_point start = now(); cf.insert_many(benchmark_insert_items, status_benchmark, secondary_insert_count); std::chrono::duration<double> diff = std::chrono::duration_cast<std::chrono::duration<double>>(now() - start); uint64_t success_count = std::accumulate(status_benchmark.begin(), status_benchmark.end(), 0); if(success_count != secondary_insert_count){ std::cerr << "Only " << success_count << " of " << secondary_insert_count << " insertions succeeded.\n"; } return secondary_insert_count / (diff.count() * 1e6); } template<uint64_t fingerprint_len_bits> double benchmark_deletions(uint64_t total_slots, double target_lf){ Morton_Type cf(total_slots); // Delete a number of keys equal to 0.1% (when slot_fraction is 0.001) // of the total slots in the table (configuration from VLDB'18 paper) // after hitting the target load factor uint64_t delete_count = to_multiple_of_batch(total_slots * slot_fraction, batch_size); uint64_t items_to_insert_to_hit_lf_target = to_multiple_of_batch(target_lf * total_slots, batch_size); std::vector<keys_t> insert_items(items_to_insert_to_hit_lf_target); std::vector<keys_t> delete_items(delete_count); // Generate items to probe (no duplicates) populate_with_random_numbers<keys_t>(insert_items, delete_items, 1.0, 0); std::vector<bool> status(items_to_insert_to_hit_lf_target, false); std::vector<bool> status_benchmark(delete_count, false); cf.insert_many(insert_items, status, items_to_insert_to_hit_lf_target); time_point start = now(); cf.delete_many(delete_items, status_benchmark, delete_count); std::chrono::duration<double> diff = std::chrono::duration_cast<std::chrono::duration<double>>(now() - start); uint64_t success_count = std::accumulate(status_benchmark.begin(), status_benchmark.end(), 0); if(success_count != delete_count){ std::cerr << "Only " << success_count << " of " << delete_count << " deletions succeeded.\n"; } return delete_count / (diff.count() * 1e6); } template<uint64_t fingerprint_len_bits> double benchmark_lookups(uint64_t total_slots, double target_lf, double overlap){ Morton_Type cf(total_slots); // Look a number of keys equal to 0.1% (when slot_fraction is 0.001) // of the total slots in the table (configuration from VLDB'18 paper) uint64_t lookup_count = 1024 * 1024; //to_multiple_of_batch(total_slots * slot_fraction, //batch_size); uint64_t items_to_insert_to_hit_lf_target = to_multiple_of_batch(target_lf * total_slots, batch_size); std::vector<keys_t> insert_items(items_to_insert_to_hit_lf_target); std::vector<keys_t> probe_items(lookup_count); // Generate items to probe (no duplicates) populate_with_random_numbers<keys_t>(insert_items, probe_items, overlap, 1); std::vector<bool> status(items_to_insert_to_hit_lf_target, false); std::vector<bool> status_benchmark(lookup_count, false); cf.insert_many(insert_items, status, items_to_insert_to_hit_lf_target); time_point start = now(); cf.likely_contains_many(probe_items, status_benchmark, lookup_count); std::chrono::duration<double> diff = std::chrono::duration_cast<std::chrono::duration<double>>(now() - start); if(overlap == 1.0){ uint64_t success_count = std::accumulate(status_benchmark.begin(), status_benchmark.end(), 0); if(success_count != lookup_count){ std::cerr << "Only " << success_count << " of " << lookup_count << " lookups succeeded.\n"; } } return lookup_count / (diff.count() * 1e6); } #endif
40.546961
112
0.765363
8ab16131d374bf0e24e4ddd99a70e1e8b4341671
34,647
rs
Rust
src/qspix/qspix_ssctl.rs
gsuyemoto/M031AE-rs
38437dfae24b01f5cc919713ddfbf7bc306616c7
[ "MIT" ]
null
null
null
src/qspix/qspix_ssctl.rs
gsuyemoto/M031AE-rs
38437dfae24b01f5cc919713ddfbf7bc306616c7
[ "MIT" ]
null
null
null
src/qspix/qspix_ssctl.rs
gsuyemoto/M031AE-rs
38437dfae24b01f5cc919713ddfbf7bc306616c7
[ "MIT" ]
null
null
null
#[doc = "Register `QSPIx_SSCTL` reader"] pub struct R(crate::R<QSPIX_SSCTL_SPEC>); impl core::ops::Deref for R { type Target = crate::R<QSPIX_SSCTL_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<QSPIX_SSCTL_SPEC>> for R { #[inline(always)] fn from(reader: crate::R<QSPIX_SSCTL_SPEC>) -> Self { R(reader) } } #[doc = "Register `QSPIx_SSCTL` writer"] pub struct W(crate::W<QSPIX_SSCTL_SPEC>); impl core::ops::Deref for W { type Target = crate::W<QSPIX_SSCTL_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::ops::DerefMut for W { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl From<crate::W<QSPIX_SSCTL_SPEC>> for W { #[inline(always)] fn from(writer: crate::W<QSPIX_SSCTL_SPEC>) -> Self { W(writer) } } #[doc = "Slave Selection Control (Master Only)\nIf AUTOSS bit is cleared to 0,\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SS_A { #[doc = "0: set the QSPIx_SS line to inactive state.\\nKeep the QSPIx_SS line at inactive state"] _0 = 0, #[doc = "1: set the QSPIx_SS line to active state.\\nQSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time. The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL\\[2\\])"] _1 = 1, } impl From<SS_A> for bool { #[inline(always)] fn from(variant: SS_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SS` reader - Slave Selection Control (Master Only)\nIf AUTOSS bit is cleared to 0,"] pub struct SS_R(crate::FieldReader<bool, SS_A>); impl SS_R { pub(crate) fn new(bits: bool) -> Self { SS_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SS_A { match self.bits { false => SS_A::_0, true => SS_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SS_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SS_A::_1 } } impl core::ops::Deref for SS_R { type Target = crate::FieldReader<bool, SS_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SS` writer - Slave Selection Control (Master Only)\nIf AUTOSS bit is cleared to 0,"] pub struct SS_W<'a> { w: &'a mut W, } impl<'a> SS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SS_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "set the QSPIx_SS line to inactive state.\nKeep the QSPIx_SS line at inactive state"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SS_A::_0) } #[doc = "set the QSPIx_SS line to active state.\nQSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time. The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL\\[2\\])"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SS_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } #[doc = "Slave Selection Active Polarity\nThis bit defines the active polarity of slave selection signal (QSPIx_SS).\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SSACTPOL_A { #[doc = "0: The slave selection signal QSPIx_SS is active low"] _0 = 0, #[doc = "1: The slave selection signal QSPIx_SS is active high"] _1 = 1, } impl From<SSACTPOL_A> for bool { #[inline(always)] fn from(variant: SSACTPOL_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SSACTPOL` reader - Slave Selection Active Polarity\nThis bit defines the active polarity of slave selection signal (QSPIx_SS)."] pub struct SSACTPOL_R(crate::FieldReader<bool, SSACTPOL_A>); impl SSACTPOL_R { pub(crate) fn new(bits: bool) -> Self { SSACTPOL_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SSACTPOL_A { match self.bits { false => SSACTPOL_A::_0, true => SSACTPOL_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SSACTPOL_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SSACTPOL_A::_1 } } impl core::ops::Deref for SSACTPOL_R { type Target = crate::FieldReader<bool, SSACTPOL_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SSACTPOL` writer - Slave Selection Active Polarity\nThis bit defines the active polarity of slave selection signal (QSPIx_SS)."] pub struct SSACTPOL_W<'a> { w: &'a mut W, } impl<'a> SSACTPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SSACTPOL_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "The slave selection signal QSPIx_SS is active low"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SSACTPOL_A::_0) } #[doc = "The slave selection signal QSPIx_SS is active high"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SSACTPOL_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } #[doc = "Automatic Slave Selection Function Enable Bit (Master Only)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum AUTOSS_A { #[doc = "0: Automatic slave selection function Disabled. Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL\\[0\\])"] _0 = 0, #[doc = "1: Automatic slave selection function Enabled"] _1 = 1, } impl From<AUTOSS_A> for bool { #[inline(always)] fn from(variant: AUTOSS_A) -> Self { variant as u8 != 0 } } #[doc = "Field `AUTOSS` reader - Automatic Slave Selection Function Enable Bit (Master Only)"] pub struct AUTOSS_R(crate::FieldReader<bool, AUTOSS_A>); impl AUTOSS_R { pub(crate) fn new(bits: bool) -> Self { AUTOSS_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AUTOSS_A { match self.bits { false => AUTOSS_A::_0, true => AUTOSS_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == AUTOSS_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == AUTOSS_A::_1 } } impl core::ops::Deref for AUTOSS_R { type Target = crate::FieldReader<bool, AUTOSS_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `AUTOSS` writer - Automatic Slave Selection Function Enable Bit (Master Only)"] pub struct AUTOSS_W<'a> { w: &'a mut W, } impl<'a> AUTOSS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AUTOSS_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Automatic slave selection function Disabled. Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL\\[0\\])"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(AUTOSS_A::_0) } #[doc = "Automatic slave selection function Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(AUTOSS_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } #[doc = "Slave 3-wire Mode Enable Bit\nIn Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPIx_CLK, QSPIx_MISO and QSPIx_MOSI pins.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLV3WIRE_A { #[doc = "0: 4-wire bi-direction interface"] _0 = 0, #[doc = "1: 3-wire bi-direction interface"] _1 = 1, } impl From<SLV3WIRE_A> for bool { #[inline(always)] fn from(variant: SLV3WIRE_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SLV3WIRE` reader - Slave 3-wire Mode Enable Bit\nIn Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPIx_CLK, QSPIx_MISO and QSPIx_MOSI pins."] pub struct SLV3WIRE_R(crate::FieldReader<bool, SLV3WIRE_A>); impl SLV3WIRE_R { pub(crate) fn new(bits: bool) -> Self { SLV3WIRE_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLV3WIRE_A { match self.bits { false => SLV3WIRE_A::_0, true => SLV3WIRE_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SLV3WIRE_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SLV3WIRE_A::_1 } } impl core::ops::Deref for SLV3WIRE_R { type Target = crate::FieldReader<bool, SLV3WIRE_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLV3WIRE` writer - Slave 3-wire Mode Enable Bit\nIn Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPIx_CLK, QSPIx_MISO and QSPIx_MOSI pins."] pub struct SLV3WIRE_W<'a> { w: &'a mut W, } impl<'a> SLV3WIRE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLV3WIRE_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "4-wire bi-direction interface"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SLV3WIRE_A::_0) } #[doc = "3-wire bi-direction interface"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SLV3WIRE_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } #[doc = "Slave Mode Time-out Interrupt Enable Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLVTOIEN_A { #[doc = "0: Slave mode time-out interrupt Disabled"] _0 = 0, #[doc = "1: Slave mode time-out interrupt Enabled"] _1 = 1, } impl From<SLVTOIEN_A> for bool { #[inline(always)] fn from(variant: SLVTOIEN_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SLVTOIEN` reader - Slave Mode Time-out Interrupt Enable Bit"] pub struct SLVTOIEN_R(crate::FieldReader<bool, SLVTOIEN_A>); impl SLVTOIEN_R { pub(crate) fn new(bits: bool) -> Self { SLVTOIEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLVTOIEN_A { match self.bits { false => SLVTOIEN_A::_0, true => SLVTOIEN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SLVTOIEN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SLVTOIEN_A::_1 } } impl core::ops::Deref for SLVTOIEN_R { type Target = crate::FieldReader<bool, SLVTOIEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLVTOIEN` writer - Slave Mode Time-out Interrupt Enable Bit"] pub struct SLVTOIEN_W<'a> { w: &'a mut W, } impl<'a> SLVTOIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLVTOIEN_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Slave mode time-out interrupt Disabled"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SLVTOIEN_A::_0) } #[doc = "Slave mode time-out interrupt Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SLVTOIEN_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } #[doc = "Slave Mode Time-out Reset Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLVTORST_A { #[doc = "0: When Slave mode time-out event occurs, the TX and RX control circuit will not be reset"] _0 = 0, #[doc = "1: When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware"] _1 = 1, } impl From<SLVTORST_A> for bool { #[inline(always)] fn from(variant: SLVTORST_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SLVTORST` reader - Slave Mode Time-out Reset Control"] pub struct SLVTORST_R(crate::FieldReader<bool, SLVTORST_A>); impl SLVTORST_R { pub(crate) fn new(bits: bool) -> Self { SLVTORST_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLVTORST_A { match self.bits { false => SLVTORST_A::_0, true => SLVTORST_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SLVTORST_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SLVTORST_A::_1 } } impl core::ops::Deref for SLVTORST_R { type Target = crate::FieldReader<bool, SLVTORST_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLVTORST` writer - Slave Mode Time-out Reset Control"] pub struct SLVTORST_W<'a> { w: &'a mut W, } impl<'a> SLVTORST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLVTORST_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "When Slave mode time-out event occurs, the TX and RX control circuit will not be reset"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SLVTORST_A::_0) } #[doc = "When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SLVTORST_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } #[doc = "Slave Mode Bit Count Error Interrupt Enable Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLVBEIEN_A { #[doc = "0: Slave mode bit count error interrupt Disabled"] _0 = 0, #[doc = "1: Slave mode bit count error interrupt Enabled"] _1 = 1, } impl From<SLVBEIEN_A> for bool { #[inline(always)] fn from(variant: SLVBEIEN_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SLVBEIEN` reader - Slave Mode Bit Count Error Interrupt Enable Bit"] pub struct SLVBEIEN_R(crate::FieldReader<bool, SLVBEIEN_A>); impl SLVBEIEN_R { pub(crate) fn new(bits: bool) -> Self { SLVBEIEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLVBEIEN_A { match self.bits { false => SLVBEIEN_A::_0, true => SLVBEIEN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SLVBEIEN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SLVBEIEN_A::_1 } } impl core::ops::Deref for SLVBEIEN_R { type Target = crate::FieldReader<bool, SLVBEIEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLVBEIEN` writer - Slave Mode Bit Count Error Interrupt Enable Bit"] pub struct SLVBEIEN_W<'a> { w: &'a mut W, } impl<'a> SLVBEIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLVBEIEN_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Slave mode bit count error interrupt Disabled"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SLVBEIEN_A::_0) } #[doc = "Slave mode bit count error interrupt Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SLVBEIEN_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } #[doc = "Slave Mode TX Under Run Interrupt Enable Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLVURIEN_A { #[doc = "0: Slave mode TX under run interrupt Disabled"] _0 = 0, #[doc = "1: Slave mode TX under run interrupt Enabled"] _1 = 1, } impl From<SLVURIEN_A> for bool { #[inline(always)] fn from(variant: SLVURIEN_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SLVURIEN` reader - Slave Mode TX Under Run Interrupt Enable Bit"] pub struct SLVURIEN_R(crate::FieldReader<bool, SLVURIEN_A>); impl SLVURIEN_R { pub(crate) fn new(bits: bool) -> Self { SLVURIEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLVURIEN_A { match self.bits { false => SLVURIEN_A::_0, true => SLVURIEN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SLVURIEN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SLVURIEN_A::_1 } } impl core::ops::Deref for SLVURIEN_R { type Target = crate::FieldReader<bool, SLVURIEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLVURIEN` writer - Slave Mode TX Under Run Interrupt Enable Bit"] pub struct SLVURIEN_W<'a> { w: &'a mut W, } impl<'a> SLVURIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLVURIEN_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Slave mode TX under run interrupt Disabled"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SLVURIEN_A::_0) } #[doc = "Slave mode TX under run interrupt Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SLVURIEN_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } #[doc = "Slave Select Active Interrupt Enable Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SSACTIEN_A { #[doc = "0: Slave select active interrupt Disabled"] _0 = 0, #[doc = "1: Slave select active interrupt Enabled"] _1 = 1, } impl From<SSACTIEN_A> for bool { #[inline(always)] fn from(variant: SSACTIEN_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SSACTIEN` reader - Slave Select Active Interrupt Enable Bit"] pub struct SSACTIEN_R(crate::FieldReader<bool, SSACTIEN_A>); impl SSACTIEN_R { pub(crate) fn new(bits: bool) -> Self { SSACTIEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SSACTIEN_A { match self.bits { false => SSACTIEN_A::_0, true => SSACTIEN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SSACTIEN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SSACTIEN_A::_1 } } impl core::ops::Deref for SSACTIEN_R { type Target = crate::FieldReader<bool, SSACTIEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SSACTIEN` writer - Slave Select Active Interrupt Enable Bit"] pub struct SSACTIEN_W<'a> { w: &'a mut W, } impl<'a> SSACTIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SSACTIEN_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Slave select active interrupt Disabled"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SSACTIEN_A::_0) } #[doc = "Slave select active interrupt Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SSACTIEN_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } #[doc = "Slave Select Inactive Interrupt Enable Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SSINAIEN_A { #[doc = "0: Slave select inactive interrupt Disabled"] _0 = 0, #[doc = "1: Slave select inactive interrupt Enabled"] _1 = 1, } impl From<SSINAIEN_A> for bool { #[inline(always)] fn from(variant: SSINAIEN_A) -> Self { variant as u8 != 0 } } #[doc = "Field `SSINAIEN` reader - Slave Select Inactive Interrupt Enable Bit"] pub struct SSINAIEN_R(crate::FieldReader<bool, SSINAIEN_A>); impl SSINAIEN_R { pub(crate) fn new(bits: bool) -> Self { SSINAIEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SSINAIEN_A { match self.bits { false => SSINAIEN_A::_0, true => SSINAIEN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { **self == SSINAIEN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { **self == SSINAIEN_A::_1 } } impl core::ops::Deref for SSINAIEN_R { type Target = crate::FieldReader<bool, SSINAIEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SSINAIEN` writer - Slave Select Inactive Interrupt Enable Bit"] pub struct SSINAIEN_W<'a> { w: &'a mut W, } impl<'a> SSINAIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SSINAIEN_A) -> &'a mut W { self.bit(variant.into()) } #[doc = "Slave select inactive interrupt Disabled"] #[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SSINAIEN_A::_0) } #[doc = "Slave select inactive interrupt Enabled"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SSINAIEN_A::_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } #[doc = "Field `SLVTOCNT` reader - Slave Mode Time-out Period\nIn Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active. The clock source of the time-out counter is Slave peripheral clock. If the value is 0, it indicates the slave mode time-out function is disabled."] pub struct SLVTOCNT_R(crate::FieldReader<u16, u16>); impl SLVTOCNT_R { pub(crate) fn new(bits: u16) -> Self { SLVTOCNT_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for SLVTOCNT_R { type Target = crate::FieldReader<u16, u16>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `SLVTOCNT` writer - Slave Mode Time-out Period\nIn Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active. The clock source of the time-out counter is Slave peripheral clock. If the value is 0, it indicates the slave mode time-out function is disabled."] pub struct SLVTOCNT_W<'a> { w: &'a mut W, } impl<'a> SLVTOCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } impl R { #[doc = "Bit 0 - Slave Selection Control (Master Only) If AUTOSS bit is cleared to 0,"] #[inline(always)] pub fn ss(&self) -> SS_R { SS_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 2 - Slave Selection Active Polarity This bit defines the active polarity of slave selection signal (QSPIx_SS)."] #[inline(always)] pub fn ssactpol(&self) -> SSACTPOL_R { SSACTPOL_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - Automatic Slave Selection Function Enable Bit (Master Only)"] #[inline(always)] pub fn autoss(&self) -> AUTOSS_R { AUTOSS_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 4 - Slave 3-wire Mode Enable Bit In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPIx_CLK, QSPIx_MISO and QSPIx_MOSI pins."] #[inline(always)] pub fn slv3wire(&self) -> SLV3WIRE_R { SLV3WIRE_R::new(((self.bits >> 4) & 0x01) != 0) } #[doc = "Bit 5 - Slave Mode Time-out Interrupt Enable Bit"] #[inline(always)] pub fn slvtoien(&self) -> SLVTOIEN_R { SLVTOIEN_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - Slave Mode Time-out Reset Control"] #[inline(always)] pub fn slvtorst(&self) -> SLVTORST_R { SLVTORST_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 8 - Slave Mode Bit Count Error Interrupt Enable Bit"] #[inline(always)] pub fn slvbeien(&self) -> SLVBEIEN_R { SLVBEIEN_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 9 - Slave Mode TX Under Run Interrupt Enable Bit"] #[inline(always)] pub fn slvurien(&self) -> SLVURIEN_R { SLVURIEN_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 12 - Slave Select Active Interrupt Enable Bit"] #[inline(always)] pub fn ssactien(&self) -> SSACTIEN_R { SSACTIEN_R::new(((self.bits >> 12) & 0x01) != 0) } #[doc = "Bit 13 - Slave Select Inactive Interrupt Enable Bit"] #[inline(always)] pub fn ssinaien(&self) -> SSINAIEN_R { SSINAIEN_R::new(((self.bits >> 13) & 0x01) != 0) } #[doc = "Bits 16:31 - Slave Mode Time-out Period In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active. The clock source of the time-out counter is Slave peripheral clock. If the value is 0, it indicates the slave mode time-out function is disabled."] #[inline(always)] pub fn slvtocnt(&self) -> SLVTOCNT_R { SLVTOCNT_R::new(((self.bits >> 16) & 0xffff) as u16) } } impl W { #[doc = "Bit 0 - Slave Selection Control (Master Only) If AUTOSS bit is cleared to 0,"] #[inline(always)] pub fn ss(&mut self) -> SS_W { SS_W { w: self } } #[doc = "Bit 2 - Slave Selection Active Polarity This bit defines the active polarity of slave selection signal (QSPIx_SS)."] #[inline(always)] pub fn ssactpol(&mut self) -> SSACTPOL_W { SSACTPOL_W { w: self } } #[doc = "Bit 3 - Automatic Slave Selection Function Enable Bit (Master Only)"] #[inline(always)] pub fn autoss(&mut self) -> AUTOSS_W { AUTOSS_W { w: self } } #[doc = "Bit 4 - Slave 3-wire Mode Enable Bit In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPIx_CLK, QSPIx_MISO and QSPIx_MOSI pins."] #[inline(always)] pub fn slv3wire(&mut self) -> SLV3WIRE_W { SLV3WIRE_W { w: self } } #[doc = "Bit 5 - Slave Mode Time-out Interrupt Enable Bit"] #[inline(always)] pub fn slvtoien(&mut self) -> SLVTOIEN_W { SLVTOIEN_W { w: self } } #[doc = "Bit 6 - Slave Mode Time-out Reset Control"] #[inline(always)] pub fn slvtorst(&mut self) -> SLVTORST_W { SLVTORST_W { w: self } } #[doc = "Bit 8 - Slave Mode Bit Count Error Interrupt Enable Bit"] #[inline(always)] pub fn slvbeien(&mut self) -> SLVBEIEN_W { SLVBEIEN_W { w: self } } #[doc = "Bit 9 - Slave Mode TX Under Run Interrupt Enable Bit"] #[inline(always)] pub fn slvurien(&mut self) -> SLVURIEN_W { SLVURIEN_W { w: self } } #[doc = "Bit 12 - Slave Select Active Interrupt Enable Bit"] #[inline(always)] pub fn ssactien(&mut self) -> SSACTIEN_W { SSACTIEN_W { w: self } } #[doc = "Bit 13 - Slave Select Inactive Interrupt Enable Bit"] #[inline(always)] pub fn ssinaien(&mut self) -> SSINAIEN_W { SSINAIEN_W { w: self } } #[doc = "Bits 16:31 - Slave Mode Time-out Period In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active. The clock source of the time-out counter is Slave peripheral clock. If the value is 0, it indicates the slave mode time-out function is disabled."] #[inline(always)] pub fn slvtocnt(&mut self) -> SLVTOCNT_W { SLVTOCNT_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "QSPI Slave Select Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qspix_ssctl](index.html) module"] pub struct QSPIX_SSCTL_SPEC; impl crate::RegisterSpec for QSPIX_SSCTL_SPEC { type Ux = u32; } #[doc = "`read()` method returns [qspix_ssctl::R](R) reader structure"] impl crate::Readable for QSPIX_SSCTL_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [qspix_ssctl::W](W) writer structure"] impl crate::Writable for QSPIX_SSCTL_SPEC { type Writer = W; } #[doc = "`reset()` method sets QSPIx_SSCTL to value 0"] impl crate::Resettable for QSPIX_SSCTL_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } }
33.540174
426
0.593587
a17bd33e6c9d7cc735919412fc7036bdb659d23b
3,462
h
C
stm32f746g-discovery/chirp/chirp_sdk_events.h
chirp/chirp-embedded-examples
78515e80bddbdac0d35d53aa32f82d8925ac99db
[ "MIT" ]
8
2019-04-01T17:34:41.000Z
2021-04-29T07:46:45.000Z
bela/chirp/chirp_sdk_events.h
chirp/chirp-embedded-examples
78515e80bddbdac0d35d53aa32f82d8925ac99db
[ "MIT" ]
3
2019-02-21T10:39:16.000Z
2019-12-05T16:45:47.000Z
stm32f746g-discovery/chirp/chirp_sdk_events.h
chirp/chirp-embedded-examples
78515e80bddbdac0d35d53aa32f82d8925ac99db
[ "MIT" ]
6
2019-08-08T01:50:59.000Z
2020-12-06T02:57:47.000Z
/**----------------------------------------------------------------------------- * * ASIO CONFIDENTIAL * * @file chirp_sdk_events.h * * @brief Events implementations of the C SDK (callbacks and states). * * All contents are strictly proprietary, and not for copying, resale, * or use outside of the agreed license. * * Copyright © 2011-2019, Asio Ltd. * All rights reserved. * *----------------------------------------------------------------------------*/ #ifndef CHIRP_SDK_EVENTS_H #define CHIRP_SDK_EVENTS_H #include <stdint.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /** * Various states the SDK can return. */ typedef enum { CHIRP_SDK_STATE_NOT_CREATED, ///< The audio processing has not been initialised yet. CHIRP_SDK_STATE_STOPPED, ///< The SDK is not processing audio. CHIRP_SDK_STATE_RUNNING, ///< The audio processing is running. CHIRP_SDK_STATE_SENDING, ///< The SDK is sending data. CHIRP_SDK_STATE_RECEIVING, ///< The SDK is receiving data. } chirp_sdk_state_t; /** * On_sending, on_sent, on_receiving and on_received callback prototype * definitions. These callbacks are called if set and respectively if the SDK is * sending, sent, is receiving or received some data. * * @param ptr Pointer of data. It's either the pointer set when calling * `chirp_sdk_set_callback_ptr` or NULL. * @param bytes on_sending : The data being sent. * on_sent : The data sent. * on_receiving : NULL. * on_received : NULL if the decode failed or the data received. * @param length on_sending : The length, in bytes, of the data being sent. * on_sent : The length, in bytes, of the data sent. * on_receiving : 0. * on_received : 0 if the decode failed or the length, in bytes, * of the data received. * @param channel Channel on which the data has been received. */ typedef void (*chirp_sdk_callback_t)(void *ptr, uint8_t *bytes, size_t length, uint8_t channel); /** * On_state_changed callback prototype definition. This is called if the * callback has been set and when the SDK's state is changing. * The possibles values are the one of the `chirp_sdk_state_t` enum * located in `chirp_sdk_states.h`. * * @param ptr Pointer of data. It's either the pointer set when calling * `chirp_sdk_set_callback_ptr` or NULL. * @param old_state The old state of the SDK before reaching this callback. * @param new_state The new state of the SDK when leaving this callback. */ typedef void (*chirp_sdk_state_callback_t)(void *ptr, chirp_sdk_state_t old_state, chirp_sdk_state_t new_state); /** * Structure containing the callbacks pointers. It is not necessary to set all * the fields. Not setting a callback will only result in not being notified of * the event. */ typedef struct { chirp_sdk_state_callback_t on_state_changed; ///< Triggered when the SDK's state is changing. chirp_sdk_callback_t on_sending; ///< Triggered when the SDK starts sending some data. chirp_sdk_callback_t on_sent; ///< Triggered when the SDK has sent the data. chirp_sdk_callback_t on_receiving; ///< Triggered when the SDK starts receiving some data. chirp_sdk_callback_t on_received; ///< Triggered when the SDK has received the data. } chirp_sdk_callback_set_t; #ifdef __cplusplus } #endif #endif /* !CHIRP_SDK_EVENTS_H */
38.898876
112
0.675621
c2b04aae7d92cb3f9d20de7ece645d49b1f99018
1,345
lua
Lua
[core]/dpGarage/client/MusicPlayer.lua
dcr30/drive-crew-mta
1bc6b1bf6520b1818c54b7fb9b75f97f9b290e69
[ "Apache-2.0" ]
16
2017-09-02T20:31:49.000Z
2020-06-07T20:59:55.000Z
[core]/dpGarage/client/MusicPlayer.lua
dcr30/drive-crew-mta
1bc6b1bf6520b1818c54b7fb9b75f97f9b290e69
[ "Apache-2.0" ]
1
2019-05-21T18:35:44.000Z
2019-05-21T18:35:44.000Z
[core]/dpGarage/client/MusicPlayer.lua
JluHeuKa/driftparadise-legacy
570ff6350a1960d531448c62ec10a0708f429c31
[ "Apache-2.0" ]
16
2018-02-18T16:39:35.000Z
2020-05-18T16:15:01.000Z
MusicPlayer = {} local MUSIC_VOLUME = 0.45 local TRACKS_COUNT = 10 local currentTrack = 1 local sound local soundVolume = 0 local soundVolumeSpeed = 5 local function playNextTrack() if not exports.dpConfig:getProperty("game.background_music") then return end currentTrack = currentTrack + 1 if currentTrack > TRACKS_COUNT then currentTrack = 1 end if isElement(sound) then destroyElement(sound) end sound = playSound("assets/music/" .. tostring(currentTrack) .. ".mp3", false) sound:setEffectEnabled("reverb", true) end local function update(dt) dt = dt / 1000 if not isElement(sound) then return end sound.volume = sound.volume + (soundVolume - sound.volume) * dt * soundVolumeSpeed end function MusicPlayer.start() addEventHandler("onClientSoundStopped", resourceRoot, playNextTrack) addEventHandler("onClientPreRender", root, update) currentTrack = math.random(1, TRACKS_COUNT) playNextTrack() if isElement(sound) then sound.volume = 0 sound.playbackPosition = math.random(0, sound.length * 0.7) end soundVolume = MUSIC_VOLUME end function MusicPlayer.fadeOut() soundVolume = 0 end function MusicPlayer.stop() removeEventHandler("onClientSoundStopped", resourceRoot, playNextTrack) removeEventHandler("onClientPreRender", root, update) if isElement(sound) then destroyElement(sound) end end
22.79661
83
0.765799
ba2158456b72c1e6ffe0ebb7c0a7e891a9e71553
1,276
lua
Lua
internal/lua/graph.lua
prologic/LadyLua
d63e0310cadf21ad0157680d2d1ae8753a52bfc7
[ "MIT" ]
77
2021-04-08T13:17:05.000Z
2022-03-31T13:06:36.000Z
internal/lua/graph.lua
prologic/LadyLua
d63e0310cadf21ad0157680d2d1ae8753a52bfc7
[ "MIT" ]
2
2021-07-22T10:39:53.000Z
2021-11-01T14:02:13.000Z
internal/lua/graph.lua
prologic/LadyLua
d63e0310cadf21ad0157680d2d1ae8753a52bfc7
[ "MIT" ]
5
2016-04-06T01:30:51.000Z
2017-11-13T20:57:27.000Z
local setmetatable = setmetatable local pairs = pairs local type = type local function visit(k, n, m, s) if m[k] == 0 then return 1 end if m[k] == 1 then return end m[k] = 0 local f = n[k] for i=1, #f do if visit(f[i], n, m, s) then return 1 end end m[k] = 1 s[#s+1] = k end local tsort = {} tsort.__index = tsort function tsort.new() return setmetatable({ n = {} }, tsort) end function tsort:add(...) local p = { ... } local c = #p if c == 0 then return self end if c == 1 then p = p[1] if type(p) == "table" then c = #p else p = { p } end end local n = self.n for i=1, c do local f = p[i] if n[f] == nil then n[f] = {} end end for i=2, c, 1 do local f = p[i] local t = p[i-1] local o = n[f] o[#o+1] = t end return self end function tsort:sort() local n = self.n local s = {} local m = {} for k in pairs(n) do if m[k] == nil then if visit(k, n, m, s) then return nil, "There is a circular dependency in the graph. It is not possible to derive a topological sort." end end end return s end return tsort
22
123
0.492947
1c738953c744f50062552e4347a467b74e69d549
1,001
css
CSS
src/Layout/Layout.css
dotenorio/react-gravatar-demo
d9afed5c83d451e647cc93dd1afdc8db43e1617b
[ "MIT" ]
null
null
null
src/Layout/Layout.css
dotenorio/react-gravatar-demo
d9afed5c83d451e647cc93dd1afdc8db43e1617b
[ "MIT" ]
23
2019-07-11T16:23:02.000Z
2022-02-26T11:14:21.000Z
src/Layout/Layout.css
dotenorio/react-gravatar-demo
d9afed5c83d451e647cc93dd1afdc8db43e1617b
[ "MIT" ]
null
null
null
* { box-sizing: border-box; margin: 0; padding: 0 } html, body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .header { background-color: #eee; padding: 25px; box-shadow: 0 1px 10px #999; display: flex; } .header h1 { margin-right: 25px; } .header ul { padding: 0px; margin: 0px; list-style: none; align-self: center; padding-top: 5px; } .header ul li { display: inline; } .header ul li a { padding: 2px 10px; display: inline-block; color: #106274; text-decoration: none; } .header ul li a:hover { opacity: 0.6; } .header ul li a.active { font-weight: bold; } .content { margin: 40px 25px; } @media only screen and (max-width: 375px) { .content { margin: 40px 15px; } .header h1 { font-size: 150%; } } @media only screen and (max-width: 768px) { .header { display: block; } .header h1 { text-align: center; margin-right: 0; margin-bottom: 15px; } .header ul { text-align: center; } }
14.3
63
0.608392
9c4f3aabb2d42e4de2a4d5bd205743baf8be454f
1,522
js
JavaScript
Conta.js
LukasSilva05/my-bank-js
4ca202c5053eb8af09e09e26295953f5f8c21fa4
[ "Apache-2.0" ]
null
null
null
Conta.js
LukasSilva05/my-bank-js
4ca202c5053eb8af09e09e26295953f5f8c21fa4
[ "Apache-2.0" ]
null
null
null
Conta.js
LukasSilva05/my-bank-js
4ca202c5053eb8af09e09e26295953f5f8c21fa4
[ "Apache-2.0" ]
null
null
null
class Conta { agencia; numero; cliente; _saldo = 0.0; get saldo() { return this._saldo; } sacar(valor) { if (this._saldo >= valor) { if (valor > 0) { this._saldo = this._saldo - valor; console.log("\nSaque concluído!") console.log(`\nSaldo atual: R$ ${conta._saldo}`) } else { console.log("\nQuantia inválida!") console.log(`\nSaldo atual: R$ ${conta._saldo}`) } } } depositar(valor) { if (valor <= 0) { console.log("\nQuantia inválida!") console.log(`\nSaldo atual: R$ ${conta._saldo}`) } else { this._saldo = this._saldo + valor; console.log("\nQuantia Depositada!") console.log(`\nSaldo atual: R$ ${conta._saldo}`) } } transferencia(valor) { if (valor > 0) { this._saldo = this._saldo + valor; } } transferir(valor, contaDestino) { if (this._saldo <= valor || valor < 0) { console.log("\nQuantia inválida!") console.log(`\nSaldo atual: R$ ${conta1._saldo}`) } else { this._saldo -= valor; contaDestino.transferencia(valor); console.log("\nTransferência efetuada com sucesso!") console.log(`\nSaldo atual: R$ ${conta1._saldo}`) } } } module.exports = Conta;
28.185185
65
0.471748
51b7b819e9efded1a6147adc3c79867006f759e3
10,773
lua
Lua
test/functional/autocmd/cmdline_spec.lua
blueyed/neovim
65578693b28008ca953e446158e31c267e5df7a3
[ "Vim" ]
2
2019-02-21T11:18:42.000Z
2019-02-25T09:31:48.000Z
test/functional/autocmd/cmdline_spec.lua
blueyed/neovim
65578693b28008ca953e446158e31c267e5df7a3
[ "Vim" ]
1
2019-02-08T11:20:39.000Z
2019-02-08T11:20:39.000Z
test/functional/autocmd/cmdline_spec.lua
blueyed/neovim
65578693b28008ca953e446158e31c267e5df7a3
[ "Vim" ]
null
null
null
local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear local command = helpers.command local eq = helpers.eq local expect = helpers.expect local eval = helpers.eval local next_msg = helpers.next_msg local feed = helpers.feed local meths = helpers.meths describe('cmdline autocommands', function() local channel before_each(function() clear() channel = meths.get_api_info()[1] meths.set_var("channel",channel) command("autocmd CmdlineEnter * call rpcnotify(g:channel, 'CmdlineEnter', v:event)") command("autocmd CmdlineLeave * call rpcnotify(g:channel, 'CmdlineLeave', v:event)") command("autocmd CmdWinEnter * call rpcnotify(g:channel, 'CmdWinEnter', v:event)") command("autocmd CmdWinLeave * call rpcnotify(g:channel, 'CmdWinLeave', v:event)") end) it('works', function() feed(':') eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=1}}}, next_msg()) feed('redraw<cr>') eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=1, abort=false}}}, next_msg()) feed(':') eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=1}}}, next_msg()) -- note: feed('bork<c-c>') might not consume 'bork' -- due to out-of-band interupt handling feed('bork<esc>') eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=1, abort=true}}}, next_msg()) end) it('can abort cmdline', function() command("autocmd CmdlineLeave * let v:event.abort= len(getcmdline())>15") feed(":put! ='ok'<cr>") expect([[ ok ]]) feed(":put! ='blah blah'<cr>") expect([[ ok ]]) end) it('handles errors correctly', function() clear() local screen = Screen.new(72, 8) screen:attach() screen:set_default_attr_ids({ [1] = {bold = true, foreground = Screen.colors.Blue1}, [2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, [3] = {bold = true, foreground = Screen.colors.SeaGreen4}, [4] = {bold = true, reverse = true}, }) command("autocmd CmdlineEnter * echoerr 'FAIL'") command("autocmd CmdlineLeave * echoerr 'very error'") feed(':') screen:expect([[ | {1:~ }| {1:~ }| {1:~ }| {4: }| : | {2:E5500: autocmd has thrown an exception: Vim(echoerr):FAIL} | :^ | ]]) feed("put ='lorem ipsum'<cr>") screen:expect([[ | {4: }| : | {2:E5500: autocmd has thrown an exception: Vim(echoerr):FAIL} | :put ='lorem ipsum' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):very error} | | {3:Press ENTER or type command to continue}^ | ]]) -- cmdline was still executed feed('<cr>') screen:expect([[ | ^lorem ipsum | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| | ]]) command("autocmd CmdlineChanged * echoerr 'change erreor'") -- history recall still works feed(":<c-p>") screen:expect([[ | lorem ipsum | {4: }| : | {2:E5500: autocmd has thrown an exception: Vim(echoerr):FAIL} | :put ='lorem ipsum' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum'^ | ]]) feed("<left>") screen:expect([[ | lorem ipsum | {4: }| : | {2:E5500: autocmd has thrown an exception: Vim(echoerr):FAIL} | :put ='lorem ipsum' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum^' | ]]) -- edit still works feed(".") screen:expect([[ {4: }| : | {2:E5500: autocmd has thrown an exception: Vim(echoerr):FAIL} | :put ='lorem ipsum' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum.' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum.^' | ]]) feed('<cr>') screen:expect([[ :put ='lorem ipsum' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum.' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):change erreor} | :put ='lorem ipsum.' | {2:E5500: autocmd has thrown an exception: Vim(echoerr):very error} | | {3:Press ENTER or type command to continue}^ | ]]) -- cmdline was still executed feed('<cr>') screen:expect([[ | lorem ipsum | ^lorem ipsum. | {1:~ }| {1:~ }| {1:~ }| {1:~ }| | ]]) end) it('works with nested cmdline', function() feed(':') eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=1}}}, next_msg()) feed('<c-r>=') eq({'notification', 'CmdlineEnter', {{cmdtype='=', cmdlevel=2}}}, next_msg()) feed('<c-f>') eq({'notification', 'CmdWinEnter', {{}}}, next_msg()) feed(':') eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=3}}}, next_msg()) feed('<c-c>') eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=3, abort=true}}}, next_msg()) feed('<c-c>') eq({'notification', 'CmdWinLeave', {{}}}, next_msg()) feed('1+2<cr>') eq({'notification', 'CmdlineLeave', {{cmdtype='=', cmdlevel=2, abort=false}}}, next_msg()) end) it('supports CmdlineChanged' ,function() command("autocmd CmdlineChanged * call rpcnotify(g:channel, 'CmdlineChanged', v:event, getcmdline())") feed(':') eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=1}}}, next_msg()) feed('l') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "l"}}, next_msg()) feed('e') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "le"}}, next_msg()) feed('t') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let"}}, next_msg()) feed('<space>') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let "}}, next_msg()) feed('x') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x"}}, next_msg()) feed('<space>') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x "}}, next_msg()) feed('=') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x ="}}, next_msg()) feed('<space>') eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x = "}}, next_msg()) feed('<c-r>=') eq({'notification', 'CmdlineEnter', {{cmdtype='=', cmdlevel=2}}}, next_msg()) feed('1') eq({'notification', 'CmdlineChanged', {{cmdtype='=', cmdlevel=2}, "1"}}, next_msg()) feed('+') eq({'notification', 'CmdlineChanged', {{cmdtype='=', cmdlevel=2}, "1+"}}, next_msg()) feed('1') eq({'notification', 'CmdlineChanged', {{cmdtype='=', cmdlevel=2}, "1+1"}}, next_msg()) feed('<cr>') eq({'notification', 'CmdlineLeave', {{cmdtype='=', cmdlevel=2, abort=false}}}, next_msg()) eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x = "}}, next_msg()) eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x = 2"}}, next_msg()) feed('<cr>') eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=1, abort=false}}}, next_msg()) eq(2, eval('x')) end) end)
47.88
106
0.392277
12973b09cac55588159dc0aa09d00c8708d51e56
344
c
C
abCalc/ops/abCOpHex.c
jeremysrand/abCalc
c5afd07c71b81b9fc01612eda5710d0fffd2d418
[ "MIT" ]
null
null
null
abCalc/ops/abCOpHex.c
jeremysrand/abCalc
c5afd07c71b81b9fc01612eda5710d0fffd2d418
[ "MIT" ]
null
null
null
abCalc/ops/abCOpHex.c
jeremysrand/abCalc
c5afd07c71b81b9fc01612eda5710d0fffd2d418
[ "MIT" ]
null
null
null
/* abCOpHex.c By: Jeremy Rand */ #include <stdio.h> #include "abCMode.h" #include "ops/abCOp.h" #include "ops/abCOpHex.h" #define HEX_NAME "HEX" static void hexExecute(void); void abCalcOpHexInit(void) { abCalcOpRegister(HEX_NAME, hexExecute); } void hexExecute(void) { abCalcModeSetBase(abCalcModeHexBase); }
11.096774
43
0.680233
703b225afe09409ecac7e18c2dc7041dd3cd1561
1,309
go
Go
internal/pkg/encryption/api_test.go
admariner/keboola-as-code
845b35c54bd50e141e7e96aa7aa2966723288569
[ "MIT" ]
10
2021-06-23T07:40:16.000Z
2022-02-17T07:14:32.000Z
internal/pkg/encryption/api_test.go
keboola/keboola-as-code
8b4a7b5e748697b6c8871c3aecb35ff2cae75e3b
[ "MIT" ]
78
2021-06-04T08:38:05.000Z
2022-03-31T06:56:00.000Z
internal/pkg/encryption/api_test.go
admariner/keboola-as-code
845b35c54bd50e141e7e96aa7aa2966723288569
[ "MIT" ]
4
2021-09-03T06:32:23.000Z
2022-03-22T12:06:02.000Z
package encryption import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/keboola/keboola-as-code/internal/pkg/log" ) func TestNewEncryptionApi(t *testing.T) { t.Parallel() logger := log.NewDebugLogger() a := NewEncryptionApi(context.Background(), logger, "https://encryption.keboola.com", 1234, true) assert.NotNil(t, a) assert.Equal(t, "https://encryption.keboola.com", a.hostUrl) mapToEncrypt := map[string]string{"#keyToEncrypt": "value"} request := a.CreateEncryptRequest("keboola.ex-generic-v2", mapToEncrypt).Send() assert.True(t, request.HasResult()) assert.False(t, request.HasError()) encryptedMap := *request.Result.(*map[string]string) assert.NotEmpty(t, encryptedMap) assert.True(t, IsEncrypted(encryptedMap["#keyToEncrypt"])) } func TestErrorEncryptionApi(t *testing.T) { t.Parallel() logger := log.NewDebugLogger() a := NewEncryptionApi(context.Background(), logger, "https://encryption.keboola.com", 1234, true) assert.NotNil(t, a) mapToEncrypt := map[string]string{"#keyToEncrypt": "value"} request := a.CreateEncryptRequest("", mapToEncrypt).Send() assert.False(t, request.HasResult()) assert.True(t, request.HasError()) assert.Error(t, request.Err()) assert.Contains(t, request.Err().Error(), "The componentId parameter is required") }
33.564103
98
0.734148
e517797ce4fd79cc0044e257fb302061185f8065
1,235
ts
TypeScript
src/services-bot/WxWorkMarkdown.ts
willerhe/coa-wx-work
38e852e8cc31a31e2fac57ddd33608f67a2663c6
[ "MIT" ]
null
null
null
src/services-bot/WxWorkMarkdown.ts
willerhe/coa-wx-work
38e852e8cc31a31e2fac57ddd33608f67a2663c6
[ "MIT" ]
null
null
null
src/services-bot/WxWorkMarkdown.ts
willerhe/coa-wx-work
38e852e8cc31a31e2fac57ddd33608f67a2663c6
[ "MIT" ]
null
null
null
export class WxWorkMarkdown { private data = '' text (text: string, color?: 'info' | 'comment' | 'warning') { if (!color) this.data += text else this.data += `<font color="${color}">${text}</font>` return this } header3 (text: string) { return this.text(`### ${text}`) } header4 (text: string) { return this.text(`#### ${text}`) } header5 (text: string) { return this.text(`##### ${text}`) } header6 (text: string) { return this.text(`###### ${text}`) } red (text: string) { return this.text(text, 'warning') } green (text: string) { return this.text(text, 'info') } gray (text: string) { return this.text(text, 'comment') } bold (text: string) { return this.text(`**${text}**`) } link (title: string, url: string) { return this.text(`[${title}](${url})`) } commentText (text: string) { return this.text(text, 'comment') } warningText (text: string) { return this.text(text, 'warning') } infoText (text: string) { return this.text(text, 'info') } br () { this.data += '\n' return this } quote () { this.data += '> ' return this } value () { return this.data } }
16.917808
63
0.536842
5ff4b225866fcad1bd3a75376cc7ec2330e6fdfc
320
lua
Lua
prototypes/vanilla-changes/item.lua
RedRafe/nuclear-overhaul
3ea8ee853be580bd7abbeef0298c79b54a02f128
[ "MIT" ]
null
null
null
prototypes/vanilla-changes/item.lua
RedRafe/nuclear-overhaul
3ea8ee853be580bd7abbeef0298c79b54a02f128
[ "MIT" ]
null
null
null
prototypes/vanilla-changes/item.lua
RedRafe/nuclear-overhaul
3ea8ee853be580bd7abbeef0298c79b54a02f128
[ "MIT" ]
null
null
null
nuclear.debug.log("--item") -- U-235 local u235 = data.raw["item"]["uranium-235"] u235.subgroup = "elements" u235.order = "92[uranium-235]" -- U-238 local u238 = data.raw["item"]["uranium-238"] u238.subgroup = "elements" u238.order = "92[uranium-238]" -- Steam turbine data.raw.item["steam-turbine"].stack_size = 50
20
46
0.675
3b6da0d8ad2f5ea847f6beb48403b380494cfd0f
1,353
h
C
include/cipher_wrapper.h
Tuya-Community/Raspberry_PI_Gateway_connects_to_iot_platform
ad3aa0a6baf39b6a0de62e434793fb079f574e6f
[ "MIT" ]
null
null
null
include/cipher_wrapper.h
Tuya-Community/Raspberry_PI_Gateway_connects_to_iot_platform
ad3aa0a6baf39b6a0de62e434793fb079f574e6f
[ "MIT" ]
null
null
null
include/cipher_wrapper.h
Tuya-Community/Raspberry_PI_Gateway_connects_to_iot_platform
ad3aa0a6baf39b6a0de62e434793fb079f574e6f
[ "MIT" ]
null
null
null
#ifndef __CRYPTO_WRAPPER_H_ #define __CRYPTO_WRAPPER_H_ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include "mbedtls/platform.h" #include "mbedtls/cipher.h" #include "mbedtls/md.h" typedef struct { unsigned char *key; unsigned char *nonce; unsigned char *ad; unsigned char *data; size_t key_len; size_t nonce_len; size_t ad_len; size_t data_len; mbedtls_cipher_type_t cipher_type; } cipher_params_t; int mbedtls_cipher_auth_encrypt_wrapper(const cipher_params_t* input, unsigned char *output, size_t *olen, unsigned char *tag, size_t tag_len); int mbedtls_cipher_auth_decrypt_wrapper(const cipher_params_t* input, unsigned char *output, size_t *olen, unsigned char *tag, size_t tag_len); int mbedtls_message_digest( mbedtls_md_type_t md_type, const uint8_t* input, size_t ilen, uint8_t* digest); int mbedtls_message_digest_hmac(mbedtls_md_type_t md_type, const uint8_t* key, size_t keylen, const uint8_t* input, size_t ilen, uint8_t* digest); #ifdef __cplusplus } #endif #endif
29.413043
76
0.593496
5773d3fcf10c1ba9d82e37109dbc53e219d06ded
97
h
C
src/board/common/EmuEEPROMConfig.h
js-midi/OpenDeck
72fc7199e3ba484b87086541f27a1ccb20fbc54f
[ "Apache-2.0" ]
248
2015-03-03T03:10:40.000Z
2021-07-04T07:32:58.000Z
src/board/common/EmuEEPROMConfig.h
js-midi/OpenDeck
72fc7199e3ba484b87086541f27a1ccb20fbc54f
[ "Apache-2.0" ]
33
2015-03-03T10:30:52.000Z
2021-06-06T10:26:20.000Z
src/board/common/EmuEEPROMConfig.h
js-midi/OpenDeck
72fc7199e3ba484b87086541f27a1ccb20fbc54f
[ "Apache-2.0" ]
35
2015-04-03T21:09:40.000Z
2021-07-01T09:26:04.000Z
#pragma once #include <MCU.h> #define EMU_EEPROM_PAGE_SIZE FLASH_PAGE_SIZE(FLASH_PAGE_EEPROM_1)
19.4
65
0.835052
0a020f20f75f4cb1a234f6434192e9ab5f5c48e3
89
h
C
netbsd/sys/arch/mac68k/include/endian.h
shisa/kame-shisa
25dfcf220c0cd8192e475a602501206ccbd9263e
[ "BSD-3-Clause" ]
1
2019-10-15T06:29:32.000Z
2019-10-15T06:29:32.000Z
netbsd/sys/arch/mac68k/include/endian.h
shisa/kame-shisa
25dfcf220c0cd8192e475a602501206ccbd9263e
[ "BSD-3-Clause" ]
null
null
null
netbsd/sys/arch/mac68k/include/endian.h
shisa/kame-shisa
25dfcf220c0cd8192e475a602501206ccbd9263e
[ "BSD-3-Clause" ]
3
2017-01-09T02:15:36.000Z
2019-10-15T06:30:25.000Z
/* $NetBSD: endian.h,v 1.6 2000/03/17 00:09:21 mycroft Exp $ */ #include <sys/endian.h>
22.25
63
0.640449
1f9f50d821084609d4564563c1d95628ec6ac12c
40,073
css
CSS
public/css/responsive.css
olaysco/awaflights-v2.0
375489997568f356464bd735a8843745978e6845
[ "MIT" ]
null
null
null
public/css/responsive.css
olaysco/awaflights-v2.0
375489997568f356464bd735a8843745978e6845
[ "MIT" ]
null
null
null
public/css/responsive.css
olaysco/awaflights-v2.0
375489997568f356464bd735a8843745978e6845
[ "MIT" ]
1
2018-07-23T15:01:43.000Z
2018-07-23T15:01:43.000Z
@media only screen and (max-width: 1200px) { .cover_gallery {width:960px; margin: 0 auto;} .cover_boxes ul li .box p {font-size: 13px; line-height: 23px;} .cover_boxes ul li, .cover_boxes ul li .box .thumb { width: 227px } .cover_boxes ul li.act, .cover_boxes ul li .box { width: 455px } .cover_boxes ul li .box .box_content { left: 247px; width: 207px } } @media only screen and (max-width: 1000px) { .cover_boxes ul { margin: 0 -8px 0 0 } .cover_boxes ul li { margin-right: 8px } .cover_boxes ul li, .cover_boxes ul li .box .thumb { width: 187px } .cover_boxes ul li.act, .cover_boxes ul li .box { width: 374px } .cover_boxes ul li .box .box_content { left: 197px; width: 177px } body.boxed .cover_boxes ul li, body.boxed .cover_boxes ul li .box .thumb { width: 185px } body.boxed .cover_boxes ul li.act, body.boxed .cover_boxes ul li .box { width: 381px } body.boxed .cover_boxes ul li .box .box_content { left: 200px; width: 185px } .cover_boxes ul li .box .box_content p { max-height: 105px; overflow: hidden } .cover_boxes ul li .box h3 { margin: 0 0 5px } .cover_boxes ul li .box .qbutton, .cover_boxes ul li .box h5 { margin: 8px 0 0 } .cover_gallery {width:800px; margin: 0 auto;} .cover_boxes ul li .box p {font-size: 12px; line-height: 18px; margin-bottom: 12px;} .cover_boxes ul li .box h3 {font-size: 13px;} .cover_boxes ul li .box .thumb {margin-right: 17px;} .cover_boxes ul li .box .box_content {padding-left: 10px;} .cover_boxes ul li {margin-right: 17px;} } @media only screen and (min-width: 768px) and (max-width: 1100px) { .portfolio_gallery a.v4 { width: 32%; margin: 0 2% 2% 0!important } .portfolio_gallery a.v4:nth-child(3n) { margin: 0 0 2% 0!important } .drop_down .wide .second ul li .flexslider.widget_flexslider ul.flex-direction-nav li { width: 194px } .widget.widget_search form input[type="text"] { width: 67% } .q_percentage_with_icon canvas { width: 100%!important; height: 100%!important } } @media only screen and (min-width: 768px) and (max-width: 1000px) { .grid2 .blog_holder.masonry .blog_share { margin-left: 0 } .grid2.two_columns_66_33 .blog_holder.blog_single article .post_comments { margin-left: 0 } .grid2.two_columns_66_33 .blog_holder.blog_single article .post_description .post_description_left, .grid2.two_columns_66_33 .blog_holder.blog_single article .post_description .post_description_right { float: none } } @media only screen and (max-width: 900px) { .projects_holder.v6.standard_no_space .mix, .projects_holder.v5.standard_no_space .mix, .projects_holder.v4.standard_no_space .mix, .projects_holder.v6.standard_no_space .filler, .projects_holder.v5.standard_no_space .filler, .projects_holder.v4.standard_no_space .filler, .projects_holder.v6.hover_text.no_space .mix, .projects_holder.v5.hover_text.no_space .mix, .projects_holder.v4.hover_text.no_space .mix, .projects_holder.v6.hover_text.no_space .filler, .projects_holder.v5.hover_text.no_space .filler, .projects_holder.v4.hover_text.no_space .filler { width: 33.32% } .safari_browser .projects_holder.v6.standard_no_space .mix, .safari_browser .projects_holder.v6.hover_text.no_space .mix, .safari_browser .projects_holder.v6.standard_no_space .filler, .safari_browser .projects_holder.v6.hover_text.no_space .filler, .safari_browser .projects_holder.v5.standard_no_space .mix, .safari_browser .projects_holder.v5.hover_text.no_space .mix, .safari_browser .projects_holder.v5.standard_no_space .filler, .safari_browser .projects_holder.v5.hover_text.no_space .filler, .safari_browser .projects_holder.v4.standard_no_space .mix, .safari_browser .projects_holder.v4.hover_text.no_space .mix, .safari_browser .projects_holder.v4.standard_no_space .filler, .safari_browser .projects_holder.v4.hover_text.no_space .filler { width: 33.3% } } @media only screen and (max-width: 783px) { .full_width .q_masonry_blog article { width: 46.5% } .blog_holder.masonry_full_width article { width: 46.5% } } @media only screen and (max-width: 830px) { body.boxed .wrapper_inner, body.boxed footer, body.boxed .header_inner, body.boxed .full_width .parallax_content, body.boxed .carousel-inner, body.boxed .footer_inner { width: 650px } .container_inner, .boxed div.section .section_inner, div.grid_section .section_inner, .full_width .parallax_content, .steps_holder_inner, .carousel-inner .slider_content_outer, nav.content_menu { width: 600px } nav.mobile_menu>ul { width: 600px } .projects_holder.v6 .mix, .projects_holder.v5 .mix, .projects_holder.v4 .mix, .projects_holder.v3 .mix, .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix { width: 31%; margin: 0 0 4% } .projects_holder.v6 .filler, .projects_holder.v5 .filler, .projects_holder.v4 .filler, .projects_holder.v3 .filler, .projects_holder.v6.hover_text .filler, .projects_holder.v5.hover_text .filler, .projects_holder.v4.hover_text .filler, .projects_holder.v3.hover_text .filler { width: 31% } .projects_holder.v2 .mix { width: 48.3%; margin: 0 0 3.6% } .projects_holder.v2 .filler { width: 48.3% } .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix, .projects_holder.v2.hover_text .mix { margin: 0 0 3.4% } .projects_holder.v6.standard_no_space .mix, .projects_holder.v5.standard_no_space .mix, .projects_holder.v4.standard_no_space .mix, .projects_holder.v3.standard_no_space .mix, .projects_holder.v2.standard_no_space .mix, .projects_holder.v6.standard_no_space .filler, .projects_holder.v5.standard_no_space .filler, .projects_holder.v4.standard_no_space .filler, .projects_holder.v3.standard_no_space .filler, .projects_holder.v2.standard_no_space .filler, .projects_holder.v6.hover_text.no_space .mix, .projects_holder.v5.hover_text.no_space .mix, .projects_holder.v4.hover_text.no_space .mix, .projects_holder.v3.hover_text.no_space .mix, .projects_holder.v2.hover_text.no_space .mix, .projects_holder.v6.hover_text.no_space .filler, .projects_holder.v5.hover_text.no_space .filler, .projects_holder.v4.hover_text.no_space .filler, .projects_holder.v3.hover_text.no_space .filler, .projects_holder.v2.hover_text.no_space .filler { width: 49.99% } .safari_browser .projects_holder.v6.standard_no_space .mix, .safari_browser .projects_holder.v6.hover_text.no_space .mix, .safari_browser .projects_holder.v6.standard_no_space .filler, .safari_browser .projects_holder.v6.hover_text.no_space .filler, .safari_browser .projects_holder.v5.standard_no_space .mix, .safari_browser .projects_holder.v5.hover_text.no_space .mix, .safari_browser .projects_holder.v5.standard_no_space .filler, .safari_browser .projects_holder.v5.hover_text.no_space .filler, .safari_browser .projects_holder.v4.standard_no_space .mix, .safari_browser .projects_holder.v4.hover_text.no_space .mix, .safari_browser .projects_holder.v4.standard_no_space .filler, .safari_browser .projects_holder.v4.hover_text.no_space .filler, .safari_browser .projects_holder.v3.standard_no_space .mix, .safari_browser .projects_holder.v3.hover_text.no_space .mix, .safari_browser .projects_holder.v3.standard_no_space .filler, .safari_browser .projects_holder.v3.hover_text.no_space .filler, .safari_browser .projects_holder.v2.standard_no_space .mix, .safari_browser .projects_holder.v2.hover_text.no_space .mix, .safari_browser .projects_holder.v2.standard_no_space .filler, .safari_browser .projects_holder.v2.hover_text.no_space .filler { width: 49.97% } .projects_holder.v6.standard_no_space .mix, .projects_holder.v5.standard_no_space .mix, .projects_holder.v4.standard_no_space .mix, .projects_holder.v3.standard_no_space .mix, .projects_holder.v2.standard_no_space .mix { margin: 0 } .masonry_with_space .projects_holder.v6 .mix, .masonry_with_space .projects_holder.v5 .mix, .masonry_with_space .projects_holder.v4 .mix { width: 33.33% } .blog_holder.masonry article, .q_masonry_blog article, .full_width .grid_section .q_masonry_blog article, .blog_holder.masonry_full_width article { width: 46.5% } .blog_holder.blog_small_image article .post_text .post_text_inner { min-height: 0!important } .comment_holder .comment_number { display: none } .comment_holder .comments { width: 100% } .two_columns_75_25 .blog_holder.masonry article, .two_columns_66_33 .blog_holder.masonry article, .two_columns_33_66 .blog_holder.masonry article, .two_columns_25_75 .blog_holder.masonry article, .two_columns_75_25 .q_masonry_blog article, .two_columns_66_33 .q_masonry_blog article, .two_columns_33_66 .q_masonry_blog article, .two_columns_25_75 .q_masonry_blog article, .full_width .q_masonry_blog article, .blog_holder.masonry_full_width article { width: 100% } div.comment_form { padding-top: 40px; border-top: 1px solid #ddd } .title { padding: 25px 0!important } .header_bottom_right_widget_holder { display: none } .q_line_graf { margin: 0 0 25px; width: 100% } .q_pie_graf { width: 70%; margin: 0 auto 25px; float: none } .q_line_graf canvas, .q_line_graf_legend, .q_pie_graf canvas, .q_pie_graf_legend { width: 100%!important; height: auto!important } .q_icon_list p, .q_list.number.circle_number li { line-height: 37px } .q_list.number.circle_number ul>li:before { top: 0 } .q_icon_list p { padding: 0 0 0 45px } .q_icon_list i { line-height: 35px; height: 35px; width: 35px } .grid2 .blog_holder article .post_description .post_description_left, .grid2 .post_info_left, .grid2 .blog_holder article .post_description .post_description_right { float: none } .grid2 .blog_holder article .post_description .post_description_left, .grid2 .post_info_left { margin-top: 10px } .grid2 .blog_holder article .post_comments { margin-left: 0 } .blog_holder.blog_small_image article .post_image, .blog_holder.blog_small_image article .post_text { float: left; width: 100% } .cover_gallery {width:100%;} .cover_boxes ul { width: 100%!important } .cover_boxes ul li { width: 100%!important; margin: 0 0 20px!important } .cover_boxes ul li, .cover_boxes ul li .box .thumb { width: 270px } .cover_boxes ul li.act, .cover_boxes ul li .box { width: 100% } .cover_boxes ul li .box .box_content { position: static; left: 0; float: right; width: 61%; margin:0px; padding:0px; } .about-content.no-wrapper .content-wrapper {padding-left:60px; padding-right: 60px;} .cover_boxes ul li .box .thumb {margin: 0px;} .cover_boxes ul li, .cover_boxes ul li .box .thumb {width:35%;} .cover_boxes ul li .box .box_content p { height: auto; max-height: none; overflow: visible } body.boxed .cover_boxes ul li.act, body.boxed .cover_boxes ul li .box { width: 100% } body.boxed .cover_boxes ul li .box .box_content { left: 0; width: 395px } .latest_post_holder.boxes>ul>li { margin: 0 2% 25px 0!important } .latest_post_holder.boxes.two_columns>ul>li, .latest_post_holder.boxes.three_columns>ul>li, .latest_post_holder.boxes.four_columns>ul>li { width: 49% } .latest_post_holder.boxes>ul>li:nth-child(2n) { margin: 0 0 25px!important } .q_circles_holder .q_circle_outer { width: 50%!important; margin: 0 0 30px } .q_circles_holder:before { display: none; width: 0; height: 0; border: 0 } .qbutton, .load_more a, #submit_comment, .drop_down .wide .second ul li .qbutton, .drop_down .wide .second ul li ul li .qbutton, .qbutton.small { padding: 0 14px } .qbutton.big_large, .qbutton.big_large_full_width { height: 50px; line-height: 50px; font-size: 16px; padding: 0 20px } .qbutton.large { height: 42px; line-height: 42px; padding: 0 17px } .qbutton.medium, #submit_comment, .load_more.tiny a { height: 38px; line-height: 38px; padding: 0 16px } .qbutton.large i, .qbutton.big_large i, .qbutton.big_large_full_width i { margin: 0 0 0 15px } .qbutton.medium i { margin: 0 0 0 13px } .qbutton.small i { margin: 0 0 0 8px } .q_social_icon_holder .fa-stack { margin: .1407692307692308em } .wpb_flexslider.flexslider.have_frame { width: 442px } .frame_holder>.wpb_wrapper { padding: 24px 0 58px 0 } .frame_holder.frame_holder2>.wpb_wrapper { padding: 33px 0 58px 0 } .have_frame.flexslider .flex-prev { left: -60px } .have_frame.flexslider .flex-next { right: -60px } .touch .content { margin: 0!important } nav.popup_menu ul li a, nav.popup_menu ul li h6 { line-height: 40px } nav.popup_menu ul li a span, nav.popup_menu ul li h6 span { font-size: .7em } .title.title_size_large h1 { font-size: 30px!important; line-height: 40px!important } .q_elements_holder.four_columns { display: inline-block; width: 100% } .q_elements_holder.two_columns .q_elements_item, .q_elements_holder.three_columns .q_elements_item, .q_elements_holder.four_columns .q_elements_item { width: 100%; display: inline-block; height: auto } } @media screen and (max-width:500px) { .about-content.no-wrapper .content-wrapper {padding-left: 20px !important; padding-right: 20px !important;} } @media only screen and (min-width: 600px) and (max-width: 768px) { .portfolio_gallery a.v3, .portfolio_gallery a.v4 { width: 49%!important; margin: 0 2% 2% 0!important } .portfolio_gallery a.v3:nth-child(2n), .portfolio_gallery a.v4:nth-child(2n) { margin: 0 0 2% 0!important } .gallery_holder ul.v4 li { width: 50%!important } .gallery_holder ul.v5 li, .gallery_holder ul.v3 li { width: 33.33333%!important } .blog_holder article .post_info .inner { padding: 0 10px 0 0 } .widget.widget_search form input[type="text"] { width: 60% } .q_image_with_text_over.one_fourth { width: 49.9% } .q_percentage_with_icon canvas { width: 100%!important; height: 100%!important } .q_circles_holder .q_circle_outer:nth-child(2n+1) { clear: both } .blog_like { padding: 0 0 0 8px } .blog_share { margin: 0 0 0 8px } .blog_holder article .post_description .post_description_left { margin: 0 12px 0 0 } .blog_holder.masonry article .post_description .post_description_left { margin: 0 } .q_tabs .tabs-nav li a { padding: 0 4px; font-size: 12px } .q_counter_holder.center { padding: 20px 15px } .price_in_table .price { font-size: 60px } } @media only screen and (max-width: 600px) { body.boxed .wrapper_inner, body.boxed footer, body.boxed .header_inner, body.boxed .full_width .parallax_content, body.boxed .carousel-inner, body.boxed .footer_inner { width: 470px } .container_inner, .boxed div.section .section_inner, div.grid_section .section_inner, .full_width .parallax_content, .steps_holder_inner, .carousel-inner .slider_content_outer, nav.content_menu { width: 420px } nav.mobile_menu>ul { width: 420px } .projects_holder.v6 .mix, .projects_holder.v5 .mix, .projects_holder.v4 .mix, .projects_holder.v3 .mix, .projects_holder.v2 .mix, .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix, .projects_holder.v2.hover_text .mix { width: 47.9%; margin: 0 0 4.7% } .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix, .projects_holder.v2.hover_text .mix { margin: 0 0 4.2% } .projects_holder.v6 .filler, .projects_holder.v5 .filler, .projects_holder.v4 .filler, .projects_holder.v3 .filler, .projects_holder.v2 .filler, .projects_holder.v6.hover_text .filler, .projects_holder.v5.hover_text .filler, .projects_holder.v4.hover_text .filler, .projects_holder.v3.hover_text .filler, .projects_holder.v2.hover_text .filler { width: 47.9% } .projects_holder.v6.standard_no_space .mix, .projects_holder.v5.standard_no_space .mix, .projects_holder.v4.standard_no_space .mix, .projects_holder.v3.standard_no_space .mix, .projects_holder.v2.standard_no_space .mix, .projects_holder.v6.standard_no_space .filler, .projects_holder.v5.standard_no_space .filler, .projects_holder.v4.standard_no_space .filler, .projects_holder.v3.standard_no_space .filler, .projects_holder.v2.standard_no_space .filler, .projects_holder.v6.hover_text.no_space .mix, .projects_holder.v5.hover_text.no_space .mix, .projects_holder.v4.hover_text.no_space .mix, .projects_holder.v3.hover_text.no_space .mix, .projects_holder.v2.hover_text.no_space .mix, .projects_holder.v6.hover_text.no_space .filler, .projects_holder.v5.hover_text.no_space .filler, .projects_holder.v4.hover_text.no_space .filler, .projects_holder.v3.hover_text.no_space .filler, .projects_holder.v2.hover_text.no_space .filler, .safari_browser .projects_holder.v6.standard_no_space .mix, .safari_browser .projects_holder.v6.hover_text.no_space .mix, .safari_browser .projects_holder.v6.standard_no_space .filler, .safari_browser .projects_holder.v6.hover_text.no_space .filler, .safari_browser .projects_holder.v5.standard_no_space .mix, .safari_browser .projects_holder.v5.hover_text.no_space .mix, .safari_browser .projects_holder.v5.standard_no_space .filler, .safari_browser .projects_holder.v5.hover_text.no_space .filler, .safari_browser .projects_holder.v4.standard_no_space .mix, .safari_browser .projects_holder.v4.hover_text.no_space .mix, .safari_browser .projects_holder.v4.standard_no_space .filler, .safari_browser .projects_holder.v4.hover_text.no_space .filler, .safari_browser .projects_holder.v3.standard_no_space .mix, .safari_browser .projects_holder.v3.hover_text.no_space .mix, .safari_browser .projects_holder.v3.standard_no_space .filler, .safari_browser .projects_holder.v3.hover_text.no_space .filler, .safari_browser .projects_holder.v2.standard_no_space .mix, .safari_browser .projects_holder.v2.hover_text.no_space .mix, .safari_browser .projects_holder.v2.standard_no_space .filler, .safari_browser .projects_holder.v2.hover_text.no_space .filler { width: 100% } .projects_holder.v6.standard_no_space .mix, .projects_holder.v5.standard_no_space .mix, .projects_holder.v4.standard_no_space .mix, .projects_holder.v3.standard_no_space .mix, .projects_holder.v2.standard_no_space .mix { margin: 0 0 6.5% } .masonry_with_space .projects_holder.v6 .mix, .masonry_with_space .projects_holder.v5 .mix, .masonry_with_space .projects_holder.v4 .mix, .masonry_with_space .projects_holder.v3 .mix { width: 49.99% } .portfolio_gallery a.v2, .portfolio_gallery a.v3, .portfolio_gallery a.v4 { width: 100%; margin: 0 0 4% 0!important } .portfolio_gallery a.v3:nth-child(2n), .portfolio_gallery a.v4:nth-child(2n) { margin: 0 0 4% 0!important } .two_columns_50_50 .column1, .two_columns_50_50 .column2, .three_columns .column1, .three_columns .column2, .three_columns .column3, .two_columns_66_33 .column1, .two_columns_66_33 .column2, .two_columns_33_66 .column1, .two_columns_33_66 .column2, .two_columns_75_25 .column1, .two_columns_75_25 .column2, .two_columns_25_75 .column1, .two_columns_25_75 .column2, .four_columns .column1, .four_columns .column2, .four_columns .column3, .four_columns .column4 { width: 100% } .two_columns_50_50 .column1 .column_inner, .two_columns_50_50 .column2 .column_inner, .three_columns .column1 .column_inner, .three_columns .column2 .column_inner, .three_columns .column3 .column_inner, .two_columns_66_33 .column1 .column_inner, .two_columns_66_33 .column2 .column_inner, .two_columns_33_66 .column1 .column_inner, .two_columns_33_66 .column2 .column_inner, .two_columns_75_25 .column1 .column_inner, .two_columns_75_25 .column2 .column_inner, .two_columns_25_75 .column1 .column_inner, .two_columns_25_75 .column2 .column_inner, .two_columns_66_33.grid2 .column1 .column_inner, .two_columns_66_33.grid2 .column2 .column_inner, .two_columns_33_66.grid2 .column1 .column_inner, .two_columns_33_66.grid2 .column2 .column_inner, .two_columns_75_25.grid2 .column1 .column_inner, .two_columns_75_25.grid2 .column2 .column_inner, .two_columns_25_75.grid2 .column1 .column_inner, .two_columns_25_75.grid2 .column2 .column_inner, .four_columns .column1 .column_inner, .four_columns .column2 .column_inner, .four_columns .column3 .column_inner, .four_columns .column4 .column_inner { padding: 0 } .q_tabs.vertical .tabs-nav { width: 22% } .q_tabs.vertical.right .tabs-nav { float: right } .q_tabs.vertical .tabs-container { width: 73% } .q_tabs.horizontal .tab-content { padding: 30px 0 10px } .q_tabs .tabs-nav li a { padding: 0 8px } .q_tabs.vertical .tabs-nav li a { padding: 6px 10px } .gallery_holder ul.v5 li, .gallery_holder ul.v4 li, .gallery_holder ul.v3 li, .gallery_holder ul.v2 li { width: 50%!important } #respond textarea { padding: 13px } .comment_holder .comment-list li ul.children { padding: 0 0 0 30px } .blog_holder.masonry article, .two_columns_75_25 .blog_holder.masonry article, .two_columns_66_33 .blog_holder.masonry article, .two_columns_33_66 .blog_holder.masonry article, .two_columns_25_75 .blog_holder.masonry article, .two_columns_75_25 .q_masonry_blog article, .two_columns_66_33 .q_masonry_blog article, .two_columns_33_66 .q_masonry_blog article, .two_columns_25_75 .q_masonry_blog article, .q_masonry_blog article, .full_width .grid_section .q_masonry_blog article { width: 100% } .call_to_action_button_wrapper.right { text-align: center!important; margin-top: 15px } .title { padding: 15px 0!important } .title h1 { float: none } .breadcrumb { position: relative } .title .subtitle { margin-top: 0!important; margin-bottom: 0!important } .blog_holder article .post_description .post_description_left, .post_info_left, .blog_holder article .post_description .post_description_right { float: none } .blog_holder article .post_description .post_description_left, .post_info_left { margin-top: 10px } .blog_holder article .post_comments { margin-left: 0 } .qode_clients.six_columns .qode_client_holder, .qode_clients.five_columns .qode_client_holder, .qode_clients.four_columns .qode_client_holder, .qode_clients.three_columns .qode_client_holder { width: 50% } .qode_clients.six_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.five_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.four_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.three_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before { border-right-width: 1px } .qode_clients.six_columns .qode_client_holder:nth-child(2n) .qode_client_holder_inner:before, .qode_clients.five_columns .qode_client_holder:nth-child(2n) .qode_client_holder_inner:before, .qode_clients.four_columns .qode_client_holder:nth-child(2n) .qode_client_holder_inner:before, .qode_clients.three_columns .qode_client_holder:nth-child(2n) .qode_client_holder_inner:before { border-right-width: 0 } .animated_icons_with_text.two_columns .animated_icon_with_text_holder, .animated_icons_with_text.three_columns .animated_icon_with_text_holder, .animated_icons_with_text.four_columns .animated_icon_with_text_holder, .animated_icons_with_text.five_columns .animated_icon_with_text_holder { width: 100% } .animated_icons_with_text .animated_icon_with_text_inner:before, .animated_icons_with_text.three_columns .animated_icon_with_text_holder:nth-child(3n) .animated_icon_with_text_inner:before, .animated_icons_with_text.four_columns .animated_icon_with_text_holder:nth-child(4n) .animated_icon_with_text_inner:before, .animated_icons_with_text.five_columns .animated_icon_with_text_holder:nth-child(5n) .animated_icon_with_text_inner:before { border-right-width: 0 } .qode_pricing_list .qode_pricing_item_text { padding-right: 130px } .qode_pricing_list .qode_pricing_item_price { width: 130px } .qode_pricing_list .qode_pricing_item_price_inner span { font-size: 25px!important } body.boxed .cover_boxes ul li .box .box_content { left: 0; width: 215px } .vc_row-fluid [class*='vc_span'] { width: 100%!important; margin-left: 0!important } .q_image_with_text_over.one_half, .q_image_with_text_over.one_third, .q_image_with_text_over.one_fourth { width: 100% } .call_to_action .column2.button_wrapper { position: relative; text-align: center } .call_to_action .column2.button_wrapper .qbutton { position: static; margin: 10px 0 0 0 } .cover_boxes ul li, .cover_boxes ul li .box .thumb { width: 190px } .cover_boxes ul li .box .box_content { width: 210px } .latest_post_holder.two_columns>ul>li, .latest_post_holder.three_columns>ul>li, .latest_post_holder.four_columns>ul>li, .latest_post_holder.boxes.two_columns>ul>li, .latest_post_holder.boxes.three_columns>ul>li, .latest_post_holder.boxes.four_columns>ul>li { width: 100%; margin: 0 0 25px!important } .q_circles_holder .q_circle_outer { width: 100%!important } .footer_top .four_columns .column2 .column_inner>div, .footer_top .three_columns .column2 .column_inner>div, .footer_top .two_columns_50_50 .column2 .column_inner>div, .footer_top .four_columns .column3 .column_inner>div, .footer_top .three_columns .column3 .column_inner>div, .footer_top .four_columns .column4 .column_inner>div { margin: 0 } .footer_top .four_columns .column1, .footer_top .four_columns .column2, .footer_top .four_columns .column3, .footer_top .three_columns .column1, .footer_top .three_columns .column2, .footer_top .two_columns_50_50 .column1 { margin: 0 0 25px } .wpb_flexslider.flexslider.have_frame { width: 307px } .frame_holder>.wpb_wrapper { padding: 18px 0 42px 0 } .frame_holder.frame_holder2>.wpb_wrapper { padding: 23px 0 40px 0 } .qode_pricing_tables .q_price_table { width: 100%!important; margin-left: 0; margin-bottom: 15px } .qode_pricing_tables .q_price_table.active { margin-top: 20px; margin-bottom: 25px } .call_to_action .text_wrapper .call_to_action_text { text-align: center; margin-bottom: 10px!important } .title.title_size_large h1 { font-size: 25px!important; line-height: 35px!important } .post-password-form { width: 100% } body.page-template-full_screen-php { font-size: inherit!important; height: auto!important } .full_screen_navigation_holder, .full_screen_preloader, .slimScrollBar { display: none!important; visibility: hidden!important } .full_screen_inner { visibility: visible!important; top: auto!important } .fp-section.fp-table, .fp-slide.fp-table, .fp-tableCell, .slimScrollDiv, .fp-scrollable { height: auto!important } .vc_row.full_screen_section { padding: 30px 0 } .cover_boxes ul li .box .box_content { position: static; left: 0; float: right; width: 61%; margin:0px; padding:0px; } .about-content.no-wrapper .content-wrapper {padding-left:60px; padding-right: 60px;} .cover_boxes ul li .box .thumb {margin: 0px;} .cover_boxes ul li, .cover_boxes ul li .box .thumb {width:35%;} } @media only screen and (max-width: 500px) { .full_width .projects_masonry_holder .portfolio_masonry_item.large_height a.portfolio_link_for_touch { display: block } .full_width .projects_masonry_holder .portfolio_masonry_item.large_height .image_holder img { height: auto!important } } @media only screen and (max-width: 480px) { body.boxed .wrapper_inner, body.boxed footer, body.boxed .header_inner, body.boxed .full_width .parallax_content, body.boxed .carousel-inner { width: 350px } body.boxed .footer_inner { width: 100% } .container_inner, .boxed div.section .section_inner, div.grid_section .section_inner, .full_width .parallax_content, .steps_holder_inner, .carousel-inner .slider_content_outer, nav.content_menu { width: 300px } .full_width .projects_masonry_holder .portfolio_masonry_item, .full_width .projects_masonry_holder .portfolio_masonry_item.large_height, .full_width .projects_masonry_holder .portfolio_masonry_item.large_width, .full_width .projects_masonry_holder .portfolio_masonry_item.large_width_height { width: 100%!important; margin: 0!important } .projects_masonry_holder .portfolio_masonry_item, .projects_masonry_holder .portfolio_masonry_item.large_height, .projects_masonry_holder .portfolio_masonry_item.large_width, .projects_masonry_holder .portfolio_masonry_item.large_width_height { width: 100% } .blog_holder.masonry { width: 300px!important } .header_bottom, footer .container_inner { padding: 0 25px } footer .container_inner, .header_bottom .container_inner { width: auto } nav.mobile_menu>ul { width: auto } .projects_holder.v6 .mix, .projects_holder.v5 .mix, .projects_holder.v4 .mix, .projects_holder.v3 .mix, .projects_holder.v2 .mix, .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix, .projects_holder.v2.hover_text .mix { width: 100%; margin: 0 0 7.4% } .projects_holder.v6.hover_text .mix, .projects_holder.v5.hover_text .mix, .projects_holder.v4.hover_text .mix, .projects_holder.v3.hover_text .mix, .projects_holder.v2.hover_text .mix { margin: 0 0 7.8% } .projects_holder.v6 .filler, .projects_holder.v5 .filler, .projects_holder.v4 .filler, .projects_holder.v3 .filler, .projects_holder.v2 .filler, .projects_holder.v6.hover_text .filler, .projects_holder.v5.hover_text .filler, .projects_holder.v4.hover_text .filler, .projects_holder.v3.hover_text .filler, .projects_holder.v2.hover_text .filler { width: 100% } .masonry_with_space .projects_holder.v6 .mix, .masonry_with_space .projects_holder.v5 .mix, .masonry_with_space .projects_holder.v4 .mix, .masonry_with_space .projects_holder.v3 .mix, .masonry_with_space .projects_holder.v2 .mix { width: 100% } .single_tags { margin: 35px 0 0 19% } .q_tabs.vertical .tabs-nav { width: 30% } .q_tabs.vertical .tabs-container { width: 65% } .q_tabs .tabs-nav li a { padding: 0 5px } .q_tabs.vertical .tabs-nav li a { padding: 7px 5px } .gallery_holder ul.v5 li, .gallery_holder ul.v4 li, .gallery_holder ul.v3 li, .gallery_holder ul.v2 li { width: 100%!important; margin: 0!important } .comment_holder .comment-list li ul.children { padding: 0 0 0 15px } .box_image_with_border { margin: 0 0 30px 0 } .box_image_holder .box_icon .fa-stack { font-size: 4em } .filter_holder ul li span { padding: 0 10px } .q_steps_holder .circle_small span { left: -35px } .footer_bottom { line-height: 35px; height: auto } .blog_holder article .post_description .post_description_left, .post_info_left { display: inline-block; float: none; margin: 0 0 5px; width: 100% } .blog_holder article .post_description .post_description_right, .post_info_right { float: none } .post_info_right { text-align: right } .author_description_inner .image { float: none } .author_text_holder { padding: 10px 0 0 } .single_tags { margin-left: 0 } .footer_top .column_inner>div { margin: 0 0 25px!important } .footer_top .column_inner { border: 0 } .qbutton.big_large { height: 50px; line-height: 50px; padding: 0 18px } .qode_clients.six_columns .qode_client_holder, .qode_clients.five_columns .qode_client_holder, .qode_clients.four_columns .qode_client_holder, .qode_clients.three_columns .qode_client_holder, .qode_clients.two_columns .qode_client_holder { width: 100% } .qode_clients.six_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.five_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.four_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.three_columns .qode_client_holder:nth-child(3n) .qode_client_holder_inner:before, .qode_clients.six_columns .qode_client_holder .qode_client_holder_inner:before, .qode_clients.five_columns .qode_client_holder .qode_client_holder_inner:before, .qode_clients.four_columns .qode_client_holder .qode_client_holder_inner:before, .qode_clients.three_columns .qode_client_holder .qode_client_holder_inner:before, .qode_clients.two_columns .qode_client_holder .qode_client_holder_inner:before { border-right-width: 0 } .side_menu_button>a { padding: 0 } .cover_boxes ul li .box .thumb { width: 100%!important } .cover_boxes ul li.act, .cover_boxes ul li .box { width: 100% } .cover_boxes ul li.act, .cover_boxes ul li .box a.thumb { float: none; margin: 0!important } .cover_boxes ul li .box .box_content { position: static; margin-top: 20px; width: 100% } .cover_boxes ul li.act { margin-bottom: 35px!important } .cover_boxes ul li .box .thumb img { width: 100% } body.boxed .cover_boxes ul li .box .box_content { left: 0; width: 100% } .q_counter_holder.center { padding: 20px } .q_accordion_holder, .q_tabs { visibility: visible!important } .wpb_flexslider.flexslider.have_frame { width: 220px } .frame_holder>.wpb_wrapper { padding: 12px 0 30px 0 } .frame_holder.frame_holder2>.wpb_wrapper { padding: 17px 0 28px 0 } .have_frame.flexslider .flex-prev { left: -50px } .have_frame.flexslider .flex-next { right: -50px } body .gform_wrapper .top_label input.small, body .gform_wrapper .top_label input.medium { width: 100% } div.pp_pic_holder { width: 100%!important; left: 0!important } .pp_content { width: 100%!important; height: 300px!important } .pp_hoverContainer { width: 100%!important; height: 250px!important } #pp_full_res>img { width: 100%!important; height: auto!important } div.pp_default .pp_details { width: 98%!important } div.ppt { width: 100%!important } .title .separator { display: none } .qode_pricing_list .qode_pricing_item_text { padding-right: 100px } .qode_pricing_list .qode_pricing_item_price { width: 100px } .qode_pricing_list .qode_pricing_item_price_inner span { font-size: 20px!important } .title.title_size_large h1 { font-size: 20px!important; line-height: 25px!important } } @media only screen and (max-width: 420px) { body.boxed .wrapper_inner, body.boxed footer, body.boxed .header_inner, body.boxed .full_width .parallax_content, body.boxed .carousel-inner { width: 320px } .header_bottom, footer .container_inner, nav.content_menu { padding: 0 15px } .pp_content { height: 250px!important } .pp_hoverContainer { height: 200px!important } .boxed .full_width .parallax_content { padding: 0 } } @media only screen and (max-width: 350px) { .container_inner, .boxed div.section .section_inner, div.grid_section .section_inner, .full_width .parallax_content, .steps_holder_inner, .carousel-inner .slider_content_outer, nav.content_menu, body.boxed .wrapper_inner, body.boxed footer, body.boxed .header_inner, body.boxed .full_width .parallax_content, body.boxed .carousel-inner { width: 95% } body.boxed .footer_inner { width: 100% } .section_inner_margin, .parallax_section_inner_margin { margin: 0 } }
31.703323
128
0.669154
b167707b733a3309f1866f7bc42061138dfd575d
6,232
css
CSS
client/controlpanel/css/main.css
idkjs/plantpro-cloud
da76f3c3a0fdcd86c6e7e802400fd0931acecadd
[ "MIT" ]
null
null
null
client/controlpanel/css/main.css
idkjs/plantpro-cloud
da76f3c3a0fdcd86c6e7e802400fd0931acecadd
[ "MIT" ]
null
null
null
client/controlpanel/css/main.css
idkjs/plantpro-cloud
da76f3c3a0fdcd86c6e7e802400fd0931acecadd
[ "MIT" ]
null
null
null
body { /*margin: 1% 1% 1% 1%;*/ margin: 0 0 0 0; background-color: #e8e8e8; /*Full page background*/ color: black; height: 100%; } html{ height: 100%; font-family: 'Roboto', Helvetica; } div.flexContainer { display: flex; flex-direction: row; align-items: stretch; align-content: stretch; min-height: 100%; } /*-----------------------------Nav Bar-------------------------------------------*/ .navbar{ border-bottom: solid; border-color: #009b09 } .navbar-brand { color:#009b09 !important; font-size: 40px; margin: 0px; } .navbar-brand:hover{ color:#007a2a !important; } .navbar-right a{ color:#009b09 !important; font-size: 17px; } .navbar-right li a:hover{ color:#ffffff !important; } .leaf li a:hover{ color:#007a2a !important; } /*---------------------------------NavBar End--------------------------------------------*/ /*-------------------------------Begin Sidebar-------------------------------------------*/ #sidebar { width: inherit; min-width: 250px; max-width: 250px; background-color:#232323; overflow-y: auto; overflow-x: auto; border-right: none; border-color: #009b09; display: flex; align-content: stretch; flex-direction: column; flex-grow: 1; color: white; } #sidebar nav { flex-grow: 99; } .nav .open > a, .nav .open > a:focus, .nav .open > a:hover{ background-color: #232323 !important; } @media screen and (max-width: 800px) { .row-offcanvas { position: relative; -webkit-transition: all 0.30s ease-out; -moz-transition: all 0.30s ease-out; transition: all 0.30s ease-out; width:calc(100% + 20px); } .row-offcanvas-left { left: -250px; } .row-offcanvas-left.active { left: 0; } .sidebar-offcanvas { position: absolute; top: 0; } } .col-xs-12 li a{ color: #bcbcbc !important; } .dropdown a:active{ color: #009b09 !important; } .dropdown-menu { position: relative; width: 100%; padding: 0; margin: 0; border-radius: 0; border:none; background-color: #232323; box-shadow: none; } .btn{ display: block; padding:4px 6px; } .btn:hover, .btn:focus{ color:#fff; } #navlist{margin: 0; padding: 0;} #navlist li{display: inline; list-style: none; margin: 0; padding: 0;} #navlist li a{float: left; display: block; background: #555; color: #fff; height: 19px; width: auto; padding: 10px; margin: 0 1px 0 0; border-bottom: 1px solid #fff; text-decoration: none;} #navlist li a:hover{background: #111; border-bottom: 1px solid #111; text-decoration: underline;} #navlist li a.active{background: #111; border-bottom: 1px solid #111;} .nav li a:hover, .nav li a:active, .nav li a:focus, .nav li a:target{ background-color: #232323 !important; color: #fff !important; } .plus:hover{ color:#fff; background-color: #009b09; } .collapsed > .caret {border-left: 4px solid #888; border-right: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent;} .dropdown-toggle a:focus, .dropdown-toggle a:hover, .dropdown-toggle a:active{ background-color: #232323 !important; } .nav{ color:#009b09 !important; list-style-position: inside; } .innerMenu a{ background-color: #232323 !important; max-width: 240px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: solid; border-width: 1px; border-color: #009b09; } .innerMenu{ padding-left: 15px; } /*Ellipsis control*/ .nav li{ max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .nav a{ max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .glyphicon-cog:hover{ color:#bcbcbc; } select { border: none; color: #ddd; background: transparent; font-weight: bold; padding: 5px; -moz-border-radius: 9px 9px 9px 9px; -webkit-border-radius: 9px 9px 9px 9px; border-radius: 9px 9px 9px 9px; background-color: #58B14C; } /*---------------------------End side Bar-----------------------*/ /*-------------------------Begin Stage------------------------*/ #stage { overflow:auto; position: auto; flex-grow: 9; } #panel{ width: 100%; } .panel_status{ padding-left: 2%; } #status{ margin-left: 0%; } #panel.inner_panel li { border-bottom: 1px solid #bbb; margin-left: 0; } #panel.inner_panel ul { list-style-type: none; overflow: hidden; width: 100%; margin-left: 2%; } .attention{ font-size: 15px; font-weight: bold; } #Level li { font-size: 18px; font-weight: normal; text-decoration: underline; } #version{ position:fixed; bottom:0; right:1; } hr { border: 1px solid #ccc; } /*---------------------------End Stage--------------------*/ h1 { color:black; height: 2%; width: 100%; /*margin-left: 3%;*/ } h2 { color: white; background-color: #009b09; height: 3%; width:100%; text-align: center; margin-left: 0%; margin-right: 0%; } h3{ padding-left: 0; margin-left: 0; } hr { color: #009b09; background-color: #009b09; } .EasterEgg { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ } .EasterEgg-content { background-color: #131313; margin: auto; padding: 20px; border: 1px solid #888; width: 50%; } .close { color: #aaaaaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; } div#sidebar div.navButton { padding: 4px; margin: 2px; color: white; } div#sidebar div.navButton:hover { background-color: green; cursor: pointer; }
18.714715
189
0.573813
bcd9c39d88b53772c7b1d5bef5b7b14cd06db17b
1,609
js
JavaScript
src/components/categories.js
IvanVukorepa/HCI
3d9035b1f10f2e8011091d8c3e8305c39abe8296
[ "MIT" ]
null
null
null
src/components/categories.js
IvanVukorepa/HCI
3d9035b1f10f2e8011091d8c3e8305c39abe8296
[ "MIT" ]
8
2021-03-08T23:47:28.000Z
2022-02-26T08:38:59.000Z
src/components/categories.js
IvanVukorepa/HCI
3d9035b1f10f2e8011091d8c3e8305c39abe8296
[ "MIT" ]
null
null
null
import React from "react" class Category extends React.Component { constructor(props){ super(props); this.state = { genres: [] } } componentDidMount(){ this.setState({ genres: this.props.genres }); } componentDidUpdate = () => { if(this.state.genres !== this.props.genres) this.setState({ genres: this.props.genres }); } genreClick = (a) => { this.props.genreClick(a); } render(){ return( <div className="categories"> {this.state.genres.map(genre => { return( <div key={genre.id} onClick={(e) => this.genreClick(genre.Name)}> <div className="category"> <span className="cat">{genre.Name}</span> </div> </div> ) })} </div> ); } } export default Category; /* /* function category(props) { return ( <Link to="/"> <div className="category"> <span className="cat">{props.category}</span> </div> </Link> ) } export default (props) => ( <div className="categories"> {category({category:"Kategorija"})} {category({category:"Kategorija"})} {category({category:"Kategorija"})} {category({category:"Kategorija"})} {category({category:"Kategorija"})} {category({category:"Kategorija"})} </div> )*/
23.318841
85
0.458048
472e55649883bcab421379cc72d2f2815b609b8b
72,953
sql
SQL
data-processing/fec/FECScraper.sql
MinnPost/minnpost-fec-data-analysis
b0bfd9c8874b16605ebb0c09cf02468481a765ab
[ "MIT" ]
null
null
null
data-processing/fec/FECScraper.sql
MinnPost/minnpost-fec-data-analysis
b0bfd9c8874b16605ebb0c09cf02468481a765ab
[ "MIT" ]
null
null
null
data-processing/fec/FECScraper.sql
MinnPost/minnpost-fec-data-analysis
b0bfd9c8874b16605ebb0c09cf02468481a765ab
[ "MIT" ]
null
null
null
/* FEC database creation scripts: ------------------------------ By Christopher Schnaars, USA Today In this file, you'll find all the necessary scripts to create an FEC database on SQL Server, including tables and stored procedures used by the FEC Scraper and FEC Parser Python scripts to interact with the database. These scripts were developed on SQL Server 2008 R2 but should work on older versions, including SQL Server 2000 and 2005. You can use the schema to create similar objects for other database managers. Once you create a database (Step 1), you should be able to run the rest of this file as a batch to create all the tables, stored procedures and triggers at once. Please note: None of the tables in this batch is indexed. If you decide to use these tables as the final resting place for your data rather than as repositories, you probably should create indexes and keys. The tables house all fields contained in the FEC data and add two fields: * ImageID is the six digit ID number assigned by the FEC for a particular data file. So, for example, if you download 421841.fec and add the contents of that file to the database, 421841 will be housed in the ImageID field in this table. * Active is a bit field to indicate whether the file is the current file. The default value is 1. If a report is amended, this field will be set to 0 for all amended reports. Database triggers (scripted below) control the Active field for you. If you use a different database manager, you'll have to come up with logic to handle this field, set it manually or delete data that has been amended. */ -- Step 1: Create the database -- Create a new database on your server. These scripts assume you've called the database FEC. -- If not, modify Step 2 to point to the database you've created. -- Step 2: Point this file to your database -- Modify this code to point to your database USE FEC; GO -- Step 3: Create header tables SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO -- This table houses filings by candidates for the House of Representatives CREATE TABLE [dbo].[Contribs_FormF3]( [ImageID] [varchar](9) NOT NULL, [Active] [bit] NOT NULL, [FormType] [char](4) NOT NULL, [CommID] [char](9) NOT NULL, [CommName] [varchar](200) NULL, [AddressChange] [varchar](1) NULL, [CommAddress1] [varchar](34) NULL, [CommAddress2] [varchar](34) NULL, [CommCity] [varchar](30) NULL, [CommState] [varchar](2) NULL, [CommZip] [varchar](9) NULL, [ElecState] [varchar](2) NULL, [ElecDist] [varchar](2) NULL, [ReptCode] [varchar](3) NULL, [ElecCode] [varchar](5) NULL, [strElecDate] [varchar](8) NULL, [StateOfElec] [varchar](2) NULL, [strCovgFromDate] [varchar](8) NULL, [strCovgToDate] [varchar](8) NULL, [TreasLastName] [varchar](30) NOT NULL, [TreasFirstName] [varchar](20) NOT NULL, [TreasMidName] [varchar](20) NULL, [TreasPrefix] [varchar](10) NULL, [TreasSuffix] [varchar](10) NULL, [strDateSigned] [varchar](8) NULL, [Line6a_TotalContribs_Prd] [varchar](12) NULL, [Line6b_TotalContribRefunds_Prd] [varchar](12) NULL, [Line6c_NetContribs_Prd] [varchar](12) NULL, [Line7a_TotOpExps_Prd] [varchar](12) NULL, [Line7b_TotOffsetToOpExps_Prd] [varchar](12) NULL, [Line7c_NetOpExps_Prd] [varchar](12) NULL, [Line8_CashOnHandAtClose_Prd] [varchar](12) NULL, [Line9_DebtsTo_Prd] [varchar](12) NULL, [Line10_DebtsBy_Prd] [varchar](12) NULL, [Line11a1_IndivsItemized_Prd] [varchar](12) NULL, [Line11a2_IndivsUnitemized_Prd] [varchar](12) NULL, [Line11a3_IndivsContribTotal_Prd] [varchar](12) NULL, [Line11b_PolPtyComms_Prd] [varchar](12) NULL, [Line11c_OtherPACs_Prd] [varchar](12) NULL, [Line11d_Candidate_Prd] [varchar](12) NULL, [Line11e_TotalContribs_Prd] [varchar](12) NULL, [Line12_TransfersFrom_Prd] [varchar](12) NULL, [Line13a_LoansByCand_Prd] [varchar](12) NULL, [Line13b_OtherLoans_Prd] [varchar](12) NULL, [Line13c_TotLoans_Prd] [varchar](12) NULL, [Line14_OffsetsToOpExps_Prd] [varchar](12) NULL, [Line15_OtherReceipts_Prd] [varchar](12) NULL, [Line16_TotReceipts_Prd] [varchar](12) NULL, [Line17_OpExps_Prd] [varchar](12) NULL, [Line18_TransToOtherComms_Prd] [varchar](12) NULL, [Line19a_LoanRepaymts_Cand_Prd] [varchar](12) NULL, [Line19b_LoanRepaymts_Other_Prd] [varchar](12) NULL, [Line19c_TotLoanRepaymts_Prd] [varchar](12) NULL, [Loan20a_IndivRefunds_Prd] [varchar](12) NULL, [Line20b_PolPartyCommRefunds_Prd] [varchar](12) NULL, [Line20c_OtherPolCommRefunds_Prd] [varchar](12) NULL, [Line20d_TotContRefunds_Prd] [varchar](12) NULL, [Line21_OtherDisb_Prd] [varchar](12) NULL, [Line22_TotDisb_Prd] [varchar](12) NULL, [Line23_CashBegin_Prd] [varchar](12) NULL, [Line24_TotReceipts_Prd] [varchar](12) NULL, [Line25_Subtotal] [varchar](12) NULL, [Line26_TotDisbThisPrd_Prd] [varchar](12) NULL, [Line27_CashAtClose_Prd] [varchar](12) NULL, [Line6a_TotalContribs_Tot] [varchar](12) NULL, [Line6b_TotalContribRefunds_Tot] [varchar](12) NULL, [Line6c_NetContribs_Tot] [varchar](12) NULL, [Line7a_TotOpExps_Tot] [varchar](12) NULL, [Line7b_TotOffsetToOpExps_Tot] [varchar](12) NULL, [Line7c_NetOpExps_Tot] [varchar](12) NULL, [Line11a1_IndivsItemized_Tot] [varchar](12) NULL, [Line11a2_IndivsUnitemized_Tot] [varchar](12) NULL, [Line11a3_IndivsContribTotal_Tot] [varchar](12) NULL, [Line11b_PolPtyComms_Tot] [varchar](12) NULL, [Line11c_OtherPACs_Tot] [varchar](12) NULL, [Line11d_Candidate_Tot] [varchar](12) NULL, [Line11e_TotalContribs_Tot] [varchar](12) NULL, [Line12_TransfersFrom_Tot] [varchar](12) NULL, [Line13a_LoansByCand_Tot] [varchar](12) NULL, [Line13b_OtherLoans_Tot] [varchar](12) NULL, [Line13c_TotLoans_Tot] [varchar](12) NULL, [Line14_OffsetsToOpExps_Tot] [varchar](12) NULL, [Line15_OtherReceipts_Tot] [varchar](12) NULL, [Line16_TotReceipts_Tot] [varchar](12) NULL, [Line17_OpExps_Tot] [varchar](12) NULL, [Line18_TransToOtherComms_Tot] [varchar](12) NULL, [Line19a_LoanRepaymts_Cand_Tot] [varchar](12) NULL, [Line19b_LoanRepaymts_Other_Tot] [varchar](12) NULL, [Line19c_TotLoanRepaymts_Tot] [varchar](12) NULL, [Loan20a_IndivRefunds_Tot] [varchar](12) NULL, [Line20b_PolPartyCommRefunds_Tot] [varchar](12) NULL, [Line20c_OtherPolCommRefunds_Tot] [varchar](12) NULL, [Line20d_TotContRefunds_Tot] [varchar](12) NULL, [Line21_OtherDisb_Tot] [varchar](12) NULL, [Line22_TotDisb_Tot] [varchar](12) NULL, CONSTRAINT [PK_Contribs_FormF3] PRIMARY KEY CLUSTERED ( [ImageID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[Contribs_FormF3] ADD CONSTRAINT [DF_Contribs_FormF3_Active] DEFAULT ((1)) FOR [Active] GO SET ANSI_PADDING ON GO -- This table houses filings by presidential candidates CREATE TABLE [dbo].[Contribs_FormF3P]( [ImageID] [varchar](9) NOT NULL, [Active] [bit] NOT NULL, [FormType] [char](4) NOT NULL, [CommID] [char](9) NOT NULL, [CommName] [varchar](200) NULL, [AddressChange] [varchar](1) NULL, [CommAddress1] [varchar](34) NULL, [CommAddress2] [varchar](34) NULL, [CommCity] [varchar](30) NULL, [CommState] [varchar](2) NULL, [CommZip] [varchar](9) NULL, [ActivityPrim] [varchar](1) NULL, [ActivityGen] [varchar](1) NULL, [ReptCode] [varchar](3) NULL, [ElecCode] [varchar](5) NULL, [strElecDate] [varchar](8) NULL, [ElecState] [varchar](2) NULL, [strFromDate] [varchar](8) NULL, [strToDate] [varchar](8) NULL, [TreasLastName] [varchar](30) NOT NULL, [TreasFirstName] [varchar](20) NOT NULL, [TreasMidName] [varchar](20) NULL, [TreasPrefix] [varchar](10) NULL, [TreasSuffix] [varchar](10) NULL, [strDateSigned] [char](8) NOT NULL, [Line6_CashBegin] [varchar](12) NULL, [Line7_TotReceipts] [varchar](12) NULL, [Line8_Subtotal] [varchar](12) NULL, [Line9_TotalDisb] [varchar](12) NULL, [Line10_CashClose] [varchar](12) NULL, [Line11_DebtsTo] [varchar](12) NULL, [Line12_DebtsBy] [varchar](12) NULL, [Line13_ExpendsSubToLimits] [varchar](12) NULL, [Line14_NetContribs] [varchar](12) NULL, [Line15_NetOpExps] [varchar](12) NULL, [Line16_FedFunds_Prd] [varchar](12) NULL, [Line17a1_IndivsItemzd_Prd] [varchar](12) NULL, [Line17a2_IndivsUnItemzd_Prd] [varchar](12) NULL, [Line17a3_IndContTot_Prd] [varchar](12) NULL, [Line17b_PolPartyComms_Prd] [varchar](12) NULL, [Line17c_OtherPACs_Prd] [varchar](12) NULL, [Line17d_Candidate_Prd] [varchar](12) NULL, [Line17e_TotContribs_Prd] [varchar](12) NULL, [Line18_TransfersFrom_Prd] [varchar](12) NULL, [Line19a_CandLoans_Prd] [varchar](12) NULL, [Line19b_OtherLoans_Prd] [varchar](12) NULL, [Line19c_TotLoans_Prd] [varchar](12) NULL, [Line20a_Operating_Prd] [varchar](12) NULL, [Line20b_Fundraising_Prd] [varchar](12) NULL, [Line20c_LegalAcctg_Prd] [varchar](12) NULL, [Line20d_TotExpOffsets_Prd] [varchar](12) NULL, [Line21_OtherReceipts_Prd] [varchar](12) NULL, [Line22_TotReceipts_Prd] [varchar](12) NULL, [Line23_OpExpends_Prd] [varchar](12) NULL, [Line24_TransToOtherComms_Prd] [varchar](12) NULL, [Line25_FundraisingDisbursed_Prd] [varchar](12) NULL, [Line26_ExemptLegalAcctgDisb_Prd] [varchar](12) NULL, [Line27a_CandRepymts_Prd] [varchar](12) NULL, [Line27b_OtherRepymts_Prd] [varchar](12) NULL, [Line27c_TotLoanRepymts_Prd] [varchar](12) NULL, [Line28a_IndivRefunds_Prd] [varchar](12) NULL, [Line28b_PolPartyCommRefunds_Prd] [varchar](12) NULL, [Line28c_OtherPolCommRefunds_Prd] [varchar](12) NULL, [Line28d_TotalContRefunds_Prd] [varchar](12) NULL, [Line29_OtherDisb_Prd] [varchar](12) NULL, [Line30_TotDisb_Prd] [varchar](12) NULL, [Line31_ItemsToLiq_Prd] [varchar](12) NULL, [AllocAlabama_Prd] [varchar](12) NULL, [AllocAlaska_Prd] [varchar](12) NULL, [AllocArizona_Prd] [varchar](12) NULL, [AllocArkansas_Prd] [varchar](12) NULL, [AllocCalifornia_Prd] [varchar](12) NULL, [AllocColorado_Prd] [varchar](12) NULL, [AllocConnecticut_Prd] [varchar](12) NULL, [AllocDelaware_Prd] [varchar](12) NULL, [AllocDistCol_Prd] [varchar](12) NULL, [AllocFlorida_Prd] [varchar](12) NULL, [AllocGeorgia_Prd] [varchar](12) NULL, [AllocHawaii_Prd] [varchar](12) NULL, [AllocIdaho_Prd] [varchar](12) NULL, [AllocIllinois_Prd] [varchar](12) NULL, [AllocIndiana_Prd] [varchar](12) NULL, [AllocIowa_Prd] [varchar](12) NULL, [AllocKansas_Prd] [varchar](12) NULL, [AllocKentucky_Prd] [varchar](12) NULL, [AllocLouisiana_Prd] [varchar](12) NULL, [AllocMaine_Prd] [varchar](12) NULL, [AllocMaryland_Prd] [varchar](12) NULL, [AllocMassachusetts_Prd] [varchar](12) NULL, [AllocMichigan_Prd] [varchar](12) NULL, [AllocMinnesota_Prd] [varchar](12) NULL, [AllocMississippi_Prd] [varchar](12) NULL, [AllocMissouri_Prd] [varchar](12) NULL, [AllocMontana_Prd] [varchar](12) NULL, [AllocNebraska_Prd] [varchar](12) NULL, [AllocNevada_Prd] [varchar](12) NULL, [AllocNewHampshire_Prd] [varchar](12) NULL, [AllocNewJersey_Prd] [varchar](12) NULL, [AllocNewMexico_Prd] [varchar](12) NULL, [AllocNewYork_Prd] [varchar](12) NULL, [AllocNorthCarolina_Prd] [varchar](12) NULL, [AllocNorthDakota_Prd] [varchar](12) NULL, [AllocOhio_Prd] [varchar](12) NULL, [AllocOklahoma_Prd] [varchar](12) NULL, [AllocOregon_Prd] [varchar](12) NULL, [AllocPennsylvania_Prd] [varchar](12) NULL, [AllocRhodeIsland_Prd] [varchar](12) NULL, [AllocSouthCarolina_Prd] [varchar](12) NULL, [AllocSouthDakota_Prd] [varchar](12) NULL, [AllocTennessee_Prd] [varchar](12) NULL, [AllocTexas_Prd] [varchar](12) NULL, [AllocUtah_Prd] [varchar](12) NULL, [AllocVermont_Prd] [varchar](12) NULL, [AllocVirginia_Prd] [varchar](12) NULL, [AllocWashington_Prd] [varchar](12) NULL, [AllocWestVirginia_Prd] [varchar](12) NULL, [AllocWisconsin_Prd] [varchar](12) NULL, [AllocWyoming_Prd] [varchar](12) NULL, [AllocPuertoRico_Prd] [varchar](12) NULL, [AllocGuam_Prd] [varchar](12) NULL, [AllocVirginIslands_Prd] [varchar](12) NULL, [AllocStatesTotal_Prd] [varchar](12) NULL, [Line16_FedFunds_Tot] [varchar](12) NULL, [Line17a1_IndivsItemzd_Tot] [varchar](12) NULL, [Line17a2_IndivsUnItemzd_Tot] [varchar](12) NULL, [Line17a3_IndContTot_Tot] [varchar](12) NULL, [Line17b_PolPartyComms_Tot] [varchar](12) NULL, [Line17c_OtherPACs_Tot] [varchar](12) NULL, [Line17d_Candidate_Tot] [varchar](12) NULL, [Line17e_TotContribs_Tot] [varchar](12) NULL, [Line18_TransfersFrom_Tot] [varchar](12) NULL, [Line19a_CandLoans_Tot] [varchar](12) NULL, [Line19b_OtherLoans_Tot] [varchar](12) NULL, [Line19c_TotLoans_Tot] [varchar](12) NULL, [Line20a_Operating_Tot] [varchar](12) NULL, [Line20b_Fundraising_Tot] [varchar](12) NULL, [Line20c_LegalAcctg_Tot] [varchar](12) NULL, [Line20d_TotExpOffsets_Tot] [varchar](12) NULL, [Line21_OtherReceipts_Tot] [varchar](12) NULL, [Line22_TotReceipts_Tot] [varchar](12) NULL, [Line23_OpExpends_Tot] [varchar](12) NULL, [Line24_TransToOtherComms_Tot] [varchar](12) NULL, [Line25_FundraisingDisbursed_Tot] [varchar](12) NULL, [Line26_ExemptLegalAcctgDisb_Tot] [varchar](12) NULL, [Line27a_CandRepymts_Tot] [varchar](12) NULL, [Line27b_OtherRepymts_Tot] [varchar](12) NULL, [Line27c_TotLoanRepymts_Tot] [varchar](12) NULL, [Line28a_IndivRefunds_Tot] [varchar](12) NULL, [Line28b_PolPartyCommRefunds_Tot] [varchar](12) NULL, [Line28c_OtherPolCommRefunds_Tot] [varchar](12) NULL, [Line28d_TotalContRefunds_Tot] [varchar](12) NULL, [Line29_OtherDisb_Tot] [varchar](12) NULL, [Line30_TotDisb_Tot] [varchar](12) NULL, [AllocAlabama_Tot] [varchar](12) NULL, [AllocAlaska_Tot] [varchar](12) NULL, [AllocArizona_Tot] [varchar](12) NULL, [AllocArkansas_Tot] [varchar](12) NULL, [AllocCalifornia_Tot] [varchar](12) NULL, [AllocColorado_Tot] [varchar](12) NULL, [AllocConnecticut_Tot] [varchar](12) NULL, [AllocDelaware_Tot] [varchar](12) NULL, [AllocDistCol_Tot] [varchar](12) NULL, [AllocFlorida_Tot] [varchar](12) NULL, [AllocGeorgia_Tot] [varchar](12) NULL, [AllocHawaii_Tot] [varchar](12) NULL, [AllocIdaho_Tot] [varchar](12) NULL, [AllocIllinois_Tot] [varchar](12) NULL, [AllocIndiana_Tot] [varchar](12) NULL, [AllocIowa_Tot] [varchar](12) NULL, [AllocKansas_Tot] [varchar](12) NULL, [AllocKentucky_Tot] [varchar](12) NULL, [AllocLouisiana_Tot] [varchar](12) NULL, [AllocMaine_Tot] [varchar](12) NULL, [AllocMaryland_Tot] [varchar](12) NULL, [AllocMassachusetts_Tot] [varchar](12) NULL, [AllocMichigan_Tot] [varchar](12) NULL, [AllocMinnesota_Tot] [varchar](12) NULL, [AllocMississippi_Tot] [varchar](12) NULL, [AllocMissouri_Tot] [varchar](12) NULL, [AllocMontana_Tot] [varchar](12) NULL, [AllocNebraska_Tot] [varchar](12) NULL, [AllocNevada_Tot] [varchar](12) NULL, [AllocNewHampshire_Tot] [varchar](12) NULL, [AllocNewJersey_Tot] [varchar](12) NULL, [AllocNewMexico_Tot] [varchar](12) NULL, [AllocNewYork_Tot] [varchar](12) NULL, [AllocNorthCarolina_Tot] [varchar](12) NULL, [AllocNorthDakota_Tot] [varchar](12) NULL, [AllocOhio_Tot] [varchar](12) NULL, [AllocOklahoma_Tot] [varchar](12) NULL, [AllocOregon_Tot] [varchar](12) NULL, [AllocPennsylvania_Tot] [varchar](12) NULL, [AllocRhodeIsland_Tot] [varchar](12) NULL, [AllocSouthCarolina_Tot] [varchar](12) NULL, [AllocSouthDakota_Tot] [varchar](12) NULL, [AllocTennessee_Tot] [varchar](12) NULL, [AllocTexas_Tot] [varchar](12) NULL, [AllocUtah_Tot] [varchar](12) NULL, [AllocVermont_Tot] [varchar](12) NULL, [AllocVirginia_Tot] [varchar](12) NULL, [AllocWashington_Tot] [varchar](12) NULL, [AllocWestVirginia_Tot] [varchar](12) NULL, [AllocWisconsin_Tot] [varchar](12) NULL, [AllocWyoming_Tot] [varchar](12) NULL, [AllocPuertoRico_Tot] [varchar](12) NULL, [AllocGuam_Tot] [varchar](12) NULL, [AllocVirginIslands_Tot] [varchar](12) NULL, [AllocStatesTotal_Tot] [varchar](12) NULL, CONSTRAINT [PK_Contribs_FormF3P] PRIMARY KEY CLUSTERED ( [ImageID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[Contribs_FormF3P] ADD CONSTRAINT [DF_Contribs_FormF3P_Active] DEFAULT ((1)) FOR [Active] GO SET ANSI_PADDING ON GO -- This table houses filings by PACs and other organizations CREATE TABLE [dbo].[Contribs_FormF3X]( [ImageID] [varchar](9) NOT NULL, [Active] [bit] NOT NULL, [FormType] [char](4) NOT NULL, [CommID] [char](9) NOT NULL, [CommName] [varchar](200) NULL, [AddressChange] [varchar](1) NULL, [CommAddress1] [varchar](34) NULL, [CommAddress2] [varchar](34) NULL, [CommCity] [varchar](30) NULL, [CommState] [varchar](2) NULL, [CommZip] [varchar](9) NULL, [ReptCode] [varchar](3) NULL, [ElecCode] [varchar](5) NULL, [strElecDate] [varchar](8) NULL, [ElecState] [varchar](2) NULL, [strFromDate] [varchar](8) NULL, [strToDate] [varchar](8) NULL, [flgQualifiedComm] [varchar](1) NULL, [TreasLastName] [varchar](30) NOT NULL, [TreasFirstName] [varchar](20) NOT NULL, [TreasMidName] [varchar](20) NULL, [TreasPrefix] [varchar](10) NULL, [TreasSuffix] [varchar](10) NULL, [strDateSigned] [char](8) NOT NULL, [Line6b_CashBegin_Prd] [varchar](12) NULL, [Line6c_TotalRects_Prd] [varchar](12) NULL, [Line6d_CashBeginSubtotal_Prd] [varchar](12) NULL, [Line7_TotDisbmts_Prd] [varchar](12) NULL, [Line8_CashOnHandAtClose_Prd] [varchar](12) NULL, [Line9_DebtsTo_Prd] [varchar](12) NULL, [Line10_DebtsBy_Prd] [varchar](12) NULL, [Line11a1_Itemized_Prd] [varchar](12) NULL, [Line11a2_Unitemized_Prd] [varchar](12) NULL, [Line11a3_Total_Prd] [varchar](12) NULL, [Line11b_PolPtyComms_Prd] [varchar](12) NULL, [Line11c_OtherPACs_Prd] [varchar](12) NULL, [Line11d_TotalContribs_Prd] [varchar](12) NULL, [Line12_TransfersFrom_Prd] [varchar](12) NULL, [Line13_AllLoansRcvd_Prd] [varchar](12) NULL, [Line14_LoanRepymtsRecv_Prd] [varchar](12) NULL, [Line15_OffsetsToOpExps_Refunds_Prd] [varchar](12) NULL, [Line16_RefundsOfFedContribs_Prd] [varchar](12) NULL, [Line17_OtherFedRects_Divds_Prd] [varchar](12) NULL, [Line18a_TransfersFromNonFedAcct_H3_Prd] [varchar](12) NULL, [Line18b_TransfersFromNonFed_LevinH5_Prd] [varchar](12) NULL, [Line18c_TotalNonFedTransfers_Prd] [varchar](12) NULL, [Line19_TotalReceipts_Prd] [varchar](12) NULL, [Line20_TotalFedReceipts_Prd] [varchar](12) NULL, [Line21a1_FedShare_Prd] [varchar](12) NULL, [Line21a2_NonFedShare_Prd] [varchar](12) NULL, [Line21b_OtherFedOpExps_Prd] [varchar](12) NULL, [Line21c_TotOpExps_Prd] [varchar](12) NULL, [Line22_TransToOtherComms_Prd] [varchar](12) NULL, [Line23_ContribsToFedCandsOrComms_Prd] [varchar](12) NULL, [Line24_IndptExps_Prd] [varchar](12) NULL, [Line25_CoordtdExpByPrtyComms_Prd] [varchar](12) NULL, [Line26_LoanRepayments_Prd] [varchar](12) NULL, [Line27_LoansMade_Prd] [varchar](12) NULL, [Line28a_IndivRefunds_Prd] [varchar](12) NULL, [Line28b_PolPartyCommRefunds_Prd] [varchar](12) NULL, [Line28c_OtherPolCommRefunds_Prd] [varchar](12) NULL, [Line28d_TotalContRefunds_Prd] [varchar](12) NULL, [Line29_OtherDisb_Prd] [varchar](12) NULL, [Line30a1_SharedFedActH6FedShare_Prd] [varchar](12) NULL, [Line30a2_SharedFedActH6NonFed_Prd] [varchar](12) NULL, [Line30b_NonAlloc100PctFedElecActivity_Prd] [varchar](12) NULL, [Line30c_TotFedElecActivity_Prd] [varchar](12) NULL, [Line31_TotDisbmts_Prd] [varchar](12) NULL, [Line32_TotFedDisbmts_Prd] [varchar](12) NULL, [Line33_TotContribs_Prd] [varchar](12) NULL, [Line34_TotContribRefunds_Prd] [varchar](12) NULL, [Line35_NetContribs_Prd] [varchar](12) NULL, [Line36_TotFedOpExps_Prd] [varchar](12) NULL, [Line37_OffsetsToOpExps_Prd] [varchar](12) NULL, [Line38_NetOpExps_Prd] [varchar](12) NULL, [Line6b_CashBegin_Tot] [varchar](12) NULL, [Line6b_Year] [varchar](12) NULL, [Line6c_TotalRects_Tot] [varchar](12) NULL, [Line6d_CashBeginSubtotal_Tot] [varchar](12) NULL, [Line7_TotDisbmts_Tot] [varchar](12) NULL, [Line8_CashOnHandAtClose_Tot] [varchar](12) NULL, [Line11a1_Itemized_Tot] [varchar](12) NULL, [Line11a2_Unitemized_Tot] [varchar](12) NULL, [Line11a3_Total_Tot] [varchar](12) NULL, [Line11b_PolPtyComms_Tot] [varchar](12) NULL, [Line11c_OtherPACs_Tot] [varchar](12) NULL, [Line11d_TotalContribs_Tot] [varchar](12) NULL, [Line12_TransfersFrom_Tot] [varchar](12) NULL, [Line13_AllLoansRcvd_Tot] [varchar](12) NULL, [Line14_LoanRepymtsRecv_Tot] [varchar](12) NULL, [Line15_OffsetsToOpExps_Refunds_Tot] [varchar](12) NULL, [Line16_RefundsOfFedContribs_Tot] [varchar](12) NULL, [Line17_OtherFedRects_Divds_Tot] [varchar](12) NULL, [Line18a_TransfersFromNonFedAcct_H3_Tot] [varchar](12) NULL, [Line18b_TransfersFromNonFed_LevinH5_Tot] [varchar](12) NULL, [Line18c_TotalNonFedTransfers_Tot] [varchar](12) NULL, [Line19_TotalReceipts_Tot] [varchar](12) NULL, [Line20_TotalFedReceipts_Tot] [varchar](12) NULL, [Line21a1_FedShare_Tot] [varchar](12) NULL, [Line21a2_NonFedShare_Tot] [varchar](12) NULL, [Line21b_OtherFedOpExps_Tot] [varchar](12) NULL, [Line21c_TotOpExps_Tot] [varchar](12) NULL, [Line22_TransToOtherComms_Tot] [varchar](12) NULL, [Line23_ContribsToFedCandsOrComms_Tot] [varchar](12) NULL, [Line24_IndptExps_Tot] [varchar](12) NULL, [Line25_CoordtdExpByPrtyComms_Tot] [varchar](12) NULL, [Line26_LoanRepayments_Tot] [varchar](12) NULL, [Line27_LoansMade_Tot] [varchar](12) NULL, [Line28a_IndivRefunds_Tot] [varchar](12) NULL, [Line28b_PolPartyCommRefunds_Tot] [varchar](12) NULL, [Line28c_OtherPolCommRefunds_Tot] [varchar](12) NULL, [Line28d_TotalContRefunds_Tot] [varchar](12) NULL, [Line29_OtherDisb_Tot] [varchar](12) NULL, [Line30a1_SharedFedActH6FedShare_Tot] [varchar](12) NULL, [Line30a2_SharedFedActH6NonFed_Tot] [varchar](12) NULL, [Line30b_NonAlloc100PctFedElecActivity_Tot] [varchar](12) NULL, [Line30c_TotFedElecActivity_Tot] [varchar](12) NULL, [Line31_TotDisbmts_Tot] [varchar](12) NULL, [Line32_TotFedDisbmts_Tot] [varchar](12) NULL, [Line33_TotContribs_Tot] [varchar](12) NULL, [Line34_TotContribRefunds_Tot] [varchar](12) NULL, [Line35_NetContribs_Tot] [varchar](12) NULL, [Line36_TotFedOpExps_Tot] [varchar](12) NULL, [Line37_OffsetsToOpExps_Tot] [varchar](12) NULL, [Line38_NetOpExps_Tot] [varchar](12) NULL, CONSTRAINT [PK_Contribs_FormF3X] PRIMARY KEY CLUSTERED ( [ImageID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[Contribs_FormF3X] ADD CONSTRAINT [DF_Contribs_FormF3X_Active] DEFAULT ((1)) FOR [Active] GO -- Step 4: Create child tables SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO -- Schedule A: CREATE TABLE [dbo].[Contribs_SchedA]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [CommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NULL, [BackRefSchedName] [varchar](8) NULL, [EntityType] [char](3) NOT NULL, [ContOrgName] [varchar](200) NULL, [ContLastName] [varchar](30) NULL, [ContFirstName] [varchar](20) NULL, [ContMidName] [varchar](20) NULL, [ContPrefix] [varchar](10) NULL, [ContSuffix] [varchar](10) NULL, [ContAddress1] [varchar](34) NULL, [ContAddress2] [varchar](34) NULL, [ContCity] [varchar](30) NULL, [ContState] [varchar](2) NULL, [ContZip] [varchar](9) NULL, [ElecCode] [varchar](5) NULL, [ElecOtherDesc] [varchar](20) NULL, [strContDate] [varchar](8) NULL, [ContAmount] [varchar](12) NULL, [ContAggregate] [varchar](12) NULL, [ContPurposeCode] [varchar](3) NULL, [ContPurposeDesc] [varchar](100) NULL, [ContEmployer] [varchar](38) NULL, [ContOccupation] [varchar](38) NULL, [DonorCommFECID] [varchar](9) NULL, [DonorCommName] [varchar](200) NULL, [DonorCandFECID] [varchar](9) NULL, [DonorCandLastName] [varchar](30) NULL, [DonorCandFirstName] [varchar](20) NULL, [DonorCandMidName] [varchar](20) NULL, [DonorCandPrefix] [varchar](10) NULL, [DonorCandSuffix] [varchar](10) NULL, [DonorCandOffice] [varchar](1) NULL, [DonorCandState] [varchar](2) NULL, [DonorCandDist] [varchar](2) NULL, [ConduitName] [varchar](200) NULL, [ConduitAddress1] [varchar](34) NULL, [ConduitAddress2] [varchar](34) NULL, [ConduitCity] [varchar](30) NULL, [ConduitState] [varchar](2) NULL, [ConduitZip] [varchar](9) NULL, [MemoCode] [varchar](1) NULL, [MemoText] [varchar](100) NULL ) ON [PRIMARY] GO -- Schedule B: CREATE TABLE [dbo].[Contribs_SchedB]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [FilerCommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NULL, [BackRefSchedName] [varchar](8) NULL, [EntityType] [varchar](3) NULL, [PayeeOrgName] [varchar](200) NULL, [PayeeLastName] [varchar](30) NULL, [PayeeFirstName] [varchar](20) NULL, [PayeeMidName] [varchar](20) NULL, [PayeePrefix] [varchar](10) NULL, [PayeeSuffix] [varchar](10) NULL, [PayeeAddress1] [varchar](34) NULL, [PayeeAddress2] [varchar](34) NULL, [PayeeCity] [varchar](30) NULL, [PayeeState] [varchar](2) NULL, [PayeeZip] [varchar](9) NULL, [ElecCode] [varchar](5) NULL, [ElecOtherDesc] [varchar](20) NULL, [strExpDate] [varchar](8) NULL, [ExpAmount] [varchar](12) NULL, [SemiAnnRefundedBundledAmt] [varchar](12) NULL, [ExpPurpCode] [varchar](3) NULL, [ExpPurpDesc] [varchar](100) NULL, [CatCode] [varchar](3) NULL, [BenCommFECID] [varchar](9) NULL, [BenCommName] [varchar](200) NULL, [BenCandFECID] [varchar](9) NULL, [BenCandLastName] [varchar](30) NULL, [BenCandFirstName] [varchar](20) NULL, [BenCandMidName] [varchar](20) NULL, [BenCandPrefix] [varchar](10) NULL, [BenCandSuffix] [varchar](10) NULL, [BenCandOffice] [varchar](1) NULL, [BenCandState] [varchar](2) NULL, [BenCandDist] [varchar](2) NULL, [ConduitName] [varchar](200) NULL, [ConduitAddress1] [varchar](34) NULL, [ConduitAddress2] [varchar](34) NULL, [ConduitCity] [varchar](30) NULL, [ConduitState] [varchar](2) NULL, [ConduitZip] [varchar](9) NULL, [MemoCode] [varchar](1) NULL, [MemoText] [varchar](100) NULL ) ON [PRIMARY] GO -- Schedule C: CREATE TABLE [dbo].[Contribs_SchedC]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [FilerCommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [RectLineNbr] [varchar](8) NULL, [EntityType] [varchar](3) NULL, [LenderOrgName] [varchar](200) NULL, [LenderLastName] [varchar](30) NULL, [LenderFirstName] [varchar](20) NULL, [LenderMidName] [varchar](20) NULL, [LenderPrefix] [varchar](10) NULL, [LenderSuffix] [varchar](10) NULL, [LenderAddress1] [varchar](34) NULL, [LenderAddress2] [varchar](34) NULL, [LenderCity] [varchar](30) NULL, [LenterState] [varchar](2) NULL, [LenderZip] [varchar](9) NULL, [ElecCod] [varchar](5) NULL, [ElecOtherDesc] [varchar](20) NULL, [LoanAmt] [varchar](12) NULL, [LoanPymtToDate] [varchar](12) NULL, [LoanBal] [varchar](12) NULL, [strLoanIncurredDate] [varchar](8) NULL, [strLoanDueDate] [varchar](15) NULL, [LoanIntRate] [varchar](15) NULL, [LoanSecuredFlag] [varchar](1) NULL, [LoanPersFundsFlag] [varchar](1) NULL, [LenderCommID] [varchar](9) NULL, [LenderCandID] [varchar](9) NULL, [LenderCandLastName] [varchar](30) NULL, [LenderCandFirstName] [varchar](20) NULL, [LenderCandMidName] [varchar](20) NULL, [LenderCandPrefix] [varchar](10) NULL, [LenderCandSuffix] [varchar](10) NULL, [LenderCandOffice] [varchar](1) NULL, [LenderCandState] [varchar](2) NULL, [LenderCandDist] [varchar](2) NULL, [MemoCode] [varchar](1) NULL, [MemoText] [varchar](100) NULL ) ON [PRIMARY] GO -- Schedule C1: CREATE TABLE [dbo].[Contribs_SchedC1]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [FilerCommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NOT NULL, [LenderOrgName] [varchar](200) NULL, [LenderAddress1] [varchar](34) NULL, [LenderAddress2] [varchar](34) NULL, [LenderCity] [varchar](30) NULL, [LenderState] [varchar](2) NULL, [LenderZip] [varchar](9) NULL, [LoanAmt] [varchar](12) NULL, [LoanIntRate] [varchar](15) NULL, [strLoanIncurredDate] [varchar](8) NULL, [strLoanDueDate] [varchar](15) NULL, [A1_LoanRestructuredFlag] [varchar](1) NULL, [A2_strOrigLoanIncurredDate] [varchar](8) NULL, [B1_CreditAmtThisDraw] [varchar](12) NULL, [B2_TotBalance] [varchar](12) NULL, [C_OthersLiableFlag] [varchar](1) NULL, [D_CollateralFlag] [varchar](1) NULL, [D1_CollateralDescription] [varchar](100) NULL, [D2_CollateralValue] [varchar](12) NULL, [D3_PerfectedInterestFlag] [varchar](1) NULL, [E1_FutureIncomeFlag] [varchar](1) NULL, [E2_FutureIncomeDesc] [varchar](100) NULL, [E3_EstimatedValue] [varchar](12) NULL, [E4_strDepositoryAcctEstablishedDate] [varchar](8) NULL, [E5_AcctLocName] [varchar](200) NULL, [E6_AcctAddress1] [varchar](34) NULL, [E7_AcctAddress1] [varchar](34) NULL, [E8_AcctCity] [varchar](30) NULL, [E9_State] [varchar](2) NULL, [E10_Zip] [varchar](9) NULL, [E11_strDepositAcctAuthDate] [varchar](8) NULL, [F_LoanBasisDesc] [varchar](100) NULL, [G_TreasLastName] [varchar](30) NULL, [G_TreasFirstName] [varchar](20) NULL, [G_TreasMidName] [varchar](20) NULL, [G_TreasPrefix] [varchar](10) NULL, [G_TreasSuffix] [varchar](10) NULL, [G_strDateSigned] [varchar](8) NULL, [H_AuthorizedLastName] [varchar](30) NULL, [H_AuthorizedfirstName] [varchar](20) NULL, [H_AuthorizedMidName] [varchar](20) NULL, [H_AuthorizedPrefix] [varchar](10) NULL, [H_AuthorizedSuffix] [varchar](10) NULL, [H_AuthorizedTitle] [varchar](20) NULL, [H_strDateSigned] [varchar](8) NULL ) ON [PRIMARY] GO -- Schedule C2: CREATE TABLE [dbo].[Contribs_SchedC2]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [FilerCommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NOT NULL, [GuarLastName] [varchar](30) NOT NULL, [GuarFirstName] [varchar](20) NOT NULL, [GuarMidName] [varchar](20) NULL, [GuarPrefix] [varchar](10) NULL, [GuarSuffix] [varchar](10) NULL, [GuarAddress1] [varchar](34) NULL, [GuarAddress2] [varchar](34) NULL, [GuarCity] [varchar](30) NULL, [GuarState] [varchar](2) NULL, [GuarZip] [varchar](9) NULL, [GuarEmployer] [varchar](38) NULL, [GuarOccupation] [varchar](38) NULL, [GuarAmt] [varchar](12) NULL ) ON [PRIMARY] GO -- Schedule D: CREATE TABLE [dbo].[Contribs_SchedD]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [CommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [EntityType] [varchar](3) NOT NULL, [CredOrgName] [varchar](200) NULL, [CredLastName] [varchar](30) NOT NULL, [CredFirstName] [varchar](20) NULL, [CredMidName] [varchar](20) NULL, [CredPrefix] [varchar](10) NULL, [CredSuffix] [varchar](10) NULL, [CredAddress1] [varchar](34) NULL, [CredAddress2] [varchar](34) NULL, [CredCity] [varchar](30) NULL, [CredState] [varchar](2) NULL, [CredZip] [varchar](9) NULL, [DebtPurpose] [varchar](100) NULL, [BegBal_Prd] [varchar](12) NULL, [IncurredAmt_Prd] [varchar](12) NULL, [PaymtAmt_Prd] [varchar](12) NULL, [BalanceAtClose_Prd] [varchar](12) NULL ) ON [PRIMARY] GO -- Schedule E: CREATE TABLE [dbo].[Contribs_SchedE]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [FormType] [varchar](8) NOT NULL, [FilerCommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NULL, [BackRefSchedName] [varchar](8) NULL, [EntityType] [varchar](3) NULL, [PayeeOrgName] [varchar](200) NULL, [PayeeLastName] [varchar](30) NULL, [PayeeFirstName] [varchar](20) NULL, [PayeeMidName] [varchar](20) NULL, [PayeePrefix] [varchar](10) NULL, [PayeeSuffix] [varchar](10) NULL, [PayeeAddress1] [varchar](34) NULL, [PayeeAddress2] [varchar](34) NULL, [PayeeCity] [varchar](30) NULL, [PayeeState] [varchar](2) NULL, [PayeeZip] [varchar](9) NULL, [ElecCode] [varchar](5) NULL, [ElecOtherDesc] [varchar](20) NULL, [strExpDate] [varchar](8) NULL, [ExpAmount] [varchar](12) NULL, [CalYTD] [varchar](12) NULL, [ExpPurpCode] [varchar](3) NULL, [ExpPurpDesc] [varchar](100) NULL, [CatCode] [varchar](3) NULL, [PayeeCommFECID] [varchar](9) NULL, [SuppOppCode] [varchar](1) NULL, [SuppOppCandID] [varchar](9) NULL, [SuppOppCandLastName] [varchar](30) NULL, [SuppOppCandFirstName] [varchar](20) NULL, [SuppOppCandMidName] [varchar](20) NULL, [SuppOppCandPrefix] [varchar](10) NULL, [SuppOppCandSuffix] [varchar](10) NULL, [SuppOppCandOffice] [varchar](1) NULL, [SuppOppCandState] [varchar](2) NULL, [SuppOppCandDist] [varchar](2) NULL, [CompLastName] [varchar](30) NULL, [CompFirstName] [varchar](20) NULL, [CompMidName] [varchar](20) NULL, [CompPrefix] [varchar](10) NULL, [CompSuffix] [varchar](10) NULL, [strDateSigned] [varchar](8) NULL, [MemoCode] [varchar](1) NULL, [MemoText] [varchar](100) NULL ) ON [PRIMARY] GO -- Text records: CREATE TABLE [dbo].[Contribs_Text]( [USATID] [int] IDENTITY(1,1) NOT NULL, [ParentType] [varchar](5) NOT NULL, [ImageID] [int] NOT NULL, [RecType] [varchar](4) NOT NULL, [CommID] [char](9) NOT NULL, [TransID] [varchar](20) NOT NULL, [BackRefTransID] [varchar](20) NULL, [BackRefFormName] [varchar](8) NULL, [FullText] [varchar](4000) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO -- Step 5: Create triggers -- Triggers are used to track when a report is amended. The active field is set to 1 for the current -- report and 0 for amended reports. CREATE TRIGGER [dbo].[UpdateF3Active] ON [dbo].[Contribs_FormF3] AFTER INSERT AS BEGIN SET NOCOUNT ON; UPDATE a SET a.Active = 0 FROM Contribs_FormF3 a INNER JOIN Contribs_FormF3 b ON a.CommID = b.CommID AND a.ImageID < b.ImageID AND a.Active = 1 AND b.Active = 1 AND a.ReptCode = b.ReptCode AND a.strCovgFromDate = b.strCovgFromDate AND a.strCovgToDate = b.strCovgToDate; END GO CREATE TRIGGER [dbo].[UpdateF3PActive] ON [dbo].[Contribs_FormF3P] AFTER INSERT AS BEGIN SET NOCOUNT ON; UPDATE a SET a.Active = 0 FROM Contribs_FormF3P a INNER JOIN Contribs_FormF3P b ON a.CommID = b.CommID AND a.ImageID < b.ImageID AND a.Active = 1 AND b.Active = 1 AND a.ReptCode = b.ReptCode AND a.strFromDate = b.strFromDate AND a.strToDate = b.strToDate; END GO CREATE TRIGGER [dbo].[UpdateF3XActive] ON [dbo].[Contribs_FormF3X] AFTER INSERT AS BEGIN SET NOCOUNT ON; UPDATE a SET a.Active = 0 FROM Contribs_FormF3X a INNER JOIN Contribs_FormF3X b ON a.CommID = b.CommID AND a.ImageID < b.ImageID AND a.Active = 1 AND b.Active = 1 AND a.ReptCode = b.ReptCode AND a.strFromDate = b.strFromDate AND a.strToDate = b.strToDate; END GO -- Step 6: Create your stored procedures -- These stored procedures are called by the FEC Scraper Python script to determine -- previously downloaded committees and files. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- This stored procedure retrieves Committee IDs that already exist in the database CREATE PROC [dbo].[usp_GetCommitteeIDs] AS SELECT CommID FROM Contribs_FormF3 UNION SELECT CommID FROM Contribs_FormF3P UNION SELECT CommID FROM Contribs_FormF3X GROUP BY CommID; GO -- This stored procedure retrieves file IDs that already exist in the database CREATE PROC [dbo].[usp_GetFileIDs] AS SELECT ImageID FROM Contribs_FormF3 UNION SELECT ImageID FROM Contribs_FormF3P UNION SELECT ImageID FROM Contribs_FormF3X; GO -- This stored procedure adds a header row to Contribs_FormF3 CREATE PROC [dbo].[usp_AddF3Header] (@ImageID varchar (9), @FormType char (4), @CommID char (9), @CommName varchar (90), @AddressChange varchar (1), @CommAddress1 varchar (34), @CommAddress2 varchar (34), @CommCity varchar (18), @CommState varchar (2), @CommZip varchar (9), @ElecState varchar (2), @ElecDist varchar (2), @ReptCode varchar (3), @ElecCode varchar (5), @strElecDate varchar (8), @StateOfElec varchar (2), @strCovgFromDate varchar (8), @strCovgToDate varchar (8), @TreasLastName varchar (30), @TreasFirstName varchar (20), @TreasMidName varchar (20), @TreasPrefix varchar (10), @TreasSuffix varchar (10), @strDateSigned varchar (8), @Line6a_TotalContribs_Prd varchar (12), @Line6b_TotalContribRefunds_Prd varchar (12), @Line6c_NetContribs_Prd varchar (12), @Line7a_TotOpExps_Prd varchar (12), @Line7b_TotOffsetToOpExps_Prd varchar (12), @Line7c_NetOpExps_Prd varchar (12), @Line8_CashOnHandAtClose_Prd varchar (12), @Line9_DebtsTo_Prd varchar (12), @Line10_DebtsBy_Prd varchar (12), @Line11a1_IndivsItemized_Prd varchar (12), @Line11a2_IndivsUnitemized_Prd varchar (12), @Line11a3_IndivsContribTotal_Prd varchar (12), @Line11b_PolPtyComms_Prd varchar (12), @Line11c_OtherPACs_Prd varchar (12), @Line11d_Candidate_Prd varchar (12), @Line11e_TotalContribs_Prd varchar (12), @Line12_TransfersFrom_Prd varchar (12), @Line13a_LoansByCand_Prd varchar (12), @Line13b_OtherLoans_Prd varchar (12), @Line13c_TotLoans_Prd varchar (12), @Line14_OffsetsToOpExps_Prd varchar (12), @Line15_OtherReceipts_Prd varchar (12), @Line16_TotReceipts_Prd varchar (12), @Line17_OpExps_Prd varchar (12), @Line18_TransToOtherComms_Prd varchar (12), @Line19a_LoanRepaymts_Cand_Prd varchar (12), @Line19b_LoanRepaymts_Other_Prd varchar (12), @Line19c_TotLoanRepaymts_Prd varchar (12), @Loan20a_IndivRefunds_Prd varchar (12), @Line20b_PolPartyCommRefunds_Prd varchar (12), @Line20c_OtherPolCommRefunds_Prd varchar (12), @Line20d_TotContRefunds_Prd varchar (12), @Line21_OtherDisb_Prd varchar (12), @Line22_TotDisb_Prd varchar (12), @Line23_CashBegin_Prd varchar (12), @Line24_TotReceipts_Prd varchar (12), @Line25_Subtotal varchar (12), @Line26_TotDisbThisPrd_Prd varchar (12), @Line27_CashAtClose_Prd varchar (12), @Line6a_TotalContribs_Tot varchar (12), @Line6b_TotalContribRefunds_Tot varchar (12), @Line6c_NetContribs_Tot varchar (12), @Line7a_TotOpExps_Tot varchar (12), @Line7b_TotOffsetToOpExps_Tot varchar (12), @Line7c_NetOpExps_Tot varchar (12), @Line11a1_IndivsItemized_Tot varchar (12), @Line11a2_IndivsUnitemized_Tot varchar (12), @Line11a3_IndivsContribTotal_Tot varchar (12), @Line11b_PolPtyComms_Tot varchar (12), @Line11c_OtherPACs_Tot varchar (12), @Line11d_Candidate_Tot varchar (12), @Line11e_TotalContribs_Tot varchar (12), @Line12_TransfersFrom_Tot varchar (12), @Line13a_LoansByCand_Tot varchar (12), @Line13b_OtherLoans_Tot varchar (12), @Line13c_TotLoans_Tot varchar (12), @Line14_OffsetsToOpExps_Tot varchar (12), @Line15_OtherReceipts_Tot varchar (12), @Line16_TotReceipts_Tot varchar (12), @Line17_OpExps_Tot varchar (12), @Line18_TransToOtherComms_Tot varchar (12), @Line19a_LoanRepaymts_Cand_Tot varchar (12), @Line19b_LoanRepaymts_Other_Tot varchar (12), @Line19c_TotLoanRepaymts_Tot varchar (12), @Loan20a_IndivRefunds_Tot varchar (12), @Line20b_PolPartyCommRefunds_Tot varchar (12), @Line20c_OtherPolCommRefunds_Tot varchar (12), @Line20d_TotContRefunds_Tot varchar (12), @Line21_OtherDisb_Tot varchar (12), @Line22_TotDisb_Tot varchar (12)) AS SET NOCOUNT ON -- See if this file already has been imported -- If so, return -1 IF EXISTS (SELECT ImageID FROM dbo.Contribs_FormF3 WHERE ImageID = @ImageID) BEGIN SELECT -1; RETURN 0; END -- Otherwise, insert the header INSERT INTO dbo.Contribs_FormF3 ([ImageID], [FormType], [CommID], [CommName], [AddressChange], [CommAddress1], [CommAddress2], [CommCity], [CommState], [CommZip], [ElecState], [ElecDist], [ReptCode], [ElecCode], [strElecDate], [StateOfElec], [strCovgFromDate], [strCovgToDate], [TreasLastName], [TreasFirstName], [TreasMidName], [TreasPrefix], [TreasSuffix], [strDateSigned], [Line6a_TotalContribs_Prd], [Line6b_TotalContribRefunds_Prd], [Line6c_NetContribs_Prd], [Line7a_TotOpExps_Prd], [Line7b_TotOffsetToOpExps_Prd], [Line7c_NetOpExps_Prd], [Line8_CashOnHandAtClose_Prd], [Line9_DebtsTo_Prd], [Line10_DebtsBy_Prd], [Line11a1_IndivsItemized_Prd], [Line11a2_IndivsUnitemized_Prd], [Line11a3_IndivsContribTotal_Prd], [Line11b_PolPtyComms_Prd], [Line11c_OtherPACs_Prd], [Line11d_Candidate_Prd], [Line11e_TotalContribs_Prd], [Line12_TransfersFrom_Prd], [Line13a_LoansByCand_Prd], [Line13b_OtherLoans_Prd], [Line13c_TotLoans_Prd], [Line14_OffsetsToOpExps_Prd], [Line15_OtherReceipts_Prd], [Line16_TotReceipts_Prd], [Line17_OpExps_Prd], [Line18_TransToOtherComms_Prd], [Line19a_LoanRepaymts_Cand_Prd], [Line19b_LoanRepaymts_Other_Prd], [Line19c_TotLoanRepaymts_Prd], [Loan20a_IndivRefunds_Prd], [Line20b_PolPartyCommRefunds_Prd], [Line20c_OtherPolCommRefunds_Prd], [Line20d_TotContRefunds_Prd], [Line21_OtherDisb_Prd], [Line22_TotDisb_Prd], [Line23_CashBegin_Prd], [Line24_TotReceipts_Prd], [Line25_Subtotal], [Line26_TotDisbThisPrd_Prd], [Line27_CashAtClose_Prd], [Line6a_TotalContribs_Tot], [Line6b_TotalContribRefunds_Tot], [Line6c_NetContribs_Tot], [Line7a_TotOpExps_Tot], [Line7b_TotOffsetToOpExps_Tot], [Line7c_NetOpExps_Tot], [Line11a1_IndivsItemized_Tot], [Line11a2_IndivsUnitemized_Tot], [Line11a3_IndivsContribTotal_Tot], [Line11b_PolPtyComms_Tot], [Line11c_OtherPACs_Tot], [Line11d_Candidate_Tot], [Line11e_TotalContribs_Tot], [Line12_TransfersFrom_Tot], [Line13a_LoansByCand_Tot], [Line13b_OtherLoans_Tot], [Line13c_TotLoans_Tot], [Line14_OffsetsToOpExps_Tot], [Line15_OtherReceipts_Tot], [Line16_TotReceipts_Tot], [Line17_OpExps_Tot], [Line18_TransToOtherComms_Tot], [Line19a_LoanRepaymts_Cand_Tot], [Line19b_LoanRepaymts_Other_Tot], [Line19c_TotLoanRepaymts_Tot], [Loan20a_IndivRefunds_Tot], [Line20b_PolPartyCommRefunds_Tot], [Line20c_OtherPolCommRefunds_Tot], [Line20d_TotContRefunds_Tot], [Line21_OtherDisb_Tot], [Line22_TotDisb_Tot]) VALUES (@ImageID, @FormType, @CommID, @CommName, @AddressChange, @CommAddress1, @CommAddress2, @CommCity, @CommState, @CommZip, @ElecState, @ElecDist, @ReptCode, @ElecCode, @strElecDate, @StateOfElec, @strCovgFromDate, @strCovgToDate, @TreasLastName, @TreasFirstName, @TreasMidName, @TreasPrefix, @TreasSuffix, @strDateSigned, @Line6a_TotalContribs_Prd, @Line6b_TotalContribRefunds_Prd, @Line6c_NetContribs_Prd, @Line7a_TotOpExps_Prd, @Line7b_TotOffsetToOpExps_Prd, @Line7c_NetOpExps_Prd, @Line8_CashOnHandAtClose_Prd, @Line9_DebtsTo_Prd, @Line10_DebtsBy_Prd, @Line11a1_IndivsItemized_Prd, @Line11a2_IndivsUnitemized_Prd, @Line11a3_IndivsContribTotal_Prd, @Line11b_PolPtyComms_Prd, @Line11c_OtherPACs_Prd, @Line11d_Candidate_Prd, @Line11e_TotalContribs_Prd, @Line12_TransfersFrom_Prd, @Line13a_LoansByCand_Prd, @Line13b_OtherLoans_Prd, @Line13c_TotLoans_Prd, @Line14_OffsetsToOpExps_Prd, @Line15_OtherReceipts_Prd, @Line16_TotReceipts_Prd, @Line17_OpExps_Prd, @Line18_TransToOtherComms_Prd, @Line19a_LoanRepaymts_Cand_Prd, @Line19b_LoanRepaymts_Other_Prd, @Line19c_TotLoanRepaymts_Prd, @Loan20a_IndivRefunds_Prd, @Line20b_PolPartyCommRefunds_Prd, @Line20c_OtherPolCommRefunds_Prd, @Line20d_TotContRefunds_Prd, @Line21_OtherDisb_Prd, @Line22_TotDisb_Prd, @Line23_CashBegin_Prd, @Line24_TotReceipts_Prd, @Line25_Subtotal, @Line26_TotDisbThisPrd_Prd, @Line27_CashAtClose_Prd, @Line6a_TotalContribs_Tot, @Line6b_TotalContribRefunds_Tot, @Line6c_NetContribs_Tot, @Line7a_TotOpExps_Tot, @Line7b_TotOffsetToOpExps_Tot, @Line7c_NetOpExps_Tot, @Line11a1_IndivsItemized_Tot, @Line11a2_IndivsUnitemized_Tot, @Line11a3_IndivsContribTotal_Tot, @Line11b_PolPtyComms_Tot, @Line11c_OtherPACs_Tot, @Line11d_Candidate_Tot, @Line11e_TotalContribs_Tot, @Line12_TransfersFrom_Tot, @Line13a_LoansByCand_Tot, @Line13b_OtherLoans_Tot, @Line13c_TotLoans_Tot, @Line14_OffsetsToOpExps_Tot, @Line15_OtherReceipts_Tot, @Line16_TotReceipts_Tot, @Line17_OpExps_Tot, @Line18_TransToOtherComms_Tot, @Line19a_LoanRepaymts_Cand_Tot, @Line19b_LoanRepaymts_Other_Tot, @Line19c_TotLoanRepaymts_Tot, @Loan20a_IndivRefunds_Tot, @Line20b_PolPartyCommRefunds_Tot, @Line20c_OtherPolCommRefunds_Tot, @Line20d_TotContRefunds_Tot, @Line21_OtherDisb_Tot, @Line22_TotDisb_Tot); -- Return value to show new header row added. SELECT 0; RETURN 0; SET NOCOUNT OFF GO -- This stored procedure adds a header row to Contribs_FormF3P CREATE PROC [dbo].[usp_AddF3PHeader] (@ImageID varchar (9), @FormType char (4), @CommID char (9), @CommName varchar (90), @AddressChange varchar (1), @CommAddress1 varchar (34), @CommAddress2 varchar (34), @CommCity varchar (18), @CommState varchar (2), @CommZip varchar (9), @ActivityPrim varchar (1), @ActivityGen varchar (1), @ReptCode varchar (3), @ElecCode varchar (5), @strElecDate varchar (8), @ElecState varchar (2), @strFromDate varchar (8), @strToDate varchar (8), @TreasLastName varchar (30), @TreasFirstName varchar (20), @TreasMidName varchar (20), @TreasPrefix varchar (10), @TreasSuffix varchar (10), @strDateSigned char (8), @Line6_CashBegin varchar (12), @Line7_TotReceipts varchar (12), @Line8_Subtotal varchar (12), @Line9_TotalDisb varchar (12), @Line10_CashClose varchar (12), @Line11_DebtsTo varchar (12), @Line12_DebtsBy varchar (12), @Line13_ExpendsSubToLimits varchar (12), @Line14_NetContribs varchar (12), @Line15_NetOpExps varchar (12), @Line16_FedFunds_Prd varchar (12), @Line17a1_IndivsItemzd_Prd varchar (12), @Line17a2_IndivsUnItemzd_Prd varchar (12), @Line17a3_IndContTot_Prd varchar (12), @Line17b_PolPartyComms_Prd varchar (12), @Line17c_OtherPACs_Prd varchar (12), @Line17d_Candidate_Prd varchar (12), @Line17e_TotContribs_Prd varchar (12), @Line18_TransfersFrom_Prd varchar (12), @Line19a_CandLoans_Prd varchar (12), @Line19b_OtherLoans_Prd varchar (12), @Line19c_TotLoans_Prd varchar (12), @Line20a_Operating_Prd varchar (12), @Line20b_Fundraising_Prd varchar (12), @Line20c_LegalAcctg_Prd varchar (12), @Line20d_TotExpOffsets_Prd varchar (12), @Line21_OtherReceipts_Prd varchar (12), @Line22_TotReceipts_Prd varchar (12), @Line23_OpExpends_Prd varchar (12), @Line24_TransToOtherComms_Prd varchar (12), @Line25_FundraisingDisbursed_Prd varchar (12), @Line26_ExemptLegalAcctgDisb_Prd varchar (12), @Line27a_CandRepymts_Prd varchar (12), @Line27b_OtherRepymts_Prd varchar (12), @Line27c_TotLoanRepymts_Prd varchar (12), @Line28a_IndivRefunds_Prd varchar (12), @Line28b_PolPartyCommRefunds_Prd varchar (12), @Line28c_OtherPolCommRefunds_Prd varchar (12), @Line28d_TotalContRefunds_Prd varchar (12), @Line29_OtherDisb_Prd varchar (12), @Line30_TotDisb_Prd varchar (12), @Line31_ItemsToLiq_Prd varchar (12), @AllocAlabama_Prd varchar (12), @AllocAlaska_Prd varchar (12), @AllocArizona_Prd varchar (12), @AllocArkansas_Prd varchar (12), @AllocCalifornia_Prd varchar (12), @AllocColorado_Prd varchar (12), @AllocConnecticut_Prd varchar (12), @AllocDelaware_Prd varchar (12), @AllocDistCol_Prd varchar (12), @AllocFlorida_Prd varchar (12), @AllocGeorgia_Prd varchar (12), @AllocHawaii_Prd varchar (12), @AllocIdaho_Prd varchar (12), @AllocIllinois_Prd varchar (12), @AllocIndiana_Prd varchar (12), @AllocIowa_Prd varchar (12), @AllocKansas_Prd varchar (12), @AllocKentucky_Prd varchar (12), @AllocLouisiana_Prd varchar (12), @AllocMaine_Prd varchar (12), @AllocMaryland_Prd varchar (12), @AllocMassachusetts_Prd varchar (12), @AllocMichigan_Prd varchar (12), @AllocMinnesota_Prd varchar (12), @AllocMississippi_Prd varchar (12), @AllocMissouri_Prd varchar (12), @AllocMontana_Prd varchar (12), @AllocNebraska_Prd varchar (12), @AllocNevada_Prd varchar (12), @AllocNewHampshire_Prd varchar (12), @AllocNewJersey_Prd varchar (12), @AllocNewMexico_Prd varchar (12), @AllocNewYork_Prd varchar (12), @AllocNorthCarolina_Prd varchar (12), @AllocNorthDakota_Prd varchar (12), @AllocOhio_Prd varchar (12), @AllocOklahoma_Prd varchar (12), @AllocOregon_Prd varchar (12), @AllocPennsylvania_Prd varchar (12), @AllocRhodeIsland_Prd varchar (12), @AllocSouthCarolina_Prd varchar (12), @AllocSouthDakota_Prd varchar (12), @AllocTennessee_Prd varchar (12), @AllocTexas_Prd varchar (12), @AllocUtah_Prd varchar (12), @AllocVermont_Prd varchar (12), @AllocVirginia_Prd varchar (12), @AllocWashington_Prd varchar (12), @AllocWestVirginia_Prd varchar (12), @AllocWisconsin_Prd varchar (12), @AllocWyoming_Prd varchar (12), @AllocPuertoRico_Prd varchar (12), @AllocGuam_Prd varchar (12), @AllocVirginIslands_Prd varchar (12), @AllocStatesTotal_Prd varchar (12), @Line16_FedFunds_Tot varchar (12), @Line17a1_IndivsItemzd_Tot varchar (12), @Line17a2_IndivsUnItemzd_Tot varchar (12), @Line17a3_IndContTot_Tot varchar (12), @Line17b_PolPartyComms_Tot varchar (12), @Line17c_OtherPACs_Tot varchar (12), @Line17d_Candidate_Tot varchar (12), @Line17e_TotContribs_Tot varchar (12), @Line18_TransfersFrom_Tot varchar (12), @Line19a_CandLoans_Tot varchar (12), @Line19b_OtherLoans_Tot varchar (12), @Line19c_TotLoans_Tot varchar (12), @Line20a_Operating_Tot varchar (12), @Line20b_Fundraising_Tot varchar (12), @Line20c_LegalAcctg_Tot varchar (12), @Line20d_TotExpOffsets_Tot varchar (12), @Line21_OtherReceipts_Tot varchar (12), @Line22_TotReceipts_Tot varchar (12), @Line23_OpExpends_Tot varchar (12), @Line24_TransToOtherComms_Tot varchar (12), @Line25_FundraisingDisbursed_Tot varchar (12), @Line26_ExemptLegalAcctgDisb_Tot varchar (12), @Line27a_CandRepymts_Tot varchar (12), @Line27b_OtherRepymts_Tot varchar (12), @Line27c_TotLoanRepymts_Tot varchar (12), @Line28a_IndivRefunds_Tot varchar (12), @Line28b_PolPartyCommRefunds_Tot varchar (12), @Line28c_OtherPolCommRefunds_Tot varchar (12), @Line28d_TotalContRefunds_Tot varchar (12), @Line29_OtherDisb_Tot varchar (12), @Line30_TotDisb_Tot varchar (12), @AllocAlabama_Tot varchar (12), @AllocAlaska_Tot varchar (12), @AllocArizona_Tot varchar (12), @AllocArkansas_Tot varchar (12), @AllocCalifornia_Tot varchar (12), @AllocColorado_Tot varchar (12), @AllocConnecticut_Tot varchar (12), @AllocDelaware_Tot varchar (12), @AllocDistCol_Tot varchar (12), @AllocFlorida_Tot varchar (12), @AllocGeorgia_Tot varchar (12), @AllocHawaii_Tot varchar (12), @AllocIdaho_Tot varchar (12), @AllocIllinois_Tot varchar (12), @AllocIndiana_Tot varchar (12), @AllocIowa_Tot varchar (12), @AllocKansas_Tot varchar (12), @AllocKentucky_Tot varchar (12), @AllocLouisiana_Tot varchar (12), @AllocMaine_Tot varchar (12), @AllocMaryland_Tot varchar (12), @AllocMassachusetts_Tot varchar (12), @AllocMichigan_Tot varchar (12), @AllocMinnesota_Tot varchar (12), @AllocMississippi_Tot varchar (12), @AllocMissouri_Tot varchar (12), @AllocMontana_Tot varchar (12), @AllocNebraska_Tot varchar (12), @AllocNevada_Tot varchar (12), @AllocNewHampshire_Tot varchar (12), @AllocNewJersey_Tot varchar (12), @AllocNewMexico_Tot varchar (12), @AllocNewYork_Tot varchar (12), @AllocNorthCarolina_Tot varchar (12), @AllocNorthDakota_Tot varchar (12), @AllocOhio_Tot varchar (12), @AllocOklahoma_Tot varchar (12), @AllocOregon_Tot varchar (12), @AllocPennsylvania_Tot varchar (12), @AllocRhodeIsland_Tot varchar (12), @AllocSouthCarolina_Tot varchar (12), @AllocSouthDakota_Tot varchar (12), @AllocTennessee_Tot varchar (12), @AllocTexas_Tot varchar (12), @AllocUtah_Tot varchar (12), @AllocVermont_Tot varchar (12), @AllocVirginia_Tot varchar (12), @AllocWashington_Tot varchar (12), @AllocWestVirginia_Tot varchar (12), @AllocWisconsin_Tot varchar (12), @AllocWyoming_Tot varchar (12), @AllocPuertoRico_Tot varchar (12), @AllocGuam_Tot varchar (12), @AllocVirginIslands_Tot varchar (12), @AllocStatesTotal_Tot varchar (12)) AS SET NOCOUNT ON -- See if this file already has been imported -- If so, return -1 IF EXISTS (SELECT ImageID FROM dbo.Contribs_FormF3P WHERE ImageID = @ImageID) BEGIN SELECT -1; RETURN 0; END -- Otherwise, insert the header INSERT INTO dbo.Contribs_FormF3P ([ImageID], [FormType], [CommID], [CommName], [AddressChange], [CommAddress1], [CommAddress2], [CommCity], [CommState], [CommZip], [ActivityPrim], [ActivityGen], [ReptCode], [ElecCode], [strElecDate], [ElecState], [strFromDate], [strToDate], [TreasLastName], [TreasFirstName], [TreasMidName], [TreasPrefix], [TreasSuffix], [strDateSigned], [Line6_CashBegin], [Line7_TotReceipts], [Line8_Subtotal], [Line9_TotalDisb], [Line10_CashClose], [Line11_DebtsTo], [Line12_DebtsBy], [Line13_ExpendsSubToLimits], [Line14_NetContribs], [Line15_NetOpExps], [Line16_FedFunds_Prd], [Line17a1_IndivsItemzd_Prd], [Line17a2_IndivsUnItemzd_Prd], [Line17a3_IndContTot_Prd], [Line17b_PolPartyComms_Prd], [Line17c_OtherPACs_Prd], [Line17d_Candidate_Prd], [Line17e_TotContribs_Prd], [Line18_TransfersFrom_Prd], [Line19a_CandLoans_Prd], [Line19b_OtherLoans_Prd], [Line19c_TotLoans_Prd], [Line20a_Operating_Prd], [Line20b_Fundraising_Prd], [Line20c_LegalAcctg_Prd], [Line20d_TotExpOffsets_Prd], [Line21_OtherReceipts_Prd], [Line22_TotReceipts_Prd], [Line23_OpExpends_Prd], [Line24_TransToOtherComms_Prd], [Line25_FundraisingDisbursed_Prd], [Line26_ExemptLegalAcctgDisb_Prd], [Line27a_CandRepymts_Prd], [Line27b_OtherRepymts_Prd], [Line27c_TotLoanRepymts_Prd], [Line28a_IndivRefunds_Prd], [Line28b_PolPartyCommRefunds_Prd], [Line28c_OtherPolCommRefunds_Prd], [Line28d_TotalContRefunds_Prd], [Line29_OtherDisb_Prd], [Line30_TotDisb_Prd], [Line31_ItemsToLiq_Prd], [AllocAlabama_Prd], [AllocAlaska_Prd], [AllocArizona_Prd], [AllocArkansas_Prd], [AllocCalifornia_Prd], [AllocColorado_Prd], [AllocConnecticut_Prd], [AllocDelaware_Prd], [AllocDistCol_Prd], [AllocFlorida_Prd], [AllocGeorgia_Prd], [AllocHawaii_Prd], [AllocIdaho_Prd], [AllocIllinois_Prd], [AllocIndiana_Prd], [AllocIowa_Prd], [AllocKansas_Prd], [AllocKentucky_Prd], [AllocLouisiana_Prd], [AllocMaine_Prd], [AllocMaryland_Prd], [AllocMassachusetts_Prd], [AllocMichigan_Prd], [AllocMinnesota_Prd], [AllocMississippi_Prd], [AllocMissouri_Prd], [AllocMontana_Prd], [AllocNebraska_Prd], [AllocNevada_Prd], [AllocNewHampshire_Prd], [AllocNewJersey_Prd], [AllocNewMexico_Prd], [AllocNewYork_Prd], [AllocNorthCarolina_Prd], [AllocNorthDakota_Prd], [AllocOhio_Prd], [AllocOklahoma_Prd], [AllocOregon_Prd], [AllocPennsylvania_Prd], [AllocRhodeIsland_Prd], [AllocSouthCarolina_Prd], [AllocSouthDakota_Prd], [AllocTennessee_Prd], [AllocTexas_Prd], [AllocUtah_Prd], [AllocVermont_Prd], [AllocVirginia_Prd], [AllocWashington_Prd], [AllocWestVirginia_Prd], [AllocWisconsin_Prd], [AllocWyoming_Prd], [AllocPuertoRico_Prd], [AllocGuam_Prd], [AllocVirginIslands_Prd], [AllocStatesTotal_Prd], [Line16_FedFunds_Tot], [Line17a1_IndivsItemzd_Tot], [Line17a2_IndivsUnItemzd_Tot], [Line17a3_IndContTot_Tot], [Line17b_PolPartyComms_Tot], [Line17c_OtherPACs_Tot], [Line17d_Candidate_Tot], [Line17e_TotContribs_Tot], [Line18_TransfersFrom_Tot], [Line19a_CandLoans_Tot], [Line19b_OtherLoans_Tot], [Line19c_TotLoans_Tot], [Line20a_Operating_Tot], [Line20b_Fundraising_Tot], [Line20c_LegalAcctg_Tot], [Line20d_TotExpOffsets_Tot], [Line21_OtherReceipts_Tot], [Line22_TotReceipts_Tot], [Line23_OpExpends_Tot], [Line24_TransToOtherComms_Tot], [Line25_FundraisingDisbursed_Tot], [Line26_ExemptLegalAcctgDisb_Tot], [Line27a_CandRepymts_Tot], [Line27b_OtherRepymts_Tot], [Line27c_TotLoanRepymts_Tot], [Line28a_IndivRefunds_Tot], [Line28b_PolPartyCommRefunds_Tot], [Line28c_OtherPolCommRefunds_Tot], [Line28d_TotalContRefunds_Tot], [Line29_OtherDisb_Tot], [Line30_TotDisb_Tot], [AllocAlabama_Tot], [AllocAlaska_Tot], [AllocArizona_Tot], [AllocArkansas_Tot], [AllocCalifornia_Tot], [AllocColorado_Tot], [AllocConnecticut_Tot], [AllocDelaware_Tot], [AllocDistCol_Tot], [AllocFlorida_Tot], [AllocGeorgia_Tot], [AllocHawaii_Tot], [AllocIdaho_Tot], [AllocIllinois_Tot], [AllocIndiana_Tot], [AllocIowa_Tot], [AllocKansas_Tot], [AllocKentucky_Tot], [AllocLouisiana_Tot], [AllocMaine_Tot], [AllocMaryland_Tot], [AllocMassachusetts_Tot], [AllocMichigan_Tot], [AllocMinnesota_Tot], [AllocMississippi_Tot], [AllocMissouri_Tot], [AllocMontana_Tot], [AllocNebraska_Tot], [AllocNevada_Tot], [AllocNewHampshire_Tot], [AllocNewJersey_Tot], [AllocNewMexico_Tot], [AllocNewYork_Tot], [AllocNorthCarolina_Tot], [AllocNorthDakota_Tot], [AllocOhio_Tot], [AllocOklahoma_Tot], [AllocOregon_Tot], [AllocPennsylvania_Tot], [AllocRhodeIsland_Tot], [AllocSouthCarolina_Tot], [AllocSouthDakota_Tot], [AllocTennessee_Tot], [AllocTexas_Tot], [AllocUtah_Tot], [AllocVermont_Tot], [AllocVirginia_Tot], [AllocWashington_Tot], [AllocWestVirginia_Tot], [AllocWisconsin_Tot], [AllocWyoming_Tot], [AllocPuertoRico_Tot], [AllocGuam_Tot], [AllocVirginIslands_Tot], [AllocStatesTotal_Tot]) VALUES (@ImageID, @FormType, @CommID, @CommName, @AddressChange, @CommAddress1, @CommAddress2, @CommCity, @CommState, @CommZip, @ActivityPrim, @ActivityGen, @ReptCode, @ElecCode, @strElecDate, @ElecState, @strFromDate, @strToDate, @TreasLastName, @TreasFirstName, @TreasMidName, @TreasPrefix, @TreasSuffix, @strDateSigned, @Line6_CashBegin, @Line7_TotReceipts, @Line8_Subtotal, @Line9_TotalDisb, @Line10_CashClose, @Line11_DebtsTo, @Line12_DebtsBy, @Line13_ExpendsSubToLimits, @Line14_NetContribs, @Line15_NetOpExps, @Line16_FedFunds_Prd, @Line17a1_IndivsItemzd_Prd, @Line17a2_IndivsUnItemzd_Prd, @Line17a3_IndContTot_Prd, @Line17b_PolPartyComms_Prd, @Line17c_OtherPACs_Prd, @Line17d_Candidate_Prd, @Line17e_TotContribs_Prd, @Line18_TransfersFrom_Prd, @Line19a_CandLoans_Prd, @Line19b_OtherLoans_Prd, @Line19c_TotLoans_Prd, @Line20a_Operating_Prd, @Line20b_Fundraising_Prd, @Line20c_LegalAcctg_Prd, @Line20d_TotExpOffsets_Prd, @Line21_OtherReceipts_Prd, @Line22_TotReceipts_Prd, @Line23_OpExpends_Prd, @Line24_TransToOtherComms_Prd, @Line25_FundraisingDisbursed_Prd, @Line26_ExemptLegalAcctgDisb_Prd, @Line27a_CandRepymts_Prd, @Line27b_OtherRepymts_Prd, @Line27c_TotLoanRepymts_Prd, @Line28a_IndivRefunds_Prd, @Line28b_PolPartyCommRefunds_Prd, @Line28c_OtherPolCommRefunds_Prd, @Line28d_TotalContRefunds_Prd, @Line29_OtherDisb_Prd, @Line30_TotDisb_Prd, @Line31_ItemsToLiq_Prd, @AllocAlabama_Prd, @AllocAlaska_Prd, @AllocArizona_Prd, @AllocArkansas_Prd, @AllocCalifornia_Prd, @AllocColorado_Prd, @AllocConnecticut_Prd, @AllocDelaware_Prd, @AllocDistCol_Prd, @AllocFlorida_Prd, @AllocGeorgia_Prd, @AllocHawaii_Prd, @AllocIdaho_Prd, @AllocIllinois_Prd, @AllocIndiana_Prd, @AllocIowa_Prd, @AllocKansas_Prd, @AllocKentucky_Prd, @AllocLouisiana_Prd, @AllocMaine_Prd, @AllocMaryland_Prd, @AllocMassachusetts_Prd, @AllocMichigan_Prd, @AllocMinnesota_Prd, @AllocMississippi_Prd, @AllocMissouri_Prd, @AllocMontana_Prd, @AllocNebraska_Prd, @AllocNevada_Prd, @AllocNewHampshire_Prd, @AllocNewJersey_Prd, @AllocNewMexico_Prd, @AllocNewYork_Prd, @AllocNorthCarolina_Prd, @AllocNorthDakota_Prd, @AllocOhio_Prd, @AllocOklahoma_Prd, @AllocOregon_Prd, @AllocPennsylvania_Prd, @AllocRhodeIsland_Prd, @AllocSouthCarolina_Prd, @AllocSouthDakota_Prd, @AllocTennessee_Prd, @AllocTexas_Prd, @AllocUtah_Prd, @AllocVermont_Prd, @AllocVirginia_Prd, @AllocWashington_Prd, @AllocWestVirginia_Prd, @AllocWisconsin_Prd, @AllocWyoming_Prd, @AllocPuertoRico_Prd, @AllocGuam_Prd, @AllocVirginIslands_Prd, @AllocStatesTotal_Prd, @Line16_FedFunds_Tot, @Line17a1_IndivsItemzd_Tot, @Line17a2_IndivsUnItemzd_Tot, @Line17a3_IndContTot_Tot, @Line17b_PolPartyComms_Tot, @Line17c_OtherPACs_Tot, @Line17d_Candidate_Tot, @Line17e_TotContribs_Tot, @Line18_TransfersFrom_Tot, @Line19a_CandLoans_Tot, @Line19b_OtherLoans_Tot, @Line19c_TotLoans_Tot, @Line20a_Operating_Tot, @Line20b_Fundraising_Tot, @Line20c_LegalAcctg_Tot, @Line20d_TotExpOffsets_Tot, @Line21_OtherReceipts_Tot, @Line22_TotReceipts_Tot, @Line23_OpExpends_Tot, @Line24_TransToOtherComms_Tot, @Line25_FundraisingDisbursed_Tot, @Line26_ExemptLegalAcctgDisb_Tot, @Line27a_CandRepymts_Tot, @Line27b_OtherRepymts_Tot, @Line27c_TotLoanRepymts_Tot, @Line28a_IndivRefunds_Tot, @Line28b_PolPartyCommRefunds_Tot, @Line28c_OtherPolCommRefunds_Tot, @Line28d_TotalContRefunds_Tot, @Line29_OtherDisb_Tot, @Line30_TotDisb_Tot, @AllocAlabama_Tot, @AllocAlaska_Tot, @AllocArizona_Tot, @AllocArkansas_Tot, @AllocCalifornia_Tot, @AllocColorado_Tot, @AllocConnecticut_Tot, @AllocDelaware_Tot, @AllocDistCol_Tot, @AllocFlorida_Tot, @AllocGeorgia_Tot, @AllocHawaii_Tot, @AllocIdaho_Tot, @AllocIllinois_Tot, @AllocIndiana_Tot, @AllocIowa_Tot, @AllocKansas_Tot, @AllocKentucky_Tot, @AllocLouisiana_Tot, @AllocMaine_Tot, @AllocMaryland_Tot, @AllocMassachusetts_Tot, @AllocMichigan_Tot, @AllocMinnesota_Tot, @AllocMississippi_Tot, @AllocMissouri_Tot, @AllocMontana_Tot, @AllocNebraska_Tot, @AllocNevada_Tot, @AllocNewHampshire_Tot, @AllocNewJersey_Tot, @AllocNewMexico_Tot, @AllocNewYork_Tot, @AllocNorthCarolina_Tot, @AllocNorthDakota_Tot, @AllocOhio_Tot, @AllocOklahoma_Tot, @AllocOregon_Tot, @AllocPennsylvania_Tot, @AllocRhodeIsland_Tot, @AllocSouthCarolina_Tot, @AllocSouthDakota_Tot, @AllocTennessee_Tot, @AllocTexas_Tot, @AllocUtah_Tot, @AllocVermont_Tot, @AllocVirginia_Tot, @AllocWashington_Tot, @AllocWestVirginia_Tot, @AllocWisconsin_Tot, @AllocWyoming_Tot, @AllocPuertoRico_Tot, @AllocGuam_Tot, @AllocVirginIslands_Tot, @AllocStatesTotal_Tot); -- Return value to show new header row added. SELECT 0; RETURN 0; SET NOCOUNT OFF GO -- This stored procedure adds a header row to Contribs_FormF3X CREATE PROC [dbo].[usp_AddF3XHeader] (@ImageID varchar (9), @FormType char (4), @CommID char (9), @CommName varchar (90), @AddressChange varchar (1), @CommAddress1 varchar (34), @CommAddress2 varchar (34), @CommCity varchar (18), @CommState varchar (2), @CommZip varchar (9), @ReptCode varchar (3), @ElecCode varchar (5), @strElecDate varchar (8), @ElecState varchar (2), @strFromDate varchar (8), @strToDate varchar (8), @flgQualifiedComm varchar (1), @TreasLastName varchar (30), @TreasFirstName varchar (20), @TreasMidName varchar (20), @TreasPrefix varchar (10), @TreasSuffix varchar (10), @strDateSigned char (8), @Line6b_CashBegin_Prd varchar (12), @Line6c_TotalRects_Prd varchar (12), @Line6d_CashBeginSubtotal_Prd varchar (12), @Line7_TotDisbmts_Prd varchar (12), @Line8_CashOnHandAtClose_Prd varchar (12), @Line9_DebtsTo_Prd varchar (12), @Line10_DebtsBy_Prd varchar (12), @Line11a1_Itemized_Prd varchar (12), @Line11a2_Unitemized_Prd varchar (12), @Line11a3_Total_Prd varchar (12), @Line11b_PolPtyComms_Prd varchar (12), @Line11c_OtherPACs_Prd varchar (12), @Line11d_TotalContribs_Prd varchar (12), @Line12_TransfersFrom_Prd varchar (12), @Line13_AllLoansRcvd_Prd varchar (12), @Line14_LoanRepymtsRecv_Prd varchar (12), @Line15_OffsetsToOpExps_Refunds_Prd varchar (12), @Line16_RefundsOfFedContribs_Prd varchar (12), @Line17_OtherFedRects_Divds_Prd varchar (12), @Line18a_TransfersFromNonFedAcct_H3_Prd varchar (12), @Line18b_TransfersFromNonFed_LevinH5_Prd varchar (12), @Line18c_TotalNonFedTransfers_Prd varchar (12), @Line19_TotalReceipts_Prd varchar (12), @Line20_TotalFedReceipts_Prd varchar (12), @Line21a1_FedShare_Prd varchar (12), @Line21a2_NonFedShare_Prd varchar (12), @Line21b_OtherFedOpExps_Prd varchar (12), @Line21c_TotOpExps_Prd varchar (12), @Line22_TransToOtherComms_Prd varchar (12), @Line23_ContribsToFedCandsOrComms_Prd varchar (12), @Line24_IndptExps_Prd varchar (12), @Line25_CoordtdExpByPrtyComms_Prd varchar (12), @Line26_LoanRepayments_Prd varchar (12), @Line27_LoansMade_Prd varchar (12), @Line28a_IndivRefunds_Prd varchar (12), @Line28b_PolPartyCommRefunds_Prd varchar (12), @Line28c_OtherPolCommRefunds_Prd varchar (12), @Line28d_TotalContRefunds_Prd varchar (12), @Line29_OtherDisb_Prd varchar (12), @Line30a1_SharedFedActH6FedShare_Prd varchar (12), @Line30a2_SharedFedActH6NonFed_Prd varchar (12), @Line30b_NonAlloc100PctFedElecActivity_Prd varchar (12), @Line30c_TotFedElecActivity_Prd varchar (12), @Line31_TotDisbmts_Prd varchar (12), @Line32_TotFedDisbmts_Prd varchar (12), @Line33_TotContribs_Prd varchar (12), @Line34_TotContribRefunds_Prd varchar (12), @Line35_NetContribs_Prd varchar (12), @Line36_TotFedOpExps_Prd varchar (12), @Line37_OffsetsToOpExps_Prd varchar (12), @Line38_NetOpExps_Prd varchar (12), @Line6b_CashBegin_Tot varchar (12), @Line6b_Year varchar (12), @Line6c_TotalRects_Tot varchar (12), @Line6d_CashBeginSubtotal_Tot varchar (12), @Line7_TotDisbmts_Tot varchar (12), @Line8_CashOnHandAtClose_Tot varchar (12), @Line11a1_Itemized_Tot varchar (12), @Line11a2_Unitemized_Tot varchar (12), @Line11a3_Total_Tot varchar (12), @Line11b_PolPtyComms_Tot varchar (12), @Line11c_OtherPACs_Tot varchar (12), @Line11d_TotalContribs_Tot varchar (12), @Line12_TransfersFrom_Tot varchar (12), @Line13_AllLoansRcvd_Tot varchar (12), @Line14_LoanRepymtsRecv_Tot varchar (12), @Line15_OffsetsToOpExps_Refunds_Tot varchar (12), @Line16_RefundsOfFedContribs_Tot varchar (12), @Line17_OtherFedRects_Divds_Tot varchar (12), @Line18a_TransfersFromNonFedAcct_H3_Tot varchar (12), @Line18b_TransfersFromNonFed_LevinH5_Tot varchar (12), @Line18c_TotalNonFedTransfers_Tot varchar (12), @Line19_TotalReceipts_Tot varchar (12), @Line20_TotalFedReceipts_Tot varchar (12), @Line21a1_FedShare_Tot varchar (12), @Line21a2_NonFedShare_Tot varchar (12), @Line21b_OtherFedOpExps_Tot varchar (12), @Line21c_TotOpExps_Tot varchar (12), @Line22_TransToOtherComms_Tot varchar (12), @Line23_ContribsToFedCandsOrComms_Tot varchar (12), @Line24_IndptExps_Tot varchar (12), @Line25_CoordtdExpByPrtyComms_Tot varchar (12), @Line26_LoanRepayments_Tot varchar (12), @Line27_LoansMade_Tot varchar (12), @Line28a_IndivRefunds_Tot varchar (12), @Line28b_PolPartyCommRefunds_Tot varchar (12), @Line28c_OtherPolCommRefunds_Tot varchar (12), @Line28d_TotalContRefunds_Tot varchar (12), @Line29_OtherDisb_Tot varchar (12), @Line30a1_SharedFedActH6FedShare_Tot varchar (12), @Line30a2_SharedFedActH6NonFed_Tot varchar (12), @Line30b_NonAlloc100PctFedElecActivity_Tot varchar (12), @Line30c_TotFedElecActivity_Tot varchar (12), @Line31_TotDisbmts_Tot varchar (12), @Line32_TotFedDisbmts_Tot varchar (12), @Line33_TotContribs_Tot varchar (12), @Line34_TotContribRefunds_Tot varchar (12), @Line35_NetContribs_Tot varchar (12), @Line36_TotFedOpExps_Tot varchar (12), @Line37_OffsetsToOpExps_Tot varchar (12), @Line38_NetOpExps_Tot varchar (12)) AS SET NOCOUNT ON -- See if this file already has been imported -- If so, return -1 IF EXISTS (SELECT ImageID FROM dbo.Contribs_FormF3X WHERE ImageID = @ImageID) BEGIN SELECT -1; RETURN 0; END -- Otherwise, insert the header INSERT INTO dbo.Contribs_FormF3X ([ImageID], [FormType], [CommID], [CommName], [AddressChange], [CommAddress1], [CommAddress2], [CommCity], [CommState], [CommZip], [ReptCode], [ElecCode], [strElecDate], [ElecState], [strFromDate], [strToDate], [flgQualifiedComm], [TreasLastName], [TreasFirstName], [TreasMidName], [TreasPrefix], [TreasSuffix], [strDateSigned], [Line6b_CashBegin_Prd], [Line6c_TotalRects_Prd], [Line6d_CashBeginSubtotal_Prd], [Line7_TotDisbmts_Prd], [Line8_CashOnHandAtClose_Prd], [Line9_DebtsTo_Prd], [Line10_DebtsBy_Prd], [Line11a1_Itemized_Prd], [Line11a2_Unitemized_Prd], [Line11a3_Total_Prd], [Line11b_PolPtyComms_Prd], [Line11c_OtherPACs_Prd], [Line11d_TotalContribs_Prd], [Line12_TransfersFrom_Prd], [Line13_AllLoansRcvd_Prd], [Line14_LoanRepymtsRecv_Prd], [Line15_OffsetsToOpExps_Refunds_Prd], [Line16_RefundsOfFedContribs_Prd], [Line17_OtherFedRects_Divds_Prd], [Line18a_TransfersFromNonFedAcct_H3_Prd], [Line18b_TransfersFromNonFed_LevinH5_Prd], [Line18c_TotalNonFedTransfers_Prd], [Line19_TotalReceipts_Prd], [Line20_TotalFedReceipts_Prd], [Line21a1_FedShare_Prd], [Line21a2_NonFedShare_Prd], [Line21b_OtherFedOpExps_Prd], [Line21c_TotOpExps_Prd], [Line22_TransToOtherComms_Prd], [Line23_ContribsToFedCandsOrComms_Prd], [Line24_IndptExps_Prd], [Line25_CoordtdExpByPrtyComms_Prd], [Line26_LoanRepayments_Prd], [Line27_LoansMade_Prd], [Line28a_IndivRefunds_Prd], [Line28b_PolPartyCommRefunds_Prd], [Line28c_OtherPolCommRefunds_Prd], [Line28d_TotalContRefunds_Prd], [Line29_OtherDisb_Prd], [Line30a1_SharedFedActH6FedShare_Prd], [Line30a2_SharedFedActH6NonFed_Prd], [Line30b_NonAlloc100PctFedElecActivity_Prd], [Line30c_TotFedElecActivity_Prd], [Line31_TotDisbmts_Prd], [Line32_TotFedDisbmts_Prd], [Line33_TotContribs_Prd], [Line34_TotContribRefunds_Prd], [Line35_NetContribs_Prd], [Line36_TotFedOpExps_Prd], [Line37_OffsetsToOpExps_Prd], [Line38_NetOpExps_Prd], [Line6b_CashBegin_Tot], [Line6b_Year], [Line6c_TotalRects_Tot], [Line6d_CashBeginSubtotal_Tot], [Line7_TotDisbmts_Tot], [Line8_CashOnHandAtClose_Tot], [Line11a1_Itemized_Tot], [Line11a2_Unitemized_Tot], [Line11a3_Total_Tot], [Line11b_PolPtyComms_Tot], [Line11c_OtherPACs_Tot], [Line11d_TotalContribs_Tot], [Line12_TransfersFrom_Tot], [Line13_AllLoansRcvd_Tot], [Line14_LoanRepymtsRecv_Tot], [Line15_OffsetsToOpExps_Refunds_Tot], [Line16_RefundsOfFedContribs_Tot], [Line17_OtherFedRects_Divds_Tot], [Line18a_TransfersFromNonFedAcct_H3_Tot], [Line18b_TransfersFromNonFed_LevinH5_Tot], [Line18c_TotalNonFedTransfers_Tot], [Line19_TotalReceipts_Tot], [Line20_TotalFedReceipts_Tot], [Line21a1_FedShare_Tot], [Line21a2_NonFedShare_Tot], [Line21b_OtherFedOpExps_Tot], [Line21c_TotOpExps_Tot], [Line22_TransToOtherComms_Tot], [Line23_ContribsToFedCandsOrComms_Tot], [Line24_IndptExps_Tot], [Line25_CoordtdExpByPrtyComms_Tot], [Line26_LoanRepayments_Tot], [Line27_LoansMade_Tot], [Line28a_IndivRefunds_Tot], [Line28b_PolPartyCommRefunds_Tot], [Line28c_OtherPolCommRefunds_Tot], [Line28d_TotalContRefunds_Tot], [Line29_OtherDisb_Tot], [Line30a1_SharedFedActH6FedShare_Tot], [Line30a2_SharedFedActH6NonFed_Tot], [Line30b_NonAlloc100PctFedElecActivity_Tot], [Line30c_TotFedElecActivity_Tot], [Line31_TotDisbmts_Tot], [Line32_TotFedDisbmts_Tot], [Line33_TotContribs_Tot], [Line34_TotContribRefunds_Tot], [Line35_NetContribs_Tot], [Line36_TotFedOpExps_Tot], [Line37_OffsetsToOpExps_Tot], [Line38_NetOpExps_Tot]) VALUES (@ImageID, @FormType, @CommID, @CommName, @AddressChange, @CommAddress1, @CommAddress2, @CommCity, @CommState, @CommZip, @ReptCode, @ElecCode, @strElecDate, @ElecState, @strFromDate, @strToDate, @flgQualifiedComm, @TreasLastName, @TreasFirstName, @TreasMidName, @TreasPrefix, @TreasSuffix, @strDateSigned, @Line6b_CashBegin_Prd, @Line6c_TotalRects_Prd, @Line6d_CashBeginSubtotal_Prd, @Line7_TotDisbmts_Prd, @Line8_CashOnHandAtClose_Prd, @Line9_DebtsTo_Prd, @Line10_DebtsBy_Prd, @Line11a1_Itemized_Prd, @Line11a2_Unitemized_Prd, @Line11a3_Total_Prd, @Line11b_PolPtyComms_Prd, @Line11c_OtherPACs_Prd, @Line11d_TotalContribs_Prd, @Line12_TransfersFrom_Prd, @Line13_AllLoansRcvd_Prd, @Line14_LoanRepymtsRecv_Prd, @Line15_OffsetsToOpExps_Refunds_Prd, @Line16_RefundsOfFedContribs_Prd, @Line17_OtherFedRects_Divds_Prd, @Line18a_TransfersFromNonFedAcct_H3_Prd, @Line18b_TransfersFromNonFed_LevinH5_Prd, @Line18c_TotalNonFedTransfers_Prd, @Line19_TotalReceipts_Prd, @Line20_TotalFedReceipts_Prd, @Line21a1_FedShare_Prd, @Line21a2_NonFedShare_Prd, @Line21b_OtherFedOpExps_Prd, @Line21c_TotOpExps_Prd, @Line22_TransToOtherComms_Prd, @Line23_ContribsToFedCandsOrComms_Prd, @Line24_IndptExps_Prd, @Line25_CoordtdExpByPrtyComms_Prd, @Line26_LoanRepayments_Prd, @Line27_LoansMade_Prd, @Line28a_IndivRefunds_Prd, @Line28b_PolPartyCommRefunds_Prd, @Line28c_OtherPolCommRefunds_Prd, @Line28d_TotalContRefunds_Prd, @Line29_OtherDisb_Prd, @Line30a1_SharedFedActH6FedShare_Prd, @Line30a2_SharedFedActH6NonFed_Prd, @Line30b_NonAlloc100PctFedElecActivity_Prd, @Line30c_TotFedElecActivity_Prd, @Line31_TotDisbmts_Prd, @Line32_TotFedDisbmts_Prd, @Line33_TotContribs_Prd, @Line34_TotContribRefunds_Prd, @Line35_NetContribs_Prd, @Line36_TotFedOpExps_Prd, @Line37_OffsetsToOpExps_Prd, @Line38_NetOpExps_Prd, @Line6b_CashBegin_Tot, @Line6b_Year, @Line6c_TotalRects_Tot, @Line6d_CashBeginSubtotal_Tot, @Line7_TotDisbmts_Tot, @Line8_CashOnHandAtClose_Tot, @Line11a1_Itemized_Tot, @Line11a2_Unitemized_Tot, @Line11a3_Total_Tot, @Line11b_PolPtyComms_Tot, @Line11c_OtherPACs_Tot, @Line11d_TotalContribs_Tot, @Line12_TransfersFrom_Tot, @Line13_AllLoansRcvd_Tot, @Line14_LoanRepymtsRecv_Tot, @Line15_OffsetsToOpExps_Refunds_Tot, @Line16_RefundsOfFedContribs_Tot, @Line17_OtherFedRects_Divds_Tot, @Line18a_TransfersFromNonFedAcct_H3_Tot, @Line18b_TransfersFromNonFed_LevinH5_Tot, @Line18c_TotalNonFedTransfers_Tot, @Line19_TotalReceipts_Tot, @Line20_TotalFedReceipts_Tot, @Line21a1_FedShare_Tot, @Line21a2_NonFedShare_Tot, @Line21b_OtherFedOpExps_Tot, @Line21c_TotOpExps_Tot, @Line22_TransToOtherComms_Tot, @Line23_ContribsToFedCandsOrComms_Tot, @Line24_IndptExps_Tot, @Line25_CoordtdExpByPrtyComms_Tot, @Line26_LoanRepayments_Tot, @Line27_LoansMade_Tot, @Line28a_IndivRefunds_Tot, @Line28b_PolPartyCommRefunds_Tot, @Line28c_OtherPolCommRefunds_Tot, @Line28d_TotalContRefunds_Tot, @Line29_OtherDisb_Tot, @Line30a1_SharedFedActH6FedShare_Tot, @Line30a2_SharedFedActH6NonFed_Tot, @Line30b_NonAlloc100PctFedElecActivity_Tot, @Line30c_TotFedElecActivity_Tot, @Line31_TotDisbmts_Tot, @Line32_TotFedDisbmts_Tot, @Line33_TotContribs_Tot, @Line34_TotContribRefunds_Tot, @Line35_NetContribs_Tot, @Line36_TotFedOpExps_Tot, @Line37_OffsetsToOpExps_Tot, @Line38_NetOpExps_Tot); -- Return value to show new header row added. SELECT 0; RETURN 0; SET NOCOUNT OFF GO
48.732799
133
0.777912
e7170928692cdd0bebe5c8cc643ca1131e5e0cfd
2,099
js
JavaScript
docs/examples/promise/01_simple_connect/node_modules/@chainx-v2/api-derive/contracts/fees.js
chainpool/chainx.js-v2
986d810e3e165283bb854d45e6f813c509407a75
[ "Apache-2.0" ]
1
2020-10-03T03:02:13.000Z
2020-10-03T03:02:13.000Z
docs/examples/promise/06_make_transfer/node_modules/@chainx-v2/api-derive/contracts/fees.js
chainpool/chainx.js-v2
986d810e3e165283bb854d45e6f813c509407a75
[ "Apache-2.0" ]
null
null
null
docs/examples/promise/06_make_transfer/node_modules/@chainx-v2/api-derive/contracts/fees.js
chainpool/chainx.js-v2
986d810e3e165283bb854d45e6f813c509407a75
[ "Apache-2.0" ]
1
2020-10-03T03:02:16.000Z
2020-10-03T03:02:16.000Z
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fees = fees; var _rxjs = require("rxjs"); var _operators = require("rxjs/operators"); var _util = require("../util"); // Copyright 2017-2020 @chainx-v2/api-derive authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. // query via constants (current applicable path) function queryConstants(api) { return (0, _rxjs.of)([// deprecated api.consts.contracts.callBaseFee || api.registry.createType('Balance'), api.consts.contracts.contractFee || api.registry.createType('Balance'), api.consts.contracts.creationFee || api.registry.createType('Balance'), api.consts.contracts.transactionBaseFee || api.registry.createType('Balance'), api.consts.contracts.transactionByteFee || api.registry.createType('Balance'), api.consts.contracts.transferFee || api.registry.createType('Balance'), // current api.consts.contracts.rentByteFee, api.consts.contracts.rentDepositOffset, api.consts.contracts.surchargeReward, api.consts.contracts.tombstoneDeposit]); } /** * @name fees * @returns An object containing the combined results of the queries for * all relevant contract fees as declared in the substrate chain spec. * @example * <BR> * * ```javascript * api.derive.contracts.fees(([creationFee, transferFee]) => { * console.log(`The fee for creating a new contract on this chain is ${creationFee} units. The fee required to call this contract is ${transferFee} units.`); * }); * ``` */ function fees(api) { return (0, _util.memo)(() => { return queryConstants(api).pipe((0, _operators.map)(([callBaseFee, contractFee, creationFee, transactionBaseFee, transactionByteFee, transferFee, rentByteFee, rentDepositOffset, surchargeReward, tombstoneDeposit]) => ({ callBaseFee, contractFee, creationFee, rentByteFee, rentDepositOffset, surchargeReward, tombstoneDeposit, transactionBaseFee, transactionByteFee, transferFee }))); }); }
39.603774
458
0.727489
854be706f4247941c3232f2a309a05b6e1d96fe2
138
lua
Lua
mods/myArcade/myhighscore/init.lua
Ganome/OPSkyBlock
8381cbb8befb6e73e40c9f8ae9de2b6527d22a4f
[ "MIT" ]
1
2019-03-28T06:25:48.000Z
2019-03-28T06:25:48.000Z
mods/myArcade/myhighscore/init.lua
Ganome/OPSkyBlock
8381cbb8befb6e73e40c9f8ae9de2b6527d22a4f
[ "MIT" ]
null
null
null
mods/myArcade/myhighscore/init.lua
Ganome/OPSkyBlock
8381cbb8befb6e73e40c9f8ae9de2b6527d22a4f
[ "MIT" ]
null
null
null
myhighscore = {} dofile(minetest.get_modpath("myhighscore").."/api.lua") dofile(minetest.get_modpath("myhighscore").."/scoreboard.lua")
23
62
0.73913
7307bd09464ddc0ace7b2dab5dd1c581ab3fbc1f
3,667
rs
Rust
src/systems/plate.rs
wbprice/the-ten-top
0bcd0c2f2cf5076c6577e2de3108ccb8649c6542
[ "MIT-0", "MIT" ]
1
2019-11-21T21:57:06.000Z
2019-11-21T21:57:06.000Z
src/systems/plate.rs
wbprice/the-ten-top
0bcd0c2f2cf5076c6577e2de3108ccb8649c6542
[ "MIT-0", "MIT" ]
2
2019-09-03T17:02:55.000Z
2019-09-10T20:54:50.000Z
src/systems/plate.rs
wbprice/the-ten-top
0bcd0c2f2cf5076c6577e2de3108ccb8649c6542
[ "MIT-0", "MIT" ]
null
null
null
use amethyst::{ core::transform::{Parent, Transform}, ecs::prelude::{Entities, Entity, Join, Read, ReadStorage, System, WriteStorage}, }; use crate::{ components::{Dish, Ingredient, Plate}, resources::{Cookbook, Dishes, Food, Ingredients}, }; pub struct PlateSystem; fn get_dish_from_ingredients( cookbook: &Cookbook, ingredients: &Vec<Ingredients>, ) -> Option<Dishes> { // Do all the ingredients contribute to the same result? if !ingredients.is_empty() { let first_ingredient = ingredients[0]; let potential_dishes = cookbook.makes(Food::Ingredients(first_ingredient)); for ingredient in ingredients.into_iter() { let ingredient_makes = cookbook.makes(Food::Ingredients(*ingredient)); for other_ingred in ingredient_makes.iter() { if !potential_dishes.contains(other_ingred) { return None; } } } return Some(potential_dishes[0]); } None } impl<'s> System<'s> for PlateSystem { type SystemData = ( Entities<'s>, WriteStorage<'s, Parent>, ReadStorage<'s, Plate>, ReadStorage<'s, Ingredient>, WriteStorage<'s, Dish>, WriteStorage<'s, Transform>, Read<'s, Cookbook>, ); fn run( &mut self, (entities, mut parents, plates, ingredients, mut dishes, mut locals, cookbook): Self::SystemData, ) { let mut entities_to_remove: Vec<Entity> = vec![]; let mut entities_to_create: Vec<(Entity, Dishes)> = vec![]; for (plate_entity, plate) in (&entities, &plates).join() { // Iterate through the plates. // What ingredients have this plate as a parent? let ingredients_and_entity: Vec<(Entity, &mut Parent, &Ingredient)> = (&entities, &mut parents, &ingredients) .join() .filter(|(_, parent, _)| &parent.entity == &plate_entity) .collect(); let mut ingredient_types: Vec<Ingredients> = ingredients_and_entity .iter() .map(|(_, _, ingredient)| ingredient.ingredient) .collect(); // If the ingredients all contribute to the same dish if let Some(dish) = get_dish_from_ingredients(&cookbook, &ingredient_types) { // and all ingredients are in place: let required_ingredients = cookbook.ingredients(Food::Dishes(dish)); let all_ingredients_found = required_ingredients .iter() .all(|ingredient| ingredient_types.contains(ingredient)); if all_ingredients_found { for (entity, _, _) in ingredients_and_entity { entities_to_remove.push(entity); } for entity in &entities_to_remove { entities.delete(*entity).unwrap(); } entities .build_entity() .with( Dish { dish: dish }, &mut dishes, ) .with( Parent { entity: plate_entity, }, &mut parents, ) .with(Transform::default(), &mut locals) .build(); } } } } }
34.271028
105
0.502045
eb8e47557a2ecf863c8a8f39a97fd1bd8afc94ac
768
rs
Rust
tokio/src/loom/std/atomic_ptr.rs
dbcfd/tokio
8f3a26597270871a2adbf4f8da80a82961e9e296
[ "MIT" ]
2
2020-03-02T03:40:39.000Z
2020-10-27T07:04:12.000Z
tokio/src/loom/std/atomic_ptr.rs
PirateDragon/tokio
282b00cbe888a96669877ce70662fba87e8c0e3c
[ "MIT" ]
null
null
null
tokio/src/loom/std/atomic_ptr.rs
PirateDragon/tokio
282b00cbe888a96669877ce70662fba87e8c0e3c
[ "MIT" ]
null
null
null
use std::fmt; use std::ops::Deref; /// `AtomicPtr` providing an additional `load_unsync` function. pub(crate) struct AtomicPtr<T> { inner: std::sync::atomic::AtomicPtr<T>, } impl<T> AtomicPtr<T> { pub(crate) fn new(ptr: *mut T) -> AtomicPtr<T> { let inner = std::sync::atomic::AtomicPtr::new(ptr); AtomicPtr { inner } } pub(crate) fn with_mut<R>(&mut self, f: impl FnOnce(&mut *mut T) -> R) -> R { f(self.inner.get_mut()) } } impl<T> Deref for AtomicPtr<T> { type Target = std::sync::atomic::AtomicPtr<T>; fn deref(&self) -> &Self::Target { &self.inner } } impl<T> fmt::Debug for AtomicPtr<T> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { self.deref().fmt(fmt) } }
23.272727
81
0.580729
9b9fc145bc70e814a53c9602ff7c48a2170e6050
5,707
js
JavaScript
bartop-api/test/integration/catalogsEndpointTest.js
bartop-io/bartop
4e6115a1f0a49d292952e5b04e26f6c7f04eb082
[ "MIT" ]
4
2018-11-26T14:41:19.000Z
2019-12-12T05:48:43.000Z
bartop-api/test/integration/catalogsEndpointTest.js
dpopp07/bartop
4e6115a1f0a49d292952e5b04e26f6c7f04eb082
[ "MIT" ]
157
2017-10-25T03:49:46.000Z
2018-07-27T18:44:28.000Z
bartop-api/test/integration/catalogsEndpointTest.js
dpopp07/bartop
4e6115a1f0a49d292952e5b04e26f6c7f04eb082
[ "MIT" ]
1
2017-10-25T04:03:29.000Z
2017-10-25T04:03:29.000Z
const request = require('supertest'); const expect = require('chai').expect; const app = require('../../src/server'); const r = require('../../src/db'); const { users, drinks } = require('../utils/testObjects'); describe('Resource - Catalog', function() { const TOKEN = global.testToken; let userId; let oldFashionedId; before(async function() { // increase hook timeout, tests require extensive environment setup this.timeout(9000); // prime the database with test tables/data const tables = await r.tableList(); if (tables.includes('users')) { await r.tableDrop('users'); } await r.tableCreate('users'); if (tables.includes('drinks')) { await r.tableDrop('drinks'); } await r.tableCreate('drinks'); const response = await r.table('users').insert(users.testUser); userId = response.generated_keys[0]; const dbResponse = await r.table('drinks').insert(drinks.oldFashioned); oldFashionedId = dbResponse.generated_keys[0]; return; }); it('Mutation - add a single drink to a catalog', function(done) { const query = ` mutation { addDrinksToCatalog( input: { userId: "${userId}", drinkIds: ["${oldFashionedId}"] } ) { drinks { name } errors { message } } }`; request(app) .post('/api/graphql') .set('Authorization', `Bearer ${TOKEN}`) .set('Content-Type', 'application/json') .send({ query }) .end((err, res) => { const payload = res.body.data.addDrinksToCatalog; expect(res.statusCode).to.equal(200); expect(payload).to.be.an('object'); expect(payload.drinks).to.be.an('array'); expect(payload.drinks[0].name).to.equal('Old Fashioned'); expect(payload.errors).to.equal(null); done(); }); }); it('Mutation - add a fake drink, should be invalid', function(done) { const badId = 'bestfriend<insertname>'; const query = ` mutation { addDrinksToCatalog( input: { userId: "${userId}", drinkIds: ["${badId}"] } ) { drinks { name } errors { message id } } }`; request(app) .post('/api/graphql') .set('Authorization', `Bearer ${TOKEN}`) .set('Content-Type', 'application/json') .send({ query }) .end((err, res) => { const payload = res.body.data.addDrinksToCatalog; expect(res.statusCode).to.equal(200); expect(payload).to.be.an('object'); expect(payload.drinks).to.equal(null); expect(payload.errors).to.be.an('array'); expect(payload.errors[0].message).to.equal('Drinks Not Found'); expect(payload.errors[0].id[0]).to.equal(badId); done(); }); }); it('Mutation - error on adding a drink for user that doesnt exist', function(done) { const badId = 'bernieEddy'; const query = ` mutation { addDrinksToCatalog( input: { userId: "${badId}", drinkIds: ["${oldFashionedId}"] } ) { drinks { name } errors { message id } } }`; request(app) .post('/api/graphql') .set('Authorization', `Bearer ${TOKEN}`) .set('Content-Type', 'application/json') .send({ query }) .end((err, res) => { const payload = res.body.data.addDrinksToCatalog; expect(res.statusCode).to.equal(200); expect(payload.errors).to.be.an('array'); expect(payload.errors[0].message).to.equal('Resource not found.'); expect(payload.errors[0].id[0]).to.equal(badId); done(); }); }); it('Mutation - remove a single drink from a catalog', function(done) { const query = ` mutation { removeDrinksFromCatalog( input: { userId: "${userId}", drinkIds: "${oldFashionedId}" } ) { drinks { name } errors { message } } }`; request(app) .post('/api/graphql') .set('Authorization', `Bearer ${TOKEN}`) .set('Content-Type', 'application/json') .send({ query }) .end((err, res) => { const payload = res.body.data.removeDrinksFromCatalog; expect(res.statusCode).to.equal(200); expect(payload).to.be.an('object'); expect(payload.drinks).to.be.an('array'); expect(payload.drinks[0].name).to.equal('Old Fashioned'); expect(payload.errors).to.equal(null); done(); }); }); it('Mutation - remove a fake drink, should be invalid', function(done) { const query = ` mutation { removeDrinksFromCatalog( input: { userId: "${userId}", drinkIds: ["proxieseverywhere", "run"] } ) { drinks { name } errors { message id } } }`; request(app) .post('/api/graphql') .set('Authorization', `Bearer ${TOKEN}`) .set('Content-Type', 'application/json') .send({ query }) .end((err, res) => { const payload = res.body.data.removeDrinksFromCatalog; expect(res.statusCode).to.equal(200); expect(payload).to.be.an('object'); expect(payload.drinks).to.equal(null); expect(payload.errors).to.be.an('array'); expect(payload.errors[0].message).to.equal('Drinks Not Found'); expect(payload.errors[0].id).to.deep.equal([ 'proxieseverywhere', 'run' ]); done(); }); }); });
29.266667
86
0.54109
1e324fa8bf0c3f9a21c248f0fae98e623b77ae66
3,104
css
CSS
style.css
romchesko-pazzi/Burning-Man
6760ddcdd191701a0cecbdc5584603e652f7855a
[ "MIT" ]
null
null
null
style.css
romchesko-pazzi/Burning-Man
6760ddcdd191701a0cecbdc5584603e652f7855a
[ "MIT" ]
null
null
null
style.css
romchesko-pazzi/Burning-Man
6760ddcdd191701a0cecbdc5584603e652f7855a
[ "MIT" ]
null
null
null
*{padding:0;margin:0;border:0;} *,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} :focus,:active{outline:none;} a:focus,a:active{outline:none;} nav,footer,header,aside{display:block;} html,body{height:100%;width:100%;font-size:100%;line-height:1;font-size:14px;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%;} input,button,textarea{font-family:inherit;} input::-ms-clear{display:none;} button{cursor:pointer;} button::-moz-focus-inner{padding:0;border:0;} a,a:visited{text-decoration:none;} a:hover{text-decoration:none;} ul li{list-style:none;} img{vertical-align:top;} h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit;} .container { max-width: 1168px; margin: 0px auto; } .first-screen { font-family: 'Anton', sans-serif; background: url(img/header-bg.jpg) no-repeat center; height: 900px; } .header__row { display: flex; align-items: center; padding-top: 57px; margin-bottom: 216px; } .header__logo { margin-right: 69px; } .header__navigation ul { display: flex; } .header__navigation li { font-size: 14px; text-transform: uppercase; letter-spacing: 2.2px; margin-left: 40px; line-height: 21px; } .header__navigation a:hover { color: rgb(255, 208, 0); transition: 0.9s; } .header__navigation li:first-child { margin-left: 0px; } .header__navigation a { color: white; } .header__phone a { font-size: 17px; color: white; letter-spacing: 1.7px; } .header__phone a:hover { color: rgb(255, 208, 0); transition: 0.7s; } .header__phone { margin-left: auto; } .offer p { font-size: 30px; line-height: 44px; letter-spacing: 0.1em; text-transform: uppercase; color: white; } .offer h1 { font-size: 100px; line-height: 147px; text-transform: uppercase; color: white; margin-bottom: 19px; } .button { border: solid 1.5px white; padding: 18px 23px; display: block; text-align: center; max-width: 238px; color: white; text-transform: uppercase; font-size: 17px; letter-spacing: 1.7px; } .button:hover { background-color:white; color: black; transition: 0.6s; } .about { padding: 113px 0px; } .about__mtitle { margin-bottom: 53px; font-family: 'Anton'; font-size: 50px; line-height: 73px; text-transform: uppercase; color: black; } .about__row { display: flex; margin: 0px -18px; margin-bottom: 67px; } .about__block { padding: 0px 18px; } .title { font-family: 'Anton'; font-size: 25px; line-height: 37px; text-transform: uppercase; margin-bottom: 32px; } .about__text { font-family: 'Open Sans'; font-size: 16px; line-height: 26px; text-align: justify; } .about__images { display: flex; justify-content: space-between; } .footer { font-family: 'Open Sans'; padding-bottom: 80px; } .footer p{ font-size: 15px; line-height: 20px; margin-right: 55px; } .footer__row { display: flex; }
17.942197
161
0.648196
132d0b86690362dece66f857b9ba4e1d8a0d57bf
500
h
C
FAITHMainUIDemo/FAITHMainUIDemo/Classes/Other/Catagroy/UIImage+Extension.h
faith939339094/FAITHMainUIDemo
f2dcfa8f56168ab9d291ee4f8b189025475cb836
[ "MIT" ]
null
null
null
FAITHMainUIDemo/FAITHMainUIDemo/Classes/Other/Catagroy/UIImage+Extension.h
faith939339094/FAITHMainUIDemo
f2dcfa8f56168ab9d291ee4f8b189025475cb836
[ "MIT" ]
null
null
null
FAITHMainUIDemo/FAITHMainUIDemo/Classes/Other/Catagroy/UIImage+Extension.h
faith939339094/FAITHMainUIDemo
f2dcfa8f56168ab9d291ee4f8b189025475cb836
[ "MIT" ]
null
null
null
// // UIImage+Extension.h // FAITH微博-02 // // Created by faith939339094 on 16/1/13. // Copyright © 2016年 faith939339094. All rights reserved. // #import <UIKit/UIKit.h> @interface UIImage (Extension) // 根据图片名字拉伸图片 +(UIImage *)resizedImage:(NSString *)name; // 根据颜色生成一张尺寸为1*1的相同颜色图片 + (UIImage *)imageWithColor:(UIColor *)color; +(UIImage *)borderImageWithImageName:(NSString *)name border:(CGFloat)border color:(UIColor *)color; +(UIImage *)imageWithOriginalImageNamed:(NSString *)name; @end
23.809524
100
0.73
201d0ac450061bdba4a602454dc675bd80aa704d
3,050
css
CSS
src/main/assets/css/footer.css
Yayayay218/capstone2
a7a3e15f0aa73499df7787a04f2e2dc7cf00642d
[ "MIT" ]
null
null
null
src/main/assets/css/footer.css
Yayayay218/capstone2
a7a3e15f0aa73499df7787a04f2e2dc7cf00642d
[ "MIT" ]
null
null
null
src/main/assets/css/footer.css
Yayayay218/capstone2
a7a3e15f0aa73499df7787a04f2e2dc7cf00642d
[ "MIT" ]
null
null
null
.full { width: 100%; } .gap { height: 30px; width: 100%; clear: both; display: block; } .footer { background-color: #434343; height: auto; padding-bottom: 30px; position: relative; width: 100%; } .footer p { margin: 0; } .footer img { max-width: 100%; } .footer h3 { font-family: Montserrat; font-size: 12px; font-weight: bold; font-style: normal; font-stretch: normal; letter-spacing: 2.4px; color: #ffffff; text-transform: uppercase; margin-top: 78px; } .footer ul { font-size: 13px; list-style-type: none; margin-left: 0; padding-left: 0; margin-top: 15px; color: #7F8C8D; } .footer ul li a { font-size: 14px; font-weight: normal; font-style: normal; font-stretch: normal; line-height: 2.57; color: #9fa3a7; } .footer a { color: #78828D } .supportLi h4 { font-size: 20px; font-weight: lighter; line-height: normal; margin-bottom: 0 !important; padding-bottom: 0; } .newsletter-box input#appendedInputButton { background: #FFFFFF; display: inline-block; float: left; height: 30px; clear: both; width: 100%; } .newsletter-box .btn { border: medium none; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; display: inline-block; height: 40px; padding: 0; width: 100%; color: #fff; } .newsletter-box { overflow: hidden; } .bg-gray { box-shadow: 0 1px 0 #B4B3B3; } .social li { /*background: none repeat scroll 0 0 #B5B5B5;*/ /*border: 2px solid #B5B5B5;*/ /*-webkit-border-radius: 50%;*/ /*-moz-border-radius: 50%;*/ /*-o-border-radius: 50%;*/ /*-ms-border-radius: 50%;*/ /*border-radius: 50%;*/ float: left; height: 36px; line-height: 36px; margin: 0 27px 0 0; padding: 0; text-align: center; width: 36px; transition: all 0.5s ease 0s; -moz-transition: all 0.5s ease 0s; -webkit-transition: all 0.5s ease 0s; -ms-transition: all 0.5s ease 0s; -o-transition: all 0.5s ease 0s; } /*.social li:hover {*/ /*transform: scale(1.15) rotate(360deg);*/ /*-webkit-transform: scale(1.1) rotate(360deg);*/ /*-moz-transform: scale(1.1) rotate(360deg);*/ /*-ms-transform: scale(1.1) rotate(360deg);*/ /*-o-transform: scale(1.1) rotate(360deg);*/ /*}*/ .social li a { color: #EDEFF1; } .social li:hover { border: 2px solid #2c3e50; background: #2c3e50; } .social li a i { font-size: 19px; margin: 0 0 0 5px; color: #EDEFF1 !important; } .footer-bottom { background-color: #434343; border-top: 1px solid #434343;; padding-top: 10px; padding-bottom: 10px; } .footer-bottom p.pull-left { padding-top: 6px; padding-bottom: 50px; font-size: 14px; font-weight: normal; font-style: normal; font-stretch: normal; line-height: 1.57; color: rgba(200, 200, 200, 0.5); } .payments { font-size: 1.5em; }
20.748299
53
0.596393
697c96734a266e26cbc4e01b254aa319a2d3de80
3,121
lua
Lua
lib/src/Dom/tryToAttributes.lua
LouieK22/anatta
f8762f5dee5bb5b82f0a8646701f35fd66f62da4
[ "MIT" ]
9
2018-10-23T00:32:43.000Z
2020-07-23T17:23:18.000Z
lib/src/Dom/tryToAttributes.lua
LouieK22/anatta
f8762f5dee5bb5b82f0a8646701f35fd66f62da4
[ "MIT" ]
16
2018-10-23T19:30:53.000Z
2019-11-27T09:33:41.000Z
lib/src/Dom/tryToAttributes.lua
LouieK22/anatta
f8762f5dee5bb5b82f0a8646701f35fd66f62da4
[ "MIT" ]
2
2019-04-04T09:43:15.000Z
2019-07-21T11:07:06.000Z
local Constants = require(script.Parent.Parent.Core.Constants) local ENTITY_ATTRIBUTE_NAME = Constants.EntityAttributeName local INSTANCE_REF_FOLDER = Constants.InstanceRefFolder local ErrConversionFailed = "%s (%s) cannot be turned into an attribute" local function instanceConversion(attributeMap, attributeName, value, instance) local refFolder = instance:FindFirstChild(INSTANCE_REF_FOLDER) if not refFolder then refFolder = Instance.new("Folder") refFolder.Name = INSTANCE_REF_FOLDER refFolder.Parent = instance end local objectValue = refFolder:FindFirstChild(attributeName) if not objectValue then objectValue = Instance.new("ObjectValue") objectValue.Name = attributeName objectValue.Parent = refFolder end attributeMap[attributeName] = value objectValue.Value = value end local conversions = { Instance = instanceConversion, instanceOf = instanceConversion, instance = instanceConversion, instanceIsA = instanceConversion, enum = function(attributeMap, attributeName, value) attributeMap[attributeName] = value.Name end, TweenInfo = function(attributeMap, attributeName, value) convert(attributeMap, attributeName, { EasingDirection = "enum", Time = "number", DelayTime = "number", RepeatCount = "number", EasingStyle = "enum", Reverses = "boolean", }, value) end, } function convert(attributeMap, attributeName, concreteType, instance, entity, value) if typeof(concreteType) == "table" then for field, fieldConcreteType in pairs(concreteType) do local fieldAttributeName = ("%s_%s"):format(attributeName, field) convert(attributeMap, fieldAttributeName, fieldConcreteType, instance, entity, value[field]) end elseif conversions[concreteType] then conversions[concreteType](attributeMap, attributeName, value, instance) elseif concreteType ~= nil then attributeMap[attributeName] = value else return false, (ErrConversionFailed:format(attributeName, concreteType)) end return true, attributeMap end return function(instance, entity, definition, component) local typeDefinition = definition.type local componentName = definition.name local checkSuccess, checkResult = typeDefinition.check(component) if not checkSuccess then return false, ("Error converting %s on %s: %s"):format(componentName, instance:GetFullName(), checkResult) end local conversionSuccess, concreteType = typeDefinition:tryGetConcreteType() if not conversionSuccess then return false, ("Error converting %s: %s"):format(componentName, concreteType) end if typeDefinition.typeName == "array" then concreteType = table.create(#component) for _ = 1, #component do local arrayFieldSuccess, fieldConcreteType = typeDefinition.typeParams[1]:tryGetConcreteType() if not arrayFieldSuccess then return false, ("Error converting %s: %s"):format(componentName, fieldConcreteType) end table.insert(concreteType, fieldConcreteType) end end local success, attributeMap = convert({}, componentName, concreteType, instance, entity, component) attributeMap[ENTITY_ATTRIBUTE_NAME] = entity return success, attributeMap end
30.009615
108
0.777956
2227b41dc4450128d80715456ab2ab1b86d510cf
596
kt
Kotlin
app/src/main/java/com/pij/zworkout/workout/feature/CreateWorkoutFeature.kt
pijpijpij/Zworkout
cc62fb7cb2fd97aad2642355b012f3237fd51bc8
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/pij/zworkout/workout/feature/CreateWorkoutFeature.kt
pijpijpij/Zworkout
cc62fb7cb2fd97aad2642355b012f3237fd51bc8
[ "Apache-2.0" ]
1
2018-03-26T18:01:32.000Z
2018-03-26T18:01:32.000Z
app/src/main/java/com/pij/zworkout/workout/feature/CreateWorkoutFeature.kt
pijpijpij/Zworkout
cc62fb7cb2fd97aad2642355b012f3237fd51bc8
[ "Apache-2.0" ]
null
null
null
package com.pij.zworkout.workout.feature import com.pij.horrocks.Interaction import com.pij.horrocks.Reducer import com.pij.zworkout.workout.State import javax.inject.Provider /** * * Created on 01/03/2018. * * @author Pierrejean */ class CreateWorkoutFeature(private val name: Provider<String>) : Interaction<Any, State> { override fun process(event: Any): Reducer<State> { return Reducer { current -> current.copy(workout = current.workout.copy(name = name.get()), file = null, nameIsReadOnly = false) } } }
22.923077
90
0.649329
2532f968aed07a7497951e0a1a4b74bd32dad69f
1,611
swift
Swift
SnSRestKit/Classes/Internal/Core/SnSRestModule.swift
greinaldor/SnSRestKit
663372b03a4e744a18873d6ac3fe32245aa45131
[ "MIT" ]
null
null
null
SnSRestKit/Classes/Internal/Core/SnSRestModule.swift
greinaldor/SnSRestKit
663372b03a4e744a18873d6ac3fe32245aa45131
[ "MIT" ]
null
null
null
SnSRestKit/Classes/Internal/Core/SnSRestModule.swift
greinaldor/SnSRestKit
663372b03a4e744a18873d6ac3fe32245aa45131
[ "MIT" ]
null
null
null
// // SnSRestModule.swift // Pods // // Created by Adrien Greiner on 22/04/17. // // import Foundation import BoltsSwift typealias SnSRestModule = SnSRestModulepInterface<AnyObject> protocol SnSRestModuleProtocol { var moduleName: String { get } var moduleAccessQueue: DispatchQueue { get } func loadModule() func unloadModule() } class SnSRestModulepInterface<ModulesDataSource: AnyObject>: SnSRestModuleProtocol { private(set) weak var modulesProvider: ModulesDataSource? public private(set) var moduleName: String private(set) var modulesAccessExecutor: Executor private var moduleAccessQueue: DispatchQueue func loadModule() { fatalError("Should be overidden in subclass") } func unloadModule() { modulesProvider = nil } init() { moduleName = "com.\(String(reflecting: type(of: self)).lowercased())" SnSRestConsoleLogger.log("\(moduleName): Initializing module") moduleAccessQueue = DispatchQueue(label: moduleName.lowercased() + ".moduleAccessQueue") modulesAccessExecutor = Executor.queue(moduleAccessQueue) } public convenience init(withModulesDataSource dataSource: ModulesDataSource) { self.init() modulesProvider = dataSource loadModule() } deinit { unloadModule() } } /// Module extended with Bolts features extension SnSRestModulepInterface { func taskFromModuleExecutor(closure: @escaping ((Void) throws -> AnyObject)) -> Task<AnyObject> { return Task.init(self.modulesAccessExecutor, closure: closure) } }
27.305085
101
0.699565
ccacff056d1541f2bb1828f019f45c3e84644f80
2,184
lua
Lua
src/wesenGemaMod/Commands/ResetCommand.lua
wesen1/wesenGemaMod
15a4b44cce7f1e5c18ce6fea9242562f15ecce93
[ "MIT" ]
1
2020-11-05T05:45:36.000Z
2020-11-05T05:45:36.000Z
src/wesenGemaMod/Commands/ResetCommand.lua
wesen1/wesenGemaMod
15a4b44cce7f1e5c18ce6fea9242562f15ecce93
[ "MIT" ]
64
2018-03-24T16:31:56.000Z
2021-12-31T19:18:40.000Z
src/wesenGemaMod/Commands/ResetCommand.lua
wesen1/wesenGemaMod
15a4b44cce7f1e5c18ce6fea9242562f15ecce93
[ "MIT" ]
2
2021-01-05T00:05:46.000Z
2021-06-25T04:39:08.000Z
--- -- @author wesen -- @copyright 2021 wesen <wesen-ac@web.de> -- @release 0.1 -- @license MIT -- local BaseCommand = require "CommandManager.BaseCommand" local LuaServerApi = require "AC-LuaServer.Core.LuaServerApi" local StaticString = require "Output.StaticString" local TemplateException = require "AC-LuaServer.Core.Util.Exception.TemplateException" --- -- Command !reset. -- Allows a player to instantly respawn while not causing info messages in other players consoles. -- -- @type ResetCommand -- local ResetCommand = BaseCommand:extend() --- -- ResetCommand constructor. -- function ResetCommand:new() self.super.new( self, StaticString("resetCommandName"):getString(), 0, StaticString("resetCommandGroupName"):getString(), {}, StaticString("resetCommandDescription"):getString(), { StaticString("resetCommandAlias1"):getString(), StaticString("resetCommandAlias2"):getString() } ) end -- Public Methods --- -- Instantly respawns a player. -- -- @tparam Player _player The player who executed the command -- @tparam string[] _arguments The list of arguments which were passed by the player -- -- @raise Error when the player is currently in one of the spectate modes -- function ResetCommand:execute(_player, _arguments) local currentTeam = LuaServerApi.getteam(_player:getCn()) if (currentTeam == LuaServerApi.TEAM_CLA_SPECT or currentTeam == LuaServerApi.TEAM_RVSF_SPECT or currentTeam == LuaServerApi.TEAM_SPECT ) then error(TemplateException( "Commands/Reset/Exceptions/PlayerIsSpectator", {} )) end -- Kill the player to make him drop the flag if he currently holds it LuaServerApi:forcedeath(_player:getCn()) -- Set the players primary weapon to his next requested primary weapon LuaServerApi.setprimary(_player:getCn(), LuaServerApi.getnextprimary(_player:getCn())) if (LuaServerApi.callhandler("onPlayerSpawn", _player:getCn()) ~= LuaServerApi.PLUGIN_BLOCK) then -- Respawn the player at a random spawn point LuaServerApi.sendspawn(_player:getCn()) LuaServerApi.callhandler("onPlayerSpawnAfter", _player:getCn()) end end return ResetCommand
26
99
0.735348
f40874cc4117d0967e0453928268829f15bab16d
432
swift
Swift
DesignCodeCourse/DesignCodeCourse/Domain/Model/UpdateItem.swift
fabirt/SwiftUI-Playground
afb25f4d330dc2fb5c8be6c22791ff84e627c82a
[ "MIT" ]
null
null
null
DesignCodeCourse/DesignCodeCourse/Domain/Model/UpdateItem.swift
fabirt/SwiftUI-Playground
afb25f4d330dc2fb5c8be6c22791ff84e627c82a
[ "MIT" ]
null
null
null
DesignCodeCourse/DesignCodeCourse/Domain/Model/UpdateItem.swift
fabirt/SwiftUI-Playground
afb25f4d330dc2fb5c8be6c22791ff84e627c82a
[ "MIT" ]
null
null
null
// // UpdateItem.swift // DesignCodeCourse // // Created by Fabi Diartt on 9/04/21. // import Foundation struct UpdateItem: Identifiable { let id = UUID() let title: String let imageName: String let body: String let date: Date var displayDate: String { let formatter = DateFormatter() formatter.dateFormat = "MMM dd" return formatter.string(from: date).uppercased() } }
18.782609
56
0.634259
0c47cca3a357e56bd5de2e0cada85e94b14eaed0
3,796
swift
Swift
Paystack/PSTCKAddressViewController.swift
mhlangagc/paystack-ios
1cf350448f3ab279a6b31435aa3fce3a2b89b18f
[ "MIT" ]
28
2016-03-04T10:03:13.000Z
2021-05-25T14:18:29.000Z
Paystack/PSTCKAddressViewController.swift
mhlangagc/paystack-ios
1cf350448f3ab279a6b31435aa3fce3a2b89b18f
[ "MIT" ]
52
2016-08-15T13:21:39.000Z
2022-02-26T11:11:41.000Z
Paystack/PSTCKAddressViewController.swift
mhlangagc/paystack-ios
1cf350448f3ab279a6b31435aa3fce3a2b89b18f
[ "MIT" ]
25
2016-02-25T08:56:55.000Z
2021-12-26T05:15:00.000Z
// // AddressViewController.swift // Paystack iOS Example // // Created by Jubril Olambiwonnu on 6/21/20. // Copyright © 2020 Paystack. All rights reserved. // import UIKit @objc public class PSTCKAddressViewController: PSTCKKeyboardHandlingBaseVC, UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate { @IBOutlet var streetField: UITextField! @IBOutlet var cityField: UITextField! @IBOutlet var stateField: UITextField! @IBOutlet var zipField: UITextField! let stateInput = UIPickerView() let validator = Validator() @IBOutlet var activityIndicator: UIActivityIndicatorView! @objc public var states = [PSTCKState]() @objc public var didCollectAddress: (([String:Any]) -> Void)? @objc public var didTapCancelButton: (() -> Void)? @objc public var transaction = "" @IBOutlet var paymentButton: UIButton! public override func viewDidLoad() { super.viewDidLoad() registerTextFields() paymentButton.isEnabled = false stateInput.dataSource = self stateInput.delegate = self stateField.inputView = stateInput stateField.delegate = self } @IBAction func onCancelButtonTap(_ sender: Any) { didTapCancelButton?() dismiss(animated: true) } public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) stateInput.reloadAllComponents() } func registerTextFields() { validator.registerField(streetField, rules: [RequiredRule()]) validator.registerField(cityField, rules: [RequiredRule()]) validator.registerField(stateField, rules: [RequiredRule()]) validator.registerField(zipField, rules: [RequiredRule()]) streetField.addTarget(self, action: #selector(textFieldChanged), for: .editingChanged) cityField.addTarget(self, action: #selector(textFieldChanged), for: .editingChanged) stateField.addTarget(self, action: #selector(textFieldChanged), for: .editingChanged) zipField.addTarget(self, action: #selector(textFieldChanged), for: .editingChanged) } @IBAction func onButtonTap(_ sender: Any) { paymentButton.setTitle(" ", for: .normal) paymentButton.isUserInteractionEnabled = false activityIndicator.startAnimating() let address: [String : Any] = [ "trans" : transaction, "address" : streetField.text!, "city" : cityField.text!, "zip_code" : zipField.text!, "state" : stateField.text! ] didCollectAddress?(address) dismiss(animated: true) } @objc func textFieldChanged() { validator.validate(self) } public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return states[row].name } public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return states.count } public func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { stateField.text = states[row].name validator.validate(self) } public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { return false } } extension PSTCKAddressViewController: ValidationDelegate { public func validationSuccessful() { paymentButton.isEnabled = true } public func validationFailed(_ errors: [(Validatable, ValidationError)]) { paymentButton.isEnabled = false } }
34.825688
143
0.672287
98de27b5a0b9bb08684a3ba7c9bd9381794de3eb
3,802
html
HTML
erl8.3/lib/ic-4.4.2/doc/html/java/com/ericsson/otp/ic/package-frame.html
PUSKAS6/hacking
7b896761770ceac87f7ede444f5036b18b485ea4
[ "MIT" ]
1
2018-02-17T03:06:14.000Z
2018-02-17T03:06:14.000Z
erl8.3/lib/ic-4.4.2/doc/html/java/com/ericsson/otp/ic/package-frame.html
PUSKAS6/hacking
7b896761770ceac87f7ede444f5036b18b485ea4
[ "MIT" ]
null
null
null
erl8.3/lib/ic-4.4.2/doc/html/java/com/ericsson/otp/ic/package-frame.html
PUSKAS6/hacking
7b896761770ceac87f7ede444f5036b18b485ea4
[ "MIT" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0) on Tue Mar 14 21:49:18 CET 2017 --> <TITLE> com.ericsson.otp.ic (Package com.ericsson.otp.ic version 4.4.2) </TITLE> <META NAME="date" CONTENT="2017-03-14"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../com/ericsson/otp/ic/package-summary.html" target="classFrame">com.ericsson.otp.ic</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Interfaces</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="Holder.html" title="interface in com.ericsson.otp.ic" target="classFrame"><I>Holder</I></A></FONT></TD> </TR> </TABLE> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="Any.html" title="class in com.ericsson.otp.ic" target="classFrame">Any</A> <BR> <A HREF="AnyHelper.html" title="class in com.ericsson.otp.ic" target="classFrame">AnyHelper</A> <BR> <A HREF="AnyHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">AnyHolder</A> <BR> <A HREF="BooleanHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">BooleanHolder</A> <BR> <A HREF="ByteHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">ByteHolder</A> <BR> <A HREF="CharHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">CharHolder</A> <BR> <A HREF="DoubleHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">DoubleHolder</A> <BR> <A HREF="Environment.html" title="class in com.ericsson.otp.ic" target="classFrame">Environment</A> <BR> <A HREF="FloatHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">FloatHolder</A> <BR> <A HREF="IntHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">IntHolder</A> <BR> <A HREF="LongHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">LongHolder</A> <BR> <A HREF="Pid.html" title="class in com.ericsson.otp.ic" target="classFrame">Pid</A> <BR> <A HREF="PidHelper.html" title="class in com.ericsson.otp.ic" target="classFrame">PidHelper</A> <BR> <A HREF="PidHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">PidHolder</A> <BR> <A HREF="Port.html" title="class in com.ericsson.otp.ic" target="classFrame">Port</A> <BR> <A HREF="PortHelper.html" title="class in com.ericsson.otp.ic" target="classFrame">PortHelper</A> <BR> <A HREF="PortHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">PortHolder</A> <BR> <A HREF="Ref.html" title="class in com.ericsson.otp.ic" target="classFrame">Ref</A> <BR> <A HREF="RefHelper.html" title="class in com.ericsson.otp.ic" target="classFrame">RefHelper</A> <BR> <A HREF="RefHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">RefHolder</A> <BR> <A HREF="ShortHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">ShortHolder</A> <BR> <A HREF="StringHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">StringHolder</A> <BR> <A HREF="TCKind.html" title="class in com.ericsson.otp.ic" target="classFrame">TCKind</A> <BR> <A HREF="Term.html" title="class in com.ericsson.otp.ic" target="classFrame">Term</A> <BR> <A HREF="TermHelper.html" title="class in com.ericsson.otp.ic" target="classFrame">TermHelper</A> <BR> <A HREF="TermHolder.html" title="class in com.ericsson.otp.ic" target="classFrame">TermHolder</A> <BR> <A HREF="TypeCode.html" title="class in com.ericsson.otp.ic" target="classFrame">TypeCode</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
39.604167
113
0.70989
0fbb20a27ab2c8db0d8c5c21d1ba495dab8e82f9
2,090
kt
Kotlin
sdk/src/main/java/com/microsoft/did/sdk/crypto/keys/PublicKey.kt
sbolotovms/VerifiableCredential-SDK-Android
b91adc0494fe3a7c8881f09e9fa90dd635aa3c05
[ "MIT" ]
null
null
null
sdk/src/main/java/com/microsoft/did/sdk/crypto/keys/PublicKey.kt
sbolotovms/VerifiableCredential-SDK-Android
b91adc0494fe3a7c8881f09e9fa90dd635aa3c05
[ "MIT" ]
null
null
null
sdk/src/main/java/com/microsoft/did/sdk/crypto/keys/PublicKey.kt
sbolotovms/VerifiableCredential-SDK-Android
b91adc0494fe3a7c8881f09e9fa90dd635aa3c05
[ "MIT" ]
null
null
null
package com.microsoft.did.sdk.crypto.keys import com.microsoft.did.sdk.crypto.CryptoOperations import com.microsoft.did.sdk.crypto.models.KeyUse import com.microsoft.did.sdk.crypto.models.Sha import com.microsoft.did.sdk.crypto.models.toKeyUse import com.microsoft.did.sdk.crypto.models.webCryptoApi.* import com.microsoft.did.sdk.crypto.models.webCryptoApi.algorithms.Algorithm import com.microsoft.did.sdk.crypto.plugins.SubtleCryptoScope import com.microsoft.did.sdk.util.Base64Url import com.microsoft.did.sdk.util.stringToByteArray /** * Represents a Public Key in JWK format. * @class * @abstract */ abstract class PublicKey(val key: JsonWebKey) : IKeyStoreItem { /** * Key type */ open var kty: KeyType = toKeyType(key.kty) /** * Key ID */ override var kid: String = key.kid ?: "" /** * Intended use */ open var use: KeyUse? = key.use?.let { toKeyUse(it) } /** * Valid key operations (key_ops) */ open var key_ops: List<KeyUsage>? = key.key_ops?.map { toKeyUsage(it) } /** * Algorithm intended for use with this key */ open var alg: String? = key.alg /** * Obtains the thumbprint for the jwk parameter * @param jwk JSON object representation of a JWK * @see https://tools.ietf.org/html/rfc7638 */ fun getThumbprint(crypto: CryptoOperations, sha: Algorithm = Sha.SHA512.algorithm): String { // construct a JSON object with only required fields val json = this.minimumAlphabeticJwk() val jsonUtf8 = stringToByteArray(json) val digest = crypto.subtleCryptoFactory.getMessageDigest(sha.name, SubtleCryptoScope.PUBLIC) val hash = digest.digest(sha, jsonUtf8) // undocumented, but assumed base64url of hash is returned return Base64Url.encode(hash) } /** * Gets the minimum JWK with parameters in alphabetical order as specified by JWK Thumbprint * @see https://tools.ietf.org/html/rfc7638 */ abstract fun minimumAlphabeticJwk(): String abstract fun toJWK(): JsonWebKey }
31.666667
100
0.688038
0f27c7ae07916e1e734f2d49ce3f159d550842d6
273
sql
SQL
src/main/resources/test/sqls/preset_add_1_group.sql
balazskrizsan/stack-judge-java
8dcc5a93195cc8af7b74e5e22f38bf36755dd083
[ "MIT" ]
1
2021-10-13T08:06:26.000Z
2021-10-13T08:06:26.000Z
src/main/resources/test/sqls/preset_add_1_group.sql
balazskrizsan/stack-judge-java
8dcc5a93195cc8af7b74e5e22f38bf36755dd083
[ "MIT" ]
2
2021-04-24T15:17:26.000Z
2021-07-25T15:57:44.000Z
src/main/resources/test/sqls/preset_add_1_group.sql
balazskrizsan/stack-judge-java
8dcc5a93195cc8af7b74e5e22f38bf36755dd083
[ "MIT" ]
null
null
null
-- requires: preset_add_1_company -- requires: preset_add_1_address INSERT INTO "group" (id, company_id, parent_id, address_id, type_id, name, members_on_group_id, created_at, created_by) VALUES (101001, 100001, null, 102001, 2, 'group name', 1, '2020-01-01 01:01:01', 1);
54.6
119
0.754579
70ae05a515d444048f4c028d4a1833f5ceac2a99
3,941
h
C
Source/C_Mesh.h
MissclickStudios/The-Mandalorian-Sands-of-Arvala
346081b26409a33f129189dbcd5a830d6d58f7da
[ "MIT" ]
1
2021-05-14T13:08:40.000Z
2021-05-14T13:08:40.000Z
Source/C_Mesh.h
MissclickStudios/The-Mandalorian-Sands-of-Arvala
346081b26409a33f129189dbcd5a830d6d58f7da
[ "MIT" ]
null
null
null
Source/C_Mesh.h
MissclickStudios/The-Mandalorian-Sands-of-Arvala
346081b26409a33f129189dbcd5a830d6d58f7da
[ "MIT" ]
1
2021-07-05T08:18:36.000Z
2021-07-05T08:18:36.000Z
#ifndef __C_MESH_H__ #define __C_MESH_H__ #include <string> #include <vector> #include <map> #include "MathGeoLib/include/Math/float4x4.h" #include "Component.h" #include "Color.h" namespace math { class float3; } class ParsonNode; class GameObject; class R_Mesh; typedef unsigned int uint; class MISSCLICK_API C_Mesh : public Component { public: C_Mesh(GameObject* owner); ~C_Mesh(); bool Update () override; bool CleanUp () override; bool SaveState (ParsonNode& root) const override; bool LoadState (ParsonNode& root) override; static inline ComponentType GetType() { return ComponentType::MESH; } // Required for templated methods such as GetComponent(). public: // --- RESOURCE MESH METHODS R_Mesh* GetMesh() const; // If there is no rMesh it returns nullptr. void SetMesh(R_Mesh* rMesh); // rMesh will be normally set when a model is imported. const char* GetMeshPath() const; // const char* GetMeshFile() const; // void SetMeshPath(const char* path); // public: // --- MESH SKINNING METHODS R_Mesh* GetSkinnedMesh() const; // void GetBoneMapping(std::map<std::string, GameObject*>& boneMapping); // void GetBoneTranforms(std::vector<float4x4>& boneTransforms); // std::vector<float4x4>* GetBoneTransformsAsPtr(); // bool RefreshSkinning(); // void AnimateMesh(); // void RefreshBoneMapping(); // void SetRootBone(GameObject* rootBone); // void SetAnimatorOwner(GameObject* cAnimatorOwner); // TMP. Ambiguous name. Change Later. public: // --- C_MESH DEBUG METHODS void GetMeshData(uint& numVertices, uint& numNormals, uint& numTexCoords, uint& numIndices, uint& numBones); void GetBoundingBoxVertices(math::float3* bbVertices) const; // TODO: Kinda dirty, should be done elsewhere (?). bool GetDrawVertexNormals() const; // bool GetDrawFaceNormals() const; // bool GetShowWireframe() const; // bool GetShowBoundingBox() const; // void SetDrawVertexNormals(bool setTo); // void SetDrawFaceNormals(bool setTo); // void SetShowWireframe(bool setTo); // void SetShowBoundingBox(bool setTo); // bool GetOutlineMesh() const; // void SetOutlineMesh(bool setTo); // Color GetOutlineColor() const; // void SetOutlineColor(Color color); // float GetOutlineThickness() const; // void SetOutlineThickness(float outline); // bool GetRenderLast() const; // void SetRenderLast(bool setTo); // private: R_Mesh* rMesh; // R_Mesh* skinnedMesh; // GameObject* rootBone; // GameObject* cAnimatorOwner; // std::vector<float4x4> boneTransforms; // std::map<std::string, GameObject*> boneMapping; // private: // --- COMPONENT MESH RENDER VARIABLES bool showWireframe; // bool showBoundingBox; // bool outlineMesh; // Color outlineColor; // float outlineThickness; // bool renderLast; // }; #endif // !__C_MESH_H__
36.831776
142
0.513575