Pass malli options to compile fn

Pass malli options to compile fn

--- modules/reitit-malli/src/reitit/coercion/malli.cljc
+++ modules/reitit-malli/src/reitit/coercion/malli.cljc
@@ -135,7 +135,7 @@
                       (if parameters
                         {:parameters
                          (->> (for [[in schema] parameters
-                                    parameter (extract-parameter in (compile schema))]
+                                    parameter (extract-parameter in (compile schema options))]
                                 parameter)
                               (into []))})
                       (if responses
@@ -148,14 +148,14 @@
                                            (update $ :description (fnil identity ""))
                                            (if (:schema $)
                                              (-> $
-                                                 (update :schema compile)
+                                                 (update :schema compile options)
                                                  (update :schema swagger/transform {:type :schema}))
                                              $))]))}))
            (throw
              (ex-info
                (str "Can't produce Schema apidocs for " specification)
                {:type specification, :coercion :schema}))))
-       (-compile-model [_ model _] (compile model))
+       (-compile-model [_ model _] (compile model options))
        (-open-model [_ schema] schema)
        (-encode-error [_ error]
          (cond-> error
@@ -165,9 +165,9 @@
                                      (update :errors (partial map #(update % :schema edn/write-string opts))))
                  (seq error-keys) (select-keys error-keys)))
        (-request-coercer [_ type schema]
-         (-coercer (compile schema) type transformers :decode nil options))
+         (-coercer (compile schema options) type transformers :decode nil options))
        (-response-coercer [_ schema]
-         (let [schema (compile schema)
+         (let [schema (compile schema options)
                encoder (-coercer schema :body transformers :encode nil options)]
            (-coercer schema :response transformers :encode encoder options)))))))


Handle _ADAPTERS_NOT_IN_BUILD.txt file

Handle _ADAPTERS_NOT_IN_BUILD.txt file

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

--- buildscripts/buildcheck/src/buildcheck/core.clj
+++ buildscripts/buildcheck/src/buildcheck/core.clj
@@ -69,12 +69,19 @@
         pattern (re-pattern (str "MMSetup" bits "BIT_[^\\s]+?_" date-token ".exe"))]
     (re-find pattern txt)))

-(def non-windows-device-adapters #{"dc1394" "Video4Linux"})
+(def device-adapter-parent-dirs [(File. micromanager "/DeviceAdapters")
+                                 (File. micromanager "/SecretDeviceAdapters")])
+
+(defn do-not-build []
+  (set (apply concat
+         (for [blacklist (map #(File. % "_ADAPTERS_NOT_IN_BUILD.txt") device-adapter-parent-dirs)]
+           (let [txt (slurp blacklist)]
+             (map #(first (.split % ":")) (.split txt "\n")))))))
+
+(def non-windows-device-adapters #{"dc1394" "SimpleCam" "Video4Linux"})

 (defn missing-vcproj []
-  (let [device-adapter-parent-dirs [(File. micromanager "/DeviceAdapters")
-                                    (File. micromanager "/SecretDeviceAdapters")]
-        device-adapter-dirs (filter #(and (.isDirectory %)
+  (let [device-adapter-dirs (filter #(and (.isDirectory %)
                                           (not (.. % getName (startsWith "."))))
                                     (mapcat #(.listFiles %) device-adapter-parent-dirs))
         directories-without-vcproj
@@ -86,13 +93,12 @@
         (sort
           (clojure.set/difference
             (set (map #(.getName %) directories-without-vcproj))
+            (do-not-build)
             non-windows-device-adapters))))

 (defn device-vcproj-files []
-  (let [device-adapter-parent-dirs [(File. micromanager "/DeviceAdapters")
-                                    (File. micromanager "/SecretDeviceAdapters")]]
     (filter #(.. % getName (endsWith ".vcproj"))
-            (mapcat file-seq device-adapter-parent-dirs))))
+            (mapcat file-seq device-adapter-parent-dirs)))

 (defn dll-name [file]
   (second (re-find #"mmgr_dal_(.*?).dll" (.getName file))))
@@ -117,6 +123,7 @@
                                           (device-vcproj-files)))]
     (sort (clojure.set/difference (set project-names)
                                   (set dll-names)
+                                  (do-not-build)
                                   helper-vcprojs))))

 (defn device-pages []
@@ -130,7 +137,8 @@
             (clojure.set/union (set non-windows-device-adapters)
                                (missing-vcproj)
                                (set dll-names))
-            (set device-page-names)))))
+            (set device-page-names)
+            (do-not-build)))))

 (defn str-lines [sequence]
   (apply str (interpose "\n" sequence)))


Fix logic mistake

Fix logic mistake

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

--- buildscripts/buildcheck/src/buildcheck/core.clj
+++ buildscripts/buildcheck/src/buildcheck/core.clj
@@ -36,7 +36,7 @@
                                        (condp = bits
                                          32 "bin_Win32"
                                          64 "bin_x64")) 24)]
-    (when-not (or (empty? vs-errors) (empty? outdated-dlls))
+    (when-not (and (empty? vs-errors) (empty? outdated-dlls))
       (println (str "MICROMANAGER " bits "-bit "
                     ({:inc "INCREMENTAL" :full "FULL"} mode)
                     " BUILD ERROR REPORT"))


Fix titles

Fix titles

--- frontend/controllers/navigation.cljs
+++ frontend/controllers/navigation.cljs
@@ -420,7 +420,8 @@
     (set-page-title! "Account")))

 (defmethod post-navigated-to! :documentation
-  [_ _ {:keys [subpage]} _ current-state]
+  [history-imp navigation-point {:keys [subpage] :as args} previous-state current-state]
+  (post-default navigation-point args)
   (let [doc (get-in current-state (conj state/docs-data-path subpage))]
     (when (and subpage
                (empty? (:children doc))


Compute doc urls with stefon

Compute doc urls with stefon

--- frontend/controllers/navigation.cljs
+++ frontend/controllers/navigation.cljs
@@ -9,6 +9,7 @@
             [frontend.favicon]
             [frontend.pusher :as pusher]
             [frontend.state :as state]
+            [frontend.stefon :as stefon]
             [frontend.utils.ajax :as ajax]
             [frontend.utils.state :as state-utils]
             [frontend.utils.vcs-url :as vcs-url]
@@ -421,5 +422,8 @@
 ;; TODO: only do this for articles (not frontpage, categories)
 (defmethod post-navigated-to! :documentation
   [_ _ {:keys [subpage]} _ current-state]
-  (let [api-ch (get-in current-state [:comms :api])]
-    (ajax/ajax :get (gstring/format "/assets/docs/%s.md" (name subpage)) :markdown api-ch :context {:subpage subpage} :format :raw)))
+  (let [api-ch (get-in current-state [:comms :api])
+        url (-> "/docs/%s.md"
+                (gstring/format (name subpage))
+                stefon/asset-path)]
+    (ajax/ajax :get url :markdown api-ch :context {:subpage subpage} :format :raw)))


fix slightly unexplained bug in device waiting

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -58,7 +58,7 @@

 (def attached-runnables (atom (vec nil)))

-(def pending-devices (atom nil))
+(def pending-devices (atom #{}))

 (defn add-to-pending [dev]
   (swap! pending-devices conj dev))
@@ -103,12 +103,15 @@
 ;; hardware control

 (defn wait-for-device [dev]
-  (when (and dev (pos? (.length dev)))
-    (core waitForDevice dev)))
+  (when-not (empty? dev)
+    (try
+      (core waitForDevice dev)
+      (swap! pending-devices disj dev)
+      (catch Exception e (println "wait for device" dev "failed.")))))

 (defn wait-for-pending-devices []
-  (dorun (map wait-for-device @pending-devices))
-  (reset! pending-devices nil))
+  (log "pending devices: " @pending-devices)
+  (dorun (map wait-for-device @pending-devices)))

 (defn get-z-stage-position [stage]
   (if-not (empty? stage) (core getPosition stage) 0))
@@ -162,7 +165,7 @@

 (defn init-burst [length trigger-sequence]
   (when trigger-sequence
-    (println trigger-sequence)
+    (log trigger-sequence)
     (arm-property-sequences trigger-sequence))
   (core setAutoShutter (@state :init-auto-shutter))
   (swap! state assoc :burst-init-time (elapsed-time @state))


Don't block when showing error at the end of acquisition

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -704,7 +704,7 @@
         (execute (mapcat #(make-event-fns % out-queue) acq-seq)))
       (catch Throwable t
              (def acq-error t)
-             (ReportingUtils/showError t "Acquisition failed."))
+             (future (ReportingUtils/showError t "Acquisition failed.")))
       (finally
         (when cleanup?
           (cleanup))


Fix connection pool handling.

Fix connection pool handling.

--- src/fhofherr/clj_db_util/db_connection.clj
+++ src/fhofherr/clj_db_util/db_connection.clj
@@ -29,34 +29,44 @@
   [db]
   (::dialect db))

-(defn pooled?
-  [db]
-  (::pooled? db false))
-
 (defn- create-con-pool
   [^DataSource ds]
   (let [cfg (doto (HikariConfig.)
               (.setDataSource ds))]
     (HikariDataSource. cfg)))

-(defn wrap-db
+(defn wrap-pool
   "Create a connection pool and wrap the data source used to connect to
   the database into it."
   [db]
   (log/info "Creating HikariCP connection pool.")
-  (let [db-spec (db-spec db)
-        dialect (dialect db)
-        pooled-ds (create-con-pool (:datasource db-spec))]
-    (from-datasource dialect pooled-ds :pooled true)))
+  (if-not (::pooled? db)
+    (let [ds (:datasource (db-spec db))
+         pooled-ds (create-con-pool ds)]
+     (as-> db $
+       (update-db-spec $ {:datasource pooled-ds})
+       (assoc $ ::pooled? true)))
+    db))

+(defn wrap-db
+  "Create a connection pool and wrap the data source used to connect to
+  the database into it.
+
+  *Deprecated*: use wrap-pool instead"
+  {:deprecated "0.1.0"}
+  [db]
+  (wrap-pool db))
+
 (defn shutdown-pool
   "If the database uses a pooled data source shut it down."
   [db]
   {:pre [(:datasource (db-spec db))]}
-  (if (pooled? db)
-    (let [pool (:datasource (db-spec db))
-          ds (.getDataSource pool)]
-      (.shutdown pool)
+  (if (::pooled? db)
+    (let [pooled-ds (:datasource (db-spec db))
+          ds (.getDataSource pooled-ds)]
+      (.shutdown pooled-ds)
       (log/info "Shutdown of HikariCP connection pool successful.")
-      (from-datasource (dialect db) ds))
+      (as-> db $
+        (update-db-spec $ {:datasource ds})
+        (assoc $ ::pooled? false)))
     db))


Set min period to 200 ms

Set min period to 200 ms

--- src/gol/react/components/control/main.cljs
+++ src/gol/react/components/control/main.cljs
@@ -41,7 +41,7 @@
       [:button {:on-click (random-population-handler actions 0 0 0)}
        "Clean"]]
      [:div
-      [:input {:type      :range :min 0 :max 1000 :step 100 :value period
+      [:input {:type      :range :min 200 :max 1000 :step 100 :value period
                :on-change (change-evolution-period-handler actions)}]]
      [:div
       [:div


fix for period char in browser; layout demo

--- src/flatgui/samples/forms/layoutdemopanel2.clj
+++ src/flatgui/samples/forms/layoutdemopanel2.clj
@@ -10,6 +10,8 @@
   (:require [flatgui.util.matrix :as m]
             [flatgui.base :as fg]
             [flatgui.awt :as awt]
+            [flatgui.inputchannels.keyboard :as keyboard]
+            [flatgui.inputchannels.awtbase :as inputbase]
             [flatgui.theme]
             [flatgui.layout]
             [flatgui.widgets.label :as label]
@@ -18,7 +20,8 @@
             [flatgui.widgets.textfield :as textfield]
             [flatgui.widgets.panel :as panel]
             [flatgui.widgets.button :as button]
-            [flatgui.widgets.scrollpanel :as scrollpanel]))
+            [flatgui.widgets.scrollpanel :as scrollpanel])
+  (:import (java.awt.event KeyEvent)))

 (def layout-cfg
   [[[:a :-] [:a :-] [:a :-] [:b :c :d :-]]
@@ -27,9 +30,13 @@
    [[:m :|] [:n :|] [:o :|] [:p :|]]])

 (fg/defevolverfn :layout
-  (if (and
-        (= (fg/get-reason) [:config :apply])
-        (abtn/button-pressed? (get-property [:config :apply] :pressed-trigger)))
+  (if (or
+        (and
+          (= (fg/get-reason) [:config :apply])
+          (abtn/button-pressed? (get-property [:config :apply] :pressed-trigger)))
+        (and
+          (= (fg/get-reason) [:config :scroll :content-pane :textfield])
+          (abtn/button-pressed? (get-property [:config :scroll :content-pane :textfield] :pressed-trigger))))
     (read-string (get-property [:config :scroll :content-pane :textfield] :text))
     old-layout))

@@ -77,6 +84,15 @@
         (catch Exception e (do (println "Config invalid: " (.getMessage e)) false)))
       false)))

+(fg/defevolverfn shortcut-pressed-evolver :pressed
+  (cond
+    (and
+      (keyboard/key-pressed? component)
+      (inputbase/with-ctrl? component)
+      (= (keyboard/get-key component) KeyEvent/VK_A)) true
+    (keyboard/key-released? component) false
+    :else old-pressed))
+
 (def layout-window
   (fg/defcomponent
     window/window
@@ -105,19 +121,21 @@
                                                             :auto-size true
                                                             :paint-border false
                                                             :model text-model
-                                                            :text (:text text-model)})}})}})
+                                                            :text (:text text-model)
+                                                            :evolvers {:pressed shortcut-pressed-evolver
+                                                                       :pressed-trigger abtn/pressed-trigger-evolver}})}})}})

     (fg/defcomponent label/label :validity-indicator
       {:text "Valid"
        :foreground (awt/color 64 255 64)
        :evolvers {:text (fg/accessorfn (if (get-property component [] :config-valid)
-                                         "Valid"
-                                         "Not valid"))
+                                         "Current config: valid"
+                                         "Current config: invalid"))
                   :foreground (fg/accessorfn (if (get-property component [] :config-valid)
                                                (awt/color 64 255 64)
                                                (awt/color 255 64 64)))}})

-    (fg/defcomponent button/button :apply {:text "Apply"})))
+    (fg/defcomponent button/button :apply {:text "Apply (Ctrl+A)"})))

 (def root-panel
   (fg/defcomponent


Account for empty DB record on initial run

--- src/aerobio/server.clj
+++ src/aerobio/server.clj
@@ -153,6 +153,7 @@
           reqtype (get-in reqmap [:headers "reqtype"])]
       (if (= reqtype "cmdline")
         (let [{:keys [user cmd action rep compfile eid]} params
+              _ (when (not (cmn/get-exp eid)) (cmn/set-exp eid))
               exp (cmn/get-exp-info eid :exp)
               tempnm (str (name exp) "-" action "-job-template")
               template (get-jobinfo tempnm)


[CIRCLE-2649] Add another safeguard against nil session-id values (#1670)

* Add another safeguard against nil session-id values

* add debug messages

--- src-cljs/frontend/analytics/amplitude.cljs
+++ src-cljs/frontend/analytics/amplitude.cljs
@@ -1,12 +1,17 @@
 (ns frontend.analytics.amplitude
   (:require [goog.net.cookies :as cookies]
-            [frontend.utils :as utils :include-macros]))
+            [frontend.utils :as utils :include-macros true]))

 (def session-cookie-name "amplitude-session-id")

 (defn session-id []
   (utils/swallow-errors
-    (js/amplitude.getSessionId)))
+    (let [sid (js/amplitude.getSessionId)]
+      (when (not sid)
+        (println sid)
+        (println js/amplitude)
+        (println js/window.amplitude))
+      (or sid -1))))

 (defn set-session-id-cookie!
   "Cookies the user with their amplitude session-id. Set the cookie
@@ -15,4 +20,6 @@
   Set the opt_maxAge to -1 as it is a session cookie:
     https://google.github.io/closure-library/api/goog.net.Cookies.html"
   []
-  (cookies/set session-cookie-name (session-id) -1 "/"))
+  (cookies/set session-cookie-name (session-id) -1 "/")
+  (println "set cookie")
+  (println (cookies/get session-cookie-name)))


default values better

default values better

--- dada-core/src/main/clojure/org/dada/core.clj
+++ dada-core/src/main/clojure/org/dada/core.clj
@@ -1,43 +1,46 @@
 (ns
  org.dada.core
  (:use org.dada.core.UnionModel)
- (:import (clojure.lang
-	   DynamicClassLoader
-	   ISeq
-	   Keyword
-	   )
-	  (java.sql
-	   Connection
-	   ResultSet
-	   ResultSetMetaData
-	   )
-	  (java.util
-	   Collection
-	   Date)
-	  (java.util.concurrent.locks
-	   Lock)
-	  (org.springframework.context.support ClassPathXmlApplicationContext)
-	  (org.springframework.beans.factory BeanFactory)
-	  (org.slf4j Logger LoggerFactory)
-	  (org.dada.asm ClassFactory)
-	  (org.dada.core
-	   AbstractModel
-	   Attribute
-	   Creator
-	   Getter
-	   MetaModel
-	   MetaModelImpl
-	   Metadata
-	   MetadataImpl
-	   Model
-	   ServiceFactory
-	   StringMetadata
-	   UnionModel
-	   Update
-	   View
-	   )
-	  (org.dada.demo Client)
-	  ))
+ (:import
+  (clojure.lang
+   DynamicClassLoader
+   ISeq
+   Keyword
+   )
+  (java.sql
+   Connection
+   ResultSet
+   ResultSetMetaData
+   )
+  (java.util
+   Collection
+   Date)
+  (java.util.concurrent.locks
+   Lock)
+  (org.springframework.context.support ClassPathXmlApplicationContext)
+  (org.springframework.beans.factory BeanFactory)
+  (org.slf4j Logger LoggerFactory)
+  (org.dada.asm ClassFactory)
+  (org.dada.core
+   AbstractModel
+   Attribute
+   Creator
+   DummyLock
+   Getter
+   MetaModel
+   MetaModelImpl
+   Metadata
+   MetadataImpl
+   Model
+   ServiceFactory
+   StringMetadata
+   SynchronousServiceFactory
+   UnionModel
+   Update
+   View
+   )
+  (org.dada.demo Client)
+  ))

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

@@ -61,15 +64,8 @@

 ;; TODO: Spring should look after this - see application-context.xml...
 (if (not (System/getProperty "dada.broker.name")) (System/setProperty "dada.broker.name" "DADA"))
