Skip to content

Instantly share code, notes, and snippets.

View atomictom's full-sized avatar

Thomas Manning atomictom

  • Google
  • Dublin, Ireland
View GitHub Profile
import System.Environment
import Control.Applicative
import Data.Maybe
import Data.List
import Data.List.Split
import Data.Map.Strict ((!), Map, fromList)
type Class = String
type Mean = Double
type StdDevSquared = Double
import Control.Monad
import Control.Applicative
import Data.Monoid
import Data.Maybe
main :: IO()
main = do
putStr "results: \n"
putStr $ fizzbuzz5 20
@atomictom
atomictom / dfff
Last active August 29, 2015 14:06
#!/usr/bin/python
import os
import re
df_lines = list(os.popen("/bin/df -h"))
def report(place, line):
# Grab the fields from each line in the df command
fs, size, used, avail, percentage, mount = re.match("(\S+)\s+" * 6, line).groups()
import System.IO
import Data.List.Split
-- import Data.MemoCombinators
-- import Debug.Trace(trace)
import Data.Array
main :: IO()
main = do
contents <- readFile "matrix_big.txt"
let matrix = map (map readInt . splitOn ",") . lines $ contents
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define TRIE_INIT_SIZE 100
#define TRIE_ALPHABET_SIZE 26
#define FIRST_LETTER 'a'
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define TRIE_INIT_SIZE 100
#define TRIE_ALPHABET_SIZE 26
#define FIRST_LETTER 'a'
# relations.txt -- A way to specify playlist relationships
#
# Comments begin with the '#' character and are ignored
#
# Currently, there's only one type of relation in relations.txt:
#
# 1. Push relations, which are specified using '->' like this:
# pusher_playlist -> pushed_playlist
# And works by pushing changes additions in one playlist to another
#
#!/usr/bin/python
# TODO: Construct a topological ordering for the pushes so they happen
# correctly regardless of their order in the relations.txt file
import re
import sys
import os.path
from exeption import ValueError
function log(){
echo "$@" >> log
bash -c "$@"
}
CC=gcc
CFLAGS=-Wall -O3 -g
LDFLAGS=-pthread
COMPILEONLY=-c
SOURCES=queue.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=$(firstword $(SOURCES:.c=))
.PHONY: clean run
.SUFFIXES: