Tidy up ugen metadata

Tidy up ugen metadata

--- src/overtone/sc/machinery/ugen/metadata/filter.clj
+++ src/overtone/sc/machinery/ugen/metadata/filter.clj
@@ -8,133 +8,312 @@
 (def muladd-specs
   [
    {:name "Resonz",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "resonant frequency in Hertz"}
-           {:name "bwr", :default 1.0 :doc "bandwidth ratio (reciprocal of Q). rq = bandwidth / centerFreq"}]
-    :check (nth-input-stream? 0)
-    :doc "A Note on Constant-Gain Digital Resonators,\" Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994.\" Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "resonant frequency in Hertz"}
+
+           {:name "bwr"
+            :default 1.0
+            :doc "bandwidth ratio (reciprocal of Q).
+                  rq = bandwidth / centerFreq"}]
+    :check (nth-input-stream? 0)
+    :doc "A Note on Constant-Gain Digital Resonators,\" Computer Music
+          Journal, vol 18, no. 4, pp. 8-10, Winter 1994.\" Computer
+          Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994."
+    :auto-rate true}
+

    {:name "OnePole",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "coef", :default 0.5 :doc "feedback coefficient. Should be between -1 and +1"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "coef"
+            :default 0.5
+            :doc "feedback coefficient. Should be between -1 and +1"}]
     :check (nth-input-stream? 0)
     :doc "A one pole filter. Implements the formula:
-out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1))"
-    :auto-rate true}
+
+          out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1))"
+    :auto-rate true}
+

    {:name "OneZero",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "coef", :default 0.5 :doc "feed forward coefficient. +0.5 makes a two point averaging filter (see also lpz1), -0.5 makes a differentiator (see also hpz1), +1 makes a single sample delay (see also delay1), -1 makes an inverted single sample delay."}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "coef"
+            :default 0.5
+            :doc "feed forward coefficient. +0.5 makes a two point
+                  averaging filter (see also lpz1), -0.5 makes a
+                  differentiator (see also hpz1), +1 makes a single
+                  sample delay (see also delay1), -1 makes an inverted
+                  single sample delay." }]
     :check (nth-input-stream? 0)
     :doc "A one zero filter. Implements the formula :
-out(i) = ((1 - abs(coef)) * in(i)) + (coef * in(i-1))"
-    :auto-rate true}
+
+          out(i) = ((1 - abs(coef)) * in(i)) + (coef * in(i-1))"
+    :auto-rate true}
+

    {:name "TwoPole",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "frequency of pole angle"}
-           {:name "radius", :default 0.8 :doc "radius of pole. Should be between 0 and +1"}]
-    :check (nth-input-stream? 0)
-    :doc "a two pole filter. This provides lower level access to setting of pole location. For general purposes Resonz is better."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "frequency of pole angle"}
+
+           {:name "radius"
+            :default 0.8
+            :doc "radius of pole. Should be between 0 and +1"}]
+
+    :check (nth-input-stream? 0)
+    :doc "a two pole filter. This provides lower level access to setting
+          of pole location.
+
+          For general purposes Resonz is better."
+    :auto-rate true}
+

    {:name "TwoZero",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "frequency of zero angle"}
-           {:name "radius", :default 0.8 :doc "radios of zero"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "frequency of zero angle"}
+
+           {:name "radius"
+            :default 0.8
+            :doc "radios of zero"}]
+
     :check (nth-input-stream? 0)
     :doc "a two zero filter"
     :auto-rate true}

+
    {:name "APF",
-    :args [{:name "in", :default 0.0}
-           {:name "freq", :default 440.0}
-           {:name "radius", :default 0.8}]
+    :args [{:name "in"
+            :default 0.0}
+
+           {:name "freq"
+            :default 440.0}
+
+           {:name "radius"
+            :default 0.8}]
+
     :check (nth-input-stream? 0)
     :doc ""
     :auto-rate true}

+
    {:name "Integrator",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "coef", :default 1.0 :doc "leak coefficient"}]
-    :check (nth-input-stream? 0)
-    :doc "leaky integrator. Integrates an input signal with a leak. The formula implemented is: out(0) = in(0) + (coef * out(-1))"
-    :auto-rate true}
-
-   {:name "Decay",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "decay-time", :default 1.0 :doc "60 dB decay time in seconds"}]
-    :check (nth-input-stream? 0)
-    :doc "triggered exponential decay. This is essentially the same as integrator except that instead of supplying the coefficient directly, it is calculated from a 60 dB decay time. This is the time required for the integrator to lose 99.9 % of its value or -60dB. This is useful for exponential decaying envelopes triggered by impulses."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "coef"
+            :default 1.0
+            :doc "leak coefficient"}]
+
+    :check (nth-input-stream? 0)
+    :doc "leaky integrator. Integrates an input signal with a leak. The
+          formula implemented is:
+
+          out(0) = in(0) + (coef * out(-1))"
+    :auto-rate true}
+
+
+   {:name "Decay"
+    :summary "triggered exponential decay."
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "decay-time"
+            :default 1.0
+            :doc "60 dB decay time in seconds"}]
+
+    :check (nth-input-stream? 0)
+    :doc "This is essentially the same as integrator except that
+          instead of supplying the coefficient directly, it is
+          calculated from a 60 dB decay time. This is the time required
+          for the integrator to lose 99.9 % of its value or -60dB. This
+          is useful for exponential decaying envelopes triggered by
+          impulses."
+    :auto-rate true}
+

    {:name "Decay2",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "attack-time", :default 0.01 :doc "60 dB attack time in seconds."}
-           {:name "decay-time", :default 1.0 :doc "60 dB decay time in seconds."}]
-    :check (nth-input-stream? 0)
-    :doc "triggered exponential attack and exponential decay. Decay has a very sharp attack and can produce clicks. Decay2 rounds off the attack by subtracting one Decay from another. (decay in attack-time decay-time) equivalent to: (- (decay in attack-time decay-time) (decay in attack-time decay-time))"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "attack-time"
+            :default 0.01
+            :doc "60 dB attack time in seconds."}
+
+           {:name "decay-time"
+            :default 1.0
+            :doc "60 dB decay time in seconds."}]
+
+    :check (nth-input-stream? 0)
+    :doc "triggered exponential attack and exponential decay. Decay has
+          a very sharp attack and can produce clicks. Decay2 rounds off
+          the attack by subtracting one Decay from another. (decay in
+          attack-time decay-time) equivalent to: (- (decay in
+          attack-time decay-time) (decay in attack-time decay-time))"
+    :auto-rate true}
+

    {:name "Lag",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time", :default 0.1 :doc "60 dB lag time in seconds"}]
-    :check (nth-input-stream? 0)
-    :doc "exponential lag, useful for smoothing out control signals. This is essentially the same as OnePole except that instead of supplying the coefficient directly, it is calculated from a 60 dB lag time. This is the time required for the filter to converge to within 0.01 % of a value."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time"
+            :default 0.1
+            :doc "60 dB lag time in seconds"}]
+
+    :check (nth-input-stream? 0)
+    :doc "exponential lag, useful for smoothing out control
+          signals. This is essentially the same as OnePole except that
+          instead of supplying the coefficient directly, it is
+          calculated from a 60 dB lag time. This is the time required
+          for the filter to converge to within 0.01 % of a value."
+    :auto-rate true}
+

    {:name "Lag2",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time", :default 0.1 :doc "60 dB lag time in seconds"} ]
-    :check (nth-input-stream? 0)
-    :doc "equivalent to Lag.kr(Lag.kr(in, time), time), resulting in a smoother transition. This saves on CPU as you only have to calculate the decay factor once instead of twice. See Lag for more details."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time"
+            :default 0.1
+            :doc "60 dB lag time in seconds"}]
+
+    :check (nth-input-stream? 0)
+    :doc "equivalent to (lag (lag in time) time), resulting in a
+          smoother transition. This saves on CPU as you only have to
+          calculate the decay factor once instead of twice. See lag for
+          more details."
+    :auto-rate true}
+

    {:name "Lag3",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time", :default 0.1 :doc "60 dB lag time in seconds"}]
-    :check (nth-input-stream? 0)
-    :doc "Lag3 is equivalent to Lag.kr(Lag.kr(Lag.kr(in, time), time), time), thus resulting in a smoother transition. This saves on CPU as you only have to calculate the decay factor once instead of three times. See Lag for more details."
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time"
+            :default 0.1
+            :doc "60 dB lag time in seconds"}]
+
+    :check (nth-input-stream? 0)
+    :doc "lag3 is equivalent to (lag (lag (lag in time) time) time),
+          thus resulting in a smoother transition. This saves on CPU as
+          you only have to calculate the decay factor once instead of
+          three times. See Lag for more details."
+    :auto-rate true}
+

    {:name "Ramp",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time", :default 0.1 :doc "60 dB lag time in seconds"}]
-    :check (nth-input-stream? 0)
-    :doc "similar to Lag but with a linear rather than exponential lag, useful for smoothing out control signals"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time"
+            :default 0.1
+            :doc "60 dB lag time in seconds"}]
+    :check (nth-input-stream? 0)
+    :doc "similar to lag but with a linear rather than exponential lag,
+          useful for smoothing out control signals"
+    :auto-rate true}
+

    {:name "LagUD",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time-up", :default 0.1 :doc "60 dB lag time in seconds for the upgoing signal"}
-           {:name "lag-time-down", :default 0.1 :doc "60 dB lag time in seconds for the downgoing signal"}]
-    :check (nth-input-stream? 0)
-    :doc "the same as Lag except that you can supply a different 60 dB time for when the signal goes up, from when the signal goes down"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time-up"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the upgoing signal"}
+
+           {:name "lag-time-down"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the downgoing signal"}]
+
+    :check (nth-input-stream? 0)
+    :doc "the same as Lag except that you can supply a different 60 dB
+          time for when the signal goes up, from when the signal goes down"
+    :auto-rate true}
+

    {:name "Lag2UD",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time-up", :default 0.1 :doc "60 dB lag time in seconds for the upgoing signal"}
-           {:name "lag-time-down", :default 0.1 :doc "60 dB lag time in seconds for the downgoing signal"}]
-    :check (nth-input-stream? 0)
-    :doc "Lag2 is equivalent to Lag.kr(Lag.kr(in, time), time)"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time-up"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the upgoing signal"}
+
+           {:name "lag-time-down"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the downgoing signal"}]
+
+    :check (nth-input-stream? 0)
+    :doc "equivalent to (lag-ud (lag-ud in up-t down-t) up-t down-t)
+          thus resulting in a smoother transition. This saves on CPU as
+          you only have to calculate the decay factor once instead of
+          twice. See Lag for more details."
+    :auto-rate true}
+

    {:name "Lag3UD",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "lag-time-up", :default 0.1 :doc "60 dB lag time in seconds for the upgoing signal"}
