Add rainbow desaturating over beat example.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -321,14 +321,16 @@
 (defn make-cues
   "Create a bunch of example cues for experimentation."
   []
-  (let [hue-bar (params/build-oscillated-param ; Spread a rainbow across a bar of music
+  (let [hue-bar (params/build-oscillated-param  ; Spread a rainbow across a bar of music
                  (oscillators/sawtooth-bar) :max 360)
-        hue-gradient (params/build-spatial-param ; Spread a rainbow across the light grid
+        desat-beat (params/build-oscillated-param  ; Desaturate a color as a beat progresses
+                    (oscillators/sawtooth-beat :down? true) :max 100)
+        hue-gradient (params/build-spatial-param  ; Spread a rainbow across the light grid
                       (show/all-fixtures)
                       (fn [head] (- (:x head) (:min-x @(:dimensions *show*)))) :max 360)
-        hue-z-gradient (params/build-spatial-param ; Spread a rainbow across the light grid
-                      (show/all-fixtures)
-                      (fn [head] (- (:z head) (:min-z @(:dimensions *show*)))) :max 360)]
+        hue-z-gradient (params/build-spatial-param  ; Spread a rainbow across the light grid front to back
+                        (show/all-fixtures)
+                        (fn [head] (- (:z head) (:min-z @(:dimensions *show*)))) :max 360)]
     (global-color-cue "red" 0 0 :include-color-wheels? true)
     (global-color-cue "orange" 1 0 :include-color-wheels? true)
     (global-color-cue "yellow" 2 0 :include-color-wheels? true)
@@ -343,28 +345,33 @@
                                            (params/build-color-param :s :rainbow-saturation :l 50 :h hue-bar)))
                            :short-name "Rainbow Bar Fade"
                            :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-                                         :type :integer}]))
+                                        :type :integer}]))
     (ct/set-cue! (:cue-grid *show*) 1 1
                  (cues/cue :color (fn [_] (global-color-effect
                                            (params/build-color-param :s :rainbow-saturation :l 50 :h hue-gradient)
                                            :include-color-wheels? true))
                            :short-name "Rainbow Grid"
                            :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-                                         :type :integer}]))
+                                        :type :integer}]))
     (ct/set-cue! (:cue-grid *show*) 2 1
                  (cues/cue :color (fn [_] (global-color-effect
                                            (params/build-color-param :s :rainbow-saturation :l 50 :h hue-gradient
                                                                      :adjust-hue hue-bar)))
                            :short-name "Rainbow Grid+Bar"
                            :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-                                         :type :integer}]))
-
-    (ct/set-cue! (:cue-grid *show*) 4 1
+                                        :type :integer}]))
+    (ct/set-cue! (:cue-grid *show*) 3 1  ; Desaturate the rainbow as each beat progresses
+                 (cues/cue :color (fn [_] (global-color-effect
+                                           (params/build-color-param :s sat-beat :l 50 :h hue-gradient
+                                                                     :adjust-hue hue-bar)))
+                           :short-name "Rainbow Pulse"))
+
+    (ct/set-cue! (:cue-grid *show*) 5 1
                  (cues/cue :color (fn [_] (global-color-effect
                                            (params/build-color-param :s 100 :l 50 :h hue-z-gradient)
                                            :include-color-wheels? true))
                            :short-name "Z Rainbow Grid"))
-    (ct/set-cue! (:cue-grid *show*) 5 1
+    (ct/set-cue! (:cue-grid *show*) 6 1
                  (cues/cue :color (fn [_] (global-color-effect
                                            (params/build-color-param :s 100 :l 50 :h hue-z-gradient
                                                                      :adjust-hue hue-bar)))
@@ -375,7 +382,7 @@
                                            (params/build-color-param :s 100 :l 50 :h hue-gradient
                                                                      :adjust-hue hue-bar)
                                            :lights (show/fixtures-named "blade")))
-                         :short-name "Rainbow Blades"))
+                           :short-name "Rainbow Blades"))

     ;; TODO: Write a macro to make it easier to bind cue variables.
@@ -383,10 +390,10 @@
                  (cues/cue :sparkle (fn [var-map] (fun/sparkle (show/all-fixtures)
                                                                :chance (:chance var-map 0.05)
                                                                :fade-time (:fade-time var-map 50)))
-                         :held true
-                         :priority 100
-                         :variables [{:key "chance" :min 0.0 :max 0.4 :start 0.05 :velocity true}
-                                     {:key "fade-time" :name "Fade" :min 1 :max 2000 :start 50 :type :integer}]))
+                           :held true
+                           :priority 100
+                           :variables [{:key "chance" :min 0.0 :max 0.4 :start 0.05 :velocity true}
+                                       {:key "fade-time" :name "Fade" :min 1 :max 2000 :start 50 :type :integer}]))

     (ct/set-cue! (:cue-grid *show*) 7 7
                  (cues/function-cue :strobe-all :strobe (show/all-fixtures) :effect-name "Raw Strobe"))
@@ -431,9 +438,9 @@
                            :color :orange :end-keys [:dimmers]))
     (ct/set-cue! (:cue-grid *show*) 5 2
                  (cues/cue :puck-dimmers (fn [var-map] (dimmer-effect
-                                                       (params/bind-keyword-param (:level var-map 255) Number 255)
-                                                       (show/fixtures-named "puck")
-                                                       :effect-name "Puck Dimmers"))
+                                                        (params/bind-keyword-param (:level var-map 255) Number 255)
+                                                        (show/fixtures-named "puck")
+                                                        :effect-name "Puck Dimmers"))
                            :variables [(merge {:key "level" :min 0 :max 255 :start 255 :name "Level"})]
                            :color :orange :end-keys [:dimmers]))
     (ct/set-cue! (:cue-grid *show*) 6 2
@@ -582,7 +589,7 @@
                                     (params/build-oscillated-param (oscillators/triangle-bar) :min 1)
                                     (show/all-fixtures) :effect-name "All Triangle Bar"))
                            :color :red :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers
-                                                   :puck-dimmers :hex-dimmers :snowball-dimmers]))
+                                                  :puck-dimmers :hex-dimmers :snowball-dimmers]))

     ;; Strobe cues
     (make-strobe-cue "All" (show/all-fixtures) 0 6)
@@ -656,13 +663,13 @@

     ;; Some basic moving head chases
     (let [triangle-phrase (params/build-oscillated-param ; Move back and forth over a phrase
-                             (oscillators/triangle-phrase) :min -90 :max 90)
+                           (oscillators/triangle-phrase) :min -90 :max 90)
           staggered-triangle-bar (params/build-spatial-param ; Bounce over a bar, staggered across grid x
-                                   (show/all-fixtures)
-                                   (fn [head]
-                                     (params/build-oscillated-param
-                                      (oscillators/triangle-bar :phase (x-phase head *show*))
-                                      :min -90 :max 0)))
+                                  (show/all-fixtures)
+                                  (fn [head]
+                                    (params/build-oscillated-param
+                                     (oscillators/triangle-bar :phase (x-phase head *show*))
+                                     :min -90 :max 0)))
           can-can-dir (params/build-pan-tilt-param :pan triangle-phrase :tilt staggered-triangle-bar)]
       (ct/set-cue! (:cue-grid *show*) 0 9
                    (cues/cue :movement (fn [var-map]
@@ -670,9 +677,9 @@

     ;; A couple snowball cues
     (ct/set-cue! (:cue-grid *show*) 0 10 (cues/function-cue :sb-pos :beams-fixed (show/fixtures-named "snowball")
-                                                             :effect-name "Snowball Fixed"))
+                                                            :effect-name "Snowball Fixed"))
     (ct/set-cue! (:cue-grid *show*) 1 10 (cues/function-cue :sb-pos :beams-moving (show/fixtures-named "snowball")
-                                                             :effect-name "Snowball Moving"))
+                                                            :effect-name "Snowball Moving"))

     ;; The separate page of specific gobo cues for each Torrent
     (make-torrent-gobo-cues :t1 (show/fixtures-named "torrent-1") 15 8)
@@ -684,8 +691,8 @@
                                           (move/direction-effect
                                            "Pan/Tilt"
                                            (params/build-pan-tilt-param :pan (:pan var-map 0.0)
-                                                                         :tilt (:tilt var-map 0.0)
-                                                                         :degrees true)
+                                                                        :tilt (:tilt var-map 0.0)
+                                                                        :degrees true)
                                            (show/all-fixtures)))
                            :variables [{:key "pan" :name "Pan"
                                         :min -180.0 :max 180.0 :start 0.0 :centered true :resolution 0.5}


remove unneeded comment

remove unneeded comment

--- src/babel/francais/morphology/verbs.clj
+++ src/babel/francais/morphology/verbs.clj
@@ -320,7 +320,6 @@
      :else
      (throw (Exception. (str "get-string: present regular inflection: don't know what to do with input argument: " (strip-refs word) " (er-type: " er-type "; ir-type: " ir-type "; re-type: " re-type))))))

-;; pass'e compos'e begins here
 (defn passe-compose [word]
   (let [infinitive (get-in word '(:français))
         er-type (re-find #"[ée]r$" infinitive) ;; c.f. italiano -are


Implement a starting offset option

Implement a starting offset option

- from a number
- from a passed function of the DOM node
- from anything else (produces 0)

In addition there is a seam for adding by a string representing a
percentage of the height of the node. But the parsing code has not
been written yet.

--- src/cljs/comic_reader/ui/waypoints.cljs
+++ src/cljs/comic_reader/ui/waypoints.cljs
@@ -4,9 +4,22 @@

 (def ^:private waypoints (atom {}))

-(defn get-node-position-at-offset [node offset]
-  (let [rect (.getBoundingClientRect node)]
-    (+ (.-top rect) (.-pageYOffset js/window))))
+(defn- as-percentage [offset]
+  0)
+
+(defn- get-offset-position [node offset]
+  (cond
+    (number? offset)    offset
+    (string? offset)    (as-percentage node offset)
+    (function? offset)  (offset node)
+    :else               0))
+
+(defn- get-node-position-at-offset [node offset]
+  (let [offset-position (get-offset-position node offset)
+        rect (.getBoundingClientRect node)]
+    (+ (.-top rect)
+       (.-pageYOffset js/window)
+       offset-position)))

 (defn- make-reset-trigger-point [waypoints id options]
   (fn [this]


get-pos helper

get-pos helper

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -52,3 +52,13 @@

 (defn set-texture! [sprite tex]
   (.setTexture sprite tex))
+
+
+(defn get-pos
+  "return the position of sprite as a vec2.
+  optionally pass in an x and y offset to add
+  to the returned vector
+  "
+  [sprite & [offest-x offset-y]]
+  (vec2/vec2 (+ (or offset-x 0) (.-position.x sprite))
+             (+ (or offset-y 0) (.-position.y sprite))))


fix no help on startup with no action bug

--- src/clojure/zensols/actioncli/parse.clj
+++ src/clojure/zensols/actioncli/parse.clj
@@ -92,117 +92,9 @@
                          (s/join "|")
                          (format " <%s>"))))))))

