updated docs for matrix.walk

updated docs for matrix.walk

--- src/clj/forma/matrix/walk.clj
+++ src/clj/forma/matrix/walk.clj
@@ -1,12 +1,22 @@
 (ns forma.matrix.walk
+  "Functions that move along a 2D array, collecting features of the
+moving window."
   (:use cascalog.api
         [forma.utils :only (nth-in)]
         [forma.matrix.utils :only (insert-into-val
-                                  insert-at)]))
+                                   insert-at)]))

 (defn walk-matrix
-  "Walks along the rows and columns of a matrix at the given window
-  size, returning all (window x window) snapshots."
+  "Returns a sequence of matrices, after walking along the rows and
+  columns of the given matrix a the specified window size and
+  returning all window-by-window snapshots.
+
+  Example usage:
+    (def mat [[0 1 2] [3 4 5]])
+    (walk-matrix mat 2) => [[[0 1]
+                             [3 4]]
+                            [[1 2]
+                             [4 5]]]"
   [m window]
   (mapcat (comp (partial apply map vector)
                 (partial map (partial partition window 1)))
@@ -15,18 +25,17 @@
 (defn buffer-matrix
   "For the supplied matrix `mat`, returns a new matrix generated by
   padding the beginning and end of each row and column with the
-  supplied value, repeated `buffer-size` times. For example:
+  supplied value, repeated `buffer-size` times.

-  (def test-matrix [[0 1 2]
-                    [3 4 5]])
-
-  (buffer-matrix 2 1 test-matrix)
-  => [[1 1 1 1 1 1 1]
-      [1 1 1 1 1 1 1]
-      [1 1 0 1 2 1 1]
-      [1 1 3 4 5 1 1]
-      [1 1 1 1 1 1 1]
-      [1 1 1 1 1 1 1]]"
+  Example usage:
+    (def test-matrix [[0 1 2]
+                      [3 4 5]])
+    (buffer-matrix 2 1 test-matrix) => [[1 1 1 1 1 1 1]
+                                        [1 1 1 1 1 1 1]
+                                        [1 1 0 1 2 1 1]
+                                        [1 1 3 4 5 1 1]
+                                        [1 1 1 1 1 1 1]
+                                        [1 1 1 1 1 1 1]]"
   [buffer-size val [row :as mat]]
   (let [n (-> buffer-size (* 2) (+ (count row)))
         buf-row (repeat n val)]
@@ -36,9 +45,13 @@
                (repeat (* 2 buffer-size) buf-row))))

 (defn wipe-out
-  "Takes a nested collection and a sequence of keys, and returns a new
+  "Accepts a nested collection and a sequence of keys, and returns a new
   collection generated by removing the value located at the position
-  indicated by the supplied key sequence."
+  indicated by the supplied key sequence.
+
+  Example usage:
+    (def test-matrix [[0 1 2] [3 4 5]])
+    (wipe-out test-matrix [1 2]) => [[0 1 2] [3 4]]"
   [coll [k & ks]]
   {:pre [(or (nil? k) (coll? coll))]}
   (if-not k
@@ -51,16 +64,16 @@
   "Iterates across the supplied two dimensional matrix, returning a
   lazy sequence of 2-element vectors of the form `[matrix entry,
   neighbor-seq]`. Neighbors outside the matrix are reported as
-  nil. For example:
+  nil.

+  Example usage:
     (def test-matrix [[:0 :1 :2 :3]
                       [:4 :5 :6 :7]
                       [:8 :9 :a :b]
                       [:c :d :e :f]])

     (first (neighbor-scan 1 test-matrix))
-    ;=> [:0 ((nil nil nil) (nil :1) (nil :4 :5))]"
-
+       => [:0 ((nil nil nil) (nil :1) (nil :4 :5))]"
   [num-neighbors mat]
   {:pre [(> (count mat)
             (inc (* 2 num-neighbors)))]}
@@ -85,4 +98,3 @@
            (apply concat)
            (filter (complement nil?))
            (apply f)))))
-


remove badges with nil values

remove badges with nil values

--- src/clj/salava/gallery/db.clj
+++ src/clj/salava/gallery/db.clj
@@ -71,14 +71,14 @@
     (str "('" (apply str (interpose "','" (map #(string/replace % #"\W" "") ids))) "')"))

 (defn badge-count [search page_count]
-  (let [limit 20
+  (let [limit 1
         badges-left (- (count search) (* limit (+ page_count 1)))]
     (if (pos? badges-left)
       badges-left
       0)))

 (defn select-badges [ctx badge_ids order page_count]
-  (let [limit 20
+  (let [limit 1
         offset (* limit page_count)]
     (if (not-empty badge_ids)
       (case order
@@ -132,8 +132,9 @@
 (defn get-gallery-badges
   "Get badge-ids"
   [ctx country tags badge-name issuer-name order recipient-name tags-ids page_count]
-  (let [badge-ids (get-badge-ids ctx country tags badge-name issuer-name order recipient-name tags-ids)]
-    {:badges (select-badges ctx badge-ids order page_count)
+  (let [badge-ids (get-badge-ids ctx country tags badge-name issuer-name order recipient-name tags-ids)
+        badges (remove #(some nil? (vals %)) (select-badges ctx badge-ids order page_count))]
+    {:badges badges #_(select-badges ctx badge-ids order page_count)
      :tags (select-tags ctx badge-ids)
      :badge_count (badge-count badge-ids page_count) }))


increase generator max-try number

increase generator max-try number

--- test/joda_time/generators.clj
+++ test/joda_time/generators.clj
@@ -194,7 +194,7 @@
                (multi-field-partial :chrono chrono
                                     :allowed-fields allowed-fields
                                     :required-fields required-fields)
-               100))
+               200))

 (def local-date
   (g/fmap #(LocalDate. %)
@@ -255,7 +255,7 @@
                        (multi-field-partial :chrono c
                                             :required-fields fields
                                             :allowed-fields fields)
-                       100))))
+                       200))))

 (defn- same-chronology [date]
   (cond (instance? ReadableInstant date)
@@ -298,4 +298,4 @@
                     (and (:start %) (:end %))
                     (some (set valid-period-field-types) (keys %)))
                period-construction-map
-               100))
+               200))


all the files have to be https

all the files have to be https

--- src/clj/secret_shame/core.clj
+++ src/clj/secret_shame/core.clj
@@ -36,7 +36,7 @@
      (include-js "bootstrap/dist/js/jquery.js")
      (include-js "bootstrap/dist/js/bootstrap.js")
      (include-js "bootcards/dist/js/bootcards.min.js")
-     (include-js "https://fb.me/react-0.9.0.js")
+     (include-js "//fb.me/react-0.9.0.js")
      (include-js "js/out/goog/base.js")
      (include-js "js/app.js")
      [:script {type "text/javascript"} "goog.require(\"secret_shame.core\");"]]]))


Change experimental Voyt extension's syntax

Two points:

 - I had forgotten to use the fully qualified key for extensions inside
   Cmetadata. Correct that.

 - Change "macro-requires" into "requires". – Voyt will be about macros,
   so the former would be redundant.

--- src/cljs/theatralia/utils.clj
+++ src/cljs/theatralia/utils.clj
@@ -17,7 +17,7 @@

   See the :voyt.ext/macro-requires in the extension metadata for a list of
   namespaces that have to be required in a namespace where this macro is used."
