Add Identifiable protocol to node store.

--- src/merkle_db/node.clj
+++ src/merkle_db/node.clj
@@ -14,6 +14,26 @@
 (defn meta-links
   [data]
   (:merkledag.node/links (meta data)))
+
+
+(defprotocol Identifiable
+  "Protocol for values which can be resolved to a multihash id."
+
+  (identify
+    [value]
+    "Return the multihash identifying this value."))
+
+
+(extend-protocol Identifiable
+
+  multihash.core.Multihash
+  (identify [x] x)
+
+  blocks.data.Block
+  (identify [x] (:id x))
+
+  merkledag.link.MerkleLink
+  (identify [x] (:target x)))

 (defprotocol NodeStore
@@ -43,17 +63,19 @@
   NodeStore

   (get-links
-    [this id]
-    (some->
-      (get-in @memory [id :links])
-      (vary-meta assoc :merkledag.node/id id)))
+    [this target]
+    (let [id (identify target)]
+      (some->
+        (get-in @memory [id :links])
+        (vary-meta assoc :merkledag.node/id id))))

   (get-data
-    [this id]
-    (when-let [node (get @memory id)]
-      (vary-meta (:data node) assoc
-                 :merkledag.node/id id
-                 :merkledag.node/links (:links node))))
+    [this target]
+    (let [id (identify target)]
+      (when-let [node (get @memory id)]
+        (vary-meta (:data node) assoc
+                   :merkledag.node/id id
+                   :merkledag.node/links (:links node)))))

   (put!
     [this data]
@@ -61,13 +83,13 @@

   (put!
     [this links data]
-    (let [id (digest/sha2-256 (pr-str [links data]))
-          links (->> (link/find-links data)
+    (let [links (->> (link/find-links data)
                      (concat links)
                      (link/compact-links)
                      (remove (set links))
                      (concat links)
-                     (vec))]
+                     (vec))
+          id (digest/sha2-256 (pr-str [links data]))]
       (swap! memory assoc id {:links links, :data data})
       (get-data this id)))


Docstring updates

Docstring updates

--- src/om_tools/core.cljx
+++ src/om_tools/core.cljx
@@ -75,6 +75,15 @@
    will-unmount, did-update, will-receive-props, render, and
    render-state

+   Method definitions take the form:
+   (methodname [args*] body)
+
+   Example:
+
+   (component
+     (did-mount [this] ...)
+     (render [this] ...)
+
    Everything inside body is within an implicit reify; any other non-Om protocols
    can be specified if needed."
   [& forms]
@@ -92,6 +101,9 @@
     :state An atom-like object for convenience to om.core/get-state and om.core/set-state!

   The contents will be processed with om-tools.core/component macro.
+
+  In addition, a factory function will be defined: ->component-name,
+  to wrap a call to om.core/build, providing any defaults.

   Example:


one step more for weeklies

one step more for weeklies

--- src/ontrail/weekly.clj
+++ src/ontrail/weekly.clj
@@ -13,8 +13,13 @@
         week-stops (time/plus midnight (time/days (- 8 dow)))]
     (time/interval week-starts week-stops)))

-(defn preceding-five-weeks [dt]
-  nil)
+(defn recur-weeks [args &] nil)
+
+(defn summary-weeks [user start-date stop-date]
+  (let [first-week (week-period start-date)
+        last-week (week-period stop-date)
+        distinct-sports (mc/distinct EXERCISE "sport" {:user user :creationDate {:$gte (.getStart first-week) :$lte (.getEnd last-week)}})]
+    {:header distinct-sports :weeks (recur-weeks user first-week last-week distinct-sports)}))

 (defn weekly-wrapper [params]
   {})


Documented :rest.

Documented :rest.

--- src/overtunes/core.clj
+++ src/overtunes/core.clj
@@ -14,8 +14,13 @@
 (defn play-note
   "Plays a single tone on instrument for duration, assuming an instrument that
   takes a frequency in Hz and a duration in seconds.
-  (play-note :C4 organ-cornet 1200)"
+  (play-note :C4 organ-cornet 1200)
+
+  Also accepts (and does nothing with) :rest.
+  (play-note :rest organ-cornet 1200)"
+
   [tone instrument duration]
+
   (if-not (= :rest tone)
     (let [seconds (/ duration 1000)
           frequency (midi->hz (note tone))]


Adding new tests for «context-from-clop»

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

--- src/conexp/tests/fca/more.clj
+++ src/conexp/tests/fca/more.clj
@@ -102,7 +102,19 @@
                                                (union set (premise impl) (conclusion impl)))
                                              #{}
                                              impls/testing-data)
-                                     (clop-by-implications impls/testing-data))))))
+                                     (clop-by-implications impls/testing-data)))))
+  (with-testing-data [ctx (random-contexts 20 10)]
+    (let [ctx (clarify-objects (reduce-context-objects ctx)),
+          cct (context-from-clop (attributes ctx)
+                                  #(context-attribute-closure ctx %))]
+      (and (= (count (objects ctx))
+              (count (objects cct)))
+           (= (attributes ctx)
+              (attributes cct))
+           (forall [g (objects ctx)]
+             (exists [h (objects cct)]
+               (= (object-derivation ctx #{g})
+                  (object-derivation cct #{h}))))))))

 ;;;


fix warning which should just be debug info

--- src/main/shadow/cljs/devtools/server/reload_macros.clj
+++ src/main/shadow/cljs/devtools/server/reload_macros.clj
@@ -55,7 +55,7 @@
           active-macros)]

     (when (seq reloaded)
-      (log/warnf "macro namespace reloaded %s" reloaded)
+      (log/debugf "macro namespace reloaded %s" reloaded)
       (sys-bus/publish! system-bus ::sys-msg/macro-update {:macro-namespaces reloaded}))

     ))


Improve exception message

Improve exception message

--- backend/src/akvo/lumen/dataset/utils.clj
+++ backend/src/akvo/lumen/dataset/utils.clj
@@ -7,4 +7,4 @@
    (when v
      (if-let [column (first (filter #(= v (get % filter-by)) columns))]
        column
-       (throw (ex-info "No such column" {filter-by v}))))))
+       (throw (ex-info (str "No such column: " v) {filter-by v}))))))


better playback controls

better playback controls

--- src/prais2/logger.cljs
+++ src/prais2/logger.cljs
@@ -84,13 +84,9 @@
 )

 (defn load-session
-  []
-  (prn "load-session not yet implemented")
-  (GET store-session-app
-       :handler sheets-success-handler
-       :error-handler sheets-read-error
-       :response-format :json
-       :keywords? true))
+  "No-op - JSON or JSONP GET appears to have restrictive permissions - using textbox paste instead."
+  []
+)

 (defn write-sheet-log
   "Write a log-event to the google sheet url."
@@ -197,13 +193,17 @@
   (icon-control "chevron-right" :redo "redo"))

 (rum/defc view-control []
-  (icon-control "eye" :view-session "view session log"))
-
-(rum/defc load-control []
   [:a#load-ctl.btn.btn-default
    {:href log-sheet-url
     :target "_blank"
-    :title "load session from spreadsheet"
+    :title "view session log"
+    :tab-index 0
+    }
+   [:i.fa.fa-eye]])
+
+(rum/defc load-control []
+  [:button#load-ctl.btn.btn-default
+   {:title "load session from spreadsheet"
     :data-toggle "collapse"
     :data-target "#paste-box"
     :aria-controls "paste-box"
@@ -212,11 +212,14 @@
     }
    [:i.fa.fa-sign-in.fa-rotate-90]])

-(rum/defc paste-box < rum/static [to-address session-log]
-  [:div#paste-box.paste-class.collapse
-   "To import a session, "
-   [:a.btn.btn-default {:href log-sheet-url} "copy rows"]
-   " from this spreadsheet and paste into the textbox."
+(rum/defc paste-box []
+  [:#paste-box.paste-class.collapse
+   [:p "To load a recorded session, copy rows from"
+    [:a.btn.btn-link {:href log-sheet-url :target "_blank" :style {:font-size "16px" :padding "0 4px 4px 4px" }} "the session log"]
+    "using a filtered view and paste them into the textbox here."]
+   [:.alert.alert-info "To create or view the spreadsheet using a session filter, go to 'Data > Filter views...' in the sheet menu."
+    [:br]
+    "Set the filter range to include the ip address and/or session-id columns and use the cell buttons at the top of those to filter for a single user's session."]
    [:form
     [:textarea {:placeholder "Paste rows here."
                 :name "foo"
@@ -244,7 +247,7 @@
     (redo-control)]
    " "
    [:.btn-group
-    (view-control)
+    #_(view-control)
     (load-control)]

    (paste-box)


Easy performance optimizations with type hints.

--- Spraff/src/spraff/core.clj
+++ Spraff/src/spraff/core.clj
@@ -37,16 +37,16 @@
         :pre [v]
         :post [% (= v %)]
     }
-
-    (locking (:lock c)
-        (if-let [result
-            (if-let [wr (.get (:whm c) v)]
-                (if-let [ret (.get wr)]
-                    ret))]
-            result
-            (do
-                (.put (:whm c) v (new java.lang.ref.WeakReference v))
-                (canonical-get c v) ))))
+    (let [^java.util.WeakHashMap whm (:whm c)]
+        (locking (:lock c)
+            (if-let [result
+                (if-let [^java.lang.ref.WeakReference wr (.get whm v)]
+                    (if-let [ret (.get wr)]
+                        ret))]
+                result
+                (do
+                    (.put whm v (new java.lang.ref.WeakReference v))
+                    (canonical-get c v) )))))

 (def canon (let [c (make-canonicalizer)]
     (fn [v] (canonical-get c v))))
@@ -251,8 +251,8 @@
                     }
                 })
                 :channels [channel])
