Use text returned from server to draw a bar chart using basic SVG stuff (for now)

--- src/cljs/om_sente/core.cljs
+++ src/cljs/om_sente/core.cljs
@@ -51,13 +51,45 @@
                                   :onChange #(field-change % owner :text)
                                   :onKeyPress #(send-text-on-enter % owner state)}))))

+(defn chart-bar
+  "Bar chart component."
+  [app owner opts]
+  (reify
+    om/IRender
+    (render [this]
+            (println opts)
+            (dom/rect #js {:fill (:color opts) :width (:width opts) :height (:height opts)
+                                 :x (:offset opts) :y (- (:available opts) (:height opts))}))))
+
+(defn make-color
+  "Given a value (height) make a color for it."
+  [v]
+  (str "#"
+       (when (< v 16) "f")
+       (.toString v 16)
+       "80"
+       (when (< (- 255 v) 16) "f")
+       (.toString (- 255 v) 16)))
+
 (defn data-view
   "Component that displays the data (text) returned by the server after processing."
   [app owner]
   (reify
     om/IRender
     (render [this]
-            (dom/div nil (:data/text app)))))
+            (dom/div nil
+                     (dom/p nil (str "The string " (:data/text app) " represented as a bar chart:"))
+                     (let [data (map #(.charCodeAt %) (:data/text app))]
+                       (println data)
+                       (apply dom/svg #js {:id "display" :width 960 :height 500}
+                              (map (fn [v o]
+                                     (println v o)
+                                     (let [c (make-color v)]
+                                       (om/build chart-bar app
+                                                 {:opts {:width 20 :height (* 3 v) :color c
+                                                         :available 500 :offset (* 20 o)}})))
+                                   data
+                                   (range))))))))

 (defmulti handle-event
   "Handle events based on the event ID."


Ideas

Ideas

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -134,7 +134,7 @@
           (mapcat #(available-moves-at board %)))
         #(update-in %1 [(:winner %2) (:move %2)] conj %2)
         {}
-        all-positions)}
+        all-positions)} ;; TODO - To optimize, just consider the move of the current player?
      )))


(maint) Fix incorrect indentation from merge-up

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -468,8 +468,8 @@
               command-chan (async/chan
                             (queue/sorted-command-buffer
                              (:max-enqueued developer)
-                          (fn [cmd ver] (cmd/update-counter! :invalidated cmd ver inc!))
-                          (fn [cmd ver] (cmd/update-counter! :ignored cmd ver inc!))))
+                             (fn [cmd ver] (cmd/update-counter! :invalidated cmd ver inc!))
+                             (fn [cmd ver] (cmd/update-counter! :ignored cmd ver inc!))))
               [q load-messages] (queue/create-or-open-stockpile (conf/stockpile-dir config)
                                                                 maybe-send-cmd-event!
                                                                 cmd-event-ch)


Pick random unit for random monitor temperature

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -316,11 +316,13 @@
         (= units :MPa)
         ((convert-units-f :kPa :MPa) (typical-monitor-pressure :kPa))))

-(defn typical-monitor-temperature [units]
-  (cond (= units :C)
-        (value-from-typical-range 50 80)
-        (= units :F)
-        ((convert-units-f :C :F) (typical-monitor-temperature :C))))
+(defn typical-monitor-temperature
+  ([] (let [units (rand-nth [:C :F])]
+        (typical-monitor-temperature units)))
+  ([units] (cond (= units :C)
+                 (value-from-typical-range 50 80)
+                 (= units :F)
+                 ((convert-units-f :C :F) (typical-monitor-temperature :C)))))

 (defn typical-surface-treating-pressure [units]
   (cond (= units :psi)


whitespace

whitespace

--- src/es.clj
+++ src/es.clj
@@ -54,4 +54,3 @@
                           (map (fn [key]
                                  (get root-verbs key))
                                (sort (keys root-verbs)))))))))
-


Add default view-box to library icons.

Add default view-box to library icons.


fixed typo

fixed typo

--- src/ctia/import/threatgrid.clj
+++ src/ctia/import/threatgrid.clj
@@ -72,7 +72,7 @@
     :default false]
    ["-v" "--verbose" "Turn on info logging"
     :default false]
-   [nil "--ctiaURL" "CTIA URL"
+   [nil "--ctia URL" "CTIA URL"
     :default "http://localhost:3000"]])

 (defn -main [& args]


Use conventional keyword to setter transformer in default atttributes handler

--- src/clojure/neko/ui.clj
+++ src/clojure/neko/ui.clj
@@ -12,7 +12,7 @@
 (ns neko.ui
   "Tools for defining and manipulating Android UI elements."
   (:use [neko.context :only [context]]
-        [neko.-utils :only [capitalize]]
+        [neko.-utils :only [capitalize keyword->setter]]
         [neko.listeners.view :only [on-click-call]])
   (:require [neko.ui.mapping :as kw])
   (:import [android.widget LinearLayout$LayoutParams]
@@ -117,7 +117,7 @@
   [el-type obj attributes]
   (map (fn [[attr value]]
          (let [real-value (kw/value el-type value)]
-           `(~(symbol (str ".set" (capitalize (name attr)))) ~obj ~real-value)))
+           `(~(keyword->setter attr) ~obj ~real-value)))
        attributes))

 (defn process-attributes


remove debugging println

remove debugging println

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -551,7 +551,7 @@
 (defn show-image [display tagged-img]
   (let [myTaggedImage (make-TaggedImage tagged-img)
         cache (.getImageCache display)]
-    (println (.pix myTaggedImage))
+    ;(println (.pix myTaggedImage))
     (.putImage cache myTaggedImage)
      (.showImage display myTaggedImage)
      (when-not false ;; (.isVisible display)


debug state

debug state

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -284,6 +284,7 @@
                  :last-z-position (get-z-stage-position (. mmc getFocusDevice))})]
     (let [acq-seq (generate-acq-sequence settings)]
        (def acq-sequence acq-seq)
+       (def last-state state)
        (execute (mapcat #(make-event-fns % out-queue) acq-seq))
        (. mmc setAutoShutter (@state :init-auto-shutter)))))


CMR-2306 typo

CMR-2306 typo

--- dev-system/project.clj
+++ dev-system/project.clj
@@ -86,7 +86,7 @@
                       :source-paths ["src" "dev" "test"]
                       :injections [(require 'pjstadig.humane-test-output)
                                    (pjstadig.humane-test-output/activate!)]}
-   ;; This is to seperate the dependencies from the dev-config specified in profiles.clj
+   ;; This is to separate the dependencies from the dev-config specified in profiles.clj
    :dev [:dev-dependencies :dev-config]
    :uberjar {:main cmr.dev-system.runner
              ;; See http://stephen.genoprime.com/2013/11/14/uberjar-with-titan-dependency.html


Fix unique mapping for gen test.

Fix unique mapping for gen test.

--- test/onyx/generative/apply_fn_gen_test.clj
+++ test/onyx/generative/apply_fn_gen_test.clj
@@ -7,7 +7,8 @@
             [com.gfredericks.test.chuck.clojure-test :refer [checking]]
             [onyx.peer.transform :as t]
             [onyx.peer.task-lifecycle :refer [persistent-results!]]
-            [onyx.api]))
+            [onyx.api])
+  (:import [java.util UUID]))

 (defn gen-segment []
   (gen/hash-map :message (gen/map gen/any gen/any)))
@@ -42,7 +43,15 @@
   (checking
    "It generalizes with a bigger batch size for single returns"
    (times 20)
-   [input (gen/vector (gen-segment))
+   ;; Uses a unique mapping of keys to values to look up an
+   ;; input for an output with no collisions.
+   [input (gen/vector (gen/hash-map
+                       :message
+                       (gen/not-empty
+                        (gen/map
+                         (gen/fmap (fn [v] (UUID/randomUUID))
+                                   (gen/tuple))
+                         gen/any))))
     output (gen/vector (gen/map gen/any gen/any)
                        (count input))]
    (let [mapping (zipmap (map :message input) output)


Brought index-test up to speed with the new divvydata api

--- test/org/gensym/viddy/web/webcore_test.clj
+++ test/org/gensym/viddy/web/webcore_test.clj
@@ -62,10 +62,7 @@

 (deftest index-tests
-  (let [datasource (reify divvy/DivvyData
-                       (station-info [datasource station-id] {})
-                       (station-updates [datasource station-id] [])
-                       (current-stations [datasource] []))
+  (let [datasource (make-datasource {})
         rfn (webcore/router datasource)]

     (testing "Should return a result"


derp image

derp image

--- clojure/src/dnd/showScreen.cljs
+++ clojure/src/dnd/showScreen.cljs
@@ -156,7 +156,12 @@
   (.moveTo term 0 (inc height)
            (if error
              "oh crap!"
-             (str "you stare at " (.-selectedText response)))))
+             (str "you stare at " (.-selectedText response)))
+           )
+   ;(.moveTo term 0 0
+      ;(.drawImage term "" #js {:shrink #js {:width 100 :height 150}}))
+  )
+

 (defn show-inventory [term character]
   (let [descriptions (->> @character :inventory (map :colorful-description))


remove java!

remove java!

--- clojure/src/yatzy_clj/yatzy.clj
+++ clojure/src/yatzy_clj/yatzy.clj
@@ -95,17 +95,6 @@
                  )]
     (if (= nil result) 0 result)))

-;int score = 0;
-;for (int i = 0; i < 6; i += 1)
-;         if (counts[6-i-1] >= 2) {
-;                n++;
-;                score += (6-i);
-;         }
-;if (n == 2)
-;  return score * 2;
-;else
-;  return 0;
-
 (defn two-pair [dice]
   (let [counts (tally-die dice)
         values (remove nil?
@@ -124,17 +113,6 @@
       )
     )
   )
-
-
-
-;(defn two-pair [dice]
-;  (let [tallies (tally-die dice)
-;        result (->> (range 0 6)
-;                    (filter #(>= (nth tallies (- 6 % 1)) 2))
-;                    (map #(- 6 %))
-;                    (reduce +)
-;                    (* 2))]
-;    (if (= nil result) 0 result)))

 (defn four-of-a-kind [dice]
   (let [tallies (tally-die dice)


More like java one

More like java one

--- clojure/src/yatzy_clj/yatzy.clj
+++ clojure/src/yatzy_clj/yatzy.clj
@@ -168,32 +168,30 @@
       0)))

 (defn full-house [dice]
-  (let [tallies (tally-die dice)]
-    (+
-      (let [result (first
-                     (remove nil?
-                             (for [at (range 0 6)]
-                               (if (>= (nth tallies (- 6 at 1)) 2)
-                                 (* (- 6 at) 2)
-                                 nil
-                                 )
-                               )
-                             )
-                     )]
-        (if (= nil result) 0 result))
-      (let [result (first
-                     (remove nil?
-                             (for [i (range 0 6)]
-                               (if (>= (nth tallies i) 3)
-                                 (* (+ i 1) 3)
-                                 nil
-                                 )
-                               )
-                             ))]
-        (if (= nil result)
-          0 result
-          )
-        )
-      )
+  (let [tallies (tally-die dice)
+        _2_at (first
+                (remove nil?
+                        (for [i (range 0 6)]
+                          (if (= (nth tallies i) 2)
+                            (+ i 1)
+                            nil
+                            )
+                          )
+                        )
+                )
+
+        _3_at (first
+                (remove nil?
+                        (for [i (range 0 6)]
+                          (if (= (nth tallies i) 3)
+                            (+ i 1)
+                            nil
+                            )
+                          )
+                        ))]
+
+    (if (and (not (= nil _2_at)) (not (= nil _3_at)))
+      (+ (* _2_at 2) (* _3_at 3))
+      0)
     )
   )


Another assertion.

Another assertion.

--- test/onyx/coordinator/concurrent_task_test.clj
+++ test/onyx/coordinator/concurrent_task_test.clj
@@ -69,7 +69,14 @@
             (let [query '[:find (count ?peer) :where
                           [?peer :peer/status :idle]]
                   result (or (ffirst (d/q query db)) 0)]
-              (is (zero? result)))))))
+              (is (zero? result))))
+
+          (testing ":inc has two active peers"
+            (let [query '[:find (count ?peer) :where
+                          [?peer :peer/task ?task]
+                          [?task :task/name :inc]]
+                  result (ffirst (d/q query db))]
+              (is (= result 2)))))))
     {:eviction-delay 50000}))

 (run-tests 'onyx.coordinator.concurrent-task-test)


Test DESCRIBE query syntax

Test DESCRIBE query syntax

--- test/rdf_path_examples/examples_test.clj
+++ test/rdf_path_examples/examples_test.clj
@@ -36,6 +36,14 @@
                                   :limit (:limit configuration)))]
     (valid-sparql-query? query)))

