Use newly defined functions in benchmark.

--- test/benchmark_test/method_call_tests.clj
+++ test/benchmark_test/method_call_tests.clj
@@ -1,11 +1,10 @@
 (ns benchmark-test.method-call-tests
   (:require
+    [clojure-method-call-benchmark.core :refer :all]
     [clojure.test :refer :all]
     [criterium [core :as cc]])
   (:import
-    (clojure.lang IFn)
-    )
-  )
+    (clojure.lang IFn)))

 (deftest baseline-0
   (println "\nRunning: baseline-0")
@@ -53,221 +52,58 @@

 (deftest condp-benchmark-0
   (println "\nRunning: condp-benchmark-0")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
+  (let [o (condp-obj-0 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
         :verbose))))

 (deftest condp-benchmark-1
   (println "\nRunning: condp-benchmark-1")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              :foo_0 0
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
+  (let [o (condp-obj-1 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
         :verbose))))

 (deftest condp-benchmark-2
   (println "\nRunning: condp-benchmark-2")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              :foo_0 0
-              :foo_1 1
-              :foo_2 2
-              :foo_3 3
-              :foo_4 4
-              :foo_5 5
-              :foo_6 6
-              :foo_7 7
-              :foo_8 8
-              :foo_9 9
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
+  (let [o (condp-obj-2 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
         :verbose))))

 (deftest condp-benchmark-3
   (println "\nRunning: condp-benchmark-3")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              :foo_0 0
-              :foo_1 1
-              :foo_2 2
-              :foo_3 3
-              :foo_4 4
-              :foo_5 5
-              :foo_6 6
-              :foo_7 7
-              :foo_8 8
-              :foo_9 9
-              :foo_10 10
-              :foo_11 11
-              :foo_12 12
-              :foo_13 13
-              :foo_14 14
-              :foo_15 15
-              :foo_16 16
-              :foo_17 17
-              :foo_18 18
-              :foo_19 19
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
+  (let [o (condp-obj-3 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
         :verbose))))

 (deftest condp-benchmark-4
-  (println "\nRunning: condp-benchmark-4")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              :foo_0 0
-              :foo_1 1
-              :foo_2 2
-              :foo_3 3
-              :foo_4 4
-              :foo_5 5
-              :foo_6 6
-              :foo_7 7
-              :foo_8 8
-              :foo_9 9
-              :foo_10 10
-              :foo_11 11
-              :foo_12 12
-              :foo_13 13
-              :foo_14 14
-              :foo_15 15
-              :foo_16 16
-              :foo_17 17
-              :foo_18 18
-              :foo_19 19
-              :foo_20 20
-              :foo_21 21
-              :foo_22 22
-              :foo_23 23
-              :foo_24 24
-              :foo_25 25
-              :foo_26 26
-              :foo_27 27
-              :foo_28 28
-              :foo_29 29
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
-        :verbose))))
+(println "\nRunning: condp-benchmark-4")
+(let [o (condp-obj-4 1)]
+  (cc/with-progress-reporting
+    (cc/quick-bench
+      (o 2)
+      :verbose))))

 (deftest condp-benchmark-5
   (println "\nRunning: condp-benchmark-5")
-  (let [res 1
-        f (fn [arg]
-            (condp = arg
-              :foo_0 0
-              :foo_1 1
-              :foo_2 2
-              :foo_3 3
-              :foo_4 4
-              :foo_5 5
-              :foo_6 6
-              :foo_7 7
-              :foo_8 8
-              :foo_9 9
-              :foo_10 10
-              :foo_11 11
-              :foo_12 12
-              :foo_13 13
-              :foo_14 14
-              :foo_15 15
-              :foo_16 16
-              :foo_17 17
-              :foo_18 18
-              :foo_19 19
-              :foo_20 20
-              :foo_21 21
-              :foo_22 22
-              :foo_23 23
-              :foo_24 24
-              :foo_25 25
-              :foo_26 26
-              :foo_27 27
-              :foo_28 28
-              :foo_29 29
-              :foo_30 30
-              :foo_31 31
-              :foo_32 32
-              :foo_33 33
-              :foo_34 34
-              :foo_35 35
-              :foo_36 36
-              :foo_37 37
-              :foo_38 38
-              :foo_39 39
-              (+ res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
-        :verbose))))
-
-(deftest if-condp-benchmark-0
-  (println "\nRunning: if-condp-benchmark-0")
-  (let [res 1
-        f (fn [arg]
-            (if (not (keyword? arg))
-              (+ res arg)
-              (condp = arg
-                :foo_0 0
-                :foo_1 1
-                :foo_2 2
-                :foo_3 3
-                :foo_4 4
-                :foo_5 5
-                :foo_6 6
-                :foo_7 7
-                :foo_8 8
-                :foo_9 9
-                :foo_10 10
-                :foo_11 11
-                :foo_12 12
-                :foo_13 13
-                :foo_14 14
-                :foo_15 15
-                :foo_16 16
-                :foo_17 17
-                :foo_18 18
-                :foo_19 19
-                :foo_20 20
-                :foo_21 21
-                :foo_22 22
-                :foo_23 23
-                :foo_24 24
-                :foo_25 25
-                :foo_26 26
-                :foo_27 27
-                :foo_28 28
-                :foo_29 29
-                :foo_30 30
-                :foo_31 31
-                :foo_32 32
-                :foo_33 33
-                :foo_34 34
-                :foo_35 35
-                :foo_36 36
-                :foo_37 37
-                :foo_38 38
-                :foo_39 39)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f 2)
+  (let [o (condp-obj-5 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
+        :verbose))))
+
+(deftest condp-if-benchmark-0
+  (println "\nRunning: condp-if-benchmark-0")
+  (let [o (condp-if-obj-0 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (o 2)
         :verbose))))

 (deftest map-benchmark-0


Weak-password disallows confirm code step

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/multiaccounts/create/core.cljs
+++ src/status_im/multiaccounts/create/core.cljs
@@ -138,12 +138,16 @@
 (fx/defn intro-step-forward
   {:events [:intro-wizard/step-forward-pressed]}
   [{:keys [db] :as cofx} {:keys [skip?] :as opts}]
-  (let  [{:keys [step first-time-setup? selected-storage-type processing?]} (:intro-wizard db)]
+  (let  [{:keys [step selected-storage-type processing? weak-password?]} (:intro-wizard db)]
     (cond (confirm-failure? db)
           (on-confirm-failure cofx)

           (= step :generate-key)
           (init-key-generation cofx)
+
+          (and  (= step :create-code)
+                (= weak-password? true))
+          nil

           (and (= step :confirm-code)
                (not processing?))


Story ID: RPC-236 fixed triple->assertion behavior messages not being behavioral

--- test/untangled_spec/assertions_spec.cljc
+++ test/untangled_spec/assertions_spec.cljc
@@ -1,7 +1,9 @@
 (ns untangled-spec.assertions-spec
   #?(:clj
-      (:require [untangled-spec.core :as c :refer [specification behavior provided assertions]]
-                [clojure.test :as t :refer (are is deftest with-test run-tests testing do-report)]
+      (:require [untangled-spec.core :as c
+                 :refer [specification behavior provided assertions]]
+                [clojure.test :as t
+                 :refer [are is deftest with-test run-tests testing do-report]]
                 [untangled-spec.assertions
                  :refer [exception-matches? triple->assertion]]
                 ))
@@ -46,31 +48,30 @@
             =throws=> (clojure.lang.ExceptionInfo #"not match regex"))))

       (behavior "triple->assertion"
-        (behavior "takes a 3-tuple of (actual,arrow,expected)"
-          (behavior "and for the => arrow, returns an equality check"
-            (assertions
-              (triple->assertion '(left => right))
-              =fn=> (check-assertion #(->> % first (= 'clojure.core/=)))
-              ))
-          (behavior "and for the =fn=> arrow, returns a fn call"
-            (assertions
-              (triple->assertion '(left =fn=> right))
-              =fn=> (check-assertion #(->> % first (= 'right)))
-              ))
-          (behavior "and for the =throws=> arrow, returns a try-catch"
-            (assertions
-              (triple->assertion '(left =throws=> (right)))
-              =fn=> (check-assertion
-                      #(and (->> % first (= 'try))
-                            (->> % second (= 'left))
-                            (-> % (nth 2) first (= 'throw))
-                            (->> % last first (= 'catch))))))
-          (behavior "any other arrow, throws an ex-info"
-            (assertions
-              (triple->assertion '(left =bad-arrow=> right))
-              =throws=> (ExceptionInfo
-                          #"invalid arrow"
-                          #(-> % ex-data (= {:arrow '=bad-arrow=>})))))))
+        (behavior "checks equality with the => arrow"
+          (assertions
+            (triple->assertion '(left => right))
+            =fn=> (check-assertion #(->> % first (= 'clojure.core/=)))
+            ))
+        (behavior "verifies actual with the =fn=> function"
+          (assertions
+            (triple->assertion '(left =fn=> right))
+            =fn=> (check-assertion #(->> % first (= 'right)))
+            ))
+        (behavior "verifies that actual throws an exception"
+          (assertions
+            (triple->assertion '(left =throws=> (right)))
+            =fn=> (check-assertion
+                    #(and (->> % first (= 'try))
+                          (->> % second (= 'left))
+                          (-> % (nth 2) first (= 'throw))
+                          (->> % last first (= 'catch))))))
+        (behavior "any other arrow, throws an ex-info"
+          (assertions
+            (triple->assertion '(left =bad-arrow=> right))
+            =throws=> (ExceptionInfo
+                        #"invalid arrow"
+                        #(-> % ex-data (= {:arrow '=bad-arrow=>}))))))

       (behavior "assertions arrows"
         (provided "=throws=> should fail if nothing threw an Exception"
@@ -78,8 +79,8 @@
           (assertions
             [:foo :bar] =throws=> (Exception #"Expected an 'Exception'")))
         (behavior "=> catches unexpected exceptions"
-            (let [e (ex-info "asdf" {})]
-              (assertions
-                (throw e) => e)))
+          (let [e (ex-info "asdf" {})]
+            (assertions
+              (throw e) => e)))
         )
       ))


insights: use same bar-width for all graphs

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -122,7 +122,8 @@
         (.text #(aget % "text")))))

 (defn visualize-insights-bar! [el builds]
-  (let [y-max (apply max (mapcat #((juxt :queued_time_minutes :build_time_minutes) %)
+  (let [bar-count 60
+        y-max (apply max (mapcat #((juxt :queued_time_minutes :build_time_minutes) %)
                                  builds))
         plot-info {:width (- (:width svg-info) (:left svg-info) (:right svg-info))
                    :height (- (:height svg-info) (:top svg-info) (:bottom svg-info))}
@@ -148,7 +149,7 @@
                    (.tickFormat js/Math.abs))
         x-scale (-> (js/d3.scale.ordinal)
                     (.domain (clj->js
-                              (map :build_num builds)))
+                              (range bar-count)))
                     (.rangeBands #js[0 (:width plot-info)] 0.5))
         svg (-> js/d3
                 (.select el)
@@ -169,7 +170,7 @@
         (.insert "rect")
         (.attr #js {"class" #(str "bar " (aget % "outcome"))
                     "y" #(y-pos-scale (aget % "build_time_minutes"))
-                    "x" #(x-scale (aget % "build_num"))
+                    "x" (fn [_ i]  (x-scale i))
                     "width" (.rangeBand x-scale)
                     "height" #(- y-middle (y-pos-scale (aget % "build_time_minutes")))}))

@@ -178,7 +179,7 @@
         (.insert "rect")
         (.attr #js {"class" "bar queue"
                     "y" y-middle
-                    "x" #(x-scale (aget % "build_num"))
+                    "x" (fn [_ i]  (x-scale i))
                     "width" (.rangeBand x-scale)
                     "height" #(- (y-neg-scale (aget % "queued_time_minutes")) y-middle)}))


(PDB-5022) date-round-trip: use with-transacted-connection'

Change with-transacted-connection to with-transacted-connection' since
the call site specifies a :repeatable-read isolation level.

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -1704,7 +1704,7 @@

       ;; While we're here, check the value in the database too...
       (is (= expected-stamp
-             (jdbc/with-transacted-connection
+             (jdbc/with-transacted-connection'
                (:scf-read-db (cli-svc/shared-globals pdb))
                :repeatable-read
                (from-sql-date (scf-store/node-deactivated-time "foo.local")))))


Adjust help-cmd-cli-interaction-stdout-test to latest changes.

--- test/cli4clj/test/cli.clj
+++ test/cli4clj/test/cli.clj
@@ -90,7 +90,7 @@
                                :fn-args "fn-args string"}}}
         test-cmd-input ["help"]
         out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (str "add" *cli4clj-line-sep* "\t Arguments: fn-args string" *cli4clj-line-sep* *cli4clj-line-sep* "help [? h]" *cli4clj-line-sep* "\tShow help." *cli4clj-line-sep* "\tDisplay a help text that lists all available commands including further detailed information about these commands." *cli4clj-line-sep* *cli4clj-line-sep* "quit [q]" *cli4clj-line-sep* "\tQuit the CLI." *cli4clj-line-sep* "\tTerminate and close the command line interface.")
+    (is (= (str "add" *cli4clj-line-sep* "\t Arguments: fn-args string" *cli4clj-line-sep* *cli4clj-line-sep* "enable-trace" *cli4clj-line-sep* "\tEnable/Disable Printing of Full Exception Traces" *cli4clj-line-sep* "\tWhen set to false (default), only the exception message will be printed when an exception occurs. When set to true, the full traces of exceptions will be printed." *cli4clj-line-sep* *cli4clj-line-sep* "help [? h]" *cli4clj-line-sep* "\tShow help." *cli4clj-line-sep* "\tDisplay a help text that lists all available commands including further detailed information about these commands." *cli4clj-line-sep* *cli4clj-line-sep* "quit [q]" *cli4clj-line-sep* "\tQuit the CLI." *cli4clj-line-sep* "\tTerminate and close the command line interface.")
            out-string))))

 (deftest allow-eval-cli-interaction-test


honor new tests

honor new tests

--- test/engine/test/core.clj
+++ test/engine/test/core.clj
@@ -1,3 +1,3 @@
 (ns engine.test.core
   (:use engine.core clojure.test)
-  (:require engine.test.data.rope))
+  (:require [engine.test.data rope cursor]))


State.

State.

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
@@ -132,6 +132,10 @@
               [@competing-updates-atom
                @n-attempts-atom])
             (long-running-inc [n]
+              ;; Note that the following `swap!` is within another `swap!`'s
+              ;; data function, which violates the rule that data functions
+              ;; should not have side effects.
+              ;; But that's OK for keeping count of attempts.
               (swap! n-attempts-atom inc)
               (Thread/sleep (rand-int 100))
               (inc n))


Clustered asplan has state abstraction / teleportation

--- src/angelic/search/action_set/asplan_c.clj
+++ src/angelic/search/action_set/asplan_c.clj
@@ -1,6 +1,7 @@
 (ns angelic.search.action-set.asplan-c
   (:require [angelic.util :as util]
             [angelic.util.graphs :as graphs]
+            [angelic.util.queues :as queues]
             [angelic.env :as env]
             [angelic.env.util :as env-util]
             [angelic.env.state :as state]
@@ -24,7 +25,6 @@
 ;; (TODO).  if leaves are clustered, need multiple goal states -- see if
 ;; worth supporthing this case or not.

-;; TODO: cluster successor generators?
 ;; TODO: state abstraction.

 ;; meta-vars are defined on clusters.
@@ -173,6 +173,30 @@
     (for [[s t] (util/safe-get simple-dtgs var)
           :when (and (= s cur-val) (not (contains? (backward-sets t) s)))]
       t)))
+
+(defn reachability-map [dtg from-val]
+  (let [q (queues/make-graph-search-pq)]
+    (queues/pq-add! q from-val 0)
+    (while (not (queues/pq-empty? q))
+      (let [[v c] (queues/pq-remove-min-with-cost! q)]
+        (doseq [[nv actions] (util/safe-get dtg v)]
+          (queues/pq-add! q nv (- c (apply max (map :reward actions)))))))
+
+    (assert (:map q))
+    (into {} (:map q))))
+
+
+(defn teleport-to-val [^HashMap cache dtgs var-name from-val to-val]
+  (when-let [cost  (get (util/cache-with cache [var-name from-val]
+                          (reachability-map (dtgs var-name) from-val))
+                        to-val)]
+    (env-util/make-factored-primitive
+     [::Teleport var-name from-val to-val]
+     {var-name from-val}
+     {var-name to-val, (action-var #{var-name}) :frozen}
+     (- cost))))
+
+

@@ -277,17 +301,23 @@
 ;; TODO: "state abstraction" here for single clusters.
 ;; TODO: can we provide some notion of relevance/directedness within a cluster?
 ;;       i.e., may have actions affecting A & B or B & C.  If precond on C, ... ?
-(defn add-directed-actions [s c var->cluster cluster-sgs dtgs ccm acyclic-succ-fn]
+(defn add-directed-actions [s c var->cluster cluster-sgs dtgs acm ccm acyclic-succ-fn teleport-fn]
   (if-let [v (util/singleton c)]
     (let [c-val (state/get-var s v)
           dtg   (get-in dtgs [v c-val])
           child (current-child s ccm c)
           d-val (-> (state/get-var s (action-var child)) :precond-map (get v))]
       (if d-val
-        (if (= c-val d-val)
-          [(make-freeze-var-action c)]
-          (for [n-val (acyclic-succ-fn v c-val d-val), a (dtg n-val)]
-            (make-add-action-action var->cluster a)))
+        (cond (= c-val d-val)
+              [(make-freeze-var-action c)]
+
+              (and teleport-fn (= 1 (count (acm c))))
+              (when-let [teleport (teleport-fn v c-val d-val)]
+                [teleport])
+
+              :else
+              (for [n-val (acyclic-succ-fn v c-val d-val), a (dtg n-val)]
+                (make-add-action-action var->cluster a)))
         (add-actions s c var->cluster cluster-sgs))) ;; only for cyclic domains -- TODO: remove?
     (let [child-action (state/get-var s (action-var (current-child s ccm c)))
           restricted-pm (select-keys (:precond-map child-action) c)]
@@ -318,9 +348,9 @@
        Greedy means we forget about reserving preconditions when free and we can fire right now (less branching).
        Sloppy means we ignore if preconditions are free, but require no action on them.
        Extra-sloppy means anything goes -- if you can execute ignoring commitments, go for it."
-  ([sas-problem & {:keys [directed? greedy? deadlock? dead-vars? components?] :as m
-                   :or   {directed? true greedy? true deadlock? true dead-vars? true components? false}}]
-     (assert (every? #{:directed? :greedy? :deadlock? :dead-vars? :components?} (keys m)))
+  ([sas-problem & {:keys [directed? greedy? deadlock? dead-vars? components? teleport?] :as m
+                   :or   {directed? true greedy? true deadlock? true dead-vars? true components? false teleport? true}}]
+     (assert (every? #{:directed? :greedy? :deadlock? :dead-vars? :components? :teleport?} (keys m)))
      (let [edge-rule     (if greedy? :greedy :naive)
            cluster-cg    (remove #(apply = %) (sas-analysis/effect-clustered-causal-graph sas-problem))
            clusters      (graphs/ancestor-set cluster-cg [#{sas/goal-var-name}])
@@ -336,7 +366,8 @@
                            #{sas/goal-var-name} [])
            dtgs          (sas-analysis/domain-transition-graphs sas-problem)
            simple-dtgs   (util/map-vals (fn [dtg] (for [[pval emap] dtg, [eval _] emap] [pval eval])) dtgs)
-           acyclic-succ-fn (partial possibly-acyclic-successors (HashMap.) simple-dtgs)]
+           acyclic-succ-fn (partial possibly-acyclic-successors (HashMap.) simple-dtgs)
+           teleport-fn   (when teleport? (partial teleport-to-val (HashMap.) dtgs))]
 ;       (assert (graphs/dag? causal-graph))
 ;       (assert (sas-analysis/unary? sas-problem))
        (assert (contains? clusters #{sas/goal-var-name}))
@@ -346,10 +377,12 @@

        ;;     (doseq [a (:actions sas-problem)] (assert (every? #(contains? (:precond-map a) %) (keys (:effect-map a)))))
        ;; TODO: Need this for real generalization, here it only has to be true on cluster!
-       (doseq [a (:actions sas-problem)] (assert (some (var->cluster (first (keys (:effect-map a))))
-                                                        (keys (:precond-map a)))))
-       (doseq [c clusters] (println c))
-       (println )
+       (doseq [a (:actions sas-problem)]
+         (when-let [c (cluster-map (first (keys (:effect-map a))))]
+           (assert (some c (keys (:precond-map a))))))
+
+;       (doseq [c clusters] (println c))
+
        (ASPlanEnv.
         sas-problem
         (expand-initial-state (env/initial-state sas-problem) clusters cc-map (goal-action dtgs))
@@ -365,7 +398,7 @@

                 (seq (sources-by-type :bottom-up-action))
                 (if directed?
-                  (add-directed-actions s (apply min-key tsi sources) var->cluster cluster-sgs dtgs cc-map acyclic-succ-fn)
+                  (add-directed-actions s (apply min-key tsi sources) var->cluster cluster-sgs dtgs ac-map cc-map acyclic-succ-fn teleport-fn)
                   (add-actions s (apply min-key tsi sources) var->cluster cluster-sgs))

                 (seq (sources-by-type :bottom-up-activate))


IE8 Fixes.

IE8 Fixes.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -118,7 +118,7 @@
   (om/update! data [:programmes :fetching] :fetching)
   (GET (str "/4/programmes/")
        {:handler  (fn [x]
-                    (println "Fetching programmes.")
+                    ;; (println "Fetching programmes.")
                     (om/update! data [:programmes :data] (mapv slugify-programme x))
                     (om/update! data [:programmes :fetching] (if (empty? x) :no-data :has-data)))
         :error-handler (fn [{:keys [status status-text]}]
@@ -132,7 +132,7 @@
   (om/update! data [:projects :fetching] :fetching)
   (GET (str "/4/programmes/" programme-id "/projects/")
        {:handler  (fn [x]
-                    (println "Fetching projects for programme: " programme-id)
+                    ;; (println "Fetching projects for programme: " programme-id)
                     (om/update! data [:projects :data] (mapv slugify-project x))
                     (om/update! data [:projects :fetching] (if (empty? x) :no-data :has-data)))
         :error-handler (fn [{:keys [status status-text]}]
@@ -146,7 +146,7 @@
   (om/update! data [:properties :fetching] :fetching)
   (GET (str "/4/projects/" project-id "/properties/")
        {:handler  (fn [x]
-                    (println "Fetching properties for project: " project-id)
+                    ;; (println "Fetching properties for project: " project-id)
                     (om/update! data [:properties :data] (mapv slugify-property x))
                     (om/update! data [:properties :fetching] (if (empty? x) :no-data :has-data)))
         :error-handler (fn [{:keys [status status-text]}]
@@ -192,26 +192,26 @@
           old-programmes (:programmes old-nav)
           old-projects (:projects old-nav)
           old-properties (:properties old-nav)]
-      (println "Old Programmes: " old-programmes " Old Projects: " old-projects " Old Properties: " old-properties)
-      (println "New Programmes: " programmes " New Projects: " projects " New Properties: " properties)
+      ;; (println "Old Programmes: " old-programmes " Old Projects: " old-projects " Old Properties: " old-properties)
+      ;; (println "New Programmes: " programmes " New Projects: " projects " New Properties: " properties)

       ;; Clear down
       (when (or (nil? programmes)
                 (empty? (-> @data :programmes :data)))
-        (println "Clearing projects.")
+        ;; (println "Clearing projects.")
         (om/update! data [:programmes :selected] nil)
         (om/update! data [:projects :data] [])
         (om/update! data [:projects :programme_id] nil)
         (fetch-programmes data))

       (when-not projects
-        (println "Clearing properties.")
+        ;; (println "Clearing properties.")
         (om/update! data [:projects :selected] nil)
         (om/update! data [:properties :data] [])
         (om/update! data [:properties :project_id] nil))

       (when-not properties
-        (println "Clearing devices, sensors and measurements.")
+        ;; (println "Clearing devices, sensors and measurements.")
         (om/update! data [:properties :selected] nil)
         (om/update! data [:property-details :data] {})
         (om/update! data [:property-details :property_id] nil)
@@ -224,21 +224,21 @@

       (when (and (not= programmes old-programmes)
                  programmes)
-        (println "Setting selected programme to: " programmes)
+        ;; (println "Setting selected programme to: " programmes)
         (om/update! data [:programmes :selected] programmes)
         (om/update! data [:projects :programme_id] programmes)
         (fetch-projects programmes data))

       (when (and (not= projects old-projects)
                  projects)
-        (println "Setting selected project to: " projects)
+        ;; (println "Setting selected project to: " projects)
         (om/update! data [:projects :selected] projects)
         (om/update! data [:properties :project_id] projects)
         (fetch-properties projects data))

       (when (and (not= properties old-properties)
                  properties)
-        (println "Setting property details to: " properties)
+        ;; (println "Setting property details to: " properties)
         (om/update! data [:properties :selected] properties))

       (when sensors
@@ -572,13 +572,19 @@
         [:h3 {:id "sensors"} "Sensors"]
         (om/build sensors-table data {:opts {:histkey :sensors
                                              :path    :readings}})
-        [:div {:id "chart-div"}
-         [:div {:id "date-picker"}
-          (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
-         (om/build chart-feedback-box (get-in data [:chart :message]))
-         (om/build chart-summary (:chart data))
-         [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
-          (om/build chart/chart-figure (:chart data))]]]))))
+
+         (if (or (not agent/IE)
+                   (agent/isVersionOrHigher 9))
+             [:div {:id "chart-div"}
+              [:div {:id "date-picker"}
+               (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
+              (om/build chart-feedback-box (get-in data [:chart :message]))
+              (om/build chart-summary (:chart data))
+              [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
+               (om/build chart/chart-figure (:chart data))]]
+             [:div.col-md-12.text-center
+              [:p.lead {:style {:padding-top 30}}
+               "Charting in Internet Explorer version " agent/VERSION " coming soon."]])]))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; property-details


Use correct device slug in breadcrumbs.

Use correct device slug in breadcrumbs.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -581,7 +581,7 @@
                   (title-for properties)]]
             [:li [:a
                   {:onClick (back-to-devices history)}
-                  (title-for devices :title-key [:location :name])]]]
+                  (title-for devices)]]]
            (om/build sensors-table data {:opts {:histkey :sensors
                                                 :path    :readings}})
            [:div {:id "chart-div"}


Add test for migrate-action-data

Add test for migrate-action-data

--- test/ctia/task/migration/migrations_test.clj
+++ test/ctia/task/migration/migrations_test.clj
@@ -2,6 +2,7 @@
   (:require [clojure.test :refer [deftest is]]
             [ctia.entity.incident :refer [StoredIncident]]
             [ctia.task.migration.migrations :as sut]
+            [cheshire.core :as json]
             [schema.core :as s]))

 (deftest add-groups-test
@@ -369,3 +370,20 @@
                                                                   :observables [{:value "Demo_iOS_1", :type "hostname"}]
                                                                   :observed_time {:start_time "2019-03-27T15:30:24.000Z"},
                                                                   :os "iOS 10.3 (1)"}]}]}}}]}}))))
+
+(deftest migrate-action-data-test
+   (let [actions [{:type "collect"
+                   :result [{:value "585c2a90e4928f67af7be2d0bdc282b7eb6c90113ae588461a441d31b5268e88"
+                             :type "sha256"}
+                            {:value "ac517bb701f20fe2f1826a0170c8ba7ba3f0632c77d89ed2dfe1883f588e9d1f"
+                             :type "sha256"}]}]
+         actions-json (json/encode actions)
+         entities [{:type "investigation"
+                    :actions actions-json}]]
+     (is (= [{:type "investigation",
+              :actions actions-json
+              :object_ids #{}
+              :investigated_observables #{"sha256:585c2a90e4928f67af7be2d0bdc282b7eb6c90113ae588461a441d31b5268e88"
+                                          "sha256:ac517bb701f20fe2f1826a0170c8ba7ba3f0632c77d89ed2dfe1883f588e9d1f"}
+              :targets #{}}]
+            (into [] sut/migrate-action-data entities)))))


just some logging hooks for now

just some logging hooks for now

--- src/cljs/infinitelives/pixi/pixelfont.cljs
+++ src/cljs/infinitelives/pixi/pixelfont.cljs
@@ -1,6 +1,15 @@
-(ns infinitelives.pixi.pixelfont)
+(ns infinitelives.pixi.pixelfont
+  (:require [infinitelives.pixi.texture :as t]
+            [infinitelives.pixi.resources :as r]))

 (defn load-pixel-font
   [pixel-font-name texture-key layout]
+  (.log js/console (str pixel-font-name))
+  (.log js/console (str texture-key))
+  (.log js/console (str layout))
+  )
+
+(defn make-text [font-key text]
+  (.log js/console (str font-key " => " text))

 )


Use prefixed metadata so as not to conflict with Core's meta

--- src/clojure/oxcart/passes/fn_reduction.clj
+++ src/clojure/oxcart/passes/fn_reduction.clj
@@ -77,7 +77,7 @@
                     (count (first raw-method))
                     (some (partial = '&)
                           (first raw-method)))
-                   {:single true :static true})
+                   {:ox/single true :ox/static true})
         new-def `(def ~new-name (fn* ~raw-method))]
     (eval-in new-def env)
     (ast new-def env)))


Removed unused function.

Removed unused function.

--- src/cmr/dev/env/manager/process/docker.clj
+++ src/cmr/dev/env/manager/process/docker.clj
@@ -15,10 +15,6 @@
   [args]
   (log/trace "Running the `docker` cli with the args:" (vec args))
   (:out (apply process/exec (concat ["docker"] args))))
-
-(defn system->opts
-  [system service-key]
-  (get-in system [service-key :opts]))

 (defn- container-id-file?
   [opts]


Added support to search orbit number and equator crossing date with AQL.

--- src/cmr/search/services/aql/conversion.clj
+++ src/cmr/search/services/aql/conversion.clj
@@ -2,6 +2,7 @@
   "Contains functions for parsing and converting aql to query conditions"
   (:require [clojure.string :as s]
             [clojure.data.xml :as x]
+            [clojure.set :as set]
             [cmr.common.xml :as cx]
             [cmr.common.services.errors :as errors]
             [clj-time.core :as t]
@@ -52,11 +53,11 @@
              :temporal {:name :temporal :type :temporal}
              :additionalAttributes {:name :attribute :type :attribute}
              ;; orbit-number is not in UMM yet
-             :orbitNumber {:name :orbit-number :type :string}
+             :orbitNumber {:name :orbit-number :type :orbit-number}
              ;; :equator-cross-longitude is not in UMM yet
              :equatorCrossingLongitude {:name :equator-cross-longitude :type :num-range}
              ;; :equator-cross-date is not in UMM yet
-             :equatorCrossingDate {:name :equator-cross-date :type :datetime}
+             :equatorCrossingDate {:name :equator-crossing-date :type :equator-crossing-date}
              :TwoDCoordinateSystemName {:name :two-d-coordinate-system-name :type :string}}})

 (defn- elem-name->type
@@ -147,12 +148,29 @@
        :start-date start-date
        :end-date stop-date})))

+(defmethod element->condition :equator-crossing-date
+  [concept-type element]
+  (let [[start-date stop-date] (parse-date-range-element element)]
+    (qm/map->EquatorCrossingDateCondition {:start-date start-date
+                                           :end-date stop-date})))
+
 (defmethod element->condition :boolean
   [concept-type element]
   (let [condition-key (elem-name->condition-key concept-type (:tag element))
         value (get-in element [:attrs :value] "Y")]
     (qm/map->BooleanCondition {:field condition-key
                                :value (= "Y" value)})))
+
+(defmethod element->condition :orbit-number
+  [concept-type element]
+  (if-let [value (cx/double-at-path element [:value])]
+    (qm/map->OrbitNumberValueCondition {:value value})
+    (let [string-double-fn (fn [n] (when n (Double. n)))
+          range-val (-> (cx/attrs-at-path element [:range])
+                        (set/rename-keys {:lower :min-value :upper :max-value})
+                        (update-in [:min-value] string-double-fn)
+                        (update-in [:max-value] string-double-fn))]
+      (qm/map->OrbitNumberRangeCondition range-val))))

 (def aql-query-type->concept-type
   "Mapping of AQL query type to search concept type"


Fix graphql network

Fix graphql network

--- src/com/wsscode/pathom/fulcro/network.cljs
+++ src/com/wsscode/pathom/fulcro/network.cljs
@@ -177,7 +177,7 @@
                           {:action
                            (fn []
                              (let [response (-> (p/entity env) (get (graphql-response-key k)))
-                                   id-param (pg/find-id (get-in env [:ast :params]))]
+                                   id-param (pg/find-id (get-in env [:ast :params]) fp/tempid?)]
                                (cond-> response
                                  id-param (assoc ::fp/tempids {(val id-param) (get response (graphql-response-key (key id-param)))}))))})}))


Invert scroll/zoom behavior.

Invert scroll/zoom behavior.

--- frontend/src/uxbox/main/ui/workspace.cljs
+++ frontend/src/uxbox/main/ui/workspace.cljs
@@ -94,8 +94,8 @@
       (dom/prevent-default event)
       (dom/stop-propagation event)
       (if (pos? (.-deltaY event))
-        (st/emit! (dw/increase-zoom))
-        (st/emit! (dw/decrease-zoom)))
+        (st/emit! (dw/decrease-zoom))
+        (st/emit! (dw/increase-zoom)))
       (scroll/scroll-to-point dom mouse-point scroll-position))))

 (def ^:private workspace-page-ref


Output ws URL

Output ws URL

--- web-app/src/cljs/potato/eventsource2.cljs
+++ web-app/src/cljs/potato/eventsource2.cljs
@@ -178,7 +178,7 @@
       (start-poll (:channel @websocket-config) (:event @websocket-config)))))

 (defn start-websocket [cid initial-event]
-  (cljs.pprint/cl-format true "Starting websocket for channel: ~s, event: ~s" cid initial-event)
+  (cljs.pprint/cl-format true "Starting websocket for channel: ~s, event: ~s, on: ~s" cid initial-event (aget js/window "websocketUrl"))
   (let [ws (new js/WebSocket (cljs.pprint/cl-format false "~a/~a?session_id=~a~@[&event=~a~]"
                                                     (aget js/window "websocketUrl")
                                                     cid


added debug info for recording id and current state

--- app/views/recording-controls.cljs
+++ app/views/recording-controls.cljs
@@ -57,13 +57,17 @@
   (init-state
     [_]
     {:state :stopped ;; :ready :started :stopped
-     :recording-id nil})
-
+     })
   (render-state
     [_ state]
-    (let [recording-id (:recording-id state)]
+    (let [recording-id (:recording-id app)
+          s (:state state)]
       (html [:div {:class "rec-container col-md-12 col-sm-6"}
              [:h3 "Recording Controls"]
+             [:div
+              [:span (str "Current Recording: " recording-id)]]
+             [:div
+              [:span (str "Recording State: " s)]]
              [:div.option-group
               [:div.col-sm-4
                [:button {:type "button"


Add a test to ensure that map destructuring is allowed

--- spec/rook/client_spec.clj
+++ spec/rook/client_spec.clj
@@ -126,6 +126,16 @@
                      (c/to :get)
                      c/send
                      (c/then 201 [response (get-in response [:headers "Inserted-Id"])])
+                     go
+                     <!!)))
+
+    (it "allows the matched clause to be a map destructuring"
+        (should= HttpServletResponse/SC_CREATED
+                 (-> (c/new-request (responder (-> (utils/response HttpServletResponse/SC_CREATED)
+                                                   (r/header "Inserted-Id" "12345"))))
+                     (c/to :get)
+                     c/send
+                     (c/then 201 [{:keys [status]} status])
                      go
                      <!!)))


Update formatting

Update formatting

--- src/clj/collect_earth_online/db/plots.clj
+++ src/clj/collect_earth_online/db/plots.clj
@@ -88,10 +88,10 @@
                           "analyzed"   (call-sql "select_analyzed_plots"   project-id user-id admin-mode?)
                           "flagged"    (call-sql "select_flagged_plots"    project-id user-id admin-mode?)
                           "confidence" (call-sql "select_confidence_plots" project-id user-id admin-mode? threshold)
-                          "natural"    (concat (call-sql "select_unanalyzed_plots" project-id user-id admin-mode?)
-                                               (call-sql "select_analyzed_plots" project-id user-id admin-mode?))
+                          "natural"    (concat (call-sql "select_analyzed_plots" project-id user-id false)
+                                               (call-sql "select_unanalyzed_plots" project-id user-id false))
                           [])
-        grouped-plots    (group-by :visible_id proj-plots)
+        grouped-plots   (group-by :visible_id proj-plots)
         plots-info      (case direction
                           "next"     (or (some (fn [[plot-id plots]]
                                                  (and (> plot-id visible-id)


- We want autocomplete

- We want autocomplete

--- src/clojure/contentreich/gorilla_repl.clj
+++ src/clojure/contentreich/gorilla_repl.clj
@@ -10,7 +10,7 @@
             [gorilla-repl.render-values-mw :as render-mw]   ;; it's essential this import comes after the previous one! It
     ;; refers directly to a var in nrepl (as a hack to workaround
     ;; a weakness in nREPL's middleware resolution).
-    ;; [cider.nrepl :as cider]
+            [cider.nrepl :as cider]
             [gorilla-repl.renderer :as renderer] ;; this is needed to bring the render implementations into scope
             [ring.util.response :as res]
             [clojure.tools.nrepl :as nrepl]
@@ -142,7 +142,7 @@
   (doall (map cc/generate-string response-seq)))

 (def ^:private nrepl-handler (apply server/default-handler
-                                    (-> '() ;;  (map resolve cider/cider-middleware)
+                                    (-> (map resolve cider/cider-middleware)
                                         (conj #'render-mw/render-values))))

 (defn process-message


Fix a bug in the logger

Fix a bug in the logger

--- src/clojure/picard/middleware/logging.clj
+++ src/clojure/picard/middleware/logging.clj
@@ -8,9 +8,9 @@
     SimpleDateFormat]
    [org.apache.log4j
     ConsoleAppender
+    Level
     Logger
     Layout
-    Priority
     SimpleLayout]
    [org.apache.log4j.spi
     LoggingEvent]))
@@ -21,7 +21,7 @@
   [request timestamp]
   (let [request-date (Date. (long timestamp))
         request-time-string (.format commons-date-formatter request-date)]
-    (format "%s - - [%s] \"%s %s HTTP/%d.%d\" %d %d"
+    (format "%s - - [%s] \"%s %s HTTP/%d.%d\" %d %d\n"
             (first (:remote-addr request ))
             request-time-string
             (:request-method request)
@@ -44,12 +44,12 @@
 (def default-options
   {:name     "request"
    :appender (ConsoleAppender. nil ConsoleAppender/SYSTEM_OUT)
-   :layout   commons-logging-format-layout
-   :priority Priority/INFO})
+   :layout   commons-logging-format-layout})

 (defn- mk-logger
   [{name :name appender :appender layout :layout :as opts}]
   (let [^Logger logger (Logger/getLogger name)]
+    (.setLevel logger Level/INFO)
     (.setLayout appender layout)
     (.addAppender logger appender)
     logger))
@@ -104,4 +104,4 @@
            (next-dn evt val))

          :finalize
-         (fn [_] (.log logger (:priority opts) @state))))))
+         (fn [_] (.info logger @state))))))


IS/SR #26 moved description of radiobutton for ratings to make it clickable like the entire radiobutton

--- src/cljs/conference_rating/add_rating_page/add_rating_page.cljs
+++ src/cljs/conference_rating/add_rating_page/add_rating_page.cljs
@@ -34,9 +34,9 @@

 (defn rating-panel-radio-input [id key input-label value]
   [:div
-   [:p {:class "text-lg-center"} input-label]
    [:input {:field :radio :value value :type "radio" :id id :name key}]
    [:label {:for id}
+   [:p {:class "text-lg-center"} input-label]
     [:span {:class "radio"}]]])

 (defn rating-panel [icon data-key panel-label panel-classes]


Fixing provider ingest permissions test.

--- system-int-test/test/cmr/system_int_test/ingest/provider_ingest_permissions_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/provider_ingest_permissions_test.clj
@@ -45,20 +45,22 @@
                                                                             "plain-group-guid3"])
         super-admin-token (e/login (s/context) "super-admin" ["ingest-super-admin-group-guid"])
         non-existant-token "not-exist"
-        collection (d/ingest "PROV1" (dc/collection {}) :echo10 provider-admin-update-token)
+        collection (d/ingest "PROV1" (dc/collection {})  {:token provider-admin-update-token})
         ingested-concept (ingest/get-concept (:concept-id collection))

         granule (d/item->concept (dg/granule collection))]

     (testing "ingest granule update permissions"
       (are [token]
-           (ingest-succeeded? (ingest/ingest-concept granule {:token token}))
+           (ingest-succeeded? (ingest/ingest-concept granule {:token token
+                                                              :allow-failure? true}))
            provider-admin-update-token
            provider-admin-read-update-token
            provider-admin-update-delete-token)

       (are [token]
-           (not (ingest-succeeded? (ingest/ingest-concept granule {:token token})))
+           (not (ingest-succeeded? (ingest/ingest-concept granule {:token token
+                                                                   :allow-failure? true})))
            guest-token
            user-token
            super-admin-token
@@ -67,12 +69,14 @@

     (testing "ingest granule delete permissions"
       (are [token]
-           (ingest-succeeded? (ingest/delete-concept granule {:token token}))
+           (ingest-succeeded? (ingest/delete-concept granule {:token token
+                                                              :allow-failure? true}))
            provider-admin-update-token
            provider-admin-read-update-token
            provider-admin-update-delete-token)
       (are [token]
-           (not (ingest-succeeded? (ingest/delete-concept granule {:token token})))
+           (not (ingest-succeeded? (ingest/delete-concept granule {:token token
+                                                                   :allow-failure? true})))
            guest-token
            user-token
            super-admin-token
@@ -81,12 +85,14 @@

     (testing "ingest collection update permissions"
       (are [token]
-           (ingest-succeeded? (d/ingest "PROV1" (dc/collection {}) :echo10 token))
+           (ingest-succeeded? (d/ingest "PROV1" (dc/collection {}) {:token token
+                                                                    :allow-failure? true}))
            provider-admin-update-token
            provider-admin-read-update-token
            provider-admin-update-delete-token)
       (are [token]
-           (not (ingest-succeeded? (d/ingest "PROV1" (dc/collection {}) :echo10 token)))
+           (not (ingest-succeeded? (d/ingest "PROV1" (dc/collection {}) {:token token
+                                                                         :allow-failure? true})))
            guest-token
            user-token
            super-admin-token
@@ -95,12 +101,14 @@

     (testing "ingest collection delete permissions"
       (are [token]
-           (ingest-succeeded? (ingest/delete-concept ingested-concept {:token token}))
+           (ingest-succeeded? (ingest/delete-concept ingested-concept {:token token
+                                                                       :allow-failure? true}))
            provider-admin-update-token
            provider-admin-read-update-token
            provider-admin-update-delete-token)
       (are [token]
-           (not (ingest-succeeded? (ingest/delete-concept ingested-concept {:token token})))
+           (not (ingest-succeeded? (ingest/delete-concept ingested-concept {:token token
+                                                                            :allow-failure? true})))
            guest-token
            user-token
            super-admin-token


remove clj tests

remove clj tests

--- test/uboats/core_test.clj
+++ test/uboats/core_test.clj
@@ -1,7 +0,0 @@
-(ns uboats.core-test
-  (:require [clojure.test :refer :all]
-            [uboats.core :refer :all]))
-
-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))


lein-release plugin: preparing 0.4.11 release

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


stabilized problematic test

stabilized problematic test

--- test/clj/swarmpit/api_integration_test.clj
+++ test/clj/swarmpit/api_integration_test.clj
@@ -115,11 +115,12 @@

     (testing "tasks"
       (let [tasks (tasks)
-            some-task (-> tasks first)]
+            some-task (-> tasks first)
+            task-id (:id some-task)]
         (is (some? tasks))
         (is (= (service-tasks service-id)
                (->> tasks (filter #(.startsWith (:taskName %) "test")))))
-        (is (= some-task (task (:id some-task))))))
+        (is (= task-id (-> task-id (task) :id)))))

     (testing "find public repository"
       (let [results (public-repositories "nginx" 1)]


fixing tests

fixing tests

--- test/com/ig/swagger/search/parser_test.clj
+++ test/com/ig/swagger/search/parser_test.clj
@@ -24,15 +24,18 @@
                  :swagger-version "2.0"
                  :summary         "ping pong"
                  :method          "GET"
+                 :service-version nil
+                 :service-name    "A-tomcat-service"
                  :servlet-context "/a-tomcat-service"}
                 {:ui-api-path     "/controller/operationId"
                  :path            "/search"
                  :swagger-version "2.0"
                  :summary         "Search for API"
                  :method          "GET"
+                 :service-version nil
+                 :service-name    "A-tomcat-service"
                  :servlet-context "/a-tomcat-service"}]
                :in-any-order)))
-

 (deftest parse-swagger-response-v2-api-path
   (facts "parsing the swagger v2 response without operationId to make sure the api-path is still correct"
@@ -42,12 +45,16 @@
                  :swagger-version "2.0"
                  :summary         "ping pong"
                  :method          "GET"
+                 :service-version nil
+                 :service-name    "A-tomcat-service"
                  :servlet-context "/a-tomcat-service"}
                 {:ui-api-path     "/controller/GET_search"
                  :path            "/search"
                  :swagger-version "2.0"
                  :summary         "Search for API"
                  :method          "GET"
+                 :service-version nil
+                 :service-name    "A-tomcat-service"
                  :servlet-context "/a-tomcat-service"}]
                :in-any-order)))

@@ -56,6 +63,8 @@
          (parse-v2 "parser_v2_minimum_fields.json") =>
          (just [{:path            "/ping/abc"
                  :method          "GET"
+                 :service-name    nil,
+                 :service-version nil,
                  :swagger-version "2.0"
                  :servlet-context nil
                  :summary         nil
@@ -70,13 +79,13 @@
                  :summary         "ping pong"
                  :method          "GET"
                  :ui-api-path     "/somebasepath/operationPing"
+                 :service-name    "A-tomcat-service",
                  :servlet-context "/a-tomcat-service"}
                 {:path            "/search"
                  :swagger-version "1.2"
                  :summary         "Search for API"
                  :method          "GET"
                  :ui-api-path     "/somebasepath/operationSearch"
+                 :service-name    "A-tomcat-service",
                  :servlet-context "/a-tomcat-service"}]
-               :in-any-order)))
-
-
+               :in-any-order)))


Simple redirect after db save

Simple redirect after db save

--- src/tesq/core.clj
+++ src/tesq/core.clj
@@ -56,9 +56,14 @@

 (defroutes routes
+  (GET "/" [] (view-template (first (list-tables))))
   (GET "/view/:table" [table] (view-template table))
   (GET "/edit/:table/:id" [table id] (edit-template table id))
-  (POST "/save" {params :params} (do (jdbc/execute! DB [(q/update-record params)]) "Saved"))
+  (POST "/save" {params :params}
+		(do
+		  (jdbc/execute! DB [(q/update-record params)])
+		  "Saved. Continue"
+		  ))
   (resources "/")
   (not-found "Page not found"))


16 reps of sine.

16 reps of sine.

--- test/onyx/coordinator/sine_cluster_sim.clj
+++ test/onyx/coordinator/sine_cluster_sim.clj
@@ -138,7 +138,7 @@
     :model/peer-rate 50
     :model/sine-length 20000
     :model/sine-start 5000
-    :model/sine-reps 8
+    :model/sine-reps 16
     :model/mean-ack-time 250
     :model/mean-completion-time 500}])


Remove val-fn version of group-by

Remove val-fn version of group-by

--- src/main/clojure/rx/lang/clojure/core.clj
+++ src/main/clojure/rx/lang/clojure/core.clj
@@ -478,8 +478,7 @@

 (defn ^Observable group-by
   "Returns an Observable of clojure.lang.MapEntry where the key is the result of
-  (key-fn x) and the val is an Observable of (val-fn x) for each key. If val-fn is
-  omitted, it defaults to identity.
+  (key-fn x) and the val is an Observable of x for each key.

   This returns a clojure.lang.MapEntry rather than rx.observables.GroupedObservable
   for some vague consistency with clojure.core/group-by and so that clojure.core/key,
@@ -492,15 +491,6 @@
   "
   ([key-fn ^Observable xs]
    (->> (.groupBy xs (iop/fn* key-fn))
-        (map (fn [^GroupedObservable go]
-               (clojure.lang.MapEntry. (.getKey go) go)))))
-  ([key-fn val-fn ^Observable xs]
-   ; TODO reinstate once this is implemented
-   ; see https://github.com/Netflix/RxJava/commit/02ccc4d727a9297f14219549208757c6e0efce2a
-   (throw (UnsupportedOperationException. "groupBy with val-fn is currently unimplemented in RxJava"))
-   (->> (.groupBy xs
-                  (iop/fn* key-fn)
-                  (iop/fn* val-fn))
         (map (fn [^GroupedObservable go]
                (clojure.lang.MapEntry. (.getKey go) go))))))


Enable HornetQ JMX [IMMUTANT-141]

Enable HornetQ JMX [IMMUTANT-141]

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -211,6 +211,14 @@

 (defn disable-hq-security [loc]
   (zip/append-child loc {:tag :security-enabled :content ["false"]}))
+
+(defn enable-hq-jmx [loc]
+  (zip/append-child loc {:tag :jmx-management-enabled :content ["true"]}))
+
+(defn update-hq-server [loc]
+  (-> loc
+      disable-hq-security
+      enable-hq-jmx))

 (defn disable-flow-control
   "Assumes loc is :jms-connection-factories and its first child is the in-vm one"
@@ -257,7 +265,7 @@
              (looking-at? :http-interface loc) (disable-security loc)
              (looking-at? :max-size-bytes loc) (zip/edit loc assoc :content ["20971520"])
              (looking-at? :address-full-policy loc) (zip/edit loc assoc :content ["PAGE"])
-             (looking-at? :hornetq-server loc) (disable-hq-security loc)
+             (looking-at? :hornetq-server loc) (update-hq-server loc)
              (looking-at? :jms-connection-factories loc) (disable-flow-control loc)
              (looking-at? :servers loc) (replace-servers loc)
              (looking-at? :server-groups loc) (replace-server-groups loc)


[#6116] [desktop] escaping was moved to react-native-desktop side

--- components/src/status_im/ui/components/react.cljs
+++ components/src/status_im/ui/components/react.cljs
@@ -93,17 +93,11 @@
     (vec (map string/upper-case ts))
     ts))

-(defn escape-html [text]
-  (if (and platform/desktop? (string? text))
-    (clojure.string/escape text {\< "<", \> ">", \& "&"})
-   text))
-
 (defn text
   ([t]
-   [text-class (escape-html t)])
+   [text-class t])
   ([opts t & ts]
    (->> (conj ts t)
-        (map escape-html)
         (transform-to-uppercase opts)
         (concat [text-class (add-font-style :style opts)])
         (vec))))


Renaming.

Renaming.

--- clj_record/test/model/manufacturer.clj
+++ clj_record/test/model/manufacturer.clj
@@ -1,6 +1,6 @@
 (ns clj-record.test.model.manufacturer
   (:require clj-record.boot
-            [clj-record.validation.built-ins :as vfn]))
+            [clj-record.validation.built-ins :as vfunc]))

 ; def'd here to illustrate that validation messages don't have to live inline in the init-model form.
@@ -14,9 +14,9 @@
     (has-many products))
   (:validation
     (:name "empty!" #(not (empty? %)))
-    (:name "starts with whitespace!" (vfn/non-match #"^\s"))
-    (:name "ends with whitespace!" (vfn/non-match #"\s$"))
-    (:founded "must be numeric" #(or (nil? %) (vfn/numeric? %)))
+    (:name "starts with whitespace!" (vfunc/non-match #"^\s"))
+    (:name "ends with whitespace!" (vfunc/non-match #"\s$"))
+    (:founded "must be numeric" #(or (nil? %) (vfunc/numeric? %)))
     (:grade my-grade-validation-message #(or (nil? %) (>= % 0))))
   (:callbacks
     (:before-save #(let [year (infer-full-year (% :founded))] (if year (assoc % :founded year) %)))))


Cleanup unneeded requires.

Cleanup unneeded requires.

--- clj_record/test/serialization_test.clj
+++ clj_record/test/serialization_test.clj
@@ -1,8 +1,7 @@
 (ns clj-record.test.serialization-test
   (:require
     [clj-record.serialization :as serialization]
-    [clj-record.test.model.manufacturer :as manufacturer]
-    [clj-record.test.model.product :as product])
+    [clj-record.test.model.manufacturer :as manufacturer])
   (:use clojure.contrib.test-is
         clj-record.test.test-helper))


delaney.clj: added function to compute cover from action of fundamental group

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -606,6 +606,25 @@
                                              [[D x] [(+ D n) x]])))]))]
       (DSymbol. d (+ n n) ops vs))))

+(defn cover [ds nr-cosets action]
+  (let [ds (dsymbol ds)
+        idcs (indices ds)
+        d (dim ds)
+        n (size ds)
+        ops (into {} (for [i idcs]
+                       [i (into {} (for [D (elements ds)
+                                         k (range nr-cosets)]
+                                     [(+ (* k n) D)
+                                      (+ (* (action k i D) n) (s ds i D))]))]))
+        t (DSymbol. d (* n nr-cosets) ops {})
+        vs (into {} (for [[i j] (zipmap idcs (rest idcs))]
+                      [i (into {} (for [D (orbit-reps t [i j])
+                                        :let [D0 (-> D dec (mod n) inc)
+                                              v* (/ (m ds i j D0) (r t i j D))]
+                                        E (orbit t [i j] D)]
+                                    [E v*]))]))]
+    (DSymbol. d (size t) ops vs)))
+
 ;; === Tests

 (deftest delaney-test


use proper type for comparison

use proper type for comparison

--- src/metabase/events/metabot_lifecycle.clj
+++ src/metabase/events/metabot_lifecycle.clj
@@ -30,7 +30,7 @@
       (let [{:keys [slack-token metabot-enabled]} object]
         (cond
           (and (contains? object :metabot-enabled)
-               (not= "true" metabot-enabled))      (metabot/stop-metabot!)
+               (not metabot-enabled))      (metabot/stop-metabot!)
           (and (contains? object :slack-token)
                (seq slack-token))                  (metabot/start-metabot!)))
       (catch Throwable e


remove debug statement

remove debug statement

--- src/overtone/device/midi/nanoKONTROL2.clj
+++ src/overtone/device/midi/nanoKONTROL2.clj
@@ -269,7 +269,6 @@
                note      (:note v)
                handle    (concat event-handle [note])
                update-fn (fn [{:keys [data2-f]}]
-                           (println "updating bus: " (busses k) data2-f)
                            (bus-set! (busses k) data2-f)

                            (reset! (state k) data2-f))]


Benchmarking tweaks.

Benchmarking tweaks.

* Fixed data-size.
* Added some initial results.

Signed-off-by: Peter Taoussanis <31b59c0e45453c97c3c2f1c22e7d4bf68ab97403@gmail.com>

--- benchmarks/benchmarks.clj
+++ benchmarks/benchmarks.clj
@@ -7,9 +7,10 @@

 ;;;; TODO
 ;; * Gather results (incl. redis-benchmark) and graph for README.
+;; * Tweak client (esp. protocol design) in response to results.

 (defn make-benching-options
-  [& {:keys [requests clients data-size carmine-pool carmine-spec
+  [{:keys [requests clients data-size carmine-pool carmine-spec
              clj-redis-pool accession-spec] :as opts}]
   (let [merged-opts (merge {:requests  10000
                             :clients   5
@@ -35,31 +36,46 @@
        (/ (double (- (System/nanoTime) start-time#)) 1000000.0)
        (catch Exception e# (println "Exception: " e#) "DNF"))))

-(comment (time-requests (make-benching-options :requests 9
-                                               :clients  3)
+(comment (time-requests (make-benching-options {:requests 9
+                                                :clients  3})
                         (Thread/sleep 1000)))

 (defn bench-redis-clojure
   [{:keys [data-key data] :as opts}]
   (println "Benching redis-clojure...")
   {:ping (time-requests opts (redis-clojure/with-server {}
-                               (redis-clojure/ping)))})
+                               (redis-clojure/ping)))
+   :set  (time-requests opts (redis-clojure/with-server {}
+                               (redis-clojure/set data-key data)))
+   :get  (time-requests opts (redis-clojure/with-server {}
+                               (redis-clojure/get data-key)))})

 (defn bench-clj-redis
   [{:keys [data-key data] db :clj-redis-pool :as opts}]
   (println "Benching clj-redis...")
-  {:ping (time-requests opts (clj-redis/ping db))})
+  {:ping (time-requests opts (clj-redis/ping db))
+   :set  (time-requests opts (clj-redis/set db data-key data))
+   :get  (time-requests opts (clj-redis/get db data-key))})

 (defn bench-accession
   [{:keys [data-key data] spec :accession-spec :as opts}]
   (println "Benching Accession...")
   {:ping (time-requests opts (accession/with-connection spec
-                               (accession/ping)))})
+                               (accession/ping)))
+   :set  (time-requests opts (accession/with-connection spec
+                               (accession/set data-key data)))
+   :get  (time-requests opts (accession/with-connection spec
+                               (accession/get data-key)))})

 (defn bench-carmine
   [{:keys [data-key data] pool :carmine-pool spec :carmine-spec :as opts}]
   (println "Benching Carmine...")
-  {:ping (time-requests opts (carmine/with-conn pool spec (carmine/ping)))})
+  {:ping (time-requests opts (carmine/with-conn pool spec
+                               (carmine/ping)))
+   :set  (time-requests opts (carmine/with-conn pool spec
+                               (carmine/set data-key data)))
+   :get  (time-requests opts (carmine/with-conn pool spec
+                               (carmine/get data-key)))})

 (defn- sort-times
   "{:a 447.38 :b \"DNF\" :c 112.77 :d 374.47 :e 374.47} =>
@@ -99,24 +115,25 @@

 (comment
   ;; Define pools and stuff only ONCE
-  (def std-opts
-    (make-benching-options :carmine-spec   (carmine/make-conn-spec)
-                           :carmine-pool   (carmine/make-conn-pool)
-                           :accession-spec (accession/connection-map)
-                           :clj-redis-pool (clj-redis/init)))
+  (defonce shared-opts {:carmine-spec   (carmine/make-conn-spec)
+                        :carmine-pool   (carmine/make-conn-pool)
+                        :accession-spec (accession/connection-map)
+                        :clj-redis-pool (clj-redis/init)})
+
+  (defn opts [& opts] (make-benching-options
+                       (merge shared-opts (apply hash-map opts))))

   ;; Ad hoc
-  (bench-carmine       (assoc std-opts :requests 1000 :clients 1 :data-size 10))
-  (bench-accession     (assoc std-opts :requests 1000 :clients 1 :data-size 10))
-  (bench-clj-redis     (assoc std-opts :requests 1000 :clients 1 :data-size 10))
-  (bench-redis-clojure (assoc std-opts :requests 1000 :clients 1 :data-size 10))
+  (bench-carmine       (opts :requests 1000 :clients 1 :data-size 100))
+  ;; {:ping 94.761, :set 104.272, :get 100.872}
+  (bench-accession     (opts :requests 1000 :clients 1 :data-size 100))
+  ;; {:ping 270.123, :set 291.792, :get 290.766}
+  (bench-clj-redis     (opts :requests 1000 :clients 1 :data-size 100))
+  ;; {:ping 65.474, :set 73.926, :get 64.811}
+  (bench-redis-clojure (opts :requests 1000 :clients 1 :data-size 100))
+  ;; {:ping 201.87, :set 268.725, :get 241.736}

   ;; Comparisons
   (bench-and-compare-clients
    (assoc std-opts :requests 1000 :clients 1 :data-size 10))
-
-  ;; Deprecated
-  ;; ([:Carmine 1.0] [:clj-redis 1.51] [:redis-clojure 1.72] [:Accession 4.19])
-  ;; ([:Carmine 1.0] [:clj-redis 1.58] [:redis-clojure 1.7]  [:Accession "DNF"])
-  ;; ([:Carmine 1.0] [:clj-redis 1.36] [:redis-clojure 1.43] [:Accession 2.47])
   )


db.fn typo

db.fn typo

--- cljs-src/todomvc/client_services.cljs
+++ cljs-src/todomvc/client_services.cljs
@@ -37,7 +37,7 @@
   ;; todo make batch delete enpoint and use that
   (go (<! (timeout 1000))
       (d/transact! local-conn (for [id ids]
-                                [:db/retractEntity id]))))
+                                [:db.fn/retractEntity id]))))

 (defmethod handle :toggle-all
   [event _ db conn local-conn]


move running point of fetch-url

move running point of fetch-url

--- clojure/src/usedbooks_search/core.clj
+++ clojure/src/usedbooks_search/core.clj
@@ -55,33 +55,25 @@
 (defn fetch-url [url]
   (html/html-resource (java.net.URL. url)))

-(defn parse-titles [q]
-  (html/select
-    (fetch-url (usedstore-url "jongno"
-                              (encode-aladin-query q)))
-    [:a.bo_l :b]))
+(defn html-select [html element]
+  (html/select html element))

-(defn parse-each-prices [q]
-  (html/select
-    (fetch-url (usedstore-url "jongno"
-                              (encode-aladin-query q)))
-    [:span.ss_p2]))
+(defn select-titles [html]
+  (html-select html [:a.bo_l :b]))

-(defn parse-each-nbooks [q]
-  (html/select
-    (fetch-url (usedstore-url "jongno"
-                              (encode-aladin-query q)))
-    [:span.ss_p4]))
+(defn select-each-prices [html]
+  (html-select html [:span.ss_p2]))

-(defn parse-total-nbooks [q]
-  (html/select
-    (fetch-url (usedstore-url "jongno"
-                              (encode-aladin-query q)))
-    [:span.ss_f_g_l]))
+(defn select-each-nbooks [html]
+  (html-select html [:span.ss_p4]))
+
+(defn select-total-nbooks [html]
+  (html-select html [:span.ss_f_g_l]))

 (defn find-total-nbooks [q]
-  (let [result
-        (first (:content (first (parse-total-nbooks q))))]
+  (let [url    (usedstore-url "jongno" (encode-aladin-query q))
+        html   (fetch-url url)
+        result (first (:content (first (select-total-nbooks html))))]
     (if (nil? result)
       0
       result)))


zero based coords

zero based coords

--- clojure/src/dnd/level.cljs
+++ clojure/src/dnd/level.cljs
@@ -44,9 +44,8 @@
    (make-level width height))

   ([width height]
-   (let [one-indexed-range #(map inc (range %))
-         row-array (one-indexed-range width)
-         col-array (one-indexed-range height)]
+   (let [row-array (range width)
+         col-array (range height)]
     (vec
       (for [x row-array]
         (vec (map #(make-block x %) col-array)))))))


(TK-347) Re-introduce parse-bootstrap-config! fn

Renaming parse-bootstrap-config! to parse-bootstrap-configs! broke client
code that relied on it. This commit re-introduces it.

--- src/puppetlabs/trapperkeeper/bootstrap.clj
+++ src/puppetlabs/trapperkeeper/bootstrap.clj
@@ -142,9 +142,9 @@
   (remove nil? (flatten (map #(line-seq (io/reader %)) files))))

 (schema/defn parse-bootstrap-configs! :- [(schema/protocol services/ServiceDefinition)]
-  "Parse the trapperkeeper bootstrap configuration and return the service graph
-  that is the result of merging the graphs of all of the services specified in
-  the configuration."
+  "Parse multiple trapperkeeper bootstrap configuration files and return the
+  service graph that is the result of merging the graphs of all of the services
+  specified in the configuration files."
   [configs :- [(schema/protocol io/IOFactory)]]
   (let [lines (chain-files configs)]
     (when (empty? lines) (throw (Exception. "Empty bootstrap config file")))
@@ -153,3 +153,9 @@
       (let [{:keys [namespace service-name]} (parse-bootstrap-line! line)]
         (resolve-service! namespace service-name)))))

+(schema/defn parse-bootstrap-config! :- [(schema/protocol services/ServiceDefinition)]
+  "Parse a single bootstrap configuration file and return the service graph
+  that is the result of merging the graphs of all the services specified in the
+  configuration file"
+  [config :- (schema/protocol io/IOFactory)]
+  (parse-bootstrap-configs! [config]))


add memoized version of local-hostname in util ns

--- storm-core/src/clj/backtype/storm/util.clj
+++ storm-core/src/clj/backtype/storm/util.clj
@@ -203,6 +203,8 @@
 (defn local-hostname
   []
   (.getCanonicalHostName (InetAddress/getLocalHost)))
+
+(def memoized-local-hostname (memoize local-hostname))

 (letfn [(try-port [port]
                   (with-open [socket (java.net.ServerSocket. port)]


improve practices: replace :all with specific :references

--- src/babel/workbook/it.clj
+++ src/babel/workbook/it.clj
@@ -3,7 +3,7 @@
   (:require
    [babel.engine :as engine]
    [babel.forest :refer [lightning-bolt]]
-   [babel.italiano.grammar :refer :all]
+   [babel.italiano.grammar :refer [medium parse small]]
    [babel.italiano.lexicon :refer :all]
    [babel.italiano.morphology :as morph :refer [fo]]
    [babel.italiano.writer :refer [expression]]


Fix rotate-right

Fix rotate-right

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -171,10 +171,10 @@
                          right-children (.-children right-node)]
                      (if (> (alength right-keys) min-keys)
                        (do
-                         (.push keys (aget (.-keys parent) (+ parent-ix 1)))
-                         (.push vals (aget (.-vals parent) (+ parent-ix 1)))
-                         (aset (.-keys parent) (+ parent-ix 1) (.shift right-keys))
-                         (aset (.-vals parent) (+ parent-ix 1) (.shift right-vals))
+                         (.push keys (aget (.-keys parent) parent-ix))
+                         (.push vals (aget (.-vals parent) parent-ix))
+                         (aset (.-keys parent) parent-ix (.shift right-keys))
+                         (aset (.-vals parent) parent-ix (.shift right-vals))
                          (when children
                            (.push children (.shift right-children)))
                          (set! upper (aget keys (- (alength keys) 1)))
@@ -349,7 +349,8 @@
       :assoc! (.assoc! tree (nth action 1) (nth action 2))
       :dissoc! (.dissoc! tree (nth action 1)))
     (.pretty-print tree)
-    (prn tree))
+    (prn tree)
+    (.valid! tree))
   tree)

 (defn apply-to-sorted-map [map actions]


removing unused code

removing unused code

--- src/complico/core.clj
+++ src/complico/core.clj
@@ -39,12 +39,6 @@
   (if (= server "localhost")
     (str "http://" server ":" port)
   (str "http://" server)))
-
-
-(defn create-script-html [original-host complico-host]
-  (selmer/render-file "templates/script.html"
-    {:complico-host complico-host
-     :original-host original-host}))

 (defn create-new-script [original-host complico-host]
   (hiccup/html


Ensure getDerivedStateFromError component option is set on class

--- src/breeze/quiescent.cljs
+++ src/breeze/quiescent.cljs
@@ -57,8 +57,6 @@
                                                   (aget (. *component* -props) "statics")))}]
     (when-some [n (or (:displayName m) (not-empty (.-name renderer)))]
       (set! (.-displayName react-map) n))
-    (when-some [n (:getDerivedStateFromError m)]
-      (set! (.-getDerivedStateFromError react-map) n))
     (when-some [f (:getInitialState m)]
       (set! (.-getInitialState react-map)
         (wrapped-lifecycle-method #js {:value (f)})))
@@ -92,6 +90,8 @@
     (let [react-component (js/createReactClass react-map)
           q-wrapper (fn [value & statics]
                       (.createElement js/React react-component (assemble-props value statics)))]
+      (when-some [n (:getDerivedStateFromError m)]
+        (set! (.-getDerivedStateFromError react-component) n))
       (when-some [displayName (.-displayName react-map)]
         (set! (.-displayName q-wrapper) displayName))
       (when-some [example (:exampleArg m)]


Five tests added into format-datetime-test module

--- test/clj_calendar/format_datetime_test.clj
+++ test/clj_calendar/format_datetime_test.clj
@@ -12,7 +12,7 @@

 (ns clj-calendar.format-datetime-test
     (:require [clojure.test :refer :all]
-              [clj-calendar.calendar :refer :all]))
+              [clj-calendar.format-datetime :refer :all]))

 ;
@@ -26,4 +26,32 @@

+;
+; Actual tests.
+;

+(deftest test-format-time-existence
+    "Check that the clj-calendar.format-datetime/format-time function definition exists."
+    (testing "if the clj-calendar.format-datetime/format-time function definition exists."
+        (is (callable? 'clj-calendar.format-datetime/format-time))))
+
+(deftest test-format-time--existence
+    "Check that the clj-calendar.format-datetime/format-time- function definition exists."
+    (testing "if the clj-calendar.format-datetime/format-time- function definition exists."
+        (is (callable? 'clj-calendar.format-datetime/format-time-))))
+
+(deftest test-format-month-existence
+    "Check that the clj-calendar.format-datetime/format-month function definition exists."
+    (testing "if the clj-calendar.format-datetime/format-month function definition exists."
+        (is (callable? 'clj-calendar.format-datetime/format-month))))
+
+(deftest test-format-day-existence
+    "Check that the clj-calendar.format-datetime/format-day function definition exists."
+    (testing "if the clj-calendar.format-datetime/format-day function definition exists."
+        (is (callable? 'clj-calendar.format-datetime/format-day))))
+
+(deftest test-format-hours-existence
+    "Check that the clj-calendar.format-datetime/format-hours function definition exists."
+    (testing "if the clj-calendar.format-datetime/format-hours function definition exists."
+        (is (callable? 'clj-calendar.format-datetime/format-hours))))
+


Have more flexible button specification for normally open vs normally closed buttons

--- src/chicken_coop/core.clj
+++ src/chicken_coop/core.clj
@@ -7,11 +7,30 @@
             [chicken-coop.hbridge :as hb]))

-; Helper functions so I can keep track of whether doors are closed or open
-;(def closed? (comp (partial log-tr "Pin closed?:") off?))
-;(def open? (comp (partial log-tr "Pin open?:") on?))
-(def closed? off?)
-(def open? on?)
+(defprotocol IButton
+  (open? [this])
+  (closed? [this]))
+
+(defrecord NormallyOnButton [gpio-pin]
+  IButton
+  (closed? [_]
+    (off? gpio-pin))
+  (open? [_]
+    (on? gpio-pin)))
+
+(defrecord NormallyOffButton [gpio-pin]
+  IButton
+  (closed? [_]
+    (on? gpio-pin))
+  (open? [_]
+    (off? gpio-pin)))
+
+(defn button [pin-header pin-n direction]
+  (assert (#{:normally-on :normally-off} direction))
+  (let [gpio-pin (gpio pin-header pin-n :in)]
+    (case direction
+      :normally-on (NormallyOnButton. gpio-pin)
+      :normally-off (NormallyOffButton. gpio-pin))))

 (defmacro wait-till [test & body]
@@ -107,8 +126,8 @@

 (defn -main []
   (log "Initializing -main")
-  (let [floor-btn (gpio :P8 11 :in)
-        roof-btn  (gpio :P8 12 :in)
+  (let [floor-btn (button :P8 11 :normally-off)
+        roof-btn  (button :P8 12 :normally-on)
         light-ain (ain 33)
         temp-ain  (ain 35)
         mtr-ctrl  (hb/hbridge [16 17 18] :header :P8)


added root re-render when fallbacks happen

--- src/untangled/client/impl/data_fetch.cljc
+++ src/untangled/client/impl/data_fetch.cljc
@@ -395,7 +395,7 @@
   - Merging the incoming data into the normalized database
   - Running post-mutations for any fetches that completed
   - Updating the global loading marker
-  - Forcing a global re-render if post-mutations ran (may change in future versions)
+  - Triggering re-render for all data item refresh lists
   "
   [reconciler]
   (fn [response items]
@@ -436,7 +436,7 @@
   - Replaces affected loading markers with error markers (if :marker is true on the load item)
   - Runs fallbacks associated with the loads
   - Sets the global error marker (:untangled/server-error)
-  - Refreshes UI
+  - Refreshes UI (from root if there were fallbacks)
   "
   [reconciler]
   (fn [error items]
@@ -463,6 +463,6 @@
       (om/merge! reconciler {:ui/react-key (udom/unique-key)})
       (run-fallbacks)
       (set-global-loading reconciler)
-      (if (contains? refresh-set :untangled/force-root)
+      (if (or @ran-fallbacks (contains? refresh-set :untangled/force-root))
         (udom/force-render reconciler)
         (udom/force-render reconciler to-refresh)))))


CLJS-278: bind *ns* to a real namespace (not symbol) during expansion

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -1447,7 +1447,7 @@
     (if (specials op)
       form
       (if-let [mac (and (symbol? op) (get-expander op env))]
-        (binding [*ns* *cljs-ns*]
+        (binding [*ns* (create-ns *cljs-ns*)]
           (apply mac form env (rest form)))
         (if (symbol? op)
           (let [opname (str op)]


proxy headers

proxy headers

--- src/clj/tictag/server.clj
+++ src/clj/tictag/server.clj
@@ -337,6 +337,7 @@
                     (wrap-restful-format :formats [:json-kw :edn :transit-json :transit-msgpack])
                     (wrap-defaults (-> api-defaults
                                        (assoc-in [:static :resources] "/public")
+                                       (assoc :proxy true)
                                        (assoc :cookies true))))
                 config)]
       (debug "Server created")


Reorganize subs ns a bit

Reorganize subs ns a bit

--- src/clj/zetawar/subs.cljs
+++ src/clj/zetawar/subs.cljs
@@ -1,14 +1,14 @@
 (ns zetawar.subs
   (:require
-    [datascript.core :as d]
-    [zetawar.db :refer [e qe]]
-    [zetawar.game :as game]
-    [zetawar.hex :as hex]
-    [zetawar.util :refer [select-values spy]]
-    [posh.core :as posh]
-    [reagent.core :as r])
+   [datascript.core :as d]
+   [zetawar.db :refer [e qe]]
+   [zetawar.game :as game]
+   [zetawar.hex :as hex]
+   [zetawar.util :refer [select-values spy]]
+   [posh.core :as posh]
+   [reagent.core :as r])
   (:require-macros
-    [zetawar.subs :refer [deftrack]]))
+   [zetawar.subs :refer [deftrack]]))

 ;; TODO: add asserts to check params for better error messages?

@@ -16,25 +16,20 @@
 ;;; App

 (deftrack app-eid [conn]
-  (ffirst
-    @(posh/q conn '[:find ?a
-                    :where
-                    [?a :app/game]])))
+  (ffirst @(posh/q conn '[:find ?a
+                          :where
+                          [?a :app/game]])))

 (defn app [conn]
   (posh/pull conn '[*] @(app-eid conn)))

-(deftrack show-win-dialog? [conn]
-  (:app/show-win-dialog @(app conn)))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Game

 (deftrack game-eid [conn]
-  (ffirst
-    @(posh/q conn '[:find ?g
-                    :where
-                    [_ :app/game ?g]])))
+  (ffirst @(posh/q conn '[:find ?g
+                          :where
+                          [_ :app/game ?g]])))

 (defn game [conn]
   (posh/pull conn '[*] @(game-eid conn)))
@@ -43,11 +38,10 @@
 ;;; Map

 (deftrack game-map-eid [conn]
-  (ffirst
-    @(posh/q conn '[:find ?m
-                    :where
-                    [_  :app/game ?g]
-                    [?g :game/map ?m]])))
+  (ffirst @(posh/q conn '[:find ?m
+                          :where
+                          [_  :app/game ?g]
+                          [?g :game/map ?m]])))

 (defn game-map [conn]
   (posh/pull conn
@@ -78,8 +72,8 @@
 (deftrack terrains [conn]
   (let [map-eid' @(game-map-eid conn)]
     (:map/terrains
-      @(posh/pull conn [{:map/terrains terrain-pull}]
-                  map-eid'))))
+     @(posh/pull conn [{:map/terrains terrain-pull}]
+                 map-eid'))))

 (defn current-base-locations [conn]
   (posh/q conn '[:find ?q ?r
@@ -119,11 +113,10 @@
        (into [])))

 (deftrack current-faction-eid [conn]
-  (ffirst
-    @(posh/q conn '[:find ?f
-                    :where
-                    [_  :app/game ?g]
-                    [?g :game/current-faction ?f]])))
+  (ffirst @(posh/q conn '[:find ?f
+                          :where
+                          [_  :app/game ?g]
+                          [?g :game/current-faction ?f]])))

 (defn current-faction [conn]
   (posh/pull conn faction-pull @(current-faction-eid conn)))
@@ -166,27 +159,6 @@
                               [(not= ?f ?cf)]]
                        @(current-faction-eid conn)))
       0))
-
-;; TODO: move to units section?
-;; TODO: sort by cost
-(deftrack buildable-unit-type-eids [conn]
-  (->> @(posh/q conn '[:find ?ut
-                       :in $ ?g
-                       :where
-                       [?g  :game/current-faction ?f]
-                       [?f  :faction/credits ?credits]
-                       [?ut :unit-type/cost ?cost]
-                       [?ut :unit-type/id ?unit-type-id]
-                       [(>= ?credits ?cost)]]
-                @(game-eid conn))
-       (map first)
-       (into [])))
-
-;; TODO: move to units section?
-(deftrack buildable-unit-types [conn]
-  (->> @(buildable-unit-type-eids conn)
-       (map (fn [ut] @(posh/pull conn '[*] ut)))
-       (into [])))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Units
@@ -297,6 +269,27 @@
       @(can-capture? conn q r)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Unit Construction
+
+(deftrack buildable-unit-type-eids [conn]
+  (->> @(posh/q conn '[:find ?ut
+                       :in $ ?g
+                       :where
+                       [?g  :game/current-faction ?f]
+                       [?f  :faction/credits ?credits]
+                       [?ut :unit-type/cost ?cost]
+                       [?ut :unit-type/id ?unit-type-id]
+                       [(>= ?credits ?cost)]]
+                @(game-eid conn))
+       (map first)
+       (into [])))
+
+(deftrack buildable-unit-types [conn]
+  (->> @(buildable-unit-type-eids conn)
+       (map (fn [ut] @(posh/pull conn '[*] ut)))
+       (into [])))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Selection and Target

 (deftrack selected? [conn q r]
@@ -372,3 +365,6 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; User Interface
+
+(deftrack show-win-dialog? [conn]
+  (:app/show-win-dialog @(app conn)))


fix read-keyword for IE

fix read-keyword for IE

--- src/cljs/cljs/reader.cljs
+++ src/cljs/cljs/reader.cljs
@@ -254,13 +254,14 @@
 (defn read-keyword
   [reader initch]
   (let [token (read-token reader (read-char reader))
-        [token ns name] (re-matches symbol-pattern token)]
-    (if (or (and (not (undefined? ns))
+        [token ns name] (re-matches symbol-pattern token)
+        ns? (and (not (undefined? ns)) (> (.length ns) 0))]
+    (if (or (and ns?
                  (identical? (. ns (substring (- (.length ns) 2) (.length ns))) ":/"))
             (identical? (aget name (dec (.length name))) ":")
             (not (== (.indexOf token "::" 1) -1)))
       (reader-error reader "Invalid token: " token)
-      (if (not (undefined? ns))
+      (if ns?
         (keyword (.substring ns 0 (.indexOf ns "/")) name)
         (keyword token)))))


Typos

Typos

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -581,10 +581,11 @@
   I've made the following modifications:
   - Removed the concept of alternating layers, which don't help much, and hurt a bit
   - Added weights to nodes and edges
-  - Added short-circuting if we've seen a seed layer before
-  - Now that cycle detection doesn't rely on crossing counts, I pulled crossings
-    and marking edges out of the ordering algorithm. This allows the counting
-    and marking to be parallelized, whereas the ordering is inherently serial."
+  - Added short-circuiting if we've seen a seed layer before
+  - Now that short-circuiting doesn't rely on crossing counts, I pulled counting
+    crossings and marking edges out of the ordering algorithm. This allows the
+    counting and marking to be parallelized, whereas the ordering is inherently
+    serial."
   ([sparse-graph]
      (SparseGraph->ordered-graphs sparse-graph 1))
   ([sparse-graph max-sweeps]


Add stops vector to data

Add stops vector to data

--- src/cljs/gtfve/state.cljs
+++ src/cljs/gtfve/state.cljs
@@ -14,6 +14,7 @@
                         :last-query ""
                         :loading? false}}}
    :data {:stops-search-results []
+          :stops []
           :stop-times []
           :routes []}})


Fix comment indent

Fix comment indent

--- src/clj/collect_earth_online/db/projects.clj
+++ src/clj/collect_earth_online/db/projects.clj
@@ -523,9 +523,9 @@
         (data-response "")
         (catch Exception e
           (let [causes (:causes (ex-data e))]
-          ;; Log unknown errors
+            ;; Log unknown errors
             (when-not causes (log (ex-message e)))
-          ;; Return error stack to user
+            ;; Return error stack to user
             (data-response (if causes
                              (str "-" (str/join "\n-" causes))
                              "Unknown server error.")))))


icon for adding location

icon for adding location

--- src/cljs/iwaswhere_web/ui/entry/actions.cljs
+++ src/cljs/iwaswhere_web/ui/entry/actions.cljs
@@ -79,6 +79,19 @@
           {:on-click #(do (create-linked-entry) (toggle-visible))}
           [:span.fa.fa-plus-square] "add linked"])])))

+(defn add-location
+  "Renders context menu for adding location."
+  [entry put-fn]
+  (let [local (r/atom {:visible false})
+        toggle-visible #(swap! local update-in [:visible] not)]
+    (fn [entry put-fn]
+      [:span.new-link-btn
+       [:span.fa.fa-map-marker.toggle {:on-click toggle-visible}]
+       (when (:visible @local)
+         [:span.new-link
+          {:on-click #(do (toggle-visible))}
+          [:span.fa.fa-plus-square] "add location"])])))
+
 (defn upvote-fn [entry op put-fn]
   "Create click function for like. Can handle both upvotes and downvotes."
   (fn [_ev]
@@ -103,7 +116,7 @@
         create-comment (h/new-entry-fn put-fn {:comment-for ts} show-comments)
         story (:linked-story entry)
         create-linked-entry (h/new-entry-fn put-fn {:linked-entries [ts]
-                                                    :linked-story story} nil)
+                                                    :linked-story   story} nil)
         new-pomodoro (h/new-entry-fn
                        put-fn (p/pomodoro-defaults ts) show-comments)
         trash-entry #(if edit-mode?
@@ -132,4 +145,5 @@
          (when (and (not comment?) prev-saved?)
            [:span.fa.fa-external-link.toggle {:on-click open-external}])
          (when-not comment? [new-link @entry put-fn create-linked-entry])
+         [add-location @entry put-fn]
          [trash-icon trash-entry]]))))


always render only last 500 log lines

always render only last 500 log lines

--- src/cljs/swarmpit/component/service/log.cljs
+++ src/cljs/swarmpit/component/service/log.cljs
@@ -118,10 +118,9 @@
             error [:span "Logs for this service couldn't be fetched."]
             (and (empty? logs) initialized) [:span "Log is empty in this service."]
             (not initialized) [:span "Loading..."]
-            :else (map
-                    (fn [item]
-                      (rum/with-key (line service item) (:key item)))
-                    filtered-logs))]]))))
+            :else (->> filtered-logs
+                       (take-last 500)
+                       (map #(rum/with-key (line service %) (:key %)))))]]))))

 (rum/defc form-task < form [params]
   (form params))


remove unneeded import

remove unneeded import

--- src/cljs/wombats_web_client/events/user.cljs
+++ src/cljs/wombats_web_client/events/user.cljs
@@ -1,6 +1,5 @@
 (ns wombats-web-client.events.user
   (:require [cljs.core.async :as async]
-            [cemerick.url :as url]
             [re-frame.core :as re-frame]
             [ajax.core :refer [json-response-format GET PUT POST DELETE]]
             [ajax.edn :refer [edn-request-format edn-response-format]]


Settle on updates.puppetlabs.com for version-check

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/puppetdb/cli/services.clj
+++ src/com/puppetlabs/puppetdb/cli/services.clj
@@ -247,7 +247,7 @@
         initial-config                             {:debug (:debug options)}
         {:keys [jetty database global] :as config} (parse-config! (:config options) initial-config)
         vardir                                     (validate-vardir (:vardir global))
-        update-server                              (:update-server global "http://www.puppetlabs.com/check-for-updates")
+        update-server                              (:update-server global "http://updates.puppetlabs.com/check-for-updates")
         resource-query-limit                       (get global :resource-query-limit 20000)
         db                                         (pl-jdbc/pooled-datasource database)
         db-gc-minutes                              (get database :gc-interval 60)


removing TODO's that are done or not needed.

--- pp-server/src/pp_server/core/handler.clj
+++ pp-server/src/pp_server/core/handler.clj
@@ -8,8 +8,6 @@
 (defn- decode-body! [req]
   (parse-string (slurp (:body req)) true))

-;; TODO: eventually abstract the route to take a type
-;; this will help use a map of functions to the type.
 (defroutes app-routes
   (POST "/format/:tipe" request
     (let [tipe (:tipe (:params request))
@@ -17,7 +15,6 @@
       (format-clj! (:input body) tipe)))
   (route/not-found "Not Found"))

-;; TODO: incorporate a configurable port number
 (def app (wrap-defaults app-routes
     ;; turn off anti-forgery crap for now
     (assoc-in site-defaults [:security :anti-forgery] false)))


Make welcome message more personalised

Make welcome message more personalised

--- src/overtone/util.clj
+++ src/overtone/util.clj
@@ -276,6 +276,4 @@
                           Programmable Music.

-May this be the start of a beautiful music hacking session...
-
-"))
+Hello " (user-name) ", may this be the start of a beautiful music hacking session...")))


Cleaned up :requires and refactored to use a constant

--- desktop/src-common/ds3/explosion.clj
+++ desktop/src-common/ds3/explosion.clj
@@ -1,13 +1,14 @@
 (ns ds3.explosion
-  (:require [play-clj.core :refer :all]
-            [play-clj.ui :refer :all]
-            [play-clj.g2d :refer :all]
+  (:require [play-clj.core :refer [bundle color pixmap! pixmap* pixmap-format]]
+            [play-clj.g2d :refer [texture]]
             [ds3.common :as c]
             [clojure.pprint :refer [pprint]]))

 (def ^:const x-offset (c/screen-to-world -3))

 (def ^:const y-offset (c/screen-to-world 2))
+
+(def ^:const default-frame-ticks 1)

 (defn create-circle-texture [c]
   (let [pix-map (pixmap* 16 16 (pixmap-format :r-g-b-a8888))]
@@ -21,7 +22,7 @@
     (assoc circle-entity
       :width (c/screen-to-world (* 2 width)) :height (c/screen-to-world (* 2 width))
       :x (+ x x-offset (c/screen-to-world  (- 8 width))) :y (+ y y-offset (c/screen-to-world (- 8 width)))
-      :ttl 12 :frame-ticks 1
+      :ttl 12 :frame-ticks default-frame-ticks
       )))

 (defn create-explosion [x y]
@@ -40,7 +41,7 @@
           (assoc explosion :entities [part1 part2 part3 (assoc part4
                                                           :x (- x (c/screen-to-world 0.5)) :y (- y (c/screen-to-world 0.5))
                                                           :width (+ width (c/screen-to-world 1)) :height (+ height (c/screen-to-world 1))
-                                                          :ttl (- ttl 1) :frame-ticks 1)])
+                                                          :ttl (- ttl 1) :frame-ticks default-frame-ticks)])
           (and (> ttl 0) (> frame-ticks 0))
           (assoc explosion :entities [part1 part2 part3 (assoc part4 :frame-ticks (- frame-ticks 1))])


added svg clj symbol

added svg clj symbol

This makes off line use of the heads up much more pleasant.


Adjust x values to center block placement

--- totem-destroyer/desktop/src-common/totem_destroyer/core.clj
+++ totem-destroyer/desktop/src-common/totem_destroyer/core.clj
@@ -92,19 +92,19 @@
                           :camera (orthographic :set-to-ortho true game-w game-h)
                           :world (box-2d 0 5)
                           :debug-renderer (Box2DDebugRenderer.))
-          brick (texture "1x1.png")
+          brick (texture "1x1-transparent.png")
           brick-1 (doto (create-brick-entity! screen brick 30 30)
-                    (body-position! (/ 275 world-scale) (/ 435 world-scale) 0))
+                    (body-position! (/ 260 world-scale) (/ 435 world-scale) 0))
           brick-2 (doto (create-brick-entity! screen brick 30 30)
-                    (body-position! (/ 365 world-scale) (/ 435 world-scale) 0))
+                    (body-position! (/ 350 world-scale) (/ 435 world-scale) 0))
           brick-3 (doto (create-brick-entity! screen brick 120 30)
-                    (body-position! (/ 275 world-scale) (/ 395 world-scale) 0))
+                    (body-position! (/ 260 world-scale) (/ 395 world-scale) 0))
           brick-4 (doto (create-brick-entity! screen brick 60 30)
-                    (body-position! (/ 305 world-scale) (/ 365 world-scale) 0))
+                    (body-position! (/ 290 world-scale) (/ 365 world-scale) 0))
           brick-5 (doto (create-brick-entity! screen brick 90 30)
-                    (body-position! (/ 275 world-scale) (/ 335 world-scale) 0))
+                    (body-position! (/ 260 world-scale) (/ 335 world-scale) 0))
           brick-6 (doto (create-brick-entity! screen brick 120 60)
-                    (body-position! (/ 275 world-scale) (/ 280 world-scale) 0))
+                    (body-position! (/ 260 world-scale) (/ 280 world-scale) 0))
           idol (doto {:body (create-idol-body! screen 320 242)})
           floor (doto {:body (create-floor-body! screen 320 470 640 20)})]
       (width! screen game-w)


(maint) Remove one-handed `=` in unit test

This commit removes an `=` called on an `every?` in our tests, which
cause human-test-output to fail with a one-handed equals failure.

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -769,12 +769,12 @@
               {:certname certname :name "b" :value "2" :environment "DEV"}
               {:certname certname :name "c" :value "3" :environment "DEV"}]))

-      (is (= (every? (comp #(t/before? before-test-starts-time %)
-                           to-date-time
-                           :producer_timestamp)
-                     (query-to-vec
-                      "SELECT fs.producer_timestamp
-                         FROM factsets fs"))))
+      (is (every? (comp #(t/before? before-test-starts-time %)
+                        to-date-time
+                        :producer_timestamp)
+                  (query-to-vec
+                   "SELECT fs.producer_timestamp
+                         FROM factsets fs")))
       (is (= 0 (times-called publish)))
       (is (empty? (fs/list-dir discard-dir)))
       (let [result (query-to-vec "SELECT certname,environment_id FROM factsets")]


Adds run-all-tests-future in dev-system user namespace

--- dev-system/dev/user.clj
+++ dev-system/dev/user.clj
@@ -2,6 +2,7 @@
   (:require [clojure.pprint :refer (pprint pp)]
             [clojure.tools.namespace.repl :refer (refresh refresh-all)]
             [cmr.dev-system.system :as system]
+            [cmr.dev-system.tests :as tests]
             [cmr.common.log :as log :refer (debug info warn error)]
             [cmr.common.dev.util :as d]
             [cmr.system-int-test.system :as sit-sys]
@@ -69,4 +70,9 @@
     (println (common-viz/compile-coffeescript (get-in system [:components :vdd-server :config])))
     (vdd/data->viz {:cmd :reload})))

+(defn run-all-tests-future
+  []
+  (future
+    (tests/run-all-tests {:fail-fast? true :speak? true})))
+
 (info "Custom dev-system user.clj loaded.")


make clj-stacktrace optional

make clj-stacktrace optional

--- src/cake.clj
+++ src/cake.clj
@@ -1,5 +1,6 @@
 (ns cake
-  (:require [clj-stacktrace.repl :as stacktrace])
+  (:require [clojure.stacktrace :as stacktrace]
+            [clj-stacktrace.repl :as clj-stacktrace])
   (:import [java.io File FileInputStream]
            [java.util Properties]))

@@ -32,4 +33,6 @@
                      (read-config (File. ".cake/config"))))

 (defn print-stacktrace [e]
-  (stacktrace/pst-on *out* (boolean (*config* "stacktrace.color")) e))+  (if-let [pst-color (*config* "clj-stacktrace")]
+    (clj-stacktrace/pst-on *out* (= "color" pst-color) e)
+    (stacktrace/print-cause-trace e)))