I hereby claim:
- I am mantree on github.
- I am tcoupland (https://keybase.io/tcoupland) on keybase.
- I have a public key ASDGaJd7dxtJb62pe1CwOnD7mQzfYyleZyZ9F3xE5mi9Rwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| (defn -bool? | |
| [x] | |
| (cond | |
| (boolean? x) x | |
| (string? x) (case x | |
| ("true" "TRUE" "t" "T") true | |
| ("false" "FALSE" "f" "F") false | |
| :clojure.spec/invalid) | |
| :else :clojure.spec/invalid)) |
| (defn one [& _] 1) | |
| (defparallelagg counter | |
| :init-var one | |
| :combine-var +) | |
| (defn mn | |
| [data] | |
| (<- [?mn] | |
| (data :> ?v) |
| (defn partition-or-time | |
| "Returns a channel that will either contain vectors of n items taken from ch or | |
| if beat-rate millis elapses then a vector with the available items. The | |
| final vector in the return channel may be smaller than n if ch closed before | |
| the vector could be completely filled." | |
| [n ch beat-rate buf-or-n] | |
| (let [out (chan buf-or-n)] | |
| (go (loop [arr (make-array Object n) | |
| idx 0 | |
| beat (timeout beat-rate)] |
| ;; Clojure 1.5.1 | |
| => 1 | |
| 1 | |
| => (require '[clojure.core.reducers :as r]) | |
| nil | |
| => (use 'clojure.repl) | |
| nil | |
| => (doc r/fold) | |
| ------------------------- | |
| clojure.core.reducers/fold |
| ;; tc | |
| (ns tron.bots | |
| (:require [tron.core :as tron])) | |
| ;;bot func: tc | |
| (defn empty-look | |
| "A mock look function which just checks for the arena | |
| boundaries." |
| (defn f [s p v] (filter #(s % p) v)) | |
| (defn s [w] | |
| (if-let [p (first w)] | |
| (if-let [v (rest w)] | |
| (concat (s (f < p v)) [p] (s (f >= p v))) | |
| p) | |
| () | |
| )) | |
| (ns dijkstra.core) | |
| (def edges {:A {:F 14 :C 9 :B 7} | |
| :B {:A 7 :C 10 :D 15} | |
| :C {:A 9 :B 10 :D 11 :F 2} | |
| :D {:B 15 :C 11 :E 6} | |
| :E {:D 6 :F 9} | |
| :F {:A 14 :C 2 :E 9}}) | |
| (def inf Integer/MAX_VALUE) |
| (defn logging [chain] (fn [req] | |
| (println "before") | |
| (try (chain req) (finally (println "after"))) | |
| )) |
| (defn logging [chain] (fn [req] | |
| (println "before") | |
| (chain req))) |