I hereby claim:
- I am jjcomer on github.
- I am jjcomer (https://keybase.io/jjcomer) on keybase.
- I have a public key whose fingerprint is 951D BB52 4253 4B41 E48F 00BD 8FB0 6166 F8A9 582F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
(ns stateMachine) | |
(defn parse-integer [str] | |
(try (Integer/parseInt str) | |
(catch NumberFormatException nfe 0))) | |
(defn displayMenu | |
"This function displays the menu and gets the user's input" | |
[] | |
(println "Displaying the menu") |
(ns StateMachine) | |
(defn initTodo [] | |
"This function will return a hash representing the inital application state" | |
{:file "todo.txt" | |
:some-other-option true}) | |
(defn parse-integer [str] | |
(try (Integer/parseInt str) | |
(catch NumberFormatException nfe 0))) |
import java.lang.reflect.*; | |
public class HelperMethods { | |
@SuppressWarnings("unchecked") | |
public static <R, T> R invokePrivateMethod(T object, String methodName, Object... args) { | |
final Method methods[] = object.getClass().getDeclaredMethods(); | |
for (Method method : methods) { | |
if (methodName.equals(method.getName())) { | |
try { | |
method.setAccessible(true); |
(ns ^{:doc "Add some colour to your output" | |
:author "Josh Comer <joshjcomer@gmail.com>"} | |
cljcolour) | |
(def black {:fore "02;30" :back "02;40"}) | |
(def red {:fore "02;31" :back "02;41"}) | |
(def green {:fore "02;32" :back "02;42"}) | |
(def yellow {:fore "02;33" :back "02;43"}) | |
(def blue {:fore "02;34" :back "02;44"}) | |
(def purple {:fore "02;35" :back "02;45"}) |
(ns trollscript.core | |
(:use [clojure.string :only [lower-case]]) | |
(:gen-class)) | |
(def MAX_CELLS 30000) | |
(defn split-code | |
"Splits the string into its trollscript commands" | |
[raw-code] | |
(->> raw-code |
(ns median.core | |
(:use [clojure.math.numeric-tower :only [floor ceil]])) | |
(defn rand-list | |
"Generates a random vector of length n with unique | |
values inclusive 1 to exclusive n" | |
[n] | |
(shuffle (map inc (range n)))) | |
(defn- median-skeleton |
(ns median.analyze | |
(:use [median core] | |
[incanter core charts datasets stats])) | |
(defn test-lists | |
"Generate test lists applying f to p and n" | |
[n p f] | |
(map #(rand-list (f p %)) (range n))) | |
(defmacro time-it |
(def c-order | |
(let [order [:id :title :author :date :price]] | |
(zipmap order (range (count order))))) | |
(defn column-sort | |
[k1 k2] | |
(compare (get c-order k1 -1) | |
(get c-order k2 -1))) | |
(def test-data |