set queue tab on mass plays

set queue tab on mass plays

--- src/cljs/western_music/handlers.cljs
+++ src/cljs/western_music/handlers.cljs
@@ -98,7 +98,9 @@
 (reg-event-fx
   :play-composer
   (fn [{db :db} [_ composer-id]]
-    {:db (ui/enqueue-composer db composer-id)
+    {:db (-> db
+             (ui/enqueue-composer composer-id)
+             (update :data/ui ui/set-tab :queue))
      :dispatch [:player-play]}))

 (reg-event-db
@@ -109,7 +111,9 @@
 (reg-event-fx
   :play-nation
   (fn [{db :db} [_ nation-id]]
-    {:db (ui/enqueue-nation db nation-id)
+    {:db (-> db
+             (ui/enqueue-nation nation-id)
+             (update :data/ui ui/set-tab :queue))
      :dispatch [:player-play]}))

 (reg-event-fx


Modified invalid exclude message

Modified invalid exclude message

--- src/cmr/common/services/messages.clj
+++ src/cmr/common/services/messages.clj
@@ -49,6 +49,8 @@
     (format "Pattern option setting disallowed on these parameters: %s" params)))

 (defn invalid-exclude-param-msg
-  "Creates a message saying supplied parameter is not in exclude params set."
-  [param]
-  (format "Parameter [%s] can not be used with exclude." param))
+  "Creates a message saying supplied parameter(s) are not in exclude params set."
+  ([]
+   (format "Some or all of the supplied parameters can not be used with exclude."))
+  ([param]
+   (format "Parameter [%s] can not be used with exclude." param)))


Tried to move event-pair System builder

Tried to move event-pair System builder

Into the same namespace as the Components it's built around. This is
really just a comment about why that doesn't work and where to find
that System definition instead.

(Motivated by continuous surprise that such a System definition doesn't
exist where I expect to find it)

--- src/com/frereth/common/async_zmq.clj
+++ src/com/frereth/common/async_zmq.clj
@@ -580,19 +580,10 @@
   [cfg]
   (map->EventPair (select-keys cfg [:_name])))

-(s/defn obsolete-event-system :- EventInterface
-  [{:keys [ex-sock in-chan external-reader external-writer _name]
-    :as cfg}]
-  ;; The EventPairInterface and actual EventPair are so tightly coupled that I don't think
-  ;; it will ever make any sense to try to have one without the other.
-  ;; At the same time, there's so much going on that my internal OOP refuses
-  ;; to just cram them back together
-  ;; So use this as a middle step for pieces that are really dynamic and not
-  ;; tied to the System's lifetime
-  ;; Note that callers are responsible for calling component/stop.
-  ;; Which is totally backwards.
-  ;; This approach seems like a really bad idea.
-  (throw (ex-info "Obsolete" {:replacement 'com.frereth.common.system/build-event-loop}))
-  (let [system (component/system-map :interface (ctor-interface (select-keys cfg [ex-sock in-chan external-reader external-writer]))
-                                     :loop (component/using (ctor (select-keys cfg [:_name])) [:interface]))]
-    (component/start system)))
+;;; I keep being surprised that I don't have a unified Component that wraps those
+;;; two into a neat little bow. They're so tightly coupled that I can't imagine
+;;; ever wanting one without the other.
+
+;;; That's in the system namespace.
+;;; Can't really move the definition into here because I wind up with this namespace
+;;; trying to (require) itself when I try to start the System.


[#1796] Refactor

[#1796] Refactor

remove unused let binding and only let those bindings that are used
more than once

--- backend/src/akvo/lumen/lib/import.clj
+++ backend/src/akvo/lumen/lib/import.clj
@@ -75,13 +75,11 @@

 (defn handle-import-request [tenant-conn config error-tracker claims data-source]
   (let [data-source-id (str (util/squuid))
-        job-execution-id (str (util/squuid))
-        table-name (util/gen-table-name "ds")
-        kind (get-in data-source ["source" "kind"])]
+        job-execution-id (str (util/squuid))]
     (insert-data-source tenant-conn {:id data-source-id
                                      :spec (json/generate-string data-source)})
     (insert-job-execution tenant-conn {:id job-execution-id
                                        :data-source-id data-source-id})
     (do-import tenant-conn config error-tracker job-execution-id claims)
     (lib/ok {"importId" job-execution-id
-             "kind" kind})))
+             "kind" (get-in data-source ["source" "kind"])})))


CMR-5307,CMR-5317,CMR-5318,CMR-5325,CMR-5327,CMR-5332: Place exclusion on newline.

--- message-queue-lib/project.clj
+++ message-queue-lib/project.clj
@@ -18,7 +18,8 @@
   :dependencies [[cheshire "5.8.1"]
                  [clj-http "2.3.0"]
                  [clj-time "0.15.1"]
-                 [com.amazonaws/aws-java-sdk-sns ~aws-java-sdk-version :exclusions [com.fasterxml.jackson.core/jackson-databind]]
+                 [com.amazonaws/aws-java-sdk-sns ~aws-java-sdk-version
+                  :exclusions [com.fasterxml.jackson.core/jackson-databind]]
                  [com.amazonaws/aws-java-sdk-sqs ~aws-java-sdk-version]
                  [com.fasterxml.jackson.core/jackson-databind "2.9.8"]
                  [commons-codec/commons-codec "1.11"]


Explicit requirement on menu

Explicit requirement on menu

--- modules/bootstrap/project.clj
+++ modules/bootstrap/project.clj
@@ -11,5 +11,6 @@
                  [prismatic/plumbing "0.2.2"]
                  [hiccup "1.0.5"]
                  [garden "1.1.5"]
+                 [juxt.modular/menu "0.5.3"]
                  [juxt.modular/web-template "0.5.1"]
                  [juxt.modular/bidi "0.5.2"]])


Change ::color spec to allow one or multiple ansi-codes

--- src/zprint/spec.cljc
+++ src/zprint/spec.cljc
@@ -2,6 +2,7 @@
   #?@(:cljs [[:require-macros [zprint.smacros :refer [only-keys]]]])
   (:require clojure.string
             [clojure.walk :refer [prewalk]]
+            [zprint.ansi :refer [ansi-codes]]
             #?@(:clj [[zprint.smacros :refer [only-keys]]
                       [clojure.spec.alpha :as s]]
                 :cljs [[cljs.spec.alpha :as s]])))
@@ -39,7 +40,9 @@
 ;; ## Color keys
 ;;

