Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@nebuta
nebuta / ast-no-gadt.hs
Created July 27, 2013 21:17
Haskell AST basic example
data Exp r = Const r | Add (Exp r) (Exp r) | Subtract (Exp r) (Exp r)
eval :: (Num r) => Exp r -> r
eval (Const v) = v
eval (Add e1 e2) = (eval e1) + (eval e2)
eval (Subtract e1 e2) = (eval e1) - (eval e2)
reify :: (Show r) => Exp r -> String
reify (Const v) = show v
reify (Add e1 e2) = concat ["(",reify e1,"+",reify e2,")"]
@stphung
stphung / friday.java
Created April 12, 2011 04:15
My solution to "Friday the Thirteenth" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: friday
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;