Moving toward parallelization

Moving toward parallelization

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -36,6 +36,7 @@
                                          TaggedImageStorageRam]
            [org.micromanager.utils ReportingUtils]
            [mmcorej TaggedImage Configuration Metadata]
+           (java.util.concurrent Executors TimeUnit)
            [java.util.prefs Preferences]
            [java.net InetAddress]
            [java.util.concurrent LinkedBlockingQueue TimeUnit CountDownLatch]
@@ -312,6 +313,17 @@
 (defn first-trigger-missing? []
   (= "1" (get-property-value (core getCameraDevice) "OutputTriggerFirstMissing")))

+(defn keep-collecting-from-circular-buffer?
+  "Returns true if there is no reason to stop popping images
+   from the circular buffer."
+  []
+  (when (. mmc isBufferOverflowed)
+    (swap! state assoc :circular-buffer-overflow true))
+  (and (not (@state :stop))
+       (or (pos? (. mmc getRemainingImageCount))
+           (and (. mmc isSequenceRunning)
+                (not (@state :circular-buffer-overflow))))))
+
 (defn init-burst [length trigger-sequence relative-z]
   (core setAutoShutter (@state :init-auto-shutter))
   (load-property-sequences (:properties trigger-sequence))
@@ -323,17 +335,28 @@
     (swap! state assoc-in [:last-stage-positions (core getFocusDevice)]
            (last absolute-slices))))

-(defn pop-burst-image
-  "Returns a TaggedImage from the circular buffer -- times out if no
-   image is found in circular buffer after waiting up to timeout-ms."
+(defn pop-tagged-image []
+  (try (core popNextTaggedImage)
+       (catch Exception e nil))) ;(println e))))
+
+(defn pop-tagged-image-timeout
   [timeout-ms]
   (let [start-time (System/currentTimeMillis)]
-    (while (and (. mmc isSequenceRunning)
-                (zero? (. mmc getRemainingImageCount)))
-      (if (< timeout-ms (- (System/currentTimeMillis) start-time))
-        (throw (Exception. "Timed out waiting for image to arrive from camera."))
-        (Thread/sleep 5))))
-  (let [tagged-image (core popNextTaggedImage)]
+    (loop []
+      (when (keep-collecting-from-circular-buffer?)
+        (if-let [image (pop-tagged-image)]
+          image
+          (if (< timeout-ms (- (System/currentTimeMillis) start-time))
+            (do (println "Timed out waiting for image to arrive from camera.")
+                (throw (Exception. "Timed out waiting for image to arrive from camera.")))
+            (do (Thread/sleep 1)
+                (recur))))))))
+
+(defn pop-burst-image
+  [timeout-ms]
+  (let [tagged-image (pop-tagged-image-timeout timeout-ms)]
+    ;(println "pop")
+        ;(println tagged-image)
     {:pix (.pix tagged-image)
      :tags (json-to-data (.tags tagged-image))}))

@@ -360,17 +383,6 @@
    (ReportingUtils/showError "Circular buffer overflowed."))
  (while (and (not (@state :stop)) (. mmc isSequenceRunning))
    (Thread/sleep 5)))
-
-(defn keep-collecting-from-circular-buffer?
-  "Returns true if there is no reason to stop popping images
-   from the circular buffer."
-  []
-  (when (. mmc isBufferOverflowed)
-    (swap! state assoc :circular-buffer-overflow true))
-  (and (not (@state :stop))
-       (or (pos? (. mmc getRemainingImageCount))
-           (and (. mmc isSequenceRunning)
-                (not (@state :circular-buffer-overflow))))))

 (defn assoc-if-nil [m k v]
   (if (nil? (m k))
@@ -397,6 +409,17 @@
                   (assoc :camera-channel-index cam-chan))
         time-stamp (burst-time (:tags image) @state)]
     (annotate-image image event @state time-stamp)))
+
+(defmacro doseq-parallel [seq-exprs & body]
+  `(let [pool# (-> (Runtime/getRuntime) .availableProcessors Executors/newFixedThreadPool)]
+     (println (.getCorePoolSize pool#))
+     (doseq ~seq-exprs
+       (let [body-fn# (cast Runnable (fn []
+                                       ;(println (str (Thread/currentThread)))
+                                       ~@body))]
+         (.submit pool# body-fn#)))
+     (.shutdown pool#)
+     (.awaitTermination pool# 10 TimeUnit/DAYS)))

 (defn produce-burst-images
   "Pops images from circular buffer and sends them to output queue."


tweaks

tweaks

--- src/jsx_fun/core.clj
+++ src/jsx_fun/core.clj
@@ -46,17 +46,6 @@
         (object-array [src options]))
       "code")))

-#_(defn transform-commonjs
-  [filename src]
-  (let [^List externs '()
-        ^List inputs [(SourceFile/fromCode filename src)]
-        ^CompilerOptions options (set-options {:lang-in :es5 :type :commonjs} (CompilerOptions.))
-        compiler (cl/make-closure-compiler)
-        ^Result result (.compile compiler externs inputs options)]
-    (if (.success result)
-      (.toSource compiler)
-      (cl/report-failure result))))
-
 (defn transform-commonjs
   [filename src]
   (let [js      [(SourceFile/fromCode filename src)]
@@ -72,6 +61,17 @@
         false)
       nil root)
     (.toSource comp root)))
+
+;(defn transform-commonjs
+;  [filename src]
+;  (let [^List externs '()
+;        ^List inputs [(SourceFile/fromCode filename src)]
+;        ^CompilerOptions options (set-options {:lang-in :es5 :type :commonjs} (CompilerOptions.))
+;        compiler (cl/make-closure-compiler)
+;        ^Result result (.compile compiler externs inputs options)]
+;    (if (.success result)
+;      (.toSource compiler)
+;      (cl/report-failure result))))

 (comment
   (def jsx-eng (jsx-engine))


rename :schema -> :var-keys

rename :schema -> :var-keys

--- src/kbilling/calc/transform.cljs
+++ src/kbilling/calc/transform.cljs
@@ -114,9 +114,9 @@

 (defn transform-op [load-plan op]
   (match [op]
-    [[:schema plan-paths]] (into #{} (for [plan-path plan-paths
-                                           :let [plan (load-plan plan-path)]
-                                           vark (var-keys plan)] vark))
+    [[:var-keys plan-paths]] (into #{} (for [plan-path plan-paths
+                                             :let [plan (load-plan plan-path)]
+                                             vark (var-keys plan)] vark))

     [[:subscribe plan-path vars]] (let [plan (load-plan plan-path)
                                         new-vars (subscribe plan vars)]


Fix type in *-from fns.

Fix type in *-from fns.

--- src/kixi/hecuba/api/projects.clj
+++ src/kixi/hecuba/api/projects.clj
@@ -12,10 +12,10 @@

 (defn- programme-id-from [ctx]
-  (get-in [:request :route-params :programme-id]))
+  (get-in ctx [:request :route-params :programme-id]))

 (defn- project-id-from [ctx]
-  (get-in [:request :route-params :project-id]))
+  (get-in ctx [:request :route-params :project-id]))

 (defn index-handle-ok [querier handlers ctx]
   (let [request (:request ctx)


upddate java version

upddate java version

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}

-  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
+  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]

   :global-vars {*warn-on-reflection* true
                *assert* true}


Fixed missing network sf #338

Fixed missing network sf
#338

--- src/cljs/swarmpit/component/service/form_settings.cljs
+++ src/cljs/swarmpit/component/service/form_settings.cljs
@@ -186,5 +186,8 @@
           (form-replicas replicas)))
       (comp/grid
         {:item true
+         :xs   12} (networks/form))
+      (comp/grid
+        {:item true
          :xs   12}
         (form-command (str/join " " command))))))


fix shadow$provide again ...

fix shadow$provide again ...

--- src/main/shadow/build/output.clj
+++ src/main/shadow/build/output.clj
@@ -139,7 +139,7 @@

 (defn generate-source-map
   [state
-   {:keys [resource-name output-name input] :as src}
+   {:keys [resource-name output-name file input] :as src}
    {:keys [source source-map source-map-json] :as output}
    js-file
    prepend]
@@ -152,6 +152,10 @@
           src-map-file
           (io/file (str (.getAbsolutePath js-file) ".map"))

+          use-fs-path?
+          (true? (get-in state [:compiler-options :source-map-use-fs-paths]))
+
+          ;; FIXME: make this use encode-source-map from above
           source-map-json
           (or source-map-json
               (let [sm-opts
@@ -166,7 +170,10 @@
                     (-> {(util/flat-filename resource-name) source-map}
                         (sm/encode* sm-opts)
                         (dissoc "lineCount") ;; its nil which closure doesn't like
-                        (assoc "sources" [resource-name])
+                        (assoc "sources"
+                               [(if (and use-fs-path? file)
+                                  (-> file (.getAbsoluteFile) (.toURI))
+                                  resource-name)])
                         )]

                 (json/write-str source-map-v3 :escape-slash false)))]
@@ -271,9 +278,9 @@
                 ;; will mess up source maps otherwise
                 ;; append is fine
                 final-output
-                (str prepend
-                     (when (and any-shadow-js? goog-base)
+                (str (when (and any-shadow-js? goog-base)
                        "var shadow$provide = {};\n")
+                     prepend
                      shadow-js-prepend
                      output
                      append


Minor DB serialization tweak :lock_with_ink_pen:

--- src/metabase/models/database.clj
+++ src/metabase/models/database.clj
@@ -43,5 +43,6 @@
                                 (encode-map (cond
                                               (not (:is_superuser @*current-user*)) (dissoc db :details)
                                               (get-in db [:details :password])      (assoc-in db [:details :password] protected-password)
+                                              (get-in db [:details :pass])          (assoc-in db [:details :pass] protected-password)     ; MongoDB uses "pass" instead of password
                                               :else                                 db)
                                             json-generator)))


hard to trace arity exception

hard to trace arity exception

--- src/mediakeys/hotkeys.clj
+++ src/mediakeys/hotkeys.clj
@@ -26,7 +26,7 @@

 (def new-provider!
     (let [provider (atom nil)]
-        (fn [ ]
+        (fn yosup [ ]
             (when @provider
                 (doto @provider
                     (.reset)
@@ -37,9 +37,10 @@

 (def new-keys!
     (let [keys (atom nil)]
-        (fn [key-update]
-            (swap! keys #(merge key-update))
-            @keys)))
+        (fn ([] @keys)
+            ([key-update]
+                (swap! keys #(merge key-update))
+                @keys))))

 (defn register-keys [^Provider provider keys]
     (let [return (chan)]
@@ -51,10 +52,10 @@
                             (put! return action)))))
         return))

-(defn keypress-channel! [key-changes]
-    (let [old-keys (new-keys! { })]
+(defn keypress-channel! [key-change]
+    (let [old-keys (new-keys!)]
         (try
-            (let [keys (new-keys! key-changes)
+            (let [keys (new-keys! key-change)
                   provider (new-provider!)
                   channel (register-keys provider keys)]
                 (save-keys! keys)


add a bit

add a bit

--- Restore-IP-Addresses/RIA.clj
+++ Restore-IP-Addresses/RIA.clj
@@ -3,9 +3,28 @@
 (def testStr1 "010010")
 (def testStr1 "101023")

+(defn filter-ip [ip]
+  (cond (> (Integer. ip) 255) false
+        (and (> (count ip) 1) (= \0 (nth ip 0))) false
+        :else
+        true)))
+
+(defn find-next [ipstr doneip]
+  "give total ip string and ip done, return next possible ip"
+  (let [allpossible (for [i (range 1 4)
+                          :let [len (count doneip)]]
+                      (subs ipstr len (+ len i)))]
+    (for [ip allpossible
+          :when (filter-ip ip)]
+      ip)))
+
+
 (defn restore-Ip-Addresses [ipstr]
   (let [ippool (atom [])]))

-(defn find-next [ipstr ipdonelist]
-  "give total ip string and ip done list, return next possible ip"
-  )
+
+
+
+
+
+


Allow cards to be moved to 'nil' collection. Resolves #4004

--- src/metabase/api/card.clj
+++ src/metabase/api/card.clj
@@ -224,7 +224,7 @@
    collection_id          (s/maybe su/IntGreaterThanZero)}
   (let [card (write-check Card id)]
     ;; if we're changing the `collection_id` of the Card, make sure we have write permissions for the new group
-    (when (not= (:collection_id card) collection_id)
+    (when (and (not (nil? collection_id)) (not= (:collection_id card) collection_id))
       (check-permissions-for-collection collection_id))
     ;; ok, now save the Card
     (db/update! Card id


inlined macro

inlined macro

--- src/midje/unprocessed.clj
+++ src/midje/unprocessed.clj
@@ -9,8 +9,7 @@
         [midje.checkers.extended-equality :only [extended-=]]
         [midje.checkers.chatty :only [chatty-checker?]]
         [midje.internal-ideas.capturedthrowable :only [captured-throwable]]
-        [midje.util.namespace :only [immigrate]]
-        [clojure.tools.macro :only [macrolet]]))
+        [midje.util.namespace :only [immigrate]]))
 (immigrate 'midje.checkers)

@@ -62,14 +61,12 @@
   the first call is supposed to make. See the documentation at
   http://github.com/marick/Midje."
   [unprocessed-check local-fakes]
-  (macrolet [(capturing-throwable [form]
-               `(try ~form
-                  (catch Throwable e#
-                    (captured-throwable e#))))]
-    (with-installed-fakes (concat (reverse (filter :data-fake (background-fakes))) local-fakes)
-      (let [code-under-test-result (capturing-throwable
-                                    (eagerly
-                                     ((:function-under-test unprocessed-check))))]
-        (check-call-counts local-fakes)
-        (check-result code-under-test-result unprocessed-check)
-        :irrelevant-return-value))))+  (with-installed-fakes (concat (reverse (filter :data-fake (background-fakes))) local-fakes)
+    (let [code-under-test-result (try
+                                   (eagerly
+                                     ((:function-under-test unprocessed-check)))
+                                  (catch Throwable ex
+                                    (captured-throwable ex)))]
+      (check-call-counts local-fakes)
+      (check-result code-under-test-result unprocessed-check)
+      :irrelevant-return-value)))


Order by Alias instead of Relation Name

Order by Alias instead of Relation Name

--- src/ambig_index_finder/parser.clj
+++ src/ambig_index_finder/parser.clj
@@ -11,11 +11,12 @@
   (* (count (:samplesizes opts))
      (:repetitions opts)))