+(defn- generate-path-iris
+  "Generates random path IRIs."
+  []
+  (-> (gen/fmap (partial str "https://w3id.org/lodsight/rdf-path/") gen/uuid)
+      (gen/list-distinct {:num-elements (inc (rand-int 10))})
+      (gen/sample 1)
+      first))
+
 (deftest preprocess-path
   (is (valid-sparql-query? (util/resource->string "sparql/extract_path.rq"))
       "SPARQL query for extracting paths is syntactically valid.")
@@ -68,12 +76,13 @@
          "date_ranges.ttl" 938908800
          "decimal_ranges.ttl" 949.56)))

+(deftest describe-paths
+  (let [query (render-file "sparql/templates/describe_paths.mustache" {:paths (generate-path-iris)})]
+    (is (valid-sparql-query? query)
+        "SPARQL query for retrieving path descriptions is syntactically valid.")))
+
 (deftest retrieve-chosen-paths
-  (let [paths (-> (gen/fmap (partial str "https://w3id.org/lodsight/rdf-path/") gen/uuid)
-                  (gen/list-distinct {:num-elements (inc (rand-int 10))})
-                  (gen/sample 1)
-                  first)
-        query (render-file "sparql/templates/path_node_labels.mustache" {:paths paths})]
+  (let [query (render-file "sparql/templates/path_node_labels.mustache" {:paths (generate-path-iris)})]
     (is (valid-sparql-query? query)
         "SPARQL query for extracting node labels is syntactically valid.")))


Test query for retrieving node labels

Test query for retrieving node labels

--- test/rdf_path_examples/examples_test.clj
+++ test/rdf_path_examples/examples_test.clj
@@ -4,9 +4,10 @@
             [rdf-path-examples.util :as util]
             [rdf-path-examples.sparql :as sparql]
             [stencil.core :refer [render-file]]
-            [clojure.tools.logging :as log]
             [clojure.test :refer :all]
-            [clojure.java.io :as io])
+            [clojure.test.check.generators :as gen]
+            [clojure.java.io :as io]
+            [clojure.tools.logging :as log])
   (:import [org.apache.jena.query QueryFactory QueryParseException]))

 (def valid-path (rdf/json-ld->rdf-model (util/resource->input-stream "valid_path.jsonld")))
@@ -67,9 +68,14 @@
          "date_ranges.ttl" 938908800
          "decimal_ranges.ttl" 949.56)))

