More network model sketch.

More network model sketch.

--- src/cbfg/net.cljs
+++ src/cbfg/net.cljs
@@ -1,5 +1,5 @@
 (ns cbfg.net
-  (:require-macros [cbfg.ago :refer [achan ago-loop aclose aalts aput]]))
+  (:require-macros [cbfg.ago :refer [achan ago-loop aclose aalts aput aput-close]]))

 (defn make-net [actx request-listen-ch request-connect-ch max-msgs-per-stream]
   (let [clean-up #()]
@@ -23,9 +23,8 @@
                                        (when (< (count (:msgs stream)) max-msgs-per-stream)
                                          [(:send-ch stream)]))
                                       streams)
-                    listenables (vals listens) ; TODO: Handle too many ports case.
                     [v ch] (aalts net (vec (concat [request-listen-ch request-connect-ch]
-                                                   deliveries sendables listenables)))]
+                                                   deliveries sendables)))]
                 (cond
                  (= ch request-listen-ch)
                  (when-let [[addr port accept-ch] v]
@@ -43,6 +42,7 @@
                            server-send-ch (achan net)
                            server-recv-ch (achan net)]
                        ; TODO: Need to model connection delay and running out of ports.
+                       ; TODO: Need to model stop accepting connections / stop listening.
                        (aput net result-ch [client-send-ch client-recv-ch])
                        (aput net accept-ch [server-send-ch server-recv-ch])
                        (recur (inc ts) request-listen-ch request-connect-ch listens
@@ -53,14 +53,19 @@
                                                          :to-side :send :to-addr to-addr :to-port to-port}))))
                      (do (aclose net result-ch)
                          (recur (inc ts) request-listen-ch request-connect-ch listens streams))))
-                 (contains? listenables ch)
-                 (if v
-                   (recur (inc ts) request-listen-ch request-connect-ch listens streams)
-                   (recur (inc ts) request-listen-ch request-connect-ch listens streams))
                  (contains? sendables ch)
-                 (if v
-                   (recur (inc ts) request-listen-ch request-connect-ch listens streams)
-                   (recur (inc ts) request-listen-ch request-connect-ch listens streams))
-                 :else ; Must be a deliverable.
-                 (recur (inc ts) request-listen-ch request-connect-ch listens streams))))))
+                 (let [send-ch ch]
+                   (if-let [stream (get streams send-ch)]
+                     (let [[msg result-ch] v]
+                       (when result-ch
+                         (aput-close net result-ch :ok))
+                       (recur (inc ts) request-listen-ch request-connect-ch listens
+                              (update-in streams [send-ch :msgs] conj msg)))
+                     (recur (inc ts) request-listen-ch request-connect-ch listens
+                            (dissoc streams send-ch)))) ; TODO: Handle closing recv-ch.
+                 :else ; Must be completed delivery (recv).
+                 (let [recv-ch ch
+                       stream (first (filter #(= (:recv-ch %) recv-ch) (vals streams)))]
+                   (recur (inc ts) request-listen-ch request-connect-ch listens
+                          (dissoc streams (:send-ch stream)))))))))


Rename render-file's filename arg to filename-or-URL (#154)

--- src/selmer/parser.clj
+++ src/selmer/parser.clj
@@ -111,15 +111,15 @@
 ;; map and potentially opts. Smart (last-modified timestamp)
 ;; auto-memoization of compiler output.

