[Add] test update-exp-data and dummy in evaluation

--- test/clj_elm/core_test.clj
+++ test/clj_elm/core_test.clj
@@ -102,14 +102,27 @@
       (predict model (first (normalize (:features libsvmlian))))
       => -1)))

+(facts "test-update-exp-data"
+  (fact "(update-exp-data pred fact exp)"
+    (let [exp {:TP 0 :FP 0 :TN 10 :FN 10}]
+      (:TP (update-exp-data 1 1 exp))
+      => 1
+      (:FP (update-exp-data 1 -1 exp))
+      => 1
+      (:TN (update-exp-data -1 -1 exp))
+      => 11
+      (:FN (update-exp-data -1 1 exp))
+      => 11)))
+
 (facts "test-evaluation"
-  (facts "(evaluation results facts)"
-    (evaluation [1 1 1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1])
-    => 1
-    (evaluation [-1 -1 -1 -1 -1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1])
-    => 1/2
-    (evaluation [-1 -1 -1 -1 -1 -1 -1 -1 -1 1] [1 1 1 1 1 1 1 1 1 1])
-    => 1/10))
+  (let [dummy {}]
+    (facts "(evaluation results facts)"
+     (evaluation [1 1 1 1 1 1 1 1 1 1] dummy [1 1 1 1 1 1 1 1 1 1])
+     => 1
+     (evaluation [-1 -1 -1 -1 -1 1 1 1 1 1] dummy [1 1 1 1 1 1 1 1 1 1])
+     => 1/2
+     (evaluation [-1 -1 -1 -1 -1 -1 -1 -1 -1 1] dummy[1 1 1 1 1 1 1 1 1 1])
+     => 1/10)))

 (facts "test-select-count"
   (fact "(select-count cond dataset)"


:bug: Fix unexpected exception on workspace first initialization.

--- frontend/src/uxbox/main/ui/workspace.cljs
+++ frontend/src/uxbox/main/ui/workspace.cljs
@@ -76,8 +76,8 @@
   (rx/cancel! shortcuts-subscription))

 (mf/defc workspace
-  [{:keys [page wst] :as props}]
-  (let [flags (mf/deref refs/flags)
+  [{:keys [page] :as props}]
+  (let [flags  (or (mf/deref refs/flags) #{})
         canvas (mf/use-ref* nil)

         left-sidebar? (not (empty? (keep flags [:layers :sitemap
@@ -88,7 +88,6 @@
                  :no-tool-bar-right (not right-sidebar?)
                  :no-tool-bar-left (not left-sidebar?)
                  :scrolling (:viewport-positionig workspace))]
-    ;; (prn "workspace.render")

     (mf/use-effect {:deps (:id page)
                     :init #(subscibe canvas page)


correct arity

correct arity

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -691,7 +691,7 @@
     (event-fn)
     (await-resume)))

-(defn run-acquisition [_ settings out-queue cleanup?]
+(defn run-acquisition [settings out-queue cleanup?]
     (try
       (def acq-settings settings)
       (log "Starting MD Acquisition: " settings)


CMR_672: Refactored to pull out code into external function for ocsd json.

--- src/cmr/indexer/data/concepts/granule.clj
+++ src/cmr/indexer/data/concepts/granule.clj
@@ -91,6 +91,13 @@
   [ocsd]
   (map ocsd ocsd-fields))

+(defn- granule->ocsd-json
+  "Create a json string from the orbitial calculated spatial domains."
+  [umm-granule]
+  (map #(json/generate-string
+                          (ocsd-map->vector %))
+                       (ocsd/ocsds->elastic-docs umm-granule)))
+
 (defmethod es/concept->elastic-doc :granule
   [context concept umm-granule]
   (let [{:keys [concept-id extra-fields provider-id revision-date format]} concept
@@ -109,9 +116,7 @@
         start-date (temporal/start-date :granule temporal)
         end-date (temporal/end-date :granule temporal)
         atom-links (map json/generate-string (ru/atom-links related-urls))
-        ocsd-json (map #(json/generate-string
-                          (ocsd-map->vector %))
-                       (ocsd/ocsds->elastic-docs umm-granule))
+        ocsd-json (granule->ocsd-json umm-granule)
         ;; not empty is used below to get a real true false value
         downloadable (not (empty? (ru/downloadable-urls related-urls)))
         browsable (not (empty? (ru/browse-urls related-urls)))


don't make unnecessary system calls for websocket url template

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -266,12 +266,17 @@
     :else                     (throw (Exception. (str "Unrecognized :websocket-host " host)))))

 (defn fill-websocket-url-template [server-port url]
-  (-> url
-      (string/replace "[[server-hostname]]" (.getHostName (java.net.InetAddress/getLocalHost)))
-      (string/replace "[[server-ip]]"       (.getHostAddress (java.net.InetAddress/getLocalHost)))
-      (string/replace "[[server-port]]"     (str server-port))))
-
-#_(fillin-websocket-url-template 1234 "ws://[[server-ip]]:[[server-port]]/figwheel-ws")
+  (cond-> url
+    (.contains url "[[server-hostname]]")
+    (string/replace "[[server-hostname]]" (.getHostName (java.net.InetAddress/getLocalHost)))
+
+    (.contains url "[[server-ip]]")
+    (string/replace "[[server-ip]]"       (.getHostAddress (java.net.InetAddress/getLocalHost)))
+
+    (.contains url "[[server-port]]")
+    (string/replace "[[server-port]]"     (str server-port))))
+
+#_(fill-websocket-url-template 1234 "ws://[[server-ip]]:[[server-port]]/figwheel-ws")

 (defn update-figwheel-connect-options [{:keys [server-port]} build]
   (if (figwheel-build? build)


Fix test

Fix test

--- test/yetibot/core/test/util/command_info.clj
+++ test/yetibot/core/test/util/command_info.clj
@@ -32,12 +32,12 @@
                              :opts ["one" "two" "three"]})]
       (is (= result
              {:parse-tree [:expr [:cmd [:words "head" [:space " "] "2"]]]
-              :sub-commands (#"(\d+)" #'yetibot.core.commands.collections/head-n
-                                      #".*" #'yetibot.core.commands.collections/head-1)
+              :sub-commands [#"(\d+)" #'yetibot.core.commands.collections/head-n
+                             #".*" #'yetibot.core.commands.collections/head-1]
               :matched-sub-cmd #'yetibot.core.commands.collections/head-n
               :match ["2" "2"]
               :command "head"
               :command-args "2"
-              :result ("one" "two")}
+              :result ["one" "two"]}
              )
           "Should parse a real command, correctly match it, and execute it"))))


Removed unused set-val! macro from c.c.algorithms.titanic

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

--- src/conexp/contrib/algorithms/titanic.clj
+++ src/conexp/contrib/algorithms/titanic.clj
@@ -14,11 +14,6 @@
  not tune for speed but for flexibility.")

 ;;; Pragmatics
-
-(defmacro- set-val!
-  "Sets (via set!) the value for key in map to val."
-  [map key val]
-  `(set! ~map (assoc ~map ~key ~val)))

 (defn- minimum
   "Computes the minimum of weights in a given sequence of


CMR-2482: Added function to fetch tag associaitons when indexing collection

--- indexer-app/src/cmr/indexer/data/concepts/collection.clj
+++ indexer-app/src/cmr/indexer/data/concepts/collection.clj
@@ -20,6 +20,7 @@
             [cmr.indexer.data.concepts.organization :as org]
             [cmr.acl.core :as acl]
             [cmr.common.concepts :as concepts]
+            [cmr.transmit.metadata-db :as mdb]
             [cmr.umm.collection :as umm-c]
             [cmr.umm.collection.entry-id :as eid]
             [cmr.common-app.services.kms-fetcher :as kf])
@@ -49,6 +50,20 @@
   nil if none exists."
   [personnel]
   (first (filter person->email-contact personnel)))
+
+(defn- get-tag-associations-for-collection
+  "Get all the tag associations for a collection"
+  [context concept]
+  (let [params {:associated-concept-id (:concept-id concept)
+                :exclude-metadata true
+                :latest true}
+        tag-associations (mdb/find-concepts context params :tag-association)]
+    (proto/save 1)
+    ;; we only want the tag associations that have no associated revision id or one equal to the
+    ;; revision of this collection
+    (filter (fn [ta] (let [rev-id (:associated-revision-id ta)]
+                       (or (nil? rev-id)
+                           (= (rev-id (:revision-id concept)))))))))

 (defn- get-elastic-doc-for-full-collection
   "Get all the fields for a normal collection index operation."
@@ -106,8 +121,11 @@
         insert-time (get-in collection [:data-provider-timestamps :insert-time])
         insert-time (f/unparse (f/formatters :date-time) insert-time)
         spatial-representation (get-in collection [:spatial-coverage :spatial-representation])
-        permitted-group-ids (acl/get-coll-permitted-group-ids context provider-id collection)]
-    (merge {:concept-id concept-id
+        permitted-group-ids (acl/get-coll-permitted-group-ids context provider-id collection)
+        tag-associations (get-tag-associations-for-collection context concept)
+        elastic-version-id (apply max (:transaction-id concept) (map :transaction-id tag-associations))]
+    (merge {:elastic-version-id elastic-version-id
+            :concept-id concept-id
             :revision-id revision-id
             :concept-seq-id (:sequence-number (concepts/parse-concept-id concept-id))
             :native-id native-id
@@ -230,4 +248,3 @@
   (if (:deleted concept)
     (get-elastic-doc-for-tombstone-collection context concept)
     (get-elastic-doc-for-full-collection context concept collection)))
-


Prepare live demo with new focus manager

--- src/flatgui/samples/forms/fdemowindow.clj
+++ src/flatgui/samples/forms/fdemowindow.clj
@@ -42,211 +42,188 @@

 ;; Panel 1 for win 1

-(def panel-1
-  (fg/defcomponent
-    panel/panel
+(def title-1 "Focus 1 - ")
+
+(fg/defevolverfn window-text-evolver :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-1 (:mode focus-state) "/" (:focused-child focus-state))))
+
+(def title-2 "Focus 2 - ")
+
+(fg/defevolverfn window-text-evolver-2 :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-2 (:mode focus-state) "/" (:focused-child focus-state))))
+
+(def title-3 "Focus 3 - ")
+
+(fg/defevolverfn window-text-evolver-3 :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-3 (:mode focus-state) "/" (:focused-child focus-state))))
+
+(def title-4 "Focus 4 - ")
+
+(fg/defevolverfn window-text-evolver-4 :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-4 (:mode focus-state) "/" (:focused-child focus-state))))
+
+(def title-5 "Focus 5 - ")
+
+(fg/defevolverfn window-text-evolver-5 :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-5 (:mode focus-state) "/" (:focused-child focus-state))))
+
+(def title-6 "Focus 6 - ")
+
+(fg/defevolverfn window-text-evolver-6 :text
+  (let [focus-state (get-property [:this] :focus-state)]
+    (str title-6 (:mode focus-state) "/" (:focused-child focus-state))))
+
+
+(def focus-window
+  (fg/defcomponent
+    window/window
     :hello
-    {:clip-size (m/defpoint 4 4)
-     :position-matrix (m/translation 1 2)}
-
-    (fg/defcomponent textfield/textfield :entry1
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 0.75)
-       :evolvers {:model tf-model-evolver}})
-
-    (fg/defcomponent textfield/textfield :entry2
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.25)
-       :evolvers {:model tf-model-evolver}})
-
-    (fg/defcomponent textfield/textfield :entry3
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.75)
-       :evolvers {:model tf-model-evolver}})))
-
-
-(def title-1 "Focus 1 - ")
-
-(fg/defevolverfn window-text-evolver :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-1 (:mode focus-state) "/" (:focused-child focus-state))))
-
-(def title-2 "Focus 2 - ")
-
-(fg/defevolverfn window-text-evolver-2 :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-2 (:mode focus-state) "/" (:focused-child focus-state))))
-
-(def title-3 "Focus 3 - ")
-
-(fg/defevolverfn window-text-evolver-3 :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-3 (:mode focus-state) "/" (:focused-child focus-state))))
-
-(def title-4 "Focus 4 - ")
-
-(fg/defevolverfn window-text-evolver-4 :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-4 (:mode focus-state) "/" (:focused-child focus-state))))
-
-(def title-5 "Focus 5 - ")
-
-(fg/defevolverfn window-text-evolver-5 :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-5 (:mode focus-state) "/" (:focused-child focus-state))))
-
-(def title-6 "Focus 6 - ")
-
-(fg/defevolverfn window-text-evolver-6 :text
-  (let [focus-state (get-property [:this] :focus-state)]
-    (str title-6 (:mode focus-state) "/" (:focused-child focus-state))))
-
-
-(def focus-window
-  (fg/defcomponent
-    window/window
-    :hello
-    {:clip-size (m/defpoint 7 7)
-     :position-matrix (m/translation 1 0.25)
+    {:clip-size (m/defpoint 4 4.5)
+     :position-matrix (m/translation 0.125 0.125)
      :text title-1
      :evolvers {:text window-text-evolver}}

     (fg/defcomponent textfield/textfield :entry1
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 0.75)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 0.5)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent textfield/textfield :entry2
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.25)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 1.0)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent textfield/textfield :entry3
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.75)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 1.5)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent panel/panel :panel1
-      {:clip-size (m/defpoint 3.0 3.0)
-       :position-matrix (m/translation 0.25 2.5)
+      {:clip-size (m/defpoint 1.0 2.375)
+       :position-matrix (m/translation 0.125 2.0)
        :look container-look})

     (fg/defcomponent panel/panel :panel2
-      {:clip-size (m/defpoint 3.0 3.0)
-       :position-matrix (m/translation 3.5 2.5)
+      {:clip-size (m/defpoint 2.625 2.375)
+       :position-matrix (m/translation 1.25 2.0)
        :look container-look}

          (fg/defcomponent panel/panel :panel2-1
-           {:clip-size (m/defpoint 2.75 1.0)
-            :position-matrix (m/translation 0.125 0.5)
+           {:clip-size (m/defpoint 2.375 0.875)
+            :position-matrix (m/translation 0.125 0.375)
             :look container-look}

            (fg/defcomponent textfield/textfield :entry1
-             {:clip-size (m/defpoint 1.125 0.375)
-              :position-matrix (m/translation 0.125 0.5)
+             {:clip-size (m/defpoint 1.0 0.375)
+              :position-matrix (m/translation 0.125 0.375)
               :evolvers {:model tf-model-evolver}})

            (fg/defcomponent textfield/textfield :entry2
-             {:clip-size (m/defpoint 1.125 0.375)
-              :position-matrix (m/translation 1.5 0.5)
+             {:clip-size (m/defpoint 1.0 0.375)
+              :position-matrix (m/translation 1.25 0.375)
               :evolvers {:model tf-model-evolver}}))

          (fg/defcomponent panel/panel :panel2-2
-           {:clip-size (m/defpoint 2.75 1.0)
-            :position-matrix (m/translation 0.125 1.625)
+           {:clip-size (m/defpoint 2.375 0.875)
+            :position-matrix (m/translation 0.125 1.375)
             :look container-look}

            (fg/defcomponent textfield/textfield :entry1
-             {:clip-size (m/defpoint 1.125 0.375)
-              :position-matrix (m/translation 0.125 0.5)
+             {:clip-size (m/defpoint 1.0 0.375)
+              :position-matrix (m/translation 0.125 0.375)
               :evolvers {:model tf-model-evolver}})

            (fg/defcomponent textfield/textfield :entry2
-             {:clip-size (m/defpoint 1.125 0.375)
-              :position-matrix (m/translation 1.5 0.5)
+             {:clip-size (m/defpoint 1.0 0.375)
+              :position-matrix (m/translation 1.25 0.375)
               :evolvers {:model tf-model-evolver}})))))

 (def focus-window-2
   (fg/defcomponent
     window/window
     :hello2
-    {:clip-size (m/defpoint 7 7)
-     :position-matrix (m/translation 9 0.25)
+    {:clip-size (m/defpoint 3.375 5)
+     :position-matrix (m/translation 4.25 0.125)
      :text title-2
      :evolvers {:text window-text-evolver-2}}

     (fg/defcomponent textfield/textfield :entry1
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 0.75)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 0.5)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent textfield/textfield :entry2
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.25)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 1.0)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent textfield/textfield :entry3
-      {:clip-size (m/defpoint 3.0 0.375)
-       :position-matrix (m/translation 0.25 1.75)
+      {:clip-size (m/defpoint 1.0 0.375)
+       :position-matrix (m/translation 0.125 1.5)
        :evolvers {:model tf-model-evolver}})

     (fg/defcomponent panel/panel :panel1
-      {:clip-size (m/defpoint 6.5 4.0)
-       :position-matrix (m/translation 0.25 2.5)
+      {:clip-size (m/defpoint 3.125 2.875)
+       :position-matrix (m/translation 0.125 2.0)
        :look container-look}

       (fg/defcomponent textfield/textfield :entry1-1
-        {:clip-size (m/defpoint 1.5 0.375)
-         :position-matrix (m/translation 0.125 0.5)
+        {:clip-size (m/defpoint 1.0 0.375)
+         :position-matrix (m/translation 0.125 0.375)
          :evolvers {:model tf-model-evolver}})

       (fg/defcomponent textfield/textfield :entry1-2
-        {:clip-size (m/defpoint 1.5 0.375)
-         :position-matrix (m/translation 1.75 0.5)
+        {:clip-size (m/defpoint 1.0 0.375)
+         :position-matrix (m/translation 1.25 0.375)
          :evolvers {:model tf-model-evolver}})

-           (fg/defcomponent panel/panel :panel1-1
-             {:clip-size (m/defpoint 6.25 2.75)
-              :position-matrix (m/translation 0.125 1.125)
-              :look container-look}
-
-             (fg/defcomponent panel/panel :panel1-1-1
-               {:clip-size (m/defpoint 3.0 2.25)
-                :position-matrix (m/translation 0.125 0.375)
-                :look container-look})
-
-             (fg/defcomponent panel/panel :panel1-1-2
-               {:clip-size (m/defpoint 2.875 2.25)
-                :position-matrix (m/translation 3.25 0.375)
-                :look container-look}
-
-               (fg/defcomponent panel/panel :panel1-1-2-1
-                 {:clip-size (m/defpoint 2.625 1.5)
-                  :position-matrix (m/translation 0.125 0.5)
-                  :look container-look}
-
-               (fg/defcomponent textfield/textfield :entry1-1-2-1
-                 {:clip-size (m/defpoint 1.5 0.375)
-                  :position-matrix (m/translation 0.125 0.5)
-                  :evolvers {:model tf-model-evolver}})))))))
+      (fg/defcomponent panel/panel :panel1-1
+        {:clip-size (m/defpoint 2.875 1.875)
+         :position-matrix (m/translation 0.125 0.875)
+         :look container-look}
+
+        (fg/defcomponent panel/panel :panel1-1-1
+          {:clip-size (m/defpoint 1.0 1.375)
+           :position-matrix (m/translation 0.125 0.375)
+           :look container-look})
+
+        (fg/defcomponent panel/panel :panel1-1-2
+          {:clip-size (m/defpoint 1.5 1.375)
+           :position-matrix (m/translation 1.25 0.375)
+           :look container-look}
+
+          (fg/defcomponent panel/panel :panel1-1-2-1
+            {:clip-size (m/defpoint 1.25 0.875)
+             :position-matrix (m/translation 0.125 0.375)
+             :look container-look}
+
+          (fg/defcomponent textfield/textfield :entry1-1-2-1
+            {:clip-size (m/defpoint 1.0 0.375)
+             :position-matrix (m/translation 0.125 0.375)
+             :evolvers {:model tf-model-evolver}})))))))

 (def focus-window-3
   (fg/defcomponent
     window/window
     :hello3
-    {:clip-size (m/defpoint 7 3.25)
-     :position-matrix (m/translation 1 7.5)
+    {:clip-size (m/defpoint 4 2.5)
+     :position-matrix (m/translation 0.125 5.25)
      :text title-3
      :evolvers {:text window-text-evolver-3}}

     (fg/defcomponent panel/panel :panel
-      {:clip-size (m/defpoint 6.75 2.5)
+      {:clip-size (m/defpoint 3.5 1.875)
        :position-matrix (m/translation 0.125 0.5)
        :look container-look}

       (fg/defcomponent panel/panel :panel1
-        {:clip-size (m/defpoint 3.0 0.875)
-         :position-matrix (m/translation 0.25 0.75)
+        {:clip-size (m/defpoint 3.25 0.875)
+         :position-matrix (m/translation 0.125 0.375)
          :look container-look}

         (fg/defcomponent textfield/textfield :entry1-1
@@ -255,26 +232,26 @@
                           :evolvers {:model tf-model-evolver}}))

       (fg/defcomponent textfield/textfield :entry1
-        {:clip-size (m/defpoint 1.5 0.375)
-         :position-matrix (m/translation 0.125 1.75)
+        {:clip-size (m/defpoint 1.0 0.375)
+         :position-matrix (m/translation 0.125 1.375)
          :evolvers {:model tf-model-evolver}})

       (fg/defcomponent textfield/textfield :entry2
-        {:clip-size (m/defpoint 1.5 0.375)
-         :position-matrix (m/translation 1.75 1.75)
+        {:clip-size (m/defpoint 1.0 0.375)
+         :position-matrix (m/translation 1.25 1.375)
          :evolvers {:model tf-model-evolver}})

       (fg/defcomponent textfield/textfield :entry3
-        {:clip-size (m/defpoint 1.5 0.375)
-         :position-matrix (m/translation 3.375 1.75)
+        {:clip-size (m/defpoint 1.0 0.375)
+         :position-matrix (m/translation 2.375 1.375)
          :evolvers {:model tf-model-evolver}}))))

 (def focus-window-4
   (fg/defcomponent
     window/window
     :hello4
-    {:clip-size (m/defpoint 7.0 2.0)
-     :position-matrix (m/translation 9 7.5)
+    {:clip-size (m/defpoint 3.375 2.0)
+     :position-matrix (m/translation 4.25 5.25)
      :text title-4
      :evolvers {:text window-text-evolver-4}}

@@ -297,8 +274,8 @@
   (fg/defcomponent
     window/window
     :hello5
-    {:clip-size (m/defpoint 4.25 1.625)
-     :position-matrix (m/translation 9 9.75)
+    {:clip-size (m/defpoint 4 1.5)
+     :position-matrix (m/translation 0.125 7.875)
      :text title-5
      :evolvers {:text window-text-evolver-5}}

@@ -316,8 +293,8 @@
   (fg/defcomponent
     window/window
     :hello6
-    {:clip-size (m/defpoint 4.25 1.625)
-     :position-matrix (m/translation 13.5 9.75)
+    {:clip-size (m/defpoint 3.375 1.0)
+     :position-matrix (m/translation 4.25 7.875)
      :text title-6
      :evolvers {:text window-text-evolver-6}}

@@ -331,7 +308,7 @@
   (fg/defcomponent
     panel/panel
     :main
-    {:clip-size (m/defpoint 40 25)
+    {:clip-size (m/defpoint 7.75 9.5)
      :background (awt/color 9 17 26)

      ;; TODO this should be a part defroot probably


Solved 5.4 and translated fpins solution as well

--- src/fpinscala/strictness_and_laziness.clj
+++ src/fpinscala/strictness_and_laziness.clj
@@ -90,4 +90,20 @@
 (defn exists
   "Function exists via fold-right from fpins"
   [p s]
-  (fold-right false #(or (p %) %2) s))+  (fold-right false #(or (p %) %2) s))
+
+;5.4
+;mine
+(defn for-all
+  "forAll for 5.4 in FPINS, it is lazy but much more verbose than fpins solution and I shoul have noticed f-r should be used!"
+  [p s]
+  (let [[h & t] s]
+    (if t
+      (and (p h) (for-all p t))
+      (p h))))
+;fpins
+(defn for-all-fpins
+  "forAll as in fpins, I should have observed that f-r should be used! But mine works as well and it is lazy also"
+  [p s]
+  (fold-right true #(and (p %) %2) s))
+;-----------------------------------------------------------------------


Better test name

Better test name

--- test/caesium/binding_test.clj
+++ test/caesium/binding_test.clj
@@ -63,9 +63,9 @@

 (declare check-method check-const-method)

-(deftest byte-pinning-test
   (doseq [method (spy (.getMethods Sodium))]
     (info method)
+(deftest interface-test
     (if-let [params (seq (.getParameters ^Method method))]
       (check-method method params)
       (check-const-method method))))


Add tests for destructuring in protocol fns, refs #141

--- test/cljs/cljs/core_test.cljs
+++ test/cljs/cljs/core_test.cljs
@@ -985,5 +985,35 @@
   (assert (= (hash {:start 133 :end 134})
              (hash (apply hash-map [:start 133 :end 134]))))

+  (defprotocol IHasFirst
+    (-get-first [this]))
+
+  (defprotocol IFindsFirst
+    (-find-first [this other]))
+
+  (deftype First [xs]
+    ISeqable
+    (-seq [this] (seq xs))
+    IIndexed
+    (-nth [this i] (nth xs i))
+    (-nth [this i not-found] (nth xs i not-found))
+    IFn
+    (-invoke [[x]] x)
+    Object
+    (toString [[x]] (str x))
+    IHasFirst
+    (-get-first [[x]] x)
+    IFindsFirst
+    (-find-first [_ [x]] x))
+
+  (let [fv (First. [1 2 3])
+        fs (First. "asdf")]
+    (assert (= (fv) 1))
+    (assert (= (fs) \a))
+    (assert (= (str fs) \a))
+    (assert (= (-get-first fv) 1))
+    (assert (= (-get-first fs) \a))
+    (assert (= (-find-first fv [1]) 1)))
+
   :ok
   )


update test

update test

--- test/kaleido/core_test.clj
+++ test/kaleido/core_test.clj
@@ -13,7 +13,6 @@

 (def web-http-url (str host "/"))
 (def web-csrf-url (str host "/csrf"))
-
 (def manager-test-url (str host manager-url))
 (def manager-auth-test-url (str host manager-url "/auth/login"))
 (def project-test-url (str host manager-url "/projects"))


Fixes #24

Fixes #24

Both ways work but this one is certainly more common.

--- test/clojurewerkz/cassaforte/test_helper.clj
+++ test/clojurewerkz/cassaforte/test_helper.clj
@@ -40,8 +40,9 @@
   (f)
   (drop-keyspace :new_cql_keyspace))

-(defmacro test-combinations [& body]
+(defmacro test-combinations
   "Run given queries in both plain and prepared modes."
+  [& body]
   `(do
      ~@body
      (client/prepared ~@body)))


Updated blog and links pages

Updated blog and links pages

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

--- src/main/cljs/clojurebridgemn/client.cljs
+++ src/main/cljs/clojurebridgemn/client.cljs
@@ -845,6 +845,10 @@
      ;; [:i [:a {:href "https://www.eventbrite.com/e/clojurebridge-mn-fallwinter-2015-tickets-19159690149"} "Sign up now"]]
      ;;  " for our Fall/Winter workshop November 13-14!"
      "Our next ClojureBridgeMN workshop is scheduled for 11/4-5"
+     [:br]
+     "Sign up NOW on "
+     [:a {:href "http://clojurebridgemn-2016.eventbrite.com"} "Eventbrite"]
+     " !"
      ;; "Stay tuned for more information about our upcoming workshop at "
      ;; [:a {:href "http://vidku.com"} "Vidku"]
      ;; " on September 11-12!"
@@ -856,7 +860,7 @@
      [:br]
      "Join us for our next "
      [:a {:href "http://www.meetup.com/clojuremn/"} "clojure.mn"]
-     " meeting on October 12th!"
+     " meeting on November 9th!"
      [:br]
      [:br]
      ]
@@ -883,13 +887,9 @@
       [:li "Global " [:a {:href "http://clojurebridge.org"} "ClojureBridge"] " organization"]
       [:li "Contact us at info@ClojureBridgeMN.org"]
       [:li "Local " [:a {:href "http://www.meetup.com/clojuremn/"} "clojure.mn"] " user group (meets every 2nd Wednesday)"]
-      [:li "ClojureBridge "
-       [:a {:href "http://bit.ly/cb-mn"} "installfest"] " and "
-       [:a {:href "https://github.com/ClojureBridge/getting-started/blob/master/nightcode.md"} "Nightcode"]
-       " guides"]
-      [:li "Our " [:a {:href "https://github.com/clojurebridge-minneapolis/track1-chatter"} "Track 1"] " guide"]
-      [:li "Our " [:a {:href "https://github.com/clojurebridge-minneapolis/track2-functional"} "Track 2"] " guide"]
-      ]]
+      [:li "ClojureBridgeMN "
+       [:a {:href "http://bit.ly/cb-mn"} "Documentation"]]
+       ]]
     }
    :board
    {:debug


make resolve-symbol a public :dynamic function

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -500,7 +500,7 @@
         (set! gensym-env (assoc gensym-env sym gs))
         gs)))

