This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package util | |
| import ( | |
| "time" | |
| ) | |
| <?php | |
| $className = "StringMap"; | |
| $arr = [ | |
| "Bool" => "bool", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * LDAP PHP Change Password Webpage | |
| * | |
| * Copyright (C) 2010 Matt Rude <http://mattrude.com> | |
| * Copyright (C) 2019 Jack Tang <[email protected]> | |
| * | |
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proc fletcher16*(arr: openArray[uint8]): uint16 = | |
| var | |
| c1: int = 0 | |
| c2: int = 0 | |
| for d in arr: | |
| c1 += d.int | |
| c2 += c1 | |
| result = (((c2 mod 255) shl 8) + (c1 mod 255)).uint16 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| you are a zoo keeper, You wanna keep animals to be healthy (not overweight) so you apply a diet plan. | |
| Problem: | |
| An animal has intial weight S at the start, For every day, you can choose to lose weight (a[i]) or have food (b[i]) or , but you have to make sure every day animal doesnt exceed T (target weight) | |
| for N days plan, how many possbile combinations can have | |
| condition | |
| ・1 ≦ N ≦ 35 | |
| ・1 ≦ Ai, Bi ≦ 1,000,000,000 (1 ≦ i ≦ N) | |
| ・(sum of A_i) < S ≦ T ≦ 1,000,000,000 | |
| sample in | |
| 2 10 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncdispatch | |
| import deques | |
| import options | |
| import httpclient | |
| import strformat | |
| export httpclient # for AsyncResponse | |
| #[ | |
| Wrapping AsyncHttpClient for pooling and timeout, also see |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def permutations(lis): | |
| N = len(lis) | |
| i = 0 | |
| c = [*range(0, max(2,N+1))] | |
| while True: | |
| yield lis | |
| i = 1 | |
| while c[i] == 0: | |
| c[i] = i | |
| i += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S deno run --allow-env --allow-ffi | |
| import { DB } from "https://deno.land/x/sqlite/mod.ts"; | |
| const schema = ` | |
| CREATE TABLE IF NOT EXISTS User ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| username TEXT | |
| ); | |
| CREATE TABLE IF NOT EXISTS Wallet ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://arxiv.org/abs/2503.16306 | |
| from collections import Counter, defaultdict | |
| from itertools import product, repeat | |
| from math import prod | |
| a = [1,1,4,4,5,6] | |
| b = [0,1,2,6,6,6] | |
| def p(n): | |
| # prob that P(sum_a < sum_b) > P(sum_a > sum_b) after n times |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* r2dec pseudo code output (r2 5.5.0) */ | |
| /* check-list @ 0x401000 */ | |
| #include <stdint.h> | |
| uint64_t entry0 (void) { | |
| int64_t var_400h; | |
| int64_t var_3ffh; | |
| int64_t var_3feh; | |
| int64_t var_3fdh; | |
| int64_t var_3fch; |
OlderNewer