-           {:name "lag-time-down", :default 0.1 :doc "60 dB lag time in seconds for the downgoing signal"}]
-    :check (nth-input-stream? 0)
-    :doc "Lag3UD is equivalent to LagUD.kr(LagUD.kr(LagUD.kr(in, timeU, timeD), timeU, timeD), timeU, timeD)"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "lag-time-up"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the upgoing signal"}
+
+           {:name "lag-time-down"
+            :default 0.1
+            :doc "60 dB lag time in seconds for the downgoing signal"}]
+
+    :check (nth-input-stream? 0)
+    :doc "equivalent to
+
+         (lag-ud (lag-ud (lag-ud (in up-t down-t) up-t down-t) up-t, down-t)
+
+         thus resulting in a smoother transition. This saves on CPU as
+         you only have to calculate the decay factor once instead of
+         three times."
+    :auto-rate true}
+

    {:name "LeakDC",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "coef", :default 0.995
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "coef"
+            :default 0.995
             :doc "leak coefficient. A value of 1 indicates no leakage
-                 and 0 indicates high leakage - essentially the rate at
-                 which the offset will return back to 0"}]
+                  and 0 indicates high leakage - essentially the rate at
+                  which the offset will return back to 0"}]
     :check (nth-input-stream? 0)
     :doc "removes a DC offset from signal. For example, a square wave
           contains prolonged sections of the cycle which are at +1 and
@@ -147,11 +326,21 @@
           for control rate"
     :auto-rate true}

+
    {:name "RLPF"
     :summary "resonant low pass filter"
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "cutoff frequency"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq. A lower rq results in more resonance."}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "cutoff frequency"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq. A lower
+                  rq results in more resonance." }]
     :check (nth-input-stream? 0)
     :doc "A resonant low pass filter is a standard subtractive synthesis
           tool which removes frequencies above a defined cut-off
@@ -169,11 +358,23 @@
           real time thus creating movement in the sound."
     :auto-rate true}

-   {:name "RHPF", :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-                         {:name "freq", :default 440.0 :doc "cutoff frequency"}
-                         {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq. A lower rq results in more resonance"}]
-    :check (nth-input-stream? 0)
+
+   {:name "RHPF"
     :summary "resonant high pass filter"
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "cutoff frequency"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq. A lower
+                  rq results in more resonance"}]
+    :check (nth-input-stream? 0)
+
     :doc "A resonant high pass filter lets through the frequencies above
           the cutoff point and successfily dampens the frequencies below
           the cutoff point. This effectively removes the fundamental
@@ -191,10 +392,17 @@
           of another low pass sound to increase the harmonic content."
     :auto-rate true}

+
    {:name "LPF",
     :summary "second order Butterworth low pass filter"
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "cutoff frequency"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "cutoff frequency"}]
+
     :check (nth-input-stream? 0)
     :doc "A low pass filter is a standard subtractive synthesis tool
           which removes frequencies above a defined cut-off point. This
@@ -205,10 +413,17 @@
           real time thus creating movement in the sound."
     :auto-rate true}

+
    {:name "HPF",
     :summary "second order high pass filter"
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "cutoff frequency"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "cutoff frequency"}]
+
     :check (nth-input-stream? 0)
     :doc "A high pass filter lets through the frequencies above the
           cutoff point and successfily dampens the frequencies below the
@@ -222,11 +437,21 @@
           of another low pass sound to increase the harmonic content."
     :auto-rate true}

+
    {:name "BPF",
     :summary "second order Butterworth bandpass filter"
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "centre frequency in Hertz"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "centre frequency in Hertz"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}]
+
     :check (nth-input-stream? 0)
     :doc "A band pass filter permits the frequencies around a specified
           centre frequency to pass unaltered through the filter while
@@ -239,11 +464,21 @@
           effects."
     :auto-rate true}

+
    {:name "BRF"
     :summary "second order Butterworth band reject filter"
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "centre frequency in Hertz"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "centre frequency in Hertz"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}]
+
     :check (nth-input-stream? 0)
     :doc "Band reject filters, also known as notch filters, attenuate a
           selected range of frequencies effectively creating a notch in
@@ -256,114 +491,283 @@
           content."
     :auto-rate true}

+
    {:name "MidEQ",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "center frequency of the band in Hertz"}
-           {:name "rq", :default 1.0 :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}
-           {:name "db", :default 0.0 :doc "amount of boost (db > 0) or attenuation (db < 0) of the frequency band"}]
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "center frequency of the band in Hertz"}
+
+           {:name "rq"
+            :default 1.0
+            :doc "the reciprocal of Q.  bandwidth / cutoffFreq"}
+
+           {:name "db"
+            :default 0.0
+            :doc "amount of boost (db > 0) or attenuation (db < 0) of
+                  the frequency band"}]
     :check (nth-input-stream? 0)
     :doc "attenuates or boosts a frequency band"
     :auto-rate true}

-   {:name "LPZ1", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two point average filter. Implements the formula: out(i) = 0.5 * (in(i) + in(i-1))"
-    :auto-rate true}
-
-   {:name "LPZ2", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two zero fixed lowpass. Implements the formula: out(i) = 0.25 * (in(i) + (2*in(i-1)) + in(i-2))"
-    :auto-rate true}
-
-   {:name "HPZ1", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two point difference filter. Implements the formula: out(i) = 0.5 * (in(i) - in(i-1))"
-    :auto-rate true}
-
-   {:name "HPZ2", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two zero fixed highpass. Implements the formula: out(i) = 0.25 * (in(i) - (2*in(i-1)) + in(i-2))"
-    :auto-rate true}
-
-   {:name "Slope", :args [{:name "in", :default 0.0 :doc "input signal to measure"}]
-    :check (nth-input-stream? 0)
-    :doc "Measures the rate of change per second of a signal. Formula implemented is: out[i] = (in[i] - in[i-1]) * sampling_rate"
-    :auto-rate true}
-
-   {:name "BPZ2", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two zero fixed midpass which cuts out 0 Hz and the Nyquist frequency. Implements the formula: out(i) = 0.5 * (in(i) - in(i-2))"
-    :auto-rate true}
-
-   {:name "BRZ2", :args [{:name "in", :default 0.0}]
-    :check (nth-input-stream? 0)
-    :doc "two zero fixed midcut which cuts out frequencies around 1/2 of the Nyquist frequency. Implements the formula: out(i) = 0.5 * (in(i) + in(i-2))"
-    :auto-rate true}
+
+   {:name "LPZ1"
+    :args [{:name "in"
+            :default 0.0}]
+
+    :check (nth-input-stream? 0)
+    :doc "two point average filter. Implements the formula:
+
+          out(i) = 0.5 * (in(i) + in(i-1))"
+    :auto-rate true}
+
+
+   {:name "LPZ2"
+    :args [{:name "in"
+            :default 0.0}]
+
+    :check (nth-input-stream? 0)
+    :doc "two zero fixed lowpass. Implements the formula:
+
+          out(i) = 0.25 * (in(i) + (2*in(i-1)) + in(i-2))"
+    :auto-rate true}
+
+
+   {:name "HPZ1"
+    :args [{:name "in"
+            :default 0.0}]
+
+    :check (nth-input-stream? 0)
+    :doc "two point difference filter. Implements the formula:
+
+          out(i) = 0.5 * (in(i) - in(i-1))"
+    :auto-rate true}
+
+
+   {:name "HPZ2"
+    :args [{:name "in"
+            :default 0.0}]
+
+    :check (nth-input-stream? 0)
+    :doc "two zero fixed highpass. Implements the formula:
+
+          out(i) = 0.25 * (in(i) - (2*in(i-1)) + in(i-2))"
+    :auto-rate true}
+
+
+   {:name "Slope"
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to measure"}]
+
+    :check (nth-input-stream? 0)
+    :doc "Measures the rate of change per second of a signal. Formula implemented is:
+
+          out[i] = (in[i] - in[i-1]) * sampling_rate"
+    :auto-rate true}
+
+
+   {:name "BPZ2"
+    :args [{:name "in"
+            :default 0.0}]
+    :check (nth-input-stream? 0)
+    :doc "two zero fixed midpass which cuts out 0 Hz and the Nyquist
+          frequency. Implements the formula:
+
+          out(i) = 0.5 * (in(i) - in(i-2))"
+    :auto-rate true}
+
+
+   {:name "BRZ2"
+    :args [{:name "in"
+            :default 0.0}]
+
+    :check (nth-input-stream? 0)
+    :doc "two zero fixed midcut which cuts out frequencies around 1/2 of
+          the Nyquist frequency. Implements the formula:
+
+          out(i) = 0.5 * (in(i) + in(i-2))"
+    :auto-rate true}
+

    {:name "Median",
-    :args [{:name "length", :default 3.0 :doc "number of input points in which to find the median. Must be an odd number from 1 to 31. If length is 1 then Median has no effect."}
-           {:name "in", :default 0.0 :doc "Input signal to be processed"}]
+    :args [{:name "length"
+            :default 3.0
+            :doc "number of input points in which to find the
+                  median. Must be an odd number from 1 to 31. If length
+                  is 1 then Median has no effect." }
+
+           {:name "in"
+            :default 0.0
+            :doc "Input signal to be processed"}]
+
     :check (nth-input-stream? 1)
-    :doc "returns the median of the last length input points. This non linear filter is good at reducing impulse noise  from a signal."
+    :doc "returns the median of the last length input points. This non
+          linear filter is good at reducing impulse noise from a
+          signal."
     :rates #{:ar :kr}
     :auto-rate true}

+
    {:name "Slew",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "up", :default 1.0 :doc "maximum upward slope"}
-           {:name "dn", :default 1.0 :doc "maximum downward slope"}]
-    :check (nth-input-stream? 0)
-    :doc "Smooth the curve by limiting the slope of the input signal to up and dn"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "up"
+            :default 1.0
+            :doc "maximum upward slope"}
+
+           {:name "dn"
+            :default 1.0
+            :doc "maximum downward slope"}]
+
+    :check (nth-input-stream? 0)
+    :doc "Smooth the curve by limiting the slope of the input signal to
+          up and dn"
+    :auto-rate true}
+

    {:name "FOS",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "a0", :default 0.0 :doc "first coefficient"}