-(if (not (System/getProperty "dada.broker.uri")) (System/setProperty "dada.broker.uri" "tcp://localhost:61616"))
-
-(do
-  (def #^ServiceFactory *external-metamodel-service-factory* nil)
-  (def #^ServiceFactory *external-model-service-factory* nil)
-  (def #^ServiceFactory *internal-view-service-factory* nil)
-  (def #^Lock *exclusive-lock* nil)
-  (def #^MetaModel *metamodel* nil))
-
+(if (not (System/getProperty "dada.broker.uri")) (System/setProperty "dada.broker.uri" "tcp://0.0.0.0:61616"))
+(if (not (System/getProperty "dada.broker.uri")) (System/setProperty "dada.client.uri" "tcp://localhost:61616"))

 (defn insert [#^View view item]
   (.update view (list (Update. nil item)) '() '())
@@ -83,6 +79,14 @@

 (defn delete [#^View view value]
   (.update view '() '() (list (Update. value nil))))
+
+(do
+  (def #^ServiceFactory *external-metamodel-service-factory* (SynchronousServiceFactory.))
+  (def #^ServiceFactory *external-model-service-factory* (SynchronousServiceFactory.))
+  (def #^ServiceFactory *internal-view-service-factory* (SynchronousServiceFactory.))
+  (def #^Lock *exclusive-lock* (DummyLock.))
+  (def #^MetaModel *metamodel* (MetaModelImpl. (str (System/getProperty "dada.broker.name") ".MetaModel") (StringMetadata. "Name") *external-metamodel-service-factory*))
+  (insert *metamodel* *metamodel*))

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


fix clojure startup warning about core/get-in

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -1,4 +1,5 @@
 (ns babel.english
+  (:refer-clojure :exclude [get-in])
   (:require
    [babel.engine :as engine]
    [babel.forest :as forest]


+(defn sentences)

+(defn sentences)

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -80,3 +80,14 @@
    (parse/parse (preprocess input) model)))

+(defn sentences []
+  (let [model (medium)]
+    (repeatedly #(println (str (let [expr (generate {:modified false
+                                                     :synsem {:cat :verb}}
+                                                    :model model)
+                                     fo (fo expr :show-notes false)]
+                                 (str (string/capitalize (nth fo 0))
+                                      (string/join "" (rest (vec fo)))
+                                      ".")))))))
+
+


Fix wrong return type of unsign method on jws backend.

--- src/buddy/sign/jws.clj
+++ src/buddy/sign/jws.clj
@@ -215,4 +215,4 @@
   [& args]
   (let [result (apply decode args)]
     (when (either/right? result)
-      result)))
+      (either/from-either result))))


Use the new aspire.templates/render fn.

Use the new aspire.templates/render fn.

--- src/clj/aspire/web.clj
+++ src/clj/aspire/web.clj
@@ -33,9 +33,7 @@
   ;; All other templating should be handled client-side.
   :available-media-types ["text/html"]
   :handle-ok (fn [_]
-               (reduce str (a-tpl/index "hi"))
-               #_"
hi there
"
-               ))
+               (a-tpl/render (a-tpl/index "hi"))))

 (defresource resource-api
   :available-media-types ["application/edn"]


Icebreakers with dynamic strengths. Atman, Crowbar, Spike, Sage, Gordian Blade, Study Guide, Snowball.

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -1428,7 +1428,7 @@
     :events {:run {:choices {:req #(and (= (:zone %) [:rig :program])
                                         (has? % :subtype "Icebreaker"))}
                    :msg (msg "give " (:title target) " +1 strength")
-                   :effect (effect (pump target 1))}}}
+                   :effect (effect (pump target 1 :all-run))}}}

    "New Angeles City Hall"
    {:events {:agenda-stolen {:msg "trash itself" :effect (effect (trash card))}}
@@ -2150,7 +2150,11 @@
     :choices (req (filter #(has? % :subtype "Icebreaker") (:deck runner)))}

    "Spike"
-   {:abilities [{:msg "break up to 3 barrier subroutines" :effect (effect (trash card))}]}
+   {:abilities [{:msg "break up to 3 barrier subroutines" :effect (effect (trash card))}]
+    :events (let [cloud {:req (req (has? target :subtype "Icebreaker"))
+                         :effect (effect (update-breaker-strength card))}]
+              {:runner-install cloud :trash cloud :card-moved cloud})
+    :strength-bonus (req (count (filter #(has? % :subtype "Icebreaker") (get-in runner [:rig :program]))))}

    "Spinal Modem"
    {:effect (effect (gain :memory 1)) :leave-play (effect (lose :memory 1)) :recurring 2
@@ -2515,7 +2519,10 @@
    "Atman"
    {:prompt "How many power counters?" :choices :credit :msg (msg "add " target " power counters")
     :effect (effect (set-prop card :counter target))
-    :abilities [{:cost [:credit 1] :msg "break 1 subroutine"}]}
+    :abilities [{:cost [:credit 1] :msg "break 1 subroutine"}]
+    :strength-bonus (req (or (:counter card) 0))
+    :events {:counter-added {:req (req (= :cid target) (:cid card))
+                             :effect (effect (update-breaker-strength card))}}}

    "Aurora"
    {:abilities [{:cost [:credit 2] :msg "break 1 barrier subroutine"}
@@ -2524,7 +2531,7 @@
    "Battering Ram"
    {:abilities [{:cost [:credit 2] :msg "break up to 2 barrier subroutines"}
                 {:cost [:credit 1] :msg "add 1 strength for the remainder of this run"
-                 :effect (effect (pump card 1 true))}]}
+                 :effect (effect (pump card 1 :all-run))}]}

    "BlacKat"
    {:abilities [{:cost [:credit 1] :msg "break 1 barrier subroutine"}
@@ -2559,7 +2566,11 @@
                 {:cost [:credit 1] :msg "add 1 strength" :effect (effect (pump card 1))}]}

    "Crowbar"
-   {:abilities [{:msg "break up to 3 code gate subroutines" :effect (effect (trash card))}]}
+   {:abilities [{:msg "break up to 3 code gate subroutines" :effect (effect (trash card))}]
+    :events (let [cloud {:req (req (has? target :subtype "Icebreaker"))
+                         :effect (effect (update-breaker-strength card))}]
+              {:runner-install cloud :trash cloud :card-moved cloud})
+    :strength-bonus (req (count (filter #(has? % :subtype "Icebreaker") (get-in runner [:rig :program]))))}

    "Crypsis"
    {:abilities [{:cost [:credit 1] :msg "break ICE subroutine"}
@@ -2612,7 +2623,7 @@
    "Gordian Blade"
    {:abilities [{:cost [:credit 1] :msg "break 1 code gate subroutine"}
                 {:cost [:credit 1] :msg "add 1 strength for the remainder of this run"
-                 :effect (effect (pump card 1 true))}]}
+                 :effect (effect (pump card 1 :all-run))}]}

    "Gingerbread"
    {:abilities [{:cost [:credit 1] :msg "break 1 tracer subroutine"}
@@ -2663,7 +2674,7 @@
    "Pipeline"
    {:abilities [{:cost [:credit 1] :msg "break 1 sentry subroutine"}
                 {:cost [:credit 2] :msg "add 1 strength for the remainder of this run"
-                 :effect (effect (pump card 1 true))}]}
+                 :effect (effect (pump card 1 :all-run))}]}

    "Refractor"
    {:abilities [{:cost [:credit 1] :msg "break 1 code gate subroutine"}
@@ -2674,13 +2685,15 @@
     :effect (req (add-watch state (keyword (str "sage" (:cid card)))
                             (fn [k ref old new]
                               (when (not= (get-in old [:runner :memory]) (get-in new [:runner :memory]))
-                                (set-prop ref side card :counter 0)))))
-    :leave-play (req (remove-watch state (keyword (str "sage" (:cid card)))))}
+                                (update-breaker-strength ref side card))))
+                 (update-breaker-strength state side card))
+    :leave-play (req (remove-watch state (keyword (str "sage" (:cid card)))))
+    :strength-bonus (req (:memory runner))}

    "Snowball"
-   {:abilities [{:cost [:credit 1] :msg "break 1 barrier subroutine"}
-                {:cost [:credit 1] :msg "add 1 strength for the remainder of the run"
-                 :effect (effect (pump card 1 true))}]}
+   {:abilities [{:cost [:credit 1] :msg "break 1 barrier subroutine"
+                 :effect (effect (pump card 1 :all-run))}
+                {:cost [:credit 1] :msg "add 1 strength" :effect (effect (pump card 1))}]}

    "Sharpshooter"
    {:abilities [{:msg "break any number of destroyer subroutines" :effect (effect (trash card))}
@@ -2688,7 +2701,9 @@

    "Study Guide"
    {:abilities [{:cost [:credit 1] :msg "break 1 code gate subroutine"}
-                {:cost [:credit 2] :msg "place 1 power counter" :effect (effect (add-prop card :counter 1))}]}
+                {:cost [:credit 2] :msg "place 1 power counter" :effect (effect (add-prop card :counter 1)
+                                                                                (update-breaker-strength card))}]
+    :strength-bonus (req (or (:counter card) 0))}

    "Switchblade"
    {:abilities [{:cost [:credit 1] :msg "break any number of sentry subroutines"}


Separate out subsuming parents; add name normalization

--- src/angelic/search/implicit/dash_astar.clj
+++ src/angelic/search/implicit/dash_astar.clj
@@ -26,47 +26,25 @@

 ;;  (except ensuring consistency if we're asserting it...)
 ;; When we create a stub, we also get: tree summarizer, subsumption-thing.
-;; (subsumption-children are parent tree-summarizers).
-;; Subsumption-thing is subsumption-child of stub, summarizer, tree-summarizer.
-;; Tree-summarizers also remember best bound, this gives us consistency
-;; How do they pass to children, though?
-;; Apparent cycle -- tree summarizer has children that are child tree-summarizers,
-;; And, these children should have the parent TS as a subsumption child.
-;; Key: this is only to preserve info from original SP, subsumption..
-;; This info should go into subsumption-thing.
-;; Subsumption-thing is just ordinary max over children, + self, + TS?
-;; ->>(We rely on eager updates to make sure it gets updated?)
-
-;; TDB should not actually go into TS, children should be directly bounded?
-;; All children, including inner SP, should do it fine.
-;; This means that every thing has exactly one subsumption parent ... which is nice.
-;; How does consistency get approached ?
-;; We just have the cycle, but would be great if we didn't have to go in child --> ts --> st --> children
-;; cycle every time things to up -- maybe ST just doesn't update ord. parents.
-;; TODO: figure this out later.
 ;; TODO: tests !
-
-;; Can goall the way down to nearest sum, I guess...
-;; Subsumer gets attached to subsumer of any child (or inner child?)

 ;; What do we do about multiple ways to express a given plan ? ? ? ?
 ;; Can normalize or not, interesting question... start without.

-;; TODO: things are propagating in the wrong order !
-;; Act SP gets added as output of Act stub.
-;; This is watched by both Top SP and Act TS.
-;; Top SP gets it first.
-;; We need to make sure we present consistent picture.
-;; This means putting add-stub-output in TS ?
-
-;; TODO: need to wrap seqs too ?
-
 ;; TODO: remove refs to stubs in TS so dead weight can be GC'd?
-
 ;; TODO first: propagate subsumption links.
 ;; TODO second: add pessimistic variant. (primitives shared!)

 ;; TODO: bounding of pessimistic descriptions ? (assume consistency for now).
+
+;; Two basic kinds of subsumption propagation:
+;;   X --> Y ==> for all child keys k, child(X, k) --> child(Y, k)
+;;   This taken into account for atomic, not pairs now.
+
+;;   X --> Y ==> for all child keys k, child(X, k) --> child(Y, k)
+
+;; TODO: we seem to be losing sa/oc sometimes ...
+;; TODO: wrapping names don't match pair-stub1.  Drop them for now, restore?

 (set! *warn-on-reflection* true)

@@ -115,16 +93,25 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;      Tree Summarizers      ;;;;;;;;;;;;;;;;;;;;;;;;;;

-(declare sp-ts get-stub-output)
-
-;; Does not need to watch stub, that happens automatically to ensure ordering.
+(declare sp-ts get-stub-output norm-name)
+
 ;; TODO: now this will never be true; how to avoid extra connections ?
-
-(defprotocol TreeSummarizer (ts-stub [ts]))
+(defprotocol TreeSummarizer
+  (ts-stub [ts])
+  (subsuming-tss [ts]) ; True tree summarizers subsuming this one.
+  (add-subsuming-ts! [ts subsuming-ts]))
+

 (defn- make-tree-summarizer [stb]
-  (let [ret (traits/reify-traits [summaries/or-summarizable summaries/simple-cached-node]
-              TreeSummarizer (ts-stub [ts] stb))]
+  (let [subsuming-tss-list (ArrayList.)
+        ret (traits/reify-traits [summaries/or-summarizable summaries/simple-cached-node]
+              TreeSummarizer
+              (ts-stub [ts] stb)
+              (subsuming-tss [ts] (seq subsuming-tss-list))
+              (add-subsuming-ts! [ts subsuming-ts]
+                (util/assert-is (= (norm-name (stub-name stb)) (norm-name (stub-name (ts-stub subsuming-ts)))))
+                (.add subsuming-tss-list subsuming-ts)
+                (summaries/connect-subsumed! subsuming-ts ts)))]
     (when-not (get-stub-output stb)
       (summaries/connect! ret stb)
       (summaries/connect-subsumed! ret stb))
@@ -136,10 +123,6 @@
  (let [s (ts-stub s)]
   (print-method (format "#<TS$%8h %s>" (System/identityHashCode s) (stub-name s)) o)))

-;; TODO: this basically looks just like old version now.
-;; Main new idea was to be: auto-propagate subsumption arcs forward...
-;; This is also what's needed for pess?
-
 ;; TODO: think about status of published output -- does it need updating ?

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -161,10 +144,6 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Used by stubs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn- with-subsuming-sp! [subsuming-sp stub]
-  (when subsuming-sp
-    (summaries/connect-subsumed! (sp-ts subsuming-sp) (tree-summarizer stub)))
-  stub)

 ;; TODO: set stub to -inf here, simplify other code?
 ;; TODO: efficiency?
@@ -224,7 +203,6 @@
     (set-stub-output! ret (sp-fn ret))
     ret))

-;; TODO: Connect ts to something ??
 (defn- make-wrapping-stub [[nm in-set] inner-stub sp-fn]
   (let [ret (traits/reify-traits [summaries/or-summarizable watched-node]
               Stub (stub-name       [s] nm)
@@ -273,7 +251,11 @@
    [(simple-subproblem
      stub out-set terminal? ;; Note ni may have different context.
      (fn [s ni]
-       (if (= ni (input-set stub)) stub (with-subsuming-sp! s (ri-fn s ni)))))]
+       (if (= ni (input-set stub))
+         stub
+         (let [subsumed-stub (ri-fn s ni)]
+           (add-subsuming-ts! (tree-summarizer subsumed-stub) (tree-summarizer stub))
+           subsumed-stub))))]
    summaries/Summarizable (summarize [s] (summary-fn s))))

@@ -315,11 +297,6 @@
             (connect-and-watch-stub! ret (make-output-collecting-stub (stub o))
               #(add-sp-child! ret %)))))) ;; No update needed
     ret))
-
-(comment
- (defmethod make-stub* :OC [[_ inner-name :as n] inp subsuming-sp]
-            (assert (nil? subsuming-sp))
-            (make-output-collecting-stub (make-stub* inner-name inp nil))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;     State Abstraction     ;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -371,36 +348,36 @@
       (fn [o] (connect-and-watch-stub-up! ret (make-state-abstracted-stub (stub o) in) #(add-sp-child! ret %))))
     ret))

-(comment
-  (defmethod make-stub* :SA [[_ inner-name :as n] inp subsuming-sp]
-    (assert (nil? subsuming-sp))
-    (make-state-abstracted-stub (make-stub* inner-name inp nil) inp)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;     Core Subproblems     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;      Names       ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-

 (defn atomic-name [fs] [:Atomic fs])
 (defn pair-name [l r] [:Pair l r])

 (defn left-factor [is]
   (loop [s (next is) ret (first is)]
-    (if s
-      (recur (next s) (pair-name ret (first s)))
-      ret)))
+    (if s (recur (next s) (pair-name ret (first s))) ret)))

 (defn right-factor [[f & r]]
-  (if (seq r)
-    (pair-name f (right-factor r))
-    f))
+  (if (seq r) (pair-name f (right-factor r)) f))

 (defn- make-fs-seq-name [fs-seq]
   (assert (seq fs-seq))
   ((if *left-recursive* left-factor right-factor)
    (map atomic-name fs-seq)))
+
+;; TODO: flatten as well?
+(defn norm-name [n]
+  (case (first n)
+    :Atomic n
+    :Pair   [:Pair (norm-name (nth n 1)) (norm-name (nth n 2))]
+    :SA     (norm-name (second n))
+    :OC     (norm-name (second n))))
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;      Atomic       ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@@ -456,7 +433,6 @@
             (do (reset! state :go) (summaries/summary-changed! s))))))))