-(defn- resolve-symbol [s]
+(defn ^:dynamic resolve-symbol [s]
   (if (pos? (.indexOf (name s) "."))
     s
     (if-let [ns-str (namespace s)]


improve comment

improve comment

--- src/re_frame/subs.cljs
+++ src/re_frame/subs.cljs
@@ -17,7 +17,7 @@

 (defn subscribe
-  "returns a reagent/reaction which observes a part of the "
+  "returns a reagent/reaction which observes a part of app-db"
   [v]
   (let [key-v       (first-in-vector v)
         handler-fn  (get @key->fn key-v)]


(TK-300) Refactor boot-services* for easier testing

This commit refactors `boot-services*` to separate the logic for
creating the app from the logic for booting the services.  This
should make it easier to write tests that having timing concerns
related to service boot-up.

--- src/puppetlabs/trapperkeeper/internal.clj
+++ src/puppetlabs/trapperkeeper/internal.clj
@@ -513,9 +513,9 @@
             (deliver shutdown-reason-promise {:cause :service-error
                                               :error t})))))))

-(schema/defn ^:always-validate boot-services**
+(schema/defn ^:always-validate boot-services-for-app**
   "Boots services for a TK app.  WARNING:  This should only ever be called
-  on the lifecycle-worker, presumably via `boot-services*`"
+  on the lifecycle-worker, presumably via `boot-services-for-app*`"
   [result-promise :- IDeref
    app :- (schema/protocol a/TrapperkeeperApp)]
   (let [{:keys [shutdown-reason-promise]} @(a/app-context app)]
@@ -527,6 +527,15 @@
                                           :error t})))
     (deliver result-promise app)))

