CMR-3691: Reverse back to hardcoded values when setting the current umm schema version and ingest config version.

--- system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -49,15 +49,6 @@
                        {"provguid1" "PROV1" "provguid2" "PROV2" "usgsguid" "USGS_EROS"})
   (constantly nil)))

-(def current-umm-version
-  "current umm schema version."
-  umm-version/current-version)
-
-(def original-ingest-accept-umm-version
-  "Original ingest-accept-umm-version in ingest config
-   used to reverse back after changing it for certain tests."
-  (ingest-config/ingest-accept-umm-version))
-
 (deftest simple-search-test
   (let [c1-echo (d/ingest "PROV1" (dc/collection {:short-name "S1"
                                                   :version-id "V1"
@@ -101,7 +92,7 @@
 ;; This tests that searching for and retrieving metadata after refreshing the search cache works.
 ;; Other metadata tests all run before refreshing the cache so they cover that case.
 (deftest collection-metadata-cache-test
-  (dev-sys-util/eval-in-dev-sys `(ngest-config/set-ingest-accept-umm-version! current-umm-version))
+  (dev-sys-util/eval-in-dev-sys `(ngest-config/set-ingest-accept-umm-version! "1.10"))
   (let [c1-echo (d/ingest "PROV1" (dc/collection {:entry-title "c1-echo"})
                           {:format :echo10})
         c2-echo (d/ingest "PROV2" (dc/collection {:entry-title "c2-echo"})
@@ -211,10 +202,10 @@
               "DIF" :dif
               "DIF10" :dif10
               "ISO" :iso19115))))))
-  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! original-ingest-accept-umm-version)))
+  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! "1.9")))

 (deftest collection-umm-json-metadata-cache-test
-  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! current-umm-version))
+  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! "1.10"))
   (let [c1-r1-echo (d/ingest "PROV1" (du/umm-spec-collection {:entry-title "c1-echo"})
                              {:format :echo10})
         c1-r2-echo (d/ingest "PROV1" (du/umm-spec-collection {:entry-title "c1-echo"
@@ -254,7 +245,7 @@
       (assert-cache-state {c1-r2-echo [:echo10 latest-umm-format]
                            c2-echo [:echo10 latest-umm-format]
                            c10-umm-json [latest-umm-format]})))
-  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! original-ingest-accept-umm-version)))
+  (dev-sys-util/eval-in-dev-sys `(ingest-config/set-ingest-accept-umm-version! "1.9")))

 ;; Tests that we can ingest and find items in different formats
 (deftest multi-format-search-test


info print format fix

info print format fix

--- boot/worker/src/boot/web.clj
+++ boot/worker/src/boot/web.clj
@@ -30,7 +30,7 @@

 (defn spit-web! [webxmlfile serve create destroy]
   (let [xmlfile  (io/file webxmlfile)]
-    (util/info "Creating web.xml...\n")
+    (util/info "Writing web.xml...\n")
     (spit
       (doto xmlfile io/make-parents)
       (pr-str (web-xml "boot-webapp" "boot-webapp" serve create destroy)))))


Fixed minor fault in deletion

Fixed minor fault in deletion

--- src/ardoq/swagger/swagger.clj
+++ src/ardoq/swagger/swagger.clj
@@ -173,8 +173,9 @@
                                         resources))]
     (doseq [{def-name :name :as component} components]
       (if (= (:type component) "Model")
-        (when-not (first (filter #(= (name %) def-name) (keys (:models resource-listing))))
+        (when-not (first (filter #(= (name %) def-name) (keys (:models resource-listing))))
           (api/delete (api/map->Component component) client)))
+
       (if (= (:type component) "Operation")
         (let [op (flatten (doall (map (fn [{path :path operations :operations}]
                                         (doall (map (fn [operation]
@@ -182,7 +183,10 @@
                                                     operations)))
                                       (:operations resource-listing))))]
           (when-not (first (filter #(= % def-name) op))
-            (api/delete (api/map->Component component) client)))))))
+            (try
+              (api/delete (api/map->Component component) client)
+              (catch clojure.lang.ExceptionInfo e
+                (println "Failed to delete operation. Most likely deleted through resource deletion")))))))))

 (defn delete-resources [client {components :components :as workspace} resources]
   (doseq [{def-name :name :as component} components]
@@ -255,7 +259,7 @@
              :operations operations
              :refs refs}]
     (delete-resources client workspace (:apis resource-listing))
-    (clojure.pprint/pprint (delete-operations-and-models client workspace url (:apis resource-listing)))
+    (delete-operations-and-models client workspace url (:apis resource-listing))
     (common/find-or-create-fields client model)
     (println "Done updating Swagger")
     (str (:_id workspace))))


Remove clojure reflection.

Remove clojure reflection.

--- modules/clojure/src/main/clojure/wunderboss/util.clj
+++ modules/clojure/src/main/clojure/wunderboss/util.clj
@@ -13,7 +13,8 @@
 ;; limitations under the License.

 (ns wunderboss.util
-  (:import org.projectodd.wunderboss.WunderBoss))
+  (:import [org.projectodd.wunderboss
+            DynamicClassLoader WunderBoss]))

 (defonce ^:private exit-tasks (atom []))

@@ -34,8 +35,9 @@
   (require '[dynapath.dynamic-classpath :as dp])
   (eval '(let [base-url-classloader
                (assoc dp/base-readable-addable-classpath
-                 :classpath-urls #(seq (.getURLs %))
-                 :add-classpath-url (fn [cl url]
+                 :classpath-urls (fn [^DynamicClassLoader cl]
+                                   (seq (.getURLs cl)))
+                 :add-classpath-url (fn [^DynamicClassLoader cl url]
                                       (.addURL cl url)))]

            ;; if dynapath is available, make our classloader join the party


make input type for email email

make input type for email email

--- src/braid/ui/views/login.cljs
+++ src/braid/ui/views/login.cljs
@@ -43,7 +43,7 @@
         [:fieldset
          [:label "Email"
           [:input {:placeholder "you@example.com"
-                   :type "text"
+                   :type "email"
                    :value (@state :email)
                    :on-change (fn [e] (set-email! (.. e -target -value)))}] ]


WIP - Evolution du bot CSB en Clojure avec l'objectif d'améliorer le classement en ligue argent

--- clojure/codingame/competition/coders-strike-back/src/coders_strike_back/Player.clj
+++ clojure/codingame/competition/coders-strike-back/src/coders_strike_back/Player.clj
@@ -1,5 +1,8 @@
 (ns Player
   (:gen-class))
+
+(def checkpoint-core-size 100)
+(def delay-between-shield-use 10)

 (defn inc-atom [curr-val] (inc curr-val))
 (defn dec-atom [curr-val] (dec curr-val))
@@ -22,13 +25,30 @@
 (defn convert-to-int [float-value]
   (Integer/valueOf (Math/round float-value)))

+(defn after [val1 val2] (if (> (- val2 val1) 0) true false))
+(defn before [val1 val2] (if (< (- val2 val1) 0) true false))
+
+(defn compute-x [x next-checkpoint-x next-checkpoint-angle next-checkpoint-distance]
+  (if (> next-checkpoint-distance 1000)
+    (cond
+      (and (>= next-checkpoint-angle -90) (<= next-checkpoint-angle 90) (before next-checkpoint-x x))
+      (convert-to-int (+ next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle))))
+      (and (>= next-checkpoint-angle -90) (<= next-checkpoint-angle 90) (after next-checkpoint-x x))
+      (convert-to-int (- next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle))))
+      (or (<= -180 next-checkpoint-angle -90 ) (>= 180 next-checkpoint-angle 90))
+      (convert-to-int (- next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle)))))
+    next-checkpoint-x))
+
+(defn compute-y [y next-checkpoint-y next-checkpoint-angle next-checkpoint-distance]
+  (if (cond
+        (and (>= next-checkpoint-angle 0)  (<= next-checkpoint-angle 180)) (convert-to-int (- next-checkpoint-y (* checkpoint-core-size (Math/sin next-checkpoint-angle))))
+        (and (< next-checkpoint-angle 0) (>= next-checkpoint-angle -180)) (convert-to-int (+ next-checkpoint-y (* checkpoint-core-size (Math/sin next-checkpoint-angle)))))
+    next-checkpoint-y))
+
 ;;Angle entre 2 points (x1,y1) et (x2,y2)
 (defn angle-between-2-points [x1 y1 x2 y2]
   (let [d (distance x1 y1 x2 y2) dx (/ (- x2 x1) d) dy (/ (- y2 y1) d) angle (convert-radian-to-degree (Math/acos dx))]
     (if (< dy 0) (- 360.0 angle) angle)))
-
-(defn after [val1 val2] (if (> (- val2 val1) 0) true false))
-(defn before [val1 val2] (if (< (- val2 val1) 0) true false))

 (defn compute-boost-from-angle [next-checkpoint-angle]
   (str (convert-to-int (* (Math/sin (convert-degree-to-radian (Math/abs next-checkpoint-angle))) 100))))
@@ -50,13 +70,13 @@
     (and (not (= @last-boost-value "SHIELD")) (not (= @last-boost-value "BOOST")) (= @last-shield-usage 0))))

 (defn use-shield? [x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value]
-  (and (= @last-shield-usage 0) (> @game-loop-counter 10) (> @max-shield-usage 0) (< (distance opponent-x opponent-y x y) 700)))
+  (and (= @last-shield-usage 0) (> @game-loop-counter 10) (> @max-shield-usage 0) (< (distance opponent-x opponent-y x y) 1000)))

 ;;Compute BOOST, SHIELD or boost value between 0 and 100
 (defn compute-action [next-checkpoint-x next-checkpoint-y next-checkpoint-distance next-checkpoint-angle x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value]
   (cond
     (use-boost? next-checkpoint-distance next-checkpoint-angle boost-used? game-loop-counter last-shield-usage last-boost-value) (do (reset! boost-used? true) "BOOST")
-    (use-shield? x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value) (do (reset! last-shield-usage 3) (swap! max-shield-usage dec-atom) "SHIELD")
+    (use-shield? x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value) (do (reset! last-shield-usage delay-between-shield-use) (swap! max-shield-usage dec-atom) "SHIELD")
     true (compute-boost next-checkpoint-distance next-checkpoint-angle)))

 (defn -main [& args]
@@ -103,9 +123,9 @@
         ; You have to output the target position
         ; followed by the power (0 <= thrust <= 100)
         ; i.e.: "x y thrust"
-        (print nextCheckpointX)
+        (print (compute-x x nextCheckpointX nextCheckpointAngle nextCheckpointDist))
         (print " ")
-        (print nextCheckpointY)
+        (print (compute-y y nextCheckpointY nextCheckpointAngle nextCheckpointDist))
         (print " ")
         (reset! last-boost-value
                 (compute-action


SQL fix

SQL fix

--- src/clj/salava/gallery/db.clj
+++ src/clj/salava/gallery/db.clj
@@ -68,9 +68,7 @@
     (select-gallery-tags {:badge_ids badge_ids} (get-db ctx))))

 (defn str-ids [ids]
-  (if (empty? ids)
-      "()"
-      (str "(" (reduce (fn [x y] (str x ",'" y "'"  )) (str "'"(first ids)"'") (rest ids)) ")")))
+    (str "('" (apply str (interpose "','" (map #(string/replace % #"\W" "") ids))) "')"))

 (defn badge-count [search page_count]
   (let [limit 48


Fix multi-:source map task input.

Fix multi-:source map task input.

--- src/clojure/parkour/graph.clj
+++ src/clojure/parkour/graph.clj
@@ -154,8 +154,9 @@
   [nodes & fs]
   (if-not (every? (comp #{:source} stage) nodes)
     (throw (ex-info "Cannot merge non-`:source` nodes." {:nodes nodes}))
-    (assoc (source (mapv :source nodes))
-      :requires (into [] (mapcat :requires nodes)))))
+    (let [node (assoc (source (apply mux/dseq (map :source nodes)))
+                 :requires (into [] (mapcat :requires nodes)))]
+      (apply remote node fs))))

 (defmethod remote* :source
   ([node f] (assoc node :stage :map, :mapper (f-list f)))


Don't reselect to preserve frontier if not excess diversifiers

--- src/clojush/pushgp/pushgp.clj
+++ src/clojush/pushgp/pushgp.clj
@@ -198,8 +198,15 @@
              (or (not (:autoconstructive argmap))
                  (> generation 0)))
     (println "Preserving frontier... ")
-    (let [raw-candidates (concat @frontier (map deref pop-agents))
-          diversifying-candidates (filter :diversifying raw-candidates)
+    (let [diversifying-children (filter :diversifying (map deref pop-agents))
+          diversifying-frontier (filter :diversifying @frontier)
+          verified-frontier (filter (fn [parent]
+                                      (some (fn [child]
+                                              (= (:parent1-genome child)
+                                                 (:genome parent)))
+                                            diversifying-children))
+                                    diversifying-frontier)
+          diversifying-candidates (concat diversifying-children verified-frontier)
           _ (println "Number of diversifying candidates for frontier preservation:"
                      (count diversifying-candidates))
           filtered-candidates (if (empty? diversifying-candidates)
@@ -207,6 +214,11 @@
                                 (if (< (count diversifying-candidates) (count pop-agents))
                                   (take (count pop-agents) (cycle diversifying-candidates))
                                   diversifying-candidates))]
+      (if (= (count filtered-candidates) (count pop-agents))
+        (do (dotimes [i population-size]
+              ((if use-single-thread swap! send) (nth pop-agents i) (fn [_] (nth filtered-candidates i))))
+            (when-not use-single-thread (apply await pop-agents)) ;; SYNCHRONIZE
+            (reset! frontier filtered-candidates))
       (loop [preserved 0
              new-frontier []
              candidates filtered-candidates]
@@ -221,7 +233,7 @@
                                                #(drop-last (count (:meta-errors to-preserve)) %))]
             (recur (inc preserved)
                    (conj new-frontier without-meta-errors)
-                   (remove-one to-preserve candidates)))))))
+                   (remove-one to-preserve candidates))))))))
   (timer @push-argmap :fitness)
   ;; calculate solution rates if necessary for historically-assessed hardness
   (calculate-hah-solution-rates pop-agents @push-argmap)


Made it clearer where multi-digit close counts fall when CSV logging close counts.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -128,7 +128,12 @@
                            :plush-genome-closes (if (empty? (:genome individual))
                                                   "()"
                                                   (apply str
-                                                         (not-lazy (map :close (:genome individual)))))
+                                                         (not-lazy
+                                                          (map (fn [closes]
+                                                                 (if (<= closes 9)
+                                                                   closes
+                                                                   (str "<" closes ">")))
+                                                               (map :close (:genome individual))))))
                            :plushy-genome-closes (if (empty? (:genome individual))
                                                    "()"
                                                    (apply str


finished part 2

finished part 2


First steps to hierarchy induction.

First steps to hierarchy induction.

--- src/exp/sas.clj
+++ src/exp/sas.clj
@@ -1,7 +1,7 @@
 (ns exp.sas
   (:require [edu.berkeley.ai.util :as util]
             [edu.berkeley.ai.util [queues :as queues] [graphviz :as gv]]
-            [exp [env :as env] causal-graphs])
+            [exp [env :as env] causal-graphs [hierarchy :as hierarchy]])
   (:import [java.util LinkedList HashMap HashSet ArrayList])
   )

@@ -469,6 +469,111 @@

+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Hierarchy induction! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Each HLA tries to get one var to particular var, or achieve all preconditions of an action
+(deftype SAS-VV-HLA     [var val precond-vars init-sets effect-sets refinements])
+(deftype SAS-Action-HLA [action  precond-vars init-sets effect-sets refinements])
+
+(defn find-all-acyclic-paths
+  ([var init-val-set goal-val reverse-dtg]
+     (find-all-acyclic-paths var init-val-set goal-val reverse-dtg nil #{} true))
+  ([var init-val-set goal-val reverse-dtg plan-suffix stack-val-set can-use-free?]
+;     (println "FACP" var init-val-set goal-val)
+     (when (and (seq init-val-set) (not (contains? stack-val-set goal-val)))
+       (if (contains? init-val-set goal-val)
+           (cons plan-suffix
+                 (find-all-acyclic-paths var (disj init-val-set goal-val) goal-val reverse-dtg plan-suffix
+                                         stack-val-set can-use-free?))
+         (apply concat
+           (for [[pval actions] (get reverse-dtg goal-val)
+                 a              actions
+                 :let  [action-free? (not (contains? (:precond-map a) var))]
+                 :when (or (not action-free?) can-use-free?)]
+             (find-all-acyclic-paths var init-val-set pval reverse-dtg (cons a plan-suffix)
+                                     (conj stack-val-set goal-val) (and can-use-free? (not action-free?)))))))))
+
+(declare induce-action-hla)
+
+;    (println paths)
+;    (doseq [path paths] (induce-action-hla (first path) init-sets reverse-dtgs))
+
+(defn progress-refinement [prim-ref init-sets reverse-dtgs]
+  (println "Progressing plan" prim-ref)
+  (loop [prim-ref prim-ref, hla-ref [], effect-sets {}]
+    (if (empty? prim-ref)
+        [hla-ref effect-sets]
+      (let [a     (first prim-ref)
+            hla-a (induce-action-hla a (merge init-sets effect-sets) reverse-dtgs)]
+        (recur (rest prim-ref) (conj hla-ref hla-a) (merge effect-sets (:effect-sets hla-a)))))))
+
+;; Want to look at acyclic paths, which include at most one free-action. (with no precond on var.)
+;; Two things we can do here; recursive style (works from any src, more caching) or direct style
+ ;; (avoid cycles, more focused description/pruning, but less caching and less general).
+(defn induce-vv-hla [var goal-val init-sets reverse-dtgs]
+  (println "Inducing HLA to get" var "to val" val "from" (init-sets var))
+  (let [inits        (init-sets var)
+        reverse-dtg  (reverse-dtgs var)
+        paths        (find-all-acyclic-paths var inits goal-val reverse-dtg)
+        refs-results (filter identity (map #(progress-refinement % init-sets reverse-dtgs) paths))]
+;    (println (map second refs-results))
+    (when (seq refs-results)
+      (SAS-VV-HLA var goal-val
+        (set (for [[ref _] refs-results, a ref, v (:precond-vars a)] v))
+        init-sets
+        (apply merge-with clojure.set/union (map second refs-results))
+        (map first refs-results)))))
+
+(defn induce-action-hla [a init-sets reverse-dtgs]
+  (println "Induce HLA for preconds of action, then action." (:name a))
+  (let [first-bits (for [[pvar pval] (:precond-map a)
+                         :when (not (= (init-sets pvar) #{pval}))]
+                     (induce-vv-hla pvar pval init-sets reverse-dtgs))]
+    (doall first-bits)
+    (doseq [b first-bits] (println "\n" b "\n\n"))
+    (when (every? identity first-bits)
+     (if (empty? first-bits)
+       (SAS-Action-HLA
+        a
+        (util/keyset (:precond-map a))
+        init-sets
+        (util/map-vals (fn [x] #{x}) (:effect-map a))
+        [[a]])
+       (let [bit (util/safe-singleton first-bits)]
+         (assert (= ((:effect-sets bit) (:var bit)) #{(:val bit)}))
+         (SAS-Action-HLA
+          a
+          (clojure.set/union (util/keyset (:precond-map a)) (:precond-vars bit))
+          init-sets
+          (merge (:effect-sets bit) (util/map-vals (fn [x] #{x}) (:effect-map a)))
+          [[bit a]]))))))
+
+(defn induce-hierarchy [sas-problem]
+  (let [{:keys [vars actions init]} sas-problem
+        reverse-dtgs                (make-extended-reverse-dtgs vars actions)
+        goal-action                 (util/safe-singleton (get-in reverse-dtgs [:goal [:true] [:false]]))
+        ]
+    (assert (= (:name goal-action) [:goal]))
+    (hierarchy/SimpleHierarchicalEnv sas-problem
+      [(util/make-safe (induce-action-hla goal-action (util/map-vals (fn [x] #{x}) init) reverse-dtgs))])))
+
+(declare pretty-print-action-hla)
+(defn pretty-print-vv-hla [vv-hla]
+  (println "\n" "VV:" (:var vv-hla) (:val vv-hla) (:precond-vars vv-hla) (:effect-sets vv-hla))
+  (doseq [ref (:refinements vv-hla)]
+    (println " " (util/str-join ", " (map :action ref))))
+  (doseq [ref (:refinements vv-hla), a ref]
+    (pretty-print-action-hla a)))
+
+(defn pretty-print-action-hla [action-hla]
+  (println "\n" "A: " (:action action-hla) (:precond-vars action-hla) (:effect-sets action-hla))
+  (doseq [ref (:refinements action-hla)]
+    (println " " (util/str-join ", " (map (juxt :var :val) (butlast ref))) (:action (last ref))))
+    (doseq [ref (:refinements action-hla), a (butlast ref)]
+      (doseq [a (butlast ref)] (pretty-print-vv-hla a))))
+
+(defn pretty-print-hierarchy [hierarchy]
+  (pretty-print-action-hla (first (:initial-plan hierarchy))))


Minor

Minor

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -177,7 +177,6 @@
         items (:items res)
         discussion (:discussion res)
         issues (:issues res)]
-    (loading? false)
     (update-state-map! :items items)
     (update-state-map! :discussion discussion)
     (update-state-map! :issues issues)


Added homology printing to Replace Space With Newline problem

--- src/clojush/problems/software/replace_space_with_newline.clj
+++ src/clojush/problems/software/replace_space_with_newline.clj
@@ -176,6 +176,7 @@
    :uniform-mutation-rate 0.01
    :problem-specific-report replace-space-report
    :print-behavioral-diversity true
+   :print-homology-data true
    :report-simplifications 0
    :final-report-simplifications 5000
    ;:max-error 1


Component ID is read too in read-components-for-chapter

--- src/hurvinek/db_interface.clj
+++ src/hurvinek/db_interface.clj
@@ -198,7 +198,8 @@
     [chapter-id]
     (try
         (jdbc/query db-spec/hurvinek-db
-                        ["select components.name from components, groups, chapters
+                        ["select components.id, components.name
+                            from components, groups, chapters
                            where groups.chapter      = chapters.id
                              and components.group_id = groups.id
                              and chapters.id=?


test fix

test fix

--- src/metabase/driver/generic_sql/query_processor/annotate.clj
+++ src/metabase/driver/generic_sql/query_processor/annotate.clj
@@ -28,7 +28,8 @@
 (defn order-columns
   "Return a sequence of column names in the order we should return results from the QP."
   [{{source-table :source_table breakout-field-ids :breakout} :query} field-names]
-  (let [breakout-field-id->name (sel :many :id->field [Field :name] :table_id source-table :id [in (set breakout-field-ids)])
+  (let [breakout-field-ids (filter identity breakout-field-ids)
+        breakout-field-id->name (sel :many :id->field [Field :name] :table_id source-table :id [in (set breakout-field-ids)])
         breakout-fields (map breakout-field-id->name breakout-field-ids)]
     (concat breakout-fields (filter #(not (contains? (set breakout-fields)
                                                      (uncastify (name %))))


Set :num-batch-threads to 1

Set :num-batch-threads to 1

--- src/lens/system.clj
+++ src/lens/system.clj
@@ -13,7 +13,7 @@
     :thread 1

     :broker
-    (new-broker {:host broker-host})
+    (new-broker {:host broker-host :num-batch-threads 1})

     :server
     (comp/using (new-server) [:port :thread :broker])))


store.pure: simplify fill-in

store.pure: simplify fill-in

--- src/io/cyanite/store/pure.clj
+++ src/io/cyanite/store/pure.clj
@@ -11,13 +11,13 @@
       (int)))

 (defn fill-in
-  [nils [path data]]
-  (hash-map path
-            (->> (group-by :time data)
-                 (merge nils)
-                 (map (comp first val))
-                 (sort-by :time)
-                 (map :metric))))
+  [nils data]
+  (->> (group-by :time data)
+       (map (fn [[k v]] [k (-> v first :point (get "mean"))]))
+       (reduce merge {})
+       (merge nils)
+       (sort-by key)
+       (mapv val)))

 (defn normalize
   [data]
@@ -26,7 +26,7 @@
 (defn empty-series
   [min-point max-point precision]
   (->> (range min-point (inc max-point) precision)
-       (map #(vector % [{:time %}]))
+       (map #(vector % nil))
        (reduce merge {})))

 (defn data->series


CMR-5848 require cleanup.

CMR-5848 require cleanup.

--- system-int-test/test/cmr/system_int_test/ingest/provider_cmr_only_client_id_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/provider_cmr_only_client_id_test.clj
@@ -5,7 +5,6 @@
     [cmr.system-int-test.data2.core :as d]
     [cmr.system-int-test.data2.granule :as dg]
     [cmr.system-int-test.data2.umm-spec-collection :as data-umm-c]
-    [cmr.system-int-test.data2.umm-spec-common :as data-umm-cmn]
     [cmr.system-int-test.utils.index-util :as index]
     [cmr.system-int-test.utils.ingest-util :as ingest]
     [cmr.system-int-test.utils.search-util :as search]


change figlet font

change figlet font


Optimize the recursion for the piper app

--- src/piper/piper.clj
+++ src/piper/piper.clj
@@ -53,12 +53,12 @@
                                                                   :part (body-collect out-chan)
                                                                   :completed (body-completed out-chan)))

-                                   (loop []
-                                     (if-some [chunk (async/<!! out-chan)]
+                                   (loop [current-chunk (async/<!! out-chan)]
+                                     (if-some [next-chunk (async/<!! out-chan)]
                                        (do
-                                         (iasync/send! stream chunk)
-                                         (recur))
-                                       (iasync/send! stream "" {:close? true}))))})))
+                                         (iasync/send! stream current-chunk)
+                                         (recur next-chunk))
+                                       (iasync/send! stream current-chunk {:close? true}))))})))

 (defn async-request [url]
   (let [hi-chan (async/chan 1024)]
@@ -78,18 +78,21 @@
                                                       (async-request url))]

                                        (concat-chans in-chans out-chan)
-                                       (loop []
-                                         (if-some [chunk (async/<!! out-chan)]
+                                       (loop [chunk (async/<!! out-chan)]
+                                         (if-some [next-chunk (async/<!! out-chan)]
                                            (do
                                              (iasync/send! stream chunk)
-                                             (recur))
-                                           (iasync/send! stream "" {:close? true})))))}))))
+                                             (recur next-chunk))
+                                           (iasync/send! stream chunk {:close? true})))))}))))

 (defn sync-piper []
   (piper-app ["http://localhost:8083/fragment-1"
               "http://localhost:8083/fragment-2"
               "http://localhost:8083/fragment-3"
-              "http://localhost:8083/fragment-1"]))
+              "http://localhost:8083/fragment-1"
+              "http://localhost:8083/fragment-2"
+              "http://localhost:8083/fragment-3"
+              ]))

 (defn async-piper []
   (piper-app ["http://localhost:8083/async-fragment-1"


Don't block thread until window size is setup. Quil hangs on some machine when using OpenGL renderer.

--- src/quil/applet.clj
+++ src/quil/applet.clj
@@ -127,23 +127,15 @@
                   :pdf    PApplet/PDF
                   :dxf    PApplet/DXF})

-(defn- wait-event-dispatch-thread
-  "Blocks current thread until all events in AWT event dispatch thread are processed."
-  []
-  (javax.swing.SwingUtilities/invokeAndWait (fn [])))
-
 (defn- applet-set-size
   ([width height]
-     (.size (current-applet) (int width) (int height))
-     (wait-event-dispatch-thread))
+     (.size (current-applet) (int width) (int height)))
   ([width height renderer]
      (let [renderer (resolve-constant-key renderer renderer-modes)]
-       (.size (current-applet) (int width) (int height) renderer))
-     (wait-event-dispatch-thread))
-    ([width height renderer path]
+       (.size (current-applet) (int width) (int height) renderer)))
+  ([width height renderer path]
      (let [renderer (resolve-constant-key renderer renderer-modes)]
-       (.size (current-applet) (int width) (int height) renderer path))
-     (wait-event-dispatch-thread)))
+       (.size (current-applet) (int width) (int height) renderer path))))

 (defn- validate-size!
   "Checks that the size vector is exactly two elements. If not, throws


fixed diff of colls

fixed diff of colls

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -28,14 +28,14 @@
    (if-not (str/blank? s)
      (->> (str/split s #"\s*,\s*") (map #(let [[k v] (str/split % sep 2)]
                                            [k (replace-opts v opts)])) (into {})))))
-(defn- diff* [a b]
+(defn diff* [a b]
   (cond
     (= a b) nil
     (map? a) (if (map? b)
                (let [d (filter #(diff* (second %) (b (first %))) a)]
                  (if (empty? d) nil (into {} d)))
                a)
-    (vector? a) (if (vector? b)
+    (coll? a) (if (coll? b)
                   (let [e (filter (fn [x] (every? #(diff* x %) b)) a)]
                     (if (empty? e) nil (vec e)))
                   a)
@@ -84,7 +84,8 @@
                (some (fn [[header value]]
                        (if (not= value (headers header))
                          (str "header " header " was " (headers header) " expected " value))) exp-headers)
-               (if-let [diff (and (not-empty exp-body) (first (diff* exp-body body*)))]
+               (when-let [diff (and (not-empty exp-body) (first (diff* exp-body body*)))]
+                 (log/error "failed matching body. expected:" exp-body " got:" body*)
                  (->> diff json/generate-string (str "expected body missing:" ))))]
     (if error
       [error resp])))


[ci skip] indent

[ci skip] indent

--- src/shorty/core.clj
+++ src/shorty/core.clj
@@ -41,10 +41,10 @@
   ([port]
    (let [port* (int (or port (:port env) 8080))]
      (reset! stop-server-fn
-             (http/run-server (-> #'routes
-                                  (wrap-defaults api-defaults)
-                                  wrap-with-logger)
-                              {:port port*}))
+             (http/run-server
+               ;; #'routes
+               (-> #'routes (wrap-defaults api-defaults) wrap-with-logger)
+               {:port port*}))
      (println (str "Started listening on http://127.0.0.1:" port*)))))

 (defn -main


Better docs and better examples in core

Better docs and better examples in core

--- src/themis/core.clj
+++ src/themis/core.clj
@@ -63,7 +63,10 @@

 (defn validation
   "Validate a data structure, `t`,
-  against a normalized validation query/rule-set"
+  against a normalized validation query/rule-set
+  Note: By default everything is returned in a map, keyed by
+  the coordinate vector.  It is possible for validation results to be
+  stomped on."
   ([t normalized-query]
    ;; For some reason `doall` doesn't work here
    (apply hash-map (into [] (mapcat identity (validation-seq t normalized-query)))))
@@ -81,7 +84,7 @@
   (defn degrandis-pets [t-map data-point opt-map]
     (and (= (get-in t-map [:name :last]) "deGrandis")
          (:has-pet t-map)
-         {}))
+         nil))

   (def valid-paul [[[:name :first] [(fn [t-map data-point opt-map] (and (= data-point "Paul")
                                                                         {:a 1 :b 2}))]]
@@ -92,7 +95,7 @@
   (def paul-rules (query/normalize valid-paul))
   (validation-seq paul paul-rules)
   (validation paul paul-rules)
-  (validation paul paul-rules identity)
+  (mapcat identity (validation paul paul-rules (partial filter second)))

 )


Changed routes that the links in the navigation use.

--- app/src/clj_web_example/ui/view/navigation.cljs
+++ app/src/clj_web_example/ui/view/navigation.cljs
@@ -9,5 +9,5 @@
 (defn navigation
   []
   [:div#navigation
-   [navigation-link (tr :messages) "#messages"]
-   [navigation-link (tr :new-message) "#messages/new"]])
+   [navigation-link (tr :messages) "#"]
+   [navigation-link (tr :new-message) "#new"]])


Use config

Use config

--- dev/src/yada/dev/system.clj
+++ dev/src/yada/dev/system.clj
@@ -71,7 +71,7 @@
   (assoc
    system
    :clostache-templater (make new-clostache-templater config)
-   :user-guide (make new-user-guide config)
+   :user-guide (make new-user-guide config :prefix nil :ext-prefix nil)
    :website (make new-website config)
    :jquery (make new-web-resources config
                  :key :jquery


Update experimental UI to handle definition_locations map

Reviewers: fromberger, shahms

Reviewed By: shahms

Differential Revision: https://phabricator-dot-kythe-repo.appspot.com/D828

--- kythe/web/ui/src-cljs/ui/src.cljs
+++ kythe/web/ui/src-cljs/ui/src.cljs
@@ -84,18 +84,21 @@
   "Returns a seq of precomputed text/anchors to display as the source-text"
   [decorations]
   (let [src (b64/decodeString (:source_text decorations))
+        definitions (:definition_locations decorations)
         anchors (mapcat overlay-anchors
                   (group-overlapping-anchors
                     (filter (fn [{:keys [start end kind]}]
                               (and start end (< start end)))
-                      (map (fn [{:keys [source_ticket target_ticket anchor_start anchor_end kind target_definition]}]
-                             {:start (:byte_offset anchor_start)
-                              :end (:byte_offset anchor_end)
-                              :target-definition target_definition
-                              :kind (schema/trim-edge-prefix kind)
-                              :anchor-ticket source_ticket
-                              :target-ticket target_ticket})
-                        (filter #(not (contains? #{schema/documents-edge schema/defines-edge} (:kind %)))
+                            (map (fn [{:keys [source_ticket target_ticket anchor_start anchor_end kind target_definition]}]
+                                   (let [def (when target_definition
+                                               (get definitions (keyword target_definition)))]
+                                     {:start (:byte_offset anchor_start)
+                                      :end (:byte_offset anchor_end)
+                                      :target-definition def
+                                      :kind (schema/trim-edge-prefix kind)
+                                      :anchor-ticket source_ticket
+                                      :target-ticket target_ticket}))
+                                 (filter #(not (contains? #{schema/documents-edge schema/defines-edge} (:kind %)))
                           (:reference decorations))))))]
     {:source-text src
      :num-lines (count-lines src)


Make clean-tokyo task also use conch.

Make clean-tokyo task also use conch.

--- src/leiningen/clean_tokyo.clj
+++ src/leiningen/clean_tokyo.clj
@@ -1,10 +1,10 @@
 (ns leiningen.clean-tokyo
-  (:use [clojure.java.shell :only [sh]]
-        [clojure.java.io :only [file]]))
+  (:use [clojure.java.io :only [file]])
+  (:require [conch.core :as sh]))

 (defn clean [srcdir]
   (when (.exists (file srcdir "Makefile"))
-    (println (:out (sh "make" "distclean" :dir (file srcdir))))))
+    (sh/stream-to-out (sh/proc "make" "distclean" :dir (file srcdir)) :out)))

 (defn clean-tokyo []
   (clean (file "src/tokyocabinet"))


update cljsjs dep

update cljsjs dep

--- src/leiningen/new/tenzing.clj
+++ src/leiningen/new/tenzing.clj
@@ -82,7 +82,7 @@
           (reagent? opts) (conj "reagent \"0.4.3\"" "cljsjs/react \"0.12.2-3\"")
           (garden?  opts) (conj "boot-garden \"1.2.5-1\"")
           (sass?    opts) (conj "boot-sassc  \"0.1.0\"")
-          (cljsjs?  opts) (conj "cljsjs/boot-cljsjs \"0.4.0\"")))
+          (cljsjs?  opts) (conj "cljsjs/boot-cljsjs \"0.4.1\"")))

 (defn build-requires [opts]
   (cond-> []


generate sentences for root verbs in alphabetic order

--- src/it.clj
+++ src/it.clj
@@ -59,4 +59,7 @@
                                       {:synsem {:sem {:aspect :perfect
                                                       :tense :past}}})))))
                 (reduce concat
-                        (vals root-verbs))))))
+                        (map (fn [key]
+                               (get root-verbs key))
+                             (sort (keys root-verbs))))))))
+


Clojure: more work on new p-graph morphism detection ideas

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -1,6 +1,7 @@
 (ns org.gavrog.clojure.pgraph-morphisms
-  (:import (org.gavrog.joss.pgraphs.io Net)
-           (org.gavrog.joss.geometry Operator)))
+  (:import (org.gavrog.joss.pgraphs.basic PeriodicGraph$CoverNode)
+           (org.gavrog.joss.pgraphs.io Net)
+           (org.gavrog.joss.geometry Operator Vector)))

 (defn nets [filename]
   (iterator-seq (Net/iterator filename)))
@@ -8,8 +9,18 @@
 (defn identity-matrix [net]
   (Operator/identity (.getDimension net)))

+(defn adjacent [node]
+  (map #(.target %) (iterator-seq (.incidences node))))
+
+(defn nextShellPair [[prev this]]
+  [this (set (for [u this, v (adjacent u) :when (not (prev v))] v))])
+
+(defn shells [net node]
+  (let [v0 (PeriodicGraph$CoverNode. net node)]
+    (iterate nextShellPair [#{v0} (set (adjacent v0))])))
+
 (defn node-signatures [net]
-  (let [mod-1 (fn [[v p]] [v (.modZ p)])
-        pos (into {} (map mod-1 (.barycentricPlacement net)))
-        by-pos (group-by pos (.nodes net))]
+  (let [pos (.barycentricPlacement net)
+        pos* (zipmap (keys pos) (map #(.modZ %) (vals pos)))
+        by-pos (group-by pos* (.nodes net))]
     by-pos))


Clojure: ditto

Clojure: ditto

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -6,14 +6,17 @@
 (defn nets [filename]
   (iterator-seq (Net/iterator filename)))

+(defn identity-matrix [net]
+  (Operator/identity (.getDimension net)))
+
+(defn barycentric-positions [net]
+  (into {} (.barycentricPlacement net)))
+
 (defn cover-node [net node]
   (PeriodicGraph$CoverNode. net node))

 (defn cover-node-position [pos node]
   (.plus (pos (.getOrbitNode node)) (.getShift node)))
-
-(defn identity-matrix [net]
-  (Operator/identity (.getDimension net)))

 (defn adjacent [node]
   (map #(.target %) (iterator-seq (.incidences node))))
@@ -26,14 +29,7 @@
     (map second (iterate next-shell-pair [#{node} (set (adjacent node))]))
     #{node}))

-(defn shell-positions [net node]
-  (let [pos (into {} (.barycentricPlacement net))]
-    (map (partial map (partial cover-node-position pos))
-         (shells net (cover-node net node)))))
-
-(defn node-signatures [net]
-  (let [pos (.barycentricPlacement net)
-        pos* (zipmap (keys pos) (map #(.modZ %) (vals pos)))
-        shifts (zipmap (keys pos) (map #(.minus (pos %) (pos* %)) (keys pos)))
-        by-pos (group-by pos* (.nodes net))]
-    by-pos))
+(defn shell-positions [net pos node]
+  (let [shift (.minus (pos node) (.modZ (pos node)))
+        pos* (fn [v] (.minus (cover-node-position pos v) shift))]
+    (map (comp sort (partial map pos*)) (shells net (cover-node net node)))))


Allow somebody to update DB descriptions :page_with_curl:

--- src/metabase/api/database.clj
+++ src/metabase/api/database.clj
@@ -105,7 +105,7 @@

 (defendpoint PUT "/:id"
   "Update a `Database`."
-  [id :as {{:keys [name engine details is_full_sync]} :body}]
+  [id :as {{:keys [name engine details is_full_sync description]} :body}]
   {name    [Required NonEmptyString]
    engine  [Required DBEngine]
    details [Required Dict]}
@@ -126,7 +126,8 @@
                        :name         name
                        :engine       engine
                        :details      details
-                       :is_full_sync is_full_sync))
+                       :is_full_sync is_full_sync
+                       :description  description)) ; TODO - this means one cannot unset the description. Does that matter?
           (events/publish-event :database-update (Database id)))
         ;; failed to connect, return error
         {:status 400


Remove unused namespaces, thanks eastwood.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -18,26 +18,14 @@
             [oc.storage.async.notification :as notification]
             [oc.storage.representations.media-types :as mt]
             [oc.storage.representations.board :as board-rep]
-            [oc.storage.representations.entry :as entry-rep]
             [oc.storage.resources.common :as common-res]
             [oc.storage.resources.org :as org-res]
             [oc.storage.resources.board :as board-res]
             [oc.storage.resources.entry :as entry-res]
-            [oc.storage.resources.reaction :as reaction-res]
             [oc.storage.lib.timestamp :as ts]
             [oc.storage.urls.board :as board-url]))

 ;; ----- Utility functions -----
-
-(defn- comments
-  "Return a sequence of just the comments for an entry."
-  [{interactions :interactions}]
-  (filter :body interactions))
-
-(defn- reactions
-  "Return a sequence of just the reactions for an entry."
-  [{interactions :interactions}]
-  (filter :reaction interactions))

 (defn- assemble-paginated-board
   "Assemble the requested activity (params) for the provided board."


fix string escape in comment

fix string escape in comment

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -46,7 +46,7 @@
                  [metrics-clojure "2.5.1"]
                  [org.clojure/core.async "0.1.303.0-886421-alpha"]
                  [com.stuartsierra/component "0.2.2"]
-                 [org.clojure/clojure "1.8.0-RC5" :scope "provided"]
+                 [org.clojure/clojure "1.6.0" :scope "provided"]
                  [org.apache.zookeeper/zookeeper "3.4.6" :scope "provided"
                   :exclusions [io.netty/netty]]
                  [org.apache.kafka/kafka_2.10 "0.8.1.1" :scope "provided"


Do not call 2 times validation on board update map, just stick to it in the context the first time.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -5,7 +5,6 @@
             [clojure.set :as clj-set]
             [compojure.core :as compojure :refer (ANY OPTIONS POST)]
             [liberator.core :refer (defresource by-method)]
-            [schema.core :as schema]
             [oc.lib.schema :as lib-schema]
             [oc.lib.slugify :as slugify]
             [oc.lib.db.pool :as pool]
@@ -123,7 +122,8 @@
       (cond (not valid-access-update?)
             [false, {:reason :board-access-not-allowed}]
             (not valid-updated-board?)
-            [false, {:board-update (api-common/rep updated-board)}]
+            [false, {:board-update (api-common/rep updated-board)
+                     :reason (api-common/rep valid-updated-board?)}]
             :else
             {:existing-org (api-common/rep org)
              :existing-board (api-common/rep original-board)
@@ -370,9 +370,7 @@
                              full-board (if drafts-board?
                                           (assemble-board conn org board ctx)
                                           (assemble-board conn board params))]
-                         (board-rep/render-board org full-board ctx params)))
-  :handle-unprocessable-entity (fn [ctx]
-    (api-common/unprocessable-entity-handler (merge ctx {:reason (schema/check common-res/Board (:board-update ctx))}))))
+                         (board-rep/render-board org full-board ctx params))))

 ;; A resource for operations on a list of boards


remove snapshots

remove snapshots

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -28,7 +28,7 @@
                  [org.clojure/tools.trace "0.7.6"]
                  [org.xerial.snappy/snappy-java "1.1.1-M1"]
                  [org.clojure/tools.logging "0.2.6"]
-                 [clj-tcp "0.4.0-SNAPSHOT"]
+                 [clj-tcp "0.4.0"]
                  [fmap-clojure "LATEST"]
                  [fun-utils "LATEST"]
                  [clj-tuple "0.1.4"]


Remove no longer necessary arg from render multi-fn

--- src/pinpointer/formatter.cljc
+++ src/pinpointer/formatter.cljc
@@ -8,8 +8,8 @@
 (def ^:dynamic *highlighting-mark* "!!!")

 (defmulti render
-  (fn [{:keys [spec]} f printer x] (when (seq? spec) (first spec))))
-(defmethod render :default [_ f printer x]
+  (fn [{:keys [spec]} printer x] (when (seq? spec) (first spec))))
+(defmethod render :default [_ printer x]
   (let [spec (-> (:trace printer) first :spec)
         msg (str "spec " spec
                  " must have its own method implementation of " `render)]
