handle multiple builds

handle multiple builds

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -44,15 +44,12 @@
            (System/exit 1))))
      requires)))

-;; All I can say is I'm sorry about this but, it seems to be the best
-;; way for me to reuse cljsbuild.
-
 ;; this is really deviating from cljsbuild at this point.
 ;; need to dig in and probably rewrite this

 ;; need to get rid of crossovers soon

-(defn run-compiler [project {:keys [crossover-path crossovers builds]} live-reload-options]
+(defn run-compiler [project {:keys [crossover-path crossovers builds]} figwheel-options]
   (println "Compiling ClojureScript.")
   ; If crossover-path does not exist before eval-in-project is called,
   ; the files it contains won't be classloadable, for some reason.
@@ -60,7 +57,7 @@
     (println "\033[31mWARNING: lein-cljsbuild crossovers are deprecated, and will be removed in future versions.\n
 See https://github.com/emezeske/lein-cljsbuild/blob/master/doc/CROSSOVERS.md for details.\033[0m")
     (fs/mkdirs crossover-path))
-  (let [parsed-builds (list (config/parse-notify-command (first builds)))]
+  (let [parsed-builds (map config/parse-notify-command builds)]
     (run-local-project project crossover-path parsed-builds
      '(require 'cljsbuild.crossover 'cljsbuild.util 'clj-stacktrace.repl 'figwheel-sidecar.auto-builder)
      `(do
@@ -71,10 +68,8 @@
           (when (not-empty '~crossovers)
             (copy-crossovers#)
             (cljsbuild.util/once-every-bg 1000 "copying crossovers" copy-crossovers#))
-          (let [build# (first '~parsed-builds)]
-            (figwheel-sidecar.auto-builder/autobuild (:source-paths build#)
-                                             (:compiler build#)
-                                             ~live-reload-options)))))))
+          (figwheel-sidecar.auto-builder/autobuild* '~parsed-builds
+                                                    ~figwheel-options))))))

 (defn optimizations-none?
   "returns true if a build has :optimizations set to :none"
@@ -99,7 +94,8 @@

 (defn output-dir-in-resources-root?
   "Check if the build output directory is in or below any of the configured resources directories."
-  [{:keys [output-dir resource-paths http-server-root] :as opts}]
+  [{:keys [output-dir] :as build-options}
+   {:keys [resource-paths http-server-root] :as opts}]
   (and output-dir
        (first (filter (fn [x] (.startsWith output-dir (str x "/" http-server-root)))
                       (relativize-resource-paths resource-paths)))))
@@ -113,49 +109,56 @@
     (vec (map (fn [[k v]] (assoc v :id (name k))) builds))
     builds))

-(defn narrow-to-one-build*
+(defn narrow-builds*
+  "Filters builds to the chosen build-ids or if no build-ids specified returns the first
+   build with optimizations set to none."
+  [builds build-ids]
+  (let [builds (map-to-vec-builds builds)
+        ;; ensure string ids
+        builds (map #(update-in % [:id] name) builds)
+        build-ids (set build-ids)]
+    (vec
+     (keep identity
+           (if-not (empty? build-ids)
+             (filter #(get build-ids (:id %)) builds)
+             [(first (filter optimizations-none? builds))])))))
+
+;; we are only going to work on one build
+;; still need to narrow this to optimizations none
+(defn narrow-builds
   "Filters builds to the chosen build-id or if no build id specified returns the first
    build with optimizations set to none."
-  [ builds build-id]
-  (let [builds (map-to-vec-builds builds)]
-    (vector
-     (if build-id
-       (some #(and (= (:id %) build-id) %) builds)
-       (first (filter optimizations-none? builds))))))
-
-;; we are only going to work on one build
-;; still need to narrow this to optimizations none
-(defn narrow-to-one-build
-  "Filters builds to the chosen build-id or if no build id specified returns the first
-   build with optimizations set to none."
-  [project build-id]
-  (update-in project [:cljsbuild :builds] narrow-to-one-build* build-id))
+  [project build-ids]
+  (update-in project [:cljsbuild :builds] narrow-builds* build-ids))

 (defn check-for-valid-options
   "Check for various configuration anomalies."
-  [{:keys [builds]} {:keys [http-server-root] :as opts}]
-  (let [build (first builds)
-        opts? (and (not (nil? build)) (optimizations-none? build))
-        out-dir? (output-dir-in-resources-root? opts)]
-    (if (nil? build)
-      (list
-       (str "Figwheel: "
-            "No cljsbuild specified. You may have mistyped the build "
-            "id on the command line or failed to specify a build in "
-            "the :cljsbuild section of your project.clj. You need to have "
-            "at least one build with :optimizations set to :none."))
-      (map
-       #(str "Figwheel Config Error (in project.clj) - " %)
-       (filter identity
-               (list
-                (when-not opts?
-                  "you have build :optimizations set to something other than :none")
-                (when-not out-dir?
-                  (str
-                   (if (:output-dir build)
-                     "your build :output-dir is not in a resources directory."
-                     "you have not configured an :output-dir in your build")
-                   (str "\nIt should match this pattern: " (make-serve-from-display opts))))))))))
+  [{:keys [http-server-root] :as opts} build']
+  (let [build-options (:compiler build')
+        opts? (and (not (nil? build-options)) (optimizations-none? build'))
+        out-dir? (output-dir-in-resources-root? build-options opts)]
+    (map
+     #(str "Figwheel Config Error (in project.clj) - " %)
+     (filter identity
+             (list
+              (when-not opts?
+                "you have build :optimizations set to something other than :none")
+              (when-not out-dir?
+                (str
+                 (if (:output-dir build-options)
+                   "your build :output-dir is not in a resources directory."
+                   "you have not configured an :output-dir in your build")
+                 (str "\nIt should match this pattern: " (make-serve-from-display opts)))))))))
+
+(defn check-config [figwheel-options builds]
+  (if (empty? builds)
+    (list
+     (str "Figwheel: "
+          "No cljsbuild specified. You may have mistyped the build "
+          "id on the command line or failed to specify a build in "
+          "the :cljsbuild section of your project.clj. You need to have "
+          "at least one build with :optimizations set to :none."))
+    (mapcat (partial check-for-valid-options figwheel-options) builds)))

 (defn normalize-dir
   "If directory ends with '/' then truncate the trailing forward slash."
@@ -181,24 +184,22 @@
        (apply-to-key vec :css-dirs)
        (apply-to-key vec :resource-paths)))

-;; duh!! I should be forcing the optimizations :none option here.
-
 (defn figwheel
   "Autocompile ClojureScript and serve the changes over a websocket (+ plus static file server)."
   [project & build-ids]
-  (let [project (narrow-to-one-build project (first build-ids))
-        current-build (first (get-in project [:cljsbuild :builds]))
+  (let [project (narrow-builds project build-ids)
+        builds (get-in project [:cljsbuild :builds])
         figwheel-options (prep-options
                           (merge
-                           { :output-dir (-> current-build :compiler :output-dir )
-                             :output-to  (-> current-build :compiler :output-to ) }
                            (:figwheel project)
-                           ;; we can get the resource paths from the project
+                           ;; this is for the initial deps files checksums
+                           ;; better to pass all the builds
+                           { :output-dir (get-in (first builds) [:compiler :output-dir])
+                             :output-to (get-in (first builds) [:compiler :output-to]) }
                            (select-keys project [:resource-paths])))]
-    (let [errors (check-for-valid-options
-                  (:cljsbuild project)
-                  figwheel-options)]
-      (println (str "Figwheel: focusing on build-id " "'" (:id current-build) "'"))
+    (let [errors (check-config figwheel-options builds)]
+      (println (str "Figwheel: focusing on build-ids ("
+                    (string/join " " (map :id builds)) ")"))
       (if (empty? errors)
         (run-compiler project
                       (config/extract-options project)


Remove scratch code

Remove scratch code

--- src/yetibot/core/adapters/irc.clj
+++ src/yetibot/core/adapters/irc.clj
@@ -200,14 +200,6 @@
       :callbacks callbacks)))

 (defonce current-channels (atom []))
-
-
-(difference #{1 2 3} #{3})
-
-(difference #{1 2 3} #{4 5 6 1})
-
-(difference #{2 3 7} #{3 2 5 1 4 55} )
-
 (defn join-or-part-with-current-channels []
   (let [chs (channels)
         to-part (difference @current-channels chs)


Fix retry interval.

Fix retry interval.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -298,9 +298,9 @@
          (when (= ch timeout-ch)
            (let [tail (last (get-in @(:onyx.core/state event) [:timeout-pool]))]
              (doseq [m tail]
-               (when (p-ext/pending? event (:id m))
-                 (taoensso.timbre/info (str "Message " (:id m) " timed out, replaying it from it's initial task."))
-                 (p-ext/retry-message event (:id m))))
+               (when (p-ext/pending? event m)
+                 (taoensso.timbre/info (str "Message " m " timed out, replaying it from it's initial task."))
+                 (p-ext/retry-message event m)))
              (swap! (:onyx.core/state event) update-in [:timeout-pool] (comp vec #(conj % []) butlast))
              (recur))))))))

@@ -395,8 +395,9 @@
             catalog-entry (find-task catalog (:name task))
             ;; Number of buckets in the timeout pool is covered over a 60 second
             ;; interval, moving each bucket back 60 seconds / N buckets
-            replay-interval (or (:onyx/replay-interval opts) 1000)
-            n-buckets (int (Math/ceil (/ 60000 replay-interval)))
+            replay-interval (or (:onyx/replay-interval catalog-entry) 1000)
+            pending-timeout (or (:onyx/pending-timeout catalog-entry) 60000)
+            n-buckets (int (Math/ceil (/ pending-timeout replay-interval)))
             buckets (vec (repeat n-buckets []))

             _ (taoensso.timbre/info (format "[%s] Starting Task LifeCycle for job %s, task %s" id job-id (:name task)))


remove old monome example

remove old monome example

--- src/overtone/examples/monome.clj
+++ src/overtone/examples/monome.clj
@@ -1,124 +0,0 @@
-(ns overtone.examples.monome
-  (:use overtone.live)
-  (:require [monome-serial.monome :as mono]))
-
-(defsynth plop [freq 440 len 0.4]
-  (* 0.4 (env-gen (perc 0.02 len) 1 1 0 1 FREE)
-     (sin-osc [(+ (* 3 (sin-osc 20)) freq) (/ freq 2)])))
-
-(def m (mono/open "/dev/ttyUSB0"))
-
-(defn plopper [cmd x y]
-  (when (= cmd :down)
-    (plop (+ 100 (* 10 (* x x))) (* y 0.2))))
-
-(mono/add-handler m plopper)
-
-(def stick         (load-sample "/home/rosejn/studio/samples/jazz-drumkit/STICK.aif"))
-(def clap          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/CLAP1.aif"))
-(def conga-1       (load-sample "/home/rosejn/studio/samples/jazz-drumkit/CONGA1.aif"))
-(def conga-2       (load-sample "/home/rosejn/studio/samples/jazz-drumkit/CONGA2.aif"))
-(def cymbal-1      (load-sample "/home/rosejn/studio/samples/jazz-drumkit/CYMBAL03.aif"))
-(def cymbal-2      (load-sample "/home/rosejn/studio/samples/jazz-drumkit/CYMBAL08.aif"))
-(def cy1           (load-sample "/home/rosejn/studio/samples/jazz-drumkit/Cy1Brushkit.aif"))
-(def cy2           (load-sample "/home/rosejn/studio/samples/jazz-drumkit/Cy2Brushkit.aif"))
-(def bass          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/bdBrushkit.aif"))
-(def snare         (load-sample "/home/rosejn/studio/samples/jazz-drumkit/SD6Brushkit.aif"))
-(def tamb          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/TAMB.aif"))
-(def hi-hat        (load-sample "/home/rosejn/studio/samples/jazz-drumkit/HIHAT01.aif"))
-(def hhos          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/HHosBrushkit.aif"))
-(def hho2          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/HHo2Brushkit.aif"))
-(def tthi          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/TThiBrushkit.aif"))
-(def tthi2         (load-sample "/home/rosejn/studio/samples/jazz-drumkit/TThi2Brushkit.aif"))
-(def ttlo          (load-sample "/home/rosejn/studio/samples/jazz-drumkit/TTloBrushkit.aif"))
-
-(def kit [stick clap conga-1 conga-2 cymbal-1 cymbal-2 cy1 cy2 bass snare tamb hi-hat hhos hho2 tthi tthi2 ttlo])
-
-(def synths (map load-sample
-                 (map
-                   #(str "/home/rosejn/studio/samples/synths/SYNC" % ".WAV")
-                   (range 1 8))))
-
-(defn drummer [cmd x y]
-  (when (= cmd :down)
-    (let [[synth info] (nth synths x)
-          id (hit synth :dur (/ (:n-frames info) (:rate info)))]
-      (mono/led-on m x y)
-      (on-event "/n_end" (fn [msg]
-                     (if (= id (first (:args msg)))
-                       (mono/led-off m x y))
-                     :overtone/remove-handler)))))
-
-(def loops
- [[1 0 0 0 1 0 0 0]
-  [1 0 1 0 1 0 1 0]
-  [1 1 0 0 1 1 0 0]
-  [1 0 1 0 1 1 0 0]
-  [1 0 0 1 1 0 0 0]
-  [1 0 0 0 1 1 0 0]
-  [1 1 0 0 1 0 0 0]
-  [1 1 1 1 1 1 1 1]])
-
-(def current-loops* (ref {}))
-
-(def tick (beat-ms 1/4 480))
-
-(defn make-metro [bpm]
-  (let [start (now)
-        tick (beat-ms 1/4 bpm)]
-    (fn
-      ([] (long (/ (- (now) start) tick)))
-      ([beat] (+ (* beat tick) start)))))
-
-(defn metro-bpm [metro bpm])
-
-(def clock (make-metro 110))
-
-(defn loop-player [inst index beat pattern]
-  (when (get @current-loops* index)
-    (let [next-beat (clock (inc beat))]
-      (if (= 1 (first pattern))
-        (at (clock beat) (hit inst)))
-      (apply-at (next (- next-beat 100) #'loop-player inst index (inc beat) pattern)))))
-
-(defn looper [cmd x y]
-  (condp = cmd
-    :down (do
-            (mono/led-on m x y)
-            (dosync (alter current-loops* assoc y true))
-            (loop-player (nth kit x) y (inc (clock)) (cycle (nth loops y))))
-    :up   (do
-            (mono/led-off m x y)
-            (dosync (alter current-loops* assoc y false)))))
-
-
-(defn foo [beat]
-  (hit-at (clock beat) :plop :freq 440)
-  (apply-at #'foo (inc (- (clock (inc beat)) 100) beat)))
-
-(defn bar [beat]
-  (hit-at (clock beat) :plop :freq 220)
-  (apply-at #'bar (+ 2 (- (clock (+ beat 2)) 100) beat)))
-
-(mono/add-handler m looper)
-
-(def flute-buf (load-sample "/home/rosejn/studio/samples/flutes/flutey-echo-intro-blast.wav"))
-
-(defsynth buf-player [buf 0 rate 1 start 0 end 1 t 0.2]
-  (* (env-gen (perc 0.01 t) 1 1 0 1 FREE)
-     (buf-rd 1 buf
-             (phasor 0
-                     (* rate (buf-rate-scale buf))
-                     (* start (buf-frames:ir buf))
-                     (* end (buf-frames:ir buf)))
-             0 1)))
-
-(defn grain [cmd x y]
-  (condp = cmd
-    :down (do
-            (buf-player flute-buf (* y 1/8 2.5) (* x 1/16) 1 0.4)
-            (mono/led-on m x y))
-    :up   (do
-            (mono/led-off m x y))))
-
-(mono/add-handler m #'grain)


add back Nick's lost set_ab_test function

Really need an admin UI for this...

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -270,6 +270,14 @@
 (defn ^:export toggle-admin []
   (swap! debug-state update-in [:current-user :admin] not))

+(defn ^:export set-ab-test
+  "Debug function for setting ab-tests, call from the js console as frontend.core.set_ab_test('new_test', false)"
+  [test-name value]
+  (let [test-path [:ab-tests (keyword (name test-name))]]
+    (println "starting value for" test-name "was" (get-in @debug-state test-path))
+    (swap! debug-state assoc-in test-path value)
+    (println "value for" test-name "is now" (get-in @debug-state test-path))))
+
 (defn reinstall-om! []
   (install-om debug-state (find-app-container (find-top-level-node)) (:comms @debug-state)))


[#7771] Fix beta warning

[#7771] Fix beta warning

--- src/status_im/accounts/core.cljs
+++ src/status_im/accounts/core.cljs
@@ -10,12 +10,10 @@
             [status-im.utils.platform :as platform]))

 (fx/defn show-mainnet-is-default-alert [{:keys [db]}]
-  (let [enter-name-screen? (= :enter-name (get-in db [:accounts/create :step]))
-        shown? (get-in db [:account/account :mainnet-warning-shown?])]
+  (let [shown? (get-in db [:account/account :mainnet-warning-shown?])]
     (when (and platform/mobile?
                config/mainnet-warning-enabled?
-               (not shown?)
-               (not enter-name-screen?))
+               (not shown?))
       (utils/show-popup
        (i18n/label :mainnet-is-default-alert-title)
        (i18n/label :mainnet-is-default-alert-text)


Fix parser a little bit

Fix parser a little bit

--- src/teach_by_friends/parser.cljs
+++ src/teach_by_friends/parser.cljs
@@ -36,7 +36,7 @@

 (defn parse-to-terms [sentence number from to]
 	(->> sentence
-			 (re-seq #"the\s[a-zA-Z'-]+|a\s[a-zA-Z'-]+|an\s[a-zA-Z'-]+|[a-zA-Z'-]+")
+			 (re-seq #"the\s[a-zA-Z]+[a-zA-Z'-]*|a\s[a-zA-Z]+[a-zA-Z'-]*|an\s[a-zA-Z]+[a-zA-Z'-]*|[a-zA-Z]+[a-zA-Z'-]*")
 			 (map-indexed (partial parse-term sentence number from to))
 			 (filter #(not (contains? exclude (:normalized %))))))


updated to joodo 0.7.2

updated to joodo 0.7.2

--- gaeshi/project.clj
+++ gaeshi/project.clj
@@ -1,11 +1,11 @@
-(defproject gaeshi/gaeshi "0.7.2"
+(defproject gaeshi/gaeshi "0.7.3"
   :description "Runtime library for Gaeshi, a Clojure framework for Google App Engine apps."
   :license {:name "The MIT License"
             :url "file://LICENSE"
             :distribution :repo
             :comments "Copyright © 2011-2012 Micah Martin All Rights Reserved."}
   :repositories {"releases" "http://gaeshi-mvn.googlecode.com/svn/trunk/releases/"}
-  :dependencies [[joodo "0.7.1"]
+  :dependencies [[joodo "0.7.2"]
                  [com.google.appengine/appengine-api-1.0-sdk "1.6.2.1"]]
   :dev-dependencies [[speclj "2.1.1"]
                      [gaeshi/gaeshi-dev "0.7.0"]]


Formatted add-child.

Formatted add-child.

--- evermind.core/src/evermind/domain/core.clj
+++ evermind.core/src/evermind/domain/core.clj
@@ -38,7 +38,9 @@
 (s/fdef add-child
         :args (s/cat :node ::node :child ::node)
         :ret ::node
-        :fn #(contains? (-> % :ret :children) (-> % :args :child)))
+        :fn #(contains?
+               (-> % :ret :children)
+               (-> % :args :child)))


Add todo-repl-webapp.handler namespace binding for eval

--- src/todo_repl_webapp/handler.clj
+++ src/todo_repl_webapp/handler.clj
@@ -6,7 +6,8 @@
             [compojure.route :as route]
             [hiccup.form :as form]
             [hiccup.page :as page]
-            [ring.adapter.jetty :as jetty]))
+            [ring.adapter.jetty :as jetty]
+            [todo-repl.core :as todo]))

 (defn home-page [& _]
   (html [:head
@@ -34,8 +35,13 @@
 (defroutes app-routes
   (GET "/" [] (do (println "get /")
                   (home-page)))
-  (POST "/eval" [evalInput] (do (println "/eval " evalInput)
-                            (eval-page (load-string evalInput))))
+  (POST "/eval" [evalInput]
+    (do (println "/eval " evalInput)
+        (println "evals to: "
+                 (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
+                          (load-string evalInput)))
+        (eval-page (str (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
+                            (load-string evalInput))))))
   (route/resources "/")
   (route/not-found "Not Found"))


Fix init-tasks so that it resets tasks.

Fix init-tasks so that it resets tasks.

Instead of just adding more tasks.

--- src/todo_repl_webapp/handler.clj
+++ src/todo_repl_webapp/handler.clj
@@ -20,6 +20,7 @@
 ;; Initialize some tasks
 (defn init-tasks [& _]
   (do
+    (dosync (ref-set *tasks-ref*  []))
     (add-new-task {:name "Go get some milk"
                    :context "shopping"
                    :due "tomorrow"})


Identation is important

Identation is important

--- src/wishlistd/models/queries.clj
+++ src/wishlistd/models/queries.clj
@@ -70,8 +70,8 @@
     (sql/delete-rows :wish ["id=?" id])))

 (defn update-wish [{:keys [id] :as wish}]
-    (sql/with-connection db
-      (sql/update-values :wish ["id=?" id] wish)))
+  (sql/with-connection db
+    (sql/update-values :wish ["id=?" id] wish)))

 ;; ADVANCED STUFF


print url

print url

--- src/xhr_redirect_demo/server.clj
+++ src/xhr_redirect_demo/server.clj
@@ -19,4 +19,5 @@
   [& args]
   (s/run-server (make-xhr-app :first) {:port 9201})
   (s/run-server (make-xhr-app :second) {:port 9202})
-  (s/run-server ui-app {:port 9200}))
+  (s/run-server ui-app {:port 9200})
+  (println "Visit http://localhost:9200/"))


[lein] Bump ultra version

[lein] Bump ultra version

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -3,5 +3,5 @@
                   [lein-ancient                      "0.6.10"]
                   [lein-pprint                       "1.1.2"]
                   [cider/cider-nrepl                 "0.13.0"]
-                  [venantius/ultra                   "0.4.1"]]
+                  [venantius/ultra                   "0.5.0"]]
         :signing {:gpg-key "E5B26621"}}}


Add docstrings to aliases.

Add docstrings to aliases.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,5 +1,8 @@
-{:user {:aliases {"math" ["with-profile" "+math" "repl"]
-                  "eval" ["run" "-m" "clojure.main/main" "-e"]}
+{:user {:aliases {"math" ^{:doc "Start a REPL with math dependencies added."}
+                    ["with-profile" "+math" "repl"]
+                  "eval" ^{:doc
+                           "Evaluate a Clojure string with clojure.main/main."}
+                    ["run" "-m" "clojure.main/main" "-e"]}
         :plugins [[lein-shell "0.2.0"]
                   [lein-miditest "0.1.0"]]}
  :math {:dependencies [[org.clojure/math.combinatorics "0.0.2"]


Fixed typo.

Fixed typo.

--- datasets/src/cortex_datasets/mmap.clj
+++ datasets/src/cortex_datasets/mmap.clj
@@ -64,8 +64,8 @@

 (defn read-mmap-entry!
   [^Memory buffer, ^long idx ^doubles retval]
-  (let [offset (* idx entry-num-doubles)
-        entry-num-doubles (alength retval)]
+  (let [entry-num-doubles (alength retval)
+        offset (* idx entry-num-doubles)]
     ;;It would be ideal if there were bulk methods for this implemented in c++.  It would also
     ;;be ideal of those methods handled simple conversion i.e. from float->double.  Until then...
     (c-for [idx 0 (< idx entry-num-doubles) (inc idx)]


Fix async demo

Fix async demo

--- demo/reagentdemo/news/async.cljs
+++ demo/reagentdemo/news/async.cljs
@@ -194,7 +194,8 @@
                  (s/src-of [:timing-wrapper :base-color :ncolors
                             :random-colors :to-rgb :tweak-color
                             :reset-random-colors :color-choose
-                            :ncolors-choose :palette :color-demo])]}]])]]))
+                            :ncolors-choose :color-plate
+                            :palette :color-demo])]}]])]]))

 (tools/register-page url (fn [] [main])
                      (str "Reagent: " title))


Fixed bad require in dev.

Fixed bad require in dev.

--- dev-resources/src/cmr/opendap/dev.clj
+++ dev-resources/src/cmr/opendap/dev.clj
@@ -10,7 +10,7 @@
     [clojure.tools.namespace.repl :as repl]
     [clojusc.dev.system.core :as system-api]
     [clojusc.twig :as logger]
-    [cmr.opendap.components.caching :as caching]
+    [cmr.authz.components.caching :as auth-caching]
     [cmr.opendap.components.config :as config]
     [cmr.opendap.components.core]
     [cmr.opendap.errors :as errors]


fixes the compute-cluster argument in mesos-scheduler call to receive-offers (#1360)


Helper macro

Helper macro

--- test/cljs/go_test.clj
+++ test/cljs/go_test.clj
@@ -9,6 +9,13 @@
             [clojure.java.shell :as sh])
   (:import [java.io Writer]
            [cljs.tagged_literals JSValue]))
+
+(defmacro tdd [& body]
+  `(do (def *ast (cljs->ast '[~@body]))
+       (def *go (s/trim (goimports (ast->go *ast))))
+       (pp/pprint *ast)
+       (println)
+       (println *go)))

 (defn combined-output [out err]
   (s/replace (s/replace (str err out) "\r" "\n") "\n\t\t" ""))


Expose container status.

Expose container status.

--- wildfly/src/immutant/wildfly.clj
+++ wildfly/src/immutant/wildfly.clj
@@ -18,9 +18,15 @@
             [immutant.wildfly.repl  :as repl]
             [wunderboss.util        :as wu]
             [clojure.java.io        :as io])
-  (:import java.net.URL))
+  (:import java.net.URL
+           org.projectodd.wunderboss.WunderBoss))

 (def module-class-loader-class (memoize #(u/try-import 'org.jboss.modules.ModuleClassLoader)))
+
+(defn in-container?
+  "Returns true if the application is currently running inside WildFly."
+  []
+  (boolean (get (WunderBoss/options) "wildfly-service")))

 (defn- get-resource-loaders
   [cl]


minor

minor

--- cljs-server/cljsinfo_server/pages/cheatsheet.cljs
+++ cljs-server/cljsinfo_server/pages/cheatsheet.cljs
@@ -654,7 +654,7 @@
       "small function definition and is often used to pass closures from one "
       "scope to another."]
     [:p.info-2e4f9
-      [:code "#()"] " forms cannot be nested."]
+      [:code "#()"] " forms cannot be nested."]]
     [:table.exmpl-tbl-42d9f
       [:thead
         [:tr
@@ -709,10 +709,10 @@
     [:p.info-2e4f9
       "ClojureScript provides four collection types: lists, vectors, sets, and "
       "maps. "
-      "These data types have unique strengths and are used heavily in programs."]
+      "Each of these data types has unique strengths and are used heavily."]
     [:p.info-2e4f9
       "All collections are immutable and persistent, which means they preserve "
-      "the previous versions of themselves when they are modified. "
+      "the previous version(s) of themselves when they are modified. "
       "Creating a \"changed\" version of any collection is an efficient "
       "operation."]
     [:p.info-2e4f9
@@ -720,7 +720,7 @@
     [:table.exmpl-tbl-42d9f
       [:thead
         [:tr
-          [:th.hdr-5bd04 {:style "width:25%"} "Collection"]
+          [:th.hdr-5bd04 {:style "width: 24%"} "Collection"]
           [:th.hdr-5bd04 "Literal Form"]]]
       [:tbody
         [:tr


Added :default-value for prompt. Still trying to get

these describe-function and show-source commands to work properly.

--- core.clj
+++ core.clj
@@ -210,13 +210,13 @@
   (select-keys
    map
    [:prompt :input :history :completer :require-match :require-coerce :completions
-    :ignore]))
+    :ignore :default-value]))

 (make-map-constructor
  ^:private make-prompt-
  Prompt
  [:prompt :input :history :completer :require-match :require-coerce :completions
-  :ignore])
+  :ignore :default-value])

 (defn make-prompt
  "Create a Prompt object. Accepts the following attributes:
@@ -407,6 +407,8 @@
    ^Symbol function]
    ;(log "type df " (type function))
    (if-let [var (ns-resolve (:*ns* @repl-env) function)]
+           #_(eval-expression (format "(doc %s)" (name function))
+                            "*doc*")
            (message-or-buffer "*doc*"
                               (trim (with-out-str
                                      (with-repl-ns
@@ -420,9 +422,17 @@
    ^Symbol function]
    ;(log "type show source" (type function))
    (if-let [var (ns-resolve (:*ns* @repl-env) function)]
+           #_(eval-expression (format "(source %s)" (name function))
+                            "*source*")
            (message-or-buffer "*source*"
-                              (trim (with-out-str (with-repl-ns (eval
-                                                    `(clojure.repl/source ~function))))))
+                              (trim
+                               (with-out-str
+                                (with-repl-ns
+                                 (eval `(clojure.repl/source ~function))))
+                               #_(with-repl-ns
+                                (with-out-str
+                                 (clojure.repl/source-fn (fully-qualified-symbol (name function))))))
+                              )
            (message "No such function \"%s\"." function)))

 (defn make-func-completer
@@ -574,8 +584,8 @@
 (defn filter-sources [amap]
   (into {} (filter #(let [k (key %)]
                          (try (with-repl-ns
-                               (clojure.repl/source-fn k))
-                              true
+                               (not= "Source not found\n"
+                                     (count (clojure.repl/source-fn k))))
                               (catch Exception e
                                      false)))
                    amap)))
@@ -591,7 +601,7 @@
                          (not (contains? excluded* (ns-name (var->ns v))))]
                          k))))