+(schema/defn ^:always-validate boot-services-for-app* :- (schema/protocol a/TrapperkeeperApp)
+  [app :- (schema/protocol a/TrapperkeeperApp)]
+  (let [lifecycle-channel (:lifecycle-channel @(a/app-context app))
+        lifecycle-promise (promise)
+        boot-fn (partial boot-services-for-app** lifecycle-promise app)]
+    (async/>!! lifecycle-channel boot-fn)
+    @lifecycle-promise
+    app))
+
 (schema/defn ^:always-validate boot-services* :- (schema/protocol a/TrapperkeeperApp)
   "Given the services to run and the map of configuration data, create the
   TrapperkeeperApp and boot the services.  Returns the TrapperkeeperApp."
@@ -537,12 +546,8 @@
                                               config-data-fn)
                                   (catch Throwable t
                                     (log/error t "Error during app buildup!")
-                                    (throw t)))
-        lifecycle-channel (:lifecycle-channel @(a/app-context app))
-        lifecycle-promise (promise)
-        boot-fn (partial boot-services** lifecycle-promise app)]
-    (async/>!! lifecycle-channel boot-fn)
-    @lifecycle-promise
+                                    (throw t)))]
+    (boot-services-for-app* app)
     app))


(maint) delete errant ':else' in 'condp'

This was syntactically incorrect; 'condp' simply uses the last form passed to it
as a default if none of the other forms are matched.

--- src/puppetlabs/trapperkeeper/internal.clj
+++ src/puppetlabs/trapperkeeper/internal.clj
@@ -77,7 +77,6 @@
                                           (:service-name error-info))))
         (throw e))

