Fix bad merge which dropped rethrow from startup

--- src/onyx/test_helper.clj
+++ src/onyx/test_helper.clj
@@ -95,11 +95,11 @@
   (try
     (let [m-cfg (or monitoring-config {:monitoring :no-op})]
       (onyx.api/start-peer-group peer-config m-cfg))
+    (catch InterruptedException e)
     (catch Throwable e
-      (fatal e)
-      nil)))
-
-(defn try-start-peers [n-peers peer-group]
+      (throw e))))
+
+(defn try-start-peers [n-peers peer-group monitoring-config]
   (try
     (onyx.api/start-peers n-peers peer-group (or monitoring-config {:monitoring :custom}))
     (catch InterruptedException e)
@@ -108,8 +108,8 @@

 (defn add-test-env-peers!
   "Add peers to an OnyxTestEnv component"
-  [{:keys [peer-group peers] :as component} n-peers]
-  (swap! peers into (try-start-peers n-peers peer-group)))
+  [{:keys [peer-group peers monitoring-config] :as component} n-peers]
+  (swap! peers into (try-start-peers n-peers peer-group monitoring-config)))

 (defn shutdown-peer [v-peer]
   (try
@@ -133,7 +133,7 @@
     (println "Starting Onyx test environment")
     (let [env (try-start-env env-config)
           peer-group (try-start-group peer-config monitoring-config)
-          peers (try-start-peers n-peers peer-group)]
+          peers (try-start-peers n-peers peer-group monitoring-config)]
       (assoc component :env env :peer-group peer-group :peers (atom peers))))

   (stop [component]


trying array to object

trying array to object

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -252,8 +252,13 @@
     [outer
      [[{:$sortByCount dollar}
        {:$limit (or limit 10)}]
-      dollar
-      dollar]]))
+      {:$map
+       {:input dollar
+        :as "index"
+        :in
+        {:k "$$index._id"
+         :v "$$index.count"}}}
+      {:$arrayToObject dollar}]]))

 (defn render-percentile
   [outer percentiles]
@@ -464,58 +469,3 @@
 ;;      :features [(count fea) (count variants) (count vedges)]}))

-;; (def do-percentile
-;;   [{:$facet
-;;     {:start
-;;      [{:$bucketAuto
-;;        {:groupBy "$start"
-;;         :buckets 100}}]}}
-;;    {:$project
-;;     {:start
-;;      {:$map
-;;       {:input [1 5 10]
-;;        :as "index"
-;;        :in
-;;        {:percentile "$$index"
-;;         :start
-;;         {:$arrayElemAt ["$start", "$$index"]}}}}}}
-;;    {:$project
-;;     {:start
-;;      {:$map
-;;       {:input "$start"
-;;        :as "index"
-;;        :in
-;;        {:percentile "$$index.percentile"
-;;         :start "$$index.start._id.max"}}}}}])
-
-;; [{:$group {:_id {:$multiply [100000 {:$ceil {:$divide ["$end" 100000]}}]} :count {:$sum 1}}} {:$sort {"_id" -1}}]
-
-[[:$facet
-  {:start
-   [{:$bucketAuto
-     {:groupBy "$start",
-      :buckets 100}}],
-   :end
-   [{:$group
-     {:_id
-      {:$multiply
-       [1000000
-        {:$ceil
-         {:$divide ["$end" 1000000]}}]},
-      :count {:$sum 1}}}
-    {:$sort {"_id" -1}}],
-   :chromosome
-   [{:$sortByCount "$chromosome"}
-    {:$limit 11}]}]
- [:$project
-  {:start
-   {:$map
-    {:input "$start",
-     :as "index",
-     :in
-     {:percentile "$$index.percentile",
-      :start "$$index.start._id.max"}}},
-   :end "$end",
-   :chromosome "$chromosome"}]
- {:$project {:_id false}}]
-


adding aggregate method

adding aggregate method

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -342,6 +342,7 @@
    :count qount
    :sort psort
    :gather gather
+   :aggregate aggregate
    :groupCount group-count})

 (defn apply-step


resetting right after connect to guarantee a sane state

--- src/overtone/core/sc.clj
+++ src/overtone/core/sc.clj
@@ -197,6 +197,8 @@

 (def N-RETRIES 20)

+(declare reset)
+
 (defn- connect-internal
   []
   (log/debug "Connecting to internal SuperCollider server")
@@ -212,6 +214,7 @@
     (snd "/status")
     (dosync (ref-set status* :connected))
     (notify true) ; turn on notifications now that we can communicate
+    (reset)
     (event :connected)))

 (defn- connect-external
@@ -228,6 +231,7 @@
         #(do
            (dosync (ref-set status* :connected))
            (notify true) ; turn on notifications now that we can communicate
+           (reset)
            (event :connected)
            :done))

@@ -247,7 +251,9 @@
   [& [host port]]
    (if (and host port)
      (.run (Thread. #(connect-external host port)))
-     (connect-internal)))
+     (connect-internal))
+
+  )

 (defonce running?* (atom false))

@@ -818,6 +824,8 @@
   (snd "/d_recv" (synthdef-bytes (synthdef-read path))))

 ; TODO: need to clear all the buffers and busses
+;  * Think about a sane policy for setting up state, especially when we are connected
+; with many peers on one or more servers...
 (defn reset
   "Clear all synthesizers, groups and pending messages from the audio server
   and then recreates the active synth groups."
@@ -949,10 +957,6 @@
              (concat named [(first names) (first args)]))
       named)))

-
-; TODO: Think about a sane policy for setting up state, especially when we are connected
-; with many peers on one or more servers...
-(on :connected #(reset)) ; put ourselves in a standard place after connect

 (defn synth-player
   "Returns a player function for a named synth.  Used by (synth ...) internally, but can be


Correctly print out val and arg map in node exception

--- src/overtone/sc/node.clj
+++ src/overtone/sc/node.clj
@@ -130,7 +130,11 @@
                  (let [val (to-id val)
                        val (to-float val)]
                    (when (not (float? val))
-                     (throw (IllegalArgumentException. (str "Incorrect arg. Was expecting a float and found " val ". Full arg map: " arg-map))))
+                     (throw (IllegalArgumentException.
+                             (str "Incorrect arg. Was expecting a float and found "
+                                  (with-out-str (pr val))
+                                  ". Full arg map: "
+                                  (with-out-str (pr arg-map))))))
                    val))]

     (zipmap (map name-fn (keys arg-map))


add test for passing multiple options

add test for passing multiple options

--- test/testdouble/cljs/csv_test.cljs
+++ test/testdouble/cljs/csv_test.cljs
@@ -16,6 +16,9 @@
     (testing "user defined newline ':cr+lf'"
       (is (= "1,2,3\r\n4,5,6" (csv/write-csv data :newline :cr+lf))))

+    (testing "user defined separator '|' and newline ':cr+lf"
+      (is (= "1|2|3\r\n4|5|6" (csv/write-csv data :separator "|" :newline :cr+lf))))
+
     (testing "quote each field"
       (is (= "\"1,000\",\"2\",\"3\"\n\"4\",\"5,000\",\"6\"" (csv/write-csv [["1,000" "2" "3"] ["4" "5,000" "6"]] :quote true))))


Fix warning

Fix warning

--- test/tick/alpha/api/dates_test.clj
+++ test/tick/alpha/api/dates_test.clj
@@ -1,7 +1,7 @@
 ;; Copyright © 2016-2018, JUXT LTD.

 (ns tick.alpha.api.dates-test
-  (:refer-clojure :exclude [dec < range <= min long int > extend - time / >= inc + max complement atom swap-vals! reset-vals! compare-and-set! reset! swap!])
+  (:refer-clojure :exclude [dec < range <= min long int > extend - time / >= inc + max complement atom swap-vals! reset-vals! compare-and-set! reset! swap! second])
   (:require
    [clojure.spec.alpha :as s]
    [clojure.test :refer :all]


Optimize DOM tree serialization by creating the attribute key/value serializer function just once, not anew for each Element serialized

--- src/main/clojure/cascade/dom.clj
+++ src/main/clojure/cascade/dom.clj
@@ -94,21 +94,15 @@
 (defn create-serialize-attribute-pair
   "Returns a function that a key/value attribute pair into a seq of strings for rendering the attribute value. The key is expected a string or keyword. The value is a string,
   number, or keyword. If the value is nil, the returned function returns nil."
-  [strategy]
-  (let [attr-quote (:attribute-quote strategy)]
-    (fn [[attr-name attr-value]]
-      (if (nil? attr-value)
-        nil
-        [" " (name attr-name) "=" attr-quote (to-attribute-value-string attr-value) attr-quote]))))
+  [attr-quote]
+  (fn [[attr-name attr-value]]
+    (if (nil? attr-value)
+      nil
+      [" " (name attr-name) "=" attr-quote (to-attribute-value-string attr-value) attr-quote])))

 (defn serialize-attribute-pairs
   [attributes strategy]
-  ; Perhaps premature optimization, but we'll be doing this a LOT. In fact, I'm not happy that
-  ; it is necessary to create the function fresh all the time; probably roll this into creation once as
-  ; part of the strategy itself.
-  (if (empty? attributes)
-    nil
-    (mapcat (create-serialize-attribute-pair strategy) attributes)))
+  (mapcat (:serialize-attribute-pair strategy) attributes))

 (defn serialize-content-and-close [element-name content strategy]
   (if (empty? content)
@@ -162,7 +156,7 @@
   (Static. ["<!--" comment "-->"]))

 (def xml-strategy {
-  :attribute-quote "\""
+  :serialize-attribute-pair (create-serialize-attribute-pair "\"")
   :write-empty-element-close (constantly ["/>"])
   })

@@ -181,8 +175,8 @@
     [">"]))

 (def html-strategy {
-  :attribute-quote "\""
-  :write-empty-element-close #'html-empty-element-writer
+  :serialize-attribute-pair (create-serialize-attribute-pair "\"")
+  :write-empty-element-close html-empty-element-writer
   })

 (defn serialize-html


#51: Bug fix to handle protocol-less URLs

--- src/qcast/infoq/site.clj
+++ src/qcast/infoq/site.clj
@@ -29,17 +29,20 @@

 ;;; Internals

+(defn- url-prefix-protocol [url]
+  (if (.startsWith url "//") (clojure.string/join ["http:" url]) url))
+
 (defn- HEAD [url & [opts]]
   (debug :head url opts)
-  (http/head url (merge http-options {:follow-redirects false} opts)))
+  (http/head (url-prefix-protocol url) (merge http-options {:follow-redirects false} opts)))

 (defn- GET [url & [opts]]
   (debug :get url opts)
-  (http/get url (merge http-options opts)))
+  (http/get (url-prefix-protocol url) (merge http-options opts)))

 (defn- POST [url & [opts]]
   (debug :post url opts)
-  (http/post url (merge http-options opts)))
+  (http/post (url-prefix-protocol url) (merge http-options opts)))

 (defn- overview-ids [dom]
   (html/select-all [:.itemtitle :> :a] #(html/attr :href %) dom))


Make router work with 0.6.0 of reagent  (and be backwards compatible)

--- src/re_frame/router.cljs
+++ src/re_frame/router.cljs
@@ -1,5 +1,6 @@
 (ns re-frame.router
-  (:require [reagent.impl.batching :refer [do-later]]
+  (:require [reagent.impl.batching]
+            [reagent.core]
             [re-frame.handlers :refer [handle]]
             [re-frame.utils :refer [error]]
             [goog.async.nextTick]))
@@ -59,7 +60,9 @@

 ;; A map from event metadata keys to the corresponding "run later" functions
 (def later-fns
-  {:flush-dom do-later              ;; after next annimation frame
+  {:flush-dom (if (exists? reagent.core/after-render)              ;; after next annimation frame
+                (.-after-render reagent.core)                      ;; reagent >= 0.6.0
+                (.-do-later reagent.impl.batching))                ;; reagent < 0.6.0
    :yield     goog.async.nextTick}) ;; almost immediately

 (defprotocol IEventQueue


Added Merger

Added Merger

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -317,6 +317,9 @@
     :advancement-cost-bonus (req (- (count (filter #(= (:title %) "Medical Breakthrough")
                                                    (concat (:scored corp) (:scored runner))))))}

+   "Merger"
+   {:agendapoints-runner (req (do 3))}
+
    "NAPD Contract"
    {:steal-cost-bonus (req [:credit 4])
     :advancement-cost-bonus (req (:bad-publicity corp))}


fixed bug

fixed bug

--- src/cljs/tic_tac_toe/core.cljs
+++ src/cljs/tic_tac_toe/core.cljs
@@ -59,8 +59,7 @@
   (init-state [_]
     {:info (chan)
      :req-chan     (chan)
-     :pub-chan     (chan)
-     :notif-chan   (pub pub-chan :topic)})
+     :pub-chan     (chan)})

   (will-mount [_]
       (let [info (om/get-state owner :info)]


Fix chained tasks

Fix chained tasks

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -102,12 +102,13 @@
     (reset! forms [])
     (reset! profiles [])
     (func project-map)
-    (->> (str "["
-              (leiningen.trampoline/trampoline-command-string
-                project-map @forms @profiles)
-              "]")
-         clojure.edn/read-string
-         (start-process process path))))
+    (doseq [i (range (count @forms))]
+      (->> (str "["
+                (leiningen.trampoline/trampoline-command-string
+                  project-map [(nth @forms i)] [(nth @profiles i)])
+                "]")
+           clojure.edn/read-string
+           (start-process process path)))))

 (defn stop-process
   [process]


can compile and run (fib 10)

can compile and run (fib 10)

--- src/clojure_metal/analyzer.clj
+++ src/clojure_metal/analyzer.clj
@@ -374,6 +374,14 @@
                                                                 next
                                                                 (cons retval))))