-(defn render-file [filename context-map & [{:keys [cache custom-resource-path]
+(defn render-file [filename-or-URL context-map & [{:keys [cache custom-resource-path]
                                             :or  {cache @cache?
                                                   custom-resource-path *custom-resource-path*}
                                             :as opts}]]
   " Parses files if there isn't a memoized post-parse vector ready to go,
   renders post-parse vector with passed context-map regardless. Double-checks
-  last-modified on files. Uses classpath for filename path "
+  last-modified on files. Uses classpath for filename-or-URL path "
   (binding [*custom-resource-path* custom-resource-path]
-    (if-let [resource (resource-path filename)]
+    (if-let [resource (resource-path filename-or-URL)]
       (let [{:keys [template last-modified]} (get @templates resource)
             ;;for some resources, such as ones inside a jar, it's
             ;;not possible to check the last modified timestamp
@@ -128,12 +128,12 @@
         (check-template-exists resource)
         (if (and cache last-modified (= last-modified last-modified-time))
           (render-template template context-map)
-          (let [template (parse parse-file filename opts)]
+          (let [template (parse parse-file filename-or-URL opts)]
             (swap! templates assoc resource {:template template
                                              :last-modified last-modified-time})
             (render-template template context-map))))
       (validation-error
-       (str "resource-path for " filename " returned nil, typically means the file doesn't exist in your classpath.")
+       (str "resource-path for " filename-or-URL " returned nil, typically means the file doesn't exist in your classpath.")
        nil nil nil))))

 ;; For a given tag, get the fn handler for the tag type,


Finish the color adjustment overlay.

Finish the color adjustment overlay.

Erase the old cue variables, draw explictly labeled Hue and Saturation
gauges, and a larger color swatch while a color is being adjusted.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -2342,7 +2342,8 @@
         effect-id (:id info)]
     ;; Take full cell, using both encoders to adjust hue and saturation.
     (let [[hue-note sat-note] (if (odd? note) [(dec note) note] [note (inc note)])
-          [hue-control sat-control] (map control-for-top-encoder-note [hue-note sat-note])]
+          [hue-control sat-control] (map control-for-top-encoder-note [hue-note sat-note])
+          graphics (create-graphics controller)]
       (reify controllers/IOverlay
         (captured-controls [this] #{hue-control sat-control (+ 21 (* 2 x))})
         (captured-notes [this] (clojure.set/union #{hue-note sat-note} (set (drop 36 (range 100)))))
@@ -2364,6 +2365,18 @@
                     (swap! (:next-grid-pads controller) assoc i (if (= i 4)
                                                                   (colors/darken current-color 20)
                                                                   (colors/lighten current-color 20))))))
+
+              ;; Replace the cue's variable value section with a hue and saturation editor.
+              (set-graphics-color graphics off-color)
+              (.fillRect graphics (* x 2 button-cell-width) 0 (* 2 button-cell-width) 100)
+              (draw-encoder-button-label controller (* x 2) 1 "Hue" white-color)
+              (draw-cue-variable-value controller (* x 2) 1 (format "%.1f" hue) white-color)
+              (draw-encoder-button-label controller (inc (* x 2)) 1 "Saturation" white-color)
+              (draw-cue-variable-value controller (inc (* x 2)) 1 (format "%.1f" sat) white-color)
+
+              ;; Add a larger color swatch between the gauges
+              (set-graphics-color graphics current-color)
+              (.fillRect graphics (- (* (inc (* x 2)) button-cell-width) 20) 50 40 40)

               ;; Display the hue and saturation gauges
               (draw-hue-gauge controller (* 2 x) 1 hue (@anchors hue-note))


Add `when>=1-7`

Add `when>=1-7`

--- src/such/versions.clj
+++ src/such/versions.clj
@@ -18,3 +18,7 @@
 (defmacro when>=1-6 [& body]
   (when (>= minor 6)
     `(do ~@body)))
+
+(defmacro when>=1-7 [& body]
+  (when (>= minor 7)
+    `(do ~@body)))


Add more version tests.

Add more version tests.

--- src/such/versions.clj
+++ src/such/versions.clj
@@ -2,10 +2,6 @@
   such.versions)

 (def ^:private minor (:minor *clojure-version*))
-
-(defmacro when=1-4 [& body]
-  (when (=  minor 4)
-    `(do ~@body)))

 (defmacro when<=1-5 [& body]
   (when (<= minor 5)
@@ -19,6 +15,22 @@
   (when (>= minor 6)
     `(do ~@body)))

+(defmacro when=1-6 [& body]
+  (when (= minor 6)
+    `(do ~@body)))
+
 (defmacro when>=1-7 [& body]
   (when (>= minor 7)
     `(do ~@body)))
+
+(defmacro when=1-7 [& body]
+  (when (= minor 7)
+    `(do ~@body)))
+
+(defmacro when>=1-8 [& body]
+  (when (>= minor 8)
+    `(do ~@body)))
+
+(defmacro when=1-8 [& body]
+  (when (= minor 8)
+    `(do ~@body)))


marked deprecated checkers with :deprecated metadata; also added 'use xyz instead' to 2 out of 4 docs.

--- src/midje/checkers/deprecated.clj
+++ src/midje/checkers/deprecated.clj
@@ -5,8 +5,10 @@
 ;; Note: checkers need to be exported in ../checkers.clj

 (defchecker map-containing
-  "Accepts a map that contains all the keys and values in expected,
+  "DEPRECATED: use 'contains' checker instead.
+   Accepts a map that contains all the keys and values in expected,
    perhaps along with others"
+  {:deprecated "0.9.0"}
   [expected]
   (contains expected))

@@ -21,6 +23,7 @@

    You can call this with either (only-maps-containing {..} {..}) or
    (only-maps-containing [ {..} {..} ])."
+  {:deprecated "0.9.0"}
   [& maps-or-maplist]
   (let [expected (one-level-map-flatten maps-or-maplist)
         subfunctions (map contains expected)]
@@ -32,13 +35,15 @@

    You can call this with either (maps-containing {..} {..}) or
    (maps-containing [ {..} {..} ])."
+  {:deprecated "0.9.0"}
   [& maps-or-maplist]
   (let [expected (one-level-map-flatten maps-or-maplist)
         subfunctions (map contains expected)]
     (contains subfunctions :in-any-order :gaps-ok)))

 (defchecker in-any-order
-  "Produces matcher that matches sequences without regard to order.
-   Prefer (just x :in-any-order)."
+  "DEPRECATED: use (just x :in-any-order) instead.
+   Produces matcher that matches sequences without regard to order."
+  {:deprecated "0.9.0"}
   [expected]
   (just expected :in-any-order))


Refactor items' displaying

Refactor items' displaying

--- src/cljs/cljs_repl_web/code_mirror/core.cljs
+++ src/cljs/cljs_repl_web/code_mirror/core.cljs
@@ -20,6 +20,15 @@
    :set-text     #(dispatch [:console-set-text :cljs-console %1])
    :add-log      #(dispatch [:add-console-log :cljs-console %])})

+(defn display-output-item
+  ([value]
+   (display-output-item value false))
+  ([value error?]
+   (println value ", " error?)
+   [:div
+    {:on-click #(dispatch [:focus-console-editor :cljs-console])
+     :class (str "cm-console-item" (when error? " error-cm-console-item"))}
+    value]))

 (defn display-repl-item
   [item]
@@ -30,12 +39,8 @@
      [utils/colored-text (str (:ns item) "=> " text)]]

     (if (= :error (:type item))
-      [:div.cm-console-item.error-cm-console-item
-       {:on-click #(dispatch [:focus-console-editor :cljs-console])}
-       (.-message (:value item))]
-      [:div.cm-console-item
-       {:on-click #(dispatch [:focus-console-editor :cljs-console])}
-       (:value item)])))
+      (display-output-item (.-message (:value item)) true)
+      (display-output-item (:value item)))))

 (defn repl-items [items]
   (into [:div] (map display-repl-item items)))


Make lazy-map macro take a map, not forms

--- cortex/src/cortex/util.cljc
+++ cortex/src/cortex/util.cljc
@@ -239,11 +239,12 @@
     (LazyMap. map)))

 (defmacro lazy-map
-  [& forms]
+  [map]
   `(->lazy-map
-     ~(->> forms
+     ~(->> map
+        (apply concat)
         (partition 2)
-        (map (fn [[k v]] [k `(delay ~v)]))
+        (clojure.core/map (fn [[k v]] [k `(delay ~v)]))
         (into {}))))

 (defn force-map


Support intervals between insts

Support intervals between insts

--- src/tick/interval.clj
+++ src/tick/interval.clj
@@ -93,6 +93,7 @@
     (every? temporal? [a b]) (absolute-interval a b)
     (and (temporal? a) (temporal-amount? b)) (relative-interval a b)
     (and (temporal-amount? a) (temporal? b)) (relative-interval b (t/negated a))
+    (and (instance? java.util.Date a) (instance? java.util.Date b)) (interval (t/instant a) (t/instant b))
     :else (throw (ex-info "Bad arguments for interval" {:arg0 a :arg1 b}))))

 ;; Adjustments


Cleans code.

Cleans code.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -439,8 +439,7 @@
             (let [k (make-key (:key body))]
               `(make-optional-clause (key-exists-without-binding-clause ~k)))
             (let [[mode body] body
-                  mflat?      (flat? mode)
-                  k           (make-key (if mflat? body (:key body)))]
+                  k (make-key (if (flat? mode) body (:key body)))]
               `(key-exists-without-binding-clause ~k)))

           :key-exists-with-binding


Remove abrams related stuff from db helpers

--- workspaces/src/com/wsscode/fulcro/db_helpers.cljc
+++ workspaces/src/com/wsscode/fulcro/db_helpers.cljc
@@ -216,11 +216,6 @@
   [this k]
   (get-in (fp/props this) [:com.wsscode.pathom.core/errors k]))

-(defn error-type
-  "Get the error type directly."
-  [this k]
-  (get-in (fp/props this) [:com.wsscode.pathom.core/errors k :abrams.diplomat.api/error-type]))
-
 (defn mutation-response
   ([this]
    (if (fp/component? this)
@@ -236,9 +231,9 @@

 (defn mutation-error?
   ([this]
-   (-> (mutation-response this) (contains? :abrams.controllers.graph/error)))
+   (-> (mutation-response this) (contains? :com.wsscode.pathom.core/mutation-errors)))
   ([state props]
-   (-> (mutation-response state props) (contains? :abrams.controllers.graph/error))))
+   (-> (mutation-response state props) (contains? :com.wsscode.pathom.core/mutation-errors))))

 (defn get-mutation [env k p]
   (if-let [m (get (methods mutations/mutate) k)]
@@ -260,8 +255,7 @@
     (swap-entity! (assoc env :ref ref) assoc ::mutation-response
       (-> p
           (dissoc ::ref)
-          (assoc :abrams.controllers.graph/error "Network error"
-                 :abrams.diplomat.api/error-type ::network-error)))
+          (assoc ::fp/error "Network error")))
     nil))

 (mutations/defmutation finish-mutation [{:keys [ok-mutation error-mutation input]}]


Scaling build timings height based on the number of containers.

--- src-cljs/frontend/components/build_timings.cljs
+++ src-cljs/frontend/components/build_timings.cljs
@@ -17,10 +17,11 @@
         (.domain #js [start-time stop-time])
         (.range  #js [0 (timings-width)]))))

-(defn create-root-svg []
+(defn create-root-svg [number-of-containers]
   (-> (.select js/d3 ".build-timings")
       (.select "svg")
-      (.attr "width" (timings-width))))
+      (.attr "width" (timings-width))
+      (.attr "height" (* number-of-containers bar-height))))

 (defn container-position [step]
   (* bar-height (inc (aget step "index"))))
@@ -69,8 +70,7 @@

 (defn draw-chart! [{:keys [parallel steps start_time stop_time] :as build}]
   (let [x-scale (create-x-scale start_time stop_time)
-        chart   (create-root-svg)]
-    (println "Running " parallel "x with " (count steps) "steps.")
+        chart   (create-root-svg parallel)]
     (draw-steps! x-scale chart steps)))

 ;;;; Main component


resize history canvas dynamically

resize history canvas dynamically

--- src/client/game/history.cljs
+++ src/client/game/history.cljs
@@ -1,5 +1,7 @@
 (ns client.game.history
   )
+
+(def prev-columns nil)

 (def size 5)

@@ -11,16 +13,21 @@
 (def canvas nil)
 (def ctx nil)

+(defn resize-canvas!
+  [columns]
+  (aset canvas "height" (* 22 size))
+  (aset canvas "width" (* columns size))
+  )
+
 (defn init-canvas!
   [id]
   (set! canvas (.getElementById js/document id))
   (set! ctx (.getContext canvas "2d"))
-  (aset canvas "height" (* 22 size))
-  (aset canvas "width" (* 400 size))
-  (.scale ctx size size))
+  )

 (defn draw-state!
   [i s]
+
   (js/console.log i (:drop-y s) (:height s) (pr-str (:collapsed s)))
   (aset ctx "fillStyle" back-color)
   (.fillRect ctx i 0 1 22)
@@ -39,5 +46,14 @@

 (defn draw-history!
   [history]
+
+  (let [columns (count history)]
+    (if (not= columns prev-columns)
+      (resize-canvas! columns))
+    (set! prev-columns columns))
+
+  (.scale ctx size size)
   (doseq [[i s] (map-indexed vector history)]
-    (draw-state! i s)))
+    (draw-state! i s))
+  (.setTransform ctx 1 0 0 1 0 0)
+  )


extended l-systems to be context sensitive

--- src/clj/aquarium/lsystem.clj
+++ src/clj/aquarium/lsystem.clj
@@ -48,7 +48,7 @@
   [seed past future productions]
   (loop [productions productions]
     (if (empty? productions)
-      (conj future (first seed))
+      (conj future (list (first seed)))
       (let [production (first productions)
             [match? result] (transform seed past production)]
         (if match?
@@ -74,5 +74,7 @@
 (defn testl
   []
   (let [p1 (production (condition nil [:a] nil) [:a :b])
-        p2 (production (condition nil [:b] nil) [:b :a :b])]
-    (travel (lsystem nil [p1 p2]) '(:a))))
+        p2 (production (condition [:a] [:b] nil) [:b :a :b])
+        p3 (production (condition nil [:b] [:a]) [:c])
+        p4 (production (condition nil [:b] nil) [:c])]
+    (travel (lsystem [:a :b] [p1 p2 p3 p4]) '(:a))))


first draft of long-term trend analysis in playground.clj

--- src/clj/forma/playground.clj
+++ src/clj/forma/playground.clj
@@ -107,8 +107,12 @@
   (let [row (vector m)
         col (i/trans row)
         ones (i/trans (i/matrix 1 1 pd))
-        ind (apply vector (map inc (range pd)))]
-    (vector (i/mmult row col))))
+        ind (i/trans [(map inc (range pd))])
+        X (i/bind-columns ones ind)
+        Xt (i/trans X)
+        ssX (i/solve (i/mmult Xt X))
+        beta (i/mmult ssX (i/trans X) col)]
+    (vector (i/sel beta 1 0))))

 (defn wordcount
@@ -116,4 +120,4 @@
     (?<- (stdout) [?sum]
         ((hfs-textline path) ?line)
         (text->num ?line :> ?vector)
-        (test-mult ?vector :> ?sum)))+        (test-mult ?vector pd :> ?sum)))


Run executor nodes in their own threads

Run executor nodes in their own threads

--- src/clj_gatling/pipeline.clj
+++ src/clj_gatling/pipeline.clj
@@ -5,7 +5,7 @@
             [clj-gatling.simulation :as simu]
             [clj-gatling.simulation-util :refer [split-equally]]
             [clojure.set :refer [rename-keys]]
-            [clojure.core.async :refer [onto-chan to-chan chan go go-loop <!!]]))
+            [clojure.core.async :refer [thread <!!]]))

 (defn local-executor [node-id simulation-fn simulation options]
   (println "Starting local executor with id:" node-id)
@@ -16,14 +16,22 @@
         raw-summary (parse-in-batches simulation batch-size results reporters)]
     raw-summary))

+(defn prun [f users-by-node]
+  (let [results (loop [users-by-node users-by-node
+                       threads []]
+                  (if-let [users (first users-by-node)]
+                    (let [t (thread (f (count threads) users))]
+                      (recur (rest users-by-node) (conj threads t)))
+                    threads))]
+    (map #(<!! %) results)))
+
 (defn run [simulation
            {:keys [nodes executor concurrency reporters] :as options}]
   (let [users-by-node (split-equally nodes (range concurrency))
-        results-by-node (pmap #(executor %2
-                                         simulation-runner
-                                         simulation
-                                         (assoc options :users %1))
-                              users-by-node
-                              (range nodes))]
+        results-by-node (prun (fn [node-id users]
+                                (executor node-id
+                                          simulation-runner
+                                          simulation (assoc options :users users)))
+                              users-by-node)]
     (reduce (partial combine-with-reporters reporters)
             results-by-node)))


fix the ai following the refactor

fix the ai following the refactor

--- src/cljs/triboard/ai/ai.cljs
+++ src/cljs/triboard/ai/ai.cljs
@@ -51,7 +51,8 @@
   (let [all-moves (turn/get-moves-of turn player)]
     (transduce
       (map #(get (move-strength cells-strength player %) looser))
-      max all-moves)))
+      min
+      all-moves)))

 ;; -----------------------------------------
@@ -71,8 +72,8 @@
       (utils/fast-max-key
         (fn [[m converted :as move]]
           (let [new-turn (turn/play-move turn m)
-                diff-score (get (move-strength cells-strength player move) player)
-                losses (map #(worst-immediate-loss cells-strength new-turn % player) others)]
-            (- diff-score (apply max losses))))
+                new-diff (get (move-strength cells-strength player move) player)
+                next-diff (map #(worst-immediate-loss cells-strength new-turn % player) others)]
+            (+ new-diff (apply min next-diff))))
         moves))
     ))


Add accessor inverse of conf coercion for vectors.

--- src/clojure/parkour/conf.clj
+++ src/clojure/parkour/conf.clj
@@ -80,6 +80,10 @@
 (defn get-class
   "Get class value of `conf` parameter `key`."
   ^Class [conf key default] (.getClass (configuration conf) key default))
