Teach defunk macro to store more appropriate arglist metadata.

--- src/overtone/helpers/lib.clj
+++ src/overtone/helpers/lib.clj
@@ -193,21 +193,24 @@
                  (first args))))
       arg-map)))

-(defmacro defunk [name docstring args & body]
-  (let [arg-names      (map first (partition 2 args))
-        arg-keys       (vec (map keyword arg-names))
-        default-map    (apply hash-map (syms-to-keywords args))
-        arg-pairs      (map #(str (first %) " " (second %)) (partition 2 args))
-        arg-pairs-str  (apply str (interpose ", " arg-pairs))
-        arg-string     (str "[" arg-pairs-str "]")
-        indented-doc   (indented-str-block docstring 55 2)
-        full-docstring (str arg-string "\n\n  " indented-doc)]
-    `(defn ~name
-       ~full-docstring
-       [& args#]
-       (let [{:keys [~@arg-names]}
-             (arg-mapper args# ~arg-keys ~default-map)]
-         ~@body))))
+(defmacro defunk [fn-name docstring args & body]
+  (let [arg-names       (map first (partition 2 args))
+        arg-names-symbs (vec (map symbol arg-names))
+        arg-keys        (vec (map keyword arg-names))
+        default-map     (apply hash-map (syms-to-keywords args))
+        arg-pairs       (map #(str (first %) " " (second %)) (partition 2 args))
+        arg-pairs-str   (apply str (interpose ", " arg-pairs))
+        arg-string      "Keyword arg fn with defaults:\n  "
+        arg-string      (str arg-string "[" arg-pairs-str "]")
+        indented-doc    (indented-str-block docstring 55 2)
+        full-docstring  (str arg-string "\n\n  " indented-doc)]
+    `(intern *ns* (with-meta '~fn-name
+                    {:doc ~full-docstring
+                     :arglists '(~arg-names-symbs)})
+             (fn [& args#]
+               (let [{:keys [~@arg-names]}
+                     (arg-mapper args# ~arg-keys ~default-map)]
+                 ~@body)))))

 (defn invert-map
   "Takes a map m and returns a new map that's keys are the m's vals and


capitalise ugen arg docstrings and update docstring for impulse

--- src/overtone/sc/ugen/osc.clj
+++ src/overtone/sc/ugen/osc.clj
@@ -4,9 +4,9 @@
 (def specs
      [
       {:name "Osc",
-       :args [{:name "buffer" :doc "lookup buffer"}
-              {:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "phase", :default 0.0 :doc "phase offset or modulator in radians"}],
+       :args [{:name "buffer" :doc "Lookup buffer"}
+              {:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "phase", :default 0.0 :doc "Phase offset or modulator in radians"}],
        :doc "Linear interpolating wavetable lookup oscillator with frequency and phase modulation inputs.

 This oscillator requires a buffer to be filled with a wavetable format signal.  This preprocesses the Signal into a form which can be used efficiently by the Oscillator.  The buffer size must be a power of 2.
@@ -16,8 +16,8 @@
 This can also be acheived by creating a Signal object and sending it the 'asWavetable' message, saving it to disk, and having the server load it from there."}

       {:name "SinOsc",
-       :args [{:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "phase", :default 0.0 :doc "phase offset or modulator in radians"}],
+       :args [{:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "phase", :default 0.0 :doc "Phase offset or modulator in radians"}],
        :doc "sine table lookup oscillator

 Note: This is the same as Osc except that the table has already been fixed as a sine table of 8192 entries."}
@@ -28,27 +28,27 @@
        :doc "very fast sine oscillator"}

       {:name "OscN",
-       :args [{:name "bufnum" :doc "buffer index.  The buffer size must be a power of 2.  The buffer should NOT be filled using Wavetable format (b_gen commands should set wavetable flag to false.  Raw signals (not converted with asWavetable) can be saved to disk and loaded into the buffer."}
-              {:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "phase", :default 0.0 :doc "phase offset or modulator in radians"}],
+       :args [{:name "bufnum" :doc "Buffer index.  The buffer size must be a power of 2.  The buffer should NOT be filled using Wavetable format (b_gen commands should set wavetable flag to false.  Raw signals (not converted with asWavetable) can be saved to disk and loaded into the buffer."}
+              {:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "phase", :default 0.0 :doc "Phase offset or modulator in radians"}],
        :doc "Noninterpolating wavetable lookup oscillator with frequency and phase modulation inputs.

 It is usually better to use the interpolating oscillator."}

       {:name "VOsc",
-       :args [{:name "bufpos" :doc " buffer index. Can be swept continuously among adjacent wavetable buffers of the same size."}
-              {:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "phase", :default 0.0 :doc "phase offset of modulator in radians"}],
+       :args [{:name "bufpos" :doc "Buffer index. Can be swept continuously among adjacent wavetable buffers of the same size."}
+              {:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "phase", :default 0.0 :doc "Phase offset of modulator in radians"}],
        :doc "A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will interpolate between two adjacent tables.

 This oscillator requires at least two buffers to be filled with a wavetable format signal.  This preprocesses the Signal into a form which can be used efficiently by the Oscillator.  The buffer size must be a power of 2.
 "}

       {:name "VOsc3",
-       :args [{:name "bufpos" :doc "buffer index. Can be swept continuously among adjacent wavetable buffers of the same size."}
-              {:name "freq1", :default 110.0 :doc "frequency in Hertz of first oscillator"}
-              {:name "freq2", :default 220.0 :doc "frequency in Hertz of second oscillator"}
-              {:name "freq3", :default 440.0 :doc "frequency in Hertz of third oscillator"}],
+       :args [{:name "bufpos" :doc "Buffer index. Can be swept continuously among adjacent wavetable buffers of the same size."}
+              {:name "freq1", :default 110.0 :doc "Frequency in Hertz of first oscillator"}
+              {:name "freq2", :default 220.0 :doc "Frequency in Hertz of second oscillator"}
+              {:name "freq3", :default 440.0 :doc "Frequency in Hertz of third oscillator"}],
        :doc "Three variable wavetable oscillators.

 A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will interpolate between two adjacent tables. This unit generator contains three oscillators at different frequencies, mixed together.
@@ -56,15 +56,15 @@
 This oscillator requires at least two buffers to be filled with a wavetable format signal.  This preprocesses the Signal into a form which can be used efficiently by the Oscillator.  The buffer size must be a power of 2. "}

       {:name "COsc",
-       :args [{:name "bufnum" :doc "the number of a buffer filled in wavetable format"}
-              {:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "beats", :default 0.5 :doc "beat frequency in Hertz"}],
+       :args [{:name "bufnum" :doc "The number of a buffer filled in wavetable format"}
+              {:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "beats", :default 0.5 :doc "Beat frequency in Hertz"}],
        :doc "Chorusing wavetable lookup oscillator. Produces sum of two signals at  (freq +/- (beats / 2)). Due to summing, the peak amplitude is twice that of the wavetable."}

       {:name "Formant",
-       :args [{:name "fundfreq", :default 440.0 :doc "fundamental frequency in Hertz (control rate)"}
-              {:name "formfreq", :default 1760.0 :doc "formant frequency in Hertz (control rate)"}
-              {:name "bwfreq", :default 880.0 :doc "pulse width frequency in Hertz. Controls the bandwidth of the formant (control rate)"}],
+       :args [{:name "fundfreq", :default 440.0 :doc "Fundamental frequency in Hertz (control rate)"}
+              {:name "formfreq", :default 1760.0 :doc "Formant frequency in Hertz (control rate)"}
+              {:name "bwfreq", :default 880.0 :doc "Pulse width frequency in Hertz. Controls the bandwidth of the formant (control rate)"}],
        :rates #{:ar},
        :doc "Generates a set of harmonics around a formant frequency at a given fundamental frequency.

@@ -72,8 +72,8 @@
 "}

       {:name "LFSaw",
-       :args [{:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "iphase", :default 0.0 :doc "initial phase offset. For efficiency reasons this is a value ranging from 0 to 2."}]
+       :args [{:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "iphase", :default 0.0 :doc "Initial phase offset. For efficiency reasons this is a value ranging from 0 to 2."}]
        :doc "low freq (i.e. not band limited) sawtooth oscillator"}

       {:name "LFPar" :extends "LFSaw"
@@ -87,12 +87,12 @@

       {:name "LFGauss",
-       :args [{:name "duration", :default 1 :doc "duration of one full cycle ( for freq input: dur = 1 / freq )
+       :args [{:name "duration", :default 1 :doc "Duration of one full cycle ( for freq input: dur = 1 / freq )
 "}
-              {:name "width", :default 0.1 :doc "relative width of the bell. Best to keep below 0.25 when used as envelope."}
-              {:name "iphase", :default 0.0 :doc "initial offset "}
-              {:name "loop", :default 1 :doc "if loop is > 0, UGen oscillates. Otherwise it calls doneAction after one cycle"}
-              {:name "action", :default NO-ACTION :doc "action to be evaluated after cycle completes"}]
+              {:name "width", :default 0.1 :doc "Relative width of the bell. Best to keep below 0.25 when used as envelope."}
+              {:name "iphase", :default 0.0 :doc "Initial offset "}
+              {:name "loop", :default 1 :doc "If loop is > 0, UGen oscillates. Otherwise it calls doneAction after one cycle"}
+              {:name "action", :default NO-ACTION :doc "Action to be evaluated after cycle completes"}]
        :rates #{:ar :kr}
        :doc "A non-band-limited gaussian function oscillator. Output ranges from minval to 1.

@@ -101,34 +101,34 @@
 "}

       {:name "LFPulse",
-       :args [{:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "iphase", :default 0.0 :doc "initial phase offset in cycles ( 0..1 )"
+       :args [{:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "iphase", :default 0.0 :doc "Initial phase offset in cycles ( 0..1 )"
                }
-              {:name "width", :default 0.5 :doc "pulse width duty cycle from zero to one"}]
+              {:name "width", :default 0.5 :doc "Pulse width duty cycle from zero to one"}]
        :signal-range :unipolar
        :rates #{:ar :kr}
        :doc "A non-band-limited pulse oscillator. Outputs a high value of one and a low value of zero.
 "}

       {:name "VarSaw",
-       :args [{:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "iphase", :default 0.0 :doc "initial phase offset in cycles ( 0..1 )"}
-              {:name "width", :default 0.5 :doc "duty cycle from zero to one."}]
+       :args [{:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "iphase", :default 0.0 :doc "Initial phase offset in cycles ( 0..1 )"}
+              {:name "width", :default 0.5 :doc "Duty cycle from zero to one."}]
        :rates #{:ar :kr}
        :doc "a variable duty cycle saw wave oscillator"}

       {:name "Impulse",
-       :args [{:name "freq", :default 440.0 :doc "frequency in Hertz"}
-              {:name "phase", :default 0.0 :doc "phase offset in cycles ( 0..1 )"}]
+       :args [{:name "freq", :default 440.0 :doc "Frequency in Hertz"}
+              {:name "phase", :default 0.0 :doc "Phase offset in cycles ( 0..1 )"}]
        :signal-range :unipolar
        :rates #{:ar :kr}
-       :doc "non band limited impulse oscillator"}
+       :doc "non band limited impulse oscillator. Outputs a single 1 every freq cycles per second and 0 the rest of the time."}

       {:name "SyncSaw",
-       :args [{:name "syncFreq", :default 440.0 :doc "frequency of the fundamental."}
-              {:name "sawFreq", :default 440.0 :doc "frequency of the slave synched sawtooth wave. sawFreq should always be greater than syncFreq."}]
+       :args [{:name "syncFreq", :default 440.0 :doc "Frequency of the fundamental."}
+              {:name "sawFreq", :default 440.0 :doc "Frequency of the slave synched sawtooth wave. sawFreq should always be greater than syncFreq."}]
        :muladd true
        :rates #{:ar :kr}
        :doc "hard sync sawtooth wave oscillator
@@ -149,9 +149,9 @@
        :doc "performs waveshaping on the input signal by indexing into a table"}

       {:name "DegreeToKey",
-       :args [{:name "bufnum" :doc "index of the buffer which contains the steps for each scale degree."}
-              {:name "in", :default 0.0 :doc "the input signal."}
-              {:name "octave", :default 12.0 :doc "the number of steps per octave in the scale. The default is 12."}]
+       :args [{:name "bufnum" :doc "Index of the buffer which contains the steps for each scale degree."}
+              {:name "in", :default 0.0 :doc "The input signal."}
+              {:name "octave", :default 12.0 :doc "The number of steps per octave in the scale. The default is 12."}]

        :rates #{:ar :kr}
        :doc "the input signal value is truncated to an integer value and used as an index into an octave repeating table of note values
@@ -159,8 +159,8 @@

       {:name "Select",
-       :args [{:name "which" :doc "index of array to select"}
-              {:name "array", :array true :doc "list of ugens to choose from"}]
+       :args [{:name "which" :doc "Index of array to select"}
+              {:name "array", :array true :doc "List of ugens to choose from"}]
        :rates #{:ar :kr}
        :doc "select the output signal from an array of inputs"}


improve diagnostic message

improve diagnostic message

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -103,7 +103,7 @@
                                   parent-value :val1
                                   head-value :val2} (fail-path parent {:head child})]
                              (str "parent[" path        "]= " parent-value ";"
-                                  "child[" (rest path) "]= " head-value ".")))))
+                                  "child[" (string/replace path #"^:head" "") "]= " head-value ".")))))

           (if (= *extra-diagnostics* true)
             (let [fail-path (get-fail-path (get-in parent [:head]) child)]


+precheck: treat :propernoun as a head feature

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -114,6 +114,8 @@
                   (get-in child [:synsem :cat] :top)))
    (fail? (unifyc (get-in parent [:head :synsem :pronoun] :top)
                   (get-in child [:synsem :pronoun] :top)))
+   (fail? (unifyc (get-in parent [:head :synsem :propernoun] :top)
+                  (get-in child [:synsem :propernoun] :top)))
    (fail? (unifyc (get-in parent [:head :synsem :subcat :1] :top)
                   (get-in child [:synsem :subcat :1] :top)))
    (fail? (unifyc (get-in parent [:head :synsem :subcat :2] :top)


feat(backend): enable proper multipart handling

--- backend/src/uxbox/api/middleware.clj
+++ backend/src/uxbox/api/middleware.clj
@@ -15,6 +15,7 @@
             [reitit.ring.middleware.exception :as exception]
             [ring.middleware.session :refer [wrap-session]]
             [ring.middleware.session.cookie :refer [cookie-store]]
+            [ring.middleware.multipart-params :refer [wrap-multipart-params]]
             [struct.core :as st]
             [uxbox.api.errors :as api-errors]
             [uxbox.util.data :refer [normalize-attrs]]
@@ -37,20 +38,26 @@
 (def ^:private normalize-params-middleware
   {:name ::normalize-params-middleware
    :wrap (fn [handler]
-           (letfn [(transform-request [request]
-                     (if-let [data (get request :query-params)]
-                       (assoc request :query-params (normalize-attrs data))
-                       request))]
+           (letfn [(transform-request [request key]
+                     (if-let [data (get request key)]
+                       (assoc request key (normalize-attrs data))
+                       request))
+                   (transform [request]
+                     (-> request
+                         (transform-request :query-params)
+                         (transform-request :multipart-params)))]
              (fn
-               ([request] (handler (transform-request request)))
+               ([request] (handler (transform request)))
                ([request respond raise]
                 (try
                   (try
-                    (let [request (transform-request request)]
-                      (handler (transform-request request) respond raise))
+                    (handler (transform request) respond raise)
                     (catch Exception e
                       (raise e))))))))})

+(def ^:private multipart-params-middleware
+  {:name ::multipart-params-middleware
+   :wrap wrap-multipart-params})

 (def ^:private parameters-validation-middleware
   (letfn [(prepare [parameters]
@@ -60,6 +67,7 @@
                               :path :path-params
                               :query :query-params
                               :body :body-params
+                              :multipart :multipart-params
                               (throw (ex-info "Not supported key on :parameters" {})))]
                  (assoc acc newkey {:key key
                                     :fn #(st/validate % spec)})))
@@ -128,8 +136,6 @@
    :data {:muuntaja muuntaja-instance
           :middleware [session-middleware
                        parameters/parameters-middleware
-                       normalize-params-middleware
-                       ;; content-negotiation
                        muuntaja/format-negotiate-middleware
                        ;; encoding response body
                        muuntaja/format-response-middleware
@@ -137,10 +143,12 @@
                        exception-middleware
                        ;; decoding request body
                        muuntaja/format-request-middleware
-                       ;; validation
-                       parameters-validation-middleware
                        ;; multipart
-                       multipart/multipart-middleware]}})
+                       multipart-params-middleware
+                       ;; parameters normalization
+                       normalize-params-middleware
+                       ;; parameters validation
+                       parameters-validation-middleware]}})

 (defn handler
   [invar]


Fix smiley example

Fix smiley example

--- re-view-template/resources/leiningen/new/re_view/examples.cljs
+++ re-view-template/resources/leiningen/new/re_view/examples.cljs
@@ -6,14 +6,11 @@
          "A more advanced example using the :view/state atom, a lifecycle method,
           and a custom method."
          {:view/initial-state    {:mouse-position [150 100]}
-          :view/did-mount        (fn [this]
+          :update-mouse-position (fn [{:keys [view/state] :as this} e]
                                    (let [element (v/dom-node this)
                                          position (.getBoundingClientRect element)]
-                                     (swap! (:view/state this) assoc :base-position [(.-left position) (.-top position)])))
-          :update-mouse-position (fn [{:keys [view/state]} e]
-                                   (let [[left-offset top-offset] (:base-position @state)]
-                                     (swap! state assoc :mouse-position [(- (.-clientX e) left-offset)
-                                                                         (- (.-clientY e) top-offset)])))}
+                                     (swap! state assoc :mouse-position [(- (.-clientX e) (.-left position))
+                                                                         (- (.-clientY e) (.-top position))])))}
          [this]
          (let [{[mouse-left mouse-top] :mouse-position} @(:view/state this)]
            [:div


[aether] Enable Aether signing on deploy (#708)

--- boot/aether/src/boot/aether.clj
+++ boot/aether/src/boot/aether.clj
@@ -348,6 +348,7 @@
   (let [pom-str                                      (pod/pom-xml jarpath pompath)
         {:keys [project version classifier] :as pom} (pom-xml-parse-string pom-str)
         pomfile                                      (pom-xml-tmp pom-str)]
+    (System/setProperty "aether.checksums.forSignature" "true")
     (aether/deploy
      :coordinates  [project version :classifier classifier]
      :pom-file     (when-not classifier (io/file pomfile))


Update radio ui to match conventions

Update radio ui to match conventions

--- src/zaffre/components/ui.cljc
+++ src/zaffre/components/ui.cljc
@@ -175,7 +175,7 @@
                 cursor-char-off
                 cursor-fg
                 cursor-bg]} (get props :style)
-        cursor (if (and focused show-cursor) cursor-char-on (if selected "x" " "))]
+        cursor (if (and focused show-cursor) cursor-char-on (if selected "*" " "))]
      (g/use-effect (fn []
        (go-loop []
          (<! (timeout 400))
@@ -183,7 +183,7 @@
          (recur))) [])

     [:view props
-      (cons [:text {:key "radio-text"} (str "[" cursor "]")]
+      (cons [:text {:key "radio-text"} (str "(" cursor ")")]
         children)]))

 (g/defcomponent ProgressBar


fix syntax error

fix syntax error

--- src_patient/patient/misc.cljs
+++ src_patient/patient/misc.cljs
@@ -2,7 +2,7 @@
   (:require [re-frame.core :refer [subscribe]]
             [mobile-patient.lib.helper :as h]))

-(defn setup-temperature [{:keys date value}]
+(defn setup-temperature [{:keys [date value]}]
   (let [patient-id @(subscribe [:get-in [:user :ref :id]])
         base-url @(subscribe [:get-in [:config :base-url]])
         data (h/vital-observation-data-wrapper patient-id


dry up app url in tests

dry up app url in tests

--- pedestal-app/test/semtag_web/integration_test.clj
+++ pedestal-app/test/semtag_web/integration_test.clj
@@ -28,6 +28,9 @@
   (original-report m)
   (taxi/take-screenshot :file (screenshot-file ".clojure-test-error-")))

+(defn app-url [& args]
+  (apply str "/semtag-web-test.html" args))
+
 (use-fixtures :each
               (fn [f]
                 (taxi/set-driver! (init-driver {:webdriver (PhantomJSDriver. (DesiredCapabilities. ))}))
@@ -50,18 +53,18 @@
   (forward))

 (deftest urls-get-updated-correctly
-  (is (.endsWith (taxi/current-url) "/semtag-web-test.html"))
+  (is (.endsWith (taxi/current-url) (app-url)))
   (click "Tag Stats")
-  (is (.endsWith (taxi/current-url) "/semtag-web-test.html#/tag-stats"))
+  (is (.endsWith (taxi/current-url) (app-url "#/tag-stats")))

   (click "Type Stats")
-  (is (.endsWith (taxi/current-url) "/semtag-web-test.html#/types"))
+  (is (.endsWith (taxi/current-url) (app-url "#/types")))

   (click "All The Things")
-  (is (.endsWith (taxi/current-url) "/semtag-web-test.html#/all"))
+  (is (.endsWith (taxi/current-url) (app-url "#/all")))

   (click "Home")
-  (is (.endsWith (taxi/current-url) "/semtag-web-test.html#/")))
+  (is (.endsWith (taxi/current-url) (app-url "#/"))))

 (deftest search-submit-works
   (taxi/input-text "#url_search_text" "feynman")


compojure-api routing perf

compojure-api routing perf

--- perf-test/clj/reitit/opensensors_routing_test.clj
+++ perf-test/clj/reitit/opensensors_routing_test.clj
@@ -4,6 +4,7 @@
             [clojure.string :as str]
             [bidi.bidi :as bidi]
             [ataraxy.core :as ataraxy]
+            [compojure.api.sweet :refer [api routes context ANY]]
             [reitit.core :as reitit]))

 (defn raw-title [color s]
@@ -266,6 +267,83 @@
               ["topics/" topic] [:test/route47 topic]
               "topics" [:test/route50]}}))

+(def opensensors-compojure-api-routes
+  (let [handler (constantly {:status 200, :body ""})]
+    (routes
+      (context "/v1" []
+        (context "/public" []
+          (ANY "/topics/:topic" [] {:name :test/route4} handler)
+          (ANY "/users/:user-id" [] {:name :test/route16} handler)
+          (ANY "/orgs/:org-id" [] {:name :test/route18} handler))
+        (context "/users/:user-id" []
+          (ANY "/orgs/:org-id" [] {:name :test/route5} handler)
+          (ANY "/invitations" [] {:name :test/route7} handler)
+          (ANY "/topics" [] {:name :test/route9} handler)
+          (ANY "/bookmarks/followers" [] {:name :test/route10} handler)
+          (context "/devices" []
+            (ANY "/" [] {:name :test/route15} handler)
+            (ANY "/bulk" [] {:name :test/route21} handler)
+            (ANY "/:client-id" [] {:name :test/route35} handler)
+            (ANY "/:client-id/reset-password" [] {:name :test/route49} handler))
+          (ANY "/device-errors" [] {:name :test/route22} handler)
+          (ANY "/usage-stats" [] {:name :test/route24} handler)
+          (ANY "/claim-device/:client-id" [] {:name :test/route26} handler)
+          (ANY "/owned-orgs" [] {:name :test/route31} handler)
+          (ANY "/bookmark/:topic" [] {:name :test/route33} handler)
+          (ANY "/" [] {:name :test/route36} handler)
+          (ANY "/orgs" [] {:name :test/route52} handler)
+          (ANY "/api-key" [] {:name :test/route43} handler)
+          (ANY "/bookmarks" [] {:name :test/route56} handler))
+        (ANY "/search/topics/:term" [] {:name :test/route6} handler)
+        (context "/orgs" []
+          (ANY "/" [] {:name :test/route55} handler)
+          (context "/:org-id" []
+            (context "/devices" []
+              (ANY "/" [] {:name :test/route37} handler)
+              (ANY "/:device-id" [] {:name :test/route13} handler)
+              (ANY "/:batch/:type" [] {:name :test/route8} handler))
+            (ANY "/usage-stats" [] {:name :test/route12} handler)
+            (ANY "/invitations" [] {:name :test/route19} handler)
+            (context "/members" []
+              (ANY "/:user-id" [] {:name :test/route34} handler)
+              (ANY "/" [] {:name :test/route38} handler)
+              (ANY "/invitation-data/:user-id" [] {:name :test/route39} handler))
+            (ANY "/errors" [] {:name :test/route17} handler)
+            (ANY "/" [] {:name :test/route42} handler)
+            (ANY "/confirm-membership/:token" [] {:name :test/route46} handler)
+            (ANY "/topics" [] {:name :test/route57} handler)))
+        (context "/messages" []
+          (ANY "/user/:user-id" [] {:name :test/route14} handler)
+          (ANY "/device/:client-id" [] {:name :test/route30} handler)
+          (ANY "/topic/:topic" [] {:name :test/route48} handler))
+        (context "/topics" []
+          (ANY "/:topic" [] {:name :test/route32} handler)
+          (ANY "/" [] {:name :test/route54} handler))
+        (ANY "/whoami" [] {:name :test/route41} handler)
+        (ANY "/login" [] {:name :test/route51} handler))
+      (context "/v2" []
+        (ANY "/whoami" [] {:name :test/route1} handler)
+        (context "/users/:user-id" []
+          (ANY "/datasets" [] {:name :test/route2} handler)
+          (ANY "/devices" [] {:name :test/route25} handler)
+          (context "/topics" []
+            (ANY "/bulk" [] {:name :test/route29} handler)
+            (ANY "/" [] {:name :test/route54} handler))
+          (ANY "/" [] {:name :test/route45} handler))
+        (context "/public" []
+          (context "/projects/:project-id" []
+            (ANY "/datasets" [] {:name :test/route3} handler)
+            (ANY "/" [] {:name :test/route27} handler))
+          (ANY "/messages/dataset/bulk" [] {:name :test/route20} handler)
+          (ANY "/datasets/:dataset-id" [] {:name :test/route28} handler)
+          (ANY "/messages/dataset/:dataset-id" [] {:name :test/route53} handler))
+        (ANY "/datasets/:dataset-id" [] {:name :test/route11} handler)
+        (ANY "/login" [] {:name :test/route23} handler)
+        (ANY "/orgs/:org-id/topics" [] {:name :test/route40} handler)
+        (ANY "/schemas" [] {:name :test/route44} handler)
+        (ANY "/topics/:topic" [] {:name :test/route47} handler)
+        (ANY "/topics" [] {:name :test/route50} handler)))))
+
 (comment
   (bench opensensors-routes false)
   (bench opensensors-routes true))
@@ -282,6 +360,12 @@
       (let [match (ataraxy/matches ataraxy-routes {:uri route})]
         (if-not match
           (println route))))))
+
+(comment
+  (doseq [route (valid-urls (reitit/router opensensors-routes))]
+    (let [match (opensensors-compojure-api-routes {:uri route :request-method :get})]
+      (if-not match
+        (println route)))))

 (defn bench! [routes name f]
   (System/gc)
@@ -296,10 +380,12 @@
         router (reitit/router routes)
         reitit-f #(reitit/match-by-path router %)
         bidi-f #(bidi/match-route opensensors-bidi-routes %)
-        ataraxy-f #(ataraxy/matches opensensors-ataraxy-routes {:uri %})]
-    (bench! routes "reitit" reitit-f)
-    (bench! routes "bidi" bidi-f)
-    (bench! routes "ataraxy" ataraxy-f)))
+        ataraxy-f #(ataraxy/matches opensensors-ataraxy-routes {:uri %})
+        compojure-api-f #(opensensors-compojure-api-routes {:uri % :request-method :get})]
+    (bench! routes "reitit" reitit-f)                       ;;  2958ns    11%
+    (bench! routes "bidi" bidi-f)                           ;; 18919ns    71%
+    (bench! routes "ataraxy" ataraxy-f)                     ;; 26461ns   100%
+    (bench! routes "compojure-api" compojure-api-f)))       ;; 10463ns    40%

 (comment
   (bench-all!))


DRY up and organize rendering by screens

--- pedestal-app/app/src/semtag_web/rendering.cljs
+++ pedestal-app/app/src/semtag_web/rendering.cljs
@@ -24,18 +24,28 @@
 (defn- frequency-stat [title data]
   (format "%s: %s - %s" title (count data) (frequencies-string data)))

+(defn clear-id [id]
+  (fn [_ _ _] (dom/set-html! (dom/by-id id) "")))
+
+(defn focus-fn [screen]
+  (fn [{:keys [transform messages]}]
+    (msg/fill transform messages {:value (name screen)})))
+
+(defn navigate-fn [screen]
+  (fn [_ _ input-queue]
+    (history/navigated input-queue screen)))
+
 ;; Rendering fns

 (def templates (html-templates/semtag-web-templates))

+;;; Home
+;;;
 (defn render-home-page [renderer [_ path] input-queue]
   (history/navigated input-queue :home)
   (let [html (templates/add-template renderer path (:semtag-web-page templates))]
     ;; didn't use get-parent-id cause it doesn't work for new multi-level paths
     (dom/set-html! (dom/by-id "content") (html {}))))
-
-(defn clear-id [id]
-  (fn [_ _ _] (dom/set-html! (dom/by-id id) "")))

 (defn set-search-title [renderer [_ path _ new-value] _]
   (dom/set-html! (dom/by-id "search_title") new-value))
@@ -54,6 +64,20 @@
                         :row-partial p/tag-search-row
                         :caption (format "Total: %s" (count (map :url things)))))))

+(defn render-tags-results [_ [_ _ _ new-value] _]
+  (dom/insert-after!
+    (dom/by-id "url_search_text")
+    (p/generate-datalist new-value)))
+
+(defn url-search [{:keys [transform messages]}]
+  (msg/fill transform messages {:query (.-value (dom/by-id "url_search_text"))
+                                :search-type (dom/value (css/sel "input[name=search_type]:checked"))}))
+
+(defn create-url [{:keys [transform messages]}]
+  (msg/fill transform messages {:value (dom/value (dom/by-id "add_url_text"))}))
+
+;;; Other pages
+;;;
 (defn render-types-results [_ [_ _ _ new-value] _]
   (dom/set-html!
     (dom/by-id "content")
@@ -64,10 +88,7 @@
                       :row-partial p/type-stats-row
                       :fields [:name :count :name-percent :url-percent])))

-(defn render-tags-results [_ [_ _ _ new-value] _]
-  (dom/insert-after!
-    (dom/by-id "url_search_text")
-    (p/generate-datalist new-value)))
+

 (defn render-tag-stats-results [_ [_ _ _ new-value] _]
   (dom/set-html!
@@ -85,27 +106,6 @@
                       :caption (str "Total: " (count new-value))
                       :fields [:type :name :url :tags :created-at])))

-(defn focus-fn [screen]
-  (fn [{:keys [transform messages]}]
-    (msg/fill transform messages {:value (name screen)})))
-
-(defn url-search [{:keys [transform messages]}]
-  (msg/fill transform messages {:query (.-value (dom/by-id "url_search_text"))
-                                :search-type (dom/value (css/sel "input[name=search_type]:checked"))}))
-
-(defn create-url [{:keys [transform messages]}]
-  (msg/fill transform messages {:value (dom/value (dom/by-id "add_url_text"))}))
-
-(defn render-types-page [_ _ input-queue]
-  (history/navigated input-queue :types))
-
-(defn render-tag-stats-page [_ _ input-queue]
-  (history/navigated input-queue :tag-stats))
-
-(defn navigate-fn [screen]
-  (fn [_ _ input-queue]
-    (history/navigated input-queue screen)))
-
 (defn render-config []
   (reduce
     into
@@ -117,12 +117,12 @@
       [:value [:app-model :home :search-results] render-search-results]

       ;; types page
-      [:node-create [:app-model :types] render-types-page]
+      [:node-create [:app-model :types] (navigate-fn :types)]
       [:node-destroy [:app-model :types] (clear-id "content")]
       [:value [:app-model :types :types-results] render-types-results]

       ;; tag-stats page
-      [:node-create [:app-model :tag-stats] render-tag-stats-page]
+      [:node-create [:app-model :tag-stats] (navigate-fn :tag-stats)]
       [:node-destroy [:app-model :tag-stats] (clear-id "content")]
       [:value [:app-model :tag-stats :tag-stats-results] render-tag-stats-results]


fix error format for join

fix error format for join

--- src/wombats/daos/game.clj
+++ src/wombats/daos/game.clj
@@ -207,11 +207,12 @@
                           initial-stats]])

       (game-sockets/broadcast-game-info ((get-game-state-by-id conn) game-id))
+
       (catch Exception e
-        (clojure.pprint/pprint (-> e
-                                   (.getCause)
-                                   (ex-data)
-                                   (wombat-error)))))))
+        (-> e
+            (.getCause)
+            (ex-data)
+            (wombat-error))))))

 (defn- update-frame-state
   [conn]


add timeout for demo

add timeout for demo

--- src/wombats/game/core.clj
+++ src/wombats/game/core.clj
@@ -103,7 +103,7 @@
           (p/source-decisions aws-credentials)
           (p/process-decisions)
           (f/finalize-frame)
-          #_(timeout-frame 500)
+          (timeout-frame 1000)
           (push-frame-to-clients)
           (push-stats-update-to-clients)
           #_(frame-debugger 1000)


Add repl start function to start chat adapters

--- src/yetibot/core/repl.clj
+++ src/yetibot/core/repl.clj
@@ -1,18 +1,22 @@
 (ns yetibot.core.repl
   "Load this namespace when working with YetiBot in the REPL or during dev."
   (:require
-    [yetibot.core.db :refer [repl-start]]
+    [yetibot.core.db :as db]
     [yetibot.core.models.users :as users]
-    [yetibot.core.loader :refer [load-commands-and-observers load-ns]]))
+    [yetibot.core.loader :refer [load-commands-and-observers load-ns]]
+    [yetibot.core.adapters.campfire :as cf]
+    [yetibot.core.adapters.irc :as irc]))

 ; use a few non-network commands for testing
 (defn load-minimal []
   (require 'yetibot.core.commands.echo :reload)
   (require 'yetibot.core.commands.collections :reload))

-(load-minimal)
-
-(repl-start)
+(defn start []
+  (load-minimal)
+  (db/repl-start)
+  (cf/start)
+  (irc/start))

 (defn load-all []
   (future


Can process dependencies section of pom

Can process dependencies section of pom

--- src/descent/pom_parser.clj
+++ src/descent/pom_parser.clj
@@ -5,6 +5,7 @@
 (defn load-pom [pom-location] (parse (java.io.File. pom-location)))

 (def pom (load-pom "resources/pom.xml"))
+

 ;(:tag pom)
 ;(:attrs pom)
@@ -200,3 +201,22 @@

 ;;; Functions to process dependencies

+(defn- get-deps-from-dependencies-section
+  "Given a pom, extract the dependencies from dependencies section."
+  [pom]
+  (-> (filter #(tag-equals? % :dependencies) (:content pom))
+      first :content))
+
+(get-deps-from-dependencies-section pom)
+
+
+(defn process-dependencies-section
+  [pom]
+  (if (pom-has-dependencies? pom)
+    (let [properties (get-dependencies-from-properties pom)
+          deps (get-deps-from-dependencies-section pom)
+          deps-seq (map #(make-dependency-version-pair % properties) deps)]
+      (into {} deps-seq))
+    nil))
+
+(process-dependencies-section pom)


fix for stderr binding

fix for stderr binding

--- src/cake/server.clj
+++ src/cake/server.clj
@@ -116,8 +116,6 @@
         log-stream  (PrintStream. (FileOutputStream. logfile) true)
         log-writer  (PrintWriter. log-stream true)]
     (System/setIn  null-stream)
-    (System/setErr log-stream)
     (System/setOut log-stream)
     (alter-var-root #'*in*  (fn [_] null-writer))
-    (alter-var-root #'*out* (fn [_] log-writer))
-    (alter-var-root #'*err* (fn [_] log-writer))))
+    (alter-var-root #'*out* (fn [_] log-writer))))


Add required dependency on digest.

Add required dependency on digest.

--- src/cavm/loader.clj
+++ src/cavm/loader.clj
@@ -2,6 +2,7 @@
   (:require [cavm.fs-utils :refer [relativize]])
   (:require [clj-time.coerce :refer [from-long]])
   (:require [clojure.java.io :as io])
+  (:require [digest])
   (:require [cavm.db :as cdb]))

 ; Combines file readers with db writers.


white background on gif

white background on gif

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -161,7 +161,7 @@
   (go
     (let [img (<! (@img-cache tick))
           s   (/ capture-size grid-size)]
-      (.clearRect playback-ctx 0 0 capture-size capture-size)
+      (.fillRect playback-ctx 0 0 capture-size capture-size)
       (doseq [[idx pos] (:cells (moves tick))]
         (if-not (= idx :empty)
           (let [[x1 y1] (get-cell-xy idx grid-size)
@@ -296,9 +296,9 @@
       om/IDidMount
       (did-mount [_]
         (def playback-ctx
-          (->
-            (om/get-node owner "playback")
-            (.getContext "2d")))
+          (let [ctx (-> (om/get-node owner "playback") (.getContext "2d"))]
+            (aset ctx "fillStyle" "#fff")
+            ctx))

         (defonce resize-loop
           (let [resize-chan (chan)]


convert the unit test of testing4j to clojure

--- src/clj/backtype/storm/testing4j.clj
+++ src/clj/backtype/storm/testing4j.clj
@@ -25,7 +25,7 @@
              ^:static [withTrackedCluster [backtype.storm.testing.MkClusterParam backtype.storm.testing.TestJob] void]
              ^:static [readTuples [java.util.Map String String] java.util.List]
              ^:static [readTuples [java.util.Map String] java.util.List]
-             ^:static [submitLocalTopology [Object String
+             ^:static [submitLocalTopology [backtype.storm.ILocalCluster String
                                             backtype.storm.Config backtype.storm.generated.StormTopology]
                        void]
              ^:static [mkTrackedTopology [backtype.storm.ILocalCluster backtype.storm.generated.StormTopology] backtype.storm.testing.TrackedTopology]
@@ -99,8 +99,8 @@
   ([^Map result ^String componentId]
      (-readTuples result componentId Utils/DEFAULT_STREAM_ID)))

-(defn -submitLocalTopology [^Object nimbus ^String topologyName ^Config config ^StormTopology topology]
-  (submit-local-topology nimbus topologyName config topology))
+(defn -submitLocalTopology [^ILocalCluster cluster ^String topologyName ^Config config ^StormTopology topology]
+  (submit-local-topology (.getNimbus cluster) topologyName config topology))

 (defn -mkTrackedTopology [^ILocalCluster trackedCluster ^StormTopology topology]
   (-> (mk-tracked-topology (.getState trackedCluster) topology)


Refactor - create `get-ModulesMapLesson-seq` function

This covers a little bit of the abstraction breach in the
`add-module-lesson-group` function.

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -10,6 +10,20 @@
 ; Data type Definitions
 ; =====================
 ;
+; ModulesMapLesson
+; ----------------
+; A Lesson in the `ModulesMap` JavaScript global.
+;
+; {
+;   :venue     -> String of the lesson venue
+;   :day       -> 0-indexed integer of the day, where 0 = Monday,
+;                 1 = Tuesday, etc, until 4 = Friday
+;   :startTime -> 0-indexed integer of the time, where 0 = 0800, 1 = 030, and
+;                 so on.
+;   :endTime   -> similar to :startTime
+; }
+;
+;
 ; TimetableLessonInfo (abbrev: ttLessonInfo)
 ; ------------------------------------------
 ; Describes a lesson in the `Timetable` global; this is the key used for each
@@ -115,6 +129,12 @@
   [moduleCode lessonType lessonGroup]
   (let [lessonGroupsMap (get-module-lesson-groups-map moduleCode lessonType)]
     (not (nil? (get lessonGroupsMap lessonGroup)))))
+
+(defn- get-ModulesMapLesson-seq
+  "Returns a sequence of `ModulesMapLesson` objects representing all lessons
+   for a lesson group of the module."
+  [moduleCode lessonType lessonGroup]
+  (get (get-module-lesson-groups-map moduleCode lessonType) lessonGroup))

 (def ^{:doc     "Width in pixels of a half hour timeslot"
        :private true
@@ -514,8 +534,7 @@
     $divElem))

 (defn- add-module-lesson!
-  "Adds a single lesson of a module (obtained from the `ModulesMap` global) to
-   the timetable.
+  "Adds a single lesson of a module the timetable.
    Returns a `ModulesSelectedLessonInfo` object augmented with the `:divElem`,
    `:moduleCode`, `:lessonType` and `:lessonGroup` keys."
   [moduleCode moduleName lessonType lessonLabel modulesMapLesson bgColorCssClass
@@ -731,63 +750,57 @@

    Returns a sequence of `ModulesSelectedLessonInfo` objects each augmented
    with the `:divElem`, `:moduleCode`, `:lessonType`, `:lessonGroup` keys."
-  [moduleCode lessonType lessonLabel bgColorCssClass isActuallySelected?
-   & {:keys [ModulesMap]
-      :or   {ModulesMap (get-ModulesMap)}}]
-
-  (let [; TODO: Refactor
-        modulesMapLessonSeq (get-in ModulesMap [moduleCode "lessons" lessonType
-                                                lessonLabel])]
-
-    (if (module-has-lesson-group? moduleCode lessonType lessonLabel)
-        (let [moduleName (get-module-name-from-module-code moduleCode)
-
-              augLessonInfoSeq
-              (doall (map (fn [modulesMapLesson]
-                            (add-module-lesson! moduleCode moduleName
-                                                           lessonType
-                                                           lessonLabel
-                                                           modulesMapLesson
-                                                           bgColorCssClass
-                                                           isActuallySelected?))
-                          modulesMapLessonSeq))
-
-              lessonInfoSeq (map #(dissoc %1 :divElem :moduleCode :lessonType
-                                          :lessonGroup)
-                                 augLessonInfoSeq)
-              $divElemSeq   (map #(:divElem %1) augLessonInfoSeq)]
-
-          (if isActuallySelected?
-              (do
-                ; Update ModulesSelected with the lesson group
-                (set! ModulesSelected
-                      (assoc-in ModulesSelected [moduleCode lessonType]
-                                {:label lessonLabel, :info lessonInfoSeq}))
-
-                ; Add to ModulesSelectedOrder
-                (if (not-any? #{moduleCode} ModulesSelectedOrder)
-                    (do
-                      (set! ModulesSelectedOrder
-                            (conj ModulesSelectedOrder moduleCode))
-                      ; Update select2 box.
-                      ; NOTE: This does a quadratic amount of work but I do not
-                      ;       have a workaround.
-                      (select2/select2-box-set-val
-                        select2/$Select2-Box
-                        (get-selected-module-codes-as-js-array))))
-
-                ; Only lesson types with more than 1 option of lesson group
-                ; will be draggable
-                (if (module-lesson-type-has-multiple-choices? moduleCode
-                                                              lessonType)
-                    (make-added-lessons-draggable $divElemSeq moduleCode
-                                                  lessonType lessonLabel
-                                                  bgColorCssClass)))
-
-              ; lesson was added due to draggable

-              ; Make it droppable
-              (make-fake-lessons-droppable augLessonInfoSeq))
-          augLessonInfoSeq))))
+  [moduleCode lessonType lessonLabel bgColorCssClass isActuallySelected?]
+  (if (module-has-lesson-group? moduleCode lessonType lessonLabel)
+      (let [moduleName          (get-module-name-from-module-code moduleCode)
+            modulesMapLessonSeq (get-ModulesMapLesson-seq moduleCode lessonType
+                                                          lessonLabel)
+
+            augLessonInfoSeq
+            (doall (map (fn [modulesMapLesson]
+                          (add-module-lesson! moduleCode moduleName
+                                                         lessonType
+                                                         lessonLabel
+                                                         modulesMapLesson
+                                                         bgColorCssClass
+                                                         isActuallySelected?))
+                        modulesMapLessonSeq))
+
+            lessonInfoSeq       (map #(dissoc %1 :divElem :moduleCode
+                                              :lessonType :lessonGroup)
+                                     augLessonInfoSeq)
+            $divElemSeq         (map #(:divElem %1) augLessonInfoSeq)]
+        (if isActuallySelected?
+            (do
+              ; Update ModulesSelected with the lesson group
+              (set! ModulesSelected
+                    (assoc-in ModulesSelected [moduleCode lessonType]
+                              {:label lessonLabel, :info lessonInfoSeq}))
+
+              ; Add to ModulesSelectedOrder
+              (if (not-any? #{moduleCode} ModulesSelectedOrder)
+                  (do
+                    (set! ModulesSelectedOrder
+                          (conj ModulesSelectedOrder moduleCode))
+                    ; Update select2 box.
+                    ; NOTE: This does a quadratic amount of work but I do not
+                    ;       have a workaround.
+                    (select2/select2-box-set-val
+                      select2/$Select2-Box
+                      (get-selected-module-codes-as-js-array))))
+
+              ; Only lesson types with more than 1 option of lesson group
+              ; will be draggable
+              (if (module-lesson-type-has-multiple-choices? moduleCode
+                                                            lessonType)
+                  (make-added-lessons-draggable $divElemSeq moduleCode
+                                                lessonType lessonLabel
+                                                bgColorCssClass)))
+
+            ; lesson was added due to draggable

+            ; Make it droppable
+            (make-fake-lessons-droppable augLessonInfoSeq))
+        augLessonInfoSeq)))

 (defn add-module!
   "Adds a module to the timetable.
@@ -816,8 +829,7 @@
                                    (:lessonType moduleInfo)
                                    (:lessonGroup moduleInfo)
                                    bgColorCssClass
-                                   true
-                                   ModulesMap))
+                                   true))

         ; Update URL hash with newly added module
         (update-document-location-hash-with-new-module!


no need to query artist list when active-artist in context

--- src/cljs/cljspazzer/client/core.cljs
+++ src/cljs/cljspazzer/client/core.cljs
@@ -53,8 +53,6 @@

 (defroute artist-path "/artists/:artist" [artist]
   (go
-    (if (nil? (:artists @app-state))
-      (swap! app-state assoc :artists (<! (services/artist-list-prefix (:active-nav @app-state "all")))))
     (let [response (<! (services/artist-detail artist))]
       (swap! app-state assoc :active-artist (response "artist"))
       (swap! app-state assoc :active-page pages/view-browse)
@@ -63,8 +61,6 @@

 (defroute album-path "/artists/:artist/albums/:album" [artist album]
   (go
-    (if (nil? (:artists @app-state))
-      (swap! app-state assoc :artists (<! (services/artist-list-prefix (:active-nav @app-state "all")))))
     (let [response (<! (services/album-detail artist album))]
       (swap! app-state assoc :active-artist artist)
       (swap! app-state assoc :active-page pages/view-browse)


celiaca

celiaca

--- src/cljs/just_married/home/rvsp.cljs
+++ src/cljs/just_married/home/rvsp.cljs
@@ -23,7 +23,7 @@
         :name-sample "Mario Rossi"
         :coming "Contaci"
         :comment "Altri commenti (allergie/esigenze particolari)"
-        :comment-sample "Per esempio la mia ragazza e' ciliaca, io posso mangiare arachidi"
+        :comment-sample "Per esempio la mia ragazza e' celiaca, io posso mangiare arachidi"
         :not-coming "Non posso"
         :confirmation-sent "Grazie per averci fatto sapere!"
         :how-many "Quanti siete?"}})


fix phone-detail ajax calls

fix phone-detail ajax calls

Conflicts:
	src/cljs/phonecat_re_frame/core.cljs

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -65,7 +65,8 @@
 (re-frame/register-pure-handler
  :process-phone-detail-response
  (fn
-   [app-state [_ [phone-id response]]]
+   ;; store info for the specific phone-id in the db
+   [app-state [_ phone-id response]]
    (assoc-in app-state [:phone-details (keyword phone-id)] response)))

 (re-frame/register-pure-handler
@@ -79,12 +80,14 @@
 (re-frame/register-pure-handler
  :load-phone-detail
  (fn
+   ;; fetch information for the phone with the given phone-id
    [app-state [_ phone-id]]
    (ajax/GET (str "phones/" phone-id ".json")
-             {:handler #(re-frame/dispatch [:process-phone-detail-response [phone-id %1]])
-              :error-handler #(re-frame/dispatch [:process-phone-detail-bad-response [phone-id %1]])
+             {:handler #(re-frame/dispatch [:process-phone-detail-response phone-id %1])
+              :error-handler #(re-frame/dispatch [:process-phone-detail-bad-response phone-id %1])
               :response-format :json
-              :keywords? true})))
+              :keywords? true})
+   app-state))

 (re-frame/register-handler
  :initialise-db             ;; usage: (dispatch [:initialise-db])


Forward options map instead of args.

Forward options map instead of args.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -65,8 +65,10 @@
    The main difference is that if the first argument on a line is a keyword,
    all elements on that line will be forwarded in a vector instead of being
    forwarded seperately."
-  [cmds err-fn]
-  (let [quit-commands (conj (:quit (get-cmd-aliases cmds)) :quit)]
+  [opts]
+  (let [cmds (opts :cmds)
+        err-fn (opts :print-err)
+        quit-commands (conj (:quit (get-cmd-aliases cmds)) :quit)]
     (fn [request-prompt request-exit]
       (try
         (or ({:line-start request-prompt :stream-end request-exit}
@@ -121,14 +123,17 @@
   "This function creates a read function that leverages jline2 for handling input.
    Thanks to the functionality provided by jline2, this allows, e.g., command history, command editing, or tab-completion.
    The input that is read is then forwarded to a repl read function that was created with create-repl-read-fn."
-  [cmds prompt-string err-fn]
-  (let [in-rdr (doto (ConsoleReader. nil *jline-input-stream* *jline-output-stream* nil)
+  [opts]
+  (let [cmds (opts :cmds)
+        err-fn (opts :print-err)
+        prompt-string (opts :prompt-string)
+        in-rdr (doto (ConsoleReader. nil *jline-input-stream* *jline-output-stream* nil)
                  (.addCompleter (StringsCompleter. (map name (keys cmds))))
                  (.setPrompt prompt-string))
         arg-hint-completers (create-arg-hint-completers cmds)
         _ (doseq [compl arg-hint-completers]
             (.addCompleter in-rdr compl))
-        rdr-fn (create-repl-read-fn cmds err-fn)]
+        rdr-fn (create-repl-read-fn opts)]
     (fn [request-prompt request-exit]
       (try
         (let [line (if *mock-jline-readline-input*
@@ -289,5 +294,5 @@
          :eval ((options# :eval-factory) (options# :cmds) (options# :allow-eval) (options# :print-err))
          :print (options# :print)
          :prompt (options# :prompt-fn)
-         :read (*read-factory* (options# :cmds) (options# :prompt-string) (options# :print-err))))))
-
+         :read (*read-factory* options#)))))
+


event handler fix list setup #186

event handler fix list setup
#186

--- src/cljs/swarmpit/event/handler.cljs
+++ src/cljs/swarmpit/event/handler.cljs
@@ -1,8 +1,22 @@
 (ns swarmpit.event.handler
   (:require [swarmpit.component.state :as state]))

+(def cursor [:form])
+
 (defmulti handle (fn [handler event] handler))
+
+(defmethod handle :service-list
+  [_ event]
+  (state/update-value [:items] event cursor))
+
+(defmethod handle :node-list
+  [_ event]
+  (state/update-value [:items] event cursor))
+
+(defmethod handle :task-list
+  [_ event]
+  (state/update-value [:items] event cursor))

 (defmethod handle :default
   [_ event]
-  (state/set-value event [:form]))+  (state/set-value event cursor))


partial highlighted current track functionality

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -168,6 +168,8 @@
             artist (.-artist tags)
             album (.-album tags)
             username (.-username data)
+            track-id (.-id data)
+            current-track-id (:current-track-id @core/app-state)
             content (list
                       (dom/span #js {:className "track-title"
                                      :title title}
@@ -180,7 +182,10 @@
                                 artist)
                       (dom/span #js {:className "track-uploader"
                                      :title (str "Added by " username)} "Added by " username))]
-        (dom/div #js {:className "track-view"} content)))))
+        (if (= current-track-id track-id)
+          (dom/div #js {:className "track-view"
+                        :style #js {:backgroundColor "#BABAB9"}} content)
+          (dom/div #js {:className "track-view"} content))))))

 (defn track-queue [data owner]
   (reify


don't use * binding

don't use * binding

--- src/clj/pw/core.clj
+++ src/clj/pw/core.clj
@@ -49,8 +49,8 @@
   (routes
    (resources "/")
    (GET "/" [] (index))
-   (POST "/pass/*" [* password]
-         (if-let [[pw] (get-password path * password)]
+   (POST ["/pass/:service" :service #"[-\w\/]+"] [service password]
+         (if-let [[pw] (get-password path service password)]
            (edn-response {:pass pw})
            (edn-response {:error "Invalid service or password"})))
    (not-found "404")))


uncomment mistakenly commented out function

--- src/ads_txt_crawler/process.clj
+++ src/ads_txt_crawler/process.clj
@@ -64,8 +64,8 @@
 ;;               (.println *err* (format "Error: non-text result for %s" url)))))
 ;;         (.println *err* (format "Error: Unknown issue calling %s" url))))))

-;; (defn build-url [domain]
-;;   (format "http://%s/ads.txt" domain))
+(defn build-url [domain]
+  (format "http://%s/ads.txt" domain))

 ;; (defn process
 ;;   "For a given domain build it's ads.txt url and return the urls it contains"


Improved docstring and recommendations on controling resource usage with query.

--- src/grafter/rdf/sesame.clj
+++ src/grafter/rdf/sesame.clj
@@ -524,12 +524,26 @@
       (throw e#))))

 (defprotocol ISPARQLable
-  "Quick and dirty sparql SELECT results.  Takes a connection and query
-string and returns a lazy sequence of results.
-
-It doesn't clear up properly in all cases, for example if the sequence
-isn't fully consumed you may cause a resource leak."
-
+  "NOTE this protocol is intended for low-level access.  End users
+  should use query instead.
+
+  Run an arbitrary SPARQL query.  Works with ASK, DESCRIBE, CONSTRUCT
+  and SELECT queries.
+
+  You can call this on a Repository however if you do you may in some
+  cases cause a resource leak, for example if the sequence of results
+  isn't fully consumed.
+
+  To use this without leaking resources it is recommended that you
+  call ->connection on your repository, inside a with-open; and then
+  consume all your results inside of a nested doseq/dorun/etc...
+
+  e.g.
+
+  (with-open [conn (->connection repo)]
+     (doseq [res (query conn \"SELECT * WHERE { ?s ?p ?o .}\")]
+        (println res)))
+  "
   ;; TODO: reimplement interfaces with proper resource handling.
   (query-dataset [this sparql-string model])

@@ -666,7 +680,25 @@
   (apply f (apply concat (butlast args) (last args))))

 (defn query
-  "Takes a repo and sparql string and an optional set of k/v argument
+  "Run an arbitrary SPARQL query.  Works with ASK, DESCRIBE, CONSTRUCT
+  and SELECT queries.
+
+  You can call this on a Repository however if you do you may in some
+  cases cause a resource leak, for example if the sequence of results
+  isn't fully consumed.
+
+  To use this without leaking resources it is recommended that you
+  call ->connection on your repository, inside a with-open; and then
+  consume all your results inside of a nested doseq/dorun/etc...
+
+  e.g.
+
+  (with-open [conn (->connection repo)]
+     (doseq [res (query conn \"SELECT * WHERE { ?s ?p ?o .}\")]
+        (println res)))
+
+
+  Takes a repo and sparql string and an optional set of k/v argument
   pairs, and executes the sparql query on the repository.

   Options are:


remove example statements

remove example statements

--- src/graphql_clj/parser.clj
+++ src/graphql_clj/parser.clj
@@ -296,6 +296,7 @@
                                       (execute-definition definition type-meta-fn)) definitions)))})))

 (comment
+  ;; Sample expressions
   (parse "query {user}")
   (parse "query {user {id}}")
   (transformer (parse "query {user {id}}"))
@@ -311,262 +312,3 @@
   }
 }"))
            graphql-clj.type/get-type-meta))
-
-
-(def statements
-  [
-   "query {
-  user(id: 4) {
-    id
-    name
-    profilePic(width: 100, height: 50.0)
-  }
-}
-"
-
-   "query {
-  user(id: 4) {
-    id
-    name
-    profilePic(width: 100, height: 50)
-  }
-}"
-
-   "{
-  user(id: 4) {
-    name
-  }
-}"
-
-   "mutation {
-  likeStory(storyID: 12345) {
-    story {
-      likeCount
-    }
-  }
-}"
-
-   "{
-  me {
-    id
-    firstName
-    lastName
-    birthday {
-      month
-      day
-    }
-    friends {
-      name
-    }
-  }
-}"
-
-   "# `me` could represent the currently logged in viewer.
-{
-  me {
-    name
-  }
-}
-"
-
-   "# `me` could represent the currently logged in viewer.
-{
-  me {
-    name
-  }
-}
-
-# `user` represents one of many users in a graph of data, referred to by a
-# unique identifier.
-{
-  user(id: 4) {
-    name
-  }
-}"
-
-   "{
-  user(id: 4) {
-    id
-    name
-    profilePic(size: 100)
-  }
-}
-"
-   "{
-  user(id: 4) {
-    id
-    name
-    profilePic(width: 100, height: 50)
-  }
-}
-"
-
-   ;; In this example, we can fetch two profile pictures of different sizes and ensure the resulting object will not have duplicate keys:
-   "{
-  user(id: 4) {
-    id
-    name
-    smallPic: profilePic(size: 64)
-    bigPic: profilePic(size: 1024)
-  }
-}
-"
-
-   ;; Since the top level of a query is a field, it also can be given an alias:
-   "{
-  zuck: user(id: 4) {
-    id
-    name
-  }
-}
-"
-
-   ;; Fragments allow for the reuse of common repeated selections of fields, reducing duplicated text in the document. Inline Fragments can be used directly within a selection to condition upon a type condition when querying against an interface or union.
-
-   ;; For example, if we wanted to fetch some common information about mutual friends as well as friends of some user:
-   "query noFragments {
-  user(id: 4) {
-    friends(first: 10) {
-      id
-      name
-      profilePic(size: 50)
-    }
-    mutualFriends(first: 10) {
-      id
-      name
-      profilePic(size: 50)
-    }
-  }
-}"
-
-   ;; The repeated fields could be extracted into a fragment and composed by a parent fragment or query.
-   "query withFragments {
-  user(id: 4) {
-    friends(first: 10) {
-      ...friendFields
-    }
-    mutualFriends(first: 10) {
-      ...friendFields
-    }
-  }
-}
-
-fragment friendFields on User {
-  id
-  name
-  profilePic(size: 50)
-}
-"
-
-   ;; Fragments are consumed by using the spread operator (...). All fields selected by the fragment will be added to the query field selection at the same level as the fragment invocation. This happens through multiple levels of fragment spreads.
-
-   ;; For example:
-   "query withNestedFragments {
-  user(id: 4) {
-    friends(first: 10) {
-      ...friendFields
-    }
-    mutualFriends(first: 10) {
-      ...friendFields
-    }
-  }
-}
-
-fragment friendFields on User {
-  id
-  name
-  ...standardProfilePic
-}
-
-fragment standardProfilePic on User {
-  profilePic(size: 50)
-}
-"
-
-   "query FragmentTyping {
-  profiles(handles: [\"zuck\", \"cocacola\"]) {
-    handle
-    ...userFragment
-    ...pageFragment
-  }
-}
-
-fragment userFragment on User {
-  friends {
-    count
-  }
-}
-
-fragment pageFragment on Page {
-  likers {
-    count
-  }
-}"
-
-   "query inlineFragmentTyping {
-  profiles(handles: [\"zuck\", \"cocacola\"]) {
-    handle
-    ... on User {
-      friends {
-        count
-      }
-    }
-    ... on Page {
-      likers {
-        count
-      }
-    }
-  }
-}"
-
-   "query inlineFragmentNoType($expandedInfo: Boolean) {
-  user(handle: \"zuck\") {
-    id
-    name
-    ... @include(if: $expandedInfo) {
-      firstName
-      lastName
-      birthday
-    }
-  }
-}"
-
-   "query getZuckProfile($devicePicSize: Int) {
-  user(id: 4) {
-    id
-    name
-    profilePic(size: $devicePicSize)
-  }
-}"
-
-   "query hasConditionalFragment($condition: Boolean) {
-  ...maybeFragment @include(if: $condition)
-}
-
-fragment maybeFragment on Query {
-  me {
-    name
-  }
-}"
-
-   "query hasConditionalFragment($condition: Boolean) {
-  ...maybeFragment
-}
-
-fragment maybeFragment on Query @include(if: $condition) {
-  me {
-    name
-  }
-}"
-
-   "query myQuery($someTest: Boolean) {
-  experimentalField @skip(if: $someTest)
-}"
-
-   "mutation setName {
-  setName(name: \"Zuck\") {
-    newName
-  }
-}"
-
-])


Add event handling single click to a checkbox

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -342,15 +342,36 @@
     (.subscribe (.-onClick grid)
                 (fn [e args]
                   (let [elem (.-target e)
+                        class-name (.-className elem)
+                        checked? (.-checked elem)
                         row (.getItem dataview (aget args "row"))
                         elem-data-id (.getAttribute elem "data-id")
                         data-id (when elem-data-id
                                   (js/parseInt (.getAttribute elem "data-id")))
                         id  (aget row _id)
-                        rank (aget row _rank)]
-                    (when (= id data-id)
-                      (put! shared/event-chan
-                            {:submission-to-rank rank})))))
+                        rank (aget row _rank)
+                        select-unselect-all-records-chkbox
+                        (.getElementById js/document
+                                         select-unselect-all-records-id)
+                        {:keys [selected-table-rows]} @shared/app-state]
+                    (if (= class-name delete-record-class)
+                      (let [fn (if checked? add-element remove-element)
+                            row (js/parseInt (.. grid
+                                                 (getCellFromEvent e)
+                                                 -row))]
+                        (update-data-to-be-deleted-vector checked? data-id)
+                        (set! (.-checked select-unselect-all-records-chkbox)
+                              (check-select-unselect-all-records-element?))
+                        (transact! shared/app-state
+                                   [:selected-table-rows]
+                                   #(fn selected-table-rows row))
+                        (.setSelectedRows
+                         grid
+                         (clj->js (:selected-table-rows @shared/app-state))))
+
+                      (when (= id data-id)
+                        (put! shared/event-chan
+                              {:submission-to-rank rank}))))))
     ;; page, filter, and data set-up on the dataview
     (init-sg-pager grid dataview)
     (.setPagingOptions dataview
@@ -391,9 +412,12 @@
           (when submission-unclicked
             (update-data! nil))
           (when new-columns
-            (.setColumns grid new-columns)
-            (resizeColumns grid)
-            (.render grid))
+            (go (<! (timeout 20))
+                (.setColumns grid new-columns)
+                (resizeColumns grid)
+                (.render grid)
+                (select-rows-marked-to-be-deleted)
+                (higlight-rows-marked-to-be-deleted grid)))
           (when filter-by
             (.setFilterArgs dataview (clj->js {:query filter-by}))
             (.refresh dataview))


consolidate "understand" into a single lexical entry

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1893,21 +1893,22 @@
                :synsem {:cat :verb
                         :sem {:pred :transfer}}}

-   "understand" {:english {:past "understood"}
-                 :synsem {:cat :verb
-                          :sem {:pred :understand}}}
-
-   "understand (deeply)" {:synsem {:cat :verb
-                                   :sem {:pred :understand-deeply}}
-                          :english {:present {:3sing "understands (deeply)"}
-                                    :past "understood (deeply)"
-                                    :participle "understanding (deeply)"}}
-
-   "understand (simply)" {:synsem {:cat :verb
-                                   :sem {:pred :understand-simply}}
-                          :english {:present {:3sing "understands (simply)"}
-                                    :past "understood (simply)"
-                                    :participle "understanding (simply)"}}
+   "understand" (let [common {:english {:past "understood"}}]
+                  (unify
+                   common
+                   {:synsem {:cat :verb
+                             :sem {:pred :understand}}})
+                  (unify
+                   common
+                   {:synsem {:cat :verb
+                             :sem {:pred :understand-deeply}}
+                    :english {:note "deeply"}})
+
+                  (unify
+                   common
+                   {:synsem {:cat :verb
+                             :sem {:pred :understand-simply}}
+                    :english {:note "simply"}}))

    "upload"  {:synsem {:cat :verb
                        :sem {:pred :caricare}}}


added fit

added fit

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -671,7 +671,13 @@
                   {:synsem {:sem {:mod {:pred :first}
                                   :comparative false}}})

-   "fold" {:synsem {:cat :verb
+   "fit" {:english {:past "fit"
+                    :participle "fitting"}
+          :synsem {:cat :verb
+                   :sem {:pred :fit}}}
+
+
+    "fold" {:synsem {:cat :verb
                     :sem {:pred :fold}}}

    "follow" {:synsem {:cat :verb


preterite should be {:tense :present}, not {:tense :past}

--- src/babel/espanol/grammar.cljc
+++ src/babel/espanol/grammar.cljc
@@ -33,7 +33,7 @@
    "imperfect" {:synsem {:sem {:aspect :progressive
                                 :tense :past}}}
    "preterito" {:synsem {:sem {:aspect :perfect
-                             :tense :past}}}})
+                               :tense :present}}}})

 (defn fo-ps [expr]
   (parse/fo-ps expr fo))
@@ -273,7 +273,7 @@
                                      :infl :preterito
                                      :cat :verb
                                      :sem {:aspect :perfect
-                                           :tense :past}}})
+                                           :tense :present}}})
                    (unifyc c10
                            root-is-head
                            {:rule "s-preterito-nonphrasal"
@@ -282,7 +282,7 @@
                                      :infl :preterito
                                      :cat :verb
                                      :sem {:aspect :perfect
-                                           :tense :past}}})
+                                           :tense :present}}})
                    (unifyc c10
                            root-is-head-root
                            {:rule "s-imperfect-phrasal"


Update lein profile

Update lein profile

--- dotfiles/lein/profiles.clj
+++ dotfiles/lein/profiles.clj
@@ -1,22 +1,23 @@
 {
   :user {
     :plugins [
-      [lein-bikeshed "0.2.0"]
-      [lein-cljfmt "0.3.0"]
-      [lein-gen "0.2.1"]
-      [lein-kibit "0.1.2"]
-      [lein-pprint "1.1.2"]
-      [com.jakemccrary/lein-test-refresh "0.11.0"]
-      [cider/cider-nrepl "0.10.0"]
-      [jonase/eastwood "0.2.2"]
-      [venantius/ultra "0.4.0"]
+      [lein-ancient "0.6.15"]
+      [lein-bikeshed "0.5.1"]
+      [lein-cljfmt "0.5.7"]
+      [lein-gen "0.2.2"]
+      [lein-kibit "0.1.6"]
+      [lein-pprint "1.2.0"]
+      [com.jakemccrary/lein-test-refresh "0.22.0"]
+      [cider/cider-nrepl "0.17.0"]
+      [jonase/eastwood "0.2.6"]
+      [venantius/ultra "0.5.2"]
       [venantius/yagni "0.1.4"]
     ]
     :dependencies [
-      [cljfmt "0.3.0"]
-      [com.cemerick/piggieback "0.2.1"]
-      [org.clojure/tools.nrepl "0.2.12"]
-      [jonase/eastwood "0.2.2"
+      [cljfmt "0.5.7"]
+      [com.cemerick/piggieback "0.2.2"]
+      [org.clojure/tools.nrepl "0.2.13"]
+      [jonase/eastwood "0.2.6"
        :exclusions [org.clojure/clojure]]
     ]
     :repl-options {


word at a time

word at a time

--- src-cljs/jasons-game/ui/pjs/main.cljs
+++ src-cljs/jasons-game/ui/pjs/main.cljs
@@ -4,6 +4,7 @@
   (:require [ajax.core :refer [GET]]
             [cljs.core.async :as async :refer [<! go timeout]]
             [clojure.browser.repl :as repl]
+            [clojure.string :refer [split]]
             [dommy.core :refer [listen!]]
             [jasons-game.thing :as t]
             [jasons-game.ui.pjs.draw :as d]
@@ -37,8 +38,8 @@
                               (w/add-thing world thing)))
                  :error-handler (fn [response] (js/alert response))}))

-(defn char-at-a-time [words]
-  (reverse (map (comp clojure.string/join reverse) (take-while #(< 0 (count %)) (iterate rest (seq (reverse words)))))))
+(defn word-at-a-time [words]
+  (reverse (map (comp #(clojure.string/join " " %) reverse) (take-while #(< 0 (count %)) (iterate rest (reverse (split words #"\W")))))))

 (defn say [thing words]
   (w/add-thing world {:type :word-balloon
@@ -49,7 +50,7 @@
                                   :words ""})
   (let [athing (w/get-thing world :word-balloon)]
     (go
-      (doseq [w (char-at-a-time words)]
+      (doseq [w (word-at-a-time words)]
         (w/modify-thing athing :words w)
         (<! (timeout 500))))))

@@ -70,7 +71,7 @@

     (draw-cursor mx my)))

-(defn mouse-pressed []
+(defn mouse-released []
   (when-let [thing (w/get-thing-at-location world [(s/mouse-x) (s/mouse-y)])]
     (say @thing (str "My name is " (:name @thing)))))

@@ -78,7 +79,6 @@
   (let [mx (s/mouse-x)
         my (s/mouse-y)]
     (when-let [thing (w/get-thing-at-location world [mx my])]
-      (w/remove-thing world :word-balloon)
       (w/move-thing thing [mx my]))))

 (defn init []
@@ -86,5 +86,5 @@

   (js/Processing. (sel1 :#stage) (s/sketch-init {:setup setup
                                                  :draw draw
-                                                 :mouse-pressed mouse-pressed
+                                                 :mouse-released mouse-released
                                                  :mouse-dragged mouse-dragged})))


Implement basic deploy.core.

Implement basic deploy.core.

--- src/incise/deploy/core.clj
+++ src/incise/deploy/core.clj
@@ -1,3 +1,21 @@
-(ns incise.deploy.core)
+(ns incise.deploy.core
+  (:require [taoensso.timbre :refer [warn]])
+  (:clojure-refer :exclude [get]))

-(defn deploy [])
+(def workflows (atom {}))
+
+(defn get [& args]
+  (apply clojure.core/get @workflow args))
+
+(defn deploy []
+  (let [{workflow-name :workflow :as settings} (conf/get :deploy)
+        [workflow (get workflow-name)]]
+    (if workflow
+      (workflow settings)
+      (warn "No workflow registered as" workflow-name))))
+
+(defn register
+  "Register a deployment workflow."
+  [workflow-name workflow]
+  (swap! workflows
+         assoc (name workflow-name) workflow))


Bring one more test back

Bring one more test back

--- test/clojure/clojurewerkz/cassaforte/schema_test.clj
+++ test/clojure/clojurewerkz/cassaforte/schema_test.clj
@@ -40,17 +40,20 @@
     (is (or
          (= 2 (count columns)) ;; Cassandra versions
          (= 3 (count columns))))))
+
+(deftest test-create-alter-keyspace
+  (alter-keyspace *session* "new_cql_keyspace"
+                  (with {:durable-writes false
+                         :replication    {"class" "NetworkTopologyStrategy"
+                                          "dc1"   1
+                                          "dc2"   2}}))
+  (let [res (describe-keyspace *session* "new_cql_keyspace")]
+    (is (= "new_cql_keyspace" (:keyspace_name res)))
+    (is (= false (:durable_writes res)))
+    (is (= "{\"dc2\":\"2\",\"dc1\":\"1\"}" (:strategy_options res)))))
+
 (comment
-  (deftest test-create-alter-keyspace
-    (alter-keyspace s "new_cql_keyspace"
-                    (with {:durable_writes false
-                           :replication    {:class "NetworkTopologyStrategy"
-                                            :dc1 1
-                                            :dc2 2}}))
-    (let [res (describe-keyspace s "new_cql_keyspace")]
-      (is (= "new_cql_keyspace" (:keyspace_name res)))
-      (is (= false (:durable_writes res)))
-      (is (= "{\"dc2\":\"2\",\"dc1\":\"1\"}" (:strategy_options res)))))
+


fix new account password

fix new account password

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

--- src/status_im/ui/screens/wallet/add_new/views.cljs
+++ src/status_im/ui/screens/wallet/add_new/views.cljs
@@ -97,6 +97,7 @@
       [react/view {:justify-content :center :flex 1}
        [react/text-input {:secure-text-entry true
                           :auto-focus        true
+                          :auto-capitalize   :none
                           :text-align        :center
                           :placeholder       ""
                           :style             {:typography :header}


clean-up home page

clean-up home page

--- webapp/src/webapp/core.clj
+++ webapp/src/webapp/core.clj
@@ -18,8 +18,8 @@
 (def site-map
 	(html
 		[:h3 "Doug's Website"]
-		[:ul (linkfy "dougpuett.com/microblog" "Micro-Blog")]
-		[:ul (linkfy "dougpuett.com/ff" "Fantasy Football")]
+		[:ul (linkfy "microblog" "Micro-Blog")]
+		[:ul (linkfy "ff" "Fantasy Football")]
 		[:ul "Full Blog"]
 		[:ul "Poetry Reader"]
 		))


Add HSV and HSL rainbow tests to the harness.

--- test/org/playasophy/wonderdome/util/color_test.clj
+++ test/org/playasophy/wonderdome/util/color_test.clj
@@ -20,6 +20,9 @@
   (let [red   (color/rgb 1 0 0)  ; hue 0/3
         green (color/rgb 0 1 0)  ; hue 1/3
         blue  (color/rgb 0 0 1)] ; hue 2/3
+    (quil/background 0)
+    (quil/stroke 0)
+
     ; red, green, and blue blocks
     (quil/with-translation [20 20]
       (quil/fill (color/gray 0.75))
@@ -58,6 +61,28 @@
       (quil/rect 50 10 40 40)
       (quil/fill (color/blend-hsv 0.5 blue red))
       (quil/rect 100 10 40 40)))
+
+    ; HSV rainbow
+    (quil/with-translation [200 20]
+      (quil/fill (color/gray 0.75))
+      (quil/text "HSV rainbow" 0 0)
+      (let [width 400]
+        (doseq [x (range 0 width)]
+          (let [c (color/hsv (/ x width) 1 1)]
+            (quil/stroke c)
+            (quil/line x 10 x 50)))))
+
+    ; HSL rainbow
+    (quil/with-translation [200 90]
+      (quil/fill (color/gray 0.75))
+      (quil/text "HSL rainbow (50% saturation)" 0 0)
+      (let [width 400]
+        (doseq [x (range 0 width)]
+          (let [c (color/hsl (/ x width) 0.5 0.5)]
+            (quil/stroke c)
+            (quil/line x 10 x 50)))))
+
+    ; TODO: less-angry rainbow?
   )

@@ -69,4 +94,4 @@
       :title "Wonderdome Color Harness"
       :setup setup-harness
       :draw render-harness
-      :size [800 600])))
+      :size [650 400])))


+TODO comment

+TODO comment

--- src/babel/francais/grammar.cljc
+++ src/babel/francais/grammar.cljc
@@ -446,13 +446,16 @@
                    ;; e.g. used as: "je m'appelle Jean" -
                    ;; [s-present-phrasal 'je' [vp-pronoun-phrasal 'm'' [vp32 'se appeler' 'Jean']]]
                    (unify h32
-                           root-is-head
-                           {:rule "vp-32"
-                            :head {:phrasal false}
-                            :synsem {:aux false
-                                     :infl {:not :past}
-                                     :cat :verb}})
-
+                          root-is-head
+                          ;; TODO: why does adding head-is-conjugated-and-present-infl
+                          ;; cause the test 'generate-named-sentence' to fail?
+                          ;;                          head-is-conjugated-and-present-infl
+                          {:rule "vp-32"
+                           :head {:phrasal false}
+                           :synsem {:aux false
+                                    :infl {:not :past}
+                                    :cat :verb}})
+
                    ;; [s-present "je" [vp-pronoun "m'" "amuse"]]
                    (unify c21
                            root-is-head


Hide dragged item on layers sidebar widget.

--- frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
@@ -130,12 +130,15 @@
         select #(select-shape selected item %)
         toggle-visibility #(toggle-visibility selected item %)
         toggle-blocking #(toggle-blocking item %)
-        classes (classnames
-                 :selected selected?
-                 :drag-active (:dragging @local)
-                 :drag-top (= :top (:over @local))
-                 :drag-bottom (= :bottom (:over @local))
-                 :drag-inside (= :middle (:over @local)))]
+        li-classes (classnames
+                    :selected selected?
+                    :hide (:dragging @local))
+        body-classes (classnames
+                      :selected selected?
+                      :drag-active (:dragging @local)
+                      :drag-top (= :top (:over @local))
+                      :drag-bottom (= :bottom (:over @local))
+                      :drag-inside (= :middle (:over @local)))]
     (letfn [(on-drag-start [event]
               (let [target (dom/event->target event)]
                 (dnd/set-allowed-effect! event "move")
@@ -161,10 +164,9 @@
               (swap! local assoc :over true))
             (on-drag-leave [event]
               (swap! local assoc :over false))]
-      [:li {:key (str (:id item))
-            :class (when selected? "selected")}
+      [:li {:class li-classes}
        [:div.element-list-body
-        {:class classes
+        {:class body-classes
          :style {:opacity (if (:dragging @local)
                             "0.5"
                             "1")}


Re-activate S3 uploader.

Re-activate S3 uploader.

--- src/uswitch/bifrost/system.clj
+++ src/uswitch/bifrost/system.clj
@@ -14,6 +14,7 @@
   (try (close! ch)
        (loop [v (<!! ch)]
          (when v (recur (<!! ch))))
+       ch
        (catch Exception e
          (error e "Unable to purge channel" ch)
          nil)))
@@ -34,5 +35,4 @@
    :rotated-event-ch (observable-chan "rotated-event-ch" buffer-size)

    :kafka-system (using (kafka-system config) [:rotated-event-ch])
-   ;;:s3-system    (using (s3-system    config) [:rotated-event-ch])
-   ))
+   :s3-system    (using (s3-system    config) [:rotated-event-ch])))


Fix unexpected behavior on image collection renaming.

--- src/uxbox/data/images.cljs
+++ src/uxbox/data/images.cljs
@@ -103,7 +103,7 @@
 (defrecord CollectionUpdated [item]
   rs/UpdateEvent
   (-apply-update [_ state]
-    (sti/assoc-collection state item)))
+    (update-in state [:images-by-id (:id item)]  merge item)))

 (defn collection-updated
   [item]


slightly nicer output when generating a new project

--- src/leiningen/new/yawt.clj
+++ src/leiningen/new/yawt.clj
@@ -71,7 +71,7 @@
   [["src/{{path}}/db.clj" (render "src/root_ns/db_couchdb.clj" data)]])

 (defn make-project! [options data]
-  (main/info "Generating a new YAWT project called" (:name data) "using options:" (str/join ", " options))
+  (main/info (str "Generating a new YAWT project called '" (:name data) "' using options: " (str/join ", " options)))
   (apply ->files data
          (concat
            (get-base-files data)


sort scenarios in index

sort scenarios in index

--- src/warp/client/views.cljs
+++ src/warp/client/views.cljs
@@ -20,7 +20,7 @@
      "Scenarios"
      (table-striped
       ["Scenario" "Timeouts" "Default Matcher"]
-      (for [scenario (:scenarios @app)]
+      (for [scenario (sort-by :id (:scenarios @app))]
         ^{:key (:id scenario)} [scenario-tr scenario])))))

 (defmulti scenario-cmd-summary :type)


Get rid of routing.

Get rid of routing.

--- src/cljs/leipzig_live/core.cljs
+++ src/cljs/leipzig_live/core.cljs
@@ -1,8 +1,5 @@
 (ns leipzig-live.core
     (:require [reagent.core :as reagent :refer [atom]]
-              [reagent.session :as session]
-              [secretary.core :as secretary :include-macros true]
-              [accountant.core :as accountant]
               [cljs.js :as cljs]))

 ;; -------------------------
@@ -83,25 +80,13 @@
    [:div
     (-> state :music print)]])

-(defn current-page []
-  [:div [(session/get :current-page)]])
-
-;; -------------------------
-;; Routes
-
-(defn app []
-  (home-page apply-action! @state))
-
-(secretary/defroute "/" []
-  (session/put! :current-page #'app))
-
 ;; -------------------------
 ;; Initialize app

 (defn mount-root []
-  (reagent/render [current-page] (.getElementById js/document "app")))
+  (reagent/render
+    [home-page apply-action! @state]
+    js/document.body))

 (defn init! []
-  (accountant/configure-navigation!)
-  (accountant/dispatch-current!)
   (mount-root))


Fix info about filtering by season and episode

--- src/cljs/subman/components.cljs
+++ src/cljs/subman/components.cljs
@@ -88,7 +88,7 @@
                                [:code ":source name"]
                                ", by default used: "
                                (edit-option options :sources :current-source)]
-                              [:p "And you can filter by source and season with "
+                              [:p "And you can filter by season and episode with "
                                [:code "S01E01"] " format."]
                               [:p "Total indexed subtitles count: "
                                @total-count


Allow DVals to locally deserialize as DVals.

--- src/clojure/parkour/io/dval.clj
+++ src/clojure/parkour/io/dval.clj
@@ -1,4 +1,5 @@
 (ns parkour.io.dval
+  (:refer-clojure :exclude [eval])
   (:require [clojure.java.io :as io]
             [parkour (fs :as fs) (cser :as cser) (mapreduce :as mr)
              ,       (reducers :as pr)]
@@ -58,17 +59,18 @@
 available source path.  Result will usually be a local file path, but may be the
 original remote path under mixed-mode job execution."
   [[^URI remote local]]
-  (if-let [fragment (.getFragment remote)]
-    (let [symlink (io/file fragment), symlink? (.exists symlink)
-          local (io/file (str local)), local? (.exists local)
-          remote (unfragment remote), remote? (= "file" (.getScheme remote))
-          source (cond symlink? symlink, local? local, remote? remote
-                       ;; Could localize, but issues: clean-up, directories
-                       (mr/local-runner? cser/*conf*) remote
-                       :else (throw (ex-info
-                                     (str remote ": cannot locate local file")
-                                     {:remote remote, :local local})))]
-      (fs/path source))))
+  (let [fragment (.getFragment remote)
+        symlink (io/file fragment), symlink? (.exists symlink)
+        local (io/file (str local)), local? (.exists local)
+        remote (unfragment remote), remote? (= "file" (.getScheme remote))
+        source (cond symlink? symlink, local? local, remote? remote
+                     ;; Could localize, but issues: clean-up, directories
+                     (nil? mr/*context*) remote
+                     (mr/local-runner? cser/*conf*) remote
+                     :else (throw (ex-info
+                                   (str remote ": cannot locate local file")
+                                   {:remote remote, :local local})))]
+    (fs/path source)))

 (defn ^:private dcpath-reader
   "EDN tagged-literal reader for dcpaths."
@@ -103,7 +105,9 @@

 (defn ^:private dval-reader
   "EDN tagged-literal reader for dvals."
-  [[f & args]] (delay (apply f args)))
+  [form]
+  (let [value (delay (apply pr/funcall form))]
+    (DVal. value form)))

 (defn ^:private dval*
   "Return a dval which locally proxies to `valref` and remotely will deserialize
@@ -113,6 +117,10 @@
 (defn dval
   "Return a dval which acts as a delay over applying var `readv` to `args`."
   [readv & args] (apply dval* (delay (apply readv args)) readv args))
+
+(defn eval
+  "Evaluate `dval` form, recomputing value each time."
+  [dval] (apply pr/funcall (.-form ^DVal dval)))

 (defn ^:private identity-ref
   "Return reference which yields `x` when `deref`ed."


break on error

break on error

--- uberjar/src/dda/pallet/dda_serverspec_crate/main.clj
+++ uberjar/src/dda/pallet/dda_serverspec_crate/main.clj
@@ -18,7 +18,7 @@
   (:require
     [clojure.string :as str]
     [clojure.tools.cli :as cli]
-    [dda.config.commons.styled-output :as styled]
+    [dda.pallet.core.main-helper :as mh]
     [dda.pallet.core.app :as core-app]
     [dda.pallet.dda-serverspec-crate.app :as app]))

@@ -44,29 +44,23 @@
     "  - has to be a valid ServerTestDomainConfig (see: https://github.com/DomainDrivenArchitecture/dda-serverspec-crate)"
     ""]))

-(defn error-msg [errors]
-  (str "The following errors occurred while parsing your command:\n\n"
-       (str/join \newline errors)))
-
-(defn exit [status msg]
-  (println msg)
-  (System/exit status))
-
 (defn -main [& args]
   (let [{:keys [options arguments errors summary help]} (cli/parse-opts args cli-options)
         verbose (if (contains? options :verbose) 1 0)]
     (cond
-      help (exit 0 (usage summary))
-      errors (exit 1 (error-msg errors))
+      help (mh/exit 0 (usage summary))
+      errors (mh/exit 1 (mh/error-msg errors))
       (not= (count arguments) 1) (exit 1 (usage summary))
-      (:install-dependencies options) (core-app/existing-install
-                                        app/crate-app
-                                        {:domain (first arguments)
-                                         :targets (:targets options)})
+      (:install-dependencies options) (if (core-app/existing-install
+                                           app/crate-app
+                                           {:domain (first arguments)
+                                            :targets (:targets options)})
+                                        (mh/exit-default-success)
+                                        (mh/exit-default-error))
       :default (if (core-app/existing-serverspec
-                     app/crate-app
-                     {:domain (first arguments)
+                    app/crate-app
+                    {:domain (first arguments)
                       :targets (:targets options)
                       :verbosity verbose})
-                   (exit 0 (styled/styled "ALL TESTS PASSED" :green))
-                   (exit 2 (styled/styled "SOME TESTS FAILED" :red))))))
+                  (mh/exit 0 (styled/styled "ALL TESTS PASSED" :green))
+                  (mh/exit 2 (styled/styled "SOME TESTS FAILED" :red))))))


Add legend customisation support

Add legend customisation support

--- src/com/hypirion/clj_xchart.clj
+++ src/com/hypirion/clj_xchart.clj
@@ -3,6 +3,7 @@
                              PieChart
                              XYSeries$XYSeriesRenderStyle
                              XChartPanel)
+           (org.knowm.xchart.style Styler$LegendPosition)
            (org.knowm.xchart.style.markers Circle
                                            Diamond
                                            None
@@ -49,6 +50,14 @@
    :scatter XYSeries$XYSeriesRenderStyle/Scatter
    :line XYSeries$XYSeriesRenderStyle/Line})

+(def legend-positions
+  {:inside-n Styler$LegendPosition/InsideN
+   :inside-ne Styler$LegendPosition/InsideNE
+   :inside-nw Styler$LegendPosition/InsideNW
+   :inside-se Styler$LegendPosition/InsideSW
+   :inside-sw Styler$LegendPosition/InsideSW
+   :outside-e Styler$LegendPosition/OutsideE})
+
 (defmacro ^:private doto-cond
   "Example:
   (doto-cond expr
@@ -68,9 +77,23 @@
               pairs)
        ~expr-sym)))

+(defn- set-legend!
+  [styler
+   {:keys [background-color border-color font padding
+           position series-line-length visible]}]
+  (doto-cond
+   styler
+   background-color (.setLegendBackgroundColor (colors background-color background-color))
+   border-color (.setLegendBorderColor (colors border-color border-color))
+   font (.setLegendFont font)
+   padding (.setLegendPadding (int padding))
+   position (.setLegendPosition (legend-positions position))
+   series-line-length (.setLegendSeriesLineLength (int series-line-length))
+   (not (nil? visible)) (.setLegendVisible visible)))
+
 (defn xy-chart
   "Returns an xy-chart"
-  [{:keys [width height title series]
+  [{:keys [width height title series legend]
     :or {width 640 height 500}}]
   {:pre [series]}
   (let [chart (XYChart. width height)]
@@ -94,17 +117,24 @@
            (not (nil? show-in-legend)) (.setShowInLegend (boolean show-in-legend))
            render-style (.setXYSeriesRenderStyle (xy-render-styles render-style))))))
     (doto-cond
+     (.getStyler chart)
+     legend (set-legend! legend))
+    (doto-cond
      chart
      title (.setTitle title))))

 (defn pie-chart
   "Returns a pie chart"
-  [{:keys [width height title series]
+  [{:keys [width height title series circular legend]
     :or {width 640 height 500}}]
   {:pre [series]}
   (let [chart (PieChart. width height)]
     (doseq [[s-name num] series]
       (.addSeries chart s-name num))
+    (doto-cond
+     (.getStyler chart)
+     (not (nil? circular)) (.setCircular circular)
+     legend (set-legend! legend))
     (doto-cond
      chart
      title (.setTitle title))))


Whitespace fix

Whitespace fix

--- test/caesium/binding_test.clj
+++ test/caesium/binding_test.clj
@@ -50,13 +50,13 @@
             java.nio.ByteBuffer
             java.nio.ByteBuffer]]
          (mapv (fn [[_ args]] (mapv (comp :tag meta) args))
-              (#'b/permuted-byte-types
-               '[^int crypto_secretbox_easy
-                 [^bytes ^{Pinned {}} c
-                  ^bytes ^{Pinned {}} m
-                  ^long ^{LongLong {}} mlen
-                  ^bytes ^{Pinned {}} n
-                  ^bytes ^{Pinned {}} k]])))))
+               (#'b/permuted-byte-types
+                '[^int crypto_secretbox_easy
+                  [^bytes ^{Pinned {}} c
+                   ^bytes ^{Pinned {}} m
+                   ^long ^{LongLong {}} mlen
+                   ^bytes ^{Pinned {}} n
+                   ^bytes ^{Pinned {}} k]])))))

 (def ByteArray (Class/forName "[B"))

@@ -99,7 +99,7 @@
   [^Method method]
   (let [rtype (.getGenericReturnType method)]
     (condp = rtype
-        Integer/TYPE (is (= "sodium_init" (.getName method)))
-        Long/TYPE (is (= #{size_t}
-                         (clean-annotations (.getAnnotations method))))
-        (is (= String rtype)))))
+      Integer/TYPE (is (= "sodium_init" (.getName method)))
+      Long/TYPE (is (= #{size_t}
+                       (clean-annotations (.getAnnotations method))))
+      (is (= String rtype)))))


Remove core.async depenency during startup.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -206,12 +206,11 @@
   (let [update-interval-id
         (or (:update-interval-id @dashboard-state)
             (js/setInterval update-current-time update-interval-ms))]
-    (go
-      (let [all-series (<! (<<< server/fetch-series-names))
-            series-names (<! (<<< server/fetch-dashboard-series))]
-        (swap! dashboard-state merge {:all-series all-series
-                                      :update-interval-id update-interval-id
-                                      :displayed-series series-names})))))
+    (swap! dashboard-state merge {:update-interval-id update-interval-id})
+
+    (server/fetch-series-names #(swap! dashboard-state merge {:all-series %}))
+    (server/fetch-dashboard-series #(swap! dashboard-state merge {:displayed-series %}))
+    (log/debug "init complete.")))

 (run)


Simplify dashboard level state.

Simplify dashboard level state.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -50,7 +50,7 @@
 (defn series-tsplot [ series ]
   (let [ series-state (atom { }) ]
     (reagent/create-class
-     {:display-name (str "series-tsplot-" (:name series))
+     {:display-name (str "series-tsplot-" series)
       :component-did-update
       (fn [ this ]
         (tsplot-draw (reagent/dom-node this) (dom-width (:dom-node @series-state)) (:series-data @series-state)))
@@ -59,7 +59,7 @@
       (fn [ this ]
         (swap! series-state assoc :dom-node (.-parentNode (reagent/dom-node this)))
         (go
-          (swap! series-state assoc :series-data (<! (<<< fetch-series-data (:name series) @query-window-secs)))))
+          (swap! series-state assoc :series-data (<! (<<< fetch-series-data series @query-window-secs)))))

       :reagent-render
       (fn [ ]
@@ -69,13 +69,13 @@
 (defn series-pane [ series ]
   [:div.series-pane
    [:div.series-pane-header
-    [:span.series-name (:name series)]]
+    [:span.series-name series]]
    [series-tsplot series]])

 (defn series-list [ ]
   [:div
    (for [ series (:series @dashboard-state) ]
-     ^{ :key (:name series) } [series-pane series])])
+     ^{ :key series } [series-pane series])])

 (defn end-edit [ text state ]
   (let [ qws (js/parseInt text) ]
@@ -111,8 +111,6 @@
   (.addEventListener js/window "resize" on-window-resize)
   (on-window-resize nil)
   (go
-    (swap! dashboard-state assoc :series
-           (vec (map (fn [ series-name ] {:name series-name})
-                     (<! (<<< fetch-series-names)))))))
+    (swap! dashboard-state assoc :series (<! (<<< fetch-series-names)))))

 (run)


add error response for media types errors

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -63,7 +63,8 @@
         (log/warn "thumbnailing error" {:path (:uri request) :code exit :err err})
         (error-response 500))
       (catch [:type :vignette.media-types/error] {:keys [message]}
-        (log/warn "media type error" {:error message}))
+        (log/warn "media type error" {:error message})
+        (error-response 500))
       (catch Exception e
         (log/warn (str e) {:path (:uri request)})
         (error-response 500)))))


Add factorial and days_in_month tests

Add factorial and days_in_month tests

--- test/luaclj/core_test.clj
+++ test/luaclj/core_test.clj
@@ -15,5 +15,7 @@
     (is (= ((create-lua-fn (slurp "resources/test/function1.lua"))) 26))
     (is (= ((create-lua-fn (slurp "resources/test/function2.lua"))) 5))
     (is (= ((create-lua-fn (slurp "resources/test/function3.lua"))) 34))
+    (is (= ((create-lua-fn (slurp "resources/test/factorial.lua"))) 120))
+    (is (= ((create-lua-fn (slurp "resources/test/days_in_month.lua"))) 31))

     ))