Skip to content

Instantly share code, notes, and snippets.

View biomunky's full-sized avatar
💾
Have you tried turning it off and on again?

Dan Klose biomunky

💾
Have you tried turning it off and on again?
View GitHub Profile
@biomunky
biomunky / bog.clj
Created February 29, 2012 14:43
very hacky start to boggle
;;hacky start to boggle
(use '[clojure.java.io :only [reader]]
'[clojure.string :only [lower-case]])
;; -- THE TRIE
(defn add-to-trie [trie x]
(assoc-in trie x (merge (get-in trie x) {:val x :terminal true})))
(defn in-trie? [trie x]
@biomunky
biomunky / gist:2482807
Created April 24, 2012 19:11
MapOfTheWorld
PImage mapImage;
Table locationTable;
int rowCount;
Table dataTable;
float dataMin = MAX_FLOAT;
float dataMax = MIN_FLOAT;
void setup() {
size(640, 400);
@biomunky
biomunky / gist:2482816
Created April 24, 2012 19:12
MapOfTheWorldTable
PImage mapImage;
Table locationTable;
int rowCount;
Table dataTable;
float dataMin = MAX_FLOAT;
float dataMax = MIN_FLOAT;
void setup() {
size(640, 400);
@biomunky
biomunky / gist:2482827
Created April 24, 2012 19:13
locations.tsv
AL 439 270
AK 94 325
AZ 148 241
AR 368 247
CA 56 176
CO 220 183
CT 576 120
DE 556 166
FL 510 331
GA 478 267
@biomunky
biomunky / gist:2482834
Created April 24, 2012 19:14
MapRandom
AL 0.1
AK -5.3
AZ 3
AR 7
CA 11
CO 1.5
CT -6.7
DE -4
FL 9
GA 2
(defproject cascalog "1.10.2-SNAPSHOT"
:description "Hadoop without the Hassle."
:url "http://www.cascalog.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:mailing-list {:name "Cascalog user mailing list"
:archive "https://groups.google.com/d/forum/cascalog-user"
:post "cascalog-user@googlegroups.com"}
:dependencies [[cascalog/cascalog-core "1.10.2-SNAPSHOT"]
[cascalog/cascalog-checkpoint "1.10.2-SNAPSHOT"]
@biomunky
biomunky / clojure core async
Last active December 20, 2015 07:48
playing with core.async
(require '[clojure.core.async :as async :refer :all])
(let [n 100
cs (repeatedly n chan)
begin (System/currentTimeMillis)]
(doseq [[c i] (map list cs (range 0 n))] (go (>! c i)))
(dotimes [i n]
(let [[v c] (alts!! cs)]
(println v)))
(println "Read" n "msgs in" (- (System/currentTimeMillis) begin) "ms"))
@biomunky
biomunky / Goofing with Elixir
Last active December 21, 2015 05:08
Goofing with Elixir Lang
##
## Define an .ex file that is compiled with elixirc
##
defmodule Hack do
def reverse_list([h|t], acc // []) do
Hack.reverse_list(t, List.concat([h], acc))
end
def reverse_list([], acc) do
acc
(use 'clojure.test)
(use 'clojure.pprint)
(def roman-lookup {\I 1 \V 5 \X 10 \L 50 \C 100 \D 500 \M 1000})
(defn roman-helper [curnt nxt agg]
(if (> nxt curnt)
(+ agg (- curnt))
(+ agg curnt)))
### Keybase proof
I hereby claim:
* I am biomunky on github.
* I am biomunky (https://keybase.io/biomunky) on keybase.
* I have a public key whose fingerprint is 54A6 908F A1A0 82EA 8E44 DD4E 32BD 5173 5505 3A4C
To claim this, I am signing this object: