Tweak output layout

Tweak output layout

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -49,24 +49,25 @@
 (defn pinpoint-out
   ([ed] (pinpoint-out ed {}))
   ([{:keys [::s/problems ::s/spec ::s/value] :as ed} {:keys [colorize]}]
-   (hline)
-   (doseq [[i problem] (map-indexed vector problems)
-           :let [trace (trace/trace problem spec value)
-                 [line & lines] (format-data value trace)]]
-     (when (not= i 0)
-       (hline))
-     (println "     Input:" line)
-     (doseq [line lines]
-       (println "          :" line))
-     (let [[line & lines] (-> (with-out-str
-                                (fipp/pprint (:pred problem)))
-                              (str/split #"\n"))]
-       (println "  Expected:" line)
-       (doseq [line lines]
-         (println "           " line)))
-     (when-let [reason (:reason problem)]
-       (println "    Reason:" reason)))
-   (hline)))
+   (if ed
+     (do (println "Some spec errors were detected:")
+         (hline)
+         (doseq [problem problems
+                 :let [trace (trace/trace problem spec value)
+                       [line & lines] (format-data value trace)]]
+           (println "     Input:" line)
+           (doseq [line lines]
+             (println "          :" line))
+           (let [[line & lines] (-> (with-out-str
+                                      (fipp/pprint (:pred problem)))
+                                    (str/split #"\n"))]
+             (println "  Expected:" line)
+             (doseq [line lines]
+               (println "           " line)))
+           (when-let [reason (:reason problem)]
+             (println "    Reason:" reason))
+           (hline)))
+     (println "Success!"))))

 (defn pinpoint
   ([spec x] (pinpoint spec x {}))


Revert "use refs for db connections"

Revert "use refs for db connections"

This reverts commit 260650c0a0fd064727820909f18fee0e7e57ac51.

--- src/polismath/poller.clj
+++ src/polismath/poller.clj
@@ -67,14 +67,12 @@
                (encode-seq (into-array v) jsonGenerator)))

-(def poll-interval   1000)
-(def pg-spec         (ref nil))
-(def mg-db           (ref nil))
+(def poll-interval 1000)
+(def pg-spec         (heroku-db-spec (env/env :database-url)))
+(def mg-db           (mongo-connect! (env/env :mongo-url)))
 (def last-timestamp  (atom 0))
 (def conversations   (atom {})) ; generated artifacts
 (def pending-votes   (ref {})) ; zid -> votes
-
-

 (def dinner-bell (Object.))
 (def active-zids (ref #{}))
@@ -190,10 +188,6 @@
 (defn -main []
   (println "launching poller " (System/currentTimeMillis))

-  (dosync
-   (ref-set pg-spec  (heroku-db-spec (env/env :database-url)))
-   (ref-set mg-db (mongo-connect! (env/env :mongo-url))))
-
   (let [threads (map #(Thread. %1)
                      (map make-worker-thread
                           (range 4)))]
@@ -203,10 +197,9 @@

   (endlessly poll-interval
       (println "poll >" @last-timestamp)
-      (let [new-votes (poll @pg-spec @last-timestamp)
+      (let [new-votes (poll pg-spec @last-timestamp)
             zid-to-votes (group-by :zid new-votes)
             zid-votes (into [] zid-to-votes)
-
             ]
         (if (> (count zid-votes) 0)
           (do


Fixed a bug with /export

Fixed a bug with /export

When a sequence label is present a special unicode character
is used to indicate the label is a sequence label. However
the export routine was not able to successfully encode it.
Now export process ensure the characters are "safe".

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/planviz/actions.cljs
+++ src/planviz/actions.cljs
@@ -1463,10 +1463,21 @@
         dcss))))

 (defn string->octet-array [s]
-  (into-array (map #(.charCodeAt % 0) s)))
+  ;; (into-array (doall (map #(.charCodeAt % 0) s))))
+  (clj->js (mapv #(.charCodeAt % 0) s)))
+
+(defn safe-octet-array [s]
+  (loop [octets [] ch (first s) more (rest s)]
+    (if-not ch
+      (into-array octets)
+      (if (= ch "▹")
+        (recur (conj (conj octets 45) 62) (first more) (rest more)) ;; "->"
+        (let [ascii (.charCodeAt ch 0)
+              ascii (if (or (< ascii 0) (> ascii 255)) 32 ascii)] ;; wierd to space
+          (recur (conj octets ascii) (first more) (rest more)))))))

 (defn create-data-url [data-str mime-type]
-  (let [data (string->octet-array data-str)
+  (let [data (safe-octet-array data-str)
         data-base64 (base64/encodeByteArray data)]
     (str "data:" mime-type ";base64," data-base64)))

@@ -1477,23 +1488,24 @@
         application (gdom/getElement "application")
         plans (gdom/getElement "plans")
         svg (.-innerHTML plans)
-        lt (inc (string/index-of svg ">"))
+        gt (inc (string/index-of svg ">"))
         svg-header "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
         svg-begin "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n "
         css-begin "\n<style type=\"text/css\">\n<![CDATA[\n"
         css-end "\n]]>\n</style>\n"
-        svg (str svg-header svg-begin (subs svg 4 lt)
+        svg (str svg-header svg-begin (subs svg 4 gt)
               css-begin css css-end
-              (string/replace (subs svg lt) #">" ">\n"))
+              (string/replace (subs svg gt) #">" ">\n"))
         dataurl (create-data-url svg "image/svg+xml")
         a (.createElement js/document "a")]
     (println "exporting" show-plan "as" filename)
     (set! (.-id a) "download")
     (set! (.-download a) filename)
+    (set! (.-innerText a) filename)
     (set! (.-href a) dataurl)
     (.appendChild application a)
     (.click a)
-    (tasks/timeout #(.removeChild application a) 5)
+    (tasks/timeout #(.removeChild application a) 10)
     true))

 (defn export []


Enhanced the push event handler. Closing issue #4. Thanks to @tuhlmann!

--- src/rente/client/ws.cljs
+++ src/rente/client/ws.cljs
@@ -1,6 +1,12 @@
 (ns rente.client.ws
   (:require [taoensso.sente :as sente]
             [taoensso.sente.packers.transit :as sente-transit]))
+
+(defmulti push-msg-handler (fn [[id _]] id)) ; Dispatch on event key which is 1st elem in vector
+
+(defmethod push-msg-handler :rente/testevent
+  [[_ event]]
+  (js/console.log "PUSHed :rente/testevent from server: %s " (pr-str event)))

 (defmulti event-msg-handler :id) ; Dispatch on event-id
 ;; Wrap for logging, catching, etc.:
@@ -8,10 +14,6 @@
 (defmethod event-msg-handler :default ; Fallback
     [{:as ev-msg :keys [event]}]
     (js/console.log "Unhandled event: %s" (pr-str event)))
-
-(defmethod event-msg-handler :rente/testevent
-  [{:as ev-msg :keys [?data]}]
-    (js/console.log "Testevent received from server"))

 (defmethod event-msg-handler :chsk/state
   [{:as ev-msg :keys [?data]}]
@@ -21,10 +23,9 @@

 (defmethod event-msg-handler :chsk/recv
   [{:as ev-msg :keys [?data]}]
-  (js/console.log "Push event from server: %s" (pr-str ?data)))
+  (push-msg-handler ?data))

 (defn event-msg-handler* [{:as ev-msg :keys [id ?data event]}]
-  ;(js/console.log "Event: %s" (pr-str event))
   (event-msg-handler ev-msg))

 (let [packer (sente-transit/get-flexi-packer :edn)
@@ -39,7 +40,10 @@
 (sente/start-chsk-router! ch-chsk event-msg-handler*)

 (defn test-socket-callback []
-  (chsk-send! [:rente/testevent {:message "Hello socket Callback!"}] 2000 #(js/console.log "Callback received: " (pr-str %))))
+  (chsk-send!
+    [:rente/testevent {:message "Hello socket Callback!"}]
+    2000
+    #(js/console.log "CALLBACK from server: " (pr-str %))))

 (defn test-socket-event []
   (chsk-send! [:rente/testevent {:message "Hello socket Event!"}]))


Use bufs-ss var.

Use bufs-ss var.

--- src/rewindable/core.cljs
+++ src/rewindable/core.cljs
@@ -47,7 +47,7 @@
                                                                   (:smas-new ss)
                                                                   (:smas-new @agw))]
       (swap! agw #(-> %
-                      (assoc :bufs (:bufs ss))
+                      (assoc :bufs bufs-ss)
                       (assoc :smas recycled-smas)
                       (assoc :smas-new recycled-smasN)))
       (doseq [[sma-old ss-buf] reborn-smas]


improved error text

improved error text

--- src/selmer/validator.clj
+++ src/selmer/validator.clj
@@ -70,7 +70,7 @@

Template Compilation Error

-
{{error}}

+
{{error}}.

In {{template}}{% if line %} on line {{line}}{% endif %}.


CMR-1753: Make it clearer where DIF10 Entry_ID is pulled from

--- umm-lib/src/cmr/umm/dif10/collection.clj
+++ umm-lib/src/cmr/umm/dif10/collection.clj
@@ -46,33 +46,31 @@
          :update-time (t/string->datetime update-time)
          :delete-time (t/string->datetime delete-time)}))))

-
 (defn- xml-elem->Collection
   "Returns a UMM Product from a parsed Collection XML structure"
   [xml-struct]
-  (let [product (xml-elem->Product xml-struct)]
-    (c/map->UmmCollection
-      {:entry-id (:short-name product)
-       :entry-title (cx/string-at-path xml-struct [:Entry_Title])
-       :personnel (personnel/xml-elem->personnel xml-struct)
-       :science-keywords (sk/xml-elem->ScienceKeywords xml-struct)
-       :platforms (platform/xml-elem->Platforms xml-struct)
-       :temporal (t/xml-elem->Temporal xml-struct)
-       :collection-progress (progress/parse xml-struct)
-       :spatial-coverage (s/xml-elem->SpatialCoverage xml-struct)
-       :projects (pj/xml-elem->Projects xml-struct)
-       :quality (cx/string-at-path xml-struct [:Quality])
-       :use-constraints (cx/string-at-path xml-struct [:Use_Constraints])
-       :organizations (org/xml-elem->Organizations xml-struct)
-       :publication-references (ref/xml-elem->References xml-struct)
-       :summary (cx/string-at-path xml-struct [:Summary :Abstract])
-       :purpose (cx/string-at-path xml-struct [:Summary :Purpose])
-       :related-urls (ru/xml-elem->RelatedURLs xml-struct)
-       :collection-associations (ma/xml-elem->MetadataAssociations xml-struct)
-       :product-specific-attributes (psa/xml-elem->ProductSpecificAttributes xml-struct)
-       :product product
-       :data-provider-timestamps (xml-elem->DataProviderTimestamps xml-struct)
-       :temporal-keywords (seq (cx/strings-at-path xml-struct [:Data_Resolution :Temporal_Resolution]))})))
+  (c/map->UmmCollection
+    {:entry-id (cx/string-at-path xml-struct [:Entry_ID])
+     :entry-title (cx/string-at-path xml-struct [:Entry_Title])
+     :personnel (personnel/xml-elem->personnel xml-struct)
+     :science-keywords (sk/xml-elem->ScienceKeywords xml-struct)
+     :platforms (platform/xml-elem->Platforms xml-struct)
+     :temporal (t/xml-elem->Temporal xml-struct)
+     :collection-progress (progress/parse xml-struct)
+     :spatial-coverage (s/xml-elem->SpatialCoverage xml-struct)
+     :projects (pj/xml-elem->Projects xml-struct)
+     :quality (cx/string-at-path xml-struct [:Quality])
+     :use-constraints (cx/string-at-path xml-struct [:Use_Constraints])
+     :organizations (org/xml-elem->Organizations xml-struct)
+     :publication-references (ref/xml-elem->References xml-struct)
+     :summary (cx/string-at-path xml-struct [:Summary :Abstract])
+     :purpose (cx/string-at-path xml-struct [:Summary :Purpose])
+     :related-urls (ru/xml-elem->RelatedURLs xml-struct)
+     :collection-associations (ma/xml-elem->MetadataAssociations xml-struct)
+     :product-specific-attributes (psa/xml-elem->ProductSpecificAttributes xml-struct)
+     :product (xml-elem->Product xml-struct)
+     :data-provider-timestamps (xml-elem->DataProviderTimestamps xml-struct)
+     :temporal-keywords (seq (cx/strings-at-path xml-struct [:Data_Resolution :Temporal_Resolution]))}))

 (defn parse-collection
   "Parses DIF 10 XML into a UMM Collection record."


Add cljfmt - disable cider-nrepl

Add cljfmt - disable cider-nrepl

--- roles/clojure/files/profiles.clj
+++ roles/clojure/files/profiles.clj
@@ -2,15 +2,19 @@

         :dependencies [[alembic "0.2.1"]
                        [clj-stacktrace "0.2.7"]
+                       [cljfmt "0.1.7"]
                        [criterium "0.4.2"]
                        [org.clojure/tools.namespace "0.2.5"]
+                       [rewrite-clj "0.4.11"
+                        :exclusions [org.clojure/tools.reader]]
                        [slamhound "1.5.3"]
                        [spyscope "0.1.4"]]

-        :plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]
+        :plugins [#_[cider/cider-nrepl "0.9.0-SNAPSHOT"]
                   [codox "0.6.6"]
                   [jonase/eastwood "0.1.4"]
                   [lein-ancient "0.5.5" :exclusions [commons-codec]]
+                  [lein-cljfmt "0.1.7" :exclusions [rewrite-clj]]
                   [lein-cljsbuild "1.0.3"]
                   [lein-clojars "0.9.1"]
                   [lein-cloverage "1.0.2"]


prevent null pointer exceptions

prevent null pointer exceptions

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@5952 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- clojure/acq_engine.clj
+++ clojure/acq_engine.clj
@@ -94,7 +94,7 @@
 ;; globals

 (declare last-wake-time)
-(declare start-time)
+(def start-time 0)
 (declare interrupt-requests)
 (declare z-corrections)

@@ -114,7 +114,7 @@
       "Channel" (get-in event [:channel :name])
       "PixelType" "GRAY8"
       "ZPositionUm" (get event :slice)
-      "AxisPositions" (JSONObject. (get-in event [:position :axes]))
+      "AxisPositions" (when-let [axes (get-in event [:position :axes])] (JSONObject. axes))
     )))

 (defn annotate-image [img event]
@@ -213,13 +213,13 @@
 (defn make-event-fns [event out-queue]
   (let [event (compute-z-position event)]
     (list
-		#(run-actions (create-presnap-actions event))
-		#(await-for 10000 (device-agents (. mmc getCameraDevice)))
-		#(when-let [wait-time-ms (event :wait-time-ms)]
-		  (acq-sleep wait-time-ms))
-		#(when (:autofocus event)
-		  (store-z-correction (run-autofocus)))
-		#(snap-image true (:close-shutter event))
+	;	#(run-actions (create-presnap-actions event))
+	;	#(await-for 10000 (device-agents (. mmc getCameraDevice)))
+	;	#(when-let [wait-time-ms (event :wait-time-ms)]
+	;	  (acq-sleep wait-time-ms))
+	;	#(when (:autofocus event)
+	;	  (store-z-correction (run-autofocus)))
+	;	#(snap-image true (:close-shutter event))
 		#(collect-image event out-queue)
     )))


Fix docs

Fix docs

--- src/spec_tools/core.cljc
+++ src/spec_tools/core.cljc
@@ -225,7 +225,7 @@
                   not available, spec-creation will fail.
            :type  optional type for the spec. if not set, will be auto-
                   resolved via spec-tools.forms/resolve-type (optional)
-         :reason  optional reason to be added to problems with s/explain
+         :reason  reason to be added to problems with s/explain (optional)
             :gen  generator function for the spec (optional)
            :name  name of the spec (optional)
     :description  description of the spec (optional)


Remove console log

Remove console log

--- src/hatti/utils.cljs
+++ src/hatti/utils.cljs
@@ -72,7 +72,6 @@

 (defn hyphen->camel-case
   [source-string]
-  (js/console.log source-string)
   (replace source-string
            #"(-)(.)"
            #(let [[_ _ letter-to-uppercase] %]


allow (lightning-bolt) to take a sequence or vector as _spec_ param again: needed in many tests

--- src/babel/forest.cljc
+++ src/babel/forest.cljc
@@ -74,33 +74,34 @@
 there is only one child for each parent, and that single child is the
 head of its parent. generate (above) 'decorates' each returned lightning bolt
 of this function with complements."
-  (log/debug (str "lightning-bolt(depth=" depth ", total-depth=" total-depth "): sem:" (strip-refs (get-in spec [:synsem :sem]))))
-  (if (not (= :none (get-in spec [:synsem :sem :synsem] :none)))
-    (exception (str "SHOULD NOT GET HERE.")))
-  (let [maxdepth 3 ;; maximum depth of a lightning bolt: H1 -> H2 -> H3 where H3 must be a lexeme, not a phrase.
-        morph (if morph morph (fn [input] (get-in input [:rule] :default-morph-no-rule)))
-        depth (if depth depth 0)
-        parents (filter #(not (fail? %)) (map (fn [rule] (unifyc spec rule)) grammar))]
-    (let [lexical ;; 1. generate list of all phrases where the head child of each parent is a lexeme.
-          (mapcat (fn [parent]
-                    (if (= false (get-in parent [:head :phrasal] false))
-                      (let [candidate-lexemes (get-lex parent :head index spec)]
-                        (if (some fail? candidate-lexemes)
-                          (exception (str "some candidate lexeme was fail?=true!")))
-                        (over/overh parent
-                                    (map copy (lazy-shuffle candidate-lexemes))
-                                    morph))))
-                  parents)
-          phrasal ;; 2. generate list of all phrases where the head child of each parent is itself a phrase.
-          (if (< depth maxdepth)
-            (mapcat (fn [parent]
-                      (over/overh parent (lightning-bolt grammar lexicon (get-in parent [:head])
-                                                         (+ 1 depth) index morph (+ 1 total-depth))
-                                  morph))
-                    parents))]
-      (if (lexemes-before-phrases depth)
-        (lazy-cat lexical phrasal)
-        (lazy-cat phrasal lexical)))))
+  (if (or (vector? spec) (seq? spec))
+    (reduce concat (map (fn [each-spec]
+                          (lightning-bolt grammar lexicon each-spec depth index morph total-depth))
+                        spec))
+    (do
+      (log/debug (str "lightning-bolt(depth=" depth ", total-depth=" total-depth "): sem:" (strip-refs (get-in spec [:synsem :sem]))))
+      (let [maxdepth 3 ;; maximum depth of a lightning bolt: H1 -> H2 -> H3 where H3 must be a lexeme, not a phrase.
+            morph (if morph morph (fn [input] (get-in input [:rule] :default-morph-no-rule)))
+            depth (if depth depth 0)
+            parents (filter #(not (fail? %)) (map (fn [rule] (unifyc spec rule)) grammar))]
+        (let [lexical ;; 1. generate list of all phrases where the head child of each parent is a lexeme.
+              (mapcat (fn [parent]
+                        (if (= false (get-in parent [:head :phrasal] false))
+                          (let [candidate-lexemes (get-lex parent :head index spec)]
+                            (if (some fail? candidate-lexemes)
+                              (exception (str "some candidate lexeme was fail?=true!")))
+                            (over/overh parent
+                                        (map copy (lazy-shuffle candidate-lexemes))))))
+                      parents)
+              phrasal ;; 2. generate list of all phrases where the head child of each parent is itself a phrase.
+              (if (< depth maxdepth)
+                (mapcat (fn [parent]
+                          (over/overh parent (lightning-bolt grammar lexicon (get-in parent [:head])
+                                                             (+ 1 depth) index morph (+ 1 total-depth))))
+                        parents))]
+          (if (lexemes-before-phrases depth)
+            (lazy-cat lexical phrasal)
+            (lazy-cat phrasal lexical)))))))

 (defn add-complement [bolt path spec grammar lexicon cache morph depth total-depth]
   (let [input-spec spec


include apache-commons

include apache-commons

--- src/storaged/project.clj
+++ src/storaged/project.clj
@@ -19,6 +19,7 @@
                                            [org.clojure/tools.cli "0.2.4"]
                                            [clojurewerkz/cassaforte "2.0.0"]
                                            [org.clojure/tools.logging "0.3.1"]
+                                           [commons-codec/commons-codec "1.10"]
                                            [org.apache.cassandra/cassandra-all "2.1.5"]]}
                  :triggers {:jar-name     "triggers-%s.jar"
                             :dependencies [[org.clojure/clojure "1.6.0"]


New UI for classes, mirroring DP

New UI for classes, mirroring DP

--- src/tango/cljs/main.cljs
+++ src/tango/cljs/main.cljs
@@ -31,25 +31,43 @@
   )

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; (defn on-click [e owner]
-;;   (log "Clicked w/o callback")
-;;   (chsk-send! [:test.event/clicked {:data "no callback"}]))
-
-;; (defn on-edit [e owner]
-;;   (log "Edit w/o callback")
-;;   (chsk-send! [:test.event/clicked {:data (.. e -target -value)}]))
-
-;; (defn on-click-cb [e owner]
-;;   (log "Click w callback")
-;;   (chsk-send! [:test.event/clicked {:data "Callback"}] 5000
-;;               (fn [cb-reply] (log (str "Callback reply: " cb-reply)))))
-
-(defn on-click-get-dancers []
-  (log "Clicked w/o callback")
-  (chsk-send! [:dancers/get {:all-of-them-now-damit! :please}]))
+;; (defonce app-state
+;;   (atom {:competitions []}))
+
+(defonce app-state
+  (atom {:selected-page :import
+
+         :competition
+         {:competition/date #inst "2014-11-22T00:00:00.000-00:00",
+          :competition/name "Elittävling",
+          :dance-perfect/version "4.1",
+          :competition/location "VÄSTERÅS",
+          :competition/classes
+          [{:class/name "Hiphop Singel Star B",
+            :class/competitors
+            [{:competitor/name "Saga Boström-Fors", :competitor/number 10, :competitor/club "M&M"}
+               {:competitor/name "Tyra Hedin", :competitor/number 11, :competitor/club "Uddans"}
+               {:competitor/name "Elina Ahlberg", :competitor/number 12, :competitor/club "SDC"}
+               {:competitor/name "Thyra Söderström", :competitor/number 13, :competitor/club "Uddans"}
+               {:competitor/name "Wilma Lindström Åslund", :competitor/number 14, :competitor/club "MD"}]}
+
+           {:class/name "Hiphop Singel Star J Fl",
+            :class/competitors
+            [{:competitor/name "Tilda Strandberg", :competitor/number 30, :competitor/club "Uddans"}
+             {:competitor/name "Tove Gärdin", :competitor/number 31, :competitor/club "BF"}
+             {:competitor/name "Esther Wallmo", :competitor/number 32, :competitor/club "Uddans"}
+             {:competitor/name "Felicia Dackell", :competitor/number 33, :competitor/club "Uddans"}
+             {:competitor/name "Emma Fredriksson", :competitor/number 34, :competitor/club "DVT"}]}
+
+           {:class/name "Hiphop Singel Star J Po",
+            :class/competitors
+            [{:competitor/name "Axel Carlsson", :competitor/number 60, :competitor/club "DTLH/DV"}
+             {:competitor/name "Tom Matei", :competitor/number 61, :competitor/club "SDC"}
+             {:competitor/name "Jacob Olsson", :competitor/number 62, :competitor/club "DTLH/DV"}]}]}}))

 (defn on-file-read [e file-reader]
   (let [result (.-result file-reader)]
+    (log "On file read: send :file/import")
     (chsk-send! [:file/import {:content result}])))

 (defn on-click-import-file [e]
@@ -59,130 +77,98 @@
     (set! (.-onload r) #(on-file-read % r))
     (.readAsText r file)))

+(defn dispatch [props]
+  (let [id (first props)
+        data (into [] (rest props))]
+    (log (str "Dispatch of " id " with data " data))
+    (match [id data]
+           [:file/import [file]]
+           (inc 1))))
+
 (defn on-export-click [e competition]
   (log "Export clicked")
   (log (str competition))
   (chsk-send! [:file/export {:file/format :dance-perfect
                              :file/content competition}]))

-(defonce app-state
-  (atom {:competitions []}))
-
-;; (defonce app-state
-;;   (atom {:competitions
-;;          [{:competition/date #inst "2014-11-22T00:00:00.000-00:00",
-;;            :competition/name "TurboMegatävling",
-;;            :dance-perfect/version "4.1",
-;;            :competition/location "THUNDERDOME",
-;;            :competition/classes
-;;            [{:class/name "Hiphop Singel Star B", :class/competitors
-;;              [{:competitor/name "Rulle Trulle", :competitor/number 1, :competitor/club "Rulles M&M"}
-;;               {:competitor/name "Katchyk Wrong", :competitor/number 2, :competitor/club "Sccchhh"}]}
-;;             {:class/name "Hiphop Singel Star J Fl", :class/competitors
-;;              [{:competitor/name "Ringo Stingo" :competitor/number 20, :competitor/club "Kapangg"}
-;;               {:competitor/name "Greve Turbo", :competitor/number 21, :competitor/club "OOoost"}]}]}]}))
-
-;; TODO - Let the server return dancers in a UI-normalized way
-(defn get-dancers [competitions]
-  (into #{}
-        (map #(dissoc % :competitor/number)
-             (for [competition competitions
-                   classes (:competition/classes competition)
-                   competitors (:class/competitors classes)]
-               competitors))))
-
-(defonce component-state
-  (atom {:competitions-visible false}))
-
-(defn competitor-component [competitors include-number?]
-  [:div ""
-   [:ul
-    (for [competitor competitors]
-      ^{:key competitor}
-      [:li
-       (str (if include-number?
-              (str "Tävlande nummer : " (:competitor/number competitor) " - "))
-            (str (:competitor/name competitor)
-                 " från "
-                 (:competitor/club competitor)))])]])
-
-(defn class-component [classes]
-  [:h3 "Classes"]
-  [:div
-   (for [cls classes]
-     ^{:key cls}
-     [:div
-      (:class/name cls)
-      [competitor-component (:class/competitors cls) true]])])
-
-(defn competition-item []
-  (let [open (atom false)]
-    (fn [competition]
-      [:li
-       [:div.view
-        [:label {:on-click #(log "Klickz")} (str (:competition/name competition) " i "
-                      (:competition/location competition) " den "
-                      (:competition/date competition))
-         ]
-        [:input.btn.btn-default
-         {:type "button"
-          :value (if @open "Stäng" "Öppna")
-          :on-click #(swap! open not)}]]
-       (if @open
-         [:div
-          [:input.btn.btn-default
-           {:type "button"
-            :value "Exportera"
-            ;; TODO - send competition id when we got back-end storage
-            :on-click #(on-export-click % competition)}]
-          [:a {:id "export-download-link"
-               :href (str "/exported-files/" (:competition/name competition) ".xml")
-               :download (str (:competition/name competition) ".xml")}]
-          [:h4 "Klasser :"]
-          [class-component (:competition/classes competition)]])])))
-
-(defn competitors-component []
-  [:div
-   [:h2 "Tillgängliga dansare"]
-   [competitor-component (get-dancers (:competitions @app-state))]])
-
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Components
+
+(defn dp-classes-component []
+  ;; table with #, class name (Dansdisciplin), Typ av dans, Antal Startande, Status
+  [:table.table
+   [:thead
+    [:tr
+     [:th {:with "20"} "#"]
+     [:th {:with "200"} "Dansdisciplin"]
+     [:th {:with "20"} "Typ"]
+     [:th {:with "20"} "Startande"]
+     [:th {:with "20"} "Status"]]]
+   [:tbody
+    (for [class (:competition/classes (:competition @app-state))]
+      ^{:key class}
+      [:tr
+       [:td "-"]
+       [:td (:class/name class)]
+       [:td "-"]
+       [:td (str (count (:class/competitors class)) "/" (count (:class/competitors class)))]
+       [:td "-"]])]])
+
+;; TODO - make the on-click event run thoughe dispatch
 (defn import-component []
   [:div
-
-   [:h2 "Tillgängliga tävlingar"]
-   [:ul
-    (for [competition (:competitions @app-state)]
-      ^{:key competition} [competition-item competition])]
    [:h2 "Importera en ny tävling : "]
-   [:input.btn.btn-default {:type "file" :value "Import file"
-                            :onChange #(on-click-import-file %)}]])
+   [:input.btn.btn-primary.btn-lg {:type "file" :value "Import file"
+                                   :onChange #(on-click-import-file %)}]])

 (defn menu-component []
-  (let [visible-component (atom :none)]
-    (fn []
-      [:div.container
-       [:div.header
-        [:h2 "Välkommen till Tango!"]
-        [:input.btn.btn-primary.btn-lg.navbar-btn
-         {:type "button" :value "Tävlingar" :on-click #(reset! visible-component :competitions)}]
-        [:input.btn.btn-primary.btn-lg
-         {:type "button" :value "Dansare" :on-click #(reset! visible-component :competitors)}]
-        [:input.btn.btn-primary.btn-lg
-         {:type "button" :value "Domare" :on-click #(reset! visible-component :adjudicators)}]
-
-        [:input.btn.btn-default
-         {:type "button" :value "Debug Button" :on-click #(chsk-send! [:debug/test {:test "Test"}])}]
-        ;[:h2 (str "visible-component " @visible-component)]
-        ]
-       (condp = @visible-component
-         :competitions [import-component]
-         :competitors [competitors-component]
-         :adjudicators [:div]
-         :none [:div])
-       ])))
+;  [:div]
+  ;; (fn []
+  ;;   (if (= (:selected-page @app-state) :import)))
+  [:div
+   [import-component]
+   [:h3 "Klasser"]
+   [dp-classes-component]])
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Application

 (defn ^:export run []
   (reagent/render-component [menu-component] (.-body js/document)))
+
+;; (defn handle-export []
+;;   (let [export-link (. js/document (getElementById "export-download-link"))]
+;;     (log "Exporting competition")
+;;     (.click export-link)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Socket handling
+(defn- event-handler [[id data :as ev] _]
+  (log (str "Event: " id))
+  (match [id data]
+    ;; TODO Match your events here <...>
+         [:chsk/recv [:file/imported content]]
+         (do
+           (swap! app-state #(merge % {:selected-page :classes
+                                       :competition content}))
+           ;(swap! app-state #(hash-map :competitions (conj (:competitions %) content)))
+           (log (str @app-state))
+           )
+         ;; [:chsk/recv [:file/export content]]
+         ;; (handle-export)
+    [:chsk/state [:first-open _]] (log "Channel socket successfully established!")
+    ;[:chsk/state new-state] (log (str "Chsk state change: " new-state))
+    ;[:chsk/recv payload] (log (str "Push event from server: " payload))
+    :else (log (str "Unmatched event: " ev)))
+  )
+
+(defonce chsk-router
+  (sente/start-chsk-router-loop! event-handler ch-chsk))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Purgatory

 ;; Exempel till "Export"
 ;;
@@ -196,29 +182,104 @@
 ;; (set! (.-href download-link) href-content)
 ;; (.click download-link)))

-(defn handle-export []
-  (let [export-link (. js/document (getElementById "export-download-link"))]
-    (log "Exporting competition")
-    (.click export-link)
-    ))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Socket handling
-(defn- event-handler [[id data :as ev] _]
-  (log (str "Event: " ev))
-  (match [id data]
-    ;; TODO Match your events here <...>
-         [:chsk/recv [:file/imported content]]
-         (do
-           (swap! app-state #(hash-map :competitions (conj (:competitions %) content)))
-           (log (str @app-state))
-           )
-         [:chsk/recv [:file/export content]]
-         (handle-export)
-    [:chsk/state [:first-open _]] (log "Channel socket successfully established!")
-    ;[:chsk/state new-state] (log (str "Chsk state change: " new-state))
-    ;[:chsk/recv payload] (log (str "Push event from server: " payload))
-    :else (log (str "Unmatched event: " ev)))
-  )
-
-(defonce chsk-router
-  (sente/start-chsk-router-loop! event-handler ch-chsk))
+
+;; TODO - Let the server return dancers in a UI-normalized way
+;; (defn get-dancers [competitions]
+;;   (into #{}
+;;         (map #(dissoc % :competitor/number)
+;;              (for [competition competitions
+;;                    classes (:competition/classes competition)
+;;                    competitors (:class/competitors classes)]
+;;                competitors))))
+
+;; (defonce component-state
+;;   (atom {:competitions-visible false}))
+
+;; (defn competitor-component [competitors include-number?]
+;;   [:div ""
+;;    [:ul
+;;     (for [competitor competitors]
+;;       ^{:key competitor}
+;;       [:li
+;;        (str (if include-number?
+;;               (str "Tävlande nummer : " (:competitor/number competitor) " - "))
+;;             (str (:competitor/name competitor)
+;;                  " från "
+;;                  (:competitor/club competitor)))])]])
+
+;; (defn class-component [classes]
+;;   [:h3 "Classes"]
+;;   [:div
+;;    (for [cls classes]
+;;      ^{:key cls}
+;;      [:div
+;;       (:class/name cls)
+;;       [competitor-component (:class/competitors cls) true]])])
+
+;; (defn competition-item []
+;;   (let [open (atom false)]
+;;     (fn [competition]
+;;       [:li
+;;        [:div.view
+;;         [:label {:on-click #(log "Klickz")} (str (:competition/name competition) " i "
+;;                       (:competition/location competition) " den "
+;;                       (:competition/date competition))
+;;          ]
+;;         [:input.btn.btn-default
+;;          {:type "button"
+;;           :value (if @open "Stäng" "Öppna")
+;;           :on-click #(swap! open not)}]]
+;;        (if @open
+;;          [:div
+;;           [:input.btn.btn-default
+;;            {:type "button"
+;;             :value "Exportera"
+;;             ;; TODO - send competition id when we got back-end storage
+;;             :on-click #(on-export-click % competition)}]
+;;           [:a {:id "export-download-link"
+;;                :href (str "/exported-files/" (:competition/name competition) ".xml")
+;;                :download (str (:competition/name competition) ".xml")}]
+;;           [:h4 "Klasser :"]
+;;           [class-component (:competition/classes competition)]])])))
+
+;; (defn competitors-component []
+;;   [:div
+;;    [:h2 "Tillgängliga dansare"]
+;;    [competitor-component (get-dancers (:competitions @app-state))]])
+
+;; (defn import-component []
+;;   [:div
+
+;;    [:h2 "Tillgängliga tävlingar"]
+;;    [:ul
+;;     (for [competition (:competitions @app-state)]
+;;       ^{:key competition} [competition-item competition])]
+;;    [:h2 "Importera en ny tävling : "]
+;;    [:input.btn.btn-default {:type "file" :value "Import file"
+;;                             :onChange ;#(dispatch [:file/import (.item (.. % -target -files) 0)])
+;;                             #(on-click-import-file %)
+;;                             }]])
+
+;; (defn menu-component []
+;;   (let [visible-component (atom :none)]
+;;     (fn []
+;;       [:div.container
+;;        [:div.header
+;;         [:h2 "Välkommen till Tango!"]
+;;         [:input.btn.btn-primary.btn-lg.navbar-btn
+;;          {:type "button" :value "Tävlingar" :on-click #(reset! visible-component :competitions)}]
+;;         [:input.btn.btn-primary.btn-lg
+;;          {:type "button" :value "Dansare" :on-click #(reset! visible-component :competitors)}]
+;;         [:input.btn.btn-primary.btn-lg
+;;          {:type "button" :value "Domare" :on-click #(reset! visible-component :adjudicators)}]
+
+;;         [:input.btn.btn-default
+;;          {:type "button" :value "Debug Button" :on-click #(chsk-send! [:debug/test {:test "Test"}])}]
+;;         ;[:h2 (str "visible-component " @visible-component)]
+;;         ]
+;;        (condp = @visible-component
+;;          :competitions [import-component]
+;;          :competitors [competitors-component]
+;;          :adjudicators [:div]
+;;          :none [:div])
+;;        ])))


Add auto multi-step table updates

Add auto multi-step table updates

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -205,10 +205,6 @@
   ScanResult          (as-map [r] (am-query|scan-result r
                                     {:scanned-count (.getScannedCount r)}))

-  CreateTableResult   (as-map [r] r) ; TODO
-  UpdateTableResult   (as-map [r] r) ; TODO
-  DeleteTableResult   (as-map [r] r) ; TODO
-
   BatchGetItemResult
   (as-map [r]
     {:items       (utils/keyword-map as-map (.getResponses r))
@@ -220,24 +216,28 @@
     {:unprocessed (.getUnprocessedItems r)
      :cc-units    (cc-units (.getConsumedCapacity r))})

-  DescribeTableResult
-  (as-map [r]
-    (let [t (.getTable r)]
-      {:name          (keyword (.getTableName t))
-       :creation-date (.getCreationDateTime t)
-       :item-count    (.getItemCount t)
-       :size          (.getTableSizeBytes t)
-       :throughput    (as-map (.getProvisionedThroughput t))
-       :indexes       (as-map (.getLocalSecondaryIndexes t))
-       :status        (utils/un-enum (.getTableStatus t))
-       :prim-keys
-       (let [schema (as-map (.getKeySchema t))
-             defs   (as-map (.getAttributeDefinitions t))]
-         (merge-with merge
-           (reduce-kv (fn [m k v] (assoc m (:name v) {:key-type  (:type v)}))
-                      {} schema)
-           (reduce-kv (fn [m k v] (assoc m (:name v) {:data-type (:type v)}))
-                      {} defs)))}))
+  TableDescription
+  (as-map [d]
+    {:name          (keyword (.getTableName d))
+     :creation-date (.getCreationDateTime d)
+     :item-count    (.getItemCount d)
+     :size          (.getTableSizeBytes d)
+     :throughput    (as-map (.getProvisionedThroughput d))
+     :indexes       (as-map (.getLocalSecondaryIndexes d))
+     :status        (utils/un-enum (.getTableStatus d))
+     :prim-keys
+     (let [schema (as-map (.getKeySchema d))
+           defs   (as-map (.getAttributeDefinitions d))]
+       (merge-with merge
+         (reduce-kv (fn [m k v] (assoc m (:name v) {:key-type  (:type v)}))
+                    {} schema)
+         (reduce-kv (fn [m k v] (assoc m (:name v) {:data-type (:type v)}))
+                    {} defs)))})
+
+  DescribeTableResult (as-map [r] (as-map (.getTable r)))
+  CreateTableResult   (as-map [r] (as-map (.getTableDescription r)))
+  UpdateTableResult   (as-map [r] (as-map (.getTableDescription r)))
+  DeleteTableResult   (as-map [r] (as-map (.getTableDescription r)))

   LocalSecondaryIndexDescription
   (as-map [d] {:name       (keyword (.getIndexName d))
@@ -360,7 +360,7 @@
   [creds table-name hash-keydef
    & [{:keys [range-keydef throughput indexes block?]
        :or   {throughput {:read 1 :write 1}}}]]
-  (let [request-result
+  (let [result
         (as-map
          (.createTable (db-client creds)
            (doto (CreateTableRequest.)
@@ -371,9 +371,9 @@
              (.setLocalSecondaryIndexes (local-indexes hash-keydef indexes)))))]

     (if-not block?
-      request-result
+      result
       (do (block-while-table-status creds table-name :creating)
-          request-result))))
+          result))))

 (comment (time (create-table mc "delete-me7" [:id :s] {:block? true})))

@@ -382,15 +382,64 @@
   (when-not (describe-table creds table-name)
     (apply create-table creds table-name opts)))

+(defn- throughput-steps
+  "Dec by any amount, inc by <= 2x current amount, Ref. http://goo.gl/Bj9TC.
+  x - start, x' - current, x* - goal."
+  [[r w] [r* w*]]
+  (let [step (fn [x* x'] (if (< x* x') x* (min x* (* 2 x'))))]
+    (loop [steps [] [r' w'] [r w]]
+      (if (and (>= r' r*) (>= w' w*))
+        steps
+        (let [[r' w' :as this-step] [(step r* r') (step w* w')]]
+          (recur (conj steps this-step) this-step))))))
+
+(comment (throughput-steps [1 1] [1 1])
+         (throughput-steps [1 1] [12 12])
+         (throughput-steps [3 3] [27 27])
+         (throughput-steps [17 8] [3 22])
+         (throughput-steps [1 1] [300 300]))
+
 (defn update-table
-  "Updates a table. Ref. http://goo.gl/Bj9TC for important throughput
-  upgrade/downgrade limits."
-  [creds {table-name :name :keys [throughput]}]
-  (as-map
-   (.updateTable (db-client creds)
-     (doto-maybe (UpdateTableRequest.) g
-       table-name (.setTableName (name g))
-       throughput (.setProvisionedThroughput (provisioned-throughput g))))))
+  "Updates a table. Allows automatic multi-step adjustments to conform to
+  update limits, Ref. http://goo.gl/Bj9TC.
+
+  Returns a promise to which the final resulting table description will be
+  delivered. Deref this promise to block until update (all steps) complete."
+  [creds table throughput & [{:keys [max-reqs]
+                              :or   {max-reqs 5}}]]
+  (let [{read* :read write* :write} throughput
+        {:keys [status throughput]} (describe-table creds table)
+        {:keys [read write num-decreases-today]} throughput
+
+        decreasing? (or (< read* read) (< write* write))
+        steps  (throughput-steps [read write] [read* write*])
+        nsteps (count steps)]
+    (when-not (empty? steps)
+      (cond (not= status :active)
+            (throw (Exception. (str "Invalid table status: " status)))
+            (and decreasing? (>= num-decreases-today 4)) ; API limit
+            (throw (Exception. (str "Max 4 decreases per 24hr period")))
+            (> nsteps max-reqs)
+            (throw (Exception. (str "`max-reqs` too low, needs reqs: " nsteps)))
+            :else
+            (letfn [(run1 [[r' w']]
+                      (as-map
+                       (.updateTable (db-client creds)
+                         (doto (UpdateTableRequest.)
+                           (.setTableName (name table))
+                           (.setProvisionedThroughput (provisioned-throughput
+                                                       {:read r' :write w'})))))
+                      ;; Returns _new_ descr when ready:
+                      (block-while-table-status creds table :updating))]
+
+              (let [p (promise)]
+                (future (deliver p (peek (mapv run1 steps))))
+                p))))))
+
+(comment
+  (def dt (describe-table creds :faraday.tests.main))
+  (let [p (update-table creds :faraday.tests.main {:read 1 :write 1})]
+    @p))

 (defn delete-table "Deletes a table, go figure."
   [creds table]
@@ -706,7 +755,7 @@

 ;;;; Misc. helpers

-;; TODO Automatic throughput (and > 2x) adjustment tools
+;; TODO Automatic throughput adjustment tools

 (defn items-by-attrs
   "Groups one or more items by one or more attributes, returning a map of form


added a comment with some further evolved solutions

--- src/clojush/problems/software/fizz_buzz_plus.clj
+++ src/clojush/problems/software/fizz_buzz_plus.clj
@@ -157,6 +157,16 @@
 ;; program: (in3 string_frominteger in3 \space in2 integer_mod string_conjchar exec_yankdup "fizz" true string_fromchar code_extract exec_swap (in3 3 integer_dup_times) code_container exec_yankdup "buzz" in3 in3 in1 integer_mod in3 in2 integer_mod in3 in1 integer_mod integer_dup_times exec_yankdup exec_swap string_split (boolean_shove string_nth string_concat string_dup_items))
 ;;
 ;; program: (in3 in1 integer_mod exec_do*times char_frominteger in3 in2 integer_mod exec_do*times char_dup in2 integer_mod char_isdigit exec_do*times char_dup integer_fromchar in3 integer_eq \space exec_shove (in3 boolean_not string_frominteger) string_conjchar in3 boolean_dup_times char_empty "fizz" string_removechar string_indexofchar string_concat exec_while integer_min "buzz" string_concat)
+;;
+;;
+;; an interesting pair (the same program, before and after simplification)
+;;
+;; Successful program: (string_split char_isdigit code_shove code_dup_times code_nthcdr string_nth code_swap code_empty in3 code_pop char_dup_times integer_max string_concat boolean_xor boolean_invert_first_then_and string_dup_times integer_lt string_setchar code_do*count string_rot char_dup boolean_empty integer_lte boolean_or in3 code_do* in3 integer_empty boolean_or exec_do*range (string_frominteger boolean_dup integer_max string_eq integer_rot string_containschar code_dup_items -2 string_eq code_member string_containschar string_yankdup -2 char_rot string_occurrencesofchar) string_yankdup boolean_and code_contains exec_do*times (" Z=N" code_do) string_first exec_s (exec_stackdepth integer_add string_conjchar "fizz" integer_dec) (code_cons string_concat char_isdigit) (integer_lte string_containschar) string_yankdup boolean_dup exec_s_when_autoconstructing (string_removechar true exec_eq integer_inc code_yankdup code_contains code_append code_fromboolean boolean_stackdepth integer_fromchar) (\space boolean_invert_first_then_and exec_noop code_yank string_conjchar false exec_eq exec_swap (boolean_dup code_empty integer_fromstring string_stackdepth in2) (code_do) exec_if () () exec_yankdup code_do*times code_do in3 exec_s_when_autoconstructing (exec_noop in2) (code_length) (code_atom)) (code_dup code_swap char_shove integer_sub boolean_invert_first_then_and code_list in2) char_isletter char_dup_times exec_s (exec_dup (code_do integer_mod string_stackdepth integer_dup_times string_rot code_list true code_flush string_containschar integer_div true string_dup_times) -74) (exec_k_when_autoconstructing (code_dup_times integer_stackdepth false string_indexofchar) (-74) code_wrap integer_pop integer_stackdepth code_car) (code_do*range string_dup_times) integer_dup code_member code_null "buzz" code_rot string_concat char_swap "\nAUz" char_stackdepth string_setchar code_frominteger string_rot integer_mod char_empty string_removechar in3 string_replace code_car integer_lt in3 string_replace in1 boolean_flush exec_pop () code_rot integer_mod string_yankdup)
+;;
+;; (same as above, simplified)
+;;
+;; program: (in3 string_frominteger -2 string_yankdup -2 string_yankdup " Z=N" string_first exec_stackdepth string_conjchar "fizz" string_concat string_yankdup \space string_conjchar in3 in2 exec_s (exec_dup (integer_mod string_stackdepth integer_dup_times string_rot integer_div string_dup_times)) integer_stackdepth string_dup_times "buzz" string_concat "\nAUz" string_rot string_replace in3 in1 integer_mod string_yankdup)
+

 ;; NOT QUITE


adding missing attribs from master

adding missing attribs from master

--- src/cmr/indexer/services/concepts/collection.clj
+++ src/cmr/indexer/services/concepts/collection.clj
@@ -38,6 +38,7 @@
      :project-sn.lowercase  (map s/lower-case project-short-names)
      :two-d-coord-name two-d-coord-names
      :two-d-coord-name.lowercase  (map s/lower-case two-d-coord-names)
+     :attributes (attrib/psas->elastic-docs umm-concept)
      :start-date (when start-date (f/unparse (f/formatters :date-time) start-date))
      :end-date (when end-date (f/unparse (f/formatters :date-time) end-date))
      :archive-center archive-center-val


Random draw from and sample of normal distribution

--- src/test_utils/core.cljs
+++ src/test_utils/core.cljs
@@ -1,4 +1,5 @@
-(ns test-utils.core)
+(ns test-utils.core
+  (:require [kixi.stats.distribution :as ksd]))

 (enable-console-print!)

@@ -37,3 +38,17 @@
   [(rand-range begin-year end-year) (rand-range 1 13) (rand-int 31)
    (rand-int 24) (rand-int 60) (rand-int 60)])

+(defn draw-normal
+  "Draw a single value from the normal distribution with mean, `mu`
+  (default 0.0), and standard deviation, `sigma` (default 1.0)."
+  ([] (draw-normal 0.0 1.0))
+  ([mu sigma] (ksd/draw (ksd/normal {:mu mu :sd sigma}))))
+
+(defn sample-normal
+  "Return a sample of n (default 3) values from the normal distribution
+  with mean, `mu` (default 0.0), and standard deviation, `sigma`
+  (default 1.0)."
+  ([] (sample-normal 3 0.0 1.0))
+  ([n] (sample-normal n 0.0 1.0))
+  ([n mu sigma] (ksd/sample n (ksd/normal {:mu mu :sd sigma}))))
+


tidy up swt modules a little

tidy up swt modules a little

--- dada-demo/src/main/clojure/org/dada/demo/whales.clj
+++ dada-demo/src/main/clojure/org/dada/demo/whales.clj
@@ -5,7 +5,6 @@
   [clojure set]
   [org.dada core]
   [org.dada.core dql]
-  [org.dada.swt new]
   [org.dada.demo server])
  (:import
   [clojure.lang
@@ -407,21 +406,21 @@
 ;; Join scratch area
 ;;--------------------------------------------------------------------------------

-(if false
-  (do
-
-    (inspect (? (dfrom "Whales")))
-    (inspect (? (dfrom "Oceans")))
-    (inspect (? (dfrom "WhalesAndOceans")))
-
-    (insert oceans-model (Ocean. "arctic"   1000000 99999999 17880))
-    (insert oceans-model (Ocean. "southern" 1000000  10000000 23737))
-
-    (insert whales-model (Whale. 50 3011 (Date. 0 1 1) "jules" "blue whale" "atlantic" 100 100))
-    (delete whales-model (Whale. 50 3100 (Date. 0 1 1) "jules" "blue whale" "seaworld" 100 100))
-    (.find whales-model 10000)
-
-    ))
+;; (if false
+;;   (do
+
+;;     (inspect (? (dfrom "Whales")))
+;;     (inspect (? (dfrom "Oceans")))
+;;     (inspect (? (dfrom "WhalesAndOceans")))
+
+;;     (insert oceans-model (Ocean. "arctic"   1000000 99999999 17880))
+;;     (insert oceans-model (Ocean. "southern" 1000000  10000000 23737))
+
+;;     (insert whales-model (Whale. 50 3011 (Date. 0 1 1) "jules" "blue whale" "atlantic" 100 100))
+;;     (delete whales-model (Whale. 50 3100 (Date. 0 1 1) "jules" "blue whale" "seaworld" 100 100))
+;;     (.find whales-model 10000)
+
+;;     ))

 ;;--------------------------------------------------------------------------------
 ;; DSL experimentation
@@ -432,89 +431,89 @@
 ;;(? (pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean)(from "Whales"))

-(if false
-  (do
+;; (if false
+;;   (do

-    ;; all whales
-    (inspect (? (dfrom "Whales")))
-
-    ;; count all whales
-    (inspect (? (dcount)(dfrom "Whales")))
-
-    ;; sum length of all whales
-    (inspect (? (dsum :length)(dfrom "Whales")))
-
-    ;; we're only interested in toothed whales
-    (inspect (? (dsplit :type (fn [type] (if (isa? whale-hierarchy :odontoceti type) [:odontoceti] []))) (dfrom "Whales")))
-
-    ;; we're only interested in rorquals
-    (inspect (? (dsplit :type (fn [type] (if (isa? whale-hierarchy :balaenopteridae type) [:balaenopteridae] []))) (dfrom "Whales")))
-
-    ;; split by suborder
-    (do
-      (def whale-hierarchy-children
-	(reduce (fn [reduction [key vals]] (reduce (fn [reduction val] (conj reduction [val key])) reduction vals)) {} (whale-hierarchy :parents)))
+;;     ;; all whales
+;;     (inspect (? (dfrom "Whales")))
+
+;;     ;; count all whales
+;;     (inspect (? (dcount)(dfrom "Whales")))
+
+;;     ;; sum length of all whales
+;;     (inspect (? (dsum :length)(dfrom "Whales")))
+
+;;     ;; we're only interested in toothed whales
+;;     (inspect (? (dsplit :type (fn [type] (if (isa? whale-hierarchy :odontoceti type) [:odontoceti] []))) (dfrom "Whales")))
+
+;;     ;; we're only interested in rorquals
+;;     (inspect (? (dsplit :type (fn [type] (if (isa? whale-hierarchy :balaenopteridae type) [:balaenopteridae] []))) (dfrom "Whales")))
+
+;;     ;; split by suborder
+;;     (do
+;;       (def whale-hierarchy-children
+;; 	(reduce (fn [reduction [key vals]] (reduce (fn [reduction val] (conj reduction [val key])) reduction vals)) {} (whale-hierarchy :parents)))

-      (def whale-type-to-suborder
-	(reduce (fn [reduction type] (conj reduction [type (whale-hierarchy-children (whale-hierarchy-children type))])) {} types))
+;;       (def whale-type-to-suborder
+;; 	(reduce (fn [reduction type] (conj reduction [type (whale-hierarchy-children (whale-hierarchy-children type))])) {} types))

-      (inspect (? (dsplit :type (fn [type] [(whale-type-to-suborder type)])) (dfrom "Whales"))))
+;;       (inspect (? (dsplit :type (fn [type] [(whale-type-to-suborder type)])) (dfrom "Whales"))))

-    ;; split by family
-    (do
-      (def whale-hierarchy-children
-	(reduce (fn [reduction [key vals]] (reduce (fn [reduction val] (conj reduction [val key])) reduction vals)) {} (whale-hierarchy :parents)))
+;;     ;; split by family
+;;     (do
+;;       (def whale-hierarchy-children
+;; 	(reduce (fn [reduction [key vals]] (reduce (fn [reduction val] (conj reduction [val key])) reduction vals)) {} (whale-hierarchy :parents)))

-      (def whale-type-to-family
-	(reduce (fn [reduction type] (conj reduction [type (whale-hierarchy-children type)])) {} types))
+;;       (def whale-type-to-family
+;; 	(reduce (fn [reduction type] (conj reduction [type (whale-hierarchy-children type)])) {} types))

-      (inspect (? (dsplit :type (fn [type] [(whale-type-to-family type)])) (dfrom "Whales"))))
-
-    ;; split by ocean
-    (inspect (? (dsplit :ocean)(dfrom "Whales")))
-    (inspect (? (dsplit :ocean)(dfrom "WhalesAndOceans")))
-
-    ;; flat split by type then ocean
-    (inspect (? (dsplit :ocean)(dsplit :type)(dfrom "Whales")))
-
-    ;; nested split by type then ocean
-    (inspect (? (dsplit :type list [(dsplit :ocean)])(dfrom "Whales")))
-
-    (inspect (? (dsplit :type list [(dunion)(dsplit :ocean)])(dfrom "Whales")))
-
-    ;; sum weights per ocean
-    (inspect (? (dsum :weight)(dsplit :ocean)(dfrom "Whales")))
-
-    ;; summarise weights per ocean
-    (inspect (? (dunion)(dsum :weight)(dsplit :ocean)(dfrom "Whales")))
-    ;; summarise weights per type
-    (inspect (? (dunion)(dsum :weight)(dsplit :type)(dfrom "Whales")))
-
-    ;; pivot weights per ocean summary
-    (inspect (? (dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean) (dfrom "Whales")))
-
-    ;; for each type - pivot weights per ocean summary
-    (inspect (? (dsplit :type list [(dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean)]) (dfrom "Whales")))
-
-    (inspect (? (dsplit :type list [(dunion)(dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean)]) (dfrom "Whales")))
-
-;; TODO
-;; split multiple dimensions at same time...
-;; reduce multiple columns at same time...
-;; rethink pivot
-;; support adding/deleting UI rows
-;; support updating UI rows
-
-  ;;(? (union "count/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean )]) (from "Whales"))
-  ;;(? (union "count/ocean/type")(split :ocean nil [(pivot :type types (keyword (count-value-key nil)))(ccount)(split :type )]) (from "Whales"))
-
-  ;; weight/ocean/type
-  ;;(inspect (? (dsplit :type nil [(dpivot :ocean oceans (keyword (sum-value-key :weight)))(dsum :weight)(dsplit :ocean )])(dfrom "Whales")))
+;;       (inspect (? (dsplit :type (fn [type] [(whale-type-to-family type)])) (dfrom "Whales"))))
+
+;;     ;; split by ocean
+;;     (inspect (? (dsplit :ocean)(dfrom "Whales")))
+;;     (inspect (? (dsplit :ocean)(dfrom "WhalesAndOceans")))
+
+;;     ;; flat split by type then ocean
+;;     (inspect (? (dsplit :ocean)(dsplit :type)(dfrom "Whales")))
+
+;;     ;; nested split by type then ocean
+;;     (inspect (? (dsplit :type list [(dsplit :ocean)])(dfrom "Whales")))
+
+;;     (inspect (? (dsplit :type list [(dunion)(dsplit :ocean)])(dfrom "Whales")))
+
+;;     ;; sum weights per ocean
+;;     (inspect (? (dsum :weight)(dsplit :ocean)(dfrom "Whales")))
+
+;;     ;; summarise weights per ocean
+;;     (inspect (? (dunion)(dsum :weight)(dsplit :ocean)(dfrom "Whales")))
+;;     ;; summarise weights per type
+;;     (inspect (? (dunion)(dsum :weight)(dsplit :type)(dfrom "Whales")))
+
+;;     ;; pivot weights per ocean summary
+;;     (inspect (? (dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean) (dfrom "Whales")))
+
+;;     ;; for each type - pivot weights per ocean summary
+;;     (inspect (? (dsplit :type list [(dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean)]) (dfrom "Whales")))
+
+;;     (inspect (? (dsplit :type list [(dunion)(dpivot :ocean ["arctic" "atlantic" "indian" "pacific" "southern"] (keyword "sum(:weight)")) (dsum :weight) (dsplit :ocean)]) (dfrom "Whales")))
+
+;; ;; TODO
+;; ;; split multiple dimensions at same time...
+;; ;; reduce multiple columns at same time...
+;; ;; rethink pivot
+;; ;; support adding/deleting UI rows
+;; ;; support updating UI rows
+
+;;   ;;(? (union "count/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean )]) (from "Whales"))
+;;   ;;(? (union "count/ocean/type")(split :ocean nil [(pivot :type types (keyword (count-value-key nil)))(ccount)(split :type )]) (from "Whales"))
+
+;;   ;; weight/ocean/type
+;;   ;;(inspect (? (dsplit :type nil [(dpivot :ocean oceans (keyword (sum-value-key :weight)))(dsum :weight)(dsplit :ocean )])(dfrom "Whales")))

-  ;; weight/type/ocean
-  ;;(inspect (? (dsplit :ocean nil [(dpivot :type types (keyword (sum-value-key :weight)))(dsum :weight)(dsplit :type )])(dfrom "Whales")))
-
-    ))
+;;   ;; weight/type/ocean
+;;   ;;(inspect (? (dsplit :ocean nil [(dpivot :type types (keyword (sum-value-key :weight)))(dsum :weight)(dsplit :type )])(dfrom "Whales")))
+
+;;     ))

 (if false
   (do
@@ -635,3 +634,10 @@

 ;; (? (dunion)(dsplit :ocean nil [(pivot :type org.dada.demo.whales/types (keyword (sum-value-key :weight)))(dsum :weight)(split :type )])(from "Whales"))
 ;; (? (dunion)(split :type nil [(pivot :ocean org.dada.demo.whales/oceans (keyword (sum-value-key :weight)))(sum :weight)(split :ocean )]) (from "Whales"))
+
+;; (? (ccount)(from "Whales"))
+;; (? (split :ocean)(from "Whales"))
+;; (? (split :type)(from "Whales"))
+;; (? (union)(split :ocean nil [(pivot :type org.dada.demo.whales/types (keyword (sum-value-key :weight)))(sum :weight)(split :type )])(from "Whales"))
+;; (? (union)(split :type nil [(pivot :ocean org.dada.demo.whales/oceans (keyword (sum-value-key :weight)))(sum :weight)(split :ocean )]) (from "Whales"))
+;; (? (from "MetaModel"))


better implementation

better implementation

--- src/cljs/org/broadinstitute/firecloud_ui/common.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common.cljs
@@ -27,21 +27,28 @@

 (defn clear-both [] [:div {:style {:clear "both"}}])

-(defn- animate [steps-remaining x y step-x step-y period]
-  (if (zero? steps-remaining)
-    (.scrollTo js/window x y)
-    (js/setTimeout
-      #(do (.scrollBy js/window step-x step-y)
-           (animate (dec steps-remaining) x y step-x step-y period))
-      period)))
+;; Smooth step from https://en.wikipedia.org/wiki/Smoothstep
+(defn- smooth-step [start end point]
+  (let [x (/ (- point start) (- end start))]
+    (* x x (- 3 (* 2 x)))))
+
+(defn- smoother-step [start end point]
+  (let [x (/ (- point start) (- end start))]
+    (* x x x (+ (* x (- (* x 6) 15)) 10))))
+
+(defn- animate [start-time end-time start-x start-y end-x end-y]
+  (let [now (js/Date.now)]
+    (if (> now end-time)
+      (.scrollTo js/window end-x end-y)
+      (let [point (smooth-step start-time end-time (js/Date.now))]
+        (.scrollTo js/window
+          (+ start-x (* point (- end-x start-x)))
+          (+ start-y (* point (- end-y start-y))))
+        (js/setTimeout #(animate start-time end-time start-x start-y end-x end-y) 10)))))

 (defn scroll-to [x y]
-  (let [duration 100
-        period 5
-        frames (/ duration period)
-        step-x (/ (- x (.-scrollX js/window)) frames)
-        step-y (/ (- y (.-scrollY js/window)) frames)]
-    (animate frames x y step-x step-y period)))
+  (let [start-time (js/Date.now)]
+    (animate start-time (+ start-time 100) (.-scrollX js/window) (.-scrollY js/window) x y)))

 (defn scroll-to-top [] (scroll-to 0 0))


Fix uuid regular experession.

Fix uuid regular experession.


optimize dev worker so it only recompiles when needed

it would trigger a recompile that didn't do anything whenever
any file changed even when it wasn't used by the build

--- src/main/shadow/cljs/devtools/server/worker/impl.clj
+++ src/main/shadow/cljs/devtools/server/worker/impl.clj
@@ -328,11 +328,13 @@
                (map #(get-in compiler-state [:sources % :macro-namespaces]))
                (reduce set/union))]

-      (if-not (contains? macros-used-by-build macro-ns)
-        compiler-state
-        (do (require macro-ns :reload)
-            (cljs/reset-resources-using-macro compiler-state macro-ns)
-            )))))
+      ;; only reload the macro ns if the build actually uses it
+      (when (contains? macros-used-by-build macro-ns)
+        (require macro-ns :reload))
+
+      ;; always reset files so they are actually re-compiled when we start using them
+      (cljs/reset-resources-using-macro compiler-state macro-ns)
+      )))

 (defn merge-fs-update [compiler-state {:keys [ext] :as fs-update}]
   (-> compiler-state
@@ -342,17 +344,24 @@
         (contains? #{"clj" "cljc"} ext)
         (merge-fs-update-clj fs-update))))

+(defn should-recompile?
+  "only recompile when a watched file is actually used by the build"
+  [{:keys [build-sources] :as state}]
+  (some
+    (fn [src-name]
+      (nil? (get-in state [:sources src-name :output])))
+    build-sources))
+
 (defn do-cljs-watch
   [{:keys [autobuild compiler-state] :as worker-state}
    {:keys [updates] :as msg}]
   (if-not autobuild
     worker-state
     (let [next-state (reduce merge-fs-update compiler-state updates)]
-      (if (identical? next-state compiler-state)
-        worker-state
-        ;; only recompile if something actually affected us
-        (-> worker-state
-            (assoc :compiler-state next-state)
+      (-> worker-state
+          (assoc :compiler-state next-state)
+          (cond->
+            (should-recompile? next-state)
             (build-compile))))))

 (defn do-config-watch


Oops! Need a set rather than a map here.

--- integration-tests/src/test/clojure/fnbox/integs.clj
+++ integration-tests/src/test/clojure/fnbox/integs.clj
@@ -16,5 +16,5 @@
                            (swap! results conj (:type x)))]
           (with-jboss #(apply run-tests namespaces))))
       (shutdown-agents)
-      (System/exit (if (empty? (filter {:fail :error} @results)) 0 -1)))))
+      (System/exit (if (empty? (filter #{:fail :error} @results)) 0 -1)))))


Cleanup ledgers upon successful replica update

TODO: need a strategy to fallback to another peer to perform the delete
in the case where the submitting peer no longer exists.

--- src/onyx/log/commands/compact_bookkeeper_log_ids.clj
+++ src/onyx/log/commands/compact_bookkeeper_log_ids.clj
@@ -6,6 +6,7 @@
             [schema.core :as s]
             [taoensso.timbre :refer [info error warn trace fatal] :as timbre]
             [onyx.schema :refer [Replica LogEntry Reactions ReplicaDiff State]]
+            [onyx.state.log.bookkeeper :as logbk]
             [onyx.extensions :as extensions]))

 (s/defmethod extensions/apply-log-entry :compact-bookkeeper-log-ids :- Replica
@@ -34,5 +35,17 @@

 (s/defmethod extensions/fire-side-effects! :compact-bookkeeper-log-ids :- State
   [{:keys [args message-id]} :- LogEntry old new diff state]
-  ;;; PXIME, clean up delete swapped ledgers
+  ;; FIXME: should be the peer assigned to the slot id that
+  ;; deletes the ledgers not the peer that submitted the swap
+  (when (= (:id state) (:peer-id args))
+    ;; If nothing changed, delete the new compacted ledger
+    ;; Otherwise, delete the stale ledgers that have been compacted
+    (let [delete-ids (if (= new old)
+                       (:new-ledger-ids args)
+                       (:prev-ledger-ids args))
+          bk-client (logbk/bookkeeper (:opts state))]
+      (doseq [ledger-id delete-ids]
+        (info "Deleting compacted ledger id:" ledger-id)
+        (.deleteLedger bk-client ledger-id))
+        (.close bk-client)))
   state)


adding type predicates

adding type predicates

--- src-cljs/graph.cljs
+++ src-cljs/graph.cljs
@@ -89,9 +89,17 @@
 (def ^:export mapcat cljs.core/mapcat)
 (def ^:export into-array cljs.core/into-array)

+; basic types
 (def ^:export vector cljs.core/vector)
 (def ^:export hash-map cljs.core/hash-map)
 (def ^:export set cljs.core/set)
+
+; type predicates
+(def ^:export is-list cljs.core/list?)
+(def ^:export is-seq cljs.core/seq?)
+(def ^:export is-vector cljs.core/vector?)
+(def ^:export is-map cljs.core/map?)
+(def ^:export is-set cljs.core/set?)

 (def ^:export clj-to-js cljs.core/clj->js)
 (defn ^:export js-to-clj


make :output-dir a warning as its not required now

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -78,18 +78,24 @@
   (let [build-options (:compiler build')
         opts? (and (not (nil? build-options)) (optimizations-none? build'))
         out-dir? (output-dir-in-resources-root? build-options opts)]
+    ;; this is now a warning
+    (when (and (not out-dir?)
+               (:output-dir build-options))
+      (println
+       (str
+          "Figwheel Config Warning (in project.clj) -- \n"
+          "Your build :output-dir is not in a resources directory.\n"
+          "If you are serving your assets (js, css, etc.) with Figwheel,\n"
+          "they must be on the resource path for the server.\n"
+          (str "Your :output-dir should match this pattern: " (make-serve-from-display opts)))))
     (map
      #(str "Figwheel Config Error (in project.clj) - " %)
      (filter identity
              (list
               (when-not opts?
                 "you have build :optimizations set to something other than :none")
-              (when-not out-dir?
-                (str
-                 (if (:output-dir build-options)
-                   "your build :output-dir is not in a resources directory."
-                   "you have not configured an :output-dir in your build")
-                 (str "\nIt should match this pattern: " (make-serve-from-display opts)))))))))
+              (when-not (:output-dir build-options)
+                "you have not configured an :output-dir in your build"))))))

 (defn check-config [figwheel-options builds]
   (if (empty? builds)
@@ -148,4 +154,3 @@
        (apply-to-key str :http-server-root)
        (apply-to-key str :open-file-command)
        (apply-to-key str :server-logfile)))
-


Further comments

Further comments

--- lein-template/src/leiningen/new/modular/website.clj
+++ lein-template/src/leiningen/new/modular/website.clj
@@ -36,6 +36,15 @@
 ;;              - these keywords correspond to the keys in ring-handler-map
 ;;   uri-context: Usually an empty string, but acts as a prefix to the route structure

+;; The use of keywords is to allow looser coupling between generated
+;; hyperlinks and the Ring handlers they route to. Every handler can be
+;; targeted by using a keyword in bidi's path-for function. This
+;; eliminates string-munging code that would otherwise be written to
+;; form URIs, with the implicit coupling between this logic and the
+;; route structure that would result. Note it is idiomatic to use
+;; namespaced keywords so that there is less chance of conflict with
+;; other keywords used by other components.
+
 ;; By also satisfying the RingHandler protocol, this component can be
 ;; made a direct dependency of a Ring-compatible web server like
 ;; http-kit or Jetty. Whether this is the only web-serving component in


hook in the game logic

hook in the game logic

--- src/zombie_run/core.cljs
+++ src/zombie_run/core.cljs
@@ -1,7 +1,8 @@
 (ns zombie-run.core
   (:require [reagent.core :as reagent]
             [zombie-run.view :as view]
-            [goog.events :as events]))
+            [goog.events :as events]
+            [zombie-run.game :as game]))

 (def key-code->action
   {"Enter"      :restart
@@ -27,23 +28,41 @@
    ;; fire
    "f"          :fire})

-(defn handle-keydown [e]
+
+(defn reset-game [state]
+  (prn "resetting game state...")
+  (reset! state (-> (game/make-game {:world-size [300 150]})
+                    (game/configure-player-weapon (zombie-run.weapon/make-weapon :musket)))))
+
+(defn run-player-action [state action]
+  (prn (str "player action: " action "..."))
+  (swap! state #(game/run-player-action % action)))
+
+(defn run-zombie-actions [state]
+  ;(prn (str "run zombie actions..."))
+  (swap! state game/run-zombie-actions))
+
+(defn handle-keydown [game-state e]
   (when-let [action (key-code->action (.-key e))]
     (case action
-      :restart (prn "new game...")
-      (prn (str "player action: " action)))))
+      :restart (reset-game game-state)
+      (run-player-action game-state action))))

-(defonce game (atom nil))
+(defonce interval (atom nil))

 (defn start []
-  (events/removeAll js/document "keydown")
-  (events/listen js/document "keydown" handle-keydown)
-  (reset! game (js/setInterval #(identity "ping") 100)))
+  (let [game-state (atom nil)]
+    (reset-game game-state)
+
+    (events/removeAll js/document "keydown")
+    (events/listen js/document "keydown" #(handle-keydown game-state %))
+
+    (reset! interval (js/setInterval #(run-zombie-actions game-state) 100))))

 (defn stop []
-  (when [@game]
-    (js/clearInterval @game)
-    (reset! game nil)))
+  (when [@interval]
+    (js/clearInterval @interval)
+    (reset! interval nil)))

 (defn reset []
   (stop)


:bug: Fix color palettes displacement.

:bug: Fix color palettes displacement.

--- frontend/src/uxbox/main/ui/workspace/colorpalette.cljs
+++ frontend/src/uxbox/main/ui/workspace/colorpalette.cljs
@@ -13,6 +13,7 @@
    [goog.events :as events]
    [okulary.core :as l]
    [rumext.alpha :as mf]
+   [uxbox.common.math :as mth]
    [uxbox.main.data.library :as dlib]
    [uxbox.main.data.workspace :as udw]
    [uxbox.main.store :as st]
@@ -65,7 +66,7 @@
         state      (mf/use-state {:show-menu false })

         width      (:width @state 0)
-        visible    (/ width 66)
+        visible    (mth/round (/ width 66))

         offset     (:offset @state 0)
         max-offset (- (count items)
@@ -76,21 +77,22 @@

         on-left-arrow-click
         (mf/use-callback
+         (mf/deps max-offset visible)
          (fn [event]
            (swap! state update :offset
                   (fn [offset]
                     (if (pos? offset)
-                      (dec offset)
+                      (max (- offset (mth/round (/ visible 2))) 0)
                       offset)))))

         on-right-arrow-click
         (mf/use-callback
-         (mf/deps max-offset)
+         (mf/deps max-offset visible)
          (fn [event]
            (swap! state update :offset
                   (fn [offset]
                     (if (< offset max-offset)
-                      (inc offset)
+                      (min max-offset (+ offset (mth/round (/ visible 2))))
                       offset)))))

         on-scroll


fix require of unmunged names in injected scripts

fixes #468

--- sidecar/src/figwheel_sidecar/build_middleware/injection.clj
+++ sidecar/src/figwheel_sidecar/build_middleware/injection.clj
@@ -4,7 +4,8 @@
    [figwheel-sidecar.utils :refer [name-like?]]
    [clojure.java.io :as io]
    [clojure.string :as string]
-   [cljs.env :as env]
+   [cljs.env :as env]
+   [cljs.compiler :as compiler]
    [cljs.analyzer.api :as ana-api]))

 #_(remove-ns 'figwheel-sidecar.build-middleware.injection)
@@ -107,14 +108,14 @@
                     (= target :nodejs))
         main?     (get-in build [:build-options :main])
         output-to (get-in build [:build-options :output-to])
-        connect-script-ns (figwheel-connect-ns-name build)
+        munged-connect-script-ns (compiler/munge (figwheel-connect-ns-name build))
         line (if (and main? (not node?))
                (str
                 (when (get-in build [:figwheel :devcards])
                   (document-write-require-lib 'devcards.core))
-                (document-write-require-lib connect-script-ns))
+                (document-write-require-lib munged-connect-script-ns))
                ;; else
-               (esc-fmt "\ngoog.require(%s);" connect-script-ns))]
+               (esc-fmt "\ngoog.require(%s);" munged-connect-script-ns))]
     (when output-to
       (if (and main? (not node?))
         (let [lines (string/split (slurp output-to) #"\n")]


add a comment and remove an unnecessary let

--- frontend/instrumentation.cljs
+++ frontend/instrumentation.cljs
@@ -28,6 +28,8 @@
           (utils/merror e)
           state)))))

+;; map of react-id to component render stats, e.g.
+;; {"0.1.1" {:last-will-update <time 3pm> :display-name "App" :last-did-update <time 3pm> :render-ms [10 39 20 40]}}
 (def component-stats (atom {}))

 (defn react-id [x]
@@ -42,9 +44,8 @@
                   (fn [f]
                     (fn [next-props next-state]
                       (this-as this
-                        (let [dname ((aget this "getDisplayName"))]
-                          (swap! component-stats update-in [(react-id this)] merge {:display-name dname
-                                                                                :last-will-update (time/now)}))
+                        (swap! component-stats update-in [(react-id this)] merge {:display-name ((aget this "getDisplayName"))
+                                                                                :last-will-update (time/now)})
                         (.call f this next-props next-state)))))
        (update-in [:componentDidUpdate]
                   (fn [f]


replaces ADH5 sample query with GATA1

replaces ADH5 sample query with GATA1

--- src/cljs/gointermod/views.cljs
+++ src/cljs/gointermod/views.cljs
@@ -57,7 +57,7 @@
       [:h2 "InterMOD GO Tool"]
       [:p "Type a Gene identifier or symbol into the searchbar up the top and press search."]
       [:p "If you're not sure what genes to choose, check out the results for "
-     [sample-query "BMP4"] ", " [sample-query "SOX18"] " or " [sample-query "ADH5"]]
+     [sample-query "BMP4"] ", " [sample-query "SOX18"] " or " [sample-query "GATA1"]]
      [organism-line]
      ]])


Last commit was not correct — fixed it

Last commit was not correct — fixed it

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/fca/exploration.clj
+++ src/conexp/fca/exploration.clj
@@ -182,79 +182,77 @@
   If you want to use automorphisms of the underlying context, you have
   to construct a special handler using the «make-handler»
   function. See the corresponding documentation of «make-handler»."
-  [possible-ctx, certain-ctx,
-   & {:keys [background-knowledge handler]
-      :or   {:background-knowledge #{},
-             :handler default-handler-for-incomplete-counterexamples}}]
-  (println background-knowledge handler)
-  (assert (set? background-knowledge))
-  (assert (= (attributes certain-ctx)
-             (attributes possible-ctx))
-          "Given contexts must coincide on the set of attributes")
-  (assert (= (objects certain-ctx)
-             (objects possible-ctx))
-          "Given contexts must coincide on the set of objects")
-  (loop [implications background-knowledge,
-         last         (close-under-implications implications #{}),
-         possible-ctx possible-ctx
-         certain-ctx  certain-ctx]
-    (if (not last)
-      {:implications (difference implications background-knowledge),
-       :possible-context possible-ctx
-       :certain-context  certain-ctx}
-      (let [conclusion-from-last (oprime possible-ctx (aprime certain-ctx last))] ; ?
-        (if (= last conclusion-from-last)
-          (recur implications
-                 (next-closed-set (attributes possible-ctx)
-                                  (clop-by-implications implications)
-                                  last)
-                 possible-ctx
-                 certain-ctx)
-          (let [new-impl        (make-implication last conclusion-from-last),
-                counterexamples (try
-                                  (handler possible-ctx certain-ctx implications new-impl)
-                                  (catch Throwable e
-                                    :abort))]
-
-            (cond
-             (= counterexamples :abort)
-             (recur implications nil possible-ctx certain-ctx) ; abort exploration
-             ;;
-             counterexamples         ; add counterexample
-             (let [new-objs (map first counterexamples)]
-               ;; check that new names are not there already
-               (when (exists [g new-objs] (contains? (objects possible-ctx) g))
-                 (illegal-argument "Got objects as «new objects» in exploration "
-                                   "which are already present."))
-               (recur implications
-                      last
-                      ;; possible incidence, i.e. the one not excluded by the expert
-                      (make-context (into (objects possible-ctx) new-objs)
-                                    (attributes possible-ctx)
-                                    (union (incidence possible-ctx)
-                                           (set-of [g m] [[g _ neg] counterexamples,
-                                                          m (difference (attributes possible-ctx)
-                                                                        (set neg))])))
-                      ;; certain incidence, i.e. the one given by the expert
-                      (make-context (into (objects certain-ctx) new-objs)
-                                    (attributes certain-ctx)
-                                    (union (incidence certain-ctx)
-                                           (set-of [g m] [[g pos _] counterexamples,
-                                                          m pos])))))
-             ;;
-             true                    ; add implication
-             (let [new-implications (conj implications new-impl)]
-               (recur new-implications
-                      (next-closed-set (attributes possible-ctx)
-                                       (clop-by-implications new-implications)
-                                       last)
-                      possible-ctx
-                      (make-context (objects certain-ctx)
-                                    (attributes certain-ctx)
-                                    (set-of [g m] [g (objects certain-ctx),
-                                                   m (close-under-implications
-                                                      new-implications
-                                                      (oprime certain-ctx #{g}))])))))))))))
+  [possible-ctx, certain-ctx & {:keys [background-knowledge handler]}]
+  (let [background-knowledge (or background-knowledge #{})
+        handler              (or handler default-handler-for-incomplete-counterexamples)]
+    (assert (set? background-knowledge))
+    (assert (= (attributes certain-ctx)
+               (attributes possible-ctx))
+            "Given contexts must coincide on the set of attributes")
+    (assert (= (objects certain-ctx)
+               (objects possible-ctx))
+            "Given contexts must coincide on the set of objects")
+    (loop [implications background-knowledge,
+           last         (close-under-implications implications #{}),
+           possible-ctx possible-ctx
+           certain-ctx  certain-ctx]
+      (if (not last)
+        {:implications (difference implications background-knowledge),
+         :possible-context possible-ctx
+         :certain-context  certain-ctx}
+        (let [conclusion-from-last (oprime possible-ctx (aprime certain-ctx last))] ; ?
+          (if (= last conclusion-from-last)
+            (recur implications
+                   (next-closed-set (attributes possible-ctx)
+                                    (clop-by-implications implications)
+                                    last)
+                   possible-ctx
+                   certain-ctx)
+            (let [new-impl        (make-implication last conclusion-from-last),
+                  counterexamples (try
+                                    (handler possible-ctx certain-ctx implications new-impl)
+                                    (catch Throwable e
+                                      :abort))]
+
+              (cond
+               (= counterexamples :abort)
+               (recur implications nil possible-ctx certain-ctx) ; abort exploration
+               ;;
+               counterexamples         ; add counterexample
+               (let [new-objs (map first counterexamples)]
+                 ;; check that new names are not there already
+                 (when (exists [g new-objs] (contains? (objects possible-ctx) g))
+                   (illegal-argument "Got objects as «new objects» in exploration "
+                                     "which are already present."))
+                 (recur implications
+                        last
+                        ;; possible incidence, i.e. the one not excluded by the expert
+                        (make-context (into (objects possible-ctx) new-objs)
+                                      (attributes possible-ctx)
+                                      (union (incidence possible-ctx)
+                                             (set-of [g m] [[g _ neg] counterexamples,
+                                                            m (difference (attributes possible-ctx)
+                                                                          (set neg))])))
+                        ;; certain incidence, i.e. the one given by the expert
+                        (make-context (into (objects certain-ctx) new-objs)
+                                      (attributes certain-ctx)
+                                      (union (incidence certain-ctx)
+                                             (set-of [g m] [[g pos _] counterexamples,
+                                                            m pos])))))
+               ;;
+               true                    ; add implication
+               (let [new-implications (conj implications new-impl)]
+                 (recur new-implications
+                        (next-closed-set (attributes possible-ctx)
+                                         (clop-by-implications new-implications)
+                                         last)
+                        possible-ctx
+                        (make-context (objects certain-ctx)
+                                      (attributes certain-ctx)
+                                      (set-of [g m] [g (objects certain-ctx),
+                                                     m (close-under-implications
+                                                        new-implications
+                                                        (oprime certain-ctx #{g}))]))))))))))))

 ;;;


insights: "behind a feature flag" you go

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -399,11 +399,12 @@
                                  "unread")}
          [:i.fa.fa-bell]]

-        [:a.aside-item {:data-placement "right"
-                        :data-trigger "hover"
-                        :title "Insights"
-                        :href "/build-insights"}
-         [:i.fa.fa-bar-chart-o]]
+        (when (feature/enabled? :insights)
+          [:a.aside-item {:data-placement "right"
+                          :data-trigger "hover"
+                          :title "Insights"
+                          :href "/build-insights"}
+           [:i.fa.fa-bar-chart-o]])

         (when (:admin user)
           [:a.aside-item {:data-placement "right"


Fix uberwar task for leiningen 2.0 preview3.

--- src/leiningen/ring/uberwar.clj
+++ src/leiningen/ring/uberwar.clj
@@ -44,11 +44,12 @@
   ([project]
      (uberwar project (default-uberwar-name project)))
   ([project war-name]
-     (when (zero? (compile/compile project))
-       (let [war-path (war/war-file-path project war-name)]
-         (war/compile-servlet project)
-         (if (war/has-listener? project)
-           (war/compile-listener project))
-         (write-uberwar project war-path)
-         (println "Created" war-path)
-         war-path))))
+     (let [res (compile/compile project)]
+       (when-not (and (number? res) (pos? res))
+         (let [war-path (war/war-file-path project war-name)]
+           (war/compile-servlet project)
+           (if (war/has-listener? project)
+             (war/compile-listener project))
+           (write-uberwar project war-path)
+           (println "Created" war-path)
+           war-path)))))


(maint) Fix managed-load-path schema errors

Fix this error:

    Caused by: clojure.lang.ExceptionInfo: Output of managed-load-path does not match schema: [(not (instance? java.lang.String a-java.io.File)) (not (instance? java.lang.String a-java.io.File)) (not (instance? java.lang.String a-java.io.File)) (not (instance? java.lang.String a-java.io.File)) (not (instance? java.lang.String a-java.io.File)) (not (instance? java.lang.String a-java.io.File))]
     at puppetlabs.services.jruby.jruby_puppet_internal$eval9067$managed_load_path__9068.invoke (jruby_puppet_internal.clj:69)
        puppetlabs.services.jruby.jruby_puppet_internal$prep_scripting_container.invoke (jruby_puppet_internal.clj:89)
        puppetlabs.services.jruby.jruby_puppet_internal$empty_scripting_container.invoke (jruby_puppet_internal.clj:101)
        puppetlabs.services.jruby.jruby_puppet_internal$create_scripting_container.invoke (jruby_puppet_internal.clj:117)
        puppetlabs.services.jruby.jruby_puppet_internal$eval9122$create_pool_instance_BANG___9123$fn__9124.invoke (jruby_puppet_internal.clj:156)
        puppetlabs.services.jruby.jruby_puppet_internal$eval9122$create_pool_instance_BANG___9123.invoke (jruby_puppet_internal.clj:141)

--- src/clj/puppetlabs/services/jruby/jruby_puppet_internal.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_internal.clj
@@ -80,7 +80,8 @@
                     (cons (str jruby-home "/lib/ruby/1.9/site_ruby")))]
     (->> load-path
       (map fs/absolute-path)
-      (map fs/normalized-path))))
+      (map fs/normalized-path)
+      (map str))))

 (defn prep-scripting-container
   [scripting-container ruby-load-path gem-home]


Macros: Notes.

Macros: Notes.

--- test/com/nomistech/clojure_the_language/macros/examples.clj
+++ test/com/nomistech/clojure_the_language/macros/examples.clj
@@ -46,9 +46,35 @@
         (do (println "It's small") :small)
         (do (println "It's large") :large)))

+;;;; Why would you use this?
+
+;;;; Given...
+
+#_
+(if test
+  (a long (and (complicated))
+     (computation with)
+     lots
+     (of bits)
+     and
+     pieces)
+  something-quick-and-simple)
+
+;;;; ...you might prefer...
+
+#_
+(if-not test
+  something-quick-and-simple
+  (a long (and (complicated))
+     (computation with)
+     lots
+     (of bits)
+     and
+     pieces))
+
 ;;;; Is this a good use of macros?
 ;;;; Yes, but...
-;;;; - See syntax-quote below.
+;;;; - (if (not ...) ... ...) is probably fine too.

 ;;;; ___________________________________________________________________________
 ;;;; Syntax-quote, unquote and unquote-splicing.
@@ -82,7 +108,7 @@
                   (do (println "It's small") :small)))
   => :large)

-(fact
+(fact "`our-if-not-2` macroexpands identically to `our-if-not-1`"
   (macroexpand-1 '(our-if-not-2 (> x 100)
                                 (do (println "It's large") :large)
                                 (do (println "It's small") :small)))


0.0.6

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.rpl/specter "0.0.5"
+(defproject com.rpl/specter "0.0.6"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  ]
   :jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions


Bump deps

Bump deps

--- project.clj
+++ project.clj
@@ -11,7 +11,7 @@
                 *assert* true}

   :dependencies
-  [[com.taoensso/encore              "2.117.0"]
+  [[com.taoensso/encore              "2.127.0"]
    [com.taoensso/timbre              "4.10.0"]
    [com.taoensso/nippy               "2.14.0"]
    [org.apache.commons/commons-pool2 "2.4.2"] ; Nb bug in newer versions, see #213


Update URL in project.clj

Update URL in project.clj

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (defproject specium "0.1.0-SNAPSHOT"
   :description "Inverse of s/form, reducing eval calls as much as possible"
-  :url "http://example.com/FIXME"
+  :url "https://github.com/athos/specium"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.9.0-alpha17"]


new version

new version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject day8.re-frame/http-fx "0.0.3"
+(defproject day8.re-frame/http-fx "0.0.4-SNAPSHOT"
   :description  "A re-frame effects handler for performing Ajax tasks"
   :url          "https://github.com/Day8/re-frame-http-fx.git"
   :license      {:name "MIT"}


move to 19 snap

move to 19 snap

--- project.clj
+++ project.clj
@@ -3,7 +3,7 @@
   [path]
   (str "resources/public/js/lib/" path))

-(defproject onaio/hatti "0.3.18"
+(defproject onaio/hatti "0.3.19-SNAPSHOT"
   :description "A cljs dataview from your friends at Ona.io"
   :license "Apache 2, see LICENSE"
   :url "https://github.com/onaio/hatti"


Release version 0.13.3.0-alpha1.

Release version 0.13.3.0-alpha1.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject onyx-app/lein-template "0.13.2.0"
+(defproject onyx-app/lein-template "0.13.3.0-alpha1"
   :description "Onyx Leiningen application template"
   :url "https://github.com/onyx-platform/onyx-template"
   :license {:name "MIT License"


0.2.12-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject riemann "0.2.11"
+(defproject riemann "0.2.12-SNAPSHOT"
   :description
 "A network event stream processor. Intended for analytics, metrics, and alerting; and to glue various monitoring systems together."
   :url "http://github.com/riemann/riemann"


sorted out stuff in project.clj

sorted out stuff in project.clj

--- project.clj
+++ project.clj
@@ -1,27 +1,32 @@
 (defproject reagent-phonecat-tutorial "0.1.0-SNAPSHOT"
-  :description "FIXME: write description"
-  :url "http://example.com/FIXME"
+  :description "A Reagent tutorial inspired by AngularJS's Phonecat."
+  :url "https://github.com/vvvvalvalval/reagent-phonecat"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}

   :source-paths ["src/clj" "src/cljs"]

-  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
+  :dependencies [;; the Clojure(Script) language
+                 [org.clojure/clojure "1.7.0-RC1"]
+                 [org.clojure/clojurescript "0.0-3308" :scope "provided"]
+
+                 ;; Server-side dependencies
                  [ring-server "0.4.0"]
+                 [ring "1.3.2"]
+                 [ring/ring-defaults "0.1.5"]
+                 [compojure "1.3.4"]
+                 [hiccup "1.0.5"]
+                 [environ "1.0.0"]
+                 [prone "0.8.2"]
+
+                 ;; client-side dependencies
+                 [org.webjars/bootstrap "3.1.0"]
                  [cljsjs/react "0.13.3-0"]
                  [reagent "0.5.0"]
                  [reagent-forms "0.5.1"]
                  [reagent-utils "0.1.4"]
-                 [ring "1.3.2"]
-                 [ring/ring-defaults "0.1.5"]
-                 [prone "0.8.2"]
-                 [compojure "1.3.4"]
-                 [hiccup "1.0.5"]
-                 [environ "1.0.0"]
-                 [org.clojure/clojurescript "0.0-3308" :scope "provided"]
                  [secretary "1.2.3"]
-
-                 [org.webjars/bootstrap "3.1.0"]]
+                 ]

   :plugins [[lein-environ "1.0.0"]
             [lein-asset-minifier "0.2.2"]]


updated libs

updated libs

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
-(defproject io.czlab/basal "2.0.1"
+(defproject io.czlab/basal "2.0.2"

   :license {:url "http://www.eclipse.org/legal/epl-v10.html"
             :name "Eclipse Public License"}
@@ -8,21 +8,21 @@
   :description "General clojure helper functions"
   :url "https://github.com/llnek/basal"

-  :dependencies [[org.apache.logging.log4j/log4j-slf4j-impl "2.13.0"]
-                 [org.apache.logging.log4j/log4j-core "2.13.0"]
-                 [org.slf4j/slf4j-api "1.7.30" ]
-                 [io.aviso/pretty "0.1.37"]
-                 [org.clojure/core.async "0.6.532"]
-                 [org.flatland/ordered "1.5.7"]
-                 [org.clojure/data.json "0.2.7"]
-                 [org.clojure/tools.logging "0.5.0"]
-                 [org.clojure/clojurescript "1.10.597"]]
+  :dependencies [[org.apache.logging.log4j/log4j-slf4j-impl "2.14.1"]
+                 [org.apache.logging.log4j/log4j-core "2.14.1"]
+                 [org.slf4j/slf4j-api "1.7.31" ]
+                 [io.aviso/pretty "1.1"]
+                 [org.clojure/core.async "1.3.618"]
+                 [org.flatland/ordered "1.5.9"]
+                 [org.clojure/data.json "2.4.0"]
+                 [org.clojure/tools.logging "1.1.0"]
+                 [org.clojure/clojurescript "1.10.866"]]

   :exclusions [org.clojure/clojure]

-  :plugins [[cider/cider-nrepl "0.22.4"]
+  :plugins [[cider/cider-nrepl "0.26.0"]
             [lein-codox "0.10.7"]
-            [lein-cljsbuild "1.1.7"]]
+            [lein-cljsbuild "1.1.8"]]

   :cljsbuild {
     :builds [{
@@ -37,7 +37,7 @@
           :pretty-print true}}]}

   :profiles {:provided {:dependencies [[org.clojure/clojure
-                                        "1.10.1" :scope "provided"]]}
+                                        "1.10.3" :scope "provided"]]}
              :uberjar {:aot :all}}

   :global-vars {*warn-on-reflection* true}
@@ -66,8 +66,8 @@
   :jvm-opts ["-Dczlabloggerflag=true"
              "-Dlog4j.configurationFile=file:attic/log4j2.xml"]

-  :javac-options ["-source" "11"
-                  "-target" "11"
+  :javac-options ["-source" "16"
+                  "-target" "16"
                   "-Xlint:unchecked" "-Xlint:-options" "-Xlint:deprecation"])

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


start with empty query in tab

start with empty query in tab

--- iwaswhere-web/src/cljs/iwaswhere_web/ui/search.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/ui/search.cljs
@@ -8,8 +8,12 @@

 (defn search-field-view
   [snapshot put-fn query-id]
-  (let [local (rc/atom {})]
-    (fn [snapshot put-fn]
+  (let [local (rc/atom {:current-query (p/parse-search "")})
+        update-search (fn [] (put-fn [:search/update
+                                       (merge {:query-id query-id}
+                                              (:current-query @local))]))]
+    (update-search)
+    (fn [snapshot put-fn query-id]
       (let [get-tags #(% (:current-query @local))
             local-snapshot @local
             before-cursor (h/string-before-cursor
@@ -25,16 +29,14 @@
                           (let [search (p/parse-search
                                          (aget ev "target" "innerText"))]
                             (swap! local assoc-in [:current-query] search)
-                            (put-fn [:search/update (merge {:query-id query-id}
-                                                           search)])))
+                            (update-search)))
             tag-replace-fn
             (fn [curr-tag tag]
               (let [curr-tag-regex (js/RegExp (str curr-tag "(?!" p/tag-char-cls ")") "i")
                     search-text (:search-text (:current-query @local))
                     new-search (p/parse-search (s/replace search-text curr-tag-regex tag))]
                 (swap! local assoc-in [:current-query] new-search)
-                (put-fn [:search/update (merge {:query-id query-id}
-                                               new-search)])))
+                (update-search)))
             on-keydown-fn
             (fn [ev]
               (let [key-code (.. ev -keyCode)]


lein-release plugin: preparing 0.139 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject maestro "0.139-SNAPSHOT"
+(defproject maestro "0.139"
   :description "Maestro service"
   :license  "https://github.com/mixradio/mr-maestro/blob/master/LICENSE"


(PE-28468) Pin trapperkeeper-metrics to 1.2.1

This has the fix for CVE-2020-7943

--- project.clj
+++ project.clj
@@ -90,7 +90,9 @@
     ;;   CVE-2017-7658 (PDB-4161)
     ;;   CVE-2018-19360 CVE-2018-19361 CVE-2018-19362 (PDB-4364)
     ;; (logstash depends on jackson-databind)
-    [com.fasterxml.jackson.core/jackson-databind "2.9.10"]])
+    [com.fasterxml.jackson.core/jackson-databind "2.9.10"]
+    ;; CVE-2020-7943
+    [puppetlabs/trapperkeeper-metrics "1.2.1" :exclusions [ring/ring-defaults org.slf4j/slf4j-api]]])

 ;; Don't use lein :clean-targets so that we don't have to repeat
 ;; ourselves, given that we need to remove some protected files, and
@@ -165,7 +167,7 @@
                     [puppetlabs/stockpile "0.0.4"]
                     [puppetlabs/tools.namespace "0.2.4.1"]
                     [puppetlabs/trapperkeeper]
-                    [puppetlabs/trapperkeeper-metrics :exclusions [ring/ring-defaults org.slf4j/slf4j-api]]
+                    [puppetlabs/trapperkeeper-metrics "1.2.1" :exclusions [ring/ring-defaults org.slf4j/slf4j-api]]
                     [puppetlabs/trapperkeeper-status]

                     ;; Various


project: no aot in dev, direct-linking uberjar

--- project.clj
+++ project.clj
@@ -4,7 +4,8 @@
   :license {:name "MIT License"
             :url "https://github.com/pyr/cyanite/tree/master/LICENSE"}
   :maintainer {:email "pyr@spootnik.org"}
-  :aot :all
+  :profiles {:uberjar {:aot      :all
+                       :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}
   :main io.cyanite
   :plugins [[lein-ancient "0.6.7"]]
   :dependencies [[org.clojure/clojure           "1.8.0"]


(maint) update project.clj to 4.2.5 for pe-only release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def pdb-version "4.2.5-SNAPSHOT")
+(def pdb-version "4.2.5")

 (defn deploy-info
   "Generate deployment information from the URL supplied and the username and


lamina to beta12

lamina to beta12

--- project.clj
+++ project.clj
@@ -10,7 +10,7 @@
                 [clj-json "0.4.3"]
                 [org.clojure/data.json "0.1.3"]
                 [com.lambdaworks/scrypt "1.3.3"]
-                [lamina "0.5.0-beta10"]
+                [lamina "0.5.0-beta12"]
                 [org.slf4j/slf4j-api "1.6.4"]
                 [ch.qos.logback/logback-classic "1.0.3"]
                 [commons-codec/commons-codec "1.6"]


Fix branch name typo.

Fix branch name typo.

--- project.clj
+++ project.clj
@@ -41,7 +41,7 @@
                                     "-XX:StartFlightRecording=duration=1080s,filename=recording.jfr"]}}
   :unison
   {:repos
-   [{:git "git@github.com:onyx-platform/onyx-kafka.git" :branch "compatability"}
-    {:git "git@github.com:onyx-platform/onyx-datomic.git" :branch "compatability"}
-    {:git "git@github.com:onyx-platform/onyx-sql.git" :branch "compatability"}]}
+   [{:git "git@github.com:onyx-platform/onyx-kafka.git" :branch "compitability"}
+    {:git "git@github.com:onyx-platform/onyx-datomic.git" :branch "compatibility"}
+    {:git "git@github.com:onyx-platform/onyx-sql.git" :branch "compatibility"}]}
   :codox {:output-dir "doc/api"})


bump to 0.3.9

bump to 0.3.9

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject figwheel/lein-template "0.3.5-1"
+(defproject figwheel/lein-template "0.3.9"
   :description "A Leinigen template for figwheel"
   :url "https://github.com/bhauman/figwheel-template"
   :license {:name "Eclipse Public License"