+(def index-access-identifier "Alias")
 (def relation-accesses (atom []))

 ;; Not the best solution, but the easiest in this case
 (defn- save-if-relation-access [o]
-  (if (and (map? o) (contains? o "Relation Name"))
+  (if (and (map? o) (contains? o index-access-identifier))
     (swap! relation-accesses conj o))
   o)

@@ -27,7 +28,7 @@
 (defn- group-by-relation [accesses]
   (apply merge-with concat
          (map
-           (fn [l] (group-by #(get % "Relation Name") l))
+           (fn [l] (group-by #(get % index-access-identifier) l))
            accesses)))

 (defn- diff-relation-access [access-by-relation]
@@ -46,7 +47,9 @@
     diff))

 (defn analyze-plans-for-all-queries [all-plans]
-  (map analyze-plans-for-query all-plans))
+  (map
+    #(map analyze-plans-for-query %)
+    all-plans))

 (defn- save-parse-result [file-name parse-result]
   (let [file-path (str parse-results-dir file-name)]
@@ -64,7 +67,7 @@
                 opts (json/read-str (first lines) :key-fn keyword)
                 plans (partition
                         (plans-per-query opts)
-                        (mapcat json/read-str (rest lines)))
+                        (map json/read-str (rest lines)))
                 parse-result (analyze-plans-for-all-queries plans)]
             (log/info "Analyzing plans found in" (first args) "which has options" opts)
             (save-parse-result file-name parse-result)))))))


bug fix

bug fix