@@ -23,7 +23,7 @@
     (if (= x (:val frame))
       (if (and (= (count trace) 1) (not (:reason frame)))
         (highlight (f (:base-printer printer) x))
-        (render frame f printer x))
+        (render frame printer x))
       (f (:base-printer printer) x))))

 (defn pop-trace [printer]
@@ -85,16 +85,16 @@
 (defn- render-next [printer x]
   (visit/visit (pop-trace printer) x))

-(defmethod render `s/spec [frame _ printer x]
-  (render-next printer x))
-
-(defmethod render `s/and [frame _ printer x]
-  (render-next printer x))
-
-(defmethod render `s/or [frame _ printer x]
-  (render-next printer x))
-
-(defmethod render `s/nilable [frame _ printer x]
+(defmethod render `s/spec [frame printer x]
+  (render-next printer x))
+
+(defmethod render `s/and [frame printer x]
+  (render-next printer x))
+
+(defmethod render `s/or [frame printer x]
+  (render-next printer x))
+
+(defmethod render `s/nilable [frame printer x]
   (render-next printer x))

 (defn- pretty-coll [printer open xs sep close f]
@@ -118,7 +118,7 @@
                      (visit/visit (cond-> printer (= i n) pop-trace) x)))]
      (pretty-coll printer open x sep close each-fn))))

