update recent compiler options

update recent compiler options

--- src/cljs_api_gen/options.clj
+++ src/cljs_api_gen/options.clj
@@ -11,29 +11,43 @@
 ;; After clojure.spec is finalized, david will accept a PR for adding a spec
 ;; for compiler options.

-;; found version added with git. for example:
+;; found relevant commits mentioning the option in git. for example:
+;; (use -G to use regex)
 ;; $ git log -S :emit-constants --source --all

+;; found first release tag containing the commit with:
+;; $ git tag --contains=<hash> --sort=committerdate
+
 (def compiler-options
-  {:anon-fn-naming-policy {:added "0.0-2411"}
+  {:aot-cache {:added "1.10.126"} ; 1969c36161b1000a36f28e5acb73d55916775d26
+   :anon-fn-naming-policy {:added "0.0-2411"}
    :asset-path {:added "0.0-2727"}
    :browser-repl {:added "1.9.183"}
    :cache-analysis {:added "0.0-2511"}
    :cache-analysis-format {:added "1.9.456"}
+   :checked-arrays {:added "1.9.854"} ; 84a2128dab9f52e67ee227a66be4f849d83de0a3
    :closure-defines {:added "0.0-2120"}
    :closure-extra-annotations {:added "0.0-2814"}
    :closure-generate-exports {:added "1.9.473"}
+   :closure-output-charset {:added "1.8.34"} ; 404d6444cb6419658a7dacb343a5fed5b9451e0c
    :closure-module-roots {:added "1.9.456"}
+   :closure-property-map-in {:added "1.10.63"} ; 072677dc0678c3f06acc612d438275d845881f9b
+   :closure-property-map-out {:added "1.10.63"} ; b48023595f90b8567d64e1d1e8162ad12e7d0d18
+   :closure-variable-map-in {:added "1.10.63"} ; 072677dc0678c3f06acc612d438275d845881f9b
+   :closure-variable-map-out {:added "1.10.63"} ; 072677dc0678c3f06acc612d438275d845881f9b
    :closure-warnings {:added "0.0-2120"}
    :compiler-stats {:added "0.0-2629"}
    :dump-core {:added "1.7.10"}
    :elide-asserts {:added "0.0-2156"}
+   :elide-strict {:added "1.10.312"} ; 03455b4ba4338ab05ffccefc9ddb41c8fd128cfa
    ; :emit-constants {:added "0.0-2014"} ; (see ignored below)
    :externs {:added "0.0-971"}
    :fn-invoke-direct {:added "1.9.660"}
    :foreign-libs {:added "0.0-971"}
    :hashbang {:added "0.0-2197"}
+   :ignore-js-module-exts {:added "1.10.63"} ; f7d611d87f6ea8a605eae7c0339f30b79a840b49
    :infer-externs {:added "1.9.456"}
+   :install-deps {:added "1.9.854"} ; fb8ce05143dac9e9feb602be2544b72c87b337a3
    :language-in {:added "0.0-2197"}
    :language-out {:added "0.0-2197"}
    :libs {:added "0.0-971"}
@@ -42,22 +56,28 @@
    :npm-deps {:added "r1.9.518"}
    :optimizations {:added "0.0-971"}
    :optimize-constants {:added "0.0-1877"}
+   :opts-cache {:added "1.10.126"} ; 542d3fad1ff499a5e3b00e7e08eff4037083a59d
    :output-dir {:added "0.0-971"}
    :output-to {:added "0.0-971"}
    :output-wrapper {:added "0.0-1513"}
+   :package-json-resolution {:added "1.10.191"} ; 233b42338c182e72391466eba2d00bae34271e58
    :parallel-build {:added "1.7.189"}
    :preamble {:added "0.0-2127"}
    :preloads {:added "1.9.85"}
    :pretty-print {:added "0.0-971"}
    :print-input-delimiter {:added "0.0-971"}
+   :process-shim {:added "1.9.854"} ; 537f60c975a29983c62647b4ea67b0bc08979366
    :pseudo-names {:added "0.0-2227"}
    :recompile-dependents {:added "0.0-2814"}
+   :rename-prefix {:added "1.9.946"} ; 7a8803ef70cb84c686341353e7ab29928487e388
+   :rename-prefix-namespace {:added "1.9.946"} ; 7a8803ef70cb84c686341353e7ab29928487e388
    :rewrite-polyfills {:added "1.9.562"}
    :source-map {:added "0.0-1798"}
    :source-map-asset-path {:added "1.9.90"}
    ; :source-map-inline {:added "0.0-2911"} ; (see ignored below)
    :source-map-path {:added "0.0-2060"}
    :source-map-timestamp {:added "0.0-2505"}
+   :stable-names {:added "1.10.63"} ; 072677dc0678c3f06acc612d438275d845881f9b
    :static-fns {:added "0.0-1424"}
    :target {:added "0.0-971"}
    ; :ups-externs {:added "0.0-993"}      ; (see ignored below)
@@ -89,7 +109,7 @@
    :repl-requires {:added "0.0-3115"}
    :repl-verbose {:added "0.0-2719"}
    :source-map-inline {:added "0.0-2911"}
-   :watch {:added "0.0-2850"}
+   :watch {:added "0.0-2850"} ; 606ccce775706b9f9f6f40ecdcc40d6947226824
    :wrap {:added "0.0-2985"}})

 ;; Sub-options can complicate things. To keep it simple, we just assign a
@@ -160,7 +180,8 @@
      :ups-foreign-libs  ; this is implicitly computed from upstream deps (user input ignored)
      :ups-libs          ; this is implicitly computed from upstream deps (user input ignored)
      :source-map-inline ; only applies to repl
-     :emit-constants}    ; this is implicitly computed from optimize-constants (user input ignored)
+     :emit-constants    ; this is implicitly computed from optimize-constants (user input ignored)
+     :watch}             ; only available via repl option (also as --watch from cli)
    :repl
    #{:watch-fn}}) ; already in compiler options


always setup s3 repository

always setup s3 repository

--- src/wb_es/web/setup.clj
+++ src/wb_es/web/setup.clj
@@ -50,22 +50,19 @@
   "run setup"
   ([] (run release-id restore-from-snapshot))
   ([release-id snapshot]
-     (let [index-id release-id]
+     (let [index-id release-id
+           repository-name "s3_repository"]
        (do
          (es-connect)
+         (connect-snapshot-repository repository-name)
          (if (has-index index-id)
            (println (format "Elasticsearch index %s is found locally. No attempt will be made to restore snapshots." index-id))
            (if snapshot
-             (let [repository-name "s3_repository"]
-               (do
-                 (connect-snapshot-repository repository-name)
-
-                 (let [snapshot-id (if (= "latest" snapshot)
-                                     (get-lateset-snapshot-id repository-name release-id)
-                                     snapshot)]
-                   (restore-snapshot index-id repository-name snapshot-id)
-                   (println (format "Elasticsearch is restored from snapshot %s" snapshot-id)))))))
-         ))))
+             (let [snapshot-id (if (= "latest" snapshot)
+                                 (get-lateset-snapshot-id repository-name release-id)
+                                 snapshot)]
+               (restore-snapshot index-id repository-name snapshot-id)
+               (println (format "Elasticsearch is restored from snapshot %s" snapshot-id)))))))))

 (defn -main
   "I don't do a whole lot ... yet."


Get rid of unused functions

Get rid of unused functions

--- src/braid/core/server/db/common.clj
+++ src/braid/core/server/db/common.clj
@@ -172,16 +172,3 @@
                   (:group/user e))
      :users-count (count (:group/user e))}))

-(def upload-pull-pattern
-  [:upload/id
-   :upload/url
-   :upload/uploaded-at
-   {:upload/thread [:thread/id]}
-   {:upload/uploaded-by [:user/id]}])
-
-(defn db->upload [e]
-  {:id (:upload/id e)
-   :uploaded-at (:upload/uploaded-at e)
-   :thread-id (get-in e [:upload/thread :thread/id])
-   :uploader-id (get-in e [:upload/uploaded-by :user/id])
-   :url (:upload/url e)})


Narrowed down 'today' to yesterday until tomrrow for resolver. Previously was polling articles published in 2020.

--- src/chronograph/import/resolver.clj
+++ src/chronograph/import/resolver.clj
@@ -59,7 +59,10 @@
 (defn run-doi-resolution []
   ; Insert recently published.
   (let [yesterday (t/minus (t/now) (t/days 1))
-        recently-published (k/select d/events-isam (k/where {:type issued-type-id :event [>= (coerce/to-sql-date yesterday)]}))]
+        today (t/plus (t/now) (t/days 1))
+        recently-published (k/select d/events-isam (k/where {:type issued-type-id
+                                                             :event [>= (coerce/to-sql-date yesterday)]
+                                                             :event [<= (coerce/to-sql-date today)]}))]

     (doseq [event recently-published]
       (prn "Add to resolutions table" (:doi event))


refactor interval

refactor interval

--- src/zombie_run/quil.clj
+++ src/zombie_run/quil.clj
@@ -52,19 +52,23 @@
          (q/with-fill [204 102 0])
          (q/with-stroke [255 0 0]))))

-(defn tick-game-fn [game]
-  (fn []
-    (Thread/sleep 100)
-    (swap! game z/run-zombie-actions)
-    (recur)))
+(defn start-interval [fn interval]
+  (doto (Thread. #(try
+                    (while (not (.isInterrupted (Thread/currentThread)))
+                      (Thread/sleep interval)
+                      (fn))
+                    (catch InterruptedException _)))
+    (.setDaemon true)
+    (.start)))
+
+(defn stop-interval [ticker]
+  (.interrupt ticker))

 (defn run-zombieland []
   (let [[world-x world-y] [300 150]
         default-game (z/make-game {:world-size [world-x world-y]})
         game (atom default-game)
-        ticker (doto (Thread. (tick-game-fn game))
-                 (.setDaemon true)
-                 (.start))]
+        ticker (start-interval #(swap! game z/run-zombie-actions) 100)]
     (q/defsketch zombie-run
                  :size [(width* world-x) (width* world-y)]
                  :title "zombie run"
@@ -84,7 +88,7 @@
                                   (when-let [action (get valid-keys (q/key-as-keyword))]
                                     (swap! game (fn [game]
                                                   (z/run-player-action game action))))))
-                 :on-close (fn [] (.interrupt ticker)))))
+                 :on-close #(stop-interval ticker))))

 (comment
   (run-zombieland))


prettier plot defaults

prettier plot defaults

--- src/cljc/gyptis/vega_templates.cljc
+++ src/cljc/gyptis/vega_templates.cljc
@@ -1,9 +1,7 @@
 (ns gyptis.vega-templates
-  "Helper functions that return vega.js plot declarations"
+  "Helper functions that produce and manipulate vega.js plot declarations."
   (:require [gyptis.util :refer [merge-spec] :as u]))

-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
 (def ^:dynamic *table* "table")
 (def ^:dynamic *x* :x)
 (def ^:dynamic *y* :y)
@@ -12,8 +10,18 @@
 (def ^:dynamic *size* :size)
 (def ^:dynamic *facet-x* :facet_x)
 (def ^:dynamic *facet-y* :facet_y)
-
 (def ^:dynamic *geopath* :geopath)