-            (with-open [in (reader corpus-file)]
-                (dorun (map #(update-state! % state-ref) (line-seq in))))))))
-
-
-
+            (time (with-open [in (reader corpus-file)]
+                (dorun (map #(update-state! % state-ref) (line-seq in)))))))))
+
+
+


changed the language on the failed build banner to include a link to discuss

--- src-cljs/frontend/components/build.cljs
+++ src-cljs/frontend/components/build.cljs
@@ -51,14 +51,16 @@
        (if (:infrastructure_fail build)
          (infrastructure-fail-message owner)
          [:div.alert-wrap
-          "Error! "
+          "Error! Check out our "
           [:a {:href "/docs/troubleshooting"}
-           "Check out common problems "]
-          "or, if there's a problem in how CircleCI ran this build, "
-          [:a (merge {:title "Report an error in how Circle ran this build"}
-                     (common/contact-support-a-info owner :tags [:report-build-clicked {:build-url build-url}]))
-           "report this issue"]
-          " and we'll investigate."])])))
+           "help docs "]
+          "or our "
+          [:a {:href "http://discuss.circleci.com/"}
+           "community site "]
+          "for more information. If you are a paid customer, you may also consider "
+          [:a (common/contact-support-a-info owner :tags [:report-build-clicked {:build-url build-url}])
+           "requesting for help"]
+          " from a support engineer."])])))

 (defn container-pill [{:keys [container current-container-id build-running?]} owner]
   (reify


unnecessary require

unnecessary require

--- examples/src/helpers/captcha_wikipedia.clj
+++ examples/src/helpers/captcha_wikipedia.clj
@@ -1,8 +1,7 @@
 (ns helpers.captcha-wikipedia
   (:require [helpers.captcha :refer [reduce-dim]]
             [anglican.runtime :refer :all])
-  (:import [robots.OxCaptcha OxCaptcha]
-           [java.io File]))
+  (:import [robots.OxCaptcha OxCaptcha]))

 ;; Renderer setup
 (def WIDTH 200) ; Width of CAPTCHA


Fix calls to ring/response when cached

Fix calls to ring/response when cached

--- src/cavm/file.clj
+++ src/cavm/file.clj
@@ -185,11 +185,11 @@
           e-tag    (str (.getName file) "_" length "_" last-modified)]
       (cond
        (cached? req e-tag last-modified)
-       (-> (ring-resp/response)
+       (-> (ring-resp/response nil)
            (status 304)
            (header "ETag" e-tag))
        (resume? req e-tag last-modified)
-       (-> (ring-resp/response)
+       (-> (ring-resp/response nil)
            (status 416))
        :else
        (let [range  (find-range req file e-tag)]


Handle closing of event-ch/render-ch in vis.

--- src/cbfg/vis.cljs
+++ src/cbfg/vis.cljs
@@ -296,46 +296,46 @@
         el-svg (str el-prefix "-svg")]
     (world-init-cb world)
     (go-loop [num-events 0]      ; Process events from world / simulation.
-      (let [[actx [verb step & args]] (<! event-ch)
-            deltas ((get (get vis-event-handlers verb) step) vis actx args)
-            event-str (str num-events ": " (last actx) " " verb " " step " " args)]
-        (when (and (not (zero? @event-delay)) (some #(not (:after %)) deltas))
-          (>! render-ch [@vis deltas false event-str])
+      (when-let [[actx [verb step & args]] (<! event-ch)]
+        (let [deltas ((get (get vis-event-handlers verb) step) vis actx args)
+              event-str (str num-events ": " (last actx) " " verb " " step " " args)]
+          (when (and (not (zero? @event-delay)) (some #(not (:after %)) deltas))
+            (>! render-ch [@vis deltas false event-str])
+            (when (> @event-delay 0) (<! (timeout @event-delay)))
+            (when (< @event-delay 0) (<! step-ch)))
+          (>! render-ch [@vis deltas true event-str])
           (when (> @event-delay 0) (<! (timeout @event-delay)))
           (when (< @event-delay 0) (<! step-ch)))
-        (>! render-ch [@vis deltas true event-str])
-        (when (> @event-delay 0) (<! (timeout @event-delay)))
-        (when (< @event-delay 0) (<! step-ch)))
-        (recur (inc num-events)))
+        (recur (inc num-events))))
     (go-loop [vis-last nil       ; Process render-ch, updating U/I.
               vis-last-positions nil
               vis-last-html nil
               vis-last-svg nil
               prev-deltas nil]
-      (let [[vis-next deltas after event-str] (<! render-ch)
-            next-deltas (take 20 (conj prev-deltas [after deltas]))]
-        (set-el-innerHTML el-event event-str)
-        (if after
-          (let [vis-next-positions (atom {})
-                actx-ch-ch-infos (group-by #(:first-taker-actx (second %)) (:chs vis-next))]
-            (assign-positions vis-next world vis-next-positions actx-ch-ch-infos
-                              (when (get-in vis-next [:actxs world :closed]) 0))
-            (let [vis-next-html (apply str (flatten (vis-html-actx vis-next world
-                                                                   actx-ch-ch-infos)))
-                  vis-next-svg (apply str (flatten (vis-svg-actxs vis-next @vis-next-positions
-                                                                  deltas true prev-deltas)))]
-              (when (not= vis-next-html vis-last-html)
-                (set-el-innerHTML el-html vis-next-html)
-                (when on-render-cb
-                  (on-render-cb vis-next)))
+      (when-let [[vis-next deltas after event-str] (<! render-ch)]
+        (let [next-deltas (take 20 (conj prev-deltas [after deltas]))]
+          (set-el-innerHTML el-event event-str)
+          (if after
+            (let [vis-next-positions (atom {})
+                  actx-ch-ch-infos (group-by #(:first-taker-actx (second %)) (:chs vis-next))]
+              (assign-positions vis-next world vis-next-positions actx-ch-ch-infos
+                                (when (get-in vis-next [:actxs world :closed]) 0))
+              (let [vis-next-html (apply str (flatten (vis-html-actx vis-next world
+                                                                     actx-ch-ch-infos)))
+                    vis-next-svg (apply str (flatten (vis-svg-actxs vis-next @vis-next-positions
+                                                                    deltas true prev-deltas)))]
+                (when (not= vis-next-html vis-last-html)
+                  (set-el-innerHTML el-html vis-next-html)
+                  (when on-render-cb
+                    (on-render-cb vis-next)))
+                (when (not= vis-next-svg vis-last-svg)
+                  (set-el-innerHTML el-svg vis-next-svg))
+                (recur vis-next @vis-next-positions vis-next-html vis-next-svg next-deltas)))
+            (let [vis-next-svg (apply str (flatten (vis-svg-actxs vis-last vis-last-positions
+                                                                  deltas false prev-deltas)))]
               (when (not= vis-next-svg vis-last-svg)
                 (set-el-innerHTML el-svg vis-next-svg))
-              (recur vis-next @vis-next-positions vis-next-html vis-next-svg next-deltas)))
-          (let [vis-next-svg (apply str (flatten (vis-svg-actxs vis-last vis-last-positions
-                                                                deltas false prev-deltas)))]
-            (when (not= vis-next-svg vis-last-svg)
-              (set-el-innerHTML el-svg vis-next-svg))
-            (recur vis-last vis-last-positions vis-last-html vis-next-svg next-deltas)))))
+              (recur vis-last vis-last-positions vis-last-html vis-next-svg next-deltas))))))
     (vis-run-controls event-delay step-ch el-prefix)
     (let [toggle-ch (listen-el (gdom/getElement el-html) "click")] ; Process toggle U/I events.
       (go-loop []
@@ -344,4 +344,5 @@
             (when (= actx-id (last actx))
               (swap! vis #(assoc-in % [:actxs actx :closed] (not (:closed actx-info))))
               (>! render-ch [@vis nil true nil])))
-          (recur))))))
+          (recur))))
+    [event-ch render-ch]))


don't use "denigrated" method on X509Certificate

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -174,13 +174,15 @@
                            (.getSerialNumber)
                            (format-serial-number)
                            (str "0x"))
-        not-before (-> cert
-                       (.getNotBefore)
-                       (format-date-time))
-        not-after (-> cert
-                      (.getNotAfter)
-                      (format-date-time))
-        subject (.getSubjectDN cert)
+        not-before    (-> cert
+                          (.getNotBefore)
+                          (format-date-time))
+        not-after     (-> cert
+                          (.getNotAfter)
+                          (format-date-time))
+        subject       (-> cert
+                          (.getSubjectX500Principal)
+                          (.getName))
         entry (str serial-number " " not-before " " not-after " /" subject "\n")]
     (spit inventory-file entry :append true)))


Bump clojurescript dep for node 0.12 support.

--- src/leiningen/new/mies_node/project.clj
+++ src/leiningen/new/mies_node/project.clj
@@ -3,7 +3,7 @@
   :url "http://example.com/FIXME"

   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2755"]]
+                 [org.clojure/clojurescript "0.0-3126"]]

   :node-dependencies [[source-map-support "0.2.8"]]


Getting a little closer...I'm receiving a byte[] instead of a sequence of strings. I really should have realized/expected this

--- src/frereth_server/auth_socket.clj
+++ src/frereth_server/auth_socket.clj
@@ -28,6 +28,8 @@
     (when (seq msg)
       ;; Just got a batch of messages. What do they mean?
       ;; For starters, go with super-easy
+      ;; I bet this is at least part of my problem: I *really* have a
+      ;; java-style byte[]. I bet that qualifies as a seq.
       :list)))

 (defmulti ^:private dispatch
@@ -54,7 +56,8 @@
   (print "Dispatching a sequence of messages: " msgs)
   ;; Apparently, expectations redirects STDOUT
   ;;(throw (RuntimeException. "Why didn't that show up?"))
-  (comment (dorun #(dispatch %) msgs))
+  (dorun #(dispatch %) msgs)
+  ;; Or possibly my real problem is laziness?
   (for [m msgs]
     (throw (RuntimeException. (str m)))))

@@ -77,7 +80,8 @@
       ;; I hate to break this up like this, but it just is not
       ;; a performance-critical section.
       ;; Probably.
-      (spit "/tmp/log.txt" (format "Sending: %s\nto\n%s" msgs s))
+      (spit "/tmp/log.txt" (format "Sending: %s" msgs))
+      (spit "/tmp/log.txt" (format "\nto\n%s" s))
       (mq/send-all s msgs))))


dissocing object id from json-response of create ex

--- src/ontrail/mutate.clj
+++ src/ontrail/mutate.clj
@@ -19,19 +19,11 @@

 (defn to-db [min] (* (Integer. min) 60 100))
-
 (defn minutes [min] (to-db min))
-
 (defn hours [h] (* (to-db 1) 60))
-
 (defn hours-and-minutes [h min] (+ (hours h) (to-db min)))
-
-(defn hours-and-minutes-and-seconds [h min sec]
-  (+ (hours h) (to-db min) (* (Integer. sec) 100)))
-
 (defn minutes-and-seconds-and-tenths [min sec tenths]
   (+ (to-db min) (* (Integer. sec) 100) (* 10 (Integer. tenths))))
-
 (defn minutes-and-seconds-and-tenths-and-hundreds [min sec tenths hundreds]
   (+ (to-db min) (* (Integer. sec) 100) (* 10 (Integer. tenths)) hundreds))

@@ -87,7 +79,7 @@
          (string/split (trim-tag tags) #"[, ;\.\^\*\/]+")
          '()))))

-(defn from-user-ex [user user-ex]
+<(defn from-user-ex [user user-ex]
   (let [bare-ex {:title (:title user-ex)
                  :duration (parse-duration (:duration user-ex))
                  :sport (:sport user-ex)
@@ -107,11 +99,12 @@

 (defn create-ex [params]
   (let [user (:user params)
-        ret  (mc/insert-and-return EXERCISE (from-user-ex user params))]
-    (.debug logger (format "User %s created an ex %s " user ret))
-    (insert-exercise-inmem-index ret)
-    ret))
-
+        ret  (mc/insert-and-return EXERCISE (from-user-ex user params))
+        str-id (str (:_id ret))
+        tret (assoc  (dissoc ret :_id) :id str-id)]
+         (insert-exercise-inmem-index ret)
+         tret))
+
 (defn comment-ex [ex-id params]
   (mc/update-by-id EXERCISE
                    (ObjectId. ex-id)


Fix command-line message

Fix command-line message

--- src/cljam/cli.clj
+++ src/cljam/cli.clj
@@ -316,7 +316,7 @@
       :pileup  (pileup args)
       :faidx   (faidx args)
       :dict    (dict args)
-      (do (println "Invalid command. See 'foo --help'.")
+      (do (println "Invalid command. See 'cljam --help'.")
           (when (seq cands)
             (newline)
             (exit 1 (candidate-msg cands)))))))


CMR-3701: Lined up the attributes in the test.

--- system-int-test/test/cmr/system_int_test/ingest/collection_revision_validation_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_revision_validation_test.clj
@@ -25,15 +25,13 @@
              response))))

   (testing "attempting to ingest using an non-integer revision id returns an error"
-    (let [response (ingest/ingest-concept (data-umm-c/collection-concept {:EntryTitle "E2" :ShortName "S2" :concept-id "C2-PROV1"
-                                                                  :revision-id "NaN"}))]
+    (let [response (ingest/ingest-concept (data-umm-c/collection-concept {:EntryTitle "E2" :ShortName "S2" :concept-id "C2-PROV1" :revision-id "NaN"}))]
       (is (= {:status 422
               :errors [(msg/invalid-revision-id "NaN")]}
              response))))

   (testing "attempting to ingest using a negative revision id returns an error"
-    (let [response (ingest/ingest-concept (data-umm-c/collection-concept {:EntryTitle "E3" :ShortName "S3" :concept-id "C2-PROV1"
-                                                                  :revision-id "-1"}))]
+    (let [response (ingest/ingest-concept (data-umm-c/collection-concept {:EntryTitle "E3" :ShortName "S3" :concept-id "C2-PROV1" :revision-id "-1"}))]
       (is (= {:status 422
               :errors [(msg/invalid-revision-id "-1")]}
              response))))


Fix tuple docstring

Fix tuple docstring

Thanks Vincent Cantin for spotting it

--- src/main/clojure/clojure/test/check/generators.cljc
+++ src/main/clojure/clojure/test/check/generators.cljc
@@ -526,7 +526,7 @@

   Examples:

-      (def t (tuple gen/small-integer gen/boolean))
+      (def t (gen/tuple gen/small-integer gen/boolean))
       (sample t)
       ;; => ([1 true] [2 true] [2 false] [1 false] [0 true] [-2 false] [-6 false]
       ;; =>  [3 true] [-4 false] [9 true]))"


Do not print namespaces when loading; return ns which caused error

--- src/main/clojure/clojure/tools/namespace/reload.clj
+++ src/main/clojure/clojure/tools/namespace/reload.clj
@@ -21,22 +21,22 @@
 (defn track-reload-one
   "Executes the next pending unload/reload operation in the dependency
   tracker. Returns the updated dependency tracker. If reloading caused
-  an error, it is captured as ::error."
+  an error, it is captured as ::error and the namespace which caused
+  the error is ::error-ns."
   [tracker]
   (let [{unload ::track/unload, load ::track/load} tracker]
     (cond
       (seq unload)
         (let [n (first unload)]
-          (prn :unloading n)
           (remove-lib n)
           (update-in tracker [::track/unload] rest))
       (seq load)
         (let [n (first load)]
-          (try (prn :loading n)
-               (require n :reload)
+          (try (require n :reload)
                (update-in tracker [::track/load] rest)
                (catch Throwable t
-                 (assoc tracker ::error t ::track/unload load))))
+                 (assoc tracker
+                   ::error t ::error-ns n ::track/unload load))))
       :else
         tracker)))