+             [:INTRINSIC 'clojure.metal.native/-] (let [retval (math- (first stack)
+                                                                      (second stack))]
+                                                    (recur (inc ip)
+                                                           (->> stack
+                                                                next
+                                                                next
+                                                                (cons retval))))
+
              [:JMP-IF-FALSE a] (if (identical? WFalse (first stack))
                                   (recur (+ ip a)
                                          (next stack))
@@ -391,7 +399,7 @@
 (-> (analyze '(do
                 (defn + [x y]
                   (clojure.metal.native/+ x y))
-                #_(defn - [x y]
+                (defn - [x y]
                   (clojure.metal.native/- x y))
                 (defn < [x y]
                   (clojure.metal.native/< x y))
@@ -399,13 +407,13 @@
                   (if (< x max)
                     (count-up (+ x 1) max)
                     x))
-                (count-up 0 1000000)
-                #_(defn fib [max]
+                (defn fib [max]
                   (if (< max 2)
                     max
                     (+ (fib (- max 1))
                        (fib (- max 2)))))
-                #_(fib 10)))
+                (defn -main []
+                  (fib 10))))
     debug
     compile-ast
     debug


[#1142] Add custom label support for aggregated geoshapes

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -64,26 +64,29 @@
           (get layer "shapeLabelColumn"))))
 )

-(defn shape-aggregation-cartocss [layer-index]
-  (format "#s {
+(defn shape-aggregation-cartocss [layer-index layer]
+  (cond-> (format "#s {
               polygon-opacity: 0.8;
               polygon-fill: [shapefill];
               line-width: 0.5;
               line-color: rgba(0,0,0,0.3);
            }
-           #s::labels {
-            text-name: [_aggregation];
+           "
+          (layer-point-color layer-index))
+          (get layer "shapeLabelColumn")
+          (str (format "#s::labels {
+            text-name: [%s];
             text-face-name: 'DejaVu Sans Book';
             text-size: 10;
             text-fill: #000;
-           }
-           "
-          (layer-point-color layer-index)))
+          }"
+          (get layer "shapeLabelColumn"))))
+)

 (defn cartocss [layer layer-index metadata-array]
   (cond
     (and (get layer "aggregationDataset")(get layer "aggregationColumn")(get layer "aggregationGeomColumn"))
-    (shape-aggregation-cartocss layer-index)
+    (shape-aggregation-cartocss layer-index layer)

     (= (get layer "layerType") "geo-shape")
     (shape-cartocss layer-index layer)
@@ -113,11 +116,27 @@
   )
 )

-(defn shape-aggregagation-popup-sql [popup table-name prefix postfix]
+(defn shape-aggregagation-extra-cols-sql [popup table-name prefix postfix]
   (if
     (= (count popup) 0)
     ""
     (str prefix (clojure.string/join "," (map (fn [popupObj] (str table-name "." (get popupObj "column"))) popup)) postfix)
+  )
+)
+
+(defn popup-and-label-cols [popup-cols label-col]
+  (cond
+    (and (boolean popup-cols) (boolean label-col))
+    (conj popup-cols {"column" label-col})
+
+    (boolean popup-cols)
+    popup-cols
+
+    (boolean label-col)
+    [{"column" label-col}]
+
+    :else
+    []
   )
 )

@@ -141,6 +160,7 @@
                                      c)) popup-columns) geom-column)
                 point-color-column (conj point-color-column)))
     hue (color-to-hue (clojure.string/upper-case (get current-layer "gradientColor" "#FF0000")))
+    extra-cols (popup-and-label-cols (get current-layer "popup") (get current-layer "shapeLabelColumn"))
     ]

     (format "with temp_table as
@@ -174,7 +194,7 @@
               temp_table;
             "

-            (shape-aggregagation-popup-sql (get current-layer "popup") shape-table-name "" ",")
+            (shape-aggregagation-extra-cols-sql extra-cols shape-table-name "" ",")
             shape-table-name
             (get current-layer "geom")
             aggregation-method
@@ -186,8 +206,8 @@
             (get current-layer "aggregationGeomColumn")
             shape-table-name
             (get current-layer "geom")
-            (shape-aggregagation-popup-sql (get current-layer "popup") shape-table-name "," "")
-            (shape-aggregagation-popup-sql (get current-layer "popup") "temp_table" "" ",")
+            (shape-aggregagation-extra-cols-sql extra-cols shape-table-name "," "")
+            (shape-aggregagation-extra-cols-sql extra-cols "temp_table" "" ",")
             (get current-layer "geom")
             hue
             )))


Fix infer-externs compiler warning

Fix infer-externs compiler warning

Fixes #38

--- src/day8/re_frame/http_fx.cljs
+++ src/day8/re_frame/http_fx.cljs
@@ -3,7 +3,8 @@
     [goog.net.ErrorCode :as errors]
     [re-frame.core :refer [reg-fx dispatch console]]
     [ajax.core :as ajax]
-    #_[cljs.spec :as s]))
+    #_[cljs.spec :as s])
+  (:import (goog.net XhrIo)))

 ;; I provide the :http-xhrio effect handler leveraging cljs-ajax lib
 ;; see API docs https://github.com/JulianBirch/cljs-ajax
@@ -42,7 +43,7 @@
     :or   {on-success      [:http-no-on-success]
            on-failure      [:http-no-on-failure]}}]
   ; wrap events in cljs-ajax callback
-  (let [api (new js/goog.net.XhrIo)]
+  (let [api (new goog.net.XhrIo)]
     (-> request
         (assoc
           :api     api


Fix logging_enabled param initial loading on Linux

Signed-off-by: Vitaliy Vlasov <e49d0217baed7632d034fb41cd352d74cf7c0ec8@gmail.com>

--- src/status_im/init/core.cljs
+++ src/status_im/init/core.cljs
@@ -46,7 +46,9 @@
 (defn restore-native-settings! []
   (when platform/desktop?
     (.getValue rn-dependencies/desktop-config "logging_enabled"
-               #(re-frame/dispatch [:set-in [:desktop/desktop :logging-enabled] %1]))))
+               #(re-frame/dispatch [:set-in [:desktop/desktop :logging-enabled]
+                                    (if (boolean? %1)
+                                      %1 (cljs.reader/read-string %1))]))))

 ;; TODO (yenda) move keychain functions to dedicated namespace
 (defn reset-keychain! []


Mera sporter

Mera sporter

--- src/skidskytte/namer.clj
+++ src/skidskytte/namer.clj
@@ -1,6 +1,7 @@
 (ns skidskytte.namer)

 (def nationalities [
+                    "amerikansk"
                     "baltisk"
                     "brittisk"
                     "dansk"
@@ -27,15 +28,15 @@
                "bridge"
                "brottnings"
                "brännboll"
+               "bänkpress"
                "bågskytte"
-               "bänkpress"
                "curling"
                "cykel"
                "dart"
+               "diskus"
+               "dragkamps"
                "dubbel"
                "dyknings"
-               "diskus"
-               "dragkamps"
                "enduro"
                "fallskärmshopps"
                "forspaddlings"
@@ -49,15 +50,17 @@
                "häcklöpnings"
                "häst"
                "höjdhopps"
+               "inlines"
+               "innebandy"
                "isjakts"
-               "innebandy"
                "judo"
+               "kanot"
                "karate"
                "kendo"
-               "kanot"
                "klättrings"
                "konstsims"
                "konståknings"
+               "krocket"
                "lacrosse"
                "landhockey"
                "längdhopps"
@@ -75,28 +78,32 @@
                "simhopps"
                "simnings"
                "skateboard"
+               "skid"
+               "skoter"
+               "skridsko"
                "skytte"
                "slalom"
+               "slungbolls"
+               "slägg"
+               "snowboard"
+               "speedway"
+               "spjut"
+               "sprint"
+               "stavhopps"
+               "studsmatte"
                "styrkelyfts"
                "störtlopps"
-               "snowboard"
                "sumobrottning"
+               "taekwando"
                "telemarks"
                "tennis"
                "tjurfäktnings"
+               "trampolin"
+               "trestegs"
                "tyngdlyftnings"
-               "trampolin"
-               "slungbolls"
-               "slägg"
-               "skid"
-               "skridsko"
-               "speedway"
-               "spjut"
-               "sprint"
-               "taekwando"
-               "trestegs"
                "undervattens"
                "vatten"
+               "vattenskids"
                "volleyboll"
                "windsurfings"
                ])
@@ -117,15 +124,15 @@
                "bridge"
                "brottning"
                "brännboll"
+               "bänkpress"
                "bågskytte"
-               "bänkpress"
                "casting"
                "curling"
                "cykel"
                "dart"
-               "dykning"
                "diskus"
                "dragkamp"
+               "dykning"
                "enduro"
                "fallskärmshopp"
                "forspaddling"
@@ -140,12 +147,13 @@
                "höjdhopp"
                "innebandy"
                "judo"
+               "kanot"
                "karate"
                "kendo"
-               "kanot"
                "klättring"
                "konstsim"
                "konståkning"
+               "krocket"
                "lacrosse"
                "landhockey"
                "lerduveskytte"
@@ -156,35 +164,38 @@
                "polo"
                "rally"
                "rodd"
+               "rodel"
                "rodeo"
-               "rodel"
                "rugby"
                "segling"
                "simhopp"
                "simning"
                "skateboard"
+               "skoter"
+               "skidor"
+               "skridsko"
                "skytte"
                "slalom"
+               "slungboll"
+               "slägga"
+               "snooker"
+               "snowboard"
+               "speedway"
+               "spjut"
                "stafett"
+               "stavhopp"
                "styrkelyft"
                "störtlopp"
-               "snowboard"
-               "snooker"
                "sumobrottning"
+               "taekwando"
                "tennis"
                "tjurfäktning"
+               "tresteg"
                "tyngdlyftning"
-               "slungboll"
-               "slägga"
-               "skidor"
-               "skridsko"
-               "speedway"
-               "spjut"
-               "taekwando"
-               "tresteg"
+               "varpa"
+               "vattenskidor"
                "volleyboll"
                "windsurfing"
-               "varpa"
                ])


Code to read configuration

Code to read configuration

--- src/emender_service/config.clj
+++ src/emender_service/config.clj
@@ -26,11 +26,25 @@
     [string]
     (java.lang.Float/parseFloat string))

+(defn parse-boolean
+    "Parse the given string as a boolean value."
+    [string]
+    (or (= string "true")
+        (= string "True")))
+
+(defn update-configuration
+    "Update selected items in the configuration structure."
+    [configuration]
+    (-> configuration
+        (update-in [:jenkins :port] parse-int)
+        (update-in [:result-cache :pretty-print] parse-boolean)
+        (update-in [:config :verbose] parse-boolean)))
+
 (defn load-configuration
     "Load configuration from the provided INI file."
     [ini-file-name]
     (-> (clojure-ini/read-ini ini-file-name :keywordize? true)
-    ))
+        update-configuration))

 (defn print-configuration
     "Print actual configuration to the output."


Duration protocol

Duration protocol

--- src/tick/core.clj
+++ src/tick/core.clj
@@ -10,27 +10,6 @@
    [java.time Clock ZoneId ZoneOffset Instant Duration DayOfWeek Month ZonedDateTime LocalTime LocalDateTime LocalDate Year YearMonth ZoneId OffsetDateTime]
    [java.time.format DateTimeFormatter]
    [java.time.temporal ChronoUnit]))
