Move definition of 'given' up above usage in describe

--- src/main/clojure/lazytest/describe.clj
+++ src/main/clojure/lazytest/describe.clj
@@ -60,6 +60,14 @@
   children are test cases (see 'it') or nested test suites (see 'testing')"
   [& decl]
   `(def ~(gensym) (testing ~@decl)))
+
+(defmacro given
+  "Like 'let' but returns the expressions of body in a list.
+  Suitable for nesting inside 'describe' or 'testing'."
+  [bindings & body]
+  {:pre [(vector? bindings)
+	 (even? (count bindings))]}
+  `(let ~bindings (list ~@body)))

 (defmacro for-any
   "Bindings is a vector of name-value pairs, where the values are
@@ -141,11 +149,3 @@
     `(test-case (with-meta
 		  (fn [] ~@body)
 		  ~metadata))))
-
-(defmacro given
-  "Like 'let' but returns the expressions of body in a list.
-  Suitable for nesting inside 'describe' or 'testing'."
-  [bindings & body]
-  {:pre [(vector? bindings)
-	 (even? (count bindings))]}
-  `(let ~bindings (list ~@body)))


Use threading operator to improve readability

--- src/com/puppetlabs/puppetdb/query/event_counts.clj
+++ src/com/puppetlabs/puppetdb/query/event_counts.clj
@@ -182,7 +182,5 @@
    {:pre  [(string? sql)]
     :post [(map? %)
            (vector? (:result %))]}
-    (update-in
-      (execute-query (apply vector sql params) paging-options)
-      [:result]
-      (partial munge-subjects summarize-by))))
+    (-> (execute-query (apply vector sql params) paging-options)
+      (update-in [:result] (partial munge-subjects summarize-by)))))


https link for the gif

https link for the gif

--- src/pc/views/blog/optimizing_om_applications.clj
+++ src/pc/views/blog/optimizing_om_applications.clj
@@ -72,7 +72,7 @@
      [:p "Every mount and update gets stored to keep track of average and maximum render times."]]

     ;; n.b. that this image is only stored in the CDN, it's not available locally
-    [:figure [:img {:src "http://dtwdl3ecuoduc.cloudfront.net/om-i/om-i-demo.gif"}]]
+    [:figure [:img {:src "https://dtwdl3ecuoduc.cloudfront.net/om-i/om-i-demo.gif"}]]

     [:article
      [:p


(PDB-4807) Respect any write db specific gc settings

Previously we always refered to the (:database ...) settings, and
ignored any that might be set for a specific write db.

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -316,25 +316,26 @@
 (defn- clean-puppetdb
   "Implements the PuppetDBServer clean method, see the protocol for
   further information."
-  [context config what]
+  [context what]
   ;; For now, just serialize them.
   ;; FIXME: improve request results wrt multiple databases?
   (let [lock (:clean-lock context)]
     (when (.tryLock lock)
       (try
         (loop [[db & dbs] (get-in context [:shared-globals :scf-write-dbs])
+               [cfg & cfgs] (get-in context [:shared-globals :scf-write-db-cfgs])
                ex nil]
           (if-not db
             (if-not ex
               true
               (throw ex))
             (let [ex (try
-                       (clean-up db lock (:database config) what)
+                       (clean-up db lock cfg what)
                        ex
                        (catch Exception db-ex
                          (when ex (.addSuppressed ex db-ex))
                          (or ex db-ex)))]
-              (recur dbs ex))))
+              (recur dbs cfgs ex))))
         (finally
           (.unlock lock))))))

@@ -797,6 +798,7 @@
                      :q q
                      :scf-read-db read-db
                      :scf-write-dbs write-db-pools
+                     :scf-write-db-cfgs write-db-cfgs
                      :scf-write-db-names write-db-names}))))))

 (defn db-unsupported-msg
@@ -969,7 +971,7 @@
                                      row-callback-fn)))

   (clean [this] (clean this #{}))
-  (clean [this what] (clean-puppetdb (service-context this) (get-config) what))
+  (clean [this what] (clean-puppetdb (service-context this) what))

   (delete-node [this certname]
                (delete-node-from-puppetdb (service-context this) certname))


Tables: return to page 1 when TextFilter applied

--- src/cljs/main/broadfcui/common/table/table.cljs
+++ src/cljs/main/broadfcui/common/table/table.cljs
@@ -116,7 +116,7 @@
              [:div {:style (:style filter-bar-props)}
               [comps/TextFilter (merge
                                  {:initial-text (:filter-text query-params)
-                                  :on-filter #(swap! state update :query-params assoc :filter-text %)}
+                                  :on-filter #(swap! state update :query-params assoc :filter-text % :page-number 1)}
                                  (:inner filter-bar-props))]]))
          (list* (:items toolbar))]
         [:div {:style {:overflowX "auto"}}


Support plain text param in api to post as an alternative to evaluating a command

--- src/yetibot/core/webapp/routes/api.clj
+++ src/yetibot/core/webapp/routes/api.clj
@@ -23,19 +23,19 @@
      ; e.g. 'yetibot.core.adapters.slack/*target*
      (symbol (str adapter-ns) "*target*")]))

