hexsha stringlengths 40 40 | size int64 140 1.03M | ext stringclasses 94
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 663 | max_stars_repo_name stringlengths 4 120 | 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 663 | max_issues_repo_name stringlengths 4 120 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 663 | 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 140 1.03M | avg_line_length float64 2.32 23.1k | max_line_length int64 11 938k | alphanum_fraction float64 0.01 1 | score float32 3 4.25 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a169a0c436e5ece742a17c7ea2ade0d5e3df729c | 1,546 | go | Go | math/subtract.go | buro9/funcs | 0a117fc83732c13b554d10e52d17997b113a3d2c | [
"MIT"
] | null | null | null | math/subtract.go | buro9/funcs | 0a117fc83732c13b554d10e52d17997b113a3d2c | [
"MIT"
] | null | null | null | math/subtract.go | buro9/funcs | 0a117fc83732c13b554d10e52d17997b113a3d2c | [
"MIT"
] | null | null | null | package math
// Subtract takes two numbers (a and b) and substracts b from a.
//
// The type of b will be cast to the same type as a.
func Subtract(a interface{}, b interface{}) interface{} {
switch av := a.(type) {
case float32:
switch bv := b.(type) {
case float32:
return av - bv
case float64:
return a... | 17.770115 | 64 | 0.613842 | 3.015625 |
bccec26a54de7338da918cc2ddbfc5c949498969 | 1,680 | js | JavaScript | server/src/commandHandlers/setSortOrder.js | sthagen/Zuehlke-poinz | c1514c03f4ba22b819eed8de8c5242eba4801067 | [
"MIT"
] | null | null | null | server/src/commandHandlers/setSortOrder.js | sthagen/Zuehlke-poinz | c1514c03f4ba22b819eed8de8c5242eba4801067 | [
"MIT"
] | null | null | null | server/src/commandHandlers/setSortOrder.js | sthagen/Zuehlke-poinz | c1514c03f4ba22b819eed8de8c5242eba4801067 | [
"MIT"
] | null | null | null | /**
* A user re-orders the backlog manually.
* This command will set the new sortOrder of all active stories in the room.
* Trashed stories will not be affected. (sortOrder = undefined).
*/
const schema = {
allOf: [
{
$ref: 'command'
},
{
properties: {
payload: {
type: 'o... | 28.474576 | 153 | 0.597619 | 3.09375 |
e354583b87d12253c7b85983fa3a2a5d42e8df29 | 5,235 | kt | Kotlin | src/main/kotlin/emufog/fog/FogGraphBuilder.kt | emufog/emufog | d79defb13b203ef5bfb45c3396782516ade9338f | [
"MIT"
] | 22 | 2017-09-26T13:12:13.000Z | 2022-01-03T19:29:34.000Z | src/main/kotlin/emufog/fog/FogGraphBuilder.kt | emufog/emufog | d79defb13b203ef5bfb45c3396782516ade9338f | [
"MIT"
] | 49 | 2017-10-24T10:18:37.000Z | 2021-06-12T08:05:48.000Z | src/main/kotlin/emufog/fog/FogGraphBuilder.kt | emufog/emufog | d79defb13b203ef5bfb45c3396782516ade9338f | [
"MIT"
] | 9 | 2017-09-12T20:42:18.000Z | 2021-07-10T12:38:34.000Z | /*
* MIT License
*
* Copyright (c) 2020 emufog contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, co... | 38.211679 | 119 | 0.689589 | 3.109375 |
e9b5f638850c1691b66c9e46134fb7620231addc | 16,293 | rs | Rust | src/main.rs | kevin-logan/rsr | 90c60e989e3e369413e89ab241ffae7b3cdd4061 | [
"Apache-2.0"
] | null | null | null | src/main.rs | kevin-logan/rsr | 90c60e989e3e369413e89ab241ffae7b3cdd4061 | [
"Apache-2.0"
] | null | null | null | src/main.rs | kevin-logan/rsr | 90c60e989e3e369413e89ab241ffae7b3cdd4061 | [
"Apache-2.0"
] | null | null | null | macro_rules! info {
( $quiet:expr, $($args:expr),+ ) => {
if !($quiet) {
println!($($args),*);
}
}
}
struct StringReplacer {
search_expression: Option<regex::Regex>,
replace_pattern: Option<String>,
}
impl StringReplacer {
pub fn new(
search_expression: Option<r... | 39.546117 | 346 | 0.441478 | 3.09375 |
be9c86117e2bee0b2ff8397846e5c55bde8f50a0 | 3,730 | lua | Lua | Data/Scripts/Bezier.lua | Core-Team-META/CC-Cinematic-Shot | 94f66c69c1a9781893de368dc9ced0c70a81544a | [
"Apache-2.0"
] | null | null | null | Data/Scripts/Bezier.lua | Core-Team-META/CC-Cinematic-Shot | 94f66c69c1a9781893de368dc9ced0c70a81544a | [
"Apache-2.0"
] | null | null | null | Data/Scripts/Bezier.lua | Core-Team-META/CC-Cinematic-Shot | 94f66c69c1a9781893de368dc9ced0c70a81544a | [
"Apache-2.0"
] | null | null | null | -- Bezier.lua
-- An instancable class allowing for a curve to be created and drawn in relation to X number of reference points
-- Created by Nicholas Foreman (https://www.coregames.com/user/f9df3457225741c89209f6d484d0eba8)
local BezierPointTemplate = script:GetCustomProperty("BezierPoint")
local BezierSegmentTemplat... | 26.834532 | 112 | 0.753083 | 3.265625 |
6d00c97df6457cd670efbf57968faee7f9667864 | 1,822 | swift | Swift | JongHelper/JongHelper/Solver/Mentu/Solver_Kotsu.swift | jphacks/SD_1702 | aaa533930e2d1c3836e80382b3ea51ec90a6b177 | [
"MIT"
] | 13 | 2017-11-01T20:15:18.000Z | 2022-01-15T18:11:33.000Z | JongHelper/JongHelper/Solver/Mentu/Solver_Kotsu.swift | jphacks/SD_1702 | aaa533930e2d1c3836e80382b3ea51ec90a6b177 | [
"MIT"
] | null | null | null | JongHelper/JongHelper/Solver/Mentu/Solver_Kotsu.swift | jphacks/SD_1702 | aaa533930e2d1c3836e80382b3ea51ec90a6b177 | [
"MIT"
] | 6 | 2017-10-27T14:58:02.000Z | 2021-08-11T13:58:41.000Z | //
// Kotu.swift
//
//
// Created by oike toshiyuki on 2017/10/17.
//
import Foundation
class Kotu: Mentu, Equatable, Comparable{
var isOpen = false
var isMentu = false
//順子はどっかしら決めて持っとく
var identifierTile: Tile
init() {
self.identifierTile = Tile.null
self.isOpen = fal... | 24.621622 | 119 | 0.537322 | 3.359375 |
12945e83bc635180a7cd831333b79ac23fb0ba8e | 12,664 | c | C | voapps/votsort.c | olebole/voclient | abeee7783f4e84404a8c3a9646bb57f48988b24a | [
"MIT"
] | 2 | 2019-12-01T15:19:09.000Z | 2019-12-02T16:48:42.000Z | voapps/votsort.c | mjfitzpatrick/voclient | 3264c0df294cecc518e5c6a7e6b2aba3f1c76373 | [
"MIT"
] | 1 | 2019-11-30T13:48:50.000Z | 2019-12-02T19:40:25.000Z | voapps/votsort.c | mjfitzpatrick/voclient | 3264c0df294cecc518e5c6a7e6b2aba3f1c76373 | [
"MIT"
] | null | null | null | /*
* VOTSORT -- Sort a VOTable based on a column value.
*
* Usage:
* votsort [<otps>] <votable.xml>
*
* Where
* -c,--col <N> Sort column num
* -d,--desc Sort in descending order
* -f,--fmt <format> Output format
* -o,--output <name> Output name
* -s,--string String sort
* -t,--top <N> Print top <N> r... | 32.060759 | 79 | 0.540272 | 3.015625 |
ebab59acb824a2e93706e47c007e30c94a6b53ba | 4,898 | rs | Rust | map_model/src/make/buildings.rs | omalaspinas/abstreet | 43b31dcdbc6b7a599eceab3a17fa4e1fab72b691 | [
"Apache-2.0"
] | 2 | 2020-03-31T22:48:17.000Z | 2020-05-19T08:02:22.000Z | map_model/src/make/buildings.rs | omalaspinas/abstreet | 43b31dcdbc6b7a599eceab3a17fa4e1fab72b691 | [
"Apache-2.0"
] | null | null | null | map_model/src/make/buildings.rs | omalaspinas/abstreet | 43b31dcdbc6b7a599eceab3a17fa4e1fab72b691 | [
"Apache-2.0"
] | null | null | null | use crate::make::sidewalk_finder::find_sidewalk_points;
use crate::raw::{OriginalBuilding, RawBuilding};
use crate::{osm, Building, BuildingID, FrontPath, LaneID, LaneType, Map, OffstreetParking};
use abstutil::Timer;
use geom::{Distance, HashablePt2D, Line, PolyLine, Polygon};
use std::collections::{BTreeMap, HashSet}... | 37.106061 | 94 | 0.538587 | 3.0625 |
cae68b4d01dd94e0377b78e6e858beab62052611 | 2,080 | asm | Assembly | sources/mul_tab.asm | matteosev/mul_tab | e6571eb465ca87198acf17be8f807695244d7dea | [
"MIT"
] | 1 | 2020-04-19T07:14:37.000Z | 2020-04-19T07:14:37.000Z | sources/mul_tab.asm | matteosev/mul_tab | e6571eb465ca87198acf17be8f807695244d7dea | [
"MIT"
] | null | null | null | sources/mul_tab.asm | matteosev/mul_tab | e6571eb465ca87198acf17be8f807695244d7dea | [
"MIT"
] | null | null | null | ; args:
; 1: the table to display
; displays the multiplication table
%include "module.asm"
section .data
x db " x ", 0
equal db " = ", 0
nl db 10 ; ascii code for new line
msg db "Please enter an integer between 0 and 9 or a letter.", 10, 0
section .bss
op1 resq 1
op2 resq ... | 27.733333 | 93 | 0.513942 | 3.484375 |
dd6032ac0651900ceecf67e713af0bbc22928a18 | 2,792 | go | Go | store/fsm.go | makersu/go-raft-kafka | 02d37c3ce6e6cac5738165fad6b91638c913c01c | [
"MIT"
] | null | null | null | store/fsm.go | makersu/go-raft-kafka | 02d37c3ce6e6cac5738165fad6b91638c913c01c | [
"MIT"
] | null | null | null | store/fsm.go | makersu/go-raft-kafka | 02d37c3ce6e6cac5738165fad6b91638c913c01c | [
"MIT"
] | null | null | null | package store
/**
// FSM provides an interface that can be implemented by
// clients to make use of the replicated log.
type FSM interface {
// Apply log is invoked once a log entry is committed.
// It returns a value which will be made available in the
// ApplyFuture returned by Raft.Apply method if that
// me... | 24.491228 | 75 | 0.690186 | 3.09375 |
be4a207ee408e3ed6964c176e53c02fa322f5df5 | 4,927 | rs | Rust | 2019/day14/src/main.rs | dcoles/advent-of-code | 4d480934daad60fcdb2112ef66f4115d9cb83ac2 | [
"MIT"
] | 2 | 2021-12-01T06:47:00.000Z | 2021-12-02T20:09:40.000Z | 2019/day14/src/main.rs | dcoles/advent-of-code | 4d480934daad60fcdb2112ef66f4115d9cb83ac2 | [
"MIT"
] | null | null | null | 2019/day14/src/main.rs | dcoles/advent-of-code | 4d480934daad60fcdb2112ef66f4115d9cb83ac2 | [
"MIT"
] | null | null | null | use std::{fs, fmt};
use std::path::Path;
use std::collections::{HashMap, VecDeque};
type Chemical = String;
const ORE: &str = "ORE";
const FUEL: &str = "FUEL";
const TRILLION: u64 = 1_000_000_000_000;
fn main() {
let input = read_input("input.txt");
// Part 1
assert_eq!(31, required_ore(&read_input("sam... | 30.79375 | 112 | 0.598742 | 3.078125 |
647f84865144aee13674b2cb43fb862bb0ee7c4f | 17,985 | rs | Rust | src/static_rc.rs | Johannesd3/static-rc | 48e883e2f5d89a3177ef31f4773ab7252b614a9d | [
"Apache-2.0",
"MIT"
] | null | null | null | src/static_rc.rs | Johannesd3/static-rc | 48e883e2f5d89a3177ef31f4773ab7252b614a9d | [
"Apache-2.0",
"MIT"
] | null | null | null | src/static_rc.rs | Johannesd3/static-rc | 48e883e2f5d89a3177ef31f4773ab7252b614a9d | [
"Apache-2.0",
"MIT"
] | null | null | null | // StaticRc
use core::{
any,
borrow,
cmp,
convert,
fmt,
future,
hash,
iter,
marker,
mem,
ops,
pin,
ptr::{self, NonNull},
task,
};
use alloc::boxed::Box;
#[cfg(nightly_async_stream)]
use core::stream;
/// A compile-time reference-counted pointer.
///
/// The i... | 34.127135 | 118 | 0.583097 | 3.375 |
90094aaa82be4c9b440fe850997c833182e8e5b8 | 1,575 | kt | Kotlin | app/src/main/java/tech/takenoko/cleanarchitecturex/repository/local/UserLocalDataSource.kt | TakenokoTech/CleanArchitectureX | 3fe34a5d239c7baece4de3a8416c9fd80fe129a2 | [
"MIT"
] | 3 | 2020-09-02T12:42:28.000Z | 2020-11-27T07:22:01.000Z | app/src/main/java/tech/takenoko/cleanarchitecturex/repository/local/UserLocalDataSource.kt | TakenokoTech/CleanArchitectureX | 3fe34a5d239c7baece4de3a8416c9fd80fe129a2 | [
"MIT"
] | 12 | 2019-11-28T05:56:50.000Z | 2019-12-09T16:55:35.000Z | app/src/main/java/tech/takenoko/cleanarchitecturex/repository/local/UserLocalDataSource.kt | TakenokoTech/CleanArchitectureX | 3fe34a5d239c7baece4de3a8416c9fd80fe129a2 | [
"MIT"
] | null | null | null | package tech.takenoko.cleanarchitecturex.repository.local
import androidx.annotation.MainThread
import androidx.annotation.WorkerThread
import androidx.lifecycle.LiveData
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import org.koin.core.KoinComponent
import org.koin.core.... | 29.166667 | 68 | 0.711746 | 3.09375 |
f065f569bc87da0b1005e3822cbd92500b510024 | 1,713 | py | Python | netensorflow/api_samples/ann_creation_and_usage.py | psigelo/NeTensorflow | ec8bc09cc98346484d1b682a3dfd25c68c4ded61 | [
"MIT"
] | null | null | null | netensorflow/api_samples/ann_creation_and_usage.py | psigelo/NeTensorflow | ec8bc09cc98346484d1b682a3dfd25c68c4ded61 | [
"MIT"
] | null | null | null | netensorflow/api_samples/ann_creation_and_usage.py | psigelo/NeTensorflow | ec8bc09cc98346484d1b682a3dfd25c68c4ded61 | [
"MIT"
] | null | null | null | import tensorflow as tf
from netensorflow.ann.ANN import ANN
from netensorflow.ann.macro_layer.MacroLayer import MacroLayer
from netensorflow.ann.macro_layer.layer_structure.InputLayerStructure import InputLayerStructure
from netensorflow.ann.macro_layer.layer_structure.LayerStructure import LayerStructure, LayerType
... | 37.23913 | 123 | 0.782837 | 3.140625 |
2d99d9c46e04f30f5d758fc9de892ba87ed74e95 | 2,716 | asm | Assembly | src/test/resources/elfsamples/tiny/keepalive.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | 3 | 2016-07-15T20:35:12.000Z | 2018-08-07T18:55:33.000Z | src/test/resources/elfsamples/tiny/keepalive.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | null | null | null | src/test/resources/elfsamples/tiny/keepalive.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | null | null | null | ;; keepalive.asm: Copyright (C) 2001 Brian Raiter <breadbox@muppetlabs.com>
;; Licensed under the terms of the GNU General Public License, either
;; version 2 or (at your option) any later version.
;;
;; To build:
;; nasm -f bin -o keepalive keepalive.asm && chmod +x keepalive
BITS 32
org 0x05426000
db 0x7F, "EL... | 33.95 | 75 | 0.663476 | 3 |
4d888bd8eaeb4e694ab623be7221fc8438aa8e03 | 6,215 | lua | Lua | game/helpers/mahjong/logic.lua | lualcs/xsServer | dc774f9f4364b5a24924c9ce5293d7cf5265c2d4 | [
"MIT"
] | 1 | 2021-02-08T12:27:24.000Z | 2021-02-08T12:27:24.000Z | game/helpers/mahjong/logic.lua | lualcs/xsServer | dc774f9f4364b5a24924c9ce5293d7cf5265c2d4 | [
"MIT"
] | null | null | null | game/helpers/mahjong/logic.lua | lualcs/xsServer | dc774f9f4364b5a24924c9ce5293d7cf5265c2d4 | [
"MIT"
] | 1 | 2022-01-23T05:14:55.000Z | 2022-01-23T05:14:55.000Z | --[[
file:mahjongLogic.lua
desc:麻将扑克
auth:Carol Luo
]]
local ipairs = ipairs
local math = require("extend_math")
local table = require("extend_table")
local class = require("class")
local gameLogic = require("game.logic")
---@class mahjongLogic:gameLogic @麻将扑克
local logic = class(gameLogic)
local this = l... | 20.57947 | 55 | 0.651167 | 3.15625 |
6fe07f6bbcf564bf1355bbc028f03e5afbd1aeaa | 8,829 | rs | Rust | binary/src/cli/remote.rs | iiYese/OMFG | 38162bdc322de53d50bb34abc6fd244636694cb7 | [
"MIT"
] | null | null | null | binary/src/cli/remote.rs | iiYese/OMFG | 38162bdc322de53d50bb34abc6fd244636694cb7 | [
"MIT"
] | null | null | null | binary/src/cli/remote.rs | iiYese/OMFG | 38162bdc322de53d50bb34abc6fd244636694cb7 | [
"MIT"
] | null | null | null | use std::{
io::{Write, Read},
fs::{File, rename}, path::{Path, PathBuf},
env::current_exe
};
use reqwest::{
StatusCode,
blocking::{Client, multipart::Form}
};
use serde::{Serialize, Deserialize};
use anyhow::{Context, anyhow, bail, Result as AnyHow};
use mac_address::get_mac_address;
use short_cryp... | 29.235099 | 102 | 0.508891 | 3.125 |
1410c372222c2ae5c4ad890f48fd7478a98bef6f | 5,255 | lua | Lua | torch_lua/src/util/torch_util.lua | migushu/rul-1 | a25f8a21ab978cfef2826ed7918de6dccaaa1c22 | [
"MIT"
] | 17 | 2017-11-22T19:14:49.000Z | 2021-11-09T07:22:52.000Z | torch_lua/src/util/torch_util.lua | johnsbuck/rul | a25f8a21ab978cfef2826ed7918de6dccaaa1c22 | [
"MIT"
] | null | null | null | torch_lua/src/util/torch_util.lua | johnsbuck/rul | a25f8a21ab978cfef2826ed7918de6dccaaa1c22 | [
"MIT"
] | 4 | 2018-11-19T01:35:56.000Z | 2020-02-17T05:47:07.000Z | ----------------------------------------------------------------------
-- A utility module containing Torch-based functions for editing
-- tensors, normalization, and other purposes.
-- @author John Bucknam
-- @license MIT
-- @module Torch-Utilities
-----------------------------------------------------------------... | 25.386473 | 75 | 0.559087 | 3.640625 |
abb91dc04859d56df64cca8558f1c74a23a34fe4 | 5,928 | rb | Ruby | lib/calendrical/base.rb | kipcole9/calendrical-ruby | e7e5693fa582c443ed3802fc8eed1dd98b59e9f3 | [
"MIT"
] | 1 | 2016-09-19T11:23:08.000Z | 2016-09-19T11:23:08.000Z | lib/calendrical/base.rb | kipcole9/calendrical-ruby | e7e5693fa582c443ed3802fc8eed1dd98b59e9f3 | [
"MIT"
] | null | null | null | lib/calendrical/base.rb | kipcole9/calendrical-ruby | e7e5693fa582c443ed3802fc8eed1dd98b59e9f3 | [
"MIT"
] | null | null | null | module Calendrical
class InvalidQuarter < StandardError; end
class InvalidMonth < StandardError; end
class InvalidWeek < StandardError; end
class InvalidDay< StandardError; end
class UnknownLunarPhase < StandardError; end
class DayError < StandardError; end
class MonthError < StandardError; end
class St... | 30.244898 | 78 | 0.550776 | 3.25 |
42cc0ac1546cae4ebc687ac3254e52adae4e8ef0 | 1,792 | lua | Lua | src/luacheck/check_state.lua | srinivas32/luacheck | 7ab26494a4a0f41c6f96e85fda846045429e3326 | [
"MIT"
] | 1,641 | 2015-01-03T18:57:09.000Z | 2022-03-30T22:08:29.000Z | src/luacheck/check_state.lua | srinivas32/luacheck | 7ab26494a4a0f41c6f96e85fda846045429e3326 | [
"MIT"
] | 206 | 2015-01-05T09:22:24.000Z | 2022-03-10T03:33:54.000Z | src/luacheck/check_state.lua | srinivas32/luacheck | 7ab26494a4a0f41c6f96e85fda846045429e3326 | [
"MIT"
] | 299 | 2015-01-07T02:08:52.000Z | 2022-03-27T10:26:47.000Z | local utils = require "luacheck.utils"
local check_state = {}
local CheckState = utils.class()
function CheckState:__init(source_bytes)
self.source_bytes = source_bytes
self.warnings = {}
end
-- Returns column of a character in a line given its offset.
-- The column is never larger than the line length.
-- Th... | 26.746269 | 78 | 0.748884 | 3.390625 |
962a8dc6e1a9a3cddabcba9d35fc5a6ceaac1001 | 3,118 | sql | SQL | hasura/migrations/1597267956798_window_views/up.sql | wbez/il-covid19-api | 1d0b89ec2b104af804ee203b5d83400d2a97d1ed | [
"MIT"
] | null | null | null | hasura/migrations/1597267956798_window_views/up.sql | wbez/il-covid19-api | 1d0b89ec2b104af804ee203b5d83400d2a97d1ed | [
"MIT"
] | 12 | 2020-07-28T16:50:16.000Z | 2020-10-16T16:23:16.000Z | hasura/migrations/1597267956798_window_views/up.sql | wbez/il-covid19-api | 1d0b89ec2b104af804ee203b5d83400d2a97d1ed | [
"MIT"
] | 3 | 2020-07-31T21:20:30.000Z | 2021-07-15T13:33:24.000Z | CREATE MATERIALIZED VIEW public.state_testing_results_change
AS
SELECT
date,
total_tested,
total_tested - lag(total_tested) OVER (ORDER BY date) AS total_tested_change,
round(
(
(total_tested - lag(total_tested) OVER (ORDER BY date))::numeric / lag(total_tested) OVER (ORDER BY da... | 35.431818 | 170 | 0.63406 | 3.265625 |
cb8c1143da35971ebc1b2488297e747858737071 | 1,079 | swift | Swift | Tests/BowLaws/MonadStateLaws.swift | Dragna/bow | 8cd19a4fd84463b53ce1b0772bec96d84f9f5007 | [
"Apache-2.0"
] | null | null | null | Tests/BowLaws/MonadStateLaws.swift | Dragna/bow | 8cd19a4fd84463b53ce1b0772bec96d84f9f5007 | [
"Apache-2.0"
] | null | null | null | Tests/BowLaws/MonadStateLaws.swift | Dragna/bow | 8cd19a4fd84463b53ce1b0772bec96d84f9f5007 | [
"Apache-2.0"
] | null | null | null | import Foundation
import SwiftCheck
@testable import Bow
class MonadStateLaws<F: MonadState & EquatableK> where F.S == Int {
static func check() {
getIdempotent()
setTwice()
setGet()
getSet()
}
private static func getIdempotent() {
property("Idempotence") <... | 28.394737 | 99 | 0.531047 | 3.21875 |
a13b4c76945bcf9c9e5830aae8366268e006c06b | 6,588 | go | Go | part.go | cinience/go.enmime | 3702bd9092afd46a33a80af5bec693960b583418 | [
"MIT"
] | null | null | null | part.go | cinience/go.enmime | 3702bd9092afd46a33a80af5bec693960b583418 | [
"MIT"
] | null | null | null | part.go | cinience/go.enmime | 3702bd9092afd46a33a80af5bec693960b583418 | [
"MIT"
] | null | null | null | package enmime
import (
"bufio"
"bytes"
"encoding/base64"
"fmt"
"io"
"mime"
"mime/multipart"
"net/textproto"
"strings"
"github.com/sloonz/go-qprintable"
)
// MIMEPart is the primary interface enmine clients will use. Each MIMEPart represents
// a node in the MIME multipart tree. The Content-Type, Disposi... | 27.22314 | 91 | 0.686703 | 3.125 |
5b3c51498621ede0a2e5fe424027b2d0f6bb763b | 4,270 | c | C | io/read_hdf5.c | Andrei-EPFL/FCFC | fdf69fc5d6b24bdd7fff2bcdf8998c6ecacabdd6 | [
"MIT"
] | null | null | null | io/read_hdf5.c | Andrei-EPFL/FCFC | fdf69fc5d6b24bdd7fff2bcdf8998c6ecacabdd6 | [
"MIT"
] | null | null | null | io/read_hdf5.c | Andrei-EPFL/FCFC | fdf69fc5d6b24bdd7fff2bcdf8998c6ecacabdd6 | [
"MIT"
] | null | null | null | #include "read_file.h"
#include "libast.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include "hdf5.h"
static int read_col(hid_t group_id, char const *pos, real **data, hsize_t *num) {
const int ndims = 1;//H5Sget_simple_extent_ndims(data_space);
hsize_... | 26.855346 | 111 | 0.559016 | 3.015625 |
a243c32bd2afc2eeb277de62059676cf64718f4d | 4,218 | asm | Assembly | Labs/Lab6/lab06_ex1.asm | ptr2578/CS61 | 682dccd6b986f383120a4612eb7e7a2d1e3cfa3f | [
"BSD-3-Clause"
] | 1 | 2019-01-01T23:31:22.000Z | 2019-01-01T23:31:22.000Z | Labs/Lab6/lab06_ex1.asm | ptr2578/CS61 | 682dccd6b986f383120a4612eb7e7a2d1e3cfa3f | [
"BSD-3-Clause"
] | null | null | null | Labs/Lab6/lab06_ex1.asm | ptr2578/CS61 | 682dccd6b986f383120a4612eb7e7a2d1e3cfa3f | [
"BSD-3-Clause"
] | null | null | null | ;=================================================
; Name: Sungho Ahn
; Email: sahn025@ucr.edu
; GitHub username: ptr2578
;
; Lab: lab 6
; Lab section: B21
; TA: Jason Goulding
;=================================================
.ORIG x3000
;--------------
; Instructions
;--------------
LD R1, ARRAY_PTR ; Load address... | 29.089655 | 76 | 0.613798 | 3.421875 |
502c0aad13ef2fe5f62da67fe6ccdec547ae174b | 3,192 | go | Go | go/src/fblib/edge.go | dominichamon/force-bundles | 3bc542ef7d471a3541f58e9458473d5b0e3839fd | [
"Apache-2.0"
] | null | null | null | go/src/fblib/edge.go | dominichamon/force-bundles | 3bc542ef7d471a3541f58e9458473d5b0e3839fd | [
"Apache-2.0"
] | null | null | null | go/src/fblib/edge.go | dominichamon/force-bundles | 3bc542ef7d471a3541f58e9458473d5b0e3839fd | [
"Apache-2.0"
] | 1 | 2020-11-15T20:12:29.000Z | 2020-11-15T20:12:29.000Z | package fblib
import (
"fmt"
"math"
)
const (
K = 0.01
)
type Edge struct {
forces []Vector
velocities []Vector
vertices []Point
}
func NewEdge(p0, p1 Point) *Edge {
return &Edge{forces: []Vector{}, velocities: []Vector{}, vertices: []Point{p0, p1},}
}
func (e *Edge) compatibility(q Edge) float64 {
d... | 24.744186 | 85 | 0.640664 | 3.484375 |
9c01205d252ee1a4634218eb8952a31f3a7fab86 | 3,906 | js | JavaScript | test/utils.spec.js | lake-effect/react-decoration | a7322bd66eaaffb6376e76cf3e864486904c8fed | [
"MIT"
] | 679 | 2016-09-28T18:15:21.000Z | 2022-02-06T21:21:11.000Z | test/utils.spec.js | lake-effect/react-decoration | a7322bd66eaaffb6376e76cf3e864486904c8fed | [
"MIT"
] | 13 | 2016-10-22T02:45:35.000Z | 2020-03-27T12:44:43.000Z | test/utils.spec.js | lake-effect/react-decoration | a7322bd66eaaffb6376e76cf3e864486904c8fed | [
"MIT"
] | 34 | 2016-09-27T21:06:32.000Z | 2021-07-17T02:44:54.000Z | import expect from 'expect';
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
import {
validateClass,
validateFunction,
validateClassAndFunction,
} from '../src/utils/validators';
import getEventPreprocessor from '../src/utils/getEventPreprocessor';
import wrapLifecycleMethod from '..... | 30.515625 | 94 | 0.616743 | 3.125 |
3d052dd80b40866b1a5f2797e995992515d13b8d | 2,149 | go | Go | pkg/cli/v0/loadbalancer/backends.go | MagnusS/infrakit | 350060829e83c2ff3f10f2ce9af3167590e9b59e | [
"Apache-2.0"
] | 1 | 2021-07-01T05:28:49.000Z | 2021-07-01T05:28:49.000Z | pkg/cli/v0/loadbalancer/backends.go | MagnusS/infrakit | 350060829e83c2ff3f10f2ce9af3167590e9b59e | [
"Apache-2.0"
] | null | null | null | pkg/cli/v0/loadbalancer/backends.go | MagnusS/infrakit | 350060829e83c2ff3f10f2ce9af3167590e9b59e | [
"Apache-2.0"
] | null | null | null | package loadbalancer
import (
"fmt"
"io"
"os"
"github.com/docker/infrakit/pkg/cli"
"github.com/docker/infrakit/pkg/spi/instance"
"github.com/spf13/cobra"
)
// Backends returns the describe command
func Backends(name string, services *cli.Services) *cobra.Command {
backends := &cobra.Command{
Use: "backend... | 20.084112 | 67 | 0.604467 | 3.109375 |
9edd57faa5df8c4cb4f693a459e2342b93f2e60c | 1,816 | rs | Rust | src/service/places/request.rs | timeanddate/libtad-rs | c4a3bd4c80780196c17358e7a5b4e39182d857a9 | [
"MIT"
] | null | null | null | src/service/places/request.rs | timeanddate/libtad-rs | c4a3bd4c80780196c17358e7a5b4e39182d857a9 | [
"MIT"
] | null | null | null | src/service/places/request.rs | timeanddate/libtad-rs | c4a3bd4c80780196c17358e7a5b4e39182d857a9 | [
"MIT"
] | null | null | null | use serde::Serialize;
#[derive(Default, Serialize)]
/// Places API request.
///
/// Request is validated when supplied to the client.
///
/// Example:
/// ```
/// use libtad_rs::{
/// ServiceClient,
/// service::places::PlacesRequest,
/// };
///
/// let client = ServiceClient::new("access_key".into(), "secret_... | 23.894737 | 78 | 0.585352 | 3.15625 |
7013b4e6a1fb00a3c474d634a4aea75c55a30781 | 1,784 | go | Go | transpose/transpose.go | charlievieth/utils | 57f65151ac366ad3d0d4389a1f56e003ba4d142c | [
"MIT"
] | 2 | 2018-10-24T10:36:28.000Z | 2021-07-18T15:51:15.000Z | transpose/transpose.go | charlievieth/utils | 57f65151ac366ad3d0d4389a1f56e003ba4d142c | [
"MIT"
] | null | null | null | transpose/transpose.go | charlievieth/utils | 57f65151ac366ad3d0d4389a1f56e003ba4d142c | [
"MIT"
] | null | null | null | package main
import (
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
"text/tabwriter"
)
var LineCount int
var MaxLength int
func init() {
flag.IntVar(&LineCount, "n", 2, "Number of lines to transpose")
flag.IntVar(&MaxLength, "l", -1, "Max line length, -1 means no max length")
}... | 18.778947 | 76 | 0.555493 | 3.453125 |
0cfa89782c8d3290c0c6ceba7319a0449a110fed | 2,585 | py | Python | model/embeddings.py | johnnytorres/crisis_conv_crosslingual | a30e762007e08190275bdd83af3c0bbc717fb516 | [
"MIT"
] | null | null | null | model/embeddings.py | johnnytorres/crisis_conv_crosslingual | a30e762007e08190275bdd83af3c0bbc717fb516 | [
"MIT"
] | null | null | null | model/embeddings.py | johnnytorres/crisis_conv_crosslingual | a30e762007e08190275bdd83af3c0bbc717fb516 | [
"MIT"
] | 1 | 2019-12-03T00:29:14.000Z | 2019-12-03T00:29:14.000Z | import os
import logging
import argparse
import numpy as np
import tensorflow as tf
from keras_preprocessing.text import Tokenizer
from tqdm import tqdm
from data import DataLoader
class EmbeddingsBuilder:
def __init__(self, args):
logging.info('initializing...')
self.args = args
self.da... | 31.91358 | 109 | 0.635977 | 3.265625 |
75e147ff08d031c15b62d14418d43f760e0e14c9 | 2,456 | rs | Rust | src/main.rs | MerlinDMC/noderole | 7d90012e597502f2623c333f775f3111585b51cc | [
"Apache-2.0",
"MIT"
] | null | null | null | src/main.rs | MerlinDMC/noderole | 7d90012e597502f2623c333f775f3111585b51cc | [
"Apache-2.0",
"MIT"
] | null | null | null | src/main.rs | MerlinDMC/noderole | 7d90012e597502f2623c333f775f3111585b51cc | [
"Apache-2.0",
"MIT"
] | null | null | null | use clap::{crate_name, AppSettings, Parser};
use figment::{
providers::{Format, Yaml},
Figment,
};
use k8s_openapi::api::core::v1::Node;
use k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta;
use kube::api::{Api, Patch, PatchParams};
use kube::Client;
use serde::Deserialize;
use std::collections::BTree... | 27.595506 | 82 | 0.607492 | 3.0625 |
e735358ce337c7093b31d7291a1e03c36b966f7d | 2,593 | lua | Lua | rom/dotos/libraries/termio.lua | development-of-things-software/.OS | e7d2b4f6f42c5339080dd76d900dba01f96d3742 | [
"MIT"
] | null | null | null | rom/dotos/libraries/termio.lua | development-of-things-software/.OS | e7d2b4f6f42c5339080dd76d900dba01f96d3742 | [
"MIT"
] | null | null | null | rom/dotos/libraries/termio.lua | development-of-things-software/.OS | e7d2b4f6f42c5339080dd76d900dba01f96d3742 | [
"MIT"
] | null | null | null | -- terminal I/O library --
local lib = {}
local function getHandler()
local term = os.getenv("TERM") or "generic"
return require("termio."..term)
end
-------------- Cursor manipulation ---------------
function lib.setCursor(x, y)
if not getHandler().ttyOut() then
return
end
io.write(string.format("\27[... | 19.643939 | 75 | 0.587736 | 3.40625 |
cb8f593bf81163325b16a935ee03841686b1722a | 880 | asm | Assembly | os/bootloader/32bit_print.asm | stplasim/basic-os | 36d951e2e2adcbae75a6066b464552b61a3d7f2c | [
"MIT"
] | 2 | 2021-03-21T09:32:19.000Z | 2022-01-28T22:22:41.000Z | os/bootloader/32bit_print.asm | stplasim/basic-os | 36d951e2e2adcbae75a6066b464552b61a3d7f2c | [
"MIT"
] | null | null | null | os/bootloader/32bit_print.asm | stplasim/basic-os | 36d951e2e2adcbae75a6066b464552b61a3d7f2c | [
"MIT"
] | null | null | null | ; This print string routine works in 32-bit mode
; Here we don't have BIOS interrupts. We directly manipulating the VGA video memory instead of calling int 0x10
; The VGA memory starts at address 0xb8000 and it has a text mode which is useful to avoid manipulating direct pixels.
[bits 32] ; using 32-bit protected mode... | 27.5 | 118 | 0.738636 | 3.1875 |
7cd0d34e13cde89496f6e7690d20e351df94ef5d | 9,317 | rs | Rust | weave/src/matrix/forest/mod.rs | tclchiam/weave-ce | 03c7b01b50111c48f6d1b471a23638825d0dbf0e | [
"BSD-3-Clause"
] | 2 | 2018-09-02T03:43:46.000Z | 2018-09-05T22:48:50.000Z | weave/src/matrix/forest/mod.rs | tclchiam/bowtie | 03c7b01b50111c48f6d1b471a23638825d0dbf0e | [
"BSD-3-Clause"
] | null | null | null | weave/src/matrix/forest/mod.rs | tclchiam/bowtie | 03c7b01b50111c48f6d1b471a23638825d0dbf0e | [
"BSD-3-Clause"
] | null | null | null | use std::hash::Hash;
use std::iter::FromIterator;
use hashbrown::{HashMap, HashSet};
use itertools::Itertools;
mod union;
mod intersect;
mod subset;
mod product;
/// Forest is an immutable set of sets
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum Forest<T: Hash + Eq> {
Empty,
Unit(Vec<T>),
Many(HashSet... | 24.518421 | 88 | 0.43104 | 3.21875 |
930e02c260b9ab769dfb6fa46dc70d03ed195ef0 | 12,531 | rs | Rust | src/options/parse.rs | Kilobyte22/dhcp_parser | cc95195d6ddd13ff3e9e0816a6dee00f3816d736 | [
"MIT"
] | 2 | 2016-09-05T10:53:09.000Z | 2019-07-19T20:12:13.000Z | src/options/parse.rs | Kilobyte22/dhcp_parser | cc95195d6ddd13ff3e9e0816a6dee00f3816d736 | [
"MIT"
] | 3 | 2016-01-10T20:19:49.000Z | 2019-07-17T06:26:12.000Z | src/options/parse.rs | Kilobyte22/dhcp_parser | cc95195d6ddd13ff3e9e0816a6dee00f3816d736 | [
"MIT"
] | 5 | 2015-10-27T15:11:23.000Z | 2018-10-10T18:35:59.000Z | use options::{DhcpOption};
use options::DhcpOption::*;
use {Result, Error};
use nom::{be_u8, be_u16, be_u32, be_i32, length_value, IResult, sized_buffer};
use std::borrow::{ToOwned};
use std::str;
use std::convert::{From};
use std::net::{IpAddr, Ipv4Addr};
use num::{FromPrimitive};
pub fn parse(bytes: &[u8]) -> Result... | 27.360262 | 90 | 0.562365 | 3.03125 |
8ab928e461865fa511c336723c790fdcfd96989a | 1,361 | kt | Kotlin | app/src/main/java/ru/kartsev/dmitry/cinemadetails/mvvm/view/helper/ZoomOutPageTransformer.kt | Jaguarhl/MoviesDetails | d80929fcb461249c074dfff73ce7156ee91ff074 | [
"Apache-2.0"
] | null | null | null | app/src/main/java/ru/kartsev/dmitry/cinemadetails/mvvm/view/helper/ZoomOutPageTransformer.kt | Jaguarhl/MoviesDetails | d80929fcb461249c074dfff73ce7156ee91ff074 | [
"Apache-2.0"
] | null | null | null | app/src/main/java/ru/kartsev/dmitry/cinemadetails/mvvm/view/helper/ZoomOutPageTransformer.kt | Jaguarhl/MoviesDetails | d80929fcb461249c074dfff73ce7156ee91ff074 | [
"Apache-2.0"
] | null | null | null | package ru.kartsev.dmitry.cinemadetails.mvvm.view.helper
import android.view.View
import androidx.viewpager.widget.ViewPager
import kotlin.math.abs
import kotlin.math.max
private const val MIN_SCALE = 0.85f
private const val MIN_ALPHA = 0.5f
class ZoomOutPageTransformer : ViewPager.PageTransformer {
override fu... | 31.651163 | 90 | 0.47612 | 3 |
f54a78074f5651a294b5fca64ab5fd88bc3b4ad6 | 842 | rs | Rust | rust/src/day01/part01.rs | goksgie/advent-of-code-2021 | e0df17bac95daf221ab97dbcf3f6bfc36aacf04a | [
"MIT"
] | null | null | null | rust/src/day01/part01.rs | goksgie/advent-of-code-2021 | e0df17bac95daf221ab97dbcf3f6bfc36aacf04a | [
"MIT"
] | null | null | null | rust/src/day01/part01.rs | goksgie/advent-of-code-2021 | e0df17bac95daf221ab97dbcf3f6bfc36aacf04a | [
"MIT"
] | null | null | null | /// Compute the consequtive increase in the input and output the result
/// as u64.
pub fn compute_consequtive_increase<'a, T: IntoIterator<Item = &'a u64>>(numbers: T) -> u64 {
let mut prev_elem = None;
let mut result = 0;
for elem in numbers {
if let Some(prev) = prev_elem {
if ele... | 27.16129 | 93 | 0.557007 | 3.265625 |
83a7a128dbfc52d480556e124e5c3c03ec04e023 | 4,348 | rs | Rust | src/main.rs | laptou/reactions-telegram-bot | 7b044b1e8d9b313836dd99dcf4797f2346b76323 | [
"MIT"
] | 5 | 2021-03-21T17:04:52.000Z | 2021-12-30T21:18:45.000Z | src/main.rs | laptou/reactions-telegram-bot | 7b044b1e8d9b313836dd99dcf4797f2346b76323 | [
"MIT"
] | 2 | 2020-10-01T22:11:58.000Z | 2020-10-04T17:01:16.000Z | src/main.rs | laptou/reactions-telegram-bot | 7b044b1e8d9b313836dd99dcf4797f2346b76323 | [
"MIT"
] | 1 | 2021-04-15T13:57:01.000Z | 2021-04-15T13:57:01.000Z | use std::{convert::Infallible, env, net::SocketAddr};
use log::{info, warn};
use pretty_env_logger;
use teloxide::{dispatching::update_listeners::UpdateListener, utils::command::BotCommand};
use teloxide::{prelude::*, types::*};
use tokio;
mod handler;
mod reaction;
use handler::{handle_callback_query, handle_comman... | 33.705426 | 98 | 0.560948 | 3.09375 |
85b09f781bff657bfa1b539e3984457a9d1a791a | 7,043 | js | JavaScript | js/tree_vis.js | UnofficialJuliaMirrorSnapshots/D3Trees.jl-e3df1716-f71e-5df9-9e2d-98e193103c45 | c97f3175a258528c66d7b16f36627c903c9e3a03 | [
"MIT"
] | 22 | 2017-09-29T18:22:25.000Z | 2021-09-29T19:54:20.000Z | js/tree_vis.js | UnofficialJuliaMirrorSnapshots/D3Trees.jl-e3df1716-f71e-5df9-9e2d-98e193103c45 | c97f3175a258528c66d7b16f36627c903c9e3a03 | [
"MIT"
] | 20 | 2017-09-27T02:13:55.000Z | 2020-07-15T16:01:18.000Z | js/tree_vis.js | UnofficialJuliaMirrorSnapshots/D3Trees.jl-e3df1716-f71e-5df9-9e2d-98e193103c45 | c97f3175a258528c66d7b16f36627c903c9e3a03 | [
"MIT"
] | 6 | 2018-02-26T18:33:41.000Z | 2021-08-03T12:23:42.000Z | if (typeof $ === 'undefined') {
loadScript("https://code.jquery.com/jquery-3.1.1.min.js", run);
} else {
run();
}
function run() {
if (typeof d3 === 'undefined') {
loadScript("https://d3js.org/d3.v3.js", showTree);
} else {
showTree();
}
}
function loadScript(url, callback)
{
c... | 31.441964 | 102 | 0.543802 | 3.046875 |
5adc45dcf20cc0bceef7b69f755461f0ee107f2f | 2,215 | rs | Rust | 2017/src/day01.rs | shrugalic/advent_of_code | 8d18a3dbdcf847a667ab553f5441676003b9362a | [
"MIT"
] | 1 | 2021-12-17T18:26:17.000Z | 2021-12-17T18:26:17.000Z | 2017/src/day01.rs | shrugalic/advent_of_code | 8d18a3dbdcf847a667ab553f5441676003b9362a | [
"MIT"
] | null | null | null | 2017/src/day01.rs | shrugalic/advent_of_code | 8d18a3dbdcf847a667ab553f5441676003b9362a | [
"MIT"
] | null | null | null | use line_reader::read_file_to_lines;
pub(crate) fn day1_part1() -> u32 {
let line = read_file_to_lines("input/day01.txt").remove(0);
solve_part1_captcha(line)
}
pub(crate) fn day1_part2() -> u32 {
let line = read_file_to_lines("input/day01.txt").remove(0);
solve_part2_captcha(line)
}
fn solve_part1_c... | 20.896226 | 63 | 0.552596 | 3.21875 |
fb628cfd5872f8ee00cb34decf048e7ec09267be | 3,752 | kt | Kotlin | psolib/src/commonMain/kotlin/world/phantasmal/psolib/asm/dataFlowAnalysis/GetStackValue.kt | DaanVandenBosch/phantasmal-world | 89ea739c65fda32cda1caaf159cad022469e2663 | [
"MIT"
] | 16 | 2019-06-14T03:20:51.000Z | 2022-02-04T08:01:56.000Z | psolib/src/commonMain/kotlin/world/phantasmal/psolib/asm/dataFlowAnalysis/GetStackValue.kt | DaanVandenBosch/phantasmal-world | 89ea739c65fda32cda1caaf159cad022469e2663 | [
"MIT"
] | 12 | 2019-09-15T20:37:05.000Z | 2022-02-06T03:24:22.000Z | psolib/src/commonMain/kotlin/world/phantasmal/psolib/asm/dataFlowAnalysis/GetStackValue.kt | DaanVandenBosch/phantasmal-world | 89ea739c65fda32cda1caaf159cad022469e2663 | [
"MIT"
] | 5 | 2019-07-20T05:16:20.000Z | 2021-11-15T09:19:54.000Z | package world.phantasmal.psolib.asm.dataFlowAnalysis
import mu.KotlinLogging
import world.phantasmal.psolib.asm.*
private val logger = KotlinLogging.logger {}
/**
* Computes the possible values of a stack element at the nth position from the top, right before a
* specific instruction. If the stack element's value ... | 29.3125 | 99 | 0.472548 | 3.21875 |
e73edfde7f67f674b761d7588194ef86d54d8b46 | 2,258 | js | JavaScript | src/game/models/tile.js | aldhsu/minesweeper | adaa9bc74b53dbe4697e2bf228faabf973eb093d | [
"CC0-1.0"
] | null | null | null | src/game/models/tile.js | aldhsu/minesweeper | adaa9bc74b53dbe4697e2bf228faabf973eb093d | [
"CC0-1.0"
] | null | null | null | src/game/models/tile.js | aldhsu/minesweeper | adaa9bc74b53dbe4697e2bf228faabf973eb093d | [
"CC0-1.0"
] | null | null | null | import _ from 'underscore';
export default class Tile {
constructor(y, x, board, channel) {
this.x = x;
this.y = y;
this.board = board;
this.revealed = false;
this.isBomb = false;
this.channel = channel;
this.isFlagged = false;
}
get isRevealed() {
return this.revealed;
}
ge... | 19.807018 | 124 | 0.550487 | 3.171875 |
ad44640a5702e5628a875fa2bd0cf737563647a8 | 2,336 | lua | Lua | src/mod/tools/api/MapViewer.lua | Ruin0x11/OpenNefia | 548f1a1442eca704bb1c16b1a1591d982a34919f | [
"MIT"
] | 109 | 2020-04-07T16:56:38.000Z | 2022-02-17T04:05:40.000Z | src/mod/tools/api/MapViewer.lua | Ruin0x11/OpenNefia | 548f1a1442eca704bb1c16b1a1591d982a34919f | [
"MIT"
] | 243 | 2020-04-07T08:25:15.000Z | 2021-10-30T07:22:10.000Z | src/mod/tools/api/MapViewer.lua | Ruin0x11/OpenNefia | 548f1a1442eca704bb1c16b1a1591d982a34919f | [
"MIT"
] | 15 | 2020-04-25T12:28:55.000Z | 2022-02-23T03:20:43.000Z | local Draw = require("api.Draw")
local Gui = require("api.Gui")
local InstancedMap = require("api.InstancedMap")
local MapRenderer = require("api.gui.MapRenderer")
local IUiLayer = require("api.gui.IUiLayer")
local IInput = require("api.gui.IInput")
local InputHandler = require("api.gui.InputHandler")
local MapViewer... | 24.333333 | 68 | 0.686644 | 3.25 |
0ce87ae6e8e21068ebe0de253baf4eb583ece22f | 701 | py | Python | conv.py | aenco9/HCAP2021 | d194ba5eab7e361d67f6de3c62f9f17f896ebcf3 | [
"MIT"
] | null | null | null | conv.py | aenco9/HCAP2021 | d194ba5eab7e361d67f6de3c62f9f17f896ebcf3 | [
"MIT"
] | null | null | null | conv.py | aenco9/HCAP2021 | d194ba5eab7e361d67f6de3c62f9f17f896ebcf3 | [
"MIT"
] | null | null | null | import numpy as np
def convolucion(Ioriginal, kernel):
'''Método encargado de realizar una convolución a una imagen
Entrada:
Ioriginal - imagen original en forma de matríz
kernel - kernel para barrer la imagen
Salida:
res - imagen resultante'''
#fr - filas, cr - columnas
fr = len(Ioriginal)-(len(kernel)-1)
c... | 26.961538 | 61 | 0.664765 | 3.171875 |
75c6fcc4bc86bebf74b9fc4302553cb213042dfa | 3,108 | swift | Swift | src/JetLib/JetLib/Core/Command/ActionCommand.swift | TrueShirshov/ios_swift_utils | a72c43d4fb9db6f34616b88ab7acc786af0bc6d6 | [
"MIT"
] | 7 | 2018-10-01T12:17:10.000Z | 2020-11-07T10:34:17.000Z | src/JetLib/JetLib/Core/Command/ActionCommand.swift | TrueShirshov/ios_swift_utils | a72c43d4fb9db6f34616b88ab7acc786af0bc6d6 | [
"MIT"
] | null | null | null | src/JetLib/JetLib/Core/Command/ActionCommand.swift | TrueShirshov/ios_swift_utils | a72c43d4fb9db6f34616b88ab7acc786af0bc6d6 | [
"MIT"
] | 1 | 2019-08-28T19:18:29.000Z | 2019-08-28T19:18:29.000Z | //
// Created on 27/07/2018
// Copyright © Vladimir Benkevich 2018
//
import Foundation
@available(*, deprecated, message: "Use CommandFactory instead")
open class ActionCommand: SerialCommand {
private let execute: (Any?) -> Void
private let canExecute: ((Any?) -> Bool)?
public init(execute: @escapin... | 28.513761 | 110 | 0.52027 | 3 |
21b0efa986efb538633538be931b8baed7abf5e5 | 1,006 | rs | Rust | bin/xcm-tools/src/cli.rs | stakedtechnologies/Neon | d7719ff137227caa590d5e4096abc5ed850e0b60 | [
"Apache-2.0"
] | 1 | 2019-03-25T06:43:56.000Z | 2019-03-25T06:43:56.000Z | bin/xcm-tools/src/cli.rs | stakedtechnologies/Neon | d7719ff137227caa590d5e4096abc5ed850e0b60 | [
"Apache-2.0"
] | null | null | null | bin/xcm-tools/src/cli.rs | stakedtechnologies/Neon | d7719ff137227caa590d5e4096abc5ed850e0b60 | [
"Apache-2.0"
] | null | null | null | /// Astar XCM tools.
#[derive(Debug, clap::Parser)]
#[clap(subcommand_required = true)]
pub struct Cli {
/// Possible subcommand with parameters.
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,
}
/// Possible subcommands of the main binary.
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
... | 27.189189 | 70 | 0.702783 | 3 |
1821f3b96a5935c203b3edf6a44aabdd1c70fb05 | 1,070 | rb | Ruby | gem/spec/lib/core/threading_spec.rb | floere/gosu_extensions | f2432fdaae277294b4b3b751f326fad1843ef335 | [
"MIT"
] | 1 | 2015-08-16T19:06:27.000Z | 2015-08-16T19:06:27.000Z | gem/spec/lib/core/threading_spec.rb | floere/gosu_extensions | f2432fdaae277294b4b3b751f326fad1843ef335 | [
"MIT"
] | null | null | null | gem/spec/lib/core/threading_spec.rb | floere/gosu_extensions | f2432fdaae277294b4b3b751f326fad1843ef335 | [
"MIT"
] | null | null | null | require File.join(File.dirname(__FILE__), '/../../spec_helper')
describe Threading do
before(:each) do
@window = stub :window, :things => []
@threaded = test_class_with(Threading).new @window
end
describe "sometimes" do
it "should only call the block's content every x times" do
@threaded.... | 30.571429 | 87 | 0.657944 | 3.015625 |
330f0c3baa6b73293fcd4fabbaa5457656f166bd | 22,550 | py | Python | pydicom_ext/pydicom_series.py | shinaji/pydicom_ext | bc3d716eb488589ba5906a0722474682987dafb8 | [
"MIT"
] | null | null | null | pydicom_ext/pydicom_series.py | shinaji/pydicom_ext | bc3d716eb488589ba5906a0722474682987dafb8 | [
"MIT"
] | null | null | null | pydicom_ext/pydicom_series.py | shinaji/pydicom_ext | bc3d716eb488589ba5906a0722474682987dafb8 | [
"MIT"
] | null | null | null | # dicom_series.py
"""
By calling the function read_files with a directory name or list
of files as an argument, a list of DicomSeries instances can be
obtained. A DicomSeries object has some attributes that give
information about the serie (such as shape, sampling, suid) and
has an info attribute, which is a pydi... | 32.823872 | 80 | 0.587095 | 3.125 |
a70f4bfdf6e56a2d004b9b30fc713c8e183a22d4 | 1,770 | swift | Swift | Carthage/Checkouts/ReactiveCocoa/Carthage/Checkouts/ReactiveSwift/Sources/Observers/Throttle.swift | arcangelw/ReactiveAutomaton | e2876b876ac3ba79f0ca797d04567e8469b3c2bb | [
"MIT"
] | 3,078 | 2016-09-11T01:54:26.000Z | 2022-03-25T09:38:59.000Z | Carthage/Checkouts/ReactiveCocoa/Carthage/Checkouts/ReactiveSwift/Sources/Observers/Throttle.swift | arcangelw/ReactiveAutomaton | e2876b876ac3ba79f0ca797d04567e8469b3c2bb | [
"MIT"
] | 602 | 2016-09-11T12:12:29.000Z | 2022-03-30T14:45:06.000Z | Sources/Observers/Throttle.swift | isabella232/ReactiveSwift | efb2f0a6f6c8739cce8fb14148a5bd3c83f2f91d | [
"MIT"
] | 565 | 2016-09-11T07:04:27.000Z | 2022-03-16T19:57:51.000Z | import Foundation
extension Operators {
internal final class Throttle<Value, Error: Swift.Error>: UnaryAsyncOperator<Value, Value, Error> {
let interval: TimeInterval
let targetWithClock: DateScheduler
private let state: Atomic<ThrottleState<Value>> = Atomic(ThrottleState())
private let schedulerDisposable =... | 27.230769 | 114 | 0.736723 | 3.078125 |
71e243140310dbc868442ebb0c4493d5cf29492e | 2,707 | sql | SQL | procedures/saveServantInfo.sql | sir-nutty/myChaldea-DB | 796d9f76d7dd64eff2923c92f0031589573d9c60 | [
"MIT"
] | null | null | null | procedures/saveServantInfo.sql | sir-nutty/myChaldea-DB | 796d9f76d7dd64eff2923c92f0031589573d9c60 | [
"MIT"
] | null | null | null | procedures/saveServantInfo.sql | sir-nutty/myChaldea-DB | 796d9f76d7dd64eff2923c92f0031589573d9c60 | [
"MIT"
] | null | null | null | CREATE DEFINER=`admin`@`10.150.0.2` PROCEDURE `saveServantInfo`(IN
user_uid VARCHAR(100),
servantName VARCHAR(100),
servantID SMALLINT,
servantType VARCHAR(30),
servantLevel TINYINT,
servantWiki VARCHAR(100),
servantFandom VARCHAR(100))
BEGIN
/*Changelog:
- 02/02/2021: Added isAdmin check.*/
... | 52.057692 | 174 | 0.700406 | 3.140625 |
e72d543325127793a428caa4bb50e28f374dcb4c | 11,270 | lua | Lua | Board.lua | AhmedDawoud3/Chess-Love2D | c2555dd61d13d4e1fd2e8b218f874fab012b8c86 | [
"MIT"
] | null | null | null | Board.lua | AhmedDawoud3/Chess-Love2D | c2555dd61d13d4e1fd2e8b218f874fab012b8c86 | [
"MIT"
] | null | null | null | Board.lua | AhmedDawoud3/Chess-Love2D | c2555dd61d13d4e1fd2e8b218f874fab012b8c86 | [
"MIT"
] | null | null | null | lightCol = {241 / 255, 217 / 255, 192 / 255, 1}
darkCol = {169 / 255, 122 / 255, 101 / 255, 1}
WIDTH = 960
HEIGHT = 960
squareTileWidth = WIDTH / 8
squareTileHeight = HEIGHT / 8
local queenShadow = 0
local rookShadow = 0
local knightShadow = 0
local bishopShadow = 0
function CreateGraphicalBoard()
for file = 0, 7 ... | 43.682171 | 120 | 0.607986 | 3.375 |
bbdb03c3f539663a7877265fcd39ede110c4a621 | 1,141 | kt | Kotlin | main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt | Richargh/spock-strong-types-krdl-kt-sandbox | 5e4307dc43eda04f61de83c141267f9a7eb8fe54 | [
"MIT"
] | null | null | null | main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt | Richargh/spock-strong-types-krdl-kt-sandbox | 5e4307dc43eda04f61de83c141267f9a7eb8fe54 | [
"MIT"
] | null | null | null | main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt | Richargh/spock-strong-types-krdl-kt-sandbox | 5e4307dc43eda04f61de83c141267f9a7eb8fe54 | [
"MIT"
] | null | null | null | package de.richargh.sandbox.spock.strongtypes
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.catchThrowable
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.CsvSource
import org.junit.jupiter.params.provider.ValueSource
internal class... | 25.931818 | 77 | 0.624014 | 3.03125 |
4ac3050ee1afc7cc157d450e529e2b9b151e51c2 | 2,092 | swift | Swift | playgrounds/ChangingGradientView.playground/Contents.swift | Changzw/every-case-demo | 0ba08146fee2904bd2151fcea8041f03b8b86e71 | [
"Apache-2.0"
] | null | null | null | playgrounds/ChangingGradientView.playground/Contents.swift | Changzw/every-case-demo | 0ba08146fee2904bd2151fcea8041f03b8b86e71 | [
"Apache-2.0"
] | null | null | null | playgrounds/ChangingGradientView.playground/Contents.swift | Changzw/every-case-demo | 0ba08146fee2904bd2151fcea8041f03b8b86e71 | [
"Apache-2.0"
] | null | null | null | //: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
extension UIColor {
convenience init(AHEX string: String) {
var hex = string.hasPrefix("#")
? String(string.dropFirst())
: string
guard hex.count == 8 || hex.count == 6
else {
self.init(... | 31.69697 | 109 | 0.611377 | 3.375 |
c3ace8ba54a76ce1d4317369067e467e8db166ed | 1,154 | go | Go | cmd/output.go | mickep76/grpc-exec-example | fd6794a634bdbb6b5f12e173017729bdeb3ba2b8 | [
"Apache-2.0"
] | 3 | 2018-07-07T16:52:43.000Z | 2018-10-15T14:00:00.000Z | cmd/output.go | mickep76/grpc-exec-example | fd6794a634bdbb6b5f12e173017729bdeb3ba2b8 | [
"Apache-2.0"
] | null | null | null | cmd/output.go | mickep76/grpc-exec-example | fd6794a634bdbb6b5f12e173017729bdeb3ba2b8 | [
"Apache-2.0"
] | null | null | null | package cmd
import (
"bufio"
"bytes"
"io"
"time"
)
type Reader struct {
reader io.Reader
BytesRead int
}
func newReader(r io.Reader) *Reader {
return &Reader{reader: r}
}
func (r *Reader) Read(p []byte) (n int, err error) {
n, err = r.reader.Read(p)
r.BytesRead += n
return n, err
}
type Message struct... | 16.724638 | 87 | 0.633449 | 3.078125 |
653275e0a6bf64ffd7bef701a34270c76bd37631 | 1,854 | py | Python | clisk/player/player.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | clisk/player/player.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | clisk/player/player.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | class Player(object):
"""Player class
Attributes:
name (str): Player name
"""
def __init__(self, name):
"""Initialize player
Args:
name (str): Player name
"""
self.name = name
def place_troops(self, board, n_troops):
"""Plac... | 26.112676 | 95 | 0.553937 | 3.375 |
43a5562a14702b4fc51c7509a5011fd3afd8d942 | 9,708 | go | Go | delivery/consumer_test.go | openrelayxyz/cardinal-streams | 74f712e2933ab8ce06f965ff1fafa4011a06b115 | [
"MIT"
] | 1 | 2022-02-21T12:23:20.000Z | 2022-02-21T12:23:20.000Z | delivery/consumer_test.go | openrelayxyz/cardinal-streams | 74f712e2933ab8ce06f965ff1fafa4011a06b115 | [
"MIT"
] | null | null | null | delivery/consumer_test.go | openrelayxyz/cardinal-streams | 74f712e2933ab8ce06f965ff1fafa4011a06b115 | [
"MIT"
] | 1 | 2022-03-28T20:50:54.000Z | 2022-03-28T20:50:54.000Z | package delivery
import (
"time"
"testing"
"math/big"
"math/rand"
"github.com/openrelayxyz/cardinal-types"
// "strings"
"regexp"
"runtime"
)
type testResumptionMessage struct{
Message
offset int64
source string
}
func (r *testResumptionMessage) Offset() int64 { return r.offset }
func (r *testRe... | 34.063158 | 154 | 0.607437 | 3 |
8eaac5799c4b40a970d0a2fa06742d97d7284f0e | 2,078 | rb | Ruby | lib/rmega/progress.rb | personal-social-media/rmega | 007041cb4d568f430cd8e385d86da1d20a86ac42 | [
"MIT"
] | 130 | 2015-01-28T22:32:43.000Z | 2022-03-26T17:40:32.000Z | lib/rmega/progress.rb | personal-social-media/rmega | 007041cb4d568f430cd8e385d86da1d20a86ac42 | [
"MIT"
] | 30 | 2015-07-06T14:02:36.000Z | 2022-01-18T07:29:51.000Z | lib/rmega/progress.rb | personal-social-media/rmega | 007041cb4d568f430cd8e385d86da1d20a86ac42 | [
"MIT"
] | 29 | 2015-02-15T09:56:57.000Z | 2022-03-13T22:03:26.000Z | module Rmega
class Progress
include Options
def initialize(total, options = {})
@total = total
@caption = options[:caption]
@bytes = 0
@real_bytes = 0
@mutex = Mutex.new
@start_time = Time.now
if show? and options[:filename]
puts options[:filename]
end... | 21.873684 | 106 | 0.567372 | 3.25 |
f314715c9e3ac2b5283ead4b783012cbce9d8dd4 | 1,932 | kt | Kotlin | src/main/assembler/Parser.kt | Corithm/toy-computer | f682a1b5f0127c1f656bd22b7b49047f47570209 | [
"Apache-2.0"
] | null | null | null | src/main/assembler/Parser.kt | Corithm/toy-computer | f682a1b5f0127c1f656bd22b7b49047f47570209 | [
"Apache-2.0"
] | null | null | null | src/main/assembler/Parser.kt | Corithm/toy-computer | f682a1b5f0127c1f656bd22b7b49047f47570209 | [
"Apache-2.0"
] | null | null | null | package main.assembler
import java.io.BufferedReader
import java.io.FileReader
/**
* Parser implementation.
*
* p. 113 - 114
*/
class Parser(fileName: String)
{
private val reader: BufferedReader = BufferedReader(FileReader(fileName))
private var currentCommand: String? = null
val IGNORED: Int = 0
... | 23.851852 | 100 | 0.549172 | 3.234375 |
15c75b19508b0bf233e22734ecdab13f50ed18f0 | 2,683 | lua | Lua | Player.lua | Kraton9000/Ninja_Run | a745bbca0359f8325c5026d2babe55f640bd8a67 | [
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null | Player.lua | Kraton9000/Ninja_Run | a745bbca0359f8325c5026d2babe55f640bd8a67 | [
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null | Player.lua | Kraton9000/Ninja_Run | a745bbca0359f8325c5026d2babe55f640bd8a67 | [
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null | require "30log-global"
Player = class("Player")
function Player:init(character, stance, stanceLimit, x, y, spriteSpeed, spriteTimer)
self.character = character
self.stance = stance
self.stanceLimit = stanceLimit
self.stanceCount = 1
self.x = x
self.y = y
self.spriteSpeed = spriteSpeed
self.spriteTimer = sprit... | 35.773333 | 179 | 0.723444 | 3.28125 |
0cdb931bc3d4d0011e0c24642dc040bbe2b51af1 | 8,924 | py | Python | phigaro/cli/batch.py | bobeobibo/phigaro | 342a3454bb5324426b25feb4a4d1f640b58bf8f8 | [
"MIT"
] | 31 | 2019-03-06T14:33:37.000Z | 2022-03-08T07:16:07.000Z | phigaro/cli/batch.py | bobeobibo/phigaro | 342a3454bb5324426b25feb4a4d1f640b58bf8f8 | [
"MIT"
] | 27 | 2019-05-17T05:06:58.000Z | 2022-03-27T00:38:56.000Z | phigaro/cli/batch.py | bobeobibo/phigaro | 342a3454bb5324426b25feb4a4d1f640b58bf8f8 | [
"MIT"
] | 12 | 2017-08-23T12:48:38.000Z | 2021-06-24T00:57:22.000Z | from __future__ import absolute_import
import argparse
import logging
import multiprocessing
import os
import sys
import uuid
from os.path import join, exists
import yaml
from phigaro.context import Context
from phigaro.batch.runner import run_tasks_chain
from phigaro.batch.task.path import sample_name
from phigaro.... | 33.174721 | 296 | 0.61766 | 3.15625 |
0bbd15397e2bf4ae4b6fd74045457ace7aa1b36b | 1,538 | js | JavaScript | components/content.js | isabella232/minidocs | 17b8b2527ad2e63f515e23101ed45325605f9d54 | [
"MIT"
] | 153 | 2016-03-27T07:56:56.000Z | 2022-03-12T23:33:14.000Z | components/content.js | freeman-lab/documentation-time | 44a9929c27595a6bea83dddec6f2ca45287bac70 | [
"MIT"
] | 67 | 2016-03-29T01:03:07.000Z | 2017-07-23T23:06:34.000Z | components/content.js | freeman-lab/documentation-time | 44a9929c27595a6bea83dddec6f2ca45287bac70 | [
"MIT"
] | 23 | 2016-03-27T17:43:20.000Z | 2018-11-30T14:06:17.000Z | var html = require('choo/html')
var css = require('sheetify')
var avatar = require('github-avatar-url')
module.exports = function (state, prev, send) {
var currentPage = state.params.page || state.current
var page = state.html[currentPage]
var pageData = state.contents.filter(function (item) {
return item.ke... | 27.963636 | 103 | 0.60013 | 3.03125 |
93e7bde25b19b5c699d99e5b1d8d5281dccfd8f9 | 2,645 | sql | SQL | source/setup/install-get-instance-info.sql | rentadba/dbaTDPMon | 278b43db2f01c5b0fb2db4dbff8e0c49fb3471b2 | [
"MIT"
] | 31 | 2017-04-06T18:12:10.000Z | 2022-02-28T11:08:41.000Z | source/setup/install-get-instance-info.sql | rentadba/dbaTDPMon | 278b43db2f01c5b0fb2db4dbff8e0c49fb3471b2 | [
"MIT"
] | 1 | 2020-04-27T04:39:27.000Z | 2020-06-19T11:34:51.000Z | source/setup/install-get-instance-info.sql | rentadba/dbaTDPMon | 278b43db2f01c5b0fb2db4dbff8e0c49fb3471b2 | [
"MIT"
] | 10 | 2017-09-25T11:32:57.000Z | 2021-09-10T11:11:50.000Z | -- ============================================================================
-- Copyright (c) 2004-2017 Dan Andrei STEFAN (danandrei.stefan@gmail.com)
-- ============================================================================
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
DECLARE @dataFilePath [nvarchar](260... | 36.232877 | 207 | 0.623062 | 3.28125 |
e8ff9e109d1e3411f4ef5d970014c1908546fefe | 6,168 | py | Python | support/update_dht_servers.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | support/update_dht_servers.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | support/update_dht_servers.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import argparse
import Libraries.arguments as ar
import Libraries.tools.general as gt
import Libraries.tools.zabbix as zt
import Classes.AppConfig as AppConfig
import requests
import copy
def r... | 35.245714 | 148 | 0.50989 | 3.03125 |
5fdc0fbffb5e43fca9e409204dc1c6d3691508eb | 1,978 | h | C | frees/search.h | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 24 | 2017-08-01T16:13:28.000Z | 2021-08-29T13:13:29.000Z | frees/search.h | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 10 | 2017-07-13T17:31:21.000Z | 2021-06-18T21:32:15.000Z | frees/search.h | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 26 | 2017-09-17T00:29:31.000Z | 2022-03-17T04:25:54.000Z |
template< typename Real, typename F >
Real fminsum ( Real *x, Real *f, const int n, F &func )
{
Real sum=0;
func(x, f, n);
for (int i=0;i<n;i++)
sum += f[i]*f[i];
return 0.5*sum;
}
template< typename Real, typename F >
bool search( Real *xold, const Real fold, Real *g, Real *p,
Real *x, Real &f, const Real ... | 18.660377 | 73 | 0.545501 | 3.40625 |
9bcbc2d477d9df313e29b83b597bdeb68ddfb426 | 3,786 | js | JavaScript | examples/plain-js/index.js | RoamDirectories/ioffice-floor-viewer-sdk | f3af7696dec986d3d3c9f2c9401093dfaee0c02d | [
"MIT"
] | null | null | null | examples/plain-js/index.js | RoamDirectories/ioffice-floor-viewer-sdk | f3af7696dec986d3d3c9f2c9401093dfaee0c02d | [
"MIT"
] | null | null | null | examples/plain-js/index.js | RoamDirectories/ioffice-floor-viewer-sdk | f3af7696dec986d3d3c9f2c9401093dfaee0c02d | [
"MIT"
] | null | null | null | // Utility objects to interact with the DOM
var ping = {};
var select = {};
var setMarkers = {};
/**
* Return an object containing the query parameters.
*/
function getQueryParams() {
var url = window.location.href;
var query = {};
var params = url.substr(url.lastIndexOf('?') + 1).split('&');
params.forEach(... | 24.584416 | 97 | 0.60803 | 3.296875 |
7c6f46a5743f6c94a9b6c85c98d454bc3531498b | 11,392 | rs | Rust | src/input/tests.rs | iandwelker/minus | f0498f63598599c270b2340864fb8324ea6ec719 | [
"Apache-2.0",
"MIT"
] | 179 | 2020-11-27T17:49:59.000Z | 2022-03-28T05:33:25.000Z | src/input/tests.rs | iandwelker/minus | f0498f63598599c270b2340864fb8324ea6ec719 | [
"Apache-2.0",
"MIT"
] | 54 | 2020-12-03T20:02:09.000Z | 2022-03-31T10:37:51.000Z | src/input/tests.rs | iandwelker/minus | f0498f63598599c270b2340864fb8324ea6ec719 | [
"Apache-2.0",
"MIT"
] | 14 | 2020-12-04T13:30:21.000Z | 2022-03-31T09:59:25.000Z | #[cfg(feature = "search")]
use crate::SearchMode;
use crate::{input::InputEvent, LineNumbers, Pager};
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseEvent, MouseEventKind};
// Just a transparent function to fix incompatiblity issues between
// versions
// TODO: Remove this later in favour of how h... | 26.931442 | 91 | 0.509831 | 3.203125 |
9c383efbdd1fb5892c9f9ac60d7dbbe07b5b6dff | 10,009 | js | JavaScript | api/team.js | HackSC/apply-2020 | a240dfd0599dc0b66ba3a77ed4dde806fb6fe009 | [
"MIT"
] | 8 | 2019-09-25T16:20:03.000Z | 2021-02-20T08:53:11.000Z | api/team.js | HackSC/apply-2020 | a240dfd0599dc0b66ba3a77ed4dde806fb6fe009 | [
"MIT"
] | 321 | 2019-09-26T19:07:59.000Z | 2022-02-17T20:47:45.000Z | api/team.js | HackSC/apply-2020 | a240dfd0599dc0b66ba3a77ed4dde806fb6fe009 | [
"MIT"
] | 2 | 2019-09-25T23:27:26.000Z | 2020-02-04T19:59:18.000Z | const express = require("express");
const models = require("./models");
const utils = require("./utils");
const router = express.Router();
router.use(utils.authMiddleware);
router.use(utils.preprocessRequest);
// GET /api/team
// - If a hacker is on a team, get that team info
router.get("/", async (req, res) => {
c... | 25.0225 | 79 | 0.613648 | 3.140625 |
eebf30247aff0a5af676c97ce77741c02458cf70 | 1,055 | swift | Swift | Source/Definitions/RuleInfo.swift | tylerlong/ringcentral-swift-client-back | 39efd3c4989c560ff35a4d126bc81ef767f2d232 | [
"MIT"
] | 1 | 2017-08-23T23:20:29.000Z | 2017-08-23T23:20:29.000Z | Source/Definitions/RuleInfo.swift | tylerlong/ringcentral-swift-client-back | 39efd3c4989c560ff35a4d126bc81ef767f2d232 | [
"MIT"
] | null | null | null | Source/Definitions/RuleInfo.swift | tylerlong/ringcentral-swift-client-back | 39efd3c4989c560ff35a4d126bc81ef767f2d232 | [
"MIT"
] | null | null | null | import Foundation
import ObjectMapper
import Alamofire
open class RuleInfo: Mappable {
// Forwarding number (or group) ordinal
open var `index`: Int?
// Number of rings for a forwarding number (or group)
open var `ringCount`: Int?
// Forwarding number (or group) data
open var `forwardingNumbers`... | 32.96875 | 130 | 0.637915 | 3.03125 |
0c90583bb1e8038246e08d81681f08ae3de8075d | 3,738 | py | Python | tests/test_remove.py | sanjaymsh/Fiona | 7be39538f7317efec3e60b8dc722af7e8fea6d52 | [
"BSD-3-Clause"
] | 1 | 2020-03-06T21:13:54.000Z | 2020-03-06T21:13:54.000Z | tests/test_remove.py | sanjaymsh/Fiona | 7be39538f7317efec3e60b8dc722af7e8fea6d52 | [
"BSD-3-Clause"
] | null | null | null | tests/test_remove.py | sanjaymsh/Fiona | 7be39538f7317efec3e60b8dc722af7e8fea6d52 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T05:38:58.000Z | 2021-04-12T05:38:58.000Z | import logging
import sys
import os
import itertools
from .conftest import requires_gpkg
import pytest
import fiona
from fiona.errors import DatasetDeleteError
def create_sample_data(filename, driver, **extra_meta):
meta = {
'driver': driver,
'schema': {
'geometry': 'Point',
... | 31.677966 | 81 | 0.677368 | 3.109375 |
c527ea84b5a4b47622dc40d44bd32c77b01e9b4f | 3,887 | sql | SQL | mySQL_test.sql | sadafmehds/mySQL_test | 84e02cb07d80d6fad4c9dac28cd2ca0c2befc41c | [
"MIT"
] | null | null | null | mySQL_test.sql | sadafmehds/mySQL_test | 84e02cb07d80d6fad4c9dac28cd2ca0c2befc41c | [
"MIT"
] | null | null | null | mySQL_test.sql | sadafmehds/mySQL_test | 84e02cb07d80d6fad4c9dac28cd2ca0c2befc41c | [
"MIT"
] | null | null | null | USE sakila;
-- 1a). Display first names and last names from table actor
SELECT first_name, last_name
FROM actor;
-- 1b).
SELECT CONCAT(first_name, ' ', last_name) AS 'Actor Name' FROM actor;
-- Practice: Testing going to lower case from upper case
SET SQL_SAFE_UPDATES=0;
UPDATE actor
SET first_name = LOWER(first_n... | 28.792593 | 717 | 0.752508 | 3.09375 |
618a0366f180ec51c4a6cb43f27cc9a4911e8436 | 854 | sql | SQL | Database Basics/MSSQL Server Exam - 22 October 2017/MSSQL Server Exam - 22 October 2017/18. Assign Employee .sql | stoyanovmiroslav/CSharp-DB-Fundamentals-SoftUni | d764eead3f40c608d4caf55d5f9d3d96cbeccf93 | [
"MIT"
] | 2 | 2019-03-03T08:33:14.000Z | 2019-03-13T07:38:38.000Z | Database Basics/MSSQL Server Exam - 22 October 2017/MSSQL Server Exam - 22 October 2017/18. Assign Employee .sql | stoyanovmiroslav/CSharp-DB-Fundamentals-SoftUni | d764eead3f40c608d4caf55d5f9d3d96cbeccf93 | [
"MIT"
] | null | null | null | Database Basics/MSSQL Server Exam - 22 October 2017/MSSQL Server Exam - 22 October 2017/18. Assign Employee .sql | stoyanovmiroslav/CSharp-DB-Fundamentals-SoftUni | d764eead3f40c608d4caf55d5f9d3d96cbeccf93 | [
"MIT"
] | 2 | 2019-02-06T10:12:00.000Z | 2019-02-06T10:30:14.000Z | CREATE PROC usp_AssignEmployeeToReport(@employeeId INT, @reportId INT)
AS
BEGIN TRAN
UPDATE Reports
SET EmployeeId = @employeeId
WHERE Id = @reportId
DECLARE @EmployeeDepartmentId INT = (SELECT e.DepartmentId
FROM Employees AS e
WHERE Id = @employ... | 31.62963 | 80 | 0.593677 | 3.015625 |
6db527cd014d265161e70cc8dcc13b7a2e6db1ac | 22,127 | lua | Lua | mg_villages/place_buildings.lua | maikerumine/mc2plus | 0d48f79d0cc3fca0be78c015e0d2b306dca16332 | [
"MIT"
] | 2 | 2017-08-07T09:51:48.000Z | 2019-10-26T18:53:18.000Z | mg_villages/place_buildings.lua | maikerumine/mc2plus | 0d48f79d0cc3fca0be78c015e0d2b306dca16332 | [
"MIT"
] | 3 | 2017-08-08T19:42:27.000Z | 2017-11-30T18:25:34.000Z | mg_villages/place_buildings.lua | maikerumine/mc2plus | 0d48f79d0cc3fca0be78c015e0d2b306dca16332 | [
"MIT"
] | null | null | null |
-- either uses get_node_or_nil(..) or the data from voxelmanip
-- the function might as well be local (only used by *.mg_drop_moresnow)
mg_villages.get_node_somehow = function( x, y, z, a, data, param2_data )
if( a and data and param2_data ) then
return { content = data[a:index(x, y, z)], param2 = param2_data[a:in... | 37.50339 | 233 | 0.66733 | 3 |
74227eda1614f2d5f3ab3b90f5f686b3003559e2 | 17,098 | rs | Rust | tests/unix_stream.rs | stevenroose/mio | ac0515cc9519f228d39bb0d9055955faf7f75f34 | [
"MIT"
] | null | null | null | tests/unix_stream.rs | stevenroose/mio | ac0515cc9519f228d39bb0d9055955faf7f75f34 | [
"MIT"
] | null | null | null | tests/unix_stream.rs | stevenroose/mio | ac0515cc9519f228d39bb0d9055955faf7f75f34 | [
"MIT"
] | null | null | null | #![cfg(unix)]
#[macro_use]
mod util;
use log::warn;
use mio::net::UnixStream;
use mio::{Interests, Token};
use std::io::{self, IoSlice, IoSliceMut, Read, Write};
use std::net::Shutdown;
use std::os::unix::net;
use std::path::Path;
use std::sync::mpsc::channel;
use std::sync::{Arc, Barrier};
use std::thread;
use std::t... | 30.261947 | 98 | 0.612352 | 3.03125 |
f03d4c226a3b3aa190f45b9620b4a20bd1deafdc | 2,296 | py | Python | isso/tests/test_html.py | Nildeala/isso | 661f2a68813e6ba5c234c9b84f440681712cdcef | [
"MIT"
] | 1 | 2017-08-24T21:10:01.000Z | 2017-08-24T21:10:01.000Z | isso/tests/test_html.py | Nildeala/isso | 661f2a68813e6ba5c234c9b84f440681712cdcef | [
"MIT"
] | null | null | null | isso/tests/test_html.py | Nildeala/isso | 661f2a68813e6ba5c234c9b84f440681712cdcef | [
"MIT"
] | null | null | null |
try:
import unittest2 as unittest
except ImportError:
import unittest
from isso.core import Config
from isso.utils import html
class TestHTML(unittest.TestCase):
def test_markdown(self):
convert = html.Markdown(extensions=())
examples = [
("*Ohai!*", "<p><em>Ohai!</em></p>"... | 37.639344 | 108 | 0.562718 | 3.09375 |
dd3594ddcffff304ad5bfce073709e244836ee0f | 1,591 | go | Go | codec/length_prefix.go | muirglacier/aw | 4245f85a37e6483f530da62354d27131d263334f | [
"MIT"
] | 36 | 2019-07-05T23:54:00.000Z | 2022-03-17T10:07:56.000Z | codec/length_prefix.go | muirglacier/aw | 4245f85a37e6483f530da62354d27131d263334f | [
"MIT"
] | 39 | 2019-07-29T07:15:06.000Z | 2021-08-03T05:02:13.000Z | codec/length_prefix.go | muirglacier/aw | 4245f85a37e6483f530da62354d27131d263334f | [
"MIT"
] | 8 | 2019-08-23T19:10:03.000Z | 2021-12-10T06:54:07.000Z | package codec
import (
"encoding/binary"
"fmt"
"io"
)
// LengthPrefixEncoder returns an Encoder that prefixes all data with a uint32
// length. The returned Encoder wraps two other Encoders, one that is used to
// encode the length prefix, and one that is used to encode the actual data.
func LengthPrefixEncoder(pr... | 32.469388 | 86 | 0.68259 | 3.234375 |
d942e7026d94c61f6fe7ac42764aeadfcf3bd1fe | 3,645 | rs | Rust | src/components/launcher.rs | ericrasmussen/quatronaut2020 | fecb38274526b0fe33c95e2701a5d8bd72b3bba8 | [
"MIT"
] | 1 | 2021-04-17T20:33:33.000Z | 2021-04-17T20:33:33.000Z | src/components/launcher.rs | ericrasmussen/benitron3000 | fecb38274526b0fe33c95e2701a5d8bd72b3bba8 | [
"MIT"
] | 52 | 2020-10-14T06:38:00.000Z | 2022-03-21T00:16:44.000Z | src/components/launcher.rs | ericrasmussen/benitron3000 | fecb38274526b0fe33c95e2701a5d8bd72b3bba8 | [
"MIT"
] | 1 | 2020-10-02T16:54:13.000Z | 2020-10-02T16:54:13.000Z | //! This component tracks when and how to fire projectiles,
//! along with logic to create different projectiles.
use amethyst::{
assets::PrefabData,
core::Transform,
derive::PrefabData,
ecs::prelude::{Component, DenseVecStorage, Entities, Entity, LazyUpdate, NullStorage, ReadExpect, WriteStorage},
... | 31.973684 | 116 | 0.687791 | 3.015625 |
ada541d03d501f3f49006046587dfaeaa1e3f73b | 7,100 | rs | Rust | task12_1/src/main.rs | HaronK/aoc2019 | 958c0a8fa125fbdc463115a78966fd31b3da7efb | [
"MIT"
] | 1 | 2019-12-12T13:11:51.000Z | 2019-12-12T13:11:51.000Z | task12_1/src/main.rs | HaronK/aoc2019 | 958c0a8fa125fbdc463115a78966fd31b3da7efb | [
"MIT"
] | null | null | null | task12_1/src/main.rs | HaronK/aoc2019 | 958c0a8fa125fbdc463115a78966fd31b3da7efb | [
"MIT"
] | null | null | null | use anyhow::Result;
use std::fmt;
use std::fs::File;
use std::io::prelude::*;
use std::ops::*;
// use termion;
fn main() -> Result<()> {
let mut content = String::new();
let mut file = File::open("input.txt")?;
file.read_to_string(&mut content)?;
let mut moons = parse(content)?;
let period = get_... | 23.58804 | 99 | 0.486901 | 3.328125 |
3fdd781f9e50b90b5ad1e5c8b4ac2e2d7bdb1c4c | 29,800 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.vclquake.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.vclquake.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.vclquake.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ; -----------------------------------------------------------------------------
; QUAKE.ASM
; Created with Nowhere Man's Virus Creation Laboratory v1.00
;
; Heavily modified VCL and Original Code by the best Bleeding Edge virus
; writer: Night Breeze. See you all in fuckin' HELL!
;
; This is a "spawning" virus and, te... | 41.678322 | 81 | 0.429228 | 3.046875 |
b1b339ac49e786ddbd73ce87153a846968bed309 | 2,925 | c | C | cli_main.c | DoubleDensity/Orca-c | 86dd6be4f4edc4fadf253eba3a7baded145cdef5 | [
"MIT"
] | null | null | null | cli_main.c | DoubleDensity/Orca-c | 86dd6be4f4edc4fadf253eba3a7baded145cdef5 | [
"MIT"
] | null | null | null | cli_main.c | DoubleDensity/Orca-c | 86dd6be4f4edc4fadf253eba3a7baded145cdef5 | [
"MIT"
] | null | null | null | #include "bank.h"
#include "base.h"
#include "field.h"
#include "mark.h"
#include "sim.h"
#include <getopt.h>
static void usage(void) {
// clang-format off
fprintf(stderr,
"Usage: cli [options] infile\n\n"
"Options:\n"
" -t <number> Number of timesteps to simulate.\n"
" ... | 25.434783 | 71 | 0.579487 | 3.1875 |
3d60ad7843a4d9704383b7fa3a512ba724484fbd | 8,189 | rs | Rust | services/sensor_tracker/src/predis.rs | Terkwood/prawnalith | fda255912eee8f7caff185b3507bdf052c9420d8 | [
"Apache-2.0",
"MIT"
] | 16 | 2018-11-06T09:31:55.000Z | 2021-07-01T15:14:41.000Z | services/sensor_tracker/src/predis.rs | Terkwood/prawnalith | fda255912eee8f7caff185b3507bdf052c9420d8 | [
"Apache-2.0",
"MIT"
] | 50 | 2018-10-05T12:55:50.000Z | 2020-05-23T15:15:37.000Z | services/sensor_tracker/src/predis.rs | Terkwood/prawnalith | fda255912eee8f7caff185b3507bdf052c9420d8 | [
"Apache-2.0",
"MIT"
] | null | null | null | use redis::Commands;
use super::model;
use redis_context::RedisContext;
use redis_delta::REvent;
use serde_json;
use std::time::SystemTime;
use uuid::Uuid;
/// Updates redis so that the individual measurement is applied to the correct tank.
/// Also records the measurement to a record associated with the sensor itsel... | 30.785714 | 98 | 0.571743 | 3.28125 |
f07f1c21b8f06d89cde1866e0e0a9e2404549ae4 | 10,586 | py | Python | src/python/vrprim/photosphere/conv.py | cmbruns/vr_samples | 8dee056766bccca1a602c6dd58fd0a641c5033a5 | [
"MIT"
] | 1 | 2017-01-29T21:15:23.000Z | 2017-01-29T21:15:23.000Z | src/python/vrprim/photosphere/conv.py | cmbruns/vr_samples | 8dee056766bccca1a602c6dd58fd0a641c5033a5 | [
"MIT"
] | 2 | 2017-01-29T20:34:39.000Z | 2017-01-29T23:26:05.000Z | src/python/vrprim/photosphere/conv.py | cmbruns/vr_samples | 8dee056766bccca1a602c6dd58fd0a641c5033a5 | [
"MIT"
] | null | null | null | """
Convert spherical panorama in equirectangular format into cubemap format
"""
from math import pi, log2
import numpy
from libtiff import TIFF
import png
import glfw
from OpenGL import GL
from OpenGL.GL import shaders
from OpenGL.GL.EXT.texture_filter_anisotropic import GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE... | 38.919118 | 129 | 0.53344 | 3.3125 |
c3d3439acf75a13b35d9c365a0760bf92cb5962d | 2,026 | rs | Rust | secp256kfun/src/libsecp_compat.rs | delta1/secp256kfun | 89c19f60a2ca33de967b1896f52282898d930be5 | [
"0BSD"
] | null | null | null | secp256kfun/src/libsecp_compat.rs | delta1/secp256kfun | 89c19f60a2ca33de967b1896f52282898d930be5 | [
"0BSD"
] | null | null | null | secp256kfun/src/libsecp_compat.rs | delta1/secp256kfun | 89c19f60a2ca33de967b1896f52282898d930be5 | [
"0BSD"
] | null | null | null | use crate::{
marker::*,
secp256k1::{PublicKey, SecretKey, XOnlyPublicKey},
Point, Scalar, XOnly,
};
impl From<Scalar> for SecretKey {
fn from(scalar: Scalar) -> Self {
SecretKey::from_slice(scalar.to_bytes().as_ref()).unwrap()
}
}
impl From<SecretKey> for Scalar {
fn from(sk: SecretKey... | 25.325 | 180 | 0.607601 | 3.109375 |
e7fca20cce05d1364eee53a17bec476012eb661d | 2,177 | py | Python | dropconnect/combine_pred_mod.py | zygmuntz/kaggle-cifar | 16936af9cf621d668c50491291e042a7849a1ac3 | [
"BSD-2-Clause"
] | 26 | 2015-01-12T18:00:50.000Z | 2020-12-19T23:49:16.000Z | dropconnect/combine_pred_mod.py | zygmuntz/kaggle-cifar | 16936af9cf621d668c50491291e042a7849a1ac3 | [
"BSD-2-Clause"
] | null | null | null | dropconnect/combine_pred_mod.py | zygmuntz/kaggle-cifar | 16936af9cf621d668c50491291e042a7849a1ac3 | [
"BSD-2-Clause"
] | 26 | 2015-01-10T22:35:01.000Z | 2020-01-15T08:56:53.000Z | #------------------------------------------
# this script combine result of different
# nets and report final result
#------------------------------------------
import sys
import numpy as np
from util import pickle, unpickle
def evaluate_result( result, text ):
# pre-condition check
num_batches = len( result[... | 30.661972 | 87 | 0.592559 | 3.546875 |
a1795f55a384b6138d1e30093e3e6ef7447da5f8 | 2,266 | go | Go | pkg/assert/assert.go | scottcagno/storage | e54fed254539aebc0588d0a736faa69dc1bfbf27 | [
"BSD-3-Clause"
] | 1 | 2021-12-11T22:32:06.000Z | 2021-12-11T22:32:06.000Z | pkg/assert/assert.go | scottcagno/storage | e54fed254539aebc0588d0a736faa69dc1bfbf27 | [
"BSD-3-Clause"
] | null | null | null | pkg/assert/assert.go | scottcagno/storage | e54fed254539aebc0588d0a736faa69dc1bfbf27 | [
"BSD-3-Clause"
] | null | null | null | package assert
import "log"
func AssertTrue(isTrue bool) {
if isTrue == true {
log.Printf("assert true: condition=%t", isTrue)
}
}
func AssertFalse(isFalse bool) {
if isFalse == false {
log.Printf("assert false: condition=%t", isFalse)
}
}
func AssertTrueMsg(isTrue bool, msg string) {
if isTrue == true {
... | 17.703125 | 51 | 0.641218 | 3.3125 |
0bf3bd3ec3ad4b49f3d757ffb24025804e0d9efa | 1,077 | js | JavaScript | src/logic.js | j2ieu/dollars-to-cents | 7d4a507034fc5e746a970464b4558e571339260a | [
"MIT"
] | null | null | null | src/logic.js | j2ieu/dollars-to-cents | 7d4a507034fc5e746a970464b4558e571339260a | [
"MIT"
] | null | null | null | src/logic.js | j2ieu/dollars-to-cents | 7d4a507034fc5e746a970464b4558e571339260a | [
"MIT"
] | null | null | null | const currencyInput = document.getElementById('money-input');
const pennyResult = document.getElementById('penny-result');
const nickelResult = document.getElementById('nickel-result');
const dimeResult = document.getElementById('dime-result');
const quarterResult = document.getElementById('quarter-result');
function... | 28.342105 | 64 | 0.655525 | 3.015625 |
358996e0c9c7881c6f8966b5ee533d9f4ebd63f1 | 2,994 | lua | Lua | laia/util/mem.lua | git22abhishek/Laia | 1a4afa40f08f91f33d0d47a1d89b106091ad076a | [
"MIT"
] | 137 | 2016-12-15T18:51:59.000Z | 2022-03-25T06:41:02.000Z | laia/util/mem.lua | git22abhishek/Laia | 1a4afa40f08f91f33d0d47a1d89b106091ad076a | [
"MIT"
] | 32 | 2016-12-15T18:50:54.000Z | 2022-03-23T17:13:27.000Z | laia/util/mem.lua | jpuigcerver/Laia | 1a4afa40f08f91f33d0d47a1d89b106091ad076a | [
"MIT"
] | 68 | 2016-12-17T01:27:44.000Z | 2022-03-23T08:44:35.000Z | laia = laia or {}
laia.mem = {}
local _cfg = {
monitor_interval = 0,
monitor_started = false
}
--[[
Function that returns the GPU memory used by the calling process.
First, it tries to use the nvidia-smi command to get the exact number of
memory used by the calling process.
If this information is not ava... | 32.901099 | 80 | 0.684035 | 3.15625 |
77926bf6de937e990e2e914e8c9eeb259d4f3175 | 3,830 | rs | Rust | pbrs/src/lib.rs | gaoqiangz/pbni-rs | 0809edd7fcc2d7263d21de9e1a05584c6e249e35 | [
"BSD-2-Clause"
] | 10 | 2021-06-08T01:15:12.000Z | 2022-02-22T09:58:27.000Z | pbrs/src/lib.rs | yishuixuanyuan/pbni-rs | 0809edd7fcc2d7263d21de9e1a05584c6e249e35 | [
"BSD-2-Clause"
] | 1 | 2021-06-09T07:31:04.000Z | 2021-06-10T12:15:16.000Z | pbrs/src/lib.rs | yishuixuanyuan/pbni-rs | 0809edd7fcc2d7263d21de9e1a05584c6e249e35 | [
"BSD-2-Clause"
] | 1 | 2022-02-22T09:57:53.000Z | 2022-02-22T09:57:53.000Z | use pbni::*;
struct RustObject {}
#[nonvisualobject(name = "n_cst_test")]
impl RustObject {
#[constructor]
fn new(session: Session, ctx: ContextObject) -> RustObject { RustObject {} }
#[method(name = "of_Array")]
fn of_array(&mut self, mut arg: Array) -> Result<String> {
arg.set_item_long(&[1... | 29.689922 | 98 | 0.563969 | 3.03125 |
6857ab4e23d3b4665d70f99a5ebeb7eb3c6e221f | 952 | lua | Lua | lua_controllers/table_controller.lua | EMerckx/argos3-experiments | f82e066df5ff1dde155f0b8f07a113ca64ed9425 | [
"MIT"
] | 1 | 2020-08-31T12:52:01.000Z | 2020-08-31T12:52:01.000Z | lua_controllers/table_controller.lua | EMerckx/argos3-experiments | f82e066df5ff1dde155f0b8f07a113ca64ed9425 | [
"MIT"
] | null | null | null | lua_controllers/table_controller.lua | EMerckx/argos3-experiments | f82e066df5ff1dde155f0b8f07a113ca64ed9425 | [
"MIT"
] | null | null | null | -----------------------------------------------------
-- @author Ewout Merckx - <ewoutmerckx.pro@gmail.com>
-----------------------------------------------------
-- global variables
-- initialization
function init()
-- init the index
index = 0
-- set the speed of the robot to zero
robot.wheels.set_v... | 19.833333 | 69 | 0.495798 | 3.328125 |
d126662eb2bc5a54fec4f91fb3246ad34de7bcea | 3,459 | rs | Rust | examples/CVE-2020-17087/cng/src/main.rs | cokesme/rewind | ff93325626a15d83bd1a3e5de22daf5e07a26663 | [
"Apache-2.0"
] | 198 | 2021-07-13T20:47:20.000Z | 2022-03-25T05:39:55.000Z | examples/CVE-2020-17087/cng/src/main.rs | cokesme/rewind | ff93325626a15d83bd1a3e5de22daf5e07a26663 | [
"Apache-2.0"
] | 7 | 2021-07-19T13:28:40.000Z | 2021-11-22T10:15:31.000Z | examples/CVE-2020-17087/cng/src/main.rs | cokesme/rewind | ff93325626a15d83bd1a3e5de22daf5e07a26663 | [
"Apache-2.0"
] | 19 | 2021-07-18T14:57:56.000Z | 2022-03-29T03:40:53.000Z |
use std::io::{self, Read};
use std::ffi::CString;
use std::ptr::null_mut;
use winapi::um::fileapi::{CreateFileA, OPEN_EXISTING};
use winapi::um::winnt::{GENERIC_READ, GENERIC_WRITE, HANDLE};
use winapi::um::ioapiset::DeviceIoControl;
use winapi::um::handleapi::{CloseHandle, INVALID_HANDLE_VALUE};
// use winapi::um::... | 23.530612 | 120 | 0.539751 | 3.03125 |
bd05ee50605573f5b44d7c3173638366e41c4c97 | 5,887 | rs | Rust | src/bin/day19.rs | pierd/advent-of-code-2018 | c2bef61e2809d5ce1e8ffa1246a9723e2b967861 | [
"MIT"
] | null | null | null | src/bin/day19.rs | pierd/advent-of-code-2018 | c2bef61e2809d5ce1e8ffa1246a9723e2b967861 | [
"MIT"
] | null | null | null | src/bin/day19.rs | pierd/advent-of-code-2018 | c2bef61e2809d5ce1e8ffa1246a9723e2b967861 | [
"MIT"
] | null | null | null | use std::str::FromStr;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
enum Arg {
Register,
Immediate,
}
impl Arg {
fn from_char(c: char) -> Option<Self> {
match c {
'r' => Some(Self::Register),
'i' => Some(Self::Immediate),
_ => None,
... | 29.732323 | 93 | 0.449465 | 3.25 |
cba8aa1f2023ccab6db26eed04efb0a4f1770e61 | 2,794 | go | Go | core/handler/device/store.go | Wcctnoam/dockerttn | 20ac410081e533cbbfe606b983cd303bfaed2bee | [
"MIT"
] | 1 | 2017-09-15T23:28:48.000Z | 2017-09-15T23:28:48.000Z | core/handler/device/store.go | SH-Paek/ttn | 3ec0bdc33316e6d383f699c884b1149326a608e7 | [
"MIT"
] | null | null | null | core/handler/device/store.go | SH-Paek/ttn | 3ec0bdc33316e6d383f699c884b1149326a608e7 | [
"MIT"
] | null | null | null | // Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package device
import (
"fmt"
"time"
"github.com/TheThingsNetwork/ttn/core/storage"
"github.com/TheThingsNetwork/ttn/utils/errors"
"gopkg.in/redis.v5"
)
// Store interface for... | 24.946429 | 96 | 0.682892 | 3.03125 |
f08d5fe0a3761d545d2f4c637b8ea051f71bf530 | 1,506 | js | JavaScript | lib/custom-commands/waitForClientConnected.js | atobatele/Nightwatch | b3e18debd6ed50d0a5410bec528508b5093a6662 | [
"MIT"
] | 12 | 2015-01-12T14:29:52.000Z | 2020-12-25T16:12:00.000Z | lib/custom-commands/waitForClientConnected.js | atobatele/Nightwatch | b3e18debd6ed50d0a5410bec528508b5093a6662 | [
"MIT"
] | 3 | 2015-01-27T00:20:43.000Z | 2018-07-31T02:10:45.000Z | lib/custom-commands/waitForClientConnected.js | atobatele/Nightwatch | b3e18debd6ed50d0a5410bec528508b5093a6662 | [
"MIT"
] | 11 | 2015-01-27T00:20:52.000Z | 2021-01-26T13:39:31.000Z | var util = require('util');
var events = require('events');
function WaitFor() {
events.EventEmitter.call(this);
this.startTime = null;
}
util.inherits(WaitFor, events.EventEmitter);
WaitFor.prototype.command = function (element, ms, msg) {
this.startTime = new Date().getTime();
var self = this;
var messag... | 25.1 | 100 | 0.62417 | 3.265625 |
b53a90f7211eb97269aee7a39d15e41a5c2cc47c | 964 | rs | Rust | src/selection_sorts/heapsort.rs | twirrim/rust-sort | 056226632b1a713212b90eeb8a251fa412b4b360 | [
"MIT"
] | null | null | null | src/selection_sorts/heapsort.rs | twirrim/rust-sort | 056226632b1a713212b90eeb8a251fa412b4b360 | [
"MIT"
] | null | null | null | src/selection_sorts/heapsort.rs | twirrim/rust-sort | 056226632b1a713212b90eeb8a251fa412b4b360 | [
"MIT"
] | null | null | null | #[cfg(test)]
mod tests {
use crate::heapsort;
#[test]
fn sort() {
let mut data = vec![5, 4, 3, 2, 1];
heapsort(&mut data);
assert_eq!(data, [1, 2, 3, 4, 5]);
}
}
fn _heapify<T: PartialOrd>(v: &mut [T], mut i: usize) {
let l = v.len();
loop {
let mut parent_idx =... | 22.418605 | 70 | 0.477178 | 3.28125 |
18b033c2844b16920f7a0e6cd308a8172fe20c37 | 1,425 | kt | Kotlin | remote/src/test/kotlin/com/androchef/remote/mappers/movies/MovieModelEntityMapperTest.kt | Abdul-Quadri-Ismail/Android-Clean-Architecture | 068912c99ad2cb890be37049f0f208457dbab63c | [
"MIT"
] | 227 | 2020-04-26T09:12:44.000Z | 2022-03-28T03:27:43.000Z | remote/src/test/kotlin/com/androchef/remote/mappers/movies/MovieModelEntityMapperTest.kt | Abdul-Quadri-Ismail/Android-Clean-Architecture | 068912c99ad2cb890be37049f0f208457dbab63c | [
"MIT"
] | 1 | 2021-01-09T13:39:38.000Z | 2021-01-09T19:36:09.000Z | remote/src/test/kotlin/com/androchef/remote/mappers/movies/MovieModelEntityMapperTest.kt | Abdul-Quadri-Ismail/Android-Clean-Architecture | 068912c99ad2cb890be37049f0f208457dbab63c | [
"MIT"
] | 49 | 2020-04-27T07:33:58.000Z | 2021-12-09T05:08:47.000Z | package com.androchef.remote.mappers.movies
import com.androchef.data.models.MovieEntity
import com.androchef.remote.factory.movies.RemoteMovieFactory
import com.androchef.remote.models.movies.MovieModel
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
... | 30.978261 | 92 | 0.750877 | 3 |
491f40bbe37c426879fd118c068500e34a39dd5f | 3,862 | lua | Lua | resources/[race]/race_progress/Settings.lua | AfuSensi/MTA-Resources | e4a0f3981ddc92c8f15c3d93140196c6a8589fa8 | [
"MIT",
"0BSD"
] | 18 | 2018-09-13T14:50:40.000Z | 2022-02-02T21:44:50.000Z | resources/[race]/race_progress/Settings.lua | AfuSensi/MTA-Resources | e4a0f3981ddc92c8f15c3d93140196c6a8589fa8 | [
"MIT",
"0BSD"
] | 151 | 2018-03-08T11:01:42.000Z | 2021-10-05T17:25:05.000Z | resources/[race]/race_progress/Settings.lua | AfuSensi/MTA-Resources | e4a0f3981ddc92c8f15c3d93140196c6a8589fa8 | [
"MIT",
"0BSD"
] | 111 | 2018-03-08T10:53:00.000Z | 2022-03-12T18:54:54.000Z | ---
-- Class to manage settings, which can be used in other scripts.
--
-- @author driver2
-- @copyright 2009 driver2
--
-- Changes:
-- 2010-01-30: Commented functions and cleaned up a bit
Settings = {}
---
-- Creates a new object with the default settings and
-- the filename.
--
-- @param table defaultSetting... | 29.480916 | 91 | 0.723977 | 3.34375 |
8d70932119fe049ad9138d4db885ecb9c268977c | 1,676 | lua | Lua | debugtool.lua | wcguo/xiuxian | 953cf54b3eea558ee7dee4ec6f161b9a66c137ac | [
"MIT"
] | 1 | 2022-02-23T18:00:08.000Z | 2022-02-23T18:00:08.000Z | debugtool.lua | wcguo/xiuxian | 953cf54b3eea558ee7dee4ec6f161b9a66c137ac | [
"MIT"
] | null | null | null | debugtool.lua | wcguo/xiuxian | 953cf54b3eea558ee7dee4ec6f161b9a66c137ac | [
"MIT"
] | 1 | 2022-03-08T17:23:06.000Z | 2022-03-08T17:23:06.000Z | local debug_util = {}
debug_util.debug_mode = true
debug_log = debug_util.debug_mode and log or function()
end
---- 序列化
--print( serpent.dump( aTable ) ) -- 完整序列化
--print( serpent.line( aTable ) ) -- 转换为 1 行 , 没有自引用
--print( serpent.block( aTable ) ) -- 转换为多行 , 没有自引用
function debug_util.info(obj)
if not debug_... | 23.942857 | 93 | 0.517303 | 3.1875 |
f7e9a9b08517c3b14fb2705c904f3abed9341ce4 | 931 | sql | SQL | backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/ddl/public/functions/getCostPrice.sql | dram/metasfresh | a1b881a5b7df8b108d4c4ac03082b72c323873eb | [
"RSA-MD"
] | 1,144 | 2016-02-14T10:29:35.000Z | 2022-03-30T09:50:41.000Z | backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/ddl/public/functions/getCostPrice.sql | vestigegroup/metasfresh | 4b2d48c091fb2a73e6f186260a06c715f5e2fe96 | [
"RSA-MD"
] | 8,283 | 2016-04-28T17:41:34.000Z | 2022-03-30T13:30:12.000Z | backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/ddl/public/functions/getCostPrice.sql | vestigegroup/metasfresh | 4b2d48c091fb2a73e6f186260a06c715f5e2fe96 | [
"RSA-MD"
] | 441 | 2016-04-29T08:06:07.000Z | 2022-03-28T06:09:56.000Z | -- DROP FUNCTION getCostPrice(numeric, numeric, numeric);
CREATE OR REPLACE FUNCTION getCostPrice
(
p_M_Product_ID numeric,
p_AD_Client_ID numeric,
p_AD_Org_ID numeric
)
RETURNS numeric
AS
$BODY$
SELECT COALESCE(sum(cost.CurrentCostPrice), 0)
FROM M_Cost cost
INNER JOIN C_AcctSchema acs on acs.C_AcctSchema_ID=... | 25.861111 | 117 | 0.787325 | 3.0625 |
652cc5a124cb82089fec9b806d9345c58673911c | 7,292 | rs | Rust | src/clash/progression/gambler.rs | chamons/ArenaGS | 0d3c8d4ebc818198b21a8c99dc853286cc16b7c2 | [
"MIT"
] | null | null | null | src/clash/progression/gambler.rs | chamons/ArenaGS | 0d3c8d4ebc818198b21a8c99dc853286cc16b7c2 | [
"MIT"
] | 126 | 2017-05-14T19:41:31.000Z | 2020-11-24T15:53:49.000Z | src/clash/progression/gambler.rs | chamons/ArenaGS | 0d3c8d4ebc818198b21a8c99dc853286cc16b7c2 | [
"MIT"
] | null | null | null | use std::cmp;
use std::collections::HashMap;
use rand::prelude::*;
use specs::prelude::*;
use super::super::*;
pub fn get_reward_request(ecs: &World, count: u32) -> Vec<(EquipmentRarity, u32)> {
let mut rng = ecs.write_resource::<RandomComponent>();
let choices = vec![EquipmentRarity::Common, EquipmentRarity... | 43.147929 | 149 | 0.629868 | 3.171875 |
040e190e0368ecd734725045a8016a6c9dab78fc | 2,581 | js | JavaScript | components/author/author.js | linmujing/lvyingWeChat | 2fc8632b5bcee5d21196eee8eec54b1f5defa790 | [
"Apache-2.0"
] | null | null | null | components/author/author.js | linmujing/lvyingWeChat | 2fc8632b5bcee5d21196eee8eec54b1f5defa790 | [
"Apache-2.0"
] | null | null | null | components/author/author.js | linmujing/lvyingWeChat | 2fc8632b5bcee5d21196eee8eec54b1f5defa790 | [
"Apache-2.0"
] | null | null | null | // components/mydist/author.js
var app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
// 组件显示
authorShow: true
},
ready(){
},
/**
* 组件的方法列表
*/
methods: {
// 获取用户信息
onGotUserInfo(res) {
console.log(res)
wx.... | 24.349057 | 88 | 0.444789 | 3.078125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.