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 python3 | |
import sys | |
import math | |
totalBytes = int(sys.argv[1]) | |
units = ["bytes", "kilobytes", "megabytes", "gigabytes", "terrabytes", "petabytes"] | |
unitIndex = int(math.log(totalBytes, 1024)) | |
bytesPerUnit = math.pow(1024, unitIndex) |
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 UI.HSCurses.Curses | |
main = do | |
scr <- initScr | |
wAddStr scr "Hello world" | |
k <- getch | |
endWin |
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
#!/bin/bash | |
set -e | |
f=$1 | |
rm -f $f.*.s | |
rm -f $f.*.ll | |
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
fun naiveIsPrime n = | |
let | |
fun helper n agg = | |
if agg = 1 then | |
true | |
else if n mod agg = 0 then | |
false | |
else | |
helper n (agg - 1) | |
in |
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
#!/bin/bash | |
old=old.out | |
new=new.out | |
echo "" > tmp | |
echo "" > out.csv |
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 bash | |
if [[ $1 = "-h" || $1 = "--help" || -z $1 ]] | |
then | |
cat <<EOD | |
rants -- angry pants | |
compile | |
rants c [project] | |
rants compile [project] |
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
z = raw_input() | |
z = reduce(lambda x,y:x+y,[ord(x) for x in z]) | |
print z%3 |
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
from itertools import permutations, combinations | |
chopsticks = ["ch", "op", "st", "icks"] | |
spoon = ["sp", "oon"] | |
fork = ["f", "ork"] | |
knife = ["k", "ni", "fe"] | |
"chopsticks" |