-(defn multi-action-context
-  "Create a multi-action context with map **action**.  These don't include the
-  name of the action on the command line and are typical UNIX like command
-  lines (ex: `ls`, `grep`, etc).
-
-  The parameter is **action** is a list of list of symbols takes the form:
-```
-'((:action-name1 package1 action1)
-  ...)
-```
-  where **action-name** is a key, **package** is the package and **action** is
-  the action definition.
-
-Keys
-----
-* **help-option:** the help action command, which defaults to [[help-option]]
-* **version-option:** usually created with [[version-option]]
-* **global-actions:** addition global actions in addition to the help and
-  version options listed above
-* **action-print-order:** an optional sequence of action name keys indicating
-  what order to print action help
-* **print-help-fn:** an optional function that takes a string argument of the
-  generated option help to provide a way to customize the help message
-* **usage-format-fn:** generate the usage portion of the help message that
-  takes the names of all action if generating multi-action usage or nil for
-  single action usage messages"
-  [actions &
-   {:keys [global-actions help-option version-option
-           action-print-order print-help-fn usage-format-fn]
-    :or {help-option (help-option)}}]
-  (merge (if action-print-order {:action-print-order action-print-order})
-         (if print-help-fn {:print-help-fn print-help-fn})
-         {:usage-format-fn (or usage-format-fn (create-default-usage-format))}
-         {:action-definitions actions
-          :global-actions (concat global-actions
-                                  (if help-option [help-option])
-                                  (if version-option [version-option]))
-          :action-mode 'multi}))
-
-(defn single-action-context
-  "Create a single action context with map **action**.  These don't include the
-  name of the action on the command line and are typical UNIX like command
-  lines (ex: `ls`, `grep`, etc).
-
-  The parameter is **action** is a list of symbols that takes the form:
-```
-'(package action)
-```
-  where **package** is the package and **action** is the action definition.
-
-  See [[multi-action-context]] for the description of **options**."
-  [action & options]
-  (-> (cons :single-action action)
-      list
-      (#(apply multi-action-context % options))
-      (merge {:action-mode 'single})))
-
-(defn create-actions [action-context]
-  (->> (:action-definitions action-context)
-       (map (fn [[key package action-def]]
-              (eval (list 'require `(quote [~package])))
-              {key (-> (format "%s/%s" package action-def)
-                       symbol
-                       eval
-                       (assoc :name (name key)))}))
-       (apply merge)))
-
-(defn- execute-action [key opts args]
-  (let [action (:app (get (create-actions) key))]
-    (apply action opts args)))
-
-(defn handle-exception
-  "Handle exceptions thrown from CLI actions."
-  [e]
-  (log/debugf "handle exception: <%s>" e)
-  (let [msg (.getMessage e)]
-    (if *log-error* (log/error e "action line parse error"))
-    (if (instance? java.io.FileNotFoundException e)
-      (binding [*out* *err*]
-        (println (format "%sio error: %s" (program-fmt) msg)))
-      (binding [*out* *err*]
-        (println (format "%serror: %s"
-                         (program-fmt)
-                         (if ex-data
-                           (.getMessage e)
-                           (.toString e)))))))
-  (log/debugf "dumping JVM: %s, rethrow: %s"
-              *dump-jvm-on-error* *rethrow-error*)
-  (if *dump-jvm-on-error*
-    (System/exit 1)
-    (if *rethrow-error* (throw e))))
-
-(defmacro with-exception
-  "Wrap a CLI forms in a `try` and call [[handle-exception]] if an exception
-  occurs."
-  {:style/indent 0}
-  [& forms]
-  (let [ex (gensym)]
-    `(try
-       ~@forms
-       (catch Exception ~ex
-         (handle-exception ~ex)))))
-
-(defn error-msg
-  "Print every element of the sequence **errors**.  If there **errors** is a
-  singleton then only print one in the common usage format."
-  [errors]
-  (if (= (count errors) 1)
-    (str (program-fmt) (first errors))
-    (str "The following errors occurred while parsing your action:\n\n"
-         (s/join \newline errors))))
+(defn- action-keys [action-context]
+  (or (:action-print-order action-context)
+      (map first (:action-definitions action-context))))

 (defn- action-help
   ([{:keys [name] :as action} skip-action-name?]
@@ -213,10 +105,6 @@
         description
         (if-not (empty? options) \newline)
         (:summary (cli/parse-opts nil options)))))
-
-(defn- action-keys [action-context]
-  (or (:action-print-order action-context)
-      (map first (:action-definitions action-context))))

 (defn help-message
   "Generate the help message text and return it.
@@ -248,6 +136,125 @@
                  (s/join (str \newline\newline))))
           ((or print-help-fn identity))))))

+(defn multi-action-context
+  "Create a multi-action context with map **action**.  These don't include the
+  name of the action on the command line and are typical UNIX like command
+  lines (ex: `ls`, `grep`, etc).
+
+  The parameter is **action** is a list of list of symbols takes the form:
+```
+'((:action-name1 package1 action1)
+  ...)
+```
+  where **action-name** is a key, **package** is the package and **action** is
+  the action definition.
+
+Keys
+----
+* **help-option:** the help action command, which defaults to [[help-option]]
+* **version-option:** usually created with [[version-option]]
+* **global-actions:** addition global actions in addition to the help and
+  version options listed above
+* **action-print-order:** an optional sequence of action name keys indicating
+  what order to print action help
+* **print-help-fn:** an optional function that takes a string argument of the
+  generated option help to provide a way to customize the help message
+* **usage-format-fn:** generate the usage portion of the help message that
+  takes the names of all action if generating multi-action usage or nil for
+  single action usage messages
+* **:no-action-fn** a function to call when no action is given, defaults to
+  printing the contents of [[help-message]]; set to `nil` to continue
+  processing without an action"
+  [actions &
+   {:keys [global-actions help-option version-option
+           action-print-order print-help-fn usage-format-fn
+           no-action-fn]
+    :or {help-option (help-option)
+         no-action-fn (fn [] (println (help-message)))}}]
+  (merge (if action-print-order {:action-print-order action-print-order})
+         (if print-help-fn {:print-help-fn print-help-fn})
+         {:usage-format-fn (or usage-format-fn (create-default-usage-format))}
+         {:action-definitions actions
+          :global-actions (concat global-actions
+                                  (if help-option [help-option])
+                                  (if version-option [version-option]))
+
+          :no-action-fn no-action-fn
+          :action-mode 'multi}))
+
+(defn single-action-context
+  "Create a single action context with map **action**.  These don't include the
+  name of the action on the command line and are typical UNIX like command
+  lines (ex: `ls`, `grep`, etc).
+
+  The parameter is **action** is a list of symbols that takes the form:
+```
+'(package action)
+```
+  where **package** is the package and **action** is the action definition.
+
+  See [[multi-action-context]] for the description of **options**."
+  [action & options]
+  (-> (cons :single-action action)
+      list
+      (#(apply multi-action-context % options))
+      (merge {:action-mode 'single})))
+
+(defn create-actions [action-context]
+  (->> (:action-definitions action-context)
+       (map (fn [[key package action-def]]
+              (eval (list 'require `(quote [~package])))
+              {key (-> (format "%s/%s" package action-def)
+                       symbol
+                       eval
+                       (assoc :name (name key)))}))
+       (apply merge)))
+
+(defn- execute-action [key opts args]
+  (let [action (:app (get (create-actions) key))]
+    (apply action opts args)))
+
+(defn handle-exception
+  "Handle exceptions thrown from CLI actions."
+  [e]
+  (log/debugf "handle exception: <%s>" e)
+  (let [msg (.getMessage e)]
+    (if *log-error* (log/error e "action line parse error"))
+    (if (instance? java.io.FileNotFoundException e)
+      (binding [*out* *err*]
+        (println (format "%sio error: %s" (program-fmt) msg)))
+      (binding [*out* *err*]
+        (println (format "%serror: %s"
+                         (program-fmt)
+                         (if ex-data
+                           (.getMessage e)
+                           (.toString e)))))))
+  (log/debugf "dumping JVM: %s, rethrow: %s"
+              *dump-jvm-on-error* *rethrow-error*)
+  (if *dump-jvm-on-error*
+    (System/exit 1)
+    (if *rethrow-error* (throw e))))
+
+(defmacro with-exception
+  "Wrap a CLI forms in a `try` and call [[handle-exception]] if an exception
+  occurs."
+  {:style/indent 0}
+  [& forms]
+  (let [ex (gensym)]
+    `(try
+       ~@forms
+       (catch Exception ~ex
+         (handle-exception ~ex)))))
+
+(defn error-msg
+  "Print every element of the sequence **errors**.  If there **errors** is a
+  singleton then only print one in the common usage format."
+  [errors]
+  (if (= (count errors) 1)
+    (str (program-fmt) (first errors))
+    (str "The following errors occurred while parsing your action:\n\n"
+         (s/join \newline errors))))
+
 (defn- parse-single [action-context actions action action-key
                      arguments single-action-mode?
                      & {:keys [print-errors?]
@@ -257,7 +264,8 @@
         (cli/parse-opts arguments option-defs)
         errors (if action
                  errors
-                 (cons (format "No such action: %s" (name action-key))
+                 (cons (if action-key
+                         (format "No such action: %s" (name action-key)))
                        errors))]
     (binding [*parse-context* {:action-context action-context
                                :actions actions
@@ -283,8 +291,15 @@
 (defn- parse-multi [action-context actions arguments]
   (let [action-keys (action-keys action-context)
         action-key (keyword (first arguments))
-        action (get actions action-key)]
-    (parse-single action-context actions action action-key (rest arguments) false)))
+        action (get actions action-key)
+        {:keys [no-action-fn]} action-context]
+    (if (and (nil? action) no-action-fn)
+      (binding [*parse-context* {:action-context action-context
+                                 :actions actions
+                                 :argument arguments
+                                 :single-action-mode? false}]
+        (no-action-fn))
+      (parse-single action-context actions action action-key (rest arguments) false))))

 (defn- parse-global [action-context actions arguments]
   (let [{:keys [global-actions]} action-context]


working on inner trace recur

working on inner trace recur

--- src/com/billpiel/sayid/inner_trace3.clj
+++ src/com/billpiel/sayid/inner_trace3.clj
@@ -333,6 +333,33 @@
   (or (meta form)
       (-> form first meta)))

+(defn tr-recur
+  [template tree-atom & args]
+
+  )
+
+(defn xpand-recur-form
+  [[_ & form] path-sym]
+  `(tr-recur ~path-sym
+             ~'$$
+             ~@form))
+
+(defn xpand-recur
+  [form src-map fn-meta path path-parent]
+  (let [xmap (xpand-all form
+                        src-map
+                        fn-meta
+                        path
+                        path-parent)]
+    (layer-xpansion-maps xmap
+                         {:path-parents {path path-parent}
+                          :templates {path (mk-tree-template src-map
+                                                             (get-form-meta-somehow form)
+                                                             fn-meta
+                                                             path)}
+                          :form (xpand-recur-form (:form xmap)
+                                               (path->sym path))})))
+
 (defn tr-if-ret
   [template tree-atom v]
   (-> (produce-recent-tree-atom! (:inner-path template)
@@ -429,6 +456,7 @@
       (let [head (first form)]
         (cond
           false "TODO"
+          (= 'recur head) (apply xpand-recur args)
           (= 'if head) (apply xpand-if args)
           :else (apply xpand-fn head args)))

@@ -540,26 +568,10 @@

 (defn f1
   [a]
-  (if true
-    (inc a)
+  (if (< a 2)
+    (recur (inc a))
     a))

-#_(let [$paths {:... :...}
-        $0-0-inc (partial tr-fn {:... :...} $paths)]
-    (fn [a]
-      (let [$$ (atom [])
-            $return ($0-0-inc inc $$ a)]
-        (record-trace-tree! $$)
-        $return)))
-
-#_(let [$paths {:... :...}
-        $0-0-inc {:paths $paths
-                  :template {:... :...}}]
-    (fn [a]
-      (let [$$ (atom [])
-            $return (tr-fn $0-0-inc $$ inc a)]
-        (record-trace-tree! $$)
-        $return)))

 #_ (inner-tracer {:qual-sym 'com.billpiel.sayid.inner-trace3/f1
                   :meta' {:ns 'com.billpiel.sayid.inner-trace3


minor style fixes

minor style fixes

--- src/ctia/lib/es/document.clj
+++ src/ctia/lib/es/document.clj
@@ -1,6 +1,5 @@
 (ns ctia.lib.es.document
   (:require
-   [clojure.string :as str]
    [ctia.lib.es.query :refer [filter-map->terms-query]]
    [clojurewerkz.elastisch.native.document :as native-document]
    [clojurewerkz.elastisch.rest.document :as rest-document]


add gauges

add gauges

--- src/de/otto/tesla/stateful/metering.clj
+++ src/de/otto/tesla/stateful/metering.clj
@@ -4,6 +4,7 @@
     [metrics.core :as metrics]
     [metrics.timers :as timers]
     [metrics.counters :as counters]
+    [metrics.gauges :as gauges]
     [metrics.reporters.graphite :as graphite]
     [metrics.reporters.console :as console]
     [clojure.tools.logging :as log])
@@ -75,4 +76,9 @@
 (defn counter! [self name]
   (counters/counter (:registry self) name))

+;; dito
+(defn gauge! [self gauge-callback-fn name]
+     (gauges/gauge-fn (:registry self) name gauge-callback-fn))
+
+
 (defn new-metering [] (map->Metering {}))


Include new view to devcards

Include new view to devcards

--- src/devcards/discuss/devcards/core.cljs
+++ src/devcards/discuss/devcards/core.cljs
@@ -49,6 +49,11 @@
             ref/usages-view
             lib/app-state)

+(defcard-om agree-disagree-reference
+            "Choose your opinion."
+            ref/agree-disagree-view
+            lib/app-state)
+
 (deftest find-tests
          "Testing the small search engine in `discuss.find`"
          (testing "fn statement, sending request and counting results"


Updated metadata_reader.clj

Updated metadata_reader.clj

--- src/emender_jenkins/metadata_reader.clj
+++ src/emender_jenkins/metadata_reader.clj
@@ -12,7 +12,7 @@

 (ns emender-jenkins.metadata-reader)

-(require '[emender-jenkins.jenkins-api :as jenkins-api])
+(require '[clj-jenkins-api.jenkins-api :as jenkins-api])

 (def GuideStatisticResultNames {
     :commiters-list                   "results.GuideStatistic.Commiters.freq"


Substitute {} for missing :params in validate-against-schema

Not doing so causes (not (map? nil)) validation problems in the absence
of :params even when all the keys in the schema are optional.

--- src/io/aviso/rook/schema_validation.clj
+++ src/io/aviso/rook/schema_validation.clj
@@ -71,7 +71,7 @@
   - on failure, the tuple is `[failures]`, where failures are as output from Schema validation"
   [request schema]
   (let [coercer (coerce/coercer schema string-coercion-matcher)
-        params' (-> request :params coercer)]
+        params' (-> request :params (or {}) coercer)]
     (if (su/error? params')
       [(su/error-val params')]
       [nil (assoc request :params params')])))


Add support for items in level

Add support for items in level

--- src/dungeon_crusade/main.clj
+++ src/dungeon_crusade/main.clj
@@ -10,23 +10,36 @@
        (alter-meta! (var ~fn-name) assoc :source (quote ~&form))
        (var ~fn-name)))

-(defn ascii-to-place [ascii]
-  (let [char-to-cell (fn [c]
-    (case c
-      \| {:type :vertical-wall}
-      \- {:type :horizontal-wall}
-      \. {:type :floor}
-      \+ {:type :door-closed}
-      \# {:type :corridor}
-      nil))]
-    (vec (map (fn [line] (vec (map char-to-cell line))) ascii))))
+(defn ascii-to-place [ascii extras]
+  "ascii: an ascii representatin of the place
+   extra: a list of [[k & ks] v] where the first element is a list of keys
+          to assoc-in the place, and the second is the value to associate"
+  (let [
+    char-to-cell (fn [c]
+      (case c
+        \| {:type :vertical-wall}
+        \- {:type :horizontal-wall}
+        \. {:type :floor}
+        \+ {:type :door-closed}
+        \# {:type :corridor}
+        nil))
+    ;; convert ascii to place
+    setting (vec (map (fn [line] (vec (map char-to-cell line))) ascii))
+    ;; add in extras like items, monsters, etc.
+    ;; create a list of functions that can be applied to assoc extras, then create a composition of
+    ;; so that setting can pass through each fn in turn.
+    place ((apply comp (map (fn [e] (partial (fn [e s] (apply assoc-in s e)) e)) extras)) setting)]
+    (println "setting" setting)
+    (println "place" place)
+    place))

 (defn init-place-0 []
   (ascii-to-place
     ["----   ----"
      "|..+## |..|"
      "|..| ##+..|"
-     "----   ----"]))
+     "----   ----"]
+    [[[1 9 :items] [{:type :ring :name "Ring of Power"}]]]))

 (defn init-world []
   {:places {:0 (init-place-0)}
@@ -57,7 +70,7 @@
   (mapcat concat (map-indexed (fn [y line] (map-indexed (fn [x cell] [cell x y]) line)) place)))

 (defn map-with-xy [f place]
-  (dorun
+  (doall
     (map (fn [e] (apply f e)) (with-xy place))))

 (defn get-xy [x y place]
@@ -187,20 +200,39 @@

 (defn render [state]
   (do
+    (println "render")
     (s/clear (state :screen))
     ;; draw map
+    (println "map-with-xy")
     (map-with-xy
       (fn [cell x y]
-        (when cell
-          (let [outchar (case (cell :type)
-            :vertical-wall   ["|"]
-            :horizontal-wall ["-"]
-            :floor           ["."]
-            :door-open       ["+" {:fg :red :styles #{:bold}}]
-            :door-closed     ["+" {:fg :black :bg :red :styles #{:bold}}]
-            :corridor        ["#"]
-            ["?"])]
-            (apply s/put-string (state :screen) x y outchar))))
+        (println cell x y)
+        (when (not (nil? cell))
+          (let [cell-items (cell :items)
+                out-char (if (not (nil? cell-items))
+                           (case :ring
+                             :ring           ["="]
+                             :food           ["%"]
+                             :bow            [")"]
+                             :sword          [")"]
+                             :armor          ["["]
+                             :shoes          ["!"]
+                             :wand           ["/"]
+                             :spellbook      ["+"]
+                             :scroll         ["?"]
+                             :coins          ["$" {:fg :yellow :styles #{:bold}}]
+                             :amulet         ["\"" {:fg :blue :styles #{:bold}}]
+                             ["?"])
+                           (case (cell :type)
+                            :vertical-wall   ["|"]
+                            :horizontal-wall ["-"]
+                            :floor           ["."]
+                            :door-open       ["+" {:fg :red :styles #{:bold}}]
+                            :door-closed     ["+" {:fg :black :bg :red :styles #{:bold}}]
+                            :corridor        ["#"]
+                            ["?"]))]
+            (apply s/put-string (state :screen) x y out-char))))
+
       (current-place state))
     ;; draw character
     (println (-> state :world :player))


Rotate sequence problem added

Rotate sequence problem added

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -434,7 +434,19 @@
             :title "Reverse Interleave"
             :times-solved 0
             :description "Write a function which reverses the interleave process into x number of subsequences."
-            :tags ["medium" "seq"]
+            :tags ["medium" "seqs"]
             :tests ["(= (__ [1 2 3 4 5 6] 2) '((1 3 5) (2 4 6)))"
 		    "(= (__ (range 9) 3) '((0 3 6) (1 4 7) (2 5 8)))"]
-	    :secret-tests ["(= (__ (range 10) 5) '((0 5) (1 6) (2 7) (3 8) (4 9)))"]})))+	    :secret-tests ["(= (__ (range 10) 5) '((0 5) (1 6) (2 7) (3 8) (4 9)))"]})
+
+    (insert! :problems
+           {:_id 44
+            :title "Rotate Sequence"
+            :times-solved 0
+            :description "Write a function which can rotate a sequence in either direction."
+            :tags ["medium" "seqs"]
+            :tests ["(= (__ 2 [1 2 3 4 5]) '(3 4 5 1 2))"
+		    "(= (__ -2 [1 2 3 4 5]) '(4 5 1 2 3))"
+		    "(= (__ 6 [1 2 3 4 5]) '(2 3 4 5 1))"]
+	    :secret-tests ["(= (__ 1 '(:a :b :c)) '(:b :c :a))"
+			   "(= (__ -4 '(:a :b :c)) '(:c :a :b))"]})))


Use cond-> instead of let + if

Use cond-> instead of let + if

--- src/github_changelog/git.clj
+++ src/github_changelog/git.clj
@@ -21,16 +21,16 @@
       (git/git-clone uri dir))))

 (defn- refresh [^Repository repo]
-  (git/git-fetch-all repo))
+  (git/git-fetch-all repo)
+  repo)

 (defn clone [{:keys [git-url dir update?]
               :or   {git-url (gen-url config)
                      dir     (git-path git-url)
                      update? true}
               :as config}]
-  (let [repo (clone-or-load git-url dir)]
-    (if update? (refresh repo))
-    repo))
+  (cond-> (clone-or-load git-url dir)
+    update? refresh))

 (defn- get-merge-sha [^Repository repo ^Ref tag]
   (let [peeled (.peel repo tag)]


Normalise example

Normalise example

--- src/grafter/csv_examples.clj
+++ src/grafter/csv_examples.clj
@@ -1,19 +1,22 @@
 (ns grafter.csv-examples
   (:use [grafter.csv]))

-(def my-csv (parse-csv "./examples/high-earners-pay-2012.csv"))
-
-(-> (parse-csv "./examples/high-earners-pay-2012.csv")
-    (grep "John" 2)
-    (fuse #(str %1 " " %2) 2 1)
-    (columns 2 1 7)
-    (rows 1 10))
-
+(defn csv-example []
+  (-> (parse-csv "./examples/high-earners-pay-2012.csv")
+      (grep "John" 2)
+      (fuse #(str %1 " " %2) 2 1)
+      (columns 2 1 7)
+      (rows 1 10)))

 ;; composition of pipelines
-(-> (-> (parse-csv "./examples/high-earners-pay-2012.csv")
-        (grep "John" 2)
-        (fuse #(str %1 " " %2) 2 1)
-        (columns 2 1 7)
-        (rows 1 10))
-    (rows 0 1))
+(defn pipeline-composition-example []
+  (-> (-> (parse-csv "./examples/high-earners-pay-2012.csv")
+          (grep "John" 2)
+          (fuse #(str %1 " " %2) 2 1)
+          (columns 2 1 7)
+          (rows 1 10))
+      (rows 0 1)))
+
+(defn normalise-example []
+  (-> (parse-csv "./test-data/Hampshire-DataPack-Health-v1/aac_tot_count-Table 1.csv")
+      (normalise [3 46])))


Quieten the organ slightly (compared to TTS).

--- src/kolmogorov_music/geb.clj
+++ src/kolmogorov_music/geb.clj
@@ -43,7 +43,7 @@
   )

 ; Instrumentation
-(definst overchauffeur [freq 110 dur 1.0 top 1500 vol 0.3]
+(definst overchauffeur [freq 110 dur 1.0 top 1500 vol 0.25]
   (-> (sin-osc freq)
       (+ (* 1/3 (sin-osc (* 2.01 freq))))
       (+ (* 1/2 (sin-osc (* 3.01 freq))))


bug fix for not existing paths

bug fix for not existing paths

--- src/leiningen/namespaces.clj
+++ src/leiningen/namespaces.clj
@@ -217,16 +217,17 @@
    (keys projects)
    (take (count projects) (repeat initial-value))))

-(defn md5-hash [path]
-  (d/digest "md5" (io/as-file path)))
+(defn md5-hash
+  ([paths] (str/join "|" (map #(md5-hash % 6) paths)))
+  ([path length]
+   (let [hash-value (d/digest "md5" (io/as-file path))
+         hash-length (dec (count hash-value))]
+     (subs hash-value (max 0 (- hash-length length)) hash-length))))

 (defn project-occurence-render [paths project]
-  (let [hash-value (str/join "|" (map md5-hash paths))
-        hash-length (dec (count hash-value))
-        short-hash-value (subs hash-value (- hash-length 5) hash-length)]
-    (if (empty? paths)
-      {project (str "O " short-hash-value)}
-      {project short-hash-value})))
+  (if (empty? paths)
+    {project (str "O ")}
+    {project (md5-hash paths)}))

 (defn resource-occurence [resource project project-desc render]
   (let [paths (concat (resource->target-path resource (name project) project-desc)
@@ -256,7 +257,7 @@
   (if (= selector namespace-def)
     (let [name-segments (str/split (name k) #"\.")]
       {:package (str/join "." (drop-last name-segments))
-       :name (last name-segments)})
+       :name    (last name-segments)})
     {:name (name k)}))

 (defn ->pretty-print-structure [data selector]
@@ -270,7 +271,7 @@
 (defn log-resouces-table [m resource-name]
   (m/info "\n* List of" resource-name)
   (m/info "     - hash-value (.i.e a3d66)  :  the namespace/resource is defined in the project.clj")
-  (m/info "     - O  :                     :  the namespace/resource does not exist in the project")
+  (m/info "     - X  :                     :  the namespace/resource does not exist in the project")
   (pp/print-table (sort-by :name m))
   (m/info "\n"))


Layout tweaks

Layout tweaks

- logo should be to the right
- copyright should not have a year
- date should be in smaller font

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -527,7 +527,7 @@
        (mapcat #(format-sexp (get subitems %) % 1 path-to-numbers false) (keys subitems))])]])

 (defn- logo []
-  [:fo:block {:space-before "110mm"}
+  [:fo:block {:space-before "100mm" :text-align "right" :end-indent "20mm"}
    [:fo:external-graphic
     {:src (io/resource "images/sbs_logo.jpg")
      :height "35mm"
@@ -535,7 +535,7 @@
      :content-width "scale-to-fit"
      :content-height "scale-to-fit"}]])

-(defn- impressum [date]
+(defn- impressum []
   (let [creator "SBS Schweizerische Bibliothek für Blinde, Seh- und Lesebehinderte"]
     [:fo:block-container {:space-before "10mm"}
      (block "Herausgeber:")
@@ -546,14 +546,15 @@
      (block "Fax +41 43 333 32 33")
      (block (external-link "http://www.sbs.ch" "www.sbs.ch"))
      (block (external-link "mailto:nutzerservice@sbs.ch" "nutzerservice@sbs.ch"))
-     (block (format "© %s %s" (layout/year date) creator))]))
+     (block {:space-before "5mm"} (format "© %s" creator))]))

 (defn- cover-page [titles date]
   [:fo:block-container
-   (map #(block (style :h1 {:break-before "auto" :space-after "5pt"}) %)
-        (concat titles [(format "Stand 1.1.%s" (layout/year date))]))
+   (map #(block (style :h1 {:break-before "auto" :space-after "5pt"}) %) titles)
+   (block (style :h2 {:break-before "auto" :space-after "5pt"})
+          (format "Gesamtkatalog, Stand 1.1.%s" (layout/year date)))
    (logo)
-   (impressum date)])
+   (impressum)])

 (defmethod document-sexp :hörfilm
   [items fmt _ _ {:keys [description date]
@@ -573,8 +574,7 @@
     (let [subitems (get items fmt)]
       [:fo:flow {:flow-name "xsl-region-body"}
        (cover-page ["Hörfilme in der SBS"
-                    "Filme mit Audiodeskription"
-                    "Gesamtkatalog"]
+                    "Filme mit Audiodeskription"]
                    date)
        (block {:break-before "odd-page"}) ;; toc should start on recto
        (toc subitems [fmt] 1 nil :heading? true)
@@ -598,7 +598,13 @@

     (let [subitems (get items fmt)]
       [:fo:flow {:flow-name "xsl-region-body"}
-       (cover-page ["Spiele in der SBS" "Gesamtkatalog"]
+       (cover-page ["Spiele in der SBS"]
+                   date)
+       (block {:break-before "odd-page"}) ;; toc should start on recto
+       (toc subitems [fmt] 1 nil :heading? true)
+       (block {:break-before "odd-page"}) ;; the very first format should start on recto
+       (mapcat #(genre-sexp (get subitems %) fmt % 1) (keys subitems))])]])
+
                    date)
        (block {:break-before "odd-page"}) ;; toc should start on recto
        (toc subitems [fmt] 1 nil :heading? true)


fix messages indices

fix messages indices

--- src/ceres_collector/db.clj
+++ src/ceres_collector/db.clj
@@ -46,11 +46,11 @@
     (mc/ensure-index @db "refs" (array-map :ts 1))
     (mc/ensure-index @db "tags" (array-map :text 1))
     (mc/ensure-index @db "tags" (array-map :ts 1))
-    (mc/ensure-index @db "message" (array-map :ts 1))
-    (mc/ensure-index @db "message" (array-map :text 1))
-    (mc/ensure-index @db "message" (array-map :tweet 1))
-    (mc/ensure-index @db "message" (array-map :tid 1))
-    (mc/ensure-index @db "message" (array-map :ts 1))
+    (mc/ensure-index @db "messages" (array-map :ts 1))
+    (mc/ensure-index @db "messages" (array-map :text 1))
+    (mc/ensure-index @db "messages" (array-map :tweet 1))
+    (mc/ensure-index @db "messages" (array-map :tid 1))
+    (mc/ensure-index @db "messages" (array-map :ts 1))
     (mc/ensure-index @db "htmls" (array-map :ts 1))
     (mc/ensure-index @db "users" (array-map :id 1))
     (mc/ensure-index @db "users" (array-map :ts 1))


add grouping comments

add grouping comments

--- src/chat/server/invite.clj
+++ src/chat/server/invite.clj
@@ -33,6 +33,7 @@
     (do (timbre/warnf "Expired nonce %s for invite %s" nonce invite)
         {:error "Expired token"})))

+;; invite by email
 (defn make-email-invite-link
   [invite]
   (let [secret-nonce (random-nonce 20)]
@@ -121,6 +122,8 @@
                           (s3/grant :all-users :read))
     (str "https://s3.amazonaws.com/" (env :aws-domain) "/avatars/" avatar-filename)))

+;; reset paswords
+
 (defn request-reset
   [user]
   (let [secret (random-nonce 20)]


fix typo

fix typo

--- src/babel/francais/morphology/verbs.cljc
+++ src/babel/francais/morphology/verbs.cljc
@@ -1086,7 +1086,7 @@
     :merge-fn
     (fn [val]
       {:français {:infl :future
-                  :français (str (get-in val [:français :future-stem] "ont"))
+                  :français (str (get-in val [:français :future-stem]) "ont")
                   :conjugated true
                   :agr {:number :plur
                         :person :3rd}}})}


Update the log statement to match reality

--- src/circle/backend/git.clj
+++ src/circle/backend/git.clj
@@ -102,7 +102,7 @@
 (defn pull
   "Git pull an existing repo"
   [repo & {:keys [ssh-key]}]
-  (infof "git fetch %s" repo)
+  (infof "git pull %s" repo)
   (git-fn* (sh/q
             (git pull))
            :ssh-key ssh-key


Add schema for scenario hooks

Add schema for scenario hooks

--- src/clj_gatling/schema.clj
+++ src/clj_gatling/schema.clj
@@ -12,6 +12,8 @@
    (s/optional-key :context) (s/pred map?)
    (s/optional-key :skip-next-after-failure?) Boolean
    (s/optional-key :allow-early-termination?) Boolean
+   (s/optional-key :pre-hook) s/Any
+   (s/optional-key :post-hook) s/Any
    :steps [Step]})

 (def Scenario
@@ -20,6 +22,8 @@
    (s/optional-key :weight) s/Int
    (s/optional-key :skip-next-after-failure?) Boolean
    (s/optional-key :allow-early-termination?) Boolean
+   (s/optional-key :pre-hook) s/Any
+   (s/optional-key :post-hook) s/Any
    :steps [Step]})

 (def Simulation


Fixed modes

Fixed modes

--- src/cljs/guitar1/neck.cljs
+++ src/cljs/guitar1/neck.cljs
@@ -19,20 +19,30 @@
 ;; TODO - Move to core
 (defn contains [item coll] (some #{item} coll))

+(defn scale-nth
+  [scale n]
+  ;; (if (pos? n)
+  ;;   (recur (rest scale) (if (first scale)
+  ;;                         (- n 1)
+  ;;                         n))
+  ;;   (- 12 (count (rest scale))))
+  (nth [0 2 4 5 7 9 11] n))
+
 (def pairs (partial partition 2))
 (def chromatic [:A :A# :B :C :C# :D :D# :E :F :F# :G :G#])
 (def strings [:E :A :D :G :B :E])
 (def lydian
   '(true false true false true false true true false true false true))
+(def ionian
+  '(true false true false true true false true false true false true))
 (def pentatonic-minor
   '(true false false true false true false true false false true false))
-(def mode-names [:Lydian :Mixolydian :Aeolian :Locrian :Ionian :Dorian :Phrygian])
+(def mode-names [:Ionian :Dorian :Phrygian :Lydian :Mixolydian :Aeolian :Locrian])
 (defn mode
   [mode-name]
   (take 12
-        (subvec (into [] (take 24 (cycle lydian)))
-                ;; This is wrong. Needs to just ignore false ones.
-                (index-of mode-names mode-name))))
+        (subvec (into [] (take 24 (cycle ionian)))
+                (scale-nth ionian (index-of mode-names mode-name)))))

 (def modes (zipmap mode-names (map mode mode-names)))

@@ -76,13 +86,6 @@
   [key scale]
   [:div.neck
    [:button {:on-click #(set-scale pentatonic-minor)} "Pentatonic Minor"]
-   ;; [:button {:on-click #(set-scale lydian)} "Lydian"]
-   ;; [:button {:on-click #(set-scale mixolydian)} "Mixolydian"]
-   ;; [:button {:on-click #(set-scale aeolian)} "Aeolian"]
-   ;; [:button {:on-click #(set-scale locrian)} "Locrian"]
-   ;; [:button {:on-click #(set-scale ionian)} "Ionian"]
-   ;; [:button {:on-click #(set-scale dorian)} "Dorian"]
-   ;; [:button {:on-click #(set-scale phrygian)} "Phrygian"]
    (map (fn [mode] [:button {:on-click #(set-scale (mode modes))} (name mode)]) (keys modes))
    (conj (map build-string (reverse strings))
          [:ul.string.frets (map #(vector :li %) (into [] (range 24)))])])


Add data for all three naval units

Add data for all three naval units

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -352,7 +352,65 @@
             {:personnel 10
              :armored   10}
             :zoc
-            [:personnel :armored]}}}})
+            [:personnel :armored]}
+     ;; Naval
+     :frigate {:description "Frigate"
+               :cost 300
+               :movement 8
+               :can-capture false
+               :can-repair #{}
+               :min-range 1
+               :max-range 1
+               :armor-type :naval
+               :armor 8
+               :repair 1
+               :state-map :free-attack-twice
+               :image "tilesets/elite-command/units/frigate-COLOR.png"
+               :terrain-effects
+               {:sea           {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}
+                :shallow-water {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}}
+               :attack-strengths
+               {:personnel 9
+                :armored   9}
+               :zoc
+               [:personnel :armored]}
+     :destroyer {:description "Destroyer"
+                 :cost 600
+                 :movement 5
+                 :can-capture false
+                 :can-repair #{}
+                 :min-range 1
+                 :max-range 4
+                 :armor-type :naval
+                 :armor 12
+                 :repair 1
+                 :state-map :free-attack-twice
+                 :image "tilesets/elite-command/units/destroyer-COLOR.png"
+                 :terrain-effects
+                 {:sea {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}}
+                 :attack-strengths
+                 {:personnel 10
+                  :armored   12}
+                 :zoc
+                 [:personnel :armored]}
+     :cruiser {:description "Cruiser"
+               :cost 1000
+               :can-capture false
+               :can-repair #{}
+               :min-range 1
+               :max-range 3
+               :armor-type :naval
+               :armor 15
+               :repair 1
+               :state-map :move-attack
+               :image "tilesets/elite-command/units/cruiser-COLOR.png"
+               :terrain-effects
+               {:sea {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}}
+               :attack-strengths
+               {:personnel 14
+                :armored   16}
+               :zoc
+               [:personnel :armored]}}}})

 ;; TODO: remove redundant id keys (?)
 (def maps


Revert "Add `foreach-rdd`-wrapper, fixes #120"

--- src/clojure/flambo/api.clj
+++ src/clojure/flambo/api.clj
@@ -259,11 +259,6 @@
   [rdd f]
   (.foreachPartition rdd (void-function f)))

-(defn foreach-rdd
-  "Applies the function `f` to each rdd in `dstream`"
-  [dstream f]
-  (.foreachRDD dstream (void-function f)))
-
 (defn aggregate
   "Aggregates the elements of each partition, and then the results for all the partitions,
   using a given combine function and a neutral 'zero value'."


Consistent naming of msg parameter for neatness; _ for unused multimethod parameters.

--- src/cmemcached/handler.clj
+++ src/cmemcached/handler.clj
@@ -135,30 +135,29 @@
     "CLIENT_ERROR\r\n"))

 (defmethod handle-command "get"
-  [connectionid message _ _]
-  (println "HANDLE-COMMAND GET" (first message))
-  (if (seq message)
+  [connectionid msg _ _]
+  (if (seq msg)
     (if (and elasticache-auto-discovery?
-             (= "AmazonElastiCache:cluster" (first message)))
+             (= "AmazonElastiCache:cluster" (first msg)))
       (elasticache-auto-discovery-response)
-      (str (reduce (fn [s key] (str s (retrieve-item key false))) "" message) "END\r\n"))
+      (str (reduce (fn [s key] (str s (retrieve-item key false))) "" msg) "END\r\n"))
     "CLIENT_ERROR\r\n"))

 (defmethod handle-command "gets"
-  [connectionid message _ _]
-  (if (seq message)
-    (str (reduce (fn [s key] (str s (retrieve-item key true))) "" message) "END\r\n")))
+  [connectionid msg _ _]
+  (if (seq msg)
+    (str (reduce (fn [s key] (str s (retrieve-item key true))) "" msg) "END\r\n")))

 (defmethod handle-command "delete"
-  [connectionid message _ _]
-  (println "MESSAGE" message)
-  (if (= :deleted (persist/delete-item (first message)))
+  [connectionid msg _ _]
+  (println "MESSAGE" msg)
+  (if (= :deleted (persist/delete-item (first msg)))
       "DELETED\r\n"
       "NOT_FOUND\r\n"))

 (defmethod handle-command "cas"
-  [connectionid message data cmd]
-  (if-let [params (decode-params message cmd)]
+  [connectionid msg data cmd]
+  (if-let [params (decode-params msg cmd)]
     (with-hide-reply (:noreply params)
       (case (persist/check-and-set (:key params) (:flags params) (* (:exptime params) 1000) (:cas-unique params) data)
         :stored "STORED\r\n"
@@ -168,8 +167,8 @@
     "CLIENT_ERROR\r\n"))

 (defmethod handle-command "incr"
-  [connectionid message data cmd]
-  (if-let [params (decode-num-params message)]
+  [connectionid msg _ _]
+  (if-let [params (decode-num-params msg)]
     (with-hide-reply (:noreply params)
       (let [[result value] (persist/increment (:key params) (:value params))]
         (case result
@@ -180,8 +179,8 @@
     "CLIENT_ERROR\r\n"))

 (defmethod handle-command "decr"
-  [connectionid message data cmd]
-  (if-let [params (decode-num-params message)]
+  [connectionid msg _ _]
+  (if-let [params (decode-num-params msg)]
     (with-hide-reply (:noreply params)
       (let [[result value] (persist/decrement (:key params) (:value params))]
         (case result
@@ -192,8 +191,8 @@
     "CLIENT_ERROR\r\n"))

 (defmethod handle-command "touch"
-  [connectionid message data cmd]
-  (if-let [params (decode-num-params message)]
+  [connectionid msg _ _]
+  (if-let [params (decode-num-params msg)]
     (with-hide-reply (:noreply params)
       (if (= :touched (persist/touch (:key params) (* (:value params) 1000)))
         "TOUCHED\r\n"
@@ -202,23 +201,23 @@

 ;; Extensions for AWS ElastiCache...
 (defmethod handle-command "config"
-  [connectionid message data cmd]
-  (if (and (seq message)
+  [connectionid msg _ _]
+  (if (and (seq msg)
            elasticache-auto-discovery?
-           (= "get" (first message))
-           (= "cluster" (second message)))
+           (= "get" (first msg))
+           (= "cluster" (second msg)))
     (elasticache-auto-discovery-response)
-    "CLIENT_ERROR\r\n"))
+    "ERROR\r\n"))

 (defmethod handle-command :default
   [_ _ _ _]
   "ERROR\r\n")

 (defn handle-message
-  [message connectionid info]
-  (println "HANDLE-MESSAGE" message)
+  [msg connectionid info]
+  (println "HANDLE-MESSAGE" msg)
   (try
-    (let [lines (split message #"\r\n")
+    (let [lines (split msg #"\r\n")
           cmd-and-args (when (first lines) (split (first lines) #"\s+"))
           cmd (first cmd-and-args)
           args (rest cmd-and-args)


Updating to use cmr-transmit-libs new config.

--- src/cmr/indexer/system.clj
+++ src/cmr/indexer/system.clj
@@ -8,7 +8,8 @@
             [cmr.common.api.web-server :as web]
             [cmr.indexer.data.elasticsearch :as es]
             [cmr.common.cache :as cache]
-            [cmr.indexer.api.routes :as routes]))
+            [cmr.indexer.api.routes :as routes]
+            [cmr.transmit.config :as transmit-config]))

 (def
   ^{:doc "Defines the order to start the components."
@@ -18,11 +19,12 @@
 (defn create-system
   "Returns a new instance of the whole application."
   []
-  {:log (log/create-logger)
-   :db (es/create-elasticsearch-store)
-   :web (web/create-web-server 3004 routes/make-api)
-   :cache (cache/create-cache)
-   :zipkin (context/zipkin-config "Indexer" false)})
+  (let [sys {:log (log/create-logger)
+             :db (es/create-elasticsearch-store)
+             :web (web/create-web-server (transmit-config/indexer-port) routes/make-api)
+             :cache (cache/create-cache)
+             :zipkin (context/zipkin-config "Indexer" false)}]
+    (transmit-config/system-with-connections sys [:metadata-db :index-set])))

 (defn start
   "Performs side effects to initialize the system, acquire resources,


cleaning macro init

cleaning macro init

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -5,8 +5,8 @@
     ))

-;; (set! *warn-on-reflection* true)
-;; (set! *unchecked-math* :warn-on-boxed)
+(set! *warn-on-reflection* true)
+; (set! *unchecked-math* :warn-on-boxed)

 (defmacro expension-report
@@ -24,15 +24,6 @@
   [fct & args]
   (eval `(~fct ~@args)))

-#_(defmacro constexpr-2
-    [[fct & args]]
-    (list* fct (map (fn [a] `~a) args)))
-
-#_(defmacro defconstexpr
-    [name arguments body]
-    (println (str body))
-    `(defmacro ~name ~arguments
-       (constexpr ~body)))

 ;; --------------------------------------------------------
 ;; Example 1: equivalent with constexpr
@@ -84,10 +75,6 @@
     (report (add-inline 1 2))
     (report (add-m-3 1 2))

-    ;; Does not compile: cannot add symbols (explain this)
-    ;; (println (add-m x y))
-    ;; (println (add-m-2 x y))
-
     ;; This however works, thanks to eval or custom macro
     (report (add-inline x y))
     (report (add-m-3 x1 x2))
@@ -126,7 +113,6 @@
   []
   (let [coll [1 2 3 4]]
     (report (average coll))
-    ;; (println (average-m coll)) ;; Would not compile
     (report (average-m [1 2 3 4]))
     (report (my-average))
     (report my-average-2)
@@ -301,10 +287,24 @@
              (recur r2#))
            r#)))))

+(defn inlined-reduce
+  [coll]
+  (let*
+    [^java.util.Iterator iter33662 (. ^java.lang.Iterable coll iterator)]
+    (loop*
+      [r__33312__auto__ 0]
+      (if
+        (. iter33662 hasNext)
+        (let*
+          [h__33313__auto__ (. iter33662 next)
+           r2__33314__auto__ (+ r__33312__auto__ h__33313__auto__)]
+          (recur r2__33314__auto__))
+        r__33312__auto__))))
+
 (defn test-inline-reduce
   ;; TODO - We could do better and accept a form, not a lambda
   []
-  (let [coll (into [] (range 10))]
+  (let [coll (vec (range 10))]

     (report (compile-reducer
               +


Fix batches

Fix batches

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -115,12 +115,12 @@
   (cc/execute session
               (apply new-query-api/alter-table query-params)))

-;; (defn alter-keyspace
-;;   "Alters properties of an existing keyspace. The
-;;    supported properties are the same that for `create-keyspace`"
-;;   [^Session session & query-params]
-;;   (cc/execute session
-;;               (apply q/alter-keyspace-query query-params)))
+(defn alter-keyspace
+  "Alters properties of an existing keyspace. The
+   supported properties are the same that for `create-keyspace`"
+  [^Session session & query-params]
+  (cc/execute session
+              (apply new-query-api/alter-keyspace query-params)))

 ;;
 ;; DB Operations
@@ -136,25 +136,22 @@
   (cc/execute session
               (apply new-query-api/insert query-params)))

-;; (defn ^:private batch-query-from-
-;;   [table records]
-;;   (->> records
-;;        (map (comp (partial apply (partial new-query-api/insert table)) flatten vector))
-;;        (apply q/queries)))
-
-;; (defn insert-batch
-;;   "Performs a batch insert (inserts multiple records into a table at the same time).
-;;   To specify additional clauses for a record (such as where or using), wrap that record
-;;   and the clauses in a vector"
-;;   [^Session session table records]
-;;   (let [query-params (batch-query-from- table records)]
-;;     (cc/execute session (q/batch-query query-params))))
-
-;; (defn atomic-batch
-;;   "Executes a group of operations as an atomic batch (BEGIN BATCH ... APPLY BATCH)"
-;;   [^Session session & clauses]
-;;   (cc/execute session
-;;               (apply q/batch-query clauses)))
+
+(defn insert-batch
+  "Performs a batch insert (inserts multiple records into a table at the same time).
+  To specify additional clauses for a record (such as where or using), wrap that record
+  and the clauses in a vector"
+  [^Session session table records]
+  (println (new-query-api/batch
+               (apply
+                new-query-api/queries
+                (map #(new-query-api/insert table %) records))))
+  (cc/execute session
+              (new-query-api/batch
+               (apply
+                new-query-api/queries
+                (map #(new-query-api/insert table %) records)))))
+

 (defn update
   "Updates one or more columns for a given row in a table. The `where` clause


rules

rules

--- src/critter_cljs/core.cljs
+++ src/critter_cljs/core.cljs
@@ -7,8 +7,14 @@
 ;; define your app data so that it doesn't get over-written on reload

 (defn init-critters []
-    (let [names ["Slipper" "Allegra" "Squeaky" "Sarah Jane" "Totoro"]]
-        (map #(hash-map :name % :x (rand-int 500) :y (rand-int 500)) names)))
+    (let [names ["Slipper" "Allegra" "Squeaky" "Sarah Jane" "Totoro"
+        ]]
+        (map #(hash-map
+            :name %
+            :x (rand-int 500)
+            :y (rand-int 500)
+            :velocity {:r 0 :angle 0})
+        names)))

 (defonce app-state (atom {
     :critters (init-critters)
@@ -21,12 +27,19 @@

 (defn to-random-nearby [it]
     (let [{:keys [x y]} it]
-        (assoc it :x (+ (rand-center 5) x)
-                  :y (+ (rand-center 5) y))))
+        (assoc it :x (+ (rand-center 10) x)
+                  :y (+ (rand-center 10) y))))

-(defn center-of-points [ps]
-    {:x (mean (map :x ps))
-     :y (mean (map :y ps))})
+(defn mean-hash [xs xs-keys]
+    (reduce
+        (fn [coll k] (assoc coll k (mean (map k xs))))
+        {} xs-keys))
+
+(defn center-of-points [ps]
+    (mean-hash ps [:x :y]))
+
+(defn average-velocity [cs]
+    (mean-hash (map :velocity cs) [:r :angle]))

 (defn to-point-fn [f] (fn [a b]
     (assoc a :x (f (:x a) (:x b))
@@ -42,28 +55,79 @@

 (def add-point (to-point-fn +))
 (def subtract-point (to-point-fn -))
+(def gt-point (to-point-fn >))

 (defn abs-point [a]
-    assoc a :x (Math/abs (:x a))
-            :y (Math/abs (:y a)))
+    (assoc a :x (Math/abs (:x a))
+             :y (Math/abs (:y a))))

 (defn move-towards [r start end]
-    (let [angle (:angle (cartesian->polar (subtract-point start end)))
-          diff (polar->cartesian {:angle angle :r r})]
-        (subtract-point start diff)))
+    (let [  route       (cartesian->polar (subtract-point start end))
+            velocity    (assoc route :r (min (:r route) r))
+            with-v      (assoc start :velocity velocity)
+            diff        (polar->cartesian velocity)]
+        (subtract-point with-v diff)))

-(defn move-critters! []
-    (let [{:keys [width height critters]} @app-state
-          critter-target (center-of-points critters)
-          move-towards-target #(move-towards 10 % critter-target)
-          next-critters (map move-towards-target critters)]
+(defn critter-collision? [c1 c2]
+    (let [  diff            (abs-point (subtract-point c1 c2))
+            space           {:x 40 :y 40}
+            {:keys [x y]}   (gt-point space diff)]
+        (and (not= c1 c2) (and x y))))
+
+(defn exclude [x xs] (filter #(not= % x) xs))
+
+(defn rule-to-center [c cs]
+    (let [  other-critters  (exclude c cs)
+            other-center    (center-of-points other-critters)]
+        (move-towards 5 c other-center)))
+
+(defn rule-avoid-walls [c width height]
+    (let [  {:keys [x y]}   c]
+        (cond   (< x 0)         (assoc c :x 0)
+                (< y 0)         (assoc c :y 0)
+                (< width x)     (assoc c :x width)
+                (< height y)    (assoc c :y height)
+                :else c)))
+
+(defn rule-avoid-collisions [c cs]
+    (let [  collisions      (filter #(critter-collision? % c) cs)
+            collision-area  (center-of-points collisions)
+            no-collision?   (empty? collisions)]
+        (cond
+            no-collision? c
+            :else   (move-towards -10 c collision-area))))
+
+(defn rule-match-velocity [c cs]
+    (let [  other-critters  (exclude c cs)
+            avg-velocity    (average-velocity other-critters)
+            r               (:r avg-velocity)
+            velocity        (assoc avg-velocity :r (/ r 4))
+            with-v          (assoc c :velocity velocity)
+            diff            (polar->cartesian velocity)]
+        (subtract-point with-v diff)))
+
+(defn critter-destination [c state]
+    (let [  cs  (:critters state)]
+        (-> c
+            (rule-to-center cs)
+            (rule-avoid-walls (:width state) (:height state))
+            (rule-avoid-collisions cs)
+            (rule-match-velocity cs)
+            )))
+
+
+(defn move-critters! [state]
+    (let [  {:keys [width height critters]} state
+            next-critters (map #(critter-destination % state) critters)]
         (swap! app-state assoc :critters next-critters)))

 (defn app-loop! []
     (js/setTimeout (fn []
-        (move-critters!)
+        (move-critters! @app-state)
         (app-loop!))
     100))
+
+

 (defn translate [x y] (str "translate(" x "px," y "px)"))
@@ -74,7 +138,7 @@
 (defn module-critter [critter]
     (let [{:keys [x y]} critter]
         [:g.module-critter
-            {:style {:transition "transform 100ms"
+            {:style {:transition "transform 500ms"
                      :transform (translate x y)}}
             [:circle {:r 20 :style {:fill "brown"}}]]))


Fix code layout.

Fix code layout.

--- src/grafter/rdf/sesame.clj
+++ src/grafter/rdf/sesame.clj
@@ -527,8 +527,7 @@
                RDFFormat/NQUADS NQuadsParserFactory
                RDFFormat/TURTLE TurtleParserFactory
                RDFFormat/JSONLD RDFJSONParserFactory
-               RDFFormat/N3 N3ParserFactory
-               }
+               RDFFormat/N3 N3ParserFactory}
         parser-class (table format)]
     (if-not parser-class
       (throw (ex-info (str "Unsupported format: " (pr-str format)) {:type :unsupported-format})))


Remove defunct comments, rename type-system-type function

--- src/graphql_clj/parser.clj
+++ src/graphql_clj/parser.clj
@@ -36,7 +36,7 @@
 (defn- to-type-names [_ & args] {:type-names (mapv :type-name args)})
 (defn- to-list [_ arg] {:node-type :list :inner-type arg :kind :LIST})
 (defn- add-required [_ arg] (assoc arg :required true))
-(defn- to-document [_ & args] (group-by :section args))     ;; TODO deal with nil instead of empty vector, deal with fragments vs. fragment definitions
+(defn- to-document [_ & args] (group-by :section args))

 (defn- to-type-system-type [k & args]
   (-> (into {:node-type k} args)
@@ -53,7 +53,7 @@
     (assert name "fragment name is NULL for fragment-definition!")
     (assoc definition :node-type k :section :fragment-definitions)))

-(def type-system-type->kind
+(def node-type->kind
   {:type-definition      :OBJECT
    :input-definition     :INPUT_OBJECT
    :union-definition     :UNION
@@ -68,7 +68,7 @@
                         :enum-fields       :fields
                         :input-type-fields :fields
                         :directive-on-name :on})
-      (assoc :kind (get type-system-type->kind (:node-type definition)))))
+      (assoc :kind (get node-type->kind (:node-type definition)))))

 (def ^:private transformations
   "Map from transformation functions to tree tags.
@@ -82,7 +82,7 @@
    unwrap-name               #{:TypeName :ArgumentName :FieldName :VariableName :EnumValue}
    to-type                   #{:Query :Mutation}
    to-enum-type              #{:EnumTypeInt}
-   to-vec                    #{:SelectionSet :TypeFields :InputTypeFields :TypeFieldArguments :VariableDefinitions :Arguments :Directives :EnumFields} ;; TODO does selection-set really belong here?
+   to-vec                    #{:SelectionSet :TypeFields :InputTypeFields :TypeFieldArguments :VariableDefinitions :Arguments :Directives :EnumFields}
    parse-int                 #{:IntValue}
    parse-double              #{:FloatValue}
    parse-string              #{:StringValue}


Update new location of submission review utils

Signed-off-by: ivermac <cd640042a8f3b0ff08bacdf4feae34fdd495051d@gmail.com>

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -21,10 +21,10 @@
             [hatti.shared :as shared]
             [hatti.utils :refer [click-fn
                                  generate-html
-                                 hyphen->camel-case
-                                 review-status-map
-                                 get-submission-review-text
-                                 pending-status]]
+                                 hyphen->camel-case]]
+            [hatti.utils.submission-review :refer [review-status-map
+                                                   get-submission-review-text
+                                                   pending-status]]
             [chimera.core :refer [any?]]
             [cljsjs.slickgrid-with-deps]))


Add example usage comment which was tried and tested

--- src/holston/dataimport.clj
+++ src/holston/dataimport.clj
@@ -1,4 +1,6 @@
 ;; Used for CSV-import of a very special file-format
+;; Example usage:
+;; lein run -m holston.dataimport/import-data "/Users/auramo/Downloads/olusia.csv"

 (ns holston.dataimport
   (:require [clojure-csv.core :as csv]


Fixed arrows on live

Fixed arrows on live

--- src/hphelper/live/view.clj
+++ src/hphelper/live/view.clj
@@ -18,9 +18,9 @@
   [index]
   (str (name (key index))
        (if (> 0 (val index))
-         "⇑" ;; Up Arrow
+         "⇓" ;; Down Arrow
          (if (< 0 (val index))
-           "⇓" ;; Down Arrow
+           "⇑" ;; Up Arrow
            "⇒" ;; Right Arrow
            ))
        (Math/abs (val index))


updates jet to include websocket backpressure fix (#1538)

* updates jet to include websocket backpressure fix

* updates to waiter-patch jet version

--- waiter/project.clj
+++ waiter/project.clj
@@ -45,7 +45,7 @@
                  [io.grpc/grpc-core "1.20.0"
                   :exclusions [com.google.guava/guava]
                   :scope "test"]
-                 [twosigma/jet "0.7.10-20210727_221451-g7742bea"
+                 [twosigma/jet "0.7.10-20220331_163431-g5c2743a"
                   :exclusions [org.mortbay.jetty.alpn/alpn-boot]]
                  [twosigma/clj-http "1.0.2-20180124_201819-gcdf23e5"
                   :exclusions [commons-codec commons-io org.clojure/tools.reader potemkin slingshot]]


passing new / old source to compile-cljs-in-project, for cljx load

--- src/clj/rksm/cloxp_cljs/ns/internals.clj
+++ src/clj/rksm/cloxp_cljs/ns/internals.clj
@@ -249,8 +249,8 @@
           (spit file new-file-src)
           (if *compile?*
             (comp/compile-cljs-in-project
-             ns-name file
-             (.getCanonicalPath (io/file "."))
+             ns-name file (.getCanonicalPath (io/file "."))
+             new-file-src old-file-src
              (:compiler-env (ensure-default-cljs-env))))
           (analyze-cljs-ns! ns-name file))))

@@ -279,20 +279,21 @@

 (defn change-ns!
   [ns-name new-source & [write-to-file file]]
-  (if-let [old-src (sf/source-for-ns ns-name file #".cljs$")]
-    (do
-      (if write-to-file
-        (when-let [file (fm/find-file-for-ns-on-cp ns-name file)]
-          (spit file new-source)
-          (analyze-cljs-ns! ns-name file)
-          (if *compile?* (comp/compile-cljs-in-project
-                          ns-name file
-                          (.getCanonicalPath (io/file "."))
-                          (:compiler-env (ensure-default-cljs-env))))))
-      (let [diff (change-ns-in-runtime! ns-name new-source old-src file)
-            change (record-change-ns! ns-name new-source old-src diff)]
-        change))
-    (throw (Exception. (str "Cannot retrieve current source for " ns-name)))))
+  (let [file (fm/find-file-for-ns-on-cp ns-name file)]
+    (if-let [old-source (sf/source-for-ns ns-name file #".clj(x|s)$")]
+      (do
+        (if write-to-file
+          (when-let [file (fm/find-file-for-ns-on-cp ns-name file)]
+            (spit file new-source)
+            (analyze-cljs-ns! ns-name file)
+            (if *compile?* (comp/compile-cljs-in-project
+                            ns-name file (.getCanonicalPath (io/file "."))
+                            new-source old-source
+                            (:compiler-env (ensure-default-cljs-env))))))
+        (let [diff (change-ns-in-runtime! ns-name new-source old-source file)
+              change (record-change-ns! ns-name new-source old-source diff)]
+          change))
+      (throw (Exception. (str "Cannot retrieve current source for " ns-name))))))

 ; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Ignore ephemeral NFS files (#68)

Ignore ephemeral NFS files (#68)

* Ignore ephemeral .nfs files

* Dynamically bind ephemeral predicate fn

* Use regex + vector for extension

* Improve docstring

* Pass ephemeral? to list-files as optional argument

* Make ephemeral? an optional keyword argument

--- src/konserve/filestore.clj
+++ src/konserve/filestore.clj
@@ -63,14 +63,17 @@
       (catch Exception e
         e))))

-(defn list-files [directory]
+(defn list-files
   "Lists all files on the first level of a directory."
-  (let [root (Paths/get directory (into-array String []))
-        ds (Files/newDirectoryStream root)
-        files (mapv (fn [^Path path]
-                      (str (.relativize root path))) ds)]
-    (.close ds)
-    files))
+  ([directory]
+   (list-files directory (fn [_] false)))
+  ([directory ephemeral?]
+   (let [root (Paths/get directory (into-array String []))
+         ds (Files/newDirectoryStream root)
+         files (mapv (fn [^Path path] (str (.relativize root path)))
+                     (remove ephemeral? ds))]
+     (.close ds)
+     files)))

 (defn count-konserve-keys [dir]
   "Counts konserve files in the directory."
@@ -90,7 +93,7 @@

 (declare migrate-old-files migrate-file-v2 migrate-file-v1)

-(defrecord BackingFilestore [base detected-old-blobs]
+(defrecord BackingFilestore [base detected-old-blobs ephemeral?]
   PBackingStore
   (-create-blob [_this store-key env]
     (let [{:keys [sync?]} env
@@ -134,7 +137,7 @@

   (-keys [_this env]
     (async+sync (:sync? env) *default-sync-translation*
-                (go-try- (into [] (list-files base)))))
+                (go-try- (into [] (list-files base ephemeral?)))))

   (-copy [_this from to env]
     (async+sync (:sync? env) *default-sync-translation*
@@ -666,8 +669,11 @@
    :write-handlers empty
    :buffer-size    1 MB
    :config         config} "
-  [path & {:keys [detect-old-file-schema? config]
-           :or {detect-old-file-schema? false}
+  [path & {:keys [detect-old-file-schema? ephemeral? config]
+           :or {detect-old-file-schema? false
+                ephemeral? (fn [^Path path]
+                             (some #(re-matches % (-> path .getFileName .toString))
+                                   [#"\.nfs.*"]))}
            :as params}]
   ;; check config
   (let [store-config (merge {:default-serializer :FressianSerializer
@@ -687,7 +693,7 @@
         _                  (when detect-old-file-schema?
                              (when-not (empty? @detect-old-blob)
                                (info (count @detect-old-blob) "files in old storage schema detected. Migration for each key will happen transparently the first time a key is accessed. Invoke konserve.core/keys to do so at once. Once all keys are migrated you can deactivate this initial check by setting detect-old-file-schema to false.")))
-        backing            (BackingFilestore. path detect-old-blob)]
+        backing            (BackingFilestore. path detect-old-blob ephemeral?)]
     (connect-default-store backing store-config)))

 (comment
@@ -780,4 +786,4 @@
   (<!! (k/bassoc store :binbar (byte-array (range 10)) {:sync? false}))
   (<!! (k/bget store :binbar (fn [{:keys [input-stream]}]
                                (map byte (slurp input-stream)))
-               {:sync? false})))+               {:sync? false})))


remove :child from semantic features with np-grammar

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -488,7 +488,8 @@
                              (remove-matching-keys lexeme
                                                    #(or
                                                      (= % :activity)        (= % :animate)  (= % :artifact)
-                                                     (= % :buyable)         (= % :clothing) (= % :consumable)
+                                                     (= % :buyable)         (= % :child)    (= % :clothing)
+                                                     (= % :consumable)
                                                      (= % :drinkable)       (= % :edible)   (= % :furniture)
                                                      (= % :human)           (= % :legible)  (= % :part-of-human-body)
                                                      (= % :pet)


cleanup: remove un-needed :infl-sharing

cleanup: remove un-needed :infl-sharing

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -342,13 +342,10 @@

                    (unify c10
                           root-is-head-root
-                          (let [infl (atom :top)]
-                            {:head {:phrasal true ;; only a vp-aux may be the head child, not simply a lexical auxiliary verb.
-                                    :synsem {:aux true
-                                             :infl infl}}
+                          {:head {:phrasal true ;; only a vp-aux may be the head child, not simply a lexical auxiliary verb.
+                                  :synsem {:aux true}}
                              :rule "s-aux"
-                             :synsem {:cat :verb
-                                      :infl infl}}))
+                             :synsem {:cat :verb}})

                    (unify c10
                            root-is-head-root
@@ -426,44 +423,35 @@
                                      :cat :verb}})
                    (unify h21a
                           root-is-comp-root
-                          (let [infl (atom :top)]
-                            {:rule "vp-aux-phrasal-complement-passato"
-                             :head {:phrasal false
-                                    :synsem {:aux true
-                                             :infl infl}}
-                             :comp {:phrasal true}
-                             :synsem {:aux true
-                                      :infl infl
-                                      :sem {:tense :past
-                                            :aspect :simple}
-                                      :cat :verb}}))
+                          {:rule "vp-aux-phrasal-complement-passato"
+                           :head {:phrasal false
+                                  :synsem {:aux true}}
+                           :comp {:phrasal true}
+                           :synsem {:aux true
+                                    :sem {:tense :past
+                                          :aspect :simple}
+                                    :cat :verb}})

                    (unify h21a
                           root-is-comp
-                          (let [infl (atom :top)]
-                            {:rule "vp-aux-nonphrasal-complement-passato"
-                             :head {:phrasal false
-                                    :synsem {:aux true
-                                             :infl infl}}
-                             :comp {:phrasal false}
-                             :synsem {:aux true
-                                      :infl infl
-                                      :sem {:tense :past
-                                            :aspect :simple}
-                                      :cat :verb}}))
+                          {:rule "vp-aux-nonphrasal-complement-passato"
+                           :head {:phrasal false
+                                  :synsem {:aux true}}
+                           :comp {:phrasal false}
+                           :synsem {:aux true
+                                    :sem {:tense :past
+                                          :aspect :simple}
+                                    :cat :verb}})
                    (unify h21a
                           root-is-comp
-                          (let [infl (atom :imperfect)]
-                            {:rule "vp-aux-nonphrasal-complement-trapassato"
-                             :head {:phrasal false
-                                    :synsem {:aux true
-                                             :infl infl}}
-                             :comp {:phrasal false}
-                             :synsem {:aux true
-                                      :infl infl
-                                      :sem {:tense :past
-                                            :aspect :perfect}
-                                      :cat :verb}}))
+                          {:rule "vp-aux-nonphrasal-complement-trapassato"
+                           :head {:phrasal false
+                                  :synsem {:aux true}}
+                           :comp {:phrasal false}
+                           :synsem {:aux true
+                                    :sem {:tense :past
+                                          :aspect :perfect}
+                                    :cat :verb}})

                    ;; these two following rules are kind of complicated and made more so by
                    ;; dependence on auxilary sense of "avere" which supplies the


Fix site-scraper test that I broke by fixing the code...

--- test/clj/comic_reader/comic_repository/scraper_test.clj
+++ test/clj/comic_reader/comic_repository/scraper_test.clj
@@ -207,7 +207,7 @@
   (t/testing "returns a valid image tag"
     (let [repo (test-repo (mock-scraper
                            :images {"manga-fox"
-                                    {{:name "3" :url  "url3"} [:img {:src "an-img-url"}]}}))]
+                                    {{:page/number 3 :page/url "url3"} [:img {:src "an-img-url"}]}}))]

       (t/is (= [:img {:src "an-img-url"}]
                (repo/image-tag repo "manga-fox" {:location/page {:page/number 3 :page/url "url3"}}))))))


add the uid column to the insert-chunk! function

--- src/bitfondue/models/chunks.clj
+++ src/bitfondue/models/chunks.clj
@@ -8,7 +8,8 @@
   (database/insert-chunk<! config/database
                            (:title chunk)
                            (:url chunk)
-                           (:description_full chunk)))
+                           (:description_full chunk)
+                           (:uid chunk)))

 (defn get-chunks
   "Retrieve chunks"


removing dependency on fs.core

removing dependency on fs.core

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -2,7 +2,6 @@
   (:refer-clojure :exclude [test])
   (:require
    [clojure.pprint :as pp]
-   [fs.core :as fs]
    [leiningen.cljsbuild.config :as config]
    [leiningen.cljsbuild.subproject :as subproject]
    [leiningen.core.eval :as leval]
@@ -56,7 +55,7 @@
   (when (not-empty crossovers)
     (println "\033[31mWARNING: lein-cljsbuild crossovers are deprecated, and will be removed in future versions.\n
 See https://github.com/emezeske/lein-cljsbuild/blob/master/doc/CROSSOVERS.md for details.\033[0m")
-    (fs/mkdirs crossover-path))
+    (.mkdirs (io/file crossover-path)))
   (let [parsed-builds (map config/parse-notify-command builds)]
     (run-local-project project crossover-path parsed-builds
      '(require 'cljsbuild.crossover 'cljsbuild.util 'clj-stacktrace.repl 'figwheel-sidecar.auto-builder 'figwheel-sidecar.core)


PDOK-2477: Deleting extract resulted in java.lang.IllegalArgumentException: No value supplied for key: true}

--- src/main/clojure/pdok/featured/extracts.clj
+++ src/main/clojure/pdok/featured/extracts.clj
@@ -99,7 +99,7 @@
   (when (seq versions)
     (let [query (str "DELETE FROM " extract-schema "." table
                      " WHERE version = ?")]
-      (try (j/execute! db (cons query (map vector versions)) :multi? true (:transaction? db))
+      (try (j/execute! db (cons query (map vector versions)) :multi? true :transaction? (:transaction? db))
            (catch java.sql.SQLException e (j/print-sql-exception-chain e))))))

 (defn- delete-extracts-with-version [db dataset feature-type extract-type versions]


Automatically generate (query ...) for views if it isn't defined

--- src/main/app_macros/view.clj
+++ src/main/app_macros/view.clj
@@ -72,6 +72,19 @@
          (partition-all 2 2)
          (reduce parse-step []))))

+;;;; Om Next query generation
+
+(defn generate-query-fn
+  "Generate a (query ...) function from the props spec."
+  [props]
+  (letfn [(generate-read-key [ret {:keys [name join]}]
+            (conj ret
+                  (cond
+                    join  (hash-map (keyword name)
+                                    `(~'om/get-query ~join))
+                    :else (keyword name))))]
+    (list 'query (reduce generate-read-key [] props))))
+
 (def fn-specs
   "Function specifications for all functions that are not Object
    instance functions taking [this] as the sole argument."
@@ -116,6 +129,14 @@
   [[name & body :as f]]
   (let [alias (fn-alias f)]
     `(~alias ~@body)))
+
+(defn maybe-generate-query-fn
+  "If (query ...) is missing from fns, it is generated automatically
+   from the props spec."
+  [fns props]
+  (cond-> fns
+    (not (some '#{query} (map first fns)))
+    (conj (generate-query-fn props))))

 (defn inject-fn-args
   "Injects a function argument binding vector into f if it doesn't
@@ -164,7 +185,8 @@
          computed           (parse-props-spec (second prop-specs))
          fns                (drop-while vector? forms)
          fns-aliased        (map resolve-fn-alias fns)
-         fns-with-args      (map inject-fn-args fns-aliased)
+         fns-with-query     (maybe-generate-query-fn fns-aliased props)
+         fns-with-args      (map inject-fn-args fns-with-query)
          fns-with-props     (map #(inject-props % props computed)
                                  fns-with-args)
          factory-fns        (filter #(= (fn-scope %) :factory)


default system now instantiates a DB component

--- src/clj/coffee_table/system.clj
+++ src/clj/coffee_table/system.clj
@@ -1,7 +1,7 @@
 (ns coffee-table.system
   "Components and their dependency relationships"
   (:require [coffee-table.component.database :refer [new-database]]
-            [coffee-table.config :refer [config]]
+            [coffee-table.config :as ctcfg]
             [com.stuartsierra.component :refer [system-map system-using]]
             [taoensso.timbre :as timbre]
             [coffee-table.config :as config]))
@@ -11,7 +11,9 @@
 (defn new-system-map
   "Create the system. See https://github.com/stuartsierra/component"
   [config]
-  (system-map))
+  (system-map
+   :db (new-database {:spec (ctcfg/database-spec config)
+                      :migratus (ctcfg/migratus config)})))

 (defn new-dependency-map
   "Declare the dependency relationship between components. See https://github.com/stuartsierra/component"
@@ -21,7 +23,7 @@
 (defn new-system
   "Construct a new system, configured with the given profile"
   [profile]
-  (let [config (config profile)]
+  (let [config (ctcfg/config profile)]
     (system-using
      (new-system-map config)
      (new-dependency-map))))


updated docs

updated docs

--- src/clj/forma/trends/filter.clj
+++ src/clj/forma/trends/filter.clj
@@ -21,7 +21,8 @@
 (defn deseasonalize
   "accepts a timeseries `ts` with frequency `freq` and returns a
   vector with the seasonal component removed; the returned vector is
-  only the trend component and the idiosyncratic disturbance.
+  only the trend component and the idiosyncratic disturbance of the
+  original time series.

   Example:
     (deseasonalize 23 (s/sample-uniform 200))"


Hivemind on Progenitor test, #738.

Hivemind on Progenitor test, #738.

--- src/clj/test/cards-programs.clj
+++ src/clj/test/cards-programs.clj
@@ -63,3 +63,28 @@
     (let [mopus (get-in @state [:runner :rig :program 0])]
       (card-ability state :runner mopus 0)
       (is (= 2 (:credit (get-runner))) "Gain 2cr"))))
+
+(deftest progenitor-host-hivemind
+  "Progenitor - Hosting Hivemind, using Virus Breeding Ground. Issue #738"
+  (do-game
+    (new-game (default-corp)
+              (default-runner [(qty "Progenitor" 1) (qty "Virus Breeding Ground" 1) (qty "Hivemind" 1)]))
+    (take-credits state :corp)
+    (play-from-hand state :runner "Progenitor")
+    (play-from-hand state :runner "Virus Breeding Ground")
+    (is (= 4 (:memory (get-runner))))
+    (let [prog (get-in @state [:runner :rig :program 0])
+          vbg (get-in @state [:runner :rig :resource 0])]
+      (card-ability state :runner prog 0)
+      (core/resolve-prompt state :runner {:card (find-card "Hivemind" (:hand (get-runner)))})
+      (is (= 4 (:memory (get-runner))) "No memory used to host on Progenitor")
+      (let [hive (first (:hosted (refresh prog)))]
+        (is (= "Hivemind" (:title hive)) "Hivemind is hosted on Progenitor")
+        (is (= 1 (:counter hive)) "Hivemind has 1 counter")
+        (is (= 0 (:credit (get-runner))) "Full cost to host on Progenitor")
+        (take-credits state :runner 1)
+        (take-credits state :corp)
+        (card-ability state :runner vbg 0) ; use VBG to transfer 1 token to Hivemind
+        (core/select state :runner {:card (refresh hive)})
+        (is (= 2 (get (refresh hive) :counter 0)) "Hivemind gained 1 counter")
+        (is (= 0 (get (refresh vbg) :counter 0)) "Virus Breeding Ground lost 1 counter")))))


Support boot files

Support boot files

--- src/clojure/nightcode/utils.clj
+++ src/clojure/nightcode/utils.clj
@@ -71,11 +71,12 @@

 ; paths and encodings

-(def ^:const clojure-exts #{"clj" "cljc" "cljs" "cljx" "edn"})
+(def ^:const clojure-exts #{"boot" "clj" "cljc" "cljs" "cljx" "edn"})
 (def ^:const wrap-exts #{"md" "txt"})
 (def styles {"as"         SyntaxConstants/SYNTAX_STYLE_ACTIONSCRIPT
              "asm"        SyntaxConstants/SYNTAX_STYLE_ASSEMBLER_X86
              "bat"        SyntaxConstants/SYNTAX_STYLE_WINDOWS_BATCH
+             "boot"       SyntaxConstants/SYNTAX_STYLE_CLOJURE
              "c"          SyntaxConstants/SYNTAX_STYLE_C
              "cc"         SyntaxConstants/SYNTAX_STYLE_C
              "cl"         SyntaxConstants/SYNTAX_STYLE_LISP


More styling

More styling

--- src/com/hypirion/clj_xchart.clj
+++ src/com/hypirion/clj_xchart.clj
@@ -4,7 +4,8 @@
                              PieSeries$PieSeriesRenderStyle
                              XYSeries$XYSeriesRenderStyle
                              XChartPanel)
-           (org.knowm.xchart.style Styler$LegendPosition
+           (org.knowm.xchart.style Styler
+                                   Styler$LegendPosition
                                    GGPlot2Theme
                                    MatlabTheme
                                    XChartTheme)
@@ -91,7 +92,7 @@
        ~expr-sym)))

 (defn- set-legend!
-  [styler
+  [^Styler styler
    {:keys [background-color border-color font padding
            position series-line-length visible]}]
   (doto-cond
@@ -105,7 +106,7 @@
    (not (nil? visible)) (.setLegendVisible visible)))

 (defn- set-chart-title-style!
-  [styler
+  [^Styler styler
    {:keys [box-background-color box-border-color box-visible
            font padding visible]}]
   (doto-cond
@@ -118,7 +119,7 @@
    visible (.setChartTitleVisible visible)))

 (defn- set-chart-style!
-  [styler
+  [^Styler styler
    {:keys [background-color font-color padding title]}]
   (doto-cond
    styler
@@ -127,65 +128,115 @@
    padding (.setChartPadding (int padding))
    title (set-chart-title-style! title)))

+(defn- set-plot-style!
+  [^Styler styler
+   {:keys [background-color border-color border-visible content-size]}]
+  (doto-cond
+   styler
+   background-color (.setPlotBackgroundColor (colors background-color background-color))
+   border-color (.setPlotBorderColor (colors border-color border-color))
+   (not (nil? border-visible)) (.setPlotBorderVisible (boolean border-visible))
+   content-size (.setPlotContentSize (double content-size))))
+
+(defn- set-series-style!
+  [^Styler styler
+   series]
+  ;; All of these are arrays, so we mutate them and set them back in.
+  (let [series-colors (.getSeriesColors styler)
+        series-lines (.getSeriesLines styler)
+        series-markers (.getSeriesMarkers styler)
+        series (vec series)]
+    (dotimes [i (count series)]
+      (let [{:keys [color stroke marker]} (series i)]
+        (when color
+          (aset series-colors i (colors color color)))
+        (when stroke
+          (aset series-lines i stroke))
+        (when marker
+          (aset series-markers i (markers marker marker)))))
+    (doto styler
+      (.setSeriesColors series-colors)
+      (.setSeriesLines series-lines)
+      (.setSeriesMarkers series-markers))))
+
+(defn- set-default-style!
+  [^Styler styler
+   {:keys [annotations-font annotations? chart plot legend series]}]
+  (doto-cond
+   styler
+   annotations-font (.setAnnotationsFont annotations-font)
+   (not (nil? annotations?)) (.setHasAnnotations (boolean annotations?))
+   chart (set-chart-style! chart)
+   legend (set-legend! legend)
+   plot (set-plot-style! plot)
+   series (set-series-style! series)))
+
 ;; TODO: Add in font as a shortcut to set all fonts not yet set.

 (defn xy-chart
   "Returns an xy-chart"
-  [{:keys [width height title series legend theme render-style chart-style
-           annotations-font]
-    :or {width 640 height 500}}]
-  {:pre [series]}
-  (let [chart (XYChart. width height)]
-    (doseq [[s-name data] series]
-      (if (sequential? data)
-        (apply add-series chart s-name data)
-        (let [{:keys [x y error-bars style]} data
-              {:keys [marker-color marker-type
-                      line-color line-style line-width
-                      fill-color show-in-legend render-style]} style]
-          (doto-cond
-           (if error-bars
-             (add-series chart s-name x y error-bars)
-             (add-series chart s-name x y))
-           marker-color (.setMarkerColor (colors marker-color marker-color))
-           marker-type (.setMarker (markers marker-type marker-type))
-           line-color (.setLineColor (colors line-color line-color))
-           line-style (.setLineStyle line-style)
-           line-width (.setLineWidth (float line-width))
-           fill-color (.setFillColor (colors fill-color fill-color))
-           (not (nil? show-in-legend)) (.setShowInLegend (boolean show-in-legend))
-           render-style (.setXYSeriesRenderStyle (xy-render-styles render-style))))))
-    (doto-cond
-     (.getStyler chart)
-     theme (.setTheme (themes theme theme))
-     render-style (.setDefaultSeriesRenderStyle (xy-render-styles render-style))
-     legend (set-legend! legend)
-     chart-style (set-chart-style! chart-style)
-     annotations-font (.setAnnotationsFont annotations-font))
-    (doto-cond
-     chart
-     title (.setTitle title))))
+  ([series]
+   (xy-chart series {}))
+  ([series
+    {:keys [width height title theme render-style]
+     :or {width 640 height 500}
+     :as styling}]
+   {:pre [series]}
+   (let [chart (XYChart. width height)]
+     (doseq [[s-name data] series]
+       (if (sequential? data)
+         (apply add-series chart s-name data)
+         (let [{:keys [x y error-bars style]} data
+               {:keys [marker-color marker-type
+                       line-color line-style line-width
+                       fill-color show-in-legend render-style]} style]
+           (doto-cond
+            (if error-bars
+              (add-series chart s-name x y error-bars)
+              (add-series chart s-name x y))
+            marker-color (.setMarkerColor (colors marker-color marker-color))
+            marker-type (.setMarker (markers marker-type marker-type))
+            line-color (.setLineColor (colors line-color line-color))
+            line-style (.setLineStyle line-style)
+            line-width (.setLineWidth (float line-width))
+            fill-color (.setFillColor (colors fill-color fill-color))
+            (not (nil? show-in-legend)) (.setShowInLegend (boolean show-in-legend))
+            render-style (.setXYSeriesRenderStyle (xy-render-styles render-style))))))
+     (doto-cond
+      (.getStyler chart)
+      theme (.setTheme (themes theme theme))
+      render-style (.setDefaultSeriesRenderStyle (xy-render-styles render-style)))
+     (set-default-style! (.getStyler chart) styling)
+     (doto-cond
+      chart
+      title (.setTitle title)))))

 (defn pie-chart
   "Returns a pie chart"
-  [{:keys [width height title series circular legend theme render-style
-           chart-style annotations-font]
-    :or {width 640 height 500}}]
-  {:pre [series]}
-  (let [chart (PieChart. width height)]
-    (doseq [[s-name num] series]
-      (.addSeries chart s-name num))
-    (doto-cond
-     (.getStyler chart)
-     theme (.setTheme (themes theme theme))
-     render-style (.setDefaultSeriesRenderStyle (pie-render-styles render-style))
-     (not (nil? circular)) (.setCircular circular)
-     legend (set-legend! legend)
-     chart-style (set-chart-style! chart-style)
-     annotations-font (.setAnnotationsFont annotations-font))
-    (doto-cond
-     chart
-     title (.setTitle title))))
+  ([series]
+   (pie-chart series {}))
+  ([series
+    {:keys [width height title circular legend theme render-style
+            chart-style annotations-font annotation-distance
+            start-angle]
+     :or {width 640 height 500}}]
+   {:pre [series]}
+   (let [chart (PieChart. width height)]
+     (doseq [[s-name num] series]
+       (.addSeries chart s-name num))
+     (doto-cond
+      (.getStyler chart)
+      theme (.setTheme (themes theme theme))
+      render-style (.setDefaultSeriesRenderStyle (pie-render-styles render-style))
+      legend (set-legend! legend)
+      chart-style (set-chart-style! chart-style)
+      annotations-font (.setAnnotationsFont annotations-font)
+      (not (nil? circular)) (.setCircular (boolean circular))
+      annotation-distance (.setAnnotationDistance (double annotation-distance))
+      start-angle (.setStartAngleInDegrees (double start-angle)))
+     (doto-cond
+      chart
+      title (.setTitle title)))))

 (defn view
   "Utility function to render one or more charts in a swing frame."


Improving implementation of stem-base-from-base

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

--- src/conexp/fca/implications.clj
+++ src/conexp/fca/implications.clj
@@ -279,23 +279,26 @@
   "For a given set of implications returns its stem-base."
   [implications]
   (loop [stem-base    #{},
-         implications (map #(make-implication (premise %)
-                                              (close-under-implications implications
-                                                                        (union (premise %)
-                                                                               (conclusion %))))
-                           implications)]
+         implications (pmap #(make-implication (premise %)
+                                               (close-under-implications implications
+                                                                         (union (premise %)
+                                                                                (conclusion %))))
+                            implications),
+         all          (vec implications)]
     (if (empty? implications)
       stem-base
       (let [A->B         (first implications),
             implications (rest implications),
-            A*           (close-under-implications (into stem-base implications)
-                                                   (premise A->B)),
-            new-impl     (make-implication A* (conclusion A->B))]
-        (recur (if (not-empty (conclusion new-impl))
-                 (conj stem-base
-                       (make-implication A* (conclusion A->B)))
-                 stem-base)
-               implications)))))
+            all          (subvec all 1)
+            A*           (close-under-implications all (premise A->B)),
+            A*->B        (make-implication A* (conclusion A->B))]
+        (if (not-empty (conclusion A*->B))
+          (recur (conj stem-base A*->B)
+                 implications
+                 (conj all A*->B))
+          (recur stem-base
+                 implications
+                 all))))))

 ;;;


test hook

test hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 73
+                 3  {:db/id 3 :person/name "Allie" :person/age 72
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}