Functions to export products, chapters, groups or components into XML output

--- src/hurvinek/exporter.clj
+++ src/hurvinek/exporter.clj
@@ -35,26 +35,71 @@
         (csv/write-csv *out* data)))

 (defn products->text
+    "Convert list of products into plain text file. Fields are separated by TAB characters."
     [products]
     (->> (for [product products]
             (str (:id product) "\t" (:name product) "\t" (:description product)))
             (clojure.string/join "\n")))

 (defn chapters->text
+    "Convert list of chapters into plain text file. Fields are separated by TAB characters."
     [chapters]
     (->> (for [chapter chapters]
             (str (:id chapter) "\t" (:name chapter)))
             (clojure.string/join "\n")))

 (defn groups->text
+    "Convert list of groups into plain text file. Fields are separated by TAB characters."
     [groups]
     (->> (for [group groups]
             (str (:id group) "\t" (:name group)))
             (clojure.string/join "\n")))

 (defn components->text
+    "Convert list of components into plain text file. Fields are separated by TAB characters."
     [components]
     (->> (for [component components]
             (str (:id component) "\t" (:name component)))
             (clojure.string/join "\n")))

+(defn products->xml
+    "Convert list of products into XML file."
+    [products]
+    (with-out-str
+        (xml/emit {:tag :products :content
+            (for [product products]
+                {:tag :product :attrs {
+                                   :id     (:id product)
+                                   :name   (:name product)
+                                   :description  (:description product)}})})))
+
+(defn chapters->xml
+    "Convert list of chapters into XML file."
+    [chapters]
+    (with-out-str
+        (xml/emit {:tag :chapters :content
+            (for [chapter chapters]
+                {:tag :chapter :attrs {
+                                   :id     (:id chapter)
+                                   :name   (:name chapter)}})})))
+
+(defn groups->xml
+    "Convert list of groups into XML file."
+    [groups]
+    (with-out-str
+        (xml/emit {:tag :groups :content
+            (for [group groups]
+                {:tag :group :attrs {
+                                   :id     (:id group)
+                                   :name   (:name group)}})})))
+
+(defn components->xml
+    "Convert list of components into XML file."
+    [components]
+    (with-out-str
+        (xml/emit {:tag :components :content
+            (for [component components]
+                {:tag :component :attrs {
+                                   :id     (:id component)
+                                   :name   (:name component)}})})))
+


Stable clj-stacktrace.

Stable clj-stacktrace.

--- ring-devel/project.clj
+++ ring-devel/project.clj
@@ -3,5 +3,5 @@
   :url "http://github.com/mmcgrana/ring"
   :dependencies [[ring/ring-core "0.2.0-SNAPSHOT"]
                  [clj-html "0.1.0-SNAPSHOT"]
-                 [clj-stacktrace "0.1.0-SNAPSHOT"]]
+                 [clj-stacktrace "0.1.0"]]
   :dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]])


client credentials grant tested

client credentials grant tested

--- test/cerber/oauth2/authorization_test.clj
+++ test/cerber/oauth2/authorization_test.clj
@@ -172,3 +172,19 @@
         (let [{:keys [status body]} (:response state)]
           status => 200
           (slurp body) => (contains "access_token"))))
+
+(fact "Client may receive its token in Client Credentials Grant."
+      (u/purge-users)
+
+      ;; when
+      (let [state (-> (session (wrap-defaults oauth-routes api-defaults))
+                      (header "Accept" "application/json")
+                      (header "Authorization" (str "Basic " (base64-auth client)))
+                      (request "/token"
+                               :request-method :post
+                               :params {:grant_type "client_credentials"}))]
+
+        ;; then
+        (let [{:keys [status body]} (:response state)]
+          status => 200
+          (slurp body) => (contains "access_token"))))


add test for asana assertion

add test for asana assertion

--- test/chat/test/server/asana_extension.clj
+++ test/chat/test/server/asana_extension.clj
@@ -64,21 +64,30 @@
         ext (asana/create-asana-extension {:id (db/uuid)
                                            :group-id (group :id)
                                            :tag-id (tag-1 :id)})]
-    (is (= 400 (:status (ext/handle-webhook ext {:headers {} :body ""}))))
+    (testing "gets an x-hook-secret on first request"
+      (is (= 400 (:status (ext/handle-webhook ext {:headers {} :body ""}))))
+      (let [msg "{\"foo\": \"bar\"}"]
+        (is (thrown? AssertionError
+                     (ext/handle-webhook
+                       ext
+                       {:body msg
+                        :headers {"x-hook-signature" (crypto/hmac "foobar" msg)}}))))
     (let [handshake-resp (ext/handle-webhook ext {:headers {"x-hook-secret" "foobar"}
                                                   :body ""})]
       (is (= 200 (:status handshake-resp)))
-      (is (= "foobar" (get-in handshake-resp [:headers "X-Hook-Secret"]))))
-    (let [ext' (db/extension-by-id (ext :id))]
-      (is (= "foobar" (get-in ext' [:config :webhook-secret])))
-      (is (= 400 (:status (ext/handle-webhook ext' {:body "{\"foo\": \"bar\"}"
-                                                    :headers {}}))))
-      (is (= 400 (:status (ext/handle-webhook ext' {:body "{\"foo\": \"bar\"}"
-                                                    :headers {"x-hook-signature" "zzzzz"}}))))
-      (let [msg "{\"foo\": \"bar\"}"]
-        (is (= 200
-               (:status
-                 (ext/handle-webhook
-                   ext'
-                   {:body msg
-                    :headers {"x-hook-signature" (crypto/hmac "foobar" msg)}}))))))))
+      (is (= "foobar" (get-in handshake-resp [:headers "X-Hook-Secret"])))))
+
+    (testing "can use the secret to compute signature"
+      (let [ext' (db/extension-by-id (ext :id))]
+        (is (= "foobar" (get-in ext' [:config :webhook-secret])))
+        (is (= 400 (:status (ext/handle-webhook ext' {:body "{\"foo\": \"bar\"}"
+                                                      :headers {}}))))
+        (is (= 400 (:status (ext/handle-webhook ext' {:body "{\"foo\": \"bar\"}"
+                                                      :headers {"x-hook-signature" "zzzzz"}}))))
+        (let [msg "{\"foo\": \"bar\"}"]
+          (is (= 200
+                 (:status
+                   (ext/handle-webhook
+                     ext'
+                     {:body msg
+                      :headers {"x-hook-signature" (crypto/hmac "foobar" msg)}})))))))))


Updated test comments

Updated test comments

--- test/clj_jenkins_api/jenkins_api_test.clj
+++ test/clj_jenkins_api/jenkins_api_test.clj
@@ -54,8 +54,8 @@
 ;

 (deftest test-encode-spaces
-    "Check that the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+    "Check the clj-jenkins-api.jenkins-api/encode-spaces function"
+    (testing "the clj-jenkins-api.jenkins-api/encode-spaces function"
         (are [x y] (= x y)
             ""            (encode-spaces "")
             "%20"         (encode-spaces " ")
@@ -66,13 +66,13 @@
             "x%20%20%20z" (encode-spaces "x   z"))))

 (deftest test-encode-spaces-NPE
-    "Check that the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+    "Check the function the clj-jenkins-api.jenkins-api/encode-spaces"
+    (testing "the function clj-jenkins-api.jenkins-api/encode-spaces"
         (is (thrown? NullPointerException (encode-spaces nil)))))

 (deftest test-job-name->url-1
-    "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+    "Check the clj-jenkins-api.jenkins-api/job-name->url"
+    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
         (are [x y] (= x y)
             "job/"                  (job-name->url "" "")
             " job/"                 (job-name->url " " "")
@@ -80,8 +80,8 @@
             "jenkins-url:8080/job/" (job-name->url "jenkins-url:8080/" ""))))

 (deftest test-job-name->url-2
-    "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+    "Check the clj-jenkins-api.jenkins-api/job-name->url"
+    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
         (are [x y] (= x y)
             "jenkins-url:8080/job/"                  (job-name->url "jenkins-url:8080/" "")
             "jenkins-url:8080/job/job-name"          (job-name->url "jenkins-url:8080/" "job-name")
@@ -89,15 +89,15 @@
             "jenkins-url:8080/job/long%20job%20name" (job-name->url "jenkins-url:8080/" "long job name"))))

 (deftest test-job-name->url-not-NPE
-    "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+    "Check the clj-jenkins-api.jenkins-api/job-name->url"
+    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
         (are [x y] (= x y)
             "job/"  (job-name->url ""  "")
             "job/"  (job-name->url nil ""))))

 (deftest test-job-name->url-NPE
-    "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+    "Check the clj-jenkins-api.jenkins-api/job-name->url"
+    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
         (is (thrown? NullPointerException (job-name->url ""  nil)))
         (is (thrown? NullPointerException (job-name->url nil nil)))))


:bug: Fix wrong limit handling on undo.

:bug: Fix wrong limit handling on undo.

--- frontend/src/app/main/data/workspace/common.cljs
+++ frontend/src/app/main/data/workspace/common.cljs
@@ -242,9 +242,10 @@

 (defn- conj-undo-entry
   [undo data]
-  (let [undo (conj undo data)]
-    (if (> (count undo) MAX-UNDO-SIZE)
-      (into [] (take MAX-UNDO-SIZE undo))
+  (let [undo (conj undo data)
+        cnt  (count undo)]
+    (if (> cnt MAX-UNDO-SIZE)
+      (subvec undo (- cnt MAX-UNDO-SIZE))
       undo)))

 (defn- materialize-undo
@@ -265,13 +266,15 @@
           (update :workspace-undo dissoc :undo-index)
           (update-in [:workspace-undo :items] (fn [queue] (into [] (take (inc index) queue))))))))

