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, string | |
def vowels(str): | |
count = 0 | |
for let in str: | |
if let in list("AEIOUaeiou"): | |
count += 1 | |
return count | |
def vowelies(str): |
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
cons = (h, t) -> (m) -> m(h, t) | |
car = (x) -> x((h, t) -> h) | |
cdr = (x) -> if x then x((h, t) -> t) else null | |
map = (ls, f) -> | |
cons (f car ls), if cdr ls then map cdr(ls), f else null | |
foldl = (ls, f, n) -> | |
f (car ls), if cdr ls then foldl (cdr ls), f, n else n |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Caffeinate Me!</title> | |
<meta name="generator" content="TextMate http://macromates.com/"> | |
<meta name="author" content="Brendan Berg"> | |
<!-- Date: 2011-08-24 --> | |
<style> |
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
point = (x, y) -> | |
setX = (nx) -> x = nx | |
setY = (ny) -> y = ny | |
(n) -> n(x, y, setX, setY) | |
pointGetX = -> | |
(x, y) -> x | |
pointGetY = -> | |
(x, y) -> y |
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
public static void main(String ... args) { | |
System.out.println(randomString(-229985452)+' '+randomString(-147909649)); | |
} | |
public static String randomString(int seed) { | |
Random rand = new Random(seed); | |
StringBuilder sb = new StringBuilder(); | |
for(int i=0;;i++) { | |
int n = rand.nextInt(27); | |
if (n == 0) break; |
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
aqueous | |
banlieue | |
bioaeration | |
bioaeronautics | |
euouae | |
gooier | |
guaiac | |
guaiacol | |
guaiacum | |
homoiousian |
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
from time import time | |
def elapsed(fn): | |
t = time() | |
fn() | |
return time() - t | |
def insert_good(n): | |
for i in range(2 ** n): | |
d[i] = 0 |
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 | |
import json | |
def search_line(row): | |
string = ''.join(row) | |
if string.find('OOOO') != -1: | |
return 'O' | |
if string.find('XXXX') != -1: | |
return 'X' | |
else: |
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 | |
# Finding every single terrible password | |
# | |
# (Password requirements from http://kottke.org/12/06/the-worlds-worst-password-requirements-list) | |
# | |
# Must be exactly 8 characters long | |
# Must contain at least one character from each of these sets: | |
# ['@', '#', '$'], | |
# ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], |
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
/* | |
* Use this at http://pegjs.majda.cz/online | |
* | |
* Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo | |
* - becomes - | |
* Fishy fish fishy fish fish fish fishy fish | |
* | |
* Also, the grammar is recursive, so it could also generate ALL THE FISH. | |
*/ |
OlderNewer