-      :else
       (throw e))))

 (defn compile-graph


remove dead code

remove dead code

--- src/clj/lambdacd/internal/execution.clj
+++ src/clj/lambdacd/internal/execution.clj
@@ -62,7 +62,6 @@
   (let [is-killed     (:is-killed ctx)
         step-id       (:step-id ctx)
         build-number  (:build-number ctx)
-        result-ch     (:result-channel ctx)
         subscription  (event-bus/subscribe ctx :kill-step)
         kill-payloads (event-bus/only-payload subscription)]
     (async/go-loop []


Formatting

Formatting

--- src/cljs/cglossa/search_inputs/cwb.cljs
+++ src/cljs/cglossa/search_inputs/cwb.cljs
@@ -3,11 +3,13 @@
             [reagent.core :as reagent]))

 (defn- phrase->cqp [phrase phonetic?]
-  (let [attr (if phonetic? "phon" "word")
+  (let [attr                (if phonetic? "phon" "word")
         chinese-chars-range "[\u4E00-\u9FFF\u3400-\u4DFF\uF900-\uFAFF]"
         ; Surround every Chinese character by space when constructing a cqp query,
         ; to treat it as if it was an individual word:
-        phrase (str/replace phrase (re-pattern (str "(" chinese-chars-range ")")) " $1 ")]
+        phrase              (str/replace phrase
+                                         (re-pattern (str "(" chinese-chars-range ")"))
+                                         " $1 ")]
     (->> (str/split phrase #"\s")
          (map #(if (= % "")
                 ""
@@ -29,11 +31,11 @@
     (swap! query-cursor assoc-in [:query] query)))

 (defn- on-phonetic-changed [event query-cursor]
-  (let [query (:query @query-cursor)
+  (let [query    (:query @query-cursor)
         checked? (aget event "target" "checked")
-        query (if checked?
-                (str/replace query "word=" "phon=")
-                (str/replace query "phon=" "word="))]
+        query    (if checked?
+                   (str/replace query "word=" "phon=")
+                   (str/replace query "phon=" "word="))]
     (swap! query-cursor assoc-in [:query] query)))

 (defn- on-key-down [event query-cursor]
@@ -46,7 +48,7 @@
 ;;;;;;;;;;;;;

 (defn- search-button [multilingual?]
-  [:button.btn.btn-success {:style {:marginLeft (if multilingual? 80 40)}
+  [:button.btn.btn-success {:style    {:marginLeft (if multilingual? 80 40)}
                             :on-click search!} "Search"])

 (defn- add-language-button []
@@ -61,10 +63,9 @@
      [:option {:key (:value language) :value (:value language)} (:text language)])])

 (defn- simple [query-cursor]
-  [:span "hallo"]
-  (let [query (:query @query-cursor)
+  (let [query           (:query @query-cursor)
         displayed-query (str/replace query #"\[\(?\w+=\"(.+?)\"(?:\s+%c)?\)?\]" "$1")
-        phonetic? (not= -1 (.indexOf query "phon="))]
+        phonetic?       (not= -1 (.indexOf query "phon="))]
     [:div.row-fluid
      [:form.form-inline.span12
       [:div.span10
@@ -83,11 +84,11 @@
   [:span])

 (defn search-inputs [{:keys [search-view search-queries]} {:keys [corpus]}]
-  (let [view (case @search-view
-               :extended extended
-               :cqp cqp
-               simple)
-        languages (:langs @corpus)
+  (let [view          (case @search-view
+                        :extended extended
+                        :cqp cqp
+                        simple)
+        languages     (:langs @corpus)
         multilingual? (> (count languages) 1)]
     [:span
      [:div.row-fluid.search-input-links
@@ -109,7 +110,7 @@
      ; and display a row of search inputs for each of them. The doall call is needed
      ; because ratoms cannot be derefed inside lazy seqs.
      (doall (for [index (range (count @search-queries))]
-              (let [query-cursor (reagent/cursor search-queries [index])
+              (let [query-cursor      (reagent/cursor search-queries [index])
                     selected-language (-> @query-cursor :query :lang)]
                 (when multilingual? [language-select languages selected-language])
                 [view query-cursor multilingual?])))


Fix various issues exposed by devcards

Fix various issues exposed by devcards

--- src/cljs/comic_reader/ui/waypoints.cljs
+++ src/cljs/comic_reader/ui/waypoints.cljs
@@ -20,7 +20,7 @@
 (defn- get-offset-position [node offset]
   (cond
     (number? offset)  offset
-    (string? offset)  (as-percentage (.innerHeight node) offset)
+    (string? offset)  (as-percentage (.-clientHeight node) offset)
     (fn? offset)      (offset node)
     :else             0))

@@ -35,7 +35,7 @@
   (fn [this]
     (swap! waypoints assoc-in
            [id :trigger-point]
-           (get-node-position-at-offset (reagent/dom-node this) (:offset options)))))
+           (get-node-position-at-offset (reagent/dom-node this) (:offset @options)))))

 (defn waypoint
   ([child-el] (waypoint {} child-el))
@@ -49,6 +49,7 @@
        :component-will-mount
        (fn []
          (swap! waypoints assoc id {:options options}))
+
        :component-will-unmount
        (fn []
          (swap! waypoints dissoc id))
@@ -57,7 +58,7 @@
        :component-did-update reset-trigger-point!

        :reagent-render
-       (fn [child-el opts]
+       (fn [opts child-el]
          (reset! options opts)
          child-el)}))))


make container function

make container function

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -151,3 +151,33 @@
         ]
     (set-pivot! container (* xhandle width) (* yhandle height))
     container))
+
+(defn make-container
+  [children & {:keys [x y xhandle yhandle scale alpha
+                      rotation tint visible
+                      mousemove mousedown mouseup mouseupoutside
+                      touchmove touchdown touchup touchupoutside
+                      buttonmode]
+               :or {x 0 y 0
+                    xhandle 0.5 yhandle 0.5
+                    scale 1
+                    alpha 1
+                    rotation 0}}]
+  (let [container (js/PIXI.Container.)]
+    (assert container "creation of container failed and returned nil")
+    (set! (.-x container) x)
+    (set! (.-y container) y)
+    (set! (.-rotation container) rotation)
+    (set! (.-visible container) visible)
+    (when-not (= scale 1)
+      (set! (.-scale container)
+            (if (number? scale)
+              (make-point scale scale)
+              (make-point (get scale 0) (get scale 1)))))
+    (when-not (= 1 alpha)
+      (set! (.-alpha container) alpha))
+    (when tint (set! (.-tint container) tint))
+
+    (doseq [child children] (.addChild container child))
+    (update-container-handle container :xhandle xhandle :yhandle yhandle)
+    container))


bench

bench

--- src/cljs/triboard/logic/transition.cljs
+++ src/cljs/triboard/logic/transition.cljs
@@ -121,9 +121,7 @@
   []
   (let [b (board/new-board)
         t (all-transitions b)]
-    (time (dotimes [i 100]
-            (all-transitions b)
-            ))
+    (time (dotimes [i 100] (all-transitions b)))
     (time (dotimes [i 100]
             (doall
               (map


Throw exception when shared library cannot be loaded by LoaderUtils

--- src/clojure/gpu/matrix/loader_utils.clj
+++ src/clojure/gpu/matrix/loader_utils.clj
@@ -66,9 +66,17 @@
               current-time (.. (new java.util.Date) (getTime))
               tmp-lib-path (str tmp-dir
                                 current-time ; to prevent duplication
-                                "lib" lib-name lib-extension)]
-          (with-open [in (ClassLoader/getSystemResourceAsStream
+                                "lib" lib-name lib-extension)
+              input-stream
+              (ClassLoader/getSystemResourceAsStream
                            (str SHARED-LIB-PATH "lib" lib-name lib-extension))]
+          ; throws an exception if the input stream cannot be opened!
+          ; eg: no permission or file not found
+          (when (nil? input-stream)
+            (throw (new UnsatisfiedLinkError
+                        (str "Cannot open shared library in java.library.path "
+                             "or resource-path!"))))
+          (with-open [in input-stream]
             (with-open [out (io/output-stream tmp-lib-path)]
               (io/copy in out)))
           (System/load tmp-lib-path)


that protocol was a bad idea - you need to have your own Registrator type.

--- src/clojure/sparkling/serialization.clj
+++ src/clojure/sparkling/serialization.clj
@@ -132,10 +132,6 @@

   )

-(defprotocol RegistrationProtocol
-  (register-classes [#^KryoRegistrator registrator #^Kryo kryo]))
-
-
 (deftype Registrator []
   KryoRegistrator
   (#^void registerClasses [#^KryoRegistrator this #^Kryo kryo]
@@ -144,11 +140,17 @@
       (require 'clojure.tools.logging)
       (require 'carbonite.api)
       (require 'sparkling.serializers)
-      ; (.setRegistrationRequired kryo true)
       (register-base-classes kryo)
-      (register-classes this kryo)                          ;; this is our extension point! extend-type this with the RegistrationProtocol to register your own classes.

       (catch Exception e
+        (try
+          (log/warn (str "Error registering serializer" this) e)
+          (catch Exception e1
+            ;(binding [*out* *err*]
+              (println "Failed to not log properly the expetion " e " while registering classes from " this " to " kryo ".\nLogging failure was " e1 ".")
+            ;)
+            (.printStackTrace e)
+            ))
         (throw (RuntimeException. "Failed to register kryo!" e))))))


Add float to mad.

Add float to mad.

--- src/clojush/pushgp/parent_selection.clj
+++ src/clojush/pushgp/parent_selection.clj
@@ -77,7 +77,7 @@
   (let [; Get median of x
         x-median (median x)
         ; calculate absolute deviation from median
-        dev (map #(Math/abs (- % x-median))
+        dev (map #(Math/abs (float (- % x-median)))
                  x)]
     (median dev)))

@@ -238,3 +238,4 @@
     selected))

+


Removing inherit-multimethod...

Removing inherit-multimethod...

--- src/conexp/contrib/gui/editors/util.clj
+++ src/conexp/contrib/gui/editors/util.clj
@@ -23,6 +23,7 @@
     conexp.contrib.gui.util
     conexp.util
     conexp.util.hookable
+    conexp.util.typecheck
     conexp.util.multimethods
     [clojure.contrib.string :only (join split-lines split)]
     [clojure.set :only (union)]))
@@ -259,48 +260,40 @@
       (if (managed-by-conexp-gui-editors-util? obj) (:control obj) obj))))

-(inherit-multimethod get-size ::widget
+(defn-typecheck-swing get-size ::widget
   "Returns the size of the given widget.

    Parameters:
-     obj         _widget")
-
-(defmethod-swing get-size ::widget
+     obj         _widget"
   [obj]
   (bean (.getSize (get-widget obj))))

-(inherit-multimethod set-size ::widget
+(defn-typecheck-swing-threads* set-size ::widget
   "Sets the size of the given widget.

    Parameters:
      obj         _widget
      width       _width
-     height      _height")
-
-(defmethod-swing-threads* set-size ::widget
+     height      _height"
   [obj width height]
   (.setSize (get-widget obj) (Dimension. width height)))

-(inherit-multimethod set-width ::widget
+(defn-typecheck set-width ::widget
   "Sets the width of the given widget.

    Parameters:
      obj         _widget
-     width       _width")
-
-(defmethod set-width ::widget
+     width       _width"
   [obj width]
   (let [ height (:height (get-size obj)) ]
     (set-size obj width height)))

-(inherit-multimethod set-height ::widget
+(defn-typecheck set-height ::widget
   "Sets the height of the given widget.

    Parameters:
      obj         _widget
-     height      _height")
-
-(defmethod set-height ::widget
+     height      _height"
   [obj height]
   (let [ width (:width (get-size obj)) ]
     (set-size obj width height)))
@@ -325,14 +318,11 @@
 (defrecord button [widget])
 (derive* ::button ::widget)

-(inherit-multimethod set-handler ::button
+(defn-typecheck-swing-threads* set-handler ::button
   "Sets the action handler for the button object.
   Parameters:
     obutton    _button object
-    handler    _0-ary function that will be called on button press")
-
-(defmethod-swing-threads*
-  set-handler ::button
+    handler    _0-ary function that will be called on button press"
   [obutton handler]
   (let [ button (get-widget obutton)
          current-handlers (.getActionListeners button)
@@ -371,14 +361,11 @@
 (defrecord split-pane [widget])
 (derive* ::split-pane ::widget)

-(inherit-multimethod set-divider-location ::split-pane
+(defn-typecheck-swing-threads* set-divider-location ::split-pane
   "Sets the location of the divider.
    Parameters:
      osplit-pane _split-pane object
-     location    _location of the divider (nbr of pixels from left/top)")
-
-(defmethod-swing-threads*
-  set-divider-location ::split-pane
+     location    _location of the divider (nbr of pixels from left/top)"
   [osplit-pane location]
   (let [split-pane (get-widget osplit-pane)]
     (.setDividerLocation split-pane location)))
@@ -416,7 +403,7 @@
 (derive* ::tree-control ::control)

-(inherit-multimethod set-tree ::tree-control
+(defn-typecheck set-tree ::tree-control
   "Sets the tree that the control displays.

    Parameters:
@@ -425,10 +412,7 @@
                     where each node is represented by a list that has
                     the node's name as first element and all its child
                     trees as rest, where each child is again represented by
-                    its respective root node")
-
-(defmethod
-  set-tree ::tree-control
+                    its respective root node"
   [otree-control tree]
   (let [ t (conj (rest tree) :root)
          treeroot (:root otree-control)
@@ -441,16 +425,13 @@
       (.reload treemodel))))

-(inherit-multimethod set-selection-mode ::tree-control
+(defn-typecheck-swing-threads* set-selection-mode ::tree-control
   "Sets the tree control's selection mode.

    Parameters:
      otree-control _tree-control object
      mode          _either :single, :multi (contiguous multiselection) or
-                    :free (free multiselection)")
-
-(defmethod-swing-threads*
-  set-selection-mode ::tree-control
+                    :free (free multiselection)"
   [otree-control mode]
   (let [ treecontrol (get-control otree-control)
          selection-model (.getSelectionModel treecontrol)]
@@ -461,7 +442,7 @@
         mode))))

-(inherit-multimethod set-selection-handler ::tree-control
+(defn-typecheck-swing-threads* set-selection-handler ::tree-control
   "Sets the selection-handler for the tree-control which is
    called every time the selection changes to handler.

@@ -469,10 +450,7 @@
      otree-control _tree-control object
      handler       _function that will be called with a list of the selected
                      nodes represented each by a list of labels starting
-                     from the root.")
-
-(defmethod-swing-threads*
-  set-selection-handler ::tree-control
+                     from the root."
   [otree-control handler]
   (let [ treecontrol (get-control otree-control)
          current-handlers (.getTreeSelectionListeners treecontrol)
@@ -523,58 +501,46 @@
 (derive* ::table-control :conexp.util.hookable/hookable)

-(inherit-multimethod get-row-count ::table-control
+(defn-typecheck-swing get-row-count ::table-control
   "Returns the number of rows of the table control.

   Parameters:
-    otable-control    _table-control object")
-
-(defmethod-swing
-  get-row-count ::table-control
+    otable-control    _table-control object"
   [otable-control]
   (.getRowCount (get-control otable-control)))

-(inherit-multimethod get-column-count ::table-control
+(defn-typecheck-swing get-column-count ::table-control
   "Returns the number of columns of the table control.

   Parameters:
-    otable-control    _table-control object")
-
-(defmethod-swing
-  get-column-count ::table-control
+    otable-control    _table-control object"
   [otable-control]
   (.getColumnCount (get-control otable-control)))

-(inherit-multimethod set-column-count ::table-control
+(defn-typecheck-swing set-column-count ::table-control
   "Sets the number of columns of the table control.

   Parameters:
     otable-control    _table-control object
-    count             _number of columns")
-
-(defmethod-swing
-  set-column-count ::table-control
+    count             _number of columns"
   [otable-control count]
   (.setColumnCount (:model otable-control) count))

-(inherit-multimethod set-row-count ::table-control
+(defn-typecheck-swing set-row-count ::table-control
   "Sets the number of rows of the table control.

   Parameters:
     otable-control    _table-control object
-    count             _number of rows")
-
-(defmethod-swing
-  set-row-count ::table-control
+    count             _number of rows"
   [otable-control count]
   (.setRowCount (:model otable-control) count))

-(inherit-multimethod register-keyboard-action ::table-control
+(defn-typecheck-swing-threads* register-keyboard-action ::table-control
   "Registers a keyboard action on the table.
   Parameters:
     otable     _table-control object
@@ -584,10 +550,7 @@
     keystroke  _a corresponding keystroke object
     condition  _can be either :focus, :widget, or :ancestor
                 (determines which widget has to be focused to trigger the
-                 action)")
-
-(defmethod-swing-threads*
-  register-keyboard-action ::table-control
+                 action)"
   [otable handler name keystroke condition]
   (let [ java-condition ({:focus JComponent/WHEN_FOCUSED
                           :widget JComponent/WHEN_IN_FOCUSED_WINDOW
@@ -604,15 +567,12 @@
     (.put input-map keystroke cmd-name)
     (.put action-map cmd-name action)))

-(inherit-multimethod get-column-index ::table-control
+(defn-typecheck-swing get-column-index ::table-control
   "Returns the tables model index of the specified column in the view.

   Parameters:
     otable    _table-control object
-    column    _viewport column")
-
-(defmethod-swing
-  get-column-index ::table-control
+    column    _viewport column"
   [otable column]
   (let [ table (get-control otable)
          col-count (.getColumnCount table) ]
@@ -621,16 +581,13 @@
              table-col (.getColumn col-model column) ]
         (.getModelIndex table-col)))))

-(inherit-multimethod get-index-column ::table-control
+(defn-typecheck-swing get-index-column ::table-control
  "Returns the column in the view that corresponds to the specified
   table model index.

   Parameters:
     otable    _table-control object
-    index     _table model index")
-
-(defmethod-swing
-  get-index-column ::table-control
+    index     _table model index"
   [otable index]
   (let [ table (get-control otable)
          col-model (.getColumnModel table)
@@ -642,40 +599,30 @@
     (if found found index)))

-(inherit-multimethod get-row-index ::table-control
+(defn-typecheck get-row-index ::table-control
   "Returns the tables model index of the specified row in view.
   Parameters:
-    row      _viewport row")
-
-(defmethod
-  get-row-index ::table-control
+    row      _viewport row"
   [otable row]
   row)

-(inherit-multimethod get-index-row ::table-control
+(defn-typecheck get-index-row ::table-control
   "Returns the row in the view that corresponds
   to the specified table model index.

   Parameters:
     otable    _table-control object
-    index     _table model index")
-
-(defmethod
-  get-index-row ::table-control
+    index     _table model index"
   [otable index]
   index)

-
-(inherit-multimethod get-row-index-permutator ::table-control
+(defn-typecheck get-row-index-permutator ::table-control
   "Returns a function that will map the current view rows to
    the according index values.

   Parameters:
-    otable    _table-control object")
-
-(defmethod
-  get-row-index-permutator ::table-control
+    otable    _table-control object"
   [otable] identity)


Split devcards

Split devcards

--- src/devcards/discuss/devcards/core.cljs
+++ src/devcards/discuss/devcards/core.cljs
@@ -3,13 +3,12 @@
             [cljs.test :refer-macros [testing is are]]
             [om.dom :as dom]
             [discuss.core :as core]
-            [discuss.communication :as com]
             [discuss.debug :as debug]
             [discuss.extensions]
             [discuss.find :as find]
             [discuss.integration :as integration]
+            [discuss.references :as ref]
             [discuss.utils.common :as lib]
-            [discuss.utils.views :as vlib]
             [discuss.views :as views]))

 (enable-console-print!)
@@ -38,6 +37,11 @@
             find/results-view
             lib/app-state)

+(defcard-om click-on-references
+            "Show dialog when clicking on a reference."
+            ref/dialog
+            lib/app-state)
+
 (deftest find-tests
          "Testing the small search engine in `discuss.find`"
          (testing "fn statement, sending request and counting results"
@@ -49,35 +53,4 @@
          (let [doms-raw (.getElementsByTagName js/document "*")]
            (testing "fn get-parent"
              (is (= "test-get-parent" (.-id (integration/get-parent doms-raw "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"))))
-             (is (= "figwheel-heads-up-content-area" (.-id (integration/get-parent doms-raw "")))))))
-
-(deftest lib-test
-         (testing "Convert strings to integer."
-           (is (= 4
-                 (lib/str->int "4")))
-           (is (= 9999999999999999999999999
-                  (lib/str->int "9999999999999999999999999")))
-           (is (nil? (lib/str->int "")))
-           (is (nil? (lib/str->int "foo"))))
-
-         (testing "cljs to json conversion stuff."
-           (let [json "{\"distance_name\": \"Levensthein\", \"values\": {\"00020_020\": \"Foobaraaaaaaaaaaaaaa.\", \"00033_013\": \"This is the only park in our city.\"}}"]
-             (is (= {:distance_name "Levensthein", :values {:00020_020 "Foobaraaaaaaaaaaaaaa.", :00033_013 "This is the only park in our city."}} (lib/json->clj json)))))
-
-         (testing "Get issue for uid."
-           (is (= "Elektroautos"
-                  (:title (lib/get-issue 3))))
-           (is (= "3"
-                  (:uid (lib/get-issue "Elektroautos"))))
-           (is (nil? (lib/get-issue "This should not be an issue in our app-state"))))
-
-         (testing "Get reference by id."
-           (let [refs [{:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"} {:url "api/elektroautos/justify/72/t", :uid 3, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin\n"} {:url "api/town-has-to-cut-spending/justify/73/t", :uid 4, :text "meisten Nachbarkommunen"} {:url "api/town-has-to-cut-spending/justify/74/t", :uid 5, :text "deutschen Kommunen"} {:url "api/town-has-to-cut-spending/justify/75/t", :uid 6, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin "} {:url "api/town-has-to-cut-spending/justify/76/t", :uid 7, :text "Tatsächlich ist Düsseldorf ein außergewöhnlicher Fall unter den deutschen Kommunen . Knapp 300 Millionen Euro plant die Stadt in diesem Jahr für Kinderfeste, Jugendbücher und Betreuungseinrichtungen ein, selten hat sie so viel für Familien ausgegeben. Vor ein paar Monaten wurden gar die Kindergartengebühren für Drei- bis Sechsjährige abgeschafft. Sparen muss Düsseldorf nicht, der Haushalt für das Jahr 2010 ist ausgeglichen, ein Kunststück, das der Stadt bereits zum elften Mal in Folge gelingt. Ja, mehr noch: Seit 2007 ist die Stadt schuldenfrei, inzwischen hat sie sich sogar ein ansehnliches Polster angespart.\n\nEinige Städte haben im vergangenen Aufschwung immerhin jedes Jahr mehr Geld eingenommen als ausgegeben. Doch die meisten Nachbarkommunen  von Düsseldorf stehen kurz vor dem Zusammenbruch, wie sich auch aus einer gerade erschienenen Studie der Bertelsmann-Stiftung ersehen lässt. "Die Schere zwischen armen und reichen Kommunen geht weiter auseinander", schreiben die Autoren. Es stelle sich die Frage, wie den rund 60 besonders armen Städten in Nordrhein-Westfalen der Haushaltsausgleich gelingen solle, wenn "sie nicht einmal während einer beispiellosen Wachstumsphase" der vergangenen Jahre dazu in der Lage waren. Die Hälfte der Städte im Bundesland hat"}]]
-             (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
-                    (lib/get-reference 1 refs)))
-             (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
-                    (lib/get-reference "1" refs)))
-             (is (nil? (lib/get-reference "foo" refs)))
-             (is (nil? (lib/get-reference -1 refs)))))
-
-         test-state)+             (is (= "figwheel-heads-up-content-area" (.-id (integration/get-parent doms-raw "")))))))


Use recur to avoid stack overflow when removing a large number of items.

--- src/main/clojure/clara/rules/memory.clj
+++ src/main/clojure/clara/rules/memory.clj
@@ -84,22 +84,28 @@

   ;; Converts the transient memory to persistent form.
   (to-persistent! [memory]))
-

 (defn remove-first-of-each
   "Remove the first instance of each item in the given set that
    appears in the collection."
   [set coll]
   (lazy-seq
-   (when-let [s (seq coll)]
-     (let [f (first s)
-           r (rest s)]
-       (if (set f)
-         (if (empty? set)
-           r ; No more items to remove, so return the rest of the list.
-           (remove-first-of-each (disj set f) r)) ; More items to remove, so recur with a smaller set.
-
-         (cons f (remove-first-of-each set r))))))) ; We did not match this item, so simply recur.
+
+   (loop [f (first coll)
+          r (rest coll)
+          to-remove set]
+
+     (when f
+       (if (to-remove f)
+
+         ;; The first item is to be removed, so do so and recur with rest of the items
+         ;; and it removed from our to-remove set.
+         (recur (first r)
+                (rest r)
+                (disj to-remove f))
+
+         ;; The first item didn't need to be removed, so continue with our lazy sequence.
+         (cons f (remove-first-of-each to-remove r)))))))

 (declare ->PersistentLocalMemory)


back-fill 401 test

back-fill 401 test

--- test/cu/web_test.clj
+++ test/cu/web_test.clj
@@ -27,7 +27,6 @@
                                                 (->> dir git-dir (option "git-dir"))
                                                 (->> dir (option "work-tree"))]
                                                cmds))))
-
 (defn git-init [dir] (git dir "init" dir))
 (defn write-executable [base-path filename contents]
   (let [full-path (str base-path "/" filename)]
@@ -68,6 +67,12 @@
                                                     "run-pipeline"
                                                     "foo")}})})))))

+; 401s with incorrect auth
+(expect {:status 401}
+        (in
+          (app (-> (request :post "/push")
+                   (auth-headers request "bad" "credentials")))))
+
 ; can view output of command through web interface
 (expect-let [evidence-that-command-ran (str (UUID/randomUUID))


(PDB-3745) Reduce autovacuum vacuum scale factor on reports

Prior to this commit, the reports table was not vacuumed
frequently enough under default postgresql settings.

After this commit, we start looking to vacuum after 1% of the table
changes.  For 1000 nodes, checking in every 30 minutes and storing
14 days of reports we'd have ~ 336,000 reports.  Every 30 minutes
1000 new reports show up.  With a 1% autovacuum scale factor we
look to vacuum after every 3,360 reports which is essentially every
2 hours ( assuming a 1 hour gc-interval).  In the case that you
store less than the default 14 days of reports then the reports
table will be vacuumed more frequently, however, we know it will
only happen after waiting gc-interval since that's how often reports
are deleted.

Long story short, assuming a default gc-interval of 1 hour we know
that we can't force autovacuum on reports any more frequently than
once per hour and with default report-ttl and runinerval we'd expect
report GC every 2 hours.  This is good because the reports table
is the largest table and we want to keep the size down by frequently
vacuuming it.

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -1496,11 +1496,12 @@

   {::vacuum-analyze #{"factsets"}})

-(defn autovacuum-vacuum-scale-factor-factsets-catalogs-certnames []
+(defn autovacuum-vacuum-scale-factor-factsets-catalogs-certnames-reports []
   (jdbc/do-commands
     "ALTER TABLE factsets  SET ( autovacuum_vacuum_scale_factor=0.80 );"
     "ALTER TABLE catalogs  SET ( autovacuum_vacuum_scale_factor=0.75 );"
-    "ALTER TABLE certnames SET ( autovacuum_vacuum_scale_factor=0.75 );"))
+    "ALTER TABLE certnames SET ( autovacuum_vacuum_scale_factor=0.75 );"
+    "ALTER TABLE reports   SET ( autovacuum_vacuum_scale_factor=0.01 );"))

 (def migrations
   "The available migrations, as a map from migration version to migration function."
@@ -1546,7 +1547,7 @@
    64 rededuplicate-facts
    65 varchar-columns-to-text
    66 jsonb-facts
-   67 autovacuum-vacuum-scale-factor-factsets-catalogs-certnames})
+   67 autovacuum-vacuum-scale-factor-factsets-catalogs-certnames-reports})

 (def desired-schema-version (apply max (keys migrations)))


Determine Asset's Metadata #778 - author and source for fetch dataset endpoint

--- backend/src/akvo/lumen/lib/dataset_impl.clj
+++ backend/src/akvo/lumen/lib/dataset_impl.clj
@@ -66,7 +66,7 @@
                                  {:as-arrays? true}))]
       (lib/ok
        (-> dataset
-           (select-keys [:created :id :modified :status :title :transformations :updated])
+           (select-keys [:created :id :modified :status :title :transformations :updated :author :source])
            (rename-keys {:title :name})
            (assoc :rows data :columns columns :status "OK"))))
     (lib/not-found {:error "Not found"})))


[#84][#85] Docstring for make-dataset-data-table multimethod

--- backend/src/org/akvo/dash/import/common.clj
+++ backend/src/org/akvo/dash/import/common.clj
@@ -2,6 +2,19 @@
   (:require [cheshire.core :as json]))

 (defmulti make-dataset-data-table
+  "Creates a dataset data table with data populated according to the
+  data source spec. Returns a status map with keys
+
+  :success? - true if import was successful, false otherwise
+  :reason - Short description of the reason for a failed import
+  :columns - A sequence of 3-tuples of the form
+
+                 [title column-name type]
+
+             where title is the user visible title of the column,
+             column-name is the name of the column in the generated
+             table and type is the user visible type of the column
+             data (string/number/date)"
   (fn [tenant-conn config table-name spec]
     (get spec "type")))


Add an extra test for client

Add an extra test for client

--- test/picard/test/client.clj
+++ test/picard/test/client.clj
@@ -338,6 +338,25 @@
        :connected nil
        :response  :dont-care
        :done      nil)))
+
+(defcoretest sending-done-after-exchange
+  [_ ch]
+  :hello-world
+
+  (client/request
+   ["localhost" 4040]
+   [{:path-info      "/"
+     :request-method "GET"}] ""
+     (fn [dn]
+       (fn [evt val]
+         (when (= :done evt)
+           (try
+             (dn :done nil)
+             (enqueue ch [:error nil])
+             (catch Exception err
+               (enqueue ch [:error err])))))))
+
+  (is (next-msgs-for ch :error nil)))

 (defcoretest issuing-immediate-abort
   [_ ch]


folds: do not rely on implicit ordering in tests.

--- test/riemann/folds_test.clj
+++ test/riemann/folds_test.clj
@@ -175,10 +175,10 @@

 (deftest modes-test
   (is (= [{:metric 2}] (vec (modes [{:metric 1} {:metric 2} {:metric 3} {:metric 4} {:metric 2}]))))
-  (is (= [{:metric 3} {:metric 2}] (vec (modes [{:metric 1} {:metric 2} {:metric 3} {:metric 3} {:metric 4} {:metric 2}]))))
+  (is (= #{{:metric 3} {:metric 2}} (set (modes [{:metric 1} {:metric 2} {:metric 3} {:metric 3} {:metric 4} {:metric 2}]))))
   (is (empty? (modes []))))

 (deftest mode-test
   (is (= {:metric 2} (mode [{:metric 1} {:metric 2} {:metric 3} {:metric 4} {:metric 2}])))
-  (is (= {:metric 3} (mode [{:metric 1} {:metric 2} {:metric 3} {:metric 3} {:metric 4} {:metric 2}])))
+  (is (#{{:metric 2} {:metric 3}} (mode [{:metric 1} {:metric 2} {:metric 3} {:metric 3} {:metric 4} {:metric 2}])))
   (is (nil? (mode []))))


Disable manual test runner in parse_command_test

--- test/monkey_music/parse_command_test.cljs
+++ test/monkey_music/parse_command_test.cljs
@@ -23,4 +23,4 @@
                                                 "direction" "left"
                                                 "team" "3"}))))

-(test-ns 'monkey-music.parse-command-test)
+;(test-ns 'monkey-music.parse-command-test)


add sleep in LIST tests to induce determinism

--- test/subrosa/test/rooms.clj
+++ test/subrosa/test/rooms.clj
@@ -120,6 +120,7 @@
       (transmit s "JOIN #foo2")
       (transmit s2 "JOIN #foo")
       (transmit s "TOPIC #foo2 :new topic")
+      (Thread/sleep 500) ; give time for all rooms to be created
       (transmit s "LIST")
       (is (received? s #"322 dan #foo2 1 :new topic$"))
       (is (received? s #"322 dan #foo 2 :$"))


STORM-600: fixed a test that had some issues with scheduling order

--- storm-core/test/clj/backtype/storm/scheduler/multitenant_scheduler_test.clj
+++ storm-core/test/clj/backtype/storm/scheduler/multitenant_scheduler_test.clj
@@ -622,6 +622,8 @@
       (is (= 4 (.size assigned-slots)))
       (is (= 2 (.size (into #{} (for [slot assigned-slots] (.getNodeId slot))))))
     )
+    ;;The text can be off for a bit until we schedule again
+    (.scheduleAsNeeded isolated-pool (into-array NodePool [free-pool]))
     (is (= "Max Nodes(2) for this user would be exceeded. 1 more nodes needed to run topology." (.get (.getStatusMap cluster) "topology1")))
     (is (= "Scheduled Isolated on 2 Nodes" (.get (.getStatusMap cluster) "topology2")))
 ))


Remove Google ns that no longer exists

Remove Google ns that no longer exists

--- ClojureScript/replete/src/replete/bundle.cljs
+++ ClojureScript/replete/src/replete/bundle.cljs
@@ -92,7 +92,6 @@
     goog.iter.Iterator
     goog.json
     goog.json.EvalJsonProcessor
-    goog.json.HybridJsonProcessor
     goog.json.NativeJsonProcessor
     goog.json.Replacer
     goog.json.Reviver


(TK-48) Improve proxy request URI construction logic

Prior to this commit, the proxy URI request construction would
always add a slash to the URI.  In cases where this wasn't
necessary, it would cause failures.

This commit changes the implementation to use a constructor
from the Java URI class, and takes a bit more care to make sure
that we have slashes in the correct places in order to build
up the URI properly.

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
@@ -21,7 +21,8 @@
            (org.eclipse.jetty.client HttpClient)
            (clojure.lang Atom)
            (java.lang.management ManagementFactory)
-           (org.eclipse.jetty.jmx MBeanContainer))
+           (org.eclipse.jetty.jmx MBeanContainer)
+           (org.eclipse.jetty.util URIUtil))
   (:require [ring.util.servlet :as servlet]
             [clojure.string :as str]
             [clojure.set :as set]
@@ -116,6 +117,12 @@
 (defn- remove-leading-slash
   [s]
   (str/replace s #"^\/" ""))
+
+(defn- with-leading-slash
+  [s]
+  (if (.startsWith s "/")
+    s
+    (str "/" s)))

 (schema/defn ^:always-validate started? :- Boolean
   "A predicate that indicates whether or not the webserver-context contains a Jetty
@@ -299,14 +306,15 @@
                          :orig (.getScheme req)
                          :http "http"
                          :https "https"))
-              context-path (.getPathInfo req)
-              uri (StringBuilder. (str scheme "://" (:host target)
-                                       ":" (:port target)
-                                       "/" (:path target) context-path))]
-          (when query
-            (.append uri "?")
-            (.append uri query))
-          (URI/create (.toString uri))))
+              context-path (.getPathInfo req)]
+          (URI. scheme
+                nil
+                (:host target)
+                (:port target)
+                (with-leading-slash
+                  (URIUtil/addPaths (:path target) context-path))
+                query
+                nil)))

       (newHttpClient []
         (let [client (if custom-ssl-ctxt-factory


More robust test

More robust test

--- test/workshop/jobs/challenge_4_3_test.clj
+++ test/workshop/jobs/challenge_4_3_test.clj
@@ -50,4 +50,4 @@
                 (let [[results] (u/collect-outputs! lifecycles [:write-segments])]
                   (u/segments-equal? expected-output results)))))
           lines (clojure.string/split results #"\n")]
-      (is (= "Summation was: 4950" (last lines))))))
+      (is (contains? (set lines) "Summation was: 4950")))))


don't stringify :points object when using pen tool

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -58,7 +58,7 @@
 (defmethod svg-element :layer.type/path
   [selected-eids layer]
   (dom/path
-   (clj->js (merge layer
+   (clj->js (merge (dissoc layer :points)
                    (svg/layer->svg-path layer)
                    {:className (str (:className layer)
                                     " shape-layer "


Remove some more remaining ios beta copy

--- src-cljs/frontend/components/mobile.cljs
+++ src-cljs/frontend/components/mobile.cljs
@@ -137,11 +137,7 @@
                                          "Shipping your app on iOS is hard. The App Store review process is
                                          long and painful. It’s important to get your app built right the first time to avoid
                                          bugs and those nasty 1-star reviews. Let CircleCI help your iOS app development
-                                         cycle with our expertise in Continuous Integration and Continuous Delivery."
-                                         [:br]
-                                         [:br]
-                                         "Currently in beta. Interested in joining? Please "
-                                         [:a {:href "mailto:sayhi@circleci.com?subject=ios"} "contact us."]]
+                                         cycle with our expertise in Continuous Integration and Continuous Delivery."]
                      :subheadline "More testing, fewer bugs, better iOS apps."
                      :explanation "Each time you push new code to your repo on Github for your
                                   iOS app, CircleCI will automatically build and test your


Minor cosmetic changes on canvas component.

--- frontend/uxbox/ui/workspace/canvas.cljs
+++ frontend/uxbox/ui/workspace/canvas.cljs
@@ -129,30 +129,25 @@
         shapes (rum/react wb/shapes-state)
         page-width (:width page)
         page-height (:height page)]
-    (html
-     [:svg.page-canvas
-      {:x wb/document-start-x
-       :y wb/document-start-y
-       :ref "canvas"
-       :width page-width
-       :height page-height
-
-       :on-mouse-down
-       (fn [event]
-         (dom/stop-propagation event)
-         (rs/emit! (dw/deselect-all)))
-
-       :on-mouse-up
-       (fn [event]
-         (dom/stop-propagation event)
-         (reset! wb/shapes-dragging? false))
-       }
-      (background)
-      (grid 1)
-
-      [:svg.page-layout {}
-       (for [item shapes]
-         (rum/with-key (shape item) (str (:id item))))]])))
+    (letfn [(on-mouse-down [event]
+              (dom/stop-propagation event)
+              (rs/emit! (dw/deselect-all)))
+            (on-mouse-up [event]
+              (dom/stop-propagation event)
+              (reset! wb/shapes-dragging? false))]
+      (html
+       [:svg.page-canvas {:x wb/document-start-x
+                          :y wb/document-start-y
+                          :ref "canvas"
+                          :width page-width
+                          :height page-height
+                          :on-mouse-down on-mouse-down
+                          :on-mouse-up on-mouse-up}
+        (background)
+        (grid 1)
+        [:svg.page-layout {}
+         (for [item shapes]
+           (rum/with-key (shape item) (str (:id item))))]]))))

 (def canvas
   (util/component


Alias clojure.java.shell instead of refer

--- boot/core/src/boot/task_helpers/notify.clj
+++ boot/core/src/boot/task_helpers/notify.clj
@@ -1,9 +1,9 @@
 (ns boot.task-helpers.notify
-  (:require [clojure.java.shell :refer [sh]]))
+  (:require [clojure.java.shell :as shell]))

 (defn- ^{:boot/from :jeluard/boot-notify} program-exists?
   [s]
-  (= 0 (:exit (sh "sh" "-c" (format "command -v %s" s)))))
+  (= 0 (:exit (shell/sh "sh" "-c" (format "command -v %s" s)))))

 (defmulti notify-method
   (fn [os _message]
@@ -12,13 +12,13 @@
 (defmethod notify-method "Mac OS X"
   [_ {:keys [message title icon pid] :as notification}]
   (if (program-exists? "terminal_notifier")
-    (sh "terminal-notifier" "-message" message "-title" title "-contentImage" icon "-group" pid)
+    (shell/sh "terminal-notifier" "-message" message "-title" title "-contentImage" icon "-group" pid)
     ((get-method notify-method :default) :default notification)))

 (defmethod notify-method "Linux"
   [_ {:keys [message title icon] :as notification}]
   (if (program-exists? "notify-send")
-    (sh "notify-send" title message "--icon" icon)
+    (shell/sh "notify-send" title message "--icon" icon)
     ((get-method notify-method :default) :default notification)))

 (defmethod notify-method :default


Typo in test names

Typo in test names

--- triangle/triangle_test.clj
+++ triangle/triangle_test.clj
@@ -7,9 +7,9 @@
   (is (= :equilateral (triangle/type 2 2 2))))
 (deftest equilateral-2
   (is (= :equilateral (triangle/type 10 10 10))))
-(deftest isoceles-1
+(deftest isosceles-1
   (is (= :isosceles (triangle/type 3 4 4))))
-(deftest isoceles-2
+(deftest isosceles-2
   (is (= :isosceles (triangle/type 4 3 4))))
 (deftest scalene
   (is (= :scalene (triangle/type 3 4 5))))


make code more readable

make code more readable

--- src/clj_money/models/reconciliations.clj
+++ src/clj_money/models/reconciliations.clj
@@ -137,10 +137,12 @@
   (find storage-spec {:id id}))

 (defn- is-in-balance?
-  [storage reconciliation]
+  [storage {:keys [account-id] :as reconciliation}]
   (or (= :new (:status reconciliation))
-      (let [account (accounts/find-by-id storage (:account-id reconciliation))
-            starting-balance (or (:balance (find-last-completed storage (:account-id reconciliation)))
+      (let [account (accounts/find-by-id storage account-id)
+            starting-balance (or (:balance (find-last-completed
+                                             storage
+                                             account-id))
                                  0M)
             delta (->> reconciliation
                        (ensure-transaction-items storage)


Fixes for trieterator

Fixes for trieterator

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -384,18 +384,24 @@
 (deftype Trieterator [iterator seek-key ^:mutable pinned-key ^:mutable pinned-key-ix ^:mutable moving-key-ix ^:mutable end? key-len]
   Object
   (key [this]
-       (aget (.key iterator) moving-key-ix))
+       (when (false? end?)
+         (aget (.key iterator) moving-key-ix)))
   (val [this]
-       (.val iterator))
+       (when (false? end?)
+         (.val iterator)))
   (maintain [this]
-             (if (or (.-end? iterator)
-                     (not (or (< pinned-key-ix 0) ;; nothing to pin
-                              (identical? pinned-key (aget (.key iterator) pinned-key-ix)))))
-               (set! end? true)
-               (set! end? false)))
+            (if (or (true? (.-end? iterator))
+                    (not (or (< pinned-key-ix 0) ;; nothing to pin
+                             (identical? pinned-key (aget (.key iterator) pinned-key-ix)))))
+              (set! end? true)
+              (do
+                (set! end? false)
+                (aset seek-key moving-key-ix (.key this)))))
   (next [this]
         (when (false? end?)
-          (.next iterator)
+          (prn :seek (.key iterator) seek-key)
+          (.seek iterator seek-key)
+          (prn :sook (.key iterator))
           (.maintain this)))
   (seek [this key]
         (when (false? end?)
@@ -405,24 +411,27 @@
   (down [this]
         (assert (false? end?))
         (assert (< moving-key-ix (- (alength seek-key) 1)))
-        (let [moving-key (.key this)]
-          (aset seek-key moving-key-ix moving-key)
-          (set! pinned-key moving-key)
-          (set! pinned-key-ix moving-key-ix)
-          (set! moving-key-ix (+ moving-key-ix 1))))
+        (set! pinned-key (.key this))
+        (set! pinned-key-ix moving-key-ix)
+        (set! moving-key-ix (+ moving-key-ix 1))
+        (aset seek-key moving-key-ix (.key this))
+        (.maintain this))
   (up [this]
       (assert (> moving-key-ix 0))
+      (aset seek-key moving-key-ix greatest)
       (set! moving-key-ix pinned-key-ix)
       (set! pinned-key-ix (- pinned-key-ix 1))
-      (set! pinned-key (aget seek-key pinned-key-ix))
-      (aset seek-key moving-key-ix least))
+      (set! pinned-key (when (>= pinned-key-ix 0) (aget seek-key pinned-key-ix)))
+      (.maintain this))
   (mark [this]
         (.mark iterator))
   (reset [this]
          (.reset iterator)))

 (defn trieterator [iterator]
-  (Trieterator. iterator (least-key (.-key-len iterator)) nil -1 0 (.-end? iterator) (.-key-len iterator)))
+  (let [trieterator (Trieterator. iterator (greatest-key (.-key-len iterator)) nil -1 0 false (.-key-len iterator))]
+    (.maintain trieterator)
+    trieterator))

 ;; works on trees
 (deftype Intersection [iterators ^:mutable end? key-len]


Added a test case.

Added a test case.

--- test/cmr/system_int_test/search/granule_search_index_name_test.clj
+++ test/cmr/system_int_test/search/granule_search_index_name_test.clj
@@ -55,10 +55,14 @@
             [gran1]
             (search/find-refs :granule {:short-name "ShortOne"
                                         "granule-ur[]" ["Granule1" "Granule4"]}))))
-    (testing "search for granules in multiple collection index with collection identifier."
+    (testing "search for granules in multiple collection indexes with collection identifier."
       (is (d/refs-match?
             [gran1 gran2 gran3 gran4]
             (search/find-refs :granule {"short-name[]" ["ShortOne" "ShortTwo"]}))))
+    (testing "search for granules in multiple collection indexes with collection identifier and small_collections."
+      (is (d/refs-match?
+            [gran4 gran6]
+            (search/find-refs :granule {"short-name[]" ["ShortTwo" "ShortThree"]}))))
     (testing "search for granules in small_collections index."
       (is (d/refs-match?
             [gran5]


cleanup and simplify

cleanup and simplify

--- src/babel/enrich.cljc
+++ src/babel/enrich.cljc
@@ -32,22 +32,8 @@
   (let [pred-of-head (get-in spec [:synsem :sem :pred] :top)]
     (if (= pred-of-head :top)
       spec
-      (mapcat (fn [lexemes]
-                (mapcat (fn [lexeme]
-                          (if (= pred-of-head
-                                 (get-in lexeme [:synsem :sem :pred] :top))
-                            (list lexeme)))
-                        lexemes))
-              (vals lexicon)))))
+      (filter (fn [lexeme]
+                (= pred-of-head
+                   (get-in lexeme [:synsem :sem :pred] :top)))
+              (reduce concat (vals lexicon))))))

-(defn matching-comp-lexemes [spec lexicon]
-  (let [pred-of-comp (get-in spec [:synsem :sem :subj :pred] :top)]
-    (if (= pred-of-comp :top)
-      spec
-      (mapcat (fn [lexemes]
-                (mapcat (fn [lexeme]
-                          (if (= pred-of-comp
-                                 (get-in lexeme [:synsem :sem :pred] :top))
-                            (list lexeme)))
-                        lexemes))
-              (vals lexicon)))))


%extend% is just the same as %include% right now

--- src/clabango/tags.clj
+++ src/clabango/tags.clj
@@ -46,9 +46,7 @@
      :context context}))

 (deftemplatetag "extends" [nodes context]
-  (let [{:keys [string]} (template-tag "include" nodes context)]
-    {:string string
-     :context (assoc context :extended true)}))
+  (template-tag "include" nodes context))

 (deftemplatetag "if" "endif" [nodes context]
   (let [if-node (first nodes)


* src/clj/cljs/core.clj: initial pass at match op macros


In the CLJS REPL, in-ns will now create namespaces which do not exist

This closes CLJS-157

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -134,7 +134,11 @@

 (def default-special-fns
   (let [load-file-fn (fn [repl-env file] (load-file repl-env file))]
-    {'in-ns (fn [_ quoted-ns] (set! comp/*cljs-ns* (second quoted-ns)))
+    {'in-ns (fn [_ quoted-ns]
+              (let [ns-name (second quoted-ns)]
+                (when-not (@comp/namespaces ns-name)
+                  (swap! comp/namespaces assoc ns-name {:name ns-name}))
+                (set! comp/*cljs-ns* ns-name)))
      'load-file load-file-fn
      'clojure.core/load-file load-file-fn
      'load-namespace (fn [repl-env ns] (load-namespace repl-env ns))}))


Upgrade karma to 4.4.1

Upgrade karma to 4.4.1

--- src/deps.cljs
+++ src/deps.cljs
@@ -1,5 +1,5 @@
 {:npm-dev-deps {"shadow-cljs"           "2.8.67"
-                "karma"                 "4.3.0"
+                "karma"                 "4.4.1"
                 "karma-chrome-launcher" "3.1.0"
                 "karma-cljs-test"       "0.1.0"
                 "karma-junit-reporter"  "2.0.1"}}


fix accidental code corruption

fix accidental code corruption

--- src/main/shadow/cljs/devtools/server.clj
+++ src/main/shadow/cljs/devtools/server.clj
@@ -293,7 +293,7 @@
            @app-ref]

        (println (str "shadow-cljs - server running at http" (when ssl-context "s") "://" (:host http) ":" (:port http)))
-       (println (str "shadow-cljs - socket repl running at " (:host soch ket-repl) ":" (:port socket-repl)))
+       (println (str "shadow-cljs - socket repl running at " (:host socket-repl) ":" (:port socket-repl)))
        (println (str "shadow-cljs - nREPL server started on port " (:port nrepl)))

        ::started


Made all status codes explicit.

Made all status codes explicit.

--- src/cower/handler.clj
+++ src/cower/handler.clj
@@ -26,28 +26,31 @@

 (defroutes app-routes
   (GET "/packages" []
-       (write-json (search "*")))
+       {:status 200
+        :body (write-json (search "*"))})

   (POST "/packages" [name url]
         (do
           (wcar* (car/set name url))
-          { :status 201 }))
+          {:status 201}))

   (GET "/packages/:name" [name]
        (let [url (wcar* (car/get name)) ]
          (if (nil? url)
-           { :status 404 }
-           (write-json
-             (key-value-to-map [name url])))))
+           {:status 404}
+           {:status 200
+            :body (write-json
+                    (key-value-to-map [name url])) })))

   (DELETE "/packages/:name" [name]
           (do
             (wcar* (car/del name))
-            { :status 204 }))
+            {:status 204}))

   (GET "/packages/search/:name" [name]
-       (write-json
-         (search (str "*" name "*"))))
+       {:status 200
+        :body (write-json
+                (search (str "*" name "*")))})

   (route/resources "/")
   (route/not-found "Not Found"))


Make a var explicitly dynamic for 1.3

Make a var explicitly dynamic for 1.3

--- src/difftest/core.clj
+++ src/difftest/core.clj
@@ -14,7 +14,7 @@
             [clj-stacktrace.core :as clj-stacktrace]
             [clj-stacktrace.repl]))

-(def *color* true)
+(def ^{:dynamic true} *color* true)

 (defn difform-str
   "Create a string that is the diff of the forms x and y."


force shutdown on destroy

force shutdown on destroy

--- src/evalback/core.clj
+++ src/evalback/core.clj
@@ -194,6 +194,7 @@
 (defn destroy []
   (doseq [_ (range instances)] (<!! @worker))
   (reset! worker nil)
-  (println :destroy))
-
-
+  (println :destroy)
+  (System/exit 0))
+
+


Doc typo fix

Doc typo fix

--- src/flatgui/paint.clj
+++ src/flatgui/paint.clj
@@ -52,8 +52,8 @@

 (defn flatten-vector
   "Suppose a vector that does not contain vectors among
-   its elements, it the tree leaf. This functions unrolls
-   tree-like structure or vectors into single vector that
+   its elements, it the tree leaf. This function unrolls
+   tree-like structure of vectors into single vector that
    contains only leafs. It is supposed that each vector
    may contain either vectors only, or non-vector elements
    only."


fixed merge conflicts

fixed merge conflicts

--- src/frontend/core.clj
+++ src/frontend/core.clj
@@ -83,12 +83,14 @@
   "helper for finding appropriate backend, assumes that the `*.circlehost` prefix
   matches the DNS for env on circleci.com"
   [req]
-  (case (:server-name req)
-    "dev.circlehost" {:proto "http" :host "dev.circlehost:8080"}
-    "prod.circlehost" {:proto "https" :host "circleci.com"}
-    "enterprise.circlehost" {:proto "https" :host "enterprise-staging.sphereci.com"}
-    (when-let [env (some->> req :server-name (re-matches #"(.*).circlehost") second)]
-      {:proto "https" :host (format "%s.circleci.com" env)})))
+  (let [server-name (:server-name req)]
+    (cond
+      (= server-name "dev.circlehost") {:proto "http" :host "dev.circlehost:8080"}
+      (= server-name "prod.circlehost") {:proto "https" :host "circleci.com"}
+      (= server-name "enterprise.circlehost") {:proto "https" :host "enterprise-staging.sphereci.com"}
+      (re-matches #"(.*).circlehost" server-name) (when-let [env (some->> req :server-name (re-matches #"(.*).circlehost") second)]
+                                                    {:proto "https" :host (format "%s.circleci.com" env)})
+      :else {:proto "http" :host "dev.circlehost:8080"})))

 (def proxy-config
   ;; Incomplete lists of routes to proxy. Unfortunately duplicated knowledge between


Ignore FNFE's since previous build deleted the domain files

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -353,16 +353,18 @@
 (defn transform-config [file]
   (let [in-file (io/file (jboss-dir) file)
         out-file in-file]
-    (if (re-find #"immutant" (slurp in-file))
-      (println file "already transformed, skipping")
-      (do
-        (with-message (str "Transforming " file)
-          (io/make-parents out-file)
-          (io/copy (with-out-str
-                     (lazy-xml/emit
-                      (walk-the-doc (prepare-zip in-file))
-                      :indent 4))
-                   out-file))))))
+    (try
+      (if (re-find #"immutant" (slurp in-file))
+        (println file "already transformed, skipping")
+        (do
+          (with-message (str "Transforming " file)
+            (io/make-parents out-file)
+            (io/copy (with-out-str
+                       (lazy-xml/emit
+                        (walk-the-doc (prepare-zip in-file))
+                        :indent 4))
+                     out-file))))
+      (catch java.io.FileNotFoundException e (println (.getMessage e))))))

 (defn extract-module-deps [f]
   (let [mods (flatten


Cleanup accidental code in comments

Cleanup accidental code in comments

--- src/googlica/core.clj
+++ src/googlica/core.clj
@@ -181,6 +181,3 @@
          ;; we output a char \^, and do this replace once we generate the final string.
          ((fn [sexps] (update sexps 1 #(str/replace % "\\^ :" "^:"))))
          (str/join "\n\n"))))
-
-;; (load-string (slurp "api-key.edn"))
-;; (http/request {:method :post, :url "https://www.googleapis.com/storage/v1/b" :content-type :json, :body "{\"name\":\"test-bucket\"}", :query-params {"key" googlica.storage.v1/*api-key* "project" "ksf-dev"}


[#2925] Add data-groups support to all visualisation types

--- backend/src/akvo/lumen/lib/aggregation.clj
+++ backend/src/akvo/lumen/lib/aggregation.clj
@@ -52,8 +52,7 @@

 (defn query [tenant-conn dataset-id visualisation-type query]
   (try
-    (if (and (-> (env/all tenant-conn) (get "data-groups"))
-             (contains? #{"bar" "line" "pie" "pivot"} visualisation-type))
+    (if (-> (env/all tenant-conn) (get "data-groups"))
       (let [[variant-key data :as result] (data-groups-query tenant-conn dataset-id visualisation-type query)]
         (if (= variant-key :akvo.lumen.lib/not-found)
           (dataset-version-query tenant-conn dataset-id visualisation-type query)


[#2756] Fix tests

[#2756] Fix tests

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -180,8 +180,8 @@
                       :name title
                       :status "OK"
                       :transformations []
-                      :groups {:transformations []
-                               :main (map #(assoc % :groupName "main" :groupId "main") commons/dataset-link-columns)}}
+                      :groups [[:main (map #(assoc % :groupName "main" :groupId "main") commons/dataset-link-columns)]
+                               [:transformations []]]}
                      (select-keys meta-group-dataset [:id :name :status :transformations :groups]))))

             (let [meta-group-dataset (-> (h (get* (api-url "/datasets" dataset-id "group" "main")))


WIP find-dependencies

WIP find-dependencies

--- proto-oct/src/proto_oct/core.clj
+++ proto-oct/src/proto_oct/core.clj
@@ -17,15 +17,11 @@
   (reduce str (map #(emit-code %) s)))

 (defn define
-  ([name value & dependencies]
-     {:type :define
-      :name name
-      :value value
-      :dependencies dependencies})
-  ([name value]
-     (define name value nil))
-  ([name]
-     (define name nil nil)))
+  [name value & dependencies]
+  {:type :define
+   :name name
+   :value value
+   :dependencies dependencies})

 (defemit :define [m]
   (if (:value m)
@@ -33,15 +29,11 @@
     (str "#define " (:name m))))

 (defn include
-  ([file system? & dependencies]
-     {:type :include
-      :file file
-      :system system?
-      :dependencies dependencies})
-  ([file system?]
-     (include file system? nil))
-  ([file]
-     (include file false nil)))
+  [file system? & dependencies]
+  {:type :include
+   :file file
+   :system system?
+   :dependencies dependencies})

 (defemit :include [m]
   (if (:system m)
@@ -49,16 +41,12 @@
     (str "#include \"" (:file m) "\"")))

 (defn ifdef
-  ([cond then else & dependencies]
-     {:type :ifdef
-      :cond cond
-      :then then
-      :else else
-      :dependencies dependencies})
-  ([cond then else]
-     (ifdef cond then else nil))
-  ([cond then]
-     (ifdef cond then nil nil)))
+  [cond then else & dependencies]
+  {:type :ifdef
+   :cond cond
+   :then then
+   :else else
+   :dependencies dependencies})

 (defemit :ifdef [m]
   (if (:else m)
@@ -73,16 +61,12 @@

 ;; copy of ifdef, generalize?
 (defn ifndef
-  ([cond then else & dependencies]
-     {:type :ifndef
-      :cond cond
-      :then then
-      :else else
-      :dependencies dependencies})
-  ([cond then else]
-     (ifndef cond then else nil))
-  ([cond then]
-     (ifndef cond then nil nil)))
+  [cond then else & dependencies]
+  {:type :ifndef
+   :cond cond
+   :then then
+   :else else
+   :dependencies dependencies})

 (defemit :ifndef [m]
   (if (:else m)
@@ -131,10 +115,10 @@

 (defn find-dependencies [s expr]
   (let [deps (:dependencies expr)]
-    (println deps)
+    ;;(println deps)
     (cond
      deps (do
-            (println (concat deps (map find-dependencies s deps)))
+            ;;(println (concat deps (map find-dependencies s deps)))
             (concat deps (map find-dependencies s deps))))))

 (defn emit-program [s]


Remove useless scope check, per review.

Remove useless scope check, per review.

--- frontend/components/build_head.cljs
+++ frontend/components/build_head.cljs
@@ -301,52 +301,51 @@
                        :href (build-model/path-for-parallelism build)}
                    (str (:parallel build) "x")]
                   [:span (:parallel build) "x"])]]]]
-            (if (has-scope :view-builds data)
-              [:div.build-actions
-               [:div.actions
+            [:div.build-actions
+             [:div.actions
+              (forms/stateful-button
+               [:button.retry_build
+                {:data-loading-text "Rebuilding",
+                 :title "Retry the same tests",
+                 :on-click #(put! controls-ch [:retry-build-clicked {:build-id build-id
+                                                                     :vcs-url vcs-url
+                                                                     :build-num build-num
+                                                                     :clear-cache? false}])}
+                "Rebuild"])
+
+              (forms/stateful-button
+               [:button.clear_cache_retry
+                {:data-loading-text "Rebuilding",
+                 :title "Clear cache and retry",
+                 :on-click #(put! controls-ch [:retry-build-clicked {:build-id build-id
+                                                                     :vcs-url vcs-url
+                                                                     :build-num build-num
+                                                                     :clear-cache? true}])}
+                "& clear cache"])
+
+              (if (has-scope :write-settings data)
                 (forms/stateful-button
-                 [:button.retry_build
+                 [:button.ssh_build
                   {:data-loading-text "Rebuilding",
-                   :title "Retry the same tests",
-                   :on-click #(put! controls-ch [:retry-build-clicked {:build-id build-id
-                                                                       :vcs-url vcs-url
-                                                                       :build-num build-num
-                                                                       :clear-cache? false}])}
-                  "Rebuild"])
-
+                   :title "Retry with SSH in VM",
+                   :on-click #(put! controls-ch [:ssh-build-clicked {:build-id build-id
+                                                                     :vcs-url vcs-url
+                                                                     :build-num build-num}])}
+                  "& enable ssh"]))]
+             [:div.actions
+              [:button.report_build
+               {:title "Report error with build",
+                :on-click #(put! controls-ch [:report-build-clicked {:build-url (:build_url @build)}])}
+               "Report"]
+              (when (build-model/can-cancel? build)
                 (forms/stateful-button
-                 [:button.clear_cache_retry
-                  {:data-loading-text "Rebuilding",
-                   :title "Clear cache and retry",
-                   :on-click #(put! controls-ch [:retry-build-clicked {:build-id build-id
-                                                                       :vcs-url vcs-url
-                                                                       :build-num build-num
-                                                                       :clear-cache? true}])}
-                  "& clear cache"])
-
-                (if (has-scope :write-settings data)
-                  (forms/stateful-button
-                   [:button.ssh_build
-                    {:data-loading-text "Rebuilding",
-                     :title "Retry with SSH in VM",
-                     :on-click #(put! controls-ch [:ssh-build-clicked {:build-id build-id
-                                                                       :vcs-url vcs-url
-                                                                       :build-num build-num}])}
-                    "& enable ssh"]))]
-               [:div.actions
-                [:button.report_build
-                 {:title "Report error with build",
-                  :on-click #(put! controls-ch [:report-build-clicked {:build-url (:build_url @build)}])}
-                 "Report"]
-                (when (build-model/can-cancel? build)
-                  (forms/stateful-button
-                   [:button.cancel_build
-                    {:data-loading-text "Canceling",
-                     :title "Cancel this build",
-                     :on-click #(put! controls-ch [:cancel-build-clicked {:build-id build-id
-                                                                          :vcs-url vcs-url
-                                                                          :build-num build-num}])}
-                    "Cancel"]))]])
+                 [:button.cancel_build
+                  {:data-loading-text "Canceling",
+                   :title "Cancel this build",
+                   :on-click #(put! controls-ch [:cancel-build-clicked {:build-id build-id
+                                                                        :vcs-url vcs-url
+                                                                        :build-num build-num}])}
+                  "Cancel"]))]]
             [:div.no-user-actions]]
            (when (:show-usage-queue usage-queue-data)
              (om/build build-queue {:build build


Remove commons-io dependency usage on storages/fs ns.

--- vendor/storages/fs.clj
+++ vendor/storages/fs.clj
@@ -7,6 +7,7 @@
 (ns storages.fs
   "A local filesystem storage implementation."
   (:require [promesa.core :as p]
+            [clojure.java.io :as io]
             [executors.core :as exec]
             [storages.proto :as pt]
             [storages.impl :as impl])
@@ -14,8 +15,7 @@
            java.io.OutputStream
            java.net.URI
            java.nio.file.Path
-           java.nio.file.Files
-           org.apache.commons.io.IOUtils))
+           java.nio.file.Files))

 (defn- normalize-path
   [^Path base ^Path path]
@@ -38,7 +38,7 @@
     (with-open [^InputStream source (pt/-input-stream content)
                 ^OutputStream dest (Files/newOutputStream fullpath
                                                           impl/open-opts)]
-      (IOUtils/copy source dest)
+      (io/copy source dest)
       path)))

 (defn- delete