Skip to content

Instantly share code, notes, and snippets.

@cathcart
cathcart / weasel.clj
Created April 5, 2012 15:47 — forked from maxcountryman/weasel.clj
Weasel in Clojure
;; weasel
(def TARGET "ME THINKS IT IS LIKE A WEASEL")
(def ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ ")
(def RATE 0.05)
(def rand-seed
"Generate a random seed as long as the target."
(take (count TARGET) (repeatedly #(rand-nth ALPHABET))))
@cathcart
cathcart / Simplex.py
Created August 30, 2011 16:44 — forked from redacted/Simplex.py
Simplex algorithm in Python (c) 2001 Vivake Gupta, retrieved from archive.org
#!/usr/bin/env python
#
# Copyright (c) 2001 Vivake Gupta (vivakeATomniscia.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@cathcart
cathcart / makefile
Created May 5, 2011 17:28 — forked from redacted/makefile
One Make to rule them all...
# get platform
uname_ans=$(shell uname)
ifeq ($(uname_ans), Darwin)
# on a Mac, can use clang/llvm
# much better diagnostics, slightly slower code
cc=clang
else
# fall back to gcc
cc=gcc