Paul Bauer pmbauer

View metrics
1 2 3 4 5 6 7 8 9 10
amd64 Linux 3.2.0-52-generic, 6 cores
Java HotSpot(TM) 64-Bit Server VM 23.21-b01
 
*** Single UseConcMarkSweepGC ***
Runtime arguments: -XX:-UseConcMarkSweepGC
Evaluation count : 300 in 60 samples of 5 calls.
Execution time sample mean : 207.175228 ms
Execution time mean : 207.185921 ms
Execution time sample std-deviation : 1.012513 ms
Execution time std-deviation : 1.022277 ms
View async_thread_ring.clj
1 2 3 4 5 6 7 8 9 10
(require '[clojure.core.async :refer [chan go <! <!! >! >!!]])
 
(defn thread-ring [size n]
{:pre [(> size 1)]}
(let [result (chan 1)
[head :as ring] (vec (repeatedly size #(chan 1)))]
(dotimes [i size]
(let [id (inc i)
in (ring i)
out (ring (mod id size))]
View raw-threadring.clj
1 2 3 4 5 6 7 8 9 10
;; based on my code from test.benchmark
(ns raw-threadring
(:import [java.util.concurrent Exchanger]))
 
 
(def ^Exchanger output-pipe (Exchanger.))
 
(defn relay [state msg]
(if (> msg 0)
(send (:next state) relay (dec msg))
View install_python.sh
1 2 3 4 5 6 7 8 9 10
# wget -O https://gist.github.com/pmbauer/5166100/raw/c72b880ba82dfd598c3cf27a3045833cadec32e2/install_python.sh
# chmod +x install_python.sh
# ./install_python.sh
#!/bin/sh
 
pushd /usr/local/src
 
echo " - Install compilers"
yum -y install gcc gdbm-devel readline-devel ncurses-devel zlib-devel bzip2-devel sqlite-devel db4-devel openssl-devel tk-devel bluez-libs-devel make
View gist:4519983
1 2 3 4 5
(get-in {:k :v} [:k]) ;; => :v
(update-in {:k :v} [:k] (constantly :x)) ;; => {:k :x}
 
(get-in {:k :v} []) ;; => {:k :v}
(update-in {:k :v} [] (constantly {:k :x})) ;; => {nil {:k :x}, :k :v}
View recommended_channel_remover.js
1 2 3 4 5 6 7 8
View y.clj
1 2 3 4 5 6 7 8 9 10
;; Y-combinator
(defn Y [f] ((fn [x] (f (fn [y] ((x x) y))))
(fn [x] (f (fn [y] ((x x) y))))))
 
 
;; Y-combinator memoized
(defn Y [f]
(let [c (atom {})
fp-gen (fn [x] (f (fn [y]
(or (@c y)
View mahout.clj
1 2 3 4 5 6 7 8 9 10
;; :dependencies [[org.apache.mahout/mahout-core "0.5"]]
;; :dev-dependencies [[slamhound "1.2.0"]]
(ns mia.mahout
(:import
(java.io File)
(org.apache.mahout.cf.taste.eval RecommenderBuilder)
(org.apache.mahout.cf.taste.impl.eval
AverageAbsoluteDifferenceRecommenderEvaluator
GenericRecommenderIRStatsEvaluator)
(org.apache.mahout.cf.taste.impl.model.file FileDataModel)
View 20p_languages_panel.txt
1 2 3 4 5 6 7 8 9 10
Programming Languages Panel
September 20, 2011
StrangeLoop
St. Louis, Missouri
 
Members:
Dean Wampler: Moderator
Rich Hickey: Clojure
Jeremy Ashkenas: CoffeeScript, NY Times
Dr. Gerald Sussman: MIT Prof, SICP
View quine_gawk.awk
1
BEGIN{S="BEGIN{S=\"%s\";s=S;gsub(/\\\\/,\"\\\\\\\\\",s);gsub(/\\\"/,\"\\\\\\\"\",s);printf(S,s)}";s=S;gsub(/\\/,"\\\\",s);gsub(/\"/,"\\\"",s);printf(S,s)}
Something went wrong with that request. Please try again.