turned on :selection-mode  :multi-interval for the namespace list ns-lb

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -355,8 +355,6 @@
   (action :name "Auto-Refresh"
           :handler (fn [e] (let [root (to-root e)
                                  id (partial select-id root)]
-                              (println "e:" e)
-                              (println "getSource:" (.getSource e))
                              (if (config (id :auto-refresh-browser-cb) :selected?)
                                (.start (seesaw.meta/get-meta root :auto-refresh-browser-timer))
                                (.stop (seesaw.meta/get-meta root :auto-refresh-browser-timer)))))))
@@ -371,6 +369,7 @@
     (config! (id :vars-lb-sp) :preferred-size (config (id :vars-lb-sp) :size))
     ;; ns
     (config! (id :ns-lb) :model @all-ns-loaded-atom)
+    (config! (id :ns-lb) :selection-mode :multi-interval) ;; experimental...
     (config! (id :vars-lb) :model [])
     (config! (id :ns-entries-lbl) :text "0")
     (config! (id :ns-require-btn) :enabled? false)
@@ -436,7 +435,6 @@
         (b/tee
           (b/bind
             (b/transform (fn [ns]
-              (ensure-selection-visible (id :ns-lb))
               (if (and ns (some #(= ns %) @all-ns-unloaded-atom))
                 true
                 false)))
@@ -469,7 +467,6 @@
     (b/bind
       (b/selection (id :vars-lb))
       (b/transform (fn [v]
-        (ensure-selection-visible (id :vars-lb))
         (if v
           (let [fqn (fqname (selection (id :ns-lb)) v)]
             (if (and fqn (not= fqn ""))
@@ -744,8 +741,14 @@
         selected-var (selection (id :vars-lb))]
     (swap! ns-lb-refresh-atom not)
     (swap! vars-lb-refresh-atom not)
-    (when-not (= (selection (id :ns-lb)) selected-ns) (selection! (id :ns-lb) selected-ns))
-    (selection! (id :vars-lb) selected-var)
+    (when-not (= (selection (id :ns-lb)) selected-ns)
+      (selection! (id :ns-lb) selected-ns)
+      (ensure-selection-visible (id :ns-lb))
+      (selection! (id :vars-lb) selected-var)
+      (ensure-selection-visible (id :vars-lb)))
+    (when-not (= (selection (id :vars-lb)) selected-var)
+      (selection! (id :vars-lb) selected-var)
+      (ensure-selection-visible (id :vars-lb)))
     {:root root :selected-ns selected-ns :selected-var selected-var}))

 ;;seesaw.core/toggle-full-screen! (locks up computer!!! don't use)
@@ -881,8 +884,10 @@
   "Refresh all or the given browser-window (pack! and show!)"
 ;;   ([] (map #(invoke-later (show! (pack! %))) @browser-root-frms))
 ;;   ([root] (invoke-later (show! (pack! root)))))
-  ([] (doall (map #(invoke-soon (show! %)) @clj-ns-browser.browser/browser-root-frms)))
-  ([root] (invoke-soon (show! root))))
+  ([]
+    (doall (map #(invoke-soon (show! %)) @clj-ns-browser.browser/browser-root-frms)))
+  ([root]
+    (invoke-soon (show! root))))

 (defn new-clj-ns-browser
@@ -940,12 +945,16 @@
               (selection! (id :ns-cbx) "loaded")
               (selection! (id :ns-lb) ns1)
               (selection! (id :vars-cbx) "publics")
-              (selection! (id :vars-lb) name1))
+              (selection! (id :vars-lb) name1)
+              (ensure-selection-visible (id :ns-lb))
+              (ensure-selection-visible (id :vars-lb)))
             (if (find-ns (symbol name1))
               ;; should be namespace
               (invoke-soon
                 (selection! (id :ns-lb) name1)
-                (selection! (id :doc-cbx) "Doc"))
+                (selection! (id :doc-cbx) "Doc")
+                (ensure-selection-visible (id :ns-lb))
+                (ensure-selection-visible (id :vars-lb)))
               ;; else must be special-form or class
               (invoke-soon
                 (if (special-form? fqn)
@@ -956,7 +965,9 @@
                     (selection! (id :vars-lb) name1))
                   (do
                     (selection! (id :ns-lb) (str *ns*))
-                    (selection! (id :doc-cbx) "Doc"))))))
-            (refresh-clj-ns-browser root)
+                    (selection! (id :doc-cbx) "Doc")))
+                (ensure-selection-visible (id :ns-lb))
+                (ensure-selection-visible (id :vars-lb)))))
+          (refresh-clj-ns-browser root)
           fqn)))))


Customize welcome message

Customize welcome message

--- src/cljs/jugsclojure/core.cljs
+++ src/cljs/jugsclojure/core.cljs
@@ -3,7 +3,7 @@

 (enable-console-print!)

-(defonce app-state (atom {:text "Hello Chestnut!"}))
+(defonce app-state (atom {:text "Hello, Stuttgart!"}))

 (defn greeting []
   [:h1 (:text @app-state)])


nil attr-value will cause removeAttribute to be called.

--- src/clojure/freactive/dom.cljs
+++ src/clojure/freactive/dom.cljs
@@ -354,13 +354,13 @@

     :default
     (fn [attr-value]
-      (.setAttribute
-        element attr-name
-        (if attr-value
+      ;(println "setting attr" element attr-name attr-value)
+      (if attr-value
+        (.setAttribute element attr-name
           (if (.-substring attr-value)
             attr-value
-            (.toString attr-value))
-          "")))))
+            (.toString attr-value)))
+        (.removeAttribute element attr-name)))))

 (defn- bind-lifecycle-callback! [element cb-name cb-value node-state]
   (case cb-name


update request-animation-frame polyfill and add fallback fn

--- src/clojure/freactive/dom.cljs
+++ src/clojure/freactive/dom.cljs
@@ -171,8 +171,19 @@

 ;; ## Polyfills

-(defn request-animation-frame [f]
-  (.requestAnimationFrame js/window f))
+(def ^:private raf-start-time (.getTime (js/Date.)))
+
+(def request-animation-frame
+  (or
+   (.-requestAnimationFrame js/window)
+   (.-webkitRequestAnimationFrame js/window)
+   (.-mozRequestAnimationFrame js/window)
+   (.-msRequestAnimationFrame js/window)
+   (.-oRequestAnimationFrame js/window)
+   (fn [f]
+     (js/setTimeout
+      #(f (- (.getTime (js/Date.)) raf-start-time))
+      16.66666))))

 ;; Render Loop


Increase output char limit

Increase output char limit

--- src/clojure/nightmod/utils.clj
+++ src/clojure/nightmod/utils.clj
@@ -17,7 +17,7 @@
 (def ^:const docs-name "*Docs*")
 (def ^:const repl-name "*REPL*")
 (def ^:const game-ns 'nightmod.run)
-(def ^:const out-char-limit 500)
+(def ^:const out-char-limit 5000)

 (def main-dir (atom nil))
 (def project-dir (atom nil))


Added print operator to show computation result.

--- src/clojure/ohua_blog/core.clj
+++ src/clojure/ohua_blog/core.clj
@@ -20,40 +20,41 @@
      (com.ohua.compile/ohua
         (com.ohua.lang/smap
           (fn [id]
-             (render-page
-               (render-side-pane
-                 (let [pids (fetch id "PostIds")
-                       views (com.ohua.lang/smap
-                               (fn [post] (fetch post "PostViews"))
-                               pids)
-                       views-and-posts (zip pids views)
-                       ordered (order-posts views-and-posts)
-                       ordered-ids (unzip-first ordered)
-                       content (com.ohua.lang/smap
-                                 (fn [a] (fetch a "PostContent"))
-                                 ordered-ids)
-                       info (com.ohua.lang/smap
+             (p
+               (render-page
+                 (render-side-pane
+                   (let [pids (fetch id "PostIds")
+                         views (com.ohua.lang/smap
+                                 (fn [post] (fetch post "PostViews"))
+                                 pids)
+                         views-and-posts (zip pids views)
+                         ordered (order-posts views-and-posts)
+                         ordered-ids (unzip-first ordered)
+                         content (com.ohua.lang/smap
+                                   (fn [a] (fetch a "PostContent"))
+                                   ordered-ids)
+                         info (com.ohua.lang/smap
+                                   (fn [a] (fetch a "PostInfo"))
+                                   ordered-ids)
+                         package (zip3 views info content)]
+                     (render-popular-posts package))
+                   (let [pids (fetch id "PostIds")
+                         posts (com.ohua.lang/smap
                                  (fn [a] (fetch a "PostInfo"))
-                                 ordered-ids)
-                       package (zip3 views info content)]
-                   (render-popular-posts package))
+                                 pids)
+                         topic-counts (process-topics posts)]
+                     (render-topics topic-counts)))
                  (let [pids (fetch id "PostIds")
                        posts (com.ohua.lang/smap
                                (fn [a] (fetch a "PostInfo"))
                                pids)
-                       topic-counts (process-topics posts)]
-                   (render-topics topic-counts)))
-               (let [pids (fetch id "PostIds")
-                     posts (com.ohua.lang/smap
-                             (fn [a] (fetch a "PostInfo"))
-                             pids)
-                     ordered (take-latest posts)
-                     ordered-ids (get-ids ordered)
-                     content (com.ohua.lang/smap
-                               (fn [a] (fetch a "PostContent"))
-                               ordered-ids)]
-                 (render-main-panel
-                   (zip ordered content)))))
+                       ordered (take-latest posts)
+                       ordered-ids (get-ids ordered)
+                       content (com.ohua.lang/smap
+                                 (fn [a] (fetch a "PostContent"))
+                                 ordered-ids)]
+                   (render-main-panel
+                     (zip ordered content))))))
           x))))

 (defn -main []


matcher-combinators: Add section comments

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -5,12 +5,18 @@
    [matcher-combinators.test] ; adds support for `match?` and `thrown-match?` in `is` expressions
    ))

+;;;; ___________________________________________________________________________
+;;;; --- Notes ----
+
 ;;;; TODO: What is an `equals` matcher?
 ;;;; TODO: What is an `embeds` matcher?

 ;;;; ++use-of-mismatch++
 ;;;; We use `m/mismatch` to demo what would otherwise be failing tests.
 ;;;; Note that `m/mismatch` should generally be avoided.
+
+;;;; ___________________________________________________________________________
+;;;; ---- Scalars ----

 (deftest most-scalars-use-equality-test
   ;; Most scalar values are interpreted as an `equals` matcher.
@@ -25,6 +31,9 @@
   (is (match? #"fox"
               "The quick brown fox jumps over the lazy dog")))

