app: display all basic blocks when a function is selected.

not laid out, though.

--- src/cfg/core.cljs
+++ src/cfg/core.cljs
@@ -214,20 +214,25 @@
                                                      insns (map r2->insn (:response aoj))
                                                      changes (assoc basic-block :instructions insns)]
                                                  (update-model! [:basic-blocks addr] changes)))))))}))
-     (when (:selected-function (om/props this))
-       (let [fva (:selected-function (om/props this))
-             function (get-in (om/props this) [:functions fva])
-             basic-blocks (:basic-blocks function)]
-         (basic-block-list
-          (om/computed {:basic-blocks basic-blocks}
-                       {:select-bb #(update-model! {:selected-basic-block %})})))))
-    (when (:selected-basic-block (om/props this))
-      (let [bbva (:selected-basic-block (om/props this))
-            bb (get-in (om/props this) [:basic-blocks bbva])
-            insns (:instructions bb)]
+     (let [props (om/props this)]
+       (when (:selected-function props)
+         (let [fva (:selected-function props)
+               function (get-in props [:functions fva])
+               basic-blocks (:basic-blocks function)]
+           (basic-block-list
+            (om/computed {:basic-blocks basic-blocks}
+                         {:select-bb #(update-model! {:selected-basic-block %})}))))))
+    (when (:selected-function (om/props this))
+      (let [props (om/props this)
+            fva (:selected-function props)
+            function (get-in props [:functions fva])
+            basic-blocks (:basic-blocks function)]
         (canvas
-         {:props :none}
-         (basicblock {:instructions insns})))))))
+         {}
+         (for [bb basic-blocks]
+           (let [bbva (:addr bb)
+                 bb (get-in props [:basic-blocks bbva])]
+             (basicblock bb)))))))))

 (def app (om/factory App))


remove debug assert

remove debug assert

--- src/pc/email.clj
+++ src/pc/email.clj
@@ -202,7 +202,6 @@

 (defmethod send-entity-email :email/access-request-created
   [db email-enum eid]
-  (assert false)
   (if (mark-sent-email eid :email/access-request-created)
     (try+
       (log/infof "sending access-request email for %s" eid)


only log when the request has a remote-addr, ie it's a real request

--- src/spq/http.clj
+++ src/spq/http.clj
@@ -39,11 +39,12 @@
          s/take!
          (d/on-realized
           (fn [rep#] (let [[req#] ~args]
-                       (timbre/info (or (:status rep#) 500)
-                                    (str/upper-case (name (:request-method req#)))
-                                    (str (:uri req#) "?" (:query-string req#))
-                                    (format "%.2f%s" (/ (double (- (System/nanoTime) start#)) 1000000.0) "ms")
-                                    (:remote-addr req#))))
+                       (when (:remote-addr req#)
+                         (timbre/info (or (:status rep#) 500)
+                                      (str/upper-case (name (:request-method req#)))
+                                      (str (:uri req#) "?" (:query-string req#))
+                                      (format "%.2f%s" (/ (double (- (System/nanoTime) start#)) 1000000.0) "ms")
+                                      (:remote-addr req#)))))
           (fn [rep#] (timbre/error "deferred" '~-name "failed with" (first ~args) rep#)))))))

 (defmacro defmiddleware


Make git commands throw on failure. Make several more git commands work in the proper repo.

--- backend/src/circle/backend/git.clj
+++ backend/src/circle/backend/git.clj
@@ -2,6 +2,7 @@
   "fns for interacting with git."
   (:import java.io.File)
   (:require [clojure.string :as str])
+  (:use [circle.util.except :only (throw-if-not)])
   (:use [clojure.tools.logging :only (infof)])
   (:use [arohner.utils :only (inspect)])
   (:require [circle.sh :as sh]))
@@ -42,11 +43,13 @@
   "Takes a seq of stevedore code. Executes it locally, with GIT_SSH and GIT_SSH_KEY set up."
   [steve & {:keys [ssh-key repo]}]
   (with-temp-ssh-key-file [f ssh-key]
-    (sh/sh steve
-           :environment (when ssh-key
-                          {"GIT_SSH" git-ssh-path
-                           "GIT_SSH_KEY" f})
-           :pwd repo)))
+    (let [result (sh/sh steve
+                        :environment (when ssh-key
+                                       {"GIT_SSH" git-ssh-path
+                                        "GIT_SSH_KEY" f})
+                        :pwd repo)]
+      (throw-if-not (zero? (-> result :exit)) "git command %s returned %s: %s" (first steve) (-> result :exit) (-> result :err))
+      result)))

 (defn clone
   "Clone a git repo at url, writing the directory to path"
@@ -81,21 +84,25 @@
 (defn latest-local-commit
   "Returns the most recent commit id, on the current branch."
   [repo]
+  {:post [(do (infof "latest commit for %s is %s" repo %) true)]}
   (->
-   (git-fn* (sh/quasiquote (git log -1 "--pretty=format:%H")))
+   (git-fn* (sh/quasiquote (git log -1 "--pretty=format:%H"))
+            :repo repo)
    :out))

 (defn latest-remote-commit
   "Returns the most recent on origin/master. Does not fetch."
   [repo]
   (->
-   (git-fn* (sh/quasiquote (git log -1 "--pretty=format:%H" "origin/master")))
+   (git-fn* (sh/quasiquote (git log -1 "--pretty=format:%H" "origin/master"))
+            :repo repo)
    :out))

 (defn committer-email
   "Returns the email address of the committer"
   [repo commit-id]
   (->
-   (git-fn* (sh/quasiquote (git log ~commit-id -1 "--format=%ae")))
+   (git-fn* (sh/quasiquote (git log ~commit-id -1 "--format=%ae"))
+            :repo repo)
    :out
    (str/trim)))


Fixes pcalls, and cleans up tests with a macro.

pcalls takes a variable number of functions, not forms.

--- bank-account/bank_account_test.clj
+++ bank-account/bank_account_test.clj
@@ -1,5 +1,8 @@
 (ns bank-account-test
-  (:require [clojure.test :refer :all]))
+  (:refer-clojure :exclude (replace))
+  (:require [clojure.walk :refer (postwalk)]
+            [clojure.string :refer (capitalize replace)]
+            [clojure.test :refer :all]))

 (load-file "bank_account.clj")

@@ -20,32 +23,37 @@
 ;;
 ;; The initial balance of the bank account should be 0.

-(defn with-bank [label f]
-  (let [acct (bank-account/open-account)
-        result (f acct label)]
-    (bank-account/close-account acct)
-    result))
+(defmacro bank-test
+  "Helper for writing cleaner bank-tests"
+  [testname & body]
+  (let [label (capitalize (replace (name testname) "-" " "))
+        add-label #(if (and (list? %) (= 'is (first %))) (concat % (list label)) %)
+        with-labels (postwalk add-label body)]
+    `(deftest ~testname
+       (let [acc# (bank-account/open-account)
+             ~'get-balance (partial bank-account/get-balance acc#)
+             ~'update-balance (partial bank-account/update-balance acc#)]
+         (do ~@with-labels)
+         (bank-account/close-account acc#)))))

-(deftest checking-basic-balance
-  (with-bank "initial balance is 0" #(is (= 0 (bank-account/get-balance %1)) %2))
-  (with-bank "incrementing and checking balance"
-    #(do (is (= 0 (bank-account/get-balance %1)) %2)
-         (is (= 10 (bank-account/update-balance %1 10)) %2)
-         (is (= 10 (bank-account/get-balance %1)) %2))))
+(bank-test initial-account-state
+  (is (= 0 (get-balance))))

-(deftest can-increment-and-decrement
-  (with-bank "increment and decrement balance"
-    #(do (is (= 0 (bank-account/get-balance %1)) %2)
-         (is (= 10 (bank-account/update-balance %1 10)) %2)
-         (is (= 0 (bank-account/update-balance %1 -10)) %2))))
+(bank-test increment-and-get-balance
+  (is (= 0  (get-balance)))
+  (is (= 10 (update-balance 10)))
+  (is (= 10 (get-balance))))

-(deftest check-concurrent-access
-  (with-bank "handles concurrent execution"
-    #(do
-      (pcalls (bank-account/update-balance %1 10)
-              (bank-account/update-balance %1 10)
-              (bank-account/update-balance %1 10))
-      (is (= 30 (bank-account/get-balance %1)) %2))))
+(bank-test can-increment-and-decrement
+  (is (= 0  (get-balance)))
+  (is (= 10 (update-balance 10)))
+  (is (= 0  (update-balance -10))))
+
+(bank-test check-concurrent-access
+  (let [add-10 #(update-balance 10)]
+    (doall ;; We have to force evaluation on this lazy-list.
+      (pcalls add-10 add-10 add-10)))
+  (is (= 30 (get-balance))))

 (run-tests)
 (shutdown-agents) ;; for the pcalls above so the test exits


More robust xml parsing

More robust xml parsing

--- src/gpx/parse.clj
+++ src/gpx/parse.clj
@@ -15,7 +15,11 @@
     "yyyy-MM-dd'T'HH:mm:ss.SSSZ"))

 (defn parse-datetime [string]
-  (f/parse multi-parser string))
+  (if (empty? string) nil
+    (try
+      (f/parse multi-parser string)
+      (catch Exception ex
+        (throw (Exception. (str "Failed parsing datetime string: \"" string "\"") ex))))))

 (defn trkpt-seq-inner [point]
   (lazy-seq
@@ -36,8 +40,8 @@
   [zpoint]
     { :lat (read-string (attr zpoint :lat))
       :lon (read-string (attr zpoint :lon))
-      :ele (read-string (xml1-> zpoint :ele text))
-      :time (parse-datetime (xml1-> zpoint :time text)) })
+      :ele (xml1-> zpoint :ele text read-string)
+      :time (xml1-> zpoint :time text parse-datetime) })

 (defn parse-metadata
   "Returns the gpx metadata
@@ -45,8 +49,8 @@
    [zgpx]
    { :name (xml1-> zgpx :metadata :name text)
      :desc (xml1-> zgpx :metadata :desc text)
-     :time (parse-datetime (xml1-> zgpx :metadata :time text))
-     :link (attr (xml1-> zgpx :metadata :link) :href) })
+     :time (xml1-> zgpx :metadata :time text parse-datetime)
+     :link (xml1-> zgpx :metadata :link (attr :href)) })

 (defn parse-gpx-inner [zgpx]
   { :points (map parse-trkpt (trkpt-seq zgpx))


only trigger a refresh if the state changes

--- frontend/components/landing_b.cljs
+++ frontend/components/landing_b.cljs
@@ -16,11 +16,14 @@
             [goog.dom]
             [goog.style]
             [om.core :as om :include-macros true]
-            [om.dom :as dom :include-macros true]
-            [sablono.core :as html :refer-macros [html]])
-  (:require-macros [frontend.utils :refer [defrender]]
+            [om.dom :as dom :include-macros true])
+  (:require-macros [frontend.utils :refer [defrender html]]
                    [cljs.core.async.macros :as am :refer [go go-loop alt!]]
                    [dommy.macros :refer [sel1 node]]))
+
+(defn maybe-set-state! [owner korks value]
+  (when (not= (om/get-state owner korks) value)
+    (om/set-state! owner korks value)))

 (defn mount-scroll-handler [owner]
   (let [logo (om/get-node owner "center-logo")
@@ -34,16 +37,17 @@
         scroll-handler #(let [vh (.-height (goog.dom/getViewportSize))
                               nav-height 70]
                           ;; we could optimize these, but calculating this is surprisingly fast (less than 10 ms)
-                          (om/set-state! owner [:header-logo-visible] (neg? (.-bottom (.getBoundingClientRect logo))))
-                          (om/set-state! owner [:header-cta-visible] (neg? (.-bottom (.getBoundingClientRect prolog-cta))))
-                          (om/set-state! owner [:header-bkg-visible] (< (.-bottom (.getBoundingClientRect home-prolog)) nav-height))
-                          (om/set-state! owner [:header-cta-invisible] (< (.-top (.getBoundingClientRect epilog-cta)) vh))
-                          (om/set-state! owner [:header-bkg-invisible] (< (.-top (.getBoundingClientRect home-epilog)) nav-height))
-                          (om/set-state! owner [:first-fig-animate] (< (.-bottom (.getBoundingClientRect purpose-article)) vh))
-                          (om/set-state! owner [:second-fig-animate] (< (.-bottom (.getBoundingClientRect potential-article)) vh))
-                          (om/set-state! owner [:header-bkg-scroller] (min (js/Math.abs (.-top (.getBoundingClientRect home-epilog)))
-                                                                           (js/Math.abs (- nav-height (.-bottom (.getBoundingClientRect home-prolog))))
-                                                                           nav-height)))]
+
+                          (maybe-set-state! owner [:header-logo-visible] (neg? (.-bottom (.getBoundingClientRect logo))))
+                          (maybe-set-state! owner [:header-cta-visible] (neg? (.-bottom (.getBoundingClientRect prolog-cta))))
+                          (maybe-set-state! owner [:header-bkg-visible] (< (.-bottom (.getBoundingClientRect home-prolog)) nav-height))
+                          (maybe-set-state! owner [:header-cta-invisible] (< (.-top (.getBoundingClientRect epilog-cta)) vh))
+                          (maybe-set-state! owner [:header-bkg-invisible] (< (.-top (.getBoundingClientRect home-epilog)) nav-height))
+                          (maybe-set-state! owner [:first-fig-animate] (< (.-bottom (.getBoundingClientRect purpose-article)) vh))
+                          (maybe-set-state! owner [:second-fig-animate] (< (.-bottom (.getBoundingClientRect potential-article)) vh))
+                          (maybe-set-state! owner [:header-bkg-scroller] (min (js/Math.abs (.-top (.getBoundingClientRect home-epilog)))
+                                                                              (js/Math.abs (- nav-height (.-bottom (.getBoundingClientRect home-prolog))))
+                                                                              nav-height)))]
     (om/set-state! owner [:scroll-key]
                    (goog.events/listen
                     js/window


fix unit tests.

fix unit tests.


[Fix] test predict using binding *sign-reverse*

--- test/clj_elm/core_test.clj
+++ test/clj_elm/core_test.clj
@@ -111,7 +111,15 @@
       => -1)
     (let [model (train-model libsvmlian 20 :norm true)]
       (predict model (first (normalize (:features libsvmlian))))
-      => -1)))
+      => -1))
+  (fact "(binding [*sign-reverse* true] (train-model dataset l))"
+    (binding [*sign-reverse* true]
+      (let [model (train-model australian 20 :norm true)]
+        (predict model (first (normalize (:features australian))))
+        => 1)
+      (let [model (train-model libsvmlian 20 :norm true)]
+        (predict model (first (normalize (:features libsvmlian))))
+        => 1))))

 (facts "test-update-exp"
   (fact "(update-exp fn key exp) return reference of exp"


Remove redundancy

Remove redundancy

--- dev/src/yada/dev/cors_demo.clj
+++ dev/src/yada/dev/cors_demo.clj
@@ -32,7 +32,6 @@
     ["/"
      [["index.html" (index component)]
       ["ajax.js" (yada (new-template-resource "cors/ajax.js" {:origin (config/docsite-origin config)}))]
-      ["talk/" (yada (io/file "/home/malcolm/src/thi.ng/talks/we-are-the-incanters"))]
       ]]))

 (defn new-cors-demo [config]


Fix errors in the meta torrent callback function

--- common/clojure/nightweb/router.clj
+++ common/clojure/nightweb/router.clj
@@ -18,7 +18,8 @@
         [nightweb.formats :only [base32-encode
                                  base32-decode
                                  b-decode
-                                 b-decode-map]]
+                                 b-decode-map
+                                 b-decode-bytes]]
         [nightweb.db :only [insert-meta-data
                             get-single-fav-data]]
         [nightweb.constants :only [is-me?
@@ -81,14 +82,14 @@
     ; iterate over the files in this torrent
     (doseq [path-leaves paths]
       (let [meta-file (read-meta-file parent-dir path-leaves)
-            meta-content (get meta-file :contents)]
+            meta-contents (get meta-file :contents)]
         ; insert it into the db
-        (insert-meta-data user-hash-bytes meta-content)
+        (insert-meta-data user-hash-bytes meta-file)
         ; if this is a fav user, start following their fav users
         (if (and is-fav-user?
                  (= "fav" (get meta-file :dir-name))
-                 (nil? (get meta-content :ptrtime)))
-          (add-user-hash (get meta-content :ptrhash)))))
+                 (nil? (get meta-contents "ptrtime")))
+          (add-user-hash (b-decode-bytes (get meta-contents "ptrhash"))))))
     ; remove any files that the torrent no longer contains
     (if-not (is-me? user-hash-bytes)
       (delete-orphaned-files user-hash-bytes paths))))


increase db pool

increase db pool

--- src/shorty/db.clj
+++ src/shorty/db.clj
@@ -9,6 +9,8 @@

 (def jdbc-spec
   (merge {:classname "org.postgresql.Driver"
+          :minimum-pool-size 100
+          :maximum-pool-size 500
           :subprotocol "postgresql"
           :subname (str "//" db-host "/" (env :db))}
          (select-keys env [:db :user :password])))


More utility macroes have been added to utils ns

--- core/src/cljc/hellhound/utils.cljc
+++ core/src/cljc/hellhound/utils.cljc
@@ -1,6 +1,16 @@
 (ns hellhound.utils
   (:require
+   [hellhound.logger.formatters  :as formatter]
    [hellhound.env :as env]))
+
+(defn code-location
+  [and-form]
+  (formatter/green
+   (str *ns* ":" (:line (meta and-form)))))
+
+(defn- printer
+  [x]
+  `(println ~(formatter/yellow (str x)) ":" ~x))

 (defn uuid
@@ -17,3 +27,14 @@
   (if (or (env/test?) (env/development?))
     `(println (str "[" ~*ns* ":" ~(:line (meta &form))
                    "] TODO: " ~msg))))
+
+
+(defmacro dump
+  [& args]
+  (let [prints (map printer args)]
+    `(do
+       (println (str "Debug in "
+                     ~(code-location &form)
+                     " -----------------------"))
+       ~@prints
+       (println "End =========================\n"))))


164 working draft

164 working draft

--- stuf/src/sandbox/4clojure.clj
+++ stuf/src/sandbox/4clojure.clj
@@ -1445,9 +1445,16 @@
 (defn accepted? [symb dfa]
   (symb (:accepts dfa)))

-(defn states [current-state dfa]
-  (let [next-states (get-next current-state dfa)]
-    (if (empty? next-states)
-      nil
-      (mapcat (fn [[c s]] (cons c (states s dfa))) next-states))))
-
+(defn alphabet [state dfa res]
+  (->> (get-next state dfa)
+       (filter (fn [[_ s]] (accepted? s dfa)))
+       (map (fn [[c _]] (str res c)))))
+
+(defn states
+  ([dfa] (states (:start dfa) dfa ""))
+  ([current-state dfa res]
+   (let [next-states (get-next current-state dfa)
+         alphb (alphabet current-state dfa res)]
+     (concat alphb
+             (mapcat (fn [[c s]] (states s dfa (str res c))) next-states)))))
+


condからcondpに変えてみた

condからcondpに変えてみた

--- POH6/rio/answer.clj
+++ POH6/rio/answer.clj
@@ -1,5 +1,5 @@
 ;
-; 結果 https://paiza.jp/poh/joshibato/rio/result/48e53fba
+; 結果 https://paiza.jp/poh/joshibato/rio/result/3ae0ce79
 ;

 (loop [n (Integer/parseInt (read-line)) w 0.0 c 0.0]
@@ -8,11 +8,10 @@
                 t (Integer/parseInt (tas 0))
                 s (Double/parseDouble (tas 1))
                 ]
-            (cond
-                (= t 1) (recur (dec n) (+ w s) c)
-                (= t 2) (recur (dec n) w (+ c s))
-                :else
-                    (let [wc (+ w c)]
+            (condp = t
+                1   (recur (dec n) (+ w s) c)
+                2   (recur (dec n) w (+ c s))
+                3   (let [wc (+ w c)]
                         (recur (dec n)
                             (/ (- (* w wc) (* s w)) wc)
                             (/ (- (* c wc) (* s c)) wc)


видалено менше

видалено менше

--- src/uawa/core.clj
+++ src/uawa/core.clj
@@ -4,14 +4,14 @@
 ;; макроси
 (defmacro визначення "див. def" [символ документація значення] `(def ~символ ~документація ~значення))
 (defmacro постійна "див. defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))
-
 (defmacro функція "див. defn" [назви & описи] (list* `defn (with-meta назви (assoc (meta назви) :private false)) описи))
+(defmacro запис "див. defrecord" [name fields & opt] `(defrecord ~name ~fields ~@opt))

 (defmacro якщо "див. if"([умова то] `(if ~умова ~то nil)) ([умова то інакше] `(if ~умова ~то ~інакше)))

 (defmacro для "див. for" [set-expr body-expr] `(for ~set-expr body-expr))

-(defmacro запис "див. defrecord" [name fields & opt] `(defrecord ~name ~fields ~@opt))
+

 ;; колекції
@@ -58,13 +58,8 @@

 ;; різні

-
 (функція дай-випадкове "див. rand-int" [максимальне] (rand-int максимальне))

 (функція друкуй "див. println" [& більше]  (binding [*print-readably* nil] (apply prn більше)))

-(функція менше?  ([x] true) ([x y] (. clojure.lang.Numbers (lt x y))) ([x y & more]   (if (< x y)     (if (next more)       (recur y (first more) (next more))       (< y (first more))) false)))

-;; (якщо (менше? (дай-випадкове 3) 4) (друкуй "українська") (друкуй "ураиский русский"))
-
-


remove out of date message

remove out of date message

--- src/chat/client/views/pages/channel.cljs
+++ src/chat/client/views/pages/channel.cljs
@@ -37,8 +37,6 @@

           (dom/div #js {:className "description"}
             (dom/p nil "One day, a channel description will be here.")
-            (dom/p nil "Currently only showing your open threads for this channel.")
-            (dom/p nil "Soon, you will see all recent threads for this channel.")

             (dom/div nil
               (case status


Undo 91264b1 - endparen is for URL, not docstring

--- src/uruk/core.clj
+++ src/uruk/core.clj
@@ -705,7 +705,7 @@
   current `session`. Optionally takes a map of content creation
   options per `content-creation-options`.

-  See https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/Session.html#insertContent(com.marklogic.xcc.Content"
+  See https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/Session.html#insertContent(com.marklogic.xcc.Content)"
   ([session uri element]
    (.insertContent session (element->content uri element)))
   ([session uri element options]


fixup

fixup

--- src/deltalog/mr.clj
+++ src/deltalog/mr.clj
@@ -25,7 +25,7 @@

 ; This creates a tap that will read a text file line-by-line.
 ; The resultant field will be named "line".
-(def in-tap (Hfs. (AvroScheme.) "/Users/chris/raw/323"))
+(def in-tap (Lfs. (AvroScheme.) "/Users/chris/raw"))
 (def out-tap (Lfs. (AvroScheme. schema/user-schema) "example/output"))

 (defn filter-ts-if


Changed up argument order for fire timeseries.

--- src/clj/forma/hadoop/jobs/timeseries.clj
+++ src/clj/forma/hadoop/jobs/timeseries.clj
@@ -134,13 +134,13 @@
         (update-chunk ?chunk t-res ?fire-series :> ?final-chunk))))

 (defn fire-query
-  [pail-path t-res start end]
-  (-> pail-path
+  [source-pail-path t-res start end]
+  (-> source-pail-path
       (pail/split-chunk-tap ["fire"])
       (create-fire-series t-res start end)))

 (defjob FireTimeseries
-  [t-res start end source-pail-path ts-pail-path]
+  [source-pail-path ts-pail-path t-res start end]
   (-> source-pail-path
       (fire-query t-res start end)
       (pail/to-pail ts-pail-path)))


Converted merge-firetuples to defparallelagg.

--- src/clj/forma/hadoop/jobs/timeseries.clj
+++ src/clj/forma/hadoop/jobs/timeseries.clj
@@ -81,21 +81,19 @@

 ;; #### Fire Time Series Processing

-(defaggregateop merge-firetuples
-  " Aggregates a number of firetuples by adding up the values
-  of each `FireTuple` property."
-  ([] [0 0 0 0])
-  ([state tuple] (map + state (schema/extract-fields tuple)))
-  ([state] [(apply schema/fire-value state)]))
-
+(defparallelagg merge-firetuples
+  "Aggregates a number of firetuples by adding up the values of each
+  `FireTuple` property."
+  :init-var #'identity
+  :combine-var #'schema/add-fires)

 (defmapop running-fire-sum
   "Special case of `running-sum` for fire objects."
   [start tseries]
-  (let [empty (schema/fire-value 0 0 0 0)]
-    (->> tseries
-         (reductions schema/add-fires empty)
-         (schema/timeseries-value start))))
+  (->> tseries
+       (reductions schema/add-fires)
+       (filter identity)
+       (schema/timeseries-value start)))

 (defn aggregate-fires
   "Converts the datestring into a time period based on the supplied
@@ -132,3 +130,5 @@
                    (for [tile (apply tile-set tile-seq)]
                      ["fire" "1000-01" (apply r/hv->tilestring tile)]))]
     (create-fire-series tap t-res start end)))
+
+


Location plugin, explore badges autocomplete

--- src/cljs/salava/location/ui/explore.cljs
+++ src/cljs/salava/location/ui/explore.cljs
@@ -42,19 +42,21 @@
                  (.on "click" (click-cb item))))))
        })))

-(defn tag-autocomplete [state]
-  (let [tag (cursor state [:tag])]
+(defn filter-autocomplete [kind state]
+  (let [filter (cursor state [kind])
+        class-name (str (name kind) "-filter")
+        placeholder (keyword "location" (str kind "FilterField"))]
     (fn []
       [autocomplete/autocomplete
-       {:value (:value @tag)
+       {:value (:value @filter)
         :cb    (fn [item]
-                 (swap! tag assoc :value (:key item))
-                 (.trigger (js/jQuery "div.badges-filter .tag-filter input") "change"))
+                 (swap! filter assoc :value (:key item))
+                 (.trigger (js/jQuery (str "div.badges-filter ."class-name " input")) "change"))
         :search-fields   [:value]
-        :items           (:autocomplete @tag)
-        :no-results-text (t :location/Notfound)
-        :placeholder     (t :location/Keyword)
-        :control-class   "form-control tag-filter"
+        :items           (:autocomplete @filter)
+        :no-results-text " "
+        :placeholder     (t placeholder)
+        :control-class   (str "form-control " class-name)
         :max-results     100
         }])))

@@ -94,20 +96,15 @@

           [:div.form-group.badges-filter {:style {:display "none"}}
            [:div.col-md-6
-            [:input.form-control {:name "badge_name"
-                                  :type "text"
-                                  :placeholder (t :location/SearchBadges)}]
-            ]]
-          [:div.form-group.badges-filter {:style {:display "none"}}
-           [:div.col-md-6
-            [:input.form-control {:name "issuer_name"
-                                  :type "text"
-                                  :placeholder (t :location/SearchIssuers)}]
-            ]]
+            [filter-autocomplete :badge state]]]

           [:div.form-group.badges-filter {:style {:display "none"}}
            [:div.col-md-6
-            [tag-autocomplete state]]]
+            [filter-autocomplete :issuer state]]]
+
+          [:div.form-group.badges-filter {:style {:display "none"}}
+           [:div.col-md-6
+            [filter-autocomplete :tag state]]]

           ]

@@ -125,8 +122,8 @@
              query-opt (fn []
                          (case (.val (js/jQuery "input[name=map-type]:checked"))
                            "users"  {:user_name (.val (js/jQuery "input[name=user_name]"))}
-                           "badges" {:badge_name  (.val (js/jQuery "input[name=badge_name]"))
-                                     :issuer_name (.val (js/jQuery "input[name=issuer_name]"))
+                           "badges" {:badge_name  (.val (js/jQuery ".badge-filter input"))
+                                     :issuer_name (.val (js/jQuery ".issuer-filter input"))
                                      :tag_name    (.val (js/jQuery ".tag-filter input"))}))

              redraw-map! (fn []
@@ -140,7 +137,11 @@

          (.on my-map "moveend" redraw-map!)

-         (.on (js/jQuery "div.users-filter input, div.badges-filter input") "keyup change" redraw-map!)
+         (.on (js/jQuery "div.users-filter input, div.badges-filter input") "keyup change"
+              (fn [e]
+                (let [len (-> e .-target.value count)]
+                (when (or (= len 0) (>= len 3))
+                  (redraw-map!)))))

          (.on (js/jQuery "input[name=map-type]") "change"
               (fn [e]
@@ -156,11 +157,17 @@
      }))

 (defn handler [site-navi]
-  (let [state (atom {:tag {:value "" :autocomplete {}}})]
+  (let [state (atom {:tag    {:value "" :autocomplete {}}
+                     :badge  {:value "" :autocomplete {}}
+                     :issuer {:value "" :autocomplete {}}
+                     })]
     (ajax/GET
       (path-for "/obpv1/location/explore/filters" false)
       {:handler
        (fn [data]
-         (swap! state assoc-in [:tag    :autocomplete] (reduce (fn [coll v] (assoc coll v v)) {} (:tag_name    data))))})
+         (swap! state assoc-in [:tag    :autocomplete] (reduce (fn [coll v] (assoc coll v v)) {} (:tag_name    data)))
+         (swap! state assoc-in [:badge  :autocomplete] (reduce (fn [coll v] (assoc coll v v)) {} (:badge_name  data)))
+         (swap! state assoc-in [:issuer :autocomplete] (reduce (fn [coll v] (assoc coll v v)) {} (:issuer_name data)))
+         )})
     (fn []
       (layout/default site-navi [map-view state]))))


Fixed max program length of initial programs from 50 to 500.

--- src/clojush/examples/bioavailability.clj
+++ src/clojush/examples/bioavailability.clj
@@ -132,6 +132,7 @@
   :error-function (partial bioavailability-error-function :train)
   :atom-generators bioavailability-atom-generators
   :max-points 500
+  :max-points-in-initial-program 500
   :evalpush-limit 500
   :population-size 500
   :max-generations 100


Fixed Median problem for downsampled lexicase.

--- src/clojush/problems/software/median.clj
+++ src/clojush/problems/software/median.clj
@@ -87,9 +87,9 @@
                          (if (= printed-result (str out-int))
                            0
                            1))))]
-        (if (= data-cases :train)
-          (assoc individual :behaviors @behavior :errors errors)
-          (assoc individual :test-errors errors))))))
+        (if (= data-cases :test)
+          (assoc individual :test-errors errors)
+          (assoc individual :behaviors @behavior :errors errors))))))

 (defn get-median-train-and-test
   "Returns the train and test cases."


Test core.match's no matching clause branch

--- test/desdemona/query_test.clj
+++ test/desdemona/query_test.clj
@@ -7,6 +7,7 @@
   @#'desdemona.query/dsl->logic)

 (deftest dsl->logic-tests
+  (is (thrown? IllegalArgumentException (dsl->logic '(BOGUS BOGUS BOGUS))))
   (is (= '(clojure.core.logic/featurec x {:ip "10.0.0.1"})
          (dsl->logic '(= (:ip x) "10.0.0.1")))))


Fix web-server/project.cljs.

Fix web-server/project.cljs.

--- web-server/project.clj
+++ web-server/project.clj
@@ -4,8 +4,8 @@
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/clojurescript "0.0-2356"]
                  [compojure "1.1.8"]
-                 [om "0.7.3"]
-                 [racehub/om-bootstrap "0.3.0"]]
+                 [racehub/om-bootstrap "0.3.0"]
+                 [om "0.7.3"]]

   :plugins [[lein-ring "0.8.11"]
             [lein-cljsbuild "1.0.3"]]


undo - mistake

undo - mistake

--- frontend/components/landing.cljs
+++ frontend/components/landing.cljs
@@ -215,7 +215,7 @@
               [:ul#tech.nav.nav-tabs
                (for [tab [:languages :databases :queues :browsers :libraries :deployment :custom]]
                  (tech-tab tab selected-tab controls-ch))]]]
-            [:div.tab-content (:class (tech-class selected-tab))
+            [:div.tab-content
              (let [templates {:languages {:img-url "/img/outer/home/tech-languages.png"
                                           :blurb "CircleCI automatically infers how to run your Ruby, Node, Python and Java tests. You can customize any step, or set up your test steps manually for PHP or other languages."}
                               :databases {:img-url "/img/outer/home/tech-databases.png"


Update iolist.clj

Update iolist.clj

--- src/iyye/iolist.clj
+++ src/iyye/iolist.clj
@@ -16,6 +16,7 @@

 (ns iyye.iolist
   (:require [extras.lispychat :as lispychat]
+            [iyye.persistence :as persistence]
             [clojure.tools.logging :as log]))

 (def AvatarsIOList (ref ()))
@@ -26,9 +27,12 @@

 (defn init-io []
   (letfn [(start-all [l]
-            (for [func (map :start-function l) :when func] (func)))]
-    (do [
+            (doall (for [func (map :start-function l) :when func] (func))))]
+    (doall [
       (init-avatars-list)
       (start-all @AvatarsIOList)
       (start-all (:inputs-list @AvatarsIOList))
       (start-all (:outputs-list @AvatarsIOList))])))
+
+(defn load-io-state []
+  )


added more complex tests

added more complex tests

--- test/simplediff/core_test.clj
+++ test/simplediff/core_test.clj
@@ -29,3 +29,25 @@
   (testing "simple compare3 works")
   (is (= (diff/docompare ["this is a new line"] 0 [ "this is a line" ] 0 )
          (list (list 1 "c" 1 "< this is a new line" "> this is a line")))))
+
+(deftest complex-compare1
+  (testing "complex compare1 works")
+  (is (= (diff/docompare ["this is a line"] 0 [ "an added line" "a second added line" "this is a line" ] 0 )
+         '((0 "a" 1 "> an added line")
+           (0 "a" 2 "> a second added line")))))
+
+(deftest complex-compare2
+  (testing "complex compare2 works")
+  (is (= (diff/docompare ["this is a line" "an line"] 0 [ "an line" "a second added line" "this is a line" ] 0 )
+         '((1 "d" 0 "< this is a line")
+           (2 "a" 2 "> a second added line")
+           (2 "a" 3 "> this is a line")))))
+
+(deftest complex-compare3
+  (testing "complex compare3 works")
+  (is (= (diff/docompare [ "an line" "a second added line" "this is a line" ] 0 ["this is a line" "an line"] 0)
+         '((1 "d" 0 "< an line")
+           (2 "d" 0 "< a second added line")
+           (3 "a" 2 "> an line")))))
+
+


Remove icon from action bar

Remove icon from action bar

--- nightweb-android/src/clojure/net/nightweb/main.clj
+++ nightweb-android/src/clojure/net/nightweb/main.clj
@@ -38,6 +38,7 @@
     (let [action-bar (.getActionBar this)]
       (.setNavigationMode action-bar android.app.ActionBar/NAVIGATION_MODE_TABS)
       (.setDisplayShowTitleEnabled action-bar false)
+      (.setDisplayShowHomeEnabled action-bar false)
       (create-tab action-bar (get-resource :string :home))
       (create-tab action-bar (get-resource :string :people))
       (create-tab action-bar (get-resource :string :photos))


Fix misplaced logging.

Fix misplaced logging.

--- src/kixi/hecuba/controller/scheduler.clj
+++ src/kixi/hecuba/controller/scheduler.clj
@@ -42,13 +42,14 @@

 (defrecord Scheduler [config]
   component/Lifecycle
-  (log/info "Scheduler starting")
   (start [this]
+    (log/info "Scheduler starting")
     (let [pipeline (get-in this [:pipeline])]
       (configure-scheduler config pipeline)
       (qs/start))
     (assoc this :scheduler (constantly @qs/*scheduler*)))
   (stop [this]
+    (log/info "Scheduler stopping")
     (qs/shutdown)
     this))


git add routes config;server config

git add routes config;server config

--- src/bookmarks/core.clj
+++ src/bookmarks/core.clj
@@ -1,7 +1,29 @@
 (ns bookmarks.core
+  (:require
+   [compojure.core :refer :all]
+   [compojure.route :as route]
+   [ring.adapter.jetty :as jetty]
+   [ring.middleware.json :as ring-json]
+   [ring.util.response	:as rr]
+   [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
+   [bookmarks.db.core :as db])
   (:gen-class))
+
+
+(defroutes app-routes
+  (GET "/" [] "welcome to home page")
+  (route/resources "/static")
+  (route/not-found "
Page not found
"))
+
+(def app
+ (-> app-routes
+      (wrap-defaults (assoc-in site-defaults [:security :anti-forgery] false))
+      (ring-json/wrap-json-body)
+      (ring-json/wrap-json-response)))
+

 (defn -main
   "I don't do a whole lot ... yet."
   [& args]
-  (println "Hello, World!"))
+  (jetty/run-jetty app {:port 8090
+                        :join? false}))


Import dialog using re-com

Import dialog using re-com

--- src/app/ctl.cljs
+++ src/app/ctl.cljs
@@ -5,7 +5,11 @@
             [markdown.core :refer [md->html]]
             [cljsjs.mousetrap]
             [reagent.core :as reagent :refer [atom]]
-            [re-com.core :refer [button]]
+            [re-com.core  :refer [h-box v-box box gap line label checkbox
+                                  radio-button button single-dropdown
+                                  input-textarea
+                                  popover-content-wrapper popover-anchor-wrapper]]
+            [re-com.util :refer [deref-or-value]]
             [re-frame.core :refer [dispatch-sync
                                    subscribe
                                    ]])
@@ -21,6 +25,61 @@
 (deftmpl help-tpl "help.html")

 (deftmpl dataview-tpl "dataview.html")
+
+(defn import-component-body-func [submit-dialog cancel-dialog dialog-data]
+  (fn []
+    [v-box
+     :children [[label
+                 :label "Type (or paste) text into the text area (one item per line) and hit import."]
+                [gap :size "15px"]
+                [h-box
+                 :children [[input-textarea
+                             :model            dialog-data
+                             :width            "300px"
+                             :rows             10
+                             :placeholder      "Enter items, one per line \n item"
+                             :on-change        #(reset! dialog-data %)
+                             :change-on-blur?  true]]]
+                [gap :size "20px"]
+                [line]
+                [gap :size "10px"]
+                [h-box
+                 :gap      "10px"
+                 :children [[button
+                             :label    [:span [:i {:class "zmdi zmdi-check" }] " Apply"]
+                             :on-click #(submit-dialog @dialog-data)
+                             :class    "btn-primary"]]]]]))
+
+(defn popover-body
+  [showing? position dialog-data on-change]
+  (let [dialog-data   (reagent/atom (deref-or-value dialog-data))
+        submit-dialog (fn [new-dialog-data]
+                        (reset! showing? false)
+                        (on-change new-dialog-data))
+        cancel-dialog #(reset! showing? false)]
+    (fn []
+      [popover-content-wrapper
+       :showing?         showing?
+       :on-cancel        cancel-dialog
+       :position         position
+       :width            "400px"
+       :backdrop-opacity 0.3
+       :title            "Import items"
+       :body             [(import-component-body-func submit-dialog cancel-dialog dialog-data)]])))
+
+
+(defn import-dlg [active-channel]
+  (let [showing? (atom false)
+        dlg-data (atom "")
+        on-change #(dispatch-sync [:import % @active-channel])]
+    (fn []
+      [popover-anchor-wrapper
+       :showing? showing?
+       :position :right-below
+       :anchor [button
+                :label "Import"
+                :on-click #(reset! showing? true)]
+       :popover [popover-body showing? :right-below dlg-data on-change]])))

 (defn title-input [{:keys [title on-save on-stop]}]
@@ -119,7 +178,8 @@
                          (cljs.reader/read-string (.. % -target -value))])}]
          ["#toggle-import-dlg" {:on-click #(dispatch-sync [:toggle-import-visibility])}]
          ["#import-dlg" {:class (visibility-class @import-visible?)}]
-         [".buttons" :*> (list [:li [button
+         [".buttons" :*> (list [:li [import-dlg active-channel]]
+                               [:li [button
                                      :label "Clear"
                                      :disabled? false
                                      :on-click #(dispatch-sync [:clear @active-channel])


fixed google-api

fixed google-api

--- src/cai/speech-api.clj
+++ src/cai/speech-api.clj
@@ -29,7 +29,7 @@
       (-> (json/read-str body :key-fn keyword)
           :responses
           first)
-      (do (println "ERROR: Call to Vision API failed. Maybe check your vision-key in profiles.clj?")
+      (do (println "ERROR: Call to Vision API failed. Maybe check your key-file?")
           (println body))))


Renamed name param to server-addr.

Renamed name param to server-addr.

--- src/cbfg/world/t1.cljs
+++ src/cbfg/world/t1.cljs
@@ -67,7 +67,9 @@

 (def prog-world (atom {})) ; { :world => world-actx
                            ;   :net-listen-ch => ch
-                           ;   :net-connect-ch => ch }
+                           ;   :net-connect-ch => ch
+                           ;   :servers => { server-addr => ports }
+                           ;   :clients => client-info }

 ; -------------------------------------------------------------------

@@ -190,16 +192,17 @@

 ; --------------------------------------------

-(defn kv-server [name & ports]
+(defn kv-server [server-addr & ports]
   (let [world (:world @prog-world)
         done (atom false)]
     (act server-init world
          (doseq [port ports]
            (when-let [listen-result-ch (achan server-init)]
-             (aput server-init (:net-listen-ch @prog-world) [name port listen-result-ch])
+             (aput server-init (:net-listen-ch @prog-world)
+                   [server-addr port listen-result-ch])
              (when-let [[accept-ch close-accept-ch] (atake server-init listen-result-ch)]
                (cbfg.world.net/server-accept-loop world accept-ch close-accept-ch)
-               (swap! prog-world #(update-in % [:servers name] conj port)))))
+               (swap! prog-world #(update-in % [:servers server-addr] conj port)))))
          (reset! done true))
     (wait-done done)))


Fix: Riemann host not to be used as the source host

--- trackit-riemann/src/samsara/trackit/reporter_riemann.clj
+++ trackit-riemann/src/samsara/trackit/reporter_riemann.clj
@@ -1,15 +1,21 @@
 (ns samsara.trackit.reporter-riemann
   (:import  [java.util.concurrent TimeUnit]
-            [com.codahale.metrics MetricFilter])
+            [com.codahale.metrics MetricFilter]
+            [java.net InetAddress UnknownHostException])
   (:require [metrics.reporters.riemann :as riemann]))

+(defn- local-host-name []
+  (try
+    (.getCanonicalHostName (InetAddress/getLocalHost))
+    (catch UnknownHostException uhe
+      "Unknown Hostname")))

 (defn start-reporting
   [registry
-   {:keys [reporting-frequency-seconds host port prefix rate-unit duration-unit separator tags]
-    :or  {reporting-frequency-seconds 10, host "localhost", port 5555, prefix "trackit"
-          rate-unit TimeUnit/SECONDS, duration-unit TimeUnit/MILLISECONDS
+   {:keys [local-host reporting-frequency-seconds host port prefix rate-unit duration-unit separator tags]
+    :or  {local-host (local-host-name), reporting-frequency-seconds 10, host "localhost", port 5555
+          prefix "trackit", rate-unit TimeUnit/SECONDS, duration-unit TimeUnit/MILLISECONDS
           separator "." tags {}} :as cfg}]
-  (let [reporter (riemann/reporter (riemann/make-riemann host port) registry (assoc cfg :host-name host))]
+  (let [reporter (riemann/reporter (riemann/make-riemann host port) registry (assoc cfg :host-name local-host))]
     (riemann/start reporter reporting-frequency-seconds)
     (fn [] (riemann/stop reporter))))


correctly connect cljs to server (using the domain the webpage was started from)

--- src-cljs/cljs_workspace/repl.cljs
+++ src-cljs/cljs_workspace/repl.cljs
@@ -4,6 +4,7 @@
 (enable-console-print!)

 (def port 9050)
+(def host (.. js/document -location -hostname))

-(repl/connect (str "http://localhost:" port "/repl"))
-(print (str "repl connected on port " port))+(repl/connect (str "http://" host ":" port "/repl"))
+(println "repl connected on port " port)


Pumped volume, proppant mass, media pressure

Previous commits ...

This commit ...

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -312,7 +312,7 @@
 (defn rand-unit [physical-quantity]
   (let [quantity-units-map {:length [:ft :m]
                             :mass [:lb :kg]
-                            :pressure [:psi :kPa :mPa]
+                            :pressure [:psi :kPa :MPa]
                             :volume [:bbl :m3]
                             :injection-rate [:bbl-per-min :bpm :m3-per-min :m3/min]
                             :proppant-concentration [:lb-per-gal :lb/gal :kg-per-m3 :kg/m3]}]
@@ -448,4 +448,27 @@
 (defn typical-kelly-bushing-elevation []
   (tuc/draw-normal 30.48 (/ 1.00 3.00)))

-
+(defn typical-pumped-volume
+  ([] (let [volume-unit (rand-volume-unit)]
+        [(typical-pumped-volume volume-unit) volume-unit]))
+  ([volume-unit]
+   (condp = volume-unit
+     :bbl (tuc/draw-normal 6986.70 1992.30)
+     :m3 (tuc/draw-normal 813.47 286.89))))
+
+(defn typical-proppant-mass
+  ([] (let [mass-unit (rand-mass-unit)]
+        [(typical-proppant-mass mass-unit) mass-unit]))
+  ([mass-unit]
+   (condp = mass-unit
+     :lb (tuc/draw-normal 4962.77 1375.72)
+     :kg (tuc/draw-normal 135068.05 16421.44))))
+
+(defn typical-median-pressure
+  ([] (let [pressure-unit (rand-pressure-unit)]
+        [(typical-median-pressure pressure-unit) pressure-unit]))
+  ([pressure-unit]
+   (condp = pressure-unit
+     :psi (tuc/draw-normal 7569.89 663.65)
+     :kPa (tuc/draw-normal 64.1635 7.0987)
+     :MPa (/ (typical-median-pressure :kPa) 1000))))


Correct error

Correct error

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -179,7 +179,7 @@
      :ft (make-measurement (tuc/draw-normal 495.763 106.098) length-unit)
      :m (length-as (typical-stage-separation :ft) length-unit)))
   ([] (let [length-unit (rand-length-unit)]
-        (typical-stage-separation length-unit))))
+        (typical-stage-extent length-unit))))

 (defn typical-stage-completion-time
   "Calculates the typical time in seconds for a stage to be completed."


Update dependencies

Update dependencies


Version 0.1.5

Version 0.1.5


bumped up dependencies

bumped up dependencies


Release version 0.9.10.0-beta1.

Release version 0.9.10.0-beta1.


Fix improper reagent form

Fix improper reagent form

--- src/braid/client/quests/views.cljs
+++ src/braid/client/quests/views.cljs
@@ -28,12 +28,13 @@

 (defn quests-menu-view []
   (let [active-quests (subscribe [:quests/active-quests])]
-    [:div.quests-menu
-     [:div.content
-      [:div.quests
-       (for [quest @active-quests]
-         ^{:key (quest :id)}
-         [quest-view quest])]]]))
+    (fn []
+      [:div.quests-menu
+       [:div.content
+        [:div.quests
+         (for [quest @active-quests]
+           ^{:key (quest :id)}
+           [quest-view quest])]]])))

 (defn quests-header-view []
   (let [completed-quest-count (subscribe [:quests/completed-quest-count])]


refactoring

refactoring

--- src/clj/om_next_leaflet/routes.clj
+++ src/clj/om_next_leaflet/routes.clj
@@ -65,15 +65,16 @@

 (def route ["/" {"" {:get index-handler}
                  "index.html" {:get index-handler}
-                 "api2/" {"lines" {"" {:get lines-handler}
-                                   ["/" [#"\d+" :line-id]] {"/stations" {:get stations-handler}}}
+                 "css" {:get (resources {:prefix "public/css/"})}
+                 "js" {:get (resources {:prefix "public/js/"})}
+                 "api2/" {"lines" {:get lines-handler}
+                          ["lines/" [#"\d+" :line-id] "/stations"] {:get stations-handler}
                           "line-names" {:get line-names-handler}
-                          "lines-in-bounds" {["/" :zoom "/" :nwlat "," :nwlng "-" :selat "," :selng] lines-in-bounds-handler}
-                          "stations-in-bounds" {["/" :zoom "/" :nwlat "," :nwlng "-" :selat "," :selng] stations-in-bounds-handler}
+                          "lines-in-bounds" {["/" :zoom "/" :nwlat "," :nwlng "-" :selat "," :selng] {:get lines-in-bounds-handler}}
+                          "stations-in-bounds" {["/" :zoom "/" :nwlat "," :nwlng "-" :selat "," :selng] {:get stations-in-bounds-handler}}
                           "objects" {:get get-objects-handler}
-                          "object" {:post save-object-handler}}
-                 "css" {:get (resources {:prefix "public/css/"})}
-                 "js" {:get (resources {:prefix "public/js/"})}}])
+                          "object" {:post save-object-handler}
+                          }}])

 (defn home-routes
   [endpoint]


Change redis env

Change redis env

--- src/clj/retroboard/environment.clj
+++ src/clj/retroboard/environment.clj
@@ -4,7 +4,7 @@
             [retroboard.resource :as resource]
             [clojure.edn :as edn]))

-(def redis-uri (or (System/getenv "REDISTOGO_URL") "redis://127.0.0.1:6379"))
+(def redis-uri (or (System/getenv "REDISCLOUD_URL") "redis://127.0.0.1:6379"))

 (def server1-conn {:pool {} :spec {:uri redis-uri}})
 (defmacro wcar* [& body] `(car/wcar server1-conn ~@body))


add side-bar to transactions pages

add side-bar to transactions pages

--- src/clj_money/web/transactions.clj
+++ src/clj_money/web/transactions.clj
@@ -12,10 +12,17 @@
             [clj-money.validation :as validation]
             [clj-money.models.accounts :as accounts]
             [clj-money.models.transactions :as transactions]
-            [clj-money.web.money-shared :refer [account-options]]
+            [clj-money.web.money-shared :refer [account-options
+                                                budget-monitors]]
             [clj-money.util :refer [format-date]]
             [clj-money.schema :as schema])
   (:use [clj-money.web.shared :refer :all]))
+
+(defmacro with-transactions-layout
+  [page-title entity-id options & content]
+  `(with-layout
+     ~page-title (assoc ~options :side-bar (budget-monitors ~entity-id))
+     ~@content))

 (defn- transaction-row
   "Renders a row in the transaction table"
@@ -41,19 +48,17 @@
 (defn index
   ([entity-id] (index entity-id {}))
   ([entity-id options]
-   (with-layout "Transactions" options
-     [:div.row
-      [:div.col-md-6
-       [:table.table.table-striped
-        [:tr
-         [:th.col-sm-2 "Date"]
-         [:th.col-sm-8 "Description"]
-         [:th.col-sm-2 " "]]
-        (map transaction-row (transactions/select-by-entity-id (env :db) entity-id))]
-       [:a.btn.btn-primary
-        {:href (str"/entities/" entity-id "/transactions/new")
-         :title "Click here to enter a new transaction."}
-        "Add"]]])))
+   (with-transactions-layout "Transactions" entity-id options
+     [:table.table.table-striped
+      [:tr
+       [:th.col-sm-2 "Date"]
+       [:th.col-sm-8 "Description"]
+       [:th.col-sm-2 " "]]
+      (map transaction-row (transactions/select-by-entity-id (env :db) entity-id))]
+     [:a.btn.btn-primary
+      {:href (str"/entities/" entity-id "/transactions/new")
+       :title "Click here to enter a new transaction."}
+      "Add"])))

 (defn- item-row
   "Renders an individual row for a transaction item"
@@ -147,18 +152,16 @@
                      :transaction-date (t/today)}
                     {}))
   ([params transaction options]
-   (with-layout "New Transaction" options
-     [:div.row
-      [:div.col-md-6
-       [:form {:action (cond-> (path "/entities"
-                                     (:entity-id params)
-                                     "transactions")
-                         (contains? params :redirect) (query {:redirect (-> params
-                                                                            :redirect
-                                                                            url-encode)})
-                         true format-url)
-               :method :post}
-        (form-fields transaction (redirect-url (:entity-id params) params))]]])))
+   (with-transactions-layout "New Transaction" (:entity-id params) options
+     [:form {:action (cond-> (path "/entities"
+                                   (:entity-id params)
+                                   "transactions")
+                       (contains? params :redirect) (query {:redirect (-> params
+                                                                          :redirect
+                                                                          url-encode)})
+                       true format-url)
+             :method :post}
+      (form-fields transaction (redirect-url (:entity-id params) params))])))

 (defn- valid-item?
   [{account-id :account-id :as item}]
@@ -192,23 +195,21 @@
 (defn edit
   ([id-or-trans] (edit id-or-trans {}))
   ([id-or-trans options]
-   (with-layout "New Transaction" options
-     [:div.row
-      [:div.col-md-6
-       (let [transaction (if (map? id-or-trans)
-                           id-or-trans
-                           (transactions/find-by-id (env :db) id-or-trans))
-             action (cond-> (path "/transactions"
-                                  (:id transaction))
-
-                      (:redirect options)
-                      (query {:redirect (url-encode (:redirect options))})
-
-                      true
-                      format-url)]
-         [:form {:action action
-                 :method :post}
-          (form-fields transaction (redirect-url (:entity-id transaction) options))])]])))
+   (let [transaction (if (map? id-or-trans)
+                       id-or-trans
+                       (transactions/find-by-id (env :db) id-or-trans))
+         action (cond-> (path "/transactions"
+                              (:id transaction))
+
+                  (:redirect options)
+                  (query {:redirect (url-encode (:redirect options))})
+
+                  true
+                  format-url)]
+     (with-transactions-layout "New Transaction" (:entity-id transaction) options
+       [:form {:action action
+               :method :post}
+        (form-fields transaction (redirect-url (:entity-id transaction) options))]))))

 (defn update
   [params]


fix center tangent edge-case

fix center tangent edge-case

--- src/cljs/palimpsest/smoothing.cljs
+++ src/cljs/palimpsest/smoothing.cljs
@@ -6,10 +6,13 @@
   (Math/sqrt (+ (* (:x a) (:x a))
                 (* (:y a) (:y a)))))

+(defn zero-vector? [a]
+  (and (= 0 (:x a)) (= 0 (:y a))))
+
 ; returns the unit vector corresponding to vector a
 (defn v2-normalize [a]
-  (when (and (= 0 (:x a)) (= 0 (:y a)))
-    (.log js/console "Warning! Can't normalize zero vector"))
+  (when (zero-vector? a)
+    (throw "Can't normalize zero vector"))
   (let [mag (v2-mag a)]
     (Coord. (/ (:x a) mag)
             (/ (:y a) mag))))
@@ -27,14 +30,6 @@
 (defn v2-tangent [a b]
   (v2-normalize (v2-sub a b)))

-; computes the tangent of the center point b
-; the direction is in the "rightwards" direction
-(defn v2-center-tangent [a b c]
-  (let [left-tan (v2-sub b a)
-        right-tan (v2-sub c b)
-        avg-tan (v2-add left-tan right-tan)]
-    (v2-normalize avg-tan)))
-
 (defn v2-dist [a b]
   (v2-mag (v2-sub a b)))

@@ -48,6 +43,19 @@
   (+ (* (:x a) (:x b))
      (* (:y a) (:y b))))

+; computes the tangent of the center point b
+; returns both the "leftward-pointing" and "rightward-pointing" tangents
+(defn v2-center-tangents [a b c]
+  (let [left-tan (v2-tangent b a)
+        right-tan (v2-tangent c b)
+        avg-tan (v2-add left-tan right-tan)]
+    (if (zero-vector? avg-tan)
+      ; if left and right tangents are exactly opposite
+      ; normalization of the average would cause divide-by-zero
+      ; in this case, just give the normalized left and right tangents
+      [(v2-reverse left-tan) right-tan]
+      (let [normed-tan (v2-normalize avg-tan)]
+        [(v2-reverse normed-tan) normed-tan]))))

 (defn parameter-normalize [params]
   (let [last-t (last params)]
@@ -205,6 +213,15 @@
               newbezier (gen-bezier coords newparams tan1 tan2)]
           (recur newbezier newparams (inc i)))))))

+; having duplicate adjacent points screws up the distance
+; calculations, so we need to remove them before doing the fitting
+(defn dedup-points [coords]
+  (reduce (fn [result c]
+            (if (= 0 (v2-dist (last result) c))
+              result
+              (conj result c)))
+          [] coords))
+
 (defn fit-cubic
   ([coords]
     (fit-cubic coords
@@ -224,16 +241,15 @@
         (if (< max-error fit-error)
           [(adjust-bezier bezier coords params tan1 tan2
                           adjust-error max-adjust-iter)]
-          (let [center-tan (v2-center-tangent
-                             (nth coords (dec split-point))
-                             (nth coords split-point)
-                             (nth coords (inc split-point)))]
+          (let [[left-tan right-tan] (v2-center-tangents
+                                       (nth coords (dec split-point))
+                                       (nth coords split-point)
+                                       (nth coords (inc split-point)))]
             (vec (concat
                    (fit-cubic
-                     (subvec coords 0 (inc split-point)) tan1
-                     (v2-reverse center-tan))
+                     (subvec coords 0 (inc split-point)) tan1 left-tan)
                    (fit-cubic
-                      (subvec coords split-point) center-tan tan2)))))))))
+                      (subvec coords split-point) right-tan tan2)))))))))

 (defn path-length [coords]
   (first (reduce
@@ -244,15 +260,6 @@
 (defn bezier3-pw-calc [beziers t]
   (let [i (int t)]
     (bezier3-calc (nth beziers i) (- t i))))
-
-; having duplicate adjacent points screws up the distance
-; calculations, so we need to remove them before doing the fitting
-(defn dedup-points [coords]
-  (reduce (fn [result c]
-            (if (= 0 (v2-dist (last result) c))
-              result
-              (conj result c)))
-          [] coords))

 (defn interpolate-points [coords desired-seg-len]
   (let [path-len (path-length coords)]


Ah hah! I now see an always spinning cube. Progress!

--- src/cljs/real/webgl_cljs/real.cljs
+++ src/cljs/real/webgl_cljs/real.cljs
@@ -1,4 +1,12 @@
 (ns webgl-cljs.real)
+
+(defn run [renderer scene camera cube animating]
+  (.render renderer scene camera)
+
+  (if @animating
+    (set! (.-y (.-rotation cube)) (- (.-y (.-rotation cube)) 0.01)))
+
+  (.requestAnimationFrame js/window (partial run renderer scene camera cube animating)))

 (defn on-load []
   (let [container (.getElementById js/document "container")
@@ -17,10 +25,11 @@
               texture-map (. THREE.ImageUtils loadTexture map-url)
               material (THREE.MeshPhongMaterial. (clj->js {:map texture-map}))
               geometry (THREE.CubeGeometry. 1 1 1)
-              cube (THREE.Mesh. geometry material)]
+              cube (THREE.Mesh. geometry material)
+              animating (atom true)]
           (set! (.-x (.-rotation cube)) (/ Math/PI 5))
           (set! (.-y (.-rotation cube)) (/ Math/PI 5))
           (.add scene cube)
-          (.render renderer scene camera))))))
+          (run renderer scene camera cube animating))))))

 (set! (.-onload js/window) on-load)


Cleanup.

Cleanup.

--- src/cljs/town_client/analyser.cljs
+++ src/cljs/town_client/analyser.cljs
@@ -4,9 +4,11 @@

 (defn counts
   [values]
-  (reduce (fn [results value]
-            (assoc results (or value 0)
-                   (inc (or (results (or value 0)) 0))))
+  (reduce
+   (fn [results key]
+     (let [key     (or key 0)
+           current (or (results key) 0)]
+       (assoc results key (inc current))))
     {} values))

 (defn enum-proportions [respondents key]


CMR-5199: Added updates for properly wrapping request-id.

--- src/cmr/opendap/app/middleware.clj
+++ src/cmr/opendap/app/middleware.clj
@@ -2,7 +2,9 @@
   "Custom ring middleware for CMR OPeNDAP."
   (:require
    [clojusc.twig :refer [pprint]]
-   [cmr.ous.util.http.request :as request]
+   [cmr.ous.util.http.request :as ous-request]
+   [cmr.http.kit.app.middleware :as middleware]
+   [cmr.http.kit.request :as request]
    [cmr.http.kit.response :as response]
    [cmr.metadata.proxy.components.auth :as auth]
    [reitit.ring :as ring]
@@ -28,7 +30,9 @@

   For more details, see the docstring above for `wrap-auth`."
   {:data
-    {:middleware [#(wrap-auth % system)]}})
+    {:middleware [#(-> %
+                       middleware/wrap-request-id
+                       (wrap-auth system))]}})

 (defn wrap-api-version-dispatch
   ""
@@ -37,7 +41,7 @@
       site-routes route-data system (reitit-auth system)))
   ([site-routes {:keys [main-api-routes-fn plugins-api-routes-fns]} system opts]
     (fn [req]
-      (let [api-version (request/accept-api-version system req)
+      (let [api-version (ous-request/accept-api-version system req)
             plugins-api-routes (vec (mapcat #(% system api-version) plugins-api-routes-fns))
             api-routes (vec (main-api-routes-fn system api-version))
             routes (concat (vec site-routes) plugins-api-routes api-routes)
@@ -46,4 +50,4 @@
         (log/debug "Made routes:" (pprint routes))
         (response/version-media-type
           (handler req)
-          (request/accept-media-type-format system req))))))
+          (ous-request/accept-media-type-format system req))))))


Refactored code.

Refactored code.

--- src/cmr/umm/echo10/related_url.clj
+++ src/cmr/umm/echo10/related_url.clj
@@ -103,14 +103,19 @@
   [related-url]
   (= "GET DATA" (:type related-url)))

+(defn downloadable-urls
+  "Returns the related-urls that are downloadable"
+  [related-urls]
+  (filter downloadable-url? related-urls))
+
 (defn generate-access-urls
   "Generates the OnlineAccessURLs element of an ECHO10 XML from a UMM Granule related urls entry."
   [related-urls]
-  (let [downloadable-urls (filter downloadable-url? related-urls)]
-    (when-not (empty? downloadable-urls)
+  (let [urls (downloadable-urls related-urls)]
+    (when-not (empty? urls)
       (x/element
         :OnlineAccessURLs {}
-        (for [related-url downloadable-urls]
+        (for [related-url urls]
           (let [{:keys [url description]} related-url]
             (x/element :OnlineAccessURL {}
                        (x/element :URL {} url)


Fix short lines & all-numeric sampleID.

Fix short lines & all-numeric sampleID.

--- src/cgdata/core.clj
+++ src/cgdata/core.clj
@@ -295,10 +295,20 @@
   [lines]
   (concat (cons (ammend-sample-field (first lines)) (rest lines))))

+(defn fix-vec [v size]
+  (let [c (count v)]
+    (cond
+      (> c size) (subvec v 0 size)
+      (< c size) (apply conj v (repeat (- size c) ""))
+      :else v)))
+
 (defmethod matrix-data :default
   [metadata features lines]
-  (let [lines (ammend-lines lines)]
-    (chunked-pmap #(data-line features (tabbed %)) lines)))
+  (let [lines (ammend-lines lines)
+        ncols (count (tabbed (first lines)))]
+    (cons (data-line features (tabbed (first lines)) "category") ; coerce sampleID type
+          (chunked-pmap #(data-line features (fix-vec (tabbed %) ncols))
+                        (rest lines)))))

 (defn- transpose
   "Transpose cells of a tsv, using the first row to fix the number of columns."


Fixes bug in declining offers (#1271)

Fixes bug in declining offers (#1271)

--- scheduler/src/cook/mesos/mesos_compute_cluster.clj
+++ scheduler/src/cook/mesos/mesos_compute_cluster.clj
@@ -161,14 +161,14 @@
                       (sched/receive-offers offers-chan match-trigger-chan this pool-name offers))
                     (do
                       (log/warn "Declining" offer-count "offer(s) for non-existent pool" pool-name)
-                      (sched/decline-offers-safe driver offers)))
+                      (sched/decline-offers-safe compute-cluster offers)))
                   (if-let [offers-chan (get pool->offers-chan "no-pool")]
                     (do
                       (log/info "Processing" offer-count "offer(s) for pool" pool-name "(not using pools)")
                       (sched/receive-offers offers-chan match-trigger-chan this pool-name offers))
                     (do
                       (log/error "Declining" offer-count "offer(s) for pool" pool-name "(missing no-pool offer chan)")
-                      (sched/decline-offers-safe driver offers))))))
+                      (sched/decline-offers-safe compute-cluster offers))))))
             pool->offers)
           (log/debug "Finished receiving offers for all pools")))
       (status-update


Newline in recursive directory check output.

--- src/leiningen/ancient/check.clj
+++ src/leiningen/ancient/check.clj
@@ -55,7 +55,8 @@
   [path settings]
   (when-let [project (read-project-map! path)]
     (when (:recursive settings) (main/info "--" path))
-    (check-project-map! project settings)))
+    (check-project-map! project settings)
+    (when (:recursive settings) (main/info))))

 (defn check-project-directory!
   [path settings]


fix whitespace.

fix whitespace.

--- src/leiningen/ancient/check.clj
+++ src/leiningen/ancient/check.clj
@@ -1,4 +1,4 @@
-(ns ^{ :doc "Check for outdated dependencies."
+(ns ^{ :doc "Check for outdated dependencies."
        :author "Yannick Scherer" }
   leiningen.ancient.check
   (:require [leiningen.ancient.utils.projects :refer :all]
@@ -15,7 +15,7 @@
   "Checks the given artifact and stores the latest version in `:latest`."
   [repos settings {:keys [group-id artifact-id version] :as artifact}]
   (let [path (artifact-path artifact)]
-    (verbose "Checking " group-id "/" artifact-id " (current version: " (version-string version)
+    (verbose "Checking " group-id "/" artifact-id " (current version: " (version-string version)
              " at " (artifact-path artifact) ") ...")
     (assoc artifact :latest (anc/artifact-outdated? settings repos artifact))))

@@ -29,7 +29,7 @@
 ;; ## Console Interaction

 (defn print-outdated-message
-  "Takes an artifact map (containing the `:latest` element) and prints
+  "Takes an artifact map (containing the `:latest` element) and prints
    the \"[...] is available but we use ...\" message to stdout."
   [{:keys [group-id artifact-id version latest]}]
   (main/info


Call read-project from leiningen.core ns.

--- src/leiningen/checkout_deps.clj
+++ src/leiningen/checkout_deps.clj
@@ -5,8 +5,9 @@
 (defn checkout-deps-paths [project]
   (apply concat (for [dep (.listFiles (file (:root project) "checkouts"))]
                   ;; Note that this resets the leiningen.core/project var!
-                  (let [proj (read-project (.getAbsolutePath
-                                            (file dep "project.clj")))]
+                  (let [proj (binding [*ns* (find-ns 'leiningen.core)]
+                               (read-project (.getAbsolutePath
+                                              (file dep "project.clj"))))]
                       (for [d [:source-path :compile-path :resources-path]]
                         (proj d))))))


Add login string, remove back button

Add login string, remove back button

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -47,7 +47,8 @@
                                 (vlib/fa-icon "fa-sign-out")))
              (dom/div #js {:className "pointer"
                            :onClick   #(lib/change-view! :login)}
-                      (vlib/fa-icon "fa-sign-in")))))
+                      (vlib/fa-icon "fa-sign-in")
+                      " Login"))))

 (defn login-form [_ owner]
   (reify
@@ -76,10 +77,7 @@
                                         :placeholder "password"}))
                (dom/button #js {:className "btn btn-default"
                                 :onClick   #(auth/login nickname password)}
-                           "Login")
-               (dom/div #js {:className "text-center text-muted pointer"
-                             :onClick   #(lib/change-view! :discussion)}
-                        "Back")))))
+                           "Login")))))

 ;; Views
 (defn bubble-view [bubble]


Fix error-alert

Fix error-alert

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -316,7 +316,7 @@
                  [:span {:aria-hidden "true"}
                   (vlib/safe-html "×")]]
                 error])))))
-(def error-alert (nom/factor ErrorAlert))
+(def error-alert (nom/factory ErrorAlert))

 (defui ItemView
   static nom/IQuery


Split IPromiseState protocol from IPromise

--- src/futura/promise.clj
+++ src/futura/promise.clj
@@ -40,12 +40,15 @@
 ;; The main abstraction definition.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defprotocol IPromise
-  "A promise abstraction."
+(defprotocol IPromiseState
+  "Additional state related abstraction."
   (^:private rejected* [_] "Returns true if a promise is rejected.")
   (^:private resolved* [_] "Returns true if a promise is resolved.")
   (^:private done* [_] "Retutns true if a promise is already done.")
-  (^:private pending* [_] "Retutns true if a promise is stil pending.")
+  (^:private pending* [_] "Retutns true if a promise is stil pending."))
+
+(defprotocol IPromise
+  "A basic promise abstraction."
   (^:private then* [_ callback] "Chain a promise.")
   (^:private error* [_ callback] "Catch a error in a promise."))

@@ -122,7 +125,7 @@
           (.setStackTrace e' (.getStackTrace e))
           (throw e')))))

-  IPromise
+  IPromiseState
   (rejected* [_]
     (.isCompletedExceptionally cf))

@@ -137,6 +140,7 @@
   (pending* [_]
     (not (.isDone cf)))

+  IPromise
   (then* [_ callback]
     (let [cf' (.thenApply cf (reify java.util.function.Function
                                (apply [_ v]


master: Added stub functions for thread and label functions.

--- src/gmail_clj/core.clj
+++ src/gmail_clj/core.clj
@@ -228,6 +228,30 @@

 ; Users.labels

+(defn label-create
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn label-delete
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn label-list
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn label-update
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn label-get
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn label-patch
+  []
+  (throw (Exception. "Not yet implemented."))
+
 ; Users.messages

 (defn message-list
@@ -263,6 +287,30 @@

 ; Users.threads

+(defn thread-get
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn thread-list
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn thread-modify
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn thread-delete
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn thread-trash
+  []
+  (throw (Exception. "Not yet implemented."))
+
+(defn thread-untrash
+  []
+  (throw (Exception. "Not yet implemented."))
+
 ; Testing code...
 (set-client-id! "1027354928765-67in4888cilm4r81ek4s110asr59abnp.apps.googleusercontent.com")
 (set-client-secret! "qFt_o9ekrr7_OH2CH-ZlZLyx")


Fetch new repos before collecting db's during box add

Previously, a box add that named a new repo would report failure to find
project, even though it had just sucessfully fetched it.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -663,9 +663,9 @@
 (defn box-add
   "Add a lein project to this box"
   [proj & adeps]
-  (let [repo-dbs (all-repo-dbs)
-        deps (fold-args-as-meta (map edn/read-string adeps))]
-    (ensure-deps-repos deps)
+  (let [deps (fold-args-as-meta (map edn/read-string adeps))
+        _ (ensure-deps-repos deps)
+        repo-dbs (all-repo-dbs)]
     (doseq [dep deps
             :let [repo-infos (newest-voom-ver-by-spec repo-dbs dep (-> dep meta :voom))]]
       (println "box adding" (str (-> dep meta :voom)) dep)


removed heads section for now

removed heads section for now

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -33,16 +33,6 @@
               (chan/color 4 :white)]
    :name "Simple RGB"})

-(defn head280
-  "Head PHS 280"
-  ;; http://media.steinigke.de/documents_t/51838206-MANUAL-1.30-en-de_00054251.pdf
-  []
-  {:channels [(chan/tilt 1 :tilt)
-              (chan/pan 2 :pan)
-              (chan/functions 10 :shutter 0 "shutter-closed" 32 "shutter-open")
-              (chan/dimmer 11)]
-   :name "Head PHS 280"})
-
 (defn use-my-show
   "Set up the show on the OLA universes it actually needs."
   []
@@ -62,9 +52,6 @@

   ;; 2DO: find what "rgb-1" means and where to look for documentation
   (show/patch-fixture! :rgb-1 (my-rgb) 1 1)
-
-  ;; Code below isn't working :(
-  ;; (show/patch-fixture! :head-1 (head280) 1 220)

   ;; Return the show's symbol, rather than the actual map, which gets huge with
   ;; all the expanded, patched fixtures in it.


Remove debug logs

Remove debug logs

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -65,7 +65,6 @@

 (defn- format-timestamp
   [timestamp col]
-  (log/info timestamp)
   (case (:unit col)
     :hour (f/unparse (f/formatter "h a - MMM YYYY") (c/from-long timestamp))
     :week (f/unparse (f/formatter "w - YYYY") (c/from-long timestamp))
@@ -80,7 +79,6 @@

 (defn- format-cell
   [value col]
-  (log/info value)
   (cond
     (instance? java.util.Date value) (format-timestamp (.getTime value) col)
     (and (number? value) (not (datetime-field? col))) (format-number value)


Add url definitions for chapters and scenes

--- src/storemi/urlfor.clj
+++ src/storemi/urlfor.clj
@@ -16,8 +16,8 @@
 (defurl user-index story-index "/:username")

 (defurl story user-index "/:story-id")
-(defurl chapter story "/chapter/:chapter")
-(defurl scene chapter "/scene/:scene")
+(defurl chapter story "/chapter/:chapter-id")
+(defurl scene chapter "/scene/:scene-id")

 (defurl story-delete story "/delete")
 (defurl story-edit story "/edit")


fix tests

fix tests

--- src/tabby/follower.clj
+++ src/tabby/follower.clj
@@ -40,7 +40,7 @@
         (utils/transmit {:dst (:src p)
                          :src (:id state)
                          :type :request-vote-reply
-                         :body {:current-term (:current-term state)
+                         :body {:term (:current-term state)
                                  :vote-granted? vote-granted?}}))))

 (defn check-election-timeout


Fix NPE in mine finder

Fix NPE in mine finder

--- src/vindinium/bots.clj
+++ src/vindinium/bots.clj
@@ -413,7 +413,7 @@
             (map first)
             (mapcat
              (fn [path]
-               (let [ps (map #(shortest-path board
+               (let [ps (keep #(shortest-path board
                                              (fn [pos] (and (passable? board pos)
                                                             (not (contains? blacklist pos))
                                                             (not (m/enemy-hero? id (m/tile board pos)))))
@@ -421,6 +421,7 @@
                                              % (last (butlast path)))
                              adj-pos)
                      min-len (apply min (map count ps))]
+                 (println ps min-len)
                  (map first (filter #(= min-len (count %)) ps)))))
             (distinct)
             (map #(-> [(sim/move->direction (m/pos game id) %) 1])))))))


Set new filedata on files created by `content-pre-wrap`

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -155,13 +155,14 @@
                                                   :path page-filepath
                                                   :filename (string/replace filename
                                                                             ext-pattern ".html"))
-                                           (dissoc :parsed :extension :file-type :full-path
-                                                   :mime-type :original))]
+                                           (dissoc :parsed :original))]
                              (perun/create-file tmp page-filepath parsed)
                              entry)))
-            new-fs (-> input-fs
-                       (commit tmp)
-                       (pm/set-meta output-meta))]
+            new-fs* (-> input-fs
+                        (commit tmp)
+                        (pm/set-meta output-meta))
+            filedata (add-filedata (boot/by-path (map :path output-meta) (boot/ls new-fs*)))
+            new-fs (pm/set-meta new-fs* filedata)]
         (reset! prev-fs new-fs)
         new-fs))))


Add new keys to doc ordering.

Add new keys to doc ordering.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -1116,7 +1116,8 @@
     :onyx/flux-policy
     :onyx/uniqueness-key
     :onyx/deduplicate?
-    :onyx/restart-pred-fn]
+    :onyx/restart-pred-fn
+    :onyx/required-tags]
    :flow-conditions-entry
    [:flow/from :flow/to :flow/predicate :flow/exclude-keys :flow/short-circuit?
     :flow/thrown-exception?  :flow/post-transform :flow/action :flow/doc]
@@ -1152,6 +1153,7 @@
     :onyx.peer/backpressure-check-interval
     :onyx.peer/backpressure-low-water-pct
     :onyx.peer/backpressure-high-water-pct :onyx.windowing/min-value
+    :onyx.peer/tags
     :onyx.zookeeper/backoff-base-sleep-time-ms
     :onyx.zookeeper/backoff-max-sleep-time-ms
     :onyx.zookeeper/backoff-max-retries :onyx.messaging/inbound-buffer-size


Fixes double completion bug.

Fixes double completion bug.

--- src/onyx/peer/task_pipeline.clj
+++ src/onyx/peer/task_pipeline.clj
@@ -76,9 +76,11 @@
   (extensions/close-resource queue session)
   (assoc event :closed true))

-(defn munge-complete-task [{:keys [sync completion-node tail-batch?] :as event}]
+(defn munge-complete-task
+  [{:keys [sync completion-node peer-node peer-version tail-batch?] :as event}]
   (when tail-batch?
-    (extensions/touch-place sync completion-node))
+    (if (= (extensions/version sync peer-node) peer-version)
+      (extensions/touch-place sync completion-node)))
   event)

 (defn open-session-loop [read-ch kill-ch pipeline-data]


Allow opting out of streaming during scenario execution

--- src/org/spootnik/fleet/http.clj
+++ src/org/spootnik/fleet/http.clj
@@ -52,6 +52,7 @@

      (GET "/scenarios/:script_name/executions" request
           (let [script_name (-> request :params :script_name)
+                stream      (not= "false" (get-in request [:params :stream] "true"))
                 args        (if-let [args (-> request :params :args)]
                               (if (sequential? args) args [args])
                               [])
@@ -70,13 +71,15 @@
                 headers     (if valid-cors
                               (merge (cors-hdrs (request :headers)) headers)
                               headers)]
+
             (future
               (try
                 (doseq [msg (repeatedly #(<!! ch))
                         :while msg
                         :when msg]
                   (history/update script_name msg)
-                  (put! resp (format "data: %s\n\n" (generate-string msg)))
+                  (when stream
+                    (put! resp (format "data: %s\n\n" (generate-string msg))))
                   (put! publisher (merge {:topic :events} msg)))
                 (catch Exception e
                   (error e "cannot handle incoming message"))
@@ -85,12 +88,15 @@

             (infof "sending request for %s [profile:%s] [matchargs:%s] [args:%s]"
                    scenario profile matchargs args)
-            (engine/request engine
-                            (api/prepare scenario profile matchargs args)
-                            ch)
-            {:status 200
-             :headers headers
-             :body resp}))
+            (let [data (engine/request
+                         engine
+                         (api/prepare scenario profile matchargs args)
+                         ch)]
+              (if stream
+                {:status 200
+                 :headers headers
+                 :body resp}
+                (json-response data)))))

      (GET "/events" request
           (let [channel    (chan 10)


[CS] Shorten test output for large failures

--- test/vip/data_processor/test_helpers.clj
+++ test/vip/data_processor/test_helpers.clj
@@ -1,5 +1,7 @@
 (ns vip.data-processor.test-helpers
   (:require [clojure.test :refer :all]))
+
+(set! *print-length* 10)

 (def problem-types [:warnings :errors :critical :fatal])


remove netty dependency from storm-core/project.clj

--- storm-core/project.clj
+++ storm-core/project.clj
@@ -27,7 +27,6 @@
                  [com.google.guava/guava "13.0"]
                  [ch.qos.logback/logback-classic "1.0.6"]
                  [org.slf4j/log4j-over-slf4j "1.6.6"]
-                 [io.netty/netty "3.6.3.Final"]
                  ]

   :source-paths ["src/clj"]


Make sure the require alias is unique

Make sure the require alias is unique

--- src/mdr2/abacus.clj
+++ src/mdr2/abacus.clj
@@ -22,7 +22,7 @@
             [immutant.messaging :as msg]
             [environ.core :refer [env]]
             [mdr2.queues :as queues]
-            [mdr2.production :as production]
+            [mdr2.production :as prod]
             [mdr2.abacus.validation :as validation]))

 (def ^:private root-path [:Task :Transaction :DocumentData])
@@ -93,7 +93,7 @@
   "Import a recorded production from file `f`"
   [f]
   (let [{product_number :product_number} (read-file f)
-        production (production/find-by-productnumber product_number)]
+        production (prod/find-by-productnumber product_number)]
     (msg/publish queues/encode-queue production)
     f))

@@ -114,7 +114,7 @@

 (defn import-status-request [f]
   (let [{product_number :product_number} (read-file f)
-        production (production/find-by-productnumber product_number)]
+        production (prod/find-by-productnumber product_number)]
     (msg/publish queues/notify-abacus-queue production)
     f))

@@ -189,7 +189,7 @@
         ;; to the db?
         (create-row 252 produced_date) ; Date of production end
         (create-row 274 date) ; Date of production start
-        (create-row 4 (production/dam-number production))] ; for legacy purposes
+        (create-row 4 (prod/dam-number production))] ; for legacy purposes
        (remove nil?) ; remove empty rows
        wrap-rows ; wrap the payload
        (map-indexed #(conj %2 %1)) ; number each row


Some crude error handling when the encoding fails

also move to the natural keys scheme for states

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -98,12 +98,15 @@
   (if-let [bitrate (ideal-bitrate production)]
     (do
       ;; encode the production
-      (encode-production production bitrate)
-      ;; downgrade to daisy202
-
-      ;; create an iso
-      (create-iso production)
-      ;; set the state to encoded
-      (prod/update! (assoc production :state :encoded)))
+      (let [result (encode-production production bitrate)]
+        (if (not= 0 (:exit result))
+          (log/errorf "Encoding failed with %s" (:err result))
+          (do
+            ;; downgrade to daisy202
+            (downgrade production)
+            ;; create an iso
+            (create-iso production)
+            ;; set the state to encoded
+            (prod/update! (assoc production :state "encoded"))))))
     ;; otherwise move the production to state :pending-volume-split
-    (prod/update! (assoc production :state :pending-volume-split))))
+    (prod/update! (assoc production :state "pending-split"))))


AnnotationAJ normalization

AnnotationAJ normalization

--- src/be/ac/ua/aspchecker/model.clj
+++ src/be/ac/ua/aspchecker/model.clj
@@ -37,7 +37,7 @@

 (defn annotations-bindings
-  "All annotations with their bindings"
+  "All annotations and their bindings"
   []
   (ek/ekeko [?annotation ?binding]
             (astb/ast|annotation-binding|annotation
@@ -80,7 +80,7 @@
               ?annotation
               "be.ac.ua.aspchecker.annotations.invariant")))

-
+;TODO maybe descompose in a simpler function and apply
 (defn binded|annotations
   "Annotation bindings"
   []
@@ -91,11 +91,41 @@
       result)))

+;TODO maybe descompose in a simpler function and apply
 (defn advice-annotation
-  "Return pairs BcelAdvice, AnnotationAJ[]"
+  "Return pairs < BcelAdvice, AnnotationAJ vector > with all
+the annotations corresponding to an advice"
   []
-  (loop[result nil, raw (advice-shadow)]
+  (loop[result [], raw (advice-shadow)]
     (if (seq raw)
       (let [[adv _] (first raw)]
-        (recur (cons [adv (.getAnnotations (.getSignature adv))] result) (rest raw)))
+        (recur (cons [adv (into [] (.getAnnotations (.getSignature adv)))] result) (rest raw)))
+      result)))
+
+
+(defn annotationtype
+  "Returns the annotation type in keyword form"
+  [an]
+  (cond
+    (.equals (.getTypeName an) "be.ac.ua.aspchecker.annotations.requires")
+    (keyword "requires")
+    (.equals (.getTypeName an) "be.ac.ua.aspchecker.annotations.ensures")
+    (keyword "ensures")
+    (.equals (.getTypeName an) "be.ac.ua.aspchecker.annotations.invariant")
+    (keyword "invariant")
+    (.equals (.getTypeName an) "be.ac.ua.aspchecker.annotations.advisedBy")
+    (keyword "advisedBy")))
+
+
+(defn annotationaj-to-normalized
+  "Receives an annotation list and returns a map with their type as keyword
+and their value as stored value"
+  [annotations]
+  (loop [result {}, ans annotations]
+    (if (seq ans)
+      (let[a (first ans)]
+        (if  (nil? (annotationtype a))
+          (recur result (rest ans))
+          (recur (assoc result (annotationtype a) (.getStringFormOfValue a "value"))
+                 (rest ans))))
       result)))


Fix lookup select bug

Fix lookup select bug

--- src/qcast/cache.clj
+++ src/qcast/cache.clj
@@ -42,7 +42,7 @@
       (warn "Presentation already exists" item))))

 (defn lookup [id]
-  (map post-process (db/select' db-spec :presentations (db/where {:id id}))))
+  (map post-process (db/select' db-spec * :presentations (db/where {:id id}))))

 (defn latest
   ([] (first (latest 1)))


pointless set

pointless set

--- src/shuppet/elb.clj
+++ src/shuppet/elb.clj
@@ -127,8 +127,8 @@
     config))

 (defn- ensure-security-groups [{:keys [local remote] :as config}]
-  (let [remote (set (-> remote
-                        (get-elements [:SecurityGroups :member children])))
+  (let [remote (-> remote
+                    (get-elements [:SecurityGroups :member children]))
         name (elb-name local)
         local (:SecurityGroups local)]
     (when-not (= (set local) (set remote))


fix keys

fix keys

--- src/specly/core.clj
+++ src/specly/core.clj
@@ -320,11 +320,11 @@
                                   ::misspelled-key unknown-key
                                   ::correct-key suggest))]
                             (if-let [replace-suggest (replacement-suggestion spec-key-data x unknown-key)]
-                              [(conj pred-path :misspelled-key unknown-key)
+                              [(conj pred-path :wrong-key unknown-key)
                                (-> exp-data
                                    (assoc
-                                    ::misspelled-key unknown-key
-                                    ::correct-key suggest))]
+                                    ::wrong-key unknown-key
+                                    ::correct-key replace-suggest))]
                               [(conj pred-path :unknown-key unknown-key)
                                (-> exp-data
                                    (assoc ::unknown-key unknown-key))]))))))))))


Improve tests

Improve tests

--- test/gigrig/powertree_test.cljs
+++ test/gigrig/powertree_test.cljs
@@ -3,6 +3,8 @@
             [clojure.zip :as zip]
             [gigrig.powertree :as ptree]))

+;; HELPERS
+;; =======
 (defn echo [arg]
   (.log js/console arg)
   arg)
@@ -12,11 +14,20 @@
    :name (str "pedal" n)
    :distributor true})

+(defn distributor-pedals [n]
+  (for [i (range 1 (inc n))]
+    (distributor-pedal i)))
+
 (defn isolator-pedal [n]
   {:type :pedal
    :name (str "pedal" n)
    :distributor true
    :isolator true})
+
+(defn isolator-pedals
+  ([n] (isolator-pedals 1 n))
+  ([from to] (for [i (range from (inc to))]
+               (isolator-pedal i))))

 (deftest simplify
   (is (= {:power :distributor :name "pedal1"} (ptree/simplify (distributor-pedal 1))))
@@ -53,8 +64,12 @@

 (deftest build
   (is (eql-zip [:distributor [:pedal "pedal1"] [:pedal "pedal2"] [:pedal "pedal3"] [:pedal "pedal4"] [:pedal "pedal5"] [:pedal "pedal6"]]
-               (ptree/build (for [n (range 1 7)] (distributor-pedal n)))))
+               (ptree/build (distributor-pedals 6))))
   (is (eql-zip [:distributor [:pedal "pedal1"] [:pedal "pedal2"] [:pedal "pedal3"] [:pedal "pedal4"] [:pedal "pedal5"] [:distributor [:pedal "pedal6"] [:pedal "pedal7"]]]
-               (ptree/build (for [n (range 1 8)] (distributor-pedal n)))))
+               (ptree/build (distributor-pedals 7))))
   (is (eql-zip [:distributor [:pedal "pedal1"] [:pedal "pedal2"] [:isolator [:pedal "pedal3"] [:pedal "pedal4"]]]
-               (ptree/build [(distributor-pedal 1) (distributor-pedal 2) (isolator-pedal 3) (isolator-pedal 4)]))))
+               (ptree/build [(distributor-pedal 1) (distributor-pedal 2) (isolator-pedal 3) (isolator-pedal 4)])))
+  (is (eql-zip [:distributor [:pedal "pedal7"] [:isolator [:pedal "pedal1"] [:pedal "pedal2"] [:pedal "pedal3"] [:pedal "pedal4"]] [:isolator [:pedal "pedal5"] [:pedal "pedal6"]]]
+               (ptree/build (cons (distributor-pedal 7) (isolator-pedals 6)))))
+  (is (eql-zip [:distributor [:pedal "pedal1"] [:pedal "pedal2"] [:pedal "pedal3"] [:pedal "pedal4"] [:pedal "pedal5"] [:isolator [:pedal "pedal6"] [:pedal "pedal7"]]]
+               (ptree/build (concat (distributor-pedals 5) (isolator-pedals 6 7))))))


cjl - Remove unused import

cjl - Remove unused import

--- test/icfp2015/gameplay_test.clj
+++ test/icfp2015/gameplay_test.clj
@@ -1,6 +1,5 @@
 (ns icfp2015.gameplay-test
   (:require [clojure.test :refer :all]
-            [icfp2015.board :as board]
             [icfp2015.gameplay :refer :all :as gameplay]))

 (deftest handle-unit-test


clojure.spec was throwing classcastexceptions on this

While removing :reload-all fixed it, I couldn't figure out the root
cause.  :/

Caused by: java.lang.ClassCastException:
clojure.spec.alpha$regex_spec_impl$reify__1340 cannot be cast to
clojure.lang.IFn

--- test/runbld/test/build_test.clj
+++ test/runbld/test/build_test.clj
@@ -1,7 +1,7 @@
 (ns runbld.test.build-test
   (:require [clojure.test :refer :all]
-            [schema.test])
-  (:require [runbld.build :as build] :reload-all))
+            [runbld.build :as build]
+            [schema.test :as s]))

 (use-fixtures :once schema.test/validate-schemas)


Update reader.clj

Update reader.clj

--- src/yaml/reader.clj
+++ src/yaml/reader.clj
@@ -21,12 +21,8 @@
   "When *keywordize* is bound to true decode map keys into keywords else leave them
   as strings. When *keywordize* is a function, calls function on the key."
   [k]
-  (cond (true? *keywordize*)
-        (keyword k)
-
-        (fn? *keywordize*)
-        (*keywordize* k)
-
+  (cond (true? *keywordize*) (keyword k)
+        (fn? *keywordize*) (*keywordize* k)
         :else k))

 (extend-protocol YAMLReader


Added healthcheck.

Added healthcheck.

--- src/onix/web.clj
+++ src/onix/web.clj
@@ -66,6 +66,16 @@
 (def json-content-type "application/json;charset=UTF-8")
 (def text-plain-type "text/plain;charset=UTF-8")

+(def healthcheck-response
+  {:status 200
+   :headers {"Content-Type" "text/plain"}
+   :body "I am healthy. Thank you for asking."})
+
+(def healthcheck-error-response
+  {:status 500
+   :headers {"Content-Type" "text/plain"}
+   :body "I am unwell. Check my logs."})
+
 (def ^:dynamic *version* "none")
 (defn set-version! [version]
   (alter-var-root #'*version* (fn [_] version)))
@@ -159,10 +169,16 @@
         [] (status))

    (GET "/pokemon"
-        [] (response pokemon "text/plain;charset=UTF-8"))
+        [] (response pokemon text-plain-type))

    (context "/applications"
             [] applications-routes))
+
+  (GET "/healthcheck" []
+    (let [dynamo-health (future (persistence/dynamo-health-check))]
+      (if @dynamo-health
+        healthcheck-response
+        healthcheck-error-response)))

   (route/not-found (error-response "Resource not found" 404)))


Validate workflow keys against :onyx/name vals in the catalog.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -40,11 +40,30 @@
             (do (<!! ch)
                 (recur))))))))

+(defn flatten-workflow [workflow]
+  (concat (keys workflow)
+          (mapcat (fn [v]
+                    (if (map? v)
+                      (flatten-workflow v)
+                      (list v)))
+            (vals workflow))))
+
+
+(defn validate-workflow-names [{:keys [workflow catalog]}]
+  (when-let [missing-names (->> workflow
+                                flatten-workflow
+                                (filter (complement (set (map :onyx/name catalog))))
+                                seq)]
+    (throw (Exception. (str "Catalog is missing :onyx/name values "
+                            "for the following workflow keywords: "
+                            (apply str (interpose ", " missing-names)))))))
+
 ;; A coordinator that runs strictly in memory. Peers communicate with
 ;; the coordinator by directly accessing its channels.
 (deftype InMemoryCoordinator [onyx-coord]
   ISubmit
   (submit-job [this job]
+    (validate-workflow-names job)
     (let [ch (chan 1)
           node (extensions/create (:sync onyx-coord) :plan)
           cb #(>!! ch (extensions/read-node (:sync onyx-coord) (:path %)))]


serve static resources from public

serve static resources from public

--- src/otto/web.clj
+++ src/otto/web.clj
@@ -1,7 +1,9 @@
 (ns otto.web
-  (:require [compojure.core     :as c]
-            [ring.util.response :as r]
-            [otto.html          :as html]))
+  (:require [compojure.core               :as compojure]
+            [otto.html                    :as html]
+            [ring.middleware.content-type :as content-type]
+            [ring.middleware.not-modified :as not-modified]
+            [ring.middleware.resource     :as resource]))

 (defn- make-state
   [organizations repositories]
@@ -21,12 +23,18 @@
        (html/organization-view organizations
                                organization
                                (.items repositories organization))))))
+(defn- make-routes-fn
+  [state]
+  (compojure/defroutes web-routes
+    (compojure/GET "/:organization-name" [organization-name]
+      (show-organization state organization-name))
+    (compojure/GET "/" []
+      (show-organization state))))

 (defn make-handler-fn
-  [o r]
-  (let [s (make-state o r)]
-    (c/defroutes web-routes
-      (c/GET "/:organization" [organization]
-             (show-organization s organization))
-      (c/GET "/" []
-             (show-organization s)))))
+  [organizations repositories]
+  (let [state (make-state organizations repositories)]
+    (-> (make-routes-fn state)
+        (resource/wrap-resource "public")
+        (content-type/wrap-content-type)
+        (not-modified/wrap-not-modified))))


Logs largest job, offer by resource

Logs largest job, offer by resource

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -583,19 +583,28 @@
                  mem {50 ..., 95 ..., 100 ...}}
    :totals {mem ..., cpus ..., ...}}"
   [resource-maps]
-  {:percentiles (pc/map-from-keys
-                  (fn percentiles
-                    [resource]
-                    (let [resource-values (->> resource-maps
-                                               (map #(get % resource))
-                                               (remove nil?))]
-                      (-> resource-values
-                          (task-stats/percentiles 50 95 100)
-                          tools/format-resource-map)))
-                  ["cpus" "mem"])
-   :totals (->> resource-maps
-                (reduce (partial merge-with +))
-                tools/format-resource-map)})
+  (let [resources-of-interest ["cpus" "mem"]]
+    {:largest-by (pc/map-from-keys
+                   (fn percentiles
+                     [resource]
+                     (->> resource-maps
+                          (sort-by #(get % resource))
+                          last
+                          tools/format-resource-map))
+                   resources-of-interest)
+     :percentiles (pc/map-from-keys
+                    (fn percentiles
+                      [resource]
+                      (let [resource-values (->> resource-maps
+                                                 (map #(get % resource))
+                                                 (remove nil?))]
+                        (-> resource-values
+                            (task-stats/percentiles 50 95 100)
+                            tools/format-resource-map)))
+                    resources-of-interest)
+     :totals (->> resource-maps
+                  (reduce (partial merge-with +))
+                  tools/format-resource-map)}))

 (defn offers->stats
   "Given a collection of offers, returns stats about the offers"


Avoids future for Mesos launch-tasks! call (#1546)

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -780,11 +780,14 @@
           (->> (group-by match->compute-cluster matches)
                (map
                  (fn [[compute-cluster matches-in-compute-cluster]]
-                   (future
-                     (launch-matches! compute-cluster pool-name
-                                      matches-in-compute-cluster fenzo))))
+                   (let [launch-matches-in-compute-cluster!
+                         #(launch-matches! compute-cluster pool-name
+                                           matches-in-compute-cluster fenzo)]
+                     (if (:mesos-config compute-cluster)
+                       (launch-matches-in-compute-cluster!)
+                       (future (launch-matches-in-compute-cluster!))))))
                doall
-               (run! deref)))))))
+               (run! #(when (future? %) (deref %)))))))))

 (defn update-host-reservations!
   "Updates the rebalancer-reservation-atom with the result of the match cycle.