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
6ea249f6ac5e69d567f8037496dc31321e36aa9b
3,582
kt
Kotlin
nugu-client-kit/src/test/java/com/skt/nugu/sdk/client/port/transport/grpc2/devicegateway/EventsServiceTest.kt
shshshl09/nugu-android
d8f9db9f6d2afd3114806fbad80f672aee690352
[ "Apache-2.0" ]
40
2019-10-16T02:50:50.000Z
2022-03-04T08:38:56.000Z
nugu-client-kit/src/test/java/com/skt/nugu/sdk/client/port/transport/grpc2/devicegateway/EventsServiceTest.kt
shshshl09/nugu-android
d8f9db9f6d2afd3114806fbad80f672aee690352
[ "Apache-2.0" ]
989
2019-10-30T07:59:28.000Z
2022-03-23T01:45:48.000Z
nugu-client-kit/src/test/java/com/skt/nugu/sdk/client/port/transport/grpc2/devicegateway/EventsServiceTest.kt
shshshl09/nugu-android
d8f9db9f6d2afd3114806fbad80f672aee690352
[ "Apache-2.0" ]
19
2019-10-17T07:24:29.000Z
2021-11-02T15:06:45.000Z
/** * Copyright (c) 2021 SK Telecom Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.skt.nugu.sdk.client.port.transport.grpc2.devicegateway import com.skt.nugu.sdk.client.port.transport.grpc2.Grpc2Call import com.skt.nugu.sdk.core.interfaces.message.Call import com.skt.nugu.sdk.core.interfaces.message.MessageRequest import com.skt.nugu.sdk.core.interfaces.message.MessageSender import com.skt.nugu.sdk.core.interfaces.message.request.EventMessageRequest import com.skt.nugu.sdk.core.interfaces.transport.Transport import org.junit.Assert.* import junit.framework.TestCase import org.junit.Assert import org.junit.Test import org.mockito.kotlin.mock import java.util.concurrent.Executors class EventsServiceTest : TestCase() { private val mockTransport: Transport = object : Transport { override fun connect() = true override fun disconnect() = Unit override fun isConnected() = true override fun isConnectedOrConnecting() = true override fun send(call: Call) = true override fun shutdown() = Unit override fun newCall( activeTransport: Transport?, request: MessageRequest, headers: Map<String, String>?, listener: MessageSender.OnSendMessageListener ): Call { TODO("Not yet implemented") } } @Test fun testEventsService() { val scheduler = Executors.newSingleThreadScheduledExecutor() val service = EventsService( mock(), mock(), scheduler, null ) Assert.assertFalse(service.isShutdown.get()) service.shutdown() Assert.assertTrue(service.isShutdown.get()) } @Test fun testSendEventMessage() { val scheduler = Executors.newSingleThreadScheduledExecutor() val service = EventsService( mock(), mock(), scheduler, null ) val listener: MessageSender.OnSendMessageListener = mock() val headers = hashMapOf("Last-Asr-Event-Time" to "123") val request: MessageRequest = EventMessageRequest.Builder( "context", "namespace", "name", "version" ).build() val call = Grpc2Call(mockTransport, request, headers, listener) val responseObserver = service.ClientCallStreamObserver("streamId", call, false) val future = service.scheduleTimeout("streamId", call) val clientChannel = EventsService.ClientChannel( mock(), future, responseObserver ) service.requestStreamMap["streamId"] = clientChannel Assert.assertEquals(service.obtainChannel("streamId"), clientChannel) Assert.assertEquals(service.requestStreamMap.size, 1) service.cancelScheduledTimeout("streamId") future?.let { Assert.assertTrue(it.isCancelled) } service.halfClose("streamId") service.shutdown() Assert.assertEquals(service.requestStreamMap.size, 0) } }
37.705263
88
0.674204
c6d1df9258786132d613ba63852b50940276e6c6
126
rb
Ruby
sample/platform.rb
liveralmask/ult
9c01175815d9d0b9f770b85f3abe08162dc48f5f
[ "MIT" ]
null
null
null
sample/platform.rb
liveralmask/ult
9c01175815d9d0b9f770b85f3abe08162dc48f5f
[ "MIT" ]
null
null
null
sample/platform.rb
liveralmask/ult
9c01175815d9d0b9f770b85f3abe08162dc48f5f
[ "MIT" ]
null
null
null
require "ult" extend Ult puts "platform=#{platform}" puts "mac?=#{mac?}" puts "linux?=#{linux?}" puts "windows?=#{windows?}"
15.75
27
0.642857
a56c8ba385979ea86b11d02c58582e07ca645517
6,830
kt
Kotlin
vlc-android/application/vlc-android/src/org/videolan/vlc/util/AccessControl.kt
anddever/libvlc-android-fork
6be951717f7b39db96827685464b80cdb96499e6
[ "BSD-2-Clause" ]
null
null
null
vlc-android/application/vlc-android/src/org/videolan/vlc/util/AccessControl.kt
anddever/libvlc-android-fork
6be951717f7b39db96827685464b80cdb96499e6
[ "BSD-2-Clause" ]
null
null
null
vlc-android/application/vlc-android/src/org/videolan/vlc/util/AccessControl.kt
anddever/libvlc-android-fork
6be951717f7b39db96827685464b80cdb96499e6
[ "BSD-2-Clause" ]
null
null
null
/***************************************************************************** * AccessControl.kt * * Copyright © 2021 VLC authors and VideoLAN * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ package org.videolan.vlc.util import android.content.Context import android.content.pm.PackageManager import android.os.Process import android.util.Log import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import org.json.JSONArray import org.json.JSONObject import org.videolan.resources.AppContextProvider import org.videolan.resources.BuildConfig import java.security.MessageDigest import java.security.NoSuchAlgorithmException private const val TAG = "VLC/AccessControl" data class CertInfo(val name: String, val keys: List<String>) data class AuthEntry(val approved: Boolean, val callingPackage: String?, val desc: String) object AccessControl { private val platformSignature: String? private val callingUidChecked = mutableMapOf<Int, AuthEntry>() private val certificateAllowList by lazy { runBlocking { loadAuthorizedKeys() } } init { platformSignature = getSignature(AppContextProvider.appContext, "android") } /** * Perform security checks to determine if the callingUid is authorized. * @param callingUid The calling application's user id. * @param clientPackageName The calling application's package name. If not specified, an attempt * will be made to resolve the package name from the package manager. */ fun logCaller(callingUid: Int, clientPackageName: String? = null) { callingUidChecked[callingUid]?.let { return } val ctx = AppContextProvider.appContext val callingPackage = getCallingPackage(ctx, callingUid, clientPackageName) when { callingUid == Process.myUid() -> { Log.i(TAG, "Known access from self (${BuildConfig.APP_ID}) to VLC") callingUidChecked[callingUid] = AuthEntry(true, BuildConfig.APP_ID, "VLC UID") return } callingUid == Process.SYSTEM_UID -> { Log.i(TAG, "Known access from system to VLC") callingUidChecked[callingUid] = AuthEntry(true, "system", "System Process") return } callingPackage != null -> { val callingSignature = getSignature(ctx, callingPackage) if (callingSignature == platformSignature) { Log.i(TAG, "Known access from Android platform ($callingPackage) to VLC") callingUidChecked[callingUid] = AuthEntry(true, callingPackage, "Known Platform Signature") return } val certs = certificateAllowList[callingPackage] certs?.keys?.forEach { key -> if (callingSignature == key) { Log.i(TAG, "Known access from ${certs.name} ($callingPackage) to VLC") callingUidChecked[callingUid] = AuthEntry(true, callingPackage, "Known App Signature") return } } Log.i(TAG, "Unknown access from signature $callingSignature ($callingPackage) to VLC") callingUidChecked[callingUid] = AuthEntry(false, callingPackage, "Unknown Signature") } } Log.i(TAG, "Access history: $callingUidChecked") } fun getCallingPackage(ctx: Context, callingUid: Int, clientPackageName: String? = null): String? { val packages = ctx.packageManager.getPackagesForUid(callingUid) ?: return null val packageName = packages.firstOrNull() return if (clientPackageName == null || clientPackageName == packageName) { packageName } else { Log.i(TAG, "Unexpected package name mismatch between $clientPackageName and $packageName") null } } /** * Read authorized keys into memory. Keys are stored in a JSON data file. */ private suspend fun loadAuthorizedKeys(): Map<String, CertInfo> { return withContext(Dispatchers.IO) { val certificateAllowList = mutableMapOf<String, CertInfo>() val ctx = AppContextProvider.appContext val jsonData = ctx.assets.open("authorized_keys.json").bufferedReader().use { it.readText() } val signatures = JSONArray(jsonData) for (i in 0 until signatures.length()) { val s = signatures[i] as JSONObject val keys = s.getJSONArray("keys") val keyList = arrayListOf<String>() for (j in 0 until keys.length()) { val keyId = (keys[j] as JSONObject).getString("keyId") keyList.add(keyId) } val name = s.getString("name") val packageName = s.getString("package") certificateAllowList[packageName] = CertInfo(name, keyList) } certificateAllowList } } @Suppress("deprecation") private fun getSignature(ctx: Context, callingPackage: String): String? { try { val packageInfo = ctx.packageManager.getPackageInfo(callingPackage, PackageManager.GET_SIGNATURES) if (packageInfo.signatures != null && packageInfo.signatures.size == 1) { return genSigSha256(packageInfo.signatures[0].toByteArray()) } } catch (e: PackageManager.NameNotFoundException) { Log.e(TAG, "Calling package name not found: $callingPackage", e) } return null } private fun genSigSha256(certificate: ByteArray): String? { try { val md = MessageDigest.getInstance("SHA-256") md.update(certificate) return md.digest().joinToString(":") { String.format("%02x", it) } } catch (e: NoSuchAlgorithmException) { Log.e(TAG, "Message digest algorithm SHA-256 not found", e) } return null } }
43.227848
111
0.628697
43d8695294cb407538259dcfd05a63b3393fbb37
114
go
Go
app/model/demo.go
KOFLazycat/lazy
989a5dee1e2a9e75d3c98b33b2139dc2550fe9da
[ "Apache-2.0" ]
102
2016-11-22T15:32:57.000Z
2022-03-17T02:25:32.000Z
app/model/demo.go
KOFLazycat/lazy
989a5dee1e2a9e75d3c98b33b2139dc2550fe9da
[ "Apache-2.0" ]
1
2018-12-12T10:38:17.000Z
2018-12-12T10:38:17.000Z
app/model/demo.go
KOFLazycat/lazy
989a5dee1e2a9e75d3c98b33b2139dc2550fe9da
[ "Apache-2.0" ]
31
2016-12-05T14:52:46.000Z
2021-03-24T05:47:47.000Z
package model type Demo struct { Key string Value string } func NewDemo() *Demo { s := &Demo{} return s }
9.5
22
0.640351
bd2f60a12d630e8dc0cc5bf83be03e456912f05c
1,519
rs
Rust
2020/day-3/src/main.rs
sil-vio/advent-of-code-2021
f9bc9fa550578baf0da5da1143715bf6c94650ee
[ "MIT" ]
1
2021-12-02T16:55:53.000Z
2021-12-02T16:55:53.000Z
2020/day-3/src/main.rs
sil-vio/advent-of-code-2021
f9bc9fa550578baf0da5da1143715bf6c94650ee
[ "MIT" ]
null
null
null
2020/day-3/src/main.rs
sil-vio/advent-of-code-2021
f9bc9fa550578baf0da5da1143715bf6c94650ee
[ "MIT" ]
null
null
null
use std::path::Path; use std::{ fs::File, io::{self, BufRead, BufReader}, }; fn main() { let lines = lines_from_file("input").unwrap(); let mut values =vec![0; 5]; values[0] = check_slope(&lines, 1, 1); values[1] = check_slope(&lines, 3, 1); values[2] = check_slope(&lines, 5, 1); values[3] = check_slope(&lines, 7, 1); values[4] = check_slope(&lines, 1, 2); println!("part 1 : {}", values[1]); println!("part 2 : {}", values.iter().product::<u64>()); } fn check_slope(lines: &Vec<Vec<char>>, dx_slope: usize, down_slope: usize) -> u64 { let mut counter: u64 = 0; for (i, line) in lines.iter().step_by(down_slope).enumerate() { if line[i*dx_slope % lines[0].len()] == '#' { counter += 1; } } counter } fn lines_from_file(filename: impl AsRef<Path>) -> io::Result<Vec<Vec<char>>> { Ok(BufReader::new(File::open(filename)?) .lines() .map(|s| s.unwrap().chars().map(|c| c).collect()) .collect::<Vec<Vec<char>>>()) } #[cfg(test)] mod tests { use super::*; #[test] fn day_3() { let lines = lines_from_file("test_input").unwrap(); assert_eq!(lines.len(), 11); assert_eq!(lines.get(0).unwrap().len(), 11); assert_eq!(check_slope(&lines, 1, 1), 2); assert_eq!(check_slope(&lines, 3, 1), 7); assert_eq!(check_slope(&lines, 5, 1), 3); assert_eq!(check_slope(&lines, 7, 1), 4); assert_eq!(check_slope(&lines, 1, 2), 2); } }
28.12963
83
0.551679
0ec97906124836f1f6dee127bd20c9df9a48a4ce
508
ts
TypeScript
components/_utils/_style.util.ts
Leo-Thx/Moore
4f9d76171fce122ed36098afe346256ba431a51a
[ "MIT" ]
null
null
null
components/_utils/_style.util.ts
Leo-Thx/Moore
4f9d76171fce122ed36098afe346256ba431a51a
[ "MIT" ]
1
2022-02-27T07:03:44.000Z
2022-02-27T07:03:44.000Z
components/_utils/_style.util.ts
Leo-Thx/Moore
4f9d76171fce122ed36098afe346256ba431a51a
[ "MIT" ]
null
null
null
import { clsPrefix } from './../_config/_variables'; /** * 获取class前缀 * @param prefix class前缀 * @param cusPrefix 自定义前缀,默认moore * @example * getClsPrefix('btn') -> moore-btn * getClsPrefix('btn', 'myclass') -> myclass-btn */ export const getClsPrefix:(prefix: string, cusPrefix?: string) => string = (prefix, cusPrefix = clsPrefix) => [ cusPrefix, prefix ].join('-'); /** * 输出警告的消息 * @param message 打印的信息 */ export const devWarning: (message: string) => void = message => console.warn(message);
26.736842
142
0.663386
5c83130296d6c81d914e0128a2b0c1246ae6c0a2
43
css
CSS
public/themes/css/theme-dark.css
Sadgasmification/nuitinfo
b44155907fba08de853532bc03721fc84f6d2f4e
[ "MIT" ]
null
null
null
public/themes/css/theme-dark.css
Sadgasmification/nuitinfo
b44155907fba08de853532bc03721fc84f6d2f4e
[ "MIT" ]
null
null
null
public/themes/css/theme-dark.css
Sadgasmification/nuitinfo
b44155907fba08de853532bc03721fc84f6d2f4e
[ "MIT" ]
null
null
null
body.dark #app { filter: invert(100%); }
10.75
23
0.604651
b18ec7c736799bfc4f1bcb24666a6cb70be9c440
19,314
c
C
eqn_lib/eqnbase.c
CavendishAstrophysics/anmap
efb611d7f80a3d14dc55e46cd01e8a622f6fd294
[ "BSD-3-Clause" ]
1
2015-09-01T12:40:45.000Z
2015-09-01T12:40:45.000Z
eqn_lib/eqnbase.c
CavendishAstrophysics/anmap
efb611d7f80a3d14dc55e46cd01e8a622f6fd294
[ "BSD-3-Clause" ]
null
null
null
eqn_lib/eqnbase.c
CavendishAstrophysics/anmap
efb611d7f80a3d14dc55e46cd01e8a622f6fd294
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright I guess there should be some copywrite for this package, * * Copyright (c) 1992 * * Liverpool University Department of Pure Mathematics, * Liverpool, L69 3BX, England. * * Author Dr R. J. Morris. * * e-mail rmorris@uk.ac.liv.uxb * * This software is copyrighted as noted above. It may be freely copied, * modified, and redistributed, provided that the copyright notice is * preserved on all copies. * * There is no warranty or other guarantee of fitness for this software, * it is provided solely "as is". Bug reports or fixes may be sent * to the authors, who may or may not act on them as they desire. * * You may not include this software in a program or other software product * without supplying the source, or without informing the end-user that the * source is available for no extra charge. * * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, * and the reason for such modification. * * All this software is public domain, as long as it is not used by any military * establishment. Please note if you are a military establishment then a mutating * virus has now escaped into you computer and is presently turning all your * programs into socially useful, peaceful ones. * */ #include <stdio.h> #include <math.h> #include <string.h> #define I_AM_EQNBASE #include "eqn.h" /* #define SORT_ADD #define PRINT_EXPANSION #define PRINT_DIFF_FUN */ #define SILLYFUNS #define grballoc(node) (node *) malloc(sizeof(node)) #define MAX(a,b) a > b ? a : b ; #define TRUE 1 #define FALSE 0 /*************************************************************************/ /* */ /* Global Varibles */ /* */ /*************************************************************************/ int eqnin_mode; /* mode of input file/stdin/string */ FILE *eqnin_file; /* input file for equation */ char *eqnin_str; /* input string for equation */ eqnode *equation_base; /* a pointer the base of the equation tree being read */ /* this is assigned in eeparse */ extern int ptrerrstring; /*************************************************************************/ /* */ /* first some subroutines to call the parser */ /* */ /*************************************************************************/ /**** input from stdin ****/ eqnode *scan_eqn() { eqnin_mode = EQNFROM_STDIN; ptrerrstring = 0; eeparse(); return(equation_base); } /**** input from a file ****/ eqnode *fscan_eqn(fp) FILE *fp; { eqnin_mode = EQNFROM_FILE; eqnin_file = fp; ptrerrstring = 0; eeparse(); return(equation_base); } /**** input from a string ****/ eqnode *sscan_eqn(string) char *string; { char stringblock[160]; eqnin_mode = EQNFROM_STRING; if( strlen(string) >= 160 ) { fprintf(stderr,"sscan_eqn: string to long <%s>\n",string); exit(-1); } eqnin_str = stringblock; strcpy( eqnin_str, string); ptrerrstring = 0; eeparse(); return(equation_base); } /*************************************************************************/ /* */ /* Now some routines for basic tree handeling */ /* */ /*************************************************************************/ /**** displays the equation in a tree fashion ****/ display_eqn( base, depth ) eqnode *base; int depth; { int i; if( base == NULL ) { fprintf(stderr,"display_eqn: base == NULL\n"); return; } switch( base->op ) { case NAME: for(i=1;i<=depth;++i) printf(" "); printf("%s\n",base->u.str); break; case NUMBER: for(i=1;i<=depth;++i) printf(" "); printf("%lf\n",base->u.num); break; case FUNCTION: for(i=1;i<=depth;++i) printf(" "); printf("%s\n",base->u.f.f->name); if(base->u.f.f->type != CONSTANT_FUN) display_eqn(base->u.f.a,depth+1); break; case '+': case '-': case '*': case '/': case '^': case '=': case ',': case '.': display_eqn(base->u.n.l,depth+1); for(i=1;i<=depth;++i) printf(" "); printf("%c\n",base->op); display_eqn(base->u.n.r,depth+1); break; default: fprintf(stderr,"display_eqn: bad op "); fprint_op(stderr,base->op); fprintf(stderr,"\n"); } } /**** prints the equation with lots of brackets! ****/ fprint_eqn(file, base ) FILE *file; eqnode *base; { if( base == NULL ) { fprintf(stderr,"NULL\007"); return; } switch( base->op ) { case FUNCTION: if(base->u.f.f->type == CONSTANT_FUN) { fprintf(file,"%s",base->u.f.f->name); break; } fprintf(file,"%s(",base->u.f.f->name); fprint_eqn(file,base->u.f.a); fprintf(file,")"); break; case NAME: fprintf(file,"%s",base->u.str); break; case NUMBER: if( eqnval(base) == rint(eqn_val(base)) ) fprintf(file,"%.0lf",eqn_val(base)); else if( eqnval(base)*10.0 == rint(eqn_val(base)*10.0) ) fprintf(file,"%.1lf",eqn_val(base)); else if( eqnval(base)*100.0 == rint(eqn_val(base)*100.0) ) fprintf(file,"%.2lf",eqn_val(base)); else if( eqnval(base)*1000.0 == rint(eqn_val(base)*1000.0) ) fprintf(file,"%.3lf",eqn_val(base)); else if( eqnval(base)*10000.0 == rint(eqn_val(base)*10000.0) ) fprintf(file,"%.4lf",eqn_val(base)); else fprintf(file,"%lf",eqn_val(base)); break; case BRACKET: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; case INTERVAL: fprintf(file,"["); fprint_eqn(file,base->u.n.l); fprintf(file,","); fprint_eqn(file,base->u.n.r); fprintf(file,"]"); break; case '+': switch( base->u.n.l->op ) { case '^': case '*': case '/': case '+': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.l); break; default: /* ',' and '-' and '=' */ fprintf(file,"("); fprint_eqn(file,base->u.n.l); fprintf(file,")"); break; } fprintf(file,"+"); switch( base->u.n.r->op ) { case '^': case '*': case '/': case '+': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; } break; case '-': switch( base->u.n.l->op ) { case '^': case '*': case '/': case '+': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.l); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.l); fprintf(file,")"); break; } fprintf(file,"-"); switch( base->u.n.r->op ) { case '^': case '*': case '/': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; } break; case '*': case '.': switch( base->u.n.l->op ) { case '^': case '*': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.l); break; default: /* '+' '-' '/' ',' '=' */ fprintf(file,"("); fprint_eqn(file,base->u.n.l); fprintf(file,")"); break; } fprintf(file,"%c",base->op); switch( base->u.n.r->op ) { case '^': case '*': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; } break; case '/': switch( base->u.n.l->op ) { case '^': case '*': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.l); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.l); fprintf(file,")"); break; } fprintf(file,"/"); switch( base->u.n.r->op ) { case '^': case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; } break; case '^': switch( base->u.n.l->op ) { case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.l); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.l); fprintf(file,")"); break; } fprintf(file,"^"); switch( base->u.n.r->op ) { case NAME: case NUMBER: case FUNCTION: fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"("); fprint_eqn(file,base->u.n.r); fprintf(file,")"); break; } break; case '=': case ',': fprint_eqn(file,base->u.n.l); fprintf(file,"%c",base->op); fprint_eqn(file,base->u.n.r); break; default: fprintf(file,"bad op: "); fprint_op(file,base->op); fprintf(file," "); } } print_eqn(eqn) eqn_node *eqn; { fprint_eqn(stdout,eqn); } fprint_op(fp,op) FILE *fp; int op; { switch(op) { case '+': case '-': case '*': case '/': case '=': case ',': case '^': case '.': fprintf(fp,"'%c'",op); case NUMBER: fprintf(fp,"NUMBER"); break; case INTERVAL: fprintf(fp,"INTERVAL"); break; case FUNCTION: fprintf(fp,"FUNCTION"); break; case NAME: fprintf(fp,"NAME"); break; case SUM1: fprintf(fp,"+"); break; case SUM2: fprintf(fp,"SUM2"); break; case SUM3: fprintf(fp,"SUM3"); break; case SUB1: fprintf(fp,"-"); break; case SUB2: fprintf(fp,"SUB2"); break; case SUB3: fprintf(fp,"SUB3"); break; case DOT2: fprintf(fp,"DOT2"); break; case DOT3: fprintf(fp,"DOT3"); break; case CROSS3: fprintf(fp,"CROSS3"); break; case SCALE2: fprintf(fp,"SCALE2"); break; case SCALE3: fprintf(fp,"SCALE3"); break; case INT_POW: fprintf(fp,"INT_POW"); break; case MULT1: fprintf(fp,"*"); break; case DIV1: fprintf(fp,"/"); break; case EQUALS1: fprintf(fp,"="); break; case POW1: fprintf(fp,"^"); break; default: fprintf(fp,"unknown %d",op); break; } } print_op(op) int op; { fprint_op(stdout,op); } /**** returns a pointer to a copy of the equation given by base ****/ eqnode *duplicate( base ) eqnode *base; { eqnode *temp; if( base == NULL ) { fprintf(stderr,"Tried to duplicate a NULL equation\n"); return(NULL); } temp = grballoc( eqnode ); temp->op = base->op; switch( base->op ) { case BRACKET: temp->u.n.r=duplicate(base->u.n.r); break; case FUNCTION: temp->u.f.f = base->u.f.f; if(base->u.f.f->type == CONSTANT_FUN) temp->u.f.a = NULL; else temp->u.f.a = duplicate(base->u.f.a); break; case NAME: temp->u.str = (char *) calloc( strlen(base->u.str)+1 , sizeof( char ) ); strcpy(temp->u.str,base->u.str); break; case NUMBER: temp->u.num = base->u.num; break; case '+': case '-': case '*': case '/': case '^': case '=': case ',': case INTERVAL: case '.': temp->u.n.l=duplicate(base->u.n.l); temp->u.n.r=duplicate(base->u.n.r); break; default: fprintf(stderr,"duplicate: bad op "); fprint_op(stderr,base->op); fprintf(stderr,"\n"); break; } return( temp ); } /* * Function: copy node * Action: copies the information from right to base */ copy_node(base,right) eqnode *base,*right; { if(right == NULL) { fprintf(stderr,"Tried to copy a Null equation\n"); return; } if(base == NULL) { fprintf(stderr,"Tried to copy onto a Null node\n"); return; } base->op = right->op; switch( right->op ) { case NUMBER: base->u.num = right->u.num; break; case NAME: base->u.str = right->u.str; break; case '+': case '-': case '*': case '/': case '^': case '=': case ',': case '.': base->u.n.l = right->u.n.l; base->u.n.r = right->u.n.r; break; case FUNCTION: base->u.f.f = right->u.f.f; base->u.f.a = right->u.f.a; break; case BRACKET: base->u.n.r = right->u.n.r; break; default: fprintf(stderr,"copy_node: bad op "); fprint_op(stderr,base->op); fprintf(stderr,"\n"); break; } } /* * Function: count_eqn_tree * Action: counts the number of nodes in a tree * note a,b only counts as two nodes */ int count_eqn_tree( base ) eqnode *base; { if( base == NULL ) { fprintf(stderr,"tried to count the nodes in a null equation\n"); return(0); } switch( base->op ) { case NAME: case NUMBER: return( 1 ); case '+': case '-': case '*': case '/': case '^': case '=': case '.': return( 1 + count_eqn_tree(base->u.n.l) + count_eqn_tree(base->u.n.r) ); case ',': return( count_eqn_tree(base->u.n.l) + count_eqn_tree(base->u.n.r) ); case FUNCTION: if(base->u.f.f->type == CONSTANT_FUN ) return( 1 ); return( 1 + count_eqn_tree(base->u.f.a) ); case BRACKET: return(count_eqn_tree(base->u.n.r)); default: fprintf(stderr,"count_eqn_tree: bad op "); fprint_op(stderr,base->op); fprintf(stderr,"\n"); break; } return( 0 ); } int count_eqn_args(base) eqnode *base; { int leftcount,rightcount; if(base == NULL) { fprintf(stderr,"Null equation while trying to count number of arguments\n"); return(0); } switch( base->op ) { case NAME: case NUMBER: return( 1 ); case '+': case '-': case '=': leftcount = count_eqn_args(base->u.n.l); rightcount = count_eqn_args(base->u.n.r); if(leftcount == 0 || rightcount == 0 ) return(0); if(leftcount != rightcount ) { fprintf(stderr,"Different counts for '%c' %d %d\n", base->op,leftcount,rightcount); return(0); } return(leftcount); case '*': leftcount = count_eqn_args(base->u.n.l); rightcount = count_eqn_args(base->u.n.r); if(leftcount == 0 || rightcount == 0 ) return(0); if(leftcount != 1 ) { fprintf(stderr,"Bad counts for '%c' %d %d\n", base->op,leftcount,rightcount); return(0); } return(rightcount); case '.': leftcount = count_eqn_args(base->u.n.l); rightcount = count_eqn_args(base->u.n.r); if(leftcount == 0 || rightcount == 0 ) return(0); if(leftcount != rightcount ) { fprintf(stderr,"Bad counts for '%c' %d %d\n", base->op,leftcount,rightcount); return(0); } return(1); case '/': leftcount = count_eqn_args(base->u.n.l); rightcount = count_eqn_args(base->u.n.r); if(leftcount == 0 || rightcount == 0 ) return(0); if(leftcount != 1 || rightcount != 1) { fprintf(stderr,"Bad counts for '%c' %d %d\n", base->op,leftcount,rightcount); return(0); } return(rightcount); case '^': leftcount = count_eqn_args(base->u.n.l); rightcount = count_eqn_args(base->u.n.r); if(leftcount == 0 || rightcount == 0 ) return(0); if(leftcount != rightcount || ( leftcount != 1 && leftcount != 3) ) { fprintf(stderr,"Bad counts for '%c' %d %d\n", base->op,leftcount,rightcount); return(0); } return(rightcount); case FUNCTION: if( base->u.f.f->type == EXTERN_MAP || base->u.f.f->type == INTERN_MAP ) return(base->u.f.f->dim); else return(1); case ',': return( count_eqn_args(base->u.n.l) + count_eqn_args(base->u.n.r) ); default: fprintf(stderr,"count_eqn_args: bad op "); fprint_op(stderr,base->op); fprintf(stderr,"\n"); break; } return( 0 ); } /* * Function: get_eqn_arg * Action: gets the i th argument from a comma seperated list * can cope with (a,b,c),(d,e,f) */ eqnode *get_eqn_arg(base,i) eqnode *base; int i; { int leftcount; if(base == NULL) { fprintf(stderr,"get_eqn_arg: base = NULL\n"); return(NULL); } if( base->op != ',' ) { if(i == 1) return(base); else return(NULL); } leftcount = count_eqn_args(base->u.n.l); if(i <= leftcount ) return(get_eqn_arg(base->u.n.l,i)); else return(get_eqn_arg(base->u.n.r,i-leftcount)); } /**** frees the space used by the equation base ****/ free_eqn_tree( base ) eqnode *base; { if( base == NULL ) { fprintf(stderr,"Tried to free a null equation\n"); return; } switch( base->op ) { case NAME: free( base->u.str ); break; case NUMBER: break; case '+': case '-': case '*': case '/': case '^': case '=': case ',': case INTERVAL: free_eqn_tree(base->u.n.l); free_eqn_tree(base->u.n.r); break; case FUNCTION: if(base->u.f.f->type != CONSTANT_FUN) free_eqn_tree(base->u.f.a); break; case BRACKET: free_eqn_tree(base->u.n.r); break; } free( base ); } free_eqn_node( node ) eqnode *node; { if( node->op == NAME) free( node->u.str ); free( node ); } /* * Function: eqn_list_product * Action: multiply together two lists of same structure * Returns: pointer to product, NULL on error */ eqnode *eqn_list_product(left,right) eqnode *left,*right; { eqnode *node; if(left == NULL ) { fprintf(stderr,"eqn_list_product: NULL left\n"); return(NULL); } if(right == NULL ) { fprintf(stderr,"eqn_list_product: NULL right\n"); return(NULL); } if( left->op == ',' && right->op == ',' ) { node = grballoc(eqnode); node->op == '+'; node->u.n.l = eqn_list_product(left->u.n.l,right->u.n.l); node->u.n.r = eqn_list_product(left->u.n.r,right->u.n.r); if(node->u.n.l == NULL || node->u.n.r == NULL) { free(node); return(NULL); } } else if( left->op != ',' && right->op != ',' ) { node = grballoc(eqnode); node->op = '*'; node->u.n.l = left; node->u.n.r = right; } else { fprintf(stderr,"eqn_list_product: left and right trees didn't match\n"); fprint_eqn(stderr,left); fprintf(stderr,"\n"); fprint_eqn(stderr,right); fprintf(stderr,"\n"); return(NULL); } return(node); } /* * Functions: join_eqn,join_dup_eqn * Action: Joins two equations together linked by op * for join_dup_eqns copys of the equations are used. */ eqnode *join_eqns(op,left,right) int op; eqnode *left, *right; { eqnode *temp; if(left == NULL ) { fprintf(stderr,"Null left equation while joining equations\n"); return(NULL); } if(right == NULL ) { fprintf(stderr,"Null right equation while joining equations\n"); return(NULL); } switch(op) { case '+': case '-': case '*': case '/': case '^': case '=': case ',': case '.': break; default: fprintf(stderr,"Bad op "); fprint_op(stderr,op); fprintf(stderr," while joining equations\n"); return(NULL); } temp = grballoc(eqnode); temp->op = op; temp->u.n.l = left; temp->u.n.r = right; return(temp); } eqnode *join_dup_eqns(op,left,right) int op; eqnode *left, *right; { eqnode *temp; if(left == NULL ) { fprintf(stderr,"Null left equation while joining equations\n"); return(NULL); } if(right == NULL ) { fprintf(stderr,"Null right equation while joining equations\n"); return(NULL); } switch(op) { case '+': case '-': case '*': case '/': case '^': case '=': case ',': case '.': break; default: fprintf(stderr,"Bad op "); fprint_op(stderr,op); fprintf(stderr," while joining equations\n"); return(NULL); } temp = grballoc(eqnode); temp->op = op; temp->u.n.l = duplicate(left); temp->u.n.r = duplicate(right); return(temp); }
23.467801
96
0.563529
bcb27688bf8f043e86c9805d7e721a600f204abf
39
js
JavaScript
packages/2002/11/06/index.js
antonmedv/year
ae5d8524f58eaad481c2ba599389c7a9a38c0819
[ "MIT" ]
7
2017-07-03T19:53:01.000Z
2021-04-05T18:15:55.000Z
packages/2002/11/06/index.js
antonmedv/year
ae5d8524f58eaad481c2ba599389c7a9a38c0819
[ "MIT" ]
1
2018-09-05T11:53:41.000Z
2018-12-16T12:36:21.000Z
packages/2002/11/06/index.js
antonmedv/year
ae5d8524f58eaad481c2ba599389c7a9a38c0819
[ "MIT" ]
2
2019-01-27T16:57:34.000Z
2020-10-11T09:30:25.000Z
module.exports = new Date(2002, 10, 6)
19.5
38
0.692308
0ee84b635a2beaae1452d4fb214d2cc82cbf54af
433
h
C
switch.h
Dmytr0K/steppers_control_se
1d3843efbf2fa99b7f08f96b395b251460c1b125
[ "MIT" ]
null
null
null
switch.h
Dmytr0K/steppers_control_se
1d3843efbf2fa99b7f08f96b395b251460c1b125
[ "MIT" ]
null
null
null
switch.h
Dmytr0K/steppers_control_se
1d3843efbf2fa99b7f08f96b395b251460c1b125
[ "MIT" ]
null
null
null
#ifndef SWITCH_H #define SWITCH_H #include <QWidget> #include "packet.h" namespace Ui { class Switch; } class Switch : public QWidget { Q_OBJECT public: explicit Switch(int num, QWidget *parent = nullptr); ~Switch(); private: Ui::Switch *ui; int switchNumber; bool activated = false; QString onStyle; QString offStyle; signals: void readyToSendPacket(Packet &packet); }; #endif // SWITCH_H
13.967742
56
0.678984
b0f0747225cf93ab73e9fc3a202fbcd5ff100b2e
324
kt
Kotlin
src/model-dsl/src/main/kotlin/org/jonnyzzz/teamcity/dsl/api/DSL.Trigger.kt
jonnyzzz/TeamCity2DSL
89c0af44b07179bc21010e64b84bd1e74ad7dfab
[ "Apache-2.0" ]
6
2016-03-27T22:22:30.000Z
2016-07-14T14:17:44.000Z
src/model-dsl/src/main/kotlin/org/jonnyzzz/teamcity/dsl/api/DSL.Trigger.kt
jonnyzzz/TeamCity2DSL
89c0af44b07179bc21010e64b84bd1e74ad7dfab
[ "Apache-2.0" ]
13
2016-03-02T23:00:24.000Z
2017-06-28T12:06:39.000Z
src/model-dsl/src/main/kotlin/org/jonnyzzz/teamcity/dsl/api/DSL.Trigger.kt
jonnyzzz/TeamCity2DSL
89c0af44b07179bc21010e64b84bd1e74ad7dfab
[ "Apache-2.0" ]
null
null
null
package org.jonnyzzz.teamcity.dsl.api import org.jonnyzzz.teamcity.dsl.model.TCParameter import org.jonnyzzz.teamcity.dsl.model.TCSettingsTrigger fun TCSettingsTrigger.param(name : String, value : String) { parameters = (parameters ?: listOf()) + TCParameter().apply { this.name = name this.value = value } }
24.923077
63
0.740741
fecc7b67867e1128df404108dd1a0d2bdd69aa72
646
html
HTML
src/templates/shared/product-breadcrumb.html
actarian/atlas
9982ef789e7d879f174afd5cf3f7273076421536
[ "MIT" ]
null
null
null
src/templates/shared/product-breadcrumb.html
actarian/atlas
9982ef789e7d879f174afd5cf3f7273076421536
[ "MIT" ]
4
2020-02-13T16:46:44.000Z
2020-02-13T16:46:48.000Z
src/templates/shared/product-breadcrumb.html
actarian/atlas
9982ef789e7d879f174afd5cf3f7273076421536
[ "MIT" ]
null
null
null
<section class="section section--breadcrumb hidden-sm-down"> <div class="container-fluid"> <ul class="nav nav--breadcrumb"> <li><a href="/atlas/index.html">Home</a></li> <li><a href="/atlas/collections.html">Collections</a></li> <li><a href="/atlas/collections.html">Atlas Concorde</a></li> <li><a href="/atlas/product-project.html">Marvel Edge</a></li> <li><a href="/atlas/product-spaces.html">Spaces</a></li> </ul> <!-- SOCIAL SHARE --> <div class="btn--group"> <div class="btn btn--share"> <span class="label">Share</span> <span class="addthis_inline_share_toolbox"></span> </div> </div> </div> </section>
35.888889
87
0.640867
031fabfd942c7fb40d6f7d8f3eb85731598ed58b
1,139
lua
Lua
corona/examples/particles/main.lua
blancoberg/timewarp
12b484d304cc6167e50b378ed2fd611a9602e5e6
[ "MIT" ]
null
null
null
corona/examples/particles/main.lua
blancoberg/timewarp
12b484d304cc6167e50b378ed2fd611a9602e5e6
[ "MIT" ]
null
null
null
corona/examples/particles/main.lua
blancoberg/timewarp
12b484d304cc6167e50b378ed2fd611a9602e5e6
[ "MIT" ]
null
null
null
require "blancoberg.timewarp.TimeWarp" local bg = display.newImage("bg.png") bg.width = display.contentWidth bg.height = display.contentHeight bg.x = bg.width/2 bg.y = bg.height/2 local btn = display.newImage("button.png") btn.x = math.round(display.contentWidth/2) btn.y = math.round(display.contentHeight/2) for a=1,70,1 do local testObject = display.newImage("bouncy.png") testObject.x = display.contentWidth * math.random() testObject.y = -testObject.height testObject.xScale = a/70 testObject.yScale = a/70 TimeWarp.to(testObject, { time=1500 + 1000 * (1-testObject.xScale), delay=4000 * math.random(), rotation = 2000 * math.random(), y=display.contentHeight, transition=easing.linear }) end function eventTouch(e) -- warp to slow motion on touch -- if e.phase == "began" then TimeWarp.warpTo(0.07,300,0) TimeWarp.to(btn,{time=200,alpha=0,isPausable=false}) end -- warp to regular speed on release -- if e.phase == "ended" then TimeWarp.warpTo(1,200,200) TimeWarp.to(btn,{time=200,alpha=1,delay=200,isPausable=false}) end end Runtime:addEventListener("touch",eventTouch)
21.490566
64
0.709394
39f5446910731a72de8dd5e1121cc653cf980505
1,927
swift
Swift
Sources/Layers/BGRAtoRGBA.swift
silvrwolfboy/Bender
512ea171950d1ab997b05cf469908fbfc48060e6
[ "MIT" ]
1,840
2017-06-02T20:34:35.000Z
2022-03-08T08:43:37.000Z
Sources/Layers/BGRAtoRGBA.swift
silvrwolfboy/Bender
512ea171950d1ab997b05cf469908fbfc48060e6
[ "MIT" ]
56
2017-06-05T16:06:33.000Z
2020-03-17T20:05:58.000Z
Sources/Layers/BGRAtoRGBA.swift
xmartlabs/Bender
512ea171950d1ab997b05cf469908fbfc48060e6
[ "MIT" ]
111
2017-06-05T13:49:05.000Z
2022-02-04T13:35:32.000Z
// // BGRAtoRGBA.swift // Bender // // Created by Mathias Claassen on 5/8/17. // // import MetalPerformanceShaders import MetalPerformanceShadersProxy /// Transforms an image from RGBA to BGRA. (You can use it the other way around too) open class BGRAtoRGBA: NetworkLayer { // Custom kernels let pipelineBGRAtoRGBA: MTLComputePipelineState! public override init(id: String? = nil) { // Load custom metal kernels pipelineBGRAtoRGBA = MetalShaderManager.shared.getFunction(name: "bgra_to_rgba", in: Bundle(for: BGRAtoRGBA.self)) super.init(id: id) } open override func validate() { let incoming = getIncoming() assert(incoming.count == 1, "BGRAtoRGBA supports one input, not \(incoming.count)") } open override func initialize(network: Network, device: MTLDevice, temporaryImage: Bool = true) { super.initialize(network: network, device: device, temporaryImage: temporaryImage) let incoming = getIncoming() outputSize = incoming[0].outputSize createOutputs(size: outputSize, temporary: temporaryImage) } open override func execute(commandBuffer: MTLCommandBuffer, executionIndex index: Int = 0) { let input = getIncoming()[0].getOutput(index: index) let output = getOrCreateOutput(commandBuffer: commandBuffer, index: index) let encoder = commandBuffer.makeComputeCommandEncoder()! encoder.label = "BGRA to RGBA encoder" encoder.setComputePipelineState(pipelineBGRAtoRGBA) encoder.setTexture(input.texture, index: 0) encoder.setTexture(output.texture, index: 1) let threadsPerGroups = MTLSizeMake(32, 8, 1) let threadGroups = output.texture.threadGrid(threadGroup: threadsPerGroups) encoder.dispatchThreadgroups(threadGroups, threadsPerThreadgroup: threadsPerGroups) encoder.endEncoding() input.setRead() } }
36.358491
122
0.702647
fe3652cccbc1a421c8ba7d7ef1058a4bea2626c9
20,909
h
C
src/grib2/Properties.h
fmidev/smartmet-library-grid-files
c68d271e12e3404cd805a423fe6c5b6c467f00e6
[ "MIT" ]
null
null
null
src/grib2/Properties.h
fmidev/smartmet-library-grid-files
c68d271e12e3404cd805a423fe6c5b6c467f00e6
[ "MIT" ]
null
null
null
src/grib2/Properties.h
fmidev/smartmet-library-grid-files
c68d271e12e3404cd805a423fe6c5b6c467f00e6
[ "MIT" ]
null
null
null
#pragma once #include <map> #include <string> namespace SmartMet { namespace GRIB2 { class Property { public: Property(); virtual ~Property(); void addProperty(const char *name,uint id); uint getPropertyId(const char *name); std::string getPropertyName(uint id); static const uint FirstProperty = 2000; class IndicatorSection { public: static const uint FirstProperty = Property::FirstProperty; static const uint Discipline = FirstProperty + 0; static const uint EditionNumber = FirstProperty + 1; static const uint LastProperty = FirstProperty + 1; }; class IdentificationSection { public: static const uint FirstProperty = IndicatorSection::LastProperty + 1; static const uint Centre = FirstProperty + 0; static const uint SubCentre = FirstProperty + 1; static const uint TablesVersion = FirstProperty + 2; static const uint LocalTablesVersion = FirstProperty + 3; static const uint SignificanceOfReferenceTime = FirstProperty + 4; static const uint Year = FirstProperty + 5; static const uint Month = FirstProperty + 6; static const uint Day = FirstProperty + 7; static const uint Hour = FirstProperty + 8; static const uint Minute = FirstProperty + 9; static const uint Second = FirstProperty + 10; static const uint ProductionStatusOfProcessedData = FirstProperty + 11; static const uint TypeOfProcessedData = FirstProperty + 12; static const uint LastProperty = FirstProperty + 12; }; class LocalSection { public: static const uint FirstProperty = IdentificationSection::LastProperty +1; static const uint LastProperty = FirstProperty + 0; }; class GridSection { public: static const uint FirstProperty = LocalSection::LastProperty + 1; static const uint SourceOfGridDefinition = FirstProperty + 0; static const uint NumberOfGridPoints = FirstProperty + 1; static const uint NumberOfOctetsForNumberOfPoints = FirstProperty + 2; static const uint InterpretationOfNumberOfPoints = FirstProperty + 3; static const uint GridDefinitionTemplateNumber = FirstProperty + 4; class EarthShape { public: static const uint FirstProperty = GridSection::FirstProperty + 5; static const uint ShapeOfTheEarth = FirstProperty + 0; static const uint ScaleFactorOfRadiusOfSphericalEarth = FirstProperty + 1; static const uint ScaledValueOfRadiusOfSphericalEarth = FirstProperty + 2; static const uint ScaleFactorOfEarthMajorAxis = FirstProperty + 3; static const uint ScaledValueOfEarthMajorAxis = FirstProperty + 4; static const uint ScaleFactorOfEarthMinorAxis = FirstProperty + 5; static const uint ScaledValueOfEarthMinorAxis = FirstProperty + 6; static const uint LastProperty = FirstProperty + 6; }; class Grid { public: static const uint FirstProperty = EarthShape::LastProperty + 1; static const uint Ni = FirstProperty + 0; static const uint Nj = FirstProperty + 1; static const uint BasicAngleOfTheInitialProductionDomain = FirstProperty + 2; static const uint SubdivisionsOfBasicAngle = FirstProperty + 3; static const uint LatitudeOfFirstGridPoint = FirstProperty + 4; static const uint LongitudeOfFirstGridPoint = FirstProperty + 5; static const uint LatitudeOfLastGridPoint = FirstProperty + 6; static const uint LongitudeOfLastGridPoint = FirstProperty + 7; static const uint ResolutionAndComponentFlags = FirstProperty + 8; static const uint LastProperty = FirstProperty + 8; }; class Rotation { public: static const uint FirstProperty = Grid::LastProperty + 1; static const uint LatitudeOfSouthernPole = FirstProperty + 0; static const uint LongitudeOfSouthernPole = FirstProperty + 1; static const uint AngleOfRotation = FirstProperty + 2; static const uint LastProperty = FirstProperty + 2; }; class LatLon { public: static const uint FirstProperty = Rotation::LastProperty + 1; static const uint IDirectionIncrement = FirstProperty + 0; static const uint JDirectionIncrement = FirstProperty + 1; static const uint ScanningMode = FirstProperty + 2; static const uint LastProperty = FirstProperty + 2; }; class PolarStereographic { public: static const uint FirstProperty = LatLon::LastProperty + 1; static const uint Nx = FirstProperty + 0; static const uint Ny = FirstProperty + 1; static const uint LatitudeOfFirstGridPoint = FirstProperty + 2; static const uint LongitudeOfFirstGridPoint = FirstProperty + 3; static const uint ResolutionAndComponentFlags = FirstProperty + 4; static const uint LaD = FirstProperty + 5; static const uint OrientationOfTheGrid = FirstProperty + 6; static const uint Dx = FirstProperty + 7; static const uint Dy = FirstProperty + 8; static const uint ProjectionCentreFlag = FirstProperty + 9; static const uint ScanningMode = FirstProperty + 10; static const uint LastProperty = FirstProperty + 10; }; class LambertConformal { public: static const uint FirstProperty = PolarStereographic::LastProperty + 1; static const uint Nx = FirstProperty + 0; static const uint Ny = FirstProperty + 1; static const uint LatitudeOfFirstGridPoint = FirstProperty + 2; static const uint LongitudeOfFirstGridPoint = FirstProperty + 3; static const uint ResolutionAndComponentFlags = FirstProperty + 4; static const uint LaD = FirstProperty + 5; static const uint LoV = FirstProperty + 6; static const uint Dx = FirstProperty + 7; static const uint Dy = FirstProperty + 8; static const uint ProjectionCentreFlag = FirstProperty + 9; static const uint ScanningMode = FirstProperty + 10; static const uint Latin1 = FirstProperty + 11; static const uint Latin2 = FirstProperty + 12; static const uint LatitudeOfSouthernPole = FirstProperty + 13; static const uint LongitudeOfSouthernPole = FirstProperty + 14; static const uint LastProperty = FirstProperty + 14; }; class Mercator { public: static const uint FirstProperty = LambertConformal::LastProperty + 1; static const uint Ni = FirstProperty + 0; static const uint Nj = FirstProperty + 1; static const uint LatitudeOfFirstGridPoint = FirstProperty + 2; static const uint LongitudeOfFirstGridPoint = FirstProperty + 3; static const uint LaD = FirstProperty + 4; static const uint LatitudeOfLastGridPoint = FirstProperty + 5; static const uint LongitudeOfLastGridPoint = FirstProperty + 6; static const uint OrientationOfTheGrid = FirstProperty + 7; static const uint Di = FirstProperty + 8; static const uint Dj = FirstProperty + 9; static const uint ResolutionAndComponentFlags = FirstProperty + 10; static const uint ScanningMode = FirstProperty + 11; static const uint LastProperty = FirstProperty + 11; }; static const uint LastProperty = Mercator::LastProperty; }; class ProductSection { public: static const uint FirstProperty = GridSection::LastProperty + 1; static const uint ProductDefinitionTemplateNumber = FirstProperty + 0; static const uint NV = FirstProperty + 1; class ParameterSettings { public: static const uint FirstProperty = ProductSection::FirstProperty + 10; static const uint ParameterCategory = FirstProperty + 0; static const uint ParameterNumber = FirstProperty + 1; static const uint TypeOfGeneratingProcess = FirstProperty + 2; static const uint BackgroundProcess = FirstProperty + 3; static const uint GeneratingProcessIdentifier = FirstProperty + 4; static const uint HoursAfterDataCutoff = FirstProperty + 5; static const uint MinutesAfterDataCutoff = FirstProperty + 6; static const uint IndicatorOfUnitOfTimeRange = FirstProperty + 7; static const uint ForecastTime = FirstProperty + 8; static const uint LastProperty = FirstProperty + 8; }; class HorizontalSettings { public: static const uint FirstProperty = ParameterSettings::LastProperty + 1; static const uint TypeOfFirstFixedSurface = FirstProperty + 0; static const uint ScaleFactorOfFirstFixedSurface = FirstProperty + 1; static const uint ScaledValueOfFirstFixedSurface = FirstProperty + 2; static const uint TypeOfSecondFixedSurface = FirstProperty + 3; static const uint ScaleFactorOfSecondFixedSurface = FirstProperty + 4; static const uint ScaledValueOfSecondFixedSurface = FirstProperty + 5; static const uint LastProperty = FirstProperty + 5; }; class StatisticalSettings { public: static const uint FirstProperty = HorizontalSettings::LastProperty + 1; static const uint YearOfEndOfOverallTimeInterval = FirstProperty + 0; static const uint MonthOfEndOfOverallTimeInterval = FirstProperty + 1; static const uint DayOfEndOfOverallTimeInterval = FirstProperty + 2; static const uint HourOfEndOfOverallTimeInterval = FirstProperty + 3; static const uint MinuteOfEndOfOverallTimeInterval = FirstProperty + 4; static const uint SecondOfEndOfOverallTimeInterval = FirstProperty + 5; static const uint NumberOfTimeRange = FirstProperty + 6; static const uint NumberOfMissingInStatisticalProcess = FirstProperty + 7; static const uint TypeOfStatisticalProcessing = FirstProperty + 8; static const uint TypeOfTimeIncrement = FirstProperty + 9; static const uint IndicatorOfUnitForTimeRange = FirstProperty + 10; static const uint LengthOfTimeRange = FirstProperty + 11; static const uint IndicatorOfUnitForTimeIncrement = FirstProperty + 12; static const uint TimeIncrement = FirstProperty + 13; static const uint LastProperty = FirstProperty + 13; }; class EpsSettings { public: static const uint FirstProperty = StatisticalSettings::LastProperty + 1; static const uint TypeOfEnsembleForecast = FirstProperty + 0; static const uint PerturbationNumber = FirstProperty + 1; static const uint NumberOfForecastsInEnsemble = FirstProperty + 2; static const uint LastProperty = FirstProperty + 2; }; class DerivedSettings { public: static const uint FirstProperty = EpsSettings::LastProperty + 1; static const uint DerivedForecast = FirstProperty + 0; static const uint NumberOfForecastsInEnsemble = FirstProperty + 1; static const uint LastProperty = FirstProperty + 1; }; class RectangularClusterSettings { public: static const uint FirstProperty = DerivedSettings::LastProperty + 1; static const uint ClusterIdentifier = FirstProperty + 0; static const uint NH = FirstProperty + 1; static const uint NL = FirstProperty + 2; static const uint TotalNumberOfClusters = FirstProperty + 3; static const uint ClusteringMethod = FirstProperty + 4; static const uint NorthernLatitudeOfClusterDomain = FirstProperty + 5; static const uint SouthernLatitudeOfClusterDomain = FirstProperty + 6; static const uint EasternLongitudeOfClusterDomain = FirstProperty + 7; static const uint WesternLongitudeOfClusterDomain = FirstProperty + 8; static const uint NumberOfForecastsInTheCluster = FirstProperty + 9; static const uint ScaleFactorOfStandardDeviation = FirstProperty + 10; static const uint ScaledValueOfStandardDeviation = FirstProperty + 11; static const uint ScaleFactorOfDistanceFromEnsembleMean = FirstProperty + 12; static const uint ScaledValueOfDistanceFromEnsembleMean = FirstProperty + 13; static const uint LastProperty = FirstProperty + 13; }; class ProbabilitySettings { public: static const uint FirstProperty = RectangularClusterSettings::LastProperty + 1; static const uint ForecastProbabilityNumber = FirstProperty + 0; static const uint TotalNumberOfForecastProbabilities = FirstProperty + 1; static const uint ProbabilityType = FirstProperty + 2; static const uint ScaleFactorOfLowerLimit = FirstProperty + 3; static const uint ScaledValueOfLowerLimit = FirstProperty + 4; static const uint ScaleFactorOfUpperLimit = FirstProperty + 5; static const uint ScaledValueOfUpperLimit = FirstProperty + 6; static const uint LastProperty = FirstProperty + 6; }; class PercentileSettings { public: static const uint FirstProperty = ProbabilitySettings::LastProperty + 1; static const uint PercentileValue = FirstProperty + 0; static const uint LastProperty = FirstProperty + 0; }; class CategoricalSettings { public: static const uint FirstProperty = PercentileSettings::LastProperty + 1; static const uint NumberOfCategories = FirstProperty + 0; static const uint CategoryType = FirstProperty + 1; static const uint CodeFigure = FirstProperty + 2; static const uint ScaleFactorOfLowerLimit = FirstProperty + 3; static const uint ScaledValueOfLowerLimit = FirstProperty + 4; static const uint ScaleFactorOfUpperLimit = FirstProperty + 5; static const uint ScaledValueOfUpperLimit = FirstProperty + 6; static const uint LastProperty = FirstProperty + 6; }; static const uint LastProperty = CategoricalSettings::LastProperty; }; class RepresentationSection { public: static const uint FirstProperty = ProductSection::LastProperty + 1; static const uint RepresentationTemplateNumber = FirstProperty + 0; class Packing { public: static const uint FirstProperty = RepresentationSection::FirstProperty + 10; static const uint ReferenceValue = FirstProperty + 0; static const uint BinaryScaleFactor = FirstProperty + 1; static const uint DecimalScaleFactor = FirstProperty + 2; static const uint BitsPerValue = FirstProperty + 3; static const uint LastProperty = FirstProperty + 3; }; class OriginalValues { public: static const uint FirstProperty = Packing::LastProperty + 1; static const uint TypeOfOriginalFieldValues = FirstProperty + 0; static const uint LastProperty = FirstProperty + 0; }; static const uint LastProperty = OriginalValues::LastProperty; }; class BitmapSection { public: static const uint FirstProperty = RepresentationSection::LastProperty; static const uint LastProperty = FirstProperty + 0; }; class DataSection { public: static const uint FirstProperty = BitmapSection::LastProperty; static const uint LastProperty = FirstProperty + 0; }; static const uint LastProperty = DataSection::LastProperty; protected: std::map<std::string,uint> propertyMap; }; // class Propetry extern Property gribProperty; } // namespace GRIB2 } // namespace SmartMet
53.203562
115
0.521689
85aa27a76c0728b60885f41a5b7e376a816fca60
1,896
js
JavaScript
src/TransitionHeight.js
samsch/transition-height
d40179f9b46e091f1a24d7c49c18b955432bc1dd
[ "0BSD" ]
1
2020-10-29T16:29:33.000Z
2020-10-29T16:29:33.000Z
src/TransitionHeight.js
samsch/transition-height
d40179f9b46e091f1a24d7c49c18b955432bc1dd
[ "0BSD" ]
null
null
null
src/TransitionHeight.js
samsch/transition-height
d40179f9b46e091f1a24d7c49c18b955432bc1dd
[ "0BSD" ]
null
null
null
import React from 'react'; // non-'visible' overflow style to be added to inner wrapper, which stops // margin collapsing out from children. const styleOverFlowAuto = { overflowY: 'auto', }; class TransitionHeight extends React.Component { constructor(props) { super(props); this.state = { height: this.props.collapsed ? '0px' : undefined, }; this.getWrapperDiv = div => { this.divEl = div; }; } componentWillReceiveProps(nextProps) { if ( nextProps.trigger !== this.props.trigger || nextProps.collapsed !== this.props.collapsed ) { this.setState({ height: this.props.collapsed ? '0px' : this.divEl.offsetHeight + 'px', }); } } componentDidUpdate(prevProps) { if ( (this.state.height != null && prevProps.trigger !== this.props.trigger) || prevProps.collapsed !== this.props.collapsed ) { setTimeout(() => { this.setState( { height: this.props.collapsed ? '0px' : this.divEl.offsetHeight + 'px', }, () => { setTimeout(() => { this.setState({ height: this.props.collapsed ? '0px' : undefined, }); }, this.props.transitionTimeSeconds * 1000); } ); }, 20); } } render() { const outerWrapperStyle = { transition: 'height ' + this.props.transitionTimeSeconds + 's ease', height: this.state.height, overflowY: !this.props.collapsed && this.state.height == null ? 'auto' : 'hidden', }; return ( <div style={outerWrapperStyle}> <div style={styleOverFlowAuto} ref={this.getWrapperDiv}> {this.props.children} </div> </div> ); } } TransitionHeight.defaultProps = { transitionTimeSeconds: 0.2, }; export default TransitionHeight;
26.333333
80
0.564346
d411616d99955da9901c26ea67a2a503eb5f02eb
429
rs
Rust
bindings/build.rs
Syfaro/windows-audio
cf5322f36330508ff6a5e2ad33794d0ebf4737a2
[ "MIT" ]
null
null
null
bindings/build.rs
Syfaro/windows-audio
cf5322f36330508ff6a5e2ad33794d0ebf4737a2
[ "MIT" ]
null
null
null
bindings/build.rs
Syfaro/windows-audio
cf5322f36330508ff6a5e2ad33794d0ebf4737a2
[ "MIT" ]
null
null
null
fn main() { windows::build! { Windows::Win32::Foundation::*, Windows::Win32::Media::Audio::CoreAudio::*, Windows::Win32::Storage::StructuredStorage::*, Windows::Win32::System::Com::*, Windows::Win32::System::ProcessStatus::*, Windows::Win32::System::PropertiesSystem::*, Windows::Win32::System::SystemServices::*, Windows::Win32::System::Threading::*, }; }
33
54
0.587413
f03c09de77f0c7e78b6c4a050e9ad430074aaf84
3,720
js
JavaScript
node_modules/scala-node/main/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.4.0.jar--29fb2f8b/scala/scalajs/runtime/StackTrace$StringRE.js
ignaciocases/hermeneumatics
f89268676a31ed764b6a861834a93a4d1f24a36c
[ "MIT" ]
null
null
null
node_modules/scala-node/main/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.4.0.jar--29fb2f8b/scala/scalajs/runtime/StackTrace$StringRE.js
ignaciocases/hermeneumatics
f89268676a31ed764b6a861834a93a4d1f24a36c
[ "MIT" ]
null
null
null
node_modules/scala-node/main/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.4.0.jar--29fb2f8b/scala/scalajs/runtime/StackTrace$StringRE.js
ignaciocases/hermeneumatics
f89268676a31ed764b6a861834a93a4d1f24a36c
[ "MIT" ]
null
null
null
/** @constructor */ ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE = (function() { ScalaJS.c.java_lang_Object.call(this); this.s$1 = null }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype = new ScalaJS.inheritable.java_lang_Object(); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.constructor = ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE; ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.s__T = (function() { return this.s$1 }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.re__Lscala_scalajs_js_RegExp = (function() { return ScalaJS.modules.scala_scalajs_runtime_StackTrace$StringRE().re$extension0__T__Lscala_scalajs_js_RegExp(this.s__T()) }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.re__T__Lscala_scalajs_js_RegExp = (function(mods) { return ScalaJS.modules.scala_scalajs_runtime_StackTrace$StringRE().re$extension1__T__T__Lscala_scalajs_js_RegExp(this.s__T(), mods) }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.hashCode__I = (function() { return ScalaJS.modules.scala_scalajs_runtime_StackTrace$StringRE().hashCode$extension__T__I(this.s__T()) }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.equals__O__Z = (function(x$1) { return ScalaJS.modules.scala_scalajs_runtime_StackTrace$StringRE().equals$extension__T__O__Z(this.s__T(), x$1) }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.init___T = (function(s) { this.s$1 = s; ScalaJS.c.java_lang_Object.prototype.init___.call(this); return this }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.re__T__ = (function(mods) { return this.re__T__Lscala_scalajs_js_RegExp(mods) }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.re__ = (function() { return this.re__Lscala_scalajs_js_RegExp() }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.s__ = (function() { return this.s__T() }); /** @constructor */ ScalaJS.inheritable.scala_scalajs_runtime_StackTrace$StringRE = (function() { /*<skip>*/ }); ScalaJS.inheritable.scala_scalajs_runtime_StackTrace$StringRE.prototype = ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype; ScalaJS.is.scala_scalajs_runtime_StackTrace$StringRE = (function(obj) { return (!(!((obj && obj.$classData) && obj.$classData.ancestors.scala_scalajs_runtime_StackTrace$StringRE))) }); ScalaJS.as.scala_scalajs_runtime_StackTrace$StringRE = (function(obj) { if ((ScalaJS.is.scala_scalajs_runtime_StackTrace$StringRE(obj) || (obj === null))) { return obj } else { ScalaJS.throwClassCastException(obj, "scala.scalajs.runtime.StackTrace$StringRE") } }); ScalaJS.isArrayOf.scala_scalajs_runtime_StackTrace$StringRE = (function(obj, depth) { return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.scala_scalajs_runtime_StackTrace$StringRE))) }); ScalaJS.asArrayOf.scala_scalajs_runtime_StackTrace$StringRE = (function(obj, depth) { if ((ScalaJS.isArrayOf.scala_scalajs_runtime_StackTrace$StringRE(obj, depth) || (obj === null))) { return obj } else { ScalaJS.throwArrayCastException(obj, "Lscala.scalajs.runtime.StackTrace$StringRE;", depth) } }); ScalaJS.data.scala_scalajs_runtime_StackTrace$StringRE = new ScalaJS.ClassTypeData({ scala_scalajs_runtime_StackTrace$StringRE: 0 }, false, "scala.scalajs.runtime.StackTrace$StringRE", ScalaJS.data.java_lang_Object, { scala_scalajs_runtime_StackTrace$StringRE: 1, java_lang_Object: 1 }); ScalaJS.c.scala_scalajs_runtime_StackTrace$StringRE.prototype.$classData = ScalaJS.data.scala_scalajs_runtime_StackTrace$StringRE; //@ sourceMappingURL=StackTrace$StringRE.js.map
53.142857
163
0.801075
39d4ea7b19990d4fc3c2b9860b068fb0df0f493a
563
js
JavaScript
src/types/main/CollectionRefundDetailActionType.js
maguon/ec_admin
c42f88965f153dae21fbaa9836d46cc376586d7b
[ "MIT" ]
null
null
null
src/types/main/CollectionRefundDetailActionType.js
maguon/ec_admin
c42f88965f153dae21fbaa9836d46cc376586d7b
[ "MIT" ]
null
null
null
src/types/main/CollectionRefundDetailActionType.js
maguon/ec_admin
c42f88965f153dae21fbaa9836d46cc376586d7b
[ "MIT" ]
null
null
null
import {createAction} from 'redux-actions'; export const getPaymentInfo = createAction('GET_PAYMENT_INFO'); export const setPaymentInfo = createAction('SET_PAYMENT_INFO'); export const getOrderInfo = createAction('GET_ORDER_INFO'); export const getOrderServiceInfo = createAction('GET_ORDER_SERVICE_INFO'); export const getOrderProdInfo = createAction('GET_ORDER_PROD_INFO'); export const getCollectionRefundPayService = createAction('GET_COLLECTION_REFUND_PAY_SERVICE'); export const getCollectionRefundPayProd = createAction('GET_COLLECTION_REFUND_PAY_PROD');
56.3
95
0.843694
75a673e9140832df26d42ef41fa6533830f218c0
5,341
h
C
HT1632.h
KenWillmott/JY-MCU-PRO-3208-HT1632
04cc7a30d79f7370754302064178f69d736eb2f7
[ "Beerware" ]
null
null
null
HT1632.h
KenWillmott/JY-MCU-PRO-3208-HT1632
04cc7a30d79f7370754302064178f69d736eb2f7
[ "Beerware" ]
null
null
null
HT1632.h
KenWillmott/JY-MCU-PRO-3208-HT1632
04cc7a30d79f7370754302064178f69d736eb2f7
[ "Beerware" ]
null
null
null
/* HT1632.h - Library for communicating JY-MCU 3208 PRO This library provides higher-level access (including text drawing) for these modules. Modified to work only with the JY-MCU 3208 PRO 32x8 red LED matrix by Ken Willmott, February 17, 2016 Created by Gaurav Manek, April 8, 2011. Released into the public domain. */ // Hardware: // // JY-MCU PRO 3208 module: // // Note, this is for the PRO module. It is not tested on the earlier version. // // For this application, the onboard AVR on the display is disabled // by connecting a jumper from the <reset> pin on the display ICSP // connector to an adjacent ground (on the display power connector). // This enables a connection to the HT1632 display driver on the // same connector as follows: // // Arduino display // ------- ------- // GND GND // VCC VCC // "CS" MOSI // "WR" MISO // "DATA" SCK // // The CS, WR, and DATA pins can be assigned to any digital pins // or analog pins configured for digital I/O // on the Arduino. Example: CS=D7, WR=D8, DATA=D6 // #ifndef HT1632_h #define HT1632_h #include <Arduino.h> #ifdef __AVR__ #include <avr/pgmspace.h> #elif defined(ESP8266) #include <pgmspace.h> #else #define PROGMEM #endif //************************* // custom font for JY-MCU #include "cp437alt_font.h" #define BIGNUM_OFFSET (0xC0) /* * USER OPTIONS * Change these options */ #define COM_SIZE 8 #define OUT_SIZE 32 #define NUM_CHANNEL 1 #define USE_NMOS 1 /* * END USER OPTIONS * Don't edit anything below unless you know what you are doing! */ // Pixels in a single byte of the internal image representation: #define PIXELS_PER_BYTE 8 // Address space size (number of 4-bit words in HT1632 memory) // Exactly equal to the number of 4-bit address spaces available. #define ADDR_SPACE_SIZE (COM_SIZE * OUT_SIZE / PIXELS_PER_BYTE) // NO-OP Definition #define NOP(); __asm__("nop\n\t"); // The HT1632 requires at least 50 ns between the change in data and the rising // edge of the WR signal. On a 16MHz processor, this provides 62.5ns per NOP. // Standard command list. // This list is modified from original code by Bill Westfield #define HT1632_ID_CMD 0b100 /* ID = 100 - Commands */ #define HT1632_ID_RD 0b110 /* ID = 110 - Read RAM */ #define HT1632_ID_WR 0b101 /* ID = 101 - Write RAM */ #define HT1632_ID_LEN 3 /* IDs are 3 bits */ #define HT1632_CMD_SYSDIS 0x00 /* CMD= 0000-0000-x Turn off oscil */ #define HT1632_CMD_SYSEN 0x01 /* CMD= 0000-0001-x Enable system oscil */ #define HT1632_CMD_LEDOFF 0x02 /* CMD= 0000-0010-x LED duty cycle gen off */ #define HT1632_CMD_LEDON 0x03 /* CMD= 0000-0011-x LEDs ON */ #define HT1632_CMD_BLOFF 0x08 /* CMD= 0000-1000-x Blink ON */ #define HT1632_CMD_BLON 0x09 /* CMD= 0000-1001-x Blink Off */ #define HT1632_CMD_SLVMD 0x10 /* CMD= 0001-00xx-x Slave Mode */ #define HT1632_CMD_MSTMD 0x14 /* CMD= 0001-01xx-x Master Mode, on-chip clock */ #define HT1632_CMD_RCCLK 0x18 /* CMD= 0001-10xx-x Master Mode, external clock */ #define HT1632_CMD_EXTCLK 0x1C /* CMD= 0001-11xx-x Use external clock */ #define HT1632_CMD_COMS00 0x20 /* CMD= 0010-ABxx-x commons options */ #define HT1632_CMD_COMS01 0x24 /* CMD= 0010-ABxx-x commons options */ #define HT1632_CMD_COMS10 0x28 /* CMD= 0010-ABxx-x commons options */ #define HT1632_CMD_COMS11 0x2C /* CMD= 0010-ABxx-x commons options */ #define HT1632_CMD_PWM_T 0xA0 /* CMD= 101x-PPPP-x PWM duty cycle - template*/ #define HT1632_CMD_PWM(lvl) (HT1632_CMD_PWM_T | (lvl-1)) /* Produces the correct command from the given value of lvl. lvl = [0..15] */ #define HT1632_CMD_LEN 8 /* Commands are 8 bits long, excluding the trailing bit */ #define HT1632_ADDR_LEN 7 /* Addresses are 7 bits long */ #define HT1632_WORD_LEN 4 /* Words are 4 bits long */ class HT1632Class { private: uint8_t _pinCS [4]; uint8_t _numActivePins; uint8_t _pinWR; uint8_t _pinDATA; uint8_t _pinCLK; uint8_t _currSelectionMask; uint8_t _tgtRender; uint8_t _tgtChannel; byte * mem [5]; void writeCommand(char); void writeData(byte, uint8_t); void writeDataRev(byte, uint8_t); void writeSingleBit(); void initialize(uint8_t, uint8_t); void select(); void select(uint8_t mask); inline void pulseCLK(); void setCLK(uint8_t pinCLK); void sendCommand(uint8_t command); void renderTarget(uint8_t targetScreen); public: void begin(uint8_t pinCS1, uint8_t pinWR, uint8_t pinDATA); void render(); void clear(); void fill(); void setBrightness(char brightness, char selectionmask = 0b00010000); // modified for JY-MCU // lower level support: void setPixel(uint8_t x, uint8_t y); void clearPixel(uint8_t x, uint8_t y); // backwards compatibility: void drawImage(const byte img [], uint8_t width, uint8_t height, int8_t x, int8_t y, int offset = 0); // added for JY-MCU void writePixel(uint8_t x, uint8_t y, uint8_t val); void writeChar(byte pos, byte val, byte cols); void printChar(byte pos, byte val); void printDigit(byte pos, byte val); void printString(const char* str); void printNum(long val, byte base, bool leading); void setDisplayColumn(byte pos, byte val); }; // end class prototypes #else //#error "HT1632.h" already defined! #endif
31.233918
105
0.697622
8562b18fed111962c25c296ba34c97231a83f670
1,437
js
JavaScript
src/Containers/Detail/DetailMainContainer.js
keemtj/airdnd-frontend
a67844d6a7c4de0ca67d9c03134bb2b4ea14792f
[ "MIT" ]
null
null
null
src/Containers/Detail/DetailMainContainer.js
keemtj/airdnd-frontend
a67844d6a7c4de0ca67d9c03134bb2b4ea14792f
[ "MIT" ]
null
null
null
src/Containers/Detail/DetailMainContainer.js
keemtj/airdnd-frontend
a67844d6a7c4de0ca67d9c03134bb2b4ea14792f
[ "MIT" ]
null
null
null
import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { useSelector, useDispatch } from 'react-redux'; import { throttle } from 'lodash'; import Subject from '../../Components/Detail/Subject'; import HomeInfos from '../../Components/Detail/HomeInfos'; import FullsizeWrapper from '../../Components/Detail/FullsizeWrapper'; import { getHome, onResize } from '../../Modules/home'; const DetailMainContainer = () => { const { isLoading, home, error } = useSelector(state => state.home.homeState); const { isScreenMedium } = useSelector(state => state.home.screenState); const dispatch = useDispatch(); const { id } = useParams(); console.log('params', id); const resize = () => dispatch(onResize()); useEffect(() => { if (home) return; dispatch(getHome(id)); window.addEventListener('resize', throttle(resize, 300)); return () => { window.removeEventListener('resize', resize); }; }, [dispatch]); if (error) return ( <div style={{ padding: '30px 30px 300px' }}> 에러 발생! 잘못된 요청입니다. </div> ); return ( <> <Subject isLoading={isLoading || !home} home={home} /> <HomeInfos isLoading={isLoading || !home} home={home} isScreenMedium={isScreenMedium} /> {!isLoading && home && <FullsizeWrapper home={home} />} </> ); }; export default React.memo(DetailMainContainer);
28.74
80
0.627697
475919c4608f27aab075f8ebf41b8322c0141843
4,213
swift
Swift
PKAR_Sample/HomeViewController.swift
Pradeepkn/ARKitSample
a521e4822b8b8515a61231a351fcb7208ca00f8a
[ "MIT" ]
null
null
null
PKAR_Sample/HomeViewController.swift
Pradeepkn/ARKitSample
a521e4822b8b8515a61231a351fcb7208ca00f8a
[ "MIT" ]
null
null
null
PKAR_Sample/HomeViewController.swift
Pradeepkn/ARKitSample
a521e4822b8b8515a61231a351fcb7208ca00f8a
[ "MIT" ]
null
null
null
// // HomeViewController.swift // PKAR_Sample // // Created by Pradeep on 2/13/19. // Copyright © 2019 Tarento Technologies Pvt Ltd. All rights reserved. // import UIKit import Lottie class HomeViewController: BaseViewController { @IBOutlet weak var homeContainerView: UIView! @IBOutlet weak var centerView: UIView! @IBOutlet weak var actionButton: UIButton! @IBOutlet weak var subContainerView: UIView! typealias ResponseCallback = (UIView, Bool) -> () override func viewDidLoad() { super.viewDidLoad() self.actionButton.isHidden = true DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(300)) { self.loadAnimation() } } func loadAnimation() { self.centerView.isHidden = true self.actionButton.isHidden = true var frame = CGRect(x: 0, y: 0, width: Int(self.view.bounds.size.width), height: Int(self.view.bounds.size.height)) self.animate(onView: self.homeContainerView, frame:frame ,animationFile: "summer") { (animatedView: UIView, isFinished : Bool) in animatedView.removeFromSuperview() frame = CGRect(x: 0, y: 0, width: Int(self.view.bounds.size.width), height: Int(self.view.bounds.size.width)) self.animate(onView: self.homeContainerView, frame:frame ,animationFile: "fabulous-onboarding-animation") { (animatedView: UIView, isFinished : Bool) in animatedView.removeFromSuperview() frame = self.homeContainerView.bounds self.centerView.isHidden = false self.actionButton.isHidden = false self.animateProgressive(onView: self.homeContainerView, frame:frame , from: 0.0, to: 0.75, animationFile: "floral-loading-animation") { (animatedView: UIView, isFinished : Bool) in animatedView.removeFromSuperview() self.animate(onView: self.homeContainerView, frame:frame ,animationFile: "dice-animation") { (animatedView: UIView, isFinished : Bool) in } } } } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.isNavigationBarHidden = true } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } func animate(onView:UIView, frame:CGRect, animationFile : String, onCompletion : @escaping ResponseCallback) { let animationView = LOTAnimationView(name: animationFile) animationView.bounds = frame//CGRect(x: Int(onView.bounds.origin.x), y: Int(onView.bounds.origin.y), width: Int(onView.bounds.size.width), height: Int(onView.bounds.size.width)) animationView.center = onView.center animationView.backgroundColor = UIColor.clear self.homeContainerView.addSubview(animationView) animationView.play{ (finished) in onCompletion(animationView, true) } } func animateProgressive(onView:UIView, frame:CGRect, from: CGFloat, to:CGFloat, animationFile : String, onCompletion : @escaping ResponseCallback) { let animationView = LOTAnimationView(name: animationFile) animationView.bounds = frame//CGRect(x: Int(onView.bounds.origin.x), y: Int(onView.bounds.origin.y), width: Int(onView.bounds.size.width), height: Int(onView.bounds.size.width)) animationView.center = onView.center animationView.backgroundColor = UIColor.clear self.homeContainerView.addSubview(animationView) animationView.play(fromProgress: from, toProgress: to) { (finished) in onCompletion(animationView, true) } } @IBAction func tapHereClicked(_ sender: Any) { self.performSegue(withIdentifier: "ARSegueIdentifier", sender: self) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
44.347368
196
0.671018
685f3cc6e600990697bffff182cdad5113003e35
1,029
swift
Swift
Sources/RouterCore/DSL/RouteProvider.swift
ShezHsky/Router
542effc66b60a84fc09f85f06df57eb382f1cb10
[ "MIT" ]
null
null
null
Sources/RouterCore/DSL/RouteProvider.swift
ShezHsky/Router
542effc66b60a84fc09f85f06df57eb382f1cb10
[ "MIT" ]
null
null
null
Sources/RouterCore/DSL/RouteProvider.swift
ShezHsky/Router
542effc66b60a84fc09f85f06df57eb382f1cb10
[ "MIT" ]
null
null
null
/// A type that acts as the source of one or more `Route`s. /// /// The `RouteProvider` is the backbone of the routing DSL. The `Routes` it provides may itself contain further /// providers, forming a complex routing graph out of simple building blocks. public protocol RouteProvider { /// A collection of one or more `Route`s. /// /// Implementations of this protocol should return a collection of `Routes` that support the formation of the DSL /// in a developer-friendly manner. The Router package supports a few out the box, including: /// /// - Any `RouteableDispatching` provides itself as a collection-of-one, allowing mixing top level routes with /// collections in the DSL. /// - The `Routes` collection type returns itself as the instance, allowing a subdomain of routes to be defined. /// /// - Note: /// The provided `Route`s should be stateless, as they may be generated multiple times during the lifetime of your /// app. var routes: Routes { get } }
46.772727
118
0.692906
27155a93242294db02645475d40bed5aacd8f97f
42
css
CSS
overMij/index.css
LeoTak/CSG2021
6b627541c10ba13c39ee37f5e103353df89cfed2
[ "MIT" ]
null
null
null
overMij/index.css
LeoTak/CSG2021
6b627541c10ba13c39ee37f5e103353df89cfed2
[ "MIT" ]
null
null
null
overMij/index.css
LeoTak/CSG2021
6b627541c10ba13c39ee37f5e103353df89cfed2
[ "MIT" ]
null
null
null
Body { background-color:lightslategrey }
14
33
0.785714
cb4bd6cf44fe78afced502ddfa1b6c45ad7c6cfb
314
go
Go
model/compose-file.go
compose-generator/dcu
e1fc65b473521e051d29607ded4bafbea375f97f
[ "Apache-2.0" ]
null
null
null
model/compose-file.go
compose-generator/dcu
e1fc65b473521e051d29607ded4bafbea375f97f
[ "Apache-2.0" ]
1
2021-04-28T15:51:02.000Z
2021-04-28T15:51:02.000Z
model/compose-file.go
compose-generator/dcu
e1fc65b473521e051d29607ded4bafbea375f97f
[ "Apache-2.0" ]
null
null
null
package model // ComposeFile represents the YAML structure of docker compose file type ComposeFile struct { Version string Services map[string]Service Networks map[string]NetworkConfigurationReference `yaml:"networks,omitempty"` Volumes map[string]VolumeConfigurationReference `yaml:"volumes,omitempty"` }
31.4
78
0.818471
592b4671967cb86e809976ae3c4c9eb03d8a4c38
1,079
swift
Swift
example/ios/exampleTests/Mock/UsercentricsOptions+Mock.swift
Usercentrics/react-native-sdk
8d668903a31e428212aa0ec2b8b5a5c84ab6fb51
[ "Apache-2.0" ]
2
2022-01-24T04:42:59.000Z
2022-02-20T11:37:37.000Z
example/ios/exampleTests/Mock/UsercentricsOptions+Mock.swift
Usercentrics/react-native-sdk
8d668903a31e428212aa0ec2b8b5a5c84ab6fb51
[ "Apache-2.0" ]
17
2021-11-03T08:27:10.000Z
2022-02-23T16:55:41.000Z
example/ios/exampleTests/Mock/UsercentricsOptions+Mock.swift
Usercentrics/react-native-sdk
8d668903a31e428212aa0ec2b8b5a5c84ab6fb51
[ "Apache-2.0" ]
null
null
null
import Foundation import Usercentrics extension UsercentricsOptions { static func mock(loggerLevel: UsercentricsLoggerLevel = .warning, settingsId: String = "AAAAA", ruleSetId: String = "BBBBB", defaultLanguage: String = "PT", version: String = "1.2.3", timeoutMillis: Int64 = 1000) -> UsercentricsOptions { return UsercentricsOptions(settingsId: settingsId, defaultLanguage: defaultLanguage, version: version, timeoutMillis: timeoutMillis, loggerLevel: loggerLevel, ruleSetId: ruleSetId) } static func asDict(mockObject: UsercentricsOptions? = nil) -> NSDictionary { let expectedOptions = (mockObject == nil ? self.mock() : mockObject)! return [ "settingsId": expectedOptions.settingsId, "ruleSetId": expectedOptions.ruleSetId, "loggerLevel": expectedOptions.loggerLevel.ordinal, "timeoutMillis": expectedOptions.timeoutMillis, "version": expectedOptions.version, "defaultLanguage": expectedOptions.defaultLanguage ] } }
41.5
184
0.681186
5df54cf3387dfe15116765d709890ef3e21fea40
71
h
C
manual/unicoc/src-groups/script/dist/is_canadian_aboriginal_unicoc.h
Tikubonn/unico
c76de5309f8a3a6fda3110e463b7e9718ea530e3
[ "MIT" ]
null
null
null
manual/unicoc/src-groups/script/dist/is_canadian_aboriginal_unicoc.h
Tikubonn/unico
c76de5309f8a3a6fda3110e463b7e9718ea530e3
[ "MIT" ]
null
null
null
manual/unicoc/src-groups/script/dist/is_canadian_aboriginal_unicoc.h
Tikubonn/unico
c76de5309f8a3a6fda3110e463b7e9718ea530e3
[ "MIT" ]
null
null
null
#include <unico.h> extern int is_canadian_aboriginal_unicoc (unicoc*);
23.666667
51
0.802817
711a4f623c891f170f328bdefc484601aa16dc30
6,726
ts
TypeScript
src/core/decks/deck/deck.aggregate-root.spec.ts
Miczeq22/brainflash-api
612e5478169bc121e2ac7251630ea0f2a00cfff2
[ "BSD-3-Clause" ]
13
2020-09-24T12:39:20.000Z
2020-10-08T13:14:29.000Z
src/core/decks/deck/deck.aggregate-root.spec.ts
Miczeq22/brainflash-api
612e5478169bc121e2ac7251630ea0f2a00cfff2
[ "BSD-3-Clause" ]
null
null
null
src/core/decks/deck/deck.aggregate-root.spec.ts
Miczeq22/brainflash-api
612e5478169bc121e2ac7251630ea0f2a00cfff2
[ "BSD-3-Clause" ]
2
2020-10-02T15:07:42.000Z
2020-11-18T04:03:05.000Z
import { createMockProxy } from '@tools/mock-proxy'; import { UniqueDeckChecker } from './rules/user-deck-should-have-unique-name.rule'; import { Deck } from './deck.aggregate-root'; import { UniqueEntityID } from '@core/shared/unique-entity-id'; import { DeckCreatedDomainEvent } from './events/deck-created.domain-event'; import { DeckTagsUpdatedDomainEvent } from './events/deck-tags-updated.domain-event'; import { Card } from '../card/card.entity'; import { NewCardAddedDomainEvent } from './events/new-card-added.domain-event'; import { CardRemovedFromDeckDomainEvent } from './events/card-removed-from-deck.domain-event'; import { createDeckMock } from '@tests/deck.mock'; describe('[Domain] Deck', () => { const uniqueDeckChecker = createMockProxy<UniqueDeckChecker>(); beforeEach(() => { uniqueDeckChecker.mockClear(); }); test('should throw an error if deck for user is not unique', async () => { uniqueDeckChecker.isUnique.mockResolvedValue(false); await expect(() => Deck.createNew( { name: '#name', description: '#description', ownerId: new UniqueEntityID(), tags: [], }, uniqueDeckChecker, ), ).rejects.toThrowError('You\'ve already created deck with name: "#name".'); }); test('should throw an error if tags are empty', async () => { uniqueDeckChecker.isUnique.mockResolvedValue(true); await expect(() => Deck.createNew( { name: '#name', description: '#description', ownerId: new UniqueEntityID(), tags: [], }, uniqueDeckChecker, ), ).rejects.toThrowError('Tags for deck cannot be empty.'); }); test('should create deck and add proper domain event', async () => { uniqueDeckChecker.isUnique.mockResolvedValue(true); const deck = await Deck.createNew( { name: '#name', description: '#description', ownerId: new UniqueEntityID(), tags: ['#tag'], }, uniqueDeckChecker, ); expect(deck.getDomainEvents()[0] instanceof DeckCreatedDomainEvent).toBeTruthy(); }); test('should throw an error if deck is not unique', async () => { uniqueDeckChecker.isUnique.mockResolvedValue(false); const deck = createDeckMock(); await expect(() => deck.updateName('#new-name', uniqueDeckChecker)).rejects.toThrowError( 'You\'ve already created deck with name: "#new-name".', ); }); test('should update deck name', async () => { uniqueDeckChecker.isUnique.mockResolvedValue(true); const deck = createDeckMock(); await deck.updateName('#new-name', uniqueDeckChecker); expect(deck.getName()).toEqual('#new-name'); }); test('should throw an error if tags are empty on update', async () => { const deck = createDeckMock(); expect(() => deck.updateTags([])).toThrowError('Tags for deck cannot be empty.'); }); test('should update deck tags and add proper domain event', async () => { const deck = createDeckMock(); deck.updateTags(['#new-tag']); expect(deck.getTags()).toEqual(['#new-tag']); expect(deck.getDomainEvents()[0] instanceof DeckTagsUpdatedDomainEvent).toBeTruthy(); }); test('should throw an error if card is already added', async () => { const deck = createDeckMock({ cards: [ Card.instanceExisting( { answer: '#answer', question: '#question', }, new UniqueEntityID(), ), ], }); expect(() => deck.addCard( Card.instanceExisting( { answer: '#answer', question: '#question', }, new UniqueEntityID(), ), ), ).toThrowError('You\'ve already added card with question: "#question".'); }); test('should add card to deck and proper domain event', async () => { const deck = createDeckMock({ cards: [ Card.instanceExisting( { answer: '#answer', question: '#question', }, new UniqueEntityID(), ), ], }); deck.addCard( Card.instanceExisting( { answer: '#answer', question: '#another-question', }, new UniqueEntityID(), ), ); expect(deck.getDomainEvents()[0] instanceof NewCardAddedDomainEvent).toBeTruthy(); }); test('should throw an error if card does not exist in deck', async () => { const deck = createDeckMock(); expect(() => deck.removeCard(new UniqueEntityID())).toThrowError( 'Card does not exist in deck.', ); }); test('should remove card from deck and add proper domain event', async () => { const card = Card.instanceExisting( { answer: '#answer', question: '#question', }, new UniqueEntityID(), ); const deck = createDeckMock({ cards: [card], }); deck.removeCard(card.getId()); expect(deck.getDomainEvents()[0] instanceof CardRemovedFromDeckDomainEvent).toBeTruthy(); }); test('should throw an error if deck is already deleted', async () => { const deck = createDeckMock({ deleted: true, }); expect(() => deck.delete()).toThrowError('Deck is already deleted.'); }); test('should delete deck', async () => { const deck = createDeckMock(); deck.delete(); expect(deck.isDeleted()).toBeTruthy(); }); test('should throw an error if deck is already published', async () => { const deck = createDeckMock({ published: true, }); expect(() => deck.publish()).toThrowError('Deck is already published.'); }); test('should throw an error if deck is deleted on publish', async () => { const deck = createDeckMock({ deleted: true, }); expect(() => deck.publish()).toThrowError('Deck is already deleted.'); }); test('should publish deck', async () => { const deck = createDeckMock(); deck.publish(); expect(deck.isPublished()).toBeTruthy(); }); test('should throw an error if deck is not published', async () => { const deck = createDeckMock({ published: false, }); expect(() => deck.unpublish()).toThrowError('Cannot unpublish deck. Deck is not published.'); }); test('should throw an error if deck is deleted on publish', async () => { const deck = createDeckMock({ deleted: true, published: true, }); expect(() => deck.unpublish()).toThrowError('Deck is already deleted.'); }); test('should unpublish deck', async () => { const deck = createDeckMock({ published: true, }); deck.unpublish(); expect(deck.isPublished()).toBeFalsy(); }); });
27.341463
97
0.601844
fa26f506b712ab3268f9610212914ec13159c1bd
8,780
lua
Lua
game/scripts/vscripts/items/item_sphere.lua
kulakaa073/SpellLibrary
6ae510089a7515adf0582d06a444f027f95af040
[ "CC-BY-2.0" ]
2
2015-10-23T16:26:22.000Z
2019-11-03T08:33:56.000Z
game/scripts/vscripts/items/item_sphere.lua
kulakaa073/SpellLibrary
6ae510089a7515adf0582d06a444f027f95af040
[ "CC-BY-2.0" ]
null
null
null
game/scripts/vscripts/items/item_sphere.lua
kulakaa073/SpellLibrary
6ae510089a7515adf0582d06a444f027f95af040
[ "CC-BY-2.0" ]
3
2015-10-27T13:30:45.000Z
2020-04-01T11:09:53.000Z
--[[ ============================================================================================================ Author: Rook Date: January 30, 2015 This function should be called from targeted datadriven abilities that can be blocked by Linken's Sphere. Checks to see if the inputted unit has modifier_item_sphere_target on them. If they do, the sphere is popped, the animation and sound plays, and true is returned. If they do not, false is returned. ================================================================================================================= ]] function is_spell_blocked_by_linkens_sphere(target) if target:HasModifier("modifier_item_sphere_target") then target:RemoveModifierByName("modifier_item_sphere_target") --The particle effect is played automatically when this modifier is removed (but the sound isn't). target:EmitSound("DOTA_Item.LinkensSphere.Activate") return true end return false end --[[ ============================================================================================================ Author: Rook Date: January 30, 2015 Called when Linken's Sphere is cast. Places a modifier_item_sphere_target on the targeted unit. Additional parameters: Keys.Duration ================================================================================================================= ]] function item_sphere_datadriven_on_spell_start(keys) if keys.caster ~= keys.target then --Place the modifier on the target, but only if they don't already have a modifier_item_sphere_target (a maximum of --one of these modifiers is currently supported). if not keys.target:HasModifier("modifier_item_sphere_target") then keys.target:AddNewModifier(keys.caster, keys.ability, "modifier_item_sphere_target", {duration = keys.Duration}) keys.ability:ApplyDataDrivenModifier(keys.caster, keys.target, "modifier_item_sphere_datadriven_icon", {duration = -1}) end keys.target:EmitSound("DOTA_Item.LinkensSphere.Target") --Remove the passively applied modifier from the caster while their Linken's Spheres are on cooldown. The caster should --have at most one modifier_item_sphere_target on themselves. keys.caster:RemoveModifierByName("modifier_item_sphere_target") keys.caster.current_spellblock_is_passive = nil else --If the player self-casted Linken's, which is currently disallowed for technical reasons. keys.ability:RefundManaCost() keys.ability:EndCooldown() EmitSoundOnClient("General.CastFail_InvalidTarget_Hero", keys.caster:GetPlayerOwner()) --This makes use of the Custom Error Flash module by zedor. https://github.com/zedor/CustomError FireGameEvent('custom_error_show', {player_ID = keys.caster:GetPlayerID(), _error = "Ability Can't Target Self"}) end end --[[ ============================================================================================================ Author: Rook Date: January 30, 2015 Called when Linken's Sphere is picked up. Makes sure the caster has a passive modifier_item_sphere_target if the item is off cooldown. ================================================================================================================= ]] function modifier_item_sphere_datadriven_on_created(keys) if keys.ability ~= nil and keys.ability:IsCooldownReady() then if keys.caster:HasModifier("modifier_item_sphere_target") then --Remove any potentially temporary version of the modifier and replace it with an indefinite one. keys.caster:RemoveModifierByName("modifier_item_sphere_target") end keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_item_sphere_target", {duration = -1}) keys.ability:ApplyDataDrivenModifier(keys.caster, keys.target, "modifier_item_sphere_datadriven_icon", {duration = -1}) keys.caster.current_spellblock_is_passive = true end end --[[ ============================================================================================================ Author: Rook Date: January 30, 2015 Called when Linken's Sphere is dropped, sold, etc. Goes through the caster's inventory and determines whether they should still have a modifier_item_sphere_target. ================================================================================================================= ]] function modifier_item_sphere_datadriven_on_destroy(keys) local num_off_cooldown_linkens_spheres_in_inventory = 0 for i=0, 5, 1 do --Search for off-cooldown Linken's Spheres in the player's inventory. local current_item = keys.caster:GetItemInSlot(i) if current_item ~= nil then if current_item:GetName() == "item_sphere_datadriven" and current_item:IsCooldownReady() then num_off_cooldown_linkens_spheres_in_inventory = num_off_cooldown_linkens_spheres_in_inventory + 1 end end end --If the player just got rid of their last Linken's Sphere, which was providing the passive spellblock. if num_off_cooldown_linkens_spheres_in_inventory == 0 and keys.caster.current_spellblock_is_passive == true then keys.caster:RemoveModifierByName("modifier_item_sphere_target") keys.caster.current_spellblock_is_passive = nil end end --[[ ============================================================================================================ Author: Rook Date: January 30, 2015 Called regularly while at least one Linken's Sphere is in the player's inventory. Tries to determine if the modifier_item_sphere_target modifier on the hero has been expended, and sets the Linken's Spheres in the player's inventory on cooldown if one has been. ================================================================================================================= ]] function modifier_item_sphere_datadriven_on_interval_think(keys) local num_off_cooldown_linkens_spheres_in_inventory = 0 for i=0, 5, 1 do --Search for off-cooldown Linken's Spheres in the player's inventory. local current_item = keys.caster:GetItemInSlot(i) if current_item ~= nil then if current_item:GetName() == "item_sphere_datadriven" and current_item:IsCooldownReady() then num_off_cooldown_linkens_spheres_in_inventory = num_off_cooldown_linkens_spheres_in_inventory + 1 end end end if num_off_cooldown_linkens_spheres_in_inventory > 0 and not keys.caster:HasModifier("modifier_item_sphere_target") then if keys.caster.current_spellblock_is_passive == nil then --If the Linken's Sphere just came off cooldown. keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_item_sphere_target", {duration = -1}) keys.ability:ApplyDataDrivenModifier(keys.caster, keys.target, "modifier_item_sphere_datadriven_icon", {duration = -1}) keys.caster.current_spellblock_is_passive = true else --keys.caster.current_spellblock_is_passive == true. --The Linken's was presumably popped passively. Note that modifier_item_sphere_target is non-dispellable. keys.caster.current_spellblock_is_passive = nil for i=0, 5, 1 do --Put all Linken's Spheres in the player's inventory on cooldown. local current_item = keys.caster:GetItemInSlot(i) if current_item ~= nil then if current_item:GetName() == "item_sphere_datadriven" then current_item:StartCooldown(current_item:GetCooldown(current_item:GetLevel())) end end end num_off_cooldown_linkens_spheres_in_inventory = 0 end end --The passive modifier from a Linken's supersedes the active one due to its indefinite duration, so remove any modifiers that --were transferred to this hero from an ally with a Linken's, now that an off-cooldown Linken's Sphere is in the player's inventory. if num_off_cooldown_linkens_spheres_in_inventory > 0 then keys.caster.current_spellblock_is_passive = true local caster_team = keys.caster:GetTeam() for i=0, 9, 1 do local hero = HeroList:GetHero(i) if hero ~= nil and hero ~= keys.caster and hero:GetTeam() ~= caster_team then keys.caster:RemoveModifierByNameAndCaster("modifier_item_sphere_target", hero) end end else --num_off_cooldown_linkens_spheres_in_inventory == 0 keys.caster.current_spellblock_is_passive = nil end end --[[ ============================================================================================================ Author: Rook Date: January 30, 2015 This public-facing modifier is placed on units when they receive the modifier_item_sphere_target modifier. Here, it regularly checks to see if the unit it's on still has modifier_item_sphere_target; if not, it removes itself. ================================================================================================================= ]] function modifier_item_sphere_datadriven_icon_on_interval_think(keys) if not keys.target:HasModifier("modifier_item_sphere_target") then keys.target:RemoveModifierByName("modifier_item_sphere_datadriven_icon") end end
55.923567
163
0.672437
581f958b15ef01cefd4cab95187d4f96d894e663
56,970
asm
Assembly
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/twiddle/twid2048.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/twiddle/twid2048.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/twiddle/twid2048.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
;*********************************************************** ; Version 2.30.00 ;*********************************************************** .def twiddle .sect ".data:twiddle" twiddle: .word 32767 ;[ 0 ] .word 0 ;[ 0 ] .word -1 ;[ 512 ] .word 32766 ;[ 512 ] .word 23169 ;[ 256 ] .word 23169 ;[ 256 ] .word -23170 ;[ 768 ] .word 23169 ;[ 768 ] .word 30272 ;[ 128 ] .word 12539 ;[ 128 ] .word -12540 ;[ 640 ] .word 30272 ;[ 640 ] .word 12539 ;[ 384 ] .word 30272 ;[ 384 ] .word -30273 ;[ 896 ] .word 12539 ;[ 896 ] .word 32137 ;[ 64 ] .word 6392 ;[ 64 ] .word -6393 ;[ 576 ] .word 32137 ;[ 576 ] .word 18204 ;[ 320 ] .word 27244 ;[ 320 ] .word -27245 ;[ 832 ] .word 18204 ;[ 832 ] .word 27244 ;[ 192 ] .word 18204 ;[ 192 ] .word -18205 ;[ 704 ] .word 27244 ;[ 704 ] .word 6392 ;[ 448 ] .word 32137 ;[ 448 ] .word -32138 ;[ 960 ] .word 6392 ;[ 960 ] .word 32609 ;[ 32 ] .word 3211 ;[ 32 ] .word -3212 ;[ 544 ] .word 32609 ;[ 544 ] .word 20787 ;[ 288 ] .word 25329 ;[ 288 ] .word -25330 ;[ 800 ] .word 20787 ;[ 800 ] .word 28897 ;[ 160 ] .word 15446 ;[ 160 ] .word -15447 ;[ 672 ] .word 28897 ;[ 672 ] .word 9511 ;[ 416 ] .word 31356 ;[ 416 ] .word -31357 ;[ 928 ] .word 9511 ;[ 928 ] .word 31356 ;[ 96 ] .word 9511 ;[ 96 ] .word -9512 ;[ 608 ] .word 31356 ;[ 608 ] .word 15446 ;[ 352 ] .word 28897 ;[ 352 ] .word -28898 ;[ 864 ] .word 15446 ;[ 864 ] .word 25329 ;[ 224 ] .word 20787 ;[ 224 ] .word -20788 ;[ 736 ] .word 25329 ;[ 736 ] .word 3211 ;[ 480 ] .word 32609 ;[ 480 ] .word -32610 ;[ 992 ] .word 3211 ;[ 992 ] .word 32727 ;[ 16 ] .word 1607 ;[ 16 ] .word -1608 ;[ 528 ] .word 32727 ;[ 528 ] .word 22004 ;[ 272 ] .word 24278 ;[ 272 ] .word -24279 ;[ 784 ] .word 22004 ;[ 784 ] .word 29621 ;[ 144 ] .word 14009 ;[ 144 ] .word -14010 ;[ 656 ] .word 29621 ;[ 656 ] .word 11038 ;[ 400 ] .word 30851 ;[ 400 ] .word -30852 ;[ 912 ] .word 11038 ;[ 912 ] .word 31785 ;[ 80 ] .word 7961 ;[ 80 ] .word -7962 ;[ 592 ] .word 31785 ;[ 592 ] .word 16845 ;[ 336 ] .word 28105 ;[ 336 ] .word -28106 ;[ 848 ] .word 16845 ;[ 848 ] .word 26318 ;[ 208 ] .word 19519 ;[ 208 ] .word -19520 ;[ 720 ] .word 26318 ;[ 720 ] .word 4807 ;[ 464 ] .word 32412 ;[ 464 ] .word -32413 ;[ 976 ] .word 4807 ;[ 976 ] .word 32412 ;[ 48 ] .word 4807 ;[ 48 ] .word -4808 ;[ 560 ] .word 32412 ;[ 560 ] .word 19519 ;[ 304 ] .word 26318 ;[ 304 ] .word -26319 ;[ 816 ] .word 19519 ;[ 816 ] .word 28105 ;[ 176 ] .word 16845 ;[ 176 ] .word -16846 ;[ 688 ] .word 28105 ;[ 688 ] .word 7961 ;[ 432 ] .word 31785 ;[ 432 ] .word -31786 ;[ 944 ] .word 7961 ;[ 944 ] .word 30851 ;[ 112 ] .word 11038 ;[ 112 ] .word -11039 ;[ 624 ] .word 30851 ;[ 624 ] .word 14009 ;[ 368 ] .word 29621 ;[ 368 ] .word -29622 ;[ 880 ] .word 14009 ;[ 880 ] .word 24278 ;[ 240 ] .word 22004 ;[ 240 ] .word -22005 ;[ 752 ] .word 24278 ;[ 752 ] .word 1607 ;[ 496 ] .word 32727 ;[ 496 ] .word -32728 ;[ 1008 ] .word 1607 ;[ 1008 ] .word 32757 ;[ 8 ] .word 804 ;[ 8 ] .word -805 ;[ 520 ] .word 32757 ;[ 520 ] .word 22594 ;[ 264 ] .word 23731 ;[ 264 ] .word -23732 ;[ 776 ] .word 22594 ;[ 776 ] .word 29955 ;[ 136 ] .word 13278 ;[ 136 ] .word -13279 ;[ 648 ] .word 29955 ;[ 648 ] .word 11792 ;[ 392 ] .word 30571 ;[ 392 ] .word -30572 ;[ 904 ] .word 11792 ;[ 904 ] .word 31970 ;[ 72 ] .word 7179 ;[ 72 ] .word -7180 ;[ 584 ] .word 31970 ;[ 584 ] .word 17530 ;[ 328 ] .word 27683 ;[ 328 ] .word -27684 ;[ 840 ] .word 17530 ;[ 840 ] .word 26789 ;[ 200 ] .word 18867 ;[ 200 ] .word -18868 ;[ 712 ] .word 26789 ;[ 712 ] .word 5601 ;[ 456 ] .word 32284 ;[ 456 ] .word -32285 ;[ 968 ] .word 5601 ;[ 968 ] .word 32520 ;[ 40 ] .word 4011 ;[ 40 ] .word -4012 ;[ 552 ] .word 32520 ;[ 552 ] .word 20159 ;[ 296 ] .word 25831 ;[ 296 ] .word -25832 ;[ 808 ] .word 20159 ;[ 808 ] .word 28510 ;[ 168 ] .word 16150 ;[ 168 ] .word -16151 ;[ 680 ] .word 28510 ;[ 680 ] .word 8739 ;[ 424 ] .word 31580 ;[ 424 ] .word -31581 ;[ 936 ] .word 8739 ;[ 936 ] .word 31113 ;[ 104 ] .word 10278 ;[ 104 ] .word -10279 ;[ 616 ] .word 31113 ;[ 616 ] .word 14732 ;[ 360 ] .word 29268 ;[ 360 ] .word -29269 ;[ 872 ] .word 14732 ;[ 872 ] .word 24811 ;[ 232 ] .word 21402 ;[ 232 ] .word -21403 ;[ 744 ] .word 24811 ;[ 744 ] .word 2410 ;[ 488 ] .word 32678 ;[ 488 ] .word -32679 ;[ 1000 ] .word 2410 ;[ 1000 ] .word 32678 ;[ 24 ] .word 2410 ;[ 24 ] .word -2411 ;[ 536 ] .word 32678 ;[ 536 ] .word 21402 ;[ 280 ] .word 24811 ;[ 280 ] .word -24812 ;[ 792 ] .word 21402 ;[ 792 ] .word 29268 ;[ 152 ] .word 14732 ;[ 152 ] .word -14733 ;[ 664 ] .word 29268 ;[ 664 ] .word 10278 ;[ 408 ] .word 31113 ;[ 408 ] .word -31114 ;[ 920 ] .word 10278 ;[ 920 ] .word 31580 ;[ 88 ] .word 8739 ;[ 88 ] .word -8740 ;[ 600 ] .word 31580 ;[ 600 ] .word 16150 ;[ 344 ] .word 28510 ;[ 344 ] .word -28511 ;[ 856 ] .word 16150 ;[ 856 ] .word 25831 ;[ 216 ] .word 20159 ;[ 216 ] .word -20160 ;[ 728 ] .word 25831 ;[ 728 ] .word 4011 ;[ 472 ] .word 32520 ;[ 472 ] .word -32521 ;[ 984 ] .word 4011 ;[ 984 ] .word 32284 ;[ 56 ] .word 5601 ;[ 56 ] .word -5602 ;[ 568 ] .word 32284 ;[ 568 ] .word 18867 ;[ 312 ] .word 26789 ;[ 312 ] .word -26790 ;[ 824 ] .word 18867 ;[ 824 ] .word 27683 ;[ 184 ] .word 17530 ;[ 184 ] .word -17531 ;[ 696 ] .word 27683 ;[ 696 ] .word 7179 ;[ 440 ] .word 31970 ;[ 440 ] .word -31971 ;[ 952 ] .word 7179 ;[ 952 ] .word 30571 ;[ 120 ] .word 11792 ;[ 120 ] .word -11793 ;[ 632 ] .word 30571 ;[ 632 ] .word 13278 ;[ 376 ] .word 29955 ;[ 376 ] .word -29956 ;[ 888 ] .word 13278 ;[ 888 ] .word 23731 ;[ 248 ] .word 22594 ;[ 248 ] .word -22595 ;[ 760 ] .word 23731 ;[ 760 ] .word 804 ;[ 504 ] .word 32757 ;[ 504 ] .word -32758 ;[ 1016 ] .word 804 ;[ 1016 ] .word 32764 ;[ 4 ] .word 402 ;[ 4 ] .word -403 ;[ 516 ] .word 32764 ;[ 516 ] .word 22883 ;[ 260 ] .word 23452 ;[ 260 ] .word -23453 ;[ 772 ] .word 22883 ;[ 772 ] .word 30116 ;[ 132 ] .word 12909 ;[ 132 ] .word -12910 ;[ 644 ] .word 30116 ;[ 644 ] .word 12166 ;[ 388 ] .word 30424 ;[ 388 ] .word -30425 ;[ 900 ] .word 12166 ;[ 900 ] .word 32056 ;[ 68 ] .word 6786 ;[ 68 ] .word -6787 ;[ 580 ] .word 32056 ;[ 580 ] .word 17868 ;[ 324 ] .word 27466 ;[ 324 ] .word -27467 ;[ 836 ] .word 17868 ;[ 836 ] .word 27019 ;[ 196 ] .word 18537 ;[ 196 ] .word -18538 ;[ 708 ] .word 27019 ;[ 708 ] .word 5997 ;[ 452 ] .word 32213 ;[ 452 ] .word -32214 ;[ 964 ] .word 5997 ;[ 964 ] .word 32567 ;[ 36 ] .word 3611 ;[ 36 ] .word -3612 ;[ 548 ] .word 32567 ;[ 548 ] .word 20474 ;[ 292 ] .word 25582 ;[ 292 ] .word -25583 ;[ 804 ] .word 20474 ;[ 804 ] .word 28706 ;[ 164 ] .word 15799 ;[ 164 ] .word -15800 ;[ 676 ] .word 28706 ;[ 676 ] .word 9126 ;[ 420 ] .word 31470 ;[ 420 ] .word -31471 ;[ 932 ] .word 9126 ;[ 932 ] .word 31236 ;[ 100 ] .word 9895 ;[ 100 ] .word -9896 ;[ 612 ] .word 31236 ;[ 612 ] .word 15090 ;[ 356 ] .word 29085 ;[ 356 ] .word -29086 ;[ 868 ] .word 15090 ;[ 868 ] .word 25072 ;[ 228 ] .word 21096 ;[ 228 ] .word -21097 ;[ 740 ] .word 25072 ;[ 740 ] .word 2811 ;[ 484 ] .word 32646 ;[ 484 ] .word -32647 ;[ 996 ] .word 2811 ;[ 996 ] .word 32705 ;[ 20 ] .word 2009 ;[ 20 ] .word -2010 ;[ 532 ] .word 32705 ;[ 532 ] .word 21705 ;[ 276 ] .word 24546 ;[ 276 ] .word -24547 ;[ 788 ] .word 21705 ;[ 788 ] .word 29446 ;[ 148 ] .word 14372 ;[ 148 ] .word -14373 ;[ 660 ] .word 29446 ;[ 660 ] .word 10659 ;[ 404 ] .word 30984 ;[ 404 ] .word -30985 ;[ 916 ] .word 10659 ;[ 916 ] .word 31684 ;[ 84 ] .word 8351 ;[ 84 ] .word -8352 ;[ 596 ] .word 31684 ;[ 596 ] .word 16499 ;[ 340 ] .word 28309 ;[ 340 ] .word -28310 ;[ 852 ] .word 16499 ;[ 852 ] .word 26077 ;[ 212 ] .word 19840 ;[ 212 ] .word -19841 ;[ 724 ] .word 26077 ;[ 724 ] .word 4409 ;[ 468 ] .word 32468 ;[ 468 ] .word -32469 ;[ 980 ] .word 4409 ;[ 980 ] .word 32350 ;[ 52 ] .word 5205 ;[ 52 ] .word -5206 ;[ 564 ] .word 32350 ;[ 564 ] .word 19194 ;[ 308 ] .word 26556 ;[ 308 ] .word -26557 ;[ 820 ] .word 19194 ;[ 820 ] .word 27896 ;[ 180 ] .word 17189 ;[ 180 ] .word -17190 ;[ 692 ] .word 27896 ;[ 692 ] .word 7571 ;[ 436 ] .word 31880 ;[ 436 ] .word -31881 ;[ 948 ] .word 7571 ;[ 948 ] .word 30713 ;[ 116 ] .word 11416 ;[ 116 ] .word -11417 ;[ 628 ] .word 30713 ;[ 628 ] .word 13645 ;[ 372 ] .word 29790 ;[ 372 ] .word -29791 ;[ 884 ] .word 13645 ;[ 884 ] .word 24006 ;[ 244 ] .word 22301 ;[ 244 ] .word -22302 ;[ 756 ] .word 24006 ;[ 756 ] .word 1206 ;[ 500 ] .word 32744 ;[ 500 ] .word -32745 ;[ 1012 ] .word 1206 ;[ 1012 ] .word 32744 ;[ 12 ] .word 1206 ;[ 12 ] .word -1207 ;[ 524 ] .word 32744 ;[ 524 ] .word 22301 ;[ 268 ] .word 24006 ;[ 268 ] .word -24007 ;[ 780 ] .word 22301 ;[ 780 ] .word 29790 ;[ 140 ] .word 13645 ;[ 140 ] .word -13646 ;[ 652 ] .word 29790 ;[ 652 ] .word 11416 ;[ 396 ] .word 30713 ;[ 396 ] .word -30714 ;[ 908 ] .word 11416 ;[ 908 ] .word 31880 ;[ 76 ] .word 7571 ;[ 76 ] .word -7572 ;[ 588 ] .word 31880 ;[ 588 ] .word 17189 ;[ 332 ] .word 27896 ;[ 332 ] .word -27897 ;[ 844 ] .word 17189 ;[ 844 ] .word 26556 ;[ 204 ] .word 19194 ;[ 204 ] .word -19195 ;[ 716 ] .word 26556 ;[ 716 ] .word 5205 ;[ 460 ] .word 32350 ;[ 460 ] .word -32351 ;[ 972 ] .word 5205 ;[ 972 ] .word 32468 ;[ 44 ] .word 4409 ;[ 44 ] .word -4410 ;[ 556 ] .word 32468 ;[ 556 ] .word 19840 ;[ 300 ] .word 26077 ;[ 300 ] .word -26078 ;[ 812 ] .word 19840 ;[ 812 ] .word 28309 ;[ 172 ] .word 16499 ;[ 172 ] .word -16500 ;[ 684 ] .word 28309 ;[ 684 ] .word 8351 ;[ 428 ] .word 31684 ;[ 428 ] .word -31685 ;[ 940 ] .word 8351 ;[ 940 ] .word 30984 ;[ 108 ] .word 10659 ;[ 108 ] .word -10660 ;[ 620 ] .word 30984 ;[ 620 ] .word 14372 ;[ 364 ] .word 29446 ;[ 364 ] .word -29447 ;[ 876 ] .word 14372 ;[ 876 ] .word 24546 ;[ 236 ] .word 21705 ;[ 236 ] .word -21706 ;[ 748 ] .word 24546 ;[ 748 ] .word 2009 ;[ 492 ] .word 32705 ;[ 492 ] .word -32706 ;[ 1004 ] .word 2009 ;[ 1004 ] .word 32646 ;[ 28 ] .word 2811 ;[ 28 ] .word -2812 ;[ 540 ] .word 32646 ;[ 540 ] .word 21096 ;[ 284 ] .word 25072 ;[ 284 ] .word -25073 ;[ 796 ] .word 21096 ;[ 796 ] .word 29085 ;[ 156 ] .word 15090 ;[ 156 ] .word -15091 ;[ 668 ] .word 29085 ;[ 668 ] .word 9895 ;[ 412 ] .word 31236 ;[ 412 ] .word -31237 ;[ 924 ] .word 9895 ;[ 924 ] .word 31470 ;[ 92 ] .word 9126 ;[ 92 ] .word -9127 ;[ 604 ] .word 31470 ;[ 604 ] .word 15799 ;[ 348 ] .word 28706 ;[ 348 ] .word -28707 ;[ 860 ] .word 15799 ;[ 860 ] .word 25582 ;[ 220 ] .word 20474 ;[ 220 ] .word -20475 ;[ 732 ] .word 25582 ;[ 732 ] .word 3611 ;[ 476 ] .word 32567 ;[ 476 ] .word -32568 ;[ 988 ] .word 3611 ;[ 988 ] .word 32213 ;[ 60 ] .word 5997 ;[ 60 ] .word -5998 ;[ 572 ] .word 32213 ;[ 572 ] .word 18537 ;[ 316 ] .word 27019 ;[ 316 ] .word -27020 ;[ 828 ] .word 18537 ;[ 828 ] .word 27466 ;[ 188 ] .word 17868 ;[ 188 ] .word -17869 ;[ 700 ] .word 27466 ;[ 700 ] .word 6786 ;[ 444 ] .word 32056 ;[ 444 ] .word -32057 ;[ 956 ] .word 6786 ;[ 956 ] .word 30424 ;[ 124 ] .word 12166 ;[ 124 ] .word -12167 ;[ 636 ] .word 30424 ;[ 636 ] .word 12909 ;[ 380 ] .word 30116 ;[ 380 ] .word -30117 ;[ 892 ] .word 12909 ;[ 892 ] .word 23452 ;[ 252 ] .word 22883 ;[ 252 ] .word -22884 ;[ 764 ] .word 23452 ;[ 764 ] .word 402 ;[ 508 ] .word 32764 ;[ 508 ] .word -32765 ;[ 1020 ] .word 402 ;[ 1020 ] .word 32766 ;[ 2 ] .word 201 ;[ 2 ] .word -202 ;[ 514 ] .word 32766 ;[ 514 ] .word 23027 ;[ 258 ] .word 23311 ;[ 258 ] .word -23312 ;[ 770 ] .word 23027 ;[ 770 ] .word 30195 ;[ 130 ] .word 12724 ;[ 130 ] .word -12725 ;[ 642 ] .word 30195 ;[ 642 ] .word 12353 ;[ 386 ] .word 30349 ;[ 386 ] .word -30350 ;[ 898 ] .word 12353 ;[ 898 ] .word 32097 ;[ 66 ] .word 6589 ;[ 66 ] .word -6590 ;[ 578 ] .word 32097 ;[ 578 ] .word 18036 ;[ 322 ] .word 27355 ;[ 322 ] .word -27356 ;[ 834 ] .word 18036 ;[ 834 ] .word 27132 ;[ 194 ] .word 18371 ;[ 194 ] .word -18372 ;[ 706 ] .word 27132 ;[ 706 ] .word 6195 ;[ 450 ] .word 32176 ;[ 450 ] .word -32177 ;[ 962 ] .word 6195 ;[ 962 ] .word 32588 ;[ 34 ] .word 3411 ;[ 34 ] .word -3412 ;[ 546 ] .word 32588 ;[ 546 ] .word 20631 ;[ 290 ] .word 25456 ;[ 290 ] .word -25457 ;[ 802 ] .word 20631 ;[ 802 ] .word 28802 ;[ 162 ] .word 15623 ;[ 162 ] .word -15624 ;[ 674 ] .word 28802 ;[ 674 ] .word 9319 ;[ 418 ] .word 31413 ;[ 418 ] .word -31414 ;[ 930 ] .word 9319 ;[ 930 ] .word 31297 ;[ 98 ] .word 9703 ;[ 98 ] .word -9704 ;[ 610 ] .word 31297 ;[ 610 ] .word 15268 ;[ 354 ] .word 28992 ;[ 354 ] .word -28993 ;[ 866 ] .word 15268 ;[ 866 ] .word 25201 ;[ 226 ] .word 20942 ;[ 226 ] .word -20943 ;[ 738 ] .word 25201 ;[ 738 ] .word 3011 ;[ 482 ] .word 32628 ;[ 482 ] .word -32629 ;[ 994 ] .word 3011 ;[ 994 ] .word 32717 ;[ 18 ] .word 1808 ;[ 18 ] .word -1809 ;[ 530 ] .word 32717 ;[ 530 ] .word 21855 ;[ 274 ] .word 24413 ;[ 274 ] .word -24414 ;[ 786 ] .word 21855 ;[ 786 ] .word 29534 ;[ 146 ] .word 14191 ;[ 146 ] .word -14192 ;[ 658 ] .word 29534 ;[ 658 ] .word 10849 ;[ 402 ] .word 30918 ;[ 402 ] .word -30919 ;[ 914 ] .word 10849 ;[ 914 ] .word 31735 ;[ 82 ] .word 8156 ;[ 82 ] .word -8157 ;[ 594 ] .word 31735 ;[ 594 ] .word 16672 ;[ 338 ] .word 28208 ;[ 338 ] .word -28209 ;[ 850 ] .word 16672 ;[ 850 ] .word 26198 ;[ 210 ] .word 19680 ;[ 210 ] .word -19681 ;[ 722 ] .word 26198 ;[ 722 ] .word 4608 ;[ 466 ] .word 32441 ;[ 466 ] .word -32442 ;[ 978 ] .word 4608 ;[ 978 ] .word 32382 ;[ 50 ] .word 5006 ;[ 50 ] .word -5007 ;[ 562 ] .word 32382 ;[ 562 ] .word 19357 ;[ 306 ] .word 26437 ;[ 306 ] .word -26438 ;[ 818 ] .word 19357 ;[ 818 ] .word 28001 ;[ 178 ] .word 17017 ;[ 178 ] .word -17018 ;[ 690 ] .word 28001 ;[ 690 ] .word 7766 ;[ 434 ] .word 31833 ;[ 434 ] .word -31834 ;[ 946 ] .word 7766 ;[ 946 ] .word 30783 ;[ 114 ] .word 11227 ;[ 114 ] .word -11228 ;[ 626 ] .word 30783 ;[ 626 ] .word 13827 ;[ 370 ] .word 29706 ;[ 370 ] .word -29707 ;[ 882 ] .word 13827 ;[ 882 ] .word 24143 ;[ 242 ] .word 22153 ;[ 242 ] .word -22154 ;[ 754 ] .word 24143 ;[ 754 ] .word 1406 ;[ 498 ] .word 32736 ;[ 498 ] .word -32737 ;[ 1010 ] .word 1406 ;[ 1010 ] .word 32751 ;[ 10 ] .word 1005 ;[ 10 ] .word -1006 ;[ 522 ] .word 32751 ;[ 522 ] .word 22448 ;[ 266 ] .word 23869 ;[ 266 ] .word -23870 ;[ 778 ] .word 22448 ;[ 778 ] .word 29873 ;[ 138 ] .word 13462 ;[ 138 ] .word -13463 ;[ 650 ] .word 29873 ;[ 650 ] .word 11604 ;[ 394 ] .word 30643 ;[ 394 ] .word -30644 ;[ 906 ] .word 11604 ;[ 906 ] .word 31926 ;[ 74 ] .word 7375 ;[ 74 ] .word -7376 ;[ 586 ] .word 31926 ;[ 586 ] .word 17360 ;[ 330 ] .word 27790 ;[ 330 ] .word -27791 ;[ 842 ] .word 17360 ;[ 842 ] .word 26673 ;[ 202 ] .word 19031 ;[ 202 ] .word -19032 ;[ 714 ] .word 26673 ;[ 714 ] .word 5403 ;[ 458 ] .word 32318 ;[ 458 ] .word -32319 ;[ 970 ] .word 5403 ;[ 970 ] .word 32495 ;[ 42 ] .word 4210 ;[ 42 ] .word -4211 ;[ 554 ] .word 32495 ;[ 554 ] .word 20000 ;[ 298 ] .word 25954 ;[ 298 ] .word -25955 ;[ 810 ] .word 20000 ;[ 810 ] .word 28410 ;[ 170 ] .word 16325 ;[ 170 ] .word -16326 ;[ 682 ] .word 28410 ;[ 682 ] .word 8545 ;[ 426 ] .word 31633 ;[ 426 ] .word -31634 ;[ 938 ] .word 8545 ;[ 938 ] .word 31049 ;[ 106 ] .word 10469 ;[ 106 ] .word -10470 ;[ 618 ] .word 31049 ;[ 618 ] .word 14552 ;[ 362 ] .word 29358 ;[ 362 ] .word -29359 ;[ 874 ] .word 14552 ;[ 874 ] .word 24679 ;[ 234 ] .word 21554 ;[ 234 ] .word -21555 ;[ 746 ] .word 24679 ;[ 746 ] .word 2209 ;[ 490 ] .word 32692 ;[ 490 ] .word -32693 ;[ 1002 ] .word 2209 ;[ 1002 ] .word 32662 ;[ 26 ] .word 2610 ;[ 26 ] .word -2611 ;[ 538 ] .word 32662 ;[ 538 ] .word 21249 ;[ 282 ] .word 24942 ;[ 282 ] .word -24943 ;[ 794 ] .word 21249 ;[ 794 ] .word 29177 ;[ 154 ] .word 14911 ;[ 154 ] .word -14912 ;[ 666 ] .word 29177 ;[ 666 ] .word 10087 ;[ 410 ] .word 31175 ;[ 410 ] .word -31176 ;[ 922 ] .word 10087 ;[ 922 ] .word 31525 ;[ 90 ] .word 8932 ;[ 90 ] .word -8933 ;[ 602 ] .word 31525 ;[ 602 ] .word 15975 ;[ 346 ] .word 28608 ;[ 346 ] .word -28609 ;[ 858 ] .word 15975 ;[ 858 ] .word 25707 ;[ 218 ] .word 20317 ;[ 218 ] .word -20318 ;[ 730 ] .word 25707 ;[ 730 ] .word 3811 ;[ 474 ] .word 32544 ;[ 474 ] .word -32545 ;[ 986 ] .word 3811 ;[ 986 ] .word 32249 ;[ 58 ] .word 5799 ;[ 58 ] .word -5800 ;[ 570 ] .word 32249 ;[ 570 ] .word 18702 ;[ 314 ] .word 26905 ;[ 314 ] .word -26906 ;[ 826 ] .word 18702 ;[ 826 ] .word 27575 ;[ 186 ] .word 17699 ;[ 186 ] .word -17700 ;[ 698 ] .word 27575 ;[ 698 ] .word 6982 ;[ 442 ] .word 32014 ;[ 442 ] .word -32015 ;[ 954 ] .word 6982 ;[ 954 ] .word 30498 ;[ 122 ] .word 11980 ;[ 122 ] .word -11981 ;[ 634 ] .word 30498 ;[ 634 ] .word 13094 ;[ 378 ] .word 30036 ;[ 378 ] .word -30037 ;[ 890 ] .word 13094 ;[ 890 ] .word 23592 ;[ 250 ] .word 22739 ;[ 250 ] .word -22740 ;[ 762 ] .word 23592 ;[ 762 ] .word 603 ;[ 506 ] .word 32761 ;[ 506 ] .word -32762 ;[ 1018 ] .word 603 ;[ 1018 ] .word 32761 ;[ 6 ] .word 603 ;[ 6 ] .word -604 ;[ 518 ] .word 32761 ;[ 518 ] .word 22739 ;[ 262 ] .word 23592 ;[ 262 ] .word -23593 ;[ 774 ] .word 22739 ;[ 774 ] .word 30036 ;[ 134 ] .word 13094 ;[ 134 ] .word -13095 ;[ 646 ] .word 30036 ;[ 646 ] .word 11980 ;[ 390 ] .word 30498 ;[ 390 ] .word -30499 ;[ 902 ] .word 11980 ;[ 902 ] .word 32014 ;[ 70 ] .word 6982 ;[ 70 ] .word -6983 ;[ 582 ] .word 32014 ;[ 582 ] .word 17699 ;[ 326 ] .word 27575 ;[ 326 ] .word -27576 ;[ 838 ] .word 17699 ;[ 838 ] .word 26905 ;[ 198 ] .word 18702 ;[ 198 ] .word -18703 ;[ 710 ] .word 26905 ;[ 710 ] .word 5799 ;[ 454 ] .word 32249 ;[ 454 ] .word -32250 ;[ 966 ] .word 5799 ;[ 966 ] .word 32544 ;[ 38 ] .word 3811 ;[ 38 ] .word -3812 ;[ 550 ] .word 32544 ;[ 550 ] .word 20317 ;[ 294 ] .word 25707 ;[ 294 ] .word -25708 ;[ 806 ] .word 20317 ;[ 806 ] .word 28608 ;[ 166 ] .word 15975 ;[ 166 ] .word -15976 ;[ 678 ] .word 28608 ;[ 678 ] .word 8932 ;[ 422 ] .word 31525 ;[ 422 ] .word -31526 ;[ 934 ] .word 8932 ;[ 934 ] .word 31175 ;[ 102 ] .word 10087 ;[ 102 ] .word -10088 ;[ 614 ] .word 31175 ;[ 614 ] .word 14911 ;[ 358 ] .word 29177 ;[ 358 ] .word -29178 ;[ 870 ] .word 14911 ;[ 870 ] .word 24942 ;[ 230 ] .word 21249 ;[ 230 ] .word -21250 ;[ 742 ] .word 24942 ;[ 742 ] .word 2610 ;[ 486 ] .word 32662 ;[ 486 ] .word -32663 ;[ 998 ] .word 2610 ;[ 998 ] .word 32692 ;[ 22 ] .word 2209 ;[ 22 ] .word -2210 ;[ 534 ] .word 32692 ;[ 534 ] .word 21554 ;[ 278 ] .word 24679 ;[ 278 ] .word -24680 ;[ 790 ] .word 21554 ;[ 790 ] .word 29358 ;[ 150 ] .word 14552 ;[ 150 ] .word -14553 ;[ 662 ] .word 29358 ;[ 662 ] .word 10469 ;[ 406 ] .word 31049 ;[ 406 ] .word -31050 ;[ 918 ] .word 10469 ;[ 918 ] .word 31633 ;[ 86 ] .word 8545 ;[ 86 ] .word -8546 ;[ 598 ] .word 31633 ;[ 598 ] .word 16325 ;[ 342 ] .word 28410 ;[ 342 ] .word -28411 ;[ 854 ] .word 16325 ;[ 854 ] .word 25954 ;[ 214 ] .word 20000 ;[ 214 ] .word -20001 ;[ 726 ] .word 25954 ;[ 726 ] .word 4210 ;[ 470 ] .word 32495 ;[ 470 ] .word -32496 ;[ 982 ] .word 4210 ;[ 982 ] .word 32318 ;[ 54 ] .word 5403 ;[ 54 ] .word -5404 ;[ 566 ] .word 32318 ;[ 566 ] .word 19031 ;[ 310 ] .word 26673 ;[ 310 ] .word -26674 ;[ 822 ] .word 19031 ;[ 822 ] .word 27790 ;[ 182 ] .word 17360 ;[ 182 ] .word -17361 ;[ 694 ] .word 27790 ;[ 694 ] .word 7375 ;[ 438 ] .word 31926 ;[ 438 ] .word -31927 ;[ 950 ] .word 7375 ;[ 950 ] .word 30643 ;[ 118 ] .word 11604 ;[ 118 ] .word -11605 ;[ 630 ] .word 30643 ;[ 630 ] .word 13462 ;[ 374 ] .word 29873 ;[ 374 ] .word -29874 ;[ 886 ] .word 13462 ;[ 886 ] .word 23869 ;[ 246 ] .word 22448 ;[ 246 ] .word -22449 ;[ 758 ] .word 23869 ;[ 758 ] .word 1005 ;[ 502 ] .word 32751 ;[ 502 ] .word -32752 ;[ 1014 ] .word 1005 ;[ 1014 ] .word 32736 ;[ 14 ] .word 1406 ;[ 14 ] .word -1407 ;[ 526 ] .word 32736 ;[ 526 ] .word 22153 ;[ 270 ] .word 24143 ;[ 270 ] .word -24144 ;[ 782 ] .word 22153 ;[ 782 ] .word 29706 ;[ 142 ] .word 13827 ;[ 142 ] .word -13828 ;[ 654 ] .word 29706 ;[ 654 ] .word 11227 ;[ 398 ] .word 30783 ;[ 398 ] .word -30784 ;[ 910 ] .word 11227 ;[ 910 ] .word 31833 ;[ 78 ] .word 7766 ;[ 78 ] .word -7767 ;[ 590 ] .word 31833 ;[ 590 ] .word 17017 ;[ 334 ] .word 28001 ;[ 334 ] .word -28002 ;[ 846 ] .word 17017 ;[ 846 ] .word 26437 ;[ 206 ] .word 19357 ;[ 206 ] .word -19358 ;[ 718 ] .word 26437 ;[ 718 ] .word 5006 ;[ 462 ] .word 32382 ;[ 462 ] .word -32383 ;[ 974 ] .word 5006 ;[ 974 ] .word 32441 ;[ 46 ] .word 4608 ;[ 46 ] .word -4609 ;[ 558 ] .word 32441 ;[ 558 ] .word 19680 ;[ 302 ] .word 26198 ;[ 302 ] .word -26199 ;[ 814 ] .word 19680 ;[ 814 ] .word 28208 ;[ 174 ] .word 16672 ;[ 174 ] .word -16673 ;[ 686 ] .word 28208 ;[ 686 ] .word 8156 ;[ 430 ] .word 31735 ;[ 430 ] .word -31736 ;[ 942 ] .word 8156 ;[ 942 ] .word 30918 ;[ 110 ] .word 10849 ;[ 110 ] .word -10850 ;[ 622 ] .word 30918 ;[ 622 ] .word 14191 ;[ 366 ] .word 29534 ;[ 366 ] .word -29535 ;[ 878 ] .word 14191 ;[ 878 ] .word 24413 ;[ 238 ] .word 21855 ;[ 238 ] .word -21856 ;[ 750 ] .word 24413 ;[ 750 ] .word 1808 ;[ 494 ] .word 32717 ;[ 494 ] .word -32718 ;[ 1006 ] .word 1808 ;[ 1006 ] .word 32628 ;[ 30 ] .word 3011 ;[ 30 ] .word -3012 ;[ 542 ] .word 32628 ;[ 542 ] .word 20942 ;[ 286 ] .word 25201 ;[ 286 ] .word -25202 ;[ 798 ] .word 20942 ;[ 798 ] .word 28992 ;[ 158 ] .word 15268 ;[ 158 ] .word -15269 ;[ 670 ] .word 28992 ;[ 670 ] .word 9703 ;[ 414 ] .word 31297 ;[ 414 ] .word -31298 ;[ 926 ] .word 9703 ;[ 926 ] .word 31413 ;[ 94 ] .word 9319 ;[ 94 ] .word -9320 ;[ 606 ] .word 31413 ;[ 606 ] .word 15623 ;[ 350 ] .word 28802 ;[ 350 ] .word -28803 ;[ 862 ] .word 15623 ;[ 862 ] .word 25456 ;[ 222 ] .word 20631 ;[ 222 ] .word -20632 ;[ 734 ] .word 25456 ;[ 734 ] .word 3411 ;[ 478 ] .word 32588 ;[ 478 ] .word -32589 ;[ 990 ] .word 3411 ;[ 990 ] .word 32176 ;[ 62 ] .word 6195 ;[ 62 ] .word -6196 ;[ 574 ] .word 32176 ;[ 574 ] .word 18371 ;[ 318 ] .word 27132 ;[ 318 ] .word -27133 ;[ 830 ] .word 18371 ;[ 830 ] .word 27355 ;[ 190 ] .word 18036 ;[ 190 ] .word -18037 ;[ 702 ] .word 27355 ;[ 702 ] .word 6589 ;[ 446 ] .word 32097 ;[ 446 ] .word -32098 ;[ 958 ] .word 6589 ;[ 958 ] .word 30349 ;[ 126 ] .word 12353 ;[ 126 ] .word -12354 ;[ 638 ] .word 30349 ;[ 638 ] .word 12724 ;[ 382 ] .word 30195 ;[ 382 ] .word -30196 ;[ 894 ] .word 12724 ;[ 894 ] .word 23311 ;[ 254 ] .word 23027 ;[ 254 ] .word -23028 ;[ 766 ] .word 23311 ;[ 766 ] .word 201 ;[ 510 ] .word 32766 ;[ 510 ] .word -32767 ;[ 1022 ] .word 201 ;[ 1022 ] .word 32766 ;[ 1 ] .word 100 ;[ 1 ] .word -101 ;[ 513 ] .word 32766 ;[ 513 ] .word 23098 ;[ 257 ] .word 23240 ;[ 257 ] .word -23241 ;[ 769 ] .word 23098 ;[ 769 ] .word 30234 ;[ 129 ] .word 12632 ;[ 129 ] .word -12633 ;[ 641 ] .word 30234 ;[ 641 ] .word 12446 ;[ 385 ] .word 30311 ;[ 385 ] .word -30312 ;[ 897 ] .word 12446 ;[ 897 ] .word 32117 ;[ 65 ] .word 6491 ;[ 65 ] .word -6492 ;[ 577 ] .word 32117 ;[ 577 ] .word 18120 ;[ 321 ] .word 27300 ;[ 321 ] .word -27301 ;[ 833 ] .word 18120 ;[ 833 ] .word 27188 ;[ 193 ] .word 18287 ;[ 193 ] .word -18288 ;[ 705 ] .word 27188 ;[ 705 ] .word 6293 ;[ 449 ] .word 32156 ;[ 449 ] .word -32157 ;[ 961 ] .word 6293 ;[ 961 ] .word 32599 ;[ 33 ] .word 3311 ;[ 33 ] .word -3312 ;[ 545 ] .word 32599 ;[ 545 ] .word 20709 ;[ 289 ] .word 25392 ;[ 289 ] .word -25393 ;[ 801 ] .word 20709 ;[ 801 ] .word 28850 ;[ 161 ] .word 15534 ;[ 161 ] .word -15535 ;[ 673 ] .word 28850 ;[ 673 ] .word 9415 ;[ 417 ] .word 31385 ;[ 417 ] .word -31386 ;[ 929 ] .word 9415 ;[ 929 ] .word 31326 ;[ 97 ] .word 9607 ;[ 97 ] .word -9608 ;[ 609 ] .word 31326 ;[ 609 ] .word 15357 ;[ 353 ] .word 28945 ;[ 353 ] .word -28946 ;[ 865 ] .word 15357 ;[ 865 ] .word 25265 ;[ 225 ] .word 20864 ;[ 225 ] .word -20865 ;[ 737 ] .word 25265 ;[ 737 ] .word 3111 ;[ 481 ] .word 32618 ;[ 481 ] .word -32619 ;[ 993 ] .word 3111 ;[ 993 ] .word 32722 ;[ 17 ] .word 1708 ;[ 17 ] .word -1709 ;[ 529 ] .word 32722 ;[ 529 ] .word 21930 ;[ 273 ] .word 24346 ;[ 273 ] .word -24347 ;[ 785 ] .word 21930 ;[ 785 ] .word 29577 ;[ 145 ] .word 14100 ;[ 145 ] .word -14101 ;[ 657 ] .word 29577 ;[ 657 ] .word 10944 ;[ 401 ] .word 30885 ;[ 401 ] .word -30886 ;[ 913 ] .word 10944 ;[ 913 ] .word 31760 ;[ 81 ] .word 8059 ;[ 81 ] .word -8060 ;[ 593 ] .word 31760 ;[ 593 ] .word 16759 ;[ 337 ] .word 28156 ;[ 337 ] .word -28157 ;[ 849 ] .word 16759 ;[ 849 ] .word 26258 ;[ 209 ] .word 19599 ;[ 209 ] .word -19600 ;[ 721 ] .word 26258 ;[ 721 ] .word 4708 ;[ 465 ] .word 32426 ;[ 465 ] .word -32427 ;[ 977 ] .word 4708 ;[ 977 ] .word 32397 ;[ 49 ] .word 4907 ;[ 49 ] .word -4908 ;[ 561 ] .word 32397 ;[ 561 ] .word 19438 ;[ 305 ] .word 26378 ;[ 305 ] .word -26379 ;[ 817 ] .word 19438 ;[ 817 ] .word 28053 ;[ 177 ] .word 16931 ;[ 177 ] .word -16932 ;[ 689 ] .word 28053 ;[ 689 ] .word 7864 ;[ 433 ] .word 31809 ;[ 433 ] .word -31810 ;[ 945 ] .word 7864 ;[ 945 ] .word 30817 ;[ 113 ] .word 11133 ;[ 113 ] .word -11134 ;[ 625 ] .word 30817 ;[ 625 ] .word 13918 ;[ 369 ] .word 29663 ;[ 369 ] .word -29664 ;[ 881 ] .word 13918 ;[ 881 ] .word 24211 ;[ 241 ] .word 22079 ;[ 241 ] .word -22080 ;[ 753 ] .word 24211 ;[ 753 ] .word 1507 ;[ 497 ] .word 32732 ;[ 497 ] .word -32733 ;[ 1009 ] .word 1507 ;[ 1009 ] .word 32754 ;[ 9 ] .word 904 ;[ 9 ] .word -905 ;[ 521 ] .word 32754 ;[ 521 ] .word 22521 ;[ 265 ] .word 23800 ;[ 265 ] .word -23801 ;[ 777 ] .word 22521 ;[ 777 ] .word 29915 ;[ 137 ] .word 13370 ;[ 137 ] .word -13371 ;[ 649 ] .word 29915 ;[ 649 ] .word 11698 ;[ 393 ] .word 30607 ;[ 393 ] .word -30608 ;[ 905 ] .word 11698 ;[ 905 ] .word 31948 ;[ 73 ] .word 7277 ;[ 73 ] .word -7278 ;[ 585 ] .word 31948 ;[ 585 ] .word 17445 ;[ 329 ] .word 27736 ;[ 329 ] .word -27737 ;[ 841 ] .word 17445 ;[ 841 ] .word 26731 ;[ 201 ] .word 18949 ;[ 201 ] .word -18950 ;[ 713 ] .word 26731 ;[ 713 ] .word 5502 ;[ 457 ] .word 32301 ;[ 457 ] .word -32302 ;[ 969 ] .word 5502 ;[ 969 ] .word 32508 ;[ 41 ] .word 4110 ;[ 41 ] .word -4111 ;[ 553 ] .word 32508 ;[ 553 ] .word 20079 ;[ 297 ] .word 25893 ;[ 297 ] .word -25894 ;[ 809 ] .word 20079 ;[ 809 ] .word 28460 ;[ 169 ] .word 16238 ;[ 169 ] .word -16239 ;[ 681 ] .word 28460 ;[ 681 ] .word 8642 ;[ 425 ] .word 31606 ;[ 425 ] .word -31607 ;[ 937 ] .word 8642 ;[ 937 ] .word 31081 ;[ 105 ] .word 10373 ;[ 105 ] .word -10374 ;[ 617 ] .word 31081 ;[ 617 ] .word 14642 ;[ 361 ] .word 29313 ;[ 361 ] .word -29314 ;[ 873 ] .word 14642 ;[ 873 ] .word 24745 ;[ 233 ] .word 21478 ;[ 233 ] .word -21479 ;[ 745 ] .word 24745 ;[ 745 ] .word 2310 ;[ 489 ] .word 32685 ;[ 489 ] .word -32686 ;[ 1001 ] .word 2310 ;[ 1001 ] .word 32670 ;[ 25 ] .word 2510 ;[ 25 ] .word -2511 ;[ 537 ] .word 32670 ;[ 537 ] .word 21326 ;[ 281 ] .word 24877 ;[ 281 ] .word -24878 ;[ 793 ] .word 21326 ;[ 793 ] .word 29222 ;[ 153 ] .word 14822 ;[ 153 ] .word -14823 ;[ 665 ] .word 29222 ;[ 665 ] .word 10182 ;[ 409 ] .word 31144 ;[ 409 ] .word -31145 ;[ 921 ] .word 10182 ;[ 921 ] .word 31553 ;[ 89 ] .word 8836 ;[ 89 ] .word -8837 ;[ 601 ] .word 31553 ;[ 601 ] .word 16063 ;[ 345 ] .word 28559 ;[ 345 ] .word -28560 ;[ 857 ] .word 16063 ;[ 857 ] .word 25769 ;[ 217 ] .word 20238 ;[ 217 ] .word -20239 ;[ 729 ] .word 25769 ;[ 729 ] .word 3911 ;[ 473 ] .word 32532 ;[ 473 ] .word -32533 ;[ 985 ] .word 3911 ;[ 985 ] .word 32267 ;[ 57 ] .word 5700 ;[ 57 ] .word -5701 ;[ 569 ] .word 32267 ;[ 569 ] .word 18785 ;[ 313 ] .word 26847 ;[ 313 ] .word -26848 ;[ 825 ] .word 18785 ;[ 825 ] .word 27629 ;[ 185 ] .word 17615 ;[ 185 ] .word -17616 ;[ 697 ] .word 27629 ;[ 697 ] .word 7081 ;[ 441 ] .word 31992 ;[ 441 ] .word -31993 ;[ 953 ] .word 7081 ;[ 953 ] .word 30535 ;[ 121 ] .word 11886 ;[ 121 ] .word -11887 ;[ 633 ] .word 30535 ;[ 633 ] .word 13186 ;[ 377 ] .word 29996 ;[ 377 ] .word -29997 ;[ 889 ] .word 13186 ;[ 889 ] .word 23661 ;[ 249 ] .word 22666 ;[ 249 ] .word -22667 ;[ 761 ] .word 23661 ;[ 761 ] .word 703 ;[ 505 ] .word 32759 ;[ 505 ] .word -32760 ;[ 1017 ] .word 703 ;[ 1017 ] .word 32763 ;[ 5 ] .word 502 ;[ 5 ] .word -503 ;[ 517 ] .word 32763 ;[ 517 ] .word 22811 ;[ 261 ] .word 23522 ;[ 261 ] .word -23523 ;[ 773 ] .word 22811 ;[ 773 ] .word 30076 ;[ 133 ] .word 13002 ;[ 133 ] .word -13003 ;[ 645 ] .word 30076 ;[ 645 ] .word 12073 ;[ 389 ] .word 30461 ;[ 389 ] .word -30462 ;[ 901 ] .word 12073 ;[ 901 ] .word 32035 ;[ 69 ] .word 6884 ;[ 69 ] .word -6885 ;[ 581 ] .word 32035 ;[ 581 ] .word 17784 ;[ 325 ] .word 27520 ;[ 325 ] .word -27521 ;[ 837 ] .word 17784 ;[ 837 ] .word 26962 ;[ 197 ] .word 18620 ;[ 197 ] .word -18621 ;[ 709 ] .word 26962 ;[ 709 ] .word 5898 ;[ 453 ] .word 32231 ;[ 453 ] .word -32232 ;[ 965 ] .word 5898 ;[ 965 ] .word 32556 ;[ 37 ] .word 3711 ;[ 37 ] .word -3712 ;[ 549 ] .word 32556 ;[ 549 ] .word 20396 ;[ 293 ] .word 25645 ;[ 293 ] .word -25646 ;[ 805 ] .word 20396 ;[ 805 ] .word 28657 ;[ 165 ] .word 15887 ;[ 165 ] .word -15888 ;[ 677 ] .word 28657 ;[ 677 ] .word 9029 ;[ 421 ] .word 31498 ;[ 421 ] .word -31499 ;[ 933 ] .word 9029 ;[ 933 ] .word 31206 ;[ 101 ] .word 9991 ;[ 101 ] .word -9992 ;[ 613 ] .word 31206 ;[ 613 ] .word 15001 ;[ 357 ] .word 29131 ;[ 357 ] .word -29132 ;[ 869 ] .word 15001 ;[ 869 ] .word 25007 ;[ 229 ] .word 21173 ;[ 229 ] .word -21174 ;[ 741 ] .word 25007 ;[ 741 ] .word 2711 ;[ 485 ] .word 32654 ;[ 485 ] .word -32655 ;[ 997 ] .word 2711 ;[ 997 ] .word 32699 ;[ 21 ] .word 2109 ;[ 21 ] .word -2110 ;[ 533 ] .word 32699 ;[ 533 ] .word 21629 ;[ 277 ] .word 24613 ;[ 277 ] .word -24614 ;[ 789 ] .word 21629 ;[ 789 ] .word 29402 ;[ 149 ] .word 14462 ;[ 149 ] .word -14463 ;[ 661 ] .word 29402 ;[ 661 ] .word 10564 ;[ 405 ] .word 31017 ;[ 405 ] .word -31018 ;[ 917 ] .word 10564 ;[ 917 ] .word 31659 ;[ 85 ] .word 8448 ;[ 85 ] .word -8449 ;[ 597 ] .word 31659 ;[ 597 ] .word 16412 ;[ 341 ] .word 28360 ;[ 341 ] .word -28361 ;[ 853 ] .word 16412 ;[ 853 ] .word 26016 ;[ 213 ] .word 19920 ;[ 213 ] .word -19921 ;[ 725 ] .word 26016 ;[ 725 ] .word 4310 ;[ 469 ] .word 32482 ;[ 469 ] .word -32483 ;[ 981 ] .word 4310 ;[ 981 ] .word 32334 ;[ 53 ] .word 5304 ;[ 53 ] .word -5305 ;[ 565 ] .word 32334 ;[ 565 ] .word 19113 ;[ 309 ] .word 26615 ;[ 309 ] .word -26616 ;[ 821 ] .word 19113 ;[ 821 ] .word 27843 ;[ 181 ] .word 17274 ;[ 181 ] .word -17275 ;[ 693 ] .word 27843 ;[ 693 ] .word 7473 ;[ 437 ] .word 31903 ;[ 437 ] .word -31904 ;[ 949 ] .word 7473 ;[ 949 ] .word 30678 ;[ 117 ] .word 11510 ;[ 117 ] .word -11511 ;[ 629 ] .word 30678 ;[ 629 ] .word 13553 ;[ 373 ] .word 29832 ;[ 373 ] .word -29833 ;[ 885 ] .word 13553 ;[ 885 ] .word 23938 ;[ 245 ] .word 22374 ;[ 245 ] .word -22375 ;[ 757 ] .word 23938 ;[ 757 ] .word 1105 ;[ 501 ] .word 32748 ;[ 501 ] .word -32749 ;[ 1013 ] .word 1105 ;[ 1013 ] .word 32740 ;[ 13 ] .word 1306 ;[ 13 ] .word -1307 ;[ 525 ] .word 32740 ;[ 525 ] .word 22227 ;[ 269 ] .word 24075 ;[ 269 ] .word -24076 ;[ 781 ] .word 22227 ;[ 781 ] .word 29748 ;[ 141 ] .word 13736 ;[ 141 ] .word -13737 ;[ 653 ] .word 29748 ;[ 653 ] .word 11322 ;[ 397 ] .word 30748 ;[ 397 ] .word -30749 ;[ 909 ] .word 11322 ;[ 909 ] .word 31856 ;[ 77 ] .word 7668 ;[ 77 ] .word -7669 ;[ 589 ] .word 31856 ;[ 589 ] .word 17103 ;[ 333 ] .word 27948 ;[ 333 ] .word -27949 ;[ 845 ] .word 17103 ;[ 845 ] .word 26497 ;[ 205 ] .word 19276 ;[ 205 ] .word -19277 ;[ 717 ] .word 26497 ;[ 717 ] .word 5106 ;[ 461 ] .word 32366 ;[ 461 ] .word -32367 ;[ 973 ] .word 5106 ;[ 973 ] .word 32455 ;[ 45 ] .word 4509 ;[ 45 ] .word -4510 ;[ 557 ] .word 32455 ;[ 557 ] .word 19760 ;[ 301 ] .word 26137 ;[ 301 ] .word -26138 ;[ 813 ] .word 19760 ;[ 813 ] .word 28259 ;[ 173 ] .word 16586 ;[ 173 ] .word -16587 ;[ 685 ] .word 28259 ;[ 685 ] .word 8253 ;[ 429 ] .word 31710 ;[ 429 ] .word -31711 ;[ 941 ] .word 8253 ;[ 941 ] .word 30951 ;[ 109 ] .word 10754 ;[ 109 ] .word -10755 ;[ 621 ] .word 30951 ;[ 621 ] .word 14281 ;[ 365 ] .word 29490 ;[ 365 ] .word -29491 ;[ 877 ] .word 14281 ;[ 877 ] .word 24480 ;[ 237 ] .word 21780 ;[ 237 ] .word -21781 ;[ 749 ] .word 24480 ;[ 749 ] .word 1908 ;[ 493 ] .word 32711 ;[ 493 ] .word -32712 ;[ 1005 ] .word 1908 ;[ 1005 ] .word 32637 ;[ 29 ] .word 2911 ;[ 29 ] .word -2912 ;[ 541 ] .word 32637 ;[ 541 ] .word 21019 ;[ 285 ] .word 25136 ;[ 285 ] .word -25137 ;[ 797 ] .word 21019 ;[ 797 ] .word 29038 ;[ 157 ] .word 15179 ;[ 157 ] .word -15180 ;[ 669 ] .word 29038 ;[ 669 ] .word 9799 ;[ 413 ] .word 31267 ;[ 413 ] .word -31268 ;[ 925 ] .word 9799 ;[ 925 ] .word 31442 ;[ 93 ] .word 9222 ;[ 93 ] .word -9223 ;[ 605 ] .word 31442 ;[ 605 ] .word 15711 ;[ 349 ] .word 28754 ;[ 349 ] .word -28755 ;[ 861 ] .word 15711 ;[ 861 ] .word 25519 ;[ 221 ] .word 20553 ;[ 221 ] .word -20554 ;[ 733 ] .word 25519 ;[ 733 ] .word 3511 ;[ 477 ] .word 32578 ;[ 477 ] .word -32579 ;[ 989 ] .word 3511 ;[ 989 ] .word 32194 ;[ 61 ] .word 6096 ;[ 61 ] .word -6097 ;[ 573 ] .word 32194 ;[ 573 ] .word 18454 ;[ 317 ] .word 27076 ;[ 317 ] .word -27077 ;[ 829 ] .word 18454 ;[ 829 ] .word 27411 ;[ 189 ] .word 17952 ;[ 189 ] .word -17953 ;[ 701 ] .word 27411 ;[ 701 ] .word 6688 ;[ 445 ] .word 32077 ;[ 445 ] .word -32078 ;[ 957 ] .word 6688 ;[ 957 ] .word 30386 ;[ 125 ] .word 12260 ;[ 125 ] .word -12261 ;[ 637 ] .word 30386 ;[ 637 ] .word 12817 ;[ 381 ] .word 30156 ;[ 381 ] .word -30157 ;[ 893 ] .word 12817 ;[ 893 ] .word 23382 ;[ 253 ] .word 22955 ;[ 253 ] .word -22956 ;[ 765 ] .word 23382 ;[ 765 ] .word 301 ;[ 509 ] .word 32765 ;[ 509 ] .word -32766 ;[ 1021 ] .word 301 ;[ 1021 ] .word 32765 ;[ 3 ] .word 301 ;[ 3 ] .word -302 ;[ 515 ] .word 32765 ;[ 515 ] .word 22955 ;[ 259 ] .word 23382 ;[ 259 ] .word -23383 ;[ 771 ] .word 22955 ;[ 771 ] .word 30156 ;[ 131 ] .word 12817 ;[ 131 ] .word -12818 ;[ 643 ] .word 30156 ;[ 643 ] .word 12260 ;[ 387 ] .word 30386 ;[ 387 ] .word -30387 ;[ 899 ] .word 12260 ;[ 899 ] .word 32077 ;[ 67 ] .word 6688 ;[ 67 ] .word -6689 ;[ 579 ] .word 32077 ;[ 579 ] .word 17952 ;[ 323 ] .word 27411 ;[ 323 ] .word -27412 ;[ 835 ] .word 17952 ;[ 835 ] .word 27076 ;[ 195 ] .word 18454 ;[ 195 ] .word -18455 ;[ 707 ] .word 27076 ;[ 707 ] .word 6096 ;[ 451 ] .word 32194 ;[ 451 ] .word -32195 ;[ 963 ] .word 6096 ;[ 963 ] .word 32578 ;[ 35 ] .word 3511 ;[ 35 ] .word -3512 ;[ 547 ] .word 32578 ;[ 547 ] .word 20553 ;[ 291 ] .word 25519 ;[ 291 ] .word -25520 ;[ 803 ] .word 20553 ;[ 803 ] .word 28754 ;[ 163 ] .word 15711 ;[ 163 ] .word -15712 ;[ 675 ] .word 28754 ;[ 675 ] .word 9222 ;[ 419 ] .word 31442 ;[ 419 ] .word -31443 ;[ 931 ] .word 9222 ;[ 931 ] .word 31267 ;[ 99 ] .word 9799 ;[ 99 ] .word -9800 ;[ 611 ] .word 31267 ;[ 611 ] .word 15179 ;[ 355 ] .word 29038 ;[ 355 ] .word -29039 ;[ 867 ] .word 15179 ;[ 867 ] .word 25136 ;[ 227 ] .word 21019 ;[ 227 ] .word -21020 ;[ 739 ] .word 25136 ;[ 739 ] .word 2911 ;[ 483 ] .word 32637 ;[ 483 ] .word -32638 ;[ 995 ] .word 2911 ;[ 995 ] .word 32711 ;[ 19 ] .word 1908 ;[ 19 ] .word -1909 ;[ 531 ] .word 32711 ;[ 531 ] .word 21780 ;[ 275 ] .word 24480 ;[ 275 ] .word -24481 ;[ 787 ] .word 21780 ;[ 787 ] .word 29490 ;[ 147 ] .word 14281 ;[ 147 ] .word -14282 ;[ 659 ] .word 29490 ;[ 659 ] .word 10754 ;[ 403 ] .word 30951 ;[ 403 ] .word -30952 ;[ 915 ] .word 10754 ;[ 915 ] .word 31710 ;[ 83 ] .word 8253 ;[ 83 ] .word -8254 ;[ 595 ] .word 31710 ;[ 595 ] .word 16586 ;[ 339 ] .word 28259 ;[ 339 ] .word -28260 ;[ 851 ] .word 16586 ;[ 851 ] .word 26137 ;[ 211 ] .word 19760 ;[ 211 ] .word -19761 ;[ 723 ] .word 26137 ;[ 723 ] .word 4509 ;[ 467 ] .word 32455 ;[ 467 ] .word -32456 ;[ 979 ] .word 4509 ;[ 979 ] .word 32366 ;[ 51 ] .word 5106 ;[ 51 ] .word -5107 ;[ 563 ] .word 32366 ;[ 563 ] .word 19276 ;[ 307 ] .word 26497 ;[ 307 ] .word -26498 ;[ 819 ] .word 19276 ;[ 819 ] .word 27948 ;[ 179 ] .word 17103 ;[ 179 ] .word -17104 ;[ 691 ] .word 27948 ;[ 691 ] .word 7668 ;[ 435 ] .word 31856 ;[ 435 ] .word -31857 ;[ 947 ] .word 7668 ;[ 947 ] .word 30748 ;[ 115 ] .word 11322 ;[ 115 ] .word -11323 ;[ 627 ] .word 30748 ;[ 627 ] .word 13736 ;[ 371 ] .word 29748 ;[ 371 ] .word -29749 ;[ 883 ] .word 13736 ;[ 883 ] .word 24075 ;[ 243 ] .word 22227 ;[ 243 ] .word -22228 ;[ 755 ] .word 24075 ;[ 755 ] .word 1306 ;[ 499 ] .word 32740 ;[ 499 ] .word -32741 ;[ 1011 ] .word 1306 ;[ 1011 ] .word 32748 ;[ 11 ] .word 1105 ;[ 11 ] .word -1106 ;[ 523 ] .word 32748 ;[ 523 ] .word 22374 ;[ 267 ] .word 23938 ;[ 267 ] .word -23939 ;[ 779 ] .word 22374 ;[ 779 ] .word 29832 ;[ 139 ] .word 13553 ;[ 139 ] .word -13554 ;[ 651 ] .word 29832 ;[ 651 ] .word 11510 ;[ 395 ] .word 30678 ;[ 395 ] .word -30679 ;[ 907 ] .word 11510 ;[ 907 ] .word 31903 ;[ 75 ] .word 7473 ;[ 75 ] .word -7474 ;[ 587 ] .word 31903 ;[ 587 ] .word 17274 ;[ 331 ] .word 27843 ;[ 331 ] .word -27844 ;[ 843 ] .word 17274 ;[ 843 ] .word 26615 ;[ 203 ] .word 19113 ;[ 203 ] .word -19114 ;[ 715 ] .word 26615 ;[ 715 ] .word 5304 ;[ 459 ] .word 32334 ;[ 459 ] .word -32335 ;[ 971 ] .word 5304 ;[ 971 ] .word 32482 ;[ 43 ] .word 4310 ;[ 43 ] .word -4311 ;[ 555 ] .word 32482 ;[ 555 ] .word 19920 ;[ 299 ] .word 26016 ;[ 299 ] .word -26017 ;[ 811 ] .word 19920 ;[ 811 ] .word 28360 ;[ 171 ] .word 16412 ;[ 171 ] .word -16413 ;[ 683 ] .word 28360 ;[ 683 ] .word 8448 ;[ 427 ] .word 31659 ;[ 427 ] .word -31660 ;[ 939 ] .word 8448 ;[ 939 ] .word 31017 ;[ 107 ] .word 10564 ;[ 107 ] .word -10565 ;[ 619 ] .word 31017 ;[ 619 ] .word 14462 ;[ 363 ] .word 29402 ;[ 363 ] .word -29403 ;[ 875 ] .word 14462 ;[ 875 ] .word 24613 ;[ 235 ] .word 21629 ;[ 235 ] .word -21630 ;[ 747 ] .word 24613 ;[ 747 ] .word 2109 ;[ 491 ] .word 32699 ;[ 491 ] .word -32700 ;[ 1003 ] .word 2109 ;[ 1003 ] .word 32654 ;[ 27 ] .word 2711 ;[ 27 ] .word -2712 ;[ 539 ] .word 32654 ;[ 539 ] .word 21173 ;[ 283 ] .word 25007 ;[ 283 ] .word -25008 ;[ 795 ] .word 21173 ;[ 795 ] .word 29131 ;[ 155 ] .word 15001 ;[ 155 ] .word -15002 ;[ 667 ] .word 29131 ;[ 667 ] .word 9991 ;[ 411 ] .word 31206 ;[ 411 ] .word -31207 ;[ 923 ] .word 9991 ;[ 923 ] .word 31498 ;[ 91 ] .word 9029 ;[ 91 ] .word -9030 ;[ 603 ] .word 31498 ;[ 603 ] .word 15887 ;[ 347 ] .word 28657 ;[ 347 ] .word -28658 ;[ 859 ] .word 15887 ;[ 859 ] .word 25645 ;[ 219 ] .word 20396 ;[ 219 ] .word -20397 ;[ 731 ] .word 25645 ;[ 731 ] .word 3711 ;[ 475 ] .word 32556 ;[ 475 ] .word -32557 ;[ 987 ] .word 3711 ;[ 987 ] .word 32231 ;[ 59 ] .word 5898 ;[ 59 ] .word -5899 ;[ 571 ] .word 32231 ;[ 571 ] .word 18620 ;[ 315 ] .word 26962 ;[ 315 ] .word -26963 ;[ 827 ] .word 18620 ;[ 827 ] .word 27520 ;[ 187 ] .word 17784 ;[ 187 ] .word -17785 ;[ 699 ] .word 27520 ;[ 699 ] .word 6884 ;[ 443 ] .word 32035 ;[ 443 ] .word -32036 ;[ 955 ] .word 6884 ;[ 955 ] .word 30461 ;[ 123 ] .word 12073 ;[ 123 ] .word -12074 ;[ 635 ] .word 30461 ;[ 635 ] .word 13002 ;[ 379 ] .word 30076 ;[ 379 ] .word -30077 ;[ 891 ] .word 13002 ;[ 891 ] .word 23522 ;[ 251 ] .word 22811 ;[ 251 ] .word -22812 ;[ 763 ] .word 23522 ;[ 763 ] .word 502 ;[ 507 ] .word 32763 ;[ 507 ] .word -32764 ;[ 1019 ] .word 502 ;[ 1019 ] .word 32759 ;[ 7 ] .word 703 ;[ 7 ] .word -704 ;[ 519 ] .word 32759 ;[ 519 ] .word 22666 ;[ 263 ] .word 23661 ;[ 263 ] .word -23662 ;[ 775 ] .word 22666 ;[ 775 ] .word 29996 ;[ 135 ] .word 13186 ;[ 135 ] .word -13187 ;[ 647 ] .word 29996 ;[ 647 ] .word 11886 ;[ 391 ] .word 30535 ;[ 391 ] .word -30536 ;[ 903 ] .word 11886 ;[ 903 ] .word 31992 ;[ 71 ] .word 7081 ;[ 71 ] .word -7082 ;[ 583 ] .word 31992 ;[ 583 ] .word 17615 ;[ 327 ] .word 27629 ;[ 327 ] .word -27630 ;[ 839 ] .word 17615 ;[ 839 ] .word 26847 ;[ 199 ] .word 18785 ;[ 199 ] .word -18786 ;[ 711 ] .word 26847 ;[ 711 ] .word 5700 ;[ 455 ] .word 32267 ;[ 455 ] .word -32268 ;[ 967 ] .word 5700 ;[ 967 ] .word 32532 ;[ 39 ] .word 3911 ;[ 39 ] .word -3912 ;[ 551 ] .word 32532 ;[ 551 ] .word 20238 ;[ 295 ] .word 25769 ;[ 295 ] .word -25770 ;[ 807 ] .word 20238 ;[ 807 ] .word 28559 ;[ 167 ] .word 16063 ;[ 167 ] .word -16064 ;[ 679 ] .word 28559 ;[ 679 ] .word 8836 ;[ 423 ] .word 31553 ;[ 423 ] .word -31554 ;[ 935 ] .word 8836 ;[ 935 ] .word 31144 ;[ 103 ] .word 10182 ;[ 103 ] .word -10183 ;[ 615 ] .word 31144 ;[ 615 ] .word 14822 ;[ 359 ] .word 29222 ;[ 359 ] .word -29223 ;[ 871 ] .word 14822 ;[ 871 ] .word 24877 ;[ 231 ] .word 21326 ;[ 231 ] .word -21327 ;[ 743 ] .word 24877 ;[ 743 ] .word 2510 ;[ 487 ] .word 32670 ;[ 487 ] .word -32671 ;[ 999 ] .word 2510 ;[ 999 ] .word 32685 ;[ 23 ] .word 2310 ;[ 23 ] .word -2311 ;[ 535 ] .word 32685 ;[ 535 ] .word 21478 ;[ 279 ] .word 24745 ;[ 279 ] .word -24746 ;[ 791 ] .word 21478 ;[ 791 ] .word 29313 ;[ 151 ] .word 14642 ;[ 151 ] .word -14643 ;[ 663 ] .word 29313 ;[ 663 ] .word 10373 ;[ 407 ] .word 31081 ;[ 407 ] .word -31082 ;[ 919 ] .word 10373 ;[ 919 ] .word 31606 ;[ 87 ] .word 8642 ;[ 87 ] .word -8643 ;[ 599 ] .word 31606 ;[ 599 ] .word 16238 ;[ 343 ] .word 28460 ;[ 343 ] .word -28461 ;[ 855 ] .word 16238 ;[ 855 ] .word 25893 ;[ 215 ] .word 20079 ;[ 215 ] .word -20080 ;[ 727 ] .word 25893 ;[ 727 ] .word 4110 ;[ 471 ] .word 32508 ;[ 471 ] .word -32509 ;[ 983 ] .word 4110 ;[ 983 ] .word 32301 ;[ 55 ] .word 5502 ;[ 55 ] .word -5503 ;[ 567 ] .word 32301 ;[ 567 ] .word 18949 ;[ 311 ] .word 26731 ;[ 311 ] .word -26732 ;[ 823 ] .word 18949 ;[ 823 ] .word 27736 ;[ 183 ] .word 17445 ;[ 183 ] .word -17446 ;[ 695 ] .word 27736 ;[ 695 ] .word 7277 ;[ 439 ] .word 31948 ;[ 439 ] .word -31949 ;[ 951 ] .word 7277 ;[ 951 ] .word 30607 ;[ 119 ] .word 11698 ;[ 119 ] .word -11699 ;[ 631 ] .word 30607 ;[ 631 ] .word 13370 ;[ 375 ] .word 29915 ;[ 375 ] .word -29916 ;[ 887 ] .word 13370 ;[ 887 ] .word 23800 ;[ 247 ] .word 22521 ;[ 247 ] .word -22522 ;[ 759 ] .word 23800 ;[ 759 ] .word 904 ;[ 503 ] .word 32754 ;[ 503 ] .word -32755 ;[ 1015 ] .word 904 ;[ 1015 ] .word 32732 ;[ 15 ] .word 1507 ;[ 15 ] .word -1508 ;[ 527 ] .word 32732 ;[ 527 ] .word 22079 ;[ 271 ] .word 24211 ;[ 271 ] .word -24212 ;[ 783 ] .word 22079 ;[ 783 ] .word 29663 ;[ 143 ] .word 13918 ;[ 143 ] .word -13919 ;[ 655 ] .word 29663 ;[ 655 ] .word 11133 ;[ 399 ] .word 30817 ;[ 399 ] .word -30818 ;[ 911 ] .word 11133 ;[ 911 ] .word 31809 ;[ 79 ] .word 7864 ;[ 79 ] .word -7865 ;[ 591 ] .word 31809 ;[ 591 ] .word 16931 ;[ 335 ] .word 28053 ;[ 335 ] .word -28054 ;[ 847 ] .word 16931 ;[ 847 ] .word 26378 ;[ 207 ] .word 19438 ;[ 207 ] .word -19439 ;[ 719 ] .word 26378 ;[ 719 ] .word 4907 ;[ 463 ] .word 32397 ;[ 463 ] .word -32398 ;[ 975 ] .word 4907 ;[ 975 ] .word 32426 ;[ 47 ] .word 4708 ;[ 47 ] .word -4709 ;[ 559 ] .word 32426 ;[ 559 ] .word 19599 ;[ 303 ] .word 26258 ;[ 303 ] .word -26259 ;[ 815 ] .word 19599 ;[ 815 ] .word 28156 ;[ 175 ] .word 16759 ;[ 175 ] .word -16760 ;[ 687 ] .word 28156 ;[ 687 ] .word 8059 ;[ 431 ] .word 31760 ;[ 431 ] .word -31761 ;[ 943 ] .word 8059 ;[ 943 ] .word 30885 ;[ 111 ] .word 10944 ;[ 111 ] .word -10945 ;[ 623 ] .word 30885 ;[ 623 ] .word 14100 ;[ 367 ] .word 29577 ;[ 367 ] .word -29578 ;[ 879 ] .word 14100 ;[ 879 ] .word 24346 ;[ 239 ] .word 21930 ;[ 239 ] .word -21931 ;[ 751 ] .word 24346 ;[ 751 ] .word 1708 ;[ 495 ] .word 32722 ;[ 495 ] .word -32723 ;[ 1007 ] .word 1708 ;[ 1007 ] .word 32618 ;[ 31 ] .word 3111 ;[ 31 ] .word -3112 ;[ 543 ] .word 32618 ;[ 543 ] .word 20864 ;[ 287 ] .word 25265 ;[ 287 ] .word -25266 ;[ 799 ] .word 20864 ;[ 799 ] .word 28945 ;[ 159 ] .word 15357 ;[ 159 ] .word -15358 ;[ 671 ] .word 28945 ;[ 671 ] .word 9607 ;[ 415 ] .word 31326 ;[ 415 ] .word -31327 ;[ 927 ] .word 9607 ;[ 927 ] .word 31385 ;[ 95 ] .word 9415 ;[ 95 ] .word -9416 ;[ 607 ] .word 31385 ;[ 607 ] .word 15534 ;[ 351 ] .word 28850 ;[ 351 ] .word -28851 ;[ 863 ] .word 15534 ;[ 863 ] .word 25392 ;[ 223 ] .word 20709 ;[ 223 ] .word -20710 ;[ 735 ] .word 25392 ;[ 735 ] .word 3311 ;[ 479 ] .word 32599 ;[ 479 ] .word -32600 ;[ 991 ] .word 3311 ;[ 991 ] .word 32156 ;[ 63 ] .word 6293 ;[ 63 ] .word -6294 ;[ 575 ] .word 32156 ;[ 575 ] .word 18287 ;[ 319 ] .word 27188 ;[ 319 ] .word -27189 ;[ 831 ] .word 18287 ;[ 831 ] .word 27300 ;[ 191 ] .word 18120 ;[ 191 ] .word -18121 ;[ 703 ] .word 27300 ;[ 703 ] .word 6491 ;[ 447 ] .word 32117 ;[ 447 ] .word -32118 ;[ 959 ] .word 6491 ;[ 959 ] .word 30311 ;[ 127 ] .word 12446 ;[ 127 ] .word -12447 ;[ 639 ] .word 30311 ;[ 639 ] .word 12632 ;[ 383 ] .word 30234 ;[ 383 ] .word -30235 ;[ 895 ] .word 12632 ;[ 895 ] .word 23240 ;[ 255 ] .word 23098 ;[ 255 ] .word -23099 ;[ 767 ] .word 23240 ;[ 767 ] .word 100 ;[ 511 ] .word 32766 ;[ 511 ] .word -32767 ;[ 1023 ] .word 100 ;[ 1023 ]
27.65534
61
0.421274
55ec74fe0a96cd61ba169764056b21e826a7be0f
360
sql
SQL
demo/act-core/src/main/resources/db/dml/h2/V2__init_data.sql
leonlee/mde
608f59e9da212ffaaa9a681950f74b5036a09189
[ "MIT" ]
9
2021-06-28T12:50:08.000Z
2022-01-15T15:03:40.000Z
demo/act-core/src/main/resources/db/dml/h2/V2__init_data.sql
leonlee/mde
608f59e9da212ffaaa9a681950f74b5036a09189
[ "MIT" ]
null
null
null
demo/act-core/src/main/resources/db/dml/h2/V2__init_data.sql
leonlee/mde
608f59e9da212ffaaa9a681950f74b5036a09189
[ "MIT" ]
1
2022-02-14T06:34:47.000Z
2022-02-14T06:34:47.000Z
INSERT INTO `contact` (`id`, `name`, `mobile`, `qq`, `address` ,`created_on`, `updated_on`, `created_by`, `updated_by`, `deleted`) VALUES (1, 'zhangSan', '13555551225', '123456', '朝阳区望京A座', '2017-11-20 11:32:53', '2017-11-20 11:32:53', 350, 350, 0), (2, 'liSi', '13555551225', '123456', '朝阳区望京A座', '2017-11-20 11:32:53', '2017-11-20 11:32:53', 350, 350, 0);
72
130
0.619444
242510decd871679b3ae13f56e2a72a028594992
920
sql
SQL
examples/shopping/sql/ebox_charge_daily.sql
snower/syncany
32d32907a155618678d5b2335cd8a70192ed1e6f
[ "MIT" ]
5
2018-08-15T13:45:30.000Z
2021-03-18T01:51:47.000Z
examples/shopping/sql/ebox_charge_daily.sql
snower/syncany
32d32907a155618678d5b2335cd8a70192ed1e6f
[ "MIT" ]
null
null
null
examples/shopping/sql/ebox_charge_daily.sql
snower/syncany
32d32907a155618678d5b2335cd8a70192ed1e6f
[ "MIT" ]
null
null
null
SELECT CONCAT(terminal_code, ':', DATE(created_at), ':', charge_type) AS terminal_code_date_type, terminal_code, DATE(created_at) AS order_date, charge_type, COUNT(out_order_no) AS order_cnt, SUM(charge) AS charge, SUM(IF(charge > 0, 1, 0)) AS charge_cnt, SUM(discounted_charge) AS discounted_charge, SUM(IF(discounted_charge > 0, 1, 0)) AS discounted_charge_cnt FROM (SELECT charge_type, terminal_code, out_order_no, created_at, SUM(charge) AS charge, SUM(discounted_charge) AS discounted_charge FROM `ebox_charge` WHERE created_at >= %s AND created_at < %s GROUP BY out_order_no , charge_type HAVING charge + discounted_charge > 0) a GROUP BY terminal_code , DATE(created_at) , charge_type
30.666667
66
0.593478
c314967da4fb7c2dee7e71b348aa416844f05a32
2,084
rs
Rust
src/test/ui/no-implicit-prelude-nested.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
66,762
2015-01-01T08:32:03.000Z
2022-03-31T23:26:40.000Z
src/test/ui/no-implicit-prelude-nested.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
76,993
2015-01-01T00:06:33.000Z
2022-03-31T23:59:15.000Z
src/test/ui/no-implicit-prelude-nested.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
11,787
2015-01-01T00:01:19.000Z
2022-03-31T19:03:42.000Z
// Test that things from the prelude aren't in scope. Use many of them // so that renaming some things won't magically make this test fail // for the wrong reason (e.g., if `Add` changes to `Addition`, and // `no_implicit_prelude` stops working, then the `impl Add` will still // fail with the same error message). #[no_implicit_prelude] mod foo { mod baz { struct Test; impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope fn foo() { drop(2) //~ ERROR cannot find function `drop` in this scope } } struct Test; impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope fn foo() { drop(2) //~ ERROR cannot find function `drop` in this scope } } fn qux() { #[no_implicit_prelude] mod qux_inner { struct Test; impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope fn foo() { drop(2) //~ ERROR cannot find function `drop` in this scope } } } fn main() { // these should work fine drop(2) }
37.890909
86
0.633877
958b87cb3ee4d25a4f0adc388defca0415ce0f84
5,520
css
CSS
assets/styles/base.css
MubarakSULAYMAN/url-shortener
892be88b2382b3e369c7c18fff224d1d332adec4
[ "MIT" ]
null
null
null
assets/styles/base.css
MubarakSULAYMAN/url-shortener
892be88b2382b3e369c7c18fff224d1d332adec4
[ "MIT" ]
null
null
null
assets/styles/base.css
MubarakSULAYMAN/url-shortener
892be88b2382b3e369c7c18fff224d1d332adec4
[ "MIT" ]
null
null
null
/* @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;700&display=swap'); @import "assets/styles/transitions.css"; @import url('assets/styles/invalid_form.css'); */ /* :root {} */ [data-theme="dark"] { --github-dark: var(--github-light); --github-light: var(--github-dark); } body, html { scroll-behavior: smooth; font-size: 14px; font-style: normal; font-weight: 300; font-family: 'Ubuntu', sans-serif; } * { padding: 0; margin: 0; box-sizing: border-box; } *:focus:not(:focus-visible) { outline: none; } *:focus:not(:-moz-focusring) { outline: none; } a { color: #000000 !important; } #app { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100vw; height: 100vh; box-sizing: border-box; } h1 { color: blue; } .intro { margin-bottom: 100px; } .toggle-button { position: fixed; top: 0; right: 0; padding: 5px; border: 1px solid transparent; border-left-color: blue; border-bottom-color: blue; border-radius: 5px; outline: none; color: blue; background-color: #ffffff; z-index: 999; transition: all 0.2s cubic-bezier(0.55, 0.055, 0.675, 0.19); } .toggle-button:hover, .toggle-button:focus { color: #ffffff; background-color: blue; box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.9); -webkit-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.9); -moz-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.9); transform: translate(-5px, 0px); } .fa-lightbulb-on, .fa-lightbulb-slash { color: blue; } .toggle-button:hover .fa-lightbulb-on, .toggle-button:focus .fa-lightbulb-on, .toggle-button:hover .fa-lightbulb-slash, .toggle-button:focus .fa-lightbulb-slash { color: #ffffff; } .instructions { position: fixed; top: 5%; background-color: #ffffff; } .instructions { padding: 20px; border: 1px solid rgba(0, 0, 0, 0.59); border-radius: 5px; list-style-position: inside; } .instructions h4 { margin-bottom: 10px; color: green; } .instructions ol { margin-top: 10px; color: gray; font-size: 12px; } .input-url { display: flex; flex-direction: column; justify-content: space-between; height: 120px; } [class*="input-url_"] { width: 50vw; height: 50px; padding: 2px; border-radius: 25px; border: 2px solid rgba(0, 0, 255, 0.59); font-weight: 700; } [class*="input-url_"]:last-child { border-color: rgba(0, 128, 0, 0.59); } [class*="input-url_"] input { height: 100%; width: 80%; padding: 5px 20px; border: 1px solid transparent; border-top-left-radius: 25px; border-bottom-left-radius: 25px; transition: all 0.2s cubic-bezier(0.55, 0.055, 0.675, 0.19); } [class*="input-url_"]:first-child input { color: blue; } [class*="input-url_"]:last-child input { color: green; } /* Don't group these */ /* Chrome/Opera/Safari */ [class*="input-url_"] input::-webkit-input-placeholder { color: gray; } /* Firefox 19+ */ [class*="input-url_"] input::-moz-placeholder { color: gray; } /* IE 10+ */ [class*="input-url_"] input:-ms-input-placeholder { color: gray; } /* Firefox 18- */ [class*="input-url_"] input:-moz-placeholder { color: gray; } [class*="input-url_"]:first-child input:hover, [class*="input-url_"]:first-child input:focus { border-color: blue; } [class*="input-url_"]:last-child input:hover, [class*="input-url_"]:last-child input:focus { border-color: green; } [class*="input-url_"] input:focus, [class*="input-url_"] button:focus { outline: none; } [class*="input-url_"] button { height: 100%; width: calc(20% - 6px); border: 1px solid transparent; border-top-right-radius: 25px; border-bottom-right-radius: 25px; background-color: rgba(gray, 0.959); font-weight: 700; transition: all 0.2s cubic-bezier(0.55, 0.055, 0.675, 0.19); } [class*="input-url_"] button:hover, [class*="input-url_"] button:focus { color: #ffffff; box-shadow: 0 5px 0 0 rgba(0, 0, 0, 0.9); transform: translate(2.5px, -2.5px) scale(1.05); } [class*="input-url_"]:first-child button:hover, [class*="input-url_"]:first-child button:focus { background-color: blue; } [class*="input-url_"]:last-child button:hover, [class*="input-url_"]:last-child button:focus { background-color: green; } .wrap { position: relative; } .tooltiptext { position: absolute; top: 200%; left: 50%; width: 120px; margin-left: -60px; padding: 5px 0; background-color: green; color: #fff; font-size: 12px; font-weight: 400; text-align: center; border-radius: 10px; z-index: 1; } .tooltiptext::after { content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: transparent transparent green transparent; } .request-info { position: relative; width: 98vw; margin-top: 20px; font-size: 12px; font-weight: 400; text-align: center; } .request-info p.loading { position: absolute; top: 0; width: 100%; color: green; } .request-info p.error { position: absolute; top: 0; width: 100%; color: red; } footer { position: absolute; bottom: 10px; width: 98vw; text-align: center; } @media only screen and (max-width: 1200px) { [class*="input-url_"] { width: 80vw; } } @media only screen and (max-width: 420px) { [class*="input-url_"] { width: 96vw; } [class*="input-url_"]:first-child input { transform: translate(1px, 2px); } [class*="input-url_"]:first-child button { transform: translate(1px, -8px); } .fa-file-archive, .fa-copy { display: none !important; } } @media only screen and (max-width: 380px) { [class*="input-url_"] input { transform: translate(0, -9.5px); } }
17.692308
96
0.665036
07fbe697f1aa410f024f247156bce44550d603bb
7,817
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1032.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1032.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1032.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x929a, %r12 nop nop nop nop add %rax, %rax and $0xffffffffffffffc0, %r12 vmovaps (%r12), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %r9 and %r11, %r11 lea addresses_normal_ht+0x11fda, %rsi lea addresses_A_ht+0x134da, %rdi nop nop inc %r11 mov $92, %rcx rep movsw dec %r11 lea addresses_D_ht+0xdf5a, %rsi lea addresses_WC_ht+0x31a, %rdi clflush (%rdi) cmp %r8, %r8 mov $116, %rcx rep movsq nop nop nop xor $63332, %rdi lea addresses_A_ht+0x1767a, %r8 sub %r11, %r11 movups (%r8), %xmm5 vpextrq $0, %xmm5, %r9 nop nop nop nop and $21478, %r11 lea addresses_WT_ht+0x148da, %rcx nop nop add $65180, %rax movups (%rcx), %xmm4 vpextrq $1, %xmm4, %r11 nop nop nop nop nop inc %r9 lea addresses_WT_ht+0x198da, %rcx nop nop nop nop xor $62153, %r12 mov $0x6162636465666768, %rsi movq %rsi, %xmm0 and $0xffffffffffffffc0, %rcx vmovntdq %ymm0, (%rcx) nop nop cmp %rsi, %rsi lea addresses_D_ht+0x113fa, %rsi lea addresses_normal_ht+0x1063a, %rdi nop nop nop nop nop xor %r12, %r12 mov $124, %rcx rep movsb nop nop nop dec %r12 lea addresses_WC_ht+0x14da, %rsi nop nop nop nop inc %rcx mov (%rsi), %di add $18352, %rcx lea addresses_normal_ht+0xa52a, %rdi nop sub %rax, %rax movl $0x61626364, (%rdi) nop nop nop nop dec %rdi lea addresses_WT_ht+0x5048, %rdi nop nop nop nop xor $41769, %r9 mov (%rdi), %rsi nop nop xor %r11, %r11 lea addresses_UC_ht+0x15ada, %r9 nop nop nop nop nop dec %r8 vmovups (%r9), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rsi nop nop nop and $45718, %rdi lea addresses_WT_ht+0x1c96b, %rcx nop nop nop cmp $48517, %r8 movl $0x61626364, (%rcx) nop nop sub $47958, %r8 lea addresses_A_ht+0x1d2da, %r9 nop nop nop add $57512, %rsi mov (%r9), %r12w nop dec %r12 lea addresses_WT_ht+0x110da, %rsi lea addresses_normal_ht+0x1335a, %rdi nop sub $31670, %rax mov $73, %rcx rep movsb and %r12, %r12 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %rdi push %rdx push %rsi // Store lea addresses_D+0x16640, %r15 nop nop nop nop nop xor %rdi, %rdi movw $0x5152, (%r15) nop nop nop cmp %rsi, %rsi // Faulty Load lea addresses_WC+0x1b8da, %r10 nop nop nop nop inc %r14 mov (%r10), %r12w lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rsi pop %rdx pop %rdi pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': True, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 6}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 6}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': True, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
33.549356
2,999
0.657797
eeb14002322d8a1e96e55a76b4f572924f99479f
2,349
kt
Kotlin
app/src/main/java/space/narrate/waylan/android/ui/search/OrientationPromptModel.kt
narrate-co/waylan_android
c5640fb3bab994fd2c78cabd83fa962fbff75911
[ "Apache-2.0" ]
13
2019-08-12T02:42:41.000Z
2021-02-07T11:26:29.000Z
app/src/main/java/space/narrate/waylan/android/ui/search/OrientationPromptModel.kt
narrate-co/words_android
c5640fb3bab994fd2c78cabd83fa962fbff75911
[ "Apache-2.0" ]
41
2019-09-28T20:53:00.000Z
2021-01-27T15:46:01.000Z
app/src/main/java/space/narrate/waylan/android/ui/search/OrientationPromptModel.kt
narrate-co/waylan_android
c5640fb3bab994fd2c78cabd83fa962fbff75911
[ "Apache-2.0" ]
null
null
null
package space.narrate.waylan.android.ui.search import space.narrate.waylan.android.R import space.narrate.waylan.core.data.prefs.Orientation /** * A sealed class to hold the possible "smart prompts" which can be displayed in the search shelf. * The search shelf is a space just above the search input field which can be expanded to display * contextual prompts. Orientation locking, is one such prompt. * * @property orientationToRequest the [Orientation] which clicking on this prompt should set the * apps orientation [UserPreferenceRepository] * @property message A short message to be displayed in the expanded search shelf area * @property icon An icon to be displayed to the left of [message] in the expanded search shelf area * @property checkedText The textRes to be displayed in the search shelf after the first click on * the prompt, indicating that the prompt has been "checked" or "completed" * @property uncheckedText The textRes to be displayed in the search shelf if the user clicks on * [checkedText], indicating that they want to reverse the "checked" or "completed" prompt. */ sealed class OrientationPromptModel( val orientationToRequest: Orientation, val message: Int, val icon: Int, val checkedText: Int, val uncheckedText: Int ) { class LockToLandscape(orientationToRequest: Orientation) : OrientationPromptModel( orientationToRequest, R.string.orientation_prompt_lock_to_landscape, R.drawable.ic_round_orientation_lock_24px, R.string.orientation_prompt_locked_label, R.string.orientation_prompt_unlocked_label ) class LockToPortrait(orientationToRequest: Orientation) : OrientationPromptModel( orientationToRequest, R.string.orientation_prompt_lock_to_portrait, R.drawable.ic_round_orientation_lock_24px, R.string.orientation_prompt_locked_label, R.string.orientation_prompt_unlocked_label ) class UnlockOrientation(orientationToRequest: Orientation) : OrientationPromptModel( orientationToRequest, R.string.orientation_prompt_unlock_orientation, R.drawable.ic_round_orientation_lock_24px, R.string.orientation_prompt_unlocked_label, R.string.orientation_prompt_locked_label ) }
43.5
100
0.746701
f35a5e84dcc0a6c989fd6b1dfe7b47f20abfacc4
784
swift
Swift
Collider/Workspace/NavigationTab/NavigationTabState.swift
MaxDesiatov/Collider
c63d4c29db40a9b8540dc599d35b65704dc64d40
[ "Apache-2.0" ]
2
2020-12-31T17:13:43.000Z
2021-01-13T15:58:27.000Z
Collider/Workspace/NavigationTab/NavigationTabState.swift
MaxDesiatov/Collider
c63d4c29db40a9b8540dc599d35b65704dc64d40
[ "Apache-2.0" ]
null
null
null
Collider/Workspace/NavigationTab/NavigationTabState.swift
MaxDesiatov/Collider
c63d4c29db40a9b8540dc599d35b65704dc64d40
[ "Apache-2.0" ]
null
null
null
// // Created by Max Desiatov on 10/01/2021. // import ComposableArchitecture struct NavigationTabState: Equatable { var files: FilesState init(root: FileItem?) { files = .init(root: root) } } enum NavigationTabAction { case files(FilesAction) } typealias NavigationTabStore = Store<NavigationTabState, NavigationTabAction> extension NavigationTabStore { var files: FilesStore { scope(state: \.files, action: NavigationTabAction.files) } } typealias NavigationTabReducer = Reducer<NavigationTabState, NavigationTabAction, SystemEnvironment<NavigationTabEnvironment>> let navigationTabReducer = NavigationTabReducer.combine( filesReducer.pullback( state: \.files, action: /NavigationTabAction.files, environment: { $0.map(\.files) } ) )
20.631579
95
0.75
517b4139b18b858e4ea3cf610b19f839a6ca789a
4,230
swift
Swift
Sources/CodableCSV/Strategy.swift
lightsprint09/CodableCSV
dd896a5b18f760ef0cdb5c285316d2eb6e2ac223
[ "MIT" ]
null
null
null
Sources/CodableCSV/Strategy.swift
lightsprint09/CodableCSV
dd896a5b18f760ef0cdb5c285316d2eb6e2ac223
[ "MIT" ]
null
null
null
Sources/CodableCSV/Strategy.swift
lightsprint09/CodableCSV
dd896a5b18f760ef0cdb5c285316d2eb6e2ac223
[ "MIT" ]
null
null
null
import Foundation /// The strategies to use when encoding/decoding. public enum Strategy { /// The strategy to use for non-standard floating-point values (IEEE 754 infinity and NaN). public enum NonConformingFloat { /// Throw upon encountering non-conforming values. This is the default strategy. case `throw` /// Decode the values from the given representation strings. case convertFromString(positiveInfinity: String, negativeInfinity: String, nan: String) } } extension Strategy { /// Indication on whether the CSV file contains headers or not. public enum Header: ExpressibleByNilLiteral, ExpressibleByBooleanLiteral { /// The CSV contains no header row. case none /// The CSV contains a single header row. case firstLine /// It is not known whether the CSV contains a header row. Try to infer it! case unknown public init(nilLiteral: ()) { self = .none } public init(booleanLiteral value: BooleanLiteralType) { self = (value) ? .firstLine : .none } } /// Indication on whether some character set should be trimmed or not at the beginning and ending of a CSV field. public enum Trim: ExpressibleByNilLiteral { /// No characters will be trimmed from the input/output. case none /// White spaces before and after delimiters will be trimmed. case whitespaces /// The given set of characters will be trimmed before and after delimiters. case set(CharacterSet) public init(nilLiteral: ()) { self = .none } } /// The strategy to use for decoding `Date` values. public enum DateDecoding { /// Defer to `Date` for decoding. case deferredToDate /// Decode the `Date` as a UNIX timestamp from a number. case secondsSince1970 /// Decode the `Date` as UNIX millisecond timestamp from a number. case millisecondsSince1970 /// Decode the `Date` as an ISO-8601-formatted string (in RFC 3339 format). case iso8601 /// Decode the `Date` as a string parsed by the given formatter. case formatted(DateFormatter) /// Decode the `Date` as a custom value decoded by the given closure. case custom((_ decoder: Decoder) throws -> Foundation.Date) } /// The strategy to use for decoding `Data` values. public enum DataDecoding { /// Defer to `Data` for decoding. case deferredToData /// Decode the `Data` from a Base64-encoded string. case base64 /// Decode the `Data` as a custom value decoded by the given closure. case custom((_ decoder: Decoder) throws -> Foundation.Data) } } extension Strategy { /// The strategy to use for encoding `Date` values. public enum DateEncoding { /// Defer to `Date` for choosing an encoding. case deferredToDate /// Encode the `Date` as a UNIX timestamp (as a number). case secondsSince1970 /// Encode the `Date` as UNIX millisecond timestamp (as a number). case millisecondsSince1970 /// Encode the `Date` as an ISO-8601-formatted string (in RFC 3339 format). case iso8601 /// Encode the `Date` as a string formatted by the given formatter. case formatted(DateFormatter) /// Encode the `Date` as a custom value encoded by the given closure. /// /// If the closure fails to encode a value into the given encoder, the encoder will encode an empty automatic container in its place. case custom((Date, Encoder) throws -> Void) } /// The strategy to use for encoding `Data` values. public enum DataEncoding { /// Defer to `Data` for choosing an encoding. case deferredToData /// Encoded the `Data` as a Base64-encoded string. case base64 /// Encode the `Data` as a custom value encoded by the given closure. /// /// If the closure fails to encode a value into the given encoder, the encoder will encode an empty automatic container in its place. case custom((Data, Encoder) throws -> Void) } }
41.881188
141
0.643026
fcc7e74aea48f390bdaacbd023b287362c78cae3
2,140
css
CSS
data/usercss/131566.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
118
2020-08-28T19:59:28.000Z
2022-03-26T16:28:40.000Z
data/usercss/131566.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
38
2020-09-02T01:08:45.000Z
2022-01-23T02:47:24.000Z
data/usercss/131566.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
21
2020-08-19T01:12:43.000Z
2022-03-15T21:55:17.000Z
/* ==UserStyle== @name Seasonvar by Serge Esmanovich @namespace USO Archive @author Serge Esmanovich @description `normal ui uses Tampermonkey https://gist.githubusercontent.com/korolariya/c8391c721b744aad3a98eb68f2afccdb/raw/89b80ade44287bcf97cf56eafea9d3e9e1a03c91/Seasonvar` @version 20171101.21.1 @license NO-REDISTRIBUTION @preprocessor uso ==/UserStyle== */ @-moz-document domain("seasonvar.ru") { html { display: none; } body { display: flex; flex-flow: row; flex-wrap: wrap; background: #fff; padding-top: 50px !important; } #mycontent { flex: 10; } #mycontent #grid { display: flex; flex-flow: row; flex-wrap: wrap; } #mycontent .item { flex: 1 0 450px; margin: 12px; text-decoration: none; border: 1px solid #ddd; padding-bottom: 10px; background: #EFF3F2; border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; } #mycontent .item { color: #000; font-size: 14px; padding: 10px; } #sidebar { flex: 1 0 250px; text-align: left; padding: 20px 40px; } #sidebar .betterT { color: #000; } #sidebar .tnt-2link { display: none; } #sidebar .alf-letter { position: relative; cursor: pointer; } #sidebar #ifilter label { color: #000; } #header { display: block; width: 100%; height: 40px; background: #333; text-align: center; padding-top: 15px; position: fixed; top: 0px; z-index: 6; } #header form { display: inline-block; } #header form input.form-textnew { position: relative; top: auto; display: block; float: left; width: 300px; font-size: 14px; } #header form input.form-searchnew { left: auto; position: relative; top: auto; display: block; height: 25px; } .searchResult { text-align: left; font-size: 14px; } .item .serial-r p { color: #000; } .item .serial-r div { color: #000; } body .sidebar.lside { left: 0px; } .pgs-sinfo, .pgs-seaslist, #player_wrap { max-width: 800px; margin: 0 auto; } #player_wrap { padding-bottom: 100px; } .pgs-sinfo { padding-top: 20px; } }
18.290598
179
0.647664
2134c1a942d09f9ea72d79852867a570f07aeeab
2,303
kt
Kotlin
src/main/kotlin/com/projectcitybuild/plugin/commands/BanIPCommand.kt
andyksaw/PCBridge
bd146b31bab402789efd8edaee6addba1b8b33da
[ "MIT" ]
3
2016-06-16T06:08:32.000Z
2017-02-03T03:23:32.000Z
src/main/kotlin/com/projectcitybuild/plugin/commands/BanIPCommand.kt
andimage/PCBridge
bd146b31bab402789efd8edaee6addba1b8b33da
[ "MIT" ]
5
2015-10-02T16:44:36.000Z
2017-02-05T04:46:13.000Z
src/main/kotlin/com/projectcitybuild/plugin/commands/BanIPCommand.kt
andimage/PCBridge
bd146b31bab402789efd8edaee6addba1b8b33da
[ "MIT" ]
3
2016-06-20T04:42:28.000Z
2017-02-02T03:15:23.000Z
package com.projectcitybuild.plugin.commands import com.projectcitybuild.core.extensions.joinWithWhitespaces import com.projectcitybuild.core.utilities.Failure import com.projectcitybuild.core.utilities.Success import com.projectcitybuild.features.bans.usecases.BanIPUseCase import com.projectcitybuild.modules.textcomponentbuilder.send import com.projectcitybuild.plugin.environment.SpigotCommand import com.projectcitybuild.plugin.environment.SpigotCommandInput import com.projectcitybuild.plugin.exceptions.InvalidCommandArgumentsException import org.bukkit.Server import org.bukkit.command.CommandSender import javax.inject.Inject class BanIPCommand @Inject constructor( private val server: Server, private val banIPUseCase: BanIPUseCase, ) : SpigotCommand { override val label = "banip" override val permission = "pcbridge.ban.banip" override val usageHelp = "/banip <name|ip> [reason]" override suspend fun execute(input: SpigotCommandInput) { if (input.args.isEmpty()) { throw InvalidCommandArgumentsException() } val targetIP = server.onlinePlayers .firstOrNull { it.name.lowercase() == input.args.first().lowercase() } ?.address?.toString() ?: input.args.first() val result = banIPUseCase.banIP( ip = targetIP, bannerName = if (input.isConsole) null else input.sender.name, reason = input.args.joinWithWhitespaces(1 until input.args.size), ) when (result) { is Failure -> input.sender.send().error( when (result.reason) { BanIPUseCase.FailureReason.IP_ALREADY_BANNED -> "$targetIP is already banned" BanIPUseCase.FailureReason.INVALID_IP -> "$targetIP is not a valid IP" } ) is Success -> input.sender.send().success("IP $targetIP has been banned") } } override fun onTabComplete(sender: CommandSender?, args: List<String>): Iterable<String>? { return when { args.isEmpty() -> server.onlinePlayers.map { it.name } args.size == 1 -> server.onlinePlayers.map { it.name }.filter { it.lowercase().startsWith(args.first().lowercase()) } else -> null } } }
39.706897
129
0.675206
c3c2d0d3a641082dae21a970eec90b5d69d33f81
1,897
kt
Kotlin
app/src/main/java/com/pichu/nanamare/camera/filter/mx/MxToyFilter.kt
Nanamare/opengl_camera
e5ac27b1d873152be817e73cf3e382bd8b233638
[ "MIT" ]
5
2020-06-01T16:24:38.000Z
2021-12-24T08:47:58.000Z
app/src/main/java/com/pichu/nanamare/camera/filter/mx/MxToyFilter.kt
Nanamare/opengl_camera
e5ac27b1d873152be817e73cf3e382bd8b233638
[ "MIT" ]
null
null
null
app/src/main/java/com/pichu/nanamare/camera/filter/mx/MxToyFilter.kt
Nanamare/opengl_camera
e5ac27b1d873152be817e73cf3e382bd8b233638
[ "MIT" ]
null
null
null
package com.pichu.nanamare.camera.filter.mx import android.content.Context import android.opengl.GLES20 import com.pichu.nanamare.R import com.pichu.nanamare.camera.MyGLUtils class MxToyFilter(context: Context, filterName: String) : MultiTextureFilter(context, filterName) { private val program: Int = MyGLUtils.buildProgram(context, R.raw.shader_vertext, R.raw.mx_toy) init { setTexture2Id(intArrayOf(0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 74, 75, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103, 105, 106, 108, 110, 111, 113, 114, 116, 118, 119, 121, 123, 125, 126, 128, 130, 131, 133, 135, 136, 138, 140, 142, 143, 145, 147, 148, 150, 152, 154, 155, 157, 159, 160, 162, 164, 165, 167, 168, 170, 172, 173, 175, 177, 178, 180, 181, 183, 184, 186, 187, 189, 190, 192, 193, 195, 196, 197, 199, 200, 201, 203, 204, 205, 206, 208, 209, 210, 211, 212, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 230, 231, 232, 233, 234, 234, 235, 236, 236, 237, 238, 239, 239, 240, 240, 241, 242, 242, 243, 243, 244, 245, 245, 246, 246, 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255)) } public override fun onDraw(cameraTexId: Int, canvasWidth: Int, canvasHeight: Int) { setupShaderInputs( program, intArrayOf(canvasWidth, canvasHeight), intArrayOf(cameraTexId, texture2Id!!), arrayOf() ) GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4) } }
79.041667
1,164
0.609383
b196dca78e186fd35cd90016ce3af5aab4a9a712
3,720
h
C
custom_widgets/donut_pie_widget.h
GPUOpen-Tools/qt_common
db1e003df850e7790586bf62237623a80dcc222b
[ "MIT" ]
3
2020-10-07T20:40:41.000Z
2022-03-19T01:39:42.000Z
custom_widgets/donut_pie_widget.h
GPUOpen-Tools/qt_common
db1e003df850e7790586bf62237623a80dcc222b
[ "MIT" ]
null
null
null
custom_widgets/donut_pie_widget.h
GPUOpen-Tools/qt_common
db1e003df850e7790586bf62237623a80dcc222b
[ "MIT" ]
2
2020-10-07T20:40:42.000Z
2020-10-28T22:18:49.000Z
//============================================================================= /// Copyright (c) 2016-2020 Advanced Micro Devices, Inc. All rights reserved. /// \author AMD Developer Tools Team /// \file /// \brief Header for a donut pie widget. /// /// This is like a pie chart, but with a hole in the center. //============================================================================= #ifndef QTCOMMON_CUSTOM_WIDGETS_DONUT_PIE_WIDGET_H_ #define QTCOMMON_CUSTOM_WIDGETS_DONUT_PIE_WIDGET_H_ #include <QWidget> /// A donut pie widget. class DonutPieWidget : public QWidget { Q_OBJECT public: /// Explicit constructor /// \param parent The parent widget explicit DonutPieWidget(QWidget* parent); /// Virtual destructor virtual ~DonutPieWidget(); /// Custom sizeHint implementation that supports DPI scaling. /// \return A default sizeHint since the size of this widget can grow to fit /// the space allowed by the layout. virtual QSize sizeHint() const Q_DECL_OVERRIDE; /// Set the number of segments for this control. This is the number of /// unique data elements to be shown in this control /// \param numSegments the number of segments needed void SetNumSegments(unsigned int numSegments); /// Set the value for the given index for the control. /// \param index the index whose value is to change /// \param value the new value to use void SetIndexValue(unsigned int index, qreal value); /// Set the fill color for the given index for the control. /// \param index the index whose color is to change /// \param fillColor the color to use void SetIndexColor(unsigned int index, const QColor& fillColor); /// Set the text to be displayed in the pie segment. /// \param index the index whose text is to change /// \param text the text to be shown void SetIndexText(unsigned int index, const QString& text); /// Set how wide the donut section should be. /// \param arcWidth the width of the donut arc void SetArcWidth(qreal arcWidth); /// Set the first line of text inside the donut /// \param text Text to set void SetTextLineOne(const QString& text); /// Set the second line of text inside the donut /// \param text Text to set void SetTextLineTwo(const QString& text); protected: /// Implementation of Qt's paint for this item. /// \param paint_event The paint event. virtual void paintEvent(QPaintEvent* paint_event) Q_DECL_OVERRIDE; private: class SliceData { public: SliceData() : value_(0) , fill_color_(Qt::black) , slice_text_() { } ~SliceData() { } qreal value_; ///< current control value to represent QColor fill_color_; ///< color used to fill the value part of the arc. QString slice_text_; ///< Additional text description }; /// Default width and height of the widget. const int kDefaultWidthAndHeight_ = 200; /// Default font pixel-size for writing the value. const int kValuePixelFontSize_ = 36; /// Default font pixel-size for writing the text. const int kTextPixelFontSize_ = 14; /// Vector of slice data. QVector<SliceData> slices_; unsigned int num_segments_; ///< number of segments (values) in the pie control qreal arc_width_; ///< width of the control arc, in pixels. This is used as the size of the pen used to draw the arc QString text_line_one_; ///< text in the center of the donut QString text_line_two_; ///< text in the center of the donut }; #endif // QTCOMMON_CUSTOM_WIDGETS_DONUT_PIE_WIDGET_H_
34.12844
132
0.64543
41578e1137d60580cd3ab6bf763ab4964b596c8d
4,042
h
C
cyclone_tcp/mdns/mdns_responder.h
Velleman/VM204-Firmware
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
[ "MIT" ]
4
2016-04-17T00:48:37.000Z
2020-03-17T01:42:20.000Z
cyclone_tcp/mdns/mdns_responder.h
Velleman/VM204-Firmware
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
[ "MIT" ]
null
null
null
cyclone_tcp/mdns/mdns_responder.h
Velleman/VM204-Firmware
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
[ "MIT" ]
6
2016-04-17T00:48:41.000Z
2022-01-28T13:50:45.000Z
/** * @file mdns_responder.h * @brief mDNS responder (Multicast DNS) * * @section License * * Copyright (C) 2010-2015 Oryx Embedded SARL. All rights reserved. * * This file is part of CycloneTCP Open. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Oryx Embedded SARL (www.oryx-embedded.com) * @version 1.6.0 **/ #ifndef _MDNS_RESPONDER_H #define _MDNS_RESPONDER_H //Dependencies #include "core/net.h" #include "core/udp.h" #include "dns/dns_common.h" //mDNS responder support #ifndef MDNS_RESPONDER_SUPPORT #define MDNS_RESPONDER_SUPPORT ENABLED #elif (MDNS_RESPONDER_SUPPORT != ENABLED && MDNS_RESPONDER_SUPPORT != DISABLED) #error MDNS_RESPONDER_SUPPORT parameter is not valid #endif //mDNS responder tick interval #ifndef MDNS_TICK_INTERVAL #define MDNS_TICK_INTERVAL 250 #elif (MDNS_TICK_INTERVAL < 100) #error MDNS_TICK_INTERVAL parameter is not valid #endif //Initial random delay #ifndef MDNS_INIT_DELAY #define MDNS_INIT_DELAY 250 #elif (MDNS_INIT_DELAY < 0) #error MDNS_INIT_DELAY parameter is not valid #endif //Number of probe packets #ifndef MDNS_PROBE_NUM #define MDNS_PROBE_NUM 3 #elif (MDNS_PROBE_NUM < 1) #error MDNS_PROBE_NUM parameter is not valid #endif //Time interval between subsequent probe packets #ifndef MDNS_PROBE_DELAY #define MDNS_PROBE_DELAY 250 #elif (MDNS_PROBE_DELAY < 100) #error MDNS_PROBE_DELAY parameter is not valid #endif //Number of announcement packets #ifndef MDNS_ANNOUNCE_NUM #define MDNS_ANNOUNCE_NUM 2 #elif (MDNS_ANNOUNCE_NUM < 1) #error MDNS_ANNOUNCE_NUM parameter is not valid #endif //Time interval between subsequent announcement packets #ifndef MDNS_ANNOUNCE_DELAY #define MDNS_ANNOUNCE_DELAY 1000 #elif (MDNS_ANNOUNCE_DELAY < 100) #error MDNS_ANNOUNCE_DELAY parameter is not valid #endif /** * @brief mDNS responder states **/ typedef enum { MDNS_STATE_INIT, MDNS_STATE_PROBING, MDNS_STATE_ANNOUNCING, MDNS_STATE_DONE, MDNS_STATE_ERROR } MdnsState; /** * @brief mDNS responder context **/ typedef struct { MdnsState state; ///<mDNS responder state bool_t conflict; ///<Conflict detected systime_t timestamp; ///<Timestamp to manage retransmissions systime_t timeout; ///<Timeout value uint_t counter; ///<Packet counter } MdnsContext; //mDNS related functions error_t mdnsResponderInit(NetInterface *interface); error_t mdnsStartProbing(NetInterface *interface); void mdnsTick(NetInterface *interface); void mdnsLinkChangeEvent(NetInterface *interface); void mdnsProcessQuery(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const DnsHeader *query, size_t queryLen); error_t mdnsSendProbe(NetInterface *interface); error_t mdnsSendAnnouncement(NetInterface *interface); NetBuffer *mdnsCreateResponse(uint16_t id, size_t *offset, DnsHeader **response, size_t *responseLen); error_t mdnsSendResponse(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, NetBuffer *buffer, size_t offset, size_t length); error_t mdnsAddIpv4ResourceRecord(NetInterface *interface, DnsHeader *message, size_t *length, bool_t flush); error_t mdnsAddIpv6ResourceRecord(NetInterface *interface, DnsHeader *message, size_t *length, bool_t flush); error_t mdnsGenerateHostname(NetInterface *interface); #endif
28.464789
85
0.771648
7142dacf36ef4e14d2d7d4dd237e8bcd3c398f88
996
ts
TypeScript
src/database/migration-undefined/1632032535561-review.ts
sambhab31/scp-qa-backend
8e0f64cf3c69ad9532afe42e300bc7a938fc68d0
[ "MIT" ]
null
null
null
src/database/migration-undefined/1632032535561-review.ts
sambhab31/scp-qa-backend
8e0f64cf3c69ad9532afe42e300bc7a938fc68d0
[ "MIT" ]
null
null
null
src/database/migration-undefined/1632032535561-review.ts
sambhab31/scp-qa-backend
8e0f64cf3c69ad9532afe42e300bc7a938fc68d0
[ "MIT" ]
null
null
null
import {MigrationInterface, QueryRunner} from "typeorm"; export class review1632032535561 implements MigrationInterface { name = 'review1632032535561' public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(`CREATE TABLE "reviews" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "is_active" boolean NOT NULL DEFAULT true, "is_archived" boolean NOT NULL DEFAULT false, "create_date_time" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "created_by" character varying(300) NOT NULL DEFAULT 'self', "last_changed_date_time" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "last_changed_by" character varying(300) NOT NULL DEFAULT 'self', "internal_comment" character varying(300), "video_hash" character varying NOT NULL, "review" jsonb NOT NULL, CONSTRAINT "PK_231ae565c273ee700b283f15c1d" PRIMARY KEY ("id"))`); } public async down(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(`DROP TABLE "reviews"`); } }
66.4
637
0.758032
ca41c2a5eed0d8c2a84f41f4496464d8d8f8b664
371
asm
Assembly
programs/oeis/131/A131668.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/131/A131668.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/131/A131668.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A131668: Smallest number whose sum of digits is 2n+1. ; 1,3,5,7,9,29,49,69,89,199,399,599,799,999,2999,4999,6999,8999,19999,39999,59999,79999,99999,299999,499999,699999,899999,1999999,3999999,5999999,7999999,9999999,29999999,49999999,69999999,89999999,199999999 add $0,5 cal $0,133296 ; Smallest number whose sum of digits is 2n. mov $1,$0 div $1,20 mul $1,2 add $1,1
37.1
207
0.757412
5ec4ce5f79e98a39bd4858be4f5a345e36a04b64
1,652
kt
Kotlin
buildSrc/src/main/java/Versions.kt
Ahmed-Abdelmeged/sailer
b9d46cd0c3d7aa3841e5020506be84f4038d9fe3
[ "MIT" ]
38
2020-06-20T18:35:36.000Z
2022-03-14T10:00:16.000Z
buildSrc/src/main/java/Versions.kt
Ahmed-Abdelmeged/sailer
b9d46cd0c3d7aa3841e5020506be84f4038d9fe3
[ "MIT" ]
1
2021-03-08T10:32:53.000Z
2021-03-08T14:24:01.000Z
buildSrc/src/main/java/Versions.kt
Ahmed-Abdelmeged/sailer
b9d46cd0c3d7aa3841e5020506be84f4038d9fe3
[ "MIT" ]
5
2020-06-22T09:45:40.000Z
2022-01-13T18:19:53.000Z
/** * Created by Ahmed Abd-Elmeged on 4/18/20. */ object Versions { object Build { const val gradlePlugin = "4.0.1" } object Kotlin { const val kotlin = "1.3.72" const val detekt = "1.9.1" const val ktlint = "9.2.1" } object AndroidX { const val appcompat = "1.2.0" const val fragment = "1.3.0-alpha07" const val activity = "1.2.0-alpha07" const val constraintlayout = "2.0.0-beta8" const val ktx = "1.3.1" const val swiperefreshlayout = "1.1.0" const val recyclerview = "1.2.0-alpha05" } object Jetpack { const val lifecycle = "2.2.0" const val room = "2.2.5" const val navigation = "2.3.0" } object Google { const val material = "1.1.0" } object Libraries { const val glide = "4.11.0" const val timber = "4.7.1" const val dagger = "2.28.3" const val rxjava = "2.2.19" const val rxandroid = "2.1.1" const val retrofit = "2.9.0" const val moshi = "1.9.3" const val okhttp = "4.8.0" const val assistedInject = "0.5.2" const val lint = "26.6.3" } object Test { const val junit = "4.13" const val core = "1.2.0" const val mockitokotlin = "2.2.0" const val robolectric = "4.3.1" const val jacoco = "0.8.5" } object AndroidTest { const val junit = "1.1.0" const val rules = "1.1.1" const val runner = "1.1.1" const val espresso = "3.1.1" const val truth = "1.1.0" const val mockito = "3.3.3" } }
25.415385
50
0.517554
70fc33a3b3b286943920038021dc450180303a3c
757
go
Go
pkg/doppelganger/version_test.go
RokyErickson/doppelganger
300c85aa5dff1d3860db47057c7f4093c701aba3
[ "MIT" ]
null
null
null
pkg/doppelganger/version_test.go
RokyErickson/doppelganger
300c85aa5dff1d3860db47057c7f4093c701aba3
[ "MIT" ]
null
null
null
pkg/doppelganger/version_test.go
RokyErickson/doppelganger
300c85aa5dff1d3860db47057c7f4093c701aba3
[ "MIT" ]
null
null
null
package doppelganger import ( "bytes" "testing" ) func TestVersionSendReceiveAndCompare(t *testing.T) { buffer := &bytes.Buffer{} if err := SendVersion(buffer); err != nil { t.Fatal("unable to send version:", err) } if buffer.Len() != 12 { t.Fatal("buffer does not contain expected byte count") } if match, err := ReceiveAndCompareVersion(buffer); err != nil { t.Fatal("unable to receive version:", err) } else if !match { t.Error("version mismatch on receive") } } func TestVersionReceiveAndCompareEmptyBuffer(t *testing.T) { buffer := &bytes.Buffer{} match, err := ReceiveAndCompareVersion(buffer) if err == nil { t.Error("version received from empty buffer") } if match { t.Error("version match on empty buffer") } }
19.410256
64
0.68428
be5db8a89830c2c2413bfd90c17a46811b342dd1
42
rs
Rust
frontend/apps/crates/components/src/module/_groups/cards/edit/main/mod.rs
mastapegs/ji-cloud
b572289c5987f5e937f5e030fbd2712229ea1204
[ "Apache-2.0", "MIT" ]
12
2020-12-07T13:21:05.000Z
2022-03-26T23:00:47.000Z
frontend/apps/crates/components/src/module/_groups/cards/edit/main/mod.rs
mastapegs/ji-cloud
b572289c5987f5e937f5e030fbd2712229ea1204
[ "Apache-2.0", "MIT" ]
1,736
2020-08-06T06:06:04.000Z
2022-03-31T18:25:39.000Z
frontend/apps/crates/components/src/module/_groups/cards/edit/main/mod.rs
mastapegs/ji-cloud
b572289c5987f5e937f5e030fbd2712229ea1204
[ "Apache-2.0", "MIT" ]
16
2020-11-20T09:18:41.000Z
2021-12-16T11:40:47.000Z
pub mod dom; pub mod pair; pub mod state;
10.5
14
0.714286
456800d7edf39218a8d756fa968d830178bbc589
174
kt
Kotlin
mint/src/main/java/io/mhssn/mint/annotations/Key.kt
mhssn95/Mint
d6a3357054fc5d83de40505251227c6bc3f43750
[ "Apache-2.0" ]
11
2021-04-05T17:39:31.000Z
2021-12-03T19:03:38.000Z
mint/src/main/java/io/mhssn/mint/annotations/Key.kt
mhssn95/Mint
d6a3357054fc5d83de40505251227c6bc3f43750
[ "Apache-2.0" ]
null
null
null
mint/src/main/java/io/mhssn/mint/annotations/Key.kt
mhssn95/Mint
d6a3357054fc5d83de40505251227c6bc3f43750
[ "Apache-2.0" ]
1
2021-08-25T04:26:48.000Z
2021-08-25T04:26:48.000Z
package io.mhssn.mint.annotations @Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.RUNTIME) annotation class Key(val key: String)
34.8
61
0.850575
cb8c34ac53abc86cbb99eab93e037dcac96d39a5
163
go
Go
engine/analytics/model.go
MrIceman/chasqi
e88b32fc92903282e19863d5c177a4a2fdc67f83
[ "Apache-2.0" ]
2
2021-07-05T21:09:58.000Z
2022-02-18T23:40:40.000Z
engine/analytics/model.go
MrIceman/chasqi
e88b32fc92903282e19863d5c177a4a2fdc67f83
[ "Apache-2.0" ]
null
null
null
engine/analytics/model.go
MrIceman/chasqi
e88b32fc92903282e19863d5c177a4a2fdc67f83
[ "Apache-2.0" ]
null
null
null
package analytics type LogEntry struct { StatusCode int Path string ResponseTimeInMs int ResponseBody string Method string }
16.3
24
0.650307
d5a7a79d9751dfdd3bb52de491aa3eaa7cc46a01
10,027
h
C
include/ConstString.h
Redchards/PeParser
cfe6a02b2be15d46067df36d9cbec4ae224c6518
[ "MIT" ]
1
2020-11-10T02:31:47.000Z
2020-11-10T02:31:47.000Z
include/ConstString.h
Redchards/PeParser
cfe6a02b2be15d46067df36d9cbec4ae224c6518
[ "MIT" ]
null
null
null
include/ConstString.h
Redchards/PeParser
cfe6a02b2be15d46067df36d9cbec4ae224c6518
[ "MIT" ]
1
2020-11-10T02:31:56.000Z
2020-11-10T02:31:56.000Z
#pragma once #include <stdexcept> #include <Configuration.h> // There's a warning about "multiple copy constructor specified". // We can safely silence them out, as it should not be like this. // The warning is due to the fact that a non-const iterator can be copied to a const iterator, but not // the other way. So, a non-const iterator has a copy constructor AND a constructor accepting a const // iterator argument. But for const iterator class, this constructor is disabled. // It does work as expected in clang and gcc, but not un visual studio yet. At least, this is only // a warning and not an error (constructor implementations are the same anyway). #pragma warning(push) #pragma warning(disable : 4521) template<class ArrayClass> class ArrayIteratorPolicy { protected: template<bool constFlag> class BaseIterator : public std::iterator<std::bidirectional_iterator_tag, ArrayClass> { friend BaseIterator<!constFlag>; protected: using indexType = typename std::conditional<constFlag, const size_t, size_t>::type; public: using value_type = typename ArrayClass::value_type; using reference = typename std::conditional<constFlag, const typename std::remove_cv<value_type>::type&, value_type&>::type; using pointer = typename std::conditional<constFlag, const typename std::remove_cv<value_type>::type*, value_type*>::type; public: constexpr BaseIterator() = delete; constexpr BaseIterator(const ArrayClass& rhs, indexType index) : it_(rhs), index_(index) {} constexpr BaseIterator(const BaseIterator& other) : it_(other.it_), index_(other.index_) {} template<bool TconstFlag = constFlag, typename std::enable_if<TconstFlag == true, bool>::type = false> constexpr BaseIterator(const BaseIterator<false>& other) : it_(other.it_), index_(other.index_) {} template<bool TconstFlag> constexpr bool operator==(const BaseIterator<TconstFlag>& rhs) const noexcept { return ((index_ == rhs.index_) && (it_ == rhs.it_)); } template<bool TconstFlag> constexpr bool operator!=(const BaseIterator<TconstFlag>& rhs) const noexcept { return !(*this == rhs); } constexpr typename std::remove_cv<value_type>::type operator*() const { return it_[index_]; } constexpr pointer operator->() const { return &(it_[index_]); } constexpr operator BaseIterator<true>() const noexcept { return{ it_, index_ }; } protected: const ArrayClass& it_; indexType index_; }; template<bool constFlag> class ReverseIterator; template<bool constFlag> class Iterator : public BaseIterator<constFlag> { protected: using Base = BaseIterator<constFlag>; using indexType = typename Base::indexType; friend Iterator<!constFlag>; public: using value_type = typename Base::value_type; using reference = typename Base::reference; using pointer = typename Base::pointer; public: constexpr Iterator(const ArrayClass& rhs, indexType index) noexcept : Base(rhs, index) {} constexpr Iterator(const Iterator& other) noexcept : Base(other) {} template<bool TconstFlag = constFlag, typename std::enable_if<TconstFlag == true, bool>::type = false> constexpr Iterator(const Iterator<false>& other) noexcept : Base(other) {} constexpr Iterator(const ReverseIterator<constFlag>& other) noexcept : Base(other) {} template<bool TconstFlag = constFlag, typename std::enable_if<TconstFlag == true, bool>::type = false> constexpr Iterator(const ReverseIterator<false>& other) noexcept : Base(other) {} constexpr Iterator& operator++() const noexcept { ++(this->index_); return *this; } constexpr Iterator operator++(int) const noexcept { Iterator tmp{ *this }; ++(this->index_); return tmp; } constexpr Iterator& operator--() const noexcept { --(this->index_); return *this; } constexpr Iterator operator--(int) const noexcept { Iterator tmp{ *this }; --(this->index_); return tmp; } }; template<bool constFlag> class ReverseIterator : public Iterator<constFlag> { protected: using Base = Iterator<constFlag>; using indexType = typename Base::indexType; friend ReverseIterator<!constFlag>; public: using value_type = typename Base::value_type; using reference = typename Base::reference; using pointer = typename Base::pointer; public: // Right now, this constructor do not work (visual studio 2015 update 1). I guess it's again the bad implementation of templates // and two pass lookup that do not play in our favor //constexpr ReverseIterator(const ArrayClass& rhs, indexType index) noexcept : Base(rhs, index) {} constexpr ReverseIterator(const ReverseIterator& other) noexcept : Base(other) {} template<bool TconstFlag = constFlag, typename std::enable_if<TconstFlag == true, bool>::type = false> constexpr ReverseIterator(const ReverseIterator<false>& other) noexcept : Base(other.it_, other.index_) {} constexpr ReverseIterator(const Iterator<constFlag>& other) noexcept : Base(other) {} template<bool TconstFlag = constFlag, typename std::enable_if<TconstFlag == true, bool>::type = false> constexpr ReverseIterator(const Iterator<false>& other) noexcept : Base(other) {} constexpr ReverseIterator& operator++() const noexcept { return static_cast<ReverseIterator&>(Base::operator--()); } constexpr ReverseIterator operator++(int) const noexcept { return Base::operator--(0); } constexpr ReverseIterator& operator--() const noexcept { return static_cast<ReverseIterator&>(Base::operator++()); } constexpr ReverseIterator operator--(int) const noexcept { return Base::operator++(0); } constexpr typename std::remove_cv<value_type>::type operator*() const { return this->it_[this->index_ - 1]; } constexpr pointer operator->() const { return &(this->it_[this->index_ - 1]); } }; public: using iterator = Iterator<false>; using reverse_iterator = ReverseIterator<false>; using const_iterator = Iterator<true>; using const_reverse_iterator = ReverseIterator<true>; }; #pragma warning(pop) class ConstString { using IterPolicy = ArrayIteratorPolicy<ConstString>; public: using value_type = const char; using reference = const char&; using pointer = const char*; public: // Serve for the sole purpose of begin able to be literal type even with default constructor constexpr ConstString() : size_(0), cstr_("") {} template<size_t size> constexpr ConstString(const char(&cstr)[size]) noexcept : size_(size - 1), cstr_(cstr) {} constexpr char at(size_t index) const { return (index < size_ ? cstr_[index] : throw std::out_of_range("Attempt to access a non-existing index of a constant string")); } constexpr char operator[](size_t index) const { return at(index); } // Modified to build with visual studio. Gcc and clang do not need recursion, simple if branches and for loop are working. friend constexpr bool operator==(const ConstString& lhs, const ConstString& rhs) { return lhs.size() != rhs.size() ? false : equalAux(lhs.size(), lhs, rhs); } constexpr operator const char*() const noexcept { return cstr_; } constexpr size_t size() const noexcept { return size_; } using iterator = typename IterPolicy::iterator; using reverse_iterator = typename IterPolicy::reverse_iterator; using const_iterator = typename IterPolicy::const_iterator; using const_reverse_iterator = typename IterPolicy::const_reverse_iterator; constexpr iterator begin() const noexcept { return{ *this, 0 }; } constexpr const_iterator cbegin() const noexcept { return begin(); } constexpr iterator end() const noexcept { return{ *this, size() }; } constexpr const_iterator cend() const noexcept { return end(); } constexpr reverse_iterator rbegin() const noexcept { return end(); } constexpr const_reverse_iterator crbegin() const noexcept { return end(); } constexpr reverse_iterator rend() const noexcept { return begin(); } constexpr const_reverse_iterator crend() const noexcept { return begin(); } friend constexpr bool equalAux(size_type size, const ConstString& lhs, const ConstString& rhs) { return size != 0 ? ((lhs[size - 1] == rhs[size - 1] && equalAux(size - 1, lhs, rhs))) : true; } private: size_t size_; const char* cstr_; }; template<size_t Tsize> class StaticString { using IterPolicy = ArrayIteratorPolicy<StaticString<Tsize>>; public: // Serve for the sole purpose of begin able to be literal type even with default constructor constexpr StaticString() : cstr_("") {} template<size_t otherSize> constexpr StaticString(const char(&cstr)[otherSize]) : cstr_(cstr) {} constexpr char operator[](size_t index) const { return (index < Tsize ? cstr_[index] : throw std::out_of_range("Attempt to access a non-existing index of a constant string")); } constexpr operator const char*() const noexcept { return cstr_; } constexpr size_t size() const noexcept { return Tsize; } using iterator = typename IterPolicy::iterator; using reverse_iterator = typename IterPolicy::reverse_iterator; using const_iterator = typename IterPolicy::const_iterator; using const_reverse_iterator = typename IterPolicy::const_reverse_iterator; constexpr iterator begin() const noexcept { return{ *this, 0 }; } constexpr const_iterator cbegin() const noexcept { return begin(); } constexpr iterator end() const noexcept { return{ *this, size() }; } constexpr const_iterator cend() const noexcept { return end(); } constexpr reverse_iterator rbegin() const noexcept { return end(); } constexpr const_reverse_iterator crbegin() const noexcept { return end(); } constexpr reverse_iterator rend() const noexcept { return begin(); } constexpr const_reverse_iterator crend() const noexcept { return begin(); } template<size_type TSize1, size_type TSize2> constexpr bool equalAux(size_type size, const StaticString<TSize1>& lhs, const StaticString<TSize2>& rhs) { return TSize1 != 0 ? ((lhs[TSize1 - 1] == rhs[TSize1 - 1] && equalAux(TSize1 - 1, lhs, rhs))) : true; } private: const char* cstr_; };
34.339041
136
0.72973
4c2b6beded1e5335b2f891be87badc22e7f5c689
567
asm
Assembly
programs/oeis/145/A145934.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/145/A145934.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/145/A145934.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A145934: Expansion of 1/(1-x*(1-6*x)). ; 1,1,-5,-11,19,85,-29,-539,-365,2869,5059,-12155,-42509,30421,285475,102949,-1609901,-2227595,7431811,20797381,-23793485,-148577771,-5816861,885649765,920550931,-4393347659,-9916653245,16443432709,75943352179,-22717244075,-478377357149,-342073892699,2528190250195,4580633606389,-10588507894781,-38072309533115,25458737835571,253892595034261,101140168020835,-1422215402184731,-2029056410309741,6504236002798645 mov $1,2 mov $2,2 lpb $0,1 sub $0,1 mul $1,6 sub $2,$1 add $1,$2 lpe sub $1,2 div $1,12 mul $1,6 add $1,1
35.4375
410
0.756614
3458dc92aad4c0beb58b1aed1aadc47ee6a27b27
235
swift
Swift
wallet/Protocols/Gradientable.swift
pietrobasso/WalletApp
17ebf604c33043093c504b0cbfba5b231ee99f4a
[ "MIT" ]
5
2019-02-17T13:45:12.000Z
2021-08-31T14:33:33.000Z
wallet/Protocols/Gradientable.swift
pietrobasso/WalletApp
17ebf604c33043093c504b0cbfba5b231ee99f4a
[ "MIT" ]
null
null
null
wallet/Protocols/Gradientable.swift
pietrobasso/WalletApp
17ebf604c33043093c504b0cbfba5b231ee99f4a
[ "MIT" ]
1
2020-06-04T04:05:38.000Z
2020-06-04T04:05:38.000Z
// // Gradientable.swift // wallet // // Created by Pietro Basso on 15/02/2019. // Copyright © 2019 Pietro Basso. All rights reserved. // import UIKit protocol Gradientable { var gradientLayer: CAGradientLayer? { get set } }
16.785714
55
0.689362
33190b249bfea8e389858313a9b36fc7c3e017ce
1,605
py
Python
ggtools/gg/static_models.py
richannan/GGTOOLS
7909da988d90de50c82532d97121a3fbcfc0263a
[ "MIT" ]
22
2019-12-16T01:30:29.000Z
2022-03-01T08:57:07.000Z
ggtools/gg/static_models.py
richannan/GGTOOLS
7909da988d90de50c82532d97121a3fbcfc0263a
[ "MIT" ]
3
2019-12-23T14:09:30.000Z
2022-03-29T01:52:53.000Z
ggtools/gg/static_models.py
richannan/GGTOOLS
7909da988d90de50c82532d97121a3fbcfc0263a
[ "MIT" ]
13
2019-12-19T07:01:19.000Z
2022-03-14T11:26:36.000Z
from os import path,makedirs from urllib.request import urlretrieve def static_download(model): ''' Download static gravity modle from icgem.gfz-potsdam.de; if the file to be downloaded is already included in the download directory, the download is automatically skipped. Usage: static_download('GGM05C') static_download('EIGEN-6C4') Inputs: model -> [str] Available options are 'GGM05C' and 'EIGEN-6C'. Outputs: downloaded static gravity model Examples: >>> static_download('GGM05C') Downloading the static gravity model GGM05C ... Finished 'static_models/GGM05C.gfc' >>> static_download('EIGEN-6C4') Downloading the static gravity model EIGEN-6C4 ... Finished 'static_models/EIGEN-6C4.gfc' ''' direc = 'static_models/' if not path.exists(direc): makedirs(direc) if model == 'GGM05C': gravity_file = direc + 'GGM05C.gfc' url = 'http://icgem.gfz-potsdam.de/getmodel/gfc/778a683780a5b0ad3163f4772b97b9075a0a13c389d2bd8ea3f891b64cfa383d/GGM05C.gfc' elif model == 'EIGEN-6C4': gravity_file = direc + 'EIGEN-6C4.gfc' url = 'http://icgem.gfz-potsdam.de/getmodel/gfc/7fd8fe44aa1518cd79ca84300aef4b41ddb2364aef9e82b7cdaabdb60a9053f1/EIGEN-6C4.gfc' else: raise Exception('Currently, available static gravity models are GGM05C and EIGEN-6C4.') if not path.exists(gravity_file): print('Downloading the static gravity model '+ model,end=' ... ') urlretrieve(url, gravity_file) print('Finished') return gravity_file
38.214286
175
0.688474
9bca7d46416818ca1bd358b805f267bcddbd6d29
706
kt
Kotlin
src/test/kotlin/dayFolders/day1/RemoveDuplicatesFromArrayKtTest.kt
lilimapradhan9/kotlin-problems
356cef0db9f0ba1106c308d33c13358077aa0674
[ "MIT" ]
1
2020-04-14T10:22:25.000Z
2020-04-14T10:22:25.000Z
src/test/kotlin/dayFolders/day1/RemoveDuplicatesFromArrayKtTest.kt
lilimapradhan9/kotlin-problems
356cef0db9f0ba1106c308d33c13358077aa0674
[ "MIT" ]
null
null
null
src/test/kotlin/dayFolders/day1/RemoveDuplicatesFromArrayKtTest.kt
lilimapradhan9/kotlin-problems
356cef0db9f0ba1106c308d33c13358077aa0674
[ "MIT" ]
null
null
null
package dayFolders.day1 import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test class RemoveDuplicatesFromArrayKtTest { @Test fun `remove duplicates from array 1,1,2`() { val arrayLength = removeDuplicates(intArrayOf(1, 1, 2)) Assertions.assertEquals(2, arrayLength) } @Test fun `remove duplicates from array 0,0,1,1,1,2,2,3,3,4`() { val arrayLength = removeDuplicates(intArrayOf(0, 0, 1, 1, 1, 2, 2, 3, 3, 4)) Assertions.assertEquals(5, arrayLength) } @Test fun `remove duplicates from empty array`() { val arrayLength = removeDuplicates(intArrayOf()) Assertions.assertEquals(0, arrayLength) } }
25.214286
84
0.66289
9aa0fbeba831fb70bb79f0135bb03468bf01c9be
7,735
asm
Assembly
home/map_objects.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
home/map_objects.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
home/map_objects.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
2
2021-08-11T19:47:07.000Z
2022-01-01T07:07:56.000Z
; Functions handling map objects. GetSpritePalette:: push hl push de push bc ld c, a farcall _GetSpritePalette ld a, c pop bc pop de pop hl ret GetSpriteVTile:: push hl push de push bc ldh [hUsedSpriteIndex], a farcall GetSprite ld hl, wSpriteFlags res 5, [hl] ldh a, [hObjectStructIndexBuffer] ; objects 10+ load in vbk0 cp 10 jr c, .continue set 5, [hl] sub 10 .continue add a add a ld b, a add b add b ldh [hUsedSpriteTile], a push af farcall GetUsedSprite pop af ld b, a xor a ld a, b ld hl, wSpriteFlags bit 5, [hl] jr z, .using_vbk0 or $80 .using_vbk0 pop bc pop de pop hl ret DoesSpriteHaveFacings:: push de push hl ld b, a ldh a, [hROMBank] push af ld a, BANK(_DoesSpriteHaveFacings) rst Bankswitch ld a, b call _DoesSpriteHaveFacings ld c, a pop de ld a, d rst Bankswitch pop hl pop de ret GetPlayerStandingTile:: ld a, [wPlayerStandingTile] call GetTileCollision ld b, a ret CheckOnWater:: ld a, [wPlayerStandingTile] call GetTileCollision sub WATERTILE ret z and a ret GetTileCollision:: ; Get the collision type of tile a. push de push hl ld hl, TileCollisionTable ld e, a ld d, 0 add hl, de ldh a, [hROMBank] push af ld a, BANK(TileCollisionTable) rst Bankswitch ld e, [hl] pop af rst Bankswitch ld a, e and $f ; lo nybble only pop hl pop de ret CheckGrassTile:: ld d, a and $f0 cp HI_NYBBLE_TALL_GRASS jr z, .check cp HI_NYBBLE_WATER jr nz, .nope .check ld a, d and LO_NYBBLE_GRASS ret z .nope scf ret CheckSuperTallGrassTile:: cp COLL_LONG_GRASS ret z cp COLL_LONG_GRASS_1C ret CheckCutTreeTile:: cp COLL_CUT_TREE ret z cp COLL_CUT_TREE_1A ret CheckHeadbuttTreeTile:: cp COLL_HEADBUTT_TREE ret z cp COLL_HEADBUTT_TREE_1D ret CheckCounterTile:: cp COLL_COUNTER ret z cp COLL_COUNTER_98 ret CheckPitTile:: cp COLL_PIT ret z cp COLL_PIT_68 ret CheckIceTile:: cp COLL_ICE ret z cp COLL_ICE_2B ret z scf ret CheckWhirlpoolTile:: nop cp COLL_WHIRLPOOL ret z cp COLL_WHIRLPOOL_2C ret z scf ret CheckWaterfallTile:: cp COLL_WATERFALL ret z cp COLL_CURRENT_DOWN ret CheckStandingOnEntrance:: ld a, [wPlayerStandingTile] cp COLL_DOOR ret z cp COLL_DOOR_79 ret z cp COLL_STAIRCASE ret z cp COLL_CAVE ret GetMapObject:: ; Return the location of map object a in bc. ld hl, wMapObjects ld bc, OBJECT_LENGTH call AddNTimes ld b, h ld c, l ret CheckObjectVisibility:: ; Sets carry if the object is not visible on the screen. ldh [hMapObjectIndexBuffer], a call GetMapObject ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc ld a, [hl] cp -1 jr z, .not_visible ldh [hObjectStructIndexBuffer], a call GetObjectStruct and a ret .not_visible scf ret CheckObjectTime:: ld hl, MAPOBJECT_HOUR add hl, bc ld a, [hl] cp -1 jr nz, .check_hour ld hl, MAPOBJECT_TIMEOFDAY add hl, bc ld a, [hl] cp -1 jr z, .timeofday_always ld hl, .TimeOfDayValues_191e ld a, [wTimeOfDay] add l ld l, a jr nc, .ok inc h .ok ld a, [hl] ld hl, MAPOBJECT_TIMEOFDAY add hl, bc and [hl] jr nz, .timeofday_always scf ret .timeofday_always and a ret .TimeOfDayValues_191e: ; entries correspond to TimeOfDay values db MORN db DAY db NITE .check_hour ld hl, MAPOBJECT_HOUR add hl, bc ld d, [hl] ld hl, MAPOBJECT_TIMEOFDAY add hl, bc ld e, [hl] ld hl, hHours ld a, d cp e ret z jr c, .check_timeofday ld a, [hl] cp d ret nc cp e ret z ccf ret .check_timeofday ld a, e cp [hl] ret c ld a, [hl] cp d ret _CopyObjectStruct:: ldh [hMapObjectIndexBuffer], a call UnmaskObject ldh a, [hMapObjectIndexBuffer] call GetMapObject farcall CopyObjectStruct ret ApplyDeletionToMapObject:: ldh [hMapObjectIndexBuffer], a call GetMapObject ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc ld a, [hl] cp -1 ret z ; already hidden ld [hl], -1 push af call .CheckStopFollow pop af call GetObjectStruct farcall DeleteMapObject ret .CheckStopFollow: ld hl, wObjectFollow_Leader cp [hl] jr z, .ok ld hl, wObjectFollow_Follower cp [hl] ret nz .ok farcall StopFollow ld a, -1 ld [wObjectFollow_Leader], a ld [wObjectFollow_Follower], a ret DeleteObjectStruct:: call ApplyDeletionToMapObject jp MaskObject CopyPlayerObjectTemplate:: push hl call GetMapObject ld d, b ld e, c ld a, -1 ld [de], a inc de pop hl ld bc, OBJECT_LENGTH - 1 jp CopyBytes LoadMovementDataPointer:: ; Load the movement data pointer for object a. ld [wMovementObject], a ldh a, [hROMBank] ld [wMovementDataBank], a ld a, l ld [wMovementDataAddress], a ld a, h ld [wMovementDataAddress + 1], a ld a, [wMovementObject] call CheckObjectVisibility ret c ld hl, OBJECT_MOVEMENTTYPE add hl, bc ld [hl], SPRITEMOVEDATA_SCRIPTED ld hl, OBJECT_STEP_TYPE add hl, bc ld [hl], STEP_TYPE_00 ld hl, wVramState set 7, [hl] and a ret FindFirstEmptyObjectStruct:: ; Returns the index of the first empty object struct in A and its address in HL, then sets carry. ; If all object structs are occupied, A = 0 and Z is set. ; Preserves BC and DE. push bc push de ld hl, wObjectStructs ld de, OBJECT_STRUCT_LENGTH ld c, NUM_OBJECT_STRUCTS .loop ld a, [hl] and a jr z, .break add hl, de dec c jr nz, .loop xor a jr .done .break ld a, NUM_OBJECT_STRUCTS sub c scf .done pop de pop bc ret GetSpriteMovementFunction:: ld hl, OBJECT_MOVEMENTTYPE add hl, bc ld a, [hl] cp NUM_SPRITEMOVEDATA jr c, .ok xor a .ok ld hl, SpriteMovementData + SPRITEMOVEATTR_MOVEMENT ld e, a ld d, 0 rept NUM_SPRITEMOVEDATA_FIELDS add hl, de endr ld a, [hl] ret GetInitialFacing:: push bc push de ld e, a ld d, 0 ld hl, SpriteMovementData + SPRITEMOVEATTR_FACING rept NUM_SPRITEMOVEDATA_FIELDS add hl, de endr ld a, BANK(SpriteMovementData) call GetFarByte add a add a maskbits NUM_DIRECTIONS, 2 pop de pop bc ret CopySpriteMovementData:: ld l, a ldh a, [hROMBank] push af ld a, BANK(SpriteMovementData) rst Bankswitch ld a, l push bc call .CopyData pop bc pop af rst Bankswitch ret .CopyData: ld hl, OBJECT_MOVEMENTTYPE add hl, de ld [hl], a push de ld e, a ld d, 0 ld hl, SpriteMovementData + SPRITEMOVEATTR_FACING rept NUM_SPRITEMOVEDATA_FIELDS add hl, de endr ld b, h ld c, l pop de ld a, [bc] inc bc rlca rlca maskbits NUM_DIRECTIONS, 2 ld hl, OBJECT_FACING add hl, de ld [hl], a ld a, [bc] inc bc ld hl, OBJECT_ACTION add hl, de ld [hl], a ld a, [bc] inc bc ld hl, OBJECT_FLAGS1 add hl, de ld [hl], a ld a, [bc] inc bc ld hl, OBJECT_FLAGS2 add hl, de ld [hl], a ld a, [bc] inc bc ld hl, OBJECT_PALETTE add hl, de ld [hl], a ret _GetMovementByte:: ; Switch to the movement data bank ldh a, [hROMBank] push af ld a, [hli] rst Bankswitch ; Load the current script byte as given by OBJECT_MOVEMENT_BYTE_INDEX, and increment OBJECT_MOVEMENT_BYTE_INDEX ld a, [hli] ld d, [hl] ld hl, OBJECT_MOVEMENT_BYTE_INDEX add hl, bc add [hl] ld e, a ld a, d adc 0 ld d, a inc [hl] ld a, [de] ld h, a pop af rst Bankswitch ld a, h ret SetVramState_Bit0:: ld hl, wVramState set 0, [hl] ret ResetVramState_Bit0:: ld hl, wVramState res 0, [hl] ret UpdateSprites:: ld a, [wVramState] bit 0, a ret z farcall Function55e0 farcall _UpdateSprites ret GetObjectStruct:: ld bc, OBJECT_STRUCT_LENGTH ld hl, wObjectStructs call AddNTimes ld b, h ld c, l ret DoesObjectHaveASprite:: ld hl, OBJECT_SPRITE add hl, bc ld a, [hl] and a ret SetSpriteDirection:: ; preserves other flags push af ld hl, OBJECT_FACING add hl, bc ld a, [hl] and %11110011 ld e, a pop af maskbits NUM_DIRECTIONS, 2 or e ld [hl], a ret GetSpriteDirection:: ld hl, OBJECT_FACING add hl, bc ld a, [hl] maskbits NUM_DIRECTIONS, 2 ret
13.382353
111
0.711571
05d9189d25dc11aa519cf060e0b8f6043a194f9d
201
rb
Ruby
lib/cocoapods_plugin.rb
thiagohmcruz/cocoapods-generate
27e125ab25fa92ac0706ce27351a7f0de4061ba7
[ "MIT" ]
234
2018-06-25T19:05:00.000Z
2022-03-29T19:46:00.000Z
lib/cocoapods_plugin.rb
thiagohmcruz/cocoapods-generate
27e125ab25fa92ac0706ce27351a7f0de4061ba7
[ "MIT" ]
121
2018-07-24T22:53:11.000Z
2022-03-22T17:01:59.000Z
lib/cocoapods_plugin.rb
hhtczengjing/cocoapods-generate
0cd1164e47366f1abefc9f3e1b1b3e293123816b
[ "MIT" ]
36
2018-07-24T22:33:01.000Z
2021-12-21T23:14:15.000Z
# frozen_string_literal: true if Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.5.0') require 'cocoapods/command/gen' else Pod::UI.warn 'cocoapods-generate requires CocoaPods >= 1.5.0' end
25.125
63
0.721393
13af85fbca9608d656a7161325fb42a932bac560
19,344
sql
SQL
src/main/resources/db/migration/oracle/V2.8.0.20190424150601__add-unique-name-constraint-to-entities.sql
patrickfischer1/WebAPI
759334d4161267b1f728a624590b566bb64abaec
[ "Apache-2.0" ]
99
2015-01-06T18:24:25.000Z
2022-03-10T16:34:04.000Z
src/main/resources/db/migration/oracle/V2.8.0.20190424150601__add-unique-name-constraint-to-entities.sql
patrickfischer1/WebAPI
759334d4161267b1f728a624590b566bb64abaec
[ "Apache-2.0" ]
1,261
2015-01-01T17:33:35.000Z
2022-03-28T18:16:27.000Z
src/main/resources/db/migration/oracle/V2.8.0.20190424150601__add-unique-name-constraint-to-entities.sql
patrickfischer1/WebAPI
759334d4161267b1f728a624590b566bb64abaec
[ "Apache-2.0" ]
159
2015-01-12T13:39:42.000Z
2022-03-15T13:39:31.000Z
-- Alter Concept Set table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_cs_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT concept_set_name FROM ${ohdsiSchema}.concept_set GROUP BY concept_set_name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT concept_set_name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.concept_set GROUP BY concept_set_name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.concept_set GROUP BY concept_set_name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.concept_set SET concept_set_name = concept_set_name || ' (' || j || ')' WHERE concept_set_id = (SELECT concept_set_id FROM ${ohdsiSchema}.concept_set WHERE concept_set_name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_cs_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'CONCEPT_SET'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.CONCEPT_SET ADD CONSTRAINT ' || constraint_title ||' UNIQUE (concept_set_name)'); END IF; END; / begin rename_cs_names; end; / -- Alter Cohort Definition table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_cd_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.cohort_definition GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.cohort_definition GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.cohort_definition GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.cohort_definition SET name = name || ' (' || j || ')' WHERE id = (SELECT id FROM ${ohdsiSchema}.cohort_definition WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_cd_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'COHORT_DEFINITION'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.COHORT_DEFINITION ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_cd_names; end; / -- Alter Cohort Characterization table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_cc_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.cohort_characterization GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.cohort_characterization GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.cohort_characterization GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.cohort_characterization SET name = name || ' (' || j || ')' WHERE id = (SELECT id FROM ${ohdsiSchema}.cohort_characterization WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_cc_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'COHORT_CHARACTERIZATION'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.COHORT_CHARACTERIZATION ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_cc_names; end; / -- Alter FeAnalysis table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_fe_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.fe_analysis GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.fe_analysis GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.fe_analysis GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.fe_analysis SET name = name || ' (' || j || ')' WHERE id = (SELECT id FROM ${ohdsiSchema}.fe_analysis WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_fe_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'FE_ANALYSIS'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.FE_ANALYSIS ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_fe_names; end; / -- Alter Pathway Analysis table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_pathway_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.pathway_analysis GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.pathway_analysis GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.pathway_analysis GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.pathway_analysis SET name = name || ' (' || j || ')' WHERE id = (SELECT id FROM ${ohdsiSchema}.pathway_analysis WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_pw_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'PATHWAY_ANALYSIS'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.PATHWAY_ANALYSIS ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_pathway_names; end; / -- Alter IR Analysis table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_ir_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.ir_analysis GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.ir_analysis GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.ir_analysis GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.ir_analysis SET name = name || ' (' || j || ')' WHERE id = (SELECT id FROM ${ohdsiSchema}.ir_analysis WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_ir_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'IR_ANALYSIS'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.IR_ANALYSIS ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_ir_names; end; / -- Alter Estimation table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_estimation_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.estimation GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.estimation GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.estimation GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.estimation SET name = name || ' (' || j || ')' WHERE estimation_id = (SELECT estimation_id FROM ${ohdsiSchema}.estimation WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_es_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'ESTIMATION'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.ESTIMATION ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_estimation_names; end; / -- Alter Prediction table CREATE OR REPLACE PROCEDURE ${ohdsiSchema}.rename_prediction_names AS TYPE NumberArray IS TABLE OF NUMBER; TYPE CharArray IS TABLE OF VARCHAR(255); duplicate_names CharArray; name_repeats NumberArray; amount_of_duplicate_names INT; amount_of_constraints INT; constraint_title VARCHAR(255); schema_title VARCHAR(255); all_duplicates INT; BEGIN SELECT COUNT(*) INTO all_duplicates FROM (SELECT name FROM ${ohdsiSchema}.prediction GROUP BY name HAVING COUNT(*) > 1); FOR k IN 0 .. coalesce(all_duplicates, 0) LOOP SELECT name BULK COLLECT INTO duplicate_names FROM ${ohdsiSchema}.prediction GROUP BY name HAVING COUNT(*) > 1; SELECT COUNT(*) BULK COLLECT INTO name_repeats FROM ${ohdsiSchema}.prediction GROUP BY name HAVING COUNT(*) > 1; amount_of_duplicate_names := duplicate_names.COUNT; FOR i IN 1 .. coalesce(amount_of_duplicate_names, 0) LOOP FOR j IN 1 .. coalesce(name_repeats(i), 0) LOOP UPDATE ${ohdsiSchema}.prediction SET name = name || ' (' || j || ')' WHERE prediction_id = (SELECT prediction_id FROM ${ohdsiSchema}.prediction WHERE name = duplicate_names(i) AND ROWNUM = 1); END LOOP; END LOOP; duplicate_names.DELETE(); name_repeats.DELETE(); END LOOP; constraint_title := 'uq_pd_name'; schema_title := '${ohdsiSchema}'; SELECT COUNT(*) INTO amount_of_constraints FROM ALL_CONSTRAINTS WHERE OWNER = '${ohdsiSchema}' AND CONSTRAINT_NAME = constraint_title AND TABLE_NAME = 'PREDICTION'; IF amount_of_constraints = 0 THEN EXECUTE IMMEDIATE ('ALTER TABLE ' || schema_title || '.PREDICTION ADD CONSTRAINT ' || constraint_title ||' UNIQUE (name)'); END IF; END; / begin rename_prediction_names; end; / DROP PROCEDURE ${ohdsiSchema}.rename_cs_names; DROP PROCEDURE ${ohdsiSchema}.rename_cd_names; DROP PROCEDURE ${ohdsiSchema}.rename_cc_names; DROP PROCEDURE ${ohdsiSchema}.rename_fe_names; DROP PROCEDURE ${ohdsiSchema}.rename_pathway_names; DROP PROCEDURE ${ohdsiSchema}.rename_ir_names; DROP PROCEDURE ${ohdsiSchema}.rename_estimation_names; DROP PROCEDURE ${ohdsiSchema}.rename_prediction_names;
34.854054
144
0.547612
9c535552388dd8255e95d81d955d0f2d702d5a7b
5,640
js
JavaScript
web/js/classes/article.js
HTML5Wiki/HTML5Wiki
a9dddb053de7150d6cf07231687b89ba7a999d62
[ "Apache-2.0" ]
1
2016-05-12T05:52:26.000Z
2016-05-12T05:52:26.000Z
web/js/classes/article.js
HTML5Wiki/HTML5Wiki
a9dddb053de7150d6cf07231687b89ba7a999d62
[ "Apache-2.0" ]
null
null
null
web/js/classes/article.js
HTML5Wiki/HTML5Wiki
a9dddb053de7150d6cf07231687b89ba7a999d62
[ "Apache-2.0" ]
null
null
null
/** * This file is part of the HTML5Wiki Project. * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE. * It is also available through the world-wide-web at this URL: * http://www.github.com/HTML5Wiki/HTML5Wiki/blob/master/LICENSE * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to mweibel@hsr.ch so we can send you a copy immediately. * * @author Michael Weibel <mweibel@hsr.ch> * @author Manuel Alabor <malabor@hsr.ch> * @author Alexandre Joly <ajoly@hsr.ch> * @author Nicolas Karrer <nkarrer@hsr.ch> * @copyright (c) HTML5Wiki Team 2011 * @category Html5Wiki * @package Web * @subpackage Javascript */ /** * Encapsulates methods for working with the article editor. * * @see templates/wiki/edit.php */ var Article = (function() { var self = {}; self.loadArticle = function(url, idArticle) { $.ajax({ type: 'get', 'url': url, complete: function(response, textStatus) { Article.replaceContent(response, textStatus); }, data: 'idArticle=' + idArticle }); return url; } self.create = function() { var form = $('#create-article'); if( form ) { var name = $('#txtAuthor').val(); var email = $('#txtAuthorEmail').val(); var id = $('#hiddenAuthorId').val(); var mediaData = { txtAuthor: name, txtAuthorEmail: email, hiddenAuthorId: id }; $.ajax({ type: 'POST', url: form.attr('action'), data: mediaData, complete: function(response, textStatus) { Article.onEditFormLoaded(response, textStatus) } }); } } self.save = function(e) { e.preventDefault(); var form = $(e.currentTarget); if( form ) { var idArticle = $('#hiddenIdArticle').val(); var timestampArticle = $('#hiddenTimestampArticle').val(); var title = $('#txtTitle').val(); var content = $('#contentEditor').val(); var versionComment = $('#versionComment').val(); var name = $('#txtAuthor').val(); var email = $('#txtAuthorEmail').val(); var id = $('#hiddenAuthorId').val(); var tags = $('#txtTags').val(); var overwrite = $('#hiddenOverwrite').val(); if (typeof title == "undefined") { title = $('article h1.heading').text(); } var mediaData = { hiddenIdArticle: idArticle, hiddenTimestampArticle: timestampArticle, txtTitle: title, contentEditor: content, versionComment: versionComment, txtAuthor: name, txtAuthorEmail: email, hiddenAuthorId: id, tags: tags, hiddenOverwrite: overwrite }; $.ajax({ type: 'POST', url: form.attr('action'), data: mediaData, complete: function(response) { if(response.status != 200){ Article.replaceContent(response); } }, success: function(data, textStatus, response) { var url = data; window.location.href = url; } }); } } self.replaceContent = function(response, textStatus) { $('#content').replaceWith(response.responseText); } self.loadEditForm = function(url, idArticle) { $.ajax({ type: 'get', url: url, data: 'idArticle=' + idArticle, complete: function(response, textStatus) { Article.onEditFormLoaded(response, textStatus); } }); return url; } self.onEditFormLoaded = function(response, textStatus) { this.replaceContent(response); } self.loadHistory = function(url, idArticle) { $.ajax({ type: 'get', url: url, data: 'idArticle=' + idArticle, complete: function(response, textStatus) { Article.replaceContent(response, textStatus); } }); return url; } /** * Changes the h1 of the Article-Editor into a textfield for editing the title * of an article. * A button with the possibility to cancel the title-editor is appended. * * @access public */ self.handleEditArticleTitle = function(displayCancelButton) { var heading = $('#headingcontainer'); var title = $('.heading').text(); var titleEditor = $('<input value="'+title+'" class="textfield" id="txtTitle" placeholder="' + Translate._('title') + '" name="txtTitle" />'); if(displayCancelButton == undefined) displayCancelButton = true; var container = $('<div class="editor-wrapper" />'); container.append(titleEditor); if(displayCancelButton) { var cancelButton = $('<a href="#" class="button">' + Translate._('restore') + '</a>'); cancelButton.bind('mouseup',{title:title}, function(event) { var heading = $('<div id="headingcontainer" style="float:left"><h1 class="heading">'+event.data.title+'</h1><div class="clear"></div><p class="meta"><span>' + Translate._('clickOnTitleToEdit') + '</span></p></div>'); $(heading).bind('mouseup', Article.handleEditArticleTitle); $('.editor-wrapper').replaceWith(heading); return false; }); container.append('<br/><span class="cancel">' + Translate._('restoreQuestion') + '</span>'); container.append(cancelButton); } heading.replaceWith(container); return false; } self.setupArticleEditorGui = function() { $('.editor #contentEditor').markItUp(html5WikiMarkItUpSettings); $('.editor #txtTags').ptags(); } self.setupArticleEditorEvents = function() { $("#edit-article").submit(Article.save); $('.editor h1.heading').bind('mouseup', Article.handleEditArticleTitle); } return self; }()); // end Article
28.923077
220
0.619858
2dad9af4abf5b26c9409321b751553c035b7cce4
6,360
rs
Rust
libraries/dimdraw/src/drawing_assembler.rs
jonlamb-gh/openscad-models-rust
f8fb33822b864e9d8c8e93c404606f13e4bbb9e0
[ "MIT" ]
null
null
null
libraries/dimdraw/src/drawing_assembler.rs
jonlamb-gh/openscad-models-rust
f8fb33822b864e9d8c8e93c404606f13e4bbb9e0
[ "MIT" ]
3
2018-09-18T19:29:09.000Z
2018-10-08T14:59:45.000Z
libraries/dimdraw/src/drawing_assembler.rs
jonlamb-gh/openscad-models-rust
f8fb33822b864e9d8c8e93c404606f13e4bbb9e0
[ "MIT" ]
null
null
null
use scad::*; use super::na; use constants::*; use dim_line::DimLocation; use drawing::Drawing; use object_assembler::ObjectAssembler; #[derive(Clone, PartialEq)] pub enum Viewport { TopLeft, TopRight, BottomLeft, BottomRight, } impl Viewport { pub fn enumerate() -> &'static [Self] { &[ Viewport::TopLeft, Viewport::TopRight, Viewport::BottomLeft, Viewport::BottomRight, ] } } pub struct DrawingParams { // title block ? pub doc_scale: f32, pub show_frame: bool, pub doc_height: f32, // TODO - pos/orien pub top_left_view_pos: na::Vector3<f32>, pub top_right_view_pos: na::Vector3<f32>, pub bottom_left_view_pos: na::Vector3<f32>, pub bottom_right_view_pos: na::Vector3<f32>, } impl Default for DrawingParams { fn default() -> DrawingParams { DrawingParams { doc_scale: 4.0, show_frame: true, doc_height: 1.0, top_left_view_pos: vec3(-15.0, 5.0, 0.0), top_right_view_pos: vec3(7.0, 4.0, 0.0), bottom_left_view_pos: vec3(-15.0, -15.0, 0.0), bottom_right_view_pos: vec3(5.0, -15.0, 0.0), } } } // TODO // trait that constructs and uses Drawing object or // methods of drawing object? // this is the former pub trait DrawingAssembler: ObjectAssembler { // describes the drawing parameters to be used by assemble_drawing()/etc fn drawing_params(&self) -> DrawingParams; fn assemble_drawing(&self) -> ScadObject { let params = self.drawing_params(); let mut parent = scad!(Union); for vp in Viewport::enumerate() { let vp_offset = match vp { Viewport::TopLeft => params.top_left_view_pos, Viewport::TopRight => params.top_right_view_pos, Viewport::BottomLeft => params.bottom_left_view_pos, Viewport::BottomRight => params.bottom_right_view_pos, }; parent.add_child(scad!(Translate(vp_offset);{ self.assemble_preview(vp.clone()), scad!(Translate(vec3(0.0, 0.0, params.doc_height));{ self.assemble_viewport(vp.clone()) }) })); } parent } // currently at or below z == 0 fn assemble_preview(&self, vp: Viewport) -> ScadObject { let obj_desc = self.describe(); let obj = self.assemble(); match vp { // top Viewport::TopLeft => scad!(Translate(vec3(0.0, 0.0, -obj_desc.thickness));{ obj }), // 3D Viewport::TopRight => scad!(Translate(vec3(0.0, 0.0, -obj_desc.thickness));{ scad!(Rotate(20.0, z_axis());{ scad!(Rotate(40.0, y_axis());{ scad!(Rotate(-50.0, x_axis());{ obj }) }) }) }), // front Viewport::BottomLeft => scad!(Translate(vec3z());{ scad!(Rotate(-90.0, x_axis());{ obj }) }), // left Viewport::BottomRight => scad!(Translate(vec3(obj_desc.width, 0.0, 0.0));{ scad!(Rotate(90.0, z_axis());{ scad!(Rotate(90.0, y_axis());{ obj }) }) }), } } fn assemble_viewport(&self, vp: Viewport) -> ScadObject { self.assemble_default_viewport(vp) } // default impl just does some basic major/minor dimensions fn assemble_default_viewport(&self, vp: Viewport) -> ScadObject { let params = self.drawing_params(); let drawing = Drawing::new(params.doc_scale); let obj_desc = self.describe(); let mut parent = scad!(Union); let mut dims_children = scad!(Color(vec3z())); let (major_dim, minor_dim) = match vp { Viewport::TopLeft => (obj_desc.length, obj_desc.width), // top right is used to show a perspective view, no dimensions Viewport::TopRight => return parent, Viewport::BottomLeft => (obj_desc.length, obj_desc.thickness), Viewport::BottomRight => (obj_desc.width, obj_desc.thickness), }; let major_dim_loc = if major_dim < 10.0 { DimLocation::Left } else { DimLocation::Center }; let minor_dim_loc = if minor_dim < 10.0 { DimLocation::Left } else { DimLocation::Center }; // major dimension dims_children.add_child( scad!(Translate(vec3(0.0, minor_dim + (drawing.spacing * 3.0), 0.0));{ drawing.dim_line(major_dim, major_dim_loc) }), ); // extension lines dims_children.add_child( scad!(Translate(vec3(0.0, minor_dim + drawing.spacing, 0.0));{ scad!(Rotate(90.0, z_axis());{ drawing.line(drawing.spacing * 3.0, false, false) }) }), ); dims_children.add_child( scad!(Translate(vec3(major_dim, minor_dim + drawing.spacing, 0.0));{ scad!(Rotate(90.0, z_axis());{ drawing.line(drawing.spacing * 3.0, false, false) }) }), ); // minor dimension dims_children.add_child( scad!(Translate(vec3(major_dim + drawing.spacing * 3.0, minor_dim, 0.0));{ scad!(Rotate(-90.0, z_axis());{ drawing.dim_line(minor_dim, minor_dim_loc) }) }), ); // extension lines dims_children.add_child( scad!(Translate(vec3(major_dim + drawing.spacing, 0.0, 0.0));{ drawing.line(drawing.spacing * 3.0, false, false) }), ); dims_children.add_child( scad!(Translate(vec3(major_dim + drawing.spacing, minor_dim, 0.0));{ drawing.line(drawing.spacing * 3.0, false, false) }), ); parent.add_child(dims_children); parent } }
31.02439
88
0.516667
85c8127fee9b069170e17a6776a413567308d9f9
114
js
JavaScript
src/main/index.js
minato31/clean-node-tdd
0e086f7e5df3dd7ba4d0f0778965c1b90a638726
[ "MIT" ]
null
null
null
src/main/index.js
minato31/clean-node-tdd
0e086f7e5df3dd7ba4d0f0778965c1b90a638726
[ "MIT" ]
1
2021-09-02T13:15:11.000Z
2021-09-02T13:15:11.000Z
src/main/index.js
minato31/clean-node-tdd
0e086f7e5df3dd7ba4d0f0778965c1b90a638726
[ "MIT" ]
null
null
null
const app = require('./config/app') app.listen(3333, () => { console.log('Server running in the port 3333') })
19
48
0.640351
2b37b16aac59d0cc0b37b48b5694eb9f046ccb7e
641
kt
Kotlin
src/main/kotlin/net/intervallayers/spring/repository/EntityRepository.kt
Interval-Layers/Spring
fc83c26eede9e4c0ec229d49584c348e45cdd688
[ "MIT" ]
null
null
null
src/main/kotlin/net/intervallayers/spring/repository/EntityRepository.kt
Interval-Layers/Spring
fc83c26eede9e4c0ec229d49584c348e45cdd688
[ "MIT" ]
null
null
null
src/main/kotlin/net/intervallayers/spring/repository/EntityRepository.kt
Interval-Layers/Spring
fc83c26eede9e4c0ec229d49584c348e45cdd688
[ "MIT" ]
null
null
null
package net.intervallayers.spring.repository import net.intervallayers.spring.model.* import org.bson.types.* import org.springframework.data.mongodb.repository.* import org.springframework.data.repository.* import org.springframework.stereotype.Repository /** * Interface of MongoRepository for basic interaction with MongoDB * @see CrudRepository for basic available methods */ @Repository interface EntityRepository : MongoRepository<Entity, ObjectId> { /** * Finds all Entity documents in Mongo database by name * If nothing is found, returns an empty list */ fun findAllByName(name: String): List<Entity> }
29.136364
66
0.770671
6bb4bf948cc2c43096ff56277566fcedfeb4dc24
1,132
h
C
iOSOpenDev/frameworks/GeoServices.framework/Headers/GEOVoltaireDirectionsProvider.h
bzxy/cydia
f8c838cdbd86e49dddf15792e7aa56e2af80548d
[ "MIT" ]
678
2017-11-17T08:33:19.000Z
2022-03-26T10:40:20.000Z
iOSOpenDev/frameworks/GeoServices.framework/Headers/GEOVoltaireDirectionsProvider.h
chenfanfang/Cydia
5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0
[ "MIT" ]
22
2019-04-16T05:51:53.000Z
2021-11-08T06:18:45.000Z
iOSOpenDev/frameworks/GeoServices.framework/Headers/GEOVoltaireDirectionsProvider.h
chenfanfang/Cydia
5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0
[ "MIT" ]
170
2018-06-10T07:59:20.000Z
2022-03-22T16:19:33.000Z
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices */ #import <GeoServices/GEODirectionsProvider.h> #import <GeoServices/PBRequesterDelegate.h> @class GEORequester; @interface GEOVoltaireDirectionsProvider : GEODirectionsProvider <PBRequesterDelegate> { GEORequester *_requester; // 20 = 0x14 } @property(retain, nonatomic) GEORequester *requester; // G=0x1fe85; S=0x1fe95; @synthesize=_requester + (id)providerHostname; // 0x1fa8d + (unsigned short)providerID; // 0x1fa89 + (void)resetProviderURL; // 0x1f8f1 + (id)providerURL; // 0x1f839 // declared property setter: - (void)setRequester:(id)requester; // 0x1fe95 // declared property getter: - (id)requester; // 0x1fe85 - (void)requesterDidCancel:(id)requester; // 0x1fe55 - (void)requester:(id)requester didFailWithError:(id)error; // 0x1fe1d - (void)requesterDidFinish:(id)requester; // 0x1fc11 - (void)cleanupRequester; // 0x1fbcd - (void)cancelProviderRequest; // 0x1fba5 - (void)startProviderWithRequest:(id)request; // 0x1fab5 - (void)dealloc; // 0x1fa21 - (id)init; // 0x1f91d @end
36.516129
101
0.751767
3d07465a3e9dfa142204becb8f0096de4e8dd4fb
6,759
rs
Rust
src/stash.rs
vors/git2-rs
8002f977de375a83d134e6897b1c759f62aa3743
[ "Apache-2.0", "MIT" ]
1
2019-04-24T23:46:26.000Z
2019-04-24T23:46:26.000Z
src/stash.rs
vors/git2-rs
8002f977de375a83d134e6897b1c759f62aa3743
[ "Apache-2.0", "MIT" ]
null
null
null
src/stash.rs
vors/git2-rs
8002f977de375a83d134e6897b1c759f62aa3743
[ "Apache-2.0", "MIT" ]
null
null
null
use {raw, panic, Oid, StashApplyProgress}; use std::ffi::{CStr}; use util::{Binding}; use libc::{c_int, c_char, size_t, c_void}; use build::{CheckoutBuilder}; use std::mem; /// Stash application progress notification function. /// /// Return `true` to continue processing, or `false` to /// abort the stash application. pub type StashApplyProgressCb<'a> = FnMut(StashApplyProgress) -> bool + 'a; /// This is a callback function you can provide to iterate over all the /// stashed states that will be invoked per entry. pub type StashCb<'a> = FnMut(usize, &str, &Oid) -> bool + 'a; #[allow(unused)] /// Stash application options structure pub struct StashApplyOptions<'cb> { progress: Option<Box<StashApplyProgressCb<'cb>>>, checkout_options: Option<CheckoutBuilder<'cb>>, raw_opts: raw::git_stash_apply_options } impl<'cb> Default for StashApplyOptions<'cb> { fn default() -> Self { Self::new() } } impl<'cb> StashApplyOptions<'cb> { /// Creates a default set of merge options. pub fn new() -> StashApplyOptions<'cb> { let mut opts = StashApplyOptions { progress: None, checkout_options: None, raw_opts: unsafe { mem::zeroed() }, }; assert_eq!(unsafe { raw::git_stash_apply_init_options(&mut opts.raw_opts, 1) }, 0); opts } /// Set stash application flag to GIT_STASH_APPLY_REINSTATE_INDEX pub fn reinstantiate_index(&mut self) -> &mut StashApplyOptions<'cb> { self.raw_opts.flags = raw::GIT_STASH_APPLY_REINSTATE_INDEX; self } /// Options to use when writing files to the working directory pub fn checkout_options(&mut self, opts: CheckoutBuilder<'cb>) -> &mut StashApplyOptions<'cb> { self.checkout_options = Some(opts); self } /// Optional callback to notify the consumer of application progress. /// /// Return `true` to continue processing, or `false` to /// abort the stash application. pub fn progress_cb<C>(&mut self, callback: C) -> &mut StashApplyOptions<'cb> where C: FnMut(StashApplyProgress) -> bool + 'cb { self.progress = Some(Box::new(callback) as Box<StashApplyProgressCb<'cb>>); self.raw_opts.progress_cb = stash_apply_progress_cb; self.raw_opts.progress_payload = self as *mut _ as *mut _; self } /// Pointer to a raw git_stash_apply_options pub fn raw(&mut self) -> &raw::git_stash_apply_options { unsafe { if let Some(opts) = self.checkout_options.as_mut() { opts.configure(&mut self.raw_opts.checkout_options); } } &self.raw_opts } } #[allow(unused)] pub struct StashCbData<'a> { pub callback: &'a mut StashCb<'a> } #[allow(unused)] pub extern fn stash_cb(index: size_t, message: *const c_char, stash_id: *const raw::git_oid, payload: *mut c_void) -> c_int { panic::wrap(|| unsafe { let mut data = &mut *(payload as *mut StashCbData); let res = { let mut callback = &mut data.callback; callback(index, CStr::from_ptr(message).to_str().unwrap(), &Binding::from_raw(stash_id)) }; if res { 0 } else { 1 } }).unwrap_or(1) } fn convert_progress(progress: raw::git_stash_apply_progress_t) -> StashApplyProgress { match progress { raw::GIT_STASH_APPLY_PROGRESS_NONE => StashApplyProgress::None, raw::GIT_STASH_APPLY_PROGRESS_LOADING_STASH => StashApplyProgress::LoadingStash, raw::GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX => StashApplyProgress::AnalyzeIndex, raw::GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED => StashApplyProgress::AnalyzeModified, raw::GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED => StashApplyProgress::AnalyzeUntracked, raw::GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED => StashApplyProgress::CheckoutUntracked, raw::GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED => StashApplyProgress::CheckoutModified, raw::GIT_STASH_APPLY_PROGRESS_DONE => StashApplyProgress::Done, _ => StashApplyProgress::None } } #[allow(unused)] extern fn stash_apply_progress_cb(progress: raw::git_stash_apply_progress_t, payload: *mut c_void) -> c_int { panic::wrap(|| unsafe { let mut options = &mut *(payload as *mut StashApplyOptions); let res = { let mut callback = options.progress.as_mut().unwrap(); callback(convert_progress(progress)) }; if res { 0 } else { -1 } }).unwrap_or(-1) } #[cfg(test)] mod tests { use stash::{StashApplyOptions}; use std::io::{Write}; use std::fs; use std::path::Path; use test::{repo_init}; use {Repository, Status, StashFlags}; fn make_stash<C>(next: C) where C: FnOnce(&mut Repository) { let (_td, mut repo) = repo_init(); let signature = repo.signature().unwrap(); let p = Path::new(repo.workdir().unwrap()).join("file_b.txt"); println!("using path {:?}", p); fs::File::create(&p).unwrap() .write("data".as_bytes()).unwrap(); let rel_p = Path::new("file_b.txt"); assert!(repo.status_file(&rel_p).unwrap() == Status::WT_NEW); repo.stash_save(&signature, "msg1", Some(StashFlags::INCLUDE_UNTRACKED)).unwrap(); assert!(repo.status_file(&rel_p).is_err()); let mut count = 0; repo.stash_foreach(|index, name, _oid| { count += 1; assert!(index == 0); assert!(name == "On master: msg1"); true }).unwrap(); assert!(count == 1); next(&mut repo); } fn count_stash(repo: &mut Repository) -> usize { let mut count = 0; repo.stash_foreach(|_, _, _| { count += 1; true }).unwrap(); count } #[test] fn smoke_stash_save_drop() { make_stash(|repo| { repo.stash_drop(0).unwrap(); assert!(count_stash(repo) == 0) }) } #[test] fn smoke_stash_save_pop() { make_stash(|repo| { repo.stash_pop(0, None).unwrap(); assert!(count_stash(repo) == 0) }) } #[test] fn smoke_stash_save_apply() { make_stash(|repo| { let mut options = StashApplyOptions::new(); options.progress_cb(|progress| { println!("{:?}", progress); true }); repo.stash_apply(0, Some(&mut options)).unwrap(); assert!(count_stash(repo) == 1) }) } }
32.033175
99
0.59713
0cb8edc3aaa4ea60cf2e8cdba8dd3f71fa79f1ce
1,510
py
Python
run.py
whyjay/memoryGAN
cfc5e8cf37f9537a3136595a6afa734335622202
[ "MIT" ]
44
2018-03-05T06:11:31.000Z
2022-03-30T06:40:24.000Z
run.py
whyjay/memoryGAN
cfc5e8cf37f9537a3136595a6afa734335622202
[ "MIT" ]
3
2018-03-20T03:17:23.000Z
2018-07-29T11:46:34.000Z
run.py
whyjay/memoryGAN
cfc5e8cf37f9537a3136595a6afa734335622202
[ "MIT" ]
11
2018-04-01T18:24:53.000Z
2020-10-15T08:55:21.000Z
import os import numpy as np import tensorflow as tf from models.config import Config from models.memory_gan import MemoryGAN from models.test_generation import test_generation from models.train import train from utils import pp, visualize, to_json os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' flags = tf.app.flags flags.DEFINE_integer("epoch", 1500, "Max epoch to train") flags.DEFINE_string("exp", 0, "Experiment number") flags.DEFINE_string("load_cp_dir", '', "cp path") flags.DEFINE_string("dataset", "fashion", "[fashion, affmnist, cifar10]") flags.DEFINE_string("loss", "jsd", "[jsd, alternative, reverse_kl, updown]") flags.DEFINE_boolean("lr_decay", False, "") flags.DEFINE_boolean("use_augmentation", False, "") flags.DEFINE_boolean("is_train", True, "True for training, False for testing [False]") flags.DEFINE_string("model", 'MemoryGAN', '') flags.DEFINE_string("generator", 'base_g', '') flags.DEFINE_string("discriminator", 'memory_d', '') FLAGS = flags.FLAGS def main(_): pp.pprint(flags.FLAGS.__flags) config = Config(FLAGS) config.print_config() config.make_dirs() config_proto = tf.ConfigProto(allow_soft_placement=FLAGS.is_train, log_device_placement=False) config_proto.gpu_options.allow_growth = True with tf.Session(config=config_proto) as sess: model = globals()[FLAGS.model](config) if not FLAGS.is_train: test_generation(model, sess) else: train(model, sess) if __name__ == '__main__': tf.app.run()
31.458333
98
0.724503
27f31dd33e6070665eb93ee202323cc1fbd679f7
5,156
kt
Kotlin
app/src/main/java/com/test/videotoimages/VideoToImages.kt
kenmasumitsu/VideoToImages
70888cf0971f439ccba27dcf5fe10a80cef8f49a
[ "Apache-2.0" ]
1
2022-03-14T16:43:27.000Z
2022-03-14T16:43:27.000Z
app/src/main/java/com/test/videotoimages/VideoToImages.kt
kenmasumitsu/VideoToImages
70888cf0971f439ccba27dcf5fe10a80cef8f49a
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/test/videotoimages/VideoToImages.kt
kenmasumitsu/VideoToImages
70888cf0971f439ccba27dcf5fe10a80cef8f49a
[ "Apache-2.0" ]
1
2021-09-05T20:07:15.000Z
2021-09-05T20:07:15.000Z
package com.test.videotoimages import android.content.Context import android.content.res.AssetFileDescriptor import android.graphics.Bitmap import android.media.MediaCodec import android.media.MediaCodecInfo.CodecCapabilities import android.media.MediaExtractor import android.media.MediaFormat import android.util.Log class VideoToImages(context: Context) { companion object { val TAG = "VideoToImages" val TIMEOUT_US = 10000L } private val yuvToRgbConverter = YuvToRgbConverter(context) private var thread: Thread = Thread() // It is called a frame is decoded during decoding. var onDecodeFrame: ((bitmap: Bitmap, frameNo: Int) -> Unit)? = null fun isRunning(): Boolean { return thread.isAlive } // This sample takes AssetFileDescriptor object for a video file in assets. // You can easily modify to take a video file in File or URL. fun run(videoAsset: AssetFileDescriptor) { if (isRunning()) { Log.d(TAG, "Failed. already running") return } thread = Thread { var decoder: MediaCodec? = null val extractor = MediaExtractor() extractor.setDataSource(videoAsset) for (i in 0..extractor.trackCount) { val format = extractor.getTrackFormat(i) val mime = format.getString(MediaFormat.KEY_MIME) if (mime!=null && mime.startsWith("video/")) { extractor.selectTrack(i) decoder = MediaCodec.createDecoderByType(mime) format.setInteger( MediaFormat.KEY_COLOR_FORMAT, CodecCapabilities.COLOR_FormatYUV420Flexible ) decoder.configure(format, null, null, 0) break } } if (decoder == null) { Log.e(TAG, "Failed to open the video file") return@Thread } decoder.start() val info = MediaCodec.BufferInfo() var isEOS = false var frameNo = 0 while (!Thread.interrupted()) { if (!isEOS) { val inIndex = decoder.dequeueInputBuffer(TIMEOUT_US) if (inIndex >= 0) { val buffer = decoder.getInputBuffer(inIndex) val sampleSize = extractor.readSampleData(buffer!!, 0) if (sampleSize < 0) { // We shouldn't stop the playback at this point, just pass the EOS // flag to decoder, we will get it again from the // dequeueOutputBuffer Log.d(TAG, "InputBuffer BUFFER_FLAG_END_OF_STREAM") decoder.queueInputBuffer( inIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM ) isEOS = true } else { decoder.queueInputBuffer( inIndex, 0, sampleSize, extractor.sampleTime, 0 ) extractor.advance() } } } val outIndex = decoder.dequeueOutputBuffer(info, TIMEOUT_US) when (outIndex) { MediaCodec.INFO_OUTPUT_FORMAT_CHANGED -> { val format = decoder.getOutputFormat() Log.d("DecodeActivity", "New format " + format); } MediaCodec.INFO_TRY_AGAIN_LATER -> { Log.d("DecodeActivity", "dequeueOutputBuffer timed out!"); } else -> { val image = decoder.getOutputImage(outIndex) if (image != null) { val bmp = Bitmap.createBitmap(image.width, image.height, Bitmap.Config.ARGB_8888) yuvToRgbConverter.yuvToRgb(image, bmp) onDecodeFrame?.let { it(bmp, frameNo) } } decoder.releaseOutputBuffer(outIndex, false) frameNo ++ } } // All decoded frames have been rendered, we can stop playing now if ((info.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { Log.d(TAG, "OutputBuffer BUFFER_FLAG_END_OF_STREAM") break } } decoder.stop() decoder.release() extractor.release() } thread.start() } }
37.635036
109
0.47052
b3805275384bbbd07fc41aed901330b04481e4b3
330
rb
Ruby
db/migrate/20140102220204_create_duplicate_registration_attempts.rb
tobocop/howhardwoulditbe
278102bbbbc2fff4ab8e9e70cc07f124003ea249
[ "MIT" ]
null
null
null
db/migrate/20140102220204_create_duplicate_registration_attempts.rb
tobocop/howhardwoulditbe
278102bbbbc2fff4ab8e9e70cc07f124003ea249
[ "MIT" ]
1
2016-01-06T01:45:34.000Z
2016-01-06T01:45:42.000Z
db/migrate/20140102220204_create_duplicate_registration_attempts.rb
tobocop/howhardwoulditbe
278102bbbbc2fff4ab8e9e70cc07f124003ea249
[ "MIT" ]
null
null
null
class CreateDuplicateRegistrationAttempts < ActiveRecord::Migration def up create_table :duplicate_registration_attempts do |t| t.integer :user_id, limit: 8 t.integer :existing_users_institution_id, limit: 8 t.timestamps end end def down drop_table :duplicate_registration_attempts end end
22
67
0.748485
f9fd0d207a8766c93ddac030762afbb69b787303
166
asm
Assembly
libsrc/ctype/isgraph.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/ctype/isgraph.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/ctype/isgraph.asm
RC2014Z80/z88dk
e5b9447b970e5fae26544b6d8aa5957c98ba0e6a
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
SECTION code_clib PUBLIC _isgraph PUBLIC isgraph EXTERN asm_isgraph ._isgraph .isgraph ld a,l call asm_isgraph ld hl,1 ret nc dec l ret
9.764706
25
0.668675
4f0d077c3c7e66027c7d784871fcb079d722f24a
1,673
lua
Lua
code/utilities.lua
gabri-16/RobotExploration
1eebf7cb489ec019421206130d327accac241aad
[ "MIT" ]
null
null
null
code/utilities.lua
gabri-16/RobotExploration
1eebf7cb489ec019421206130d327accac241aad
[ "MIT" ]
null
null
null
code/utilities.lua
gabri-16/RobotExploration
1eebf7cb489ec019421206130d327accac241aad
[ "MIT" ]
null
null
null
---- Utilities ---- ---- Sensors preprocessing ---- OBSTACLE_THRESHOLD = 0.8 -- [0,1], 0 -> no obstacle, increasing exponentially -- Count the number of stopped robots sensed close to the items sensed on a given channel function count_RAB(channel, sensing_range) number_robot_sensed = 0 for i = 1, #robot.range_and_bearing do -- for each robot seen, check they it is close enough if robot.range_and_bearing[i].range < sensing_range and robot.range_and_bearing[i].data[channel] == 1 then number_robot_sensed = number_robot_sensed + 1 end end return number_robot_sensed end -- Check if a robot is in the base function is_in_base() max = 0 for i = 1, #robot.motor_ground do v = robot.motor_ground[i].value if (v > max) then max = v end end return max <= WHITE_GROUND_THRESHOLD end function is_near_obstacle() local obstacle = 0 -- Usage og 0-1 values since true-false create issues... for i=1, #robot.proximity do if robot.proximity[i].value > OBSTACLE_THRESHOLD then obstacle = 1 end end return obstacle end ---- Actuators postprocessing ---- -- Bring velocity back to range [MIN_VELOCITY, MAX_VELOCITY] function restrain_velocity(velocity) local restrained_v = velocity restrained_v.left = math.max(restrained_v.left, MIN_VELOCITY) restrained_v.left = math.min(restrained_v.left, MAX_VELOCITY) restrained_v.right = math.max(restrained_v.right, MIN_VELOCITY) restrained_v.right = math.min(restrained_v.right, MAX_VELOCITY) return restrained_v end ---- Miscellaneous ---- -- Ternary operator like function ternary(cond, T, F) if cond then return T else return F end end
27.42623
110
0.722654
3e74a2597974e0defa6eba07a59cfa40b2877a25
13,942
h
C
ace/ace/Proactor_Impl.h
tharindusathis/sourcecodes-of-CodeReadingTheOpenSourcePerspective
1b0172cdb78757fd17898503aaf6ce03d940ef28
[ "Apache-1.1" ]
46
2015-12-04T17:12:58.000Z
2022-03-11T04:30:49.000Z
ace/ace/Proactor_Impl.h
tharindusathis/sourcecodes-of-CodeReadingTheOpenSourcePerspective
1b0172cdb78757fd17898503aaf6ce03d940ef28
[ "Apache-1.1" ]
null
null
null
ace/ace/Proactor_Impl.h
tharindusathis/sourcecodes-of-CodeReadingTheOpenSourcePerspective
1b0172cdb78757fd17898503aaf6ce03d940ef28
[ "Apache-1.1" ]
23
2016-10-24T09:18:14.000Z
2022-02-25T02:11:35.000Z
/* -*- C++ -*- */ //============================================================================= /** * @file Proactor_Impl.h * * Proactor_Impl.h,v 4.14 2001/05/17 15:35:41 schmidt Exp * * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> */ //============================================================================= #ifndef ACE_PROACTOR_IMPL_H #define ACE_PROACTOR_IMPL_H #include "ace/pre.h" #include "ace/OS.h" #if ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) // This only works on Win32 platforms and on Unix platforms supporting // aio calls. #include "ace/Asynch_IO.h" #include "ace/Reactor.h" /** * @class ACE_Proactor_Impl * * @brief A manager for asynchronous event demultiplexing. This class * is the base class for all the concrete implementation * classes. * * See the Proactor pattern description at * http://www.cs.wustl.edu/~schmidt/proactor.ps.gz for more * details. */ class ACE_Export ACE_Proactor_Impl : public ACE_Event_Handler { public: /// Virtual destruction. virtual ~ACE_Proactor_Impl (void) {} /// Close the IO completion port. virtual int close (void) = 0; /// This method adds the <handle> to the I/O completion port. This /// function is a no-op function for Unix systems. virtual int register_handle (ACE_HANDLE handle, const void *completion_key) = 0; /** * Dispatch a single set of events. If <wait_time> elapses before * any events occur, return 0. Return 1 on success i.e., when a * completion is dispatched, non-zero (-1) on errors and errno is * set accordingly. */ virtual int handle_events (ACE_Time_Value &wait_time) = 0; /** * Block indefinitely until at least one event is dispatched. * Dispatch a single set of events. If <wait_time> elapses before * any events occur, return 0. Return 1 on success i.e., when a * completion is dispatched, non-zero (-1) on errors and errno is * set accordingly. */ virtual int handle_events (void) = 0; /// Add wakeup dispatch threads (reinit). virtual int wake_up_dispatch_threads (void) = 0; /// Close all dispatch threads. virtual int close_dispatch_threads (int wait) = 0; /// Number of thread used as a parameter to CreatIoCompletionPort. virtual size_t number_of_threads (void) const = 0; virtual void number_of_threads (size_t threads) = 0; /// Get the event handle. virtual ACE_HANDLE get_handle (void) const = 0; // // = Factory methods for the operations // // Note that the user does not have to use or know about these // methods. /// Create the correct implementation class for doing Asynch_Read_Stream. virtual ACE_Asynch_Read_Stream_Impl *create_asynch_read_stream (void) = 0; /// Create the correct implementation class for doing Asynch_Write_Stream. virtual ACE_Asynch_Write_Stream_Impl *create_asynch_write_stream (void) = 0; /// Create the correct implementation class for doing Asynch_Read_File. virtual ACE_Asynch_Read_File_Impl *create_asynch_read_file (void) = 0; /// Create the correct implementation class for doing Asynch_Write_File. virtual ACE_Asynch_Write_File_Impl *create_asynch_write_file (void) = 0; /// Create the correct implementation class for doing Asynch_Accept. virtual ACE_Asynch_Accept_Impl *create_asynch_accept (void) = 0; /// Create the correct implementation class for doing Asynch_Transmit_File. virtual ACE_Asynch_Transmit_File_Impl *create_asynch_transmit_file (void) = 0; /// Create the correct implementation class for doing /// Asynch_Read_Dgram. virtual ACE_Asynch_Read_Dgram_Impl *create_asynch_read_dgram (void) = 0; /// Create the correct implementation class for doing /// Asynch_Write_Dgram. virtual ACE_Asynch_Write_Dgram_Impl *create_asynch_write_dgram (void) = 0; // // = Factory methods for the results // // Note that the user does not have to use or know about these // methods unless they want to "fake" results. /// Create the correct implementation class for ACE_Asynch_Read_Stream::Result class. virtual ACE_Asynch_Read_Stream_Result_Impl *create_asynch_read_stream_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void* act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Write_Stream::Result. virtual ACE_Asynch_Write_Stream_Result_Impl *create_asynch_write_stream_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_write, const void* act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Read_File::Result. virtual ACE_Asynch_Read_File_Result_Impl *create_asynch_read_file_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void* act, u_long offset, u_long offset_high, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Write_File::Result. virtual ACE_Asynch_Write_File_Result_Impl *create_asynch_write_file_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_write, const void* act, u_long offset, u_long offset_high, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Read_Dgram::Result. virtual ACE_Asynch_Read_Dgram_Result_Impl *create_asynch_read_dgram_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_read, int flags, int protocol_family, const void* act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Write_Dgram::Result. virtual ACE_Asynch_Write_Dgram_Result_Impl *create_asynch_write_dgram_result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_write, int flags, const void* act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Accept::Result. virtual ACE_Asynch_Accept_Result_Impl *create_asynch_accept_result (ACE_Handler &handler, ACE_HANDLE listen_handle, ACE_HANDLE accept_handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void* act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /// Create the correct implementation class for ACE_Asynch_Transmit_File::Result. virtual ACE_Asynch_Transmit_File_Result_Impl *create_asynch_transmit_file_result (ACE_Handler &handler, ACE_HANDLE socket, ACE_HANDLE file, ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, u_long bytes_to_write, u_long offset, u_long offset_high, u_long bytes_per_send, u_long flags, const void *act, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN) = 0; /** * Create the correct implementation object for the Timer * result. POSIX_SIG_Proactor will create a Timer object with a * meaningful signal number, if you leave the signal number as 0. */ virtual ACE_Asynch_Result_Impl *create_asynch_timer (ACE_Handler &handler, const void *act, const ACE_Time_Value &tv, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = 0) = 0; /** * Post <how_many> completions to the completion port so that all * threads can wake up. This is used in conjunction with the * <run_event_loop>. */ virtual int post_wakeup_completions (int how_many) = 0; }; #endif /* (ACE_WIN32 && ACE_HAS_WINCE) || ACE_HAS_AIO_CALLS */ #include "ace/post.h" #endif /* ACE_PROACTOR_IMPL_H */
58.827004
150
0.431861
3e3e6bdc5a0c9debbf6d3c3c05cbab72b5b95900
3,551
h
C
Example/Pods/JXCategoryKit/JXCategoryKit/Foundation/NSData/NSData+JXEncrypt.h
ZiOS-Repo/IU_RTImagePicker
544813058445b9bef4fe158b04107815df324c42
[ "MIT" ]
4
2020-03-24T16:27:12.000Z
2021-07-28T15:45:43.000Z
Example/Pods/JXCategoryKit/JXCategoryKit/Foundation/NSData/NSData+JXEncrypt.h
ZiOS-Repo/IU_RTImagePicker
544813058445b9bef4fe158b04107815df324c42
[ "MIT" ]
null
null
null
Example/Pods/JXCategoryKit/JXCategoryKit/Foundation/NSData/NSData+JXEncrypt.h
ZiOS-Repo/IU_RTImagePicker
544813058445b9bef4fe158b04107815df324c42
[ "MIT" ]
null
null
null
// // NSData+JXEncrypt.h // JXCategoryKit // // Created by Barnett on 2020/4/13. // Copyright © 2020 Barnett. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSUInteger, JXDataCryptType) { JXDataCryptTypeDES = 0, JXDataCryptType3DES, JXDataCryptTypeAES128, JXDataCryptTypeAES192, JXDataCryptTypeAES256 }; @interface NSData (JXEncrypt) #pragma mark - Hash /// 返回md2哈希的小写NSString。 - (NSString *)jx_md2String; /// 返回md2哈希值的NSData。 - (NSData *)jx_md2Data; /// 返回md4哈希的小写NSString。 - (NSString *)jx_md4String; /// 返回md4哈希值的NSData。 - (NSData *)jx_md4Data; /// 返回md5哈希的小写NSString。 - (NSString *)jx_md5String; /// 返回md5哈希值的NSData。 - (NSData *)jx_md5Data; /// 返回sha1哈希的小写NSString。 - (NSString *)jx_sha1String; /// 返回sha1哈希值的NSData。 - (NSData *)jx_sha1Data; /// 返回sha224哈希的小写NSString。 - (NSString *)jx_sha224String; /// 返回sha224哈希值的NSData。 - (NSData *)jx_sha224Data; /// 返回sha256哈希的小写NSString。 - (NSString *)jx_sha256String; /// 返回sha256哈希值的NSData。 - (NSData *)jx_sha256Data; /// 返回sha384哈希的小写NSString。 - (NSString *)jx_sha384String; /// 返回sha384哈希值的NSData。 - (NSData *)jx_sha384Data; /// 返回sha512哈希的小写NSString。 - (NSString *)jx_sha512String; /// 返回sha512哈希值的NSData。 - (NSData *)jx_sha512Data; /// 基于散列的消息认证码 HMAC-MD5加密 - (NSString *)jx_hmacMD5StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-MD5加密 - (NSData *)jx_hmacMD5DataWithKey:(NSData *)key; /// 基于散列的消息认证码 HMAC-SHA1加密 - (NSString *)jx_hmacSHA1StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-SHA1加密 - (NSData *)jx_hmacSHA1DataWithKey:(NSData *)key; /// 基于散列的消息认证码 HMAC-SHA224加密 - (NSString *)jx_hmacSHA224StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-SHA224加密 - (NSData *)jx_hmacSHA224DataWithKey:(NSData *)key; /// 基于散列的消息认证码 HMAC-SHA256加密 - (NSString *)jx_hmacSHA256StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-SHA256加密 - (NSData *)jx_hmacSHA256DataWithKey:(NSData *)key; /// 基于散列的消息认证码 HMAC-SHA384加密 - (NSString *)jx_hmacSHA384StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-SHA384加密 - (NSData *)jx_hmacSHA384DataWithKey:(NSData *)key; /// 基于散列的消息认证码 HMAC-SHA512加密 - (NSString *)jx_hmacSHA512StringWithKey:(NSString *)key; /// 基于散列的消息认证码 HMAC-SHA512加密 - (NSData *)jx_hmacSHA512DataWithKey:(NSData *)key; /// crc32哈希算法 - (NSString *)jx_crc32String; /// crc32哈希值 - (uint32_t)jx_crc32; #pragma mark - 加密解密 /// 加密 DES数据块长度为64位,所以IV长度需要为8个字符(ECB模式不用IV),密钥长度也为8个字符,IV与密钥超过长度则截取,不足则在末尾填充'\0'补足 AES数据块长度为128位,所以IV长度需要为16个字符(ECB模式不用IV),密钥根据指定密钥位数分别为16、24、32个字符,IV与密钥超过长度则截取,不足则在末尾填充'\0'补足 3DES数据块长度为64位,所以IV长度需要为8个字符(ECB模式不用IV),密钥长度为16或24个字符(8个字符以内则结果与DES相同),IV与密钥超过长度则截取,不足则在末尾填充'\0'补足 /// @param type 加密类型 /// @param key 秘钥 /// @param iv 初始化向量 - (NSData *)jx_encryptWithType:(JXDataCryptType)type key:(NSString *)key iv:(nullable NSString *)iv; /// 解密 /// @param type 加密类型 /// @param key 秘钥 /// @param iv 初始化向量 - (NSData *)jx_decryptWithType:(JXDataCryptType)type key:(NSString *)key iv:(nullable NSString *)iv; #pragma mark - Encode and decode /// 返回以UTF8解码的字符串。 - (nullable NSString *)jx_utf8String; /// 返回十六进制的大写NSString。 - (nullable NSString *)jx_hexString; /// 从十六进制字符串返回NSData。 /// @param hexString 不区分大小写的十六进制字符串。 + (nullable NSData *)jx_dataWithHexString:(NSString *)hexString; /// 返回base64编码的NSString。 - (nullable NSString *)jx_base64EncodedString; /// 从base64编码的字符串返回NSData。 + (nullable NSData *)jx_dataWithBase64EncodedString:(NSString *)base64EncodedString; /// 返回NSDictionary或NSArray用于已解码的self。如果发生错误,则返回nil。 - (nullable id)jx_jsonValueDecoded; @end NS_ASSUME_NONNULL_END
25.919708
274
0.747677
f033f0846a998f9a5ac92cbb40712c19a572ab8c
623
py
Python
extra_tests/ctypes_tests/test_unions.py
nanjekyejoannah/pypy
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
[ "Apache-2.0", "OpenSSL" ]
333
2015-08-08T18:03:38.000Z
2022-03-22T18:13:12.000Z
extra_tests/ctypes_tests/test_unions.py
nanjekyejoannah/pypy
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
[ "Apache-2.0", "OpenSSL" ]
7
2020-02-16T16:49:05.000Z
2021-11-26T09:00:56.000Z
extra_tests/ctypes_tests/test_unions.py
nanjekyejoannah/pypy
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
[ "Apache-2.0", "OpenSSL" ]
55
2015-08-16T02:41:30.000Z
2022-03-20T20:33:35.000Z
import sys from ctypes import * def test_getattr(): class Stuff(Union): _fields_ = [('x', c_char), ('y', c_int)] stuff = Stuff() stuff.y = ord('x') | (ord('z') << 24) if sys.byteorder == 'little': assert stuff.x == b'x' else: assert stuff.x == b'z' def test_union_of_structures(): class Stuff(Structure): _fields_ = [('x', c_int)] class Stuff2(Structure): _fields_ = [('x', c_int)] class UnionofStuff(Union): _fields_ = [('one', Stuff), ('two', Stuff2)] u = UnionofStuff() u.one.x = 3 assert u.two.x == 3
21.482759
48
0.523274
7bce250e0170ccb964f4692c913bf8f9ec3db4d2
72
rb
Ruby
slack-api-explorer/app.rb
dblock/slack-metabot
b5baf885ebd0712c0cf7cb7b06967c03c5c1be29
[ "CC-BY-3.0" ]
9
2016-01-05T21:49:13.000Z
2016-01-21T01:48:22.000Z
slack-api-explorer/app.rb
dblock/slack-metabot
b5baf885ebd0712c0cf7cb7b06967c03c5c1be29
[ "CC-BY-3.0" ]
3
2016-01-05T22:25:14.000Z
2016-01-06T15:17:01.000Z
slack-api-explorer/app.rb
dblock/slack-metabot
b5baf885ebd0712c0cf7cb7b06967c03c5c1be29
[ "CC-BY-3.0" ]
1
2017-05-19T02:02:18.000Z
2017-05-19T02:02:18.000Z
module SlackApiExplorer class App < SlackRubyBotServer::App end end
14.4
37
0.791667
56825b75714d56d4ddee196a83bfb6d71e6761a5
7,075
sql
SQL
assets/sql_database/db_freepik_v5.sql
reyhanfikri/freepik
187a5babbecf1ac841661ab0a01030ee452b303e
[ "MIT" ]
null
null
null
assets/sql_database/db_freepik_v5.sql
reyhanfikri/freepik
187a5babbecf1ac841661ab0a01030ee452b303e
[ "MIT" ]
1
2018-04-05T05:56:01.000Z
2018-04-25T13:50:56.000Z
assets/sql_database/db_freepik_v5.sql
reyhanfikri/freepik
187a5babbecf1ac841661ab0a01030ee452b303e
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 09, 2018 at 03:52 PM -- Server version: 10.1.30-MariaDB -- PHP Version: 7.2.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `db_freepik` -- -- -------------------------------------------------------- -- -- Table structure for table `t_comment` -- CREATE TABLE `t_comment` ( `id_comment` int(11) NOT NULL, `id_gambar` int(11) NOT NULL, `id_user` int(11) NOT NULL, `comment` longtext NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_comment` -- INSERT INTO `t_comment` (`id_comment`, `id_gambar`, `id_user`, `comment`) VALUES (1, 1, 3, 'Lucu banget!!! ( >v<)'), (2, 6, 3, 'Kok bisa gitu wkwkwk'), (3, 2, 3, 'Bisa pas gitu loh xD'), (4, 3, 3, 'Keren!'), (5, 1, 4, 'So cute! :3'), (6, 2, 4, 'A fluffy ball :3'), (7, 1, 4, ':3'); -- -------------------------------------------------------- -- -- Table structure for table `t_ekstensi_gambar` -- CREATE TABLE `t_ekstensi_gambar` ( `id_ekstensi_gambar` int(11) NOT NULL, `ekstensi_gambar` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_ekstensi_gambar` -- INSERT INTO `t_ekstensi_gambar` (`id_ekstensi_gambar`, `ekstensi_gambar`) VALUES (1, 'jpg'), (2, 'png'); -- -------------------------------------------------------- -- -- Table structure for table `t_gambar` -- CREATE TABLE `t_gambar` ( `id_gambar` int(11) NOT NULL, `id_user` int(11) NOT NULL, `id_ekstensi_gambar` int(11) NOT NULL, `nama_gambar` varchar(100) NOT NULL, `nama_file` varchar(200) NOT NULL, `jumlah_like` int(11) NOT NULL, `jumlah_view` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_gambar` -- INSERT INTO `t_gambar` (`id_gambar`, `id_user`, `id_ekstensi_gambar`, `nama_gambar`, `nama_file`, `jumlah_like`, `jumlah_view`) VALUES (1, 2, 1, 'cute_kitten', 'cute_kitten.jpg', 0, 71), (2, 2, 1, 'perfectly-timed-funny-cat-pictures-5', 'perfectly-timed-funny-cat-pictures-5.jpg', 0, 31), (3, 2, 1, 'fantasy_background', 'fantasy_background.jpg', 0, 9), (4, 2, 1, 'cat', 'cat.jpg', 0, 3), (5, 2, 1, 'blue', 'blue.jpg', 0, 6), (6, 2, 1, 'mobil_kaca', 'mobil_kaca.jpg', 0, 8), (7, 2, 1, 'tipsskripsi', 'tipsskripsi.jpg', 0, 2), (8, 4, 1, 'fujisan-fumotoppara-campground-reflection-70684195', 'fujisan-fumotoppara-campground-reflection-70684195.jpg', 0, 5); -- -------------------------------------------------------- -- -- Table structure for table `t_role` -- CREATE TABLE `t_role` ( `id_role` int(11) NOT NULL, `role` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_role` -- INSERT INTO `t_role` (`id_role`, `role`) VALUES (1, 'user_biasa'), (2, 'user_admin'); -- -------------------------------------------------------- -- -- Table structure for table `t_user` -- CREATE TABLE `t_user` ( `id` int(11) NOT NULL, `id_role` int(11) NOT NULL, `email` varchar(100) NOT NULL, `username` varchar(100) NOT NULL, `password` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_user` -- INSERT INTO `t_user` (`id`, `id_role`, `email`, `username`, `password`) VALUES (1, 2, 'admin@gmail.com', 'admin', 'admin'), (2, 1, 'reyhanfikri@student.upi.edu', 'reyhanfikri', '123456'), (3, 1, 'r@gmail.com', 'rrr', '654321'), (4, 1, 'noir@gmail.com', 'noir', 'scarlet'); -- -------------------------------------------------------- -- -- Table structure for table `t_user_profile` -- CREATE TABLE `t_user_profile` ( `id_user_profile` int(11) NOT NULL, `id_user` int(11) NOT NULL, `nama_lengkap` varchar(100) DEFAULT NULL, `jenis_kelamin` varchar(100) DEFAULT NULL, `alamat` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `t_user_profile` -- INSERT INTO `t_user_profile` (`id_user_profile`, `id_user`, `nama_lengkap`, `jenis_kelamin`, `alamat`) VALUES (1, 2, NULL, NULL, NULL), (2, 3, NULL, NULL, NULL), (3, 4, NULL, NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `t_comment` -- ALTER TABLE `t_comment` ADD PRIMARY KEY (`id_comment`), ADD KEY `fk3` (`id_gambar`), ADD KEY `fk4` (`id_user`); -- -- Indexes for table `t_ekstensi_gambar` -- ALTER TABLE `t_ekstensi_gambar` ADD PRIMARY KEY (`id_ekstensi_gambar`); -- -- Indexes for table `t_gambar` -- ALTER TABLE `t_gambar` ADD PRIMARY KEY (`id_gambar`), ADD KEY `fk2` (`id_user`), ADD KEY `fk_ekstensi_gambar` (`id_ekstensi_gambar`); -- -- Indexes for table `t_role` -- ALTER TABLE `t_role` ADD PRIMARY KEY (`id_role`); -- -- Indexes for table `t_user` -- ALTER TABLE `t_user` ADD PRIMARY KEY (`id`), ADD KEY `fk_role` (`id_role`); -- -- Indexes for table `t_user_profile` -- ALTER TABLE `t_user_profile` ADD PRIMARY KEY (`id_user_profile`), ADD KEY `fk_name` (`id_user`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `t_comment` -- ALTER TABLE `t_comment` MODIFY `id_comment` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `t_ekstensi_gambar` -- ALTER TABLE `t_ekstensi_gambar` MODIFY `id_ekstensi_gambar` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `t_gambar` -- ALTER TABLE `t_gambar` MODIFY `id_gambar` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `t_user` -- ALTER TABLE `t_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `t_user_profile` -- ALTER TABLE `t_user_profile` MODIFY `id_user_profile` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `t_comment` -- ALTER TABLE `t_comment` ADD CONSTRAINT `fk3` FOREIGN KEY (`id_gambar`) REFERENCES `t_gambar` (`id_gambar`), ADD CONSTRAINT `fk4` FOREIGN KEY (`id_user`) REFERENCES `t_user` (`id`); -- -- Constraints for table `t_gambar` -- ALTER TABLE `t_gambar` ADD CONSTRAINT `fk2` FOREIGN KEY (`id_user`) REFERENCES `t_user` (`id`), ADD CONSTRAINT `fk_ekstensi_gambar` FOREIGN KEY (`id_ekstensi_gambar`) REFERENCES `t_ekstensi_gambar` (`id_ekstensi_gambar`); -- -- Constraints for table `t_user` -- ALTER TABLE `t_user` ADD CONSTRAINT `fk_role` FOREIGN KEY (`id_role`) REFERENCES `t_role` (`id_role`); -- -- Constraints for table `t_user_profile` -- ALTER TABLE `t_user_profile` ADD CONSTRAINT `fk_name` FOREIGN KEY (`id_user`) REFERENCES `t_user` (`id`) ON UPDATE CASCADE; COMMIT; /*!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 */;
25.267857
134
0.651873
8f8fb19e7872e8916b0097847907729683d9eddb
340
kt
Kotlin
app/src/main/java/com/buchi/fullentry/movie/domain/DataToEntity.kt
SunnyBe/MovieApp
f4c1d6c8067c4149d357a4ded6e6455b60b15156
[ "Unlicense" ]
null
null
null
app/src/main/java/com/buchi/fullentry/movie/domain/DataToEntity.kt
SunnyBe/MovieApp
f4c1d6c8067c4149d357a4ded6e6455b60b15156
[ "Unlicense" ]
null
null
null
app/src/main/java/com/buchi/fullentry/movie/domain/DataToEntity.kt
SunnyBe/MovieApp
f4c1d6c8067c4149d357a4ded6e6455b60b15156
[ "Unlicense" ]
null
null
null
package com.buchi.fullentry.movie.domain import com.buchi.fullentry.movie.data.cache.MovieData import com.buchi.fullentry.movie.model.Movie fun MovieData.toEntity() = Movie( id, title, originalTitle, originalLanguage, adult, overview, backdropPath, listOf(1,2), mediaType, popularity, posterPath, voteAverage, voteCount, releaseDate )
42.5
162
0.802941
fd4dd176c9903fc95769110d223116bef93ead7f
3,323
h
C
octet/src/math/bvec4.h
MatthewDuddington/MG1_01_LSystems
5aa0f657452705ee4960e4859f04192d121cc960
[ "MIT" ]
null
null
null
octet/src/math/bvec4.h
MatthewDuddington/MG1_01_LSystems
5aa0f657452705ee4960e4859f04192d121cc960
[ "MIT" ]
null
null
null
octet/src/math/bvec4.h
MatthewDuddington/MG1_01_LSystems
5aa0f657452705ee4960e4859f04192d121cc960
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////// // // (C) Andy Thomason 2012-2014 // // Modular Framework for OpenGLES2 rendering on multiple platforms. // // Boolean Vector class // namespace octet { namespace math { // boolean vector class bvec4 { int v[4]; // (v < 0) = true, (v >= 0) = false public: bvec4() {} bvec4(bool x, bool y, bool z, bool w) { v[0] = x ? -1 : 0; v[1] = y ? -1 : 0; v[2] = z ? -1 : 0; v[3] = w ? -1 : 0; }; bvec4(int x, int y, int z, int w) { v[0] = x; v[1] = y; v[2] = z; v[3] = w; }; int &operator[](int i) { return v[i]; } const int &operator[](int i) const { return v[i]; } bvec4 operator&(int r) const { return bvec4(v[0]&r, v[1]&r, v[2]&r, v[3]&r); } bvec4 operator|(int r) const { return bvec4(v[0]|r, v[1]|r, v[2]|r, v[3]|r); } bvec4 operator^(int r) const { return bvec4(v[0]^r, v[1]^r, v[2]^r, v[3]^r); } bvec4 operator&(const bvec4 &r) const { return bvec4(v[0]&r.v[0], v[1]&r.v[1], v[2]&r.v[2], v[3]&r.v[3]); } bvec4 operator|(const bvec4 &r) const { return bvec4(v[0]|r.v[0], v[1]|r.v[1], v[2]|r.v[2], v[3]|r.v[3]); } bvec4 operator^(const bvec4 &r) const { return bvec4(v[0]^r.v[0], v[1]^r.v[1], v[2]^r.v[2], v[3]^r.v[3]); } bvec4 &operator&=(const bvec4 &r) { v[0] &= r.v[0]; v[1] &= r.v[1]; v[2] &= r.v[2]; v[3] &= r.v[3]; return *this; } bvec4 &operator|=(const bvec4 &r) { v[0] |= r.v[0]; v[1] |= r.v[1]; v[2] |= r.v[2]; v[3] |= r.v[3]; return *this; } bvec4 &operator^=(const bvec4 &r) { v[0] ^= r.v[0]; v[1] ^= r.v[1]; v[2] ^= r.v[2]; v[3] ^= r.v[3]; return *this; } bvec4 operator~() const { return bvec4(~v[0], ~v[1], ~v[2], ~v[3]); } bvec4 xy() const { return bvec4(v[0], v[1], 0, 0); } bvec4 xyz() const { return bvec4(v[0], v[1], v[2], 0); } bvec4 xyz1() const { return bvec4(v[0], v[1], v[2], 1); } int &x() { return v[0]; } int &y() { return v[1]; } int &z() { return v[2]; } int &w() { return v[3]; } int x() const { return v[0]; } int y() const { return v[1]; } int z() const { return v[2]; } int w() const { return v[3]; } }; inline bvec4 operator>(const vec4 &lhs, const vec4 &rhs) { return bvec4(fgt(lhs.x(), rhs.x()), fgt(lhs.y(), rhs.y()), fgt(lhs.z(), rhs.z()), fgt(lhs.w(), rhs.w())); } inline bvec4 operator<(const vec4 &lhs, const vec4 &rhs) { return bvec4(flt(lhs.x(), rhs.x()), flt(lhs.y(), rhs.y()), flt(lhs.z(), rhs.z()), flt(lhs.w(), rhs.w())); } inline bvec4 operator>=(const vec4 &lhs, const vec4 &rhs) { return bvec4(fge(lhs.x(), rhs.x()), fge(lhs.y(), rhs.y()), fge(lhs.z(), rhs.z()), fge(lhs.w(), rhs.w())); } inline bvec4 operator<=(const vec4 &lhs, const vec4 &rhs) { return bvec4(fle(lhs.x(), rhs.x()), fle(lhs.y(), rhs.y()), fle(lhs.z(), rhs.z()), fle(lhs.w(), rhs.w())); } inline bvec4 operator==(const vec4 &lhs, const vec4 &rhs) { return bvec4(feq(lhs.x(), rhs.x()), feq(lhs.y(), rhs.y()), feq(lhs.z(), rhs.z()), feq(lhs.w(), rhs.w())); } inline bvec4 operator!=(const vec4 &lhs, const vec4 &rhs) { return bvec4(fne(lhs.x(), rhs.x()), fne(lhs.y(), rhs.y()), fne(lhs.z(), rhs.z()), fne(lhs.w(), rhs.w())); } bool all(const bvec4 &b) { return (b.x() & b.y() & b.z() & b.w()) < 0; } bool any(const bvec4 &b) { return (b.x() | b.y() | b.z() | b.w()) < 0; } } }
54.47541
169
0.506771
15234c386a54977f631d7c0fd7126e91e254fa5e
4,260
sql
SQL
sources/nfirs/scripts/materialized_views/nist.lr_mr_pred.sql
tbuffington7/data
6ef19c9ad5b3c9cea6fcdf13d04e7edf51aa7eb9
[ "MIT" ]
null
null
null
sources/nfirs/scripts/materialized_views/nist.lr_mr_pred.sql
tbuffington7/data
6ef19c9ad5b3c9cea6fcdf13d04e7edf51aa7eb9
[ "MIT" ]
null
null
null
sources/nfirs/scripts/materialized_views/nist.lr_mr_pred.sql
tbuffington7/data
6ef19c9ad5b3c9cea6fcdf13d04e7edf51aa7eb9
[ "MIT" ]
null
null
null
CREATE MATERIALIZED VIEW nist.lr_mr_pred AS SELECT tr.year, tr.tr10_fid AS geoid, tr.region, tr.state, g.id AS fd_id, 'size_'::text || g.population_class::text AS fd_size, 1 AS f_located, CASE WHEN acs."B25002_002E" > 0 THEN acs."B01001_001E"::double precision / acs."B25002_002E"::double precision WHEN acs."B25002_002E" = 0 AND acs."B01001_001E" > 0 THEN 'Infinity'::double precision ELSE 'NaN'::double precision END AS ave_hh_sz, acs."B01001_001E" AS pop, acs."B02001_003E" AS black, acs."B02001_004E" AS amer_es, acs."B02001_005E" + acs."B02001_006E" + acs."B02001_007E" + acs."B02001_008E" AS other, acs."B03003_003E" AS hispanic, acs."B01001_002E" AS males, acs."B01001_003E" + acs."B01001_027E" AS age_under5, acs."B01001_004E" + acs."B01001_028E" AS age_5_9, acs."B01001_005E" + acs."B01001_029E" AS age_10_14, acs."B01001_006E" + acs."B01001_007E" + acs."B01001_030E" + acs."B01001_031E" AS age_15_19, acs."B01001_008E" + acs."B01001_009E" + acs."B01001_010E" + acs."B01001_032E" + acs."B01001_033E" + acs."B01001_034E" AS age_20_24, acs."B01001_011E" + acs."B01001_012E" + acs."B01001_035E" + acs."B01001_036E" AS age_25_34, acs."B01001_013E" + acs."B01001_014E" + acs."B01001_037E" + acs."B01001_038E" AS age_35_44, acs."B01001_015E" + acs."B01001_016E" + acs."B01001_039E" + acs."B01001_040E" AS age_45_54, acs."B01001_017E" + acs."B01001_018E" + acs."B01001_019E" + acs."B01001_041E" + acs."B01001_042E" + acs."B01001_043E" AS age_55_64, acs."B01001_020E" + acs."B01001_021E" + acs."B01001_022E" + acs."B01001_044E" + acs."B01001_045E" + acs."B01001_046E" AS age_65_74, acs."B01001_023E" + acs."B01001_024E" + acs."B01001_047E" + acs."B01001_048E" AS age_75_84, acs."B01001_025E" + acs."B01001_049E" AS age_85_up, acs."B25002_001E" AS hse_units, acs."B25002_003E" AS vacant, acs."B25014_008E" AS renter_occ, acs."B25014_005E" + acs."B25014_006E" + acs."B25014_007E" + acs."B25014_011E" + acs."B25014_012E" + acs."B25014_013E" AS crowded, acs."B25024_002E" + acs."B25024_003E" + acs."B25024_004E" AS sfr, acs."B25024_007E" + acs."B25024_008E" + acs."B25024_009E" AS units_10, acs."B25024_010E" AS mh, acs."B25034_006E" + acs."B25034_007E" + acs."B25034_008E" + acs."B25034_009E" + acs."B25034_010E" AS older, pcl.apts_n AS apt_parcels, pcl.mr_n AS mr_parcels, acs."B19013_001E" AS inc_hh, acs."B25040_002E" AS fuel_gas, acs."B25040_003E" AS fuel_tank, acs."B25040_005E" AS fuel_oil, acs."B25040_006E" AS fuel_coal, acs."B25040_007E" AS fuel_wood, acs."B25040_008E" AS fuel_solar, acs."B25040_009E" AS fuel_other, acs."B25040_010E" AS fuel_none, svi.r_pl_themes AS svi, acs."B12001_001" - (acs."B12001_003" + acs."B12001_012") AS married, acs."B23025_005" AS unemployed, acs."B12001_007" AS nilf, sm.adult_smoke AS smoke_st, sc.smoking_pct AS smoke_cty FROM nist.tract_years_2 tr LEFT JOIN nist.svi2010 svi ON tr.tr10_fid = ('14000US'::text || lpad(svi.fips::text, 11, '0')) LEFT JOIN firestation_firedepartment g ON tr.state::text = g.state::text AND tr.fdid::text = g.fdid::text LEFT JOIN nist.acs_est_new acs ON tr.tr10_fid = acs.geoid AND acs.year = (SELECT max(year) FROM nist.acs_est_new) LEFT JOIN nist.sins sm ON tr.state::text = sm.postal_code AND sm.year = 2010 LEFT JOIN nist.sins_county sc ON "substring"(tr.tr10_fid, 8, 5) = sc.fips LEFT JOIN nist.med_risk_parcel_info pcl ON tr.tr10_fid = ((('14000US'::text || pcl.state_code) || pcl.cnty_code) || pcl.tract) WHERE tr.year = 2016 WITH DATA; ALTER TABLE nist.lr_mr_pred OWNER TO firecares; GRANT ALL ON TABLE nist.lr_mr_pred TO sgilbert; GRANT SELECT ON TABLE nist.lr_mr_pred TO firecares; COMMENT ON MATERIALIZED VIEW nist.lr_mr_pred IS 'This collects all the data needed to predict the number of fires etc. for low and medium risk fires. There is (or should be) one entry per census tract. The main issue with this query is the use of hard-coded dates in a couple of places in the JOIN clauses. As currently written, they will have to be updated periodically to keep the query up to date.';
54.615385
135
0.697887
b87f7b0415aabdb4bad155f0fb58a242243d06d3
174
rs
Rust
episcopal_api/crates/library/src/rite2/office/mod.rs
gbj/commonprayer
15197dcb7fc2417b5f5695964eb0afbeb2969f94
[ "MIT" ]
1
2022-02-04T14:30:45.000Z
2022-02-04T14:30:45.000Z
episcopal_api/crates/library/src/rite2/office/mod.rs
gbj/commonprayer
15197dcb7fc2417b5f5695964eb0afbeb2969f94
[ "MIT" ]
5
2022-02-09T13:48:36.000Z
2022-03-04T16:50:49.000Z
episcopal_api/crates/library/src/rite2/office/mod.rs
gbj/commonprayer
15197dcb7fc2417b5f5695964eb0afbeb2969f94
[ "MIT" ]
null
null
null
mod categories; pub mod evening_prayer; pub mod morning_prayer; pub use categories::*; pub use evening_prayer::EVENING_PRAYER_II; pub use morning_prayer::MORNING_PRAYER_II;
21.75
42
0.821839
4a4e92405d92e62d7827656a97c28d5fc2f7c793
141
js
JavaScript
src/APIs/people/controllers/index.js
pethersonmoreno/cash-flow-api
806c396aa37025cff643d03ec845661d99634eec
[ "MIT" ]
1
2019-12-16T15:52:42.000Z
2019-12-16T15:52:42.000Z
src/APIs/people/controllers/index.js
pethersonmoreno/cash-flow-api
806c396aa37025cff643d03ec845661d99634eec
[ "MIT" ]
1
2021-05-10T19:35:45.000Z
2021-05-10T19:35:45.000Z
src/APIs/people/controllers/index.js
pethersonmoreno/cash-flow-api
806c396aa37025cff643d03ec845661d99634eec
[ "MIT" ]
null
null
null
const common = require('./common'); const blockUsedPerson = require('./blockUsedPerson'); module.exports = { common, blockUsedPerson };
17.625
53
0.70922
0b24c9c12856cb1232066c7941cc8a2db9d6f09f
2,496
py
Python
friction_ramp_analysis/classes/callForceRampGUI.py
JSotres/AFM-Friction-Ramp-Analysis
d663134f148575f09e2991186c991ed00598ab5e
[ "MIT" ]
null
null
null
friction_ramp_analysis/classes/callForceRampGUI.py
JSotres/AFM-Friction-Ramp-Analysis
d663134f148575f09e2991186c991ed00598ab5e
[ "MIT" ]
null
null
null
friction_ramp_analysis/classes/callForceRampGUI.py
JSotres/AFM-Friction-Ramp-Analysis
d663134f148575f09e2991186c991ed00598ab5e
[ "MIT" ]
null
null
null
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog import sys from .readNanoscopeForceRamps import * import matplotlib.pyplot as plt from ..qt5_ui_files.ForceRampGUI import * from matplotlib.backends.backend_qt5agg import (NavigationToolbar2QT as NavigationToolbar) import os import math from ..qt5_ui_files.mplwidget1plot import mplwidget1plot class forceRampGUI(QMainWindow): signal1 = QtCore.pyqtSignal(float) signal2 = QtCore.pyqtSignal(float) def __init__(self): super().__init__() self.ui = Ui_ForceRampGUI() self.ui.setupUi(self) self.ui.pushButtonSendVi.clicked.connect(self.sendVi) self.ui.pushButtonSendVf.clicked.connect(self.sendVf) self.ui.pushButtonGetValue.clicked.connect(self.getValue) MplToolbar = NavigationToolbar(self.ui.widget.canvas, self) self.addToolBar(MplToolbar) filename = QFileDialog.getOpenFileNames( self, "Open File", os.getcwd(), "All Files (*)")[0][0] self.rampObject = NanoscopeRamp(filename) self.rampObject.readHeader() self.rampObject.readRamps() self.plotRamp() def getValue(self): x1,x2 = self.ui.widget.canvas.axes.get_xlim() condition = np.logical_and((self.rampObject.Ramp[0]['RawX']>x1),(self.rampObject.Ramp[0]['RawX']<x2)) if self.ui.radioButtonForward.isChecked() == True: yf = self.rampObject.Ramp[0]['RawY'][0][condition] self.ui.lineEditValue.setText(str(format(yf.mean(),'.3f'))) elif self.ui.radioButtonBackward.isChecked() == True: yb = self.rampObject.Ramp[0]['RawY'][1][condition] self.ui.lineEditValue.setText(str(format(yb.mean(),'.3f'))) else: yf = self.rampObject.Ramp[0]['RawY'][0][condition] yb = self.rampObject.Ramp[0]['RawY'][1][condition] y2 = (yf+yb)/2 self.ui.lineEditValue.setText(str(format(y2.mean(),'.3f'))) QtCore.pyqtSlot() def sendVi(self): value = float(self.ui.lineEditValue.text()) self.signal1.emit(value) QtCore.pyqtSlot() def sendVf(self): value = float(self.ui.lineEditValue.text()) self.signal2.emit(value) def plotRamp(self): self.ui.widget.canvas.axes.clear() self.ui.widget.canvas.axes.plot(self.rampObject.Ramp[0]['RawX'], self.rampObject.Ramp[0]['RawY'][0][:]) self.ui.widget.canvas.axes.plot(self.rampObject.Ramp[0]['RawX'], self.rampObject.Ramp[1]['RawY'][1][:]) self.ui.widget.canvas.axes.set_ylabel('Photodiode Vertical Signal (V)') self.ui.widget.canvas.axes.set_xlabel('Sample Displacement (nm)') self.ui.widget.canvas.figure.tight_layout() self.ui.widget.canvas.draw()
35.657143
105
0.733574
9892b006515d05683311daa541eb079270432e7a
11,470
html
HTML
manual_atsp2K/atsp/node108.html
mansour2014/ATSP2K_plus
30842b9f086d1e497aeb778e2a352d1e8e520ec3
[ "BSD-4-Clause-UC" ]
1
2019-07-21T14:03:39.000Z
2019-07-21T14:03:39.000Z
manual_atsp2K/atsp/node108.html
mzmansour/ATSP2K_plus
30842b9f086d1e497aeb778e2a352d1e8e520ec3
[ "BSD-4-Clause-UC" ]
null
null
null
manual_atsp2K/atsp/node108.html
mzmansour/ATSP2K_plus
30842b9f086d1e497aeb778e2a352d1e8e520ec3
[ "BSD-4-Clause-UC" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.47) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Serial nonh, mchf.</TITLE> <META NAME="description" CONTENT="Serial nonh, mchf."> <META NAME="keywords" CONTENT="atsp"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="atsp.css"> <LINK REL="next" HREF="node109.html"> <LINK REL="previous" HREF="node107.html"> <LINK REL="up" HREF="node107.html"> <LINK REL="next" HREF="node109.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1634" HREF="node109.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html1630" HREF="node107.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html1624" HREF="node107.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html1632" HREF="node2.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1635" HREF="node109.html">Parallel mpi_nonh, mpi_mchf.</A> <B> Up:</B> <A NAME="tex2html1631" HREF="node107.html">I/O File Formats</A> <B> Previous:</B> <A NAME="tex2html1625" HREF="node107.html">I/O File Formats</A> &nbsp <B> <A NAME="tex2html1633" HREF="node2.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION001710000000000000000"> Serial <TT>nonh, mchf</TT>.</A> </H1> Each <TT>mchf</TT> calculation begins with computing the angular coefficient and integral data using <TT>nonh</TT>. <TT>nonh</TT> records the data in a set of files. The only input file needed by <TT>nonh</TT> is the list of configurations. By default the list of configurations is named <TT>cfg.inp</TT>. Each cfg.inp is produced by <TT>lsgen</TT> using a set of rules. <TT>lsgen</TT> generates a single file per <TT>LS</TT> term. <TT>mchf</TT> calculates the radial functions by performing optimization of the energy functional over a set of LS terms which are known to mix in the Breit-Pauli configuration interaction calculation. For each LS term in the <TT>cfg.inp</TT> file, the output data consists of a one-dimensional list of coefficients, <IMG WIDTH="31" HEIGHT="40" ALIGN="MIDDLE" BORDER="0" SRC="img49.png" ALT="$w_{ab}^{ij}$"> or <!-- MATH $v_{abcd;k}^{ij}$ --> <IMG WIDTH="50" HEIGHT="40" ALIGN="MIDDLE" BORDER="0" SRC="img50.png" ALT="$v_{abcd;k}^{ij}$"> (denoted by <TT>cn(j)</TT> in <TT>nonh</TT>, and <TT>coeff</TT> in <TT>mchf</TT>) and with each such coefficient there is associated an integral. The latter is specified by an integer, <TT>inptr(j)</TT> that indicates the position of the integral within the list of all possible integrals. In the generation of a matrix element, we then need to know where the data for a matrix element terminates. This is achieved by specifying the end position of a matrix element without the necessity of specifying the first, since it follows the last coefficient of the previous. This is the role of the array <TT>ico(i)</TT> which indicates the last position of the i'th non-zero matrix elements. Since only non-zero matrix elements are stored, another integer is needed to specify the value of the row index: <TT>jan(i)</TT> (<TT>ih(i)</TT> in <TT>mchf</TT>) is the array containing this information. Because the list of coefficients and associated integrals may become extremely large, the data is collected and written to disk after <TT>LSDIM=30000</TT> have been collected to memory. The last record for a given LS term will always contain less than <TT>LSDIM</TT> elements, possibly zero, if necessary. The value of <TT>LSDIM</TT> can readily be changed by changing four parameter statements. <P> Since <TT>nonh</TT> expects a single configuration list named <TT>cfg.inp</TT>, the configuration lists for each term participating in the <TT>mchf</TT> calculation are concatenated to <TT>cfg.inp</TT>. In general, <TT>cfg.inp</TT> is a file created by concatenating a number of configuration lists of terms that mix, or the final list contains a set of block of terms. <TT>nonh</TT> reads each block for the entire <TT>cfg.inp</TT> and computes all integral and angular data for the Hamiltonian. then, the computed data is stored in a set of files, which are used in a later stage by the by <TT>mchf</TT> calculation. <P> The files have the following format: <P> <OL> <LI><TT>cfg.inp</TT> is a text file. It is used as input to both: <TT>nonh and mchf</TT>: <PRE> cfg.inp: (formatted) For each block (1 : NB) . header (A72) -- not used by the program . List of closed shells el(1:nclosd) Format: (20(1X,A3)) For each CSF (1 : ncfg) . Configuration information (el(i),q(i), i=1,nocc) Format: (8(1x,A3,1x,I2,1x)) . Angular coupling LSv(1:nocc),RLS(1:nocc-1) Format: (15(5X,A3)) Terminating condition: * </PRE> <P> </LI> <LI><TT>cfg.h</TT>: This files is created by <TT>nonh</TT> and it contains information which pertains to the expansions for each term found in the list. <PRE> Global information (formatted: . nclosd 'Closed shells:' (I4, A15) . el(1:nclosd) (18(1X,A3)) . nwf 'Other Orbitals' (I4, A16) . el(nclosd+1:nwf) (18(1X,A3)) . nb, idim, lsdim, who (I3, I8, I8, 3X, A5) For each block (1 : NB) . Term, ncfg, max number of coeff per column, total coefficients </PRE> <P> </LI> <LI><TT>yint.lst</TT>: This is a file that has global information about all the expansions in <TT>cfg.inp</TT>. This is a binary file. yint.lst: (unformatted) <PRE> . nclosed, maxorb, nb, lsdim . list of closed shells (converted to 24A3 format) . list of other orbitals -- one or more records (24A3) format For each Block (1 : NB) . lij, jan(1:lij) repeated, terminating condition: lij &lt; lsdim ncol (or ncfg for block), jptr(1:ncol) Global information: For each . integral case (1:4) icase, noint(icase) (last position in global list of integrals) . ipackn(:), lused(:) for this case where the range is from beginning to noint(icase) </PRE> <P> </LI> <LI><TT>c.lst</TT>: The coefficients and integrals needed for the energy expression and the generation of the interaction matrix are stored, by column, sequentially for each term found in <TT>cfg.inp</TT>. This is a binary file. c.lst: (unformatted) (Each processor writes on its own c.lst.nn file) <PRE> . For each block (1:NB) ncoff, cn(1:ncoff), inptr(1:ncoff) repeated terminating condition: ncoff &lt; lsdim (may be zero) </PRE> <P> </LI> <LI><TT>ih.0n.lst</TT>: For each of the terms, numbered <IMG WIDTH="76" HEIGHT="31" ALIGN="MIDDLE" BORDER="0" SRC="img180.png" ALT="$n=1,2,..$">, a file is created which records the row index of a matrix element. This facilitates the sparse matrix representation. This also is a binary file. ih.nn.lst: (unformatted), where nn is a 2 digit number and is the block number <PRE> . lij, ico(1:lsj) repeated, terminating condition: lij &lt; lsdim ncol (or ncfg for block), jptr(1:ncol) NOTE: The use of separate ih.nn.lst for each term simplifis the memory management in diag(); </PRE> <P> </LI> <LI>summry contains some additional information: <OL> <LI>The mean radius, the expectaion of <IMG WIDTH="43" HEIGHT="34" ALIGN="MIDDLE" BORDER="0" SRC="img85.png" ALT="$\sum_i r_i$">. </LI> <LI>The mean square radius, the expectation of <IMG WIDTH="46" HEIGHT="36" ALIGN="MIDDLE" BORDER="0" SRC="img86.png" ALT="$\sum_i r_i^2$">. </LI> <LI>The dipole-dipole operator, the expectation of <!-- MATH $(\sum_i r_i)^2$ --> <IMG WIDTH="63" HEIGHT="36" ALIGN="MIDDLE" BORDER="0" SRC="img87.png" ALT="$(\sum_i r_i)^2$">, </LI> <LI>The Isotope shift parameter, <!-- MATH $S= - \sum_{i<j} \nabla_i\cdot \nabla_j$ --> <IMG WIDTH="144" HEIGHT="34" ALIGN="MIDDLE" BORDER="0" SRC="img88.png" ALT="$S= - \sum_{i&lt;j} \nabla_i\cdot \nabla_j$">. </LI> </OL> The mean radius gives an indication of the size of the atomic system, whereas the dipole-dipole operator (denoted as <TT>r.r</TT> in the <TT>summry</TT> file) is relevant to long-range interactions&nbsp;[#!babb!#]. <P> </LI> <LI><TT>LSn.l</TT>: <TT>mchf</TT> saves the eigenvectors for each term included in the configuration list in a separate file. Multiple eigenvalues and eigenvectors for a given term are saved in the same file, Therefore, an <TT>LSn.l</TT> file contains a single term, however, it may contain multile eigenvalues. A number of <TT>LSn.l</TT> files are created, correspondingly file per block (term). <PRE> Global Information for the term: Label, Atomic number, Number of electrons, number of configurations (2X,A6,A,F5.1,A,I3,A,I6)' ) 2 blank lines J value, number of eigenvalues: (//A8,I4,2X,A8,I4)' .For each eigenvalue index requested: . Ssms factor: (A8,f15.10) . index of dominant configuration, energy, label (i6,f16.9,2x,A) . weight coefficients(eigenvector) '(7F11.8)' The command %"head 4P.l" shows the head of the file, the first 10 lines: #### Z=9 Z = 9.0 NEL = 0 NCFG = 4552 2*J = 0 NUMBER = 1 Ssms= 9.1044850144 5 -97.049494320 2s.2p(4)3P2_4P -.03539122 -.10039993 .00687978 .00152753 .98568399 -.01049074 -.04761180 .00214886 .02015163 -.03685424 -.03234737 -.01254864 -.00348771 .00099990 -.00848004 -.00053098 .00079421 .00175919 .00089763 .00013236 -.00007157 -.00452096 -.00173801 .00167690 .00337817 -.00020025 -.00041671 -.00144874 ........... </PRE> <P> </LI> </OL> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html1634" HREF="node109.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html1630" HREF="node107.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html1624" HREF="node107.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html1632" HREF="node2.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1635" HREF="node109.html">Parallel mpi_nonh, mpi_mchf.</A> <B> Up:</B> <A NAME="tex2html1631" HREF="node107.html">I/O File Formats</A> <B> Previous:</B> <A NAME="tex2html1625" HREF="node107.html">I/O File Formats</A> &nbsp <B> <A NAME="tex2html1633" HREF="node2.html">Contents</A></B> <!--End of Navigation Panel--> <ADDRESS> 2001-10-11 </ADDRESS> </BODY> </HTML>
36.412698
144
0.681691
5fbb491291f33b3306e30af68a99db29531e3ba0
97
css
CSS
stylesheets/viewport.css
MindChirp/infoScreen
9a21fdd9c1d0c3ab3657e9122e94af3734731feb
[ "MIT" ]
6
2020-08-14T09:35:15.000Z
2021-04-28T20:29:30.000Z
stylesheets/viewport.css
MindChirp/infoScreen
9a21fdd9c1d0c3ab3657e9122e94af3734731feb
[ "MIT" ]
93
2020-12-09T23:21:32.000Z
2022-03-25T19:11:25.000Z
stylesheets/viewport.css
MindChirp/infoScreen
9a21fdd9c1d0c3ab3657e9122e94af3734731feb
[ "MIT" ]
null
null
null
.progression-dot.active { opacity: 1 !important; background-color: rgb(200,200,200); }
24.25
40
0.659794
0b7b1e425f8017f791073b532d42d48a2786d924
171
py
Python
13.py
kwoshvick/project-euler
d27370b0f22b51ad9ccb15afa912983d8fd8be5c
[ "MIT" ]
null
null
null
13.py
kwoshvick/project-euler
d27370b0f22b51ad9ccb15afa912983d8fd8be5c
[ "MIT" ]
null
null
null
13.py
kwoshvick/project-euler
d27370b0f22b51ad9ccb15afa912983d8fd8be5c
[ "MIT" ]
null
null
null
file = open("13") sum = 0 for numbers in file: #print(numbers.rstrip()) numbers = int(numbers) sum += numbers; print(sum) sum = str(sum) print(sum[:10])
10.6875
28
0.596491
56a825ac0b63bd755b5a8abd099c695f37e2e0c7
3,197
ts
TypeScript
source/modules/ANSI-X9-62/Parameters.ta.ts
JonathanWilbur/ansi-x9-62-ts
5922d85e267c7a5297c87565910ea8cd17a938e1
[ "MIT" ]
null
null
null
source/modules/ANSI-X9-62/Parameters.ta.ts
JonathanWilbur/ansi-x9-62-ts
5922d85e267c7a5297c87565910ea8cd17a938e1
[ "MIT" ]
null
null
null
source/modules/ANSI-X9-62/Parameters.ta.ts
JonathanWilbur/ansi-x9-62-ts
5922d85e267c7a5297c87565910ea8cd17a938e1
[ "MIT" ]
null
null
null
/* eslint-disable */ import { ASN1Element as _Element, NULL, OBJECT_IDENTIFIER } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { ECParameters, _decode_ECParameters, _encode_ECParameters, } from "../ANSI-X9-62/ECParameters.ta"; export { CurveNames } from "../ANSI-X9-62/CurveNames.osa"; export { CURVES } from "../ANSI-X9-62/CURVES.oca"; export { ECParameters, _decode_ECParameters, _encode_ECParameters, } from "../ANSI-X9-62/ECParameters.ta"; /* START_OF_SYMBOL_DEFINITION Parameters */ /** * @summary Parameters * @description * * ### ASN.1 Definition: * * ```asn1 * Parameters ::= CHOICE { * ecParameters ECParameters, * namedCurve CURVES.&id({CurveNames}), * implicitlyCA NULL * } * ``` */ export type Parameters = | { ecParameters: ECParameters } /* CHOICE_ALT_ROOT */ | { namedCurve: OBJECT_IDENTIFIER } /* CHOICE_ALT_ROOT */ | { implicitlyCA: NULL } /* CHOICE_ALT_ROOT */; /* END_OF_SYMBOL_DEFINITION Parameters */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_Parameters */ let _cached_decoder_for_Parameters: $.ASN1Decoder<Parameters> | null = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_Parameters */ /* START_OF_SYMBOL_DEFINITION _decode_Parameters */ /** * @summary Decodes an ASN.1 element into a(n) Parameters * @function * @param {_Element} el The element being decoded. * @returns {Parameters} The decoded data structure. */ export function _decode_Parameters(el: _Element) { if (!_cached_decoder_for_Parameters) { _cached_decoder_for_Parameters = $._decode_inextensible_choice<Parameters>( { "UNIVERSAL 16": ["ecParameters", _decode_ECParameters], "UNIVERSAL 6": ["namedCurve", $._decodeObjectIdentifier], "UNIVERSAL 5": ["implicitlyCA", $._decodeNull], } ); } return _cached_decoder_for_Parameters(el); } /* END_OF_SYMBOL_DEFINITION _decode_Parameters */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_Parameters */ let _cached_encoder_for_Parameters: $.ASN1Encoder<Parameters> | null = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_Parameters */ /* START_OF_SYMBOL_DEFINITION _encode_Parameters */ /** * @summary Encodes a(n) Parameters into an ASN.1 Element. * @function * @param {value} el The element being decoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The Parameters, encoded as an ASN.1 Element. */ export function _encode_Parameters( value: Parameters, elGetter: $.ASN1Encoder<Parameters> ) { if (!_cached_encoder_for_Parameters) { _cached_encoder_for_Parameters = $._encode_choice<Parameters>( { ecParameters: _encode_ECParameters, namedCurve: $._encodeObjectIdentifier, implicitlyCA: $._encodeNull, }, $.BER ); } return _cached_encoder_for_Parameters(value, elGetter); } /* END_OF_SYMBOL_DEFINITION _encode_Parameters */ /* eslint-enable */
33.652632
84
0.665311
b71a1128fcebd916425d57d5349baef4f99d3535
194
sql
SQL
src/main/resources/dbScripts/create_roles.sql
javachemistry/em-rest-ai
5769c98aaf402bc9c448fafefcba4c4c6c87da40
[ "Apache-2.0" ]
null
null
null
src/main/resources/dbScripts/create_roles.sql
javachemistry/em-rest-ai
5769c98aaf402bc9c448fafefcba4c4c6c87da40
[ "Apache-2.0" ]
null
null
null
src/main/resources/dbScripts/create_roles.sql
javachemistry/em-rest-ai
5769c98aaf402bc9c448fafefcba4c4c6c87da40
[ "Apache-2.0" ]
null
null
null
--DROP TABLE roles IF EXISTS; CREATE TABLE roles ( id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 100, INCREMENT BY 1) PRIMARY KEY, role_code VARCHAR(10), role_name VARCHAR(50) );
27.714286
90
0.747423
6bb3e3aa34e5a8622c3655d3b07d8c10d73fe50f
4,620
h
C
components/smxusb/include/XBASE/bapi.h
jingzhishen/YoC-open
7a8ade3343d3ab296a6d05cf33c093fd956d8282
[ "Apache-2.0" ]
null
null
null
components/smxusb/include/XBASE/bapi.h
jingzhishen/YoC-open
7a8ade3343d3ab296a6d05cf33c093fd956d8282
[ "Apache-2.0" ]
null
null
null
components/smxusb/include/XBASE/bapi.h
jingzhishen/YoC-open
7a8ade3343d3ab296a6d05cf33c093fd956d8282
[ "Apache-2.0" ]
null
null
null
/* * bapi.h Version 4.4.0 * * smxBase API. * * Copyright (c) 2004-2018 Micro Digital Inc. * All rights reserved. www.smxrtos.com * * This software is confidential and proprietary to Micro Digital Inc. * It has been furnished under a license and may be used, copied, or * disclosed only in accordance with the terms of that license and with * the inclusion of this header. No title to nor ownership of this * software is hereby transferred. * * Authors: David Moore, Yingbo Hu, and Ralph Moore * *****************************************************************************/ #ifndef SB_BAPI_H #define SB_BAPI_H /* Function Prototypes */ #ifdef __cplusplus extern "C" { #endif #if !defined(SB_OS_SMX3) /* Base Block Pool Functions */ BOOLEAN sb_BlockPoolCreate(u8 *p, PCB_PTR pool, u16 num, u16 size, const char *name); BOOLEAN sb_BlockPoolCreateDAR(SB_DCB *dar, PCB_PTR pool, u16 num, u16 size, u16 align, const char *name); u8 *sb_BlockPoolDelete(PCB_PTR pool); u32 sb_BlockPoolPeek(PCB_PTR pool, SB_PK_PARM par); u8 *sb_BlockGet(PCB_PTR pool, u16 clrsz); BOOLEAN sb_BlockRel(PCB_PTR pool, u8 *bp, u16 clrsz); #endif /* DAR Functions */ u8 *sb_DARAlloc(SB_DCB_PTR dar, u32 sz, u32 align); BOOLEAN sb_DARFreeLast(SB_DCB_PTR dar); BOOLEAN sb_DARInit(SB_DCB_PTR dar, u8 *pi, u32 sz, BOOLEAN fill, u32 fillval); /* Error Manager Functions */ BOOLEAN sb_EMInit(void); BOOLEAN sb_EMClear(void); void sb_EM(SB_ERRNO errnum); /* Message Display Functions */ #define sb_MsgDisplay() #define sb_MsgOutConst(mtype, mp) #define sb_MsgOutVar(mtype, mp) #define sb_MsgConstDisplay(mtype, mp) \ { \ sb_MsgOutConst(mtype, mp); \ sb_MsgDisplay(); \ } #define sb_MsgVarDisplay(mtype, mp) \ { \ sb_MsgOutVar(mtype, mp); \ sb_MsgDisplay(); \ } /* MPU Functions */ void sb_MPUInit(void); void sb_MPULoad(void); /* Power Management Functions */ u32 sb_PowerDown(u32 power_mode); /* System Stack Functions */ void sb_SSFill(void); void sb_SSFillMost(void); void sb_SSFillResv(u32 resv); void sb_SSPInit(void); u32 sb_SSScan(void); /* Time Measurement Functions */ void sb_TMInit(void); void sb_TMStart(u32 *pts); void sb_TMEnd(u32 ts, u32 *ptm); /* Time Functions */ void sb_GetLocalTime(DATETIME *pDateTime); /* Utility Functions */ u32 sb_read32_unaligned(u8 *addr); void sb_write32_unaligned(u8 *addr, u32 val); #ifdef __cplusplus } #endif /* Macros */ #define sb_ERROR_RET(errnum, x)\ { \ sb_EM(errnum); \ return x; \ } /* Utility Macros */ #define sb_BCD_BYTE_TO_DECIMAL(num) (((num) & 0x0F) + ((((num) & 0xF0)>>4) * 10)) #define sb_DECIMAL_TO_BCD_BYTE(num) (((((num)%100)/10)<<4) | ((num)%10)) /* max 99; higher values truncated (e.g. 100 --> 00) */ #define sb_INVERT_U16(v16) (u16)(((uint)((v16) & 0x00FF) << 8) | ((uint)((v16) & 0xFF00) >> 8)) #define sb_INVERT_U32(v32) (u32)(((u32)(v32) << 24) | (((u32)(v32) << 8) & 0x00FF0000) | (((u32)(v32) >> 8) & 0x0000FF00L) | ((u32)(v32) >> 24)) #define sb_MIN(a, b) (((a) > (b)) ? (b) : (a)) #define sb_MAX(a, b) (((a) > (b)) ? (a) : (b)) #define sb_LOU16(l) ((u16)(l)) #define sb_HIU16(l) ((u16)(((l) & 0xFFFF0000L)>>16)) #define sb_MAKEU32(h,l) ((u32)(((u32)(h)<<16) | (l))) #if (SB_DATA_ALIGN == 1) #define sb_READ32_UNALIGNED(a) (*(u32*)(a)) #define sb_WRITE32_UNALIGNED(a, v) (*(u32*)(a) = (v)) #else #define sb_READ32_UNALIGNED(a) sb_read32_unaligned((u8 *)(a)) #define sb_WRITE32_UNALIGNED(a, v) sb_write32_unaligned((u8 *)(a), (v)) #endif /* Time Measurement Macros */ /* The first call to TMInit() primes the caches. */ #if SB_TM_EN #define sb_TM_INIT() {sb_TMInit(); \ sb_TMInit();} #define sb_TM_START(p) sb_TMStart(p); #define sb_TM_END(p, q) sb_TMEnd(p, q); #else #define sb_TM_INIT() #define sb_TM_START(p) #define sb_TM_END(p, q) #endif /* Old names to support existing code. Will be deleted in a future release. */ #define SB_INVERT_U16(v16) sb_INVERT_U16(v16) #define SB_INVERT_U32(v32) sb_INVERT_U32(v32) #define SB_MIN(a, b) sb_MIN(a, b) #define SB_MAX(a, b) sb_MAX(a, b) #define SB_LOU16(l) sb_LOU16(l) #define SB_HIU16(l) sb_HIU16(l) #define SB_MAKEU32(h,l) sb_MAKEU32(h,l) #endif /* SB_BAPI_H */
31.428571
154
0.604113
7be90a9d3f7c3613a1bcb072fc122570b3d8c6de
491
css
CSS
data/usercss/21954.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
118
2020-08-28T19:59:28.000Z
2022-03-26T16:28:40.000Z
data/usercss/21954.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
38
2020-09-02T01:08:45.000Z
2022-01-23T02:47:24.000Z
data/usercss/21954.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
21
2020-08-19T01:12:43.000Z
2022-03-15T21:55:17.000Z
/* ==UserStyle== @name GMail - Hide invites box 21954 @namespace USO Archive @author Denis_ @description `Hide annoying "Invite friends" box from Gmail (Google mail).` @version 20091019.17.32 @license NO-REDISTRIBUTION @preprocessor uso ==/UserStyle== */ @namespace url(http://www.w3.org/1999/xhtml); @-moz-document url-prefix(https://mail.google.com/mail/), url-prefix(http://mail.google.com/mail/) { div.pY { display: none !important; } }
32.733333
78
0.655804
0e88f35831828044b166b06882494b7027a2d12e
496
html
HTML
src/index.html
llyp618/my-datepicker
69e80f16ed1c8c1c0512ed6782c7da22ed51796c
[ "MIT" ]
null
null
null
src/index.html
llyp618/my-datepicker
69e80f16ed1c8c1c0512ed6782c7da22ed51796c
[ "MIT" ]
null
null
null
src/index.html
llyp618/my-datepicker
69e80f16ed1c8c1c0512ed6782c7da22ed51796c
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>datepicker</title> <style> .datepicker { border: 1px solid #ccc; border-radius: 4px; padding:5px; height:24px; line-height: 24px; width:230px; outline: none; } .datepicker:focus { border:1px solid #1abc9c; } </style> </head> <body> <input type="text" class="datepicker" id="d1"> </body> </html>
19.076923
55
0.582661
5ada3fb9ca2dfc014d8f03dd649b64c45e04a5ef
960
sql
SQL
banach/pleakpaper2_schema.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
1
2017-12-29T10:00:04.000Z
2017-12-29T10:00:04.000Z
banach/pleakpaper2_schema.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
null
null
null
banach/pleakpaper2_schema.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
null
null
null
create table port ( port_id INT8 primary key, name TEXT, latitude INT8, longitude INT8, offloadcapacity INT8, offloadtime INT8, harbordepth INT8, available Bool); create table ship ( ship_id INT8 primary key, name TEXT, cargo INT8, latitude INT8, longitude INT8, length INT8, draft INT8, max_speed INT8); CREATE TABLE ship_parameters ( param_id INT8 PRIMARY KEY, deadline INT8, portname TEXT); create table berth (berth_id INT8 primary key, port_id INT8, berthlength INT8); CREATE TABLE slot (slot_id INT8 primary key, port_id INT8, berth_id INT8, slotstart INT8, slotend INT8); create table port_enc ( port_id INT8 primary key, name TEXT, latitude INT8, longitude INT8, offloadcapacity INT8, offloadtime INT8, harbordepth INT8, available Bool); create table aggr_count_enc ( pname TEXT, cnt INT8); create table aggr_count ( pname TEXT, cnt INT8); create table capacities ( slots_number INT8);
19.2
104
0.739583
b1e09740613780c03c16b3b059d6dddc74561ba2
338
sql
SQL
municipal-services/fsm/src/main/resources/db/migration/main/V20210401170203.1__fsm_ddl.sql
pradeepkumarcm-egov/DIGIT-Dev
d8fb601fae6d919d2386f36b36dfc7fde77ebd4f
[ "MIT" ]
11
2021-04-22T13:18:00.000Z
2021-07-13T06:24:48.000Z
municipal-services/fsm/src/main/resources/db/migration/main/V20210401170203.1__fsm_ddl.sql
pradeepkumarcm-egov/DIGIT-Dev
d8fb601fae6d919d2386f36b36dfc7fde77ebd4f
[ "MIT" ]
940
2019-12-03T10:55:53.000Z
2022-03-16T18:37:25.000Z
municipal-services/fsm/src/main/resources/db/migration/main/V20210401170203.1__fsm_ddl.sql
pradeepkumarcm-egov/DIGIT-Dev
d8fb601fae6d919d2386f36b36dfc7fde77ebd4f
[ "MIT" ]
30
2019-12-06T09:35:45.000Z
2022-02-04T15:23:21.000Z
ALTER TABLE eg_fsm_application ALTER COLUMN sanitationtype DROP NOT NULL, ALTER COLUMN source DROP NOT NULL, ALTER COLUMN vehicle_id DROP NOT NULL; ALTER TABLE eg_fsm_application_auditlog ALTER COLUMN sanitationtype DROP NOT NULL, ALTER COLUMN source DROP NOT NULL, ALTER COLUMN vehicle_id DROP NOT NULL;
30.727273
42
0.760355
24adfffad3725a7a67565ec1e1ddda7106661f3b
653
lua
Lua
wyx/event/CommandEvent.lua
scottcs/wyx
554324cf36faf28da437d4af52fe392e9507cf62
[ "MIT" ]
null
null
null
wyx/event/CommandEvent.lua
scottcs/wyx
554324cf36faf28da437d4af52fe392e9507cf62
[ "MIT" ]
null
null
null
wyx/event/CommandEvent.lua
scottcs/wyx
554324cf36faf28da437d4af52fe392e9507cf62
[ "MIT" ]
null
null
null
local Class = require 'lib.hump.class' local Event = getClass 'wyx.event.Event' -- Command Event - fires when a command needs to be executed local CommandEvent = Class{name='CommandEvent', inherits=Event, function(self, command) verifyClass('wyx.command.Command', command) Event.construct(self, 'Command Event') self._command = command end } -- destructor function CommandEvent:destroy() self._command = nil Event.destroy(self) end -- return the command function CommandEvent:getCommand() return self._command end function CommandEvent:__tostring() return self:_msg('%s', tostring(self._command)) end -- the class return CommandEvent
21.064516
60
0.75804
d49533d34b8ae2750f9cae49d3026f75e3a0fc77
385
rs
Rust
src/db/schema.rs
gahag/reminder-bot
80319ffe1566ec03f6dbf277714b27eb772a8db5
[ "MIT" ]
1
2021-02-23T17:45:30.000Z
2021-02-23T17:45:30.000Z
src/db/schema.rs
gahag/reminder-bot
80319ffe1566ec03f6dbf277714b27eb772a8db5
[ "MIT" ]
null
null
null
src/db/schema.rs
gahag/reminder-bot
80319ffe1566ec03f6dbf277714b27eb772a8db5
[ "MIT" ]
null
null
null
table! { reminders (id) { id -> Integer, due -> BigInt, recurrying -> Nullable<Integer>, chat -> BigInt, message -> Text, } } table! { trusted_chats (id) { id -> BigInt, username -> Nullable<Text>, title -> Nullable<Text>, } } allow_tables_to_appear_in_same_query!( reminders, trusted_chats, );
16.73913
40
0.527273
16536b01e0038960c930d82f66a3b4035488d695
2,438
tsx
TypeScript
web/src/components/Login.tsx
lunush/posty
b0ea2c342e5a80e72ebc6bbb786720b9994e2b89
[ "MIT" ]
null
null
null
web/src/components/Login.tsx
lunush/posty
b0ea2c342e5a80e72ebc6bbb786720b9994e2b89
[ "MIT" ]
null
null
null
web/src/components/Login.tsx
lunush/posty
b0ea2c342e5a80e72ebc6bbb786720b9994e2b89
[ "MIT" ]
null
null
null
import { useMutation } from '@apollo/client' import { useContext, useState } from 'react' import { ActivityIndicator, NativeSyntheticEvent, StyleSheet, Text, View } from 'react-native' import { LOGIN } from 'src/requests' import { Link, useHistory } from 'react-router-dom' import { AuthContext } from 'src/utils/auth' import StandardTextInput from './common/StandardTextInput' import StandardButton from './common/StandardButton' import { color, globalStyles } from 'src/globalStyles' const Login: React.FC = () => { const context = useContext(AuthContext) const history = useHistory() const [state, setState] = useState({ Username: '', Password: '' }) if (context.token) history.push('/') const [login, { error, loading }] = useMutation(LOGIN, { variables: { username: state.Username, password: state.Password }, update(_, { data: { login: token } }) { if (token) { context.login(token) history.push('/') } } }) const handleChange = (e: NativeSyntheticEvent<any>) => { setState({ ...state, [e.nativeEvent.srcElement.placeholder]: e.nativeEvent.text }) } const handleSubmit = () => { if (state.Password.trim() !== '' && state.Username.trim() !== '') login() } return ( <View style={[globalStyles.fullSpace, globalStyles.centeredContainer]}> <Text style={styles.title}>Login</Text> <StandardTextInput value={state.Username} onChange={handleChange} title="Username" /> <StandardTextInput value={state.Password} onChange={handleChange} title="Password" secureTextEntry /> {loading ? ( <ActivityIndicator style={styles.activityIndicator} /> ) : ( <StandardButton title="Login" onPress={handleSubmit} /> )} <Text style={globalStyles.smallText}> Don't have an account yet? Click <Link to="/register" style={{ color: color.link, textDecoration: 'none' }} > {' '} here{' '} </Link> to get one! </Text> {error && <Text style={globalStyles.mediumText}>{error.message}</Text>} </View> ) } const styles = StyleSheet.create({ activityIndicator: { padding: 14, marginVertical: 10 }, title: { color: color.primary, fontSize: 32, height: 40 } }) export default Login
24.626263
77
0.602543
43b3a45f258a27e987878bed811a655cc6b22f89
2,453
go
Go
batten/docker_check_central_log_collection.go
dockersecuritytools/batten
12068149817e7f1c072662e7aaa6a980c7843ea6
[ "MIT" ]
77
2015-05-28T16:17:22.000Z
2022-01-03T15:29:26.000Z
batten/docker_check_central_log_collection.go
dockersecuritytools/batten
12068149817e7f1c072662e7aaa6a980c7843ea6
[ "MIT" ]
5
2015-06-30T11:52:36.000Z
2017-02-22T18:04:59.000Z
batten/docker_check_central_log_collection.go
dockersecuritytools/batten
12068149817e7f1c072662e7aaa6a980c7843ea6
[ "MIT" ]
11
2015-05-28T21:12:24.000Z
2017-01-08T09:43:18.000Z
package batten func (dc *DockerCheckCentralLogCollection) GetCheckDefinition() CheckDefinition { return dc } func (dc *DockerCheckCentralLogCollection) AuditCheck() (bool, error) { // TODO return true, nil } type DockerCheckCentralLogCollection struct { *CheckDefinitionImpl } func makeDockerCheckCentralLogCollection() Check { return &DockerCheckCentralLogCollection{ CheckDefinitionImpl: &CheckDefinitionImpl{ identifier: "CIS-Docker-Benchmark-6.5", category: "Docker Security Operations", name: "Use a centralized and remote log collection service", description: `Each container maintains its logs
under /var/lib/docker/containers/$INSTANCE_ID/$INSTANCE_ID-json.log. But, maintaining logs at a centralized place is preferable.`, rationale: `Storing log data on a remote host or a centralized place protects log integrity from local attacks. If an attacker gains access on the local system, he could tamper with or remove log data that is stored on the local system. Also, the 'docker logs' paradigm is not yet fully developed. There are quite a few difficulties in managing the container logs namely • No logrotate for container logs 
 • Transient behavior of docker logs 
 • Difficulty in accessing application specific log files 
 • All stdout and stderr are logged 
Hence, a centralized and remote log collection service should be utilized to keep logs for all the containers.`, auditDescription: `First, verify that the centralized and remote log collection service is configured. Then verify that all the containers are logging at this centralized place. 
Step 1: List all the running instances of containers by executing below command: docker ps -q 
Step 2: For each container instance, execute the below command: 
docker inspect --format='{{.Volumes}}' $INSTANCE_ID 
Ensure that a centralized log volume is mounted on the containers.`, remediation: `Configure a centralized and remote log collection service. Some of the examples to do this are in references. Once the log collection service is active, configure all the containers to send their logs to this service.`, impact: "None", defaultValue: `By default, each container logs separately.`, references: []string{ "https://docs.docker.com/reference/commandline/cli/#logs", "http://jpetazzo.github.io/2014/08/24/syslog-docker/", "http://stackengine.com/docker-logs-aggregating-ease/", }, }, } }
61.325
463
0.76437
3526b3e56c8c1aaba3c90d3be02a2f7c499e9058
681
sql
SQL
process_usage_check.sql
allwaysoft/Oracle-DBA-Common-Scripts
e42a7e7afe539cf92e62dd2ee76cdb60802ef144
[ "Apache-2.0" ]
null
null
null
process_usage_check.sql
allwaysoft/Oracle-DBA-Common-Scripts
e42a7e7afe539cf92e62dd2ee76cdb60802ef144
[ "Apache-2.0" ]
null
null
null
process_usage_check.sql
allwaysoft/Oracle-DBA-Common-Scripts
e42a7e7afe539cf92e62dd2ee76cdb60802ef144
[ "Apache-2.0" ]
5
2019-10-21T12:03:06.000Z
2021-11-21T06:25:05.000Z
set pagesize 0 linesize 200 echo off feedback off verify off prompt prompt ##############Begin############################################# prompt Parameter:Process usage check prompt *****************Begin********* prompt select INST_ID || '||' || TO_NUMBER(LIMIT_VALUE) || '||' || CURRENT_UTILIZATION || '||' || ROUND(CURRENT_UTILIZATION / to_number(limit_value), 0) || '||' || MAX_UTILIZATION || '||' || ROUND(MAX_UTILIZATION / to_number(limit_value), 0) from gv$resource_limit where resource_name = 'processes' order by inst_id; prompt prompt *****************End************ prompt ##############End#################################
32.428571
72
0.519824
02c003beced941ad4c3809c4ef2cbd2d75f2f555
987
sql
SQL
src/tests/perftest/Scripts/Car01.sql
cameronfletcher/dddlib
55e5cc71f8242a813fb67a460147660f9f9fba17
[ "MIT" ]
19
2015-06-21T12:16:05.000Z
2020-04-25T20:01:52.000Z
src/tests/perftest/Scripts/Car01.sql
cameronfletcher/dddlib
55e5cc71f8242a813fb67a460147660f9f9fba17
[ "MIT" ]
84
2015-03-01T13:25:31.000Z
2017-09-13T16:28:33.000Z
src/tests/perftest/Scripts/Car01.sql
cameronfletcher/dddlib
55e5cc71f8242a813fb67a460147660f9f9fba17
[ "MIT" ]
12
2015-03-01T12:51:36.000Z
2021-08-31T01:55:43.000Z
CREATE TABLE [dbo].[Cars] ( [Registration] VARCHAR(10) NOT NULL PRIMARY KEY, [TotalDistanceDriven] INT NOT NULL ); GO CREATE PROCEDURE [dbo].[LoadCar] @Registration VARCHAR(10) AS SELECT [Registration], [TotalDistanceDriven] FROM [dbo].[Cars] WHERE [Registration] = @Registration; GO CREATE PROCEDURE [dbo].[SaveCar] @Registration VARCHAR(10), @TotalDistanceDriven INT, @IsDestroyed BIT AS MERGE INTO [dbo].[Cars] AS [Target] USING (SELECT @Registration AS [Registration], @TotalDistanceDriven AS [TotalDistanceDriven], @IsDestroyed AS [IsDestroyed]) AS [Source] ON [Target].[Registration] = [Source].[Registration] WHEN MATCHED AND [Source].[IsDestroyed] = 1 THEN DELETE WHEN MATCHED THEN UPDATE SET [Target].[TotalDistanceDriven] = [Source].[TotalDistanceDriven] WHEN NOT MATCHED THEN INSERT ([Registration], [TotalDistanceDriven]) VALUES ([Source].[Registration], [Source].[TotalDistanceDriven]); GO
28.2
137
0.700101
5b6aad09f632f0c911c0b49edaa981247baa5c37
1,059
swift
Swift
LoveCat/Class/MessagePage/Models/MessageModel.swift
xingtianwuganqi/iOS_petrescue
618aa0b00540a323f4d0debbdf7743abff3e6ed0
[ "MIT" ]
null
null
null
LoveCat/Class/MessagePage/Models/MessageModel.swift
xingtianwuganqi/iOS_petrescue
618aa0b00540a323f4d0debbdf7743abff3e6ed0
[ "MIT" ]
null
null
null
LoveCat/Class/MessagePage/Models/MessageModel.swift
xingtianwuganqi/iOS_petrescue
618aa0b00540a323f4d0debbdf7743abff3e6ed0
[ "MIT" ]
null
null
null
// // MessageModel.swift // LoveCat // // Created by jingjun on 2021/3/22. // import Foundation import HandyJSON struct MessageModel: HandyJSON { var headIcon: String? var nickName: String? var unreadNum: Int = 0 } struct MessageNumModel: HandyJSON { var sys_unread: Int? var like_unread: Int? var collec_unread: Int? var com_unread: Int? } struct MessageListModel: HandyJSON { var id: Int? var create_time: String? var msg_type: Int? var msg_id: Int? var from_info: UserInfoModel? var to_info: UserInfoModel? var is_read: Int? var topicInfo: HomePageModel? var showInfo: ShowPageModel? var replyInfo: ReplyListModel? var commentInfo: CommentListModel? var reply_type: Int? var reply_id: Int? } struct SystemMsgModel: HandyJSON { var create_time: String? var content: String? var msg_type: Int? var user_id: Int? var timeStr: String? mutating func didFinishMapping() { timeStr = Tool.shared.timeTDate(time: create_time ?? "") } }
20.764706
64
0.673277
85d4be697c0bc840212bfee8258355df163d5c61
677
js
JavaScript
services/symfony/symfony-insight-grade.tester.js
symbldk/shields
ca927fd5d8f06055f542a212495aee471717716b
[ "CC0-1.0" ]
16,313
2015-01-01T12:20:07.000Z
2022-03-31T22:00:23.000Z
services/symfony/symfony-insight-grade.tester.js
symbldk/shields
ca927fd5d8f06055f542a212495aee471717716b
[ "CC0-1.0" ]
5,688
2015-01-01T14:38:26.000Z
2022-03-31T23:13:32.000Z
services/symfony/symfony-insight-grade.tester.js
mikscust/shields
aac838934b1767d0696b0141043be07d1fa250e6
[ "CC0-1.0" ]
8,174
2015-01-03T13:11:17.000Z
2022-03-31T21:52:28.000Z
import Joi from 'joi' import { createServiceTester } from '../tester.js' import { sampleProjectUuid, noSymfonyToken } from './symfony-test-helpers.js' export const t = await createServiceTester() t.create('valid project grade') .skipWhen(noSymfonyToken) .get(`/${sampleProjectUuid}.json`) .timeout(15000) .expectBadge({ label: 'grade', message: Joi.equal( 'platinum', 'gold', 'silver', 'bronze', 'no medal' ).required(), }) t.create('nonexistent project') .skipWhen(noSymfonyToken) .get('/45afb680-d4e6-4e66-93ea-bcfa79eb8a88.json') .expectBadge({ label: 'symfony insight', message: 'project not found', })
24.178571
77
0.657312
3dce305e59e131051c6b3449a39609139dc0f1f8
19,575
rs
Rust
vulkano/src/descriptor/descriptor_set/fixed_size_pool.rs
i509VCB/vulkano
f2e277f9e44d3920816d23fc3b21aeabc35a5aef
[ "Apache-2.0", "MIT" ]
1
2021-10-09T15:24:21.000Z
2021-10-09T15:24:21.000Z
vulkano/src/descriptor/descriptor_set/fixed_size_pool.rs
i509VCB/vulkano
f2e277f9e44d3920816d23fc3b21aeabc35a5aef
[ "Apache-2.0", "MIT" ]
null
null
null
vulkano/src/descriptor/descriptor_set/fixed_size_pool.rs
i509VCB/vulkano
f2e277f9e44d3920816d23fc3b21aeabc35a5aef
[ "Apache-2.0", "MIT" ]
1
2019-08-29T00:43:20.000Z
2019-08-29T00:43:20.000Z
// Copyright (c) 2017 The vulkano developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, // at your option. All files in the project carrying such // notice may not be copied, modified, or distributed except // according to those terms. use crossbeam_queue::SegQueue; use std::hash::Hash; use std::hash::Hasher; use std::sync::Arc; use crate::buffer::BufferAccess; use crate::buffer::BufferViewRef; use crate::descriptor::descriptor::DescriptorDesc; use crate::descriptor::descriptor_set::persistent::*; use crate::descriptor::descriptor_set::DescriptorPool; use crate::descriptor::descriptor_set::DescriptorPoolAlloc; use crate::descriptor::descriptor_set::DescriptorPoolAllocError; use crate::descriptor::descriptor_set::DescriptorSet; use crate::descriptor::descriptor_set::DescriptorSetDesc; use crate::descriptor::descriptor_set::UnsafeDescriptorPool; use crate::descriptor::descriptor_set::UnsafeDescriptorSet; use crate::descriptor::descriptor_set::UnsafeDescriptorSetLayout; use crate::device::Device; use crate::device::DeviceOwned; use crate::image::view::ImageViewAbstract; use crate::sampler::Sampler; use crate::OomError; use crate::VulkanObject; /// Pool of descriptor sets of a specific capacity and that are automatically reclaimed. /// /// You are encouraged to use this type when you need a different descriptor set at each frame, or /// regularly during the execution. /// /// # Example /// /// At initialization, create a `FixedSizeDescriptorSetsPool`. /// /// ```rust /// use vulkano::descriptor::descriptor_set::FixedSizeDescriptorSetsPool; /// # use vulkano::pipeline::GraphicsPipelineAbstract; /// # use std::sync::Arc; /// # let graphics_pipeline: Arc<GraphicsPipelineAbstract> = return; /// // use vulkano::pipeline::GraphicsPipelineAbstract; /// // let graphics_pipeline: Arc<GraphicsPipelineAbstract> = ...; /// /// let layout = graphics_pipeline.layout().descriptor_set_layout(0).unwrap(); /// let pool = FixedSizeDescriptorSetsPool::new(layout.clone()); /// ``` /// /// You would then typically store the pool in a struct for later. Then whenever you need a /// descriptor set, call `pool.next()` to start the process of building it. /// /// ```rust /// # use std::sync::Arc; /// # use vulkano::descriptor::descriptor_set::FixedSizeDescriptorSetsPool; /// # use vulkano::pipeline::GraphicsPipelineAbstract; /// # let mut pool: FixedSizeDescriptorSetsPool = return; /// let descriptor_set = pool.next() /// //.add_buffer(...) /// //.add_sampled_image(...) /// .build().unwrap(); /// ``` /// /// Note that `next()` requires exclusive (`mut`) access to the pool. You can use a `Mutex` around /// the pool if you can't provide this. /// #[derive(Clone)] pub struct FixedSizeDescriptorSetsPool { layout: Arc<UnsafeDescriptorSetLayout>, // We hold a local implementation of the `DescriptorPool` trait for our own purpose. Since we // don't want to expose this trait impl in our API, we use a separate struct. pool: LocalPool, } impl FixedSizeDescriptorSetsPool { /// Initializes a new pool. The pool is configured to allocate sets that corresponds to the /// parameters passed to this function. pub fn new(layout: Arc<UnsafeDescriptorSetLayout>) -> FixedSizeDescriptorSetsPool { let device = layout.device().clone(); FixedSizeDescriptorSetsPool { layout, pool: LocalPool { device, next_capacity: 3, current_pool: None, }, } } /// Starts the process of building a new descriptor set. /// /// The set will corresponds to the set layout that was passed to `new`. #[inline] pub fn next(&mut self) -> FixedSizeDescriptorSetBuilder<()> { let inner = PersistentDescriptorSet::start(self.layout.clone()); FixedSizeDescriptorSetBuilder { pool: self, inner } } } /// A descriptor set created from a `FixedSizeDescriptorSetsPool`. pub struct FixedSizeDescriptorSet<R> { inner: PersistentDescriptorSet<R, LocalPoolAlloc>, } unsafe impl<R> DescriptorSet for FixedSizeDescriptorSet<R> where R: PersistentDescriptorSetResources, { #[inline] fn inner(&self) -> &UnsafeDescriptorSet { self.inner.inner() } #[inline] fn num_buffers(&self) -> usize { self.inner.num_buffers() } #[inline] fn buffer(&self, index: usize) -> Option<(&dyn BufferAccess, u32)> { self.inner.buffer(index) } #[inline] fn num_images(&self) -> usize { self.inner.num_images() } #[inline] fn image(&self, index: usize) -> Option<(&dyn ImageViewAbstract, u32)> { self.inner.image(index) } } unsafe impl<R> DescriptorSetDesc for FixedSizeDescriptorSet<R> { #[inline] fn num_bindings(&self) -> usize { self.inner.num_bindings() } #[inline] fn descriptor(&self, binding: usize) -> Option<DescriptorDesc> { self.inner.descriptor(binding) } } unsafe impl<R> DeviceOwned for FixedSizeDescriptorSet<R> { #[inline] fn device(&self) -> &Arc<Device> { self.inner.device() } } impl<R> PartialEq for FixedSizeDescriptorSet<R> where R: PersistentDescriptorSetResources, { #[inline] fn eq(&self, other: &Self) -> bool { self.inner().internal_object() == other.inner().internal_object() && self.device() == other.device() } } impl<R> Eq for FixedSizeDescriptorSet<R> where R: PersistentDescriptorSetResources {} impl<R> Hash for FixedSizeDescriptorSet<R> where R: PersistentDescriptorSetResources, { #[inline] fn hash<H: Hasher>(&self, state: &mut H) { self.inner().internal_object().hash(state); self.device().hash(state); } } // The fields of this struct can be considered as fields of the `FixedSizeDescriptorSet`. They are // in a separate struct because we don't want to expose the fact that we implement the // `DescriptorPool` trait. #[derive(Clone)] struct LocalPool { // The `LocalPoolInner` struct contains an actual Vulkan pool. Every time it is full, we create // a new pool and replace the current one with the new one. current_pool: Option<Arc<LocalPoolInner>>, // Capacity to use when we create a new Vulkan pool. next_capacity: u32, // The Vulkan device. device: Arc<Device>, } struct LocalPoolInner { // The actual Vulkan descriptor pool. This field isn't actually used anywhere, but we need to // keep the pool alive in order to keep the descriptor sets valid. actual_pool: UnsafeDescriptorPool, // List of descriptor sets. When `alloc` is called, a descriptor will be extracted from this // list. When a `LocalPoolAlloc` is dropped, its descriptor set is put back in this list. reserve: SegQueue<UnsafeDescriptorSet>, } struct LocalPoolAlloc { // The `LocalPoolInner` we were allocated from. We need to keep a copy of it in each allocation // so that we can put back the allocation in the list in our `Drop` impl. pool: Arc<LocalPoolInner>, // The actual descriptor set, wrapped inside an `Option` so that we can extract it in our // `Drop` impl. actual_alloc: Option<UnsafeDescriptorSet>, } unsafe impl DescriptorPool for LocalPool { type Alloc = LocalPoolAlloc; fn alloc(&mut self, layout: &UnsafeDescriptorSetLayout) -> Result<Self::Alloc, OomError> { loop { // Try to extract a descriptor from the current pool if any exist. // This is the most common case. if let Some(ref mut current_pool) = self.current_pool { if let Some(already_existing_set) = current_pool.reserve.pop() { return Ok(LocalPoolAlloc { actual_alloc: Some(already_existing_set), pool: current_pool.clone(), }); } } // If we failed to grab an existing set, that means the current pool is full. Create a // new one of larger capacity. let count = *layout.descriptors_count() * self.next_capacity; let mut new_pool = UnsafeDescriptorPool::new(self.device.clone(), &count, self.next_capacity, false)?; let alloc = unsafe { match new_pool.alloc((0..self.next_capacity).map(|_| layout)) { Ok(iter) => { let stack = SegQueue::new(); for elem in iter { stack.push(elem); } stack } Err(DescriptorPoolAllocError::OutOfHostMemory) => { return Err(OomError::OutOfHostMemory); } Err(DescriptorPoolAllocError::OutOfDeviceMemory) => { return Err(OomError::OutOfDeviceMemory); } Err(DescriptorPoolAllocError::FragmentedPool) => { // This can't happen as we don't free individual sets. unreachable!() } Err(DescriptorPoolAllocError::OutOfPoolMemory) => unreachable!(), } }; self.next_capacity = self.next_capacity.saturating_mul(2); self.current_pool = Some(Arc::new(LocalPoolInner { actual_pool: new_pool, reserve: alloc, })); } } } unsafe impl DeviceOwned for LocalPool { #[inline] fn device(&self) -> &Arc<Device> { &self.device } } impl DescriptorPoolAlloc for LocalPoolAlloc { #[inline] fn inner(&self) -> &UnsafeDescriptorSet { self.actual_alloc.as_ref().unwrap() } #[inline] fn inner_mut(&mut self) -> &mut UnsafeDescriptorSet { self.actual_alloc.as_mut().unwrap() } } impl Drop for LocalPoolAlloc { fn drop(&mut self) { let inner = self.actual_alloc.take().unwrap(); self.pool.reserve.push(inner); } } /// Prototype of a `FixedSizeDescriptorSet`. /// /// The template parameter `R` is an unspecified type that represents the list of resources. /// /// See the docs of `FixedSizeDescriptorSetsPool` for an example. pub struct FixedSizeDescriptorSetBuilder<'a, R> { pool: &'a mut FixedSizeDescriptorSetsPool, inner: PersistentDescriptorSetBuilder<R>, } impl<'a, R> FixedSizeDescriptorSetBuilder<'a, R> { /// Builds a `FixedSizeDescriptorSet` from the builder. #[inline] pub fn build(self) -> Result<FixedSizeDescriptorSet<R>, PersistentDescriptorSetBuildError> { let inner = self.inner.build_with_pool(&mut self.pool.pool)?; Ok(FixedSizeDescriptorSet { inner }) } /// Call this function if the next element of the set is an array in order to set the value of /// each element. /// /// Returns an error if the descriptor is empty. /// /// This function can be called even if the descriptor isn't an array, and it is valid to enter /// the "array", add one element, then leave. #[inline] pub fn enter_array( self, ) -> Result<FixedSizeDescriptorSetBuilderArray<'a, R>, PersistentDescriptorSetError> { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.enter_array()?, }) } /// Skips the current descriptor if it is empty. #[inline] pub fn add_empty( self, ) -> Result<FixedSizeDescriptorSetBuilder<'a, R>, PersistentDescriptorSetError> { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_empty()?, }) } /// Binds a buffer as the next descriptor. /// /// An error is returned if the buffer isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the buffer doesn't have the same device as the descriptor set layout. /// #[inline] pub fn add_buffer<T>( self, buffer: T, ) -> Result< FixedSizeDescriptorSetBuilder<'a, (R, PersistentDescriptorSetBuf<T>)>, PersistentDescriptorSetError, > where T: BufferAccess, { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_buffer(buffer)?, }) } /// Binds a buffer view as the next descriptor. /// /// An error is returned if the buffer isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the buffer view doesn't have the same device as the descriptor set layout. /// pub fn add_buffer_view<T>( self, view: T, ) -> Result< FixedSizeDescriptorSetBuilder<'a, (R, PersistentDescriptorSetBufView<T>)>, PersistentDescriptorSetError, > where T: BufferViewRef, { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_buffer_view(view)?, }) } /// Binds an image view as the next descriptor. /// /// An error is returned if the image view isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the image view doesn't have the same device as the descriptor set layout. /// #[inline] pub fn add_image<T>( self, image_view: T, ) -> Result< FixedSizeDescriptorSetBuilder<'a, (R, PersistentDescriptorSetImg<T>)>, PersistentDescriptorSetError, > where T: ImageViewAbstract, { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_image(image_view)?, }) } /// Binds an image view with a sampler as the next descriptor. /// /// An error is returned if the image view isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the image view or the sampler doesn't have the same device as the descriptor set layout. /// #[inline] pub fn add_sampled_image<T>( self, image_view: T, sampler: Arc<Sampler>, ) -> Result< FixedSizeDescriptorSetBuilder< 'a, ( (R, PersistentDescriptorSetImg<T>), PersistentDescriptorSetSampler, ), >, PersistentDescriptorSetError, > where T: ImageViewAbstract, { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_sampled_image(image_view, sampler)?, }) } /// Binds a sampler as the next descriptor. /// /// An error is returned if the sampler isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the sampler doesn't have the same device as the descriptor set layout. /// #[inline] pub fn add_sampler( self, sampler: Arc<Sampler>, ) -> Result< FixedSizeDescriptorSetBuilder<'a, (R, PersistentDescriptorSetSampler)>, PersistentDescriptorSetError, > { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.add_sampler(sampler)?, }) } } /// Same as `FixedSizeDescriptorSetBuilder`, but we're in an array. pub struct FixedSizeDescriptorSetBuilderArray<'a, R> { pool: &'a mut FixedSizeDescriptorSetsPool, inner: PersistentDescriptorSetBuilderArray<R>, } impl<'a, R> FixedSizeDescriptorSetBuilderArray<'a, R> { /// Leaves the array. Call this once you added all the elements of the array. pub fn leave_array( self, ) -> Result<FixedSizeDescriptorSetBuilder<'a, R>, PersistentDescriptorSetError> { Ok(FixedSizeDescriptorSetBuilder { pool: self.pool, inner: self.inner.leave_array()?, }) } /// Binds a buffer as the next element in the array. /// /// An error is returned if the buffer isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the buffer doesn't have the same device as the descriptor set layout. /// pub fn add_buffer<T>( self, buffer: T, ) -> Result< FixedSizeDescriptorSetBuilderArray<'a, (R, PersistentDescriptorSetBuf<T>)>, PersistentDescriptorSetError, > where T: BufferAccess, { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.add_buffer(buffer)?, }) } /// Binds a buffer view as the next element in the array. /// /// An error is returned if the buffer isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the buffer view doesn't have the same device as the descriptor set layout. /// pub fn add_buffer_view<T>( self, view: T, ) -> Result< FixedSizeDescriptorSetBuilderArray<'a, (R, PersistentDescriptorSetBufView<T>)>, PersistentDescriptorSetError, > where T: BufferViewRef, { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.add_buffer_view(view)?, }) } /// Binds an image view as the next element in the array. /// /// An error is returned if the image view isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the image view doesn't have the same device as the descriptor set layout. /// pub fn add_image<T>( self, image_view: T, ) -> Result< FixedSizeDescriptorSetBuilderArray<'a, (R, PersistentDescriptorSetImg<T>)>, PersistentDescriptorSetError, > where T: ImageViewAbstract, { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.add_image(image_view)?, }) } /// Binds an image view with a sampler as the next element in the array. /// /// An error is returned if the image view isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the image or the sampler doesn't have the same device as the descriptor set layout. /// pub fn add_sampled_image<T>( self, image_view: T, sampler: Arc<Sampler>, ) -> Result< FixedSizeDescriptorSetBuilderArray< 'a, ( (R, PersistentDescriptorSetImg<T>), PersistentDescriptorSetSampler, ), >, PersistentDescriptorSetError, > where T: ImageViewAbstract, { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.add_sampled_image(image_view, sampler)?, }) } /// Binds a sampler as the next element in the array. /// /// An error is returned if the sampler isn't compatible with the descriptor. /// /// # Panic /// /// Panics if the sampler doesn't have the same device as the descriptor set layout. /// pub fn add_sampler( self, sampler: Arc<Sampler>, ) -> Result< FixedSizeDescriptorSetBuilderArray<'a, (R, PersistentDescriptorSetSampler)>, PersistentDescriptorSetError, > { Ok(FixedSizeDescriptorSetBuilderArray { pool: self.pool, inner: self.inner.add_sampler(sampler)?, }) } }
31.881107
106
0.622375
62db599962c40136936ab846c93c074ddab3dc0b
1,091
kt
Kotlin
anvil/src/gen-sdk-21/kotlin/dev/inkremental/dsl/android/widget/QuickContactBadge.kt
savardd/inkremental
e1171fe02e562c6788531c1a7f2994835270be96
[ "MIT" ]
45
2020-02-12T19:11:57.000Z
2021-08-06T17:57:15.000Z
anvil/src/gen-sdk-21/kotlin/dev/inkremental/dsl/android/widget/QuickContactBadge.kt
savardd/inkremental
e1171fe02e562c6788531c1a7f2994835270be96
[ "MIT" ]
33
2019-08-30T15:58:45.000Z
2020-01-24T10:49:51.000Z
anvil/src/gen-sdk-21/kotlin/dev/inkremental/dsl/android/widget/QuickContactBadge.kt
savardd/inkremental
e1171fe02e562c6788531c1a7f2994835270be96
[ "MIT" ]
5
2019-09-16T10:31:12.000Z
2019-12-24T13:54:04.000Z
@file:Suppress("DEPRECATION", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "unused") package dev.inkremental.dsl.android.widget import android.graphics.drawable.Drawable import android.widget.QuickContactBadge import dev.inkremental.Inkremental import dev.inkremental.attr import dev.inkremental.bind import dev.inkremental.dsl.android.CustomSdkSetter import dev.inkremental.dsl.android.SdkSetter import dev.inkremental.v import kotlin.Array import kotlin.Int import kotlin.String import kotlin.Suppress import kotlin.Unit fun quickContactBadge(configure: QuickContactBadgeScope.() -> Unit = {}) = v<QuickContactBadge>(configure.bind(QuickContactBadgeScope)) abstract class QuickContactBadgeScope : ImageViewScope() { fun excludeMimes(arg: Array<String>): Unit = attr("excludeMimes", arg) fun mode(arg: Int): Unit = attr("mode", arg) fun overlay(arg: Drawable): Unit = attr("overlay", arg) companion object : QuickContactBadgeScope() { init { Inkremental.registerAttributeSetter(SdkSetter) Inkremental.registerAttributeSetter(CustomSdkSetter) } } }
34.09375
89
0.788268