Fix cols derefs and now api-panel-ui is a Form-2 component.

--- src/cljs/cljs_repl_web/views.cljs
+++ src/cljs/cljs_repl_web/views.cljs
@@ -466,24 +466,23 @@
                                                                 [build-symbol-ui symbol])]]])]]]]])

 (defn build-api-panel-ui
-  "Builds the UI for the api panel. Expects the numer of columns in which place the sections
-  of the tutorial and the sections themselves. `cols` must be a divisor of 12."
+  "Builds the UI for the api panel."
   [sections]
-  (let [cols (subscribe [:api-panel-columns])
-        secs (count sections)
-        secs-per-col (quot secs @cols)
-        partitioned-sections (partition-all (if (zero? (rem secs cols))
-                                              secs-per-col
-                                              (inc secs-per-col)) sections)]
-    [h-box
-     :size (str "0 1 " (quot 100 cols) "%")
-     :gap "10px"
-     :children (for [sections partitioned-sections]
-                 ^{:key sections} [v-box
-                                   :size "1 1 auto"
-                                   :gap "10px"
-                                   :children (for [section sections]
-                                               [build-section-ui section])])]))
+  (let [cols (subscribe [:api-panel-columns]) ;; must be a divisor of 12
+        secs (count sections)]
+    (fn [sections]
+      [h-box
+       :size (str "0 1 " (quot 100 @cols) "%")
+       :gap "10px"
+       :children [[label :label (str "Columns: " @cols)]
+                  (for [sections (partition-all (if (zero? (rem secs @cols))
+                                                  (quot secs @cols)
+                                                  (inc (quot secs @cols))) sections)]
+                    ^{:key sections} [v-box
+                                      :size "1 1 auto"
+                                      :gap "10px"
+                                      :children (for [section sections]
+                                                  [build-section-ui section])])]])))

 (defn api-panel []
   [build-api-panel-ui (:sections api-utils/custom-api-map)])


WIP Basic XPC api

WIP Basic XPC api

--- src/cljs/clojure/browser/net.cljs
+++ src/cljs/clojure/browser/net.cljs
@@ -68,32 +68,37 @@
             v])
          (js->clj gxpc-config-fields))))

-(defprotocol IXpcConnection
-  (listen-parent [this type fn] [this type fn encode-json?])
-  (listen-child  [this type fn] [this type fn encode-json?]))
+(defprotocol CrossPageChannel
+  (register-service [this type fn] [this type fn encode-json?])

-(deftype XpcConnection [parent child]
-  IXpcConnection
-  ())
+  (connect [this fn])
+
+  (send-xpc [this type payload]))
+
+(extend-type goog.net.xpc.CrossPageChannel
+
+  CrossPageChannel
+  (register-service [this type fn]
+    (listen-parent this type fn false))
+  (register-service [this type fn encode-json?]
+    (.registerService parent (name type) fn encode-json?))
+
+  (connect [this fn]
+    (.connect this fn))
+
+  (send-xpc [this type payload]
+    (.send this (name type) payload)))

 (defn cross-page-channel
-  [config]
+  [url & config]
   (goog.net.xpc.CrossPageChannel.
    (.strobj (reduce (fn [sum [k v]]
                       (when-let [field (xpc-config-fields k)]
                         (assoc sum field v)))
                     {}
-                    config))))
-
-(defn xpc-connection
-  ([url]
-     (xpc-connection url nil))
-  ([url & config]
-     (let [parent (cross-page-channel
-                   (assoc (apply hash-map config)
-                     :peer_uri
-                     url))]
-       ())))
+                    (assoc (apply hash-map config)
+                      :peer_uri
+                      url)))))

 (defn xhr-connection
   "Returns a connection"


Add drawer component.

Add drawer component.

--- src/cljs/reflecti/ant_design.cljs
+++ src/cljs/reflecti/ant_design.cljs
@@ -508,6 +508,10 @@
             {:description (cond-> description
                             (not (string? description)) as-element)}))])

+(def drawer
+  "https://ant.design/components/drawer/"
+  (adapt-react-class js/antd.Drawer))
+
 ;; -

 (defn modal


Added try catch around start of Jetty to log port it was trying to use.

--- src/cmr/common/api/web_server.clj
+++ src/cmr/common/api/web_server.clj
@@ -46,26 +46,30 @@

   (start
     [this system]
-    (let [{:keys [port routes-fn use-compression?]} this
-          routes (routes-fn system)
-          ^Server server (jetty/run-jetty routes {:port port
-                                                  :join? false
-                                                  :min-threads MIN_THREADS
-                                                  :max-threads MAX_THREADS})]
+    (try
+      (let [{:keys [port routes-fn use-compression?]} this
+            routes (routes-fn system)
+            ^Server server (jetty/run-jetty routes {:port port
+                                                    :join? false
+                                                    :min-threads MIN_THREADS
+                                                    :max-threads MAX_THREADS})]

-      (when use-compression?
-        ;; Create a GZIP handler to handle compression of responses
-        (let [new-handler (doto (GzipHandler.)
-                            (.setHandler (.getHandler server))
-                            (.setMinGzipSize MIN_GZIP_SIZE))]
-          ;; Replace the existing handler with the gzip handler
-          (doto server
-            (.stop)
-            (.setHandler new-handler)
-            (.start))))
+        (when use-compression?
+          ;; Create a GZIP handler to handle compression of responses
+          (let [new-handler (doto (GzipHandler.)
+                              (.setHandler (.getHandler server))
+                              (.setMinGzipSize MIN_GZIP_SIZE))]
+            ;; Replace the existing handler with the gzip handler
+            (doto server
+              (.stop)
+              (.setHandler new-handler)
+              (.start))))

-      (info "Jetty started on port" port)
-      (assoc this :server server)))
+        (info "Jetty started on port" port)
+        (assoc this :server server))
+      (catch Exception e
+        (info "Failed to start jetty on port" port)
+        (throw e))))

   (stop
     [this system]


remove space

remove space

--- test/synthesis_crawlers/core_test.clj
+++ test/synthesis_crawlers/core_test.clj
@@ -247,14 +247,10 @@
                               {:tag "span", :class #{}, :id "sp"}])
            "html > body > div#bar.hoge.piyo > span#sp"))))

