This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Map<String, Sequence<String>> zipmap (Sequence<String> keys, Sequence<Sequence<String>> vals) { | |
return keys.zip(vals).fold(Maps.<String, Sequence<String>>map(), (Callable2<? super Map<String, Sequence<String>>, ? super Pair<String, Sequence<String>>, ? extends Map<String, Sequence<String>>>) Maps.asMap()); | |
} | |
private static Map<String, Sequence<String>> zipmapversion2 (Sequence<String> keys, Sequence<Sequence<String>> vals) { | |
Sequence<Pair<String,Sequence<String>>> keysAndVals = keys.zip(vals); | |
Map<String, Sequence<String>> map = Maps.map(); | |
return keysAndVals.fold(map,wtf()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fbcorelogic.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn validkeyo [key] | |
(conde | |
[(emptyo key)] | |
[(fresh [first-of-key rest-of-key] | |
(resto key rest-of-key) | |
(validkeyo rest-of-key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fn [sos] | |
(letfn [ | |
(combine [x y] | |
(let [diff [nil (.toUpperCase (str (clojure.set/difference x y)))] ] | |
(conj (clojure.set/intersection x y) diff))) | |
(remove-dontcares [minterms] (set (remove vector? minterms))) | |
(get-off-by-ones [all-minterms [current-key current-vals]] | |
(let [ | |
off-by-one | |
(map #(combine current-key %) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn which-am-i [unranked-value] | |
(let [all-the-things | |
(map #(vector (first %1) (distance-between (second %1) unranked-value)) all-the-averages) | |
top-two (take 2 (sort-by second all-the-things)) | |
difference-between-top-two (Math/abs (apply - (map second top-two))) | |
very-close (< difference-between-top-two 50) | |
best-one (if | |
very-close | |
(ffirst (shuffle top-two)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns maze.team5mark2) | |
(def next-directions | |
{ | |
:n [:w :n :e :s] | |
:w [:s :w :n :e] | |
:s [:e :s :w :n] | |
:e [:n :e :s :w] | |
} | |
) | |
(defn not-dead-end [direction [leng & side-passages]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns maze.team5) | |
(def next-directions | |
{ | |
:n [:w :n :e :s] | |
:w [:s :w :n :e] | |
:s [:e :s :w :n] | |
:e [:n :e :s :w] | |
} | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all_release_branch_names=($(git show-ref | grep 'release_' | cut -d' ' -f 2)) | |
for branch in $all_release_branch_names; do | |
commit_where_it_branched_from_master= $(git merge-base ${branch} master) | |
git show $commit_where_it_branched_from_master -s --pretty=format:"$commit_it_where_branched_from_master branched from master on %cd" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Download cloc, chmod it and have it on your path somewhere (as cloc) | |
2) get the scan-history script | |
curl https://raw.github.com/rhunter/git-scan-history/master/bin/git-scan-history > ~/bin/git-scan-history | |
3) chmod it | |
chmod +x ~/bin/git-scan-history |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1169071810 0 | |
1169138071 6294 | |
1169143071 23245 | |
1169143580 23245 | |
1169144084 23275 | |
1169145926 23275 | |
1169149435 31231 | |
1169150235 34922 | |
1169153198 47651 | |
1169153433 30684 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns git-charts.core | |
(:use [incanter.core] [incanter.zoo]) | |
(:require (incanter stats charts io))) | |
(defn read-dataset [] | |
(incanter.io/read-dataset "/Users/jen/Dropbox/legacy codebase/ove-gitstats/lines_of_code.dat" :delim \space)) | |
(defn clean-dataset [ds] | |
(incanter.core/col-names ds [:Date :Locs])) |