-(defmethod render `s/tuple [{:keys [steps] :as frame} _ printer x]
+(defmethod render `s/tuple [{:keys [steps] :as frame} printer x]
   (if (empty? steps)
     (render-next printer x)
     (render-coll frame printer x)))
@@ -128,10 +128,10 @@
     (render-next printer x)
     (render-coll frame printer x)))

-(defmethod render `s/every [frame _ printer x]
+(defmethod render `s/every [frame printer x]
   (render-every frame printer x))

-(defmethod render `s/coll-of [frame _ printer x]
+(defmethod render `s/coll-of [frame printer x]
   (render-every frame printer x))

 (defn- render-every-kv [{:keys [steps] :as frame} printer x]
@@ -148,13 +148,13 @@
                            pop-trace)]
             [:span (visit/visit kprinter k) " " (visit/visit vprinter v)]))))))

-(defmethod render `s/every-kv [frame _ printer x]
+(defmethod render `s/every-kv [frame printer x]
   (render-every-kv frame printer x))

-(defmethod render `s/map-of [frame _ printer x]
+(defmethod render `s/map-of [frame printer x]
   (render-every-kv frame printer x))

-(defmethod render `s/keys [{[key] :steps :as frame} _ printer x]
+(defmethod render `s/keys [{[key] :steps :as frame} printer x]
   (if (nil? key)
     (visit/visit (pop-trace printer) x)
     (render-coll frame printer x
@@ -162,7 +162,7 @@
         (let [vprinter (cond-> printer (= k key) pop-trace)]
           [:span (visit/visit printer k) " " (visit/visit vprinter v)])))))

