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
""" | |
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 |
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
\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. |
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
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
[._]*.s[a-w][a-z] | |
[._]s[a-w][a-z] | |
*.un~ | |
Session.vim | |
.netrwhist | |
*~ |
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 | |
################################################################################ | |
*.sw[op] | |
################################################################################ | |
# C++ | |
################################################################################ | |
# Compiled Object files | |
*.slo |
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
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, |
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
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> { |