+
+(def ^:dynamic top-level
+  {:width 600
+   :height 600
+   :padding {:top 50, :left 100, :bottom 100, :right 50}
+   :data []
+   :scales []
+   :axes []
+   :marks []
+   :legends []
+   :signals []})

 (defn- first-non-nil
   [data field]
@@ -23,7 +31,7 @@
        first))

 (defn guess-scale-type
-  "Returns \"linear\" or \"ordinal\" or \"time\" or \"geojson\" or nil"
+  "Returns \"linear\" or \"ordinal\" or \"time\" or \"geojson\" or nil."
   [data field]
   (if-let [meta-type (-> data meta (get field))]
     ;; first check the metadata on data for scale-type info
@@ -116,7 +124,7 @@
     [unlabelled-facet-mark x-labelled-facet-mark y-labelled-facet-mark xy-labelled-facet-mark]))

 (defn facet
-  "Returns a vega spec with a facetted layout based on the *facet-x*
+  "Takes a vega spec and produces a vega spec with a facetted layout based on the *facet-x*
   and *facet-y* fields."
   [inner-spec [datum & more :as data]]
   {:pre [(contains? datum *facet-x*) (contains? datum *facet-y*)]}
@@ -142,20 +150,7 @@
                     :properties {:axis {:strokeWidth {:value 0}}}}]
             :marks facetted-marks})))

-(def top-level
-  {:width 800
-   :height 600
-   :padding {:top 100, :left 100, :bottom 100, :right 200}
-   :data []
-   :scales []
-   :axes []
-   :marks []
-   :legends []
-   :signals []})
-
-(defn wrap-dims
-  [spec]
-  (merge-spec top-level spec))
+

 (defn assoc-hover
   [vg hover-spec]
@@ -170,11 +165,12 @@
     "ordinal" (vary-meta data assoc field "ordinal")
     "geojson"  (let [raise-geopath (fn [datum] (-> datum
                                                (dissoc *geopath*)
-                                               (merge (get datum *geopath*))))]
-                 (vary-meta (map raise-geopath data) assoc field "geojson"))))
+                                               (merge (get datum *geopath*))))
+                     flattened-data (map raise-geopath data)]
+                 (vary-meta flattened-data assoc field "geojson"))))

 (defn ->vg-data
-  "Converts class types into data that vega.js understands."
+  "Converts objects like Date into data that vega.js understands."
   [data]
   (let [fields (-> data first keys)]
     (reduce (fn [acc, field]
@@ -401,8 +397,8 @@
         data [{:name *table* :values data}]
         scales [{:name "fill" :type "quantize"
                  :domain {:data *table* :field *fill*}
-                 :range ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6",
-                         "#4292c6", "#2171b5", "#08519c", "#08306b"]}]
+                 :range ["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59",
+                         "#ef6548","#d7301f","#b30000","#7f0000"]}]
         marks [{:type "path"
                 ;; geotransform in mark so that facetting works?
                 :from {:data *table*
@@ -410,8 +406,8 @@
                 :properties
                 {:update {:path {:field "layout_path"}
                           :fill {:scale "fill" :field *fill*}}
-                 :hover {:fill {:value "red"}}}}]]
+                 :hover {:fill {:value "steelblue"}}}}]]
     {:data data
      :scales scales
      :marks marks
-     :legends []}))
+     :legends [{:fill "fill"}]}))


working card quantity buttons

working card quantity buttons

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -260,9 +260,12 @@
                     (for [line (last group)]
                       [:div.line
                        (when (:edit state)
-                         [:span
-                          [:button.small {:type "button" :on-click #()} "+"]
-                          [:button.small {:type "button" :on-click #()} "-"]])
+                         (let [ch (om/get-state owner :edit-channel)]
+                           [:span
+                            [:button.small {:on-click #(put! ch {:qty 1 :card (:card line)})
+                                            :type "button"} "+"]
+                            [:button.small {:on-click #(put! ch {:qty -1 :card (:card line)})
+                                            :type "button"} "-"]]))
                        (:qty line) " "
                        (if-let [name (get-in line [:card :title])]
                          (let [card (:card line)]


Improve verify

Improve verify

--- src/clojure_fabric/crypto_suite.clj
+++ src/clojure_fabric/crypto_suite.clj
@@ -13,7 +13,8 @@
 ;; limitations under the License.

 (ns clojure-fabric.crypto-suite
-  (:require [clojure.data.codec.base64 :as b64])
+  (:require [clojure.data.codec.base64 :as b64]
+            [clojure-fabric.utils :as utils])
   (:import [org.bouncycastle.crypto.generators ECKeyPairGenerator]
            [org.bouncycastle.jce ECNamedCurveTable]
            [org.bouncycastle.jce.spec ECNamedCurveParameterSpec ECNamedCurveSpec]
@@ -302,8 +303,10 @@
         digest (byte[]) original digest that was signed
   Returns
         (bool): verification successful or not"
-  [pub-key-byte signature ^bytes digest {:keys [algorithm curve type security-provider] :as opts}]
-  (let [^PublicKey pub-key (import-key pub-key-byte opts)
+  [pub-key signature ^bytes digest {:keys [algorithm curve type security-provider] :as opts}]
+  (let [^PublicKey pub-key (cond (utils/bytes? pub-key) (import-key pub-key opts)
+                                 (string? pub-key) (import-key (cert-string->bytes pub-key))
+                                 :else pub-key)
         signer (Signature/getInstance (name algorithm))]
     (.initVerify signer pub-key)
     (.update signer digest)


Fix chaining mistake

Fix chaining mistake

--- src/clojure_fabric/crypto_suite.clj
+++ src/clojure_fabric/crypto_suite.clj
@@ -280,16 +280,16 @@
 (defn sign
   "Sign the data.
   Params
+        digest (byte[]) fixed-length digest of the target message to be signed
         Key (Key) private signing key
-        digest (byte[]) fixed-length digest of the target message to be signed
         opts (function) hashing function to use
   Returns
         Result(Object):Signature object"
-  [priv-key ^bytes digest {:keys [algorithm]}]
-  (doto (Signature/getInstance (name algorithm))
-    (.initSign priv-key)
-    (.update digest)
-    (.sign)))
+  [^bytes digest priv-key {:keys [algorithm]}]
+  (let [signature (Signature/getInstance (name algorithm))]
+    (.initSign signature priv-key)
+    (.update signature digest)
+    (.sign signature)))

 ;;; verify
 (defn verify
@@ -301,9 +301,9 @@
   Returns
         (bool): verification successful or not"
   [pub-key signature ^bytes digest {:keys [algorithm]}]
-  (doto (Signature/getInstance (name algorithm))
-    (.initVerify pub-key) ;; Reflection warning! - pub-key type is unknown :(
-    (.update digest)
+  (let [signature (Signature/getInstance (name algorithm))]
+    (.initVerify signature pub-key) ;; Reflection warning! - pub-key type is unknown :(
+    (.update signature digest)
     (.verify signature)))

 #_


Added error logging.

Added error logging.

--- src/cmr/opendap/components/auth.clj
+++ src/cmr/opendap/components/auth.clj
@@ -56,6 +56,7 @@
      (token/user-id-key token)
      #(token/->user (config/get-echo-rest-url system) token))
     (catch Exception e
+      (log/error e)
       (ex-data e))))

 (defn cached-admin-role
@@ -69,6 +70,7 @@
                             token
                             user-id))
     (catch Exception e
+      (log/error e)
       {:errors (ex-data e)})))

 (defn cached-concept-permission
@@ -84,6 +86,7 @@
                       user-id
                       concept-id))
     (catch Exception e
+      (log/error e)
       (ex-data e))))

 (defn check-roles


Fix typo

Fix typo

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -1869,7 +1869,7 @@
   By default this plugin will also register resolvers to provide the index itself, if
   you for some reason need to hide it you can dissoc the `::pc/register` from the output
   and they will not be available, but consider that doing so you lose the ability to
-  have instrospection in tools like Pathom Viz and Fulcro Inspect."
+  have introspection tools like Pathom Viz and Fulcro Inspect."
   ([] (connect-plugin {}))
   ([{::keys [indexes] :as env}]
    (let [indexes   (or indexes (atom {}))


Add parallel connect read tolerance with nils

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -451,18 +451,25 @@
                                                                              (distinct))))
                                               _              (pt/trace env {::pt/event ::batch-items-ready
                                                                             ::items    items})
-                                              batch-result   (<!maybe (call-resolver env items))
+                                              batch-result   (try
+                                                               (<?maybe (call-resolver env items))
+                                                               (catch #?(:clj Throwable :cljs :default) e
+                                                                 (pt/trace env {::pt/event ::batch-result-error
+                                                                                :error     e})
+                                                                 (repeat (count items) {})))
                                               _              (pt/trace env {::pt/event    ::batch-result-ready
                                                                             ::items-count (count batch-result)})
                                               linked-results (->> (zipmap items batch-result)
                                                                   (into {} (filter second)))]
                                           (doseq [[resolver-input value] linked-results]
-                                            (p/cache-hit env [resolver-sym resolver-input] (go-promise value)))
+                                            (p/cache-hit env [resolver-sym resolver-input] (go-promise (or value {}))))
                                           (get linked-results e {}))))
                                     (pt/tracing env (assoc trace-data ::pt/event ::call-resolver-with-cache)
                                       (<!
                                         (p/cached-async env [resolver-sym e]
-                                          (call-resolver env e)))))
+                                          (do
+                                            (pt/trace env {::pt/event ::call-resolver-cache-miss})
+                                            (or (<?maybe (call-resolver env e)) {}))))))

                                   :else
                                   (pt/tracing env (assoc trace-data ::pt/event ::call-resolver-without-cache)


starting updater agent

starting updater agent

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

--- acqEngine/src/org/micromanager/config_editor.clj
+++ acqEngine/src/org/micromanager/config_editor.clj
@@ -6,6 +6,12 @@
            [javax.swing.table AbstractTableModel]
            [java.awt Color Dimension])
   (:use [org.micromanager.mm :only [load-mm gui core edt get-config]]))