-
-(defn nanos [n]
-  (Duration/ofNanos n))
-
-(defn millis [n]
-  (Duration/ofMillis n))
-
-(defn seconds [n]
-  (Duration/ofSeconds n))
-
-(defn minutes [n]
-  (Duration/ofMinutes n))
-
-(defn hours [n]
-  (Duration/ofHours n))
-
-(defn days [n]
-  (Duration/ofDays n))
-
-(defn weeks [n]
-  (Duration/ofDays (* 7 n)))

 (def ^{:dynamic true} *clock* nil)

@@ -205,6 +184,41 @@
   (date [zdt] (.toLocalDate zdt))
   (zone [zdt] (.getZone zdt)))

+(defprotocol IDuration
+  (nanos [_] "Return the given quantity in nanoseconds.")
+  (millis [_] "Return the given quantity in milliseconds.")
+  (seconds [_] "Return the given quantity in seconds.")
+  (minutes [_] "Return the given quantity in minutes.")
+  (hours [_] "Return the given quantity in hours.")
+  (days [_] "Return the given quantity in days.")
+  (weeks [_] "Return the given quantity in weeks.")
+  (months [_] "Return the given quantity in approximate months.")
+  (years [_] "Return the given quantity in approximate years."))
+
+(extend-protocol IDuration
+  Number
+  (nanos [n] (Duration/ofNanos n))
+  (millis [n] (Duration/ofMillis n))
+  (seconds [n] (Duration/ofSeconds n))
+  (minutes [n] (Duration/ofMinutes n))
+  (hours [n] (Duration/ofHours n))
+  (days [n] (Duration/ofDays n))
+  (weeks [n] (Duration/ofDays (/ n 7)))
+  (months [n] (Duration/ofDays (* (years n) 12)))
+  (years [n] (Duration/ofDays (/ n 365.25)))
+
+  Duration
+  (nanos [d] (.toNanos d))
+  (millis [d] (.toMillis d))
+  (seconds [d] (.getSeconds d))
+  (minutes [d] (.toMinutes d))
+  (hours [d] (.toHours d))
+  (days [d] (.toDays d))
+  (weeks [d] (/ (days d) 7))
+  (months [d] (* (years d) 12))
+  (years [d] (/ (days d) 365.24))
+  )
+
 (defprotocol ITimeArithmetic
   (+ [_ _] "Add time")
   (- [_ _] "Subtract time")


Format code

Format code

--- src/spec_tools/core.cljc
+++ src/spec_tools/core.cljc
@@ -47,11 +47,11 @@
   [spec]
   (pr-str (s/form spec)))

-(defn ^:skip-wiki  deserialize
+(defn ^:skip-wiki deserialize
   "Reads specs from a string.
   TODO: Should optionally read the realated Registry entries."
   [s]
-  #?(:clj (clojure.edn/read-string s)
+  #?(:clj  (clojure.edn/read-string s)
      :cljs (cljs.reader/read-string s)))

 (def invalid '::s/invalid)


Added Docker pid-extraction from state.

Added Docker pid-extraction from state.


test with server/wrap-protect-origins enabled

--- src/main/cawala/server_components/middleware.clj
+++ src/main/cawala/server_components/middleware.clj
@@ -100,7 +100,7 @@
       (wrap-api "/api")
       server/wrap-transit-params
       server/wrap-transit-response
-      #_(server/wrap-protect-origins {:allow-when-origin-missing? false
+      (server/wrap-protect-origins {:allow-when-origin-missing? false
                                     :legal-origins              legal-origins})
       (wrap-html-routes)
       ;; If you want to set something like session store, you'd do it against


minor formatting update

minor formatting update

--- src/thi/ng/luxor/presets.clj
+++ src/thi/ng/luxor/presets.clj
@@ -10,52 +10,52 @@
 ;; See lux/core/cameraresponse.cpp or luxrender/properties/camera.py
 ;; to keep this up to date...
 (def ^:const film-response-presets
-  {:advantix-100cd "Advantix_100CD",
-   :advantix-200cd "Advantix_200CD",
-   :advantix-400cd "Advantix_400CD",
-   :agfachrome-ctpecisa-200cd "Agfachrome_ctpecisa_200CD",
-   :agfachrome-ctprecisa-100cd "Agfachrome_ctprecisa_100CD",
-   :agfachrome-rsx2-050cd "Agfachrome_rsx2_050CD",
-   :agfachrome-rsx2-100cd "Agfachrome_rsx2_100CD",
-   :agfachrome-rsx2-200cd "Agfachrome_rsx2_200CD",
-   :agfacolor-futura-100cd "Agfacolor_futura_100CD",
-   :agfacolor-futura-200cd "Agfacolor_futura_200CD",
-   :agfacolor-futura-400cd "Agfacolor_futura_400CD",
-   :agfacolor-futura2-100cd "Agfacolor_futuraII_100CD",
-   :agfacolor-futura2-200cd "Agfacolor_futuraII_200CD",
-   :agfacolor-futura2-400cd "Agfacolor_futuraII_400CD",
-   :agfacolor-hdc-100-pluscd "Agfacolor_hdc_100_plusCD",
-   :agfacolor-hdc-200-pluscd "Agfacolor_hdc_200_plusCD",
-   :agfacolor-hdc-400-pluscd "Agfacolor_hdc_400_plusCD",
-   :agfacolor-optima2-100cd "Agfacolor_optimaII_100CD",
-   :agfacolor-optima2-200cd "Agfacolor_optimaII_200CD",
-   :agfacolor-ultra-050-cd "Agfacolor_ultra_050_CD",
-   :agfacolor-vista-100cd "Agfacolor_vista_100CD",
-   :agfacolor-vista-200cd "Agfacolor_vista_200CD",
-   :agfacolor-vista-400cd "Agfacolor_vista_400CD",
-   :agfacolor-vista-800cd "Agfacolor_vista_800CD",
-   :ektachrome-100-pluscd "Ektachrome_100_plusCD",
-   :ektachrome-100cd "Ektachrome_100CD",
-   :ektachrome-320tcd "Ektachrome_320TCD",
-   :ektachrome-400xcd "Ektachrome_400XCD",
-   :ektachrome-64cd "Ektachrome_64CD",
-   :ektachrome-64tcd "Ektachrome_64TCD",
-   :ektachrome-e100scd "Ektachrome_E100SCD",
-   :f125cd "F125CD",
-   :f250cd "F250CD",
-   :f400cd "F400CD",
-   :fcicd "FCICD",
-   :gold-100cd "Gold_100CD",
-   :gold-200cd "Gold_200CD",
-   :kodachrome-200cd "Kodachrome_200CD",
-   :kodachrome-25cd "Kodachrome_25CD",
-   :kodachrome-64cd "Kodachrome_64CD",
-   :max-zoom-800cd "Max_Zoom_800CD",
-   :portra-100tcd "Portra_100TCD",
-   :portra-160nccd "Portra_160NCCD",
-   :portra-160vccd "Portra_160VCCD",
-   :portra-400nccd "Portra_400NCCD",
-   :portra-400vccd "Portra_400VCCD",
+  {:advantix-100cd "Advantix_100CD"
+   :advantix-200cd "Advantix_200CD"
+   :advantix-400cd "Advantix_400CD"
+   :agfachrome-ctpecisa-200cd "Agfachrome_ctpecisa_200CD"
+   :agfachrome-ctprecisa-100cd "Agfachrome_ctprecisa_100CD"
+   :agfachrome-rsx2-050cd "Agfachrome_rsx2_050CD"
+   :agfachrome-rsx2-100cd "Agfachrome_rsx2_100CD"
+   :agfachrome-rsx2-200cd "Agfachrome_rsx2_200CD"
+   :agfacolor-futura-100cd "Agfacolor_futura_100CD"
+   :agfacolor-futura-200cd "Agfacolor_futura_200CD"
+   :agfacolor-futura-400cd "Agfacolor_futura_400CD"
+   :agfacolor-futura2-100cd "Agfacolor_futuraII_100CD"
+   :agfacolor-futura2-200cd "Agfacolor_futuraII_200CD"
+   :agfacolor-futura2-400cd "Agfacolor_futuraII_400CD"
+   :agfacolor-hdc-100-pluscd "Agfacolor_hdc_100_plusCD"
+   :agfacolor-hdc-200-pluscd "Agfacolor_hdc_200_plusCD"
+   :agfacolor-hdc-400-pluscd "Agfacolor_hdc_400_plusCD"
+   :agfacolor-optima2-100cd "Agfacolor_optimaII_100CD"
+   :agfacolor-optima2-200cd "Agfacolor_optimaII_200CD"
+   :agfacolor-ultra-050-cd "Agfacolor_ultra_050_CD"
+   :agfacolor-vista-100cd "Agfacolor_vista_100CD"
+   :agfacolor-vista-200cd "Agfacolor_vista_200CD"
+   :agfacolor-vista-400cd "Agfacolor_vista_400CD"
+   :agfacolor-vista-800cd "Agfacolor_vista_800CD"
+   :ektachrome-100-pluscd "Ektachrome_100_plusCD"
+   :ektachrome-100cd "Ektachrome_100CD"
+   :ektachrome-320tcd "Ektachrome_320TCD"
+   :ektachrome-400xcd "Ektachrome_400XCD"
+   :ektachrome-64cd "Ektachrome_64CD"
+   :ektachrome-64tcd "Ektachrome_64TCD"
+   :ektachrome-e100scd "Ektachrome_E100SCD"
+   :f125cd "F125CD"
+   :f250cd "F250CD"
+   :f400cd "F400CD"
+   :fcicd "FCICD"
+   :gold-100cd "Gold_100CD"
+   :gold-200cd "Gold_200CD"
+   :kodachrome-200cd "Kodachrome_200CD"
+   :kodachrome-25cd "Kodachrome_25CD"
+   :kodachrome-64cd "Kodachrome_64CD"
+   :max-zoom-800cd "Max_Zoom_800CD"
+   :portra-100tcd "Portra_100TCD"
+   :portra-160nccd "Portra_160NCCD"
+   :portra-160vccd "Portra_160VCCD"
+   :portra-400nccd "Portra_400NCCD"
+   :portra-400vccd "Portra_400VCCD"
    :portra-800cd "Portra_800CD"})

 (def ^:const ior-categories


Nix unnecessary endparen in docstring

Nix unnecessary endparen in docstring

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

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


Update docstring

Update docstring

--- src/uruk/core.clj
+++ src/uruk/core.clj
@@ -349,7 +349,6 @@
            (seq content-base)) (.newSession cs user password content-base))))

 (defn create-session
-  ;; TODO document content-source parameter
   "Create a Session for querying and transacting with. Parameter
   `db-info` describing database connection information must
   include :uri key, and may optionally include connection information
@@ -367,7 +366,8 @@
   session.)

   If optional `content-source` is passed, the Session is created from
-  the given ContentSource rather than creating one from the database info URI."
+  the given ContentSource rather than creating one from the database
+  info URI."
   ([db-info]
    (create-session* db-info))
   ([db-info {:keys [default-request-options logger user-object


fixed typo

fixed typo

--- src/ueberfoo/commandline.clj
+++ src/ueberfoo/commandline.clj
@@ -189,7 +189,7 @@
       (cond
        (zero? n-del) (println " entries deleted.")
        (= 1 n-del)   (println " entry deleted:")
-       :else         (println " entires deleted:"))
+       :else         (println " entries deleted:"))
       (doseq [x (:selected in)] (println ((:formatter in) x))))))

 ;;; invocation


Add master branch

Add master branch

--- src-cljs/cljs_workspace/om_history.cljs
+++ src-cljs/cljs_workspace/om_history.cljs
@@ -4,7 +4,7 @@
             [cljs-workspace.morph
               :as morphic
               :refer [set-position set-fill set-extent add-morph remove-morph]]
-            [cljs-workspace.branch-vis :refer [render-tree]]))
+            [cljs-workspace.branch-vis :refer [render-tree is-master]]))

 (enable-console-print!)

@@ -31,10 +31,10 @@
   @branch-count)

 ;; global atom referencing the branch that we currently operate on
-(def current-branch (atom {:id (generate-uuid) :data (atom [])}))
+(def current-branch (atom {:id "Master" :data (atom [])}))

 ;; global atom referencing the total history graph
-(def app-history (atom {:id 1 :root @current-branch :data (@current-branch :data)}))
+(def app-history (atom {:id "Master" :data (@current-branch :data)}))

 ;; ffd
 (def history-view)
@@ -179,18 +179,25 @@
       (swap! branch conj s))
     (swap! branch conj s)))