+
+(defn get-vector
+  "Get string-vector value of `conf` parameter `key`."
+  [conf key default] (or (some-> (get conf key) (str/split #",")) default))

 (defn assoc!
   "Set `conf` parameter `key` to `val`."


Add more proto->clj

Add more proto->clj

--- src/clojure_fabric/proto.clj
+++ src/clojure_fabric/proto.clj
@@ -514,6 +514,16 @@
                           :extesion (when-not (.isEmpty extension)
                                       ;; FIXME: more specific type?
                                       extension))))
+  Identities$SerializedIdentity
+  (proto->clj [this ignore]
+    (make-serialized-identity :mspid (.getMspid this)
+                              :id-bytes (.getIdBytes this)))
+  Common$SignatureHeader
+  (proto->clj [this ignore]
+    (make-signature-header :creator (-> (.getCreator this)
+                                        (Identities$SerializedIdentity/parseFrom)
+                                        (proto->clj ignore))
+                           :nonce (.getNonce this)))

   Common$Header
   (proto->clj [this {:keys [channel-header signature-header]}]
@@ -521,7 +531,8 @@
       (make-header :channel-header (proto->clj (Common$ChannelHeader/parseFrom (.getChannelHeader this))
                                                channel-header)
                    :signature-header (when-not (.isEmpty raw-signature-header)
-                                       (proto->clj raw-signature-header signature-header)))))
+                                       (proto->clj (Common$SignatureHeader/parseFrom raw-signature-header)
+                                                   signature-header)))))
   Configtx$ConfigValue
   (proto->clj [this ignore]
     (make-config-value :version (.getVersion this)


Changing port to 3008

Changing port to 3008

--- src/cmr/mock_echo/system.clj
+++ src/cmr/mock_echo/system.clj
@@ -11,7 +11,7 @@
             [cmr.mock-echo.data.acl-db :as acl-db]
             [cmr.system-trace.context :as context]))

