Fix spacing props for mui 4

Fix spacing props for mui 4

--- examples/material-ui/src/example/core.cljs
+++ examples/material-ui/src/example/core.cljs
@@ -54,10 +54,10 @@
     #js {:palette #js {:primary #js {:main (gobj/get (.-red mui-colors) 100)}}}))

 (defn custom-styles [theme]
-  #js {:button #js {:margin (.. theme -spacing -unit)}
+  #js {:button #js {:margin (.spacing theme 1)}
        :textField #js {:width 200
-                       :marginLeft (.. theme -spacing -unit)
-                       :marginRight (.. theme -spacing -unit)}})
+                       :marginLeft (.spacing theme 1)
+                       :marginRight (.spacing theme 1)}})

 (def with-custom-styles (withStyles custom-styles))

@@ -68,7 +68,7 @@
   [:> mui/Grid
    {:container true
     :direction "column"
-    :spacing 16}
+    :spacing 2}

    [:> mui/Grid {:item true}
     [:> mui/Toolbar
@@ -135,7 +135,7 @@
     [:> mui/Grid
      {:container true
       :direction "row"
-      :spacing 8}
+      :spacing 4}

      ;; For properties that require React Node as parameter,
      ;; either use r/as-element to convert Reagent hiccup forms into React elements,


Render run row statuses correctly

Render run row statuses correctly

This fixes a bug where the "not-run" run status does not render
correctly in the UI.

--- src-cljs/frontend/components/pages/workflow.cljs
+++ src-cljs/frontend/components/pages/workflow.cljs
@@ -1,5 +1,6 @@
 (ns frontend.components.pages.workflow
-  (:require [frontend.components.common :as common]
+  (:require [clojure.string :as string]
+            [frontend.components.common :as common]
             [frontend.components.pieces.button :as button]
             [frontend.components.pieces.card :as card]
             [frontend.components.pieces.icon :as icon]
@@ -42,21 +43,22 @@
                     run/branch-name
                     run/commit-sha]
              run-name :run/name}
-            (om-next/props this)]
+            (om-next/props this)
+            run-status-class (status-class status)]
         (card/basic
          (element :content
            (html
             [:div
-             [:div.status {:class (name status)}
+             [:div.status {:class (name run-status-class)}
               [:a.exception {:href (routes/v1-run {:run-id id})}
-               [:span.status-icon {:class (name status)}
+               [:span.status-icon {:class (name run-status-class)}
                 (case (status-class status)
                   :status-class/failed (icon/status-failed)
                   :status-class/stopped (icon/status-canceled)
                   :status-class/succeeded (icon/status-passed)
                   :status-class/running (icon/status-running)
                   :status-class/waiting (icon/status-queued))]
-               [:.status-string (name status)]]]
+               [:.status-string (string/replace (name status) #"-" " ")]]]
              [:div.run-info
               [:div.build-info-header
                [:div.contextual-identifier


Removed unneeded logging.

Removed unneeded logging.

--- src-cljs/kixi/hecuba/widgets/datetimepicker.cljs
+++ src-cljs/kixi/hecuba/widgets/datetimepicker.cljs
@@ -73,7 +73,6 @@
                                            :className  "btn btn-primary btn-large"
                                            :onClick
                                            (fn [e]
-                                             (println "HOOOOO")
                                              (let [start (-> (om/get-node owner "dateFrom") .-value)
                                                    end   (-> (om/get-node owner "dateTo") .-value)]
                                                (evaluate-dates data history start end)))}


Removing an extra div

Removing an extra div

:<> - Reagent Fragment (https://github.com/reagent-project/reagent/blob/master/doc/ReactFeatures.md)
Example #1

[:div
  [:span "foo"]
  [:span "bar"]]

=>

    "foo"
    "bar"

--- examples/todomvc/src/todomvc/views.cljs
+++ examples/todomvc/src/todomvc/views.cljs
@@ -99,7 +99,7 @@

 (defn todo-app
   []
-  [:div
+  [:<>
    [:section#todoapp
     [task-entry]
     (when (seq @(subscribe [:todos]))


[FLINK-9995][tests] Improve tearing down Mesos.

- Clean up logs and Mesos working directory.
- Kill Mesos processes using grepkill! utility.

--- flink-jepsen/src/jepsen/flink/mesos.clj
+++ flink-jepsen/src/jepsen/flink/mesos.clj
@@ -111,14 +111,20 @@
 (defn stop-master!
   [node]
   (info node "Stopping mesos master")
-  (meh (c/exec :killall :-9 :mesos-master))
-  (meh (c/exec :rm :-rf master-pidfile)))
+  (meh (cu/grepkill! :mesos-master))
+  (meh (c/exec :rm :-rf master-pidfile))
+  (meh (c/exec :rm :-rf
+               (c/lit (str log-dir "/*"))
+               (c/lit (str master-dir "/*")))))

 (defn stop-slave!
   [node]
   (info node "Stopping mesos slave")
-  (meh (c/exec :killall :-9 :mesos-slave))
-  (meh (c/exec :rm :-rf slave-pidfile)))
+  (meh (cu/grepkill! :mesos-slave))
+  (meh (c/exec :rm :-rf slave-pidfile))
+  (meh (c/exec :rm :-rf
+               (c/lit (str log-dir "/*"))
+               (c/lit (str slave-dir "/*")))))

 ;;; Marathon functions


Add skipping and scaling

Add skipping and scaling

--- maps/src/maps/core.cljs
+++ maps/src/maps/core.cljs
@@ -18,6 +18,10 @@
 (defonce height (reagent/atom 600))

 (defonce pause (reagent/atom 1100))
+
+(defonce skip (reagent/atom 0))
+
+(defonce scale (reagent/atom 1))

 (def options
   {:chart       {:type "line"}
@@ -52,7 +56,8 @@
       (assoc-in [:xAxis :max] @x-max)
       (assoc-in [:yAxis :min] @y-min)
       (assoc-in [:yAxis :max] @y-max)
-      (assoc-in [:series 0 :data] @points)))
+      (assoc-in [:series 0 :data]
+                (take-nth (int @scale) (drop (int @skip) @points)))))

 (defn chart-render [wd ht ps]
   @ps
@@ -100,8 +105,8 @@
              :on-change #(reset! upper-v (-> % .-target .-value))}]
     @upper-v]])

-(defn logistic-map [x]
-  (* 3.9341 x (- 1 x)))
+(defn logistic-map [n]
+  (* 3.9341 n (- 1 n)))

 (defn evolution! [seed ps interval]
   (letfn [(evol [x y]
@@ -127,6 +132,12 @@
    [:div
     [:label {:for "pause"} "pause"]
     [slider "pause" pause 200 2000]]
+   [:div
+    [:label {:for "skip"} "skip"]
+    [slider "skip" skip 0 1000]]
+   [:div
+    [:label {:for "scale"} "scale"]
+    [slider "scale" scale 1 10]]
    [chart width height points]])

 (reagent/render-component [page]


Improved grouped selection.

Improved grouped selection.

--- frontend/uxbox/ui/workspace/canvas.cljs
+++ frontend/uxbox/ui/workspace/canvas.cljs
@@ -49,74 +49,93 @@
    :fill "lavender"
    :stroke "gray"})

-(defn- shape-render
+(defn shape-render
   [own {:keys [id x y width height] :as shape}]
-  (let [local (:rum/local own)
-        selected (rum/react wb/selected-state)]
-    (html
-     [:g {
-          :on-mouse-down
-          (fn [event]
-            (dom/stop-propagation event)
-            (swap! local assoc :init-coords [x y])
-            (reset! wb/shapes-dragging? true))
+  (let [selected (rum/react wb/selected-state)
+        selected? (contains? selected id)]
+    (letfn [(on-mouse-down [event]
+              (let [local (:rum/local own)]
+                (dom/stop-propagation event)
+                (swap! local assoc :init-coords [x y])
+                (reset! wb/shapes-dragging? true))
+              (cond
+                (and (not selected?)
+                     (empty? selected))
+                (rs/emit! (dw/select-shape id))

-          :on-click
-          (fn [event]
-            (when (= (:init-coords @local) [x y])
-              (if (.-ctrlKey event)
-                (rs/emit! (dw/select-shape id))
-                (rs/emit! (dw/deselect-all)
-                          (dw/select-shape id)))))
+                (and (not selected?)
+                     (not (empty? selected)))
+                (if (.-ctrlKey event)
+                  (rs/emit! (dw/select-shape id))
+                  (rs/emit! (dw/deselect-all)
+                            (dw/select-shape id)))))
+            (on-mouse-up [event]
+              (dom/stop-propagation event)
+              (reset! wb/shapes-dragging? false))]
+      (html
+       [:g {:on-mouse-down on-mouse-down
+            :on-mouse-up on-mouse-up}
+        (shapes/render shape)
+        (if selected?
+          [:g {:class "controls"}
+           [:rect {:x x :y y :width width :height height
+                   :style {:stroke "black" :fill "transparent"
+                         :stroke-opacity "0.5"}}]
+           [:circle (merge default-selection-props
+                           {:cx x :cy y})]
+           [:circle (merge default-selection-props
+                           {:cx (+ x width) :cy y})]
+           [:circle (merge default-selection-props
+                           {:cx x :cy (+ y height)})]
+           [:circle (merge default-selection-props
+                           {:cx (+ x width) :cy (+ y height)})]])]))))

-          :on-mouse-up
-          (fn [event]
-            (dom/stop-propagation event)
-            (reset! wb/shapes-dragging? false))
-          }
-      (shapes/render shape)
-      (if (contains? selected id)
+(def shape
+  (util/component
+   {:render shape-render
+    :name "shape"
+    :mixins [mx/static rum/reactive (mx/local {})]}))
+
+(defn- selected-shapes-render
+  [own shapes]
+  (let [selected (rum/react wb/selected-state)
+        local (:rum/local own)
+        x (apply min (map :x shapes))
+        y (apply min (map :y shapes))
+        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
+        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
+        width (- x' x)
+        height (- y' y)]
+    (letfn [(on-mouse-down [event]
+              (dom/stop-propagation event)
+              (swap! local assoc :init-coords [x y])
+              (reset! wb/shapes-dragging? true))
+            (on-mouse-up [event]
+              (dom/stop-propagation event)
+              (reset! wb/shapes-dragging? false))]
+      (html
+       [:g.selected
+        {:on-mouse-down on-mouse-down
+         :on-mouse-up on-mouse-up}
+        (for [item shapes]
+          (shapes/render item))
         [:g {:class "controls"}
          [:rect {:x x :y y :width width :height height
                  :style {:stroke "black" :fill "transparent"
                          :stroke-opacity "0.5"}}]
          [:circle (merge default-selection-props
-                         {:cx x :cy y})]
+                       {:cx x :cy y})]
          [:circle (merge default-selection-props
                          {:cx (+ x width) :cy y})]
          [:circle (merge default-selection-props
                          {:cx x :cy (+ y height)})]
          [:circle (merge default-selection-props
-                         {:cx (+ x width) :cy (+ y height)})]])])))
+                         {:cx (+ x width) :cy (+ y height)})]]]))))

-
-;; (defn- shape-render
-;;   [own shape]
-;;   (let [local (:rum/local own)
-;;         x 30
-;;         y 30
-;;         width 100
-;;         height 100]
-;;     (html
-;;      [:g
-;;       (shapes/render shape {:x x :y y :width width :height height})
-;;       [:g {:class "controls"}
-;;        [:rect {:x x :y y :width width :height height
-;;                :style {:stroke "black" :fill "transparent"
-;;                        :stroke-opacity "0.5"}}]
-;;        [:circle (merge default-selection-props
-;;                        {:cx x :cy y})]
-;;        [:circle (merge default-selection-props
-;;                        {:cx (+ x width) :cy y})]
-;;        [:circle (merge default-selection-props
-;;                        {:cx x :cy (+ y height)})]
-;;        [:circle (merge default-selection-props
-;;                        {:cx (+ x width) :cy (+ y height)})]]])))
-
-(def shape
+(def selected-shapes
   (util/component
-   {:render shape-render
-    :name "shape"
+   {:render selected-shapes-render
+    :name "selected-shapes"
     :mixins [mx/static rum/reactive (mx/local {})]}))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -151,10 +170,14 @@
         [:svg.page-layout {}
          (for [item nonselected]
            (rum/with-key (shape item) (str (:id item))))
-         (if (seq selected)
-           [:g.selected
-            (for [item selected]
-              (rum/with-key (shape item) (str (:id item))))])]]))))
+
+
+         (cond
+           (= (count selected) 1)
+           (shape (first selected))
+
+           (> (count selected) 1)
+           (selected-shapes selected))]]))))

 (def canvas
   (util/component


Add deprecated metadata to ring.util.test

--- ring-core/src/ring/util/test.clj
+++ ring-core/src/ring/util/test.clj
@@ -2,6 +2,7 @@
   "Utilities for testing Ring components.

   All functions in this namespace are currently deprecated."
+  {:deprecated "1.1"}
   (:require [ring.util.io :as io]))

 (def ^{:doc "Returns a ByteArrayInputStream for the given String.


innerHTML setter

innerHTML setter

--- src/cljs/infinitelives/utils/dom.cljs
+++ src/cljs/infinitelives/utils/dom.cljs
@@ -72,3 +72,9 @@
     (set! (.-textContent elem) text)
     (set! (.-innerText elem) text))
   elem)
+
+(defn set-html!
+  "Set the innerHTML of `elem` to `html`"
+  [elem html]
+  (set! (.-innerHTML elem) html)
+  elem)


Fixed #80, was still converting the :root_id to a screen on a check

--- src/cljs/memento/handlers/memory.cljs
+++ src/cljs/memento/handlers/memory.cljs
@@ -13,7 +13,7 @@
 (defn thread-in-cache?
   "Receives an application state and a thread-id, and returns true if the
   application cache currently contains that thread."
-  [app-state thread-id]
+  [app-state ^UUID thread-id]
   (contains? (get-in app-state [:cache :threads]) thread-id))

@@ -167,7 +167,7 @@
   :memory-save-success
   (fn [app-state [_ result msg]]
     (dispatch [:state-message (str "Saved: " msg) "alert-success"])
-    (let [thread-id (str (:root_id result))]
+    (let [thread-id (:root_id result)]
       (when (thread-in-cache? app-state thread-id)
         (dispatch [:thread-load thread-id])))
     (-> app-state


Fix docstrings style on sign.proto ns.

Fix docstrings style on sign.proto ns.

--- src/clojure/buddy/core/sign/proto.clj
+++ src/clojure/buddy/core/sign/proto.clj
@@ -17,6 +17,6 @@

 (defprotocol Signature
   "Default inteterface for all signature
-algorithms supported by `buddy`."
+  algorithms supported by `buddy`."
   (make-signature [input key alg] "Make signature.")
   (verify-signature [input signature key alg] "Verify signature."))


Little adjustment

Little adjustment

--- src/clojure_rest/dao/document_dao.clj
+++ src/clojure_rest/dao/document_dao.clj
@@ -1,7 +1,6 @@
 (ns clojure-rest.dao.document-dao
   (:use [korma.core :only [select insert values delete where set-fields]])
-  (:require [clojure.java.jdbc :as jdbc]
-            [clojure.tools.logging :as log]
+  (:require [clojure.tools.logging :as log]
             [clojure-rest.model.document :as document-model]))

 (defn get-all-documents


fix typo

fix typo

--- src/graphql_clj/type.clj
+++ src/graphql_clj/type.clj
@@ -37,7 +37,7 @@
   "Create schema definition from parsed & transformed type system definition."
   ([parsed-schema introspection-schema]
    (assert (not (insta/failure? parsed-schema)) (format "Schema is invalid (%s)." parsed-schema))
-   (assert (not (insta/failure? introspection-schema)) (format "Introspection Schema is invalid (%s)." parsed-schema))
+   (assert (not (insta/failure? introspection-schema)) (format "Introspection Schema is invalid (%s)." introspection-schema))
    (let [definitions (concat (:type-system-definitions parsed-schema)
                              (:type-system-definitions introspection-schema))
          grouped (into {} (group-by :node-type definitions))


Whitespace

Whitespace

--- src/hodgepodge/core.cljs
+++ src/hodgepodge/core.cljs
@@ -1,6 +1,5 @@
 (ns hodgepodge.core
   (:require [cljs.reader :as reader]))
-

 ;; Crude storage API


Remove unnecessary function

Remove unnecessary function

--- minicraft/desktop/src-common/minicraft/utils.clj
+++ minicraft/desktop/src-common/minicraft/utils.clj
@@ -73,9 +73,6 @@
          :right (> (game :x) (* (game :width) (/ 2 3)))
          false)))

-(defn ^:private move-npc
-  [entities entity])
-
 (defn ^:private get-player-velocity
   [{:keys [x-velocity y-velocity]}]
   [(cond


flex shrink for wallet value

flex shrink for wallet value

--- src/status_im/ui/screens/wallet/components/styles.cljs
+++ src/status_im/ui/screens/wallet/components/styles.cljs
@@ -107,6 +107,7 @@

 (def wallet-value
   {:padding-left   6
+   :flex-shrink    1
    :color          styles/color-white-transparent-5
    :font-size      15
    :letter-spacing -0.2})


Only include name once

Only include name once

(it's not so nice we need to say it twice)

--- src/vip/data_processor/db/translations/v5_1/states.clj
+++ src/vip/data_processor/db/translations/v5_1/states.clj
@@ -19,7 +19,6 @@
              [(util/simple-value->ltree :election_administration_id)
               util/external-identifiers->ltree
               (util/simple-value->ltree :name)
-              (util/simple-value->ltree :name)
               (util/simple-value->ltree :polling_location_ids)])
      {:path id-path
       :simple_path (util/path->simple-path id-path)


Don't attempt to track changes to namespaces when AOT compiling

--- src/main/clojure/cascade/path_map.clj
+++ src/main/clojure/cascade/path_map.clj
@@ -46,15 +46,17 @@
         (require :reload (ns-name n))))))

 (defn add-tracked-namespace
-  "Adds a namespace to those that are tracked for reload on change (if not already tracked)."
+  "Adds a namespace to those that are tracked for reload on change (if not already tracked). Returns nil."
   [n]
-  (swap! tracked-namespaces
-    (fn [tracked]
-      (if-not (contains? tracked n)
-        (do
-          (start-tracking n)
-          (conj tracked n))
-        tracked))))
+  (if-not *compile-files*
+    (swap! tracked-namespaces
+      (fn [tracked]
+        (if-not (contains? tracked n)
+          (do
+            (start-tracking n)
+            (conj tracked n))
+          tracked))))
+   nil)

 (defn add-function-to-config
   [selector path function]


Accept all seqable types in place of variable parameter lists

--- clstreams/src/clstreams/kstreams/impl.clj
+++ clstreams/src/clstreams/kstreams/impl.clj
@@ -88,7 +88,7 @@

 (defn dispatch-value-from-param [param-type-sym]
   (cond
-    (clojure.string/ends-with? (str param-type-sym) "<>") 'clojure.lang.ISeq
+    (clojure.string/ends-with? (str param-type-sym) "<>") 'clojure.lang.Seqable
     (contains? function-type-param-wrappers param-type-sym) 'clojure.lang.IFn
     :else param-type-sym))

@@ -96,6 +96,14 @@
   [class-name-sym {:keys [parameter-types return-type]}]
   (vec (cons class-name-sym
              (map dispatch-value-from-param parameter-types))))
+
+(defn param-wrapper-for-type
+  [param-type-sym]
+  (let [type-name (str 'String<>)]
+    (if (clojure.string/ends-with? (str param-type-sym) "<>")
+      (let [elem-type-sym (symbol (subs type-name 0 (- (count type-name) 2)))]
+        (fn [seq-expr] `(into-array ~elem-type-sym ~seq-expr)))
+      (get function-type-param-wrappers param-type-sym identity))))

 (def kstreams-mm-data
   (reduce (partial add-class-to-multimethods-data dispatch-value-from-params)
@@ -106,4 +114,4 @@
            org.apache.kafka.streams.kstream.KGroupedTable]))

 (def kstream-multimethod-defs (exprs-from-multimethods-data kstreams-mm-data
-                                                            #(get function-type-param-wrappers % identity)))
+                                                            param-wrapper-for-type))


Include all SQL exceptions in error string, not only the first

--- src/pdok/featured_to_extracts/api.clj
+++ src/pdok/featured_to_extracts/api.clj
@@ -105,7 +105,10 @@
             (swap! stats assoc-in [:processing worker-id] nil)
             (stats-on-callback callback-chan request run-stats)))
         (catch Exception e
-          (let [error-stats (merge request {:status "error" :msg (str e)})]
+          (let [error-str (if (instance? Iterable e)
+                            (clojure.string/join " Next: " (map str (seq e)))
+                            (str e))
+                error-stats (merge request {:status "error" :msg error-str})]
             (log/warn e error-stats)
             (swap! stats assoc-in [:processing worker-id] nil)
             (stats-on-callback callback-chan request error-stats)))


only include comments from report_comment_selections where selection > 0

--- src/polismath/components/postgres.clj
+++ src/polismath/components/postgres.clj
@@ -277,7 +277,9 @@
   [rid]
   {:select [:tid]
    :from [:report_comment_selections]
-   :where [:= :rid rid]})
+   :where [:and
+           [:= :rid rid]
+           [:> :selection 0]]})

 (defn query-zid-from-rid [component rid]
   (query component (zid-from-rid rid)))


use set-html! so pages can transition correctly

--- pedestal-app/app/src/semtag_web/rendering.cljs
+++ pedestal-app/app/src/semtag_web/rendering.cljs
@@ -29,7 +29,7 @@
 (defn render-home-page [renderer [_ path] transmitter]
   (let [html (templates/add-template renderer path (:semtag-web-page templates))]
     ;; didn't use get-parent-id cause it doesn't work for new multi-level paths
-    (dom/append! (dom/by-id "content") (html {}))))
+    (dom/set-html! (dom/by-id "content") (html {}))))

 (defn render-page [renderer [_ _ _ value :as delta] input-queue]
   (case value
@@ -55,7 +55,7 @@
                         :caption (format "Total: %s" (count (map :url things)))))))

 (defn render-types-results [_ [_ _ _ new-value] _]
-  (dom/append!
+  (dom/set-html!
     (dom/by-id "content")
     (p/generate-table "type_stats_table" (:results new-value)
                       :caption (format "%s things, %s tags"


cleanup in channel wiring

cleanup in channel wiring

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/core.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/core.cljs
@@ -20,10 +20,7 @@
 ;;;; Main file of the BirdWatch client-side application.

 ;;; Channels for handling information flow in the application.
-(def state-in-chan (chan)) ; Data from server, e.g. new tweets and previous chunks.
-(def qry-chan (chan)) ; Queries that will be forwarded to the server.
 (def state-pub-chan (chan (sliding-buffer 1))) ; Publication of state changes.
-(def state-pub (pub state-pub-chan first)) ; Pub for subscribing to

 (def ts-comp (toolbox/single-in-single-out ts-c/init-component
                                            {:in-chan [:sliding 1]
@@ -31,7 +28,7 @@
                                             :in-timeout 1000}))

 (def state-comp (toolbox/make-component c/make-state c/handle-incoming nil))
-
+(def state-pub (pub (:sliding-out-chan state-comp) first)) ; Pub for subscribing to

 (def wc-c-comp (toolbox/single-in-single-out (partial wc-c/init-component 25)
                                              {:in-chan [:sliding 1]
@@ -43,29 +40,24 @@
                                               :out-chan [:buffer 1]
                                               :in-timeout 5000}))

-(sub state-pub :app-state (:in-chan wc-c-comp))
-(pipe (:out-chan wc-c-comp) state-in-chan)
-
-(sub state-pub :app-state (:in-chan ts-comp))
-(pipe (:out-chan ts-comp) state-in-chan)
-
-(sub state-pub :app-state (:in-chan wc-comp))
-(pipe (:out-chan wc-comp) state-in-chan)
-
-(pipe state-in-chan (:in-chan state-comp))
-(pipe (:out-chan state-comp) qry-chan)
-(pipe (:sliding-out-chan state-comp) state-pub-chan)
+(def tweets-comp (toolbox/single-in-single-out tw/init-component))

 ;;; Initialization of WebSocket communication.
 (def ws-comp (toolbox-ws/component))
-(pipe (:out-chan ws-comp) state-in-chan)
-(pipe qry-chan (:in-chan ws-comp))

-(def tweets-comp (toolbox/single-in-single-out tw/init-component))
+(sub state-pub :app-state (:in-chan wc-c-comp))
+(sub state-pub :app-state (:in-chan ts-comp))
+(sub state-pub :app-state (:in-chan wc-comp))
 (sub state-pub :app-state (:in-chan tweets-comp))
-(pipe (:out-chan tweets-comp) state-in-chan)

-(toolbox-r/init-components state-pub state-in-chan
+(pipe (:out-chan wc-c-comp) (:in-chan state-comp))
+(pipe (:out-chan ts-comp) (:in-chan state-comp))
+(pipe (:out-chan wc-comp) (:in-chan state-comp))
+(pipe (:out-chan state-comp) (:in-chan ws-comp))
+(pipe (:out-chan ws-comp) (:in-chan state-comp))
+(pipe (:out-chan tweets-comp) (:in-chan state-comp))
+
+(toolbox-r/init-components state-pub (:in-chan state-comp)
                            [[cv/count-view "tweet-count"] [cv/users-count-view "users-count"]
                             [cv/total-count-view "total-tweet-count"] [sv/search-view "search"]
                             [pag/pagination-view "pagination"] [st/sort-view "sort-buttons"]])


cleanup

cleanup

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/util.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/util.cljs
@@ -1,9 +1,6 @@
 (ns birdwatch.util
   (:require-macros [cljs.core.async.macros :refer [go-loop]])
-  (:require [clojure.string :as s]
-            [birdwatch.state :as state]
-            [tailrecursion.priority-map :refer [priority-map-by]]
-            [cljs.core.async :as async :refer [timeout]]))
+  (:require [cljs.core.async :as async :refer [timeout]]))

 (defn by-id [id] (.getElementById js/document id))
 (defn elem-width [elem] (aget elem "offsetWidth"))


Adds insertL

Adds insertL

--- src/the_little_clojurian/chapter3.clj
+++ src/the_little_clojurian/chapter3.clj
@@ -62,3 +62,15 @@
          '(tacos tamales and jalapeno salsa)))
   (is (= (insertR 'e 'd '(a b c d f g d h))
          '(a b c d e f g d h))))
+
+(with-test
+  (def insertL
+    (fn [new old lat]
+      (cond (null? lat) '()
+            (eq? (car lat) old) (conss new (conss old (cdr lat)))
+            :else (cons (car lat) (insertL new old (cdr lat))))))
+
+  (is (= (insertL 'topping 'fudge '())
+         '()))
+  (is (= (insertL 'topping 'fudge '(ice cream with fudge for dessert))
+         '(ice cream with topping fudge for dessert))))


fix the route names

fix the route names

--- frontend/routes.cljs
+++ frontend/routes.cljs
@@ -83,18 +83,18 @@
   (defroute v1-about "/about" []
     (open-to-outer! nav-ch :about {}))

-  (defroute v1-about "/pricing" []
+  (defroute v1-pricing "/pricing" []
     (if authenticated?
       (open-to-inner! nav-ch :account {:subpage "plans"})
       (open-to-outer! nav-ch :pricing {})))

-  (defroute v1-about "/jobs" []
+  (defroute v1-jobs "/jobs" []
     (open-to-outer! nav-ch :jobs {}))

   (defroute v1-privacy "/privacy" []
     (open-to-outer! nav-ch :privacy {}))

-  (defroute v1-privacy "/security" []
+  (defroute v1-security "/security" []
     (open-to-outer! nav-ch :security {}))

   (defroute v1-root "/" {:as params}


testing

testing

--- src/jjamppong/window.clj
+++ src/jjamppong/window.clj
@@ -34,9 +34,10 @@
    [javafx.collections FXCollections ListChangeListener]))

-(def filter-atom
+(def config-atom
   (atom
    {:tags #{"V" "D" "I" "W" "E" "F"}
+    :auto-scroll true
     :filter-text ""
     :filter-is-ignorecase false
     :filter-is-regex false
@@ -134,19 +135,21 @@

 (defn auto-scroll [table]
   ;; TODO(kep): is too laggy scrollTo. need to refactoring.
+  ;; TODO(kep): disable auto-scroll
   (.. table
       (getItems)
       (addListener
        (reify ListChangeListener
          (onChanged [this change]
            (.next change)
-           (let [s (.. table getItems size)]
-             (when (pos? s)
-               (javafx.application.Platform/runLater
-                #(do
-                   (let [itm (first (.getAddedSubList change))]
-                     (when (instance? Log itm)
-                       (.scrollTo table itm))))))))))))
+           (when (:auto-scroll @config-atom)
+             (let [s (.. table getItems size)]
+               (when (pos? s)
+                 (javafx.application.Platform/runLater
+                  #(do
+                     (let [itm (first (.getAddedSubList change))]
+                       (when (instance? Log itm)
+                         (.scrollTo table itm)))))))))))))

 (defn ^java.util.function.Predicate f-to-predicate [f]
@@ -331,7 +334,7 @@
      (f-to-predicate
       (fn [p]
         (let [{:keys [level message]} p
-              {:keys [tags filter-text filter-is-regex filter-is-ignorecase]} @filter-atom]
+              {:keys [tags filter-text filter-is-regex filter-is-ignorecase]} @config-atom]
           (if-not (get tags level)
             false
             (if filter-is-regex
@@ -390,25 +393,25 @@
         })
      (let [tag (get check-dic event-source)]
        (if (.isSelected event-source)
-         (swap! filter-atom update-in [:tags] conj tag)
-         (swap! filter-atom update-in [:tags] disj tag))))
+         (swap! config-atom update-in [:tags] conj tag)
+         (swap! config-atom update-in [:tags] disj tag))))
    (impl/update-predicate this filtered))

   (^{:tag void}
    on_txt_filter_changed [this ^javafx.scene.input.KeyEvent event]
-   (swap! filter-atom assoc :filter-text  (.getText (.getSource event)))
+   (swap! config-atom assoc :filter-text  (.getText (.getSource event)))
    (impl/update-predicate this filtered))

   (^{:tag void}
    on_check_ignorecase [this ^javafx.event.ActionEvent event]
    (let [event-source (.getSource event)]
-     (swap! filter-atom assoc :filter-is-ignorecase (.isSelected event-source)))
+     (swap! config-atom assoc :filter-is-ignorecase (.isSelected event-source)))
    (impl/update-predicate this filtered))

   (^{:tag void}
    on_check_regex [this ^javafx.event.ActionEvent event]
    (let [event-source (.getSource event)]
-     (swap! filter-atom assoc :filter-is-regex (.isSelected event-source)))
+     (swap! config-atom assoc :filter-is-regex (.isSelected event-source)))
    (impl/update-predicate this filtered))
 )


search-type works, repl ftw

search-type works, repl ftw

--- pedestal-app/app/src/semtag_web/rendering.cljs
+++ pedestal-app/app/src/semtag_web/rendering.cljs
@@ -1,5 +1,6 @@
 (ns semtag-web.rendering
   (:require [domina :as dom]
+            [domina.css :as css]
             [semtag-web.rendering-util :as util]
             [semtag-web.partials :as p]
             [clojure.string]
@@ -49,7 +50,7 @@

 (defn url-search [{:keys [transform messages]}]
   (msg/fill transform messages {:query (.-value (dom/by-id "url_search_text"))
-                                :search-type "regex"}))
+                                :search-type (dom/value (css/sel "input[name=search_type]:checked"))}))

 (defn render-config []
   (reduce


Search returns JSON array of ragams and no markup.

--- src/kosha/app/search.clj
+++ src/kosha/app/search.clj
@@ -1,41 +1,15 @@
 (ns kosha.app.search
-  (:require [kosha.app.view :as view]
-            [kosha.db.search :as db-search]
-            [kosha.app.util :as util]
-            [clojure.string :as s]))
+  (:require [kosha.db.search :as db-search]
+            [kosha.app.util :as util]))

-(defn external-links [{:keys [k-ragams s-ragams]}
-                      {:keys [raga-link melakartha mela-number]}]
-  [:section.inline
-   (if-not (s/blank? raga-link)
-     [:span.external-link [:a {:href (str "https://en.wikipedia.org" raga-link) :target "blank"} "Wiki"]])

-   (if-let [kragam (first k-ragams)]
-     (let [link (format "http://www.karnatik.com/ragas%s.shtml#%s" (first kragam) kragam)]
-       [:span.external-link [:a {:href link :target "blank"} "Karnatik"]]))
+(defn get-ragam
+  "Retrieves 10 best matches for given ragam name."
+  [{:keys [params] :as request}]
+  (let [ragams (db-search/ragams (:q params) 10)]
+    (util/json-response ragams)))

-   (if-let [sragam (first s-ragams)]
-     (let [link "http://www.sangeethapriya.org/fetch_tracks.php?ragam"]
-       [:form.inline.external-link {:action link :method "POST" :target "blank"}
-        [:input {:type :hidden :name "FIELD_TYPE" :value sragam}]
-        [:input {:type :submit :name "Sangeethapriya" :value "Sangeethapriya"}]]))])
-
-(defn mela-data [{:keys [melakartha mela-number] :as metadata}]
-  (if melakartha
-    (format "This is mela %s" mela-number)
-    (format "Janya of %s" mela-number)))
-
-(defn ragam [{:keys [params] :as request}]
-  (let [ragams (db-search/ragams-with-scales (:q params) 10)]
-    {:status 200
-     :body (view/html-skeleton
-            [:table
-             [:thead [:th "Ragam"] [:th "Arohanam"] [:th "Avarohanam"] [:th "Mela"] [:th "Links"]]
-             [:tbody
-              (for [{:keys [ragam-name arohanam avarohanam metadata] :as ragam} ragams]
-                [:tr
-                 [:td (util/unaccent ragam-name)]
-                 [:td arohanam]
-                 [:td avarohanam]
-                 [:td (mela-data metadata)]
-                 [:td (external-links ragam metadata)]])]])}))
+(defn handler [{:keys [params] :as request}]
+  (let [type (get-in request [:params :t])]
+    (case type
+      "ragam" (get-ragam request))))


Rearrange cues more sensibly.

Rearrange cues more sensibly.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -939,34 +939,34 @@
                    (cues/function-cue :h2o-led :on (show/fixtures-named :h2o-led) :effect-name "H2O LED"))

     ;; Control the Hypnotic RGB Laser
-    (show/set-cue! (+ x-base 0) (+ y-base 3)
+    (show/set-cue! (+ x-base 0) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-red (show/fixtures-named "hyp-rgb")
                                       :color :red :effect-name "Hypnotic Red"))
-    (show/set-cue! (+ x-base 1) (+ y-base 3)
+    (show/set-cue! (+ x-base 1) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-green (show/fixtures-named "hyp-rgb")
                                       :color :green :effect-name "Hypnotic Green"))
-    (show/set-cue! (+ x-base 2) (+ y-base 3)
+    (show/set-cue! (+ x-base 2) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-blue (show/fixtures-named "hyp-rgb")
                                       :color :blue :effect-name "Hypnotic Blue"))
-    (show/set-cue! (+ x-base 3) (+ y-base 3)
+    (show/set-cue! (+ x-base 3) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-red-green (show/fixtures-named "hyp-rgb")
                                       :color :yellow :effect-name "Hypnotic Red Green"))
-    (show/set-cue! (+ x-base 4) (+ y-base 3)
+    (show/set-cue! (+ x-base 4) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-red-blue (show/fixtures-named "hyp-rgb")
                                       :color :purple :effect-name "Hypnotic Red Blue"))
-    (show/set-cue! (+ x-base 5) (+ y-base 3)
+    (show/set-cue! (+ x-base 5) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-green-blue (show/fixtures-named "hyp-rgb")
                                       :color :cyan :effect-name "Hypnotic Green Blue"))
-    (show/set-cue! (+ x-base 6) (+ y-base 3)
+    (show/set-cue! (+ x-base 6) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-red-green-blue (show/fixtures-named "hyp-rgb")
                                       :color :white :effect-name "Hypnotic Red Green Blue"))
-    (show/set-cue! (+ x-base 7) (+ y-base 3)
+    (show/set-cue! (+ x-base 7) (+ y-base 2)
                    (cues/function-cue :hypnotic-beam :beam-all-random (show/fixtures-named "hyp-rgb")
                                       :color :white :effect-name "Hypnotic Random"))
-    (show/set-cue! (+ x-base 6) (+ y-base 4)
+    (show/set-cue! (+ x-base 6) (+ y-base 3)
                    (cues/function-cue :hypnotic-spin :beams-ccw (show/fixtures-named "hyp-rgb")
                                       :color :cyan :effect-name "Hypnotic Rotate CCW" :level 50))
-    (show/set-cue! (+ x-base 7) (+ y-base 4)
+    (show/set-cue! (+ x-base 7) (+ y-base 3)
                    (cues/function-cue :hypnotic-spin :beams-cw (show/fixtures-named "hyp-rgb")
                                       :color :cyan :effect-name "Hypnotic Rotate Clockwise" :level 50))

@@ -982,7 +982,15 @@
                                       :color :orange :effect-name "Puck Sound"))
     (show/set-cue! (+ x-base 6) (+ y-base 7)
                    (cues/function-cue :snowball-sound :sound-active (show/fixtures-named "snowball")
-                                      :color :orange :effect-name "Snowball Sound"))))
+                                      :color :orange :effect-name "Snowball Sound" :end-keys [:snowball-pos]))
+
+    ;; A couple other snowball cues
+    (show/set-cue! (+ x-base 6) (+ y-base 6)
+                   (cues/function-cue :snowball-pos :beams-moving (show/fixtures-named "snowball")
+                                      :effect-name "Snowball Moving" :color :yellow :end-keys [:snowball-sound]))
+    (show/set-cue! (+ x-base 6) (+ y-base 5)
+                   (cues/function-cue :snowball-pos :beams-fixed (show/fixtures-named "snowball")
+                                      :effect-name "Snowball Fixed" :end-keys [:snowball-sound]))))

 (defn- aim-cue-var-key
   "Determine the cue variable key value to use for a variable being
@@ -1126,35 +1134,6 @@
                    (cues/cue :movement (fn [var-map]
                                          (move/pan-tilt-effect "P/T Can Can" can-can-p-t (show/all-fixtures))))))

-  ;; A couple snowball cues
-  (show/set-cue! 0 10 (cues/function-cue :sb-pos :beams-fixed (show/fixtures-named "snowball")
-                                         :effect-name "Snowball Fixed"))
-  (show/set-cue! 1 10 (cues/function-cue :sb-pos :beams-moving (show/fixtures-named "snowball")
-                                         :effect-name "Snowball Moving"))
-
-  (show/set-cue! 0 8
-                 (cues/cue :movement (fn [var-map]
-                                       (move/direction-effect
-                                        "Pan/Tilt"
-                                        (cues/apply-merging-var-map var-map
-                                                                    params/build-direction-param-from-pan-tilt
-                                                                    :degrees true)
-                                        (show/all-fixtures)))
-                           :variables [{:key "pan" :name "Pan"
-                                        :min -180.0 :max 180.0 :start 0.0 :centered true :resolution 0.5}
-                                       {:key "tilt" :name "Tilt"
-                                        :min -180.0 :max 180.0 :start 0.0 :centered true :resolution 0.5}]))
-  (show/set-cue! 1 8 (cues/cue :movement (fn [var-map]
-                                           (move/aim-effect
-                                            "Aim"
-                                            (cues/apply-merging-var-map var-map params/build-aim-param)
-                                            (show/all-fixtures)))
-                               :variables [{:key "x" :name "X"
-                                            :min -20.0 :max 20.0 :start 0.0 :centered true :resolution 0.05}
-                                           {:key "z" :name "Z"
-                                            :min -20.0 :max 20.0 :start 0.0 :centered true :resolution 0.05}
-                                           {:key "y" :name "Y"
-                                            :min 0.0 :max 20.0 :start 0.0 :centered false :resolution 0.05}]))
   #_(show/set-cue! 3 8 (cues/function-cue :blade-speed :movement-speed (show/fixtures-named "blade")
                                         :color :purple :effect-name "Slow Blades"))


Rename log file

Rename log file

--- src/afterglow/max/init.clj
+++ src/afterglow/max/init.clj
@@ -22,7 +22,6 @@
   "Makes sure the logs directory exists, and returns its path."
   []
   (let [pkg-dir (.getParentFile @init-dir)
-        log-dir (clojure.java.io/file pkg-dir "logs")
-        log-file (clojure.java.io/file log-dir "afterglow.log")]
+        log-file (clojure.java.io/file pkg-dir "logs" "afterglow.max.log")]
     (clojure.java.io/make-parents log-file)
     (.getAbsolutePath log-file)))


updated om to support no transform map

updated om to support no transform map

--- src/kioo/om.clj
+++ src/kioo/om.clj
@@ -40,14 +40,14 @@
   (component* path body om-emit-opts))

-(defmacro snippet [path sel args trans]
-  (snippet* path (list sel trans) args om-emit-opts))
+(defmacro snippet [path sel args & trans]
+  (snippet* path (cons sel trans) args om-emit-opts))

-(defmacro template [path args trans]
-  (snippet* path (list trans) args om-emit-opts))
+(defmacro template [path args & trans]
+  (snippet* path  trans args om-emit-opts))

-(defmacro defsnippet [sym path sel args trans]
-  `(def ~sym ~(snippet* path (list sel trans) args om-emit-opts)))
+(defmacro defsnippet [sym path sel args & trans]
+  `(def ~sym ~(snippet* path (cons sel trans) args om-emit-opts)))

-(defmacro deftemplate [sym path args trans]
-  `(def ~sym ~(snippet* path (list trans) args om-emit-opts)))
+(defmacro deftemplate [sym path args & trans]
+  `(def ~sym ~(snippet* path trans args om-emit-opts)))


remove unused test

remove unused test

--- test/leiningen/leinsync/deps_test.clj
+++ test/leiningen/leinsync/deps_test.clj
@@ -71,7 +71,4 @@
                  :dep-4 {:deps-project-3 :v-4}
                  :dep-5 {:deps-project-1 :v-6, :deps-project-3 :v-2}}
                 (d/pretty-print-structure (fn [x] (get m x)))
-                (sort-by :name))))))
-
-(deftest ^:unit last-version-of
-  (is (= :unknown (d/last-version-of "not-valid"))))+                (sort-by :name))))))


(PDB-3275) Fix zip-tests with new test.check

The updated version of test.check appears to generate Double/NaN out of gen/any
sometimes, which is problematic because it doesn't equal itself. Replace this
with a slightly customized version which only generates values that equal
themselves.

--- test/puppetlabs/puppetdb/zip_test.clj
+++ test/puppetlabs/puppetdb/zip_test.clj
@@ -54,9 +54,19 @@
       (conj #(gen/map (gen/one-of [gen/keyword gen/string]) %))
       (conj foo-gen)))

+
+(def simple-reflexively-equal
+  (gen/one-of [gen/int gen/large-integer
+               (gen/double* {:NaN? false :infinite? false})
+               gen/char gen/string gen/ratio gen/boolean gen/keyword
+               gen/keyword-ns gen/symbol gen/symbol-ns gen/uuid]))
+
+(def any-reflexively-equal
+  (gen/recursive-gen gen/container-type simple-reflexively-equal))
+
 (cct/defspec no-op-zipper
   50
-  (prop/for-all [v (gen/sized (tree-generator with-maps gen/any))]
+  (prop/for-all [v (gen/sized (tree-generator with-maps any-reflexively-equal))]
                 (= v
                    (:node (post-order-transform (tree-zipper v) [identity])))))


Add transformation merge-datasets spec [skip ci]

--- backend/specs/akvo/lumen/specs/transformation.clj
+++ backend/specs/akvo/lumen/specs/transformation.clj
@@ -201,8 +201,7 @@
 (s/def ::transformation.generate-geopoints/args
   (s/keys :req-un [::transformation.generate-geopoints/columnNameLat
                    ::transformation.generate-geopoints/columnNameLong
-                   ::transformation.generate-geopoints/columnTitleGeo
-                   ::transformation.filter-column/expression]))
+                   ::transformation.generate-geopoints/columnTitleGeo]))

 (defmethod op-spec :core/generate-geopoints  [_]
   (s/keys
@@ -210,6 +209,43 @@
 	    ::transformation.engine/onError
             ::transformation.engine/op]))

+(create-ns  'akvo.lumen.specs.transformation.merge-datasets)
+(alias 'transformation.merge-datasets 'akvo.lumen.specs.transformation.merge-datasets)
+
+(create-ns  'akvo.lumen.specs.transformation.merge-datasets.source)
+(alias 'transformation.merge-datasets.source 'akvo.lumen.specs.transformation.merge-datasets.source)
+
+(create-ns  'akvo.lumen.specs.transformation.merge-datasets.target)
+(alias 'transformation.merge-datasets.target 'akvo.lumen.specs.transformation.merge-datasets.target)
+
+
+
+(s/def ::transformation.merge-datasets.source/datasetId ::db.dsv/dataset-id)
+(s/def ::transformation.merge-datasets.source/aggregationColumn (s/nilable ::db.dsv.column/columnName))
+(s/def ::transformation.merge-datasets.source/aggregationDirection #{"ASC" "DESC"})
+(s/def ::transformation.merge-datasets.source/mergeColumn ::db.dsv.column/columnName)
+(s/def ::transformation.merge-datasets.source/mergeColumns (s/coll-of ::db.dsv.column/columnName :kind vector? :distinct true))
+
+(s/def ::transformation.merge-datasets/source (s/keys
+                                               :req-un [::transformation.merge-datasets.source/datasetId
+                                                        ::transformation.merge-datasets.source/aggregationColumn
+                                                        ::transformation.merge-datasets.source/aggregationDirection
+                                                        ::transformation.merge-datasets.source/mergeColumn
+                                                        ::transformation.merge-datasets.source/mergeColumns]))
+
+(s/def ::transformation.merge-datasets.target/mergeColumn ::db.dsv.column/columnName)
+
+(s/def ::transformation.merge-datasets/target (s/keys :req-un [::transformation.merge-datasets.target/mergeColumn]))
+
+(s/def ::transformation.merge-datasets/args
+  (s/keys :req-un [::transformation.merge-datasets/source
+                   ::transformation.merge-datasets/target]))
+
+(defmethod op-spec :core/merge-datasets  [_]
+  (s/keys
+   :req-un [::transformation.merge-datasets/args
+	    ::transformation.engine/onError
+            ::transformation.engine/op]))

 (lumen.s/sample ::transformation.engine/op-spec 10)


Fixes and improvements

Fixes and improvements

--- src/node/game/cards.cljs
+++ src/node/game/cards.cljs
@@ -90,7 +90,7 @@
               :msg "make the Runner take 1 tag or suffer 2 meat damage"
               :effect (req (if (= target "1 tag")
                              (do (gain state :runner :tag 1) (system-msg state side "takes 1 tag"))
-                             (do (damage state :runner :meat 2)
+                               (do (damage state :runner :meat 2)
                                  (system-msg state side "suffers 2 meat damage"))))}}}

    "Astrolabe"
@@ -742,7 +742,8 @@
    {:effect (effect (gain :memory 1 :max-hand-size 1))
     :leave-play (effect (lose :memory 1 :max-hand-size 1))
     :events {:agenda-scored
-             {:prompt "Choose a card" :msg (msg "add " (:title target) " to HQ from R&D")
+             {:player :runner
+              :prompt "Choose a card" :msg (msg "add " (:title target) " to HQ from R&D")
               :choices (req (:deck runner)) :effect (effect (move target :hand) (shuffle! :deck))}}}

    "Lucky Find"
@@ -1028,7 +1029,8 @@
    {:effect
     (effect (gain :link 1)
             (resolve-ability
-             {:optional {:prompt "Install another Rabbit Hole?" :msg "install another Rabbit Hole"
+             {:optional {:req (req (some #(when (= (:title %) "Rabbit Hole") %) (:deck runner)))
+                         :prompt "Install another Rabbit Hole?" :msg "install another Rabbit Hole"
                          :effect (req (when-let [c (some #(when (= (:title %) "Rabbit Hole") %)
                                                          (:deck runner))]
                                         (runner-install state side c)


Whitespace

Whitespace

--- src/circle/backend/build/run.clj
+++ src/circle/backend/build/run.clj
@@ -65,7 +65,7 @@
       (email/notify-build-results b))
     b
     (catch Exception e
-      (println "run-build: except: " b)
+      (println "run-build: except:" b)
       (error e (format "caught exception on %s" (build/build-name b)))
       (println "assoc'ing failed=true")
       (dosync


updated profiles

updated profiles

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -12,12 +12,16 @@
  :tools
  {:plugins
   [[lein-try "0.4.3"]
-   [lein-binplus "0.4.2"]
+   [lein-binplus "0.6.2"]
    [lein-ancient "0.6.10"]
-   [jonase/eastwood "0.2.3"]
-   [lein-kibit "0.1.3"]
    [lein-shell "0.5.0"]
    [lein-cloverage "1.0.7-SNAPSHOT"]
+   [lein-cljfmt "0.5.6"]
+   [venantius/yagni "0.1.4"]
+   [lein-bikeshed "0.4.1"]
+   [jonase/eastwood "0.2.4"]
+   [lein-kibit "0.1.5"]
+   [lein-checkall "0.1.1"]
    #_[samsara/lein-template "0.1.0-SNAPSHOT"]
    ]
   }}


allowing either true or 1 as leave-open arg to (buffer-save ...)

--- src/overtone/sc/core.clj
+++ src/overtone/sc/core.clj
@@ -548,7 +548,7 @@
         {:keys [header samples n-frames start-frame leave-open]} arg-map]
     (snd "/b_write" (:id buf) path header samples
          n-frames start-frame
-         leave-open)
+         (if leave-open 1 0))
     :done))

 (defmulti buffer-id type)


Implement Bhagat

Implement Bhagat

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -67,6 +67,12 @@
                  :cost [:forfeit]
                  :choices (req (cancellable (filter #(not (is-type? % "Event")) (:deck runner)) :sorted))
                  :effect (effect (runner-install target) (shuffle! :deck))}]}
+
+   "Bhagat"
+   {:events {:successful-run {:req (req (= target :hq))
+                              :msg "force the Corp to trash the top card of R&D"
+                              :effect (effect (mill :corp))
+                              :once :per-turn}}}

    "Bank Job"
    {:data {:counter 8


don't throw exceptions when completion can't load

(say for instance when using drawbridge to connect to an HTTP transport)

--- src/clj/reply/initialization.clj
+++ src/clj/reply/initialization.clj
@@ -120,9 +120,12 @@
     ~(export-definition 'reply.initialization/lazy-clojuredocs)
     (~'intern-with-meta '~'user '~'clojuredocs ~'#'lazy-clojuredocs)

-    (require '[complete.core])
-    ~(export-definition 'reply.initialization/resolve-class)
-    (~'intern-with-meta '~'complete.core '~'resolve-class ~'#'resolve-class)
+    (try
+      (require '[complete.core])
+      ~(export-definition 'reply.initialization/resolve-class)
+      (~'intern-with-meta '~'complete.core '~'resolve-class ~'#'resolve-class)
+      (catch Exception e#
+        (println "Unable to initialize completion.")))

     (in-ns '~'user)


renamed make-config to config

renamed make-config to config

--- src/cljc/ow/starbuck/client.cljc
+++ src/cljc/ow/starbuck/client.cljc
@@ -15,7 +15,7 @@
          ::transition-count 0
          ::max-transitions max-transitions))

-(defn make-config [ruleset components & {:keys [unit]}]
+(defn config [ruleset components & {:keys [unit]}]
   {:unit unit
    :components components
    :ruleset ruleset})


Add an option to lesscompiler. Flailing.

--- src/clojure/staircase/assets.clj
+++ src/clojure/staircase/assets.clj
@@ -10,7 +10,7 @@
         [dieter.asset.livescript   :only (compile-livescript)]
         [dieter.asset.coffeescript :only (compile-coffeescript)]))

-(def less-c (LessCompiler.))
+(def less-c (LessCompiler. ["--relative-urls"]))

 (defn less [f] (.compile less-c f))


[fix] Add event with participants.

[fix] Add event with participants.


Cut commented code.

Cut commented code.


Tweak fallback message

Tweak fallback message

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -132,7 +132,7 @@
              (print-error nproblems value t)
              (newline)
              (hline)))
-         (do (println "\n(Failed to analyze the spec errors, and will fall back to s/explain-printer)\n")
+         (do (println "\n[PINPOINTER] Failed to analyze the spec errors, and will fall back to s/explain-printer\n")
              (s/explain-printer ed))))
      (println "Success!!"))))


fix compile error when source dir is missing

--- src/cake/tasks/compile.clj
+++ src/cake/tasks/compile.clj
@@ -2,7 +2,7 @@
   (:use cake
         [cake.core :only [deftask bake invoke]]
         [uncle.core :only [ant add-fileset fileset-seq]]
-        [cake.file :only [file newer? mkdir]]
+        [cake.file :only [file newer? mkdir file-exists?]]
         [cake.project :only [reset-classloaders! with-classloader classpath]]
         [bake.core :only [verbose? debug? log os-name os-arch]]
         [cake.utils :only [sudo prompt-read]]
@@ -14,18 +14,19 @@
 (defn compile-java [src & [dest]]
   (let [start (System/currentTimeMillis)
         dest  (file (or dest (first (:compile-path *project*))))]
-    (ant Javac (merge {:destdir     dest
-                       :classpath   (classpath)
-                       :srcdir      src
-                       :fork        true
-                       :verbose     (verbose?)
-                       :debug       true
-                       :debug-level "source,lines"
-                       :target      "1.5"
-                       :failonerror true}
-                      (:java-compile *project*)))
-    (when (some #(newer? % start) (file-seq dest))
-      (reset-classloaders!))))
+    (when-let [src (seq (filter file-exists? src))]
+      (ant Javac (merge {:destdir     dest
+                         :classpath   (classpath)
+                         :srcdir      (filter file-exists? src)
+                         :fork        true
+                         :verbose     (verbose?)
+                         :debug       true
+                         :debug-level "source,lines"
+                         :target      "1.5"
+                         :failonerror true}
+                        (:java-compile *project*)))
+      (when (some #(newer? % start) (file-seq dest))
+        (reset-classloaders!)))))

 (deftask compile-java #{compile-native}
   (copy-native)


[#7] Guard against non existing user

[#7] Guard against non existing user

--- api/src/api/datastore/survey.clj
+++ api/src/api/datastore/survey.clj
@@ -61,16 +61,17 @@

 (defn get-survey-definition [email survey-id]
   (let [user-dao (UserDao.)
-        user (.findUserByEmail user-dao email)
-        survey-dao (com.gallatinsystems.survey.dao.SurveyGroupDAO.)
-        survey (.getByKey survey-dao (Long/parseLong survey-id))
-        form-dao (com.gallatinsystems.survey.dao.SurveyDAO.)
-        forms (.filterByUserAuthorizationObjectId form-dao
-                                                  (.listSurveysByGroup form-dao (Long/parseLong survey-id))
-                                                  (ds/id user))]
-    {:id survey-id
-     :name (.getName survey)
-     :forms (mapv #(get-form-definition email (ds/id %))
-                  forms)
-     :created-at (ds/created-at survey)
-     :modified-at (ds/modified-at survey)}))
+        user (.findUserByEmail user-dao email)]
+    (when user
+      (let [survey-dao (com.gallatinsystems.survey.dao.SurveyGroupDAO.)
+            survey (.getByKey survey-dao (Long/parseLong survey-id))
+            form-dao (com.gallatinsystems.survey.dao.SurveyDAO.)
+            forms (.filterByUserAuthorizationObjectId form-dao
+                                                      (.listSurveysByGroup form-dao (Long/parseLong survey-id))
+                                                      (ds/id user))]
+        {:id survey-id
+         :name (.getName survey)
+         :forms (mapv #(get-form-definition email (ds/id %))
+                      forms)
+         :created-at (ds/created-at survey)
+         :modified-at (ds/modified-at survey)}))))


a request fn to assemble a request map that calc uses for convenience; dissoc :meta from the meta results if true

--- src/clj/ephemeris/core.clj
+++ src/clj/ephemeris/core.clj
@@ -36,10 +36,14 @@
       (get hs 0)
       \O)))

+(defn- request [stuff]
+  (let [want (merge defaults stuff)
+        jd (utc-to-jd (:utc want))]
+    (assoc want :jd jd)))
+
 (defn calc [stuff]
-  (let [want (merge defaults stuff)
-        sw (SwissEph.)
-        jd (utc-to-jd (:utc want))
+  (let [sw (SwissEph.)
+        want (request stuff)
         flag (. SweConst SEFLG_SPEED)]
     (merge
       {:bodies
@@ -49,7 +53,7 @@
                   res (double-array 6)
                   err (StringBuffer.)
                   rc (.swe_calc_ut sw
-                                   jd
+                                   (:jd want)
                                    what
                                    flag
                                    res
@@ -63,8 +67,8 @@
         (let [cusps (double-array 13)
               ascmc (double-array 10)
               rc (.swe_houses sw
-                              jd
-                              0 ;; what flag?
+                              (:jd want)
+                              0 ;; TODO: flags?
                               (:lat (:geo want))
                               (:lon (:geo want))
                               (int (coerce-houses (:houses want)))
@@ -78,5 +82,5 @@
               {:houses (zipmap (range 1 13) (rest cusps))}
               {}))))
       (if (boolean (:meta want))
-        {:meta (conj (seq want) {:jd jd})}
+        {:meta (dissoc want :meta)}
         {}))))


fix it

fix it

--- src/cljs/bulldog/core.cljs
+++ src/cljs/bulldog/core.cljs
@@ -19,8 +19,6 @@
   (:import goog.History))

 (enable-console-print!)
-
-(println "Greetings puny humans!")

 (defn now
   "Create current date"


Fix number of tests & show the number & disable input after filling all tests

--- src/cljs/russyll/core.cljs
+++ src/cljs/russyll/core.cljs
@@ -38,6 +38,7 @@
    :splitted-mapped-atom {}
    :current-model "0"
    :splitted=mapped []
+   :done false
    })

 ;; Subscriptions
@@ -59,7 +60,9 @@

 (defn choose-word [user-history]
   (let [choice (serve-words-rand)]
-    (if (contains? user-history choice) (choose-word user-history) choice)))
+    (if (contains? user-history choice)
+      (choose-word user-history)
+      choice)))

 (defn set-new-word [db _]
   (let [
@@ -73,7 +76,10 @@

 (defn end-or-continue [db how-many how-many-guessed]
   (if (>= how-many-guessed how-many)
-    (assoc db :result (calc-stats (:user-history db)))
+    (-> db
+        (assoc :result (calc-stats (:user-history db)))
+        (assoc :done true)
+        )
     (set-new-word db [])))

 (defn debug [db]
@@ -86,12 +92,11 @@
          n-of-separations (->> current-word (filter #(= \- %)) (count))
          k (clojure.string/replace current-word "-" "")
          user-history (:user-history db)
-         how-many-guessed (-> user-history (count) (inc))
+         how-many-guessed (-> user-history (count))
          ]
      (if (= n-of-separations 1)
        (-> db
            (assoc-in [:user-history k] current-word)
-
            (assoc :user-progress (* how-many-guessed (/ 100 how-many)))
            (end-or-continue how-many how-many-guessed)
                   )
@@ -195,6 +200,7 @@
         current-word (re-frame/subscribe [:key-in-db :current-word])
         user-history (re-frame/subscribe [:key-in-db :user-history])
         result (re-frame/subscribe [:key-in-db :result])
+        done (re-frame/subscribe [:key-in-db :done])
         ]
     (fn []
       [:div
@@ -204,14 +210,14 @@
         [:strong "Important: "]
         "Set the division with a dash '-': 'игорь' -> 'и-горь'. There will be 10 words to divide."
         [:div.input-group.col-sm-4
-         [:input.form-control {:value @current-word, :on-change #(re-frame/dispatch [:set-current-word (-> % .-target .-value)])}]
+         [:input.form-control {:disabled @done :value @current-word, :on-change #(re-frame/dispatch [:set-current-word (-> % .-target .-value)])}]
          [:div.input-group-btn
           [:button.btn.btn-default
-           {:on-click #(re-frame/dispatch [:next-word])} (if (-> (count @user-history) (= how-many)) "Result" "Next")]]]
+           {:disabled @done :on-click #(re-frame/dispatch [:next-word])} (if (-> (count @user-history) (= how-many)) "Result" "Next")]]]
         [:ul.list-group
          {:style {:margin-top "10px"}}
-         (for [[k v] @user-history]
-           [:li.list-group-item {:key k} (str k " -> " v)])]]
+         (for [[i [k v]] (zipmap (-> @user-history (count) (range)) @user-history)]
+           [:li.list-group-item {:key k} (str (inc i) ". " k " -> " v)])]]
        [:table.table
         [:tr
          (for [{:keys [short]} models] [:th {:key short}  short])] [:tr (for [v @result] [:td {:key (rand)} v])]]


cljs/skyport.core: Add damage text over players

Players that are hit now display the damage over their heads.

--- src/cljs/skyport/core.cljs
+++ src/cljs/skyport/core.cljs
@@ -2,6 +2,7 @@
   (:require-macros [cljs.core.async.macros :refer (go go-loop)])
   (:require [cljs.core.async :refer (<! chan close! map<)]
             [clojure.string :as str]
+            [clojure.set :as set]
             [clojure.walk :refer [keywordize-keys]]
             [chord.client :as socket :refer (ws-ch)]
             [om.core :as om :include-macros true]
@@ -63,36 +64,54 @@
     "left-down"  [ 1  0]
     "right-down" [ 0  1]))

+(defn length [[ax ay] [bx by]]
+  (js/Math.sqrt
+   (+ (js/Math.pow (- ax bx) 2)
+      (js/Math.pow (- ay by) 2))))
+
+(defn get-weapon [player weapon]
+  (first
+   (drop-while (comp (partial not= weapon) :name)
+               (select-keys player
+                            [:primary-weapon
+                             :secondary-weapon]))))
+
 (defmulti handle-action :type)

 (defmethod handle-action "laser"
-  [{:keys [from stop] :as action}]
-  (swap! state assoc :action
-         (assoc action
-           :start (:position (player! from))
-           :stop (parse-coords stop))))
+  [{:keys [from stop direction] :as action}]
+  (let [player (player! from)
+        level (:level (get-weapon player "laser"))]
+    (swap! state assoc :action
+           (assoc action
+             :start (:position player)
+             :stop (parse-coords stop)
+             :dmg (+ 16 (* 2 (dec level)))))))

 (defmethod handle-action "droid"
-  [{:keys [sequence] :as action}]
-  (swap! state assoc :action
-         (assoc action
-           :sequence (mapv direction->coord
-                           sequence))))
+  [{:keys [sequence from] :as action}]
+  (let [level (:level (get-weapon (player! from) "droid"))]
+    (swap! state assoc :action
+           (assoc action
+             :sequence (mapv direction->coord
+                             sequence)
+             :dmg (+ 20 (* 2 level))))))

 (defmethod handle-action "mortar"
-  [{:keys [from coordinates]}]
+  [{:keys [from coordinates :as action]}]
   (let [player (player! from)
-        mortar (first
-                (drop-while (comp (partial not= "mortar") :name)
-                            (select-keys player
-                                         [:primary-weapon
-                                          :secondary-weapon])))]
+        level (->> (select-keys player [:primary-weapon
+                                        :secondary-weapon])
+                   (drop-while (comp (partial not= "mortar") :name))
+                   first
+                   :level)]
     (swap! state assoc :action
-           {:coord (mapv +
-                         (:position player)
-                         (parse-coords coordinates))
-            :radius (inc
-                     (:level mortar))})))
+           (assoc action
+             :coord (mapv +
+                          (:position player)
+                          (parse-coords coordinates))
+             :radius (inc level)
+             :dmg (if (= 3 level) 25 20)))))

 (defmethod handle-action "move"
   [{:keys [direction from]}]
@@ -122,7 +141,8 @@
 (defmethod handle-message! "gamestate"
   [gamestate]
   (let [new-state (update-in gamestate [:players]
-                             (partial map parse-position))]
+                             (comp (partial sort-by :name)
+                                   (partial map parse-position)))]
     (reset! state new-state)
     (timeout 0)))

@@ -207,7 +227,7 @@
                   (js/Math.sqrt 3)
                   (+ k (- j 2))))])

-(defn laser-shot [{:keys [start stop]} owner]
+(defn laser-shot [{:keys [start stop dmg direction]} owner]
   (html
    (let [[x_1 y_1] (coords-to-pixel start)
          [x_2 y_2] (coords-to-pixel stop)
@@ -217,17 +237,32 @@
                                  (js/Math.pow y_d 2)))
          width 20
          angle (* (js/Math.atan2 x_d y_d)
-                  (/ -180 js/Math.PI))]
+                  (/ -180 js/Math.PI))
+         hits (->> start
+                   (iterate (partial map + (direction->coord direction)))
+                   (take (length start stop))
+                   rest
+                   (into #{})
+                   (set/intersection
+                    (->> (:players @state)
+                         (map :position)
+                         (into #{}))))]
      [:g
       [:rect
        {:class "laser"
         :x (- x_2 (/ width 2)) :y y_2
         :width width :height height
         :transform (str "rotate(" angle" " x_2 " " y_2 ")")
-        :fill "url(#laser-shot)"}]])))
-
-
-(defn mortar-shot [{:keys [coord radius]} owner]
+        :fill "url(#laser-shot)"}]
+      [:g {:class "display"}
+       (for [hit hits
+             :let [[x y] (coords-to-pixel hit)]]
+         [:text {:class "damage"
+                 :x x :y y}
+          (str "-" dmg "HP")])]])))
+
+
+(defn mortar-shot [{:keys [coord dmg radius]} owner]
   (html
    (let [circle [[ 1  0]
                  [ 1  1]
@@ -244,25 +279,35 @@
          ;; path. Lastly, because the each circle completes back at
          ;; the same place it started we remove these all the extra
          ;; points.
-         hits (->> circle
+         area (->> circle
                    repeat
                    (reductions interleave)
                    (take radius)
                    (interleave (repeat '([-1 -1])))
                    (apply concat)
                    (reductions (partial mapv +) coord)
-                   distinct)]
+                   (into #{}))
+         hits (->> (:players @state)
+                   (map :position)
+                   (into #{})
+                   (set/intersection area))]
      [:g (om/build-all hexagon-view
-                       (for [[j k] hits
+                       (for [[j k] area
                              :let [[x y] (coords-to-pixel [j k])]]
                          {:x x
                           :y y
                           :size TILE-SIZE
                           :label "D"
                           :position [j k]})
-                       {:key :position})])))
-
-(defn droid-shot [{:keys [sequence from]} owner]
+                       {:key :position})
+      [:g {:class "display"}
+       (for [hit hits
+             :let [[x y] (coords-to-pixel hit)]]
+         [:text {:class "damage"
+                 :x x :y y}
+          (str "-" dmg "HP")])]])))
+
+(defn droid-shot [{:keys [sequence from dmg]} owner]
   (reify
     om/IInitState
     (init-state [_]
@@ -293,7 +338,8 @@
                       :cy y
                       :r (/ TILE-SIZE 3)}]]))
         (om/build mortar-shot {:coord explosion
-                               :radius 1})))))
+                               :radius 1
+                               :dmg dmg})))))

 (defmulti action-view
   (fn [action _] (:type action)))


1k char limit

1k char limit

--- src/cljs/unfolds/core.cljs
+++ src/cljs/unfolds/core.cljs
@@ -14,7 +14,12 @@
       (om/transact! app :items #(conj % new-item)))))

 (defn handle-change [e owner {:keys [text]}]
-  (om/set-state! owner :text (.. e -target -value)))
+  (let [value (.. e -target -value)
+        count (count value)]
+    (om/set-state! owner :count count)
+    (if (> count 999)
+      (om/set-state! owner :text text)
+      (om/set-state! owner :text value))))

 (defn item-view [item owner]
   (reify
@@ -27,11 +32,11 @@
     om/IRenderState
     (render-state [this state]
       (dom/div nil
-        (dom/h1 nil (:text app))
+        (dom/h1 nil (str (:text app) " " (:count state)))
         (dom/textarea #js
           {:value (:text state)
            :ref "new-item"
-           :rows "5" :cols "80"
+           :rows "12" :cols "80"
            :onChange #(handle-change % owner state)})
         (dom/button #js
           {:onClick #(add-item app owner)} "Add item")


Change one terrain to a seaport for testing purposes

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -562,7 +562,9 @@
       :terrain-type :deep-water}
      {:q 1
       :r 4
-      :terrain-type :mountains}
+      :terrain-type :seaport
+      ;:terrain-type :mountains
+      }
      {:q 2
       :r 4
       :terrain-type :plains}


simplify state handling around resume

simplify state handling around resume

--- src/re_frame/router.cljs
+++ src/re_frame/router.cljs
@@ -156,12 +156,7 @@
                                      [:scheduled #(-run-next-tick this)])

             ;; event processing is paused - probably by :flush-dom metadata
-            [:paused :add-event   ] [:paused   #(-add-event this arg)]
-
-            ;; processing the event that caused the queue to be paused
-            [:resuming :add-event    ] [:resuming  #(-add-event this arg)]
-            [:resuming :exception    ] [:quiescent #(-exception this arg)]
-            [:resuming :finish-resume] [:running   #(-run-queue this)]
+            [:paused :add-event] [:paused  #(-add-event this arg)]
             [:paused :resume   ] [:running #(-resume this)]

             (throw (str "re-frame: state transition not found. " fsm-state " " trigger)))]


Improve block store integration tests further.

--- src/blocks/store/tests.clj
+++ src/blocks/store/tests.clj
@@ -111,11 +111,17 @@

 (defn test-block-store
   "Tests a block store implementation."
-  [label store & {:keys [blocks max-size clean]
-                  :or {blocks 10, max-size 1024, clean true}}]
+  [label store & {:keys [blocks max-size eraser]
+                  :or {blocks 10, max-size 1024}}]
+  (when-not (empty? (block/list store))
+    (throw (IllegalStateException.
+             (str "Cannot run integration test on " (pr-str store)
+                  " as it already contains blocks!"))))
   (println "  *" label)
-  (is (empty? (block/list store)) "starts empty")
   (testing (.getSimpleName (class store))
+    (testing "querying non-existent block"
+      (is (nil? (block/stat store (multihash/sha1 "foo"))))
+      (is (nil? (block/get store (multihash/sha1 "bar")))))
     (testing "put attributes"
       (test-put-attributes store))
     (let [stored-content (populate-blocks! store blocks max-size)]
@@ -130,7 +136,8 @@
         (test-block store id content))
       (let [[id content] (first (seq stored-content))]
         (test-restore-block store id content))
-      (when clean
+      (if eraser
+        (eraser store)
         (doseq [id (keys stored-content)]
-          (is (true? (block/delete! store id))))
-        (is (empty? (block/list store)) "ends empty")))))
+          (is (true? (block/delete! store id)))))
+      (is (empty? (block/list store)) "ends empty"))))


Remove invitation sub in core

Remove invitation sub in core

--- src/braid/client/subs.cljs
+++ src/braid/client/subs.cljs
@@ -267,11 +267,6 @@
     (get-in state [:users user-id :nickname])))

 (reg-sub
-  :invitations
-  (fn [state _]
-    (get-in state [:invitations])))
-
-(reg-sub
   :user-subscribed-tag-ids
   (fn [state _]
     (set (get-in state [:user :subscribed-tag-ids]))))


Enlarge toolbar

Enlarge toolbar

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

--- src/conexp/contrib/gui/editors/context_editor/context_editor.clj
+++ src/conexp/contrib/gui/editors/context_editor/context_editor.clj
@@ -242,7 +242,7 @@
                                   :floatable? false)
           root           (top-bottom-split (scrollable bar)
                                            (get-widget table)
-                                           :divider-location 65)
+                                           :divider-location 70)
           e-ctx          @ectx,
           widget         (context-editor-widget. root table ectx),
           keystroke-fill (KeyStroke/getKeyStroke KeyEvent/VK_SPACE


Fix ring system possibly not getting ring handler.

Box got the merged project :containium entry, but
not the module-descriptor merged one...

--- src/containium/modules.clj
+++ src/containium/modules.clj
@@ -104,8 +104,11 @@
           boxure-config (-> (get-config (-> manager :systems :config) :modules)
                             (assoc :profiles profiles))]
       (if-let [box (start-box descriptor boxure-config (:systems manager))]
-        (let [box (assoc-in box [:project :containium]
-                            (merge (-> box :project :containium) containium))]
+        ; --------
+        ; ARNOUT-PLEASE-FIXME: Should the project map get updated with values from the Module deployment descriptor?
+        ; It's not really data coming from a leiningen project, but on the other hand you probably don't want different :containium data?
+        ; --------
+        (let [box (assoc-in box [:project :containium] (-> box :descriptor :containium))]
           (when (-> box :project :containium :ring)
             (upstart-box (-> manager :systems :ring) name box))
           (send-to-module manager name


Improve validation

Improve validation

- add more possible signatures
- allow volumes for Musiknoten

--- src/catalog/validation.clj
+++ src/catalog/validation.clj
@@ -18,7 +18,7 @@
 (def BrailleGrade
   (apply s/enum (vals vubis/braille-grade-raw-to-braille-grade)))

-(def SignatureRE #"(DS |GDB |BG |ED |PS|DY|GD)\d{4,6}")
+(def SignatureRE #"(DS |GDB |BG |ED |BM |BK |PS|DY|GD)\d{4,6}")

 (def SignatureTuple
   [(s/one SignatureRE "signature")
@@ -87,7 +87,8 @@
  {:source-publisher s/Str
   :source-date s/Inst
   :producer-brief ProducerBrief
-  :genre-text s/Str})
+  :genre-text s/Str
+  (s/optional-key :volumes) s/Int})

 (abstract-map/extend-schema
  Grossdruck CatalogItem [:grossdruck]


action isnt a keyword

action isnt a keyword

--- src/celestial/api/jobs.clj
+++ src/celestial/api/jobs.clj
@@ -98,7 +98,7 @@
       :notes "Runs adhoc remote opertions on system (like deployment, service restart etc)
               using matching remoting capable tool like Capisrano/Supernal/Fabric"}
        (let [{:keys [machine] :as system} (s/get-system id)]
-         (if-let [actions (find-action-for (keyword action) (:type system))]
+         (if-let [actions (find-action-for action (:type system))]
            (schedule-job id "run-action" (<< "submitted ~{action} action")
              [actions (merge args {:action (keyword action) :hostname (machine :hostname) :target (machine :ip) :system-id (Integer. id)})])
            (bad-req {:msg (<< "No action ~{action} found for id ~{id}")})


make sure window visibility is bool

make sure window visibility is bool

--- src/chat/client/store.cljs
+++ src/chat/client/store.cljs
@@ -80,7 +80,7 @@
   (when visible?
     (transact! [:notifications :unread-count] (constantly 0))
     (set! (.-title js/document) "Chat"))
-  (transact! [:notifications :window-visible?] (constantly visible?)))
+  (transact! [:notifications :window-visible?] (constantly (boolean visible?))))

 ; error


Clean up print-instances

Clean up print-instances

--- src/circle/backend/ec2.clj
+++ src/circle/backend/ec2.clj
@@ -355,13 +355,9 @@
   (->> (instances)
        (map (fn [inst]
               (-> inst
-               (assoc :state-name (-> inst :state :name))
-               (assoc :security-groups (str/join "," (for [g (:securityGroups inst)]
-                                                       (.getGroupName g))))
                (assoc :tags (into (sorted-map) (for [t (map bean (-> inst :tags))] [(:key t) (:value t)]))))))
-       (table [:instanceId :state-name :publicIpAddress :imageId :security-groups :tags])
+       (table [:instanceId :publicIpAddress :imageId :tags])
        (println)))
-

 (defn image-wait-for-ready [image-name]
   (try-try-again


Log exceptions before returning error to client

--- src/clj/cglossa/server.clj
+++ src/clj/cglossa/server.clj
@@ -42,6 +42,7 @@
   `(try (let [res# ~fn-call]
           (transit-response* res#))
         (catch Exception e#
+          (log/error e#)
           {:status 500
            :body   (.toString e#)})))


Czech messages

Czech messages

--- src/clj_mrazik/irc_bot.clj
+++ src/clj_mrazik/irc_bot.clj
@@ -45,6 +45,11 @@
 (def soviet2                 (atom nil))
 (def soviet3                 (atom nil))
 (def soviet4                 (atom nil))
+(def czech1                  (atom nil))
+(def czech2                  (atom nil))
+(def czech3                  (atom nil))
+(def czech4                  (atom nil))
+

 (defn load-all-data-files
     []
@@ -56,6 +61,10 @@
     (reset! happy-birthday-messages (load-vocabulary "data/happy-birthday.txt"))
     (reset! quotes                  (load-vocabulary "data/quotes.txt"))
     (reset! papalas                 (load-vocabulary "data/papalas.txt"))
+    (reset! czech1                  (load-vocabulary "data/czech1.txt"))
+    (reset! czech2                  (load-vocabulary "data/czech2.txt"))
+    (reset! czech3                  (load-vocabulary "data/czech3.txt"))
+    (reset! czech4                  (load-vocabulary "data/czech4.txt"))
     (reset! soviet1                 (load-vocabulary "data/soviet1.txt"))
     (reset! soviet2                 (load-vocabulary "data/soviet2.txt"))
     (reset! soviet3                 (load-vocabulary "data/soviet3.txt"))
@@ -279,6 +288,7 @@
                           "papalas"  (say-quote papalas)
                           "papaláš"  (say-quote papalas)
                           "совет"    (say-quote soviet1 soviet2 soviet3 soviet4)
+                          "sg"       (say-quote czech1 czech2 czech3 czech4)
                           "fix the Universe" "linux++ trello-- Mojo-- Blue.Jeans-- BlueJeans-- asciidoc-- docbook++"
                           "rainbow"   (apply str (for [color (range 16)]
                                                      (str (char 3) (format "%02d" color) (format "test%02d " color) (char 3) "99")))


Reenabling friend name set

Reenabling friend name set

--- src/cljs/bmihw/submit.cljs
+++ src/cljs/bmihw/submit.cljs
@@ -37,7 +37,7 @@
             (success!)))))))

 (defn set-name! [name]
-  (let [elem (.querySelector js/document "#username")]
+  (let [elem (.querySelector js/document "#twitter-username")]
     (set! (.-value elem) name)))

 (defn friends-component [friends-edn]


Experiment with passing app-state hash map

--- src/cljs/cglossa/core.cljs
+++ src/cljs/cglossa/core.cljs
@@ -2,7 +2,10 @@
   (:require [reagent.core :as reagent :refer [atom]]
             [plumbing.core :as plumbing :refer [map-vals]]))

-(defonce app-state (atom {:text "Hello Chestnut!"}))
+(def data {:categories ["ku" "hest"]
+           :users      ["per" "kari"]})
+
+(defonce app-state (into {} (map-vals atom data)))

 (defn navbar []
   [:div.navbar.navbar-fixed-top [:div.navbar-inner [:div.container [:span.brand "Glossa"]]]])
@@ -13,21 +16,19 @@
     [:button#new-search-button.btn.btn-mini.btn-primary {:title "Reset form" :value "Reset form"}]
     [:div.span9]]])

-(defn middle []
-  [:div "middle"])
+(defn bottom [{:keys [categories]}]
+  [:div (for [cat @categories]
+     [:div cat])])

-(defn bottom []
-  [:div "bottom"])
-
-(defn app []
+(defn app [s]
+  (.log js/console s)
   [:div [navbar]
    [:div.container-fluid
-    [top]
-    [middle]]
-   [bottom]])
+    [top]]
+   [bottom s]])

 (defn ^:export main []
   (reagent/render-component
     (fn []
-      [app])
+      [app app-state])
     (. js/document (getElementById "app"))))


add back support for dropping folders

add back support for dropping folders

--- src/cljs/smgui/search.cljs
+++ src/cljs/smgui/search.cljs
@@ -8,6 +8,7 @@
             [smgui.core :as app :refer [flux-handler]]
             [smgui.settings :as settings]
             [smgui.util :refer [class-set copy-file]]
+            [smgui.dirscan :as dir]
             [cljs.core.async :refer [put! chan <! >! close! pipe]]
             [swannodette.utils.reactive :as r]))

@@ -121,10 +122,11 @@
                                                               :channel c}})))

 (defmethod flux-handler :add-search [{:keys [path]}]
-  (go
-    (let [id (rand)
-          channel (download-chan path)]
-      (loop [state {:status :init}]
-        (when state
-          (swap! app/app-state update-in [:searches] #(assoc % id (merge state {:path path :id id})))
-          (recur (<! channel)))))))
+  (dochan [channel (->> (dir/show-lookup path)
+                        (r/map download-chan))]
+    (go
+      (let [id (rand)]
+        (loop [state {:status :init}]
+          (when state
+            (swap! app/app-state update-in [:searches] #(assoc % id (merge state {:path path :id id})))
+            (recur (<! channel))))))))


get with event chan instead of current item

--- src/cljs/unfolds/core.cljs
+++ src/cljs/unfolds/core.cljs
@@ -187,7 +187,7 @@

       (defroute "/:id" {id :id}
         (om/update! app :route [:view-item id])
-        (put! (om/get-state owner :current-item) id))
+        (put! (om/get-state owner :event) {:op :get :data id}))

       (.setEnabled history true)

@@ -210,12 +210,7 @@

                (= id :search)
                (do
-                 (.setToken history "/search"))
-
-               :else
-               (let [item (<! (util/edn-chan {:url (str "/items/" id)}))]
-                 (.setToken history (str "/" id))
-                 (om/update! app :current-item item))))
+                 (.setToken history "/search"))))
             (recur)))

       ;; event loop
