Fix some problems: now all reservations are processed.

--- src/vacation2/main.clj
+++ src/vacation2/main.clj
@@ -69,7 +69,7 @@

 ; HELPER FUNCTIONS

-(defn initialize-data [n-customers n-relations]
+(defn initialize-data [n-customers n-reservations n-relations]
   (letfn [(rand-seats []
             (* (+ (rand 5) 1) 100))
           (rand-price []
@@ -78,21 +78,30 @@
             (for [i (range n-relations)]
               (ref {:id i :seats (rand-seats :price (rand-price))})))]
     {:reservations
-      (for [i (range n-customers)]
+      (for [i (range n-reservations)]
         (ref {:id i :fulfilled? false :total 0}))
      :cars    (generate-relation)
      :flights (generate-relation)
      :rooms   (generate-relation)}))

+(defn zip [& lists]
+  "Zip m lists of n elements into list of n m-tuples.
+
+  > (zip [1 2 3 4] [5 6 7 8] [9 10 11 12])
+  ([1 5 9] [2 6 10] [3 7 11] [4 8 12])
+
+  Based on http://stackoverflow.com/a/2588385/8137"
+  (apply map vector lists))
+
 ; BEHAVIORS

 (def customer-behavior
   (behavior
-    []
-    []
-    (log "start reservation")
-    (dosync
-      (println "TODO"))))
+    [customer-id]
+    [reservation done?]
+    (log "start reservation" (:id @reservation) "by customer" customer-id)
+    ; TODO
+    (deliver done? true)))

 ; MAIN

@@ -102,18 +111,17 @@
     (let [{n-customers    :customers
            n-reservations :reservations
            n-relations    :relations} options
-          n-reservations-per-customer (quot n-reservations n-customers)
           {:keys [reservations cars flights rooms]}
-            (initialize-data n-customers n-relations)
+            (initialize-data n-customers n-reservations n-relations)
           customer-actors
-            (for [i (range n-customers)]
-              (spawn customer-behavior))]
+            (map #(spawn customer-behavior %) (range n-customers))
+          done-promises
+            (repeatedly n-reservations promise)]
       (when (not= (rem n-reservations n-customers) 0)
         (println "WARNING: number of reservations is not divisible by number"
-          "of customers. Using" n-reservations-per-customer "reservations per"
-          "customer, so only" (* n-reservations-per-customer n-customers)
-          "in total."))
-      (doseq [c customer-actors]
-        (dotimes [_i n-reservations-per-customer]
-          (send c)))))
+          "of customers."))
+      (doseq [[customer reservation done?] (zip (cycle customer-actors) reservations done-promises)]
+        (send customer reservation done?))
+      (doseq [done? done-promises]
+        (deref done?))))
   (shutdown-agents))


Make sure acquisition engine is finished before window attempts to close.

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -611,7 +611,7 @@
     (event-fn)
     (await-resume)))

-(defn run-acquisition [this settings out-queue]
+(defn run-acquisition [this settings out-queue cleanup?]
   (try
     (def acq-settings settings)
     (log (str "Starting MD Acquisition: " settings))
@@ -623,7 +623,8 @@
       (let [acq-seq (generate-acq-sequence settings @attached-runnables)]
         (def acq-sequence acq-seq)
         (execute (mapcat #(make-event-fns % out-queue) acq-seq))
-        (cleanup)
+        (when cleanup?
+          (cleanup))
         (.put out-queue TaggedImageQueue/POISON)
         ))
     (catch Throwable t (do (ReportingUtils/showError t "Acquisition failed.")
@@ -777,14 +778,14 @@
     (.addToAlbum gui (make-TaggedImage img))))

-(defn run-acquisition-with-processors [this settings acq-eng]
+(defn run-acquisition-with-processors [this settings acq-eng cleanup?]
   (def last-acq this)
   (def eng acq-eng)
   (swap! (.state this) assoc :stop false :pause false :finished false)
   (let [out-queue (LinkedBlockingQueue. 10)]
     (reset! (.state this) nil)
     (def outq out-queue)
-    (let [acq-thread (Thread. #(run-acquisition this settings out-queue)
+    (let [acq-thread (Thread. #(run-acquisition this settings out-queue cleanup?)
                               "Acquisition Engine Thread (Clojure)")
           processors (ProcessorStack. out-queue (.getTaggedImageProcessors acq-eng))
           out-queue-2 (.begin processors)]
@@ -806,12 +807,12 @@
   (let [acq-eng (.getAcquisitionEngine gui)
         acq-settings (.getSequenceSettings acq-eng)
         settings (convert-settings acq-settings)]
-    (run-acquisition-with-processors this settings acq-eng)))
+    (run-acquisition-with-processors this settings acq-eng true)))

 (defn -run [this acq-settings acq-eng]
   (load-mm)
   (let [settings (convert-settings acq-settings)
-        out-queue-2 (run-acquisition-with-processors this settings acq-eng)]
+        out-queue-2 (run-acquisition-with-processors this settings acq-eng true)]
     (when-not (:stop @(.state this))
       (let [live-acq (LiveAcq. mmc out-queue-2 (:summary-metadata @(.state this))
                                (:save settings) acq-eng gui)]


Remove cljsbuild hook from lein profiles and add noderepl.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -7,13 +7,13 @@
                        [slamhound "1.3.3"]]
         :plugins [[lein-difftest "1.3.7"]
                   [lein-exec "0.3.0"]
+                  [org.bodil/lein-noderepl "0.1.10"]
                   [lein-clojars "0.9.1"]
                   [lein-pprint "1.1.1"]
                   [lein-ring "0.8.0"]
                   [lein-cljsbuild "0.3.2"]
                   [lein-deps-tree "0.1.2"]
                   [lein-marginalia "0.7.1"]]
-        :hooks [leiningen.cljsbuild]
         :repl-options {:timeout 120000}
         :injections [(require '[redl core complete])
                      (require 'spyscope.core)


Plugin upgrades

Plugin upgrades

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -37,7 +37,7 @@
 ;;                     (require 'spyscope.core)
                      ]
         :plugins [
-                    [lein-virgil "0.1.7"] ; auto-recompile and reload .java files from :java-source-paths into the REPL
+                    [lein-virgil "0.1.8"] ; auto-recompile and reload .java files from :java-source-paths into the REPL
                     [lein-libdir "0.1.1"] ; dependencies to ./lib/
                     ;[cider/cider-nrepl "0.9.1"]
                     ;[refactor-nrepl "1.1.0"]
@@ -75,8 +75,8 @@
  }
  :repl {:dependencies [;[zcaudate/lucid.aether "1.4.4"]
                        ;[zcaudate/lucid.core.inject "1.4.4"]
-                       [zcaudate/lucid.core.debug "1.4.4"]
-                       [zcaudate/lucid.package "1.4.4"]
+                       [zcaudate/lucid.core.debug "1.4.7"]
+                       [zcaudate/lucid.package "1.4.7"]
                        ;; needed for ns reload (i.e. resetting; see clojure.tools.namespace.reload [Clojure only as of 0.3.0alpha4)
                        [org.clojure/tools.namespace "0.3.0-alpha4"]]
         :plugins [[com.gfredericks/lein-shorthand "0.4.1"]]


Use lazy maps in optimise.descent

Use lazy maps in optimise.descent

This obviates the need to call 'force' yourself when using outputf (the
same sort of gotcha as your having to pass 'requests' when using outputf
in the original think.recommend version.

--- cortex/src/cortex/optimise/descent.clj
+++ cortex/src/cortex/optimise/descent.clj
@@ -104,16 +104,20 @@
          initial-step true]
     (let [function (cp/update-parameters function params)
           gradient (cp/gradient function)
-          state (merge
-                  {:params params
-                   :value (delay (cp/output function))
-                   :gradient gradient
-                   :optimiser optimiser
-                   :initial-step initial-step}
-                  (if-not initial-step
-                    (merge
-                      (cp/get-state optimiser)
-                      {:last-step (delay (- params last-params))})))]
+          state (util/->lazy-map
+                  (merge
+                    (if-not initial-step
+                      (merge
+                        ;; This *needs* to be first, because lazy maps will be coerced
+                        ;; to regular maps if they appear in the tail of a merge, and
+                        ;; the map returned by get-state might be lazy.
+                        (cp/get-state optimiser)
+                        {:last-step (delay (- params last-params))}))
+                    {:params params
+                     :value (delay (cp/output function))
+                     :gradient gradient
+                     :optimiser optimiser
+                     :initial-step initial-step}))]
       (if-not (terminate? state)
         (let [optimiser (cp/compute-parameters optimiser gradient params)
               new-params (cp/parameters optimiser)]
@@ -135,7 +139,7 @@
       optimiser
       initial-params
       (fn [state]
-        (swap! log* conj (util/map-vals force state))
+        (swap! log* conj (util/force-map state))
         (terminate? state)))
     @log*))

@@ -191,7 +195,7 @@
   [terminate? cutoff params]
   (fn [state]
     (or (terminate? state)
-        (<= (m/distance (- (force (:params state))
+        (<= (m/distance (- (:params state)
                            params))
             cutoff))))

@@ -199,14 +203,14 @@
   [terminate? cutoff]
   (fn [state]
     (or (terminate? state)
-        (<= (force (:value state))
+        (<= (:value state)
             cutoff))))

 (defn limit-gradient
   [terminate? cutoff]
   (fn [state]
     (or (terminate? state)
-        (<= (m/magnitude (force (:gradient state)))
+        (<= (m/magnitude (:gradient state))
             cutoff))))

 ;;;; I/O
@@ -222,8 +226,7 @@
   (fn [state]
     (apply util/sprintf fmt
            (for [arg args]
-             (force
-               (arg state))))
+             (arg state)))
     (flush)
     (terminate? state)))

@@ -240,10 +243,10 @@
   (outputf terminate?
            "f = % .8e, |grad| = % .8e, |dx| = % .8e%n"
            :value
-           (comp m/magnitude force :gradient)
+           (comp m/magnitude :gradient)
            (fn [state]
              (if-not (:initial-step state)
-               (m/magnitude (force (:last-step state)))
+               (m/magnitude (:last-step state))
                Double/NaN))))

 (defn pause


use timbre on client-side instead of js/console

--- src/chat/client/s3.cljs
+++ src/chat/client/s3.cljs
@@ -2,6 +2,7 @@
   (:require [cljs-uuid-utils.core :as uuid]
             [clojure.string :refer [split]]
             [goog.events :as events]
+            [taoensso.timbre :as timbre :refer-macros [errorf]]
             [chat.client.xhr :refer [edn-xhr ajax-xhr]]
             [chat.client.views.helpers :refer [ends-with?]])
   (:import [goog.net XhrIo EventType]))
@@ -11,8 +12,7 @@
     {:method :get
      :uri "/s3-policy"
      :on-error (fn [err]
-                 (.error js/console "Error getting s3 authorization: "
-                         (pr-str (:error err))))
+                 (errorf "Error getting s3 authorization: %s" (:error err)))
      :on-complete
      (fn [{:keys [bucket auth]}]
        (let [file-name (.-name file)
@@ -30,4 +30,4 @@
                             (.append "Content-Type" (.-type file))
                             (.append "file" file file-name))
                     :on-complete (fn [e] (on-complete file-url))
-                    :on-error (fn [e] (.error js/console "Error uploading: " (pr-str (:error e))))})))}))
+                    :on-error (fn [e] (errorf "Error uploading: %s" (:error e)))})))}))


add _ping

add _ping

--- src/clj_docker/core.clj
+++ src/clj_docker/core.clj
@@ -5,7 +5,10 @@
             [clj-docker.image :as image]
             [slingshot.slingshot :refer [try+]]))

-(def make-client clj-docker.client/make-client)
+(def make-client client/make-client)
+
+(defn ping [cli]
+  (client/get cli "/_ping" {}))

 (defn version [cli]
   (client/get cli "/version" {:as :json}))