-(defmethod render `s/merge [frame _ printer x]
+(defmethod render `s/merge [frame printer x]
   (render-next printer x))

 (defn- render-regex [{:keys [reason steps] :as frame} printer x]
@@ -188,28 +188,28 @@

         :else (render-coll frame printer x)))

-(defmethod render `s/cat [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/& [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/alt [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/? [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/* [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/+ [frame _ printer x]
-  (render-regex frame printer x))
-
-(defmethod render `s/multi-spec [frame _ printer x]
+(defmethod render `s/cat [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/& [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/alt [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/? [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/* [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/+ [frame printer x]
+  (render-regex frame printer x))
+
+(defmethod render `s/multi-spec [frame printer x]
   (if (= (:reason frame) "no method")
     (highlight (visit/visit (:base-printer printer) x))
     (render-next printer x)))

-(defmethod render `s/nonconforming [frame _ printer x]
-  (render-next printer x))
+(defmethod render `s/nonconforming [frame printer x]
+  (render-next printer x))


CMR-3461-2 PR fixes

CMR-3461-2 PR fixes

--- search-app/src/cmr/search/services/tagging_service.clj
+++ search-app/src/cmr/search/services/tagging_service.clj
@@ -24,6 +24,9 @@
 (def ^:private native-id-separator-character
   "This is the separator character used when creating the native id for a tag."
   "/")
+
+(def ^:private association-conflict-error-message
+  "Failed to %s tag [%s] with collection [%s] because it conflicted with a concurrent %s on the same tag and collection. This means that someone is sending the same request to the CMR at the same time.")

 (defn- context->user-id
   "Returns user id of the token in the context. Throws an error if no token is provided"
@@ -214,12 +217,13 @@
             (merge {:tagged-item tagged-item} message)
             {:tag-association {:concept-id concept-id :revision-id revision-id}
              :tagged-item tagged-item}))