+;;;; ___________________________________________________________________________
+;;;; ---- Predicates ----
+
 (deftest predicate-test
   ;; Functions are used as predicates.
   (is (match? even?
@@ -37,6 +46,9 @@
 (deftest equals-overrides-predicate-test
   (is (match? (m/equals even?)
               even?)))
+
+;;;; ___________________________________________________________________________
+;;;; ---- Maps ----

 (deftest maps-test

@@ -74,6 +86,9 @@
   (is (match? (m/equals {:a 1 :b even?})
               {:a 1 :b 1234})))

+;;;; ___________________________________________________________________________
+;;;; ---- Sequences ----
+
 (deftest sequences-test
   ;; A sequence is interpreted as an `equals` matcher, which specifies count and
   ;; order of matching elements. The elements are matched based on their types.
@@ -99,6 +114,9 @@
   (is (match? (m/in-any-order [odd? odd? even?])
               [1 2 3])))

+;;;; ___________________________________________________________________________
+;;;; ---- Sets ----
+
 (deftest sets-test
   ;; A set is interpreted as an `equals` matcher.
   ;; NOTE: matching sets is an O(n!) operation because it compares every
@@ -112,6 +130,9 @@
   ;; Use `m/set-equals` to repeat predicates.
   (is (match? (m/set-equals [odd? odd? 2]) #{1 2 3})))

+;;;; ___________________________________________________________________________
+;;;; ---- Nested data structures ----
+
 (deftest nested-test
   ;; Maps, sequences and sets follow the same semantics whether at the top level
   ;; or nested within a structure.
@@ -120,6 +141,9 @@
               {:a {:z 1234}
                :b [1 2 3]
                :c :this-is-all-very-cool})))
+
+;;;; ___________________________________________________________________________
+;;;; ---- Explicit matchers ----

 (deftest match-with-explicit-matchers-test
   ;; TODO: When is this useful? Just /eg/ `(is (match? 37 (+ 29 8)))`
@@ -132,11 +156,17 @@
               1234)) ; TODO: I guess we need this in contexts where `even?` would not be treated as a pred -- but what are those contexts?
   )

+;;;; ___________________________________________________________________________
+;;;; ---- Exceptions ----
+
 (deftest exception-matching-test
   (is (thrown-match? clojure.lang.ExceptionInfo
                      {:foo 1}
                      (throw (ex-info "Boom!" {:foo 1 :bar 2})))))

+;;;; ___________________________________________________________________________
+;;;; ---- More ----
+
 ;;;; TODO: There's more. Continue going through the documentation at
 ;;;;       https://github.com/nubank/matcher-combinators and adding
 ;;;;       examples here.


Add a TODO

Add a TODO

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_105_generative_testing/midje_gen_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_105_generative_testing/midje_gen_test.clj
@@ -40,7 +40,8 @@
   (fact (sort v) => (sort (sort v))))

 (for-all "First element is min after sorting"
-    {:num-tests 100}
+    {:num-tests 100} ; TODO This options map must comne after the binding form
+                     ;      - check elsewhere too.
   [v (gen/not-empty (gen/vector gen/int))]
   (fact (apply min v)
     => (first (sort v))))


Add some notes

Add some notes

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_600_bidi_yada/sss_200_yada.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_600_bidi_yada/sss_200_yada.clj
@@ -37,6 +37,9 @@
 ;;;; - `yada/as-resource`
 ;;;; - `yada/handler`
 ;;;; - `yada/resource`
+
+;;;; TODO Maybe tidy these tests.
+;;;; TODO Maybe do compojure-api instead.

 (defn make-test-routes []
   ["/"


Minor refactorings of session code

Minor refactorings of session code

--- src/compojure/http/session.clj
+++ src/compojure/http/session.clj
@@ -110,40 +110,31 @@
 (defmethod destroy-session :cookie [session])

 ;; Session middleware
-(defn- in-seconds
+
+(defn- timestamp-after
   "Returns the current time plus seconds as milliseconds."
   [seconds]
-  (let [current-time (. System currentTimeMillis)]
-    (+ (* seconds 1000) current-time)))
-
-(defn- set-session-expires-at
-  "Updates the session :expires-at if this session has an
-   expires value, otherwise just retuns the session."
+  (+ (* seconds 1000) (System/currentTimeMillis)))
+
+(defn- assoc-expiry
+  "Associate an :expires-at key with the session if the session repository
+  contains the :expires key."
   [session]
   (if-let [expires (:expires *session-repo*)]
-    (assoc session :expires-at (in-seconds expires))
+    (assoc session :expires-at (timestamp-after expires))
     session))

 (defn- session-expired?
   "True if this session's timestamp is in the past."
   [session]
   (if-let [expires-at (:expires-at session)]
-    (let [current-time (. System currentTimeMillis)]
-      (< expires-at current-time))
-    false))
-
-(defn- new-session
-  "Returns a new session.  Will set the expires timestamp if needed."
-  []
-  (if (contains? *session-repo* :expires)
-    (set-session-expires-at (create-session))
-    (create-session)))
+    (< expires-at (System/currentTimeMillis))))

 (defn- new-request-session
   "Associates a new session with a request."
   [request]
   (assoc request
-    :session      (new-session)
+    :session (assoc-expiry (create-session))
     :new-session? true))

 (defn- get-request-session
@@ -160,7 +151,7 @@
       (do
         (destroy-session session)
         (new-request-session request))
-      (assoc request :session (set-session-expires-at session)))
+      (assoc request :session (assoc-expiry session)))
     (new-request-session request)))

 (defn- assoc-request-flash
@@ -175,9 +166,9 @@
 (defn- set-session-cookie
   "Set the session cookie on the response if required."
   [request response session]
-  (let [new?    (:new-session? request)
-        cookie  (session-cookie new? session)
-        update  (set-cookie :compojure-session cookie, :path "/")]
+  (let [new?   (:new-session? request)
+        cookie (session-cookie new? session)
+        update (set-cookie :compojure-session cookie, :path "/")]
     (if cookie
       (update-response request response update)
       response)))
@@ -185,20 +176,20 @@
 (defn- save-handler-session
   "Save the session for a handler if required."
   [request response session]
-  (cond (and (contains? response :session)
+  (when (and (contains? response :session)
              (nil? (response :session)))
-        (destroy-session session)
-        (or (:session response)
+    (destroy-session session))
+  (when (or (:session response)
             (contains? *session-repo* :expires)
             (:new-session? request)
             (not-empty (:flash request)))
-        (write-session session)))
+    (write-session session)))

 (defn with-session
   "Wrap a handler in a session of the specified type. Session type defaults to
   :memory if not supplied."
   ([handler]
-    (with-session handler {:type :memory}))
+    (with-session handler :memory))
   ([handler session-repo]
     (fn [request]
       (binding [*session-repo* session-repo]


Fix docstring of «explore-attributes»

Fix docstring of «explore-attributes»

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

--- src/conexp/fca/exploration.clj
+++ src/conexp/fca/exploration.clj
@@ -51,17 +51,33 @@

   - :handler «fn»

-    Interaction is accomplished via the given handler fn, which is called with the current
-    context of possible incidences, the current context of certain indcidences, all
-    implications known so far and a new implication. The handler has to return
-    counterexamples for the new implication, if there are some. Otherwise it has to return
-    nil. Counterexamples are given as a sequence of rows, every row being of the form
-
-       [g positive-attributes negative-attributes],
-
-    where «g» is a new object, «positive-attributes» is a sequence of attributes the new
-    object has, and «negative-attributes» is a sequence of attributes the new object does
-    not have.  Note that «positive-attributes» and «negative-attributes» must be disjoint.
+    Interaction is accomplished via the given handler fn.  Depending on whether incomplete
+    counterexamples are allowed or not, this handler is called with different arguments
+    and is supposed to return different things:
+
+    - if incomplete counterexamples are not allowed, «fn» is called (in this order) with
+      the current working context, the set of known implications and the current
+      implication to be asked to the expert.  It is supposed to return either «nil» (in
+      which case the implication is accepted), or a sequence of counterexamples which are
+      supposed to be of the form
+
+        [g attributes]
+
+      where «g» is the name of a new object and «attributes» is the set of attributes the
+      new object should possess.
+
+    - if incomplete counterexamples are allowed, «fn» is called with the context of
+      possible incidences, the context of certain incidence, the set of known implications
+      and the current implication to be asked to the expert.  It is supposed to return
+      either «nil» (in which case the implication is accepted), or a sequence of
+      counterexamples of the form
+
+        [g positive-attributes negative-attributes],
+
+      where «g» is a new object, «positive-attributes» is a sequence of attributes the new
+      object has, and «negative-attributes» is a sequence of attributes the new object
+      does not have.  Note that «positive-attributes» and «negative-attributes» must be
+      disjoint.

   - :background-knowledge «set of implications»


serialize the :data map when inserting a chunk into the database


Improve generation of hints

Improve generation of hints


State.

State.

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
@@ -111,14 +111,15 @@

 (defn demo-competition-to-modify-atom []
   (let [n-attempts-atom (atom 0)]
-    (letfn [(create-competing-threads []
+    (letfn [(long-running-inc [n]
+              (swap! n-attempts-atom inc)
+              (Thread/sleep (rand-int 100))
+              (inc n))
+            (long-running-inc-on-atom []
+              (swap! competing-updates-atom long-running-inc))
+            (create-competing-threads []
               (dotimes [_ n-competitors]
-                (.start (Thread. (fn []
-                                   (swap! competing-updates-atom
-                                          (fn [n]
-                                            (swap! n-attempts-atom inc)
-                                            (Thread/sleep (rand-int 100))
-                                            (inc n))))))))
+                (.start (Thread. long-running-inc-on-atom))))
             (report-on-what-is-happening []
               (loop []
                 (println [@competing-updates-atom


Switch to a timer so that we can specify time units and have nanoseconds as the default across microservices

--- src/kixi/datastore/metrics.clj
+++ src/kixi/datastore/metrics.clj
@@ -5,11 +5,12 @@
             [kixi.metrics.reporters.json-console :as reporter]
             [metrics
              [core :refer [new-registry]]
-             [histograms :refer [histogram update!]]
+             [timers :refer [time! timer]]
              [meters :refer [mark! meter]]]
             [metrics.jvm.core :as jvm]
             [metrics.ring.expose :as expose]
-            [taoensso.timbre :as log]))
+            [taoensso.timbre :as log])
+  (:import (java.util.concurrent TimeUnit)))

 (def upper-name
   (memoize
@@ -53,9 +54,8 @@
     (let [metric-name (request-ctx->metric-name ctx)
           met (meter registry (append-rates metric-name))]
       (when-let [start-time (get-in ctx [:metrics ky])]
-      ;On exception this won't get the modified context, i.e. the one with start time in it. This is due to the manifold chain and catch mechinism used.
-        (update! (histogram registry metric-name)
-                 (- (now) start-time)))
+        ;On exception this won't get the modified context, i.e. the one with start time in it. This is due to the manifold chain and catch mechinism used.
+        (.update (timer registry metric-name) (- (now) start-time) TimeUnit/MILLISECONDS))
       (mark! met))
     ctx))


Added some debugging info to try to debug #1

--- src/leiningen/new/electron.clj
+++ src/leiningen/new/electron.clj
@@ -7,8 +7,12 @@
 (def render (renderer "electron"))

 ;; From: https://github.com/http-kit/lein-template/blob/master/src/leiningen/new/http_kit.clj
-(defn binary [file]
-  (io/input-stream (io/resource (str/join "/" ["leiningen" "new" "electron" file]))))
+(defn binary [file-name]
+  (let [f     (str/join "/" ["leiningen" "new" "electron" file-name])
+        res   (io/resource f)]
+    (println f)
+    (println res)
+    (io/input-stream res)))

 (defn electron
   [name]


Add latest version of nrepl for Clojure dev

- cider-jack-in and rock the world

--- clojure/profiles.clj
+++ clojure/profiles.clj
@@ -1,8 +1,9 @@
 {:user
-  {:plugins [[lein-localrepo "0.5.4"] ;; https://github.com/kumarshantanu/lein-localrepo
-             [lein-nevam "0.1.2"]     ;; Convert pom.xml to project.clj
-             [lein-pprint "1.2.0"]]   ;; Pretty-print a representation of the project map
-   :dependencies [[alembic "0.3.2"]
-                  [pjstadig/humane-test-output "0.8.3"]]
-   :injections [(require 'pjstadig.humane-test-output)
-                (pjstadig.humane-test-output/activate!)]}}
+ {:plugins [[lein-localrepo "0.5.4"] ;; https://github.com/kumarshantanu/lein-localrepo
+            [lein-nevam "0.1.2"]     ;; Convert pom.xml to project.clj
+            [lein-pprint "1.2.0"]    ;; Pretty-print a representation of the project map
+            [nrepl "0.6.0"]]
+  :dependencies [[alembic "0.3.2"]
+                 [pjstadig/humane-test-output "0.8.3"]]
+  :injections [(require 'pjstadig.humane-test-output)
+               (pjstadig.humane-test-output/activate!)]}}


style fix

style fix

--- src/main/clojure/cljs/core.clj
+++ src/main/clojure/cljs/core.clj
@@ -875,7 +875,7 @@
         fields (vec (map #(with-meta % nil) fields))
         base-fields fields
         pr-open (core/str "#" (.getNamespace rname) "." (.getName rname) "{")
-        fields (conj fields '__meta '__extmap (with-meta '__hash {:mutable true}))]
+        fields (conj fields '__meta '__extmap '^:mutable __hash)]
     (let [gs (gensym)
           ksym (gensym "k")
           impls (concat
@@ -979,7 +979,7 @@
                          (. ~(first sig) ~slot ~@sig)
                          (let [x# (if (nil? ~(first sig)) nil ~(first sig))]
                            ((or
-                             (aget ~(fqn fname) (js/goog.typeOf x#))
+                             (aget ~(fqn fname) (goog/typeOf x#))
                              (aget ~(fqn fname) "_")
                              (throw (missing-protocol
                                      ~(core/str psym "." fname) ~(first sig))))


(SERVER-2550) Add very basic http endpoint test for CRL update

--- test/integration/puppetlabs/services/certificate_authority/certificate_authority_int_test.clj
+++ test/integration/puppetlabs/services/certificate_authority/certificate_authority_int_test.clj
@@ -673,3 +673,34 @@
              formatter (time-format/formatter "YYY-MM-dd'T'HH:mm:ssz")]
          (is (time/after? (time-format/parse formatter ca-exp) (time/now)))
          (is (time/after? (time-format/parse formatter crl-exp) (time/now))))))))
+
+(deftest update-crl-endpoint-test
+  (bootstrap/with-puppetserver-running-with-mock-jrubies
+   "JRuby mocking is safe here because all of the requests are to the CA
+     endpoints, which are implemented in Clojure."
+   app
+   {:jruby-puppet
+    {:gem-path [(ks/absolute-path jruby-testutils/gem-path)]}
+    :webserver
+    {:ssl-cert (str bootstrap/master-conf-dir "/ssl/certs/localhost.pem")
+     :ssl-key (str bootstrap/master-conf-dir "/ssl/private_keys/localhost.pem")
+     :ssl-ca-cert (str bootstrap/master-conf-dir "/ssl/ca/ca_crt.pem")
+     :ssl-crl-path (str bootstrap/master-conf-dir "/ssl/crl.pem")}}
+   (testing "valid CRL returns 200"
+     (let [response (http-client/put
+                     "https://localhost:8140/puppet-ca/v1/certificate_revocation_list"
+                     {:ssl-cert (str bootstrap/master-conf-dir "/ssl/ca/ca_crt.pem")
+                      :ssl-key (str bootstrap/master-conf-dir "/ssl/ca/ca_key.pem")
+                      :ssl-ca-cert (str bootstrap/master-conf-dir "/ssl/ca/ca_crt.pem")
+                      :as :text
+                      :body (slurp (str bootstrap/master-conf-dir "/ssl/crl.pem"))})]
+       (is (= 200 (:status response)))))
+   (testing "bad data returns 400"
+     (let [response (http-client/put
+                     "https://localhost:8140/puppet-ca/v1/certificate_revocation_list"
+                     {:ssl-cert (str bootstrap/master-conf-dir "/ssl/ca/ca_crt.pem")
+                      :ssl-key (str bootstrap/master-conf-dir "/ssl/ca/ca_key.pem")
+                      :ssl-ca-cert (str bootstrap/master-conf-dir "/ssl/ca/ca_crt.pem")
+                      :as :text
+                      :body "Bad data"})]
+       (is (= 400 (:status response)))))))


A way to generate a pruned and readable AST

--- src/cljs/go.clj
+++ src/cljs/go.clj
@@ -1,14 +1,30 @@
 (ns cljs.go
-  (:require [cljs.closure]
+  (:require [cljs.analyzer]
+            [cljs.closure]
             [cljs.env]
             [cljs.js-deps]
             [cljs.go.compiler]
             [clojure.string :as s]
+            [clojure.walk :as w]
             [clojure.java.shell :as sh]))

 (defn cljs->go [in]
   (cljs.env/with-compiler-env (cljs.env/default-compiler-env)
     (doall (cljs.closure/-compile in {}))))
+
+(defn cljs->readable-ast [in]
+  (let [single? (not (sequential? in))]
+    (binding [cljs.analyzer/*cljs-ns* 'cljs.user]
+      (cond->
+       (doall
+        (for [form (cond-> in single? list)]
+          (->> form
+               (cljs.analyzer/analyze (cljs.analyzer/empty-env))
+               (w/prewalk
+                #(cond-> % (map? %) (dissoc :children :locals :ns :column
+                                            :protocol-inline :protocol-impl
+                                            :doc :js-globals :jsdoc))))))
+       single? first))))

 (defn go->str [in]
   (if (seq? in)
@@ -70,6 +86,12 @@
        println)

   (->> '[(ns hello)
+         (defn main []
+           (println "Hello World"))]
+       cljs->readable-ast
+       clojure.pprint/pprint)
+
+  (->> '[(ns hello)
          (defn foo
            ([] (foo "World"))
            ([x] (println "Hello " x))


put directly in the nav channel, so that we can use a button

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -100,6 +100,7 @@
     om/IRender
     (render [_]
       (let [cast! (om/get-shared owner :cast!)
+            nav-ch (om/get-shared owner [:comms :nav])
             word-list (shuffle ["precursor"
                                 "prototype"
                                 "wireframe"
@@ -127,10 +128,11 @@
             random-word (nth word-list (- (count word-list) 4))]
         (html
           [:div.make-button-wrap
-           [:a.make-button
+           [:button.make-button
             {:role "button"
-             :on-click #(cast! :landing-closed)
-             :href (str "/document/" id)
+             :on-click #(do
+                          (cast! :landing-closed)
+                          (put! nav-ch [:navigate! {:path (str "/document/" id)}]))
              :on-mouse-enter #(om/refresh! owner)}
             [:div.make-prepend "Make a"]
             ;; [:div.make-prepend "Or make a"] ;; for bottom cta


remove menu view classes until we need them

--- src-cljs/frontend/components/overlay.cljs
+++ src-cljs/frontend/components/overlay.cljs
@@ -22,7 +22,7 @@
     om/IRender
     (render [_]
       (let [cast! (om/get-shared owner :cast!)
-            menu-button-learned? (get-in data state/menu-button-learned-path)] ; TODO figure out if this should be different because we used to call chat menu "the menu"
+            main-menu-learned? (get-in data state/main-menu-learned-path)]
         (html
           [:a.main-menu-button {:on-click (if (overlay-visible? data)
                                             #(cast! :overlay-menu-closed)
@@ -72,7 +72,7 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)]
         (html
-          [:div.menu-view {:class (str "menu-view-" "start")}
+          [:div.menu-view
            [:div.menu-view-frame
             [:a.menu-item {:on-click #(cast! :overlay-info-toggled)
                            :role "button"}
@@ -104,7 +104,7 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)]
         (html
-          [:div.menu-view {:class (str "menu-view-" "invite")}
+          [:div.menu-view
            [:article.menu-view-frame
             [:h2 "Show this idea to your team."]
             [:p "Send your team invites to come collaborate with you in this doc. Separate emails with a space or a comma."]
@@ -133,7 +133,7 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)]
         (html
-          [:div.menu-view {:class (str "menu-view-" "info")}
+          [:div.menu-view
            [:article.menu-view-frame
             [:h2 "What is Precursor?"]
             [:p "No-nonsense prototyping—perfect for wireframing, sketching, and brainstorming. "
@@ -174,7 +174,7 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)]
         (html
-          [:div.menu-view {:class (str "menu-view-" "shortcuts")}
+          [:div.menu-view
            [:article.menu-view-frame
             [:h2 "Move fast, make things."]
             [:div.shortcuts-item
@@ -209,7 +209,7 @@
     (render [_]
       (let [cast! (om/get-shared owner :cast!)]
         (html
-         [:div.menu-view {:class (str "menu-view-" "username")}
+         [:div.menu-view
           [:article.menu-view-frame
            [:h2 "Let's change that name."]
            [:p "Sign up to change how your name appears in chat.


Clone repository

Clone repository

--- src/midara/builder/builder.clj
+++ src/midara/builder/builder.clj
@@ -66,7 +66,7 @@
     (println "Build with command: echo " args  build-log "; sleep 15")
     (println (System/getProperty "user.dir"))
     (println (-> (java.io.File. ".") .getAbsolutePath))
-    (sh "sh" "-c" (str "echo " args "> " build-log "; sleep 15"))))
+    (sh "sh" "-c" (str "cd " workdir ";" "git clone --depth 1 git@github.com:" owner "/" name ".git; " pwd" " > " build-log "; sleep 15"))))

 (defn build
   ; Start the build process


Close out the loops before shutting down ZK.

--- src/onyx/coordinator/async.clj
+++ src/onyx/coordinator/async.clj
@@ -131,7 +131,7 @@
   (let [shutdown (:shutdown (extensions/read-node sync peer))]
     (extensions/delete sync shutdown)))

-(defn born-peer-ch-loop [sync sync-ch born-tail offer-head dead-head]
+(defn born-peer-ch-loop [sync sync-ch born-tail offer-head dead-head dead-ch]
   (loop []
     (when (<!! born-tail)
       (let [offset (extensions/next-offset sync :born-log)]
@@ -142,7 +142,7 @@
             (>!! offer-head peer)))
         (recur)))))

-(defn dead-peer-ch-loop [sync sync-ch dead-tail evict-head offer-head]
+(defn dead-peer-ch-loop [sync sync-ch dead-tail evict-head offer-head dead-ch]
   (loop []
     (when-let [peer-node (<!! dead-tail)]
       (when (mark-peer-death sync sync-ch peer-node)
@@ -152,7 +152,7 @@
         (>!! offer-head peer-node))
       (recur))))

-(defn planning-ch-loop [sync queue planning-tail offer-head]
+(defn planning-ch-loop [sync queue planning-tail offer-head dead-ch]
   (loop []
     (when (<!! planning-tail)
       (let [offset (extensions/next-offset sync :planning-log)]
@@ -165,13 +165,13 @@
             (>!! offer-head job-id)))
         (recur)))))

-(defn ack-ch-loop [sync sync-ch ack-tail]
+(defn ack-ch-loop [sync sync-ch ack-tail dead-ch]
   (loop []
     (when-let [ack-node (:path (<!! ack-tail))]
       (acknowledge-task sync sync-ch ack-node)
       (recur))))

-(defn evict-ch-loop [sync sync-ch evict-tail offer-head shutdown-head]
+(defn evict-ch-loop [sync sync-ch evict-tail offer-head shutdown-head dead-ch]
   (loop []
     (when (<!! evict-tail)
       (let [offset (extensions/next-offset sync :evict-log)]
@@ -186,7 +186,7 @@

 (defn offer-ch-loop
   [sync sync-ch revoke-delay offer-tail ack-head exhaust-head
-   complete-head revoke-head]
+   complete-head revoke-head dead-ch]
   (loop []
     (when (<!! offer-tail)
       (let [offset (extensions/next-offset sync :offer-log)]
@@ -200,7 +200,7 @@
         (extensions/checkpoint sync :offer-log offset)
         (recur)))))

-(defn offer-revoke-ch-loop [sync sync-ch offer-revoke-tail evict-head]
+(defn offer-revoke-ch-loop [sync sync-ch offer-revoke-tail evict-head dead-ch]
   (loop []
     (when (<!! offer-revoke-tail)
       (let [offset (extensions/next-offset sync :revoke-log)]
@@ -210,7 +210,7 @@
           (extensions/checkpoint sync :revoke-log offset))
         (recur)))))

-(defn exhaust-queue-loop [sync sync-ch exhaust-tail seal-head]
+(defn exhaust-queue-loop [sync sync-ch exhaust-tail seal-head dead-ch]
   (loop []
     (when-let [node (:path (<!! exhaust-tail))]
       (when-let [result (exhaust-queue sync sync-ch node)]
@@ -218,7 +218,7 @@
         (>!! seal-head result))
       (recur))))

-(defn seal-resource-loop [sync seal-tail exhaust-head]
+(defn seal-resource-loop [sync seal-tail exhaust-head dead-ch]
   (loop []
     (when (<!! seal-tail)
       (let [offset (extensions/next-offset sync :seal-log)]
@@ -231,14 +231,14 @@
         (recur)))))

 (defn completion-ch-loop
-  [sync sync-ch complete-tail offer-head complete-head]
+  [sync sync-ch complete-tail offer-head complete-head dead-ch]
   (loop []
     (when-let [node (:path (<!! complete-tail))]
       (when-let [result (complete-task sync sync-ch node #(>!! complete-head %))]
         (>!! offer-head result))
       (recur))))

-(defn shutdown-ch-loop [sync shutdown-tail]
+(defn shutdown-ch-loop [sync shutdown-tail dead-ch]
   (loop []
     (when-let [peer (<!! shutdown-tail)]
       (shutdown-peer sync peer)
@@ -305,8 +305,20 @@
           seal-mult (mult seal-ch-head)
           completion-mult (mult completion-ch-head)
           shutdown-mult (mult shutdown-ch-head)
-          failure-mult (mult failure-ch-head)]
-
+          failure-mult (mult failure-ch-head)
+
+          planning-dead-ch (chan)
+          born-peer-dead-ch (chan)
+          dead-peer-dead-ch (chan)
+          evict-dead-ch (chan)
+          offer-dead-ch (chan)
+          offer-revoke-dead-ch (chan)
+          ack-dead-ch (chan)
+          exhaust-dead-ch (chan)
+          seal-dead-ch (chan)
+          completion-dead-ch (chan)
+          shutdown-dead-ch (chan)]
+
       (tap planning-mult planning-ch-tail)
       (tap born-peer-mult born-peer-ch-tail)
       (tap dead-peer-mult dead-peer-ch-tail)
@@ -419,6 +431,39 @@

       (dire/with-handler! #'shutdown-ch-loop
         java.lang.Exception (fn [e & _] (warn e)))
+
+      (dire/with-finally! #'born-peer-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'dead-peer-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'planning-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'ack-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'evict-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'offer-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'offer-revoke-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'exhaust-queue-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'seal-resource-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'completion-ch-loop
+        (fn [& args] (>!! (last args) true)))
+
+      (dire/with-finally! #'shutdown-ch-loop
+        (fn [& args] (>!! (last args) true)))

       (r/repair-planning-messages! sync #(>!! planning-ch-head %))
       (r/repair-birth-messages! sync #(>!! born-peer-ch-head %))
@@ -453,6 +498,18 @@
         :shutdown-ch-head shutdown-ch-head
         :failure-ch-head failure-ch-head

+        :planning-dead-ch planning-dead-ch
+        :born-peer-dead-ch born-peer-dead-ch
+        :dead-peer-dead-ch dead-peer-dead-ch
+        :evict-dead-ch evict-dead-ch
+        :offer-dead-ch offer-dead-ch
+        :offer-revoke-dead-ch offer-revoke-dead-ch
+        :ack-dead-ch ack-dead-ch
+        :exhaust-dead-ch exhaust-dead-ch
+        :seal-dead-ch seal-dead-ch
+        :completion-dead-ch completion-dead-ch
+        :shutdown-dead-ch shutdown-dead-ch
+
         :planning-mult planning-mult
         :born-peer-mult born-peer-mult
         :dead-peer-mult dead-peer-mult
@@ -467,19 +524,19 @@
         :failure-mult failure-mult

         :sync-thread (thread (sync-ch-loop sync sync-ch failure-ch-head))
-        :born-peer-thread (thread (born-peer-ch-loop sync sync-ch born-peer-ch-tail offer-ch-head dead-peer-ch-head))
-        :dead-peer-thread (thread (dead-peer-ch-loop sync sync-ch dead-peer-ch-tail evict-ch-head offer-ch-head))
-        :planning-thread (thread (planning-ch-loop sync queue planning-ch-tail offer-ch-head))
-        :ack-thread (thread (ack-ch-loop sync sync-ch ack-ch-tail))
-        :evict-thread (thread (evict-ch-loop sync sync-ch evict-ch-tail offer-ch-head shutdown-ch-head))
-        :offer-revoke-thread (thread (offer-revoke-ch-loop sync sync-ch offer-revoke-ch-tail evict-ch-head))
-        :exhaust-thread (thread (exhaust-queue-loop sync sync-ch exhaust-ch-tail seal-ch-head))
-        :seal-thread (thread (seal-resource-loop sync seal-ch-tail exhaust-ch-head))
-        :completion-thread (thread (completion-ch-loop sync sync-ch completion-ch-tail offer-ch-head completion-ch-head))
+        :born-peer-thread (thread (born-peer-ch-loop sync sync-ch born-peer-ch-tail offer-ch-head dead-peer-ch-head born-peer-dead-ch))
+        :dead-peer-thread (thread (dead-peer-ch-loop sync sync-ch dead-peer-ch-tail evict-ch-head offer-ch-head dead-peer-dead-ch))
+        :planning-thread (thread (planning-ch-loop sync queue planning-ch-tail offer-ch-head planning-dead-ch))
+        :ack-thread (thread (ack-ch-loop sync sync-ch ack-ch-tail ack-dead-ch))
+        :evict-thread (thread (evict-ch-loop sync sync-ch evict-ch-tail offer-ch-head shutdown-ch-head evict-dead-ch))
+        :offer-revoke-thread (thread (offer-revoke-ch-loop sync sync-ch offer-revoke-ch-tail evict-ch-head offer-revoke-dead-ch))
+        :exhaust-thread (thread (exhaust-queue-loop sync sync-ch exhaust-ch-tail seal-ch-head exhaust-dead-ch))
+        :seal-thread (thread (seal-resource-loop sync seal-ch-tail exhaust-ch-head seal-dead-ch))
+        :completion-thread (thread (completion-ch-loop sync sync-ch completion-ch-tail offer-ch-head completion-ch-head completion-dead-ch))
         :failure-thread (thread (failure-ch-loop failure-ch-tail))
-        :shutdown-thread (thread (shutdown-ch-loop sync shutdown-ch-tail))
+        :shutdown-thread (thread (shutdown-ch-loop sync shutdown-ch-tail shutdown-dead-ch))
         :offer-thread (thread (offer-ch-loop sync sync-ch revoke-delay offer-ch-tail ack-ch-head
-                                             exhaust-ch-head completion-ch-head offer-revoke-ch-head)))))
+                                             exhaust-ch-head completion-ch-head offer-revoke-ch-head offer-dead-ch)))))

   (stop [component]
     (info "Stopping Coordinator")
@@ -498,6 +555,30 @@
     (close! (:shutdown-ch-head component))
     (close! (:failure-ch-head component))

+    (<!! (:planning-dead-ch component))
+    (<!! (:born-peer-dead-ch component))
+    (<!! (:dead-peer-dead-ch component))
+    (<!! (:evict-dead-ch component))
+    (<!! (:offer-dead-ch component))
+    (<!! (:offer-revoke-dead-ch component))
+    (<!! (:ack-dead-ch component))
+    (<!! (:exhaust-dead-ch component))
+    (<!! (:seal-dead-ch component))
+    (<!! (:completion-dead-ch component))
+    (<!! (:shutdown-dead-ch component))
+
+    (close! (:planning-dead-ch component))
+    (close! (:born-peer-dead-ch component))
+    (close! (:dead-peer-dead-ch component))
+    (close! (:evict-dead-ch component))
+    (close! (:offer-dead-ch component))
+    (close! (:offer-revoke-dead-ch component))
+    (close! (:ack-dead-ch component))
+    (close! (:exhaust-dead-ch component))
+    (close! (:seal-dead-ch component))
+    (close! (:completion-dead-ch component))
+    (close! (:shutdown-dead-ch component))
+
     component))

 (defn coordinator [{:keys [onyx.coordinator/revoke-delay]}]


Move writing :log-parameters from ReplicaSubscription into LogWriter

--- src/onyx/peer/communicator.clj
+++ src/onyx/peer/communicator.clj
@@ -24,6 +24,16 @@

   (start [{:keys [log] :as component}]
     (taoensso.timbre/info "Starting Log Writer")
+    ;; Race to write the job scheduler and messaging to durable storage so that
+    ;; non-peers subscribers can discover which properties to use.
+    ;; Only one writer will succeed, and only one needs to.
+
+    (extensions/write-chunk log
+                            :log-parameters
+                            {:job-scheduler (:onyx.peer/job-scheduler peer-config)
+                             :messaging (select-keys peer-config [:onyx.messaging/impl])
+                             :log-version onyx.peer.log-version/version}
+                            nil)
     (let [outbox-ch (chan (arg-or-default :onyx.peer/outbox-capacity peer-config))
           outbox-loop-thread (thread (outbox-loop log outbox-ch group-ch))]
       (assoc component
@@ -45,17 +55,6 @@

   (start [{:keys [log] :as component}]
     (taoensso.timbre/info "Starting Replica Subscription")
-    ;; Race to write the job scheduler and messaging to durable storage so that
-    ;; non-peers subscribers can discover which properties to use.
-    ;; Only one writer will succeed, and only one needs to.
-
-    (extensions/write-chunk log
-                            :log-parameters
-                            {:job-scheduler (:onyx.peer/job-scheduler peer-config)
-                             :messaging (select-keys peer-config [:onyx.messaging/impl])
-                             :log-version onyx.peer.log-version/version}
-                            nil)
-
     (let [group-id (java.util.UUID/randomUUID)
           inbox-ch (chan (arg-or-default :onyx.peer/inbox-capacity peer-config))
           origin (extensions/subscribe-to-log log inbox-ch)]


Clean up lifecycle resources.

Clean up lifecycle resources.

--- src/onyx/peer/virtual_peer.clj
+++ src/onyx/peer/virtual_peer.clj
@@ -4,7 +4,14 @@
             [taoensso.timbre :as timbre]
             [dire.core :as dire]
             [onyx.extensions :as extensions]
+            [onyx.peer.task-lifecycle-extensions :as l-ext]
             [onyx.peer.task-lifecycle :refer [task-lifecycle]]))
+
+(defn force-close-pipeline! [pipeline]
+  (try
+    (l-ext/close-lifecycle-resources* (:pipeline-data pipeline))
+    (catch Exception e
+      (timbre/warn e))))

 (defn payload-loop [id sync queue payload-ch shutdown-ch status-ch dead-ch pulse opts]
   (let [complete-ch (chan 1)
@@ -17,6 +24,7 @@
         (cond (nil? v) (extensions/delete sync (:node pulse))
               (= ch complete-ch) (recur nil)
               (= ch shutdown-ch) (recur nil)
+              (= ch err-ch) (force-close-pipeline! pipeline)
               (= ch payload-ch)
               (let [payload-node (:path v)
                     payload (extensions/read-node sync payload-node)


Further Graphviz visual tweaks

Further Graphviz visual tweaks

--- src/overtone/repl/graphviz.clj
+++ src/overtone/repl/graphviz.clj
@@ -48,7 +48,7 @@
   (with-out-str
     (doseq [ug ugs]
       (if (:control-param ug)
-        (println (str (:id ug) " [label = \"" (-> ug :name) "\n " (keyword (-> ug :control-param :name))  "\n default: " (-> ug :control-param :default) "\" shape=invhouse style=\"rounded, bold\" ]; "))
+        (println (str (:id ug) " [label = \"" (-> ug :name) "\n " (keyword (-> ug :control-param :name))  "\n default: " (-> ug :control-param :default) "\" shape=invhouse style=\"rounded, filled, bold\" fillcolor=black fontcolor=white ]; "))
         (println (str (:id ug)
                       (with-out-str
                         (print " [label = \"{")
@@ -76,11 +76,11 @@
                       "<__UG_NAME__>"(graphviz-escape-chars (:name ug))

                       " }\" style=" (cond
-                                     (= :ar (:rate ug)) "\"bold, rounded\""
-                                     (= :kr (:rate ug)) "\"filled, bold, rounded\""
-                                     (= :dr (:rate ug)) "\"filled, bold, diagonals\""
+                                     (= :ar (:rate ug)) "\"filled, bold, rounded\" "
+                                     (= :kr (:rate ug)) "\"bold, rounded\""
+                                     (= :dr (:rate ug)) "\"bold, diagonals\" "
                                      (= :ir (:rate ug)) "\"dashed, rounded\""
-                                     :else "\"filled, bold, rounded\"") " shape=record rankdir=LR];"))))))
+                                     :else "\"\"") " shape=record rankdir=LR];"))))))

 (defn- print-connection
   [n input ug]


set base k to 50 (bucketize beyond 50 people)

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -28,7 +28,7 @@
                   (merge {:n-comps 2
                           :pca-iters 10
                           :base-iters 10
-                          :base-k 100
+                          :base-k 50
                           :group-iters 10
                           :group-k 3}
                     opts))


actually call `enable-console-print!` in devcards examples


Rename move-away to move-away!

Rename move-away to move-away!

--- src/mdr2/abacus.clj
+++ src/mdr2/abacus.clj
@@ -93,7 +93,7 @@
   [file]
   (file-startswith? file ["SN3_" "SN12_"]))

-(defn move-away [f reason]
+(defn move-away! [f reason]
   (let [new-name (str reason "_" (.getName f))
         new-path (nio/resolve-sibling f new-name)]
     (nio/move! f new-path StandardCopyOption/REPLACE_EXISTING)))
@@ -121,7 +121,7 @@
              (format "Production %s has no DAISY Export in %s"
                      product_number (path/manifest-path production)))]
         (log/warn message)
-        (move-away f "Failed")))))
+        (move-away! f "Failed")))))

 (defn import-recorded-production
   "Import a recorded production from file `f`"
@@ -130,7 +130,7 @@
     (import-valid-recorded-production f)
     (do
       (log/warnf "ABACUS input file %s not valid" (.getName f))
-      (move-away f "Invalid"))))
+      (move-away! f "Invalid"))))

 (defn import-recorded-productions
   "Import recorded productions from ABACUS and put them on the archive queue"


Make i18n slightly more smart

Make i18n slightly more smart

in that it falls back to :de if the translations do not contain the
language

--- src/mdr2/dtbook.clj
+++ src/mdr2/dtbook.clj
@@ -26,17 +26,12 @@
     :enclosures "Talking book enclosures"
     :end "End of book"}})

-(defn- fallback
-  "Return the `language` or the fallback language if `language` is blank"
-  [language]
-  (if (s/blank? language)
-    "de"
-    language))
-
 (defn- translate
-  "Return a string for the given `key` and `locale`"
-  [locale key]
-  (get-in translations [locale key] key))
+  "Return a string for the given `key` and `language`"
+  [language key]
+  (let [l (keyword language)
+        locale (if (contains? translations l) l :de)]
+    (get-in translations [locale key] key)))

 (defn default-book
   "Return an default book sexp"
@@ -52,8 +47,7 @@
 (defn commercial-audiobook
   "Return an sexp for the body of a commercial audiobook"
   [title creator language]
-  (let [locale (keyword (fallback language))
-        t (partial translate locale)]
+  (let [t (partial translate language)]
     [:book
      [:frontmatter
       [:doctitle title]


(SERVER-1772) Update ezbake.manifest with uberjar info

Update generate-manifest-file to include dependency information for any
additional uberjars that have been included in the project.

Changes the function from using a formatted string to an arguably better
mustache template, since mustache is already used elsewhere in ezbake

--- src/puppetlabs/ezbake/core.clj
+++ src/puppetlabs/ezbake/core.clj
@@ -68,6 +68,10 @@
    (schema/optional-key :java-args) schema/Str
    (schema/optional-key :logrotate-enabled) schema/Bool})

+(def UberjarInfo
+  {:uberjar File
+   :lein-project {schema/Any schema/Any}})
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Shell / Filesystem Helpers

@@ -180,26 +184,48 @@
     (fs/file config-dir)))

 (defn generate-manifest-file
-  [lein-project]
-  (spit
-    (fs/file staging-dir "ext" "ezbake.manifest")
-    (format "
+  [lein-project additional-uberjars-info]
+  (let [uberjar-info (for [uberjar-info additional-uberjars-info]
+                       {:uberjar (fs/base-name (:uberjar uberjar-info))
+                        :dependencies (deputils/generate-dependency-tree-string (:lein-project uberjar-info))})
+        template-map
+        {:ezbake-version (get-ezbake-version lein-project)
+         :package-group (:group lein-project)
+         :package-name (:name lein-project)
+         :package-version (:version lein-project)
+         :manifest-string (deputils/generate-manifest-string lein-project)
+         :dependency-tree (deputils/generate-dependency-tree-string lein-project)
+         :additional-uberjar-info uberjar-info
+         :has-additional-uberjars (not (empty? additional-uberjars-info))}]
+    (spit
+     (fs/file staging-dir "ext" "ezbake.manifest")
+     (stencil/render-string "
 This package was built by the Puppet Labs packaging system.

-EZBake version: %s
-Release package: %s/%s (%s)
-Bundled packages: %s
+EZBake version: {{{ezbake-version}}}
+Release package: {{{package-group}}}/{{{package-name}}} ({{{package-version}}})
+Bundled packages: {{{manifest-string}}}
+{{#has-additional-uberjars}}
+Additional Uberjars:
+{{/has-additional-uberjars}}
+{{#additional-uberjar-info}}
+{{{uberjar}}}
+{{/additional-uberjar-info}}

 Dependency tree:

-%s
+{{{dependency-tree}}}
+{{#has-additional-uberjars}}
+Additional uberjar dependencies:
+
+{{/has-additional-uberjars}}
+{{#additional-uberjar-info}}
+{{{uberjar}}}:
+
+{{{dependencies}}}
+{{/additional-uberjar-info}}
 "
-            (get-ezbake-version lein-project)
-            (:group lein-project)
-            (:name lein-project)
-            (:version lein-project)
-            (deputils/generate-manifest-string lein-project)
-            (deputils/generate-dependency-tree-string lein-project))))
+                            template-map))))

 (defn- get-cli-app-files-in
   [jar]
@@ -574,8 +600,10 @@
     (spit out-file-path project-string)
     out-file-path))

-(schema/defn build-uberjar-from-coordinates! :- File
-  "Build an uberjar from maven coordinates and return a file pointing to the built uberjar"
+(schema/defn build-uberjar-from-coordinates! :- UberjarInfo
+  "Build an uberjar from maven coordinates and return a map containing a file
+   pointing to the built uberjar and the lein project map that was used to
+   create it"
   [repositories
    [project-symbol version :as dependency-coordinates]]
   (let [dependency-jar (resolve-dependency! dependency-coordinates repositories)
@@ -596,11 +624,13 @@
     ; When the project.clj file is read by project/read above, it includes the
     ; file's location in the project map that it produces. This is how the
     ; uberjar/uberjar function knows where to create the new uberjar
-    (uberjar/uberjar project-map)))
-
-(schema/defn build-additional-uberjars! :- [schema/Str]
+    (let [uberjar-file (uberjar/uberjar project-map)]
+      {:uberjar uberjar-file
+       :lein-project project-map})))
+
+(schema/defn build-additional-uberjars! :- [UberjarInfo]
   "Builds uberjars from projects specified in the :additional-uberjars section
-  of the ezbake config and returns a list of paths to the built uberjars.
+  of the ezbake config and returns a list of information about the built uberjars.

   For dependency resolution, we use the same list of repositories (under the
   :repositories key in project.clj) as the lein project that ezbake is running
@@ -612,11 +642,11 @@
     (mapv build-fn dependencies)))

 (schema/defn copy-additional-uberjars!
-  [uberjar-paths :- [schema/Str]]
+  [uberjar-info :- [UberjarInfo]]
   (lein-main/info "Copying additional uberjars to staging directory")
-  (doseq [jar-path uberjar-paths]
-    (let [destination-path (format "%s/%s" staging-dir (fs/base-name jar-path))]
-      (fs/copy jar-path destination-path))))
+  (doseq [jar-file (map :uberjar uberjar-info)]
+    (let [destination-path (format "%s/%s" staging-dir (fs/base-name jar-file))]
+      (fs/copy jar-file destination-path))))

 (defmulti action
   (fn [action & args] action))
@@ -651,14 +681,15 @@
           bin-files       (cp-shared-files dependencies get-bin-files-in)
           terminus-files  (cp-terminus-files dependencies build-target)
           upstream-ezbake-configs (get-upstream-ezbake-configs lein-project)
-          additional-uberjars (build-additional-uberjars! lein-project)]
+          additional-uberjar-info (build-additional-uberjars! lein-project)
+          additional-uberjar-filenames (map #(fs/base-name (:uberjar %)) additional-uberjar-info)]
       (cp-shared-files dependencies get-cli-defaults-files-in)
       (cp-shared-files dependencies get-build-scripts-files-in)
       (if cli-app-files
         (cp-cli-wrapper-scripts (:name lein-project)))
       (cp-doc-files lein-project)
-      (when additional-uberjars
-        (copy-additional-uberjars! additional-uberjars))
+      (when additional-uberjar-info
+        (copy-additional-uberjars! additional-uberjar-info))
       (generate-ezbake-config-file! lein-project
                                     build-target
                                     config-files
@@ -667,10 +698,10 @@
                                     bin-files
                                     terminus-files
                                     upstream-ezbake-configs
-                                    (map fs/base-name additional-uberjars))
+                                    additional-uberjar-filenames)
       (let [project-w-deployed-version (assoc lein-project :version deployed-version)]
-        (generate-project-data-yaml project-w-deployed-version build-target (map fs/base-name additional-uberjars))
-        (generate-manifest-file project-w-deployed-version))
+        (generate-project-data-yaml project-w-deployed-version build-target additional-uberjar-filenames)
+        (generate-manifest-file project-w-deployed-version additional-uberjar-info))
       (create-git-repo lein-project))))

 (defmethod action "build"


more merging

more merging

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -151,10 +151,11 @@
   ;; TODO: accept ready-made View
   (insert *metamodel* (do-filter tgt-view src-model attr-keys filter-fn)))

-(defn dtransform [#^Model src-model #^String suffix & #^Collection attribute-descrips]
+(defn dtransform [#^Model src-model #^String suffix #^Keyword key-key #^Keyword version-key & #^Collection attribute-descrips]
   ;; TODO: accept ready-made View ?
   ;; TODO: default key/version from src-model
-  (insert *metamodel* (apply do-transform suffix src-model attribute-descrips)))
+
+  (insert *metamodel* (apply do-transform suffix src-model key-key version-key attribute-descrips)))

 (defn dcount
   ([#^Model src-model key-value]
@@ -170,11 +171,25 @@
    (dsum src-model attribute-key (type key-value) key-value))
   ([#^Model src-model #^Keyword attribute-key #^Class key-type key-value]
    (insert *metamodel* (do-reduce-sum src-model attribute-key key-type key-value)))
+  ([#^Model src-model #^Keyword attribute-key #^Class key-type key-value #^Metadata metadata]
+   (insert *metamodel* (do-reduce-sum src-model attribute-key key-type key-value metadata)))
   )

 ;; TODO: try to lose key-to-value and vice-versa then define dpivot...
 ;; TODO: should mutability be part of metadata ?
 (defn dsplit
+  ([#^Model src-model #^Keyword key #^boolean mutable]
+   (dsplit
+    src-model
+    key
+    mutable
+    list
+    identity
+    (fn [#^Model model value]
+	(insert *metamodel* model)
+	model
+	)
+    ))
   ([#^Model src-model #^Keyword key #^boolean mutable #^IFn tgt-hook]
    (dsplit
     src-model
@@ -201,6 +216,9 @@
     ))
   )

+(defn do-model [#^Model src-model #^String suffix #^Keyword key #^Keyword version]
+  (connect src-model (model (str (.getName src-model) "." suffix) key version (.getMetadata  src-model))))
+
 ;; TODO
 ;; dindex


removing call to get-username from request-reddit-auth-token

--- src/saved_for_reddit/core.cljs
+++ src/saved_for_reddit/core.cljs
@@ -74,7 +74,7 @@
         (if (clojure.string/blank? error)
           (do
             (set-app-state-field :token access-token)
-            (get-username access-token))
+            )
           (handle-error error)))))

 ;; Starting point
@@ -94,14 +94,15 @@
           (set! (.-location js/window) (gen-reddit-auth-url client-id redirect-uri "abcdef"))
           ;; code query param is not nil or token is populated in app state
           (do
-            (if (not (clojure.string/blank? (:token @app-state)))
-              ;; reddit api token already exists in app-state
-              (get-username (:token @app-state))
+            (if  (clojure.string/blank? (:token @app-state))
               ;; app-state does not contain auth-token
               ;; retreive auth-token from reddit api
               (request-reddit-auth-token client-id redirect-uri code))
+            ;; access-token should exist in app-state by this point
+            (get-username (:token @app-state))
             (go (js/setTimeout #(refresh-reddit-auth-token client-id redirect-uri) 3300000)))
           )
+        ;; all reddit auth and setup should be done
         (r/render-component [loggedin-html (:username @app-state)] (dommy/sel1 :#loggedin))
         (r/render-component [search-bar-html] (dommy/sel1 :#search-form))
         (r/render-component [main-html app-state saved-posts] (dommy/sel1 :#app)))


(maint) Stop reencoding json catalog in benchmarking tool

This commit fixes a regression in the benchmarking tool that caused a
catalog to be reencoded to json every iteration of the benchmarking
tool.

--- src/puppetlabs/puppetdb/cli/benchmark.clj
+++ src/puppetlabs/puppetdb/cli/benchmark.clj
@@ -195,29 +195,29 @@
   (if-not (> (- clock lastrun) run-interval)
     state
     (let [base-url {:protocol "http" :host puppetdb-host :port puppetdb-port :prefix "/pdb/query"}
-          catalog (some-> catalog update-catalog (maybe-tweak-catalog rand-percentage) json/generate-string)
-          report (some-> report update-report-run-fields json/generate-string)
-          factset (some-> factset (update-factset rand-percentage) json/generate-string)]
+          catalog (some-> catalog update-catalog (maybe-tweak-catalog rand-percentage))
+          report (some-> report update-report-run-fields)
+          factset (some-> factset (update-factset rand-percentage))]
       ;; Submit the catalog and reports in separate threads, so as to not
       ;; disturb the world-loop and otherwise distort the space-time continuum.
       (when catalog
         (future
           (try
-            (client/submit-catalog base-url 6 catalog)
+            (client/submit-catalog base-url 6 (json/generate-string catalog))
             (log/infof "[%s] submitted catalog" host)
             (catch Exception e
               (log/errorf "[%s] failed to submit catalog: %s" host e)))))
       (when report
         (future
           (try
-            (client/submit-report base-url 5 report)
+            (client/submit-report base-url 5 (json/generate-string report))
             (log/infof "[%s] submitted report" host)
             (catch Exception e
               (log/errorf "[%s] failed to submit report: %s" host e)))))
       (when factset
         (future
           (try
-            (client/submit-facts base-url 4 factset)
+            (client/submit-facts base-url 4 (json/generate-string factset))
             (log/infof "[%s] submitted factset" host)
             (catch Exception e
               (log/errorf "[%s] failed to submit factset: %s" host e)))))
@@ -232,12 +232,12 @@
    based on the clock)"
   [{:keys [host lastrun catalog report factset puppetdb-host puppetdb-port run-interval rand-percentage] :as state}]
   (let [base-url {:protocol "http" :host puppetdb-host :port puppetdb-port :prefix "/pdb/query"}
-        catalog (some-> catalog (maybe-tweak-catalog rand-percentage) json/generate-string)
-        report (some-> report update-report-run-fields json/generate-string)
-        factset (some-> factset (update-factset rand-percentage) json/generate-string)]
-    (when catalog (client/submit-catalog base-url 6 catalog))
-    (when report (client/submit-report base-url 5 report))
-    (when factset (client/submit-facts base-url 4 factset))
+        catalog (some-> catalog (maybe-tweak-catalog rand-percentage))
+        report (some-> report update-report-run-fields)
+        factset (some-> factset (update-factset rand-percentage))]
+    (when catalog (client/submit-catalog base-url 6 (json/generate-string catalog)))
+    (when report (client/submit-report base-url 5 (json/generate-string report)))
+    (when factset (client/submit-facts base-url 4 (json/generate-string factset)))
     (assoc state :catalog catalog)))

 (defn submit-n-messages


Fix argument name

Fix argument name

--- src/sparql_to_graphviz/cli.clj
+++ src/sparql_to_graphviz/cli.clj
@@ -44,9 +44,9 @@
   "Save DOT `diagram` to `output`."
   [output diagram]
   (if (= output *out*)
-    (do (.write output class-diagram) (flush))
+    (do (.write output diagram) (flush))
     (with-open [writer (io/writer output)]
-      (.write writer class-diagram))))
+      (.write writer diagram))))

 (defn- main
   [{::spec/keys [endpoint min-support output]


Handle the case when the query key is an ident.

--- src/untangled/client/impl/data_fetch.cljc
+++ src/untangled/client/impl/data_fetch.cljc
@@ -352,7 +352,9 @@
   "For items that are manually targeted, move them in app state from their result location to their target location."
   [state-atom items]
   (doseq [item items]
-    (let [default-target  [(data-query-key item)]
+    (let [default-target  (if (vector? (data-query-key item))
+                            (data-query-key item)
+                            [(data-query-key item)])
           field-target    (conj (or (data-ident item) []) (::field item))
           explicit-target (or (::target item) [])
           relocate?       (and (not-empty explicit-target)


add a test for correctly receiving an error for unknown commands


Add better naming to newly created icon collections.

--- src/uxbox/main/data/icons.cljs
+++ src/uxbox/main/data/icons.cljs
@@ -104,8 +104,8 @@
 (defrecord CreateCollection []
   rs/WatchEvent
   (-apply-watch [_ state s]
-    (let [coll {:name "Unnamed collection"
-                :id (uuid/random)}]
+    (let [name (str "Unnamed Collection (" (gensym "c") ")")
+          coll {:name name}]
       (->> (rp/req :create/icon-collection coll)
            (rx/map :payload)
            (rx/map collection-created)))))


unneeded test

unneeded test

--- test/matross/config/template_map_test.clj
+++ test/matross/config/template_map_test.clj
@@ -1,34 +0,0 @@
-(ns matross.config.template-map-test
-  (:require [matross.config.template-map]
-            [matross.config.template-map :refer [template-map]]
-            [clojure.test :refer :all])
-  (:import matross.config.template_map.TemplateMap))
-
-(deftest template-map-test
-  (testing "various ways of lookups"
-    (let [tm (template-map {:key "value"})]
-      (is (= (:key tm) "value"))
-      (is (= (:not-key tm "default") "default"))
-      (is (= (tm :key) "value"))
-      (is (= (tm :not-key "default") "default"))))
-
-  (testing "Retrieving a string with a variable gets evaluated"
-    (let [tm (template-map {:key "{{ lookup }}" :lookup "value"})]
-      (is (= (:key tm) "value"))))
-
-  (testing "Circular template reference throws an exception"
-    (let [tm (template-map {:key "{{ key }}"})]
-      (is (thrown? IllegalArgumentException (:key tm))))
-    (let [tm (template-map {:key "{{ lookup }}" :lookup "{{ key }}"})]
-      (is (thrown? IllegalArgumentException (:key tm)))))
-  (testing "A retrieved map is wrapped in a TemplateMap"
-    (let [tm (template-map {:key {:key "value"}})]
-      (is (= (type (:key tm)) TemplateMap))))
-
-  (comment "Map lookups are currently borked"
-    (testing "Complex keys can be templated"
-      (let [tm (template-map {:key "{{a.b}}" :a {:b "value"}})]
-        (is (= (:key tm) "value"))))
-    (testing "Circular lookup fails in maps too"
-      (let [tm (template-map {:key {:key "{{key.key}}"}})]
-        (is (thrown? IllegalArgumentException (get-in tm [:key :key])))))))


Completion tests

Completion tests

--- test/onyx/coordinator/simulation_test.clj
+++ test/onyx/coordinator/simulation_test.clj
@@ -65,14 +65,16 @@
   (with-system
     (fn [coordinator sync log]
       (let [peer (extensions/create sync :peer)
-            offer-ch-spy (chan 1)
-            ack-ch-spy (chan 3)
-            evict-ch-spy (chan 1)
-            failure-ch-spy (chan 1)]
+            offer-ch-spy (chan 5)
+            ack-ch-spy (chan 5)
+            evict-ch-spy (chan 5)
+            completion-ch-spy (chan 5)
+            failure-ch-spy (chan 10)]

         (tap (:offer-mult coordinator) offer-ch-spy)
         (tap (:ack-mult coordinator) ack-ch-spy)
         (tap (:evict-mult coordinator) evict-ch-spy)
+        (tap (:completion-mult coordinator) completion-ch-spy)
         (tap (:failure-mult coordinator) failure-ch-spy)

         (>!! (:born-peer-ch-head coordinator) peer)
@@ -131,11 +133,46 @@
             (let [failure (<!! failure-ch-spy)]
               (is (= (:ch failure) :ack)))))

-        (testing "Completing a task that's already been completed fails")
-
-        (testing "Completing a task from an idle peer fails")
-
-        (testing "Completing a task that doesn't exist fails")
+        (testing "Completing a task that doesn't exist fails"
+          (>!! (:completion-ch-head coordinator) {:path "dead path"})
+          (let [failure (<!! failure-ch-spy)]
+            (is (= (:ch failure) :complete))))
+
+        (testing "Completing a task that's already been completed fails"
+          (let [peer-id (d/tempid :onyx/log)
+                task-id (d/tempid :onyx/log)
+                node-path (str (java.util.UUID/randomUUID))
+                tx [{:db/id peer-id
+                     :peer/status :active
+                     :node/completion node-path
+                     :node/payload (str (java.util.UUID/randomUUID))
+                     :node/ack (str (java.util.UUID/randomUUID))
+                     :node/status (str (java.util.UUID/randomUUID))
+                     :peer/task {:db/id task-id
+                                 :task/complete? true}}]]
+            @(d/transact (:conn log) tx)
+
+            (>!! (:completion-ch-head coordinator) {:path node-path})
+            (let [failure (<!! failure-ch-spy)]
+              (is (= (:ch failure) :complete)))))
+
+        (testing "Completing a task from an idle peer fails"
+          (let [peer-id (d/tempid :onyx/log)
+                task-id (d/tempid :onyx/log)
+                node-path (str (java.util.UUID/randomUUID))
+                tx [{:db/id peer-id
+                     :peer/status :idle
+                     :node/completion node-path
+                     :node/payload (str (java.util.UUID/randomUUID))
+                     :node/ack (str (java.util.UUID/randomUUID))
+                     :node/status (str (java.util.UUID/randomUUID))
+                     :peer/task {:db/id task-id
+                                 :task/complete? false}}]]
+            @(d/transact (:conn log) tx)
+
+            (>!! (:completion-ch-head coordinator) {:path node-path})
+            (let [failure (<!! failure-ch-spy)]
+              (is (= (:ch failure) :complete)))))

         (testing "Evicting a peer that doesn't have a task fails")


Graduating to incremental update

Graduating to incremental update

--- src/wishlistd/models/redis.clj
+++ src/wishlistd/models/redis.clj
@@ -46,12 +46,6 @@
   "Allows incremental updates by merging old and new wishlist maps."
   (r/with-server db
     (when-let [old (read-wishlist code)]
-      (update-wishlist (merge old wishlist)))))
-
-(defn update-merge-new [{:keys [code] :as wishlist}]
-  "Allows incremental updates by merging old and new wishlist maps."
-  (r/with-server db
-    (when-let [old (read-wishlist code)]
       (let [wishes (merge (:wishes old) (:wishes wishlist))
             no-nils (remove-map-nils wishes)
             neu (assoc wishlist :wishes no-nils)]


CMR-2186: Search-public-conf rename caused links to be generated incorrectly

--- search-app/src/cmr/search/services/query_execution/facets/facets_v2_results_feature.clj
+++ search-app/src/cmr/search/services/query_execution/facets/facets_v2_results_feature.clj
@@ -191,7 +191,7 @@
 (defn create-v2-facets
   "Create the facets v2 response. Takes an elastic aggregations result and returns the facets."
   [context elastic-aggregations query]
-  (let [search-public-conf (get-in context [:system :search-public-conf])
+  (let [search-public-conf (get-in context [:system :public-conf])
         base-link (format "%s/collections.json"
                           (conn/root-url
                             (assoc search-public-conf


Version update

Version update

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

--- src/conexp.clj
+++ src/conexp.clj
@@ -12,6 +12,6 @@

 (dorun (map immigrate *conexp-namespaces*))

-(def *conexp-version* 1258483489601)
+(def *conexp-version* 1258574048577)

 nil


only evaluate atomic littorals at compile time

--- src/logfmt.clj
+++ src/logfmt.clj
@@ -16,6 +16,11 @@
   (s/join " "
           (map (fn [[k v]] (str (name k) "=" v)) m)))

+(defn atomic-literal? [x]
+  (or (string? x)
+      (keyword? x)
+      (number? x)))
+
 (defn format-pairs
   "helper function for out and err
    expands any literal values into string values, removing string concatenation
@@ -33,13 +38,13 @@
                (rest remaining)

                (if (first out)
-                 (if (symbol? v)
-                   (conj out (str " " (name k) "=") v)
-                   (conj out (str " " (name k) "=" v)))
+                 (if (atomic-literal? v)
+                   (conj out (str " " (name k) "=" v))
+                   (conj out (str " " (name k) "=") v))

-                 (if (symbol? v)
-                   (conj out (str (name k) "=") v)
-                   (conj out (str (name k) "=" v))))))))))
+                 (if (atomic-literal? v)
+                   (conj out (str (name k) "=" v))
+                   (conj out (str (name k) "=") v)))))))))

 (defmacro out
   "formats a static pair of keys/values and logs it to stdout. Specifically


Unify error-exit paths

Unify error-exit paths

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- examples/example02/client/sdk/src/example02/main.cljs
+++ examples/example02/client/sdk/src/example02/main.cljs
@@ -71,7 +71,7 @@
       (exit -1 "Error: " (string/join errors))

       (nil? id)
-      (println "ERROR: Must specify a chaincodeID")
+      (exit -1 "Error: Must specify a chaincodeID")

       :else
       (let [desc (commands command)


Update to latest ClojureScript master

Update to latest ClojureScript master

--- ClojureScript/replete/project.clj
+++ ClojureScript/replete/project.clj
@@ -1,4 +1,4 @@
 (defproject replete "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0-RC2"]
-                 [org.clojure/clojurescript "0.0-3411"]
+                 [org.clojure/clojurescript "0.0-3422"]
                  [org.clojure/tools.reader "0.10.0-SNAPSHOT" :exclusions [org.clojure/clojure]]])


CMR-1280: fixes some ISO MENDS xml parsing

--- umm-lib/src/cmr/umm/iso_mends/spatial.clj
+++ umm-lib/src/cmr/umm/iso_mends/spatial.clj
@@ -167,15 +167,15 @@
      (x/element :gml:Polygon {:gml:id (gen-id)}
                 (x/element :gml:exterior {} (gml-linear-ring (:points exterior)))
                 (when-not (empty? interior)
-                  (map #(x/element :gml/interior {} (gml-linear-ring (:points %))) interior))))))
+                  (map #(x/element :gml:interior {} (gml-linear-ring (:points %))) interior))))))

 (defmethod geometry->iso-geom cmr.spatial.mbr.Mbr
   [mbr]
   (x/element :gmd:EX_GeographicBoundingBox {}
-             (x/element :gmd:eastBoundingLongitude {} (gco-decimal (:east mbr)))
-             (x/element :gmd:westBoundingLongitude {} (gco-decimal (:west mbr)))
-             (x/element :gmd:northBoundingLatitude {} (gco-decimal (:north mbr)))
-             (x/element :gmd:southBoundingLatitude {} (gco-decimal (:south mbr)))))
+             (x/element :gmd:westBoundLongitude {} (gco-decimal (:west mbr)))
+             (x/element :gmd:eastBoundLongitude {} (gco-decimal (:east mbr)))
+             (x/element :gmd:southBoundLatitude {} (gco-decimal (:south mbr)))
+             (x/element :gmd:northBoundLatitude {} (gco-decimal (:north mbr)))))

 (defn geometry->iso-xml
   "Returns an individual ISO MENDS geographic extent element for a UMM


ARM: imx5: generate dtbs for imx5 boards

It helps to generate device tree blobs for imx5 boards with command
'make ARCH=arm dtbs'.

Signed-off-by: Shawn Guo <912cf7eb7d8018e2943586ae6657d21fd4e38239@linaro.org>

--- arch/arm/mach-imx/Makefile.boot
+++ arch/arm/mach-imx/Makefile.boot
@@ -38,5 +38,8 @@
 params_phys-$(CONFIG_SOC_IMX6Q)	:= 0x10000100
 initrd_phys-$(CONFIG_SOC_IMX6Q)	:= 0x10800000

+dtb-$(CONFIG_MACH_IMX51_DT) += imx51-babbage.dtb
+dtb-$(CONFIG_MACH_IMX53_DT) += imx53-ard.dtb imx53-evk.dtb \
+			       imx53-qsb.dtb imx53-smd.dtb
 dtb-$(CONFIG_SOC_IMX6Q)	+= imx6q-arm2.dtb \
 			   imx6q-sabrelite.dtb


minor refactorings (#336)

minor refactorings (#336)

--- waiter/src/waiter/service_description.clj
+++ waiter/src/waiter/service_description.clj
@@ -751,7 +751,7 @@
         (throw (ex-info (utils/message :cannot-identify-service)
                         (error-message-map-fn passthrough-headers waiter-headers))))
       (sling/try+
-        (let [{:keys [service-id service-description core-service-description]}
+        (let [{:keys [core-service-description service-description service-id]}
               (build service-description-builder user-service-description
                      {:assoc-run-as-user-approved? assoc-run-as-user-approved?
                       :defaults defaults
@@ -796,14 +796,9 @@
 (defn service-id->service-description
   "Loads the service description for the specified service-id including any overrides."
   [kv-store service-id service-description-defaults metric-group-mappings &
-   {:keys [refresh nil-on-missing? effective?] :or {refresh false nil-on-missing? true effective? true}}]
-  (let [core-service-description (fetch-core
-                                   kv-store
-                                   service-id
-                                   :refresh refresh
-                                   :nil-on-missing? nil-on-missing?)]
-    (cond-> core-service-description
-            effective? (default-and-override metric-group-mappings kv-store service-description-defaults service-id))))
+   {:keys [effective? nil-on-missing? refresh] :or {effective? true nil-on-missing? true refresh false}}]
+  (cond-> (fetch-core kv-store service-id :nil-on-missing? nil-on-missing? :refresh refresh)
+          effective? (default-and-override metric-group-mappings kv-store service-description-defaults service-id)))

 (defn can-manage-service?
   "Returns whether the `username` is allowed to modify the specified service description."


cleanup

cleanup

--- services/seq-streamer.clj
+++ services/seq-streamer.clj
@@ -1,14 +0,0 @@
-
-{:name "seq-streamer"
- :path ""
- :func (fn [in-resource & _]
-         (if (pg/eoi? in-resource)
-           (pg/done)
-           (let [buf (byte-array (* 64 1040))
-                 input (->> in-resource io/as-url input-stream)]
-
-             (pg/close-stream input)
-             )))
-
- :description ""
- }


Fill out core_spec for finding parsers and layouts.

--- spec/incise/core_spec.clj
+++ spec/incise/core_spec.clj
@@ -5,10 +5,25 @@
 (describe "namespace is layout or parser filter"
   (it "returns false on non-parser and non-layout namespaces"
     (doseq [ns-sym ['arbitrary.name.space 'my.parser.yay 'your.layout.boop]]
-      (should-not (namespace-is-layout-or-parser ns-sym))))
+      (should-not (namespace-is-layout-or-parser? ns-sym))))
   (it "returns true for parser and layout namespaces"
     (doseq [ns-sym ['incise.parsers.cool-thing 'incise.layouts.bootstrapped]]
-      (should (namespace-is-layout-or-parser ns-sym))))
-  (it "returns false for core parser and layout namespaces"
-    (doseq [core-ns core-namespace-symbols]
-      (should-not (namespace-is-layout-or-parser core-ns)))))
+      (should (namespace-is-layout-or-parser? ns-sym)))))
+
+(describe "namespace is spec or test"
+  (it "returns true for specs and tests"
+    (doseq [ns-sym ['cool.thing-test 'incise.parsers.core-spec]]
+      (should (namespace-is-spec-or-test? ns-sym))))
+  (it "returns false for other namespaces"
+    (doseq [ns-sym ['cool.thing 'incise.parsers.batman]]
+      (should-not (namespace-is-spec-or-test? ns-sym)))))
+
+(describe "finding parsers and layouts"
+  (with layout-and-parser-syms (find-parser-and-layout-symbols))
+  (it "does not contain core namespaces"
+    (doseq [core-sym core-namespace-symbols]
+      (should-not-contain core-sym @layout-and-parser-syms)))
+  (it "should contain default layouts and parsers"
+    (doseq [default-sym ['incise.parsers.markdown
+                         'incise.layouts.page]]
+      (should-contain default-sym @layout-and-parser-syms))))


Update alfa.clj

Update alfa.clj

--- practice/alfa.clj
+++ practice/alfa.clj
@@ -47,5 +47,19 @@
       (first res)
       (recur (dec i) (rest res)))))

+;;range
+(defn range' [i j]
+  (if (< i j)
+    (if (= i j)
+      '()
+      (cons i (range' (inc i) j)))))
+
+(defn range'' [i j]
+  (loop [n i
+         res '()]
+    (if (= n j)
+      (reverse res)
+      (recur (inc n) (cons n res)))))
+
 ;; Reimplementing Clojure in pure recursion
 ;; last, butlast, keep, map, take, take-while, remove, drop, drop-while, distinct, range, for


:bug: Fix bug on images collections filtering.

--- frontend/src/uxbox/main/data/images.cljs
+++ frontend/src/uxbox/main/data/images.cljs
@@ -72,7 +72,7 @@
   ptk/UpdateEvent
   (update [_ state]
     (reduce (fn [state {:keys [id user] :as item}]
-              (let [type (if (uuid/zero? (:user item)) :builtin :own)
+              (let [type (if (uuid/zero? (:user-id item)) :builtin :own)
                     item (assoc item :type type)]
                 (assoc-in state [:images-collections id] item)))
             state


fix list repo data formation

fix list repo data formation

--- cloc-web/src/cloc_web/users.clj
+++ cloc-web/src/cloc_web/users.clj
@@ -54,10 +54,10 @@
     (let [repos (-> (r/table "users")
                     (r/filter (r/fn [u] (r/eq user (r/get-field u :user))))
                     (r/run conn))
-          to-repo-url (fn [id]
-                        (let [[first-part second-part] (rest (split id #"/" 3))]
+          to-repo-url (fn [repo]
+                        (let [[first-part second-part] (rest (split (:id repo) #"/" 3))]
                           (get-repo-location first-part second-part)))]
-      (map #(update-in % [:id] to-repo-url) repos))))
+      (map (juxt to-repo-url identity) repos))))

 (defn- list-github-repos
   [user]
@@ -69,9 +69,11 @@

 (defn list-repos
   [{:keys [user] :as params}]
-  (let [repos (into {} (list-github-repos user))
-        registered (list-registered-repos params)]
-    (merge repos registered)))
+  (let [repos (into {} (list-github-repos user)) ;; {"url":object}
+        registered (into {} (list-registered-repos params))
+        add-registered (fn [repo registered]
+                          (merge repo {:registered registered}))]
+    (merge-with add-registered repos registered)))

 (defn me
   [{:keys [user] :as params}]


Less over-engineered solution for day 9 2017.

--- clojure/src/advent2017/day9.clj
+++ clojure/src/advent2017/day9.clj
@@ -1,31 +1,33 @@
 (ns advent2017.day9
-  "Write an instaparse grammar to parse the input into groups of garbage,
-  ignoring the discard garbage. Part 1 is the sum of the depths of the groups.
-  Part 2 is the sum of the number of non-discard garbage."
-  (:require [instaparse.core :as insta]
-            [advent2017.core :refer [read-puzzle ->lines bfs-lazy]]))
+  "A FSM that tracks group depths and non-discard garbage counts. See git
+  history for the Instaparse grammar version."
+  (:require [advent2017.core :refer [read-puzzle ->lines]]))

 (def puzzle (read-puzzle "day9.data" (comp first ->lines)))

-(def parser
-  (memoize
-   (insta/parser
-    "group           = <'{'> (group_inner <','>)* group_inner? <'}'>
-     <group_inner>   = group | garbage
-     garbage         = <'<'> garbage_inner* <'>'>
-     <garbage_inner> = <garbage_discard> | garbage_keep
-     garbage_discard = #'!.'
-     <garbage_keep>  = !garbage_discard (#'[^>]')")))
+(defn solve [input]
+  (reduce (fn [{:keys [mode depth depths garbage] :as state} c]
+            (case mode
+              :group   (case c
+                         \{ (-> state
+                                (update :depth inc)
+                                (update :depths conj (inc depth)))
+                         \} (update state :depth dec)
+                         \, state
+                         \< (assoc state :mode :garbage))
+              :garbage (case c
+                         \! (assoc state :mode :discard)
+                         \> (assoc state :mode :group)
+                         (update state :garbage inc))
+              :discard (assoc state :mode :garbage)))
+          {:mode    :group
+           :depth   0
+           :depths  []
+           :garbage 0}
+          input))

-(defn solve-1 [input]
-  (apply + (bfs-lazy (parser input)
-                     (fn [a _ _] (= a :group))
-                     (fn [_ depth _] (inc depth)))))
-
-(defn solve-2 [input]
-  (apply + (bfs-lazy (parser input)
-                     (fn [a _ _] (= a :garbage))
-                     (fn [a _ b] (count b)))))
+(def solve-1 (comp (partial apply +) :depths solve))
+(def solve-2 (comp :garbage solve))

 (comment
   (assert (= (solve-1 "{}") 1))


remove awkward captcha reading

remove awkward captcha reading

--- examples/src/queries/captcha_wikipedia.clj
+++ examples/src/queries/captcha_wikipedia.clj
@@ -32,11 +32,3 @@
   (:value (first observes)))

 (def COMPILE-query-args [nil])
-
-;; INFER stuff
-(def directory (clojure.java.io/file "resources/wikipedia-dataset"))
-(def files (take 100 (rest (file-seq directory))))
-(def num-observes (count files))
-(def observes (doall (map vec (map (fn [f] (map vec (.load oxCaptcha (.getPath f)))) files))))
-
-(def INFER-query-args [(first observes)])


First work on simple layers rendering (just WIP).

--- frontend/uxbox/ui/workspace/toolboxes.cljs
+++ frontend/uxbox/ui/workspace/toolboxes.cljs
@@ -27,6 +27,15 @@
   (as-> (l/in [:workspace :drawing]) $
     (l/focus-atom $ st/state)))

+(def ^:static ^:private shapes-by-id
+  (as-> (l/key :shapes-by-id) $
+    (l/focus-atom $ st/state)))
+
+(defn- focus-page
+  [pageid]
+  (as-> (l/in [:pages-by-id pageid]) $
+    (l/focus-atom $ st/state)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Draw Tools
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -79,9 +88,31 @@
 ;; Layers
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

+(defn- layer-element-render
+  [own item selected]
+  (println "layer-element-render" (:id item))
+  (let [selected? (contains? selected (:id item))]
+    (html
+     [:li {:key (str (:id item))}
+      [:div.element-actions
+       [:div.toggle-element i/eye]
+       [:div.block-element i/lock]]
+      [:div.element-icon i/box]
+      [:span (or (:name item)
+                 (:id item))]])))
+
+(def ^:static ^:private layer-element
+  (util/component
+   {:render layer-element-render
+    :name "layer-element"
+    :mixins [mx/static]}))
+
 (defn layers-render
-  []
+  [own]
   (let [workspace (rum/react wb/workspace-state)
+        selected (:selected workspace)
+        shapes-by-id (rum/react shapes-by-id)
+        page (rum/react (focus-page (:page workspace)))
         close #(rs/emit! (dw/toggle-toolbox :layers))]
     (html
      [:div#layers.tool-window
@@ -91,73 +122,53 @@
        [:div.tool-window-close {:on-click close} i/close]]
       [:div.tool-window-content
        [:ul.element-list
-        #_(for [shape (reverse shapes)]
-          (let [{shape-id :shape/uuid
-                 selected? :shape/selected?
-                 locked? :shape/locked?
-                 visible? :shape/visible?
-                 raw-shape :shape/data} shape]
-            [:li {:key shape-id
-                :class (when selected? "selected")}
-             [:div.toggle-element
-              {:class (when visible? "selected")
-               :on-click #(actions/toggle-shape-visibility conn shape-id)} i/eye]
-             [:div.block-element
-              {:class (when locked? "selected")
-               :on-click #(actions/toggle-shape-lock conn shape-id)} i/lock]
-             [:div.element-icon
-              (shapes/icon raw-shape)]
-             [:span (shapes/name raw-shape)]]))
-;; TODO GROUPS
-            [:li
-              [:div.element-actions
-                [:div.toggle-element i/eye]
-                [:div.block-element i/lock]]
-              [:div.element-icon i/box]
-              [:span "Layer name"]]
-
-            [:li.group
-              [:div.element-actions
-                [:div.toggle-element i/eye]
-                [:div.block-element i/lock]
-                [:div.chain-element i/chain]]
-              [:div.element-icon i/folder]
-              [:span "Closed group"]
-              [:span.toggle-content i/arrow-slide]]
-
-            [:li.group.open
-              [:div.element-actions
-                [:div.toggle-element i/eye]
-                [:div.block-element i/lock]
-                [:div.chain-element i/chain]]
-              [:div.element-icon i/folder]
-              [:span "Opened group"]
-              [:span.toggle-content i/arrow-slide]]
-
-            [:li
-              [:div.element-actions
-                [:div.toggle-element i/eye]
-                [:div.block-element i/lock]]
-              [:div.sublevel-element i/sublevel]
-              [:div.element-icon i/box]
-              [:span "Sub layer"]]
-
-            [:li.group
-              [:div.element-actions
-                [:div.toggle-element i/eye]
-                [:div.block-element i/lock]
-                [:div.chain-element i/chain]]
-              [:div.sublevel-element i/sublevel]
-              [:div.element-icon i/folder]
-              [:span "Sub group"]
-              [:span.toggle-content i/arrow-slide]]]]
-
-        [:div.layers-tools
-          [:ul.layers-tools-content
-            [:li.clone-layer i/copy]
-            [:li.group-layer i/folder]
-            [:li.delete-layer i/trash]
-          ]]])))
+        (for [shape (map #(get shapes-by-id %) (:shapes page))
+              :let [component (layer-element shape selected)]]
+          (rum/with-key component (:id shape)))]]
+      [:div.layers-tools
+       [:ul.layers-tools-content
+        [:li.clone-layer i/copy]
+        [:li.group-layer i/folder]
+        [:li.delete-layer i/trash]
+        ]]])))
+
+
+        ;; [:li.group
+        ;;  [:div.element-actions
+        ;;   [:div.toggle-element i/eye]
+        ;;   [:div.block-element i/lock]
+        ;;   [:div.chain-element i/chain]]
+        ;;  [:div.element-icon i/folder]
+        ;;  [:span "Closed group"]
+        ;;  [:span.toggle-content i/arrow-slide]]
+
+        ;; [:li.group.open
+        ;;  [:div.element-actions
+        ;;   [:div.toggle-element i/eye]
+        ;;   [:div.block-element i/lock]
+        ;;   [:div.chain-element i/chain]]
+        ;;  [:div.element-icon i/folder]
+        ;;  [:span "Opened group"]
+        ;;  [:span.toggle-content i/arrow-slide]]
+
+        ;; [:li
+        ;;  [:div.element-actions
+        ;;   [:div.toggle-element i/eye]
+        ;;   [:div.block-element i/lock]]
+        ;;  [:div.sublevel-element i/sublevel]
+        ;;  [:div.element-icon i/box]
+        ;;  [:span "Sub layer"]]
+
+        ;; [:li.group
+        ;;  [:div.element-actions
+        ;;   [:div.toggle-element i/eye]
+        ;;   [:div.block-element i/lock]
+        ;;   [:div.chain-element i/chain]]
+        ;;  [:div.sublevel-element i/sublevel]
+        ;;  [:div.element-icon i/folder]
+        ;;  [:span "Sub group"]
+        ;;  [:span.toggle-content i/arrow-slide]]]]
+

 (def ^:static layers
   (util/component


fix(backend): start http server with no deamon threads

--- backend/src/uxbox/http.clj
+++ backend/src/uxbox/http.clj
@@ -121,7 +121,7 @@
   [config]
   (jetty/run-jetty @app {:join? false
                          :async? true
-                         :daemon? true
+                         :daemon? false
                          :port (:http-server-port config)}))

 (defstate server


:sparkles: Add a proper way to enable/disable assertions on clojure code.

--- backend/src/uxbox/main.clj
+++ backend/src/uxbox/main.clj
@@ -9,16 +9,24 @@

 (ns uxbox.main
   (:require
-   [mount.core :as mount]
-   [uxbox.config :as cfg]
-   [uxbox.migrations]
-   [uxbox.db]
-   [uxbox.http]
-   #_[uxbox.scheduled-jobs])
-  (:gen-class))
+   [mount.core :as mount]))
+
+(defn- enable-asserts
+  [_]
+  (let [m (System/getProperty "uxbox.enable-asserts")]
+    (or (nil? m) (= "true" m))))
+
+;; Set value for current thread binding.
+(set! *assert* (enable-asserts nil))
+
+;; Set value for all new threads bindings.
+(alter-var-root #'*assert* enable-asserts)

 ;; --- Entry point

 (defn -main
   [& args]
+  (load "uxbox/config"
+        "uxbox/migrations"
+        "uxbox/http")
   (mount/start))


include today in UI next holidays

include today in UI next holidays

--- priv/ui/src/holiday_ping_ui/channels/subs.cljs
+++ priv/ui/src/holiday_ping_ui/channels/subs.cljs
@@ -41,7 +41,7 @@
 (defn- next-holiday
   [holidays]
   (let [today     (format/date-to-string (time/today))
-        upcoming? #(> (:date %) today)]
+        upcoming? #(>= (:date %) today)]
     (first (filter upcoming? holidays))))

 (re-frame/reg-sub


add some helper functions

add some helper functions

--- datomic-dsl/src/datomic_dsl/add_nested.clj
+++ datomic-dsl/src/datomic_dsl/add_nested.clj
@@ -4,4 +4,31 @@
    [clojure.zip :as zip]
    [datomic-dsl.created-nested :refer [map-zip dsl-zipper zip-nodes]]))

+(defn up-stepper
+  "Step over the map-entries up."
+  [node]
+  (take-while (complement nil)
+              (iterate zip/up node)))

+(defn zip-nde-map-entries
+  "If this is a map-entry - get the key out of the zipper."
+  [me]
+  (if (= (type (zip/node me)) clojure.lang.MapEntry)
+    (key (zip/node ma))))
+
+(defn steps-up
+  "Keys to the top for a given node."
+  [node]
+  (filter (comp not all?)
+          (map zip-node-map-entries
+               (up-zipper node))))
+
+(defn map-key-seqs
+  "For a given dsl, get a sequence of steps to each of the nested nodes."
+  [dsl]
+  (filter
+   (comp not empty?)
+   (map step-up
+        (zip-nodes
+         dsl-zipper dsl))))
+


Changed tabs to spaces.

Changed tabs to spaces.

--- nav-obj-splitter.clj
+++ nav-obj-splitter.clj
@@ -8,29 +8,29 @@
 (re-find (re-pattern "^Table|Form|Report|Dataport|XMLport|Page|Codeunit") "Table 100 Test Table")

 (defn type-id [type]
-	(cond
-		(= type "Table") 1
-		(= type "Form") 2
-		(= type "Report") 3
-		(= type "Dataport") 4
-		(= type "Codeunit") 5
-		(= type "XMLport") 6
-		(= type "MenuSuite") 7
-		(= type "Page") 8))
+  (cond
+    (= type "Table") 1
+    (= type "Form") 2
+    (= type "Report") 3
+    (= type "Dataport") 4
+    (= type "Codeunit") 5
+    (= type "XMLport") 6
+    (= type "MenuSuite") 7
+    (= type "Page") 8))

 (defn parse-first-line [line]
-	(let [matches (re-find (re-pattern #"^(.+) (\d+) (.+)") line)
-		  type (nth matches 1)
-		  id (nth matches 2)
-		  name (nth matches 3)]
-		{:type-id (type-id type) :type type :id id :name name}))
+  (let [matches (re-find (re-pattern #"^(.+) (\d+) (.+)") line)
+        type (nth matches 1)
+        id (nth matches 2)
+        name (nth matches 3)]
+    {:type-id (type-id type) :type type :id id :name name}))

 (defn make-single-file-name [{type-id :type-id type :type id :id}]
-	"1-Table-100-Test Table")
-
+  "1-Table-100-Test Table")
+
 (defn make-single-file-name []
-	(+ "1" "test"))
-
+  (+ "1" "test"))
+
 (join ["1" "test"])
 (join "-" ["1" "test"])
 (parse-first-line "Table 100 Test Table")


Made area boundaries more pronounced

Made area boundaries more pronounced

--- src-cljs/acfe/render.cljs
+++ src-cljs/acfe/render.cljs
@@ -51,8 +51,8 @@
 			  (clj->js
 			   {:paths glatlngs
 				:strokeColor color
-				:strokeOpacity 0.3
-				:strokeWeight 0.9
+				:strokeOpacity 1.0
+				:strokeWeight 2.0
 				:fillColor color
 				:fillOpacity 0.2
 				:id id


same line literals

same line literals

--- src-cljs/flatride/core.cljs
+++ src-cljs/flatride/core.cljs
@@ -46,8 +46,7 @@
         slopes (increasing-seqs elev-objs)
         longest-slope (longest-seq slopes)
         steepest-slope (greatest-diff-seq slopes)]
-    (display-elev-fn {
-                      :idx idx
+    (display-elev-fn {:idx idx
                       :longest-slope longest-slope
                       :steepest-slope steepest-slope})))

@@ -66,7 +65,6 @@
 (defn process-routes [display-route-fn display-elev-fn routes status]
   (doseq [idx (range (->> routes .-routes .-length))]
     (start-compute-elevation-data (nth (.-routes routes) idx) idx display-elev-fn))
-  (display-route-fn {
-               :to-display routes
-               :routes-data (map parse-route (.-routes routes))}))
+  (display-route-fn {:to-display routes
+                     :routes-data (map parse-route (.-routes routes))}))