Add term buffer peer-config schemas.

Add term buffer peer-config schemas.

--- src/onyx/schema.cljc
+++ src/onyx/schema.cljc
@@ -732,6 +732,10 @@
    (s/optional-key :onyx.zookeeper/prepare-failure-detection-interval) s/Int
    (s/optional-key :onyx.messaging/allow-short-circuit?) s/Bool
    (s/optional-key :onyx.messaging/short-circuit-buffer-size) s/Int
+   (s/optional-key :onyx.messaging/term-buffer-size.coordinator) PosInt
+   (s/optional-key :onyx.messaging/term-buffer-size.heartbeat) PosInt
+   (s/optional-key :onyx.messaging/term-buffer-size.segment) PosInt
+   (s/optional-key :onyx.messaging/term-buffer-size.segment-short-circuit) PosInt
    (s/optional-key :onyx.messaging.aeron/embedded-driver?) s/Bool
    (s/optional-key :onyx.messaging/decompress-fn) (deprecated [:peer-config :model :onyx.messaging/decompress-fn])
    (s/optional-key :onyx.messaging/compress-fn) (deprecated [:peer-config :model :onyx.messaging/compress-fn])


Use 'sans' font for visualizing justification graph.

--- src/paragon/core.clj
+++ src/paragon/core.clj
@@ -38,7 +38,7 @@

 (defn visualize
   [jg]
-  (graphio/view (:graph jg) :node {:fillcolor :white :style :filled}))
+  (graphio/view (:graph jg) :node {:fillcolor :white :style :filled :fontname "sans"}))

 (defn check-axiom-neg1
   "Everything is black or white."


bar charts nicely in table

bar charts nicely in table

--- src/prais2/data.cljs
+++ src/prais2/data.cljs
@@ -50,17 +50,15 @@

 (def chart-width 300)

-(defn min-outer-low
-  "the minimum outer-low value across all rows"
-  [data]
-  (apply min (map :outer-low (rest data))))
-;; (min-outer-low content/table1-data) => 94.8
+(def min-outer-low  (apply min (map :outer-low (rest content/table1-data))))
+;;  "the minimum outer-low value across all rows"
+;; => 94.8

 (defn bar-scale
   "value to pixel-width scale-factor controlled by slider in [0-1]"
   [slider]
-  (/ chart-width (- 100 (* (min-outer-low content/table1-data) slider))))
+  (/ chart-width (- 100 (* min-outer-low slider))))
 ;; (bar-scale 1) => 57.7 (a 5.2% range expanded to 300px)
 ;; (bar-scale 0) => 3 (a 100% range expanded to 300px)