-(deftest extract-examples
-  (let [random-examples (rdf/json-ld->rdf-model (util/resource->input-stream "random_examples.jsonld"))
-        examples-map (examples/extract-examples random-examples)]))
+(deftest retrieve-chosen-paths
+  (let [paths (-> (gen/fmap (partial str "https://w3id.org/lodsight/rdf-path/") gen/uuid)
+                  (gen/list-distinct {:num-elements (inc (rand-int 10))})
+                  (gen/sample 1)
+                  first)
+        query (render-file "sparql/templates/path_node_labels.mustache" {:paths paths})]
+    (is (valid-sparql-query? query)
+        "SPARQL query for extracting node labels is syntactically valid.")))

 (deftest random-selection
   (testing "Random selection generates a syntatically valid SPARQL query."


Wire up bootstrapping a head

Wire up bootstrapping a head

--- src/doctopus/doctopus/head.clj
+++ src/doctopus/doctopus/head.clj
@@ -1,11 +1,23 @@
-(ns doctopus.doctopus.head)
+(ns doctopus.doctopus.head
+  (:require [clojure.edn :as edn]
+            [me.raynes.fs :as fs]
+            [doctopus.doctopus.tentacle :refer [map->Tentacle]]))

 ;; Head
 (defprotocol HeadMethods
+  (bootstrap-tentacles [this root])
   (list-tentacles [this]))

 (defrecord Head
-    [tentacles]
+    [name]
   HeadMethods
+  (bootstrap-tentacles [this root]
+    (let [tentacles-root (binding [fs/*cwd* root] (fs/file (:name this)))
+          tentacle-files (fs/list-dir tentacles-root)
+          tentacle-configs (for [tf tentacle-files
+                                 :let [strang (slurp tf)]]
+                             (edn/read-string strang))
+          tentacles (map #(map->Tentacle %) tentacle-configs)]
+      (assoc this :tentacles tentacles)))
   (list-tentacles [this] (:tentacles this)))


Update deps

Update deps

Former-commit-id: 39c0f85294c51c6e93d187ea8ebe62916a70a754

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,6 +1,5 @@
 (defproject planck "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.28"]
-                 [tailrecursion/cljson "1.0.7"]
-                 [org.omcljs/ambly "0.6.0"]]
+                 [org.clojure/clojurescript "1.7.48"]
+                 [tailrecursion/cljson "1.0.7"]]
   :clean-targets ["out" "target"])


Renamed ts to ss-ts and param cleanup.

Renamed ts to ss-ts and param cleanup.


ply -> ply.core

ply -> ply.core


MMT-1038 MMT-458 update preview gem commit

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "0211841"))
+      "6b51c3fc0ae"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


MMT-1358: Update Preview Gem

MMT-1358: Update Preview Gem

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "487bb407418"))
+      "acffcfadc5e"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


Add code for retractions (untested)

Add code for retractions (untested)


Connection pool is stored to atom field in record


Added docstrings to the lambda-blog.middleware namespace.

--- src/lambda_blog/middleware.clj
+++ src/lambda_blog/middleware.clj
@@ -1,4 +1,5 @@
 (ns lambda-blog.middleware
+  "Various entity transformers used in the generation pipelines."
   (:refer-clojure :exclude [replace])
   (:require [clojure.pprint :refer [pprint]]
             [clojure.set :refer [union]]
@@ -24,21 +25,27 @@
        (times "../")
        (apply str)))

-(defn add-paths [path-spec]
+(defn add-paths
+  "Returns a middleware function that adds paths to an `entity` based on `path-spec`. `path-spec` can use various `entity` keys by naming them in angle brackets (i.e. `\"posts/<year>/<month>/<title>.html\"`). Each key is stringified and [[lambda-blog.utils/sanitize]]d before including in the path."
+  [path-spec]
   (fn [entity]
     (let [p (fmt path-spec entity)]
       (assoc entity
              :path-to-root (path-to-root path-spec)
              :path (pathcat p)))))

-(defn collect-tags [{:keys [entries] :as ent}]
+(defn collect-tags
+  "Collects unique `tags` from each of the `entries` in the `ent`ity. Returns `ent`ity with collected tags stored under `tags`."
+  [{:keys [entries] :as ent}]
   (->> entries
        (map :tags)
        (apply union)
        (into #{})
        (assoc ent :tags)))

-(defn link [es]
+(defn link
+  "Links all entities in `es` by adding `:previous` and `:next` keys containing respective entities to each of them."
+  [es]
   (map (fn [prev curr next]
          (assoc curr
                 :previous prev
@@ -47,13 +54,17 @@
        es
        (concat (next es) '(nil))))

-(defn promote [what]
+(defn promote
+  "Returns a middleware function that promotes all subkeys of a map under `what` key of an `entity` into the `entity`."
+  [what]
   (fn [entity]
     (reduce (fn [e [k v]]
               (assoc e k v))
             entity
             (entity what))))

-(defn inspect [entity]
+(defn inspect
+  "Pretty prints an `entity` for debugging purposes. Returns unmodified `entity`."
+  [entity]
   (log/debug (with-out-str (pprint entity)))
   entity)


Use new onyx version / lib-onyx

Use new onyx version / lib-onyx

--- src/leiningen/new/onyx_app.clj
+++ src/leiningen/new/onyx_app.clj
@@ -37,8 +37,8 @@
         data {:name name
               ;; The formatting here matters
               :onyx-version "0.9"
-              :onyx-version-post ".9"
-              :lib-onyx-minor "0.1"
+              :onyx-version-post ".10"
+              :lib-onyx-minor "10.0"
               :app-name name
               :app-name-underscore (clojure.string/replace name #"-" "_")
               :sanitized path


OrgGroupMembership has organization_group_id

[#145811513]


Doc string changes

Doc string changes

--- src/main/clojure/gpio/core.clj
+++ src/main/clojure/gpio/core.clj
@@ -81,11 +81,11 @@
   (set-direction! [port direction] "Sets the direction of this port: in or out.")
   (set-active-low! [port active-low?] "Invert the logic of the value pin for both reading and writing so that a high == 0 and low == 1. ")
   (read-value [port] "Return the value of the port")
-  (write-value! [port value] "Writes the value to the port.  The value may be specified as :high, :low (and symbol or string variations), \1, \0, or 1, 0"))
+  (write-value! [port value] "Writes the value to the port.  The value may be specified as `:high`, `:low` (and symbol or string variations), \1, \0, or 1, 0"))

 (defprotocol GpioChannelProvider
   (set-edge! [providor setting])
-  (create-edge-channel [port] "Returns a core async channel on which events will be put")
+  (create-edge-channel [port] "Returns a core.async channel on which events will be put")
   (release-edge-channel! [port channel]))

 (defn- value-file [port]
@@ -97,14 +97,14 @@
 (defn open-port
   "Opens a port from which values may be read or written.
   Args:
-  * port - the gpio pin number
-  * opts: a map of optional properts
-      * :direction - sets the initial direction
-      * :active-low? - sets the port as \"active low\", value true or false
-      * :initial-value - sets the intitial value of the pin.
-      * :digital-result-format - describes the format for digital values on read
-          This can be one of #{:keyword :symbol }
-      * :from-raw-fn - a converter function, which takes the `char`
+  * `port` - the gpio pin number
+  * opts: optional keyword args
+      * `:direction` - sets the initial direction
+      * `:active-low?` - sets the port as \"active low\", value true or false
+      * `:initial-value` - sets the intitial value of the pin.
+      * `:digital-result-format` - describes the format for digital values on read
+          This can be one of `#{:keyword :symbol :integer :boolean :char}`
+      * `:from-raw-fn` - a converter function, which takes the `char`
           value (\1 or \0) read and converts it into a meaningful value.
           Overrides the default formatter"
   [port & opts]
@@ -170,9 +170,9 @@
 (defn open-channel-port
   "Opens a port which can be used for listening to value changes.  In addition to the
   options map for [[open-port]], the following are available:
-  * :event-buffer-size - the size of the change events buffer.  Defaults to 1
-  * :timeout - sets a timeout for the OS polling wait time.  Defaults to -1, which waits indefinitely
-  * :edge - sets the edge value- :rising, :falling, or :both"
+  * `:event-buffer-size` - the size of the change events buffer.  Defaults to 1
+  * `:timeout` - sets a timeout for the OS polling wait time.  Defaults to -1, which waits indefinitely
+  * `:edge` - sets the edge value- `:rising`, `:falling`, or `:both`"
   [port & opts]
   (let [{:keys [event-buffer-size timeout edge]
          :or {event-buffer-size 1, timeout -1}} opts


adds delay while sending chunked requests in integration test (#1464)

--- waiter/integration/waiter/basic_test.clj
+++ waiter/integration/waiter/basic_test.clj
@@ -228,7 +228,7 @@
               (is (str/includes? (str (get headers "server")) "Python"))))))

       (testing "content headers"
-        (let [request-length 100000
+        (let [request-length 120000
               long-request (apply str (repeat request-length "a"))]

           (testing "unchunked request"
@@ -247,7 +247,7 @@
                                  waiter-url
                                  request-headers
                                  :path "/request-info"
-                                 :body (make-chunked-body long-request 4096 20))
+                                 :body (make-chunked-body long-request 16384 200))
                   chunked-body-str (str (:body chunked-resp))
                   chunked-body-json (try-parse-json chunked-body-str)]
               (is (= request-length (get-in chunked-body-json ["request-length"])) chunked-body-str)


compile has the source and not using source-logging-push-back-reader

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -360,9 +360,7 @@
                               {src (:source-map smd)}
                               {:lines (+ (:gen-line smd) 3)
                                :file (str "repl-" t ".js")
-                               :sources-content [(or (:source (meta form))
-                                                     ;; handle strings / primitives without metadata
-                                                     (with-out-str (pr form)))]})
+                               :sources-content [source]})
                             true)))))
                (cb (.toString sb))))))))))


CMR-2482: Added ingest event handling for tag-association concept.

--- metadata-db-app/src/cmr/metadata_db/config.clj
+++ metadata-db-app/src/cmr/metadata_db/config.clj
@@ -51,6 +51,7 @@
   {:granule ingest-exchange-name
    :collection ingest-exchange-name
    :tag ingest-exchange-name
+   :tag-association ingest-exchange-name
    ;; Add service when we add service indexing
    :service nil
    :access-group access-control-exchange-name})


Fix constraints of «extents» and «intents» in docstring

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -418,7 +418,7 @@
   (attribute-derivation ctx (object-derivation ctx set-of-objects)))

 (defn extents
-  "Computes a sequence of all extents of ctx."
+  "Computes a sequence of all extents of ctx, in a lectic order."
   [ctx]
   (all-closed-sets (objects ctx) (partial context-object-closure ctx)))

@@ -428,7 +428,7 @@
   (object-derivation ctx (attribute-derivation ctx set-of-attributes)))

 (defn intents
-  "Computes a sequence of all intents of ctx."
+  "Computes a sequence of all intents of ctx, in a lectic order."
   [ctx]
   (all-closed-sets (attributes ctx) (partial context-attribute-closure ctx)))


this change was causing a weird exception in nimbus, reverting it.

--- src/clj/backtype/storm/daemon/common.clj
+++ src/clj/backtype/storm/daemon/common.clj
@@ -239,7 +239,7 @@
   (->> (get storm-conf TOPOLOGY-METRICS-CONSUMER-REGISTER)
        (map #(get % "class"))
        (number-duplicates)
-       (map #(str Constants/METRICS_COMPONENT_ID_PREFIX "_" %))))
+       (map #(str Constants/METRICS_COMPONENT_ID_PREFIX %))))

 (defn metrics-consumer-bolt-specs [components-ids-that-emit-metrics storm-conf]
   (let [inputs (->> (for [comp-id components-ids-that-emit-metrics]


make sure no transition case returns nil

--- src/clj/backtype/storm/daemon/nimbus.clj
+++ src/clj/backtype/storm/daemon/nimbus.clj
@@ -94,6 +94,12 @@
     (reassign-topology nimbus storm-id)
     nil
     ))
+
+;; there's a minor problem where rebalancing is scheduled over and over until it finally happens
+;; can fix this by either:
+;; 1. detecting whether it's scheduled or not...
+;; 2. not using monitor event, but rather some sort of "on startup" event
+;; 3. generating a "rebalance id" and only rebalancing if current status has that id

 (defn state-transitions [nimbus storm-id status]
   {:active {:monitor (reassign-transition nimbus storm-id)
@@ -150,7 +156,7 @@
                                               " storm-id: " storm-id)]
                                  (if error-on-no-transition?
                                    (throw-runtime msg)
-                                   (log-message msg)
+                                   (do (log-message msg) nil)
                                    ))))
                  transition (-> (state-transitions nimbus storm-id status)
                                 (get (:type status))


Create github issue in for dummy users.

Create github issue in for dummy users.

--- src/clj/hatnik/web/server/dummy_data.clj
+++ src/clj/hatnik/web/server/dummy_data.clj
@@ -11,7 +11,14 @@
                                     :subject "{{library}} {{version}} released"
                                     :body "Hey {{library}} released. New version {{VERSION}}."
                                     :library "com.nbeloglazov/hatnik-test-lib"
-                                    :last-processed-version "0.0.9"})))
+                                    :last-processed-version "0.0.9"})
+    (stg/create-action! db user-id {:project-id proj-id
+                                    :type "github-issue"
+                                    :repo "nbeloglazov/hatnik"
+                                    :title "{{library}} {{version}} released"
+                                    :body "Hey ho. {{library}} {{version}}, was {{previous-version}}."
+                                    :library "org.clojure/clojure"
+                                    :last-processed-version "1.6.0"})))

 (defn create-quil-project [db user-id]
   (let [proj-id (stg/create-project! db {:name "Quil"


Probably fix issue with chart tooltip label disappearing when building production cljsbuild

--- src/cljs/my_money/components/charts.cljs
+++ src/cljs/my_money/components/charts.cljs
@@ -18,7 +18,10 @@
     (sort-by :date < (reduce date-sum [] dates))))

 (defn- moneyfy-y-label [tooltip]
-  (str (.-yLabel tooltip) "€"))
+  (-> tooltip
+      js->clj
+      (get "yLabel")
+      (str "€")))

 (defn chart [events-to-show starting-amount all-events]
   (let [collapsed? (r/atom false)]


More navbar styles to tailwind, collapsing of the contents while on mobile removed for now

--- src/cljs/my_money/components/navbar.cljs
+++ src/cljs/my_money/components/navbar.cljs
@@ -49,12 +49,13 @@

 (defn navbar [e!]
   (r/with-let [collapsed? (r/atom true)]
-    [:nav.navbar-expand-lg.navbar-dark.mb-2.relative.flex.items-center.px-4.py-2.bg-black.bg-opacity-75
+    [:nav.mb-2.relative.flex.md:flex-row.md:flex-nowrap.md:justify-start.items-center.px-4.py-2.bg-black.bg-opacity-75
      [:a.text-white.inline-block.whitespace-nowrap.text-lg.mr-4 {:href "#"} "my-money"]
-     [:button.navbar-toggler {:type "button"
+     #_[:button.navbar-toggler {:type "button"
                               :on-click #(swap! collapsed? not)}
       [:span.navbar-toggler-icon]]
-     [:div.collapse.navbar-collapse
+     ;; TODO: Reimplement .collapse class
+     [:div.flex.flex-auto
       (when-not @collapsed? {:class "show"})
       [:ul.flex.pl-0.mb-0.list-none
        (when (session/get :identity)


Fixed bug in uniform-instruction-mutation (would never mutate).

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -118,8 +118,8 @@
                                 (:instruction (first (random-plush-genome 1 atom-generators argmap)))))
         token-mutator (fn [token]
                         (if (< (lrand) uniform-mutation-rate)
-                          (instruction-mutator token))
-                        token)
+                          (instruction-mutator token)
+                          token))
         new-genome (map token-mutator (:genome ind))]
     (make-individual :genome new-genome
                      :history (:history ind)


Consolidate build deps uninstallation command

--- src/docker_clojure/dockerfile/shared.clj
+++ src/docker_clojure/dockerfile/shared.clj
@@ -39,8 +39,7 @@
     (when (seq deps)
       (case distro
         ("slim-buster" "buster")
-        [(str/join " " (concat ["apt-get remove -y --purge"] deps))
-         "apt-get autoremove -y"]
+        [(str/join " " (concat ["apt-get purge -y --auto-remove"] deps))]

         "alpine"
         [(str/join " " (concat ["apk del"] deps))]


Update to ClojureScript 1.7.170

Update to ClojureScript 1.7.170

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,6 +1,6 @@
 (defproject planck "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.166"]
+                 [org.clojure/clojurescript "1.7.170"]
                  [tailrecursion/cljson "1.0.7"]
                  [com.cognitect/transit-clj "0.8.275"]
                  [com.cognitect/transit-cljs "0.8.220"]]


corrected indents in initialize.clj

corrected indents in initialize.clj

--- src/lcmap/clownfish/setup/initialize.clj
+++ src/lcmap/clownfish/setup/initialize.clj
@@ -21,10 +21,10 @@

  If run from the repl, this will create whatever cassandra schema is provided
  in dev/resources/schema.setup.cql, and whatever rabbitmq exchanges, queues and
- bindings are contained in dev/resources/rabbit-setup.edn.
+ bindings are contained in dev/resources/rabbit.setup.edn.

  If run from the test profile the same holds true except the file path is
- test/resources/schema.setup.cql and test/resources/rabbit-setup.edn.
+ test/resources/schema.setup.cql and test/resources/rabbit.setup.edn.

  (start), (stop) and (bounce) may be called from the repl following
  initialization. lcmap.clownfish.system is hard wired to never start
@@ -38,7 +38,7 @@
  using qualified names that indicate either an environment of 'local' or 'unit'.

  If this is something you really want to do, follow these steps (db as example):
- 1 - Modify the dev/resources/scheme.setup.cql
+ 1 - Modify the dev/resources/schema.setup.cql
  2 - Start the repl
  3 - Create an environment dictionary configured for remote server access
  4 - (require '[lcmap.clownfish.setup.initialize :as initialize])
@@ -56,10 +56,10 @@
                     (mount/start #'lcmap.clownfish.configuration/config
                                  #'lcmap.clownfish.db/db-cluster
                                  #'lcmap.clownfish.setup.db/setup
-                                 (mount/with-args {:environment environment})
-                      (mount/stop  #'lcmap.clownfish.configuration/config
-                                   #'lcmap.clownfish.db/db-cluster
-                                   #'lcmap.clownfish.setup.db/setup)))
+                                 (mount/with-args {:environment environment}))
+                    (mount/stop  #'lcmap.clownfish.configuration/config
+                                 #'lcmap.clownfish.db/db-cluster
+                                 #'lcmap.clownfish.setup.db/setup))
     (catch Exception e
       (stacktrace/print-stack-trace e)
       (log/errorf "error initializing db: %s" (stacktrace/root-cause e)))))
@@ -73,11 +73,11 @@
                                  #'event/amqp-connection
                                  #'event/amqp-channel
                                  #'lcmap.clownfish.setup.event/setup
-                                 (mount/with-args {:environment environment})
-                      (mount/stop #'lcmap.clownfish.configuration/config
-                                  #'lcmap.clownfish.event/amqp-connection
-                                  #'lcmap.clownfish.event/amqp-channel
-                                  #'lcmap.clownfish.setup.event/setup)))
+                                 (mount/with-args {:environment environment}))
+                    (mount/stop #'lcmap.clownfish.configuration/config
+                                #'lcmap.clownfish.event/amqp-connection
+                                #'lcmap.clownfish.event/amqp-channel
+                                #'lcmap.clownfish.setup.event/setup))
     (catch Exception e
       (stacktrace/print-stack-trace e)
       (log/errorf "error initializing event system: %s"


Revised conversion and validation impl.

Revised conversion and validation impl.

--- src/fm/simrunner/config.clj
+++ src/fm/simrunner/config.clj
@@ -3,6 +3,19 @@
     [clojure.java.io :as jio])
   (:import
     (java.io File)))
+
+(defn- string->file [^String string]
+  (let [string (-> string str .trim)]
+    (when-not (.isEmpty string)
+      (File. string))))
+
+(defn- file? [value]
+  (instance? File value))
+
+(defn- string->double [^String string]
+  (try
+    (Double/valueOf (str string))
+    (catch NumberFormatException x)))

 (def ^{:private true} parameter-ids [:input-file
                                      :eps
@@ -13,11 +26,37 @@
                                      :calc-err
                                      :acsr-size])

-(def ^{:private true} blank-config (-> parameter-ids
-                                       (zipmap (repeat nil))
-                                       (assoc :invalid-ids
-                                              (into #{} parameter-ids))))
+(def ^{:private true} parameter-specs [{:valid?        file?
+                                        :string->value string->file}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}
+                                       {:valid?        number?
+                                        :string->value string->double}])
+
+(def ^{:private true} parameter-defs (zipmap parameter-ids parameter-specs))

+(defn- string->value [param-id value-string]
+  (if-let [string->value (get-in parameter-defs [param-id :string->value])]
+    (string->value value-string)
+    (throw (IllegalArgumentException. (format "Undefined parameter id: %s!"
+                                              param-id)))))
+
+(defn- value-valid? [param-id value]
+  (if-let [valid? (get-in parameter-defs [param-id :valid?])]
+    (valid? value)
+    (throw (IllegalArgumentException. (format "Undefined parameter id: %s!"
+                                              param-id)))))
+
 (defn- blank? [trimmed-line]
   (.isEmpty trimmed-line))

@@ -43,63 +82,49 @@
 (defn- trimmed [lines]
   (map #(-> % str .trim) lines))

-(defn- string->double [^String string]
-  (try
-    (Double/valueOf (str string))
-    (catch NumberFormatException x)))
+(defn strings->values [config]
+  (->> (merge (zipmap parameter-ids (repeat nil)) config)
+       (map (fn [[param-id value-string]]
+              [param-id (string->value param-id value-string)]))
+       (into {})))

-(defn- string->file [^String string]
-  (let [string (-> string str .trim)]
-    (when-not (.isEmpty string)
-      (File. string))))
+(defn validate [config]
+  (reduce (fn [validated param-id]
+            (let [value (param-id config)]
+              (if (value-valid? param-id value)
+                (-> validated
+                    (assoc param-id value)
+                    (vary-meta update-in [::invalid-ids] disj param-id))
+                (assoc validated param-id nil))))
+          (with-meta {}
+                     (assoc (meta config)
+                            :type         ::config
+                            ::invalid-ids (into #{} parameter-ids)))
+          parameter-ids))

-(defmulti string->value {:private true} (fn [param-id _] param-id))
+(defn invalid-ids
+  ([config]
+    (invalid-ids config false))
+  ([config validate?]
+    (-> (if validate? (validate config) config) meta ::invalid-ids)))

-(defmethod string->value :input-file [_ string]
-  (string->file string))
-
-(defmethod string->value :eps [_ string]
-  (string->double string))
-
-(defmethod string->value :log-num [_ string]
-  (string->double string))
-
-(defmethod string->value :stuetz-count [_ string]
-  (string->double string))
-
-(defmethod string->value :correction [_ string]
-  (string->double string))
-
-(defmethod string->value :max-deviation [_ string]
-  (string->double string))
-
-(defmethod string->value :calc-err [_ string]
-  (string->double string))
-
-(defmethod string->value :acsr-size [_ string]
-  (string->double string))
-
-(defn strings->values [config]
-  (reduce (fn [config [param-id value-string]]
-            (if-let [value (string->value param-id value-string)]
-              (-> config
-                  (assoc param-id value)
-                  (update-in [:invalid-ids] disj param-id))
-              (assoc config param-id nil)))
-          {:invalid-ids (into #{} parameter-ids)}
-          config))
+(defn valid?
+  ([config]
+    (valid? config false))
+  ([config validate?]
+    (-> (if validate? (validate config) config) invalid-ids seq not)))

 (defn read-config-lines [lines]
   (let [values (-> lines
                    trimmed
                    skip-ignored
                    strip-comments)]
-    (strings->values (zipmap parameter-ids values))))
+    (-> parameter-ids
+        (zipmap values)
+        strings->values
+        validate)))

 (defn read-config-file [file]
   (with-open [reader (jio/reader file)]
     (read-config-lines (line-seq reader))))

-(defn valid? [config]
-  (-> config :invalid-ids seq not))
-


Fixed error with titanic

Fixed error with titanic

--- src/main/clojure/conexp/fca/lattices.clj
+++ src/main/clojure/conexp/fca/lattices.clj
@@ -418,7 +418,7 @@
   (titanic (attributes context)
            (supports context 0)
            1.0
-           <=))
+           <))

 (defn titanic-iceberg-intent-seq
   "Computes the iceberg intent seq for given context and minimal
@@ -427,7 +427,7 @@
   (let [intents (titanic (attributes context)
                          (supports context minsupp)
                          1.0
-                         <=)]
+                         <)]
     (if (<= (* (count (objects context)) minsupp)
             (count (attribute-derivation context (attributes context))))
       intents


permutations.clj: slight unfactoring

permutations.clj: slight unfactoring

--- clojure/org/gavrog/clojure/permutations.clj
+++ clojure/org/gavrog/clojure/permutations.clj
@@ -3,7 +3,6 @@
 (defn permutations [degree]
   (let [keys (range 1 (inc degree))
         complete? (comp empty? :unused)
-        branch? (comp not complete?)
         children (fn [node]
                    (let [{:keys [perm unused unseen]} node]
                      (when-let [i (first unused)]
@@ -14,4 +13,6 @@
         root {:perm {}
               :unused (into #{} keys)
               :unseen (into #{} keys)}]
-    (map :perm (filter complete? (tree-seq branch? children root)))))
+    (map :perm
+         (filter complete?
+                 (tree-seq (comp not complete?) children root)))))


comment out location.search for now

comment out location.search for now

--- frontend/history.cljs
+++ frontend/history.cljs
@@ -19,7 +19,12 @@
                                     (str "#" hash))))
             :createUrl (fn [token path-prefix location]
                          (let [[path hash] (string/split token #"#")]
-                           (str path-prefix path (.-search location) (when hash (str "#" hash)))))}))
+                           (str path-prefix
+                                path
+                                ;; comment out for now, need to figure out how to combine
+                                ;; location search and the search already in the token
+                                ;; (.-search location)
+                                (when hash (str "#" hash)))))}))

 (defn setup-dispatcher! [history-imp]
   (events/listen history-imp goog.history.EventType.NAVIGATE


Stepping works properly now

Stepping works properly now

--- src/playwood_logo/core.cljs
+++ src/playwood_logo/core.cljs
@@ -7,10 +7,11 @@

 ;; define your app data so that it doesn't get over-written on reload

+(def step-timeout 500)
 (def initial-turtle-state
   {
-   :x   11
-   :y   1
+   :x   10
+   :y   0
    :dir :S
    })

@@ -20,16 +21,21 @@
                           :mode :stop
                           :step 0
                           :code [
+                                 [:forward]
                                  [:left]
-                                 [:forward 1]
+                                 [:forward]
                                  [:right]
-                                 [:forward 1]
+                                 [:forward]
                                  [:left]
-                                 [:forward 1]
-                                 ]
+                                 [:forward]
+                                 [:right]
+                                 [:right]
+                                 [:forward]
+                                 [:left]
+                           ]
                           }

-                :grid    {
+                :board    {
                           :width    400
                           :height   300
                           :num-rows 21
@@ -64,9 +70,9 @@
 (defn dir-to-offset [dir]
   (case dir
     :N [0 -1]
-    :E [-1 0]
+    :E [1 0]
     :S [0 1]
-    :W [1 0]
+    :W [-1 0]
     [0 0]))

 (defn dir-to-rotation [dir]
@@ -78,53 +84,59 @@
     0))

-(defn play! []
-  (swap! app-state assoc-in [:program :mode] :play))
-
-(defn reset-turtle! []
-  (swap! app-state assoc :turtle initial-turtle-state))

 (defn apply-stop [prev-state]
   (-> prev-state
       (assoc-in [:program :mode] :stop)
       (assoc-in [:program :step] 0)))

-(defn stop! []
-  (swap! app-state apply-stop))
-

 (defn apply-command [turtle-state step-code]
   (let [[cmd arg] step-code]
     (case cmd
       :left
-      (-> turtle-state
-                  (update :dir rotate-left))
+      (-> turtle-state (update :dir rotate-left))
       :right
-      (-> turtle-state
-                  (update :dir rotate-right))
+      (-> turtle-state (update :dir rotate-right))

       :forward
-      (let [[dx dy] (dir-to-offset (:dir turtle-state))]
+      (let [[dx dy] (dir-to-offset (:dir turtle-state))
+            amount (or arg 1)]
         (-> turtle-state
-            (update :x + (* arg dx))
-            (update :y + (* arg dy))))
+            (update :x + (* amount dx))
+            (update :y + (* amount dy))))
       turtle-state)))

+(defn should-proceed-running []
+  (let [program (:program @app-state)]
+    (and (= (:mode program) :play)
+      (< (-> program :step) (-> program :code count)))))
+
+
 (defn next-step! []
-  (swap! app-state
-         (fn [prev-state]
-           (let [program (:program prev-state)
-                 num-steps (-> program :code count dec)]
-             (if (and
-                   (= (:mode program) :play)
-                   (< (:step program) num-steps))
-               (-> prev-state
-                   (update-in [:program :step] inc)
-                   (update-in [:turtle] apply-command
-                              (-> program :code (nth (-> program :step inc)))))
-               (apply-stop prev-state))))))
-
+  (if (should-proceed-running)
+    (do
+      (swap! app-state
+             (fn [prev-state]
+               (let [program (:program prev-state)]
+                 (-> prev-state
+                     (update-in [:turtle] apply-command
+                                (-> program :code (get (-> program :step))))
+                     (update-in [:program :step] inc)))))
+      (js/setTimeout next-step! step-timeout))
+    (swap! app-state apply-stop)))
+
+
+(defn play! []
+  (swap! app-state assoc-in [:program :mode] :play)
+  (js/setTimeout next-step! step-timeout))
+
+(defn reset-turtle! []
+  (swap! app-state assoc :turtle initial-turtle-state))
+
+(defn stop! []
+  (swap! app-state apply-stop))

@@ -132,7 +144,7 @@
 (defn Turtle [{:keys [x y dir]}]
   [:g
    {:transform
-    (str "translate(" x "," y ")" "rotate(" (dir-to-rotation dir) ")")
+    (str "translate(" x "," y ")" "rotate(" (dir-to-rotation dir) " 0.5 0.5)")
     }
    (for [c turtle-circles]
      [:circle (merge c  {
@@ -155,11 +167,11 @@

 (defn Board []
-  (let [grid (:grid @app-state)
-        width (:width grid)
-        height (:height grid)
-        num-rows (:num-rows grid)
-        num-cols (:num-cols grid)]
+  (let [board (:board @app-state)
+        width (:width board)
+        height (:height board)
+        num-rows (:num-rows board)
+        num-cols (:num-cols board)]
     [:svg {:width width
            :height height}
      [:g {:transform
@@ -173,7 +185,24 @@
      ]))

-(defn controls []
+(defn CurrentCommand []
+  (let [program (@app-state :program)
+        mode  (program :mode)
+        step (program :step)
+        code (program :code)
+        command (get code step)]
+    (if (= mode :play)
+      [:span (str command)])))
+
+(defn CurrentState []
+  (let [turtle (@app-state :turtle)]
+    [:div
+     [:span (str turtle)]
+     [:span (-> @app-state :program :mode)]]
+    ))
+
+
+(defn Controls []
   [:div {:style {
                  :display "flex" :flex-direction "column" :align-items "center"
                  }}
@@ -186,20 +215,19 @@
                :style { :font-family "monospace" :width 400 :height 300 }
                :value (-> @app-state :program :code (#(apply str %)))} ]

-   [:div  "Step: " (-> @app-state :program :step)]
-   ])
-
-
-(defn world []
-  [:div {:style { :display "flex" :flex-direction "column" }}
+   [:div  [CurrentCommand]]
+   ])
+
+
+(defn App []
+  [:div {:style { :display "flex" :flex-direction "column" :align-items "center" }}
    [Board]
-   [controls]
-   ])
-
-
-(js/setInterval next-step! 100)
-
-(reagent/render-component [world]
+   [Controls]
+   ])
+
+
+
+(reagent/render-component [App]
                           (. js/document (getElementById "app")))

 (defn on-js-reload []


URS password has a default - removed from profiles.example.clj

--- dev-system/profiles.example.clj
+++ dev-system/profiles.example.clj
@@ -2,5 +2,4 @@
                     :cmr-sys-dba-password "CHANGE_ME"
                     :cmr-bootstrap-password "CHANGE_ME"
                     :cmr-ingest-password "CHANGE_ME"
-                    :cmr-rabbit-mq-password "CHANGE_ME"
-                    :cmr-urs-password "CHANGE_ME"}}}
+                    :cmr-rabbit-mq-password "CHANGE_ME"}}}


Linty fix :yum:

Linty fix :yum:

--- src/metabase/db/migrations.clj
+++ src/metabase/db/migrations.clj
@@ -11,32 +11,33 @@

 ;;; # Migration Helpers

-(defn- migration-ran? [migration]
+(defn- migration-ran? [migration-name]
   (-> (k/select :data_migrations
                 (k/aggregate (count :*) :count)
-                (k/where {:id (name migration)}))
+                (k/where {:id (name migration-name)}))
       first :count (> 0)))

 (defn- run-migration-if-needed
-  "Run MIGRATION if needed. MIGRATION should be a symbol naming a fn that takes no arguments.
+  "Run migration defined by MIGRATION-VAR if needed.

-     (run-migration-if-needed 'set-card-database-and-table-ids)"
-  [migration]
-  (when-not (migration-ran? migration)
-    (log/info (format "Running data migration '%s'..." (name migration)))
-    (@(resolve migration))
-    (k/insert "data_migrations"
-              (k/values {:id        (name migration)
-                         :timestamp (u/new-sql-timestamp)}))
-    (log/info "[ok]")))
+     (run-migration-if-needed #'set-card-database-and-table-ids)"
+  [migration-var]
+  (let [migration-name (name (:name (meta migration-var)))]
+    (when-not (migration-ran? migration-name)
+      (log/info (format "Running data migration '%s'..." migration-name))
+      (@migration-var)
+      (k/insert "data_migrations"
+                (k/values {:id        migration-name
+                           :timestamp (u/new-sql-timestamp)}))
+      (log/info "[ok]"))))

 (def ^:private data-migrations (atom []))

 (defmacro ^:private defmigration
-  "Define a new data migration. This is just a simple wrapper around `defn-` that adds the function"
+  "Define a new data migration. This is just a simple wrapper around `defn-` that adds the resulting var to that `data-migrations` atom."
   [migration-name & body]
   `(do (defn- ~migration-name [] ~@body)
-       (swap! data-migrations conj '~migration-name)))
+       (swap! data-migrations conj #'~migration-name)))

 (defn run-all
   "Run all data migrations defined by `defmigration`."


use map destructuring for before's optional arg list

--- src/midje/ideas/background.clj
+++ src/midje/ideas/background.clj
@@ -46,11 +46,11 @@
   (defmacro before
     "Code to run before a given wrapping target (:facts, :contents, :checks).
      Used with background and against-background"
-    [wrapping-target before-form & [_ after-form & _]]
+    [wrapping-target before-form & {:keys [after]}]
     (ensure-correct-form-variable `(try
                                      ~before-form
                                      ?form
-                                     (finally ~after-form))))
+                                     (finally ~after))))

   (defmacro after
     "Code to run after a given wrapping target (:facts, :contents, :checks).


[#177] Use with-open for StringWriter. Fix test.

--- priv/clojure/string.clj
+++ priv/clojure/string.clj
@@ -60,24 +60,20 @@

 (defn- replace-by
   [s re f]
-  (let [buffer (new erlang.io.StringWriter "")
-        opts (clj_core/seq_to_list.e [:global #[:capture :first :index]])
-        append erlang.io.StringWriter/write.2
-        length (count s)
-        match-result (erlang.util.Regex/run.e re s opts)]
-    (loop [index 0
-           [[i len :as m] & ms] (->> (when (not= match-result :nomatch)
-                                       match-result)
-                                     second
-                                     (map first))]
-      (if m
-        (do
-          (append buffer (subs s index i))
-          (append buffer (f (subs s i (+ i len))))
-          (recur (+ i len) ms))
-        (do
-          (append buffer (subs s index length))
-          (str buffer))))))
+  (with-open [buffer (new erlang.io.StringWriter)]
+    (let [append erlang.io.StringWriter/write.2
+          length (count s)
+          matches (re-run re s :global #[:capture :first :index])]
+      (loop [index 0
+             [[i len :as m] & ms] (->> matches (map first))]
+        (if m
+          (do
+            (append buffer (subs s index i))
+            (append buffer (f (subs s i (+ i len))))
+            (recur (+ i len) ms))
+          (do
+            (append buffer (subs s index length))
+            (str buffer)))))))

 (defn ^String replace
   "Replaces all instance of match with replacement in s.
@@ -118,20 +114,19 @@

 (defn- replace-first-by
   [s re f]
-  (let [buffer (new erlang.io.StringWriter "")
-        opts (clj_core/seq_to_list.e [#[:capture :first :index]])
-        append erlang.io.StringWriter/write.2
-        length (count s)
-        match-result (erlang.util.Regex/run.e re s opts)
-        [i len] (when (not= match-result :nomatch)
-                  (-> match-result second first))]
-    (if i
-      (do
-        (append buffer (subs s 0 i))
-        (append buffer (f (subs s i (+ i len))))
-        (append buffer (subs s (+ i len) length))
-        (str buffer))
-      s)))
+  (with-open [buffer (new erlang.io.StringWriter)]
+    (let [append erlang.io.StringWriter/write.2
+          length (count s)
+          [[i len] :as matches] (re-run re s #[:capture :all :index])
+          matches (map (fn [[i len]] (subs s i (+ i len))) matches)
+          matches (if (= (count matches) 1) (first matches) matches)]
+      (if i
+        (do
+          (append buffer (subs s 0 i))
+          (append buffer (f matches))
+          (append buffer (subs s (+ i len) length))
+          (str buffer))
+        s))))

 (defn- replace-first-str
   [s match replace]
@@ -322,15 +317,16 @@
   (let [s (when s (str s))
         length (count s)
         append erlang.io.StringWriter/write.2]
-    (loop [index 0
-           buffer (new erlang.io.StringWriter)]
-      (if (= length index)
-        (str buffer)
-        (let [ch (clojerl.String/char_at.e s index)]
-          (if-let [replacement (cmap ch)]
-            (append buffer replacement)
-            (append buffer ch))
-          (recur (inc index) buffer))))))
+    (with-open [buffer (new erlang.io.StringWriter)]
+      (loop [index 0
+             buffer buffer]
+        (if (= length index)
+          (str buffer)
+          (let [ch (clojerl.String/char_at.e s index)]
+            (if-let [replacement (cmap ch)]
+              (append buffer replacement)
+              (append buffer ch))
+            (recur (inc index) buffer)))))))

 (defn index-of
   "Return index of value (string or char) in s, optionally searching


Fix mark/reset for trie. Add product-join test.

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -370,7 +370,8 @@
          (assert (> (alength marked-nodes) 0))
          (assert (> (alength marked-ixes) 0))
          (set! node (.pop marked-nodes))
-         (set! ix (.pop marked-ixes))))
+         (set! ix (.pop marked-ixes))
+         (.maintain this)))

 (defn iterator [tree]
   (loop [node (.-root tree)]
@@ -381,7 +382,7 @@
       (recur (aget (.-children node) 0)))))

 ;; trie view of a tree
-(deftype Trieterator [iterator seek-key pinned-key ^:mutable moving-key-ix ^:mutable end? key-len]
+(deftype Trieterator [iterator ^:mutable seek-key ^:mutable pinned-key marked-seek-keys marked-pinned-keys ^:mutable moving-key-ix ^:mutable end? key-len]
   Object
   (key [this]
        (when (false? end?)
@@ -390,20 +391,18 @@
        (when (false? end?)
          (.val iterator)))
   (maintain [this]
-            (if (or (true? (.-end? iterator))
-                    (not (key-lt (.key iterator) pinned-key)))
-              (set! end? true)
-              (do
-                (set! end? false)
-                (aset seek-key moving-key-ix (.key this))))) ;; is this needed?
+            (set! end? (or (true? (.-end? iterator))
+                           (not (key-lt (.key iterator) pinned-key)))))
   (next [this]
         (when (false? end?)
           (.seek iterator seek-key)
+          (aset seek-key moving-key-ix (.key this))
           (.maintain this)))
   (seek [this key]
         (when (false? end?)
           (aset seek-key moving-key-ix key)
           (.seek iterator seek-key)
+          (aset seek-key moving-key-ix (.key this))
           (.maintain this)))
   (down [this]
         (assert (false? end?))
@@ -422,12 +421,17 @@
         (aset pinned-key moving-key-ix greatest))
       (.maintain this))
   (mark [this]
-        (.mark iterator))
+        (.mark iterator)
+        (apush marked-seek-keys seek-key)
+        (apush marked-pinned-keys pinned-key))
   (reset [this]
-         (.reset iterator)))
+         (.reset iterator)
+         (set! seek-key (.pop marked-seek-keys))
+         (set! pinned-key (.pop marked-pinned-keys))
+         (.maintain this)))

 (defn trieterator [iterator]
-  (let [trieterator (Trieterator. iterator (least-key (.-key-len iterator)) (greatest-key (.-key-len iterator)) 0 false (.-key-len iterator))]
+  (let [trieterator (Trieterator. iterator (least-key (.-key-len iterator)) (greatest-key (.-key-len iterator)) #js [] #js [] 0 false (.-key-len iterator))]
     (.maintain trieterator)
     trieterator))

@@ -832,6 +836,22 @@
                  movements (gen/vector (gen-next key-len))] ;; TODO use gen-movement once Treeterator supports seek
                 (run-self-join-prop min-keys key-len actions movements)))

+(defn run-product-join-prop [min-keys key-len actions movements]
+  (let [tree (apply-to-tree (tree min-keys key-len) actions)
+        iterator-results (apply-to-iterator (iterator tree) movements)
+        iterator-a (trieterator (iterator tree))
+        iterator-b (trieterator (iterator tree))
+        join-results (apply-to-iterator
+                      (treeterator (join #js [iterator-a iterator-b] (* 2 key-len) #js [(into-array (range key-len)) (into-array (range key-len (* 2 key-len)))]))
+                      movements)]
+    (= (map vec iterator-results) (map vec join-results))))
+
+(defn product-join-prop [key-len]
+  (prop/for-all [min-keys gen/s-pos-int
+                 actions (gen/vector (gen-action key-len))
+                 movements (gen/vector (gen-next key-len))] ;; TODO use gen-movement once Treeterator supports seek
+                (run-product-join-prop min-keys key-len actions movements)))
+
 (comment
   (dc/quick-check 1000 (least-prop 1))
   (dc/quick-check 1000 (least-prop 2))
@@ -861,6 +881,7 @@
   (dc/quick-check 10000 (self-join-prop 1))
   (dc/quick-check 10000 (self-join-prop 2))
   (dc/quick-check 10000 (self-join-prop 3))
+  (dc/quick-check 10000 (product-join-prop 1))

   (defn f []


Fix an issue w/ URL of newly published story.

--- src/oc/storage/api/stories.clj
+++ src/oc/storage/api/stories.clj
@@ -107,8 +107,10 @@
   (timbre/info "Publishing story:" story-for)
   (if-let* [board (:existing-board ctx)
             story (:existing-story ctx)
-            _publish-result (story-res/publish-story! conn (:uuid story) (:user ctx))]
-    (do (timbre/info "Published story:" story-for) true)
+            publish-result (story-res/publish-story! conn (:uuid story) (:user ctx))]
+    (do
+      (timbre/info "Published story:" story-for)
+      {:updated-story publish-result})
     (do (timbre/error "Failed publishing story:" story-for) false)))

 ;; ----- Resources - see: http://clojure-liberator.github.io/liberator/assets/img/decision-graph.svg
@@ -306,10 +308,11 @@
                                org (or (:existing-org ctx)
                                        (org-res/get-org conn org-slug))
                                org-uuid (:uuid org)
-                               board (board-res/drafts-storyboard org-uuid (:user ctx)) ; Drafts board for the user
                                story (or (:existing-story ctx)
                                          (story-res/get-story conn story-uuid))
+                               board (board-res/get-board conn (:board-uuid story))
                                _matches? (and (= org-uuid (:org-uuid story))
+                                              (= org-uuid (:org-uuid board))
                                               (= :draft (keyword (:status story))))]
                         {:existing-org org :existing-board board :existing-story story}
                         false))


Issue when reading core.async batches. max-segments could be come negative and a whole batch would be read.

--- src/onyx/plugin/core_async.clj
+++ src/onyx/plugin/core_async.clj
@@ -32,10 +32,9 @@
         ms (or (:onyx/batch-timeout task-map) (:onyx/batch-timeout defaults))
         step-ms (/ ms (:onyx/batch-size task-map))
         timeout-ch (timeout ms)
-        batch (if (zero? max-segments)
-                (<!! timeout-ch)
+        batch (if (pos? max-segments)
                 (loop [segments [] cnt 0]
-                  (if (= cnt batch-size)
+                  (if (= cnt max-segments)
                     segments
                     (if-let [message (first (alts!! [retry-ch chan timeout-ch] :priority true))]
                       (recur (conj segments
@@ -43,7 +42,8 @@
                                     :input :core.async
                                     :message message})
                              (inc cnt))
-                      segments))))]
+                      segments)))
+                (<!! timeout-ch))]
     (doseq [m batch]
       (swap! pending-messages assoc (:id m) (:message m)))
     (when (and (= 1 (count @pending-messages))


Remove stray debug.

Remove stray debug.

--- src/onyx/static/validation.clj
+++ src/onyx/static/validation.clj
@@ -193,7 +193,7 @@
                     (and (= from :all)
                          (empty? (remove all-tasks to)))
                     (and (coll? to)
-                         (every? (fn [t] (println t)
+                         (every? (fn [t]
                                    (try ((task->egress-edges from) t)
                                         (catch NullPointerException e nil))) to)))
         (throw (ex-info ":flow/to value doesn't name a valid connected task in the workflow, :all, or :none"


enable refresh of recurring credits for cards hosted after installation

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1404,9 +1404,8 @@
                            :zone '(:onhost) ;; hosted cards should not be in :discard or :hand etc
                            :previous-zone (:zone target))]
        (update! state side (update-in card [:hosted] #(conj % c)))
-       (when-let [events (:events (card-def target))]
-         (when installed
-           (register-events state side events c)))
+       (when installed
+         (card-init state side c false))
        c))))

 (defn is-tagged? [state]


Correct errors

Correct errors

Correct template code errors and begin to restructure pipeline code to
omit >!!, which isn’t supported in cljs.

--- src/cljs/app/app.cljs
+++ src/cljs/app/app.cljs
@@ -1,5 +1,5 @@
 (ns app.app
-  (:require [cljs.core.async :as async :refer [<!]]
+  (:require [cljs.core.async :as async :refer [chan <! >!]]
             [reagent.core :as reagent]
             [kioo.reagent :as kioo]
             [cljs-http.client :as http])
@@ -11,6 +11,10 @@

 ; Application state
 (def query-results (reagent/atom {}))
+
+(defn query [path]
+  (let [in (chan)]
+    ))

 (defn get-results [in]
   (let [out (chan)]
@@ -24,7 +28,7 @@
       (while true
         (>! out {{{hits-vector :hits} :hits} :body} (<! in))))))

-(defn )
+;(defn )

 (defn update-results-state [in]
   (go
@@ -32,7 +36,7 @@
       (swap! @query-results (<! in)))))

 ; Process pipeline
-(def query-chan (chan))
+
 (def get-results-out (get-results query-chan))
 (def extract-hits-out (extract-hits get-results-out))
 (update-results-state extract-hits-out)
@@ -44,14 +48,14 @@
 (defsnippet result-card "templates/results.html" [:.card] [result-map]
   {[:.list-column] (kioo/content [:li
                                    [:ul {:class "list-row"}
-                                     (map result-data {:_source} result-map)]])})
+                                     (map result-data (get result-map :_source))]])})

 (deftemplate result-cards "templates/results.html" []
   {[:.card] (map result-card @query-results)})

 (deftemplate page "index.html" []
-  {[:.search-field] (kioo/listen :on-change #(>!! query-chan .-value))}
-  {[:.results] (result-cards)})
+  {[:.search-field] (kioo/listen :on-change #(>!! query-chan .-value))
+   [:.results] (kioo/content (result-cards))})

 (defn init []
   (reagent/render-component [page] (.-body js/document)))
@@ -60,8 +64,7 @@
   ;       terms "cardiovascular"]
   ;   (execute-query query-url terms))

-
   ; (let [{drugs :drugs rationale :rationale recommendation :recommendation
-  ;       quality-of-evidence :quality-of-evidence
-  ;       strength-of-recommendation :strength-of-recommendation
-  ;       evidence :evidence}]
+  ;        quality-of-evidence :quality-of-evidence
+  ;        strength-of-recommendation :strength-of-recommendation
+  ;        evidence :evidence}]


removed crawl-informative - not used

removed crawl-informative - not used

--- src/crawler/crawl.clj
+++ src/crawler/crawl.clj
@@ -242,60 +242,6 @@
                              (clojure.string/split #"\s+"))))
         nav-content  (:total-nav-info space)]
     (/ nav-content text-content)))
-
-(defn crawl-informative
-  "Args:
-    start: Good entry point
-
-   Args alt:
-    queues: pagination and content queues
-    visited: visited links
-    globals: global info
-    to-eliminate: global decision-space pruning"
-  ([start limit]
-     (let [start-body   (utils/download-with-cookie start)
-           to-eliminate (template-removal/all-xpaths start-body start utils/my-cs)]
-       (crawl-informative {:url start}
-                          (set [])
-                          {}
-                          to-eliminate
-                          limit)))
-
-  ([queues visited globals to-eliminate limit]
-     (if (and (not (zero? limit))
-              (or (seq (-> queues :content))
-                  (seq (-> queues :pagination))))
-       (let [content-q   (-> queues :content)         ; holds the content queues
-             paging-q    (-> queues :pagination)      ; holds the pagination queues
-
-             queue-kw    (cond
-                          (empty? content-q)
-                          :pagination
-
-                          (empty? paging-q)
-                          :content
-
-                          :else
-                          (if (even? (int (/ (count visited) 10)))
-                            :pagination :content))
-
-             queue       (queues queue-kw)
-
-             url         (-> queue first :url)
-             body        (-> url download-with-cookie)
-             new-visited (conj visited url)
-             paginated?  (-> queue first :pagination?)  ; ignore this
-                                        ; guy. Not yet necessary
-
-             space       (rich-char-extractor/state-action
-                          body url to-eliminate)
-
-             prev-nav-num (-> queue first :prev-nav)
-             cur-nav-num  (cur-nav-fraction body space)
-             leaf?        (rich-char-extractor/leaf?
-                           prev-nav-num
-                           cur-nav-num)]
-         leaf?))))

 (defn sample-sitemap
   ([start]
@@ -464,10 +410,30 @@
              leaf-paths)
             (dec limit)))))
        {:to-remove to-eliminate
-        :model     (reverse
+        :models     (reverse
                     (sort-by
                      second
                      (frequencies leaf-paths)))})))
+
+(defn crawl-site-extract
+  ([site model]
+     (crawl-site-extract
+      site
+      model
+      (set [])
+      [{:url             site
+        :remaining-model model}]))
+
+  ([site model visited queue]
+     (let [url (-> queue first :url)])))
+
+(defn crawl-site
+  [start {to-eliminate :to-remove models :models}]
+  (map
+   (fn [[model score]]
+     (let [in-order-model (reverse model)]
+       (crawl-site-extract start in-order-model)))
+   models))

 (defn crawl
   [start crawler-type num-docs]


Add backdrop-on-click from upstream

Add backdrop-on-click from upstream

--- src/re_com/modal_panel.cljs
+++ src/re_com/modal_panel.cljs
@@ -10,6 +10,7 @@
    {:name :wrap-nicely?     :required false :default true    :type "boolean"                                        :description [:span "if true, wrap " [:code ":child"] " in a white, rounded panel"]}
    {:name :backdrop-color   :required false :default "black" :type "string"          :validate-fn string?           :description "CSS color of backdrop"}
    {:name :backdrop-opacity :required false :default 0.6     :type "double | string" :validate-fn number-or-string? :description [:span "opacity of backdrop from:" [:br] "0.0 (transparent) to 1.0 (opaque)"]}
+   {:name :backdrop-on-click :required false :default nil     :type "-> nil"          :validate-fn fn?               :description "a function which takes no params and returns nothing. Called when the backdrop is clicked"}
    {:name :class            :required false                  :type "string"          :validate-fn string?           :description "CSS class names, space separated"}
    {:name :style            :required false                  :type "CSS style map"   :validate-fn css-style?        :description "CSS styles to add or override"}
    {:name :attr             :required false                  :type "HTML attr map"   :validate-fn html-attr?        :description [:span "HTML attributes, like " [:code ":on-mouse-move"] [:br] "No " [:code ":class"] " or " [:code ":style"] "allowed"]}])
@@ -19,7 +20,7 @@
    main window to prevent UI interactivity and place user focus on the modal window.
    Parameters:
     - child:  The message to display in the modal (a string or a hiccup vector or function returning a hiccup vector)"
-  [& {:keys [child wrap-nicely? backdrop-color backdrop-opacity class style attr]
+  [& {:keys [child wrap-nicely? backdrop-color backdrop-opacity backdrop-on-click class style attr]
       :or   {wrap-nicely? true backdrop-color "black" backdrop-opacity 0.6}
       :as   args}]
   {:pre [(validate-args-macro modal-panel-args-desc args "modal-panel")]}
@@ -40,7 +41,9 @@
                 :opacity          backdrop-opacity
                 :z-index          1020
                 :pointer-events   "none"}           ;; TODO: trying to prevent change of focus under the bwhen clicking on backdrop (also with the on-click below). Remove!
-     :on-click #(do (println "stopping propagation") (.preventDefault %) (.stopPropagation %))
+     :on-click (handler-fn (when backdrop-on-click (backdrop-on-click))
+                           (.preventDefault event)
+                           (.stopPropagation event))
      }]
    [:div
     {:style (merge {:margin  "auto"                 ;; Child


Namespace comment

Namespace comment

--- src/detritus/pred.clj
+++ src/detritus/pred.clj
@@ -1,4 +1,5 @@
-(ns detritus.pred)
+(ns detritus.pred
+  "A collection of predicates and predicate helpers.")

 (defn ->assert
   "(λ T → ((λ T) → Bool)) → T


Focus management #38 - :focus-traversal-order performance optimization: avoid extra re-sorting of container components by default

--- src/flatgui/focus.clj
+++ src/flatgui/focus.clj
@@ -93,17 +93,20 @@
 ;;; Sorts focusable components so that they are traversed in left->right, up->down direction.
 ;;; To make such an order, arranges components in a vector of horizontal "lines".
 ;;;
-;;;  NOTE:
-;;; This implementation is slow. For containers that have frequenlty moving children, it's better
-;;; to wrap it into another function that would call this one in rare cases (e.g. only when :children
-;;; change)
-(fg/defevolverfn :focus-traversal-order
+;;; NOTE: This implementation is slow. Use only if explicitly needed to follow changes in child positions
+(fg/defevolverfn sort-focus-traversal-order-evolver :focus-traversal-order
   (let [accepting-children (get-accepting-children component)]
     (if (pos? (count accepting-children))
       (let [lines (group-by-lines component accepting-children)
             result (mapcat (fn [i] (map :id (nth lines i))) (range 0 (count lines)))]
         result)
       [])))
+
+(fg/defevolverfn :focus-traversal-order
+  (let [reason (fg/get-reason)]
+    (if (or (nil? reason) (= reason [:this]))
+      (sort-focus-traversal-order-evolver component)
+      old-focus-traversal-order)))

 (fg/defaccessorfn get-child-ids-in-traversal-order [component]
   (if-let [focus-traversal-order (get-property component [:this] :focus-traversal-order)]


Remove --relative-urls flag from less compiler.

I misunderstood what --relative-urls did. Apparently it's not used in
reference to sourcemaps– rather, it rewrites asset URLs to be relative.
Not what we want in this case.

--- src/frontend/less.clj
+++ src/frontend/less.clj
@@ -31,7 +31,7 @@

 (defn compile! [& {:keys [src dest minify]
                    :or {src less-file, dest output-file, minify false}}]
-  (let [standard-flags (format "--source-map-basepath=$PWD/resources --source-map=%s --source-map-url=%s --relative-urls" less-map less-map-url)
+  (let [standard-flags (format "--source-map-basepath=$PWD/resources --source-map=%s --source-map-url=%s" less-map less-map-url)
         flags (if minify
                 (str standard-flags " --compress")
                 standard-flags)


Update comment wording to be slighly more clear.

--- src/oc/storage/representations/entry.clj
+++ src/oc/storage/representations/entry.clj
@@ -105,7 +105,7 @@
                 [(self-link org-slug board-slug entry-uuid)
                  (up-link org-slug board-slug)])
         more-links (cond
-                    ;; Accessing drafts, or access by authors get editing links
+                    ;; Accessing their drafts, or access by an author, both get editing links
                     (or (and draft? (not secure-access?)) (= access-level :author))
                     (concat links [(partial-update-link org-slug board-slug entry-uuid)
                                    (delete-link org-slug board-slug entry-uuid)


Only do this for Clj, not Cljs.

Only do this for Clj, not Cljs.

--- src/onyx/flow_conditions/fc_routing.cljc
+++ src/onyx/flow_conditions/fc_routing.cljc
@@ -1,6 +1,6 @@
 (ns onyx.flow-conditions.fc-routing
   (:require [onyx.lifecycles.lifecycle-invoke :as lc]
-            [onyx.static.util :refer [kw->fn exception? deserializable-exception]]
+            [onyx.static.util :refer [kw->fn exception?] :as u]
             [onyx.types :refer [->Route]]))

 (defn join-output-paths [all to-add downstream]
@@ -33,12 +33,16 @@
    (->Route #{} #{} nil nil)
    compiled-flow-conditions))

+(defn maybe-attach-segment [e segment]
+  #?(:cljs e)
+  #?(:clj (u/deserializable-exception e {:offending-segment segment})))
+
 (defn route-data
   [event {:keys [egress-ids compiled-ex-fcs compiled-norm-fcs flow-conditions] :as compiled} result message]
   (if (nil? flow-conditions)
     (if (exception? message)
       (let [{:keys [exception segment]} (ex-data message)
-            e (deserializable-exception exception {:offending-segment segment})]
+            e (maybe-attach-segment exception segment)]
         (lc/handle-exception
          event :lifecycle/apply-fn e (:compiled-handle-exception-fn compiled)))
       (->Route egress-ids nil nil nil))
@@ -46,7 +50,7 @@
       (if (seq compiled-ex-fcs)
         (choose-output-paths event compiled-ex-fcs result (:exception (ex-data message)) egress-ids)
         (let [{:keys [exception segment]} (ex-data message)]
-          (throw (deserializable-exception exception {:segment segment}))))
+          (throw (maybe-attach-exception exception segment))))
       (if (seq compiled-norm-fcs)
         (choose-output-paths event compiled-norm-fcs result message egress-ids)
         (->Route egress-ids nil nil nil)))))


force render on every load

force render on every load

--- src/sierpinski_sieve/core.cljs
+++ src/sierpinski_sieve/core.cljs
@@ -8,10 +8,6 @@
 (defn log [& args] (.log js/console args))

 (defonce app-state (atom {}))
-
-(defn render-canvas []
-  (let [size 400]
-    [:center [:canvas {:width size :height size :id "canvas"}]]))

 (defn next-row [modulus row]
   (for [x (range 0 (inc (count row)))]
@@ -39,12 +35,19 @@
           (paint-row ctx y row size))
         (.fill ctx)))))

-(reagent/render [render-canvas]
-                (. js/document (getElementById "app")))
+(defn render-canvas [size]
+  (fn []
+    [:center [:canvas {:width size :height size :id "canvas"}]]))
+
+(defn main [size]
+  (reagent/render [(render-canvas size)]
+                  (. js/document (getElementById "app")))
+  (time (paint "canvas" size (take size (sieve '(1) 2)))))
+
+(main 400)

 (defn on-js-reload []
   ;; optionally touch your app-state to force rerendering depending on
   ;; your application
   ;; (swap! app-state update-in [:__figwheel_counter] inc)
-  (time (paint "canvas" 400 (take 400 (sieve '(1) 2))))
 )


simply use mapfn, not pmap: benchmark shows no effect


Eliminate warning for unused variable

Eliminate warning for unused variable

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -538,7 +538,7 @@
      (typical-density density-unit substance)))
   ([density-unit substance]
    (condp = density-unit
-     :lb-per-cu-ft (let [[density density-unit substance] (typical-density :kg-per-m3)]
+     :lb-per-cu-ft (let [[density _ substance] (typical-density :kg-per-m3)]
                      [((convert-units-f :kg-per-m3 :lb-per-cu-ft) density) :lb-per-cu-ft substance])
      :kg-per-m3    (condp = substance
                      ;; Typical values for different substances taken from


remove storm-spec to get build working

remove storm-spec to get build working

--- src/storm-polis/storm_spec.clj
+++ src/storm-polis/storm_spec.clj
@@ -1,105 +0,0 @@
-(ns polismath.storm-spec
-  (:import [backtype.storm StormSubmitter LocalCluster])
-  (:require [incanter.core :as ic.core])
-  (:use [backtype.storm clojure config]
-        polismath.matrix-utils
-        polismath.pca
-        polismath.simulation)
-  (:gen-class))
-
-
-(defspout reaction-spout ["conv-id" "reaction"] {:prepare true}
-  [conf context collector]
-  (let [n-convs 3
-        start-n 3
-        reaction-gen (atom (make-reaction-gen n-convs start-n))]
-    (spout
-      (nextTuple []
-        (let [reaction (first @reaction-gen)
-              conv-id (first reaction)
-              rest-reaction (rest reaction)]
-          (Thread/sleep 1000)
-          (println "RUNNING SPOUT")
-          (swap! reaction-gen rest)
-          (emit-spout! collector [conv-id rest-reaction])))
-      (ack [id]))))
-
-
-(defn data-updater [update-fn & [init-fn]]
-  "This function abstracts the common pattern of fetching (or initing if necessary) an item from a
-  data dictionary, then updating it based on the specified updated function. Useful since our bolts
-  store data by conversation id."
-  (let [init-fn (or init-fn #(identity nil))]
-    (fn [data conv-id & inputs]
-      (let [value (or (get data conv-id) (init-fn))
-            new-value (apply update-fn value inputs)]
-        (assoc data conv-id new-value)))))
-
-; This is a little bit of a hack. Need to get pca working on matrices with just a couple of elements still...
-;(def init-matrix (->RatingMatrix ["p1" "p2" "p3"] ["c1" "c2" "c3"] [[1 1 0] [0 1 -1] [0 -1 1]]))
-; this might actually be really bad for structural sharing (keeping a head around); don't understand all of
-; the intricacies of structural sharing though
-(def init-matrix (named-matrix))
-
-(defbolt rating-matrix ["conv-id" "rating-matrix"] {:prepare true}
-  [conf context collector]
-  (let [data (atom {})]
-    (bolt (execute [tuple]
-      (let [[conv-id reaction] (.getValues tuple)]
-        (swap! data
-               (data-updater #(update-nmat % [reaction]) #(identity init-matrix))
-               conv-id)
-        (emit-bolt! collector
-                    [conv-id (ic.core/matrix (:matrix (get @data conv-id)))]
-                    :anchor tuple))))))
-
-
-(defbolt ptpt-pca ["conv-id" "pcs" "proj"] {:prepare true}
-  [conf context collector]
-  ; If nothing exists yet, creating an empty matrix
-  (let [data (atom {})
-        n-comps 2]
-    (bolt (execute [tuple]
-      (let [[conv-id rating-matrix] (.getValues tuple)]
-        (swap! data (data-updater #(powerit-pca rating-matrix n-comps :start-vectors % :iters 5)) conv-id)
-        (let [pcs (get @data conv-id)
-              proj (pca-project rating-matrix pcs)]
-          (emit-bolt! collector [conv-id pcs proj])))))))
-
-
-;(defbolt clusters ["clusters"] {:prepare true}
-  ;[conf context collector]
-  ;(let [
-
-
-(defn mk-topology []
-  (topology
-    ; Spouts:
-    {"1" (spout-spec reaction-spout)}
-    ; Bolts:
-    {"2" (bolt-spec {"1"  ["conv-id"]}
-                    rating-matrix)
-     "3" (bolt-spec {"2" ["conv-id"]}
-                    ptpt-pca)
-     }))
-
-
-(defn run-local! []
-  (let [cluster (LocalCluster.)]
-    (.submitTopology cluster "online-pca" {TOPOLOGY-DEBUG true} (mk-topology))))
-
-
-(defn submit-topology! [name]
-  (StormSubmitter/submitTopology
-    name
-    {TOPOLOGY-DEBUG true
-     TOPOLOGY-WORKERS 3}
-    (mk-topology)))
-
-
-(defn -main
-  ([]
-   (run-local!))
-  ([name]
-   (submit-topology! name)))
-


Add `utils/keywordize`

Add `utils/keywordize`

--- src/taoensso/faraday/utils.clj
+++ src/taoensso/faraday/utils.clj
@@ -20,3 +20,8 @@
   (fmap* coll f))

 (comment (map (partial fmap inc) ['(1 2 3) [1 2 3] {:1 1 :2 2 :3 3} #{1 2 3}]))
+
+(defn keywordize-map [m] (reduce-kv (fn [m k v] (assoc m (keyword k) v)) {} m))
+
+(comment (keywordize-map nil)
+         (keywordize-map {"akey" "aval" "bkey" "bval"}))


Fix imports, syntax

Fix imports, syntax

--- src/icecap/crypto.clj
+++ src/icecap/crypto.clj
@@ -8,11 +8,11 @@
   location of the blob in the database) and the cap key (the key used
   to encrypt the blob).
   - An authenticated encryption scheme."
+  (:refer-clojure :exclude [derive])
   (:require [caesium.crypto.generichash :refer [blake2b]]
-            [caesium.crypto.secretbox :as secretbox])
-  (:import java.util Arrays)
-  (:refer-clojure :exclude [derive])
-  (:require [crypto.random :as csprng]))
+            [caesium.crypto.secretbox :as secretbox]
+            [crypto.random :as csprng])
+  (:import [java.util Arrays]))

 (def cap-bits
   "The size of a cap, in bits."
@@ -106,8 +106,9 @@

 (defn blake2b-kdf
   "Create a key derivation function based on BLAKE2b."
+  []
   (reify KDF
-    (derive [_ cap mccaster-key salt]
+    (derive [_ cap master-key salt]
       (let [output (blake2b cap :salt salt :key master-key :personal personal)
             index-start-byte (inc cap-key-bytes)
             index-end-byte (+ index-start-byte index-bytes)
@@ -134,6 +135,7 @@

   Please note that this uses a fixed nonce, and that's *perfectly
   fine*. This is the only message ever encrypted with that key!"
+  []
   (reify EncryptionScheme
     (encrypt [_ key plaintext]
       (secretbox/encrypt key (secretbox/int->nonce 1) plaintext))


bring back toString on the core collections, include a new lower level `pr-str*` which doesn't bring in all the other printing machinery

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -26,6 +26,17 @@
 (defn ^:export set-print-fn!
   "Set *print-fn* to f."
   [f] (set! *print-fn* f))
+
+(def ^:dynamic *flush-on-newline* true)
+(def ^:dynamic *print-readably* true)
+(def ^:dynamic *print-meta* false)
+(def ^:dynamic *print-dup* false)
+
+(defn- pr-opts []
+  {:flush-on-newline *flush-on-newline*
+   :readably *print-readably*
+   :meta *print-meta*
+   :dup *print-dup*})

 (def
   ^{:doc "bound in a repl thread to the most recent value printed"}
@@ -330,6 +341,23 @@
 (defprotocol INamed
   (-name [x])
   (-namespace [x]))
+
+;; Printing support
+
+(deftype StringBufferWriter [sb]
+  IWriter
+  (-write [_ s] (.append sb s))
+  (-flush [_] nil))
+
+(defn pr-str*
+  "Support so that collections can implement toString without
+   loading all the printing machinery."
+  [^not-native obj]
+  (let [sb (gstring/StringBuffer.)
+        writer (StringBufferWriter. sb)]
+    (-pr-writer obj writer (pr-opts))
+    (-flush writer)
+    (str sb)))

 ;;;;;;;;;;;;;;;;;;; symbols ;;;;;;;;;;;;;;;

@@ -621,6 +649,10 @@
   [x] (satisfies? IIndexed x))

 (deftype IndexedSeq [arr i]
+  Object
+  (toString [coll]
+   (pr-str* coll))
+
   ISeqable
   (-seq [this] this)

@@ -696,6 +728,10 @@
 (declare with-meta)

 (deftype RSeq [ci i meta]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IMeta
   (-meta [coll] meta)
   IWithMeta
@@ -1783,6 +1819,10 @@

 ;;;;;;;;;;;;;;;; cons ;;;;;;;;;;;;;;;;
 (deftype List [meta first rest count ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IList

   IWithMeta
@@ -1829,6 +1869,10 @@
   (-count [coll] count))

 (deftype EmptyList [meta]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IList

   IWithMeta
@@ -1898,6 +1942,10 @@
         r))))

 (deftype Cons [meta first rest ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IList

   IWithMeta
@@ -1990,6 +2038,10 @@
         (.-x lazy-seq)))))

 (deftype LazySeq [meta realized x ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (LazySeq. meta realized x __hash))

@@ -2072,6 +2124,10 @@
      (ArrayChunk. arr off end)))

 (deftype ChunkedCons [chunk more meta ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll m]
     (ChunkedCons. chunk more m __hash))
@@ -3059,6 +3115,10 @@
          pr-sequential-writer pr-writer chunked-seq)

 (deftype PersistentVector [meta cnt shift root tail ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentVector. meta cnt shift root tail __hash))

@@ -3222,6 +3282,10 @@
 (defn vector [& args] (vec args))

 (deftype ChunkedSeq [vec node i off meta ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll m]
     (chunked-seq vec node i off m))
@@ -3294,6 +3358,10 @@
 (declare build-subvec)

 (deftype Subvec [meta v start end ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (build-subvec meta v start end __hash))

@@ -3574,6 +3642,10 @@
 ;;; PersistentQueue ;;;

 (deftype PersistentQueueSeq [meta front rear ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentQueueSeq. meta front rear __hash))

@@ -3606,6 +3678,10 @@
   (-seq [coll] coll))

 (deftype PersistentQueue [meta count front rear ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentQueue. meta count front rear __hash))

@@ -3719,6 +3795,10 @@
     new-obj))

 (deftype ObjMap [meta keys strobj update-count ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (ObjMap. meta keys strobj update-count __hash))

@@ -3887,6 +3967,10 @@
 (declare TransientArrayMap)

 (deftype PersistentArrayMap [meta cnt arr ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentArrayMap. meta cnt arr __hash))

@@ -4583,6 +4667,10 @@
                (.inode-assoc! edit shift key2hash key2 val2 added-leaf?)))))))

 (deftype NodeSeq [meta nodes i s ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IMeta
   (-meta [coll] meta)

@@ -4640,6 +4728,10 @@
        (NodeSeq. nil nodes i s nil))))

 (deftype ArrayNodeSeq [meta nodes i s ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IMeta
   (-meta [coll] meta)

@@ -4689,6 +4781,10 @@
 (declare TransientHashMap)

 (deftype PersistentHashMap [meta cnt root ^boolean has-nil? nil-val ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentHashMap. meta cnt root has-nil? nil-val __hash))

@@ -4907,6 +5003,10 @@
       stack)))

 (deftype PersistentTreeMapSeq [meta stack ^boolean ascending? cnt ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   ISeqable
   (-seq [this] this)

@@ -5405,6 +5505,10 @@

 (deftype PersistentTreeMap [comp tree cnt meta ^:mutable __hash]
   Object
+  (toString [coll]
+    (pr-str* coll))
+
+  Object
   (entry-at [coll k]
     (loop [t tree]
       (if-not (nil? t)
@@ -5633,6 +5737,10 @@
 (declare TransientHashSet)

 (deftype PersistentHashSet [meta hash-map ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentHashSet. meta hash-map __hash))

@@ -5738,6 +5846,10 @@
       k)))

 (deftype PersistentTreeSet [meta tree-map ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentTreeSet. meta tree-map __hash))

@@ -5985,6 +6097,10 @@
                    (if ((mk-bound-fn sc end-test end-key) e) s (next s))))))

 (deftype Range [meta start end step ^:mutable __hash]
+  Object
+  (toString [coll]
+    (pr-str* coll))
+
   IWithMeta
   (-with-meta [rng meta] (Range. meta start end step __hash))

@@ -6249,11 +6365,6 @@
          (fn [match] (aget char-escapes match)))
        \"))

-(deftype StringBufferWriter [sb]
-  IWriter
-  (-write [_ s] (.append sb s))
-  (-flush [_] nil))
-
 (defn- pr-writer
   "Prefer this to pr-seq, because it makes the printing function
    configurable, allowing efficient implementations such as appending
@@ -6367,17 +6478,6 @@
   (string-print "\n")
   (when (get opts :flush-on-newline)
     (flush)))
-
-(def *flush-on-newline* true)
-(def *print-readably* true)
-(def *print-meta* false)
-(def *print-dup* false)
-
-(defn- pr-opts []
-  {:flush-on-newline *flush-on-newline*
-   :readably *print-readably*
-   :meta *print-meta*
-   :dup *print-dup*})

 (defn pr-str
   "pr to a string, returning it. Fundamental entrypoint to IPrintWithWriter."


CMR-5201: Created a SES-specific results-processing function.

--- src/cmr/sizing/core.clj
+++ src/cmr/sizing/core.clj
@@ -66,6 +66,30 @@
     :nc (estimate-binary-size granule-count vars)
     :not-implemented))

+;; XXX This function is nearly identical to one of the same name in
+;;     cmr.ous.common -- we should put this somewhere both can use,
+;;     after generalizing to take a func and the func's args ...
+(defn process-results
+  ([results start errs]
+   (process-results results start errs {:warnings nil}))
+  ([{:keys [params data-files tag-data vars format]} start errs warns]
+   (log/trace "Got data-files:" (vec data-files))
+   (log/trace "Process-results tag-data:" tag-data)
+   (if errs
+     (do
+       (log/error errs)
+       errs)
+     (let [estimate-or-errs (-estimate-size format (count data-files) vars)]
+       ;; Error handling for post-stages processing
+       (if (errors/erred? estimate-or-errs)
+         (do
+           (log/error estimate-or-errs)
+           estimate-or-errs)
+         (do
+           (log/debug "Generated URLs:" (vec estimate-or-errs))
+           (results/create estimate-or-errs :elapsed (util/timed start)
+                                            :warnings warns)))))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;   API   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -101,10 +125,11 @@
         fmt (:format params)]
     (log/trace "raw-params:" raw-params)
     (log/debug "Got format:" fmt)
-    (ous-common/process-results
+    (process-results
       {:params params
        :data-files data-files
-       :estimate (-estimate-size fmt (count data-files) vars)}
+       :vars vars
+       :format fmt}
       start
       errs
       warns)))


Adding a command to move tab to new tabset

--- src/lt/objs/tabs.cljs
+++ src/lt/objs/tabs.cljs
@@ -521,6 +521,19 @@

 (append (object/->content canvas/canvas) (:content @multi))

+(defn move-tab-to-tabset [obj ts]
+  (rem! obj)
+  (add! obj ts)
+  (active! obj))
+
+(cmd/command {:command :tabs.move-new-tabset
+              :desc "Tab: Move tab to new tabset"
+              :exec (fn []
+                      (when-let [ts (ctx/->obj :tabset)]
+                        (when-let [cur (@ts :active-obj)]
+                          (let [new (cmd/exec! :tabset.new)]
+                            (move-tab-to-tabset cur new)))))})
+
 (cmd/command {:command :tabs.move-next-tabset
               :desc "Tab: Move tab to next tabset"
               :exec (fn []
@@ -528,9 +541,7 @@
                         (let [cur (@ts :active-obj)
                               next (or (next-tabset ts) (prev-tabset ts))]
                           (when (and cur next (not= next ts))
-                            (rem! cur)
-                            (add! cur next)
-                            (active! cur)))))})
+                            (move-tab-to-tabset cur next)))))})

 (cmd/command {:command :tabs.move-prev-tabset
               :desc "Tab: Move tab to previous tabset"
@@ -539,9 +550,7 @@
                         (let [cur (@ts :active-obj)
                               next (or (prev-tabset ts) (next-tabset ts))]
                           (when (and cur next (not= next ts))
-                            (rem! cur)
-                            (add! cur next)
-                            (active! cur)))))})
+                            (move-tab-to-tabset cur next)))))})

 (cmd/command {:command :tabs.next
               :desc "Tab: Next tab"
@@ -605,8 +614,9 @@
 (cmd/command {:command :tabset.new
               :desc "Tabset: Add a tabset"
               :exec (fn []
-                      (spawn-tabset)
-                      (equalize-tabset-widths))})
+                      (let [ts (spawn-tabset)]
+                        (equalize-tabset-widths)
+                        ts))})

 (cmd/command {:command :tabs.focus-active
               :desc "Tab: focus active"