@@ -229,12 +224,15 @@
                   (.setToken history (str "/" (:item/id data))) ;; XXX
                   (om/transact! app :current-item #(merge % data)))

-                ;; TODO: where's get? Why not here?
+                :get
+                (let [item (<! (util/edn-chan {:url (str "/items/" data)}))]
+                  (.setToken history (str "/" data))
+                  (om/update! app :current-item item))

                 :search
                 (let [data (<! (util/edn-chan
                                 {:url (str "/search/" (:subs data))}))]
-                  ;; XX: what if there's no hit?
+                  ;; XXX: what if there's no hit?
                   ;;(.setToken history (str "/items")) ;; XXX
                   (om/transact! app :items (fn [_] data)) ;; search results
                   )


correct catch/finally namespace again

correct catch/finally namespace again

--- src/cljs_api_gen/parse.clj
+++ src/cljs_api_gen/parse.clj
@@ -445,7 +445,7 @@
                (assoc
                  (select-keys try-form
                               [:docstring :filename :lines :github-link])
-                 :full-name (str (:ns try-form) "/" name-)
+                 :full-name (str "special/" name-)
                  :ns "special"
                  :type "special form"
                  :name name-


Remove circular dependency

Remove circular dependency

--- src/clojars/cloudfiles.clj
+++ src/clojars/cloudfiles.clj
@@ -2,8 +2,7 @@
   (:require [clojars.file-utils :as fu]
             [clojure.java.io :as io]
             [clojure.string :as str]
-            [org.jclouds.blobstore2 :as jc]
-            [clojars.cloudfiles :as cf])
+            [org.jclouds.blobstore2 :as jc])
   (:import [org.jclouds.blobstore
             BlobStore
             domain.PageSet


Added a gene that says to move in a random direction.

--- src/clojure_robby/core.clj
+++ src/clojure_robby/core.clj
@@ -7,13 +7,13 @@

 (def map-size 20) ; Size of the map used for robot simulation.
-(def gold-prob 10) ; Probability in 100 that a tile contains gold.
+(def gold-prob 20) ; Probability in 100 that a tile contains gold.
 (def simul-steps 100) ; Steps to allow the robot to make in a simulation.
 (def tiles [\w \p \g]) ; Tiles that populate the map: wall, path, and gold.
-(def actions [\u \d \l \r \p]) ; Actions the robot can take: up, down, left, right, pick up.
+(def actions [\u \d \l \r \x \p]) ; Actions the robot can take: up, down, left, right, pick up.
 (def dir-vects ['(0 -1) '(0 1) '(-1 0) '(1 0) '(0 0)]) ; Direction vectors, corresponding to the actions.

-(def mutation-prob 2) ; Probability in 100 that a gene will mutate.
+(def mutation-prob 10) ; Probability in 100 that a gene will mutate.
 (def action-penalty 5) ; How many points robot loses when hitting the wall or picking up when it shouldn't.
 (def gold-value 10) ; How many points picking up gold is worth.

@@ -22,8 +22,8 @@
 (defn rand-dna []
   "Initializes a vector of random DNA."
   (defn rand-gene []
-    (nth actions (rand-int (count actions))))
-  (vec (repeatedly (** (count tiles) (count actions)) rand-gene)))
+    (rand-nth actions))
+  (vec (repeatedly (** (count tiles) 5) rand-gene)))

 (defn cross [a b]
   "Crosses two vectors of DNA."
@@ -77,6 +77,7 @@
   "Simulates the DNA on a map. Evaluates to the score the robot achieved in simul-steps."
   (defn make-step [[current-map pos score]]
     "Makes a single step on the map, according to the DNA sequence."
+    ;(print pos)
     (defn get-situation []
       "Returns the tile situation at the current pos."
       (def nearby-tiles (map (fn[v] (get-tile the-map (add-vec pos v))) dir-vects))
@@ -93,6 +94,12 @@
         (if (not= \w (get-tile current-map new-pos))
           [current-map new-pos score]
           [current-map pos (- score action-penalty)]))
+      \x
+      (do
+        (def new-pos (add-vec pos (rand-nth (take 4 dir-vects))))
+        (if (not= \w (get-tile current-map new-pos))
+          [current-map new-pos score]
+          [current-map pos (- score action-penalty)]))
       \p
       (do
         (if (= \g (get-tile current-map pos))
@@ -106,12 +113,12 @@
 (defn evolve [individuals]
   "Takes a bunch of individuals (DNAs) and cross-breeds by fitness."
   (def the-map (rand-map))
-  (def ordered (reverse (sort-by (fn[dna] (simulate dna the-map)) individuals)))
-  (println (simulate (first ordered) the-map))
-  (def crossed (map (fn [pair]
-         (let [[a b] (vec pair)] (cross a b)))
-       (partition 2 ordered)))
-  (concat crossed (map mutate crossed)))
+  (def ordered (sort-by (fn[dna] (simulate dna the-map)) individuals))
+  (println (simulate (last ordered) the-map))
+  (def crossed
+    (map (fn [pair] (let [[a b] (vec pair)] (cross a b)))
+         (partition 2 ordered)))
+  (concat (mutate crossed) ()))

 (defn -main
   "I don't do a whole lot ... yet."


Adding results on job-results request

Adding results on job-results request

--- src/emender_service/rest_api.clj
+++ src/emender_service/rest_api.clj
@@ -12,11 +12,12 @@

 (ns emender-service.rest-api)

-(require '[ring.util.response     :as http-response])
-(require '[clojure.pprint         :as pprint])
-(require '[clojure.data.json      :as json])
+(require '[ring.util.response         :as http-response])
+(require '[clojure.pprint             :as pprint])
+(require '[clojure.data.json          :as json])

 (require '[emender-service.file-utils :as file-utils])
+(require '[emender-service.results    :as results])

 (defn read-request-body
     [request]
@@ -73,6 +74,7 @@
           results  (-> (read-request-body request) body->results)]
         (println "job name" job-name)
         (println "results:" results)
+        (results/add-new-results job-name results)
         ;(pprint/pprint results)
         (send-response {:status :ok})))


commented out de/serialize b/c read-string

--- src/divergence/system.cljs
+++ src/divergence/system.cljs
@@ -260,6 +260,8 @@
   ;(js/alert @serial-data)
   (.setItem js/localStorage "dm" data))

+(comment
+  "Not sure what read-string refers to, but commenting out for now, since undeclared"
 (defn serialize [entities]
   (doseq [e entities]
     (if (= ":bunny" (pr-str (@e :name)))
@@ -270,3 +272,4 @@
    (doseq [e entities
            :when (= :bunny (@e :name))]
      (reset! e (read-string (.getItem js/localStorage "dm")))))
+)


add contact-component

add contact-component

--- app/src/cljs/app/components.cljs
+++ app/src/cljs/app/components.cljs
@@ -14,3 +14,21 @@
       [:h3 "Profile"]]
      [:div.aboutdescription
       description]]]])
+
+(defn contact-component
+  [name email phone]
+  [:div#contact
+   [section-component
+    [:div.contact
+     [:div.contactname
+      [:h3 name]]
+     [:div.contactphonemail.mdl-grid
+      [:div.mdl-cell.mdl-cell--4-col
+       [:i.material-icons "phone"]]
+      [:div.mdl-cell.mdl-cell--4-col
+       [:i.material-icons "email"]]]
+     [:div.contact.mdl-grid
+      [:div.mdl-cell.mdl-cell--4-col
+       [:p phone]]
+      [:div.mdl-cell.mdl-cell--4-col
+       [:p email]]]]]])


Experimental: Add `reduce-hscan` util

Experimental: Add `reduce-hscan` util

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -706,6 +706,41 @@
   (reduce-scan (fn rf [acc in] (into acc in))
     [] (fn scan-fn [cursor] (wcar {} (scan cursor)))))

+(defn reduce-hscan
+  "Experimental. Like `reduce-scan` but:
+    - `rf` is (fn [acc k v]), as in `reduce-kv`.
+    - `rf` will never be called with the same key twice
+      (i.e. automatically de-duplicates elements)."
+  ([rf          scan-fn] (reduce-hscan rf nil scan-fn))
+  ([rf acc-init scan-fn]
+   (let [keys-seen_ (enc/-vol! (transient #{}))]
+
+     (reduce-scan
+       (fn wrapped-rf [acc kvs]
+         (enc/reduce-kvs
+           (fn [acc k v]
+             (if (contains? @keys-seen_ k)
+               acc
+               (do
+                 (enc/-vol-swap! keys-seen_ conj! k)
+                 (enc/convey-reduced (rf acc k v)))))
+           acc
+           kvs))
+
+       acc-init scan-fn))))
+
+(comment
+  (wcar {} (del "test:foo"))
+  (wcar {} (doseq [i (range 1e4)] (hset "test:foo" (str "k" i) (str "v" i))))
+  (count
+    (reduce-hscan
+      (fn rf [acc k v]
+        (if #_true false
+          (reduced (assoc acc k v))
+          (do      (assoc acc k v))))
+      {}
+      (fn [cursor] (wcar {} (hscan "test:foo" cursor))))))
+
 ;;;; Deprecated

 (enc/deprecated


Add combinatorial sanity-check: don't allow multi-key value combinations

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -453,16 +453,15 @@
     (reduce (fn [r kvs]
               (let [ks (keys kvs)
                     vs (mapv ensure-coll (vals kvs))]
+                (when (> (count (filter next vs)) 1)
+                  (-> (Exception. "Can range over only a single attr's values")
+                      (throw)))
                 (into r (mapv (comp clj-item->db-item (partial zipmap ks))
                               (apply utils/cartesian-product vs)))))
             [] (ensure-coll kvs))))

-(comment (multi-kvs {:k1 "v1"})
-         (multi-kvs {:k1 ["v1" "v2"]})
-         (multi-kvs {:k1 "v1" :k2 [0 1]})
-         (multi-kvs [{:k1 "v1" :k2 [0 1]}
-                     {:k1 "v2" :k2 [2 3]}])
-         (multi-kvs {:k1 ["v1" "v2"] :k2 [0 1]}))
+(comment (multi-kvs {:a "a1" :b ["b1" "b2" "b3"] :c ["c1" "c2"]})
+         (multi-kvs {:a "a1" :b ["b1" "b2" "b3"] :c ["c1"]}))

 (defn- batch-request-items
   "{<table> <request> ...} -> {<table> KeysAndAttributes> ...}"


Send ble signal with using value from joystick

--- src/re_natal_esp32control_app/views/ble_control.cljs
+++ src/re_natal_esp32control_app/views/ble_control.cljs
@@ -19,15 +19,15 @@
    [v.common/text {:style {:color "#fff" :text-align "center" :height 100}}
     label]])

-(defn ble-send [device & [{:keys [lf lb rf rb]}]]
-  (let [data (map #(if (nil? %) 0 %) [lf lb rf rb])]
-    (ble/write (:id device) service-id characteristic-id data)))
+(defn ble-send [{:keys [lf lb rf rb]}]
+  (let [current-device (subscribe [:get-current-device])
+        data (map #(if (nil? %) 0 %) [lf lb rf rb])]
+    (ble/write (:id @current-device) service-id characteristic-id data)))

 (defn tile-buttons []
-  (let [current-device (subscribe [:get-current-device])
-        stop #(ble-send @current-device)
+  (let [stop #(ble-send {})
         control-button (fn [label signals]
-                             [touch-button label #(ble-send @current-device signals) stop])]
+                             [touch-button label #(ble-send signals) stop])]
     [v.common/view {:style {:align-content "center" :align-self "center"}}
      [v.common/view {:style {:flex-direction "row"}}
       [control-button "left foreward" {:rf 255}]
@@ -72,18 +72,16 @@
                   :width view-w
                   :height view-h
                   :background-color "#beb"}
-          :on-layout (fn [this]
-                       (update-view-x-y))
+          :on-layout #(update-view-x-y)
           :on-start-should-set-responder (fn [] true)
           :on-move-should-set-responder (fn [] true)
           :on-responder-grant #(action-after-calc %)
           :on-responder-move #(action-after-calc %)
-          :on-responder-release (fn [] (on-release))}])
+          :on-responder-release #(on-release)}])

       :component-did-mount
-      (fn [this]
-        (reset! joystick-ref (-> (.-refs this)
-                                 (.-joystickArea))))})))
+      #(reset! joystick-ref (-> (.-refs %)
+                                (.-joystickArea)))})))

 (def control-modes
   [{:id :joystick
@@ -91,9 +89,23 @@
    {:id :tile-buttons
     :name "Tile Buttons"}])

+(defn rate->byte [rate]
+  (-> rate
+      (min 1)
+      (max 0)
+      (* 255)))
+
 (defn all-range-action [{:keys [x y]}]
-  (prn :x x)
-  (prn :y y))
+  (when (and x y)
+    (let [f (rate->byte (- y))
+          b (rate->byte  y)
+          l (rate->byte (- x))
+          r (rate->byte  x)
+          lf (max 0 (- f l))
+          rf (max 0 (- f r))
+          lb (max 0 (- b l))
+          rb (max 0 (- b r))]
+      (ble-send {:lf (int lf) :rf (int rf) :lb (int lb) :rb (int rb)}))))

 (defn control-area []
   (let [control-mode (r/atom (:id (first control-modes)))]


Fix a typo

Fix a typo

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -68,7 +68,7 @@

     [pathvec middleware? & entries],

-  In which case pathvec and middleware? (if present) will provide a
+  in which case pathvec and middleware? (if present) will provide a
   context pathvec and default middleware for the nested entries
   without introducing a separate route."
   [dispatch-table]


Moved generated test blog files to the target directory.

--- test/lambda_blog/fixtures.clj
+++ test/lambda_blog/fixtures.clj
@@ -49,7 +49,7 @@
            :footer-template footer
            :footer-scripts ["js/lambda-blog.js"]
            :navigation-template navigation
-           :output-dir "/out/"
+           :output-dir "/target/out/"
            :url "localhost:8000"
            :scripts ["http://code.jquery.com/jquery-2.2.0.min.js"
                      "https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.25.1/js/jquery.tablesorter.min.js"


fixing some db connection issues on heroku

--- src/text_stream/data.clj
+++ src/text_stream/data.clj
@@ -3,8 +3,22 @@
             [korma.core :refer :all]
             [text-stream.edits :as edits]))

-(defdb db (postgres {:db "textstream"
-                  :user "field-thompson"}))
+
+
+(defdb db
+  (if (System/getenv "DATABASE_URL")
+    (let [db-uri (java.net.URI. (System/getenv "DATABASE_URL"))
+          user-and-password (clojure.string/split (.getUserInfo db-uri) #":")]
+      {:classname "org.postgresql.Driver"
+       :subprotocol "postgresql"
+       :user (get user-and-password 0)
+       :password (get user-and-password 1) ; may be nil
+       :subname (if (= -1 (.getPort db-uri))
+                  (format "//%s%s" (.getHost db-uri) (.getPath db-uri))
+                  (format "//%s:%s%s" (.getHost db-uri) (.getPort db-uri)
+                          (.getPath db-uri)))})
+    (postgres
+     {:db "textstream"})))

 (defentity stream)


Abbreviate long template descriptions, but show full description on hover.

--- src/cljs/clj_templates/pages/templates/page.cljs
+++ src/cljs/clj_templates/pages/templates/page.cljs
@@ -2,7 +2,8 @@
   (:require [clj-templates.util.events :refer [listen]]
             [clj-templates.util.js :refer [target-value]]
             [re-frame.core :refer [dispatch]]
-            [clojure.string :as str]))
+            [clojure.string :as str]
+            [reagent.core :as r]))

 (def lein-logo "images/leiningen.jpg")
 (def boot-logo "images/boot-logo.png")
@@ -13,18 +14,29 @@
 (defn lein-usage [template-name]
   (str "lein new " template-name "my-app"))

-(defn template-panel [{:keys [template-name description build-system homepage downloads]}]
-  [:div.template
-   [:div
-    [(if homepage :a.title :div.title)
-     (when homepage {:href homepage}) template-name]
-    [:div.description description]]
-   [:div.info-row
-    [:div.template-attribute [:div.keyword ":downloads "] [:div.code downloads]]
-    [:div.template-icons
-     (when (= build-system "lein")
-       [:img {:src lein-logo :width "20px"}])
-     [:img {:src boot-logo :width "23px"}]]]])
+(def max-description-length 150)
+
+(defn abbreviate-description [description should-abbreviate?]
+  (if (and should-abbreviate?
+           (< max-description-length (count description)))
+    (str (subs description 0 max-description-length) "...")
+    description))
+
+(defn template-panel []
+  (let [hovered? (r/atom false)]
+    (fn [{:keys [template-name description build-system homepage downloads]}]
+      [:div.template {:on-mouse-enter #(reset! hovered? true)
+                      :on-mouse-leave #(reset! hovered? false)}
+       [:div
+        [(if homepage :a.title :div.title)
+         (when homepage {:href homepage}) template-name]
+        [:div.description (abbreviate-description description (not @hovered?))]]
+       [:div.info-row
+        [:div.template-attribute [:div.keyword ":downloads "] [:div.code downloads]]
+        [:div.template-icons
+         (when (= build-system "lein")
+           [:img {:src lein-logo :width "20px"}])
+         [:img {:src boot-logo :width "23px"}]]]])))

 (defn search-input [hit-count query-string]
   [:input.search-input {:type        "text"


linty fix / remove debug line

linty fix / remove debug line

--- src/metabase/driver/query_processor/expand.clj
+++ src/metabase/driver/query_processor/expand.clj
@@ -82,7 +82,6 @@
 (defn expand-filter
   "Expand a `filter` clause."
   [filter-clause]
-  (def _b filter-clause)
   (with-resolved-fields parse-filter filter-clause))

 ;; Do a breadth-first walk so we don't walk things that will be tossed anyway. Since


don't write data files in test

don't write data files in test

--- test/tabby/local_net_test.clj
+++ test/tabby/local_net_test.clj
@@ -12,6 +12,7 @@
 (defn test-cluster []
   (-> (create-network-cluster 50 9495)
       (cluster/init-cluster 3)
+      (update :servers utils/mapf assoc :data-dir nil)
       (assoc-in [:servers "0.localnet:0" :election-timeout] 0)
       (assoc-in [:servers "1.localnet:1" :election-timeout-fn]
                 (constantly 150))