Do the worker HB timeout check when HB's are updated

--- storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ storm-core/src/clj/backtype/storm/daemon/nimbus.clj
@@ -326,7 +326,7 @@
 ;; Does not assume that clocks are synchronized. Executor heartbeat is only used so that
 ;; nimbus knows when it's received a new heartbeat. All timing is done by nimbus and
 ;; tracked through heartbeat-cache
-(defn- update-executor-cache [curr hb]
+(defn- update-executor-cache [curr hb timeout]
   (let [reported-time (:time-secs hb)
         {last-nimbus-time :nimbus-time
          last-reported-time :executor-reported-time} curr
@@ -338,15 +338,18 @@
                       (current-time-secs)
                       last-nimbus-time
                       )]
-      {:nimbus-time nimbus-time
+      {:is-timed-out (and
+                       nimbus-time
+                       (>= (time-delta nimbus-time) timeout))
+       :nimbus-time nimbus-time
        :executor-reported-time reported-time}))

-(defn update-heartbeat-cache [cache executor-beats all-executors]
+(defn update-heartbeat-cache [cache executor-beats all-executors timeout]
   (let [cache (select-keys cache all-executors)]
     (into {}
       (for [executor all-executors :let [curr (cache executor)]]
         [executor
-         (update-executor-cache curr (get executor-beats executor))]
+         (update-executor-cache curr (get executor-beats executor) timeout)]
          ))))

 (defn update-heartbeats! [nimbus storm-id all-executors existing-assignment]
@@ -355,7 +358,8 @@
         executor-beats (.executor-beats storm-cluster-state storm-id (:executor->node+port existing-assignment))
         cache (update-heartbeat-cache (@(:heartbeats-cache nimbus) storm-id)
                                       executor-beats
-                                      all-executors)]
+                                      all-executors
+                                      ((:conf nimbus) NIMBUS-TASK-TIMEOUT-SECS))]
       (swap! (:heartbeats-cache nimbus) assoc storm-id cache)))

 (defn- update-all-heartbeats! [nimbus existing-assignments topology->executors]
@@ -380,14 +384,12 @@
     (->> all-executors
         (filter (fn [executor]
           (let [start-time (get executor-start-times executor)
-                nimbus-time (-> heartbeats-cache (get executor) :nimbus-time)]
+                is-timed-out (-> heartbeats-cache (get executor) :is-timed-out)]
             (if (and start-time
                    (or
                     (< (time-delta start-time)
                        (conf NIMBUS-TASK-LAUNCH-SECS))
-                    (not nimbus-time)
-                    (< (time-delta nimbus-time)
-                       (conf NIMBUS-TASK-TIMEOUT-SECS))
+                    (not is-timed-out)
                     ))
               true
               (do


Huge performance optimizations

Huge performance optimizations

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -19,7 +19,8 @@
             [qbits.knit :as knit])
   (:import [com.datastax.driver.core
             BatchStatement
-            PreparedStatement]
+            PreparedStatement
+            Session]
            [java.util.concurrent ExecutorService]))

 (set! *warn-on-reflection* true)
@@ -111,39 +112,42 @@
   [points]
   (json/generate-string (vec points)))

+(defn process-path-fn
+  [^Session session cql tenant rollup period from to asize]
+  (let [rollup (int rollup)
+        from (long from)
+        to (long to)]
+    (fn [path]
+      (try
+        (let [points (object-array asize)
+              agg-fn (agg-fn-by-path path)
+              rows (.execute session (format cql path))
+              first-row (.one rows)]
+          (when first-row
+            (loop [row first-row]
+              (when row
+                (let [time (long (.getLong row "time"))
+                      metric-raw (into [] (.getList row "data" java.lang.Double))
+                      metric (if (> (count metric-raw) 1)
+                               (agg-fn metric-raw)
+                               (first metric-raw))]
+                  (aset points (time-to-ndx from rollup time) metric)
+                  (recur (.one rows)))))
+            (str/join ["\"" path "\":" (points-to-json points)])))
+        (catch  Exception e
+          (info e "Fetching exception"))))))
+
 (defn par-fetch
   "Fetch data in parallel fashion."
-  [session fetch! executor paths tenant rollup period from to]
-  (let [rollup (int rollup)
-        from (long from)
-        to (long to)
-        asize (inc (time-to-ndx from rollup to))
-        futures
-        (doall (map #(knit/future executor
-                       (try
-                         (let [points (object-array asize)
-                               agg-fn (agg-fn-by-path %)
-                               rows (->> (alia/execute
-                                          session
-                                          fetch!
-                                          {:values [% tenant (int rollup)
-                                                    (int period)
-                                                    from to]
-                                           :fetch-size Integer/MAX_VALUE
-                                           }))]
-                           (when rows
-                             (doseq [row rows]
-                               (let [time (long (:time row))
-                                     metric-raw (:data row)
-                                     metric (if (> (count metric-raw) 1)
-                                              (agg-fn metric-raw)
-                                              (first metric-raw))]
-                                 (aset points (time-to-ndx from rollup time)
-                                       metric)))
-                             (str/join ["\"" % "\":" (points-to-json points)])))
-                         (catch  Exception e
-                           (info e "Fetching exception"))))
-                    paths))]
+  [session executor paths tenant rollup period from to]
+  (let [asize (inc (time-to-ndx from rollup to))
+        cql (format (str "SELECT data, time FROM metric WHERE "
+                         "path = '%%s' AND tenant = '%s' AND rollup = %s "
+                         "AND period = %s AND time >= %s AND time <= %s;")
+                    tenant rollup period from to)
+        process-path (process-path-fn session cql tenant rollup period from
+                                      to asize)
+        futures (doall (map #(knit/future executor (process-path %)) paths))]
     (str "{" (str/join "," (remove nil? (map deref-limiter futures))) "}")))

 (defn cassandra-metric-store
@@ -213,8 +217,8 @@
         (let [min-point  (align-time from rollup)
               max-point  (align-time (apply min [to (now)]) rollup)]
           (if-let [series (and (seq paths)
-                               (par-fetch session fetchq executor paths tenant
-                                          rollup period min-point max-point))]
+                               (par-fetch session executor paths tenant rollup
+                                          period min-point max-point))]
             (format "{\"from\":%s,\"to\":%s,\"step\":%s,\"series\":%s}"
                     min-point max-point rollup series)
             (json/generate-string {:from from


Removed stacktrace injection which doesn't work.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -8,10 +8,5 @@
                   ;[lein-autodoc "0.9.0"]
                   [lein-marginalia "0.7.0"]
                   [lein-noir "1.2.0"]]
-        :injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
-                                            'print-cause-trace)
-                           new (ns-resolve (doto 'clj-stacktrace.repl require)
-                                           'pst)]
-                       (alter-var-root orig (constantly @new)))]
         :vimclojure-opts {:repl true
                           :port 2113}}}


lein: quickie -> test-refresh - growl support

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -37,7 +37,8 @@
                   [lein-try "0.4.1"]
                   [lein-alembic "0.1.0"]     ; make alembic available -> reload prj deps w/o restarting repl: (alembic.still/load-project)
                   [lein-clojuredocs "1.0.2"] ; Create clojuredocs-style doc
-                  [quickie "0.2.6"] ; autotest for clojure.test
+                  ;;[quickie "0.2.6"] ; autotest for clojure.test
+                  [com.jakemccrary/lein-test-refresh "0.3.4"] ;; autotest: lein test-refresh :growl
                   [lein-light "0.0.44"] ; LightTable: `lein light` in a prj
                   ]}
        :repl-options {:nrepl-middleware


[lein] Update Eastwood

[lein] Update Eastwood

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,7 +1,7 @@
 {:user {:plugins [[lein-cloverage                    "1.0.2"]
                   [lein-fore-prob                    "0.1.2"]
                   [lein-ancient                      "0.5.4"]
-                  [jonase/eastwood                   "0.1.0"]
+                  [jonase/eastwood                   "0.2.1"]
                   [lein-drip                         "0.1.1-SNAPSHOT"]
                   [com.jakemccrary/lein-test-refresh "0.3.4"]
                   [lein-pprint                       "1.1.1"]]


lein-depgraph is handy

lein-depgraph is handy

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,4 +1,5 @@
 {:user {:plugins [[lein-exec "0.3.0"]
+                  [lein-depgraph "0.1.0"]
                   [jonase/eastwood "0.1.2"]]
         :dependencies [[org.clojure/tools.namespace "0.2.4"]
                        [criterium "0.4.2"]


[lein] Remove unused plugins

[lein] Remove unused plugins

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,10 +1,7 @@
 {:user {:plugins [[lein-cloverage                    "1.0.6"]
                   [lein-fore-prob                    "0.1.2"]
                   [lein-ancient                      "0.6.10"]
-                  [jonase/eastwood                   "0.2.3"]
-                  [com.jakemccrary/lein-test-refresh "0.3.4"]
-                  [lein-pprint                       "1.1.1"]
-                  [lein-kibit                        "0.1.2"]
-                  [cider/cider-nrepl                 "0.12.0"]
+                  [lein-pprint                       "1.1.2"]
+                  [cider/cider-nrepl                 "0.13.0"]
                   [venantius/ultra                   "0.4.1"]]
         :signing {:gpg-key "E5B26621"}}}


Remove debug printf

Remove debug printf

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -541,7 +541,6 @@
             nses     (->> all-nses (set/intersection (if all all-nses namespace)) sort)]
         (pod/with-eval-in @compile-pod
           (binding [*compile-path* ~(.getPath tgt)]
-            (prn *clojure-version*)
             (doseq [[idx ns] (map-indexed vector '~nses)]
               (boot.util/info "Compiling %s/%s %s...\n" (inc idx) (count '~nses) ns)
               (compile ns)))))


Use seek instead of find, the latter already exists in clojure.core

--- src/refactor_nrepl/ns/clean_ns.clj
+++ src/refactor_nrepl/ns/clean_ns.clj
@@ -36,13 +36,13 @@
   (assert-no-exclude-clause (core/get-ns-component ns-form :use))
   ns-form)

-(defn- find
+(defn- seek
   "Find the first element in coll that satisfies pred?"
   [pred? coll]
   (reduce (fn [_ x] (when (pred? x) (reduced x))) nil coll))

 (defn clean-ns [{:keys [path relative-path]}]
-  (let [path (find #(and % (.exists (io/file %)))
+  (let [path (seek #(and % (.exists (io/file %)))
                    [path relative-path])]
     (assert (core/source-file? path))
     ;; Prefix notation not supported in cljs.


Update it.cljs

Update it.cljs

--- src/status_im/translations/it.cljs
+++ src/status_im/translations/it.cljs
@@ -66,9 +66,9 @@
    :not-specified                         "Non specificato"
    :public-key                            "Chiave pubblica"
    :phone-number                          "Numero di telefono"
-   :email                                 "Email"
+   :email                                 "E-mail"
    :profile-no-status                     "Nessuno stato"
-   :add-to-contacts                       "Aggiungere ai contatti"
+   :add-to-contacts                       "Aggiungi ai contatti"
    :error-incorrect-name                  "Seleziona un altro nome"
    :error-incorrect-email                 "e-mail non valida"


Behaviours can add behaviours

Behaviours can add behaviours

--- test/little_monster_simulation/core_test.clj
+++ test/little_monster_simulation/core_test.clj
@@ -54,9 +54,20 @@
                                             (dissoc-in m [:behaviours :one-shot]))}}
           monster' (c/tick monster 1)]
       (is (empty? (:behaviours monster')))))
+
   (testing "behaviours can add stats"
     (let [monster {:stats {:life 100}
                    :behaviours {:walkies (fn [m _]
                                            (assoc-in m [:stats :walk] 100))}}
           monster' (c/tick monster 1)]
+      (is (= 100 (c/value-of monster' :walk)))))
+
+  (testing "behaviours can add other behaviours"
+    (let [monster {:stats {:life 100}
+                   :behaviours {:add-walk (fn [m _]
+                                            (assoc-in m
+                                                      [:behaviours :walk]
+                                                      (fn [m _]
+                                                        (assoc-in m [:stats :walk] 100))))}}
+          monster' (c/tick (c/tick monster 1) 1)]
       (is (= 100 (c/value-of monster' :walk))))))


More underneeded var removal.

More underneeded var removal.

--- src/cbfg/ago.clj
+++ src/cbfg/ago.clj
@@ -8,8 +8,7 @@
   `(cljs.core.async/>! (:event-ch (actx-top ~actx)) ~event))

 (defmacro ago [child-actx-binding-name actx & body]
-  `(let [w# (actx-top ~actx)
-         ago-id# (swap! (:last-id w#) inc)
+  `(let [ago-id# (swap! (:last-id (actx-top ~actx)) inc)
          ~child-actx-binding-name (conj ~actx
                                         ['~child-actx-binding-name ago-id#])]
      (go (actx-event ~actx [:beg "ago" ~child-actx-binding-name])


Gui: toolbar structured

Gui: toolbar structured


procfile

procfile

--- src/spc/core.clj
+++ src/spc/core.clj
@@ -1,6 +1,6 @@
 (ns spc.core
-  (:use ring.adapter.jetty)
-  (:use ring.util.response))
+  (:use ring.adapter.jetty
+        ring.util.response))

 (defn handler [req]
   (response "Hello worldssss"))
@@ -9,4 +9,4 @@
   (-> handler))

 (defn -main []
-  (defonce server (run-jetty app { :port 8000 })))
+  (defonce server (run-jetty app { :port 8080 })))


remove formatted message from result

remove formatted message from result

--- src/chartem.clj
+++ src/chartem.clj
@@ -38,8 +38,4 @@
     {:pass? true}
     {:pass? false
      :expected (:description matcher)
-     :was ((:describe-mismatch matcher) a)
-;; "\nExpected: " ++ description m ++ "\n     but: " ++ describeMismatch m a
-     :message (str "\nExpected: " (:description matcher)
-                   "\n     but: "
-                   ((:describe-mismatch matcher) a))}))
+     :was ((:describe-mismatch matcher) a)}))


Added rendering options flag constants

Added rendering options flag constants


combineTiles.clj: some more work

combineTiles.clj: some more work

--- clojure/org/gavrog/clojure/combineTiles.clj
+++ clojure/org/gavrog/clojure/combineTiles.clj
@@ -9,11 +9,18 @@
     (frequencies (for [D (orbit-reps ds idcs)] (canonical (orbit ds idcs D))))))

 (defn- partition-by-automorphism-group [ds]
-  (into pempty (apply concat (automorphisms ds))))
+  (or (seq (into pempty (apply concat (automorphisms ds))))
+      (map hash-set (elements ds))))

 (defn- inequivalent-forms [ds]
   (for [orb (partition-by-automorphism-group ds)]
-    (renumbered-from ds (first orb))))
+    (canonical ds (first orb))))
+
+(defn- signatures [ds]
+  (into {} (for [orb (partition-by-automorphism-group ds)
+                 :let [inv (invariant ds (first orb))],
+                 D orb]
+             [D inv])))

 (defn combine-tiles [ds]
   (make-backtracker


Avoid consistency column-title-error until specification

We need to specify what do do with older transformations prior to this limitation

--- backend/src/akvo/lumen/lib/transformation/engine.clj
+++ backend/src/akvo/lumen/lib/transformation/engine.clj
@@ -539,5 +539,5 @@

 (defn column-title-error? [column-title columns]
   (when (not-empty (filter #(= column-title (get % "title")) columns))
-    {:success? false
+    #_{:success? false
      :message  (format "In this dataset there's already a column with this name: %s. Please choose another non existing name" column-title)}))


aargh, my code tidy fn moves brackets into comments!?!

--- src/overtone/sc/machinery/ugen/metadata/extras/bhob.clj
+++ src/overtone/sc/machinery/ugen/metadata/extras/bhob.clj
@@ -1515,4 +1515,6 @@
    ;;      *ar {|in, tone|
    ;;              ^Mix([HiShelf.ar(in, 10000, tone), LoShelf.ar(in, 100, tone.reciprocal)])
    ;;      }
-   ;;}])
+   ;;}
+
+   ])


As suggested by Nick Klauer, removal of duplications in the code

--- ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
+++ ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
@@ -16,7 +16,6 @@
             CompletionProposal
             ICompletionProposal
             ICompletionProposalExtension6
-            IContentAssistProcessor
             IContextInformation
             IContextInformationExtension
             IContextInformationValidator]
@@ -41,19 +40,7 @@
     (first (filter (comp call? z/node) parents))))

 (defn call-context-loc
-  "for viewer, at offset 12, return the loc containing the encapsulatin
-   call, or nil"
-  [viewer offset]
-  (when (pos? offset)
-    (let [loc (lu/loc-containing-offset
-                (-> viewer .getParseState :parse-tree lu/parsed-root-loc)
-                offset)
-          maybe-call-loc (-> loc parent-call)]
-      (when (call? (z/node maybe-call-loc))
-        maybe-call-loc))))
-
-(defn call-context-loc
-  "for viewer, at offset 12, return the loc containing the encapsulatin
+  "for viewer, at offset 12, return the loc containing the encapsulating
    call, or nil"
   [viewer offset]
   (when (pos? offset)


Get BPM adjustment with circular gauge working.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -519,7 +519,7 @@
   "Figure out how many pixels wide some text will be in a given font."
   [graphics font text]
   (let [context (.getFontRenderContext graphics)]
-    (.getWidth (.getStringBounds text context))))
+    (.getWidth (.getStringBounds font text context))))

 (defn draw-bottom-button-label
   "Draw a label for a button below the graphical display."
@@ -569,6 +569,10 @@
   "The font used when drawing cue variable values."
   (get-display-font :condensed-light Font/PLAIN 22))

+(def font-for-cue-variable-emphasis
+  "The font used when drawing cue variable values."
+  (get-display-font :condensed Font/PLAIN 22))
+
 (defn draw-cue-variable-value
   "Draw a label under an encoder at the top of the graphical display."
   [controller index encoder-count text color]
@@ -582,6 +586,23 @@
     (.drawString graphics label
                  (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 40)))

+(defn draw-attributed-variable-value
+  "Draw a label under an encoder at the top of the graphical display,
+  with an attributed string so the label can have mixed fonts, colors,
+  etc. Assumes the value will fit in the allocated space."
+  [controller index encoder-count attributed-string color]
+  (let [graphics (create-graphics controller)
+        space (space-for-encoder-button-label encoder-count)
+        context (.getFontRenderContext graphics)
+        iterator (.getIterator attributed-string)
+        measurer (java.awt.font.LineBreakMeasurer. iterator context)
+        layout (.nextLayout measurer Integer/MAX_VALUE)
+        width (.getWidth (.getBounds layout))]
+    ;; Establish a default color for characters that don't change it
+    (set-graphics-color graphics color)
+    (.drawString graphics iterator
+                 (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 40)))
+
 (defn ^:deprecated make-gauge
   "Create a graphical gauge with an indicator that fills a line.
   The default range is from zero to a hundred, and the default size is
@@ -592,6 +613,25 @@
         marker 0
         leader (take (int (/ scaled 2)) (repeat 0))]
     (take width (concat leader [marker] (repeat 0)))))
+
+(defn draw-gauge
+  "Draw a graphical gauge with an indicator that fills an arc under a
+  variable value. The default range is from zero to a hundred, and the
+  default color for both the track and active area is dim white."
+  [controller index encoder-count value & {:keys [lowest highest track-color active-color]
+                                           :or {lowest 0 highest 100
+                                                track-color dim-white-color active-color track-color}}]
+  (let [graphics (create-graphics controller)
+        range (- highest lowest)
+        fraction (/ (- value lowest)  range)
+        x-center (+ (* index button-cell-width) (* encoder-count 0.5 button-cell-width))
+        arc (java.awt.geom.Arc2D$Double. (- x-center 25.0) 50.0 50.0 50.0 240.0 -300.0 java.awt.geom.Arc2D/OPEN)]
+    (set-graphics-color graphics track-color)
+    (.draw graphics arc)
+    (.setStroke graphics (java.awt.BasicStroke. 5.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
+    (set-graphics-color graphics active-color)
+    (.setAngleExtent arc (* -300.0 fraction))
+    (.draw graphics arc)))

 (defn ^:deprecated make-pan-gauge
   "Create a graphical gauge with an indicator that moves along a line.
@@ -646,19 +686,45 @@
   (let [button (if (keyword? button) (get-in control-buttons [button :control]) button)]
     (get @(:modes controller) button)))

+(def metronome-background
+  "The background for the metronome section, to mark it as such."
+  (colors/darken (colors/desaturate (colors/create-color :blue) 55) 45))
+
+(def metronome-content
+  "The color for content in the metronome section, to mark it as such."
+  (colors/desaturate (colors/create-color :aqua) 30))
+
 (defn- bpm-adjusting-interface
-  "Add an arrow showing the BPM is being adjusted, or point out that
-  it is being externally synced."
-  [controller]
+  "Bold the section of the BPM that is being adjusted, and draw the
+  gauge in a brighter color, or indicate that it is being synced and
+  can't be adjusted."
+  [controller snapshot]
   (if (= (:type (show/sync-status)) :manual)
-    (let [arrow-pos (if (in-mode? controller :shift) 14 16)]
-      #_(aset (get (:next-display controller) 2) arrow-pos 0))
-    (do
-      #_(aset (get (:next-display controller) 2) 9 0)
-      (when-not (:showing @(:metronome-mode controller))
-        ;; We need to display the sync mode in order to point at it
-        (write-display-cell controller 3 0
-                            (str "         " (metronome-sync-label controller)))))))
+    (let [graphics (create-graphics controller)
+          bpm (double (:bpm snapshot))
+          bpm-string (format "%.1f" bpm)
+          label (java.text.AttributedString. bpm-string)]
+      (set-graphics-color graphics metronome-background)
+      (.fillRect graphics button-cell-width 21 button-cell-width 20)
+      (.addAttribute label java.awt.font.TextAttribute/FONT font-for-cue-variable-values)
+      (if (in-mode? controller :shift)
+        (do (.addAttribute label java.awt.font.TextAttribute/FONT font-for-cue-variable-emphasis
+                           0 (- (count bpm-string) 2))
+            (.addAttribute label java.awt.font.TextAttribute/FOREGROUND (java.awt.Color/WHITE)
+                           0 (- (count bpm-string) 2)))
+        (do (.addAttribute label java.awt.font.TextAttribute/FONT font-for-cue-variable-emphasis
+                           (dec (count bpm-string)) (count bpm-string))
+            (.addAttribute label java.awt.font.TextAttribute/FOREGROUND (java.awt.Color/WHITE)
+                           (dec (count bpm-string)) (count bpm-string))))
+      (draw-attributed-variable-value controller 1 1 label metronome-content)
+      (draw-gauge controller 1 1 bpm :lowest controllers/minimum-bpm :highest controllers/maximum-bpm
+                  :track-color metronome-content :active-color white-color))
+
+    ;; Display the sync mode in red to explain why we are not adjusting it.
+    (let [graphics (create-graphics controller)]
+      (set-graphics-color graphics metronome-background)
+      (.fillRect graphics button-cell-width (- Wayang/DISPLAY_HEIGHT 20) button-cell-width 20)
+      (draw-bottom-button-label controller 1 (metronome-sync-label controller) red-color))))

 (defn sign-velocity
   "Convert a midi velocity to its signed equivalent, to translate
@@ -690,8 +756,8 @@
                (reify controllers/IOverlay
                  (captured-controls [this] #{72})
                  (captured-notes [this] #{1 9})
-                 (adjust-interface [this _]
-                   (bpm-adjusting-interface controller)
+                 (adjust-interface [this snapshot]
+                   (bpm-adjusting-interface controller snapshot)
                    true)
                  (handle-control-change [this message]
                    (adjust-bpm-from-encoder controller message))
@@ -818,10 +884,6 @@
   (when (not= marker @(:last-marker controller))
     (reset! (:last-marker controller) marker)))

-(def metronome-background
-  "The background for the metronome section, to mark it as such."
-  (colors/darken (colors/desaturate (colors/create-color :blue) 55) 45))
-
 (defn- update-metronome-section
   "Updates the sections of the interface related to metronome
   control."
@@ -833,18 +895,20 @@
     ;; Is the first cell reserved for metronome information?
     (if (seq metronome-mode)
       (let [graphics (create-graphics controller)
-            bpm (format "%.1f" (double (:bpm snapshot)))
-            chars (+ (count marker) (count bpm))]
+            bpm (:bpm snapshot)
+            bpm-string (format "%.1f" (double bpm))]
         ;; Draw the background that makes the metronome section distinctive.
         (set-graphics-color graphics metronome-background)
         (.fillRect graphics 0 0 (* 2 button-cell-width) Wayang/DISPLAY_HEIGHT)

         ;; Draw the beat and BPM information
-        (set-graphics-color graphics white-color)
-        (draw-cue-variable-value controller 0 1 marker white-color)
-        (draw-cue-variable-value controller 1 1 bpm white-color)
-        (draw-encoder-button-label controller 0 1 "Beat" white-color)
-        (draw-encoder-button-label controller 1 1 "BPM" white-color)
+        (set-graphics-color graphics metronome-content)
+        (draw-encoder-button-label controller 0 1 "Beat" metronome-content)
+        (draw-cue-variable-value controller 0 1 marker metronome-content)
+        (draw-encoder-button-label controller 1 1 "BPM" metronome-content)
+        (draw-cue-variable-value controller 1 1 bpm-string metronome-content)
+        (draw-gauge controller 1 1 bpm :lowest controllers/minimum-bpm :highest controllers/maximum-bpm
+                    :track-color metronome-content)

         ;; Make the metronome button bright, since some overlay is present
         (swap! (:next-text-buttons controller) assoc metronome-button white-color))
@@ -1384,8 +1448,8 @@
                            (reify controllers/IOverlay
                              (captured-controls [this] #{15})
                              (captured-notes [this] #{9 1})
-                             (adjust-interface [this _]
-                               (bpm-adjusting-interface controller)
+                             (adjust-interface [this snapshot]
+                               (bpm-adjusting-interface controller snapshot)
                                true)
                              (handle-control-change [this message]
                                (adjust-bpm-from-encoder controller message))


Tidying.

Tidying.

--- test/com/nomistech/clojure_the_language/macros_test.clj
+++ test/com/nomistech/clojure_the_language/macros_test.clj
@@ -1,14 +1,15 @@
 (ns com.nomistech.clojure-the-language.macros-test
   (:require [midje.sweet :refer :all]))

-(defmacro goo [x] `(list x
-                         'x
-                         ~'x
-                         ~x
-                         '~x))
+(defmacro do-things-with-symbols [x]
+  `(list x
+         'x
+         ~'x
+         ~x
+         '~x))

 (fact
-  (macroexpand-1 '(goo x-in-call))
+  (macroexpand-1 '(do-things-with-symbols x-in-call))
   => '(clojure.core/list com.nomistech.clojure-the-language.macros-test/x
                          'com.nomistech.clojure-the-language.macros-test/x
                          x


delaney3d.clj: still more work on pseudo-toroidal cover function

--- clojure/org/gavrog/clojure/delaney3d.clj
+++ clojure/org/gavrog/clojure/delaney3d.clj
@@ -34,16 +34,40 @@
   (let [ds (oriented-cover ds)
         {:keys
          [nr-generators relators cones edge-to-word]} (fundamental-group ds)
+        _ (assert (every? (comp #{1 2 3 4 6} second) cones)
+                  "Symbol violates the crystallographic restriction")
         cones2 (filter (fn [[wd deg]] (= deg 2)) cones)
         cones3 (filter (fn [[wd deg]] (= deg 3)) cones)
         base (map core-table
                   (results (table-generator nr-generators relators 4)))
-        good (for [ct base :when (flattens-all? ct cones)]
-               (let [type (if (= (count ct) 4)
-                            (if (fully-involutive? ct) :v4 :z4)
-                            (core-type (count ct)))]
-                 [type ct]))
-        candidates (reduce (fn [m [k v]] (massoc m k v)) {} good)
-
-        ]
+        cores (for [ct base :when (flattens-all? ct cones)]
+                (let [type (if (= (count ct) 4)
+                             (if (fully-involutive? ct) :v4 :z4)
+                             (core-type (count ct)))]
+                  [type ct]))
+        z2a (filter (fn [ct] (and (= 2 (count ct))
+                                  (flattens-all? ct cones2)))
+                    base)
+        z2b (filter (fn [ct] (and (= 2 (count ct))
+                                  (not (flattens-all? ct cones2))))
+                    base)
+        z3a (filter (fn [ct] (and (= 3 (count ct))
+                                  (flattens-all? ct cones3)))
+                    base)
+        s3a (filter (fn [ct] (and (= 6 (count ct))
+                                  (flattens-all? ct cones3)))
+                    base)
+        z6 (for [a z3a, b z2a
+                 :let [c (intersection-table a b)]
+                 :when (and (= 6 (count c)) (flattens-all? c cones))]
+             [:z6 c])
+        d6 (for [a s3a, b z2b
+                 :let [c (intersection-table a b)]
+                 :when (and (= 12 (count c)) (flattens-all? c cones))]
+             [:d6 c])
+        categorized (reduce (fn [m [k v]] (massoc m k v)) {}
+                            (concat cores z6 d6))
+        candidates (for [type [:z1 :z2 :z3 :z4 :v4 :s3 :z6 :d4 :d6 :a4 :s4]
+                         ct (categorized type)]
+                     ct)]
     candidates))


minor cleanup

minor cleanup

--- collectors/jenkins/src/jenkins_collector/jenkins.clj
+++ collectors/jenkins/src/jenkins_collector/jenkins.clj
@@ -2,24 +2,18 @@
   (:require [cheshire.core :refer :all]
             [clojure.tools.logging :as log]
             [kuona-core.util :as util]
-            [clj-http.client :as http])
-  (:import (java.util Date)))
+            [clj-http.client :as http]))

 (defn job-to-job
   [job]
   {:name (:name job)
    :url  (:url job)})

-(defn jobs
+(defn read-jenkins-jobs
   [connection url]
   (let [response (connection url)
         result (map job-to-job (:jobs response))]
     result))
-
-
-(defn parse-json
-  [content]
-  (parse-string content true))

 (defn http-source
   [credentials]
@@ -27,7 +21,7 @@
     (let [uri (str url "/api/json")
           http-credentials {:basic-auth [(:username credentials) (:password credentials)]}
           response (http/get uri http-credentials)
-          content (parse-json (:body response))]
+          content (util/parse-json-body response)]
       content)))

 (defn read-build
@@ -39,13 +33,9 @@
                   :url    (:url b)
                   :source b}) (:builds build))))

-(defn builds
+(defn read-jenkins-builds
   [connection jobs]
   (flatten (map #(read-build connection %) jobs)))
-
-(defn timestamp
-  []
-  (new Date))

 (defn make-build-metric
   [connection server build]
@@ -61,7 +51,7 @@
       :number    (:number content)
       :duration  (:duration content)
       :result    (:result content)
-      :collected (timestamp)
+      :collected (util/timestamp)
       :collector {:name    :kuona-jenkins-collector
                   :version (util/get-project-version 'kuona-jenkins-collector)}
       :jenkins   content}}))
@@ -83,7 +73,7 @@
 (defn collect-metrics
   [connection url]
   (log/info "Collecting metrics from" url)
-  (let [build-jobs (jobs connection url)
-        build-log (builds connection build-jobs)
+  (let [build-jobs (read-jenkins-jobs connection url)
+        build-log (read-jenkins-builds connection build-jobs)
         build-metrics (map #(make-build-metric connection url %) build-log)]
     build-metrics))


add link for shopify case study

add link for shopify case study

--- frontend/components/landing-b.cljs
+++ frontend/components/landing-b.cljs
@@ -62,7 +62,11 @@
                    "Launches are dead,"
                    [:br]
                    " long live iteration."]
-                  [:p "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum convallis varius porttitor. Mauris rhoncus tempor scelerisque. Donec in dignissim erat, a venenatis arcu. Mauris sagittis volutpat nulla."]]]]
+                  [:p "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum convallis varius porttitor. Mauris rhoncus tempor scelerisque. Donec in dignissim erat, a venenatis arcu. Mauris sagittis volutpat nulla."]
+                  [:p
+                   "Wanna know more? "
+                   [:a "Learn about Shopify's process"]
+                   "."]]]]
                [:section.home-practice]
                [:section.home-potential]
                [:section.home-epilog]])))))


fix for 1.3a use current type-hint syntax

--- dada-core/src/main/clojure/org/dada/dsl.clj
+++ dada-core/src/main/clojure/org/dada/dsl.clj
@@ -40,11 +40,11 @@
 ;;--------------------------------------------------------------------------------
 ;; needs refactoring from here...

-(defn apply-getters [#^ISeq getters value]
+(defn apply-getters [getters value]
   "apply a list of getters to a value returning a list of their results"
-  (map (fn [#^Getter getter] (.get getter value)) getters))
-
-(def #^Metadata$Comparator int-version-comparator
+  (map (fn [^Getter getter] (.get getter value)) getters))
+
+(def ^Metadata$Comparator int-version-comparator
      (proxy [Metadata$Comparator][]
 	    (higher [old new] (> (.getVersion new) (.getVersion old)))))

@@ -58,20 +58,20 @@
 ;; TODO: creation of extra literal and composed values
 ;;----------------------------------------

-(defn make-transformer [#^ISeq init-fns #^Metadata metadata #^View view]
-  (let [#^Creator creator (.getCreator metadata)]
+(defn make-transformer [init-fns ^Metadata metadata ^View view]
+  (let [^Creator creator (.getCreator metadata)]
     (new
      Transformer
-     #^Collection
+     ^Collection
      (list view)
-     #^Transformer$StatelessStrategy
+     ^Transformer$StatelessStrategy
      (proxy
       [Transformer$StatelessStrategy]
       []
       (transform
        [input]
        ;; TODO: this code needs to be FAST - executed online
-       (.create creator (into-array Object (map (fn [#^IFn init-fn] (init-fn input)) init-fns))))
+       (.create creator (into-array Object (map (fn [init-fn] (init-fn input)) init-fns))))
       ))))

 ;; returns [key type init-fn]
@@ -80,8 +80,8 @@
 ;; simple one-to-one mapping
 ;; key -> [key type fn]
 (defmethod do-transform-attribute
-  clojure.lang.Keyword [#^Keyword key #^Metadata md]
-  (let [#^Attribute attribute (.getAttribute md key)
+  clojure.lang.Keyword [key ^Metadata md]
+  (let [^Attribute attribute (.getAttribute md key)
 	type (.getType attribute)
 	getter (.getGetter attribute)
 	value-fn (fn [value] (.get getter value))]
@@ -90,17 +90,17 @@
 ;; synthetic attribute
 ;; [key type keys fn] -> [key type fn]
 (defmethod do-transform-attribute
-  clojure.lang.PersistentList [attribute #^Metadata md]
+  clojure.lang.PersistentList [attribute ^Metadata md]
   (let [[key type keys transform-fn] attribute
 	getters (map #(.getGetter (.getAttribute md %)) keys)
-	product-fn (fn [value] (map (fn [#^Getter getter] (.get getter value)) getters))
+	product-fn (fn [value] (map (fn [^Getter getter] (.get getter value)) getters))
 	init-fn (fn [value] (apply transform-fn (product-fn value)))]
     (list key type init-fn)))

 (defn third [s] (nth s 2))

-(defn do-transform [#^String suffix #^Model src-model & #^Collection attribute-descrips]
-  (let [#^Metadata model-metadata (.getMetadata src-model)
+(defn do-transform [^String suffix ^Model src-model & attribute-descrips]
+  (let [^Metadata model-metadata (.getMetadata src-model)
 	attribute-details (map #(do-transform-attribute % model-metadata) attribute-descrips)
 	attribute-keys (map first attribute-details)
 	attribute-types (map second attribute-details)
@@ -122,7 +122,7 @@
 ;;----------------------------------------

 (defn make-splitter
-  [#^IFn src-name-fn #^Model src-model key #^IFn value-to-keys #^IFn key-to-value #^IFn view-hook]
+  [src-name-fn ^Model src-model key value-to-keys key-to-value view-hook]
   (let [src-metadata (.getMetadata src-model)
 	mutable (.getMutable (.getAttribute src-metadata key))
 	map (new ConcurrentHashMap)
@@ -151,7 +151,7 @@
       ))))

 (defn do-split
-  [#^Model src-model #^Keyword key #^IFn value-to-keys #^IFn key-to-value #^IFn view-hook]
+  [^Model src-model key value-to-keys key-to-value view-hook]
   (connect src-model (make-splitter
 		      (fn [value] (str (.getName src-model) "." "split(" key "=" value")"))
 		      src-model
@@ -165,7 +165,7 @@
 ;;----------------------------------------

 (defn reducer
-  [#^String src-name #^Metadata src-metadata #^Metadata tgt-metadata reduction-key #^Collection extra-values #^IFn strategy-fn #^IFn value-key-fn]
+  [^String src-name ^Metadata src-metadata ^Metadata tgt-metadata reduction-key ^Collection extra-values strategy-fn value-key-fn]
   (let [strategy (strategy-fn src-metadata tgt-metadata reduction-key)]
     (Reducer. (str src-name "." (value-key-fn reduction-key))
 	      tgt-metadata extra-values strategy)))
@@ -175,8 +175,8 @@
 (defn sum-value-key [key]
   (str "sum(" key ")"))

-(defn #^Metadata sum-reducer-metadata
-  [#^Collection primary-keys sum-key #^Collection extra-attribute-specs]
+(defn ^Metadata sum-reducer-metadata
+  [^Collection primary-keys sum-key ^Collection extra-attribute-specs]
   (custom-metadata
    (name (gensym "org.dada.core.reducer.Sum"))
    Object
@@ -189,11 +189,11 @@
      [(keyword (sum-value-key sum-key)) Number true]]))
   )

-(defn make-sum-reducer-strategy [#^Metadata src-metadata #^Metadata tgt-metadata sum-key]
+(defn make-sum-reducer-strategy [^Metadata src-metadata ^Metadata tgt-metadata sum-key]
   (let [getter (.getGetter (.getAttribute src-metadata sum-key))
 	accessor (fn [value] (.get getter value))
-	new-value (fn [#^Update update] (accessor (.getNewValue update)))
-	old-value (fn [#^Update update] (accessor (.getOldValue update)))
+	new-value (fn [^Update update] (accessor (.getNewValue update)))
+	old-value (fn [^Update update] (accessor (.getOldValue update)))
 	creator (.getCreator tgt-metadata)]
     (proxy
      [Reducer$Strategy]
@@ -214,7 +214,7 @@
      )))

 (defn do-reduce-sum
-  [#^String src-name #^Metadata src-metadata #^Metadata tgt-metadata sum-key #^Collection extra-values]
+  [^String src-name ^Metadata src-metadata ^Metadata tgt-metadata sum-key ^Collection extra-values]
   (reducer src-name src-metadata tgt-metadata sum-key extra-values make-sum-reducer-strategy sum-value-key))

 ;; count specific stuff - should be in its own file
@@ -222,8 +222,8 @@
 (defn count-value-key [count-key]
   (str "count(" (or count-key "*")  ")"))

-(defn #^Metadata count-reducer-metadata
-  [#^Collection primary-keys count-key #^Collection extra-attribute-specs]
+(defn ^Metadata count-reducer-metadata
+  [^Collection primary-keys count-key ^Collection extra-attribute-specs]
   (custom-metadata
    (name (gensym "org.dada.core.reducer.Count"))
    Object
@@ -235,7 +235,7 @@
     [[:version Integer true]
      [(keyword (count-value-key count-key)) Number true]])))

-(defn make-count-reducer-strategy [#^Metadata src-metadata #^Metadata tgt-metadata & [count-key]]
+(defn make-count-reducer-strategy [^Metadata src-metadata ^Metadata tgt-metadata & [count-key]]
   ;; TODO - use count-key
   (let [creator (.getCreator tgt-metadata)]
     (proxy
@@ -251,7 +251,7 @@
     ))

 (defn do-reduce-count
-  [#^String src-name #^Metadata src-metadata #^Metadata tgt-metadata count-key #^Collection extra-values]
+  [^String src-name ^Metadata src-metadata ^Metadata tgt-metadata count-key ^Collection extra-values]
   (reducer src-name src-metadata tgt-metadata count-key extra-values make-count-reducer-strategy count-value-key))

 ;;----------------------------------------
@@ -294,7 +294,7 @@
 ;; ;; [name & options :name string :type class :convert fn :default val/fn] - TODO: :key, :version
 ;; ;; TODO :default not a good idea - would replace nulls
 ;; ;; TODO what about type hints on lambdas ?
-;; (defn expand-property [#^Class src-type #^Getter src-getter #^Keyword src-key & pvec]
+;; (defn expand-property [^Class src-type ^Getter src-getter src-key & pvec]
 ;;   (let [pmap (apply array-map pvec)
 ;; 	tgt-type (or (pmap :type) src-type)
 ;; 	tgt-key (or (pmap :name) src-key)
@@ -332,7 +332,7 @@
 ;; ;; allow splitting :split <split-fn> implemented by router - should provide fn for tgt-view construction...
 ;; ;; abstract out tgt-view construction so it can be done from parameters, during select, or on-demand from router...

-;; (defn select [#^Model src-model #^Keyword src-key-key #^Keyword src-version-key #^ISeq attrs & pvec]
+;; (defn select [^Model src-model src-key-key src-version-key attrs & pvec]
 ;;   (let [pmap (apply array-map pvec)
 ;; 	src-metadata (. src-model getMetadata)
 ;; 	src-keys (map keyword (. src-metadata getAttributeKeys))
@@ -385,7 +385,7 @@
 ;;----------------------------------------
 ;; still to refactor - also sum()

-(defn dtransform [#^Model src-model #^String suffix #^Keyword key-key #^Keyword version-key & #^Collection attribute-descrips]
+(defn dtransform [^Model src-model ^String suffix key-key version-key & attribute-descrips]
   ;; TODO: accept ready-made View ?
   ;; TODO: default key/version from src-model
   (insert *metamodel* (apply do-transform suffix src-model key-key version-key attribute-descrips)))
@@ -398,7 +398,7 @@
 ;; data-fn -  returns a tuple of [metamodel prefix extra-pairs...]
 ;;--------------------------------------------------------------------------------

-(defn metamodel [#^Model src-model]
+(defn metamodel [^Model src-model]
   (let [prefix (.getName src-model)
 	metaprefix (str "Meta-" prefix)]
     [ ;; metadata
@@ -433,7 +433,7 @@
 (defn ? [& chain]
   (dochain (thread-chain chain)))

-(defn meta-view [#^String suffix #^Model src-metamodel f]
+(defn meta-view [^String suffix ^Model src-metamodel f]
   ;; create a metamodel into which t place our results...
   (let [tgt-metamodel (model (str (.getName src-metamodel) suffix) (.getMetadata src-metamodel))]
     ;; register it with the global metamodel
@@ -443,7 +443,7 @@
      src-metamodel
      (proxy [View] []
 	    (update [insertions alterations deletions]
-		    (doall (map (fn [#^Update insertion]
+		    (doall (map (fn [^Update insertion]
 				    (trace (str "INSERTION " (.getNewValue insertion)))
 				    (apply f tgt-metamodel (.getNewValue insertion))) insertions)))))
     tgt-metamodel))
@@ -456,7 +456,7 @@
 	     [src-metadata (str metaprefix ".union()") extra-keys])
 	 ;; direct
 	 (fn []
-	     (let [[#^Model src-metamodel prefix #^Collection extra-pairs] (direct-fn)
+	     (let [[^Model src-metamodel prefix ^Collection extra-pairs] (direct-fn)
 		   tgt-model (model (or model-name (str prefix ".union()")) src-metadata)
 		   tgt-metamodel (meta-view ".union()" src-metamodel (fn [tgt-metamodel src-model extra-pairs] (connect src-model tgt-model)))]
 	       (insert *metamodel* tgt-model)
@@ -468,7 +468,7 @@
 ;; each split adds an extra key/value downstream that we may need to unwrap upstream
 (defn ccount [& [count-key]]
   (fn [[metadata-fn data-fn]]
-      (let [[#^Metadata src-metadata metaprefix extra-keys] (metadata-fn)
+      (let [[^Metadata src-metadata metaprefix extra-keys] (metadata-fn)
 	    dummy (trace (str "COUNT METADATA " metaprefix " " extra-keys))
 	    extra-attributes (map (fn [key] (.getAttribute src-metadata key)) extra-keys)
 	    tgt-metadata (count-reducer-metadata extra-keys count-key extra-attributes)]
@@ -478,14 +478,14 @@
 	 ;; direct
 	 (if data-fn
 	   (fn []
-	       (let [[#^Model src-metamodel prefix #^Collection extra-pairs] (data-fn)
+	       (let [[^Model src-metamodel prefix ^Collection extra-pairs] (data-fn)
 		     dummy (trace (str "COUNT extra-pairs [0]: " extra-pairs))
 		     new-prefix (str prefix "." (count-value-key count-key))
 		     tgt-model (model new-prefix src-metadata)
 		     tgt-metamodel (meta-view
 				    (str "." (count-value-key count-key))
 				    src-metamodel
-				    (fn [tgt-metamodel #^Model src-model extra-pairs]
+				    (fn [tgt-metamodel ^Model src-model extra-pairs]
 					(trace (str "COUNT extra-pairs [1]: " extra-pairs))
 					(let [count-model (do-reduce-count
 							   (.getName src-model)
@@ -500,7 +500,7 @@

 (defn sum [sum-key]
   (fn [[metadata-fn data-fn]]
-      (let [[#^Metadata src-metadata metaprefix extra-keys] (metadata-fn)
+      (let [[^Metadata src-metadata metaprefix extra-keys] (metadata-fn)
 	    dummy (trace (str "SUM METADATA " metaprefix " " extra-keys))
 	    extra-attributes (map (fn [key] (.getAttribute src-metadata key)) extra-keys)
 	    tgt-metadata (sum-reducer-metadata extra-keys sum-key extra-attributes)]
@@ -510,14 +510,14 @@
 	 ;; direct
 	 (if data-fn
 	   (fn []
-	       (let [[#^Model src-metamodel prefix #^Collection extra-pairs] (data-fn)
+	       (let [[^Model src-metamodel prefix ^Collection extra-pairs] (data-fn)
 		     dummy (trace (str "SUM extra-pairs [0]: " extra-pairs))
 		     new-prefix (str prefix "." (sum-value-key sum-key))
 		     tgt-model (model new-prefix src-metadata)
 		     tgt-metamodel (meta-view
 				    (str "." (sum-value-key sum-key))
 				    src-metamodel
-				    (fn [tgt-metamodel #^Model src-model extra-pairs]
+				    (fn [tgt-metamodel ^Model src-model extra-pairs]
 					(trace (str "SUM extra-pairs [1]: " extra-pairs))
 					(let [sum-model (do-reduce-sum
 							 (.getName src-model)
@@ -560,7 +560,7 @@
 	 ;; data
 	 (fn []
 	     (let [src-data-tuple (direct-fn)
-		   [#^Model src-metamodel src-prefix #^Collection src-extra-pairs] src-data-tuple
+		   [^Model src-metamodel src-prefix ^Collection src-extra-pairs] src-data-tuple
 		   dummy (trace (str "SPLIT src-extra-pairs " src-extra-pairs))
 		   tgt-metamodel (model (str (.getName src-metamodel) suffix) (.getMetadata src-metamodel))
 		   tgt-prefix (str src-prefix "." split-key)
@@ -578,11 +578,11 @@
 		       (update [insertions alterations deletions]
 			       (doall
 				(map
-				 (fn [#^Update insertion]
+				 (fn [^Update insertion]
 				     (let [[src-model src-extra-values] (.getNewValue insertion)
 					   chain-fn (if subchain
 					; plug split -> sub -> tgt
-						      (fn [#^Model split-model split-extra-value]
+						      (fn [^Model split-model split-extra-value]
 							  (let [split-metamodel (model (str (.getName src-metamodel) (str suffix "=" split-extra-value)) (.getMetadata src-metamodel))
 								split-prefix (str tgt-prefix "=" split-extra-value)
 								split-extra-pairs (concat src-extra-pairs [[split-key split-extra-value]])
@@ -609,14 +609,14 @@
 								    (update [insertions alterations deletions]
 									    (doall
 									     (map
-									      (fn [#^Update insertion]
+									      (fn [^Update insertion]
 										  (let [sub-model-tuple (.getNewValue insertion)] ;; [sub-model sub-extra-pairs]
 										    ;; UNCOMMENT HERE AND WORK IT OUT
 										    (insert tgt-metamodel (doall sub-model-tuple))
 										    ))
 									      insertions)))))))
 						      ;; plug split -> tgt
-						      (fn [#^Model split-model split-extra-value]
+						      (fn [^Model split-model split-extra-value]
 							  (trace (str "SPLIT - producing new model " split-model " " split-extra-value))
 							  (let [split-model-tuple (list split-model (concat src-extra-values [[split-key split-extra-value]]))]
 							    (insert *metamodel* split-model) ;add to global metamodel
@@ -642,7 +642,7 @@

 ;; pivot fn must supply such a closed list of values to be used as
 ;; attribute metadata for output model....
-(defn pivot-metadata [#^Metadata src-metadata #^Collection primary-keys #^Collection pivot-values value-key]
+(defn pivot-metadata [^Metadata src-metadata ^Collection primary-keys ^Collection pivot-values value-key]
   (let [value-type (.getType (.getAttribute src-metadata value-key))]
     (custom-metadata
      (name (gensym "org.dada.core.Pivot"))
@@ -671,7 +671,7 @@
 	     [tgt-metadata (str metaprefix tgt-name) extra-keys '(:pivot)])
 	 ;; direct
 	 (fn []
-	     (let [[#^Model src-metamodel prefix #^Collection extra-pairs] (direct-fn)
+	     (let [[^Model src-metamodel prefix ^Collection extra-pairs] (direct-fn)
 		   dummy (trace (str "PIVOT extra-pairs before pivot: " extra-pairs))
 		   extra-pairs (remove #(= (first %) pivot-key) extra-pairs)
 		   dummy (trace (str "PIVOT extra-pairs after pivot:  " extra-pairs))
@@ -690,4 +690,4 @@

 ;; types

-(defn date [#^Integer y #^Integer m #^Integer d] (LocalDate. y m d))
+(defn date [^Integer y ^Integer m ^Integer d] (LocalDate. y m d))


update all tabs when entry updated

update all tabs when entry updated

--- iwaswhere-web/src/cljs/iwaswhere_web/ui/markdown.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/ui/markdown.cljs
@@ -65,7 +65,9 @@
                                        ;(put-fn [:text-entry/update temp-entry])
                                        (prn key-code)
                                        (.preventDefault ev))))]
-        (when-not (= @last-saved latest-entry) (reset! last-saved latest-entry))
+        (when-not (= @last-saved latest-entry) (reset! last-saved latest-entry)
+                                               (reset! local-display-entry latest-entry)
+                                               (reset! local-saved-entry latest-entry))
         [:div.edit-md
          [:pre [:code {:content-editable true
                        :on-input         update-temp-fn


added test for stepped Fibonacci sequence solution.

--- euler-clj/test/euler_clj/core_test.clj
+++ euler-clj/test/euler_clj/core_test.clj
@@ -21,3 +21,7 @@
 (deftest test-problem-2
   (testing "problem-2 for n = 90")
     (is (= (problem-2 90) 44)))
+
+(deftest test-problem-2-unfiltered
+  (testing "problem-2-unfiltered for n = 90")
+    (is (= (problem-2-unfiltered 90) 44)))


removed cljs support

removed cljs support

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -1,8 +1,7 @@
 (ns babel.espanol.lexicon
   (:refer-clojure :exclude [get-in])
   (:require
-   #?(:clj [clojure.tools.logging :as log])
-   #?(:cljs [babel.logjs :as log])
+   [clojure.tools.logging :as log]
    [babel.lexiconfn :refer [compile-lex if-then
                             map-function-on-map-vals unify]]
    [babel.espanol.morphology :as morph]


Remove caddisfly tests count assertion

Remove caddisfly tests count assertion

--- backend/src/akvo/lumen/component/caddisfly.clj
+++ backend/src/akvo/lumen/component/caddisfly.clj
@@ -42,7 +42,7 @@
         tests (version-schema-backwards-adapt
                v0-tests
                (-> local-schema-uri io/resource slurp (json/parse-string keyword) extract-tests-v2))]
-    (assert (= v2-count (count tests)))
+    (when-not (= v2-count (count tests))(log/error :failed-caddisfly-expectations :v2-count v2-count :tests-count (count tests)))
     (log/warn ::start "Using caddisfly LOCAL schema-uri:" local-schema-uri)
     (map->Caddisfly (assoc opts :schema tests))))

@@ -53,7 +53,7 @@
         tests (version-schema-backwards-adapt
                v0-tests
                (-> schema-uri client/get :body (json/decode keyword) extract-tests-v2))]
-    (assert (= v2-count (count tests)))
+    (when-not (= v2-count (count tests))(log/error :failed-caddisfly-expectations :v2-count v2-count :tests-count (count tests)))
     (log/info ::start "Using caddisfly ONLINE schema-uri" schema-uri)
     (map->Caddisfly (assoc opts :schema tests))))


don't show the user subpages that can't be accessed

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -737,13 +737,34 @@
    :billing billing
    :cancel cancel})

+(defn determine-subpage
+  "Determines which subpage we should show the user. If they have
+   a plan, then we don't want to show them the plan page; if they
+   don't have a plan, then we don't want to show them the invoices page."
+  [subpage plan org-name]
+  (cond (#{:users :projects} subpage)
+        subpage
+
+        (and plan
+             (plan-model/can-edit-plan? plan org-name)
+             (= subpage :plan))
+        :containers
+
+        (and plan
+             (not (plan-model/can-edit-plan? plan org-name))
+             (#{:containers :organizations :billing :cancel} subpage))
+        :plan
+
+        :else subpage))
+
 (defn org-settings [app owner]
   (reify
     om/IRender
     (render [_]
-      (let [subpage (get app :org-settings-subpage)
+      (let [requested-subpage (get app :org-settings-subpage :projects)
             org-data (get-in app state/org-data-path)
-            plan (get-in app state/org-plan-path)]
+            plan (get-in app state/org-plan-path)
+            subpage (determine-subpage requested-subpage plan (:name org-data))]
         (html [:div.container-fluid.org-page
                (if-not (:name org-data)
                  [:div.loading-spinner common/spinner]


Remove nrepl transcript.

Remove nrepl transcript.


Add a message ensuring that a stack trace here is normal. At least until stack trace filtering is implemented in the clojure module.

--- clojure/src/test/resources/cucumber/runtime/clojure/stepdefs.clj
+++ clojure/src/test/resources/cucumber/runtime/clojure/stepdefs.clj
@@ -26,4 +26,4 @@

 (Given #"^(\d+) unimplemented step$" [arg1]
   (comment  Express the Regexp above with the code you wish you had  )
-  (throw (cucumber.runtime.PendingException.)))+  (throw (cucumber.runtime.PendingException. "This is pending. Seeing a stacktrace here is normal.")))


removed unused imports from test-org-settings

--- test-cljs/frontend/components/test_org_settings.cljs
+++ test-cljs/frontend/components/test_org_settings.cljs
@@ -1,7 +1,14 @@
 (ns frontend.components.test-org-settings
-  (:require [frontend.test-utils :as test-utils :refer [example-plan is-re]]
+  (:require [cljs.core.async :as async]
+            [frontend.test-utils :as test-utils :refer [example-plan is-re]]
             [frontend.components.org-settings :as org-settings]
+            [frontend.utils.docs :as doc-utils]
             [frontend.utils.html :refer [hiccup->html-str]]
+            [frontend.stefon :as stefon]
+            [goog.dom]
+            [om.core :as om :include-macros true]
+            [frontend.routes :as routes]
+            [om.dom :refer (render-to-str)]
             [cljs.test :as test :refer-macros [deftest is testing]]))

 (deftest test-discount-rendering


update ship width and position

update ship width and position

--- cartagena-web/src/cartagena_web/main.cljs
+++ cartagena-web/src/cartagena_web/main.cljs
@@ -48,14 +48,14 @@
     {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"img/jail.png\" x=0 y=0 width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
    ;; ship
    [:rect
-    {:x (to-scale 400)
+    {:x (to-scale 410)
      :y (to-scale 240)
-     :width (to-scale 90)
+     :width (to-scale 80)
      :height (to-scale 60)
      :stroke "black"
      :fill "sienna"}]
    [:g
-    {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"img/ship.png\" x=\"" (to-scale 400) "\" y=\"" (to-scale 240) "\" width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
+    {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"img/ship.png\" x=\"" (to-scale 410) "\" y=\"" (to-scale 240) "\" width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
    ])

 (def piece-positions


cleanup

cleanup

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -477,11 +477,6 @@
               z-ref
               0))
          z-ref))))
-
-;(defn z-stage-needs-adjustment [stage-name]
-;  (or (not (@state :init-continuous-focus))
-;      (not (core isContinuousFocusEnabled))
-;      (core isContinuousFocusDrive stage-name)))

 (defn z-stage-needs-adjustment [stage-name]
   (not (and (@state :init-continuous-focus)
@@ -780,21 +775,19 @@
     (.addToAlbum gui (make-TaggedImage img))))

-(defn run-acquisition-sequence [this settings acq-eng]
+(defn run-acquisition-with-processors [this settings acq-eng]
   (def last-acq this)
   (def eng acq-eng)
   (load-mm)
   (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)
                               "Acquisition Engine Thread (Clojure)")
           processors (ProcessorStack. out-queue (.getTaggedImageProcessors acq-eng))
-          out-queue-2 (.begin processors)
-          ]
-      (swap! (.state this) assoc
-             :acq-thread acq-thread)
-      (def outq out-queue)
+          out-queue-2 (.begin processors)]
+      (swap! (.state this) assoc :acq-thread acq-thread)
       (when-not (:stop @(.state this))
         (.start acq-thread))
       out-queue-2)))
@@ -807,16 +800,17 @@
 (defn -run [this acq-settings acq-eng]
   (let [settings (convert-settings acq-settings)
         summary-metadata (make-summary-metadata settings)
-        out-queue-2 (run-acquisition-sequence this settings acq-eng)]
-  (when-not (:stop @(.state this))
-    (let [live-acq (LiveAcq. mmc out-queue-2 summary-metadata
-                             (:save settings) acq-eng gui)]
-      (swap! (.state this) assoc
-             :summary-metadata summary-metadata
-             :display live-acq
-             :image-cache (.getImageCache live-acq))
-      (.start live-acq)
-      (.getAcquisitionName live-acq)))))
+        out-queue-2 (run-acquisition-with-processors this settings acq-eng)]
+    (swap! (.state this) assoc :summary-metadata summary-metadata)
+    (when-not (:stop @(.state this))
+      (let [live-acq (LiveAcq. mmc out-queue-2 summary-metadata
+                               (:save settings) acq-eng gui)]
+        (swap! (.state this) assoc
+               :summary-metadata summary-metadata
+               :display live-acq
+               :image-cache (.getImageCache live-acq))
+        (.start live-acq)
+        (.getAcquisitionName live-acq)))))

 (defn -acquireSingle [this]
   (load-mm)


Add a 0 energy level to `+orbitals-extra-at-energy-level+`

--- test/com/nomistech/clojure_the_language/c_900_appy_stuff/s_100_science/ss_atomic_orbitals.clj
+++ test/com/nomistech/clojure_the_language/c_900_appy_stuff/s_100_science/ss_atomic_orbitals.clj
@@ -2,7 +2,8 @@
   (:require [midje.sweet :refer :all]))

 (def +orbitals-extra-at-energy-level+
-  [{:s 1}
+  [{}
+   {:s 1}
    {:p 3}
    {}
    {:d 5}
@@ -11,12 +12,11 @@
    {}])

 (def +n-orbitals-extra-at-energy-level-diffs+
-  (cons 0
-        (for [m +orbitals-extra-at-energy-level+]
-          (if (empty? m)
-            0
-            (apply + (for [[k v] m]
-                       v))))))
+  (for [m +orbitals-extra-at-energy-level+]
+    (if (empty? m)
+      0
+      (apply + (for [[k v] m]
+                 v)))))

 (def +n-electrons-extra-at-energy-level-diffs+
   (map (partial * 2)


Don't update if it's already balanced.

Don't update if it's already balanced.

--- src/onyx/log/commands/volunteer_for_task.clj
+++ src/onyx/log/commands/volunteer_for_task.clj
@@ -81,13 +81,18 @@

 (defmethod select-job :onyx.job-scheduler/round-robin
   [{:keys [args]} replica]
-  (let [job (or (find-job-needing-peers replica) (round-robin-next-job replica))
+  (let [balanced (common/balance-jobs replica)
+        counts (common/job->peers replica)
+        job (or (find-job-needing-peers replica) (round-robin-next-job replica))
         task (select-task replica job)
         prev (get (allocations->peers (:allocations replica)) (:id args))]
-    (-> replica
-        (remove-peers args prev)
-        (update-in [:allocations job task] conj (:id args))
-        (update-in [:allocations job task] vec))))
+    (if (and (= balanced (into {} (map (fn [[job peers]] {job (count peers)}) counts)))
+             (= (apply + (vals balanced)) (count (:peers replica))))
+      replica
+      (-> replica
+          (remove-peers args prev)
+          (update-in [:allocations job task] conj (:id args))
+          (update-in [:allocations job task] vec)))))

 (defmethod select-job :default
   [_ replica]


CMR-738: Added test of retrieving Atom spatial results with cartesian polygons.:

--- test/cmr/system_int_test/search/collection_search_format_test.clj
+++ test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -251,7 +251,11 @@
                                         :summary "Summary of coll2"
                                         :beginning-date-time "2010-01-01T12:00:00Z"
                                         :ending-date-time "2010-01-11T12:00:00Z"
-                                        :related-urls [ru3]}))]
+                                        :related-urls [ru3]
+                                        :spatial-coverage
+                                        (dc/spatial :cartesian
+                                                    :cartesian
+                                                    (poly/polygon [(umm-s/ords->ring -70 20, 70 20, 70 30, -70 30, -70 20)]))}))]

     (index/refresh-elastic-index)


(PDB-3723) Exclude structured values from fact-contents

[rlb@puppet.com: adjust message; move removal of path gc and unused db
 variable to other commits]

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -515,7 +515,10 @@
                                            "                   from fact_paths) distinct_paths"
                                            "   where jsonb_extract_path(stable||volatile,"
                                            "                            variadic path_array)"
-                                           "           is not null)"))
+                                           "           is not null"
+                                           "         and jsonb_typeof(jsonb_extract_path(stable||volatile,
+                                                                                variadic path_array))"
+                                           "               <> 'object')"))
                                      :fs]]
                              :left-join [[:environments :env]
                                          [:= :fs.environment_id :env.id]]}


Custom stem-base-from-base for Uwes Algorithm

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

--- src/conexp/contrib/experimental/ryssel_algorithm.clj
+++ src/conexp/contrib/experimental/ryssel_algorithm.clj
@@ -59,4 +59,27 @@

 ;;;

+(defn stem-base-from-base*
+  "For a given set of implications returns its stem-base."
+  [implications]
+  (loop [stem-base    #{},
+         implications implications,
+         all          (vec implications)]
+    (if (empty? implications)
+      stem-base
+      (let [A->B         (first implications),
+            implications (rest implications),
+            all          (subvec all 1)
+            A*           (close-under-implications all (premise A->B)),
+            A*->B        (make-implication A* (conclusion A->B))]
+        (if (not-empty (conclusion A*->B))
+          (recur (conj stem-base A*->B)
+                 implications
+                 (conj all A*->B))
+          (recur stem-base
+                 implications
+                 all))))))
+
+;;;
+
 nil


moving stuff

moving stuff

git-svn-id: 90c135e2b654d5d39218b235c725b90ec5779e48@386 cd74b5cd-e609-0410-a199-9e5d10d28226

--- src/edu/berkeley/angel/planning/strips/instances.clj
+++ src/edu/berkeley/angel/planning/strips/instances.clj
@@ -111,14 +111,6 @@
   (let [goal-atoms (set (:goal-atoms instance))]
      (make-goal #(every? % goal-atoms))))

-(defn strips-instance->state-space-search-problem
-  [instance]
-  (make-search-problem
-   (set (:init-atoms instance))
-   nil
-   (get-strips-action-space instance)
-   (get-strips-goal instance)
-   ))

 (defmethod planning-problem->state-space-search-problem :edu.berkeley.angel.planning.strips/StripsPlanningInstance
   [instance]
@@ -131,11 +123,11 @@

 (comment
-  (uniform-cost-graph-search
-  (strips-instance->state-space-search-problem
+  (map :name (first (uniform-cost-graph-search
+  (planning-problem->state-space-search-problem
   (read-strips-planning-instance
    (read-strips-planning-domain "/Users/jawolfe/Projects/research/IPC/IPC2/2000-Tests/Blocks/Track1/Typed/domain.pddl")
-   "/Users/jawolfe/Projects/research/IPC/IPC2/2000-Tests/Blocks/Track1/Typed/probBLOCKS-4-0.pddl")))
-
+   "/Users/jawolfe/Projects/research/IPC/IPC2/2000-Tests/Blocks/Track1/Typed/probBLOCKS-4-0.pddl")))))
+

   )


formatting change

formatting change

--- opennebula/config/src/com/sixsq/slipstream/connector/opennebula.clj
+++ opennebula/config/src/com/sixsq/slipstream/connector/opennebula.clj
@@ -3,8 +3,7 @@
     [com.sixsq.slipstream.connector.opennebula-template :as tpl]
     [com.sixsq.slipstream.ssclj.resources.common.schema :as sch]
     [com.sixsq.slipstream.ssclj.resources.common.utils :as u]
-    [com.sixsq.slipstream.ssclj.resources.connector :as cr]
-    ))
+    [com.sixsq.slipstream.ssclj.resources.connector :as cr]))

 ;;
 ;; schemas


[#10808] Can't recover keys from keycard

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

--- src/status_im/ui/screens/keycard/recovery/views.cljs
+++ src/status_im/ui/screens/keycard/recovery/views.cljs
@@ -147,8 +147,7 @@
                                :color      (if (> 3 free-pairing-slots) colors/red colors/gray)}}
            (i18n/label :t/keycard-free-pairing-slots {:n free-pairing-slots})]])]
       [react/view
-       [react/view {:flex            1
-                    :padding         16
+       [react/view {:padding         16
                     :justify-content :center}
         [quo/text-input
          {:on-change-text    #(re-frame/dispatch [:keycard.onboarding.pair.ui/input-changed %])


Fixing a protocol-related compile error in the in-memory-date-cache sketch

--- src/org/gensym/viddy/queries/in_memory_date_cache.clj
+++ src/org/gensym/viddy/queries/in_memory_date_cache.clj
@@ -4,17 +4,20 @@
 (defn make-datacache [calculation-fns]
   (reify dc/DateCache

-    (maybe-find-for-date-range [this key start end]
+    (maybe-find-for-date-range [this key start end args]
       (if (contains? this [key start end])
         [true (get this [key start end])]
         [false nil]))

-    (calculate-for-date-range [this key start end]
+    (calculate-for-date-range [this key start end args]
       ((get calculation-fns key) start end))

-    (store-calculation [this key start end calculation]
+    (store-calculation [this key start end calculation args]
       (assoc this [key start end] calculation))

-    (concat-calculation [this a b]
-      (calculation-fns key) a b)))
+    (concat-calculation [this key a b]
+      (calculation-fns key) a b)
+
+    (empty-calculation [datasource key]
+      )))


Added NREPL server.

Added NREPL server.

--- lambdalf-lib/src/main/clojure/alfresco.clj
+++ lambdalf-lib/src/main/clojure/alfresco.clj
@@ -1,7 +1,8 @@
 (ns alfresco
   (:require [swank.swank]))
+(use '[clojure.tools.nrepl.server :only (start-server stop-server)])

-(def *swank-server* (atom nil))
+(def ^:dynamic *swank-server* (atom nil))

 (defn- switch
   "Starts up the swank server. Server shutdown is currently not supported."
@@ -10,6 +11,9 @@

 (defn start-swank []
   (swap! *swank-server* switch))
+
+; Start the nREPL server - note: should be handled more like the swank server above (i.e. hold a reference to the server in an atom)
+(defonce nrepl-server (start-server :port 7888))

 (gen-class :name alfresco.interop.ClojureInit
            :prefix "ci-"


(maint) Fix factset-with-package-inventory-queries test

Replace contains? with not-any? to fix bug.

--- test/puppetlabs/puppetdb/http/facts_test.clj
+++ test/puppetlabs/puppetdb/http/facts_test.clj
@@ -1968,7 +1968,7 @@
   (testing "factsets with package inventory query should ignore deactivated nodes"
     (let [responses (json/parse-string (slurp (:body (query-response
                                                        method endpoint))))]
-      (is (not (contains? (into [] (map #(get % "certname") responses)) "foo4")))))
+      (is (not-any? #(= "foo4" %) (map #(get % "certname") responses)))))

   (testing "factset queries should return appropriate results"
     (let [queries [["=" "certname" "foo1"]


reword Djinn label, hack to let Nerve Agent gain counters on Sneakdoor runs

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -151,7 +151,7 @@
     :events {:purge {:effect (effect (trash card))}}}

    "Djinn"
-   {:abilities [{:label "Add a virus program to your Grip from your Stack"
+   {:abilities [{:label "Search your Stack for a virus program and add it to your Grip"
                  :prompt "Choose a Virus"
                  :msg (msg "adds " (:title target) " to their Grip")
                  :choices (req (cancellable (filter #(and (is-type? % "Program")
@@ -590,6 +590,7 @@
                                    {:req (req (= target :archives))
                                     :successful-run
                                     {:effect (req (swap! state assoc-in [:run :server] [:hq])
+                                                  (trigger-event state :corp :no-action)
                                                   (update-run-ice state side)
                                                   (system-msg state side
                                                               (str "uses Sneakdoor Beta to make a successful run on HQ")))}}


unregister Clot effect when trashed voluntarily by Runner

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -68,7 +68,8 @@
     :events {:purge {:effect (req (swap! state update-in [:corp :register] dissoc :cannot-score)
                                   (trash state side card))}
              :corp-install {:req (req (= (:type target) "Agenda"))
-                            :effect (req (swap! state update-in [:corp :register :cannot-score] #(cons target %)))}}}
+                            :effect (req (swap! state update-in [:corp :register :cannot-score] #(cons target %)))}}
+    :leave-play (req (swap! state update-in [:corp :register] dissoc :cannot-score))}

    "Collective Consciousness"
    {:events {:rez {:req (req (= (:type target) "ICE")) :msg "draw 1 card"


Parametrize the executor for the local fs.

--- src/datoteka/storages/local.clj
+++ src/datoteka/storages/local.clj
@@ -28,7 +28,6 @@
             [clojure.java.io :as io]
             [executors.core :as exec]
             [datoteka.proto :as pt]
-            [datoteka.impl :as impl]
             [datoteka.core :as fs])
   (:import java.io.InputStream
            java.io.OutputStream
@@ -54,29 +53,35 @@
         ^Path fullpath (normalize-path base path)]
     (when-not (fs/exists? (.getParent fullpath))
       (fs/create-dir! (.getParent fullpath)))
-    (with-open [^InputStream source (pt/-input-stream content)
-                ^OutputStream dest (Files/newOutputStream
-                                    fullpath fs/write-open-opts)]
-      (io/copy source dest)
+    (with-open [^InputStream src (io/input-stream content)
+                ^OutputStream dst (io/output-stream content)]
+      (io/copy src dst)
       path)))

 (defn- delete
   [base path]
   (let [path (->> (pt/-path path)
                   (normalize-path base))]
-    (Files/deleteIfExists ^Path path)))
+    (fs/delete-sigle path)))

-(defrecord LocalFileSystemBackend [^Path base ^URI baseuri]
+(defn- submit
+  [executor func]
+  (let [supplier (reify Supplier (get [_] (func)))]
+     (CompletableFuture/supplyAsync supplier executor)))
+
+(defrecord LocalFileSystemBackend [^Path base
+                                   ^URI baseuri
+                                   ^ExecutorService executor]
   pt/IPublicStorage
   (-public-uri [_ path]
     (.resolve baseuri (str path)))

   pt/IStorage
   (-save [_ path content]
-    (exec/submit (partial save base path content)))
+    (submit executor #(save base path content)))

   (-delete [_ path]
-    (exec/submit (partial delete base path)))
+    (submit executor #(delete base path)))

   (-exists? [this path]
     (try
@@ -89,8 +94,8 @@

   pt/IClearableStorage
   (-clear [_]
-    (fs/delete-dir! base)
-    (fs/create-dir! base))
+    (fs/delete base)
+    (fs/create-dir base))

   pt/ILocalStorage
   (-lookup [_ path']
@@ -108,7 +113,9 @@
   If that path does not exists it will be automatically created,
   if it exists but is not a directory, an exception will be
   raised."
-  [{:keys [basedir baseuri] :as keys}]
+  [{:keys [basedir baseuri executor]
+    :or {executor (ForkJoinPool/commonPool)}
+    :as keys}]
   (let [^Path basepath (pt/-path basedir)
         ^URI baseuri (pt/-uri baseuri)]
     (when (and (fs/exists? basepath)
@@ -116,7 +123,7 @@
       (throw (ex-info "File already exists." {})))

     (when-not (fs/exists? basepath)
-      (fs/create-dir! basepath))
+      (fs/create-dir basepath))

-    (->LocalFileSystemBackend basepath baseuri)))
+    (->LocalFileSystemBackend basepath baseuri executor)))


Refactor

Refactor

--- src/front/ui/widgets/tasks.cljs
+++ src/front/ui/widgets/tasks.cljs
@@ -326,8 +326,8 @@
            project
            tasks-done]))]]))

-(defn render-todays
-  [tasks]
+(defn- render-categorized-todos-for
+  [filter-fn tasks]
   (let [projects (distinct (map #(state/get-project-by-id (get-in % [:project :id]))
                                 tasks))]
     [:div#tasks-container
@@ -339,8 +339,7 @@
                 [:li.project
                  [:div.project-name
                   [:span (:name p)]]
-                 (let [tasks   (filter #(:today %)
-                                       (:tasks p))
+                 (let [tasks   (filter-fn p)
                        n-tasks (count tasks)]
                    (if (:show-only-first p)
                      [:div
@@ -365,3 +364,11 @@
                                       (state/update-project! p
                                                              :show-only-first true))}
                          "Show only first"])]))]))]]]))
+
+(defn render-todays
+  [tasks]
+  [render-categorized-todos-for (fn [p]
+                                  (filter #(and (:today %)
+                                                (not (:done %)))
+                                          (:tasks p)))
+   tasks])


make reference links crossed-out if they are tagged as removed, and don't create a link if they don't exist yet (close #117)

--- src/main/cljs_api_gen/write.clj
+++ src/main/cljs_api_gen/write.clj
@@ -26,6 +26,10 @@
     [stencil.core :as stencil]
     ))

+(def ^:dynamic *result*
+  "The current result that we are writing."
+  nil)
+
 (def ns-descriptions
   "FIXME: put this in the official docstrings if missing (patch request)"

@@ -244,8 +248,10 @@
 (defn ref-link
   [full-name]
   (when full-name
-    {:display-name (get-full-display-name full-name)
-     :link (str (encode/encode-fullname full-name) ".md")}))
+    (let [item (get-in *result* [:symbols full-name])]
+      {:display-name (cond-> (md-escape (get-full-display-name full-name))
+                       (:removed item) md-strikethru)
+       :link (when item (str (encode/encode-fullname full-name) ".md"))})))

 (defn add-related-links
   [{:keys [related] :as item}]
@@ -522,27 +528,28 @@
 ;;--------------------------------------------------------------------------------

 (defn dump-result! [result]
-  (mkdir *output-dir*)
-  (mkdir (str *output-dir* "/" refs-dir))
-
-  (println "writing edn...")
-  (dump-edn-file! result)
-
-  (println "writing ref files...")
-  (doseq [item (vals (:symbols result))]
-    (dump-ref-file! item))
-
-  (println "writing readme...")
-  (dump-readme! result)
-
-  (println "writing history...")
-  (dump-history! result)
-
-  (println "writing unported...")
-  (dump-unported! result)
-
-  (println "writing unfinished...")
-  (dump-unfinished! result)
-
+  (binding [*result* result]
+
+    (mkdir *output-dir*)
+    (mkdir (str *output-dir* "/" refs-dir))
+
+    (println "writing edn...")
+    (dump-edn-file! result)
+
+    (println "writing ref files...")
+    (doseq [item (vals (:symbols result))]
+      (dump-ref-file! item))
+
+    (println "writing readme...")
+    (dump-readme! result)
+
+    (println "writing history...")
+    (dump-history! result)
+
+    (println "writing unported...")
+    (dump-unported! result)
+
+    (println "writing unfinished...")
+    (dump-unfinished! result))
   )


Return correct poller; fixes #11

Return correct poller; fixes #11

--- src/main/clojure/gpio/poll.cljc
+++ src/main/clojure/gpio/poll.cljc
@@ -18,9 +18,11 @@
         (when-let [events (.poll poller timeout)]
           (doseq [_ (filter #(= port (.getData %)) events)]
             (on-change-fn))
-          (recur)))))
+          (recur)))

-  (defn cancel-watch [poller]
+      poller))
+
+  (defn cancel-watch [^EventPoller poller]
     (.close poller))

 )


implement Tori Hanzō

implement Tori Hanzō

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -365,6 +365,29 @@
                                    :msg (msg "trash a copy of " (:title target) " from HQ and force the Runner to encounter it again")}
                                  card nil)))}]}

+   "Tori Hanzō"
+   {:events
+    {:pre-resolve-damage
+     {:once :per-run
+      :req (req (and this-server (= target :net) (> (last targets) 0)))
+      :effect (req (swap! state assoc-in [:damage :damage-replace] true)
+                   (damage-defer state side :net (last targets))
+                   (show-wait-prompt state :runner "Corp to use Tori Hanzō")
+                   (resolve-ability state side
+                     {:optional {:req (req (can-pay? state :corp nil [:credit 2]))
+                                 :prompt (str "Pay 2 [Credits] to do 1 brain damage with Tori Hanzō?") :player :corp
+                                 :yes-ability {:msg "do 1 brain damage instead of net damage"
+                                               :effect (req (swap! state update-in [:damage] dissoc :damage-replace)
+                                                            (clear-wait-prompt state :runner)
+                                                            (pay state :corp card :credit 2)
+                                                            (damage state side :brain 1 {:card card}))}
+                                 :no-ability {:effect (req (swap! state update-in [:damage] dissoc :damage-replace)
+                                                           (clear-wait-prompt state :runner)
+                                                           (damage state side :net (get-defer-damage state side :net nil)
+                                                                   {:card card}))}}} card nil))}
+     :prevented-damage {:req (req (and this-server (= target :net) (> (last targets) 0)))
+                        :effect (req (swap! state assoc-in [:per-run (:cid card)] true))}}}
+
    "Tyrs Hand"
    {:abilities [{:label "[Trash]: Prevent a subroutine on a Bioroid from being broken"
                  :req (req (and (= (butlast (:zone current-ice)) (butlast (:zone card)))


s/funciton/function

s/funciton/function


add test for Dinosaurus

add test for Dinosaurus

--- src/clj/test/cards-hardware.clj
+++ src/clj/test/cards-hardware.clj
@@ -36,10 +36,7 @@
       (prompt-select :runner (find-card "Datasucker" (:discard (get-runner))))
       (let [ds (get-in @state [:runner :rig :program 0])]
         (is (not (nil? ds)))
-        (is (= (:title ds) "Datasucker"))
-        )
-      )
-    ))
+        (is (= (:title ds) "Datasucker"))))))

 (deftest comet-event-play
   "Comet - Play event without spending a click after first event played"
@@ -56,6 +53,24 @@
       (is (= 7 (:credit (get-runner))))
       (is (= 2 (:click (get-runner))))
       (is (nil? (:comet-event (core/get-card state comet))) "Comet ability disabled"))))
+
+(deftest dinosaurus-strength-boost-mu-savings
+  "Dinosaurus - Boost strength of hosted icebreaker; keep MU the same when hosting or trashing hosted breaker"
+  (do-game
+    (new-game (default-corp) (default-runner [(qty "Dinosaurus" 1) (qty "Battering Ram" 1)]))
+    (take-credits state :corp)
+    (core/gain state :runner :credit 5)
+    (play-from-hand state :runner "Dinosaurus")
+    (let [dino (get-in @state [:runner :rig :hardware 0])]
+      (card-ability state :runner dino 0)
+      (core/select state :runner {:card (find-card "Battering Ram" (:hand (get-runner)))})
+      (is (= 2 (:click (get-runner))))
+      (is (= 0 (:credit (get-runner))))
+      (is (= 4 (:memory (get-runner))) "Battering Ram 2 MU not deducted from available MU")
+      (let [ram (first (:hosted (refresh dino)))]
+        (is (= 5 (:current-strength (refresh ram))) "Dinosaurus giving +2 strength to Battering Ram")
+        (core/move state :runner (find-card "Battering Ram" (:hosted (refresh dino))) :discard) ; trash Battering Ram
+        (is (= 4 (:memory (get-runner))) "Battering Ram 2 MU not added to available MU")))))

 (deftest turntable-swap
   "Turntable - Swap a stolen agenda for a scored agenda"


Properly use rank when combining registered middlewares.


Moved to google closure svg graphics.

Moved to google closure svg graphics.

--- ClojureScript/hello.cljs
+++ ClojureScript/hello.cljs
@@ -2,18 +2,21 @@

 (ns hello
     (:use
-        [goog.dom :only [appendChild createDom]]
+        [goog.dom :only [appendChild createDom createTextNode removeChildren]]
         [goog.events :only [listen]]
         [goog.events.EventType :only [CLICK]]
+        [goog.graphics :only [createGraphics Stroke SolidFill]]
         ))

 (def pos (atom 0))
 (def keys-pressed (atom (set)))
+(def my-code-url "https://github.com/pauldoo/scratch/blob/master/ClojureScript/hello.cljs")

 (defn print-to-log [v]
     (.log js/console v))

-(defn foobar [t canvas y event] (do
+(defn foobar [t canvas-element y event] (do
+    (print-to-log "hello")
     (cond
         (= t :up)
             (swap! keys-pressed disj (.keyCode event))
@@ -21,28 +24,28 @@
             (swap! keys-pressed conj (.keyCode event))
         :else
             nil)
-    (let [ctx (.getContext canvas "2d")
-        x (swap! pos inc)]
+    (let [x (swap! pos inc)
+        graphics (goog.graphics/createGraphics 400 300)]
         (do
-            (. ctx (save))
-            (.clearRect ctx 0 0 (.width canvas) (.height canvas))
-            (set! (.fillStyle ctx) "red")
-            (.fillRect ctx x y 100 50)
-            (. ctx (restore))
+            (.drawCircle graphics x y 30 (Stroke. 2 "green") (SolidFill. "yellow"))
+            (goog.dom/removeChildren canvas-element)
+            (.render graphics canvas-element)
             ))))

 (defn ^:export main []
     (let [
-        canvas (goog.dom/createDom "canvas" (.strobj {
-            "width" 400
-            "height" 300
-            "style" "border: 1px solid #000000"
-            }) "")
+        canvas (goog.dom/createDom "div" {} "")
         button (goog.dom/createDom "button" {} "Click!")]
         (do
             (goog.events/listen button goog.events.EventType/CLICK (partial foobar :click canvas 100))
             (goog.events/listen document.body goog.events.EventType/KEYDOWN (partial foobar :down canvas 50) true)
             (goog.events/listen document.body goog.events.EventType/KEYUP (partial foobar :up canvas 150) true)
-            (dorun (map (partial goog.dom/appendChild document.body)
-                [(goog.dom/createDom "h1" {} "Hello!") canvas button])))))
+            (goog.dom/appendChild document.body (goog.dom/createDom "div" {}
+                (goog.dom/createDom "h1" {} "Work in progress..")
+                (goog.dom/createDom "div" {} "Try clicking the button, or pressing keys.")
+                (goog.dom/createDom "div" {}
+                    (goog.dom/createTextNode "My code lives here: ")
+                    (goog.dom/createDom "a" (.strobj {"href" my-code-url}) my-code-url))
+                button
+                canvas)))))


Add to information model.

Add to information model.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -509,7 +509,12 @@
             :lifecycle/after-retry-segment {:doc "A function that takes four arguments - an event map, a message id, the return of an input plugin ack-segment call, and the matching lifecycle map. May return a value of any type which will be discarded. This function is whenever a segment at the input task has been pending for greater than pending-timeout time and will be retried."
                                             :type :function
                                             :optional? true
-                                            :added "0.8.0"}}}
+                                            :added "0.8.0"}
+
+            :lifecycle/handle-exception {:doc "If an exception is thrown during any lifecycle execution, one or more lifecycle handlers may be defined. If present, the exception will be caught and passed to this function,  which takes 3 arguments - an event map, the keyword lifecycle name from which the exception was thrown, and the exception object. This function must return `true` or `false` indicating whether the job should be restarted. If any exception handling function defined for this task returns `false`, the job is killed."
+                                            :type :function
+                                            :optional? true
+                                            :added "0.8.3"}}}

    :peer-config
    {:summary "All options available to configure the virtual peers and development environment."
@@ -1083,7 +1088,8 @@
     :lifecycle/after-batch
     :lifecycle/after-task-stop
     :lifecycle/after-ack-segment
-    :lifecycle/after-retry-segment]
+    :lifecycle/after-retry-segment
+    :lifecycle/handle-exception]
    :peer-config
    [:onyx/id :onyx.peer/job-scheduler :zookeeper/address
     :onyx.peer/inbox-capacity :onyx.peer/outbox-capacity


Construct re patterns

Construct re patterns

--- src/org/spootnik/fleet/http.clj
+++ src/org/spootnik/fleet/http.clj
@@ -92,7 +92,7 @@
 (defn yield-cors-match
   [{:keys [origins] :or {origins []}}]
   (fn [origin]
-    (some #(re-find % origin) origins)))
+    (some #(re-find % origin) (map re-pattern origins))))

 (defn start-http
   [scenarios engine opts]


Server does not need a db ref.

Server does not need a db ref.

--- dev/src/config/dev_config.clj
+++ dev/src/config/dev_config.clj
@@ -13,7 +13,6 @@
                                                           :asset-path           "js/compiled/out"
                                                           :source-map-timestamp true}}]}
    :server/jetty      {:handler (ig/ref :handler/main)
-                       :db      (ig/ref :db/postgres)
                        :opts    {:port 3456 :join? false}}
    :pretty/exceptions {}
    :logger/timbre     {:appenders {:spit {:fname "logs/dev.log"}}}})


stack service div moved to form layout group

--- src/cljs/swarmpit/component/stack/info.cljs
+++ src/cljs/swarmpit/component/stack/info.cljs
@@ -76,11 +76,13 @@
                      (str "Stack removing failed. " (:error response))))}))

 (rum/defc form-services < rum/static [services]
-  (tlist/table services/headers
-               (sort-by :serviceName services)
+  [:div.form-layout-group
+   (form/section "Services")
+   (list/table (map :name services/headers)
+               services
                services/render-item
                services/render-item-keys
-               services/onclick-handler))
+               services/onclick-handler)])

 (rum/defc form-networks < rum/static [networks]
   (when (not-empty networks)
@@ -147,9 +149,8 @@
        (comp/raised-button
          {:onTouchTap #(delete-stack-handler stack-name)
           :label      "Delete"}))]]
-   (form-services services)
    [:div.form-layout
-    [:div.form-layout-group]
+    (form-services services)
     (form-networks networks)
     (form-volumes volumes)
     (form-configs configs)


A few more minor cleanup fixes

A few more minor cleanup fixes

--- src/com/puppetlabs/puppetdb/scf/migrate.clj
+++ src/com/puppetlabs/puppetdb/scf/migrate.clj
@@ -322,7 +322,7 @@
           (sorted? %)
           (apply < 0 (keys %))
           (<= (count %) (count migrations))]}
-  (let [pending (difference (utils/keyset migrations) (set (applied-migrations)))]
+  (let [pending (difference (utils/keyset migrations) (applied-migrations))]
       (into (sorted-map)
         (select-keys migrations pending))))

@@ -330,7 +330,7 @@
   "Migrates database to the latest schema version. Does nothing if database is
 already at the latest schema version."
   []
-  (if-let [unexpected (first (difference (set (applied-migrations)) (set (keys migrations))))]
+  (if-let [unexpected (first (difference (applied-migrations) (utils/keyset migrations)))]
     (throw (IllegalStateException.
               (format "Your PuppetDB database contains a schema migration numbered %d, but this version of PuppetDB does not recognize that version."
                     unexpected))))


(PDB-1076) Make environment garbage collection ignore null values

If a factset, report or catalog is migrated from an earlier puppetdb
version or submitted with a earlier puppetdb-terminus version it has
NULL as environment_id. If any of them have a record with that PuppetDB
failed to garbage collect any environments at all as the subselect
returned a NULL value.

Switching from UNION ALL to just UNION speeds up the query dramatically
as the return value from the subselect is much smaller (doesn't contain
any duplicates).

--- src/com/puppetlabs/puppetdb/scf/storage.clj
+++ src/com/puppetlabs/puppetdb/scf/storage.clj
@@ -746,11 +746,11 @@
   (time! (:gc-environments metrics)
          (sql/delete-rows :environments
            ["ID NOT IN
-              (SELECT environment_id FROM catalogs
-               UNION ALL
-               SELECT environment_id FROM reports
-               UNION ALL
-               SELECT environment_id FROM factsets)"])))
+              (SELECT environment_id FROM catalogs WHERE environment_id IS NOT NULL
+               UNION
+               SELECT environment_id FROM reports WHERE environment_id IS NOT NULL
+               UNION
+               SELECT environment_id FROM factsets WHERE environment_id IS NOT NULL)"])))

 (defn delete-unassociated-statuses!
   "Remove any statuses that aren't associated with a report"


fix merge mistake by removing test-server-delayed from netty_unit_test.clj

--- storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj
+++ storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj
@@ -93,36 +93,6 @@
     (.close server)
     (.term context)))

-(deftest test-server-delayed
-    (let [req_msg (String. "0123456789abcdefghijklmnopqrstuvwxyz")
-       storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
-                    STORM-MESSAGING-NETTY-AUTHENTICATION false
-                    STORM-MESSAGING-NETTY-BUFFER-SIZE 1024
-                    STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
-                    STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000
-                    STORM-MESSAGING-NETTY-SERVER-WORKER-THREADS 1
-                    STORM-MESSAGING-NETTY-CLIENT-WORKER-THREADS 1
-                    }
-        context (TransportFactory/makeContext storm-conf)
-        client (.connect context nil "localhost" port)
-
-        server (Thread.
-                (fn []
-                  (Thread/sleep 1000)
-                  (let [server (.bind context nil port)
-                        iter (.recv server 0 0)
-                        resp (.next iter)]
-                    (is (= task (.task resp)))
-                    (is (= req_msg (String. (.message resp))))
-                    (.close server)
-                  )))
-        _ (.start server)
-        _ (.send client task (.getBytes req_msg))
-        ]
-    (.close client)
-    (.join server)
-    (.term context)))

 (deftest test-batch
   (let [num-messages 100000


modify testpipeline to display all possible step states

--- backend/test/lambdaui/testpipeline/simple_pipeline.clj
+++ backend/test/lambdaui/testpipeline/simple_pipeline.clj
@@ -17,13 +17,24 @@
 (defn ls [args ctx]
   (shell/bash ctx (:cwd args) "ls"))

-(defonce should-fail? (atom false))
+(defonce lastStatus (atom nil))

-(defn fail-every-other-run [_ _]
-  (swap! should-fail? not)
-  (if @should-fail?
-    {:status :failure}
-    {:status :success}))
+(defn swapStatus [lastStatus]
+  (case lastStatus
+    :success :failure
+    :failure :waiting
+    :waiting :success
+    :success)
+  )
+
+
+(defn long-running-task-10s [_ _]
+  (Thread/sleep 10000)
+  {:status :success}
+  )
+
+(defn different-status [_ _]
+  {:status (swap! lastStatus swapStatus)})

 (def pipeline-structure
   `((either
@@ -33,5 +44,6 @@
        clone
        git/list-changes
        ls)
-     fail-every-other-run
+     different-status
+     long-running-task-10s
      ))


Allow empty freesound-search... (freesound-search)

--- src/overtone/libs/freesound.clj
+++ src/overtone/libs/freesound.clj
@@ -99,24 +99,25 @@
   (freesound-url "/sounds/search" params))

 (defn- normalize-search-args
-  "Takes a sequence of args and returns a map of params for use with
+  "Takes a sequence of search args and returns a map of params for use with
   freesound-search*"
-  [args]
-  (let [ks (first args)
-        ks (when (coll? ks)
-             ks)
-        args (if ks
-               (rest args)
-               args)
-        q (first args)
-        q (when (string? q)
-            q)
-        args (if q
-               (rest args)
-               args)]
-    (-> (apply hash-map args)
-        (assoc :ks ks :sounds_per_page 100)
-        (update-in [:q] #(or q %)))))
+  ([] (normalize-search-args nil))
+  ([args]
+     (let [ks (first args)
+           ks (when (coll? ks)
+                ks)
+           args (if ks
+                  (rest args)
+                  args)
+           q (first args)
+           q (when (string? q)
+               q)
+           args (if q
+                  (rest args)
+                  args)]
+       (-> (apply hash-map args)
+           (assoc :ks ks :sounds_per_page 100)
+           (update-in [:q] #(or q % ""))))))

 (defn- freesound-search*
   [params]


Switch to using release version of tsne lib

--- examples/dropout/project.clj
+++ examples/dropout/project.clj
@@ -7,7 +7,7 @@
                  [thinktopic/cortex-datasets "0.1.0"]
                  [thinktopic/cortex-gpu "0.1.0-SNAPSHOT"]
                  [net.mikera/imagez "0.10.0"]
-                 [thinktopic/tsne-core "0.1.0-SNAPSHOT"]
+                 [thinktopic/tsne-core "0.1.0"]
                  [incanter/incanter-core "1.5.7"]
                  [incanter/incanter-charts "1.5.7"]]


full workflow is running

full workflow is running


make sure we really started waiting in test to avoid race conditions