Skip to content

Instantly share code, notes, and snippets.

View prophile's full-sized avatar

Alistair Lynn prophile

View GitHub Profile
#!/bin/bash
if [ -e $1 ]; then
rm -f $1
else
touch $1
fi
module std.kmp;
export kmp;
kmpl<a> :: Array<a> -> Array<a> -> Maybe<Int>;
kmp<a> :: Array<a>, Array<a> -> Maybe<Int>;
kmpAdvanceTable<a> :: Array<a> -> Array<Int>;
kmpl(pattern) {
@prophile
prophile / gist:887232
Created March 25, 2011 17:30
PonyLeaks reveals diplomatic cables
THINGS TO OCCUR
Thursday (small team of 2-3)
* If seating is out, retract seating
* Mark out layout in Cube & Bar 2
* DJ riser
* Power
* Network
* Verify facilities (projector etc)
module std;
export Maybe;
export Nothing;
export Just;
export force;
export isNothing;
Maybe<a> = variant Nothing, Just(a)
module std;
export Maybe;
export Nothing;
export Just;
export force;
export isNothing;
Maybe<a> = variant Nothing, Just(a)
module xtoa;
export xtoa;
export hexValue;
export decValue;
export binValue;
xtoa :: String, Int -> String;
hexValue :: Int -> String;
public boolean hassum(int target) {
return hassum_recursive(-1, 0, 0, target);
}
private boolean hassum_recursive(int hi, int lo, int sum, int target) {
if (sum == target) {
return true;
} else if (sum > target && lo < hi) {
return hassum_recursive(hi, lo + 1, sum - array[lo], target);
} else {
<?php
require_once("auth.php");
class NoCredentialsAuth extends AuthBackend
{
private $authed = false;
private $user;
private function __construct()
#!/bin/bash
# begin config section
SOURCE=src
BUILD=dist
MAINCLASS=CrosswordApp
UNCRUSTIFY=uncrustify.cfg
OWNPACKAGES="com.hovercatsw uk.ac.soton"
# end of config section
TARGET=$BUILD/$MAINCLASS.java
COMPLETE=`tempfile --prefix=flatten`
#!/bin/bash
MAINCLASS=FractalApp
find . -name '*.java' | xargs cat | grep "^import " | sort | uniq
find . -name '*.java' | grep -v $MAINCLASS | sort | xargs cat | grep -v "^import " | sed s/public\ class/class/g | sed s/public\ interface/interface/g | sed s/public\ abstract\ class/abstract\ class/g
find . -name $MAINCLASS.java | xargs cat | grep -v "^import "
SLASH="/"
STAR="*"
OPENCOMMENT=$SLASH$STAR
CLOSECOMMENT=$STAR$SLASH
echo ""