Skip to content

Instantly share code, notes, and snippets.

View mwhittaker's full-sized avatar

Michael Whittaker mwhittaker

View GitHub Profile
@mwhittaker
mwhittaker / generator.py
Created September 9, 2016 18:57
Generators as a Library
"""
A simple library level implementation of yielding generators using threads. Not
efficient, but it works!
"""
import threading
class BoundedConcurrentQueue(object):
def __init__(self, cap):
self.cap = cap
\section{Background}
Last semester, we designed and implemented Felix: a system which measures
network traffic using NetKAT. Felix's query language and query compilation
design were complete, and a paper on Felix was accepted to SOSR. However,
both Felix and the SOSR submission were imperfect. First, Felix's query
compiler was slow for large inputs and would often crash on \emph{very} large
inputs. Second, the Felix compiler was not integrated with Haoxian's runtime
which made it onerous to run Felix end-to-end. Finally, our SOSR submission was
written hurriedly and submitted last minute\footnote{literally!}, leaving the
paper a bit incohesive.
@mwhittaker
mwhittaker / README.md
Last active January 18, 2016 03:22
Installing OCaml on CSUG

This gist contains information on how to get opam and ocaml installed on CSUG. These installation instructions are a modified version of the official installation instructions.

cd $HOME
mkdir -p bin
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh
sh opam_installer.sh $HOME/bin
@mwhittaker
mwhittaker / .gitignore
Last active August 29, 2015 14:23
Graduate School
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
@mwhittaker
mwhittaker / .gitignore
Last active August 29, 2015 14:22
C++ Playground
################################################################################
# vim
################################################################################
*.sw[op]
################################################################################
# C++
################################################################################
# Compiled Object files
*.slo
@mwhittaker
mwhittaker / README.md
Last active August 29, 2015 14:19
Amazon Web Services

Amazon Web Services

Common Commands

  • Dry run launching an EC2 instance.

      aws ec2 run-instances  --dry-run  --image-id ami-d05e75b8
    
  • Launch an EC2 instance with all the fixins.

aws ec2 run-instances \

@mwhittaker
mwhittaker / tree.rs
Created April 19, 2015 02:48
Rust Tree Fold
use Tree::{Leaf, Node};
enum Tree<A> {
Leaf,
Node(Box<Tree<A>>, A, Box<Tree<A>>)
}
fn tree_fold<A, B, F>(f: &F, a: B, t: &Tree<A>) -> B where F: Fn(B, &A, B) -> B, B: Clone {
match *t {
Leaf => a,
@mwhittaker
mwhittaker / monad.rs
Created April 19, 2015 02:31
Rust Maybe Monad
use std::ops::Shr;
use Maybe::{Nothing, Just};
#[derive(Debug)]
enum Maybe<A> {
Nothing,
Just(A)
}
impl<A, B, F> Shr<F> for Maybe<A> where F: Fn(A) -> Maybe<B> {
@mwhittaker
mwhittaker / README.md
Last active March 14, 2020 18:12
Google Cloud Platform