+
+;; utils
+
+(defn updater-agent [init-value update-fn]
+  (let [a (agent init-value)]
+    (await a

 ;; swing layout


bumped version, upgraded storm dep

bumped version, upgraded storm dep

--- storm-kafka/project.clj
+++ storm-kafka/project.clj
@@ -1,4 +1,4 @@
-(defproject storm/storm-kafka "0.9.0-wip5-scala292"
+(defproject storm/storm-kafka "0.9.0-wip15-scala292"
   :source-path "src/clj"
   :java-source-path "src/jvm"
   :javac-options {:debug "true" :fork "true"}
@@ -6,7 +6,7 @@
   :dependencies [[com.twitter/kafka_2.9.2 "0.7.0"
                   :exclusions [org.apache.zookeeper/zookeeper
                                log4j/log4j]]]
-  :dev-dependencies [[storm "0.9.0-wip9"]
+  :dev-dependencies [[storm "0.9.0-wip15"]
                      [org.slf4j/log4j-over-slf4j "1.6.6"]
                      [ch.qos.logback/logback-classic "1.0.6"]
                      [org.clojure/clojure "1.4.0"]]


fix watch-futures, i.e. handle on-exit/on-error being nil

--- src/fscrawler_tika_convert/reap.clj
+++ src/fscrawler_tika_convert/reap.clj
@@ -61,8 +61,8 @@
       (when (realized? a-future)
         (unregister-future! a-future)
         (let [do-nothing (constantly nil)
-              on-error (get callbacks :on-error do-nothing)
-              on-exit (get callbacks :on-exit do-nothing)
+              on-error (or (:on-error callbacks) do-nothing)
+              on-exit (or (:on-exit callbacks) do-nothing)
               error (deref-exception a-future)]
           (if error
             (on-error a-future error)


Separate changelog generation

Separate changelog generation

--- src/github_changelog/cli.clj
+++ src/github_changelog/cli.clj
@@ -15,11 +15,13 @@
 (defn- read-config [file]
   (edn/read-string (slurp file)))

+(defn- generate [file]
+  (->> (read-config file)
+       changelog
+       format-tags))
+
 (defn -main [& [config-file]]
   (when (empty? config-file)
     (exit 1 "Usage: program-name config-file.edn"))

-  (->> (read-config config-file)
-       changelog
-       format-tags
-       (exit 0)))
+  (exit 0 (generate config-file)))


cleanup

cleanup

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/communicator.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/communicator.cljs
@@ -48,15 +48,6 @@
                                :from (* chunk-size @prev-chunks-loaded)}])
       (swap! prev-chunks-loaded inc))))

-(defn load-prev2
-  "load previous tweets matching the current search"
-  []
-  (dotimes [n 20]
-    (chsk-send! [:cmd/query {:query (query-string)
-                             :n 1000
-                             :uid (:uid @chsk-state)
-                             :from (* 1000 n)}])))
-
 (defn start-search
   "initiate new search by starting SSE stream"
   []
@@ -68,9 +59,7 @@
     (swap! state/app assoc :search s)
     (aset js/window "location" "hash" (js/encodeURIComponent s))
     (start-percolator)
-    (dotimes [n 4] (load-prev))
-    ;(load-prev2)
-    ))
+    (dotimes [n 4] (load-prev))))

 (defn- event-handler [{:keys [event]}]
   (match event


lein: lein-ancient bump

lein: lein-ancient bump

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -1,6 +1,6 @@
 {:user {:plugins [
                   [lein-ring "0.9.3"]
-                  [lein-ancient "0.6.6"]
+                  [lein-ancient "0.6.7"]
                   [jonase/eastwood "0.2.1"]
                   [cider/cider-nrepl "0.9.0-SNAPSHOT"]
                   ]}}


Skip Visits Without Age

Skip Visits Without Age

--- src/lens/routes.clj
+++ src/lens/routes.clj
@@ -520,10 +520,13 @@
       (t/in-years (t/interval (c/from-date birth-date) (c/from-date edat))))))

 (defn age-decade [age]
+  {:pre [age]}
   (* (quot age 10) 10))

 (defn visit-count-by-age-decade [visits]
-  (->> (group-by (comp age-decade age-at-visit) visits)
+  (->> (map age-at-visit visits)
+       (remove nil?)
+       (group-by age-decade)
        (map-vals count)))

 (defn query [db expr]


Clean Brnaches List Handler

Clean Brnaches List Handler

--- src/lens/routes.clj
+++ src/lens/routes.clj
@@ -246,7 +246,6 @@
   (r/map render-embedded-branch branches))

 (defresource branch-list-handler
-  :allowed-methods [:get :post]
   :available-media-types media-types

   :handle-ok
@@ -258,12 +257,7 @@
      {:lens/branches
       (->> (api/all-branches db)
            (render-embedded-branches)
-           (into []))}})
-
-  :handle-not-found
-  (fn [_]
-    {:links {:up {:href (service-document-path)}}
-     :error "Branch not found."}))
+           (into []))}}))

 ;; ---- Query -----------------------------------------------------------------


test hook

test hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 51
+                 3  {:db/id 3 :person/name "Allie" :person/age 50
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}


make api host dynamic

make api host dynamic

--- cljx-src/dpl/config.cljx
+++ cljx-src/dpl/config.cljx
@@ -18,7 +18,7 @@

 #+cljs
 (def api-cfg
-   {:host "localhost"
+   {:host (if browser? (.-host js/location) "localhost")
     :port (if browser? (.-port js/location) api-port)
     :root-path "/api"})


bump dev dep versions

bump dev dep versions

--- build.boot
+++ build.boot
@@ -5,9 +5,9 @@
                   [adzerk/boot-test      "1.0.4"  :scope "test"]
                   [str-to-argv           "0.1.0"  :scope "test"]
                   ; needed in order to run the "alda repl" command in dev
-                  [alda/core             "0.0.1"  :scope "test"]
-                  [alda/sound-engine-clj "0.0.1"  :scope "test"]
-                  [alda/repl-clj         "0.0.1"  :scope "test"]
+                  [alda/core             "0.1.0"  :scope "test"]
+                  [alda/sound-engine-clj "0.1.0"  :scope "test"]
+                  [alda/repl-clj         "0.1.0"  :scope "test"]

                   ; silence slf4j logging dammit
                   [org.slf4j/slf4j-nop              "1.7.21"]


actually refresh plugins instead of just updating the view

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/plugins.cljs
+++ src/lt/objs/plugins.cljs
@@ -237,11 +237,10 @@
           :triggers #{:refresh!}
           :desc "Plugin Manager: refresh installed plugins"
           :reaction (fn [this plugins]
-                      (println "here refreshing")
+                      (object/merge! app/app {::plugins (available-plugins)})
                       (let [ul (dom/$ :.plugins (object/->content this))]
-                        (println ul)
                         (dom/empty ul)
-                        (dom/append ul (dom/fragment (map installed-plugin-ui (vals (available-plugins))))))))
+                        (dom/append ul (dom/fragment (map installed-plugin-ui (-> @app/app ::plugins vals)))))))

 (behavior ::on-close
           :triggers #{:close}


Have text boxes hooked up

Have text boxes hooked up

--- src/matchmaker/core.cljs
+++ src/matchmaker/core.cljs
@@ -20,15 +20,17 @@
   [:textarea {:value @value
               :on-change #(reset! value (-> % .-target .-value))}])

+(def players-txt (atom ""))
+(def attendance-txt (atom ""))
+
 (defn root []
-  (let [players-txt (atom "")
-        attendance-txt (atom "")]
-    [[(editor players-txt)]
-     [(editor attendance-txt)]
-     (let [players (parse-players players-txt)
-           attendance (parse-attendance attendance-txt)
-           teams (group-teams (can-play players attendance))]
-       [:p "TODO: Everything."])]))
+  [:div
+   [editor players-txt]
+   [editor attendance-txt]
+   (let [players (parse-players players-txt)
+         attendance (parse-attendance attendance-txt)
+         teams (group-teams (can-play players attendance))]
+     [:p "TODO: Everything. " (count @players-txt) " - " (count @attendance-txt)])])

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


Provide good validation messages in all browsers.

--- src-cljs/frontend/components/contact_form.cljs
+++ src-cljs/frontend/components/contact_form.cljs
@@ -7,14 +7,24 @@
                    [frontend.utils :refer [html]])
   (:import [goog.math Rect]))

