Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am bgruber on github.
* I am iheardata (https://keybase.io/iheardata) on keybase.
* I have a public key whose fingerprint is C912 3464 37C7 F48D E295 6B0F 8D5F F901 32E2 0303
To claim this, I am signing this object:
@bgruber
bgruber / gist:5960910
Last active December 19, 2015 13:19
k-means pixel guessing
(ns solution.core
(:require clojure-csv.core))
(defn read-csv [file]
(let [csvd (clojure-csv.core/parse-csv file)
parseint #(Integer/parseInt %)
intlines (map #(map parseint %) (next csvd))]
(map #(vector (first %) (rest %)) intlines)))
(def trainset (delay (read-csv (slurp "resources/digitssample.csv"))))
(defadvice archive-zip-extract
(around cygpathify (archive name) activate)
"Run the archive filename through cygpath before continuing."
(let ((archive (car (process-lines "cygpath" archive))))
ad-do-it))