-(def symbol-completer-exclude-namespaces (atom ['clojure.core]))
+(def symbol-completer-exclude-namespaces (atom ['clojure.core 'clojure.repl]))

 (defn make-symbol-completer
   "Create a symbol completer. Accepts a filter function that will take a
@@ -639,8 +649,11 @@
 ;; This is equivalent to the C# coded "eval-expression" command
 ;; in LispCommands.cs.
 ;;
-(defcmd eval-expression
-  "Evaluate a Clojure expression and show its result."
-  [ ^{:prompt "Eval: " :history "expression" :key-binding "M-:"}
-    ^String expression]
-  (message (trim (repl-eval-print-string expression))))
+;; (defcmd ^{:key-binding "M-:"} eval-expression
+
+;;   "Evaluate a Clojure expression and show its result."
+;;   [ ^{:prompt "Eval: " :history "expression" }
+;;   ^String expression
+;;   ^{:default-value "*eval*"}
+;;   ^String buffer-name]
+;;   (message-or-buffer buffer-name (trim (repl-eval-print-string expression))))


prevent edit mode timelins

prevent edit mode timelins

--- core.clj
+++ core.clj
@@ -1,6 +1,8 @@
 (ns tween.core
   (:import Vector3
-    [UnityEngine HideFlags GameObject Color Vector4 Vector3 Vector2 Quaternion MonoBehaviour WaitForSeconds Time Mathf]
+    [UnityEngine Application HideFlags MonoBehaviour
+     GameObject Color Vector4 Vector3 Vector2 Quaternion
+     WaitForSeconds Time Mathf]
     [System GC Object]
     [System.Collections IEnumerator])
   (:require
@@ -14,18 +16,25 @@
 (def ^System.Single -single (float 0.0))
 (def ^System.Int32  -short  (int 0))

-(def -mono-obj
-  (let [_ (UnityEngine.Object/Destroy (GameObject/Find "tween.core/-mono-obj"))
-        o (GameObject. "tween.core/-mono-obj")]
-    (set! (.hideFlags o) HideFlags/HideInHierarchy)
-    (.AddComponent o UnityEngine.MonoBehaviour)))
+(def -mono-obj (volatile! nil))
+(defn mono-obj []
+    (if (. Application isPlaying)
+      (or (if (not (UnityEngine.Object/op_Equality @-mono-obj nil))
+              @-mono-obj)
+        (vreset! -mono-obj
+          (let [o (or (GameObject/Find "tween.core/-mono-obj")
+                      (GameObject. "tween.core/-mono-obj"))]
+            ;(set! (.hideFlags o) HideFlags/HideInHierarchy)
+            (or (.GetComponent o UnityEngine.MonoBehaviour)
+                (.AddComponent o UnityEngine.MonoBehaviour)))))))

 (defn every-frame [f]
-  (let [coro-root -mono-obj]
-    (.StartCoroutine coro-root
-      (reify IEnumerator
-        (MoveNext [this] (f))
-        (get_Current [this])))))
+  (if (. Application isPlaying)
+    (let [coro-root (mono-obj)]
+      (.StartCoroutine coro-root
+        (reify IEnumerator
+          (MoveNext [this] (f))
+          (get_Current [this]))))))

 (defn- datatype? [v] (or (sequential? v) (set? v) (map? v)))

@@ -125,51 +134,53 @@
 (def <over> (*TimeLineCursor 0 false))

 (defn timeline [fns]
-  (let [current (volatile! (first fns))
-        fns (volatile! (rest fns))
-        ^UnityEngine.MonoBehaviour coro-root -mono-obj
-        ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
-    (.StartCoroutine coro-root
-      (reify IEnumerator
-        (MoveNext [this]
-          (when-not panic
+  (when (. Application isPlaying)
+    (let [current (volatile! (first fns))
+          fns (volatile! (rest fns))
+          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
+          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
+      (.StartCoroutine coro-root
+        (reify IEnumerator
+          (MoveNext [this]
+            (when-not panic
+              (try
+                (set! (.v cursor) (@current))
+                (if (.v cursor) true
+                  (if (do (vreset! current (first @fns) )
+                          (vswap! fns rest) @current)
+                    true
+                    (!TimeLineCursor cursor)
+                    ))
+                (catch Exception e false))))
+          (get_Current [this] (.v cursor))))
+      (fn [] (if @current true false)))))
+
+(defn timeline-1 [fns] (timeline (map #(%) fns)))
+
+(defn array-timeline [^clojure.lang.PersistentHashSet opts
+                      ^|System.Object[]|               fns]
+  (when (. Application isPlaying)
+    (let [cnt (int (dec (.Length fns)))
+          current (volatile! ((aget fns 0)))
+          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
+          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
+      (.StartCoroutine coro-root
+        (reify IEnumerator
+          (MoveNext [this]
             (try
               (set! (.v cursor) (@current))
               (if (.v cursor) true
-                (if (do (vreset! current (first @fns) )
-                        (vswap! fns rest) @current)
-                  true
-                  (!TimeLineCursor cursor)
-                  ))
-              (catch Exception e false))))
-        (get_Current [this] (.v cursor))))
-    (fn [] (if @current true false))))
-
-(defn timeline-1 [fns] (timeline (map #(%) fns)))
-
-(defn array-timeline [^clojure.lang.PersistentHashSet opts
-                      ^|System.Object[]|               fns]
-  (let [cnt (int (dec (.Length fns)))
-        current (volatile! ((aget fns 0)))
-        ^UnityEngine.MonoBehaviour coro-root -mono-obj
-        ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
-    (.StartCoroutine coro-root
-      (reify IEnumerator
-        (MoveNext [this]
-          (try
-            (set! (.v cursor) (@current))
-            (if (.v cursor) true
-              (if (>= (.i cursor) cnt)
-                  (if (opts :loop)
-                    (do (set! (.i cursor) 0)
-                        (vreset! current ((aget fns 0))) true)
-                    (!TimeLineCursor cursor))
-                  (do (set! (.i cursor) (inc (.i cursor)))
-                      (vreset! current ((aget fns (.i cursor))))
-                      @current)))
-            (catch Exception e false)))
-        (get_Current [this] (.v cursor))))
-    (fn [] (.v cursor))))
+                (if (>= (.i cursor) cnt)
+                    (if (opts :loop)
+                      (do (set! (.i cursor) 0)
+                          (vreset! current ((aget fns 0))) true)
+                      (!TimeLineCursor cursor))
+                    (do (set! (.i cursor) (inc (.i cursor)))
+                        (vreset! current ((aget fns (.i cursor))))
+                        @current)))
+              (catch Exception e false)))
+          (get_Current [this] (.v cursor))))
+      (fn [] (.v cursor)))))

 (defmacro timeline* [& fns]
   (let [[opts fns] ((juxt (comp set filter) remove) keyword? fns)
@@ -249,6 +260,7 @@
       (~'fn []
         (~'when-not ~'(.initiated cursor)
         ~'(set! (.initiated cursor) true)
+        ~'(set! (.start cursor) Time/time)
         ~@(map #(list 'set! (list '.a %1) %2) pairsyms base-getters))
         ~'(set! (.now cursor) (- Time/time (.start cursor)))
         (~'set! ~'(.ratio cursor) ~ratio-code)
@@ -262,8 +274,9 @@
         (~'if ~'(< (.now cursor) (.duration cursor))
           true
           (~'do
-            ~@(map #(list (or (-> %1 :pair :vars :r) !Pair-Object) %2) tagmaps pairsyms)
-            (!TweenCursor ~'cursor)))))))
+            ;~@(map #(list (or (-> %1 :pair :vars :r) !Pair-Object) %2) tagmaps pairsyms)
+            ;(!TweenCursor ~'cursor)
+            nil))))))

@@ -331,6 +344,21 @@
   {:base (.GetComponent this UnityEngine.Light)
    :get (.range this)
    :tag System.Single})
+
+(defmacro AND [& more]
+  (let [syms (take (count more) (repeatedly gensym))]
+   `(~'let [~@(mapcat vector syms more)]
+      (~'fn [] (~'and ~@(map list syms))))))
+
+(defmacro OR [& more]
+  (let [syms (take (count more) (repeatedly gensym))]
+   `(~'let [~@(mapcat vector syms more)]
+      (~'fn [] (~'or ~@(map list syms))))))
+
+(defmacro NOT [f]
+  (let [sym (gensym)]
+   `(~'let [~sym ~f]
+      (~'fn [] (~'not (~sym))))))

 '[tween.core]


Added function for debugging errors.

Added function for debugging errors.

--- dev-resources/src/mx/roads/forgotten/blog/dev.clj
+++ dev-resources/src/mx/roads/forgotten/blog/dev.clj
@@ -13,6 +13,7 @@
     [clojure.walk :refer [macroexpand-all]]
     [clojusc.twig :as logger]
     [dragon.blog :as blog]
+    [dragon.blog.post :as post]
     [dragon.config :as config]
     [dragon.generator :as gen]
     [dragon.util :as util]
@@ -28,9 +29,18 @@
     [taoensso.timbre :as log]
     [trifl.java :refer [show-methods]]))

-(logger/set-level! ['mx.roads.forgotten.blog] :debug)
+(logger/set-level! ['mx.roads.forgotten.blog 'dragon] :info)

 ;;; Aliases

 (def reload #'repl/refresh)
 (def reset #'repl/refresh)
+
+(defn show-lines-with-error
+  "Process posts and show the lines of text that threw exceptions."
+  []
+  (->> (blog/get-posts)
+       (map #(->> %
+                 (post/add-post-data)
+                 :text))
+       (pprint)))


Print conditions better, at least in Clojure.

--- src/active/clojure/condition.cljc
+++ src/active/clojure/condition.cljc
@@ -71,12 +71,22 @@
 (defrecord ConditionType
     [name supertype field-names total-field-count])

+#?(:clj
+(defmethod print-method ConditionType [^ConditionType ct ^java.io.Writer w]
+  (.write w (name (:name ct)))))
+
 (def ^{:doc "Root of the condition-type hierarchy."}
   &condition
   (ConditionType. '&condition nil [] 0))

 (defrecord ConditionComponent
     [type arguments])
+
+#?(:clj
+(defmethod print-method ConditionComponent [^ConditionComponent cc ^java.io.Writer w]
+  (print-method (:type cc) w)
+  (.write w ": ")
+  (print-method (:arguments cc) w)))

 (defn- condition-component?
   "Is object a condition component?"
@@ -452,10 +462,11 @@
       (doto w
         (.write (name type))
         (.write ": "))
-      (if (string? message)
-        (let [^String s message]
-          (.write w s))
-        (print message))
+      (cond
+       (nil? message) (println "<no message>")
+       (string? message) (let [^String s message]
+                           (.write w s))
+       :else (print message))
       (let [^String spaces
             (apply str (repeat (+ (count (name type)) 2)
                                \space))]
@@ -477,10 +488,11 @@
   (let [[type who message stuff] (decode-condition c)]
     (print (name type))
     (print ": ")
-    (if (string? message)
-      (let [s message]
-        (print s))
-      (print message))
+      (cond
+       (nil? message) (println "<no message>")
+       (string? message) (let [^String s message]
+                           (.write w s))
+       :else (print message))
     (let [spaces
           (apply str (repeat (+ (count (name type)) 2)
                              \space))]


Improve comments.

Improve comments.

--- src/algebolic/expression/core.clj
+++ src/algebolic/expression/core.clj
@@ -15,10 +15,12 @@
   of expression evaluation:

   There is a function `functionalise` for transforming expressions into Clojure functions that
-  can be called. This is useful for turning the expressions into things you can plot etc.
+  can be called. This is useful for turning the expressions into things you can plot etc. It lives
+  in the `algebolic.expression.evaluate` namespace.

   There is also an `interpreter` namespace which provides an alternate (and much faster)
-  mechanism for evaluating the expressions at a particular point.
+  mechanism for evaluating the expressions at a particular point. It is found in the
+  `algebolic.expression.interpreter` namespace.

   The `score` namespace provides score functions that use both of these implementations."
   (:refer-clojure :exclude [rand rand-nth rand-int])


Inhibits the display of one.

Inhibits the display of one.

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -112,12 +112,13 @@
   :state)

 (defmethod render :init [_]
-  (fx/initialize-views (:form snippets) (:greeting snippets))
-  (add-input-event-listeners "name-input")
-  (event/listen (by-id "greet-button")
-                "click"
-                #(dispatch/fire :greeting
-                                {:name (value (by-id "name-input"))})))
+  (comment
+    (fx/initialize-views (:form snippets) (:greeting snippets))
+    (add-input-event-listeners "name-input")
+    (event/listen (by-id "greet-button")
+                  "click"
+                  #(dispatch/fire :greeting
+                                  {:name (value (by-id "name-input"))}))))

 (defmethod render :form [{:keys [state error name]}]
   (fx/show-form)


Restart after ipm change

Restart after ipm change

--- src/app/ctl.cljs
+++ src/app/ctl.cljs
@@ -75,8 +75,10 @@
                                                 (dispatch-sync [:set-playmode "single"])
                                                 (dispatch-sync [:start]))}]
              ["#ipm" {:value (Math/floor (* 60  @items-per-sec))
-                      :on-change (fn [evt] (dispatch-sync [:set-ipm
-                                                           (cljs.reader/read-string (.. evt -target -value ))]))}]
+                      :on-change (fn [evt]
+                                   (dispatch-sync [:set-ipm
+                                                   (cljs.reader/read-string (.. evt -target -value ))])
+                                   (dispatch-sync [:start]))}]
              ["#doRandomize" (if @randomize? {:checked "true"} {})]
                                         ;           ["#doRandomize" {:on-click #(println (.. % -target -checked))}]
              ["#doRandomize" {:on-click #(dispatch-sync [:set-randomize (.. % -target -checked)])}]


Make fetcher parallel

Make fetcher parallel

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -202,14 +202,20 @@
          {:values [ttl data tenant rollup period path time]}))
       (fetch [this agg paths tenant rollup period from to]
         (debug "fetching paths from store: " paths tenant rollup period from to)
-        (if-let [data (and (seq paths)
-                           (->> (alia/execute
-                                 session fetch!
-                                 {:values [paths tenant (int rollup) (int period)
-                                           from to]
-                                  :fetch-size Integer/MAX_VALUE})
-                                (map detect-aggregate)
-                                (seq)))]
+        (if-let [data
+                 (and (seq paths)
+                      (let [futures
+                            (doall (map #(future
+                                           (->> (alia/execute
+                                                 session fetch!
+                                                 {:values [% tenant (int rollup)
+                                                           (int period)
+                                                           from to]
+                                                  :fetch-size Integer/MAX_VALUE})
+                                                (map detect-aggregate)
+                                                (seq))
+                                           paths)))]
+                        (map deref futures)))]
           (let [min-point  (:time (first data))
                 max-point  (-> to (quot rollup) (* rollup))
                 nil-points (->> (range min-point (inc max-point) rollup)


Fix deflogical test

Fix deflogical test

--- test/clj/libx/deflogical_test.cljc
+++ test/clj/libx/deflogical_test.cljc
@@ -21,7 +21,7 @@
                  [:baz (= ?e (:e this))]
                  [:quux (= ?e (:e this))]
                  =>
-                 (libx.util/insert! ([-1 :foo "bar"])))))))))
+                 (libx.util/insert! [-1 :foo "bar"]))))))))
   ;(testing "Multiple facts"
   ;  (let [output   (macroexpand
   ;                   '(deflogical


separate nominal and accusative pronouns for elision formation

e.g “je t’aime” vs “j’aime”

--- src/babel/francais/morphology.clj
+++ src/babel/francais/morphology.clj
@@ -29,10 +29,20 @@
         (and (not (nil? b))
              (let [a (get-string word)
                    b (get-string b)]
-               (and (re-find #"^[jmlt]e" a) ;; je/le/me/te
+               (and (re-find #"^(je|tu)$" a) ;;
                     (re-find #"^[aeéiou]" b))))
         (let [a (get-string word)]
-          (str (string/replace a #"^([jmlt]).*" (fn [[_ suffix]] (str suffix "'"))) (get-string b)))
+          (str (string/replace a #"^(j|t).*" (fn [[_ prefix]] (str prefix "'"))) (get-string b)))
+
+        ;; (elle) la + est (amuseé) = (elle) l'est (amuseé)
+        (and (not (nil? b))
+             (let [a (get-string word)
+                   b (get-string b)]
+               (and (re-find #"^(la|le|me|se|te)$" a) ;;
+                    (re-find #"^[aeéiou]" b))))
+        (let [a (get-string word)]
+          (str (string/replace a #"^(l|m|s|t).*"
+                               (fn [[_ prefix]] (str prefix "'"))) (get-string b)))

         (and (not (nil? word))
              (not (nil? b)))


More TODO for kvs.

More TODO for kvs.

--- src/cbfg/kvs.cljs
+++ src/cbfg/kvs.cljs
@@ -20,7 +20,7 @@
 ; TODO: Compaction/maintenance/re-org/vaccuum abstraction.
 ; TODO: Readers not blocked by writers.
 ; TODO: Mutations shadow old values.
-; TODO: Simulated slow-disks, full-disks, etc.
+; TODO: Simulated slow-disks, full-disks, half-written mutation, rollback, etc.

 (defn make-kc [] ; A kc is a keys & changes map.
   {:keys (sorted-map)      ; key -> sq


create a dedicated index for each filesystem

also prepare support for having a filesystem :prefix and importing
multiple filesystems into the same index.

--- src/brainbot/nozzle/esconnect.clj
+++ src/brainbot/nozzle/esconnect.clj
@@ -213,19 +213,37 @@
    "import_file"      simple-import_file})

 (defn build-handle-connection
-  [es-index num-workers filesystems]
+  [fsmap num-workers]
   (fn [conn]
     (logging/info "initializing rabbitmq connection with" num-workers "workers")
-    (doseq [fs filesystems
-            [command handle-msg] (seq command->msg-handler)
-            _ (range num-workers)]
+    (doseq [_ (range num-workers)]
       (mqhelper/channel-loop
        conn
        (fn [ch]
-         (let [qname (misc/initialize-rabbitmq-structures ch command "nextbot" fs)]
-           ;; (lb/qos ch 1)
-           (lcons/subscribe ch qname
-                            (mqhelper/make-handler (partial handle-msg fs es-index)))))))))
+         (doseq [fs (keys fsmap)
+                 [command handle-msg] (seq command->msg-handler)]
+           (let [qname (misc/initialize-rabbitmq-structures ch command "nextbot" fs)]
+             ;; (lb/qos ch 1)
+             (lcons/subscribe ch qname
+                              (mqhelper/make-handler (partial handle-msg fs (get-in fsmap [fs :index])))))))))))
+
+(defn make-standard-fsmap
+  [filesystems]
+  (into
+   {}
+   (for [fs filesystems]
+     [fs {:index fs :prefix "" :filesystem fs}])))
+
+
+(defn indexes-from-fsmap
+  [fsmap]
+  (distinct (map :index (vals fsmap))))
+
+
+(defn ensure-all-indexes-and-mappings
+  [fsmap]
+  (doseq [idx (indexes-from-fsmap fsmap)]
+    (ensure-index-and-mappings idx)))

 (defn esconnect-run-section
@@ -233,18 +251,17 @@
   (let [rmq-settings (misc/rmq-settings-from-config iniconfig)
         num-workers (Integer. (get-in iniconfig [section "num-workers"] "10"))
         filesystems (misc/get-filesystems-from-iniconfig iniconfig section)
-        es-index (get-in iniconfig [misc/main-section-name "es-index"])
+        fsmap (make-standard-fsmap filesystems)
         es-url (or (get-in iniconfig [misc/main-section-name "es-url"]) "http://localhost:9200")]

     (when (empty? filesystems)
       (misc/die (str "no filesystems defined in section " section)))

-    (when-not es-index
-      (misc/die "es-index setting missing"))
-
     (logging/info "connecting to elasticsearch" es-url)
     (esr/connect! es-url)
-    (ensure-index-and-mappings es-index)
+
+    (ensure-all-indexes-and-mappings fsmap)
+
     (mqhelper/connect-loop
      #(rmq/connect rmq-settings)
-     (build-handle-connection es-index num-workers filesystems))))
+     (build-handle-connection fsmap num-workers))))


add case to automatically factor string for cached path if it is extended as a navigator

--- src/clj/com/rpl/specter/impl.cljx
+++ src/clj/com/rpl/specter/impl.cljx
@@ -783,6 +783,10 @@
             (keyword? p)
             p

+            ;; in case anyone extends String for their own use case
+            (and (string? p) (valid-navigator? p))
+            p
+
             :else
             (magic-fail! "Code " p " is not a valid navigator or can't be factored")
             )


put back outer-product, will change later

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -92,6 +92,13 @@
   [coll]
   (apply (partial map vector) coll))

+(defn outer-product
+  "returns a flattened vector of the outer product of a vector and its
+  transpose"
+  [coll]
+  (let [mat (i/matrix coll)]
+    (flatten (i/mmult mat (i/trans mat)))))
+
 (defn element-sum
   "returns a vector of sums of each respective element in a vector of vectors,
   i.e., a vector with the first element being the sum of the first
@@ -107,8 +114,8 @@
   TODO: remove redundancy, keep readability"
   [y & x]
   (let [foc (apply first-order-conditions y x)]
-    [(element-sum (map i/kronecker (transpose foc)))
-     (element-sum (map i/kronecker (transpose (map i/cumulative-sum foc))))]))
+    [(element-sum (map outer-product (transpose foc)))
+     (element-sum (map outer-product (transpose (map i/cumulative-sum foc))))]))

 (defn hansen-stat
   "returns the Hansen (1992) test statistic; number of first-order
@@ -133,12 +140,13 @@
   to do."
   [y long-block short-block & x]
   (let [characteristics (create-struct :short :long :long-tstat :break)
-        [long-val long-tstat] (apply long-stats y x)]
+        deseas (harmonic-seasonal-decomposition 23 3 y)
+        [long-val long-tstat] (apply long-stats deseas x)]
     (struct characteristics
-            (min-short-trend long-block short-block y)
+            (min-short-trend long-block short-block deseas)
             long-val
             long-tstat
-            (apply hansen-stat y x))))
+            (apply hansen-stat deseas x))))

 (defn scaled-vector
   [scalar coll]


updated functions for extra speed; down to 150ms for 100x hansen-stat

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -38,7 +38,12 @@
          (catch Throwable e
            (error (str "TIMESERIES ISSUES: " ts ", " cofactors) e)))))

-(defn linear-residuals [y X] (:residuals (s/linear-model y X)))
+(defn linear-residuals
+  [y x & {:keys [intercept] :or {intercept true}}]
+    (let [_x (if intercept (i/bind-columns (replicate (i/nrow x) 1) x) x)
+          xtx (i/mmult (i/trans _x) _x)
+          coefs (i/mmult (i/solve xtx) (i/trans _x) y)]
+      (i/minus y (i/mmult _x coefs))))

 (defn first-order-conditions
   "returns a matrix with residual weighted cofactors (incl. constant
@@ -52,7 +57,7 @@
         resid (linear-residuals coll X)
         sq-resid (i/mult resid resid)
         mu (utils/average sq-resid)]
-    (i/bind-rows (map * resid X) resid (i/minus sq-resid mu))))
+    (i/trans (i/bind-columns (i/mult resid X) resid (i/minus sq-resid mu)))))

 (defn hansen-stat
   "returns the Hansen (1992) test statistic, based on (1) the first-order


fix ns

fix ns

--- src/clj/starcity/datomic/util.clj
+++ src/clj/starcity/datomic/util.clj
@@ -1,4 +1,4 @@
-(ns starcity.datomic.utils
+(ns starcity.datomic.util
   (:require [datomic.api :as d]))

 (defn ident


allow Demolition Run to be clickable in the play area

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -114,7 +114,7 @@
                        (when (:installed card)
                          (handle-abilities card owner))
                        (send-command "play" {:card card}))
-              ("rig" "current" "onhost") (handle-abilities card owner)
+              ("rig" "current" "onhost" "play-area") (handle-abilities card owner)
               nil)
             (case (first zone)
               "hand" (case type


C handlers: Correct query in retraction of entities

The find specification in the query for retracting entities representing
material form inputs had been wrong. It returned a set of 1-tuples of
entity IDs instead of a collection of entity IDs. Correct this.

--- src/cljs/theatralia/handlers.cljs
+++ src/cljs/theatralia/handlers.cljs
@@ -128,5 +128,5 @@
 (defn material-added
   [db [scratch-entid]]
   [[:db.fn/retractEntity scratch-entid]
-   [:db.fn/call retract-entities '[:find ?e :where [?e :tag/index _]]]])
+   [:db.fn/call retract-entities '[:find [?e ...] :where [?e :tag/index _]]]])
 (th-utils/register-handler* material-added)


currency spec

currency spec

--- src/clojure/nossal/shop/spec.cljc
+++ src/clojure/nossal/shop/spec.cljc
@@ -58,7 +58,8 @@
 (s/def ::cep (s/def (s/and string? #(re-matches cep-regex %))))
 (s/def ::street-address (s/keys :req [::street ::number]
                                 :opt [::complement]))
-(s/def ::country #{:brazil})
+(s/def ::country #{:brazil :usa})
+(s/def ::currency #{:BRL :USD :MXN :COP :CLP :ARS :PEN :EUR :PYN :UYU :VEB :VEF :GBP})
 (s/def ::address (s/keys :req [::cep
                                ::country
                                ::state
@@ -86,6 +87,8 @@
 (s/def ::payment-type #{:creadit-card :debit-card :boleto})
 (s/def ::payment (s/keys :req-un [::payment-type
                                   ::amount
+                                  ::currency
+                                  ::country
                                   ::installments
                                   ::soft-descriptor]))


Fixed typo.

Fixed typo.

--- src/cmr/umm/iso_mends/granule.clj
+++ src/cmr/umm/iso_mends/granule.clj
@@ -19,7 +19,7 @@
            emit-fn (if indent? x/indent-str x/emit-str)]
        (emit-fn
          (x/element :granule {}
-                    (x/element :placehodler {} "UMM granule for MENDS ISO is not supported.")
+                    (x/element :placeholder {} "UMM granule for MENDS ISO is not supported.")
                     (x/element :granule-ur {} granule-ur)))))))

 (defn validate-xml


DB Explorer now adds a proper primary key

Ok so it also adds a field called tfield, but we can fix that soon

--- resources/public/init/dbexplorer.cljs
+++ resources/public/init/dbexplorer.cljs
@@ -1,4 +1,3 @@
-
 (defn get-tables []
 (remote "!get-list-of-tables"
         {:session-id  (:session-id @webapp.framework.client.system-globals.client-session-atom)}
@@ -6,11 +5,6 @@
             (reset! webapp.framework.client.system-globals/app-state (assoc-in @webapp.framework.client.system-globals/app-state [:ui :table-list] result2))))
 )
 (get-tables)
-
-
-(comment sql "select * from newtable" [] (fn [rr] (js/alert (pr-str rr))))
-
-

 (defn-ui-component     main   [app] {}
   (div nil
@@ -29,8 +23,9 @@

             (span {:className "input-group-btn"}
                   (button {:className "btn btn-default" :type "button"
-                           :onClick #(let [table-name    (.. (js/document.getElementById "tablename") -value  )]
-                                       (sql  (str "create table " table-name " (did     integer)") {}
+                           :onClick #(let [table-name    (.. (js/document.getElementById "tablename") -value  )
+                                           create-sql    (str "create table " table-name " (id       serial NOT NULL,tfield    character varying,  CONSTRAINT  " table-name "_PK    PRIMARY KEY (id))")]
+                                       (sql create-sql  {}
                                              (fn [ss]
                                                (do
                                                  (set! (js/document.getElementById "tablename") -value  "")


Allows synthetic pods to have a non-default termination grace period (#1808)

* Allows synthetic pods to have a non-default termination grace period

* Fixes spelling of 'synthetic'

--- scheduler/src/cook/kubernetes/api.clj
+++ scheduler/src/cook/kubernetes/api.clj
@@ -1101,6 +1101,13 @@
     ; pod
     (.setMetadata pod metadata)
     (.setSpec pod pod-spec)
+
+    ; We want to allow synthetic pods to have a non-default (typically 0) termination grace period,
+    ; so that they can be deleted quickly to free up space on nodes for real job pods. The default
+    ; grace period of 30 seconds can cause real job pods to be deemed unschedulable and fail.
+    (when (synthetic-pod? pod-name)
+      (when-let [{:keys [synthetic-pod-termination-grace-period-seconds]} (config/kubernetes)]
+        (.setTerminationGracePeriodSeconds pod-spec synthetic-pod-termination-grace-period-seconds)))

     pod))


Minor code cleanup.

Minor code cleanup.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -49,7 +49,7 @@
      {:display-name (str "series-tsplot-" series)
       :component-did-update
       (fn [ this ]
-        (tsplot-draw (.-firstChild (reagent/dom-node this)) (:series-data @series-state)))
+        (tsplot-draw (.-firstChild @dom-node) (:series-data @series-state)))

       :component-did-mount
       (fn [ this ]
@@ -66,11 +66,11 @@
                     {:width (.-clientWidth node)
                      :height (.-clientHeight node)})]])})))

-(defn series-pane [ series ]
+(defn series-pane [ series-name ]
   [:div.series-pane
    [:div.series-pane-header
-    [:span.series-name series]]
-   [series-tsplot series]])
+    [:span.series-name series-name]]
+   [series-tsplot series-name]])

 (defn series-list [ ]
   [:div
@@ -86,9 +86,8 @@
     (fn []
       [:input {:value (:text @state)
                :onChange #(swap! state assoc :text (.. % -target -value))
-               :onKeyDown #(do
-                             (when (= (.-key %) "Enter")
-                                 (on-enter (:text @state))))} ])))
+               :onKeyDown #(when (= (.-key %) "Enter")
+                             (on-enter (:text @state)))}])))

 (defn header [ ]
   [:div.header


Include the Request, JVM System Properties, and basic stack trace in the report

--- src/io/aviso/twixt/exceptions.clj
+++ src/io/aviso/twixt/exceptions.clj
@@ -69,6 +69,11 @@
                  ))
         ]))))

+(defn- stack-trace-element->row-markup
+  [element]
+  [:tr
+   [:td (to-markup element)]])
+
 (defn- exception->markup
   "Given an analyzed exception, generate markup for it."
   [{:keys [class message properties stack-trace]}]
@@ -85,8 +90,11 @@
          (apply concat
                 (for [k (-> properties keys sort)]
                   [[:dt (-> k name h)] [:dd (-> (get properties k) to-markup)]]))
-         ])
-      ]
+         ])]
+     (when-not (empty? stack-trace)
+       [:table.table.table-hover.table-condensed.table-striped.table-bordered
+        (map stack-trace-element->row-markup stack-trace)])
+
      ]))

 (defn- match-keys
@@ -124,7 +132,7 @@

 (defn build-report
   "Builds an HTML exception report (as a string)."
-  [twixt exception]
+  [twixt request exception]
   (html5
     [:head
      [:title "Exception"]
@@ -140,7 +148,14 @@
         [:div.alert.alert-danger (h (exception-message exception))]
         ]
        ]
-      (write-exception-stack exception)
+      (write-exception-stack exception)
+
+      [:h3 "Request"]
+
+      (to-markup request)
+
+      [:h3 "System Properties"]
+      (to-markup (System/getProperties))
       ]
      ]))

@@ -160,7 +175,7 @@
       (catch Throwable t
         ;; TODO: logging!
         (->
-          (build-report twixt t)
+          (build-report twixt request t)
           #_ (spy "report")
           response
           (content-type "text/html")


Remove the shell based duration detection

--- src/mdr2/dtb.clj
+++ src/mdr2/dtb.clj
@@ -1,9 +1,7 @@
 (ns mdr2.dtb
   "Functions to query DAISY Talking Books"
   (:require [clojure.data.xml :as xml]
-            [clojure.java.io :refer [file]]
-            [clojure.java.shell :refer [sh]]
-            [clojure.string :refer [trim-newline]])
+            [clojure.java.io :refer [file]])
   (:import javax.sound.sampled.AudioSystem))

 (defn file-audio-length
@@ -17,15 +15,6 @@
         durationInSeconds (/ frames frameRate)]
     durationInSeconds))

-;; admitedly this is kinda hackish but the "Java-way" using
-;; AudioSystem et al doesn't seem to work inside immutant
-;; see https://issues.jboss.org/browse/IMMUTANT-457
-;; (defn file-audio-length [file]
-;;   (-> (sh "soxi" "-D" (.getPath file))
-;;       :out
-;;       trim-newline
-;;       Double/parseDouble))
-
 (defn wav-file? [file]
   (and (.isFile file)
        (.endsWith (.getName file) ".wav")))


Generate an rdf according to the DAISY3 spec

i.e. use all the attributes from
http://www.daisy.org/z3986/2005/Z3986-2005.html. Drop all the 'ncc' and
'sbs' attributes.

Also drop the useless let and use destructuring in the argument list

--- src/mdr2/rdf.clj
+++ src/mdr2/rdf.clj
@@ -5,60 +5,47 @@
 (defn get-meta-data [{:keys [path] :as production}]
   (merge production (dtb/meta-data path)))

-(defn- rdf-sexp [production]
-  (let [{:keys [title creator subject description publisher date identifier source language rights
-                sourceDate sourceEdition sourcePublisher sourceRights sourceTitle
-                multimediaType multimediaContent narrator producedDate
-                revision revisionDate revisionDescription
-                totalTime audioFormat type
-                footnotes prodnotes multi-volume sidebars
-                tocItems
-                depth files size
-                page-front page-normal page-special]} production]
-    [:rdf:DRF {:xmlns:rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-               :xmlns:dc "http://purl.org/dc/elements/1.1/"
-               :xmlns:ncc "http://www.daisy.org/publications/specifications/"
-               :xmlns:sbs "http://www.sbszh.ch/sbs/namespace"}
-     ;; see also
-     ;; http://www.daisy.org/z3986/specifications/daisy_202.html?q=publications/specifications/daisy_202.html#ncc
-     [:rdf:Description
-      [:dc:creator creator]
-      [:dc:date date]
-      [:dc:format "Daisy 2.02"] ;; this is only for DAISY 2.02
-      [:dc:identifier identifier]
-      [:dc:language language]
-      [:dc:publisher publisher]
-      [:dc:source source]
-      [:dc:title title]
-      [:dc:type type]
-      [:ncc:charset "utf-8"]
-      [:ncc:depth depth]
-      [:ncc:files files]
-      (when footnotes [:ncc:footnotes footnotes])
-      [:ncc:kByteSize size]
-      [:ncc:multimediaType multimediaType]
-      [:ncc:narrator narrator]
-      [:ncc:pageFront page-front]
-      [:ncc:pageNormal page-normal]
-      [:ncc:pageSpecial page-special]
-      (when prodnotes [:ncc:prodNotes prodnotes])
-      [:ncc:producedDate producedDate]
-      [:ncc:revisionDate revisionDate]
-      (when multi-volume
-        [:ncc:setInfo (str (:number multi-volume) " of " (:total multi-volume))])
-      (when sidebars [:ncc:sidebars sidebars])
-      [:ncc:sourceDate sourceDate]
-      [:ncc:sourcePublisher sourcePublisher]
-      [:ncc:tocItems tocItems]
-      [:ncc:totalTime totalTime]
-      [:sbs:audioFormat "FIXME:"]
-      [:sbs:audioTotalTime "FIXME:"]
-      [:sbs:audioType "FIXME:"]
-      [:sbs:idMaster "FIXME:"]
-      [:sbs:idPrint "FIXME:"]
-      [:sbs:idVorstufe "FIXME:"]
-      [:sbs:kostenstelle "FIXME:"]
-      [:sbs:printPageNumber "FIXME:"]]]))
+(defn- rdf-sexp
+  [{:keys [title creator subject description publisher date identifier source language rights
+           sourceDate sourceEdition sourcePublisher sourceRights sourceTitle
+           multimediaType multimediaContent narrator producer producedDate
+           revision revisionDate revisionDescription
+           totalTime audioFormat type]}]
+  [:rdf:DRF {:xmlns:rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+             :xmlns:dc "http://purl.org/dc/elements/1.1/"
+             :xmlns:ncc "http://www.daisy.org/publications/specifications/"
+             :xmlns:sbs "http://www.sbszh.ch/sbs/namespace"}
+   ;; see also
+   ;; http://www.daisy.org/z3986/2005/Z3986-2005.html#Over
+   [:rdf:Description
+    [:dc:title title]
+    [:dc:creator creator]
+    [:dc:subject subject]
+    [:dc:description description]
+    [:dc:publisher publisher]
+    ;; what about dc:Contributor?
+    [:dc:date date]
+    [:dc:type type]
+    [:dc:format "ANSI/NISO Z39.86-2005"] ; we are talking about DAISY3 here
+    [:dc:identifier identifier]
+    [:dc:source source]
+    [:dc:language language]
+    [:dc:rights rights]
+    [:dtb:sourceDate sourceDate]
+    [:dtb:sourceEdition sourceEdition]
+    [:dtb:sourcePublisher sourcePublisher]
+    [:dtb:sourceRights sourceRights]
+    [:dtb:sourceTitle sourceTitle]
+    [:dtb:multimediaType multimediaType]
+    [:dtb:multimediaContent multimediaContent]
+    [:dtb:narrator narrator]
+    [:dtb:producer producer]
+    [:dtb:producedDate producedDate]
+    [:dtb:revision revision]
+    [:dtb:revisionDate revisionDate]
+    [:dtb:revisionDescription revisionDescription]
+    [:dtb:totalTime totalTime]
+    [:dtb:audioFormat audioFormat]]]))

 (defn rdf
   "Create rdf for a given production"


Simplify nml-map

Simplify nml-map

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -173,24 +173,22 @@
   (get (get m (string/lower-case nml) {}) (string/lower-case key) ""))

 (defn nml-map [s src]
-  (let [tree (nml-parse s :s src)
-        transformers
-        {
-         :c identity
-         :dataref #(apply string/lower-case %)
-         :name #(apply string/lower-case %)
-         :nv_sequence (fn [& nv_subsequences] (into {} nv_subsequences))
-         :nv_subsequence (fn [name values] {name values})
-         :nv_subsequence_begin #(apply string/lower-case %)
-         :partref #(apply string/lower-case %)
-         :s (fn [& nv_sequences] (into {} nv_sequences))
-         :stmt (fn [name nv_sequence _] (into {} {name nv_sequence}))
-         :string (fn [& letters] (apply str letters))
-         :value identity
-         :values (fn [& values] (into [] values))
-         }]
-    (let [newtree (insta/transform transformers tree)]
-      newtree)))
+  (insta/transform
+   {
+    :c identity
+    :dataref #(apply string/lower-case %)
+    :name #(apply string/lower-case %)
+    :nv_sequence (fn [& nv_subsequences] (into {} nv_subsequences))
+    :nv_subsequence (fn [name values] {name values})
+    :nv_subsequence_begin #(apply string/lower-case %)
+    :partref #(apply string/lower-case %)
+    :s (fn [& nv_sequences] (into {} nv_sequences))
+    :stmt (fn [name nv_sequence _] (into {} {name nv_sequence}))
+    :string (fn [& letters] (apply str letters))
+    :value identity
+    :values (fn [& values] (into [] values))
+    }
+   (nml-parse s :s src)))

 ;;(defn nml-set [m nml key val]
 ;; (let [src (str "user-supplied value")


Adding a TODO

Adding a TODO

--- system-int-test/test/cmr/system_int_test/bootstrap/virtual_products_test.clj
+++ system-int-test/test/cmr/system_int_test/bootstrap/virtual_products_test.clj
@@ -56,4 +56,6 @@
     (vp/ingest-virtual-collections source-collections)
     (index/wait-until-indexed)
     (bootstrap/bootstrap-virtual-products)
-    (index/wait-until-indexed)))
+    (index/wait-until-indexed)
+    ;; TODO: Make sure all the appropriate virtual granules were created.
+    ))


(SERVER-1183) Add explicit cache-enable setting to class-info test

This commit adds an explicit value for the
`environment-class-cache-enabled` setting to the
`class-info-updated-after-cache-flush-during-prior-request` test.  This
protects the test against a future change to the default value for this
setting in the `with-puppetserver-running-with-services` helper,
possibly unintentionally causing the test to not perform properly as a
result.

--- test/integration/puppetlabs/services/master/environment_classes_int_test.clj
+++ test/integration/puppetlabs/services/master/environment_classes_int_test.clj
@@ -658,7 +658,8 @@
         authorization/authorization-service
         admin/puppet-admin-service
         vcs/versioned-code-service]
-       {:jruby-puppet {:max-active-instances 1}
+       {:jruby-puppet {:max-active-instances 1
+                       :environment-class-cache-enabled true}
         :webserver {:ssl-ca-cert (:localcacert puppet-server-settings)
                     :ssl-cert (:hostcert puppet-server-settings)
                     :ssl-key (:hostprivkey puppet-server-settings)}


forgot the first argument ...

forgot the first argument ...

--- services/rnaseq-phase0-d.clj
+++ services/rnaseq-phase0-d.clj
@@ -3,7 +3,8 @@
  :path "",

  :graph {:setexp {:type "func"
-                  :name "set-exp"}
+                  :name "set-exp"
+                  :args ["#1"]}
          :split-filter {:type "func"
                         :name "split-filter-fastqs"}
          :mail {:type "func"


Selecting columns, not rows

Selecting columns, not rows

--- src/life/demo.clj
+++ src/life/demo.clj
@@ -76,12 +76,12 @@
            (map #(rotate %2 0 %1) [1 0 -1] (repeat R))))

 ;; Matrices return rows preferentially over columns using the "slices" function.
-;; There is a variation of this function that can return columns, but this has not
-;; yet been implemented
+;; We can select columns by selecting slices in the second dimension instead of
+;; the default first dimension. Visually, this will transpose the grid.
+(disp (slices ((outer-fn rotate [1 0 -1] [1 0 -1]) R) 1))

-;; If we do a column sum of the 3x3 matrix we get a 3 vector - horizontally, though
-;; it represents a single column sum across each row
-(disp (map (partial apply add) (slices ((outer-fn rotate [1 0 -1] [1 0 -1]) R))))
+;; If we do a column sum of the 3x3 matrix we get a 3 vector
+(disp (map (partial apply add) (slices ((outer-fn rotate [1 0 -1] [1 0 -1]) R) 1)))

 ;; And if we sum the vector we see a "neighbor count" for each cell in our original
 ;; matrix R


remove useless error log

remove useless error log

don't know why it would ever error out but even if it does
we are not going to do anything with it anyways.

fixes #471

--- src/main/shadow/cljs/npm/cli.cljs
+++ src/main/shadow/cljs/npm/cli.cljs
@@ -76,12 +76,7 @@
             ;; under which circumstances that may disconnect for "valid" reasons
             ;; like switching the WiFi network, sleep mode etc
             ;; instead just have the java proc periodically check if this is still alive
-            (.end socket "OK")
-
-            (.on socket "error"
-              (fn [err]
-                (js/console.warn "node-server socket err" err))
-              )))
+            (.end socket "OK")))

         (.on node-server "error"
           (fn [err]


Add indentation data to declare-pipeline macro

--- src/pipeline/grafter/pipeline.clj
+++ src/pipeline/grafter/pipeline.clj
@@ -27,7 +27,7 @@

 (defmacro declare-pipeline
   "Declare a pipeline function, exposing it to grafter-server etc..."
-
+  {:style/indent :defn}
   ([sym display-name type-form metadata]
    (if-let [sym (qualify-symbol sym)]
      (let [decl (create-pipeline-declaration sym type-form metadata)]


(MAINT) Close the stockpile command stream

Add the stream to a with-open block to ensure the stockpile stream is
closed properly.

--- src/puppetlabs/puppetdb/queue.clj
+++ src/puppetlabs/puppetdb/queue.clj
@@ -23,16 +23,17 @@

 (defn entry->cmd [q {stockpile-entry :entry :as entry}]
   (let [[received-time-ms command version certname] (str/split (stock/entry-meta stockpile-entry) #"_" 4)]
-    (-> entry
-        (assoc
-         :command command
-         :version (Long/parseLong version)
-         :certname certname
-         :payload (stream->json (stock/stream q stockpile-entry)))
-        (assoc-in [:annotations :received] (-> received-time-ms
-                                               Long/parseLong
-                                               tcoerce/from-long
-                                               kitchensink/timestamp)))))
+    (with-open [command-stream (stock/stream q stockpile-entry)]
+      (-> entry
+          (assoc
+           :command command
+           :version (Long/parseLong version)
+           :certname certname
+           :payload (stream->json command-stream))
+          (assoc-in [:annotations :received] (-> received-time-ms
+                                                 Long/parseLong
+                                                 tcoerce/from-long
+                                                 kitchensink/timestamp))))))

 (defn store-command
   ([q command version certname command-stream]


removing misnamed file

removing misnamed file

--- src/regarde/models/rating-set.clj
+++ src/regarde/models/rating-set.clj
@@ -1,21 +0,0 @@
-(ns regarde.models.rating-set
-    (:require [regarde.models.exercise :as exercise]
-              [korma.core :as sql]))
-
-(sql/defentity rating-sets
-  (sql/table :rating_sets)
-  (sql/belongs-to regarde.models.user/users))
-
-(defn find [user-id exercise-id]
-  (first (sql/select rating-sets
-                     (sql/where {:exercise_id (Integer. exercise-id)
-                                 :user_id (Integer. user-id)}))))
-
-(defn create [user-id exercise-id]
-  (sql/insert rating-sets (sql/values [{:user_id (Integer.  user-id)
-                                    :exercise_id (Integer. exercise-id)}])))
-
-(defn find-or-create [user-id exercise-id]
-  (if-let [set (find user-id exercise-id)]
-    set
-    (create user-id exercise-id)))


Add vertical rule on scroll interaction.

--- src/uxbox/ui/workspace/rules.cljs
+++ src/uxbox/ui/workspace/rules.cljs
@@ -82,12 +82,10 @@
     :name "vertical-tick-render"
     :mixins [mx/static]}))

-
 (defn horizontal-rule-render
   [own sidebar?]
   (let [scroll (rum/react wb/scroll-a)
         scroll-x (:x scroll)
-        scroll-y (:y scroll)
         translate-x (- (- wb/canvas-scroll-padding) (:x scroll))]
     (html
      [:svg.horizontal-rule
@@ -105,60 +103,79 @@
     :mixins [mx/static rum/reactive]}))

-(defn v-line
-  [position value]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Horizontal Rule
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn horizontal-tick-render
+  [own value]
+  (let [big-ticks-mod (big-ticks-mod 1)
+        mid-ticks-mod (mid-ticks-mod 1)
+        big-step? (< (mod value big-ticks-mod) step-size)
+        mid-step? (< (mod value mid-ticks-mod) step-size)
+        pos (+ value
+               wb/canvas-start-x
+               wb/canvas-scroll-padding)
+        pos (* pos zoom)]
   (cond
-    (< (mod value big-ticks-mod) step-size)
+    big-step?
     (html
-     [:g {:key position}
-      [:line {:y1 position
-              :y2 position
+     [:g {:key pos}
+      [:line {:y1 pos
+              :y2 pos
               :x1 5
               :x2 step-padding
               :stroke "#9da2a6"}]
-      [:text {:y position
+      [:text {:y pos
               :x 5
-              :transform (str/format "rotate(90 0 %s)" position)
+              :transform (str/format "rotate(90 0 %s)" pos)
               :fill "#9da2a6"
               :style {:font-size "12px"}}
        value]])

-    (< (mod value mid-ticks-mod) step-size)
+    mid-step?
     (html
-     [:line {:key position
-             :y1 position
-             :y2 position
+     [:line {:key pos
+             :y1 pos
+             :y2 pos
              :x1 10
              :x2 step-padding
              :stroke "#9da2a6"}])

     :else
     (html
-     [:line {:key position
-             :y1 position
-             :y2 position
+     [:line {:key pos
+             :y1 pos
+             :y2 pos
              :x1 15
              :x2 step-padding
-             :stroke "#9da2a6"}])))
+             :stroke "#9da2a6"}]))))
+
+(def ^:const horizontal-tick
+  (mx/component
+   {:render horizontal-tick-render
+    :name "horizontal-tick-render"
+    :mixins [mx/static]}))

 (defn vertical-rule-render
   [own sidebar?]
-  (let [height wb/viewport-height
-        ticks (concat (range (- step-padding start-height) 0 step-size)
-                      (range 0 (- height start-height step-padding) step-size))]
+  (let [scroll (rum/react wb/scroll-a)
+        scroll-y (:y scroll)
+        translate-y (- (- wb/canvas-scroll-padding) (:y scroll))]
     (html
      [:svg.vertical-rule
       {:width 20
        :height wb/viewport-height}
-      [:g
-       [:rect {:x 0
-               :y step-padding
-               :height height
-               :width step-padding
-               :fill "rgb(233, 234, 235)"}]
-       (for [tick ticks
-             :let [pos (* (+ tick start-height) zoom)]]
-         (v-line pos tick))]])))
+
+      [:g {:transform (str  "translate(0, " translate-y ")")}
+       (for [value +ticks+]
+         (-> (horizontal-tick value)
+             (rum/with-key value)))]
+      [:rect {:x 0
+              :y 0
+              :height 20
+              :width 20
+              :fill "rgb(233, 234, 235)"}]])))

 (def vertical-rule
   (mx/component


Update SPARQL test

Update SPARQL test

--- test/clj/sparqlab/test/sparql.clj
+++ test/clj/sparqlab/test/sparql.clj
@@ -13,6 +13,6 @@
                               seq
                               (filter query-file?)))]
     (doseq [[q1 q2] query-pairs]
-      (is (sparql/equal-query? q1 q2)))))
+      (is (:equal? (sparql/equal-query? q1 q2))))))

 (deftest equal-results?)


wrapped the footer div.container in a div.footer in order for the color to be full width

--- src-cljs/bitfondue/core.cljs
+++ src-cljs/bitfondue/core.cljs
@@ -93,17 +93,18 @@

 (defn footer
   []
-  [:div.container.footer
-   [:div.row
-    [:div.col-md-4
-     [:ul
-      [:li [:a {:href "http://blog.bitfondue.com"} "Blog"]]
-      [:li [:a {:href "https://github.com/bitfondue"} "GitHub"]]]]
-    [:div.col-md-4]
-    [:div.col-md-4
-     [:ul
-      [:li [:a {:href "https://twitter.com/bitfondue"} "Twitter"]]
-      [:li [:a {:href "https://twitter.com/bitfondue"} "Facebook"]]]]]])
+  [:div.footer
+   [:div.container
+    [:div.row
+     [:div.col-md-4
+      [:ul
+       [:li [:a {:href "http://blog.bitfondue.com"} "Blog"]]
+       [:li [:a {:href "https://github.com/bitfondue"} "GitHub"]]]]
+     [:div.col-md-4]
+     [:div.col-md-4
+      [:ul
+       [:li [:a {:href "https://twitter.com/bitfondue"} "Twitter"]]
+       [:li [:a {:href "https://twitter.com/bitfondue"} "Facebook"]]]]]]])

 (defn layout


slope diff fun

slope diff fun

--- src-cljs/flatride/utils.cljs
+++ src-cljs/flatride/utils.cljs
@@ -3,3 +3,6 @@
 (defn log [stuff]
   (.log js/console stuff))

+(defn slope-diff [seq]
+    (- (last seq) (first seq)))
+


Add some generative test docs

Add some generative test docs

--- test/onyx/log/generative_test.clj
+++ test/onyx/log/generative_test.clj
@@ -27,21 +27,27 @@
 (def messaging
   (component/start (aeron/aeron {:opts peer-config})))

-(defn bump-forward-immediates [entries peers peer-id]
+(defn bump-forward-immediates
+  "If peer hasn't finished joining yet, bump all their
+  log entries to the head of their queue. Order is otherwise stable."
+  [entries peers peer-id]
   (if ((set peers) peer-id)
     entries
     (vec (concat (filter :immediate? entries)
                  (remove :immediate? entries)))))

+(defn active-peers [replica entry]
+  (cond-> (set (concat (:peers replica)
+                       ; might not need these with the below entries
+                       (vals (or (:prepared replica) {}))
+                       (vals (or (:accepted replica) {}))))
+    (:id (:args entry)) (conj (:id (:args entry)))
+    (:joiner (:args entry)) (conj (:joiner (:args entry)))))
+
 (defn apply-entry [replica entries entry]
   (let [new-replica (extensions/apply-log-entry entry replica)
         diff (extensions/replica-diff entry replica new-replica)
-        peers (cond-> (set (concat (:peers replica)
-                                   ; might not need these with the below entries
-                                   (vals (or (:prepared replica) {}))
-                                   (vals (or (:accepted replica) {}))))
-                (:id (:args entry)) (conj (:id (:args entry)))
-                (:joiner (:args entry)) (conj (:joiner (:args entry))))
+        peers (active-peers replica entry)
         peer-reactions (keep (fn [peer-id]
                                (if-let [reactions (extensions/reactions entry
                                                                         replica
@@ -64,7 +70,10 @@
                           peer-reactions)]
     (vector new-replica unapplied)))

-(defn apply-peer-queue-entry [{:keys [replica message-id entries peer-choices log]} next-peer]
+(defn apply-peer-queue-entry
+  "Applies the next log message in the selected peer's queue.
+  Effectively, the next peer that wrote its message to ZK"
+  [{:keys [replica message-id entries peer-choices log]} next-peer]
   (let [peer-queue (entries next-peer)
         next-entry (first peer-queue)
         new-peer-queue (vec (rest peer-queue))
@@ -79,7 +88,10 @@
      :log (conj log message)
      :peer-choices (conj peer-choices next-peer)}))

-(defn peer-gen [replica-state-gen]
+(defn peer-gen
+  "Generator to look into all of the peer's write queues
+  and pick an entry to get fake written next"
+  [replica-state-gen]
   (gen/bind replica-state-gen
             (fn [state]
               ; we only play back log messages from peers who have
@@ -93,14 +105,22 @@
                                      (contains? peers peer)))
                                (:entries state))))))))

-(defn apply-entry-gen [replica-state-gen]
+(defn apply-entry-gen
+  "Apply an entry from one of the peers log queues
+  to a replica generator "
+  [replica-state-gen]
   (gen/fmap
     (fn [[state peer-id]]
       (apply-peer-queue-entry state peer-id))
     (gen/tuple replica-state-gen
                (peer-gen replica-state-gen))))

-(defn apply-entries-gen [replica-state-gen]
+(defn apply-entries-gen
+  "Recurse over replica generator until entries
+  are exhausted. Return the final replica, the log messages
+  in the order they were written and the order of the peers
+  that got to write"
+  [replica-state-gen]
   (gen/bind replica-state-gen
             (fn [state]
               (let [g (gen/return state)]
@@ -112,12 +132,17 @@
   (checking
     "Checking joins"
     10000
-    [{:keys [replica peer-choices]}
+    [{:keys [replica log peer-choices]}
      (apply-entries-gen
        (gen/return
          {:replica {:job-scheduler (:onyx.peer/job-scheduler peer-config)
                     :messaging (:onyx.messaging/config peer-config)}
           :message-id 0
+          ; TODO: for scheduling we need a way to supply queues for entries written by non peers
+          ; possibly could just check whether they are certain message types
+          ; in peer-gen (rename to queue-select-gen?)
+          ; eg. queue with :z [{:fn :submit-job]
+          ; if they are in separate queues they could be processed in any order which is what we want
           :entries {:a [{:fn :prepare-join-cluster
                          :immediate? true
                          :args {:peer-site (extensions/peer-site messaging)


fix cursor line parser in test runner, and split test case parser into multimethod

--- test/parinfer/formatter-test.cljs
+++ test/parinfer/formatter-test.cljs
@@ -7,78 +7,78 @@

 (def fs (js/require "fs"))

-(defn parse-test-cases! []
-  (let [text (.readFileSync fs "formatter-test.md")
-        lines (split-lines text)
-        error-msg (fn [line-no msg]
-                    (str "error at test-case line #" line-no ": " msg))
+(defn error-msg
+  [line-no msg]
+  (str "error at test-case line #" line-no ": " msg))

-        state
-        (reduce
-          (fn [{:keys [block-key test-case test-cases] :as state} [line-no line]]
-            (println line-no ":" (pr-str line))
-            (cond
+(defmulti parse-line
+  (fn [state [line-no line]]
+    (cond
+      (= "```" line)          :end-block
+      (re-find #"^```" line)  :start-block
+      (:block-key state)      :in-block
+      :else                   :default)))

-              ;;; Block is ending?
-              (= "```" line)
-              (if-not block-key
-                (throw (error-msg line-no "opening block must have a name: 'in' or 'out'"))
-                (let [test-case-done? (:out test-case)]
-                  (if test-case-done?
+(defmethod parse-line :end-block
+  [{:keys [block-key test-case test-cases] :as state} [line-no line]]
+  (if-not block-key
+    (throw (error-msg line-no "opening block must have a name: 'in' or 'out'"))
+    (let [test-case-done? (:out test-case)]
+      (if test-case-done?

-                    ;; close test case
-                    (-> state
-                        (update-in [:test-cases] conj test-case)
-                        (assoc :block-key nil)
-                        (assoc :test-case {}))
+        ;; close test case
+        (-> state
+            (update-in [:test-cases] conj test-case)
+            (assoc :block-key nil)
+            (assoc :test-case {}))

-                    ;; close test block
-                    (assoc state :block-key nil))))
+        ;; close test block
+        (assoc state :block-key nil)))))

-              ;;; Block is starting?
-              (re-find #"^```" line)
-              (if block-key
-                (throw (error-msg line-no "must close previous block before starting new one"))
-                (let [block-name (second (re-find #"^```(.*)$" line))
-                      block-key (keyword block-name)]
-                  (cond
+(defmethod parse-line :start-block
+  [{:keys [block-key test-case test-cases] :as state} [line-no line]]
+  (if block-key
+    (throw (error-msg line-no "must close previous block before starting new one"))
+    (let [block-name (second (re-find #"^```(.*)$" line))
+          block-key (keyword block-name)]
+      (cond

-                    (not (#{:in :out} block-key))
-                    (throw (error-msg line-no (str "block name " (pr-str block-name) "must be either 'in' or 'out'")))
+        (not (#{:in :out} block-key))
+        (throw (error-msg line-no (str "block name " (pr-str block-name) "must be either 'in' or 'out'")))

-                    (and (= :in block-key) (:in test-case))
-                    (throw (error-msg line-no (str "there is already an 'in' block for this test case.")))
+        (and (= :in block-key) (:in test-case))
+        (throw (error-msg line-no (str "there is already an 'in' block for this test case.")))

-                    (and (= :out block-key) (not (:in test-case)))
-                    (throw (error-msg line-no (str "must include an 'in' block before an 'out' block.")))
+        (and (= :out block-key) (not (:in test-case)))
+        (throw (error-msg line-no (str "must include an 'in' block before an 'out' block.")))

-                    :else
-                    (-> state
-                        (assoc :block-key block-key)
-                        (assoc-in [:test-case block-key] {:line-no line-no :text ""})))))
+        :else
+        (-> state
+            (assoc :block-key block-key)
+            (assoc-in [:test-case block-key] {:line-no line-no :text ""}))))))

-              ;;; Inside a block?
-              block-key
-              (let [cursor-x (.indexOf line "|")
-                    cursor (when (and (= :in block-key)
-                                      (not= -1 cursor-x))
-                             {:cursor-x cursor-x
-                              :cursor-line (- line-no (:line-no (:in test-case)))})
-                    line (string/replace line "|" "")]
-                (println "CURSOR:" (pr-str cursor))
-                (-> state
-                   (update-in [:test-case block-key :text] str "\n" line)
-                   (assoc-in [:test-case block-key :cursor] cursor)))
+(defmethod parse-line :in-block
+  [{:keys [block-key test-case test-cases] :as state} [line-no line]]
+  (let [cursor-x (.indexOf line "|")
+        cursor-line (when (and (= :in block-key)
+                               (not= -1 cursor-x))
+                      (- line-no (:line-no (:in test-case))))
+        line (string/replace line "|" "")]
+    (-> state
+        (update-in [:test-case block-key :text] str "\n" line)
+        (update-in [:test-case block-key :cursor-line] #(or % cursor-line)))))

-              ;;; Outside a block?
-              :else
-              state))
+(defmethod parse-line :default
+  [state [line-no line]]
+  state)

-          {:test-cases []
-           :block-key nil ;; :in or :out
-           :test-case {:in nil, :out nil}}
-
-          (map-indexed (fn [line-no line] [(inc line-no) line]) lines))]
+(defn parse-test-cases [text]
+  (let [lines (split-lines text)
+        initial-state {:test-cases []
+                       :block-key nil ;; :in or :out
+                       :test-case {:in nil, :out nil}}
+        numbered-lines (map-indexed (fn [line-no line] [(inc line-no) line]) lines)
+        state (reduce parse-line initial-state numbered-lines)]

     (when (:block-key state)
       (throw (error-msg "EOF" "code block not closed")))
@@ -89,9 +89,11 @@
     (:test-cases state)))

 (deftest run-test-cases
-  (let [test-cases (parse-test-cases!)]
-    (doseq [{:keys [in out cursor]} test-cases]
-      (is (= (:text out) (format-text cursor (:text in)))
-          (cond-> (str "test case @ line #" (:line-no in))
-            cursor (str " with cursor:" (pr-str cursor)))))))
+  (let [text (.readFileSync fs "formatter-test.md")
+        test-cases (parse-test-cases text)]
+    (doseq [{:keys [in out]} test-cases]
+      (let [cursor-line (:cursor-line in)]
+        (is (= (:text out) (format-text {:cursor-line cursor-line} (:text in)))
+            (cond-> (str "test case @ line #" (:line-no in))
+              cursor-line (str " with cursor at line:" (pr-str cursor-line))))))))


removed es stuff from response

removed es stuff from response


Assign fat-ass achievement for text files too

--- src-clj/acha/achievement.clj
+++ src-clj/acha/achievement.clj
@@ -314,8 +314,7 @@
    (fn [{:keys [changed-files author time]}]
      (let [fat-ass-threshold (* 2 1024 1024)]
        (when (some #(and (= :add (:kind %))
-                         (= :binary (get-in % [:new-file :type]))
-                         (< fat-ass-threshold (get-in % [:new-file :size])))
+                         (< fat-ass-threshold (get-in % [:new-file :size] 0)))
                    changed-files)
          {:username author
           :time time})))])


Fix entity test on Node

Fix entity test on Node

--- test/reagenttest/testreagent.cljs
+++ test/reagenttest/testreagent.cljs
@@ -1078,9 +1078,16 @@
                  [:custom-element.foobar "foo"]))))

 (deftest html-entities
-  (is (= "<i> </i>"
-         (server/render-to-static-markup
-           [:i (gstr/unescapeEntities " ")]))))
+  (testing "entity numbers can be unescaped always"
+    (is (= "<i> </i>"
+           (server/render-to-static-markup
+             [:i (gstr/unescapeEntities " ")]))))
+
+  (when r/is-client
+    (testing "When DOM is available, all named entities can be unescaped"
+      (is (= "<i> </i>"
+             (server/render-to-static-markup
+               [:i (gstr/unescapeEntities " ")]))))))

 (defn context-wrapper []
   (r/create-class


comments

comments

--- src/babel/english/writer.clj
+++ src/babel/english/writer.clj
@@ -12,6 +12,7 @@
            :refer [delete-from-expressions
                    fill-language-by-spec
                    process write-lexicon reload]])
+(require '[clojure.repl :refer (doc)])
 (require '[clojure.tools.logging :as log])
 (require '[dag_unify.core :refer (fail? get-in strip-refs unify)])

@@ -48,6 +49,7 @@
                                      source-language-short-name)]
     (count
      (use-map-fn
+      ;; source-expression in the language that we want to translate into English.
       (fn [source-expression]
         (do (log/debug
              (str source-language-short-name ": "


s/unify/unifyc/: the latter will avoid problems if using (pmap)

--- src/babel/english/writer.clj
+++ src/babel/english/writer.clj
@@ -12,7 +12,7 @@
                    fill-language-by-spec
                    process write-lexicon reload]])
 (require '[clojure.tools.logging :as log])
-(require '[dag_unify.core :refer (fail? get-in strip-refs unify)])
+(require '[dag_unify.core :refer (fail? get-in strip-refs unifyc)])

 (defn rewrite-lexicon []
   (write-lexicon "en" @lexicon))
@@ -25,12 +25,14 @@
   "Generate translations from source language (e.g. 'it' for Italian) into English.
    Optionally takes a root form of a verb in the source language."
   ;; Example usage: (translate \"es\" \"abrazar\"
+  (log/info (str "calling (rewrite-lexicon)"))
   (rewrite-lexicon)
+  (log/info (str "finished calling (rewrite-lexicon)"))
   (let [spec :top
         ;; {:synsem {:sem {:pred :arrive}}}

         spec (if root
-               (unify spec
+               (unifyc spec
                       (language-to-root-spec source-language-short-name root))
                spec)

@@ -143,26 +145,26 @@
     (write-lexicon "en" lexicon)
     (log/info (str "done writing lexicon."))
     (log/info (str "generating with this many verbs: " (.size (reduce concat (vals root-verbs)))))
-    ;; TODO: rewrite with threading macro (->)
+    ;; TODO: rewrite with threading macro (->>)
     (.size (pmap (fn [verb]
                    (let [root-form (get-in verb [:english :english])]
                      (log/debug (str "generating from root-form:" root-form))
                      (.size (map (fn [tense]
-                                   (let [spec (unify {:root {:english {:english root-form}}}
+                                   (let [spec (unifyc {:root {:english {:english root-form}}}
                                                      tense)]
                                      (.size
                                       (map (fn [gender]
-                                             (let [spec (unify spec
+                                             (let [spec (unifyc spec
                                                                {:comp {:synsem {:agr gender}}})]
                                                (log/trace (str "generating from gender: " gender))
                                                (.size
                                                 (map (fn [person]
-                                                       (let [spec (unify spec
+                                                       (let [spec (unifyc spec
                                                                          {:comp {:synsem {:agr {:person person}}}})]
                                                          (log/trace (str "generating from person: " person))
                                                          (.size
                                                           (map (fn [number]
-                                                                 (let [spec (unify spec
+                                                                 (let [spec (unifyc spec
                                                                                {:comp {:synsem {:agr {:number number}}}})]
                                                                    (write-one spec)))
                                                                [:sing :plur]))))


remove unnecessary require

remove unnecessary require

--- src/braid/mobile/panels.cljs
+++ src/braid/mobile/panels.cljs
@@ -1,6 +1,5 @@
 (ns braid.mobile.panels
   (:require [reagent.core :as r]
-            [re-frame.core :refer [subscribe dispatch]]
             [reagent.ratom :include-macros true :refer-macros [reaction]]))

 (defn panels-view [panel-items panel-view]


fix anchors

fix anchors

--- src/clj/just_married/css.clj
+++ src/clj/just_married/css.clj
@@ -42,7 +42,8 @@
    :small-cats "../images/small_cats.jpg"})

 (def common
-  [[]])
+  [[:a {:text-decoration "none"}]
+   [:a:hover {:text-decoration "none"}]])

 (def main-page
   [[:.container {:display "grid"
@@ -71,7 +72,7 @@
                         :vertical-align "-0.4em"}]

    [:blockquote {;;:display "inline" ;; TODO: check if we need this as well
-                 :background (:quote-background COLOR-PALLETTE)
+                 :background (:quote-background COLOR-PALLETTE)lock
                  :padding "0.5em 10px"
                  :font-size "1em"
                  :font-family (:open-sans FONT-FAMILIES)
@@ -116,16 +117,14 @@
                          :text-align "center"
                          :text-decoration "none"
                          :color (:gold COLOR-PALLETTE)
-                         :margin-bottom "50px"}]
+                         :margin-bottom "50px"}

-   ;; FIXME: should be less generic here
-   [:a {:color (:white COLOR-PALLETTE)
-        :text-decoration "none"}]
+    ;; FIXME: should be less generic here
+    [:a {:color (:white COLOR-PALLETTE)}]

-   [:a:hover {:color (:gold COLOR-PALLETTE)
-              :text-decoration "none"
-              :border-left "1px solid white"
-              :border-right "1px solid white"}]])
+    [:a:hover {:color (:gold COLOR-PALLETTE)
+               :border-left "1px solid white"
+               :border-right "1px solid white"}]]])

 (def enter-page
   [[:.initial__root {:display "grid"
@@ -160,5 +159,6 @@
 (defstyles screen
   ;; could maybe even split creating multiple CSS files?
   (into []
-        (concat main-page
+        (concat common
+                main-page
                 enter-page)))


add interpretation for validation failures of type

--- src/clj_money/validation.clj
+++ src/clj_money/validation.clj
@@ -69,6 +69,12 @@
            :class (class pred)})
   [path (format "The attribute at %s is not valid" path)])

+(defn- interpret-type-failure
+  [{:keys [pred path] :as problem}]
+   (when (and (seq pred)
+              (= 'instance? (second pred)))
+     [path (format "%s must be an instance of %s" (-> path last humanize) (nth pred 2))]))
+
 (def problem-interpreters
   [interpret-required-failure
    interpret-regex-failure
@@ -76,6 +82,7 @@
    interpret-positive-big-dec-failure
    interpret-collection-count-failure
    interpret-set-inclusion-failure
+   interpret-type-failure
    interpret-unknown-failure])

 (defn- problem->message