-(s/def ::color #{:red :purple :green :blue :magenta :yellow :black :cyan})
+(def ansi-code (-> ansi-codes keys set))
+
+(s/def ::color (s/or :code ansi-code :codes (s/coll-of ansi-code)))

 (s/def ::brace ::color)
 (s/def ::bracket ::color)


emit time-left to dashboard

emit time-left to dashboard

--- src/server/core.cljs
+++ src/server/core.cljs
@@ -116,6 +116,7 @@

         (.. io (to "game") (emit "time-left" s))
         (.. io (to "mc") (emit "time-left" s))
+        (.. io (to "dashboard") (emit "time-left" s))
         (.. io (to "lobby") (emit "start-game"))

         (if-not (zero? s)


Don't presume to know the key value.

Don't presume to know the key value.

[ci skip]

--- src/onyx/windowing/window_id.clj
+++ src/onyx/windowing/window_id.clj
@@ -74,7 +74,7 @@
 ;; WID requires that a strict lower-bound of the windowing attribute
 ;; be defined. In our example, this will be 0. We will use a window
 ;; range of 20, and a slide value of 5. `extents` tells of which values
-;; of `:window-key` fall into their respect windows via:
+;; of the windowing key fall into their respect windows via:
 ;;
 ;; (doseq [n (range 20)]
 ;;  (println n ": " (extents 0 20 5 n)))
@@ -108,17 +108,17 @@
 ;; `wids` is defined in section 3.4 of the paper. This is the variant
 ;; of the algorithm that also covers the case where range and slide
 ;; are defined on the same value.
-(defn wids-lower [min-windowing-attr w-slide t]
-  (dec (long (Math/floor (/ (- (:window-key t)
+(defn wids-lower [min-windowing-attr w-slide w-key t]
+  (dec (long (Math/floor (/ (- (get t w-key)
                                min-windowing-attr) w-slide)))))

-(defn wids-upper [min-windowing-attr w-range w-slide t]
-  (dec (long (Math/floor (/ (- (+ (:window-key t) w-range)
+(defn wids-upper [min-windowing-attr w-range w-slide w-key t]
+  (dec (long (Math/floor (/ (- (+ (get t w-key) w-range)
                                min-windowing-attr) w-slide)))))

-(defn wids [min-windowing-attr w-range w-slide t]
-  (let [lower (wids-lower min-windowing-attr w-slide t)
-        upper (wids-upper min-windowing-attr w-range w-slide t)]
+(defn wids [min-windowing-attr w-range w-slide w-key t]
+  (let [lower (wids-lower min-windowing-attr w-slide w-key t)
+        upper (wids-upper min-windowing-attr w-range w-slide w-key t)]
     (range (inc lower) (inc upper))))

 ;; The follow code runs through 30 segments with
@@ -127,7 +127,7 @@
 ;; up with both tables we looked at above.
 ;;
 ;; (doseq [n (range 30)]
-;;   (println n "=>" (wids 0 20 5 {:window-key n})))
+;;   (println n "=>" (wids 0 20 5 :k {:k n})))

 ;; 0 => (0 1 2 3)
 ;; 1 => (0 1 2 3)
@@ -165,8 +165,9 @@
    "one segment per fixed window" 100000
    [w-range-and-slide gen/s-pos-int
     w-attr gen/pos-int]
-   (let [segment {:window-key w-attr}
-         buckets (wids 0 w-range-and-slide w-range-and-slide segment)]
+   (let [w-key :window-key
+         segment {:window-key w-attr}
+         buckets (wids 0 w-range-and-slide w-range-and-slide w-key segment)]
      (is (= 1 (count buckets))))))

 (deftest sliding-windows
@@ -175,8 +176,9 @@
    [w-slide gen/s-pos-int
     multiple gen/s-pos-int
     w-attr gen/pos-int]
-   (let [segment {:window-key w-attr}
-         buckets (wids 0 (* multiple w-slide) w-slide segment)]
+   (let [w-key :window-key
+         segment {:window-key w-attr}
+         buckets (wids 0 (* multiple w-slide) w-slide w-key segment)]
      (is (= multiple (count buckets))))))

 (deftest inverse-functions
@@ -186,9 +188,10 @@
    [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)]
+   (let [w-key :window-key
+         values (extents 0 (* multiple w-slide) w-slide extent-id)]
      (is (every? #(some #{extent-id}
-                        (wids 0 (* multiple w-slide) w-slide {:window-key %}))
+                        (wids 0 (* multiple w-slide) w-slide w-key {:window-key %}))
                  values)))))

 (def windows
@@ -260,8 +263,9 @@
 (def w-slide (* 1000 60 20))

 (doseq [p people]
-  (let [segment (assoc p :window-key (.getTime (random-timestamp)))
-        assigned-extents (wids 0 w-range w-slide segment)]
+  (let [w-key :event-time
+        segment (assoc p w-key (.getTime (random-timestamp)))
+        assigned-extents (wids 0 w-range w-slide w-key segment)]
     (doseq [e assigned-extents]
       (swap! state update e conj p))))


util/simpledb.clj: added select-items

util/simpledb.clj: added select-items

--- src/org/altlaw/util/simpledb.clj
+++ src/org/altlaw/util/simpledb.clj
@@ -67,3 +67,11 @@
   ([domain-name query-string]
      (.getItemList (.listItems (get-domain domain-name)
                                query-string))))
+
+(defn select-items
+  ([domain-name query-string]
+     (select-items domain-name query-string nil))
+  ([domain-name query-string next-token]
+     (reduce (fn [m [k v]] (assoc m k (parse-attr-list v)))
+             {} (.getItems (.selectItems (get-domain domain-name)
+                                         query-string next-token)))))


Missed an instance of util/line

Missed an instance of util/line

--- src/oxcart/passes/tree_shake.clj
+++ src/oxcart/passes/tree_shake.clj
@@ -61,7 +61,7 @@
       (assert (:forms (get whole-program-ast m)))

       (doseq [ast (:forms (get whole-program-ast m))]
-        (debug "Pondering line:" (util/line ast) (:op ast))
+        (debug "Pondering line:" (util/format-line-info ast) (:op ast))

         (if (pattern/def? ast)
           (if (contains? reach-set (:var ast))


Move all output into the run-listener

Move all output into the run-listener

--- src/radicalzephyr/boot_junit.clj
+++ src/radicalzephyr/boot_junit.clj
@@ -52,7 +52,9 @@
     (testRunStarted [description]
       (println "Test started!"))
     (testRunFinished [result]
-      (println "\nTest run finished!"))
+      (println "\nTest run finished!")
+      (when (> (.getFailureCount result) 0)
+        (println (result->map result))))
     (testStarted [description]
       (print "."))
     (testFailure [failure]
@@ -64,11 +66,9 @@
   (core/with-pre-wrap fileset
     (if (seq packages)
       (let [^JUnitCore core (doto (JUnitCore.)
-                              (.addListener run-listener))
-            result (.run core
-                         (into-array Class
-                                     (find-all-tests packages)))]
-        (when (> (.getFailureCount result) 0)
-          (println (result->map result))))
+                              (.addListener run-listener))]
+        (.run core
+              (into-array Class
+                          (find-all-tests packages))))
       (println "No packages were tested."))
     fileset))


all-guests test fix

all-guests test fix

--- test/clj/just_married/db_test.clj
+++ test/clj/just_married/db_test.clj
@@ -42,5 +42,5 @@
                       :last-name "bros"
                       :family-name "Plumbers"})

-      (let [res (j/query database-url)]
+      (let [res (db/all-guests!)]
         (is (= 2 (count res)))))))


Adding test code from Java SDK

Adding test code from Java SDK

--- test/clojure_fabric/core_test.clj
+++ test/clojure_fabric/core_test.clj
@@ -1,5 +1,6 @@
 (ns clojure-fabric.core-test
   (:require [clojure.test :refer :all]
+            [clojure.java.io :as io]
             [clojure-fabric.core :refer :all]
             [clojure-fabric.crypto-suite :as crypto-suite]
             [clojure-fabric.grpc-core :as grpc]))
@@ -7,6 +8,33 @@
 ;;;
 ;;; (Originally from End2endAndBackaGainIT.java)
 ;;;
+;;; Test scenario
+;;;
+;;; 1. Create two - v1 and v11, in resource/fixture/gocc/ - chaincode IDs
+;;; 2. Create
+;;;
+;;;
+;;;
+
+;;;
+;;; Utility functions
+;;;
+(defn domain-name->cert-map
+  [domain-name]
+  (let [cert-pem (-> "fixture/e2e-2Orgs/channel/crypto-config/peerOrganizations/%s/ca/ca.%s-cert.pem"
+                     (format domain-name domain-name)
+                     (io/resource)
+                     (io/as-file))]
+    (if cert-pem
+      {:pem-file                cert-pem
+       :allow-all-host-names    true}
+      {})))
+
+(defonce default-defs
+  {:invoke-wait-time    100000
+   :deploy-wait-time    120000
+   :proposal-wait-time  120000})
+
 (defonce chaincode-id-defs
   {:v1  {:name "example_cc_go" :path "github.com/example_cc" :version "1"}
    :v11 {:name "example_cc_go" :path "github.com/example_cc" :version "11"}})
@@ -15,7 +43,33 @@
   {:foo {:name "foo"}
    :bar {:name "bar"}})

-;;;;
+(defonce org-defs
+  (into {}
+        (map #(vector (:msp-id %)
+                      (merge % (domain-name->cert-map (:domain-name %))))
+             [{:msp-id                   "Org1MSP"
+               :domain-name              "org1.example.com"
+               :ca-location              "http://localhost:7054"
+               :ca-name                  "ca0"
+               :peer-locations           ["peer0.org1.example.com@grpc://localhost:7051"
+                                          "peer1.org1.example.com@grpc://localhost:7056"]
+               :orderer-locations        ["orderer.example.com@grpc://localhost:7050"]
+               :eventhub-locations       ["peer0.org1.example.com@grpc://localhost:7053"
+                                          "peer1.org1.example.com@grpc://localhost:7058"]
+               :pem-file                 nil
+               :allow-all-host-names     false}
+              {:msp-id                   "Org2MSP"
+               :domain-name              "org2.example.com"
+               :ca-location              "http://localhost:8054"
+               :ca-name                  "ca0"
+               :peer-locations           ["peer0.org2.example.com@grpc://localhost:8051"
+                                          "peer1.org2.example.com@grpc://localhost:8056"]
+               :orderer-locations        ["orderer.example.com@grpc://localhost:7050"]
+               :eventhub-locations       ["peer0.org2.example.com@grpc://localhost:8053"
+                                          "peer1.org2.example.com@grpc://localhost:8058"]
+               :pem-file                 nil
+               :allow-all-host-names     false}])))
+

 (defonce chaincode-id-v1 (grpc/make-chaincode-id (get-in chaincode-id-defs [:v1 :name])
                                                  (get chaincode-id-defs :v1)))


fix reflection warnings

fix reflection warnings

--- dada-core/src/main/clojure/org/dada/core/jms/JMSServiceFactory.clj
+++ dada-core/src/main/clojure/org/dada/core/jms/JMSServiceFactory.clj
@@ -34,21 +34,21 @@
    ])

 (defn -decouple [#^org.dada.core.jms.JMSServiceFactory this #^Object target]
-  (let [[_ _ _ _ _ _ _ name-getter] (.state this)
+  (let [[_ _ _ _ _ _ _ #^Getter name-getter] (.state this)
 	server-name (.get name-getter target)]
     (.server this target server-name)
     (.client this server-name)
     ))

 (defn -client [#^org.dada.core.jms.JMSServiceFactory this #^String end-point]
-  (let [[session destination-factory _ _ interface timeout true-async _ _ protocol] (.state this)]
+  (let [[session #^DestinationFactory destination-factory _ _ interface timeout true-async _ _ protocol] (.state this)]
     (Proxy/newProxyInstance
      (.getContextClassLoader (Thread/currentThread))
      (into-array Class [interface])
      (SynchronousClient. session (.createDestination destination-factory session (str end-point "." protocol)) interface timeout true-async))))

 (defn -server [#^org.dada.core.jms.JMSServiceFactory this #^Object target #^String end-point]
-  (let [[session destination-factory executor-service producer _ _ _ _ invoker protocol] (.state this)]
+  (let [[#^Session session #^DestinationFactory destination-factory #^ExecutorService executor-service producer _ _ _ _ #^Invoker invoker protocol] (.state this)]
     (.setMessageListener
      (.createConsumer session (.createDestination destination-factory session (str end-point "." protocol)))
      (proxy [MessageListener] [] (onMessage [message] (.execute executor-service (fn [] (.invoke invoker target session message producer))))))


update lein profiles

update lein profiles

--- tag-clojure/lein/profiles.clj
+++ tag-clojure/lein/profiles.clj
@@ -10,6 +10,7 @@
                   [lein-vanity "0.2.0"]
                   [lein-ring "0.8.11"]
                   [lein-cloudbees "1.0.5"]
+                  [venantius/ultra "0.4.0"]
                   [org.clojure/tools.trace "0.7.8"]]
         :dependencies [[alembic "0.3.2"]
                        [org.clojure/tools.nrepl "0.2.7"]]}}


Use localstorage ... WIP

Use localstorage ... WIP

--- examples/todomvc/src/todomvc/handlers.cljs
+++ examples/todomvc/src/todomvc/handlers.cljs
@@ -1,6 +1,6 @@
 (ns todomvc.handlers
   (:require
-    [todomvc.db    :refer [default-value valid-schema?]]
+    [todomvc.db    :refer [default-value valid-schema? get-local-storage]]
     [re-frame.core :refer [register-pure-handler
                            path after
                            trim-v
@@ -8,9 +8,11 @@

 ;; -- Middleware --------------------------------------------------------------
-;; To be used for handlers operating solely on todos
 ;;
+;; checks that the structure in app-db matches the schema
 (def check-schema (after valid-schema?))
+
+;; middleware for any handler which manipulates todos.
 (def todo-middleware [check-schema (path [:todos])  debug  trim-v])

@@ -29,10 +31,11 @@
   :initialise-db                  ;; event id being handled
   check-schema                    ;; middleware
   (fn  [_ _]                      ;; the handler
-    default-value))               ;; all hail the new state
+    (merge default-value
+           (get-local-storage))))    ;; all hail the new state

-(register-pure-handler            ;; disptached to when user changes the bottom filter
+(register-pure-handler            ;; handlers changes the footer filter
   :set-showing                    ;; event-id
   [check-schema debug trim-v]     ;; middleware  (wraps the handler)
   (fn                             ;; handler
@@ -40,10 +43,10 @@
     (assoc db :showing filter-kw)))

-(register-pure-handler             ;; given only the text, create a new todo
+(register-pure-handler             ;; given the text, create a new todo
   :add-todo
-  todo-middleware                  ;; only 'todo' part of db provided
-  (fn [todos [text]]
+  todo-middleware
+  (fn [todos [text]]               ;; "path" middlware means we are given :todo
     (let [id  (next-id todos)]
       (assoc todos id {:id id :title text :done false}))))

@@ -52,7 +55,7 @@
   :complete-all-toggle
   todo-middleware
   (fn [todos]
-    (let [val (not-every? :done (vals todos))]
+    (let [val (not-every? :done (vals todos))]   ;; toggle true or false?
       (reduce #(assoc-in %1 [%2 :done] val)
               todos
               (keys todos)))))


Add a test for spliced seqs

Add a test for spliced seqs

--- test/momentum/test/core/async.clj
+++ test/momentum/test/core/async.clj
@@ -789,3 +789,13 @@
   (let [coll    (seq [1 2 3])
         spliced (splice {:ch1 coll})]
     (is (= coll (get spliced :ch1)))))
+
+(deftest pulling-the-last-item-in-a-spliced-seq-removes-the-key
+  (let [ch (channel)
+        spliced (splice {:ch (seq ch)})]
+    (put ch :omg)
+    (close ch)
+    (doasync spliced
+      (fn [[[k v] & more]]
+        (is (= [k v] [:ch :omg]))
+        (is (nil? (get more :ch)))))))


Catch all React errors during tests

Catch all React errors during tests

--- test/reagenttest/testreagent.cljs
+++ test/reagenttest/testreagent.cljs
@@ -901,6 +901,29 @@
 (defn foo []
   [:div])

+(defn log-error [& f]
+  (debug/error (apply str f)))
+
+(defn wrap-capture-window-error [f]
+  (fn []
+    (let [org js/console.onerror]
+      (set! js/window.onerror (fn [e]
+                                (log-error e)
+                                true))
+      (try
+        (f)
+        (finally
+          (set! js/window.onerror org))))))
+
+(defn wrap-capture-console-error [f]
+  (fn []
+    (let [org js/console.error]
+      (set! js/console.error log-error)
+      (try
+        (f)
+        (finally
+          (set! js/console.error org))))))
+
 (deftest test-err-messages
   (when (dev?)
     (is (thrown-with-msg?
@@ -934,24 +957,27 @@
             pkg "reagenttest.testreagent."
             stack1 (str "in " pkg "comp1")
             stack2 (str "in " pkg "comp2 > " pkg "comp1")
-            lstr (fn [& s] (list (apply str s)))
             re (fn [& s]
                  (re-pattern (apply str s)))
             rend (fn [x]
                    (with-mounted-component x identity))]
         (let [e (debug/track-warnings
-                 #(is (thrown-with-msg?
-                       :default (re "Invalid tag: 'div.' \\(" stack2 "\\)")
-                       (rend [comp2 [:div. "foo"]]))))]
-          (is (= e
-                 {:error (lstr "Error rendering component (" stack2 ")")})))
+                  (wrap-capture-window-error
+                    (wrap-capture-console-error
+                      #(is (thrown-with-msg?
+                             :default (re "Invalid tag: 'div.' \\(" stack2 "\\)")
+                             (rend [comp2 [:div. "foo"]]))))))]
+          (is (= (last (:error e))
+                 (str "Error rendering component (" stack2 ")"))))

         (let [e (debug/track-warnings
-                 #(is (thrown-with-msg?
-                       :default (re "Invalid tag: 'div.' \\(" stack1 "\\)")
-                       (rend [comp1 [:div. "foo"]]))))]
-          (is (= e
-                 {:error (lstr "Error rendering component (" stack1 ")")})))
+                  (wrap-capture-window-error
+                    (wrap-capture-console-error
+                      #(is (thrown-with-msg?
+                             :default (re "Invalid tag: 'div.' \\(" stack1 "\\)")
+                             (rend [comp1 [:div. "foo"]]))))))]
+          (is (= (last (:error e))
+                 (str "Error rendering component (" stack1 ")"))))

         (let [e (debug/track-warnings #(r/as-element [nat]))]
           (is (re-find #"Using native React classes directly"
@@ -981,11 +1007,14 @@
           comp1 (fn comp1 []
                   ($ nil :foo)
                   [:div "foo"])]
-      (with-mounted-component [error-boundary [comp1]]
-        (fn [c div]
-          (r/flush)
-          (is (= "Cannot read property 'foo' of null" (.-message @error)))
-          (is (found-in #"Something went wrong\." div)))))))
+      (debug/track-warnings
+        (wrap-capture-window-error
+          (wrap-capture-console-error
+            #(with-mounted-component [error-boundary [comp1]]
+               (fn [c div]
+                 (r/flush)
+                 (is (= "Cannot read property 'foo' of null" (.-message @error)))
+                 (is (found-in #"Something went wrong\." div))))))))))

 (deftest test-dom-node
   (let [node (atom nil)


added back code which is not dead yet

added back code which is not dead yet

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -365,6 +365,19 @@
              (if (feature/enabled? :ui-v2)
                (ssh-ad-v2 build owner)
                (ssh-ad build owner)))])))))
+
+(defn build-time-visualization [build owner]
+  (reify
+    om/IDidMount
+    (did-mount [_]
+      (-> js/console (.log "did-mount calling get-node"))
+      (let [el (om/get-node owner)]
+        (viz-build/visualize-timing! el build)))
+    om/IRender
+    (render [_]
+      (js/console.log "build-time-visualization render called")
+      (html
+       [:div.build-time-visualization]))))

 (defn cleanup-artifact-path [path]
   (-> path


wip on om remote

wip on om remote

--- src/tango/cljs/client.cljs
+++ src/tango/cljs/client.cljs
@@ -94,6 +94,7 @@
   (do
     (log (apply str (map :competition/name d)))
     ;(d/transact! (d/db conn) )
+    (d/transact! conn [{:db/id 1 :competition/name (apply str (map :competition/name d))}])
     ))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -117,9 +118,10 @@

 (defmethod event-msg-handler :chsk/recv
   [{:as ev-msg :keys [?data]}]
-  (do
-    (log (str "Push event from server: " ?data))
-    (handle-query-result (second ?data))))
+  (let [[topic payload] ?data]
+    (log (str "Push event from server: " ev-msg))
+    (when (= topic :event-manager/query-result)
+      (handle-query-result (second ?data)))))

 (defmethod event-msg-handler :chsk/handshake
   [{:as ev-msg :keys [?data]}]
@@ -154,6 +156,7 @@
   [{:keys [state query] :as env} key params]
   {:value (do
             ;(log (str "Env: " env " --- Key : " key " --- Params" params))
+            (log "Read app/competitions")
             (d/q '[:find [(pull ?e ?selector) ...]
                    :in $ ?selector
                    :where [?e :competition/name]]
@@ -176,10 +179,15 @@
 ;; read operations should follow a mutation. :tempids will be discussed later.
 ;; Mutations can easily change multiple aspects of the application (think Facebook "Add Friend").
 ;; Adding :value with a :keys vector helps users identify stale keys which should be re-read.
+;; (defmethod mutate 'app/name
+;;   [{:keys [state]} _ _]
+;;   {:value {:keys [:competition/name]}
+;;    :action (fn [] (d/transact! state [{:db/id 1 :competition/name "B"}]))})
+
 (defmethod mutate 'app/name
   [{:keys [state]} _ _]
-  {:value {:keys [:competition/name]}
-   :action (fn [] (d/transact! state [{:db/id 1 :competition/name "B"}]))})
+  {:value {:keys [:app/competitions]}
+   :action (fn [] (chsk-send! [:event-manager/query [[:competition/name :competition/location]]]))})

 (defn test-query-click [t]
   (do
@@ -188,14 +196,6 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Components
-
-;; (defui Competition
-;;   Object
-;;   (render
-;;    [this]
-;;    (dom/div nil "Hi mom I'm a competition")))
-
-;; (def competition (om/factory Competition))

 (defui Competition
   Object
@@ -232,74 +232,27 @@
          (dom/th nil "Namn")
          (dom/th nil "Plats")))
        (apply dom/tbody nil (map competition competitions))
-       ;; (dom/tbody
-       ;;  nil
-       ;;  (apply dom/tr nil
-       ;;         (map competition competitions)))
-       ))
-     ;(dom/div nil (competition (first competitions)))
+
+       )
+      (dom/button
+       #js {:onClick
+            (fn [e]
+              (test-query-click this)
+                                        ;(chsk-send! [:event-manager/query [[:competition/name :competition/location]]])
+               )}
+        "Query")
+      )
+
      )))

-(defui Tester
-  static om/IQuery
-  (query [this]
-         [{:app/competitions [:competition/name :competition/location {:competition/classes [:class/name]}]}])
-  Object
-  (render
-   [this]
-   (let [{:keys [app/competitions]} (get-in (om/props this) [:app/competitions 0])
-         entity (first (:app/competitions (om/props this)))]
-     ;;(log "Props =>")
-     ;;(log (om/props this))
-     (dom/div
-      nil
-      (dom/div
-       nil
-       (str "Competition 1 " (:competition/name entity)))
-      (dom/div
-       nil
-       (str "Location " (:competition/location entity)))
-      (dom/div
-       nil
-       (str "# classes " (count (:competition/classes entity))))
-      (competition) ;;(dom/div nil "Hi mom I'm a competition")
-      ;; (for [x (:competition/classes (first (:app/competitions (om/props this))))]
-      ;;   (dom/div nil x))
-      (dom/div
-       nil
-       (dom/button
-        #js {:onClick
-             (fn [e]
-               (test-query-click this)
-               ;(chsk-send! [:event-manager/query [[:competition/name :competition/location]]])
-               )}
-        "Query"))))))
-
-;; (defui Counter
-;;   static om/IQuery
-;;   (query [this]
-;;     [{:app/counter [:db/id :app/title :app/count]}])
-;;   Object
-;;   (render [this]
-;;     (let [{:keys [app/title app/count] :as entity}
-;;           (get-in (om/props this) [:app/counter 0])]
-;;       (dom/div nil
-;;         (dom/h2 nil title)
-;;         (dom/span nil (str "Count: " count))
-;;         (dom/button
-;;           #js {:onClick
-;;                (fn [e]
-;;                  (om/transact! this
-;;                    `[(app/increment ~entity)]))}
-;;           "Click me!")))))
+

 (defn transit-post [url]
   (fn [{:keys [remote]} cb]
     (do
       (log "Post")
-      (log remote)
-      ;(cb [:a])
-      )
+      (log (str "Remote " remote))
+      (cb {}))
     ;; (.send XhrIo url
     ;;   (fn [e]
     ;;     (this-as this
@@ -308,12 +261,20 @@
     ;;   #js {"Content-Type" "application/transit+json"})
     ))

+(defn sente-post []
+  (fn [{:keys [remote] :as env} cb]
+    (do
+      (log "Env > ")
+      (log env)
+      (log (str "Sent to Tango Backend => " remote))
+      (chsk-send! [:event-manager/query [[:competition/name :competition/location]]]))))
+
 (def reconciler
   (om/reconciler
     {:state conn
-     ;:remotes [:remote]
+     :remotes [:remote]
      :parser (om/parser {:read read :mutate mutate})
-     ;:send (transit-post "x") ;(fn [x y] (log (str "Sending to server: x" x " y: " y)))
+     :send (sente-post) ;(fn [x y] (log (str "Sending to server: x" x " y: " y)))
      }))

 ;; (om/add-root! reconciler
@@ -321,3 +282,36 @@

 (om/add-root! reconciler
   CompetitionsView (gdom/getElement "app"))
+
+;; (defui Tester
+;;   static om/IQuery
+;;   (query [this]
+;;          [{:app/competitions [:competition/name :competition/location {:competition/classes [:class/name]}]}])
+;;   Object
+;;   (render
+;;    [this]
+;;    (let [{:keys [app/competitions]} (get-in (om/props this) [:app/competitions 0])
+;;          entity (first (:app/competitions (om/props this)))]
+;;      ;;(log "Props =>")
+;;      ;;(log (om/props this))
+;;      (dom/div
+;;       nil
+;;       (dom/div
+;;        nil
+;;        (str "Competition 1 " (:competition/name entity)))
+;;       (dom/div
+;;        nil
+;;        (str "Location " (:competition/location entity)))
+;;       (dom/div
+;;        nil
+;;        (str "# classes " (count (:competition/classes entity))))
+;;       (competition)
+;;       (dom/div
+;;        nil
+;;        (dom/button
+;;         #js {:onClick
+;;              (fn [e]
+;;                (test-query-click this)
+;;                ;(chsk-send! [:event-manager/query [[:competition/name :competition/location]]])
+;;                )}
+;;         "Query"))))))


Refactor: simplify HTTP server configuration

--- src/territory_bro/main.clj
+++ src/territory_bro/main.clj
@@ -17,10 +17,9 @@

 (mount/defstate ^{:on-reload :noop} http-server
   :start
-  (http/start (-> config/env
-                  (assoc :handler #'router/app)
-                  (update :io-threads #(or % (* 2 (.availableProcessors (Runtime/getRuntime)))))
-                  (update :port #(or (-> config/env :options :port) %))))
+  (http/start {:handler #'router/app
+               :port (:port config/env)
+               :io-threads (* 2 (.availableProcessors (Runtime/getRuntime)))})
   :stop
   (http/stop http-server))


fix: project.clj had a syntax error

fix: project.clj had a syntax error

--- ssclj/jar/project.clj
+++ ssclj/jar/project.clj
@@ -60,7 +60,7 @@
                   "\n"
                   ;; This line is related to the SlipStream project:
                   "API Server: (require '[com.sixsq.slipstream.ssclj.app.server :as server])\n"
-                  "            (def state (server/start 8201))\n"))
+                  "            (def state (server/start 8201))\n"
                   "DB Seeding: (require '[com.sixsq.slipstream.ssclj.resources.seeds.event :as es])\n"
                   "            (es/seed! 10 :bob)\n"))
                 }


minor: adapt project.clj

minor: adapt project.clj

--- ssclj/jar/project.clj
+++ ssclj/jar/project.clj
@@ -1,4 +1,4 @@
-(defproject com.sixsq.slipstream/ssclj "3.5-SNAPSHOT"
+(defproject com.sixsq.slipstream/ssclj "3.6-SNAPSHOT"
   :description    "Clojure REST resources"
   :url            "http://sixsq.com"
   :license {:name "Apache License, Version 2.0"
@@ -96,7 +96,7 @@

    :dev
      { :env {  :clj-env        "development"
-               :config-path    "config-hsqldb-mem.edn"}
+               :config-path    "config-hsqldb.edn"}
        :jvm-opts ["-Dlogfile.path=development"]
        :dependencies [ [peridot/peridot "0.4.1"]
                        [expectations/expectations "2.1.4"]]}


rearrange process-file and walk, change input path to my linux machine's, add two funcs that help clean up dirty HTML

--- src/unicodify_clj/core.clj
+++ src/unicodify_clj/core.clj
@@ -1,11 +1,12 @@
 (ns unicodify-clj.core
   (:require [clojure.java.io :as io]
+            [hickory.core :as hickory]
             [pl.danieljanus.tagsoup :as ts]
             [hiccup.core :as hiccup]
             [clojure.string :as strng]
             [unicodify-clj.transcode :as xc]))

-(def INPUT_PATH "/Users/lukegessler/play/malhar/www.hindi-urdu-malhar.org/")
+(def INPUT_PATH "/home/luke/Sync/playground/malhar/www.hindi-urdu-malhar.org/")
 (def OUTPUT_PATH "/tmp/malhar")

 (defn- transcode
@@ -52,6 +53,31 @@
                                          elt))
         :else elt))

+(defn- DIRTY-strip-out-p-tags
+  "Sometimes a file contains a <p> tag that is not closed (e.g.
+  mirdardinaa%5E.html). This causes the parser to sloppily infer
+  where the </p> should go, which causes transcoding issues. This
+  is an attempt to get rid of these."
+  [s]
+  (if (and (clojure.string/includes? s "<p>")
+           (not (clojure.string/includes? s "</p>")))
+    (clojure.string/replace s #"(<p>\s*)+(\r\n|\r|\n)" "\n")
+    s))
+
+(defn- DIRTY-fix-quotes
+  [s]
+  (clojure.string/replace s #"(?i)face=xdvng" "face=\"Xdvng\""))
+
+(defn- transcode-file-string
+  [s]
+  (-> s
+      DIRTY-strip-out-p-tags
+      DIRTY-fix-quotes
+      hickory/parse
+      hickory/as-hiccup
+      unicodify
+      hiccup/html))
+
 (defn process-file
   [f]
   (let [fname (last (strng/split (.toString f) #"/"))
@@ -62,23 +88,17 @@
     (when (not (.isDirectory f))
       (if (= ext "html")
         (spit (str OUTPUT_PATH "/" fname)
-              (-> f
-                  .toString
-                  ts/parse
-                  unicodify
-                  hiccup/html))
+              (transcode-file-string (slurp f)))
         (io/copy f (io/file (str OUTPUT_PATH "/" fname)))))))

 (defn- walk
   [path]
-  (doall
-   (map #(do
-           (println "Processing file" (.toString %))
-           (process-file %))
-        (file-seq (io/file path))))
+
+  (doseq [file (file-seq (io/file path))]
+    (println "Processing file" (.toString file))
+    (process-file file))
   :ok)

 (defn -main
   []
   (walk INPUT_PATH))
-


Refactor logic-query-tests to use `are`

Refactor logic-query-tests to use `are`

--- test/desdemona/query_test.clj
+++ test/desdemona/query_test.clj
@@ -1,7 +1,7 @@
 (ns desdemona.query-test
   (:require
    [desdemona.query :as q]
-   [clojure.test :refer [deftest is]]))
+   [clojure.test :refer [deftest is are]]))

 (def dsl->logic
   @#'desdemona.query/dsl->logic)
@@ -16,9 +16,11 @@
                           [{:ip "10.0.0.1"}]))))

 (deftest logic-query-tests
-  (is (= []
-         (q/run-logic-query 'l/fail
-                            [{:ip "10.0.0.1"}])))
-  (is (= [[{:ip "10.0.0.1"}]]
-         (q/run-logic-query '(l/featurec x {:ip "10.0.0.1"})
-                            [{:ip "10.0.0.1"}]))))
+  (are [events query results] (= results (q/run-logic-query query events))
+    [{:ip "10.0.0.1"}]
+    'l/fail
+    []
+
+    [{:ip "10.0.0.1"}]
+    '(l/featurec x {:ip "10.0.0.1"})
+    [[{:ip "10.0.0.1"}]]))


Test for parse-boolean existence

Test for parse-boolean existence

--- test/hurvinek/config_test.clj
+++ test/hurvinek/config_test.clj
@@ -37,6 +37,12 @@
     "Check that the hurvinek.config/parse-float definition exists."
     (testing "if the hurvinek.config/parse-float definition exists."
         (is (callable? 'hurvinek.config/parse-float))))
+
+
+(deftest test-parse-boolean-existence
+    "Check that the hurvinek.config/parse-boolean definition exists."
+    (testing "if the hurvinek.config/parse-boolean definition exists."
+        (is (callable? 'hurvinek.config/parse-boolean))))

 (deftest test-load-configuration-existence


Changed OR of multiple string conditions to a single strings condition to reduce size of elasticsearch query and improve performance.

--- src/cmr/search/services/query_walkers/collection_query_resolver.clj
+++ src/cmr/search/services/query_walkers/collection_query_resolver.clj
@@ -169,8 +169,7 @@
       (if (empty? collection-concept-ids)
         [#{} (qm/->MatchNoneCondition)]
         [(set collection-concept-ids)
-         (qm/or-conds
-           (map #(qm/string-condition :collection-concept-id % true false) collection-concept-ids))])))
+         (qm/string-conditions :collection-concept-id collection-concept-ids true)])))

   (is-collection-query-cond? [_] true)


Clean up tests a little

Clean up tests a little

--- test/caesium/crypto/box_test.clj
+++ test/caesium/crypto/box_test.clj
@@ -25,23 +25,19 @@
               kp2 (b/generate-keypair (:secret kp1))]
           (u/array-eq (:public kp1) (:public kp2))))))

-(def nonce (v/hex-resource "vectors/box/nonce"))
-(def plaintext (v/hex-resource "vectors/box/plaintext"))
-(def ciphertext (v/hex-resource "vectors/box/ciphertext"))
-(def bob-secret-key (v/hex-resource "vectors/box/bob-secret-key"))
-(def bob-public-key (v/hex-resource "vectors/box/bob-public-key"))
-(def alice-secret-key (v/hex-resource "vectors/box/alice-secret-key"))
-(def alice-public-key (v/hex-resource "vectors/box/alice-public-key"))
+(def box-vector (partial v/hex-resource "vectors/box/"))

 (deftest box-encrypt-decrypt-test
-  (is (u/array-eq ciphertext
-                  (b/encrypt alice-public-key bob-secret-key nonce plaintext))
-      "Bob can encrypt a message for Alice")
-  (is (u/array-eq plaintext
-                  (b/decrypt bob-public-key alice-secret-key nonce ciphertext))
-      "Alice can decrypt the message from Bob")
-  (let [hex-public-key (u/hexify alice-public-key)
-        hex-private-key (u/hexify bob-secret-key)]
+  (let [nonce (box-vector "nonce")
+        ptext (box-vector "plaintext")
+        ctext (box-vector "ciphertext")
+        bob-pk (box-vector "bob-public-key")
+        bob-sk (box-vector "bob-sk")
+        alice-pk (box-vector "alice-public-key")
+        alice-sk (box-vector "alice-secret-key")]
+    (is (u/array-eq ctext (b/encrypt alice-pk bob-sk nonce ptext)))
+    (is (u/array-eq ptext (b/decrypt bob-pk alice-sk nonce ctext))))
+  (let [hex-pk (u/hexify (box-vector "alice-pk"))
+        hex-sk (u/hexify (box-vector "bob-secret-key"))]
     (is (thrown? java.lang.ClassCastException
-                 (b/encrypt hex-public-key hex-private-key nonce plaintext))
-        "encrypt does not accept strings")))
+                 (b/encrypt hex-pk hex-sk nonce ptext)))))


add CLJS-1225 problem case in comment to compiler tests

--- test/clj/cljs/compiler_tests.clj
+++ test/clj/cljs/compiler_tests.clj
@@ -58,10 +58,16 @@
     (comp/emit
       (ana/analyze aenv
         '(defn foo ([a]) ([a b])))))
+  )

-  (env/with-compiler-env cenv
-    (comp/munge
-      (comp/lazy-load?
+;; CLJS-1225
+
+(comment
+  (binding [ana/*cljs-static-fns* true]
+    (env/with-compiler-env cenv
+      (comp/emit
         (ana/analyze aenv
-          '(defn foo ([a]) ([a b]))))))
+          '(defn incme []
+             (let [incme (fn [a queue & args])]
+               (println (incme 1 [1] 1 1))))))))
   )


Revert a breaking change.

Revert a breaking change.

Apparently it's only within a midje.* namespaces that calling
xml emit on a failure result causes a stack overflow.

--- src/midje/emission/plugins/junit.clj
+++ src/midje/emission/plugins/junit.clj
@@ -90,9 +90,14 @@

 (defn fail [failure-map]
   (let [testcase (testcase-with-failure failure-map)]
-    (log
-      (with-out-str
-        (xml/emit-element testcase)))))
+    ;; FIXME: currently there is a bug in midje that prevents us emitting this map as xml
+    ;; (xml/emit-element testcase) => StackOverflowError, when called in a
+    ;; midje namespace
+    (log (str "<testcase classname='" (-> testcase :attrs :classname) "' name='" (-> testcase :attrs :name)  "'>\n"))
+    (log (str "<failure type='" (-> testcase :content first :attrs :type) "'>"))
+    (log (-> testcase :content first :content :first))
+    (log "</failure>\n")
+    (log "</testcase>")))

 (defn starting-to-check-fact [fact]
   (let [fact-namespace (str (fact/namespace fact))


Remove the debounce from text input

Remove the debounce from text input

--- src/balance/cmn/pages/task_details_page.cljs
+++ src/balance/cmn/pages/task_details_page.cljs
@@ -24,15 +24,17 @@
           {:keys [id title description]} @task]
       [rn/view {:style (:page styles)}
        [rn/text-input {:style                  (:title styles)
-                       :value                  title
+                       :default-value          title
                        :placeholder            "Title"
                        :multiline              true
+                       :auto-correct           false
                        :placeholder-text-color "gray"
                        :on-change-text         #(update-task id [:title] %)}]
        [rn/text-input {:style                  (:description styles)
-                       :value                  description
+                       :default-value          description
                        :placeholder            "Task Description"
                        :multiline              true
+                       :auto-correct           false
                        :placeholder-text-color "gray"
                        :on-change-text         #(update-task id [:description] %)}]])))


Create hyperlinks in comments

Create hyperlinks in comments

--- src/cljs/salava/social/ui/badge_message.cljs
+++ src/cljs/salava/social/ui/badge_message.cljs
@@ -84,6 +84,26 @@
                     }
            (t :badge/Delete)]])])))

+(defn hyperlink [text]
+  (let [url (if (or (re-find #"^https?://" (str text)) (re-find #"^http?://" (str text))) text (str "http://" text))]
+    [:a {:href url
+         :target "_blank"} (str text)]))
+
+(defn blank-reduce [a-seq]
+  (let [str-space (fn [str1 str2]
+                    (do
+                      (let [current (conj str1 " ")]
+                        (conj current str2))))]
+      (reduce str-space ()  a-seq)))
+
+(defn search-and-replace-www [item]
+  (let [split-words (clojure.string/split item #" ")
+        helper (fn [current item]
+                 (if (or (re-find #"www." item) (re-find #"^https?://" item) (re-find #"^http?://" item))
+                     (conj current (hyperlink item))
+                     (conj current (str item))))]
+    (blank-reduce (reduce helper () split-words))))
+
 (defn message-list-item [{:keys [message first_name last_name ctime id profile_picture user_id]} state]
   [:div {:class "media message-item" :key id}
   (if (or (=  user_id (:user_id @state)) (= "admin" (:user_role @state)))
@@ -96,10 +116,7 @@
       [:span.date (date-from-unix-time (* 1000 ctime) "minutes")]
      ]
     (into [:div] (for [ item (clojure.string/split-lines message)]
-                   [:p.msg item]))
-    ]
-   ]
-  )
+                   (into [:p.msg] (search-and-replace-www item))))]])

 (defn message-list-load-more [state]
   (if (pos? (:messages_left @state))
@@ -110,9 +127,7 @@
                   :on-click #(do
                                (init-data state)
                                (.preventDefault %))}
-              (str (t :social/Loadmore) " (" (:messages_left @state) " " (t :social/Messagesleft) ")")]]]
-     ]
-))
+              (str (t :social/Loadmore) " (" (:messages_left @state) " " (t :social/Messagesleft) ")")]]]]))

 (defn scroll-bottom []


Formatting fixes

Formatting fixes

--- bin/bb_test.clj
+++ bin/bb_test.clj
@@ -527,7 +527,7 @@

 -------------------------
 Detected 1 error\n"
-           (expound/expound-str :cat-spec/alt [])))
+             (expound/expound-str :cat-spec/alt [])))
     (is (= "-- Syntax error -------------------

   []
@@ -838,9 +838,9 @@
 ;; (defmethod multi-spec-bar-spec ::b [_] (s/keys :req [::b]))

 #_(deftest multi-spec
-  (testing "missing dispatch key"
-    (is (=
-         "-- Missing spec -------------------
+    (testing "missing dispatch key"
+      (is (=
+           "-- Missing spec -------------------

 Cannot find spec for

@@ -860,10 +860,10 @@

 -------------------------
 Detected 1 error\n"
-         (expound/expound-str :multi-spec/el {}))))
-  (testing "invalid dispatch value"
-    (is (=
-         "-- Missing spec -------------------
+           (expound/expound-str :multi-spec/el {}))))
+    (testing "invalid dispatch value"
+      (is (=
+           "-- Missing spec -------------------

 Cannot find spec for

@@ -883,11 +883,11 @@

 -------------------------
 Detected 1 error\n"
-         (expound/expound-str :multi-spec/el {:multi-spec/el-type :image}))))
-
-  (testing "valid dispatch value, but other error"
-    (is (=
-         "-- Spec failed --------------------
+           (expound/expound-str :multi-spec/el {:multi-spec/el-type :image}))))
+
+    (testing "valid dispatch value, but other error"
+      (is (=
+           "-- Spec failed --------------------

   {:multi-spec/el-type :text}

@@ -906,13 +906,13 @@

 -------------------------
 Detected 1 error\n"
-         (expound/expound-str :multi-spec/el {:multi-spec/el-type :text}))))
-
-  ;; https://github.com/bhb/expound/issues/122
-  (testing "when re-tag is a function"
-    (s/def :multi-spec/b string?)
-    (s/def :multi-spec/bar (s/multi-spec multi-spec-bar-spec (fn [val tag] (assoc val :type tag))))
-    (is (= "-- Missing spec -------------------
+           (expound/expound-str :multi-spec/el {:multi-spec/el-type :text}))))
+
+    ;; https://github.com/bhb/expound/issues/122
+    (testing "when re-tag is a function"
+      (s/def :multi-spec/b string?)
+      (s/def :multi-spec/bar (s/multi-spec multi-spec-bar-spec (fn [val tag] (assoc val :type tag))))
+      (is (= "-- Missing spec -------------------

 Cannot find spec for

@@ -926,7 +926,7 @@
 -------------------------
 Detected 1 error
 "
-           (expound/expound-str :multi-spec/bar {} {:print-specs? false})))))
+             (expound/expound-str :multi-spec/bar {} {:print-specs? false})))))

 (s/def :recursive-spec/tag #{:text :group})
 (s/def :recursive-spec/on-tap (s/coll-of map? :kind vector?))
@@ -1181,11 +1181,11 @@
     (is (= "hello"
            (s/assert :test-assert/name "hello"))))
   (testing "assertion fails"
-           (try
-         (binding [s/*explain-out* expound/printer]
-           (s/assert :test-assert/name :hello))
-         (catch Exception e
-           (is (= "Spec assertion failed
+    (try
+      (binding [s/*explain-out* expound/printer]
+        (s/assert :test-assert/name :hello))
+      (catch Exception e
+        (is (= "Spec assertion failed
 -- Spec failed --------------------

   :hello
@@ -1201,8 +1201,8 @@

 -------------------------
 Detected 1 error\n"
-                  ;; FIXME - move assertion out of catch, similar to instrument tests
-                  (:cause (Throwable->map e))))))))
+               ;; FIXME - move assertion out of catch, similar to instrument tests
+               (:cause (Throwable->map e))))))))

 (s/def :test-explain-str/name string?)
 (deftest test-explain-str
@@ -1368,10 +1368,10 @@

 -------------------------
 Detected 1 error\n"
-           (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-             (s/explain-str
-              :alt-spec/one-many-int-or-str
-              [[:one]]))))
+             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+               (s/explain-str
+                :alt-spec/one-many-int-or-str
+                [[:one]]))))
     (s/def :alt-spec/int-or-str (s/or :i int?
                                       :s string?))
     (s/def :alt-spec/one-many-int-or-str (s/cat :bs (s/alt :one :alt-spec/int-or-str
@@ -1528,9 +1528,9 @@

 -------------------------
 Detected 2 errors\n"
-         (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-           (s/explain-str (s/keys :req-un [:alt-spec/num-types :alt-spec/str-types])
-                          {:num-types [true] :str-types [false]}))))
+           (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+             (s/explain-str (s/keys :req-un [:alt-spec/num-types :alt-spec/str-types])
+                            {:num-types [true] :str-types [false]}))))

   (is (=
        "-- Spec failed --------------------
@@ -1564,18 +1564,18 @@

   ;; mspecs not supported
   #_(is (=
-       ;; This output is not what we want: ideally, the two alternates
-       ;; should be grouped into a single problem.
-       ;; I'm adding it as a spec to avoid regressions and to keep it as
-       ;; an example of something I could improve.
-       ;; The reason we can't do better is that we can't reliably look
-       ;; at the form of a multi-spec. It would be nice if spec inserted
-       ;; the actual spec form that was returned by the multi-spec, but
-       ;; as it stands today, we'd have to figure out how to call the multi-
-       ;; method with the actual value. That would be complicated and
-       ;; potentially have unknown side effects from running arbitrary code.
-
-       "-- Spec failed --------------------
+         ;; This output is not what we want: ideally, the two alternates
+         ;; should be grouped into a single problem.
+         ;; I'm adding it as a spec to avoid regressions and to keep it as
+         ;; an example of something I could improve.
+         ;; The reason we can't do better is that we can't reliably look
+         ;; at the form of a multi-spec. It would be nice if spec inserted
+         ;; the actual spec form that was returned by the multi-spec, but
+         ;; as it stands today, we'd have to figure out how to call the multi-
+         ;; method with the actual value. That would be complicated and
+         ;; potentially have unknown side effects from running arbitrary code.
+
+         "-- Spec failed --------------------

   {:mspec {:tag ..., :one-many-int [[\"1\"]]}}
                                     ^^^^^
@@ -1596,14 +1596,14 @@
 -------------------------
 Detected 2 errors\n"

-       (expound/expound-str
-        (s/keys
-         :req-un [:alt-spec/mspec])
-        {:mspec
-         {:tag :x
-          :one-many-int [["1"]]}}
-
-        {:print-specs? false}))))
+         (expound/expound-str
+          (s/keys
+           :req-un [:alt-spec/mspec])
+          {:mspec
+           {:tag :x
+            :one-many-int [["1"]]}}
+
+          {:print-specs? false}))))

 (defn mutate-coll [x]
   (cond
@@ -1740,16 +1740,16 @@

 ;; FIXME: conformers are pretty advanced, I'm OK if they don't work in spartan.spec yet
 #_(deftest conformers-test
-  ;; Example from http://cjohansen.no/a-unified-specification/
-  (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})
-            *print-namespace-maps* false]
-    (testing "conform string to int"
-      (is (string?
-           (s/explain-str :conformers-test/number "123a"))))
-    ;; Example from https://github.com/bhb/expound/issues/15#issuecomment-326838879
-    (testing "conform maps"
-      (is (string? (s/explain-str :conformers-test/query {})))
-      (is (= "-- Spec failed --------------------
+    ;; Example from http://cjohansen.no/a-unified-specification/
+    (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})
+              *print-namespace-maps* false]
+      (testing "conform string to int"
+        (is (string?
+             (s/explain-str :conformers-test/number "123a"))))
+      ;; Example from https://github.com/bhb/expound/issues/15#issuecomment-326838879
+      (testing "conform maps"
+        (is (string? (s/explain-str :conformers-test/query {})))
+        (is (= "-- Spec failed --------------------

 Part of the value

@@ -1767,14 +1767,14 @@

 -------------------------
 Detected 1 error\n"
-             (s/explain-str :conformers-test/query {:conformers-test.query/id :conformers-test/lookup-user
-                                                    :conformers-test.query/params {}}))))
-    ;; Minified example based on https://github.com/bhb/expound/issues/15
-    ;; This doesn't look ideal, but really, it's not a good idea to use spec
-    ;; for string parsing, so I'm OK with it
-    (testing "conform string to seq"
-      (is (=
-           "-- Spec failed --------------------
+               (s/explain-str :conformers-test/query {:conformers-test.query/id :conformers-test/lookup-user
+                                                      :conformers-test.query/params {}}))))
+      ;; Minified example based on https://github.com/bhb/expound/issues/15
+      ;; This doesn't look ideal, but really, it's not a good idea to use spec
+      ;; for string parsing, so I'm OK with it
+      (testing "conform string to seq"
+        (is (=
+             "-- Spec failed --------------------

   \"A\\C\"
     ^^
@@ -1784,10 +1784,10 @@
 -------------------------
 Detected 1 error
 "
-           (s/explain-str :conformers-test/string-AB "AC"))))
-    (testing "s/cat"
-      (s/def :conformers-test/sorted-pair (s/and (s/cat :x int? :y int?) #(< (-> % :x) (-> % :y))))
-      (is (= "-- Spec failed --------------------
+             (s/explain-str :conformers-test/string-AB "AC"))))
+      (testing "s/cat"
+        (s/def :conformers-test/sorted-pair (s/and (s/cat :x int? :y int?) #(< (-> % :x) (-> % :y))))
+        (is (= "-- Spec failed --------------------

   [1 0]

@@ -1804,8 +1804,8 @@
 -------------------------
 Detected 1 error
 "
-             (expound/expound-str :conformers-test/sorted-pair [1 0] {:print-specs? false})))
-      (is (= "-- Spec failed --------------------
+               (expound/expound-str :conformers-test/sorted-pair [1 0] {:print-specs? false})))
+        (is (= "-- Spec failed --------------------

   [... [1 0]]
        ^^^^^
@@ -1822,8 +1822,8 @@

 -------------------------
 Detected 1 error\n"
-             (expound/expound-str (s/coll-of :conformers-test/sorted-pair) [[0 1] [1 0]] {:print-specs? false})))
-      (is (= "-- Spec failed --------------------
+               (expound/expound-str (s/coll-of :conformers-test/sorted-pair) [[0 1] [1 0]] {:print-specs? false})))
+        (is (= "-- Spec failed --------------------

   {:a [1 0]}
       ^^^^^
@@ -1840,8 +1840,8 @@

 -------------------------
 Detected 1 error\n"
-             (expound/expound-str (s/map-of keyword? :conformers-test/sorted-pair) {:a [1 0]} {:print-specs? false})))
-      (is (= "-- Spec failed --------------------
+               (expound/expound-str (s/map-of keyword? :conformers-test/sorted-pair) {:a [1 0]} {:print-specs? false})))
+        (is (= "-- Spec failed --------------------

   [... \"a\"]
        ^^^
@@ -1852,14 +1852,14 @@

 -------------------------
 Detected 1 error\n"
-             (expound/expound-str :conformers-test/sorted-pair [1 "a"] {:print-specs? false}))))
-    (testing "conformers that modify path of values"
-      (s/def :conformers-test/vals (s/coll-of (s/and string?
-                                                     #(re-matches #"[A-G]+" %))))
-      (s/def :conformers-test/csv (s/and string?
-                                         (s/conformer parse-csv)
-                                         :conformers-test/vals))
-      (is (= "-- Spec failed --------------------
+               (expound/expound-str :conformers-test/sorted-pair [1 "a"] {:print-specs? false}))))
+      (testing "conformers that modify path of values"
+        (s/def :conformers-test/vals (s/coll-of (s/and string?
+                                                       #(re-matches #"[A-G]+" %))))
+        (s/def :conformers-test/csv (s/and string?
+                                           (s/conformer parse-csv)
+                                           :conformers-test/vals))
+        (is (= "-- Spec failed --------------------

 Part of the value

@@ -1875,17 +1875,17 @@

 -------------------------
 Detected 1 error\n"
-             (expound/expound-str :conformers-test/csv "abc,def,ghi" {:print-specs? false}))))
-
-    ;; this is NOT recommended!
-    ;; so I'm not inclined to make this much nicer than
-    ;; the default spec output
-    (s/def :conformers-test/coerced-kw (s/and (s/conformer #(if (string? %)
-                                                              (keyword %)
-                                                              ::s/invalid))
-                                              keyword?))
-    (testing "coercion"
-      (is (= "-- Spec failed --------------------
+               (expound/expound-str :conformers-test/csv "abc,def,ghi" {:print-specs? false}))))
+
+      ;; this is NOT recommended!
+      ;; so I'm not inclined to make this much nicer than
+      ;; the default spec output
+      (s/def :conformers-test/coerced-kw (s/and (s/conformer #(if (string? %)
+                                                                (keyword %)
+                                                                ::s/invalid))
+                                                keyword?))
+      (testing "coercion"
+        (is (= "-- Spec failed --------------------

   nil

@@ -1902,10 +1902,10 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str :conformers-test/coerced-kw nil))))
-
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str :conformers-test/coerced-kw nil))))
+
+        (is (= "-- Spec failed --------------------

   [... ... ... 0]
                ^
@@ -1923,15 +1923,15 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str (s/coll-of :conformers-test/coerced-kw) ["a" "b" "c" 0])))))
-    ;; Also not recommended
-    (s/def :conformers-test/str-kw? (s/and (s/conformer #(if (string? %)
-                                                           (keyword %)
-                                                           ::s/invalid)
-                                                        name) keyword?))
-    (testing "coercion with unformer"
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str (s/coll-of :conformers-test/coerced-kw) ["a" "b" "c" 0])))))
+      ;; Also not recommended
+      (s/def :conformers-test/str-kw? (s/and (s/conformer #(if (string? %)
+                                                             (keyword %)
+                                                             ::s/invalid)
+                                                          name) keyword?))
+      (testing "coercion with unformer"
+        (is (= "-- Spec failed --------------------

   nil

@@ -1948,10 +1948,10 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str :conformers-test/coerced-kw nil))))
-
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str :conformers-test/coerced-kw nil))))
+
+        (is (= "-- Spec failed --------------------

   [... ... ... 0]
                ^
@@ -1969,17 +1969,17 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str (s/coll-of :conformers-test/coerced-kw) ["a" "b" "c" 0])))))
-
-    (s/def :conformers-test/name string?)
-    (s/def :conformers-test/age pos-int?)
-    (s/def :conformers-test/person (s/keys* :req-un [:conformers-test/name
-                                                     :conformers-test/age]))
-    ;; FIXME: Implementation could be simpler once
-    ;; https://dev.clojure.org/jira/browse/CLJ-2406 is fixed
-    (testing "spec defined with keys*"
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str (s/coll-of :conformers-test/coerced-kw) ["a" "b" "c" 0])))))
+
+      (s/def :conformers-test/name string?)
+      (s/def :conformers-test/age pos-int?)
+      (s/def :conformers-test/person (s/keys* :req-un [:conformers-test/name
+                                                       :conformers-test/age]))
+      ;; FIXME: Implementation could be simpler once
+      ;; https://dev.clojure.org/jira/browse/CLJ-2406 is fixed
+      (testing "spec defined with keys*"
+        (is (= "-- Spec failed --------------------

   [... ... ... :Stan]
                ^^^^^
@@ -1991,11 +1991,11 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str :conformers-test/person [:age 30 :name :Stan])))))
-
-    (testing "spec defined with keys* and copies of bad value elsewhere in the data"
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str :conformers-test/person [:age 30 :name :Stan])))))
+
+      (testing "spec defined with keys* and copies of bad value elsewhere in the data"
+        (is (= "-- Spec failed --------------------

 Part of the value

@@ -2011,13 +2011,13 @@

 -------------------------
 Detected 1 error\n"
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str (s/tuple
-                               keyword?
-                               :conformers-test/person) [:Stan [:age 30 :name :Stan]])))))
-
-    (testing "ambiguous value"
-      (is (= "-- Spec failed --------------------
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str (s/tuple
+                                 keyword?
+                                 :conformers-test/person) [:Stan [:age 30 :name :Stan]])))))
+
+      (testing "ambiguous value"
+        (is (= "-- Spec failed --------------------

   {[0 1] ..., [1 0] ...}
               ^^^^^
@@ -2035,9 +2035,9 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
-               (s/explain-str (s/map-of :conformers-test/sorted-pair any?) {[0 1] [1 0]
-                                                                            [1 0] [1 0]})))))))
+               (binding [s/*explain-out* (expound/custom-printer {:print-specs? false})]
+                 (s/explain-str (s/map-of :conformers-test/sorted-pair any?) {[0 1] [1 0]
+                                                                              [1 0] [1 0]})))))))

 (s/def :duplicate-preds/str-or-str (s/or
                                     ;; Use anonymous functions to assure
@@ -2066,7 +2066,7 @@

 -------------------------
 Detected 1 error\n"
-           (expound/expound-str :duplicate-preds/str-or-str 1)))))
+         (expound/expound-str :duplicate-preds/str-or-str 1)))))

 (s/def :fspec-test/div (s/fspec
@@ -2088,8 +2088,8 @@

 ;; FIXME - support fspec
 #_(deftest fspec-exception-test
-  (testing "args that throw exception"
-    (is (= "-- Exception ----------------------
+    (testing "args that throw exception"
+      (is (= "-- Exception ----------------------

   expound.alpha-test/my-div

@@ -2115,10 +2115,10 @@
 -------------------------
 Detected 1 error\n"

-           ;;
-           (until-unsuccessful #(expound/expound-str :fspec-test/div my-div))))
-
-    (is (= "-- Exception ----------------------
+             ;;
+             (until-unsuccessful #(expound/expound-str :fspec-test/div my-div))))
+
+      (is (= "-- Exception ----------------------

   [expound.alpha-test/my-div]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -2144,7 +2144,7 @@

 -------------------------
 Detected 1 error\n"
-           (until-unsuccessful #(expound/expound-str (s/coll-of :fspec-test/div) [my-div]))))))
+             (until-unsuccessful #(expound/expound-str (s/coll-of :fspec-test/div) [my-div]))))))

 (s/def :fspec-ret-test/my-int pos-int?)
@@ -2157,8 +2157,8 @@

 ;; FIXME: support fspec
 #_(deftest fspec-ret-test
-  (testing "invalid ret"
-    (is (= "-- Function spec failed -----------
+    (testing "invalid ret"
+      (is (= "-- Function spec failed -----------

   expound.alpha-test/my-plus

@@ -2172,9 +2172,9 @@

 -------------------------
 Detected 1 error\n"
-           (until-unsuccessful #(expound/expound-str :fspec-ret-test/plus my-plus {:print-specs? false}))))
-
-    (is (= "-- Function spec failed -----------
+             (until-unsuccessful #(expound/expound-str :fspec-ret-test/plus my-plus {:print-specs? false}))))
+
+      (is (= "-- Function spec failed -----------

   [expound.alpha-test/my-plus]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -2189,11 +2189,11 @@

 -------------------------
 Detected 1 error\n"
-           (until-unsuccessful #(expound/expound-str (s/coll-of :fspec-ret-test/plus) [my-plus] {:print-specs? false}))))
-    (s/def :fspec-ret-test/return-map (s/fspec
-                                       :args (s/cat)
-                                       :ret (s/keys :req-un [:fspec-ret-test/my-int])))
-    (is (= "-- Function spec failed -----------
+             (until-unsuccessful #(expound/expound-str (s/coll-of :fspec-ret-test/plus) [my-plus] {:print-specs? false}))))
+      (s/def :fspec-ret-test/return-map (s/fspec
+                                         :args (s/cat)
+                                         :ret (s/keys :req-un [:fspec-ret-test/my-int])))
+      (is (= "-- Function spec failed -----------

   <anonymous function>

@@ -2210,9 +2210,9 @@
 -------------------------
 Detected 1 error
 "
-           (until-unsuccessful #(expound/expound-str :fspec-ret-test/return-map
-                                                     (fn [] {})
-                                                     {:print-specs? false}))))))
+             (until-unsuccessful #(expound/expound-str :fspec-ret-test/return-map
+                                                       (fn [] {})
+                                                       {:print-specs? false}))))))

 (s/def :fspec-fn-test/minus (s/fspec
                              :args (s/cat :x int? :y int?)


(SERVER-294) update test case to match agent

Update a test case for the /file_bucket_file endpoint to match the
behavior of Puppet 4 agents, which will now correctly set the
Content-Type as "application/octet-stream" instead of "text/plain"
(PUP-3812).

--- test/integration/puppetlabs/services/jruby/request_handler_test.clj
+++ test/integration/puppetlabs/services/jruby/request_handler_test.clj
@@ -63,18 +63,11 @@
                                                        (subs expected-md5 0 8))
                                           expected-md5
                                           "contents"])
-               ;; This accept and content-type header match what the Puppet
-               ;; agent sends to the master for a file-bucket PUT. Ideally,
-               ;; these should both be 'application/octet-stream', but for now
-               ;; we have to live with 'binary' content-type because
-               ;; everything is terrible.
                options                 (merge ssl-request-options
                                               {:body (ByteArrayInputStream.
                                                        raw-byte-arr)
-                                               :headers {"accept"
-                                                           "binary"
-                                                         "content-type"
-                                                           "application/octet-stream"}})
+                                               :headers {"accept" "application/octet-stream"
+                                                         "content-type" "application/octet-stream"}})
                response (http-client/put (str "https://localhost:8140/"
                                               "puppet/v3/file_bucket_file/md5/"
                                               expected-md5


Don't mention (outdated) RabbitMQ version in catalog description

--- src/rabbitmq-broker/src/clojure/io/pivotal/pcf/rabbitmq/server.clj
+++ src/rabbitmq-broker/src/clojure/io/pivotal/pcf/rabbitmq/server.clj
@@ -70,7 +70,7 @@

 (def catalog {:services [{:name "p-rabbitmq"
                           :provider "pivotal"
-                          :description "RabbitMQ version 3.3.x"
+                          :description "RabbitMQ messaging broker"
                           :tags ["rabbitmq" "rabbit" "messaging" "message-queue" "amqp" "mqtt" "stomp"]}]})

 (defn init-catalog!


Fixed indentation and moved recur into tail position

- also uses case now instead of if
- uses unicode escape sequence for character 27 (ESC)
- not yet functional, I think

--- Clojure/src/snake/terminal_reader.clj
+++ Clojure/src/snake/terminal_reader.clj
@@ -1,24 +1,16 @@
 (ns snake.terminal-reader)

 (defn read-input [input-receiver]
-	(loop [data (read)]
-    (if (= data "")
-        ((print "UP")
-         (recur (read)))
-   ((if (= data "")
-        ((print "DOWN")
-         (recur (read)))
-   ( ;default
-    (recur (str data (read)))))))))
-;		(case data
-;			"" ( ;(send input-receiver move 'up)
-;				       (print "UP")
-;				       ; (recur [data (read)])
-;             )
-;			"" (print "DOWN")
-;
-;			((print (str "DEFAULT" data))
-;			 (recur (str data (read)))))))
+  (loop [data (read)]
+    (case data
+      "\u001B[A" ( ;(send input-receiver move 'up)
+              (print "UP")
+              ; (recur [data (read)])
+              )
+      "\u001B[B" (print "DOWN")
+
+      (print (str "DEFAULT" data)))
+    (recur (str data (read)))))

 (defn start [input-receiver]
-	(send (agent nil) read-input input-receiver))
+  (send (agent nil) read-input input-receiver))


Refactor of structural validation

Refactor of structural validation

Factored out the least pure bits of the main fn so it can be more easily tested

--- src/kixi/datastore/structural_validation.clj
+++ src/kixi/datastore/structural_validation.clj
@@ -29,37 +29,40 @@
           f)
       (error "File does exist: " id))))

+(def max-errors 10)  ;Maybe this should be some sort of %age of file size
+
 (defn csv-schema-test
-  [schemastore schema-id file]
-  (let [schema (sv/schema-id->schema schemastore schema-id)]
-    (try
-      (with-open [contents (io/reader file)]
-        (let [lines (->> contents
-                         line-seq
-                         rest)          ;header line
-              invalids (into [] (comp (take 10)
-                                      (remove #(s/valid? schema %))
-                                      (map #(parse-csv % :strict true))) lines)]
-          (if (first invalids)
-            {::ms/valid false
-             ::ms/explain (map #(s/explain-data schema %) invalids)} ;This should be some sort of %age of file size
-            {::ms/valid true})))
-      (catch Exception e
-        {::ms/valid false
-         :e e}))))
+  [schema file]
+  (try
+    (with-open [contents (io/reader file)]
+      (let [lines (-> contents
+                      line-seq
+                      rest)             ;header line
+            invalids (into [] (comp (map #(parse-csv % :strict true))
+                                    (map first)
+                                    (remove #(s/valid? schema %))
+                                    (take max-errors)) lines)]
+        (if (first invalids)
+          {::ms/valid false
+           ::ms/explain (map #(s/explain-data schema %) invalids)}
+          {::ms/valid true})))
+    (catch Exception e
+      {::ms/valid false
+       :e e})))

 (defn structural-validator
   [filestore schemastore]
   (fn [metadata]
     (when-let [^File file (metadata->file filestore metadata)]
       (try
-        {:kixi.comms.event/key :kixi.datastore/file-metadata-updated
-         :kixi.comms.event/version "1.0.0"
-         :kixi.comms.event/payload {::ms/file-metadata-update-type ::ms/file-metadata-structural-validation-checked
-                                    ::ms/id (::ms/id metadata)
-                                    ::ms/structural-validation
-                                    (case (::ms/type metadata)
-                                      "csv" (csv-schema-test schemastore (::ss/id metadata) file))}}
+        (let [schema (sv/schema-id->schema schemastore (::ss/id metadata))
+              result (case (::ms/type metadata)
+                       "csv" (csv-schema-test schema file))]
+          {:kixi.comms.event/key :kixi.datastore/file-metadata-updated
+           :kixi.comms.event/version "1.0.0"
+           :kixi.comms.event/payload {::ms/file-metadata-update-type ::ms/file-metadata-structural-validation-checked
+                                      ::ms/id (::ms/id metadata)
+                                      ::ms/structural-validation result}})
         (finally
           (.delete file))))))


Updating version to 1.63.2-SNAPSHOT

Updating version to 1.63.2-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.63.1"
+(defproject cook "1.63.2-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.10.3"]


Bump to 1.42.6-SNAPSHOT

Bump to 1.42.6-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.42.5"
+(defproject cook "1.42.6-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Fix packetTypes restriction removal

Fix packetTypes restriction removal

--- src/cljs/demtools/core.cljs
+++ src/cljs/demtools/core.cljs
@@ -149,10 +149,7 @@
                       parser (.getParser demo)

                       parse-chan
-                      (chan
-                       1 (comp
-                          (map (aget % "packetType")))
-                          (x/reductions into [])))]
+                      (chan 1 (x/reductions into []))]
                   (cb {:parser-state "parsing"
                        :header (js->clj (.readHeader parser)
                                         :keywordize-keys true)})


fix #197 weird animation

fix #197 weird animation

Former-commit-id: b98293ceddb1161241a746636f0f5eb778d405ec

--- src/status_im/chats_list/screen.cljs
+++ src/status_im/chats_list/screen.cljs
@@ -42,50 +42,31 @@
                                           :style  st/search-icon}
                                 :handler (fn [])}}]])

-(defn chats-list [{platform-specific :platform-specific}]
-  (let [chats (subscribe [:get :chats])
-        chats-scrolled? (subscribe [:get :chats-scrolled?])
-        animation? (subscribe [:animations :tabs-bar-animation?])
-        tabs-bar-value (subscribe [:animations :tabs-bar-value])
-        container-height (r/atom 0)
-        content-height (r/atom 0)]
-    (dispatch [:set :chats-scrolled? false])
-    (fn []
-      [view st/chats-container
-       [chats-list-toolbar platform-specific]
-       [list-view {:dataSource          (to-datasource @chats)
-                   :renderRow           (fn [row _ _]
-                                          (list-item [chat-list-item row]))
-                   :style               st/list-container
-                   ;;; if "maximizing" chat list will make scroll to 0,
-                   ;;; then disable maximazing
-                   :onLayout            (fn [event]
-                                          (when-not @chats-scrolled?
-                                            (let [height (.. event -nativeEvent -layout -height)]
-                                              (reset! container-height height))))
-                   :onContentSizeChange (fn [width height]
-                                          (reset! content-height height))
-                   :onScroll            (fn [e]
-                                          (let [offset             (.. e -nativeEvent -contentOffset -y)
-                                                min-content-height (+ @container-height tabs-height)
-                                                scrolled?          (and (< 0 offset) (< min-content-height @content-height))]
-                                            (dispatch [:set :chats-scrolled? scrolled?])
-                                            (dispatch [:set-animation :tabs-bar-animation? true])))}]
-       [animated-view {:style         (st/action-buttons-container @animation? (or @tabs-bar-value 0))
-                       :pointerEvents :box-none}
-        [action-button {:buttonColor color-blue
-                        :offsetY     16
-                        :offsetX     16}
-         [action-button-item
-          {:title       (label :t/new-chat)
-           :buttonColor :#9b59b6
-           :onPress     #(dispatch [:show-group-contacts :people])}
-          [ion-icon {:name  :md-create
-                     :style st/create-icon}]]
-         [action-button-item
-          {:title       (label :t/new-group-chat)
-           :buttonColor :#1abc9c
-           :onPress     #(dispatch [:show-group-new])}
-          [ion-icon {:name  :md-person
-                     :style st/person-stalker-icon}]]]]
-       [bottom-gradient]])))
+(defview chats-list [{platform-specific :platform-specific}]
+  [chats [:get :chats]]
+  ;; todo what is this?!
+  #_(dispatch [:set :chats-scrolled? false])
+  [view st/chats-container
+   [chats-list-toolbar platform-specific]
+   [list-view {:dataSource (to-datasource chats)
+               :renderRow  (fn [row _ _]
+                             (list-item [chat-list-item row]))
+               :style      st/list-container}]
+   [view {:style         (st/action-buttons-container false 0)
+          :pointerEvents :box-none}
+    [action-button {:buttonColor color-blue
+                    :offsetY     16
+                    :offsetX     16}
+     [action-button-item
+      {:title       (label :t/new-chat)
+       :buttonColor :#9b59b6
+       :onPress     #(dispatch [:show-group-contacts :people])}
+      [ion-icon {:name  :md-create
+                 :style st/create-icon}]]
+     [action-button-item
+      {:title       (label :t/new-group-chat)
+       :buttonColor :#1abc9c
+       :onPress     #(dispatch [:show-group-new])}
+      [ion-icon {:name  :md-person
+                 :style st/person-stalker-icon}]]]]
+   [bottom-gradient]])


9cc345d housekeeping

9cc345d housekeeping

--- src/taoensso/carmine/connections.clj
+++ src/taoensso/carmine/connections.clj
@@ -168,13 +168,14 @@
     (let [^URI uri (if (instance? URI uri) uri (URI. uri))
           [user password] (.split (str (.getUserInfo uri)) ":")
           port (.getPort uri)
-          db (if-let [db-str (last (re-matches #"/(\d+)" (.getPath uri)))] (Integer. ^String db-str))]
+          db (if-let [[_ db-str] (re-matches #"/(\d+)$" (.getPath uri))]
+               (Integer. ^String db-str))]
       (-> {:host (.getHost uri)}
           (#(if (pos? port)        (assoc % :port     port)     %))
           (#(if (and db (pos? db)) (assoc % :db       db)       %))
           (#(if password           (assoc % :password password) %))))))

-(comment (parse-uri "redis://redistogo:pass@panga.redistogo.com:9475/"))
+(comment (parse-uri "redis://redistogo:pass@panga.redistogo.com:9475/7"))

 (def conn-spec
   (memoize


Minor renamings

Minor renamings

--- clojure-client/src/breakbox/client.clj
+++ clojure-client/src/breakbox/client.clj
@@ -37,13 +37,13 @@

-(defn add-fault [fault-name service type & additional-args]
-  (doseq [host (:hosts service)]
+(defn add-fault [fault-name config type & additional-args]
+  (doseq [host (:hosts config)]
     (let [url (str "http://" host ":6660")]
-      (post url (fault-command fault-name service type (apply hash-map additional-args))))))
+      (post url (fault-command fault-name config type (apply hash-map additional-args))))))

-(defn reset [service]
-  (doseq [host (:hosts service)]
+(defn reset [config]
+  (doseq [host (:hosts config)]
      (let [url (str "http://" host ":6660")]
        (delete url))))


Disable compiler infer warnings for inlined reagent.ratom

--- gen-src/day8/re_frame_10x/inlined_deps/reagent/v1v0v0/reagent/ratom.cljs
+++ gen-src/day8/re_frame_10x/inlined_deps/reagent/v1v0v0/reagent/ratom.cljs
@@ -6,6 +6,8 @@
             [day8.re-frame-10x.inlined-deps.reagent.v1v0v0.reagent.impl.batching :as batch]
             [clojure.set :as s]
             [goog.object :as obj]))
+
+(set! *warn-on-infer* false)

 (declare flush!)