I hereby claim:
- I am joelittlejohn on github.
- I am joelittlejohn (https://keybase.io/joelittlejohn) on keybase.
- I have a public key whose fingerprint is 1DA9 3EE1 7F6A 3324 18B0 DBB9 9ABE 584A 8CED 6563
To claim this, I am signing this object:
;; Building a functional queue using two stacks | |
;; We'll use vectors for our stacks, 'push' == conj | |
(def ^:private push conj) | |
;; We'll need be able to fill one stack from another | |
(defn ^:private refill | |
[s1 s2] | |
(if (empty? s1) | |
s2 |
I hereby claim:
To claim this, I am signing this object:
(ns brisfunctional-zipper.core) | |
(def sample | |
[:+ [:* 5 6] [:* 7 4] [:+ 1 2]]) | |
(defn loc [l r c p] | |
{:left l | |
:right r | |
:cur c | |
:path p}) |
(ns sokoban.core) | |
(comment #{:n :s :e :w}) | |
(def start-world | |
{:person [3 1] | |
:targets #{[1 3]} | |
:crates #{[1 2]} | |
:blanks #{[1 3] [2 3] [3 3] | |
[1 2] [3 2] |
;; joebot | |
(ns tron.bots | |
(:require [tron.core :as tron])) | |
(defn empty-look | |
"A mock look function which just checks for the arena | |
boundaries." | |
[pos] | |
(when-not (tron/valid-pos? pos) :wall)) |
(ns merge-ascii | |
(:require [clojure.java.io :refer [reader writer]])) | |
(defn choose-char [a b] | |
(cond (nil? a) b | |
(nil? b) a | |
(not= b \space) b | |
:else a)) | |
(defn merge [a b out] |
(let [digits (into [] (map char (concat (range 48 58) (range 65 91) (range 97 123)))) ;; 0-9,A-Z,a-z | |
base (biginteger (count digits)) | |
entropy 64] | |
(defn id [] | |
(loop [id10 (BigInteger. entropy (java.security.SecureRandom.)) | |
id62 ""] | |
(if (and (<= id10 (BigInteger/ZERO)) (seq id62)) | |
id62 | |
(let [[d r] (.divideAndRemainder id10 base)] | |
(recur d (str id62 (digits (.intValue r))))))))) |
echo "# Contributors" > CONTRIBUTORS.md && git log --pretty=tformat:"* %an <%ae>" | tac | awk ' !x[$0]++' >> CONTRIBUTORS.md |
<?php | |
$wgExtensionCredits['parserhook'][] = array( | |
'name' => 'WebServiceSequenceDiagram', | |
'version' => '1.0', | |
'author' => 'Eddie Olsson', | |
'url' => 'http://www.mediawiki.org/wiki/Extension:WebSequenceDiagram', | |
'description' => 'Render inline sequence diagrams using websequencediagrams.com' | |
); | |
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { |
(def t | |
"trie containing the 100,000 most common english words" | |
(with-open [r (clojure.java.io/reader "/tmp/words-100000")] | |
(reduce #(assoc-in %1 %2 (sorted-map \0 nil)) (sorted-map) (line-seq r)))) | |
(defn search [p m] | |
"return a sorted sequence of all words in the trie m that start with the given prefix p" | |
(let [n (get-in m p) | |
next (mapcat #(search (str p (key %)) m) (dissoc n \0))] | |
(if (contains? n \0) (cons p next) next))) |