add cli opt for closure check

add cli opt for closure check

--- src/main/shadow/cljs/devtools/cli.clj
+++ src/main/shadow/cljs/devtools/cli.clj
@@ -21,6 +21,7 @@
    [nil "--once" "compile once and exit"]
    [nil "--release" "compile in release mode and exit"]
    [nil "--debug" "debug mode, useful in combo with --release (pseudo-names, source-map)"]
+   [nil "--check" "run sources through closure compiler type checks"]
    [nil "--npm" "run in npm compatibility mode"]
    [nil "--runtime TARGET" "(npm-only) node or browser"
     :parse-fn keyword
@@ -48,13 +49,16 @@

       ;; specific build
       (:build options)
-      (let [{:keys [build dev once release]} options]
+      (let [{:keys [check build dev once release]} options]
         (cond
           release
           (api/release build options)

           once
           (api/once build options)
+
+          check
+          (api/check build)

           :else
           (api/dev build (merge default-opts options))


Story ID: RPC-236 Summary: fixed terminal reporting for message & extra

--- src/untangled_spec/reporters/terminal.clj
+++ src/untangled_spec/reporters/terminal.clj
@@ -33,7 +33,7 @@
     (clojure.string/split s #"\n")
     (apply str (interpose (str "\n" (pad " " (inc (* 2 n)))) s))))

-(defn print-test-result [{:keys [message where status actual expected assertion throwable]} print-fn print-level]
+(defn print-test-result [{:keys [message where status actual expected extra throwable]} print-fn print-level]
   (print-fn)
   (print-fn (c/white (if (= status :error)
                        "Error" "Failed") " in " where))
@@ -41,10 +41,10 @@
              (instance? Throwable actual))
     (print-throwable actual))
   (when throwable (print-throwable throwable))
-  (when assertion (print-fn (c/magenta "ASSERTION:") assertion))
+  (when message (print-fn (c/magenta "ASSERTION:") message))
   (print-fn (c/cyan "expected:") (pretty-str expected (+ 5 print-level)))
   (print-fn (c/red "  actual:") (pretty-str actual (+ 5 print-level)))
-  (when message (print-fn (c/yellow " message:") message))
+  (when extra (print-fn (c/yellow "   extra:") extra))
   (when true ;TODO: -> env/cfg
     (throw (ex-info "" {::stop? true}))))


Add first simple output handling to main method.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -22,11 +22,24 @@
 (defn -main [& args]
   (println "Starting dsbdp main...")
   (let [in-cntr (Counter.)
+        out-cntr (Counter.)
         delta-cntr (delta-counter)
         stats-fn (fn []
                    (println
-                     "in:" (long (/ (delta-cntr :in (.value in-cntr)) 1000)) "k;"))
-        in-loop (ProcessingLoop. (fn [] (.inc in-cntr)))]
+                     "in:" (long (/ (delta-cntr :in (.value in-cntr)) 1000)) "k;"
+                     "out:" (long (/ (delta-cntr :out (.value out-cntr)) 1000)) "k;"))
+        out-fn (fn [_ _]
+                 (.inc out-cntr))
+        in-data 1
+        proc-fns [(fn [i _] (inc i)) (fn [_ o] (inc o))]
+        pipeline (create-local-processing-pipeline
+                   proc-fns
+                   out-fn)
+        in-fn (get-in-fn pipeline)
+        in-loop (ProcessingLoop.
+                  (fn []
+                    (in-fn in-data)
+                    (.inc in-cntr)))]
     (.start in-loop)
     (run-repeat (executor) stats-fn 1000)))


tidy ugen metadata

tidy ugen metadata

--- src/overtone/sc/machinery/ugen/metadata/beq_suite.clj
+++ src/overtone/sc/machinery/ugen/metadata/beq_suite.clj
@@ -7,75 +7,160 @@
   [

    {:name "BLowPass",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "cutoff frequency"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "cutoff frequency"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "12db/oct rolloff - 2nd order resonant Low Pass Filter based on the Second Order Section (SOS) biquad UGen"}
+    :doc "12db/oct rolloff - 2nd order resonant Low Pass Filter based on
+          the Second Order Section (SOS) biquad UGen"}

    {:name "BHiPass",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "cutoff frequency"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q. bandwidth / cutoffFreq"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "cutoff frequency"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q. bandwidth / cutoffFreq"}]
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "12db/oct rolloff - 2nd order resonant  Hi Pass Filter based on the Second Order Section (SOS) biquad UGen."}
+    :doc "12db/oct rolloff - 2nd order resonant Hi Pass Filter based on
+          the Second Order Section (SOS) biquad UGen." }

    {:name "BAllPass",
-    :args [{:name "in" :doc "input signal to be processed."}
-           {:name "freq", :default 1200.0 :doc "center frequency."}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq."}],
+    :args [{:name "in"
+            :doc "input signal to be processed."}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "center frequency."}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq."}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "All pass filter based on the Second Order Section (SOS) biquad UGen"}
+    :doc "All pass filter based on the Second Order Section (SOS) biquad
+          UGen"}

    {:name "BBandPass",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "center frequency"}
-           {:name "bw", :default 1.0 :doc "the bandwidth in octaves between -3 dB frequencies"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0 :doc "center frequency"}
+
+           {:name "bw"
+            :default 1.0
+            :doc "the bandwidth in octaves between -3 dB frequencies"}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "Band pass filter based on the Second Order Section (SOS) biquad UGen"}
+    :doc "Band pass filter based on the Second Order Section (SOS)
+          biquad UGen"}

    {:name "BBandStop",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "center frequency"}
-           {:name "bw", :default 1.0 :doc "the bandwidth in octaves between -3 dB frequencies"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "center frequency"}
+
+           {:name "bw"
+            :default 1.0
+            :doc "the bandwidth in octaves between -3 dB frequencies"}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "Band reject filter based on the Second Order Section (SOS) biquad UGen"}
+    :doc "Band reject filter based on the Second Order Section (SOS)
+          biquad UGen"}

    {:name "BPeakEQ",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "center frequency"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}
-           {:name "db", :default 0.0 :doc "boost/cut the center frequency (in dBs)"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "center frequency"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}
+
+           {:name "db"
+            :default 0.0
+            :doc "boost/cut the center frequency (in dBs)"}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
-    :doc "Parametric equalizer based on the Second Order Section (SOS) biquad UGen"}
+    :doc "Parametric equalizer based on the Second Order Section (SOS)
+          biquad UGen"}

    {:name "BLowShelf",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "center frequency"}
-           {:name "rs", :default 1.0 :doc "the reciprocal of S.  Shell boost/cut slope. When S = 1, the shelf slope is as steep as it can be and remain monotonically increasing or decreasing gain with frequency.  The shelf slope, in  dB/octave, remains proportional to S for all other values for a fixed freq/SampleRate.ir and db."}
-           {:name "db", :default 0.0 :doc "gain. boost/cut the center frequency in dBs"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "center frequency"}
+
+           {:name "rs"
+            :default 1.0
+            :doc "the reciprocal of S.  Shell boost/cut slope. When S =
+                  1, the shelf slope is as steep as it can be and remain
+                  monotonically increasing or decreasing gain with
+                  frequency.  The shelf slope, in dB/octave, remains
+                  proportional to S for all other values for a fixed
+                  freq/SampleRate.ir and db." }
+
+           {:name "db"
+            :default 0.0
+            :doc "gain. boost/cut the center frequency in dBs"}]
+
     :rates #{:ar}
     :check (nth-input-stream? 0)
     :doc "Low shelf based on the Second Order Section (SOS) biquad UGen"}

    {:name "BHiShelf",
-    :args [{:name "in" :doc "input signal to be processed"}
-           {:name "freq", :default 1200.0 :doc "center frequency"}
-           {:name "rs", :default 1.0 :doc "the reciprocal of S.  Shell boost/cut slope. When S = 1, the shelf slope is as steep as it can be and remain monotonically increasing or decreasing gain with frequency.  The shelf slope, in  dB/octave, remains proportional to S for all other values for a fixed freq/SampleRate.ir and db."}
-           {:name "db", :default 0.0 :doc "gain. boost/cut the center frequency in dBs"}],
+    :args [{:name "in"
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 1200.0
+            :doc "center frequency"}
+
+           {:name "rs"
+            :default 1.0
+            :doc "the reciprocal of S.  Shell boost/cut slope. When S =
+                  1, the shelf slope is as steep as it can be and remain
+                  monotonically increasing or decreasing gain with
+                  frequency.  The shelf slope, in dB/octave, remains
+                  proportional to S for all other values for a fixed
+                  freq/SampleRate.ir and db." }
+           {:name "db"
+            :default 0.0
+            :doc "gain. boost/cut the center frequency in dBs"}],
     :rates #{:ar}
     :check (nth-input-stream? 0)
     :doc "Hi shelfbased on the Second Order Section (SOS) biquad UGen"}])


Cosmetic

Cosmetic

