Upgrade re-frisk dependency to 0.5.4.1

Upgrade re-frisk dependency to 0.5.4.1

--- src/leiningen/new/re_frame/project.clj
+++ src/leiningen/new/re_frame/project.clj
@@ -48,7 +48,7 @@
                    [day8.re-frame/tracing "0.5.1"]{{/10x?}}{{#cider?}}
                    [figwheel-sidecar "0.5.16"]
                    [cider/piggieback "0.3.5"]{{/cider?}}{{#re-frisk?}}
-                   [re-frisk "0.5.4"]{{/re-frisk?}}]
+                   [re-frisk "0.5.4.1"]{{/re-frisk?}}]

     :plugins      [[lein-figwheel "0.5.18"]{{#test?}}
                    [lein-doo "0.1.8"]{{/test?}}]}


Optimize `date` with no args

Optimize `date` with no args

--- src/tick/alpha/api.cljc
+++ src/tick/alpha/api.cljc
@@ -72,7 +72,7 @@
 ;; Construction and coercion

 (defn date
-  ([] (core/date (today)))
+  ([] (today))
   ([v] (core/date v)))

 (defn time


'mothods'? RLY?

'mothods'? RLY?

--- src/toggler/handler.clj
+++ src/toggler/handler.clj
@@ -51,7 +51,7 @@
   :handle-ok (fn [_] (getoggle)))

 (defresource set-toggle [component setting newval]
-  :allowed-mothods [:put]
+  :allowed-methods [:put]
   :available-media-types ["application/json"]
   :exists? (fn [_] (let [e (getoggle component setting)]
                     (if-not (nil? e)
@@ -61,7 +61,7 @@
   :handle-ok true)

 (defresource reconfigure [config]
-  :allowed-mothods [:put]
+  :allowed-methods [:put]
   :available-media-types ["application/json"]
   :exists? (fn [_] (let [e @cfg]
                     (if-not (nil? e)
@@ -79,7 +79,7 @@
   (GET "/toggle/:component" [component] (get-toggle-all-for-component component))
   (GET "/toggle/:component/:setting" [component setting] (get-toggle-for-component-and-setting component setting))
   (PUT "/toggle" {body :body} (let [bodydecoded (decode (slurp body) true)]
-                                (setoggle (get bodydecoded :component) (get bodydecoded :setting) (get bodydecoded :newval))))
+                                (set-toggle (get bodydecoded :component) (get bodydecoded :setting) (get bodydecoded :newval))))
   (comment (POST "/toggle" {body :body} (create-toggle body)))
   (route/not-found "Not Found")
   (route/resources "/"))


Adds docstring to prune-empty-maps.

Adds docstring to prune-empty-maps.

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
@@ -92,6 +92,9 @@
                             {:Title "some title"}]}))

 (defn- prune-empty-maps
+  "If x is a map, returns nil if all of the map's values are nil, otherwise returns the map with
+  prune-empty-maps applied to all values. If x is a collection, returns the result of keeping the
+  non-nil results of calling prune-empty-maps on each value in x."
   [x]
   (cond
     (map? x) (let [pruned (reduce (fn [m [k v]]


results-track-view no component state

results-track-view no component state

--- src-cljs/core.cljs
+++ src-cljs/core.cljs
@@ -57,16 +57,17 @@

 (defn results-track-view [track owner]
   (reify
-    om/IRenderState
-    (render-state [this {:keys [update-filters]}]
-      (let [artist (dom/span
+    om/IRender
+    (render [this]
+      (let [search-chan (om/get-shared owner :search-channel)
+            artist (dom/span
                     #js {:className "artist"
-                         :onClick #(put! update-filters
+                         :onClick #(put! search-chan
                                          {:artist (get @track "artist")})}
                     (get track "artist"))
             album (dom/span
                    #js {:className "album"
-                        :onClick #(put! update-filters
+                        :onClick #(put! search-chan
                                         {:artist (get @track "artist")
                                          :album (get @track "album")})}
                    (get track "album"))


dset.clj: some work on filtering out illegal symbols

--- clojure/org/gavrog/clojure/dsets.clj
+++ clojure/org/gavrog/clojure/dsets.clj
@@ -4,11 +4,17 @@
           [delaney])))

 (defn dsets [dim max-size]
-  (let [idcs (range (inc dim))]
+  (let [idcs (range (inc dim))
+        still-good? (fn [ds i D]
+                      (empty? (for [j idcs
+                                    :when (or (< j (dec i)) (> j (inc i)))
+                                    :let [o (orbit ds [i j] D)]
+                                    :when (> (size o) (if (loopless? o) 4 2))]
+                                j)))]
     (make-backtracker
       {:root [(dsymbol (str "1 " dim))
               (into (sorted-set) (for [i idcs] [i 1]))]
-       :extract (fn [[ds free]] (when (empty? free) ds))
+       :extract (fn [[ds free]] (when (and (empty? free) (canonical? ds)) ds))
        :children (fn [[ds free]]
                    (when (seq free)
                      (let [[i D] (first free)
@@ -19,5 +25,5 @@
                                                           [j E]))]]))]
                        (for [[E free] (concat adding extending)
                              :let [ds (glue ds i D E)]
-                             :when (canonical? ds)]
+                             :when (still-good? ds i D)]
                          [ds (disj free [i D] [i E])]))))})))


CMR-1776: Fixed typo

CMR-1776: Fixed typo

--- system-int-test/test/cmr/system_int_test/search/collection_sorting_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_sorting_search_test.clj
@@ -110,7 +110,7 @@
              "entry-title" (sort-revisions-by-field :entry-title false all-revisions)
              "+entry-title" (sort-revisions-by-field :entry-title false all-revisions)
              "-entry-title" (sort-revisions-by-field :entry-title true all-revisions)
-             ;; alias for entry_titile
+             ;; alias for entry_title
              "dataset_id" (sort-revisions-by-field :entry-title false all-revisions)
              "-dataset_id" (sort-revisions-by-field :entry-title true all-revisions)
              ;; Revision date is not returned (and therefore not available for


fix bug connecting to snapshot repo

fix bug connecting to snapshot repo

--- src/wb_es/web/setup.clj
+++ src/wb_es/web/setup.clj
@@ -49,7 +49,7 @@
                                              "region" "us-east-1"}}))
   ([repository-name repository-settings]
    (try
-     (http/get (format "%s/_snapshot/%s" es-base-url repository-name)
+     (http/put (format "%s/_snapshot/%s" es-base-url repository-name)
                {:content-type "application/json"
                 :body (json/generate-string repository-settings)})
      (catch Exception e


Correct typo in lein-kibit version

Correct typo in lein-kibit version

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,2 +1,2 @@
 {:user {:plugins [[jonase/eastwood "0.2.0"]
-                  [lein-kibit "0.0."]]}}
+                  [lein-kibit "0.0.8"]]}}


Adds jark to user plugins.

Adds jark to user plugins.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -2,6 +2,7 @@
                   [lein-swank "1.4.4"]
                   [lein-difftest "1.3.7"]
                   [lein-clojars "0.8.0"]
+                  [jark/jark-server "0.4.0"]
                   [clj-stacktrace "0.2.4"]
                   [lein-pprint "1.1.1"]
                   [slamhound "1.2.0"]


Use lein shorthand and allembic in profiles.clj.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,11 +1,13 @@
 {:user {:dependencies [[clj-stacktrace "0.2.8"]
                        [spyscope "0.1.5"]
+                       [alembic "0.3.2"]
                        [debugger "0.1.7"]
                        [bolth "0.1.0"]
                        [com.aphyr/prism "0.1.2"]
                        [slamhound "1.5.5"]]
         :plugins [[lein-difftest "2.0.0"]
                   [lein-exec "0.3.4"]
+                  [com.palletops/lein-shorthand "0.4.0"]
                   [lein-instant-cheatsheet "2.1.3"]
                   [lein-ancient "0.5.5"]
                   [com.aphyr/prism "0.1.2"]
@@ -17,12 +19,12 @@
                   [lein-pprint "1.1.2"]
                   [lein-ring "0.8.13"]
                   [lein-cljsbuild "1.0.6"]
-                  [lein-deps-tree "0.1.2"]
                   [mvxcvi/whidbey "0.4.1"]
                   [lein-typed "0.3.5"]
                   [lein-marginalia "0.8.0"]]
         ; printing options are customizable:
         :puget-options {}
+        :shorthand {. [alembic.still/distill alembic.still/lein]}
         :repl-options {:timeout 120000}
         :injections [(require 'spyscope.core)
                      (let [orig (ns-resolve (doto 'clojure.stacktrace require)


Updates

Updates

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,6 +1,4 @@
 {:user
- {:plugins      [[venantius/ultra "0.5.1"]
-                 [refactor-nrepl "2.2.0"]
-                 [cider/cider-nrepl "0.14.0"]]
-  :dependencies [[org.clojure/tools.namespace "0.2.11"]]
+ {:plugins      []
+  :dependencies []
   }}


line up the loading spinners better

line up the loading spinners better

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -460,7 +460,8 @@
         (let [card (get-in app state/stripe-card-path)
               controls-ch (om/get-shared owner [:comms :controls])]
           (if-not (and card checkout-loaded?)
-            [:div.loading-spinner common/spinner]
+            [:div.card.row-fluid [:legend.span8 "Card on file"]
+             [:div.row-fluid [:div.offset1.span6 [:div.loading-spinner common/spinner]]]]
             [:div
               [:div.card.row-fluid [:legend.span8 "Card on file"]]
               [:div.row-fluid
@@ -504,7 +505,9 @@
               b-name (:billing_name plan-data)
               b-extra (:extra_billing_data plan-data)]
           (if-not plan-data
-            [:div.loading-spinner common/spinner]
+            [:div.invoice-data.row-fluid
+             [:legend.span8 "Invoice data"]
+             [:div.row-fluid [:div.span8 [:div.loading-spinner common/spinner]]]]
             [:div.invoice-data.row-fluid
              [:fieldset
               [:legend.span8 "Invoice data"]
@@ -630,7 +633,10 @@
         (let [account-balance (get-in app state/org-plan-balance-path)
               invoices (get-in app state/org-invoices-path)]
           (if-not (and account-balance invoices)
-            [:div.loading-spinner common/spinner]
+            [:div.row-fluid
+             [:div.span8
+               [:legend "Invoices"]
+              [:div.loading-spinner common/spinner]]]
             [:div.row-fluid
              [:div.span8
                [:legend "Invoices"]


fix deselecting a previously saved piggieback org

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -417,11 +417,12 @@
                  [:div.control
                   [:label.checkbox
                    [:input
-                    {:value org
-                     :checked (contains? selected-piggyback-orgs org)
-                     ;; Note: this is broken if the org is already in piggieback_orgs, need to explicitly pass the value :(
-                     :on-change #(utils/toggle-input controls-ch (conj state/selected-piggyback-orgs-path org) %)
-                     :type "checkbox"}]
+                    (let [checked? (contains? selected-piggyback-orgs org)]
+                      {:value org
+                       :checked checked?
+                       ;; Note: this is broken if the org is already in piggieback_orgs, need to explicitly pass the value :(
+                       :on-change #(utils/edit-input controls-ch (conj state/selected-piggyback-orgs-path org) % :value (not checked?))
+                       :type "checkbox"})]
                    org]])]
               [:div.form-actions.span7
                (forms/managed-button


[#3036] Use db.data-group/get-data-group-by-column-name instead of the one defined directly in sql

--- backend/src/akvo/lumen/lib/transformation/reverse_geocode.clj
+++ backend/src/akvo/lumen/lib/transformation/reverse_geocode.clj
@@ -27,7 +27,7 @@

 (defn source-table-name-2 [conn {:strs [datasetId]} geoshapeColumn]
   (let [dataset-version-id (:id (db.dataset-version/latest-dataset-version-2-by-dataset-id conn {:dataset-id datasetId}))
-        data-group (db.data-group/db-get-data-group-by-column-name conn {:dataset-version-id dataset-version-id
+        data-group (db.data-group/get-data-group-by-column-name conn {:dataset-version-id dataset-version-id
                                                                          :column-name geoshapeColumn})]
     (:table-name data-group)))


Change default tab away from circle.yml

Change default tab away from circle.yml

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -733,15 +733,10 @@
   (cond
    ;; default to ssh-info for SSH builds
    (build-model/ssh-enabled-now? build) :ssh-info
-   ;; default to the queue tab if the build is currently usage queued, and
-   ;; the user is has the right permissions (and is logged in).
-   (and (:read-settings scopes)
-        (build-model/in-usage-queue? build))
-   :usage-queue
    ;; If there's no SSH info, build isn't finished, show the config
    (build-model/running? build) (if (feature/enabled? :ui-v2) :config :commits)
-   ;; Otherwise, just use the first one.
-   :else :tests))
+   (:read-settings scopes) :usage-queue
+   :else nil))

 (def tab-link :a.tab-link)


PE-2319: Address review comments

PE-2319: Address review comments

--- src/puppetlabs/trapperkeeper/services/nrepl/nrepl_service.clj
+++ src/puppetlabs/trapperkeeper/services/nrepl/nrepl_service.clj
@@ -10,27 +10,23 @@
 (def ^{:private true} default-nrepl-port 7888)
 (def ^{:private true} default-bind-addr "0.0.0.0")

-(def ^{:private true} nrepl-server (atom nil))
-
 (defn- startup-nrepl
-  [config]
+  [config nrepl-server]
   {:pre [(map? config)]}
-  (let [enabled (parse-bool (get-in config [:nrepl :enabled] false))
-        port    (get-in config [:nrepl :port] default-nrepl-port)
-        bind    (get-in config [:nrepl :bind] default-bind-addr)]
-    (if (true? enabled)
+  (let [enabled?     (parse-bool (get-in config [:nrepl :enabled] false))
+        port         (get-in config [:nrepl :port] default-nrepl-port)
+        bind         (get-in config [:nrepl :bind] default-bind-addr)]
+    (if enabled?
       (do (log/debug "Starting nrepl service on port" port)
           (compare-and-set! nrepl-server nil (nrepl/start-server :port port :bind bind)))
-      (log/debug "nrepl service disabled, not starting")))
-
-  (println "nrepl server values: " @nrepl-server))
+      (log/debug "nrepl service disabled, not starting"))))

 (defn- shutdown-nrepl
-  [config]
+  [config nrepl-server]
   {:pre [(map? config)]}
-  (if (not (nil? @nrepl-server))
-    (do (log/debug "Shutting down nrepl service")
-        (nrepl/stop-server @nrepl-server))))
+  (when-not (nil? @nrepl-server)
+    (log/debug "Shutting down nrepl service")
+    (nrepl/stop-server @nrepl-server)))

 (defservice nrepl-service
   "The nREPL trapperkeeper service starts up a Clojure network REPL (nREPL) server attached to the running
@@ -44,8 +40,9 @@
    If no port is specified then the default port of 7888 is used."
   {:depends [[:config-service get-config]]
    :provides [shutdown]}
-  (startup-nrepl (get-config))
-  {:shutdown (partial shutdown-nrepl (get-config))})
+  (let [nrepl-server (atom nil)]
+    (startup-nrepl (get-config) nrepl-server)
+    {:shutdown (partial shutdown-nrepl (get-config) nrepl-server)}))


Add comments to navigation-3d.

Add comments to navigation-3d.

--- src/quil/middlewares/navigation_3d.clj
+++ src/quil/middlewares/navigation_3d.clj
@@ -1,15 +1,21 @@
 (ns quil.middlewares.navigation-3d
   (:require [quil.core :as q]))

-(defn- default-camera []
+(defn- default-position
+  "Default position configuration. Check default configuration in
+  'camera' function."
+  []
   {:position [(/ (q/width) 2.0)
               (/ (q/height) 2.0)
               (/ (q/height) 2.0 (q/tan (/ (* q/PI 60.0) 360.0)))]
    :straight [0 0 -1]
    :up [0 1 0]})

-; http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
-(defn- rotate-by-axis-and-angle [v axis angle]
+(defn- rotate-by-axis-and-angle
+  "Rotates vector v by angle with axis.
+  Formula is taken from wiki:
+  http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle"
+  [v axis angle]
   (let [[a-x a-y a-z] axis
         [x y z] v
         cs (q/cos angle)
@@ -38,37 +44,57 @@
      (+ (* d x) (* e y) (* f z))
      (+ (* g x) (* h y) (* i z))]))

-(defn- rotate-lr [nav-3d angle]
+(defn- rotate-lr
+  "Rotates nav-3d configuration left-right. angle positive - rotate right,
+  negative - left."
+  [nav-3d angle]
   (update-in nav-3d [:straight] rotate-by-axis-and-angle (:up nav-3d) angle))

-(defn- cross-product [[u1 u2 u3] [v1 v2 v3]]
+(defn- cross-product
+  "Vector cross-product: http://en.wikipedia.org/wiki/Cross_product"
+  [[u1 u2 u3] [v1 v2 v3]]
   [(- (* u2 v3) (* u3 v2))
    (- (* u3 v1) (* u1 v3))
    (- (* u1 v2) (* u2 v1))])

-(defn- v-mult [v mult]
+(defn- v-mult
+  "Multiply vector v by scalar mult."
+  [v mult]
   (mapv #(* % mult) v))

-(defn- v-plus [v1 v2]
+(defn- v-plus
+  "Sum of 2 vectors."
+  [v1 v2]
   (mapv + v1 v2))

-(defn- v-opposite [v]
+(defn- v-opposite
+  "Returns vector opposite to vector v."
+  [v]
   (v-mult v -1))

-(defn- v-normalize [v]
+(defn- v-normalize
+  "Normalize vector, returning vector
+  which has same direction but with norm equals to 1."
+  [v]
   (let [norm (->> (map q/sq v)
                   (apply +)
                   (q/sqrt))]
     (v-mult v (/ norm))))

-(defn- rotate-ud [nav-3d angle]
+(defn- rotate-ud
+  "Rotates nav-3d configuration up-down."
+  [nav-3d angle]
   (let [axis (cross-product (:straight nav-3d) (:up nav-3d))
         rotate #(rotate-by-axis-and-angle % axis angle)]
     (-> nav-3d
         (update-in [:straight] rotate)
         (update-in [:up] rotate))))

-(defn- rotate [state event pixels-in-360]
+(defn- rotate
+  "Mouse handler function which rotates nav-3d configuration.
+  It uses mouse from event object and pixels-in-360 to calculate
+  angles to rotate."
+  [state event pixels-in-360]
   (if (= 0 (:p-x event) (:p-y event))
     state
     (let [dx (- (:p-x event) (:x event))
@@ -82,7 +108,11 @@

 (def ^:private space (keyword " "))

-(defn- move [state event step-size]
+(defn- move
+  "Keyboard handler function which moves nav-3d configuration.
+  It uses keyboard key from event object to determing in which
+  direction to move."
+  [state event step-size]
   (let [{:keys [up straight]} (:navigation-3d state)]
     (if-let [dir (condp = (:key event)
                    :w straight
@@ -96,7 +126,10 @@
                  #(v-plus % (v-mult dir step-size)))
       state)))

-(defn- setup-3d-nav [user-setup user-settings]
+(defn- setup-3d-nav
+  "Custom 'setup' function which creates initial position
+  configuration and puts it to the state map."
+  [user-setup user-settings]
   (let [initial-state (-> user-settings
                           (select-keys [:straight :up :position])
                           (->> (merge (default-camera)))


Make functions local to file private

Make functions local to file private

--- src/refactor_nrepl/ns/dependencies.clj
+++ src/refactor_nrepl/ns/dependencies.clj
@@ -92,13 +92,13 @@
        (map (partial add-package-prefix-to-class prefix))
        (map parse-import)))

-(defn extract-imports
+(defn- extract-imports
   [form]
   (let [parse-tree (rest (second (parse-form form)))]
     (for [import parse-tree]
       (parse-import import))))

-(defn extract-used [use-form]
+(defn- extract-used [use-form]
   (some->>  use-form
             extract-libspecs
             (map use-to-refer-all)))
@@ -112,7 +112,7 @@
    (extract-used (get-ns-component ns-form :use))
    (extract-requires (get-ns-component ns-form :require))))

-(defn- get-imports [ns-form]
+(defn get-imports [ns-form]
   (some-> (get-ns-component ns-form :import) extract-imports
           flatten))


fixed last commit

fixed last commit

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -275,20 +275,6 @@
   (swap! app-state/app-state assoc :music-info [])
   (swap! app-state/app-state assoc :current-track-id nil)
   (swap! app-state/app-state assoc :current-sound-id nil))
-
-;(t/ann delete-track! [t/String -> t/Nothing])
-(defn delete-track! [track-id]
-  (println "Received delete-track signal:" track-id)
-  (swap! app-state/app-state assoc :track-id-hashes (dissoc (:track-id-hashes @app-state/app-state) track-id))
-  (swap! app-state/app-state assoc :track-order (vec (remove #(= track-id %1) (:track-order @app-state/app-state))))
-
-  (if (= track-id (:current-track-id @app-state/app-state))
-    (do
-      (print "CURRENT TRACK DELETED!")
-      (player/destroy-track (:current-sound-id @app-state/app-state))
-      (swap! app-state/app-state assoc :current-track-id nil)
-      (swap! app-state/app-state assoc :current-sound-id nil)
-      (.emit socket "track-deleted"))))

 (.on socket "upload-slots-change"
   (fn [new-upload-slots]


Add zoomed out view, animation for transitioning

Still to do: disable inputs while animating, speed up scroll speed when
zoomed out.

--- src/graphito/core.cljs
+++ src/graphito/core.cljs
@@ -150,11 +150,17 @@
                           :project-radius (constantly (* zoom-out-scale max-radius))
                           :project-opacity (constantly 1)})

-(defn sync-graph! [state]
+(defn projectors-for-state [state]
+  (if (= (:projection state) :fisheye) fisheye-projectors zoom-out-projectors))
+
+(defn sync-graph! [state & {:keys [animate]}]
   (let [{:keys [svg nodes links camera-pos view-size]} state
         {:keys [project-displacement
                 project-radius
-                project-opacity]} fisheye-projectors
+                project-opacity]} (projectors-for-state state)
+        maybe-transition (if animate
+                           #(-> % .transition (.duration 500))
+                           identity)
         positions (mapv (fn [node]
                           (view-position state
                                          (:pos node)
@@ -169,16 +175,18 @@
           (.style "stroke" "#C9CBCB")
           (.style "stroke-width" 3))
       (-> link-selection
+          maybe-transition
           (.attr "x1" #(-> % :source positions :x))
           (.attr "y1" #(-> % :source positions :y))
           (.attr "x2" #(-> % :target positions :x))
           (.attr "y2" #(-> % :target positions :y))))
-    (let [node-selection #(-> svg (.selectAll ".node") (.data (apply array nodes)))]
-      (-> (node-selection) .enter
+    (let [node-selection (-> svg (.selectAll ".node") (.data (apply array nodes)))]
+      (-> node-selection .enter
         (.append "circle")
         (.attr "class" "node")
         (.style "fill" "#777A7A"))
-      (-> (node-selection)
+      (-> node-selection
+        maybe-transition
         (.attr "cx" (fn [d i] (:x (positions i))))
         (.attr "cy" (fn [d i] (:y (positions i))))
         (.attr "r" (fn [d i] (project-radius (distances-from-camera i))))
@@ -191,7 +199,8 @@
    :view-size (math-vec width height)
    :camera-pos (math-vec 0 0)
    :nodes []
-   :edges []})
+   :edges []
+   :projection :fisheye}) ; Can be :fisheye or :zoom-out

 (defn swap-state! [current-state f & args]
   (apply swap! current-state f args)
@@ -203,6 +212,10 @@

 (defn move-camera! [current-state d]
   (update-state! current-state :camera-pos add-vec d))
+
+(defn set-projection! [current-state projection]
+  (swap! current-state assoc :projection projection)
+  (sync-graph! @current-state :animate true))

 ;; Layout

@@ -395,6 +408,16 @@
       (.filter #(< % 0.5))
       (.subscribe #(js/alert "TODO: zoom out"))))

+;; Temporary animation test function
+
+(defn zoom-in-out-on-interval! [current-state]
+  ((fn f [projection]
+     (.setTimeout js/window
+                  (fn []
+                    (set-projection! current-state projection)
+                    (f (if (= projection :fisheye) :zoom-out :fisheye)))
+                  2000)) :zoom-out))
+
 ;; Exported function to do magic

 (defn ^:export inhabit [selector]
@@ -412,4 +435,7 @@
                 (move-camera-on-arrow-keys! current-state)
                 (move-camera-on-pan! gesture-manager current-state)
                 (move-camera-on-swipe! gesture-manager current-state)
-                (zoom-out-on-pinch! gesture-manager current-state)))
+                (zoom-out-on-pinch! gesture-manager current-state)
+                (zoom-in-out-on-interval! current-state)))
+
+


Reimplement socket abstraction.

Reimplement socket abstraction.

--- src/igorle/socket.cljs
+++ src/igorle/socket.cljs
@@ -2,36 +2,68 @@
   "A basic socket interface abstraction."
   (:require [cljs.core.async :as a]))

-(defprotocol ISocket
-  (listen! [_ ch] "Listen all events on channel.")
-  (send! [_ data] "Send data through the socket."))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; The socket abstraction
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defprotocol ISocketFactory
-  String
-  (-socket [url]
-    (js/WebSocket. url)))
+(defprotocol IWebSocket
+  (-listen [_ ch] "Listen all messages from the channel.")
+  (-send [_ data] "Send data to the socket.")
+  (-close [_] "Close the socket."))

-(defn- listener
-  "A listener factory helper."
-  [type output]
-  (fn [event]
-    (a/put! output {:type type :payload (.-data event)})))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Implementation
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-;; Default implementation for websockets
+(deftype WebSocket [ws bus mult]
+  IWebSocket
+  (-listen [_ ch]
+    (a/tap mult ch)
+    ch)

-(when js/WebSocket
-  (extend-type js/WebSocket
-    ISocket
-    (listen! [s ch]
-      (case type
-        :message (aset s "onmessage" (listener :socket/message input))
-        :close (aset s "onclose" (listener :socket/close input))
-        :open (aset s "onopen" (listener :socket/open input))
-        :error (aset s "onerror" (listener :socket/error input))))
-    (send! [s data]
-      (.send s data))))
+  (-send [_ data]
+    (.send ws data))

-(defn socket
-  "Create new socket instance."
+  (-close [_]
+    (.close ws)
+    (a/close! bus)))
+
+(defn websocket*
+  [ws]
+  (let [bus (a/chan (a/sliding-buffer 256))
+        mult (a/mult bus)
+        listener (fn [type event]
+                   (let [data (.-data event)]
+                     (a/put! output {:type type :payload data ::event event})))]
+    (set! (.-onmessage ws) (partial listener :message))
+    (set! (.-onclose ws) (partial listener :close))
+    (set! (.-onopen ws) (partial listener :open))
+    (set! (.-onerror ws) (partial listener :error))
+    (WebSocket. ws bus mult)))
+
+(deftype FakeWebSocket [bus mult]
+  IWebSocket
+  (-listen [_ ch]
+    (a/tap mult ch)
+    ch)
+
+  (-send [_ data]
+    (.send ws data))
+
+  (-close [_]
+    (.close ws)
+    (a/close! bus)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Public Api
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn websocket
   [url]
-  (-socket url))
+  (let [ws (js/WebSocket. url)]
+    (websocket* url)))
+
+(defn fake-websocket
+  [ch]
+  (let [mult (a/mult ch)]
+    (FakeWebSocket. ch mult)))


Add adam-clojure

Add adam-clojure

--- cortex/src/cortex/optimise/optimisers.clj
+++ cortex/src/cortex/optimise/optimisers.clj
@@ -103,3 +103,36 @@
                  {:acc-gradient acc-gradient
                   :acc-step acc-step
                   :params params}))}))
+
+(defn adam-clojure
+  [& {:keys [step-size first-moment-decay
+             second-moment-decay conditioning]
+      :or {step-size 0.001
+           first-moment-decay 0.9
+           second-moment-decay 0.999
+           conditioning 1e-8}}]
+  {:initialize (fn [param-count]
+                 {:first-moment (m/new-vector :vectorz param-count)
+                  :second-moment (m/new-vector :vectorz param-count)
+                  :num-steps 0})
+   :update (fn [{:keys [params first-moment second-moment num-steps]} gradient]
+             (let [num-steps (inc num-steps)
+                   first-moment (accumulate first-moment-decay
+                                            first-moment
+                                            gradient)
+                   second-moment (accumulate second-moment-decay
+                                             second-moment
+                                             (m/square gradient))
+                   first-moment* (/ first-moment
+                                    (- 1 (Math/pow first-moment-decay num-steps)))
+                   second-moment* (/ second-moment
+                                     (- 1 (Math/pow second-moment-decay num-steps)))
+                   step (* step-size
+                           (/ first-moment*
+                              (+ (m/sqrt second-moment*)
+                                 conditioning)))
+                   params (- params step)]
+               {:params params
+                :first-moment first-moment
+                :second-moment second-moment
+                :num-steps num-steps}))})


+(deftest mod-is-empty-list)

+(deftest mod-is-empty-list)

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -127,6 +127,14 @@
                                   (is (not (= "" (fo foo))))
                                   (log/info (str "fo: " (fo foo)))
                                   (fo foo)))))))))
+
+(deftest mod-is-empty-list
+  (let [result (generate {:synsem {:sem {:pred :name
+                                         :mod '()}}})]
+    (is (= (get-in result [:synsem :sem :mod]
+                   :undefined-should-not-return-this)
+           '()))))
+
 (deftest her-name-is-luisa
   (is (= "her name is Luisa"
          (fo (generate {:modified false


Fixed a parameter in multiple coins example.

--- test/clojure/uncomplicate/bayadera/examples/dbda/ch09/multiple_coins_test.clj
+++ test/clojure/uncomplicate/bayadera/examples/dbda/ch09/multiple_coins_test.clj
@@ -47,19 +47,19 @@
       (with-release [prior (distribution multiple-coins-prior)
                      prior-dist-5 (prior (sv 2 2 5))
                      prior-sampler-5 (time (doto (sampler prior-dist-5) (fit!)))
-                     prior-dist-100 (prior (sv 2 2 100))
-                     prior-sampler-100 (time (doto (sampler prior-dist-100) (fit!)))
+                     prior-dist-75 (prior (sv 2 2 75))
+                     prior-sampler-75 (time (doto (sampler prior-dist-75) (fit!)))
                      post-model (posterior-model multiple-coins-likelihood multiple-coins-prior)
                      post (posterior post-model)
                      post-dist-5 (post (sv N0 z0 N1 z1 2 2 5))
                      post-sampler-5 (time (doto (sampler post-dist-5) (fit!)))
-                     post-dist-100 (post (sv N0 z0 N1 z1 2 2 100))
-                     post-sampler-100 (time (doto (sampler post-dist-100) (fit!)))]
+                     post-dist-75 (post (sv N0 z0 N1 z1 2 2 75))
+                     post-sampler-75 (time (doto (sampler post-dist-75) (fit!)))]

-        {:prior-5 (histogram! prior-sampler-5 100)
-         :prior-100 (histogram! prior-sampler-100 100)
-         :posterior-5 (time (histogram! post-sampler-5 100))
-         :posterior-100 (time (histogram! post-sampler-100 100))}))))
+        {:prior-5 (histogram! prior-sampler-5 75)
+         :prior-75 (histogram! prior-sampler-75 75)
+         :posterior-5 (time (histogram! post-sampler-5 75))
+         :posterior-75 (time (histogram! post-sampler-75 75))}))))

 (defn setup []
   (reset! state
@@ -80,8 +80,8 @@
     (q/background 0)
     (draw-plots (:plots @state) (:prior-5 @all-data) 0 0)
     (draw-plots (drop 3 (:plots @state)) (:posterior-5 @all-data) 0 320)
-    (draw-plots (drop 6 (:plots @state)) (:prior-100 @all-data) 0 640)
-    (draw-plots (drop 9 (:plots @state)) (:posterior-100 @all-data) 0 960)))
+    (draw-plots (drop 6 (:plots @state)) (:prior-75 @all-data) 0 640)
+    (draw-plots (drop 9 (:plots @state)) (:posterior-75 @all-data) 0 960)))

 (defn display-sketch []
   (q/defsketch diagrams


Use ensure-slash at compilation

Use ensure-slash at compilation

--- modules/reitit-core/src/reitit/core.cljc
+++ modules/reitit-core/src/reitit/core.cljc
@@ -55,7 +55,9 @@
                                  [maybe-arg (rest args)])
                  macc (into macc (expand data opts))
                  child-routes (walk-many (str pacc path) macc (keep identity childs))]
-             (if (seq childs) (seq child-routes) [[(str pacc path) macc]])))))]
+             (if (seq childs)
+               (seq child-routes)
+               [[(str pacc (ensure-slash path)) macc]])))))]
     (walk-one path (mapv identity data) raw-routes)))

 (defn map-data [f routes]


Put jars directly in lib/ instead of nesting.

--- src/leiningen/deps.clj
+++ src/leiningen/deps.clj
@@ -3,7 +3,8 @@
   (:use [leiningen]
         [clojure.contrib.java-utils :only [file]])
   (:import [org.apache.maven.model Dependency]
-           [org.apache.maven.artifact.ant DependenciesTask]))
+           [org.apache.maven.artifact.ant DependenciesTask]
+           [org.apache.tools.ant.util FlatFileNameMapper]))

 (defn- make-dependency [[group name version]]
   (doto (Dependency.)
@@ -24,6 +25,6 @@
     (.execute deps-task)
     (.mkdirs (file (:root project) "lib"))
     (lancet/copy {:todir "lib/"}
-                 ;; TODO: flatten
                  (.getReference lancet/ant-project
-                                (.getFilesetId deps-task)))))+                                (.getFilesetId deps-task))
+                 (FlatFileNameMapper.))))


No quotes on repl start message.

No quotes on repl start message.

--- src/leiningen/repl.clj
+++ src/leiningen/repl.clj
@@ -48,7 +48,8 @@
                                  (.printStackTrace e#)))
                              (recur)))
              .start)
-           (format "REPL started; server listening on %s:%s." ~host ~port)))))
+           (symbol (format "REPL started; server listening on %s:%s."
+                           ~host ~port))))))

 (defn copy-out-loop [reader]
   (let [buffer (make-array Character/TYPE 1000)]


Use git fn everywhere, remove get-dir-voom-version

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -14,13 +14,16 @@
 (set! *warn-on-reflection* true)

 (defn git
-  [^File d & subcmd]
+  [{:keys [^File gitdir]} & subcmd]
   ;; We won't handle bare repos or displaced worktrees
-  (let [gitdir (.getPath d)
-        worktree (.getParent d)
-        rtn (apply sh "git" (str "--git-dir=" gitdir) (str "--work-tree=" worktree) subcmd)]
+  (let [dir-args (if (nil? gitdir)
+                   []
+                   [(str "--git-dir=" (.getPath gitdir))
+                    (str "--work-tree=" (.getParent gitdir))])
+        all-args (concat dir-args subcmd)
+        rtn (apply sh "git" all-args)]
     (when-not (zero? (:exit rtn))
-      (throw (ex-info "git error" rtn)))
+      (throw (ex-info "git error" (assoc rtn :git all-args))))
     rtn))

 ;; === git sha-based versions ===
@@ -34,19 +37,10 @@
            t))

 (defn get-voom-version
-  [path & [long-sha?]]
+  [path & {:keys [long-sha? gitdir]}]
   (let [shafmt (if long-sha? "%H" "%h")
         fmt (str "--pretty=" shafmt ",%cd")
-        {:keys [out exit err]} (sh "git" "log" "-1" fmt path)
-        ;; Throw exception if error?
-        [sha, datestr] (-> out s/trim (s/split #"," 2))
-        ctime (Date. ^String datestr)]
-    {:ctime ctime :sha sha}))
-
-(defn get-dir-voom-version
-  [dir path]
-  (let [{:keys [out exit err]} (git dir "log" "-1"  "--pretty=%h,%cd" "--" path)
-        ;; Throw exception if error?
+        {:keys [out exit err]} (git {:gitdir gitdir} "log" "-1" fmt path)
         [sha, datestr] (-> out s/trim (s/split #"," 2))
         ctime (Date. ^String datestr)]
     {:ctime ctime :sha sha}))
@@ -71,7 +65,7 @@

 (defn dirty-wc?
   [path]
-  (let [{:keys [out err exit]} (sh "git" "status" "--short" path)]
+  (let [{:keys [out err exit]} (git {} "status" "--short" path)]
     (not (empty? out))))

@@ -93,7 +87,7 @@

 (defn find-project-files
   [^File d]
-  (let [{:keys [out err exit]} (git d "ls-files" "project.clj" "**/project.clj")
+  (let [{:keys [out err exit]} (git {:gitdir d} "ls-files" "project.clj" "**/project.clj")
         projects (when-not (empty? out)
                    (s/split-lines out))]
     (map #(str (.getParent d) "/" %) projects)))
@@ -101,7 +95,7 @@
 (defn contains-sha? [d sha]
   (prn "contains-sha?" d sha)
   (->>
-   (git d "rev-parse" "--verify" "--quiet" sha)
+   (git {:gitdir d} "rev-parse" "--verify" "--quiet" sha)
    :exit
    zero?))

@@ -118,7 +112,7 @@
   [dirs]
   (doseq [^File d dirs]
     (println "Fetching:" (.getPath d))
-    (git d "fetch")))
+    (git {:gitdir d} "fetch")))

 (defn find-project
   [pgroup pname candidate]
@@ -141,7 +135,7 @@
                                (locate-sha dirs sha)))]
     (prn "sha-candidates" sha-candidates)
     (mapcat (fn [c]
-              (git c "checkout" sha)
+              (git {:gitdir c} "checkout" sha)
               (find-project groupId artifactId c))
             sha-candidates)))

@@ -229,8 +223,8 @@
   [dirs]
   (doseq [^File d dirs]
     (println "Checking out latest:" (.getPath d))
-    (git d "fetch")
-    (git d "checkout" "origin/HEAD")))
+    (git {:gitdir d} "fetch")
+    (git {:gitdir d} "checkout" "origin/HEAD")))

 ;; Add metadata pinning (how big to bump? all? minor? sha?) -- warn about not updating
 ;; Opt-in autobump  -- default to no major auto
@@ -241,7 +235,7 @@
           (for [dir dirs
                 prj-file (find-project-files dir)]
             (let [{:keys [group name version] :as prj} (project/read prj-file)
-                  gver (get-dir-voom-version dir (:root prj))
+                  gver (get-voom-version (:root prj) :gitdir dir)
                   qual (format-voom-ver gver timestamp-fmt)
                   new-ver (str (s/replace version #"-SNAPSHOT" "") qual)]
               [(symbol group name) new-ver])))))
@@ -331,7 +325,7 @@
   (let [[kstrs sargs] (split-with #(.startsWith ^String % ":") args)
         kargset (set (map #(keyword (subs % 1)) kstrs))
         long-sha (kargset :long-sha)
-        gver (-> project :root (get-voom-version long-sha))
+        gver (-> project :root (get-voom-version :long-sha? long-sha))
         qual (format-voom-ver gver timestamp-fmt)
         upfn #(str (s/replace % #"-SNAPSHOT" "") qual)
         nproj (update-in project [:version] upfn)


Start beat grid visualization.

Start beat grid visualization.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -1085,6 +1085,37 @@
         (draw-attributed-variable-value controller 1 1 bpm-label metronome-content)
         (draw-gauge controller 1 1 bpm :lowest controllers/minimum-bpm :highest controllers/maximum-bpm
                     :track-color metronome-content)
+
+        ;; Draw the beat grid visualization
+        (set-graphics-color graphics metronome-content)
+        (.draw graphics (java.awt.geom.Line2D$Double. button-cell-width (- Wayang/DISPLAY_HEIGHT 60)
+                                                            button-cell-width (- Wayang/DISPLAY_HEIGHT 19)))
+
+        (let [beat-width (/ button-cell-width (:bpb snapshot))
+              beat-position (- button-cell-width (* beat-width (:beat-phase snapshot)))
+              metro (:metronome (:show controller))]
+          (.setClip graphics  0 (- Wayang/DISPLAY_HEIGHT 60) (* 2 button-cell-width) 40)
+          (set-graphics-color graphics (if (rhythm/snapshot-down-beat? snapshot) red-color white-color))
+          (.draw graphics (java.awt.geom.Line2D$Double. beat-position (- Wayang/DISPLAY_HEIGHT 40)
+                                                        beat-position (- Wayang/DISPLAY_HEIGHT 20)))
+          (loop [position (+ beat-position beat-width)
+                 snap (rhythm/metro-snapshot metro (+ (:instant snapshot) (rhythm/metro-tick metro)))]
+            (when (< position (* 2 button-cell-width))
+              (set-graphics-color graphics (if (rhythm/snapshot-down-beat? snap) red-color white-color))
+              (.draw graphics (java.awt.geom.Line2D$Double. position (- Wayang/DISPLAY_HEIGHT 40)
+                                                            position (- Wayang/DISPLAY_HEIGHT 20)))
+              (recur (+ position beat-width)
+                     (rhythm/metro-snapshot metro (+ (:instant snap) (rhythm/metro-tick metro))))))
+          (loop [position (- beat-position beat-width)
+                 snap (rhythm/metro-snapshot metro (- (:instant snapshot) (rhythm/metro-tick metro)))]
+            (when (>= position 0)
+              (set-graphics-color graphics (if (rhythm/snapshot-down-beat? snap) red-color white-color))
+              (.draw graphics (java.awt.geom.Line2D$Double. position (- Wayang/DISPLAY_HEIGHT 40)
+                                                            position (- Wayang/DISPLAY_HEIGHT 20)))
+              (recur (- position beat-width)
+                     (rhythm/metro-snapshot metro (- (:instant snap) (rhythm/metro-tick metro)))))))
+
+

         ;; Make the metronome button bright, since some overlay is present
         (swap! (:next-text-buttons controller) assoc metronome-button white-color))


Convert GeoTIFF to Shapefile and Mapinfo File.

--- src/clj/popchange/lib/raster_calculation.clj
+++ src/clj/popchange/lib/raster_calculation.clj
@@ -315,16 +315,22 @@
            (s/replace "{REPLACE_COLOUR_RAMP}" (apply str (colour-map-stops-xml stops)))))
       (python raster-to-png-script tiff style-filename png))))

-(defn tiff->shapefile-zip
-  [tiff dst]
+(defn tiff->vector!
+  [tiff dst vector-file-ext ogr-format]
   (let [basename (util/md5 tiff)
         wd (wdir "/" basename "_tmp")
         tmpf (partial str wd "/")
-        vector-file (str basename ".shp")]
+        vector-file (str basename vector-file-ext)]
     (do
       @(exec/sh ["mkdir" wd])
-      @(exec/sh ["gdal_polygonize.py" tiff "-f" "ESRI Shapefile" (tmpf vector-file)])
-      @(exec/sh ["cd" wd])
-      @(exec/sh ["zip" "-r" dst "."])
-      @(exec/sh ["cd"])
+      @(exec/sh ["gdal_polygonize.py" tiff "-f" ogr-format (tmpf vector-file)])
+      @(exec/sh ["zip" "-r" dst "."] {:dir wd})
       @(exec/sh ["rm" "-Rf" wd]))))
+
+(defn tiff->shapefile-zip!
+  [tiff dst]
+  (tiff->vector! tiff dst ".shp" "ESRI Shapefile"))
+
+(defn tiff->mapinfo-zip!
+  [tiff dst]
+  (tiff->vector! tiff dst ".tab" "Mapinfo File"))


adjust lot criteria validation

adjust lot criteria validation

--- src/clj_money/models/storage/sql_storage.clj
+++ src/clj_money/models/storage/sql_storage.clj
@@ -70,20 +70,11 @@
 (s/def ::transaction-id uuid?)
 (s/def ::date (partial instance? LocalDate))
 (s/def ::nilable-date #(or (instance? LocalDate %) (nil? %)))
-
-(defmulti lot-criteria (fn [criteria]
-                         (->> #{:id :account-id :commodity-id}
-                              (filter #(contains? criteria %))
-                              first)))
-(defmethod lot-criteria :account-id   [_] (s/keys :req-un [::account-id]   :opt-un[::commodity-id]))
-(defmethod lot-criteria :commodity-id [_] (s/keys :req-un [::commodity-id] :opt-un[::account-id]))
-(defmethod lot-criteria :default      [_] (s/keys :req-un [::id]           :opt-un[::commodity-id ::account-id]))
 (s/def ::lot-criteria
-  (s/multi-spec lot-criteria
-                (fn [criteria]
-                  (->> #{:id :account-id :commodity-id}
-                       (filter #(contains? criteria %))
-                       first))))
+  (s/and (fn [model]
+           (when-let [v (some #(get model %) #{:id :account-id :commodity-id :entity-id})]
+             (integer? v)))
+         (s/keys :opt-un [::id ::account-id ::commodity-id ::entity-id])))

 (s/def ::lot-transaction-criteria
   (fn [c] (integer? (some #(% c) [:id :lot-id :transaction-id]))))
@@ -266,6 +257,14 @@
    (if (and criteria (seq criteria))
      (h/merge-where sql (map->where criteria options))
      sql)))
+
+(defn- append-entity-id-to-lot-query
+  [sql entity-id]
+  (if entity-id
+    (-> sql
+        (h/join [:commodities :c] [:= :c.id :lots.commodity_id])
+        (h/merge-where [:= :c.entity-id entity-id]))
+    sql))

 (defn- descending-sort?
   "Returns a boolean value indicating whether or not
@@ -714,11 +713,14 @@
   (select-lots
     [_ criteria options]
     (validate-criteria criteria ::lot-criteria)
-    (query db-spec (-> (h/select :*)
-                       (h/from :lots)
-                       (h/where (map->where criteria))
-                       (append-limit options)
-                       (append-sort options))))
+    (let [entity-id (:entity-id criteria)
+          filtered-criteria (dissoc criteria :entity-id)]
+      (query db-spec (-> (h/select :*)
+                         (h/from :lots)
+                         (h/where (map->where filtered-criteria))
+                         (append-entity-id-to-lot-query entity-id)
+                         (append-limit options)
+                         (append-sort options)))))

   (delete-lot
     [_ id]


removed garbage

removed garbage

--- src/cljs/reagent_phonecat_tutorial/core.cljs
+++ src/cljs/reagent_phonecat_tutorial/core.cljs
@@ -10,11 +10,6 @@
             [goog.history.EventType :as EventType]
             [cljs.core.async :as a]
             [cljsjs.react :as react])
-  )
-
-(comment
-  (in-ns 'reagent-phonecat.core)
-
   )

 (enable-console-print!)


Even closer to working

Even closer to working

--- src/doctopus/storage/impls/postgres_impl.clj
+++ src/doctopus/storage/impls/postgres_impl.clj
@@ -57,25 +57,20 @@
   (if (nil? (:image res))
     res
     (let [bais (ByteArrayInputStream. (:image res))]
-      (-> res
-          (assoc :body bais)
-          (dissoc :image)))))
+      (assoc res :body bais))))

 (defn- make-response
   [res]
-  (response/response (:body res)))
-
-(defn- set-content-type
-  [res]
-  (response/content-type (dissoc res :mime-type) (:mime-type res)))
+  (log/debug "Content type from the DB is:" (:mime-type res))
+  (-> (response/response (:body res))
+      (response/content-type (:mime-type res))))

 (defn load-fn
   [uri]
   (if-let [res (first (db/get-document-by-uri uri))]
     (-> res
         (build-body)
-        (make-response)
-        (set-content-type))))
+        (make-response))))

 (defn remove-fn
   [document]


Add type hint.

Add type hint.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -18,7 +18,7 @@

-(def ^:dynamic *queue-size* 100000)
+(def ^:dynamic ^Integer *queue-size* (int 100000))
 (def ^:dynamic
   *queue-setup*
   (let [file-name "queue-setup.cfg"


Revisit this later

Revisit this later

--- src/madetomeasure_api/routes/subscribers.clj
+++ src/madetomeasure_api/routes/subscribers.clj
@@ -28,6 +28,7 @@

 (defn create-subscribers [request]
   (let [subscribers (extract-subscribers request)]
+    ; TODO: Extract this into some sort of try catch for SQL calls
     (try
       (let [insertions (apply clojure.java.jdbc/insert! db/db-spec :subscribers subscribers)]
         (present-response/success insertions))


Add more paths to :clean-targets for todomvc example

--- examples/todomvc/project.clj
+++ examples/todomvc/project.clj
@@ -12,7 +12,12 @@

   :plugins [[lein-shadow "0.1.5"]]

-  :clean-targets ^{:protect false} ["resources/public/js" "target"]
+  :clean-targets ^{:protect false} [:target-path
+                                    ".shadow-cljs"
+                                    "shadow-cljs.edn"
+                                    "package.json"
+                                    "package-lock.json"
+                                    "resources/public/js"]

   :shadow-cljs {:nrepl {:port 8777}


Fixup command-execution-info test

Fixup command-execution-info test

--- test/yetibot/core/test/util/command_info.clj
+++ test/yetibot/core/test/util/command_info.clj
@@ -27,17 +27,10 @@
         :command-args "bar"}
        (command-execution-info "foo bar"))))
   (testing "Real command with opts"
-    (let [result (command-execution-info
-                   "head 2" {:run-command? true
-                             :opts ["one" "two" "three"]})]
-      (is (= result
-             {:parse-tree [:expr [:cmd [:words "head" [:space " "] "2"]]]
-              :sub-commands [#"(\d+)" #'yetibot.core.commands.collections/head-n
-                             #".*" #'yetibot.core.commands.collections/head-1]
-              :matched-sub-cmd #'yetibot.core.commands.collections/head-n
-              :match ["2" "2"]
-              :command "head"
-              :command-args "2"
-              :result ["one" "two"]}
-             )
-          "Should parse a real command, correctly match it, and execute it"))))
+    (let [{:keys [result match command-args]}
+          (command-execution-info
+            "head 2" {:run-command? true
+                      :opts ["one" "two" "three"]})]
+      (= match ["2" "2"])
+      (= result ["one" "two"])
+      (= command-args "2"))))


Getting max minutes from plan template.

Getting max minutes from plan template.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -981,17 +981,18 @@
     om/IRender
     (render [_]
       (let [org-name (:org_name plan)
+            osx-max-minutes (some-> plan :osx :template :max_minutes)
             osx-usage (-> plan :usage :os:osx)]
         (html
          [:div
           [:fieldset [:legend (str org-name "'s iOS usage")]]
-          (if (not-empty osx-usage)
+          (if (and (not-empty osx-usage) osx-max-minutes)
             (let [osx-usage (->> osx-usage
                                  (sort)
                                  (reverse)
                                  (take 12)
                                  (map (fn [[month amount]]
-                                        {:usage amount :max 1000
+                                        {:usage amount :max osx-max-minutes
                                          :month ((comp datetime/date->month-name usage-key->date) month)})))]
               [:div.monthly-usage
                (om/build-all usage-bar osx-usage)])


Don't show any window if the desktop version is launched with '-nw'

--- desktop/src/nightweb_desktop/core.clj
+++ desktop/src/nightweb_desktop/core.clj
@@ -24,7 +24,8 @@
                 (java.io/file home-dir ".config" app-name-lower))))))

 (defn -main
-  []
+  [& args]
   (router/start-router (get-data-dir))
   (server/start-server)
-  (window/start-window))
+  (when-not (contains? (set args) "-nw")
+    (window/start-window)))


Add missing space in Card

Add missing space in Card

--- dev/semantic_reagent_cards/views.cljs
+++ dev/semantic_reagent_cards/views.cljs
@@ -23,7 +23,7 @@
                  [c/Image {:floated true :size :mini :src "http://semantic-ui.com/images/avatar/large/steve.jpg"}]
                  [c/CardHeader "Steve Sanders"]
                  [c/CardMeta "Friends of Elliot"]
-                 [c/CardDescription "Steve wants to add you to the group" [:strong "best friends"]]]
+                 [c/CardDescription "Steve wants to add you to the group " [:strong "best friends"]]]
                 [c/CardContent {:extra true}
                  [:div {:class-name "ui two buttons"}
                   [c/Button {:basic true :color :green} "Approve"]
@@ -33,7 +33,7 @@
                  [c/Image {:floated true :size :mini :src "http://semantic-ui.com/images/avatar2/large/molly.png"}]
                  [c/CardHeader "Molly Thomas"]
                  [c/CardMeta "New User"]
-                 [c/CardDescription " Molly wants to add you to the group" [:strong "musicians"]]]
+                 [c/CardDescription " Molly wants to add you to the group " [:strong "musicians"]]]
                 [c/CardContent {:extra true}
                  [:div {:class-name "ui two buttons"}
                   [c/Button {:basic true :color :green} "Approve"]


fixed syntax of new heads definitions

fixed syntax of new heads definitions

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -121,14 +121,10 @@

   (show/patch-fixture! :scene-side-1 (rgbw-simple) 1 33  :x 0 :y 1.7 :z 1.5)

-  (show/patch-fixture! :head-1 (jb-systems-sirius-8ch) 1 49 :x 3.5  :y 7  :z 2.8
-    :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224)
-  (show/patch-fixture! :head-2 (jb-systems-sirius-8ch) 1 65 :x 3.5  :y 7  :z 2.8
-    :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224)
-  (show/patch-fixture! :head-3 (jb-systems-sirius-8ch) 1 81 :x 3.5  :y 7  :z 2.8
-    :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224)
-  (show/patch-fixture! :head-4 (jb-systems-sirius-8ch) 1 97 :x 3.5  :y 7  :z 2.8
-    :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224)
+  (show/patch-fixture! :head-1 (jb-systems-sirius-8ch :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224) 1 49 :x 3.5  :y 7  :z 2.8)
+  (show/patch-fixture! :head-2 (jb-systems-sirius-8ch :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224) 1 65 :x 3.5  :y 7  :z 2.8)
+  (show/patch-fixture! :head-3 (jb-systems-sirius-8ch :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224) 1 81 :x 3.5  :y 7  :z 2.8)
+  (show/patch-fixture! :head-4 (jb-systems-sirius-8ch :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224) 1 97 :x 3.5  :y 7  :z 2.8)

   (show/patch-fixture! :back-1 (rgbd-cheap) 1 140 :x -1.757 :y 0.325 :z 0.3)
   (show/patch-fixture! :back-2 (rgbd-cheap) 1 144 :x -1.057 :y 0.325 :z 0.3)


add files/relative

add files/relative

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/files.cljs
+++ src/lt/objs/files.cljs
@@ -301,9 +301,12 @@
           (join cur find)
           (recur (parent cur) cur))))))

-(defn ->name|path [f & [relative]]
-  (let [path (if relative
-               (.relative fpath relative f)
+(defn relative [a b]
+  (.relative fpath a b))
+
+(defn ->name|path [f & [rel]]
+  (let [path (if rel
+               (relative rel f)
                f)]
     [(.basename fpath f) path]))


[WM] update deps; remove pedestal-tb snapshot

--- resources/leiningen/new/kraken_http_api/project.clj
+++ resources/leiningen/new/kraken_http_api/project.clj
@@ -1,18 +1,18 @@
 (defproject {{name}} "0.1.0-SNAPSHOT"
-  :description ""
+  :description "FIXME: HTTP API gateway for ..."
   :url "https://github.com/democracyworks/{{name}}"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.clojure/tools.logging "0.3.1"]
                  [turbovote.resource-config "0.2.0"]
-                 [com.novemberain/langohr "3.2.0"]
+                 [com.novemberain/langohr "3.3.0"]
                  [prismatic/schema "0.4.3"]
                  [ch.qos.logback/logback-classic "1.1.3"]

                  [io.pedestal/pedestal.service "0.4.0"]
                  [io.pedestal/pedestal.service-tools "0.4.0"]
-                 [democracyworks/pedestal-toolbox "0.6.1-SNAPSHOT"]
+                 [democracyworks/pedestal-toolbox "0.6.1"]

                  ;; this has to go before pedestal.immutant
                  ;; until this is fixed:


Annotate dynamic vars.

Annotate dynamic vars.

These will eventially become atoms.

--- dev-resources/src/cmr/dev/env/manager/repl.clj
+++ dev-resources/src/cmr/dev/env/manager/repl.clj
@@ -17,8 +17,8 @@
 ;;;   State & Transition Vars   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def state :stopped)
-(def system nil)
+(def ^:dynamic state :stopped)
+(def ^:dynamic system nil)
 (def valid-stop-transitions #{:started :running})
 (def invalid-init-transitions #{:initialized :started :running})
 (def invalid-deinit-transitions #{:started :running})


Tweaked logging levels.

Tweaked logging levels.

--- dev-resources/src/cmr/dev/env/manager/repl.clj
+++ dev-resources/src/cmr/dev/env/manager/repl.clj
@@ -39,7 +39,7 @@
     (init :default))
   ([mode]
     (if (contains? invalid-init-transitions state)
-      (log/error "System has aready been initialized.")
+      (log/warn "System has aready been initialized.")
       (do
         (alter-var-root #'system
           (constantly ((components/init mode))))
@@ -62,7 +62,7 @@
     (when (nil? system)
       (init mode))
     (if (contains? invalid-start-transitions state)
-      (log/error "System has already been started.")
+      (log/warn "System has already been started.")
       (do
         (alter-var-root #'system component/start)
         (alter-var-root #'state (fn [_] :started))))
@@ -71,7 +71,7 @@
 (defn stop
   []
   (if (contains? invalid-stop-transitions state)
-    (log/error "System already stopped.")
+    (log/warn "System already stopped.")
     (do
       (alter-var-root #'system
         (fn [s] (when s (component/stop s))))
@@ -86,7 +86,7 @@
 (defn run
   []
   (if (contains? invalid-run-transitions state)
-    (log/error "System is already running.")
+    (log/warn "System is already running.")
     (do
       (if (not (contains? invalid-init-transitions state))
         (init))


Properly shutdown system when ^D is entered.


Default decode to :edn codec

Default decode to :edn codec

--- core/src/immutant/codecs.clj
+++ core/src/immutant/codecs.clj
@@ -110,6 +110,6 @@
    `encoding` can be the name of the encoding or its
    content-type. `encoding` defaults to :none."
   ([data]
-     (decode data :none))
+     (decode data :edn))
   ([data encoding]
      (.decode (lookup-codec encoding) data)))


Handle zero-padding more robustly.

Handle zero-padding more robustly.

--- src/multihash/core.clj
+++ src/multihash/core.clj
@@ -83,13 +83,20 @@
       (throw (IllegalArgumentException.
                (str "Input string '" value "' is not valid hex: number of "
                     "characters (" (count value) ") is odd"))))
-    (let [width (/ (count value) 2)
-          data (.toByteArray (BigInteger. value 16))]
-      (if (= width (alength data))
-        data
-        (let [data' (byte-array width)]
-          (System/arraycopy data 0 data' (- width (alength data)) (alength data))
-          data')))))
+    (when-not (re-matches #"^[0-9a-fA-F]+$" value)
+      (throw (IllegalArgumentException.
+               (str "Input string '" value "' is not valid hex: "
+                    "contains illegal characters"))))
+    (let [length (/ (count value) 2)
+          int-bytes (.toByteArray (BigInteger. value 16))
+          int-length (alength int-bytes)]
+      (if (= length int-length)
+        int-bytes
+        (let [data (byte-array length)]
+          (if (< int-length length)
+            (System/arraycopy int-bytes 0 data (- length int-length) int-length)
+            (System/arraycopy int-bytes (- int-length length) data 0 length))
+          data)))))


address PR conversion concern

address PR conversion concern

--- src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
@@ -38,22 +38,19 @@
          {:style :light :margin :top :color :exception-red
           :text "Redact" :icon :trash-can
           :onClick
-          (fn []
-            (let [conf (js/confirm "Are you sure ?")]
-              (when conf
-                (let [name (entity "name")
-                      namespace (entity "namespace")
-                      snapshotId (entity "snapshotId")]
-                  (do
-                    (swap! state assoc :blocking-text "Redacting..." :blocking? true)
-                    (endpoints/call-ajax-orch
-                      {:endpoint (endpoints/delete-agora-entity
-                                   config? namespace name snapshotId)
-                       :on-done (fn [{:keys [success? status-text]}]
-                                    (swap! state dissoc :blocking? :blocking-text)
-                                    (if success?
-                                      ((:on-delete props))
-                                      (js/alert (str "Error ! Message : " status-text))))}))))))}]])
+          #(when (js/confirm "Are you sure?")
+            (let [name (entity "name")
+                  namespace (entity "namespace")
+                  snapshotId (entity "snapshotId")]
+              (swap! state assoc :blocking-text "Redacting..." :blocking? true)
+              (endpoints/call-ajax-orch
+                {:endpoint (endpoints/delete-agora-entity
+                             config? namespace name snapshotId)
+                 :on-done (fn [{:keys [success? status-text]}]
+                            (swap! state dissoc :blocking? :blocking-text)
+                            (if success?
+                              ((:on-delete props))
+                              (js/alert (str "Error ! Message : " status-text))))})))}]])
      [comps/EntityDetails {:entity entity}]
      [:div {:style {:fontSize "120%" :margin "1.5em 0 0.5em 0"}} "Save as:"]
      (map


more benchmarks for map-vals

more benchmarks for map-vals

--- scripts/benchmarks.clj
+++ scripts/benchmarks.clj
@@ -84,6 +84,31 @@
     (manual-transform data inc)
     ))

+(defn map-vals-map-iterable [^clojure.lang.IMapIterable m afn]
+  (let [k-it (.keyIterator m)
+        v-it (.valIterator m)]
+    (loop [ret {}]
+      (if (.hasNext k-it)
+        (let [k (.next k-it)
+              v (.next v-it)]
+          (recur (assoc ret k (afn v)))
+          )
+        ret
+        ))))
+
+(defn map-vals-map-iterable-transient [^clojure.lang.IMapIterable m afn]
+  (persistent!
+    (let [k-it (.keyIterator m)
+          v-it (.valIterator m)]
+      (loop [ret (transient {})]
+        (if (.hasNext k-it)
+          (let [k (.next k-it)
+                v (.next v-it)]
+            (recur (assoc! ret k (afn v)))
+            )
+          ret
+          )))))
+
 (let [data {:a 1 :b 2 :c 3 :d 4}]
   (run-benchmark "transform values of a small map" 1000000
     (into {} (for [[k v] data] [k (inc v)]))
@@ -93,6 +118,9 @@
     (transform [ALL LAST] inc data)
     (transform MAP-VALS inc data)
     (zipmap (keys data) (map inc (vals data)))
+    (into {} (map (fn [e] [(key e) (inc (val e))]) data))
+    (map-vals-map-iterable data inc)
+    (map-vals-map-iterable-transient data inc)
     ))

 (let [data (->> (for [i (range 1000)] [i i]) (into {}))]
@@ -100,10 +128,14 @@
     (into {} (for [[k v] data] [k (inc v)]))
     (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
     (persistent! (reduce-kv (fn [m k v] (assoc! m k (inc v))) (transient {}) data))
+    (persistent! (reduce-kv (fn [m k v] (assoc! m k (inc v))) (transient clojure.lang.PersistentHashMap/EMPTY) data))
     (reduce-kv (fn [m k v] (assoc m k (inc v))) (empty data) data)
     (transform [ALL LAST] inc data)
     (transform MAP-VALS inc data)
     (zipmap (keys data) (map inc (vals data)))
+    (into {} (map (fn [e] [(key e) (inc (val e))]) data))
+    (map-vals-map-iterable data inc)
+    (map-vals-map-iterable-transient data inc)
     ))

 (let [data [1 2 3 4 5]]


improve benchmarks script, add benchmark for large map values update

--- scripts/benchmarks.clj
+++ scripts/benchmarks.clj
@@ -29,10 +29,10 @@
     (for [i (range iters)]
       (time-ms amt-per-iter afn))))

-(defn compare-benchmark [iters amt-per-iter afn-map]
+(defn compare-benchmark [amt-per-iter afn-map]
   (let [results (transform [ALL LAST]
                   (fn [afn]
-                    (average-time-ms iters amt-per-iter afn))
+                    (average-time-ms 8 amt-per-iter afn))
                   afn-map)
         [[_ best-time] & _ :as sorted] (sort-by last results)
         ]
@@ -41,11 +41,11 @@
       (println (pretty-float5 t) "\t\t" (pretty-float3 (/ t best-time 1.0)) "\t\t" k)
       )))

-(defmacro run-benchmark [name iters amt-per-iter & exprs]
+(defmacro run-benchmark [name amt-per-iter & exprs]
   (let [afn-map (->> exprs (map (fn [e] [`(quote ~e) `(fn [] ~e)])) (into {}))]
     `(do
        (println "Benchmark:" ~name)
-       (compare-benchmark ~iters ~amt-per-iter ~afn-map)
+       (compare-benchmark ~amt-per-iter ~afn-map)
        (println "\n********************************\n")
        )))

@@ -53,7 +53,7 @@

 (let [data {:a {:b {:c 1}}}
       p (comp-paths :a :b :c)]
-  (run-benchmark "get value in nested map" 6 10000000
+  (run-benchmark "get value in nested map" 10000000
     (get-in data [:a :b :c])
     (select [:a :b :c] data)
     (compiled-select p data)
@@ -74,14 +74,14 @@
           (my-update m3 :c afn))))))

 (let [data {:a {:b {:c 1}}}]
-  (run-benchmark "update value in nested map" 6 1000000
+  (run-benchmark "update value in nested map" 1000000
     (update-in data [:a :b :c] inc)
     (transform [:a :b :c] inc data)
     (manual-transform data inc)
     ))

 (let [data [1 2 3 4 5]]
-  (run-benchmark "map a function over a vector" 6 1000000
+  (run-benchmark "map a function over a vector" 1000000
     (vec (map inc data))
     (mapv inc data)
     (transform ALL inc data)
@@ -101,13 +101,20 @@
     ))

 (let [data {:a 1 :b 2 :c 3 :d 4}]
-  (run-benchmark "transform values of a map" 6 1000000
+  (run-benchmark "transform values of a map" 1000000
     (into {} (for [[k v] data] [k (inc v)]))
     (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
     (manual-similar-reduce-kv data)
     (transform [ALL LAST] inc data)
     ))

+(let [data (->> (for [i (range 1000)] [i i]) (into {}))]
+  (run-benchmark "transform values of large map" 1000
+    (into {} (for [[k v] data] [k (inc v)]))
+    (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
+    (manual-similar-reduce-kv data)
+    (transform [ALL LAST] inc data)
+    ))

 (declarepath TreeValues)
@@ -132,7 +139,6 @@

 (let [data [1 2 [[3]] [4 6 [7 [8]] 10]]]
   (run-benchmark "update every value in a tree (represented with vectors)"
-    6
     100000
     (walk/postwalk (fn [e] (if (and (number? e) (even? e)) (inc e) e)) data)
     (transform [(walker number?) even?] inc data)


fixed a bug in the tag trim code

fixed a bug in the tag trim code

--- src/ontrail/parser.clj
+++ src/ontrail/parser.clj
@@ -92,7 +92,7 @@
   ([tags]
      (let [trim-tag #(-> % string/trim)]
        (if (string? tags)
-         (filter (partial not= "") (string/split (trim-tag tags) #","))
+         (filter (partial not= "") (map string/trim (string/split tags #",")))
          '()))))

 (defn parse-natural [hr]


Show only unique pairs.

Show only unique pairs.

--- src/app/pairs.cljs
+++ src/app/pairs.cljs
@@ -7,8 +7,15 @@
 (def index (atom 0))

 (defn get-combination [list]
-  (let [get-item #(list (rand-int (count list)))]
-    [(get-item) (get-item)]))
+  (if (< (count list) 2)
+    ["Add" "items"]
+    (let [get-item #(list (rand-int (count list)))
+          item1 (get-item)]
+      (loop [trials 100]
+        (let [item2 (get-item)]
+          (if (= item1 item2)
+            (recur (dec trials))
+            [(get-item) (get-item)]))))))

 (defn pairs [data presentation]
   (reify


Pass delete-node-blobstore through to zk-state

--- storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
+++ storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
@@ -53,6 +53,7 @@
       (create_sequential [this path data acls] (.create_sequential zk-state path data acls))
       (set_data [this path data acls] (.set_data zk-state path data acls))
       (delete_node [this path] (.delete_node zk-state path))
+      (delete_node_blobstore [this path nimbus-host-port-info] (.delete_node_blobstore zk-state path nimbus-host-port-info))
       (get_data [this path watch?] (.get_data zk-state path watch?))
       (get_data_with_version [this path watch?] (.get_data_with_version zk-state path watch?))
       (get_version [this path watch?] (.get_version zk-state path watch?))


CMR-5374: Remove unnecessary wait.

CMR-5374: Remove unnecessary wait.

--- system-int-test/test/cmr/system_int_test/search/data_json_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/data_json_search_test.clj
@@ -70,7 +70,6 @@
         private-collections-with-tag (create-collections 5)
         private-collections-without-tag (create-collections 4)]
     (tag-util/create-tag (config/echo-system-token) tag)
-    (index-util/wait-until-indexed)

     ;; Make collections public
     (make-collections-public public-collections-with-tag)


:iphone: Display user popup on click instead of hover

--- frontend/src/uxbox/main/ui/users.cljs
+++ frontend/src/uxbox/main/ui/users.cljs
@@ -49,8 +49,8 @@
         photo (if (str/empty? (:photo profile ""))
                 "/images/avatar.jpg"
                 (:photo profile))]
-    [:div.user-zone {:on-mouse-enter #(swap! local assoc :open true)
-                     :on-mouse-leave #(swap! local assoc :open false)}
+    [:div.user-zone {:on-mouse-down #(swap! local assoc :open true)
+                     :on-mouse-up #(swap! local assoc :open false)}
      [:span (:fullname profile)]
      [:img {:src photo}]
      (user-menu (:open @local))]))


leave newline at end of mapseq docstring

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -374,7 +374,8 @@
                     (maybe/just v)
                     (maybe/nothing)))
                 [1 2])
-      ;=> <Nothing>"
+      ;=> <Nothing>
+  "
   [mf coll]
   (sequence (map mf coll)))


CMR-2854 Updates test to make it more readable

--- access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
@@ -436,23 +436,36 @@
         group2-concept-id (:concept_id group2)]
     (u/wait-until-indexed)
     (testing "Search with every criteria"
-      (are3 [provider-ids permitted-groups identity-types users acls]
-        (let [response (ac/search-for-acls (u/conn-context) {:provider provider-ids
-                                                             :permitted-group permitted-groups
-                                                             :identity-type identity-types
-                                                             :permitted-user users})]
+      (are3 [params acls]
+        (let [response (ac/search-for-acls (u/conn-context) params)]
           (is (= (acls->search-response (count acls) acls)
                  (dissoc response :took))))
         "Multiple search criteria"
-        ["PROV1"] ["registered"] ["catalog_item"] ["user1"] first-result
+        {:provider "PROV1"
+         :permitted-group "registered"
+         :identity-type "catalog_item"
+         :permitted-user "user1"}
+        [acl7]

         "One criteria changed to get empy result"
-        ["PROV1"] ["guest"] ["catalog_item"] ["user1"] []
+        {:provider "PROV1"
+         :permitted-group "guest"
+         :identity-type "catalog_item"
+         :permitted-user "user1"}
+        []

         ;;To show that when permitted groups are specified, the groups associated with the user but not included in the permitted groups params are not returned
         "Multiple search criteria with permitted groups being registered and guest but user1 being specified as permitted user"
-        ["PROV1" "PROV2"] ["registered" "guest"] ["catalog_item" "provider"] ["user1"] second-result
+        {:provider ["PROV1" "PROV2"]
+         :permitted-group ["guest" "registered"]
+         :identity-type ["catalog_item" "provider"]
+         :permitted-user "user1"}
+        [acl4 acl7]

         ;;Shows when permitted groups are not specified, then all user groups are returned for that user
         "Multiple search criteria with no permitted group specified and permitted users set to user2"
-        ["PROV1" "PROV2"] [""] ["catalog_item" "provider"] ["user2"] third-result))))
+        {:provider ["PROV1" "PROV2"]
+         :permitted-group ""
+         :identity-type ["catalog_item" "provider"]
+         :permitted-user "user2"}
+        [acl4 acl5 acl6 acl7 acl9]))))


project settings env-vars whitespace fixes

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -264,10 +264,10 @@
             "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
             "The values can be any bash expression and can reference other variables, such as setting "
             [:code "M2_MAVEN"] " to " [:code "${HOME}/.m2)"] "."
-            "To disable string substitution you need to escape the " [:code "$"]
+            " To disable string substitution you need to escape the " [:code "$"]
             " characters by prefixing them with " [:code "\\"] "."
-            "For example a crypt'ed password like " [:code "$1$O3JMY.Tw$AdLnLjQ/5jXF9.MTp3gHv/"]
-            " you would enter " [:code "\\$1\\$O3JMY.Tw\\$AdLnLjQ/5jXF9.MTp3gHv/"] "."]
+            " For example, a crypt'ed password like " [:code "$1$O3JMY.Tw$AdLnLjQ/5jXF9.MTp3gHv/"]
+            " would be entered as " [:code "\\$1\\$O3JMY.Tw\\$AdLnLjQ/5jXF9.MTp3gHv/"] "."]
            [:form
             [:input#env-var-name
              {:required true, :type "text", :value new-env-var-name


don't dissoc-path the notes if the first word is "it" (pred=lei or lui)

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -14,8 +14,14 @@
                         show-notes true}}]
   (let [input (if (or (and (not (= "it" from-language))
                            (not (= "fr" from-language)))
-                      (not (= :past (get-in input [:synsem :sem :tense])))
-                      (not (= :perfect (get-in input [:synsem :sem :aspect]))))
+                      (and (not (= :past (get-in input [:synsem :sem :tense])))
+                           (not (= :perfect (get-in input [:synsem :sem :aspect])))
+                           (not (= :lui (get-in input [:synsem :sem :subj :pred])))
+                           (not (= :lei (get-in input [:synsem :sem :subj :pred])))))
+                ;; TODO: we are (dissoc)ing two paths, but probably only need
+                ;; to do the second [:english :a :note]. It's harmless to do both
+                ;; but confusing to try to understand since the first is
+                ;; probably not significant.
                 (dissoc-paths input [[:comp :english :note]
                                      [:english :a :note]])
                 input)]


show gender symbol for pronouns for both Italian and French

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -141,7 +141,7 @@
    (and (string? (get-in word [:english]))
         (= :masc (get-in word [:gender]))
         (= true (get-in word [:pronoun]))
-        (= "it" from-language)
+        (some #(= from-language %) ["fr" "it"])
         ;; If a pronoun is 'gendered', it means that the gender
         ;; is implicit in the word, e.g. "he" and "she".
         ;; An example of a non-gendered pronoun in English is "they",
@@ -153,7 +153,7 @@
    (and (string? (get-in word [:english]))
         (= :fem (get-in word [:gender]))
         (= true (get-in word [:pronoun]))
-        (= "it" from-language)
+        (some #(= from-language %) ["fr" "it"])
         (= false (unify false (get-in word [:agr :gendered] false))))
    (trim (str (get-in word [:english]) " (♀)"))

@@ -269,7 +269,6 @@
      (log/debug (str "A STRING-A: " string-a))
      (log/debug (str "B STRING-B: " string-b))
      (cond
-
        (and (= string-b "s")
             (nil? (re-find #"s$" string-a)) ;; plural noun phrase does *not* end with 's' (e.g. "the women"
             (= :plur (get-in word [:a :agr :number]))
@@ -294,7 +293,7 @@
    (and (= :english (get-in word '(:infl)))
         (string? (get-in word '(:english))))
    (get-in word '(:english))
-
+
    (= true (get-in word '(:hidden)))
    ;;   "Ø"
    ""
@@ -693,7 +692,7 @@
     (= (get-in word '(:cat) :noun))
     (string? (get-in word '(:root))))
    (get-in word '(:root))
-
+
    (and
     (= (get-in word '(:agr :number)) :sing)
     (= (get-in word '(:cat) :noun))
@@ -702,14 +701,14 @@
               (if (and (get-in word '(:note))
                        (not (= false show-notes)))
                 (get-in word '(:note)))))
-
+
    ;; TODO: remove support for deprecated :root - use :sing instead.
    (and
     (= (get-in word '(:agr :number)) :sing)
     (= (get-in word '(:cat) :noun))
     (string? (get-in word '(:root :english))))
    (get-in word '(:root :english))
-
+
    (and
     (= (get-in word '(:agr :number)) :sing)
     (= (get-in word '(:cat) :noun))


Property maps are now parsed to JS objects recursively

This means that styles can be specified as Clojure maps.

--- src/quiescent/dom.cljs
+++ src/quiescent/dom.cljs
@@ -11,7 +11,7 @@
   [obj]
   (if (map? obj)
     (let [o (js-obj)]
-      (doseq [[k v] obj] (aset o (name k) v))
+      (doseq [[k v] obj] (aset o (name k) (js-props v)))
       o)
     obj))


Fix :checkbox should not be required for `table`.

--- src/reforms/table.cljs
+++ src/reforms/table.cljs
@@ -85,8 +85,8 @@
                           (mapcat keys)
                           distinct))
         {selection :selection selection-path :path row-id-fn :row-id nil-selects-all? :nil-selects-all? :or {row-id-fn (comp first vals)}} checkboxes
-        selected (or (binding/get-in selection selection-path) #{}) ; selection-path may be nil
-        select-all (and nil-selects-all? (nil? (binding/get-in selection selection-path)))]
+        selected (when selection (or (binding/get-in selection selection-path) #{})) ; selection-path may be nil
+        select-all (when selection (and nil-selects-all? (nil? (binding/get-in selection selection-path))))]
     [:table attrs
      [:thead
       [:tr


Reset requested-uri on use

Reset requested-uri on use

--- src/cylon/core.clj
+++ src/cylon/core.clj
@@ -347,7 +347,7 @@
     (let [form
           [:form {:method "POST" :style "border: 1px dotted #555"
                   :action (bidi/path-for routes (get @handlers-p :process-login))}
-           (when requested-uri
+           (when (not-empty requested-uri)
              [:input {:type "hidden" :name :requested-uri :value requested-uri}])
            [:div
             [:label {:for "username"} "Username"]
@@ -373,7 +373,8 @@

       {:status 302
        :headers {"Location" (or requested-uri "/")} ; "/" can be parameterized (TODO)
-       :cookies {"session" (start-session! http-session-store username)}}
+       :cookies {"session" (start-session! http-session-store username)
+                 "requested-uri" ""}}

       ;; Return back to login form
       {:status 302


Fix setting aws/credentials-provider from env

The keys need to be aws-access-key & aws-secret-key to be compatible
with the current env setup and the vector needs to be wrapped in a
constant function

--- src/braid/core.clj
+++ src/braid/core.clj
@@ -18,10 +18,12 @@

 (defn start!
   "Entry point for prod"
-  ([port] (let [env (if (:api-secret env)
-                      (assoc env :aws/credentials-provider ((juxt :api-key :api-secret) env))
-                      env)]
-            (start! port env)))
+  ([port]
+   (start! port
+           (cond-> env
+             (env :aws-access-key)
+             (assoc :aws/credentials-provider
+                    (constantly ((juxt :aws-access-key :aws-secret-key) env))))))
   ([port args]
    ;; modules must run first
    (when (and (= (args :environment) "prod") (empty? (args :hmac-secret)))


Don't do weird display with upload emoji input

--- src/braid/emoji/client/views.cljs
+++ src/braid/emoji/client/views.cljs
@@ -19,21 +19,17 @@
                  :on-change (fn [e]
                               (reset! shortcode
                                       (.. e -target -value)))}]]
-       [:label {:style {:border "1px solid gray"
-                        :background-color "white"
-                        :padding "0.25em"
-                        :border-radius "5px"}}
-        (if @uploading? "Uploading..." "Upload Image")
-        [:input {:type "file"
-                 :multiple false
-                 :style {:display "none"}
-                 :on-change (fn [e]
-                              (reset! uploading? true)
-                              (s3/upload
-                                (aget (.. e -target -files) 0)
-                                (fn [url]
-                                  (reset! uploading? false)
-                                  (reset! image-url url))))}]]
+       [:label
+        (if @uploading? "Uploading..."
+            [:input {:type "file"
+                     :multiple false
+                     :on-change (fn [e]
+                                  (reset! uploading? true)
+                                  (s3/upload
+                                    (aget (.. e -target -files) 0)
+                                    (fn [url]
+                                      (reset! uploading? false)
+                                      (reset! image-url url))))}])]
        [:button
         {:disabled (or (string/blank? @shortcode)
                        (string/blank? @image-url)


117 el ns added

117 el ns added

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -24,6 +24,7 @@
             [etaoin.xpath :as xpath]
             [etaoin.util :as util :refer [defmethods]]
             [etaoin.driver :as drv]
+            [etaoin.element :as el]
             [clojure.data.codec.base64 :as b64]
             [clojure.tools.logging :as log]
             [clojure.java.io :as io]


fix build

fix build

--- src/clj/com/rpl/specter/navs.cljc
+++ src/clj/com/rpl/specter/navs.cljc
@@ -566,6 +566,14 @@
         (str begins newl)
         )))

+  #?(:cljs cljs.core/MapEntry)
+  #?(:cljs
+    (update-first [e afn]
+      (cljs.core/->MapEntry (-> e key afn) (val e) nil)))
+  #?(:cljs
+    (update-last [e afn]
+      (cljs.core/->MapEntry (key e) (-> e val afn) nil)))
+
   #?(:clj Object :cljs default)
   (update-first [l val]
     (update-first-list l val))
@@ -585,6 +593,12 @@
     (first s))
   (get-last [s]
     (last s))
+
+  #?(:cljs cljs.core/MapEntry)
+  (get-first [e]
+    (key e))
+  (get-last [e]
+    (val e))

   #?(:clj String :cljs string)
   (get-first [s]


add instructional prompt to Precognition, re-alphabetize

--- src/clj/game/cards-operations.clj
+++ src/clj/game/cards-operations.clj
@@ -300,9 +300,6 @@
                                     (+ c (count (filter (fn [ice] (:rezzed ice)) (:ices server)))))
                                   0 (flatten (seq (:servers corp))))))}

-   "Precognition"
-   {:effect (req (doseq [c (take 5 (:deck corp))] (move state side c :play-area)))}
-
    "Power Grid Overload"
    {:trace {:base 2 :msg "trash 1 piece of hardware"
             :effect (req (let [max-cost (- target (second targets))]
@@ -326,6 +323,11 @@
                                                           (<= (:cost %) n))}
                                      :msg (msg "trash " (:title target)) :effect (effect (trash target))}
                                     card nil)))}
+
+   "Precognition"
+   {:effect (req (prompt! state side card
+                         (str "Drag cards from the play area back onto R&D") ["OK"] {})
+                 (doseq [c (take 5 (:deck corp))] (move state side c :play-area)))}

    "Predictive Algorithm"
    {:events {:pre-steal-cost {:effect (effect (steal-cost-bonus [:credit 2]))}}}


redirect to index.html on request to /

redirect to index.html on request to /

--- src/clj/passa_paraula/handler.clj
+++ src/clj/passa_paraula/handler.clj
@@ -21,7 +21,7 @@
      (include-js "js/app.js")]]))

 (defroutes routes
-  (GET "/" [] (file-response "index.html" {:root "resources/public"}))
+  (GET "/" [] (redirect "/index.html"))
   (resources "/")
   (not-found "Not Found"))


More concise destructuring

More concise destructuring

--- src/cljs/asciinema_player/vt.cljs
+++ src/cljs/asciinema_player/vt.cljs
@@ -49,7 +49,7 @@
   (update-in vt [:lines] (fn [lines]
                            (conj (vec (drop 1 lines)) (empty-line width)))))

-(defn scroll-down [{width :width height :height :as vt}]
+(defn scroll-down [{:keys [width height] :as vt}]
   (update-in vt [:lines] (fn [lines]
                            (vec (conj (take (dec height) lines) (empty-line width))))))

@@ -66,7 +66,7 @@
 (defn execute-ht [vt]
   (move-cursor-to-next-tab vt 1))

-(defn execute-lf [{height :height {y :y} :cursor :as vt}]
+(defn execute-lf [{:keys [height] {y :y} :cursor :as vt}]
   (if (= height (inc y))
     (-> vt
         scroll-up
@@ -75,7 +75,7 @@
         (assoc-in [:cursor :x] 0)
         (update-in [:cursor :y] inc))))

-(defn move-cursor-down [{height :height {y :y} :cursor :as vt}]
+(defn move-cursor-down [{:keys [height] {y :y} :cursor :as vt}]
   (if (= height (inc y))
     (scroll-up vt)
     (update-in vt [:cursor :y] inc)))
@@ -104,7 +104,7 @@

 (defn execute-sc
   "http://www.vt100.net/docs/vt510-rm/DECSC"
-  [{{x :x y :y} :cursor char-attrs :char-attrs :as vt}]
+  [{{:keys [x y]} :cursor :keys [char-attrs] :as vt}]
   (assoc vt :saved {:cursor {:x x :y y}
                     :char-attrs char-attrs}))

@@ -141,7 +141,7 @@
       default
       v)))

-(defn execute-ich [{{x :x y :y} :cursor width :width char-attrs :char-attrs :as vt}]
+(defn execute-ich [{{:keys [x y]} :cursor :keys [width char-attrs] :as vt}]
   (let [n (get-param vt 0 1)]
     (update-in vt [:lines y] (fn [line]
                                (vec (take width (concat (take x line)
@@ -154,19 +154,19 @@
         new-y (if (>= new-y 0) new-y 0)]
     (assoc-in vt [:cursor :y] new-y)))

-(defn execute-cud [{{y :y} :cursor height :height :as vt}]
+(defn execute-cud [{{y :y} :cursor :keys [height] :as vt}]
   (let [n (get-param vt 0 1)
         new-y (+ y n)
         new-y (if (< new-y height) new-y (dec height))]
     (assoc-in vt [:cursor :y] new-y)))

-(defn execute-cuf [{{x :x} :cursor width :width :as vt}]
+(defn execute-cuf [{{x :x} :cursor :keys [width] :as vt}]
   (let [n (get-param vt 0 1)
         new-x (+ x n)
         new-x (if (< new-x width) new-x (dec width))]
     (assoc-in vt [:cursor :x] new-x)))

-(defn execute-cub [{{x :x} :cursor width :width :as vt}]
+(defn execute-cub [{{x :x} :cursor :keys [width] :as vt}]
   (let [n (get-param vt 0 1)
         new-x (- x n)
         new-x (if (>= new-x 0) new-x 0)]
@@ -187,7 +187,7 @@
         new-x (if (<= n width) (dec n) (dec width))]
     (assoc-in vt [:cursor :x] new-x)))

-(defn execute-cup [{width :width height :height :as vt}]
+(defn execute-cup [{:keys [width height] :as vt}]
   (let [new-x (get-param vt 1 1)
         new-x (if (<= new-x width) (dec new-x) (dec width))
         new-y (get-param vt 0 1)
@@ -204,7 +204,7 @@
   (vec (concat (take x line)
                (repeat (- (count line) x) (empty-cell char-attrs)))))

-(defn clear-to-end-of-screen [{{x :x y :y} :cursor width :width height :height char-attrs :char-attrs :as vt}]
+(defn clear-to-end-of-screen [{{:keys [x y]} :cursor :keys [width height char-attrs] :as vt}]
   (update-in vt [:lines] (fn [lines]
                            (let [top-lines (take y lines)
                                  curr-line (clear-line-right (nth lines y) x char-attrs)
@@ -215,14 +215,14 @@
   (vec (concat (repeat (inc x) (empty-cell char-attrs))
                (drop (inc x) line))))

-(defn clear-to-beginning-of-screen [{{x :x y :y} :cursor width :width height :height char-attrs :char-attrs :as vt}]
+(defn clear-to-beginning-of-screen [{{:keys [x y]} :cursor :keys [width height char-attrs] :as vt}]
   (update-in vt [:lines] (fn [lines]
                            (let [top-lines (repeat y (empty-line width char-attrs))
                                  curr-line (clear-line-left (nth lines y) x char-attrs)
                                  bottom-lines (drop (inc y) lines)]
                              (vec (concat top-lines [curr-line] bottom-lines))))))

-(defn clear-screen [{width :width height :height char-attrs :char-attrs :as vt}]
+(defn clear-screen [{:keys [width height char-attrs] :as vt}]
   (assoc-in vt [:lines] (empty-screen width height char-attrs)))

 (defn execute-ed [vt]
@@ -247,7 +247,7 @@
 (defn ignore [vt input]
   vt)

-(defn print [{width :width height :height {x :x y :y} :cursor :as vt} input]
+(defn print [{:keys [width height] {:keys [x y]} :cursor :as vt} input]
   (if (= width (inc x))
     (if (= height (inc y))
       (-> vt


Move comments around

Move comments around

--- src/com/frereth/server/system.clj
+++ src/com/frereth/server/system.clj
@@ -28,16 +28,7 @@
                             :protocol :tcp}
                       :direction :bind
                       :sock-type :router}]
-    {;; Almost definitely want to maximize this thread count
-     ;; Although that really depends on the environment.
-     ;; It makes sense for a production server.
-     ;; For a local one...probably not so much.
-     ;; Q: Why not?
-     ;; A: Well, context switches come to mind. I'm not
-     ;; sure whether I buy that that would be an issue.
-     :context {:thread-count (-> (util/core-count) dec (max 1))}
-
-     :action-socket (assoc-in default-sock [:url :port] 7841)
+    {:action-socket (assoc-in default-sock [:url :port] 7841)
      :action-loop {:_name "Action!"}
      :action-loop-interface {:in-chan (async/chan)
                              :external-reader (fn [_]
@@ -47,6 +38,16 @@

      :auth-socket (assoc-in default-sock [:url :port] 7843)
      :auth-loop {:_name "authcz"}
+
+     ;; Almost definitely want to maximize this thread count
+     ;; Although that really depends on the environment.
+     ;; It makes sense for a production server.
+     ;; For a local one...probably not so much.
+     ;; Q: Why not?
+     ;; A: Well, context switches come to mind. I'm not
+     ;; sure whether I buy that that would be an issue.
+     ;; Whichever approach makes the most sense, we have to have at least 1.
+     :context {:thread-count (-> (util/core-count) dec (max 1))}

      :control-socket (assoc default-sock
                             :url {:protocol :inproc


Review comment: explain why upserts between generational steps don't conflict.

--- src/common/datomish/transact.cljc
+++ src/common/datomish/transact.cljc
@@ -506,10 +506,19 @@
         (let [{:keys [upserted resolved upserts-ev allocations-ev allocations-e allocations-v entities]} evolution]
           (merge-with
             concat
-            {:tempids  id->e ;; TODO: ensure we handle conflicting upserts across generations correctly here.
-             :upserted upserted
+            {:upserted upserted
              :resolved resolved
-             :entities entities}
+             :entities entities
+             ;; The keys of the id->e map are unique between generation steps, so we can simply
+             ;; concat tempids.  Suppose that id->e and id->e* are two such mappings, resolved on
+             ;; subsequent evolutionary steps, and that id is a key in the intersection of the two
+             ;; key sets. This can't happen: if id maps to e via id->e, all instances of id have
+             ;; been evolved forward (replaced with e) before we try to resolve the next set of
+             ;; :upserts-e.  That is, we'll never successfully upsert the same id-literal in more
+             ;; than one generation step.  (We might upsert the same id-literal to multiple entids
+             ;; via distinct [a v] pairs in a single generation step; in this case,
+             ;; <resolve-upserts-e will throw.)
+             :tempids  id->e}
             (evolve-upserts-ev id->e upserts-ev)
             (evolve-upserts-e  id->e upserts-e)
             (evolve-allocations-ev id->e allocations-ev)


Clostache release 0.6.0

Clostache release 0.6.0

--- modules/clostache/project.clj
+++ modules/clostache/project.clj
@@ -1,11 +1,11 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/clostache "0.6.0-SNAPSHOT"
+(defproject juxt.modular/clostache "0.6.0"
   :description "A modular extension that provides a Clostache templater for juxt.modular/template"
   :url "https://github.com/juxt/modular/tree/master/modules/clostache"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[com.stuartsierra/component "0.2.1"]
                  [de.ubercode.clostache/clostache "1.3.1"]
-                 [juxt.modular/template "0.6.0-SNAPSHOT"]
+                 [juxt.modular/template "0.6.0"]
                  ])


Fix default development server uri.

Fix default development server uri.

--- frontend/scripts/figwheel.clj
+++ frontend/scripts/figwheel.clj
@@ -3,7 +3,7 @@

 (def options
   {;;"uxbox.config.url" "http://127.0.0.1:6060/api"
-   "uxbox.config.url" "https://test.uxbox.io/api"
+   "uxbox.config.url" "https://demo.uxbox.io/api"
    })

 (ra/start-figwheel!


errors above inputs

errors above inputs

--- frontend/src/leftover/ui.cljs
+++ frontend/src/leftover/ui.cljs
@@ -60,7 +60,7 @@
       (put! actions {:type :add-payment :args state})
       (om/set-state! owner :errors errors))))

-(defn show-error
+(defn error-box
   [name error]
   (if error
     (obr/alert {:bs-style "danger"}
@@ -78,10 +78,10 @@
       (let [actions (om/get-shared owner :actions)]
         (dom/div {:class "col-sm-6 component"}
                  (dom/form
+                   (error-box "Location" (get-in state [:errors :location]))
                    (obi/input {:type "text" :placeholder "Location" :value location :on-change #(handle-change % owner :location)})
-                   (show-error "Location" (get-in state [:errors :location]))
+                   (error-box "Amount" (get-in state [:errors :amount]))
                    (obi/input {:type "text" :placeholder "Amount" :value amount :on-change #(handle-change % owner :amount)})
-                   (show-error "Amount" (get-in state [:errors :amount]))
                    (obb/button-group {:justified? true}
                                      (obb/button-group {} (obb/button { :bs-style "success" :on-click (fn [e] (.preventDefault e) (add-payment actions owner state) nil) } "Add")))))))))


updated dbvis version

updated dbvis version

--- main/src/dda/pallet/dda_managed_ide/domain.clj
+++ main/src/dda/pallet/dda_managed_ide/domain.clj
@@ -116,7 +116,7 @@
        :basics {:argo-uml {:version "0.34"}
                 :yed {:download-url
                       "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip"}
-                :dbvis {:version "10.0.13"}}}
+                :dbvis {:version "10.0.15"}}}
       (when (contains? ide-platform :atom)
         {:atom (atom/atom-config vm-type contains-clojure? contains-devops?)})
       (when (contains? ide-platform :idea)