-(defn api [{:keys [chat-source command token] :as params} req]
+(defn api [{:keys [chat-source text command token] :as params} req]
   (info "/api called with params:" params)
   (info "/api request:" req)
   (when-let [body (:body req)] (info "/api body:" (slurp body)))
   (cond
     (empty? chat-source) "chat-source parameter is required!"
-    (empty? command) "command parameter is required!"
+    (and (empty? command) (empty? text)) "command or text parameter is required!"
     :else (if-let [chat-source (edn/read-string chat-source)]
             (do
               (info "chat-source" chat-source)
               (let [user {:username "api"}
                     room (:room chat-source)
-                    res (handle-unparsed-expr chat-source user command)
+                    res (or text (handle-unparsed-expr chat-source user command))
                     [messaging-fns *target*] (determine-messaging-fns-and-target chat-source)]
                 (binding [*messaging-fns* @messaging-fns
                           *chat-source* chat-source]


tweak release-snapshot table

tweak release-snapshot table

--- src/main/shadow/cljs/devtools/release_snapshot.clj
+++ src/main/shadow/cljs/devtools/release_snapshot.clj
@@ -15,43 +15,34 @@
   (pprint/print-table ks rows)
   (print "\u001B[m"))

-(defn short-resource-name [resource-name]
-  (cond
-    (str/includes? resource-name "node_modules")
-    (second (str/split resource-name #"/"))
-    :else resource-name))
-
 (defn get-optimized-info [build-modules]
   (->> build-modules
-       (map (fn [module]
-              (->> (:source-bytes module)
-                   (map (fn [[module-name bytes]] [module-name {:optimized-size bytes}]))
-                   (into {}))))
+       (map :source-bytes)
        (reduce (partial merge-with +))))

-(defn get-unoptimized-info [build-sources]
-  (reduce
-    (fn [m x]
-      (assoc m (:resource-name x) (select-keys x [:js-size :source-size])))
-    {}
-    build-sources))
-
 (defn get-bundle-summary [{:keys [build-modules build-sources] :as bundle-info}]
-  (let [optimized (get-optimized-info build-modules)
-        raw (get-unoptimized-info build-sources)
-        merged (build/deep-merge optimized raw)]
-    (->> merged
-         (group-by (fn [[k _]] (short-resource-name k)))
-         (map (fn [[k v]]
-                (let [resource-totals (->> v (map second) (reduce (partial merge-with +)))]
-                  (assoc resource-totals :short-resource-name k)))))))
+  (let [optimized (get-optimized-info build-modules)]
+    (->> build-sources
+         (map (fn [{:keys [package-name resource-name js-size source-size]}]
+                {:group (or package-name resource-name)
+                 :js-size js-size
+                 :source-size source-size
+                 :optimized-size (get optimized resource-name 0)}))
+         (group-by :group)
+         (map (fn [[group items]]
+                (->> items
+                     (map #(dissoc % :group))
+                     (reduce (partial merge-with +) {:group group}))))
+         (into [])
+         )))

 (defn print-bundle-info-table [bundle-info]
   (->> (get-bundle-summary bundle-info)
-       (sort-by #(or (:optimized-size %) 0) >)
-       (map (fn [{:keys [short-resource-name source-size js-size optimized-size]}]
-              {"Resource name" short-resource-name
-               "Optimized size" (some-> optimized-size (format-byte-size))
-               "Source size" (some-> source-size (format-byte-size))
-               "JS size" (some-> js-size (format-byte-size))}))
-       (print-table ["Resource name" "Optimized size" "JS size" "Source size"])))
+       (remove #(zero? (:optimized-size %)))
+       (sort-by :optimized-size >)
+       (map (fn [{:keys [group source-size js-size optimized-size]}]
+              {"Source" group
+               "Optimized size" (when (pos? optimized-size) (format-byte-size optimized-size))
+               "Source size" (format-byte-size source-size)
+               "JS size" (format-byte-size js-size)}))
+       (print-table ["Source" "Optimized size" "JS size" "Source size"])))


Refer to the var, to make sure changes are picked up


Removed obsolete code.

Removed obsolete code.

--- umm-lib/src/cmr/umm/validation/parent_weaver.clj
+++ umm-lib/src/cmr/umm/validation/parent_weaver.clj
@@ -48,11 +48,6 @@
     [obj parent]
     (assoc obj :parent parent))

-  java.util.List
-  (set-parent
-    [obj parent]
-    (map #(set-parent % parent) obj))
-
   PlatformRef
   (set-parent
     [platform-ref platform]


Generate a random measurement

Generate a random measurement

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -631,9 +631,36 @@
        :W (make-measurement typical-energy power-unit) ;; assume energy expended for 1 s
        :hp (power-as (typical-power :W) :hp)))))

+(def quantity-generate-measurement-map
+  {:density                typical-density
+   :energy                 typical-total-pump-energy
+   :force                  typical-force
+   :length                 typical-stage-length
+   :mass                   typical-proppant-mass
+   :power                  typical-power
+   :pressure               typical-surface-treating-pressure
+   :proppant-concentration typical-proppant-concentration
+   :temperature            typical-monitor-temperature
+   :slurry-rate            typical-slurry-rate
+   :volume                 typical-pumped-volume})
+
 (defn generate-measurement-pair [units generate-units-f generate-measurement-f measurement-as-f]
   (let [unit (generate-units-f)
         measurement (generate-measurement-f unit)]
     [measurement (measurement-as-f measurement (first (remove (partial = unit) units)))]))

 (generate-measurement-pair #{:bpm :m3-per-min} rand-slurry-rate-unit typical-slurry-rate slurry-rate-as)
+
+(defn rand-measurement
+  ([]
+   (rand-measurement (rand-physical-quantity)))
+  ([physical-quantity]
+   (println physical-quantity)
+   ((quantity-generate-measurement-map physical-quantity) (rand-unit physical-quantity))))
+
+(rand-measurement)
+
+
+
+(rand-measurement)
+


autosuggest->react-autosuggest

autosuggest->react-autosuggest

--- src/cljs/swarmpit/component/service/form_settings.cljs
+++ src/cljs/swarmpit/component/service/form_settings.cljs
@@ -29,7 +29,7 @@
      :InputLabelProps {:shrink true}}))

 (defn- form-image-tag-r [value tags tagMenuSuggestions]
-  (comp/autosuggest
+  (comp/react-autosuggest
     {:renderInputComponent        (fn [inputProps]
                                     (let [{:keys [ref] :as p} (keywordize-keys (js->clj inputProps))]
                                       (comp/text-field
@@ -50,10 +50,10 @@
                                     (comp/menu-item
                                       {:key      s
                                        :selected (goog.object/get props "isHighlighted")} s))
-     :renderSuggestionsContainer  (fn [options]
-                                    (comp/paper
-                                      (merge {:square true} (keywordize-keys (goog.object/get options "containerProps")))
-                                      (goog.object/get options "children")))
+     ;:renderSuggestionsContainer  (fn [options]
+     ;                               (comp/paper
+     ;                                 (merge {:square true} (keywordize-keys (goog.object/get options "containerProps")))
+     ;                                 (goog.object/get options "children")))
      :theme                       {:container                {:position "relative"}
                                    :suggestionsContainerOpen {:position  "absolute"
                                                               :zIndex    1


starting with a clear range

starting with a clear range

--- test/celestial/integration/proxmox.clj
+++ test/celestial/integration/proxmox.clj
@@ -1,6 +1,7 @@
 (ns celestial.integration.proxmox
   "Integration tests assume a proxmox vm with local address make sure to configure it"
   (:require
+     [hypervisors.networking :refer (clear-range)]
      [supernal.sshj :refer (execute)]
      [flatland.useful.map :refer (dissoc-in*)]
      [celestial.common :refer (slurp-edn)]
@@ -31,28 +32,29 @@
     (.stop ct*)
     (.delete ct*)))

-(fact "non generated" :integration :proxmox
-  (with-conf
-    (running-seq (vconstruct redis-prox-spec))))
+(with-conf
+  (with-state-changes [(before :facts (clear-range :proxmox))]
+    (fact "non generated" :integration :proxmox
+       (running-seq (vconstruct redis-prox-spec)))

-(fact "ip and vmid generated" :integration :proxmox
-   (with-conf
-    (running-seq
-      (vconstruct (-> redis-prox-spec (dissoc-in* [:machine :ip]) (dissoc-in* [:proxmox :vmid]))))))
+    (fact "ip and vmid generated" :integration :proxmox
+       (running-seq
+         (vconstruct (-> redis-prox-spec (dissoc-in* [:machine :ip]) (dissoc-in* [:proxmox :vmid])))))

-(fact "bridged" :integration :proxmox :bridge
-   (with-conf
-      (running-seq (vconstruct redis-bridged-prox))))
+    (fact "bridged" :integration :proxmox :bridge
+       (running-seq (vconstruct redis-bridged-prox)))

-(fact "cluster" :integration :proxmox :bridge :cluster
-   (with-conf clustered-prox
-      (running-seq (vconstruct (assoc-in redis-bridged-prox [:proxmox :node] "proxmox-b")))))
+    (fact "cluster" :integration :proxmox :bridge :cluster
+       (with-conf clustered-prox
+          (running-seq (vconstruct (assoc-in redis-bridged-prox [:proxmox :node] "proxmox-b")))))

-#_(fact "proxmox 3" :integration :proxmox-3
-   (with-conf proxmox-3
-     (running-seq (vconstruct (assoc-in redis-bridged-prox [:proxmox :node] "proxmox-3")))))
+  #_(fact "proxmox 3" :integration :proxmox-3
+       (with-conf proxmox-3
+           (running-seq (vconstruct (assoc-in redis-bridged-prox [:proxmox :node] "proxmox-3")))))

-(fact "centos bridge" :integration :proxmox :bridge :centos
-    (with-conf clustered-prox
-      (running-seq (vconstruct (assoc-in redis-bridged-prox [:machine :os] :centos-6)))))
+    (fact "centos bridge" :integration :proxmox :bridge :centos
+       (with-conf clustered-prox
+          (running-seq (vconstruct (assoc-in redis-bridged-prox [:machine :os] :centos-6)))))))

+
+


teach osc validator how to print out a nil type

--- src/overtone/sc/machinery/server/osc_validator.clj
+++ src/overtone/sc/machinery/server/osc_validator.clj
@@ -272,7 +272,18 @@
         (throw (IllegalArgumentException. err-string))))

     (when-let [[err-type err-arg] (error-args sig args)]
-      (let [err-string (str "Failed attempting to send an OSC message to SuperCollider server. Reason: incorrect arglist type in OSC message " path ". Expected " (description err-type) " found " (type err-arg) ". Message name: " path " Type sig: " sig " Arg list: " args)]
+      (let [err-string (str "Failed attempting to send an OSC message to SuperCollider server. Reason: incorrect arglist type in OSC message "
+                            path
+                            ". Expected "
+                            (description err-type)
+                            " found "
+                            (with-out-str (pr (type err-arg)))
+                            ". Message name: "
+                            path
+                            " Type sig: "
+                            sig
+                            " Arg list: "
+                            args)]
         (log/error err-string)
         (throw (IllegalArgumentException. err-string))))


Cleanup and update for message -> segments lifecycle calls rename

--- test/onyx/plugin/bench_plugin_test.clj
+++ test/onyx/plugin/bench_plugin_test.clj
@@ -5,6 +5,7 @@
             [onyx.plugin.bench-plugin]
             [onyx.static.logging-configuration :as log-config]
             [onyx.plugin.core-async]
+            [onyx.test-helper :refer [load-config]]
             [interval-metrics.core :as im]
             [onyx.api])
   (:import [onyx.plugin RandomInputPlugin]))
@@ -13,76 +14,47 @@

 (def scheduler :onyx.job-scheduler/balanced)

-(def messaging :aeron)
+(def id (java.util.UUID/randomUUID))

-(def env-config
-  {:zookeeper/address "127.0.0.1:2189"
-   :zookeeper/server? true
-   :zookeeper.server/port 2189
-   :onyx/id id
-   :onyx.peer/job-scheduler scheduler})
+(def config (load-config))

-(def pending-timeout 60000)
+(def env-config (assoc (:env-config config) :onyx/id id))
+(def peer-config (assoc (:peer-config config) :onyx/id id))

-(def peer-config
-  {:zookeeper/address "127.0.0.1:2189"
-   :onyx/id id
-   :onyx.messaging/ack-daemon-timeout pending-timeout
-   ;:onyx.messaging.aeron/offer-idle-strategy :low-restart-latency
-   ;:onyx.messaging.aeron/poll-idle-strategy :low-restart-latency
-   :onyx.messaging/bind-addr "127.0.0.1"
-   :onyx.messaging/peer-ports (vec (range 40000 40200))
-   :onyx.peer/job-scheduler scheduler
-   :onyx.messaging/impl messaging})
-
-
-(println "Starting env")
 (def env (onyx.api/start-env env-config))

 (def peer-group
   (onyx.api/start-peer-group peer-config))

 (def batch-size 20)
-(def batch-timeout 100)
-
-; (defn test-input [segment]
-;   (println "Input called on " segment)
-;   segment)
+(def batch-timeout 10)

 (defn my-inc [{:keys [n] :as segment}]
-  ;(info "Received segment " segment)
-  #_(when (zero? (rand-int 100000))
-    (Thread/sleep 2000))
   (assoc segment :n (inc n)))

 (def catalog
   [{:onyx/name :in
     :onyx/plugin :onyx.plugin.bench-plugin/generator
-    ;:onyx/ident :onyx.plugin.RandomInputPlugin
     :onyx/type :input
     :onyx/medium :generator
     :onyx/max-pending 50000
-    :onyx/pending-timeout pending-timeout
     :onyx/batch-timeout batch-timeout
     :onyx/batch-size batch-size}

    {:onyx/name :inc1
     :onyx/fn :onyx.plugin.bench-plugin-test/my-inc
-    ;:onyx/fn :onyx.plugin.JavaFn/testFn
     :onyx/type :function
     :onyx/batch-timeout batch-timeout
     :onyx/batch-size batch-size}

    {:onyx/name :inc2
     :onyx/fn :onyx.plugin.bench-plugin-test/my-inc
-    ;:onyx/fn :onyx.plugin.JavaFn/testFn
     :onyx/type :function
     :onyx/batch-timeout batch-timeout
     :onyx/batch-size batch-size}

    {:onyx/name :inc3
     :onyx/fn :onyx.plugin.bench-plugin-test/my-inc
-    ;:onyx/fn :onyx.plugin.JavaFn/testFn
     :onyx/type :function
     :onyx/batch-timeout batch-timeout
     :onyx/batch-size batch-size}
@@ -101,27 +73,25 @@
     :onyx/batch-size batch-size
     :onyx/doc "Drops messages on the floor"}])

-
-;; TO TEST
-
 (def workflow [[:in :inc1]
                [:inc1 :inc2]
                [:inc2 :inc3]
                [:inc3 :inc4]
                [:inc4 :no-op]])

-
-(println "starting Vpeers")
+(println "Starting Vpeers")
 (def v-peers (onyx.api/start-peers 6 peer-group))

 (println "Started vpeers")
-(def bench-length 300000)
+(def bench-length 120000)

 (def messages-tracking (atom {}))
 (def rate+latency (im/rate+latency {:rate-unit :nanoseconds
                                     :latency-unit :nanoseconds}))
 (def retry-counter
   (atom (long 0)))
+
+(def total-segments (atom 0))

 (Thread/sleep 10000)

@@ -159,7 +129,9 @@
                                                              (Thread/sleep 1000)
                                                              (.println (System/out) (str (:onyx.core/id event) " RATE: " (im/snapshot! rate)))))}))
    :lifecycle/after-batch (fn after-batch [event lifecycle]
-                            (im/update! (:generator/rate event) (count (:onyx.core/batch event)))
+                            (let [cnt (count (:onyx.core/batch event))]
+                              (swap! total-segments + cnt)
+                              (im/update! (:generator/rate event) cnt))
                             {})})

 (def in-calls
@@ -195,12 +167,11 @@
   {:catalog catalog
    :workflow workflow
    :lifecycles lifecycles
-   ;:acker/percentage 50
    :task-scheduler :onyx.task-scheduler/balanced})

-(Thread/sleep 5000)
-
+(reset! total-segments 0)
 (Thread/sleep bench-length)
+(println "AVERAGE THROUGHPUT: " (float (* 1000 (/ @total-segments bench-length))))

 (doseq [v-peer v-peers]
   (onyx.api/shutdown-peer v-peer))


Remove commented line

Remove commented line

--- src/puppetlabs/trapperkeeper/services_internal.clj
+++ src/puppetlabs/trapperkeeper/services_internal.clj
@@ -366,7 +366,6 @@
                         ;; we don't need to track these as dependencies because it
                         ;; will be provided by the app.
                         [_ fn-body] (replace-fn-calls (set tk-svc-fn-names)
-                                                      ;#{'service-context 'service-id}
                                                       this fn-body)
                         ;; transform all the functions from the service protocol, and keep
                         ;; a list of the dependencies so that prismatic can inject them


