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
*.vim | |
*.agdai |
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 time import time, sleep | |
def runtime(f, retcont): | |
t = time() | |
r = f() | |
tt = time() | |
if retcont == []: | |
retcont.append(r) | |
elif retcont is not None: | |
assert(r == retcont[0]) |
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 collections import namedtuple | |
import re | |
# Literal patterns only match themselves, but quack like regular expressions | |
class LiteralPattern(str): | |
def match(self, other): | |
if other.startswith(self): | |
return LiteralMatch(str(self)) | |
return None |
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
CFLAGS = -std=c99 -Wall | |
main : main.o | |
.PHONY : test clean | |
test : main | |
./$^ "*regex*" "*vtable*" < main.c | |
clean : |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
void print_bin(uint32_t x) | |
{ | |
int i; | |
for (i = 31; i >= 0; --i) | |
putchar(x & (1 << i) ? '1' : '0'); | |
} |
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
arrowelim : {A B : Set} → (A → B) → A → B | |
arrowelim f a = f a | |
data _⊎_ (A B : Set) : Set where | |
inl : A → A ⊎ B | |
inr : B → A ⊎ B | |
disjintro₁ : {A : Set} → A → (X : Set) → A ⊎ X | |
disjintro₁ a X = inl a |
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
data ℕ : Set where | |
zero : ℕ | |
suc : (n : ℕ) → ℕ | |
{-# BUILTIN NATURAL ℕ #-} | |
infixl 6 _+_ | |
_+_ : (n m : ℕ) → ℕ | |
n + zero = n | |
n + suc m = suc (n + m) |
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
\documentclass[a4paper]{article} | |
\usepackage{bussproofs} | |
\usepackage{savetrees} | |
\usepackage{amsmath} | |
\newcommand{\using}[2]{\AxiomC{}\RightLabel{#1}\UnaryInfC{#2}} | |
\newcommand{\assume}[1]{\AxiomC{#1}} | |
\newcommand{\closed}[2]{\AxiomC{$\left[\text{#2}\right]^\text{#1}$}} |
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
.PHONY: default | |
default: spectrum.png | |
.PHONY: waves-video | |
waves-video: waves | |
./$< | mpv --no-correct-pts --fps=30 --scale=oversample - | |
.PHONY: test test-video | |
test: nz.png | |
sxiv $^ |
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
CC = gcc | |
CFLAGS = -O3 -std=c99 | |
.PHONY: test | |
test: life | |
./life < gosper.pbm | mpv --no-correct-pts --fps=20 --scale=oversample - | |
.PHONY: time | |
time: life-limited | |
time ./$< < pulsar.pbm > /dev/null |