This file contains 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
int main(void) { | |
} |
This file contains 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 <string.h> | |
enum { | |
NPREF = 2, /* Number of prefix words */ | |
NHASH = 4093, /* Size of hash table */ | |
MAXGEN = 10000 /* Maximum words generated */ | |
}; |
This file contains 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 <string.h> | |
enum { | |
NPREF = 2, /* Number of prefix words */ | |
NHASH = 4093, /* Size of hash table */ | |
MAXGEN = 10000 /* Maximum words generated */ | |
}; |
This file contains 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 sys | |
from random import choice | |
MAXWORDS = 10000 # Max words to output | |
NPREF = 2 # Number of prefix words | |
NONWORD = '\n' # Sentinel word | |
table = {} # {(p1,p2) : [s1, s2, s3]} | |
prefix = tuple([NONWORD for i in range(NPREF)]) | |
wordlist = sys.stdin.read().split() |
This file contains 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
; tee | |
; Returns non-zero exit code if an error occured | |
section .bss | |
buf: resb 1024 | |
buflen equ $-buf | |
stdin equ 0 | |
stdout equ 1 | |
O_WRONLY equ 1q | |
O_CREAT equ 100q |
This file contains 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
package main | |
import "fmt" | |
/* Graph representation */ | |
type Dag struct { | |
outgoing_edges map[int][]int | |
incoming_edges map[int][]int | |
} |
This file contains 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
/* | |
* Project Euler #13 | |
* Eugene Ma | |
* | |
* Real Answer: 5537376230 | |
*/ | |
#include <stdio.h> | |
#include <string.h> |
This file contains 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 copy | |
import re | |
class Board(object): | |
''' | |
tile | |
[a-z] placed tile | |
"_" normal empty square | |
[2-9] multiplier empty square | |
''' |
This file contains 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
;; zipper.scm | |
;; A binary tree zipper implementation in Scheme | |
;; Author: Eugene Ma (edma2) | |
(define (make-tree datum left right) | |
(list datum left right)) | |
(define datum car) | |
(define left-child cadr) | |
(define right-child caddr) | |
(define (make-leaf datum) |
This file contains 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 itertools | |
import sys | |
from bottle import route, run, redirect | |
ALPHANUM = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' | |
def usage(): | |
print 'usage: %s <hostname> <port>' | |
exit(-1) |
OlderNewer