-        (catch Exception e ; Report a specific error in the case of a conflict, otherwise throw error
+        (catch clojure.lang.ExceptionInfo e ; Report a specific error in the case of a conflict, otherwise throw error
           (if (= :conflict (:type (ex-data e)))
-            {:errors (format "Failed to %s tag [%s] with collection [%s] because it conflicted with a concurrent operation"
+            {:errors (format association-conflict-error-message
                         (if (= :insert operation) "associate" "dissociate")
                         (:tag-key tag-association)
-                        coll-concept-id)
+                        coll-concept-id
+                        (if (= :insert operation) "association" "dissociation"))
              :tagged-item tagged-item}
             (throw e)))))))

@@ -235,12 +239,12 @@
         {:keys [tag-key originator-id]} existing-tag
         mdb-context (assoc context :system
                            (get-in context [:system :embedded-systems :metadata-db]))
-        [t1 result] (util/time-execution (doall (pmap
-                                                   (fn [association]
-                                                     (update-tag-association
-                                                      mdb-context (merge association {:tag-key tag-key
-                                                                                :originator-id originator-id}) operation))
-                                                   tag-associations)))]
+        [t1 result] (util/time-execution (util/fast-map
+                                          (fn [association]
+                                            (update-tag-association
+                                             mdb-context (merge association {:tag-key tag-key
+                                                                             :originator-id originator-id}) operation))
+                                          tag-associations))]
     (debug "update-tag-associations:" t1)
     result))


volumes in service info are clickable

volumes in service info are clickable

--- src/cljs/swarmpit/component/service/info/mounts.cljs
+++ src/cljs/swarmpit/component/service/info/mounts.cljs
@@ -1,7 +1,8 @@
 (ns swarmpit.component.service.info.mounts
   (:require [material.component.form :as form]
             [material.component.list-table-auto :as list]
-            [rum.core :as rum]))
+            [rum.core :as rum]
+            [swarmpit.routes :as routes]))

 (enable-console-print!)

@@ -21,6 +22,10 @@
                   "No")
       (val item))))

+(defn onclick-handler
+  [item]
+  (routes/path-for-frontend :volume-info {:name (:host item)}))
+
 (rum/defc form-bind < rum/static [bind]
   (when (not-empty bind)
     [:div
@@ -39,7 +44,7 @@
                  volume
                  render-item
                  render-item-keys
-                 nil)]))
+                 onclick-handler)]))

 (rum/defc form < rum/static [mounts]
   (when (not-empty mounts)


Replaced storing functions to render to multimethods to make things more transparent.

--- src/leiningen/new/reagent/src/cljs/reagent/core.cljs
+++ src/leiningen/new/reagent/src/cljs/reagent/core.cljs
@@ -17,26 +17,32 @@

 ;; -------------------------
 ;; Views
-(defn page1 []
+
+(defmulti page identity)
+
+(defmethod page :page1 [_]
   [:div [:h2 (get-state :text) "Page 1"]
    [:div [:a {:href "#/page2"} "go to page 2"]]])

-(defn page2 []
+(defmethod page :page2 [_]
   [:div [:h2 (get-state :text) "Page 2"]
    [:div [:a {:href "#/"} "go to page 1"]]])

+(defmethod page :default [_]
+  [:div "Invalid/Unknown route"])
+
 (defn main-page []
-  [:div [(get-state :current-page)]])
+  [:div [page (get-state :current-page)]])

 ;; -------------------------
 ;; Routes
 (secretary/set-config! :prefix "#")

 (secretary/defroute "/" []
-  (put! :current-page page1))
+  (put! :current-page :page1))

 (secretary/defroute "/page2" []
-  (put! :current-page page2))
+  (put! :current-page :page2))

 ;; -------------------------
 ;; Initialize app


Experiment with a fix for #617

Experiment with a fix for #617

--- src/riemann/transport/sse.clj
+++ src/riemann/transport/sse.clj
@@ -11,7 +11,8 @@
             [riemann.time             :refer [unix-time]]
             [clojure.tools.logging    :refer [info]]
             [clj-http.util            :refer [url-decode]]
-            [clojure.string           :refer [split]]))
+            [clojure.string           :refer [split]])
+  (:import sun.nio.ch.IOUtil))

 (def event-to-server-sent-event
   "Prepare an event for sending out on the wire."
@@ -134,7 +135,7 @@
                               (:latencies in)))))))

 (defn sse-server
-  "Starts a new SSE server for a core. Starts immediately.
+  "Creates a new SSE server for a core.

   Options:
   :host    The address to listen on (default 127.0.0.1)
@@ -152,6 +153,10 @@
      :or   {host    "127.0.0.1"
             port    5558
             headers {}}}]
+
+   ; Work around a deadlock when SSE-server and netty are started in parallel
+   (IOUtil/load)
+
      (SSEServer.
       host
       port


Add code to access all repos.

Add code to access all repos.

--- src/sweng_hw6_grader/core.clj
+++ src/sweng_hw6_grader/core.clj
@@ -20,18 +20,22 @@
               {:oauth-token "72ba628e6c0e29ecb5a8c36e61d611048bcbb442" :debug true})

   ; Helper for easier getting; adds Github prefix and OAuth token automatically
-  (defn g
-    ([url]
-     (g url {}))
-    ([url params]
-     (let [full-url (str "https://api.github.com" url)
-           user-agent {"User-Agent" "SwEng HW6 Grader"}
-           full-params (conj {:oauth-token "c51e6e73fe7bf706942ef41eda1a10435d130027"
-                              :as :json
-                              :headers user-agent} params)
-           response (client/get full-url full-params)]
-       (pprint response)
-       response)))
+  ; Create a github helper
+  (defn github-helper [method]
+    (fn helper
+      ([url] (helper url {}))
+      ([url params]
+       (let [full-url (str "https://api.github.com" url)
+             user-agent {"User-Agent" "SwEng HW6 Grader"}
+             full-params (conj {:oauth-token "c51e6e73fe7bf706942ef41eda1a10435d130027"
+                                :as :json
+                                :headers user-agent} params)
+             response (method full-url full-params)]
+         (pprint response)
+         response))))
+  (def g (github-helper client/get))
+  (def p (github-helper client/post))
+  (def d (github-helper client/delete))

   ; Interesting URLs:
   ; /repos/Sjlver/github-issues-tests/issues/3/events
@@ -54,4 +58,16 @@
      :labels (map :name (:labels issue))
      :repository (-> issue :repository :full_name)
      })
+
+  (defn forall-repos [f]
+    (with-open [rdr (reader "/home/jowagner/phd/05sweng/sweng-quizapp/Homeworks/Homework6/scripts/sonar_credentials.txt")]
+      (doseq [line (line-seq rdr)]
+        (let [[name-nice name-lower password] (split line #"\s+")]
+          (if (not= name-lower "betatest")
+            (f (str "sweng-2013-team-" name-lower)))))))
+
+  (forall-repos #(p (str "/repos/sweng-epfl/" % "/labels")
+                    {:body (client/json-encode {:name "Homework6Contest"
+                                                :color "FFFF00"})}))
+
 )


CMR-4239 - Split out common support functions from collection ones.

The reason being some of these will be used in the forthcoming UMM-Var changes
(and, after that, the UMM-Service changes).