-(defn save-state [n]
+(defn save-to-master [n]
+  (let [master-branch app-history]
+    (save-state n master-branch)))
+
+(defn save-state
+  ([n]
+    (save-state n current-branch))
+  ([n branch]
     (cond (> 100 @reverted-to -1 )
       ; we have to branch because a modification based on a reverted state:
       (branch-at @reverted-to n)
       ; else just append to history
       :else
-      (let [b @(@current-branch :data)]
+      (let [b @(@branch :data)]
         (when-not (= (last b) n)
-          (append-to-branch (@current-branch :data) n))
+          (append-to-branch (@branch :data) n))
         (let [c (len b)]
-            (render-tree @app-history @current-branch (fn [branch] (switch-to-branch branch)) (* c (/ index 100)))
-            (prn (str c " Saved " (pluralize c "State")))))))
+            (render-tree @app-history @branch (fn [b] (switch-to-branch b)) (* c (/ index 100)))
+            (prn (str c " Saved " (pluralize c "State"))))))))

 (om/root
   (fn [app owner]


Change My/All Builds utils tooltip to popover tooltip (#1759)

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -3,6 +3,7 @@
             [frontend.async :refer [raise!]]
             [frontend.components.common :as common]
             [frontend.components.pieces.icon :as icon]
+            [frontend.components.pieces.popover :as popover]
             [frontend.components.pieces.status :as status]
             [frontend.config :as config]
             [frontend.datetime :as datetime]
@@ -271,45 +272,49 @@
           [:div.aside-user-options
            (expand-menu-items items subpage)]])))))

+(defn toggle-all-builds [owner show-all-builds? disable-toggle?]
+  [:header.toggle-all-builds
+   [:label {:class (if disable-toggle?
+                     "disabled tooltip-anchor"
+                     (if show-all-builds? "" "checked"))}
+    "My builds"
+    [:input {:name "toggle-all-builds"
+             :type "radio"
+             :value "false"
+             :checked (not show-all-builds?)
+             :react-key "toggle-all-builds-my-builds"
+             :disabled disable-toggle?
+             :on-change #(raise! owner [:show-all-builds-toggled false])}]]
+   [:label {:class (if disable-toggle?
+                     "disabled"
+                     (if show-all-builds? "checked" ""))}
+    "All builds"
+    [:input {:name "toggle-all-builds"
+             :type "radio"
+             :value "true"
+             :checked show-all-builds?
+             :react-key "toggle-all-builds-all-builds"
+             :disabled disable-toggle?
+             :on-change #(raise! owner [:show-all-builds-toggled true])}]]])
+
 (defn builds-table-filter [{:keys [data on-branch?]} owner]
   ;; Create an additional filter for the builds-table to feed into
   ; Currently just duplicating the my branches / all fiels
   (reify
-    om/IDidMount
-    (did-mount [_]
-      (utils/tooltip ".toggle-all-builds"))
     om/IRender
     (render [_]
       (let [show-all-builds? (get-in data state/show-all-builds-path)
-            disable-toggle? on-branch?]
+            disable-toggle? on-branch?
+            toggle-all-builds (toggle-all-builds owner show-all-builds? disable-toggle?)]
         (html
           [:div.dashboard-top-menu
-           [:header.toggle-all-builds
-            (when disable-toggle?
-              {:data-original-title "My / All builds sort is not available on branches."
-               :data-placement "left"})
-            [:label {:class (if disable-toggle?
-                              "disabled tooltip-anchor"
-                              (if show-all-builds? "" "checked"))}
-             "My builds"
-             [:input {:name "toggle-all-builds"
-                      :type "radio"
-                      :value "false"
-                      :checked (not show-all-builds?)
-                      :react-key "toggle-all-builds-my-builds"
-                      :disabled disable-toggle?
-                      :on-change #(raise! owner [:show-all-builds-toggled false])}]]
-            [:label {:class (if disable-toggle?
-                              "disabled"
-                              (if show-all-builds? "checked" ""))}
-             "All builds"
-             [:input {:name "toggle-all-builds"
-                      :type "radio"
-                      :value "true"
-                      :checked show-all-builds?
-                      :react-key "toggle-all-builds-all-builds"
-                      :disabled disable-toggle?
-                      :on-change #(raise! owner [:show-all-builds-toggled true])}]]]])))))
+           (if disable-toggle?
+             (popover/popover {:title nil
+                               :body [:span "My / All builds sort is not available on branches."]
+                               :placement :left
+                               :trigger-mode :hover}
+               toggle-all-builds)
+             toggle-all-builds)])))))

 (defn collapse-group-id [project]
   "Computes a hash of the project id.  Includes the :current-branch if


update to new cider

update to new cider

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -2,7 +2,8 @@
  {:repl-options {:init (set! *print-length* 100)}
   :plugins
   [
-   [cider/cider-nrepl "0.9.1"]
+   [refactor-nrepl "2.0.0-SNAPSHOT"]
+   [cider/cider-nrepl "0.10.0-SNAPSHOT"]
    [lein-midje "3.1.3"]
    [lein-try "0.4.1"]
    [lein-marginalia "0.7.1"]
@@ -10,9 +11,9 @@
    [lein-ancient "0.5.4"]
    [jonase/eastwood "0.0.2"]
    [lein-auto "0.1.1"]
-   [refactor-nrepl "1.1.0"]
    ]
   :dependencies
   [[alembic "0.3.2"]
    [criterium "0.4.3"]
-   [org.clojure/tools.nrepl "0.2.10"]]}}
+   [org.clojure/tools.nrepl "0.2.11"]
+   ]}}


Changed the folder options format

Changed the folder options format

--- src/video_server/process.clj
+++ src/video_server/process.clj
@@ -119,6 +119,6 @@
             (try (when fetch?
                    (fetch-info folder key video))
                  (when encode?
-                   (process-video folder video fmt size (:encode (:options folder))))
+                   (process-video folder video fmt size (-> folder :options :encoder :containers)))
                  (catch Exception e (log/error e "error processing video" (str video)))))))))


Handle nil as a uniqueness-key by no longer nil punning

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -372,6 +372,7 @@
                   onyx.core/triggers onyx.core/windows onyx.core/task-map onyx.core/window-state
                   onyx.core/state-log onyx.core/results]} event
           grouping-fn (:grouping-fn compiled)
+          uniqueness-check? (contains? task-map :onyx/uniqueness-key)
           id-key (:onyx/uniqueness-key task-map)]
       (doall
         (map
@@ -387,9 +388,8 @@
               (run!
                 (fn [message]
                   (let [segment (:message message)
-                        unique-id (if id-key (get segment id-key))
-                        seen? (and unique-id (state-extensions/filter? (:filter @window-state) event unique-id))]
-                    (when-not seen?
+                        unique-id (if uniqueness-check? (get segment id-key))]
+                    (when-not (and uniqueness-check? (state-extensions/filter? (:filter @window-state) event unique-id))
                       (inc-count! fused-ack)
                       (let [[new-window-state full-log-entry]
                             (reduce (fn [[window-state log-entries] window]
@@ -406,7 +406,7 @@
                       (doseq [t triggers]
                         (triggers/fire-trigger! event window-state t {:segment segment :context :new-segment})))
                     ;; Always update the filter, to freshen up the fact that the id has been re-seen
-                    (when unique-id
+                    (when uniqueness-check?
                       (swap! window-state update :filter state-extensions/apply-filter-id event unique-id))))
                 (:leaves leaf))))
           (:tree results)


Need to require segment filter implementations

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -24,6 +24,7 @@
               [onyx.interop]
               [onyx.state.log.atom]
               [onyx.state.log.bookkeeper]
+              [onyx.state.filter.set]
               [onyx.state.core :as state]
               [onyx.state.state-extensions :as state-extensions]
               [onyx.static.default-vals :refer [defaults arg-or-default]]))


Grab the useful containers

Grab the useful containers

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -5,6 +5,9 @@
   (:use-macros [crate.macros :only [defpartial]]))

 (defpartial wish-li [desc url]
+(def $create ($ "#create-wishlist"))
+(def $content ($ "#box"))
+(def $header ($ "#title-box"))
   [:li.wish
    [:div.delete]
    [:input {:type "text" :class "description" :value desc}]


use the proper transaction url

use the proper transaction url

--- src/pc/admin/migrate_storage.clj
+++ src/pc/admin/migrate_storage.clj
@@ -107,7 +107,7 @@
 (defonce queue-consumer-interrupt (atom nil))
 (defonce popped-transactions (atom []))

-(def transaction-url (str "http://localhost:8067" random-uri))
+(def transaction-url (str "http://104.156.231.173:8067" random-uri))
 (defn fetch-transaction []
   (-> (http/get transaction-url)
     :body


Remove bidi extension

Remove bidi extension

I feel now that maps should instead be converted to resources
ahead-of-time, rather than just-in-time.

--- src/yada/yada.clj
+++ src/yada/yada.clj
@@ -34,10 +34,4 @@
 (defn language [ctx]
   (get-in ctx [:response :produces :language]))

-(extend-protocol bidi/Matched
-  clojure.lang.APersistentMap
-  (resolve-handler [this m]
-    (when (= (:remainder m) "")
-      (merge (dissoc m :remainder) {:handler (handler (resource this))})))
-  (unresolve-handler [this m]
-    (when (= this (:handler m)) "")))
+


can't walk through walls

can't walk through walls

--- clojure/src/dnd/character.cljs
+++ clojure/src/dnd/character.cljs
@@ -1,22 +1,24 @@
 (ns dnd.character)

 (defonce base-character {:char "@"
-                    :x 3
-                    :y 2
-                    :inventory []})
+                         :x 3
+                         :y 2
+                         :inventory []})

 (defn is-character [inhabitant] (= "@" (:char inhabitant)))

 (defn move-character! [level character dx dy]
-  (let [{ox :x oy :y} @character
-        {old-inhabitants :inhabitants} (get-in @level [ox oy])
-        remove-character #(assoc % :inhabitants (remove is-character old-inhabitants))
-        level-without-character (swap! level update-in [ox oy] remove-character)
-        target-block (get-in level-without-character [dx dy])
-        target-inhabitants (:inhabitants target-block)
-        updated-character (swap! character assoc :x dx :y dy)
-        update-habs #(assoc % :inhabitants (conj target-inhabitants updated-character))
-        updated-level (swap! level update-in [dx dy] update-habs)]
+  (let [target-block (get-in @level [dx dy])]
+    (if-let [target-block (not (:solid target-block))]
+      (let [{ox :x oy :y} @character
+            {old-inhabitants :inhabitants} (get-in @level [ox oy])
+            remove-character #(assoc % :inhabitants (remove is-character old-inhabitants))
+            level-without-character (swap! level update-in [ox oy] remove-character)
+            target-inhabitants (:inhabitants target-block)
+            updated-character (swap! character assoc :x dx :y dy)
+            update-habs #(assoc % :inhabitants (conj target-inhabitants updated-character))
+            updated-level (swap! level update-in [dx dy] update-habs)])
+      "can't walk there")
     [level character]))


Add some whitespace to run-listener definition

--- src/radicalzephyr/boot_junit.clj
+++ src/radicalzephyr/boot_junit.clj
@@ -51,12 +51,15 @@
       []
     (testRunStarted [description]
       (println "Test started!"))
+
     (testRunFinished [result]
       (println "\nTest run finished!")
       (when (> (.getFailureCount result) 0)
         (println (result->map result))))
+
     (testStarted [description]
       (print "."))
+
     (testFailure [failure]
       (print "E"))))


Throw an error on test failure

Throw an error on test failure

This seems to be the convention used by other testing tasks, and I think
the speak and notify tasks will generate better messages if we throw.

--- src/radicalzephyr/boot_junit.clj
+++ src/radicalzephyr/boot_junit.clj
@@ -70,9 +70,11 @@
   (core/with-pre-wrap fileset
     (if (seq packages)
       (let [^JUnitCore core (doto (JUnitCore.)
-                              (.addListener (run-listener packages)))]
-        (.run core
-              (into-array Class
-                          (find-all-tests packages))))
+                              (.addListener (run-listener packages)))
+            result (.run core
+                         (into-array Class
+                                     (find-all-tests packages)))]
+        (when (> (.getFailureCount result) 0)
+          (throw (ex-info "Some tests failed or errored" {}))))
       (println "No packages were tested."))
     fileset))


Use proper outer-rect calculation for path.

The same as prev comit. Don't treat path as rect.

--- src/uxbox/main/geom.cljs
+++ src/uxbox/main/geom.cljs
@@ -446,8 +446,8 @@
                  :text (generic-outer-rect state shape)
                  :icon (generic-outer-rect state shape)
                  :line (generic-outer-rect state shape)
-                 :path (generic-outer-rect state shape)
-                 ;; :path (path-outer-rect state shape)
+                 ;; :path (generic-outer-rect state shape)
+                 :path (path-outer-rect state shape)
                  :circle (circle-outer-rect state shape)
                  :group (group-outer-rect state shape))]
      (if (:group shape)


fix "étudier" -> "étudiiez"

fix "étudier" -> "étudiiez"

--- src/babel/francais/morphology/verbs.clj
+++ src/babel/francais/morphology/verbs.clj
@@ -24,7 +24,7 @@
         er-type (re-find #"[eé]r$" infinitive)
         ir-type (re-find #"ir$" infinitive)
         re-type (re-find #"re$" infinitive)
-        stem (string/replace infinitive #"[iaeé]r$" "")
+        stem (string/replace infinitive #"i?[iaeé]r$" "")
         stem (if re-type
                ;; prendre -> prend
                (string/replace infinitive #"re$" "")


cleanup interactive and add buttonmode

cleanup interactive and add buttonmode

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -12,10 +12,11 @@

 (defn make-sprite
   "construct a sprite by its texture. optionally pass in other things"
-  [texture & {:keys [x y xhandle yhandle scale alpha interactive mousedown
+  [texture & {:keys [x y xhandle yhandle scale alpha
                      rotation tint tiling tiling-width tiling-height visible
                      mousemove mousedown mouseup mouseupoutside
-                     touchmove touchdown touchup touchupoutside]
+                     touchmove touchdown touchup touchupoutside
+                     buttonmode]
               :or {x 0 y 0
                    xhandle 0.5 yhandle 0.5
                    scale 1
@@ -40,8 +41,8 @@
               (make-point (get scale 0) (get scale 1)))))
     (when-not (= 1 alpha)
       (set! (.-alpha s) alpha))
-    (.setInteractive s (or mousemove mousedown mouseup mouseupoutside
-                           touchmove touchdown touchup touchupoutside))
+    (set! (.-interactive s) (or mousemove mousedown mouseup mouseupoutside
+                                touchmove touchdown touchup touchupoutside))

     (when mousedown (set! (.-mousedown s) mousedown))
     (when mousemove (set! (.-mousemove s) mousemove))
@@ -52,6 +53,8 @@
     (when touchmove (set! (.-touchmove s) touchmove))
     (when touchup (set! (.-touchup s) touchup))
     (when touchupoutside (set! (.-touchupoutside s) touchupoutside))
+
+    (when-not (nil? buttonmode) (set! (.-buttonMode s) buttonmode))

     (when tint (set! (.-tint s) tint))
     s))


render layout after initial route loading

--- src/cljs/swarmpit/component/layout.cljs
+++ src/cljs/swarmpit/component/layout.cljs
@@ -66,9 +66,10 @@

 (rum/defc layout < rum/reactive []
   (let [{:keys [handler] :as route} (state/react controller/cursor)]
-    (if (page-layout? handler)
-      (page-layout route)
-      (page-single route))))
+    (when (some? route)
+      (if (page-layout? handler)
+        (page-layout route)
+        (page-single route)))))

 (defn mount!
   []


Story ID: develop
Summary:
- remove CI debugging
- find-element's :key case was not constructing the query selector correctly (missing a closing `]`)

Comments to QA/Testers:
Changelog:

--- src/untangled_spec/dom/util.cljs
+++ src/untangled_spec/dom/util.cljs
@@ -75,9 +75,7 @@
       (re-find #"-text$" keyword-str)
       (let [tagname (str/lower-case (re-find #"^\w+" keyword-str))]
         (gd/findNode element (fn [e] (and (node-contains-text? value e) (= tagname (tag-name e))))))
-      (= keyword :key) (.querySelector element (let [selector (str/join ["[data-reactid$='$" value "']"])]
-                                                 (println :SELECTOR selector)
-                                                 selector))
+      (= keyword :key) (.querySelector element (str/join ["[data-reactid$='$" value "']"]))
       (= keyword :class) (.querySelector element (str "." value))
       (= keyword :selector) (or (.querySelector element value) nil)
       :else (let [attr (name keyword)


todos

todos

--- src/hackerrank/compare_the_triplets.clj
+++ src/hackerrank/compare_the_triplets.clj
@@ -38,3 +38,8 @@

   (println @alice @bob)
 )
+
+;; 2016-07-29 17:04
+;; 1/7 points
+;; o think of others test cases
+;; o make it more testable


Provide more helpful message in doc lookup

Refers #12

--- src/main/clojure/vimclojure/backend.clj
+++ src/main/clojure/vimclojure/backend.clj
@@ -52,7 +52,8 @@
     :>>
     (fn [v] (print-doc v))

-    (throw (Exception. (str "No such Var or Namespace: " symbol)))))
+    (println
+      (str "'" symbol "' could not be found. Please check the spelling."))))

 (defn javadoc-path-for-class
   "Translate the name of a Class to the path of its javadoc file."


(maint) Move comment below migration lists

The past few times we've written migrations we've forgotten to move the
comment, so this moves it after the list so it won't need to be moved.

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -2021,12 +2021,12 @@
    71 autovacuum-vacuum-scale-factor-factsets-catalogs-certnames
    72 add-support-for-catalog-inputs
    73 resource-events-partitioning
-   ; Make sure that if you change the structure of reports
-   ; or resource events, you also update the delete-reports
-   ; cli command.
    74 reports-partitioning
    75 add-report-type-to-reports
    76 add-report-partition-indexes-on-id})
+   ;; Make sure that if you change the structure of reports
+   ;; or resource events, you also update the delete-reports
+   ;; cli command.

 (defn desired-schema-version []
   "The newest migration this PuppetDB instance knows about.  Anything


Fix desriptions

Fix desriptions

--- src/robinson/ui/components/robinson.clj
+++ src/robinson/ui/components/robinson.clj
@@ -993,28 +993,6 @@
                                        {:name (get ability :description)}
                                        {:name ""}])
                                     abilities))}]]])))
