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 time | |
class Node(object): | |
def __init__(self, name, weight, children): | |
self.name = name | |
self.weight = weight | |
self.children = children | |
def __str__(self): | |
return self.name + " " + str(self.children) |
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
class Node(object): | |
def __init__(self, name, weight, children): | |
self.name = name | |
self.weight = weight | |
self.children = children | |
def parse(content): | |
queue = {} | |
for l in content.split('\n'): | |
if l.strip() != '': |
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
bank = [5,1,10,0,1,7,13,14,3,12,8,10,7,12,0,6] | |
seenCombos = [] | |
seen = False | |
cycles = 0 | |
while not seen: | |
seenCombos.append(bank.copy()) | |
maxindex = bank.index(max(bank)) | |
b = bank[maxindex] |
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
def parse(s): | |
n = [] | |
for l in s.split('\n'): | |
if l != '': | |
n.append(int(l)) | |
return n | |
with open('d5in.txt') as f: | |
nums = parse(f.read()) | |
pos = 0 |
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
Section "Monitor" | |
Identifier "HDMI" | |
EndSection | |
Section "Monitor" | |
Identifier "DVI" | |
Option "RightOf" "HDMI" | |
EndSection |
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
section .text | |
global _start | |
_start: | |
mov eax,1 | |
int 80h |
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
Linking hello ... | |
/usr/bin/ld: cannot find -lHSbase-4.9.1.0 | |
/usr/bin/ld: cannot find -lHSinteger-gmp-1.0.0.1 | |
/usr/bin/ld: cannot find -lHSghc-prim-0.5.0.0 | |
/usr/bin/ld: cannot find -lHSrts | |
collect2: error: ld returned 1 exit status | |
`gcc' failed in phase `Linker'. (Exit code: 1) |
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 $ from 'jquery' | |
let keys = {} | |
$(document).keydown((e) => { | |
keys[e.key] = true | |
}) | |
$(document).keyup((e) => { | |
keys[e.key] = false |
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
L_nil = None | |
class LispType(object): | |
def get_val(self, env, vars={}): | |
return L_nil | |
class Lisp_Int(LispType): | |
def __init__(self, num): | |
self.val = num | |
def get_val(self, env, vars={}): |
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
! ############ | |
! # COLORS # | |
! ############ | |
! special | |
*.foreground: #d3d0c8 | |
*.background: #2d2d2d | |
*.cursorColor: #d3d0c8 | |
! black | |
*.color0: #2d2d2d |