@@ -45,7 +45,7 @@
   until either an error is encountered or there are no more pending
   operations."
   [tracker]
-  (loop [tracker (dissoc tracker ::error)]
+  (loop [tracker (dissoc tracker ::error ::error-ns)]
     (let [{error ::error, unload ::track/unload, load ::track/load} tracker]
       (if (and (not error)
                (or (seq load) (seq unload)))


♻ Split command handler tests

♻ Split command handler tests

Why:
- We will need multiple tests per command for all the error conditions,
  so it's more convenient to have one deftest per command.

--- test/territory_bro/db_admin_test.clj
+++ test/territory_bro/db_admin_test.clj
@@ -120,55 +120,58 @@
                         (let [events (conj events user-is-absent-event)]
                           (is (empty? (generate-commands events))))))))))))))))

-(deftest handle-command-test
+(deftest migrate-tenant-schema-test
   (let [spy (spy/spy)
         injections {:now (constantly test-time)
-                    :migrate-tenant-schema! (spy/fn spy :migrate-tenant-schema!)
-                    :ensure-gis-user-present! (spy/fn spy :ensure-gis-user-present!)
+                    :migrate-tenant-schema! (spy/fn spy :migrate-tenant-schema!)}]
+    (is (= [schema-is-present-event]
+           (db-admin/handle-command! {:command/type :db-admin.command/migrate-tenant-schema
+                                      :command/time test-time
+                                      :command/system "test"
+                                      :congregation/id cong-id
+                                      :congregation/schema-name "cong1_schema"}
+                                     injections)))
+    (is (= [[:migrate-tenant-schema! "cong1_schema"]]
+           (spy/read! spy)))))
+
+(deftest ensure-gis-user-present-test
+  (let [spy (spy/spy)
+        injections {:now (constantly test-time)
+                    :ensure-gis-user-present! (spy/fn spy :ensure-gis-user-present!)}]
+    (is (= [user-is-present-event]
+           (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-present
+                                      :command/time test-time
+                                      :command/system "test"
+                                      :user/id user-id
+                                      :gis-user/username "username123"
+                                      :gis-user/password "password123"
+                                      :congregation/id cong-id
+                                      :congregation/schema-name "cong1_schema"}
+                                     injections)))
+    (is (= [[:ensure-gis-user-present! {:username "username123"
+                                        :password "password123"
+                                        :schema "cong1_schema"}]]
+           (spy/read! spy)))))
+
+(deftest ensure-gis-user-absent-test
+  (let [spy (spy/spy)
+        injections {:now (constantly test-time)
                     :ensure-gis-user-absent! (spy/fn spy :ensure-gis-user-absent!)}]
+    (is (= [user-is-absent-event]
+           (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-absent
+                                      :command/time test-time
+                                      :command/system "test"
+                                      :user/id user-id
+                                      :gis-user/username "username123"
+                                      :congregation/id cong-id
+                                      :congregation/schema-name "cong1_schema"}
+                                     injections)))
+    (is (= [[:ensure-gis-user-absent! {:username "username123"
+                                       :schema "cong1_schema"}]]
+           (spy/read! spy)))))

-    (testing "migrate-tenant-schema"
-      (is (= [schema-is-present-event]
-             (db-admin/handle-command! {:command/type :db-admin.command/migrate-tenant-schema
-                                        :command/time test-time
-                                        :command/system "test"
-                                        :congregation/id cong-id
-                                        :congregation/schema-name "cong1_schema"}
-                                       injections)))
-      (is (= [[:migrate-tenant-schema! "cong1_schema"]]
-             (spy/read! spy))))
-
-    (testing "ensure-gis-user-present"
-      (is (= [user-is-present-event]
-             (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-present
-                                        :command/time test-time
-                                        :command/system "test"
-                                        :user/id user-id
-                                        :gis-user/username "username123"
-                                        :gis-user/password "password123"
-                                        :congregation/id cong-id
-                                        :congregation/schema-name "cong1_schema"}
-                                       injections)))
-      (is (= [[:ensure-gis-user-present! {:username "username123"
-                                          :password "password123"
-                                          :schema "cong1_schema"}]]
-             (spy/read! spy))))
-
-    (testing "ensure-gis-user-absent"
-      (is (= [user-is-absent-event]
-             (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-absent
-                                        :command/time test-time
-                                        :command/system "test"
-                                        :user/id user-id
-                                        :gis-user/username "username123"
-                                        :congregation/id cong-id
-                                        :congregation/schema-name "cong1_schema"}
-                                       injections)))
-      (is (= [[:ensure-gis-user-absent! {:username "username123"
-                                         :schema "cong1_schema"}]]
-             (spy/read! spy))))
-
-    (testing "invalid command"
-      (is (thrown-with-msg? ExceptionInfo #"Value does not match schema"
-                            (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-absent}
-                                                      injections))))))
+(deftest handle-command-test
+  (testing "invalid command"
+    (is (thrown-with-msg? ExceptionInfo #"Value does not match schema"
+                          (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-absent}
+                                                    {})))))


fix error with single pronoun set

fix error with single pronoun set

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -75,7 +75,7 @@

 (defn format-pronoun-examples
-  [pronoun-declension alternates]
+  [pronoun-declensions]
   (let [title "Pronoun Island: English Language Examples"]
     (html
      [:html
@@ -85,8 +85,7 @@
        [:link {:rel "stylesheet" :href "/pronouns.css"}]]
       [:body
        (title-block title)
-       (apply examples-block pronoun-declension)
-       (map #(apply examples-block %) alternates)
+       (map #(apply examples-block %) pronoun-declensions)
        (about-block)
        (contact-block)]])))

@@ -127,12 +126,11 @@

 (defn pronouns [params pronouns-table]
   (let [path (params :*)
-        ors (u/vec-coerce (params "or"))
-        pronoun-declension (lookup-pronouns (escape-html path)
-                                            pronouns-table)
-        alternates (map #(lookup-pronouns (escape-html %)
+        alts (or (params "or") [])
+        pronouns (concat [path] (u/vec-coerce alts))
+        pronoun-declensions (map #(lookup-pronouns (escape-html %)
                                           pronouns-table)
-                        ors)]
-    (if pronoun-declension
-      (format-pronoun-examples pronoun-declension alternates)
+                        pronouns)]
+    (if pronoun-declensions
+      (format-pronoun-examples pronoun-declensions)
       (not-found))))


[Fixes #5828] Updated bounties network URL

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/ui/screens/browser/default_dapps.cljs
+++ src/status_im/ui/screens/browser/default_dapps.cljs
@@ -60,7 +60,7 @@
             :photo-path  "contacts://name-bazaar"
             :description "ENS name marketplace"}
            {:name        "The Bounties Network"
-            :dapp-url    "https://berlin.bounties.network/"
+            :dapp-url    "https://bounties.network/"
             :photo-path  "contacts://bounties-network"
             :description "Bounties on any task, paid in any token"}
            {:name        "Emoon"


util/s3.clj: close stream in get-object-string

--- src/org/altlaw/util/s3.clj
+++ src/org/altlaw/util/s3.clj
@@ -80,8 +80,8 @@

 (defn get-object-string [bucket-name object-key]
   (catch-s3-errors
-   (IOUtils/toString (get-object-stream bucket-name object-key)
-                     "UTF-8")))
+   (with-open [stream (get-object-stream bucket-name object-key)]
+     (IOUtils/toString stream "UTF-8"))))

 (defn put-object-stream [bucket-name object-key stream metadata]
   (catch-s3-errors


fix blogwidth image

fix blogwidth image

--- src/smallblog/data.clj
+++ src/smallblog/data.clj
@@ -274,7 +274,7 @@
 							(scale-image-to-bytes imagebytes content-type 150
 								userid))
 					blogimageid (sql/insert-record :imageblob
-							(scale-image-to-bytes imagebytes content-type 538
+							(scale-image-to-bytes imagebytes content-type 550
 								userid))]
 				(sql/insert-record :image
 					{:filename filename :title title :description description
@@ -295,7 +295,7 @@
 					:description (:description image)
 					:image (ByteArrayInputStream. (:image blob))
 					:content-type (:contenttype blob)}))))