-#_(defn render-ability-choices
-  "Render the player ability choice menu if the world state is `:gain-level`."
-  [state]
-  (let [screen (get state :screen)
-        abilities (get-in state [:world :ability-choices])
-        height (+ 3 (* 3 (count abilities)))]
-    (render-list screen :ui 17 4 43 height
-      (concat
-        (mapcat
-          (fn [ability]
-            [{:s (format "<color fg=\"highlight\">%s</color> - %s" (get ability :hotkey) (get ability :name))
-              :fg :black
-              :bg :white
-              :style #{}}
-             {:s (format "    %s" (get ability :description)) :fg :black :bg :white :style #{}}
-             {:s "" :fg :black :bg :white :style #{}}])
-          abilities)
-        [{:s "" :fg :black :bg :white :style #{}}
-         {:s "Select hotkey." :fg :black :bg :white :style #{}}]))
-    (render-rect-double-border screen 16 3 43 height :black :white)
-    (put-string screen :ui 29 3 "Choose New Ability" :black :white)))
-

 (zc/def-component ActionChoices
   [this]
@@ -1052,24 +1030,24 @@

 (zc/def-component Describe
   [this]
-  (let [{:keys [game-state]} (zc/props this)]
-    nil))
-#_(defn render-describe
-  "Render the describe info pane if the world state is `:describe`."
-  [state]
-  (let [{cursor-x :x
-         cursor-y :y} (get-in state [:world :cursor])
-        [x y]         (rv/viewport-xy state)
-        [w _]         (rv/viewport-wh state)
-        _             (println "cursor-x" cursor-x "w" w)
+  (let [{:keys [game-state]} (zc/props this)
+        {cursor-x :x
+         cursor-y :y} (get-in game-state [:world :cursor])
+        [x y]         (rv/viewport-xy game-state)
+        [w _]         (rv/viewport-wh game-state)
+        _             (log/info "cursor-x" cursor-x "w" w)
         position      (if (< cursor-x (/ w 2))
                         :right
                         :left)
-        description   (rdesc/describe-cell-at-xy state (+ x cursor-x) (+ y cursor-y))]
-  (render-text (state :screen) position "Look" (if (get-in state [:world :dev-mode])
-                                                 (str description "[" (+ x cursor-x) " " (+ y cursor-y) "]"
-                                                      (get-cell state (+ x cursor-x) (+ y cursor-y)))
-                                                 description))))
+        description   (rdesc/describe-cell-at-xy game-state (+ x cursor-x) (+ y cursor-y))
+        text          (if (get-in game-state [:world :dev-mode])
+                         (str description "[" (+ x cursor-x) " " (+ y cursor-y) "]"
+                              (get-cell game-state (+ x cursor-x) (+ y cursor-y)))
+                         description)
+        cursor-x      (if (= position :left)
+                        (dec (- cursor-x (count text)))
+                        (inc cursor-x))]
+  (zc/csx [:text {:style {:position :fixed :top cursor-y :left cursor-x}} [text]])))


Fixed line wires tests

Fixed line wires tests

--- test/basinet/line_wires_test.clj
+++ test/basinet/line_wires_test.clj
@@ -1,10 +1,15 @@
 (ns basinet.line-wires-test
-  (:require [khazad-dum :refer :all]
+  (:require [khazad-dum :refer :all :exclude [deftest]]
             [basinet :as b]
             [basinet.buffer-test :refer [?convert=]]
             [evil-ant :as e])
   (:import [java.nio.channels ClosedChannelException]
            [basinet Result]))
+
+(defmacro deftest [name & body]
+  `(khazad-dum/deftest ~name
+     (binding [b/*signal-set* (b/signal-set)]
+       ~@body)))

 (deftest line-writer-readers-chars-and-makes-strings
   (with-open [cb (b/char-buffer "hello\nhi\nagain!!!\n")
@@ -60,55 +65,64 @@
       (?convert= [ob cb lr] Result/OVERFLOW)
       (?chars= cb "hello!!!"))))

-(comment
 (deftest simple-line-source-test
   (with-open [pipe (b/pipe)
               source (b/line-source (b/source pipe))]
     (doseq [c "hello\n"] (b/push pipe (byte c)))
-    (e/emit-now! (b/on-poppable pipe))
-    (?= (b/pop source) "hello")))
+    (b/emit-now!)
+    (b/emit-now!)
+    (?= (b/try-pop source) "hello")))

 (deftest simple-line-sink-test
   (with-open [pipe (b/pipe)
               sink (b/line-sink (b/sink pipe))]
     (b/push sink "hello")
+    (b/emit-now!)
     (doseq [c "hello\n"] (?= (b/try-pop pipe) (int c)))))

 (deftest line-sink-with-lines-option
   (with-open [pipe (b/pipe)
-              source (b/line-source pipe)
+              source (b/line-source pipe :lines 5)
               sink (b/line-sink pipe  :lines 5)]
     (dotimes [i 5] (?= (b/try-push sink "hello") true))
-    (e/emit-now! (b/on-poppable pipe))
-    (dotimes [i 5] (?= (b/pop source) "hello"))))
+    (b/emit-now!)
+    (b/emit-now!)
+    (b/emit-now!)
+    (dotimes [i 5] (?= (b/try-pop source) "hello"))))

 (deftest line-source-with-lines-option
   (with-open [pipe (b/pipe)
               source (b/line-source pipe :lines 5)
               sink (b/line-sink pipe :lines 5)]
     (dotimes [i 5] (b/push sink "hello"))
-    (e/emit-now! (b/on-poppable pipe))
+    (b/emit-now!)
+    (b/emit-now!)
+    (b/emit-now!)
     (dotimes [i 5] (?= (b/try-pop source) "hello"))))

 (deftest line-source-with-encoding-option
   (with-open [pipe (b/pipe)
               source (b/line-source pipe :charset "UTF-16LE")]
     (doseq [b (map byte [58 4 10 0])] (b/push pipe b))
-    (e/emit-now! (b/on-poppable pipe))
-    (?= (b/pop source) (str (char 1082)))))
+    (b/emit-now!)
+    (b/emit-now!)
+    (?= (b/try-pop source) (str (char 1082)))))

 (deftest line-sink-with-encoding-option
   (with-open [pipe (b/pipe)
               sink (b/line-sink pipe :charset "UTF-16LE")]
     (b/push sink (str (char 1082)))
-    (e/emit-now! (b/on-poppable pipe))
-    (doseq [b (map byte [58 4 10 0])] (?= (b/pop pipe) b))))
+    (b/emit-now!)
+    (b/emit-now!)
+    (doseq [b (map byte [58 4 10 0])] (?= (b/try-pop pipe) b))))

 (deftest line-socket-test
   (with-open [pipe (b/pipe)
               socket (b/line-socket pipe :lines 2)]
     (b/try-push socket "hi")
     (b/try-push socket "Hello!!!")
-    (e/emit-now! (b/on-poppable pipe))
+    (b/emit-now!)
+    (b/emit-now!)
+    (b/emit-now!)
     (?= (b/try-pop socket) "hi")
-    (?= (b/try-pop socket) "Hello!!!"))))
+    (?= (b/try-pop socket) "Hello!!!")))


pixel font example cleanup

pixel font example cleanup

--- examples/pixelfont/src/pixelfont/core.cljs
+++ examples/pixelfont/src/pixelfont/core.cljs
@@ -28,14 +28,4 @@
     (m/with-sprite canvas :bg
       [text (pf/make-text :big "The quick brown fox jumped over the lazy sequence!"
                           {"fo" -2  "ro" -1 "la" -1 })]
-      (while true (<! (e/next-frame)))
-      )
-
-    ;(t/set-texture! :font (r/get-texture :fonts :nearest))
-
-    #_ (m/with-sprite canvas :bg
-      [rabbit (s/make-sprite :font :xhandle 0.2 :yhandle 0.2 :scale 2)]
-      (loop [angle 0]
-        ;(s/set-rotation! rabbit angle)
-        (<! (e/next-frame))
-        (recur (+ 0.01 angle))))))
+      (while true (<! (e/next-frame))))))


Fixed the input box on the Todo MVC demo

--- src/webapp/framework/client/macros.cljs
+++ src/webapp/framework/client/macros.cljs
@@ -418,15 +418,15 @@
   (let [input-path (swap! path-index inc)]
     `(input (merge ~params
                    {
-                    :value      (read-ui  ~app [~input-path])
+                    :value      (~'read-ui  ~app [~input-path])
                     :onChange   (~'fn [~'event]
                                       (~'let [~'newtext  (.. ~'event -target -value  )]
                                              (~'write-ui  ~app  [~input-path]  ~'newtext)))
                     :onKeyDown  (~'fn [~'event]
-                                      (do
+                                      (~'do
                                         (~'if (= (.-keyCode ~'event  ) 13)
                                               (~'go
-                                               (let [~'newtext (~'read-ui  ~app [~input-path])]
+                                               (~'let [~'newtext (~'read-ui  ~app [~input-path])]
                                                  ((~@code) ~'newtext)
                                                  (~'write-ui  ~app  [~input-path]  ""))))))
                     } ))))


Use more inclusive pattern for source ID (for both GET and PUT).

--- src/lcmap/aardvark/landsat.clj
+++ src/lcmap/aardvark/landsat.clj
@@ -131,8 +131,8 @@
    (context "/landsat" request
      (GET    "/" [] {:body nil})
      (ANY    "/" [] (allow "GET"))
-     (GET    "/source/:source-id" [source-id] (get-source source-id))
-     (PUT    "/source/:source-id" [source-id] (put-source source-id request))
+     (GET    "/source/:source-id{.+}" [source-id] (get-source source-id))
+     (PUT    "/source/:source-id{.+}" [source-id] (put-source source-id request))
      (GET    "/tiles" [] (get-tiles request))
      (GET    "/tile-spec" [] (get-tile-specs))
      (POST   "/tile-spec" [] (post-tile-spec request))


split up basic-connection test into two separate tests

--- test/subrosa/test/connection.clj
+++ test/subrosa/test/connection.clj
@@ -8,7 +8,9 @@
   (with-connection s
     (transmit s "NICK dan")
     (transmit s "USER dan 0 * :Dan Larkin")
-    (is (received? s #"Welcome to the .* dan$")))
+    (is (received? s #"Welcome to the .* dan$"))))
+
+(deftest opposite-order-connect
   (with-connection s
     (transmit s "USER dan 0 * :Dan Larkin")
     (transmit s "NICK dan")


Add partial testing to the hazelcast mesh

--- test/puppetlabs/cthun/meshing/hazelcast_test.clj
+++ test/puppetlabs/cthun/meshing/hazelcast_test.clj
@@ -1,3 +1,14 @@
 (ns puppetlabs.cthun.meshing.hazelcast-test
   (require [clojure.test :refer :all]
            [puppetlabs.cthun.meshing.hazelcast :refer :all]))
+
+(deftest broker-for-endpoint-test
+  (with-redefs [flatten-location-map (fn [_] [{:broker "bill" :endpoint "cth://localhost/agent"}
+                                              {:broker "ted"  :endpoint "cth://localhost/agent"}
+                                              {:broker "bill" :endpoint "cth://localhost/controller"}])]
+    (testing "it finds the controller"
+      (is (= "bill" (broker-for-endpoint nil "cth://localhost/controller"))))
+    (testing "it finds the agent"
+      (is (= "bill" (broker-for-endpoint nil "cth://localhost/agent"))))
+    (testing "it won't find something absent"
+      (is (not (broker-for-endpoint nil "cth://localhost/no-suchagent"))))))


Try auto gain adjustment.

Try auto gain adjustment.

--- src/clojure/playasophy/wonderdome/mode/tunes.clj
+++ src/clojure/playasophy/wonderdome/mode/tunes.clj
@@ -29,6 +29,7 @@

 (def power-factor 9/10)
 (def power-decay 1/200)
+(def power-target 2.0)

 (defrecord FrequencyBand
@@ -43,7 +44,17 @@
   [band elapsed decay]
   (-> band
       (update :energy * (ctl/bound [0.0 1.0] (- 1.0 (* 1/1000 decay elapsed))))
-      (update :power  * (ctl/bound [0.0 1.0] (- 1.0 (* power-decay elapsed))))))
+      (update :power  * (ctl/bound [0.0 1.0] (- 1.0 (* power-decay elapsed))))
+      (assoc :gain (ctl/bound [0.2 5.0]
+                              (cond
+                                ; If power is lower than we want, add gain
+                                (< (/ (:power band) power-target) 0.8)
+                                  (* (:gain band) 1.01)
+                                ; If power is higher than we want, back off gain
+                                (> (/ (:power band) power-target) 1.2)
+                                  (* (:gain band) 0.99)
+                                :else
+                                  (:gain band))))))

 (defn- update-energy
@@ -85,7 +96,6 @@

 (defrecord TunesMode
   [bands          ; Average energy per band
-   gain           ; Gain per band (static for now)
    decay          ; How quickly energy levels decay (frac/s)
    smoothing      ; Proportion to smooth input samples by (fraction of old average to keep)
    rotation       ; How much to rotate each band spatially


Factor out dt-update.

Factor out dt-update.

--- src/clojure/playasophy/wonderdome/mode/tunes.clj
+++ src/clojure/playasophy/wonderdome/mode/tunes.clj
@@ -76,6 +76,13 @@
      (- angle-div low-band)]))

+(defn- dt-update
+  "Updates the given value by applying the rate (in seconds) multiplied by the
+  elapsed time (in milliseconds)."
+  [value rate elapsed]
+  (+ value (* 1/1000 elapsed rate)))
+
+
 (defrecord TunesMode
   [bands          ; Average energy per band
    gain           ; Gain per band (static for now)
@@ -98,8 +105,8 @@
         (cond->
           (assoc this
                :bands (mapv #(apply-decay % elapsed decay) bands)
-               :rotation (sphere/wrap-angle (+ rotation (* elapsed (/ rotation-rate 1000))))
-               :color-shift (ctl/wrap [0.0 1.0] (+ color-shift (* elapsed (/ shift-rate 1000)))))
+               :rotation (sphere/wrap-angle (dt-update rotation rotation-rate elapsed))
+               :color-shift (ctl/wrap [0.0 1.0] (dt-update color-shift shift-rate elapsed)))
           (compare-and-set! log-next? true false)
             (doto prn)))


Fixed timestamp column type.

Fixed timestamp column type.

--- src/com/lemondronor/orbital_detector/reports.clj
+++ src/com/lemondronor/orbital_detector/reports.clj
@@ -25,7 +25,7 @@

 (def db-schema
   {:reports
-   {:timestamp :integer
+   {:timestamp :text
     :icao :text
     :registration :text
     :altitude :integer
@@ -130,3 +130,14 @@
       (add-records!
        db
        (planeplotter/read-log log-path)))))
+
+(comment
+
+  (def geojson
+  (->> (com.lemondronor.orbital-detector.db/query-seq1
+        (com.lemondronor.orbital-detector.db/db-spec "pings.sqb")
+        "SELECT lat, lon FROM reports")
+       (map (fn [r] [(:lat r) (:lon r)]))
+       (map list)
+       (com.lemondronor.orbital-detector.geojson/geojson)))
+  )


"trapassato": {:aspect :pluperfect}

"trapassato": {:aspect :pluperfect}

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -41,7 +41,7 @@
                                 :tense :past}}}
    "passato" {:synsem {:sem {:aspect :simple
                              :tense :past}}}
-   "trapassato" {:synsem {:sem {:aspect :perfect
+   "trapassato" {:synsem {:sem {:aspect :pluperfect
                                 :tense :past}}}})

 (defn fo-ps [expr]


Add gauges for hue and saturation adjustments.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -807,6 +807,46 @@
     (.setAngleStart arc (+ 270.0 (* -300.0 fraction)))
     (.setAngleExtent arc 0.0)
     (.draw graphics arc)))
+
+(defn draw-hue-gauge
+  "Draw a graphical gauge whose colors are the hues of the color
+  circle, with an indicator that rides around an circle (starting at
+  the bottom) under a variable value."
+  [controller index encoder-count value active?]
+  (let [graphics (create-graphics controller)
+        x-center (+ (* index button-cell-width) (* encoder-count 0.5 button-cell-width))
+        arc (java.awt.geom.Arc2D$Double. (- x-center 20.0) 50.0 40.0 40.0 270.0 -1.0 java.awt.geom.Arc2D/OPEN)]
+    (dotimes [i 360]
+      (.setAngleStart arc (- 270.0 i))
+      (set-graphics-color graphics (colors/create-color :h i :s 70.0 :l 35.0))
+      (.draw graphics arc))
+    (.setStroke graphics (java.awt.BasicStroke. 6.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
+    (if active?
+      (set-graphics-color graphics (colors/create-color :h value :s 100.0 :l 50.0))
+      (set-graphics-color graphics (colors/create-color :h value :s 70.0 :l 35.0)))
+    (.setAngleStart arc (- 270.0 value))
+    (.setAngleExtent arc 0.0)
+    (.draw graphics arc)))
+
+(defn draw-saturation-gauge
+  "Draw a graphical gauge whose colors are the saturation levels of
+  the specified hue circle, with an indicator like that of a level
+  gauge, under a variable value."
+  [controller index encoder-count hue value active?]
+  (let [graphics (create-graphics controller)
+        x-center (+ (* index button-cell-width) (* encoder-count 0.5 button-cell-width))
+        arc (java.awt.geom.Arc2D$Double. (- x-center 20.0) 50.0 40.0 40.0 240.0 -3.0 java.awt.geom.Arc2D/OPEN)]
+    (dotimes [i 100]
+      (.setAngleStart arc (- 240.0 (* i 3)))
+      (set-graphics-color graphics (colors/create-color :h hue :s i :l 35.0))
+      (.draw graphics arc))
+    (.setStroke graphics (java.awt.BasicStroke. 5.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
+    (dotimes [i (math/round value)]
+      (if active?
+        (set-graphics-color graphics (colors/create-color :h hue :s i :l 50.0))
+        (set-graphics-color graphics (colors/create-color :h value :s i :l 35.0)))
+      (.setAngleStart arc (- 240.0 (* i 3)))
+      (.draw graphics arc))))

 (defn ^:deprecated make-pan-gauge
   "Create a graphical gauge with an indicator that moves along a line.
@@ -1252,9 +1292,17 @@
                     :highest (max cur-val (:max cue-var))))

       (or (= (type cur-val) :com.evocomputing.colors/color) (= (:type cue-var) :color))
-      nil ;; TODO: Implement based on this:
-      #_(controllers/add-overlay (:overlays controller)
-                               (build-color-adjustment-overlay controller note cue cue-var effect info))
+      (let [current-color (or (cues/get-cue-variable cue cue-var :show (:show controller) :when-id effect-id)
+                              white-color)
+            hue (colors/hue current-color)
+            sat (colors/saturation current-color)]
+        (if (= encoder-count 1)
+          (if (odd? index)  ; We have room for just one gauge; draw whichever will be there in the overlay
+            (draw-saturation-gauge controller index 1 hue sat false)
+            (draw-hue-gauge controller index 1 hue false))
+          (do   ; We have room for both gauges
+            (draw-hue-gauge controller index 1 hue false)
+            (draw-saturation-gauge controller (inc index) 1 hue sat false))))

       (or (= (type cur-val) Boolean) (= (:type cue-var) :boolean))
       (draw-boolean-gauge controller index encoder-count cur-val))))
@@ -2372,14 +2420,9 @@
                                                                   (colors/darken current-color 20)
                                                                   (colors/lighten current-color 20))))))

-              ;; Display the hue and saturation numbers and gauges
-              (let [hue-str (clojure.string/join (take 5 (str (double hue) "     ")))
-                    sat-str (clojure.string/join (take 5 (str (double sat))))
-                    hue-gauge (make-pan-gauge hue :highest 360 :width 8)
-                    sat-gauge (make-gauge sat :width 8)]
-                (write-display-cell controller 0 x (str "H: " hue-str " S: " sat-str))
-                (write-display-text controller 1 (* x 17) hue-gauge)
-                (write-display-text controller 1 (+ 9 (* x 17)) sat-gauge))
+              ;; Display the hue and saturation gauges
+              (draw-hue-gauge controller (* 2 x) 1 hue (@anchors hue-note))
+              (draw-saturation-gauge controller (inc (* 2 x)) 1 hue sat (@anchors sat-note))

               ;; Put the touch pad into the appropriate state
               (if (@anchors hue-note)


Use actual fonts, and fix width calculations.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -490,15 +490,21 @@
   "The number of pixels to keep blank between labels of adjacent buttons."
   4)

+(defn string-width
+  "Determines how many pixels wide a string will be in a given font
+  and render context."
+  [text font render-context]
+  (.getWidth (.getStringBounds font text render-context)))
+
 (defn fit-string
   "Truncates a string (appending an ellipsis) enough to fit within a
   given pixel width."
-  [text font-metrics max-width]
-  (if (or (clojure.string/blank? text) (<= (.stringWidth font-metrics text) max-width))
+  [text font render-context max-width]
+  (if (or (clojure.string/blank? text) (<= (string-width text font render-context) max-width))
     text
     (loop [truncated (subs text 0 (dec (count text)))]
       (let [result (str truncated "…")]
-        (if (or (clojure.string/blank? truncated) (<= (.stringWidth font-metrics result) max-width))
+        (if (or (clojure.string/blank? truncated) (<= (string-width result font render-context) max-width))
           result
           (recur (subs truncated 0 (dec (count truncated)))))))))

@@ -512,17 +518,17 @@
 (defn calculate-text-width
   "Figure out how many pixels wide some text will be in a given font."
   [graphics font text]
-  (let [metrics (.getFontMetrics graphics font)]
-    (.stringWidth metrics text)))
+  (let [context (.getFontRenderContext graphics)]
+    (.getWidth (.getStringBounds text context))))

 (defn draw-bottom-button-label
   "Draw a label for a button below the graphical display."
   [controller index text color]
   (let [graphics (create-graphics controller)
         font (get-display-font :roboto-medium Font/BOLD 14)
-        metrics (.getFontMetrics graphics font)
-        label (fit-string text metrics (- button-cell-width button-cell-margin))
-        width (.stringWidth metrics label)]
+        context (.getFontRenderContext graphics)
+        label (fit-string text font context (- button-cell-width button-cell-margin))
+        width (string-width label font context)]
     (set-graphics-color graphics color)
     (.setFont graphics font)
     (.drawString graphics label (int (math/round (- (* (+ index 0.5) button-cell-width) (/ width 2))))
@@ -536,7 +542,7 @@

 (def font-for-encoder-button-label
   "The font used when drawing labels under encoders."
-  (get-display-font :condensed-light Font/PLAIN 14))
+  (get-display-font :condensed Font/PLAIN 14))

 (def encoder-label-underline-height
   "The height at which to draw the line under an encoder label."
@@ -547,9 +553,9 @@
   [controller index encoder-count text color]
   (let [graphics (create-graphics controller)
         space (space-for-encoder-button-label encoder-count)
-        metrics (.getFontMetrics graphics font-for-encoder-button-label)
-        label (fit-string text metrics space)
-        width (.stringWidth metrics label)]
+        context (.getFontRenderContext graphics)
+        label (fit-string text font-for-encoder-button-label context space)
+        width (string-width label font-for-encoder-button-label context)]
     (set-graphics-color graphics color)
     (.setFont graphics font-for-encoder-button-label)
     (.drawString graphics label
@@ -883,10 +889,10 @@
   (let [graphics (create-graphics controller)
         space (space-for-encoder-button-label encoder-count)
         font font-for-encoder-button-label
-        metrics (.getFontMetrics graphics font)
+        context (.getFontRenderContext graphics)
         longer (or (:name v) (name (:key v)))
         shorter (or (:short-name v) longer)]
-    (if (<= (.stringWidth metrics longer) space) longer shorter)))
+    (if (<= (string-width longer font context) space) longer shorter)))

 (defn draw-cue-variable-names
   "Draw the names of adjustable variables under the appropriate
@@ -1015,9 +1021,10 @@
               (.fillRect graphics (+ left (/ button-cell-margin 2.0)) (- Wayang/DISPLAY_HEIGHT 38)
                          (- width button-cell-margin) 20)
               (let [label-font (get-display-font :condensed Font/PLAIN 16)
-                    metrics (.getFontMetrics graphics label-font)
-                    label (fit-string (or (:name cue) (:name (first fx))) metrics (- width button-cell-margin 2))
-                    label-width (.stringWidth metrics label)]
+                    context (.getFontRenderContext graphics)
+                    label (fit-string (or (:name cue) (:name (first fx))) label-font context
+                                      (- width button-cell-margin 2))
+                    label-width (string-width label label-font context)]
                 (set-graphics-color graphics off-color)
                 (.setFont graphics label-font)
                 (.drawString graphics label (int (math/round (- (+ left button-cell-width) (/ label-width 2))))
@@ -1036,7 +1043,7 @@
                   (draw-bottom-button-label controller (* 2 x) (if ending "Ending" "End") red-color)))
               (when scroll-vars
                 (swap! (:next-top-pads controller) assoc (inc (* 2 x)) dim-white-color)
-                (draw-bottom-button-label controller (inc (* 2 x)) "More →" white-color))
+                (draw-bottom-button-label controller (inc (* 2 x)) "Next Vars >" white-color))
               (when (seq (rest fx))
                 (recur (rest fx) (rest fx-meta) (inc x)))))

@@ -1063,7 +1070,6 @@
               width (calculate-text-width graphics font text)]
           (.setFont graphics font)
           (.setPaint graphics no-effects-active-color)
-          (timbre/info width (math/round (- (/ Wayang/DISPLAY_WIDTH 2) (/ width 2))))
           (.drawString graphics text (int (math/round (- (/ Wayang/DISPLAY_WIDTH 2) (/ width 2))))
                        (/ Wayang/DISPLAY_HEIGHT 2)))))))

@@ -1248,16 +1254,15 @@
   (clear-display-buffer controller)
   (let [welcome (str "Welcome to " (version/title))
         version (str "version " (version/tag))
-        graphics (create-graphics controller)]
+        graphics (create-graphics controller)
+        context (.getFontRenderContext graphics)]
     (.setFont graphics (get-display-font :roboto-medium Font/PLAIN 42))
     (.setPaint graphics (java.awt.Color/WHITE))
-    (let [metrics (.getFontMetrics graphics)
-          x (int (- (/ Wayang/DISPLAY_WIDTH 2) (/ (.stringWidth metrics welcome) 2)))]
+    (let [x (int (- (/ Wayang/DISPLAY_WIDTH 2) (/ (string-width welcome (.getFont graphics) context) 2)))]
       (.drawString graphics welcome x 80))
     (.setFont graphics (get-display-font :condensed-light Font/ITALIC 20))
     (.setPaint graphics (java.awt.Color/BLUE))
-    (let [metrics (.getFontMetrics graphics)
-          x (int (- (/ Wayang/DISPLAY_WIDTH 2) (/ (.stringWidth metrics version) 2)))]
+    (let [x (int (- (/ Wayang/DISPLAY_WIDTH 2) (/ (string-width version (.getFont graphics) context) 2)))]
       (.drawString graphics version x 110))
     (let [afterglow-logo (javax.imageio.ImageIO/read
                           (.getResourceAsStream Effect "/public/img/Afterglow-logo-padded-left.png"))
@@ -2223,6 +2228,7 @@
   parameters."
   [show port-in port-out device refresh-interval display-name]
   {:pre [(some? show)]}
+  (load-fonts)
   (let [modes (atom #{})
         controller
         (with-meta


whitespace

whitespace

--- src/cljx/jamesmacaulay/async_tools/core.cljx
+++ src/cljx/jamesmacaulay/async_tools/core.cljx
@@ -59,13 +59,13 @@
 (defn then<
   [f ch]
   (async-future* (fn [cb]
-             (async/take! ch (comp cb f)))))
+                   (async/take! ch (comp cb f)))))

 (defn all<
   [xs]
   (async-future< (async/map list
-                      (map cast-as-readport
-                           xs))))
+                            (map cast-as-readport
+                                 xs))))

 (defn race<
   [xs]


fix CLJS 'format' impl

fix CLJS 'format' impl

--- test/calfpath/core_test.cljc
+++ test/calfpath/core_test.cljc
@@ -17,7 +17,7 @@
         :clj [calfpath.core :as c])))

-#?(:cljs (defmacro format [& args] `(gstring/format ~@args)))
+#?(:cljs (def format gstring/format))

 (deftest test-->uri


missing notice

missing notice

--- src/clj/cljs/analyzer/utils.clj
+++ src/clj/cljs/analyzer/utils.clj
@@ -1,3 +1,11 @@
+;   Copyright (c) Rich Hickey. All rights reserved.
+;   The use and distribution terms for this software are covered by the
+;   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;   which can be found in the file epl-v10.html at the root of this distribution.
+;   By using this software in any fashion, you are agreeing to be bound by
+;   the terms of this license.
+;   You must not remove this notice, or any other, from this software.
+
 (ns cljs.analyzer.utils
   (:require [cljs.analyzer :as ana]))


Clean up the scraped image tag

Clean up the scraped image tag

--- src/clj/comic_reader/scrape.clj
+++ src/clj/comic_reader/scrape.clj
@@ -18,8 +18,12 @@
     [tag attrs]
     [tag attrs content]))

+(defn clean-image-tag [[tag attrs & content]]
+  [tag (select-keys attrs [:alt :src])])
+
 (defn fetch-image-tag [url]
   (-> (fetch-url url)
       (html/select [:div#imgholder :a :img#img])
       first
-      enlive->hiccup))
+      enlive->hiccup
+      clean-image-tag))


Fix broken build

Fix broken build

I changed the name of my router, but not the references to it. Missed
the brokenness in REPL, until I checked from the command-line.

Did verify that the web server and routes (such as they are) are running correctly.

--- src/clj/frereth_web/handler.clj
+++ src/clj/frereth_web/handler.clj
@@ -6,7 +6,7 @@
             [ribol.core :refer (manage raise)]
             [schema.core :as s]
             [taoensso.timbre :as log])
-  (:import [frereth_web.routes Routes]))
+  (:import [frereth_web.routes HttpRoutes]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Schema
@@ -18,7 +18,7 @@
   "What the system options piece looks like"
   {:web-server ServerDescription})

-(s/defrecord Server [http-router :- Routes]
+(s/defrecord Server [http-router :- HttpRoutes]
     component/Lifecycle
   (start
    [this]


bring Ramujan damage prevention prompt to the front

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -488,7 +488,7 @@
    {:prevent {:damage [:net :brain]}
     :abilities [{:effect (req (let [n (count (filter #(= (:title %) (:title card)) (all-installed state :runner)))]
                                 (resolve-ability state side
-                                  {:prompt "Choose how much damage to prevent" :priority true
+                                  {:prompt "Choose how much damage to prevent" :priority 50
                                    :choices {:number (req (min n (count (:deck runner))))}
                                    :msg (msg "trash " target " cards from their Stack and prevent " target " damage")
                                    :effect (effect (damage-prevent :net target)


Added mostly-complete support for Bug.

Added mostly-complete support for Bug.

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -43,7 +43,11 @@
               :effect (effect (ice-strength-bonus -2))}}}

    "Bug"
-   {:req (req (some #{:hq} (:successful-run runner-reg)))}
+   {:req (req (some #{:hq} (:successful-run runner-reg)))
+    :events {:corp-draw {:optional
+                         {:prompt (msg "Pay 2 [Credits] to reveal card just drawn?") :player :runner
+                          :yes-ability {:msg (msg "reveal the card just drawn: " (:title (last (:hand corp))))
+                                        :cost [:credit 2]}}}}}

    "Cache"
    {:abilities [{:counter-cost 1 :effect (effect (gain :credit 1)) :msg "gain 1 [Credits]"}]


Allow to read byte-arrays from input-stream directly.

--- src/clj/geschichte/platform.clj
+++ src/clj/geschichte/platform.clj
@@ -3,6 +3,7 @@
   (:require [clojure.set :as set]
             [clojure.edn :as edn]
             [clojure.string :as str]
+            [clojure.java.io :as io]
             [geschichte.platform-log :refer [debug info warn error]]
             [konserve.platform :refer [read-string-safe]]
             [hasch.benc :refer [IHashCoercion -coerce]]
@@ -70,7 +71,7 @@
                                  (if (= (:topic m) :binary-fetched)
                                    (cli/send ws :byte (let [out (ByteArrayOutputStream.)]
                                                         (.write out (byte 0))
-                                                        (.write out (:value m))
+                                                        (io/copy (:value m) out)
                                                         (.toByteArray out)))
                                    (cli/send ws :text (str " " (pr-str m))))
                                  (recur (<! out))))


component spec added

component spec added

--- src/clj/hellhound/component.clj
+++ src/clj/hellhound/component.clj
@@ -55,18 +55,3 @@
 (s/def ::depends-on (s/coll-of keyword? :kind vector? :distinct true))
 (s/def ::component (s/keys :req [::name ::start-fn ::stop-fn]
                            :opt [::depends-on]))
-
-
-(gen/sample (s/gen ::name))
-(gen/sample (s/gen ::start-fn))
-(gen/sample (s/gen ::component))
-a
-(get-name a)
-(started? a)
-(dependencies a)
-(start! a {})
-(keyword-ns? ::name)
-(s/gen ::name)
-(gen/sample (gen/list gen/boolean))
-
-(gen/sample (gen/vector gen/keyword))


fix activation-url

fix activation-url

--- src/clj/movement/activation.clj
+++ src/clj/movement/activation.clj
@@ -7,7 +7,7 @@
   (str (java.util.UUID/randomUUID)))

 (def url (if (env :dev?) "http://localhost:8000/activate/"
-                          "http://movementsession.com/activate/"))
+                          "http://movement-session.herokuapp.com/activate/"))

 (defn send-activation-email [email activation-id]
   (try


routes

routes

--- src/clj/salava/badge/routes.clj
+++ src/clj/salava/badge/routes.clj
@@ -268,4 +268,29 @@
                   :summary "Get badge statistics about badges, badge view counts, congratulations and issuers"
                   :auth-rules access/signed
                   :current-user current-user
-                  (ok (b/badge-stats ctx (:id current-user)))))))
+                  (ok (b/badge-stats ctx (:id current-user))))
+
+             (POST "/evidence/:user-badge-id" []
+                   :return {:status (s/enum "success" "error")}
+                   :path-params [user-badge-id :- Long]
+                   :body-params [id :- (s/maybe s/Int)
+                                 name :- (s/maybe s/Str)
+                                 description :- (s/maybe s/Str)
+                                 audience :- (s/maybe s/Str)
+                                 genre :- (s/maybe s/Str)
+                                 url :- s/Str
+                                 narrative :- (s/maybe s/Str)]
+                   :summary "Save badge evidence"
+                   :auth-rules access/authenticated
+                   :current-user current-user
+                   (ok (b/save-badge-evidence ctx (:id current-user) user-badge-id id name description audience genre url narrative)))
+
+             (DELETE "/evidence/:evidenceid" [user_badge_id]
+                     :return {:status (s/enum "success" "error")}
+                     :path-params [evidenceid :- Long]
+                     :summary "Delete evidence"
+                     :auth-rules access/authenticated
+                     :current-user current-user
+                     ;(prn user_badge_id evidenceid)
+                     (ok (b/delete-evidence! ctx evidenceid user_badge_id (:id current-user)))
+                     ))))


Refacotring

Refacotring

--- src/cljs/cljs_webrepl/core.cljs
+++ src/cljs/cljs_webrepl/core.cljs
@@ -47,6 +47,17 @@
     (if (< 0 columns)
       (assoc state :columns columns)
       state)))
+
+(defn close-dialog [id]
+  (some-> (.querySelector js/document (str "#" id))
+          (.close)))
+
+(defn show-dialog [id]
+  (debugf "Showing dialog: %s" id)
+  (when-let [dialog (.querySelector js/document (str "#" id))]
+    (when-not (.-showModal dialog)
+      (.registerDialog js/dialogPolyfill dialog))
+    (.showModal dialog)))

 (defn pprint-str [data]
   (with-out-str (fipp/pprint data)))
@@ -266,7 +277,7 @@
       [:pre "..."]])])

 (defn history-card
-  [{:keys [state columns] :as props} num {:keys [ns expression result output] :as history-item}]
+  [{:keys [state columns] :as props} {:keys [num ns expression result output] :as history-item}]
   [:div
    {:class (str "mdl-cell " (card-columns-class columns))}
    [:div.mdl-card.mdl-shadow--2dp
@@ -349,35 +360,26 @@
      (doall
       (for [[num history-item] (:history @state)]
         ^{:key num}
-        [history-card props num history-item]))
+        [history-card props (assoc history-item :num num)]))
      (when (input-ok? @state)
        [input-card props])]]])

-(defn close-dialog [id]
-  (some-> (.querySelector js/document id)
-          (.close)))
-
-(defn show-dialog [id]
-  (when-let [dialog (.querySelector js/document id)]
-    (when-not (.-showModal dialog)
-      (.registerDialog js/dialogPolyfill dialog))
-    (.showModal dialog)))
-
-(defn reset-dialog [state]
+
+(defn reset-dialog [{:keys [state]}]
   [:dialog.mdl-dialog {:id "reset-dialog"}
    [:div.mdl-dialog__content
     [:p "Reset REPL? All data will be lost."]]
    [:div.mdl-dialog__actions
     [:button.mdl-button
      {:on-click (fn []
-                  (close-dialog "#reset-dialog")
+                  (close-dialog "reset-dialog")
                   (reset-repl! state))}
      "Reset"]
     [:button.mdl-button
-     {:on-click #(close-dialog "#reset-dialog")}
+     {:on-click #(close-dialog "reset-dialog")}
      "Cancel"]]])

-(defn about-dialog []
+(defn about-dialog [props]
   [:dialog.mdl-dialog.mdl-dialog__wide {:id "about-dialog"}
    [:h4.mdl-dialog__title "CLJS-WebREPL"]
    [:div.mdl-dialog__content
@@ -390,62 +392,95 @@
      "Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version."]]
    [:div.mdl-dialog__actions
     [:button.mdl-button
-     {:on-click #(close-dialog "#about-dialog")}
+     {:on-click #(close-dialog "about-dialog")}
      "Ok"]]])

-
-(defn home-page-header [{:keys [columns state] :as props}]
+(defn reset-repl-button [{:keys [show-reset-dialog]}]
+  [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect
+   {:on-click show-reset-dialog
+    :style    {:color "#fff"}}
+   [:i.material-icons "report"]
+   [:span.mdl-cell--hide-phone "RESET"]])
+
+(defn more-columns-button [{:keys [more-columns]}]
+  [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect.mdl-cell--hide-phone
+   {:on-click more-columns
+    :style    {:color "#fff"}}
+   [:i.material-icons "view_column"]])
+
+(defn less-columns-button [{:keys [less-columns]}]
+  [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect.mdl-cell--hide-phone
+   {:on-click less-columns
+    :style    {:color "#fff"}}
+   [:i.material-icons "view_stream"]])
+
+(defn menu-button [id]
+  [:button.mdl-button.mdl-js-button.mdl-button--icon.mdl-js-ripple-effect {:id "main-menu"}
+   [:i.material-icons "more_vert"]])
+
+(defn more-columns-menu-item [{:keys [more-columns]}]
+  [:li.mdl-menu__item {:on-click more-columns} "More Columns"])
+
+(defn less-columns-menu-item [{:keys [less-columns]}]
+  [:li.mdl-menu__item {:on-click less-columns} "Less Columns"])
+
+(defn github-menu-item [{:keys [github]}]
+  [:li.mdl-menu__item {:on-click github} "GitHub"])
+
+(defn about-menu-item [{:keys [show-about-dialog]}]
+  [:li.mdl-menu__item {:on-click show-about-dialog} "About"])
+
+(defn reset-menu-item [{:keys [show-reset-dialog]}]
+  [:li.mdl-menu__item {:on-click show-reset-dialog} "Reset REPL"])
+
+(defn home-page-menu [props]
+  [:ul.mdl-menu.mdl-menu--bottom-right.mdl-js-menu.mdl-js-ripple-effect
+   {:for "main-menu"}
+   [more-columns-menu-item props]
+   [less-columns-menu-item props]
+   [reset-menu-item props]
+   [github-menu-item props]
+   [about-menu-item props]])
+
+(defn home-page-title [{:keys [title title-icon] :as props}]
+  [:span.mdl-layout-title
+   [:img.svg-size {:src title-icon}]
+   (str " " title)])
+
+(defn home-page-header [{:keys [reset-repl more-columns] :as props}]
   [:header.mdl-layout__header
    [:div.mdl-layout__header-row
-    [:span.mdl-layout-title
-     [:img.svg-size {:src "images/cljs-white.svg"}]
-     " CLJS-WebREPL"]
+    [home-page-title props]
     [:div.mdl-layout-spacer]
-    [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect
-     {:on-click #(show-dialog "#reset-dialog")
-      :style    {:color "#fff"}}
-     [:i.material-icons "report"]
-     [:span "RESET"]]
-    [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect
-     {:on-click #(swap! state more-columns)
-      :style    {:color "#fff"}}
-     [:i.material-icons "view_column"]]
-    [:button.mdl-button.mdl-js-button.mdl-js-ripple-effect
-     {:on-click #(swap! state less-columns)
-      :style    {:color "#fff"}}
-     [:i.material-icons "view_stream"]]
-    [:button.mdl-button.mdl-js-button.mdl-button--icon.mdl-js-ripple-effect {:id "main-menu"}
-     [:i.material-icons "more_vert"]]
-    [:ul.mdl-menu.mdl-menu--bottom-right.mdl-js-menu.mdl-js-ripple-effect
-     {:for "main-menu"}
-     [:li.mdl-menu__item
-      {:on-click #(show-dialog "#reset-dialog")}
-      "Reset REPL"]
-     [:li.mdl-menu__item
-      {:on-click #(set! (.-location js/window) "https://github.com/theasp/cljs-webrepl")}
-      "GitHub"]
-     [:li.mdl-menu__item
-      {:on-click #(show-dialog "#about-dialog")}
-      "About"]]]])
-
-(defn home-page []
-  (let [columns (:columns @state)
-        props   {:state   state
-                 :columns columns
-                 :title   "Cljs-WebREPL"}]
-    [:div
-     [about-dialog]
-     [reset-dialog state]
-     [:div.tall
-      [mdl/upgrade
-       [:div.flex-v.tall.mdl-layout.mdl-js-layout.mdl-layout--fixed-header.mdl-layout--no-drawer-button
-        [home-page-header props]
-        (if (:ns @state)
-          [history props]
-          [please-wait props])]]]]))
+    [reset-repl-button props]
+    [less-columns-button props]
+    [more-columns-button props]
+    [menu-button "main-menu"]
+    [home-page-menu props]]])
+
+(defn home-page [{:keys [state] :as props}]
+  (debugf "Props: %s" (keys props))
+  [:div
+   [about-dialog props]
+   [reset-dialog props]
+   [:div.tall
+    [mdl/upgrade
+     [:div.flex-v.tall.mdl-layout.mdl-js-layout.mdl-layout--fixed-header.mdl-layout--no-drawer-button
+      [home-page-header props]
+      (if (:ns @state)
+        [history (assoc props :columns (:columns @state))]
+        [please-wait props])]]]])

 (defn mount-root []
-  (r/render [home-page] (.getElementById js/document "app")))
+  (let [props {:state             state
+               :more-columns      #(swap! state more-columns)
+               :less-columns      #(swap! state less-columns)
+               :show-reset-dialog #(show-dialog "reset-dialog")
+               :show-about-dialog #(show-dialog "about-dialog")
+               :github            #(set! (.-location js/window) "https://github.com/theasp/cljs-webrepl")
+               :title-icon        "images/cljs-white.svg"
+               :title             "Cljs-WebREPL"}]
+    (r/render [home-page props] (.getElementById js/document "app"))))

 (defn init! []
   (reset-repl! state)


Make use of cljs-ajax

Make use of cljs-ajax

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -1,7 +1,8 @@
 (ns comic-reader.main
   (:require [figwheel.client :as fw]
             [om.core :as om :include-macros true]
-            [om.dom :as dom :include-macros true]))
+            [om.dom :as dom :include-macros true]
+            [ajax.core :refer [GET POST]]))

 (enable-console-print!)

@@ -35,3 +36,13 @@
        (dom/h1 nil (:text data)))))
  app-state
  {:target (. js/document (getElementById "main-area"))})
+
+(defn handler [response]
+  (.log js/console (str response)))
+
+(defn error-handler [{:keys [status status-text]}]
+  (.log js/console (str "something bad happened: " status " " status-text)))
+
+(GET "/api/v1/sites" {:handler handler
+                      :error-handler error-handler
+                      :response-format :edn})