-
-
 (deftest create-relative-path-test
   (testing "returns a css selector which specifies e"
     (let [node (first (.select (Jsoup/parse "

") "html > body > div > span#sp"))]
       (is (= (create-relative-path node) "html > body > div.hoge > span#sp")))))
-
-

 (deftest generate-container-cand-exprs-test
   (testing "generates the expressions of the specified containers"


explicit truncate op for tests

explicit truncate op for tests

--- src/er_cassandra/session/alia.clj
+++ src/er_cassandra/session/alia.clj
@@ -138,33 +138,40 @@
          sort
          vec)))

+(defn truncate-test-tables
+  "given a session truncate the tables given. only works in _test
+   keyspaces"
+  [session & tables]
+  (let [ks (s/keyspace session)
+        tables (filterv #(not= "schema_migrations" (some-> % name)) tables)]
+
+    (when-not (str/ends-with? (name ks) "_test")
+      (throw (ex-info "truncate-test-tables is only for *_test keyspaces"
+                      {:keyspace ks
+                       :tables tables})))
+
+    (info "truncating test tables:" tables)
+
+    (with-context deferred-context
+      (mlet [:let [tfns (for [t tables]
+                          (fn [_]
+                            (s/execute session (h/truncate t))
+                            (return deferred-context true)))]]
+        (if (not-empty tfns)
+          (apply >>= (return true) tfns)
+          (return true))))))
+
 (defn truncate-spy-tables
   "given a spy session, truncate all tables which have been accessed,
    then reset the spy-log"
   [spy-session]
-  (let [ks (s/keyspace spy-session)
-        mts (mutated-tables spy-session)
-        mts (filterv #(not= "schema_migrations" (some-> % name)) mts)]
-
-    (when-not (str/ends-with? (name ks) "_test")
-      (throw (ex-info "truncate-spy-tables is only for *_test keyspaces"
-                      {:keyspace ks
-                       :mutated-tables mts})))
-
-    (info "truncating spy tables:" mts)
-
-    (with-context deferred-context
-      (mlet [:let [tfns (for [mt mts]
-                          (fn [_]
-                            (s/execute spy-session (h/truncate mt))
-                            (return deferred-context true)))]
-
-             _ (if (not-empty tfns)
-                 (apply >>= (return true) tfns)
-                 (return true))]
-
-        (s/reset-spy-log spy-session)
-        (return true)))))
+  (with-context deferred-context
+    (mlet [:let [mts (mutated-tables spy-session)]
+
+           _ (apply truncate-test-tables spy-session mts)]
+
+      (s/reset-spy-log spy-session)
+      (return true))))

 (defrecord AliaSpySession [keyspace
                            alia-session


Replace graphify with graph-fn that supports incanter datasets.

--- src/grafter/rdf.clj
+++ src/grafter/rdf.clj
@@ -12,9 +12,10 @@
    [grafter.rdf.ontologies.sdmx-measure]
    [grafter.rdf.ontologies.sdmx-attribute]
    [grafter.rdf.ontologies.sdmx-concept])
-  (:require [clojure.java.io :as io])
-  (:require [grafter.rdf.protocols :as pr])
-  (:require [grafter.rdf.sesame :as ses])
+  (:require [clojure.java.io :as io]
+            [grafter.tabular :as tab]
+            [grafter.rdf.protocols :as pr]
+            [grafter.rdf.sesame :as ses])
   (:import [grafter.rdf.protocols Triple Quad]
            [grafter.rdf.sesame ISesameRDFConverter])
   (:import [org.openrdf.model Statement Value Resource Literal URI BNode ValueFactory]
@@ -84,17 +85,24 @@
   (reduce conj triple-template
           (mapcat vector hash-map)))

-(defmacro graphify [row-bindings & forms]
-  "Takes a vector in fn binding form (where destructuring is
-supported) followed by a series of graph or triplify forms and
-concatenates them all together."
-  `(fn graphify-rows-fn [rs#]
-     (mapcat (fn graphify-row [row-sym#]
-               (let [~@row-bindings row-sym#]
-                 (->> (concat
-                       ~@forms)
-                      (map (fn [triple#] (with-meta triple# {:row row-sym#}))))))
-             rs#)))
+(defn- canonicalise-column-names [ds]
+  (tab/make-dataset (map name (tab/column-names ds)) ds))
+
+(defmacro graph-fn
+  "Takes FIXME followed by a series of graph or triplify forms and concatenates them
+  all together."
+  [[row-bindings] & forms]
+  {:pre [(or (symbol? row-bindings) (map? row-bindings)
+             (vector? row-bindings))]}
+
+  `(fn graphify-dataset [ds#]
+     (mapcat (fn graphify-row [row#]
+               (let [~row-bindings row#]
+                 (->> (concat ~@forms)
+                      (map (fn [triple#]
+                             (with-meta triple# {::row row#}))))))
+             (:rows ds#))))
+

 (defn load-triples [my-repo triple-seq]
   (doseq [triple triple-seq]
@@ -102,7 +110,7 @@
       (pr/add-statement my-repo triple)
       (catch java.lang.IllegalArgumentException e
         (throw (Exception.
-                (str "Problem loading triple: " (print-str triple) " from row: " (-> triple meta :row)) e)))))
+                (str "Problem loading triple: " (print-str triple) " from row: " (-> triple meta ::row)) e)))))
   my-repo)

 (def prefixer ontutils/prefixer)


Inject the monitoring component into the peer query server.

--- src/onyx/system.clj
+++ src/onyx/system.clj
@@ -145,7 +145,7 @@
      :messenger-group messenger-group
      :state-store-group state-store-group
      :logging-config (logging-config/logging-configuration peer-config)
-     :monitoring monitoring
+     :monitoring monitoring
      :virtual-peer (component/using
                     (virtual-peer group-ch outbox-ch log peer-config onyx-task vpeer-id)
                     [:group-id :messenger-group :monitoring :logging-config :state-store-group])}))
@@ -156,10 +156,10 @@
    {:config peer-config
     :logging-config (logging-config/logging-configuration peer-config)
     :monitoring (component/using (metrics-monitoring/new-monitoring) [:logging-config])
-    :state-store-group (component/using (queryable-state/new-state-store-group peer-config) [:logging-config])
+    :state-store-group (component/using (queryable-state/new-state-store-group peer-config) [:logging-config])
     :messenger-group (component/using (m/build-messenger-group peer-config) [:logging-config])
-    :query-server (component/using (qs/query-server peer-config) [:logging-config :state-store-group])
-    :peer-group-manager (component/using (pgm/peer-group-manager peer-config onyx-vpeer-system)
+    :query-server (component/using (qs/query-server peer-config) [:logging-config :state-store-group :monitoring])
+    :peer-group-manager (component/using (pgm/peer-group-manager peer-config onyx-vpeer-system)
                                          [:logging-config :monitoring
                                           :state-store-group :messenger-group
                                           :query-server])}))


Don't fill parent by default

Don't fill parent by default

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -111,8 +111,7 @@

 (defn ^:private create-group
   [^WidgetGroup group children]
-  (-> (doto group
-        (.setFillParent true))
+  (-> group
       u/create-entity
       (add! children)))


Fix ns issue.

Fix ns issue.

--- src/kixi/hecuba/data/validate.clj
+++ src/kixi/hecuba/data/validate.clj
@@ -13,7 +13,7 @@
 (defn- reset-counters!
   "Resets the counters for a given sensor."
   [session where]
-  (dbnew/execute session
+  (db/execute session
    (hayt/update :sensors
                 (hayt/set-columns {:events 0
                                    :errors 0})
@@ -23,7 +23,7 @@
   [[= :device_id (:device_id m)] [= :type (:type m)]])

 (defn- update-sensor [session sensor delta]
-  (dbnew/execute session
+  (db/execute session
                  (hayt/update :sensors
                               (hayt/set-columns delta)
                               (hayt/where (where-from sensor)))))
@@ -52,7 +52,7 @@
   "Increment error counter and label median spike in metadata."
   [store sensor m]
   (let [metadata (-> m :metadata)]
-    (dbnew/with-session [session (:hecuba-session store)]
+    (db/with-session [session (:hecuba-session store)]
       (update-sensor session (where-from m) {:errors (hayt/inc-by 1)})
       (assoc-in m [:metadata] (m/update-metadata metadata {:median-spike "true"})))))

@@ -94,7 +94,7 @@
       (label-invalid-value session sensor (where-from m)))))

 (defn- sensor-exists? [session m]
-  (first (dbnew/execute session
+  (first (db/execute session
                   (hayt/select :sensors
                                (hayt/where (where-from m))))))

@@ -102,7 +102,7 @@
   "Measurement map is pipelines through a number of validation
   functions. Returns map of measurement with updated metadata."
   [store m]
-  (dbnew/with-session [session (:hecuba-session store)]
+  (db/with-session [session (:hecuba-session store)]
     (let [sensor (sensor-exists? session m)
           events (-> sensor first :events)
           where  (where-from m)


Alignment.

Alignment.

--- src/klangmeister/instruments.cljs
+++ src/klangmeister/instruments.cljs
@@ -37,8 +37,8 @@
                        (-> .-type  (set! "sine"))
                        (.start start)
                        (.stop (+ start 1.5)))))]
-    (doseq [h [1 2 3 4.1 5.2]
-            p [1 0.6 0.4 0.25 0.2]]
+    (doseq [h [1.0 2.0 3.0 4.1  5.2]
+            p [1.0 0.6 0.4 0.25 0.2]]
       (harmonic h p))))

 (defn fuzz! [midi start dur]


Made sure that blog navbar is nice and ordered.

--- src/lambda_blog/templates/nav.clj
+++ src/lambda_blog/templates/nav.clj
@@ -7,7 +7,7 @@
                       :dropdown-menu
                       "nav navbar-nav")}
          (map (fn [[f s]]
-                (if (map? s)
+                (if (sequential? s)
                   (li {:class :dropdown}
                       (a {:href "#"}
                          f


added TODO comments

added TODO comments

--- src/main/clojure/naojure/core.clj
+++ src/main/clojure/naojure/core.clj
@@ -626,6 +626,7 @@
         speed (/ desired-change (* max-change execution-time-seconds))]
     (clip speed 0.01 1.0)))

+;; TODO needs to return futures we can use to check when task completes
 (defn- motion-task
   [robot joint-name joint-pos-deg execution-time-seconds cur-joints limits]
   (let [pos-rad (Math/toRadians joint-pos-deg)
@@ -647,7 +648,9 @@
       (map (fn [[j v]] (motion-task robot j v duration cur-joints limits))
            joint-changes))))

+;; ability to use channel or callback on completion
 ;; TODO make the duration and channel params optional
+;; TODO handle tasks other than motion
 (defn donao
   "Accepts a number of parameters specifying robot actions and executes them"
   [robot duration chan & actions]


Log PID without hostname.

Log PID without hostname.

--- src/riemann/bin.clj
+++ src/riemann/bin.clj
@@ -42,7 +42,11 @@
 (defn pid
   "Process identifier, such as it is on the JVM. :-/"
   []
-  (-> (java.lang.management.ManagementFactory/getRuntimeMXBean) (.getName)))
+  (let [name (-> (java.lang.management.ManagementFactory/getRuntimeMXBean)
+               (.getName))]
+    (try
+      (get (re-find #"^(\d+).*" name) 1)
+      (catch Exception e name))))

 (defn -main
   "Start Riemann. Loads a configuration file from the first of its args."


Index CC headers into a separate field.  Use linked fields to search them as a part of the "to" field.

--- src/net/dishevelled/mailindex.clj
+++ src/net/dishevelled/mailindex.clj
@@ -79,15 +79,27 @@
                                  (map address-to-str
                                       (.getRecipients msg Message$RecipientType/TO))))
          :boost 2
-         :linked-fields ["to_tokens"]}
+         :linked-fields ["to_tokens" "cc"]}
+
+   "cc" {:value-fn
+         (fn [^MimeMessage msg] (join
+                                 " "
+                                 (map address-to-str
+                                      (.getRecipients msg Message$RecipientType/CC))))
+         :boost 2
+         :linked-fields ["to_tokens" "cc"]}

    "to_tokens" {:value-fn (fn [^MimeMessage msg]
                             (join " "
-                                  (map address-to-tokens
-                                       (.getRecipients
-                                        msg
-                                        Message$RecipientType/TO))))
-                :boost 2}
+                                  (concat (map address-to-tokens
+                                               (.getRecipients
+                                                msg
+                                                Message$RecipientType/TO))
+                                          (map address-to-tokens
+                                               (.getRecipients
+                                                msg
+                                                Message$RecipientType/CC)))))
+                :boost 1}

    "from" {:value-fn (fn [^MimeMessage msg] (address-to-str (first (.getFrom msg))))
            :boost 3


If Navigable isn't found, fallback on get-in

--- src/themis/core.clj
+++ src/themis/core.clj
@@ -40,9 +40,12 @@

 (defn navigate
   "Fetch the data from within a data structure given coordinates.
+  If the data structure is not extended to Navigable, try `get-in`.
   Note: Tuck our internal protocols behind a function for consumption"
   [t coordinate-vec]
-  (protocols/-navigate t coordinate-vec))
+  (if (satisfies? protocols/Navigable t)
+    (protocols/-navigate t coordinate-vec)
+    (get-in t coordinate-vec)))

 (defn raw-validation
   "Create a response vector for a validation call,


figwheel.main: print repl start header and include controls in repl-requires

--- figwheel-main/src/figwheel/main.cljc
+++ figwheel-main/src/figwheel/main.cljc
@@ -842,6 +842,9 @@
                  (fn [p]
                    (vec (distinct
                          (concat p '[figwheel.repl.preload])))))
+      conn?
+      (update-in [:options :repl-requires] into '[[figwheel.main :refer-macros [stop-builds start-builds build-once reset clean status]]
+                                                  [figwheel.repl :refer-macros [conns focus]]])
       (and conn? (:client-print-to config))
       (update-in [:options :closure-defines] assoc
                  'figwheel.repl/print-output
@@ -1043,6 +1046,22 @@
                    (ansip/format-str (log/format-ex except-data))))
         #_(clojure.pprint/pprint (Throwable->map err))
         (flush)))))
+
+(def repl-header
+  (str "Figwheel Main Controls:
+          (figwheel.main/stop-builds id ...)  ;; stops Figwheel autobuilder for ids
+          (figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
+          (figwheel.main/reset)               ;; stops, cleans, reloads config, and starts autobuilder
+          (figwheel.main/build-once id ...)   ;; builds source one time
+          (figwheel.main/clean id ...)        ;; deletes compiled cljs target files
+          (figwheel.main/status)              ;; displays current state of system
+Figwheel REPL Controls:
+          (figwheel.repl/conns)               ;; displays the current connections
+          (figwheel.repl/focus session-name)  ;; choose which session name to focus on
+In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
+    Docs: (doc function-name-here)
+    Exit: :cljs/quit
+ Results: Stored in vars *1, *2, *3, *e holds last exception object"))

 ;; TODO this needs to work in nrepl as well
 (defn repl [repl-env repl-options]
@@ -1066,12 +1085,14 @@
                            string/trim-newline
                            println)
                       (flush))))]
-    (let [repl-options (assoc repl-options :caught (:caught repl-options repl-caught))]
+    (let [repl-options (-> repl-options
+                           (assoc :caught (:caught repl-options repl-caught)))]
       (println (ansip/format-str
                 [:bright (format "Prompt will show when REPL connects to evaluation environment (i.e. %s)"
                                  (if (= :nodejs (:target repl-options))
                                    "Node"
                                    "a REPL hosting webpage"))]))
+      (println repl-header)
       (if (in-nrepl?)
         (nrepl-repl repl-env repl-options)
         (let [repl-fn (or (when-not (false? (:rebel-readline (::config *config*)))


figwheel.repl: turn development debug logging off

--- figwheel-repl/src/figwheel/repl.cljc
+++ figwheel-repl/src/figwheel/repl.cljc
@@ -67,7 +67,7 @@
   (glog/log logger goog.debug.Logger.Level.FINEST msg))

 ;; TODO dev
-(.setLevel logger goog.debug.Logger.Level.FINEST )
+#_(.setLevel logger goog.debug.Logger.Level.FINEST)

 ;; --------------------------------------------------------------
 ;; Bootstrap goog require reloading


hide the scrollbar on the container_parent

--- frontend/components/build_steps.cljs
+++ frontend/components/build_steps.cljs
@@ -132,15 +132,12 @@
             containers (:containers data)
             controls-ch (:controls-ch data)]
         (html
-         [:div
+         [:div#container_scroll_parent ;; hides horizontal scrollbar
           [:div#container_parent {:on-wheel (fn [e]
                                               (when (not= 0 (.-deltaX e))
                                                 (.preventDefault e)
                                                 (aset js/document.body "scrollTop" (+ js/document.body.scrollTop (.-deltaY e)))))
-                                  :on-scroll (fn [e]
-                                               (js/console.log e)
-                                               (js/console.log (.-detail e))
-                                               )
+                                  :on-scroll #(put! controls-ch [:container-parent-scroll])
                                   :scroll "handle_browser_scroll"
                                   :window-resize "realign_container_viewport"
                                   :resize-sensor "height_changed"}


Improve source code comments

Improve source code comments

--- src/web/remote.cljs
+++ src/web/remote.cljs
@@ -42,7 +42,7 @@
   (println "send-to-remote" (:remote queries))
   (put! ch-pending-queries {:queries queries :merge-fn merge-fn}))

-;;;; Receive push updates from the server
+;;;; Queue queries while backend is down, flush whenever possible

 (defn start-flushing-pending-queries! [reconciler]
   (go
@@ -57,6 +57,8 @@
           (println "Remote: waiting for connection")
           (<! (timeout 500))))
       (recur))))
+
+;;;; Receive push updates from the server

 (defn refetch-root-query [reconciler]
   (let [app (om/app-root reconciler)


fix usage of (dag-unify.core/fail-path)

fix usage of (dag-unify.core/fail-path)

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -311,12 +311,11 @@
         (if (and
              *throw-exception-if-failed-to-add-complement*
              (get-in child '(:head)))
-          (throw (exception (str "failed to add complement: " child "  to: phrase: " parent
-                                 ". Failed path was: " (fail-path result)
-                                 ". Value of parent at path is: "
-                                 (get-in parent (fail-path result))
-                                 "; Synsem of child is: "
-                                 (get-in child '(:synsem) :top)))))
+          (throw
+           (exception
+            (let [fail-path (fail-path parent {:comp child})]
+              (str "failed to add complement: " (:rule child) "  to: phrase: " (:rule parent)
+                   ". Failed path was: " fail-path)))))
         (log/trace (str "moreover-comp: complement synsem: " (strip-refs (get-in child '(:synsem) :top))))
         (log/trace (str "moreover-comp:  parent value: " (strip-refs (get-in parent (fail-path result)))))
         :fail))))


moved update dialogs

moved update dialogs

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -224,7 +224,7 @@

 (om/root
-  (fn [{:keys [stream cells win-state moves tick tick-ms grid-size media-error? show-nums] :as app} _]
+  (fn [{:keys [stream cells win-state moves tick tick-ms grid-size show-nums] :as app} _]
     (reify
       om/IDidMount
       (did-mount [_]
@@ -293,11 +293,6 @@
                     :step     "10"
                     :onChange #(set-tick-ms! app (- (js/parseInt (.. % -target -value))))}))))

-            (if stream
-              (om/build grid app)
-              (dom/div #js {:className "heads-up"} "To play Cellf, allow your camera."))
-
-            (when media-error?
-              (dom/div #js {:className "warning"} "Error accessing camera.")))))))
+            (when stream (om/build grid app)))))))
   app-state
   {:target (.getElementById js/document "app")})


Remove socket-timeout from mongo-options

--- src/cfpb/qu/env.clj
+++ src/cfpb/qu/env.clj
@@ -6,8 +6,7 @@
 (def default-env
   {:mongo-host "127.0.0.1"
    :mongo-port 27017
-   :mongo-options {:connect-timeout 2000
-                   :socket-timeout 2000}
+   :mongo-options {:connect-timeout 2000}
    :statsd-port 8125
    :http-ip "127.0.0.1"
    :http-port 3000


Allow bitrate of 32 but for periodicals only

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -95,7 +95,7 @@

 (def bitrates
   "Possible bitrates for encoding a DTB"
-  [128 112 96 80 64 56 48])
+  [128 112 96 80 64 56 48 32])

 (defn ideal-bitrate
   "Calculate the ideal bitrate based on the size of a production and how
@@ -120,6 +120,8 @@
         ;; BitRate (kbps) = (File Size (bytes) / Duration (seconds)) * 8/1000
         max-bitrate (* (/ max-capacity duration sampling-ratio) (/ 8 1000))]
     (->> bitrates
+         ;; only use bitrate 32 for periodicals
+         (filter #(or (= (:production_type production) "periodical") (> % 32)))
          ;; for stereo productions use only bitrates larger than 96
          (filter #(or (dtb/mono? dtb) (>= % 96)))
          (filter #(<= % max-bitrate))


Add support for starting a new ruby runtime with a specific environment

--- src/circle/ruby.clj
+++ src/circle/ruby.clj
@@ -5,16 +5,38 @@
   (:import java.io.StringWriter)
   (:import java.lang.ref.WeakReference)
   (:use [circle.util.except :only (throw-if-not)])
+  (:use [arohner.utils :only (inspect)])
   (:require [clojure.string :as string])
   (:require fs))

-(declare eval ruby get-class get-module send)
-
-(defn new-runtime []
-  (let [config (doto (org.jruby.RubyInstanceConfig.)
+(declare eval ruby get-class get-module send ->ruby)
+
+(def ^{:dynamic true} *runtime* nil)
+
+(defmacro with-runtime [r & body]
+  `(binding [*runtime* ~r]
+     ~@body))
+
+(defn hash-get
+  "Get a value out of a ruby hash"
+  [h key]
+  (.fastARef h (->ruby key)))
+
+(defn hash-set
+  "Set a value in a ruby hash"
+  [h key value]
+  (.fastASet h (->ruby key) (->ruby value)))
+
+(defn new-runtime
+  "Creates and returns a new ruby runtime. env is a map of string->string environment variables that will be overwritten"
+  [& {:keys [env]}]
+  (let [whole-env (merge (into {} (System/getenv)) env)
+        config (doto (org.jruby.RubyInstanceConfig.)
+                 (.setEnvironment whole-env)
                  (.setCompatVersion org.jruby.CompatVersion/RUBY1_9)
-                 (.setJRubyHome (format "%s/.rvm/rubies/%s" (System/getenv "HOME") (System/getenv "rvm_ruby_string"))))]
-    (org.jruby.Ruby/newInstance config)))
+                 (.setJRubyHome (format "%s/.rvm/rubies/%s" (System/getenv "HOME") (System/getenv "rvm_ruby_string"))))
+        runtime (org.jruby.Ruby/newInstance config)]
+    runtime))

 (defn eval
   ([s]


Calculate the ideal bitrate more like the legacy system

i.e. do not half the amount of space for stereo productions. Instead
just minify the available space by a small tolerance of 2%.

This reverts commit b4853cd2a7cc285777baff07912ca75c4a1a1923.

Fixes #52

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -100,7 +100,12 @@
   [production]
   (let [dtb (path/recorded-path production)
         duration (quot (dtb/audio-length dtb) 1000) ; convert from millisecs to secs
-        max-bitrate (/ (* (/ max-size duration) 8) 1000)]
+        ;; apparently stereo doesn't use twice as much space if you
+        ;; use joint stereo compression mode, so no need to divide by
+        ;; two. The legacy system just added a tolerance of 2% for
+        ;; stereo productions.
+        sampling-ratio (if (dtb/mono? dtb) 1 1.02)
+        max-bitrate (/ (* (/ max-size duration sampling-ratio) 8) 1000)]
     (->> bitrates
          (filter #(<= % max-bitrate))
          (apply max 0))))


Clean up core

Clean up core

Just holds code useful for rerunning taxonomy.

--- src/datemo/core.clj
+++ src/datemo/core.clj
@@ -3,19 +3,8 @@
   (:require
     [datomic.api :as d]
     [clojure.java.io :as io]
-    [clojure.pprint :as pp :refer (pprint)])
-  (:gen-class))
+    [clojure.pprint :as pp :refer (pprint)]))

-;; (def conn
-;;   (<!! (client/connect
-;;         {:db-name "datemo"
-;;          :account-id client/PRO_ACCOUNT
-;;          :secret "datemo"
-;;          :region "none"
-;;          :endpoint "localhost:8998"
-;;          :service "peer-server"
-;;          :access-key "datemo"})))
-;; (def db (client/db conn))
 (def db-uri "datomic:dev://localhost:4334/datemo");
 (def conn (d/connect db-uri))
 (def db (d/db conn))
@@ -37,15 +26,7 @@
              more)
       {:datoms n})))

-(defn -main []
-  (def tx (-> (io/resource "sample-docs.edn")
-               (read-all)
-               (first)))
-  (def schema-tx (-> (io/resource "schemas/arb.edn")
-                     (read-all)
-                     (first)))
-  ;; (pprint (d/transact conn schema-tx))
-  ;; (pprint (d/transact conn tx))
-  ;; (pprint (into {} (d/entity db 17592186045418)))
-  ;; (pprint (d/pull db '[*] 17592186045418))
-  )
+;; (def schema-tx (-> (io/resource "schemas/arb.edn")
+;;                    (read-all)
+;;                    (first)))
+;; (pprint (d/transact conn schema-tx))


Improve error recovery of the store internal streams.

--- src/potok/core.cljs
+++ src/potok/core.cljs
@@ -93,6 +93,8 @@

 (enable-console-print!)

+(def ^:private noop (constantly nil))
+
 ;; --- Public API

 (defn store
@@ -108,38 +110,50 @@
   used for advanced use cases, where one store is not
   enough."
   ([] (store nil))
-  ([{:keys [on-error state]
-     :or {on-error default-error-handler}}]
+  ([{:keys [on-error state] :or {on-error default-error-handler}}]
    {:pre [(fn? on-error)]}
-   (let [bus (rx/bus)
-         state-s  (->> (rx/filter update? bus)
-                       (rx/scan #(update %2 %1) state)
-                       (rx/merge (rx/just state))
-                       (rx/catch on-error)
-                       (rx/retry 1024)
-                       (rx/share))
-         watch-s  (->> (rx/filter watch? bus)
-                       (rx/with-latest-from vector state-s)
-                       (rx/flat-map (fn [[event state]] (watch event state bus)))
-                       (rx/catch on-error)
-                       (rx/retry 1024))
-         effect-s (->> (rx/filter effect? bus)
-                       (rx/with-latest-from vector state-s))
-         subw (rx/on-value watch-s #(rx/push! bus %))
-         sube (rx/on-value effect-s (fn [[event state]] (effect event state bus)))
-         stoped? (volatile! false)]
-     (specify! state-s
-       Store
-       (-push [_ event]
-         (when @stoped? (throw (ex-info "store already terminated" {})))
-         (rx/push! bus event))
+   (letfn [(process-watch [input-sub [event state]]
+             (watch event state input-sub))
+           (process-update [input-sub state event]
+             (update event state))
+           (handle-effect [input-sub [event state]]
+             (effect event state input-sub))
+           (handle-error [error]
+             (on-error error)
+             (rx/throw error))]
+     (let [input-sb (rx/subject)
+           state-sb (rx/behavior-subject state)
+           state-sm (->> (rx/filter update? input-sb)
+                         (rx/scan (partial process-update input-sb) state)
+                         (rx/catch handle-error)
+                         (rx/retry 1024))
+           watch-sm (->> (rx/filter watch? input-sb)
+                         (rx/with-latest-from vector state-sb)
+                         (rx/flat-map (partial process-watch input-sb))
+                         (rx/catch handle-error)
+                         (rx/retry 1024))
+           effct-sm (->> (rx/filter effect? input-sb)
+                         (rx/with-latest-from vector state-sb)
+                         (rx/do (partial handle-effect input-sb))
+                         (rx/catch handle-error)
+                         (rx/retry 1024))
+           subs     (rx/subscribe state-sm state-sb)
+           subw     (rx/subscribe watch-sm input-sb)
+           sube     (rx/subscribe effct-sm noop)
+           stoped?  (volatile! false)]
+       (specify! state-sb
+         Store
+         (-push [_ event]
+           (when @stoped? (throw (ex-info "store already terminated" {})))
+           (rx/push! input-sb event))

-       Object
-       (close [_]
-         (vreset! stoped? true)
-         (.unsubscribe subw)
-         (.unsubscribe sube)
-         (rx/end! bus))))))
+         Object
+         (close [_]
+           (vreset! stoped? true)
+           (.unsubscribe subs)
+           (.unsubscribe subw)
+           (.unsubscribe sube)
+           (rx/end! input-sb)))))))

 (defn emit!
   "Emits an event or a collection of them into the default store.


allowing fuzzy conform helper to traverse through spec/keys specs

--- src/specly/core.clj
+++ src/specly/core.clj
@@ -56,7 +56,7 @@
   (when-let [s (and spec-key (spec-from-registry spec-key))]
        (satisfies? FuzzySpec s)))

-
+(declare parse-keys-args poss-path)

 ;; score a spelling suggestion
 ;;  + 1 the value is a collection and conforms
@@ -232,8 +232,21 @@
               (cond
                 (s/valid? (k->s k) v) 1
                 (fuzzy-spec? (k->s k))
-                (fuzzy-conform-score (spec-from-registry (k->s k)) v))
-
+                (fuzzy-conform-score (spec-from-registry (k->s k)) v)
+
+                ;; TODO extract as method
+                ;; consider making conform-score protocol private and having a general conform score
+                ;; to test for shape of either keys or strict-keys type
+
+                ;; this may be going to deep
+                :else
+                (when-let [s (spec-from-registry (k->s k))]
+                    (when (s/spec? s)
+                      (let  [d (s/describe s)]
+                        (when (#{'keys 'strict-keys} (first d))
+                          (fuzzy-conform-score-helper (apply parse-keys-args (rest d))
+                                                    v))))))
+
               (and (sequential? v)
                    (s/valid? (k->s k) v))
               1
@@ -262,8 +275,28 @@
             (avg (into (vec good-key-val-scores) adjusted-key-val-scores))]))))

+
+
+
 (comment

+
+
+  (fuzzy-conform-score (strict-keys :opt-un [:fig-opt/http-server-root
+                                             :fig-opt/server-port
+                                             :fig-opt/server-ip]
+                                    :req-un [:fig-opt/loose-build-config])
+                       {:http-server-root 1
+                        :server-port 1
+                        :asdf 3
+                        :loose-build-config {;:aaaaaaaaa "asdf"
+                                             ;:bbbbbbbb "asdf"
+                                             :cccccccc "asdf"
+                                             }
+                        }
+                       )
+
+
   (fuzzy-conform-score-helper (parse-keys-args
                                :opt-un [:fig-opt/http-server-root
                                         :fig-opt/server-port
@@ -422,8 +455,6 @@

   ;;

-(declare poss-path)
-
 (def empty-path-set #{})
 (def consable-empty-path-set #{[]})

@@ -469,8 +500,6 @@
            (when-let [spec (spec-from-registry desc)]
              (s/regex? spec)))
       (s/regex? desc)))
-
-(declare poss-path)

 (def int-key {:ky ::int-key})

@@ -571,6 +600,19 @@

+;; moving from errors to messages
+
+;; filtering errors
+;; upgrading unknown key errors to misplaced key errors or misplaced misspelled key errors
+;; could remove the possible missing required key errors caused by misspelling
+;; could remove the local versions of these errors in strict-keys
+
+
+
+
+;; filtering and sorting errors
+;;
+

@@ -620,6 +662,11 @@
                                                        :build-config/id
                                                        :build-config/source-paths]
                                               :opt-un [:build-config/assert]))
+
+    (s/def :fig-opt/loose-build-config (s/keys :req-un [
+                                                        :build-config/id
+                                                        :build-config/source-paths]
+                                               :opt-un [:build-config/assert]))

     (s/def :fig-opt/http-server-root string?)
@@ -655,5 +702,6 @@
                                       [{:id :asdf
                                         :source-paths ["src"]}]})

-
+
+  (remove-ns 'specly.core)
   )


Fix bug causing worker to crash when WORKER_MAX_JOBS not set

--- src/worker/core.clj
+++ src/worker/core.clj
@@ -80,6 +80,6 @@
     (let [ch (lch/open conn)]
       (lq/declare ch jobs-q {:durable true :auto-delete false})
       (le/fanout ch events-x {:durable false :auto-delete false})
-      (lb/qos ch (Integer/parseInt (env "WORKER_MAX_JOBS" 1)))
+      (lb/qos ch (Integer/parseInt (env "WORKER_MAX_JOBS" "1")))
       (println "Worker" worker-id "Waiting for jobs")
       (lc/blocking-subscribe ch jobs-q on-message))))


Tidied up async testing.

Tidied up async testing.

--- test-cljs/meetdown/view_test.cljs
+++ test-cljs/meetdown/view_test.cljs
@@ -1,20 +1,32 @@
 (ns meetdown.view-test
-  (:require [cljs.core.async :refer [<! chan]]
-            [cljs.test :as t :refer-macros [async deftest is run-tests]]
+  (:require [cljs.core.async :refer [<! chan >!]]
+            [cljs.test :as t :refer-macros [async deftest is testing]]
             [meetdown.view :as v]
             [meetdown.messages :refer [FindEvent]]
             [cljs-http.client :as http])
   (:require-macros [cljs.core.async.macros :refer [go]]))

+(deftest test-async
+  (testing "Just a toy test to try out async testing."
+   (let [c (chan)]
+      (cljs.test/async done
+                       (go
+                         (>! c "hello"))
+                       (go
+                         (let [msg (<! c)]
+                           (is (= "hello" msg))))
+                       (done)))))
+
 (deftest test-event-lookup
   (let [c (chan)]
-    (v/event-lookup c {:route-params {:id 1234}})
     (async done
-           (go
-             (let [msg (<! c)]
-               (is (= (:id msg) 1234))
-               (is (= FindEvent (type msg)))
-               (done))))))
+           (testing "Test that event-lookup puts the route-params from view to the ui-channel in the form of a FindEvent record."
+                      (v/event-lookup c {:route-params {:id 1234}})
+                      (go
+                        (let [msg (<! c)]
+                          (is (= 1234 (:id msg)))
+                          (is (= FindEvent (type msg))))
+                        (done))))))

-;; TODO I have no idea why but this works when run via doo but it doesn't when I run run-tests through
-;; the repl in CIDER using (cljs.test/run-tests 'meetdown.view-test)
+;; FYI When I run run-tests through the repl in CIDER using (cljs.test/run-tests 'meetdown.view-test) the output goes to the browser console!
+;; Not sure what to do about this but I'll live with it for now.


Fix subst cljs form that wasn't quoted

Fix subst cljs form that wasn't quoted

--- test/clj/dalap/test/walk_test.clj
+++ test/clj/dalap/test/walk_test.clj
@@ -1,5 +1,5 @@
 ^{:cljs
-  (ns dalap.test.walk-test
+  '(ns dalap.test.walk-test
     (:require [buster-cljs.core :refer [is is-equal]]
               [dalap.walk :refer
                (IWalkerState
@@ -66,8 +66,3 @@
   (it "recur over the walk function"
     (is (= (walk [[1 2 3] [4 5]] recursive-visitor)
            [[1 2 3] [4 5]]))))
-
-;; (deftest test-using-apply-with-a-walker
-;;   (it "walk works when used in an apply"
-;;     (is-equal (apply walk [1])
-;;               1)))


Standardise utility routes

Standardise utility routes

--- src/exploud/web.clj
+++ src/exploud/web.clj
@@ -96,18 +96,22 @@
 (defroutes routes
   "The RESTful routes we provide."

+  (GET "/ping"
+       []
+       (response "pong" "text/plain"))
+
+  (GET "/healthcheck"
+       []
+       (response {:name "exploud"
+                  :version *version*
+                  :success true}))
+
   (context
    "/1.x" []

    (GET "/ping"
         []
         (response "pong" "text/plain"))
-
-   (GET "/status"
-        []
-        (response {:name "exploud"
-                   :version *version*
-                   :success true}))

    (GET "/pokemon"
         []


use fully qualified class in type-hint, works around a clojure bug

--- src/hiccup/util.clj
+++ src/hiccup/util.clj
@@ -42,7 +42,7 @@
   (apply str (map to-str xs)))

 (defprotocol ToURI
-  (^URI to-uri [x] "Convert a value into a URI."))
+  (^java.net.URI to-uri [x] "Convert a value into a URI."))

 (extend-protocol ToURI
   java.net.URI


Include in test.

Include in test.

--- test/onyx/log/submit_job_test.clj
+++ test/onyx/log/submit_job_test.clj
@@ -28,3 +28,39 @@
   (fact (:jobs new-replica) => [:b :a])
   (fact diff => {:job :a})
   (fact reactions => nil))
+
+(def entry (create-log-entry :submit-job {:id :j1
+                                          :tasks [:t1 :t2 :t3]}))
+
+(def f (partial extensions/apply-log-entry (assoc entry :message-id 0)))
+
+(def rep-diff (partial extensions/replica-diff entry))
+
+(def rep-reactions (partial extensions/reactions entry))
+
+(def old-replica {:job-scheduler :onyx.job-scheduler/round-robin
+                  :peers [:p1 :p2]})
+
+(let [new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)]
+  (fact (rep-reactions old-replica new-replica diff {:id :p1}) => nil?)
+  (fact (rep-reactions old-replica new-replica diff {:id :p2}) => nil?))
+
+(def entry (create-log-entry :submit-job {:id :j1
+                                          :tasks [:t1 :t2 :t3]}))
+
+(def f (partial extensions/apply-log-entry (assoc entry :message-id 0)))
+
+(def rep-diff (partial extensions/replica-diff entry))
+
+(def rep-reactions (partial extensions/reactions entry))
+
+(def old-replica {:job-scheduler :onyx.job-scheduler/round-robin
+                  :peers [:p1 :p2 :p3]})
+
+(let [new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)]
+  (fact (rep-reactions old-replica new-replica diff {:id :p1}) =not=> nil?)
+  (fact (rep-reactions old-replica new-replica diff {:id :p2}) =not=> nil?)
+  (fact (rep-reactions old-replica new-replica diff {:id :p3}) =not=> nil?))
+


Java is weird

Java is weird

--- src/korhal/core.clj
+++ src/korhal/core.clj
@@ -2,7 +2,7 @@
   (:import (jnibwapi.JNIBWAPI)
            (jnibwapi.BWAPIEventListener)
            (jnibwapi.model.Unit)
-           (jnibwapi.types.UnitType.UnitTypes)))
+           (jnibwapi.types.UnitType$UnitTypes)))

 (gen-class
  :name "korhal.core"
@@ -51,10 +51,10 @@
 (defn korhal-gameUpdate [this]

   ;; spawn a drone
-  (for [unit (.getMyUnits (:api @this))]
-    (when (= (.getTypeID unit) (.. jnibwapi.types.UnitType.UnitTypes Zerg_Larve getID))
+  #_(for [unit (.getMyUnits (:api @this))]
+    (when (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Larva)
       (when (and (< 50 (.. (:api @this) getSelf getMinerals)) (not (:morphed-drone this)))
-        (.morph (:api @this) (.getID unit) (.. jnibwapi.types.UnitType.UnitTypes Zerg_Drone getID))
+        (.morph (:api @this) (.getID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Drone))
         (swap-keys (.state this) :morphed-drone true)))))


Move Item Group Schema Attributes in its own Definition

--- src/lens/schema.clj
+++ src/lens/schema.clj
@@ -146,6 +146,24 @@
           (throw (ex-info "Conflict!" {:type :conflict})))
         (throw (ex-info "Form not found." {:type :not-found}))))]})

+(def item-group
+  {:attributes
+   [{:db/ident :item-group/id
+     :db/valueType :db.type/string
+     :db/unique :db.unique/identity
+     :db/cardinality :db.cardinality/one
+     :db/doc "The id of an item."}
+
+    {:db/ident :item-group/form
+     :db/valueType :db.type/ref
+     :db/cardinality :db.cardinality/one
+     :db/doc "A reference to the form of an item group."}
+
+    {:db/ident :item-group/rank
+     :db/valueType :db.type/long
+     :db/cardinality :db.cardinality/one
+     :db/doc "The rank of an item group relative to its form."}]})
+
 (def base-schema
   {:partitions
    [{:db/ident :part/meta-data}
@@ -172,24 +190,6 @@
      :db/unique :db.unique/identity
      :db/cardinality :db.cardinality/one
      :db/doc "The id of a study-event."}
-
-    ;; Item-Group
-
-    {:db/ident :item-group/id
-     :db/valueType :db.type/string
-     :db/unique :db.unique/identity
-     :db/cardinality :db.cardinality/one
-     :db/doc "The id of an item."}
-
-    {:db/ident :item-group/form
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/one
-     :db/doc "A reference to the form of an item group."}
-
-    {:db/ident :item-group/rank
-     :db/valueType :db.type/long
-     :db/cardinality :db.cardinality/one
-     :db/doc "The rank of an item group relative to its form."}

     ;; Item

@@ -471,6 +471,7 @@
       (into (map make-attr (concat (:attributes subject)
                                    (:attributes study)
                                    (:attributes form)
+                                   (:attributes item-group)
                                    (:attributes schema))))
       (into (map make-enum (:enums subject)))
       (into (map make-func (concat (:functions subject)


prevent setup-db from being executed several times while running test suite

--- src/metabase/db.clj
+++ src/metabase/db.clj
@@ -13,7 +13,7 @@

 (declare post-select)

-(def db-file
+(defonce db-file
   "Path to our H2 DB file from env var or app config."
   (delay
    (str "file:" (or (:database-file env)
@@ -23,14 +23,15 @@
 ;; Do this by appending `;AUTO_SERVER=TRUE` to the JDBC URL (see http://h2database.com/html/features.html#auto_mixed_mode)

-(defn- setup-db
+(defonce ^:private setup-db
   "Setup Korma default DB."
-  []
-  (log/info (str "Using H2 database file: " @db-file))
-  (let [db (create-db (h2 {:db @db-file
-                           :naming {:keys str/lower-case
-                                    :fields str/upper-case}}))]
-    (default-connection db)))
+  (memoize
+   (fn []
+     (log/info (str "Using H2 database file: " @db-file))
+     (let [db (create-db (h2 {:db @db-file
+                              :naming {:keys str/lower-case
+                                       :fields str/upper-case}}))]
+       (default-connection db)))))

 (defn migrate


fix doc redirects

fix doc redirects

--- frontend/routes.cljs
+++ frontend/routes.cljs
@@ -108,16 +108,15 @@
   (defroute v1-doc-subpage (FragmentRoute. "/docs/:subpage") {:as params}
     (let [subpage (keyword (:subpage params))]
       (if-let [doc (get (doc-utils/find-all-docs) subpage)]
-        (let [token (str (name subpage) (when (:_fragment params) (str "#" (:_fragment params))))]
-          (if (= token (doc-utils/maybe-rewrite-token token))
-            (open-to-outer! nav-ch :documentation (assoc params
-                                                    :subpage subpage
-                                                    :_title (:title doc)))
-            (put! nav-ch [:navigate! {:path (str "/docs/" (doc-utils/maybe-rewrite-token token))
-                                      :replace-token? true}])))
+        (open-to-outer! nav-ch :documentation (assoc params
+                                                      :subpage subpage
+                                                      :_title (:title doc)))
         (do
-          (utils/mlog "Couldn't find doc for subpage" subpage)
-          (put! nav-ch [:navigate! {:path "/docs" :replace-token? true}])))))
+          (let [token (str (name subpage) (when (:_fragment params) (str "#" (:_fragment params))))
+                path (if (= token (doc-utils/maybe-rewrite-token token))
+                       "/docs"
+                       (str "/docs/" (doc-utils/maybe-rewrite-token token)))]
+            (put! nav-ch [:navigate! {:path path :replace-token? true}]))))))

   (defroute v1-about (FragmentRoute. "/about") {:as params}
     (open-to-outer! nav-ch :about params))


nosubmit mode to test speech and command translation

--- src/bolt/core.cljs
+++ src/bolt/core.cljs
@@ -53,13 +53,19 @@
       :else (apply string/replace url "%s" args))))

 (defn handle-search-result [app {:keys [url] :as cmd}]
-  (if url
-    ;; TODO: url encode args
-    (let [redirect-url (build-url url (:args cmd))]
-      (swap! app assoc :message
-             (string/replace-first "Redirecting with %s ..." "%s" (name (:name cmd))))
-      (set! (.-location js/window) redirect-url))
-    (swap! app assoc :error (str "No command found for " (:name cmd)))))
+  (cond
+   (re-find #"nosubmit" js/window.location.search)
+   (js/alert (str "Would submit: " cmd))
+
+   (seq url)
+   ;; TODO: url encode args
+   (let [redirect-url (build-url url (:args cmd))]
+     (swap! app assoc :message
+            (string/replace-first "Redirecting with %s ..." "%s" (name (:name cmd))))
+     (set! (.-location js/window) redirect-url))
+
+   :else
+   (swap! app assoc :error (str "No command found for " (:name cmd)))))

 (defn handle-event [app event event-data]
   (.log js/console "Event: " (pr-str event event-data))


phrasing

phrasing

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -438,8 +438,7 @@
   fapply)

 (defn >>=
-  "Performs a Haskell-style left-associative
-  bind.
+  "Perform a Haskell-style left-associative bind.

   Let's see it in action:

@@ -452,8 +451,8 @@
    (reduce bind mv (cons f fs))))

 (defn >>
-  "Performs a Haskell-style left-associative bind,
-  ignoring the values produced by the monad computations."
+  "Perform a Haskell-style left-associative bind,
+  ignoring the values produced by the monadic computations."
   ([mv mv']
    (bind mv (fn [_] mv')))
   ([mv mv' & mvs]
@@ -483,7 +482,7 @@
       (return b))))

 (defn extract
-  "Generic function for unwrap/extract
+  "Generic function to unwrap/extract
   the inner value of a container."
   [v]
   (p/extract v))


Delay is more app-specific than fence.

Delay is more app-specific than fence.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -121,8 +121,8 @@
 (vis-init (map< (fn [id] {:op (.-id (.-target id))
                           :x (js/parseInt (get-el-value "x"))
                           :y (js/parseInt (get-el-value "y"))
-                          :fence (= (get-el-value "fence") "1")
-                          :delay (js/parseInt (get-el-value "delay"))})
+                          :delay (js/parseInt (get-el-value "delay"))
+                          :fence (= (get-el-value "fence") "1")})
                 (merge [(listen (gdom/getElement "add") "click")
                         (listen (gdom/getElement "sub") "click")
                         (listen (gdom/getElement "test") "click")]))


Fix indentation.

Fix indentation.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -42,10 +42,10 @@
                 waited (.getWaitedTime t-info)
                 blocked (.getBlockedTime t-info)]
             (println (str t-id "," t-name "," cpu-time "," user-time "," waited "," blocked ","
-                          (delta-cntr (str "cpu" t-id) cpu-time) ","
-                          (delta-cntr (str "user" t-id) user-time) ","
-                          (delta-cntr (str "waited" t-id) waited) ","
-                          (delta-cntr (str "blocked" t-id) blocked)))))))))
+                       (delta-cntr (str "cpu" t-id) cpu-time) ","
+                       (delta-cntr (str "user" t-id) user-time) ","
+                       (delta-cntr (str "waited" t-id) waited) ","
+                       (delta-cntr (str "blocked" t-id) blocked)))))))))

 (defn -main [& args]
   (println "Starting dsbdp main...")


cleanup

cleanup

--- src/es/systems.clj
+++ src/es/systems.clj
@@ -80,8 +80,6 @@
    [query & {:keys [from size] :or {size 100 from 0}}]
   (doc/search index "system" :from from :size size :query query :fields ["owner" "env"]))

-;; (first (:hits (:hits (query {:bool {:minimum_should_match 1, :should [#_{:term {:env "prod"}} {:term {:env ":dev"}}], :must [{:term {:machine.cpus 4}}]}} :from 0 :size 100))))
-
 (defn- query-for [username q]
   (let [{:keys [envs username] :as user} (p/get-user! username)]
     (if (su? user)


Lets actually install the gem, shall we?

--- src/fatty/core.clj
+++ src/fatty/core.clj
@@ -52,7 +52,7 @@
                             ["sudo" "make" "install"]]))

 (def chef (software :source "chef"
-            :steps [["/opt/opscode/embedded/bin/gem" "install" "chef" "-n" "/opt/opscode/bin"]]))
+            :steps [["sudo" "/opt/opscode/embedded/bin/gem" "install" "chef" "-n" "/opt/opscode/bin"]]))

 (defn- log-sh-result
   [status true-log false-log]


lein-release plugin: bumped version from 0.3.30 to 0.3.31-SNAPSHOT for next development cycle

--- re_view/project.clj
+++ re_view/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view "0.3.30"
+(defproject re-view "0.3.31-SNAPSHOT"
   :description "Tiny React wrapper"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_view"
   :license {:name "Eclipse Public License"


Fixed problem with Single observable object

--- src/beicon/core.cljc
+++ src/beicon/core.cljc
@@ -120,6 +120,12 @@
      [o]
      (instance? Flowable o)))

+#?(:clj
+   (defn single?
+     "Check if the provided value is Single instance."
+     [o]
+     (instance? Single o)))
+
 (defn scheduler?
   "Check if the provided value is Scheduler instance."
   [v]
@@ -488,9 +494,10 @@
      ([ob nf ef cf]
       (subscribe ob nf ef cf nil))
      ([ob nf ef cf sf]
-      (if (flowable? ob)
-        (subscribe-to-flowable ob nf ef cf sf)
-        (subscribe-to-observable ob nf ef cf sf)))))
+      (cond
+        (flowable? ob) (subscribe-to-flowable ob nf ef cf sf)
+        (single? ob) (subscribe-to-observable (.toObservable ob) nf ef cf sf)
+        :else (subscribe-to-observable ob nf ef cf sf)))))

 (defn on-value
   "Subscribes a function to invoke for each element


Add timeout function.

Add timeout function.

--- src/beicon/core.cljs
+++ src/beicon/core.cljs
@@ -159,6 +159,15 @@
   []
   (create (fn [sink]
             (sink nil))))
+
+(defn timeout
+  "Return an observable sequence that will return
+  one unique nil value after specified timeout."
+  ([ms]
+   (timeout ms nil))
+  ([ms val]
+   {:pre [(number? ms)]}
+   (.map (js/Rx.Observable.timer ms) (fn [_] val))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Bus


Add image command

Add image command

--- src/bolt/config.cljs
+++ src/bolt/config.cljs
@@ -20,6 +20,7 @@
     :lastfm {:alias "lfm" :url "http://www.last.fm/search?q=%s"}
     :clojuredocs {:alias "cd" :url "http://clojuredocs.org/search?q=%s"}
     :flickr {:alias "fl" :url "http://www.flickr.com/search/?q=%s"}
+    :google-image {:url "https://www.google.com/search?site=imghp&tbm=isch&q=%s"}
     :imdb {:url "http://www.imdb.com/find?q=%s&s=all"}
     :rotten {:url "http://www.rottentomatoes.com/search/?search=%s"}
     :domainr {:url "https://domai.nr/?q=%s"}
@@ -40,6 +41,7 @@
     :find {:names ["google" "wikipedia" "wikidata" "freebase"]}
     :buy {:names ["amazon" "google-shopping"]}
     :domain {:names ["domainr" "google-domain"]}
+    :image {:names ["flickr" "google-image"]}

     ;; not used on phone
     :google-group {:alias "ggs" :url "http://groups.google.com/groups/dir?q=%s"}


create fluid soft drop, and simplify input events

--- src/client/core.cljs
+++ src/client/core.cljs
@@ -27,7 +27,7 @@
     [client.repl :as repl]
     [client.socket :refer [socket connect-socket!]]
     [client.vcr :refer [vcr toggle-record! record-frame!]]
-    [cljs.core.async :refer [put! chan <! timeout]]))
+    [cljs.core.async :refer [put! chan <! timeout unique]]))

 (enable-console-print!)

@@ -43,7 +43,9 @@
                   :score 0
                   :level 0
                   :level-lines 0
-                  :total-lines 0}))
+                  :total-lines 0
+
+                  :soft-drop false}))

 ; required for pausing/resuming the gravity routine
 (def pause-grav (chan))
@@ -189,8 +191,9 @@
   (let [[x y] (:position @state)
         piece (:piece @state)
         board (:board @state)]
-    (swap! state assoc  :board (write-piece-to-board piece x y board)
-                        :piece nil)
+    (swap! state assoc :board (write-piece-to-board piece x y board)
+                       :piece nil
+                       :soft-drop false)
     (put! pause-grav 0)

     ; If collapse routine returns a channel...
@@ -202,7 +205,7 @@
         (try-spawn-piece!))
       (try-spawn-piece!))))

-(defn try-gravity!
+(defn apply-gravity!
   "Move current piece down 1 if possible, else lock the piece."
   []
   (let [piece (:piece @state)
@@ -222,24 +225,22 @@

   (go
     (loop []
-      (let [cs [(timeout (get-level-speed (:level @state)))
-                pause-grav]                 ; channels to listen to (timeout, pause)
+      (let [soft-speed 25
+            level-speed (get-level-speed (:level @state))
+            speed (if (:soft-drop @state)
+                    (min soft-speed level-speed)
+                    level-speed)
+
+            cs [(timeout speed) pause-grav] ; channels to listen to (timeout, pause)
             [_ c] (alts! cs)]               ; get the first channel to receive a value
         (if (= pause-grav c)                ; if "pause" received, wait for "resume"
           (<! resume-grav)
-          (try-gravity!))
+          (apply-gravity!))
         (recur)))))

 ;;------------------------------------------------------------
 ;; Input-driven STATE CHANGES
 ;;------------------------------------------------------------
-
-(def key-codes {:left 37
-                :up 38
-                :right 39
-                :down 40
-                :space 32
-                :shift 16})

 (defn try-move!
   "Try moving the current piece to the given offset."
@@ -275,22 +276,44 @@
 (defn add-key-events
   "Add all the key inputs."
   []
-  (.addEventListener js/window "keydown"
-     (fn [e]
-       (if (:piece @state)
-         (let [code (aget e "keyCode")]
-          (cond
-            (= code (:down key-codes))  (do (try-move!  0  1) (.preventDefault e))
-            (= code (:left key-codes))  (do (try-move! -1  0) (.preventDefault e))
-            (= code (:right key-codes)) (do (try-move!  1  0) (.preventDefault e))
-            (= code (:space key-codes)) (do (hard-drop!)      (.preventDefault e))
-            (= code (:up key-codes))    (do (try-rotate!)     (.preventDefault e))))))
-        )
-  (.addEventListener js/window "keyup"
-     (fn [e]
-       (let [code (aget e "keyCode")]
-         (cond
-           (= code (:shift key-codes)) (toggle-record!))))))
+  (let [down-chan (chan)
+        key-names {37 :left
+                   38 :up
+                   39 :right
+                   40 :down
+                   32 :space
+                   16 :shift}
+        key-name #(-> % .-keyCode key-names)]
+
+    (.addEventListener js/window "keydown"
+      (fn [e]
+        (if (:piece @state)
+          (case (key-name e)
+            :down  (do (put! down-chan true) (.preventDefault e))
+            :left  (do (try-move! -1  0)     (.preventDefault e))
+            :right (do (try-move!  1  0)     (.preventDefault e))
+            :space (do (hard-drop!)          (.preventDefault e))
+            :up    (do (try-rotate!)         (.preventDefault e))
+            nil))))
+
+    (.addEventListener js/window "keyup"
+      (fn [e]
+        (case (key-name e)
+          :down  (put! down-chan false)
+          :shift (toggle-record!)
+          nil)))
+
+    ; Listen to the down key, but ignore repeats.
+    (let [c (unique down-chan)]
+      (go
+        (while true
+          (let [on-or-off (<! c)]
+            (swap! state assoc :soft-drop on-or-off)
+
+            ; force gravity to reset
+            (put! pause-grav 0)
+            (put! resume-grav 0)))))))
+

 ;;------------------------------------------------------------
 ;; Facilities


Use *nix line-ending

Use *nix line-ending

Not sure whether this line-ending issues are due to Vim.

--- src/clj_dde/core.clj
+++ src/clj_dde/core.clj
@@ -1,101 +1,98 @@
-(ns clj-dde.core
-  [:import
-        [com.pretty_tools.dde.client DDEClientConversation]
-        [com.pretty_tools.dde.client DDEClientEventListener]
-        [com.pretty_tools.dde ClipboardFormat]
-        [com.pretty_tools.dde DDEException]
-        [com.pretty_tools.dde DDEMLException]])
-
-#_(System/getProperty "java.library.path")
-
-
-
-;; implement the DDEClientEventListener interface
-
-(defn setEventListener
-  [conv]
-(.setEventListener conv
-  (reify DDEClientEventListener
-  (onItemChanged [this topic item data]
-               (prn (str "Item Changed: " topic  " , " item  " , " data )))
-  (onDisconnect [this]
-                (prn (str "onDisconnect() called."))))))
-
-
-(defn listen
-  [conv]
-(.setEventListener conv
-  (reify DDEClientEventListener
-  (onItemChanged [this _ _ data]
-               (data))
-  (onDisconnect [this]
-                (prn (str "onDisconnect() called."))))))
-
-
-(defn listen-and-print-data
-  [conv]
-(.setEventListener conv
-  (reify DDEClientEventListener
-  (onItemChanged [this _ _ data]
-               (prn (str data)))
-  (onDisconnect [this]
-                (prn (str "onDisconnect() called."))))))
-
-
-;; instantiate a DDEClientConversation
-
-(defn conversation
-  []
-  (DDEClientConversation.))
-
-
-;; Method Definitions for a DDEClientConversation.  These are the 'direct' translations of java->clojure.
-;; TODO: define more 'idiomatic, syntactic sugar' usage methods.
-
-(defn setTimeout
-  [conv ms]
-  (.setTimeout conv ms))
-
-(defn getTimeout
-  "returns timeout length in ms"
-  [conv]
-  (.getTimeout conv))
-
-(defn connect
-  [conv app topic]
-  (.connect conv app topic))
-
-(defn disconnect
-  [conv]
-  (.disconnect conv))
-
-(defn startAdvice
-  [conv item]
-  (.startAdvice conv item))
-
-(defn stopAdvice
-  [conv item]
-  (.stopAdvice conv item))
-
-(defn poke
-  [conv topic input]
-  (.poke conv topic input))
-
-(defn request
-  [conv item]
-  (.request conv item))
-
-(defn execute
-  [conv command]
-  (.execute conv command))
-
-(defn getService
-  [conv]
-  (.getService conv))
-
-(defn getTopic
-  [conv]
-  (.getTopic conv))
-
-
-
+(ns clj-dde.core
+  [:import
+        [com.pretty_tools.dde.client DDEClientConversation]
+        [com.pretty_tools.dde.client DDEClientEventListener]
+        [com.pretty_tools.dde ClipboardFormat]
+        [com.pretty_tools.dde DDEException]
+        [com.pretty_tools.dde DDEMLException]])
+
+#_(System/getProperty "java.library.path")
+
+
+
+;; implement the DDEClientEventListener interface
+
+(defn setEventListener
+  [conv]
+(.setEventListener conv
+  (reify DDEClientEventListener
+  (onItemChanged [this topic item data]
+               (prn (str "Item Changed: " topic  " , " item  " , " data )))
+  (onDisconnect [this]
+                (prn (str "onDisconnect() called."))))))
+
+
+(defn listen
+  [conv]
+(.setEventListener conv
+  (reify DDEClientEventListener
+  (onItemChanged [this _ _ data]
+               (data))
+  (onDisconnect [this]
+                (prn (str "onDisconnect() called."))))))
+
+
+(defn listen-and-print-data
+  [conv]
+(.setEventListener conv
+  (reify DDEClientEventListener
+  (onItemChanged [this _ _ data]
+               (prn (str data)))
+  (onDisconnect [this]
+                (prn (str "onDisconnect() called."))))))
+
+
+;; instantiate a DDEClientConversation
+
+(defn conversation
+  []
+  (DDEClientConversation.))
+
+
+;; Method Definitions for a DDEClientConversation.  These are the 'direct' translations of java->clojure.
+;; TODO: define more 'idiomatic, syntactic sugar' usage methods.
+
+(defn setTimeout
+  [conv ms]
+  (.setTimeout conv ms))
+
+(defn getTimeout
+  "returns timeout length in ms"
+  [conv]
+  (.getTimeout conv))
+
+(defn connect
+  [conv app topic]
+  (.connect conv app topic))
+
+(defn disconnect
+  [conv]
+  (.disconnect conv))
+
+(defn startAdvice
+  [conv item]
+  (.startAdvice conv item))
+
+(defn stopAdvice
+  [conv item]
+  (.stopAdvice conv item))
+
+(defn poke
+  [conv topic input]
+  (.poke conv topic input))
+
+(defn request
+  [conv item]
+  (.request conv item))
+
+(defn execute
+  [conv command]
+  (.execute conv command))
+
+(defn getService
+  [conv]
+  (.getService conv))
+
+(defn getTopic
+  [conv]
+  (.getTopic conv))


add partitions fn to access partition/replica data

--- src/clj_kafka/zk.clj
+++ src/clj_kafka/zk.clj
@@ -44,3 +44,14 @@
   (with-resource [z (zk/connect (get m "zookeeper.connect"))]
     zk/close
     (zk/children z "/brokers/topics")))
+
+(defn partitions
+  "Returns a map of partitions and replica ids. e.g. {\"1\" [0], \"0\" [0]}"
+  [m topic]
+  (with-resource [z (zk/connect (get m "zookeeper.connect"))]
+    zk/close
+    (-> (zk/data z (str "/brokers/topics/" topic))
+        :data
+        String.
+        read-str
+        (get "partitions"))))


Fixed bug (issue #285)

Fixed bug (issue #285)

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -1058,7 +1058,7 @@
                             (untag-instruction-erc 10000)
                             (tagged-instruction-erc 10000)
                             'integer_tagged_instruction]
-                           (if (use-type :integer) '[integer_tag_exec_instruction] [])
+                           (if (use-type :exec) '[integer_tag_exec_instruction] [])
                            (if (use-type :code) '[integer_tag_code_instruction] [])
                            (if (use-type :integer) '[integer_tag_integer_instruction] [])
                            (if (use-type :float) '[integer_tag_float_instruction] [])


Use babashka.deps instead of creating a separate .classpath file

--- bb.clj
+++ bb.clj
@@ -1,13 +1,17 @@
 ;; Example of using clj-chrome-devtools with babashka
-;;
-;; Make a .classpath
-;; $ clj -A:bb -Spath > .classpath
 ;;
 ;; Start Chrome in the background:
 ;; /some/chrome-binary --remote-debugging-port=9222 --headless &
 ;;
 ;; Run with:
-;; $ bb --classpath $(cat .classpath) bb.clj
+;; $ bb bb.clj
+
+(require '[babashka.deps :as deps])
+(deps/add-deps
+ '{:deps {tatut/devtools {:git/url "https://github.com/tatut/clj-chrome-devtools"
+                          :git/sha "cc96255433ca406aaba8bcee17d0d0b3b16dc423"}
+          org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
+                                   :git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}})

 (require '[clj-chrome-devtools.core :as core]
          '[clj-chrome-devtools.automation :as auto])


CMR-599: refined validation logic per Jason's comment.

--- search-app/src/cmr/search/validators/validation.clj
+++ search-app/src/cmr/search/validators/validation.clj
@@ -16,12 +16,9 @@
 (defn validate-result-format
   "Validate requested search result format."
   [concept-type result-format]
-  (let [mime-type (mt/format->mime-type result-format)
-        valid-mime-types (set (map mt/format->mime-type
-                                   (concept-type->supported-result-formats concept-type)))]
-    (if-not (get valid-mime-types mime-type)
-      [(format "The mime type [%s] is not supported for %ss." mime-type (name concept-type))]
-      [])))
+  (let [mime-type (mt/format->mime-type result-format)]
+    (when-not (get (concept-type->supported-result-formats concept-type) result-format)
+      [(format "The mime type [%s] is not supported for %ss." mime-type (name concept-type))])))

 (defprotocol Validator
   "Defines the protocol for validating query conditions.
@@ -35,9 +32,7 @@
   (validate
     [{:keys [concept-type result-format condition]}]
     (let [errors (validate-result-format concept-type result-format)]
-      (if-not (empty? errors)
-        errors
-        (validate condition))))
+      (if (seq errors) errors (validate condition))))

   cmr.search.models.query.ConditionGroup
   (validate


Force jar in hadoop task.

Force jar in hadoop task.

--- leiningen/hadoop.clj
+++ leiningen/hadoop.clj
@@ -23,8 +23,7 @@
         (pallet.core/lift (forma.hadoop.cluster/master-nodeset ~node-type)
                           :phase (pallet.phase/phase-fn
                                   (pallet.crate.hadoop/hadoop-command
-                                   ;;"jar" ~dest-path
-                                   ~@args))
+                                   "jar" ~dest-path ~@args))
                           :compute forma.hadoop.environment/ec2-service
                           :environment forma.hadoop.environment/remote-env)
         (println "Your job's complete. Kill with Ctrl-C."))


(PE-3864) utilize 'x500-name->CN' function

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -150,7 +150,7 @@
   (-> csr
       (.getSubject)
       (.toString)
-      (.substring 3)))  ; strip off the leading 'CN='
+      (utils/x500-name->CN)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Serial number functions + lock


Clean

Clean

--- backend/test/akvo/lumen/test_utils.clj
+++ backend/test/akvo/lumen/test_utils.clj
@@ -1,30 +1,21 @@
 (ns akvo.lumen.test-utils
-  (:require [akvo.lumen.component.tenant-manager :refer [pool]]
-            [akvo.lumen.config :as config]
-            [akvo.lumen.lib.aes :as aes]
+  (:require [akvo.lumen.lib.aes :as aes]
             [akvo.lumen.lib.import :as import]
             [akvo.lumen.lib.import.clj-data-importer]
-            [akvo.lumen.lib.transformation.engine :refer (new-dataset-version)]
             [akvo.lumen.lib.update :as update]
             [akvo.lumen.postgres]
-            [akvo.lumen.protocols :as p]
             [akvo.lumen.specs.transformation]
-            [akvo.lumen.util :refer [squuid] :as util ]
             [cheshire.core :as json]
             [clj-time.coerce :as tcc]
             [clj-time.core :as tc]
             [clj-time.format :as timef]
-            [clojure.edn :as edn]
-            [clojure.java.io :as io]
             [clojure.java.io :as io]
             [clojure.java.jdbc :as jdbc]
-            [clojure.set :as set]
             [clojure.spec.alpha :as s]
             [clojure.spec.test.alpha :as stest]
+            [clojure.tools.logging :as log]
+            [diehard.core :as dh]
             [clojure.test :as t]
-            [clojure.tools.logging :as log]
-            [clojure.walk :refer (keywordize-keys)]
-            [diehard.core :as dh]
             [duct.core :as duct]
             [hugsql.core :as hugsql]
             [integrant.core :as ig])


Add :added metadata for new generators in 0.8.0 & 0.9.0

--- src/main/clojure/clojure/test/check/generators.cljc
+++ src/main/clojure/clojure/test/check/generators.cljc
@@ -154,6 +154,7 @@
 (defn generate
   "Returns a single sample value from the generator, using a default
   size of 30."
+  {:added "0.8.0"}
   ([generator]
      (generate generator 30))
   ([generator size]
@@ -236,6 +237,7 @@
   "Create a new generator that modifies the size parameter by the given function. Intended to
    support generators with sizes that need to grow at different rates compared to the normal
    linear scaling."
+  {:added "0.8.0"}
   ([f generator]
     (sized (fn [n] (resize (f n) generator)))))

@@ -666,6 +668,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([gen] (vector-distinct gen {}))
   ([gen opts]
    (assert (generator? gen) "First arg to vector-distinct must be a generator!")
@@ -686,6 +689,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([gen] (list-distinct gen {}))
   ([gen opts]
    (assert (generator? gen) "First arg to list-distinct must be a generator!")
@@ -706,6 +710,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([key-fn gen] (vector-distinct-by key-fn gen {}))
   ([key-fn gen opts]
    (assert (generator? gen) "First arg to vector-distinct-by must be a generator!")
@@ -726,6 +731,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([key-fn gen] (list-distinct-by key-fn gen {}))
   ([key-fn gen opts]
    (assert (generator? gen) "First arg to list-distinct-by must be a generator!")
@@ -745,6 +751,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([gen] (set gen {}))
   ([gen opts]
    (assert (generator? gen) "First arg to set must be a generator!")
@@ -764,6 +771,7 @@
     :max-tries     the number of times the generator will be tried before
                    failing when it does not produce distinct elements
                    (default 10)"
+  {:added "0.9.0"}
   ([gen] (sorted-set gen {}))
   ([gen opts]
    (assert (generator? gen) "First arg to sorted-set must be a generator!")
@@ -849,6 +857,7 @@
     :max  the maximum integer (inclusive)

   Both :min and :max are optional."
+  {:added "0.9.0"}
   [{:keys [min max]}]
   (core/let [min (or min MIN_INTEGER)
         max (or max MAX_INTEGER)]
@@ -860,7 +869,7 @@
                    (fmap #(+ max %) (large-integer** (- min max) 0))
                    (fmap #(+ min %) (large-integer** 0 (- max min))))))))

-(def large-integer
+(def ^{:added "0.9.0"} large-integer
   "Generates a platform-native integer from the full available range
   (in clj, 64-bit Longs, and in cljs, numbers between -(2^53 - 1) and
   (2^53 - 1)).
@@ -1063,6 +1072,7 @@

   Note that the min/max options must be finite numbers. Supplying a
   min precludes -Infinity, and supplying a max precludes +Infinity."
+  {:added "0.9.0"}
   [{:keys [infinite? NaN? min max]
     :or {infinite? true, NaN? true}}]
   (core/let [frequency-arg (cond-> [[95 (double-finite min max)]]
@@ -1094,7 +1104,7 @@
       (-> frequency-arg first second)
       (frequency frequency-arg))))

-(def double
+(def ^{:added "0.9.0"} double
   "Generates 64-bit floating point numbers from the entire range,
   including +/- infinity and NaN. Use double* for more control."
   (double* {}))
@@ -1250,7 +1260,7 @@
     (tuple int
            (such-that (complement zero?) int))))

-(def uuid
+(def ^{:added "0.9.0"} uuid
   "Generates a random type-4 UUID. Does not shrink."
   (no-shrink
    #?(:clj
@@ -1376,6 +1386,7 @@
       (->> users
            (map #(assoc %2 :id %1) (range))
            (gen/shuffle)))"
+  {:added "0.9.0"}
   [bindings & body]
   (assert (vector? bindings)
           "First arg to gen/let must be a vector of bindings.")


bump re-pressed version;

bump re-pressed version;

Version 0.2.0 of re-pressed has a significant bug that is fixed in 0.2.1.

--- resources/leiningen/new/closp/project.clj
+++ resources/leiningen/new/closp/project.clj
@@ -21,7 +21,7 @@
                  [reagent "0.7.0"]
                  [re-frame "0.10.5"]
                  [day8.re-frame/tracing-stubs "0.5.1"] ;stubs so you dont have to switch out macro calls between dev and prod code
-                 [re-pressed "0.2.0"]
+                 [re-pressed "0.2.1"]
                  [com.degel/re-frame-storage-fx "0.1.0"]

                  [bidi "2.1.3"]


removes println from test

removes println from test

--- waiter/test/waiter/token_test.clj
+++ waiter/test/waiter/token_test.clj
@@ -1483,7 +1483,6 @@
                  :headers {"accept" "application/json"}
                  :request-method :post})
               {{:strs [details message]} "waiter-error"} (json/read-str body)]
-          (println body)
           (is (= 400 status))
           (is (not (str/includes? body "clojure")))
           (is (str/includes? (str details) "fallback-period-secs") body)


CMR-662: Cleaned up test in response to pull request comments.

--- test/cmr/system_int_test/search/aql_search_test.clj
+++ test/cmr/system_int_test/search/aql_search_test.clj
@@ -100,35 +100,29 @@
          "S%R_" [coll1 coll2 coll3 coll4 coll5 coll6])))

 (deftest aql-search-with-query-parameters
-  (let [make-coll (fn [n entry-title]
-                    (d/ingest "PROV1" (dc/collection {:short-name entry-title
-                                                      :entry-title (str "coll" n)})))
-        coll1 (make-coll 1 "SHORT")
-        coll2 (make-coll 2 "SHORT")
-        coll3 (make-coll 3 "SHORT")
-        coll4 (make-coll 4 "SHORT")]
+  (let [make-coll (fn [n]
+                    (d/ingest "PROV1" (dc/collection {:entry-title (str n)})))
+        coll1 (make-coll 1)
+        coll2 (make-coll 2)
+        coll3 (make-coll 3)
+        coll4 (make-coll 4)]
     (index/refresh-elastic-index)
     ;; invalid query parameter
     (is (= {:errors ["Parameter [foo] was not recognized."]
             :status 422}
-           (search/find-refs-with-aql :collection
-                                      [{:shortName "SHORT"}]
-                                      {}
-                                      {:query-params {:foo true}})))
-    (are [search-str params items]
-         (let [refs (search/find-refs-with-aql :collection [{:shortName search-str}]
+           (search/find-refs-with-aql :collection [] {} {:query-params {:foo true}})))
+    (are [params items]
+         (let [refs (search/find-refs-with-aql :collection []
                                                {} {:query-params params})
                result (d/refs-match? items refs)]
            (when-not result
              (println "Expected:" (pr-str (map :entry-title items)))
              (println "Actual:" (pr-str (map :name (:refs refs)))))
            result)
-         ;; Exact matches
-         "SHORT" {:page-size 1} [coll1]
-         "SHORT" {:page-size 1 :page-num 3} [coll3]
-         ; TODO - enable this test when sort-key is supported
-         ;"SHORT" {:sort-key :entry-title} [coll1 coll2 coll3 coll4]
-         "SHORT" {} [coll1 coll2 coll3 coll4])))
+
+         {:page-size 1} [coll1]
+         {:page-size 1 :page-num 3} [coll3]
+         {} [coll1 coll2 coll3 coll4])))

 (deftest aql-search-with-multiple-conditions


Tidy up async code in resolver.

Tidy up async code in resolver.

--- src/chronograph/import/resolver.clj
+++ src/chronograph/import/resolver.clj
@@ -17,16 +17,18 @@
   (:require [clojure.core.async :as async :refer [<! <!! >!! >! go chan close! merge]]))

 (def doi-channel (chan))
-(def dois-resolved-channel (chan))

 (def issued-type-id (data/get-type-id-by-name "issued"))
 (def resolved-type-id (data/get-type-id-by-name "first-resolution-test"))
 (def source-id (data/get-source-id-by-name "CrossRefRobot"))

+(defn prnl [& args] (locking *out* (apply prn args)))
+
 (defn get-resolutions
   "Get the first and last redirects or nil if it doesn't exist."
   [doi]
   (try
+    (locking *out* (prn "Start resolve" doi))
     (let [url (crdoi/normalise-doi doi)
           result (try-try-again {:sleep 5000 :tries 2} #(client/get url
                                                          {:follow-redirects true
@@ -36,6 +38,7 @@
           first-redirect (second redirects)
           last-redirect (last redirects)
           ok (= 200 (:status result))]
+          (locking *out* (prn "Finish resolve" doi ok))
           (when ok
             [first-redirect last-redirect]))
     (catch Exception _ nil)))
@@ -57,21 +60,21 @@
   (go
      (loop [doi (<! doi-channel)]
        (when doi
-         (locking *out* (prn "Get resolutions for" doi))
-         (let [result (get-resolutions doi)]
-           (if result
-             (let [[first-redirect last-redirect] result]
-                 (locking *out* (prn "Return to channel" ch doi))
-                 (>!! ch [doi first-redirect last-redirect]))
-             (do
-               (locking *out* (prn "Close ch" ch))
-               (close! ch))))
-         (recur (<!! doi-channel))))))
+             (let [result (get-resolutions doi)]
+               (when result
+                 (let [[first-redirect last-redirect] result]
+                     (>! ch [doi first-redirect last-redirect]))))
+             (recur (<! doi-channel))))
+
+     ; When loop is over, close output channel.
+     (prnl "Close channel" ch)
+     (close! ch)))

 (defn run-doi-resolution []
   ; Insert recently published.
   (let [yesterday (t/minus (t/now) (t/weeks 1))
         recently-published (k/select d/events-isam (k/where {:type issued-type-id :event [>= (coerce/to-sql-date yesterday)]}))]
+
     (doseq [event recently-published]
       (prn "Add to resolutions table" (:doi event))
       (k/exec-raw ["INSERT INTO resolutions (doi) VALUES (?) ON DUPLICATE KEY UPDATE doi = doi"
@@ -82,21 +85,17 @@
           resolve-channel (merge doi-resolve-channels)]

       ; Stick the DOIs on a channel for them to be resolved asynchronously and returned via doi-resolve-channels.
-      ; Bit of a hack - put a non-resolvable DOI on the channel to start the worker off.
-      ; Otherwise they never get started and never close their doi-resolve-channels.
-      (doseq [_ (range num-return-chans)]
-        (>!! doi-channel "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
-
       (go
         (doseq [doi dois]
-          (>!! doi-channel doi))
+          (locking *out* (prn "Spool" doi))
+          (>! doi-channel doi))
         (prn "Closing DOI channel")
         (close! doi-channel))
-
+
       ; Get resolutions from the merged doi-resolve-channel and insert them.
       ; TODO maybe batch into transactions?
       (loop [resolution (<!! resolve-channel)]
         (when resolution
           (let [[doi first-redirect last-redirect] resolution]
             (insert-resolutions doi first-redirect last-redirect))
-          (recur (<!! dois-resolved-channel)))))))+          (recur (<!! resolve-channel)))))))


Implementation of HTTP POST command.

Implementation of HTTP POST command.

--- src/clj_jenkins_api/jenkins_api.clj
+++ src/clj_jenkins_api/jenkins_api.clj
@@ -15,16 +15,6 @@

 (require '[clj-http.client   :as http-client])

-(defn get-command
-    "The reimplementation of HTTP GET command that can use JVM keystore for
-     establishing secure connections."
-    [url]
-    (:body (http-client/get url {
-                    :keystore "keystore"
-                    :keystore-pass "changeit"
-                    :trust-store "keystore"
-                    :trust-store-pass "changeit"})))
-
 (defn job-name->url
     "Transform job name (that can contain spaces) to the URL part."
     [jenkins-url job-name]
@@ -39,4 +29,26 @@
               (.startsWith job-config-url "http://")  (str "http://"  jenkins-basic-auth "@" (subs job-config-url 7))
               :else job-config-url)))

+(defn get-command
+    "The reimplementation of HTTP GET command that can use JVM keystore for
+     establishing secure connections."
+    [url]
+    (:body (http-client/get url {
+                    :keystore "keystore"
+                    :keystore-pass "changeit"
+                    :trust-store "keystore"
+                    :trust-store-pass "changeit"})))

+(defn post-command
+    "The reimplementation of HTTP POST command that can use JVM keystore for
+     establishing secure connections and use basic auth if provided."
+    [jenkins-url jenkins-basic-auth job-name command]
+    (let [url (str (job-name->url (update-jenkins-url jenkins-url jenkins-basic-auth) job-name) "/" command)]
+        ;(println "URL to use: " url)
+        (http-client/post url {
+                    :keystore "keystore"
+                    :keystore-pass "changeit"
+                    :trust-store "keystore"
+                    :trust-store-pass "changeit"})))
+
+


Use relative path for onyxplatform.org use

--- src/cljs/onyx_cheat_sheet/core.cljs
+++ src/cljs/onyx_cheat_sheet/core.cljs
@@ -155,7 +155,7 @@
    {}
    [(dom/h4 #js {:className "key-set"} "Keys")
     (for [k (model-display-order section)]
-      [(dom/code #js {:className "code-example"} (dom/a #js {:href (str "/#" (name section) "/" (keyword-sanitize-? k))} (str k)))
+      [(dom/code #js {:className "code-example"} (dom/a #js {:href (str "#" (name section) "/" (keyword-sanitize-? k))} (str k)))
        (dom/p {})])]))

 (defn pretty-edn [input]


Fix login private register link

Fix login private register link

--- src/cljs/salava/core/ui/helper.cljs
+++ src/cljs/salava/core/ui/helper.cljs
@@ -58,6 +58,6 @@
       (reduce str-space a-seq))))

 (defn private? []
-  (if (session/get :user)
-    (session/get-in [:user :private] false)
-    (session/get :private false)))
+  (if (session/get :private)
+    (session/get :private false)
+    (session/get-in [:user :private] false)))


Comment out genome_two_point_crossover

Comment out genome_two_point_crossover

--- src/clojush/instructions/genome.clj
+++ src/clojush/instructions/genome.clj
@@ -647,7 +647,7 @@
                         :genome)))
       state)))

-(define-registered
+#_(define-registered
   genome_two_point_crossover
   ^{:stack-types [:genome]}
   (fn [state]


Separated api and site routes.

Separated api and site routes.

Also provided over-arching web namespace that unites the two.

--- search-app/src/cmr/search/site/routes.clj
+++ search-app/src/cmr/search/site/routes.clj
@@ -11,23 +11,10 @@
    [cmr.common.api.context :as context]
    [cmr.common-app.api-docs :as api-docs]))

-(defn get-landing-pages
-  ""
-  [request]
-  {:status 200
-   :body "TBD"})
-
 (defn build-routes [system]
   (let [relative-root-url (get-in system [:public-conf :relative-root-url])]
     (routes
       (context relative-root-url []
-        ;; Landing pages - Note that the landing pages must come before the
-        ;; api-docs, since api-docs/docs-routes also use a context of "site"
-        ;; but have the last entry as a 404 renderer, and as such, would
-        ;; prevent any pages in the "site" context from rendering after that
-        ;; point.
-        (GET "/site/collections/landing-pages" req
-          (get-landing-pages req))
         ;; Add routes for API documentation
         (api-docs/docs-routes
           (get-in system [:public-conf :protocol])


Disable read-eval

Disable read-eval

--- desktop/src/nightweb_desktop/utils.clj
+++ desktop/src/nightweb_desktop/utils.clj
@@ -79,9 +79,10 @@
 (defn get-version
   "Returns version number from project.clj."
   []
-  (let [project-clj (-> (java.io/resource "project.clj")
-                        slurp
-                        read-string)]
+  (let [project-clj (->> (java.io/resource "project.clj")
+                         slurp
+                         read-string
+                         (binding [*read-eval* false]))]
     (if (= (name (nth project-clj 1)) "nightweb-desktop")
       (nth project-clj 2)
       "beta")))


let uniforms be immutable

let uniforms be immutable

--- src/gamma_driver/drivers/basic.cljs
+++ src/gamma_driver/drivers/basic.cljs
@@ -28,9 +28,12 @@

 (defn default-input-fn [driver program binder-fn variable old-spec new-spec]
   (let [t (:tag new-spec)]
-    (if (and old-spec new-spec (not= :uniform new-spec) (= (old-spec t) (new-spec t)))
-      new-spec
-      (binder-fn (gd/gl driver) program variable new-spec))))
+    (if (and old-spec new-spec (not= :uniform t) (= (old-spec t) (new-spec t)))
+      old-spec
+      (if
+        (and (= :uniform t) (:immutable? old-spec))
+        old-spec
+        (binder-fn (gd/gl driver) program variable new-spec)))))


Trim un-needed instrument and ugens.

Trim un-needed instrument and ugens.

--- src/kolmogorov_music/instrument.clj
+++ src/kolmogorov_music/instrument.clj
@@ -1,6 +1,5 @@
 (ns kolmogorov-music.instrument
-  (:require [overtone.live :refer :all]
-            [overtone.samples.piano :refer [index-buffer]]))
+  (:require [overtone.live :refer :all]))

 (definst overchauffeur [freq 110 dur 1.0 vol 1.0]
   (-> (sin-osc freq)
@@ -8,24 +7,8 @@
       (+ (* 1/3 (sin-osc (* 2.01 freq))))
       (+ (* 1/8 (sin-osc (* 5.01 freq))))
       (+ (* 2 (sin-osc (* 0.5 freq))))
-      (clip2 0.4)
-      ;(rlpf (line:kr 2000 (* 2/3 freq) dur) 1/2)
-      (+ (* 1 (sin-osc freq) (env-gen (perc))))
+      (clip2 0.8)
       (hpf 100)
       (lpf 1000)
       (* (env-gen (adsr 0.01 0.3 0.9 0.2) (line:kr 1 0 dur) :action FREE))
       (* vol)))
-
-(definst piano
-  [note 60 duration 10 level 1 rate 1 loop? 0 attack 0 decay 1 sustain 1 release 0.1 curve -4]
-  (let  [buf (index:kr (:id index-buffer) note)
-         cutoff (line:kr 1 0 duration)
-         env (env-gen (adsr attack decay sustain release level curve) cutoff :action FREE)]
-    (* env (scaled-play-buf 2 buf :rate rate :level level :loop loop? :action FREE))))
-
-(comment
-(fx-reverb)
-(fx-distortion)
-(fx-chorus)
-(fx-bitcrusher)
-)


Better table sorting.

Better table sorting.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -511,35 +511,64 @@
     [:span {:class "label label-success"} status]
     [:span {:class "label label-danger"} status]))

-(defn sorting-th [owner label sort-key sorted-by]
-  [:th {:onClick (fn [_ _] (om/set-state! owner :sort-by sort-key))}
-   (str label " ") (if (= sort-key sorted-by) [:i.fa.fa-sort-asc] " ")])
+(defn sorting-th [owner label header-key]
+  (let [{:keys [sort-key sort-asc]} (:sort-spec (om/get-state owner))]
+    [:th {:onClick (fn [_ _]
+                     (let [th-chan (:th-chan (om/get-state owner))]
+                       (log "Owner: " owner " th-chan " th-chan " header-key " header-key)
+                       (log "Clicked on: " header-key)
+                       (put! th-chan header-key (fn [closed] (if closed "I'm Closed!" "I work.")))))}
+     (str label " ")
+     (if (= sort-key header-key)
+       (if sort-asc
+         [:i.fa.fa-sort-asc]
+         [:i.fa.fa-sort-desc]))]))

 (defn sensors-table [data owner {:keys [histkey path]}]
   (reify
     om/IInitState
     (init-state [_]
-      {:sort-by :type})
+      {:th-chan (chan)
+       :sort-spec {:sort-key :type
+                   :sort-asc true}})
+    om/IWillMount
+    (will-mount [_]
+      (go-loop []
+        (let [{:keys [th-chan sort-spec]} (om/get-state owner)
+              {:keys [sort-key sort-asc]} sort-spec
+              th-click (<! th-chan)]
+          (log "Header clicked: " th-click)
+          (if (= th-click sort-key)
+            (om/set-state! owner {:th-chan th-chan
+                                  :sort-spec {:sort-key th-click
+                                              :sort-asc (not sort-asc)}})
+            (om/set-state! owner {:th-chan th-chan
+                                  :sort-spec {:sort-key th-click
+                                              :sort-asc true}})))
+        (recur)))
     om/IRenderState
     (render-state [_ state]
-      (let [sorted-by            (:sort-by state)
-            sensors              (:sensors data)
-            selected-property-id (-> data :active-components :properties)
-            flattened-sensors    (get-sensors selected-property-id data)
-            chart                (:chart data)
-            history              (om/get-shared owner :history)
-            table-id             "sensors-table"]
+      (let [{:keys [sort-key sort-asc]} (:sort-spec state)
+            sensors                     (:sensors data)
+            selected-property-id        (-> data :active-components :properties)
+            flattened-sensors           (get-sensors selected-property-id data)
+            chart                       (:chart data)
+            history                     (om/get-shared owner :history)
+            table-id                    "sensors-table"]
         (html
          [:table {:className "table table-hover"}
           [:thead
            [:tr
-            (sorting-th owner "Type" :type sorted-by)
-            (sorting-th owner "Unit" :unit sorted-by)
-            (sorting-th owner "Period" :period sorted-by)
-            (sorting-th owner "Device" :device_id sorted-by)
-            (sorting-th owner "Status" :status sorted-by)]]
+            (sorting-th owner "Type" :type)
+            (sorting-th owner "Unit" :unit)
+            (sorting-th owner "Period" :period)
+            (sorting-th owner "Device" :device_id)
+            (sorting-th owner "Status" :status)]]
           [:tbody
-           (for [row (sort-by sorted-by flattened-sensors)]
+           ;; TODO: reverse sorting based on :sort-asc
+           (for [row (if sort-asc
+                       (sort-by sort-key flattened-sensors)
+                       (reverse (sort-by sort-key flattened-sensors)))]
              (let [{:keys [device_id type unit period status]} row
                    id (str type "-" device_id)]
                [:tr {:onClick (fn [_ _]


Release peers that arent sealing.

Release peers that arent sealing.

--- src/onyx/log/commands/seal_task.clj
+++ src/onyx/log/commands/seal_task.clj
@@ -6,15 +6,16 @@
             [onyx.extensions :as extensions]))

 (defn should-seal? [replica args]
-  (let [n-peers (count (get-in replica [:allocations (:job args) (:task args)]))
-        status (common/task-status replica (:job args) (:task args))]
+  (let [status (common/task-status replica (:job args) (:task args))]
     (boolean
      (and (= (get status :active 0) 1)
           (= (get-in replica [:peer-state (:id args)]) :active)))))

 (defmethod extensions/apply-log-entry :seal-task
   [{:keys [args]} replica]
-  replica)
+  (if-not (should-seal? replica args)
+    (assoc-in replica [:peer-state (:id args)] :idle)
+    replica))

 (defmethod extensions/replica-diff :seal-task
   [{:keys [args]} old new]


Compile will fail without these

Compile will fail without these

--- src/overtone/app/editor/actions.clj
+++ src/overtone/app/editor/actions.clj
@@ -11,7 +11,7 @@

 (defn file-open [path]
-  (let [f (File. path)
+  (let [f (java.io.File. path)
         dir (.getParent (java.io.File. path))]
   (.setText (:editor @editor*) (slurp path))
   (dosync (alter editor* assoc
@@ -21,8 +21,10 @@
 (defn file-save []
   (spit (:current-path @editor*) (.getText (:editor @editor*))))

+(defn verify-msg [arg] arg)
+
 (defn file-save-as [path]
-  (let [f (File. path)
+  (let [f (java.io.File. path)
         dir (.getParent (java.io.File. "/home/rosejn/studio/samples/kit/boom.wav"))]
     (if (or (not (.exists f))
             (and (.exists f) (verify-msg (.getCanonicalPath f))))


I have reassembled FPINS variant of tree and tree mapping function from there as well.


Validate length of password on client side

--- src/braid/client/gateway/validations.cljs
+++ src/braid/client/gateway/validations.cljs
@@ -18,9 +18,13 @@
         (cb nil)))]

    :user-auth/password
-   [(fn [email cb]
-      (if (string/blank? email)
+   [(fn [password cb]
+      (if (string/blank? password)
         (cb "You need to enter a password.")
+        (cb nil)))
+    (fn [password cb]
+      (if (< (count password) 8)
+        (cb "Your password is too short.")
         (cb nil)))]

    :action.create-group/group-name