-
+
 (defn get-image
 	"returns a map with :filename, :title, :description (from image table)
 		and :image (as a stream), :content-type from imageblob"


Have a slow version of update-intercom-db running that self-throttles

--- src/polismath/intercom.clj
+++ src/polismath/intercom.clj
@@ -159,16 +159,14 @@
     (println "Number w/o:                    " (count icusers-by-email))
     ; Now getting to work
     (println "Now updating all user records in intercom")
-    (let [jobs (mapv
-                 (fn [u]
-                   [u (future
-                        (log/info "Running update for user:" (hash-map-subset u [:uid :email :hname :created]))
-                        (update-icuser-from-dbuser! u))])
-                   all-users)
-          failed-jobs (filterv (comp future-failed? second) jobs)]
-      (println "Number of failed jobs:" (count failed-jobs))
-      (doseq [[u _] failed-jobs]
-        (println u)))
+    (doseq [u all-users]
+      (Thread/sleep 1200)
+      (log/info "Running update for user:" (hash-map-subset u [:uid :email :hname :created]))
+      (try
+        (update-icuser-from-dbuser! u)
+        (catch Exception e
+          (log/error "Problem with update for user" (hash-map-subset u [:uid :email :hname :created]))
+          (.printStackTrace e *out*))))
     ; Stab at doing batched runs
     ;(let [jobs (mapv
                  ;(fn [us]


rename our test topology in auth test case

--- test/clj/backtype/storm/security/auth/auth_test.clj
+++ test/clj/backtype/storm/security/auth/auth_test.clj
@@ -127,7 +127,7 @@
   (let [client (NimbusClient. "localhost" 6627)
         nimbus_client (.getClient client)]
      (is (thrown? TTransportException
-            (.activate nimbus_client "bogus_topology")))
+            (.activate nimbus_client "security_auth_test_topology")))
      (.close client)))

 (deftest authentication-test
@@ -143,6 +143,6 @@
   (System/setProperty "java.security.auth.login.config" "./conf/jaas_digest.conf")
   (let [client (NimbusClient. "localhost" 6628)
         nimbus_client (.getClient client)]
-     (.activate nimbus_client "bogus_topology")
+     (.activate nimbus_client "security_auth_test_topology")
      (.close client)))


(TK-311) Add log-event-listener isStarted method

Overlooked in the initial reify.

--- test/puppetlabs/trapperkeeper/testutils/logging.clj
+++ test/puppetlabs/trapperkeeper/testutils/logging.clj
@@ -97,15 +97,17 @@
   "Returns a log Appender that will call (listen event) for each log event."
   [listen]
   ;; No clue yet if we're supposed to start with a default name.
-  (let [name (atom (str "tk-log-listener-" (kitchensink/uuid)))]
+  (let [name (atom (str "tk-log-listener-" (kitchensink/uuid)))
+        started? (atom false)]
     (reify
       Appender
-      (doAppend [this event] (listen event))
+      (doAppend [this event] (when @started? (listen event)))
       (getName [this] @name)
       (setName [this x] (reset! name x))
       LifeCycle
-      (start [this] true)
-      (stop [this] true))))
+      (start [this] (reset! started? true))
+      (stop [this] (reset! started? false))
+      (isStarted [this] @started?))))

 (defn call-with-additional-log-appenders [logger-id appenders f]
   "Adds the specified appenders to the logger specified by logger-id,


Add snippets for Lights, Camera - Material Properties. Issue #87.

--- test/snippets/lights_camera/material_properties.clj
+++ test/snippets/lights_camera/material_properties.clj
@@ -43,7 +43,7 @@
   (fill 0 51 102)
   (light-specular  255 255 255)
   (directional-light 204 204 204 -1 -1 -1)
-  (specular 255 255 255)
+  (specular 255)
   (sphere 50)
   (translate 0 100 0)
   (specular 204 102 0)


Add directional lighting

Add directional lighting

--- src/threedee/core.cljs
+++ src/threedee/core.cljs
@@ -1,5 +1,5 @@
 (ns threedee.core
-  (:require [cljs.pprint :refer [pprint] ]
+  (:require [cljs.pprint :refer [pprint]]
             [cljsjs.three :as THREE]
             [threedee.vectors :as v]))

@@ -7,19 +7,23 @@

 (def WIDTH 600)
 (def HEIGHT 600)
-(def attractor-acceleration 0.04)
-(def max-velocity 2)
+(def attractor-acceleration 0.01)
+(def max-velocity 0.2)

 (defonce scene (THREE.Scene.))
 (def camera (THREE.PerspectiveCamera. 75 (/ WIDTH HEIGHT) 0.2 1000))
 (defonce renderer (THREE.WebGLRenderer. #js {"antialias" true}))
+(defonce light (do
+                 (let [light (THREE.DirectionalLight. 0x0000ff 1)]
+                   (.set (.-position light) 0.5 -1 0)
+                   (.add scene light))))

 (.setPixelRatio renderer js.window.devicePixelRatio)
 (.setSize renderer WIDTH HEIGHT)

 (defonce x (.appendChild (.getElementById js/document "main") renderer.domElement))

-(defonce model (atom {:attractor {:pos [0 0]}
+(defonce model (atom {:attractor {:id "attractor" :pos [0 0]}
                       :balls     (for [n (range 1 10)]
                                    {:id n :pos [(* n 0.4) 0] :velocity [0 0.3] :acceleration [0 0]})}))

@@ -59,13 +63,14 @@
       accelerate-balls
       move-balls))

-
-(def geometry (THREE.BoxGeometry. 0.2 0.3 0.1))
-(def material (THREE.MeshBasicMaterial. #js {"color" 0xffffff "wireframe" true}))
+(def geometry (THREE.SphereGeometry. 0.2 0.3 0.1))
+(def material (THREE.MeshPhongMaterial. #js {"color" 0xffffff
+                                             "specular" 0x555555
+                                             "shininess" 30}))

 (defn add-items-to-scene [scene model]
-  (doseq [ball (:balls model)]
-    (prn (str  "Adding: " ball))
+  (doseq [ball (conj (:balls model) (:attractor model))]
+    (prn (str "Adding: " ball))
     (let [ball-mesh (THREE.Mesh.
                       geometry
                       material)]
@@ -100,6 +105,6 @@

 (defonce initial-setup
          (do
-             (prn "Initial setup")
-             (add-items-to-scene scene @model)
-             (mainloop)))+           (prn "Initial setup")
+           (add-items-to-scene scene @model)
+           (mainloop)))


Added tree->data as inverse of data->tree

--- src/tupelo/forest.cljc
+++ src/tupelo/forest.cljc
@@ -192,7 +192,6 @@
                                map-data)

     :else (throw (IllegalArgumentException. (str "tree->data: unrecognized node=" node)))))
-

 (defn enlive-node-lax?
   "Returns true for nominal Enlive nodes, else false"


Consistently use ljlib to refer to hello-lambda-jakarta.core from tools

--- src/whoami/whoami.cljs
+++ src/whoami/whoami.cljs
@@ -1,12 +1,12 @@
 (ns whoami.core
   (:require [cljs.nodejs :as nodejs]
-            [hello-lambda-jakarta.core :as core]
+            [hello-lambda-jakarta.core :as ljlib]
             ))

 (nodejs/enable-util-print!)

 (defn -main []
-  (println (core/whoami))
+  (println (ljlib/whoami))
 )

 (set! *main-cli-fn* -main)


Replaced code generating function

Replaced code generating function

--- src/wishlistd/code.clj
+++ src/wishlistd/code.clj
@@ -1,11 +1,14 @@
 (ns wishlistd.code)

-(def letters ["A","B","C","D","E","F","G","H","I","J","K"])
+(defn random-vowel []
+  (rand-nth ["a","i","u","e","o"]))

-(defn generate-code [id]
-  (apply str
-    (map
-      (comp
-        #(letters %)
-        #(Integer/parseInt (str %)))
-      (format "%03d" id))))+(defn random-consonant []
+  (rand-nth ["b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","y","z"]))
+
+(defn random-code [length]
+  (apply str
+    (for [i (range length)]
+      (if (even? i)
+        (random-consonant)
+        (random-vowel)))))


fix schema select test

fix schema select test

--- test/cljs/gc_api_browser/schema_select_test.cljs
+++ test/cljs/gc_api_browser/schema_select_test.cljs
@@ -3,14 +3,15 @@
             [gc-api-browser.schema-select :refer [get-domain]]))

 (def schema
-  {:links [{:href "http://gocardless.com"}]})
+  {:links [{:href "http://api.gocardless.com"}
+           {:href "http://sandbox-api.gocardless.com"}]})

 (deftest test-get-domain
   (testing "with an existing url set"
     (is (= "http://example.com"
            (get-domain schema {:url "http://example.com/foobar"}))))
   (testing "with no existing url set"
-    (is (= "http://gocardless.com"
+    (is (= "http://sandbox-api.gocardless.com"
            (get-domain schema {:url nil})))))

 (comment


(#9068) More testing of the SQL generated matching

This adds further tests, now that we have the underlying database stable and
able to handle query inside an array column.

Signed-off-by: Daniel Pittman <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@puppetlabs.com>

--- test/com/puppetlabs/cmdb/test/query/resource.clj
+++ test/com/puppetlabs/cmdb/test/query/resource.clj
@@ -269,7 +269,7 @@
                    :exported   false
                    :sourcefile nil
                    :sourceline nil
-                   :parameters {"random" "false"}}
+                   :parameters {"random" ["false"]}}
           result6 {:hash       "6"
                    :type       "Mval"
                    :title      "multivalue"
@@ -289,5 +289,11 @@
         (is (= (s/query-resources ["=" "exported" true]) [result1 result2 result3]))
         (is (= (s/query-resources ["=" ["parameter" "ensure"] "file"]) [result1]))
         ;; multi-value parameter matching!
-        (is (= (s/query-resources ["=" ["parameter" "multi"] "two"]) [result6])))
-      )))
+        (is (= (s/query-resources ["=" ["parameter" "multi"] "two"]) [result6]))
+        ;; and that they don't match *everything*
+        (is (= (s/query-resources ["=" ["parameter" "multi"] "five"]) []))
+        ;; testing not operations
+        (is (= (s/query-resources ["not" ["=" "type" "File"]])
+               [result2 result3 result5 result6]))
+        (is (= (s/query-resources ["not" ["=" "type" "File"] ["=" "type" "Notify"]])
+               [result6]))))))


(maint) Fix test usage of user.dir for Java11 compat