+(defn- validation-message [control]
+  (let [validity (.-validity control)]
+    (cond
+      (.-valid validity) nil
+      (.-valueMissing validity) "Please fill out this field."
+
+      (.-typeMismatch validity)
+      (case (.-type control)
+        "email" "Please enter a valid email address.")
+
+      ;; Default to the message provided by the browser.
+      :else (.-validationMessage control))))

 (defn- form-control [props owner]
   (let [update-state
-        (fn [input]
-          (om/set-state! owner {:value (.-value input)
-                                :validation-message (let [msg (.-validationMessage input)]
-                                                      (when (not= "" msg)
-                                                        msg))}))]
+        (fn [control]
+          (om/set-state! owner {:value (.-value control)
+                                :validation-message (validation-message control)}))]
     (reify
       om/IInitState
       (init-state [_]
@@ -83,6 +93,9 @@
                             (.preventDefault e)
                             (let [form (.-target e)
                                   action (.-action form)
+                                  ;; NOTE: HTMLFormElement.elements returns the form's *listed* elements; we really want
+                                  ;; the *submittable* elements. Here, we assume they're the same.
+                                  ;; https://html.spec.whatwg.org/multipage/forms.html#categories
                                   params (into {} (map (juxt #(.-name %) #(.-value %)) (.-elements form)))
                                   filtered-params (params-filter params)
                                   valid? (fn [f] (every? #(.checkValidity %) (.-elements f)))]


Making linux container selection look a bit better with GA pricing.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -509,7 +509,8 @@
             container-cost (pm/per-container-cost plan)
             piggiebacked? (pm/piggieback? plan org-name)
             button-clickable? (not= (if piggiebacked? 0 (pm/paid-containers plan))
-                                    selected-paid-containers)]
+                                    selected-paid-containers)
+            title-element (if (feature/enabled? :osx-ga-inner-pricing) :h1 :legend)]
       (html
         [:div#edit-plan {:class "pricing.page"}
          (when-not (config/enterprise?)
@@ -517,7 +518,7 @@
             [:legend "More containers means faster builds and lower queue times."]])
          [:div.main-content
           [:div
-           [:legend "Linux Plan - "
+           [title-element "Linux Plan - "
             [:div.container-input
              [:input.form-control {:style {:margin "4px" :height "calc(2em + 2px)"}
                                    :type "text" :value selected-containers


fix typo

fix typo

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

--- plugins/SlideExplorer2/src/slide_explorer/view.clj
+++ plugins/SlideExplorer2/src/slide_explorer/view.clj
@@ -136,7 +136,7 @@
                      :w (* zoom w) :h (* zoom h)
                      :alpha 1
                      :stroke {:color color
-                              :width 2-}}])))
+                              :width 2}}])))

 (defn paint-stage-position [^Graphics2D g screen-state]
   (let [[x y] (:xy-stage-position screen-state)


Refactor to use helper

Refactor to use helper


Made require more robust

Made require more robust

--- lib/compojure.clj
+++ lib/compojure.clj
@@ -2,7 +2,7 @@
 (clojure/refer 'clojure)

 (import '(javax.servlet.http HttpServlet))
-(import '(java.io FileReader PushbackReader))
+(import '(java.io File FileReader PushbackReader))

 ;;;;; General-use functions ;;;;;

@@ -68,16 +68,17 @@
        (refer '~'compojure)))

 (def #^{:private true}
-  *loaded-files* nil)
+  *loaded-paths* #{})

 (defn require
   "Load the file if and only if it has not been loaded previously."
   [file]
-  (when-not (includes? file *loaded-files*)
-    (def *loaded-files*
-      (cons file *loaded-files*))
-    (load-file file)
-    true))
+  (let [path (. (new File file) (getCanonicalPath))]
+    (when-not (contains? *loaded-paths* path)
+      (def *loaded-paths*
+        (conj *loaded-paths* path))
+      (load-file path)
+      true)))

 (defmacro return
   "A do block that will always return the argument x."
@@ -94,8 +95,8 @@

 (defn file
   "Returns an instance of java.io.File."
-  ([name]          (new java.io.File name))
-  ([parent name]   (new java.io.File parent name))
+  ([name]          (new File name))
+  ([parent name]   (new File parent name))
   ([p q & parents] (reduce file (file p q) parents)))

 (defn pipe-stream
@@ -158,10 +159,8 @@

 (defn glob
   "Find all files in a directory matching a glob."
-  ([pattern]
-    (glob pattern "."))
-  ([pattern path]
-    (glob-parts (split-path pattern) (file path))))
+  [pattern]
+  (glob-parts (split-path pattern) (file ".")))

 (defn load-glob
   "Load all files matching a glob."
@@ -193,4 +192,4 @@
     (require \"modules/html/init.clj\")"
   [& modules]
   (doseq m modules
-    (require (str (file "./modules" (str m) "init.clj")))))
+    (require (str (file "modules" (str m) "init.clj")))))


Only add the volume suffix to the iso name if there is a volume

--- src/mdr2/production/path.clj
+++ src/mdr2/production/path.clj
@@ -55,7 +55,7 @@
   "Path to the iso of the exported DTB for given `production` and
   `volume`"
   [{id :id :as production} volume]
-  (file (iso-path production volume) (str id "_" volume ".iso")))
+  (file (iso-path production volume) (str id (when volume (str "_" volume)) ".iso")))

 (defn manifest-path
   "Path to the manifest of the DTB which was exported from obi for


[#244] Make test more realible

[#244] Make test more realible

--- api/test/clojure/org/akvo/flow_api/datastore/stats_test.clj
+++ api/test/clojure/org/akvo/flow_api/datastore/stats_test.clj
@@ -75,7 +75,7 @@
               "fsdfs" 1
               "fbfb" 1}
              (stats/option-question-stats dss {:questionId (str question-id)
-                                         :formId (str form-id)}))))))
+                                               :formId (str form-id)}))))))

 (deftest test-number-question
   (ds/with-remote-api (:remote-api fixtures/*system*) "akvoflowsandbox"
@@ -84,13 +84,12 @@
           ;; After how many (full) strokes does water start flowing?
           question-id "146622024"]
       (is
-       (= {:sd 165.42890102277977
-           :max 365.0
+       (= {:max 365.0
            :min 0.0
-           :mean 134.67441860465115
            :count 129}
-          (stats/number-question-stats dss {:formId form-id
-                                            :questionId question-id}))))))
+          (select-keys (stats/number-question-stats dss {:formId form-id
+                                                         :questionId question-id})
+                       [:max :min :count]))))))

 (deftest test-filter-anwers
   (ds/with-remote-api (:remote-api fixtures/*system*) "akvoflowsandbox"


Use border algorithm to compute lattice edges by default

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

--- src/conexp/layouts/util.clj
+++ src/conexp/layouts/util.clj
@@ -86,14 +86,6 @@
   [lattice]
   (reverse (graph/dependency-list (lattice->graph lattice))))

-(defn edges
-  "Returns a sequence of pairs of vertices of lattice which are
-  directly neighbored in lattice."
-  [lattice]
-  (set-of [x y] [x (base-set lattice),
-                 y (base-set lattice),
-                 :when (directly-neighboured? lattice x y)]))
-
 (defn- edges-by-border
   "Computes edges of a lattice by a border algorithm as given by José
   L. Balcázar and Cristina Tîrnǎucǎ."
@@ -117,6 +109,12 @@
                           H
                           cover)))
         H))))
+
+(defn edges
+  "Returns a sequence of pairs of vertices of lattice which are
+  directly neighbored in lattice."
+  [lattice]
+  (edges-by-border lattice))

 (defn top-down-elements-in-layout
   "Returns the elements in layout ordered top down."


Remove :target option and add :keep-on-top option.

--- src/quil/applet.clj
+++ src/quil/applet.clj
@@ -37,8 +37,9 @@
   (set! (.finished applet) true))

 (defn- prepare-applet-frame
-  [applet title renderer keep-on-top?]
-  (let [keep-on-top?   (boolean keep-on-top?)
+  [applet title renderer]
+  (let [m              (meta applet)
+        keep-on-top?   (true? (:keep-on-top m))
         frame          (.frame applet)]
     (doseq [listener (.getWindowListeners frame)]
       (.removeWindowListener frame listener))
@@ -62,11 +63,9 @@

 (defn- applet-run
   "Launches the applet to the specified target."
-  [applet title renderer target]
+  [applet title renderer]
   (PApplet/runSketch (into-array String ["--hide-stop" title]) applet)
-  (case target
-    :frame (prepare-applet-frame applet title renderer false)
-    :perm-frame (prepare-applet-frame applet title renderer true)))
+  (prepare-applet-frame applet title renderer))

 (def ^{:private true}
@@ -101,16 +100,6 @@
         (and (coll? size) (= 2 (count size))) size
         :else (throw (IllegalArgumentException.
                       (str "Invalid size definition:" size ". Was expecting :fullscreen or 2 elements vector: [x-size y-size].")))))
-
-(def ^{:private true} VALID-TARGETS #{:frame :perm-frame})
-
-(defn- validate-target!
-  "Checks that the target option is one of the following allowed
-  targets: [:frame, :perm-frame]."
-  [target]
-  (when-not (some VALID-TARGETS [target])
-    (throw (IllegalArgumentException. (str "Invalid target:" target". Was expecting one of: " (vec VALID-TARGETS)))))
-  target)

 (defn- to-method-name [keyword]
   "Converts keyword to java-style method symbol. :on-key-pressed => onKeyPressed"
@@ -262,7 +251,8 @@
    :title          - a string which will be displayed at the top of
                      the sketch window.

-   :target         - Specify the target. One of :frame, :perm-frame.
+   :keep-on-top    - Sets whether sketch window should always be above other windows.
+                     Note: some platforms might not support always-on-top windows.

    :setup          - a fn to be called once when setting the sketch up.

@@ -315,7 +305,6 @@
                                  (apply hash-map opts))

         size              (process-size (:size options))
-        target            (validate-target! (:target options))
         title             (or (:title options) (str "Quil " (swap! untitled-applet-id* inc)))
         renderer          (or (:renderer options) :java2d)
         draw-fn           (or (:draw options) no-fn)
@@ -336,7 +325,6 @@
                                      [name (or (options name) no-fn)]))
         applet-state      (merge options
                                  {:state state
-                                  :target target
                                   :looping? looping?
                                   :on-close on-close-fn
                                   :setup-fn setup-fn
@@ -347,7 +335,7 @@
                                  listeners)
         prx-obj           (quil.Applet. applet-state)]
     (doto prx-obj
-      (applet-run title renderer target)
+      (applet-run title renderer)
       (attach-applet-listeners))))

 (def ^{:private true}


CL + CW | #117 | strengthen regex pattern for dashboard safen routes

--- src/objective8/utils.clj
+++ src/objective8/utils.clj
@@ -106,8 +106,8 @@
       ((regex-checker #"/objectives/\d+/writers") target)
       ((regex-checker #"/objectives/\d+/writers/invitation") target)
       ((regex-checker #"/objectives/\d+/writer-invitations/\d+") target)
-      ((regex-checker #"/objectives/\d+/dashboard/questions.*") target)
-      ((regex-checker #"/objectives/\d+/dashboard/comments.*") target)))
+      ((regex-checker #"/objectives/\d+/dashboard/questions(?:\?(?:(?:(?:[a-zA-Z-]*=[a-zA-Z0-9-|%2F]*)&?)+)?)?(?:#[a-zA-Z-]*)?") target)
+      ((regex-checker #"/objectives/\d+/dashboard/comments(?:\?(?:(?:(?:[a-zA-Z-]*=[a-zA-Z0-9-|%2F]*)&?)+)?)?(?:#[a-zA-Z-]*)?") target)))

 (defn safen-fragment [fragment]
   (or ((regex-checker #"comments") fragment)


Changed database synchronization code to catch Throwable to handle Java assertion failures.

--- bootstrap-app/src/cmr/bootstrap/data/db_synchronization.clj
+++ bootstrap-app/src/cmr/bootstrap/data/db_synchronization.clj
@@ -218,7 +218,7 @@
                           concept-id revision-id (pr-str (:errors data))))
             (error e (format "Error saving or indexing concept %s with revision %s. Message: %s"
                              concept-id revision-id (.getMessage e))))))
-      (catch Exception e
+      (catch Throwable e
         (error e (format "Error saving or indexing concept %s with revision %s. Message: %s"
                          concept-id revision-id (.getMessage e)))))))

@@ -355,7 +355,7 @@
                         concept-id revision-id (pr-str (:errors data))))
           (error e (format "Error deleting or unindexing concept %s with revision %s. Message: %s"
                            concept-id revision-id (.getMessage e))))))
-    (catch Exception e
+    (catch Throwable e
       (error e (format "Error deleting or unindexing concept %s with revision %s. Message: %s"
                        concept-id revision-id (.getMessage e))))))


run component process fn in future, as this will:

- enable component to process multiple requests in parallel
  (within multiple futures => on multiple threads)

--- src/ow/starbuck/core.clj
+++ src/ow/starbuck/core.clj
@@ -43,16 +43,17 @@
          (info "starting...")
          (go-loop [~req (<! ~'ch-in)]
            (if-not (= ~req ~stopkw)
-             (do (debug "got request")
-                 ~(if silent?
-                    `(do (debug "silent component - will not wait for response(s)")
-                         (future (safe-process ~this ~'processfn ~req)))
-                    `(let [res# (safe-process ~this ~'processfn ~req)]
-                       (debug "sending response(s)")
-                       (cond
-                         (nil? res#)        nil
-                         (sequential? res#) (dorun (map #(put! ~'ch-out %) res#))
-                         true               (put! ~'ch-out res#))))
+             (do (future
+                   (debug "got request")
+                   ~(if silent?
+                      `(do (debug "silent component - will ignore response(s)")
+                           (safe-process ~this ~'processfn ~req))
+                      `(let [res# (safe-process ~this ~'processfn ~req)]
+                         (debug "sending response(s)")
+                         (cond
+                           (nil? res#)        nil
+                           (sequential? res#) (dorun (map #(put! ~'ch-out %) res#))
+                           true               (put! ~'ch-out res#)))))
                  (recur (<! ~'ch-in)))
              (info "stopped.")))
          (info "started.")


PERF: Allow messages to short-circuit directly to core.async buffers, cutting out Aeron completely in cases where external-addr for the sending peer is the same as the receiving peer

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -24,7 +24,7 @@
   (format "udp://%s:%s" addr port))

 (defrecord AeronConnection
-  [peer-group messaging-group acking-daemon acking-ch
+  [peer-group messaging-group publications virtual-peers acking-daemon acking-ch
    send-idle-strategy compress-f inbound-ch release-ch retry-ch]
   component/Lifecycle
   (start [component]
@@ -32,6 +32,7 @@
     (let [config (:config peer-group)
           messaging-group (:messaging-group peer-group)
           publications (:publications messaging-group)
+          virtual-peers (:virtual-peers messaging-group)
           inbound-ch (:inbound-ch (:messenger-buffer component))
           release-ch (chan (sliding-buffer (arg-or-default :onyx.messaging/release-ch-buffer-size config)))
           retry-ch (chan (sliding-buffer (arg-or-default :onyx.messaging/retry-ch-buffer-size config)))
@@ -41,6 +42,7 @@
       (assoc component
              :messaging-group messaging-group
              :publications publications
+             :virtual-peers virtual-peers
              :send-idle-strategy send-idle-strategy
              :compress-f compress-f
              :acking-ch acking-ch
@@ -58,6 +60,8 @@

     (assoc component
            :send-idle-strategy nil
+           :publications nil
+           :virtual-peers nil
            :compress-f nil :decompress-f nil
            :inbound-ch nil :release-ch nil :retry-ch nil )))

@@ -174,9 +178,10 @@
                              #_(.threadingMode ThreadingMode/DEDICATED)
                              #_(.dirsDeleteOnExit true))))

-          port (opts->port opts)
           bind-addr (common/bind-addr opts)
           external-addr (common/external-addr opts)
+          port (opts->port opts)
+          external-channel (aeron-channel external-addr port)
           idle-strategy-config (arg-or-default :onyx.messaging.aeron/idle-strategy opts)
           send-idle-strategy (backoff-strategy idle-strategy-config)
           receive-idle-strategy (backoff-strategy idle-strategy-config)
@@ -188,6 +193,7 @@
       (assoc component
              :bind-addr bind-addr
              :external-addr external-addr
+             :external-channel external-channel
              :port port
              :media-driver media-driver
              :publications publications
@@ -224,6 +230,8 @@
   [messenger]
   {:aeron/external-addr (:external-addr (:messaging-group messenger))
    :aeron/port (:port (:messaging-group messenger))})
+
+(defrecord AeronPeerConnection [channel peer-id])

 ;;;; THIS CAN BE MADE FASTER BY NOT GOING THROUGH PEER-LINK IN OPERATION
 (defmethod extensions/connect-to-peer AeronConnection
@@ -243,53 +251,81 @@
           segments)
         segments))))

+(defn short-circuitable? [messenger channel]
+  (= (:external-channel (:messaging-group messenger))
+     channel))
+
+(defn short-circuit-ch [messenger peer-id ch-k]
+  (-> messenger
+      :virtual-peers
+      deref
+      (get peer-id)
+      ch-k))
+
+(defn send-messages-short-circuit [ch batch]
+  (doseq [segment batch]
+    (>!! ch segment)))
+
 (defmethod extensions/send-messages AeronConnection
-  [messenger event peer-link batch]
-  (let [pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
-                                                                 (:channel peer-link))
-        peer-id (:peer-id peer-link)
-        [len unsafe-buffer] (protocol/build-messages-msg-buf (:compress-f messenger) peer-id batch)
-        offer-f (fn [] (.offer pub unsafe-buffer 0 len))
-        idle-strategy (:send-idle-strategy messenger)]
-    ;;; TODO: offer will return a particular code when the publisher is down
-    ;;; we should probably re-restablish the publication in this case
-    (while (neg? ^long (offer-f))
-      (.idle ^IdleStrategy idle-strategy 0))))
+  [messenger event {:keys [peer-id channel]} batch]
+  (if (short-circuitable? messenger channel)
+    (send-messages-short-circuit (short-circuit-ch messenger peer-id :inbound-ch) batch)
+    (let [pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
+                                                                   channel)
+          [len unsafe-buffer] (protocol/build-messages-msg-buf (:compress-f messenger) peer-id batch)
+          offer-f (fn [] (.offer pub unsafe-buffer 0 len))
+          idle-strategy (:send-idle-strategy messenger)]
+      ;;; TODO: offer will return a particular code when the publisher is down
+      ;;; we should probably re-restablish the publication in this case
+      (while (neg? ^long (offer-f))
+        (.idle ^IdleStrategy idle-strategy 0)))))
+
+(defn ack-messages-short-circuit [ch acks]
+  (doseq [ack acks]
+    (>!! ch ack)))

 (defmethod extensions/internal-ack-messages AeronConnection
-  [messenger event peer-link acks]
-  ; TODO: Might want to batch in a single buffer as in netty
-  (let [pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
-                                                                 (:channel peer-link))
-        peer-id (:peer-id peer-link)
-        idle-strategy (:send-idle-strategy messenger)]
-    (doseq [{:keys [id completion-id ack-val]} acks]
-      (let [unsafe-buffer (protocol/build-acker-message peer-id id completion-id ack-val)
-            offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/ack-msg-length))]
-        (while (neg? ^long (offer-f))
-          (.idle ^IdleStrategy idle-strategy 0))))))
+  [messenger event {:keys [peer-id channel]} acks]
+  (if (short-circuitable? messenger channel)
+    (ack-messages-short-circuit (short-circuit-ch messenger peer-id :acking-ch) acks)
+    (let [pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
+                                                                   channel)
+          idle-strategy (:send-idle-strategy messenger)]
+      (doseq [{:keys [id completion-id ack-val]} acks]
+        (let [unsafe-buffer (protocol/build-acker-message peer-id id completion-id ack-val)
+              offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/ack-msg-length))]
+          (while (neg? ^long (offer-f))
+            (.idle ^IdleStrategy idle-strategy 0)))))))
+
+
+(defn complete-message-short-circuit [ch completion-id]
+  (>!! ch completion-id))

 (defmethod extensions/internal-complete-message AeronConnection
-  [messenger event id peer-link]
-  (let [idle-strategy (:send-idle-strategy messenger)
-        pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
-                                                                 (:channel peer-link))
-        peer-id (:peer-id peer-link)
-        unsafe-buffer (protocol/build-completion-msg-buf peer-id id)
-        offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/completion-msg-length))]
-    (while (neg? ^long (offer-f))
-      (.idle ^IdleStrategy idle-strategy 0))))
+  [messenger event id {:keys [peer-id channel]}]
+  (if (short-circuitable? messenger channel)
+    (complete-message-short-circuit (short-circuit-ch messenger peer-id :release-ch) id)
+    (let [idle-strategy (:send-idle-strategy messenger)
+          pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger) channel)
+          unsafe-buffer (protocol/build-completion-msg-buf peer-id id)
+          offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/completion-msg-length))]
+      (while (neg? ^long (offer-f))
+        (.idle ^IdleStrategy idle-strategy 0)))))
+
+(defn retry-message-short-circuit [ch retry-id]
+  (>!! ch retry-id))

 (defmethod extensions/internal-retry-message AeronConnection
-  [messenger event id peer-link]
-  (let [idle-strategy (:send-idle-strategy messenger)
-        pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
-                                                                 (:channel peer-link))
-        peer-id (:peer-id peer-link)
-        unsafe-buffer (protocol/build-retry-msg-buf peer-id id)
-        offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/retry-msg-length))]
-    (while (neg? ^long (offer-f))
-      (.idle ^IdleStrategy idle-strategy 0))))
+  [messenger event id {:keys [peer-id channel]}]
+  (if (short-circuitable? messenger channel)
+    (retry-message-short-circuit (short-circuit-ch messenger peer-id :retry-ch) id)
+    (let [idle-strategy (:send-idle-strategy messenger)
+          pub ^uk.co.real_logic.aeron.Publication (get-publication (:publications messenger)
+                                                                   channel)
+          unsafe-buffer (protocol/build-retry-msg-buf peer-id id)
+          offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/retry-msg-length))]
+      (while (neg? ^long (offer-f))
+        (.idle ^IdleStrategy idle-strategy 0)))))

 (defmethod extensions/close-peer-connection AeronConnection
   [messenger event peer-link]


Change footer copyright

Change footer copyright

--- src/pict_source/site.clj
+++ src/pict_source/site.clj
@@ -22,4 +22,6 @@
          [:a {:href "#"} "en"]]]]
       content
       [:footer {:class "row"}
-       [:p "автор" [:a {:href "http://shvetsovdm.github.io"} "Дмитрий Швецов (shvetsovdm)"]]]]]))
+       [:p
+        "© 2015 "
+        [:a {:href "http://shvetsovdm.github.io"} "Дмитрий Швецов (shvetsovdm)"]]]]]))


fixed examples to use new combinators

fixed examples to use new combinators

--- src/datasplash/examples.clj
+++ src/datasplash/examples.clj
@@ -91,8 +91,7 @@
                                  (into {})))
                               {:name "Projection"}))
         global-mean-temp (->> all-rows
-                              (ds/map :mean_temp)
-                              (ds/mean)
+                              (ds/combine (ds/mean-fn :mapper :mean_temp))
                               (ds/view))
         filtered-results (->> all-rows
                               (ds/filter (fn [{:keys [month]}] (= month monthFilter)))
@@ -169,7 +168,7 @@
                      (bq/read-bq-table input)
                      (ds/map-kv (fn [{:keys [month mean_temp]}]
                                   [(edn/read-string month) (double mean_temp)]))
-                     (ds/max {:scope :per-key :type :double})
+                     (ds/combine (ds/max-fn) {:scope :per-key})
                      (ds/map (fn [[k v]]
                                {:month k :max_mean_temp v})))]
     (if (re-find #":[^\\]" output)


more informative SootType stringification

--- src/tbnl_apk/apk/dex/soot/parse.clj
+++ src/tbnl_apk/apk/dex/soot/parse.clj
@@ -272,14 +272,35 @@
                                                         (fn [form]
                                                           (cond
                                                             (instance? soot.SootMethodRef form)
-                                                            [(.. form declaringClass getName)
-                                                             (.. form name)]
+                                                            (list
+                                                             :method
+                                                             [(.. form declaringClass getName)
+                                                              (.. form name)])
+
+                                                            (instance? soot.SootFieldRef form)
+                                                            (list
+                                                             :field
+                                                             [(.. form declaringClass getName)
+                                                              (.. form name)])

                                                             (instance? soot.SootClass form)
-                                                            (.. form getName)
+                                                            (list
+                                                             :type
+                                                             (.. form getName))

                                                             (instance? soot.RefType form)
-                                                            (.. form getClassName)
+                                                            (list
+                                                             :type
+                                                             (.. form getClassName))
+
+                                                            (instance? soot.ArrayType form)
+                                                            (list
+                                                             :array
+                                                             [(.. form baseType)
+                                                              (.. form numDimensions)])
+
+                                                            (instance? soot.NullType form)
+                                                            nil

                                                             (and (list? form)
                                                                  (= (first form) :invoke))


Create a grid of surfaces in a single frame.

--- src/overtone/gui/surface.clj
+++ src/overtone/gui/surface.clj
@@ -81,10 +81,22 @@
       (repaint! c)))
   c)

+(defn- nil-param
+  []
+  (let [v (atom 0.0)]
+    {:name ""
+    :get-value (fn [] @v)
+    :set-value (fn [new-val] (reset! v new-val))
+    :min 0.0
+    :max 1.0}))
+
 (defn surface-panel [x y z]
   (let [state {:color :blue
-               :x x :y y :z z :dir (atom nil)}
-        c (canvas :preferred-size [480 :by 480]
+               :x (or x (nil-param))
+               :y (or y (nil-param))
+               :z (or z (nil-param))
+               :dir (atom nil)}
+        c (canvas :preferred-size [400 :by 300]
                   :cursor :crosshair
                   :paint (fn [c g] (paint-surface state c g)))
         t (timer (partial handle-timer state)
@@ -96,14 +108,6 @@
       :mouse-released (partial handle-release-event state t))
     [c t]))

-(defn- nil-param
-  []
-  (let [v (atom 0.0)]
-    {:name ""
-    :get-value (fn [] @v)
-    :set-value (fn [new-val] (reset! v new-val))
-    :min 0.0
-    :max 1.0}))

 (defn surface
   "Create a 'surface' for controlling params. Takes three
@@ -120,14 +124,35 @@
   "
   [x y z]
   (invoke-now
-    (let [[panel timer] (surface-panel (or x (nil-param))
-                                       (or y (nil-param))
-                                       (or z (nil-param)))
+    (let [[panel timer] (surface-panel x y z)
           f (frame :title "Surface"
                    :content panel
                    :on-close :dispose)]
       (listen f :window-closed (fn [_] (.stop timer)))
       (-> f pack! show!))))
+
+(defn surface-grid
+  "Create a grid of surfaces. params is a sequence of [x y z] triples passed
+  to (surface). Returns the frame that displays the grid. If you get an
+  empty surface, it probably means you've got an inst without sufficient
+  metadata.
+
+  See:
+    (surface)
+  "
+  [& params]
+  (let [p-and-t (for [p params] (apply surface-panel p))
+        panels (map first p-and-t)
+        timers (map second p-and-t)
+        f (frame :title "Surfaces"
+                 :content (grid-panel
+                            :columns (int (Math/ceil (Math/sqrt (count panels))))
+                            :border 5 :hgap 5 :vgap 5
+                            :background :black
+                            :items panels))]
+    (listen f :window-closed (fn [_]
+                               (doseq [t timers] (.stop t))))
+    (-> f pack! show!)))

 (defn synth-param
   "Create a surface param for a synth or instrument.
@@ -152,23 +177,27 @@
       :max (:max param)})))

 (comment
+  ; Set up a sequencer with some drum sounds. Hook some drum params
+  ; to a couple surfaces.
   (do
     (use 'overtone.live)
     (use 'overtone.gui.sequencer)
     (use 'overtone.gui.surface)
     (use 'overtone.inst.drum)
     (def m (metronome 128))
-    (step-sequencer m 11 [kick closed-hat snare])
-    (surface (synth-param snare "freq")
-             (synth-param kick "freq")
-             (synth-param snare "sustain")))
-
+    (step-sequencer m 11 [kick closed-hat open-hat snare])
+    (surface-grid [(synth-param snare "freq") (synth-param kick "freq") (synth-param snare "sustain")]
+              [(synth-param closed-hat "low") (synth-param closed-hat "hi") (synth-param closed-hat "t")]
+              [(synth-param open-hat "low") (synth-param open-hat "hi") (synth-param open-hat "t")]
+              [(synth-param kick "freq-decay") (synth-param kick "amp-decay") (synth-param snare "decay")]))
+
+  ; Set up two sin waves and control their frequencies with a surface.
   (do
     (use 'overtone.live)
     (use 'overtone.gui.surface)
     (defsynth harmony [freq1 {:default 440 :min 40 :max 1800 :step 1}
                        freq2 {:default 880 :min 40 :max 1800 :step 1}
-                       amp    {:default 0.1 :min 0.1 :max 1 :step 0.01} ]
+                       amp   {:default 0.1 :min 0.1 :max 1 :step 0.01} ]
       (out 0 (* amp (sin-osc [freq1 freq2]))))
     (def h (harmony))
     (surface (synth-param harmony h "freq1")


make windows-os? visible

make windows-os? visible

--- src/overtone/helpers/lib.clj
+++ src/overtone/helpers/lib.clj
@@ -7,7 +7,8 @@
            [java.io File])
   (:use [clojure.stacktrace]
         [clojure.pprint]
-        [overtone.helpers doc]))
+        [overtone.helpers doc]
+        [overtone.helpers.system :only [windows-os?]]))

 (defn to-str


[CS WR] Smaller logging of successful runs

--- src/vip/data_processor/pipeline.clj
+++ src/vip/data_processor/pipeline.clj
@@ -47,7 +47,7 @@
              :fatal {}
              :pipeline pipeline}
         result (run-pipeline ctx)]
-    (log/info result)
+    (log/info (select-keys result [:errors :warnings :critical :fatal :db]))
     (when-let [ex (:exception result)]
       (log/error (with-out-str (stacktrace/print-stack-trace ex)))
       (throw (ex-info "Exception during processing" {:exception ex


Changing test response check so that error messages in the test build will show the error response.

--- system-int-test/src/cmr/system_int_test/utils/index_util.clj
+++ system-int-test/src/cmr/system_int_test/utils/index_util.clj
@@ -1,6 +1,7 @@
 (ns ^{:doc "provides index related utilities."}
   cmr.system-int-test.utils.index-util
-  (:require [clj-http.client :as client]
+  (:require [clojure.test :refer [is]]
+            [clj-http.client :as client]
             [cmr.system-int-test.utils.url-helper :as url]
             [cmr.indexer.config :as config]
             [cmr.system-int-test.utils.queue :as queue]
@@ -23,9 +24,11 @@
 (defn update-indexes
   "Makes the indexer update the index set mappings and indexes"
   []
-  (client/post (url/indexer-update-indexes)
-               {:connection-manager (s/conn-mgr)
-                :headers {transmit-config/token-header (transmit-config/echo-system-token)}}))
+  (let [response (client/post (url/indexer-update-indexes)
+                   {:connection-manager (s/conn-mgr)
+                    :headers {transmit-config/token-header (transmit-config/echo-system-token)}
+                    :throw-exceptions false})]
+    (is (= 200 (:status response)) (:body response))))

 (defn set-message-queue-retry-behavior
   "Set the message queue retry behavior"


Add debug logging

Add debug logging

--- src/gml_to_featured/api.clj
+++ src/gml_to_featured/api.clj
@@ -29,7 +29,7 @@
   DateTime
   (to-json [t, ^JsonGenerator jg] (.writeString jg (str t))))

-(defn- translate-file-from-stream [reader, dataset, mapping, validity, json-filename-fn]
+(defn- translate-file-from-stream [reader, dataset, mapping, validity, original-filename]
   "Read from reader, xml2json translate the content"
   (let [compressed-files (volatile! [])]
     (runner/translate
@@ -38,8 +38,9 @@
       validity
       reader
       #(doseq [file %]
-         (let [json-filename ^String (json-filename-fn)
+         (let [json-filename ^String (fs/json-filename original-filename)
                compressed-file (fs/create-target-file json-filename)]
+           (log/debug "Saving result as" json-filename)
            (with-open [output-stream (io/output-stream compressed-file)
                        zip (ZipOutputStream. output-stream)]
              (.putNextEntry zip (ZipEntry. json-filename))
@@ -53,12 +54,10 @@

 (defn- translate-file-from-zipentry [dataset, mapping, validity, ^ZipFile zipfile, ^ZipEntry entry]
   "Transform a single entry in a zip-file. Returns the location where the result is saved on the filesystem"
-  (let [json-filename-fn #(let [json-filename (fs/json-filename (.getName (File. (.getName entry))))]
-                            (log/debug "Saving result as" json-filename)
-                            json-filename)
+  (let [original-filename (.getName (File. (.getName entry)))
         entry-stream (.getInputStream zipfile entry)]
     (log/debug "Going to transform zip entry" (.getName entry))
-    (let [resulting-files (translate-file-from-stream entry-stream dataset mapping validity json-filename-fn)]
+    (let [resulting-files (translate-file-from-stream entry-stream dataset mapping validity original-filename)]
       (.close entry-stream)
       resulting-files)))

@@ -75,14 +74,12 @@
   "Transforms a file or zip-stream and returns a vector with the transformed files"
   (if (= format :zip)
     (translate-from-zipfile file dataset mapping validity)
-    (let [json-filename-fn #(let [json-filename (fs/json-filename original-filename)]
-                              (log/debug "Saving result as" json-filename)
-                              json-filename)]
+    (do
       (log/debug "Going to transform file" original-filename)
       (with-open [stream (condp = format
                            :gzip (GZIPInputStream. (FileInputStream. file))
                            :plain (FileInputStream. file))]
-        (translate-file-from-stream stream dataset mapping validity json-filename-fn)))))
+        (translate-file-from-stream stream dataset mapping validity original-filename)))))

 (defn extract-filename [headers, ^String uri]
   "Extract the original filename from the Content-Disposition header, or from the URI if unavailable"
@@ -120,6 +117,7 @@
     {:json-files (map #(config/create-url (str "api/get/" (.getName %))) zipped-files)}))

 (defn stats-on-callback [callback-chan request stats]
+  (log/debug "Callback stats:" stats)
   (when (:callback request)
     (go (>! callback-chan [(:callback request) stats]))))


.who: forbid overriding users' self-definitions

--- src/goodbot/plugins/who.clj
+++ src/goodbot/plugins/who.clj
@@ -6,24 +6,29 @@

 (def who-is-query '[:find ?e :in $ ?nick :where [?e :who.entry/nick ?nick]])

+(defn find-entry [db nick]
+  (when-let [[id] (->> db
+                       (datomic/q who-is-query db nick)
+                       first)]
+    (datomic/entity db id)))
+
 (defmulti handle-who
   (fn [_ _ c _] c))

 (defmethod handle-who "add" [irc message _ rest]
   (def conn (db/get-conn irc))
+  (def db (datomic/db conn))
   (when-let [[who-nick desc] (extract-word {:text rest})]
-    (println "add-who" message)
-    @(datomic/transact conn [{:db/id (datomic/tempid :db.part/who)
-                              :who.entry/nick who-nick
-                              :who.entry/submitter (:nick message)
-                              :who.entry/desc desc}])
-    (str "added " who-nick " as " desc " (by " (:nick message) ")")))
-
-(defn find-entry [db nick]
-  (when-let [[id] (->> db
-                       (datomic/q who-is-query db nick)
-                       first)]
-    (datomic/entity db id)))
+    (def entry (find-entry db who-nick))
+    (if (and entry
+             (= (:who.entry/submitter entry) who-nick)
+             (not= who-nick (:nick message)))
+      "cannot override a user's self-definition"
+      (do @(datomic/transact conn [{:db/id (datomic/tempid :db.part/who)
+                                    :who.entry/nick who-nick
+                                    :who.entry/submitter (:nick message)
+                                    :who.entry/desc desc}])
+          (str "added " who-nick " as " desc " (by " (:nick message) ")")))))

 (defmethod handle-who "is" [irc message _ rest]
   (def conn (db/get-conn irc))


Fixed CLI to use the right objects when regen'ing stats.

--- src/hxgm30/language/cli.clj
+++ src/hxgm30/language/cli.clj
@@ -7,31 +7,40 @@
     [hxgm30.language.components.lang :as lang-component]
     [hxgm30.language.gen.assembled.core :as asm]
     [hxgm30.language.gen.core :as gen]
-    [hxgm30.language.gen.name :as name]))
+    [hxgm30.language.gen.name :as name]
+    [taoensso.timbre :as log]))

 (defn setup-system
   []
-  (logger/set-level! '[hxgm30] :error)
-  (system-manager/setup-manager {:init 'hxgm30.language.components.core/cli
-                                 :throw-errors true})
+  (logger/set-level! '[hxgm30] :trace)
+  (system-manager/setup-manager {:init 'hxgm30.language.components.core/init
+                                 :throw-errors false})
   (system-manager/startup)
   (system-manager/system))

 (defn -main
   [& args]
   (let [cmd (keyword (first args))
+        _ (log/debug "Got command:" cmd)
         sys (setup-system)
+        _ (log/debug "System, setup complete.")
         gen-type (config/lang-default-generator-mode sys)
+        _ (when-not (nil? gen-type) (log/debug "Got generator type:" gen-type))
         generator (lang-component/get-generator sys gen-type)]
+    (log/debug "Got generator:" generator)
     (case cmd
       :regen-markov-chains (do
                              (println "Regenerating markov-chain data ...\n")
-                             (gen/regen-stats
-                              (lang-component/get-generator sys :markov)))
+                             (->> :markov
+                                  (lang-component/get-generator sys)
+                                  :stats-gen
+                                  gen/regen-stats))
       :regen-syntagmata (do
                           (println "Regenerating syntagmata data ...\n")
-                          (gen/regen-stats
-                           (lang-component/get-generator sys :syntagmata)))
+                          (->> :syntagmata
+                               (lang-component/get-generator sys)
+                               :stats-gen
+                               gen/regen-stats))
       :names (if-let [race (second args)]
                (name/run generator (keyword race))
                (name/run generator))
@@ -39,4 +48,3 @@
                       language (keyword (second args))]
                   (asm/run generator world language)))
     (println)))
-


Make it possible to set consistency level during query

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -218,18 +218,18 @@
 (defn ^Session connect
   "Connects to the Cassandra cluster. Use `build-cluster` to build a cluster."
   ([hosts]
-   (connect-or-close (build-cluster {:hosts hosts})))
+     (connect-or-close (build-cluster {:hosts hosts})))
   ([hosts keyspace-or-opts]
-    (if (string? keyspace-or-opts)
-      (connect hosts keyspace-or-opts {})
-      (let [keyspace (:keyspace keyspace-or-opts)
-            opts     (dissoc keyspace-or-opts :keyspace)]
-        (if keyspace
-          (connect hosts keyspace opts)
-          (connect-or-close (-> opts (merge {:hosts hosts}) build-cluster))))))
+     (if (string? keyspace-or-opts)
+       (connect hosts keyspace-or-opts {})
+       (let [keyspace (:keyspace keyspace-or-opts)
+             opts     (dissoc keyspace-or-opts :keyspace)]
+         (if keyspace
+           (connect hosts keyspace opts)
+           (connect-or-close (-> opts (merge {:hosts hosts}) build-cluster))))))
   ([hosts keyspace opts]
-   (let [c (build-cluster (merge opts {:hosts hosts}))]
-     (connect-or-close c (name keyspace)))))
+     (let [c (build-cluster (merge opts {:hosts hosts}))]
+       (connect-or-close c (name keyspace)))))

 (defn ^Session connect-with-uri
   ([^String uri]


reduce logging overhead in production

reduce logging overhead in production

--- frontend/utils.cljs
+++ frontend/utils.cljs
@@ -1,6 +1,7 @@
 (ns frontend.utils
   (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
             [ajax.core :as ajax]
+            [frontend.env :as env]
             [goog.crypt :as crypt]
             [goog.crypt.Md5 :as md5]
             [goog.Uri]
@@ -10,15 +11,6 @@

 (defn csrf-token []
   (aget js/window "CSRFToken"))
-
-(defn mlog [& messages]
-  (.apply (.-log js/console) js/console (clj->js messages)))
-
-(defn mwarn [& messages]
-  (.apply (.-warn js/console) js/console (clj->js messages)))
-
-(defn merror [& messages]
-  (.apply (.-error js/console) js/console (clj->js messages)))

 (def parsed-uri
   (goog.Uri. (-> (.-location js/window) (.-href))))
@@ -36,6 +28,23 @@
    :logging-enabled? (parse-uri-bool (.getParameterValue parsed-uri "logging-enabled"))
    :restore-state? (parse-uri-bool (.getParameterValue parsed-uri "restore-state"))
    :rethrow-errors? (parse-uri-bool (.getParameterValue parsed-uri "rethrow-errors"))})
+
+(def logging-enabled?
+  (if (nil? (:logging-enabled? initial-query-map))
+    (env/development?)
+    (:logging-enabled? initial-query-map)))
+
+(defn mlog [& messages]
+  (when logging-enabled?
+    (.apply (.-log js/console) js/console (clj->js messages))))
+
+(defn mwarn [& messages]
+  (when logging-enabled?
+    (.apply (.-warn js/console) js/console (clj->js messages))))
+
+(defn merror [& messages]
+  (when logging-enabled?
+    (.apply (.-error js/console) js/console (clj->js messages))))

 (defn uuid
   "returns a type 4 random UUID: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"


CMR-3508: Addressed review comments.

CMR-3508: Addressed review comments.

--- search-app/test/cmr/search/test/services/parameter_validation.clj
+++ search-app/test/cmr/search/test/services/parameter_validation.clj
@@ -66,7 +66,7 @@

   ;; Page Size
   (testing "Search with large page size"
-    (is (= nil
+    (is (empty?
            (cpv/page-size-validation :collection (assoc valid-params :page-size 100)))))
   (testing "Negative page size"
     (is (= ["page_size must be a number between 0 and 2000"]
@@ -80,7 +80,7 @@

   ;; Page Num
   (testing "Valid page_num"
-    (is (= nil
+    (is (empty?
            (cpv/page-num-validation :collection (assoc valid-params :page-num 5)))))
   (testing "Page num less than one"
     (is (= ["page_num must be a number greater than or equal to 1"]


Create the znodes.

Create the znodes.

--- src/onyx/sync/zookeeper.clj
+++ src/onyx/sync/zookeeper.clj
@@ -61,8 +61,6 @@
 (defn job-log-path [prefix]
   (str root-path "/" prefix "/job-log"))

-
-
 (defn born-log-path [prefix]
   (str root-path "/" prefix "/coordinator/born-log"))

@@ -96,14 +94,12 @@
 (defn shutdown-log-path [prefix]
   (str root-path "/" prefix "/coordinator/shutdown-log"))

-
 (defrecord ZooKeeper [opts]
   component/Lifecycle

   (start [component]
     (taoensso.timbre/info "Starting ZooKeeper")
-    (let [server (when (:zookeeper/server? opts)
-                   (TestingServer. (:zookeeper.server/port opts)))
+    (let [server (when (:zookeeper/server? opts) (TestingServer. (:zookeeper.server/port opts)))
           conn (zk/connect (:zookeeper/address opts))
           prefix (:onyx/id opts)]
       (zk/create conn root-path :persistent? true)
@@ -124,6 +120,18 @@
       (zk/create conn (job-path prefix) :persistent? true)
       (zk/create conn (job-log-path prefix) :persistent? true)

+      (zk/create-all conn (born-log-path) :persistent? true)
+      (zk/create-all conn (death-log-path) :persistent? true)
+      (zk/create-all conn (planning-log-path) :persistent? true)
+      (zk/create-all conn (ack-log-path) :persistent? true)
+      (zk/create-all conn (evict-log-path) :persistent? true)
+      (zk/create-all conn (offer-log-path) :persistent? true)
+      (zk/create-all conn (revoke-log-path) :persistent? true)
+      (zk/create-all conn (exhaust-log-path) :persistent? true)
+      (zk/create-all conn (seal-log-path) :persistent? true)
+      (zk/create-all conn (complete-log-path) :persistent? true)
+      (zk/create-all conn (shutdown-log-path) :persistent? true)
+
       (assoc component :server server :conn conn :prefix (:onyx/id opts))))

   (stop [component]


Claen up checker, check for trigger/emit success.

--- src/onyx_jepsen/checker.clj
+++ src/onyx_jepsen/checker.clj
@@ -11,18 +11,10 @@
             [clojure.core.async :as casync :refer [chan >!! <!! close! alts!!]]
             [clojure.tools.logging :refer :all]))

-(defn base-replica [peer-config]
-  (merge replica/base-replica
-         {:job-scheduler (:onyx.peer/job-scheduler peer-config)
-          :messaging (select-keys peer-config [:onyx.messaging/impl])}))
-
-(defn playback-log [peer-config peer-log-reads]
+(defn playback-log [{:keys [base-replica entries] :as m}]
   (reduce #(onyx.extensions/apply-log-entry %2 %1)
-          (base-replica peer-config)
-          peer-log-reads))
-
-(comment (playback-log (clojure.edn/read-string (slurp "resources/prod-peer-config.edn"))
-                       (clojure.edn/read-string (slurp "/Users/lucas/clojure/onyx-jepsen/store/onyx-aggregation-test/20160626T165221.000Z/log.edn"))))
+          base-replica
+          entries))

 (defn pulses [conn peer-config]
   (onyx.log.curator/children conn (onyx.log.zookeeper/pulse-path (:onyx/tenancy-id peer-config))))
@@ -43,11 +35,14 @@
                          :read-results (:results r)})
                       reads)))))

+(defn emitted-segment? [segment]
+  (= :emitted (:type segment)))
+
 (defn reads-correct-jobs? [job+reads]
   (empty?
     (remove (fn [{:keys [read-results job-num]}]
               (or (empty? read-results)
-                  (= #{job-num} (set (map :job-num read-results)))))
+                  (= #{job-num} (set (map :job-num (remove emitted-segment? read-results))))))
             job+reads)))

 (defn job-exception [log-conn final-replica]
@@ -61,7 +56,7 @@
           history))

 (defn highest-timestamped-write
-  "Grabs the trigger write with the highest timstamp value in it.
+  "Grabs the trigger write with the highest timestamp value in it.
    Currently unused as we now support job-completed trigger events, but we may use this later
    if we want to track writes over the job's duration"
   [trigger-ledger-reads]
@@ -71,14 +66,14 @@
        last
        last))

-(defn single-trigger-write
+(defn final-trigger-write
   "Reads the results of a single trigger ledger write.
    Assumes only one trigger call has been made"
   [trigger-ledger-reads]
-  (let [;; only one job in this test, should be lots of empty ledgers and only one write
-        job-triggers (vec (remove (comp empty? :results)
+  (let [job-triggers (vec (remove (comp empty? :results)
                                   (get (:value trigger-ledger-reads) 0)))]
-    (assert (= 1 (count job-triggers)) (str job-triggers))
+    ;; final trigger write may occur multiple times if job isn't sealed before a peer crashes
+    ;; this checks that all the trigger writes are the same
     (->> (first job-triggers)
          :results
          last
@@ -104,7 +99,9 @@
                    :unacknowledged-writes-read unacked-writes-read
                    :job-exception-message (some-> exception (.getMessage))
                    :job-exception-trace (if exception (with-out-str (clojure.stacktrace/print-stack-trace exception)))}
-     :invariants {:job-completed? (nil? exception)
+     :invariants {:job-completed? (and (nil? exception)
+                                       (= (count (:completed-jobs final-replica))
+                                          n-jobs))
                   :reads-correct-jobs? correct-jobs?
                   :all-written-read? all-written-read?}}))

@@ -113,7 +110,7 @@
         ledger-reads (first (history->read-ledgers history :persist))
         trigger-ledger-reads (first (history->read-ledgers history :annotate-job))
         ;; TODO: Don't need the sort any more - trigger only called on job-complete
-        final-window-state-write (single-trigger-write trigger-ledger-reads)
+        final-window-state-write (final-trigger-write trigger-ledger-reads)
         window-state-filtered? (= (count final-window-state-write)
                                   (count (set final-window-state-write)))
         ledger-read-results (ledger-reads->job+reads ledger-reads)
@@ -124,17 +121,30 @@
         read-values (->> ledger-read-results
                          (mapcat :read-results)
                          (map #(dissoc % :job-num))
+                         ;; values sent down not via trigger sync
+                         (remove emitted-segment?)
                          set)
+        trigger-emitted-values (->> ledger-read-results
+                                    (mapcat :read-results)
+                                    (map #(dissoc % :job-num))
+                                    ;; values sent down not via trigger sync
+                                    (filter emitted-segment?)
+                                    (mapcat :ids)
+                                    set)
         diff-added-read (clojure.set/difference added-values read-values)
         all-added-read? (empty? diff-added-read)
         written-not-triggered (clojure.set/difference (set (map :id added-values))
                                                       (set final-window-state-write))
         all-added-triggered? (empty? written-not-triggered)
+        added-not-emitted (clojure.set/difference (set (map :id added-values))
+                                                  (set trigger-emitted-values))
+        all-added-emitted? (empty? added-not-emitted)
         unacked-writes-read (clojure.set/difference read-values added-values)]
     {:information {:read-values read-values
                    :diff-added-read diff-added-read
                    :unacknowledged-writes-read unacked-writes-read
                    :added-not-triggered written-not-triggered
+                   :added-not-emitted added-not-emitted
                    :job-exception-message (some-> exception (.getMessage))
                    :job-exception-trace (if exception
                                           (with-out-str (clojure.stacktrace/print-stack-trace exception)))}
@@ -144,6 +154,8 @@
                                            n-jobs))
                   :reads-correct-jobs? correct-jobs?
                   :all-added-triggered? all-added-triggered?
+                  ;; FIXME: all-added-emitted? is currently broken by job-complete not flushing remaining segments.
+                  ;:all-added-emitted? all-added-emitted?
                   :all-added-read? all-added-read?}}))

 ;; TODO, check whether the jobs were even submitted, if not, nothing should be read back
@@ -157,7 +169,7 @@
                                                   (and (= (:f action) :read-peer-log)
                                                        (= (:type action) :ok)))
                                                 history)))
-          final-replica (playback-log peer-config peer-log-reads)
+          final-replica (playback-log peer-log-reads)
           peer-client (component/start (system/onyx-client peer-config))
           log-conn (:log peer-client)
           all-peers-up? (= (count (:peers final-replica))


load_all.clj: removed references to internal libs

--- src/org/altlaw/load_all.clj
+++ src/org/altlaw/load_all.clj
@@ -1,7 +1,5 @@
 (ns org.altlaw.load-all
   (:require
-   org.altlaw.internal.application
-
    org.altlaw.jobs.distindex
    org.altlaw.jobs.genhtml
    org.altlaw.jobs.getindexes
@@ -19,11 +17,6 @@
    org.altlaw.jobs.procfiles.profed
    org.altlaw.jobs.procfiles.profed-map

-   org.altlaw.test.internal
-   org.altlaw.test.internal.idserver.impl
-   org.altlaw.test.internal.idserver.client
-   org.altlaw.test.internal.privacy.impl
-   org.altlaw.test.internal.privacy.client
    org.altlaw.test.run
    org.altlaw.test.www
    org.altlaw.test.www.search


use map args for piano inst

use map args for piano inst

--- src/overtone/inst/piano.clj
+++ src/overtone/inst/piano.clj
@@ -19,20 +19,20 @@
                 random 0.1
                 stretch 0.1
                 sustain 0.1]
-  (let [snd (apply mda-piano [:freq (midicps note)
-                              :gate gate
-                              :vel vel
-                              :decay decay
-                              :release release
-                              :hard hard
-                              :velhard velhard
-                              :muffle muffle
-                              :velmuff velmuff
-                              :velcurve velcurve
-                              :stereo stereo
-                              :tune tune
-                              :random random
-                              :stretch stretch
-                              :sustain sustain])]
+  (let [snd (mda-piano {:freq (midicps note)
+                        :gate gate
+                        :vel vel
+                        :decay decay
+                        :release release
+                        :hard hard
+                        :velhard velhard
+                        :muffle muffle
+                        :velmuff velmuff
+                        :velcurve velcurve
+                        :stereo stereo
+                        :tune tune
+                        :random random
+                        :stretch stretch
+                        :sustain sustain})]
     (detect-silence snd 0.005 :action FREE)
     (* 1 snd))) ;;TODO: figure out why this mul is required


add simple-flute synth

add simple-flute synth

(translated from https://github.com/supercollider-quarks/SynthDefPool/blob/master/pool/apad_mh.scd)

--- src/overtone/inst/synth.clj
+++ src/overtone/inst/synth.clj
@@ -4,6 +4,23 @@
         [overtone.sc.machinery.ugen.fn-gen]
         [overtone.music pitch]
         [overtone.studio mixer inst]))
+
+;; translated from: https://github.com/supercollider-quarks/SynthDefPool/blob/master/pool/apad_mh.scd
+(definst simple-flute [freq 880
+                       amp 0.5
+                       attack 0.4
+                       decay 0.5
+                       sustain 0.8
+                       release 1
+                       gate 1
+                       out 0]
+  (let [env  (env-gen (adsr attack decay sustain release) gate amp :action FREE)
+        mod1 (lin-lin:kr (sin-osc:kr 6) -1 1 (* freq 0.99) (* freq 1.01))
+        mod2 (lin-lin:kr (lf-noise2:kr 1) -1 1 0.2 1)
+        mod3 (lin-lin:kr (sin-osc:kr (ranged-rand 4 6)) -1 1 0.5 1)
+        sig (distort (* env (sin-osc [freq mod1])))
+        sig (* sig mod2 mod3)]
+    sig))

 ;;modified version of: https://github.com/supercollider-quarks/SynthDefPool/blob/master/pool/cs80lead_mh.scd
 (definst cs80lead


Show filename above 'choose file' button.

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1354,14 +1354,14 @@
                                                     (.preventDefault %)
                                                     (om/set-state! owner :drag-over? false)
                                                     (file-selected-fn (aget % "dataTransfer" "files" 0)))}
-             [:div "Drop your files here or click " [:b "Choose file"] " below to select them manually!"]
+             (if file-name
+               [:div file-name]
+               [:div "Drop your files here or click " [:b "Choose file"] " below to select them manually!"])
              [:input#hidden-p12-file-input {:type "file"
                                             :on-change #(file-selected-fn (aget % "target" "files" 0))}]
              [:label.p12-file-input {:for "hidden-p12-file-input"}
               [:i.material-icons "file_upload"]
-              (if file-name
-                file-name
-                "Choose file")]]]
+                "Choose file"]]]

            [:hr]
            [:div.buttons


reverted some accidental refactoring of project-model/usable-containers to project-model/linux-containers

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -212,7 +212,7 @@
    (when (and (> parallelism 1) (project-model/osx? project)) ["disabled"])
    (when (> parallelism (project-model/buildable-parallelism plan project)) ["disabled"])
    (when (= parallelism (get-in project-data [:project :parallel])) ["selected"])
-   (when (not= 0 (mod (project-model/linux-containers plan project) parallelism)) ["bad_choice"])))
+   (when (not= 0 (mod (project-model/usable-containers plan project) parallelism)) ["bad_choice"])))

 (defn parallelism-tile
   "Determines what we show when they hover over the parallelism option"
@@ -258,9 +258,9 @@

      ;; Tell them to upgrade when they're using more parallelism than their plan allows,
      ;; but only on the tiles between (allowed parallelism and their current parallelism]
-     (when (and (> (:parallel project) (project-model/linux-containers plan project))
+     (when (and (> (:parallel project) (project-model/usable-containers plan project))
                 (>= (:parallel project) parallelism)
-                (> parallelism (project-model/linux-containers plan project)))
+                (> parallelism (project-model/usable-containers plan project)))
        [:div.insufficient-minimum
         "Unsupported. Upgrade or lower parallelism."
         [:i.fa.fa-question-circle {:title (str "You need " parallelism " containers on your plan to use "


fix :file handling

fix :file handling

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -31,7 +31,7 @@
              [collect-keywords :refer [collect-keywords]]
              [analyze-host-expr :refer [analyze-host-expr]]]
             [clojure.tools.analyzer.js.utils
-             :refer [desugar-ns-specs validate-ns-specs ns-resource source-path res-path]]
+             :refer [desugar-ns-specs validate-ns-specs ns-resource ns->relpath res-path]]
             [cljs
              [tagged-literals :as tags]
              [js-deps :as deps]]
@@ -496,10 +496,11 @@
   (env/ensure (global-env)
     (let [res (ns-resource ns)]
       (assert res (str "Can't find " ns " in classpath"))
-      (let [filename (source-path res)
+      (let [filename (ns->relpath ns)
             path (res-path res)]
         (when-not (get-in *env* [::analyzed-cljs path])
-          (binding [*ns* *ns*]
+          (binding [*ns*   *ns*
+                    *file* filename]
             (with-open [rdr (io/reader res)]
               (let [pbr (readers/indexing-push-back-reader
                          (java.io.PushbackReader. rdr) 1 filename)


made run-passes dynamic

made run-passes dynamic

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -267,7 +267,7 @@
      (when metadata
        {:meta metadata}))))

-(defn run-passes [ast]
+(defn ^:dynamic run-passes [ast]
   (binding [elides (into #{:line :column :end-line :end-column :file :source} elides)]
     (-> ast


improved error message

improved error message

--- src/selmer/validator.clj
+++ src/selmer/validator.clj
@@ -48,9 +48,7 @@
            (if (= tag-name (last end-tags))
              tags (conj tags (assoc tag :line line)))
            (exception
-             "Orphaned closing tag " (format-tag tag) " on line " line
-             ", tag " (format-tag last-tag) " on line " (:line last-tag) " was not closed "
-             "for template " template)))
+             "Tag " (format-tag last-tag)" was not closed on line " (:line last-tag) "for template " template)))

        (get @closing-tags tag-name)
        (conj tags (assoc tag :line line))


Using the fancier rpath flags for readline

--- config/software/readline.clj
+++ config/software/readline.clj
@@ -16,13 +16,25 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
+(let [env
+      (cond
+       (and (is-os? "darwin") (is-machine? "x86_64"))
+       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
+         "LDFLAGS" "-R/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
+       (is-os? "linux")
+       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
+         "LDFLAGS" "-Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
+       (is-os? "solaris2")
+       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
+         "LDFLAGS" "-Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
+       )
+      ]

-(software "readline" :source "readline-5.2"
-          :steps [{
-                   :env {"LDFLAGS" "-R/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
-                         "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
-                   :command "./configure"
-                   :args ["--prefix=/opt/opscode/embedded"]
-                   }
-                  {:command "make"}
-                  {:command "make" :args ["install"]}])
+  (software "readline" :source "readline-5.2"
+            :steps [{
+                     :env env
+                     :command "./configure"
+                     :args ["--prefix=/opt/opscode/embedded"]
+                     }
+                    {:command "make"}
+                    {:command "make" :args ["install"]}]))


removed info from comments, added event number if any and added round presentation strings

--- src/tango/cljs/main.cljs
+++ src/tango/cljs/main.cljs
@@ -261,18 +261,20 @@

 (def round-map
   {:none ""
-   :normal-x "Normal" :semifinal-x "Semifinal" :final-x "Final" :b-final-x "-" :retry-x "Retry" :second-try-x "2nd try"
-   :normal-1-5 "-" :semifinal-1-5 "-" :retry-1-5 "-" :second-try-1-5 "-"
-   :normal-3d "-" :semifinal-3d "-" :retry-3d "-" :second-try-3d "-"
-   :normal-a+b "-" :semifinal-a+b "-" :final-a+b "-" :b-final-a+b "-" :retry-a+b "-" :second-try-a+b "-"
-   :presentation "-"})
+   :normal-x "Normal" :semifinal-x "Semifinal" :final-x "Final"
+   :b-final-x "B-Final" :retry-x "Retry" :second-try-x "2nd try"
+
+   :normal-1-5 "Normal 1-5" :semifinal-1-5 "Semifinal 1-5" :retry-1-5 "Retry 1-5" :second-try-1-5 "2nd try 1-5"
+
+   :normal-3d "Normal 3D" :semifinal-3d "Semifinal 3D" :retry-3d "Retry 3D" :second-try-3d "2nd try 3D"
+
+   :normal-a+b "Normal A+B" :semifinal-a+b "Semifinal A+B" :final-a+b "Final A+B"
+   :b-final-a+b "B-Final A+B" :retry-a+b "Retry A+B" :second-try-a+b "2nd try A+B"
+
+   :presentation "Presentation"})

 (defn make-event-round-presentation [event-round]
-  (get round-map event-round)
-  ;; (condp = event-round
-  ;;   :unknown-round-value "Okänd Runda"
-  ;;   :normal-x "Normal")
-  )
+  (get round-map event-round))

 (defn make-round-presentation [round-status round-count]
   (str
@@ -384,7 +386,7 @@

           [:tr
            [:td (make-event-time-presentation (:event/time event) (:event/status event))]
-           [:td (if (or comment-row? (= (:event/number event) -1)) "" (:event/number event))]
+           [:td (if (or  (= (:event/number event) -1)) "" (:event/number event))]
            ;; use comment if class number is zero
            [:td
             (let [t (vec (:competition/classes (:competition @app-state)))]
@@ -424,7 +426,7 @@
               (str (:event/heats event) " heats"))]

            [:td
-            (if (zero? (:event/recall event))
+            (if (or (zero? (:event/recall event)) comment-row?)
               ""
               (str "Recall " (:event/recall event)))]

@@ -437,7 +439,10 @@
                   "All adj"
                   (str "Panel " panel))))]

-           [:td (make-dance-type-presentation (:event/dances event))]])))]]])
+           [:td
+            (if comment-row?
+              ""
+              (make-dance-type-presentation (:event/dances event)))]])))]]])

 ; :selected-page :import
 (defn menu-component []


Update TODOs

Update TODOs

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -65,23 +65,18 @@
             java.nio.ByteBuffer))

 ;;;; TODO
-;; * Code walk-through.
-;; * Go through Rotary PRs.
-;; * Go through Rotary non-PR forks.
-;; * Nippy support.
-;; * More consistent string/keyword-ization.
+;; * Finish up code walk-through.
+;; * Go through Rotary PRs, non-PR forks.
+;; * Consistent string/keyword-ization.
+;; * Nippy support (`serialized`, `binary`) types with marked bin data.
+;; * README docs.
+;; * Benchmarks.
 ;; * Further tests.
-;; * Docs!
-;; * Benching.
 ;; * Parallel scans.
 ;; * Async API.
 ;; * Auto throughput adjusting.

 ;;;; Coercion - values
-
-;; TODO Nippy support (will require special marker bin-wrapping), incl.
-;; Serialized (boxed) type (should allow empty strings & ANY type of set)
-;; Maybe require special wrapper types for writing bins/serialized

 (defn- str->num [^String s] (if (.contains s ".") (Double. s) (Long. s)))
 (defn- bb->ba   [^ByteBuffer bb] (.array bb))