-  {:extensions {:voyt.ext/macro-requires ['theatralia.thomsky]}}
+  {:grenada.cmeta/extensions {:voyt.ext/requires ['theatralia.thomsky]}}
   ([handler-sym] `(register-handler* ~handler-sym []))
   ([handler-sym middleware]
    `(do
@@ -40,7 +40,7 @@

   See the :voyt.ext/macro-requires in the extension metadata for a list of
   namespaces that have to be required in a namespace where this macro is used."
-  {:extensions {:voyt.ext/macro-requires ['re-frame.core]}}
+  {:grenada.cmeta/extensions {:voyt.ext/requires ['re-frame.core]}}
   [handler-sym]
   `(do
      (re-frame.core/register-sub ~(keyword handler-sym)


Full unit-test running on cljs

Full unit-test running on cljs

--- test/obb_rules/unit_test.cljc
+++ test/obb_rules/unit_test.cljc
@@ -7,34 +7,33 @@
   (testing "get-units"
     (is (= 20 (count (unit/get-units))))))

-(comment
 (defn- test-unit
   [name code]
-  (let [unit (get-unit-by-name name)
-        unit-by-code (get-unit-by-code code)]
+  (let [unit (unit/get-unit-by-name name)
+        unit-by-code (unit/get-unit-by-code code)]
     (is (= unit unit-by-code))
-    (is (= name (unit-name unit)))
-    (is (= code (unit-code unit)))
-    (is (> (unit-attack unit) 0))
-    (is (unit-movement-type unit))
-    (is (> (unit-defense unit) 0))))
+    (is (= name (unit/unit-name unit)))
+    (is (= code (unit/unit-code unit)))
+    (is (> (unit/unit-attack unit) 0))
+    (is (unit/unit-movement-type unit))
+    (is (> (unit/unit-defense unit) 0))))

 (defn- verify-unit
   [unit]
   (testing  (test-unit (:name unit) (:code unit))))

 (deftest verify-units
-  (doseq [unit (get-units)]
+  (doseq [unit (unit/get-units)]
     (verify-unit unit)))

 (defn- unit-present?
   "Checks if a unit is present"
   [uname coll]
-  (some (fn [u] (= (unit-name u) (name uname))) coll))
+  (some (fn [u] (= (unit/unit-name u) (name uname))) coll))

 (deftest units-by-category-test
   (testing "light units"
-    (let [units (units-by-category :light)]
+    (let [units (unit/units-by-category :light)]
       (is units)
       (is (> (count units) 0))
       (is (unit-present? :rain units))
@@ -43,7 +42,7 @@
       (is (not (unit-present? :crusader units)))))

   (testing "medium units"
-    (let [units (units-by-category :medium)]
+    (let [units (unit/units-by-category :medium)]
       (is units)
       (is (> (count units) 0))
       (is (unit-present? :worm units))
@@ -51,7 +50,7 @@
       (is (not (unit-present? :crusader units)))))

   (testing "heavy units"
-    (let [units (units-by-category :heavy)]
+    (let [units (unit/units-by-category :heavy)]
       (is units)
       (is (> (count units) 0))
       (is (unit-present? :crusader units))
@@ -59,4 +58,3 @@
       (is (not (unit-present? :worm units))))))

 (verify-units)
-)


hq-util and unpack-map-workflow no longer exist

--- test/onyx/validation_test.clj
+++ test/onyx/validation_test.clj
@@ -2,7 +2,6 @@
   (:require [onyx.peer.pipeline-extensions :as p-ext]
             [onyx.peer.task-lifecycle-extensions :as l-ext]
             [midje.sweet :refer :all]
-            [onyx.queue.hornetq-utils :as hq-util]
             [onyx.api]))

 (def id (java.util.UUID/randomUUID))
@@ -138,11 +137,6 @@

 (onyx.api/shutdown-env env)

-(fact (onyx.api/unpack-map-workflow {:a :b}) => [[:a :b]])
-(fact (onyx.api/unpack-map-workflow {:a {:b :c}}) => [[:a :b] [:b :c]])
-(fact (onyx.api/unpack-map-workflow {:a {:b {:c :d}}}) => [[:a :b] [:b :c] [:c :d]])
-(fact (onyx.api/unpack-map-workflow {:a {:b :c :d :e}}) => [[:a :b] [:a :d] [:b :c] [:d :e]])
-
 (fact (sort (onyx.api/map-set-workflow->workflow {:a #{:b :c}
                                                   :b #{:d}
                                                   :c #{:d :e}}))
@@ -152,15 +146,6 @@
              [:b :d]
              [:c :d]
              [:c :e]]))
-
-
-(fact (into #{} (onyx.api/unpack-map-workflow {:a {:b :c} :d {:e :f :g :h}}))
-      => #{[:a :b]
-           [:b :c]
-           [:d :e]
-           [:d :g]
-           [:e :f]
-           [:g :h]})

 (let [catalog
       [{:onyx/name :a


Simple clojure solution to 55

Simple clojure solution to 55

--- euler_clojure/src/euler_clojure/problem55.clj
+++ euler_clojure/src/euler_clojure/problem55.clj
@@ -8,23 +8,17 @@

 (ns euler.problem55)

-(defn to-digits [n]
-  ;; 1234 => (1 2 3 4)
-  (map #(Character/getNumericValue %) (str n)))
+(defn reverse-num [n]
+  ;; 123456 => 654321N
+  (bigint (clojure.string/join (reverse (str n)))))

-(defn to-num [digits]
-  ;; [1 2 3 4] => 1234N
-  (bigint (clojure.string/join digits)))
-
-(def palindromic?
-  (memoize (fn [n] (= (to-digits n)
-                      (reverse (to-digits n))))))
+(def palindrome?
+  (memoize (fn [n] (= n (reverse-num n)))))

 (defn lychrel? [n]
-  (let [reverse-num #(to-num (reverse (to-digits %)))
-        start (+ n (reverse-num n))
+  (let [start (+ n (reverse-num n))
         iterations (iterate #(+' % (reverse-num %)) start)]
-    (not-any? palindromic? (take 50 iterations))))
+    (not-any? palindrome? (take 50 iterations))))

 (defn problem55 []
   (count (filter lychrel? (range 1 10000))))


Add logging to template request

Add logging to template request

--- src/pdok/featured_to_extracts/template.clj
+++ src/pdok/featured_to_extracts/template.clj
@@ -35,6 +35,7 @@
   (clojure.string/replace template "{{>" (str "{{>" qualifier)))

 (defn add-or-update-template [{:keys [dataset extract-type name template]}]
+  (log/info "Add/Update template, dataset: " dataset "extract-type: " extract-type "name: " + name)
   (let [template (normalize template)
         template (prefix-partials template (template-qualifier dataset extract-type))
         template-key (template-key dataset extract-type name)]


makes assert-ping-response less flaky (#896)

--- waiter/integration/waiter/health_check_test.clj
+++ waiter/integration/waiter/health_check_test.clj
@@ -34,9 +34,9 @@
                (get-in ping-response [:headers :x-kitchen-protocol-version]))
             (str ping-response))
         (is (= "get" (get-in ping-response [:headers :x-kitchen-request-method])) (str ping-response))
-        (is (or (= {:exists? true :healthy? true :service-id service-id :status "Running"} service-state)
-                (= {:exists? true :healthy? false :service-id service-id :status "Starting"} service-state))
-            (str service-state)))
+        (is (:exists? service-state) (str service-state))
+        (is (= service-id (:service-id service-state)) (str service-state))
+        (is (contains? #{"Running" "Starting"} (:status service-state)) (str service-state)))
       (do
         (is (= "timed-out" (get ping-response :result)) (str ping-response))
         (is (= {:exists? true :healthy? false :service-id service-id :status "Starting"} service-state))))))


1_3_4

--- src/sicp_tasks_on_clojure/chapter1_3_4.clj
+++ src/sicp_tasks_on_clojure/chapter1_3_4.clj
@@ -47,4 +47,7 @@
              c)))

 (defn find-zero [a b c]
-  (newton-method (cubic a b c) 1))+  (newton-method (cubic a b c) 1))
+
+(defn double-it [f]
+  (comp f f))


Fix problem with inconsistent measurements data.

--- src-cljs/kixi/hecuba/tabs/hierarchy/data.cljs
+++ src-cljs/kixi/hecuba/tabs/hierarchy/data.cljs
@@ -249,15 +249,14 @@
                                                  (into [] (map (fn [m]
                                                                  (assoc m :sensor sensor))
                                                                (:measurements response))))))
-                           (when (= (-> sensors last) sensor)
-                             (let [units          (-> @properties :chart :units)
-                                   sensors        (fetch-sensors entity_id @properties)
-                                   measurements   (-> @properties :chart :measurements)
-                                   all-series     (parse (filter seq measurements) units sensors)
-                                   unit-groups    (group-by #(-> % first :unit) all-series)
-                                   all-groups     (vals unit-groups)]
-                               (om/update! properties [:chart :all-groups] all-groups)
-                               (om/update! properties [:chart :fetching] false))))
+                           (let [units          (-> @properties :chart :units)
+                                 sensors        (fetch-sensors entity_id @properties)
+                                 measurements   (-> @properties :chart :measurements)
+                                 all-series     (parse (filter seq measurements) units sensors)
+                                 unit-groups    (group-by #(-> % first :unit) all-series)
+                                 all-groups     (vals unit-groups)]
+                             (om/update! properties [:chart :all-groups] all-groups)
+                             (om/update! properties [:chart :fetching] false)))
                 :headers {"Accept" "application/json"}
                 :response-format :json
                 :keywords? true}))))


Refactor log-subscriber.

Refactor log-subscriber.

--- src/cmr/dev/env/manager/components/system.clj
+++ src/cmr/dev/env/manager/components/system.clj
@@ -20,32 +20,29 @@
 ;;;   Utility Constants, Data Structures, & Functions   ;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn log-subscriber
-  [logging-type]
-  (case logging-type
-    :fatal (fn [msg] (log/fatal msg))
-    :error (fn [msg] (log/error msg))
-    :warn (fn [msg] (log/warn msg))
-    :info (fn [msg] (log/info msg))
-    :debug (fn [msg] (log/debug msg))
-    :trace (fn [msg] (log/trace msg))
-    :timer (fn [msg] (log/tracef "The %s interval has passed."
-                                 (:interval msg)))
-    :fs (fn [msg] (log/debug "File system got watcher event:" msg))))
+(def log-subscriber
+  {:fatal (fn [msg] (log/fatal msg))
+   :error (fn [msg] (log/error msg))
+   :warn (fn [msg] (log/warn msg))
+   :info (fn [msg] (log/info msg))
+   :debug (fn [msg] (log/debug msg))
+   :trace (fn [msg] (log/trace msg))
+   :timer (fn [msg] (log/tracef "The %s interval has passed." (:interval msg)))
+   :file-event (fn [msg] (log/debug "File system got watcher event:" msg))})

 (def default-subscribers
-  [{:topic :fatal :fn (log-subscriber :fatal)}
-   {:topic :error :fn (log-subscriber :error)}
-   {:topic :warn :fn (log-subscriber :warn)}
-   {:topic :info :fn (log-subscriber :info)}
-   {:topic :debug :fn (log-subscriber :debug)}
-   {:topic :trace :fn (log-subscriber :trace)}])
+  [{:topic :fatal :fn (:fatal log-subscriber)}
+   {:topic :error :fn (:error log-subscriber)}
+   {:topic :warn :fn (:warn log-subscriber)}
+   {:topic :info :fn (:info log-subscriber)}
+   {:topic :debug :fn (:debug log-subscriber)}
+   {:topic :trace :fn (:trace log-subscriber)}])

 (def default-timer-subscribers
-  [{:interval :all :fn (log-subscriber :timer)}])
+  [{:interval :all :fn (:timer log-subscriber)}])

 (def default-watcher-subscribers
-  [{:event :all :fn (log-subscriber :fs)}])
+  [{:topic :file-event :fn (:file-event log-subscriber)}])

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;   D.E.M Components   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


fix huge performance bug -- don't get into a render loop!

--- src-cljs/frontend/components/chat.cljs
+++ src-cljs/frontend/components/chat.cljs
@@ -124,6 +124,7 @@
     om/IInitState
     (init-state [_]
       {:listener-key (.getNextUniqueId (.getInstance IdGenerator))
+       :auto-scroll? true
        :touch-enabled? false})
     om/IDidMount
     (did-mount [_]
@@ -139,15 +140,17 @@
     om/IWillUnmount
     (will-unmount [_]
       (d/unlisten! (om/get-shared owner :db) (om/get-state owner :listener-key)))
-    om/IWillUpdate
-    (will-update [_ _ _]
+    om/IWillReceiveProps
+    (will-receive-props [_ next-props]
       ;; check for scrolled all of the way down
-      (let [node (om/get-node owner "chat-messages")]
-        (om/set-state! owner :auto-scroll (= (- (.-scrollHeight node) (.-scrollTop node))
-                                             (.-clientHeight node)))))
+      (let [node (om/get-node owner "chat-messages")
+            auto-scroll? (= (- (.-scrollHeight node) (.-scrollTop node))
+                            (.-clientHeight node))]
+        (when (not= (om/get-state owner :auto-scroll?) auto-scroll?)
+          (om/set-state! owner :auto-scroll? auto-scroll?))))
     om/IDidUpdate
     (did-update [_ _ _]
-      (when (om/get-state owner :auto-scroll)
+      (when (om/get-state owner :auto-scroll?)
         (set! (.-scrollTop (om/get-node owner "chat-messages"))
               10000000)))
     om/IRender


clean up billing overview copy

clean up billing overview copy

--- src-cljs/frontend/components/plan.cljs
+++ src-cljs/frontend/components/plan.cljs
@@ -270,11 +270,12 @@
           [:div.menu-view
            [:div.divider.make]
            [:div.content.make
-            [:h4 "Team of 3 @ $10/mo."]]
+            [:h4 "Your team plan renews June 7 for $15."]]
            [:div.content.make
-            [:p "We'll begin charging in 14 days when your free trial expires. "
-                "Then your Product Hunt discount will save you 50% for the next 6 months. "
-                "Your first invoice will be $15. "]]
+            [:p "3 users are active on your team. "
+                "Your plan renews monthly. "
+                "Product Hunt's 50% discount is included in the renewal price. "
+                "The 14 days left in your trial are included in the renewal date. "]]
            [:div.divider.make]
            [:a.vein.make {:on-click         #(cast! :billing-info-opened)
                           :on-touch-end #(do (cast! :billing-info-opened) (.preventDefault %))}


Story ID: develop added env to check-server-tx args

--- src/untangled/client/protocol_support.cljs
+++ src/untangled/client/protocol_support.cljs
@@ -32,11 +32,11 @@
   `initial-ui-state`: denormalized app state prior to sending the server transaction
   `ui-tx`: the om transaction that modifies the app state locally
   `server-tx`: the server transaction corresponding to ui-tx"
-  [{:keys [initial-ui-state ui-tx server-tx] :as data}]
+  [{:keys [initial-ui-state ui-tx server-tx]} & {:keys [env]}]
   (component "Client Remoting"
     (let [{:keys [parser]} (impl/init-testing)
           state (atom initial-ui-state)
-          parse (partial parser {:state state})
+          parse (partial parser (merge {:state state} env))
           tempid-map (impl/allocate-tempids ui-tx)
           ui-tx (impl/rewrite-tempids ui-tx tempid-map)]


:cyclone:

:cyclone:

Port configuration command-line stuff?

--- src/main/clj/agency/irl/instagrammer/core.clj
+++ src/main/clj/agency/irl/instagrammer/core.clj
@@ -48,7 +48,7 @@

 (defn -main
-  [& args]
+  [& args [port]]

   (println)
   (println "***")


remove line/column info from EDN reader

remove line/column info from EDN reader

--- src/main/clojure/clojure/tools/reader/edn.clj
+++ src/main/clojure/clojure/tools/reader/edn.clj
@@ -146,34 +146,21 @@

 (defn read-list
   [rdr _]
-  (let [[line column] (when (indexing-reader? rdr)
-                        [(get-line-number rdr) (dec (get-column-number rdr))])
-        the-list (read-delimited \) rdr true)]
+  (let [the-list (read-delimited \) rdr true)]
     (if (empty? the-list)
       '()
-      (with-meta (clojure.lang.PersistentList/create the-list)
-        (when line
-          {:line line :column column})))))
+      (clojure.lang.PersistentList/create the-list))))

 (defn read-vector
   [rdr _]
-  (let [[line column] (when (indexing-reader? rdr)
-                        [(get-line-number rdr) (dec (get-column-number rdr))])
-        the-vector (read-delimited \] rdr true)]
-    (with-meta the-vector
-      (when line
-        {:line line :column column}))))
+  (read-delimited \] rdr true))

 (defn read-map
   [rdr _]
-  (let [[line column] (when (indexing-reader? rdr)
-                        [(get-line-number rdr) (dec (get-column-number rdr))])
-        l (to-array (read-delimited \} rdr true))]
+  (let [l (to-array (read-delimited \} rdr true))]
     (when (== 1 (bit-and (alength l) 1))
       (reader-error rdr "Map literal must contain an even number of forms"))
-    (with-meta (RT/map l)
-      (when line
-        {:line line :column column}))))
+    (RT/map l)))

 (defn read-number
   [reader initch]
@@ -225,24 +212,20 @@
 (defn read-symbol
   [rdr initch]
   (when-let [token (read-token rdr initch)]
-    (let [[line column] (when (indexing-reader? rdr)
-                          [(get-line-number rdr) (dec (get-column-number rdr))])]
-      (case token
-
-        ;; special symbols
-        "nil" nil
-        "true" true
-        "false" false
-        "/" '/
-        "NaN" Double/NaN
-        "-Infinity" Double/NEGATIVE_INFINITY
-        ("Infinity" "+Infinity") Double/POSITIVE_INFINITY
-
-        (or (when-let [p (parse-symbol token)]
-              (with-meta (symbol (p 0) (p 1))
-                (when line
-                  {:line line :column column})))
-            (reader-error rdr "Invalid token: " token))))))
+    (case token
+
+      ;; special symbols
+      "nil" nil
+      "true" true
+      "false" false
+      "/" '/
+      "NaN" Double/NaN
+      "-Infinity" Double/NEGATIVE_INFINITY
+      ("Infinity" "+Infinity") Double/POSITIVE_INFINITY
+
+      (or (when-let [p (parse-symbol token)]
+            (symbol (p 0) (p 1)))
+          (reader-error rdr "Invalid token: " token)))))

 (defn read-keyword
   [reader initch]
@@ -266,20 +249,13 @@

 (defn read-meta
   [rdr _]
-  (let [[line column] (when (indexing-reader? rdr)
-                        [(get-line-number rdr) (dec (get-column-number rdr))])
-        m (desugar-meta (read rdr true nil true))]
+  (let [m (desugar-meta (read rdr true nil true))]
     (when-not (map? m)
       (reader-error rdr "Metadata must be Symbol, Keyword, String or Map"))
     (let [o (read rdr true nil true)]
       (if (instance? IMeta o)
-        (let [m (if (and line
-                         (seq? o))
-                  (assoc m :line line
-                           :column column)
-                  m)]
-          (when (instance? IObj o)
-            (with-meta o (merge (meta o) m))))
+        (when (instance? IObj o)
+          (with-meta o (merge (meta o) m)))
         (reader-error rdr "Metadata can only be applied to IMetas")))))

 (defn read-set


Use pst-on in wrap-stacktrace-log

Use pst-on in wrap-stacktrace-log

--- ring-devel/src/ring/middleware/stacktrace.clj
+++ ring-devel/src/ring/middleware/stacktrace.clj
@@ -14,9 +14,8 @@
     (try
       (handler request)
       (catch Exception ex
-        (let [msg (str "Exception: " (pst-str ex))]
-          (.println *err* msg)
-          (throw ex))))))
+        (pst-on *err* false ex)
+        (throw ex)))))

 (defn- style-resource [path]
   (html [:style {:type "text/css"} (slurp (io/resource path))]))


Add support for CPS handlers to run-jetty

--- ring-jetty-adapter/src/ring/adapter/jetty.clj
+++ ring-jetty-adapter/src/ring/adapter/jetty.clj
@@ -15,6 +15,7 @@
            [org.eclipse.jetty.server.handler AbstractHandler]
            [org.eclipse.jetty.util.thread ThreadPool QueuedThreadPool]
            [org.eclipse.jetty.util.ssl SslContextFactory]
+           [javax.servlet AsyncContext]
            [javax.servlet.http HttpServletRequest HttpServletResponse]))

 (defn- ^AbstractHandler proxy-handler [handler]
@@ -22,9 +23,19 @@
     (handle [_ ^Request base-request request response]
       (let [request-map  (servlet/build-request-map request)
             response-map (handler request-map)]
-        (when response-map
-          (servlet/update-servlet-response response response-map)
-          (.setHandled base-request true))))))
+        (servlet/update-servlet-response response response-map)
+        (.setHandled base-request true)))))
+
+(defn- ^AbstractHandler async-proxy-handler [handler]
+  (proxy [AbstractHandler] []
+    (handle [_ ^Request base-request request response]
+      (let [^AsyncContext context (.startAsync request)]
+        (handler
+         (servlet/build-request-map request)
+         (fn [response-map]
+           (servlet/update-servlet-response response response-map)
+           (.complete context)
+           (.setHandled base-request true)))))))

 (defn- ^ServerConnector server-connector [server & factories]
   (ServerConnector. server (into-array ConnectionFactory factories)))
@@ -102,6 +113,7 @@
   supplied options:

   :configurator         - a function called with the Jetty Server instance
+  :async?               - if true, treat the handler as asynchronous
   :port                 - the port to listen on (defaults to 80)
   :host                 - the hostname to listen on
   :join?                - blocks the thread until server ends (defaults to true)
@@ -128,9 +140,9 @@
   :response-header-size - the maximum size of a response header (default 8192)
   :send-server-version? - add Server header to HTTP response (default true)"
   [handler options]
-  (let [server (create-server (dissoc options :configurator))]
-    (doto server
-      (.setHandler (proxy-handler handler)))
+  (let [server (create-server (dissoc options :configurator))
+        proxyf (if (:async? options) async-proxy-handler proxy-handler)]
+    (.setHandler server (proxyf handler))
     (when-let [configurator (:configurator options)]
       (configurator server))
     (try


(WIP) Jsonp progress, refs #48

(WIP) Jsonp progress, refs #48

--- samples/twitterbuzz/src/twitterbuzz/core.cljs
+++ samples/twitterbuzz/src/twitterbuzz/core.cljs
@@ -1 +1,18 @@
-(ns twitterbuzz.core)+(ns twitterbuzz.core
+  (:require [goog.net.Jsonp :as jsonp]
+            [goog.debug.Console :as console]))
+
+(def console (goog.debug.Console.))
+(defn log [msg] (.addLogRecord console msg))
+
+(def twitter-uri (goog.Uri. "http://twitter.com/search.json"))
+
+(defn retrieve [payload callback]
+  (.send (goog.net.Jsonp. twitter-uri)
+         payload
+         callback))
+
+(defn my-callback [json]
+  (log json))
+
+(retrieve (.strobj {"q" "clojure"}) my-callback)


Log any exceptions thrown while running Clojure tests. This was previously omitted because it double logged test failure stats. Correct that to not throw an exception to indicate test failure so that we can log any exception.

--- src/main/resources/clojuresque/tasks/test.clj
+++ src/main/resources/clojuresque/tasks/test.clj
@@ -6,10 +6,9 @@
 (refer 'clojuresque.util :only '[deftask namespaces])

 (defn check-result
-  [result]
-  (let [{:keys [fail error]} result]
-    (if (not (zero? (reduce + [fail error])))
-        (throw (Exception. (clojure.string/join " " ["There are" fail "test failures and" error "errors."]))))))
+  [{:keys [fail error], :as _result}]
+  (and (= 0 fail)
+       (= 0 error)))

 (defn test-namespaces
   [{:keys [source-files]}]
@@ -44,12 +43,16 @@
   [{:keys [junit tests] :as options}]
   (let [exit-code (atom 0)]
     (try
-      (cond
-        junit (test-junit/test-namespaces options)
-        (seq tests) (test-vars options)
-        :else (test-namespaces options))
-      (catch Throwable _t
-        (reset! exit-code -1))
+      (let [success? (cond
+                       junit (test-junit/test-namespaces options)
+                       (seq tests) (test-vars options)
+                       :else (test-namespaces options))]
+        (when-not success?
+          (reset! exit-code -1))
+        success?)
+      (catch Throwable t
+        (println "Exception thrown while running tests: " t)
+        (reset! exit-code -2))
       ;; Some stray non-daemon threads may cause the JVM to hang on exit.
       ;; Call this after all tests have run to allow proper shutdown.
       (finally


Change the name of the parameter for the body of the request and make it configurable

--- src/io/aviso/rook/swagger.clj
+++ src/io/aviso/rook/swagger.clj
@@ -191,7 +191,6 @@
     (let [[so' new-schema] (map->swagger-schema swagger-options swagger-object schema)]
       [so' new-schema])

-    ;; Avoid forward slash in the swagger name, as that's problematic.
     ;; Avoid forward slash in the swagger name, as that's problematic, especially for
     ;; the swagger-ui (which must be taking a few liberties or shortcuts).
     [swagger-name (str schema-ns \: schema-name)
@@ -217,7 +216,7 @@
       ;; Assumption: it's a map and named
       (let [[swagger-object' schema-reference] (->swagger-schema swagger-options swagger-object schema)]
         (update-in swagger-object' paths-key
-                   conj {:name     :request-body
+                   conj {:name     (:body-name swagger-options)
                          :in       :body
                          :required true
                          :schema   schema-reference}))
@@ -334,6 +333,8 @@

 (def default-swagger-options
   {:template                  default-swagger-template
+   ;; Name of special parameter used for the body of the request
+   :body-name                 :body
    :route-injector            default-route-injector
    :configurer                default-configurer
    :data-type-mappings        default-data-type-mappings


Display set number for each item in history

--- src/app/cljs/one/repmax/sets/view.cljs
+++ src/app/cljs/one/repmax/sets/view.cljs
@@ -23,14 +23,17 @@
     (add-event-listener-for-persisting-set)))

 (defmethod render :new-set/persisted [{:keys [message]}]
-  (let [set-list (css/sel "#recent-set-history ol")
-        new-list-item (set-list-item (:set message))]
+  (let [exercise-set (:set message)
+        set-list (css/sel "#recent-set-history ol")
+        set-number (-> set-list (css/sel "li") d/nodes count inc)
+        new-list-item (set-list-item (assoc exercise-set :number set-number))]
     (d/append! set-list new-list-item)))

 (defn- set-list-item [exercise-set]
   (let [li (d/clone (:recent-set-history-list-item snippets))]
     (-> li (css/sel ".value.weight") (d/set-text! (:weight exercise-set)))
     (-> li (css/sel ".value.reps") (d/set-text! (:reps exercise-set)))
+    (-> li (css/sel ".set-number .value") (d/set-text! (:number exercise-set)))
     li))

 (defn- add-event-listener-for-persisting-set []


fix subtitle in list items

fix subtitle in list items

arguments were missing in reagent-render args so component wasn't
reacting to changes

Signed-off-by: yenda <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>

--- src/status_im/ui/components/list_item/views.cljs
+++ src/status_im/ui/components/list_item/views.cljs
@@ -134,12 +134,12 @@
    (when title-row-accessory
      [react/view styles/title-row-accessory-container title-row-accessory])])

-(defn subtitle-row [{:keys [subtitle subtitle-max-lines subtitle-row-accessory]}
-                    icon? theme]
+(defn subtitle-row
+  [subtitle-row-elements icon? theme]
   (let [subtitle-row-accessory-width (reagent/atom 0)]
     (reagent/create-class
-     {:render
-      (fn []
+     {:reagent-render
+      (fn [{:keys [subtitle subtitle-max-lines subtitle-row-accessory]} icon? theme]
         [react/view styles/subtitle-row-container
          (cond
            (or (string? subtitle) (keyword? subtitle) (number? subtitle))


Blurry lines.

Blurry lines.

--- src/kolmogorov_music/song.clj
+++ src/kolmogorov_music/song.clj
@@ -13,11 +13,12 @@
 (definst sing [freq 110 dur 1.0 vol 1.0]
   (-> (sin-osc freq)
       (+ (sin-osc (* 3.01 freq)))
-      (+ (* 1/4 (sin-osc (* 2.05 freq))))
-      (+ (* 1/3 (sin-osc (* 1/2 freq))))
-      (rlpf (line:kr 5000 0 1.0) 1/50)
-      (clip2 0.5)
-      (* (env-gen (adsr 0.05 (* dur 1/3) 0.3 0) (line:kr 1 0 dur) :action FREE))
+      (+ (* 1/3 (sin-osc (* 2.01 freq))))
+      (+ (* 1/8 (sin-osc (* 5.01 freq))))
+      (+ (* 1/2 (sin-osc (* 1/2 freq))))
+      (rlpf (line:kr 3000 0 1) 1/5)
+      (clip2 0.7)
+      (* (env-gen (adsr 0.001 0.03 0.9 0.2) (line:kr 1 0 dur) :action FREE))
       (* vol)))

 ; Arrangement
@@ -37,7 +38,7 @@
   (update-in v [i] (partial + n)))

 (defn digit-shift [x n]
-  (apply * x (repeat n (bigint 10))))
+  (apply * x (repeat n (biginteger 10))))

 (defn construct [a b c d]
   (if (zero? (* a b))
@@ -86,13 +87,32 @@
        (wherever :pitch, :pitch (comp scale/A scale/major scale/lower))
        code))

+(def blurred-lines
+  (let [riff (phrase (repeat 8 1/2) (concat [[nil nil]] (repeat 6 [2 4]) [[nil nil]]))
+        accompaniment (->> (times 4 riff)
+                           (then (times 3 (wherever :pitch, :pitch (scale/from -3) riff)))
+                           (then (phrase [4] [[nil nil]])))
+        bass
+        (->>
+          (phrase [1/2 6/2 1/2 1/2 6/2 1/2 1/2 6/2 1/2 1/2 6/2 1/2]
+                  (cycle [-14 nil -14]))
+          (then
+            (phrase [1/2 6/2 1/2 1/2 6/2 1/2 1/2 6/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2]
+                    [-17 nil -17 -17 nil -17 -17 nil -17 -10 -3 -11 -4 -12 -5 -13 -14])))
+        harmony (phrase [32] [14])
+        ]
+    (->>
+      (with bass accompaniment)
+      (wherever :pitch, :pitch (comp scale/A scale/major))
+      code)))
+
 (defn decode [channels notes]
   (decode* (vec (repeat channels 0)) notes))

 (defn track [start]
   (->>
     (champernowne/word 10 start)
-    (decode 4)
+    (decode 3)
     (wherever :pitch, :pitch temperament/equal)
     (where :time (bpm 120))
     (where :duration (bpm 120))))
@@ -107,4 +127,5 @@
   (fx-chorus)
   (fx-distortion)

+  (live/play (track blurred-lines))
   )


only show threads from the active group in the inbox

--- src/chat/client/views/pages/inbox.cljs
+++ src/chat/client/views/pages/inbox.cljs
@@ -14,10 +14,15 @@
           (concat
             [(new-thread-view {})]
             (map (fn [t] (om/build thread-view t {:key :id}))
-                 (let [user-id (get-in @store/app-state [:session :user-id])]
+                 (let [group-id (data :open-group-id)
+                       user-id (get-in @store/app-state [:session :user-id])]
                    ; sort by last message sent by logged-in user, most recent first
                    (->> (select-keys (data :threads) (get-in data [:user :open-thread-ids]))
                         vals
+                        (filter (fn [thread]
+                                  (contains? (set (->> (thread :tag-ids)
+                                                       (map  (fn [tag-id]
+                                                               (get-in @store/app-state [:tags tag-id :group-id]))))) group-id)))
                         (sort-by
                           (comp (partial apply max)
                                 (partial map :created-at)


fix whitespaces

fix whitespaces

--- src/lambdacd/control_flow.clj
+++ src/lambdacd/control_flow.clj
@@ -36,6 +36,6 @@

-  (defn ^{:display-type :container} in-cwd [cwd & steps]
+(defn ^{:display-type :container} in-cwd [cwd & steps]
   (fn [args ctx]
     (execution/execute-steps steps (assoc args :cwd cwd) (execution/new-base-context-for ctx))))


Remove some duplication around isl forces

- Inverse square law

--- src/cljs/cljs-physics-engine/core.cljs
+++ src/cljs/cljs-physics-engine/core.cljs
@@ -1,6 +1,8 @@
 (ns cljs-physics-engine.core)

 (defn- square [n] (* n n))
+
+(defn- neg [a] (* -1 a))

 (defn- map-values
   ([f d1 d2]
@@ -31,9 +33,9 @@
   (/ (* g m-1 m-2)
      (square r)))

-(defn- force-electrostatic [k-e m-1 m-2 r]
-  (/ (* k-e m-1 m-2)
-     (square r)))
+(defn- force-electrostatic [k-e q-1 q-2 r]
+  (neg (/ (* k-e q-1 q-2)
+          (square r))))

 (defn- v [u t a]
   (+ u (* a t)))
@@ -50,19 +52,18 @@
 (defn- calc-gravity-from-env [env p]
   {:x 0 :y (* -1 (force-gravity (:G env) (:M env) (:m p) (+ (:y p) (:r env)))) :z 0})

-(defn- gravitational-f-between-particles [g p-a p-b]
-  (let [r (vector-difference (select-keys p-b [:x :y :z]) (select-keys p-a [:x :y :z])) ;; Is this the right way around?
+(defn- deconstruct-force-into-components [force-fn p-a p-b]
+  (let [r (vector-difference (select-keys p-b [:x :y :z]) (select-keys p-a [:x :y :z]))
         mag-r (vector-magnitude r)
         unit-vector-r (unit-vector r)
-        f-gravity (force-gravity g (:m p-a) (:m p-b) mag-r)]
-    (map-vector #(* % f-gravity) unit-vector-r)))
+        force (force-fn mag-r)]
+    (map-vector #(* % force) unit-vector-r)))
+
+(defn- gravitational-f-between-particles [g p-a p-b]
+  (deconstruct-force-into-components (partial force-gravity g (:m p-a) (:m p-b)) p-a p-b))

 (defn- electrostatic-f-between-particles [k-e p-a p-b]
-  (let [r (vector-difference (select-keys p-a [:x :y :z]) (select-keys p-b [:x :y :z]))
-        mag-r (vector-magnitude r)
-        unit-vector-r (unit-vector r)
-        f-electrostatic (force-electrostatic k-e (:q p-a) (:q p-b) mag-r)]
-    (map-vector #(* % f-electrostatic) unit-vector-r)))
+  (deconstruct-force-into-components (partial force-electrostatic k-e (:q p-a) (:q p-b)) p-a p-b))

 ;; Optimisation of 2x if we don't calculate the same force twice for each particle
 (defn- calc-inter-particle-gravity [env p other-ps]


fix select all

fix select all

--- src/cljs/salava/badge/ui/exporter.cljs
+++ src/cljs/salava/badge/ui/exporter.cljs
@@ -17,9 +17,7 @@
     (conj (mapv #(hash-map :value % :title %) emails)  {:value "all" :title (t :badge/All)})))

 (defn badges-for-grid [state]
-  (let [badges (if (= "all" (:email-selected @state))(:badges @state) (filter #(= (:email-selected @state) (:email %)) (:badges @state)))]
-    (swap! state assoc :current-view-badges badges)
-    badges))
+  (if (= "all" (:email-selected @state))(:badges @state) (filter #(= (:email-selected @state) (:email %)) (:badges @state))))

 (defn visibility-options []
   [{:value "all" :title (t :badge/All)}
@@ -46,7 +44,7 @@
    [g/grid-select        (t :badge/Email ":") "select-email" :email-selected (email-options state) state hard-reset]
    [g/grid-search-field  (t :badge/Search ":") "badgesearch" (t :badge/Searchbyname) :search state soft-reset]
    [g/grid-select        (t :badge/Show ":") "select-visibility" :visibility (visibility-options) state soft-reset]
-   [g/grid-buttons       (t :badge/Tags ":") (unique-values :tags (:current-view-badges @state)) :tags-selected :tags-all state soft-reset]
+   [g/grid-buttons       (t :badge/Tags ":") (unique-values :tags (badges-for-grid state)) :tags-selected :tags-all state soft-reset]
    [g/grid-radio-buttons (t :badge/Order ":") "order" (order-radio-values) :order state]])

 (defn badge-visible? [element state]
@@ -108,12 +106,13 @@

 (defn badge-grid [state]
   (let [badges (badges-for-grid state)
-        order (:order @state)]
+        order (:order @state)
+        current (map #(badge-visible? % state) badges)]
     [:div {:class "row wrap-grid"
            :id "grid"}
-     (doall(for [element-data (sort-by (keyword order) badges)]
-             (if (badge-visible? element-data state)
-               (grid-element element-data state))))]))
+     (doall (for [element-data (sort-by (keyword order) badges)]
+              (if (badge-visible? element-data state)
+                (grid-element element-data state))))]))

 (defn export-to-pdf [state]
   (let [badges-to-export (:badges-selected @state)
@@ -174,13 +173,25 @@
 (defn select-all [state]
   (if (:badges-all @state)
     (swap! state assoc :badges-selected [] :badges-all false)
-    (swap! state assoc :badges-selected (map :id (:current-view-badges @state) #_(:badges @state)) :badges-all true)))
-
-(defn select-all-button [state]
-  (fn []
+    (swap! state assoc :badges-selected (map :id (filter #(badge-visible? % state)(badges-for-grid state))) :badges-all true)))
+
+(defn badge-export-buttons [state]
+  [:div
+   [:button {:class    "btn btn-primary"
+             :on-click #(select-all state)}
+    (if (:badges-all @state) (t :badge/Clearall) (t :badge/Selectall))]
+   (if (not (nil? (:backpack_id (first (filter #(= (:email %) (:email-selected @state)) (:emails @state))))))
      [:button {:class    "btn btn-primary"
-               :on-click #(select-all state)}
-      (if (:badges-all @state) (t :badge/Clearall) (t :badge/Selectall))]))
+               :on-click #(export-badges state)
+               :disabled (= 0 (count (:badges-selected @state)))}
+      (t :badge/Exportselected)])
+   [:button {:class "btn btn-primary"
+             :on-click #(do (.preventDefault %)
+                          (swap! state assoc :pdf-option "default")
+                          (m/modal![export-to-pdf-modal state] {:size :lg}))
+             :disabled (= 0 (count (:badges-selected @state)))}
+    (t :badge/Exporttopdf)]])
+

 (defn content [state]
   [:div {:id "export-badges"}
@@ -200,18 +211,7 @@
              (empty? (:badges @state)) (t :badge/Nobadgestoexport))]
           [:div
            [badge-grid-form state]
-           [select-all-button state]
-           (if (not (nil? (:backpack_id (first (filter #(= (:email %) (:email-selected @state)) (:emails @state))))))
-             [:button {:class    "btn btn-primary"
-                       :on-click #(export-badges state)
-                       :disabled (= 0 (count (:badges-selected @state)))}
-              (t :badge/Exportselected)])
-           [:button {:class "btn btn-primary"
-                     :on-click #(do (.preventDefault %)
-                                     (swap! state assoc :pdf-option "default")
-                                         (m/modal![export-to-pdf-modal state] {:size :lg}))
-                     :disabled (= 0 (count (:badges-selected @state)))}
-            (t :badge/Exporttopdf)]
+           [badge-export-buttons state]
            [badge-grid state]])]))])

 (defn init-data [state]
@@ -233,7 +233,6 @@
                      :tags-selected []
                      :badges-all false
                      :badges-selected []
-                     :current-view-badges []
                      :pdf-option "default"
                      :user-id (:id (session/get :user))
                      :initializing true})]


Adding handling for dirty-wc? check and override.

Also changed 'kargs to 'kargset.

--- src/leiningen/git_version.clj
+++ src/leiningen/git_version.clj
@@ -37,6 +37,12 @@
     (when (and ctime sha)
       {:ctime ctime :sha sha})))

+(defn dirty-wc?
+  [path]
+  ;; TODO Is it right to ignore untracked files?
+  (let [{:keys [out err exit]} (sh "git" "status" "--short" "--untracked-files=no" path)]
+    (not (empty? out))))
+
 (defn git-version
   "Usage:
     lein git-version [flags] [lein command ...]
@@ -53,18 +59,19 @@
     lein git-version :parse <version-str>"
   [project & args]
   (let [[kstrs sargs] (split-with #(.startsWith % ":") args)
-        kargs (map #(keyword (.substring % 1)) kstrs)
-        long-sha (some #{:long-sha} kargs)
+        kargset (set (map #(keyword (.substring % 1)) kstrs))
+        long-sha (kargset :long-sha)
         gver (-> project :root (get-git-version long-sha))
         qual (format-git-ver gver timestamp-fmt)
         upfn #(str (s/replace % #"-SNAPSHOT" "") qual)
         nproj (update-in project [:version] upfn)
         nmeta (update-in (meta project) [:without-profiles :version] upfn)
         nnproj (with-meta nproj nmeta)]
-    ;; TODO throw exception if dirty
-    ;; TODO throw exception if upstream doesn't contain this commit
-    ;; args :insanely-allow-dirty-working-copy :no-upstream :print :long-sha
+    ;; TODO throw exception if upstream doesn't contain this commit :no-upstream
     (cond
-     (some #{:print} kargs) (println (upfn (:version project)))
-     (some #{:parse} kargs) (prn (ver-parse (first sargs)))
-     :else (lmain/resolve-and-apply nnproj sargs))))
+     (:print kargset) (println (upfn (:version project)))
+     (:parse kargset) (prn (ver-parse (first sargs)))
+     :else (if (and (dirty-wc? (:root project))
+                    (not (:insanely-allow-dirty-working-copy kargset)))
+             (lmain/abort "Refusing to continue with dirty working copy. (Hint: Run 'git status')")
+             (lmain/resolve-and-apply nnproj sargs)))))


Two tests added into the module process-info-test

--- test/emender_jenkins/process_info_test.clj
+++ test/emender_jenkins/process_info_test.clj
@@ -39,3 +39,26 @@
     (testing "if the emender-jenkins.process-info/read-properties definition exists."
         (is (callable? 'emender-jenkins.process-info/read-properties))))

+(deftest test-get-current-pid
+    "Check the behaviour of function emender-jenkins.process-info/get-current-pid."
+    (testing "the behaviour of function emender-jenkins.process-info/get-current-pid."
+        (let [pid (get-current-pid)]
+            (is (not (nil? pid)))
+            (is (re-matches #"[0-9]+" pid)))))
+
+(deftest test-read-properties
+    "Check the behaviour of function emender-jenkins.process-info/read-properties."
+    (testing "the behaviour of function emender-jenkins.process-info/read-properties."
+        (let [props (read-properties)]
+            (are [x] (not (nil? x))
+                (:java-version    props)
+                (:java-class-path props)
+                (:java-home       props)
+                (:java-vendor     props)
+                (:os-arch         props)
+                (:os-name         props)
+                (:os-version      props)
+                (:user-dir        props)
+                (:user-home       props)
+                (:user-name       props)))))
+


Cosmetic improvements on sitemap sidebar ns.

--- src/uxbox/main/ui/workspace/sidebar/sitemap.cljs
+++ src/uxbox/main/ui/workspace/sidebar/sitemap.cljs
@@ -30,12 +30,12 @@

 ;; --- Lenses

-(def ^:const pages-l
+(def pages-l
   (letfn [(getter [state]
             (let [project (get-in state [:workspace :project])]
               (stpr/project-pages state project)))]
-    (as-> (l/lens getter) $
-      (l/derive $ st/state))))
+    (-> (l/lens getter)
+        (l/derive st/state))))

 ;; --- Component


Start converting handshake-test to new logging WIP

The basic idea looks more or less correct. The ns compiles. I haven't
actually run the tests yet to see whether it's good.

--- test/frereth_cp/message/handshake_test.clj
+++ test/frereth_cp/message/handshake_test.clj
@@ -41,7 +41,11 @@
 (defn consumer
   [{:keys [::specs/message-loop-name]
     :as io-handle}
-   prelog time-out succeeded? bs]
+   log-atom
+   log-ctx
+   time-out
+   succeeded?
+   bs]
   ;; Note that, at this point, we're blocking the
   ;; I/O loop.
   ;; Whatever happens here must return control
@@ -54,9 +58,10 @@
   ;; Then again, you *could* do something like
   ;; this, to experiment with the unencrypted
   ;; networking protocol.
-  (log/info prelog "Message over network")
-
-  (let [consumption (dfrd/future
+  (swap! log-atom log/info log-ctx "Message over network")
+
+  (let [prelog (utils/pre-log message-loop-name)
+        consumption (dfrd/future
                       ;; Checking for the server state is wasteful here.
                       ;; And very dubious...depending on implementation details,
                       ;; it wouldn't take much to shift this over to triggering
@@ -67,11 +72,13 @@
                       ;; Q: But is it worth it for the test's sake?
                       ;; Better Q: Is this the sort of thing that will trip
                       ;; us up with surprising behavior if it doesn't work?
-                      (let [state (message/get-state io-handle time-out ::timed-out)
-                            prelog' (utils/pre-log message-loop-name)]
-                        (log/debug prelog'
-                                   "get-state returned:" state
-                                   "\nScheduled from:\n" prelog)
+                      (let [state (message/get-state io-handle time-out ::timed-out)]
+                        (swap! log-atom
+                               log/debug
+                               log-ctx
+                               "Got state"
+                               {::state state
+                                ::parent-context prelog})
                         (if (or (= ::timed-out state)
                                 (instance? Throwable state)
                                 (nil? state))
@@ -80,51 +87,70 @@
                                           (ex-info "Non-exception"
                                                    {::problem state}))]
                             (is (not problem))
-                            (log/error problem prelog' "Failed!\nTriggered from\n" prelog)
-                            (if (instance? ExceptionInfo problem)
-                              (log/warn prelog' (str (.getData problem) "\nfrom:\n" prelog))
-                              (log/warn (str prelog' " is difficult to debug from\n" prelog)))
+                            (swap! log-atom
+                                   log/exception
+                                   problem
+                                   log-ctx
+                                   "Failed!"
+                                   {::triggered-from prelog})
                             (if (realized? succeeded?)
-                              (log/warn prelog' "Caller already thinks we succeeded from\n" prelog)
+                              (swap! log-atom
+                                     log/warn
+                                     log-ctx
+                                     "Caller already thinks we succeeded"
+                                     {::triggered-by prelog})
                               (dfrd/error! succeeded? problem)))
                           (message/parent->! io-handle bs))))]
     (dfrd/on-realized consumption
                       (fn [success]
-                        (let [prelog' (utils/pre-log message-loop-name)]
-                          (log/debug (str prelog'
-                                          "Message successfully consumed: "
-                                          success
-                                          "  from\n"
-                                          prelog))))
+                        (swap! log-atom
+                               log-ctx
+                               "Message successfully consumed"
+                               {::outcome success
+                                ::triggered-from prelog}))
                       (fn [failure]
-                        (let [prelog' (utils/pre-log message-loop-name)]
-                          (log/debug (str prelog'
-                                          "Failed to consume message: "
-                                          failure
-                                          "  from\n"
-                                          prelog)))))))
+                        (swap! log-atom
+                               log-ctx
+                               "Failed to consume message"
+                               {::problem failure
+                                ::triggered-from prelog})))))

 (defn srvr->client-consumer
   "This processes bytes that are headed from the server to the client"
-  [client-io time-out succeeded? bs]
-  (let [prelog (utils/pre-log "server->client consumer")]
-    (consumer client-io prelog time-out succeeded? bs)))
+  [client-io log-atom time-out succeeded? bs]
+  (consumer client-io
+            log-atom
+            ::srvr->client-consumer
+            time-out
+            succeeded?
+            bs))

 (defn client->srvr-consumer
-  [server-io time-out succeeded? bs]
+  [server-io log-atom time-out succeeded? bs]
   (let [prelog (utils/pre-log "client->server consumer")]
-    (consumer server-io prelog time-out succeeded? bs)))
+    (consumer server-io
+              log-atom
+              ::client->srvr-consumer
+              time-out
+              succeeded?
+              bs)))

 (defn buffer-response!
   "Serialize and send a message from the child"
   [io-handle
-   prelog
+   message-loop-name
+   log-atom
    message
    success-message
    error-message
    error-details]
-  (let [frames (io/encode protocol message)]
-    (log/debug prelog "Ready to send" (count frames) "message frames")
+  (let [frames (io/encode protocol message)
+        prelog (utils/pre-log message-loop-name)]
+    (swap! log-atom
+           log/debug
+           ::buffer-response!
+           "Ready to send message frames"
+           {::frame-count (count frames)})
     (doseq [frame frames]
       (let [array (if (.hasArray frame)
                     (.array frame)
@@ -138,7 +164,11 @@
           (throw (ex-info "Sending failed"
                           {::failed-on frame
                            ::context prelog}))
-          (log/debug prelog (str (count array) "-byte frame sent")))))))
+          (swap! log-atom
+                 log/debug
+                 ::buffer-response!
+                 "frame sent"
+                 {::frame-size (count array)}))))))
 (comment
   ;; Inline test for test-helper.
   ;; This seems like a bad sign.
@@ -159,25 +189,30 @@
   (io/decode-stream src protocol))

 (defn decode-bytes->child
-  [decode-src decode-sink bs]
-  (comment) (log/debug (str "Trying to decode "
-                            (if-not (keyword? bs)
-                              (count bs)
-                              "")
-                            " bytes in ") bs)
+  [decode-src decode-sink log-atom bs]
+  (comment) (swap! log-atom
+                   log/debug
+                   ::decode-bytes->child
+                   "Trying to decode"
+                   (if-not (keyword? bs)
+                     {::message-size (count bs)}
+                     {::eof-flag bs}) bs)
   (if-not (keyword? bs)
     (do
       (when (= 2 (count bs))
-        (log/debug (str "This is probably a prefix expecting "
-                        (b-t/uint16-unpack bs)
-                        " bytes")))
+        (swap! log-atom
+               log/debug
+               ::decode-bytes->child
+               (str "This is probably a prefix expecting "
+                    (b-t/uint16-unpack bs)
+                    " bytes")))
       (let [decoded (strm/try-take! decode-sink ::drained 10 false)]
         (strm/put! decode-src bs)
         (deref decoded 10 false)))
     bs))

 (defn server-child-processor
-  [server-atom state-atom chzbrgr-length incoming]
+  [server-atom state-atom log-atom chzbrgr-length incoming]
   (is incoming)
   (is (or (keyword? incoming)
           (and (bytes? incoming)
@@ -201,7 +236,8 @@
       (if (not= rsp ::specs/normal)
         ;; Happy path
         (buffer-response! @server-atom
-                          prelog
+                          "server"
+                          log-atom
                           rsp
                           "Message buffered to child"
                           "Giving up on forwarding to child"
@@ -230,6 +266,7 @@
           ;; That's annoying, but it should be good enough for
           ;; purposes of this test.
           (buffer-response! @server-atom
+                            "client"
                             prelog
                             chzbrgr
                             "Buffered chzbrgr to child"
@@ -389,9 +426,11 @@
                                     (conj acc result)))
                                 []
                                 frames)
+          log-atom (log/init)
           decoded (map (partial decode-bytes->child
                                 decode-src
-                                decode-sink)
+                                decode-sink
+                                log-atom)
                        binary-frames)]
       (try
         (dorun decoded)
@@ -408,15 +447,16 @@
         ;; Or maybe a ByteBuf?
         (is (= msg (second decoded)))
         (finally
-          (strm/close! decode-src))))))
+          (strm/close! decode-src)
+          (let [logger (log/std-out-log-factory)]
+            (log/flush-logs! logger @log-atom)))))))
 (comment (check-decoder)
          )

 (deftest handshake
   (let [logger (log/std-out-log-factory)
-        log-state (atom (log/init))
-        prelog (utils/pre-log "Handshake test")]
-    (log/info log-state ::top-level "Top")
+        prelog (utils/pre-log "Handshake test")
+        log-atom (atom (log/info (log/init) ::top-level "Top"))]
     (let [client->server (strm/stream)
           server->client (strm/stream)
           succeeded? (dfrd/deferred)
@@ -426,26 +466,22 @@
           client-atom (atom nil)
           time-out 500
           client-parent-cb (fn [^bytes bs]
-                             (let [log-state
-                                   (log/info log-state
-                                             ::client-parent-callback
-                                             (str
-                                              "Sending a" (count bs)
-                                              "byte array to client's parent"))]
-                               (reset! log-state log-state)
-                               ;; TODO: Need lamport interactions everywhere the
-                               ;; the streams cross.
-                               ;; Calling out here is one place.
-                               ;; But, honestly, so is the parameters into this callback.
-                               ;; At the very least, I should pass in the caller's
-                               ;; lamport clock so I could adjust an atom that
-                               ;; tracks this test's clock.
-                               ;; Alternatively, pass in the entire log-state.
-                               ;; It's tempting to forward that along when we
-                               ;; forward the message from client->server, but
-                               ;; the current protocol does not allow that.
-                               (let [sent (strm/try-put! client->server bs time-out ::timed-out)]
-                                 (is (not= @sent ::timed-out)))))
+                             (swap! log-atom
+                                    log/info
+                                    ::client-parent-callback
+                                    (str "Sending a" (count bs)
+                                         "byte array to client's parent"))
+                             ;; With the current implementation, there is no good way
+                             ;; to coordinate our lamport clock with the ioloop's.
+                             ;; Well, we get the ioloop's when we call get-state.
+                             ;; And that clock will pretty much always be ahead
+                             ;; of ours.
+                             ;; But there's no good way [currently] to go the other
+                             ;; direction, if we want to keep everything synchronized.
+                             ;; After all, get-state will actually return a clock tick
+                             ;; that's quite a bit behind the caller's.
+                             (let [sent (strm/try-put! client->server bs time-out ::timed-out)]
+                               (is (not= @sent ::timed-out))))
           ;; Something that spans multiple packets would be better, but
           ;; that seems like a variation on this test.
           ;; Although this *does* take me back to the beginning, where
@@ -480,17 +516,26 @@
           ;; These are really hooks for sending the bytes to the encryption
           ;; layer.
           server-parent-cb (fn [bs]
-                             (log/info (utils/pre-log "Server's parent callback")
-                                       "Sending a" (class bs) "to server's parent")
+                             (swap! log-atom
+                                    log/info
+                                    ::server-parent-cb
+                                    "Sending a" (class bs) "to server's parent")
                              (let [sent (strm/try-put! server->client bs time-out ::timed-out)]
                                (is (not= @sent ::timed-out))))
           server-child-cb (partial mock-server-child
                                    srvr-decode-src)]
       (dfrd/on-realized succeeded?
                         (fn [good]
-                          (log/info "----------> Test should have passed <-----------"))
+                          (swap! log-atom
+                                 log/info
+                                 ::child-succeeded
+                                 "----------> Test should have passed <-----------"))
                         (fn [bad]
-                          (log/error bad "High-level test failure")
+                          (swap! log-atom
+                                 log/error
+                                 ::child-failed
+                                 "High-level test failure"
+                                 {::problem bad})
                           (is (not bad))))

       ;; If we use consume-async (which seems preferable), we risk
@@ -508,40 +553,51 @@
       (strm/consume (partial server-child-processor
                              server-atom
                              server-state-atom
+                             log-atom
                              chzbrgr-length)
                     srvr-decode-sink)

-      (let [client-init (message/initial-state "Client" {} false)
-            client-io (message/start! client-init client-parent-cb client-child-cb)
-            server-init (message/initial-state "Server" {} logger true)
+      (let [client-init (message/initial-state "Client" false {} logger)
+            client-io (message/start! client-init logger client-parent-cb client-child-cb)
+            server-init (message/initial-state "Server" true {} logger)
             ;; It seems like this next part really shouldn't happen until the initial message arrives
             ;; from the client.
             ;; Actually, it starts when the Initiate(?) packet arrives as part of the handshake. So
             ;; that isn't quite true
-            server-io (message/start! server-init server-parent-cb server-child-cb)]
+            server-io (message/start! server-init logger server-parent-cb server-child-cb)]
         (reset! client-atom client-io)
         (reset! server-atom server-io)

         (try
-          (strm/consume (partial client->srvr-consumer server-io time-out succeeded?)
+          (strm/consume (partial client->srvr-consumer
+                                 server-io
+                                 log-atom
+                                 time-out
+                                 succeeded?)
                         client->server)
-          (strm/consume (partial srvr->client-consumer client-io time-out succeeded?)
+          (strm/consume (partial srvr->client-consumer
+                                 client-io
+                                 log-atom
+                                 time-out
+                                 succeeded?)
                         server->client)

           (let [initial-message (Unpooled/buffer K/k-1)]
             ;; Kick off the exchange
             (buffer-response! client-io
-                              prelog
+                              log-atom
                               ::ohai!
                               "Sequence Initiated"
                               "Handshake initiation failed"
                               {})
             ;; TODO: Find a reasonable value for this timeout
             (let [really-succeeded? (deref succeeded? 10000 ::timed-out)]
-              (log/info prelog
-                        "=====================================================\n"
-                        "handshake-test run through. Need to see what happened\n"
-                        "=====================================================")
+              (swap! log-atom
+                     log/info
+                     ::handshake-status-check
+                     (str "=====================================================\n"
+                          "handshake-test run through. Need to see what happened\n"
+                          "====================================================="))
               (let [client-message-state (message/get-state client-io time-out ::timed-out)]
                 ;; This seems inside-out.
                 ;; TODO: Check really-succeeded? first.
@@ -573,23 +629,37 @@
                           (instance? Throwable srvr-state)
                           (nil? srvr-state))
                   (is (not srvr-state)))
+                ;; Keep this around as a reminder to look carefully at it in
+                ;; case of wonkiness
                 (comment (is (not flow-control) "Server flow-control")))
               (is (= ::kthxbai really-succeeded?))
               (is (= 6 (-> client-state
                            deref
                            ::count)))))
           (finally
-            (log/info "Cleaning up")
+            (swap! log-atom
+                   log/info
+                   ::handshake-status-check
+                   "Cleaning up")
             (strm/close! clnt-decode-src)
             (strm/close! srvr-decode-src)
             (try
               (message/halt! client-io)
               (catch Exception ex
-                (log/error ex "Trying to halt client")))
+                (swap! log-atom
+                       log/exception
+                       ex
+                       ::handshake-status-check
+                       "Trying to halt client")))
             (try
               (message/halt! server-io)
               (catch Exception ex
-                (log/error ex "Trying to halt server")))))))))
+                (swap! log-atom
+                       log/exception
+                       ex
+                       ::handshake-status-check
+                       "Trying to halt server")))
+            (log/flush-logs! logger @log-atom)))))))
 (comment
   (handshake)
   (count (str ::kk))


Use :simple optimization level for tests.

--- scripts/watch-tests.clj
+++ scripts/watch-tests.clj
@@ -5,7 +5,7 @@
    :output-to "out/tests.js"
    :output-dir "out"
    :parallel-build false
-   :optimizations :none
+   :optimizations :simple
    :pretty-print true
    :target :nodejs
    :language-in  :ecmascript5


fix bug in process-use-autofocus that caused an exception for a single-event sequence

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

--- acqEngine/src/org/micromanager/sequence_generator.clj
+++ acqEngine/src/org/micromanager/sequence_generator.clj
@@ -100,9 +100,10 @@
   (for [[e1 e2] (pairs-back events)]
     (assoc e2 :autofocus
       (and use-autofocus
-        (and (zero? (mod (e2 :frame) (inc autofocus-skip)))
-             (or (not= (:position e1) (:position e2))
-                 (not= (:frame e1) (:frame e2))))))))
+        (or (not e1)
+          (and (zero? (mod (e2 :frame) (inc autofocus-skip)))
+               (or (not= (:position e1) (:position e2))
+                   (not= (:frame e1) (:frame e2)))))))))

 (defn process-wait-time [events interval-ms]
   (cons


add a TODO

add a TODO

--- test/com/billpiel/mem_tracer/core_test.clj
+++ test/com/billpiel/mem_tracer/core_test.clj
@@ -20,5 +20,5 @@
  - and deep search values for funcs?
 - string output like tools.trace
  - requires sequential log?
-
+- diff entries
 ")


fixed bug

fixed bug

--- main/src/dda/pallet/dda_managed_vm/domain.clj
+++ main/src/dda/pallet/dda_managed_vm/domain.clj
@@ -52,7 +52,7 @@
     DdaVmUser
     DdaVmBookmarks
     DdaVmTargetType
-     :usage-type (s/enum :desktop-minimal :desktop-base :desktop-office)))
+    {:usage-type (s/enum :desktop-minimal :desktop-base :desktop-office)}))

 (def DdaVmDomainResolvedConfig
   "The convention configuration for managed vms crate."


re-indent

re-indent

--- src/main/cljs/dmohs/react.clj
+++ src/main/cljs/dmohs/react.clj
@@ -1,7 +1,7 @@
 (ns dmohs.react
   (:require
-   cljs.analyzer
-   [dmohs.react.common :as common]))
+    cljs.analyzer
+    [dmohs.react.common :as common]))

 (defmacro defc [name doc-string-or-fn-map & [fn-map]]


Curry split.

Curry split.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -25,23 +25,17 @@
 (defmethod live/play-note :clap2 [_]
   ((sample "samples/select-click.wav")))

-(defn split [n fraction notes]
-  (let [note (nth notes n)
-        first-note (-> note (update-in [:duration] * fraction))
-        second-note (-> note
-                        (update-in [:duration] * (- 1 fraction))
-                        (update-in [:time] + (:duration first-note)))]
-    (concat
-      (take n notes)
-      [first-note second-note]
-      (drop (inc n) notes))))
-
-(comment
-  (->>
-    (rhythm [1/2 1/2 1/3 1/3])
-    (split 1 1/2)
-    )
-  )
+(defn split [n fraction]
+  (fn [notes]
+    (let [note (nth notes n)
+          first-note (-> note (update-in [:duration] * fraction))
+          second-note (-> note
+                          (update-in [:duration] * (- 1 fraction))
+                          (update-in [:time] + (:duration first-note)))]
+      (concat
+        (take n notes)
+        [first-note second-note]
+        (drop (inc n) notes)))))

 (definst akadinda [freq 440 vol 0.5]
   (-> (sin-osc freq)
@@ -70,22 +64,22 @@
   (part
     (phrase [2 1/2 3/2] (repeat 0))
     [identity
-     #(->> % (split 0 1/8) (split 1 1/7))
-     #(->> % (split 0 1/8) (split 1 1/7) (split 2 1/6))
-     #(->> % (split 0 1/8))]))
+     (split 0 1/8)
+     (comp (split 1 1/7) (split 0 1/8))
+     (comp (split 2 1/6) (split 1 1/7) (split 0 1/8))]))

 (def ta
   (part
     (phrase [1 5/4 3/4 1] (cons nil (repeat 1)))
     [identity
-     #(->> % (split 2 1/3))
-     #(->> % (split 3 1/2))]))
+     (split 2 1/3)
+     (split 3 1/2)]))

 (def ha
   (part
     (phrase [1/2 3 1/2] (cons nil (repeat 2)))
     [identity
-     #(->> % (split 0 1/4) (split 2 1/6) (split 4 1/2))]))
+     (comp (split 4 1/2) (split 2 1/6) (split 0 1/4))]))

 (def balendorc
   (let [a (phrase [2 1/2 3/2] (repeat 0))


Fix pagination

Fix pagination

--- src/clojure/clojurewerkz/cassaforte/query.clj
+++ src/clojure/clojurewerkz/cassaforte/query.clj
@@ -106,7 +106,7 @@
   ([& {:keys [key last-key per-page where] :or {:page 0}}]
      {:limit per-page
       :where (if last-key
-               (assoc where key [> last-key])
+               (conj (vec where) [> key last-key])
                where)}))


reordering

reordering

--- src/frontend/cljs/alibi/entry_page_state.cljs
+++ src/frontend/cljs/alibi/entry_page_state.cljs
@@ -36,9 +36,6 @@
 ;(log "initial state %o" initial-state)

-(defonce state (atom (merge {:activity-graphic-data []
-                             :activity-graphic-mouse-over-entry {}} initial-state)))
-
 (defn input-entry->data-entry
   [entry]
   (when entry
@@ -74,6 +71,9 @@
       (assoc :selected-date (get-in entry-screen-form [:selected-date :date])
              :selected-item (get-in entry-screen-form [:selected-task]))))

+(defonce state (atom (merge {:activity-graphic-data []
+                             :activity-graphic-mouse-over-entry {}} initial-state)))
+
 (defn selected-date []
   (om/ref-cursor (get-in (om/root-cursor state) [:form :selected-date])))
 (defn selected-task []


Clojure beer-song test shouldn't expect a trailing blank line

The README doesn't specify a blank line at the end of the output, but the test
suite wants the multiple-verse output to end in "\n\n". The README's version
of the requirements seems more sensible.

--- assignments/clojure/beer-song/beer_song_test.clj
+++ assignments/clojure/beer-song/beer_song_test.clj
@@ -6,8 +6,8 @@
 (def verse-1 "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n")
 (def verse-0 "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n")

-(def song-8-6 "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n")
-(def song-3-0 "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n")
+(def song-8-6 "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n")
+(def song-3-0 "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n")

 (deftest test-verse
   (is (= verse-8 (beer/verse 8)))


Use metric-name from metrics.core

Use metric-name from metrics.core

--- metrics-clojure-core/src/metrics/counters.clj
+++ metrics-clojure-core/src/metrics/counters.clj
@@ -1,6 +1,6 @@
 (ns metrics.counters
-  (:require [metrics.core  :refer [default-registry]]
-            [metrics.utils :refer [metric-name desugared-title]])
+  (:require [metrics.core  :refer [default-registry metric-name]]
+            [metrics.utils :refer [desugared-title]])
   (:import [com.codahale.metrics MetricRegistry Counter]
            java.util.concurrent.TimeUnit))


add 'caused by' info/stacktrace when printing exception

--- src/midje/util/exceptions.clj
+++ src/midje/util/exceptions.clj
@@ -35,6 +35,12 @@
   (cons (str throwable)
     (without-clojure-strings (stacktrace-as-strings throwable))))

+(defn- friendly-caused-by [ex prefix]
+  (when-let [cause (.getCause ex)]
+    (let [[data & stacktrace] (friendly-exception-lines cause prefix)]
+      (cons (str line-separator prefix "Caused by: " data)
+            stacktrace))))
+

 ;; When a fact throws an Exception or Error it gets wrapped
 ;; in this deftype
@@ -47,7 +53,9 @@
   ICapturedThrowable
   (throwable [this] ex)
   (friendly-stacktrace [this]
-    (join line-separator (friendly-exception-lines (throwable this) "              "))))
+      (join line-separator
+            (concat (friendly-exception-lines (throwable this) "              ")
+                    (friendly-caused-by (throwable this) "              ")))))

 (defn captured-throwable [ex]
   (CapturedThrowable. ex))


use edited entry data

use edited entry data

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -93,7 +93,7 @@
   [conn entry author]
   (if-let* [entry-uuid (:uuid entry)
            found-entry (entry-res/get-entry conn entry-uuid)]
-    found-entry
+    entry
     (entry-res/->entry conn entry-res/temp-uuid entry author)))

 (defn- valid-new-board? [conn org-slug {board-map :data author :user}]


adding a doc string, marking all functions except cli as private

--- src/main/clojure/clojure/tools/cli.clj
+++ src/main/clojure/clojure/tools/cli.clj
@@ -4,12 +4,12 @@
         [clojure.pprint :only (pprint cl-format)])
   (:refer-clojure :exclude [replace]))

-(defn build-doc [{:keys [switches docs default]}]
+(defn ^:private build-doc [{:keys [switches docs default]}]
   [(apply str (interpose ", " switches))
    (or (str default) "")
    (or docs "")])

-(defn banner-for [specs]
+(defn ^:private banner-for [specs]
   (println "Usage:")
   (println)
   (let [docs (into (map build-doc specs)
@@ -24,22 +24,22 @@
       (cl-format true "~{ ~vA  ~vA  ~vA ~}" v)
       (prn))))

-(defn name-for [k]
+(defn ^:private name-for [k]
   (replace k #"^--no-|^--\[no-\]|^--|^-" ""))

-(defn flag-for [^String v]
+(defn ^:private flag-for [^String v]
   (not (.startsWith v "--no-")))

-(defn opt? [^String x]
+(defn ^:private opt? [^String x]
   (.startsWith x "-"))

-(defn flag? [^String x]
+(defn ^:private flag? [^String x]
   (.startsWith x "--[no-]"))

-(defn end-of-args? [x]
+(defn ^:private end-of-args? [x]
   (= "--" x))

-(defn spec-for
+(defn ^:private spec-for
   [arg specs]
   (->> specs
        (filter (fn [s]
@@ -47,11 +47,11 @@
                      (contains? switches arg))))
        first))

-(defn default-values-for
+(defn ^:private default-values-for
   [specs]
   (into {} (for [s specs] [(s :name) (s :default)])))

-(defn apply-specs
+(defn ^:private apply-specs
   [specs args]
   (loop [options    (default-values-for specs)
          extra-args []
@@ -80,7 +80,7 @@
          :default
          (recur options (conj extra-args (first args)) (rest args)))))))

-(defn switches-for
+(defn ^:private switches-for
   [switches flag]
   (-> (for [^String s switches]
         (cond
@@ -89,7 +89,7 @@
          :default                        [s]))
       flatten))

-(defn generate-spec
+(defn ^:private generate-spec
   [raw-spec]
   (let [[switches raw-spec] (split-with #(and (string? %) (opt? %)) raw-spec)
         [docs raw-spec]     (split-with string? raw-spec)
@@ -106,6 +106,21 @@
            options)))

 (defn cli
+  "Parse the provided args using the given specs. Specs are vectors
+  describing a command line argument. For example:
+
+  [\"-p\" \"--port\" \"Port to listen on\" :default 3000 :parse-fn #(Integer/parseInt %)]
+
+  First provide the switches (from least to most specific), then a doc
+  string, and pairs of options.
+
+  Valid options are :default, :parse-fn, and :flag. See
+  https://github.com/clojure/tools.cli/blob/master/README.md for more
+  detailed examples.
+
+  Returns a vector containing a map of the parsed arguments, a vector
+  of extra arguments that did not match known switches, and a
+  documentation banner to provide usage instructions."
   [args & specs]
   (let [specs (map generate-spec specs)]
     (let [[options extra-args] (apply-specs specs args)


Fix status check.

Fix status check.

--- src/oc/storage/async/storage_notification.clj
+++ src/oc/storage/async/storage_notification.clj
@@ -65,7 +65,7 @@
               entry-result (entry-res/update-entry! conn entry-uuid new-entry-data)]
       (do
         (timbre/info "Handled inbox-action dismiss for entry:" entry-result)
-        (when (= status :published)
+        (when (= (:status entry-data) :published)
           (notification/send-trigger! (notification/->trigger :add org board {:new entry-result} author nil))))
       (timbre/error "Failed handling" (:sub-type body) "message for item:" entry-uuid "and users" user-ids))))

@@ -85,7 +85,7 @@
               entry-result (entry-res/update-entry! conn entry-uuid new-entry-data)]
       (do
         (timbre/info "Handled inbox-action" (:sub-type body) "for entry:" entry-result)
-        (when (= status :published)
+        (when (= (:status entry-data) :published)
           (notification/send-trigger! (notification/->trigger :add org board {:new entry-result} author nil))))
       (timbre/error "Failed handling follow message for item:" entry-uuid "and users" user-ids))))


Use function instead of macro for byte conversion

--- src/pandect/utils/convert.clj
+++ src/pandect/utils/convert.clj
@@ -43,15 +43,14 @@

 ;; ## Unsigned Int (as Long) to Byte Array

-(defmacro long->4-bytes
+(defn long->4-bytes
   "Convert an unsigned 32-bit integer (given as long) to a 4-byte array."
-  [v]
-  `(let [v# (long ~v)]
-     (doto (byte-array 4)
-      (aset 0 (byte (bit-and (bit-shift-right v# 24) 0xFF)))
-      (aset 1 (byte (bit-and (bit-shift-right v# 16) 0xFF)))
-      (aset 2 (byte (bit-and (bit-shift-right v# 8) 0xFF)))
-      (aset 3 (byte (bit-and v# 0xFF))))))
+  [^long v]
+  (doto (byte-array 4)
+    (aset 0 (byte (bit-and (bit-shift-right v 24) 0xFF)))
+    (aset 1 (byte (bit-and (bit-shift-right v 16) 0xFF)))
+    (aset 2 (byte (bit-and (bit-shift-right v 8) 0xFF)))
+    (aset 3 (byte (bit-and v 0xFF)))))

 ;; ## Unsigned Int (as Long) to String


Generate state machine outside dispatch for possible registration.

--- src/rewindable/ago-macros.clj
+++ src/rewindable/ago-macros.clj
@@ -27,14 +27,14 @@
 (defmacro ago [ago-world & body]
   (let [sm (ioc/state-machine body 1 &env my-async-terminators)]
     `(let [b# (rewindable.ago/fifo-buffer ~ago-world :ago 1)
-           c# (rewindable.ago/ago-chan-buf ~ago-world b#)]
+           c# (rewindable.ago/ago-chan-buf ~ago-world b#)
+           sm# ~sm
+           sm-instance# (sm#)
+           state# (ioc/aset-all! sm-instance#
+                                 cljs.core.async.impl.ioc-helpers/USER-START-IDX
+                                 c#)]
        (cljs.core.async.impl.dispatch/run
         (fn []
-          (let [sm# ~sm
-                sm-instance# (sm#)
-                state# (ioc/aset-all! sm-instance#
-                                      cljs.core.async.impl.ioc-helpers/USER-START-IDX
-                                      c#)]
-            (rewindable.ago/ago-reg-state-machine ~ago-world state# b#)
-            (cljs.core.async.impl.ioc-helpers/run-state-machine-wrapped state#))))
+          (rewindable.ago/ago-reg-state-machine ~ago-world state# b#)
+          (cljs.core.async.impl.ioc-helpers/run-state-machine-wrapped state#)))
        c#)))


fix for Use of undeclared Var re-frame.core/subscribe

--- src/status_im/utils/views.clj
+++ src/status_im/utils/views.clj
@@ -48,18 +48,21 @@
                                     2 [(first rest-body') {} (second rest-body')]
                                     3 rest-body')
         [subs-bindings vars-bindings] (prepare-subs subs)]
-    `(defn ~n ~params
-       (let [~@subs-bindings]
-         (reagent.core/create-class
-           (merge ~(->> component-map
-                        (map (fn [[k f]]
-                               (let [args (gensym "args")]
-                                 [k `(fn [& ~args]
-                                       (let [~@vars-bindings]
-                                         (apply ~f ~args)))])))
-                        (into {}))
-                  {:display-name (name '~n)
-                   :reagent-render
-                   (fn ~params
-                     (let [~@vars-bindings]
-                       ~body))}))))))
+    `(do
+       (when-not (find-ns 're-frame.core)
+         (require 're-frame.core))
+       (defn ~n ~params
+         (let [~@subs-bindings]
+           (reagent.core/create-class
+            (merge ~(->> component-map
+                         (map (fn [[k f]]
+                                (let [args (gensym "args")]
+                                  [k `(fn [& ~args]
+                                        (let [~@vars-bindings]
+                                          (apply ~f ~args)))])))
+                         (into {}))
+                   {:display-name (name '~n)
+                    :reagent-render
+                                  (fn ~params
+                                    (let [~@vars-bindings]
+                                      ~body))})))))))


CMR-348: Reset port number for search.

CMR-348: Reset port number for search.

--- test/cmr/system_int_test/utils/url_helper.clj
+++ test/cmr/system_int_test/utils/url_helper.clj
@@ -21,7 +21,7 @@

 (def indexer-port (config-value :indexer-port 3004))

-(def search-port (config-value :search-port 3013))
+(def search-port (config-value :search-port 3003))

 (def elastic_root (format "http://localhost:%s" elastic-port))


Temporarily take out this test for CI.

Temporarily take out this test for CI.

--- test/onyx/coordinator/coordinator_ha_test.clj
+++ test/onyx/coordinator/coordinator_ha_test.clj
@@ -1,148 +0,0 @@
-(ns onyx.coordinator.coordinator-ha-test
-  (:require [midje.sweet :refer :all]
-            [zookeeper ]
-            [onyx.queue.hornetq-utils :as hq-util]
-            [onyx.api])
-  (:import [org.apache.curator.test TestingServer]
-           [org.hornetq.core.server.embedded EmbeddedHornetQ]))
-
-(def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))
-
-;; Need to run ZK and HQ away from the Coordinator because the
-;; Coordinator will start and stop these services as it
-;; comes on and offline.
-(def zk-server (TestingServer. (:spawn-port (:zookeeper config))))
-
-(def hq-server
-  (doto (EmbeddedHornetQ.)
-    (.setConfigResourcePath
-     (str (clojure.java.io/resource
-           (first (:configs (:hornetq config))))))
-    (.start)))
-
-(def n-messages 2000)
-
-(def batch-size 1320)
-
-(def echo 1000)
-
-(def id (str (java.util.UUID/randomUUID)))
-
-(def in-queue (str (java.util.UUID/randomUUID)))
-
-(def out-queue (str (java.util.UUID/randomUUID)))
-
-(def onyx-port (+ 10000 (rand-int 10000)))
-
-(def hq-config {"host" "localhost"
-                "port" 5445})
-
-(def coord-opts
-  {:hornetq/mode :udp
-   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
-   :hornetq.udp/group-address (:group-address (:hornetq config))
-   :hornetq.udp/group-port (:group-port (:hornetq config))
-   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
-   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
-   :zookeeper/address (:address (:zookeeper config))
-   :onyx/id id
-   :onyx.coordinator/host "localhost"
-   :onyx.coordinator/port onyx-port
-   :onyx.coordinator/revoke-delay 5000})
-
-(def peer-opts
-  {:hornetq/mode :udp
-   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
-   :hornetq.udp/group-address (:group-address (:hornetq config))
-   :hornetq.udp/group-port (:group-port (:hornetq config))
-   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
-   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
-   :zookeeper/address (:address (:zookeeper config))
-   :onyx/id id})
-
-(def onyx-server (onyx.api/start-distributed-coordinator coord-opts))
-
-(def onyx-port-2 (+ 10000 (rand-int 10000)))
-
-(def coord-opts-2
-  {:hornetq/mode :udp
-   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
-   :hornetq.udp/group-address (:group-address (:hornetq config))
-   :hornetq.udp/group-port (:group-port (:hornetq config))
-   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
-   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
-   :zookeeper/address (:address (:zookeeper config))
-   :onyx/id id
-   :onyx.coordinator/host "localhost"
-   :onyx.coordinator/port onyx-port-2
-   :onyx.coordinator/revoke-delay 5000})
-
-(def onyx-server-2 (future (onyx.api/start-distributed-coordinator coord-opts-2)))
-
-(def conn (onyx.api/connect :distributed coord-opts))
-
-(hq-util/create-queue! hq-config in-queue)
-(hq-util/create-queue! hq-config out-queue)
-
-(hq-util/write-and-cap! hq-config in-queue (map (fn [x] {:n x}) (range n-messages)) echo)
-
-(defn my-inc [{:keys [n] :as segment}]
-  (assoc segment :n (inc n)))
-
-(def catalog
-  [{:onyx/name :in
-    :onyx/ident :hornetq/read-segments
-    :onyx/type :input
-    :onyx/medium :hornetq
-    :onyx/consumption :concurrent
-    :hornetq/queue-name in-queue
-    :hornetq/host "localhost"
-    :hornetq/port 5445
-    :onyx/batch-size batch-size}
-
-   {:onyx/name :inc
-    :onyx/fn :onyx.coordinator.coordinator-ha-test/my-inc
-    :onyx/type :transformer
-    :onyx/consumption :concurrent
-    :onyx/batch-size batch-size}
-
-   {:onyx/name :out
-    :onyx/ident :hornetq/write-segments
-    :onyx/type :output
-    :onyx/medium :hornetq
-    :onyx/consumption :concurrent
-    :hornetq/queue-name out-queue
-    :hornetq/host "localhost"
-    :hornetq/port 5445
-    :onyx/batch-size batch-size}])
-
-(def workflow {:in {:inc :out}})
-
-(def v-peers (onyx.api/start-peers conn 1 peer-opts))
-
-(onyx.api/submit-job conn {:catalog catalog :workflow workflow})
-
-(Thread/sleep 7000)
-(onyx.api/stop-distributed-coordinator onyx-server)
-
-(def onyx-server (future (onyx.api/start-distributed-coordinator coord-opts)))
-(Thread/sleep 7000)
-
-(onyx.api/stop-distributed-coordinator onyx-server-2)
-
-(def results (hq-util/consume-queue! hq-config out-queue echo))
-
-(doseq [v-peer v-peers]
-  ((:shutdown-fn v-peer)))
-
-(onyx.api/shutdown conn)
-(onyx.api/stop-distributed-coordinator onyx-server)
-
-(.stop hq-server)
-(.stop zk-server)
-
-(let [expected (set (map (fn [x] {:n (inc x)}) (range n-messages)))]
-  (fact (set (butlast results)) => expected)
-  (fact (last results) => :done))
-
-


Add extra sleep in between broker reboot

--- test/onyx/plugin/input_broker_reboot_test.clj
+++ test/onyx/plugin/input_broker_reboot_test.clj
@@ -66,6 +66,7 @@
        (onyx.api/submit-job peer-config job)
        (Thread/sleep 5000)
        (swap! mock component/stop)
+       (Thread/sleep 5000)
        (swap! mock component/start)
        (Thread/sleep 5000)
        (doseq [x test-data2] (>!! input-chan x))


adding test for statements?

adding test for statements?

--- test/org/libraryweasel/ligature/core_test.clj
+++ test/org/libraryweasel/ligature/core_test.clj
@@ -48,6 +48,12 @@
     (is (not (statement? ["test" "test" :a])))
     (is (statement? ["test" :a "test" "test"])))) ; TODO more test cases

+(deftest statements?-test
+  (testing "Common examples"
+    (is (statements? [["hello" "world" "triple"]]))
+    (is (statements? #{["hello" "world" "triple"]}))
+    (is (statements? '(["hello" "world" "triple"]))))) ; TODO more test cases
+
 (deftest lang-tag?-test
   (testing "Common examples"
     (is (not (lang-tag? "")))


Make var name clearer.

Make var name clearer.

--- src/tryclojure/views/eval.clj
+++ src/tryclojure/views/eval.clj
@@ -3,8 +3,8 @@
             [tryclojure.models.eval :refer [eval-request]]
             [noir.response :as resp]))

-(defpage "/eval.json" {:keys [expr jsonp]}
-  (let [{:keys [expr result error message] :as res} (eval-request expr)
+(defpage "/eval.json" {:keys [command jsonp]}
+  (let [{:keys [expr result error message] :as res} (eval-request command)
         data (if error
                res
                (let [[out res] result]
@@ -13,4 +13,4 @@

     (if jsonp
       (resp/jsonp jsonp data)
-      (resp/json data))))+      (resp/json data))))


add count integration

add count integration

--- src/wb_es/web/integration.clj
+++ src/wb_es/web/integration.clj
@@ -46,8 +46,7 @@
                                  (map pack-search-obj))
                     :query (:q params)
                     :page 1
-                    :page_size page-size
-                    }]
+                    :page_size page-size}]
       (assoc response :body body-new))))

 (defn wrap-search-exact [handler]
@@ -59,7 +58,10 @@
       (assoc response :body content-new))))

 (defn wrap-count [handler]
-  handler)
+  (fn [request]
+    (let [response (handler request)
+          count (get-in response [:body :count])]
+      (assoc response :body {:count count}))))

 (defn wrap-random [handler]
   handler)


Fix panel bookends. Change Input component to use theming

--- src/zaffre/components/ui.cljc
+++ src/zaffre/components/ui.cljc
@@ -71,8 +71,8 @@
                                :flex-direction :row
                                :cursor-char-on \u2592
                                :cursor-char-off \_
-                               :cursor-fg (zcolor/color 255 255 255 255)
-                               :cursor-bg (zcolor/color 0 0 0 255)}}
+                               :cursor-fg :ref/secondary
+                               :cursor-bg :ref/surface}}
         props (assoc (merge default-props props)
                 :style (merge (:style default-props)
                               (:style props)))
@@ -81,7 +81,7 @@
                 cursor-char-off
                 cursor-fg
                 cursor-bg]} (get props :style)
-        cursor-fg (if (and focused show-cursor) cursor-fg (zcolor/color 255 255 255))
+        cursor-fg (if (and focused show-cursor) cursor-fg :ref/on-surface)
         cursor (if (and focused show-cursor) cursor-char-on cursor-char-off)]

      (g/use-effect (fn []
@@ -435,7 +435,7 @@
                     :style {:position :absolute
                             :height 1 :width (+ 2 (count title))
                             :top -1 :left 1}}
-             (str "|" title "|")]
+             (str "\u2524" title "\u251C")]
       children)]))

 ;; style taken from https://www.nucleo.com.au/using-flexbox-for-modal-dialogs/


fix typo

fix typo

--- src_patient/patient/subs.cljs
+++ src_patient/patient/subs.cljs
@@ -7,7 +7,6 @@
 (reg-sub
  :user-name
  (fn [db _]
-   (print db)
    (patient-model/get-official-name @(subscribe [:patient]))))

 (reg-sub
@@ -29,4 +28,4 @@
           (filter #((set gen-pract-ids) (-> % :ref :id)))
           (map #(hash-map :username (:id %)
                           :id (:id %)))
-          ))))
+          )))))


Display example data on import screen

Display example data on import screen

--- src/accounting/core.cljs
+++ src/accounting/core.cljs
@@ -101,9 +101,9 @@
    {:account "", :amount ""}])

 (def app-state (atom
-  {:screen :summary
-   :txs sample-txs
-   :prices sample-prices
+  {:screen :import
+   :txs []
+   :prices [{}]
    :register-parts []
    :entry-parts empty-entry-parts}))

@@ -160,12 +160,26 @@
                [])))

 (def right-align #js {:style #js {:textAlign "right"}})
+(def top-align #js {:style #js {:verticalAlign "text-top"}})

 (defn render-import [state]
   (dom/div nil
-    (dom/p nil "Import transaction data:")
-    (dom/textarea #js {:onKeyDown (send! :import-txs) :rows 20 :cols 100})
-    (dom/p nil "Import price data:")
+    (dom/table nil
+      (dom/tr nil
+        (dom/td nil
+          (dom/p nil "Import transactions:  Paste data in the text area and press enter.  Example data: →")
+          (dom/textarea #js {:onKeyDown (send! :import-txs) :rows 20 :cols 100}))
+        (dom/td top-align
+          (dom/pre nil
+            "[\n"
+            "[\"2014-02-24\" \"Starting Equity\" :assets-cash 100 :assets-etrade 2000 :equity]\n"
+            "[\"2014-02-25\" \"Trader Joe's\" :expenses-groceries 25 :assets-cash]\n"
+            "[\"2014-02-26\" \"E*Trade\" :assets-etrade [10 :GLD] :expenses-commissions 10 :assets-etrade -1167]\n"
+            "[\"2014-02-27\" \"Whole Foods\" :expenses-groceries 30 :liabilities-visa]\n"
+            "[\"2014-02-28\" \"Paycheck\" :assets-bank 1000 :income-job]\n"
+            "]\n"))))
+    (dom/p nil "Import asset values:  Paste data and press enter.  Example Data:  "
+      (dom/span #js {:style #js {:fontFamily "monospace"}} "[{:GLD 115.70}]"))
     (dom/textarea #js {:onKeyDown (send! :import-prices) :rows 20 :cols 100})))

 (defn render-table-headings [headings]


Make citation more accessible.

Make citation more accessible.

--- src/afterglow/rhythm.clj
+++ src/afterglow/rhythm.clj
@@ -1,8 +1,8 @@
 (ns afterglow.rhythm
-  "Functions to help work with musical time."
-  {:author "Jeff Rose, James Elliott",
-   :original
-   "https://github.com/overtone/overtone/blob/master/src/overtone/music/rhythm.clj"}
+  "Functions to help work with musical time, evolved from the original
+  version in [Overtone](https://github.com/overtone/overtone/blob/master/src/overtone/music/rhythm.clj)."
+ {:author "Jeff Rose, James Elliott",
+   :doc/format :markdown}
   (:require [overtone.at-at :refer [now]]
             [clojure.math.numeric-tower :refer [round floor]]))