-           {:name "a1", :default 0.0 :doc "second coefficient"}
-           {:name "b1", :default 0.0 :doc "third coefficient"}]
-    :check (nth-input-stream? 0)
-    :doc "first order filter section. Formula is equivalent to: out(i) = (a0 * in(i)) + (a1 * in(i-1)) + (b1 * out(i-1))"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "a0"
+            :default 0.0
+            :doc "first coefficient"}
+
+           {:name "a1"
+            :default 0.0
+            :doc "second coefficient"}
+
+           {:name "b1"
+            :default 0.0
+            :doc "third coefficient"}]
+
+    :check (nth-input-stream? 0)
+    :doc "first order filter section. Formula is equivalent to:
+
+          out(i) = (a0 * in(i)) + (a1 * in(i-1)) + (b1 * out(i-1))"
+    :auto-rate true}
+

    {:name "SOS",
-    :args [{:name "in", :default 0.0 :doc "input signal"}
-           {:name "a0", :default 0.0 :doc "1st coefficient"}
-           {:name "a1", :default 0.0 :doc "2nd coefficient"}
-           {:name "a2", :default 0.0 :doc "3rd coefficient"}
-           {:name "b1", :default 0.0 :doc "4th coefficient"}
-           {:name "b2", :default 0.0 :doc "5th coefficient"}]
-    :check (nth-input-stream? 0)
-    :doc "second order filter section (biquad). Formula is equivalent to: out(i) = (a0 * in(i)) + (a1 * in(i-1)) + (a2 * in(i-2)) + (b1 * out(i-1)) + (b2 * out(i-2))"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal"}
+
+           {:name "a0"
+            :default 0.0
+            :doc "1st coefficient"}
+
+           {:name "a1"
+            :default 0.0
+            :doc "2nd coefficient"}
+
+           {:name "a2"
+            :default 0.0
+            :doc "3rd coefficient"}
+
+           {:name "b1"
+            :default 0.0
+            :doc "4th coefficient"}
+
+           {:name "b2"
+            :default 0.0
+            :doc "5th coefficient"}]
+
+    :check (nth-input-stream? 0)
+    :doc "second order filter section (biquad). Formula is equivalent
+          to:
+
+          out(i) = (a0 * in(i)) +
+                   (a1 * in(i-1)) +
+                   (a2 * in(i-2)) +
+                   (b1 * out(i-1)) +
+                   (b2 * out(i-2))"
+    :auto-rate true}
+

    {:name "Ringz",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "resonant frequency in Hertz"}