--- clj-tcp/src/clj_tcp/client.clj
+++ clj-tcp/src/clj_tcp/client.clj
@@ -207,8 +207,9 @@

 (defn- create-write-lock-ch [max-concurrent-writes]
   (let [write-lock-ch (chan (dropping-buffer max-concurrent-writes))]
-    (doseq [i (range max-concurrent-writes)]
-      (>! write-lock-ch 1))))
+    (go
+      (doseq [i (range max-concurrent-writes)]
+        (>! write-lock-ch 1)))))

 (defn write-poison [{:keys [write-ch read-ch internal-error-ch]}]
   (go (>! write-ch [(->Poison) nil] ))


Bump to leanest and meanest clojure/script versions

--- cljx/plongeur-cljs/project.clj
+++ cljx/plongeur-cljs/project.clj
@@ -2,9 +2,9 @@

   :description "Plongeur frontend: Kierros/Cycle architecture."

-  :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/clojurescript "1.8.34"]
-                 [org.clojure/core.async "0.2.374" :exclusions [org.clojure/tools.reader]]
+  :dependencies [[org.clojure/clojure "1.9.0-alpha7"]
+                 [org.clojure/clojurescript "1.9.89"]
+                 [org.clojure/core.async "0.2.385" :exclusions [org.clojure/tools.reader]]
                  [com.taoensso/sente "1.8.1"]
                  [quiescent "0.3.1"]
                  [sablono "0.6.3"]


Include DateTimeField unit in QP response

--- src/metabase/driver/query_processor/annotate.clj
+++ src/metabase/driver/query_processor/annotate.clj
@@ -47,17 +47,26 @@
 (defn- flatten-collect-fields [form]
   (let [fields (transient [])]
     (clojure.walk/prewalk (fn [f]
-                            (if-not (= (type f) metabase.driver.query_processor.interface.Field) f
-                                    (do
-                                      (conj! fields f)
-                                      ;; HACK !!!
-                                      ;; Nested Mongo fields come back inside of their parent when you specify them in the fields clause
-                                      ;; e.g. (Q fields venue...name) will return rows like {:venue {:name "Kyle's Low-Carb Grill"}}
-                                      ;; Until we fix this the right way we'll just include the parent Field in the :query-fields list so the pattern
-                                      ;; matching works correctly.
-                                      ;; (This hack was part of the old annotation code too, it just sticks out better because it's no longer hidden amongst the others)
-                                      (when (:parent f)
-                                        (conj! fields (:parent f))))))
+                            (cond
+                              (= (type f) metabase.driver.query_processor.interface.Field)
+                              (do
+                                (conj! fields f)
+                                ;; HACK !!!
+                                ;; Nested Mongo fields come back inside of their parent when you specify them in the fields clause
+                                ;; e.g. (Q fields venue...name) will return rows like {:venue {:name "Kyle's Low-Carb Grill"}}
+                                ;; Until we fix this the right way we'll just include the parent Field in the :query-fields list so the pattern
+                                ;; matching works correctly.
+                                ;; (This hack was part of the old annotation code too, it just sticks out better because it's no longer hidden amongst the others)
+                                (when (:parent f)
+                                  (conj! fields (:parent f))))
+
+                              ;; For a DateTimeField we'll flatten it back into regular Field but include the :unit info for the frontend
+                              ;; Recurse so this fn will handle the resulting Field normally
+                              (= (type f) metabase.driver.query_processor.interface.DateTimeField)
+                              (recur (assoc (:field f)
+                                            :unit (:unit f)))
+
+                              :else f))
                           form)
     (->> (persistent! fields)
          distinct


Refactor

Refactor

--- backend/src/akvo/lumen/component/keycloak.clj
+++ backend/src/akvo/lumen/component/keycloak.clj
@@ -46,7 +46,7 @@
          req-opts (-> req-opts
                       (select-keys [:timeout])
                       (assoc :form-params params))]
-     (if-some [access-token (-> (client/post url (assoc req-opts :connection-manager connection-manager))
+     (when-some [access-token (-> (client/post url (assoc req-opts :connection-manager connection-manager))
                                 :body
                                 json/decode
                                 (get "access_token"))]
@@ -279,7 +279,7 @@
   ([{:keys [api-root http-timeout user-id-cache connection-manager] :as keycloak} email
     {:keys [timeout] :or {timeout http-timeout}}]
    (let [bare-req-opts {:timeout timeout}]
-     (if-some [headers (request-headers keycloak bare-req-opts)]
+     (when-some [headers (request-headers keycloak bare-req-opts)]
        (let [req-opts (assoc bare-req-opts :headers headers)]
          (when-let [user-id (lookup-user-id connection-manager req-opts api-root user-id-cache email)]
            (when-let [allowed-paths


More reset! -> swap!

More reset! -> swap!

--- src/physim/core.cljs
+++ src/physim/core.cljs
@@ -29,11 +29,12 @@

 (defn generate-particles
   [n]
-  (for [i (range n)]
-    { :pos [(rand-x) (rand-y) (rand-y)]
+  (vec
+   (for [i (range n)]
+     {:pos [(rand-x) (rand-y) (rand-y)]
       :vel [(/ (* initial-speed (rand-x)) scene-width)
             (/ (* initial-speed (rand-y)) scene-width)
-            (/ (* initial-speed (rand-y)) scene-width)] }))
+            (/ (* initial-speed (rand-y)) scene-width)] })))

 (defn set-position!
   [mesh [x y z]]
@@ -160,8 +161,8 @@
   (doseq [i (range particle-count)]
     (let [p (nth @particles i)
           [p v a] (move (:pos p) (:vel p) @particles)]
-      (reset! particles
-              (assoc (vec @particles) i {:pos p :vel v})))))
+      (swap! particles
+             assoc i {:pos p :vel v}))))

 (init-particles! (generate-particles particle-count))
 (def render-scene (make-renderer! @particle-meshes))


Use close button in editor

Use close button in editor

--- desktop/src/nightmod/core/desktop_launcher.clj
+++ desktop/src/nightmod/core/desktop_launcher.clj
@@ -27,7 +27,7 @@
 (def ^:const editor-width 700)

 (def editor-widgets [:save :undo :redo :font-dec :font-inc
-                     :doc :paredit :paredit-help])
+                     :doc :paredit :paredit-help :close])

 (defn create-layered-pane
   "Returns the pane with the editors."
@@ -78,7 +78,7 @@
           ; Q
           81 (window/confirm-exit-app!)
           ; W
-          ;87 (editors/close-selected-editor!)
+          87 (editors/close-selected-editor!)
           ; else
           false)))
     ; set various window properties
@@ -92,5 +92,5 @@
   (s/invoke-later
     (s/show! (reset! ui/ui-root (create-window)))
     (binding [editors/*editor-widgets* editor-widgets]
-      (comment editors/show-editor! "")))
+      (reset! ui/tree-selection "")))
   (Keyboard/enableRepeatEvents true))


Unroll assoc, improve comment

Unroll assoc, improve comment

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -90,9 +90,9 @@
     (if (= :retry (:action routes))
       (assoc accum :retries (conj! (:retries accum) root))
       (update accum :segments (fn [s]
-                                (conj! s (assoc leaf*
-                                                :flow (:flow routes)
-                                                :hash-group hash-group)))))))
+                                (conj! s (-> leaf*
+                                             (assoc :flow (:flow routes))
+                                             (assoc :hash-group hash-group))))))))

 (s/defn add-from-leaves
   "Flattens root/leaves into an xor'd ack-val, and accumulates new segments and retries"
@@ -214,7 +214,7 @@
   (if (= :input (:onyx/type task-map))
     (let [new-messenger (m/receive-acks messenger)]
       (if-let [ack-barrier (m/all-acks-seen? new-messenger)]
-        ;; Should checkpoint offsets here
+        ;; TODO: Should checkpoint offsets here
         (let [completed? (get-in barriers [(:replica-version ack-barrier) (:epoch ack-barrier) :completed?])]
           (when completed?
             (complete-job event))


Experiment with new ugen metadata formatting attempting to improve readability

--- src/overtone/sc/machinery/ugen/metadata/trig.clj
+++ src/overtone/sc/machinery/ugen/metadata/trig.clj
@@ -11,10 +11,15 @@
   [

    {:name "TWindex"
-    :args [{:name "trig"
-            :doc "trigger. Trigger can be any signal. A trigger happens
-                  when the signal changes from non-positive to
-                  positive." }
+    :description "Triggered window"
+    :doc "When triggered, returns a random index value based on array as
+          a list of probabilities. By default the list of probabilities
+          should sum to 1.0, when the normalize flag is set to 1, the
+          values get normalized by the ugen (less efficient)."
+
+    :args [{:name "trig"
+            :doc "Trigger - can be any signal. A trigger happens when
+                  the signal changes from non-positive to positive." }

            {:name "array",
             :doc  "list of probabilities"
@@ -23,218 +28,488 @@
            {:name "normalize",
             :doc "normalise flag - 0 off, 1 on"
             :default 0}]
-    :default-rate :kr
-    :doc "When triggered, returns a random index value based on array as
-          a list of probabilities. By default the list of probabilities
-          should sum to 1.0, when the normalize flag is set to 1, the
-          values get normalized by the ugen (less efficient)"}
+    :default-rate :kr}
+

    {:name "Trig1"
+    :description "Timed trigger"
+    :doc "Outputs one for dur seconds whenever the input goes from
+          negative to positive, otherwise outputs 0."
+
     :args [{:name "trig",
             :doc "trigger. Trigger can be any signal. A trigger happens
                   when the signal changes from non-positive to
                   positive."
-            :default 0.0 }
+            :default 0.0}
+
            {:name "dur",
             :doc  "duration of the trigger output in seconds."
             :default 0.1 }]
     :signal-range :unipolar
-    :default-rate :kr
-    :doc "outputs one for dur seconds whenever the input goes from
-            negative to positive"}
-
-   {:name "Trig", :extends "Trig1"
-    :doc "When a nonpositive to positive transition occurs at the input, Trig outputs the level of the triggering input for the specified duration, otherwise it outputs zero."}
+    :default-rate :kr}
+
+
+   {:name "Trig" :extends "Trig1"
+    :description "Timed trigger"
+    :doc "When a nonpositive to positive transition occurs at the input,
+          Trig outputs the level of the triggering input for the
+          specified duration, otherwise it outputs zero."}
+

    {:name "TDelay"
-    :args [{:name "trig", :default 0.0 :doc "input trigger signal."}
-           {:name "dur", :default 0.1 :doc "delay time in seconds."}]
+    :description "Trigger delay"
+    :doc "Delays an input trigger by dur, ignoring other triggers in the
+          meantime"
+
+    :args [{:name "trig",
+            :doc "input trigger signal."
+            :default 0.0 }
+
+           {:name "dur"
+            :doc "delay time in seconds."
+            :default 0.1 }]
     :signal-range :unipolar
     :default-rate :kr
-    :check [(same-rate-as-first-input)]
-    :doc "delays an input trigger by dur, ignoring other triggers in the meantime"}
+    :check [(same-rate-as-first-input)]}
+

    {:name "SendTrig"
-    :args [{:name "in", :default 0.0 :doc "input trigger signal"}
-           {:name "id", :default 0 :doc "an integer that will be passed with the trigger message. This is useful if you have more than one SendTrig in a SynthDef"}
-           {:name "value", :default 0.0 :doc "a UGen or float that will be polled at the time of trigger, and its value passed with the trigger message"}]
+    :description "Send a /tr OSC message to Overtone"
+    :doc "On receiving a trigger sends a :trigger event with id and
+          value. This command is the mechanism that synths can use to
+          trigger events in clients.
+
+          The trigger message sent back to the client is this:
+
+          /tr - trigger message
+
+          int   - node ID
+
+          int   - trigger ID
+
+          float - trigger value"
+
+    :args [{:name "in"
+            :doc "input trigger signal"
+            :default 0.0 }
+
+           {:name "id"
+            :doc "an integer that will be passed with the trigger
+                  message. This is useful if you have more than one
+                  SendTrig in a SynthDef"
+            :default 0 }
+
+           {:name "value"
+            :doc "A UGen or float that will be polled at the time of
+                  trigger, and its value passed with the trigger
+                  message"
+            :default 0.0 }]
     :default-rate :kr
     :num-outs 0
-    :check [(same-rate-as-first-input)]
-    :doc "on receiving a trigger sends a :trigger event with id and value. This command is the mechanism that synths can use to trigger events in clients.
-
-The trigger message sent back to the client is this:
-
-/tr						a trigger message
-
-        int - node ID
-
-        int - trigger ID
-
-        float - trigger value
-
-"}
+    :check [(same-rate-as-first-input)]}
+

    {:name "SendReply"
-    :args [{:name "trig", :default 0.0 :doc "input trigger signal"}
-           {:name "cmd-name", :default "/reply" :doc "a string or symbol, as a message name." :mode :append-string}
-           {:name "values", :default 0.0 :mode :append-sequence :doc "array of ugens, or valid ugen inputs"}
-           {:name "reply-id", :default -1 :doc "integer id (similar to that used by send-trig)"}]
+    :description "Send information via OSC to Overtone"
+    :doc "Send an array of values from the server via an
+          message. The OSC message is formed with cmd-name as the path,
+          followed by two compulsary args: node-id (the id of the node
+          that sent the message) and reply-id (the value specified in
+          the params). These args are then followed by the list of
+          values specified in the params.
+
+          For example, if the ugen is used as follows:
+
+          (send-reply tr  \"/foobar\" [1 2 3] 42)
+
+          When the trig tr triggers, Overtone will receive an event that
+          looks like the following (where 32 represents the node-id of
+          the synth that sent the message):
+
+          {:path \"/foobar\" :args (32 42 1 2 3)}
+
+          You can register to respond to this event as follows:
+
+          (on-event \"/foobar\" (fn [msg] (println msg)) ::handle-foobar)"
+    :args [{:name "trig"
+            :doc "Input trigger signal"
+            :default 0.0 }
+
+           {:name "cmd-name"
+            :doc "A string or symbol, as a message name."
+            :default "/reply"
+            :mode :append-string }
+
+           {:name "values"
+            :doc "Array of ugens, or valid ugen inputs"
+            :default 0.0
+            :mode :append-sequence }
+
+           {:name "reply-id"
+            :doc "Integer id (similar to that used by send-trig)"
+            :default -1 }]
+    :default-rate :kr}
+
+
+   {:name "Latch"
+    :description "Sample and hold"
+    :doc "Holds input signal value when triggered."
+    :args [{:name "in"
+            :doc "Input signal."
+            :default 0.0 }
+
+           {:name "trig"
+            :doc "Trigger. Trigger can be any signal. A trigger happens
+                  when the signal changes from non-positive to
+                  positive."
+            :default 0.0}]
+    :default-rate :kr}
+
+
+   {:name "Gate" :extends "Latch"
+    :description "Gate or hold"
+    :doc "Lets signal flow when trig is positive, otherwise holds last
+          input value"}
+
+
+   {:name "PulseCount"
+    :description "Pulse counter"
+    :doc "Each input trigger increments a counter value that is output."
+    :args [{:name "trig"
+            :doc "Trigger. Trigger can be any signal. A trigger happens
+                  when the signal changes from non-positive to positive."
+            :default 0.0 }
+
+           {:name "reset"
+            :doc "Resets the counter to zero when triggered."
+            :default 0.0 }]
+    :check (same-rate-as-first-input)
+    :default-rate :kr}
+
+
+   {:name "SetResetFF", :extends "PulseCount"
+    :description "Set-reset flip flop"
+    :doc "When a trigger is received the output is set to 1.0 Subsequent
+          triggers have no effect When a trigger is received in the
+          reset input, the output is set back to 0.0
+
+          One use of this is to have some precipitating event cause
+          something to happen until you reset it."}
+
+
+   {:name "Peak", :extends "PulseCount"
+    :description "Track peak signal amplitude"
+    :doc "Outputs the peak amplitude of the signal so far, a trigger
+          resets to current value"}
+
+
+   {:name "RunningMin", :extends "Latch"
+    :description "Track minimum level"
+    :doc "Outputs the minimum value received at the input. When
+          triggered, the minimum output value is reset to the current
+          value." }
+
+
+   {:name "RunningMax", :extends "Latch"
+    :description "Track maximum level"
+    :doc "Outputs the maximum value received at the input. When
+          triggered, the maximum output value is reset to the current
+          value." }
+
+
+   {:name "Stepper"
+    :description "Pulse counter"
+    :doc "Triggers increment a counter which is output as a signal. The
+          counter loops around from max to min by step increments"
+
+    :args [{:name "trig"
+            :doc "Trigger. Trigger can be any signal. A trigger happens
+                  when the signal changes from non-positive to
+                  positive."
+            :default 0}
+
+           {:name "reset"
+            :doc "Resets the counter to resetval when triggered."
+            :default 0}
+
+           {:name "min"
+            :doc "minimum value of the counter."
+            :default 0}
+
+           {:name "max"
+            :doc "maximum value of the counter."
+            :default 7 }
+
+           {:name "step"
+            :doc "step value each trigger. May be negative."
+            :default 1 }
+
+           {:name "resetval"
+            :doc "value to which the counter is reset when it receives a reset trigger."
+            :default 1 }]
+    :check (same-rate-as-first-input)
+    :default-rate :kr}
+
+
+   {:name "PulseDivider"
+    :description "Pulse divider"
+    :doc "Outputs a trigger every div input triggers"
+    :args [{:name "trig"
+            :doc "Trigger. Trigger can be any signal. A trigger happens
+                   when the signal changes from non-positive to
+                   positive."
+            :default 0.0}
+
+           {:name "div"
+            :doc "Number of pulses to divide by."
+            :default 2.0}
+
+           {:name "start-val"
+            :doc "Starting value for the trigger count. This lets you
+                   start somewhere in the middle of a count, or if
+                   startCount is negative it adds that many counts to
+                   the first time the output is triggers."
+            :default 0.0}]
+    :default-rate :kr}
+
+
+   {:name "ToggleFF"
+    :description "Toggle flip flop"
+    :doc "Flip-flops between zero and one each trigger"
+    :args [{:name "trig"
+            :doc "trigger input"
+            :default 0.0 }]
+    :default-rate :kr}
+
+
+   {:name "ZeroCrossing"
+    :description "Zero crossing frequency follower"
+    :doc "Outputs a frequency based upon the distance between
+          interceptions of the X axis. The X intercepts are determined
+          via linear interpolation so this gives better than just
+          integer wavelength resolution. This is a very crude pitch
+          follower, but can be useful in some situations."
+    :args [{:name "in"
+            :doc "input signal"
+            :default 0.0 }]
     :default-rate :kr
-    :doc "send an array of values from the server via an OSC message. The OSC message is formed with cmd-name as the path, followed by two compulsary args: node-id (the id of the node that sent the message) and reply-id (the value specified in the params). These args are then followed by the list of values specified in the params.
-
-For example, if the ugen is used as follows:
-
- (send-reply tr  \"/foobar\" [1 2 3] 42)
-
-When the trig tr triggers, Overtone will receive an event that looks like the following (where 32 represents the node-id of the synth that sent the message):
-
- {:path \"/foobar\" :args (32 42 1 2 3)}
-
-You can register to respond to this event as follows:
-
- (on-event \"/foobar\" (fn [msg] (println msg)) ::handle-foobar)"}
-
-   {:name "Latch"
-    :args [{:name "in", :default 0.0 :doc "input signal."}
-           {:name "trig", :default 0.0 :doc "trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive."}]
-    :default-rate :kr
-    :doc "holds the input signal value when triggered"}
-
-   {:name "Gate", :extends "Latch"
-    :doc "lets signal flow when trig is positive, otherwise holds last input value"}
-
-   {:name "PulseCount"
-    :args [{:name "trig", :default 0.0 :doc "trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive."}
-           {:name "reset", :default 0.0 :doc "resets the counter to zero when triggered."}]
+    :check (same-rate-as-first-input)}
+
+
+   {:name "Timer"
+    :description "Trigger timer"
+    :doc "Outputs time since last trigger"
+
+    :args [{:name "trig"
+            :doc "trigger input"
+            :default 0.0 }]
     :check (same-rate-as-first-input)
-    :default-rate :kr
-    :doc "each input trigger increments a counter value that is output."}
-
-   {:name "SetResetFF", :extends "PulseCount"
-    :doc "When a trigger is received the output is set to 1.0 Subsequent triggers have no effect When a trigger is received in the reset input, the output is set back to 0.0
-
-One use of this is to have some precipitating event cause something to happen until you reset it.
-"}
-
-   {:name "Peak", :extends "PulseCount"
-    :doc "outputs the peak amplitude of the signal so far, a trigger resets to current value"}
-
-   {:name "RunningMin", :extends "Latch"
-    :doc "Outputs the minimum value received at the input. When triggered, the minimum output value is reset to the current value."}
-
-   {:name "RunningMax", :extends "Latch"
-    :doc "Outputs the maximum value received at the input. When triggered, the maximum output value is reset to the current value."}
-
-   {:name "Stepper"
-    :args [{:name "trig", :default 0 :doc "trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive."}
-           {:name "reset", :default 0 :doc "resets the counter to resetval when triggered."}
-           {:name "min", :default 0 :doc "minimum value of the counter."}
-           {:name "max", :default 7 :doc "maximum value of the counter."}
-           {:name "step", :default 1 :doc "step value each trigger. May be negative."}
-           {:name "resetval" :default 1 :doc "value to which the counter is reset when it receives a reset trigger."}] ; TODO MAYBE? allow :default :min
-    :check (same-rate-as-first-input)
-    :default-rate :kr
-    :doc "triggers increment a counter which is output as a signal. The counter loops around from max to min by step increments"}
-
-   {:name "PulseDivider"
-    :args [{:name "trig", :default 0.0 :doc "trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive."}
-           {:name "div", :default 2.0 :doc "number of pulses to divide by."}
-           {:name "start-val", :default 0.0 :doc "starting value for the trigger count. This lets you start somewhere in the middle of a count, or if startCount is negative it adds that many counts to the first time the output is triggers."}]
-    :default-rate :kr
-    :doc "outputs a trigger every div input triggers"}
-
-   {:name "ToggleFF"
-    :args [{:name "trig", :default 0.0 :doc "trigger input"}]
-    :default-rate :kr
-    :doc "flip-flops between zero and one each trigger"}
-
-   {:name "ZeroCrossing"
-    :args [{:name "in", :default 0.0 :doc "input signal"}]
-    :default-rate :kr
-    :check (same-rate-as-first-input)
-    :doc "Outputs a frequency based upon the distance between interceptions of the X axis. The X intercepts are determined via linear interpolation so this gives better than just integer wavelength resolution. This is a very crude pitch follower, but can be useful in some situations."}
-
-   {:name "Timer"
-    :args [{:name "trig", :default 0.0 :doc "trigger input"}]
-    :check (same-rate-as-first-input)
-    :default-rate :kr
-    :doc "outputs time since last trigger"}
+    :default-rate :kr}
+

    {:name "Sweep"
-    :args [{:name "trig", :default 0.0 :doc "trigger input"}
-           {:name "rate", :default 1.0 :doc "rate in seconds"}]
-    :default-rate :kr
-    :doc "outputs a linear increasing signal by rate/second on trigger"}
+    :description "Triggered linear ramp"
+    :doc "outputs a linear increasing signal by rate/second when trig input crosses from non-positive to positive"
+
+    :args [{:name "trig"
+            :doc "trigger input"
+            :default 0.0}
+
+           {:name "rate"
+            :doc "rate in seconds"
+            :default 1.0 }]
+    :default-rate :kr}
+

    {:name "Phasor"
-    :args [{:name "trig", :default 0.0 :doc "When triggered, reset value to resetPos (default: 0, Phasor outputs start initially)"}
-           {:name "rate", :default 1.0 :doc "The amount of change per sample i.e at a rate of 1 the value of each sample will be 1 greater than the preceding sample"}
-           {:name "start", :default 0.0 :doc "Starting point of the ramp"}
-           {:name "end", :default 1.0 :doc "End point of the ramp"}
-           {:name "reset-pos", :default 0.0  :doc "The value to jump to upon receiving a trigger"}]
-    :default-rate :kr
-    :doc "Phasor is a linear ramp between start and end values. When its trigger input crosses from non-positive to positive, Phasor's output will jump to its reset position. Upon reaching the end of its ramp Phasor will wrap back to its start. N.B. Since end is defined as the wrap point, its value is never actually output."}
+    :description "Resettable linear ramp between two levels"
+    :doc "Phasor is a linear ramp between start and end values. When its
+          trigger input crosses from non-positive to positive, Phasor's
+          output will jump to its reset position. Upon reaching the end
+          of its ramp Phasor will wrap back to its start. N.B. Since end
+          is defined as the wrap point, its value is never actually
+          output."
+
+    :args [{:name "trig"
+            :doc "When triggered, reset value to resetPos (default: 0,
+                  phasor outputs start initially)"
+            :default 0.0}
+
+           {:name "rate"
+            :doc "The amount of change per sample i.e at a rate of 1 the
+                  value of each sample will be 1 greater than the
+                  preceding sample"
+            :default 1.0}
+
+           {:name "start"
+            :doc "Starting point of the ramp"
+            :default 0.0}
+
+           {:name "end"
+            :doc "End point of the ramp"
+            :default 1.0}
+
+           {:name "reset-pos"
+            :doc "The value to jump to upon receiving a trigger"
+            :default 0.0}]
+    :default-rate :kr}
+

    {:name "PeakFollower"
-    :args [{:name "in", :default 0.0 :doc "input signal."}
-           {:name "decay", :default 0.999 :doc "decay factor."}]
-    :default-rate :kr
-    :doc "outputs the peak signal amplitude, falling with decay over time until reaching signal level"}
+    :description "Track peak signal amplitude"
+    :doc "Outputs the peak signal amplitude, falling with decay over
+         time until reaching signal level"
+    :args [{:name "in"
+            :doc "input signal."
+            :default 0.0}
+
+           {:name "decay"
+            :doc "decay factor."
+            :default 0.999}]
+    :default-rate :kr}
+

    {:name "Pitch"
-    :args [{:name "in" :doc "Input signal"}
-           {:name "init-freq", :default 440.0 :doc "Value of output pitch until first pitch detected."}
-           {:name "min-freq", :default 60.0 :doc "Minimum frequency of execution."}
-           {:name "max-freq", :default 4000.0 :doc "Maximum frequency of execution."}
-           {:name "exec-freq", :default 100.0 :doc "The target rate to periodically execute in cps. Clipped between min-freq and max-freq."}
-           {:name "max-bins-per-octave", :default 16 :doc "Number of lags for course search. A larger value will cause the coarse search to take longer, a smaller value will cause the subsequent fine search to take longer."}
-           {:name "median", :default 1 :doc "Median filter value of length median on the output estimation. Helps eliminate outliers and jitter. Value of 1 means no filter."}
-           {:name "amp-threshold", :default 0.01 :doc "Minum peak to peak amplitude of input signal before pitch estimation is performed."}
-           {:name "peak-threshold", :default 0.5 :doc "Finds the next peak that is above peak-threshold times the amplitude of the peak at lag zero. A value of 0.5 does a pretty good job of eliminating overtones."}
-           {:name "down-sample", :default 1 :doc "Down sample the input signal by an integer factor. Helps reduce CPU overthead. Also reduces pitch resolution."}
-           {:name "clar" :default 0 :doc "Clarity measurement (purity of the pitched signal) if greater than 0."}]
+    :description "Autocorrelation pitch follower"
+    :doc "This is a better pitch follower than zero-crossing, but more
+          costly of CPU. For most purposes the default settings can be
+          used and only in needs to be supplied. Pitch returns two
+          values (via an Array of OutputProxys, a freq which is the
+          pitch estimate and has-freq, which tells whether a pitch was
+          found. Some vowels are still problematic, for instance a wide
+          open mouth sound somewhere between a low pitched short 'a'
+          sound as in 'sat', and long 'i' sound as in 'fire', contains
+          enough overtone energy to confuse the algorithm. None of these
+          settings are time variable."
+    :args [{:name "in"
+            :doc "Input signal"}
+
+           {:name "init-freq"
+            :doc "Value of output pitch until first pitch detected."
+            :default 440.0}
+
+           {:name "min-freq",
+            :doc "Minimum frequency of execution."
+            :default 60.0}
+
+           {:name "max-freq",
+            :doc "Maximum frequency of execution."
+            :default 4000.0}
+
+           {:name "exec-freq",
+            :doc "The target rate to periodically execute in
+                  cps. Clipped between min-freq and max-freq."
+            :default 100.0}
+
+           {:name "max-bins-per-octave",
+            :doc "Number of lags for course search. A larger value will
+                 cause the coarse search to take longer, a smaller value
+                 will cause the subsequent fine search to take longer."
+            :default 16}
+
+           {:name "median",
+            :doc "Median filter value of length median on the output
+                  estimation. Helps eliminate outliers and jitter. Value
+                  of 1 means no filter."
+            :default 1}
+
+           {:name "amp-threshold",
+            :doc "Minum peak to peak amplitude of input signal before
+                  pitch estimation is performed."
+            :default 0.01}
+
+           {:name "peak-threshold",
+            :doc "Finds the next peak that is above peak-threshold times
+                  the amplitude of the peak at lag zero. A value of 0.5
+                  does a pretty good job of eliminating overtones."
+            :default 0.5}
+
+           {:name "down-sample",
+            :doc "Down sample the input signal by an integer
+                  factor. Helps reduce CPU overthead. Also reduces pitch
+                  resolution."
+            :default 1}
+
+           {:name "clar"
+            :doc "Clarity measurement (purity of the pitched signal) if
+                  greater than 0."
+            :default 0}]
     :rates #{:kr}
     :num-outs 2
-    :description "Autocorrelation pitch follower"
-    :check (nth-input-stream? 0)
-    :doc "This is a better pitch follower than zero-crossing, but more costly of CPU. For most purposes the default settings can be used and only in needs to be supplied. Pitch returns two values (via an Array of OutputProxys, a freq which is the pitch estimate and has-freq, which tells whether a pitch was found. Some vowels are still problematic, for instance a wide open mouth sound somewhere between a low pitched short 'a' sound as in 'sat', and long 'i' sound as in 'fire', contains enough overtone energy to confuse the algorithm. None of these settings are time variable."}
+    :check (nth-input-stream? 0)}

    {:name "InRange"
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lo", :default 0.0 :doc "low threshold"}
-           {:name "hi", :default 1.0 :doc "high threshold"}]
-    :default-rate :kr
-    :doc "Tests if a signal is between lo and hi"}
+    :description "Tests if a signal is within a given range"
+    :doc "If in is >= lo and <= hi output 1.0, otherwise output
+          0.0. Output is initially zero."
+    :args [{:name "in"
+            :doc "input signal"
+            :default 0.0}
+
+           {:name "lo",
+            :doc "low threshold"
+            :default 0.0}
+
+           {:name "hi",
+            :doc "high threshold"
+            :default 1.0}]
+    :default-rate :kr}

    {:name "Fold", :extends "InRange"
-    :doc "Folds input wave to within the lo and hi thresholds. This differs from the BinaryOpUGen fold2 in that it allows one to set both low and high thresholds."}
+    :description "Fold a signal outside given thresholds."
+    :doc "Folds input wave to within the lo and hi thresholds. This
+         differs from the ugen fold2 in that it allows one to
+         set both low and high thresholds."}

    {:name "Clip"
-    :args [{:name "in", :default 0.0 :doc "The signal to be clipped"}
-           {:name "lo", :default 0.0, :doc "Low threshold of clipping. Must be less then hi"}
-           {:name "hi", :default 1.0, :doc "High threshold of clipping. Must be greater then lo"}]
-    :default-rate :kr
-    :doc "Clip a signal outside given thresholds. This differs from the BinaryOpUGen clip2 in that it allows one to set both low and high thresholds."}
+    :description "Clip a signal outside given thresholds."
+    :doc "Clip a signal outside given thresholds. This differs from the
+          ugen clip2 in that it allows one to set both low and high
+          thresholds."
+    :args [{:name "in",
+            :doc "The signal to be clipped"
+            :default 0.0}
+
+           {:name "lo",
+            :doc "Low threshold of clipping. Must be less then hi"
+            :default 0.0,}
+
+           {:name "hi",
+            :doc "High threshold of clipping. Must be greater then lo"
+            :default 1.0,}]
+    :default-rate :kr}

    {:name "Wrap", :extends "InRange"
-    :doc "Wraps input wave to the low and high thresholds. This differs from the BinaryOpUGen wrap2 in that it allows one to set both low and high thresholds."}
+    :description "Wrap a signal outside given thresholds."
+    :doc "Wraps input wave to the low and high thresholds. This differs
+         from the ugen wrap2 in that it allows one to set both
+         low and high thresholds." }

    {:name "Schmidt", :extends "InRange"
-    :doc "outout one when signal greater than high, and zero when lower than low."}
+    :description "Schmidt trigger"
+    :doc "Outout one when signal greater than high, and zero when lower
+         than low." }

    ;; TODO maybe allow a rect datatype as arg
    ;;      and write init function to handle it
    {:name "InRect"
-    :args [{:name "x", :default 0.0 :doc "X component signal"}
-           {:name "y", :default 0.0 :doc "Y component signal"}
+    :description "Test if a point is within a given rectangle."
+    :doc "Outputs one if the 2d coordinate of x,y input values falls
+          inside a rectangle, else zero"
+    :args [{:name "x"
+            :doc "X component signal"
+            :default 0.0}
+
+           {:name "y"
+            :doc "Y component signal"
+            :default 0.0}
+
            {:name "left"}
            {:name "top"}
            {:name "right"}
            {:name "bottom"}]
-    :default-rate :kr
-    :doc "outputs one if the 2d coordinate of x,y input values falls inside a rectangle, else zero"}
+    :default-rate :kr}

    {:name "Trapezoid"
     :args [{:name "in", :default 0.0}
@@ -245,16 +520,30 @@
     :default-rate :kr}

    {:name "MostChange"
-    :args [{:name "a", :default 0.0 :doc "first input"}
-           {:name "b", :default 0.0 :doc "second input"}]
-    :default-rate :kr
-    :doc "output whichever signal changed the most"}
+    :description "Output most changed"
+    :doc "output whichever signal changed the most"
+    :args [{:name "a"
+            :doc "first input"
+            :default 0.0 }
+
+           {:name "b",
+            :doc "second input"
+            :default 0.0}]
+    :default-rate :kr}

    {:name "LeastChange", :extends "MostChange"
+    :description "Output least changed"
     :doc "output whichever signal changed the least"}

    {:name "LastValue"
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "diff", :default 0.01 :doc "difference threshold"}]
-    :default-rate :kr
-    :doc "output the last value before the input changed by a threshold of diff"}])
+    :description "Output the last value before the input changed"
+    :doc "Output the last value before the input changed by a threshold
+          of diff"
+    :args [{:name "in",
+            :doc "input signal"
+            :default 0.0}
+
+           {:name "diff",
+            :doc "difference threshold"
+            :default 0.01}]
+    :default-rate :kr}])


:bug: Fix files ordering on dashboard project page.

--- frontend/src/uxbox/main/ui/dashboard/project.cljs
+++ frontend/src/uxbox/main/ui/dashboard/project.cljs
@@ -9,7 +9,6 @@
 ;; Copyright (c) 2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>

 (ns uxbox.main.ui.dashboard.project
-  (:refer-clojure :exclude [sort-by])
   (:require
    [lentes.core :as l]
    [rumext.alpha :as mf]
@@ -24,7 +23,9 @@

 (mf/defc project-page
   [{:keys [section team-id project-id] :as props}]
-  (let [files (mf/deref files-ref)]
+  (let [files (->> (mf/deref files-ref)
+                   (sort-by :modified-at)
+                   (reverse))]
     (mf/use-effect
      {:fn #(st/emit! (dsh/initialize-project team-id project-id))
       :deps (mf/deps team-id project-id)})


Allow codecs to be registered from outside the codec ns.

--- core/src/immutant/codecs.clj
+++ core/src/immutant/codecs.clj
@@ -40,8 +40,10 @@
    * :decode - A single-arity function that decodes its argument from
      the expected type to clojure data."
   [{:keys [name content-type type encode decode] :or {type :string}}]
-  `(proxy [~(if (= :bytes type) 'BytesCodec 'StringCodec)]
-       [~(clojure.core/name name) ~content-type]
+  `(proxy [~(if (= :bytes type)
+              'org.projectodd.wunderboss.codecs.BytesCodec
+              'org.projectodd.wunderboss.codecs.StringCodec)]
+       [(clojure.core/name ~name) ~content-type]
      (encode [data#]
        (~encode data#))
      (decode [data#]


Rename symbols to reflect API change

Rename symbols to reflect API change

--- breakout/desktop/src-common/breakout/core.clj
+++ breakout/desktop/src-common/breakout/core.clj
@@ -12,7 +12,7 @@

 (defn create-ball-body!
   [screen x y radius]
-  (->> (circle radius)
+  (->> (circle-shape radius)
        (fixture-def :density 1 :friction 0 :restitution 1 :shape)
        (create-body! screen (body-def :dynamic)
                      :set-transform x y 0 :create-fixture)))
@@ -25,7 +25,7 @@
         width 0
         0 0]
        float-array
-       (chain :create-chain)
+       (chain-shape :create-chain)
        (fixture-def :density 1 :shape)
        (create-body! screen (body-def :static)
                      :set-transform x y 0 :create-fixture)))


fix typos

fix typos

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -888,16 +888,16 @@
                              :merge-fn
                              (fn [val]
                                {:synsem {:cat :verb
-                                         :subcat {:2 {:agr {:number :plur
+                                         :subcat {:1 {:agr {:number :plur
                                                             :person :2nd}}}}
-                                :english {:infl :present
+                                :english {:infl :past
                                           :english (get-in val [:english :past :2plur])}})}

                             {:path [:english :past :3plur]
                              :merge-fn
                              (fn [val]
                                {:synsem {:cat :verb
-                                         :subcat {:3 {:agr {:number :plur
+                                         :subcat {:1 {:agr {:number :plur
                                                             :person :3rd}}}}
                                 :english {:infl :past
                                           :english (get-in val [:english :past :3plur])}})}


transport: type hints

transport: type hints

--- src/riemann/transport.clj
+++ src/riemann/transport.clj
@@ -11,11 +11,13 @@
         clojure.tools.logging)
   (:require [riemann.query       :as query])
   (:import
+    (java.util List)
     (java.util.concurrent TimeUnit
                           Executors)
     (com.aphyr.riemann Proto$Msg)
     (io.netty.channel ChannelInitializer
                       Channel
+                      ChannelPipeline
                       ChannelHandler)
     (io.netty.channel.group ChannelGroup
                             DefaultChannelGroup)
@@ -56,7 +58,7 @@
   Returns x."
   [x]
   (when (instance? ReferenceCounted x)
-    (.retain x))
+    (.retain ^ReferenceCounted x))
   x)

 (defmacro channel-initializer
@@ -73,19 +75,24 @@
   (assert (even? (count names-and-exprs)))
   (let [handlers (partition 2 names-and-exprs)
         shared (filter (comp :shared meta first) handlers)
+        pipeline-name (vary-meta (gensym "pipeline")
+                                 assoc :tag `ChannelPipeline)
         forms (map (fn [[h-name h-expr]]
-                     `(.addLast ~(when-let [e (:executor (meta h-name))]
+                     `(.addLast ~pipeline-name
+                                ~(when-let [e (:executor (meta h-name))]
                                    e)
                                 ~(str h-name)
                                 ~(if (:shared (meta h-name))
                                    h-name
                                    h-expr)))
                    handlers)]
+;    (prn forms)
     `(let [~@(apply concat shared)]
        (proxy [ChannelInitializer] []
          (initChannel [~'ch]
-           (doto (.pipeline ~'ch)
-             ~@forms))))))
+           (let [~pipeline-name (.pipeline ^Channel ~'ch)]
+             ~@forms
+             ~pipeline-name))))))

 (defn protobuf-decoder
   "Decodes protobufs to Msg objects"
@@ -101,7 +108,7 @@
   "A decoder that turns DatagramPackets into ByteBufs."
   []
   (proxy [MessageToMessageDecoder] []
-    (decode [context ^DatagramPacket message out]
+    (decode [context ^DatagramPacket message ^List out]
       (.add out (retain (.content message))))

     (isSharable [] true)))
@@ -110,7 +117,7 @@
   "Netty decoder for Msg protobuf objects -> maps"
   []
   (proxy [MessageToMessageDecoder] []
-    (decode [context message out]
+    (decode [context message ^List out]
       (.add out (decode-msg message)))
     (isSharable [] true)))

@@ -118,7 +125,7 @@
   "Netty encoder for maps -> Msg protobuf objects"
   []
   (proxy [MessageToMessageEncoder] []
-    (encode [context message out]
+    (encode [context message ^List out]
       (.add out (encode-pb-msg message)))
     (isSharable [] true)))


Add further docstrings

Add further docstrings

--- src/rosado/processing.clj
+++ src/rosado/processing.clj
@@ -499,7 +499,11 @@
      (.copy *applet* img (int sx1) (int sy1) (int sx2) (int sy2)
             (int dx1) (int dy1) (int dx2) (int dy2))))

-(defn cos [angle] (PApplet/cos (float angle)))
+(defn cos
+  "Calculates the cosine of an angle. This function expects the values
+  of the angle parameter to be provided in radians (values from 0 to
+  Math/PI*2). Values are returned in the range -1 to 1."
+  [angle] (PApplet/cos (float angle)))

 (defn create-font
   ([name size] (.createFont *applet* name (float size)))
@@ -569,6 +573,15 @@
   (.curveTightness *applet* (float ti)))

 (defn curve-vertex
+  "Specifies vertex coordinates for curves. This function may only be
+  used between begin-shape and end-shape and only when there is no
+  mode keyword specified to begin-hape. The first and last points in a
+  series of curve-vertex lines will be used to guide the beginning and
+  end of a the curve. A minimum of four points is required to draw a
+  tiny curve between the second and third points. Adding a fifth point
+  with curveVertex will draw the curve between the second, third, and
+  fourth points. The curveVertex function is an implementation of
+  Catmull-Rom splines."
   ([x y] (.curveVertex *applet* (float x) (float y)))
   ([x y z] (.curveVertex *applet* (float x) (float y) (float z))))

@@ -580,7 +593,15 @@
   []
   (PApplet/day))

-(defn degrees [radians] (PApplet/degrees (float radians)))
+(defn degrees
+  "Converts a radian measurement to its corresponding value in
+  degrees. Radians and degrees are two ways of measuring the same
+  thing. There are 360 degrees in a circle and (* 2 Math/PI) radians
+  in a circle. For example, (= 90° (/ Math/PI 2) 1.5707964). All
+  trigonometric methods in Processing require their parameters to be
+  specified in radians."
+  [radians]
+  (PApplet/degrees (float radians)))

 (defn delay-frame [nap-time] (.delay *applet* (int nap-time)))

@@ -636,9 +657,18 @@

 ;; $$exec

-(defn exit [] (.exit *applet*))
-
-(defn exp [a] (PApplet/exp (float a)))
+(defn exit
+  "Quits/stops/exits the program.  Rather than terminating
+  immediately, exit will cause the sketch to exit after draw has
+  completed (or after setup completes if called during the setup
+  method). "
+  []
+  (.exit *applet*))
+
+(defn exp
+  "Returns Euler's number e (2.71828...) raised to the power of the
+  value parameter."
+  [val] (PApplet/exp (float val)))

 ;; $$expand

@@ -917,14 +947,35 @@
                    (float z-near) (float z-far))))

 (defn point
+  "Draws a point, a coordinate in space at the dimension of one
+  pixel. The first parameter is the horizontal value for the point,
+  the second value is the vertical value for the point, and the
+  optional third value is the depth value. Drawing this shape in 3D
+  using the z parameter requires the P3D or OPENGL parameter in
+  combination with size as shown in the above example."
   ([x y] (.point *applet* (float x)(float y)))
   ([x y z] (.point *applet* (float x) (float y) (float z))))

 (defn point-light
+  "Adds a point light. Lights need to be included in the draw() to
+  remain persistent in a looping program. Placing them in the setup()
+  of a looping program will cause them to only have an effect the
+  first time through the loop. The affect of the r, g, and b
+  parameters is determined by the current color mode. The x, y, and z
+  parameters set the position of the light"
   [r g b x y z]
-  (.pointLight *applet* r g b x y z))
-
-(defn pop-matrix [] (.popMatrix *applet*))
+  (.pointLight *applet* (float r) (float g) (float b) (float x) (float y) (float z)))
+
+(defn pop-matrix
+  "Pops the current transformation matrix off the matrix
+  stack. Understanding pushing and popping requires understanding the
+  concept of a matrix stack. The push-matrix fn saves the current
+  coordinate system to the stack and pop-matrix restores the prior
+  coordinate system. push-matrix and pop-matrix are used in conjuction
+  with the other transformation methods and may be embedded to control
+  the scope of the transformations."
+  []
+  (.popMatrix *applet*))

 (defn pow
   "Facilitates exponential expressions. The pow() function is an
@@ -971,6 +1022,15 @@
   (PApplet/radians (float degrees)))

 (defn random
+  "Generates random numbers. Each time the random function is called,
+  it returns an unexpected value within the specified range. If one
+  parameter is passed to the function it will return a float between
+  zero and the value of the high parameter. The function call (random
+  5) returns values between 0 and 5 (starting at zero, up to but not
+  including 5). If two parameters are passed, it will return a float
+  with a value between the the parameters. The function call
+  (random -5 10.2) returns values starting at -5 up to (but not
+  including) 10.2."
   ([max] (.random *applet* (float max)))
   ([min max] (.random *applet* (float min) (float max))))

@@ -1132,9 +1192,20 @@
   ([[r g b] [x y z] [nx ny nz] angle concentration]
      (.spotLight *applet* r g b x y z nx ny nz angle concentration)))

-(defn sq [a] (PApplet/sq (float a)))
-
-(defn sqrt [a] (PApplet/sqrt (float a)))
+(defn sq
+  "Squares a number (multiplies a number by itself). The result is
+  always a positive number, as multiplying two negative numbers always
+  yields a positive result. For example, -1 * -1 = 1."
+  [a]
+  (PApplet/sq (float a)))
+
+(defn sqrt
+  "Calculates the square root of a number. The square root of a number
+  is always positive, even though there may be a valid negative
+  root. The square root s of number a is such that (= a (* s s)) . It
+  is the opposite of squaring."
+  [a]
+  (PApplet/sqrt (float a)))

 ;; $$start
 ;; $$status


Link to changelog from news

Link to changelog from news

--- demo/reagentdemo/news.cljs
+++ demo/reagentdemo/news.cljs
@@ -13,6 +13,9 @@

 (defn main []
   [:div
+   [:div.reagent-demo
+    [:h1 [:a {:href "https://github.com/reagent-project/reagent/blob/master/CHANGELOG.md"} "Check changelog for the latest releases"]]]
+
    [:div.reagent-demo
     [:h1 [:a {:href "https://github.com/reagent-project/reagent/blob/master/CHANGELOG.md#081-2018-05-15"} "Reagent 0.8.1"]]
     [:span "2018-05-15"]]


Set tabSize to 4 and expand tabs.

Set tabSize to 4 and expand tabs.

--- src/sqls/ui/seesaw/worksheet.clj
+++ src/sqls/ui/seesaw/worksheet.clj
@@ -15,13 +15,14 @@
            [java.io File]
            [javax.swing JFrame JPanel JScrollPane JTable JViewport JTextArea KeyStroke JComponent]
            [javax.swing.table TableColumn]
-           [javax.swing.text DefaultEditorKit]))
+           [javax.swing.text DefaultEditorKit]
+           [org.fife.ui.rsyntaxtextarea RSyntaxTextArea]))

 (defn fix-textarea-bindings!
   "Fix rich-text-area bindings.
   Note that it does modify its argument before returning it."
-  ^JTextArea
-  [^JTextArea t]
+  ^RSyntaxTextArea
+  [^RSyntaxTextArea t]
   (let [is-osx (-> (System/getProperty "os.name") (.toLowerCase) (.startsWith "mac os x"))
         ctrl-enter-ks (KeyStroke/getKeyStroke "control pressed ENTER")
         m (.getInputMap t)]
@@ -473,6 +474,8 @@
                                                                           :syntax :sql
                                                                           :columns 80
                                                                           :rows 25))
+        _ (.setTabSize query-text-area 4)
+        _ (.setTabsEmulated query-text-area true)
         query-text-area-scrollable (seesaw.core/scrollable query-text-area)
         results-panel (seesaw.core/vertical-panel :id :results-panel
                                                   :preferred-size [800 :by 400])


Fixing schema bug that prevents ring from starting

--- src/cia/schemas/relationships.clj
+++ src/cia/schemas/relationships.clj
@@ -133,7 +133,7 @@

 (s/defschema CompositeIndicatorExpression
   "See http://stixproject.github.io/data-model/1.2/indicator/CompositeIndicatorExpressionType/"
-  {:operator (s/either "and" "or" "not")
+  {:operator (s/enum "and" "or" "not")
    :indicators [IndicatorReference]})

 ;; ttp


Ignore card abilities when clicked only if the active prompt is a Select.

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -102,7 +102,7 @@
 (defn handle-card-click [{:keys [type zone counter advance-counter advancementcost advanceable
                                  root] :as card} owner]
   (let [side (:side @game-state)]
-    (if-not (empty? (get-in @game-state [side :selected]))
+    (if (= (get-in @game-state [side :prompt 0 :prompt-type]) "select")
       (send-command "select" {:card card})
       (if (and (= (:type card) "Identity") (= side (keyword (.toLowerCase (:side card)))))
         (handle-abilities card owner)


Automatically load Avro reader var namespaces

Spark in particular but potentially other JVM frameworks as well do not
provide any convenient hooks we could use to load Avro reader var
namespaces prior to the framework performing Avro deserialization.  With
this change, we work around the problem by loading configured Avro
reader var namespaces upon first using a `ClojureDatumReader` instance.

--- src/clojure/abracad/avro/read.clj
+++ src/clojure/abracad/avro/read.clj
@@ -4,7 +4,8 @@
   (:require [abracad.avro :as avro]
             [abracad.avro.util
              :refer [mangle unmangle field-keyword if-not-let]])
-  (:import [org.apache.avro Schema Schema$Field]
+  (:import [clojure.lang Var]
+           [org.apache.avro Schema Schema$Field]
            [org.apache.avro.io Decoder ResolvingDecoder]
            [abracad.avro ClojureDatumReader ArrayAccessor]))

@@ -105,3 +106,10 @@
 (defn read-bytes
   [^ClojureDatumReader reader ^Schema expected ^Decoder in]
   (.array (.readBytes in nil)))
+
+;; Load namespaces in order to ensure Avro reader vars are available
+(doseq [ns (->> (vals avro/*avro-readers*)
+                (map #(-> ^Var % .-ns .-name))
+                (distinct)
+                (sort))]
+  (require ns))


Add copyright notice on codecs ns.

Add copyright notice on codecs ns.

--- src/clojure/buddy/core/codecs.clj
+++ src/clojure/buddy/core/codecs.clj
@@ -1,3 +1,17 @@
+;; Copyright 2014-2015 Andrey Antukh <niwi@niwi.be>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
 (ns buddy.core.codecs
   "Util functions for make conversion between string, bytes
 and encode them to base64 ot hex format."


Added more mime-type extensions

Added more mime-type extensions

--- ring-core/src/ring/util/mime_type.clj
+++ ring-core/src/ring/util/mime_type.clj
@@ -1,35 +1,57 @@
-(ns ring.util.mime-type)
+(ns ring.util.mime-type
+  "Utility functions for finding out the mime-type of a file.")

 (def default-mime-types
-  {"ai"    "application/postscript"
+  {"7z"    "application/x-7z-compressed"
+   "aac"   "audio/aac"
+   "ai"    "application/postscript"
    "asc"   "text/plain"
+   "atom"  "application/atom+xml"
    "avi"   "video/x-msvideo"
    "bin"   "application/octet-stream"
    "bmp"   "image/bmp"
+   "bz2"   "application/x-bzip"
    "class" "application/octet-stream"
    "cer"   "application/pkix-cert"
    "crl"   "application/pkix-crl"
    "crt"   "application/x-x509-ca-cert"
    "css"   "text/css"
+   "csv"   "text/csv"
+   "deb"   "application/x-deb"
+   "dll"   "application/octet-stream"
+   "dmg"   "application/octet-stream"
    "dms"   "application/octet-stream"
    "doc"   "application/msword"
    "dvi"   "application/x-dvi"
    "eps"   "application/postscript"
    "etx"   "text/x-setext"
    "exe"   "application/octet-stream"
+   "flv"   "video/x-flv"
+   "flac"  "audio/flac"
    "gif"   "image/gif"
+   "gz"    "application/gzip"
    "htm"   "text/html"
    "html"  "text/html"
+   "ico"   "image/x-icon"
+   "iso"   "application/x-iso9660-image"
+   "jar"   "application/java-archive"
    "jpe"   "image/jpeg"
    "jpeg"  "image/jpeg"
    "jpg"   "image/jpeg"
    "js"    "text/javascript"
+   "json"  "application/json"
    "lha"   "application/octet-stream"
    "lzh"   "application/octet-stream"
    "mov"   "video/quicktime"
+   "m4v"   "video/mp4"
+   "mp3"   "audio/mpeg"
+   "mp4"   "video/mp4"
    "mpe"   "video/mpeg"
    "mpeg"  "video/mpeg"
    "mpg"   "video/mpeg"
+   "oga"   "audio/ogg"
+   "ogg"   "audio/ogg"
+   "ogv"   "video/ogg"
    "pbm"   "image/x-portable-bitmap"
    "pdf"   "application/pdf"
    "pgm"   "image/x-portable-graymap"
@@ -39,16 +61,22 @@
    "ppt"   "application/vnd.ms-powerpoint"
    "ps"    "application/postscript"
    "qt"    "video/quicktime"
+   "rar"   "application/x-rar-compressed"
    "ras"   "image/x-cmu-raster"
    "rb"    "text/plain"
    "rd"    "text/plain"
+   "rss"   "application/rss+xml"
    "rtf"   "application/rtf"
    "sgm"   "text/sgml"
    "sgml"  "text/sgml"
+   "svg"   "image/svg+xml"
    "swf"   "application/x-shockwave-flash"
+   "tar"   "application/x-tar"
    "tif"   "image/tiff"
    "tiff"  "image/tiff"
    "txt"   "text/plain"
+   "webm"  "video/webm"
+   "wmv"   "video/x-ms-wmv"
    "xbm"   "image/x-xbitmap"
    "xls"   "application/vnd.ms-excel"
    "xml"   "text/xml"


Removed reflection warning from Fuzzy-Set

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

--- src/conexp/contrib/fuzzy/sets.clj
+++ src/conexp/contrib/fuzzy/sets.clj
@@ -10,8 +10,6 @@
   (:use conexp.main))

 (ns-doc "Basic definitions for fuzzy sets")
-
-(set! *warn-on-reflection* true)

 ;;;

@@ -63,7 +61,7 @@
       (or result 0)))
   (applyTo [this seq]
     (if (= 1 (count seq))
-      (.applyTo hashmap seq)
+      (apply hashmap seq)
       (illegal-argument "Cannot apply fuzzy sets to non-singleton sequences.")))
   ;;
   clojure.lang.Associative


Get all honey badger about JBOSS_HOME

Get all honey badger about JBOSS_HOME

--- support/fntest/src/main/clojure/fntest/jboss.clj
+++ support/fntest/src/main/clojure/fntest/jboss.clj
@@ -50,11 +50,18 @@
         (Thread/sleep 1000)
         (recur (dec attempts)))))

+(defn start-command []
+  (let [java-home (System/getProperty "java.home")
+        jboss-home (.getCanonicalFile (io/file home))]
+  (str java-home "/bin/java -Xms64m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.boot.log.file=" jboss-home "/standalone/log/boot.log -Dlogging.configuration=file:" jboss-home "/standalone/configuration/logging.properties -jar " jboss-home "/jboss-modules.jar -mp " jboss-home "/modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=" jboss-home)))
+
 (defn start []
   "Start up a JBoss or toss exception if one is already running"
   (if (ready?)
     (throw (Exception. "JBoss is already running!"))
-    (future (sh (str home "/bin/standalone.sh")))))
+    (let [cmd (start-command)]
+      (println cmd)
+      (future (apply sh (.split cmd " "))))))

 (defn stop []
   "Shut down whatever JBoss instance is responding to api-url"


Fix entity preview to work for all entities, not just the first one clicked [GAWB-2771] (#1026)

--- src/cljs/main/broadfcui/page/workspace/data/entity_viewer.cljs
+++ src/cljs/main/broadfcui/page/workspace/data/entity_viewer.cljs
@@ -33,8 +33,10 @@
      {:last-entity []})
    :component-will-mount
    (fn [{:keys [this props]}]
-     (let [{:keys [entity-type entity-name]} props]
-       (this :-update-and-load entity-type entity-name)))
+     (this :-handle-props props))
+   :component-will-receive-props
+   (fn [{:keys [this next-props]}]
+     (this :-handle-props next-props))
    :render
    (fn [{:keys [props state this]}]
      (let [{:keys [update-parent-state]} props
@@ -120,6 +122,10 @@
                                     :sort-by :for-sort
                                     :render :for-render}])}
                 :paginator :none}]]))
+   :-handle-props
+   (fn [{:keys [this]} props]
+     (let [{:keys [entity-type entity-name]} props]
+       (this :-update-and-load entity-type entity-name)))
    :-update-and-load
    (fn [{:keys [state props]} item-type item-name]
      (let [update-viewer-state (fn [& args]


Update ws.

Update ws.

--- ws/scratch/interpreter-test.clj
+++ ws/scratch/interpreter-test.clj
@@ -96,30 +96,31 @@
 ;; @@
 ;; ->
 ;;; Warming up for JIT optimisations 5000000000 ...
-;;;   compilation occured before 129884 iterations
-;;;   compilation occured before 259754 iterations
-;;;   compilation occured before 389624 iterations
-;;;   compilation occured before 11038964 iterations
-;;;   compilation occured before 11168834 iterations
+;;;   compilation occured before 210546 iterations
+;;;   compilation occured before 27157874 iterations
+;;;   compilation occured before 27368400 iterations
+;;;   compilation occured before 27578926 iterations
+;;;   compilation occured before 27789452 iterations
+;;;   compilation occured before 27999978 iterations
 ;;; Estimating execution count ...
 ;;; Sampling ...
 ;;; Final GC...
 ;;; Checking GC...
-;;; WARNING: Final GC required 63.09181317676532 % of runtime
+;;; WARNING: Final GC required 48.9934217651921 % of runtime
 ;;; Finding outliers ...
 ;;; Bootstrapping ...
 ;;; Checking outlier significance
 ;;; x86_64 Mac OS X 10.9.5 4 cpu(s)
 ;;; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
 ;;; Runtime arguments: -Dfile.encoding=UTF-8 -Xmx4g -Dclojure.compile.path=/Users/jony/Documents/Work/Computing/ProjectX/Projects/algebolic/target/classes -Dalgebolic.version=0.1.0-SNAPSHOT -Dclojure.debug=false
-;;; Evaluation count : 3901110 in 6 samples of 650185 calls.
-;;;       Execution time sample mean : 150.557777 ns
-;;;              Execution time mean : 150.531630 ns
-;;; Execution time sample std-deviation : 2.173764 ns
-;;;     Execution time std-deviation : 2.264377 ns
-;;;    Execution time lower quantile : 148.153076 ns ( 2.5%)
-;;;    Execution time upper quantile : 153.176454 ns (97.5%)
-;;;                    Overhead used : 1.902678 ns
+;;; Evaluation count : 3881214 in 6 samples of 646869 calls.
+;;;       Execution time sample mean : 154.520584 ns
+;;;              Execution time mean : 154.514142 ns
+;;; Execution time sample std-deviation : 2.010962 ns
+;;;     Execution time std-deviation : 2.107593 ns
+;;;    Execution time lower quantile : 152.522755 ns ( 2.5%)
+;;;    Execution time upper quantile : 156.804920 ns (97.5%)
+;;;                    Overhead used : 1.904185 ns
 ;;;
 ;; <-
 ;; =>
@@ -203,30 +204,25 @@
 ;; @@
 ;; ->
 ;;; Warming up for JIT optimisations 5000000000 ...
-;;;   compilation occured before 33 iterations
-;;;   compilation occured before 149509 iterations
-;;;   compilation occured before 448461 iterations
-;;;   compilation occured before 1345317 iterations
-;;;   compilation occured before 19282437 iterations
-;;;   compilation occured before 19431913 iterations
+;;;   compilation occured before 632961 iterations
 ;;; Estimating execution count ...
 ;;; Sampling ...
 ;;; Final GC...
 ;;; Checking GC...
-;;; WARNING: Final GC required 32.98901319450617 % of runtime
+;;; WARNING: Final GC required 46.6136484687365 % of runtime
 ;;; Finding outliers ...
 ;;; Bootstrapping ...
 ;;; Checking outlier significance
 ;;; x86_64 Mac OS X 10.9.5 4 cpu(s)
 ;;; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
 ;;; Runtime arguments: -Dfile.encoding=UTF-8 -Xmx4g -Dclojure.compile.path=/Users/jony/Documents/Work/Computing/ProjectX/Projects/algebolic/target/classes -Dalgebolic.version=0.1.0-SNAPSHOT -Dclojure.debug=false
-;;; Evaluation count : 4671618 in 6 samples of 778603 calls.
-;;;       Execution time sample mean : 129.318231 ns
-;;;              Execution time mean : 129.282911 ns
-;;; Execution time sample std-deviation : 2.842865 ns
-;;;     Execution time std-deviation : 2.955372 ns
-;;;    Execution time lower quantile : 125.914485 ns ( 2.5%)
-;;;    Execution time upper quantile : 132.860098 ns (97.5%)
+;;; Evaluation count : 4428132 in 6 samples of 738022 calls.
+;;;       Execution time sample mean : 139.061126 ns
+;;;              Execution time mean : 139.119389 ns
+;;; Execution time sample std-deviation : 5.463746 ns
+;;;     Execution time std-deviation : 5.701333 ns
+;;;    Execution time lower quantile : 133.351946 ns ( 2.5%)
+;;;    Execution time upper quantile : 147.370668 ns (97.5%)
 ;;;                    Overhead used : 1.904185 ns
 ;;;
 ;; <-


Improve the test for put-index. Include a more complete index as an example.

--- test/clj_ravendb/client_putting_indexes_test.clj
+++ test/clj_ravendb/client_putting_indexes_test.clj
@@ -6,9 +6,9 @@
             [clj-ravendb.config :refer :all]))

 (let [client (client ravendb-url ravendb-database {:ssl-insecure? true :oauth-url oauth-url :api-key api-key})
-      idx {:index "MultiClause"
+      idx {:index "ExpensiveSweetAndSavouryProductsWithLowStockAndRunningOut"
            :from :Products
-           :where [[:== :Name "Chocolade"] [:== :UnitsInStock 15]]
+           :where [[:> :PricePerUser 20] [:< :UnitsInStock 10] [:== :UnitsOnOrder 0] [:== :Category "categories/2"]]
            :select [:Name]}]
   (deftest test-put-index-with-invalid-index-throws
     (testing "Putting an index with an invalid form."
@@ -28,15 +28,15 @@
       (let [actual (put-index! client idx)
             expected 201]
         (is (= expected (actual :status))))))
-
+
   (deftest test-query-put-index-returns-correct-results
     (testing "querying an index returns the correct results"
-      (let [actual (query-index client {:index "MultiClause"})
-            results (actual :results)
+      (let [actual (query-index client {:index "ExpensiveSweetAndSavouryProductsWithLowStockAndRunningOut"})
+            results (sort-by :UnitsInStock (actual :results))
             doc-one (first (filter
                              (fn [i]
-                               (and (= (-> i :Name) "Chocolade")
-                                    (= (-> i :UnitsInStock) 15))) results))]
+                               (and (= (-> i :Name) "Chef Anton's Gumbo Mix")
+                                    (= (-> i :UnitsInStock) 0))) results))]
         (and (is (not= nil doc-one))))))

   (deftest test-putting-index-uses-custom-req-builder


indentation

indentation

--- test/cljx/jamesmacaulay/zelkova/signal_test.cljx
+++ test/cljx/jamesmacaulay/zelkova/signal_test.cljx
@@ -30,10 +30,10 @@
         mapped (z/map vector input foldp)
         async (z/async mapped)]
     (are [sig sources] (= (impl/signal-deps sig) sources)
-         input #{}
-         foldp #{input}
-         mapped #{input foldp}
-         async #{mapped})))
+      input #{}
+      foldp #{input}
+      mapped #{input foldp}
+      async #{mapped})))

 (deftest test-memoized-graph-calculations
   (let [input (z/input 0 :some-topic)
@@ -41,38 +41,38 @@
         mapped (z/map vector input foldp)
         async (z/async mapped)]
     (are [sig parents-map] (= (impl/parents-map sig) parents-map)
-         input {input #{}}
-         foldp {input #{}
-                foldp #{input}}
-         mapped {input #{}
-                 foldp #{input}
-                 mapped #{input foldp}}
-         async {input #{}
-                foldp #{input}
-                mapped #{input foldp}
-                async #{mapped}})
+      input {input #{}}
+      foldp {input #{}
+             foldp #{input}}
+      mapped {input #{}
+              foldp #{input}
+              mapped #{input foldp}}
+      async {input #{}
+             foldp #{input}
+             mapped #{input foldp}
+             async #{mapped}})
     (are [sig kids-map] (= (impl/kids-map sig) kids-map)
-         input {input #{}}
-         foldp {input #{foldp}
-                foldp #{}}
-         mapped {input #{foldp mapped}
-                 foldp #{mapped}
-                 mapped #{}}
-         async {input #{foldp mapped}
-                foldp #{mapped}
-                mapped #{async}
-                async #{}})
+      input {input #{}}
+      foldp {input #{foldp}
+             foldp #{}}
+      mapped {input #{foldp mapped}
+              foldp #{mapped}
+              mapped #{}}
+      async {input #{foldp mapped}
+             foldp #{mapped}
+             mapped #{async}
+             async #{}})
     (are [sig sorted-sigs] (= (impl/topsort sig) sorted-sigs)
-         input [input]
-         foldp [input foldp]
-         mapped [input foldp mapped]
-         async [input foldp mapped async])
+      input [input]
+      foldp [input foldp]
+      mapped [input foldp mapped]
+      async [input foldp mapped async])
     (are [sig inputs-by-topic] (= (impl/inputs-by-topic sig) inputs-by-topic)
-         input {:some-topic [input]}
-         foldp {:some-topic [input]}
-         mapped {:some-topic [input]}
-         async {:some-topic [input]
-                (:relayed-event-topic async) [async]})))
+      input {:some-topic [input]}
+      foldp {:some-topic [input]}
+      mapped {:some-topic [input]}
+      async {:some-topic [input]
+             (:relayed-event-topic async) [async]})))

 (deftest-async test-wiring-things-up
   (go


add write piece to board and clear board functions


html over-escaping fixed

html over-escaping fixed

HTML escaping no longer takes place on the server. This allows for the
client to decide how it wants to escape (or not escape) any characters,
leaving room for non-web-based viewers.

--- src/text_stream/edits.clj
+++ src/text_stream/edits.clj
@@ -1,5 +1,4 @@
-(ns text-stream.edits
-  (:require [hiccup.util :refer [escape-html]]))
+(ns text-stream.edits)

 (defn consolidate
   "Takes a seq of edits and composes them into a single function. Applies from
@@ -93,6 +92,8 @@
      ;; first message in a stream
      initial-text (fn [_ _] nil)

+     ;; we don't escape html here because the client does that and we
+     ;; want to be able to send literal characters to non-web-based viewers
      insert (fn [in _] (and (string? in) in))

      delete (fn [in source-map]
@@ -124,5 +125,5 @@
     (let [func (get commands cmd)
           text-input (subs text (inc cmd-len))]
       (if-let [valid-input ((get cmd-validators func)
-                            (escape-html text-input) source-map)]
+                            text-input source-map)]
         ((func valid-input) source-map)))))


Add a function for testing format strings

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -113,6 +113,26 @@
                    chapter-link-name-normalize
                    chapter-link-url-normalize))

+(defn format-specifiers? [fmt specs]
+  (loop [m (re-matcher (re-pattern (first specs)) fmt)
+         specs (rest specs)]
+    (if (.find m)
+      (if (seq specs)
+        (recur (.usePattern m (re-pattern (first specs)))
+               (rest specs))
+        true)
+      false)))
+
+(def #^{:macro true} has #'is)
+
+(deftest test-format-specifiers?
+  (has (format-specifiers? "%s" ["%s"]))
+  (has (format-specifiers? "abc%s %def %y" ["%s" "%d" "%y"]))
+
+  (has (not (format-specifiers? "%d" ["%s"])))
+  (has (not (format-specifiers? "%s%d" ["%s" "%f"])))
+  (has (not (format-specifiers? "%sabc%d" ["%d" "%s"]))))
+
 (defn test-extract-image-tag [html image-tag]
   (and
    (tu/ensure-dependencies-defined extract-image-tag)


fix typo

fix typo

--- src/main/clojure/clojure/tools/analyzer/passes/js/validate.clj
+++ src/main/clojure/clojure/tools/analyzer/passes/js/validate.clj
@@ -17,7 +17,7 @@
 (defmethod -validate :maybe-class [{:keys [class env] :as ast}]
   (throw (ex-info (str "Cannot resolve: " class)
                   (merge {:sym class
-                          :ast prewalk ast cleanup}
+                          :ast (prewalk ast cleanup)}
                          (source-info env)))) )

 (defn validate-tag [t {:keys [env] :as ast}]


Fix wrong class reference on forms events.

--- src/uxbox/data/forms.cljs
+++ src/uxbox/data/forms.cljs
@@ -24,7 +24,7 @@
 (defn assign-errors
   ([type] (assign-errors type nil))
   ([type errors]
-   (FormErrors. type errors)))
+   (AssignErrors. type errors)))

 ;; --- Assign Field Value


Fixed docstring

Fixed docstring

--- src/video_server/util.clj
+++ src/video_server/util.clj
@@ -52,8 +52,9 @@
   [url]
   (URLDecoder/decode (str url) "UTF-8"))

-(defn split-equally [num coll]
-  "Split a collection into a vector of (as close as possible) equally sized parts"
+(defn split-equally
+  "Split a collection into a vector of (as close as possible) equally sized parts."
+  [num coll]
   (loop [num num
          parts []
          coll coll


(PDB-2908) maplog: support i18n-friendly message-generator

--- src/puppetlabs/structured_logging/core.clj
+++ src/puppetlabs/structured_logging/core.clj
@@ -151,17 +151,23 @@
         (if (instance? Throwable throwable-or-ctx)
           [throwable-or-ctx ctx-or-message (first more) (rest more)]
           [nil throwable-or-ctx ctx-or-message more])
-        esc-ctx (mapvals #(.replace (str %) "%" "%%") ctx)]
-
-    (write-with-marker! logger level throwable
-                        (apply format (interpolate-message msg esc-ctx) fmt-args)
-                        ctx)))
+        msg (if (string? msg)
+              (let [esc-ctx (mapvals #(.replace (str %) "%" "%%") ctx)]
+                (apply format (interpolate-message msg esc-ctx) fmt-args))
+              (msg ctx))]
+    (write-with-marker! logger level throwable msg ctx)))

 (defmacro maplog
-  "Logs an event after expanding any braced references to ctx-map keys
-  in the message into the corresponding ctx-map values, and then
-  passing the expanded string and format-args to clojure.core/format.
-  Includes the ctx-map in the event as an slf4j event Marker.
+  "Logs an event with ctx-map as an slf4j event Marker.
+
+  When a message string is provided, expands any braced key references
+  like \"{foo}\" in the string into the corresponding ctx-map values,
+  and then passes the expanded string and format-args to
+  clojure.core/format.  Percent-escapes the expansions so the content
+  can't be interpreted as format directives.
+
+  When a message-generator is provided, calls (message-generator
+  ctx-map) to generate the log message.

   The level-or-pair parameter may be either a log level keyword like
   :error or a vector of a custom logger and the log level, like
@@ -175,9 +181,14 @@
            \"Failed to pull record from remote {remote}. Response: status {status}\")

   (maplog [:sync :info] {:remote ...}
-           \"Finished pull from {remote} in %s seconds\" sync-time)"
+           \"Finished pull from {remote} in %s seconds\" sync-time)
+
+  (maplog :info {:status 200}
+          #(i18n/trs \"Received success status {0}\" (:status %1)))"
   {:arglists '([level-or-pair ctx-map message & format-args]
-               [level-or-pair throwable ctx-map message & format-args])}
+               [level-or-pair throwable ctx-map message & format-args]
+               [level-or-pair ctx-map message-generator]
+               [level-or-pair throwable ctx-map message-generator])}
   [level-or-pair x y & more]
   `(let [lop# ~level-or-pair
          [ns# level#] (if (coll? lop#) lop# [~*ns* lop#])


Reduced repetition

Reduced repetition

--- src/useful/utils.clj
+++ src/useful/utils.clj
@@ -64,8 +64,8 @@
   `(try (ns ~(ns-name *ns*) ~ns-reference)
         (eval '~then-form)
         (catch Exception e#
-          (when-not (or (instance? java.io.FileNotFoundException    e#)
-                        (instance? java.lang.ClassNotFoundException e#))
+          (when-not (some #(instance? % e#) [java.io.FileNotFoundException
+                                             java.lang.ClassNotFoundException])
             (printf "%s: %s %s" (.getName (class e#)) (.getMessage e#) '~ns-reference))
           (eval '~else-form))))


Use component-local state

Use component-local state

Place buffers and channels for the custom slide into the component
state, rather than as defs

--- src-cljs/qcon/main.cljs
+++ src-cljs/qcon/main.cljs
@@ -13,10 +13,6 @@

 (def debug false)

-(def bufsize 7)
-(def buf1 (buffer bufsize))
-(def chan1 (chan buf1))
-
 (def default-font "72pt")

 (defprotocol Slide
@@ -25,36 +21,46 @@

 (defrecord PutAndTakeSlide []
   Slide
-  (init-slide-state [_] nil)
+  (init-slide-state [_]
+    (println "Init state of PutAndTakeSlide")
+    (let [bufsize 7
+          buf1 (buffer bufsize)
+          chan1 (chan buf1)]
+      {:bufsize bufsize
+       :buf1 buf1
+       :chan1 chan1}))
   (render-slide [_ data owner]
-    [:div
-     [:svg {:version "1.1" :width 800 :height 600}
-
-      [:g {:transform "translate(70,65)"
-           :onClick (fn [_]
-                      (go
-                        (>! chan1 (str (rand-int 10)))
-                        (om/set-state! owner :modified (new js/Date))))}
-
-       [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
-       [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]
-
-      (for [x (range bufsize)]
-        (let [radius 50]
-          [:g {:transform (str "translate(320,320)")}
-           [:g {:transform (str "rotate(" (- (* (- x (/ bufsize 2) (- 1)) (/ 180 bufsize))) ") translate(200)")}
-            [:circle {:cx 0 :cy radius :r radius :style {:fill "#224"}}]
-            [:text {:x (- 0 (/ radius 2) 5) :y (* 1.7 radius) :style {:font-size default-font :fill "white"}}
-             (str (aget (.-arr (.-buf buf1)) (mod (+ x (.-head (.-buf buf1))) bufsize)))]]]))
-
-      [:g {:transform "translate(70,475)"
-           :onClick (fn [_]
-                      (go
-                        (<! chan1)
-                        (om/set-state! owner :modified (new js/Date))))}
-       [:rect {
-               :x 0 :y 0 :width 140 :height 100 :fill "black"}]
-       [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]]]]))
+    (let [bufsize (om/get-state owner :bufsize)
+          buf1 (om/get-state owner :buf1)
+          chan1 (om/get-state owner :chan1)]
+      [:div
+       [:svg {:version "1.1" :width 800 :height 600}
+
+        [:g {:transform "translate(70,65)"
+             :onClick (fn [_]
+                        (go
+                          (>! chan1 (str (rand-int 10)))
+                          (om/set-state! owner :modified (new js/Date))))}
+
+         [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
+         [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]
+
+        (for [x (range bufsize)]
+          (let [radius 50]
+            [:g {:transform (str "translate(320,320)")}
+             [:g {:transform (str "rotate(" (- (* (- x (/ bufsize 2) (- 1)) (/ 180 bufsize))) ") translate(200)")}
+              [:circle {:cx 0 :cy radius :r radius :style {:fill "#224"}}]
+              [:text {:x (- 0 (/ radius 2) 5) :y (* 1.7 radius) :style {:font-size default-font :fill "white"}}
+               (str (aget (.-arr (.-buf buf1)) (mod (+ x (.-head (.-buf buf1))) bufsize)))]]]))
+
+        [:g {:transform "translate(70,475)"
+             :onClick (fn [_]
+                        (go
+                          (<! chan1)
+                          (om/set-state! owner :modified (new js/Date))))}
+         [:rect {
+                 :x 0 :y 0 :width 140 :height 100 :fill "black"}]
+         [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]]]])))

 (def app-model
   (atom {:current-slide 3
@@ -112,6 +118,10 @@

 (defn slide [data owner current]
   (reify
+    om/IInitState
+    (init-state [_]
+      (when-let [custom (:custom data)]
+        (init-slide-state (om/value custom))))
     om/IRender
     (render [_]
       (html