Fix description of convert command

Fix description of convert command

--- src/cljam/tools/cli.clj
+++ src/cljam/tools/cli.clj
@@ -82,19 +82,15 @@
 ;; ### convert command

 (def ^:private convert-cli-options
-  [["-if" "--input-format FORMAT" "Input file format <auto|sam|bam>"
-    :default "auto"]
-   ["-of" "--output-format FORMAT" "Output file format <auto|sam|bam>"
-    :default "auto"]
-   ["-t" "--thread THREAD" "Number of threads (0 is auto)"
+  [["-t" "--thread THREAD" "Number of threads (0 is auto)"
     :default 0
     :parse-fn #(Integer/parseInt %)]
    ["-h" "--help" "Print help"]])

 (defn- convert-usage [options-summary]
-  (->> ["Convert SAM to BAM or BAM to SAM."
-        ""
-        "Usage: cljam convert [-if FORMAT] [-of FORMAT] [-t THREAD] <in.bam|sam> <out.bam|sam>"
+  (->> ["Convert file format based on the file extension."
+        ""
+        "Usage: cljam convert [-t THREAD] <in-file> <out-file>"
         ""
         "Options:"
         options-summary]
@@ -381,7 +377,7 @@
                      "Usage: cljam {view,convert,normalize,sort,index,pileup,faidx,dict,level,version} ..."
                      :options  [["-h" "--help" "Show help" :default false :flag true]]
                      :commands [["view"    "Extract/print all or sub alignments in SAM or BAM format."]
-                                ["convert" "Convert SAM to BAM or BAM to SAM."]
+                                ["convert" "Convert file format based on the file extension."]
                                 ["normalize" "Normalize references of alignments."]
                                 ["sort"    "Sort alignments by leftmost coordinates."]
                                 ["index"   "Index sorted alignment for fast random access."]


Update react documentation links in intro.cljs

Most importantly, the keys link stopped resolving to anything useful.

--- demo/reagentdemo/intro.cljs
+++ demo/reagentdemo/intro.cljs
@@ -112,9 +112,9 @@
 (defn intro []
   (let [github {:href "https://github.com/reagent-project/reagent"}
         clojurescript {:href "https://github.com/clojure/clojurescript"}
-        react {:href "http://facebook.github.io/react/"}
+        react {:href "https://reactjs.org/"}
         hiccup {:href "https://github.com/weavejester/hiccup"}
-        dynamic-children {:href "http://facebook.github.io/react/docs/multiple-components.html#dynamic-children"}]
+        react-keys {:href "https://reactjs.org/docs/lists-and-keys.html#keys"}]
     [:div.demo-text

      [:h2 "Introduction to Reagent"]
@@ -168,7 +168,7 @@
      and helps React to improve performance for large lists. The key
      can be given either (as in this example) as meta-data, or as a "
      [:code ":key"] " item in the first argument to a component (if it
-     is a map). See React’s " [:a dynamic-children "documentation"] "
+     is a map). See React’s " [:a react-keys "documentation"] "
      for more info."]]))

 (defn managing-state []


Ooops. Delete experimental leftover.

Ooops. Delete experimental leftover.

--- src/cljs/reagent_toolbox_docs/components/list.cljs
+++ src/cljs/reagent_toolbox_docs/components/list.cljs
@@ -3,39 +3,6 @@
 (ns reagent-toolbox-docs.components.list
   (:require [reagent-toolbox-docs.layout :as layout]
             [reagent-toolbox-docs.ui :as ui]))
-
-(defn list-test []
-  (let [notify-new-comics (reagent.ratom/atom false)]
-    (fn []
-      [:div
-       [reagent-toolbox.core/list {:selectable true
-                                   :ripple     true}
-        [reagent-toolbox.core/list-sub-header {:caption "Explore characters"}]
-        [reagent-toolbox.core/list-item {:avatar     "http://vignette1.wikia.nocookie.net/watchmen/images/7/7c/Doctor_Manhattan_%28movie%29.jpg"
-                                         :caption    "Dr. Manhattan"
-                                         :legend     "Jonathan 'Jon' Osterman"
-                                         :right-icon "star"}]
-
-        [reagent-toolbox.core/list-item {:avatar     "http://vignette1.wikia.nocookie.net/watchmen/images/5/5b/Ozymandias.jpg"
-                                         :caption    "Ozymandias"
-                                         :legend     "Adrian veidt"
-                                         :right-icon "star"}]
-
-        [reagent-toolbox.core/list-item {:avatar     "http://vignette3.wikia.nocookie.net/watchmen/images/6/64/Rorschach.jpg"
-                                         :caption    "Rorschach"
-                                         :legend     "Walter Joseph Kovacs"
-                                         :right-icon "star"}]
-
-        [reagent-toolbox.core/list-sub-header {:caption "Configuration"}]
-        [reagent-toolbox.core/list-checkbox {:caption   "Notify new comics"
-                                             :legend    "You will receive a notification when a new one is published"
-                                             :checked   @notify-new-comics
-                                             :on-change #(reset! notify-new-comics %)}]
-        [reagent-toolbox.core/list-divider]
-        [reagent-toolbox.core/list-item {:caption   "Contact the publisher"
-                                         :left-icon "send"}]
-        [reagent-toolbox.core/list-item {:caption   "Remove this publication"
-                                         :left-icon "delete"}]]])))

 (defn view []
   (fn []


Refer clojure.repl/source

Refer clojure.repl/source

--- clojure/lein.symlink/profiles.clj
+++ clojure/lein.symlink/profiles.clj
@@ -16,6 +16,7 @@
                   [lein-swank "1.4.4"]]

         :injections [(require 'spyscope.core
+                              '[clojure.repl :refer [source]]
                               '[criterium.core :refer [bench quick-bench]])]

         :aliases {"slamhound" ["run" "-m" "slam.hound"]}


bumps version to 1.49.1-SNAPSHOT

bumps version to 1.49.1-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.49.0"
+(defproject cook "1.49.1-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Format ugen metadata

Format ugen metadata

--- src/overtone/sc/machinery/ugen/metadata/demand.clj
+++ src/overtone/sc/machinery/ugen/metadata/demand.clj
@@ -2,198 +2,400 @@
   (:use [overtone.sc.machinery.ugen common check]))

 (def specs
-     [
-      {:name "Demand",
-       :args [{:name "trig" :doc "Can be any signal. A trigger happens when the signal changes from non-positive to positive."}
-              {:name "reset" :default 0 :doc "Resets the list of ugens when triggered."}
-              {:name "demand-ugens", :mode :append-sequence-set-num-outs :doc "list of demand rate ugens"}],
-       :check [(arg-is-demand-ugen-or-list-of-demand-ugens? :demand-ugens) ]
-       :auto-rate true
-       :doc "On every trigger it demands the next value from each of the demand ugens passed as args.  Used to pull values from the other demand rate ugens.
-
-By design, a reset trigger only resets the demand ugens; it does not reset the value at Demand's output. Demand continues to hold its value until the next value is demanded, at which point its output value will be the first expected item in the list."}
-
-      {:name "Duty",
-       :args [{:name "dur", :default 1.0}
-              {:name "reset", :default 0.0}
-              {:name "action", :default 0 :doc "Default: NO-ACTION"}
-              {:name "level", :default 1.0}]
-       :check (fn [rate num-outs [dur reset & _] spec]
-                (if (and (dr? dur)
-                         (not (or (dr? reset)
-                                  (ir? reset)
-                                  (rate= reset rate))))
-                  (format "Duration argument must be demand rate, and the reset must be either a constant or demand rate.  (dur: %s, reset: %s)" dur reset)))
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the duty cgen instead."}
-
-      {:name "TDuty" :extends "Duty"
-       :args [{:name "dur", :default 1.0}
-              {:name "reset", :default 0.0}
-              {:name "action", :default 0 :doc "Default: NO-ACTION"}
-              {:name "level", :default 1.0}
-              {:name "gapFirst", :default 0}]
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the tduty cgen instead."}
-
-      {:name "DemandEnvGen",
-       :args [{:name "level" :doc "demand ugen (or other ugen) returning level values"}
-              {:name "dur" :doc "demand ugen (or other ugen) returning time values"}
-              {:name "shape", :default 1 :doc "demand ugen (or other ugen) returning shape number - the number given is the shape number"}
-              {:name "curve", :default 0 :doc "demand ugen (or other ugen) returning curve values -  if shape is 5, this is the curve factor. Thee possible values are: 0 - flat segments, 1 - linear segments, the default, 2 - natural exponential growth and decay. In this case, the levels must all be nonzero and the have the same sign, 3 - sinusoidal S shaped segments, 4 - sinusoidal segments shaped like the sides of a Welch window, a Float - a curvature value for all segments, an Array of Floats - curvature values for each segments."
-               }
-              {:name "gate", :default 1.0 :doc "control rate gate if gate is x >= 1, the ugen runs, if gate is 0 > x > 1, the ugen is released at the next level (doneAction), if gate is x <= 0, the ugen is sampled end held"}
-              {:name "reset", :default 1.0 :doc "if reset crosses from nonpositive to positive, the ugen is reset at the next level. If it is > 1, it is reset immediately."}
-              {:name "levelScale", :default 1.0 :doc "demand ugen returning level scaling values"}
-              {:name "levelBias", :default 0.0 :doc "demand ugen returning level offset values"}
-              {:name "timeScale", :default 1.0 :doc "demand ugen returning time scaling values"}
-              {:name "action", :default 0 :doc "Default: NO-ACTION"}]
-;;       :init (fn [rate [l d s c gate reset ls lb ts da] spec]
-;;               (if (or (ar? gate) (ar? reset))
-;;                 [l d s c (as-ar gate) (as-ar reset) ls lb ts da]))
-       :doc "Plays back break point envelope contours (levels, times, shapes) given by demand ugens. The next values are called when the next node is reached."}
-
-      ;; DUGen : UGen {
-      ;;  init { arg ... argInputs;
-      ;;    super.init(*argInputs);
-      ;;    this.forceAudioRateInputsIntoUGenGraph;
-      ;;  }
-      ;;  forceAudioRateInputsIntoUGenGraph {
-      ;;      inputs.do { |in| if(in.rate == \audio) { in <! 0 } }; }
-      ;;
-      ;;    // some n-ary op special cases
-      ;;
-      ;;    linlin { arg inMin, inMax, outMin, outMax, clip=\minmax;
-      ;;        ^((this.prune(inMin, inMax, clip)-inMin)/(inMax-inMin) * (outMax-outMin) + outMin);
-      ;;  }
-      ;;
-      ;;  linexp { arg inMin, inMax, outMin, outMax, clip=\minmax;
-      ;;    ^(pow(outMax/outMin, (this-inMin)/(inMax-inMin)) * outMin)
-      ;;      .prune(inMin, inMax, clip);
-      ;;  }
-      ;;
-      ;;  explin { arg inMin, inMax, outMin, outMax, clip=\minmax;
-      ;;    ^(log(this.prune(inMin, inMax, clip)/inMin))
-      ;;      / (log(inMax/inMin)) * (outMax-outMin) + outMin
-      ;;  }
-      ;;
-      ;;  expexp { arg inMin, inMax, outMin, outMax, clip=\minmax;
-      ;;    ^pow(outMax/outMin, log(this.prune(inMin, inMax, clip/inMin) / log(inMax/inMin)) * outMin)
-      ;;  }
-      ;; }
-      ;; TODO understand forceAudioRateInputsIntoUGenGraph
-      ;; which is implemented in the pseudo-ugen DUGen parent of below
-
-      {:name "Dseries",
-       :args [{:name "length", :default Float/POSITIVE_INFINITY :doc "Default: positive infinity."}
-              {:name "start" :default 1}
-              {:name "step" :default 1}]
-       :rates #{:dr}
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dseries cgen instead."}
-
-      {:name "Dgeom",
-       :args [{:name "length", :default Float/POSITIVE_INFINITY :doc "Default: positive infinity"}
-              {:name "start", :default 1}
-              {:name "grow", :default 2}]
-       :rates #{:dr}
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dgeom cgen instead."}
-
-      {:name "Dbufrd",
-       :args [{:name "bufnum", :default 0.0, :doc "buffer number to read from"}
-              {:name "phase", :default 0.0, :doc "index into the buffer"}
-              {:name "loop", :default 1.0, :doc "when phase exceeds number of frames in buffer, loops when set to 1"}],
-       :rates #{:dr}
-       :doc "Read values from a buffer on demand, using phase (index) value that is also pulled on demand. All inputs can be either demand ugen or any other ugen."}
-
-      {:name "Dbufwr",
-       :args [{:name "bufnum", :default 0}
-              {:name "phase", :default 0.0}
-              {:name "input", :default 0.0}
-              {:name "loop", :default 1.0}],
-       :rates #{:dr}
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dbufwr cgen instead."}
-
-      {:name "Dseq",
-       :args [{:name "list", :mode :append-sequence, :array true, :doc "array of values or other ugens"}
-              {:name "num-repeats", :default 1, :doc "number of repeats"}],
-       :rates #{:dr}
-       :doc "Demand rate sequence generator. Outputs a sequence of values, possibly repeating multiple times. Use INF as a repeat val to create an endless loop."}
-
-      {:name "Dser"
-       :args [{:name "list", :mode :append-sequence, :array true :doc "array of values or other ugens"}
-              {:name "count", :default 1 :doc "number of values to return"}],
-       :doc "Demand rate sequence generator. Generates a sequence of values Like dseq, except outputs only count total values, rather than repeating."
-       :rates #{:dr}}
-
-      {:name "Dshuf" :extends "Dseq"
-       :doc "Demand rate random sequence generator. Shuffle a sequence once and then output it one or more times."}
-
-      {:name "Drand" :extends "Dseq"
-       :doc "Demand rate random sequence generator. Generate a random ordering of an input sequence."}
-
-      {:name "Dxrand" :extends "Dseq"
-       :doc "Demand rate random sequence generator. Generate a random ordering of the given sequence without repeating any element until all elements have been returned."}
-
-      {:name "Dswitch1",
-       :args [{:name "list", :mode :append-sequence, :array true :doc "array of values or other ugens"}
-              {:name "index" :doc "which of the inputs to return"}],
-       :rates #{:dr}
-       :doc "A demand rate switch that can be used to select one of multiple demand rate inputs."}
-
-      {:name "Dswitch" :extends "Dswitch1"
-       :doc "A demand rate switch. In difference to Dswitch1, Dswitch embeds all items of an input demand ugen first before looking up the next index."}
-
-      {:name "Dwhite",
-       :args [
-              {:name "length", :default Float/POSITIVE_INFINITY :doc "Default: positive infinity" }
-              {:name "lo", :default 0.0 }
-              {:name "hi", :default 1.0 }
-]
-       :rates #{:dr}
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dwhite cgen instead."}
-
-      {:name "Diwhite" :extends "Dwhite"
-       :doc "This ugen has been internalised for scserver compatibility. Please use the diwhite cgen instead."}
-
-      {:name "Dbrown",
-       :args [{:name "length", :default Float/POSITIVE_INFINITY :doc "Default: positive infinity"}
-              {:name "lo", :default 0.0}
-              {:name "hi", :default 1.0}
-              {:name "step", :default 0.01 }
-]
-       :rates #{:dr}
-       :internal-name true
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dbrown cgen instead."}
-
-      {:name "Dibrown" :extends "Dbrown"
-       :doc "This ugen has been internalised for scserver compatibility. Please use the dibrown cgen instead."}
-
-      {:name "Dstutter",
-       :args [{:name "num-repeats" :doc "number of repeats (can be a demand ugen)"}
-              {:name "in" :doc "input ugen"}],
-       :rates #{:dr}
-       :check (nth-input-stream? 1)
-       :doc "Replicates input values n times on demand.  Both inputs can be demand rate ugens."}
-
-      {:name "Donce",
-       :args [{:name "in"}],
-       :rates #{:dr}}
-
-      {:name "Dpoll",
-       :args [{:name "in" :doc "demand ugen to poll values from"}
-              {:name "trig-id" :default -1
-               :doc "if greater than 0, a '/tr' message is sent back to the client (similar to SendTrig)"}
-              {:name "label" :doc "a label string" :default "dpoll-val" :mode :append-string}
-              {:name "run", :default 1.0 :doc "activation switch 0 or 1 (can be a demand ugen)"}
-],
-       :rates #{:dr}
-       :check (nth-input-stream? 0)
-       :doc "Print the value of an input demand ugen. The print-out is in the form: label: value block offset: offset.
-
-WARNING: Printing values from the Server in intensive for the CPU. Poll should be used for debugging purposes.
-"}
-      ])
+  [
+   {:name "Demand",
+    :args [{:name "trig"
+            :doc "Can be any signal. A trigger happens when the signal
+                  changes from non-positive to positive." }
+
+           {:name "reset"
+            :default 0
+            :doc "Resets the list of ugens when triggered."}
+
+           {:name "demand-ugens"
+            :mode :append-sequence-set-num-outs
+            :doc "list of demand rate ugens"}]
+
+    :check [(arg-is-demand-ugen-or-list-of-demand-ugens? :demand-ugens) ]
+    :auto-rate true
+    :doc "On every trigger it demands the next value from each of the
+          demand ugens passed as args.  Used to pull values from the
+          other demand rate ugens.
+
+          By design, a reset trigger only resets the demand ugens; it
+          does not reset the value at Demand's output. Demand continues
+          to hold its value until the next value is demanded, at which
+          point its output value will be the first expected item in the
+          list." }
+
+
+   {:name "Duty",
+    :args [{:name "dur"
+            :default 1.0}
+
+           {:name "reset"
+            :default 0.0}
+
+           {:name "action"
+            :default 0
+            :doc "Default: NO-ACTION"}
+
+           {:name "level"
+            :default 1.0}]
+
+    :check (fn [rate num-outs [dur reset & _] spec]
+             (if (and (dr? dur)
+                      (not (or (dr? reset)
+                               (ir? reset)
+                               (rate= reset rate))))
+               (format "Duration argument must be demand rate, and the
+                        reset must be either a constant or demand
+                        rate.  (dur: %s, reset: %s)" dur reset)))
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the duty cgen instead." }
+
+
+   {:name "TDuty" :extends "Duty"
+    :args [{:name "dur"
+            :default 1.0}
+
+           {:name "reset"
+            :default 0.0}
+
+           {:name "action"
+            :default 0
+            :doc "Default: NO-ACTION"}
+
+           {:name "level"
+            :default 1.0}
+
+           {:name "gapFirst"
+            :default 0}]
+
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the tduty cgen instead." }
+
+
+   {:name "DemandEnvGen",
+    :args [{:name "level"
+            :doc "demand ugen (or other ugen) returning level values"}
+
+           {:name "dur"
+            :doc "demand ugen (or other ugen) returning time values"}
+
+           {:name "shape"
+            :default 1
+            :doc "demand ugen (or other ugen) returning shape number -
+                  the number given is the shape number"}
+
+           {:name "curve"
+            :default 0
+            :doc "demand ugen (or other ugen) returning curve values -
+                  if shape is 5, this is the curve factor. Thee possible
+                  values are: 0 - flat segments, 1 - linear segments,
+                  the default, 2 - natural exponential growth and
+                  decay. In this case, the levels must all be nonzero
+                  and the have the same sign, 3 - sinusoidal S shaped
+                  segments, 4 - sinusoidal segments shaped like the
+                  sides of a Welch window, a Float - a curvature value
+                  for all segments, an Array of Floats - curvature
+                  values for each segments." }
+
+           {:name "gate"
+            :default 1.0
+            :doc "control rate gate if gate is x >= 1, the ugen runs, if
+                  gate is 0 > x > 1, the ugen is released at the next
+                  level (doneAction), if gate is x <= 0, the ugen is
+                  sampled end held"}
+
+           {:name "reset"
+            :default 1.0
+            :doc "if reset crosses from nonpositive to positive, the
+                  ugen is reset at the next level. If it is > 1, it is
+                  reset immediately." }
+
+           {:name "levelScale"
+            :default 1.0
+            :doc "demand ugen returning level scaling values"}
+
+           {:name "levelBias"
+            :default 0.0
+            :doc "demand ugen returning level offset values"}
+
+           {:name "timeScale"
+            :default 1.0
+            :doc "demand ugen returning time scaling values"}
+
+           {:name "action"
+            :default 0
+            :doc "Default: NO-ACTION"}]
+    ;;TODO: Figure out if this init fn is useful in any way
+    ;;       :init (fn [rate [l d s c gate reset ls lb ts da] spec]
+    ;;               (if (or (ar? gate) (ar? reset))
+    ;;                 [l d s c (as-ar gate) (as-ar reset) ls lb ts da]))
+    :doc "Plays back break point envelope contours (levels, times,
+          shapes) given by demand ugens. The next values are called when
+          the next node is reached." }
+
+   ;; DUGen : UGen {
+   ;;  init { arg ... argInputs;
+   ;;    super.init(*argInputs);
+   ;;    this.forceAudioRateInputsIntoUGenGraph;
+   ;;  }
+   ;;  forceAudioRateInputsIntoUGenGraph {
+   ;;      inputs.do { |in| if(in.rate == \audio) { in <! 0 } }; }
+   ;;
+   ;;    // some n-ary op special cases
+   ;;
+   ;;    linlin { arg inMin, inMax, outMin, outMax, clip=\minmax;
+   ;;        ^((this.prune(inMin, inMax, clip)-inMin)/(inMax-inMin) * (outMax-outMin) + outMin);
+   ;;  }
+   ;;
+   ;;  linexp { arg inMin, inMax, outMin, outMax, clip=\minmax;
+   ;;    ^(pow(outMax/outMin, (this-inMin)/(inMax-inMin)) * outMin)
+   ;;      .prune(inMin, inMax, clip);
+   ;;  }
+   ;;
+   ;;  explin { arg inMin, inMax, outMin, outMax, clip=\minmax;
+   ;;    ^(log(this.prune(inMin, inMax, clip)/inMin))
+   ;;      / (log(inMax/inMin)) * (outMax-outMin) + outMin
+   ;;  }
+   ;;
+   ;;  expexp { arg inMin, inMax, outMin, outMax, clip=\minmax;
+   ;;    ^pow(outMax/outMin, log(this.prune(inMin, inMax, clip/inMin) / log(inMax/inMin)) * outMin)
+   ;;  }
+   ;; }
+   ;; TODO: understand forceAudioRateInputsIntoUGenGraph
+   ;; which is implemented in the pseudo-ugen DUGen parent of below
+
+
+   {:name "Dseries",
+    :args [{:name "length"
+            :default Float/POSITIVE_INFINITY
+            :doc "Default: positive infinity."}
+
+           {:name "start"
+            :default 1}
+
+           {:name "step"
+            :default 1}]
+
+    :rates #{:dr}
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dseries cgen instead."}
+
+
+   {:name "Dgeom",
+    :args [{:name "length"
+            :default Float/POSITIVE_INFINITY
+            :doc "Default: positive infinity"}
+
+           {:name "start"
+            :default 1}
+
+           {:name "grow"
+            :default 2}]
+
+    :rates #{:dr}
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dgeom cgen instead."}
+
+
+   {:name "Dbufrd",
+    :args [{:name "bufnum"
+            :default 0.0
+            :doc "buffer number to read from"}
+
+           {:name "phase"
+            :default 0.0
+            :doc "index into the buffer"}
+
+           {:name "loop"
+            :default 1.0
+            :doc "when phase exceeds number of frames in buffer, loops
+                  when set to 1"}],
+    :rates #{:dr}
+    :doc "Read values from a buffer on demand, using phase (index) value
+          that is also pulled on demand. All inputs can be either demand
+          ugen or any other ugen." }
+
+
+   {:name "Dbufwr",
+    :args [{:name "bufnum"
+            :default 0}
+
+           {:name "phase"
+            :default 0.0}
+
+           {:name "input"
+            :default 0.0}
+
+           {:name "loop"
+            :default 1.0}]
+
+    :rates #{:dr}
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dbufwr cgen instead." }
+
+
+   {:name "Dseq",
+    :args [{:name "list"
+            :mode :append-sequence,
+            :array true
+            :doc "array of values or other ugens"}
+
+           {:name "num-repeats"
+            :default 1
+            :doc "number of repeats"}]
+
+    :rates #{:dr}
+    :doc "Demand rate sequence generator. Outputs a sequence of values,
+          possibly repeating multiple times. Use INF as a repeat val to
+          create an endless loop." }
+
+
+   {:name "Dser"
+    :args [{:name "list"
+            :mode :append-sequence
+            :array true
+            :doc "array of values or other ugens"}
+
+           {:name "count"
+            :default 1
+            :doc "number of values to return"}],
+
+    :rates #{:dr}
+    :doc "Demand rate sequence generator. Generates a sequence of values
+          like dseq, except outputs only count total values, rather than
+          repeating."}
+
+
+   {:name "Dshuf" :extends "Dseq"
+    :doc "Demand rate random sequence generator. Shuffle a sequence once
+         and then output it one or more times." }
+
+
+   {:name "Drand" :extends "Dseq"
+    :doc "Demand rate random sequence generator. Generate a random
+          ordering of an input sequence." }
+
+
+   {:name "Dxrand" :extends "Dseq"
+    :doc "Demand rate random sequence generator. Generate a random
+          ordering of the given sequence without repeating any element
+          until all elements have been returned." }
+
+
+   {:name "Dswitch1",
+    :args [{:name "list"
+            :mode :append-sequence
+            :array true :doc "array of values or other ugens"}
+
+           {:name "index"
+            :doc "which of the inputs to return"}]
+
+    :rates #{:dr}
+    :doc "A demand rate switch that can be used to select one of
+          multiple demand rate inputs." }
+
+
+   {:name "Dswitch" :extends "Dswitch1"
+    :doc "A demand rate switch. In difference to Dswitch1, Dswitch
+          embeds all items of an input demand ugen first before looking
+          up the next index." }
+
+
+   {:name "Dwhite",
+    :args [
+           {:name "length"
+            :default Float/POSITIVE_INFINITY
+            :doc "Default: positive infinity" }
+
+           {:name "lo"
+            :default 0.0 }
+
+           {:name "hi"
+            :default 1.0 }]
+
+    :rates #{:dr}
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dwhite cgen instead." }
+
+
+   {:name "Diwhite" :extends "Dwhite"
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the diwhite cgen instead." }
+
+
+   {:name "Dbrown",
+    :args [{:name "length"
+            :default Float/POSITIVE_INFINITY
+            :doc "Default: positive infinity"}
+
+           {:name "lo"
+            :default 0.0}
+
+           {:name "hi"
+            :default 1.0}
+
+           {:name "step"
+            :default 0.01}]
+    :rates #{:dr}
+    :internal-name true
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dbrown cgen instead." }
+
+
+   {:name "Dibrown" :extends "Dbrown"
+    :doc "This ugen has been internalised for scserver
+          compatibility. Please use the dibrown cgen instead." }
+
+
+   {:name "Dstutter",
+    :args [{:name "num-repeats"
+            :doc "number of repeats (can be a demand ugen)"}
+
+           {:name "in"
+            :doc "input ugen"}]
+
+    :rates #{:dr}
+    :check (nth-input-stream? 1)
+    :doc "Replicates input values n times on demand.  Both inputs can be
+          demand rate ugens." }
+
+
+   {:name "Donce",
+    :args [{:name "in"}],
+    :rates #{:dr}}
+
+
+   {:name "Dpoll",
+    :args [{:name "in"
+            :doc "demand ugen to poll values from"}
+
+           {:name "trig-id"
+            :default -1
+            :doc "if greater than 0, a '/tr' message is sent back to the
+                  client (similar to SendTrig)"}
+
+           {:name "label"
+            :default "dpoll-val"
+            :mode :append-string
+            :doc "a label string"}
+
+           {:name "run"
+            :default 1.0
+            :doc "activation switch 0 or 1 (can be a demand ugen)"}]
+    :rates #{:dr}
+    :check (nth-input-stream? 0)
+    :doc "Print the value of an input demand ugen. The print-out is in
+          the form: label: value block offset: offset.
+
+          WARNING: Printing values from the Server in intensive for the
+          CPU. Poll should be used for debugging purposes."}])


clojureise envgen ugen argnames

clojureise envgen ugen argnames

--- src/overtone/sc/machinery/ugen/metadata/envgen.clj
+++ src/overtone/sc/machinery/ugen/metadata/envgen.clj
@@ -44,9 +44,9 @@
        :args [{:name "envelope" :mode :append-sequence :doc "an Array of Controls."}
               {:name "gate", :default 1.0 :doc "this triggers the envelope and holds it open while > 0. If the Env is fixed-length (e.g. Env.linen, Env.perc), the gate argument is used as a simple trigger. If it is an sustaining envelope (e.g. Env.adsr, Env.asr), the envelope is held open until the gate becomes 0, at which point is released.
 "}
-              {:name "levelScale", :default 1.0 :doc "scales the levels of the breakpoints."}
-              {:name "levelBias", :default 0.0 :doc "offsets the levels of the breakpoints."}
-              {:name "timeScale", :default 1.0 :doc "scales the durations of the segments."}
+              {:name "level-scale", :default 1.0 :doc "scales the levels of the breakpoints."}
+              {:name "level-bias", :default 0.0 :doc "offsets the levels of the breakpoints."}
+              {:name "time-scale", :default 1.0 :doc "scales the durations of the segments."}
               {:name "action", :default 0 :doc "an integer representing an action to be executed when the env is finished playing. This can be used to free the enclosing synth, etc."}]
        :doc "envelope generator, interpolates across a path of control points over time, see the overtone.sc.envelope functions to generate the control points array

@@ -58,9 +58,9 @@

       {:name "Linen",
        :args [{:name "gate", :default 1.0 :doc "Input trigger"}
-              {:name "attackTime", :default 0.01 :doc "Time taken to rise to susLevel in seconds"}
-              {:name "susLevel", :default 1.0 :doc "Level to hold the envelope at until gate is triggered"}
-              {:name "releaseTime", :default 1.0 :doc "Time to fall from susLevel back to 0 after the gate has been triggered"}
+              {:name "attack-time", :default 0.01 :doc "Time taken to rise to susLevel in seconds"}
+              {:name "sus-level", :default 1.0 :doc "Level to hold the envelope at until gate is triggered"}
+              {:name "release-time", :default 1.0 :doc "Time to fall from susLevel back to 0 after the gate has been triggered"}
               {:name "action", :default 0 :doc "done action"}],
        :rates #{:kr}
        :doc "A linear envelope generator, rises to susLevel over attackTime seconds and after the gate goes non-positive falls over releaseTime to finally perform an option doneAction"}


[#214] clean up logic

[#214] clean up logic

--- api/src/clojure/org/akvo/flow_api/middleware/anomaly.clj
+++ api/src/clojure/org/akvo/flow_api/middleware/anomaly.clj
@@ -11,14 +11,11 @@
         (anomaly/handle e)))))

 (defn translate-exception [e]
-  (if-not (.getMessage e)
-    (throw e)
-    (if (or (.contains (.getMessage e) "Over Quota")
-          (.contains (.getMessage e) "required more quota"))
-      (an/too-many-requests "This application is temporarily over its serving quota." {})
-      (if (.contains (.getMessage e) "Please try again in 30 seconds")
-        (an/bad-gateway "The server encountered an error and could not complete your request. Please try again in 30 seconds." {})
-        (throw e)))))
+  (condp #(.contains %2 %1) (or (.getMessage e) "")
+    "Over Quota" (an/too-many-requests "This application is temporarily over its serving quota." {})
+    "required more quota" (an/too-many-requests "This application is temporarily over its serving quota." {})
+    "Please try again in 30 seconds" (an/bad-gateway "The server encountered an error and could not complete your request. Please try again in 30 seconds." {})
+    (throw e)))

 (defn wrap-log-errors [handler]
   (fn [request]


Fixing scroll to bottom on ui v2.

Fixing scroll to bottom on ui v2.

--- src-cljs/frontend/components/build_steps.cljs
+++ src-cljs/frontend/components/build_steps.cljs
@@ -51,6 +51,9 @@
         (html
          [:span {:dangerouslySetInnerHTML
                  #js {"__html" trailing-out}}])))))
+
+(defn scroll-to-bottom [element]
+  (.scrollIntoView element false))

 (defn action [action owner {:keys [uses-parallelism?] :as opts}]
   (reify
@@ -108,8 +111,7 @@
                    [:div.action-log-messages
                     (common/messages (:messages action))
                     [:i.click-to-scroll.fa.fa-arrow-circle-o-down.pull-right
-                     {:on-click #(let [target (.-parentNode (.-currentTarget %))]
-                                   (.scrollIntoView target false))}]
+                     {:on-click #(scroll-to-bottom (.-parentNode (.-currentTarget %)))}]

                     (when (:bash_command action)
                       [:span
@@ -298,11 +300,7 @@
                    [:div.action-log-messages
                     (common/messages (:messages action))
                     [:i.click-to-scroll.fa.fa-arrow-circle-o-down.pull-right
-                     {:on-click #(let [node (om/get-node owner)
-                                       body (.-body js/document)]
-                                   (set! (.-scrollTop body) (- (+ (.-y (goog.style/getRelativePosition node body))
-                                                                  (.-height (goog.style/getSize node)))
-                                                               (.-height (goog.dom/getViewportSize)))))}]
+                     {:on-click #(scroll-to-bottom (.-parentNode (.-currentTarget %)))}]
                     (when (:bash_command action)
                       [:span
                        (when (:exit_code action)


add space in Merge PR button text

add space in Merge PR button text

--- src-cljs/frontend/components/pages/build.cljs
+++ src-cljs/frontend/components/pages/build.cljs
@@ -80,7 +80,7 @@
          [:div.rebuild-container
           [:button.rebuild {:on-click #(raise! owner [:merge-pull-request-clicked (build-model/merge-args build pull-request-number)])}
            [:i.octicon.octicon-git-merge.rebuild-icon]
-           (str "Merge PR#" pull-request-number)]])))))
+           (str "Merge PR #" pull-request-number)]])))))

 (defn- header-actions
   [data owner]


fix french tests

fix french tests

--- test/babel/test/fr.clj
+++ test/babel/test/fr.clj
@@ -42,9 +42,9 @@
                                           :sem {:pred :avere
                                                 :subj {:pred :I}}}}
                                 small)]
-    (and (is (not (nil? result)))
-         (is (= "av" (get-in result [:head :français :imperfect-stem])))
-         (is (= "j'avais" (fo result))))))
+    (is (not (nil? result)))
+    (is (= "av" (get-in result [:head :français :imperfect-stem])))
+    (is (= "j'avais" (fo result)))))

 (deftest être-as-aux
   (let [lexicon (:lexicon @small)
@@ -140,7 +140,7 @@
                           {:synsem {:subcat '()}}
                           {:synsem {:sem {:subj {:pred :noi
                                                  :gender :fem}
-                                          :pred :andare
+                                          :pred :go
                                           :aspect :perfect
                                           :tense :past}}})
          (:grammar @small)
@@ -151,7 +151,7 @@
          (is (= (fo result) "nous sommes allées")))))

 (deftest passe-compose
-  (let [result (engine/generate {:synsem {:sem {:pred :andare
+  (let [result (engine/generate {:synsem {:sem {:pred :go
                                                 :subj {:pred :noi
                                                        :gender :fem}
                                                 :aspect :perfect


Disable stack traces

Disable stack traces

They take way too long to load on mobile devices
and when paired with Parinfer (which requires
calls into ClojureScript) things can more easily
appear to be locked up to the user.

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -190,18 +190,22 @@
   ([error include-stacktrace?]
    (let [cause (.-cause error)]
      (println (.-message cause))
-     (when include-stacktrace?
-       (load-core-source-maps!)
-       (let [canonical-stacktrace (st/parse-stacktrace
-                                    {}
-                                    (.-stack cause)
-                                    {:ua-product :safari}
-                                    {:output-dir "file://(/goog/..)?"})]
-         (println
-           (mapped-stacktrace-str
-             canonical-stacktrace
-             (or (:source-maps @st) {})
-             nil)))))))
+     ;; For now, disable stack traces because they take too long to load and
+     ;; when paired with Parinfer (which requires calls into ClojureScript)
+     ;; things can more easily appear to be locked up to the user.
+     (comment
+       (when include-stacktrace?
+         (load-core-source-maps!)
+         (let [canonical-stacktrace (st/parse-stacktrace
+                                      {}
+                                      (.-stack cause)
+                                      {:ua-product :safari}
+                                      {:output-dir "file://(/goog/..)?"})]
+           (println
+             (mapped-stacktrace-str
+               canonical-stacktrace
+               (or (:source-maps @st) {})
+               nil))))))))

 (defn get-var
   [env sym]


t-sweet had a syntax error that prevented it from being run

--- test/midje/t_sweet.clj
+++ test/midje/t_sweet.clj
@@ -11,7 +11,7 @@
             [midje.data.compendium :as compendium])
   ;; Following is for testing the use of vars to fake private functions
   ;; in another namespace.
-  (:require midje.data.t-prerequisite-state)
+  (:require midje.data.t-prerequisite-state))

 (fact "all of Midje's public, API-facing vars have docstrings"
   (map str (remove (comp :doc meta) (vals (ns-publics 'midje.sweet)))) => []
@@ -338,9 +338,9 @@
   (var-inc-local (var-inc-local 2)))

 (fact "can fake private remote-namespace functions using vars"
-  (#'midje.internal-ideas.t-fakes/var-inc-user 2) => 400
-  (provided
-    (#'midje.internal-ideas.t-fakes/var-inc 2) => 200))
+  (#'midje.data.t-prerequisite-state/var-inc-user 2) => 400
+  (provided
+    (#'midje.data.t-prerequisite-state/var-inc 2) => 200))

 (fact "and can fake local functions using vars"
   (#'var-inc-user-local 2) => 400
@@ -349,9 +349,9 @@

 (fact "default prerequisites work with vars"
   (config/with-augmented-config {:partial-prerequisites true}
-    (#'midje.internal-ideas.t-fakes/var-twice) => 201
+    (#'midje.data.t-prerequisite-state/var-twice) => 201
     (provided
-      (#'midje.internal-ideas.t-fakes/var-inc 2) => 200)))
+      (#'midje.data.t-prerequisite-state/var-inc 2) => 200)))

 ;;; Unfolded prerequisites

@@ -361,30 +361,30 @@
    (var-inc-local (var-inc-local 2))  => 201))

 (defn here-and-there []
-  (var-inc-local (#'midje.internal-ideas.t-fakes/var-inc 2)))
+  (var-inc-local (#'midje.data.t-prerequisite-state/var-inc 2)))

 (fact "vars also work with unfolded prerequisites"
   (here-and-there) => 201
   (provided
-   (var-inc-local (#'midje.internal-ideas.t-fakes/var-inc 2)) => 201))
+   (var-inc-local (#'midje.data.t-prerequisite-state/var-inc 2)) => 201))

 (defn there-and-here []
-  (#'midje.internal-ideas.t-fakes/var-inc (var-inc-local 2)))
+  (#'midje.data.t-prerequisite-state/var-inc (var-inc-local 2)))

 (fact "vars also work with unfolded prerequisites"
   (there-and-here) => 201
   (provided
-   (#'midje.internal-ideas.t-fakes/var-inc (var-inc-local 2)) => 201))
+   (#'midje.data.t-prerequisite-state/var-inc (var-inc-local 2)) => 201))

 (defn over-there-over-there-spread-the-word-to-beware []
-  (#'midje.internal-ideas.t-fakes/var-inc
-   (#'midje.internal-ideas.t-fakes/var-inc 2)))
+  (#'midje.data.t-prerequisite-state/var-inc
+   (#'midje.data.t-prerequisite-state/var-inc 2)))

 (fact "vars also work with unfolded prerequisites"
   (over-there-over-there-spread-the-word-to-beware) => 201
   (provided
-   (#'midje.internal-ideas.t-fakes/var-inc
-    (#'midje.internal-ideas.t-fakes/var-inc 2)) => 201))
+   (#'midje.data.t-prerequisite-state/var-inc
+    (#'midje.data.t-prerequisite-state/var-inc 2)) => 201))

  (fact "exceptions do not blow up"
    (odd? "foo") => (throws Exception)


Remove unned files

Remove unned files

--- sort.clj
+++ sort.clj
@@ -1,3 +0,0 @@
-(ns bigsorter)
-
-


+grammar; english/lexicon == english.lexicon/lexicon


delay loading of mmc

delay loading of mmc

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -8,11 +8,10 @@
            [java.awt Color Dimension Font Insets]
            [java.awt.event KeyAdapter MouseAdapter]
            [com.swtdesigner SwingResourceManager])
-  (:use [clooj.utils :only (constrain-to-parent attach-action-key)]
+  (:use [org.micromanager.browser.utils
+            :only (constrain-to-parent attach-action-key)]
         [clojure.contrib.json :only (read-json)]
         [org.micromanager.mm :only (load-mm gui)]))
-
-(load-mm)

 (defn get-search-icon []
   (SwingResourceManager/getIcon
@@ -135,6 +134,7 @@
 (def default-headings ["CurrentPath" "Time" "Frames" "Comment"])

 (defn start-browser []
+  (load-mm)
   (-> (get-summary-maps "/Users/arthur/qqq")
     (create-table-model default-headings)
     create-browser))


Layout manager #41

Layout manager #41


Set GZIP to maximum compression

Set GZIP to maximum compression

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/dar/write.clj
+++ src/obcc/dar/write.clj
@@ -20,7 +20,7 @@
            [org.apache.commons.io.output ByteArrayOutputStream ProxyOutputStream]
            [org.apache.commons.compress.compressors.bzip2 BZip2CompressorOutputStream]
            [org.apache.commons.compress.compressors.xz XZCompressorOutputStream]
-           [java.util.zip GZIPOutputStream]
+           [org.apache.commons.compress.compressors.gzip GzipCompressorOutputStream GzipParameters]
            [lzma.streams LzmaOutputStream$Builder])
   (:require [flatland.protobuf.core :as fl]
             [clojure.java.io :as io]
@@ -51,7 +51,7 @@
 ;;--------------------------------------------------------------------------------------
 (def compressors
   {"none" #(ProxyOutputStream. %)
-   "gzip" #(GZIPOutputStream. %)
+   "gzip" #(let [params (GzipParameters.)] (.setCompressionLevel params 9) (GzipCompressorOutputStream. % params))
    "lzma" #(-> (LzmaOutputStream$Builder. %) .build)
    "bzip2" #(BZip2CompressorOutputStream. %)
    "xz" #(XZCompressorOutputStream. % 6)


Stemming to search index.

Stemming to search index.

--- src/ontrail/search.clj
+++ src/ontrail/search.clj
@@ -53,7 +53,7 @@

 (defn to-term-seq [^String words]
   (if (string? words)
-    (filter valid-term? (re-seq re-term (to-lower (strip-html words))))
+    (map stem (filter valid-term? (re-seq re-term (to-lower (strip-html words)))))
     []))

 (defn exercise-to-terms [exercise]
@@ -163,7 +163,7 @@
 (defn search-wrapper [query]
   (let [query-string (:q query)
         page (page-or-default query)
-        terms (filter valid-term? (re-seq re-term (to-lower query-string)))]
+        terms (map stem (filter valid-term? (re-seq re-term (to-lower query-string))))]
     (if (> (count terms) 0)
       (let [res (search terms page)]
         {:results (:results res) :searchSummary (format-summary res terms query-string)})


oops, forgot import

oops, forgot import

--- src/pump/template.cljs
+++ src/pump/template.cljs
@@ -1,4 +1,5 @@
-(ns pump.template)
+(ns pump.template
+  (:require  [clojure.string :as string]))

 (declare as-content)


Fix prosemirror isCode patch

Fix prosemirror isCode patch

--- re_view_prosemirror/src/re_view_prosemirror/markdown.cljs
+++ re_view_prosemirror/src/re_view_prosemirror/markdown.cljs
@@ -47,14 +47,11 @@
                                        (.renderList state node "    " (fn []
                                                                         (str (or (.. node -attrs -bullet) "*") " "))))})

-(defn patch-inline-code-mark
-  "WARNING: this is a patch that will become redundant after the upstream bug is fixed."
-  [schema]
-  (doto schema (aset "marks" "code" "__proto__" "isCode" true)))

 (def schema (-> markdown-schema
-                (patch-inline-code-mark)
-                (cond-> *tables?* (tables/add-schema-nodes))))
+                (cond-> *tables?* (tables/add-schema-nodes))
+                ;; WARNING: this is a brittle patch that will become redundant after the upstream bug is fixed.
+                (doto (aset "marks" "code" "isCode" true))))

 (def ^js/pmMarkdown.MarkdownSerializer serializer (MarkdownSerializer (merge {}
                                                                              (when *tables?*


fix tests broken in last commit

fix tests broken in last commit

--- src/babel/latin.cljc
+++ src/babel/latin.cljc
@@ -178,13 +178,13 @@
                                               :agr (get-in spec [:synsem :agr])}}}
         debug (log/debug (str "read-one: source-specification:" source-specification))
         question-to-pose-to-user
-        (babel.english/morph (babel.english/generate source-specification
-                                                     :model source-model
-                                                     :truncate-children false)
+        (babel.english/morph (babel.generate/generate source-specification
+                                                      source-model)
+                             source-model
                              :show-notes false) ;; TODO: use {:from-language :la}
         parses (filter #(empty? (get-in % [:synsem :subcat]))
                        (babel.english/parse
-                        question-to-pose-to-user false)) ;; false: don't truncate
+                        question-to-pose-to-user source-model false)) ;; false: don't truncate
         source-expressions parses
         target-specs
         (map (fn [parse]


* benchmark/cljs/benchmark_runner.cljs: reduce vector bench

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -39,6 +39,12 @@
        (recur (inc i) (conj! v i))))))
 (println)

+(println ";;; (def v (into [] (range 1000000)))")
+(println ";;; (reduce + v)")
+(def v (into [] (range 1000000)))
+(time (reduce + v))
+(println)
+
 (println ";;; map / record ops")
 (simple-benchmark [coll {:foo 1 :bar 2}] (get coll :foo) 1000000)
 (simple-benchmark [coll {:foo 1 :bar 2}] (-lookup coll :foo nil) 1000000)


help text formatting

help text formatting

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -18,9 +18,7 @@
 ;; Tasks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (core/deftask help
-  "Print usage info and list available tasks.
-
-  Here is some other stuff."
+  "Print usage info and list available tasks."
   []
   (core/with-pre-wrap
     (let [tasks (#'helpers/available-tasks 'boot.user)
@@ -50,7 +48,7 @@
         ├── <theme-name>_success.mp3
         └── <theme-name>_warning.mp3

-   Sound files specified individually take precedence over theme sounds."
+  Sound files specified individually take precedence over theme sounds."

   [t theme NAME   str "The notification sound theme."
    s success FILE str "The sound file to play when the build is successful."


Add docstring to ISpec protocol.

Add docstring to ISpec protocol.

--- src/bytebuf/spec.clj
+++ src/bytebuf/spec.clj
@@ -9,6 +9,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defprotocol ISpec
+  "Basic abstraction for something that can be work like a Spec."
   (read [_ buff start] "Read all data from buffer.")
   (write [_ buff start data] "Read all data from buffer."))


skip project-eval if there is not classloader

--- src/cake/project.clj
+++ src/cake/project.clj
@@ -83,28 +83,29 @@

 (defn project-eval [ns-forms bindings body]
   (reload)
-  (let [[let-bindings object-bindings] (separate-bindings bindings)
-        temp-ns (gensym "bake")
-        form
-        `(do (ns ~temp-ns
-               (:use ~'cake)
-               ~@ns-forms)
-             (fn [ins# outs# ~@(keys object-bindings)]
-               (try
-                 (clojure.main/with-bindings
-                   (bake.io/with-streams ins# outs#
-                     (binding ~(shared-bindings)
-                       (let ~(quote-if odd? let-bindings)
-                         ~@body))))
-                 (finally
-                  (remove-ns '~temp-ns)))))]
-    (try (apply eval-in classloader
-                `(clojure.main/with-bindings (eval '~form))
-                *ins* *outs* (vals object-bindings))
-         (catch Throwable e
-           (println "error evaluating:")
-           (prn body)
-           (throw e)))))
+  (when classloader
+    (let [[let-bindings object-bindings] (separate-bindings bindings)
+          temp-ns (gensym "bake")
+          form
+          `(do (ns ~temp-ns
+                 (:use ~'cake)
+                 ~@ns-forms)
+               (fn [ins# outs# ~@(keys object-bindings)]
+                 (try
+                   (clojure.main/with-bindings
+                     (bake.io/with-streams ins# outs#
+                       (binding ~(shared-bindings)
+                         (let ~(quote-if odd? let-bindings)
+                           ~@body))))
+                   (finally
+                    (remove-ns '~temp-ns)))))]
+      (try (apply eval-in classloader
+                  `(clojure.main/with-bindings (eval '~form))
+                  *ins* *outs* (vals object-bindings))
+           (catch Throwable e
+             (println "error evaluating:")
+             (prn body)
+             (throw e))))))

 (defmacro bake
   "Execute code in a your project classloader. Bindings allow passing state to the project


Fix bug on stop http-kit server.

Fix bug on stop http-kit server.

--- src/clj/pfrt/web.clj
+++ src/clj/pfrt/web.clj
@@ -21,7 +21,7 @@

   (stop [_ system]
     (let [stopfn (deref webserver)]
-      (@stopfn)
+      (stopfn)
       system)))

 (defn web-server


Fixed ERRORs in function ordering. Added TODO comments for create-commit function

--- src/clj_git/core.clj
+++ src/clj_git/core.clj
@@ -86,12 +86,6 @@
           (.write wrtr bdata))
         (unset-writable filepath)))
     filepath))
-
-(defn write-tree [tree-struct]
-  (-> tree-struct
-      (tree-data)
-      (byte-array)
-      (write-object)))

 (defn write-blob [text]
   (write-object (str "blob " (count text) "\0" text)))
@@ -133,6 +127,12 @@
         data (concat header-bs body)
         ]
     data))
+
+(defn write-tree [tree-struct]
+  (-> tree-struct
+      (tree-data)
+      (byte-array)
+      (write-object)))

 (defn hash-tree [tree-struct]
   (->> tree-struct
@@ -206,10 +206,10 @@
         (conj out e)
         (recur (f-entry r) (conj out e))))))

-(def commit blob)
-
 (defn blob [hash-hex]
   (to-str (second (read-object hash-hex))))
+
+(def commit blob)

 (defn branch [b]
   (let [filepath (str (git-root) "refs/heads/" b)]
@@ -381,9 +381,10 @@

 ; Creates a new commit object (and all required tree objects)
 ; from the current index
+; TODO: Update the index, HEAD and branch after creating objects!
 (defn create-commit [message parent-hash]
   (let [[tree-hash tree-structs] (index-to-tree-objects)
-        timestamp (str (current-unix-time) " +0000")
+        timestamp (str (current-unix-time) " +0000") ; TODO: Use current timezone
         text (str "tree " tree-hash "\n"
                   "parent " parent-hash "\n"
                   "author " (get-author) " " timestamp "\n"
@@ -392,3 +393,4 @@
                   message "\n")]
     (doseq [e tree-structs] (write-tree (:contents e)))
     (write-commit text)))
+


upgrades to jetty version 9.4.19.v20190610 (#797)

--- waiter/project.clj
+++ waiter/project.clj
@@ -41,7 +41,7 @@
                  [io.grpc/grpc-core "1.20.0"
                   :exclusions [com.google.guava/guava]
                   :scope "test"]
-                 [twosigma/jet "0.7.10-20190610_212308-g550b820"
+                 [twosigma/jet "0.7.10-20190612_154727-g9cb249e"
                   :exclusions [org.mortbay.jetty.alpn/alpn-boot]]
                  [twosigma/clj-http "1.0.2-20180124_201819-gcdf23e5"
                   :exclusions [commons-codec commons-io org.clojure/tools.reader potemkin slingshot]]


Reorganize tests so all the ones that have to do with item10 are together

--- test/app/test/core.clj
+++ test/app/test/core.clj
@@ -159,6 +159,24 @@
                           type-solver-classes))]
     (is (hierarchy-overrides-toString? type-solver-classes cl))))

+(deftest testClassWhoseParentsOverrideToString
+  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
+        cl (first (filter #(= (.getName %) "ClassWhoseParentOverridesToString")
+                          type-solver-classes))]
+    (is (hierarchy-overrides-toString? type-solver-classes cl))))
+
+(deftest testClassThatDeclaresToStringWithParams
+  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
+        cl (first (filter #(= (.getName %) "ClassThatDeclaresToStringWithParams")
+                          type-solver-classes))]
+    (is (false? (hierarchy-overrides-toString? type-solver-classes cl)))))
+
+(deftest testClassThatDoesNotOverrideToString
+  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
+        cl (first (filter #(= (.getName %) "ClassThatDoesNotOverrideToString")
+                          type-solver-classes))]
+    (is (false? (hierarchy-overrides-toString? type-solver-classes cl)))))
+
 (deftest test-getAllSuperclasses-depth-0
   (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
         cl (first (filter #(= (.getName %) "ParentClassThatOverridesToString") type-solver-classes))]
@@ -174,25 +192,6 @@
       (let [superclasses (getAllSuperclasses cl)]
         (is (= 1 (count superclasses)))))))

-
-(deftest testClassWhoseParentsOverrideToString
-  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
-        cl (first (filter #(= (.getName %) "ClassWhoseParentOverridesToString")
-                          type-solver-classes))]
-    (is (hierarchy-overrides-toString? type-solver-classes cl))))
-
-(deftest testClassThatDeclaresToStringWithParams
-  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
-        cl (first (filter #(= (.getName %) "ClassThatDeclaresToStringWithParams")
-                          type-solver-classes))]
-    (is (false? (hierarchy-overrides-toString? type-solver-classes cl)))))
-
-(deftest testClassThatDoesNotOverrideToString
-  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
-        cl (first (filter #(= (.getName %) "ClassThatDoesNotOverrideToString")
-                          type-solver-classes))]
-    (is (false? (hierarchy-overrides-toString? type-solver-classes cl)))))
-
 ; =============================================================
 ; Command parser
 ; =============================================================


Version 0.3.2-SNAPSHOT

Version 0.3.2-SNAPSHOT

--- metlog-vault/project.clj
+++ metlog-vault/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-vault "0.3.1"
+(defproject metlog-vault "0.3.2-SNAPSHOT"
   :description "Repository for long term storage of series data."

   :license {:name "Eclipse Public License"


WIP adds functionality to collect build jobs

--- kuona-api/test/kuona_api/core/collector/jenkins_test.clj
+++ kuona-api/test/kuona_api/core/collector/jenkins_test.clj
@@ -148,3 +148,54 @@
                (c "http://foo/bar") => {:result "foo"}
                (provided
                  (http/get "http://foo/bar/api/json" {}) => {:body (generate-string {:result :foo})}))))
+
+(def workflow-job-class
+  "org.jenkinsci.plugins.workflow.job.WorkflowJob")
+
+(defn workflow-job? [job]
+  (= (:_class job) workflow-job-class))
+
+(facts "about workflow jobs"
+       (fact
+         (workflow-job? {}) => false)
+       (fact
+         (workflow-job? {:_class workflow-job-class}) => true))
+
+(defn build-job [job]
+  (cond
+    (workflow-job? job) (select-keys job [:name :url])
+    :else nil))
+
+(facts
+  (fact
+    (build-job {}) => nil)
+  (fact (let [valid-job-spec {:_class workflow-job-class
+                              :name   "some_name"
+                              :url    "job_url"
+                              }
+              job-def        {:name "some_name"
+                              :url  "job_url"
+                              }]
+          (build-job valid-job-spec) => job-def)))
+
+(defn read-jobs [job]
+  (concat [] (map build-job (:jobs job))))
+
+(facts "about reading build jobs"
+       (let [valid-job-spec {:_class workflow-job-class
+                             :name   "some_name"
+                             :url    "job_url"
+                             }
+             job-def        {:name "some_name"
+                             :url  "job_url"
+                             }]
+         (fact "job collections"
+               (read-jobs {}) => []
+               (read-jobs {:jobs []}) => []
+               (read-jobs {:jobs [valid-job-spec]}) => [job-def]
+               )
+         (fact
+           (read-jobs {:jobs [valid-job-spec]}) => [job-def]
+
+           ))
+       )


Simplify error callback

Simplify error callback

--- src/app/cljs/one/repmax/datastore_configuration/observer.cljs
+++ src/app/cljs/one/repmax/datastore_configuration/observer.cljs
@@ -39,7 +39,7 @@
     (dispatch/fire :action {:action :datastore-configuration/collections-verified, :configuration config})
     (mongo/create-collection config "exercises" ;; TODO Get collection name from elsewhere
                              #(dispatch/fire :action {:action :datastore-configuration/collections-verified, :configuration config})
-                             #(dispatch/fire :action {:action :datastore-configuration/initialization-failed, :configuration config}))))
+                             #(initialization-error-callback config %))))

 (defn contains-collection? [collections collection-name]
   (some #(= collection-name (% "name")) collections))


BigQuery test fix :wrench: [ci drivers]

BigQuery test fix :wrench: [ci drivers]

--- src/metabase/query_processor/middleware/annotate_and_sort.clj
+++ src/metabase/query_processor/middleware/annotate_and_sort.clj
@@ -35,7 +35,8 @@
   [qp]
   (fn [query]
     (let [results (qp query)]
-      (if-not (or (qputil/mbql-query? query)
-                  (:annotate? results))
-        (infer-column-types results)
-        (annotate/annotate-and-sort query results)))))
+      (-> (if-not (or (qputil/mbql-query? query)
+                      (:annotate? results))
+            (infer-column-types results)
+            (annotate/annotate-and-sort query results))
+          (dissoc :annotate?)))))


CMR-1199: Refactored multimethod into normal one.

Simplified logic to not need to support xml elements and strings in
ingest repsonse xml parsing.

--- system-int-test/src/cmr/system_int_test/utils/ingest_util.clj
+++ system-int-test/src/cmr/system_int_test/utils/ingest_util.clj
@@ -133,22 +133,14 @@
       {:errors errors :path path})
     (first (:content elem))))

-(defmulti parse-xml-error-response-elem
+(defn- parse-xml-error-response-elem
   "Parse an xml error response element"
-  (fn [elem]
-    (type elem)))
-
-(defmethod parse-xml-error-response-elem clojure.data.xml.Element
   [elem]
   (let [{:keys [tag content]} elem
         expanded-content (map parse-xml-error-response-elem content)]
     (if (= :error tag)
       (parse-xml-error-elem elem)
       {tag expanded-content})))
-
-(defmethod parse-xml-error-response-elem java.lang.String
-  [elem]
-  elem)

 (defmulti parse-ingest-response-as
   "Parse the ingest response as a given format"


Little change in buttons

Little change in buttons

--- src/airhead_frontend/components.cljs
+++ src/airhead_frontend/components.cljs
@@ -49,12 +49,12 @@
 (defn playlist-add-button [track]
   [:button.add
    {:on-click #(req/playlist-add! (:uuid track))}
-   "+"])
+   "[+]"])

 (defn playlist-remove-button [track]
   [:button.remove
    {:on-click #(req/playlist-remove! (:uuid track))}
-   "-"])
+   "[-]"])

 (defn track-tr [track action-button]
   [:tr.track


Expose keys from the Immutant/JBoss registry [IMMUTANT-358]

--- namespaces/common/src/main/clojure/immutant/registry.clj
+++ namespaces/common/src/main/clojure/immutant/registry.clj
@@ -46,3 +46,14 @@
   (or (clojure.core/get @registry name) (get-from-msc name)))

 (def ^{:doc "Deprecated; use get instead" :no-doc true} fetch #'get)
+
+(defn service-names
+  "Return the JBoss MSC service names"
+  []
+  (map (memfn getCanonicalName) (.getServiceNames @msc-registry)))
+
+(defn keys
+  "Return all the keys in the registry"
+  []
+  (concat (clojure.core/keys @registry)
+          (service-names)))


form-decode: encoding defaults to "UTF-8"

--- ring-core/src/ring/util/codec.clj
+++ ring-core/src/ring/util/codec.clj
@@ -42,16 +42,18 @@

 (defn form-decode
   "Parse parameters from a string into a map."
-  [^String param-string encoding]
-  (reduce
-    (fn [param-map encoded-param]
-      (if-let [[_ key val] (re-matches #"([^=]+)=(.*)" encoded-param)]
-        (assoc-param param-map
-          (url-decode key encoding)
-          (url-decode (or val "") encoding))
-         param-map))
-    {}
-    (string/split param-string #"&")))
+  ([^String param-string]
+     (form-decode param-string "UTF-8"))
+  ([^String param-string encoding]
+     (reduce
+      (fn [param-map encoded-param]
+        (if-let [[_ key val] (re-matches #"([^=]+)=(.*)" encoded-param)]
+          (assoc-param param-map
+                       (url-decode key encoding)
+                       (url-decode (or val "") encoding))
+          param-map))
+      {}
+      (string/split param-string #"&"))))

 (defn form-encode
   "Encode parameters from a map into a string."


Fix occasionally-failing test

Fix occasionally-failing test

The assertion that shrinking reduces the sum of elements is only
true if the collection doesn't have zeros.

--- src/test/clojure/clojure/test/check/test.cljc
+++ src/test/clojure/clojure/test/check/test.cljc
@@ -385,7 +385,7 @@
   (prop/for-all [g gen-distinct-generator
                  seed gen-seed
                  size (gen/choose 1 20)]
-    (let [rose-tree (gen/call-gen (g (gen/choose 0 1000))
+    (let [rose-tree (gen/call-gen (g (gen/choose 1 1000))
                                   (random/make-random seed) size)
           a-shrink (->> rose-tree
                         (iterate #(first (rose/children %)))


(PDB-2617) Add with-historical-catalogs-enabled

Add a with-historical-catalogs-enabled test macro that ensures that
historical catalogs are enabled as specified for the duration of its
body.  Then use it in historical-catalogs-storage-test to make sure we
revert to the original "historical catalog state" after the test.

--- test/puppetlabs/puppetdb/scf/storage_test.clj
+++ test/puppetlabs/puppetdb/scf/storage_test.clj
@@ -459,71 +459,82 @@
 (def certname (:certname catalog))
 (def current-time (str (now)))

+(defmacro with-historical-catalogs-enabled [limit & body]
+  `(let [orig-limit# @historical-catalogs-limit
+         orig-jsonb-setting# @store-catalogs-jsonb-columns?]
+     (try
+       (reset! historical-catalogs-limit ~limit)
+       (reset! store-catalogs-jsonb-columns? true)
+       ~@body
+       (finally
+         (reset! historical-catalogs-limit orig-limit#)
+         (reset! store-catalogs-jsonb-columns? orig-jsonb-setting#)))))
+
 (deftest-db historical-catalogs-storage-test
-  (add-certname! "basic.catalogs.com")
-
-  (reset! historical-catalogs-limit 3)
-  (reset! store-catalogs-jsonb-columns? true)
-  (testing "stores JSONB resources and edges fields"
-    (store-catalog! (assoc catalog :producer_timestamp (-> 2 days ago)) (now))
-    (is (= [{:count 1}]
-           (query-to-vec [(str "SELECT COUNT(*) FROM catalogs WHERE resources IS NOT NULL"
-                               " AND edges IS NOT NULL")])))
-    (is (= #{{:source_type "Class" :source_title "foobar"
-              :target_type "File" :target_title "/etc/foobar"
-              :relationship "contains"}
-             {:source_type "Class" :source_title "foobar"
-              :target_type "File" :target_title "/etc/foobar/baz"
-              :relationship "contains"}
-             {:source_type "File" :source_title "/etc/foobar"
-              :target_type "File" :target_title "/etc/foobar/baz"
-              :relationship "required-by"}}
-           (->> (query-to-vec [(str "SELECT edges FROM catalogs")])
-                (mapcat (comp sutils/parse-db-json :edges))
-                set)))
-    (is (= #{{:type "Class" :title "foobar" :exported false
-              :tags #{"class" "foobar"} :file nil :line nil :parameters {}}
-             {:type "File" :title "/etc/foobar" :exported false
-              :file "/tmp/foo" :line 10 :tags #{"file" "class" "foobar"}
-              :parameters {:ensure "directory" :group "root" :user "root"}}
-             {:type "File" :title "/etc/foobar/baz" :exported false
-              :file "/tmp/bar" :line 20 :tags #{"file" "class" "foobar"}
-              :parameters {:ensure "directory" :group "root" :user "root"
-                           :require "File[/etc/foobar]"}}}
-           (->> (query-to-vec [(str "SELECT resources FROM catalogs")])
-                (mapcat (comp sutils/parse-db-json :resources))
-                (map #(update % :tags set))
-                set))))
-
-  (testing "stores a second catalog"
-    (store-catalog! (assoc catalog :producer_timestamp current-time) (now))
-    (is (= [{:count 2}]
-           (query-to-vec ["SELECT COUNT(*) FROM catalogs"]))))
-
-  (testing "storing an older catalog doesn't change the latest id"
-    (store-catalog! (assoc catalog :producer_timestamp (-> 1 days ago)) (now))
-    (is (= [{:count 3}]
-           (query-to-vec ["SELECT COUNT(*) FROM catalogs"])))
-
-    (is (= [{:producer_timestamp (to-timestamp current-time)}]
-           (query-to-vec [(str "SELECT catalogs.producer_timestamp FROM certnames"
-                               " JOIN latest_catalogs ON certnames.id = latest_catalogs.certname_id"
-                               " JOIN catalogs ON catalogs.id = latest_catalogs.catalog_id"
-                               " WHERE certnames.certname = 'basic.catalogs.com'")]))))
-
-  (testing "only stores up to three catalogs a certname"
-    (store-catalog! (assoc catalog :producer_timestamp (-> 3 days ago)) (now))
-    (store-catalog! (assoc catalog :producer_timestamp (-> 4 days ago)) (now))
-    (store-catalog! (assoc catalog :producer_timestamp (-> 5 days ago)) (now))
-    (store-catalog! (assoc catalog :producer_timestamp (-> 6 days ago)) (now))
-    (is (= [{:count 3}] (query-to-vec ["SELECT COUNT(*) FROM catalogs"]))))
-
-  (testing "storing a new certname doesn't delete other certname's catalogs"
-    (add-certname! "bar.bazz.com")
-    (store-catalog! (assoc catalog
-                           :certname "bar.bazz.com"
-                           :producer_timestamp (-> 1 days ago)) (now))
-    (is (= [{:count 4}] (query-to-vec ["SELECT COUNT(*) FROM catalogs"])))))
+  (with-historical-catalogs-enabled 3
+
+    (add-certname! "basic.catalogs.com")
+
+    (testing "stores JSONB resources and edges fields"
+      (store-catalog! (assoc catalog :producer_timestamp (-> 2 days ago)) (now))
+      (is (= [{:count 1}]
+             (query-to-vec [(str "SELECT COUNT(*) FROM catalogs WHERE resources IS NOT NULL"
+                                 " AND edges IS NOT NULL")])))
+      (is (= #{{:source_type "Class" :source_title "foobar"
+                :target_type "File" :target_title "/etc/foobar"
+                :relationship "contains"}
+               {:source_type "Class" :source_title "foobar"
+                :target_type "File" :target_title "/etc/foobar/baz"
+                :relationship "contains"}
+               {:source_type "File" :source_title "/etc/foobar"
+                :target_type "File" :target_title "/etc/foobar/baz"
+                :relationship "required-by"}}
+             (->> (query-to-vec [(str "SELECT edges FROM catalogs")])
+                  (mapcat (comp sutils/parse-db-json :edges))
+                  set)))
+      (is (= #{{:type "Class" :title "foobar" :exported false
+                :tags #{"class" "foobar"} :file nil :line nil :parameters {}}
+               {:type "File" :title "/etc/foobar" :exported false
+                :file "/tmp/foo" :line 10 :tags #{"file" "class" "foobar"}
+                :parameters {:ensure "directory" :group "root" :user "root"}}
+               {:type "File" :title "/etc/foobar/baz" :exported false
+                :file "/tmp/bar" :line 20 :tags #{"file" "class" "foobar"}
+                :parameters {:ensure "directory" :group "root" :user "root"
+                             :require "File[/etc/foobar]"}}}
+             (->> (query-to-vec [(str "SELECT resources FROM catalogs")])
+                  (mapcat (comp sutils/parse-db-json :resources))
+                  (map #(update % :tags set))
+                  set))))
+
+    (testing "stores a second catalog"
+      (store-catalog! (assoc catalog :producer_timestamp current-time) (now))
+      (is (= [{:count 2}]
+             (query-to-vec ["SELECT COUNT(*) FROM catalogs"]))))
+
+    (testing "storing an older catalog doesn't change the latest id"
+      (store-catalog! (assoc catalog :producer_timestamp (-> 1 days ago)) (now))
+      (is (= [{:count 3}]
+             (query-to-vec ["SELECT COUNT(*) FROM catalogs"])))
+
+      (is (= [{:producer_timestamp (to-timestamp current-time)}]
+             (query-to-vec [(str "SELECT catalogs.producer_timestamp FROM certnames"
+                                 " JOIN latest_catalogs ON certnames.id = latest_catalogs.certname_id"
+                                 " JOIN catalogs ON catalogs.id = latest_catalogs.catalog_id"
+                                 " WHERE certnames.certname = 'basic.catalogs.com'")]))))
+
+    (testing "only stores up to three catalogs a certname"
+      (store-catalog! (assoc catalog :producer_timestamp (-> 3 days ago)) (now))
+      (store-catalog! (assoc catalog :producer_timestamp (-> 4 days ago)) (now))
+      (store-catalog! (assoc catalog :producer_timestamp (-> 5 days ago)) (now))
+      (store-catalog! (assoc catalog :producer_timestamp (-> 6 days ago)) (now))
+      (is (= [{:count 3}] (query-to-vec ["SELECT COUNT(*) FROM catalogs"]))))
+
+    (testing "storing a new certname doesn't delete other certname's catalogs"
+      (add-certname! "bar.bazz.com")
+      (store-catalog! (assoc catalog
+                             :certname "bar.bazz.com"
+                             :producer_timestamp (-> 1 days ago)) (now))
+      (is (= [{:count 4}] (query-to-vec ["SELECT COUNT(*) FROM catalogs"]))))))

 (deftest-db catalog-persistence
   (testing "Persisted catalogs"


other door type

other door type


fix bug in the elephant query, grouping incorrectly

--- src/clj/elephantdb/cascalog/core.clj
+++ src/clj/elephantdb/cascalog/core.clj
@@ -34,7 +34,7 @@
     (<- [!shard !key !value]
         (pairs-sq !keyraw !valueraw)
         (mk-sortable-key [(.getLPFactory spec)] !keyraw :> !sort-key)
-        (shardify [(.getNumShards spec)] !key :> !shard)
+        (shardify [(.getNumShards spec)] !keyraw :> !shard)
         (:sort !sort-key)
         ((IdentityBuffer.) !keyraw !valueraw :> !key !value)
         )))


using manifest list for registry v2

using manifest list for registry v2

#441

--- src/clj/swarmpit/registry/client.clj
+++ src/clj/swarmpit/registry/client.clj
@@ -108,6 +108,6 @@
         {:method  :HEAD
          :url     (build-url registry (str "/" repository-name "/manifests/" repository-tag))
          :options {:headers (merge (basic-auth registry)
-                                   {:Accept "application/vnd.docker.distribution.manifest.v2+json"})}})
+                                   {:Accept "application/vnd.docker.distribution.manifest.list.v2+json"})}})
       :headers
       :docker-content-digest))


don't watch target dirs for changes

don't watch target dirs for changes

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -112,6 +112,8 @@
   (let [ms   TimeUnit/MILLISECONDS
         q    (LinkedBlockingQueue.)
         ps   (into-array String (:src-paths (core/get-env)))
+        ps   (->> (core/get-env) :src-paths
+               (remove core/tmpfile?) (into-array String))
         k    (.invoke @pod/worker-pod "boot.watcher/make-watcher" q ps)
         ign? (git/make-gitignore-matcher (core/get-env :src-paths))]
     (fn [continue]


adds missing cookie name to the logs (#1196)

--- waiter/src/waiter/auth/oidc.clj
+++ waiter/src/waiter/auth/oidc.clj
@@ -95,7 +95,7 @@
                                (get "cookie")
                                (cookie-support/cookie-value oidc-challenge-cookie))]
         (when (str/blank? challenge-cookie)
-          (throw (ex-info "No challenge cookie set"
+          (throw (ex-info (str "No challenge cookie set: " oidc-challenge-cookie)
                           (assoc bad-request-map :cookie-name oidc-challenge-cookie))))
         (let [decoded-value (cookie-support/decode-cookie challenge-cookie password)]
           (when-not (map? decoded-value)


Fix unescaped pasted quotes in doc string.

--- src/afterglow/fixtures/blizzard.clj
+++ src/afterglow/fixtures/blizzard.clj
@@ -49,7 +49,7 @@
 ```clojure
 (show/add-function! :torrent-shutter
                     (afterglow.effects.channel/function-cue
-                     "Torrent Shutter Open" :shutter-open 50 (show/fixtures-named "torrent")))
+                     \"Torrent Shutter Open\" :shutter-open 50 (show/fixtures-named \"torrent\")))
 ```"
   {:doc/format :markdown}
   []


Adds skeleton pattern recognition functions.

--- src/cadence/pattern_recognition.clj
+++ src/cadence/pattern_recognition.clj
@@ -1,9 +1,6 @@
 (ns cadence.pattern-recognition
-  (:require [cadence.model :as model]
-            [noir.session :as sess]
-            [cadence.model.validators :as is-valid])
-  (:use noir.core
-        clojure.walk))
+  (:require [noir.session :as sess])
+  (:use clj-ml.classifiers))

 (def training-min (atom 6))

@@ -27,3 +24,15 @@
 (defn kept-cadences
   "A helper function to get the set of training from the session."
   [] (sess/get :training-cadences #{}))
+
+(defn gen-phrase-classifier
+  "Creates an SVM classifier from the given data."
+  []
+  ; TODO Implement
+  nil)
+
+(defn is-authentic?
+  "Returns whether the given cadence is authentic or not."
+  [classifer cadence]
+  ; TODO Implement
+  true)


Use Failure not Exception

Use Failure not Exception

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -23,7 +23,7 @@
   "Succeeds with a result Seq[Artifact] representing all Maven artifacts in the
   queried datastore that belong to the specified Group. Will Succeed with an
   empty result if there are no known artifacts. Fails if the group is unknown or
-  if another exception is encountered."
+  if another Failure is encountered."

   {:arglists '[[config group-thing]]}
   dispatch)


Dropped a paren

Dropped a paren

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -121,4 +121,4 @@

   [c thing name]
   (let [h (thing->handle c :examples thing)]
-    (io/file h (str name ".clj")))
+    (io/file h (str name ".clj"))))


Extend smtp-send to inject multiple messages through single connection.

--- src/clj/com/draines/postal/smtp.clj
+++ src/clj/com/draines/postal/smtp.clj
@@ -1,12 +1,25 @@
 (ns com.draines.postal.smtp
   (:use [com.draines.postal.message :only [make-jmessage]])
-  (:import [javax.mail Transport]))
+  (:import [javax.mail Transport Session]))

-(defn smtp-send [msg]
-  (let [jmsg (make-jmessage msg)]
-    (try
-     (Transport/send jmsg)
-     {:code 0 :error :SUCCESS :message "message sent"}
-     (catch Exception e
-       {:code 99 :error (class e) :message (.getMessage e)}))))
+(defn smtp-send
+  ([msg]
+     (let [jmsg (make-jmessage msg)]
+       (try
+         (Transport/send jmsg)
+         {:code 0 :error :SUCCESS :message "message sent"}
+         (catch Exception e
+           {:code 99 :error (class e) :message (.getMessage e)}))))
+  ([host port & msgs]
+     (let [session (doto (Session/getInstance
+                          (doto (java.util.Properties.)
+                            (.put "mail.smtp.host" (or host "localhost"))
+                            (.put "mail.smtp.port" (or port "25"))))
+                     (.setDebug false))]
+       (with-open [transport (doto (-> session (.getTransport "smtp"))
+                               (.connect "" ""))]
+         (let [jmsgs (map #(make-jmessage % session) msgs)]
+           (doseq [jmsg jmsgs]
+             (.sendMessage transport jmsg (.getAllRecipients jmsg))))))))

+


moved beta dictionary creation

moved beta dictionary creation

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -158,13 +158,13 @@
   "query to end all queries: estimate the probabilities for each
   period after the training period."
   [eco-beta-src dynamic-src static-src]
-  (let [beta-dict (log/beta-dict eco-beta-src)]
-    (<- [?s-res ?mod-h ?mod-v ?s ?l ?prob-series]
+  (<- [?s-res ?mod-h ?mod-v ?s ?l ?prob-series]
       (dynamic-src ?s-res ?pd ?mod-h ?mod-v ?s ?l ?val ?neighbor-val)
       (static-src ?s-res ?mod-h ?mod-v ?s ?l _ _ ?eco _)
-      (apply-betas [beta-dict] ?eco ?val ?neighbor-val :> ?prob)
+      (log/beta-dict eco-beta-src :> ?beta-dict)
+      (apply-betas [?beta-dict] ?eco ?val ?neighbor-val :> ?prob)
       (log/mk-timeseries ?pd ?prob :> ?prob-series)
-      (:distinct false))))
+      (:distinct false)))

 (comment
   (let [m {:est-start "2005-12-31"


Render leaderboard

Render leaderboard

--- src/clj/made_merits/routes/home.clj
+++ src/clj/made_merits/routes/home.clj
@@ -5,9 +5,9 @@
             [made-merits.db.core :as db]
             [clojure.java.io :as io]))

-(defn home-page []
+(defn leader-board []
   (layout/render
-    "home.html" {:docs (-> "docs/docs.md" io/resource slurp)}))
+    "leaderboard.html" {:docs (-> "docs/docs.md" io/resource slurp)}))

 (defn merits-page []
   (layout/render "merits.html" {:users (db/get-users) :merits (db/get-merits)}))
@@ -17,6 +17,6 @@
   (layout/render "merits.html" {:users (db/get-users) :merits (db/get-merits)}))

 (defroutes home-routes
-  (GET "/" [] (home-page))
+  (GET "/" [] (leader-board))
   (GET "/merits" [] (merits-page))
   (POST "/merits" [merit_id user_id] (add-merits merit_id user_id)))


Use site name in issuer email

Use site name in issuer email

--- src/clj/salava/badgeIssuer/main.clj
+++ src/clj/salava/badgeIssuer/main.clj
@@ -8,7 +8,7 @@
    [salava.badgeIssuer.creator :refer [generate-image]]
    [salava.badgeIssuer.db :as db]
    [salava.badgeIssuer.util :refer [selfie-id is-badge-issuer? badge-valid? already-issued?]]
-   [salava.core.util :refer [publish get-site-url bytes->base64 hex-digest now get-full-path get-db get-db-1 file-from-url-fix md->html get-db-col plugin-fun get-plugins]]
+   [salava.core.util :refer [publish get-site-url get-site-name bytes->base64 hex-digest now get-full-path get-db get-db-1 file-from-url-fix md->html get-db-col plugin-fun get-plugins]]
    [salava.profile.db :refer [user-information]]
    [salava.user.db :refer [primary-email]]
    [slingshot.slingshot :refer :all]))
@@ -43,7 +43,7 @@
      :description description
      :type "Profile"
      :url (if (pos? uid) (str (get-full-path ctx) "/profile/" uid) (get-site-url ctx))
-     :email (str "no-reply@" (get-site-url ctx))
+     :email (str "no-reply@" (get-site-name ctx))
      :image (str (get-site-url ctx) "/" image_file)
      (keyword "@context") "https://w3id.org/openbadges/v2"}))


Allow deleting # symbol when paredit is enabled

--- src/clojure/paredit_widget/core.clj
+++ src/clojure/paredit_widget/core.clj
@@ -95,9 +95,23 @@
 (def ^:const special-chars
   #{"(" ")" "[" "]" "{" "}" "\""})

-(def ^:const ignore-during-selection
-  #{:paredit-backward-delete
-    :paredit-forward-delete})
+(defn disable-paredit?
+  [cmd widget]
+  (let [text (s/value widget)
+        selected (.getSelectedText widget)
+        offset (.getCaretPosition widget)]
+    (case cmd
+      :paredit-backward-delete
+      (or selected
+          (= offset 0)
+          (= "#" (subs text (- offset 1) offset)))
+
+      :paredit-forward-delete
+      (or selected
+          (= offset (count text))
+          (= "#" (subs text offset (+ offset 1))))
+
+      false)))

 (defn exec-paredit!
   [k w buffer enable-default? enable-advanced?]
@@ -107,7 +121,7 @@
                           (or (advanced-keymap k)
                               (advanced-alternative-keymap k)
                               (foreign-keymap k))))]
-    (when-not (and (.getSelectedText w) (ignore-during-selection cmd))
+    (when-not (disable-paredit? cmd w)
       (insert-result! w (exec-command! cmd w buffer))
       cmd)))