@@ -72,9 +70,11 @@
   )

 (r/defc bar < r/static [slider value fill]
-  [:div {:style {:display "inline-block"
+  [:div {:style {:padding 0
+                 :margin 0
+                 :display "inline-block"
                  :background-color fill
-                 :height "20px"
+                 :height "22px"
                  :width (str (bar-width slider value) "px")}
          }])

@@ -82,10 +82,11 @@
 (r/defc bar-chart < r/static [row]
   (let [slider 1]
     [:div
-     #_(bar slider (:outer-low row) "red")
+     (bar slider (- (:outer-low row) (* min-outer-low slider)) "red")
      (bar slider (- (:inner-low row) (:outer-low row)) "cyan")
      (bar slider (- (:inner-high row) (:inner-low row)) "blue")
      (bar slider (- (:outer-high row) (:inner-high row)) "cyan")
+     (bar slider (- 100 (:outer-high row)) "orange")
      ])
   )


Fix bug where macro gets executed during compile time and no config exists

Change-Id: I38f6ac3332779de89bfec31ce9d3a4d4b5e2a727

--- src/qcast/server.clj
+++ src/qcast/server.clj
@@ -51,10 +51,13 @@

 (defroutes feed-routes
   "Routes for RSS Feeds"
-  (let [feed-count (config/get :feed :items-count)]
-    (GET "/feed"       [] (response/redirect "feed/audio"))
-    (GET "/feed/audio" [] (respond (feed/serve :audio (cache/latest feed-count))))
-    (GET "/feed/video" [] (respond (feed/serve :video (cache/latest feed-count))))))
+  (GET "/feed"       [] (response/redirect "feed/audio"))
+  (GET "/feed/audio" []
+    (let [feed-count (config/get :feed :items-count)]
+      (respond (feed/serve :audio (cache/latest feed-count)))))
+  (GET "/feed/video" []
+    (let [feed-count (config/get :feed :items-count)]
+      (respond (feed/serve :video (cache/latest feed-count))))))

 (defroutes files-routes
   "Routes for file handling and downloads"


Fix doc string placement.

Fix doc string placement.

--- src/re_com/core.cljs
+++ src/re_com/core.cljs
@@ -18,10 +18,11 @@

 (defn label
+  "Returns markup for a basic label"
   [& {:keys [label style class on-click]
       :as   args}]
   {:pre [(superset? label-args (keys args))]}
-  "Returns markup for a basic label"
+
   [:span
    (merge
      {:class (str "rc-label " class)
@@ -43,10 +44,11 @@

 (defn input-text
+  "returns markup for a basic text imput label"
   [& {:keys [text on-change style class]
       :as   args}]
   {:pre [(superset? input-text-args (keys args))]}
-  "returns markup for a basic text imput label"
+
   [:input
    {:type "text"
     :class (str "rc-input-text " class)
@@ -68,11 +70,12 @@

 (defn button
+  "Returns the markup for a basic button."
   [& {:keys [label on-click style class]
       :or   {:class "btn-default"}
       :as   args}]
   {:pre [(superset? button-args (keys args))]}
-  "Returns the markup for a basic button."
+
   [:button
    {:class    (str "rc-button btn " class)
     :style    (merge {:flex "none" :align-self "flex-start"} style)
@@ -97,10 +100,11 @@

 ;; TODO: when disabled, should the text appear "disabled".
 (defn checkbox
+  "I return the markup for a checkbox, with an optional RHS label."
   [& {:keys [model on-change label disabled style label-class label-style]
       :as   args}]
   {:pre [(superset? checkbox-args (keys args))]}
-  "I return the markup for a checkbox, with an optional RHS label."
+
   (let [model       (deref-or-value model)
         disabled    (deref-or-value disabled)
         callback-fn (if (and on-change (not disabled)) #(on-change (not model)))]     ;; call on-change with either true or false
@@ -137,10 +141,11 @@

 (defn radio-button
+  "I return the markup for a radio button, with an optional RHS label."
   [& {:keys [model value label on-change disabled style label-class label-style]
       :as   args}]
   {:pre [(superset? radio-button-args (keys args))]}
-  "I return the markup for a radio button, with an optional RHS label."
+
   (let [model       (deref-or-value model)
         disabled    (deref-or-value disabled)
         callback-fn (if (and on-change (not disabled)) #(on-change value))]
@@ -170,10 +175,11 @@

 (defn progress-bar
+  "Render a bootstrap styled progress bar"
   [& {:keys [model]
       :as   args}]
   {:pre [(superset? progress-bar-args (keys args))]}
-  "Render a bootstrap styled progress bar"
+
   [:div
    {:class "rc-progress-bar progress"
     :style {:flex "none"}}
@@ -189,8 +195,9 @@
 ;; ------------------------------------------------------------------------------------

 (defn spinner
+  "Render an animated gif spinner"
   []
-  "Render an animated gif spinner"
+
   [:div {:style {:display "flex"
                  :flex    "none"
                  :margin "10px"}}
@@ -209,11 +216,12 @@

 (defn title
+  "An underlined, left justified, H3 Title"
   [& {:keys [label underline?]
       :or   {underline? true}
       :as   args}]
   {:pre [(superset? title-args (keys args))]}
-  "An underlined, left justified, H3 Title"
+
   [v-box
    :children [[:h3 label]
               (when underline? [line :size "1px"])]])


Make command line option to loop through rules. May need more testing

--- src/rule110/core.clj
+++ src/rule110/core.clj
@@ -16,7 +16,6 @@
     (if (zero? l)
       n
       (str (apply str (mapv (constantly "0") (range l))) n))))
-

 (defn all-possible-rules
   "Return a list of rule number and step-fn's for all possible cellular automata
@@ -86,19 +85,34 @@
                            (step step-fn)
                            #_draw-grid
                            graphics/draw-frame
-                           #_midi/play-grid))
+                           midi/play-grid))
               grid
               (range const/max-steps))
       (Thread/sleep 300)
       (graphics/reset)))

-
 (defn -main
   [& args]
-  (let [grid (random-grid const/grid-size 25)]
-    (prn "starting grid " grid)
-    (doseq [ [rule-num rule-map] (all-possible-rules)]
+  (loop [grid (random-grid const/grid-size 25)
+        action (or (first args) :all)
+        all-rules (all-possible-rules)
+        rules (if (= :all (keyword action))
+                all-rules
+                [(nth all-rules (Integer/parseInt action))])]
+    (prn "starting grid " grid " action " action)
+    (doseq [ [rule-num rule-map] rules]
       (prn "rule -num " rule-num " map " rule-map)
-      (run-rule rule-num rule-map grid)))
+      (run-rule rule-num rule-map grid))
+    (when (not (= :all (keyword action)))
+      (println "New rule:")
+      (let [naction (read-line)]
+        (println "Got it ")
+        (if (re-matches #"\d+" naction)
+          (println "Next rule " naction)
+          (recur grid
+                 naction
+                 all-rules
+                 [(nth all-rules (Integer/parseInt naction))])))))
+  (println "Done")
   (midi/stop)
   nil)


renaming var and adjusting to new structure

--- test/celestial/test/actions.clj
+++ test/celestial/test/actions.clj
@@ -3,7 +3,7 @@
     [celestial.model :refer (rconstruct)]
     [celestial.persistency.actions :refer (validate-action)]
     [celestial.persistency :refer (type-exists?)]
-    [celestial.fixtures.data :refer (redis-actions)]
+    [celestial.fixtures.data :refer (redis-deploy)]
     [celestial.fixtures.core :refer (with-m?)]
     remote.capistrano)
   (:use midje.sweet)
@@ -11,7 +11,7 @@
   )

 (fact "actions to remoter construction"
-      (let [cap (rconstruct redis-actions {:action :deploy :target "192.168.5.31"})]
+      (let [cap (rconstruct redis-deploy {:target "192.168.5.31"})]
         cap  => (contains  {:args ["deploy" "-s" "hostname=192.168.5.31"]
                             :src  "git://github.com/narkisr/cap-demo.git"})))

@@ -19,17 +19,17 @@
 (fact "action validations"
       (with-redefs [type-exists? (fn [_] true)]

-        (validate-action redis-actions)  => truthy
+        (validate-action redis-deploy)  => truthy

-        (validate-action (assoc-in redis-actions [:actions :deploy :capistrano :args] nil)) =>
-        (throws ExceptionInfo (with-m? {:capistrano {:args '("must be present")}}))
+        (validate-action (assoc-in redis-deploy [:capistrano :args] nil)) =>
+        (throws ExceptionInfo (with-m? {:args '("must be present")}))

-        (validate-action (assoc-in redis-actions [:actions :stop :supernal :args] nil)) => truthy
+        (validate-action (assoc-in redis-deploy [:actions :stop :supernal :args] nil)) => truthy

         )

       (fact "missing type"
-            (validate-action (assoc redis-actions :operates-on "foo")) =>
+            (validate-action (assoc redis-deploy :operates-on "foo")) =>
             (throws ExceptionInfo (with-m? {:operates-on  '("type not found, create it first")}))
             (provided
               (type-exists? anything)  => false


Refering to the write module in the tests

--- test/engine_server/web_test.clj
+++ test/engine_server/web_test.clj
@@ -1,6 +1,6 @@
-(ns engine-server.core-test
+(ns engine-server.web-test
   (:require [clojure.test :refer :all]
-            [engine-server.core :refer :all]
+            [engine-server.web :refer :all]
   )
 )


Fix remaining failing tests

Fix remaining failing tests

--- test/yada/url_resource_test.clj
+++ test/yada/url_resource_test.clj
@@ -17,7 +17,7 @@
 ;; content-length.)

 (deftest resource-test
-  (let [resource (io/resource "public/css/fonts.css")
+  (let [resource (io/resource "static/css/fonts.css")
         handler (yada.core/resource resource)
         response @(handler (mock/request :get "/"))]
     (given response
@@ -25,5 +25,4 @@
       :status := 200
       [:headers "content-type"] := "text/css;charset=utf-8"
       [:headers "content-length"] :? nil?
-      :body :? (partial instance? BufferedReader)
-      )))
+      :body :? (partial instance? BufferedReader))))


Checkout dirs are no longer part of the fileset

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -54,6 +54,7 @@
 (def ^:private src-watcher       (atom (constantly nil)))
 (def ^:private repo-config-fn    (atom identity))
 (def ^:private loaded-checkouts  (atom #{}))
+(def ^:private checkout-dirs     (atom #{}))
 (def ^:private default-repos     [["clojars"       {:url "https://clojars.org/repo/"}]
                                   ["maven-central" {:url "https://repo1.maven.org/maven2"}]])
 (def ^:private default-mirrors   (delay (let [c (boot.App/config "BOOT_CLOJARS_MIRROR")
@@ -69,7 +70,7 @@
    :asset    {:input nil :output true}
    :source   {:input true :output nil}
    :resource {:input true :output true}
-   :checkout {:input true :user true}})
+   :checkout {:input nil :output nil :user nil :checkout true}})

 (defn- genkw [& [prefix-string :as args]]
   (->> [(ns-name *ns*) (apply gensym args)] (map str) (apply keyword)))
@@ -105,22 +106,20 @@
         m (->> masks+ (map masks) (apply merge))
         in-fileset? (or (:input m) (:output m))]
     (util/with-let [d (tmp-dir* k)]
-      (when in-fileset?
-        (let [t (tmpd/map->TmpDir (assoc m :dir d))]
-          (swap! tempdirs conj t)
-          (when (:input t)
-            (set-env! :directories #(conj % (.getPath (:dir t))))))))))
+      (cond (:checkout m) (swap! checkout-dirs conj d)
+            in-fileset?   (swap! tempdirs conj (tmpd/map->TmpDir (assoc m :dir d))))
+      (when (or (:checkout m) (:input m))
+        (set-env! :directories #(conj % (.getPath d)))))))

 (defn- add-user-asset    [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:user :asset}) dir {}))
 (defn- add-user-source   [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:user :source}) dir {}))
 (defn- add-user-resource [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:user :resource}) dir {}))
-(defn- add-user-checkout [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:user :checkout}) dir {}))

 (defn- user-temp-dirs     [] (get-dirs {:dirs @tempdirs} #{:user}))
 (defn- user-asset-dirs    [] (get-dirs {:dirs @tempdirs} #{:user :asset}))
 (defn- user-source-dirs   [] (get-dirs {:dirs @tempdirs} #{:user :source}))
 (defn- user-resource-dirs [] (get-dirs {:dirs @tempdirs} #{:user :resource}))
-(defn- user-checkout-dirs [] (get-dirs {:dirs @tempdirs} #{:user :checkout}))
+(defn- user-checkout-dirs [] @checkout-dirs)
 (defn- non-user-temp-dirs [] (->> [:asset :source :resource]
                                   (map #(get-dirs {:dirs @tempdirs} #{%}))
                                   (apply set/union)
@@ -787,7 +786,6 @@
         (add-user-asset    (first (user-asset-dirs)))
         (add-user-source   (first (user-source-dirs)))
         (add-user-resource (first (user-resource-dirs)))
-        (add-user-checkout (first (user-checkout-dirs)))
         (update-in [:tree] merge (:tree fileset)))))

 (defn reset-build!


Add unpeeling of ExecutionException in boot.core/boot and fixes #405

After discussion on Slack it emerged that it is necessary and robust to unpeel ExecutionExceptions
when dereffing a feature so that the App.Exit (or whatever) inside can be properly propagated.

After tracking down all the @ and deref, I came to the conclusion that only boot.core/boot, the
entry point of the execution, needs this.

This patch does exactly that.

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -23,7 +23,7 @@
     [java.nio.file Path]
     [java.net URLClassLoader URL]
     [java.lang.management ManagementFactory]
-    [java.util.concurrent LinkedBlockingQueue TimeUnit Semaphore]))
+    [java.util.concurrent LinkedBlockingQueue TimeUnit Semaphore ExecutionException]))

 (declare watch-dirs post-env! get-env set-env! tmp-file tmp-dir ls empty-dir! patch!)

@@ -936,6 +936,8 @@
                     (every? string? argv) (apply construct-tasks argv)
                     :else (throw (IllegalArgumentException.
                                    "Arguments must be either all strings or all fns"))))))
+       (catch ExecutionException e
+         (throw (.getCause e)))
        (finally (do-cleanup!))))

 ;; Low-Level Tasks, Helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Removed slow test.

Removed slow test.

--- src/clojure_club/x106_number_maze/mbastian.clj
+++ src/clojure_club/x106_number_maze/mbastian.clj
@@ -36,7 +36,7 @@
          (some #(when (some (comp #{g} peek) %) %))
          (filter (comp #{g} peek)))))

-(time (number-paths 1 4137))
+;(time (number-paths 1 4137))
 (time (number-paths 7 43))
 (time (number-paths 9 2))
 (time (number-paths 2 9))


Doubled max points

Doubled max points

--- src/clojush/problems/software/mirror_image.clj
+++ src/clojush/problems/software/mirror_image.clj
@@ -164,7 +164,7 @@
 (def argmap
   {:error-function (mirror-image-error-function mirror-image-data-domains)
    :atom-generators mirror-image-atom-generators
-   :max-points 600
+   :max-points 1200
    :max-genome-size-in-initial-program 150
    :evalpush-limit 600
    :population-size 1000


Some more work. Also, this is a Scots vending machine, dammit!

--- src/vending/core.clj
+++ src/vending/core.clj
@@ -1,20 +1,19 @@
 (ns vending.core)
-
-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))

 (defn make-default-machine [] { :stock {:apples 5 :oranges 5 :lemons 5}
-	:coins {:dollars 1 :quarters 4 :dimes 4 :nickels 4}
+	:coins {:merk 1 :plack 4 :bawbee 4 :bodle 4}
 	:tendered nil
 	:last-message ""
 	:change nil
 	:output nil} )

-(def coin-values {:dollar 1 :quarter 0.25 :dime 0.10 :nickel 0.05})
+(def coin-values {:merk 1 :plack 0.25 :bawbee 0.10 :bodle 0.05})
+
+(keys coin-values)
+
+(.indexOf (keys coin-values) :bodle)

 (def item-prices {:apples 0.65 :oranges 1 :lemons 1.5})

@@ -22,31 +21,36 @@
 	(coin-values coin))

 (defn coins-value [coins]
+  "Sum the value of these coins."
 	(apply + (map coin-value coins)))

 (defn coin-return [machine]
+  "Return all tendered coins in this machine."
 	(assoc (dissoc machine :tendered) :change (:tendered machine)))
-
+
 (defn add-coin [machine coin]
+  "Add this coin to this machine."
 	(assoc (dissoc machine :tendered) :tendered (cons coin (:tendered machine))))

 (defn add-coins [machine coins]
+  "Add these coins to this machine"
 	(cond (empty? coins) machine
 		true (add-coins (add-coin machine (first coins)) (rest coins))))

 (defn magic-inc [maybenum]
+  "A wrapper round inc which treats nil as zero."
 	(cond (nil? maybenum) 1
 		true (inc maybenum)))

 (defn sum-coin [coin sums]
-	(cond
-		(= coin :dollar) (update-in sums [:dollar] magic-inc)
-		(= coin :quarter) (update-in sums [:quarter] magic-inc)
-		(= coin :dime) (update-in sums [:dime] magic-inc)
-		(= coin :nickel) (update-in sums [:nickel] magic-inc)))
+  "Adds this coin (assumed to be on of :merk, :plack, :bawbee, :bodle)
+  to this map of sums."
+	(update-in sums [coin] magic-inc))

-(defn sum-coins
-	"Returns a map {:dollars :quarters :dimes :nickels}"
+(defn sum-coins
+	"takes a list in the form (:merk :merk :bawbee :plack :bodle) and returns
+  a map {:merk 2 :plack 1 :bawbee 1 :bodle 1}. Optional second argument: an
+  existing map in that general form."
 	([coins]
 		(sum-coins coins {}))
 	([coins sums]
@@ -62,52 +66,60 @@
 (defn subtract-nickle [list]
 	(subtract-denomination list 1))

-(defn subtract-dime [list]
+(defn subtract-bawbee [list]
 	(subtract-denomination list 2))

-(defn subtract-quarter [list]
+(defn subtract-plack [list]
 	(subtract-denomination list 3))

-(defn subtract-dollar [list]
+(defn subtract-merk [list]
 	(subtract-denomination list 4))

-(defn in-make-change [amount dollars quarters dimes nickels]
-	"Return a tuple (dollars quarters nickels dimes) which indicates the number remaining
+(defn in-make-change [amount merk plack bawbee bodle]
+	"Return a tuple (merk plack bodle bawbee) which indicates the number remaining
 	after making change, or nil if not possible"
 	(cond
-		(= amount 0) (list dollars quarters dimes nickels)
-		(and (>= amount (:dollar coin-values)) (> dollars 0))
-			(in-make-change (- amount (:dollar coin-values)) (- dollars 1) quarters dimes nickels)
-		(and (>= amount (:quarter coin-values)) (> quarters 0))
-			(in-make-change (- amount (:quarter coin-values)) dollars (- quarters 1) dimes nickels)
-		(and (>= amount (:dime coin-values)) (> dimes 0))
-			(in-make-change (- amount (:dime coin-values)) dollars quarters (- dimes 1) nickels)
-		(and (>= amount (:nickel coin-values)) (> nickels 0))
-			(in-make-change (- amount (:nickel coin-values)) dollars quarters dimes (- nickels 1))))
+		(= amount 0) (list merk plack bawbee bodle)
+		(and (>= amount (:merk coin-values)) (> merk 0))
+			(in-make-change (- amount (:merk coin-values)) (- merk 1) plack bawbee bodle)
+		(and (>= amount (:plack coin-values)) (> plack 0))
+			(in-make-change (- amount (:plack coin-values)) merk (- plack 1) bawbee bodle)
+		(and (>= amount (:bawbee coin-values)) (> bawbee 0))
+			(in-make-change (- amount (:bawbee coin-values)) merk plack (- bawbee 1) bodle)
+		(and (>= amount (:bodle coin-values)) (> bodle 0))
+			(in-make-change (- amount (:bodle coin-values)) merk plack bawbee (- bodle 1))))

-(defn make-change [amount dollars quarters dimes nickels]
-	(map #(- %1 %2) (list dollars quarters dimes nickels)
-		(in-make-change amount dollars quarters dimes nickels)
+(defn make-change [amount merk plack bawbee bodle]
+	(map #(- %1 %2) (list merk plack bawbee bodle)
+		(in-make-change amount merk plack bawbee bodle)
 		))

-(defn make-change-machine [machine change]
-	machine)
+(defn subtract-change [machine change]
+  "subtract this change from this machine")
+
+(defn make-change-machine [machine item-price change]
+    (let [
+      tend (sum-coins (:tendered machine))
+		change (make-change item-price (:merk tend) (:plack tend) (:bawbee tend) (:bodle tend))]
+      (cond (nil? change) machine)
+        true (assoc (dissoc (subtract-change machine change) :change ) :change change )))

 (defn remove-from-stock [machine item]
 	machine)

 (defn deliver-item [machine item change]
-	(make-change-machine
-		(remove-from-stock
-			(assoc (dissoc machine :output) :output (cons item (:output machine)))
-			item)
-		change))
+	(make-change-machine
+		(remove-from-stock
+			(assoc (dissoc machine :output) :output (cons item (:output machine)))
+			item)
+    (item item-prices)
+		change))

 (defn get-item [machine item]
 	(let [item-price (item item-prices)
 		tend (sum-coins (:tendered machine))
-		change (make-change item-price (:dollar tend) (:quarter tend) (:dime tend) (:nickel tend))]
+		change (make-change item-price (:merk tend) (:plack tend) (:bawbee tend) (:bodle tend))]
 	(cond (<= 0 (item (:stock machine))) (coin-return machine)
 		(<= (coins-value (:tendered machine)) item-price) (coin-return machine)
 		(empty? change) (coin-return)


(PDB-2849) correct deprecation warning for export tool

Since users don't necessarily have the client tool installed, link to
docs instead of pointing them to the man page.

--- src/puppetlabs/puppetdb/cli/export.clj
+++ src/puppetlabs/puppetdb/cli/export.clj
@@ -63,8 +63,9 @@
   [& args]
   (let [{:keys [outfile base-url anonymization]} (validate-cli! args)]
     (println (str "[deprecated] The PuppetDB export command is deprecated in "
-                  "favor of exports via the Puppet 'db' subcommand. See "
-                  "'man puppet-db' for usage instructions."))
+                  "favor of exports via the PuppetDB CLI tool. "
+                  "See https://docs.puppet.com/puppetdb/latest/pdb_client_tools.html#puppetdb-cli "
+                  "for installation and usage instructions."))
     (println (str "Triggering export to " outfile " at " (now) "..."))
     (trigger-export-via-http! base-url outfile anonymization)
     (println (str "Finished export to " outfile " at " (now) "."))))


added link to source code on GitHub

added link to source code on GitHub

--- src/xebang/views.clj
+++ src/xebang/views.clj
@@ -41,4 +41,5 @@
           [:a {:href "http://www.cubicle6.com"} "Caleb Peterson"] " | "
           [:a {:href "mailto:caleb.peterson@cubicle6.com"} "E-mail Me"] " | "
           "Inspired by " [:a {:href "http://www.duckduckgoog.com/"} "DuckDuckGoog"] " | "
+          [:a {:href "https://github.com/calebmpeterson/xebang"} "Source on GitBub"] " | "
           "Soli Deo Gloria"]]]]]]))


try bigger treshold

try bigger treshold

--- src/mobile_patient/component/gesture_view.cljs
+++ src/mobile_patient/component/gesture_view.cljs
@@ -8,8 +8,8 @@
   (let [e1 (first (.. e -touchHistory -touchBank))
         dx (- (.-currentPageX e1) (.-startPageX e1))]
     (cond
-      (> dx 20) :right
-      (< dx -20) :left)))
+      (> dx 50) :right
+      (< dx -50) :left)))

 (defn log [e]
   (print (first (.. e -touchHistory -touchBank))))


Fix wrong initial filtering and ordering values in icons page.

--- src/uxbox/main/ui/dashboard/icons.cljs
+++ src/uxbox/main/ui/dashboard/icons.cljs
@@ -41,6 +41,8 @@

 (defn- contains-term?
   [phrase term]
+  {:pre [(string? phrase)
+         (string? term)]}
   (let [term (name term)]
     (str/includes? (str/lower phrase) (str/trim (str/lower term)))))

@@ -320,8 +322,8 @@
   {:mixins [mx/static mx/reactive]}
   [{:keys [selected id type] :as state}]
   (let [editable? (or (= type :own) (nil? id))
-        ordering (:order state)
-        filtering (:filter state)
+        ordering (:order state :name)
+        filtering (:filter state "")
         icons (mx/react icons-ref)
         icons (->> (vals icons)
                    (filter #(= id (:collection %)))


Fixing renamed schema.

Fixing renamed schema.

--- src/vip/data_processor/db/postgres.clj
+++ src/vip/data_processor/db/postgres.clj
@@ -235,7 +235,7 @@
 (defn refresh-materialized-views
   [ctx]
   (log/info "Refreshing materialized views")
-  (doseq [view ["dashboard.sources" "dashboard.elections"]]
+  (doseq [view ["v5_dashboard.sources" "v5_dashboard.elections"]]
     (korma/exec-raw
      (:conn xml-tree-values)
      [(str "refresh materialized view " view)]))


Working example for query compiler

Working example for query compiler

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -563,11 +563,11 @@
 ;; Heuristic: Each Recall clause is used at most once in the plan
 ;; Heuristic: Each Filter/Let clause is used at most once per path in the plan

-(defn rule->flow-plan [rule]
+(defn add-rule [plan rule]
   (let [recalls (filter #(= Recall (type %)) (:clauses rule))
         computes (set (filter #(= Compute (type %)) (:clauses rule)))
         outputs (filter #(= Output (type %)) (:clauses rule))
-        main-plan (atom empty-flow-plan)
+        main-plan (atom plan)
         nodes&vars&computes-applied (for [recall recalls]
                                       (let [plan @main-plan
                                             [plan node vars] (recall->nodes plan recall)
@@ -586,14 +586,22 @@
       (reset! main-plan (output->nodes @main-plan nodes vars output)))
     @main-plan))

-
+(defn add-rules [plan rules]
+  ;; TODO stratify
+  (reduce add-rule plan rules))
+
+(comment
   (deffact edge "[x] has an edge to [y]")
   (deffact connected "[x] is connected to [y]")

-(rule->flow-plan (Rule. [(Recall. :known&pretended (->edge 'x 'y))
-                         (Output. :pretended (->connected 'x 'y))]))
-
-(rule->flow-plan (Rule. [(Recall. :known&pretended (->edge 'x 'y))
-                         (Recall. :known&pretended (->connected 'y 'z))
-                         (Output. :pretended (->connected 'x 'z))]))
-
+  (let [plan (add-rules empty-flow-plan
+                        [(Rule. [(Recall. :known&pretended (->edge 'x 'y))
+                                 (Output. :pretended (->connected 'x 'y))])
+                         (Rule. [(Recall. :known&pretended (->edge 'x 'y))
+                                 (Recall. :known&pretended (->connected 'y 'z))
+                                 (Output. :pretended (->connected 'x 'z))])])
+        state (flow-plan->flow-state plan)]
+    (apush* (aget (:node->facts state) 0) #js [(->edge 0 1) (->edge 1 2) (->edge 2 3) (->edge 3 1)])
+    (persistent! (aget (:node->state (fixpoint state)) 1)))
+  )
+


add Toxi's comments to dub step example synth

--- src/overtone/examples/compositions/auto_dubstep.clj
+++ src/overtone/examples/compositions/auto_dubstep.clj
@@ -45,24 +45,40 @@

 (demo 60
       (let [bpm     120
+            ;; create pool of notes as seed for random base line sequence
             notes   [40 41 28 28 28 27 25 35 78]
+            ;; create an impulse trigger firing once per bar
             trig    (impulse:kr (/ bpm 120))
+            ;; create frequency generator for a randomly picked note
             freq    (midicps (lag (demand trig 0 (dxrand notes INF)) 0.25))
+            ;; switch note durations
             swr     (demand trig 0 (dseq [1 6 6 2 1 2 4 8 3 3] INF))
+            ;; create a sweep curve for filter below
             sweep   (lin-exp (lf-tri swr) -1 1 40 3000)
+            ;; create a slightly detuned stereo sawtooth oscillator
             wob     (mix (saw (* freq [0.99 1.01])))
+            ;; apply low pass filter using sweep curve to control cutoff freq
             wob     (lpf wob sweep)
+            ;; normalize to 80% volume
             wob     (* 0.8 (normalizer wob))
+            ;; apply band pass filter with resonance at 5kHz
             wob     (+ wob (bpf wob 1500 2))
+            ;; mix in 20% reverb
             wob     (+ wob (* 0.2 (g-verb wob 9 0.7 0.7)))

+            ;; create impulse generator from given drum pattern
             kickenv (decay (t2a (demand (impulse:kr (/ bpm 30)) 0 (dseq [1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0] INF))) 0.7)
+            ;; use modulated sine wave oscillator
             kick    (* (* kickenv 7) (sin-osc (+ 40 (* kickenv kickenv kickenv 200))))
+            ;; clip at max volume to create distortion
             kick    (clip2 kick 1)

+            ;; snare is just using gated & over-amplified pink noise
             snare   (* 3 (pink-noise) (apply + (* (decay (impulse (/ bpm 240) 0.5) [0.4 2]) [1 0.05])))
+            ;; send through band pass filter with peak @ 2kHz
             snare   (+ snare (bpf (* 4 snare) 2000))
+            ;; also clip at max vol to distort
             snare   (clip2 snare 1)]
-
+   ;; mixdown & clip
    (clip2 (+ wob kick snare) 1)))
 ;;(stop)


db/seed! make work again

db/seed! make work again

--- src/chat/server/seed.clj
+++ src/chat/server/seed.clj
@@ -1,7 +1,7 @@
 (ns chat.server.seed
   (:require [chat.server.db :as db]))

-(defn seed []
+(defn seed! []
   (let [user-1 (db/create-user! {:id (db/uuid)
                                  :email "raf@leanpixel.com"
                                  :password "foobar"
@@ -11,11 +11,22 @@
                                  :password "foobar"
                                  :avatar "https://s3-us-west-2.amazonaws.com/slack-files2/avatars/2015-05-09/4805955000_07dc272f0a7f9de7719e_192.jpg"})

-        msg (db/create-message! {:user-id (user-1 :id) :created-at (java.util.Date.)
+        msg (db/create-message! {:id (db/uuid)
+                                 :user-id (user-1 :id)
+                                 :created-at (java.util.Date.)
                                  :content "Hello?"})
-        _ (db/create-message! {:thread-id (msg :thread-id) :user-id (user-1 :id) :created-at (java.util.Date.)
+        _ (db/create-message! {:id (db/uuid)
+                               :thread-id (msg :thread-id)
+                               :user-id (user-1 :id)
+                               :created-at (java.util.Date.)
                                :content "Hi!"})
-        _ (db/create-message! {:thread-id (msg :thread-id) :user-id (user-1 :id) :created-at (java.util.Date.)
+        _ (db/create-message! {:id (db/uuid)
+                               :thread-id (msg :thread-id)
+                               :user-id (user-1 :id)
+                               :created-at (java.util.Date.)
                                :content "Oh, great, someone else is here."})
-        _ (db/create-message! {:thread-id (msg :thread-id) :user-id (user-2 :id) :created-at (java.util.Date.)
+        _ (db/create-message! {:id (db/uuid)
+                               :thread-id (msg :thread-id)
+                               :user-id (user-2 :id)
+                               :created-at (java.util.Date.)
                                :content "Yep"})]))


don't reset namespaces, we have smarter incremental analysis now based on whether a file needs recompilation

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -936,39 +936,41 @@

 (defn build
   "Given a source which can be compiled, produce runnable JavaScript."
-  [source opts]
-  (ana/reset-namespaces!)
-  (let [opts (if (= :nodejs (:target opts))
-               (merge {:optimizations :simple} opts)
-               opts)
-        ups-deps (get-upstream-deps)
-        all-opts (assoc opts
-                   :ups-libs (:libs ups-deps)
-                   :ups-foreign-libs (:foreign-libs ups-deps)
-                   :ups-externs (:externs ups-deps))]
-    (binding [ana/*cljs-static-fns*
-              (or (and (= (opts :optimizations) :advanced))
-                  (:static-fns opts)
-                  ana/*cljs-static-fns*)
-              ana/*cljs-warnings*
-              (assoc ana/*cljs-warnings* :undeclared (true? (opts :warnings)))]
-      (let [compiled (-compile source all-opts)
-            js-sources (concat
-                         (apply add-dependencies all-opts
-                            (concat (if (coll? compiled) compiled [compiled])
-                                    (when (= :nodejs (:target all-opts))
-                                      [(-compile (io/resource "cljs/nodejs.cljs") all-opts)])))
-                         (when (= :nodejs (:target all-opts))
-                           [(-compile (io/resource "cljs/nodejscli.cljs") all-opts)]))
-            optim (:optimizations all-opts)]
-        (if (and optim (not= optim :none))
-          (->> js-sources
-               (apply optimize all-opts)
-               (add-header all-opts)
-               (add-wrapper all-opts)
-               (add-source-map-link all-opts)
-               (output-one-file all-opts))
-          (apply output-unoptimized all-opts js-sources))))))
+  ([source opts] (build source opts false))
+  ([source opts reset]
+    (when reset
+      (ana/reset-namespaces!))
+    (let [opts (if (= :nodejs (:target opts))
+                 (merge {:optimizations :simple} opts)
+                 opts)
+          ups-deps (get-upstream-deps)
+          all-opts (assoc opts
+                     :ups-libs (:libs ups-deps)
+                     :ups-foreign-libs (:foreign-libs ups-deps)
+                     :ups-externs (:externs ups-deps))]
+      (binding [ana/*cljs-static-fns*
+                (or (and (= (opts :optimizations) :advanced))
+                    (:static-fns opts)
+                    ana/*cljs-static-fns*)
+                ana/*cljs-warnings*
+                (assoc ana/*cljs-warnings* :undeclared (true? (opts :warnings)))]
+        (let [compiled (-compile source all-opts)
+              js-sources (concat
+                           (apply add-dependencies all-opts
+                             (concat (if (coll? compiled) compiled [compiled])
+                               (when (= :nodejs (:target all-opts))
+                                 [(-compile (io/resource "cljs/nodejs.cljs") all-opts)])))
+                            (when (= :nodejs (:target all-opts))
+                              [(-compile (io/resource "cljs/nodejscli.cljs") all-opts)]))
+              optim (:optimizations all-opts)]
+          (if (and optim (not= optim :none))
+            (->> js-sources
+              (apply optimize all-opts)
+              (add-header all-opts)
+              (add-wrapper all-opts)
+              (add-source-map-link all-opts)
+              (output-one-file all-opts))
+            (apply output-unoptimized all-opts js-sources)))))))

 (comment


Use directly set database url.

Use directly set database url.

--- src/clj/hbg_crime/db.clj
+++ src/clj/hbg_crime/db.clj
@@ -5,10 +5,7 @@
             [clj-time.core :as time]
             [clj-time.coerce :as coerce]))

-(def db (clojure.string/replace-first (env :database-url)
-                                      "postgres:"
-                                      "jdbc:postgresql:"))
-(def conn (j/get-connection db))
+(def db (env :database-url))

 (defn create-reports-table
   []


Add support of query-params in post requests.

--- src/clj_spotify/core.clj
+++ src/clj_spotify/core.clj
@@ -72,41 +72,30 @@
   [m]
   (apply dissoc m template-keys))

-(defn modify-form-params
-  "Do necessary conversion of form parameters."
-  [m]
-  (-> m
-      remove-path-keys
-      convert-values))
-
-(defn select-params-type
-  "Return either :query-params or :form-params key depending on value of method"
-  [method]
-  (if
-    (or (= method :put) (= method :post))
-    :form-params
-    :query-params))
+(defn filter-map-keys [map keys]
+  (into {} (filter #(.contains keys (key %)) map)))

 (defn api-request
   "Returns a request map for a particular api call."
-  [method endpoint params-spec m t]
-  (let [query-params {(select-params-type method) (modify-form-params m)
-                      :oauth-token t
-                      :content-type :json}
-        url (replace-url-values m (str spotify-api-url endpoint))]
-    (-> (try
-          (client/check-url! url)
-          (merge query-params {:method method :url url})
-          (catch Exception e (ex-data e))))))
+  [method endpoint query-params-spec m t]
+  (let [url (replace-url-values m (str spotify-api-url endpoint))
+        params (remove-path-keys m)
+        query-params (convert-values (if (or (= method :put) (= method :post))
+                                       (filter-map-keys params query-params-spec)
+                                       params))
+        form-params (apply dissoc params (keys query-params))]
+    {:method method :url url
+     :query-params query-params :form-params form-params
+     :oauth-token t :content-type :json}))

 (defn spotify-api-call
   "Returns a function that takes a map m and an optional oauth-token t as arguments."
-  [method endpoint & {:keys [params-spec]}]
+  [method endpoint & {:keys [query-params]}]
   (fn f
     ([m] (f m nil))
     ([m t]
      (-> (try
-           (client/request (api-request method endpoint params-spec m t))
+           (client/request (api-request method endpoint query-params m t))
            (catch Exception e (ex-data e)))
          (response-to-map)))))

@@ -412,9 +401,10 @@
   :uris a list of spotify track uris.
   :position the position to insert the tracks.

-  Example: (add-tracks-to-playlist {:user_id \"elkalel\" :playlist_id \"6IIjEBw2BrRXbrSLerA7A6\" :uris \"spotify:track:4iV5W9uYEdYUVa79Axb7Rh,
-  spotify:track:1301WleyT98MSxVHPZCA6M\" :position 2} \"BQBw-JtC..._7GvA\")"
-  (api-post "users/user_id/playlists/playlist_id/tracks"))
+  Example: (add-tracks-to-playlist {:user_id \"elkalel\" :playlist_id \"6IIjEBw2BrRXbrSLerA7A6\"
+  :uris [\"spotify:track:4iV5W9uYEdYUVa79Axb7Rh\", \"spotify:track:1301WleyT98MSxVHPZCA6M\"]
+  :position 2} \"BQBw-JtC..._7GvA\")"
+  (api-post "users/user_id/playlists/playlist_id/tracks" :query-params [:position]))

 ;TODO - Deal with correct formatting of :tracks.
 ;TODO - Additional doc string with optional and required values in :tracks.


Resolving merge conflicts.

Resolving merge conflicts.

--- jar-async/src/slipstream/async/collector.clj
+++ jar-async/src/slipstream/async/collector.clj
@@ -34,7 +34,7 @@
 (def number-of-readers 32)
 (def timeout-all-users-loop (seconds-in-msecs 240))
 (def timeout-online-loop (seconds-in-msecs 10))
-(def timeout-collect (* 2 timeout-collect-loop))
+(def timeout-collect (* 6 timeout-online-loop))
 (def timeout-collect-reader-release (+ timeout-collect (seconds-in-msecs 2)))
 (def timeout-processing-loop (seconds-in-msecs 60))

@@ -90,14 +90,14 @@

 (defn collect!
   [user connector]
-  (let [ch (chan 1)]
+  (let [ch (chan 1) ts (System/currentTimeMillis)]
     (go
       (let [[v _] (alts! [ch (timeout timeout-collect-reader-release)])]
         (swap! busy free [(get-name user) connector])
         (cond
-          (nil? v) (log-timeout user connector)
-          (< v 0) (log-failure user connector)
-          :else (log-collected user connector v))))
+          (nil? v) (log-timeout ts user connector)
+          (< v 0) (log-failure ts user connector)
+          :else (log-collected ts user connector v))))
     (go (>! ch (Collector/collect user connector (msecs-in-seconds timeout-collect))))))

 (defn update-metric!
@@ -146,7 +146,7 @@
   (let [connectors (connectors)]
     (check-channel-size users connectors)
     (doseq [u users
-      c connectors]
+            c connectors]
       (if-not (@busy [(get-name u) c])
         (go (>! chan [u c]))
         (log/log-info "Avoiding working on " (build-user-connector-msg u c) " being in a process." )))))


use Java Thread to launch Thrift Server

use Java Thread to launch Thrift Server

--- test/clj/backtype/storm/security/auth/auth_test.clj
+++ test/clj/backtype/storm/security/auth/auth_test.clj
@@ -116,12 +116,13 @@
     	   (.serve server)))

 (defn launch-server-w-wait [server-port ms login-cfg aznClass]
-   (future (launch-test-server server-port login-cfg aznClass))
+   (.start (Thread. #(launch-test-server server-port login-cfg aznClass)))
    (log-message "Waiting for Nimbus Server...")
-   (Thread/sleep ms))
+   (Thread/sleep ms)
+   (log-message "Continue..."))

 (deftest authorization-test
-  (launch-server-w-wait 6627 1000 "" "backtype.storm.security.auth.DenyAuthorizer")
+  (launch-server-w-wait 6627 2000 "" "backtype.storm.security.auth.DenyAuthorizer")
   (log-message "Starting Nimbus client w/ anonymous authentication")
   (let [client (NimbusClient. "localhost" 6627)
         nimbus_client (.getClient client)]
@@ -130,7 +131,7 @@
      (.close client)))

 (deftest authentication-test
-  (launch-server-w-wait 6628 1000 "./conf/jaas_digest.conf" "backtype.storm.security.auth.NoopAuthorizer")
+  (launch-server-w-wait 6628 2000 "./conf/jaas_digest.conf" "backtype.storm.security.auth.NoopAuthorizer")
   (System/setProperty "java.security.auth.login.config" "")
   (log-message "Starting Nimbus client w/ anonymous authentication (expect authentication failure")
   (is (= "Peer indicated failure: Unsupported mechanism type ANONYMOUS"


Run full table iteration test with more rows

--- test/clojurewerkz/cassaforte/iterate_table_test.clj
+++ test/clojurewerkz/cassaforte/iterate_table_test.clj
@@ -11,13 +11,13 @@
                         (th/with-temporary-keyspace s f)))

   (deftest test-iterate-table
-    (th/test-combinations
-     (dotimes [i 100]
-       (insert s :users {:name (str "name_" i) :city (str "city" i) :age (int i)})))
+    (let [n 100000]
+      (dotimes [i n]
+        (insert s :users {:name (str "name_" i) :city (str "city" i) :age (int i)}))

-    (let [res (group-by :name
-                        (take 100 (iterate-table s :users :name 10)))]
-      (dotimes [i 100]
-        (let [item (first (get res (str "name_" i)))]
-          (is (= {:name (str "name_" i) :city (str "city" i) :age (int i)}
-                 item)))))))
+      (let [res (group-by :name
+                          (take n (iterate-table s :users :name 10)))]
+        (dotimes [i n]
+          (let [item (first (get res (str "name_" i)))]
+            (is (= {:name (str "name_" i) :city (str "city" i) :age (int i)}
+                   item))))))))


Revert "Add failing db test for nested queries"

This reverts commit 2b3b6cb1e416bfd04417f28151ffafd5293844d4.

--- test/freecoin/integration/db/mongo.clj
+++ test/freecoin/integration/db/mongo.clj
@@ -52,8 +52,7 @@
   (facts {:midje/name (format "can store records, then query with a query map for %s store" type)}
          (let [record-1 {:field-1 "r1f1" :field-2 "r1f2,r2f2" :field-3 "r1f3,r3f3"}
                record-2 {:field-1 "r2f1" :field-2 "r1f2,r2f2" :field-3 "r2f3"}
-               record-3 {:field-1 "r3f1" :field-2 "r3f2" :field-3 "r1f3,r3f3"}
-               record-4 {:field-1 "r4f1" :field-2 "r4f2" :nested {:field "r4"}}]
+               record-3 {:field-1 "r3f1" :field-2 "r3f2" :field-3 "r1f3,r3f3"}]
            (m/store! store :field-1 record-1)
            (m/store! store :field-1 record-2)
            (m/store! store :field-1 record-3)
@@ -64,9 +63,7 @@
             {:field-2 "r1f2,r2f2"}                       [record-1 record-2]
             {:field-1 "r1f1"}                            [record-1]
             {:field-2 "r1f2,r2f2" :field-3 "r1f3,r3f3"}  [record-1]
-            {:field-2 "haven't got one"}                 []
-            {:nested {:field "r4"}}                      [record-4]
-            ))))
+            {:field-2 "haven't got one"}                 []))))

 (facts "run store and query tests for both in-memory and mongo stores"
        (run-store-and-query-tests (m/create-memory-store) "in-memory")


Fix failing test

Fix failing test

--- test/refactor_nrepl/artifacts_test.clj
+++ test/refactor_nrepl/artifacts_test.clj
@@ -21,7 +21,7 @@
   (reset! artifacts/artifacts {})
   (with-redefs
     [artifacts/get-artifacts-from-clojars! (constantly clojars-artifacts)
-     artifacts/get-all-clj-artifacts! (constantly clojure-artifacts)
+     artifacts/get-mvn-artifacts! (constantly clojure-artifacts)
      artifacts/get-versions! (constantly clojure-versions)]

     (is (#'artifacts/stale-cache?))


Remove terminate-all-instances, to reduce chance of errors. Tweak signature of terminate-instances!

--- src/circle/backend/ec2.clj
+++ src/circle/backend/ec2.clj
@@ -74,15 +74,12 @@
   (-> (instance instance-id) :publicIpAddress))

 (defn terminate-instances!
-  [instance-ids]
+  [& instance-ids]
   (when (seq instance-ids)
     (with-ec2-client client
       (-> client
           (.terminateInstances (TerminateInstancesRequest. instance-ids))
           (bean)))))
-
-(defn terminate-all-instances! []
-  (terminate-instances! (all-instance-ids)))

 (defn security-groups
   []


trade_name_j: varchar(99) -> varchar(999)

--- src/pg_demo/table_defs.clj
+++ src/pg_demo/table_defs.clj
@@ -4520,7 +4520,7 @@
               COMMENTS varchar(1000),
               MHLW_RE_EXAMINATION_DATE timestamp,
               CLINICAL_COMPOUND_NUMBER varchar(99),
-              TRADE_NAME_J varchar(99),
+              TRADE_NAME_J varchar(999),
               COMMENTS_J varchar(1000),
               EXCLUDE_RPT_CANDIDATE numeric(1),
               PMDA_CLASS_ID_1 numeric,


load sound on start

load sound on start

--- src/pomodoro/pomodoro.cljs
+++ src/pomodoro/pomodoro.cljs
@@ -32,6 +32,7 @@

 (def sound (.createElement js/document "audio"))
 (set! (.-src sound) "/sounds/bell.mp3")
+(.load sound)

 (defn play-sound []
   (.load sound)


remove log

remove log

--- Assets/game/board.clj
+++ Assets/game/board.clj
@@ -90,7 +90,6 @@
                       (< (count @TRICK-STREAK) 30) 6
                       (< (count @TRICK-STREAK) 40) 7)]
      (reset! game.data/trick-multiplier multiplier)
-     (log (str "multiplier: " @game.data/trick-multiplier))
      (reset! game.data/trick-score (+ @game.data/trick-score (* multiplier (trick-score [x y z]))))
      (update-trick-ui)
      (game.ui/tween-rect-scale (the score) (v3 1.2 1.2 1) 0.2)))))


Added url to Github page to project.clj.

--- app/project.clj
+++ app/project.clj
@@ -1,6 +1,6 @@
 (defproject clj-web-example "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
-  :url "http://example.com/FIXME"
+  :url "https://github.com/MattiNieminen/clj-web-example"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0-beta3"]


progress on two-term flat-fielding

progress on two-term flat-fielding

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

--- plugins/SlideExplorer2/src/slide_explorer/flatfield.clj
+++ plugins/SlideExplorer2/src/slide_explorer/flatfield.clj
@@ -28,16 +28,17 @@

 (defn offset-image [images gain-image]
   (let [mean-image (image/intensity-projection
-                        :mean images)
+                     :mean images)
         uncorrected-pixel (image/center-pixel mean-image)]
+    (println uncorrected-pixel)
     (doto (image/divide-processors mean-image gain-image)
-      (.multiply -1)
-      (.add uncorrected-pixel))))
+      ;(.multiply -1)
+      (.subtract (double uncorrected-pixel)))))

 (defn flat-field [images]
-  (-> (image/intensity-projection :median images)
-      (image/gaussian-blur 50)
-      image/normalize-to-max))
+  (let [gain (gain-image images)]
+    {:offset (image/gaussian-blur (offset-image images gain) 50)
+     :gain (image/gaussian-blur gain 50)}))

 (defn flat-field-by-channel [cache]
   (->> @cache


CMR-3628: Removing the use of dummy value from ECHO10 translation.

--- umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/echo10.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/echo10.clj
@@ -123,7 +123,7 @@
      [:InsertTime (dates/with-default (dates/data-create-date c))]
      [:LastUpdate (dates/with-default (dates/data-update-date c))]
      [:DeleteTime (dates/data-delete-date c)]
-     [:LongName "dummy-long-name"]
+     [:LongName spec-util/not-provided]
      [:DataSetId (:EntryTitle c)]
      [:Description (if-let [abstract (:Abstract c)]
                      (util/trunc abstract 12000)


Wip on #42

Wip on #42

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -141,18 +141,23 @@
               (.append sb (char c))
               (recur sb (.read in))))))

+(defn- reconnect-if
+  [repl-env]
+  (when-not @(:torn-down repl-env)
+    (@(:reconnect-fn repl-env))))
+
 (defn start-reading-messages
   "Starts a thread reading inbound messages."
   [repl-env opts]
   (.start
-        (Thread.
-          #(try
-            (let [rv (read-messages (:in @(:socket repl-env)) (:response-promise repl-env) opts)]
-              (when (= :eof rv)
-                (close-socket @(:socket repl-env))))
-            (catch IOException e
-              (when-not (.isClosed (:socket @(:socket repl-env)))
-                (.printStackTrace e)))))))
+    (Thread.
+      #(try
+        (let [rv (read-messages (:in @(:socket repl-env)) (:response-promise repl-env) opts)]
+          (when (= :eof rv)
+            (close-socket @(:socket repl-env))
+            (reconnect-if repl-env)))
+        (catch IOException _
+          (reconnect-if repl-env))))))

 (defn stack-line->canonical-frame
   "Parses a stack line into a frame representation, returning nil
@@ -189,18 +194,23 @@
   (let [{:keys [out]} @(:socket repl-env)
         response-promise (promise)]
     (reset! (:response-promise repl-env) response-promise)
-    (write out js)
-    (let [response @response-promise]
-      (if (= :eof response)
-        {:status :error
-         :value  "Connection to JavaScriptCore closed."}
-        (let [result (json/read-str response
-                       :key-fn keyword)]
-          (merge
-            {:status (keyword (:status result))
-             :value  (:value result)}
-            (when-let [raw-stacktrace (:stacktrace result)]
-              {:stacktrace raw-stacktrace})))))))
+    (try
+      (write out js)
+      (let [response @response-promise]
+        (if (= :eof response)
+          (do
+            (reconnect-if repl-env)
+            {:status :error
+             :value  "Connection closed."})
+          (let [result (json/read-str response
+                         :key-fn keyword)]
+            (merge
+              {:status (keyword (:status result))
+               :value  (:value result)}
+              (when-let [raw-stacktrace (:stacktrace result)]
+                {:stacktrace raw-stacktrace})))))
+      (catch Exception _
+        (reconnect-if repl-env)))))

 (defn load-javascript
   "Load a Closure JavaScript file into the JSC REPL process."
@@ -273,6 +283,7 @@
           env (ana/empty-env)
           core (io/resource "cljs/core.cljs")]
       ((println-fn opts) "\nConnecting to" (bonjour-name->display-name bonjour-name) "...\n")
+      (reset! (:reconnect-fn repl-env) (partial reconnect repl-env opts))
       (set-up-socket repl-env opts endpoint-address (dec endpoint-port))
       (when (= "true" (:value (jsc-eval repl-env "typeof cljs === 'undefined'")))
         ;; compile cljs.core & its dependencies, goog/base.js must be available
@@ -332,7 +343,7 @@
       (tear-down repl-env)
       (throw t))))

-(defrecord JscEnv [response-promise bonjour-name webdav-mount-point socket options]
+(defrecord JscEnv [response-promise bonjour-name webdav-mount-point socket torn-down reconnect-fn options]
   repl/IReplEnvOptions
   (-repl-options [this]
     {:require-foreign true})
@@ -363,10 +374,11 @@
   (-load [repl-env provides url]
     (load-javascript repl-env provides url))
   (-tear-down [repl-env]
+    (reset! torn-down true)
     (tear-down repl-env)))

 (defn repl-env* [options]
-  (JscEnv. (atom nil) (atom nil) (atom nil) (atom nil) options))
+  (JscEnv. (atom nil) (atom nil) (atom nil) (atom nil) (atom nil) (atom nil) options))

 (defn repl-env
   [& {:as options}]


Fix malformed precondition check

Fix malformed precondition check

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -217,7 +217,7 @@
   The canonical stacktrace must be a vector of maps of the form
   {:file <string> :function <string> :line <integer> :column <integer>}."
   [raw-stacktrace opts]
-  {:pre  [string? (map? opts)]
+  {:pre  [(string? raw-stacktrace) (map? opts)]
    :post [(vector? %)]}
   (->> raw-stacktrace
     string/split-lines


Made naming unambiguous clean -> clean-terminal

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>

--- Clojure/src/snake/terminal.clj
+++ Clojure/src/snake/terminal.clj
@@ -1,7 +1,7 @@
 (ns snake.terminal)

-(defn clean
-  "Clear the terminal, i.e., remove all output."
+(defn clean-terminal
+  "Remove all output from the terminal."
   []
 	(print "\u001B[2J"))


Indentation.

Indentation.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -42,10 +42,9 @@

 (defn vis-add-ch [vis ch]
   (swap! vis #(update-in % [:chs ch]
-                           (fn [v]
-                             (if (nil? v)
-                               {:id ((:gen-id @vis)) :msgs {}}
-                               v)))))
+                         (fn [v] (if (nil? v)
+                                   {:id ((:gen-id @vis)) :msgs {}}
+                                   v)))))

 (def vis-event-handlers
   {"ago"


(SERVER-1630) Change ruby-code-dir to use using-jruby-9k? helper

Previously, the ruby-code-dir variable parsed the JRuby version to
order to figure out whether or not to prefix the internal, default code
path with 'classpath:/'.  This commit changes the logic to use a helper
that the jruby-utils library now provides, using-jruby-9k?.

--- src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -32,19 +32,14 @@
   classpath.

   See also:  http://jruby.org/apidocs/org/jruby/runtime/load/LoadService.html"
-  (let [jruby-version Constants/VERSION]
-    (if (< (count jruby-version) 2)
-      (throw (Exception. (str "Unexpected jruby-version format: " jruby-version)))
-      ;; Under JRuby 9k (and presumably later JRuby versions as well), JRuby
-      ;; will fail to find resources from the classpath unless they are prefixed
-      ;; with "classpath:/".  JRuby 1.x will generally find resources when
-      ;; prefixed with "classpath:/" as well, but an invocation of JRuby's irb
-      ;; will error out with "java.lang.NullPointerException: 'in' is null"
-      ;; when the "classpath:/" prefix is included.  The code below ensures
-      ;; that the "classpath:/" prefix is only omitted for JRuby 1.x.
-      (str (if (not= "1." (subs jruby-version 0 2))
-             "classpath:/")
-           "puppetserver-lib"))))
+  ;; Under JRuby 9k (and presumably later JRuby versions as well), JRuby
+  ;; will fail to find resources from the classpath unless they are prefixed
+  ;; with "classpath:/".  JRuby 1.x will generally find resources when
+  ;; prefixed with "classpath:/" as well, but an invocation of JRuby's irb
+  ;; will error out with "java.lang.NullPointerException: 'in' is null"
+  ;; when the "classpath:/" prefix is included.  The code below ensures
+  ;; that the "classpath:/" prefix is only included for JRuby 9k.
+  (str (if jruby-schemas/using-jruby-9k? "classpath:/") "puppetserver-lib"))

 (def default-http-connect-timeout
   "The default number of milliseconds that the client will wait for a connection


[#20] Use files to store secrets

[#20] Use files to store secrets

- We're going to use Kubernetes secrets mounted as file system
- We'll expose the mount point as an environment variable

--- api/src/clojure/org/akvo/flow_api/main.clj
+++ api/src/clojure/org/akvo/flow_api/main.clj
@@ -12,11 +12,19 @@
     s
     (str s "/")))

+(defn secret-value
+  "Reads the value of a secret from a file. It expects an
+  environment variable SECRETS_MOUNT_PATH pointing to a folder
+  containing secret files"
+  [secret-key]
+  (let [mount-path (ensure-trailing-slash (:secrets-mount-path env))]
+    (slurp (format "%s%s" secret-key))))
+
 (defn -main [& args]
   (let [bindings {'http-port (Integer/parseInt (:port env "3000"))
-                  'github-auth-token (:github-auth-token env)
+                  'github-auth-token (secret-value "github-auth-token")
                   'api-root (:api-root env)
-                  'sentry-dsn (:sentry-dsn env)
+                  'sentry-dsn (secret-value "sentry-dsn")
                   'tmp-dir (ensure-trailing-slash (System/getProperty "java.io.tmpdir"))}
         system   (->> (load-system [(io/resource "org/akvo/flow_api/system.edn")] bindings)
                       (component/start))]


Begin to re-work main.

Begin to re-work main.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -105,43 +105,46 @@
                                         "The first example sentence is followed by another example sentence. "
                                         "The second sentence is followed by another example sentence.")
                       "pcap" pcap-byte-array-test-data
+                      "self-adaptivity" 1
                       "nil" nil))
           _ (println "in-data:" in-data)
-          fn-mapping (:fn-mapping options)
-          _ (println "fn-mapping:" fn-mapping)
+          fn-mapping (atom (:fn-mapping options))
+          _ (println "fn-mapping:" @fn-mapping)
           pipeline-length (:pipeline-length options)
+          proc-fns (atom
+                     (condp = scenario
+                       "no-op" (create-no-op-proc-fns pipeline-length)
+                       "busy-sleep" (create-busy-sleep-proc-fns (count in-data))
+                       "factorial" [(fn [i _] (factorial i))]
+                       "factorial-inc" (create-factorial-proc-fns pipeline-length)
+                       "opennlp-single-inc" (utils/combine-proc-fns-vec
+                                              @fn-mapping
+                                              opennlp-single-sentence-inc-test-fns)
+                       "pcap-clj-map" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-clj-map)]
+                                        [(fn [i _] (pcap-fn i))])
+                       "pcap-clj-map-inc" (combine-proc-fns-vec
+                                            @fn-mapping
+                                            sample-pcap-processing-definition-clj-map)
+                       "pcap-java-map" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-java-map)]
+                                         [(fn [i _] (pcap-fn i))])
+                       "pcap-java-map-inc" (combine-proc-fns-vec
+                                             @fn-mapping
+                                             sample-pcap-processing-definition-java-map)
+                       "pcap-json" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-json)]
+                                     [(fn [i _] (pcap-fn i))])
+                       "pcap-json-inc" (combine-proc-fns-vec
+                                         @fn-mapping
+                                         sample-pcap-processing-definition-json)
+                       "pcap-csv" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-csv)]
+                                    [(fn [i _] (pcap-fn i))])
+                       "pcap-csv-inc" (combine-proc-fns-vec
+                                        @fn-mapping
+                                        sample-pcap-processing-definition-csv)))
           pipeline (if (and
                          (not (nil? in-data))
                          (not (.endsWith scenario "-direct")))
                      (create-local-processing-pipeline
-                       (condp = scenario
-                         "no-op" (create-no-op-proc-fns pipeline-length)
-                         "busy-sleep" (create-busy-sleep-proc-fns (count in-data))
-                         "factorial" [(fn [i _] (factorial i))]
-                         "factorial-inc" (create-factorial-proc-fns pipeline-length)
-                         "opennlp-single-inc" (utils/combine-proc-fns-vec
-                                                fn-mapping
-                                                opennlp-single-sentence-inc-test-fns)
-                         "pcap-clj-map" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-clj-map)]
-                                          [(fn [i _] (pcap-fn i))])
-                         "pcap-clj-map-inc" (combine-proc-fns-vec
-                                              fn-mapping
-                                              sample-pcap-processing-definition-clj-map)
-                         "pcap-java-map" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-java-map)]
-                                           [(fn [i _] (pcap-fn i))])
-                         "pcap-java-map-inc" (combine-proc-fns-vec
-                                               fn-mapping
-                                               sample-pcap-processing-definition-java-map)
-                         "pcap-json" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-json)]
-                                       [(fn [i _] (pcap-fn i))])
-                         "pcap-json-inc" (combine-proc-fns-vec
-                                           fn-mapping
-                                           sample-pcap-processing-definition-json)
-                         "pcap-csv" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-csv)]
-                                      [(fn [i _] (pcap-fn i))])
-                         "pcap-csv-inc" (combine-proc-fns-vec
-                                          fn-mapping
-                                          sample-pcap-processing-definition-csv))
+                       @proc-fns
                        out-fn))
           batch-delay (:batch-delay options)
           batch-size (:batch-size options)


Only an idiot would not run the tests before pushing.

--- modules/web/src/test/clojure/org/immutant/web/ring/test/RingMetaData.clj
+++ modules/web/src/test/clojure/org/immutant/web/ring/test/RingMetaData.clj
@@ -23,7 +23,7 @@
   (:require [clojure.java.io :as io]))

 ;; init the global runtime
-(ApplicationBootstrapUtils/init)
+(ApplicationBootstrapUtils/lazyInit)

 (deftest all-tests


Exclude reify

Exclude reify

--- ClojureScript/src/goby/macros.clj
+++ ClojureScript/src/goby/macros.clj
@@ -1,4 +1,5 @@
-(ns goby.macros)
+(ns goby.macros
+  (:refer-clojure :exclude [reify]))

 (defmacro reify
   "Implements a protocol, delegating to clojure.core/reify while also adding an


Rename `all-items` to `items`.

Rename `all-items` to `items`.

--- src/isla/story.clj
+++ src/isla/story.clj
@@ -19,7 +19,7 @@
   (connected-rooms [this story]))

 (defprotocol QueryableStory
-  (all-items [this])
+  (items [this])
   (item [this name]))

 (defprotocol Playable


Make code use new `Room` `items` fn.

Make code use new `Room` `items` fn.

--- src/isla/story.clj
+++ src/isla/story.clj
@@ -80,7 +80,7 @@
         (let [name (second arguments)]
           (if (some #{name} (map (fn [x] (:name x))
                                  items-in-room))
-            (let [item (first (filter (fn [x] (= (:name x) name)) items-in-room))]
+            (let [item (item (:room player) name)]
               (creturn
                (assoc-in
                 (assoc-in this [:player :items] (conj (:items player) item)) ;; item to player


tests for matrix updating

tests for matrix updating

--- test/matrix_utils_test.clj
+++ test/matrix_utils_test.clj
@@ -15,7 +15,11 @@
   [[ 0 1 0]
    [-1 1 1]
    [-1 0 0]])
+(def real-ptpts ["p1" "p2" "p3"])
+(def real-cmts ["c1" "c2" "c3"])

+
+; Simple creation test

 (deftest create-matrix
   (testing "Creation of matrix from scratch"
@@ -24,6 +28,55 @@
           cmts          (atom [])]
       (update-rating-matrix reactions rating-matrix ptpts cmts)
       (is (= @rating-matrix real-rating-matrix))
-      (is (= @ptpts ["p1" "p2" "p3"]))
-      (is (= @cmts ["c1" "c2" "c3"])))))
+      (is (= @ptpts real-ptpts))
+      (is (= @cmts real-cmts)))))

+
+; These could all be DRYer, and likely highlight the need to change the way we are
+; treating the identity of these atoms
+
+(deftest update-matrix
+  (testing "Updating an existing matrix"
+    (let [rating-matrix (atom real-rating-matrix)
+          ptpts (atom real-ptpts)
+          cmts (atom real-cmts)]
+      (testing "only with existing comments/ptpts"
+        (update-rating-matrix
+          ['("p1" "c3" 1) '("p3" "c3" -1)]
+          rating-matrix ptpts cmts)
+        (is (= @rating-matrix
+               [[ 0 1  1]
+                [-1 1  1]
+                [-1 0 -1]]))
+        (is (= @ptpts real-ptpts) "Nothing should change")
+        (is (= @cmts real-cmts) "Nothing should change")))
+
+    (let [rating-matrix (atom real-rating-matrix)
+          ptpts (atom real-ptpts)
+          cmts (atom real-cmts)]
+      (testing "with new ptpts"
+        (update-rating-matrix
+          ['("p4" "c3" 1) '("p3" "c3" -1)]
+          rating-matrix ptpts cmts)
+        (is (= @rating-matrix
+               [[ 0 1  0]
+                [-1 1  1]
+                [-1 0 -1]
+                [ 0 0  1]]))
+        (is (= @ptpts ["p1" "p2" "p3" "p4"]) "the new participant should be in ptpts")
+        (is (= @cmts real-cmts) "nothing should change")))
+
+    (let [rating-matrix (atom real-rating-matrix)
+          ptpts (atom real-ptpts)
+          cmts (atom real-cmts)]
+      (testing "with new ptpts"
+        (update-rating-matrix
+          ['("p4" "c3" 1) '("p3" "c3" -1)]
+          rating-matrix ptpts cmts)
+        (is (= @rating-matrix
+               [[ 0 1  0]
+                [-1 1  1]
+                [-1 0 -1]
+                [ 0 0  1]]))
+        (is (= @ptpts ["p1" "p2" "p3" "p4"]) "the new participant should be in ptpts")
+        (is (= @cmts real-cmts) "nothing should change")))))


Apply consistent sanitization when checking tags

--- frontend/src/faceboard/helpers/filters/tags.cljs
+++ frontend/src/faceboard/helpers/filters/tags.cljs
@@ -26,5 +26,5 @@
      :tags-by-size (sorted-list-of-tags-by-size tally)}))

 (defn tags-filter-predicate [selected-tags person]
-  (let [person-tags (set (:tags person))]
+  (let [person-tags (set (person/tags person))]
     (subset? selected-tags person-tags)))


STORM-1526  fix perf issue related to clojure dynamic method lookup in the spout.nextTuple() call tree

--- storm-core/src/clj/org/apache/storm/daemon/executor.clj
+++ storm-core/src/clj/org/apache/storm/daemon/executor.clj
@@ -58,7 +58,7 @@
   (.prepare grouping context (GlobalStreamId. component-id stream-id) target-tasks)
   (if (instance? LoadAwareCustomStreamGrouping grouping)
     (fn [task-id ^List values load]
-      (.chooseTasks grouping task-id values load))
+      (.chooseTasks ^LoadAwareCustomStreamGrouping grouping task-id values load))
     (fn [task-id ^List values load]
       (.chooseTasks grouping task-id values))))


Commented out tests that are no longer unit tests.

--- test/cmr/opendap/tests/unit/rest/handler/collection.clj
+++ test/cmr/opendap/tests/unit/rest/handler/collection.clj
@@ -6,63 +6,67 @@
    [cmr.opendap.rest.handler.collection :as collection]
    [cmr.opendap.testing.util :as util]))

-(deftest generate-via-get
-  (let [pvt-func #'collection/generate-via-get
-        concept-id :C123-PROV]
-    (is (= {:collection-id "C123-PROV"
-            :format "nc"
-            :granules []
-            :exclude-granules false
-            :variables []
-            :subset nil
-            :bounding-box nil}
-           (util/parse-response
-            (pvt-func {:params {}} "/search" "token" concept-id))))
-    (is (= {:collection-id "C123-PROV"
-            :format "nc"
-            :granules []
-            :exclude-granules false
-            :variables ["V1-PROV" "V2-PROV"]
-            :subset ["lat(56.109375,67.640625)"
-                     "lon(-9.984375,19.828125)"]
-            :bounding-box nil}
-           (util/parse-response
-            (pvt-func {:params
-                       {:variables "V1-PROV,V2-PROV"
-                        :subset ["lat(56.109375,67.640625)"
-                                 "lon(-9.984375,19.828125)"]}}
-                      "/search"
-                      "token"
-                      concept-id))))))
+;; XXX These now need to be re-worked ... and moved, since the latest code
+;; changes mean they're not simple unit tests anymore (they make multiple calls
+;; to CMR Search, so they're integration or system tests).

-(deftest generate-via-post
-  (let [pvt-func #'collection/generate-via-post
-        concept-id :C123-PROV]
-    (is (= {:collection-id "C123-PROV"
-            :format "nc"
-            :granules []
-            :exclude-granules false
-            :variables []
-            :subset nil
-            :bounding-box nil}
-           (util/parse-response
-            (pvt-func (util/create-json-stream-payload {})
-                      "/search"
-                      "token"
-                      concept-id))))
-    (is (= {:collection-id "C123-PROV"
-            :format "nc"
-            :granules []
-            :exclude-granules false
-            :variables ["V1-PROV" "V2-PROV"]
-            :subset ["lat(56.109375,67.640625)"
-                     "lon(-9.984375,19.828125)"]
-            :bounding-box nil}
-           (util/parse-response
-            (pvt-func (util/create-json-stream-payload
-                       {:variables "V1-PROV,V2-PROV"
-                        :subset ["lat(56.109375,67.640625)"
-                                 "lon(-9.984375,19.828125)"]})
-                      "/search"
-                      "token"
-                      concept-id))))))
+; (deftest generate-via-get
+;   (let [pvt-func #'collection/generate-via-get
+;         concept-id :C123-PROV]
+;     (is (= {:collection-id "C123-PROV"
+;             :format "nc"
+;             :granules []
+;             :exclude-granules false
+;             :variables []
+;             :subset nil
+;             :bounding-box nil}
+;            (util/parse-response
+;             (pvt-func {:params {}} "/search" "token" concept-id))))
+;     (is (= {:collection-id "C123-PROV"
+;             :format "nc"
+;             :granules []
+;             :exclude-granules false
+;             :variables ["V1-PROV" "V2-PROV"]
+;             :subset ["lat(56.109375,67.640625)"
+;                      "lon(-9.984375,19.828125)"]
+;             :bounding-box nil}
+;            (util/parse-response
+;             (pvt-func {:params
+;                        {:variables "V1-PROV,V2-PROV"
+;                         :subset ["lat(56.109375,67.640625)"
+;                                  "lon(-9.984375,19.828125)"]}}
+;                       "/search"
+;                       "token"
+;                       concept-id))))))
+
+; (deftest generate-via-post
+;   (let [pvt-func #'collection/generate-via-post
+;         concept-id :C123-PROV]
+;     (is (= {:collection-id "C123-PROV"
+;             :format "nc"
+;             :granules []
+;             :exclude-granules false
+;             :variables []
+;             :subset nil
+;             :bounding-box nil}
+;            (util/parse-response
+;             (pvt-func (util/create-json-stream-payload {})
+;                       "/search"
+;                       "token"
+;                       concept-id))))
+;     (is (= {:collection-id "C123-PROV"
+;             :format "nc"
+;             :granules []
+;             :exclude-granules false
+;             :variables ["V1-PROV" "V2-PROV"]
+;             :subset ["lat(56.109375,67.640625)"
+;                      "lon(-9.984375,19.828125)"]
+;             :bounding-box nil}
+;            (util/parse-response
+;             (pvt-func (util/create-json-stream-payload
+;                        {:variables "V1-PROV,V2-PROV"
+;                         :subset ["lat(56.109375,67.640625)"
+;                                  "lon(-9.984375,19.828125)"]})
+;                       "/search"
+;                       "token"
+;                       concept-id))))))


At least print the error

At least print the error

--- src/cljs/go.clj
+++ src/cljs/go.clj
@@ -46,13 +46,14 @@
                      (str "import \"" package "\";"))
                    "var _ = " (cond->> var package (str package ".")))
            {:keys [exit err out]} (sh/sh "godef" "-i" "-t" "-o" (str (count in)) :in in)]
-       (when (zero? exit)
+       (if (zero? exit)
          (let [[loc & def] (s/split-lines out)
                [file line col] (s/split loc #":")]
            (merge
             {:file file :def (s/trim (s/join "\n" (remove (comp empty? s/trim) def)))}
             (when (and line col)
-              {:line (biginteger line) :col (biginteger col)}) ))))))
+              {:line (biginteger line) :col (biginteger col)}) ))
+         (println err)))))

 (defn go-get [package]
   (let [{:keys [exit err]} (sh/sh "go" "get" package)]


Remove update-key from series (use assoc instead)

--- src/dataframe/series.clj
+++ src/dataframe/series.clj
@@ -7,6 +7,7 @@
 (declare series
          update-key)

+; A Series is a data structure that maps an index
 ; A Series is a data structure that maps an index
 ; to valus.  It supports:
 ; - Order 1 access to values by index
@@ -67,7 +68,8 @@
     frame with a new row added corresponding
     to the input index and column map."
     (if (contains? this idx)
-      (update-key this idx val)
+      (series (assoc values (get lookup idx) val)
+              index)
       (series (conj values val) (conj index idx)))))

 ; Constructor
@@ -116,20 +118,6 @@
   to the input index"
   ([^Series srs i] (get srs i nil))
   ([^Series srs i or-else] (get srs i or-else)))
-
-
-(defn update-key
-  "If the series has the given key,
-  return a series with the value
-  for that key updated to the given
-  value.
-  Otherwise, do nothing and return
-  the given series"
-  [^Series srs k v]
-  (if (contains? srs k)
-    (series (assoc (values srs) (.. srs lookup (get k)) v)
-            (index srs))
-    srs))

 (defn set-index


expand habits list

expand habits list

--- src/cljs/iwaswhere_web/ui/entry/briefing/habits.cljs
+++ src/cljs/iwaswhere_web/ui/entry/briefing/habits.cljs
@@ -22,6 +22,7 @@
         query-cfg (subscribe [:query-cfg])
         waiting-habits (subscribe [:waiting-habits])
         options (subscribe [:options])
+        expand-fn #(swap! local update-in [:expanded-habits] not)
         stories (reaction (:stories @options))
         saga-filter (fn [entry]
                       (if-let [selected (:selected @local)]
@@ -29,7 +30,7 @@
                           (= selected (:linked-saga story)))
                         true))
         entries-map (subscribe [:entries-map])
-        entries-list
+        habits
         (reaction
           (let [entries-map @entries-map
                 find-missing (u/find-missing-entry entries-map put-fn)
@@ -42,20 +43,20 @@
               entries
               (filter (u/pvt-filter conf entries-map) entries))))]
     (fn waiting-habits-list-render [entry local local-cfg put-fn]
-      (let [entries-list @entries-list
+      (let [habits (if (:expanded-habits @local) @habits (take 12 @habits))
             tab-group (:tab-group local-cfg)
             today (.format (js/moment.) "YYYY-MM-DD")
             briefing-day (-> entry :briefing :day)]
-        (when (and (= today briefing-day) (seq entries-list))
+        (when (and (= today briefing-day) (seq habits))
           [:div
            [:table.habits
             [:tbody
-             [:tr
+             [:tr {:on-click expand-fn}
               [:th [:span.fa.fa-exclamation-triangle]]
               [:th [:span.fa.fa-diamond]]
               [:th [:span.fa.fa-diamond.penalty]]
               [:th "waiting habit"]]
-             (for [entry (take 15 entries-list)]
+             (for [entry habits]
                (let [ts (:timestamp entry)
                      text (eu/first-line entry)]
                  ^{:key ts}


(SERVER-325) Add test to validate flushing second instance

This commit adds a test that validates that it is possible to flush
an instance other than the first one in the pool, if the first instance
is still borrowed when the second one hits its request limit.

--- test/unit/puppetlabs/services/jruby/jruby_pool_test.clj
+++ test/unit/puppetlabs/services/jruby/jruby_pool_test.clj
@@ -125,14 +125,16 @@
       (is (= (jruby-core/default-pool-size (ks/num-cpus)) (:size pool-state))))))

 (defn create-pool-context
-  [max-requests]
-  (let [config (-> (jruby-testutils/jruby-puppet-config {:max-active-instances 1})
-                   (assoc :max-requests-per-instance max-requests))
-        profiler jruby-testutils/default-profiler
-        pool-context (jruby-core/create-pool-context
-                       config profiler jruby-testutils/default-shutdown-fn)]
-    (jruby-agents/prime-pool! pool-context config profiler)
-    pool-context))
+  ([max-requests]
+    (create-pool-context max-requests 1))
+  ([max-requests max-instances]
+   (let [config (-> (jruby-testutils/jruby-puppet-config {:max-active-instances max-instances})
+                    (assoc :max-requests-per-instance max-requests))
+         profiler jruby-testutils/default-profiler
+         pool-context (jruby-core/create-pool-context
+                        config profiler jruby-testutils/default-shutdown-fn)]
+     (jruby-agents/prime-pool! pool-context config profiler)
+     pool-context)))

 (deftest flush-jruby-after-max-requests
   (testing "JRuby instance is not flushed if it has not exceeded max requests"
@@ -155,4 +157,19 @@
           id            (:id instance)]
       (jruby-core/return-to-pool instance)
       (let [instance (jruby-core/borrow-from-pool pool-context)]
-        (is (= id (:id instance)))))))
+        (is (= id (:id instance))))))
+  (testing "Can flush a JRuby instance that is not the first one in the pool"
+    (let [pool-context  (create-pool-context 2 3)
+          instance1     (jruby-core/borrow-from-pool pool-context)
+          instance2     (jruby-core/borrow-from-pool pool-context)
+          id            (:id instance2)]
+      (jruby-core/return-to-pool instance2)
+      ;; borrow it a second time and confirm we get the same instance
+      (let [instance2 (jruby-core/borrow-from-pool pool-context)]
+        (is (= id (:id instance2)))
+        (jruby-core/return-to-pool instance2))
+      ;; borrow it a third time and confirm that we get a different instance
+      (let [instance2 (jruby-core/borrow-from-pool pool-context)]
+        (is (not= id (:id instance2)))
+        (jruby-core/return-to-pool instance2))
+      (jruby-core/return-to-pool instance1))))


added a simple with-contracts macro that composes a string of contracts with a root contractee function

--- src/fogus/me/trammel.clj
+++ src/fogus/me/trammel.clj
@@ -24,6 +24,12 @@
        (if name
          (rest forms)
          forms)))))
+
+(defmacro with-contracts
+  ([f] f)
+  ([f contract] (list 'partial contract f))
+  ([f contract & more]
+     `(with-contracts (with-contracts ~f ~contract) ~@more)))

 (defmacro defconstrainedfn
   [name & body]


Use doc-string.

Use doc-string.

--- modules/reitit-frontend/src/reitit/frontend/history.cljs
+++ modules/reitit-frontend/src/reitit/frontend/history.cljs
@@ -60,8 +60,8 @@
           (recur (.-parentNode el)))))))

 (defn- event-target [event]
-  ;; Read event's target from composed path to get shadow dom working,
-  ;; fallback to target property if not available
+  "Read event's target from composed path to get shadow dom working,
+   fallback to target property if not available"
   (let [original-event (.-event_ event)]
     (if (exists? (.-composedPath original-event))
       (first (.composedPath original-event))


Update lein-droid in template

Update lein-droid in template

--- template/project.clj
+++ template/project.clj
@@ -1,8 +1,8 @@
-(defproject play-clj/lein-template "0.4.4"
+(defproject play-clj/lein-template "0.4.5-SNAPSHOT"
   :description "A template for making play-clj projects"
   :url "https://github.com/oakes/play-clj"
   :license {:name "Public Domain"
             :url "http://unlicense.org/UNLICENSE"}
-  :dependencies [[lein-droid "0.3.3"]]
+  :dependencies [[lein-droid "0.3.5"]]
   :resource-paths ["resources"]
   :eval-in-leiningen true)


Removing capture reveal.

Removing capture reveal.

--- umm-spec-lib/src/cmr/umm_spec/simple_xpath.clj
+++ umm-spec-lib/src/cmr/umm_spec/simple_xpath.clj
@@ -254,7 +254,6 @@
 ;; Select the values of the attributes given by attrib-name
 (defmethod process-xml-selector :attrib-selector
   [elements {:keys [attrib-name]}]
-  (cmr.common.dev.capture-reveal/capture-all)
   (persistent!
     (reduce (fn [attrib-values element]
               (if-let [attrib-value (get-in element [:attrs attrib-name])]


Call sh with args

Call sh with args

--- src/leiningen/new/chestnut/env/dev/clj/chestnut/dev.clj
+++ src/leiningen/new/chestnut/env/dev/clj/chestnut/dev.clj
@@ -36,7 +36,7 @@
 (defn start-less []
   (future
     (println "Starting less.")
-    (sh ["lein" "less" "auto"])))
+    (sh "lein" "less" "auto")))
 {{/less?}}
 {{#sass?}}
 (defn start-sass []


add TODO

add TODO

--- src/hodgepodge/core.cljs
+++ src/hodgepodge/core.cljs
@@ -48,6 +48,7 @@
        (->
         (.getItem s (serialize key))
         deserialize)))
+  ; TODO arity 3
 )

 (defn clear! [storage] (.clear storage))


remove errant require

remove errant require

--- src/vip/data_processor/validation/v5/street_segment.clj
+++ src/vip/data_processor/validation/v5/street_segment.clj
@@ -3,7 +3,6 @@
             [vip.data-processor.db.postgres :as postgres]
             [vip.data-processor.validation.v5.util :as util]
             [clojure.string :as str]
-            [clojure.edn :as edn]
             [vip.data-processor.errors :as errors]
             [clojure.tools.logging :as log]))


fixed customer-spawn-time for barbers, multiple barbers are more complicated...

--- 7_languages/Clojure/sleeping_barber_problem.clj
+++ 7_languages/Clojure/sleeping_barber_problem.clj
@@ -6,6 +6,7 @@
 (def number-chairs 3)
 (def opening-seconds (* 1000 10))
 (def duration-haircut 20)
+(def customer-spawn-time #(+ (rand-int 21) 10))

 (def shop-open? (atom false))
 (def open-chairs (ref number-chairs))
@@ -21,7 +22,8 @@
 (defn generate-customers []
   (future
     (while @shop-open?
-      (let [time-next-customer (+ (rand-int 20) 10)]
+      (let [time-next-customer (customer-spawn-time)]
+        ;(print time-next-customer)
         (Thread/sleep time-next-customer)
         (dosync
           (if (> @open-chairs 0)


Fix reset password and verify account emails. Remove help links from all emails for now, cleanup not used copy.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -29,72 +29,23 @@
 (def invite-message "invited you to his team on Carrot")
 (def invite-message-with-company "invited you to join the “%s” digest on Carrot")
 (def invite-button "Accept invitation")
-(def invite-help-links
-  [:p {:class "digest-help"}
-    "Visit our "
-    [:a {:href carrot-help}
-      "getting started guide"]
-    " for tips and tricks on how to get the most out of Carrot."])

 (def share-message "sent you a post")
 (def share-cta "Read post")
-(def share-help-links
-  [:p {:class "digest-help"}
-    "Not sure what a post is? Head over to our "
-    [:a {:href carrot-help} "support center"]
-    " to learn more"])

 (def board-invite-message "invited you to join the private section “%s” within your company digest")
 (def anonymous-board-invite-message "You've been invited to join the private section “%s” within your company digest")
 (def board-invite-explainer "Private sections of the digest are only available to invited team members.")
-(def board-invite-help-links
-  [:p {:class "digest-help"}
-    "Not sure what a private section is? Head over to our "
-    [:a {:href carrot-help} "support center"]
-    " to learn more"])

 (def reset-message "Password reset")
 (def reset-instructions "Click the button below to reset your password. If you didn't request a password reset, you can ignore this email.")
 (def reset-button-text "Reset Password")
-(def reset-ignore "If you didn't request a password reset, you can safely ignore this email.")
-(def reset-help-links
-  [:p {:class "digest-help"}
-    [:a {:href carrot-hello-mailto} "Contact us"]
-    " or visit our "
-    [:a {:href carrot-help} "support center"]
-    " if you’re in need of assistance"])
-
-(def verify-message "Please verify your email for Carrot")
-(def verify-instructions "Click the link below to verify your email address.")
+
+(def verify-message "Please verify your email")
+(def verify-instructions "Click the link below to verify your account.")
 (def verify-button-text "Verify Email")
-(def verify-ignore "If you didn't create a Carrot account, you can safely ignore this email.")
-(def verify-help-links
-  [:p {:class "digest-help"}
-    [:a {:href carrot-hello-mailto} "Contact us"]
-    " or visit our "
-    [:a {:href carrot-help} "support center"]
-    " if you’re in need of assistance"])
-
-(def digest-help-links
-  [:p {:class "digest-help"}
-    "You’re receing this digest weekly. You can change your "
-    [:a {:href profile-url} "delivery frequency"]
-    "."])
-

 ;; ----- HTML Fragments -----
-
-(defn- help-links [token-type]
-  [:table {:class "row"}
-    [:tr
-      [:th {:class "small-12 large-12 columns"}
-        (case token-type
-          :reset reset-help-links
-          :verify verify-help-links
-          :invite invite-help-links
-          :board-notification board-invite-help-links
-          :share-link share-help-links
-          :digest digest-help-links)]]])

 (defn- org-logo
   [{org-name :org-name logo-url :org-logo-url logo-height :org-logo-height logo-width :org-logo-width}]
@@ -319,9 +270,6 @@
       (when logo? (spacer 40))
       (h1 title)
       (mapcat post posts)
-      (spacer 24)
-      horizontal-line
-      (help-links :digest)
       (spacer 73)]))

 ;; ----- Transactional Emails -----
@@ -359,9 +307,6 @@
       (when show-note? (paragraph note))
       (spacer 35)
       (left-button "Accept invitation" board-url)
-      (spacer 24)
-      horizontal-line
-      (help-links :invite)
       (spacer 73)]))

 (defn- invite-content [td-classes invite]
@@ -394,9 +339,6 @@
       (when show-note? (paragraph note))
       (spacer 35)
       (left-button invite-button (:token-link invite))
-      (spacer 24)
-      horizontal-line
-      (help-links :invite)
       (spacer 73)]))

 (defn- share-content [entry]
@@ -433,9 +375,6 @@
       (post-attribution entry)
       (spacer 8)
       (read-post-button share-cta entry-url)
-      (spacer 24)
-      horizontal-line
-      (help-links :share-link)
       (spacer 73)]))

 (defn- token-prep [token-type msg]
@@ -449,10 +388,7 @@
     :button-text (case token-type
                     :reset reset-button-text
                     :verify verify-button-text)
-    :link (:token-link (keywordize-keys msg))
-    :ignore (case token-type
-                :reset reset-ignore
-                :verify verify-ignore)})
+    :link (:token-link (keywordize-keys msg))})

 (defn- token-content [td-classes token-type msg]
   (let [message (token-prep token-type msg)
@@ -462,20 +398,13 @@
     [:td {:class td-classes}
       (spacer 40)
       (when logo? (org-logo msg))
-      (when logo? (spacer 35))
-      (spacer 35)
+      (when logo? (spacer 40))
       (h2 (:message message))
-      (spacer 28)
+      (spacer 40)
       (paragraph (:instructions message))
-      (spacer 35)
+      (spacer 20)
       (left-button (:button-text message) (:token-link msg))
-      (spacer 35)
-      (paragraph (:ignore message))
-      (spacer 35)
-      horizontal-line
-      (help-links token-type)
-      (spacer 40)
-      (spacer 33)]))
+      (spacer 72)]))

 ;; ----- General HTML, common to all emails -----

@@ -560,8 +489,7 @@
   (let [message (token-prep token-type msg)]
     (str (:message message) "\n\n"
          (:instructions message) "\n\n"
-         (:link message) "\n\n"
-         (:ignore message))))
+         (:link message))))

 (defn digest-html [digest]
   (html digest :digest))


Use X-Forwarded-* headers when present

Use X-Forwarded-* headers when present

--- src/org/akvo/resumed.clj
+++ src/org/akvo/resumed.clj
@@ -20,16 +20,11 @@
 (defn gen-id []
   (.replaceAll (str (UUID/randomUUID)) "-" ""))

-(defn default-headers []
-  tus-headers)
-
 (defn options-headers []
   (select-keys tus-headers ["Tus-Version" "Tus-Extension" "Tus-Max-Size"]))

 (defn get-header [req header]
   (get-in req [:headers (.toLowerCase ^String header)]))
-
-

 (defn to-number
   "Returns a numeric representation of a String.
@@ -114,17 +109,22 @@
 (defn get-location
   "Get Location string from request"
   [req]
-  (let [origin (get-in req [:headers "origin"])]
-    (if (not (str/blank? origin))
-      (format "%s%s" origin (:uri req))
-      (format "%s://%s%s%s"
-              (name (:scheme req))
-              (:server-name req)
-              (if (and (not= (:server-port req) 80)
-                       (not= (:server-port req) 443))
-                (str ":" (:server-port req))
-                "")
-              (:uri req)))))
+  (let [origin (get-in req [:headers "origin"])
+        f-host (get-in req [:headers "x-forwarded-host"])
+        f-proto (get-in req [:headers "x-forwarded-proto"])
+        uri (:uri req)]
+    (if (and f-host f-proto)
+      (format "%s://%s%s" f-proto f-host uri)
+      (if (not (str/blank? origin))
+        (format "%s%s" origin uri)
+        (format "%s://%s%s%s"
+                (name (:scheme req))
+                (:server-name req)
+                (if (and (not= (:server-port req) 80)
+                         (not= (:server-port req) 443))
+                  (str ":" (:server-port req))
+                  "")
+                uri)))))

 (defn post
   [req opts]


flatten multiple occurrences of a given synth in a given group when vijualising the node-tree

--- src/overtone/core/sc.clj
+++ src/overtone/core/sc.clj
@@ -629,20 +629,36 @@
   [node]
   (str "Synth " (node :id) " " (node :synth)))

+(defn render-synth-set-node-str-for-vijual
+  [node]
+  (str (count (node :ids)) " Synths " (node :synth-set) ))
+
 (defn render-node-str-for-vijual
   [node]
   (cond
-   (contains? node :group) (render-group-node-str-for-vijual node)
-   (contains? node :synth) (render-synth-node-str-for-vijual node)
+   (contains? node :group)     (render-group-node-str-for-vijual node)
+   (contains? node :synth)     (render-synth-node-str-for-vijual node)
+   (contains? node :synth-set) (render-synth-set-node-str-for-vijual node)
    (true) (throw (Exception. "Please implement a vijual node renderer for this node type"))
    ))
+
+(defn flatten-synths-for-vijual
+  [node-list]
+  (let [synth-matcher    #(% :synth)
+        synths           (filter synth-matcher node-list)
+        non-synths       (filter (complement synth-matcher) node-list)
+        compact          #(remove nil? %)
+        compacted-synths (reduce (fn [sum node] (update-in sum [(node :synth) :ids] #(-> (conj [(node :id)] %) flatten compact))) {} synths)
+        synth-sets       (into [] (map (fn [[k v]] (if (< 1 (count (v :ids))) {:synth-set k :ids (v :ids)} {:synth k :id (first (v :ids))})) compacted-synths))]
+
+       (into non-synths synth-sets)))

 (defn prepare-tree-for-vijual
   [tree]
   (let [node     (render-node-str-for-vijual (dissoc tree :children))
         children (tree :children)]
     (if (pos? (count children))
-      (apply conj [node] (for [i children] (prepare-tree-for-vijual i)))
+      (apply conj [node] (for [i (flatten-synths-for-vijual children) ] (prepare-tree-for-vijual i)))
       [node])))

 (defn print-node-tree


Special case the FFT ugen to allow :ar ugens to be passed to it as args

--- src/overtone/sc/ugen.clj
+++ src/overtone/sc/ugen.clj
@@ -242,6 +242,9 @@
       (when-not (or
                  ;; Special case the a2k ugen
                  (and (= "A2K" (:name ugen))
+                      (= :ar (:rate-name bad-input)))
+                 ;; Special case the FFT ugen which may have ar ugens plugged into it
+                 (and (= "FFT" (:name ugen))
                       (= :ar (:rate-name bad-input)))
                  ;; Special case demand rate ugens which may have kr ugens plugged into them
                  (and (= :dr cur-rate)


Fix test-running in advanced compilation

--- test/runtests.cljs
+++ test/runtests.cljs
@@ -4,7 +4,8 @@
                     :refer (is deftest with-test run-tests testing)]
                    [cloact.debug :refer [dbg println]])
   (:require [cemerick.cljs.test :as t]
-            [cloact.core :as cloact :refer [atom]]))
+            [cloact.core :as cloact :refer [atom]]
+            [demo :as demo]))

 (defn ^:export console-print [x]
   (when (not= x "\n")


unsaved edits

unsaved edits

--- src/prais2/devcards.cljs
+++ src/prais2/devcards.cljs
@@ -206,27 +206,11 @@

-(defcard Transit-log-write1
-  "Dump log to transit format - unresponsively..."
-  (sit/write logger/log-wv ;@logger/log-state
-                          [(js/Date.) :foo (:event-data @logger/log-state) @core/app]))
-
-(defcard Transit-log-write2
+
+(defcard Transit-log-write-once
   "Dump log to transit format - unresponsively..."
   (sit/write logger/log-wv @logger/log-state))

-;;
-;;
-;;=> [["~#log-entry",["~m1447800495549","~:start-session",null,["~#app-state",["~:2014","~:intro",null,true,1,1,3,1,null,null]]]]]
-
-
-;;=> on success:
-;;=> [#prais2.logger.Log-entry{:time-stamp #inst "2015-11-18T10:57:33.854-00:00", :event-key :start-session, :event-data nil, :app-state #prais2.core.App-state{:datasource :2014, :page :intro, :sort-by nil, :sort-ascending true, :slider-axis-value 1, :detail-slider-axis-value 1, :chart-state 3, :theme 1, :selected-h-code nil, :map-h-code nil}}]
-;;
-;;=> on failure
-
-
-;;=> Transit-log-writer: @log-atom: " [#prais2.logger.Log-entry{:time-stamp #inst "2015-11-18T11:32:48.870-00:00", :event-key :start-session, :event-data nil, :app-state #prais2.core.App-state{:datasource :2014, :page :intro, :sort-by nil, :sort-ascending true, :slider-axis-value 1, :detail-slider-axis-value 1, :chart-state 3, :theme 1, :selected-h-code nil, :map-h-code nil}} #prais2.logger.Log-entry{:time-stamp #inst "2015-11-18T13:28:01.215-00:00", :event-key :start-session, :event-data nil, :app-state #prais2.core.App-state{:datasource :2014, :page :intro, :sort-by nil, :sort-ascending true, :slider-axis-value 1, :detail-slider-axis-value 1, :chart-state 3, :theme 1, :selected-h-code nil, :map-h-code nil}}]
 #_(defcard Transit-log-writer
   "Writes Log entries"
   (fn [log-atom]


fix type field access

fix type field access

--- src/sicp/common/list.clj
+++ src/sicp/common/list.clj
@@ -25,8 +25,8 @@
   (equals [this obj]
     (or (identical? this obj)
         (and (instance? Pair obj)
-             (= @a @(:a obj))
-             (= @b @(:b obj)))))
+             (= @a @(.a obj))
+             (= @b @(.b obj)))))
   (hashCode [_]
     (reduce #(+ (* 31 %1) (hash %2))
             17