This file contains 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
I 4281 | |
IV 3311 | |
V 2250 | |
i 1289 | |
bVII 1207 | |
vi 944 | |
bVI 587 | |
ii 521 | |
bIII 343 | |
iv 211 |
This file contains 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
""" | |
For part 1 for counting solutions ≤ x, our DP state can be dp[n][f][d][le] = the count of digit-strings with | |
- n digits | |
- where the first digit is f | |
- and a double digit has appeared iff d = 1 | |
- that are less than equal to the last n digits of x iff le = 1. | |
""" | |
def part1_dp(x): # x should be list of digits |
This file contains 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
(() => {window.setInterval(() => { | |
document.querySelectorAll('.betaveros').forEach((node) => { | |
node.parentNode.removeChild(node); | |
}); | |
const makeNode = (t) => { | |
const span = document.createElement('span'); | |
span.className = 'betaveros'; | |
span.textContent = t; | |
return span; | |
}; |
This file contains 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 sys, os, subprocess | |
def check(msg): | |
if not input(msg + ' (y/n): ').lower().startswith('y'): | |
print('Aborting') | |
sys.exit() | |
subprocess.run('./config enable-fuzz-libfuzzer -DPEDANTIC enable-asan enable-ubsan no-shared -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=fuzzer-no-link enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment enable-tls1_3 enable-weak-ssl-ciphers enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method enable-nextprotoneg --debug'.split(), env={'CC': 'clang'}) | |
check('Does config look ok?') | |
with open('Makefile') as infile: |
This file contains 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
0000000100000f40 <__Z1av>: | |
100000f40: 55 push rbp | |
100000f41: 48 89 e5 mov rbp,rsp | |
100000f44: b8 03 00 00 00 mov eax,0x3 | |
100000f49: 5d pop rbp | |
100000f4a: c3 ret | |
100000f4b: 0f 1f 44 00 00 nop DWORD PTR [rax+rax*1+0x0] | |
0000000100000f50 <_main>: | |
100000f50: 55 push rbp |
This file contains 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 Control.Monad | |
import Data.List | |
-- Haskell comments look like this, lines that start with two hyphens. | |
{- You can also write range comments like this. -} | |
-- We did not write the type annotations (lines with ::) during class, and in | |
-- fact if you delete them Haskell will supply (more general) type signatures. | |
-- You can see what type Haskell thinks the things we've defined are by running |
This file contains 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
b8 01 00 00 00 mov eax,0x1 | |
b8 37 13 00 00 mov eax,0x1337 | |
b9 01 00 00 00 mov ecx,0x1 | |
b9 37 13 00 00 mov ecx,0x1337 | |
48 c7 c0 01 00 00 00 mov rax,0x1 | |
48 c7 c0 37 13 00 00 mov rax,0x1337 | |
48 c7 c1 01 00 00 00 mov rcx,0x1 | |
48 c7 c1 37 13 00 00 mov rcx,0x1337 | |
49 c7 c0 01 00 00 00 mov r8,0x1 | |
49 c7 c0 37 13 00 00 mov r8,0x1337 |
This file contains 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Change fn+- to (minus sign)</name> | |
<appendix>You need to enable Unicode Hex Input and U.S. input sources.</appendix> | |
<identifier>private.fn_minus</identifier> | |
<autogen>__KeyToKey__ | |
KeyCode::MINUS, ModifierFlag::FN, | |
<!-- change input source to Unicode --> |
This file contains 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
from __future__ import division, print_function | |
def partial_differences(xs): | |
return [x2 - x1 for (x1, x2) in zip(xs, xs[1:])] | |
def index_of_max(xs): | |
return max(enumerate(xs), key=lambda pair: pair[1])[0] | |
# given a list of floats, compute a tempo and a timestamp | |
def tempo(xs, max_beats): |
This file contains 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 Control.Monad | |
import Data.List | |
-- Haskell comments look like this, lines that start with two hyphens. | |
{- You can also write range comments like this. -} | |
-- We did not write the type annotations (lines with ::) during class, and in | |
-- fact if you delete them Haskell will supply (more general) type signatures. | |
-- You can see what type Haskell thinks the things we've defined are by running |