-;; (since it may already exist)!
 ;; Note: we must always wrap in S-A stub to get effects out of logger.
 (defmethod get-stub :Atomic [[_ fs :as n] inp-set subsuming-sp]
   (let [full-name [n (if *state-abstraction* (fs/extract-context fs inp-set) inp-set)]
@@ -511,6 +487,8 @@

 (defn- make-pair-stub2 [left-sp right-stub]
+;  (util/assert-is (= (first (sp-name left-sp)) :SA))
+;  (util/assert-is (= (first (stub-name right-stub)) :SA))
   (let [nm (pair-name (sp-name left-sp) (stub-name right-stub))
         is (input-set (stub left-sp))]
     (assert (= (output-set left-sp) (input-set right-stub)))
@@ -523,6 +501,7 @@
         ret))))

 ;; Note, potential to learn about additioan lsubsumption here, however, must be taken into account.
+;; TODO: name does not match wrapping names.
 (defn- make-pair-stub1 [nm left-stub right-stub-fn]
   (if-let [left-sp (get-stub-output left-stub)]
     (make-pair-stub2 left-sp (right-stub-fn (output-set left-sp)))


Bugfix for the new* macro.

Bugfix for the new* macro.

--- src/appengine_magic/services/datastore.clj
+++ src/appengine_magic/services/datastore.clj
@@ -321,12 +321,11 @@

 (defmacro new* [entity-record-type property-values & {:keys [parent]}]
-  (if parent
-      `(let [parent# ~parent
-             entity# (new ~entity-record-type ~@property-values)]
-         (if (nil? parent#)
-             entity#
-             (with-meta entity# {:key (get-key-object entity# parent#)})))))
+  `(let [parent# ~parent
+         entity# (new ~entity-record-type ~@property-values)]
+     (if (nil? parent#)
+         entity#
+         (with-meta entity# {:key (get-key-object entity# parent#)}))))

 ;;; Note that the code relies on the API's implicit transaction tracking


Fixed a bug with omitting deadlines in calls to URL fetch.

--- src/appengine_magic/services/url_fetch.clj
+++ src/appengine_magic/services/url_fetch.clj
@@ -58,7 +58,8 @@
     (if follow-redirects
       (.followRedirects fetch-options)
       (.doNotFollowRedirects fetch-options))
-    (.setDeadline fetch-options (double deadline))
+    (when-not (nil? deadline)
+      (.setDeadline fetch-options (double deadline)))
     (let [method-obj (method {:delete HTTPMethod/DELETE
                               :get    HTTPMethod/GET
                               :head   HTTPMethod/HEAD


Transitions working, include opcode decoder

Opcode dispatch is simply a set of transitions generated from the
opcode map.

Still need to handle transferring of instruction into the control unit

--- src/computer_build.clj
+++ src/computer_build.clj
@@ -13,7 +13,7 @@
 (def static-states {
   :fetch {:control-signals '(:rd_pc, :wr_addr), :next :store_instruction}
   :store_instruction {:control-signals '(:rd_ram, :wr_ir), :next :decode}
-  ;:decode {:control-signals '(:rd_ir)}
+  :decode {:control-signals '()}
 })

 (defn flatten-1 [things]
@@ -73,7 +73,7 @@
 (defn control-unit [instructions]
   "Given a set of states, make a control unit that will
   execute them"
-  (let [states (make-states instructions)
+  (let [states (merge (make-states instructions) static-states)
         control-signals (set (apply concat (map (fn [[_ body]] (:control-signals body)) states)))
         opcodes (make-opcodes instructions)]
     (defn realize-state [state]
@@ -88,15 +88,17 @@
                    ; outputs
                    (zipmap control-signals (repeat (count control-signals) std-logic))
                    ; signals
-                   {
-                    :ir (std-logic-vector (- (count (second (first opcodes))) 1) 0)
-                    }
+                   { :opcode (std-logic-vector (- (count (second (first opcodes))) 1) 0) }
                    ; reset
                    (vec (map #(list 'low %) control-signals))
                    ; states
                    (mapmap realize-state states)
                    ; transitions
-                   []
+                   (concat
+                     ; states
+                     (map #(list (first %) (:next (second %))) states)
+                     ; decode
+                     (map #(list :decode `(= :opcode ~(second %)) (keyword (str (first %) "_0"))) opcodes))
                    )))

 (defn build* [cpuname instructions]


docs fix ("a signal")

docs fix ("a signal")

--- src/cljx/jamesmacaulay/zelkova/signal.cljx
+++ src/cljx/jamesmacaulay/zelkova/signal.cljx
@@ -197,7 +197,7 @@
   of the `from` channel and a producer on the `to` channel, and should close the
   `to` channel when the `from` channel is closed. There are no requirements for
   how many values should be put on the `to` channel or when they should be sent.
-  `splice` returns signal with an initial value of `init`, which asynchronously
+  `splice` returns a signal with an initial value of `init`, which asynchronously
   produces whichever values are put on the `to` channel in the `setup!` function."
   [setup! init source]
   (let [topic [::splice init setup! source]


Minor fixes

Minor fixes

--- clinicico.worker/src/clinicico/worker.clj
+++ clinicico.worker/src/clinicico/worker.clj
@@ -5,7 +5,8 @@
             [langohr.channel   :as lch]
             [langohr.queue     :as lq]
             [langohr.consumers :as lc]
-            [langohr.basic     :as lb]))
+            [langohr.basic     :as lb]
+            [clojure.tools.logging :as log]))

 (def ^{:const true}
   exchange-name "")
@@ -13,8 +14,9 @@
 (defn message-handler
   [ch {:keys [content-type delivery-tag type] :as meta} ^bytes payload]
   (do
-    (println (format "[consumer] Received a message: %s, delivery tag: %d, content type: %s, type: %s"
-                     (String. payload "UTF-8") delivery-tag content-type type))
+    (log/debug
+      (format "[consumer] Received a message: %s, delivery tag: %d, content type: %s, type: %s"
+        (String. payload "UTF-8") delivery-tag content-type type))
     (Thread/sleep 2000)))

 (defn start-consumer
@@ -30,9 +32,9 @@
   [& args]
   (let [[options args banner]
         (cli args
-             ["-h" "--help" "Show help" :default false :flag true]
-             ["-n" "--nworkers" "The amount of worker threads to start" :default (.availableProcessors (Runtime/getRuntime)) :parse-fn #(Integer. %)]
-             ["-m" "--method" "The R method and queue name to execute" :default "echo"])
+          ["-h" "--help" "Show help" :default false :flag true]
+          ["-n" "--nworkers" "The amount of worker threads to start" :default (.availableProcessors (Runtime/getRuntime)) :parse-fn #(Integer. %)]
+          ["-m" "--method" "The R method and queue name to execute" :default "echo"])
         conn (rmq/connect)
         qname (format "task.%s" (:method options))]
     (when (or (:help options))
@@ -40,7 +42,7 @@
       (System/exit 0))
     (dotimes [n (:nworkers options)]
       (let [ch (lch/open conn)]
-        (println (format "[main] Connected worker %d. Channeld id: %d for channel %s" n (.getChannelNumber ch) qname))
+        (log/debug (format "[main] Connected worker %d. Channeld id: %d for channel %s" (inc n) (.getChannelNumber ch) qname))
         (lq/declare ch qname :exclusive false :auto-delete true)
         (start-consumer conn ch qname)))
       (while true (Thread/sleep 100))


Docstrings

Docstrings

--- src/main/clojure/clojure/data/json_new.clj
+++ src/main/clojure/clojure/data/json_new.clj
@@ -211,8 +211,8 @@

      :keywordize boolean

-        If true (default) convert JSON properties from strings into
-        keywords.
+        If true (default) convert JSON property names from strings
+        into keywords.

      :bigdec boolean

@@ -226,7 +226,7 @@
      :eof-value Object

         Object to return if the stream is empty and eof-error? is
-        true. Default is nil."
+        false. Default is nil."
   [reader & options]
   (let [{:keys [keywordize eof-error? eof-value bigdec]
          :or {keywordize false


reverting to use dissoc-in version that dosnt nullify keys since protocols lose identity

--- src/main/clojure/com/narkisr/fs_logic.clj
+++ src/main/clojure/com/narkisr/fs_logic.clj
@@ -1,6 +1,6 @@
 (ns com.narkisr.fs-logic
   (:import java.io.File)
-  (:use (clojure.contrib (def :only [defmacro-]) (core :only [dissoc-in]))
+  (:use (clojure.contrib (def :only [defmacro-]))
         (com.narkisr (file-info :only [split-path]))
          pattern-match))

@@ -25,6 +25,9 @@
 (defn filehandle? [node] (= (type node) :filehandle))

 (defn xattr-map [file]  (apply hash-map (:xattrs file)))
+
+(defn dissoc-in [data keys]
+  (assoc-in data (butlast keys) (dissoc (get-in data (butlast keys)) (last keys))))

 (defn- path-match-to-keys [path]
   (match path


fix model name formatting problem

fix model name formatting problem

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -793,8 +793,7 @@
 			[reduction-metadata-accessor reduction-applicator reduction-name]
 			((apply reduction-monad split reduction-args))
 			[reduction-metadata reduction-key] (reduction-metadata-accessor)
-			tgt-name (str (.getName src-model) "." (apply collection tgt-key) "=*." reduction-name)
-			dummy (println "MGROUP" (.getName src-model) "." (apply collection tgt-key) "=*." reduction-name)
+			tgt-name (str (.getName src-model) "." (apply str tgt-key) "=*." reduction-name)
 			tgt-model (model tgt-name reduction-metadata)]
 		    (insert *metamodel* tgt-model)
 		    (hook tgt-model tgt-key)


CMR-8767: Added tests for association-details for service, tool, grid and collection. tests for variable already exist. (#1774)

Co-authored-by: siwei xu <6532de1a8b5e90ff3cadd14b3ab551515d3f3d37@raytheon.com>

--- system-int-test/test/cmr/system_int_test/search/generic_association_test.clj
+++ system-int-test/test/cmr/system_int_test/search/generic_association_test.clj
@@ -83,18 +83,20 @@
     (index/wait-until-indexed)
     (testing "Associate collection with tool by concept-id and revision-ids"
       (let [response1 (association-util/associate-by-concept-ids
-                       token tl1-concept-id [{:concept-id coll1-concept-id}
-                                             {:concept-id coll2-concept-id}])
+                       token tl1-concept-id [{:concept-id coll1-concept-id :revision-id coll1-revision-id}
+                                             {:concept-id coll2-concept-id :data "some data"}])
             _ (index/wait-until-indexed)
             ;;Search for the tool tl1, it should return the association
             tl1-search-result (search-request "tools.umm_json" "native_id=tl1")
             tl1-search-body (json/parse-string (:body tl1-search-result) true)
             tl1-search-generic-associations (get-in (first (:items tl1-search-body)) [:meta :associations :collections])
+            tl1-search-generic-association-details (get-in (first (:items tl1-search-body)) [:meta :association-details :collections])

             ;;Search for the collection coll1, it should return the association
             coll1-search-result (search-request "collections.umm-json" "entry_title=entry-title1")
             coll1-search-body (json/parse-string (:body coll1-search-result) true)
             coll1-search-generic-associations (get-in (first (:items coll1-search-body)) [:meta :associations :tools])
+            coll1-search-generic-association-details (get-in (first (:items coll1-search-body)) [:meta :association-details :tools])

             ;;Search for the collection coll2, it should return the association
             coll2-search-result (search-request "collections.umm-json" "entry_title=entry-title2")
@@ -105,10 +107,15 @@
         ;; Search for the tool tl1 returns the coll1 and coll2 as association
         (is (= (set [coll2-concept-id coll1-concept-id])
                (set tl1-search-generic-associations)))
+        (is (= (set [{:concept-id coll1-concept-id, :revision-id coll1-revision-id}
+                     {:data "some data", :concept-id coll2-concept-id}])
+               (set tl1-search-generic-association-details)))

         ;; Search for the collection coll1 returns the tl1 as association
         (is (= [tl1-concept-id]
                coll1-search-generic-associations))
+        (is (= [{:concept-id tl1-concept-id}]
+               coll1-search-generic-association-details))

         ;; Search for the collection coll2 returns the tl1 as association
         (is (= [tl1-concept-id]
@@ -202,6 +209,7 @@
             grid-search-result (search-request "grids.json" "name=Grid-A7-v1")
             grid-search-body (json/parse-string (:body grid-search-result) true)
             grid-search-generic-associations (get-in (first (:items grid-search-body)) [:associations :tools])
+            grid-search-generic-association-details (get-in (first (:items grid-search-body)) [:association-details :tools])

             ;;Search for the tool, it should return the association
             tl1-search-result (search-request "tools.umm_json" "native_id=tl1")
@@ -243,6 +251,8 @@
         ;; Search for the grid returns the tl1 as generic association
         (is (= [tl1-concept-id]
                grid-search-generic-associations))
+        (is (= [{:concept-id tl1-concept-id :revision-id tl1-revision-id}]
+               grid-search-generic-association-details))

         ;; Search for the tool returns the grid as generic association
         (is (= [grid-concept-id]
@@ -297,13 +307,14 @@
     (index/wait-until-indexed)
     (testing "Associate collection with service by concept-id and revision-ids"
       (let [response1 (association-util/associate-by-concept-ids
-                       token sv1-concept-id [{:concept-id coll1-concept-id}
-                                             {:concept-id coll2-concept-id}])
+                       token sv1-concept-id [{:concept-id coll1-concept-id :revision-id coll1-revision-id}
+                                             {:concept-id coll2-concept-id :data "some data"}])
             _ (index/wait-until-indexed)
             ;;Search for the service sv1, it should return the association
             sv1-search-result (search-request "services.umm_json" "native_id=sv1")
             sv1-search-body (json/parse-string (:body sv1-search-result) true)
             sv1-search-generic-associations (get-in (first (:items sv1-search-body)) [:meta :associations :collections])
+            sv1-search-generic-association-details (get-in (first (:items sv1-search-body)) [:meta :association-details :collections])

             ;;Search for the collection coll1, it should return the association
             coll1-search-result (search-request "collections.umm-json" "entry_title=entry-title1")
@@ -319,6 +330,9 @@
         ;; Search for the service sv1 returns the coll1 as association
         (is (= (set [coll2-concept-id coll1-concept-id])
                (set sv1-search-generic-associations)))
+        (is (= (set [{:concept-id coll1-concept-id, :revision-id coll1-revision-id}
+                     {:data "some data", :concept-id coll2-concept-id}])
+               (set sv1-search-generic-association-details)))

         ;; Search for the collection coll1 returns the sv1 as association
         (is (= [sv1-concept-id]


Refactoring csv to map schema conversion

--- env/dev/clj/gtfve/datomic.clj
+++ env/dev/clj/gtfve/datomic.clj
@@ -36,7 +36,7 @@
 (defn- assoc-temp-id [m]
   (assoc m :db/id (d/tempid :db.part/user)))

-(defn csv->map
+(defn csv->maps
   "Create a transaction from csv found in path. header-map is a map of strings
   to keywords defining column to keyword mappings for the generated transaction
   map. transform-vals is a map of keywords to functions defining function
@@ -73,7 +73,8 @@

 (defn load-agency! [path conn]
   (->> path
-       (csv->map agency-header-keys {})
+       (csv->maps agency-header-keys {})
+       (map assoc-temp-id)
        (d/transact conn)))

 ;; Routes ;;
@@ -94,7 +95,10 @@
   {:route/agency #(vector :agency/id %)})

 (defn load-routes! [path conn]
-  (d/transact conn (csv->map routes-header-keys routes-val-transforms path)))
+  (->> path
+       (csv->maps routes-header-keys routes-val-transforms)
+       (map assoc-temp-id)
+       (d/transact conn)))

 ;; Stops ;;
 ;;;;;;;;;;;
@@ -119,7 +123,10 @@
    :stop/location-type read-string})

 (defn load-stops! [path conn]
-  (d/transact conn (csv->map stops-header-keys stops-val-transforms path)))
+  (->> path
+       (csv->maps stops-header-keys stops-val-transforms)
+       (map assoc-temp-id)
+       (d/transact conn)))

 ;; Calendar ;;
 ;;;;;;;;;;;;;;
@@ -163,9 +170,9 @@

 (defn load-calendar! [path conn]
   (->> path
-       (csv->map calendar-header-keys calendar-val-transforms)
+       (csv->maps calendar-header-keys calendar-val-transforms)
        (map (partial process-calendar-map calendar-days))
-       (map drop-empty)
+       (map assoc-temp-id)
        (d/transact conn)))

 ;; Shapes ;;


Improved comments in examples namespace.

--- src/clj_formal_specifications_app/examples.clj
+++ src/clj_formal_specifications_app/examples.clj
@@ -1,8 +1,6 @@
 (ns clj-formal-specifications-app.examples
   (:require [clojure.string :as str]
             [clojure.java.io :as io]))
-
-; Getting a list of files named public/examples/something.clj is quite a task.

 (def example-dir "public/examples/")

@@ -14,12 +12,17 @@
   [entry]
   (re-matches (re-pattern (str example-dir ".*.clj")) (.getName entry)))

+; Getting a list of files named public/examples/something.clj is quite a task.
+
 (defn examples-in-jar
+  "Opens a jar file at uri and returns a list of example specification
+  files inside of it."
   [uri]
   (with-open [jar (java.util.jar.JarFile. uri)]
     (doall (filter example-entry? (enumeration-seq (.entries jar))))))

 (defn get-jar-path
+  "If uri points inside to a jar file, returns uri to the jar file itself."
   [uri]
   (re-find #"(?<=jar:file:).+(?=[!])" uri))

@@ -32,6 +35,7 @@
   (rest (file-seq (io/file (io/resource uri)))))

 (defn filename-as-text
+  "Turns 'some_file.clj' into 'Some file'."
   [filename]
   (str/capitalize
    (str/replace (str/replace filename #"_" " ") #".clj" "")))


update example how to resolve body format with Muuntaja

--- examples/ring-swagger/src/example/server.clj
+++ examples/ring-swagger/src/example/server.clj
@@ -27,24 +27,36 @@
          :swagger {:tags ["spec"]}}

         ["/plus"
-         {:get {:summary "plus with spec"
+         {:get {:summary "plus with spec query parameters"
                 :parameters {:query {:x int?, :y int?}}
                 :responses {200 {:body {:total int?}}}
                 :handler (fn [{{{:keys [x y]} :query} :parameters}]
                            {:status 200
-                            :body {:total (+ x y)}})}}]]
+                            :body {:total (+ x y)}})}
+          :post {:summary "plus with spec body parameters"
+                 :parameters {:body {:x int?, :y int?}}
+                 :responses {200 {:body {:total int?}}}
+                 :handler (fn [{{{:keys [x y]} :body} :parameters}]
+                            {:status 200
+                             :body {:total (+ x y)}})}}]]

        ["/schema"
         {:coercion schema/coercion
          :swagger {:tags ["schema"]}}

         ["/plus"
-         {:get {:summary "plus with schema"
+         {:get {:summary "plus with schema query parameters"
                 :parameters {:query {:x Int, :y Int}}
                 :responses {200 {:body {:total Int}}}
                 :handler (fn [{{{:keys [x y]} :query} :parameters}]
                            {:status 200
-                            :body {:total (+ x y)}})}}]]]
+                            :body {:total (+ x y)}})}
+          :post {:summary "plus with schema body parameters"
+                 :parameters {:body {:x Int, :y Int}}
+                 :responses {200 {:body {:total Int}}}
+                 :handler (fn [{{{:keys [x y]} :body} :parameters}]
+                            {:status 200
+                             :body {:total (+ x y)}})}}]]]

       {:data {:middleware [ring.middleware.params/wrap-params
                            muuntaja.middleware/wrap-format
@@ -57,7 +69,10 @@
                                     "application/transit+json"}
                         :consumes #{"application/json"
                                     "application/edn"
-                                    "application/transit+json"}}}})
+                                    "application/transit+json"}}}
+       ;; TODO: these should work by default!
+       :extract-request-format (comp :format :muuntaja/request)
+       :extract-response-format (comp :format :muuntaja/response)})
     (ring/routes
       (swagger-ui/create-swagger-ui-handler
         {:path "/", :url "/api/swagger.json"})


Add sample om-next devcard

Add sample om-next devcard

--- src/discuss/cards.cljs
+++ src/discuss/cards.cljs
@@ -1,15 +1,28 @@
 (ns discuss.cards
   (:require [om.core :as om :include-macros true]
-            [sablono.core :as sab :include-macros true]
+            [sablono.core :as html :refer-macros [html]]
+            [om.next :as nom :refer-macros [defui]]
+            [discuss.parser :as parser]
             [discuss.utils.common :as lib]
             [discuss.views :as views])
-  (:require-macros [devcards.core :as dc :refer [defcard defcard-om deftest]]))
+  (:require-macros [devcards.core :as dc :refer [defcard defcard-om defcard-om-next deftest]]))

 (enable-console-print!)

 (defcard-om discuss
   views/main-view
   lib/app-state)
+
+(defui Foo
+  Object
+  (render [this]
+          (html [:h1 "Wuki"])))
+(def foo (nom/factory Foo))
+
+(defcard-om-next wuki-card
+  foo
+  parser/reconciler)
+

 ;; -----------------------------------------------------------------------------
 ;; Start devcards
@@ -18,6 +31,6 @@
   ;; conditionally start the app based on whether the #main-app-area
   ;; node is on the page
   (when-let [node (.getElementById js/document "main-app-area")]
-    (.render js/ReactDOM (sab/html [:div "This is working"]) node)))
+    (.render js/ReactDOM (html [:div "This is working"]) node)))

 (main)


+surface

+surface

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -189,6 +189,7 @@
               {:source-id (first (map :source_id results))
                :source (first (map :source results))
                :source-v2 {:language source-language
+                           :surface (first (map :source results))
                            :locale source-locale}
                :target-spec target-spec
                :targets-v2 (map (fn [result]


@otfrom rubber duckie - you're the one.

@otfrom rubber duckie - you're the one.

--- src/kixi/hecuba/data/measurements/download.clj
+++ src/kixi/hecuba/data/measurements/download.clj
@@ -81,7 +81,10 @@
 (defn indexes-of [v xs]
   (set (keep-indexed (fn [i x] (when (= x v) i)) xs)))

-(defn filled-measurements [measurements]
+(defn measurements->columns [ms]
+  (map (fn [[{:keys [timestamp value]} & more]] (apply vector timestamp value (map :value more))) ms))
+
+(defn filled-measurements [measurements out]
   (let [sentinel         (Object.)
         is-sentinel?     #(identical? % sentinel)
         next-or-sentinel #(if-let [n (next %)] n [sentinel])
@@ -90,12 +93,9 @@
                            (when-let [row (first (apply map vector (replace-empty xs)))]
                              (when (not-every? is-sentinel? row)
                                row)))]
-    (loop [ms measurements data (list)]
+    (loop [ms measurements]
       (let [row (next-row ms)]
-        (if-not row
-          (if (seq data)
-            (apply map vector data)
-            (list))
+        (when row
           (let [row-timestamps (mapv :timestamp row)
                 row-timestamp  (first (sort (remove nil? row-timestamps)))
                 data-indexes   (indexes-of row-timestamp row-timestamps)
@@ -105,10 +105,9 @@
                                                        (hash-map :timestamp row-timestamp :value nil))) row)
                 fns            (map-indexed (fn [i _] (if (has-data? i) next-or-sentinel identity)) row)
                 step           (fn [xs] (map (fn [f v] (f v)) fns xs))]
-            (recur (step ms) (concat data [out-row]))))))))
+            (csv/write-csv out (map measurements->columns out-row))
+            (recur (step ms))))))))

-(defn measurements->columns [ms]
-  (map (fn [[x & more]] (apply vector (:timestamp x) (:value x) (map :value more))) ms))

 (defn generate-file [store item]
   (let [{:keys [header data]} item
@@ -117,7 +116,7 @@
     (try
       (with-open [out (io/writer tmpfile)]
         (csv/write-csv out header)
-        (csv/write-csv out (measurements->columns (filled-measurements data))))
+        (filled-measurements data out))
       (s3/store-file (:s3 store) (-> item
                                      (assoc :dir      (.getParent tmpfile)
                                             :filename (.getName tmpfile))


removed friction from list of forces because it is not a motion

--- src/clj/sol/core.clj
+++ src/clj/sol/core.clj
@@ -51,7 +51,6 @@
    :revolution
    :rotation
    :fluctuation
-   :friction
    :acceleration])

 (def instability-limit 13)


Release

Release


reorder deps

reorder deps

--- src/metabase/task/send_anonymous_stats.clj
+++ src/metabase/task/send_anonymous_stats.clj
@@ -4,10 +4,10 @@
             (clojurewerkz.quartzite [jobs :as jobs]
                                     [triggers :as triggers])
             [clojurewerkz.quartzite.schedule.cron :as cron]
-            [metabase.util.stats :as stats]
             (metabase [config :as config]
                       [public-settings :as public-settings]
-                      [task :as task])))
+                      [task :as task])
+            [metabase.util.stats :as stats]))

 (def ^:private ^:const job-key     "metabase.task.anonymous-stats.job")
 (def ^:private ^:const trigger-key "metabase.task.anonymous-stats.trigger")


Onboarding headers style

Onboarding headers style

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/intro/styles.cljs
+++ src/status_im/ui/screens/intro/styles.cljs
@@ -32,7 +32,9 @@
    :transform        [{:translateX (animated/mix progress (- progress-size) 0)}]})

 (def wizard-title
-  {:margin-bottom 16})
+  {:margin-bottom 16
+   :typography    :header
+   :text-align    :center})

 (def wizard-text
   {:color      colors/gray


Split out 'sub-paths and adjust to return file components.

This is being done to facilitate merge commit handling. We don't care
about non-'project.clj' files but we'll get them anyways now. They add
only a small size to the DB.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -958,6 +958,15 @@
      (.getBuildNumber dav)
      (.getQualifier dav)]))

+(defn sub-paths
+  "Turns path 'foo/bar/baz/quux' into:
+  ['' 'foo' 'foo/bar' 'foo/bar/baz' 'foo/bar/baz/quux']"
+  [path]
+  (-> path
+      (s/split #"/")
+      (->> (reductions #(str %1 "/" %2)))
+      (conj "")))
+
 (defn exported-commits
   [gitdir tip-shas seen-shas]
   (let [marks-file (File/createTempFile "marks" ".txt")]
@@ -1042,13 +1051,7 @@
               (->/when-let [[_ dir] (re-matches #"(.*)(^|/)project.clj" path)]
                 (->/apply pldb/db-fact r-proj (:sha commit) dir
                           (proj-fact-tail gitdir file-sha))))
-            (->/for [dir-path (set (mapcat (fn [path]
-                                             (let [parts (drop-last
-                                                          (s/split path #"/"))]
-                                               (if (empty? parts)
-                                                 [""]
-                                                 (reductions #(str %1 "/" %2) parts))))
-                                           (keys (:paths commit))))]
+            (->/for [dir-path (set (mapcat sub-paths (keys (:paths commit))))]
               (pldb/db-fact r-commit-path (:sha commit) dir-path))))))))

 (def voomdb-header "voom-db-2")


[Fix #225] Use orchard.info/info

[Fix #225] Use orchard.info/info

--- src/refactor_nrepl/ns/resolve_missing.clj
+++ src/refactor_nrepl/ns/resolve_missing.clj
@@ -1,6 +1,6 @@
 (ns refactor-nrepl.ns.resolve-missing
   "Resolve a missing symbol on the classpath."
-  (:require [cider.nrepl.middleware.info :refer [info-clj]]
+  (:require [orchard.info :refer [info]]
             [cider.nrepl.middleware.util.cljs :as cljs]
             [cljs-tooling.util.analysis :as cljs-ana]
             [clojure.string :as str]
@@ -15,7 +15,7 @@
            (slamhound/candidates :refer (symbol (suffix sym)) [] {})]))

 (defn- get-type [sym]
-  (let [info (info-clj 'user sym)]
+  (let [info (info 'user sym)]
     (if-let [clazz (:class info)]
       (cond
         ((set (:interfaces info)) 'clojure.lang.IType) :type


mapcat

mapcat

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -270,6 +270,20 @@
 ;; - Show the example of efficient loop generation
 ;; --------------------------------------------------------

+;; Note: how to do recursive nested loops:
+#_(loop [i 5
+         r 0]
+    (if (pos? i)
+      (recur
+        (dec i)
+        (loop [j 5
+               r r]
+          (if (pos? j)
+            (recur (dec j) (inc r))
+            r)
+          ))
+      r))
+
 ;; Phase 1
 #_(defmacro inline-reduce
     [reducer initial transforms coll]
@@ -297,7 +311,6 @@
         remaining (rest transforms)]
     (case op
       ;;TODO - Multimethod here for extensibility
-      ;;TODO - How to do mapcat (not nested loop-recur)
       :map
       `(let [h2# (~fct ~h)]
          (inline-reducer ~reducer ~remaining ~r h2#))
@@ -305,6 +318,9 @@
       `(if (~fct ~h)
          (inline-reducer ~reducer ~remaining ~r ~h)
          ~r)
+      :mapcat
+      `(let [h2# (~fct ~h)]
+         (inline-reduce ~reducer ~r ~remaining h2#))
       `(~reducer ~r ~h))))

 (defmacro inline-reduce
@@ -339,6 +355,13 @@
               + 0
               [[:filter odd?] [:map #(* 2 %)]]
               coll))
+
+    (report (inline-reduce
+              + 0
+              [[:filter odd?]
+               [:map #(* 2 %)]
+               [:mapcat (fn [x] [x x])]]
+              coll))
     ))


current badge always appears in metabadge block

--- src/cljs/salava/metabadge/ui/metabadge.cljs
+++ src/cljs/salava/metabadge/ui/metabadge.cljs
@@ -30,8 +30,12 @@
       meta_badge_req [:div {:title "This badge is part of a milestone badge"} [:span [:i.link-icon {:class "fa fa-puzzle-piece"}]]]
       :else nil)))

+(defn current-badge [required_badges]
+  (->> required_badges (filter :current) first))
+
 (defn required-block-badges [m]
-  (take 20 (shuffle (:required_badges m))))
+  (let [current-badge (current-badge (:required_badges m))]
+    (into [current-badge] (take 19 (remove :current (:required_badges m))))))

 (defn partition-count [m]
   (let [no (count (required-block-badges m))]
@@ -42,7 +46,7 @@
   (let [{:keys [received name image criteria]} (:badge m)
         milestone-image-class (if received "" " not-received")]
     [:a {:href "#" :on-click #(mo/open-modal [:metabadge :metadata] m)}
-     [:div.metabadge
+     [:div.metabadge {:class (if (> (count (:required_badges m)) 8) " metabadge-large")}
       [:div.panel
        [:div.panel-heading (:name m)
         [:div.pull-right (if (:milestone? m) [:i {:class "fa fa-sitemap"}] [:i {:class "fa fa-puzzle-piece"}])]]
@@ -62,7 +66,7 @@
                                                           [:td [:div [:img.img-circle {:src image :alt name :title name :class (if current "img-thumbnail" "")}]]]
                                                           [:td [:div [:img.img-circle.not-received {:src image :alt name :title name} ]]]))))
                                             [:tr]
-                                            coll))) [:tbody] (partition-all (partition-count m) (required-block-badges m) #_(take 20 (shuffle (:required_badges m)))))]]]]]]]]]))
+                                            coll))) [:tbody] (partition-all (partition-count m) (required-block-badges m)))]]]]]]]]]))

 (defn metabadge-link [assertion-url state]


Ditto

Ditto

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -1,3 +1,12 @@
+;; Copyright (c) 2012-2014 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team
+;;
+;; The use and distribution terms for this software are covered by the
+;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;; which can be found in the file epl-v10.html at the root of this distribution.
+;; By using this software in any fashion, you are agreeing to be bound by
+;; the terms of this license.
+;; You must not remove this notice, or any other, from this software.
+
 (ns clojurewerkz.cassaforte.cql
   "Main namespace for working with CQL, prepared statements. Convenience functions
    for key operations built on top of CQL."


add image prefix

add image prefix

--- crawler.clj
+++ crawler.clj
@@ -5,9 +5,9 @@

 (def n (atom 0))

-(defn save-image [url dir]
+(defn save-image [url dir prefix]
   (with-open [in (io/input-stream (str/replace url #" " "%20"))
-              out (io/output-stream (str dir "/" (swap! n inc) ".jpg"))]
+              out (io/output-stream (str dir "/" prefix "_" (swap! n inc) ".jpg"))]
     (io/copy in out)))

 (def links (let [dom (-> "http://www.butterflycircle.com/checklist/"
@@ -22,18 +22,21 @@
                   first
                   text
                   str/lower-case)
+        species (-> (select dom [:div#content-container :div.right :table.details [:tr (nth-child 4)] [:td (nth-child 2)] :i])
+                    first
+                    text)
         imgs (->> (select dom [:div#gallery-thumbs :div :img])
                   (map #(get-in % [:attrs :data-image])))]
-    [genus imgs]))
+    [genus species imgs]))

 (defn save-data []
   (doseq [link links]
     (println link)
-    (let [[genus imgs] (butterfly link)
+    (let [[genus species imgs] (butterfly link)
           img-dir (str "data/" genus)]
       (.mkdir (io/file img-dir))
       (println "save" (count imgs) "images into dir" img-dir)
-      (doall (map #(save-image % img-dir) imgs)))))
+      (doall (map #(save-image % img-dir species) imgs)))))

 (defn cleanup []
   (doseq [dir (->> (file-seq (io/file "data"))


Changed deprecated functions

Changed deprecated functions

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -237,8 +237,8 @@
         "Automap MIDI" 10 21 :sparkle-chance :min 0.01 :max 0.2)
       (show/add-midi-control-to-var-mapping
         "Automap MIDI" 10 22 :sparkle-fade :min 1 :max 500)
-      (show/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 51 0 7)
-      (show/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 52 1 7)
+      (cues/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 51 0 7)
+      (cues/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 52 1 7)
       (show/add-midi-control-to-var-mapping "Automap MIDI" 10 66 :osc-beat-ratio :max 3 :transform-fn (fn [v] (Math/pow 2 (Math/round (- 3 v)))))
       (show/add-midi-control-to-var-mapping
         "Automap MIDI" 10 25 :lightness-max-general :min 0 :max 100)
@@ -258,7 +258,7 @@
         "Automap MIDI" 10 23 :main-hue :min 0 :max 360)

       ; Reset beat mapping from MIDI button to a cue
-      (show/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 58 7 7)
+      (cues/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 58 7 7)
     )
   )

@@ -309,50 +309,6 @@
 (afterglow.show/set-variable! :osc-beat-ratio 8)
 (afterglow.show/set-variable! :front-1-note 0)
 (afterglow.show/set-variable! :main-adjust-hue 0)
-
-(defn light-sawtooth-phase
-  "Change light of fixtures with phase shift. WIP."
-  []
-  (let [phase-gradient (params/build-spatial-param  ; Spread a phase shift across fixtures
-      (show/all-fixtures)
-      (fn [head] (- (:x head) (:min-x @(:dimensions *show*)))) :max 1)]
-    (let [light-param (params/build-oscillated-param
-      (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true :phase phase-gradient) :max :max-lightness)]
-      (show/add-effect! :color (global-color-effect
-        (params/build-color-param :s 100 :l light-param :h :main-hue))
-      )
-    )
-  )
-)
-
-(defn light-sawtooth-color
-  "Change light according to sawtooth osc & hue phase"
-  ([]
-    (light-sawtooth-color (show/all-fixtures))
-    )
-  ([fixtures]
-    (let [light-param (params/build-oscillated-param
-      (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true) :max :max-lightness)
-          hue-param (params/build-oscillated-param
-      (oscillators/square-beat :beat-ratio 16 :down? true) :max 90)
-    ]
-      (show/add-effect! :color (afterglow.effects.color/color-effect
-                          "Light sawtooth color" (params/build-color-param :h :main-hue :s 100 :l light-param :adjust-hue hue-param) fixtures))
-    ))
-)
-
-(defn light-to-param
-  "Change light according to dynamic parameter"
-  [param]
-  (let [light-param (params/build-oscillated-param
-    (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true) :max :max-lightness)
-        hue-param (params/build-oscillated-param
-    (oscillators/square-beat :beat-ratio 16 :down? true) :max 90)
-  ]
-    (show/add-effect! :color (global-color-effect
-      (params/build-color-param :h :main-hue :s 100 :l param)))
-  )
-)

 (defn shutter-open
   "Open shutters on heads in London show"
@@ -532,7 +488,7 @@
           "Bass" (params/build-color-param :h :main-hue :s 100 :l :audio-bass-front) (show/fixtures-named "front"))
     ))))

-  (let [light-param (params/build-oscillated-param
+  (let [light-param (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-back)]
     (ct/set-cue! (:cue-grid *show*) 0 2
       (cues/cue :color  (fn [_] (afterglow.effects/scene
@@ -542,7 +498,7 @@
       )))))

-  (let [light-param (params/build-oscillated-param
+  (let [light-param (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-front)]
     (ct/set-cue! (:cue-grid *show*) 1 2
       (cues/cue :color  (fn [_] (afterglow.effects/scene
@@ -551,9 +507,9 @@
             "Bass" (params/build-color-param :h :main-hue :s 100 :l light-param) (show/fixtures-named "front"))
       )))))

-  (let [light-param-back (params/build-oscillated-param
+  (let [light-param-back (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-back)
-        light-param-front (params/build-oscillated-param
+        light-param-front (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-front)]
     (ct/set-cue! (:cue-grid *show*) 2 2
       (cues/cue :color  (fn [_] (afterglow.effects/scene
@@ -567,7 +523,7 @@
   (ct/set-cue! (:cue-grid *show*) 1 2
     (cues/cue :color  (fn [_] (afterglow.effects/scene
       "Sine Back & Front"
-      (let [light-param (params/build-oscillated-param
+      (let [light-param (oscillators/build-oscillated-param
         (oscillators/sine :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-general)]
         (global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
       )
@@ -576,7 +532,7 @@
   (ct/set-cue! (:cue-grid *show*) 0 1
     (cues/cue :color  (fn [_] (afterglow.effects/scene
       "Sawtooth All"
-      (let [light-param (params/build-oscillated-param
+      (let [light-param (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-general)]
         (global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
       )
@@ -585,7 +541,7 @@
   (ct/set-cue! (:cue-grid *show*) 1 1
     (cues/cue :color  (fn [_] (afterglow.effects/scene
       "Sine All"
-      (let [light-param (params/build-oscillated-param
+      (let [light-param (oscillators/build-oscillated-param
         (oscillators/sine :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-general)]
         (global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
       )
@@ -594,7 +550,7 @@
   (ct/set-cue! (:cue-grid *show*) 2 1
     (cues/cue :color  (fn [_] (afterglow.effects/scene
       "Saw all, change colors 16B"
-      (let [light-param (params/build-oscillated-param
+      (let [light-param (oscillators/build-oscillated-param
         (oscillators/sawtooth :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-general)]
         (fx/chase "Saw all, hue adjust" [(global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
           (global-color-effect (params/build-color-param :h :main-hue :adjust-hue 30 :s 100 :l light-param))
@@ -621,7 +577,7 @@
   (ct/set-cue! (:cue-grid *show*) 3 1
     (cues/cue :color  (fn [_] (afterglow.effects/scene
       "Sine all, change colors 16B"
-      (let [light-param (params/build-oscillated-param
+      (let [light-param (oscillators/build-oscillated-param
         (oscillators/sine :interval :beat :interval-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :lightness-max-general)]
         (fx/chase "Saw all, hue adjust" [(global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
           (global-color-effect (params/build-color-param :h :main-hue :adjust-hue 30 :s 100 :l light-param))


Mention max idle time, while we're at it

--- src/demo/caching.clj
+++ src/demo/caching.clj
@@ -16,8 +16,11 @@
 ;;; Put an entry in the cache
 (.put foo :a 1)

-;;; Override its time-to-live
+;;; Override its time-to-live...
 (.put foo :a 1, 1 TimeUnit/HOURS)
+;;; ...and its max idle time...
+(.put foo :a 1, 1 TimeUnit/HOURS, 20 TimeUnit/MINUTES)
+;;; ...also works for putIfAbsent, putAll, and replace

 ;;; Add all the entries in the map to the cache
 (.putAll foo {:b 2, :c 3})


style fixes: re-arrange args of functions;

--- src/docker/image.clj
+++ src/docker/image.clj
@@ -18,7 +18,7 @@
                                   :status 409
                                   :message "Conflicts while "}})

-(defn show-all [client & {:keys [all] :or {all 0}}]
+(defn show-all
   "Lists all images on Docker host.
   Arguments:
     client  - the initialized client for docker API
@@ -27,6 +27,7 @@
   Usage:
     (show-all client)
     (show-all client :all 10)"
+  [client & {:keys [all] :or {all 0}}]
   (let [params {:all all}
         {:keys [status body error]} (dc/rpc-get client "/images/json"
                                                 {:query-params params})]
@@ -38,8 +39,7 @@

 ;;TODO: finish authorization
 ;;TODO: add support for from-src
-(defn create [client image
-              & {:keys [from-src repo tag registry]}]
+(defn create
   "Creates an new image, either by pull it from the registry or importing it from file.
   Arguments:
     client - initialized docker client
@@ -53,6 +53,7 @@
     (create client \"registry\")
     (create client \"registry\" :tag \"latest\")
   "
+  [client image & {:keys [from-src repo tag registry]}]
   (let [params {:fromImage image
                 :repo repo
                 :tag tag
@@ -66,7 +67,7 @@
       (throw+ (merge (:unspecified exceptions)
                      {:response resp})))))

-(defn delete [client image-name & {:keys [force] :or {force false}}]
+(defn delete
   "Remove image from filesystem
   Arguments:
     client - initialized docker client
@@ -75,6 +76,7 @@
     :force - ignore possible errors while removing it, default false.
   Usage:
     (delete client \"registry\")"
+  [client image-name & {:keys [force] :or {force false}}]
   (let [{:keys [status body]
          :as resp} (dc/rpc-delete client (str "/images/" image-name)
                                          {:query-params {:force force}})]
@@ -86,7 +88,7 @@
       (throw+ (merge (:unspecified exceptions) resp)))))

-(defn insert-file [client image url path]
+(defn insert-file
   "Inserts a file from the url in the image on the path.
   Arguments:
     client  - initialized client
@@ -97,6 +99,7 @@
     a lazy-seq of parsed json-stream.
   Usage:
     (insert-file client \"http://s3.in/folder/file.exe\" \"/usr/shared\")"
+  [client image url path]
   (let [params {:url url, :path path}
         {:keys [status body]
          :as resp} @(dc/stream-post client
@@ -109,7 +112,7 @@
                 (:unspecified exceptions)
                 (:response resp))))))

-(defn inspect [client image]
+(defn inspect
   "Returns low-level information on the image name
   Arguments:
     client  - an initialized docker's client
@@ -118,6 +121,7 @@
     plain Clojure map
   Usage:
     (inspect client \"lapax/tiny-haproxy\")"
+  [client image]
   (let [{:keys [status body]} (dc/rpc-get client
                                           (str "/images/" image "/json"))]
     (case status
@@ -126,7 +130,7 @@
       500 (throw+ (:server-error exceptions))
       (throw+ (:unspecified exceptions)))))

-(defn history [client image]
+(defn history
   "Returns the history of the image
   Arguments:
     client  - the initialized client of docker
@@ -135,15 +139,16 @@
     a list of maps of history item
   Usage:
     (history client \"lapax/tiny-haproxy\")"
+  [client image]
   (let [{:keys [status body]} (dc/rpc-get client
-                                           (str "/images/" image "/history" ))]
-    (case status
-      200 (dc/parse-json client body)
-      404 (throw+ (:no-image exceptions))
-      500 (throw+ (:server-error exceptions))
-      (throw+ (:unspecified exceptions)))))
-
-(defn push [client image & {:keys [registry]}]
+                                          (str "/images/" image "/history" ))]
+    (case status
+      200 (dc/parse-json client body)
+      404 (throw+ (:no-image exceptions))
+      500 (throw+ (:server-error exceptions))
+      (throw+ (:unspecified exceptions)))))
+
+(defn push
   "Push the image on the registry
   Arguments:
     client  -  the initialized client for docker api
@@ -155,6 +160,7 @@
   Usage:
     (push client \"lapax/tiny-haproxy\")
     (push client \"lapax/tiny-haproxy\" :registry \"http://url\")"
+  [client image & {:keys [registry]}]
   (let [params {:registry registry}
         {:keys [status body]} @(dc/stream-post client
                                              (str "/images/" image "/push")
@@ -166,8 +172,7 @@
       500 (throw+ (:server-error exceptions))
       (throw+ (:unspecified exceptions)))))

-(defn tag [client image & {:keys [repo force]
-                           :or {repo "default", force false}}]
+(defn tag
   "Tags the image into a repository
   Arguments:
     client  - the initialized client of docker
@@ -180,6 +185,8 @@
   Usage:
     (tag client \"base\" :repo \"default\")
     (tag client \"base\" :repo \"default\" :force true)"
+  [client image & {:keys [repo force]
+                   :or {repo "default", force false}}]
   (let [params {:repo repo, :force force}
         {:keys [status body]} (dc/rpc-get client
                                           (str "/images/" image "/tag")
@@ -192,7 +199,7 @@
       500 (throw+ (:server-error exceptions))
       (throw+ (:unspecified exceptions)))))

-(defn search [client search-term]
+(defn search
   "Searches for an image in the docker index.
   Arguments:
     client      -  the initialized client
@@ -201,6 +208,7 @@
     a list with search results
   Usage:
     (search client \"sshd\")"
+  [client search-term]
   (let [params {:term search-term}
         {:keys [status body]} (dc/rpc-get client
                                           (str "/images/search")


add debug prints, and fix a few bugs ;)

add debug prints, and fix a few bugs ;)

--- src/herring/core.clj
+++ src/herring/core.clj
@@ -40,11 +40,16 @@
   [ch {:keys [content-type delivery-tag type] :as meta} ^bytes payload]
   (if (= content-type "application/json")
     (do
+      (println "<< in auth-handler >>")
       (let [data (json/read-str (String. payload "UTF-8"))
             username (get data "username")
             password (get data "password")
             response-key (get data "responseKey")
             response-payload (json/write-str (authenticate-user username password))]
+        (println (clojure.string/join ", " [username
+                                            password
+                                            response-key
+                                            response-payload]))
         (lb/publish ch
                     response-exchange
                     response-key


(PE-2406) re-use readable objects

(PE-2406) re-use readable objects

--- src/puppetlabs/trapperkeeper/bootstrap.clj
+++ src/puppetlabs/trapperkeeper/bootstrap.clj
@@ -62,22 +62,30 @@
       (string/replace #"(?:#|;).*$" "")
       (string/trim)))

-(defn- config-path-readable?
-  "Answers whether or not the given config path contains a readable file.
-   Supports specifying the config file via URI, so it can be inside a .jar."
-  [path]
-  (or
-    (.exists (file path))
-    (try
-      (input-stream (URI. path))
-      true
-      (catch Exception e
-        false))))
+(defn- open-config-file
+  [config-path]
+  (let [config-file (file config-path)]
+    (if (.exists config-file)
+      config-file
+
+      ;; if that didn't work (won't for a URI of a file inside a .jar),
+      ;; get a bigger hammer
+      (try
+        (input-stream (URI. config-path))
+        (catch Exception ignored
+          ;; If that didn't work either, we can't read it.  Don't wrap and
+          ;; re-throw here, as `ignored` may be misleading (in the case of a
+          ;; normal path, it is useless - there is no reason to mess with URIs)
+          (throw (IllegalArgumentException.
+                   (str "Specified bootstrap config file does not exist: '"
+                        config-path "'"))))))))

 (defn- config-from-cli
   "Given the data from the command-line (parsed via `core/parse-cli-args!`),
   check to see if the caller explicitly specified the location of the bootstrap
-  config file.  If so, return it.  Throws an IllegalArgumentException if a
+  config file.  If so, return an object that can be read via `reader` (will
+  normally be a `file`, but in the case of a config file inside of a .jar, it
+  will be an `input-stream`).  Throws an IllegalArgumentException if a
   location was specified but the file doesn't actually exist."
   [cli-data]
   {:pre  [(map? cli-data)]
@@ -85,12 +93,11 @@
               (satisfies? IOFactory %))]}
   (when (contains? cli-data :bootstrap-config)
     (when-let [config-path (cli-data :bootstrap-config)]
-      (if (config-path-readable? config-path)
-        (do
-          (log/debug (str "Loading bootstrap config from specified path: '" config-path "'"))
-          config-path)
-        (throw (IllegalArgumentException.
-                 (str "Specified bootstrap config file does not exist: '" config-path "'")))))))
+      (let [config-file (open-config-file config-path)]
+        (log/debug (str "Loading bootstrap config from specified path: '"
+                        config-path "'"))
+        config-file))))
+

 (defn- config-from-cwd
   "Check to see if there is a bootstrap config file in the current working


Fix element-nss

Fix element-nss

--- src/main/clojure/clojure/data/xml/event.clj
+++ src/main/clojure/clojure/data/xml/event.clj
@@ -17,7 +17,7 @@
   (:import (clojure.data.xml.node Element CData Comment)))

 (definline element-nss* [element]
-  (get (meta element) :clojure.data.xml/nss {}))
+  `(get (meta ~element) :clojure.data.xml/nss {}))

 (defn element-nss
   "Get xmlns environment from element"


fixed tests for text objects

fixed tests for text objects

--- test/clj/zee3/draw/draw_selenium_test.clj
+++ test/clj/zee3/draw/draw_selenium_test.clj
@@ -91,20 +91,20 @@

 (deftest text-mouseup
    (let [act (:actions *driver*)]
-      (.moveToElement act (:webelement (element {:tag :canvas})) 36 120)
+      (.moveToElement act (:webelement (element {:tag :canvas})) 15 110)
       (.click act)
       (.perform act))
    (is (= (test-output) "text-mouseup")))

 (deftest text-mousemove
    (let [act (:actions *driver*)]
-      (.moveToElement act (:webelement (element {:tag :canvas})) 76 110)
+      (.moveToElement act (:webelement (element {:tag :canvas})) 56 110)
       (.perform act))
    (is (= (test-output) "text-mousemove")))

 (deftest text-mousedown
    (let [act (:actions *driver*)]
-      (.moveToElement act (:webelement (element {:tag :canvas})) 116 130)
+      (.moveToElement act (:webelement (element {:tag :canvas})) 106 110)
       (.click act)
       (.perform act))
    (is (= (test-output) "text-mousedown")))


turned back on the project settings link when the user is not in the ui-v2

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -149,7 +149,7 @@
       (assoc :navigation-point navigation-point
              :navigation-data (assoc args
                                      :show-aside-menu? (not (feature/enabled? :ui-v2))
-                                     :show-settings-link? false)
+                                     :show-settings-link? (not (feature/enabled? :ui-v2)))
              :project-settings-project-name project-name)
       (assoc-in state/crumbs-path [{:type :dashboard}
                                    {:type :org :username org}


only display last 20 messages in dev gui

--- app/gui/html/cljs/defpi/ws.cljs
+++ app/gui/html/cljs/defpi/ws.cljs
@@ -32,7 +32,7 @@
    (apply dom/div nil
           (map (fn [m]
                  (dom/div nil (:val m)))
-               (reverse (:messages data))))))
+               (take 20 (reverse (:messages data)))))))

 (om/root app-state message-comp (.getElementById js/document "app-messages"))
 (om/root app-state jobs-comp (.getElementById js/document "app-jobs"))
@@ -47,7 +47,8 @@

 (defn show-msg
   [msg]
-  (swap! app-state update-in [:messages] conj msg))
+  (swap! app-state update-in [:messages] conj msg)
+  )

 (defn reply-sync
   [msg res]


Update to latest tools.reader for TRDR-33 (syntax-quote)

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,6 +1,7 @@
 (defproject planck "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.clojure/clojurescript "1.7.189"]
+                 [org.clojure/tools.reader "1.0.0-alpha3"]
                  [tailrecursion/cljson "1.0.7"]
                  [com.cognitect/transit-clj "0.8.275"]
                  [com.cognitect/transit-cljs "0.8.220"]


CMR-1750: Refactored code based on review comments.

--- common-lib/src/cmr/common/util.clj
+++ common-lib/src/cmr/common/util.clj
@@ -325,9 +325,9 @@
   "Recursively delete the directory or file by the given name. Does nothing if the file does not exist."
   [fname]
   (when (.exists (io/file fname))
-    (let [func (fn [func f]
-                 (when (.isDirectory f)
-                   (doseq [f2 (.listFiles f)]
-                     (func func f2)))
-                 (io/delete-file f))]
-      (func func (io/file fname)))))
+    (letfn [(delete-recursive
+              [^java.io.File file]
+              (when (.isDirectory file)
+                (dorun (map delete-recursive (.listFiles file))))
+              (io/delete-file file))]
+      (delete-recursive (io/file fname)))))


Revert "Debugging a CI server failure"

Revert "Debugging a CI server failure"

This reverts commit 036ea8955dc288d0eecbd41f425a54c8f65bb3e5.

--- test/com/puppetlabs/puppetdb/test/core.clj
+++ test/com/puppetlabs/puppetdb/test/core.clj
@@ -40,9 +40,10 @@
 (deftest successful-command-invocation
   (let [success? (atom false)
         fail? (atom false)]
-    (run-command #(reset! success? true)
-                 #(reset! fail? true)
-                 ["version"])
+    (with-out-str
+      (run-command #(reset! success? true)
+                   #(reset! fail? true)
+                   ["version"]))
     (is (true? @success?))
     (is (false? @fail?))))


Update formatting for stacktrace test

Update formatting for stacktrace test

--- ring-devel/test/ring/middleware/test/stacktrace.clj
+++ ring-devel/test/ring/middleware/test/stacktrace.clj
@@ -6,15 +6,15 @@
 (def assert-app    (wrap-stacktrace (fn [_] (assert (= 1 2)))))

-(def html-req {:headers {"accept" "text/html"}})
-(def js-req   {:headers {"accept" "application/javascript"}})
+(def html-req  {:headers {"accept" "text/html"}})
+(def js-req    {:headers {"accept" "application/javascript"}})
 (def plain-req {})

 (deftest wrap-stacktrace-smoke
   (binding [*err* (java.io.StringWriter.)]
     (doseq [app [exception-app assert-app]]
       (testing "requests with Accept: text/html"
-        (let [{:keys [status headers body] :as response} (app html-req)]
+        (let [{:keys [status headers body]} (app html-req)]
           (is (= 500 status))
           (is (= {"Content-Type" "text/html"} headers))
           (is (.startsWith body "<!DOCTYPE html>"))))


[frontend]: Update project config

[frontend]: Update project config

--- frontend/project.clj
+++ frontend/project.clj
@@ -27,13 +27,20 @@
                                   [pjstadig/humane-test-output "0.8.3"]]
                    :doo {:paths {:karma "./node_modules/.bin/karma"}}}}

-  ; set plugins using aliases helps decrease "$ time lein help" significantly
-  :aliases {"cljsbuild" ["update-in" ":plugins" "conj" "[lein-cljsbuild \"1.1.4\"]" "--" "cljsbuild"]
+
+  :aliases {
+            ;; set plugins using aliases helps decrease "$ time lein help" significantly
+            "cljsbuild" ["update-in" ":plugins" "conj" "[lein-cljsbuild \"1.1.4\"]" "--" "cljsbuild"]
             "less" ["update-in" ":plugins" "conj" "[lein-less \"1.7.5\"]" "--" "less"]
             "figwheel" ["update-in" ":plugins" "conj" "[lein-figwheel \"0.5.14\"]" "--" "figwheel"]
             "git-deps" ["update-in" ":plugins" "conj" "[lein-git-deps \"0.0.2\"]" "--" "git-deps"]
             "cljfmt" ["update-in" ":plugins" "conj" "[lein-cljfmt \"0.5.6\"]" "--" "cljfmt"]
-            "doo" ["update-in" ":plugins" "conj" "[lein-doo \"0.1.7\"]" "--" "doo"]}
+            "doo" ["update-in" ":plugins" "conj" "[lein-doo \"0.1.7\"]" "--" "doo"]
+
+            ;; project tasks
+            "build" ["do"
+                     ["clean"]
+                     ["with-profile" "dev,repl" "figwheel" "dev"]]}

   :source-paths ["src"]

@@ -73,35 +80,8 @@
   :less {:source-paths ["resources/less"]
          :target-path "resources/public/css"}

-  :figwheel {
-             ;; :http-server-root "public" ;; default and assumes "resources"
-             ;; :server-port 3449 ;; default
-             ;; :server-ip "127.0.0.1"
-
-             :css-dirs ["resources/public/css"] ;; watch and update CSS
-
-             ;; Start an nREPL server into the running figwheel process
-             ;; :nrepl-port 7888
-
-             :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]
-             ;; Server Ring Handler (optional)
-             ;; if you want to embed a ring handler into the figwheel http-kit
-             ;; server, this is for simple ring servers, if this
-             ;; doesn't work for you just run your own server :)
-             ;; :ring-handler hello_world.server/handler
-
-             ;; To be able to open files in your editor from the heads up display
-             ;; you will need to put a script on your path.
-             ;; that script will have to take a file path and a line number
-             ;; ie. in  ~/bin/myfile-opener
-             ;; #! /bin/sh
-             ;; emacsclient -n +$2 $1
-             ;;
-             ;; :open-file-command "myfile-opener"
-
-             ;; if you want to disable the REPL
-             ;; :repl false
-
-             ;; to configure a different figwheel logfile path
-             ;; :server-logfile "tmp/logs/figwheel-logfile.log"
-             })
+  :figwheel {:css-dirs ["resources/public/css"] ;; watch and update CSS
+             :nrepl-port 7000
+             :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl
+                                cider.nrepl/cider-middleware
+                                refactor-nrepl.middleware/wrap-refactor]})


remove unintended :refer-clojure

remove unintended :refer-clojure

(This is meant for a separate pull request)

--- storm-core/src/clj/backtype/storm/util.clj
+++ storm-core/src/clj/backtype/storm/util.clj
@@ -36,8 +36,7 @@
   (:require [clojure [set :as set]])
   (:require [clojure.java.io :as io])
   (:use [clojure walk])
-  (:use [backtype.storm log])
-  (:refer-clojure :exclude [some?]))
+  (:use [backtype.storm log]))

 (defn wrap-in-runtime
   "Wraps an exception in a RuntimeException if needed"


Review & adapt dataset function docs

Review & adapt dataset function docs

--- backend/src/akvo/lumen/dataset.clj
+++ backend/src/akvo/lumen/dataset.clj
@@ -14,12 +14,10 @@
 (hugsql/def-db-fns "akvo/lumen/job-execution.sql")

 (defn all
-  "Return all datasets."
   [tenant-conn]
   (lib/ok (all-datasets tenant-conn)))

 (defn create
-  "Create new dataset. Body should conform..."
   [tenant-conn config error-tracker claims data-source]
   (import/handle-import-request tenant-conn config error-tracker claims data-source))

@@ -49,7 +47,7 @@
             order-by-expr)))

 (defn fetch-metadata
-  "Fetch dataset metadata (everything apart from rows) with id"
+  "Fetch dataset metadata (everything apart from rows)"
   [conn id]
   (if-let [dataset (dataset-by-id conn {:id id})]
     (let [columns (remove #(get % "hidden") (:columns dataset))]
@@ -65,7 +63,6 @@
     (lib/not-found {:error "Not found"})))

 (defn fetch
-  "Fetch dataset with id"
   [conn id]
   (if-let [dataset (dataset-by-id conn {:id id})]
     (let [columns (remove #(get % "hidden") (:columns dataset))
@@ -81,7 +78,6 @@

 (defn delete
-  "Delete dataset with id"
   [tenant-conn id]
   (let [c (delete-dataset-by-id tenant-conn {:id id})]
     (if (zero? c)
@@ -91,7 +87,6 @@
       (let [v (delete-maps-by-dataset-id tenant-conn {:id id})](lib/ok {:id id})))))

 (defn update
-  "Update dataset with id"
   [tenant-conn config dataset-id {refresh-token "refreshToken"}]
   (if-let [{data-source-spec :spec
             data-source-id :id} (data-source-by-dataset-id tenant-conn
@@ -109,7 +104,6 @@
     (lib/not-found {:id dataset-id})))

 (defn update-meta
-  "Update dataset meta with id. Body should conform..."
   [tenant-conn id {:strs [name]}]
   (update-dataset-meta tenant-conn {:id id :title name})
   (lib/ok {}))