-(defn- add-undo-entry [state entry]
+(defn- add-undo-entry
+  [state entry]
   (if entry
     (let [state (update-in state [:workspace-undo :items] (fnil conj-undo-entry []) entry)]
       (assoc-in state [:workspace-undo :index] (dec (count (get-in state [:workspace-undo :items])))))
     state))

-(defn- accumulate-undo-entry [state {:keys [undo-changes redo-changes]}]
+(defn- accumulate-undo-entry
+  [state {:keys [undo-changes redo-changes]}]
   (-> state
       (update-in [:workspace-undo :transaction :undo-changes] #(into undo-changes %))
       (update-in [:workspace-undo :transaction :redo-changes] #(into % redo-changes))))


Add basic test cases for core functions

Add basic test cases for core functions

--- test/hbase_region_inspector/core_test.clj
+++ test/hbase_region_inspector/core_test.clj
@@ -32,3 +32,84 @@
            {:start-key (.getBytes "hello")
             :end-key (byte-array (map byte (range 5)))
             :untouched 1234}))))
+
+(def ^:private servers
+  {"alpha" {}
+   "beta"  {}
+   "gamma" {}})
+
+(def ^:private regions
+  ;; foo-sum 12
+  ;; bar-sum 14
+  ;; baz-sum 16
+  [{:server "alpha" :table "foo" :start-key (.getBytes "d") :val1 1 :val2 1}
+   {:server "alpha" :table "bar" :start-key (.getBytes "c") :val1 1 :val2 2}
+   {:server "alpha" :table "baz" :start-key (.getBytes "b") :val1 2 :val2 3}
+   {:server "alpha" :table "foo" :start-key (.getBytes "a") :val1 2 :val2 4}
+   {:server "beta"  :table "bar" :start-key (.getBytes "h") :val1 3 :val2 5}
+   {:server "beta"  :table "baz" :start-key (.getBytes "g") :val1 3 :val2 6}
+   {:server "beta"  :table "foo" :start-key (.getBytes "f") :val1 4 :val2 7}
+   {:server "beta"  :table "bar" :start-key (.getBytes "e") :val1 4 :val2 8}
+   {:server "gamma" :table "baz" :start-key (.getBytes "l") :val1 5 :val2 9}
+   {:server "gamma" :table "foo" :start-key (.getBytes "k") :val1 5 :val2 10}
+   {:server "gamma" :table "bar" :start-key (.getBytes "j") :val1 6 :val2 11}
+   {:server "gamma" :table "baz" :start-key (.getBytes "i") :val1 6 :val2 12}])
+
+(deftest test-regions-by-servers
+  (let [abg (fn [& args]
+              (let [{servers :servers :as result}
+                    (apply regions-by-servers regions servers args)
+                    {:strs [alpha beta gamma]}
+                    (into {} (for [server servers] [(:name server) server]))]
+                (merge result {:alpha alpha :beta beta :gamma gamma
+                               :checker (juxt :max :sum)})))]
+    (testing "all tables"
+      (let [{:keys [tables alpha beta gamma checker]} (abg :val1 :metric [])]
+        (is (= #{"foo" "bar" "baz"} (set tables)))
+        (is (= [22 6] (checker alpha)))
+        (is (= [22 14] (checker beta)))
+        (is (= [22 22] (checker gamma)))
+        (is (= [3 4 2 1] (map :val2 (:regions alpha))))
+        (is (= [8 7 6 5] (map :val2 (:regions beta))))
+        (is (= [12 11 9 10] (map :val2 (:regions gamma))))))
+    (testing "subset of tables"
+      (let [{:keys [tables alpha beta gamma checker]} (abg :val1 :metric ["foo" "baz"])]
+        (is (= #{"foo" "bar" "baz"} (set tables)))
+        (is (= [16 5] (checker alpha)))
+        (is (= [16 7] (checker beta)))
+        (is (= [16 16] (checker gamma)))
+        (is (= [3 4 1] (map :val2 (:regions alpha))))
+        (is (= [7 6] (map :val2 (:regions beta))))
+        (is (= [12 9 10] (map :val2 (:regions gamma))))))
+    (testing "sort by table sum"
+      (let [{:keys [tables alpha beta gamma checker]} (abg :val1 :table [])]
+        (is (= #{"foo" "bar" "baz"} (set tables)))
+        (is (= [3 2 4 1] (map :val2 (:regions alpha))))
+        (is (= [6 8 5 7] (map :val2 (:regions beta))))
+        (is (= [12 9 11 10] (map :val2 (:regions gamma))))))))
+
+(deftest test-regions-by-tables
+  (testing "sort by metric"
+    (let [result (regions-by-tables regions :val1 :metric)
+          [bar baz foo] result
+          [bar-regions baz-regions foo-regions] (map :regions result)]
+      ;; Tables are sorted by their names
+      (is (= ["bar" "baz" "foo"] (map :name result)))
+      (is (= 12 (:sum foo)))
+      (is (= 14 (:sum bar)))
+      (is (= 16 (:sum baz)))
+      (is (= [10 7 4 1] (map :val2 foo-regions)))
+      (is (= [11 8 5 2] (map :val2 bar-regions)))
+      (is (= [12 9 6 3] (map :val2 baz-regions)))))
+  (testing "sort by start-key"
+    (let [result (regions-by-tables regions :val1 :start-key)
+          [bar baz foo] result
+          [bar-regions baz-regions foo-regions] (map :regions result)]
+      ;; Tables are, again, sorted by their names
+      (is (= ["bar" "baz" "foo"] (map :name result)))
+      (is (= 12 (:sum foo)))
+      (is (= 14 (:sum bar)))
+      (is (= 16 (:sum baz)))
+      (is (= [4 1 7 10] (map :val2 foo-regions)))
+      (is (= [2 8 5 11] (map :val2 bar-regions)))
+      (is (= [3 6 12 9] (map :val2 baz-regions))))))


(PDB-2905) command-test: use annotate-with-attempt

Call annotate-with-attempt to add attempts to test cmdrefs so that
they'll be more realistic.  This supports migrating the DLO to
support stockpile.

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -142,6 +142,14 @@
   [command publish-var discard-var & body]
   `(test-msg-handler* ~command ~publish-var ~discard-var *db* ~@body))

+(defn add-fake-attempts [cmdref n]
+  (loop [i 0
+         result cmdref]
+    (if (or (neg? n) (= i n))
+      result
+      (recur (inc i)
+             (mql/annotate-with-attempt result (Exception. (str "thud-" i)))))))
+
 (deftest command-processor-integration
   (let [command {:command "some command" :version 1 :payload "\"payload\""}]
     (testing "correctly formed messages"
@@ -186,9 +194,6 @@
             (is (= 0 (times-called publish)))
             (is (= 1 (count (fs/list-dir discard-dir))))
             (is (= 0 (times-called process-counter)))))))))
-
-(defn append-attempts [n command]
-  (assoc-in command [:annotations :attempts] (repeat n {})))

 (deftest command-retry-handler
   (testing "Should log retries as debug for less than 4 attempts"
@@ -201,7 +206,9 @@
                         mh (mql/message-handler q nil
                                                 delay-message process-message)]]
             (binding [*logger-factory* (atom-logger log-output)]
-              (mh (append-attempts i (tqueue/store-command q "replace catalog" 10 "cats" {:certname "cats"})))
+              (mh (-> (tqueue/store-command q "replace catalog" 10
+                                            "cats" {:certname "cats"})
+                      (add-fake-attempts i)))
               (is (called? delay-message))
               (is (not (called? mql/discard-message)))

@@ -220,7 +227,9 @@
               mh (mql/message-handler q nil delay-message process-message)]
           (with-redefs [mql/discard-message (mock-fn)]
             (binding [*logger-factory* (atom-logger log-output)]
-              (mh (append-attempts mql/maximum-allowable-retries (tqueue/store-command q "replace catalog" 10 "cats" {:certname "cats"})))
+              (mh (-> (tqueue/store-command q "replace catalog" 10
+                                            "cats" {:certname "cats"})
+                      (add-fake-attempts mql/maximum-allowable-retries)))
               (is (not (called? delay-message)))
               (is (called? mql/discard-message))
               (is (= (get-in @log-output [0 1]) :error))


day 9

day 9

--- 2017/day-9/src/day_9/core.clj
+++ 2017/day-9/src/day_9/core.clj
@@ -10,43 +10,95 @@
     (g-ls)
     (map #(clojure.string/split #"\s+"))))

-(defn score'
-  ([s i] (score' s i 1 nil))
-  ([s i d [tag & tags]]
-   (if (< i (count s))
-     (let [c (get s i)
-           i' (inc i)
-           c' (condp = c
-                \! :not
-                \< :open-gb
-                \> :close-gb
-                \{ :open-gr
-                \} :close-gr
-                :any)
-           push (fn [t2s & t1s]
-                  (concat (reverse t1s) t2s))]
-       (prn i (count s))
-       (condp = tag
-         nil (condp = c'
-               :open-gr (+ d (score' s i' (inc d) [:gr]))
-               :open-gb (score' s i' d [:gb])
-               :not (score' s i' d [:not])
-               (score' s i' d nil))
-         :gr (condp = c'
-               :close-gr (score' s i' (dec d) tags)
-               :open-gr (+ d (score' s i' (inc d) (push tags tag :gr)))
-               :open-gb (score' s i' d (push tags tag :gb))
-               :not (score' s i' d (push tags tag :not))
-               :any (score' s i' d (push tags tag)))
-         :gb (condp = c'
-               :close-gb (score' s i' d tags)
-               :open-gr (score' s i' d (push tags tag))
-               :close-gr (score' s i' d (push tags tag))
-               :open-gb (score' s i' d (push tags tag :gb))
-               :not (score' s i' d (push tags tag :not))
-               :any (score' s i' d (push tags tag)))
-         :not (score' s i' d tags)))
-     0)))
+(defn score''
+  [s]
+  (->>
+    (iterate
+      (fn
+        [[ttl i d [tag & tags]]]
+        (if (< i (count s))
+          (let [c (get s i)
+                i' (inc i)
+                c' (condp = c
+                     \! :not
+                     \< :open-gb
+                     \> :close-gb
+                     \{ :open-gr
+                     \} :close-gr
+                     :any)
+                push (fn [t2s & t1s]
+                       (concat (reverse t1s) t2s))]
+            ;(prn ttl i d tag c c')
+            (condp = tag
+              nil (condp = c'
+                    :open-gr [(+ ttl d) i' (inc d) [:gr]]
+                    :open-gb [ttl i' d [:gb]]
+                    :not [ttl i' d [:not]]
+                    [ttl i' d nil])
+              :gr (condp = c'
+                    :close-gr [ttl i' (dec d) tags]
+                    :open-gr [(+ ttl d) i' (inc d) (push tags tag :gr)]
+                    :open-gb [ttl i' d (push tags tag :gb)]
+                    :not [ttl i' d (push tags tag)]
+                    :any [ttl i' d (push tags tag)])
+              :gb (condp = c'
+                    :close-gb [ttl i' d tags]
+                    :open-gr [ttl i' d (push tags tag)]
+                    :close-gr [ttl i' d (push tags tag)]
+                    :open-gb [ttl i' d (push tags tag)]
+                    :not [ttl i' d (push tags tag :not)]
+                    :any [ttl i' d (push tags tag)])
+              :not [ttl i' d tags]))
+          [ttl]))
+      [0 0 1 nil])
+    (take-while #(> (count %) 2))
+    last
+    first))
+
+(defn score'''
+  [s]
+  (->>
+    (iterate
+      (fn
+        [[ttl i d [tag & tags]]]
+        (if (< i (count s))
+          (let [c (get s i)
+                i' (inc i)
+                c' (condp = c
+                     \! :not
+                     \< :open-gb
+                     \> :close-gb
+                     \{ :open-gr
+                     \} :close-gr
+                     :any)
+                push (fn [t2s & t1s]
+                       (concat (reverse t1s) t2s))]
+            ;(prn ttl i d tag c c')
+            (condp = tag
+              nil (condp = c'
+                    :open-gr [ttl i' (inc d) [:gr]]
+                    :open-gb [ttl i' d [:gb]]
+                    :not [ttl i' d [:not]]
+                    [ttl i' d nil])
+              :gr (condp = c'
+                    :close-gr [ttl i' (dec d) tags]
+                    :open-gr [ttl i' (inc d) (push tags tag :gr)]
+                    :open-gb [ttl i' d (push tags tag :gb)]
+                    :not [ttl i' d (push tags tag)]
+                    :any [ttl i' d (push tags tag)])
+              :gb (condp = c'
+                    :close-gb [ttl i' d tags]
+                    :open-gb [(inc ttl) i' d (push tags tag)]
+                    :open-gr [(inc ttl) i' d (push tags tag)]
+                    :close-gr [(inc ttl) i' d (push tags tag)]
+                    :not [ttl i' d (push tags tag :not)]
+                    :any [(inc ttl) i' d (push tags tag)])
+              :not [ttl i' d tags]))
+          [ttl]))
+      [0 0 1 nil])
+    (take-while #(> (count %) 2))
+    last
+    first))

 (defn -main
   "I don't do a whole lot ... yet."


Update tests for java-agents support

Update tests for java-agents support

--- lein-ancient/test/leiningen/ancient/cli_test.clj
+++ lein-ancient/test/leiningen/ancient/cli_test.clj
@@ -13,6 +13,7 @@
   :dependencies?    true
   :plugins?         false
   :profiles?        true
+  :java-agents?     true
   :qualified?       false
   :snapshots?       false
   :interactive?     false
@@ -40,7 +41,7 @@
       (with-out-str
         (with-logging true
           (parse [":get"])))
-        => #"no longer supported")
+      => #"no longer supported")

 (fact "about unapplicable flags."
       (with-out-str
@@ -68,15 +69,21 @@
             (dis flags ks) => (dis defaults ks)
             (select-keys flags ks) => ?effects))
     ?args                    ?effects
-    [":all"]                 {:dependencies? true, :plugins? true}
+    [":all"]                 {:dependencies? true, :plugins? true,
+                              :java-agents? true}
     [":allow-all"]           {:snapshots? true, :qualified? true}
     [":allow-snapshots"]     {:snapshots? true}
     [":allow-qualified"]     {:qualified? true}
     [":check-clojure"]       {:check-clojure? true}
     [":interactive"]         {:interactive? true}
-    [":plugins"]             {:dependencies? false, :plugins? true}
-    [":all" ":plugins"]      {:dependencies? true, :plugins? true}
-    [":plugins" ":all"]      {:dependencies? true, :plugins? true}
+    [":plugins"]             {:dependencies? false, :plugins? true,
+                              :java-agents? false}
+    [":all" ":plugins"]      {:dependencies? true, :plugins? true,
+                              :java-agents? true}
+    [":plugins" ":all"]      {:dependencies? true, :plugins? true,
+                              :java-agents? true}
+    [":java-agents"]         {:dependencies? false, :plugins? false,
+                              :java-agents? true}
     [":no-colors"]           {:colors? false}
     [":no-colours"]          {:colors? false}
     [":no-profiles"]         {:profiles? false}


Add longitude and latitude

Add longitude and latitude

--- src-cljs/kixi/hecuba/main.cljs
+++ src-cljs/kixi/hecuba/main.cljs
@@ -263,6 +263,8 @@
         (pipe (map< (fn [x]
                       ;; TODO This should really be an independent consumer on a multiplexed channel
                       (om/transact! data [:location :name] (constantly (-> x :location :name)))
+                      (om/transact! data [:location :longitude] (constantly (-> x :location :longitude)))
+                      (om/transact! data [:location :latitude] (constantly (-> x :location :latitude)))
                       (:readings x))
                     (:out devices-detail-ajax-pair))
               (:in sensors-table-pair))
@@ -291,9 +293,9 @@
                (om/build table (get-in data [:tables :properties]) {:opts (om/get-state owner :properties-table-channels)})
                (dom/h2 nil "Devices")
                (om/build table (get-in data [:tables :devices]) {:opts (om/get-state owner :devices-table-channels)})
-               (dom/p nil (str "Location " (get-in data [:location :name])))
-               (dom/p nil (str "Longitude " (get-in data [:location :longitude])))
-               (dom/p nil (str "Latitude " (get-in data [:location :latitude])))
+               (dom/p nil (str "Location: " (get-in data [:location :name])))
+               (dom/p nil (str "Longitude: " (get-in data [:location :longitude])))
+               (dom/p nil (str "Latitude: " (get-in data [:location :latitude])))
                (dom/h2 nil "Sensors")
                (om/build table (get-in data [:tables :sensors]) {:opts (om/get-state owner :sensors-table-channels)})
                ))))


fix arity

fix arity

--- main/src/dda/pallet/dda_user_crate/infra/ssh.clj
+++ main/src/dda/pallet/dda_user_crate/infra/ssh.clj
@@ -85,7 +85,7 @@
 (s/defn configure-user
   [user-name :- s/Str
    ssh-config :- Ssh]
-  (configure-ssh-client user-name ssh-config)
+  (configure-ssh-client user-name)
   (configure-authorized-keys user-name ssh-config)
   (when (contains? ssh-config :ssh-key)
     (configure-ssh-key user-name ssh-config)))


Remove parens around arglists in cheat-sheet

--- server/src/main/clojure/vimclojure/util.clj
+++ server/src/main/clojure/vimclojure/util.clj
@@ -442,10 +442,10 @@
   (string/join
     "\n\n"
     (map (fn [n]
-           (let [mdata (mapv #((juxt :ns :name :arglists) (meta %))
-                             (vals (ns-publics n)))
+           (let [mdata (map #((juxt :ns :name (fn [m] (string/join \space (:arglists m)))) (meta %))
+                            (vals (ns-publics n)))
                  {defs  true
-                  funcs false} (group-by (comp nil? peek) mdata)
+                  funcs false} (group-by (comp empty? last) mdata)
                  len   (inc (apply max 0 (map (comp count str second) funcs)))
                  defs  (map #(apply format "%s/%s" %) defs)
                  funcs (map #(apply format (str "%s/%-" len "s%s") %) funcs)]


Deprecate functions which became unnecessary.

The refactoring of how MIDI mapping functions are removed obviated the
need for all the special-purpose removal functions which existed before,
but I did not previously notice that.

--- src/afterglow/show.clj
+++ src/afterglow/show.clj
@@ -578,8 +578,8 @@
   will be stored in the variable.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-to-var-mapping]] if you later want to stop
-  the variable from responding to these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the variable
+  from responding to these MIDI messages."
   [device-filter channel control-number variable & {:keys [min max transform-fn] :or {min 0 max 127}}]
   {:pre [(some? *show*) (some? device-filter) (integer? channel) (<= 0 channel 15)
          (integer? control-number) (<= 0 control-number 127) (some? variable)
@@ -604,10 +604,14 @@
     update-fn))

 (defn remove-midi-control-to-var-mapping
-  "Cease updating the specified variable in [[*show*]] when the
+  "Deprecated: There is no reason to use this function, it is simpler
+  to call [[remove-control-mapping]] directly.
+
+  Cease updating the specified variable in [[*show*]] when the
   specified MIDI controller-change messages are received. `f` is the
   function that was returned by [[add-midi-control-to-var-mapping]]
   when this relationship was created."
+  {:deprecated "0.2.0"}
   [device-filter channel control-number variable f]
   {:pre [(some? *show*) (some? device-filter) (integer? channel) (<= 0 channel 15)
          (integer? control-number) (<= 0 control-number 127) (some? variable)]}
@@ -629,8 +633,8 @@
   variable containing a dimmer master.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-to-master-mapping]] if you later want to
-  stop the dimmer master from being affected by these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the
+  dimmer master from being affected by these MIDI messages."
   [device-filter channel control-number & {:keys [master min max] :or {master (:grand-master *show*) min 0 max 100}}]
   {:pre [(some? *show*) (some? device-filter) (number? min) (number? max) (not= min max)
          (<= 0 min 100) (<= 0 max 100)
@@ -647,16 +651,18 @@
     update-fn))

 (defn remove-midi-control-to-master-mapping
-  "Cease updating the specified [[dimmer/master]] when the specified
+  "Deprecated: There is no reason to use this function, it is simpler
+  to call [[remove-control-mapping]] directly.
+
+  Cease updating the specified [[dimmer/master]] when the specified
   MIDI controller-change messages are received. `f` is the function
   that was returned by [[add-midi-control-to-master-mapping]] when
   this relationship was established."
+  {:deprecated "0.2.0"}
   [device-filter channel control-number f & {:keys [master] :or {master (:grand-master *show*)}}]
   {:pre [(some? *show*) (some? device-filter) (integer? channel) (<= 0 channel 15)
          (integer? control-number) (<= 0 control-number 127)]}
-  (let [bound (bind-keyword-param master Master (:grand-master *show*))
-        master (resolve-param bound *show* (rhythm/metro-snapshot (:metronome *show*)))]
-    (midi/remove-control-mapping device-filter channel control-number f)))
+  (midi/remove-control-mapping device-filter channel control-number f))

 (defn- add-midi-control-metronome-mapping
   "Helper function to perform some action on a metronome when a
@@ -667,8 +673,8 @@
   `device-filter` (using [[filter-devices]]) will be chosen.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-metronome-mapping]] if you later want to
-  stop the metronome from being affected by these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the
+  metronome from being affected by these MIDI messages."
   [device-filter channel control-number metronome mapped-fn]
   {:pre [(some? *show*) (some? device-filter) (integer? channel) (<= 0 channel 15)
          (integer? control-number) (<= 0 control-number 127) (fn? mapped-fn)]}
@@ -692,14 +698,17 @@
   metronome attached to [[*show*]] is mapped.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-metronome-mapping]] if you later want to
-  stop the metronome from being affected by these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the
+  metronome from being affected by these MIDI messages."
   [device-filter channel control-number & {:keys [metronome] :or {metronome (:metronome *show*)}}]
   (add-midi-control-metronome-mapping device-filter channel control-number metronome
                                       #(rhythm/metro-start % 1)))

 (defn remove-midi-control-metronome-mapping
-  "Stop affecting a metronome when the specified MIDI
+  "Deprecated: There is no reason to use this function, it is simpler
+  to call [[remove-control-mapping]] directly.
+
+  Stop affecting a metronome when the specified MIDI
   controller-change messages are received. This undoes the effect of
   any of [[add-midi-control-metronome-reset-mapping]],
   [[add-midi-control-metronome-align-bar-mapping]], and
@@ -715,12 +724,11 @@
   [[add-midi-control-metronome-align-bar-mapping]], or
   [[add-midi-control-metronome-align-phrase-mapping]] when this
   relationship was established."
+  {:deprecated "0.2.0"}
   [device-filter channel control-number f & {:keys [metronome] :or {metronome (:metronome *show*)}}]
   {:pre [(some? *show*) (some? device-filter) (integer? channel) (<= 0 channel 15)
          (integer? control-number) (<= 0 control-number 127)]}
-  (let [bound (bind-keyword-param metronome Metronome (:metronome *show*))
-        metronome (resolve-param bound *show* (rhythm/metro-snapshot (:metronome *show*)))]
-    (midi/remove-control-mapping device-filter channel control-number f)))
+  (midi/remove-control-mapping device-filter channel control-number f))

 (defn add-midi-control-metronome-align-bar-mapping
   "Adjust a metronome so the closest beat is considered the first in
@@ -737,8 +745,8 @@
   metronome attached to [[*show*]] is unmapped.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-metronome-mapping]] if you later want to
-  stop the metronome from being affected by these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the
+  metronome from being affected by these MIDI messages."
   [device-filter channel control-number & {:keys [metronome] :or {metronome (:metronome *show*)}}]
   (add-midi-control-metronome-mapping device-filter channel control-number metronome
                                       #(rhythm/metro-bar-start % (rhythm/metro-bar %))))
@@ -758,8 +766,8 @@
   metronome attached to [[*show*]] is mapped.

   Returns a MIDI mapping function which can be passed
-  to [[remove-midi-control-metronome-mapping]] if you later want to
-  stop the metronome from being affected by these MIDI messages."
+  to [[remove-control-mapping]] if you later want to stop the
+  metronome from being affected by these MIDI messages."
   [device-filter channel control-number & {:keys [metronome] :or {metronome (:metronome *show*)}}]
   (add-midi-control-metronome-mapping device-filter channel control-number metronome
                                       #(rhythm/metro-phrase-start % (rhythm/metro-phrase %))))


add :lookup function for all grammars

add :lookup function for all grammars

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -409,6 +409,8 @@
      :language "en"
      :morph fo
      :grammar grammar
+     :lookup (fn [arg]
+               (analyze arg lexicon))
      :lexicon lexicon
      :for {:es ;; a lexicon specific to when we want to use Español as a target.
            (into {}
@@ -465,6 +467,8 @@
                           (merge tree
                                  (morph-walk-tree tree))))
      :language "en"
+     :lookup (fn [arg]
+               (analyze arg lexicon))
      :morph fo
      :grammar grammar
      :lexicon lexicon
@@ -529,6 +533,8 @@
      :language "en"
      :morph fo
      :grammar grammar
+     :lookup (fn [arg]
+               (analyze arg lexicon))

      ;; Will throw exception if more than 1 rule has the same :rule value:
      :grammar-map (zipmap
@@ -569,6 +575,8 @@
                         (do
                           (merge tree
                                  (morph-walk-tree tree))))
+     :lookup (fn [arg]
+               (analyze arg lexicon))
      :grammar grammar
      :morph fo
      :lexicon lexicon


comment out meta-lexeme "_"

comment out meta-lexeme "_"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -25,12 +25,12 @@

    ;; useful meta-lexeme for debugging generation or parsing -
    ;;    modify its constraints as you prefer for what you are trying to debug.
-   "_"
-   (unify agreement-noun
-          common-noun
-          feminine-noun
-          countable-noun
-          {:synsem {:sem {:pred :blank}}})
+;   "_"
+;   (unify agreement-noun
+;          common-noun
+;          feminine-noun
+;          countable-noun
+;          {:synsem {:sem {:pred :blank}}})

    "Antonia"
    {:synsem {:sem {:pred :antonia


Add callback functionality for rejected action

--- src/beehive/future.clj
+++ src/beehive/future.clj
@@ -97,9 +97,11 @@
   (apply [this result]
     (fn (:status future) result)))

-(defn on-complete [^CLJResilientFuture f fn]
-  (let [^PrecipiceFuture java-f (.future f)
-        cb (CLJCallback. java-f fn)]
-    (.onSuccess java-f cb)
-    (.onError java-f cb)
-    (.onTimeout java-f cb)))+(defn on-complete [f fn]
+  (if (instance? CLJRejectedFuture f)
+    (fn :rejected (.reason ^CLJRejectedFuture f))
+    (let [^PrecipiceFuture java-f (.future ^CLJResilientFuture f)
+          cb (CLJCallback. java-f fn)]
+      (.onSuccess java-f cb)
+      (.onError java-f cb)
+      (.onTimeout java-f cb))))


:art: Squashes reflection warning

:art: Squashes reflection warning

--- src/aero/core.cljc
+++ src/aero/core.cljc
@@ -149,7 +149,7 @@
                         (try (io/file source)
                              ;; Handle the case where the source isn't file compatible:
                              (catch java.lang.IllegalArgumentException _ nil))]
-               (io/file (.getParent source-file) include)))]
+               (io/file (.getParent ^java.io.File source-file) include)))]
        (if (and fl (.exists fl))
          fl
          (StringReader. (pr-str {:aero/missing-include include}))))))


Removed unused reference in request-helper

--- src/checkin/request_helper.clj
+++ src/checkin/request_helper.clj
@@ -1,5 +1,4 @@
-(ns checkin.request-helper
-    (:require [cemerick.friend :as friend]))
+(ns checkin.request-helper)

 (defn- get-user-identity [request]
 (let [session (:session request)


Temporary disable subscene

Temporary disable subscene

--- src/clj/subman/parser/core.clj
+++ src/clj/subman/parser/core.clj
@@ -15,7 +15,7 @@
 (def sources (atom [addicted-source
                     podnapisi-source
                     opensubtitles-source
-                    subscene-source
+                    ;subscene-source
                     notabenoid-source
                     uksubtitles-source]))


fix gh link

fix gh link

--- src/cljs/om_time/personal.cljs
+++ src/cljs/om_time/personal.cljs
@@ -9,7 +9,7 @@
       (dom/div
        #js {:className "personal"}
        (dom/a
-        #js {:href "www.github.com/dmh43"}
+        #js {:href "https://www.github.com/dmh43"}
         (dom/i #js {:className "fa fa-github"}))
        (dom/a
         #js {:href "https://github.com/dmh43/Om-Time"}


rename some side-effect! fns

rename some side-effect! fns

--- src/aspire/web.clj
+++ src/aspire/web.clj
@@ -13,16 +13,14 @@
             [aspire.sqldb :as a-sqldb]
             [aspire.security :as a-sec]
             [aspire.handlers :as a-hdl]
-            [aspire.web.http :refer [wrap-host-urls]]
-            )
+            [aspire.web.http :refer [wrap-host-urls]])
   (:gen-class))
-

 (defresource onboarding!
   :available-media-types ["text/html"]
   :handle-ok a-hdl/onboarding!)

-(defresource admin
+(defresource admin!
   :allowed-methods [:get]
   :available-media-types ["text/html"]
   :handle-ok a-hdl/admin!)
@@ -37,10 +35,9 @@
                  [:link {:rel "stylesheet" :href "css/global.css"}]]
                 [:body
                  [:div#main
-                  [:div [:p#loading "Loading..."]]
-                 [:script {:src "js/aspire.js"}]]])))
+                  [:div [:p#loading "This isn't implemented yet."]]]])))

-(defresource config-page
+(defresource config-page!
   :allowed-methods [:post]
   :available-media-types ["text/html"]
   :post! a-hdl/config-page!
@@ -48,12 +45,12 @@
   :post-redirect? (fn [_] {:location "/admin"}))

 (defroutes admin-routes
-  (GET "/" [] admin)
+  (GET "/" [] admin!)
   (ANY "/debug" req (prn-str req)))

 (defroutes config-routes
   (PUT "/key/:key" [] config-key)
-  (POST "/page/:page" [] config-page))
+  (POST "/page/:page" [] config-page!))

 (defroutes app-routes
   ;; just for now, send everybody to /welcome


Adds functions for adding move sequences to games.

We already had functions for adding individual moves, but the new
functions for adding move sequences (add-move-sequence,
add-san-move-sequence and add-uci-move-sequence) are faster than
repeated calls to the functions for adding individual moves, because
the sequence functions eliminate the need to zip/unzip the tree for
every move added.

--- src/clojure/clj_chess/game.clj
+++ src/clojure/clj_chess/game.clj
@@ -116,6 +116,25 @@
 (def ^:private zip-add-uci-move #(zip-add-move %1 board/move-from-uci %2))
 (def ^:private zip-add-plain-move #(zip-add-move %2 (fn [_ m] m) %2))

+(defn- zip-add-move-sequence
+  "Takes a zipper, a move function (a function that, given a board and some
+  other value, translates that value to a chess move), and a sequence of
+  values representing chess moves, and returns a new zipper for a modified
+  game tree where the moves have been added at the zipper location."
+  [zipper move-function moves]
+  (reduce (fn [z m]
+            (-> (zip-add-move z move-function m)
+                (zip/down)
+                (zip/rightmost)))
+          zipper
+          moves))
+
+(def ^:private zip-add-san-move-sequence
+  #(zip-add-move-sequence %1 board/move-from-san %2))
+
+(def ^:private zip-add-uci-move-sequence
+  #(zip-add-move-sequence %2 board/move-from-uci %2))
+
 (defn- zip-add-key-value-pair
   [zipper key value]
   (zip/edit zipper assoc-in [key] value))
@@ -153,6 +172,35 @@
   [game uci-move & [node-id]]
   (add-move game board/move-from-uci uci-move
             (or node-id (-> game :current-node :node-id))))
+
+
+(defn add-move-sequence
+  "Like add-move, but adds a sequence of moves rather than a single move. This
+  is faster than calling add-move multiple times, because we don't have to
+  unzip and zip the tree for each added move."
+  [game move-function moves node-id]
+  (let [z (-> (game-zip game node-id)
+              (zip-add-move-sequence move-function moves))]
+    (assoc game :root-node (zip/root z)
+                :current-node (zip/node z))))
+
+
+(defn add-san-move-sequence
+  "Like add-san-move, but adds a sequence of moves rather than a single move.
+  This is faster than calling add-san-move multiple times, because we don't
+  have to unzip and zip the tree for each added move."
+  [game san-moves & [node-id]]
+  (add-move-sequence game board/move-from-san san-moves
+                     (or node-id (-> game :current-node :node-id))))
+
+
+(defn add-uci-move-sequence
+  "Like add-uci-move, but adds a sequence of moves rather than a single move.
+  This is faster than calling add-uci-move multiple times, because we don't
+  have to unzip and zip the tree for each added move."
+  [game uci-moves & [node-id]]
+  (add-move-sequence game board/move-from-uci uci-moves
+                     (or node-id (-> game :current-node :node-id))))

 (defn add-key-value-pair


Revert sleep time change

Revert sleep time change

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -255,7 +255,7 @@
     (when-let [project (read-android-project project)]
       (doseq [cmd ["doall" "repl"]]
         (leiningen.droid/execute-subtask project cmd [])
-        (Thread/sleep 15000)))
+        (Thread/sleep 10000)))
     :else
     (leiningen.repl/repl project)))


Added logging to know how long requests are taking.

--- src/cmr/transmit/echo/rest.clj
+++ src/cmr/transmit/echo/rest.clj
@@ -29,8 +29,9 @@
          url (format "%s%s" (conn/root-url conn) url-path)
          params (merge (request-options conn) options)
          ;; Uncoment to log requests
-         _ (debug "Making ECHO GET Request" url (pr-str params))
+         _ (debug "Making ECHO GET Request" url)
          response (client/get url params)
+         _ (debug "Completed ECHO GET Request" url)
          {:keys [status body headers]} response
          parsed (if (.startsWith ^String (get headers "Content-Type" "") "application/json")
                   (json/decode body true)


logging

logging

--- src/babel/over.clj
+++ src/babel/over.clj
@@ -95,9 +95,9 @@
                   (unifyc {:head child}
                           {:head {:synsem {:sem (lexfn-sem-impl (get-in child '(:synsem :sem) :top))}}}))]
       (if (not (fail? result))
-        (let [debug (log/debug (str "moreover-head " (get-in parent '(:rule)) " succeeded: " (:rule result)
+        (let [debug (log/debug (str "moreover-head: " (get-in parent '(:rule)) " succeeded: " (:rule result)
                                     ":'" (morph result) "'"))
-              debug (log/debug (str "child matched parents desired synsem:"
+              debug (log/debug (str "moreover-head: child matched parent's desired head synsem:"
                                     (strip-refs (get-in parent [:head :synsem]))))

               debug (log/trace (str " resulting sem: " (strip-refs (get-in result '(:synsem :sem)))))]
@@ -116,12 +116,12 @@
                                      (unifyc child
                                              {:synsem {:sem (lexfn-sem-impl (get-in child '(:synsem :sem) :top))}})
                                      [:synsem]))))
-              debug (log/warn (str "fail-path: " (get-fail-path (get-in parent [:head])
-                                                                child)))
-              debug (log/warn (str "  parent@" fail-path "="
+              debug (log/debug (str "fail-path: " (get-fail-path (get-in parent [:head])
+                                                                 child)))
+              debug (log/debug (str "  parent@" fail-path "="
                                     (get-in parent (concat [:head] fail-path))))
-              debug (log/warn (str "    head@" fail-path "="
-                                   (get-in child fail-path)))]
+              debug (log/debug (str "    head@" fail-path "="
+                                    (get-in child fail-path)))]
           :fail)))))

 ;; Might be useful to set the following variable to true,
@@ -225,6 +225,8 @@
 (defn overc [parent comp]
   "add given child as the comp child of the phrase: parent."

+  (throw (Exception. (str "GOT INTO OVERC.")))
+
   (log/debug (str "set? parent:" (set? parent)))
   (log/debug (str "seq? parent:" (seq? parent)))
   (log/debug (str "seq? comp:" (seq? comp)))


small refactors

small refactors

--- src/chat/server/db.clj
+++ src/chat/server/db.clj
@@ -662,11 +662,10 @@
               [?sub :user/subscribed-tag ?t]
               [?th :thread/tag ?t]]
             (d/db *conn*) user-id)
-       (reduce (fn [memo [tag-id threads-count subscribers-count]]
-                 (assoc memo tag-id
-                   {:tag/threads-count threads-count
-                    :tag/subscribers-count subscribers-count}))
-               {})))
+       (map (fn [tag-id threads-count subscribers-count]
+              [tag-id {:tag/threads-count threads-count
+                       :tag/subscribers-count subscribers-count}]))
+       (into {})))

 (defn fetch-tags-for-user
   "Get all tags visible to the given user"
@@ -684,7 +683,7 @@
               (d/db *conn*) user-id)
          (map (fn [[tag]]
                 (db->tag (merge tag (tag-stats (tag :tag/id))))))
-         set)))
+         (into #{}))))

 (defn threads-with-tag
   "Find threads with a given tag that the user is allowed to see, ordered by most recent message.
@@ -701,9 +700,9 @@
                               (d/db *conn*) tag-id)
         thread-eids (->> all-thread-eids
                          (sort-by second #(compare %2 %1))
+                         (map first)
                          (drop skip)
-                         (take limit)
-                         (map first))]
+                         (take limit))]
     {:threads (->> (d/pull-many (d/db *conn*) thread-pull-pattern thread-eids)
                    (map db->thread)
                    (filter (fn [thread] (user-can-see-thread? user-id (thread :id)))))


use datomic scalar query

use datomic scalar query

--- src/chat/server/db.clj
+++ src/chat/server/db.clj
@@ -197,8 +197,9 @@

 (defn email-taken?
   [email]
-  (-> (d/q '[:find ?e :in $ ?email :where [?e :user/email ?email]] (d/db *conn*) email)
-      first
+  (-> (d/q '[:find ?e .
+             :in $ ?email
+             :where [?e :user/email ?email]] (d/db *conn*) email)
       some?))

 (defn create-user!


fix format of pending invites

fix format of pending invites

--- src/chat/server/db.clj
+++ src/chat/server/db.clj
@@ -343,14 +343,15 @@

 (defn fetch-invitations-for-user
   [user-id]
-  (d/q '[:find (pull ?i [{:invite/group [:group/id]}
-                         {:invite/from [:user/id]}])
-         :in $ ?user-id
-         :where
-         [?u :user/id ?user-id]
-         [?u :user/email ?email]
-         [?i :invite/to ?email]]
-       (d/db *conn*) user-id))
+  (->> (d/q '[:find (pull ?i [{:invite/group [:group/id :group/name]}
+                              {:invite/from [:user/id :user/email]}])
+              :in $ ?user-id
+              :where
+              [?u :user/id ?user-id]
+              [?u :user/email ?email]
+              [?i :invite/to ?email]]
+            (d/db *conn*) user-id)
+       (map first)))

 (defn fetch-messages
   "This almost certainly shouldn't be called outside of tests"


it's no need to export spacing function

it's no need to export spacing function

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/coldnew/pangu.cljc
+++ src/coldnew/pangu.cljc
@@ -1,7 +1,7 @@
 (ns coldnew.pangu
   (:require [coldnew.pangu.impl :as impl]))

-(defn ^:export spacing
+(defn spacing
   "Performs a paranoid text spacing on str."
   [str]
   (->> str


also show the Thread$State

also show the Thread$State

--- src/bzzz/core.clj
+++ src/bzzz/core.clj
@@ -140,7 +140,7 @@
       :get (case uri
              "/_stat" (stat)
              "/_stack" (into {} (for [[^Thread t traces] (Thread/getAllStackTraces)]
-                                  [(str (.getName t) "@" (.getId t))
+                                  [(str (.getName t) "@" (.getId t) "-" (.toString ^Thread$State (.getState t)))
                                    (into [] (for [^StackTraceElement s traces]
                                               (.toString s)))]))
              "/favicon.ico" "" ;; XXX


Make ws client configurable

Make ws client configurable

This PR allows user to set policies such as idle timeout, max msg size
etc.

--- src/clj_chrome_devtools/impl/connection.clj
+++ src/clj_chrome_devtools/impl/connection.clj
@@ -91,23 +91,28 @@
       (throw (ex-info "No debuggable pages found"
                       {:pages pages}))))

+(defn- make-ws-client [ & [{:keys [idle-timeout max-msg-size-mb]
+                            :or {idle-timeout 0
+                                 max-msg-size-mb (* 1024 1024)}}]]
+  (let [client (ws/client)]
+    (doto (.getPolicy client)
+      (.setIdleTimeout idle-timeout)
+      (.setMaxTextMessageSize max-msg-size-mb))
+    client))
+
 (defn connect-url
   "Establish a websocket connection to web-socket-debugger-url, as given by
    inspectable-pages."
-  [web-socket-debugger-url]
+  [web-socket-debugger-url & [ws-client]]
   (assert web-socket-debugger-url)
-  (let [client     (ws/client)
+  (let [client     (or ws-client
+                       (make-ws-client))
         ;; Request id to callback
         requests   (atom {})

         ;; Event pub/sub channel
         event-chan (async/chan)
         event-pub  (async/pub event-chan (juxt :domain :event))]
-
-    ;; Configure max message size to 1mb (default 64kb is way too small)
-    (doto (.getPolicy client)
-      (.setIdleTimeout 0)
-      (.setMaxTextMessageSize (* 1024 1024)))

     (.start client)
     (->Connection (ws/connect web-socket-debugger-url
@@ -127,11 +132,13 @@
   ([host port]
    (connect host port 1000))
   ([host port max-wait-time-ms]
+   (connect host port max-wait-time-ms (make-ws-client)))
+  ([host port max-wait-time-ms ws-client]
    (when max-wait-time-ms
      (wait-for-remote-debugging-port host port max-wait-time-ms))
     (let [url (-> (inspectable-pages host port)
                   (first-inspectable-page))]
-      (connect-url url))))
+      (connect-url url ws-client))))

 (defn send-command [{requests :requests con :ws-connection} payload id callback]
   (swap! requests assoc id callback)


Found issue with ago-loop init, so avoiding for now.

--- src/cbfg/npr.cljs
+++ src/cbfg/npr.cljs
@@ -28,27 +28,29 @@
   (client-snapshot-end [this actx stream-request snapshot-beg snapshot-end])
   (client-snapshot-item [this actx stream-request snapshot-beg snapshot-item]))

-(defn make-npr-server-session [actx server stream-request to-client-ch]
-  (ago-loop npr-server-session actx
-            [stream-request stream-request
-             snapshot (server-take-snapshot server actx stream-request nil)
-             num-snapshots 0]
-            (println "server-session" snapshot num-snapshots)
-            (cond
-             (nil? snapshot) (aput-close npr-server-session to-client-ch
-                                         (assoc stream-request :status :ok))
-             (snapshot-rollback? snapshot) (aput-close npr-server-session to-client-ch
-                                                       (stream-request-rollback-msg stream-request snapshot))
-             :else (when (aput npr-server-session to-client-ch
-                               (stream-request-snapshot-beg-msg stream-request snapshot))
-                     (doseq [item (snapshot-items snapshot)]
-                       (aput npr-server-session to-client-ch
-                             (stream-request-snapshot-item-msg stream-request snapshot item)))
-                     (when (aput npr-server-session to-client-ch
-                                 (stream-request-snapshot-end-msg stream-request snapshot))
-                       (recur stream-request
-                              (server-take-snapshot server actx stream-request snapshot)
-                              (inc num-snapshots)))))))
+(defn make-npr-server-session [actx server stream-request-in to-client-ch]
+  (println "MAKE npr-server-session" snapshot num-snapshots)
+  (let [snapshot (server-take-snapshot server actx stream-request-in nil)]
+    (ago-loop npr-server-session actx
+              [stream-request stream-request-in
+               snapshot snapshot-in
+               num-snapshots 0]
+              (println "server-session" snapshot num-snapshots)
+              (cond
+               (nil? snapshot) (aput-close npr-server-session to-client-ch
+                                           (assoc stream-request :status :ok))
+               (snapshot-rollback? snapshot) (aput-close npr-server-session to-client-ch
+                                                         (stream-request-rollback-msg stream-request snapshot))
+               :else (when (aput npr-server-session to-client-ch
+                                 (stream-request-snapshot-beg-msg stream-request snapshot))
+                       (doseq [item (snapshot-items snapshot)]
+                         (aput npr-server-session to-client-ch
+                               (stream-request-snapshot-item-msg stream-request snapshot item)))
+                       (when (aput npr-server-session to-client-ch
+                                   (stream-request-snapshot-end-msg stream-request snapshot))
+                         (recur stream-request
+                                (server-take-snapshot server actx stream-request snapshot)
+                              (inc num-snapshots))))))))

 (defn npr-client-loop [actx client stream-request snapshot-beg-in out from-server-ch]
   (ago-loop npr-client-loop actx


layout: compute (some) edges.

layout: compute (some) edges.

--- src/cfg/core.cljs
+++ src/cfg/core.cljs
@@ -225,8 +225,23 @@
        operands-size)))

+(defn compute-edges
+  [basic-blocks]
+  (remove nil?
+          (concat
+            (for [bb basic-blocks]
+              (when (:jump bb)
+                {:src (:addr bb) :dst (:jump bb) :type :jump}))
+            (for [bb basic-blocks]
+              (when (:fail bb)
+                [:src (:addr bb) :dst (:fail bb) :type :fail])))))
+
+
 (defn layout-cfg
   [basic-blocks]
+  (cmn/d basic-blocks)
+  (let [edges (compute-edges basic-blocks)]
+    (cmn/d edges))
   (map-indexed (fn [i bb]
                  (merge bb {:x i :y i
                             :width (compute-bb-width bb)


Fix previous commit

Fix previous commit

--- src/cljs/map.cljs
+++ src/cljs/map.cljs
@@ -76,8 +76,8 @@
         sh (dom/by-id "showhere")]
     ;; FIXME: first switch to https for panoramap.org
     ;; http://stackoverflow.com/questions/32106849/getcurrentposition-and-watchposition-are-deprecated-on-insecure-origins
-    ;; (when (= local 1)
-    (.getCurrentPosition (.-geolocation js/navigator) geolocalize))
+    (when (= local 1)
+      (.getCurrentPosition (.-geolocation js/navigator) geolocalize))
     (set! (.-onclick stop) #(set! stopper "stop"))
     (set! (.-onclick sh)
           #(let [z (.getZoom mymap)]


Add a timeout when loading markers.

Add a timeout when loading markers.

It works fine with chromium, but there is still something wrong
with recent version of Firefox.

--- src/cljs/map.cljs
+++ src/cljs/map.cljs
@@ -1,14 +1,14 @@
 (ns wlmmap.map
   (:require [mrhyde.extend-js]
             [blade :refer [L]]
-            [cljs.core.async :refer [chan <! >!]]
+            [cljs.core.async :refer [chan <! >! timeout]]
             [shoreleave.remotes.http-rpc :refer [remote-callback]])
   (:require-macros [cljs.core.async.macros :refer [go]]))

 (blade/bootstrap)

 (def mymap (-> L .-mapbox (.map "map" "examples.map-uci7ul8p")
-      (.setView [45 3.215] 5)))
+               (.setView [45 3.215] 5)))

 (def markers (L/MarkerClusterGroup.))

@@ -19,15 +19,17 @@
                 lng (last (first a))
                 title (last a)
                 icon ((get-in L [:mapbox :marker :icon])
-                      {:marker-symbol "post" :marker-color "0044FF"})
-                marker (-> L (.marker (L/LatLng. lat lng) {:icon icon :title title}))]
+                      {:marker-symbol "" :marker-color "0044FF"})
+                marker (-> L (.marker (L/LatLng. lat lng)
+                                      {:icon icon}))]
             (.bindPopup marker title)
-            (.addLayer markers marker))
-          (.addLayer mymap markers))))
-  (remote-callback
-   :get-markers []
-   #(doseq [a %] (go (>! ch a)))))
+            (.addLayer markers marker)))))
+  (remote-callback :get-markers []
+                   #(go (doseq [a %]
+                          (<! (timeout 1))
+                          (>! ch a)))))

+(.addLayer mymap markers)

 ;; FIXME: get language
 ;; (js/alert (.-language js/navigator))


Allow user defined mktemp patterns

Allow user defined mktemp patterns

--- plugins/matross/tasks/temp_file.clj
+++ plugins/matross/tasks/temp_file.clj
@@ -3,8 +3,8 @@
             [clojure.string :refer [trim-newline]] [me.raynes.conch.low-level :refer [stream-to-string]]))

 (defn temp-file-command "Generates the mktemp shell command for the given options"
-  [{:keys [temp-dir] :or {temp-dir "/tmp"}}]
-  (str "mktemp " temp-dir "/matross.XXXXXX"))
+  [{:keys [temp-dir pattern] :or {temp-dir "/tmp" pattern "matross.XXXXXX"}}]
+  (str "mktemp " temp-dir "/" pattern))

 (deftask temp-file
   "Creates  a temporary file on the target machine and returns the file path in [:data :path]"


Whitespace.

Whitespace.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -234,15 +234,12 @@
        (- x y)))

 (def example-cmd-handlers
-  {"add"
-   (fn [cmd] {:rq #(example-add % (:x cmd) (:y cmd) (:delay cmd))
-              :fence (:fence cmd)})
-   "sub"
-   (fn [cmd] {:rq #(example-sub % (:x cmd) (:y cmd) (:delay cmd))
-              :fence (:fence cmd)})
-   "test"
-   (fn [cmd] {:rq #(cbfg.fence/test %)
-              :fence (:fence cmd)})})
+  {"add"  (fn [cmd] {:rq #(example-add % (:x cmd) (:y cmd) (:delay cmd))
+                     :fence (:fence cmd)})
+   "sub"  (fn [cmd] {:rq #(example-sub % (:x cmd) (:y cmd) (:delay cmd))
+                     :fence (:fence cmd)})
+   "test" (fn [cmd] {:rq #(cbfg.fence/test %)
+                     :fence (:fence cmd)})})

 (vis-init (map< (fn [ev] {:op (.-id (.-target ev))
                           :x (js/parseInt (get-el-value "x"))


fix proper noun lexical filter

fix proper noun lexical filter

--- src/babel/english/grammar.clj
+++ src/babel/english/grammar.clj
@@ -509,7 +509,7 @@
                 (for [[k v] @lexicon]
                   (let [filtered-v
                         (filter #(or (= (get-in % [:synsem :cat]) :verb)
-                                     (= (get-in % [:synsem :propernoun]) true)
+                                     (= (get-in % [:synsem :sem :propernoun]) true)
                                      (= (get-in % [:synsem :cat]) :noun)
                                      (= (get-in % [:synsem :pronoun]) true)
                                      (= (get-in % [:synsem :cat]) :det))


Use advanced damage calculations

Use advanced damage calculations

--- src/dungeon_crusade/combat.clj
+++ src/dungeon_crusade/combat.clj
@@ -9,6 +9,11 @@
             [taoensso.timbre :as timbre]))

 (timbre/refer-timbre)
+
+(defn uniform-rand
+  [minimum maximum]
+  {:pre [(< minimum maximum)]}
+  (+ (rand (- maximum minimum)) minimum))

 (defn- vec-match?
   [v0 v1]
@@ -91,309 +96,189 @@
     [:bat        :bite         :human      :foot]      (+  (rand)  0.5)
     [:bat        :bite         :human      :head]      (+  (rand)  0.5)
     [:bat        :bite         :human      :leg]       (+  (rand)  0.5)
-    [:bat        :bite         :human      :neck]      (+  (rand)  0.5)
-    [:bird       :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:bird       :bite         :human      :arm]       (+  (rand)  0.5)
-    [:bird       :bite         :human      :face]      (+  (rand)  0.5)
-    [:bird       :bite         :human      :foot]      (+  (rand)  0.5)
-    [:bird       :bite         :human      :head]      (+  (rand)  0.5)
-    [:bird       :bite         :human      :leg]       (+  (rand)  0.5)
-    [:bird       :bite         :human      :neck]      (+  (rand)  0.5)
+    [:bat        :bite         :human      :neck]      (+  (rand)  0.9)
+    [:bird       :bite         :human      :*]         (+  (* (rand) 0.5)  0.5)
     [:bird       :claw         :human      :abdomen]   (+  (rand)  0.5)
-    [:bird       :claw         :human      :arm]       (+  (rand)  0.5)
-    [:bird       :claw         :human      :face]      (+  (rand)  0.5)
-    [:bird       :claw         :human      :foot]      (+  (rand)  0.5)
-    [:bird       :claw         :human      :head]      (+  (rand)  0.5)
-    [:bird       :claw         :human      :leg]       (+  (rand)  0.5)
-    [:bird       :claw         :human      :neck]      (+  (rand)  0.5)
-    [:boar       :bite         :human      :abdomen]   (+  (rand)  0.5)
+    [:bird       :claw         :human      :face]      (+  (rand)  0.8)
+    [:bird       :claw         :human      :neck]      (+  (rand)  0.7)
+    [:bird       :claw         :human      :*]         (+  (rand)  0.5)
+    [:boar       :bite         :human      :abdomen]   (+  (* 2.0 (rand))  0.5)
     [:boar       :bite         :human      :arm]       (+  (rand)  0.5)
-    [:boar       :bite         :human      :face]      (+  (rand)  0.5)
+    [:boar       :bite         :human      :face]      (+  (rand)  1.5)
     [:boar       :bite         :human      :foot]      (+  (rand)  0.5)
-    [:boar       :bite         :human      :head]      (+  (rand)  0.5)
-    [:boar       :bite         :human      :leg]       (+  (rand)  0.5)
-    [:boar       :bite         :human      :neck]      (+  (rand)  0.5)
-    [:boar       :gore         :human      :abdomen]   (+  (rand)  0.5)
-    [:boar       :gore         :human      :arm]       (+  (rand)  0.5)
-    [:boar       :gore         :human      :face]      (+  (rand)  0.5)
-    [:boar       :gore         :human      :foot]      (+  (rand)  0.5)
-    [:boar       :gore         :human      :head]      (+  (rand)  0.5)
-    [:boar       :gore         :human      :leg]       (+  (rand)  0.5)
-    [:boar       :gore         :human      :neck]      (+  (rand)  0.5)
-    [:centipede  :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:centipede  :bite         :human      :arm]       (+  (rand)  0.5)
-    [:centipede  :bite         :human      :face]      (+  (rand)  0.5)
-    [:centipede  :bite         :human      :foot]      (+  (rand)  0.5)
-    [:centipede  :bite         :human      :head]      (+  (rand)  0.5)
-    [:centipede  :bite         :human      :leg]       (+  (rand)  0.5)
-    [:centipede  :bite         :human      :neck]      (+  (rand)  0.5)
-    [:clam       :clamp        :human      :abdomen]   (+  (rand)  0.5)
-    [:clam       :clamp        :human      :arm]       (+  (rand)  0.5)
-    [:clam       :clamp        :human      :face]      (+  (rand)  0.5)
-    [:clam       :clamp        :human      :foot]      (+  (rand)  0.5)
-    [:clam       :clamp        :human      :head]      (+  (rand)  0.5)
-    [:clam       :clamp        :human      :leg]       (+  (rand)  0.5)
-    [:clam       :clamp        :human      :neck]      (+  (rand)  0.5)
-    [:fish       :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:fish       :bite         :human      :arm]       (+  (rand)  0.5)
-    [:fish       :bite         :human      :face]      (+  (rand)  0.5)
-    [:fish       :bite         :human      :foot]      (+  (rand)  0.5)
-    [:fish       :bite         :human      :head]      (+  (rand)  0.5)
-    [:fish       :bite         :human      :leg]       (+  (rand)  0.5)
-    [:fish       :bite         :human      :neck]      (+  (rand)  0.5)
-    [:frog       :claw         :human      :abdomen]   (+  (rand)  0.5)
-    [:frog       :claw         :human      :arm]       (+  (rand)  0.5)
-    [:frog       :claw         :human      :face]      (+  (rand)  0.5)
-    [:frog       :claw         :human      :foot]      (+  (rand)  0.5)
-    [:frog       :claw         :human      :head]      (+  (rand)  0.5)
-    [:frog       :claw         :human      :leg]       (+  (rand)  0.5)
-    [:frog       :claw         :human      :neck]      (+  (rand)  0.5)
-    [:gecko      :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:gecko      :bite         :human      :arm]       (+  (rand)  0.5)
-    [:gecko      :bite         :human      :face]      (+  (rand)  0.5)
-    [:gecko      :bite         :human      :foot]      (+  (rand)  0.5)
-    [:gecko      :bite         :human      :head]      (+  (rand)  0.5)
-    [:gecko      :bite         :human      :leg]       (+  (rand)  0.5)
-    [:gecko      :bite         :human      :neck]      (+  (rand)  0.5)
+    [:boar       :bite         :human      :head]      (+  (rand)  1.5)
+    [:boar       :bite         :human      :leg]       (+  (rand)  0.8)
+    [:boar       :bite         :human      :neck]      (+  (rand)  1.5)
+    [:boar       :gore         :human      :abdomen]   (+  (rand)  2.5)
+    [:boar       :gore         :human      :arm]       (+  (rand)  1.5)
+    [:boar       :gore         :human      :face]      (+  (rand)  3.5)
+    [:boar       :gore         :human      :foot]      (+  (rand)  1.5)
+    [:boar       :gore         :human      :head]      (+  (rand)  3.5)
+    [:boar       :gore         :human      :leg]       (+  (rand)  2.5)
+    [:boar       :gore         :human      :neck]      (+  (rand)  3.5)
+    [:centipede  :bite         :human      :*]         (+  (* (rand) 0.5)  0.5)
+    [:clam       :clamp        :human      :*]         (+  (* (rand) 0.2)  0.1)
+    [:fish       :bite         :human      :*]         (+  (* (rand) 0.5)  0.2)
+    [:frog       :claw         :human      :*]         (+  (* (rand) 0.3)  0.1)
+    [:gecko      :bite         :human      :*]         (+  (* (rand) 0.2)  0.1)
     [:human      :punch        :bat        :body]      (+  (rand)  0.5)
-    [:human      :punch        :bat        :face]      (+  (rand)  0.5)
-    [:human      :punch        :bat        :head]      (+  (rand)  0.5)
-    [:human      :punch        :bat        :leg]       (+  (rand)  0.5)
-    [:human      :punch        :bat        :wing]      (+  (rand)  0.5)
+    [:human      :punch        :bat        #{:face
+                                             :head}]   (+  (rand)  0.8)
+    [:human      :punch        :bat        :leg]       (+  (rand)  0.2)
+    [:human      :punch        :bat        :wing]      (+  (rand)  0.8)
     [:human      :punch        :bird       :beak]      (+  (rand)  0.5)
     [:human      :punch        :bird       :body]      (+  (rand)  0.5)
     [:human      :punch        :bird       :head]      (+  (rand)  0.5)
-    [:human      :punch        :bird       :leg]       (+  (rand)  0.5)
+    [:human      :punch        :bird       :leg]       (+  (* (rand) 0.5) 0.5)
     [:human      :punch        :bird       :tail]      (+  (rand)  0.5)
-    [:human      :punch        :bird       :wing]      (+  (rand)  0.5)
+    [:human      :punch        :bird       :wing]      (+  (rand) 1.5)
     [:human      :punch        :boar       :body]      (+  (rand)  0.5)
-    [:human      :punch        :boar       :eye]       (+  (rand)  0.5)
-    [:human      :punch        :boar       :face]      (+  (rand)  0.5)
-    [:human      :punch        :boar       :head]      (+  (rand)  0.5)
-    [:human      :punch        :boar       :leg]       (+  (rand)  0.5)
-    [:human      :punch        :boar       :snout]     (+  (rand)  0.5)
-    [:human      :punch        :boar       :tail]      (+  (rand)  0.5)
-    [:human      :punch        :centipede  :body]      (+  (rand)  0.5)
-    [:human      :punch        :centipede  :head]      (+  (rand)  0.5)
-    [:human      :punch        :centipede  :leg]       (+  (rand)  0.5)
+    [:human      :punch        :boar       :eye]       (+  (rand)  2.5)
+    [:human      :punch        :boar       :face]      (+  (rand)  0.9)
+    [:human      :punch        :boar       :head]      (+  (rand)  0.3)
+    [:human      :punch        :boar       :leg]       (+  (rand)  0.7)
+    [:human      :punch        :boar       :snout]     (+  (rand)  0.7)
+    [:human      :punch        :boar       :tail]      (+  (* (rand) 0.6)  0.1)
+    [:human      :punch        :centipede  #{:body
+                                             :head}]   (+  (rand)  0.9)
+    [:human      :punch        :centipede  :leg]       (+  (* (rand) 0.2)  0.1)
     [:human      :punch        :clam       :shell]     (+  (rand)  0.5)
-    [:human      :punch        :fish       :body]      (+  (rand)  0.5)
-    [:human      :punch        :fish       :fin]       (+  (rand)  0.5)
-    [:human      :punch        :fish       :head]      (+  (rand)  0.5)
-    [:human      :punch        :fish       :tail]      (+  (rand)  0.5)
-    [:human      :punch        :frog       :body]      (+  (rand)  0.5)
-    [:human      :punch        :frog       :face]      (+  (rand)  0.5)
-    [:human      :punch        :frog       :head]      (+  (rand)  0.5)
-    [:human      :punch        :frog       :leg]       (+  (rand)  0.5)
-    [:human      :punch        :gecko      :body]      (+  (rand)  0.5)
-    [:human      :punch        :gecko      :face]      (+  (rand)  0.5)
-    [:human      :punch        :gecko      :head]      (+  (rand)  0.5)
-    [:human      :punch        :gecko      :leg]       (+  (rand)  0.5)
-    [:human      :punch        :gecko      :tail]      (+  (rand)  0.5)
-    [:human      :punch        :monkey     :arm]       (+  (rand)  0.5)
-    [:human      :punch        :monkey     :body]      (+  (rand)  0.5)
-    [:human      :punch        :monkey     :face]      (+  (rand)  0.5)
-    [:human      :punch        :monkey     :head]      (+  (rand)  0.5)
-    [:human      :punch        :monkey     :leg]       (+  (rand)  0.5)
-    [:human      :punch        :monkey     :neck]      (+  (rand)  0.5)
-    [:human      :punch        :monkey     :tail]      (+  (rand)  0.5)
-    [:human      :punch        :octopus    :body]      (+  (rand)  0.5)
-    [:human      :punch        :octopus    :head]      (+  (rand)  0.5)
+    [:human      :punch        :fish       #{:body
+                                             :head}]   (+  (rand)  0.5)
+    [:human      :punch        :fish       #{:fin
+                                             :tail}]   (+  (* (rand) 0.6) 0.5)
+    [:human      :punch        :frog       :*]         (+  (rand)  0.5)
+    [:human      :punch        :gecko      :*]         (+  (rand)  0.5)
+    [:human      :punch        :monkey     #{:arm
+                                             :leg}]       (+  (rand)  0.5)
+    [:human      :punch        :monkey     #{:body
+                                             :face
+                                             :head
+                                             :neck}]   (+  (rand)  0.5)
+    [:human      :punch        :monkey     :tail]      (+  (* (rand) 0.5)  0.5)
+    [:human      :punch        :octopus    #{:body
+                                             :head}]   (+  (rand)  1.5)
     [:human      :punch        :octopus    :tentacle]  (+  (rand)  0.5)
-    [:human      :punch        :parrot     :body]      (+  (rand)  0.5)
-    [:human      :punch        :parrot     :face]      (+  (rand)  0.5)
-    [:human      :punch        :parrot     :head]      (+  (rand)  0.5)
-    [:human      :punch        :parrot     :leg]       (+  (rand)  0.5)
-    [:human      :punch        :parrot     :tail]      (+  (rand)  0.5)
-    [:human      :punch        :parrot     :wing]      (+  (rand)  0.5)
-    [:human      :punch        :rat        :body]      (+  (rand)  0.5)
-    [:human      :punch        :rat        :face]      (+  (rand)  0.5)
-    [:human      :punch        :rat        :head]      (+  (rand)  0.5)
-    [:human      :punch        :rat        :leg]       (+  (rand)  0.5)
-    [:human      :punch        :rat        :neck]      (+  (rand)  0.5)
-    [:human      :punch        :rat        :tail]      (+  (rand)  0.5)
-    [:human      :punch        :scorpion   :abdomen]   (+  (rand)  0.5)
-    [:human      :punch        :scorpion   :claw]      (+  (rand)  0.5)
-    [:human      :punch        :scorpion   :head]      (+  (rand)  0.5)
-    [:human      :punch        :scorpion   :leg]       (+  (rand)  0.5)
-    [:human      :punch        :scorpion   :tail]      (+  (rand)  0.5)
-    [:human      :punch        :sea-snake  :body]      (+  (rand)  0.5)
-    [:human      :punch        :sea-snake  :head]      (+  (rand)  0.5)
-    [:human      :punch        :shark      :body]      (+  (rand)  0.5)
-    [:human      :punch        :shark      :fin]       (+  (rand)  0.5)
-    [:human      :punch        :shark      :head]      (+  (rand)  0.5)
-    [:human      :punch        :shark      :nose]      (+  (rand)  0.5)
-    [:human      :punch        :shark      :tail]      (+  (rand)  0.5)
-    [:human      :punch        :snake      :body]      (+  (rand)  0.5)
-    [:human      :punch        :snake      :head]      (+  (rand)  0.5)
-    [:human      :punch        :snake      :tail]      (+  (rand)  0.5)
-    [:human      :punch        :spider     :abdomen]   (+  (rand)  0.5)
-    [:human      :punch        :spider     :face]      (+  (rand)  0.5)
-    [:human      :punch        :spider     :leg]       (+  (rand)  0.5)
-    [:human      :punch        :squid      :body]      (+  (rand)  0.5)
-    [:human      :punch        :squid      :head]      (+  (rand)  0.5)
-    [:human      :punch        :squid      :tentacle]  (+  (rand)  0.5)
-    [:human      :punch        :turtle     :body]      (+  (rand)  0.5)
-    [:human      :punch        :turtle     :face]      (+  (rand)  0.5)
-    [:human      :punch        :turtle     :head]      (+  (rand)  0.5)
-    [:human      :punch        :turtle     :leg]       (+  (rand)  0.5)
-    [:human      :punch        :turtle     :neck]      (+  (rand)  0.5)
-    [:human      :punch        :turtle     :shell]     (+  (rand)  0.5)
-    [:human      :punch        :urchin     :body]      (+  (rand)  0.5)
-    [:monkey     :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:monkey     :bite         :human      :arm]       (+  (rand)  0.5)
-    [:monkey     :bite         :human      :face]      (+  (rand)  0.5)
-    [:monkey     :bite         :human      :foot]      (+  (rand)  0.5)
-    [:monkey     :bite         :human      :head]      (+  (rand)  0.5)
-    [:monkey     :bite         :human      :leg]       (+  (rand)  0.5)
-    [:monkey     :bite         :human      :neck]      (+  (rand)  0.5)
-    [:monkey     :punch        :human      :abdomen]   (+  (rand)  0.5)
-    [:monkey     :punch        :human      :arm]       (+  (rand)  0.5)
-    [:monkey     :punch        :human      :face]      (+  (rand)  0.5)
-    [:monkey     :punch        :human      :foot]      (+  (rand)  0.5)
-    [:monkey     :punch        :human      :head]      (+  (rand)  0.5)
-    [:monkey     :punch        :human      :leg]       (+  (rand)  0.5)
-    [:monkey     :punch        :human      :neck]      (+  (rand)  0.5)
-    [:octopus    :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:octopus    :bite         :human      :arm]       (+  (rand)  0.5)
-    [:octopus    :bite         :human      :face]      (+  (rand)  0.5)
-    [:octopus    :bite         :human      :foot]      (+  (rand)  0.5)
-    [:octopus    :bite         :human      :head]      (+  (rand)  0.5)
-    [:octopus    :bite         :human      :leg]       (+  (rand)  0.5)
-    [:octopus    :bite         :human      :neck]      (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :abdomen]   (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :arm]       (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :face]      (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :foot]      (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :head]      (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :leg]       (+  (rand)  0.5)
-    [:octopus    :bite-venom   :human      :neck]      (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :abdomen]   (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :arm]       (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :face]      (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :foot]      (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :head]      (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :leg]       (+  (rand)  0.5)
-    [:octopus    :squeeze      :human      :neck]      (+  (rand)  0.5)
-    [:parrot     :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:parrot     :bite         :human      :arm]       (+  (rand)  0.5)
-    [:parrot     :bite         :human      :face]      (+  (rand)  0.5)
-    [:parrot     :bite         :human      :foot]      (+  (rand)  0.5)
-    [:parrot     :bite         :human      :head]      (+  (rand)  0.5)
-    [:parrot     :bite         :human      :leg]       (+  (rand)  0.5)
-    [:parrot     :bite         :human      :neck]      (+  (rand)  0.5)
-    [:parrot     :claw         :human      :abdomen]   (+  (rand)  0.5)
-    [:parrot     :claw         :human      :arm]       (+  (rand)  0.5)
-    [:parrot     :claw         :human      :face]      (+  (rand)  0.5)
-    [:parrot     :claw         :human      :foot]      (+  (rand)  0.5)
-    [:parrot     :claw         :human      :head]      (+  (rand)  0.5)
-    [:parrot     :claw         :human      :leg]       (+  (rand)  0.5)
-    [:parrot     :claw         :human      :neck]      (+  (rand)  0.5)
-    [:rat        :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:rat        :bite         :human      :arm]       (+  (rand)  0.5)
-    [:rat        :bite         :human      :face]      (+  (rand)  0.5)
-    [:rat        :bite         :human      :foot]      (+  (rand)  0.5)
-    [:rat        :bite         :human      :head]      (+  (rand)  0.5)
-    [:rat        :bite         :human      :leg]       (+  (rand)  0.5)
-    [:rat        :bite         :human      :neck]      (+  (rand)  0.5)
-    [:rat        :claw         :human      :abdomen]   (+  (rand)  0.5)
-    [:rat        :claw         :human      :arm]       (+  (rand)  0.5)
-    [:rat        :claw         :human      :face]      (+  (rand)  0.5)
-    [:rat        :claw         :human      :foot]      (+  (rand)  0.5)
-    [:rat        :claw         :human      :head]      (+  (rand)  0.5)
-    [:rat        :claw         :human      :leg]       (+  (rand)  0.5)
-    [:rat        :claw         :human      :neck]      (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :arm]       (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :face]      (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :foot]      (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :head]      (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :leg]       (+  (rand)  0.5)
-    [:scorpion   :bite         :human      :neck]      (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :abdomen]   (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :arm]       (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :face]      (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :foot]      (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :head]      (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :leg]       (+  (rand)  0.5)
-    [:scorpion   :claw         :human      :neck]      (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :abdomen]   (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :arm]       (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :face]      (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :foot]      (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :head]      (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :leg]       (+  (rand)  0.5)
-    [:scorpion   :sting-venom  :human      :neck]      (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :arm]       (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :face]      (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :foot]      (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :head]      (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :leg]       (+  (rand)  0.5)
-    [:sea-snake  :bite         :human      :neck]      (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :abdomen]   (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :arm]       (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :face]      (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :foot]      (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :head]      (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :leg]       (+  (rand)  0.5)
-    [:sea-snake  :bite-venom   :human      :neck]      (+  (rand)  0.5)
-    [:shark      :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:shark      :bite         :human      :arm]       (+  (rand)  0.5)
-    [:shark      :bite         :human      :face]      (+  (rand)  0.5)
-    [:shark      :bite         :human      :foot]      (+  (rand)  0.5)
-    [:shark      :bite         :human      :head]      (+  (rand)  0.5)
-    [:shark      :bite         :human      :leg]       (+  (rand)  0.5)
-    [:shark      :bite         :human      :neck]      (+  (rand)  0.5)
-    [:snake      :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:snake      :bite         :human      :arm]       (+  (rand)  0.5)
-    [:snake      :bite         :human      :face]      (+  (rand)  0.5)
-    [:snake      :bite         :human      :foot]      (+  (rand)  0.5)
-    [:snake      :bite         :human      :head]      (+  (rand)  0.5)
-    [:snake      :bite         :human      :leg]       (+  (rand)  0.5)
-    [:snake      :bite         :human      :neck]      (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :abdomen]   (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :arm]       (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :face]      (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :foot]      (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :head]      (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :leg]       (+  (rand)  0.5)
-    [:snake      :bite-venom   :human      :neck]      (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :abdomen]   (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :arm]       (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :face]      (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :foot]      (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :head]      (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :leg]       (+  (rand)  0.5)
-    [:spider     :bite-venom   :human      :neck]      (+  (rand)  0.5)
-    [:squid      :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:squid      :bite         :human      :arm]       (+  (rand)  0.5)
-    [:squid      :bite         :human      :face]      (+  (rand)  0.5)
-    [:squid      :bite         :human      :foot]      (+  (rand)  0.5)
-    [:squid      :bite         :human      :head]      (+  (rand)  0.5)
-    [:squid      :bite         :human      :leg]       (+  (rand)  0.5)
-    [:squid      :bite         :human      :neck]      (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :abdomen]   (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :arm]       (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :face]      (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :foot]      (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :head]      (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :leg]       (+  (rand)  0.5)
-    [:squid      :squeeze      :human      :neck]      (+  (rand)  0.5)
-    [:turtle     :bite         :human      :abdomen]   (+  (rand)  0.5)
-    [:turtle     :bite         :human      :arm]       (+  (rand)  0.5)
-    [:turtle     :bite         :human      :face]      (+  (rand)  0.5)
-    [:turtle     :bite         :human      :foot]      (+  (rand)  0.5)
-    [:turtle     :bite         :human      :head]      (+  (rand)  0.5)
-    [:turtle     :bite         :human      :leg]       (+  (rand)  0.5)
-    [:turtle     :bite         :human      :neck]      (+  (rand)  0.5)
-    [:urchin     :spike        :human      :abdomen]   (+  (rand)  0.5)
-    [:urchin     :spike        :human      :arm]       (+  (rand)  0.5)
-    [:urchin     :spike        :human      :face]      (+  (rand)  0.5)
-    [:urchin     :spike        :human      :foot]      (+  (rand)  0.5)
-    [:urchin     :spike        :human      :head]      (+  (rand)  0.5)
-    [:urchin     :spike        :human      :leg]       (+  (rand)  0.5)
-    [:urchin     :spike        :human      :neck]      (+  (rand)  0.5)
+    [:human      :punch        :parrot     #{:body
+                                             :face
+                                             :head}]   (+  (rand)  0.5)
+    [:human      :punch        :parrot     #{:leg
+                                             :tail}]   (+  (* (rand) 0.7)  0.5)
+    [:human      :punch        :parrot     :wing]      (+  (rand)  0.8)
+    [:human      :punch        :rat        #{:body
+                                             :face
+                                             :head
+                                             :neck}]   (+  (rand)  0.5)
+    [:human      :punch        :rat        #{:leg
+                                             :tail}]   (+  (* (rand) 0.7)  0.5)
+    [:human      :punch        :scorpion   #{:abdomen
+                                             :head
+                                             :tail}]   (+  (rand)  0.9)
+    [:human      :punch        :scorpion   #{:claw
+                                             :leg}]    (+  (rand)  0.5)
+    [:human      :punch        :sea-snake  #{:body
+                                             :head}]   (+  (rand)  0.9)
+    [:human      :punch        :shark      #{:body
+                                             :head
+                                             :nose}]   (+  (rand)  0.5)
+    [:human      :punch        :shark      #{:fin
+                                             :tail}]   (+  (* (rand) 0.6)  0.5)
+    [:human      :punch        :snake      #{:body
+                                             :head
+                                             :tail}]   (+  (rand)  0.5)
+    [:human      :punch        :spider     #{:abdomen
+                                             :face}]   (+  (rand)  0.5)
+    [:human      :punch        :spider     #{:leg}]    (uniform-rand 0.5 1.5)
+    [:human      :punch        :squid      #{:body
+                                             :head
+                                             :tentacle}] (uniform-rand 0.5 1.5)
+    [:human      :punch        :turtle     #{:body
+                                             :face
+                                             :head
+                                             :neck}]   (uniform-rand 0.5 1.5)
+    [:human      :punch        :turtle     :leg]       (uniform-rand 0.5 1.5)
+    [:human      :punch        :turtle     :shell]     (uniform-rand 0.5 1.1)
+    [:human      :punch        :urchin     :body]      (uniform-rand 0.5 1.5)
+    [:monkey     :bite         :human      #{:abdomen
+                                             :head
+                                             :face}]   (uniform-rand 0.5 1.5)
+    [:monkey     :bite         :human      #{:arm
+                                             :foot
+                                             :leg}]    (uniform-rand 0.5 1.5)
+    [:monkey     :bite         :human      #{:neck
+                                             :abdomen
+                                             :face
+                                             :head}]   (uniform-rand 0.5 1.9)
+    [:monkey     :punch        :human      #{:arm
+                                             :foot
+                                             :leg}]    (uniform-rand 0.5 1.1)
+    [:monkey     :punch        :human      :neck]      (uniform-rand 0.5 1.8)
+    [:octopus    :bite         :human      #{:abdomen
+                                             :head
+                                             :neck
+                                             :face}]   (uniform-rand 0.5 1.5)
+    [:octopus    :bite         :human      #{:foot
+                                             :arm
+                                             :leg}]    (uniform-rand 0.5 1.5)
+    [:octopus    :bite-venom   :human      #{:abdomen
+                                             :face
+                                             :neck
+                                             :head}]   (uniform-rand 0.5 1.5)
+    [:octopus    :bite-venom   :human      #{:arm
+                                             :foot
+                                             :leg}]    (uniform-rand 0.5 1.5)
+    [:octopus    :squeeze      :human      :neck]      (uniform-rand 1.5 3.5)
+    [:octopus    :squeeze      :human      :*]         (uniform-rand 0.5 1.5)
+    [:parrot     :bite         :human      #{:abdomen
+                                             :head
+                                             :face
+                                             :neck}]   (uniform-rand 0.5 1.5)
+    [:parrot     :bite         :human      #{:arm
+                                             :foot
+                                             :leg}]    (uniform-rand 0.5 1.0)
+    [:parrot     :claw         :human      :*]         (uniform-rand 0.2 0.7)
+    [:rat        :bite         :human      #{:abdomen
+                                             :face
+                                             :head
+                                             :neck}]      (uniform-rand 0.5 1.5)
+    [:rat        :bite         :human      #{:arm
+                                             :foot
+                                             :leg}]       (uniform-rand 0.5 1.5)
+    [:rat        :claw         :human      :*]   (uniform-rand 0.5 1.5)
+    [:scorpion   :bite         :human      :face]      (uniform-rand 0.5 1.5)
+    [:scorpion   :bite         :human      :*]   (uniform-rand 0.5 1.5)
+    [:scorpion   :claw         :human      :*]   (uniform-rand 0.5 1.5)
+    [:scorpion   :sting-venom  :human      :abdomen]   (uniform-rand 0.5 1.5)
+    [:scorpion   :sting-venom  :human      :arm]       (uniform-rand 0.5 1.0)
+    [:scorpion   :sting-venom  :human      :face]      (uniform-rand 1.5 1.5)
+    [:scorpion   :sting-venom  :human      :foot]      (uniform-rand 0.5 0.9)
+    [:scorpion   :sting-venom  :human      :head]      (uniform-rand 1.0 1.5)
+    [:scorpion   :sting-venom  :human      :leg]       (uniform-rand 0.8 1.4)
+    [:scorpion   :sting-venom  :human      :neck]      (uniform-rand 1.0 1.5)
+    [:sea-snake  :bite         :human      :*]         (uniform-rand 0.5 1.1)
+    [:sea-snake  :bite-venom   :human      :abdomen]   (uniform-rand 0.6 1.5)
+    [:sea-snake  :bite-venom   :human      :arm]       (uniform-rand 0.6 1.3)
+    [:sea-snake  :bite-venom   :human      :face]      (uniform-rand 0.5 1.6)
+    [:sea-snake  :bite-venom   :human      :foot]      (uniform-rand 0.5 1.2)
+    [:sea-snake  :bite-venom   :human      :head]      (uniform-rand 0.7 1.5)
+    [:sea-snake  :bite-venom   :human      :leg]       (uniform-rand 0.5 1.2)
+    [:sea-snake  :bite-venom   :human      :neck]      (uniform-rand 0.8 1.5)
+    [:shark      :bite         :human      :abdomen]   (uniform-rand 2.5 4.5)
+    [:shark      :bite         :human      :arm]       (uniform-rand 1.5 3.5)
+    [:shark      :bite         :human      :face]      (uniform-rand 2.5 4.5)
+    [:shark      :bite         :human      :foot]      (uniform-rand 2.5 4.5)
+    [:shark      :bite         :human      :head]      (uniform-rand 2.5 5.5)
+    [:shark      :bite         :human      :leg]       (uniform-rand 2.5 4.5)
+    [:shark      :bite         :human      :neck]      (uniform-rand 1.5 3.5)
+    [:snake      :bite         :human      :*]         (uniform-rand 1.1 1.6)
+    [:snake      :bite-venom   :human      :*]         (uniform-rand 0.6 1.2)
+    [:squid      :bite         :human      :*]         (uniform-rand 0.5 2.5)
+    [:squid      :squeeze      :human      :neck]      (uniform-rand 1.5 2.5)
+    [:squid      :squeeze      :human      :*]         (uniform-rand 0.5 2.5)
+    [:turtle     :bite         :human      :*]         (uniform-rand 0.5 1.5)
+    [:urchin     :spike        :human      #{:head
+                                             :neck}]   (uniform-rand 0.9 1.5)
+    [:urchin     :spike        :human      :*]         (uniform-rand 0.5 1.2)
     [:* :* :* :*] (+ (rand) 0.5)))

 (defn attack


Support termseq

Support termseq

--- src/aerobio/server.clj
+++ src/aerobio/server.clj
@@ -77,10 +77,11 @@
    ;; Our parameter db
    [aerobio.params :as pams]
    ;; HTSeq
-   [aerobio.htseq.common :as cmn]
-   [aerobio.htseq.rnaseq :as htrs]
-   [aerobio.htseq.tnseq  :as htts]
-   [aerobio.htseq.wgseq  :as htws]
+   [aerobio.htseq.common  :as cmn]
+   [aerobio.htseq.rnaseq  :as htrs]
+   [aerobio.htseq.termseq :as httm]
+   [aerobio.htseq.tnseq   :as htts]
+   [aerobio.htseq.wgseq   :as htws]
    ;; Program graph construction, execution, delivery
    [aerobio.pgmgraph :as pg]
    ;; REST actions


Add clojush.translate to namespaces in clojush.ns, used with use-clojush.

--- src/clojush/ns.clj
+++ src/clojush/ns.clj
@@ -3,6 +3,8 @@
 (defmacro use-clojush
   []
   '(do
-     (use '(clojush args evaluate globals individual interpreter pushstate random simplification util))
-     (use '(clojush.instructions boolean code common numbers random-instructions return string tag zip))
+     (use '(clojush args evaluate globals individual interpreter pushstate random
+                    simplification translate util))
+     (use '(clojush.instructions boolean code common numbers random-instructions return string
+                                 tag zip))
      (use '(clojush.pushgp breed genetic-operators parent-selection pushgp report))))


Add better error reporting for exception monad.

--- src/cats/monad/exception.cljc
+++ src/cats/monad/exception.cljc
@@ -297,6 +297,9 @@
       (success v))

     (-mbind [_ s f]
+      (assert (exception? mv) (str "Context mismatch: " (p/-repr mv)
+                                   " is not allowed to use with exception context."))
+
       (if (success? s)
         (f (p/-extract s))
         s))


use new figwheel syntax

use new figwheel syntax

--- src/leiningen/new/reagent_liveedit/dev.cljs
+++ src/leiningen/new/reagent_liveedit/dev.cljs
@@ -7,10 +7,11 @@

 (enable-console-print!)

-(figwheel/watch-and-reload
-  :websocket-url "ws://localhost:3449/figwheel-ws"
-  :jsload-callback (fn [] (r/force-update-all)
-                     (testrunner/run-tests)))
+(figwheel/start
+ {:websocket-url "ws://localhost:3449/figwheel-ws"
+  :on-jsreload (fn []
+                 (r/force-update-all)
+                 (testrunner/run-tests))})

 (weasel/connect "ws://localhost:9001" :verbose true)


Make sleeping last longer

Make sleeping last longer

--- src/cljc/robinson/update.cljc
+++ src/cljc/robinson/update.cljc
@@ -1170,7 +1170,7 @@
   "Sleep."
   [state keyin]
   (let [d (rlos/sight-distance state)]
-    (if (> d 2)
+    (if (> d 4)
       (rw/assoc-current-state state :normal)
       (do-rest state))))