Improve docstrings

Improve docstrings

--- src/overtone/sc/node.clj
+++ src/overtone/sc/node.clj
@@ -572,7 +572,8 @@
   group)

 (defn- group-clear*
-  "Free all child synth nodes in a group."
+  "Nukes all nodes in the group. This completely clears out all
+   subgroups and frees all subsynths."
   [group]
   (ensure-connected!)
   (ensure-node-active! group "clearing node")
@@ -580,8 +581,8 @@
   group)

 (defn- group-deep-clear*
-  "Free all child synth nodes in and below this group in other child
-  groups."
+  "Traverses all groups below this group and frees all the synths. Group
+    structure is left unaffected."
   [group]
   (ensure-connected!)
   (ensure-node-active! group "deep clearing node")


Removed unnecessary escape in client.cljs

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/main/cljs/clojurebridgemn/client.cljs
+++ src/main/cljs/clojurebridgemn/client.cljs
@@ -590,7 +590,7 @@
      ;;  " for our Fall/Winter workshop November 13-14!"
      ;; "Save the date! Our next ClojureBridgeMN workshop is scheduled for 11/13-14"
      ;; "Stay tuned for our next ClojureBridgeMN workshop (tentatively scheduled for November 4-5)"
-     "Our next ClojureBridgeMN workshop is coming soon on Nov 4 & 5 !!!"
+     "Our next ClojureBridgeMN workshop is coming soon on Nov 4 & 5 !!!"
      [:br]
      [:br]
      "Sign up NOW on "


Refactored error handling from poller

Refactored error handling from poller

--- src/polismath/poller.clj
+++ src/polismath/poller.clj
@@ -93,6 +93,14 @@
       "lastVoteTimestamp" lastVoteTimestamp)))

+(defn log-update-error [conv start-time e]
+  (println "exception when processing zid: " (:zid conv))
+  (.printStackTrace e)
+  (let [end (System/currentTimeMillis)
+        duration (- end start-time)]
+    (metric "math.pca.compute.fail" duration)))
+
+
 (defn -main []
   (println "launching poller " (System/currentTimeMillis))
   (metric "math.process.launch" 1)
@@ -109,20 +117,16 @@
         ; For each conv...
         (doseq [[zid votes] zid-votes]
           (let [lastVoteTimestamp (:created (last votes))
-                start (System/currentTimeMillis)]
+                start-time        (System/currentTimeMillis)
+                conv              (or (@conversations zid) (new-conv))]
             (swap! conversations
               (fn [convs]
                 (try
-                  (assoc convs zid
-                    (conv-update (or (convs zid) (new-conv)) votes))
+                  (->> (conv-update conv votes)
+                       (assoc convs zid))
                   (catch Exception e
                     (do
-                      (println "exception when processing zid: " zid)
-                      (.printStackTrace e)
-                      (let [end (System/currentTimeMillis)
-                            duration (- end start)]
-                        (metric "math.pca.compute.fail" duration))
-
+                      (log-update-error conv start-time e)
                       ; Put things back the way they were
                       convs)))))


warning if system id is missing

warning if system id is missing

--- src/proxmox/provider.clj
+++ src/proxmox/provider.clj
@@ -140,8 +140,9 @@
             (try+
               (check-task node (prox-post (str "/nodes/" node "/openvz") ct*))
               (enable-features this)
-              (when (s/system-exists? id)
-                (s/partial-system id {:proxmox {:vmid vmid} :machine {:ip ip}}))
+              (if (s/system-exists? id)
+                (s/partial-system id {:proxmox {:vmid vmid} :machine {:ip ip}})
+                (warn "Creating a proxmox instance without a valid system id"))
               (when (ct* :netif)
                 (update-interfaces node (extended :flavor) ip network* vmid))
               (->Container node ct* extended network*)


add few flags for deps checks

add few flags for deps checks

--- src/jarkeeper/core.clj
+++ src/jarkeeper/core.clj
@@ -28,7 +28,7 @@

 (defn check-deps [deps]
   (map (fn [dep]
-         (conj dep (anc/artifact-outdated? dep))
+         (conj dep (anc/artifact-outdated? dep {:snapshots? false :qualified? false}))
          ) deps))

 (defn calculate-stats [deps]


wikilink

wikilink

--- src/java_time/core.clj
+++ src/java_time/core.clj
@@ -171,7 +171,7 @@
      false)))

 (def not-after?
-  "Similar to `before?`, but also returns truthy if the inputs are equal."
+  "Similar to [[before?]], but also returns truthy if the inputs are equal."
   (complement after?))

 (defn after?
@@ -194,7 +194,7 @@
      false)))

 (def not-before?
-  "Similar to `after?`, but also returns truthy if the inputs are equal."
+  "Similar to [[after?]], but also returns truthy if the inputs are equal."
   (complement before?))

 (defn plus


Faster BytesSha .hashCode and .equals methods

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1040,11 +1040,9 @@
   Object
   (toString [this] (get-hex-string this))
   (hashCode [_]
-    (bit-or
-     (bit-shift-left (aget bytes 0) 8)
-     (bit-shift-left (aget bytes 1) 0)))
+    (bit-or (aget bytes 1) (bit-shift-left (aget bytes 0) 8)))
   (equals [this o]
-    (and (satisfies? Sha o) (Arrays/equals bytes ^bytes (get-byte-array o)))))
+    (and (instance? BytesSha o) (Arrays/equals bytes ^bytes (get-byte-array o)))))

 (defn str->sha [^String s]
   (assert (<= 4 (count s)))


Remove missing :key waring on recent colors.

--- src/uxbox/ui/workspace/recent_colors.cljs
+++ src/uxbox/ui/workspace/recent_colors.cljs
@@ -50,9 +50,10 @@
       [:div.row-flex
        (for [color colors]
          [:span.color-th {:style {:background color}
+                          :key color
                           :on-click (partial callback color)}])
        (for [i (range (- 5 (count colors)))]
-         [:span.color-th])
+         [:span.color-th {:key (str "empty" i)}])

        [:span.color-th.palette-th {:on-click toggle-colorpalette}
         i/palette]]])))


CMR-1359: Adding more comments to defn-timed.

--- common-lib/src/cmr/common/util.clj
+++ common-lib/src/cmr/common/util.clj
@@ -92,9 +92,10 @@
          result# (do ~@body)]
      [(- (System/currentTimeMillis) start#) result#]))

-
 (defmacro defn-timed
-  "Creates a function that logs how long it took to execute the body"
+  "Creates a function that logs how long it took to execute the body. It supports multiarity functions
+  but only times how long the last listed arity version takes. This means it should be used with
+  multiarity functions where it calls itself with the extra arguments."
   [fn-name & fn-tail]
   (let [fn-name-str (name fn-name)
         ns-str (str *ns*)


fine tune

fine tune

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -468,9 +468,14 @@
         ))

   (ct/set-cue! (:cue-grid *show*) 2 6
-    (cues/cue :dimmers (fn [_] (dimmer-effect 0 (show/fixtures-named "head")))
-        :short-name "Heads down"
-        ))
+    (cues/cue :dimmers (fn [_]
+      (afterglow.effects/scene
+        (dimmer-effect 0 (show/fixtures-named "head"))
+        (dimmer-effect 255 (show/fixtures-named "front"))
+        )
+      )
+    :short-name "Heads down"
+    ))

   (ct/set-cue! (:cue-grid *show*) 0 3


remove codex, should be a plugin nothing worthwhile there right now

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/codex.cljs
+++ src/lt/objs/codex.cljs
@@ -1,68 +0,0 @@
-(ns lt.objs.codex
-  (:require [lt.object :as object]
-            [lt.util.dom :as dom]
-            [lt.objs.editor.pool :as pool]
-            [lt.objs.tabs :as tabs])
-  (:require-macros [lt.macros :refer [defui]]))
-
-(def fake-content "(object/behavior* ::close
-                  :triggers #{:close}
-                  :reaction (fn [this]
-                              (tabs/rem! this)))
-
-(object/behavior* ::add!
-                  :triggers #{:add!}
-                  :reaction (fn [this info]
-                              (add-item! this info)))")
-
-(defui codex-item [info]
-  [:li (object/->content (:ed info))])
-
-(defn add-item! [codex info]
-  (let [ed (pool/create {:content fake-content :name "fake codex editor" :mime "cljs"})]
-    (dom/append (object/->content codex) (codex-item (assoc info :ed ed)))
-    ed))
-
-(defn open-codex! []
-  (let [c (object/create ::codex)]
-    (tabs/add! c)
-    c))
-
-;;*********************************************************
-;; Object
-;;*********************************************************
-
-(object/object* ::codex
-                :name "Codex"
-                :eds []
-                :tags #{:codex}
-                :init (fn []
-                        [:ul.codex
-                         ]
-                        ))
-
-;;*********************************************************
-;; Behaviors
-;;*********************************************************
-
-(object/behavior* ::close
-                  :triggers #{:close}
-                  :reaction (fn [this]
-                              (tabs/rem! this)))
-
-(object/behavior* ::add!
-                  :triggers #{:add!}
-                  :reaction (fn [this info]
-                              (let [ed (add-item! this info)]
-                                (object/update! this [:eds] conj ed)
-                                (object/raise ed :refresh!))))
-
-(object/behavior* ::clear!
-                  :triggers #{:clear!}
-                  :reaction (fn [this]
-                              (doseq [ed (:eds @this)]
-                                (object/destroy! ed))))
-
-
-;(def cur (open-codex!))
-;(object/raise cur :add! {:name "blah"})


Fix Slack Pulse unicode handling :robot:

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -170,7 +170,7 @@
 (defn- render-to-png
   [^String html, ^ByteArrayOutputStream os, width]
   (let [is            (ByteArrayInputStream. (.getBytes html StandardCharsets/UTF_8))
-        doc-source    (StreamDocumentSource. is nil "text/html")
+        doc-source    (StreamDocumentSource. is nil "text/html; charset=utf-8")
         parser        (DefaultDOMSource. doc-source)
         doc           (.parse parser)
         window-size   (Dimension. width 1)


implement codetemplate deconstruction

implement codetemplate deconstruction

--- src/mirthsync/apis.clj
+++ src/mirthsync/apis.clj
@@ -325,8 +325,10 @@
 (defn deconstruct-node
   "Takes an xml node representing one of our major api elements and returns one or
   more deconstructed parts with filenames and a zip loc for the content."
-  [file-path el-loc find-name-val]
-  (let [base-path (mf/remove-extension file-path)]
+  [file-path el-loc find-name-val place-in-subdir?]
+  (let [base-path (if place-in-subdir?
+                    (str (mf/remove-extension file-path) File/separator)
+                    (str (.getParentFile (File. file-path)) File/separator))]
     (loop [el-loc el-loc
            deconstruction []]
       ;; (log/info (str "tag: " (:tag (cz/node el-loc))))
@@ -336,7 +338,7 @@
               [next-el-loc deconstruction] (if script
                                              (let [script-name (str (mf/safe-name script-name) ".js")]
                                                [(cz/next (script-node->fileref script script-name))
-                                                (conj deconstruction [(str base-path File/separator script-name) (loc-text script)])])
+                                                (conj deconstruction [(str base-path script-name) (loc-text script)])])
                                              [(cz/next el-loc) deconstruction])]

           (recur next-el-loc deconstruction))))))
@@ -350,7 +352,17 @@
    el-loc
    (fn [el-loc]
      (when-let [name-loc (cdzx/xml1-> el-loc :entry :string)]
-       [(cdzx/text name-loc) (cz/right name-loc)]))))
+       [(cdzx/text name-loc) (cz/right name-loc)]))
+   false))
+
+(defmethod mi/deconstruct-node :code-templates [_ file-path el-loc]
+  (deconstruct-node
+   file-path
+   el-loc
+   (fn [el-loc]
+     (when-let [script-loc (cdzx/xml1-> el-loc :properties :code)]
+       [(cdzx/xml1-> el-loc :name cdzx/text) script-loc]))
+   false))

 (defn name-script-sequence
   "Take a script loc to find and build the script name."
@@ -441,7 +453,8 @@
      (some (fn [[name script]]
              (when-let [script-loc (script el-loc)]
                [(name script-loc) script-loc]))
-           channel-deconstructors))))
+           channel-deconstructors))
+   true))

 (comment


Forgot to remove Clojure 1.1 from project file

--- test/midje/sweet/t_background_nesting.clj
+++ test/midje/sweet/t_background_nesting.clj
@@ -42,3 +42,7 @@
       (+ (middlemost) (innermost)) => (throws java.lang.Error))))