-(def DEFAULT_PORT 3007)
+(def DEFAULT_PORT 3008)

 (def
   ^{:doc "Defines the order to start the components."


Empty query string is actually okay.

Empty query string is actually okay.

--- src/cmr/opendap/ous/core.clj
+++ src/cmr/opendap/ous/core.clj
@@ -60,7 +60,7 @@

 (defn data-files->opendap-urls
   [params pattern-info data-files query-string]
-  (if (and pattern-info data-files query-string)
+  (if (and pattern-info data-files)
     (->> data-files
          (map (partial data-file->opendap-url pattern-info))
          (map #(str % "." (:format params) query-string)))


normalize path in realfs

normalize path in realfs

--- src/com/brainbot/real_fs.clj
+++ src/com/brainbot/real_fs.clj
@@ -91,6 +91,24 @@
   [path]
   (acl-from-attribute (read-attributes path)))

+(defn- collapse-consecutive-slash
+  [s]
+  (string/replace s #"/+" "/"))
+
+(defn- trim-slash
+  [s]
+  (string/replace s #"^/+|/+$" ""))
+
+
+(defn- normalize-path
+  [path]
+  (let [tmp (-> path
+              collapse-consecutive-slash
+              trim-slash)]
+    (if (= "" tmp)
+      "/"
+      tmp)))
+

 (defrecord RealFilesystem [root]
   vfs/Filesystem
@@ -109,7 +127,7 @@
        :mtime (ct (.lastModifiedTime attr))}))

   (join [fs parts]
-    (string/join "/" parts))
+    (normalize-path (string/join "/" parts)))

   (listdir [fs dir]
     (let [fp (string/join "/" [(:root fs) dir])


Story ID: develop Merge branch 'feature/RPC-298' into develop

--- src/untangled/support_viewer.cljs
+++ src/untangled/support_viewer.cljs
@@ -2,25 +2,44 @@
   (:require
     [om.next :as om :refer-macros [defui]]
     [om.dom :as dom]
+    [untangled.client.data-fetch :refer [load-singleton]]
     [untangled.client.core :as core]
     [untangled.client.mutations :as m]
     [yahoo.intl-messageformat-with-locales]
     [untangled.i18n :refer-macros [tr trf]]
-    [untangled.client.impl.network :as net]))
+    [untangled.client.impl.network :as net])
+  (:import goog.Uri))
+
+(defn get-url
+  [] (-> js/window .-location .-href))
+
+(defn uri-params
+  ([] (uri-params (get-url)))
+  ([url]
+   (let [query-data (.getQueryData (goog.Uri. url))]
+     (into {}
+       (for [k (.getKeys query-data)]
+         [k (.get query-data k)])))))
+
+(defn get-url-param
+  ([param-name] (get-url-param (get-url) param-name))
+  ([url param-name]
+   (get (uri-params url) param-name)))

 (defui ^:once SupportViewerRoot
   static om/IQuery
-  (query [this] [:react-key :current-position :client-time :frames :position])
+  (query [this] [:react-key :current-position :client-time :frames :position :comments])
   Object
   (render [this]
-    (let [{:keys [react-key current-position client-time frames position] :or {react-key "ROOT"}} (om/props this)]
+    (let [{:keys [react-key current-position client-time frames position comments] :or {react-key "ROOT"}} (om/props this)]
       (dom/div #js {:key react-key :className (str "history-controls " (name position))}
         (dom/button #js {:onClick #(om/transact! this '[(support-viewer/toggle-position)])} (tr "<===>"))
         (dom/button #js {:onClick #(om/transact! this '[(support-viewer/step-back)])} (tr "<Back"))
         (dom/button #js {:onClick #(om/transact! this '[(support-viewer/step-forward)])} (tr "Forward>"))
         (dom/hr nil)
         (dom/span #js {:className "frame"} (trf "Frame {f,number} of {end,number} " :f (inc current-position) :end frames))
-        (dom/span #js {:className "timestamp"} (trf "{ts,date,short} {ts,time,long}" :ts client-time))))))
+        (dom/span #js {:className "timestamp"} (trf "{ts,date,short} {ts,time,long}" :ts client-time))
+        (dom/div #js {:className "user-comments"} comments)))))

 (defn history-entry [history n]
   (let [steps (:steps history)
@@ -35,7 +54,6 @@
       (do (core/refresh this) this)
       (do
         (reset! application (core/mount @application app-root dom-id))
-        (core/reset-state! @application (history-entry history (-> history :steps count dec)))
         (reset! support (core/mount @support SupportViewerRoot dom-id-or-node))
         @support)))

@@ -47,21 +65,37 @@
 (defn start-untangled-support-viewer
   "Create and display a new untangled support viewer on the given app root, with VCR controls to browse through the given history. The support HTML file must include
   a div with app-dom-id (to mount the app) and a div with support-dom-id to mount the viewer controls."
-  [support-dom-id AppRoot app-dom-id history]
+  [support-dom-id AppRoot app-dom-id]
   (let [app (atom (core/new-untangled-client :networking (net/mock-network)))
-        max-idx (dec (count (:steps history)))
-        viewer (map->SupportViewer {:history     history
-                                    :app-root    AppRoot
+        viewer (map->SupportViewer {:app-root    AppRoot
                                     :dom-id      app-dom-id
                                     :application app
                                     :support     (atom (core/new-untangled-client
-                                                         :initial-state {:history          history
+                                                         :initial-state {:history          {}
                                                                          :application      app
-                                                                         :position        :controls-left
+                                                                         :position         :controls-left
                                                                          :client-time      (js/Date.)
-                                                                         :frames           (inc max-idx)
-                                                                         :current-position max-idx}
-                                                         :networking (net/mock-network)))})]
+                                                                         :frames           0
+                                                                         :current-position 0}
+                                                         :started-callback
+                                                         (fn [{:keys [reconciler]}]
+                                                           (load-singleton reconciler `[:support-request]
+                                                             :callback (fn [state]
+                                                                         (swap! state
+                                                                           (fn [s]
+                                                                             (let [req (:support-request @state)
+                                                                                comments (:comment req)
+                                                                                history (:history req)
+                                                                                frames (-> history :steps count)
+                                                                                last-idx (dec frames)]
+                                                                               (core/reset-state! @app (history-entry history last-idx))
+                                                                               (-> s
+                                                                                (dissoc :support-request)
+                                                                                (assoc :comments comments)
+                                                                                (assoc :frames frames)
+                                                                                (assoc :history history)
+                                                                                (assoc :current-position last-idx))))))
+                                                             :params {:id (get-url-param "id")}))))})]
     (core/mount viewer SupportViewerRoot support-dom-id)))

 (defn history-step [state delta-fn]


send back percent for hp

send back percent for hp

--- src/wombats/game/player_stats.clj
+++ src/wombats/game/player_stats.clj
@@ -15,21 +15,23 @@
    stats players))

 (defn- add-player-hp
-  [stats arena]
+  [stats arena wombat-hp]
   (let [player-ids (set (keys stats))]
     (reduce
      (fn [stats-acc cell]
        (let [cell-uuid (get-in cell [:contents :uuid])]
          (if (contains? player-ids cell-uuid)
-           (assoc-in stats-acc [cell-uuid :hp] (get-in cell [:contents :hp]))
+           (let [hp (get-in cell [:contents :hp])
+                 percent (* (double (/ hp wombat-hp)) 100)]
+             (assoc-in stats-acc [cell-uuid :hp] percent))
            stats-acc)))
      stats (flatten arena))))

 (defn get-player-stats
   "Returns stats from game-state"
-  [game-state]
+  [{:keys [players frame arena-config]}]
   (-> {}
-      (add-player-scores (:players game-state))
-      (add-player-hp (get-in game-state [:frame
-                                         :frame/arena]))
+      (add-player-scores players)
+      (add-player-hp (:frame/arena frame)
+                     (:arena/wombat-hp arena-config))
       vals))


add some docstrings for extras/bhob ugens

--- src/overtone/sc/machinery/ugen/metadata/extras/bhob.clj
+++ src/overtone/sc/machinery/ugen/metadata/extras/bhob.clj
@@ -5,838 +5,498 @@
 (def specs
   [
    {:name "Henon2DN"
-    :summary ""
+    :summary "hénon map 2D chaotic generator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "a"
             :default 1.4
-            :doc ""}
+            :doc "equation variable"}

            {:name "b"
             :default 0.3
-            :doc ""}
+            :doc "equation variable"}

            {:name "x0"
             :default 0.30501993062401
-            :doc ""}
+            :doc "initial value of x"}

            {:name "y0"
             :default 0.20938865431933
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
+            :doc "initial value of y"}]
+
+    :rates #{:ar :kr}
+    :doc "The Hénon map is a discrete-time dynamical system. It is one
+          of the most studied examples of dynamical systems that exhibit
+          chaotic behaviour.
+
+          The map depends on two parameters, a and b, which for the
+          canonical Hénon map have values of a = 1.4 and b = 0.3. For
+          the canonical values the Hénon map is chaotic. For other
+          values of a and b the map may be chaotic, intermittent, or
+          converge to a periodic orbit. An overview of the type of
+          behaviour of the map at different parameter values may be
+          obtained from its orbit diagram.
+
+          For more information see the wikipedia article:
+
+          http://en.wikipedia.org/wiki/Hénon_map" }

    {:name "Henon2DL"
-    :summary ""
+    :extends "Henon2DN"
+    :summary "hénon map 2D chaotic generator with linear interpolation"}
+
+   {:name "Henon2DC"
+    :extends "Henon2DN"
+    :summary "hénon map 2D chaotic generator with cubic interpolation"}
+
+   {:name "HenonTrig"
+    :extends "Henon2DN"
+    :summary "hénon map 2D chaotic trigger"
+    :args [{:name "minfreq"
+            :default 5
+            :doc "iteration frequency in Hertz"}
+
+           {:name "maxfreq"
+            :default 10
+            :doc "iteration frequency in Hertz"}
+
+           {:name "a"
+            :default 1.4
+            :doc "Hénon equation variable"}
+
+           {:name "b"
+            :default 0.3
+            :doc "Hénon equation variable"}
+
+           {:name "x0"
+            :default 0.30501993062401
+            :doc "initial value of x"}
+
+           {:name "y0"
+            :default 0.20938865431933
+            :doc "initial value of y"}]
+
+    :rates #{:ar :kr}}
+
+
+   {:name "Gbman2DN"
+    :summary "gingerbreadman map 2D chaotic generator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
-
-           {:name "a"
-            :default 1.4
-            :doc ""}
-
-           {:name "b"
-            :default 0.3
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "x0"
-            :default 0.30501993062401
-            :doc ""}
+            :default 1.2
+            :doc "initial value of x"}

            {:name "y0"
-            :default 0.20938865431933
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Henon2DC"
-    :summary ""
+            :default 2.1
+            :doc "initial value of y"}]
+
+    :rates #{:ar :kr}
+    :doc "A two-dimensional piecewise linear chaotic 2D map. See
+          wikipedia article for more information:
+
+          http://en.wikipedia.org/wiki/Gingerbreadman_map"}
+
+   {:name "Gbman2DL"
+    :extends "Gbman2DN"
+    :summary "gingerbreadman map 2D chaotic generator with linear interpolation"}
+
+   {:name "Gbman2DC"
+    :extends "Gbman2DN"
+    :summary "gingerbreadman map 2D chaotic generator with cubic interpolation"}
+
+   {:name "GbmanTrig"
+    :extends "Gbman2DN"
+    :summary "gingerbreadman map 2D chaotic trigger"
+    :args [{:name "minfreq"
+            :default 5
+            :doc ""}
+
+           {:name "maxfreq"
+            :default 10
+            :doc ""}
+
+           {:name "x0"
+            :default 1.2
+            :doc ""}
+
+           {:name "y0"
+            :default 2.1
+            :doc ""}]}
+
+   {:name "Standard2DN"
+    :summary "standard map 2D chaotic generator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
-
-           {:name "a"
+            :doc "iteration frequency in Hertz"}
+
+           {:name "k"
             :default 1.4
-            :doc ""}
-
-           {:name "b"
-            :default 0.3
-            :doc ""}
+            :doc "perturbation amount"}

            {:name "x0"
-            :default 0.30501993062401
-            :doc ""}
+            :default 4.9789799812499
+            :doc "initial value of x"}

            {:name "y0"
-            :default 0.20938865431933
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "HenonTrig"
-    :summary ""
+            :default 5.7473416156381
+            :doc "initial value of y"}]
+
+    :rates #{:ar :kr}
+    :doc "The standard map is an area-preserving chaotic map from a
+          square with side 2pi onto itself. This map is also known as
+          the Chirikov–Taylor map or as the Chirikov standard map. For
+          more information see the wikipedia article:
+
+          http://en.wikipedia.org/wiki/Standard_map"}
+
+   {:name "Standard2DL"
+    :extends "Standard2DN"
+    :summary "standard map 2D chaotic generator with linear interpolation"}
+
+   {:name "Standard2DC"
+    :extends "Standard2DN"
+    :summary "standard map 2D chaotic generator with cubic interpolation"}
+
+   {:name "StandardTrig"
+    :extends "Standard2DN"
+    :summary "standard map 2D chaotic trigger"
     :args [{:name "minfreq"
             :default 5
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 10
-            :doc ""}
-
-           {:name "a"
+            :doc "iteration frequency in Hertz"}
+
+           {:name "k"
             :default 1.4
-            :doc ""}
-
-           {:name "b"
-            :default 0.3
-            :doc ""}
+            :doc "perturbation amount"}

            {:name "x0"
-            :default 0.30501993062401
-            :doc ""}
+            :default 4.9789799812499
+            :doc "initial value of x"}

            {:name "y0"
-            :default 0.20938865431933
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-
-   {:name "Gbman2DN"
-    :summary ""
+            :default 5.7473416156381
+            :doc "initial value of y"}]}
+
+
+   {:name "Latoocarfian2DN"
+    :summary "latoocarfian 2D chaotic generator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
+            :doc "iteration frequency in Hertz"}
+
+           {:name "a"
+            :default 1
+            :doc "Latoocarfian equation variable"}
+
+           {:name "b"
+            :default 3
+            :doc "Latoocarfian equation variable"}
+
+           {:name "c"
+            :default 0.5
+            :doc "Latoocarfian equation variable"}
+
+           {:name "d"
+            :default 0.5
+            :doc "Latoocarfian equation variable"}

            {:name "x0"
-            :default 1.2
-            :doc ""}
+            :default 0.34082301375036
+            :doc "initial value of x"}

            {:name "y0"
-            :default 2.1
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Gbman2DL"
-    :summary ""
+            :default -0.38270086971332
+            :doc "initial value of y"}]
+
+    :rates #{:ar :kr}
+    :doc "This is a function given in Clifford Pickover's book Chaos In
+          Wonderland, pg 26.
+
+          The function has four parameters a, b, c, and d. The function is:
+
+          xnew = sin(y * b) + c * sin(x * b);
+
+          ynew = sin(x * a) + d * sin(y * a);
+
+          x = xnew;
+
+          y = ynew;
+
+          output = x;
+
+          x values determine frequencies; y values determine amplitudes.
+          Stable ranges for a & b tend to be between -3 to + 3. c & d
+          between 0.5 and 1.5.  There are combinations within these
+          ranges that are unstable, so be prepared to tweak this
+          oscillator." }
+
+   {:name "Latoocarfian2DL"
+    :extends "Latoocarfian2DN"
+    :summary "latoocarfian 2D chaotic generator with linear interpolation"}
+
+   {:name "Latoocarfian2DC"
+    :extends "Latoocarfian2DN"
+    :summary "latoocarfian 2D chaotic generator with cubic interpolation"}
+
+   {:name "LatoocarfianTrig"
+    :extends "Latoocarfian2DN"
+    :summary "latoocarfian 2D chaotic trigger"
+    :args [{:name "minfreq"
+            :default 5
+            :doc ""}
+
+           {:name "maxfreq"
+            :default 10
+            :doc "iteration frequency in Hertz"}
+
+           {:name "a"
+            :default 1
+            :doc "iteration frequency in Hertz"}
+
+           {:name "b"
+            :default 3
+            :doc "Latoocarfian equation variable"}
+
+           {:name "c"
+            :default 0.5
+            :doc "Latoocarfian equation variable"}
+
+           {:name "d"
+            :default 0.5
+            :doc "Latoocarfian equation variable"}
+
+           {:name "x0"
+            :default 0.34082301375036
+            :doc "intial value of x"}
+
+           {:name "y0"
+            :default -0.38270086971332
+            :doc "initial value of y"}]}
+
+   {:name "Lorenz2DN"
+    :summary "lorenz 2D chaotic generator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
+            :doc "iteration frequency in Hertz"}
+
+           {:name "s"
+            :default 10
+            :doc "Lorenz equation variable"}
+
+           {:name "r"
+            :default 28
+            :doc "Lorenz equation variable"}
+
+           {:name "b"
+            :default 2.6666667
+            :doc "Lorenz equation variable"}
+
+           {:name "h"
+            :default 0.02
+            :doc "Lorenz equation variable"}

            {:name "x0"
-            :default 1.2
-            :doc ""}
+            :default 0.090879182417163
+            :doc "initial value of x"}

            {:name "y0"
-            :default 2.1
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Gbman2DC"
-    :summary ""
+            :default 2.97077458055
+            :doc "initial value of y"}
+
+           {:name "z0"
+            :default 24.282041054363
+            :doc "initial value of z"}]
+
+    :rates #{:ar :kr}
+    :doc "The Lorenz system is a system of ordinary differential
+          equations (the Lorenz equations) first studied by Edward
+          Lorenz. It is notable for having chaotic solutions for certain
+          parameter values and initial conditions. In particular, the
+          Lorenz attractor is a set of chaotic solutions of the Lorenz
+          system which, when plotted, resemble a butterfly or figure
+          eight.
+
+          The equation is as follows:
+
+          x' = s(y - x)
+
+          y' = x(r - z) - y
+
+          z' = xy - bz
+
+          The time step amount determines the rate at which the ODE is
+          evaluated.  Higher values will increase the rate, but cause
+          more instability.  This generator uses a different algorithm
+          than the LorenzN/L/C ugen included with current distributions.
+          The resulting sound is somewhat different, and it also means
+          that becomes unstable around 0.02." }
+
+   {:name "Lorenz2DL"
+    :extends "Lorenz2DN"
+    :summary "lorenz 2D chaotic generator with linear interpolation"}
+
+   {:name "Lorenz2DC"
+    :extends "Lorenz2DN"
+    :summary "lorenz 2D chaotic generator with cubic interpolation"}
+
+   {:name "LorenzTrig"
+    :extends "Lorenz2DN"
+    :summary "lorenz 2D chaotic trigger"}
+
+   {:name "Fhn2DN"
+    :summary "FitzHughNagumo Neuron Firing Oscillator with no interpolation"
     :args [{:name "minfreq"
             :default 11025
             :default:kr 40
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 22050
             :default:kr 100
-            :doc ""}
-
-           {:name "x0"
-            :default 1.2
-            :doc ""}
-
-           {:name "y0"
-            :default 2.1
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "GbmanTrig"
-    :summary ""
+            :doc "iteration frequency in Hertz"}
+
+           {:name "urate"
+            :default 0.1
+            :doc "update rate for u"}
+
+           {:name "wrate"
+            :default 0.1
+            :doc "update rate for w"}
+
+           {:name "b0"
+            :default 0.6
+            :doc "equation constant"}
+
+           {:name "b1"
+            :default 0.8
+            :doc "equation constant"}
+
+           {:name "i"
+            :default 0
+            :doc "arbitrary external impulse; i.e. pulse wave, trigger,
+                 lfnoise, or nothing." }
+
+           {:name "u0"
+            :default 0
+            :doc "reset value for u"}
+
+           {:name "w0"
+            :default 0
+            :doc "reset value for w"}]
+
+    :rates #{:ar :kr}
+    :doc "The FitzHugh–Nagumo model is a simplified version of the
+          Hodgkin–Huxley model which models in a detailed manner
+          activation and deactivation dynamics of a spiking neuron. For
+          more information see the wikipedia article:
+
+          http://en.wikipedia.org/wiki/FitzHugh–Nagumo_model"}
+
+   {:name "Fhn2DL"
+    :extends "Fhn2DN"
+    :summary "FitzHughNagumo Neuron Firing Oscillator with linear interpolation"}
+
+   {:name "Fhn2DC"
+    :extends "Fhn2DN"
+    :summary "FitzHughNagumo Neuron Firing Oscillator with cubic interpolation"}
+
+
+   {:name "FhnTrig"
+    :extends "Fhn2DN"
+    :summary "FitzHughNagumo Neuron Firing Oscillator trigger"
     :args [{:name "minfreq"
-            :default 5
-            :doc ""}
+            :default 4
+            :doc "iteration frequency in Hertz"}

            {:name "maxfreq"
             :default 10
-            :doc ""}
-
-           {:name "x0"
-            :default 1.2
-            :doc ""}
-
-           {:name "y0"
-            :default 2.1
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Standard2DN"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "k"
-            :default 1.4
-            :doc ""}
-
-           {:name "x0"
-            :default 4.9789799812499
-            :doc ""}
-
-           {:name "y0"
-            :default 5.7473416156381
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Standard2DL"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "k"
-            :default 1.4
-            :doc ""}
-
-           {:name "x0"
-            :default 4.9789799812499
-            :doc ""}
-
-           {:name "y0"
-            :default 5.7473416156381
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Standard2DC"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "k"
-            :default 1.4
-            :doc ""}
-
-           {:name "x0"
-            :default 4.9789799812499
-            :doc ""}
-
-           {:name "y0"
-            :default 5.7473416156381
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "StandardTrig"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 5
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 10
-            :doc ""}
-
-           {:name "k"
-            :default 1.4
-            :doc ""}
-
-           {:name "x0"
-            :default 4.9789799812499
-            :doc ""}
-
-           {:name "y0"
-            :default 5.7473416156381
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-
-   {:name "Latoocarfian2DN"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "a"
-            :default 1
-            :doc ""}
-
-           {:name "b"
-            :default 3
-            :doc ""}
-
-           {:name "c"
-            :default 0.5
-            :doc ""}
-
-           {:name "d"
-            :default 0.5
-            :doc ""}
-
-           {:name "x0"
-            :default 0.34082301375036
-            :doc ""}
-
-           {:name "y0"
-            :default -0.38270086971332
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Latoocarfian2DL"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "a"
-            :default 1
-            :doc ""}
-
-           {:name "b"
-            :default 3
-            :doc ""}
-
-           {:name "c"
-            :default 0.5
-            :doc ""}
-
-           {:name "d"
-            :default 0.5
-            :doc ""}
-
-           {:name "x0"
-            :default 0.34082301375036
-            :doc ""}
-
-           {:name "y0"
-            :default -0.38270086971332
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-
-   {:name "Latoocarfian2DC"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "a"
-            :default 1
-            :doc ""}
-
-           {:name "b"
-            :default 3
-            :doc ""}
-
-           {:name "c"
-            :default 0.5
-            :doc ""}
-
-           {:name "d"
-            :default 0.5
-            :doc ""}
-
-           {:name "x0"
-            :default 0.34082301375036
-            :doc ""}
-
-           {:name "y0"
-            :default -0.38270086971332
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "LatoocarfianTrig"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 5
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 10
-            :doc ""}
-
-           {:name "a"
-            :default 1
-            :doc ""}
-
-           {:name "b"
-            :default 3
-            :doc ""}
-
-           {:name "c"
-            :default 0.5
-            :doc ""}
-
-           {:name "d"
-            :default 0.5
-            :doc ""}
-
-           {:name "x0"
-            :default 0.34082301375036
-            :doc ""}
-
-           {:name "y0"
-            :default -0.38270086971332
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Lorenz2DN"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "s"
-            :default 10
-            :doc ""}
-
-           {:name "r"
-            :default 28
-            :doc ""}
-
-           {:name "b"
-            :default 2.6666667
-            :doc ""}
-
-           {:name "h"
-            :default 0.02
-            :doc ""}
-
-           {:name "x0"
-            :default 0.090879182417163
-            :doc ""}
-
-           {:name "y0"
-            :default 2.97077458055
-            :doc ""}
-
-           {:name "z0"
-            :default 24.282041054363
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Lorenz2DL"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "s"
-            :default 10
-            :doc ""}
-
-           {:name "r"
-            :default 28
-            :doc ""}
-
-           {:name "b"
-            :default 2.6666667
-            :doc ""}
-
-           {:name "h"
-            :default 0.02
-            :doc ""}
-
-           {:name "x0"
-            :default 0.090879182417163
-            :doc ""}
-
-           {:name "y0"
-            :default 2.97077458055
-            :doc ""}
-
-           {:name "z0"
-            :default 24.282041054363
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Lorenz2DC"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "s"
-            :default 10
-            :doc ""}
-
-           {:name "r"
-            :default 28
-            :doc ""}
-
-           {:name "b"
-            :default 2.6666667
-            :doc ""}
-
-           {:name "h"
-            :default 0.02
-            :doc ""}
-
-           {:name "x0"
-            :default 0.090879182417163
-            :doc ""}
-
-           {:name "y0"
-            :default 2.97077458055
-            :doc ""}
-
-           {:name "z0"
-            :default 24.282041054363
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "LorenzTrig"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "s"
-            :default 10
-            :doc ""}
-
-           {:name "r"
-            :default 28
-            :doc ""}
-
-           {:name "b"
-            :default 2.6666667
-            :doc ""}
-
-           {:name "h"
-            :default 0.02
-            :doc ""}
-
-           {:name "x0"
-            :default 0.090879182417163
-            :doc ""}
-
-           {:name "y0"
-            :default 2.97077458055
-            :doc ""}
-
-           {:name "z0"
-            :default 24.282041054363
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Fhn2DN"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
+            :doc "iteration frequency in Hertz"}

            {:name "urate"
             :default 0.1
-            :doc ""}
+            :doc "update rate for u"}

            {:name "wrate"
             :default 0.1
-            :doc ""}
+            :doc "update rate for 2"}

            {:name "b0"
             :default 0.6
-            :doc ""}
+            :doc "equation constant"}

            {:name "b1"
             :default 0.8
-            :doc ""}
+            :doc "equation constant"}

            {:name "i"
             :default 0
-            :doc ""}
+            :doc "arbitrary external impulse; i.e. pulse wave, trigger,
+                  lfnoise or nothing"}

            {:name "u0"
             :default 0
-            :doc ""}
+            :doc "reset value for u"}

            {:name "w0"
             :default 0
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Fhn2DL"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "urate"
-            :default 0.1
-            :doc ""}
-
-           {:name "wrate"
-            :default 0.1
-            :doc ""}
-
-           {:name "b0"
-            :default 0.6
-            :doc ""}
-
-           {:name "b1"
-            :default 0.8
-            :doc ""}
-
-           {:name "i"
-            :default 0
-            :doc ""}
-
-           {:name "u0"
-            :default 0
-            :doc ""}
-
-           {:name "w0"
-            :default 0
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "Fhn2DC"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 11025
-            :default:kr 40
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 22050
-            :default:kr 100
-            :doc ""}
-
-           {:name "urate"
-            :default 0.1
-            :doc ""}
-
-           {:name "wrate"
-            :default 0.1
-            :doc ""}
-
-           {:name "b0"
-            :default 0.6
-            :doc ""}
-
-           {:name "b1"
-            :default 0.8
-            :doc ""}
-
-           {:name "i"
-            :default 0
-            :doc ""}
-
-           {:name "u0"
-            :default 0
-            :doc ""}
-
-           {:name "w0"
-            :default 0
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
-
-   {:name "FhnTrig"
-    :summary ""
-    :args [{:name "minfreq"
-            :default 4
-            :doc ""}
-
-           {:name "maxfreq"
-            :default 10
-            :doc ""}
-
-           {:name "urate"
-            :default 0.1
-            :doc ""}
-
-           {:name "wrate"
-            :default 0.1
-            :doc ""}
-
-           {:name "b0"
-            :default 0.6
-            :doc ""}
-
-           {:name "b1"
-            :default 0.8
-            :doc ""}
-
-           {:name "i"
-            :default 0
-            :doc ""}
-
-           {:name "u0"
-            :default 0
-            :doc ""}
-
-           {:name "w0"
-            :default 0
-            :doc ""}]
-
-    :rates #{:ar :kr}
-    :doc ""}
+            :doc "reset value for w"}]}

    {:name "PV_CommonMag"
+    :summary "returns common magnitudes"
     :args [{:name "buffer-a"
-            :doc ""}
+            :doc "FFT buffer a"}

            {:name "buffer-b"
-            :doc ""}
+            :doc "FFT buffer b"}

            {:name "tolerance"
             :default 0
-            :doc ""}
+            :doc "magnitudes within which test will pass"}

            {:name "remove"
             :default 0
-            :doc ""}]
+            :doc "scale uncommon magnitudes"}]
     :rates #{:kr}
-    :doc ""}
+    :doc "Returns magnitudes common to buffer-a & buffer-b within a
+         tolerance level." }

    {:name "PV_CommonMul"
     :args [{:name "buffer-a"
@@ -1855,6 +1515,4 @@
    ;;      *ar {|in, tone|
    ;;              ^Mix([HiShelf.ar(in, 10000, tone), LoShelf.ar(in, 100, tone.reciprocal)])
    ;;      }
-   ;;}
-
-   ])
+   ;;}])


equivalent-allocation? should default to false for all other schedulers

--- src/onyx/scheduling/common_job_scheduler.clj
+++ src/onyx/scheduling/common_job_scheduler.clj
@@ -216,7 +216,7 @@

 (defmethod equivalent-allocation? :default
   [_ _]
-  true)
+  false)

 (defn reconfigure-cluster-workload [replica]
   (let [job-offers (job-offer-n-peers replica)


Some monkey patching to launcher.runner to avoid doo exiting on Error

--- test/browser/launcher/runner.cljs
+++ test/browser/launcher/runner.cljs
@@ -8,4 +8,8 @@
             replumb.require-browser-test
             replumb.source-browser-test))

+;; Or doo will exit with an error, see:
+;; https://github.com/bensu/doo/issues/83#issuecomment-165498172
+(set! (.-error js/console) (fn [x] (.log js/console x)))
+
 (doo-all-tests #"^replumb.*-test")


Add some unit tests to verify some corner cases for the symbol clojure.core//

It shows up as a special case just about everywhere.

--- test/clj_ns_browser/test/core.clj
+++ test/clj_ns_browser/test/core.clj
@@ -1,6 +1,17 @@
 (ns clj-ns-browser.test.core
+  (:require [clj-ns-browser.browser :as b]
+            [clj-ns-browser.utils :as u])
   (:use [clj-ns-browser.core])
   (:use [clojure.test]))

-(deftest replace-me ;; FIXME: write
-  (is false "No tests have been written."))
+(deftest slash-symbol-fixup-checks
+  (is (= "Function"
+         (:object-type-str (b/better-get-docs-map "clojure.core//"))))
+  (is (= #'clojure.core// (u/resolve-fqname "clojure.core//")))
+  (is (= #'clojure.core// (u/resolve-fqname "clojure.core" "/")))
+  (is (= "clojure.core//" (u/fqname 'clojure.core//)))
+  (is (= "clojure.core//" (u/fqname '/)))
+  (is (= "clojure.core//"
+         (re-find #"^clojure\.core//"
+                  (u/render-one-doc-text "clojure.core//" "Doc"))))
+  )


Fix tests

Fix tests

Need to remove these with-redefs one of these days...

--- test/docker_clojure/core_test.clj
+++ test/docker_clojure/core_test.clj
@@ -5,7 +5,8 @@

 (deftest image-variants-test
   (testing "generates the expected set of variants"
-    (with-redefs [default-distro (constantly :debian/slim-buster)]
+    (with-redefs [default-distro (constantly :debian/slim-buster)
+                  default-jdk-version 11]
       (let [variants (image-variants #{8 11 14 15}
                                      #{:debian/buster :debian/slim-buster :alpine/alpine}
                                      {"lein"       "2.9.1"


remove closure gen from array-index-of-keyword? and array-index-of-symbol?

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -5606,9 +5606,8 @@
     (loop [i 0]
       (cond
         (<= len i) -1
-        (let [k' (aget arr i)]
-          (and (keyword? k')
-               (identical? kstr (.-fqn k')))) i
+        (and (keyword? (aget arr i))
+             (identical? kstr (.-fqn (aget arr i)))) i
         :else (recur (+ i 2))))))

 (defn- array-index-of-symbol? [arr k]
@@ -5617,9 +5616,8 @@
     (loop [i 0]
       (cond
         (<= len i) -1
-        (let [k' (aget arr i)]
-          (and (symbol? k')
-               (identical? kstr (.-str k')))) i
+        (and (symbol? (aget arr i))
+             (identical? kstr (.-str (aget arr i)))) i
         :else (recur (+ i 2))))))

 (defn- array-index-of-identical? [arr k]


good so far

good so far

--- src/nettle/utils/specfun.clj
+++ src/nettle/utils/specfun.clj
@@ -1,5 +1,6 @@
 (ns nettle.utils.specfun
-  (:require [clojure.spec :as spec]))
+  (:require [clojure.spec :as spec]
+            [nettle.utils.core :as utils]))

 (def funs (atom {}))

@@ -15,5 +16,23 @@

 (spec/def ::defs (spec/* (spec/spec ::def)))

-;(spec/def ::defs (spec/cat :name ::name
-;                           :defs ::defs))
+(spec/def ::defspecfun (spec/cat :name ::name
+                                 :defs ::defs))
+
+(defn defs-to-map [defs]
+  (into {} (map (fn [m]
+                  {(:spec m) `(fn [~(:argsym m)] ~@(:body m))})
+                defs)))
+
+(defn defspecfun-sub [x]
+  `(swap! funs (fn [tgt#] (update-in tgt# [(quote ~(:name x))]
+              (fn [current#]
+                (merge (or current# {})
+                       ~(defs-to-map (:defs x))))))))
+
+
+(defmacro defspecfun [& args]
+  (let [x (spec/conform ::defspecfun args)]
+    (if (= x ::spec/invalid)
+      (utils/common-error (spec/explain-str ::defspecfun args))
+      (defspecfun-sub x))))


Simplify the filter functions used in all the queries, fix replies query by moving the sorting after the join function.

--- src/oc/storage/db/common.clj
+++ src/oc/storage/db/common.clj
@@ -9,6 +9,22 @@
             [oc.lib.db.common :as db-common]))

 (def min-iso8601 (lib-time/to-iso (lib-time/from-millis 0)))
+
+(defn- direction-filter [direction start row-field]
+  (if (= direction :before)
+    (r/gt start row-field)
+    (r/le start row-field)))
+
+(defn- unseen-filter [container-last-seen-at row-field]
+  (r/gt container-last-seen-at row-field))
+
+(defn- user-visibility-filter [user-id entry-row]
+  (r/or ;; has :follow true
+        (-> (r/get-field entry-row [:user-visibility (keyword user-id) :follow])
+            (r/default false))
+        (-> (r/get-field entry-row [:user-visibility (keyword user-id) :unfollow])
+            (r/default true)
+            (r/not))))

 (defn row-pinned-at [allowed-board-uuids row container-id]
   (r/branch (r/contains allowed-board-uuids (r/get-field row :board-uuid))
@@ -43,12 +59,11 @@
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
            ;; Filter out:
-        (r/filter query (r/fn [row]
-          (r/or (r/not start)
-                (r/and (= direction :before)
-                        (r/gt start (r/get-field row :published-at)))
-                (r/and (= direction :after)
-                      (r/le start (r/get-field row :published-at))))))
+        (if start
+          (r/filter query (r/fn [row]
+            ;; All records after/before the start
+            (direction-filter direction start (r/get-field row :published-at))))
+          query)
         (if-not count?
           (r/order-by query (order-fn :published-at))
           query)
@@ -100,12 +115,11 @@
                            (r/get-field :bookmarked-at)
                            (r/default nil))}))
         ;; Filter out:
-        (r/filter query (r/fn [row]
-          (r/or (r/not start)
-                (r/and (= direction :before)
-                       (r/gt start (r/get-field row :sort-value)))
-                (r/and (= direction :after)
-                       (r/le start (r/get-field row :sort-value))))))
+        (if start
+          (r/filter query (r/fn [row]
+            ;; All records after/before the start
+            (direction-filter direction start (r/get-field row :sort-value))))
+          query)
         (if-not count?
           (r/order-by query (order-fn :sort-value))
           query)
@@ -152,28 +166,31 @@
                               (set
                                (map :uuid
                                     (filter #(not= (:access %) "private") allowed-boards)))
-                              (set (map :uuid allowed-boards)))]
+                              (set (map :uuid allowed-boards)))
+        dir-filter (when start
+                     #(direction-filter direction start (r/get-field % :sort-value)))
+        uns-filter (when (and unseen container-last-seen-at)
+                      #(unseen-filter container-last-seen-at (r/get-field % :sort-value)))
+        filter? (or dir-filter uns-filter)]
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         ;; Filter out non allowed boards
         (r/get-all query index-value {:index index-name})
         (r/merge query (r/fn [row]
           {:sort-value (row-order-val allowed-pins-boards row container-id)}))
+        (if filter?
+          (r/filter query (r/fn [row]
+            (cond (and dir-filter uns-filter)
+                  (r/and (dir-filter row) (uns-filter row))
+                  dir-filter
+                  (dir-filter row)
+                  :else
+                  (uns-filter row))))
+          query)
         ;; Order by home pinned-at/published-at
         (if-not count?
           (r/order-by query (order-fn :sort-value))
           query)
-        ;; Filter out:
-        (r/filter query (r/fn [row]
-          (r/and ;; Filter out seen entries if unseen flag is on
-                 (r/or (r/not unseen)
-                       (r/gt (r/get-field row [:published-at])
-                             container-last-seen-at))
-                 (r/or (r/not start)
-                       (r/and (= direction :before)
-                              (r/gt start (r/get-field row :sort-value)))
-                       (r/and (= direction :after)
-                             (r/le start (r/get-field row :sort-value)))))))
            ;; Apply count if needed
         (if count? (r/count query) query)
            ;; Apply limit
@@ -210,12 +227,10 @@
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
         ;; Filter out:
-        (r/filter query (r/fn [row]
-          (r/or (r/not start)
-                (r/and (= direction :before)
-                       (r/gt start (r/get-field row :published-at)))
-                (r/and (= direction :after)
-                       (r/le start (r/get-field row :published-at))))))
+        (if start
+          (r/filter query (r/fn [row]
+            (direction-filter direction start (r/get-field row :published-at))))
+          query)
         (if-not count?
           (r/order-by query (order-fn :published-at))
           query)
@@ -297,42 +312,40 @@
              (coll? relation-fields))
          (boolean? count?)
          (boolean? unseen)]}
-  (let [order-fn (if (= order :desc) r/desc r/asc)]
+  (let [order-fn (if (= order :desc) r/desc r/asc)
+        dir-filter (when start
+                     #(direction-filter direction start (r/get-field % [:reduction :created-at])))
+        uns-filter (when (and unseen container-last-seen-at)
+                      #(unseen-filter container-last-seen-at (r/get-field % [:reduction :created-at])))
+        filter? (or dir-filter uns-filter)]
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table :interactions) query
         (r/get-all query index-value {:index index-name})
         (r/group query :resource-uuid)
         (r/max query :created-at)
         (r/ungroup query)
-        (r/filter query (r/fn [row]
-          ;; All records after/before the start
-          (r/or (r/not start)
-                (r/and (= direction :before)
-                      (r/gt start (r/get-field row [:reduction :created-at])))
-                (r/and (= direction :after)
-                      (r/le start (r/get-field row [:reduction :created-at]))))))
-        ;; Sort
-        (if-not count?
-          (r/order-by query (order-fn (r/fn [row] (r/get-field row [:reduction :created-at]))))
+        (if filter?
+          (r/filter query (r/fn [row]
+            ;; All records after/before the start
+            (cond (and dir-filter uns-filter)
+                  (r/and (dir-filter row)
+                         (uns-filter row))
+                  dir-filter
+                  (dir-filter row)
+                  uns-filter
+                  (uns-filter row))))
           query)
         ;; Join with the relative entry
         (r/eq-join query :group  ;; {:left {:group "resource-uuid" :reduction comment-map} :right entry-map}
           (r/table :entries))
         ;; Filter out items the user is not following
         (r/filter query (r/fn [row]
-          (r/and (r/or (r/not unseen)
-                       (r/gt (r/get-field row [:left :reduction :created-at])
-                             container-last-seen-at))
-                 ;; Filter on the user's visibility map:
-                 (r/or ;; has :follow true
-                       (-> row
-                          (r/get-field [:right :user-visibility (keyword user-id) :follow])
-                          (r/default false))
-                            ;; has :unfollow false (key actually exists)
-                       (-> row
-                           (r/get-field [:right :user-visibility (keyword user-id) :unfollow])
-                           (r/default true)
-                           (r/not))))))
+          ;; Filter on the user's visibility map:
+          (user-visibility-filter user-id (r/get-field row :right))))
+        ;; Sort
+        (if-not count?
+          (r/order-by query (order-fn (r/fn [row] (r/get-field row [:left :reduction :created-at]))))
+          query)
         ;; Apply limit
         (if (pos? limit)
           (r/limit query limit)
@@ -347,12 +360,6 @@
                        :last-activity-at last-activity-at
                        ;; Add sort-value for pagination
                        :sort-value last-activity-at
-                       ;; Count unseen comments
-                       :unseen-comments (-> (r/table :interactions)
-                                            (r/between [true entry-uuid container-last-seen-at]
-                                                       [true entry-uuid r/maxval]
-                                                       {:index :comment-resource-uuid-created-at})
-                                            (r/count))
                        ;; Add all the related interactions
                        :interactions (-> (r/table :interactions)
                                          (r/get-all [entry-uuid] {:index :resource-uuid})


No need to log messenger buffer

No need to log messenger buffer

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -118,7 +118,7 @@
                             release-ch retry-ch decompress-f compress-f]
   component/Lifecycle
   (start [component]
-    (taoensso.timbre/info "Starting Aeron" (:messenger-buffer component))
+    (taoensso.timbre/info "Starting Aeron")
     (let [config (:config peer-group)
           inbound-ch (:inbound-ch (:messenger-buffer component))
           release-ch (chan (sliding-buffer (:onyx.messaging/release-ch-buffer-size defaults)))


make non-public API fns private

make non-public API fns private

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -111,13 +111,13 @@
 (def MIDI-NOTE-RE (re-pattern MIDI-NOTE-RE-STR))
 (def ONLY-MIDI-NOTE-RE (re-pattern (str "\\A" MIDI-NOTE-RE-STR "\\Z")))

-(defn midi-string-matcher
+(defn- midi-string-matcher
   "Determines whether a midi keyword is valid or not. If valid,
   returns a regexp match object"
   [mk]
   (re-find ONLY-MIDI-NOTE-RE (name mk)))

-(defn validate-midi-string!
+(defn- validate-midi-string!
   "Throws a friendly exception if midi-keyword mk is not
   valid. Returns matches if valid."
   [mk]


Detach size toggle from edit-vertex-or-connections

--- src/constraint/edit.cljs
+++ src/constraint/edit.cljs
@@ -49,14 +49,18 @@
         add-or-delete (if (nil? connected-id) add-new-edge delete-edge)]
     (update-in world-state [:edges] add-or-delete)))

+(defn toggle-vertex-size [selected world-state]
+  (let [toggle-between-sizes #(inc (mod % 2))
+        selected-vertex-size [:vertices selected 0]]
+    (update-in world-state
+               selected-vertex-size
+               toggle-between-sizes)))
+
 (defn edit-vertex-or-connections [clicked-vertex world-state]
-  (let [selected (:selected world-state)
-        swap-vertex-size #(inc (mod % 2))
-        selected-vertex-size [:vertices selected 0]]
+  (let [selected (:selected world-state)]
     (if (= selected clicked-vertex)
-      (update-in world-state selected-vertex-size swap-vertex-size)
-      (add-or-delete-edge selected clicked-vertex world-state)
-      )))
+      (toggle-vertex-size selected world-state)
+      (add-or-delete-edge selected clicked-vertex world-state))))

 (defn handle-editing [clicked-what event world-state]
   (let [clicked-edge? (re-matches #"edge.*" clicked-what)


Add something explicit about unboxed values.

--- test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
+++ test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
@@ -28,13 +28,23 @@
   (fact clojure.lang.BigInt => clojure.lang.BigInt)
   (fact clojure.lang.Ratio  => clojure.lang.Ratio))

-(fact "Some examples of values of each type"
+(fact "We can produce unboxed values"
+  ;; **** Is there a way to make a test of this?
+  (byte 2)
+  (short 2)
+  (int 2)
+  (float 2.2)
+  (double 2.2))
+
+(fact "Some examples of values that have literal representations"
   (fact (type 2)     => Long)
   (fact (type 2N)    => clojure.lang.BigInt)
   (fact (type 2/3)   => clojure.lang.Ratio)
   (fact (type 2.0M)  => BigDecimal)
   (fact (type 2M)    => BigDecimal)
-  (fact (type 2.0)   => Double)
+  (fact (type 2.0)   => Double))
+
+(fact "Some examples of values that do not have literal representations"
   (fact (type (Byte. (byte 2)))     => Byte)
   (fact (type (Short. (short 2)))   => Short)
   (fact (type (Integer. (int 2)))   => Integer)


Removed need to specify namespaces for integration tests or unit tests.

--- dev-system/src/cmr/dev_system/tests.clj
+++ dev-system/src/cmr/dev_system/tests.clj
@@ -9,53 +9,41 @@
   (:require [clojure.test :as t]
             [cmr.common.util :as u]
             [cmr.system-int-test.utils.ingest-util :as ingest-util]
-            [cmr.common.dev.util :as du]))
+            [cmr.common.dev.util :as du]
+            [clojure.set :as set]))

-(def unit-test-names
-  "Lists the set of unit tests that will run. This will be combined with a suffix and prefix to
-  create a regular expression to match namespace names."
-  [:acl
-   :common
-   :index-set
-   :indexer
-   :metadata-db
-   :search
-   :spatial
-   :system-trace
-   :transmit
-   :umm])
+(defn system-integration-test?
+  [test-ns]
+  (re-find #"system-int-test" (str test-ns)))

-(def unit-test-ns-matchers
-  "Converted list of unit test names into namespace matching regular expressions"
-  (->> unit-test-names
-       (map name)
-       (map #(str "cmr." % ".test.*"))
-       (map re-pattern)))
+(defn integration-test-ns->compare-value
+  "The comparator function to use for sorting integration tests. We want system integration tests
+  to run last."
+  [test-ns]
+  (if (system-integration-test? test-ns)
+    10
+    1))

-(def integration-namespace-suffixes
-  "A set of suffixes matching integration test namespaces."
-  [:index-set.int-test
-   :metadata-db.int-test
-   :system-int-test])
+(def integration-test-namespaces
+  "The list of integration test namespaces. Anything that contains 'cmr.' and 'int-test' is
+  considered an integration test namespace."
+  (->> (all-ns)
+       (filter #(re-find #"cmr\..*int-test" (str %)))
+       (sort-by integration-test-ns->compare-value)))

-(def integration-test-ns-matchers
-  "Converted list of integration test names into namespace matching regular expressions"
-  (->> integration-namespace-suffixes
-       (map name)
-       (map #(str "cmr." % ".*"))
-       (map re-pattern)))
-
-(defn ns-matchers->namespaces
-  "Finds all the namespaces matching the set of regular expressions passed in."
-  [ns-matchers]
-  (for [ns-matcher ns-matchers
-        test-ns (filter #(re-matches ns-matcher (name (ns-name %))) (all-ns))]
-    test-ns))
+(def unit-test-namespaces
+  "This defines a list of unit test namespaaces. Anything namespace name that contains 'cmr.' and
+  'test' that is not an integration test namespace is considered a unit test namespace."
+  (set/difference
+    (->> (all-ns)
+         (filter #(re-find #"cmr\..*test" (str %)))
+         set)
+    (set integration-test-namespaces)))

 (defn run-tests
   "Runs all the tests matching the list of namespace regular expressions. The tests are run
   in parallel if parallel? is true. Returns a lazy sequence of test results maps."
-  [ns-matchers parallel?]
+  [namespaces parallel?]
   (let [map-fn (if parallel? pmap map)]
     (map-fn (fn [test-ns]
               (taoensso.timbre/set-level! :warn)
@@ -63,7 +51,7 @@
                 (assoc results
                        :took millis
                        :test-ns test-ns)))
-            (ns-matchers->namespaces ns-matchers))))
+            namespaces)))

 (defn analyze-results
   "Analyzes a list of tests results to compute totals, find slowest tests, etc. Returns a map of
@@ -142,8 +130,8 @@
   (println "RUNNING ALL TESTS")
   (let [{:keys [fail-fast?]} options
         test-results-handler (fail-fast?->test-results-handler fail-fast?)
-        unittest-results (run-tests unit-test-ns-matchers true)
-        inttest-results (run-tests integration-test-ns-matchers false)
+        unittest-results (run-tests unit-test-namespaces true)
+        inttest-results (run-tests integration-test-namespaces false)
         [took test-results] (u/time-execution
                               (test-results-handler
                                 (concat unittest-results inttest-results)))]


Make stuff easier for consumers

Make stuff easier for consumers

--- src/eulalie/support.cljc
+++ src/eulalie/support.cljc
@@ -1,15 +1,37 @@
 (ns eulalie.support
-  (:require [plumbing.map]
+  (:require [eulalie.core :as eulalie]
+            [plumbing.map]
             [eulalie.core :as eulalie]
-            [glossop.core]))
+            #? (:clj
+                [glossop.core]
+                :cljs
+                [cljs.core.async]))
+  #? (:cljs (:require-macros [glossop.macros :refer [<? go-catching]])))
+
+(defmulti translate-error-type
+  (fn [service error-type]
+    (keyword "eulalie.service" (name service))))
+(defmethod translate-error-type :default [_ error-type] error-type)
+
+(defn error->throwable [service {:keys [type message] :as error}]
+  (let [type (translate-error-type service error)]
+    (ex-info (name type) (assoc error :type type))))
+
+(defn issue-request! [{:keys [body target service] :as req} req-fn resp-fn]
+  (go-catching
+    (let [{:keys [error body]}
+          (<? (eulalie/issue-request!
+               (assoc req :body (req-fn target body))))]
+      (if error
+        (error->throwable service error)
+        (resp-fn target body)))))

 #? (:clj
     (defmacro defissuer [service target-name args req-fn resp-fn & [doc]]
       (let [fname!  (-> target-name name (str "!") symbol)
             fname!! (-> target-name name (str "!!") symbol)
             args'   (into '[creds] (conj args '& '[extra]))
-            body  `(eulalie/issue-request!
-                    ~service ~(keyword target-name) ~'creds
+            body  `(eulalie.support/issue-request!
                     (merge {:service ~service
                             :target ~(keyword target-name)
                             :creds ~'creds}


player.cljs logging

player.cljs logging

--- src/frontend/player.cljs
+++ src/frontend/player.cljs
@@ -77,6 +77,7 @@

 ; TODO: probably should go into a different module...but which?
 (defn destroy-track [sound-id]
+  (println "Destroying sound-id:" sound-id)
   (let [sound (.getSoundById js/soundManager sound-id)]
     (if (or (undefined? sound)
             (> 3 (.-readyState sound)))
@@ -84,6 +85,7 @@
       (.destruct sound))))

 (defn set-position [position]
+  (println "Setting sound position to: " position)
   (if (= 0 (.-playState (:current-sound @app-state)))
     (.play (:current-sound @app-state)
            #js {:whileplaying while-playing
@@ -101,7 +103,9 @@
   (nil? (:current-sound @app-state)))

 (defn set-volume [volume]
+  (println "Setting volume to: " volume)
   (swap! app-state assoc :volume volume)

   (if-not (nil? (:current-sound @app-state))
-    (.setVolume (:current-sound @app-state) volume)))
+    (.setVolume (:current-sound @app-state) volume)
+    (println "No current-sound to immediately apply volume to.")))


Basic fleetdb querying

Basic fleetdb querying

--- src/hello_world/core.clj
+++ src/hello_world/core.clj
@@ -19,11 +19,15 @@
 (require 'hiccup.form)
 (require 'fleetdb.client)

+(def client (connect))
+
 (def todos [
             {:task "Task 1" :done? false }
             {:task "Task 2" :done? true }
             {:task "Task 3" :done? false }
             ])
+
+(defn select-all-tasks [] (client ["select" "tasks"]))

 (defn template [head, body]
   (html5
@@ -36,9 +40,9 @@
   (for [task tasks]
     (html
      [:div
-      [:h3 (task :task)]
+      [:h3 (task "task")]

-      (if (task :done?)
+      (if (task "done?")
         [:button.btn.btn-success
          [:span.glyphicon.glyphicon-ok-sign]
         ]
@@ -52,7 +56,7 @@
   )

 (def index (template (html
-                      [:title "Clojure TODO!"]
+                      [:title "Clojure Todo"]
                       [:meta {
                               :name "viewport"
                               :content "width=device-width, initial-scale=1.0"
@@ -81,7 +85,7 @@
                        [:div.starter-template
                         [:h1 "Clojure Todo"]
                         [:p.lead "All tasks:"]
-                        (task-template todos)
+                        (task-template (select-all-tasks))
                         (form-to {:class "form-inline" :role "form"} [:task "/post"]
                                  [:div.form-group
                                   (label "task" "Task:")


Now has a sector generator built in

Now has a sector generator built in

--- src/hphelper/handler.clj
+++ src/hphelper/handler.clj
@@ -18,6 +18,9 @@
             [hphelper.scengen.select :as ssel]
             [hphelper.shared.saveload :as sl]
             [hiccup.core :refer :all]
+
+            ;; Sector Generator
+            [hphelper.sectorgen.generator :as secgen]

             ;; Live paranoia
             [hphelper.live.view :as lview]
@@ -105,11 +108,18 @@
       (println (:hps scen))
       (sprint/html-print-player-sheet scen ((:hps scen) (Integer/parseInt (:p_id params))))))

+  ;; Hacky way to print a player's entire player sheet
   (GET "/player/:scen_id/:p_id/" {{scen_id :scen_id p_id :p_id} :params baseURL :context}
       (let [scen (sl/load-fullscen-from-db (c/int-show (Integer/parseInt scen_id)))]
          (sprint/html-print-player-sheet scen ((:hps scen) (c/int-show (Integer/parseInt p_id))))))
+  ;; Prints the minion sheet from a single scenario
   (GET "/minions/:scen_id/" {{scen_id :scen_id} :params baseURL :context}
        (sprint/html-print-optional (sl/load-fullscen-from-db (c/int-show (Integer/parseInt scen_id))) '(:minions)))
+
+  ;; SECTORGEN
+  ;; Prints 7 randomly generated sectors
+  (GET "/sectorgen/" []
+       (secgen/html-print-neighbours 7))

   ;; LIVE
   (GET "/live/new/:scen_id/" {{scen_id :scen_id} :params baseURL :context}
@@ -176,6 +186,7 @@
            [:body
             [:a {:href (str baseURL "/scen/")} "Scenario Generator"][:br]
             [:a {:href (str baseURL "/char/")} "Character Generator"][:br]
+            [:a {:href (str baseURL "/sectorgen/")} "Sector Generator"][:br]
             [:br]
             [:a {:href "https://github.com/lsenjov/hphelper"} "Source Code"][:br]
             ]]))


[#8997] Error 'Hzb.checkViodeoAuthorizationStatus in not a function' at attempt to scan QR on IOS

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

--- src/status_im/ui/components/permissions.cljs
+++ src/status_im/ui/components/permissions.cljs
@@ -1,7 +1,5 @@
 (ns status-im.ui.components.permissions
   (:require [status-im.utils.platform :as platform]
-            [taoensso.timbre :as log]
-            [status-im.ui.components.camera :as camera]
             [status-im.react-native.js-dependencies :as js-dependencies]))

 (def permissions-class (.-PermissionsAndroid js-dependencies/react-native))
@@ -27,7 +25,4 @@
                     (on-allowed)
                     (on-denied)))
           (.catch on-denied)))
-
-    (if ((set permissions) :camera)
-      (camera/request-access-ios on-allowed on-denied)
-      (on-allowed))))
+    (on-allowed)))


Load cljs.js and cljs.env before macrowbar is loaded (also - Trigger travis build)

--- src/test/cljc/mikron/runtime/core_test2.cljc
+++ src/test/cljc/mikron/runtime/core_test2.cljc
@@ -4,14 +4,15 @@
             [clojure.test.check.clojure-test :as tc.test #?@(:cljs [:include-macros true])]
             [clojure.test.check.properties :as tc.prop #?@(:cljs [:include-macros true])]
             [clojure.test.check.generators :as tc.gen #?@(:cljs [:include-macros true])]
+
+            ;; Load these for macrowbar
+            [cljs.js]
+            [cljs.env]
+
             [macrowbar.core :as macrowbar]
             [mikron.runtime.core :as mikron]
             [mikron.runtime.test-generators :as test-generators]
-            [mikron.runtime.test-util :as test-util]
-
-            ;; Load these for macrowbar
-            [cljs.js]
-            [cljs.env]))
+            [mikron.runtime.test-util :as test-util]))

 ;; Property based testing


working on deep fn trace

working on deep fn trace

--- src/com/billpiel/mem_tracer/util/other.clj
+++ src/com/billpiel/mem_tracer/util/other.clj
@@ -137,6 +137,23 @@
                                                    %))))
        #'~alias))

+(defn macro?
+  [v]
+  (try (-> v
+           (obj-pred-action-else symbol?
+                                 :t-fn
+                                 find-var)
+           meta
+           :macro)
+       (catch java.lang.IllegalArgumentException e
+         (macro? (qualify-sym 'clojure.core v)))))
+
+(defn special-operator?
+  [v]
+  ((some-fn macro?
+            special-symbol?)
+   v))
+
 (defn source-fn-var
   [fn-var]
   (->> fn-var
@@ -172,44 +189,82 @@
          inc
          inc))

-(-> fff var meta :source clojure.walk/macroexpand-all)
-(eval '(do (declare x) (let [x 4] (eval '(inc x)))))
+(defn back-into
+  [orig noob]
+
+  (let [r ((if (seq? orig)
+             reverse
+             identity)
+           (into  (or (empty orig)
+                      [])
+                  noob))
+        ]
+    r))
+
+(defn swap-in-path-syms
+  [form & [path]]
+  (cond
+    (special-operator? form) form
+    (coll? form)  (back-into form (doall (map-indexed #(swap-in-path-syms %2
+                                                                          (conj (or path
+                                                                                [])
+                                                                                %))
+                                                      form)))
+    :else (symbol (apply str
+                         "___"
+                         (clojure.string/join "-"
+                                              path)))))
+
+(defn deep-zipmap
+       [a b]
+       (zipmap (filter (comp not coll?) (tree-seq coll? seq a))
+               (filter (comp not coll?) (tree-seq coll? seq b))))

 #_ (do
-     (defn ff [] 1)
-
-     (->> #'ff
-          meta ((juxt :ns
-                      (constantly "/")
-                      :name))
-          (apply str)
-          symbol
-          clojure.repl/source-fn)
-
-     (defn f1
-       [a b c]
-       (inc (let [d 4
-                  e 5]
-              (-> a
-                  inc
-                  (+ d)))))
-
-     (f1 1 2 3)
-
-     (clojure.pprint/pprint (clojure.walk/macroexpand-all '(defn f1
-                                                             [a b c]
-                                                             (inc (let [d 4
-                                                                        e 5]
-                                                                    (-> a
-                                                                        inc
-                                                                        (+ d)))))))
-     (def f1
-       (fn* ([a b c]
-             (inc (let* [d 4
-                         e 5]
-                        (+
-                         (inc a)
-                         d))))))
-
-
-     (comment))
+     (clojure.walk/macroexpand-all
+      (swap-in-path-syms
+       '(defn f1 [a] (let [b 4] {a (-> a (+ b))})))
+
+      )
+
+
+
+     (def src '(defn f1 [a] (let [[b] [4 5]] {a (-> a (+ b) dec)})))
+     '(def f1 (fn* ([a]
+                    (let* [vec__21418 [4 5]
+                           b (clojure.core/nth vec__21418 0
+                                               nil)]
+                          {a (dec (+ a
+                                     b))}))))
+
+     {[2 1 1 1 3 0] {:type :expr
+                     :provides [3 1 0 0] ; some info about mapping to '[4 5]  ??
+                     :coordinates [2 1 1 1 3 0]
+                     :expanded '(clojure.core/nth vec__21418 0 nil)}
+      [2 1 1 2 0 1 0] {:type :expr
+                       :provides [3 2 0 1 3]
+                       :coordinates [2 1 1 2 0 1 0]
+                       :original '(-> a (+ b) dec)
+                       :expanded '(dec (+ a b))}
+      [2 1 1 2 0 1 1 0] {:type :expr
+                         :provides [3 2 0 1 2 0]
+                         :coordinates [2 1 1 2 0 1 1 0]
+                         :original '(+ b)
+                         :expanded '(+ a b)}}
+
+     '(def f1_1234 (fn* ([a]
+                         (let* [vec__21418 [4 5]
+                                b ((f* nth [2 1 1 1 3 0])
+                                   vec__21418 0
+                                   nil)]
+                               {a ((f* dec [2 1 1 2 0 1 0])
+                                   ((f* + [2 1 1 2 0 1 1 0])
+                                    a b))}))))
+
+     (deep-zipmap (clojure.walk/macroexpand-all
+                   (swap-in-path-syms src))
+                  (swap-in-path-syms
+                   (clojure.walk/macroexpand-all src)))
+
+     (swap-in-path-syms
+      (clojure.walk/macroexpand-all src)))


Move basic empty world ns declaration here

Instead of having the renderer set up the same baseline
environment for every world

--- src/com/frereth/server/comms/registrar.clj
+++ src/com/frereth/server/comms/registrar.clj
@@ -105,7 +105,14 @@
                   ;; Or, at least, that we're in an interpreter
                   ;; environment/namespace
                   ;; that acts as if those assumptions are true
-                  :script '[(defn listen [element event-type]
+                  :script '[(ns empty.world
+                                 "Need a naming scheme
+Although, honestly, for now, user makes as much sense as any"
+                                 (:require-macros [cljs.core.async.macros :as asyncm :refer (go go-loop)])
+                                 (:require [cljs.core.async :as async]
+                                           [goog.dom :as dom]
+                                           [goog.events :as events]))
+                            (defn listen [element event-type]
                               (let [out (chan)]
                                 (events/listen element event-type
                                                (fn [e]


Minor fixes on layers drag and drop on layers toolbox.

--- src/uxbox/ui/workspace/toolboxes/layers.cljs
+++ src/uxbox/ui/workspace/toolboxes/layers.cljs
@@ -224,11 +224,10 @@
             (on-drag-leave [event]
               (swap! local assoc :over false))]
       (html
-       [:li.group {:class (when open? "open")
-                   :key (str (:id item))
-                   :draggable true}
+       [:li.group {:class (when open? "open")}
         [:div.element-list-body
          {:class classes
+          :draggable true
           :on-drag-start on-drag-start
           :on-drag-enter on-drag-enter
           :on-drag-leave on-drag-leave


Add some more docs, result-seq, result-meta

--- src/main/clojure/com/stuartsierra/lazytest2.clj
+++ src/main/clojure/com/stuartsierra/lazytest2.clj
@@ -22,6 +22,17 @@

 (deftype TestThrown [source states throwable]
   Successful (success? [] false))
+
+(defn result-seq
+  "Given a single TestResult, returns a depth-first sequence of that
+  TestResult and all its children."
+  [r]
+  (tree-seq :children :children r))
+
+(defn result-meta
+  "Given a TestResult, returns the metadata map of its source."
+  [r]
+  (meta (:source r)))

 ;;; Contexts


[STORM-1424] Removed unused topology-path variable in config.clj/read-supervisor-storm-conf

--- storm-core/src/clj/backtype/storm/config.clj
+++ storm-core/src/clj/backtype/storm/config.clj
@@ -217,8 +217,7 @@
 (defn read-supervisor-storm-conf
   [conf storm-id]
   (let [stormroot (supervisor-stormdist-root conf storm-id)
-        conf-path (supervisor-stormconf-path stormroot)
-        topology-path (supervisor-stormcode-path stormroot)]
+        conf-path (supervisor-stormconf-path stormroot)]
     (read-supervisor-storm-conf-given-path conf conf-path)))

 (defn read-supervisor-topology


simplify contact component

simplify contact component

--- src-cljs/reagent_tutorial/core.cljs
+++ src-cljs/reagent_tutorial/core.cljs
@@ -46,12 +46,11 @@
         (>= c 2) (assoc :middle middle)))))

 ;; UI components
-(defn contact []
-  (fn [c]
-    [:li
-     [:span (display-name c)]
-     [:button {:on-click #(remove-contact! c)}
-      "Delete"]]))
+(defn contact [c]
+  [:li
+   [:span (display-name c)]
+   [:button {:on-click #(remove-contact! c)}
+    "Delete"]])

 (defn new-contact []
   (let [val (r/atom "")]


Use original file name when inlining mail images

--- systems/mail/src/containium/systems/mail.clj
+++ systems/mail/src/containium/systems/mail.clj
@@ -81,7 +81,7 @@
               (recur (zip/next (zip/edit loc assoc-in [:attrs :src] (str "cid:" cid)))
                      (cond-> contents
                              content (conj {:type :inline, :content content, :content-id cid
-                                            :content-type content-type}))))
+                                            :content-type content-type, :file-name src}))))
             (recur (zip/next loc) contents)))))))