don't reload file or dependents when :figwheel-no-load is set on ns

fixes #446

--- support/src/figwheel/client/file_reloading.cljs
+++ support/src/figwheel/client/file_reloading.cljs
@@ -295,11 +295,15 @@
     ;; we are forcing reload here
     (figwheel-require (name namespace) true)))

+(defn figwheel-no-load? [{:keys [namespace] :as file-msg}]
+  (let [meta-pragmas (get @figwheel-meta-pragmas (name namespace))]
+    (:figwheel-no-load meta-pragmas)))
+
 (defn reload-file? [{:keys [namespace] :as file-msg}]
   (dev-assert (namespace-file-map? file-msg))
   (let [meta-pragmas (get @figwheel-meta-pragmas (name namespace))]
     (and
-     (not (:figwheel-no-load meta-pragmas))
+     (not (figwheel-no-load? file-msg))
      (or
       (:figwheel-always meta-pragmas)
       (:figwheel-load meta-pragmas)
@@ -385,7 +389,8 @@
           (eval-body eval-body-file opts))))
     (reset! dependencies-loaded (list))
     (let [all-files (filter #(and (:namespace %)
-                                  (not (:eval-body %)))
+                                  (not (:eval-body %))
+                                  (not (figwheel-no-load? %)))
                             files)
           ;; add in figwheel always
           all-files (concat all-files (get-figwheel-always))


Added support for InputStream outputs in HTTP library

--- lib/compojure/http/http.clj
+++ lib/compojure/http/http.clj
@@ -31,6 +31,7 @@
                    parser
                    str-utils))
   (:import (java.io File
+                    InputStream
                     FileInputStream)
            (java.net URL)
            (java.util Enumeration
@@ -162,24 +163,22 @@
   (or (.getParameter request "_method")
       (.getMethod request)))

-(defn- send-stream
-  "Send a stream of data to the HTTP response."
-  [context response stream filename]
-  (.setHeader response
-    "Content-Type" (context-mimetype context (str filename)))
-  (with-open in stream
-    (pipe-stream in (.getOutputStream response))))
-
+(defn- set-type-by-name
+  "Set the content type header by guessing the mimetype from the resource name."
+  [#^HttpServletResponse response context name]
+  (.setHeader response "Content-Type" (context-mimetype context name)))
+
 (defn- update-response
   "Destructively update a HttpServletResponse using a Clojure datatype:
-    string - Adds to the response body
-    seq    - Adds all containing elements to the response body
-    map    - Updates the HTTP headers
-    Number - Updates the status code
-    File   - Updates the response body via a file stream
-    URL    - Updates the response body via a stream to the URL
-    vector - Iterates through its contents, successively updating the response
-             with each value"
+    string      - Adds to the response body
+    seq         - Adds all containing elements to the response body
+    map         - Updates the HTTP headers
+    Number      - Updates the status code
+    File        - Updates the response body via a file stream
+    URL         - Updates the response body via a stream to the URL
+    InputStream - Pipes the input stream to the resource body
+    vector      - Iterates through its contents, successively updating the
+                  response with each value"
   [#^HttpServletResponse response context update]
   (cond
     (vector? update)
@@ -196,12 +195,16 @@
         (.setHeader response k v))
     (instance? Number update)
       (.setStatus response update)
+    (instance? Cookie update)
+      (.addCookie response update)
     (instance? File update)
-      (send-stream context response (new FileInputStream update) update)
+      (update-response response context (.toURL update))
     (instance? URL update)
-      (send-stream context response (.openStream update) update)
-    (instance? Cookie update)
-      (.addCookie response update)))
+      (do (set-type-by-name response context (str update))
+          (update-response response context (.openStream update)))
+    (instance? InputStream update)
+      (with-open in update
+        (pipe-stream in (.getOutputStream response)))))

 (defn- apply-http-handler
   "Finds and evaluates the handler that matches the HttpServletRequest. If the


Test greedy construction for 3 selected items

--- test/rdf_path_examples/diversification_test.clj
+++ test/rdf_path_examples/diversification_test.clj
@@ -6,8 +6,11 @@
 (deftest greedy-construction
   (let [distances {#{1 2} 0.5
                    #{1 3} 1
-                   #{2 3} 0.5}
+                   #{1 4} 1
+                   #{2 3} 0.5
+                   #{2 4} 0.5
+                   #{3 4} 0}
         distance-fn (fn [a b] (get distances (hash-set a b)))
         paths (apply union (keys distances))]
     (with-redefs [rand-nth (constantly 1)] ; Start with path 1
-      (is (= (divers/greedy-construction paths distance-fn 2) #{1 3})))))
+      (is (= (divers/greedy-construction paths distance-fn 3) #{1 2 3})))))


Include macros in completion results

Include macros in completion results

Former-commit-id: d4221eca1a904ad5be3f4ddd895f7b6c8d3066bb

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -77,7 +77,9 @@
     (filter (if allow-private?
               identity
               #(not (:private (:meta (val %)))))
-      (:defs (get (:cljs.analyzer/namespaces @planck.core/st) ns-sym)))))
+      (apply merge
+        ((juxt :defs :macros)
+          (get (:cljs.analyzer/namespaces @planck.core/st) ns-sym))))))

 (defn is-completion? [buffer-match-suffix candidate]
   (re-find (js/RegExp. (str "^" buffer-match-suffix)) candidate))
@@ -95,9 +97,9 @@
       (clj->js (if (= "" buffer-match-suffix)
                  []
                  (map #(str buffer-prefix %)
-                  (sort
-                    (filter (partial is-completion? buffer-match-suffix)
-                      all-candidates))))))))
+                   (sort
+                     (filter (partial is-completion? buffer-match-suffix)
+                       all-candidates))))))))

 (defn extension->lang [extension]
   (if (= ".js" extension)


Scope completions to typed namespace

Scope completions to typed namespace

Former-commit-id: 1e7beac67de06fb638e74c5bde0fc6b91f27af29

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -87,10 +87,13 @@
   (let [namespace-candidates (map str
                                (keys (:cljs.analyzer/namespaces @planck.core/st)))
         top-form? (re-find #"^\s*\(\s*[^()\s]*$" buffer)
-        all-candidates (set (concat namespace-candidates
-                                    (completion-candidates-for-ns 'cljs.core false)
-                                    (completion-candidates-for-ns @current-ns true)
-                                    (when top-form? (map str repl-specials))))]
+        typed-ns (second (re-find #"(\b[a-zA-Z-.]+)\/[a-zA-Z-]+$" buffer))
+        all-candidates (set (if typed-ns
+                              (completion-candidates-for-ns (symbol typed-ns) false)
+                              (concat namespace-candidates
+                                      (completion-candidates-for-ns 'cljs.core false)
+                                      (completion-candidates-for-ns @current-ns true)
+                                      (when top-form? (map str repl-specials)))))]
     (let [buffer-match-suffix (re-find #"[a-zA-Z-]*$" buffer)
           buffer-prefix (subs buffer 0 (- (count buffer) (count buffer-match-suffix)))]
       (clj->js (if (= "" buffer-match-suffix)


whitespace fix

whitespace fix

--- src/overtone/examples/instruments/pitch_controller.clj
+++ src/overtone/examples/instruments/pitch_controller.clj
@@ -6,7 +6,7 @@

 (defsynth pitch-controlled-saws
   [out-bus 0]
-  (let [p   (pitch (sound-in) )
+  (let [p   (pitch (sound-in))
         p   (/ p 4)
         p   (lag p 1)]
     (out out-bus (saw [p (+ p (* p 0.01))]))))


Start preferring index-oir on planner examples instead of resolvers

--- test/com/wsscode/pathom/connect/planner_test.cljc
+++ test/com/wsscode/pathom/connect/planner_test.cljc
@@ -17,6 +17,9 @@
                         x))
                     resolvers)]
     (pc/register {} resolvers)))
+
+(defn oir-index [resolvers]
+  (::pc/index-oir (register-index resolvers)))

 (defn base-graph-env []
   (assoc (pcp/base-env)
@@ -59,7 +62,7 @@
                                                      :label (str
                                                               (str node-id " | ")
                                                               #_(if attrs
-                                                                  (str (str/join "," attrs) " | "))
+                                                                  (str (str/join "" attrs) " | "))
                                                               (pcp/node->label node))}
                                               (get-in env [::pc/index-resolvers (::pc/sym node) ::pc/dynamic-resolver?])
                                               (assoc
@@ -120,8 +123,7 @@
 (deftest compute-run-graph-test-no-path
   (testing "no path"
     (is (= (compute-run-graph
-             {::resolvers []
-              ::eql/query [:a]})
+             {::eql/query [:a]})
            {::pcp/nodes             {}
             ::pcp/index-syms        {}
             ::pcp/unreachable-attrs #{:a}
@@ -129,23 +131,16 @@

     (testing "broken chain"
       (is (= (compute-run-graph
-               {::resolvers [{::pc/sym    'b
-                              ::pc/input  #{:a}
-                              ::pc/output [:b]}]
-                ::eql/query [:b]})
+               {::pc/index-oir '{:b {#{:a} #{b}}}
+                ::eql/query    [:b]})
              '#::pcp{:nodes             {}
                      :index-syms        {}
                      :unreachable-attrs #{:a :b}
                      :unreachable-syms  #{b}}))

       (is (= (compute-run-graph
-               {::resolvers [{::pc/sym    'b
-                              ::pc/input  #{:a}
-                              ::pc/output [:b]}
-                             {::pc/sym    'b1
-                              ::pc/input  #{:a}
-                              ::pc/output [:b]}]
-                ::eql/query [:b]})
+               {::pc/index-oir '{:b {#{:a} #{b1 b}}}
+                ::eql/query    [:b]})
              '#::pcp{:nodes             {}
                      :index-syms        {}
                      :unreachable-attrs #{:a :b}
@@ -278,20 +273,12 @@

     (testing "partial cycle"
       (is (= (compute-run-graph
-               {::resolvers [{::pc/sym    'a
-                              ::pc/input  #{:c}
-                              ::pc/output [:a]}
-                             {::pc/sym    'a1
-                              ::pc/output [:a]}
-                             {::pc/sym    'b
-                              ::pc/input  #{:a}
-                              ::pc/output [:b]}
-                             {::pc/sym    'c
-                              ::pc/input  #{:b}
-                              ::pc/output [:c]}
-                             {::pc/sym    'd
-                              ::pc/output [:d]}]
-                ::eql/query [:c :a]})
+               {::pc/index-oir '{:a {#{:c} #{a}
+                                     #{}   #{a1}}
+                                 :b {#{:a} #{b}}
+                                 :c {#{:b} #{c}}
+                                 :d {#{} #{d}}}
+                ::eql/query    [:c :a]})
              '{::pcp/nodes             {1 {::pc/sym               c
                                            ::pcp/node-id          1
                                            ::pcp/requires         {:c {}}
@@ -317,27 +304,12 @@
                ::pcp/root              4
                ::pcp/index-attrs       {:a 4 :b 2 :c 1}}))))

-  (testing "extra provides"
-    (is (= (compute-run-graph
-             {::resolvers [{::pc/sym    'a
-                            ::pc/output [:a :b :c]}]
-              ::eql/query [:a]})
-           '{::pcp/nodes             {1 {::pc/sym               a
-                                         ::pcp/node-id          1
-                                         ::pcp/requires         {:a {}}
-                                         ::pcp/input            {}
-                                         ::pcp/source-for-attrs #{:a}}}
-             ::pcp/index-syms        {a #{1}}
-             ::pcp/unreachable-syms  #{}
-             ::pcp/unreachable-attrs #{}
-             ::pcp/root              1
-             ::pcp/index-attrs       {:a 1}})))
-
   (testing "collapse nodes"
     (is (= (compute-run-graph
-             {::resolvers [{::pc/sym    'a
-                            ::pc/output [:a :b :c]}]
-              ::eql/query [:a :b]})
+             {::pc/index-oir '{:a {#{} #{a}}
+                               :b {#{} #{a}}
+                               :c {#{} #{a}}}
+              ::eql/query    [:a :b]})
            '{::pcp/nodes             {1 {::pc/sym               a
                                          ::pcp/node-id          1
                                          ::pcp/requires         {:a {} :b {}}


add mono compatibility to .NET project.clj template

--- src/clojure/leiningen/new/dotnet_clojure/project.clj
+++ src/clojure/leiningen/new/dotnet_clojure/project.clj
@@ -3,7 +3,7 @@
   :dependencies []
   :warn-on-reflection true
   :plugins [[lein-clr "0.2.1"]]
-  :clr {:cmd-templates {:clj-exe [["target" "clr" "lib" "{{internal-dir}}" %1]]
+  :clr {:cmd-templates {:clj-exe [[?PATH "mono"] ["target" "clr" "lib" "{{internal-dir}}" %1]]
                         :clj-zip [".." ".." ".." "{{zip-path}}"]
                         :unzip ["jar" "xf" %2]}
         :deps-cmds [[:unzip "" :clj-zip]]


fixed missing project-config key

fixed missing project-config key

--- src/org/domaindrivenarchitecture/pallet/convention/managed_ide.clj
+++ src/org/domaindrivenarchitecture/pallet/convention/managed_ide.clj
@@ -46,7 +46,8 @@
   "Managed vm crate default configuration"
   [user-key dev-platform vm-platform]
   (map-utils/deep-merge
-    {:ide-user user-key}
+    {:ide-user user-key
+     :project-config dda-projects}
     (cond
       (= dev-platform :clojure) {:clojure {:os-user-name (name user-key)}
                                  :atom {:settings (if (= vm-platform :aws)


Update middleware versions

Update middleware versions

--- home/wasa/.lein/profiles.clj
+++ home/wasa/.lein/profiles.clj
@@ -1,2 +1,2 @@
-{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
-        :dependencies [[org.clojure/tools.nrepl "0.2.10"]]}}
+{:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]
+        :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}


desktop: Push crop data to cropper

desktop: Push crop data to cropper

--- apps/desktop/src_front/souptitle_desktop/manager/views/content.cljs
+++ apps/desktop/src_front/souptitle_desktop/manager/views/content.cljs
@@ -49,7 +49,8 @@
      [centered-box
       {:space 80}
       [cropper {:src (:url cover)
-                :on-crop #(dispatch [:update-serial-crop-data %])}]]
+                :on-crop #(dispatch [:update-serial-crop-data %])
+                :crop-props {:data (clj->js (:crop-data cover))}}]]
      [serial-dropzone])])

 (defmethod content :season [{{:keys [title]} :meta}]


CMR-494: modified temporal validation

CMR-494: modified temporal validation

--- src/cmr/search/services/parameter_validation.clj
+++ src/cmr/search/services/parameter_validation.clj
@@ -199,16 +199,19 @@
   start-day and end-day are integer between 1 and 366"
   [concept-type params]
   (if-let [temporal (:temporal params)]
-    (apply concat
-           (map
-             (fn [value]
-               (let [[start-date end-date start-day end-day] (map s/trim (s/split value #","))]
-                 (concat
-                   (validate-date-time start-date)
-                   (validate-date-time end-date)
-                   (day-valid? start-day "temporal_start_day")
-                   (day-valid? end-day "temporal_end_day"))))
-             temporal))
+    (let [temporal (if (sequential? temporal)
+                     temporal
+                     (vector temporal))]
+      (apply concat
+             (map
+               (fn [value]
+                 (let [[start-date end-date start-day end-day] (map s/trim (s/split value #","))]
+                   (concat
+                     (validate-date-time start-date)
+                     (validate-date-time end-date)
+                     (day-valid? start-day "temporal_start_day")
+                     (day-valid? end-day "temporal_end_day"))))
+               temporal)))
     []))


fix(ccw.server): use common/send-code and fix the wrong behavior

--- ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
+++ ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
@@ -204,13 +204,6 @@
           (println " timeout !")
           (swap! timed-out-safe-connections update-in [safe-connection] (fnil inc 0)))))))

-(defn send-code
-  "Sends code and keep tracks of safe-connections that have timeouts.
-   When a safe-connection has had 2 timeouts, stop trying to use
-   it and return nil."
-  [safe-connection code timeout]
-  (send-message safe-connection {"op" "eval", "code" code} timeout))
-
 (defmulti find-var-metadata
   (fn [current-namespace ^IClojureEditor editor var]
     (when-let [repl (.getCorrespondingREPL editor)]
@@ -225,7 +218,7 @@
                                 "(clojure.core/the-ns '%s) '%s))")
                        current-namespace
                        var)
-          response (first (send-code safe-connection code 1000))]
+          response (first (common/send-code safe-connection code :timeout 1000))]
       response)))

 (defmethod find-var-metadata "info"
@@ -266,7 +259,7 @@
     :else (when-let [repl (.getCorrespondingREPL editor)]
             (let [safe-connection (.getSafeToolingConnection repl)
                   code (complete-command current-namespace prefix false)
-                  response (first (send-code safe-connection code 1000))]
+                  response (first (common/send-code safe-connection code :timeout 1000))]
               response))))

 (defmethod find-suggestions "complete"
@@ -409,7 +402,7 @@
                 (str " - " type))
             filter
             (context-info-data completion (+ prefix-offset (count completion)) metadata)
-            (delay (doc/var-doc-info-html (find-var-metadata ns editor completion))))))))) ;; todo remove metadata
+            (delay (doc/var-doc-info-html (find-var-metadata current-namespace editor completion))))))))) ;; todo remove metadata

 (def activation-characters
   "Characters which will trigger auto-completion"


updated offheap benchmarks

updated offheap benchmarks

--- src/main/clojure/hikesaber/benchmark/harness.clj
+++ src/main/clojure/hikesaber/benchmark/harness.clj
@@ -3,7 +3,7 @@
    :name org.gensym.hikesaber.benchmark.harness
    :methods [#^{:static true} [countUniqueBikes [Object] int]
              #^{:static true} [countUniqueBikesTransduce [Object] int]
-             #^{:static true} [countUniqueBikesOffHeap [Object] int]
+            #^{:static true} [countUniqueBikesOffHeap [Object] int]
              #^{:static true} [countUniqueBikesOffHeapNth [Object] int]
              #^{:static true} [countUniqueBikesOffHeapTransduce [Object] int]
              #^{:static true} [loadRecords [] Object]
@@ -26,10 +26,11 @@
 (defn -unloadRecords [records]
   (ohr/dispose (:offheap records)))

+
 ;;Result "countUniqueBikes":
-;;  0.658 ±(99.9%) 0.004 s/op [Average]
-;;  (min, avg, max) = (0.623, 0.658, 0.696), stdev = 0.016
-;;  CI (99.9%): [0.654, 0.662] (assumes normal distribution)
+;;  0.657 ±(99.9%) 0.003 s/op [Average]
+;;  (min, avg, max) = (0.630, 0.657, 0.723), stdev = 0.013
+;;  CI (99.9%): [0.654, 0.660] (assumes normal distribution)
 (defn -countUniqueBikes [records]
   (loop [i 0
          coll (:records records)
@@ -41,17 +42,18 @@
              (conj ids (:bikeid (first coll)))))))

 ;;Result "countUniqueBikesTransduce":
-;;  0.654 ±(99.9%) 0.004 s/op [Average]
-;;  (min, avg, max) = (0.618, 0.654, 0.710), stdev = 0.018
-;;  CI (99.9%): [0.650, 0.658] (assumes normal distribution)
+;;  0.665 ± (99.9%) 0.005 s/op [Average]
+;;  (min, avg, max) = (0.630, 0.665, 0.724), stdev = 0.020
+;;  CI (99.9%): [0.660, 0.670] (assumes normal distribution)
 (defn -countUniqueBikesTransduce [records]
   (count (transduce  (map :bikeid) conj #{} (:records records))))

+
 ;;Result "countUniqueBikesOffHeap":
-;;  0.273 ±(99.9%) 0.005 s/op [Average]
-;;  (min, avg, max) = (0.253, 0.273, 0.337), stdev = 0.020
-;;  CI (99.9%): [0.268, 0.278] (assumes normal distribution)
+;;  0.287 ±(99.9%) 0.006 s/op [Average]
+;;  (min, avg, max) = (0.254, 0.287, 0.336), stdev = 0.026
+;;  CI (99.9%): [0.281, 0.293] (assumes normal distribution)
 (defn -countUniqueBikesOffHeap [records]
   (let [num-records (count (:offheap records))
         unsafe (ohr/unsafe (:offheap records))
@@ -66,11 +68,10 @@
                (conj ids (ohr/get-bike-id unsafe offset)))))))

-
 ;;Result "countUniqueBikesOffHeapNth":
-;;  0.404 ±(99.9%) 0.006 s/op [Average]
-;;  (min, avg, max) = (0.372, 0.404, 0.474), stdev = 0.026
-;;  CI (99.9%): [0.398, 0.410] (assumes normal distribution)
+;;  0.374 ±(99.9%) 0.007 s/op [Average]
+;;  (min, avg, max) = (0.307, 0.374, 0.429), stdev = 0.031
+;;  CI (99.9%): [0.367, 0.381] (assumes normal distribution)
 (defn -countUniqueBikesOffHeapNth [records]
   (let [num-records (count (:offheap records))
         coll (:offheap records)]
@@ -83,9 +84,10 @@
                  (conj ids (ohr/bike-id record))))))))

+
 ;;Result "countUniqueBikesOffHeapTransduce":
-;;  0.307 ±(99.9%) 0.006 s/op [Average]
-;;  (min, avg, max) = (0.274, 0.307, 0.370), stdev = 0.026
-;;  CI (99.9%): [0.301, 0.313] (assumes normal distribution)
+;;  0.315 ±(99.9%) 0.007 s/op [Average]
+;;  (min, avg, max) = (0.273, 0.315, 0.372), stdev = 0.029
+;;  CI (99.9%): [0.308, 0.321] (assumes normal distribution)
 (defn -countUniqueBikesOffHeapTransduce [records]
   (count (transduce (map ohr/bike-id) conj #{} (:offheap records))))


Fix typos

Fix typos

--- src-cljs/photon/ui/frontend.cljs
+++ src-cljs/photon/ui/frontend.cljs
@@ -288,7 +288,7 @@
                                                          :active-projection
                                                          new-active-projection))))]
         (dom/div #js {:className "projections"}
-          (dom/h1 #js {:className "view-title"} "Rrojections")
+          (dom/h1 #js {:className "view-title"} "Projections")
           (dom/div
            #js {:className "button"
                 :onClick (fn [_]
@@ -444,10 +444,10 @@
             #js {:className "widget-box"}
             (dom/span
               #js {:className "title"}
-                "title")
+                "Control Panel")
             (dom/span
               #js {:className "large-value"}
-                "4")))
+              (dom/button #js {:onClick (fn [_])} "Restart"))))
         #_(dom/div
           #js {:className "col-sm-12 col-md-6 col-lg-4"}
           (dom/div


re-add ability to compose via vectors with a more efficient implementation

--- src/clj/com/rpl/specter/impl.clj
+++ src/clj/com/rpl/specter/impl.clj
@@ -74,6 +74,10 @@
   StructureValsPathFunctions
   (coerce-path [this]
     this)
+
+  java.util.List
+  (coerce-path [this]
+    (comp-paths* this))

   Object
   (coerce-path [this]


Add functionality for Gene Conditioning Shoppe to genetics cards

Fairly strightforward change, basically we add an or condition to the
requirements for each card to trigger that will also trigger the
second time if GCS is installed.

Unfortunately, this technique will have to be used if new genetics
cards are introduced, as it's (AFAICT) impossible to implement this
behaviour on GCS itself.

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -15,8 +15,10 @@

    "Adjusted Chronotype"
    {:events {:runner-loss {:req (req (and (some #{:click} target)
-                                           (empty? (filter #(= :click %)
-                                                           (mapcat first (turn-events state side :runner-loss))))))
+                                          (let [click-losses (filter #(= :click %) (mapcat first (turn-events state side :runner-loss)))]
+                                            (or (empty? click-losses)
+                                                (and (= (count click-losses) 1)
+                                                     (persistent-flag? state side card :triggers-twice))))))
                            :msg "gain [Click]" :effect (effect (gain :runner :click 1))}}}

    "Aesops Pawnshop"
@@ -160,7 +162,9 @@

    "Enhanced Vision"
    {:events {:successful-run {:msg (msg "force the Corp to reveal " (:title (first (shuffle (:hand corp)))))
-                              :req (req (first-event state side :successful-run))}}}
+                              :req (req (or (first-event state side :successful-run)
+                                            (and (second-event state side :successful-run)
+                                                 (persistent-flag? state side card :triggers-twice))))}}}

    "Fall Guy"
    {:prevent {:trash [:resource]}
@@ -439,7 +443,7 @@
                                                                                " of " title))))}}}))]
      {:events {:runner-install {:req (req (first-event state side :runner-install))
                                 :effect (effect (resolve-ability
-                                                 (pphelper (:title target)
+                                                 (pphelper (:title target)
                                                            (->> (:deck runner)
                                                                 (filter #(has? % :title (:title target)))
                                                                 (vec)))
@@ -472,12 +476,12 @@
                   {:label "X[Credit]:Remove counters from a hosted card" :choices {:req #(:host %)}
                    :req (req (not (empty? (:hosted card))))
                    :effect (req (let [paydowntarget target]
-                                  (resolve-ability
+                                  (resolve-ability
                                     state side
                                     {:prompt "How many counters to remove?"
                                      :choices {:number (req (min (:credit runner) (:counter paydowntarget)))}
                                      :msg (msg "remove " target " counters from " (:title paydowntarget))
-                                     :effect (req (do
+                                     :effect (req (do
                                                     (lose state side :credit target)
                                                     (if (= (:counter paydowntarget) target)
                                                       (runner-install state side (dissoc paydowntarget :counter) {:no-cost true})
@@ -621,12 +625,17 @@
                                     {:cause :ability-cost})))}]}

    "Symmetrical Visage"
-   {:events {:runner-click-draw {:req (req (first-event state side :runner-click-draw))
+   {:events {:runner-click-draw {:req (req (or (first-event state side :runner-click-draw)
+                                               (and (second-event state side :runner-click-draw)
+                                                    (persistent-flag? state side card :triggers-twice))))
                                  :msg "gain 1 [Credits]"
                                  :effect (effect (gain :credit 1))}}}

    "Synthetic Blood"
-   {:events {:damage {:req (req (first-event state side :damage)) :msg "draw 1 card"
+   {:events {:damage {:req (req (or (first-event state side :damage)
+                                    (and (second-event state side :damage)
+                                         (persistent-flag? state side card :triggers-twice))))
+                      :msg "draw 1 card"
                       :effect (effect (draw :runner))}}}

    "Tallie Perrault"


remove budget items with zero budget and zero actual

--- src/clj_money/models/reports.clj
+++ src/clj_money/models/reports.clj
@@ -214,7 +214,8 @@
                                                    {:types #{:income :expense}})
                      (group-by :type)
                      (sort-by  #(.indexOf [:income :expense] (first %)))
-                     (mapcat #(process-budget-group s budget as-of %)))]
+                     (mapcat #(process-budget-group s budget as-of %))
+                     (remove #(= 0M (:actual %) (:budget %))))]
       (-> budget
           (assoc :items items)
           (rename-keys {:name :title})


[n.u.adapters] Refactor ref-adapter to use safe-for-ui in callbacks

--- src/clojure/neko/ui/adapters.clj
+++ src/clojure/neko/ui/adapters.clj
@@ -1,9 +1,10 @@
 (ns neko.ui.adapters
   "Contains custom adapters for ListView and Spinner."
-  (:use [neko.threading :only [on-ui]]
-        [neko.ui :only [make-ui-element]])
-  (:import neko.ui.adapters.InterchangeableListAdapter
-           android.view.View))
+  (:require [neko.debug :refer [safe-for-ui]]
+            [neko.threading :refer [on-ui]]
+            [neko.ui :refer [make-ui-element]])
+  (:import android.view.View
+           neko.ui.adapters.InterchangeableListAdapter))

 (defn ref-adapter
   "Takes a function that creates a View, a function that updates a
@@ -17,21 +18,26 @@
   ref-type. `access-fn` argument is optional, it is called on the
   value of ref-type to get the list to be displayed."
   ([create-view-fn update-view-fn ref-type]
-     (ref-adapter create-view-fn update-view-fn ref-type identity))
+   (ref-adapter create-view-fn update-view-fn ref-type identity))
   ([create-view-fn update-view-fn ref-type access-fn]
-     {:pre [(fn? create-view-fn) (fn? update-view-fn)
-            (instance? clojure.lang.IFn access-fn)
-            (instance? clojure.lang.IDeref ref-type)]}
-     (let [create-fn (fn [context]
-                       (let [view (create-view-fn)]
-                         (if (instance? View view)
-                           view
-                           (make-ui-element
-                            context view
-                            {:container-type :abs-listview-layout}))))
-           adapter (InterchangeableListAdapter. create-fn update-view-fn
-                                                (access-fn @ref-type))]
-       (add-watch ref-type ::adapter-watch
-                  (fn [_ __ ___ new-state]
-                    (on-ui (.setData adapter (access-fn new-state)))))
-       adapter)))
+   {:pre [(fn? create-view-fn) (fn? update-view-fn)
+          (instance? clojure.lang.IFn access-fn)
+          (instance? clojure.lang.IDeref ref-type)]}
+   (let [create-fn (fn [context]
+                     (or (safe-for-ui
+                          (let [view (create-view-fn)]
+                            (if (instance? View view)
+                              view
+                              (make-ui-element
+                               context view
+                               {:container-type :abs-listview-layout}))))
+                         (android.view.View. context)))
+         adapter (InterchangeableListAdapter.
+                  create-fn
+                  (fn [pos view parent data]
+                    (safe-for-ui (update-view-fn pos view parent data)))
+                  (access-fn @ref-type))]
+     (add-watch ref-type ::adapter-watch
+                (fn [_ __ ___ new-state]
+                  (on-ui (.setData adapter (access-fn new-state)))))
+     adapter)))


Create-fn function in ref-adapter can return UI tree

--- src/clojure/neko/ui/adapters.clj
+++ src/clojure/neko/ui/adapters.clj
@@ -11,8 +11,10 @@

 (ns neko.ui.adapters
   "Contains custom adapters for ListView and Spinner."
-  (:use [neko.threading :only [on-ui]])
-  (:import neko.ui.adapters.InterchangeableListAdapter))
+  (:use [neko.threading :only [on-ui]]
+        [neko.ui :only [make-ui-element]])
+  (:import neko.ui.adapters.InterchangeableListAdapter
+           android.view.View))

 (defn ref-adapter
   "Takes a function that creates a View, a function that updates a
@@ -31,7 +33,14 @@
      {:pre [(fn? create-view-fn) (fn? update-view-fn)
             (instance? clojure.lang.IFn access-fn)
             (instance? clojure.lang.IDeref ref-type)]}
-     (let [adapter (InterchangeableListAdapter. create-view-fn update-view-fn
+     (let [create-fn (fn []
+                       (let [view (create-view-fn)]
+                         (if (instance? View view)
+                           view
+                           (make-ui-element
+                            neko.context/context view
+                            {:container-type :abs-listview-layout}))))
+           adapter (InterchangeableListAdapter. create-fn update-view-fn
                                                 (access-fn @ref-type))]
        (add-watch ref-type ::adapter-watch
                   (fn [_ __ ___ new-state]


Added logout function.

Added logout function.

--- src/cmr/transmit/echo/tokens.clj
+++ src/cmr/transmit/echo/tokens.clj
@@ -18,6 +18,13 @@
        (get-in parsed [:token :id])
        (r/unexpected-status-error! status body)))))

+(defn logout
+  "Logs into ECHO and returns the token"
+  [context token]
+  (let [[status body] (r/rest-delete context (str "/tokens/" token))]
+    (when-not (= 200 status)
+      (r/unexpected-status-error! status body))))
+
 (defn login-guest
   "Logs in as a guest and returns the token."
   [context]


Updated column pull & push examples for readability

--- src/css-guide/styles/layout.cljs
+++ src/css-guide/styles/layout.cljs
@@ -2,6 +2,7 @@
   (:require [om.next :as om :refer-macros [defui]]
             [styles.util :as util :refer [to-cljs] :refer-macros [source->react defexample defarticle defview]]
             [om.dom :as dom]
+            [untangled.icons :as icons]
             [clojure.string :as str]))

@@ -234,123 +235,77 @@
   "### Column Push

   Move back and forth any number of columns wide you need to push the position of your column within the grid."
-  (dom/div #js {}
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--1 u-push--11"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 11"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--2 u-push--10"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 10"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--3 u-push--9"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 9"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--4 u-push--8"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 8"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--5 u-push--7"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 7"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--6 u-push--6"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 6"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--7 u-push--5"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 5"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--8 u-push--4"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 4"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--9 u-push--3"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 3"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--10 u-push--2"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 2"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--11 u-push--1"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 1"))))))
+  (dom/div #js {:className "u-row"}
+    (dom/div #js {:className "u-column--1 u-push--11"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 11"))
+
+    (dom/div #js {:className "u-column--2 u-push--10"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 10"))
+
+    (dom/div #js {:className "u-column--3 u-push--9"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 9"))
+
+    (dom/div #js {:className "u-column--4 u-push--8"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 8"))
+
+    (dom/div #js {:className "u-column--5 u-push--7"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 7"))
+
+    (dom/div #js {:className "u-column--6 u-push--6"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 6"))
+
+    (dom/div #js {:className "u-column--7 u-push--5"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 5"))
+
+    (dom/div #js {:className "u-column--8 u-push--4"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 4"))
+
+    (dom/div #js {:className "u-column--9 u-push--3"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 3"))
+
+    (dom/div #js {:className "u-column--10 u-push--2"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 2"))
+
+    (dom/div #js {:className "u-column--11 u-push--1"}
+      (dom/div #js {:className "box-row"} (icons/icon :keyboard_arrow_right) " 1"))))

 (defexample grid-example-column-pull
   "### Column Pull

   Move back and forth any number of columns wide you need to pull the position of your column within the grid."
-  (dom/div #js {}
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--1 u-pull--11"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 11"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--2 u-pull--10"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 10"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--3 u-pull--9"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 9"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--4 u-pull--8"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 8"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--5 u-pull--7"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 7"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--6 u-pull--6"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 6"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--7 u-pull--5"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 5"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--8 u-pull--4"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 4"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--9 u-pull--3"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 3"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--10 u-pull--2"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 2"))))
-    (dom/div #js {:className "u-row"}
-      (dom/div #js {:className "u-column--11 u-pull--1"}
-        (dom/div #js {:className "box-row"}
-          (dom/span #js {}
-            (dom/i #js {:className "c-icon-right-dir"}) " 1"))))))
+  (dom/div #js {:className "u-row"}
+    (dom/div #js {:className "u-column--1 u-pull--11"}
+      (dom/div #js {:className "box-row"} "11 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--2 u-pull--10"}
+      (dom/div #js {:className "box-row"} "10 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--3 u-pull--9"}
+      (dom/div #js {:className "box-row"} "9 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--4 u-pull--8"}
+      (dom/div #js {:className "box-row"} "8 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--5 u-pull--7"}
+      (dom/div #js {:className "box-row"} "7 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--6 u-pull--6"}
+      (dom/div #js {:className "box-row"} "6 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--7 u-pull--5"}
+      (dom/div #js {:className "box-row"} "5 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--8 u-pull--4"}
+      (dom/div #js {:className "box-row"} "4 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--9 u-pull--3"}
+      (dom/div #js {:className "box-row"} "3 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--10 u-pull--2"}
+      (dom/div #js {:className "box-row"} "2 " (icons/icon :keyboard_arrow_left)))
+
+    (dom/div #js {:className "u-column--11 u-pull--1"}
+      (dom/div #js {:className "box-row"} "1 " (icons/icon :keyboard_arrow_left)))))

 (defexample grid-example-column-push-pull
   "### Column Push/Pull"
@@ -539,35 +494,36 @@

 (def sections
   (vec (sort-by :title [
+                        {:id       :grids
+                         :title    "Columns & Rows"
+                         :documentation
+                                   "# Columns & Rows
+
+                                   Grids are the bread and butter of web design, this one is based on flexbox. Needless to say you will find this grid system a joy to use. [Flexbox Mythbusting](http://jonyablonski.com/2015/flexbox-myth-busting/)\n\n
+                                   #### New to grids?\n\n
+                                   Check out my presentation on CSS Grids can help you, complete with a [slide deck](https://speakerdeck.com/stephenway/css-grids-can-help-you), and a [CodePen](http://codepen.io/stephenway/pen/dMKzvy) to play with complex grid layouts."
+                         :examples [grid-example-12-column grid-example-learn grid-example-autopilot grid-example-responsive
+                                    grid-example-fluid  grid-example-column-nesting]}
+                        {:id            :align
+                         :title         "Grid Alignment"
+                         :documentation "# Grid Alignment
+                         Shortcuts to placing your elements left or right."
+                         :examples      [grid-example-align-start grid-example-align-center
+                                         grid-example-align-end grid-example-align-top
+                                         grid-example-align-middle grid-example-align-bottom]}
                         {:id :layouts
                          :title "Layouts"
                          :documentation element-layout-header
                          :examples [element-layout]}
-                        {:id       :grids
-                         :title    "Grid"
-                         :documentation
-                                   "Grids are the bread and butter of web design, this one is based on flexbox. Needless to say you will find this grid system a joy to use. [Flexbox Mythbusting](http://jonyablonski.com/2015/flexbox-myth-busting/)\n\n
-                                   #### New to grids?\n\n
-                                   Check out my presentation on CSS Grids can help you, complete with a [slide deck](https://speakerdeck.com/stephenway/css-grids-can-help-you), and a [CodePen](http://codepen.io/stephenway/pen/dMKzvy) to play with complex grid layouts."
-                         :examples [grid-example-12-column grid-example-learn grid-example-autopilot grid-example-responsive
-                                    grid-example-fluid grid-example-column-push grid-example-column-pull
-                                    grid-example-column-push-pull grid-example-column-nesting]}
-                        {:id            :align
-                         :title         "Grid - Align"
-                         :documentation "# Grid - Align
-                         Shortcuts to placing your elements left or right."
-                         :examples      [grid-example-align-start grid-example-align-center
-                                         grid-example-align-end grid-example-align-top
-                                         grid-example-align-middle grid-example-align-bottom]}
-                        {:id            :distributed
-                         :title         "Grid - Distribute"
-                         :documentation "# Grid - Distributed
-                         Evenly distribute objects into a row or column."
-                         :examples      [grid-example-distributed-around grid-example-distributed-between]}
                         {:id            :ordering
-                         :title         "Grid - Ordering"
-                         :documentation "# Grid - Ordering
-                         Manipulate the order of objects with special column classes."
+                         :title         "Ordering & Distribution"
+                         :documentation "# Ordering & Distribution
+                         Manipulate the order of objects with special column classes or evenly distribute objects into a row or column."
                          :examples      [grid-example-ordering-first grid-example-ordering-last
-                                         grid-example-ordering-reverse]
-                         }])))
+                                         grid-example-ordering-reverse grid-example-distributed-around grid-example-distributed-between]
+                         }
+                        {:id            :columns-layout
+                         :title         "Pushing & Pulling"
+                         :documentation "# Pushing & Pulling Columns"
+                         :examples      [grid-example-column-push grid-example-column-pull grid-example-column-push-pull]}
+                        ])))


Make use of consume macro inside unnest-dispatch-table

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -153,13 +153,10 @@
                                       (nil? middleware) (assoc-in [0 3] default-middleware))))

                           (vector? x)
-                          (let [[context-pathvec & maybe-middleware+entries] entry
-                                middleware (if-not (vector?
-                                                     (first maybe-middleware+entries))
-                                             (first maybe-middleware+entries))
-                                entries (if middleware
-                                          (next maybe-middleware+entries)
-                                          maybe-middleware+entries)]
+                          (consume entry
+                            [context-pathvec :+
+                             middleware (complement vector?) :?
+                             entries :&]
                             (unnest-table context-pathvec middleware entries))))
           (unnest-table [context-pathvec default-middleware entries]
                         (mapv (fn [[_ pathvec :as unnested-entry]]


Factor out map-traversal-dispatcher

Factor out map-traversal-dispatcher

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -328,6 +328,29 @@
                                (assoc ~req :route-params route-params#)))]))
                routes)
            :else nil)))))
+
+(defn map-traversal-dispatcher
+  "Returns a Ring handler using the given dispatch-map and
+  endpoint-fns to guide dispatch. Used by
+  build-map-traversal-handler."
+  [dispatch-map endpoint-fns]
+  (fn rook-map-traversal-dispatcher [request]
+    (loop [pathvec      (second (request-route-spec request))
+           dispatch     dispatch-map
+           route-params {}]
+      (if-let [seg (first pathvec)]
+        (if (contains? dispatch seg)
+          (recur (next pathvec) (get dispatch seg) route-params)
+          (if-let [v (::param-name dispatch)]
+            (recur (next pathvec) (::param-next dispatch)
+              (assoc route-params v seg))
+            ;; no match on path
+            nil))
+        (if-let [h (get endpoint-fns
+                     (get dispatch (:request-method request)))]
+          (h (assoc request :route-params route-params))
+          ;; unsupported method for path
+          nil)))))

 (defn build-map-traversal-handler
   "Returns a form evaluating to a Ring handler that handles dispatch
@@ -384,24 +407,7 @@
        (let [dispatch-map# (:dispatch-map @~tmp)
              endpoint-fns# (:endpoint-fns @~tmp)]
          (ns-unmap *ns* '~tmp)
-         (fn rook-map-traversal-dispatcher# [~req]
-           [dispatch-map# endpoint-fns#]
-           (loop [pathvec#      (second (request-route-spec ~req))
-                  dispatch#     dispatch-map#
-                  route-params# {}]
-             (if-let [seg# (first pathvec#)]
-               (if (contains? dispatch# seg#)
-                 (recur (next pathvec#) (get dispatch# seg#) route-params#)
-                 (if-let [v# (::param-name dispatch#)]
-                   (recur (next pathvec#) (::param-next dispatch#)
-                     (assoc route-params# v# seg#))
-                   ;; no match on path
-                   nil))
-               (if-let [h# (get endpoint-fns#
-                             (get dispatch# (:request-method ~req)))]
-                 (h# (assoc ~req :route-params route-params#))
-                 ;; unsupported method for path
-                 nil))))))))
+         (map-traversal-dispatcher dispatch-map# endpoint-fns#)))))

 (def dispatch-table-compilation-defaults
   {:emit-fn             eval


Updated cache REST API integration tests.

--- test/cmr/opendap/tests/integration/app/admin.clj
+++ test/cmr/opendap/tests/integration/app/admin.clj
@@ -49,7 +49,15 @@
                                      "application/vnd.cmr-opendap.v1+json")))]
       (is (= 404 (:status response)))))
   (testing "v2 routes ..."
-    (let [response @(httpc/get (format "http://localhost:%s/opendap/cache"
+    (let [response @(httpc/get (format "http://localhost:%s/opendap/cache/auth"
+                                       (test-system/http-port))
+                                (-> {}
+                                    (request/add-token-header
+                                     (util/get-sit-token))
+                                    (request/add-accept
+                                     "application/vnd.cmr-opendap.v2+json")))]
+      (is (= 200 (:status response))))
+    (let [response @(httpc/get (format "http://localhost:%s/opendap/cache/concept"
                                        (test-system/http-port))
                                 (-> {}
                                     (request/add-token-header


CMR-2201: Added missing require.

CMR-2201: Added missing require.

--- metadata-db-app/dev/user.clj
+++ metadata-db-app/dev/user.clj
@@ -8,6 +8,7 @@
             [cmr.common.log :as log :refer (debug info warn error)]
             [cmr.metadata-db.data.memory-db :as memory]
             [cmr.common.dev.util :as d]
+            [cmr.common.lifecycle :as l]
             [cmr.mock-echo.system :as mock-echo])
   (:use [clojure.test :only [run-all-tests]]
         [clojure.repl]


Generative testing for WindowID implementation.

[ci skip]

--- src/onyx/windowing/window_id.clj
+++ src/onyx/windowing/window_id.clj
@@ -1,4 +1,10 @@
-(ns onyx.windowing.window-id)
+(ns onyx.windowing.window-id
+  (:require [clojure.test.check :as tc]
+            [clojure.test.check.generators :as gen]
+            [clojure.test.check.properties :as prop]
+            [clojure.test :refer [deftest is]]
+            [com.gfredericks.test.chuck :refer [times]]
+            [com.gfredericks.test.chuck.clojure-test :refer [checking]]))

 ;; An implementation of the Window-ID specification, as discussed
 ;; in http://web.cecs.pdx.edu/~tufte/papers/WindowAgg.pdf.
@@ -154,39 +160,33 @@
 ;; 28 => (5 6 7 8)
 ;; 29 => (5 6 7 8)

-;; Now we will tackle a more general case - where the range
-;; and slide values aren't defined on the same attribute.
-;; Instead of :window-attr, we now use :range-attr and :slide-attr.
-;; As noted by the paper, a common case of this is a timestamp range,
-;; and a slide-by-tuple of 1 for slide. This is back in section 3.3.
+(deftest fixed-windows
+  (checking
+   "one segment per fixed window" 100000
+   [w-range-and-slide gen/s-pos-int
+    w-attr gen/pos-int]
+   (let [segment {:window-attr w-attr}
+         buckets (wids 0 w-range-and-slide w-range-and-slide segment)]
+     (is (= 1 (count buckets))))))

-;;; WIP....
-;; (defn var-2-n-windows [t r-attr w-slide])
+(deftest sliding-windows
+  (checking
+   "a segment in a multiple sliding windows" 100000
+   [w-slide gen/s-pos-int
+    multiple gen/s-pos-int
+    w-attr gen/pos-int]
+   (let [segment {:window-attr w-attr}
+         buckets (wids 0 (* multiple w-slide) w-slide segment)]
+     (is (= multiple (count buckets))))))

-;; (defn var-2-extent-lower [w-range w]
-;;   (- w w-range))
-
-;; (defn var-2-extent-upper [w]
-;;   w)
-
-;; ;; Yields all values of :range-attr which belong to window w
-;; ;; with range of length w-range.
-;; (defn var-2-extents [w-range w]
-;;   (range (inc (var-2-extent-lower w-range w))
-;;          (inc (var-2-extent-upper w))))
-
-;; (var-2-extents 20 25)
-
-;; (defn var-wids-lower [t]
-;;   (get t (:range-attr t)))
-
-;; (defn var-wids-upper [t w-range]
-;;   (+ (get t (:range-attr t)) w-range))
-
-;; (defn var-2-wids [t]
-;;   (var-wids-lower t))
-
-;; (var-2-wids {:range-attr :ts :ts 30})
-
-
-;; (var-wids-upper {:range-attr :ts :ts 30} 10)
+(deftest inverse-functions
+  (checking
+   "values produced by extents are matched by wids" 10000
+   ;; Bound the window size to 10 to keep the each test iteration quick.
+   [w-slide (gen/resize 10 gen/s-pos-int)
+    multiple gen/s-pos-int
+    extent-id gen/pos-int]
+   (let [values (extents 0 (* multiple w-slide) w-slide extent-id)]
+     (is (every? #(some #{extent-id}
+                        (wids 0 (* multiple w-slide) w-slide {:window-attr %}))
+                 values)))))


Caching other database calls (with a 1 minute TTL)

--- src/org/gensym/viddy/storage.clj
+++ src/org/gensym/viddy/storage.clj
@@ -73,8 +73,10 @@
                     :status :station-status} %))))

 (defn make-divvy-data [db-spec]
-  (let [current-stations
-        (memo/ttl current-stations :ttl/threshold (* 60 1000))]
+  (let [one-minute (* 60 1000)
+        current-stations (memo/ttl current-stations :ttl/threshold one-minute)
+        station-info (memo/ttl station-info :ttl/threshold one-minute)
+        station-updates (memo/ttl station-updates :ttl/threshold one-minute)]
     (reify data/DivvyData
       (clear-caches [this]
         (memo/memo-clear! current-stations))


CMR-1890: Additional test

CMR-1890: Additional test

--- system-int-test/test/cmr/system_int_test/search/collection_facets_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_facets_search_test.clj
@@ -707,10 +707,10 @@
 (deftest platform-missing-fields-test
   (grant-permissions)
   ;; Test that if the platforms do not exist in KMS, they will still be returned, but with a value
-  ;; of "not provided" for all of the values in the hierarchy other than short name.
+  ;; of "Not Provided" for all of the values in the hierarchy other than short name.
   (make-coll 1 "PROV1" (platforms "Platform" 2 2 1))
   ;; Test that even with a nil series-entity the platform will still be returned, but with a
-  ;; value of "not provided" for the series-entity
+  ;; value of "Not Provided" for the series-entity
   (make-coll 2 "PROV1" {:platforms [(dc/platform {:short-name "A340-600"})]})
   (let [expected-platforms [{:subfields ["category"],
                              :field "platforms",
@@ -749,3 +749,75 @@
                               (filter #(= "platforms" (:field %))))]
     (is (= expected-platforms actual-platforms))))

+(deftest instrument-missing-fields-test
+  (grant-permissions)
+  ;; Test that if the instruments do not exist in KMS, they will still be returned, but with a value
+  ;; of "Not Provided" for all of the values in the hierarchy other than short name.
+  (make-coll 1 "PROV1" (platforms "instrument-test" 2 2 1))
+  ;; Test that even with a nil type and sub-type the instrument will still be returned, but with a
+  ;; value of "Not Provided" for those fields.
+  (make-coll 2 "PROV1" {:platforms [(dc/platform
+                                      {:instruments [(dc/instrument {:short-name "ADS"})]})]})
+  (let [expected-instruments [{:field "instruments",
+                               :subfields ["category"],
+                               :category
+                               [{:value "Not Provided",
+                                 :count 1,
+                                 :subfields ["class"],
+                                 :class
+                                 [{:value "Not Provided",
+                                   :count 1,
+                                   :subfields ["type"],
+                                   :type
+                                   [{:value "Not Provided",
+                                     :count 1,
+                                     :subfields ["subtype"],
+                                     :subtype
+                                     [{:value "Not Provided",
+                                       :count 1,
+                                       :subfields ["short-name"],
+                                       :short-name
+                                       [{:value "instrument-test-p0-i0",
+                                         :count 1,
+                                         :subfields ["long-name"],
+                                         :long-name [{:value "Not Provided", :count 1}]}
+                                        {:value "instrument-test-p0-i1",
+                                         :count 1,
+                                         :subfields ["long-name"],
+                                         :long-name [{:value "Not Provided", :count 1}]}
+                                        {:value "instrument-test-p1-i0",
+                                         :count 1,
+                                         :subfields ["long-name"],
+                                         :long-name [{:value "Not Provided", :count 1}]}
+                                        {:value "instrument-test-p1-i1",
+                                         :count 1,
+                                         :subfields ["long-name"],
+                                         :long-name
+                                         [{:value "Not Provided", :count 1}]}]}]}]}]}
+                                {:value "In Situ/Laboratory Instruments",
+                                 :count 1,
+                                 :subfields ["class"],
+                                 :class
+                                 [{:value "Chemical Meters/Analyzers",
+                                   :count 1,
+                                   :subfields ["type"],
+                                   :type
+                                   [{:value "Not Provided",
+                                     :count 1,
+                                     :subfields ["subtype"],
+                                     :subtype
+                                     [{:value "Not Provided",
+                                       :count 1,
+                                       :subfields ["short-name"],
+                                       :short-name
+                                       [{:value "ADS",
+                                         :count 1,
+                                         :subfields ["long-name"],
+                                         :long-name
+                                         [{:value "Automated DNA Sequencer",
+                                           :count 1}]}]}]}]}]}]}]
+        actual-instruments (->> (get-facet-results :hierarchical)
+                                :json-facets
+                                (filter #(= "instruments" (:field %))))]
+    (is (= expected-instruments actual-instruments))))
+


some tree functions

some tree functions

--- sass-dsl/src/sass_dsl/transform.clj
+++ sass-dsl/src/sass_dsl/transform.clj
@@ -115,3 +115,15 @@
         (recur
          (pull-selecor-and-child-up-one loc new-node-name))
         (recur (zip/next loc))))))
+
+(defn sass-de-nest-flattened-colors-vec-zip
+  "Wrap the sass-de-nest in a vector zipper."
+  [colon-vec]
+  (zip/vector-zip (sass-ds-nest (zip/vector-zip colon-vec))))
+
+(defn is-constant-declaration
+  "Is this a sass constant declaration"
+  [tree-node]
+  (if (string? tree-node)
+    (= \$ (first (take 1 (clojure.string/triml tree-node))))))
+


CMR-3219: Adding config to allow disabling caching of certain formats.

--- search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj
+++ search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj
@@ -11,6 +11,7 @@
   (require [cmr.common.util :as u]
            [cmr.common.cache :as c]
            [cmr.common.xml :as cx]
+           [clojure.set :as set]
            [cmr.common.config :refer [defconfig]]
            [cmr.common.jobs :refer [defjob]]
            [cmr.common.services.errors :as errors]
@@ -30,8 +31,13 @@
   "Identifies the key used when the cache is stored in the system."
   :metadata-cache)

-(def cached-formats
-  "This is a set of formats that are cached."
+(defconfig non-cached-collection-metadata-formats
+  "Defines a set of collection metadata formats that will not be cached in memory"
+  {:default #{}
+   :type :edn})
+
+(def all-formats
+  "All the possible collection metadata formats that could be cached."
   #{:echo10
     :iso19115
     :dif
@@ -39,6 +45,11 @@
     ;; Note that when upgrading umm version we should also cache the previous version of UMM.
     {:format :umm-json
      :version umm-version/current-version}})
+
+(defn cached-formats
+  "This is a set of formats that are cached."
+  []
+  (set/difference all-formats (non-cached-collection-metadata-formats)))

 ;; Defines the record that represents the cache and implements the cache protocol. This is a very
 ;; simple implementation that just wraps an atom with the map of cached concept ids to revision
@@ -128,7 +139,7 @@
         concepts (doall (metadata-db/get-concepts mdb-context concept-tuples true))
         concepts (concepts-without-xml-processing-inst concepts)
         rfms (u/fast-map #(rfm/compress
-                           (rfm/concept->revision-format-map context % cached-formats))
+                           (rfm/concept->revision-format-map context % (cached-formats)))
                          concepts)]
     (reduce #(assoc %1 (:concept-id %2) %2) {} rfms)))


CMR-5927 Removes saved values.

CMR-5927 Removes saved values.

--- umm-spec-lib/src/cmr/umm_spec/migration/spatial_extent_migration.clj
+++ umm-spec-lib/src/cmr/umm_spec/migration/spatial_extent_migration.clj
@@ -31,7 +31,6 @@
                               (get geographic-coordinate-system :LatitudeResolution))
         geographic-coordinate-unit (when geographic-coordinate-system
                                      (get geographic-coordinate-system :GeographicCoordinateUnits))]
-    (proto-repl.saved-values/save 1)
     (if geographic-coordinate-system
       (-> c
           (assoc-in [:SpatialExtent :HorizontalSpatialDomain :ResolutionAndCoordinateSystem


fixed vpn-settings

fixed vpn-settings

--- main/src/dda/pallet/dda_managed_vm/infra.clj
+++ main/src/dda/pallet/dda_managed_vm/infra.clj
@@ -51,6 +51,7 @@
                       cm/Settings
                       browser/Settings
                       communication/Settings
+                      vpn/Settings
                       #{:install-git})))})

 (s/defn init


Fix wrong stata querying on shape moviment streams.

--- src/uxbox/ui/workspace/base.cljs
+++ src/uxbox/ui/workspace/base.cljs
@@ -106,9 +106,11 @@
     (rx/on-value $ (fn [delta]
                      (let [pageid (get-in @st/state [:workspace :page])
                            selected (get-in @st/state [:workspace :selected])
-                           page (get-in @st/state [:pages-by-id pageid])]
-                       (doseq [sid (filter selected (:shapes page))]
-                         (rs/emit! (dw/move-shape sid delta))))))))
+                           shapes (->> (vals @shapes-by-id)
+                                       (filter #(= (:page %) pageid))
+                                       (filter (comp selected :id)))]
+                       (doseq [{:keys [id group]} shapes]
+                         (rs/emit! (dw/move-shape id delta))))))))

 (defn selrect->rect
   [data]


delete-wish func

delete-wish func

--- src/wishlistd/models/queries.clj
+++ src/wishlistd/models/queries.clj
@@ -20,7 +20,7 @@
 ;[:wishlist :int]
 ;["constraint fk_wish_wishlist foreign key(wishlist) references Wishlist(id) on delete cascade"])))

-(defn get-wishlist [{:keys [code]}]
+(defn get-wishlist [{:keys [code]}] ; code is unique not null
   (sql/with-connection db
 	(sql/with-query-results results
       ["select * from wishlist where code=?" code]
@@ -30,7 +30,7 @@
   (sql/with-connection db
 	(sql/insert-records :wishlist wishlist)))

-(defn delete-wishlist [{:keys [code]}]
+(defn delete-wishlist [{:keys [code]}] ; code is unique not null
   (sql/with-connection db
     (sql/delete-rows :wishlist ["code=?" code])))

@@ -42,4 +42,8 @@

 (defn insert-wish [wish {:keys [id]}]
   (sql/with-connection db
-    (sql/insert-records :wish (assoc wish :wishlist id))))+    (sql/insert-records :wish (assoc wish :wishlist id))))
+
+(defn delete-wish [{:keys [id]}]
+  (sql/with-connection db
+    (sql/delete-rows :wishlist ["id=?" id])))


Fixes access-control-service build

Fixes access-control-service build

--- access-control-app/src/cmr/access_control/services/acl_validation.clj
+++ access-control-app/src/cmr/access_control/services/acl_validation.clj
@@ -5,7 +5,7 @@
             [cmr.transmit.metadata-db :as mdb1]
             [cmr.transmit.metadata-db2 :as mdb]
             [cmr.access-control.data.acls :as acls]
-            [cmr.metadata-db.services.messages :as msg]))
+            [cmr.access-control.services.messages :as msg]))

 (defn- catalog-item-identity-collection-applicable-validation
   "Validates the relationship between collection_applicable and collection_identifier."


Show any found errors immediately

Show any found errors immediately

--- src/braid/client/register/subs.cljs
+++ src/braid/client/register/subs.cljs
@@ -23,9 +23,9 @@
   (fn [state [_ field]]
     (cond
       (get-in state [:fields field :focused?]) :focused
-      (< 0 (get-in state [:fields field :validations-left])) :loading
       (string/blank? (get-in state [:fields field :value])) :blank
       (not (empty? (get-in state [:fields field :errors]))) :invalid
+      (< 0 (get-in state [:fields field :validations-left])) :loading
       :else :valid)))


validating using model opertions set

validating using model opertions set

--- src/celestial/persistency/users.clj
+++ src/celestial/persistency/users.clj
@@ -11,13 +11,13 @@

 (ns celestial.persistency.users
   (:require
+    [celestial.model :refer (operations)]
     [cemerick.friend.credentials :as creds]
     [celestial.roles :refer (roles admin)]
     [celestial.common :refer (import-logging)]
     [cemerick.friend :as friend]
     [subs.core :as subs :refer (validate! combine when-not-nil validation every-v every-kv)]
     [puny.core :refer (entity)]
-    [celestial.jobs :refer (operations)]
     [clojure.core.strint :refer (<<)]
     ))

@@ -46,7 +46,7 @@

 (def user-v
   {:username #{:required :String!} :password #{:required :String!}
-   :roles #{:required :role*} :envs #{:required :env*} :operations #{:required :operation*}})
+   :roles #{:required :role*} :envs #{:required :env*} :operations #{:operation*}})

 (validation :role (when-not-nil roles (<< "role must be either ~{roles}")))


Only delete keypairs when present

Only delete keypairs when present

--- src/circle/backend/action/nodes.clj
+++ src/circle/backend/action/nodes.clj
@@ -46,8 +46,9 @@
     (when (seq ids)
       (infof "terminating nodes %s" ids)
       (apply ec2/terminate-instances! ids))
-    (infof "deleting keypair %s" (-> @build :node :keypair-name))
-    (ec2/delete-keypair (-> @build :node :keypair-name))))
+    (when (-> @build :node :keypair-name)
+      (infof "deleting keypair %s" (-> @build :node :keypair-name))
+      (ec2/delete-keypair (-> @build :node :keypair-name)))))

 (defaction stop-nodes []
   {:name "stop nodes"}


Add missing require

Add missing require

--- src/clj/org/openforis/ceo/https.clj
+++ src/clj/org/openforis/ceo/https.clj
@@ -1,7 +1,8 @@
 (ns org.openforis.ceo.https
-  (:require [clojure.java.io :as io]
+  (:require [clojure.java.io    :as io]
             [clojure.java.shell :as sh]
-            [clojure.string :as str]
+            [clojure.string     :as str]
+            [clojure.tools.cli         :refer [parse-opts]]
             [org.openforis.ceo.logging :refer [log-str]]))

 (def path-env (System/getenv "PATH"))


refactoring, owner search support

refactoring, owner search support

--- src/clj/swarmpit/couchdb/client.clj
+++ src/clj/swarmpit/couchdb/client.clj
@@ -54,33 +54,34 @@
                  :query-params params}]
     (execute @(http/delete url options))))

-(defn- get-doc
-  [id]
-  (get (str "/swarmpit/" id)))
-
-(defn- create-doc
+(defn get-doc
+  [id]
+  (try
+    (get (str "/swarmpit/" id))
+    (catch Exception _)))
+
+(defn create-doc
   [doc]
   (post "/swarmpit" doc))

-(defn- find-doc
+(defn find-docs
+  ([type]
+   (find-docs nil type))
+  ([query type]
+   (->> {:selector (merge query {:type {"$eq" type}})}
+        (post "/swarmpit/_find")
+        :docs)))
+
+(defn find-doc
   [query type]
-  (->> {:selector (merge query {:type {"$eq" type}})}
-       (post "/swarmpit/_find")
-       :docs
-       (first)))
-
-(defn- find-all-docs
-  [type]
-  (->> {:selector {:type {"$eq" type}}}
-       (post "/swarmpit/_find")
-       :docs))
-
-(defn- delete-doc
+  (first (find-docs query type)))
+
+(defn delete-doc
   [doc]
   (let [url (str "/swarmpit/" (:_id doc))]
     (delete url {:rev (:_rev doc)})))

-(defn- update-doc
+(defn update-doc
   ([doc delta]
    (let [url (str "/swarmpit/" (:_id doc))]
      (put url (merge doc delta))))
@@ -110,39 +111,52 @@

 ;; Docker user

-(defn docker-users
-  []
-  (find-all-docs "dockeruser"))
-
-(defn docker-user
+(defn dockerusers
+  [owner]
+  (find-docs {"$or" [{:owner {"$eq" owner}}
+                     {:public {"$eq" true}}]} "dockeruser"))
+
+(defn dockeruser
   [id]
   (get-doc id))

-(defn docker-user-by-name
+(defn dockeruser-exist?
+  [docker-user]
+  (some? (find-doc {:username {"$eq" (:username docker-user)}
+                    :owner    {"$eq" (:owner docker-user)}} "dockeruser")))
+
+(defn dockeruser-by-name
   [username]
   (find-doc {:username {"$eq" username}} "dockeruser"))

-(defn create-docker-user
+(defn create-dockeruser
   [docker-user]
   (create-doc docker-user))

-(defn delete-docker-user
+(defn delete-dockeruser
   [docker-user]
   (delete-doc docker-user))

 ;; Registry

 (defn registries
-  []
-  (find-all-docs "registry"))
+  [owner]
+  (find-docs {"$or" [{:owner {"$eq" owner}}
+                     {:public {"$eq" true}}]} "registry"))

 (defn registry
   [id]
   (get-doc id))

+(defn registry-exist?
+  [registry]
+  (some? (find-doc {:name  {"$eq" (:name registry)}
+                    :owner {"$eq" (:owner registry)}} "registry")))
+
 (defn registry-by-name
-  [name]
-  (find-doc {:name {"$eq" name}} "registry"))
+  [name owner]
+  (find-doc {:name  {"$eq" name}
+             :owner {"$eq" owner}} "registry"))

 (defn create-registry
   [registry]
@@ -156,7 +170,7 @@

 (defn users
   []
-  (find-all-docs "user"))
+  (find-docs "user"))

 (defn user
   [id]


preconditions

preconditions


precondition

precondition

--- src/cljs/tictactoe/logic/board.cljs
+++ src/cljs/tictactoe/logic/board.cljs
@@ -15,9 +15,12 @@
   [_]
   cst/board-size)

+(def valid-coordinate? (set cst/coordinates))
+
 (defn convert-cell
   "Assign the cell [x y] to a new player"
   [board player x y]
+  {:pre [(valid-coordinate? [x y])]}
   (assoc board [x y] player))

 (defn is-cell-owned?


Add logs for entry on AND and OR nodes

Add logs for entry on AND and OR nodes

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -1154,6 +1154,7 @@
 (defn reader3-run-and-node
   "Execute an AND node."
   [env plan node]
+  (reader3-node-log! env node {::pt/event ::and-node-run})
   (if (::p/async-parser? env)
     (reader3-run-and-node-async env plan node)
     (reader3-run-and-node-sync env plan node)))
@@ -1189,6 +1190,7 @@
 (defn reader3-run-or-node
   "Execute an OR node."
   [env plan node]
+  (reader3-node-log! env node {::pt/event ::or-node-run})
   (if (::p/async-parser? env)
     (reader3-run-or-node-async env plan node)
     (reader3-run-or-node-sync env plan node)))