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 ruby | |
DEBUG = false | |
start_line_index, end_line_index, filename = ARGV | |
start_line = start_line_index.to_i - 1 | |
end_line = end_line_index.to_i - 1 | |
source_lines = STDIN.readlines | |
lines_before = source_lines[0...start_line] |
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 debian:jessie | |
RUN echo "deb http://httpredir.debian.org/debian jessie-backports main" >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y build-essential python python-pip python-dev curl maven | |
RUN apt-get install -t jessie-backports -y ca-certificates-java openjdk-8-jre-headless openjdk-8-jdk-headless | |
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - | |
RUN apt-get install -y nodejs |
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 Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) | |
import System.Exit (ExitCode(..), exitWith) | |
import qualified LinkedList as L | |
exitProperly :: IO Counts -> IO () | |
exitProperly m = do | |
counts <- m | |
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess | |
testCase :: String -> Assertion -> Test |
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
(ns robot-sim.core) | |
;; robot = { :direction [0 1], :position [4, 5] } | |
(defn rotate-right [[x y]] | |
[y (- x)]) | |
(defn rotate-left [[x y]] | |
[(- y) x]) |
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
Homebrew build logs for nginx on Mac OS X 10.11.4 | |
Build date: 2016-04-07 14:18:17 |
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
;; Similar to https://clojuredocs.org/clojure.core/line-seq, | |
;; but is byte-oriented instead of line-oriented | |
(defn byte-seq [^java.io.BufferedReader rdr] | |
(lazy-seq | |
(let [ch (.read rdr)] | |
(if (= ch -1) | |
'() | |
(cons ch (byte-seq rdr)))))) |
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
class Bytes a where | |
toBytes :: a -> List UInt8 | |
width :: Int | |
addWithCarry :: a -> a -> (Tuple Boolean a) | |
default addWithCarry a b = case (addLists (toBytes a) (toBytes b)) of | |
(Cons 0 sum) -> (Tuple false a) | |
(Cons 1 sum) -> (Tuple true a) | |
otherwise -> error |
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
wget -r -l1 -H -t1 -nd -N -A.bz2 -erobots=off http://u-go.net/gamerecords/ | |
for f in *.tar.bz2; do tar xf $f; done |
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
OPENCLC=/System/Library/Frameworks/OpenCL.framework/Libraries/openclc | |
BUILD_DIR=./build | |
EXECUTABLE=main | |
.SUFFIXES: | |
KERNEL_ARCH=i386 x86_64 gpu_32 gpu_64 | |
BITCODES=$(patsubst %, mykernel.cl.%.bc, $(KERNEL_ARCH)) | |
$(EXECUTABLE): $(BUILD_DIR)/mykernel.cl.o $(BUILD_DIR)/main.o $(BITCODES) | |
clang -framework OpenCL -o $@ $(BUILD_DIR)/mykernel.cl.o $(BUILD_DIR)/main.o |
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
void printint(int); | |
int f() { | |
int n; | |
n = -2147483648; | |
printint(n); | |
return n; | |
} |
NewerOlder