+(deftest left-to-right-shadowing
+   (against-background [ (middlemost) => 33 (middlemost) => 12]
+		       (fact (* 2 (middlemost)) => 24)))
+


Remove tests for deprecated features

Remove tests for deprecated features

--- test/aero/core_test.clj
+++ test/aero/core_test.clj
@@ -75,13 +75,6 @@
   (let [config (read-config "test/aero/config.edn" {:profile :prod})]
     (is (= 80 (:port config)))))

-;; cond is deprecated, just make sure it still works!
-(deftest cond-test
-  (let [config (read-config "test/aero/config.edn" {:profile :dev})]
-    (is (= 9000 (:old-port config))))
-  (let [config (read-config "test/aero/config.edn" {:profile :prod})]
-    (is (= 90 (:old-port config)))))
-
 (deftest dummy-test
   (let [config (read-config "test/aero/config.edn" {:profile :dev})]
     (is (= "dummy" (:dummy config)))))


s/()/[]/

s/()/[]/

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -35,7 +35,7 @@
   (is (not (empty? (analyze "svegliata")))))

 (deftest present-irregular
-  (let [result (generate {:synsem {:subcat ()
+  (let [result (generate {:synsem {:subcat []
                                    :cat :verb
                                    :sem {:pred :be
                                          :subj {:pred :I}
@@ -48,7 +48,7 @@
 ;; TODO: remove this test: use medium (default) model rather than small.
 (deftest passato-prossimo-small
   (let [result (generate {:root {:italiano {:italiano "bere"}}
-                          :synsem {:subcat ()
+                          :synsem {:subcat []
                                    :sem {:subj {:pred :I}
                                          :tense :present
                                          :aspect :perfect}}}
@@ -60,7 +60,7 @@
   (let [result (generate {:root {:italiano {:italiano "bere"}}
                           :modified false
                           :synsem {:cat :verb
-                                   :subcat ()
+                                   :subcat []
                                    :sem {:aspect :perfect
                                          :obj :unspec
                                          :subj {:pred :I}
@@ -72,7 +72,7 @@
   (let [result (generate {:root {:italiano {:italiano "bere"}}
                           :modified false
                           :synsem {:cat :verb
-                                   :subcat ()
+                                   :subcat []
                                    :sem {:aspect :pluperfect
                                          :obj :unspec
                                          :subj {:pred :I}
@@ -84,7 +84,7 @@
   (let [result (generate {:root {:italiano {:italiano "addormentarsi"}}
                           :modified false
                           :synsem {:cat :verb
-                                   :subcat ()
+                                   :subcat []
                                    :sem {:aspect :pluperfect
                                          :subj {:pred :I
                                                 :gender :fem}
@@ -110,7 +110,7 @@

 (deftest fix-regression
   (let [spec {:synsem {:cat :verb
-                       :subcat ()
+                       :subcat []
                        :sem {:pred :get-up
                              :subj {:pred :I}
                              :tense :present
@@ -119,7 +119,7 @@

 (deftest passato-prossimo-reflexive
   (let [result (generate {:comp {:synsem {:agr {:gender :fem}}}
-                          :synsem {:subcat ()
+                          :synsem {:subcat []
                                    :cat :verb
                                    :sem {:pred :get-up
                                          :subj {:pred :I}
@@ -130,7 +130,7 @@
     (is (= "io mi sono alzata" (morph result)))))

 (deftest present-ditransitive
-  (let [result (generate {:synsem {:subcat ()
+  (let [result (generate {:synsem {:subcat []
                                    :cat :verb
                                    :sem {:pred :be-called
                                          :tense :present
@@ -147,7 +147,7 @@
     (is (= "io parlo") (morph (first (:parses (first result)))))))

 (deftest round-trip-1
-  (let [expr (generate {:synsem {:subcat ()
+  (let [expr (generate {:synsem {:subcat []
                                  :cat :noun
                                  :sem {:spec {:def :def}
                                        :mod {:pred :difficile}
@@ -184,7 +184,7 @@
   (let [do-this-many 10
         expressions (take do-this-many
                           (repeatedly #(generate
-                                        {:synsem {:subcat ()
+                                        {:synsem {:subcat []
                                                   :sem {:mod {:pred :top}
                                                         :number :top
                                                         :pred :top
@@ -212,7 +212,7 @@
                            #(generate {:synsem {:cat :verb
                                                 :sem {:tense :present
                                                       :aspect :simple}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -232,7 +232,7 @@
                                                 :infl :imperfect
                                                 :sem {:tense :past
                                                       :aspect :progressive}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -253,7 +253,7 @@
                                                 :sem {:tense :present
                                                       :aspect :perfect
                                                       :obj :unspec}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -272,7 +272,7 @@
                            #(generate {:synsem {:cat :verb
                                                 :sem {:tense :present
                                                       :aspect :simple}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -290,7 +290,7 @@
                           (repeatedly
                            #(generate {:synsem {:cat :verb
                                                 :sem {:tense :future}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -308,7 +308,7 @@
                           (repeatedly
                            #(generate {:synsem {:cat :verb
                                                 :sem {:tense :conditional}
-                                                :subcat ()}}
+                                                :subcat []}}
                                       :model (small))))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
@@ -357,7 +357,7 @@
   (take n
         (repeatedly #(let [generated
                            (morph (generate {:synsem {:cat :verb
-                                                      :subcat ()}}))
+                                                      :subcat []}}))
                            parsed (reduce concat (map :parses (parse generated (medium))))]
                        (log/info (str "generated: " generated))
                        (log/info (str "semantics: "
@@ -384,7 +384,7 @@
 ;; should fail fast: instead seems to run forever.
 (deftest difficult-generate
   (let [synsem
-        {:synsem {:subcat ()
+        {:synsem {:subcat []
                   :sem {:pred :be
                         :subj {:pred :città}
                         :obj {:pred :calzoni}}}}]
@@ -397,7 +397,7 @@

 (deftest gestiscono
   (let [result
-        (generate {:synsem {:subcat ()
+        (generate {:synsem {:subcat []
                             :cat :verb
                             :sem {:subj {:pred :loro}
                                   :pred :manage
@@ -406,26 +406,26 @@
     (is (= "loro gestiscono" (morph result)))))

 (deftest casa-generate
-  (let [result (generate {:synsem {:subcat ()
+  (let [result (generate {:synsem {:subcat []
                                    :pronoun false
                                    :cat :noun
                                    :agr {:number :sing}
                                    :sem {:pred :house
-                                         :mod ()
+                                         :mod []
                                          :spec {:def :def}}}})]
     (is (= (morph result) "la casa"))
-    (is (= (get-in result [:synsem :sem :mod]) ()))))
+    (is (= (get-in result [:synsem :sem :mod]) []))))

 (deftest case-generate
-  (let [result (generate {:synsem {:subcat ()
+  (let [result (generate {:synsem {:subcat []
                                    :pronoun false
                                    :cat :noun
                                    :agr {:number :plur}
                                    :sem {:pred :house
-                                         :mod ()
+                                         :mod []
                                          :spec {:def :def}}}})]
     (is (= (morph result) "le case"))
-    (is (= (get-in result [:synsem :sem :mod]) ()))))
+    (is (= (get-in result [:synsem :sem :mod]) []))))

 (deftest alla-casa-generate
   (let [result (generate
@@ -434,11 +434,11 @@
                  ;; TODO: the above is needed to prevent "a" + reflexive pronoun:
                  ;; eliminate this need.
                  :synsem {:cat :prep
-                          :subcat ()
+                          :subcat []
                           :sem {:pred :a
                                 :obj {:pred :house
                                       :spec {:def :def}
-                                      :mod ()}}}})]
+                                      :mod []}}}})]
     (is (= (morph result) "alla casa"))))

 (deftest a-casa-generate
@@ -447,10 +447,10 @@
                  ;; TODO: the above is needed to prevent "a" + reflexive pronoun:
                  ;; eliminate this need.
                  :synsem {:cat :prep
-                          :subcat ()
+                          :subcat []
                           :sem {:pred :a
                                 :obj {:pred :house
-                                      :mod () ;; if :mod () is specified:
+                                      :mod [] ;; if :mod [] is specified:
                                       ;; test will run faster since there will
                                       ;; be less futile bolts checked
                                       ;; (less bolts where no complement can
@@ -462,7 +462,7 @@
 (deftest a-casa-generate-2
   (let [result (generate
                 {:modified false
-                 :synsem {:subcat ()
+                 :synsem {:subcat []
                           :cat :verb
                           :sem {:tense :present
                                 :aspect :simple
@@ -527,43 +527,43 @@

 (deftest davanti-il-tavolo
   (let [parse-result (mapcat :parses (parse "davanti il tavolo"))
-        gen-result (generate {:synsem {:subcat ()
+        gen-result (generate {:synsem {:subcat []
                                        :cat :prep
                                        :sem {:pred :in-front-of
                                              :obj {:pred :table
                                                    :number :sing
-                                                   :mod ()
+                                                   :mod []
                                                    :spec {:def :def}}}}
                               :comp {:synsem {:cat :noun
                                               :pronoun false
-                                              :subcat ()}}})]
+                                              :subcat []}}})]
     (is (not (empty? parse-result)))
     (is (= "davanti il tavolo"
            (morph gen-result)))))

 (deftest davanti-lo-studente
   (let [parse-result (mapcat :parses (parse "davanti lo studente"))
-        gen-result (generate {:synsem {:subcat ()
+        gen-result (generate {:synsem {:subcat []
                                        :cat :prep
                                        :sem {:pred :in-front-of
                                              :obj {:pred :student
                                                    :number :sing
-                                                   :mod ()
+                                                   :mod []
                                                    :spec {:def :def}}}}
                               :comp {:synsem {:cat :noun
                                               :pronoun false
-                                              :subcat ()}}})]
+                                              :subcat []}}})]
     (is (not (empty? parse-result)))
     (is (= "davanti lo studente"
            (morph gen-result)))))

 (deftest davanti-il-tavolo
-  (let [expr (generate {:synsem {:subcat ()
+  (let [expr (generate {:synsem {:subcat []
                                  :cat :prep
                                  :sem {:pred :in-front-of
                                        :reflexive false
                                        :obj {:pred :table
-                                             :mod ()
+                                             :mod []
                                              :number :sing
                                              :spec {:def :def
                                                     :pred :definite}}}}})]
@@ -571,15 +571,15 @@
            "davanti il tavolo"))))

 (deftest furniture-sentence
-  (let [expr (generate {:synsem {:sem {:obj {:pred :table :mod () :spec {:def :def}
+  (let [expr (generate {:synsem {:sem {:obj {:pred :table :mod [] :spec {:def :def}
                                              :number :sing}
                                        :pred :in-front-of
-                                       :subj {:pred :chair :mod () :spec {:def :def}
+                                       :subj {:pred :chair :mod [] :spec {:def :def}
                                               :number :sing}
                                        :tense :present
                                        :aspect :simple}
                                  :cat :verb
-                                 :subcat ()}
+                                 :subcat []}
                         :comp {:synsem {:agr {:person :3rd}}}
                         :modified false})]
     (is (= (morph expr)
@@ -594,7 +594,7 @@
 ;          not)))

 (deftest past-and-gender-agreement
-  (is (= (morph (generate {:synsem {:subcat ()
+  (is (= (morph (generate {:synsem {:subcat []
                                     :cat :verb
                                     :sem {:pred :go
                                           :aspect :perfect
@@ -606,7 +606,7 @@

 (deftest exists1
   (is (= (morph (generate {:synsem {:cat :verb
-                                    :subcat ()
+                                    :subcat []
                                     :sem {:obj :unspec
                                           :subj :top
                                           :pred :exist
@@ -619,7 +619,7 @@

 (deftest exists2
   (is (= (morph (generate {:synsem {:cat :verb
-                                    :subcat ()
+                                    :subcat []
                                     :sem {:obj :unspec
                                           :subj :top
                                           :pred :exist
@@ -633,7 +633,7 @@

 (deftest exists3
   (is (= (morph (generate {:synsem {:cat :verb
-                                    :subcat ()
+                                    :subcat []
                                     :sem {:obj :unspec
                                           :subj :top
                                           :pred :exist
@@ -651,7 +651,7 @@
 (deftest present-progressive-vs-present-simple
   (let [base-spec {:modified false
                    :synsem {:cat :verb
-                            :subcat ()
+                            :subcat []
                             :sem {:pred :eat
                                   :tense :present
                                   :subj {:pred :I}
@@ -668,7 +668,7 @@

 (deftest fornendo
   (is (= "io sto fornendo" (morph (generate {:synsem {:cat :verb
-                                                      :subcat ()
+                                                      :subcat []
                                                       :sem {:tense :present
                                                             :aspect :progressive
                                                             :subj {:pred :I}
@@ -676,7 +676,7 @@
                                              :modified false
                                              :root {:italiano {:italiano "fornire"}}}))))
   (is (= "tu stai fornendo" (morph (generate {:synsem {:cat :verb
-                                                       :subcat ()
+                                                       :subcat []
                                                        :sem {:tense :present
                                                              :aspect :progressive
                                                              :obj :unspec}
@@ -688,7 +688,7 @@

 (deftest present-progressive-reflexive
   (is (= "loro si stanno addormentando" (morph (generate {:synsem {:cat :verb
-                                                                   :subcat ()
+                                                                   :subcat []
                                                                    :sem {:tense :present
                                                                          :aspect :progressive
                                                                          :subj {:pred :loro}}}


[#32] Fix deserialization of falsey values (were returning as nil) (@pegotezzi)

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -136,7 +136,6 @@
   "Forces argument of any type to be subject to automatic de/serialization with
   Nippy.")

-
 (defn- freeze?  [x] (or (nippy-tools/wrapped-for-freezing? x)
                         (encore/bytes? x)))
 (defn- stringy? [x] (or (string? x) (keyword? x)))
@@ -183,12 +182,20 @@

 (defn- db-val->clj-val "Returns the Clojure value of given AttributeValue object."
   [^AttributeValue x]
-  (or (.getS x)
-      (some->> (.getN  x) ddb-num-str->num)
-      (some->> (.getB  x) nt-thaw)
-      (some->> (.getSS x) (into #{}))
-      (some->> (.getNS x) (mapv ddb-num-str->num) (into #{}))
-      (some->> (.getBS x) (mapv nt-thaw)          (into #{}))))
+  (let [[type x*]
+        (or (when-let [x* (.getS  x)] [:s  x*])
+            (when-let [x* (.getN  x)] [:n  x*])
+            (when-let [x* (.getB  x)] [:b  x*])
+            (when-let [x* (.getSS x)] [:ss x*])
+            (when-let [x* (.getNS x)] [:ns x*])
+            (when-let [x* (.getBS x)] [:bs x*]))]
+    (case type
+      :s  (->> x*)
+      :n  (->> x* ddb-num-str->num)
+      :b  (->> x* nt-thaw)
+      :ss (->> x* (into #{}))
+      :ns (->> x* (mapv ddb-num-str->num) (into #{}))
+      :bs (->> x* (mapv nt-thaw)          (into #{})))))

 (defn- clj-val->db-val "Returns an AttributeValue object for given Clojure value."
   ^AttributeValue [x]


Add `:return-cc?` option to several fns, clean up auto batch reprocessing

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -70,11 +70,6 @@
             com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient
             java.nio.ByteBuffer))

-;; TODO setReturnConsumedCapacity enum for:
-;; GetItem PutItem UpdateItem DeleteItem
-;; Query Scan
-;; BatchGetItem BatchWriteItem
-
 ;;;; Connections

 (def ^:private db-client*
@@ -415,14 +410,15 @@
     prim-kvs     - {<hash-key> <val>} or {<hash-key> <val> <range-key> <val>}.
     :attrs       - attrs to return, [<attr> ...].
     :consistent? - use strongly (rather than eventually) consistent reads?"
-  [creds table prim-kvs & [{:keys [attrs consistent?]}]]
+  [creds table prim-kvs & [{:keys [attrs consistent? return-cc?]}]]
   (as-map
    (.getItem (db-client creds)
     (doto-maybe (GetItemRequest.) g
       :always     (.setTableName       (name table))
       :always     (.setKey             (clj-item->db-item prim-kvs))
       consistent? (.setConsistentRead  g)
-      attrs       (.setAttributesToGet (mapv name g))))))
+      attrs       (.setAttributesToGet (mapv name g))
+      return-cc?  (.setReturnConsumedCapacity (utils/enum :total))))))

 (defn- expected-values
   "{<attr> <cond> ...} -> {<attr> ExpectedAttributeValue ...}"
@@ -441,7 +437,7 @@
                 met for the operation to succeed. e.g.:
                   {<attr> <expected-value> ...}
                   {<attr> false ...} ; Attribute must not exist"
-  [creds table item & [{:keys [return expected]
+  [creds table item & [{:keys [return expected return-cc?]
                         :or   {return :none}}]]
   (as-map
    (.putItem (db-client creds)
@@ -449,7 +445,8 @@
        :always  (.setTableName    (name table))
        :always  (.setItem         (clj-item->db-item item))
        expected (.setExpected     (expected-values g))
-       return   (.setReturnValues (utils/enum g))))))
+       return   (.setReturnValues (utils/enum g))
+       return-cc? (.setReturnConsumedCapacity (utils/enum :total))))))

 (defn- attribute-updates
   "{<attr> [<action> <value>] ...} -> {<attr> AttributeValueUpdate ...}"
@@ -466,7 +463,7 @@
     update-map - {<attr> [<#{:put :add :delete}> <optional value>]}.
     :return    - e/o #{:none :all-old :updated-old :all-new :updated-new}.
     :expected  - {<attr> <#{<expected-value> false}> ...}."
-  [creds table prim-kvs update-map & [{:keys [return expected]
+  [creds table prim-kvs update-map & [{:keys [return expected return-cc?]
                                        :or   {return :none}}]]
   (as-map
    (.updateItem (db-client creds)
@@ -475,12 +472,13 @@
        :always  (.setKey              (clj-item->db-item prim-kvs))
        :always  (.setAttributeUpdates (attribute-updates update-map))
        expected (.setExpected         (expected-values g))
-       return   (.setReturnValues     (utils/enum g))))))
+       return   (.setReturnValues     (utils/enum g))
+       return-cc? (.setReturnConsumedCapacity (utils/enum :total))))))

 (defn delete-item
   "Deletes an item from a table by its primary key.
   See `put-item` for option docs."
-  [creds table prim-kvs & [{:keys [return expected]
+  [creds table prim-kvs & [{:keys [return expected return-cc?]
                             :or   {return :none}}]]
   (as-map
    (.deleteItem (db-client creds)
@@ -488,7 +486,8 @@
        :always  (.setTableName    (name table))
        :always  (.setKey          (clj-item->db-item prim-kvs))
        expected (.setExpected     (expected-values g))
-       return   (.setReturnValues (utils/enum g))))))
+       return   (.setReturnValues (utils/enum g))
+       return-cc? (.setReturnConsumedCapacity (utils/enum :total))))))

 ;;;; API - batch ops

@@ -525,17 +524,15 @@
                                           :attrs []}}))

 (defn- merge-unprocessed
-  [creds more-f last-result]
+  [more-f last-result]
   (loop [{:keys [items unprocessed consumed-capacity]} last-result]
-    (when (seq unprocessed) (println "REPROCESSING!: " unprocessed))
     (if-not (seq unprocessed)
-      (if items
-        (with-meta items {:consumed-capacity consumed-capacity})
-        last-result)
+      (if items (with-meta items {:consumed-capacity consumed-capacity})
+                last-result)

       (let [{items* :items unprocessed* :unprocessed
              consumed-capacity* :consumed-capacity}
-            (more-f creds unprocessed)]
+            (more-f unprocessed)]

         (recur (merge {:unprocessed       unprocessed*
                        :consumed-capacity (when consumed-capacity
@@ -543,13 +540,6 @@
                                                consumed-capacity*))}
                       (when (or items items*)
                         {:items (into (or items []) items*)})))))))
-
-(defn- batch-get-item* [creds raw-request]
-  (merge-unprocessed creds batch-get-item*
-   (as-map
-    (.batchGetItem (db-client creds)
-      (doto (BatchGetItemRequest.) ; {table-str KeysAndAttributes}
-        (.setRequestItems raw-request))))))

 (defn batch-get-item
   "Retrieves a batch of items in a single request.
@@ -562,8 +552,14 @@
                :consistent? true}
      :friends {:prim-kvs [{:catagory \"favorites\" :id [1 2 3]}
                           {:catagory \"recent\"    :id [7 8 9]}]}})"
-  [creds requests]
-  (batch-get-item* creds (batch-request-items requests)))
+  [creds requests & [{:keys [return-cc?] :as opts}]]
+  (let [raw-req (if (:raw? opts) requests (batch-request-items requests))]
+    (merge-unprocessed #(batch-get-item creds % (assoc opts :raw? true))
+     (as-map
+      (.batchGetItem (db-client creds)
+        (doto-maybe (BatchGetItemRequest.) g ; {table-str KeysAndAttributes}
+          :always    (.setRequestItems raw-req)
+          return-cc? (.setReturnConsumedCapacity (utils/enum :total))))))))

 (comment
   (def bigval (.getBytes (apply str (range 14000))))
@@ -576,14 +572,6 @@
     :put    (doto (WriteRequest.) (.setPutRequest    (doto (PutRequest.)    (.setItem item))))
     :delete (doto (WriteRequest.) (.setDeleteRequest (doto (DeleteRequest.) (.setKey  item))))))

-(defn- batch-write-item*
-  [creds raw-request]
-  (merge-unprocessed creds batch-write-item*
-   (as-map
-    (.batchWriteItem (db-client creds)
-      (doto (BatchWriteItemRequest.)
-        (.setRequestItems raw-request))))))
-
 (defn batch-write-item
   "Executes a batch of Puts and/or Deletes in a single request.
    Limits apply, Ref. http://goo.gl/Bj9TC. No transaction guarantees are
@@ -593,16 +581,24 @@
      {:users {:put    [{:user-id 1 :username \"sally\"}
                        {:user-id 2 :username \"jane\"}]
               :delete [{:user-id [3 4 5]}]}})"
-  [creds requests]
-  (batch-write-item* creds
-    (utils/name-map
-     ;; {<table> <table-reqs> ...} -> {<table> [WriteRequest ...] ...}
-     (fn [table-request]
-       (reduce into []
-         (for [action (keys table-request)
-               :let [items (attr-multi-vs (table-request action))]]
-           (mapv (partial write-request action) items))))
-     requests)))
+  [creds requests & [{:keys [return-cc?] :as opts}]]
+  (let [raw-req
+        (if (:raw? opts) requests
+            (utils/name-map
+             ;; {<table> <table-reqs> ...} -> {<table> [WriteRequest ...] ...}
+             (fn [table-request]
+               (reduce into []
+                 (for [action (keys table-request)
+                       :let [items (attr-multi-vs (table-request action))]]
+                   (mapv (partial write-request action) items))))
+             requests))]
+
+    (merge-unprocessed #(batch-write-item creds % (assoc opts :raw? true))
+     (as-map
+      (.batchWriteItem (db-client creds)
+        (doto-maybe (BatchWriteItemRequest.) g
+          :always    (.setRequestItems raw-req)
+          return-cc? (.setReturnConsumedCapacity (utils/enum :total))))))))

 ;;;; API - queries & scans

@@ -637,7 +633,7 @@

   For unindexed item retrievel see `scan`."
   [creds table prim-key-conds
-   & [{:keys [last-prim-kvs return index order limit consistent?]
+   & [{:keys [last-prim-kvs return index order limit consistent? return-cc?]
        :or   {order :asc}}]]
   (println (query|scan-conditions prim-key-conds))
   (as-map
@@ -651,6 +647,7 @@
        index           (.setIndexName      g)
        consistent?     (.setConsistentRead g)
        (coll?* return) (.setAttributesToGet (mapv name return))
+       return-cc? (.setReturnConsumedCapacity (utils/enum :total))
        (and return (not (coll?* return))) (.setSelect (utils/enum return))))))

 (defn scan
@@ -669,7 +666,8 @@
   For automatic parallelization & segment control see `scan-parallel`.
   For indexed item retrievel see `query`."
   [creds table
-   & [{:keys [attr-conds last-prim-kvs return limit total-segments segment]}]]
+   & [{:keys [attr-conds last-prim-kvs return limit total-segments segment
+              return-cc?]}]]
   (as-map
    (.scan (db-client creds)
      (doto-maybe (ScanRequest.) g
@@ -680,6 +678,7 @@
        total-segments  (.setTotalSegments     (long g))
        segment         (.setSegment           (long g))
        (coll?* return) (.setAttributesToGet (mapv name return))
+       return-cc? (.setReturnConsumedCapacity (utils/enum :total))
        (and return (not (coll?* return))) (.setSelect (utils/enum return))))))

 (defn scan-parallel


Only write simple number values as numbers (exclude rationals, arb-precision nums, etc.)

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -111,6 +111,10 @@
 (def ^:private ^:const ba-class (Class/forName "[B"))
 (defn- ba? [x] (instance? ba-class x))
 (defn- ba-buffer [^bytes ba] (ByteBuffer/wrap ba))
+(defn- simple-number? [x] (or (instance? Long    x)
+                              (instance? Double  x)
+                              (instance? Integer x)
+                              (instance? Float   x)))

 (defn- to-attr-value
   "Returns an AttributeValue object for given Clojure value."
@@ -119,7 +123,7 @@
   [x]
   (cond
    (string? x)        (doto (AttributeValue.) (.setS x))
-   (number? x)        (doto (AttributeValue.) (.setN (str x)))
+   (simple-number? x) (doto (AttributeValue.) (.setN (str x)))
    (ba?     x)        (doto (AttributeValue.) (.setB (ba-buffer x)))
    (set-of string? x) (doto (AttributeValue.) (.setSS x))
    (set-of number? x) (doto (AttributeValue.) (.setNS (map str x)))


simplifications to re-rule based parsing


rename deftests

rename deftests

--- test/java_time_test.clj
+++ test/java_time_test.clj
@@ -6,7 +6,7 @@

 (def clock (j/fixed-clock "2015-11-26T10:20:30.000000040Z" "UTC"))

-(deftest constructors
+(deftest constructors-test
   (testing "clocks"
     (testing ", with-clock"
       (are [f] (= (j/with-clock clock (f))
@@ -321,7 +321,7 @@
      (is (j/period? (j/period)))
      (is (not (j/period? nil)))))

-(deftest operations
+(deftest operations-test
   (testing "duration"
     (is (j/duration? (j/duration 1 :days)))
     (is (not (j/duration? nil)))
@@ -410,7 +410,7 @@
              (j/minus (j/day-of-week 6) 5)
              (j/minus (j/day-of-week 6) (j/days 5)))))))

-(deftest ordering
+(deftest ordering-test

   (testing "times"
     (let [ldt (j/local-date-time clock)
@@ -573,7 +573,7 @@
       (is (j/not-before? apr-1 jan-1))
       (is (not (j/not-before? jan-1 apr-1))))))

-(deftest mock-clock
+(deftest mock-clock-test
   (testing "constructors"
     (is (= (j/mock-clock)
            (j/mock-clock 0)
@@ -622,7 +622,7 @@
           (j/set-clock! clock 0)
           (is (= 0 (j/value clock))))))))

-(deftest properties
+(deftest properties-test
   (testing "units"
     (is (= (j/unit :seconds)
            (j/unit (j/duration) :seconds)
@@ -795,7 +795,7 @@
     (testing "throws"
       (is (thrown? Exception (j/as (j/local-time 0) :year))))))

-(deftest legacy-conversion
+(deftest legacy-conversion-test
   (testing "deprecated"
     (testing "converts through instant"
       (is (= (j/instant 1000) (j/instant (java.util.Date. 1000))))
@@ -925,7 +925,7 @@

   (import '[org.joda.time Duration Period DateTimeZone
             LocalDate LocalTime LocalDateTime DateTime Instant])
-  (deftest joda
+  (deftest joda-test
     (testing "duration from duration and period"
       (is (= (j/duration 1 :millis)
             (j/duration (Duration/millis 1))


#42: remove locale-dependent test

#42: remove locale-dependent test

--- test/java_time_test.clj
+++ test/java_time_test.clj
@@ -61,8 +61,7 @@

     (is (= (j/day-of-week 4)
            (j/day-of-week :thursday)
-           (j/day-of-week (j/local-date clock))
-           (j/day-of-week "ee" "05")))
+           (j/day-of-week (j/local-date clock))))

     (is (j/day-of-week? (j/day-of-week 4))))


Add hide functionality to group members.

--- src/uxbox/ui/shapes.cljs
+++ src/uxbox/ui/shapes.cljs
@@ -48,7 +48,9 @@
         shapes-by-id (get @st/state :shapes-by-id)]
     (html
      [:g attrs
-      (for [item (map #(get shapes-by-id %) items)]
+      (for [item (->> items
+                      (map #(get shapes-by-id %))
+                      (remove :hidden))]
         (shapes/-render item nil))])))

 (defmethod shapes/-render-svg :builtin/icon


write tests for the other direction

write tests for the other direction

--- test/hu/ssh/github_changelog/semver_test.clj
+++ test/hu/ssh/github_changelog/semver_test.clj
@@ -17,4 +17,5 @@
     (is (semver/extract "1.0.1"))))

 (deftest newer?
-  (is (semver/newer? (c/complete {:major 1} Semver) (c/complete {:major 0} Semver))))
+  (is (semver/newer? (c/complete {:major 1} Semver) (c/complete {:major 0} Semver)))
+  (is (not (semver/newer? (c/complete {:major 0} Semver) (c/complete {:major 1} Semver)))))


Added stub twitter adapter

Added stub twitter adapter

--- test/layzee/integration/twitter_examples.clj
+++ test/layzee/integration/twitter_examples.clj
@@ -1,8 +1,9 @@
 (ns layzee.integration.twitter-examples
   (:use midje.sweet)
   (:require [clojure.test :refer :all]
-            [layzee.core :refer :all]))
+            [layzee.adapters.twitter :refer :all :as twitter]))

 (facts
  (fact "Can read the timeline"
-       (+ 1 1) => 2))
+       (let [result (twitter/lazy-web)]
+         (< 0 (count result)) => true)))


Upgrade eastwood

Upgrade eastwood

--- leiningen/.lein/profiles.clj
+++ leiningen/.lein/profiles.clj
@@ -2,4 +2,4 @@
                   [lein-cljfmt "0.5.6"]
                   [lein-kibit "0.1.5" :exclusions [org.clojure/clojure]]
                   [lein-cloverage "1.0.9"]
-                  [jonase/eastwood "0.2.4"]]}}
+                  [jonase/eastwood "0.2.5"]]}}


Update lein profile

Update lein profile

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,9 +1,9 @@
 {:user
- {:dependencies [[cljdev "0.4.0-SNAPSHOT"]]
+ {:dependencies [[cljdev "0.5.0-SNAPSHOT"]]
   :injections   [(require 'nu)]
   :repositories [["nu-maven" {:url "s3p://nu-maven/releases/"
-                               :username [:gpg :env/artifacts_aws_access_key_id]
-                               :passphrase [:gpg :env/artifacts_aws_secret_access_key]}]]
+                              :username [:gpg :env/artifacts_aws_access_key_id]
+                              :passphrase [:gpg :env/artifacts_aws_secret_access_key]}]]

   :plugins [[s3-wagon-private "1.2.0"]]}
   :repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]


Bump lein profile deps

Bump lein profile deps

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,14 +1,18 @@
 {:user
  {:dependencies [[cljdev "0.6.7-SNAPSHOT"]]
+
   :injections   [(require 'nu)]
+
   :repositories [["nu-maven" {:url "s3p://nu-maven/releases/"
                               :username [:gpg :env/artifacts_aws_access_key_id]
                               :passphrase [:gpg :env/artifacts_aws_secret_access_key]}]]

-  :plugins [[s3-wagon-private "1.2.0"]
+  :plugins [[s3-wagon-private "1.3.0"]
             [jonase/eastwood "0.2.4"]
-            [lein-gorilla "0.4.0"]]}
-  :repl {:plugins [[cider/cider-nrepl "0.14.0-SNAPSHOT"]
-                   [refactor-nrepl "2.3.0-SNAPSHOT"]]
+            [com.jakemccrary/lein-test-refresh "0.21.1"]
+            [venantius/ultra "0.5.2"]]}
+
+  :repl {:plugins [[cider/cider-nrepl "0.15.1"]
+                   [refactor-nrepl "2.3.1"]]
          :dependencies [[org.clojure/tools.nrepl "0.2.12"]]
          :repl-options {:timeout 120000}}}


lein-ancient bump

lein-ancient bump

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -1,6 +1,6 @@
 {:user {:plugins [
                   [lein-ring "0.9.1"]
-                  [lein-ancient "0.6.2"]
+                  [lein-ancient "0.6.3"]
                   [jonase/eastwood "0.2.1"]
                   [cider/cider-nrepl "0.8.2"]
                   ]}}


Resources list is now in the site configuration file.

--- src/palletops/hyde.clj
+++ src/palletops/hyde.clj
@@ -30,6 +30,7 @@

 (def Site-Config
   {:template s/Keyword
+   (s/optional-key :resources) [s/Str]
    :config
    {(s/optional-key :collections)
     {s/Keyword
@@ -189,9 +190,9 @@
          [s/Str Site-Config Tag-Map :- s/Bool]]}
   ([root site-config]
      (copy-resources! root site-config *tag-map*))
-  ([root {:keys [template] :as site-config} tag-map]
-     (let [template (if (keyword? template) (name template) template)
-           resources (template-resources template)
+  ([root {:keys [template resources] :as site-config} tag-map]
+     (printf "Copying resources: %s\n" resources)
+     (let [template (name template)
            files (map #(format "%s/%s" template %) resources)]
        (doseq [r resources]
          (let [source (format "%s/%s" template r)
@@ -225,7 +226,7 @@
                           content)
                      content)
            target (format "%s/%s" root path)]
-       (println (format "writing %s" target))
+       (println (format "writing %s (%s bytes)" target (count content)))
        (spit target content)
        true)))

@@ -242,7 +243,9 @@
     tag-map]
      (let [target-dir (format "%s/_%s" root name)
            docs (if index?
-                  (map #(assoc-in %1 [:front-matter index-key] %2) docs (range (count docs)))
+                  (map #(assoc-in %1 [:front-matter index-key] %2)
+                       docs
+                       (range (count docs)))
                   docs)]
        (doseq [doc docs]
          (write-document! target-dir doc tag-map))


fix tests

fix tests

--- test/neb/test/array.clj
+++ test/neb/test/array.clj
@@ -11,5 +11,5 @@
         (fact "Write Cell With Array"
               (new-cell trunk 1 (int 1) {:arr (range 100)}) => anything)
         (fact "Read Cell With Array"
-              (read-cell trunk 1) => (fn [m] (= m {:arr (vec (range 100))})))
+              (read-cell trunk 1) => (contains {:arr (vec (range 100))}))
         (.dispose trunk)))


got tst.parse.demo converted to forest & bush

--- test/tst/parse/demo.clj
+++ test/tst/parse/demo.clj
@@ -52,8 +52,6 @@
         (hid->tree (add-tree-hiccup (parse-and-transform "  123 ")))
         {:attrs {:tag :int}, :content [123]}))))

-(comment
-
 ; If we use the InstaParse built-in ability to perform simple "pre-transforms" on the AST, we can greatly
 ; simplify out manual transformations.  Compare how simple tx-map is below with the previous example. Also,
 ; notice that we don't need the (prune-whitespace-nodes ...) function anyplace either.
@@ -90,41 +88,38 @@
                                     ast-tx    (insta/transform tx-map ast-parse) ]
                                 ast-tx)) ]
     (with-forest (new-forest)
-      (is= (hid->tree (add-tree-hiccup (parse-and-transform "girl")))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :identifier}, :value ["girl"]}]}]})
+      (is= (hid->bush (add-tree-hiccup (parse-and-transform "girl")))
+        [{:tag :tokens}
+         [{:tag :token}
+          [{:tag :identifier} "girl"]]] )

-      (is= (hid->tree (add-tree-hiccup (parse-and-transform (ts/quotes->double "'abc'"))))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :string}, :value ["abc"]}]}]})
+      (is= (hid->bush (add-tree-hiccup (parse-and-transform (ts/quotes->double "'abc'"))))
+        [{:tag :tokens}
+         [{:tag :token}
+          [{:tag :string} "abc"]]] )

-      (is= (hid->tree (add-tree-hiccup (parse-and-transform +123)))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :integer}, :value [123]}]}]})
+      (is= (hid->bush (add-tree-hiccup (parse-and-transform +123)))
+        [{:tag :tokens}
+         [{:tag :token}
+          [{:tag :integer} 123]]])

-      (is= (hid->tree (add-tree-hiccup (parse-and-transform -123)))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :integer}, :value [-123]}]}]})
+      (is= (hid->bush (add-tree-hiccup (parse-and-transform -123)))
+        [{:tag :tokens}
+         [{:tag :token}
+          [{:tag :integer} -123]]])

       ; All together now!
-      (is= (hid->tree (add-tree-hiccup
+      (is= (hid->bush (add-tree-hiccup
                         (parse-and-transform
                           (ts/quotes->double "do-re-mi abc 1 23 baby 'you and me girl'"))))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :identifier}, :value ["do-re-mi"]}]}
-                 {:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :identifier}, :value ["abc"]}]}
-                 {:attrs {:tag :token}, :kids [{:attrs {:tag :integer}, :value [1]}]}
-                 {:attrs {:tag :token}, :kids [{:attrs {:tag :integer}, :value [23]}]}
-                 {:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :identifier}, :value ["baby"]}]}
-                 {:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :string}, :value ["you and me girl"]}]}]}))))
+        [{:tag :tokens}
+         [{:tag :token} [{:tag :identifier} "do-re-mi"]]
+         [{:tag :token} [{:tag :identifier} "abc"]]
+         [{:tag :token} [{:tag :integer} 1]]
+         [{:tag :token} [{:tag :integer} 23]]
+         [{:tag :token} [{:tag :identifier} "baby"]]
+         [{:tag :token} [{:tag :string} "you and me girl"]]]))))
+

 ;-----------------------------------------------------------------------------
 (dotest
@@ -166,13 +161,11 @@
                                                 (throw (IllegalArgumentException. (str ast-tx)))
                                                 ast-tx)
                                     ]
-                                ast-tx))
-        ]
+                                ast-tx)) ]
     (with-forest (new-forest)
-      (is= (hid->tree (add-tree-hiccup (parse-and-transform "girl.2")))
-        {:attrs {:tag :tokens},
-         :kids  [{:attrs {:tag :token},
-                  :kids  [{:attrs {:tag :identifier}, :value ["girl.2"]}]}]}))))
+      (is= (hid->bush (add-tree-hiccup (parse-and-transform "girl.2")))
+        [{:tag :tokens}
+         [{:tag :token}
+          [{:tag :identifier} "girl.2"]]]))))

-)


New test: test-load-configuration-4 and 5

--- test/zg/config_test.clj
+++ test/zg/config_test.clj
@@ -181,3 +181,19 @@
             (-> cfg :display :emender-page) "http://example.com/emender"
             (-> cfg :display :other) nil)))

+(deftest test-load-configuration-4
+    "Check the behaviour of function zg.config/load-configuration."
+    (let [cfg (load-configuration "test/test2.ini")]
+        (is (not (nil? (:server cfg))))
+        (is (not (nil? (:display cfg))))
+        (is (nil? (:other cfg)))))
+
+(deftest test-load-configuration-5
+    "Check the behaviour of function zg.config/load-configuration."
+    (let [cfg (load-configuration "test/test2.ini")]
+        (are [x y] (= x y)
+            (-> cfg :server  :url-prefix)   ""
+            (-> cfg :display :app-name)     ""
+            (-> cfg :display :emender-page) ""
+            (-> cfg :display :other) nil)))
+


include pronouns in page titles (re #56)

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -20,6 +20,14 @@
             [pronouns.util :as u]
             [hiccup.core :refer :all]
             [hiccup.util :refer [escape-html]]))
+
+(defn prose-comma-list
+  [items]
+  (let [c (count items)]
+    (cond
+      (<= c 1) (first items)
+      (= c 2) (s/join " and " items)
+      :else (str (s/join ", " (butlast items)) ", and " (last items)))))

 (defn href
   [url text]
@@ -49,7 +57,9 @@

 (defn possessive-pronoun-example
   [possessive-pronoun]
-  (render-sentence "At least I think it was " (wrap-pronoun possessive-pronoun) "."))
+  (render-sentence "At least I think it was "
+                   (wrap-pronoun possessive-pronoun)
+                   "."))

 (defn reflexive-example
   [subject reflexive]
@@ -58,16 +68,16 @@
                    (wrap-pronoun reflexive)
                    "."))

-(defn title-block [title]
+(defn header-block [header]
   [:div {:class "section title"}
-   [:h1 title]])
+   (href "/" [:h1 header])])

 (defn examples-block
   [subject object possessive-determiner possessive-pronoun reflexive]
-  (let [sub-obj (str subject "/" object)
-        header-str (str "Here are some usage examples for my "
+  (let [sub-obj (s/join "/" [subject object])
+        header-str (str "Here are some example sentences using my "
                         sub-obj
-                        " pronouns")]
+                        " pronouns:")]
     [:div {:class "section examples"}
      [:h2 header-str]
      [:p (subject-example subject)
@@ -81,7 +91,8 @@
    [:p "Full usage: "
        [:tt "http://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"]
        " displays examples of your pronouns."]
-   [:p "This is a bit unwieldy. If we have a good guess we'll let you use just the first one or two."]])
+   [:p "This is a bit unwieldy. If we have a good guess we'll let you use"
+       " just the first one or two."]])

 (defn contact-block []
   (let [twitter-name (fn [handle] (href (str "https://www.twitter.com/" handle)
@@ -102,7 +113,8 @@

 (defn format-pronoun-examples
   [pronoun-declensions]
-  (let [title "Pronoun Island: English Language Examples"]
+  (let [sub-objs (map #(s/join "/" (take 2 %)) pronoun-declensions)
+        title (str "Pronoun Island: " (prose-comma-list sub-objs) " examples")]
     (html
      [:html
       [:head


Handle lein 2.7.0 get-dependencies arity change

--- src/lein_voom/plugin.clj
+++ src/lein_voom/plugin.clj
@@ -1,5 +1,6 @@
 (ns lein-voom.plugin
   (:require [leiningen.core.classpath :as lcp]
+            [leiningen.core.main :as lcm]
             [leiningen.voom :as voom]
             [robert.hooke :as hooke])
   (:import [java.io File]))
@@ -13,6 +14,14 @@
   ;; can't mapcat here since :checkout-deps-shares points to vectors and strings
   (flatten (map #(% dep-project) (:checkout-deps-shares project))))

+(defn- get-project-dependencies
+  "Wrapper for leiningen.core.classpath/get-dependencies
+   that handles the API change between lein 2.6 and 2.7"
+  [project]
+  (if (lcm/version-satisfies? (lcm/leiningen-version) "2.7.0")
+    (lcp/get-dependencies :dependencies nil project)
+    (lcp/get-dependencies :dependencies project)))
+
 (defn checkout-deps-paths
   "Checkout dependencies are used to place source for a dependency
   project directly on the classpath rather than having to install the
@@ -21,7 +30,7 @@
   (->
    (when-let [f  (voom/find-box)]
      (apply concat
-            (for [[d & _] (keys (lcp/get-dependencies :dependencies project))
+            (for [[d & _] (keys (get-project-dependencies project))
                   :let [dep-name (str (or (namespace d) (name d)) "--" (name d))
                         proj-path (voom/adj-path f dep-name "project.clj")]
                   :when (.isFile proj-path)


Block seq should return MapEntrys.

Block seq should return MapEntrys.

--- src/blocks/data.clj
+++ src/blocks/data.clj
@@ -135,7 +135,9 @@

   (seq
     [this]
-    (seq (concat [[:id id] [:size size]] _attrs)))
+    (seq (concat [(clojure.lang.MapEntry. :id id)
+                  (clojure.lang.MapEntry. :size size)]
+                 _attrs)))

   (iterator
     [this]


Pass IRubyObjects and RaiseExceptions through the ->ruby interface.

--- src/circle/ruby.clj
+++ src/circle/ruby.clj
@@ -76,6 +76,15 @@
 (defmethod ->ruby
   clojure.lang.Keyword [k]
   (RubySymbol/newSymbol (ruby) (name k)))
+
+(defmethod ->ruby
+  org.jruby.runtime.builtin.IRubyObject [e]
+  e)
+
+;; RaiseException wraps an exception for Java, but isn't an IRubyObject.
+(defmethod ->ruby
+  org.jruby.exceptions.RaiseException [e]
+  (.getException e))

 (defmethod ->ruby
   clojure.lang.Sequential [v]


fix typo

fix typo

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2165,21 +2165,20 @@
    "warn" {:synsem {:cat :verb
                      :sem {:pred :warn}}}

-   ;; TODO: rename {:pred :wash} to {:pred :wash-oneself} and add non-reflexive "wash" with {:pred :wash}.
-   "wash" {:synsem {:cat :verb
+   "wash" [;; 1. non-reflexive
+           {:synsem {:cat :verb
                      :sem {:pred :wash}}}
-
-
-   "wash" (let [subject-semantics (atom :top)]
-            {:synsem {:cat :verb
-                      :sem {:pred :wash-oneself
-                            :reflexive true
-                            :subj subject-semantics
-                            :obj subject-semantics}
-                      :subcat {:1 {:sem subject-semantics}
-                               :2 {:pronoun true
-                                   :reflexive true
-                                   :sem subject-semantics}}}})
+           ;; 2. reflexive
+           (let [subject-semantics (atom :top)]
+             {:synsem {:cat :verb
+                       :sem {:pred :wash-oneself
+                             :reflexive true
+                             :subj subject-semantics
+                             :obj subject-semantics}
+                       :subcat {:1 {:sem subject-semantics}
+                                :2 {:pronoun true
+                                    :reflexive true
+                                    :sem subject-semantics}}}})]
    "waste" {:synsem {:cat :verb
                 :sem {:pred :waste}}}


+go around

+go around

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -817,6 +817,16 @@
              :subcat {:2 {:cat :prep}}}
     :english {:past "went"}}

+   "go around"
+   {:synsem {:cat :verb
+             :sem {:activity true
+                   :discrete false
+                   :pred :go-around}
+             :subcat {:2 '()}}
+    :english {:past "went around"
+              :participle "going around"
+              :present {:3sing "goes around"}}}
+
    "go downstairs"
    {:synsem {:cat :verb
              :sem {:activity true


added s'endormir

added s'endormir

--- src/babel/francais/lexicon.clj
+++ src/babel/francais/lexicon.clj
@@ -495,6 +495,22 @@
 ;                                       :pronoun true
 ;                                       :reflexive true
 ;                                       :sem subject-semantics}}}})
+
+  "s'endormir" (let [subject-semantics (ref {:human true})
+                    subject-agr (ref :top)]
+                {:synsem {:cat :verb
+                          :essere true
+                          :sem {:pred :fall-asleep
+                                :reflexive true
+                                :subj subject-semantics
+                                :obj subject-semantics}
+                          :subcat {:1 {:agr subject-agr
+                                       :sem subject-semantics}
+                                   :2 {:agr subject-agr
+                                       :pronoun true
+                                       :reflexive true
+                                       :sem subject-semantics}}}})
+
   "soulever" {:synsem {:cat :verb
                        :sem {:pred :lift}}}


Add board-access also in the share via email request schema.

--- src/oc/storage/async/email.clj
+++ src/oc/storage/async/email.clj
@@ -21,6 +21,7 @@
    :org-logo-width (schema/maybe schema/Int)
    :org-logo-height (schema/maybe schema/Int)
    :board-name (schema/maybe schema/Str)
+   :board-access (schema/maybe schema/Str)
    :headline schema/Str
    :abstract (schema/maybe schema/Str)
    :body (schema/maybe schema/Str)
@@ -47,6 +48,7 @@
    :org-logo-width (:logo-width org)
    :org-logo-height (:logo-height org)
    :board-name (:name board)
+   :board-access (:access board)
    :headline (:headline entry)
    :abstract (:abstract entry)
    :body (:body entry)


Moved the scale into the ground function. De-generalises and simplifies a bunch of other stuff - tradeoff.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -8,34 +8,30 @@
         ms-per-beat (/ ms-per-minute beats-per-minute)]
     #(+ start (* ms-per-beat %))))

-(defn after [timing offset] #(timing (+ offset %)))
-(defn tempo [timing factor] #(timing (/ % factor)))
-(defn ground [note] (+ 60 note))
-
-(def note# (comp sampled-piano ground))
-(defn chord# [chord] (doseq [note (vals chord)] (note# note)))

 (def ionian #(let [interval (mod % 7)
                   note ([0 2 4 5 7 9 11] interval)
                   octave (quot (- % interval) 7)]
                (+ (* 12 octave) note)))

-(defn triad [scale root]
-  (zipmap [:i :iii :v]
-          [(scale root)
-           (scale (+ root 2))
-           (scale (+ root 4))]))
+(defn after [timing offset] #(timing (+ offset %)))
+(defn tempo [timing factor] #(timing (/ % factor)))
+(defn ground [note] (+ 60 (ionian note)))

-(defn lower [note] (- note 12))
-(defn raise [note] (+ note 12))
+(def note# (comp sampled-piano ground))
+(defn chord# [chord] (doseq [note (vals chord)] (note# note)))
+
+(defn triad [root] (zipmap [:i :iii :v] [root (+ root 2) (+ root 4)]))
+(defn lower [note] (- note 7))
+(defn raise [note] (+ note 7))

 (defn with-base [chord]
   (assoc chord :base
          (lower (:i chord))))

-(def I (with-base (triad ionian 0)))
-(def II (with-base (triad ionian 1)))
-(def V (with-base (triad ionian 4)))
+(def I (with-base (triad 0)))
+(def II (with-base (triad 1)))
+(def V (with-base (triad 4)))

 (def progression [I I II II II V I (update-in V [:base] lower)])

@@ -60,40 +56,40 @@
         next))))

 (defn intro# [timing]
-    (even-melody# timing (take 32 (cycle (map ionian [5 4]))))
+    (even-melody# timing (take 32 (cycle [5 4])))
     (rhythm-n-bass# timing (take 8 (cycle progression))))

 (defn first-bit# [timing]
   (-> timing
     (after -1)
     (tempo 2)
-    (even-melody# (map ionian [2 4 5 4 4 2 4]))
+    (even-melody# [2 4 5 4 4 2 4])
     (after 9)
-    (even-melody# (map ionian [-2 1 2 1 1 -2 1]))
+    (even-melody# [-2 1 2 1 1 -2 1])
     (after 9)
-    (even-melody# (map ionian [-2 1 2 1 1 -2 1 2 3 4]))
+    (even-melody# [-2 1 2 1 1 -2 1 2 3 4])
     (after 6)
-    (even-melody# (map ionian [-1 -2 -3 0 0 -3 0 1 0 -3])))
+    (even-melody# [-1 -2 -3 0 0 -3 0 1 0 -3]))
   (rhythm-n-bass# timing (take 8 (cycle progression))))

 (defn variation# [timing]
   (-> timing
     (tempo 2)
     (after 9)
-    (even-melody# (map ionian [11 11 12 9 7]))
+    (even-melody# [11 11 12 9 7])
     (after 11)
-    (even-melody# (map ionian [8 8 9 8 3]))
+    (even-melody# [8 8 9 8 3])
     (after 11)
-    (even-melody# (map ionian [8 8 9 6 4]))
+    (even-melody# [8 8 9 6 4])
     (after 11)
-    (even-melody# (map ionian [11 11 12 11 8])))
+    (even-melody# [11 11 12 11 8]))
   (first-bit# timing))

 (defn final-chord# [timing]
   (-> timing
     (after -1)
     (tempo 2)
-    (even-melody# (map ionian [11 13 14])))
+    (even-melody# [11 13 14]))
   (at (timing 0)
       (chord# (update-in I [:i] raise))))


typo in docs

typo in docs

duplicate 'is'

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -243,7 +243,7 @@

      In the absence of an explicit `signals function`, the node's input signal defaults to `app-db`
      and, as a result, the value within `app-db` (a map) is
-     is given as the 1st argument when `a-computation-fn` is called.
+     given as the 1st argument when `a-computation-fn` is called.

   **Second variation** - a signal function is explicitly supplied:


docs: fix improperly indented code block

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -282,8 +282,8 @@
   If, on the other hand, the signal function was simpler and returned a singleton, like this:

       #!clj
-     (fn [query-vec dynamic-vec]
-       (subscribe [:a-sub]))      ;; <-- returning a singleton
+      (fn [query-vec dynamic-vec]
+        (subscribe [:a-sub]))      ;; <-- returning a singleton

   then the associated computation function must be written to expect a single value
   as the 1st argument:


Revert "Change query cache from being an atom to a ratom"

This is no longer necessary, so we are reverting it.

This reverts commit 9247b1935d397ced68385d97e19d51f415a85e06.

--- src/re_frame/subs.cljc
+++ src/re_frame/subs.cljc
@@ -1,7 +1,7 @@
 (ns re-frame.subs
  (:require
    [re-frame.db        :refer [app-db]]
-   [re-frame.interop   :refer [add-on-dispose! debug-enabled? make-reaction ratom? deref? dispose! reagent-id ratom]]
+   [re-frame.interop   :refer [add-on-dispose! debug-enabled? make-reaction ratom? deref? dispose! reagent-id]]
    [re-frame.loggers   :refer [console]]
    [re-frame.utils     :refer [first-in-vector]]
    [re-frame.registrar :refer [get-handler clear-handlers register-handler]]
@@ -15,7 +15,7 @@
 ;; De-duplicate subscriptions. If two or more equal subscriptions
 ;; are concurrently active, we want only one handler running.
 ;; Two subscriptions are "equal" if their query vectors test "=".
-(def query->reaction (ratom {}))
+(def query->reaction (atom {}))

 (defn clear-subscription-cache!
   "Causes all subscriptions to be removed from the cache.


Fix bad apply in core macro

Fix bad apply in core macro

--- src/omreactpixi/core.clj
+++ src/omreactpixi/core.clj
@@ -10,7 +10,6 @@
   (let [jsname  (symbol "js" (str "ReactPIXI." (name tag)))
         cljname (symbol (clojure.string/lower-case (name tag)))]
   `(defn ~cljname [opts# & children#]
-     (.apply React.createElement
+     (apply React.createElement
              ~jsname
-             nil  ;; context (javascript this)
              (cljs.core/into-array (cons opts# children#))))))


Add additional server sync fns - server-sync and with-server-self-sync and also allow a matcher-fn in recv.

--- src/overtone/sc/core.clj
+++ src/overtone/sc/core.clj
@@ -178,11 +178,20 @@
   "Register your intent to wait for a message associated with given path to be
   received from the server. Returns a promise that will contain the message once
   it has been received. Does not block current thread (this only happens once
-  you try and look inside the promise and the reply has not yet been received)."
-  [path]
-  (let [p (promise)]
-    (on-sync-event path (uuid) #(do (deliver p %) :done))
-    p))
+  you try and look inside the promise and the reply has not yet been received).
+
+  If an optional matcher-fn is specified, will only deliver the promise when
+  the matcher-fn returns true. The matcher-fn should accept one arg which is
+  the incoming event info."
+  ([path] (recv path nil))
+  ([path matcher-fn]
+     (let [p (promise)]
+       (on-sync-event path (uuid) (fn [info]
+                                    (when (or (nil? matcher-fn)
+                                              (matcher-fn info))
+                                      (deliver p info)
+                                      :done)))
+    p)))

 (defn- parse-status [args]
   (let [[_ ugens synths groups loaded avg peak nominal actual] args]
@@ -384,6 +393,32 @@

     (let [res (action-fn)]
       (snd "/sync" id)
+      res)))
+
+(defn server-sync
+  "Send a sync message to the server with the specified id. Server will reply
+  with a synced message when all incoming messages up to the sync message have
+  been handled. See with-server-sync and on-server-sync for more typical
+  usage."
+  [id]
+  (snd "/sync" id))
+
+(defn with-server-self-sync
+  "Blocks the current thread until the action-fn explicitly sends a server sync.
+  The action-fn is assumed to have one argument which will be the unique sync id.
+  This is useful when the action-fn is itself asynchronous yet you wish to
+  synchronise with its completion. The action-fn can sync using the fn server-sync.
+  Returns the result of action-fn."
+  [action-fn]
+  (let [id (update-server-sync-id)
+        prom (promise)]
+    (on-event "/synced" (uuid)
+              (fn [msg] (when (= id (first (:args msg)))
+                         (do
+                           (deliver prom true)
+                           :done))))
+    (let [res (action-fn id)]
+      (await-promise! prom)
       res)))

 (defn with-server-sync


remove old discussion (we now support maps as args)

--- src/overtone/sc/ugen.clj
+++ src/overtone/sc/ugen.clj
@@ -28,13 +28,6 @@

 (defn- inf? [obj]
   (:infinite-sequence (meta obj)))
-
-;; Does it really make sense to cycle over the values of a collection when
-;; doing expansion?  I don't think maps should be allowed as arguments, unless
-;; this is a strategy at having named arguments, but then the ordering wouldn't
-;; make sense.
-;;(defn- cycle-vals [coll]
-;;  (cycle (if (map? coll) (vals coll) coll)))

 (defn- expandable? [arg]
   (and (coll? arg)


Try again...

Try again...

--- src/poetshelper/core.clj
+++ src/poetshelper/core.clj
@@ -110,10 +110,6 @@
     (println "Starting server on port " port)
     (httpkit/run-server poetshelper-server {:port port})))

-(defn -main [& [port]]
-  (let [port (Integer. (or port (env :port) 5000))]
-    (start-server port)))
-
 (defn -from-proc-file [$ [port]]
   (println "I'm coming from the proc file and I know about ")
   (println port))


Promote tick.interval/concurrencies to API

--- src/tick/alpha/api.clj
+++ src/tick/alpha/api.clj
@@ -301,6 +301,9 @@
   ([x & args]
    (reduce interval/concur x args)))

+(defn concurrencies [& intervals]
+  (apply interval/concurrencies intervals))
+
 ;; Divisions

 (defn divide-by [divisor t]


update to sCU

update to sCU

--- src/cambo/component.cljc
+++ src/cambo/component.cljc
@@ -205,9 +205,12 @@
                        :or {initial-variables {} prepare-variables default-prepare-variables}}]
            (let [container (fn container []
                              (this-as this
-                               ;; TODO: state!
+                               (.apply js/React.Component this (js-arguments))
                                (set! (.-mounted this) true)
-                               (.apply js/React.Component this (js-arguments))
+                               (set! (.-state this) (->state {:query-data nil
+                                                              :variables nil
+                                                              ;; TODO: add set-variables functionality
+                                                              :cambo/prop {}}))
                                this))]
              (set! (.-prototype container)
                    (goog.object/clone js/React.Component.prototype))
@@ -225,15 +228,16 @@
              (specify! (.-prototype container)
                Object
                (shouldComponentUpdate [this next-props next-state next-context]
-                 ;; TODO: only care about the path of fragment props, other props deep compare
-                 ;; TODO: how do children apply here?
-                 (let [get-paths (fn [props]
-                                   (into {} (for [[k {:keys [cambo/path] :as v}] props]
-                                              [k (if path path v)])))
-                       current-props (get-paths (props this))
+                 (let [update-props (fn [props]
+                                      (reduce (fn [props key]
+                                                (let [path (get-path props key)]
+                                                  (assoc props key path)))
+                                              props
+                                              (keys fragments)))
+                       current-props (update-props (props this))
                        current-state (state this)
                        current-context (context this)
-                       next-props (get-paths (get-props next-props))
+                       next-props (update-props (get-props next-props))
                        next-state (get-state next-state)
                        next-context (get-context next-context)]
                    (or (not= current-props next-props)
@@ -246,6 +250,7 @@
                    (.update-subscription this context)
                    {:query-data (.get-query-data this props context)
                     :variables vars
+                    ;; TODO: want to merge this ...
                     :cambo/prop {:variables next-vars}}))

                (update-fragment-pointers [this props {:keys [route]} vars]


fix typo

fix typo

--- src/chat/server/sync.clj
+++ src/chat/server/sync.clj
@@ -122,7 +122,7 @@
   [{:as ev-msg :keys [event id ?data ring-req ?reply-fn send-fn]}]
   (when-let [user-id (get-in ring-req [:session :user-id])]
     (if (db/with-conn (db/user-in-group? user-id (?data :group-id)))
-      (let [data (assoc data :inviter-id user-id)
+      (let [data (assoc ?data :inviter-id user-id)
             invitation (db/with-conn (db/create-invitation! data))]
         (when-let [invited-user (db/with-conn (db/user-with-email (invitation :to)))]
           (chsk-send! (invited-user :id) [:chat/invitation-recieved invitation])))


Redo update queries

Redo update queries

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -295,15 +295,13 @@
   [m]
   [:using m])

-(def ^:private insert-order
-  {:values        1
-   :value         1
-   :values-vector 1
-   :values-seq    1
-   :using         2
-   :if-not-exists 3})
-
-(let [with-values {:timestamp #(QueryBuilder/timestamp %)
+(let [order       {:values        1
+                   :value         1
+                   :values-vector 1
+                   :values-seq    1
+                   :using         2
+                   :if-not-exists 3}
+      with-values {:timestamp #(QueryBuilder/timestamp %)
                    :ttl       #(QueryBuilder/ttl %)}
       renderers
       {:value         (fn value-query [query-builder [key value]]
@@ -317,12 +315,11 @@
        :using         (fn using-query [query-builder m]
                         (doseq [[key value] m]
                           (.using query-builder ((get with-values key) value)))
-                        query-builder)
-       }]
+                        query-builder)}]
   (defn insert
     [table-name & statements]
     (->> statements
-         (sort-by #(get select-order (first %)))
+         (sort-by #(get order (first %)))
          (reduce (fn [builder [statement-name statement-args]]
                    ((get renderers statement-name) builder statement-args))
                  (QueryBuilder/insertInto (name table-name)))


Fix validations on group-type fields

Fix validations on group-type fields

--- src/braid/client/gateway/validations.cljs
+++ src/braid/client/gateway/validations.cljs
@@ -64,6 +64,6 @@

    :gateway.action.create-group/group-type
    [(fn [type cb]
-      (when (string/blank? type)
+      (if (string/blank? type)
         (cb "You need to select a group type.")
         (cb nil)))]})


Add old-recordings? fn

Add old-recordings? fn

--- src/beebster_clj/core.clj
+++ src/beebster_clj/core.clj
@@ -19,6 +19,11 @@

 (def iplayer-info
   '("get_iplayer" "-i"))
+
+(defn old-recordings?
+  "Does get-iplayer complain about recorded programmes > 30 days?"
+  [str]
+  (remove nil? (map #(re-find #"These programmes should be deleted:" %) str)))

 (defn get-info
   "get-iplayer info for entered index"


tesser working well

tesser working well

--- src/blx/sortable/core.clj
+++ src/blx/sortable/core.clj
@@ -32,6 +32,11 @@

 ; Result :: {:product_name str
 ;            :listings [Listing]}
+
+
+; TODO
+; listing manufacturer "Eastman Kodak Company"
+

 (defn- parse-json
   "Parses a JSON string, keywordizing keys."
@@ -162,34 +167,6 @@
                 identity)
           listings)))

-(p/defnp t-match [products listings]
-  (let [manufacturer-matcher (make-manufacturer-matcher products manufacturer-matchers)
-        title-matchers (map-vals make-title-matcher products)]
-    (->> (t/group-by (comp :product_name #(match-listing manufacturer-matcher title-matchers %)))
-         (t/fold {:reducer #(update %1 :listings conj %2)
-                  :reducer-identity (constantly {:listings []})
-                  :combiner conj
-                  :combiner-identity (constantly [])})
-         (t/tesser (t/chunk 1024 listings))
-         (pmap (fn [[prod m]]
-                (assoc m :product_name prod))))))
-
-(p/defnp r-match [products listings]
-  (let [manufacturer-matcher (make-manufacturer-matcher products manufacturer-matchers)
-        title-matchers (map-vals make-title-matcher products)
-        reducef (fn ([] {})
-                  ([m [listing prod]]
-                   (assoc m prod
-                          (-> m
-                              (get prod {:product_name prod
-                                         :listings []})
-                              (update :listings conj listing)))))]
-    (->> listings
-         (r/map (juxt identity (comp :product_name #(match-listing manufacturer-matcher title-matchers %))))
-         (into []))))
-;         (r/fold reducef)
-;         vals)))
-
 (p/defnp group-matches [matches]
   (let [product first
         listing second]
@@ -200,6 +177,25 @@
                   {:product_name (:product_name prod)
                    :listings (map listing matching-listings)}
                   matching-listings))))))
+
+(p/defnp t-match [products listings]
+  (let [manufacturer-matcher (make-manufacturer-matcher products manufacturer-matchers)
+        title-matchers (map-vals make-title-matcher products)]
+    (->> (t/map parse-json)
+         (t/fold {:reducer (fn [m l]
+                             (let [prod-name
+                                   (->> l
+                                        (match-listing manufacturer-matcher title-matchers)
+                                        :product_name)]
+                               (update m prod-name conj l)))
+                  :reducer-identity (constantly {})
+                  :combiner (fn [acc m]
+                              (merge-with (partial apply conj) acc m))
+                  :combiner-identity (constantly {})
+                  :post-combiner (partial map (fn [[prod-name ls]]
+                                                {:product_name prod-name
+                                                 :listings ls}))})
+         (t/tesser (t/chunk 1024 listings)))))

 (defn -main
   [& args]
@@ -212,13 +208,9 @@
     (with-open [listings (io/reader (:listings-uri conf))
                 out      (io/writer (:out-uri conf))]
       (doseq [result-item (->> (line-seq listings)
-                               (mapv parse-json)
+                               ;(mapv parse-json)
+                               ;(iota/seq (:listings-uri conf))
                                (t-match products))]
-                               ;(iota/seq (:listings-uri conf))
-                               ;(r/map (fn [s] (let [z (parse-json s)]
-                               ;                 (println z)
-                               ;                 z)))
-                               ;(r-match products))]
                                ;(match-all products)
                                ;group-matches)]
         (json/generate-stream result-item out)


fixing ip key

fixing ip key

--- src/celestial/dnsmasq.clj
+++ src/celestial/dnsmasq.clj
@@ -11,15 +11,15 @@
 (def restart
   (step :restart-service "sudo service dnsmasq stop" "sudo service dnsmasq start"))

-(defn add-host [{:keys [hostname ip_address dnsmasq]}]
+(defn add-host [{:keys [hostname ip dnsmasq]}]
   (execute dnsmasq
-      (step :add-host (<< "echo '~{ip_address} ~{hostname}' | sudo tee -a /etc/hosts >> /dev/null" ))
+      (step :add-host (<< "echo '~{ip} ~{hostname}' | sudo tee -a /etc/hosts >> /dev/null" ))
       (ignore-code restart)))

-(defn remove-host [{:keys [hostname ip_address dnsmasq]}]
+(defn remove-host [{:keys [hostname ip dnsmasq]}]
   (execute dnsmasq
-    (step :remove-host (<< "sudo sed -ie \"\\|^~{ip_address} ~{hostname}\\$|d\" /etc/hosts"))
+    (step :remove-host (<< "sudo sed -ie \"\\|^~{ip} ~{hostname}\\$|d\" /etc/hosts"))
     (ignore-code restart)))

 ; (add-host "foo" "192.168.20.90")


adding struct ctor

adding struct ctor

--- src/celestial/swagger.clj
+++ src/celestial/swagger.clj
@@ -10,26 +10,36 @@
    (:require
      [compojure.route :as route]))

+(defmacro defstruct- [name & ks]
+  "A struct def that creates a constructor in the form of sname-"
+ `(do
+   (defstruct ~name ~@ks)
+   (defn ~(symbol (str name "-")) [& k#] (apply struct ~name k# ))))
+
 (def base "http://localhost:8082/")

-(defstruct base-swag :apiVersion :swaggerVersion :basepath)
+(defstruct- base-swag :apiVersion :swaggerVersion :basepath)

-(defstruct resource-listing :apiVersion :swaggerVersion :basepath :apis)
+(defstruct- resource-listing :apiVersion :swaggerVersion :basepath :apis)

-(defstruct api-decleration  :apiVersion :swaggerVersion :basepath :resourcePath :apis :models)
+(defstruct- api-decleration  :apiVersion :swaggerVersion :basepath :resourcePath :apis :models)

-(defstruct bare-api :path :description)
+(defstruct- bare-api :path :description)

-(defstruct api :path :description :operations)
+(defstruct- api :path :description :operations)

-(defstruct operation :httpMethod :nickname :responseClass :parameters :summary :notes :errorResponses)
+(defstruct- operation :httpMethod :nickname :responseClass :parameters :summary :notes :errorResponses)

-(defstruct parameter :paramType :name :description :dataType :required :allowableValues :allowMultiple)
+(defstruct- parameter :paramType :name :description :dataType :required :allowableValues :allowMultiple)
+
+(defstruct- model :id :properties)
+
+(defstruct- property :name :type :description)

 (def ^{:doc "see https://github.com/wordnik/swagger-core/wiki/Datatypes"}
   primitives #{:byte :boolean :int :long :float :double :string :Date})

-(def resource-listing-data (atom (struct resource-listing)))
+(def resource-listing-data (atom (resource-listing-)))

 (def apis (atom {}))

@@ -41,13 +51,13 @@

 (defn create-params [path args]
-  (let [defaults (struct parameter nil nil nil "String" true nil false) ]
+  (let [defaults (parameter- nil nil nil "String" true nil false) ]
     (mapv
       #(-> % meta
            (merge defaults {:name (str %)} (guess-type path %))) args)))

 (defn create-op [desc verb params]
-  (merge (struct operation) desc {:parameters params :httpMethod verb}))
+  (merge (operation-) desc {:parameters params :httpMethod verb}))

 (defn swag-path [path]
   "Converts compojure params to swagger params notation"
@@ -57,7 +67,7 @@
   "Creates a swagger enabled http route with a given verb"
   [verb path args desc & body]
   `(with-meta (~verb ~path ~args ~@body)
-      (struct api ~(swag-path path) "THis should be taken from defroute!"
+      (api- ~(swag-path path) "THis should be taken from defroute!"
            [(create-op ~desc (-> ~verb var meta :name) ~(create-params path args))])))

 (defmacro GET-
@@ -78,7 +88,7 @@
 (defn create-api [name & routes]
   (let [_apis (filterv identity (map meta (rest routes)))]
     (swap! apis assoc (keyword name)
-           (struct api-decleration "0.1" "1.1" (<< "~{base}api") (<< "/~{name}") (combine-apis _apis) []))))
+           (api-decleration- "0.1" "1.1" (<< "~{base}api") (<< "/~{name}") (combine-apis _apis) []))))

 (defmacro defroutes-
   "A swagger enabled defroute"
@@ -97,9 +107,9 @@
    )

 (def celetial-listing
-  (struct resource-listing "0.1" "1.1" base
-          [(struct bare-api "/api/jobs" "Job scheduling operations")
-           (struct bare-api "/api/hosts" "Hosts operations")]))
+  (resource-listing- "0.1" "1.1" base
+          [(bare-api- "/api/jobs" "Job scheduling operations")
+           (bare-api- "/api/hosts" "Hosts operations")]))

 (defroutes api-declerations
   (GET "/hosts" [] {:body (@apis :hosts)})


Revert "Bind cheshire.generate/*date-format* to ISO-8601 date format"

This reverts commit af95a5f8845c5e12c2bb4b480463777421772329.

--- src/cheshire/generate.clj
+++ src/cheshire/generate.clj
@@ -8,7 +8,7 @@
            (clojure.lang IPersistentCollection Keyword Ratio Symbol)))

 ;; date format rebound for custom encoding
-(def ^{:dynamic true :private true} *date-format* "yyyy-MM-dd'T'HH:mm:ssZ")
+(def ^{:dynamic true :private true} *date-format*)

 (defmacro tag
   ([obj]


* src/clj/cljs/compiler.clj: support protocol type hint

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -703,8 +703,9 @@
                  (and protocol tag
                       (or *cljs-static-fns*
                           (:protocol-inline env))
-                      (when-let [ps (:protocols (resolve-existing-var (dissoc env :locals) tag))]
-                        (ps protocol))))
+                      (or (= protocol tag)
+                          (when-let [ps (:protocols (resolve-existing-var (dissoc env :locals) tag))]
+                            (ps protocol)))))
         opt-not? (and (= (:name info) 'cljs.core/not)
                       (= (infer-tag (first (:args expr))) 'boolean))
         ns (:ns info)


* src/clj/cljs/compiler.clj: add *loop-lets* dynamic var for tracking let bindings in loops

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -391,10 +391,12 @@
                (println "})()"))))

 (defmethod emit :fn
-  [{:keys [name env methods max-fixed-arity variadic recur-frames]}]
+  [{:keys [name env methods max-fixed-arity variadic recur-frames loop-lets]}]
   ;;fn statements get erased, serve no purpose and can pollute scope if named
   (when-not (= :statement (:context env))
-    (let [loop-locals (seq (mapcat :names (filter #(and % @(:flag %)) recur-frames)))]
+    (let [loop-locals (seq (concat
+                            (mapcat :names (filter #(and % @(:flag %)) recur-frames))
+                            (mapcat :name loop-lets)))]
       (when loop-locals
         (when (= :return (:context env))
             (print "return "))
@@ -586,6 +588,7 @@
 (def specials '#{if def fn* do let* loop* throw try* recur new set! ns deftype* defrecord* . js* & quote})

 (def ^:dynamic *recur-frames* nil)
+(def ^:dynamic *loop-lets* nil)

 (defmacro disallowing-recur [& body]
   `(binding [*recur-frames* (cons nil *recur-frames*)] ~@body))
@@ -720,7 +723,8 @@
         max-fixed-arity (apply max (map :max-fixed-arity methods))
         variadic (boolean (some :variadic methods))]
     ;;todo - validate unique arities, at most one variadic, variadic takes max required args
-    {:env env :op :fn :name mname :methods methods :variadic variadic :recur-frames *recur-frames*
+    {:env env :op :fn :name mname :methods methods :variadic variadic
+     :recur-frames *recur-frames* :loop-lets *loop-lets*
      :jsdoc [(when variadic "@param {...*} var_args")]
      :max-fixed-arity max-fixed-arity}))

@@ -748,7 +752,10 @@
              [bes env])))
         recur-frame (when is-loop {:names (vec (map :name bes)) :flag (atom nil)})
         {:keys [statements ret children]}
-        (binding [*recur-frames* (if recur-frame (cons recur-frame *recur-frames*) *recur-frames*)]
+        (binding [*recur-frames* (if recur-frame (cons recur-frame *recur-frames*) *recur-frames*)
+                  *loop-lets* (cond
+                               is-loop ()
+                               *loop-lets* (cons {:names (vec (map :name bes))} *loop-lets*))]
           (analyze-block (assoc env :context (if (= :expr context) :return context)) exprs))]
     {:env encl-env :op :let :loop is-loop
      :bindings bes :statements statements :ret ret :form form :children (into [children] (map :init bes))}))


fix build, remove references to ui2 which we just removed

--- src/clj/lambdacd/core.clj
+++ src/clj/lambdacd/core.clj
@@ -4,7 +4,6 @@
             [clojure.core.async :as async]
             [lambdacd.internal.execution :as execution]
             [lambdacd.internal.pipeline-state :as pipeline-state]
-            [lambdacd.ui.new_ui :as new-ui]
             [compojure.route :as route]
             [ring.util.response :as resp]))

@@ -26,7 +25,6 @@
 (defn- mk-complete-route [pipline-def state ctx]
   (routes
     (context "/old" [] (server/ui-for pipline-def state ctx))
-    (context "/ui2" [] (new-ui/new-ui-routes pipline-def state))
     (GET "/" [] (resp/redirect "old/"))
     (route/resources "/")
     (route/not-found "
Page not found
")))


Document that stringify-breakend may return nil

--- src/cljam/io/vcf/util.clj
+++ src/cljam/io/vcf/util.clj
@@ -275,7 +275,8 @@
         {:bases bases, :join (if pre-dot :before :after)}))))

 (defn stringify-breakend
-  "Returns a string representation of a breakend."
+  "Returns a string representation of a breakend. If the input is malformed,
+  returns `nil`. See the docstring of `parse-breakend` for the format."
   [{:keys [chr pos strand join] s :bases}]
   (when (and (not-empty s) (#{:before :after} join))
     (if (and chr pos (#{:forward :reverse} strand))


Better error message whenever fid-map has a nil value

--- src/cljs/dato/lib/db.cljs
+++ src/cljs/dato/lib/db.cljs
@@ -159,7 +159,7 @@
 (defn prep-broadcastable-tx-report [tx-report]
   (let [fids    (fid-map tx-report)
         tx-guid (d/squuid)]
-    (assert (every? identity (vals fids)) (str "Missing fid value in " (pr-str fids)))
+    (assert (every? identity (vals fids)) (str "Missing guid value in broadcast tx-report: " (pr-str fids) " - did you forget to add a :dato/guid to a new entity?"))
     (def l-tx-report tx-report)
     ;; We're broadcasting this, so we need to track the fids for the
     ;; lifetime of this db


Nav Code Cleanup

Nav Code Cleanup

--- src/cljs/lens/navbar.cljs
+++ src/cljs/lens/navbar.cljs
@@ -9,11 +9,6 @@

 ;; ---- Nav -------------------------------------------------------------------

-(defcomponent nav-item [item owner]
-  (render [_]
-    (d/li (when (:active item) {:class "active"})
-      (d/a {:href "#" :on-click (h ((:handler item) owner))} (:name item)))))
-
 (defcomponent undo-nav-item [_ owner]
   (will-mount [_]
     (bus/listen-on owner :undo-enabled #(om/set-state! owner :enabled %)))
@@ -24,11 +19,16 @@
       (d/a {:href "#" :title "Undo"
             :on-click (h (bus/publish! owner :undo {}))} (fa/span :undo)))))

+(defcomponent nav-item [item owner]
+  (render [_]
+    (d/li (when (:active item) {:class "active"})
+      (d/a {:href "#" :on-click (h ((:handler item) owner))} (:name item)))))
+
 (defcomponent nav [nav]
   (render [_]
-    (apply d/ul {:class "nav navbar-nav"}
-           (om/build undo-nav-item (:undo-nav-item nav))
-           (om/build-all nav-item (:items nav)))))
+    (d/ul {:class "nav navbar-nav"}
+      (om/build undo-nav-item (:undo-nav-item nav))
+      (om/build-all nav-item (:items nav)))))

 ;; ---- Sign In/Out -----------------------------------------------------------


drop logging

drop logging

--- src/cljs/mpd/enemies.cljs
+++ src/cljs/mpd/enemies.cljs
@@ -9,6 +9,5 @@
 (defn setup []
   (log "  enemies")
   (fn [state]
-    (log @enemies)
     (swap! state assoc :enemies @enemies)
     state))


use repos-dir config

use repos-dir config

--- src/cljs_api_gen/goog.clj
+++ src/cljs_api_gen/goog.clj
@@ -3,9 +3,10 @@
     [clojure.pprint :refer [pprint]]
     [clojure.java.shell :refer [sh]]
     [clojure.java.io :as io]
-    [clojure.string :as str]))
+    [clojure.string :as str]
+    [cljs-api-gen.config :refer [repos-dir]]))

-(def goog-dir "repos/closure-library")
+(def goog-dir (str repos-dir "/closure-library"))

 (defn goog-ns-class? [n]
   (not= n (str/lower-case n)))