--- test/onyx/coordinator/simulation_test.clj
+++ test/onyx/coordinator/simulation_test.clj
@@ -214,7 +214,7 @@
   (with-system
     (fn [coordinator sync log]
       (let [peer-node (extensions/create sync :peer)
-            payload-node (extensions/create sync :payload)
+            in-payload-node (extensions/create sync :payload)
             sync-spy (chan 1)
             ack-ch-spy (chan 1)
             offer-ch-spy (chan 1)
@@ -240,8 +240,8 @@
         (tap (:offer-mult coordinator) offer-ch-spy)
         (tap (:completion-mult coordinator) completion-ch-spy)

-        (extensions/write-place sync peer-node payload-node)
-        (extensions/on-change sync payload-node #(>!! sync-spy %))
+        (extensions/write-place sync peer-node in-payload-node)
+        (extensions/on-change sync in-payload-node #(>!! sync-spy %))

         (>!! (:born-peer-ch-head coordinator) peer-node)
         (>!! (:planning-ch-head coordinator)
@@ -253,11 +253,11 @@

         (testing "The payload node is populated"
           (let [event (<!! sync-spy)]
-            (is (= (:path event) payload-node))))
+            (is (= (:path event) in-payload-node))))

         (let [db (d/db (:conn log))]
           (testing "It receives the :in task"
-            (let [task (:task (extensions/read-place sync payload-node))
+            (let [task (:task (extensions/read-place sync in-payload-node))
                   query '[:find ?task :where [?task :task/name :in]]]
               (is (= (:db/id task) (ffirst (d/q query db))))))

@@ -269,13 +269,13 @@
               (is (= (count (d/q query db)) 1))))

           (testing "The payload node contains the other node paths"
-            (let [nodes (:nodes (extensions/read-place sync payload-node))]
+            (let [nodes (:nodes (extensions/read-place sync in-payload-node))]
               (is (= (clojure.set/difference (into #{} (keys nodes))
                                              #{:payload :ack :completion :status})
                      #{})))))

         (testing "Touching the ack node triggers the callback"
-          (let [nodes (:nodes (extensions/read-place sync payload-node))]
+          (let [nodes (:nodes (extensions/read-place sync in-payload-node))]
             (extensions/touch-place sync (:ack nodes))
             (let [event (<!! ack-ch-spy)]
               (= (:path event) (:ack nodes)))))
@@ -285,7 +285,7 @@
           (extensions/on-change sync inc-payload-node #(>!! sync-spy %))

           (testing "Touching the completion node triggers the callback"
-            (let [nodes (:nodes (extensions/read-place sync payload-node))]
+            (let [nodes (:nodes (extensions/read-place sync in-payload-node))]
               (extensions/touch-place sync (:completion nodes))
               (let [event (<!! completion-ch-spy)]
                 (= (:path event) (:completion nodes)))))


Fixed problem with return not being added before the '.end method'

--- src/ralang/gen.clj
+++ src/ralang/gen.clj
@@ -94,6 +94,8 @@

 (defn genEndMethod
   "Generates a end method." []
+  (cond
+    (not (.contains lastWritten "return")) (do (genReturn output1 nil) (genReturn output1 "")))
   (write output1 ".end method"))

 (defn genFunction


Server triggers work on multiple tables

Server triggers work on multiple tables

This is good! :)

--- src/webapp/framework/client/components/main_view.cljs
+++ src/webapp/framework/client/components/main_view.cljs
@@ -34,7 +34,6 @@

                               :onKeyDown  (fn [e]
                                              (do
-;                                               (js/alert (pr-str (.-keyCode e  )))
                                                    (if (= (.-keyCode e  ) 13)
                                                              (go
                                                                  ;(js/alert (read-ui  app [:newitem2]))
@@ -69,7 +68,11 @@
                                                     (inline  "10%" (str (<-- :id)))
                                                     (inline  "90%" (str (<-- :item)))))

-
+                                  (realtime select id,user_name from users
+                                                  {}
+                                                  (container
+                                                    (inline  "10%" (str (<-- :id)))
+                                                    (inline  "90%" (str (<-- :user_name)))))

                                   (div {:style {:padding "20px" :backgoundColor "white"}})


Add find-doc and clarify example naming

Add find-doc and clarify example naming

--- src/reply/main.clj
+++ src/reply/main.clj
@@ -45,9 +45,10 @@

   (println "Clojure" (clojure-version))
   (println "Exit:    Control+D")
-  (println "Docs:    (doc function-name)")
-  (println "Javadoc: (javadoc java-object-or-class)")
-  (println "Source:  (source function-name)")
+  (println "Docs:    (doc function-name-here)")
+  (println "         (find-doc \"part-of-name-here\")")
+  (println "Javadoc: (javadoc java-object-or-class-here)")
+  (println "Source:  (source function-name-here)")

   (with-redefs [clojure.core/print-sequential hacks.printing/print-sequential
                 complete/resolve-class hacks.complete/resolve-class]


Adds multiinsertR and multiinsertL

Adds multiinsertR and multiinsertL

--- src/the_little_clojurian/chapter3.clj
+++ src/the_little_clojurian/chapter3.clj
@@ -111,3 +111,27 @@
          '()))
   (is (= (multirember 'cup '(coffee cup tea cup and hick cup))
          '(coffee tea and hick))))
+
+(with-test
+  (def multiinsertR
+    (fn [new old lat]
+      (cond (null? lat) '()
+            (eq? (car lat) old) (cons old (cons new (multiinsertR new old (cdr lat))))
+            :else (cons (car lat) (multiinsertR new old (cdr lat))))))
+
+  (is (= (multiinsertR 'new 'old '())
+         '()))
+  (is (= (multiinsertR 'new 'old '(old socks old beer))
+         '(old new socks old new beer))))
+
+(with-test
+  (def multiinsertL
+    (fn [new old lat]
+      (cond (null? lat) '()
+            (eq? (car lat) old) (cons new (cons old (multiinsertL new old (cdr lat))))
+            :else (cons (car lat) (multiinsertL new old (cdr lat))))))
+
+  (is (= (multiinsertL 'new 'old '())
+         '()))
+  (is (= (multiinsertL 'new 'old '(old socks old beer))
+         '(new old socks new old beer))))


Core functions to play notes and chords

Core functions to play notes and chords

--- src/tenor/core.clj
+++ src/tenor/core.clj
@@ -1,6 +1,12 @@
 (ns tenor.core
   (:use [overtone.live]
-        [overtone.inst.piano]))
+        [overtone.inst.piano]
+        [tenor.constructs]))

-(defn play-chord [a-chord]
-  (doseq [note a-chord] (piano note)))
+(defn play-note [instrument note]
+ (instrument note))
+
+(defn play-chord [instrument note]
+  (doseq [note (chord (find-note-name note) (rand-nth (keys SCALE)))]
+    (play-note instrument note)))
+


Report an error for prerequisites on private fns

--- src/midje/error_handling/semi_sweet_validations.clj
+++ src/midje/error_handling/semi_sweet_validations.clj
@@ -8,7 +8,9 @@
         [midje.util.form-utils :only [fnref-var-object]]))

 (letfn [(compiler-will-inline-fn? [fnref]
-          (contains? (meta (fnref-var-object fnref)) :inline))]
+          (contains? (meta (fnref-var-object fnref)) :inline))
+        (exposed-testable? [fnref]
+          (contains? (meta (fnref-var-object fnref)) :testable))]

   (defmethod validate "fake" [[_fake_ & fake-form :as form]]
     (let [funcall (first fake-form)]
@@ -22,6 +24,11 @@
         (validation-error-report-form
           form
           (cl-format nil "You cannot override the function `~S`: it is inlined by the Clojure compiler." (first funcall)))
+
+        (exposed-testable? (first funcall))
+        (validation-error-report-form
+         form
+         "Prerequisites cannot be specified for private functions exposed with expose-testables.")

         :else
         form))))


[fix] last message preview

[fix] last message preview

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

--- src/status_im/ui/screens/home/views/inner_item.cljs
+++ src/status_im/ui/screens/home/views/inner_item.cljs
@@ -46,8 +46,6 @@
      [react/text {:style               styles/last-message-text
                   :number-of-lines     1
                   :accessibility-label :chat-message-text}
-      #_(if-let [render-recipe (:render-recipe content)]
-          (chat.utils/render-chunks render-recipe message))
       (:text content)]

      :else
@@ -112,8 +110,7 @@
          [message-timestamp timestamp]]]
        [react/view styles/item-lower-container
         (let [{:keys [tribute-status tribute-label]} (:tribute-to-talk contact)]
-          (if (or group-chat
-                  (#{:none :paid} tribute-status))
+          (if (not (#{:require :pending} tribute-status))
             [message-content-text {:content      last-message-content
                                    :content-type last-message-content-type}]
             [react/text {:style styles/last-message-text} tribute-label]))


CMR-3489 Update docstring

CMR-3489 Update docstring

--- common-lib/src/cmr/common/api/web_server.clj
+++ common-lib/src/cmr/common/api/web_server.clj
@@ -41,9 +41,9 @@
   ONE_MB)

 (def MAX_REQUEST_BODY_SIZE
- "The maximum size of a request to body. This is set to 200KB prevent large requests coming in
+ "The maximum size of a request to body. This is set to 500KB prevent large requests coming in
   that cause out of memory exceptions. A large ISO document like AST_L1A can be 120K characters which
-  would take up about 240KB in Java. This value is set to 3 MB."
+  would take up about 240KB in Java. This value is set to 5 MB."
  (* 5 ONE_MB))

 (defn- routes-fn-verify-size


allow foreign libs to be bundled as pseudo modules so they can be cached more aggressivly

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -7,7 +7,9 @@
            (com.google.javascript.jscomp.deps JsFileParser)
            (java.util.logging Level)
            [java.util.concurrent Executors Future]
-           (com.google.javascript.jscomp ReplaceCLJSConstants CompilerOptions CommandLineRunner))
+           (com.google.javascript.jscomp ReplaceCLJSConstants CompilerOptions CommandLineRunner)
+           (java.security MessageDigest)
+           (javax.xml.bind DatatypeConverter))
   (:require [clojure.data.json :as json]
             [clojure.java.io :as io]
             [clojure.set :as set]
@@ -1746,8 +1748,21 @@

 ;; FIXME: manifest should be custom step
 (defn flush-manifest [public-dir modules]
-  (spit (io/file public-dir "manifest.json")
-    (json/write-str (map #(select-keys % [:name :js-name :entries :depends-on :default :sources]) modules))))
+  (spit
+    (io/file public-dir "manifest.json")
+    (->> modules
+         (map (fn [{:keys [name js-name entries depends-on default sources foreign-files] :as mod}]
+                (-> {:name name
+                     :js-name js-name
+                     :entries entries
+                     :depends-on depends-on
+                     :default default
+                     :sources sources}
+                    (cond->
+                      (seq foreign-files)
+                      (assoc :foreign (mapv #(select-keys % [:js-name :provides]) foreign-files))))
+                ))
+         (json/write-str))))

 (defn foreign-js-source-for-mod [state {:keys [sources] :as mod}]
   (->> sources
@@ -1756,9 +1771,94 @@
        (map :output)
        (str/join "\n")))

+(defn md5hex [^String text]
+  (let [bytes
+        (.getBytes text)
+
+        md
+        (doto (MessageDigest/getInstance "MD5")
+          (.update bytes))
+
+        sig
+        (.digest md)]
+
+    (DatatypeConverter/printHexBinary sig)
+    ))
+
+(defn create-foreign-bundles
+  [state]
+  (update state :optimized
+    (fn [modules]
+      (->> modules
+           (map (fn [{:keys [name sources] :as mod}]
+                  (let [foreign-srcs
+                        (->> sources
+                             (map #(get-in state [:sources %]))
+                             (filter :foreign))]
+
+                    (if-not (seq foreign-srcs)
+                      mod
+                      (let [output
+                            (->> foreign-srcs
+                                 (map :output)
+                                 (str/join "\n"))
+
+                            provides
+                            (->> foreign-srcs
+                                 (map :provides)
+                                 (reduce set/union #{})
+                                 (sort)
+                                 (into []))
+
+                            md5
+                            (md5hex output)
+
+                            foreign-name
+                            (str (clojure.core/name name) "-foreign-" md5 ".js")]
+
+                        (assoc mod
+                          ;; remove foreign from sources list (mainly for a clean manifest)
+                          :sources
+                          (->> sources
+                               (map #(get-in state [:sources %]))
+                               (remove :foreign)
+                               (map :name)
+                               (into []))
+
+                          ;; FIXME: unfinished optmization
+                          ;; I want to be able to split foreigns into multiple files eventually
+                          ;; say you have foreign A,B,C
+                          ;; if A changes more frequently than B,C it might be useful to have it as a separate include
+                          ;; so B,C still benefit from caching and A doesn't cause them to download again
+                          :foreign-files
+                          [{:js-name foreign-name
+                            :provides provides
+                            :output output
+                            }])))
+                    )))
+           (into [])))))
+
+(defn flush-foreign-bundles
+  [{:keys [public-dir] :as state}]
+  (doseq [{:keys [foreign-files] :as mod} (:optimized state)
+          :when (seq foreign-files)
+          {:keys [js-name provides output] :as foreign-file} foreign-files]
+    (let [target (io/file public-dir js-name)]
+      (when-not (.exists target)
+
+        (log state {:type :flush-foreign
+                    :provides provides
+                    :js-name js-name
+                    :js-size (count output)})
+
+        (spit target output))))
+
+  state)
+
 (defn flush-modules-to-disk
   [{modules :optimized
     :keys [unoptimizable
+           bundle-foreign
            ^File public-dir
            cljs-runtime-path]
     :as state}]
@@ -1772,47 +1872,57 @@
     (when-not public-dir
       (throw (ex-info "missing :public-dir" {})))

-    (doseq [{:keys [default output prepend source-map-name name js-name] :as mod} modules]
-      (let [target
-            (io/file public-dir js-name)
-
-            out
-            (if default
-              (str unoptimizable output)
-              output)
-
-            out
-            (if (:web-worker mod)
-              (let [deps (:depends-on mod)]
-                (str (str/join "\n" (for [other modules
-                                          :when (contains? deps (:name other))]
-                                      (str "importScripts('" (:js-name other) "');")))
-                     "\n\n"
-                     out))
-              out)
-
-            out
-            (str prepend (foreign-js-source-for-mod state mod) out)]
-
-        (io/make-parents target)
-        (spit target out)
-
-        (log state {:type :flush-module
-                    :name name
-                    :js-name js-name
-                    :js-size (count out)})
-
-        (when source-map-name
-          (spit target (str "\n//# sourceMappingURL=" cljs-runtime-path "/" (file-basename source-map-name) "\n")
-            :append true))))
-
-    (flush-manifest public-dir modules)
-
-    (when (:source-map state)
-      (flush-source-maps state))
-
-    ;; with-logged-time expects that we return the compiler-state
-    state))
+    (let [{modules :optimized
+           :as state}
+          (if (not= :inline bundle-foreign)
+            (-> state
+                (create-foreign-bundles)
+                (flush-foreign-bundles))
+            state)]
+
+      (doseq [{:keys [default output prepend source-map-name name js-name] :as mod} modules]
+        (let [target
+              (io/file public-dir js-name)
+
+              out
+              (if default
+                (str unoptimizable output)
+                output)
+
+              out
+              (if (:web-worker mod)
+                (let [deps (:depends-on mod)]
+                  (str (str/join "\n" (for [other modules
+                                            :when (contains? deps (:name other))]
+                                        (str "importScripts('" (:js-name other) "');")))
+                       "\n\n"
+                       out))
+                out)
+
+              out
+              (if (= :inline bundle-foreign)
+                (str prepend (foreign-js-source-for-mod state mod) out)
+                (str prepend "\n" out))]
+
+          (io/make-parents target)
+          (spit target out)
+
+          (log state {:type :flush-module
+                      :name name
+                      :js-name js-name
+                      :js-size (count out)})
+
+          (when source-map-name
+            (spit target (str "\n//# sourceMappingURL=" cljs-runtime-path "/" (file-basename source-map-name) "\n")
+              :append true))))
+
+      (flush-manifest public-dir modules)
+
+      (when (:source-map state)
+        (flush-source-maps state))
+
+      ;; with-logged-time expects that we return the compiler-state
+      state)))

 (defn load-externs [{:keys [externs build-modules] :as state}]
   (let [default-externs
@@ -2478,6 +2588,8 @@
        :macros-loaded #{}
        :use-file-min true

+       :bundle-foreign :inline
+
        :static-fns true
        :elide-asserts false


Catch jgit errors

Catch jgit errors

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -175,7 +175,8 @@

 (defn format-diff!
   [^ByteArrayOutputStream out ^DiffFormatter df ^DiffEntry diff]
-  (.format df diff)
+  (try (.format df diff)
+    (catch Exception _))
   (let [s (.toString out "UTF-8")]
     (.reset out)
     s))
@@ -321,7 +322,8 @@
   [^JTree sidebar ^FileRepository repo content ^RevCommit commit]
   (.setText content (clj->html (utils/get-string :loading)))
   (future
-    (let [s (create-html repo commit)]
+    (let [s (try (create-html repo commit)
+              (catch Exception e (.getMessage e)))]
       (s/invoke-later
         (when (= commit (selected-commit sidebar))
           (doto content


headline in config

headline in config

--- src/elliot/templates/home.clj
+++ src/elliot/templates/home.clj
@@ -20,7 +20,7 @@
           [:img {:src "imgs/daemon_img.png" :id "daemon-img"}]]]
         [:div {:class "search-div col"}
          [:div {:class "search-div-contents"}
-          [:h1 (str "Hey " (config/all :daemon-name) "....")]
+          [:h1 (config/all :headline)]
           [:form {:method "GET"}
            [:div {:class "form-group"}
             [:input {:type "text"


reference clj-time correctly

reference clj-time correctly

--- src/github_authors/github.clj
+++ src/github_authors/github.clj
@@ -3,6 +3,8 @@
             [tentacles.issues :as issues]
             [io.pedestal.service.log :as log]
             [com.github.ragnard.hamelito.hiccup :as haml]
+            clj-time.core
+            clj-time.format
             [clostache.parser :as clostache]))

 ;;; helpers


docstring of system.workflow has been updated

--- core/src/cljc/hellhound/system/workflow.cljc
+++ core/src/cljc/hellhound/system/workflow.cljc
@@ -1,32 +1,37 @@
 (ns hellhound.system.workflow
   "System's workflow a vector describing the dataflow of the system.
-  Components have an input and an output stream. Each stream is a
-  core.async channel. HellHound connects io of each component to another
-  component based on the desciption given by the `:workflow` of the
-  system.
+  Each components has an input and an output stream. Each stream is a
+  `hellhound.stream/stram`. HellHound connects io of each component
+  to another component based on the desciption given by the `:workflow`
+  of the system.

-  System's workflow is a vector of vectors. Each vector contains two
-  mandatory element which are:
-    * The name of the output component
-    * The name of the input component
-  and an optional predicate function. This function connects the
-  output stream of output component to input stream of input component,
-  and in case of existance of a predicate function, it only sends those
-  messages which pass the predicate.
+  System's workflow is a vector of hashmaps. Each hashmap contains two
+  mandatory keys which are:

-  Predicate function should be a pure function obviousely."
+    * `:hellhound.workflow/source` which its value should be name of
+      the output component
+    * `:hellhound.workflow/sink`  which its value should be name of
+      the input component
+
+  and an optional `:hellhound.workflow/predicate` key that its value
+  should be predicate function.
+
+  Hellhound setup up a connection based on every hashmap (Node) and
+  connects the output of the source to input of the sink.
+
+  predicate function should return a boolean which filters all the
+  messages (See `hellhound.message`) from source component and feed
+  them to the sink component.
+
+  Predicate function must be pure and free of side effects."
   (:require
    [hellhound.logger               :as log]
    [hellhound.components.protocols :as cimpl]
-   [hellhound.streams              :as streams]
    [hellhound.system.impl.splitter :as spltr]
-   [hellhound.system.operations    :as op]
-   [hellhound.system.impl.system   :as sys]
-   [hellhound.system.protocols     :as impl]
-   [hellhound.system.utils         :as utils])
+   [hellhound.system.protocols     :as impl])

-  (:import (clojure.lang IPersistentMap
-                         PersistentVector)))
+  (:import (clojure.lang IPersistentMap)))
+

 (defn- invalid-workflow


:tada: Upload several images at once

:tada: Upload several images at once

--- frontend/src/uxbox/main/ui/workspace/left_toolbar.cljs
+++ frontend/src/uxbox/main/ui/workspace/left_toolbar.cljs
@@ -44,8 +44,8 @@
             (st/emit! (dw/create-and-add-shape :image shape aspect-ratio))))

         on-file-selected
-        (fn [file]
-          (st/emit! (dw/upload-image file on-uploaded)))]
+        (fn [files]
+          (run! #(st/emit! (dw/upload-image % on-uploaded)) files))]

     [:aside.left-toolbar
      [:div.left-toolbar-inside
@@ -76,7 +76,7 @@
         [:*
           i/image
           [:& file-uploader {:accept "image/jpeg,image/png,image/webp"
-                             :multi false
+                             :multi true
                              :input-ref file-input
                              :on-selected on-file-selected}]]]
        [:li.tooltip.tooltip-right


Prepare user-friendly samples #15 - book

--- flatguisamples/src/flatgui/samples/forms/orderticketwin.clj
+++ flatguisamples/src/flatgui/samples/forms/orderticketwin.clj
@@ -64,9 +64,7 @@
           (awt/mix-colors-coeff (:prime-4 theme) (:prime-3 theme) (* 0.5 ref-val))
           (awt/mix-colors-coeff (:prime-3 theme) (:prime-2 theme) ref-val))))))

-
-;;; TODO merge following two functions into one
-;;; Value provider for filling ticket fields with the values of clicked quote
+;;; Value provider for filling ticket fields (regular text fields) with the values of clicked quote
 (fg/defaccessorfn quote-val-provider [component reason bid-col-id ask-col-id]
   (case reason
     [:bids :content-pane]
@@ -81,6 +79,7 @@
       (if selection-model (value-provider (tcom/get-anchor-model-row selection-model) (.indexOf header-ids ask-col-id))))
     nil))

+;;; Value provider for filling ticket field (spinner) with the values of clicked quote
 (fg/defaccessorfn spinner-quote-val-provider [component reason bid-col-id ask-col-id]
   (case reason
     [:_ :bids :content-pane]
@@ -276,9 +275,8 @@
     (fg/defcomponent spinner/spinner :px-entry
       {:clip-size (m/defpoint 1.375 0.375 0)
        :step 0.01
-       :position-matrix (m/transtation 2.125 3.0)
-       ;; TODO without using :children keyword here?
-       :children {:editor (fg/defcomponent spinner/spinnereditor :editor {:evolvers {:model px-evolver}})}})
+       :position-matrix (m/transtation 2.125 3.0)}
+      (fg/defcomponent spinner/spinnereditor :editor {:evolvers {:model px-evolver}}))

     (fg/defcomponent label/label :stgy-label
       {:text "Strategy:"


protect against missing/invalid args

protect against missing/invalid args

--- src/main/shadow/cljs/repl.clj
+++ src/main/shadow/cljs/repl.clj
@@ -22,6 +22,9 @@
      :repl-sources list-of-source-names-required-on-repl-init
      :repl-actions list-of-repl-actions-and-the-input-that-created-them}))

+(defn repl-state? [x]
+  (and (map? x) (::repl-state x)))
+
 (defn setup [state]
   {:pre [(cljs/compiler-state? state)]}
   (let [cljs-user-requires
@@ -60,7 +63,8 @@
         ;; FIXME: proper ns-info for cljs.user, can use analyzer data because nothing was compiled yet

         repl-state
-        {:current {:ns 'cljs.user
+        {::repl-state true
+         :current {:ns 'cljs.user
                    :name "cljs/user.cljs"
                    :ns-info ns-info}
          ;; the sources required to get the repl started
@@ -356,63 +360,62 @@
             )))))

 (defn read-one
-  ([repl-state reader]
-   (read-one repl-state reader {}))
-  ([repl-state
-    reader
-    {:keys [filename] :or {filename "repl-input.cljs"}}]
-   (let [eof-sentinel
-         (Object.)
-
-         opts
-         {:eof eof-sentinel
-          :read-cond :allow
-          :features #{:cljs}}
-
-         in
-         (readers/source-logging-push-back-reader
-           reader ;; (PushbackReader. reader (object-array buf-len) buf-len buf-len)
-           1
-           filename)
-
-         {:keys [ns ns-info] :as repl-rc}
-         (:current repl-state)
-
-         form
-         (binding [*ns*
-                   (create-ns ns)
-
-                   ana/*cljs-ns*
-                   ns
-
-                   ana/*cljs-file*
-                   name
-
-                   reader/*data-readers*
-                   tags/*cljs-data-readers*
-
-                   reader/*alias-map*
-                   (merge reader/*alias-map*
-                     (:requires ns-info)
-                     (:require-macros ns-info))]
-
-           (reader/read opts in))
-
-         eof?
-         (identical? form eof-sentinel)]
-
-     (-> {:eof? eof?}
-         (cond->
-           (not eof?)
-           (assoc :form form
-                  :source
-                  ;; FIXME: poking at the internals of SourceLoggingPushbackReader
-                  ;; not using (-> form meta :source) which log-source provides
-                  ;; since there are things that do not support IMeta, still want the source though
-                  (-> @(.-source-log-frames in)
-                      (:buffer)
-                      (str)))))
-     )))
+  [repl-state reader {:keys [filename] :or {filename "repl-input.cljs"} :as opts}]
+  {:pre [(repl-state? repl-state)]}
+  (let [eof-sentinel
+        (Object.)
+
+        opts
+        {:eof eof-sentinel
+         :read-cond :allow
+         :features #{:cljs}}
+
+        in
+        (readers/source-logging-push-back-reader
+          reader ;; (PushbackReader. reader (object-array buf-len) buf-len buf-len)
+          1
+          filename)
+
+        {:keys [ns ns-info] :as repl-rc}
+        (:current repl-state)
+
+        _ (assert (symbol? ns))
+
+        form
+        (binding [*ns*
+                  (create-ns ns)
+
+                  ana/*cljs-ns*
+                  ns
+
+                  ana/*cljs-file*
+                  name
+
+                  reader/*data-readers*
+                  tags/*cljs-data-readers*
+
+                  reader/*alias-map*
+                  (merge reader/*alias-map*
+                    (:requires ns-info)
+                    (:require-macros ns-info))]
+
+          (reader/read opts in))
+
+        eof?
+        (identical? form eof-sentinel)]
+
+    (-> {:eof? eof?}
+        (cond->
+          (not eof?)
+          (assoc :form form
+                 :source
+                 ;; FIXME: poking at the internals of SourceLoggingPushbackReader
+                 ;; not using (-> form meta :source) which log-source provides
+                 ;; since there are things that do not support IMeta, still want the source though
+                 (-> @(.-source-log-frames in)
+                     (:buffer)
+                     (str)))))
+    ))

 (defn process-input
   "processes a string of forms, may read multiple forms"
@@ -424,7 +427,7 @@
     (loop [{:keys [repl-state] :as state} state]

       (let [{:keys [eof?] :as read-result}
-            (read-one repl-state reader)]
+            (read-one repl-state reader {})]

         (if eof?
           state
@@ -439,7 +442,7 @@
         (readers/input-stream-reader input-stream)

         {:keys [eof?] :as read-result}
-        (read-one repl-state reader)]
+        (read-one repl-state reader {})]
     (if eof?
       state
       (process-read-result state read-result))))


fix race condition in record-fact-existence!

Previously, running several facts in parallel would occasionally cause
'AssertionError Assert failed: (not (neg? index-to-exclude))' in
midje.data.compendium.Compendium/vector-remove.

Turns out that was due to a race condition in
midje.data.compendium/record-fact-existence!.

This commit fixes it.

--- src/midje/data/compendium.clj
+++ src/midje/data/compendium.clj
@@ -135,8 +135,9 @@
 (defn record-fact-existence! [fact-function]
   (when (and (fact/allows-itself-to-be-recorded? fact-function)
              (config/user-wants-fact-to-be-recorded? fact-function))
-    (if-let [previous (previous-version @global fact-function)]
-      (swap! global remove-from previous))
+    (swap! global #(if-let [previous (previous-version % fact-function)]
+                     (remove-from % previous)
+                     %))
     (swap! global add-to fact-function))
   ;; Returning the fact-function is a kludge required by the
   ;; way tabular facts are parsed.


Drop tables first option added

Drop tables first option added

--- src/wishlistd/models/init.clj
+++ src/wishlistd/models/init.clj
@@ -29,9 +29,8 @@
     (sql/drop-table :wish)
     (sql/drop-table :wishlist)))

-(defn -main []
-  (print "Migrating database...") (flush)
-  (drop-tables)
+(defn -main [cmd]
+  (when (= cmd "drop" (drop-tables))) ; optionally drop tables before creating
   (create-wishlist)
   (create-wish)
-  (println " done"))+  (println "Done!"))


Check if js/location exists

Check if js/location exists

--- modules/reitit-frontend/src/reitit/frontend/history.cljs
+++ modules/reitit-frontend/src/reitit/frontend/history.cljs
@@ -32,7 +32,8 @@
          (.getPathPrefix history)
          token)))

-(def ^:private current-domain (.getDomain (.parse Uri js/location)))
+(def ^:private current-domain (if (exists? js/location)
+                                (.getDomain (.parse Uri js/location))))

 (defn ignore-anchor-click
   "Ignore click events from a elements, if the href points to URL that is part


correct node name bug

correct node name bug

--- Jobs/rnaseq-xcompare-job-template.clj
+++ Jobs/rnaseq-xcompare-job-template.clj
@@ -1,6 +1,6 @@

 {:nodes
- {:cmp
+ {:ph2
   {:name "rnaseq-xcompare",
    :type "tool",
    :args []}


Parse fixture heads.

Parse fixture heads.

--- src/afterglow/fixtures/qxf.clj
+++ src/afterglow/fixtures/qxf.clj
@@ -54,12 +54,55 @@
    :capabilities (mapv qxf-capability->map
                        (zip-xml/xml-> ch :Capability))})

+(defn qxf-channnel-assigment->vector
+  "Builds a vector containing the offset at which a channel exists in
+  a mode and the channel name. Offsets are one-based, to parallel
+  fixture manuals. In other words, the DMX address assigned to the
+  fixture corresponds to offset 1, the next address to offset 2, and
+  so on."
+  [a]
+  [(inc (Integer/parseInt (zip-xml/attr a :Number))) (zip-xml/text a)])
+
+(defn- qxf-head->vector
+  "Builds a vector containing the channel offsets belonging to a
+  single head."
+  [h]
+  (mapv #(inc (Integer/parseInt %)) (zip-xml/xml-> h :Channel zip-xml/text)))
+
+(defn- qxf-process-heads
+  "Extracts any head-specific channels from a QLC+ mode, given a
+  sequence of Head nodes and the vector of mode channel assignments."
+  ([heads all-channels]
+   ;; Just starting; see if there is anything to do, if so set up structures we need
+   (if (seq heads)  ; There are some heads to deal with
+     (let [channel-map (into {} all-channels)]
+       (qxf-process-heads heads channel-map []))
+     [nil all-channels]))  ; There were no heads
+
+  ([remaining-heads remaining-channel-map heads-processed]
+   ;; Recursive head processing
+   (if (empty? remaining-heads)
+     [heads-processed (vec remaining-channel-map)]  ; Finished, return results
+     ;; Process the next head
+     (loop [head-channel-numbers (qxf-head->vector (first remaining-heads))
+            head-channel-result []
+            channels-left remaining-channel-map]
+       (if (empty? head-channel-numbers)  ; Finished processing this head
+         (qxf-process-heads (rest remaining-heads) channels-left (conj heads-processed head-channel-result))
+         (let [current (first head-channel-numbers)]
+           (recur (rest head-channel-numbers)
+                  (conj head-channel-result [current (get channels-left current)])
+                  (dissoc channels-left current))))))))
+
 (defn- qxf-mode->map
   "Builds a map containing a mode specification from a QLC+ fixture
   definition. Currently ignores the Physical documentation."
   [m]
-  {:name (zip-xml/attr m :Name)
-   :channels (mapv zip-xml/text (zip-xml/xml-> m :Channel))})
+  (let [all-channels (mapv qxf-channnel-assigment->vector (zip-xml/xml-> m :Channel))
+        [heads other-channels] (qxf-process-heads (zip-xml/xml-> m :Head) all-channels)]
+    {:name (zip-xml/attr m :Name)
+     :channels other-channels
+     :heads heads}))

 (defn translate-definition
   "Converts a map read by [[convert-qxf]] into an Afterglow fixture


remove animation from svg, refactor objects

--- frontend/components/common.cljs
+++ frontend/components/common.cljs
@@ -81,36 +81,29 @@
    :repo "M44.4,27.5h-5.6v5.6h5.6V27.5z M44.4,16.2h-5.6v5.6h5.6V16.2z M78.1,5H21.9c0,0-5.6,0-5.6,5.6 v67.5c0,5.6,5.6,5.6,5.6,5.6h11.2V95l8.4-8.4L50,95V83.8h28.1c0,0,5.6-0.1,5.6-5.6V10.6C83.8,5,78.1,5,78.1,5z M78.1,72.5 c0,5.4-5.6,5.6-5.6,5.6H50v-5.6H33.1v5.6h-5.6c-5.6,0-5.6-5.6-5.6-5.6v-5.6h56.2V72.5z M78.1,61.2h-45V10.6h45.1L78.1,61.2z M44.4,50h-5.6v5.6h5.6V50z M44.4,38.8h-5.6v5.6h5.6V38.8z"})

 (def ico-templates
-  {:logo {:paths [(:turn ico-paths) (:circle ico-paths)]}
-   :pass {:paths [(:turn ico-paths (:check ico-paths))]}
-   :fail {:paths [(:turn ico-paths) (:times ico-paths)]}
-   :queued {:paths [(:turn ico-paths) (:clock ico-paths)]}
-   :logo-light {:paths [(:slim_turn ico-paths) (:slim_circle ico-paths)]}
-   :busy-light {:paths [(:slim_turn ico-paths) (:slim_circle ico-paths)]
-                :d "600ms"
-                :v "0 50 50;360 50 50"
-                :k "0;1"}
-   :pass-light {:paths [(:slim_check ico-paths)]}
-   :fail-light {:paths [(:slim_times ico-paths)]}
-   :hold-light {:paths [(:slim_clock ico-paths)]}
-   :stop-light {:paths [(:slim_ban ico-paths)]}
-   :settings-light {:paths [(:slim_settings ico-paths) (:slim_circle ico-paths)]}
-   :none-light {:paths [(:slim_circle ico-paths)]}
-   :repo {:paths [(:repo ico-paths)]}})
+  {:logo {:paths [:turn :circle]}
+   :pass {:paths [:turn :check]}
+   :fail {:paths [:turn :times]}
+   :queued {:paths [:turn :clock]}
+   :logo-light {:paths [:slim_turn :slim_circle]}
+   :busy-light {:paths [:slim_turn :slim_circle]}
+   :pass-light {:paths [:slim_check]}
+   :fail-light {:paths [:slim_times]}
+   :hold-light {:paths [:slim_clock]}
+   :stop-light {:paths [:slim_ban]}
+   :settings-light {:paths [:slim_settings :slim_circle]}
+   :none-light {:paths [:slim_circle]}
+   :repo {:paths [:repo]}})

 (defn ico [ico-name]
   (let [template (get ico-templates ico-name)]
-    [:svg {:class "ico" :xmlns "http://www.w3.org/2000/svg" :viewBox "0 0 100 100"
-           :dangerouslySetInnerHTML
-           #js {"__html" (apply str
-                                (for [path (:paths template)]
-                                  (str "<path class='ico-" (name ico-name) "' fill='none'"
-                                       " d='" path "'>"
-                                       (when (:d template)
-                                         (str "<animateTransform attributeName='transform' type='rotate'"
-                                              " repeatDur='indefinite' dur='" (:d template) "' values='" (:v template) "'"
-                                              " keyTimes='" (:k template) "'></animateTransform>"))
-                                       "</path>")))}}]))
+    [:i {:class "ico"}
+      [:svg {:xmlns "http://www.w3.org/2000/svg" :viewBox "0 0 100 100"
+             :class (name ico-name)
+             :dangerouslySetInnerHTML
+             #js {"__html" (apply str
+                                  (for [path (:paths template)]
+                                    (str "<path class='" (name path) "' fill='none' d='" (get ico-paths path) "'></path>")))}}]]))

 ;; TODO: why do we have ico and icon?
 (def icon-shapes


upmerge from master

upmerge from master

--- storm-core/test/clj/org/apache/storm/nimbus_test.clj
+++ storm-core/test/clj/org/apache/storm/nimbus_test.clj
@@ -22,7 +22,7 @@
             TestAggregatesCounter TestPlannerSpout TestPlannerBolt]
            [org.apache.storm.nimbus InMemoryTopologyActionNotifier]
            [org.apache.storm.generated GlobalStreamId]
-           [org.apache.storm ThriftMockAutoCred]
+           [org.apache.storm Thrift MockAutoCred]
            [org.apache.storm.stats BoltExecutorStats])
   (:import [org.apache.storm.testing.staticmocking MockedZookeeper])
   (:import [org.apache.storm.scheduler INimbus])


find-atoms behind find-all-atoms

find-atoms behind find-all-atoms

--- src/atom_finder/classifier.clj
+++ src/atom_finder/classifier.clj
@@ -58,9 +58,14 @@

 (def any-atom? (apply some-fn (map :classifier atoms)))

-(defn find-all-atoms
-  [root]
-  (map-values (fn [atom]
-                (log-err (str "finding " (:name atom) " in " (filename root)) nil
-                         ((:finder atom) root)))
-              atom-lookup))
+(s/defn find-atoms :- {s/Keyword [IASTNode]}
+  [atoms :- [Atom] root]
+  (->> atoms
+       (map (fn [atom]
+              (log-err (str "finding " (:name atom) " in " (filename root)) nil
+                       {(:name atom) ((:finder atom) root)}
+                       )))
+       (apply merge)
+       ))
+
+(defn find-all-atoms [root] (find-atoms atoms root))


remove unused {:essere false}

remove unused {:essere false}

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -827,7 +827,6 @@
                   :subcat '()}}
    "help"
    {:synsem {:cat :verb
-             :essere false
              :sem {:pred :aiutare
                    :activity true
                    :obj {:human true}}


assign funcitons

assign funcitons

--- src/ca_recipe/family_async.clj
+++ src/ca_recipe/family_async.clj
@@ -14,3 +14,29 @@
                             :carrots :potatoes :cheese :apples})
    (ref-set assignments {})
    (ref-set shopping-cart #{})))
+
+(defn assignment
+  [child]
+  (get @assignments child))
+
+(defn buy-candy []
+  (dosync
+   (commute shopping-cart conj (store/grab :candy))))
+
+(defn collect-assignment
+  [child]
+  (let [item (assignment child)]
+    (dosync
+     (alter shopping-cart conj item)
+     (alter assignments dissoc child)
+     (ensure shopping-list) ;;
+     ;;
+     )
+    item))
+
+(defn assign-item-to-child [child]
+  (let [item (first @shopping-list)]
+    (dosync
+     (alter assignments assoc child item)
+     (alter shopping-list disj item))
+    item))


Lower get-endorsement depth limit

Lower get-endorsement depth limit

--- src/clj/salava/badge/parse.clj
+++ src/clj/salava/badge/parse.clj
@@ -233,7 +233,7 @@
 ;;

 (defn- get-endorsement
-  ([item] (get-endorsement item 3))
+  ([item] (get-endorsement item 1))
   ([item depth]
    (let [item-id (:id item)]
      (if (empty? (:endorsement item))


add test for ancestral imager

add test for ancestral imager

--- src/clj/test/cards-agendas.clj
+++ src/clj/test/cards-agendas.clj
@@ -1,4 +1,24 @@
 (in-ns 'test.core)
+
+(deftest ancestral-imager
+  "Ancestral Imager - damage on jack out"
+  (do-game
+    (new-game (default-corp [(qty "Ancestral Imager" 3)]) (default-runner))
+    (play-from-hand state :corp "Ancestral Imager" "New remote")
+    (let [ai (get-in @state [:corp :servers :remote1 :content 0])]
+      (core/advance state :corp {:card (refresh ai)})
+      (core/advance state :corp {:card (refresh ai)})
+      (take-credits state :corp)
+      (take-credits state :runner)
+      (core/advance state :corp {:card (refresh ai)})
+      (is (= 3 (get-in (refresh ai) [:advance-counter])))
+      (core/score state :corp {:card (refresh ai)})
+      (take-credits state :corp)
+      (is (= 3 (count(get-in @state [:runner :hand]))))
+      (core/click-run state :runner {:server :hq})
+      (core/jack-out state :runner nil)
+      (is (= 2 (count(get-in @state [:runner :hand]))))
+      )))

 (deftest fetal-ai-damage
   "Fetal AI - damage on access"


add missing 'require'

add missing 'require'

--- src/clj_money/web/accounts.clj
+++ src/clj_money/web/accounts.clj
@@ -1,5 +1,6 @@
 (ns clj-money.web.accounts
-  (:require [hiccup.core :refer :all]
+  (:require [environ.core :refer [env]]
+            [hiccup.core :refer :all]
             [hiccup.page :refer :all]
             [clj-money.models.accounts :as accounts])
   (:use [clj-money.web.shared :refer :all]))


Made get-query-params and get-form-params preserve previous params if there's any.

Signed-off-by: James Reeves <9dadf8ecafa226c8f7c16002bdcb090267879343@weavejester.com>

--- src/compojure/http/request.clj
+++ src/compojure/http/request.clj
@@ -41,9 +41,10 @@
 (defn get-query-params
   "Parse parameters from the query string."
   [request]
-  (if-let [query (request :query-string)]
-    (parse-params query #"&")
-    {}))
+  (merge (request :query-params)
+    (if-let [query (request :query-string)]
+      (parse-params query #"&")
+      {})))

 (defn get-character-encoding
   "Get the character encoding, or use the default from duck-streams."
@@ -60,11 +61,12 @@
 (defn get-form-params
   "Parse urlencoded form parameters from the request body."
   [request]
-  (if (= (request :content-type) "application/x-www-form-urlencoded")
-    (if-let [body (slurp-body request)]
-      (parse-params body #"&")
-      {})
-    {}))
+  (merge (request :form-params)
+    (if (= (request :content-type) "application/x-www-form-urlencoded")
+      (if-let [body (slurp-body request)]
+        (parse-params body #"&")
+        {})
+      {})))

 (defn assoc-parameters
   "Add urlencoded parameters to a request map."


Fix Optimus file not found error

Fix Optimus file not found error

--- resources/leiningen/new/clover/src/clj/clover/server.clj
+++ resources/leiningen/new/clover/src/clj/clover/server.clj
@@ -29,24 +29,27 @@
       (optimizations/add-cache-busted-expires-headers)
       (optimizations/add-last-modified-headers)))

+(defn- asset-config [freeze-assets?]
+  (if freeze-assets?
+    {:js advanced-js
+     :strategy strategies/serve-frozen-assets}
+    {:js expanded-js
+     :strategy strategies/serve-live-assets}))
+
 (defn render-layout [js]
   (html5
    [:head
     [:title "FIXME: {{name}}"]]
    [:body (cons [:main#app] js)]))

-(defn- make-routes [freeze-assets?]
+(defn- make-routes [js-fn]
   (routes
-   (GET "/" req (render-layout (if freeze-assets?
-                                 (advanced-js req)
-                                 (expanded-js req))))
+   (GET "/" req (render-layout (js-fn req)))
    (route/not-found "Not found! ")))

 (defn make-handler [{:keys [debug-exceptions? freeze-assets?]}]
-  (let [asset-strategy (if freeze-assets?
-                         strategies/serve-frozen-assets
-                         strategies/serve-live-assets)]
-    (-> (make-routes freeze-assets?)
-        (optimus/wrap get-assets asset-optimizations asset-strategy)
+  (let [{:keys [js strategy]} (asset-config freeze-assets?)]
+    (-> (make-routes js)
+        (optimus/wrap get-assets asset-optimizations strategy)
         (cond-> debug-exceptions? prone/wrap-exceptions)
         (wrap-defaults site-defaults))))


adding test for multiple arity fns in engine namespace

--- spec/cljs/t3/game/engine_spec.cljs
+++ spec/cljs/t3/game/engine_spec.cljs
@@ -1,34 +1,61 @@
 (ns t3.game.engine-spec
   (:require-macros [speclj.core :refer [describe it should= before]])
   (:require [speclj.core]
-            [t3.game.engine :as engine]))
-
-(describe "turn and change-player-turn:"
-          (before (engine/reset-game))
+            [t3.game.engine :as engine :refer [game-state]]))
+
+(describe "which-player-turn? and change-player-turn:"
+          (before (engine/reset-game))
+          ;; -----
           (it "should start game as player1's turn"
               (should= :player1
                        (engine/which-player-turn?)))
+          (it "snapshot: should start game as player1's turn"
+              (should= :player1
+                       (engine/which-player-turn? @game-state)))
+          ;; -----
           (it "should be player2's turn after player1 goes"
               (should= :player2
                        (do (engine/change-player-turn)
                            (engine/which-player-turn?))))
+          (it "snapshot: should be player2's turn after player1 goes"
+              (should= :player2
+                       (do (engine/change-player-turn)
+                           (engine/which-player-turn? @game-state))))
+          ;; -----
           (it "should be player1's turn again after player1 and player2 goes"
               (should= :player1
                        (do (engine/change-player-turn)
                            (engine/change-player-turn)
-                           (engine/which-player-turn?)))))
+                           (engine/which-player-turn?))))
+          (it "snapshot: should be player1's turn again after player1 and player2 goes"
+              (should= :player1
+                       (do (engine/change-player-turn)
+                           (engine/change-player-turn)
+                           (engine/which-player-turn? @game-state)))))

 (describe "player-spaces and take-space:"
           (before (engine/reset-game))
+          ;; -----
           (it "player1 should take :space1"
               (should= (sorted-set :space1)
                        (do (engine/take-space :space1)
                            (engine/player-spaces :player1))))
+          (it "snapshot: player1 should take :space1"
+              (should= (sorted-set :space1)
+                       (do (engine/take-space :space1)
+                           (engine/player-spaces @game-state :player1))))
+          ;; -----
           (it "player2 should take :space2"
               (should= (sorted-set :space2)
                        (do (engine/change-player-turn)
                            (engine/take-space :space2)
                            (engine/player-spaces :player2))))
+          (it "snapshot: player2 should take :space2"
+              (should= (sorted-set :space2)
+                       (do (engine/change-player-turn)
+                           (engine/take-space :space2)
+                           (engine/player-spaces @game-state :player2))))
+          ;; -----
           (it "player1 should take :space5 & :space7, player2 should take :space6"
               (should= (list (sorted-set :space5 :space7) (sorted-set :space6))
                        (do (engine/take-space :space5)
@@ -37,7 +64,16 @@
                            (engine/change-player-turn)
                            (engine/take-space :space7)
                            (list (engine/player-spaces :player1)
-                                 (engine/player-spaces :player2))))))
+                                 (engine/player-spaces :player2)))))
+          (it "player1 should take :space5 & :space7, player2 should take :space6"
+              (should= (list (sorted-set :space5 :space7) (sorted-set :space6))
+                       (do (engine/take-space :space5)
+                           (engine/change-player-turn)
+                           (engine/take-space :space6)
+                           (engine/change-player-turn)
+                           (engine/take-space :space7)
+                           (list (engine/player-spaces @game-state :player1)
+                                 (engine/player-spaces @game-state :player2))))))

 (describe "all-taken-spaces:"
           (before (engine/reset-game))
@@ -48,10 +84,19 @@
                            (engine/take-space :space6)
                            (engine/change-player-turn)
                            (engine/take-space :space7)
-                           (engine/all-taken-spaces)))))
+                           (engine/all-taken-spaces))))
+          (it "snapshot: player1 and player2 should collectively have taken :space5, :space6, and :space7"
+              (should= (sorted-set :space5 :space6 :space7)
+                       (do (engine/take-space :space5)
+                           (engine/change-player-turn)
+                           (engine/take-space :space6)
+                           (engine/change-player-turn)
+                           (engine/take-space :space7)
+                           (engine/all-taken-spaces @game-state)))))

 (describe "all-remaining-spaces:"
           (before (engine/reset-game))
+          ;; -----
           (it "should have 5 spaces left"
               (should= #{:space4 :space5 :space6 :space7 :space8}
                        (do (engine/take-space :space0)
@@ -62,6 +107,17 @@
                            (engine/change-player-turn)
                            (engine/take-space :space3)
                            (engine/all-remaining-spaces))))
+          (it "snapshot: should have 5 spaces left"
+              (should= #{:space4 :space5 :space6 :space7 :space8}
+                       (do (engine/take-space :space0)
+                           (engine/change-player-turn)
+                           (engine/take-space :space1)
+                           (engine/change-player-turn)
+                           (engine/take-space :space2)
+                           (engine/change-player-turn)
+                           (engine/take-space :space3)
+                           (engine/all-remaining-spaces @game-state))))
+          ;; -----
           (it "should have 0 spaces left"
               (should= #{}
                        (do (engine/take-space :space0)
@@ -81,10 +137,31 @@
                            (engine/take-space :space7)
                            (engine/change-player-turn)
                            (engine/take-space :space8)
-                           (engine/all-remaining-spaces)))))
+                           (engine/all-remaining-spaces))))
+          (it "snapshot: should have 0 spaces left"
+              (should= #{}
+                       (do (engine/take-space :space0)
+                           (engine/change-player-turn)
+                           (engine/take-space :space1)
+                           (engine/change-player-turn)
+                           (engine/take-space :space2)
+                           (engine/change-player-turn)
+                           (engine/take-space :space3)
+                           (engine/change-player-turn)
+                           (engine/take-space :space4)
+                           (engine/change-player-turn)
+                           (engine/take-space :space5)
+                           (engine/change-player-turn)
+                           (engine/take-space :space6)
+                           (engine/change-player-turn)
+                           (engine/take-space :space7)
+                           (engine/change-player-turn)
+                           (engine/take-space :space8)
+                           (engine/all-remaining-spaces @game-state)))))

 (describe "space-available?:"
           (before (engine/reset-game))
+          ;; -----
           (it "space should be available"
               (should= true
                        (do (engine/put! :board-size 3)
@@ -92,13 +169,28 @@
                            (engine/take-space :space1)
                            (engine/take-space :space2)
                            (engine/space-available? :space3))))
+          (it "snapshot: space should be available"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/space-available? @game-state :space3))))
+          ;; -----
           (it "space should not be available"
               (should= false
                        (do (engine/put! :board-size 3)
                            (engine/take-space :space0)
                            (engine/take-space :space1)
                            (engine/take-space :space2)
-                           (engine/space-available? :space2)))))
+                           (engine/space-available? :space2))))
+          (it "snapshot: space should not be available"
+              (should= false
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/space-available? @game-state :space2)))))

 (describe "player-win?:"
           (before (engine/reset-game))
@@ -109,6 +201,14 @@
                            (engine/take-space :space1)
                            (engine/take-space :space2)
                            (engine/player-win? :player1))))
+          (it "snapshot: player1 should win on 3x3"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/player-win? @game-state :player1))))
+          ;; -----
           (it "player2 should win on 3x3"
               (should= true
                        (do (engine/put! :board-size 3)
@@ -117,6 +217,15 @@
                            (engine/take-space :space4)
                            (engine/take-space :space8)
                            (engine/player-win? :player2))))
+          (it "snapshot: player2 should win on 3x3"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/change-player-turn)
+                           (engine/take-space :space0)
+                           (engine/take-space :space4)
+                           (engine/take-space :space8)
+                           (engine/player-win? @game-state :player2))))
+          ;; -----
           (it "player1 should win 4x4"
               (should= true
                        (do (engine/put! :board-size 4)
@@ -125,6 +234,15 @@
                            (engine/take-space :space2)
                            (engine/take-space :space3)
                            (engine/player-win? :player1))))
+          (it "snapshot: player1 should win 4x4"
+              (should= true
+                       (do (engine/put! :board-size 4)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/take-space :space3)
+                           (engine/player-win? @game-state :player1))))
+          ;; -----
           (it "player2 should win 4x4"
               (should= true
                        (do (engine/put! :board-size 4)
@@ -134,6 +252,16 @@
                            (engine/take-space :space10)
                            (engine/take-space :space15)
                            (engine/player-win? :player2))))
+          (it "snapshot: player2 should win 4x4"
+              (should= true
+                       (do (engine/put! :board-size 4)
+                           (engine/change-player-turn)
+                           (engine/take-space :space0)
+                           (engine/take-space :space5)
+                           (engine/take-space :space10)
+                           (engine/take-space :space15)
+                           (engine/player-win? @game-state :player2))))
+          ;; -----
           (it "player1 should not win on 3x3"
               (should= nil
                        (do (engine/put! :board-size 3)
@@ -141,6 +269,14 @@
                            (engine/take-space :space1)
                            (engine/take-space :space3)
                            (engine/player-win? :player1))))
+          (it "snapshot: player1 should not win on 3x3"
+              (should= nil
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space3)
+                           (engine/player-win? @game-state :player1))))
+          ;; -----
           (it "player1 should not win on 4x4"
               (should= nil
                        (do (engine/put! :board-size 4)
@@ -148,7 +284,15 @@
                            (engine/take-space :space1)
                            (engine/take-space :space2)
                            (engine/take-space :space4)
-                           (engine/player-win? :player1)))))
+                           (engine/player-win? :player1))))
+          (it "snapshot: player1 should not win on 4x4"
+              (should= nil
+                       (do (engine/put! :board-size 4)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/take-space :space4)
+                           (engine/player-win? @game-state :player1)))))

 (describe "cats-game?:"
           (before (engine/reset-game))
@@ -166,7 +310,21 @@
                            (engine/take-space :space7)
                            (engine/take-space :space8)
                            (engine/cats-game?))))
-
+          (it "snapshot: should be cats game"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space4)
+                           (engine/take-space :space5)
+                           (engine/take-space :space6)
+                           (engine/change-player-turn)
+                           (engine/take-space :space2)
+                           (engine/take-space :space3)
+                           (engine/take-space :space7)
+                           (engine/take-space :space8)
+                           (engine/cats-game? @game-state))))
+          ;; -----
           (it "should not be a cats game"
               (should= false
                        (do (engine/put! :board-size 3)
@@ -182,10 +340,27 @@
                            (engine/take-space :space4)
                            (engine/take-space :space7)
                            (engine/take-space :space8)
-                           (engine/cats-game?)))))
+                           (engine/cats-game?))))
+          (it "snapshot: should not be a cats game"
+              (should= false
+                       (do (engine/put! :board-size 3)
+                           ;; These three win
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           ;; --
+                           (engine/take-space :space5)
+                           (engine/take-space :space6)
+                           (engine/change-player-turn)
+                           (engine/take-space :space3)
+                           (engine/take-space :space4)
+                           (engine/take-space :space7)
+                           (engine/take-space :space8)
+                           (engine/cats-game? @game-state)))))

 (describe "game-over?:"
           (before (engine/reset-game))
+          ;; -----
           (it "game should be over because player1 won"
               (should= true
                        (do (engine/put! :board-size 3)
@@ -193,6 +368,14 @@
                            (engine/take-space :space1)
                            (engine/take-space :space2)
                            (engine/game-over?))))
+          (it "snapshot: game should be over because player1 won"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/game-over? @game-state))))
+          ;; -----
           (it "game should be over because player2 won"
               (should= true
                        (do (engine/put! :board-size 3)
@@ -200,7 +383,15 @@
                            (engine/take-space :space0)
                            (engine/take-space :space1)
                            (engine/take-space :space2)
-                           (engine/game-over?)))))
+                           (engine/game-over?))))
+          (it "snapshot: game should be over because player2 won"
+              (should= true
+                       (do (engine/put! :board-size 3)
+                           (engine/change-player-turn)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/game-over? @game-state)))))

 (describe "player-turn-sequence:"
           (before (engine/reset-game))
@@ -209,6 +400,12 @@
                        (do (engine/put! :board-size 3)
                            (engine/player-turn-sequence :space1)
                            ((engine/player-spaces :player1) :space1))))
+          (it "snapshot: space should be able to be taken"
+              (should= :space1
+                       (do (engine/put! :board-size 3)
+                           (engine/player-turn-sequence :space1)
+                           ((engine/player-spaces @game-state :player1) :space1))))
+          ;; -----
           (it "space should not be able to be taken - playe1 has already won"
               (should= nil
                        (do (engine/put! :board-size 3)
@@ -217,7 +414,16 @@
                            (engine/take-space :space2)
                            (engine/player-turn-sequence :space3)
                            ((engine/player-spaces :player1) :space3))))
-          (it "space should not be able to be taken - playe2 has already won"
+          (it "snapshot: space should not be able to be taken - playe1 has already won"
+              (should= nil
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/player-turn-sequence :space3)
+                           ((engine/player-spaces @game-state :player1) :space3))))
+          ;; -----
+          (it "space should not be able to be taken - player2 has already won"
               (should= nil
                        (do (engine/put! :board-size 3)
                            (engine/change-player-turn)
@@ -227,6 +433,17 @@
                            (engine/change-player-turn)
                            (engine/player-turn-sequence :space3)
                            ((engine/player-spaces :player1) :space3))))
+          (it "snapshot: space should not be able to be taken - player2 has already won"
+              (should= nil
+                       (do (engine/put! :board-size 3)
+                           (engine/change-player-turn)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/change-player-turn)
+                           (engine/player-turn-sequence :space3)
+                           ((engine/player-spaces @game-state :player1) :space3))))
+          ;; -----
           (it "space should not be able to be taken, so it should still be player1's turn"
               (should= :player1
                        (do (engine/put! :board-size 3)
@@ -235,10 +452,26 @@
                            (engine/take-space :space2)
                            (engine/player-turn-sequence :space3)
                            (engine/which-player-turn?))))
+          (it "snapshot: space should not be able to be taken, so it should still be player1's turn"
+              (should= :player1
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/take-space :space2)
+                           (engine/player-turn-sequence :space3)
+                           (engine/which-player-turn? @game-state))))
+          ;; -----
           (it "space be able to be taken, so it should be player2's turn"
               (should= :player2
                        (do (engine/put! :board-size 3)
                            (engine/take-space :space0)
                            (engine/take-space :space1)
                            (engine/player-turn-sequence :space3)
-                           (engine/which-player-turn?)))))
+                           (engine/which-player-turn?))))
+          (it "snapshot: space be able to be taken, so it should be player2's turn"
+              (should= :player2
+                       (do (engine/put! :board-size 3)
+                           (engine/take-space :space0)
+                           (engine/take-space :space1)
+                           (engine/player-turn-sequence :space3)
+                           (engine/which-player-turn? @game-state)))))


More mapping tuning.

More mapping tuning.

--- src/ctia/stores/es/mapping.clj
+++ src/ctia/stores/es/mapping.clj
@@ -289,7 +289,7 @@
      :confidence string
      :severity {:type "integer"}
      :valid_time valid-time
-     :reason string
+     :reason text
      :source_uri string
      :reason_uri string
      :indicators related-indicators
@@ -365,7 +365,7 @@
      :source string
      :ttp_type string
      :expires ts
-     :indicators string
+     :indicators all_string
      :owner string
      :created ts
      :modified ts}}})


Momoize building of power tree

Momoize building of power tree

--- src/gigrig/components/app.cljs
+++ src/gigrig/components/app.cljs
@@ -7,12 +7,12 @@
             [gigrig.positioning :as positioning]
             [gigrig.components.pedal-search :as pedal-search]))

+(def build-tree (memoize #(-> % ptree/build positioning/emplace)))
+
 (defn component
   [state]
   [:div#app
    [:h1 "Power Supply Diagram generator"]
    [pedal-search/component (:search-field @state)]
    [selected-pedals/component (:selected-pedals @state)]
-   [diagram/component {:zipper (-> (:selected-pedals @state)
-                                   ptree/build
-                                   positioning/emplace)}]])
+   [diagram/component {:zipper (build-tree (:selected-pedals @state))}]])


Fix type in env template file paths

Fix type in env template file paths

--- src/leiningen/new/re_frame.clj
+++ src/leiningen/new/re_frame.clj
@@ -9,10 +9,10 @@
   [["env/dev/clj/{{sanitized}}/dev.clj"
     (render "env/dev/clj/project_name/dev.clj" data)]

-   ["env/dev/cljs/{{sanitized}}/dev.clj"
+   ["env/dev/cljs/{{sanitized}}/dev.cljs"
     (render "env/dev/cljs/project_name/dev.cljs" data)]

-   ["env/prod/cljs/{{sanitized}}/prod.clj"
+   ["env/prod/cljs/{{sanitized}}/prod.cljs"
     (render "env/prod/cljs/project_name/prod.cljs" data)]

    ["LICENSE" (render "LICENSE" data)]


get-binding-[details|data] can take multiple ids, set-binding-data! multiple id and matrix pairs, other clean-ups

--- src-resource/excel/cljs4excel.cljs
+++ src-resource/excel/cljs4excel.cljs
@@ -5,7 +5,8 @@

 (defn js->fn
   "Take a function and JSON, convert JSON to a Clojure structure and pass it to the function."
-  [fn js] (fn (js->clj js)))
+  [f js]
+  (f (js->clj js)))

 (defn binding->fn
   "Called from JS for a Excel document binding.
@@ -14,70 +15,113 @@
    :type Type of binding, currently only matrix.
    :cc Binding column count.
    :rc Binding row count."
-   [fn id type cc rc] (fn {:id id
-                            :type type
-                            :cc cc
-                            :rc rc}))
+   [f id type cc rc]
+   (f {:id id
+        :type type
+        :cc cc
+        :rc rc}))

 (defn binding-data->fn
   "Similar to binding->fn, but includes binding data keyed under :data."
-  [fn id type cc rc data] (fn {:id id
-                                :type type
-                                :cc cc
-                                :rc rc
-                                :data (js->clj data)}))
+  [f id type cc rc data]
+  (f {:id id
+      :type type
+      :cc cc
+      :rc rc
+      :data (js->clj data)}))

 (defn get-selection
   "Used to get the current document selection."
-  [fn] (.getSelection js/app (partial js->fn fn)))
+  [f]
+  (.getSelection js/app (partial js->fn f)))

 (defn set-selection!
   "Replace current document selection with given matrix data."
-  [matrix] (.setSelection js/app (clj->js matrix)))
+  [matrix]
+  (.setSelection js/app (clj->js matrix)))

 (defn add-binding-named-item
   "Add a named binding to a document region. The name can either refer to an
   existing named item in the document, or a region by using the A1 reference style.
   Examples of A1 references: A1 (single cell at A1), B1:C2 (2x2 at B1 to C2),
   Sheet1!$A$1:$B$2 (2x2 within Sheet1 on $A$1 to $B$2), etc.."
-  [name id fn] (.addBindingFromNamedItem js/app name id (partial binding->fn fn)))
+  [name id f]
+  (.addBindingFromNamedItem js/app name id (partial binding->fn f)))

 (defn add-binding-prompt
   "Add a document binding by prompting user to provide a region."
-  [id fn] (.addBindingFromPrompt js/app id (partial binding->fn fn)))
+  [id f]
+  (.addBindingFromPrompt js/app id (partial binding->fn f)))

 (defn add-binding-selection
   "Add a document binding for the current selection."
-  [id fn] (.addBindingFromSelection js/app id (partial binding->fn fn)))
+  [id f]
+  (.addBindingFromSelection js/app id (partial binding->fn f)))

 (defn get-all-bindings
   "Called the given function with a vector of all current binding ids."
-  [fn] (.getAllBindings js/app (partial js->fn fn)))
+  [f]
+  (.getAllBindings js/app (partial js->fn f)))

 (defn get-binding-details
-  "Call the given function with the details of given binding id."
-  [id fn] (.getBindingDetails js/app id (partial binding->fn fn)))
+  "Call the given function with the details of given binding id.
+  Multiple ids can be given as long as the final callback function can
+  handle as many arguments as ids given. The given ids can either be contained
+  within a sequence or not. Examples:
+      (get-binding-details id println)
+      (get-binding-details id1 id2 println)
+      (get-binding-details '(id1 id2) println)
+      (get-binding-details '(id1 id2) '(id3 id4) println)"
+  [& args]
+  (let [ids (-> args butlast flatten)
+        f (last args)]
+    (if (empty? ids)
+      (f)
+      (.getBindingDetails js/app (first ids)
+        (partial binding->fn
+          #(get-binding-details (rest ids) (partial f %)))))))

 (defn get-binding-data
-  "Pass current binding data to given function."
-  [id fn] (.getBindingData js/app id (partial binding-data->fn fn)))
+  "Pass current binding data to given function.
+  Multiple ids can be given as long as the final callback function can
+  handle as many arguments as ids given. The given ids can either be contained
+  within a sequence or not. Examples:
+      (get-binding-data id println)
+      (get-binding-data id1 id2 println)
+      (get-binding-data '(id1 id2) println)
+      (get-binding-data '(id1 id2) '(id3 id4) println)"
+  [& args]
+  (let [ids (-> args butlast flatten)
+        f (last args)]
+    (if (empty? ids)
+      (f)
+      (.getBindingData js/app (first ids)
+        (partial binding-data->fn
+          #(get-binding-data (rest ids) (partial f %)))))))

 (defn set-binding-data!
-  "Replace binding selection with given matrix data."
-  [id matrix] (.setBindingData js/app id (clj->js matrix)))
+  "Replace binding selection with given matrix data.
+  Multiple pairs of id and matrix may be given."
+  [id matrix & rest]
+  (.setBindingData js/app id (clj->js matrix))
+  (if (= 2 (count (take 2 rest)))
+    (set-binding-data! (first rest) (second rest) (drop 2 rest))))

 (defn add-binding-data-event
   "Subscribe to data changes on binding id, passing it to given function
   whenever it is changed."
-  [id fn] (.addBindingDataEvent js/app id fn))
+  [id f]
+  (.addBindingDataEvent js/app id f))

 (defn remove-binding
   "Removes an existing binding. Any data within the binding remains in sheet."
-  [id] (.removeBinding js/app id))
+  [id]
+  (.removeBinding js/app id))

 (defn remove-binding-data-event
   "Unsubscribe to data changes on binding id."
-  [id] (.removeBindingDataEvent js/app id))
+  [id]
+  (.removeBindingDataEvent js/app id))

 (defn show-sp
   "Show scratchpad editor"


Correctly wait for notification to animate on

--- src-cljs/frontend/components/pieces/flash_notification.cljs
+++ src-cljs/frontend/components/pieces/flash_notification.cljs
@@ -92,6 +92,9 @@
           ;; Show the notification we just took off the channel.
           (om-next/update-state! this assoc :notification notification)

+          ;; Wait for the notification to animate on.
+          (<! (timeout presenter-animation-duration))
+
           ;; Park here until another notification arrives, the notification is
           ;; clicked, or we time out.
           (alt!
@@ -151,7 +154,8 @@
         (html
          [:div
           [:div {:style {:margin "10px 0"}}
-           (button/button {:on-click #(swap! state update :counter inc)}
+           (button/button {:primary? true
+                           :on-click #(swap! state update :counter inc)}
                           "Show Notification")]
           [:div {:style {:overflow "hidden"}}
            (when-not (zero? counter)