--- system-int-test/test/cmr/system_int_test/ingest/collection_umm_spec_validation_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_umm_spec_validation_test.clj
@@ -61,12 +61,22 @@
     (testing "schema validation errors returned"
       (side/eval-form `(icfg/set-return-umm-json-validation-errors! true))
       (let [response (d/ingest-umm-spec-collection
+                               (data-umm-c/collection-missing-properties {:AdditionalAttributes
+                                               [(data-umm-c/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                                                (data-umm-c/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
+                               {:allow-failure? true})]
                        "PROV1"
                        (data-umm-c/collection-missing-properties
                          {:AdditionalAttributes
                           [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
                            (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
                        {:allow-failure? true})]
+                      "PROV1"
+                      (data-umm-c/collection-missing-properties
+                        {:AdditionalAttributes
+                         [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                          (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
+                      {:allow-failure? true})]
         (is (= {:status 422
                 :errors ["object has missing required properties ([\"CollectionProgress\",\"DataCenters\",\"Platforms\",\"ProcessingLevel\",\"ScienceKeywords\",\"TemporalExtents\"])"]}
                (select-keys response [:status :errors])))))
@@ -75,15 +85,29 @@
       (side/eval-form `(icfg/set-return-umm-json-validation-errors! false))
       (assert-valid {:AdditionalAttributes [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
                                             (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})))
+      (assert-valid {:AdditionalAttributes [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                                            (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})))
+      (assert-valid {:AdditionalAttributes [(data-umm-cmn/additional-attribute
+                                             {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                                            (data-umm-cmn/additional-attribute
+                                             {:Name "bool2" :DataType "BOOLEAN" :Value true})]})))

   (testing "UMM-C JSON-Schema validation through Cmr-Validate-Umm-C header"
     (testing "schema validation errors returned when Cmr-Validate-Umm-C header is true"
       (let [response (d/ingest-umm-spec-collection
+                                                       [(data-umm-c/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                                                        (data-umm-c/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
+                               {:allow-failure? true :validate-umm-c true})]
                        "PROV1"
                        (data-umm-c/collection-missing-properties
                          {:AdditionalAttributes
                            [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
                             (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
+                      "PROV1"
+                      (data-umm-cmn/collection-missing-properties
+                       {:AdditionalAttributes
+                        [(data-umm-cmn/additional-attribute {:Name "bool1" :DataType "BOOLEAN" :Value true})
+                         (data-umm-cmn/additional-attribute {:Name "bool2" :DataType "BOOLEAN" :Value true})]})
                        {:allow-failure? true :validate-umm-c true})]
         (is (= {:status 422
                 :errors ["object has missing required properties ([\"CollectionProgress\",\"DataCenters\",\"Platforms\",\"ProcessingLevel\",\"ScienceKeywords\",\"TemporalExtents\"])"]}


Update dependencies.

Update dependencies.

--- frontend/project.clj
+++ frontend/project.clj
@@ -22,12 +22,12 @@
                  [cljsjs/react-dom "15.4.0-0"]
                  [cljsjs/react-dom-server "15.4.0-0"]
                  [cljsjs/moment "2.15.2-3"]
-                 [funcool/potok "1.0.0"]
+                 [funcool/potok "1.1.0"]
                  [funcool/struct "1.0.0"]
                  [funcool/lentes "1.2.0"]
-                 [funcool/beicon "2.5.0"]
+                 [funcool/beicon "2.8.0"]
                  [funcool/cuerdas "2.0.1"]
-                 [funcool/bide "1.0.6"]]
+                 [funcool/bide "1.2.1"]]
   :plugins [[lein-ancient "0.6.10"]]
   :clean-targets ^{:protect false} ["resources/public/js" "target"]
   )


Added return keyword to js macro

Added return keyword to js macro

--- modules/javascript/javascript.clj
+++ modules/javascript/javascript.clj
@@ -30,4 +30,6 @@
   "Generates javascript code from an sexpr. Currently only handles functions.
   e.g. (js alert \"Hello World\") => \"alert(\"Hello World\");\""
   [name & args]
-  `(str '~name "(" (json-list (list ~@args)) ");"))
+  (if (= name 'return)
+    `(str "return " (js ~@args))
+    `(str '~name "(" (json-list (list ~@args)) ");")))


Removed unused function

Removed unused function


Add missing copyright/license part on colorpicker ns.

--- src/uxbox/ui/colorpicker.cljs
+++ src/uxbox/ui/colorpicker.cljs
@@ -1,3 +1,9 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+
 (ns uxbox.ui.colorpicker
   (:require [sablono.core :as html :refer-macros [html]]
             [rum.core :as rum]


Add area for joystick

Add area for joystick

--- src/re_natal_esp32control_app/views/ble_control.cljs
+++ src/re_natal_esp32control_app/views/ble_control.cljs
@@ -1,5 +1,6 @@
 (ns re-natal-esp32control-app.views.ble-control
-  (:require [reagent.core :as r]
+  (:require [clojure.string :as str]
+            [reagent.core :as r]
             [re-natal-esp32control-app.devices.ble :as ble]
             [re-natal-esp32control-app.views.common :as v.common]
             [re-frame.core :refer [subscribe dispatch dispatch-sync]]))
@@ -41,6 +42,39 @@
       [control-button "back"          {:lb 255 :rb 255}]
       [control-button "back right"    {:lb 255}]]]))

+(defn joystick []
+  [v.common/view
+   [v.common/text "joystick here"]])
+
+(def control-modes
+  [{:id :joystick
+    :name "Joystick"}
+   {:id :tile-buttons
+    :name "Tile Buttons"}])
+
+(defn control-area []
+  (let [control-mode (r/atom (:id (first control-modes)))]
+    (fn []
+      [v.common/view
+       [v.common/view {:style {:flex-direction "row"
+                               :margin-bottom 40}}
+        (doall
+         (for [{:keys [id name]} control-modes
+               :let [selected? (= @control-mode id)]]
+           ^{:key (str :mode-select- id)}
+           [v.common/touchable-highlight
+            {:style {:background-color "#ccc"
+                     :padding 10
+                     :border-width 3
+                     :border-color (if selected? "#666" "#ccc")
+                     :margin 5
+                     :border-radius 5}
+             :on-press #(reset! control-mode id)}
+            [v.common/text name]]))]
+       (case @control-mode
+         :tile-buttons [tile-buttons]
+         [joystick])])))
+
 (defn ble-control-page []
   (let [current-device (subscribe [:get-current-device])
         connected? (r/atom false)]
@@ -57,7 +91,7 @@
              (:name @current-device)]
             [v.common/text (:id @current-device)]]
          (if @connected?
-           [tile-buttons]
+           [control-area]
            [v.common/view {:style {:align-content "center" :align-self "center"}}
             [v.common/text "connecting"]])])
       :component-will-mount (fn []


(SERVER-2550) Process InputStream into ByteArrayStream

The utilities for turning pems into PKI objects cannot handle a basic
input stream. This commit converts the input from the endpoint into a
ByteArrayInputStream, which is handled correctly by the ssl-utils
helpers.

--- src/clj/puppetlabs/services/ca/certificate_authority_core.clj
+++ src/clj/puppetlabs/services/ca/certificate_authority_core.clj
@@ -1,5 +1,5 @@
 (ns puppetlabs.services.ca.certificate-authority-core
-  (:import [java.io InputStream]
+  (:import [java.io InputStream ByteArrayInputStream]
            (clojure.lang IFn)
            (org.joda.time DateTime))
   (:require [puppetlabs.puppetserver.certificate-authority :as ca]
@@ -100,7 +100,10 @@
    {:keys [cacrl cacert enable-infra-crl infra-crl-path]} :- ca/CaSettings]
   (locking crl-write-serializer
     (try
-      (let [incoming-crls (utils/pem->crls incoming-crl-pem)]
+      (let [byte-stream (-> incoming-crl-pem
+                            ca/input-stream->byte-array
+                            ByteArrayInputStream.)
+            incoming-crls (utils/pem->crls byte-stream)]
         (ca/update-crls incoming-crls cacrl cacert)
         (when enable-infra-crl
           (ca/update-crls incoming-crls infra-crl-path cacert)))


Commit often

Commit often

--- slackbot/src/org/teamweek/slackbot.clj
+++ slackbot/src/org/teamweek/slackbot.clj
@@ -141,8 +141,21 @@

 (defn submit-answers [db-conn domain user answers]
   ;; TODO insert into datomic db
-  (prn answers)
-  )
+  (let [db (d/db db-conn)
+        user-eid (d/q '[:find ?member .
+                        :in $ domain user
+                        :where
+                        [?team :team/domain domain]
+                        [?team :team/members ?member]
+                        [?member :member/name ?user]]
+                      db domain user)
+        tx (for [answer answers]
+             {:db/id (d/tempid :db.part/user)
+              :answer/author user-eid
+              :answer/text (:answer answer)
+              :answer/ts (:ts answer)
+              :_question/answers (:question answer)})]
+    @(d/transact db-conn tx)))

 (defjob QuestionnaireJob [{:keys [domain db-conn]}]
   (let [db (d/db db-conn)
@@ -154,18 +167,16 @@
                      [?team :team/members ?member]
                      [?member :member/name ?name]]
                    db domain)
-        questions (d/q '[:find [?text ...]
+        questions (d/q '[:find (pull ?question [:db/id :question/text])
                          :in $ ?domain
                          :where
                          [?team :team/domain ?domain]
-                         [?team :team/questions ?question]
-                         [?question :question/text ?text]]
+                         [?team :team/questions ?question]]
                        db domain)
         conn (when (and token
                         (not-empty users)
                         (not-empty questions))
                (connect token))]
-
     (if conn
       ;; TODO in parallell, but the job is not finished before all has answered/timeout
       (doseq [user users]
@@ -176,10 +187,11 @@
           (println "Users" users)
           (println "Questions" questions)))))

-(defn schedule-questionnaire-job [scheduler domain cron-string]
+(defn schedule-questionnaire-job [scheduler db-conn domain cron-string]
   (let [job (jobs/build
              (jobs/of-type QuestionnaireJob)
-             (jobs/using-job-data {:domain domain})
+             (jobs/using-job-data {:domain domain
+                                   :db-conn db-conn})
              (jobs/with-identity (jobs/key (str "jobs." domain))))
         trigger (triggers/build
                  (triggers/with-identity (triggers/key (str "triggers." domain)))
@@ -188,12 +200,14 @@
                     (cron/cron-schedule cron-string))))]
     (scheduler/schedule scheduler job trigger)))

-(defn init-start-jobs [scheduler db]
-  (doseq [{:keys [domain schedule]} (d/q '[:find (pull ?team [:team/domain :team/schedule])
+(defn init-start-jobs [scheduler db-conn]
+  (doseq [db (d/db db-conn)
+          {:keys [domain schedule]} (d/q '[:find (pull ?team [:team/domain :team/schedule])
                                            :where
                                            [?team :team/domain]]
                                          db)]
     (schedule-questionnaire-job scheduler
+                                db-conn
                                 domain
                                 schedule)))

@@ -242,9 +256,8 @@

 (defn -main [db-uri]
   (let [scheduler (scheduler/start (scheduler/initialize))
-        db-conn (d/connect db-uri)
-        db (d/db db-conn)]
-    (init-start-jobs scheduler db)
+        db-conn (d/connect db-uri)]
+    (init-start-jobs scheduler db-conn)
     (listen-for-team-updates scheduler db-conn)))

 (comment
@@ -300,6 +313,7 @@

   (d/transact db-conn [[:db/add [:team/domain "abc"] :team/schedule "* * F * *"]])

+  (d/pull (d/db db-conn) [:team/domain :team/schedule] [:team/domain "abc"])


[hotfix][tests] Upgrade zookeeper package to 3.4.9-3+deb9u2

--- flink-jepsen/src/jepsen/flink/flink.clj
+++ flink-jepsen/src/jepsen/flink/flink.clj
@@ -36,7 +36,7 @@
 (def default-flink-dist-url "https://archive.apache.org/dist/flink/flink-1.6.0/flink-1.6.0-bin-hadoop28-scala_2.11.tgz")
 (def hadoop-dist-url "https://archive.apache.org/dist/hadoop/common/hadoop-2.8.3/hadoop-2.8.3.tar.gz")
 (def kafka-dist-url "http://mirror.funkfreundelandshut.de/apache/kafka/2.2.0/kafka_2.11-2.2.0.tgz")
-(def deb-zookeeper-package "3.4.9-3+deb9u1")
+(def deb-zookeeper-package "3.4.9-3+deb9u2")
 (def deb-mesos-package "1.5.0-2.0.1")
 (def marathon-dist-url "https://downloads.mesosphere.io/marathon/builds/1.7.189-48bfd6000/marathon-1.7.189-48bfd6000.tgz")


:sparkles: Improve internal error response data structure.

--- backend/src/app/http/errors.clj
+++ backend/src/app/http/errors.clj
@@ -59,7 +59,7 @@
              (with-out-str
                 (.printStackTrace ^Throwable err (java.io.PrintWriter. *out*))))
   {:status 500
-   :body {:type :exception
+   :body {:type :internal-error
           :message (ex-message err)
           :data (ex-data err)}})


Playable game. I've yet to win it.

Playable game. I've yet to win it.

--- pegthing/src/pegthing/core.clj
+++ pegthing/src/pegthing/core.clj
@@ -270,3 +270,29 @@
     (if-let [new-board (make-move board (first input) (second input))]
       (user-entered-valid-move new-board)
       (user-entered-invalid-move board))))
+
+(defn game-over
+  "Announce the game is over and prompt to play again"
+  [board]
+  (let [remaining-pegs (count (filter :pegged (vals board)))]
+    (println "Game over! You had" remaining-pegs "pegs left:")
+    (print-board board)
+    (println "Play again? y/n [y]")
+    (let [input (get-input "y")]
+      (if (= "y" input)
+        (prompt-rows)
+        (do
+          (println "Bye!")
+          (System/exit 0))))))
+
+(defn prompt-empty-peg [board]
+  (println "Here's your board:")
+  (print-board board)
+  (println "Remove which peg? [e]")
+  (prompt-move (remove-peg board (letter->pos (get-input "e")))))
+
+(defn prompt-rows []
+  (println "How many rows? [5]")
+  (let [rows (Integer. (get-input 5))
+        board (new-board rows)]
+    (prompt-empty-peg board)))


Add test case for serving files in root and authenticate acces to them.

--- test/catacumba/core_tests.clj
+++ test/catacumba/core_tests.clj
@@ -357,6 +357,26 @@
                 (is (= (:status data) 404)))))))))
 )

+(deftest routing-1
+  (testing "Serving authenticated assets in root."
+    (letfn [(handler1 [state context]
+              (reset! state 1)
+              "hello world")
+
+            (handler2 [state context]
+              (reset! state 2)
+              (ct/delegate))]
+
+      (let [state (atom 0)
+            app (ct/routes [[:get "api" #(handler1 state %)]
+                            [:scope
+                             [:any #(handler2 state %)]
+                             [:assets nil {:dir "public"}]]])]
+        (with-server {:handler app}
+          (let [response (client/get (str base-url "/test.txt"))]
+            (is (= (:body response) "hello world from test.txt\n"))
+            (is (= (:status response) 200))
+            (is (= 2 @state))))))))

 (deftest context-data-forwarding


Fix PR comments

Fix PR comments

--- boot/worker/src/boot/notify.clj
+++ boot/worker/src/boot/notify.clj
@@ -52,29 +52,26 @@
   [s]
   (= 0 (:exit (sh "sh" "-c" (format "command -v %s" s)))))

-(defmulti -notify
+(defmulti notify-method
   (fn [os _message]
     os))

-(defn notify-default [{:keys [message title]}]
-  (printf "%s: %s" title message))
-
-(defmethod -notify "Mac OS X"
+(defmethod notify-method "Mac OS X"
   [_ {:keys [message title icon pid] :as notification}]
   (if (program-exists? "terminal_notifier")
     (sh "terminal-notifier" "-message" message "-title" title "-contentImage" icon "-group" pid)
-    (notify-default notification)))
+    ((get-method notify-method :default) :default notification)))

-(defmethod -notify "Linux"
+(defmethod notify-method "Linux"
   [_ {:keys [message title icon] :as notification}]
   (if (program-exists? "notify-send")
     (sh "notify-send" title message "--icon" icon)
-    (notify-default notification)))
+    ((get-method notify-method :default) :default notification)))

-(defmethod -notify :default
-  [_ notification]
-  (notify-default notification))
+(defmethod notify-method :default
+  [_ {:keys [message title]}]
+  (printf "%s: %s" title message))

 (defn ^{:boot/from :jeluard/boot-notify} notify!
   [s m]
-  (-notify (System/getProperty "os.name") (assoc m :message s)))
+  (notify-method (System/getProperty "os.name") (assoc m :message s)))


Add sum and diff tests

Add sum and diff tests

--- test/jest/arithmetic_test.clj
+++ test/jest/arithmetic_test.clj
@@ -2,6 +2,17 @@
   (:require [clojure.test :refer :all]
             [jest.utils :refer :all]
             :verbose))
+
+(deftest sum-test-1
+  (test-code
+   "val x = 1 + 2;"
+   ["(def x (+ 1 2))"]))
+
+(deftest sum-test-2
+  (test-code
+   "val x = 1 + 2 + 3;"
+   ["(def x (+ (+ 1 2) 3))"]))
+

 (deftest product-test-1
   (test-code


Refactor: duplication

Refactor: duplication

--- test/layzee/integration/storage/simple_db_examples.clj
+++ test/layzee/integration/storage/simple_db_examples.clj
@@ -6,23 +6,27 @@
             [cemerick.rummage.encoding :as enc]
             [layzee.adapters.settings :refer :all :as settings]))

-(defn- set[amazon-credential key value] ;; https://console.aws.amazon.com/iam/home?region=us-west-2#security_credential
-  (let [client (sdb/create-client (-> amazon-credential :access-key-id) (-> amazon-credential :secret-access-key))]
-    (let [config (assoc enc/keyword-strings :client client)]
-      (sdb/create-domain config "bjb-demo")
-      (sdb/put-attrs config "bjb-demo" {::sdb/id key :name "value" :key value}))))
+;; https://github.com/cemerick/rummage
+(defn- client-for[amazon-credential] (sdb/create-client (-> amazon-credential :access-key-id) (-> amazon-credential :secret-access-key)))
+(defn- config-for[amazon-credential] (assoc enc/keyword-strings :client (client-for amazon-credential)))

-(defn- get[amazon-credential key]
-  (let [client (sdb/create-client (-> amazon-credential :access-key-id) (-> amazon-credential :secret-access-key))]
-    (let [config (assoc enc/keyword-strings :client client)]
-      (sdb/create-domain config "bjb-demo")
-      (-> (sdb/get-attrs config "bjb-demo" key) :key))))
-
+(defn- set[amazon-credential domain key value] ;; https://console.aws.amazon.com/iam/home?region=us-west-2#security_credential
+  (let [config (config-for amazon-credential)]
+    (sdb/put-attrs config domain {::sdb/id key :name "value" :key value})))
+
+(defn- get[amazon-credential domain key]
+  (let [config (config-for amazon-credential)]
+    (-> (sdb/get-attrs config domain key) :key)))
+
 (facts "Basic proof that we can connect"
-       (fact "can write an entry and read it back"
-             (set settings/amazon-credential "Have you ever tried to eat a clock?" "It's very time consuming.")
-             (get settings/amazon-credential "Have you ever tried to eat a clock?") => "It's very time consuming.")
+       (let [domain "test-layzee-web"]
+         (sdb/create-domain (config-for settings/amazon-credential) domain)
+
+         (fact "can write an entry and read it back"
+               (set settings/amazon-credential domain "Have you ever tried to eat a clock?" "It's very time consuming.")
+               (get settings/amazon-credential domain "Have you ever tried to eat a clock?") => "It's very time consuming.")

-       (future-fact "Getting something that does not exist returns nil")
-
-         )+         (future-fact "Getting something that does not exist returns nil")
+         (future-fact "What about when domain does not exist?")
+         (future-fact "You can list and delete domains")
+         ))


Updated the banner.

Updated the banner.

--- test/lambda_blog/fixtures.clj
+++ test/lambda_blog/fixtures.clj
@@ -11,7 +11,7 @@
             [lambda-blog.templates.tags :refer [tags-index]]
             [lambda-blog.parsers.md :refer [parse]]
             [lambda-blog.utils :refer [pathcat]]
-            [s-html.tags :refer [a div img li span ul]]))
+            [s-html.tags :refer [a div h1 img li p span ul]]))

 (defn- navigation [{:keys [archives path-to-root rss static-pages] :as ent}]
   (ul {:class [:nav :navbar-nav]}
@@ -31,12 +31,15 @@
       (li (a {:href (pathcat path-to-root (:path archives))}
              "Archives"))))

-(defn- banner [{:keys [logo path-to-root]}]
-  (row (div {:class [:hidden-xs :col-sm-2 :col-md-1]}
-            (img {:style "height: 150px;"
-                  :src (pathcat path-to-root "media/logo.svg")}))
-       (div {:class [:col-xs-12 :col-sm-8 :col-md-10]}
-            (text-centered "Some banner contents"))))
+(defn- banner [{:keys [logo path-to-root url]}]
+  (row (div {:class [:col-xs-12 :col-sm-8 :col-md-10]}
+            (h1 {:style "font-size: 300%;"}
+                "λ-blog")
+            (p {:style "font-size: 150%;"}
+               "A static blog generator generator optimized for customizability."))
+       (div {:class [:hidden-xs :col-sm-2 :col-md-1 :pull-right]}
+            (img {:style "height: 120px;"
+                  :src (pathcat path-to-root logo)}))))

 (defn- footer [_]
   (text-centered
@@ -54,6 +57,7 @@
            :url "https://idorobots.github.io/lambda-blog/"
            :output-dir "/target/out/"
            :brand-logo "media/logo.svg"
+           :logo "media/logo.svg"
            :favicon "media/logo.svg"
            :banner-template banner
            :navigation-template navigation


added unit test

added unit test

--- test/pe_fp_core/core_test.clj
+++ test/pe_fp_core/core_test.clj
@@ -159,7 +159,8 @@
                               :fplog/car-wash-per-gal-discount 0.08
                               :fplog/num-gallons 14.7
                               :fplog/gallon-price 2.39
-                              :fplog/octane 87})
+                              :fplog/octane 87
+                              :fplog/odometer 15803})
         (let [fplogs (core/fplogs-for-user conn new-user-id-1)]
           (is (= 1 (count fplogs)))
           (let [[fplog-id fplog] (first fplogs)]
@@ -175,7 +176,8 @@
             (is (= 14.7M (:fplog/num-gallons fplog)))
             (is (= 0.08M (:fplog/car-wash-per-gal-discount fplog)))
             (is (= 2.39M (:fplog/gallon-price fplog)))
-            (is (= 87 (:fplog/octane fplog)))))
+            (is (= 87 (:fplog/octane fplog)))
+            (is (= 15803M (:fplog/odometer fplog)))))
         (let [fplogs (core/fplogs-for-fuelstation conn new-fuelstation-id-1)]
           (is (= 1 (count fplogs)))
           (let [[fplog-id fplog] (first fplogs)]


CMR-3797:  Fixed a reference issue.

CMR-3797:  Fixed a reference issue.

--- system-int-test/src/cmr/system_int_test/utils/search_util.clj
+++ system-int-test/src/cmr/system_int_test/utils/search_util.clj
@@ -654,7 +654,8 @@
       ;; Freeze time in test
       (tk/set-time-override! (tu/n->date-time now-n))
       ;; Freeze time on CMR side
-      (side/eval-form `(tk/set-time-override! (tu/n->date-time now-n)))
+      (side/eval-form
+        `(do (require 'cmr.common.test.time-util) (tk/set-time-override! (tu/n->date-time now-n))))
       (f)
       (finally
         ;; Resume time in test


Two db-interface tests: test-status->int and test-dictionary-type->char

--- test/zg/db_interface_test.clj
+++ test/zg/db_interface_test.clj
@@ -11,8 +11,9 @@
 ;

 (ns zg.db-interface-test
-  (:require [clojure.test :refer :all]
-            [zg.db-interface :refer :all]))
+  (:require [clojure.test      :refer :all]
+            [clojure.java.jdbc :as jdbc]
+            [zg.db-interface   :refer :all]))

 ;
 ; Common functions used by tests.
@@ -116,3 +117,23 @@
     (testing "if the zg.db-interface/read-changes-for-user definition exists."
         (is (callable? 'zg.db-interface/read-changes-for-user))))

+;
+; Test function behaviour
+;
+
+(deftest test-status->int
+    "Checking the function status->int."
+    (testing "the function status->int."
+        (are [x y] (= x (status->int y))
+            1 :deleted
+            0 :undeleted
+            0 nil)))
+
+(deftest test-dictionary-type->char
+    "Checking the function dictionary-type->char."
+    (testing "the function dictionary-type->char."
+        (are [x y] (= x (dictionary-type->char y))
+            "w" :whitelist
+            "b" :blacklist
+            "o" :other)))
+


add flash notification for delete code sign success

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -951,8 +951,10 @@
   [target message status {:keys [context]} state]
   (if-not (= (:project-name context) (:project-settings-project-name state))
     state
-    (update-in state state/project-osx-keys-path (partial remove #(and (:id %) ; figure out why we get nil id's
-                                                                       (= (:id context) (:id %)))))))
+    (-> state
+        (update-in state/project-osx-keys-path (partial remove #(and (:id %) ; figure out why we get nil id's
+                                                                     (= (:id context) (:id %)))))
+        (state/add-flash-notification "Your key has been successfully removed."))))

 (defmethod post-api-event! [:delete-code-signing-keys :success]
   [target message status {:keys [context]} previous-state current-state]


Encode redirect and delegate in OAuth state

--- src-cljs/frontend/utils/bitbucket.cljs
+++ src-cljs/frontend/utils/bitbucket.cljs
@@ -9,23 +9,13 @@
   )

 (defn auth-url []
-  (let [;; auth-host and auth-protocol indicate the circle host that
-        ;; will handle the oauth redirect
-        auth-host (aget js/window "renderContext" "auth_host")
-        auth-protocol (aget js/window "renderContext" "auth_protocol")
-        redirect (-> (str auth-protocol "://" auth-host)
-                     (url  "auth/bitbucket")
-                     (assoc :query (merge {"return-to" (str js/window.location.pathname
-                                                            js/window.location.hash)}
-                                          (when (not= auth-host js/window.location.host)
-                                            ;; window.location.protocol includes the colon
-                                            {"delegate" (str js/window.location.protocol "//" js/window.location.host)})))
-                     (assoc :protocol (or (aget js/window "renderContext" "auth_protocol")
-                                          "https"))
-                     str)]
+  (let [state {"return-to" (str js/window.location.pathname
+                                js/window.location.hash)
+               "token" (utils/oauth-csrf-token)
+               "delegate" (str js/window.location.protocol "//" js/window.location.host)}
+        state-str (.stringify js/JSON (clj->js state))]
     (-> (url (http-endpoint) "site/oauth2/authorize")
-        (assoc :query {"redirect_uri" redirect
-                       "state" (utils/oauth-csrf-token)
+        (assoc :query {"state"        state-str
                        "response_type" "code"
                        "client_id" (aget js/window "renderContext" "bitbucketClientId")})
         str)))


Failing tests

Failing tests

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -313,13 +313,18 @@
        :dissoc! (dissoc map (nth action 1))))
    map actions))

+(defn run-the-prop [min-keys actions]
+  (let [tree (apply-to-tree (tree min-keys) actions)
+        sorted-map (apply-to-sorted-map (sorted-map-by #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1)) actions)]
+    (and (= (seq (map vec tree)) (seq sorted-map))
+         (or (empty? tree) (.valid! tree)))))
+
 (defn the-prop [gen]
   (prop/for-all [min-keys gen/s-pos-int
                  actions (gen/vector gen)]
-                (let [tree (apply-to-tree (tree min-keys) actions)
-                      sorted-map (apply-to-sorted-map (sorted-map-by #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1)) actions)]
-                  (and (= (seq (map vec tree)) (seq sorted-map))
-                       (or (empty? tree) (.valid! tree))))))
+                (run-the-prop min-keys actions)))
+
+(apply run-the-prop [1 [[:assoc! 19 0] [:assoc! "" 0] [:assoc! 0 0] [:assoc! 19 0]]])

 ;; (dc/quick-check 100 (the-prop gen-assoc))
 ;; (dc/quick-check 100 (the-prop gen-action))


remove usages of (dag_unify.core/merge)

remove usages of (dag_unify.core/merge)

--- src/babel/engine.cljc
+++ src/babel/engine.cljc
@@ -1,6 +1,6 @@
 ;; TODO: consider moving this code into babel.generate itself.
 (ns babel.engine ^{:doc "API wrapper around babel.generate"}
-  (:refer-clojure :exclude [get-in merge])
+  (:refer-clojure :exclude [get-in])
   (:require
    #?(:clj [clojure.data.json :as json])
    [clojure.string :as string]
@@ -10,7 +10,7 @@
    [babel.generate :as generate]
    #?(:clj [babel.html :refer [tablize]])
    [babel.ug :refer (head-principle)]
-   [dag_unify.core :refer [fail? get-in merge strip-refs unify unifyc]]
+   [dag_unify.core :refer [fail? get-in strip-refs unify unifyc]]
    #?(:clj [hiccup.page :refer [include-css]])
    #?(:clj [hiccup.core :refer [html]])))


CMR-1576: Removed unnecessary comment

CMR-1576: Removed unnecessary comment

--- umm-lib/src/cmr/umm/test/generators/collection.clj
+++ umm-lib/src/cmr/umm/test/generators/collection.clj
@@ -279,8 +279,6 @@
                 :temporal t/temporals
                 :spatial-keywords (ext-gen/nil-if-empty (gen/vector (ext-gen/string-alpha-numeric 1 10) 0 4))
                 :temporal-keywords (ext-gen/nil-if-empty (gen/vector (ext-gen/string-alpha-numeric 1 10) 0 4))
-                ;; DIF requires science-keyowrds to always exist, not ideal here for ECHO10. As science-keywords is optional for ECHO10
-                ; :science-keywords (gen/vector sk/science-keywords 1 3)
                 :science-keywords (ext-gen/nil-if-empty (gen/vector sk/science-keywords 0 3))
                 :platforms (ext-gen/nil-if-empty (gen/vector platforms 0 4))
                 :product-specific-attributes (ext-gen/nil-if-empty (gen/vector psa/product-specific-attributes 0 10))


annotate generated defrecord factory fns with :factory metadata, document :positional or :map

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -894,7 +894,8 @@

 (defn- build-positional-factory
   [rsym rname fields]
-  (let [fn-name (with-meta (symbol (core/str '-> rsym)) (meta rsym))]
+  (let [fn-name (with-meta (symbol (core/str '-> rsym))
+                  (assoc (meta rsym) :factory :positional))]
     `(defn ~fn-name
        [~@fields]
        (new ~rname ~@fields))))
@@ -1003,7 +1004,8 @@
          (extend-type ~tagname ~@(dt->et tagname impls fields true))))))

 (defn- build-map-factory [rsym rname fields]
-  (let [fn-name (symbol (core/str 'map-> rsym))
+  (let [fn-name (with-meta (symbol (core/str 'map-> rsym))
+                  (assoc (meta rsym) :factory :map))
         ms (gensym)
         ks (map keyword fields)
         getters (map (fn [k] `(~k ~ms)) ks)]


more info added to queue urls

more info added to queue urls


Fix creation of mongodb collection if already exists

--- server/src/clinicico/server/store.clj
+++ server/src/clinicico/server/store.clj
@@ -25,15 +25,12 @@
    :db (str (:mongo-db config))
    :collection "statuses"})

-
-(defn- megabytes
-  [^long n]
-  (* n 1024 1024))
-
 (connect! mongo-options)
 (set-db! (get-db (mongo-options :db)))
-(collection/create (mongo-options :collection) {:capped true :size (-> 16 megabytes)})
-(collection/ensure-index (mongo-options :collection) {:modified 1} {:expireAfterSeconds 120})
+(if (not (collection/exists? (mongo-options :collection)))
+  (do
+    (collection/create (mongo-options :collection) {})
+    (collection/ensure-index (mongo-options :collection) {:modified 1} {:expireAfterSeconds 120})))

 (defn retrieve
   [id]


forward options to piggyback correctly

forward options to piggyback correctly

fixes #282

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -126,13 +126,19 @@
     (require 'cemerick.piggieback)
     (let [cljs-repl (resolve 'cemerick.piggieback/cljs-repl)
           special-fns (or (:special-fns opts) cljs.repl/default-special-fns)
-          output-dir (or (:output-dir opts) "out")]
+          output-dir (or (:output-dir opts) "out")
+          opts' (assoc opts
+                       :special-fns special-fns
+                       :output-dir output-dir)]
       (try
         ;; Piggieback version 0.2+
-        (cljs-repl figwheel-env :special-fns special-fns :output-dir output-dir)
+        (apply cljs-repl figwheel-env (apply concat opts'))
         (catch Exception e
           ;; Piggieback version 0.1.5
-          (cljs-repl :repl-env figwheel-env :special-fns special-fns :output-dir output-dir))))
+          (apply cljs-repl
+                 (apply concat
+                        (assoc opts'
+                               :repl-env figwheel-env))))))
     (catch Exception e
       (println "INFO: nREPL connection found but unable to load piggieback. Starting default REPL")
       (start-cljs-repl :default figwheel-env opts))))


lowercase keys in the result.

lowercase keys in the result.

--- clojure/etl/etl.clj
+++ clojure/etl/etl.clj
@@ -1,9 +1,10 @@
 (ns etl
   (:require [clojure.string :as str]))

-(defn- merge-scores [map tiles score]
-  (merge map
-         (zipmap tiles (repeat score))))
+(defn- merge-scores [result tiles score]
+  (merge result
+         (zipmap (map str/lower-case tiles)
+                 (repeat score))))

 (defn transform [defs]
   (loop [
@@ -11,5 +12,4 @@
          acc {}]
     (if more_defs
       (recur more_defs (merge-scores acc tiles score))
-      (merge-scores acc tiles score))
-    ))
+      (merge-scores acc tiles score))))


Revert fixed-arity condition constructors again.

I couldn't figure out a way to make it work in general
for ClojureScript.

--- src/active/clojure/condition.cljc
+++ src/active/clojure/condition.cljc
@@ -267,10 +267,6 @@
                        (partition 2 (first ?field-specs))
                        ;; legacy syntax
                        ?field-specs)
-        ?constructor-params (concat (map (fn [[?field-name _]]
-                                           (gensym ?field-name))
-                                         ?field-pairs)
-                                    (map gensym (:field-names (eval ?supertype))))
         document (fn [n doc]
                    (vary-meta n
                               (fn [m]
@@ -307,11 +303,11 @@
                                                     ?field-pairs))))))
            (->ConditionType '~?condition-type ~?supertype
                             '[~@(map first ?field-pairs)] total-field-count#))
-         (def ~(document-with-arglist ?constructor
-                                      (vec (map first ?field-pairs))
-                                      (str "Construct a " (reference ?condition-type) " condition."))
-           (fn [~@?constructor-params]
-             (make-condition [(->ConditionComponent ~?condition-type (vector ~@?constructor-params))])))
+         (def ~(document ?constructor
+                         (str "Construct a " (reference ?condition-type) " condition."))
+           (fn [& args#]
+             {:pre [(= (count args#) total-field-count#)]}
+             (make-condition [(->ConditionComponent ~?condition-type (vec args#))])))
          (def ~(document-with-arglist ?predicate '[thing]
                                       (str "Is object a " (reference ?condition-type) " condition?"))
            (condition-predicate ~?condition-type))


Fixed weird collapse view bug

Fixed weird collapse view bug

--- src/catalysis/client/datview.cljs
+++ src/catalysis/client/datview.cljs
@@ -349,8 +349,8 @@
 (defn attribute-view
   [conn attr-ident values]
   ;; This is hacky, take out for datview and query...
-  (let [collapsable? true ;; Need to get this to dispatch... XXX
-        collapse-attribute? (r/atom true)
+  (let [collapsable? false ;; Need to get this to dispatch... XXX Or should maybe just default to true for all non-component refs
+        collapse-attribute? (r/atom false)
         values-rx (if (sortable? conn attr-ident)
                     (reaction (map :db/id (sort-by :e/order @(pull-many-rx conn '[:db/id :e/order] values))))
                     (reaction (sort values)))]
@@ -358,18 +358,16 @@
       [re-com/v-box
        :padding "8px"
        :gap "8px"
-       :children
-       [[re-com/h-box
-         :children
-         [(when collapsable?
-            [collapse-button collapse-attribute?])
-          [label-view conn attr-ident]]]
-        (if (and collapsable? @collapse-attribute?)
-          ^{:key 1}
-          [collapse-summary conn attr-ident values]
-          (for [value @values]
-            ^{:key (hash {:component :attribute-view :value value})}
-            [value-view conn attr-ident value]))]])))
+       :children [[re-com/h-box
+                   :children [(when collapsable?
+                                [collapse-button collapse-attribute?])
+                              [label-view conn attr-ident]]]
+                  (if (and collapsable? @collapse-attribute?)
+                    ^{:key 1}
+                    [collapse-summary conn attr-ident values]
+                    (for [value @values-rx]
+                      ^{:key (hash {:component :attribute-view :value value})}
+                      [value-view conn attr-ident value]))]])))

 ;; The following several functions are for splitting up attributes; this approach feels rather flawed.


Emphasize built-in threadpool

Emphasize built-in threadpool

--- src/clj/com/climate/claypoole.clj
+++ src/clj/com/climate/claypoole.clj
@@ -239,8 +239,9 @@

   The threadpool may be one of 3 things:
     1. An ExecutorService, e.g. one created by threadpool.
-    2. The keyword :builtin. In this case, the future will use the same
-       threadpool as an ordinary clojure.core/future.
+    2. The keyword :builtin. In this case, the future will use the built-in
+       agent threadpool, the same threadpool used by an ordinary
+       clojure.core/future.
     3. The keyword :serial. In this case, the computation will be performed in
        serial. This may be helpful during profiling, for example.
   "
@@ -279,8 +280,9 @@

   The threadpool may be one of 3 things:
     1. An ExecutorService, e.g. one created by threadpool.
-    2. The keyword :builtin. In this case, the future will use the same
-       threadpool as an ordinary clojure.core/future.
+    2. The keyword :builtin. In this case, the future will use the built-in
+       agent threadpool, the same threadpool used by an ordinary
+       clojure.core/future.
     3. The keyword :serial. In this case, the computation will be performed in
        serial. This may be helpful during profiling, for example.
   "