Fix pitch-shift arg name from window-cize to window-size. Also format ugen metadata.

--- src/overtone/sc/machinery/ugen/metadata/misc.clj
+++ src/overtone/sc/machinery/ugen/metadata/misc.clj
@@ -5,26 +5,70 @@
      [
       {:name "PitchShift",
        :args [{:name "in", :doc "The input signal."}
-              {:name "window-cize", :default 0.2, :doc "The size of the grain window in seconds. This value cannot be modulated."}
-              {:name "pitch-ratio", :default 1.0, :doc "The ratio of the pitch shift. Must be from 0.0 to 4.0"}
-              {:name "pitch-dispersion", :default 0.0, :doc "The maximum random deviation of the pitch from the pitchRatio."}
-              {:name "time-dispersion", :default 0.0, :doc "A random offset of from zero to timeDispersion seconds is added to the delay
-of each grain. Use of some dispersion can alleviate a hard comb filter effect due to uniform grain placement. It can also be an effect in itself. timeDispersion can be no larger than windowSize."}],
+              {:name "window-size",
+               :default 0.2,
+               :doc "The size of the grain window in seconds. This value
+                     cannot be modulated." }
+
+              {:name "pitch-ratio",
+               :default 1.0,
+               :doc "The ratio of the pitch shift. Must be from 0.0 to
+                     4.0"}
+
+              {:name "pitch-dispersion",
+               :default
+               0.0,
+               :doc "The maximum random deviation of the pitch from the
+                     pitchRatio." }
+
+              {:name "time-dispersion",
+               :default 0.0,
+               :doc "A random offset of from zero to timeDispersion
+                     seconds is added to the delay of each grain. Use of
+                     some dispersion can alleviate a hard comb filter
+                     effect due to uniform grain placement. It can also
+                     be an effect in itself. timeDispersion can be no
+                     larger than windowSize." }],
        :rates #{:ar}
        :check [(same-rate-as-first-input)
                (nth-input-stream? 0)]
-       :doc "A time domain granular pitch shifter. Grains have a triangular amplitude envelope and an overlap of 4:1."}
+       :doc "A time domain granular pitch shifter. Grains have a
+             triangular amplitude envelope and an overlap of 4:1." }

       {:name "Pluck",
-       :args [{:name "in", :default 0.0, :doc "An excitation signal."}
-              {:name "trig", :default 1.0, :doc "Upon a negative to positive transition, the excitation signal will be fed into the delay line."}
-              {:name "maxdelaytime", :default 0.2, :doc "The max delay time in seconds (initializes the internal delay buffer)."}
-              {:name "delaytime", :default 0.2, :doc "Delay time in seconds."}
-              {:name "decaytime", :default 1.0, :doc "Time for the echoes to decay by 60 decibels. Negative times emphasize odd partials."}
-              {:name "coef", :default 0.5, :doc "The coef of the internal OnePole filter. Values should be between -1 and +1 (larger values will be unstable... so be careful!)."}],
-       :rates #{:ar}
-       :check (nth-input-stream? 0)
-       :doc "Implements the Karplus-Strong style of synthesis, where a delay line (normally starting with noise) is filtered and fed back on itself so that over time it becomes periodic."}
+       :args [{:name "in",
+               :default 0.0,
+               :doc "An excitation signal."}
+
+              {:name "trig",
+               :default 1.0,
+               :doc "Upon a negative to positive transition, the
+                     excitation signal will be fed into the delay line." }
+
+              {:name "maxdelaytime",
+               :default 0.2,
+               :doc "The max delay time in seconds (initializes the
+                     internal delay buffer)." }
+
+              {:name "delaytime",
+               :default 0.2,
+               :doc "Delay time in seconds."}
+
+              {:name "decaytime",
+               :default 1.0,
+               :doc "Time for the echoes to decay by 60
+                     decibels. Negative times emphasize odd partials."}
+
+              {:name "coef",
+               :default 0.5,
+               :doc "The coef of the internal OnePole filter. Values
+                     should be between -1 and +1 (larger values will be
+                     unstable... so be careful!)." }],
+       :rates #{:ar}
+       :check (nth-input-stream? 0)
+       :doc "Implements the Karplus-Strong style of synthesis, where a
+             delay line (normally starting with noise) is filtered and
+             fed back on itself so that over time it becomes periodic."}

       ;; TODO write some functions implementing these classand buffer  methods
       ;; Partitioned Convolution, from PartConv.sc
@@ -56,12 +100,31 @@
       ;; }

       {:name "PartConv",
-       :args [{:name "in", :doc "Processing target."}
-              {:name "fftsize", :doc "Spectral convolution partition size (twice partition size). You must ensure that the blocksize divides the partition size and there are at least two blocks per partition (to allow for amortisation)"}
-              {:name "irbufnum", :doc "Prepared buffer of spectra for each partition of the inpulse response"}],
-       :rates #{:ar}
-       :check (nth-input-stream? 0)
-       :doc "Partitioned convolution. Various additional buffers must be supplied. Mono impulse response only! If inputting multiple channels, you'll need independent PartConvs, one for each channel. But the charm is: impulse response can be as large as you like (CPU load increases with IR size. Various tradeoffs based on fftsize choice, due to rarer but larger FFTs. This plug-in uses amortisation to spread processing and avoid spikes). Normalisation factors difficult to anticipate; convolution piles up multiple copies of the input on top of itself, so can easily overload. "}
+       :args [{:name "in",
+               :doc "Processing target."}
+
+              {:name "fftsize",
+               :doc "Spectral convolution partition size (twice
+                     partition size). You must ensure that the blocksize
+                     divides the partition size and there are at least
+                     two blocks per partition (to allow for
+                     amortisation)"}
+
+              {:name "irbufnum",
+               :doc "Prepared buffer of spectra for each partition of
+                     the inpulse response"}],
+       :rates #{:ar}
+       :check (nth-input-stream? 0)
+       :doc "Partitioned convolution. Various additional buffers must be
+             supplied. Mono impulse response only! If inputting multiple
+             channels, you'll need independent PartConvs, one for each
+             channel. But the charm is: impulse response can be as large
+             as you like (CPU load increases with IR size. Various
+             tradeoffs based on fftsize choice, due to rarer but larger
+             FFTs. This plug-in uses amortisation to spread processing
+             and avoid spikes). Normalisation factors difficult to
+             anticipate; convolution piles up multiple copies of the
+             input on top of itself, so can easily overload."}

       {:name "Hilbert",
        :args [{:name "in"}],
@@ -70,124 +133,452 @@
        :num-outs 2}

       {:name "FreqShift",
-       :args [{:name "in", :doc "The signal to process"}
-              {:name "freq", :default 0.0, :doc "Amount of shift in cycles per second"}
-              {:name "phase", :default 0.0, :doc "Phase of the frequency shift (0 - 2pi)"}],
+       :args [{:name "in",
+               :doc "The signal to process"}
+
+              {:name "freq",
+               :default 0.0,
+               :doc "Amount of shift in cycles per second"}
+
+              {:name "phase",
+               :default 0.0,
+               :doc "Phase of the frequency shift (0 - 2pi)"}],
+
        :rates #{:ar},
        :check (nth-input-stream? 0)
-       :doc "FreqShift implements single sideband amplitude modulation, also known as frequency shifting, but not to be confused with pitch shifting.  Frequency shifting moves all the components of a signal by a fixed amount but does not preserve the original harmonic relationships."}
+       :doc "FreqShift implements single sideband amplitude modulation,
+             also known as frequency shifting, but not to be confused
+             with pitch shifting.  Frequency shifting moves all the
+             components of a signal by a fixed amount but does not
+             preserve the original harmonic relationships."}

       {:name "GVerb",
-       :args [{:name "in", :doc "mono input"}
-              {:name "roomsize", :default 10.0, :doc "in squared meters."}
-              {:name "revtime", :default 3.0, :doc "in seconds"}
-              {:name "damping", :default 0.5, :doc "0 to 1, high frequency rolloff, 0 damps the reverb signal completely, 1 not at all"}
-              {:name "inputbw", :default 0.5, :doc "0 to 1, same as damping control, but on the input signal"}
-              {:name "spread", :default 15.0, :doc "a control on the stereo spread and diffusion of the reverb signal"}
-              {:name "drylevel", :default 1.0, :doc "amount of dry signal"}
-              {:name "earlyreflevel", :default 0.7, :doc "amount of early reflection level"}
-              {:name "taillevel", :default 0.5, :doc "amount of tail level"}
-              {:name "maxroomsize", :default 300.0, :doc "to set the size of the delay lines."}],
+       :args [{:name "in",
+               :doc "mono input"}
+
+              {:name "roomsize",
+               :default 10.0,
+               :doc "in squared meters."}
+
+              {:name "revtime",
+               :default 3.0,
+               :doc "in seconds"}
+
+              {:name "damping",
+               :default 0.5,
+               :doc "0 to 1, high frequency rolloff, 0 damps the reverb
+                     signal completely, 1 not at all"}
+
+              {:name "inputbw",
+               :default 0.5,
+               :doc "0 to 1, same as damping control, but on the input
+                     signal"}
+
+              {:name "spread",
+               :default 15.0,
+               :doc "a control on the stereo spread and diffusion of the
+                     reverb signal"}
+
+              {:name "drylevel",
+               :default 1.0,
+               :doc "amount of dry signal"}
+
+              {:name "earlyreflevel",
+               :default 0.7,
+               :doc "amount of early reflection level"}
+
+              {:name "taillevel",
+               :default 0.5
+               :doc "amount of tail level"}
+
+              {:name "maxroomsize", :
+               default 300.0,
+               :doc "to set the size of the delay lines." }],
+
        :rates #{:ar},
        :num-outs 2,
        :check (nth-input-stream? 0)
-       :doc "A two-channel reverb UGen, based on the \"GVerb\" LADSPA effect by Juhana Sadeharju (kouhia at nic.funet.fi).
-
-WARNING - in the current version of the server, there are severe noise issues when you attempt to modify the roomsize or set it to a value greater than 40."}
+       :doc "A two-channel reverb UGen, based on the \"GVerb\" LADSPA
+             effect by Juhana Sadeharju (kouhia at nic.funet.fi).
+
+             WARNING - in the current version of the server, there are
+             severe noise issues when you attempt to modify the roomsize
+             or set it to a value greater than 40." }

       {:name "FreeVerb",
-       :args [{:name "in", :doc "The input signal"}
-              {:name "mix", :default 0.33, :doc "Dry/wet balance. range 0..1"}
-              {:name "room", :default 0.5, :doc "Room size. rage 0..1"}
-              {:name "damp", :default 0.5, :doc "Reverb HF damp. range 0..1"}],
-       :rates #{:ar}
-       :check (nth-input-stream? 0)
-       :doc "A reverb coded from experiments with faust. Valid parameter range from 0 to 1. Values outside this range are clipped by the UGen."}
+       :args [{:name "in",
+               :doc "The input signal"}
+
+              {:name "mix",
+               :default 0.33,
+               :doc "Dry/wet balance. range 0..1"}
+
+              {:name "room",
+               :default 0.5,
+               :doc "Room size. rage 0..1"}
+
+              {:name "damp",
+               :default 0.5,
+               :doc "Reverb HF damp. range 0..1"}],
+
+       :rates #{:ar}
+       :check (nth-input-stream? 0)
+       :doc "A reverb coded from experiments with faust. Valid parameter
+             range from 0 to 1. Values outside this range are clipped by the UGen."}

       {:name "FreeVerb2",
-       :args [{:name "in", :doc "Input signal channel 1"}
-              {:name "in2", :doc "Input signal channel 2"}
-              {:name "mix", :default 0.33, :doc "Dry/wet balance. range 0..1"}
-              {:name "room", :default 0.5, :doc "Room size. rage 0..1"}
-              {:name "damp", :default 0.5, :doc "Reverb HF damp. range 0..1"}],
+       :args [{:name "in",
+               :doc "Input signal channel 1"}
+
+              {:name "in2",
+               :doc "Input signal channel 2"}
+
+              {:name "mix",
+               :default 0.33,
+               :doc "Dry/wet balance. range 0..1"}
+
+              {:name "room",
+               :default 0.5,
+               :doc "Room size. rage 0..1"}
+
+              {:name "damp",
+               :default 0.5,
+               :doc "Reverb HF damp. range 0..1"}],
+
        :rates #{:ar},
        :num-outs 2,
        :check [(nth-input-stream? 0)
                (nth-input-stream? 1)]
-       :doc "A two-channel reverb coded from experiments with faust. Valid parameter range from 0 to 1. Values outside this range are clipped by the UGen."}
+       :doc "A two-channel reverb coded from experiments with
+             faust. Valid parameter range from 0 to 1. Values outside
+             this range are clipped by the UGen." }

       {:name "MoogFF",
-       :args [{:name "in", :default 0.0 :doc "The input signal"}
-              {:name "freq", :default 100.0, :doc "The cutoff frequency"}
-              {:name "gain", :default 2.0, :doc "The filter resonance gain, between zero and 4"}
-              {:name "reset", :default 0.0, :doc "When greater than zero, this will reset the state of the digital filters at the beginning of a computational block."}]
+       :args [{:name "in",
+               :default 0.0
+               :doc "The input signal"}
+
+              {:name "freq",
+               :default 100.0,
+               :doc "The cutoff frequency"}
+
+              {:name "gain",
+               :default 2.0,
+               :doc "The filter resonance gain, between zero and 4"}
+
+              {:name "reset",
+               :default 0.0,
+               :doc "When greater than zero, this will reset the state
+                     of the digital filters at the beginning of a
+                     computational block."}]
+
        :rates #{:ar :kr}
        :check (nth-input-stream? 0)
        :doc "A digital implementation of the Moog VCF (filter)."}

       {:name "Spring",
-       :args [{:name "in", :default 0.0, :doc "Modulated input force"}
-              {:name "spring", :default 0.0, :doc "Spring constant (incl. mass)"}
-              {:name "damp", :default 0.0, :doc "Damping"}]
+       :args [{:name "in",
+               :default 0.0,
+               :doc "Modulated input force"}
+
+              {:name "spring",
+               :default 0.0,
+               :doc "Spring constant (incl. mass)"}
+
+              {:name "damp",
+               :default 0.0,
+               :doc "Damping"}]
+
        :rates #{:ar}
        :doc "Physical model of resonating spring"}

+
       {:name "Ball",
-       :args [{:name "in", :default 0.0, :doc "modulated surface level"}
-              {:name "g", :default 1.0, :doc "gravity"}
-              {:name "damp", :default 0.0, :doc "damping on impact"}
-              {:name "friction", :default 0.01, :doc "proximity from which on attraction to surface starts"}]
-       :rates #{:ar}
-       :doc "models the path of a bouncing object that is reflected by a vibrating surface"}
+       :args [{:name "in",
+               :default 0.0,
+               :doc "modulated surface level"}
+
+              {:name "g",
+               :default 1.0,
+               :doc "gravity"}
+
+              {:name "damp",
+               :default 0.0,
+               :doc "damping on impact"}
+
+              {:name "friction",
+               :default 0.01,
+               :doc "proximity from which on attraction to surface starts"}]
+
+       :rates #{:ar}
+       :doc "models the path of a bouncing object that is reflected by a
+             vibrating surface"}

       {:name "TBall",
-       :args [{:name "in", :default 0.0, :doc "modulated surface level"}
-              {:name "g", :default 10.0, :doc "gravity"}
-              {:name "damp", :default 0.0, :doc "damping on impact"}
-              {:name "friction", :default 0.01, :doc "proximity from which on attraction to surface starts"}]
-       :rates #{:ar}
-       :doc "models the impacts of a bouncing object that is reflected by a vibrating surface"}
+       :args [{:name "in",
+               :default 0.0,
+               :doc "modulated surface level"}
+
+              {:name "g",
+               :default 10.0,
+               :doc "gravity"}
+
+              {:name "damp",
+               :default 0.0,
+               :doc "damping on impact"}
+
+              {:name "friction",
+               :default 0.01,
+               :doc "proximity from which on attraction to surface
+                    starts"}]
+
+       :rates #{:ar}
+       :doc "models the impacts of a bouncing object that is reflected
+            by a vibrating surface"}
+

       {:name "Gendy1",
-       :args [{:name "ampdist", :default 1.0, :doc "Choice of probability distribution for the next perturbation of the amplitude of a control point. The distributions are (adapted from the GENDYN program in Formalized Music): 0- LINEAR,1- CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5- EXPON, 6- SINUS, Where the sinus (Xenakis' name) is in this implementation taken as sampling from a third party oscillator. See example below."}
-              {:name "durdist", :default 1.0, :doc "Choice of distribution for the perturbation of the current inter control point duration."}
-              {:name "adparam", :default 1.0, :doc "A parameter for the shape of the amplitude probability distribution, requires values in the range 0.0001 to 1 (there are safety checks in the code so don't worry too much if you want to modulate!)
+       :args [{:name "ampdist",
+               :default 1.0,
+               :doc "Choice of probability distribution for the next
+                     perturbation of the amplitude of a control
+                     point. The distributions are (adapted from the
+                     GENDYN program in Formalized Music): 0- LINEAR,1-
+                     CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5-
+                     EXPON, 6- SINUS, Where the sinus (Xenakis' name) is
+                     in this implementation taken as sampling from a
+                     third party oscillator. See example below." }
+
+              {:name "durdist",
+               :default 1.0,
+               :doc "Choice of distribution for the perturbation of the
+                     current inter control point duration." }
+
+              {:name "adparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the amplitude
+                     probability distribution, requires values in the
+                     range 0.0001 to 1 (there are safety checks in the
+                     code so don't worry too much if you want to
+                     modulate!)
 "}
-              {:name "ddparam", :default 1.0, :doc "A parameter for the shape of the duration probability distribution, requires values in the range 0.0001 to 1"}
-              {:name "minfreq", :default 440.0, :doc "Minimum allowed frequency of oscillation for the Gendy1 oscillator, so gives the largest period the duration is allowed to take on."}
-              {:name "maxfreq", :default 660.0, :doc "Maximum allowed frequency of oscillation for the Gendy1 oscillator, so gives the smallest period the duration is allowed to take on. "}
-              {:name "ampscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for amplitude. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of amplitude."}
-              {:name "durscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for duration. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of duration."}
-              {:name "init-cps", :default 12, :doc "Initialise the number of control points in the memory. Xenakis specifies 12. There would be this number of control points per cycle of the oscillator, though the oscillator's period will constantly change due to the duration distribution."}
-              {:name "knum" :default 12, :doc "Current number of utilised control points, allows modulation."}]
+              {:name "ddparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the duration
+                     probability distribution, requires values in the
+                     range 0.0001 to 1"}
+
+              {:name "minfreq",
+               :default 440.0,
+               :doc "Minimum allowed frequency of oscillation for the
+                     Gendy1 oscillator, so gives the largest period the
+                     duration is allowed to take on." }
+
+              {:name "maxfreq",
+               :default 660.0,
+               :doc "Maximum allowed frequency of oscillation for the
+                     Gendy1 oscillator, so gives the smallest period the
+                     duration is allowed to take on. "}
+
+              {:name "ampscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for amplitude. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of amplitude." }
+
+              {:name "durscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for duration. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of duration." }
+
+              {:name "init-cps",
+               :default 12,
+               :doc "Initialise the number of control points in the
+                     memory. Xenakis specifies 12. There would be this
+                     number of control points per cycle of the
+                     oscillator, though the oscillator's period will
+                     constantly change due to the duration
+                     distribution." }
+
+              {:name "knum"
+               :default 12,
+               :doc "Current number of utilised control points, allows
+                     modulation." }]
+
        :rates #{:ar :kr}
-       :doc "An implementation of the dynamic stochastic synthesis generator conceived by Iannis Xenakis and described in Formalized Music (1992, Stuyvesant, NY: Pendragon Press) chapter 9 (pp 246-254) and chapters 13 and 14 (pp 289-322). The BASIC program in the book was written by Marie-Helene Serra so I think it helpful to credit her too. The program code has been adapted to avoid infinities in the probability distribution functions. The distributions are hard-coded in C but there is an option to have new amplitude or time breakpoints sampled from a continuous controller input."}
+       :doc "An implementation of the dynamic stochastic synthesis
+             generator conceived by Iannis Xenakis and described in
+             Formalized Music (1992, Stuyvesant, NY: Pendragon Press)
+             chapter 9 (pp 246-254) and chapters 13 and 14 (pp
+             289-322). The BASIC program in the book was written by
+             Marie-Helene Serra so I think it helpful to credit her
+             too. The program code has been adapted to avoid infinities
+             in the probability distribution functions. The
+             distributions are hard-coded in C but there is an option to
+             have new amplitude or time breakpoints sampled from a
+             continuous controller input." }

       {:name "Gendy2",
-       :args [{:name "ampdist", :default 1.0, :doc "Choice of probability distribution for the next perturbation of the amplitude of a control point. The distributions are (adapted from the GENDYN program in Formalized Music): 0- LINEAR, 1- CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5- EXPON, 6- SINUS, Where the sinus (Xenakis' name) is in this implementation taken as sampling from a third party oscillator. "}
-              {:name "durdist", :default 1.0, :doc "Choice of distribution for the perturbation of the current inter control point duration. "}
-              {:name "adparam", :default 1.0, :doc "A parameter for the shape of the amplitude probability distribution, requires values in the range 0.0001 to 1 (there are safety checks in the code so don't worry too much if you want to modulate!)"}
-              {:name "ddparam", :default 1.0, :doc "A parameter for the shape of the duration probability distribution, requires values in the range 0.0001 to 1"}
-              {:name "minfreq", :default 440.0, :doc "Minimum allowed frequency of oscillation for the Gendy1 oscillator, so gives the largest period the duration is allowed to take on."}
-              {:name "maxfreq", :default 660.0, :doc "Maximum allowed frequency of oscillation for the Gendy1 oscillator, so gives the smallest period the duration is allowed to take on."}
-              {:name "ampscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for amplitude. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of amplitude."}
-              {:name "durscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for duration. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of duration."}
-              {:name "init-cps", :default 12, :doc "Initialise the number of control points in the memory. Xenakis specifies 12. There would be this number of control points per cycle of the oscillator, though the oscillator's period will constantly change due to the duration distribution."}
-              {:name "knum" :default 12, :doc "Current number of utilised control points, allows modulation. "}
-              {:name "a", :default 1.17, :doc "parameter for Lehmer random number generator perturbed by Xenakis as in ((old*a)+c)%1.0"}
-              {:name "c", :default 0.31, :doc "parameter for Lehmer random number generator perturbed by Xenakis"}]
+       :args [{:name "ampdist",
+               :default 1.0,
+               :doc "Choice of probability distribution for the next
+                     perturbation of the amplitude of a control
+                     point. The distributions are (adapted from the
+                     GENDYN program in Formalized Music): 0- LINEAR, 1-
+                     CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5-
+                     EXPON, 6- SINUS, Where the sinus (Xenakis' name) is
+                     in this implementation taken as sampling from a
+                     third party oscillator. "}
+
+              {:name "durdist",
+               :default 1.0,
+               :doc "Choice of distribution for the perturbation of the
+                     current inter control point duration. "}
+
+              {:name "adparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the amplitude
+                     probability distribution, requires values in the
+                     range 0.0001 to 1 (there are safety checks in the
+                     code so don't worry too much if you want to
+                     modulate!)" }
+
+              {:name "ddparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the duration
+                     probability distribution, requires values in the
+                     range 0.0001 to 1"}
+
+              {:name "minfreq",
+               :default 440.0,
+               :doc "Minimum allowed frequency of oscillation for the
+                     Gendy1 oscillator, so gives the largest period the
+                     duration is allowed to take on." }
+
+              {:name "maxfreq",
+               :default 660.0,
+               :doc "Maximum allowed frequency of oscillation for the
+                     Gendy1 oscillator, so gives the smallest period the
+                     duration is allowed to take on." }
+
+              {:name "ampscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for amplitude. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of amplitude." }
+
+              {:name "durscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for duration. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of duration." }
+
+              {:name "init-cps",
+               :default 12,
+               :doc "Initialise the number of control points in the
+                     memory. Xenakis specifies 12. There would be this
+                     number of control points per cycle of the
+                     oscillator, though the oscillator's period will
+                     constantly change due to the duration
+                     distribution." }
+
+              {:name "knum"
+               :default 12,
+               :doc "Current number of utilised control points, allows
+                     modulation. "}
+
+              {:name "a",
+               :default 1.17,
+               :doc "parameter for Lehmer random number generator
+                     perturbed by Xenakis as in ((old*a)+c)%1.0"}
+
+              {:name "c",
+               :default 0.31,
+               :doc "parameter for Lehmer random number generator
+                     perturbed by Xenakis"}]
+
        :rates #{:ar :kr}
-       :doc "See gendy1 help file for background. This variant of GENDYN is closer to that presented in Hoffmann, Peter. (2000) The New GENDYN Program. Computer Music Journal 24:2, pp 31-38. "}
+       :doc "See gendy1 help file for background. This variant of GENDYN
+             is closer to that presented in Hoffmann, Peter. (2000) The
+             New GENDYN Program. Computer Music Journal 24:2, pp
+             31-38. "}
+

       {:name "Gendy3",
-       :args [{:name "ampdist", :default 1.0, :doc "Choice of probability distribution for the next perturbation of the amplitude of a control point. The distributions are (adapted from the GENDYN program in Formalized Music): 0- LINEAR,1- CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5- EXPON, 6- SINUS, Where the sinus (Xenakis' name) is in this implementation taken as sampling from a third party oscillator."}
-              {:name "durdist", :default 1.0, :doc "Choice of distribution for the perturbation of the current inter control point duration."}
-              {:name "adparam", :default 1.0, :doc "A parameter for the shape of the amplitude probability distribution, requires values in the range 0.0001 to 1 (there are safety checks in the code so don't worry too much if you want to modulate!)"}
-              {:name "ddparam", :default 1.0, :doc "A parameter for the shape of the duration probability distribution, requires values in the range 0.0001 to 1"}
-              {:name "freq", :default 440.0, :doc "Oscillation frquency."}
-              {:name "ampscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for amplitude. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of amplitude."}
-              {:name "durscale", :default 0.5, :doc "Normally 0.0 to 1.0, multiplier for the distribution's delta value for duration. An ampscale of 1.0 allows the full range of  -1 to 1 for a change of duration."}
-              {:name "init-cps", :default 12, :doc "Initialise the number of control points in the memory. Xenakis specifies 12. There would be this number of control points per cycle of the oscillator, though the oscillator's period will constantly change due to the duration distribution."}
-              {:name "knum" :default 12, :doc "Current number of utilised control points, allows modulation."}]
+       :args [{:name "ampdist",
+               :default 1.0,
+               :doc "Choice of probability distribution for the next
+                     perturbation of the amplitude of a control
+                     point. The distributions are (adapted from the
+                     GENDYN program in Formalized Music): 0- LINEAR,1-
+                     CAUCHY, 2- LOGIST, 3- HYPERBCOS, 4- ARCSINE, 5-
+                     EXPON, 6- SINUS, Where the sinus (Xenakis' name) is
+                     in this implementation taken as sampling from a
+                     third party oscillator." }
+
+              {:name "durdist",
+               :default 1.0,
+               :doc "Choice of distribution for the perturbation of the
+                     current inter control point duration." }
+
+              {:name "adparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the amplitude
+                     probability distribution, requires values in the
+                     range 0.0001 to 1 (there are safety checks in the
+                     code so don't worry too much if you want to
+                     modulate!)" }
+
+              {:name "ddparam",
+               :default 1.0,
+               :doc "A parameter for the shape of the duration
+                     probability distribution, requires values in the
+                     range 0.0001 to 1"}
+
+              {:name "freq",
+               :default 440.0,
+               :doc "Oscillation frquency."}
+
+              {:name "ampscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for amplitude. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of amplitude." }
+
+              {:name "durscale",
+               :default 0.5,
+               :doc "Normally 0.0 to 1.0, multiplier for the
+                     distribution's delta value for duration. An
+                     ampscale of 1.0 allows the full range of -1 to 1
+                     for a change of duration." }
+
+              {:name "init-cps",
+               :default 12,
+               :doc "Initialise the number of control points in the
+                     memory. Xenakis specifies 12. There would be this
+                     number of control points per cycle of the
+                     oscillator, though the oscillator's period will
+                     constantly change due to the duration
+                     distribution." }
+
+              {:name "knum"
+               :default 12,
+               :doc "Current number of utilised control points, allows
+                     modulation." }]
+
        :rates #{:ar :kr}
-      :doc "See Gendy1 help file for background. This variant of GENDYN normalises the durations in each period to force oscillation at the desired pitch. The breakpoints still get perturbed as in Gendy1. There is some glitching in the oscillator caused by the stochastic effects: control points as they vary cause big local jumps of amplitude. Put ampscale and durscale low to minimise this. All parameters can be modulated at control rate except for initCPs which is used only at initialisation."}])
+      :doc "See Gendy1 help file for background. This variant of GENDYN
+            normalises the durations in each period to force oscillation
+            at the desired pitch. The breakpoints still get perturbed as
+            in Gendy1. There is some glitching in the oscillator caused
+            by the stochastic effects: control points as they vary cause
+            big local jumps of amplitude. Put ampscale and durscale low
+            to minimise this. All parameters can be modulated at control
+            rate except for initCPs which is used only at
+            initialisation." }])


fix double-map bug for access request entities

--- src-cljs/frontend/components/overlay.cljs
+++ src-cljs/frontend/components/overlay.cljs
@@ -194,10 +194,10 @@
 (defmethod render-access-entity :access-request
   [entity cast!]
   (html
-   [:div.access-card.make {:key (:db/id entity)}
-    {:class (if (= :access-request.status/denied (:access-request/status entity))
-              "denied"
-              "requesting")}
+   [:div.access-card.make {:key (:db/id entity)
+                           :class (if (= :access-request.status/denied (:access-request/status entity))
+                                    "denied"
+                                    "requesting")}
     [:div.access-avatar
      [:img.access-avatar-img {:src (utils/gravatar-url (:access-request/cust entity))}]]
     [:div.access-details


Tabs working.

Tabs working.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -590,9 +590,13 @@

 (defn property-details-div [data owner]
   (reify
-    om/IRender
-    (render [_]
-      (let [selected-property-id (-> data :active-components :properties)
+    om/IInitState
+    (init-state [_]
+      {:active-tab :overview})
+    om/IRenderState
+    (render-state [_ state]
+      (let [active-tab           (:active-tab state)
+            selected-property-id (-> data :active-components :properties)
             properties           (-> data :properties :data)
             property-details     (get-property-details selected-property-id data)
             property_data        (:property_data property-details)]
@@ -600,12 +604,20 @@
                [:h2 "Property Details"]
                (bs/panel
                 (:slug property-details)
-                [:div.col-md-12
+                [:div ;; Tab Container
                  [:ul.nav.nav-tabs {:role "tablist"}
-                  [:li.active [:a {:href "#"} "Overview"]]
-                  [:li [:a {:href "#"} "Profiles"]]
-                  [:li [:a {:href "#"} "Sensor Data"]]]
-                 [:div.col-md-12
+                  [:li {:class (if (= active-tab :overview) "active" nil)}
+                   [:a {:onClick (fn [_ _] (om/set-state! owner :active-tab :overview))}
+                    "Overview"]]
+                  [:li {:class (if (= active-tab :profiles) "active" nil)}
+                   [:a {:onClick (fn [_ _] (om/set-state! owner :active-tab :profiles))}
+                    "Profiles"]]
+                  [:li {:class (if (= active-tab :sensors) "active" nil)}
+                   [:a {:onClick (fn [_ _] (om/set-state! owner :active-tab :sensors))}
+                    "Sensor Data"]]]
+                 ;; Overview
+                 [:div {:class (if (not= active-tab :overview) "hidden" "col-md-12")}
+                  [:h3 "Overview"]
                   [:div.col-md-4
                    [:dl.dl-horizontal
                     [:dt "Property Code"] [:dd (:property_code property-details)]
@@ -629,16 +641,23 @@
                       {:src (str "https://s3-us-west-2.amazonaws.com/get-embed-data/" pic)}])]
                   [:div.col-md-6
                    (for [ti (:technology_icons property_data)]
-                     [:img.tmg-responsive {:src ti :width 80 :height 80}])]]
-                 [:div.col-md-12
-                  (detail-section "Description" (:description property_data))
-                  (detail-section "Project Summary" (:project_summary property_data))
-                  (detail-section "Project Team" (:project_team property_data))
-                  (detail-section "Design Strategy" (:design_strategy property_data))
-                  (detail-section "Energy Strategy" (:energy_strategy property_data))
-                  (detail-section "Monitoring Policy" (:monitoring_policy property_data))
-                  (detail-section "Other Notes" (:other_notes property_data))]
-                 (om/build sensors-div data)]
+                     [:img.tmg-responsive {:src ti :width 80 :height 80}])]
+                  [:div.col-md-12
+                   (detail-section "Description" (:description property_data))
+                   (detail-section "Project Summary" (:project_summary property_data))
+                   (detail-section "Project Team" (:project_team property_data))
+                   (detail-section "Design Strategy" (:design_strategy property_data))
+                   (detail-section "Energy Strategy" (:energy_strategy property_data))
+                   (detail-section "Monitoring Policy" (:monitoring_policy property_data))
+                   (detail-section "Other Notes" (:other_notes property_data))]]
+                 ;; Sensors
+                 [:div {:class (if (not= active-tab :sensors) "hidden" nil)}
+                  (om/build sensors-div data)]
+                 ;; Profiles
+                 [:div {:class (if (not= active-tab :profiles) "hidden" "col-md-12")}
+                  [:h3 "Profiles"]
+                  [:p "Profiles go here..."]]]
+
                 )])))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Rename actxs to hier.

Rename actxs to hier.


(PE-5496) Integrate trapperkeeper-proxy into console-services

--- configs/pe-console-services/pe-console-services.clj
+++ configs/pe-console-services/pe-console-services.clj
@@ -6,7 +6,7 @@
                  [puppetlabs/pe-rbac-service "{{{pe-rbac-version}}}"]
                  [puppetlabs/rbac-ui "{{{pe-rbac-ui-version}}}"]
                  [puppetlabs/pe-activity-service "{{{pe-activity-service-version}}}"]
-                 ;[puppetlabs/pe-trapperkeeper-proxy "{{{pe-trapperkeeper-proxy-version}}}"]
+                 [puppetlabs/pe-trapperkeeper-proxy "{{{pe-trapperkeeper-proxy-version}}}"]
                  [puppetlabs/trapperkeeper-webserver-jetty9 "0.7.1"]]

   :uberjar-name "console-services-release.jar"


Change rainbow mode controls to speed/scale.

--- src/org/playasophy/wonderdome/mode/rainbow.clj
+++ src/org/playasophy/wonderdome/mode/rainbow.clj
@@ -1,17 +1,12 @@
 (ns org.playasophy.wonderdome.mode.rainbow
   (:require
-    [org.playasophy.wonderdome.geometry.sphere :as sphere]
     [org.playasophy.wonderdome.mode.core :as mode]
-    [org.playasophy.wonderdome.util.color :as color]))
-
-
-(def ^:private ^:const move-rate
-  "Rate at which the angles change in radians per millisecond."
-  0.0005)
+    [org.playasophy.wonderdome.util.color :as color]
+    [org.playasophy.wonderdome.util.control :as control]))

 (defrecord RainbowMode
-  [polar azimuth scale speed offset]
+  [scale speed offset]

   mode/Mode

@@ -24,22 +19,19 @@
             offset' (if (> offset' 1.0) (- offset' 1.0) offset')]
         (assoc this :offset offset'))

-      ; TODO: add controls for adjusting speed and scale
-      ; TODO: add reset button
-
       [:button/repeat :x-axis]
-      (let [delta (* (or (:value event) 0)
-                     (or (:elapsed event) 0)
-                     move-rate)]
-        (assoc this :azimuth
-          (sphere/wrap-angle (+ azimuth delta))))
+      (assoc this :scale
+             (control/adjust scale event
+                             :rate 0.5
+                             :min-val 0.1
+                             :max-val 5.0))

       [:button/repeat :y-axis]
-      (let [delta (* (or (:value event) 0)
-                     (or (:elapsed event) 0)
-                     move-rate)]
-        (assoc this :polar
-          (sphere/wrap-angle (+ polar delta))))
+      (assoc this :speed
+             (control/adjust speed event
+                             :rate 0.5
+                             :min-val -3.0
+                             :max-val  3.0))

       ; default
       this))
@@ -47,12 +39,12 @@

   (render
     [this pixel]
-    (let [angle (sphere/angle-offset (:sphere pixel) [0 polar azimuth])
-          index (* scale (- angle offset))]
+    (let [[_ angle _] (:sphere pixel)
+          index (- (* scale angle) offset)]
       (color/rainbow index))))

 (defn rainbow
   "Creates a new rainbow color-cycling mode."
   []
-  (RainbowMode. 0.0 0.0 1.0 1.0 0.0))
+  (RainbowMode. 1.0 1.0 0.0))


CMR-2109: Updated elasticsearch error message to be a string instead of a map to be consistent with other health check errors.

--- elastic-utils-lib/src/cmr/elastic_utils/connect.clj
+++ elastic-utils-lib/src/cmr/elastic_utils/connect.clj
@@ -59,9 +59,8 @@
     (admin/cluster-health conn :wait_for_status "yellow"
                           :timeout (str (hh/health-check-timeout-seconds) "s"))
     (catch Exception e
-      {:status "Inaccessible"
-       :problem (format "Unable to get elasticsearch cluster health, caught exception: %s"
-                        (.getMessage e))})))
+      (format "Unable to get elasticsearch cluster health, caught exception: %s"
+              (.getMessage e)))))

 (defn health-fn
   "Returns the health state of elasticsearch."


bump version in ui

bump version in ui

--- elephantdb-server/src/clj/elephantdb/ui/handler.clj
+++ elephantdb-server/src/clj/elephantdb/ui/handler.clj
@@ -8,7 +8,7 @@
             [compojure.route :as route]
             [elephantdb.client :as c]))

-(def VERSION "0.4.4-SNAPSHOT")
+(def VERSION "0.4.5-SNAPSHOT")

 ;; ## Thrift client functions


fix tests

fix tests

--- src/test/clojure/clojure/tools/reader_test.clj
+++ src/test/clojure/clojure/tools/reader_test.clj
@@ -127,8 +127,8 @@
     (are [re s opts] (is (thrown-with-msg? RuntimeException re (read-string opts s)))
          #"Feature should be a keyword" "#?((+ 1 2) :a)" opts
          #"even number of forms" "#?(:cljs :a :clj)" opts
-         #"read-cond-splicing must implement" "#?@(:clj :a)" opts
-         #"is reserved" "#?@(:foo :a :else :b)" opts
+         #"read-cond-splicing must implement" "(#?@(:clj :a))" opts
+         #"is reserved" "(#?@(:foo :a :else :b))" opts
          #"must be a list" "#?[:foo :a :else :b]" opts
          #"Conditional read not allowed" "#?[:clj :a :default nil]" {:read-cond :BOGUS}
          #"Conditional read not allowed" "#?[:clj :a :default nil]" {}))
@@ -146,7 +146,7 @@
     (is (not (:splicing? x)))
     (is (= :foo (get x :no-such-key :foo)))
     (is (= (:form x) '(:clj foo :cljs bar))))
-  (let [x (read-string {:read-cond :preserve} "#?@(:clj [foo])" )]
+  (let [x (first (read-string {:read-cond :preserve} "(#?@(:clj [foo]))"))]
     (is (reader-conditional? x))
     (is (= x (reader-conditional '(:clj [foo]) true)))
     (is (:splicing? x))
@@ -163,7 +163,7 @@
     (is (= {:x 1 :y 2} (:form tl)))
     (is (= :foo (get tl :no-such-key :foo))))
   (testing "print form roundtrips"
-     (doseq [s ["#?(:clj foo :cljs bar)"
-                "#?(:cljs #js {:x 1, :y 2})"
-                "#?(:clj #clojure.test_clojure.reader.TestRecord [42 85])"]]
-       (is (= s (pr-str (read-string {:read-cond :preserve} s)))))))
+    (doseq [s ["#?(:clj foo :cljs bar)"
+               "#?(:cljs #js {:x 1, :y 2})"
+               "#?(:clj #clojure.test_clojure.reader.TestRecord [42 85])"]]
+      (is (= s (pr-str (read-string {:read-cond :preserve} s)))))))


Simplified ultra-regression (thanks Tom).

--- src/clojush/examples/ultra_regression.clj
+++ src/clojush/examples/ultra_regression.clj
@@ -1,12 +1,10 @@
 ;; ultra_regression.clj
 ;; an example problem for clojush, a Push/PushGP system written in Clojure
-;; Lee Spector, lspector@hampshire.edu, 2010
+;; Lee Spector, lspector@hampshire.edu, 2013

 (ns clojush.examples.ultra-regression
-  (:use [clojush.pushgp.pushgp]
-        [clojush.pushstate]
-        [clojush.interpreter]
-        [clojure.math.numeric-tower]))
+  (:use clojush.pushgp.pushgp)
+  (:require clojush.examples.simple-regression))

 ;;;;;;;;;;;;
 ;; Integer symbolic regression of x^3 - 2x^2 - x (problem 5 from the
@@ -14,35 +12,13 @@
 ;; input instruction that uses the auxiliary stack.
 ;; Uses only the ULTRA genetic operator.

-(define-registered
-  in
-  (fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-
 (def argmap
-  {:error-function (fn [program]
-                     (doall
-                       (for [input (range 10)]
-                         (let [state (run-push program
-                                               (push-item input :auxiliary
-                                                          (push-item input :integer
-                                                                     (make-push-state))))
-                               top-int (top-item :integer state)]
-                           (if (number? top-int)
-                             (abs (- top-int
-                                     (- (* input input input)
-                                        (* 2 input input) input)))
-                             1000)))))
-   :atom-generators (list (fn [] (rand-int 10))
-                          'in
-                          'integer_div
-                          'integer_mult
-                          'integer_add
-                          'integer_sub)
-   :mutation-probability 0.0
-   :crossover-probability 0.0
-   :simplification-probability 0.0
-   :ultra-probability 1
-   :ultra-alternation-rate 0.01
-   :ultra-alignment-deviation 1
-   :ultra-mutation-rate 0.05
-   })
+  (merge clojush.examples.simple-regression/argmap
+         {:mutation-probability 0.0
+          :crossover-probability 0.0
+          :simplification-probability 0.0
+          :ultra-probability 1
+          :ultra-alternation-rate 0.01
+          :ultra-alignment-deviation 1
+          :ultra-mutation-rate 0.05
+          }))


y->ies before any consonant, not just [mnrt]

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -771,12 +771,17 @@
          english-verb-phrase)))))

 (defn plural-en [english]
-  (if (re-find #"[mnrt][y]$" english) ;; city => cities
-    (replace english #"[y]$" "ies")
-    (if (re-find #"[cs][hsx]$" english) ;; brush => brushes; beach => beaches
-      (str english "es")
-      ;; default case.
-      (str english "s"))))
+  (cond
+    ;; city => cities
+    (re-find #"y$" english)
+    (replace english #"[^aeiou][y]$" "ies")
+
+    (re-find #"[cs][hsx]$" english) ;; brush => brushes; beach => beaches
+    (str english "es")
+
+    ;; default case.
+    true
+    (str english "s")))

 (def gender-symbol-female
   {#" \(♀\)$"


handle possessive suffix "'s"

handle possessive suffix "'s"

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -38,7 +38,7 @@
    ""))

 (defn get-string [word]
-  (log/debug (str "get-string: " word))
+  (log/debug (if (map? word) (str "get-string: " (strip-refs word))))
   (cond
    (ref? word)
    (get-string @word)
@@ -137,11 +137,35 @@
                   :b {:a (get-in word '(:b :a :past))
                       :b (get-in word '(:b :b))}})
    (and
-    (get-in word '(:a))
-    (get-in word '(:b)))
-   (join " "
-         (list (get-string (get-in word '(:a)))
-               (get-string (get-in word '(:b)))))
+    (get-in word [:a])
+    (get-in word [:b]))
+   (let [string-a (get-string (get-in word [:a]))
+         string-b (get-string (get-in word [:b]))]
+     (log/debug (str "A AGR1: " (strip-refs (get-in word [:a]))))
+     (log/debug (str "A AGR2: " (strip-refs (get-in word [:a :agr]))))
+     (log/debug (str "A AGR3: " (strip-refs (get-in word [:a :agr :number]))))
+     (log/debug (str "A STRING-A: " string-a))
+     (log/debug (str "B STRING-B: " string-b))
+     (cond
+
+       (and (= string-b "s")
+            (nil? (re-find #"s$" string-a)) ;; plural noun phrase does *not* end with 's' (e.g. "the women"
+            (= :plur (get-in word [:a :agr :number]))
+            (= false (get-in word [:a :propernoun] false)))
+       (str string-a "s'") ;; "the women" + "s" => "the womens'"
+
+       (and (= string-b "s")  ;; plural noun phrase *does* end with 's' (e.g. "the women"
+            (= :plur (get-in word [:a :agr :number]))
+            (= false (get-in word [:a :propernoun] false)))
+       (str string-a "'") ;; "the dogs" + "s" => "the dogs'"
+
+       (= string-b "s")
+       (str string-a "'" string-b)  ;; "the dog" + "s" => "the dog's"
+
+       true
+       (join " "
+             [(get-string (get-in word '(:a)))
+              (get-string (get-in word '(:b)))])))

    ;; TODO: this seems wrong: how could :infl == :english?
    (and (= :english (get-in word '(:infl)))
@@ -799,7 +823,7 @@
                                    merge-fn (:merge-fn path-and-merge-fn)]
                                ;; a lexeme-kv is a pair of a key and value. The key is a string (the word's surface form)
                                ;; and the value is a list of lexemes for that string.
-                               (log/debug (str (first lexeme-kv) "looking at path: " path))
+                               (log/debug (str "'" (first lexeme-kv) "' looking at path: " path))
                                (mapcat (fn [lexeme]
                                          ;; this is where a unify/dissoc that supported
                                          ;; non-maps like :top and :fail, would be useful:


s/'()/[]/

s/'()/[]/

--- src/babel/espanol/morphology.cljc
+++ src/babel/espanol/morphology.cljc
@@ -77,8 +77,8 @@
          usted (if usted usted false)]
      (log/debug (str "get-string-1: word: " word))
      (log/debug (str "get-string-1: word (stripped-refs): " (strip-refs word)))
-     (log/debug (str "word's a is a string? " (get-in word '(:a)) " => " (string? (get-in word '(:a)))))
-     (log/debug (str "word's b is a map? " (get-in word '(:b)) " => " (map? (get-in word '(:b)))))
+     (log/debug (str "word's a is a string? " (get-in word [:a]) " => " (string? (get-in word [:a]))))
+     (log/debug (str "word's b is a map? " (get-in word [:b]) " => " (map? (get-in word [:b]))))

      (log/debug (str "word's a espanol is a string? " (get-in word '(:a :espanol)) " => " (string? (get-in word '(:a :espanol)))))

@@ -90,18 +90,18 @@
       (= word {:initial true})
       ".."

-      (and (string? (get-in word '(:a)))
-           (string? (get-in word '(:b))))
-      (get-string (get-in word '(:a))
-                  (get-in word '(:b)))
-
-      (and (string? (get-in word '(:a)))
-           (map? (get-in word '(:b))))
-      (get-string (get-in word '(:a))
-                  (get-in word '(:b)))
-
-      (and (map? (get-in word '(:a)))
-           (map? (get-in word '(:b))))
+      (and (string? (get-in word [:a]))
+           (string? (get-in word [:b])))
+      (get-string (get-in word [:a])
+                  (get-in word [:b]))
+
+      (and (string? (get-in word [:a]))
+           (map? (get-in word [:b])))
+      (get-string (get-in word [:a])
+                  (get-in word [:b]))
+
+      (and (map? (get-in word [:a]))
+           (map? (get-in word [:b])))
       (get-string
        (get-string (get-in word [:a]))
        (get-string (get-in word [:b])))
@@ -110,10 +110,10 @@
       ;; that look in :a and :b. Either remove those following rules
       ;; if they are redundant and not needed, or move this general rule
       ;; below the following rules.
-      (and (not (= :none (get-in word '(:a) :none)))
-           (not (= :none (get-in word '(:b) :none))))
-      (get-string (get-in word '(:a))
-                  (get-in word '(:b)))
+      (and (not (= :none (get-in word [:a] :none)))
+           (not (= :none (get-in word [:b] :none))))
+      (get-string (get-in word [:a])
+                  (get-in word [:b]))

       (and
        (string? (get-in word '(:a :espanol)))
@@ -126,12 +126,12 @@
            (string/trim (get-in word '(:b :espanol))))

       (and
-       (string? (get-in word '(:a)))
+       (string? (get-in word [:a]))
        (string? (get-in word '(:b :espanol)))
        (or (= :none (get-in word '(:b :agr :number) :none))
            (= :top (get-in word '(:b :agr :number) :none)))
        )
-      (str (string/trim (get-in word '(:a)))
+      (str (string/trim (get-in word [:a]))
            " "
            (string/trim (get-in word '(:b :espanol))))

@@ -142,7 +142,7 @@
            (= :top (get-in word '(:b :agr :number) :none)))
        (= (get-in word '(:a :infl)) :top))
       (string/trim (str (get-in word '(:a :espanol))
-                        " " (get-string-1 (get-in word '(:b)))))
+                        " " (get-string-1 (get-in word [:b]))))

       (= true (get-in word [:exception]))
       (get-in word [:espanol])


Example app demonstrates usage of ref name

This demonstrates using a sorted-set to follow best practices (as I understand, from the original issue thread)

Make no claims this is really idiomatic, I've never used Firebase before :)

--- examples/cljs/om-value-changes/src/core.cljs
+++ examples/cljs/om-value-changes/src/core.cljs
@@ -12,19 +12,75 @@

 (def app-state (atom {:count 0}))

-(defn counter-view [app owner]
+;;; state modifiers
+
+(defn set-item-fn [{:keys [name val]}]
+  (fn [items]
+    (let [items (or items (sorted-map))]
+      (assoc items name val))))
+
+(defn remove-item-fn [{:keys [name]}]
+  #(dissoc % name))
+
+;;; event handlers
+
+(defn inc-counter-handler [app r]
+  (om/transact! app :count inc)
+  (pani/transact! r :counter inc))
+
+(defn add-item-handler [app r]
+  (let [v {:value (js/Math.random)}]
+    (pani/push! r :items v)))
+
+(defn mutate-item-handler [app r name]
+  (let [v {:value (js/Math.random)}]
+    (pani/set! r [:items name] v)))
+
+(defn del-items-handler [app r]
+  (om/update! app :items (sorted-map))
+  (pani/set! r :items nil))
+
+;;; om components
+
+(defn counter-view [app owner {:keys [r]}]
+  (om/component
+    (dom/div nil
+     (:count app) " "
+     (dom/a #js {:onClick (partial inc-counter-handler app r)} "+"))))
+
+(defn item-view [[_ item] owner]
+  (om/component
+    (dom/li nil (:value item))))
+
+(defn items-view [app owner {:keys [r]}]
+  (om/component
+    (dom/div nil
+     (apply dom/ul nil (om/build-all item-view (:items app) {:key :value}))
+     (dom/a #js {:onClick (partial add-item-handler app r)} "add item") (dom/br nil)
+     (dom/a #js {:onClick (partial del-items-handler app r)} "reset items"))))
+
+(defn app-view [app owner]
   (reify
     om/IWillMount
     (will-mount [_]
       (let [r (pani/root firebase-app-url)
             c (pani/bind r :value :counter)]
-        (go-loop [m (<! c)]
-          (om/update! app :count m)
-          (recur (<! c)))))
+        ;; wire up counter, via channel
+        (go-loop [{:keys [val] :as v} (<! c)]
+                 (om/transact! app :count #(max % val))
+                 (recur (<! c)))
+        ;; wire up items, via callbacks
+        (pani/bind r :child_added   :items #(om/transact! app :items (set-item-fn %)))
+        (pani/bind r :child_changed :items #(om/transact! app :items (set-item-fn %)))
+        (pani/bind r :child_removed :items #(om/transact! app :items (remove-item-fn %)))
+        (om/set-state! owner :fb-root r)))

     om/IRender
     (render [_]
-      (dom/div nil (:count app)))))
+      (let [r (om/get-state owner :fb-root)]
+        (dom/div nil
+         (om/build counter-view app {:opts {:r r}})
+         (om/build items-view app {:opts {:r r}}))))))

-(om/root counter-view app-state
-         {:target (.getElementById js/document "app")})
+(om/root app-view app-state
+         {:target (.getElementById js/document "app")})


Minor formatting cleanup.

Minor formatting cleanup.

--- src/blutwurst/tuple_generator.clj
+++ src/blutwurst/tuple_generator.clj
@@ -25,7 +25,7 @@
   ^{ :private true }
   [
    {
-      :name "Simple String Generator"
+      :name "Random String Generator"
       :determiner #(= (:type %) "VARCHAR")
       :generator #(random-string (or (:length %) 255))
    }
@@ -51,6 +51,7 @@
                                  (recur column (rest strategies))
                                  ))
                              ))]
+
     (generator-search column value-generation-strategies)
     ))


add :choices to 24/7 News Cycle so it will work

--- src/clj/game/cards-operations.clj
+++ src/clj/game/cards-operations.clj
@@ -2,10 +2,10 @@

 (def cards-operations
   {"24/7 News Cycle"
-   {:req (req (> (count (:scored corp)) 1))
-    :additional-cost [:forfeit]
-    :prompt "Choose an agenda to trigger"
-    :msg (msg "trigger the score ability on " (:title target))
+   {:req (req (> (count (:scored corp)) 1)) :additional-cost [:forfeit]
+    :prompt "Choose an agenda to trigger its \"when scored\" ability"
+    :choices (req (filter #(= (:type %) "Agenda") (:scored corp)))
+    :msg (msg "trigger the \"when scored\" ability of " (:title target))
     :effect (effect (card-init target))}

    "Aggressive Negotiation"


save result to fb

save result to fb

--- src/clj/quiz_site/routes/quiz.clj
+++ src/clj/quiz_site/routes/quiz.clj
@@ -29,6 +29,11 @@
   [quiz-id]
   (json/read-str (:body (client/get (str fburl "/quizzes/" quiz-id ".json")))
                  :key-fn keyword))
+
+(defn do-put-results*
+  [result-id results]
+  (client/post (str fburl "/results/" result-id "/subs.json") {:form-params results
+                                                               :content-type :json}))

 (defn push-quiz
   [quiz host]
@@ -69,9 +74,16 @@
         answers (:answers results)
         cmpfn (fn [x] (if (= (:c (x qs)) (x answers)) true false))
         ncorrect (count (filter cmpfn qkeys))
+        sid (:sid results)
+        rid (:result-id quiz)
+        submission {:sid sid
+                    :correct ncorrect
+                    :time (new java.util.Date)}
         ]
+    (do-put-results* rid submission)
     {:correct ncorrect
-     :outof (:nQuestions quiz)}))
+     :outof (:nQuestions quiz)
+     :sid sid}))
 (def quiz-routes
   (defroutes document-routes
     (context "/quiz" []


attempt to revise webapp.listlpv/csv2table

--- src/clj/webapp/routes/listlpv.clj
+++ src/clj/webapp/routes/listlpv.clj
@@ -59,20 +59,29 @@
 (defn csv2table
 "Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
  [lpvs]
+(let [curcat1 (atom "")
+      curcat2 (atom "")
+      curcat3 (atom [])]
  [:table
-(doseq [lpv lpvs]
- (let [curmap (zipmap [:cat1 :cat2 :cat3] (split (first lpvs) #","))
-       nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
-       ;;cur3str (str "")
-       cur3vec (vector "")
+(for [lpv lpvs]
+ (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
+       ;;nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
        ]
-   (if (= (:cat1 curmap) (:cat1 nextmap))
+   (if (= (:cat1 catmap) curcat1)

-     (if (= (:cat2 curmap) (:cat2 nextmap))
-       (conj cur3vec (:cat3 curmap))
-       [:tr [:td] [:td (:cat2 curmap)] [:td (str cur3vec " " (:cat3 curmap))]])
+     (if (= (:cat2 catmap) curcat2)
+       (swap! curcat3 conj (str (:cat3 catmap)))
+       ([:tr [:td] [:td curcat2] [:td curcat3]]
+          (reset! curcat2 (str (:cat2 catmap)))))

-     [:tr [:td (:cat1 curmap)] [:td (:cat2 curmap)] [:td (str cur3vec " " (:cat3 curmap))]])))])
+     ((if (clojure.string/blank? @curcat1)
+        ((reset! curcat1 (str (:cat1 catmap)))
+         (reset! curcat2 (str (:cat2 catmap)))
+         (swap! curcat3 conj (str (:cat3 catmap))))
+        ([:tr [:td curcat1] [:td curcat2] [:td curcat3]]
+           (reset! curcat1 (str (:cat1 catmap)))
+           (reset! curcat2 (str (:cat2 catmap)))
+           (reset! curcat3 (str (:cat3 catmap)))))))))]))

 (defn handle-listlpv-gen
   [ldomain colorder]


Cosmetic changes.

Cosmetic changes.

--- src/cljs/cljs_bootstrap/repl.cljs
+++ src/cljs/cljs_bootstrap/repl.cljs
@@ -175,7 +175,7 @@
   "Handles the case when the evaluation returned success.
   Supports the following options (opts = option map):

-  * :no-pr-str-on-value If true, avoids wrapping value in pr-str.
+  * :no-pr-str-on-value avoids wrapping value in pr-str.

   The opts map passed here overrides the environment options."
   ([opts cb value]
@@ -201,6 +201,7 @@

   Supports the following options (opts = option map):
   * :verbose will enable the the evaluation logging, defaults to false.
+  * :no-pr-str-on-value avoids wrapping value in pr-str

   Note1: The opts map passed here overrides the environment options.
   Note2: This function will also clear the :last-eval-warning flag in


controller switched to bidi

controller switched to bidi

--- src/cljs/swarmpit/controller.cljs
+++ src/cljs/swarmpit/controller.cljs
@@ -4,6 +4,7 @@
             [swarmpit.url :refer [dispatch! query-string]]
             [cemerick.url :refer [query->map]]
             [swarmpit.storage :as storage]
+            [swarmpit.routes :as routes]
             [swarmpit.component.page-login :as page-login]
             [swarmpit.component.page-401 :as page-401]
             [swarmpit.component.page-404 :as page-404]
@@ -59,33 +60,36 @@

 (defmethod dispatch :service-list
   [_]
-  (fetch "/services"
+  (fetch (routes/path-for-backend :services)
          (fn [response]
            (slist/mount! response))))

 (defmethod dispatch :service-info
   [{:keys [route-params]}]
-  (fetch (str "/services/" (:id route-params))
+  (fetch (routes/path-for-backend :service route-params)
          (fn [response]
            (sinfo/mount! response))))

 (defmethod dispatch :service-create-image
   [_]
-  (fetch "/registries/sum"
-         (fn [response-reg]
-           (fetch "/dockerhub/users/sum"
-                  (fn [response-usr]
-                    (screatei/mount! response-reg response-usr))))))
+  (fetch (routes/path-for-backend :registries-sum)
+         (fn [registries]
+           (fetch (routes/path-for-backend :dockerhub-users-sum)
+                  (fn [users]
+                    (screatei/mount! registries users))))))

 (defmethod dispatch :service-create-config
   [_]
   (let [params (keywordize-keys (query->map (query-string)))]
-    (screatec/mount! (:registry params)
-                     (:repository params))))
+    (fetch (routes/path-for-backend :networks)
+           (fn [networks]
+             (screatec/mount! (:registry params)
+                              (:repository params)
+                              networks)))))

 (defmethod dispatch :service-edit
   [{:keys [route-params]}]
-  (fetch (str "/services/" (:id route-params))
+  (fetch (routes/path-for-backend :service-update route-params)
          (fn [response]
            (sedit/mount! response))))

@@ -93,13 +97,13 @@

 (defmethod dispatch :network-list
   [_]
-  (fetch "/networks"
+  (fetch (routes/path-for-backend :networks)
          (fn [response]
            (nlist/mount! response))))

 (defmethod dispatch :network-info
   [{:keys [route-params]}]
-  (fetch (str "/networks/" (:id route-params))
+  (fetch (routes/path-for-backend :network route-params)
          (fn [response]
            (ninfo/mount! response))))

@@ -111,13 +115,13 @@

 (defmethod dispatch :node-list
   [_]
-  (fetch "/nodes"
+  (fetch (routes/path-for-backend :nodes)
          (fn [response]
            (ndlist/mount! response))))

 (defmethod dispatch :node-info
   [{:keys [route-params]}]
-  (fetch (str "/nodes/" (:id route-params))
+  (fetch (routes/path-for-backend :node route-params)
          (fn [response]
            (ndinfo/mount! response))))

@@ -125,13 +129,13 @@

 (defmethod dispatch :task-list
   [_]
-  (fetch "/tasks"
+  (fetch (routes/path-for-backend :tasks)
          (fn [response]
            (tlist/mount! response))))

 (defmethod dispatch :task-info
   [{:keys [route-params]}]
-  (fetch (str "/tasks/" (:id route-params))
+  (fetch (routes/path-for-backend :task route-params)
          (fn [response]
            (tinfo/mount! response))))

@@ -139,13 +143,13 @@

 (defmethod dispatch :user-list
   [_]
-  (fetch "/admin/users"
+  (fetch (routes/path-for-backend :users)
          (fn [response]
            (ulist/mount! response))))

 (defmethod dispatch :user-info
   [{:keys [route-params]}]
-  (fetch (str "/admin/users/" (:id route-params))
+  (fetch (routes/path-for-backend :user route-params)
          (fn [response]
            (uinfo/mount! response))))

@@ -157,13 +161,13 @@

 (defmethod dispatch :registry-list
   [_]
-  (fetch "/admin/registries"
+  (fetch (routes/path-for-backend :registries)
          (fn [response]
            (reglist/mount! response))))

 (defmethod dispatch :registry-info
   [{:keys [route-params]}]
-  (fetch (str "/admin/registries/" (:id route-params))
+  (fetch (routes/path-for-backend :registry route-params)
          (fn [response]
            (reginfo/mount! response))))

@@ -175,7 +179,7 @@

 (defmethod dispatch :dockerhub-list
   [_]
-  (fetch "/dockerhub/users/sum"
+  (fetch (routes/path-for-backend :dockerhub-users-sum)
          (fn [response]
            (dhlist/mount! response))))


Set sync fn as default bench function.

Set sync fn as default bench function.

--- src/clojure/nanomsg/benchmark.clj
+++ src/clojure/nanomsg/benchmark.clj
@@ -83,4 +83,4 @@

 (defn -main
   []
-  (bench-async))
+  (bench-fn1))


Separate field for new entry

Separate field for new entry

--- workspaces/src/com/wsscode/pathom/workspaces/graphql/simple_todo_demo.cljs
+++ workspaces/src/com/wsscode/pathom/workspaces/graphql/simple_todo_demo.cljs
@@ -11,17 +11,12 @@

 (declare TodoItem)

-(fm/defmutation update-todo [todo]
+(fm/defmutation update-todo-item [todo]
   (action [{:keys [state ref]}]
     (swap! state update-in ref merge todo))
   (remote [{:keys [ast state]}]
     (-> ast
-        (fm/returning state TodoItem)
-        (assoc :key 'update-todo-item))))
-
-(fm/defmutation create-todo-item [_]
-  (remote [_]
-    true))
+        (fm/returning state TodoItem))))

 (fp/defsc TodoItem
   [this {:todo/keys [id title completed]}]
@@ -32,42 +27,55 @@
    :ident         [:todo/id :todo/id]
    :query         [:todo/id :todo/title :todo/completed]
    :css           [[:.completed {:text-decoration "line-through"}]
-                   [:.creating {}]]
+                   [:.creating {:color "#ccc"}]]
    :css-include   []}
-  (let [creating? (fp/tempid? id)]
-    (dom/div {:classes [(if completed :.completed)
-                        (if creating? :.creating)]}
-      (dom/label
-        (dom/input {:type    "checkbox"
-                    :checked completed
-                    :onClick #(fp/transact! this [`(update-todo ~{:todo/id id :todo/completed (not completed)})])})
-        (if-not creating?
-          (str title)))
-
-      (if creating?
-        (dom/div
-          (dom/input {:type     "text"
-                      :value    title
-                      :onChange #(fm/set-string! this :todo/title :event %)})
-          (dom/button {:onClick #(fp/transact! this [`(create-todo-item ~(fp/props this))])} "Save"))))))
+  (dom/div {:classes [(if completed :.completed)
+                      (if (fp/tempid? id) :.creating)]}
+    (dom/label
+      (dom/input {:type    "checkbox"
+                  :checked completed
+                  :onClick #(fp/transact! this [`(update-todo-item ~{:todo/id id :todo/completed (not completed)})])})
+      (str title))))

 (def todo-item (fp/factory TodoItem {:keyfn :todo/id}))

-(fm/defmutation add-new-todo [{}]
+(fp/defsc NewTodo
+  [this {:todo/keys [title]} {::keys [on-save-todo]}]
+  {:initial-state (fn [_]
+                    {:todo/id        (fp/tempid)
+                     :todo/title     ""
+                     :todo/completed false})
+   :ident         [:todo/id :todo/id]
+   :query         [:todo/id :todo/title :todo/completed]
+   :css           []
+   :css-include   []}
+  (dom/div
+    (dom/input {:type     "text"
+                :value    title
+                :onChange #(fm/set-string! this :todo/title :event %)})
+    (dom/button {:onClick #(on-save-todo (fp/props this))} "Add")))
+
+(fm/defmutation create-todo-item [todo]
   (action [env]
-    (db.h/create-entity! env TodoItem {} :append :all-todo-items)))
+    (db.h/swap-entity! env update :all-todo-items conj (fp/get-ident TodoItem todo))
+    (db.h/create-entity! env NewTodo {} :replace :ui/new-todo))
+  (remote [_]
+    true))
+
+(def new-todo-ui (fp/factory NewTodo {:keyfn :todo/id}))

 (fp/defsc TodoSimpleDemo
-  [this {:keys [all-todo-items]}]
+  [this {:keys [all-todo-items] :ui/keys [new-todo]}]
   {:initial-state (fn [_]
-                    {})
+                    {:ui/new-todo (fp/get-initial-state NewTodo {})})
    :ident         (fn [] [::root "singleton"])
-   :query         [{:all-todo-items (fp/get-query TodoItem)}]
+   :query         [{:all-todo-items (fp/get-query TodoItem)}
+                   {:ui/new-todo (fp/get-query NewTodo)}]
    :css           []
    :css-include   [TodoItem]}
   (dom/div
-    (mapv todo-item all-todo-items)
-    (dom/button {:onClick #(fp/transact! this [`(add-new-todo {})])} "Add item")))
+    (new-todo-ui (fp/computed new-todo {::on-save-todo #(fp/transact! this [`(create-todo-item ~%)])}))
+    (mapv todo-item all-todo-items)))

 (ws/defcard todo-simple-demo
   (ct.fulcro/fulcro-card


use x-waiter-token header instead of host header as that may change the cluster calculation (#1633)

--- waiter/integration/waiter/token_request_test.clj
+++ waiter/integration/waiter/token_request_test.clj
@@ -769,7 +769,7 @@
                                        :name service-id-prefix
                                        :owner (retrieve-username)
                                        :token token}
-                    response (post-token waiter-url token-description :headers {"host" token})]
+                    response (post-token waiter-url token-description :token token)]
                 (assert-response-status response http-200-ok))

               (let [{:keys [body headers]} (get-token waiter-url token)


basic api

basic api

--- src/main/clojure/ranked_choice/routes.clj
+++ src/main/clojure/ranked_choice/routes.clj
@@ -1,8 +1,11 @@
 (ns ranked-choice.routes
-  (:require [bidi.ring :as bidi]
+  (:require [bidi.bidi :as bidi]
+            [bidi.ring :refer [make-handler]]
             [ring.util.response :as resp]
             [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
             [ring.middleware.json :refer [wrap-json-response]]))
+
+(declare route)

 (defn ok [request]
   (resp/response {:status "OK"}))
@@ -10,11 +13,21 @@
 (defn index [_]
   (resp/redirect "index.html"))

+(defn poll-view [request]
+  (resp/response ["Calvin" "Hobbes" "Locke"]))
+
+(defn polls-list [request]
+  (->> [123 456 789]
+       (map #(bidi/path-for route poll-view :id %))
+       (into [])
+       (resp/response)))
+
 (def route ["/" {"" index
-                 "api/" ok}])
+                 "api/poll/" {"" polls-list
+                              [:id] poll-view}}])

 (def site
   (-> route
-      (bidi/make-handler)
+      (make-handler)
       (wrap-json-response)
       (wrap-defaults site-defaults)))


minor refactoring

minor refactoring

--- src/dev/plastic/dev/figwheel.cljs
+++ src/dev/plastic/dev/figwheel.cljs
@@ -7,7 +7,7 @@
             [figwheel.client.utils :as utils]))

 (defonce ^:dynamic *inside-repl-plugin* false)
-(def ^:const repl-style "color:white; background-color:black; padding:0px 2px; border-radius:2px;")
+(def ^:const repl-marker-style "color:white; background-color:black; padding:0px 2px; border-radius:1px;")

 (defn figwheel-repl-fix [code]
   (.replace code
@@ -28,15 +28,18 @@
     (js* "eval(~{code})")))

 (defn present-repl-result [result]
-  (log "%cREPL" repl-style result))
+  (log "%cREPL" repl-marker-style result))
+
+(defn eval-inside-repl-plugin [code]
+  (let [rewritten-code (rewrite-repl-code-snippet code)
+        result (eval rewritten-code)]
+    (present-repl-result result)
+    (pr-str result)))

 (defn fancy-eval [code]
-  (if-not *inside-repl-plugin*
-    (eval code)
-    (let [rewritten-code (rewrite-repl-code-snippet code)
-          result (eval rewritten-code)]
-      (present-repl-result result)
-      (pr-str result))))
+  (if *inside-repl-plugin*
+    (eval-inside-repl-plugin code)
+    (eval code)))

 (defn repl-plugin [& args]
   (let [standard-impl (apply figwheel/repl-plugin args)]


Remove cljs from dependencies

Remove cljs from dependencies

--- plugin/project.clj
+++ plugin/project.clj
@@ -12,7 +12,7 @@
   :eval-in-leiningen true

   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "0.0-3308" :scope "provided"]
+
                  [doo "0.1.6-SNAPSHOT"]]

   :clean-targets ^{:protect false} [:target-path "resources/public/js/" "out"]
@@ -21,6 +21,9 @@
         :alias {:browsers [:chrome :firefox]
                 :dom [:browsers :headless]}}

+  :profiles {:dev {:dependencies [[org.clojure/clojurescript "0.0-3308"
+                                   :scope "provided"]]}}
+
   :cljsbuild
   {:builds {:test {:source-paths ["src" "test"]
                    :compiler {:output-to "resources/public/js/testable.js"


Update Language

Update Language

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -358,7 +358,7 @@
         "Set up your test runner to output in JUnit-style XML"] ", so we can:"
        [:ul
         [:li "Show a summary of all test failures across all containers"]
-        [:li "Identify the slowest test"]
+        [:li "Identify your slowest tests"]
         [:li "Balance tests between containers when using properly configured parallelization"]]
        ])


Some speedups

Some speedups

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -210,8 +210,11 @@
       (swap! state assoc-in [:last-stage-positions stage-dev] [x y]))))

 (defn set-property
-  ([prop] (let [[d p v] prop]
-            (device-best-effort d (core setProperty d p v)))))
+  [prop]
+  (let [[d p v] prop]
+    (when (not= v (get-in @state [:last-property-settings d p]))
+      (device-best-effort d (core setProperty d p v))
+      (swap! state assoc-in [:last-property-settings d p] v))))

 (defn run-autofocus []
   (let [z-drive (@state :default-z-drive)
@@ -365,8 +368,8 @@
 (defn acq-sleep [interval-ms]
   (log "acq-sleep")
   (when (and (@state :init-continuous-focus)
-    (not (core isContinuousFocusEnabled)))
-      (core enableContinuousFocus true))
+             (not (core isContinuousFocusEnabled)))
+    (core enableContinuousFocus true))
   (let [target-time (+ (@state :last-wake-time) interval-ms)
         delta (- target-time (jvm-time-ms))]
     (when (pos? delta)
@@ -410,28 +413,30 @@
               0))
          z-ref))))

+(defn z-stage-needs-adjustment [stage-name]
+  (or (not (@state :init-continuous-focus))
+      ;(not (core isContinuousFocusEnabled))
+      (core isContinuousFocusDrive stage-name)))
+
 (defn update-z-positions [msp-index]
   (when-let [msp (get-msp msp-index)]
     (dotimes [i (.size msp)]
       (let [stage-pos (.get msp i)
             stage-name (.stageName stage-pos)]
         (when (= 1 (.numAxes stage-pos))
-          (when (or (not (core isContinuousFocusEnabled))
-                    (core isContinuousFocusDrive stage-name))
+          (when (z-stage-needs-adjustment stage-name)
             (set-msp-z-position msp-index stage-name (get-z-stage-position stage-name))))))))

 (defn recall-z-reference [current-position]
   (let [z-drive (@state :default-z-drive)]
-    (when (or (not (core isContinuousFocusEnabled))
-              (core isContinuousFocusDrive z-drive))
-      (set-z-stage-position z-drive
+    (when (z-stage-needs-adjustment z-drive)
+      (set-stage-position z-drive
         (or (get-msp-z-position current-position z-drive)
             (@state :reference-z))))))

 (defn store-z-reference [current-position]
   (let [z-drive (@state :default-z-drive)]
-    (when (and (or (not (core isContinuousFocusEnabled))
-                   (core isContinuousFocusDrive z-drive)))
+    (when (z-stage-needs-adjustment z-drive)
       (let [z (get-z-stage-position z-drive)]
         (state-assoc! :reference-z z)))))

@@ -506,7 +511,7 @@
             #(set-property [d p v]))
           #(when-lets [exposure (:exposure event)
                        camera (core getCameraDevice)]
-             (device-best-effort (set-exposure camera exposure)))
+             (set-exposure camera exposure))
           #(when check-z-ref
              (recall-z-reference current-position))
           #(when-let [wait-time-ms (:wait-time-ms event)]
@@ -522,10 +527,10 @@
           (for [runnable (event :runnables)]
             #(.run runnable))
           #(device-best-effort (core getCameraDevice)
-             (wait-for-pending-devices)
-             (expose event)
-             (collect event out-queue)
-             (stop-trigger)))))))
+            (wait-for-pending-devices)
+            (expose event)
+            (collect event out-queue)
+            (stop-trigger)))))))

 (defn execute [event-fns]
   (doseq [event-fn event-fns :while (not (:stop @state))]


a little refactoring

a little refactoring

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -787,10 +787,12 @@
                               "Acquisition Engine Thread (Clojure)")
           processors (ProcessorStack. out-queue (.getTaggedImageProcessors acq-eng))
           out-queue-2 (.begin processors)]
-      (swap! (.state this) assoc :acq-thread acq-thread)
+      (swap! (.state this) assoc
+             :acq-thread acq-thread
+             :summary-metadata (make-summary-metadata settings))
       (when-not (:stop @(.state this))
         (.start acq-thread))
-      out-queue-2)))
+      out-queue-2)))

 ;; java interop -- implements org.micromanager.api.Pipeline

@@ -800,14 +802,11 @@
 (defn -run [this acq-settings acq-eng]
   (load-mm)
   (let [settings (convert-settings acq-settings)
-        summary-metadata (make-summary-metadata settings)
         out-queue-2 (run-acquisition-with-processors this settings acq-eng)]
-    (swap! (.state this) assoc :summary-metadata summary-metadata)
     (when-not (:stop @(.state this))
-      (let [live-acq (LiveAcq. mmc out-queue-2 summary-metadata
+      (let [live-acq (LiveAcq. mmc out-queue-2 (:summary-metadata @(.state this))
                                (:save settings) acq-eng gui)]
         (swap! (.state this) assoc
-               :summary-metadata summary-metadata
                :display live-acq
                :image-cache (.getImageCache live-acq))
         (.start live-acq)


fix process.browser not being correctly set for :browser in dev

--- src/main/shadow/build/targets/browser.clj
+++ src/main/shadow/build/targets/browser.clj
@@ -703,7 +703,13 @@
     (configure state mode config)

     :compile-prepare
-    (maybe-inject-cljs-loader-constants state mode config)
+    (-> state
+        (maybe-inject-cljs-loader-constants mode config)
+        (cond->
+          ;; only set this if any :shadow-js is used otherwise closure will complain
+          (get-in state [:sym->id 'shadow.js])
+          (assoc-in [:compiler-options :closure-defines 'shadow.js.process.browser] true)
+          ))

     :compile-finish
     (-> state
@@ -713,10 +719,6 @@
           (bootstrap-host-build? state)
           (bootstrap-host-info)))

-    :optimize-prepare
-    (-> state
-        (assoc-in [:compiler-options :closure-defines 'shadow.js.process.browser] true))
-
     :flush
     (flush state mode config)


[#2212] WIP connection pool for http requests

--- backend/src/akvo/lumen/component/keycloak.clj
+++ backend/src/akvo/lumen/component/keycloak.clj
@@ -229,11 +229,14 @@

 (defn- api-get
   [headers url]
-  (-> url (client/get {:headers headers}) :body json/decode))
+  (time
+   (-> url
+       (client/get {:headers headers})
+       :body
+       json/decode)))

 (defn- active-user [users email]
   (-> (filter #(and (= (get % "email") email)
-                    (get % "emailVerified")
                     (get % "enabled"))
               users)
       first
@@ -326,10 +329,12 @@
     (allowed-paths keycloak email)))

 (defn- keycloak [{:keys [credentials url realm]}]
-  (map->KeycloakAgent {:api-root (format "%s/admin/realms/%s" url realm)
-                       :credentials credentials
-                       :issuer (format "%s/realms/%s" url realm)
-                       :user-id-cache (atom {})}))
+  (client/with-connection-pool
+    {:timeout 5 :threads 4 :insecure? false :default-per-route 10}
+    (map->KeycloakAgent {:api-root (format "%s/admin/realms/%s" url realm)
+                         :credentials credentials
+                         :issuer (format "%s/realms/%s" url realm)
+                         :user-id-cache (atom {})})))

 (defmethod ig/init-key :akvo.lumen.component.keycloak/data  [_ {:keys [url realm] :as opts}]
   (try


filter from all docs

filter from all docs

--- src-cljs/frontend/components/doc_viewer.cljs
+++ src-cljs/frontend/components/doc_viewer.cljs
@@ -81,23 +81,23 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)
             app-docs (get-in app docs-path)
-            display-docs (cond
-                           (nil? app-docs)
-                           (dummy-docs (:document/id app) 5) ;; loading state
+            all-docs (cond
+                       (nil? app-docs)
+                       (dummy-docs (:document/id app) 5) ;; loading state

-                           (empty? app-docs) (dummy-docs (:document/id app) 1) ;; empty state
+                       (empty? app-docs) (dummy-docs (:document/id app) 1) ;; empty state

-                           :else
-                           (->> app-docs
-                             (filter :last-updated-instant)
-                             (sort-by :last-updated-instant)
-                             (reverse)
-                             (take 100)))
+                       :else
+                       (->> app-docs
+                         (filter :last-updated-instant)
+                         (sort-by :last-updated-instant)
+                         (reverse)))
+            display-docs (take 100 all-docs)
             filtered-docs (if (seq (om/get-state owner :doc-filter))
-                            (let [filter-text (str/lower-case (om/get-state owner :doc-filter))]
-                              (filter #(not= -1 (.indexOf (str/lower-case (:document/name %))
-                                                          filter-text))
-                                      display-docs))
+                            (take 100 (let [filter-text (str/lower-case (om/get-state owner :doc-filter))]
+                                        (filter #(not= -1 (.indexOf (str/lower-case (:document/name %))
+                                                                    filter-text))
+                                                all-docs)))
                             display-docs)
             searching? (seq (om/get-state owner :doc-filter))]
         (html
@@ -110,7 +110,7 @@
                        :value (or (om/get-state owner :doc-filter) "")
                        :onChange #(om/set-state! owner :doc-filter (.. % -target -value))}]
               (when searching?
-                [:span (str (count filtered-docs) " of " (count display-docs))])
+                [:span (str (count filtered-docs) " of " (count all-docs))])

               (om/build docs-list filtered-docs)))]])))))


more tests for publish-events

more tests for publish-events

--- clients/clojure/test/samsara/client_test.clj
+++ clients/clojure/test/samsara/client_test.clj
@@ -1,6 +1,7 @@
 (ns samsara.client-test
   (:require [samsara.client2 :refer :all]
-            [midje.sweet :refer :all]))
+            [midje.sweet :refer :all]
+            [samsara.utils :refer [to-json]]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -74,6 +75,7 @@
 ;;                                                                            ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

+
 (defmacro with-mock-send-events [publish & body]
   `(with-redefs [samsara.client2/send-events (fn [& args#] args#)]
      (let [[~'url ~'headers ~'body ~'opts] ~publish]
@@ -82,6 +84,7 @@

 (fact "publish-events: should post the given events to the ingestion-api"

+      ;; successful post of a single event
       (with-mock-send-events
         (publish-events "http://localhost:9000/v1"
                         [{:eventName "a" :timestamp 1 :sourceId "d1"}])
@@ -91,5 +94,17 @@
         headers => (contains {"Content-Type" "application/json"
                               "X-Samsara-publishedTimestamp" anything})

+        body => (to-json [{:eventName "a" :timestamp 1 :sourceId "d1"}] )
+
         )
       )
+
+
+(fact "publish-events: should post the given events to the ingestion-api"
+
+      ;; successful post of a single event
+      (with-mock-send-events
+        (publish-events "http://localhost:9000/v1"
+                        [{:invalid "event"}])
+        ) => (throws Exception)
+      )


updated dependencies

updated dependencies

--- frameworks/Clojure/luminus/hello/project.clj
+++ frameworks/Clojure/luminus/hello/project.clj
@@ -17,9 +17,7 @@
                  [com.taoensso/tower "3.0.2"]
                  [compojure "1.5.0"]
                  [ring-webjars "0.1.1"]
-                 [ring/ring-defaults "0.1.5"]
-                 [ring "1.4.0"
-                  :exclusions [ring/ring-jetty-adapter]]
+                 [ring/ring-defaults "0.2.0"]
                  [mount "0.1.10"]
                  [cprop "0.1.6"]
                  [org.clojure/tools.cli "0.3.3"]


use clojure's builtin into-array fn

use clojure's builtin into-array fn

It looks like byte-seq-to-array is duplicating work that into-array can
do. This commit uses the builtin instead.

Note: I've tested this at the unit level, but as I can't seem to light
up the LEDs on my nanoKONTROL2 I haven't tested that it still works when
integrating with a real device.

--- src/overtone/device/midi/nanoKONTROL2.clj
+++ src/overtone/device/midi/nanoKONTROL2.clj
@@ -128,14 +128,6 @@
                                    :m7 {:note 55}
                                    :r7 {:note 71}}}}}))

-(defn- byte-seq-to-array
-  "Turn a seq of bytes into a native byte-array."
-  [bseq]
-  (let [ary (byte-array (count bseq))]
-    (doseq [i (range (count bseq))]
-      (aset-byte ary i (nth bseq i)))
-    ary))
-
 ;; Magic sysex messages (recorded from Korg Kontrol Editor output)
 (def start-sysex [-16 126 127 6 1 -9])
 (def second-sysex [-16 66 64 0 1 19 0 31 18 0 -9])
@@ -170,12 +162,12 @@
   determined by recording the sysex messages that the official Korg
   Kontrol Editor sends to perform this task.)"
   [nko]
-  (midi-sysex nko (byte-seq-to-array start-sysex))
-  (midi-sysex nko (byte-seq-to-array second-sysex))
-  (midi-sysex nko (byte-seq-to-array start-sysex))
-  (midi-sysex nko (byte-seq-to-array main-sysex))
-  (midi-sysex nko (byte-seq-to-array start-sysex))
-  (midi-sysex nko (byte-seq-to-array end-sysex)))
+  (midi-sysex nko (into-array Byte/TYPE start-sysex))
+  (midi-sysex nko (into-array Byte/TYPE second-sysex))
+  (midi-sysex nko (into-array Byte/TYPE start-sysex))
+  (midi-sysex nko (into-array Byte/TYPE main-sysex))
+  (midi-sysex nko (into-array Byte/TYPE start-sysex))
+  (midi-sysex nko (into-array Byte/TYPE end-sysex)))

 (defn leds-on-test
   [nko]


fix redis config

fix redis config

--- src/pathfinder/redis/expired_listener.clj
+++ src/pathfinder/redis/expired_listener.clj
@@ -25,14 +25,15 @@

 (defn create-listener
   []
+  ;; turn on keyspace notifications
+  (wcar* (car/config-set "notify-keyspace-events" "Ex"))
+  ;; start subscribers
   (car/with-new-pubsub-listener
     (:spec connection)
     {pattern notify-key-expired}
     (car/psubscribe pattern)))

 (defstate expired-listener
-  :start (do
-           (println "Startin expired-listener...")
-           (create-listener))
+  :start (create-listener)
   :stop (when expired-listener
           (car/close-listener expired-listener)))


Update to ClojureScript 1.7.189

Update to ClojureScript 1.7.189

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,6 +1,6 @@
 (defproject planck "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.170"]
+                 [org.clojure/clojurescript "1.7.189"]
                  [tailrecursion/cljson "1.0.7"]
                  [com.cognitect/transit-clj "0.8.275"]
                  [com.cognitect/transit-cljs "0.8.220"]]


CMR-493: Reset port for search.

CMR-493: Reset port for search.

--- src/cmr/system_int_test/utils/url_helper.clj
+++ src/cmr/system_int_test/utils/url_helper.clj
@@ -11,7 +11,7 @@

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

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

 (defn elastic-root
   []


Change the default ordering on projects dashboard.

--- src/uxbox/main/ui/dashboard/projects.cljs
+++ src/uxbox/main/ui/dashboard/projects.cljs
@@ -103,7 +103,7 @@
 (mx/defc menu
   {:mixins [mx/static]}
   [state projects]
-  (let [ordering (:order state :name)
+  (let [ordering (:order state :created)
         filtering (:filter state "")
         count (count projects)]
     (letfn [(on-term-change [event]
@@ -228,7 +228,7 @@
 (mx/defc grid
   {:mixins [mx/static]}
   [state projects]
-  (let [ordering (:order state :name)
+  (let [ordering (:order state :created)
         filtering (:filter state "")
         projects (->> (vals projects)
                       (filter-projects-by filtering)


Correct comment

Correct comment

--- src/shuriken/monkey_patches/syntax_quote.clj
+++ src/shuriken/monkey_patches/syntax_quote.clj
@@ -59,6 +59,7 @@
         (original-macros ch))))

   ;; Step 3: Add (syntax-quote x) -> `(x) translation into clojure.pprint
+  ;;         and translate (unquote-splicing args) to ~@args as well.
   (require 'clojure.pprint)
   (alter-var-root #'clojure.pprint/reader-macros
                   assoc


Deleted a whitespace

Deleted a whitespace

and made a commit for it! What a drama...

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- doc/examples/function-context.clj
+++ doc/examples/function-context.clj
@@ -70,7 +70,7 @@

 (defn antiexchange? [f S]
   (forall [A (subsets S),
-           x S,
+           x S,
            y S]
     (=> (and (not= x y)
              (not (contains? (f A) x))


Remove obsolete var.

Remove obsolete var.

--- src/dsbdp/data_processing_dsl.clj
+++ src/dsbdp/data_processing_dsl.clj
@@ -105,7 +105,6 @@
   (let [input-sym 'input
         offset-sym 'offset
         fn-body-vec (let [rules (:rules dsl-expression)
-                          input-type (:input-type dsl-expression)
                           output-type (:output-type dsl-expression)]
                       (condp = (name output-type)
                         "java-map" (create-data-processing-fn-body-for-java-map-output-type input-sym offset-sym rules)


Use io/resource instead of trying to load cljs ns

--- src/adzerk/boot_cljs.clj
+++ src/adzerk/boot_cljs.clj
@@ -17,7 +17,7 @@
 (defn- cljs-depdendency []
   (let [proj-deps    (core/get-env :dependencies)
         cljs-dep?    (first (filter (comp #{'org.clojure/clojurescript} first) proj-deps))
-        cljs-exists? (guard (do (require 'cljs.build.api) true) false)]
+        cljs-exists? (io/resource "cljs/build/api.clj")]
     (cond
       ; org.clojure/clojurescript in project (non-transitive) deps - do nothing
       cljs-dep?    nil


Name synth types.

Name synth types.

--- src/klangmeister/instruments.cljs
+++ src/klangmeister/instruments.cljs
@@ -28,13 +28,16 @@
 (defn >>> [& nodes]
   (reduce wire nodes))

-(defn oscillate [type freq duration]
+(defn oscillator [type freq duration]
   (fn [at context]
     (doto (.createOscillator context)
       (-> .-frequency .-value (set! freq))
       (-> .-type (set! type))
       (.start at)
       (.stop (+ at duration)))))
+
+(def sin-osc (partial oscillator "sine"))
+(def saw (partial oscillator "sawtooth"))

 (defn destination [at context]
   (.-destination context))
@@ -46,7 +49,7 @@

 (defn bell! [{:keys [time duration pitch]}]
   (let [harmonic (fn [n proportion]
-                   (>>> (oscillate "sine" (* n pitch) 1.5)
+                   (>>> (sin-osc (* n pitch) 1.5)
                         (percuss 0.01 proportion)
                         (volume 0.01)
                         destination))]
@@ -58,7 +61,7 @@
       all)))

 (defn fuzz! [{:keys [duration pitch]}]
-  (>>> (oscillate "sawtooth" pitch 1.5)
+  (>>> (saw pitch 1.5)
        (percuss 0.1 0.5)
        (volume 0.3)
        destination))
@@ -67,7 +70,7 @@
   (let [freqs [pitch (* pitch 1.01) (* pitch 0.99)]
         envelopes [[0.3 0.2] [0.05 0.1] [0.1 0.1]]]
     (->> (map (fn [freq [attack decay]]
-                (>>> (oscillate "sawtooth" freq 1.5)
+                (>>> (saw freq 1.5)
                      (percuss attack decay)
                      (volume 0.05)
                      destination))


don't break closure libs that follow classpath conventions

--- src/main/clojure/cljs/js_deps.clj
+++ src/main/clojure/cljs/js_deps.clj
@@ -212,9 +212,9 @@
    (with-open [reader (io/reader url)]
      (-> reader line-seq parse-js-ns
        (merge
-         {:url url :closure-lib true}
+         {:url url}
          (when lib-path
-           {:lib-path lib-path}))))))
+           {:closure-lib true :lib-path lib-path}))))))

 (defn load-library*
   "Given a path to a JavaScript library, which is a directory


Better name for assert-property fn

Better name for assert-property fn

--- src/assert_json/core.clj
+++ src/assert_json/core.clj
@@ -19,10 +19,11 @@
                    ": expected " value
                    ", found: " m-val)))

-(defn map-has? [m property value]
+(defn assert-property [m property value]
   (let [m-val (has-key m property)]
     (cond (= ::nothing-here m-val) (throw (property-not-found property))
           (not= (type m-val) (type value)) (throw (wrong-property-type property m-val value))
           (not= value m-val) (throw (wrong-property-value property m-val value))
           :default true)))

+