-           {:name "decay-time", :default 1.0 :doc "the 60 dB decay time of the filter"}]
-    :check (nth-input-stream? 0)
-    :doc "Ringz is the same as Resonz, except that instead of a resonance parameter, the bandwidth is specified in a 60dB ring decay time. One Ringz is equivalent to one component of the Klank UGen"
-    :auto-rate true}
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "resonant frequency in Hertz"}
+
+           {:name "decay-time"
+            :default 1.0
+            :doc "the 60 dB decay time of the filter"}]
+
+    :check (nth-input-stream? 0)
+    :doc "Ringz is the same as Resonz, except that instead of a
+          resonance parameter, the bandwidth is specified in a 60dB ring
+          decay time. One Ringz is equivalent to one component of the
+          klank ugen"
+    :auto-rate true}
+

    {:name "Formlet",
-    :args [{:name "in", :default 0.0 :doc "input signal to be processed"}
-           {:name "freq", :default 440.0 :doc "resonant frequency in Hertz"}
-           {:name "attack-time", :default 1.0 :doc "60 dB attack time in seconds"}
-           {:name "decay-time", :default 1.0 :doc "60 dB decay time in seconds"}]
-    :check (nth-input-stream? 0)
-    :doc "a resonant filter whose impulse response is like that of a sine wave with a Decay2 envelope over it. The great advantage to this filter over FOF is that there is no limit to the number of overlapping
-grains since the grain is just the impulse response of the filter. Note that if attacktime == decaytime then the signal cancels out and if attacktime > decaytime then the impulse response is inverted."
+    :args [{:name "in"
+            :default 0.0
+            :doc "input signal to be processed"}
+
+           {:name "freq"
+            :default 440.0
+            :doc "resonant frequency in Hertz"}
+
+           {:name "attack-time"
+            :default 1.0
+            :doc "60 dB attack time in seconds"}
+
+           {:name "decay-time"
+            :default 1.0
+            :doc "60 dB decay time in seconds"}]
+
+    :check (nth-input-stream? 0)
+    :doc "a resonant filter whose impulse response is like that of a
+          sine wave with a Decay2 envelope over it. The great advantage
+          to this filter over FOF is that there is no limit to the
+          number of overlapping grains since the grain is just the
+          impulse response of the filter. Note that if attacktime ==
+          decaytime then the signal cancels out and if attacktime >
+          decaytime then the impulse response is inverted."
     :auto-rate true}])

 (def detect-silence
   {:name "DetectSilence",
-   :args [{:name "in", :default 0.0 :doc "any source"}
-          {:name "amp", :default 0.0001 :doc "when input falls below this, evaluate doneAction"}
-          {:name "time", :default 0.1 :doc "the minimum duration of the input signal which input must fall below thresh before this triggers. The default is 0.1 seconds"}
-          {:name "action", :default 0 :doc "the action to perform when silence is detected. Default: NO-ACTION"}],
+   :args [{:name "in"
+           :default 0.0
+           :doc "any source"}
+
+          {:name "amp"
+           :default 0.0001
+           :doc "when input falls below this, evaluate done action"}
+
+          {:name "time"
+           :default 0.1
+           :doc "the minimum duration of the input signal which input
+                 must fall below thresh before this triggers. The
+                 default is 0.1 seconds"}
+
+          {:name "action"
+           :default 0
+           :doc "the action to perform when silence is
+                 detected. Default: NO-ACTION"}],
    :num-outs 1
    :check-inputs same-rate-as-first-input
    :check (nth-input-stream? 0)
-   :doc "If the signal input starts with silence at the beginning of the synth's duration, then DetectSilence will wait indefinitely until the first sound before starting to monitor for silence. This UGen outputs 1 if silence is detected, otherwise 0."
+   :doc "If the signal input starts with silence at the beginning of the
+         synth's duration, then DetectSilence will wait indefinitely
+         until the first sound before starting to monitor for
+         silence. This UGen outputs 1 if silence is detected, otherwise
+         0."
    :rates #{:ar :kr}
    :auto-rate true})


fix comparison error, add lookup-entity implementations

--- src/clj_money/models/auth_helpers.clj
+++ src/clj_money/models/auth_helpers.clj
@@ -14,13 +14,11 @@
   [_ resource]
   (:id resource))

-(defmethod ^:private lookup-entity-id :account
+(defmethod ^:private lookup-entity-id :default
   [_ resource]
-  (:entity-id resource))
-
-(defmethod ^:private lookup-entity-id :transaction
-  [_ resource]
-  (:entity-id resource))
+  (or (:entity-id resource)
+      (throw (ex-info "No :entity-id value present" {:resource resource
+                                                     :meta (meta resource)}))))

 (defmethod ^:private lookup-entity-id :attachment
   [{storage-spec :storage-spec :as context} resource]
@@ -50,7 +48,7 @@
   [user resource & args]
   (let [context (last args)
         entity (lookup-entity context resource)]
-    (= (:user-id entity))))
+    (= (:user-id entity) (:id user))))

 (defn user-granted-access?
   [user resource action {storage-spec :storage-spec :as context}]


Specify data type for ajax call. Fixes #91.

--- src/cljs/clojuredocs/mods/search.cljs
+++ src/cljs/clojuredocs/mods/search.cljs
@@ -217,9 +217,10 @@
      :data {:query query
             :clojure-level clojure-level
             :text text}
+     :data-type :edn
      :success (fn [_]
                 (util/navigate-to "/search-feedback/success"))
-     :error (fn [_]
+     :error (fn [& args]
               (om/set-state! owner
                 :error-message
                 "There was a problem sending your feedback, try again.")


Removed bad partial.

Removed bad partial.

--- src/dragon/blog/post/impl/default.clj
+++ src/dragon/blog/post/impl/default.clj
@@ -109,11 +109,13 @@
   (log/debug "Converting post body ...")
   (let [system (:system this)]
     (event/publish system tag/parse-content-pre {:body (:body data)})
-    (-> data
-        :content-type
-        keyword
-        (partial post-util/convert-body! system data)
-        (event/publish-> system tag/parse-content-post {:body (:body data)}))))
+    (->> data
+         :content-type
+         keyword
+         (post-util/convert-body! system data)
+         (event/publish->> system
+                           tag/parse-content-post
+                           {:body (:body data)}))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;   Implementation   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Server can now detect tables in the public schema

This means that the demo todo MVC app tables can be detected. However
testing with an external schema doesn't seem to work yet


(MAINT) Reformatting

(MAINT) Reformatting

--- src/puppetlabs/trapperkeeper/authorization/acl.clj
+++ src/puppetlabs/trapperkeeper/authorization/acl.clj
@@ -127,10 +127,13 @@
   (str/replace in #"\$(\d+)" #(nth captures (- (read-string (second %)) 1))))

 (defn interpolate-backreference
-  "change all possible backreferences in ace patterns to values from the capture groups"
+  "change all possible backreferences in ace patterns to values from the
+  capture groups"
   [ace captures]
   (if (= (ace :type) :dynamic)
-    (new-domain (ace :auth-type) (str/join "." (map #(substitute-backreference % captures) (reverse (ace :pattern)))))
+    (new-domain (ace :auth-type)
+                (str/join "." (map #(substitute-backreference % captures)
+                                   (reverse (ace :pattern)))))
     ace))

 (schema/defn match? :- schema/Bool


Fix mobile UI for mailserver icons

Fix mobile UI for mailserver icons

--- src/status_im/ui/screens/offline_messaging_settings/views.cljs
+++ src/status_im/ui/screens/offline_messaging_settings/views.cljs
@@ -7,14 +7,18 @@
             [status-im.ui.components.list.views :as list]
             [status-im.ui.components.react :as react]
             [status-im.ui.components.status-bar.view :as status-bar]
+            [status-im.utils.platform :as platform]
             [status-im.ui.components.toolbar.view :as toolbar]
             [status-im.ui.components.toolbar.actions :as toolbar.actions]
             [status-im.ui.screens.offline-messaging-settings.styles :as styles]))

 (defn- wnode-icon [connected?]
-  [react/view {:style (styles/wnode-icon-container connected?)}
+  [react/view (if platform/desktop?
+                {:style (styles/wnode-icon-container connected?)}
+                (styles/wnode-icon-container connected?))
    [vector-icons/icon :icons/wnode
-    {:style (styles/wnode-icon connected?)}]])
+    (if platform/desktop? {:style (styles/wnode-icon connected?)}
+        (styles/wnode-icon connected?))]])

 (defn connect-to-mailserver [id]
   (re-frame/dispatch [:connect-wnode id]))


fix docstring indentation in doc gen

fix docstring indentation in doc gen

--- scripts/get-symbol-metadata/src/core.clj
+++ scripts/get-symbol-metadata/src/core.clj
@@ -81,6 +81,36 @@
   (get-forms-from-file (get-repo-path ns- repo file)))

 ;;------------------------------------------------------------
+;; Docstring Indentation Fix
+;;------------------------------------------------------------
+
+(defn get-docstring-indent
+  [docstring]
+  (let [lines (split-lines docstring)]
+    (if (> (count lines) 1)
+      (let [[first-line & indented-lines] lines
+            get-indent-length #(count (re-find #"^ *" %))
+            has-content? #(pos? (count (trim %)))]
+        (->> indented-lines
+             (filter has-content?)
+             (map get-indent-length)
+             (apply min 3)))
+      0)))
+
+(defn fix-docstring
+  [docstring]
+  (let [indent-length (get-docstring-indent docstring)]
+    (if (zero? indent-length)
+      docstring
+      (let [[first-line & indented-lines] (split-lines docstring)
+            indent (re-pattern (str "^ {" indent-length "}"))
+            remove-indent #(replace % indent "")]
+        (->> indented-lines
+             (map remove-indent)
+             (cons first-line)
+             (join "\n"))))))
+
+;;------------------------------------------------------------
 ;; Form Parsing
 ;;------------------------------------------------------------

@@ -89,7 +119,8 @@
   (let [fn-or-macro ({'defn "function" 'defmacro "macro"} (first form))
         docstring (when fn-or-macro
                     (let [ds (nth form 2)]
-                      (when (string? ds) ds)))
+                      (when (string? ds)
+                        (fix-docstring ds))))
         m (meta form)
         lines [(:line m) (:end-line m)]
         num-lines (inc (- (:end-line m) (:line m)))


[CS] Make error-message-for public (macrology)

--- src/vip/data_processor/validation/csv/file_set.clj
+++ src/vip/data_processor/validation/csv/file_set.clj
@@ -18,7 +18,7 @@
          ")")
     (str part)))

-(defn- error-message-for [dependencies]
+(defn error-message-for [dependencies]
   (str "File dependencies not met: " (error-message-part dependencies)))

 (defmacro build-dependencies


clean-up

clean-up

--- model/make.clj
+++ model/make.clj
@@ -4,15 +4,15 @@

 (defn find-record [id]
   (sql/with-connection db
-    (sql/with-results rows (str "select * from make where id =" id)
+    (sql/with-results rows (str "select * from make where id =" id)
       (merge {} (first rows)))))

 (defn create [attributes]
-  (let [key-vector (keys attributes)
-        val-vector (map attributes key-vector)]
-    (sql/with-connection db
-      (let
-        [id (sql/transaction
-              (sql/insert-values :make key-vector val-vector)
-              (sql/with-results rows "VALUES IDENTITY_VAL_LOCAL()" (:1 (first rows))))]
-        (find-record id)))))
+  (sql/with-connection db
+    (let
+      [key-vector (keys attributes)
+       val-vector (map attributes key-vector)
+       id (sql/transaction
+            (sql/insert-values :make key-vector val-vector)
+            (sql/with-results rows "VALUES IDENTITY_VAL_LOCAL()" (:1 (first rows))))]
+      (find-record id))))


Handle bidi wildcards in yada hosts

Handle bidi wildcards in yada hosts

Fix #67

--- lib/edge.ig.yada/src/edge/yada/ig.clj
+++ lib/edge.ig.yada/src/edge/yada/ig.clj
@@ -38,7 +38,11 @@
 (defmethod hosts "bidi.vhosts.VHostsModel"
   [config state]
   (let [vhosts (mapcat first (:vhosts (::handler state)))]
-    (map #(str (name (:scheme %)) "://" (:host %)) vhosts)))
+    (map (fn [vhost]
+           (if (= :* vhost)
+             (str "http://localhost:" (:port state))
+             (str (name (:scheme vhost)) "://" (:host vhost))))
+         vhosts)))

 (defmethod hosts :default
   [config state]


Possibility for running handler in transaction.

--- src/subticket/service.clj
+++ src/subticket/service.clj
@@ -3,7 +3,8 @@
             [io.pedestal.http.route :as route]
             [io.pedestal.http.body-params :as body-params]
             [ring.util.response :as ring-resp]
-            [subticket.users :as users]))
+            [subticket.users :as users]
+            [korma.db]))

 (defn about-page
   [request]
@@ -51,12 +52,12 @@
 ;; The interceptors defined after the verb map (e.g., {:get home-page}
 ;; apply to / and its children (/about).
 (def common-interceptors [(body-params/body-params) http/html-body])
-(def json-interceptors [(body-params/body-params) http/json-body default-json])
+(defn json-interceptors [handler] [(body-params/body-params) http/json-body default-json (fn [request] (korma.db/transaction (handler request)))])

 ;; Tabular routes
 (def routes #{["/" :get (conj common-interceptors `home-page)]
               ["/about" :get (conj common-interceptors `about-page)]
-              ["/user/:user-id" :put (conj json-interceptors `users/add-user-handler)]})
+              ["/user/:user-id" :put (json-interceptors users/add-user-handler) :route-name :add-user]})

 ;; Map-based routes
 ;(def routes `{"/" {:interceptors [(body-params/body-params) http/html-body]


Note about reducers.

Note about reducers.

--- src/cljs/go.clj
+++ src/cljs/go.clj
@@ -158,7 +158,9 @@
   ([] (compile-clojurescript "."))
   ([target-dir]
      (env/ensure
-      (doseq [ns '[cljs.core ; cljs.reader ;; doesn't work yet, some ns / import issue.
+      (doseq [ns '[cljs.core
+                   ; cljs.reader ;; doesn't work yet, some ns / import issue.
+                   ; clojure.core.reducers ;; fails to macroexpand a destructure during analyzing.
                    clojure.set clojure.data clojure.string clojure.walk clojure.zip]
               :let [resource (io/resource (str (s/replace (str ns) "." "/") ".cljs"))]]
         (time


Fixed Issue #4: Added a `read-all` function for clj pretty printing.

--- pp-jvm-server/src/pp_jvm/format/clojure_pp.clj
+++ pp-jvm-server/src/pp_jvm/format/clojure_pp.clj
@@ -1,16 +1,22 @@
 (ns pp-jvm.format.clojure-pp
   (:require [clojure.tools.reader :as r]
+            [clojure.tools.reader.reader-types :as rt]
             [clojure.pprint :refer [write code-dispatch simple-dispatch]]))

 (def dispatch-mode
   {"clojure"  code-dispatch
    "edn"      simple-dispatch})

+(defn- read-all
+  [input]
+  (let [eof (Object.)]
+    (take-while #(not= % eof) (repeatedly #(r/read input false eof)))))
+
 (defn str-to-literal!
   "Takes valid clojure as input and transforms it to a clojure literal for
   formating."
   [string]
-  (r/read-string string))
+  (read-all (rt/string-push-back-reader string)))

 (defn- format-literal!
   "Takes a literal and formats it using the built in clojure.pprint/write


stop returning false from events in a few places

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -335,14 +335,14 @@

                          :onSubmit (fn [e]
                                      (cast! :text-layer-finished)
-                                     false)
+                                     (utils/stop-event e))
                          :onKeyDown #(cond (= "Enter" (.-key %))
                                            (do (cast! :text-layer-finished)
-                                               false)
+                                               (utils/stop-event %))

                                            (= "Escape" (.-key %))
                                            (do (cast! :cancel-drawing)
-                                               false)
+                                               (utils/stop-event %))

                                            :else nil)}
                     ;; TODO: experiment with a contentEditable div
@@ -416,10 +416,10 @@
                          :onWheel #(.stopPropagation %)
                          :onSubmit (fn [e]
                                      (cast! :layer-properties-submitted)
-                                     false)
+                                     (utils/stop-event e))
                          :onKeyDown #(when (= "Enter" (.-key %))
                                        (cast! :layer-properties-submitted)
-                                       false)}
+                                       (utils/stop-event %))}
                     (dom/input #js {:type "text"
                                     :ref "id-input"
                                     :className "layer-property-id"
@@ -451,7 +451,7 @@
                       (when (seq targets)
                         (dom/button #js {:className "layer-property-button"
                                          :onClick #(do (om/update-state! owner :input-expanded not)
-                                                       false)}
+                                                       (utils/stop-event %))}
                                     "...")))
                     (apply dom/div #js {:className (if (om/get-state owner :input-expanded)
                                                      "property-dropdown-targets expanded"
@@ -512,16 +512,15 @@
                                          (js/clearInterval (om/get-state owner :touch-timer))
                                          ((:handle-mouse-move! handlers) (aget touches "0")))))
                       :onMouseDown (fn [event]
+                                     ((:handle-mouse-down handlers) event)
                                      ;;(.preventDefault event)
                                      (.stopPropagation event)
-                                     ((:handle-mouse-down handlers) event))
+                                     )
                       :onMouseUp (fn [event]
+                                   ((:handle-mouse-up handlers) event)
                                    ;(.preventDefault event)
-                                   (.stopPropagation event)
-                                   ((:handle-mouse-up handlers) event))
+                                   (.stopPropagation event))
                       :onWheel (fn [event]
-                                 (.preventDefault event)
-                                 (.stopPropagation event)
                                  (let [dx     (- (aget event "deltaX"))
                                        dy     (aget event "deltaY")]
                                    (om/transact! payload (fn [state]
@@ -529,7 +528,8 @@
                                                                  mode   (cameras/camera-mouse-mode state)]
                                                              (if (= mode :zoom)
                                                                (cameras/set-zoom state (partial + (* -0.002 dy)))
-                                                               (cameras/move-camera state dx (- dy))))))))}
+                                                               (cameras/move-camera state dx (- dy)))))))
+                                 (utils/stop-event event))}
                  (dom/defs nil
                    (dom/pattern #js {:id           "small-grid"
                                      :width        (str (cameras/grid-width camera))


Add testing.

Add testing.

--- test/onyx/coordinator/multi_peer_test.clj
+++ test/onyx/coordinator/multi_peer_test.clj
@@ -59,11 +59,12 @@
         (<!! sync-spy-a)
         (<!! sync-spy-b)

-        (let [payload-a (extensions/read-place sync payload-node-a)
-              payload-b (extensions/read-place sync payload-node-b)]
-          (is (not (nil? payload-a)))
-          (is (not (nil? payload-b)))
-          (is (not= payload-a payload-b)))))
+        (testing "Both payloads are received"
+          (let [payload-a (extensions/read-place sync payload-node-a)
+                payload-b (extensions/read-place sync payload-node-b)]
+            (is (not (nil? payload-a)))
+            (is (not (nil? payload-b)))
+            (is (not= payload-a payload-b))))))
     {:eviction-delay 50000}))

 (run-tests 'onyx.coordinator.multi-peer-test)


(PE-4648) Changed port that the test-app-startup-against-crls tests use

This commit changes the port that the `test-app-startup-against-crls`
tests use from 8140 to 8081.  The use of port 8140 was conflicting with
the default port that Puppet masters use.  This has led to frequent local
test run failures when one would happen to have a master already running
when trying to run the tests.

--- test/puppetlabs/master/bootstrap_test.clj
+++ test/puppetlabs/master/bootstrap_test.clj
@@ -59,13 +59,14 @@
   nil)

 (deftest test-app-startup-against-crls
-  (let [test-url "https://localhost:8140/production/node/localhost"]
+  (let [port     8081
+        test-url (str "https://localhost:" port "/production/node/localhost")]
     (tk-bootstrap-testutils/with-app-with-config
       app
       jvm-puppet-service-stack
       {:webserver
         {:ssl-host    "0.0.0.0"
-         :ssl-port    8140
+         :ssl-port    port
          :client-auth "need"}
        :jruby-puppet (jruby-testutils/jruby-puppet-config-with-prod-env 1)}
       (testing (str "Simple request to jvm puppet succeeds when the client "


Replicate linreg tests for experimental API

--- test/tensorflow_clj/experimental_test.clj
+++ test/tensorflow_clj/experimental_test.clj
@@ -3,3 +3,48 @@
             [tensorflow-clj.core :refer :all]
             [tensorflow-clj.experimental :refer :all]
             [tensorflow-clj.util :refer :all]))
+
+(def x-train [1.  2.  3.  4.])
+(def y-train [0. -1. -2. -3.])
+
+(deftest linreg-one-pass
+  (testing "Linear regression (one pass)"
+    (exec-graph-sess-fn
+      (fn [graph session]
+        (load-graph! graph "misc/linreg.pb")
+        (run-graph-thing session {:init nil})
+        (let [[[a b c d]] (run-graph-thing session {:x x-train} :linear_model)]
+          (is (approx= 0.0 a))
+          (is (approx= 0.3 b))
+          (is (approx= 0.6 c))
+          (is (approx= 0.9 d)))))))
+
+(deftest linreg-one-loss
+  (testing "Linear regression (one loss)"
+    (exec-graph-sess-fn
+      (fn [graph session]
+        (load-graph! graph "misc/linreg.pb")
+        (run-graph-thing session {:init nil})
+        (let [[loss] (run-graph-thing session {:x x-train :y y-train} :loss)]
+          (is (approx= 23.66 loss)))))))
+
+(deftest linreg-fixed-vars
+  (testing "Linear regression (fixed variables)"
+    (exec-graph-sess-fn
+      (fn [graph session]
+        (load-graph! graph "misc/linreg.pb")
+        (run-graph-thing session {:fixW nil :fixb nil})
+        (let [[loss] (run-graph-thing session {:x x-train :y y-train} :loss)]
+          (is (approx= 0.0 loss)))))))
+
+(deftest linreg-graph-iterations
+  (testing "Linear regression (1000 iterations)"
+    (exec-graph-sess-fn
+      (fn [graph session]
+        (load-graph! graph "misc/linreg.pb")
+        (run-graph-thing session {:init nil})
+        (dotimes [i 1000]
+          (run-graph-thing session {:x x-train :y y-train :train nil}))
+        (let [[[W] [b]] (run-graph-thing session {} :W :b)]
+          (is (approx= -0.9999 W))
+          (is (approx= 0.99999 b)))))))


Make alternate-scroll-separator configurable.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -146,12 +146,12 @@
       (keys cmds))))

 (defn set-up-alternate-scrolling
-  [height width alternate-height prompt-string in-rdr]
+  [height width alternate-height alternate-scroll-separator prompt-string in-rdr]
   (let [prompt-width (count prompt-string)
         adjusted-prompt-string (str "\u001B[" (- height alternate-height) ";0H"
                                     "\u001B[2K"
                                     prompt-string
-                                    "\u001B[" (- height alternate-height 1) ";0H" (apply str (repeat width "\u203E"))
+                                    "\u001B[" (- height alternate-height 1) ";0H" (apply str (repeat width alternate-scroll-separator))
                                     "\u001B[1;" (- height alternate-height 2) "r"
                                     "\u001B[" (- height alternate-height) ";" (+ prompt-width 1) "H")]
     (print (str "\u001B[2J\u001B[1;" (- height alternate-height 2) "r"))
@@ -189,12 +189,13 @@

         alternate-scrolling (opts :alternate-scrolling)
         alternate-height (opts :alternate-height)
+        alternate-scroll-separator (opts :alternate-scroll-separator)
         term (TerminalFactory/create)
         ansi-support (.isAnsiSupported term)
         last-height (atom (.getHeight term))
         last-width (atom (.getWidth term))]
     (when (and alternate-scrolling ansi-support)
-      (set-up-alternate-scrolling @last-height @last-width alternate-height prompt-string in-rdr))
+      (set-up-alternate-scrolling @last-height @last-width alternate-height alternate-scroll-separator prompt-string in-rdr))
     (fn [request-prompt request-exit]
       (let [line (.readLine in-rdr)
             current-height (.getHeight term)
@@ -205,7 +206,7 @@
                 (or (not= @last-height current-height) (not= @last-width current-width)))
           (reset! last-height current-height)
           (reset! last-width current-width)
-          (set-up-alternate-scrolling @last-height @last-width alternate-height prompt-string in-rdr))
+          (set-up-alternate-scrolling @last-height @last-width alternate-height alternate-scroll-separator prompt-string in-rdr))
         (if (not (nil? file-history))
           (.flush file-history))
         (if (and (not (nil? line))
@@ -325,7 +326,8 @@
    :prompt-fn (fn [])
    :prompt-string "cli# "
    :alternate-scrolling false
-   :alternate-height 3})
+   :alternate-height 3
+   :alternate-scroll-separator "\u203E"})

 (defn merge-options
   "This function merges the user supplied configuration options with the default and mandatory default options.


Improve handling of comments.

Improve handling of comments.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -54,8 +54,13 @@
   (let [in-rdr (doto (ConsoleReader.) (.addCompleter (StringsCompleter. (map name (keys cmds)))))
         rdr-fn (create-repl-read-fn cmds)]
     (fn [request-prompt request-exit]
-      (binding [*in* (PushbackReader. (StringReader. (str (.readLine in-rdr) "\n")))]
-        (rdr-fn request-prompt request-exit)))))
+      (let [line (.readLine in-rdr)]
+        (if (and (not (nil? line))
+                 (not (.isEmpty line))
+                 (not (-> line (.trim) (.startsWith ";"))))
+          (binding [*in* (PushbackReader. (StringReader. (str line "\n")))]
+            (rdr-fn request-prompt request-exit))
+          request-prompt)))))

 (defn get-cmd-aliases
   [cmds]


Added second variadic arity to add-task for adding

composable extra behaviros to task bundles

--- src/onyx/job.clj
+++ src/onyx/job.clj
@@ -11,13 +11,15 @@

 (s/defn ^:always-validate add-task :- os/Job
   "Adds a task's task-definition to a job"
-  [{:keys [lifecycles triggers windows flow-conditions] :as job}
-   {:keys [task schema] :as task-definition}]
-  (merge-with s/validate schema task)
-  (merge-with s/validate base-schemas task)
-  (cond-> job
-    true (update :catalog conj (:task-map task))
-    lifecycles (update :lifecycles into (:lifecycles task))
-    triggers (update :triggers into (:triggers task))
-    windows (update :windows into (:windows task))
-    flow-conditions (update :flow-conditions into (:flow-conditions task))))
+  ([job task-definition & behaviors]
+   (add-task job (reduce (fn [acc f] (f acc))task-definition behaviors)))
+  ([{:keys [lifecycles triggers windows flow-conditions] :as job}
+    {:keys [task schema] :as task-definition}]
+   (merge-with s/validate schema task)
+   (merge-with s/validate base-schemas task)
+   (cond-> job
+     true (update :catalog conj (:task-map task))
+     lifecycles (update :lifecycles into (:lifecycles task))
+     triggers (update :triggers into (:triggers task))
+     windows (update :windows into (:windows task))
+     flow-conditions (update :flow-conditions into (:flow-conditions task)))))


Bump chef-server to 0.10.4 and add gecode

--- config/projects/chef-server-full.clj
+++ config/projects/chef-server-full.clj
@@ -17,9 +17,9 @@
 ;; limitations under the License.
 ;;

-(project "chef-server-full" "0.10.0" "1"
+(project "chef-server-full" "0.10.4" "1"
          :build-order [ "prep" "autoconf" "zlib" "libiconv" "db" "gdbm" "ncurses" "openssl"
-                        "libxml2" "libxslt" "ruby" "rsync" "chef" "chef-server"
+                        "libxml2" "libxslt" "ruby" "rsync" "gecode" "chef" "chef-server"
                         "erlang" "icu" "spidermonkey" "curl" "couchdb"])


Update total coins on triggered events

Update total coins on triggered events

This just adds to the total in course-material, which is retrieved
periodically from the server and is authorative.

--- src/rill/web.clj
+++ src/rill/web.clj
@@ -3,7 +3,7 @@
             [rill.handler :as rill-handler]
             [rill.message :as message]))

-(defn command-result-to-ring-response [command [status events new-version]]
+(defn command-result-to-ring-response [command [status events new-version triggered]]
   (case status
     :rejected
     {:status 422 :body {:status :command-rejected}} ; HTTP 422 Unprocessable Entity
@@ -18,6 +18,7 @@
     {:status 200 :body {:status :command-accepted
                         :events events
                         :aggregate-version new-version
+                        :triggered triggered
                         :aggregate-id (message/primary-aggregate-id command)}}

     ;; else


must require clojure.edn

must require clojure.edn

otherwise it can't be compiled and it cause an error in lein test

--- src/larva/graph.clj
+++ src/larva/graph.clj
@@ -1,9 +1,10 @@
 (ns larva.graph
-  (:require [larva.meta-model :refer :all]
+  (:require [clojure.edn :as edn]
+            [larva.meta-model :refer :all]
             [schema.core :as s]
             [ubergraph.core :as g]))

-(def uni-model (clojure.edn/read-string (slurp "resources/edn-sources/standard_app.clj")))
+(def uni-model (edn/read-string (slurp "resources/edn-sources/standard_app.clj")))

 ;;;;;;
 ;; Transforming standard app program to Ubergraph


Fix failure to reset forms.

Fix failure to reset forms.

--- src-cljs/frontend/components/contact_form.cljs
+++ src-cljs/frontend/components/contact_form.cljs
@@ -148,7 +148,8 @@
                                         (if (= (:status resp) :success)
                                           (do
                                             (om/set-state! owner :form-state :success)
-                                            (.reset form))
+                                            ;; Not clear why this delay is needed, but without it the reset just doesn't happen.
+                                            (js/setTimeout #(.reset form) 10))
                                           (do
                                             (om/set-state! owner :form-state :idle)
                                             (om/set-state! owner :notice {:type "error" :message "Sorry! There was an error sending your message."})))))))))})


Wording around iOS beta.

Wording around iOS beta.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -924,7 +924,7 @@
           [:p (str (pm/freemium-containers plan) " container is free, forever.")])
         (when-not (config/enterprise?)
           [:p "Additionally, projects that are public on GitHub will build with " pm/oss-containers " extra containers -- our gift to free and open source software."]
-          [:p "If you are enabled in the limited-release, you may also choose an iOS plan "
+          [:p "If you are in the limited-release beta, you may also choose an iOS plan "
               [:a {:href "#containers"} "here"]
               ". We will support general release in the near future!"])]]))))


fix setup of test pipelines

fix setup of test pipelines

--- backend/test/lambdaui/testpipeline/core.clj
+++ backend/test/lambdaui/testpipeline/core.clj
@@ -27,9 +27,9 @@

 (defn start-server [port]
-  (let [simple-pipeline (lambdacd/assemble-pipeline pipe/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "SIMPLE PIPELINE" :location :backend-location :path-prefix ""}})
-        trigger-pipeline (lambdacd/assemble-pipeline pipe-with-trigger/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "TRIGGER PIPELINE" :location :backend-location :path-prefix ""}})
-        long-running-pipe (lambdacd/assemble-pipeline long-running-pipe/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "LONG-RUNNING PIPELINE" :location :backend-location :path-prefix ""}})]
+  (let [simple-pipeline (lambdacd/assemble-pipeline pipe/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "SIMPLE PIPELINE" :location :backend-location }})
+        trigger-pipeline (lambdacd/assemble-pipeline pipe-with-trigger/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "TRIGGER PIPELINE" :location :backend-location }})
+        long-running-pipe (lambdacd/assemble-pipeline long-running-pipe/pipeline-structure {:home-dir (util/create-temp-dir) :ui-config {:name "LONG-RUNNING PIPELINE" :location :backend-location }})]
     (reset! current-pipeline simple-pipeline)
     (reset! server (http/run-server
                      (routes


more work on setter

more work on setter

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -3,20 +3,15 @@
   (:require [instaparse.core :as insta ])
   (:require [clojure.string  :as string]))

-(declare nmlname nmlstr nmlsub)
+(declare nmlname nmlstr)

 (def debug false)

 (def parse (insta/parser (clojure.java.io/resource "grammar")))

-(defn nmlfind [tree nml key]
-  (let [stmts     (rest tree)
-        stmt      (last (filter #(= (nmlname %) nml) stmts))
-        nvsubseqs (rest (last stmt))]
-    (last (filter #(= (nmlname %) key) nvsubseqs))))
-
 (defn nmlget [tree nml key]
-  (let [nvsubseq  (nmlfind tree nml key)
+  (let [stmt      (last (filter #(= (nmlname %) nml) (rest tree)))
+        nvsubseq  (last (filter #(= (nmlname %) key) (rest (last stmt))))
         values    (last nvsubseq)]
     (if (nil? values) "" (nmlstr values))))

@@ -70,19 +65,15 @@
                  :ws       ""
                  :wsopt    ""))))

-(defn nmlset [tree nml key val]
-  (let [swap-if (fn [k v] (if (= (nmlstr k) nml) [k (nmlsub v nml key val)] [k v]))]
-    (println (insta/transform {:stmt swap-if} tree))))
-
-(defn nmlsub [nvseq nml key val]
-  (let [val-tree (parse val :start :values)
-        swap-if (fn [k v] (if (= (nmlstr k) key) [k val-tree] [k v]))]
-    (insta/transform {:nvsubseq swap-if} nvseq)))
+(defn nmlset [tree nml key val & sub]
+  (let [child (if sub :nvsubseq :stmt)
+        match (if sub key nml)
+        vnew  (if sub (fn [tree] (parse val :start :values)) #(nmlset % nml key val true))
+        f     (fn [k v] [child k (if (= (nmlstr k) match) (vnew v) v)])]
+    (insta/transform {child f} tree)))

 (defn -main [& args]
   (alter-var-root #'*read-eval* (constantly false))
   (let [filename (last args)
         tree (parse (slurp filename))]
-    (nmlset tree "n1" "s" "'orly'")))
-;;   (println (nmlget tree "n1" "s"))))
-;;   (println (nmlstr tree))))
+    (println (nmlget (nmlset tree "n1" "s" "'orly'") "n1" "s"))))


Fix falling back to HEAD/master even if the target state exists

--- src/web/app.cljs
+++ src/web/app.cljs
@@ -33,16 +33,25 @@
       (routing/activate-route! view {:state (:name state)})))

   (componentWillUpdate [this new-props new-state]
-    (let [{:keys [custard/state custard/states]} new-props]
-      (when (and (empty? state)
-                 (not (empty? states)))
-        (let [get-fn (fn [name] (first (filter #(= name (:name %)) states)))
-              head (get-fn "HEAD")
-              master (get-fn "refs/heads/master")]
-          (cond
-            head (.select-state this [:state "HEAD"])
-            master (.select-state this [:state "refs/heads/master"])
-            :else (.select-state this [:state (:id (first states))]))))))
+    (let [state (:state (om/get-params this))
+          states (:custard/states new-props)]
+      (println "App: will update:"
+               "state?" (not (nil? state))
+               "states?" (not (empty? states)))
+      (when (not (empty? states))
+        (let [names (map :name states)
+              find-state (fn [name] (first (filter #(= name %) names)))
+              requested-state (find-state (second state))
+              head (find-state "HEAD")
+              master (find-state "refs/heads/master")]
+          (println "App: will update: desired state" state)
+          (println "App: will update:   found:" requested-state)
+          (when (nil? requested-state)
+            (println "App: will update: falling back to HEAD or master")
+            (cond
+              head (.select-state this [:state "HEAD"])
+              master (.select-state this [:state "refs/heads/master"])
+              :else (.select-state this [:state (:name (first states))])))))))

   (render [this]
     (dom/div #js {:className "app"}


Use the set-state! api to set the state

Use the set-state! api to set the state

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -111,9 +111,11 @@
             ;; create an iso
             (create-iso production)
             ;; set the state to encoded
-            (prod/update! (assoc production :state "encoded"))))))
+            (prod/set-state! production "encoded")
+            ;; FIXME: set the number of volumes
+            ))))
     ;; otherwise move the production to state :pending-volume-split
-    (prod/update! (assoc production :state "pending-split"))))
+    (prod/set-state! production "pending-split")))

 (defn encode-multiple
   [production sample-rate bitrate]
@@ -127,4 +129,4 @@
           ;; create an iso
           (create-iso production volume)))))
   ;; set the state to encoded
-  (prod/update! (assoc production :state "encoded")))
+  (prod/set-state! production "encoded"))


add ability to run single test (namespace), fixes #775 (#776)

--- src/riemann/bin.clj
+++ src/riemann/bin.clj
@@ -88,7 +88,7 @@
    (-main "riemann.config"))
   ([config]
    (-main "start" config))
-  ([command config]
+  ([command config & [test-name]]
    (logging/init)
    (case command
      "start" (try
@@ -107,7 +107,8 @@
                 (set-config-file! config)
                 (riemann.config/include @config-file)
                 (binding [test/*streams* (:streams @config/next-core)]
-                  (let [results (clojure.test/run-all-tests #".*-test")]
+                  (let [test-name-pattern (if test-name (re-pattern test-name) #".*-test")
+                        results (clojure.test/run-all-tests test-name-pattern)]
                     (if (and (zero? (:error results))
                              (zero? (:fail results)))
                       (System/exit 0)


Add component state watcher

Add component state watcher

--- src/cljs/dato/debug/components/core.cljs
+++ src/cljs/dato/debug/components/core.cljs
@@ -6,7 +6,9 @@
             [cljs.reader :as reader]
             [clojure.string :as string]
             [dato.lib.core :as dato]
+            [dato.datascript-utils :as dsu]
             [dato.debug.components.keyboard-listener :as keyboard]
+            [goog.dom.classes :as gclass]
             [om-bootstrap.panel :as bs-p]
             [om-bootstrap.grid :as g]
             [om.core :as om :include-macros true]
@@ -69,6 +71,79 @@
                         :ns      'dato.debug}
                     cb))))

+(defn state-watcher-coms [state-watchers]
+  (keys (dissoc state-watchers ::count)))
+
+(defn com-owner [state-watchers com-key]
+  (get-in state-watchers [com-key :owner]))
+
+(defn com-state [state-watchers com]
+  (get-in state-watchers [com :states]))
+
+(defn com-name [state-watchers com]
+  (when com
+    (get-in state-watchers [com :name])))
+
+(def state-watchers
+  (atom {::count 0}))
+
+(defn com-key [com]
+  (om/react-id com))
+
+(defn watch-state-did-mount [f]
+  (fn []
+    (this-as
+     this
+     (swap! state-watchers
+            (fn [s]
+              (let [com-id (com-key this)]
+                (-> s
+                    (update-in [::count] inc)
+                    (assoc-in [com-id :name] ((or (aget this "getDisplayName") (fn [] "Unknown"))))
+                    (assoc-in [com-id :owner] this)))))
+     (.call f this))))
+
+(defn watch-state-did-update [f]
+  (fn [prev-props prev-state]
+    (this-as
+     this
+     (swap! state-watchers
+            (fn [s]
+              (let [com-id (com-key this)]
+                (-> s
+                    (assoc-in [com-id :states :dato] (dato/get-state this))
+                    (assoc-in [com-id :states :om] (om/get-state this))))))
+     (.call f this prev-props prev-state))))
+
+(defn watch-state-will-unmount [f]
+  (fn []
+    (this-as
+     this
+     (swap! state-watchers
+            (fn [s]
+              (let [com-id (com-key this)]
+                (-> s
+                    (dissoc com-id)))))
+     (.call f this))))
+
+(defn wrap-watch-state-methods [methods]
+  (-> methods
+      (update-in [:componentDidMount] watch-state-did-mount)
+      (update-in [:componentDidUpdate] watch-state-did-update)
+      (update-in [:componentWillUnmount] watch-state-will-unmount)))
+
+(def watch-state-methods
+  (om/specify-state-methods!
+   (-> om/pure-methods
+       (wrap-watch-state-methods)
+       (clj->js))))
+
+(defn highlight-node! [node]
+  (gclass/add node "dato-inspected"))
+
+(defn unhighlight-node! [node]
+  (gclass/remove node "dato-inspected"))
+
 (defn history-com [data owner opts]
   (reify
     om/IDisplayName
@@ -77,14 +152,14 @@
     om/IWillMount
     (will-mount [_]
       (om/set-state! owner [:current-save-slot] 0)
-      (om/set-state! owner [:tool] :states)
+      (om/set-state! owner [:tool] :components)
       (om/set-state! owner [:current-query] "default")
-      (om/set-state! owner [:open?] false)
+      (om/set-state! owner [:open?] true)
       (om/set-state! owner [:query] (or (:expressions opts) [])))
     om/IDidUpdate
     (did-update [_ _ prev]
-      (let [node        (om/get-node owner)
-            editor-node (.querySelector node ".editor")
+      (let [node                (om/get-node owner)
+            editor-node         (.querySelector node ".editor")
             switched-to-editor? (and (not= :debugger (:tool prev))
                                      (= :debugger (om/get-state owner [:tool])))]
         (when (and switched-to-editor? editor-node)
@@ -191,113 +266,166 @@
           (when (om/get-state owner [:open?])
             (bs-p/panel
              {:header (dom/div "["
-                               (dom/button {:on-click #(om/set-state! owner [:tool] :timeline)} "Timeline")
-                               "] | ["
-                               (dom/button {:on-click #(om/set-state! owner [:tool] :states)} "States")
-                               "] | ["
-                               (dom/button {:on-click #(om/set-state! owner [:tool] :query)} "Expression Watch")
+                               (dom/button {:style    {:cursor "pointer"}
+                                            :on-click #(om/set-state! owner [:tool] :timeline)} "Timeline")
+                               "]  ["
+                               (dom/button {:style    {:cursor "pointer"}
+                                            :on-click #(om/set-state! owner [:tool] :components)} "Components")
+                               "]  ["
+                               (dom/button {:style    {:cursor "pointer"}
+                                            :on-click #(om/set-state! owner [:tool] :states)} "States")
+                               "]  ["
+                               (dom/button {:style    {:cursor "pointer"}
+                                            :on-click #(om/set-state! owner [:tool] :query)} "Expression Watch")
                                "] - Dato Debugger " (dom/small "(" log-count " states)"))}
              (case (om/get-state owner [:tool])
-               :states   (dom/div
-                          (dom/h3 "Click a slot to restore a state")
-                          (dom/ul
-                           (for [slot-idx (range 0 10)]
-                             (let [local-storage-name (str "dato_save_state_" slot-idx)
-                                   existing-db        (js/localStorage.getItem local-storage-name)]
-                               (dom/li {:style    {:cursor "pointer"}
-                                        :on-click #(restore-save-state! owner slot-idx)} (if existing-db
-                                                                                (dom/strong "Slot " slot-idx)
-                                                                                "No state saved"))))))
-               :query    (dom/div
-                          (g/grid
-                           {}
-                           (g/row
-                            {}
-                            (g/col
-                             {:xs 0 :sm 2 :md 2 :lg 2}
+               :states     (dom/div
+                            (dom/h3 "Click a slot to restore a state")
+                            (dom/ul
+                             (for [slot-idx (range 0 10)]
+                               (let [local-storage-name (str "dato_save_state_" slot-idx)
+                                     existing-db        (js/localStorage.getItem local-storage-name)]
+                                 (dom/li {:style    {:cursor "pointer"}
+                                          :on-click #(restore-save-state! owner slot-idx)} (if existing-db
+                                          (dom/strong "Slot " slot-idx)
+                                          "No state saved"))))))
+               :query      (dom/div
+                            (g/grid
+                             {}
                              (g/row
                               {}
                               (g/col
-                               {:xs 12 :sm 12 :md 12 :lg 12}
-                               (dom/input {:placeholder "Search Expressions"})))
-                             (g/row
-                              {}
-                              (g/col
-                               {:xs 12 :sm 12 :md 12 :lg 12}
-                               (dom/ul
-                                (for [[idx query] (map-indexed vector (om/get-state owner [:query]))
-                                      :let [current-query? (= (:title query) (om/get-state owner [:current-query]))
-                                            title (str idx ". " (:title query))]]
-                                  (dom/li {:style    {:cursor "pointer"}
-                                           :on-click #(om/set-state! owner [:current-query] idx)}
-                                          (if current-query?
-                                            (dom/strong title)
-                                            title)))))))
-                            (g/col {:xs 3 :sm 3 :md 3 :lg 3}
-                                   (let [current-query (om/get-state owner [:query (om/get-state owner [:current-query])])]
-                                     (dom/div
-                                      (when (false? (:valid? current-query))
-                                        (dom/pre "Invalid code"))
-                                      (dom/input {:placeholder "Query title"
-                                                  :value "Current Session"})
-                                      (dom/textarea {:placeholder "Expression (cljs code)"
-                                                     :value       (:str current-query)
-                                                     :on-change   (fn [event]
-                                                                    (let [str-value (.. event -target -value)
-                                                                          valid? (try (compile-expr str-value identity)
-                                                                                true
-                                                                                (catch js/Error e
-                                                                                false))]
-                                                                      (om/update-state! owner [:queries (om/get-state owner [:current-query])] (fn [s]
-                                                                                (merge s
-                                                                                {:str    str-value
-                                                                                :valid? valid?})))))
-                                                     :style       {:width  "100%"
-                                                                   :height "100%"}}))))
-                            (g/col {:xs 12 :sm 7 :md 7 :lg 7}
-                                   (when-let [current-query (om/get-state owner [:query (om/get-state owner [:current-query])])]
-                                     (dom/pre
-                                      (binding [*print-length* 10]
-                                        (let [query-results ((:fn current-query) db)]
-                                          (with-out-str (pp/pprint query-results))))))))))
-               :editor   (dom/div
-                          "Code editor"
-                          (dom/link {:rel      "stylesheet"
-                                     :property "stylesheet"
-                                     :href     "/css/vendor/codemirror/codemirror.css"})
-                          (dom/div {:className "editor"}))
-               :timeline (dom/div
-                          (dom/h3 (pr-str (get-in log [selected-state-idx :tx/intent])))
-                          (dom/div
-                           (dom/input {:type      "range"
-                                       :min       0
-                                       :max       (max 0 (dec (count (:log data))))
-                                       :value     (om/get-state owner [:states :selected])
-                                       :on-change #(let [idx (reader/read-string (.. % -target -value))]
-                                                     (om/set-state! owner [:states :selected] idx)
-                                                     (set-app-state! idx))})
-                           (dom/button {:on-click #(play-all-states!)
-                                        :disabled (not (pos? log-count))} "> Play All")
-                           (dom/div {:style {:float "right"
-                                             :width "50%"}}
-                                    (dom/pre (pr-str (get-in selected-state [:tx :tx-data]))))
-                           (dom/ul
-                            {:className "event-history"}
-                            (let [int (->> (:log data)
-                                           (map-indexed vector)
-                                           (reduce (fn [run [idx next]]
-                                                     (let [cnt        (count run)
-                                                           last-event (:tx/intent (nth run (dec cnt)))
-                                                           selected?  (= idx selected-state-idx)]
-                                                       (if (= last-event (:tx/intent next))
-                                                         (-> run
-                                                             (update-in [(dec cnt) :count] inc)
-                                                             (update-in [(dec cnt) :selected?] #(or selected? %)))
-                                                         (conj run (-> next
-                                                                       (assoc :count 1)
-                                                                       (assoc :selected? selected?)))))) [{}]))]
-                              (for [tx int]
-                                (dom/li (if (:selected? tx)
-                                          (dom/strong (pr-str (:tx/intent tx)))
-                                          (pr-str (:tx/intent tx)))
-                                        (when (pos? (dec (:count tx))) (str " x " (:count tx))))))))))))))))))
+                               {:xs 0 :sm 2 :md 2 :lg 2}
+                               (g/row
+                                {}
+                                (g/col
+                                 {:xs 12 :sm 12 :md 12 :lg 12}
+                                 (dom/input {:placeholder "Search Expressions"})))
+                               (g/row
+                                {}
+                                (g/col
+                                 {:xs 12 :sm 12 :md 12 :lg 12}
+                                 (dom/ul
+                                  (for [[idx query] (map-indexed vector (om/get-state owner [:query]))
+                                        :let [current-query? (= (:title query) (om/get-state owner [:current-query]))
+                                              title (str idx ". " (:title query))]]
+                                    (dom/li {:style    {:cursor "pointer"}
+                                             :on-click #(om/set-state! owner [:current-query] idx)}
+                                            (if current-query?
+                                              (dom/strong title)
+                                              title)))))))
+                              (g/col {:xs 3 :sm 3 :md 3 :lg 3}
+                                     (let [current-query (om/get-state owner [:query (om/get-state owner [:current-query])])]
+                                       (dom/div
+                                        (when (false? (:valid? current-query))
+                                          (dom/pre "Invalid code"))
+                                        (dom/input {:placeholder "Query title"
+                                                    :value "Current Session"})
+                                        (dom/textarea {:placeholder "Expression (cljs code)"
+                                                       :value       (:str current-query)
+                                                       :on-change   (fn [event]
+                                                                      (let [str-value (.. event -target -value)
+                                                                            valid? (try (compile-expr str-value identity)
+                                                                                true
+                                                                                (catch js/Error e
+                                                                                false))]
+                                                                        (om/update-state! owner [:queries (om/get-state owner [:current-query])] (fn [s]
+                                                                                (merge s
+                                                                                {:str    str-value
+                                                                                :valid? valid?})))))
+                                                       :style       {:width  "100%"
+                                                                     :height "100%"}}))))
+                              (g/col {:xs 12 :sm 7 :md 7 :lg 7}
+                                     (when-let [current-query (om/get-state owner [:query (om/get-state owner [:current-query])])]
+                                       (dom/pre
+                                        (binding [*print-length* 10]
+                                          (let [query-results ((:fn current-query) db)]
+                                            (with-out-str (pp/pprint query-results))))))))))
+               :editor     (dom/div
+                            "Code editor"
+                            (dom/link {:rel      "stylesheet"
+                                       :property "stylesheet"
+                                       :href     "/css/vendor/codemirror/codemirror.css"})
+                            (dom/div {:className "editor"}))
+               :components (dom/div
+                            "Component States"
+                            (dom/link {:rel      "stylesheet"
+                                       :property "stylesheet"
+                                       :href     "/css/vendor/codemirror/codemirror.css"})
+                            (dom/div {:className "state"}
+                                     (let [components        (state-watcher-coms @state-watchers)
+                                           inspected-com-key (om/get-state owner [:inspected-com-key])]
+                                       (dom/div
+                                        (dom/input {:on-change   #(om/set-state! owner [:com-name-filter] (.. % -target -value))
+                                                    :value        (om/get-state owner [:com-name-filter])
+                                                    :placeholder "Component Display Name"})
+                                        (dom/div
+                                         {:style {:float "right"
+                                                  :width "50%"}}
+                                         (if inspected-com-key
+                                           (dom/h4 (com-name @state-watchers inspected-com-key) "(" inspected-com-key ")")
+                                           (dom/h4 "No component"))
+                                         (when-let [inspected-com-key (om/get-state owner [:inspected-com-key])]
+                                           (let [com-states  (com-state @state-watchers inspected-com-key)
+                                                 dato-state* (:dato com-states)
+                                                 dato-state  (when dato-state*
+                                                               (dsu/touch+ dato-state*))
+                                                 om-state    (:om com-states)]
+                                             (dom/div
+                                              "Dato/Recorded"
+                                              (dom/pre (with-out-str (pp/pprint dato-state)))
+                                              "Om/Transient"
+                                              (dom/pre (with-out-str (pp/pprint (->
+                                                                                om-state
+                                                                                (dissoc :dato.lib.db/listener-key)
+                                                                                (dissoc :dato.lib.db/listener-keys)))))))))
+                                        (dom/ul
+                                         (for [com-key components
+                                               :let [com-name (com-name @state-watchers com-key)]
+                                               :when (and com-name
+                                                          (let [filter (om/get-state owner [:com-name-filter])]
+                                                            (if (string/blank? filter)
+                                                              true
+                                                              (.match (string/lower-case com-name) filter))))]
+                                           (let [com-owner  (com-owner @state-watchers com-key)
+                                                 owner-node (when com-owner (om/get-node com-owner))]
+                                             (dom/li {:style    {:cursor "pointer"}
+                                                      ;; Someday we'll figure this out...
+                                                      :on-mouse-enter #(when owner-node (highlight-node! owner-node))
+                                                      :on-mouse-leave #(when owner-node (unhighlight-node! owner-node))
+                                                      :on-click #(om/set-state! owner [:inspected-com-key] com-key)} com-name "(" com-key ")"))))))))
+               :timeline   (dom/div
+                            (dom/h3 (pr-str (get-in log [selected-state-idx :tx/intent])))
+                            (dom/div
+                             (dom/input {:type      "range"
+                                         :min       0
+                                         :max       (max 0 (dec (count (:log data))))
+                                         :value     (om/get-state owner [:states :selected])
+                                         :on-change #(let [idx (reader/read-string (.. % -target -value))]
+                                                       (om/set-state! owner [:states :selected] idx)
+                                                       (set-app-state! idx))})
+                             (dom/button {:on-click #(play-all-states!)
+                                          :disabled (not (pos? log-count))} "> Play All")
+                             (dom/div {:style {:float "right"
+                                               :width "50%"}}
+                                      (dom/pre (pr-str (get-in selected-state [:tx :tx-data]))))
+                             (dom/ul
+                              {:className "event-history"}
+                              (let [int (->> (:log data)
+                                             (map-indexed vector)
+                                             (reduce (fn [run [idx next]]
+                                                       (let [cnt        (count run)
+                                                             last-event (:tx/intent (nth run (dec cnt)))
+                                                             selected?  (= idx selected-state-idx)]
+                                                         (if (= last-event (:tx/intent next))
+                                                           (-> run
+                                                               (update-in [(dec cnt) :count] inc)
+                                                               (update-in [(dec cnt) :selected?] #(or selected? %)))
+                                                           (conj run (-> next
+                                                                         (assoc :count 1)
+                                                                         (assoc :selected? selected?)))))) [{}]))]
+                                (for [tx int]
+                                  (dom/li (if (:selected? tx)
+                                            (dom/strong (pr-str (:tx/intent tx)))
+                                            (pr-str (:tx/intent tx)))
+                                          (when (pos? (dec (:count tx))) (str " x " (:count tx))))))))))))))))))


Don't read the db from localStorage on every render in the state debugger

--- src/cljs/dato/debug/components/core.cljs
+++ src/cljs/dato/debug/components/core.cljs
@@ -199,14 +199,15 @@
                                "] - Dato Debugger " (dom/small "(" log-count " states)"))}
              (case (om/get-state owner [:tool])
                :states   (dom/div
-                          (dom/h3 "Click a title to restore a state")
+                          (dom/h3 "Click a slot to restore a state")
                           (dom/ul
                            (for [slot-idx (range 0 10)]
                              (let [local-storage-name (str "dato_save_state_" slot-idx)
-                                   existing-db        (when-let [db-str (js/localStorage.getItem local-storage-name)]
-                                                        (reader/read-string db-str))]
+                                   existing-db        (js/localStorage.getItem local-storage-name)]
                                (dom/li {:style    {:cursor "pointer"}
-                                        :on-click #(restore-save-state! owner slot-idx)} (:title existing-db "No state saved"))))))
+                                        :on-click #(restore-save-state! owner slot-idx)} (if existing-db
+                                                                                (dom/strong "Slot " slot-idx)
+                                                                                "No state saved"))))))
                :query    (dom/div
                           (g/grid
                            {}


small fix

small fix

--- src/cljs/salava/social/ui/dashboard.cljs
+++ src/cljs/salava/social/ui/dashboard.cljs
@@ -295,7 +295,7 @@
        [:div.profile-block.row_1;.block-content
         [:div.heading_1
          [:i.fa.fa-user.icon]
-         [:a {:href (path-for "/user/profile" (get-in user [:user :id]))}[:span.title
+         [:a {:href (str (path-for "/user/profile/" ) (get-in user [:user :id]))}[:span.title
           (t :user/Profile)]]]
         [:div.content
          (when-not (not-activated?) [:a.btn.button {:href (path-for "/user/edit/profile")} (t :page/Edit)])


XML encode # character in SVGs

XML encode # character in SVGs

Fixes #130.

See also https://stackoverflow.com/a/38459219.

--- src/day8/re_frame/trace/utils/macros.clj
+++ src/day8/re_frame/trace/utils/macros.clj
@@ -1,10 +1,18 @@
 (ns day8.re-frame.trace.utils.macros
-  (:require [clojure.java.io :as io]))
+  (:require [clojure.java.io :as io]
+            [clojure.string :as str]))

 (defmacro slurp-macro
-  "Reads a file as a string. Slurp is wrapped in a macro so it can interact with local files before clojurescript compilation."
+  "Reads a file as a string. Slurp is wrapped in a macro so it can interact with local files before clojurescript compilation.
+  #'s are replaced with %23 for URL encoding."
+  ;; For reasons unknown (to me), browsers don't like URL encoding the entire string.
+  ;; I suspect XML encoding the attributes is the correct way to do this, but
+  ;; #'s are the problem here, so we so we do surgery on the one problematic symbol.
   [path]
-  (slurp (io/resource path)))
+  (str/replace
+    (slurp (io/resource path))
+    "#"
+    "%23"))

 (defmacro with-cljs-devtools-prefs [prefs & body]
   `(let [previous-config# (devtools.prefs/get-prefs)


another literal -> term

another literal -> term

--- src/gamma/compiler/insert_variables.cljs
+++ src/gamma/compiler/insert_variables.cljs
@@ -8,7 +8,7 @@
   (let [id (gen-term-id)]
     (-> db
         (assoc-in-location (:parent location) id)
-        (assoc-elements [{:id    id :head :literal
+        (assoc-elements [{:id    id :head :literal :tag :term
                           :type  (:type (get-element db location))
                           :value {:tag  :variable :id (:id (:id location))
                                   :type (:type (get-element db location))}}]))))


Fix scrambled brackets and parens for v1

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -53,8 +53,8 @@
         (html
           [:div.head-user
            [:div.breadcrumbs
-            (when (and (not (feature/enabled? :ui-v2) (seq crumbs-data)))
-              [:a {:title "home", :href "/"} :i.fa.fa-home " "])
+            (when (and (not (feature/enabled? :ui-v2)) (seq crumbs-data))
+              [:a {:title "home", :href "/"} [:i.fa.fa-home] " "])
             (crumbs/crumbs crumbs-data)]
            (when (show-follow-project-button? app)
              (forms/managed-button