--- test/puppetlabs/trapperkeeper/bootstrap_test.clj
+++ test/puppetlabs/trapperkeeper/bootstrap_test.clj
@@ -1,7 +1,7 @@
 (ns puppetlabs.trapperkeeper.bootstrap-test
   (:import (java.io StringReader))
   (:require [clojure.test :refer :all]
-            [clojure.java.io :refer [file]]
+            [clojure.java.io :refer [file] :as io]
             [slingshot.slingshot :refer [try+]]
             [puppetlabs.kitchensink.core :refer [without-ns]]
             [puppetlabs.kitchensink.classpath :refer [with-additional-classpath-entries]]
@@ -46,21 +46,24 @@
               (is (= (hello-world hello-world-svc) "hello world")))))

         (testing "Gives precedence to bootstrap config in cwd"
-          (let [old-cwd (System/getProperty "user.dir")]
+          (let [cwd-config (io/file (System/getProperty "user.dir") "bootstrap.cfg")
+                test-config (io/file "./dev-resources/bootstrapping/cwd/bootstrap.cfg")]
+            ;; This test used to set the user.dir property to the dev-resources dir above,
+            ;; however in Java 11 it is illegal to set user.dir at runtime.
+            (is (not (.exists cwd-config))
+                "A bootstrap config file exists in the cwd, cannot reliably test cwd bootstrap loading!")
             (try
-              (System/setProperty
-               "user.dir"
-               (.getAbsolutePath (file "./dev-resources/bootstrapping/cwd")))
+              (io/copy test-config cwd-config)
               (with-test-logging
                 (let [app (bootstrap-with-empty-config)
                       test-svc (get-service app :TestService)
                       hello-world-svc (get-service app :HelloWorldService)]
                   (is (logged?
-                       #"Loading bootstrap config from current working directory: '.*/dev-resources/bootstrapping/cwd/bootstrap.cfg'"
+                       #"Loading bootstrap config from current working directory: '.*/bootstrap.cfg'"
                        :debug))
                   (is (= (test-fn test-svc) :cwd))
                   (is (= (hello-world hello-world-svc) "hello world"))))
-              (finally (System/setProperty "user.dir" old-cwd)))))
+              (finally (io/delete-file cwd-config)))))

         (testing "Gives precedence to bootstrap config specified as CLI arg"
           (with-test-logging


#15 read dates of posts

#15 read dates of posts

--- src/kalar_plugins/templates/page.clj
+++ src/kalar_plugins/templates/page.clj
@@ -7,20 +7,30 @@
             [net.cgrand.enlive-html :as ehtml]
             [kalar-core.config :as config]
             [kalar-core.file :as kfile])
-  (:import (java.io StringWriter StringReader)))
+  (:import (java.io StringWriter StringReader)
+           (java.text SimpleDateFormat)))

 (defn- get-dst-path [^String src-path]
   (kfile/get-dst (str/replace src-path #"\..*$" ".html")))

+
+(def ^:private date-formatter (SimpleDateFormat. "yyyy-MM-dd"))
+
+(defn- format-date [date-str] (.parse date-formatter date-str))
+
+(defn- extract-date-from-filename [filename]
+  (-> (re-matcher  #"^\d{4}-\d{1,2}-\d{1,2}" filename) re-find format-date))
+
+
 (defn load-markdown [^String file]
   (let [input    (new StringReader (slurp file))
         output   (new StringWriter)
+        date     (extract-date-from-filename (.getName (io/file file)))
         metadata (md/md-to-html input output :parse-meta? true :heading-anchors true)
         html     (.toString output)
         url (string/replace (string/replace file (re-pattern (str "^" (kfile/find-resources-dir))) "") #"\..*$" ".html")
         dest-file (io/file (kfile/find-dest) (string/replace url #"^/" ""))]
-
-    (merge metadata {:body html :url url :dest-file dest-file})))
+    (merge metadata {:body html :url url :dest-file dest-file :date date})))

 (defn load-md-excerpt [^String md]
   (let [compiled (load-markdown md)


Fixed regression introduced with 353e0656c4fb

Fixes #35

--- src/main/clojure/vimclojure/repl.clj
+++ src/main/clojure/vimclojure/repl.clj
@@ -55,7 +55,7 @@

 (defn make-repl
   "Create a new Repl."
-  ([id] (make-repl (the-ns 'user)))
+  ([id] (make-repl id (the-ns 'user)))
   ([id namespace]
    (struct-map repl
                :id                 id


fix practice groups style

fix practice groups style

--- src/mobile_patient/screen/chats.cljs
+++ src/mobile_patient/screen/chats.cljs
@@ -19,14 +19,16 @@
         patient @(subscribe [:user-by-id patient-id])
         chat-name (str (user-model/get-official-name patient) " PG")
         unread (get-in item [:chat :unread])]
-    [ui/touchable-highlight {:style {:padding 10}
+    [ui/touchable-highlight {:style {:border-color "#E9E9EF"
+                                     :border-width 1
+                                     :border-top-width (if (zero? index) 0 1)
+                                     :border-bottom-width 0
+                                     :padding 10}
                              :on-press #(on-press item navigation chat-name)
                              :underlay-color "white"}
      [ui/view {:style {:flex 1
                        :flex-direction :row
                        :justify-content :space-between
-                       :margin-top 10
-                       :margin-bottom 10
                        :padding-left 15
                        :padding-right 10}}


Preserve theme when refreshing REPL

Preserve theme when refreshing REPL

--- src/net/sekao/nightcode/projects.clj
+++ src/net/sekao/nightcode/projects.clj
@@ -37,7 +37,7 @@
     (shortcuts/add-tooltips! pane [:#up :#new_file :#open_in_file_browser :#close])
     pane))

-(defn home-pane [pref-state runtime-state]
+(defn home-pane [pref-state-atom runtime-state]
   (let [pane (FXMLLoader/load (io/resource "home.fxml"))
         docs (-> pane .getChildren (.get 1) .getItems (.get 0))
         repl (-> pane .getChildren (.get 1) .getItems (.get 1))
@@ -47,7 +47,7 @@
                      (let [pipes (b/create-pipes)]
                        (b/init-console! repl pipes web-port
                          (fn []
-                           (b/refresh-builder! repl true pref-state)
+                           (b/refresh-builder! repl true @pref-state-atom)
                            (b/start-builder-process! repl pipes process "." nil ["clojure.main"])))))]
     ; load the panes
     (.load (.getEngine docs) (str "http://localhost:" web-port "/cheatsheet-full.html"))
@@ -132,7 +132,7 @@
         path)
       (getPane [pref-state-atom runtime-state-atom _]
         (let [pane (or (get-in @runtime-state-atom [:project-panes path])
-                       (home-pane @pref-state-atom @runtime-state-atom))]
+                       (home-pane pref-state-atom @runtime-state-atom))]
           (swap! runtime-state-atom update :project-panes assoc path pane)
           pane))
       (focus [pane]
@@ -353,7 +353,7 @@
   :ret spec/pane?)

 (fdef home-pane
-  :args (s/cat :pref-state map? :runtime-state map?)
+  :args (s/cat :pref-state-atom spec/atom? :runtime-state map?)
   :ret spec/pane?)

 (fdef file-node


add @current-user to edit-profile

add @current-user to edit-profile

--- src/verbose_spoon/routes/handler.clj
+++ src/verbose_spoon/routes/handler.clj
@@ -38,7 +38,7 @@
   (GET "/registration" [] (registration/page))
   (GET "/main" [] (main/page))
   (GET "/me" [] (me/page))
-  (GET "/edit-profile" [] (edit-profile/page))
+  (GET "/edit-profile" [] (edit-profile/page @current-user))
   (GET "/my-application" [] (my-application/page @current-user))
   (GET "/view-apply-project/:project_name" [project_name] (view-apply-project/page project_name))
   (GET "/view-course/:coursenum" [coursenum] (view-course/page coursenum))


spelling error checking code is understood. I'd like to lick the shoes of this code's author.

--- src/data_mall/spell_error.clj
+++ src/data_mall/spell_error.clj
@@ -35,16 +35,51 @@
   (let [w2-0 (.substring w2 1)]
     (map #(str w1 % w2-0) alphabet)))

+(defn insert-split
+  [[w1 w2]]
+  (map #(str w1 % w2) alphabet))
+
 (defn edits-1
   [word]
   (let [splits (map (partial split-word word) (range (inc (count word))))
         long-splits (filter #(> (count (second %)) 1) splits)
         deletes (map delete-char long-splits)
         transposes (map transpose-split long-splits)
-        ]
-    )
-  )
+        replaces (mapcat replace-split long-splits)
+        inserts (remove nil? (mapcat insert-split splits))] ;don't know why need a remove here
+    (set (concat deletes transposes replaces inserts))))

-;(words "Mama takes good care of me.")
+(defn known-edits-2
+  [word]
+  (set (filter (partial contains? n-words)
+               (apply union (map #(edits-1 %) (edits-1 word))))))
+
+(defn known
+  [words]
+  (set (filter (partial contains? n-words) words)))
+
+(defn correct
+  [word]
+  (let [candidate-thunks [#(known (list word))
+                          #(known (edits-1 word))
+                          #(known-edits-2 word)
+                          #(list word)]]
+    (->> candidate-thunks
+         (map (fn [f] (f)))
+         (filter #(> (count %) 0))
+         first
+         (map (fn [w] [(get n-words w 1) w]))
+         (reduce (partial max-key first))
+         second)))

+
+
+
+
+
+
+
+
+
+


remove unused env key

remove unused env key


Remove unused require from clojure-http-kit

--- clojure-http-kit/src/sse_server/core.clj
+++ clojure-http-kit/src/sse_server/core.clj
@@ -1,7 +1,6 @@
 (ns sse-server.core
   (:require [org.httpkit.server :refer [run-server with-channel on-close send! close]]
-            [org.httpkit.timer :refer [schedule-task]]
-            [clojure.pprint :refer [pprint]]))
+            [org.httpkit.timer :refer [schedule-task]]))

 (def channel-hub (atom {}))


delaney3d.clj: fixed the spelling of a function

--- clojure/org/gavrog/clojure/delaney3d.clj
+++ clojure/org/gavrog/clojure/delaney3d.clj
@@ -111,7 +111,7 @@

 (def checks [check-axes check-cover check-simplified])

-(defn check-euclicidity [ds]
+(defn check-euclidicity [ds]
   (loop [data {:symbol ds}, to-do checks]
     (if (seq to-do)
       (let [data ((first to-do) data)]


fix typo that was causing the cached connection to be closed

--- src/asphalt/type.clj
+++ src/asphalt/type.clj
@@ -37,7 +37,7 @@
   (create-connection      [this] (create-connection connection-source))
   (obtain-connection      [this] connection)
   (return-connection [this conn] (when-not (identical? conn connection) ; do not close current connection
-                                   (return-connection connection-source connection))))
+                                   (return-connection connection-source conn))))

 (def ^:const sql-nil        0)


disambiguate minus arity file names

disambiguate minus arity file names

--- src/atom_finder/questions/all_nodes.clj
+++ src/atom_finder/questions/all_nodes.clj
@@ -16,7 +16,7 @@
 ;; List all node counts file-by-file
 (defn count-all-nodes-in-project
   [edn-file]
-  (prn (now))
+  (println (str (now)))
   (->> atom-finder-corpus-path
        (pmap-dir-c-files
         (fn [file]
@@ -90,8 +90,8 @@

 (defn main-all-nodes
   []
-  (let [edn-file "tmp/all-node-counts_2018-09-05_for-debugging-esem.edn"
-        csv-file "src/analysis/data/all-node-counts_2018-09-05_for-debugging-esem.csv"
+  (let [edn-file "tmp/all-node-counts_2018-10-25_disambiguate-minus-arity.edn"
+        csv-file "src/analysis/data/all-node-counts_2018-10-25_disambiguate-minus-arity.csv"
         ]
     (count-all-nodes-in-project edn-file)
     (summarize-all-nodes edn-file csv-file)


simplified regular first person singular conditional inflection

--- src/babel/espanol/morphology/verbs.cljc
+++ src/babel/espanol/morphology/verbs.cljc
@@ -52,11 +52,7 @@
      (get-in word [:condicional number-and-person])
      (get-in word [:condicional number-and-person])

-     (and (= person :1st) (= number :sing) ar-type)
-     (str stem "ía")
-     (and (= person :1st) (= number :sing) er-type)
-     (str stem "ía")
-     (and (= person :1st) (= number :sing) ir-type)
+     (and (= person :1st) (= number :sing))
      (str stem "ía")

      (and (= person :2nd) (= number :sing) ar-type)


Improve image loss / regain error message.

--- src/onyx/messaging/aeron/subscriber.clj
+++ src/onyx/messaging/aeron/subscriber.clj
@@ -74,8 +74,7 @@

 (defn check-correlation-id-alignment [aligned ^io.aeron.logbuffer.Header header]
   (when-not (get aligned (.correlationId ^Image (.context header)))
-    (throw (ex-info "Lost and regained image with the same session-id and different correlation-id."
-                    {:correlation-id (.correlationId ^Image (.context header))}))))
+    (throw (ex-info "Messenger subscription image was lost, and rejoined. This is generally due to timeout conditions e.g. garbage collection, or other causes of connection flapping. Rebooting peer." {:correlation-id (.correlationId ^Image (.context header))}))))

 (deftype Subscriber
   [peer-id
@@ -108,8 +107,8 @@
     (let [media-driver-dir (:onyx.messaging.aeron/media-driver-dir peer-config)
           sinfo [dst-task-id slot-id site]
           aligned {}
-          ctx (cond-> (.errorHandler (Aeron$Context.)
-                                     (new-error-handler error error-counter))
+          ctx (cond-> (Aeron$Context.)
+                true (.errorHandler (new-error-handler error error-counter))
                 media-driver-dir (.aeronDirectoryName ^String media-driver-dir))
           conn (Aeron/connect ctx)
           channel (autil/channel peer-config)


Use new interpretation of arena as a vector of rows

Arenas with an aspect ratio other than 1:1 would have provoked an
exception drawing borders.

--- src/clj/battlebots/arena/generation.clj
+++ src/clj/battlebots/arena/generation.clj
@@ -50,18 +50,18 @@

 (defn- border
   "places block walls contiguously along the border of the arena"
-  ;; arenas are vectors (seqs?) of columns -not vectors of rows
-  ;; columns are not consistently vectors -they can be seqs
+  ;; arenas are vectors (seqs?) of rows -not vectors of columbs
+  ;; rows are not consistently vectors -they can be seqs
   [{:keys [dimx dimy border]} arena]
   (if border
     (let [block (:block arena-key)
-          vwall (repeat dimy block)
-          xform (map-indexed (fn [x column]
-                               (if (#{0 (dec dimx)} x)
-                                 vwall
-                                 (-> (vec column)
+          hwall (repeat dimx block)
+          xform (map-indexed (fn [y row]
+                               (if (#{0 (dec dimy)} y)
+                                 hwall
+                                 (-> (vec row)
                                      (assoc-in [0] block)
-                                     (assoc-in [(dec dimy)] block)))))]
+                                     (assoc-in [(dec dimx)] block)))))]
       (vec (sequence xform arena)))
     arena))


Added 'cleanup' mutator card.

Added 'cleanup' mutator card.

--- src/clj/funstructor/cards_functions.clj
+++ src/clj/funstructor/cards_functions.clj
@@ -334,6 +334,13 @@
       game-map)))

 (defmethod apply-card
+  :cleanup
+  [game player-key card & args]
+  ((apply-to-funstruct game player-key)
+   (fn [funstruct]
+     (remove #(= :gap (:terminal %)) funstruct))))
+
+(defmethod apply-card
   :action-equality-1
   [game-map player-key card & args]
   (let [opp (get-opponent game-map player-key)]


Fixed 'cleanup' mutator card.

Fixed 'cleanup' mutator card.

--- src/clj/funstructor/cards_functions.clj
+++ src/clj/funstructor/cards_functions.clj
@@ -337,9 +337,10 @@
 (defmethod apply-card
   :mutator-cleanup
   [game player-key card & args]
-  ((apply-to-funstruct game player-key)
-   (fn [funstruct]
-     (filterv #(not= :gap (:terminal %)) funstruct))))
+  (let [opponent (get-opponent game-map player-key)]
+    ((apply-to-funstruct game player-key)
+     (fn [funstruct]
+       (filterv #(not= :gap (:terminal %)) funstruct)))))

 (defmethod apply-card
   :action-equality-1


vain atempt to make extend-type work on pixi container

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -153,13 +153,14 @@
     (set-pivot! container (* xhandle width) (* yhandle height))
     container))

-;; (defprotocol Container
-;;   (update-handle [container & handles]))
+(defprotocol Container
+  (update-handle [container xhandle yhandle]))

-;; (extend-type js/PIXI.Container
-;;   Container
-;;   (update-handle
-;;     ([container & handles] (apply update-container-handles container handles))))
+(extend-type js/PIXI.Container
+  Container
+  (update-handle
+    ([container xhandle yhandle]
+     (update-container-handles container :xhandle xhandle :yhandle yhandle))))

 (defn make-container
   [children & {:keys [x y xhandle yhandle scale alpha


cleanup

cleanup

--- src/clojure/zensols/actioncli/parse.clj
+++ src/clojure/zensols/actioncli/parse.clj
@@ -26,10 +26,10 @@
 (defn- create-commands [command-context]
   (->> (:command-defs command-context)
        (map (fn [[key pkg-parent pkg-child command-def]]
-                  (let [req (list 'require `(quote (~pkg-parent ~pkg-child)))]
-                    (eval req)
-                    {key (symbol (format "%s.%s/%s" pkg-parent
-                                         pkg-child command-def))})))
+              (let [req (list 'require `(quote (~pkg-parent ~pkg-child)))]
+                (eval req)
+                {key (symbol (format "%s.%s/%s" pkg-parent
+                                     pkg-child command-def))})))
        (apply merge)
        eval
        (merge (:single-commands command-context))
@@ -63,10 +63,10 @@
   {:style/indent 0}
   [& forms]
   (let [ex (gensym)]
-   `(try
-      ~@forms
-      (catch Exception ~ex
-        (handle-exception ~ex)))))
+    `(try
+       ~@forms
+       (catch Exception ~ex
+         (handle-exception ~ex)))))

 (defn error-msg
   "Print every element of the sequence **errors**.  If there **errors** is a


Added extract access-value for SMAP ISO granule.

--- src/cmr/search/services/transformer.clj
+++ src/cmr/search/services/transformer.clj
@@ -7,7 +7,8 @@
             [cmr.common.mime-types :as mt]
             [cmr.common.services.errors :as errors]
             [cmr.search.services.acl-service :as acl-service]
-            [cmr.common.util :as u]))
+            [cmr.common.util :as u]
+            [cmr.umm.iso-smap.granule :as smap-g]))

 (def native-format
   "This format is used to indicate the metadata is in it's native format."
@@ -86,8 +87,10 @@

 (defmethod extract-access-value "application/iso-smap+xml"
   [concept]
-  ;; SMAP ISO doesn't support restriction flag yet.
-  nil)
+  ;; TODO: Don't have a good way to extract the access-value of SMAP ISO granule.
+  ;; Need to save the access value in concept.
+  (when (= :granule (:concept-type concept))
+    (smap-g/xml->access-value (:metadata concept))))

 (defmulti add-acl-enforcement-fields
   "Adds the fields necessary to enforce ACLs to the concept"


Highlight properly on focus as well as cursor movement

--- src/org/knotation/editor/highlight.cljs
+++ src/org/knotation/editor/highlight.cljs
@@ -45,9 +45,8 @@

 (defn cross<->highlight!
   [line-map-atom editors]
-  (doseq [[ix e] (map-indexed vector (butlast editors))]
-    (.on e "cursorActivity"
-         (fn [_] (when (.hasFocus e) (cross->highlight! @line-map-atom ix editors)))))
-  (let [out (last editors)]
-    (.on out "cursorActivity"
-         (fn [_] (when (.hasFocus out) (cross->highlight! @line-map-atom :out editors))))))
+  (let [setup (fn [ed ix]
+                (.on ed "cursorActivity" (fn [_] (when (.hasFocus ed) (cross->highlight! @line-map-atom ix editors))))
+                (.on ed "focus" (fn [_] (cross->highlight! @line-map-atom ix editors))))]
+    (doseq [[ix e] (map-indexed vector (butlast editors))] (setup e ix))
+    (setup (last editors) :out)))


Add R/restart-system!

Add R/restart-system!

--- etc/repl.clj
+++ etc/repl.clj
@@ -126,6 +126,11 @@
      (f)
      (swap! system-status (fn [s] (assoc s an-ns false))))))

+(defn restart-system!
+  "Restarts the system with an optiona reload"
+  []
+  (when (stop-system!)
+    (start-system!)))

 (defn sys
   "Pull out the system for passing around"


url not added to token stream for tokens

--- src/help_me_im_dumb/index.clj
+++ src/help_me_im_dumb/index.clj
@@ -14,8 +14,8 @@
         comments (doc "comments")
         comment-string (concat (map #(get % "text") comments))]
     (->
-     (apply str body url comment-string)
      (clojure.string/replace #"[,!'.%?]" "")
+     (apply str body comment-string)
      (clojure.string/split #"\s+"))))

 (defn token-seq-from-file


extracting map-key

extracting map-key

--- src/aws/provider.clj
+++ src/aws/provider.clj
@@ -22,7 +22,7 @@
     [flatland.useful.utils :refer (defm)]
     [flatland.useful.map :refer (dissoc-in*)]
     [slingshot.slingshot :refer  [throw+ try+]]
-    [celestial.provider :refer (wait-for wait-for-ssh)]
+    [celestial.provider :refer (wait-for wait-for-ssh map-key)]
     [celestial.core :refer (Vm)]
     [taoensso.timbre :as timbre]
     [celestial.persistency.systems :as s]
@@ -116,9 +116,6 @@

 (def defaults {:aws {:min-count 1 :max-count 1}})

-(defn map-key [m from to]
-  (dissoc-in* (assoc-in m to (get-in m from)) from))
-
 (defn find-groups
    [endpoint names vpc-id]
    (map :group-id


create set of alternatives for subjects, tenses, and verb preds

--- src/babel/latin.cljc
+++ src/babel/latin.cljc
@@ -20,13 +20,6 @@

 (def lexicon (edn2lexicon "src/babel/latin/lexicon.edn"))

-(defn generate [spec]
-  (first (shuffle
-          (filter #(not (fail? %))
-                  (map (fn [val]
-                         (unifyc spec val))
-                       (flatten (vals lexicon)))))))
-
 (defn parse [surface]
   [{:parses (morph/analyze surface lexicon)}])

@@ -37,4 +30,35 @@
             :fo fo
             :generate-fn generate})

+(def tenses
+  [{:tense :present}
+   {:tense :past
+    :aspect :progressive}
+   {:tense :future}])

+(def subjects [:I :tu :lui :lei :noi :voi :loro])
+
+(def preds
+  (vec
+   (set
+    (map #(get-in % [:synsem :sem :pred])
+         (filter #(= :verb (get-in % [:synsem :cat]))
+                 (flatten (vals lexicon)))))))
+
+(defn generate [spec]
+  (first (shuffle
+          (filter #(not (fail? %))
+                  (map (fn [val]
+                         (unifyc spec val))
+                       (flatten (vals lexicon)))))))
+(defn get-spec []
+  (unifyc
+   {:synsem {:sem (first (shuffle tenses))}}
+   {:synsem {:sem {:subj {:pred (first (shuffle subjects))}}}}
+   {:synsem {:sem {:pred (first (shuffle preds))}}}))
+
+
+
+
+
+


Adding new-line charated at the EOF

Adding new-line charated at the EOF

--- test/vignette/util/services_test.clj
+++ test/vignette/util/services_test.clj
@@ -6,4 +6,4 @@
 (facts :static-assets :url
        (svc/materialize-static-asset-url "uuid_sample") => "http://hostname:9999/image/uuid_sample"
        (provided
-         (consul/find-service consul/create-consul "static-assets" consul/service-query-tag) => {:address "hostname", :port 9999}))+         (consul/find-service consul/create-consul "static-assets" consul/service-query-tag) => {:address "hostname", :port 9999}))


Add dom add-class! and remove-class! shortcuts.

--- src/cljs/c2/dom.cljs
+++ src/cljs/c2/dom.cljs
@@ -105,6 +105,10 @@
   [el class classed?]
   (gclasses/enable (select el) class classed?))

+;;TODO: make these kind of shortcuts macros for better performance.
+(defn add-class! [el class] (classed! el class true))
+(defn remove-class! [el class] (classed! el class false))
+
 (def request-animation-frame
   (or (.-requestAnimationFrame js/window)
       (.-webkitRequestAnimationFrame js/window)


Restore :genome instructions when :autoconstructive-genome-instructions is :all

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -501,8 +501,8 @@
     (doseq [instr (case (:autoconstructive-genome-instructions @push-argmap)
                     :all (registered-for-stacks
                            (if (:autoconstructive-environments @push-argmap)
-                             [:integer :boolean :exec :float :tag :environment]
-                             [:integer :boolean :exec :float :tag]))
+                             [:integer :boolean :exec :genome :float :tag :environment]
+                             [:integer :boolean :exec :genome :float :tag]))
                     :gene-oriented (into (registered-for-stacks
                                            (if (:autoconstructive-environments @push-argmap)
                                              [:integer :boolean :exec :float :tag :environment]


fixed issue #22 - transformations on set selectors not working

--- src/kioo/core.clj
+++ src/kioo/core.clj
@@ -65,10 +65,16 @@
    #(conj %1
           (cond
            (list? %2) (apply (resolve-enlive-var (first %2)) (rest %2))
-           (vector? %2) (eval-selector %2)
+           (or (vector? %2)
+               (map? %2)
+               (set? %2)) (eval-selector %2)
            (symbol? %2) (resolve-enlive-var %2)
             :else %2))
-   [] sel))
+   (cond
+    (vector? sel) []
+    (set? sel) #{}
+    (map? sel) {}
+    :else []) sel))

 (defn map-trans [node trans-lst]
   (reduce (fn [node [sel trans]]


Added docstrings to the lambda-blog.generator namespace.

--- src/lambda_blog/generator.clj
+++ src/lambda_blog/generator.clj
@@ -1,4 +1,5 @@
 (ns lambda-blog.generator
+  "Filesystem utilities used in the generation pipeline."
   (:refer-clojure :exclude [update])
   (:require [clojure.java.io :refer [make-parents]]
             [lambda-blog.utils :refer [pathcat]]
@@ -6,24 +7,32 @@
             [s-html.print :refer [html->str]]
             [taoensso.timbre :as log]))

-(defn copy-dir! [{:keys [output-dir] :as ent} what where]
+(defn copy-dir!
+  "Copies `what` to `where` inside of the configured `output-dir`. Returns unmodified `ent`ity, but interacts with the filesystem."
+  [{:keys [output-dir] :as ent} what where]
   (let [to (pathcat output-dir where)]
     (log/info "Copying" what "to" to)
     (fs/copy-dir what to)
     ent))

-(defn clean-dir! [{:keys [output-dir] :as ent}]
+(defn clean-dir!
+  "Cleans the configured `output-dir`. Returns unmoified `ent`ity, but interacts with the filesystem."
+  [{:keys [output-dir] :as ent}]
   (let [d (pathcat output-dir)]
     (log/info "Cleaning" d)
     (fs/delete-dir d)
     ent))

-(defn update [entity key & funs]
+(defn update
+  "Returns `entity` with value under `key` modified by succesively applying `funs`."
+  [entity key & funs]
   (assoc entity
          key ((reduce comp (reverse funs))
               (entity key))))

-(defn update-all [entity key & funs]
+(defn update-all
+  "Returns `entity` with sequence under `key` modified by succesively applying `funs` to each of the elements."
+  [entity key & funs]
   (let [vs (entity key)]
     (assoc entity
            key
@@ -31,8 +40,10 @@
                  (map (reduce comp (reverse funs))
                       vs)))))

-(defn whenever [entity predicate & funs]
-  (if (predicate entity)
+(defn whenever
+  "Returns `entity` modified by succesively applying `funs` if `(predicate? entity)` is true."
+  [entity predicate? & funs]
+  (if (predicate? entity)
     ((reduce comp (reverse funs))
      entity)
     entity))
@@ -48,19 +59,25 @@
          html->str
          (spit-file f))))

-(defn generate! [env what template & args]
-  (do-generate! template (merge env (env what)) args)
-  env)
+(defn generate!
+  "Transforms a part of an `entity` under `key` into an HTML page using `template` with extra `args`. Returns unmodified `entity`, but interacts with the filesystem."
+  [entity key template & args]
+  (do-generate! template (merge entity (entity key)) args)
+  entity)

-(defn generate-all! [env what template & args]
-  (doseq [ent (env what)]
-    (do-generate! template (merge env ent) args))
-  env)
+(defn generate-all!
+  "Transforms a sequence of values of an `entity` under `key` into HTML pages using `template` with extra `args`. Returns `entity` unmodified, but interacts with the filesystem."
+  [entity key template & args]
+  (doseq [ent (entity key)]
+    (do-generate! template (merge entity ent) args))
+  entity)

-(defn read-dir [env key path parser]
+(defn read-dir
+  "Reads a directory under `path` and parses each file using `parser`. Returns `entity` with parsed file contents sequence stored under `key`."
+  [entity key path parser]
   (->> path
        fs/list-dir
        (map (fn [file]
               (log/info "Reading " file)
               (parser (slurp file))))
-       (assoc env key)))
+       (assoc entity key)))


Moved project.clj adapter options to sub-map

--- src/leiningen/ring/server.clj
+++ src/leiningen/ring/server.clj
@@ -11,8 +11,15 @@
              (symbol ns)
              s))))

+(defn project-options
+  "A map of Ring options from the project.clj file."
+  [project]
+  (let [opts (:ring project)]
+    (merge (select-keys opts [:init :destroy :handler])
+           (:adapter opts))))
+
 (defn env-options
-  "A map of options from environment variables"
+  "A map of options from environment variables."
   []
   (merge (if-let [p (System/getenv "PORT")] {:port p})
          (if-let [p (System/getenv "SSLPORT")] {:ssl-port p})))
@@ -20,7 +27,7 @@
 (defn server-task
   "Shared logic for server and server-headless tasks."
   [project options]
-  (let [options (merge (:ring project)
+  (let [options (merge (project-options project)
                        (env-options)
                        options)]
     (eval-in-project


CMR-1357:Addressed review comments.

CMR-1357:Addressed review comments.

--- umm-lib/test/cmr/umm/test/validation/granule.clj
+++ umm-lib/test/cmr/umm/test/validation/granule.clj
@@ -160,14 +160,14 @@
   (make-granule {:temporal (g/map->GranuleTemporal {:range-date-time (helpers/range-date-time a b)})}))

 (deftest granule-temporal-coverage
-  (let [fn-coll (fn [coll-start coll-end ends-at-present-flag]
-                  (helpers/coll-with-range-date-times
-                    [(helpers/range-date-time coll-start coll-end)] ends-at-present-flag))
+  (let [make-coll (fn [coll-start coll-end ends-at-present-flag]
+                    (helpers/coll-with-range-date-times
+                      [(helpers/range-date-time coll-start coll-end)] ends-at-present-flag))
         assert-valid #(assert-valid-gran %1 %2)
         assert-invalid #(assert-invalid-gran %1 %2 [:temporal] [%3])
-        coll (fn-coll "2015-01-01T00:00:00Z" "2015-01-02T00:00:00Z" nil)
-        coll-ends-at-present (fn-coll "2015-01-01T00:00:00Z" "2015-01-02T00:00:00Z" true)
-        coll-no-end-date (fn-coll "2015-01-01T00:00:00Z" nil false)]
+        coll (make-coll "2015-01-01T00:00:00Z" "2015-01-02T00:00:00Z" nil)
+        coll-ends-at-present (make-coll "2015-01-01T00:00:00Z" "2015-01-02T00:00:00Z" true)
+        coll-no-end-date (make-coll "2015-01-01T00:00:00Z" nil false)]

     (testing "Granule with no temporal coverage values is valid"
       (assert-valid coll (make-granule {})))


print url to log

print url to log

--- src/holston/core.clj
+++ src/holston/core.clj
@@ -10,6 +10,7 @@
               "postgresql://localhost:5432/holston"))

 (defn show-landing-page [req]
+  (println ("DB url:" db))
   (str "Holston is ready for e-business " (:?column? (first (sql/query db-url
            ["select 'with a DB!'"])))))


use api

use api

--- src/frontend/cljs/alibi/entry_page.cljs
+++ src/frontend/cljs/alibi/entry_page.cljs
@@ -61,13 +61,13 @@

 (defn render-day-entry-table!
   [for-state]
-  (let [new-date (get-in for-state [:form :selected-date :date])]
+  (let [new-date (state/selected-date for-state)]
     (day-entry-table/render "day-entry-table" new-date)))

 (add-watch
   state :renderer
   (fn [_ _ _ new-state]
-    ;(log "new-state %o" new-state)
+    (log "new-state %o" new-state)
     (render-day-entry-table! new-state)))

 (reset! state @state)


Use all the boards to compose the drafts response, make sure the board-access is returned with every draft entry.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -12,6 +12,7 @@
             [oc.lib.api.common :as api-common]
             [oc.storage.config :as config]
             [oc.storage.api.access :as access]
+            [oc.storage.api.activity :as activity-api]
             [oc.storage.api.entries :as entries-api]
             [oc.storage.async.notification :as notification]
             [oc.storage.representations.media-types :as mt]
@@ -342,9 +343,12 @@
                                            (board-res/drafts-board org-uuid (:user ctx))
                                            ;; Regular board by slug
                                            (board-res/get-board conn org-uuid slug)))
-                               boards (board-res/list-boards-by-org conn org-uuid)
+                               ;; For drafts board we need to return all the boards or users will be
+                               ;; cut out of their own drafts
+                               boards (board-res/list-boards-by-org conn org-uuid activity-api/board-props)
                                boards-map (zipmap (map :uuid boards) boards)]
-                        {:existing-org (api-common/rep org) :existing-board (api-common/rep board)
+                        {:existing-org (api-common/rep org)
+                         :existing-board (api-common/rep board)
                          :existing-org-boards (api-common/rep boards-map)}
                         false))


move #'download-file to bottom of ns

move #'download-file to bottom of ns

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -190,35 +190,6 @@
                 out (StringWriter.)]
       (copy in out)
       (.toString out))))
-
-(defn download-file
-  "Downloads the file pointed to by url to local path. If no timeout
-  is specified will use blocking io to transfer data. If timeout is specified,
-  transfer will block for at most timeout ms before throwing a
-  java.net.SocketTimeoutException if data transfer has stalled.
-
-  It's also possible to specify n-retries to determine how many attempts to
-  make to download the file and also the wait-t between attempts in ms (defaults
-  to 5000 ms)"
-  ([url path]                          (download-file-without-timeout url path))
-  ([url path timeout]                  (download-file-with-timeout url path timeout))
-  ([url path timeout n-retries]        (download-file url path timeout n-retries 5000))
-  ([url path timeout n-retries wait-t] (download-file url path timeout n-retries wait-t 0))
-  ([url path timeout n-retries wait-t attempts-made]
-     (when (>= attempts-made n-retries)
-       (throw (Exception. (str "Aborting! Download failed after "
-                               n-retries
-                               " attempts. URL attempted to download: "
-                               url ))))
-
-     (let [path (resolve-tilde-path path)]
-       (try
-         (download-file-with-timeout url path timeout)
-         (catch java.io.IOException e
-           (rm-rf! path)
-           (Thread/sleep wait-t)
-           (download-file url path timeout n-retries wait-t (inc attempts-made)))))))
-

 (defn file-size
   "Returns the size of the file pointed to by path in bytes"
@@ -312,3 +283,31 @@
           (if (.mkdir tmp-dir)
             tmp-dir
             (recur (inc num-attempts))))))))
+
+(defn download-file
+  "Downloads the file pointed to by url to local path. If no timeout
+  is specified will use blocking io to transfer data. If timeout is specified,
+  transfer will block for at most timeout ms before throwing a
+  java.net.SocketTimeoutException if data transfer has stalled.
+
+  It's also possible to specify n-retries to determine how many attempts to
+  make to download the file and also the wait-t between attempts in ms (defaults
+  to 5000 ms)"
+  ([url path]                          (download-file-without-timeout url path))
+  ([url path timeout]                  (download-file-with-timeout url path timeout))
+  ([url path timeout n-retries]        (download-file url path timeout n-retries 5000))
+  ([url path timeout n-retries wait-t] (download-file url path timeout n-retries wait-t 0))
+  ([url path timeout n-retries wait-t attempts-made]
+     (when (>= attempts-made n-retries)
+       (throw (Exception. (str "Aborting! Download failed after "
+                               n-retries
+                               " attempts. URL attempted to download: "
+                               url ))))
+
+     (let [path (resolve-tilde-path path)]
+       (try
+         (download-file-with-timeout url path timeout)
+         (catch java.io.IOException e
+           (rm-rf! path)
+           (Thread/sleep wait-t)
+           (download-file url path timeout n-retries wait-t (inc attempts-made)))))))


Newlines are your friends

Newlines are your friends

--- test/desdemona/jobs/sample_job_test.clj
+++ test/desdemona/jobs/sample_job_test.clj
@@ -20,12 +20,16 @@
                            [:determine-origin :build-row]
                            [:build-row :prepare-rows]
                            [:prepare-rows :write-lines]]
-        expected-lifecycles [{:lifecycle/task :write-lines :lifecycle/calls :desdemona.lifecycles.logging/log-calls}
-                             {:lifecycle/task :read-lines :lifecycle/calls :desdemona.lifecycles.logging/log-calls}
-                             {:lifecycle/task :write-lines :lifecycle/calls :onyx.plugin.sql/write-rows-calls}
-                             {:lifecycle/task :read-lines :lifecycle/calls :onyx.plugin.kafka/read-messages-calls}]]
     (is (= (map :onyx/name catalog) expected-catalog-names))
     (is (= ((find-task catalog :read-lines) :kafka/topic) "test1"))
+        expected-lifecycles [{:lifecycle/task :write-lines
+                              :lifecycle/calls :desdemona.lifecycles.logging/log-calls}
+                             {:lifecycle/task :read-lines
+                              :lifecycle/calls :desdemona.lifecycles.logging/log-calls}
+                             {:lifecycle/task :write-lines
+                              :lifecycle/calls :onyx.plugin.sql/write-rows-calls}
+                             {:lifecycle/task :read-lines
+                              :lifecycle/calls :onyx.plugin.kafka/read-messages-calls}]]
     (is (thrown? Exception ((find-task catalog :doesnt-exist) :kafka/topic)))
     (is (= ((find-task catalog :write-lines) :sql/table) :logLines))
     (is (= workflow expected-workflow))


Clean up

Clean up

--- test/onyx/coordinator/simulant_test.clj
+++ test/onyx/coordinator/simulant_test.clj
@@ -184,16 +184,22 @@
   (testing "All peers got a roughly even number of tasks assigned"
     (su/peer-fairness result-db n-peers n-jobs tasks-per-job)))

-
-(let [query '[:find ?inst :where
-              [_ :peer/status _ ?tx]
-              [?tx :db/txInstant ?inst]]
-      txs (sort (map first (d/q query (d/history result-db))))]
-
-  (prn (map (fn [tx]
-              (let [db (d/as-of result-db tx)]
-                [(map first (d/q '[:find (count ?p) :where [?p :peer/status]] db)) tx]))
-            txs)))
+(def insts
+  (->> (-> '[:find ?inst :where
+             [_ :peer/status _ ?tx]
+             [?tx :db/txInstant ?inst]]
+           (d/q (d/history result-db)))
+       (map first)
+       (sort)))
+
+
+(def dt-and-peers
+  (map (fn [tx]
+         (let [db (d/as-of result-db tx)]
+           (->> (d/q '[:find (count ?p) :where [?p :peer/status]] db)
+                (map first)
+                (concat [tx]))))
+       insts))

 (alter-var-root #'system component/stop)


minor debugging code change

minor debugging code change

--- flatguicore/src/flatgui/widgets/componentbase.clj
+++ flatguicore/src/flatgui/widgets/componentbase.clj
@@ -328,12 +328,13 @@
                has-changes (or prev-has-changes new-has-changes)
                with-evolved-target (assoc with-evolved-target-fresh :has-changes has-changes)
                new-aux (:aux-container with-evolved-target)
-;               _ (if (= [:main :tiket :ticket-panel :aggr-slider :base] target-id-path)
-;                   (println " JUST EVOLVED target-id-path " target-id-path
-;                     " new-has-changes " new-has-changes
-;                     " init " initialization
-;                     " props " (:clip-size (get-in new-aux (fgc/conjv k :latest-changed-properties)))
-;                     ))
+               ;_ (if (= [:main :app-panel :hello] target-id-path)
+               ;    (println " JUST EVOLVED target-id-path " target-id-path
+               ;      " new-has-changes " new-has-changes
+               ;      " init " initialization
+               ;      " props " (:position-matrix (get-in new-aux (fgc/conjv k :latest-changed-properties)))
+               ;      " val " (get-in container (fgc/conjv k :position-matrix))
+               ;      ))
                ]
               ;@todo Without this initialization check :children for table content pane do not get evolved on initialization. Why?
               (if (or new-has-changes (and initialization has-changes))


add tests for getAllSuperclasses

add tests for getAllSuperclasses

--- test/app/test/core.clj
+++ test/app/test/core.clj
@@ -6,6 +6,8 @@
   (:use [app.javaparser.navigation])
   (:use [clojure.test])
   (:use [conjure.core])
+  (:use [app.symbol_solver.funcs])
+  (:use [app.symbol_solver.type_solver])
   (:require [instaparse.core :as insta]))

 (load "helper")
@@ -157,6 +159,22 @@
                           type-solver-classes))]
     (is (hierarchy-overrides-toString? type-solver-classes cl))))

+(deftest test-getAllSuperclasses-depth-0
+  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
+        cl (first (filter #(= (.getName %) "ParentClassThatOverridesToString") type-solver-classes))]
+    (binding [typeSolver (typeSolverOnList type-solver-classes)]
+      (let [superclasses (getAllSuperclasses cl)]
+        (is (= 0 (count superclasses)))))))
+
+
+(deftest test-getAllSuperclasses-depth-1
+  (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
+        cl (first (filter #(= (.getName %) "ClassWhoseParentOverridesToString") type-solver-classes))]
+    (binding [typeSolver (typeSolverOnList type-solver-classes)]
+      (let [superclasses (getAllSuperclasses cl)]
+        (is (= 1 (count superclasses)))))))
+
+
 (deftest testClassWhoseParentsOverrideToString
   (let [type-solver-classes (flatten (map allTypes sampleClassesItem10Test))
         cl (first (filter #(= (.getName %) "ClassWhoseParentOverridesToString")


make prep function return original text if not processed

--- src/parinfer/format/prep.cljc
+++ src/parinfer/format/prep.cljc
@@ -144,5 +144,6 @@
   "Format the given text by repositioning any trailing closing delimiters based on indentation."
   ([text] (format-text initial-state text))
   ([state text]
-   (when-let [state (process-text state text)]
-     (join "\n" (:lines state)))))
+   (if-let [state (process-text state text)]
+     (join "\n" (:lines state))
+     text)))


adds migration to convert ids to refs

adds migration to convert ids to refs

--- src/pc/datomic/migrations.clj
+++ src/pc/datomic/migrations.clj
@@ -54,6 +54,53 @@
                       :cust/name "prcrsr"
                       :cust/uuid (d/squuid)}]))

+(defn doc-id-datom->ref-transaction [db {:keys [e v] :as datom}]
+  (let [ent (d/entity db e)]
+    (cond (:db/txInstant ent) [:db/add e :transaction/document v]
+          (:layer/type ent) [:db/add e :layer/document v]
+          (:chat/body ent)  [:db/add e :chat/document v]
+          (:layer/name ent) [:db/add e :layer/document v]
+          (= :layer (:entity/type ent)) [:db/add e :layer/document v]
+          (:layer/end-x ent) [:db/add e :layer/document v]
+          ;; TODO: need to clean up the db to get rid of invalid layers and do some sort of
+          ;;       validation when new fields come through the wire
+          (= #{:frontend/id :document/id} (set (keys ent))) [:db.fn/retractEntity e]
+          :else (throw+ {:error :unknown-document-id-type :e e}))))
+
+(defn have-document-ref? [db {:keys [e] :as datom}]
+  (let [ent (d/entity db e)]
+    (or (:layer/document ent)
+        (:chat/document ent)
+        (:transaction/document ent))))
+
+(defn document-ids->document-refs [db conn]
+  (log/infof "converting document-ids to document-refs")
+  (doseq [datom-group (partition-all 1000 (filter (partial have-document-ref? db) (d/datoms db :avet :document/id)))]
+    @(d/transact-async conn (mapv #(doc-id-datom->ref-transaction db %) datom-group))))
+
+(defn have-ref-attr? [db ref-attr {:keys [e] :as datom}]
+  (let [ent (d/entity db e)]
+    (get ent ref-attr)))
+
+(defn access-entities-ids->refs [db conn]
+  (doseq [attr [:permission/document :permission/cust :permission/granter
+                :access-request/document :access-request/cust
+                :access-grant/document :access-grant/granter]
+          :let [ref-attr (keyword (namespace attr) (str (name attr) "-ref"))]]
+    (log/infof "converting %s to %s" attr ref-attr)
+    (doseq [datom-group (partition-all 1000 (filter (partial have-ref-attr? db ref-attr) (d/datoms db :aevt attr)))]
+      @(d/transact-async conn (mapv (fn [{:keys [e v] :as datom}]
+                                      [:db/add e ref-attr v])
+                                    datom-group)))))
+
+
+(defn longs->refs
+  "Converts attributes that store ids to refs, e.g. layers go from :document/id to :layer/document"
+  [conn]
+  (let [db (d/db conn)]
+    ;(document-ids->document-refs db conn)
+    (access-entities-ids->refs db conn)))
+
 (def migrations
   "Array-map of migrations, the migration version is the key in the map.
    Use an array-map to make it easier to resolve merge conflicts."


now it stops too

now it stops too

--- src/sormilla/video.clj
+++ src/sormilla/video.clj
@@ -94,7 +94,7 @@
   (future
     (try
       (while (run?)
-        (let [socket      (open-socket)
+        (let [socket      (open-socket)
               out         (agent (io/output-stream (io/file (str "sormilla-" (.format (java.text.SimpleDateFormat. "yyyyMMdd-HHmmss") (java.util.Date.)) ".h264"))))
               reader      (make-reader (.getInputStream socket))
               decoder     (make-decoder)]
@@ -102,9 +102,10 @@
             (doto (.getOutputStream socket)
               (.write (byte-array (map bin/ubyte [1 0 0 0])))
               (.flush))
-            (while-let [data (reader)]
-              (send-off out save data)
-              (reset! image (decoder (second data))))
+            (while (run?)
+              (let [data (reader)]
+                (send-off out save data)
+                (reset! image (decoder (second data)))))
             (catch java.io.IOException e
               (println "I/O error:" e ": reconnecting...")
               (Thread/sleep 1000))


(maint) Better indexing for package_inventory related queries

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -1241,6 +1241,12 @@
    "create index package_name_version_idx on package_inventory using btree (name, version)"

    "create index package_certname_idx on package_inventory using btree (certname_id)"))
+
+(defn add-better-package-inventory-indexing []
+  (jdbc/do-commands
+   "create index package_name_provider_version_idx on package_inventory using btree (name, provider, version)"
+   ["create index certnames_inactive_idx on certnames using btree (certname)"
+    "  where deactivated is not null or expired is not null"]))

 (def migrations
   "The available migrations, as a map from migration version to migration function."
@@ -1276,7 +1282,8 @@
    54 drop-resource-events-resource-type-idx
    55 index-certnames-unique-latest-report-id
    56 merge-fact-values-into-facts
-   57 add-package-inventory})
+   57 add-package-inventory
+   58 add-better-package-inventory-indexing})

 (def desired-schema-version (apply max (keys migrations)))

@@ -1408,7 +1415,12 @@
     (log/info (trs "Creating additional index `facts_value_string_trgm`"))
     (jdbc/do-commands
      ["create index facts_value_string_trgm on facts"
-      "  using gin (value_string gin_trgm_ops)"])))
+      "  using gin (value_string gin_trgm_ops)"]))
+  (when-not (sutils/index-exists? "package_name_trgm")
+    (log/info (trs "Creating additional index `package_name_trgm`"))
+    (jdbc/do-commands
+     ["create index package_name_trgm on package_inventory"
+      "  using gin (name gin_trgm_ops)"])))

 (defn indexes!
   "Create missing indexes for applicable database platforms."


Start work on game loop

Start work on game loop

--- src/tictactoe/core.clj
+++ src/tictactoe/core.clj
@@ -82,16 +82,27 @@
               #(best-case (opponent player) %1 (game-board board move player) (not is-current-player) (+ 1 depth))
               (valid-moves (game-board board move player)))))))

-(defn- value-of-move
-  [board player]
-  #(cond
-    (winning-board? (game-board board %1 player) player) 10
-    :else 0))
-
 (defn cpu-move
   [board current-player]
   (apply max-key
     #(best-case current-player %1 board true 0)
     (valid-moves board)))

-(defn -main "Play the Game" [] (game-board))
+; step ->
+;   render()
+;   if game.finished? ->
+;     die()
+;   else ->
+;     ask()
+;     play_cpu()
+;     step()
+
+(defn player-move
+  []
+  (read-line))
+
+(defn step
+  [board]
+  (game-board board (player-move) (cpu-move (game-board board (player-move) "0") "X")) "X")
+;
+; (defn -main "Play the Game" [] (game-board))


Fix lint error

Fix lint error

--- src/toucan/hydrate.clj
+++ src/toucan/hydrate.clj
@@ -282,7 +282,8 @@
 ;;; ==================================================================================================================

 (defn flush-hydration-key-caches!
-  "Clear out the cached hydration keys. Useful when doing interactive development and defining new hydration functions."
+  "Clear out the cached hydration keys. Useful when doing interactive development and defining new hydration
+  functions."
   []
   (reset! automagic-batched-hydration-key->model* nil)
   (reset! hydration-key->batched-f*               nil)


Remove classpath scanning in automagic batched hydration

This code is pretty slow with large classpaths, taking over 10 seconds
in Metabase. This code is also broken on JDK 9 due to the classloader
changes, `classpath/classpath` will always return the empty
list. With this removed, all of the Metabase tests still pass and we
can save that 10 second load time the first time hydration is called.

--- src/toucan/hydrate.clj
+++ src/toucan/hydrate.clj
@@ -167,9 +167,6 @@

   This is built pulling the `hydration-keys` set from all of our entities."
   []
-  (doseq [ns-symb (ns-find/find-namespaces (classpath/classpath))
-          :when   (s/starts-with? (name ns-symb) (str (models/root-namespace) \.))]
-    (require ns-symb))
   (into {} (for [ns       (all-ns)
                  [_ varr] (ns-publics ns)
                  :let     [model (var-get varr)]


Use oc.lib.component.keep-alive/KeepAlive to avoid the application from quitting after startup, minor code smell.

--- src/oc/email/app.clj
+++ src/oc/email/app.clj
@@ -1,8 +1,9 @@
 (ns oc.email.app
   (:gen-class)
   (:require [com.stuartsierra.component :as component]
-            [manifold.stream :as stream]
             [taoensso.timbre :as timbre]
+            [clojure.java.io :as jio]
+            [oc.lib.component.keep-alive :refer (map->KeepAlive)]
             [oc.lib.sentry.core :as sentry-lib :refer (map->SentryCapturer)]
             [oc.email.config :as c]
             [oc.lib.sqs :as sqs]
@@ -40,7 +41,10 @@
       :sentry-capturer (map->SentryCapturer sentry)
       :sqs (component/using
             (sqs/sqs-listener sqs-creds sqs-queue sqs-msg-handler)
-            [:sentry-capturer]))))
+            [:sentry-capturer])
+      :run-blocker (component/using
+                    (map->KeepAlive nil)
+                    [:sentry-capturer]))))

 (defn echo-config []
   (println (str "\n"
@@ -51,7 +55,7 @@
     "Email from: " c/email-from-domain "\n"
     "Email digest-prefix: " c/email-digest-prefix "\n"
     "Email images prefix: " c/email-images-prefix "\n"
-    "FileStack: " (or c/filestack-api-key "false") "\n"
+    "Filestack API Key: " (or c/filestack-api-key "false") "\n"
     "Log level: " c/log-level "\n"
     "Sentry: " c/sentry-config "\n"
     "\n"
@@ -64,7 +68,7 @@

   ;; Echo config information
   (println (str "\n"
-    (when c/intro? (str (slurp (clojure.java.io/resource "oc/assets/ascii_art.txt")) "\n"))
+    (when c/intro? (str (slurp (jio/resource "oc/assets/ascii_art.txt")) "\n"))
     "OpenCompany Email Service\n"))
   (echo-config)

@@ -73,9 +77,7 @@
                             :sqs-queue c/aws-sqs-email-queue
                             :sqs-msg-handler sqs-handler
                             :sqs-creds {:access-key c/aws-access-key-id
-                                        :secret-key c/aws-secret-access-key}}))
-
-  (deref (stream/take! (stream/stream)))) ; block forever
+                                        :secret-key c/aws-secret-access-key}})))

 (defn -main []
   (start))


agent

agent

--- src/ontrail/keen.clj
+++ src/ontrail/keen.clj
@@ -73,7 +73,7 @@
      c
      (do
        (alter expires assoc id 0)
-       ((alter agents assoc id (count-by-id id)) id)))))
+       ((alter agents assoc id (agent (count-by-id id))) id)))))

 (defn update [state blocking-fn]
   (blocking-fn))


No more println in achan-buf.

No more println in achan-buf.

--- src/cbfg/ago.clj
+++ src/cbfg/ago.clj
@@ -23,10 +23,7 @@
   `(achan-buf ~actx 0))

 (defmacro achan-buf [actx buf-or-size]
-  `(let [ch# (cljs.core.async/chan)]
-     (println "achan-buf"
-              ~actx ~buf-or-size ch#) ; No event since might be outside go block.
-     ch#))
+  `(cljs.core.async/chan) ; No event since might be outside go block.

 (defmacro aclose [actx ch]
   `(do (actx-event ~actx [:beg "aclose" ~actx ~ch])