Improve paths introduction

Improve paths introduction

--- src/uk/co/tombooth/pollock.cljs
+++ src/uk/co/tombooth/pollock.cljs
@@ -374,21 +374,26 @@

 ;; ## Paths vs Points

-;; having all the code for dealing with a point is all well and good,
-;; but we need to be dealing with paths
-
-;; I've had a play with path generation before and besier curves gave
-;; a nice output
-
-;; De Casteljau's algorithm is the way we shall be coming up with
-;; paths
-
-;; first off we need to generate the anchor points for the curve
-
-;; to do this we will need to be able to:
-;;   - get a random number between two points (for distance, steps)
-;;   - get a random direction
-;;   - add vectors
+;; All of the gestures Pollock makes are fluid paths, even if the
+;; velocity along the path might be rather erratic. We now need to
+;; work out how to generate a path of points that we can then use the
+;; code we have written above to project and splatter.
+
+;; A [Bezier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
+;; is a commonly used curve for generating a smooth curve that can be
+;; scaled indefinitely allowing us to have as many points along our
+;; path as we care to calculate.
+
+;; Bezier curves are defined by an list of control points, so we need
+;; to be able to generate a potential unbounded list of random control
+;; points that should give use limitless different paths to paint with.
+
+;; In order to generate a list of control points we will need to be
+;; able to:
+
+;;   - get a random number between two points for distance and steps,
+;;   - get a random unit vector for the initial direction of the generation,
+;;   - add vectors together to move between our control points.

 (defn random-between [lower-bound upper-bound]
   (+ lower-bound (rand (- upper-bound lower-bound))))
@@ -470,7 +475,7 @@

 ;; ## Motion, going through the paces

-;; all the points along the generated path should have an associated
+;; All the points along the generated path should have an associated
 ;; velocity. To start with we can generate a linear velocity along the
 ;; path, given a randomised total time to traverse the path and the
 ;; total length of the path.
@@ -512,8 +517,7 @@
                                       total-distance))]
     (vector-divide-by-const difference-vector time-between)))

-;; this calculation will leave off the last points velocity, so for
-;; now we can just set it to 0
+;; This calculation will leave off the last points velocity,  we can just set it to 0

 (defn path-velocities [path total-time]
   (let [total-distance   (path-length path)
@@ -524,7 +528,7 @@
                       path))
           [0 0 0])))

-;; as well as the velocity at each point along the path, we also need
+;; As well as the velocity at each point along the path, we also need
 ;; how much paint there is falling. Again to keep life simple we are
 ;; going to model this as a linear flow along the path with there
 ;; always being no paint left.
@@ -556,8 +560,11 @@
 (defn pick-a-colour []
   (nth paint-colours (rand-int (count paint-colours))))

-;; now we need to assemble all of the above functions into something
-;; that will work out everything
+;; Now we need to assemble all of the above functions into something
+;; the resembles Jackson Pollock applying paint to a canvas. We start
+;; with a point, project a path, work out masses and velocities,
+;; project and then splatter. This is all then packaged up with a
+;; colour for drawing onto our canvas.

 (defn fling-paint []
   (let [position       (starting-point)


adjust nrepl once more

adjust nrepl once more

apparently CLJS sessions are clone'd ...

--- src/main/shadow/cljs/devtools/server/nrepl_impl.clj
+++ src/main/shadow/cljs/devtools/server/nrepl_impl.clj
@@ -14,7 +14,7 @@
   (:import [java.io StringReader]
            [clojure.lang Var]))

-(def ^:dynamic repl-state-ref nil)
+(def ^:dynamic *repl-state* nil)

 (defn send [{:keys [transport session id] :as req} {:keys [status] :as msg}]
   (let [res
@@ -31,19 +31,21 @@
     (log/debug ::send res)
     (transport/send transport res)))

-(defn do-repl-quit [state-ref session]
-  (let [session-id (-> session meta :id)
-        {:keys [clj-ns watch-chan]} (get @state-ref session-id)]
-
-    (swap! state-ref dissoc session-id)
-    (async/close! watch-chan)
+(defn do-repl-quit [session]
+  (let [{:keys [clj-ns watch-chan] :as repl-state} (get @session #'*repl-state*)]
+
+    ;; only close watch-chan if session originally started it
+    ;; clones would otherwise shutdown all output
+    (when (= session (:session repl-state))
+      (async/close! watch-chan))

     (swap! session assoc
       #'*ns* clj-ns
+      #'*repl-state* nil
       #'cider.piggieback/*cljs-compiler-env* nil)))

-(defn worker-exit [state-ref session msg]
-  (do-repl-quit state-ref session)
+(defn worker-exit [session msg]
+  (do-repl-quit session)

   ;; replying with msg id that started the REPL, not the last msg
   (send msg {:err "\nThe REPL worker has stopped.\n"})
@@ -113,15 +115,20 @@
       ;; :else
       (send msg {:err (pr-str [:FIXME result])}))))

-(defn do-cljs-eval [{::keys [state-ref worker] :keys [ns session code runtime-id] :as msg}]
+(defn do-cljs-eval [{::keys [worker] :keys [ns session code runtime-id] :as msg}]
   (let [reader (StringReader. code)

         session-id
-        (-> session meta :id str)]
-
-    ;; :last-msg is used by the print loop started by repl-init
+        (-> session meta :id str)
+
+        {:keys [last-msg-ref] :as repl-state}
+        (get @session #'*repl-state*)]
+
+    ;; :last-msg-ref is used by the print loop started by repl-init
     ;; to ensure that all prints use the latest message id when sending it out
-    (swap! state-ref assoc :last-msg msg)
+    ;; FIXME: this is completely pointless with clone'd sessions
+    ;; lets just hope eval is only ever done against one of the clones ...
+    (reset! last-msg-ref msg)

     (loop []
       (when-let [build-state (repl-impl/worker-build-state worker)]
@@ -148,13 +155,13 @@
             (recur)

             (= :repl/quit form)
-            (do (do-repl-quit state-ref session)
+            (do (do-repl-quit session)
                 (send msg {:value ":repl/quit"
                            :printed-value 1
                            :ns (-> *ns* ns-name str)}))

             (= :cljs/quit form)
-            (do (do-repl-quit state-ref session)
+            (do (do-repl-quit session)
                 (send msg {:value ":cljs/quit"
                            :printed-value 1
                            :ns (-> *ns* ns-name str)}))
@@ -184,15 +191,13 @@
         (-> (async/sliding-buffer 100)
             (async/chan))

-        session-id
-        (-> session meta :id)
-
-        state-ref
-        (get @session #'repl-state-ref)]
-
-    (swap! state-ref assoc session-id
-      {:init-msg msg
-       :last-msg msg
+        last-msg-ref
+        (atom msg)]
+
+    (set! *repl-state*
+      ;; FIXME: atom shared between all clones
+      ;; probably causes out/err issues
+      {:last-msg-ref last-msg-ref
        :session session
        :watch-chan watch-chan
        :worker worker
@@ -207,7 +212,7 @@
     ;; cleanup if worker exits
     (go (<! proc-stop)
         (async/close! watch-chan)
-        (worker-exit state-ref session msg))
+        (worker-exit session msg))

     ;; watch worker for specific messages (ie. out/err)
     ;; send :err/:out with latest msg id to make tools happy
@@ -218,10 +223,10 @@
             (when-some [{:keys [type text] :as msg} (<! watch-chan)]
               (case type
                 :repl/out
-                (send (:last-msg @state-ref) {:out (str text "\n")})
+                (send @last-msg-ref {:out (str text "\n")})

                 :repl/err
-                (send (:last-msg @state-ref) {:err (str text "\n")})
+                (send @last-msg-ref {:err (str text "\n")})

                 ;; not interested in any other message for now
                 :ignored)
@@ -241,22 +246,24 @@
           (reify
             clojure.lang.IDeref
             (deref [_]
-              (some-> @state-ref :worker :state-ref deref :build-state :compiler-env))))))))
-
-(defn set-worker [{:keys [session] :as msg}]
-  ;; re-create this for every message so we know exactly which msg started a REPL
-  (swap! session assoc #'api/*nrepl-init* #(repl-init msg %1 %2))
-
-  ;; can only store vars in a session, always put one in though
-  (when-not (contains? @session #'repl-state-ref)
-    (swap! session assoc #'repl-state-ref (atom {})))
-
-  (let [state-ref (get @session #'repl-state-ref)
-        session-id (-> session meta :id)
-        {:keys [build-id worker]} (get @state-ref session-id)]
+              (some-> worker :state-ref deref :build-state :compiler-env))))))))
+
+(defn set-worker [{:keys [op session] :as msg}]
+  ;; re-create this for every eval so we know exactly which msg started a REPL
+  ;; only eval messages can "upgrade" a REPL
+  (when (= "eval" op)
+    (swap! session assoc #'api/*nrepl-init* #(repl-init msg %1 %2)))
+
+  ;; DO NOT PUT ATOM'S INTO THE SESSION!
+  ;; clone will result in two session using the same atom
+  ;; so any change to the atom will affect all session clones
+  (when-not (contains? @session #'*repl-state*)
+    (swap! session assoc #'*repl-state* nil))
+
+  (let [{:keys [build-id worker] :as repl-state} (get @session #'*repl-state*)]
     (if-not build-id
       msg
-      (assoc msg ::state-ref state-ref ::worker worker ::build-id build-id))))
+      (assoc msg ::repl-state repl-state ::worker worker ::build-id build-id))))

 (defn do-cljs-load-file [{::keys [worker] :keys [file file-path] :as msg}]
   (when-some [result (worker/load-file worker {:file-path file-path :source file})]


hydrate can_read/can_write in GET /api/dashboard/:id

--- src/metabase/api/dash.clj
+++ src/metabase/api/dash.clj
@@ -29,7 +29,7 @@

 (defendpoint GET "/:id" [id]
   (let-404 [db (-> (sel :one Dashboard :id id)
-                   (hydrate :creator :organization [:ordered_cards [:card :creator]]))]
+                   (hydrate :creator :organization [:ordered_cards [:card :creator]] :can_read :can_write))]
     {:dashboard db})) ; why is this returned with this {:dashboard} wrapper?

 (defendpoint DELETE "/:id" [id]


fix css path

fix css path

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -34,6 +34,6 @@
   :figwheel {
              :http-server-root "public" ;; default and assumes "resources"
              :server-port 3449 ;; default
-             :css-dirs ["public/resources/css"] ;; watch and update CSS
+             :css-dirs ["resources/public/css"] ;; watch and update CSS
              ;; :ring-handler {{name}}.server/handler
              })


Fix accounts clipped on the wallet screen

Fixes #9767

Signed-off-by: Gheorghe Pinzaru <742a0a3885ab52ea1795e48e261ec4223e194612@gmail.com>

--- src/status_im/ui/screens/wallet/accounts/views.cljs
+++ src/status_im/ui/screens/wallet/accounts/views.cljs
@@ -91,7 +91,7 @@
 (views/defview total-value []
   (views/letsubs [currency        [:wallet/currency]
                   portfolio-value [:portfolio-value]]
-    [react/view
+    [react/view {:style {:padding-horizontal 16}}
      [react/nested-text {:style {:font-size 32 :color colors/gray :font-weight "600"}}
       [{:style {:color colors/black}} portfolio-value]
       " "
@@ -157,8 +157,12 @@

 (views/defview accounts []
   (views/letsubs [accounts [:multiaccount/accounts]]
-    [react/scroll-view {:horizontal true}
-     [react/view {:flex-direction :row :padding-top 11 :padding-bottom 12}
+    [react/scroll-view {:horizontal                        true
+                        :shows-horizontal-scroll-indicator false}
+     [react/view {:flex-direction     :row
+                  :padding-top        11
+                  :padding-bottom     12
+                  :padding-horizontal 16}
       (for [account accounts]
         ^{:key account}
         [account-card account])
@@ -168,7 +172,7 @@
   [react/view {:flex 1}
    [react/scroll-view
     [accounts-options]
-    [react/view {:margin-top 8 :padding-horizontal 16}
+    [react/view {:margin-top 8}
      [total-value]
      [accounts]]
     [assets]


avoids redundant store of service description into the kv store (#759)

--- waiter/src/waiter/core.clj
+++ waiter/src/waiter/core.clj
@@ -875,9 +875,11 @@
                                            (partial sd/service-id->source-tokens-entries kv-store))
    :start-new-service-fn (pc/fnk [[:scheduler scheduler]
                                   [:state start-service-cache scheduler-interactions-thread-pool]
-                                  store-service-description-fn]
+                                  service-id->service-description-fn store-service-description-fn]
                            (fn start-new-service [{:keys [service-id] :as descriptor}]
-                             (store-service-description-fn descriptor)
+                             (if-not (seq (service-id->service-description-fn service-id :effective? false))
+                               (store-service-description-fn descriptor)
+                               (log/info "not storing service description for" service-id "as it already exists"))
                              (scheduler/validate-service scheduler service-id)
                              (service/start-new-service
                                scheduler descriptor start-service-cache scheduler-interactions-thread-pool)))


db-conn-info fn needs to take :host parameter


rswap! always reutrns nil

rswap! always reutrns nil

--- demo/sitetools/core.cljs
+++ demo/sitetools/core.cljs
@@ -13,22 +13,23 @@
   (enable-console-print!))

 (defn rswap! [a f & args]
-  ;; Like swap!, except that recursive swaps on the same atom are ok.
+  ;; Like swap!, except that recursive swaps on the same atom are ok,
+  ;; and always returns nil.
   {:pre [(satisfies? ISwap a)
          (ifn? f)]}
   (if a.rswapping
-    (do (-> (or a.rswapfs
-                (set! a.rswapfs (array)))
-            (.push #(apply f % args)))
-        (swap! a identity))
+    (-> (or a.rswapfs
+            (set! a.rswapfs (array)))
+        (.push #(apply f % args)))
     (do (set! a.rswapping true)
         (try (swap! a (fn [state]
                         (loop [s (apply f state args)]
-                          (if-some [sf (some-> a .-rswapfs .shift)]
+                          (if-some [sf (some-> a.rswapfs .shift)]
                             (recur (sf s))
                             s))))
              (finally
-               (set! a.rswapping false))))))
+               (set! a.rswapping false)))))
+  nil)

 ;;; Configuration
@@ -54,27 +55,26 @@
                                (str (:default-title state)))]
                    (assert (vector? v1))
                    (when r/is-client
-                     (r/next-tick #(set! js/document.title title)))
+                     (set! js/document.title title))
                    (assoc state :main-content v1 :title title))
     :set-page (do (assert (string? v1))
                   (secretary/dispatch! v1)
                   (assoc state :page-name v1))
     :goto-page (do
                  (assert (string? v1))
-                 (when r/is-client
-                   (.setToken history v1 false)
-                   (r/next-tick #(set! js/document.body.scrollTop 0)))
-                 (recur state [:set-page v1]))
+                 (if r/is-client
+                   (do (.setToken history v1)
+                       (r/next-tick #(set! js/document.body.scrollTop 0))
+                       state)
+                   (recur state [:set-page v1])))
     state))

 (defn dispatch [event]
   ;; (dbg event)
-  (rswap! config demo-handler event)
-  nil)
+  (rswap! config demo-handler event))

 (defn add-page-to-generate [url]
-  {:pre [(string? url)]
-   :post [(map? %)]}
+  {:pre [(string? url)]}
   (swap! config update-in [:pages] conj url))

 (defn register-page [url comp title]
@@ -208,7 +208,7 @@
   (when r/is-client
     (let [page-conf (when (exists? js/pageConfig)
                       (js->clj js/pageConfig :keywordize-keys true))
-          conf (swap! config merge page-conf)]
-      (init-history (:page-name conf))
-      (r/render-component (:body conf)
-                          (js/document.getElementById (:main-div conf))))))
+          conf (swap! config merge page-conf)
+          {:keys [page-name body main-div]} conf]
+      (init-history page-name)
+      (r/render-component body (js/document.getElementById main-div)))))


kibit suggested code improvement

kibit suggested code improvement

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/build/golang.clj
+++ src/obcc/build/golang.clj
@@ -72,7 +72,7 @@
     (println (:stderr (protoc "--go_out=./" (str proto) {:verbose true})))))

 (def cwd (System/getProperty "user.dir"))
-(defn fqpath [path] (->> (io/file cwd path) .getAbsolutePath))
+(defn fqpath [path] (.getAbsolutePath (io/file cwd path)))

 (defn go [path env & args]
   (let [fqpath (fqpath path)


Give the :done-payload some time when stopping the source

--- src/pubsure_ws/source.clj
+++ src/pubsure_ws/source.clj
@@ -238,4 +238,6 @@
     (reset! open false)
     (doseq [topic-agent (vals @topics)]
       (send topic-agent done-action config))
+    (when (:done-payload config)
+      (Thread/sleep 1000))
     (@stop-fn :timeout 100)))


Fix for v> definition

Fix for v> definition

--- src/robinson/worldgen.clj
+++ src/robinson/worldgen.clj
@@ -92,7 +92,7 @@

 (defmacro v>
   [x y]
-  `(cliskf/vif (cliskf/v+ (invert ~x) ~y) [1 1 1] [0 0 0]))
+  `(cliskf/vif (cliskf/v- ~x ~y) [1 1 1] [0 0 0]))

 (defn init-ocean
   []


implementing basic tests for RangeMap

implementing basic tests for RangeMap

--- sample/test/sample/rangemap_test.clj
+++ sample/test/sample/rangemap_test.clj
@@ -1,6 +1,80 @@
 (ns sample.rangemap-test
-  (:require [sample.rangemap :as sut]
-            [clojure.test :as t]))
+  (:require [sample.rangemap :refer :all]
+            [clojure.test :refer :all]))

-(deftest test1)
+;;; (remove-ns 'sample.rangemap-test)
+
+
+(deftest test-get
+  (testing "get"
+    (let [m (range-map :find-ceiling :a 11 :b 22 :c 33)]
+      (is (= 11 (get m :a)))
+      (is (= 22 (get m :b)))
+      (is (= 33 (get m :c))))
+
+    (let [m (range-map :find-ceiling)]
+      (is (= nil (get m :a))))))
+
+
+(deftest test-equal
+  (testing "equal"
+    (let [m (range-map :find-ceiling :a 11 :b 22 :c 33)]
+      (is (= {:a 11 :b 22 :c 33} m))
+      (is (= m {:b 22 :c 33 :a 11})))
+
+    (let [m (range-map :find-ceiling)]
+      (is (= {} m))
+      (is (= m {})))))
+
+
+(deftest test-str
+  (testing "str"
+    (is (= (str (range-map :find-ceiling :a 11 :b 22 :c 33))
+           "{:a 11, :b 22, :c 33}"))
+    (is (= (str (range-map :find-ceiling))
+           "{}"))))
+
+
+(deftest test-read
+  (testing "read"
+    (let [m (range-map :find-ceiling :a 11 :b 22 :c 33)]
+      (is (= m (clojure.edn/read-string (str m)))))
+    (let [m (range-map :find-ceiling)]
+      (is (= m (clojure.edn/read-string (str m)))))))
+
+
+(deftest test-keys
+  (testing "keys"
+    (is (= (set (keys (range-map :find-ceiling :a 11 :b 22 :c 33)))
+           (set (keys {:a 11 :b 22 :c 33}))))
+    (is (= (keys (range-map :find-ceiling))
+           (keys {})))))
+
+
+(deftest test-vals
+  (testing "vals"
+    (is (= (set (vals (range-map :find-ceiling :a 11 :b 22 :c 33)))
+           (set (vals {:a 11 :b 22 :c 33}))))
+    (is (= (vals (range-map :find-ceiling))
+           (vals {})))))
+
+
+(deftest test-assoc
+  (testing "assoc"
+    (let [m (-> (range-map :find-ceiling :a 11 :b 22)
+                (assoc :b 23 :c 33 :d 44))]
+      (is (= m {:a 11 :b 23 :c 33 :d 44})))
+    (let [m (-> (range-map :find-ceiling)
+                (assoc :b 22 :a 11))]
+      (is (= m {:a 11 :b 22})))))
+
+
+(deftest test-dissoc
+  (testing "dissoc"
+    (let [m (-> (range-map :find-ceiling :a 11 :b 22 :c 33)
+                (dissoc :b))]
+      (is (= m {:a 11 :c 33})))
+    (let [m (-> (range-map :find-ceiling)
+                (dissoc :a))]
+      (is (= m {})))))


new tests for new functions

new tests for new functions

--- test/forma/classify/logistic_test.clj
+++ test/forma/classify/logistic_test.clj
@@ -26,26 +26,22 @@
 (def X (map (partial cons 1)
             (read-mys-csv feature-path)))

-(def beta-init
-  "define the initial parameter vector as a sequence of 0s, i.e., no
-information on how each variable is weighted."
-  (repeat (count (first X)) 0))
+(fact
+ (logistic-prob (to-double-rowmat [1 2 3])
+                (to-double-rowmat [0.5 0.5 0.5])) => (roughly 0.9525))

-;; (facts
-;;  "log-likelihood of a particular, binary label will always be the same
-;; with a initialized parameter vector of 0's"
-;;  (logistic-prob beta-init (first X)) => 0.5
-;;  (log-likelihood beta-init (first y) (first X)) => -0.6931471805599453
-;;  (total-log-likelihood beta-init y X) => -693.1471805599322)
+(facts
+ (let [ym (to-double-rowmat y)
+       Xm (to-double-matrix X)
+       x  (to-double-rowmat (first X))
+       beta (logistic-beta-vector ym Xm 1e-8 1e-10 6)]
+   (vector? beta) => true
+   (last beta)    => (roughly -8.4745)
+   (first beta)   => (roughly -1.7796)
+   (logistic-prob (initial-beta Xm) x) => 0.5))

-;; (facts
-;;  "logistic routine should return a vector of coefficients, with the
-;; first and last specified, as below."
-;;  (let [label-seq   y
-;;        feature-mat X
-;;        beta-output (logistic-beta-vector label-seq feature-mat 1e-8 1e-8 10)]
-;;    (first beta-output) => -2.416103637233374
-;;    (last beta-output)  => -26.652096814499775))
+
+

 ;; (def new-prob (estimated-probabilities y X X))

@@ -108,29 +104,4 @@
 ;;      alerts-query => (produces [["eco1" [31] 0.9999999999963644]
 ;;                                 ["eco1" [49] 0.9999999999765928]]))))

-(defn random-ints [] (take 5 (repeatedly #(rand-int 100))))

-(defn random-eco []
-  (if (zero? (rand-int 2)) 22220 22221))
-
-(def modis-sample (for [x (range 10) y (range 10)]
-                    [27 8 x y]))
-
-(def sample-dynamic-tap
-  (vec (for [[h v s l] modis-sample
-             pd (range 827 837)]
-         ["500" pd h v s l (random-ints) (random-ints)])))
-
-(def sample-static-tap
-  (vec (for [[h v s l] modis-sample]
-         ["500" h v s l 14141 35 (random-eco) (rand-int 2)])))
-
-(fact
- (logistic-prob (to-double-rowmat [1 2 3])
-                (to-double-rowmat [0.5 0.5 0.5])) => (roughly 0.9525))
-
-
-
-;; (score-seq beta-init y X) =>
-;; #<DoubleMatrix [-379.0; 0.0; 30621.542477607727; -1166.0903274796437; -177.81596113101114; -5.0; -2252.5; 31312.711433410645; 46206.15969371796; -829.2855146437614; 1294.593096722383; -104.96217569007422; 383.63241966150235; -21590.0; 10.0; 2.0; -166.34467628318816; -0.6342561841011047; -5.259043335914612; -0.3465735912322998]>
-


vpc-id is needed to find sg by name

vpc-id is needed to find sg by name

--- resources/default.clj
+++ resources/default.clj
@@ -15,6 +15,7 @@
  :LoadBalancer {:LoadBalancerName $app-name
                 :Listeners [elb-8080->8080]
                 :SecurityGroups [$sg-http-8080]
+                :VpcId $vpc-id
                 :Subnets $elb-subnets-be
                 :Scheme "internal"
                 :HealthCheck elb-healthcheck-ping}


Test retrieve-build-definitions function stubbing the api request

--- test/build_mon/test/vso_api.clj
+++ test/build_mon/test/vso_api.clj
@@ -3,13 +3,31 @@
             [clojure.java.io :as io]
             [build-mon.vso-api :as api]))

-(fact "vso-api-get-fn wraps an api token and returns a function which can be called with just a URL"
-      (let [result (api/vso-api-get-fn "SOME API TOKEN")]
+(def account "VSO_ACCOUNT_NAME")
+(def project "VSO_PROJECT_NAME")
+(def token "VSO_API_TOKEN")
+
+(fact "vso-api-get-fn wraps an api token and returns a function which makes a HTTP GET request on a url"
+      (let [result (api/vso-api-get-fn token)]
         (fn? result) => truthy
         (result "NOT A REAL URL") => (throws java.net.MalformedURLException)))

 (fact "vso-api-fns returns a map of the exposed functions"
       (let [get-fn (fn [url] "API RESPONSE")
-            result (api/vso-api-fns get-fn "ACCOUNT_NAME" "PROJECT_NAME")]
+            result (api/vso-api-fns get-fn account project)]
         (fn? (:retrieve-build-info result)) => truthy
         (fn? (:retrieve-build-definitions result)) => truthy))
+
+(defn get-fn-stub-request [stubbed-url response]
+  (fn [url]
+    (when (= stubbed-url url) response)))
+
+(fact "retrieve-build-definitions retrieves build definitions"
+      (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0"
+            stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"},
+                                                    {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}"
+            stub-response {:status 200 :body stub-json-body}
+            get-fn-stubbed (get-fn-stub-request expected-url stub-response)
+            vso-api (api/vso-api-fns get-fn-stubbed account project)]
+        ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"}
+                                                    {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))


Понизил версию kormasql до 0.4.2

Понизил версию kormasql до 0.4.2

--- radiolamp-6P3/project.clj
+++ radiolamp-6P3/project.clj
@@ -20,7 +20,8 @@
                  [clj-time "0.12.0"]

                  [org.postgresql/postgresql "9.4.1211"]
-                 [korma "0.4.3"]
+                 [korma "0.4.2"]
+

                  [net.sourceforge.htmlcleaner/htmlcleaner "2.16"]


Fixes input binding to text area

Fixes input binding to text area

--- src/wordsmith/editor.cljs
+++ src/wordsmith/editor.cljs
@@ -11,8 +11,8 @@
     (render [_]
       (dom/div nil
         (dom/textarea #js {:id "input-area"
-                           :onChange #(handle-input % input owner)
-                           :value input})
+                           :onChange #(handle-input % input owner)}
+                      (:input app))
         (dom/div #js {:ref "output-area"
                       :id "output-area"
                       :dangerouslySetInnerHTML #js {:__html (.marked js/window input)}})))))


Comments

Comments

--- src/yada/interceptors.clj
+++ src/yada/interceptors.clj
@@ -194,9 +194,10 @@
                          (get-in ctx [:resource :produces]))
         rep (rep/select-best-representation (:request ctx) produces)]
     (cond-> ctx
-      produces (assoc :produces produces)
+      produces (assoc :produces produces) ; all the possible representations
       produces (assoc-in [:response :vary] (rep/vary produces))
-      rep (assoc-in [:response :produces] rep))))
+      rep (assoc-in [:response :produces] rep) ; the best representation
+      )))

 ;; Conditional requests - last modified time
 (defn check-modification-time [ctx]


Adding placeholder on frontend for build min usage.


Use new tools.cli functionality for command line parsing

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

--- stuff/libs/conexp-clj.clj
+++ stuff/libs/conexp-clj.clj
@@ -13,20 +13,20 @@
 (defn- run-repl []
   (clojure.main/repl :init #(use 'conexp.main)))

-(with-command-line *command-line-args*
-  "conexp-clj -- a general purpose tool for Formal Concept Analysis\n"
-  [[gui? "Start the graphical user interface"]
-   [load "Load script and run"]]
-  (when gui?
+(let [options (cli *command-line-args*
+                   (optional ["--gui" "Start the graphical user interface"])
+                   (optional ["--load" "Load a given script"]))]
+  (when (options :gui)
     (clojure.main/repl :init #(do
                                 (use 'conexp.main)
                                 (use 'conexp.contrib.gui)
                                 (@(ns-resolve 'conexp.contrib.gui 'gui)
                                  :default-close-operation javax.swing.JFrame/EXIT_ON_CLOSE))))
-  (when load
+  (when (options :load)
     (use 'conexp.main)
-    (load-file load))
-  (when-not (or load gui?)
+    (load-file (options :load)))
+  (when-not (or (options :gui)
+                (options :load))
     (clojure.main/repl :init #(use 'conexp.main))))

 ;;


Fix logging examples.

Fix logging examples.

--- src/app/cljs/one/sample/logging.cljs
+++ src/app/cljs/one/sample/logging.cljs
@@ -18,9 +18,9 @@

 (comment
   ;; log to the console
-  (start-display (log/console-output))
+  (log/start-display (log/console-output))
   ;; log to to the "fancy" window
-  (start-display (log/fancy-output "main"))
+  (log/start-display (log/fancy-output "main"))
   ;; change the logging level
   (log/set-level logger :fine)
   )


Blockly components can have a type

Blockly components can have a type

The type information is put inside the data tag of a block

--- idecode/myappshare/mainapp.cljs
+++ idecode/myappshare/mainapp.cljs
@@ -253,21 +253,26 @@

 (def basic-blocks  [
-                     "appshare_element_header"
-                     "appshare_element_text"
-                     "appshare_element_br"
-                     "appshare_element_box"
-                     "appshare_element_left_padding"
-                     "appshare_element_top_padding"
+                     ["appshare_element_header"]
+                     ["appshare_element_text"]
+                     ["appshare_element_br"]
+                     ["appshare_element_box"]
+                     ["appshare_element_left_padding"]
+                     ["appshare_element_top_padding"]
                      ])

-(defn show-blocks [section-name  block-names]
+(defn show-blocks [section-name   block-names ]
   (let [this-toolbox   (str "<xml>"
                             (apply str
-                                   (map (fn [x] (str "<block type=\"" x "\"></block>"))
+                                   (map (fn [x] (str
+                                                  "<block "
+                                                      "type=\"" (first x) "\" "
+                                                  ">"
+                                                      "<data>" (second x) "</data>"
+                                                  "</block>"))
                                         block-names))
                             "</xml>")]
     (js/uuuttt  this-toolbox)
@@ -353,24 +358,24 @@

             (add-blocks "Basic"     basic-blocks)

-            (add-blocks "Glue"     ["appshare_custom_component"
-                                    "appshare_call_custom_component"
+            (add-blocks "Glue"     [["appshare_custom_component"]
+                                    ["appshare_call_custom_component"]
                                     ])

-            (add-blocks "Text"     ["appshare_div"
-                                      "appshare_no_attributes"
-                                      "appshare_element_attribute"
-                                      "appshare_element_text"])
+            (add-blocks "Text"     [  ["appshare_div"]
+                                      ["appshare_no_attributes"]
+                                      ["appshare_element_attribute"]
+                                      ["appshare_element_text"]])

             (add-blocks "Shapes"   [])

-            (add-blocks "Custom"  ["appshare_ui_component"
-                                    "appshare_div"
-                                    "appshare_no_attributes"
-                                    "appshare_element_attribute"
-                                    "appshare_element_text"])
+            (add-blocks "Custom"  [ ["appshare_ui_component"]
+                                    ["appshare_div"]
+                                    ["appshare_no_attributes"]
+                                    ["appshare_element_attribute"]
+                                    ["appshare_element_text"]])

             )


saving.

saving.

--- src/clj/forma/hadoop/jobs/update.clj
+++ src/clj/forma/hadoop/jobs/update.clj
@@ -115,35 +115,35 @@
      ;;                  exploded-rain-output
      ;;                  adjusted-s3))

-     trends
-     ([:tmp-dirs trends-output
-       ;; :deps adjust-series
-       ]
-      (println "Calculating trends stats")
-      (r/Trends (:spatial-res conf)
-                (:temporal-res conf)
-                est-end
-                adjusted-s3
-                trends-output
-                est-start))
-
-     trends->pail
-     ([:deps trends]
-      (println "Adding trends series to pail")
-      (r/TrendsPail (:spatial-res conf)
-                    (:temporal-res conf)
-                    est-end
-                    trends-output
-                    (:pailpath storage)))
-
-     merge-trends
-     ([:deps trends->pail]
-      (println "Merging trends time series stored in pail")
-      (r/MergeTrends (:spatial-res conf)
-                     (:temporal-res conf)
-                     est-end
-                     (:pailpath storage)
-                     merged-trends-s3))
+     ;; trends
+     ;; ([:tmp-dirs trends-output
+     ;;   ;; :deps adjust-series
+     ;;   ]
+     ;;  (println "Calculating trends stats")
+     ;;  (r/Trends (:spatial-res conf)
+     ;;            (:temporal-res conf)
+     ;;            est-end
+     ;;            adjusted-s3
+     ;;            trends-output
+     ;;            est-start))
+
+     ;; trends->pail
+     ;; ([:deps trends]
+     ;;  (println "Adding trends series to pail")
+     ;;  (r/TrendsPail (:spatial-res conf)
+     ;;                (:temporal-res conf)
+     ;;                est-end
+     ;;                trends-output
+     ;;                (:pailpath storage)))
+
+     ;; merge-trends
+     ;; ([:deps trends->pail]
+     ;;  (println "Merging trends time series stored in pail")
+     ;;  (r/MergeTrends (:spatial-res conf)
+     ;;                 (:temporal-res conf)
+     ;;                 est-end
+     ;;                 (:pailpath storage)
+     ;;                 merged-trends-s3))

      preprocess-fires
      ([:tmp-dirs fire-output
@@ -157,7 +157,7 @@

      forma-tap
      ([:tmp-dirs forma-tap-output
-       :deps [preprocess-fires merge-trends]]
+       :deps [preprocess-fires #_ merge-trends]]
       (println "Prepping FORMA tap for neighbor analysis")
       (r/FormaTap (:spatial-res conf)
                   (:temporal-res conf)
@@ -198,86 +198,84 @@
      ;;              beta-data-output
      ;;              beta-s3))

-
-
-     ;; forma-estimate
-     ;; ([:deps neighbors]
-     ;;  (println "Classify pixels using beta vectors")
-     ;;  (r/EstimateForma (:spatial-res conf)
-     ;;                   (:temporal-res conf)
-     ;;                   (:betas storage)
-     ;;                   neighbors-output
-     ;;                   (:static storage)
-     ;;                   estimated-s3
-     ;;                   (:super-eco? conf)))
-
-     ;; probs-pail
-     ;; ([:deps forma-estimate]
-     ;;  (println "Add probability output to pail")
-     ;;  (r/ProbsPail (:spatial-res conf)
-     ;;               (:temporal-res conf)
-     ;;               est-end
-     ;;               estimated-s3
-     ;;               (:pailpath storage)))
-
-     ;; merge-probs
-     ;; ([:deps probs-pail]
-     ;;  (println "Merge probability time series.")
-     ;;  (r/MergeProbs (:spatial-res conf)
-     ;;                (:temporal-res conf)
-     ;;                est-end
-     ;;                (:pailpath storage)
-     ;;                merged-estimated-s3))
-
-     ;; gadm2-eco-ids
-     ;; ([:deps merge-probs]
-     ;;  (println "Merging in gadm2 and eco fields")
-     ;;  (r/ProbsGadm2 merged-estimated-s3
-     ;;                (:gadm2 storage)
-     ;;                (:static storage)
-     ;;                (:gadm2eco storage)))
-
-     ;; common-data-conversion
-     ;; ([:deps gadm2-eco-ids]
-     ;;  (println "Prepping for website")
-     ;;  (r/FormaWebsite (:threshold conf)
-     ;;                  (:zoom conf)
-     ;;                  (:min-zoom conf)
-     ;;                  (:spatial-res conf)
-     ;;                  (:temporal-res conf)
-     ;;                  (:cdm-temporal-res conf)
-     ;;                  (:training-end conf)
-     ;;                  (:nodata conf)
-     ;;                  (:gadm2eco storage)
-     ;;                  gfw-site-s3))
-
-     ;; download-prep
-     ;; ([:deps gadm2-eco-ids]
-     ;;  ;; # prep data for FORMA download
-     ;;  (println "Prepping data for FORMA download link")
-     ;;  (r/FormaDownload (:threshold conf)
-     ;;                   (:spatial-res conf)
-     ;;                   (:temporal-res conf)
-     ;;                   (:nodata conf)
-     ;;                   (:gadm2eco storage)
-     ;;                   forma-site-s3))
-
-     ;; blue-raster
-     ;; ([:deps gadm2-eco-ids]
-     ;;  (println "Converting for Blue Raster")
-     ;;  (r/BlueRaster (:spatial-res conf)
-     ;;                (:temporal-res conf)
-     ;;                (:nodata conf)
-     ;;                (:gadm2eco storage)
-     ;;                (:static storage)
-     ;;                (:blueraster storage)))
-
-     ;; david-conversion
-     ;; ([:deps gadm2-eco-ids]
-     ;;  (println "Converting for David")
-     ;;  (r/FormaDavid (:nodata conf)
-     ;;                (:gadm2eco storage)
-     ;;                (:static storage)
-     ;;                david-s3))
+     forma-estimate
+     ([:deps neighbors]
+      (println "Classify pixels using beta vectors")
+      (r/EstimateForma (:spatial-res conf)
+                       (:temporal-res conf)
+                       (:betas storage)
+                       neighbors-output
+                       (:static storage)
+                       estimated-s3
+                       (:super-eco? conf)))
+
+     probs-pail
+     ([:deps forma-estimate]
+      (println "Add probability output to pail")
+      (r/ProbsPail (:spatial-res conf)
+                   (:temporal-res conf)
+                   est-end
+                   estimated-s3
+                   (:pailpath storage)))
+
+     merge-probs
+     ([:deps probs-pail]
+      (println "Merge probability time series.")
+      (r/MergeProbs (:spatial-res conf)
+                    (:temporal-res conf)
+                    est-end
+                    (:pailpath storage)
+                    merged-estimated-s3))
+
+     gadm2-eco-ids
+     ([:deps merge-probs]
+      (println "Merging in gadm2 and eco fields")
+      (r/ProbsGadm2 merged-estimated-s3
+                    (:gadm2 storage)
+                    (:static storage)
+                    (:gadm2eco storage)))
+
+     common-data-conversion
+     ([:deps gadm2-eco-ids]
+      (println "Prepping for website")
+      (r/FormaWebsite (:threshold conf)
+                      (:zoom conf)
+                      (:min-zoom conf)
+                      (:spatial-res conf)
+                      (:temporal-res conf)
+                      (:cdm-temporal-res conf)
+                      (:training-end conf)
+                      (:nodata conf)
+                      (:gadm2eco storage)
+                      gfw-site-s3))
+
+     download-prep
+     ([:deps gadm2-eco-ids]
+      ;; # prep data for FORMA download
+      (println "Prepping data for FORMA download link")
+      (r/FormaDownload (:threshold conf)
+                       (:spatial-res conf)
+                       (:temporal-res conf)
+                       (:nodata conf)
+                       (:gadm2eco storage)
+                       forma-site-s3))
+
+     blue-raster
+     ([:deps gadm2-eco-ids]
+      (println "Converting for Blue Raster")
+      (r/BlueRaster (:spatial-res conf)
+                    (:temporal-res conf)
+                    (:nodata conf)
+                    (:gadm2eco storage)
+                    (:static storage)
+                    (:blueraster storage)))
+
+     david-conversion
+     ([:deps gadm2-eco-ids]
+      (println "Converting for David")
+      (r/FormaDavid (:nodata conf)
+                    (:gadm2eco storage)
+                    (:static storage)
+                    david-s3))

      )))


remove unused functions

remove unused functions

--- src/clj/ikea_clojure_cup/product.clj
+++ src/clj/ikea_clojure_cup/product.clj
@@ -23,12 +23,6 @@
                          :weight-unit (-> units last last)})))
             []
             table-rows)))
-
-(defn- filter-string-contains [v string]
-  (filter #(.contains % string) v))
-
-(defn- dimension->int [coll]
-  (Integer/parseInt (nth (cs/split (first coll) #"\s") 2)))

 (defn- transform-packages [hick-packages]
   (reduce (fn [v {:keys [dimensions-and-weight packages weight-unit dimension-unit]}]


Handle the case when the source date is empty

--- src/cljs/mdr2/productions/vubis.cljs
+++ src/cljs/mdr2/productions/vubis.cljs
@@ -183,7 +183,7 @@
      [:td description]
      [:td library_number]
      [:td source_publisher]
-     [:td (tf/unparse (tf/formatters :date) source_date)]
+     [:td (when source_date (tf/unparse (tf/formatters :date) source_date))]
      [:td [buttons id]]]))

 (defn- productions []


hide progress bar from completed milestones

--- src/cljs/salava/metabadge/ui/my.cljs
+++ src/cljs/salava/metabadge/ui/my.cljs
@@ -26,8 +26,8 @@

 (defn metabadge-element [milestone state]
   (let [{:keys [badge name min_required required_badges completion_status]} milestone
-        completed (if (> completion_status 100) 100 completion_status)
-        image-class (if (= 100 completion_status) "" " opaque")]
+        image-class (if (= 100 completion_status) "" " opaque")
+        is-completed? (= completion_status 100)]
     [:div.media.grid-container
      [:div.media-content
       [:a {:href "#" :on-click #(mo/open-modal [:metabadge :metadata] milestone)}
@@ -39,14 +39,15 @@
         [:div.media-heading
          [:p.heading-link name]]

-        [:div.progress
-         [:div.progress-bar.progress-bar-success
-          { :role "progressbar"
-            :aria-valuenow (str completion_status)
-            :style {:width (str completion_status "%")}
-            :aria-valuemin "0"
-            :aria-valuemax "100"}
-          (str completion_status "%")]]]
+        (when-not is-completed?
+          [:div.progress
+           [:div.progress-bar.progress-bar-success
+            { :role "progressbar"
+              :aria-valuenow (str completion_status)
+              :style {:width (str completion_status "%")}
+              :aria-valuemin "0"
+              :aria-valuemax "100"}
+            (str completion_status "%")]])]
        ]]]))

 (defn order-radio-values []


Clean up cli tests.

Clean up cli tests.

--- test/cli4clj/test/cli.clj
+++ test/cli4clj/test/cli.clj
@@ -10,124 +10,124 @@
   ^{:author "Ruediger Gad",
     :doc "Tests for cli4clj"}
   cli4clj.test.cli
-  (:use clojure.test)
   (:require
     (cli4clj
-      [cli :refer :all]
-      [cli-tests :refer :all])
-    (clj-assorted-utils [util :refer :all]))
+      [cli :as cli]
+      [cli-tests :as cli-tests])
+    (clj-assorted-utils [util :as utils])
+    (clojure [test :as test]))
   (:import (java.io ByteArrayInputStream)
            (java.util ArrayList)))

-(deftest simple-options-merging-test
+(test/deftest simple-options-merging-test
   (let [user-options {:cmds {:foo {:fn 123}}}
         defaults {:cmds {:bar {:fn 456}}}
         mandatory-defaults {}
         expected {:cmds {:bar {:fn 456}
                          :foo {:fn 123}}}]
-    (is (= expected (merge-options defaults user-options mandatory-defaults)))))
-
-(deftest simple-options-override-test
+    (test/is (= expected (cli/merge-options defaults user-options mandatory-defaults)))))
+
+(test/deftest simple-options-override-test
   (let [user-options {:cmds {:foo {:fn 123}
                              :bar {:fn 789}}}
         defaults {:cmds {:bar {:fn 456}}}
         mandatory-defaults {}
         expected {:cmds {:bar {:fn 789}
                          :foo {:fn 123}}}]
-    (is (= expected (merge-options defaults user-options mandatory-defaults)))))
-
-(deftest simple-mandatory-options-override-test
+    (test/is (= expected (cli/merge-options defaults user-options mandatory-defaults)))))
+
+(test/deftest simple-mandatory-options-override-test
   (let [user-options {:cmds {:foo {:fn 123}
                              :bar {:fn 789}}}
         defaults {}
         mandatory-defaults {:cmds {:bar {:fn 456}}}
         expected {:cmds {:bar {:fn 456}
                          :foo {:fn 123}}}]
-    (is (= expected (merge-options defaults user-options mandatory-defaults)))))
-
-(deftest user-options-override-non-nested-test
+    (test/is (= expected (cli/merge-options defaults user-options mandatory-defaults)))))
+
+(test/deftest user-options-override-non-nested-test
   (let [user-options {:prompt :xyz}
         defaults {:prompt :abc}
         mandatory-defaults {}
         expected {:prompt :xyz}]
-    (is (= expected (merge-options defaults user-options mandatory-defaults)))))
-
-
-
-(deftest cmd-vector-to-cmd-test-input-string-test
-  (let [expected (str "foo" *cli4clj-line-sep* "bar" *cli4clj-line-sep*)
+    (test/is (= expected (cli/merge-options defaults user-options mandatory-defaults)))))
+
+
+
+(test/deftest cmd-vector-to-cmd-test-input-string-test
+  (let [expected (str "foo" cli/*cli4clj-line-sep* "bar" cli/*cli4clj-line-sep*)
         cmd-vec ["foo" "bar"]]
-    (is (= expected (cmd-vector-to-test-input-string cmd-vec)))))
-
-(deftest simple-test-cli-interaction-stdout-test
-  (let [out-string (test-cli-stdout #(start-cli {}) [])]
-    (is (= "" out-string))))
-
-(deftest simple-test-cli-interaction-stderr-test
-  (let [err-string (test-cli-stderr #(start-cli {}) ["xyz"])]
-    (is (.startsWith err-string "Invalid command: \"[xyz]\"."))))
-
-(deftest add-cmd-cli-interaction-stdout-test
+    (test/is (= expected (cli-tests/cmd-vector-to-test-input-string cmd-vec)))))
+
+(test/deftest simple-test-cli-interaction-stdout-test
+  (let [out-string (cli-tests/test-cli-stdout #(cli/start-cli {}) [])]
+    (test/is (= "" out-string))))
+
+(test/deftest simple-test-cli-interaction-stderr-test
+  (let [err-string (cli-tests/test-cli-stderr #(cli/start-cli {}) ["xyz"])]
+    (test/is (.startsWith err-string "Invalid command: \"[xyz]\"."))))
+
+(test/deftest add-cmd-cli-interaction-stdout-test
   (let [cli-opts {:cmds {:add {:fn #(+ %1 %2)}}}
         test-cmd-input ["add 1 2"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= "3" out-string))))
-
-(deftest add-cmd-cli-interaction-stdout-multiline-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= "3" out-string))))
+
+(test/deftest add-cmd-cli-interaction-stdout-multiline-test
   (let [cli-opts {:cmds {:add {:fn #(+ %1 %2)}}}
         test-cmd-input ["add 1 2" "add 3 4" "add 5 6"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["3" "7" "11"]) out-string))))
-
-(deftest div-cmd-cli-interaction-cmd-error-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["3" "7" "11"]) out-string))))
+
+(test/deftest div-cmd-cli-interaction-cmd-error-test
   (let [cli-opts {:cmds {:div {:fn #(/ %1 %2)}}}
         test-cmd-input ["div 1 0"]
-        out-string (test-cli-stderr #(start-cli cli-opts) test-cmd-input)]
-    (is (= "Divide by zero" out-string))))
-
-(deftest help-cmd-cli-interaction-stdout-test
+        out-string (cli-tests/test-cli-stderr #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= "Divide by zero" out-string))))
+
+(test/deftest help-cmd-cli-interaction-stdout-test
   (let [cli-opts {:cmds {:add {:fn #(+ %1 %2)
                                :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*
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (str "add" cli/*cli4clj-line-sep*
+                "\t Arguments: fn-args string" cli/*cli4clj-line-sep* cli/*cli4clj-line-sep*
+                "help [? h]" cli/*cli4clj-line-sep*
+                "\tShow help." cli/*cli4clj-line-sep*
+                "\tDisplay a help text that lists all available commands including further detailed information about these commands." cli/*cli4clj-line-sep* cli/*cli4clj-line-sep*
+                "quit [q]" cli/*cli4clj-line-sep*
+                "\tQuit the CLI." cli/*cli4clj-line-sep*
                 "\tTerminate and close the command line interface.")
            out-string))))

-(deftest allow-eval-cli-interaction-test
+(test/deftest allow-eval-cli-interaction-test
   (let [cli-opts {:allow-eval true}
         test-cmd-input ["(+ 1 2)"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["3"]) out-string))))
-
-
-
-(deftest expected-string-creation-single-line-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["3"]) out-string))))
+
+
+
+(test/deftest expected-string-creation-single-line-test
   (let [in ["a"]
-        out (expected-string in)]
-    (is (= "a" out))))
-
-(deftest expected-string-creation-multi-line-test
+        out (cli-tests/expected-string in)]
+    (test/is (= "a" out))))
+
+(test/deftest expected-string-creation-multi-line-test
   (let [in ["a" "b" "c"]
-        out (expected-string in)
+        out (cli-tests/expected-string in)
         line-sep (System/getProperty "line.separator")]
-    (is (= (str "a" line-sep "b" line-sep "c") out))))
-
-(deftest expected-string-creation-custom-separator-test
+    (test/is (= (str "a" line-sep "b" line-sep "c") out))))
+
+(test/deftest expected-string-creation-custom-separator-test
   (let [in ["a" "b" "c"]
-        out (expected-string in "foo")
+        out (cli-tests/expected-string in "foo")
         line-sep "foo"]
-    (is (= (str "a" line-sep "b" line-sep "c") out))))
-
-
-
-(deftest get-cmd-aliases-test
+    (test/is (= (str "a" line-sep "b" line-sep "c") out))))
+
+
+
+(test/deftest get-cmd-aliases-test
   (let [cmds {:a {}
               :b :a
               :c :a
@@ -137,19 +137,19 @@
               :x :d}
         expected {:a [:b :c :foo]
                   :d [:x :y]}]
-    (is (= expected (get-cmd-aliases cmds)))))
-
-
-
-(deftest get-args-info-simple-fns-test
-  (let [result (add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))}
-                                        :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
-    (is (= '[[arg]] (get-in result [:cmds :a :fn-args])))
-    (is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
-
-(deftest get-args-info-simple-multi-arity-fn-test
-  (let [result (add-args-info-m {:cmds {:a {:fn (fn ([a] (inc a)) ([a b] (+ a b)) ([a b c] (+ a b c)))}}})]
-    (is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))))
+    (test/is (= expected (cli/get-cmd-aliases cmds)))))
+
+
+
+(test/deftest get-args-info-simple-fns-test
+  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))}
+                                            :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
+    (test/is (= '[[arg]] (get-in result [:cmds :a :fn-args])))
+    (test/is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
+
+(test/deftest get-args-info-simple-multi-arity-fn-test
+  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn ([a] (inc a)) ([a b] (+ a b)) ([a b c] (+ a b c)))}}})]
+    (test/is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))))

 (defn test-fn-single-arity
   [summand1 summand2]
@@ -160,55 +160,55 @@
   ([a b] (+ a b))
   ([a b c] (+ a b c)))

-(deftest get-args-info-defns-test
-  (let [result (add-args-info-m {:cmds {:a {:fn test-fn-multi-arity}
+(test/deftest get-args-info-defns-test
+  (let [result (cli/add-args-info-m {:cmds {:a {:fn test-fn-multi-arity}
                                         :b {:fn test-fn-single-arity}}})]
-    (is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))
-    (is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
-
-(deftest get-args-info-override-test
-  (let [result (add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))
+    (test/is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))
+    (test/is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
+
+(test/deftest get-args-info-override-test
+  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))
                                             :fn-args "My Custom Argument Description"}
                                         :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
-    (is (= "My Custom Argument Description" (get-in result [:cmds :a :fn-args])))
-    (is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
-
-(deftest simple-create-arg-hint-completers-test
+    (test/is (= "My Custom Argument Description" (get-in result [:cmds :a :fn-args])))
+    (test/is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))
+
+(test/deftest simple-create-arg-hint-completers-test
   (let [cmd-map {:a {:fn-args [['x 'y 'z]]}
                  :b {:fn-args "Test hint"}}
-        completers (create-arg-hint-completers cmd-map)]
-    (is (vector? completers))
-    (is (= 2 (count completers)))))
-
-(deftest create-arg-hint-completers-completion-proposal-test
+        completers (cli/create-arg-hint-completers cmd-map)]
+    (test/is (vector? completers))
+    (test/is (= 2 (count completers)))))
+
+(test/deftest create-arg-hint-completers-completion-proposal-test
   (let [cmd-map {:a {:fn-args [['x 'y 'z]]}
                  :b {:fn-args "my args"
                      :completion-hint "test hint"}}
-        completers (create-arg-hint-completers cmd-map)
+        completers (cli/create-arg-hint-completers cmd-map)
         arr-lst (ArrayList.)]
-    (is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
-    (is (= 2 (.size arr-lst)))
-    (is (= "Arguments: [[x y z]]" (.get arr-lst 0)))
-    (is (= "" (.get arr-lst 1)))
+    (test/is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
+    (test/is (= 2 (.size arr-lst)))
+    (test/is (= "Arguments: [[x y z]]" (.get arr-lst 0)))
+    (test/is (= "" (.get arr-lst 1)))
     (.clear arr-lst)
-    (is (= 2 (.complete (nth completers 1) "b " 2 arr-lst)))
-    (is (= 2 (.size arr-lst)))
-    (is (= "Arguments: my args" (.get arr-lst 0)))
-    (is (= "test hint" (.get arr-lst 1)))))
-
-(deftest create-arg-hint-completers-link-hint-test
+    (test/is (= 2 (.complete (nth completers 1) "b " 2 arr-lst)))
+    (test/is (= 2 (.size arr-lst)))
+    (test/is (= "Arguments: my args" (.get arr-lst 0)))
+    (test/is (= "test hint" (.get arr-lst 1)))))
+
+(test/deftest create-arg-hint-completers-link-hint-test
   (let [cmd-map {:a {:foo "Linking to foo hint test."
                      :completion-hint :foo}}
-        completers (create-arg-hint-completers cmd-map)
+        completers (cli/create-arg-hint-completers cmd-map)
         arr-lst (ArrayList.)]
-    (is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
-    (is (= 2 (.size arr-lst)))
-    (is (= "Linking to foo hint test." (.get arr-lst 0)))
-    (is (= "" (.get arr-lst 1)))))
-
-
-
-(deftest async-cmd-not-finished-test
+    (test/is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
+    (test/is (= 2 (.size arr-lst)))
+    (test/is (= "Linking to foo hint test." (.get arr-lst 0)))
+    (test/is (= "" (.get arr-lst 1)))))
+
+
+
+(test/deftest async-cmd-not-finished-test
   (let [cli-opts {:cmds {:async-foo {:fn (fn []
                                            (println "Starting...")
                                            (let [tmp-out *out*]
@@ -216,15 +216,15 @@
                                                (Thread.
                                                  (fn []
                                                    (binding [*out* tmp-out]
-                                                     (sleep 500)
+                                                     (utils/sleep 500)
                                                      (println "Finished."))))
                                                (.start)))
                                            "Started.")}}}
         test-cmd-input ["async-foo"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["Starting..." "\"Started.\""]) out-string))))
-
-(deftest async-cmd-sleep-finished-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["Starting..." "\"Started.\""]) out-string))))
+
+(test/deftest async-cmd-sleep-finished-test
   (let [cli-opts {:cmds {:async-foo {:fn (fn []
                                            (println "Starting...")
                                            (let [tmp-out *out*]
@@ -232,53 +232,53 @@
                                                (Thread.
                                                  (fn []
                                                    (binding [*out* tmp-out]
-                                                     (sleep 500)
+                                                     (utils/sleep 500)
                                                      (println "Finished."))))
                                                (.start)))
                                            "Started.")}}}
         test-cmd-input ["async-foo" "_sleep 1000"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["Starting..." "\"Started.\"" "Finished."]) out-string))))
-
-
-
-(deftest print-cmd-invalid-token-to-string-fallback-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["Starting..." "\"Started.\"" "Finished."]) out-string))))
+
+
+
+(test/deftest print-cmd-invalid-token-to-string-fallback-test
   (let [cli-opts {:cmds {:print {:fn #(println %)}}}
         test-cmd-input ["print /foo/bar"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["/foo/bar"]) out-string))))
-
-(deftest print-cmd-invalid-token-exception-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["/foo/bar"]) out-string))))
+
+(test/deftest print-cmd-invalid-token-exception-test
   (let [cli-opts {:cmds {:print {:fn #(println %)}}
                   :invalid-token-to-string false}
         test-cmd-input ["print /foo/bar"]
-        out-string (test-cli-stderr #(start-cli cli-opts) test-cmd-input)]
-    (is (.startsWith out-string "java.lang.RuntimeException: Invalid token: /foo/bar"))))
-
-
-
-(deftest enable-trace-test
+        out-string (cli-tests/test-cli-stderr #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (.startsWith out-string "java.lang.RuntimeException: Invalid token: /foo/bar"))))
+
+
+
+(test/deftest enable-trace-test
   (let [cli-opts {}
         test-cmd-input ["_enable-trace true"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["print-exception-trace is set to: true"]) out-string))))
-
-(deftest enable-trace-wrong-arg-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["print-exception-trace is set to: true"]) out-string))))
+
+(test/deftest enable-trace-wrong-arg-test
   (let [cli-opts {}
         test-cmd-input ["_enable-trace 123"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string
              ["Error, you need to supply a boolean value: true or false"
               "print-exception-trace is set to: false"])
            out-string))))

-(deftest simple-jline-input-stream-mock-test
-  (let [in-string (str "a 1" *cli4clj-line-sep* "b 2 3" *cli4clj-line-sep* "q" *cli4clj-line-sep*)
-        out (binding [*jline-input-stream* (ByteArrayInputStream. (.getBytes in-string))]
+(test/deftest simple-jline-input-stream-mock-test
+  (let [in-string (str "a 1" cli/*cli4clj-line-sep* "b 2 3" cli/*cli4clj-line-sep* "q" cli/*cli4clj-line-sep*)
+        out (binding [cli/*jline-input-stream* (ByteArrayInputStream. (.getBytes in-string))]
               (with-out-str
-                (start-cli {:cmds {:a {:fn (fn [arg] (inc arg))}
+                (cli/start-cli {:cmds {:a {:fn (fn [arg] (inc arg))}
                                    :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})))]
-    (is (= (expected-string ["2" (str "5" *cli4clj-line-sep*)]) out))))
-
+    (test/is (= (cli-tests/expected-string ["2" (str "5" cli/*cli4clj-line-sep*)]) out))))
+


bugfix override existing dependency

bugfix override existing dependency

--- src/distillery/view/dependencies.clj
+++ src/distillery/view/dependencies.clj
@@ -22,7 +22,7 @@

 (defn- copy-stream-to-file
   [^java.io.InputStream s ^java.nio.file.Path p]
-  (java.nio.file.Files/copy s p (into-array java.nio.file.CopyOption [])))
+  (java.nio.file.Files/copy s p (into-array java.nio.file.CopyOption [java.nio.file.StandardCopyOption/REPLACE_EXISTING])))

 (defn- save-dependency
   "Saves a static resource dependency relative to the given HTML file path."


file-line-at

file-line-at

--- src/hackerrank/save_the_prisoner.clj
+++ src/hackerrank/save_the_prisoner.clj
@@ -12,6 +12,7 @@
 ; (println (get-current-path))

 (def test-file-path "resources\\test-case.txt")
+(def test-file-line-current-index 0)
 ; (println (slurp test-file-path))

 ; http://stackoverflow.com/questions/36579613/how-to-read-n-lines-from-a-file-in-clojure
@@ -20,8 +21,22 @@
 	(with-open [rdr (io/reader filename)]
 		(doall (take n (line-seq rdr)))))

+(defn file-lines [filename]
+	(with-open [rdr (io/reader filename)]
+		(let [lines (line-seq rdr)]
+			; (println "lines " lines)
+			; (println "count " (count lines))
+			(doall (take (count lines) lines)))))
+; (println (file-lines test-file-path))
+
+(defn file-line-at [filename at]
+	(with-open [rdr (io/reader filename)]
+		(nth (line-seq rdr) at)))
+; (println (file-line-at test-file-path 0))
+; (println (file-line-at test-file-path 1))
+
 (defn read-line []
-	(lines 1 test-file-path))
+	(file-line-at test-file-path test-file-line-current-index))

 (defn get-test-case-number []
 	(parseInt (read-line)))


Remove csv constraint

Remove csv constraint

--- src/kixi/datastore/metadatastore.clj
+++ src/kixi/datastore/metadatastore.clj
@@ -6,7 +6,7 @@
             [clojure.spec.gen :as gen]))

 (s/def ::type #{"stored"})
-(s/def ::file-type #{"csv"})
+(s/def ::file-type string?)
 (s/def ::id sc/uuid)
 (s/def ::parent-id ::id)
 (s/def ::pieces-count int?)


Fixed duplicate .core suffix in ns declaration of core.cljs

--- src/leiningen/new/om_start/core.cljs
+++ src/leiningen/new/om_start/core.cljs
@@ -1,4 +1,4 @@
-(ns {{namespace}}.core
+(ns {{namespace}}
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]))


Fix dev ns

Fix dev ns

--- dev/cljs/asciinema/player/dev.cljs
+++ dev/cljs/asciinema/player/dev.cljs
@@ -6,6 +6,7 @@
             [asciinema.player.source :as source]
             [asciinema.player.view :as view]
             [asciinema.player.format.asciicast-v0 :as v0]
+            [asciinema.player.format.asciicast-v1 :as v1]
             [clojure.walk :as walk]
             [cljs.core.async :refer [chan >! <! put!]]
             [schema.core :as s]
@@ -140,8 +141,8 @@
 ;;     (def v1-json (<! (fetch-json v1-url)))))

 ;; (go
-;;   (let [v1-frames (p/build-v1-frames v1-json)]
-;;     (time (last v1-frames))))
+;;   (let [v1-frames (v1/build-v1-frames v1-json)]
+;;     (time (last (take 500 v1-frames)))))

 ;; (let [v1-frames (p/build-v1-frames v1-json)]
 ;;   (-> v1-frames (nth 45) last p/vt->frame :lines vec (nth 13) ffirst))


Fix TCLI-85 by correcting plural call

Fix TCLI-85 by correcting plural call

--- src/main/clojure/cljs/tools/cli.cljs
+++ src/main/clojure/cljs/tools/cli.cljs
@@ -299,7 +299,7 @@
   [specs]
   (if (seq specs)
     (let [show-defaults? (some #(and (:required %) (contains? % :default)) specs)
-          parts (map (partial make-summary-parts show-defaults?) specs)
+          parts (map (partial make-summary-part show-defaults?) specs)
           lens (apply map (fn [& cols] (apply max (map count cols))) parts)
           lines (format-lines lens parts)]
       (s/join \newline lines))


reuse getters from metadata

reuse getters from metadata

--- src/main/java/org/dada/demo/core.clj
+++ src/main/java/org/dada/demo/core.clj
@@ -158,15 +158,14 @@
 ;; [name & options :name string :type class :convert fn :default val/fn] - TODO: :key, :version
 ;; TODO :default not a good idea - would replace nulls
 ;; TODO what about type hints on lambdas ?
-(defn expand-property [src-class src-type src-name & pvec]
+(defn expand-property [src-class src-type src-getter src-name & pvec]
   (let [pmap (apply array-map pvec)
 	tgt-type (or (pmap :type) src-type)
 	tgt-name (or (pmap :name) src-name)
 	convert (or (pmap :convert) identity)
 	default (or (pmap :default) ())
 	defaulter (if (fn? default) default (fn [value] default))
-	getter (make-proxy-getter src-class src-type src-name)
-	retriever (fn [value] (convert (. getter get value)))]
+	retriever (fn [value] (convert (. src-getter get value)))]
     [tgt-type tgt-name retriever]
     ))

@@ -181,11 +180,12 @@
 	  [name (make-proxy-getter tgt-class type name)]))
     fields)))

-(defn make-fields [src-class src-map props]
+(defn make-fields [src-class src-type-map src-getter-map props]
   (map (fn [prop]
 	   (let [src-name (first prop)
-		 src-type (src-map src-name)]
-	     (apply expand-property src-class src-type prop)))
+		 src-type (src-type-map src-name)
+		 src-getter (src-getter-map src-name)]
+	     (apply expand-property src-class src-type src-getter prop)))
        props))

 (defn select [src-model key-name version-name props & pvec]
@@ -194,17 +194,16 @@
 	tgt-model-name (or (pmap :model) (.toString (gensym "OutputModel")))
 	src-metadata (. src-model getMetadata)
 	src-class (. src-metadata getValueClass)
+	src-names (. src-metadata getAttributeNames)
 	src-types (. src-metadata getAttributeTypes)
-	src-names (. src-metadata getAttributeNames)
-	src-map (apply array-map (interleave src-names src-types)) ; name:type
-	fields (make-fields src-class src-map props) ; selection ([type name ...])
+	src-type-map (apply array-map (interleave src-names src-types)) ; name:type
+	src-getters (. src-metadata getAttributeGetters)
+	src-getter-map (apply array-map (interleave src-names src-getters)) ; name:getter
+	fields (make-fields src-class src-type-map src-getter-map props) ; selection ([type name ...])
    	tgt-types (map (fn [field] (nth field 0)) fields)
+	;; test to see if transform is needed should be done somewhere here...
    	tgt-names (map (fn [field] (nth field 1)) fields)
-	src-getters (. src-metadata getAttributeGetters)
    	sel-getters (map (fn [field] (nth field 2)) fields)
-	;; we should be able to take src-getters directly from metadata
-	;; map them to name and then
-	;;sel-getters (map (fn [name] (src-getter-map name)) tgt-names)
 	tgt-props (map (fn [field] [(nth field 0) (nth field 1)]) fields) ; ([type name]..)
 	class-factory (new ClassFactory)
   	tgt-class (apply make-class class-factory tgt-class-name tgt-props)
@@ -214,7 +213,7 @@
    	tgt-version-getter (tgt-getter-map version-name)
 	tgt-metadata (new GetterMetadata tgt-class tgt-types tgt-names tgt-getters)
 	view (VersionedModelView. tgt-model-name tgt-metadata tgt-key-getter tgt-version-getter)
-	transformer (transform src-model src-class src-map sel-getters tgt-names view tgt-class)]
+	transformer (transform src-model src-class src-type-map sel-getters tgt-names view tgt-class)]
     view)
   )


changed email message

changed email message

--- src/secret_santa_app/email/email.clj
+++ src/secret_santa_app/email/email.clj
@@ -11,10 +11,10 @@
 (def pw "Pi+3.1415")
 (. email setDebug true)
 (. email setAuthenticator (new DefaultAuthenticator from pw))
-(. email setMsg "this came from the clojure repl")
+(. email setMsg "this came from the heroku")
 (. email setFrom from)
 (. email addTo "timothy.d.butterworth@gmail.com" "John Doe")
-(. email setSubject "hi from clojure web")
+(. email setSubject "hi from clojure web on Heroku")
 (. email setSmtpPort port)
 (. email setHostName host)
 (. email setTLS true)


fix #530

fix #530

--- src/status_im/chats_list/styles.cljs
+++ src/status_im/chats_list/styles.cljs
@@ -6,7 +6,8 @@
                                                  text1-color
                                                  text2-color
                                                  new-messages-count-color]]
-            [status-im.components.tabs.styles :refer [tabs-height]]))
+            [status-im.components.tabs.styles :refer [tabs-height]]
+            [status-im.utils.platform :as p]))

 (def gradient-top-bottom-shadow
   ["rgba(24, 52, 76, 0.165)"
@@ -115,7 +116,7 @@

 (def list-container
   {:background-color color-light-gray
-   :margin-bottom    72})
+   :margin-bottom    (when p/ios? 72)})

 (def create-icon
   {:fontSize 20


CMR-1695: Fixing virtual product project file.

--- virtual-product-app/project.clj
+++ virtual-product-app/project.clj
@@ -6,6 +6,7 @@
                  [nasa-cmr/cmr-common-app-lib "0.1.0-SNAPSHOT"]
                  [nasa-cmr/cmr-system-trace-lib "0.1.0-SNAPSHOT"]
                  [nasa-cmr/cmr-message-queue-lib "0.1.0-SNAPSHOT"]
+                 [nasa-cmr/cmr-umm-lib "0.1.0-SNAPSHOT"]
                  [nasa-cmr/cmr-transmit-lib "0.1.0-SNAPSHOT"]
                  [compojure "1.3.2"]
                  [ring/ring-core "1.3.2" :exclusions [clj-time]]


adapting to new type edn format

adapting to new type edn format

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -47,9 +47,9 @@
        (generate-response (p/host h)))
   (GET "/host/type/:h" [h]
        (generate-response (select-keys (p/type (:type (p/fuzzy-host h))) [:classes])))
-  (POST "/type" [type module classes]
-        (p/new-type type {:module module :classes classes})
-        (generate-response {:msg "new type saved" :type type :classes classes}))
+  (POST "/type" [type & props]
+        (p/new-type type props)
+        (generate-response {:msg "new type saved" :type type :opts props}))
   )


clearing out debug and edn middleware import

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -6,7 +6,6 @@
         [ring.middleware.format-params :only [wrap-restful-params]]
         [ring.middleware.format-response :only [wrap-restful-response]]
         [metrics.ring.instrument :only  (instrument)]
-        [ring.middleware.edn :only (wrap-edn-params)]
         [ring.adapter.jetty :only (run-jetty)]
         [taoensso.timbre :only (debug info error warn set-config! set-level!)]
         [celestial.jobs :only (enqueue initialize-workers clear-all)])
@@ -47,7 +46,6 @@
   (GET "/host/machine/:h" [h]
        (generate-response (p/host h)))
   (GET "/host/type/:h" [h]
-       (debug (select-keys (p/type (:type (p/fuzzy-host h))) [:classes]))
        (generate-response (select-keys (p/type (:type (p/fuzzy-host h))) [:classes])))
   (POST "/type" [type module classes]
         (p/new-type type {:module module :classes classes})


continue work on new main method

continue work on new main method


wrap stacktrace canonicalization to suppress stack parse failures

if :repl-verbose, print failed stacktrace canonicalization

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -353,21 +353,27 @@
 (defn- display-error
   ([repl-env ret form opts]
    (display-error repl-env ret form (constantly nil) opts))
-  ([repl-env ret form f opts]
+  ([repl-env ret form f {:keys [print flush]}]
    (f)
    (when-let [value (:value ret)]
-     ((:print opts) value))
+     (print value))
    (when-let [st (:stacktrace ret)]
      (if (and (true? (:source-map opts))
               (satisfies? IParseStacktrace repl-env))
-       (let [cst (-parse-stacktrace repl-env st ret opts)]
+       (let [cst (try
+                   (-parse-stacktrace repl-env st ret opts)
+                   (catch Throwable e
+                     (when (:repl-verbose opts)
+                       (print "Failed to canonicalize stacktrace")
+                       (print (with-out-str (.printStacktrace e *out*)))
+                       (flush))))]
          (if (vector? cst)
            (if (satisfies? IPrintStacktrace repl-env)
              (-print-stacktrace repl-env cst ret opts)
              (print-mapped-stacktrace cst opts))
-           ((:print opts) st)))
-       ((:print opts) st))
-     ((:flush opts)))))
+           (print st)))
+       (print st))
+     (flush))))

 (defn evaluate-form
   "Evaluate a ClojureScript form in the JavaScript environment. Returns a


Render solutions in dropdown

Render solutions in dropdown

Hide solution sets by default... Will be removed eventually.

--- src/cljs/ji/main.cljs
+++ src/cljs/ji/main.cljs
@@ -85,12 +85,14 @@

 (defn render-solutions!
   [sets]
-  (let [el (node [:div.panel [:h2 "Hints"]])]
-    (if-let [x (sel1 :#solution)] (dom/remove! x))
+  (some-> (sel1 :#solution) (dom/remove!))
+  (let [ul (node [:ul#solution-sets.f-dropdown.content {:data-dropdown-content true}])]
     (dom/append! (sel1 :#sidebar-left)
-                 (node [:div#solution.row.collapse el]))
+                 (node [:div#solution
+                        [:a.button {:href "#" :data-dropdown "solution-sets"} "Hints"]
+                        ul]))
     (doseq [s sets]
-      (dom/append! el (card-ui/set-tmpl s)))))
+      (dom/append! ul (node [:li (card-ui/set-tmpl s)])))))

 (defn go-game-summary [container {:keys [game] :as finish-msg}]
   (go (let [modal (node [:div.reveal-modal.open


Adding reason phrase and protocol version to response map

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -324,7 +324,9 @@
          :chunked? (if (nil? entity) false (.isChunked entity))
          :repeatable? (if (nil? entity) false (.isRepeatable entity))
          :streaming? (if (nil? entity) false (.isStreaming entity))
-         :status (.getStatusCode status)})
+         :status (.getStatusCode status)
+         :protocol-version (.getProtocolVersion status)
+         :reason-phrase (.getReasonPhrase status)})
       (catch Throwable t
         (when-not (conn/reusable? conn-mgr)
           (.shutdown conn-mgr))


Convert given port-file option to a file.

--- wildfly/src/immutant/wildfly/repl.clj
+++ wildfly/src/immutant/wildfly/repl.clj
@@ -20,13 +20,14 @@
               [wunderboss.util            :as wu]))

 (defn ^:private possible-nrepl-files [file]
-  (if (and file (.isAbsolute (io/file file)))
-    [file]
-    (when (u/app-root)
-      (map u/app-relative
-        (if file
-          [file]
-          [".nrepl-port" "target/repl-port"])))))
+  (let [file (io/file file)]
+    (if (and file (.isAbsolute file))
+      [file]
+      (when (u/app-root)
+        (map u/app-relative
+          (if file
+            [file]
+            [".nrepl-port" "target/repl-port"]))))))

 (defn ^:private spit-nrepl-files
   [port file]


Revert back to :host from :interface for nrepl options [IMMUTANT-493]

--- wildfly/src/immutant/wildfly/repl.clj
+++ wildfly/src/immutant/wildfly/repl.clj
@@ -36,19 +36,19 @@
     (spit f port)
     (.deleteOnExit f)))

-(defn ^:private nrepl-interface-port [server]
+(defn ^:private nrepl-host-port [server]
   (let [ss (-> server deref :ss)]
     [(-> ss .getInetAddress .getHostAddress) (.getLocalPort ss)]))

 (defn stop
   "Stop the REPL"
   [server]
-  (iu/info (apply format "Shutting down nREPL at %s:%s" (nrepl-interface-port server)))
+  (iu/info (apply format "Shutting down nREPL at %s:%s" (nrepl-host-port server)))
   (.close server))

 (defn start
-  "Fire up a repl bound to interface/port"
-  [{:keys [interface port port-file] :or {interface "localhost", port 0}}]
+  "Fire up a repl bound to host/port"
+  [{:keys [host port port-file] :or {host "localhost", port 0}}]
   (let [{:keys [nrepl-middleware nrepl-handler]}
         (-> (wu/options) (get "repl-options" "{}") read-string)]
     (when (and nrepl-middleware nrepl-handler)
@@ -61,8 +61,8 @@
                               (symbol? %) (iu/require-resolve %)
                               (list? %) (eval %)))
                       (apply nrepl/default-handler)))
-          server (nrepl/start-server :port port :bind interface :handler handler)]
+          server (nrepl/start-server :port port :bind host :handler handler)]
       (u/at-exit (partial stop server))
-      (let [[interface bound-port] (nrepl-interface-port server)]
-        (iu/info (format "nREPL bound to %s:%s" interface bound-port))
+      (let [[host bound-port] (nrepl-host-port server)]
+        (iu/info (format "nREPL bound to %s:%s" host bound-port))
         (spit-nrepl-files bound-port port-file)))))


New test added into commits_stat_test.clj

--- test/arachnida/commits_stat_test.clj
+++ test/arachnida/commits_stat_test.clj
@@ -14,4 +14,21 @@
   (:require [clojure.test :refer :all]
             [arachnida.commits-stat :refer :all]))

+;
+; Common functions used by tests.
+;

+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+
+;
+; Tests for various functions
+;
+
+(deftest test-parse-sha-existence
+    "Check that the arachnida.commits-stat/parse-sha definition exists."
+    (testing "if the arachnida.commits-stat/parse-sha definition exists."
+        (is (callable? 'arachnida.commits-stat/parse-sha))))
+


ordering

ordering

--- test/celestial/integration/hooks.clj
+++ test/celestial/integration/hooks.clj
@@ -23,7 +23,7 @@

 (with-conf
   (with-state-changes [(before :facts (set-user {:username "admin"} (populate-all)))]
-    (fact "adding a new host" :hooks :tinymasq :integration
+    (fact "adding a new host" :integration :hooks :tinymasq
       (set-user {:username "admin"}
         (s/update-system 1 (merge-with merge (s/get-system 1) machine))
         (update-dns create) => "host added"


Refactored making a GET request to its own function

--- test/clj/memento/test/routes/api.clj
+++ test/clj/memento/test/routes/api.clj
@@ -1,10 +1,11 @@
 (ns memento.test.routes.api
   (:require [clojure.test :refer :all]
             [cognitect.transit :as transit]
-            [ring.mock.request :refer [request header]]
+            [ring.mock.request :refer [request header body]]
             [memento.handler :refer [app]]
             [memento.test.db.core :as tdb]
-            [memento.test.db.memory :as tdm]))
+            [memento.test.db.memory :as tdm])
+  (:import java.io.ByteArrayOutputStream))

 ;;;;
@@ -12,10 +13,30 @@
 ;;;;

 (defn transit->clj
+  "Receives a byte array expected to contain transit+json, and coverts it
+  to a clojure data structure"
   [arr]
-  (let [in     arr
-        reader (transit/reader in :json)]
-    (transit/read reader)))
+  (try
+    (let [reader (transit/reader arr :json)]
+      (transit/read reader))
+    (catch Exception _ nil)))
+
+(defn clj->transit
+  [data]
+  (let [out    (ByteArrayOutputStream. 4096)
+        writer (transit/writer out :json)]
+    (transit/write writer data)
+    (.toString out)))
+
+(defn get-request
+  "Executes a GET request with an optional set of parameters. Returns
+  a vector with the response and the translated body"
+  ([url]
+   (get-request url nil))
+  ([url params]
+   (let [response (app (-> (request :get url params)
+                           (header "Accept" "application/transit+json")))]
+     [response (transit->clj (:body response))])))

 ;;;;
 ;;;; Tests
@@ -26,13 +47,11 @@
   (tdb/init-placeholder-data!)
   (tdm/import-placeholder-memories!)
   (testing "Search request should not include a trailing slash"
-    (let [response (app (request :get "/api/memory/search/?q="))]
+    (let [[response _] (get-request "/api/memory/search/?q=")]
       (is response)
       (is (= 404 (:status response)))))
   (testing "GETting just 'memory' returns all thoughts"
-    (let [response (app (-> (request :get "/api/memory")
-                            (header "Accept" "application/transit+json")))
-          clj-data (transit->clj (:body response))]
+    (let [[response clj-data] (get-request "/api/memory" nil)]
       (is response)
       (is (= 200 (:status response)))
       (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))
@@ -42,9 +61,7 @@
         (is (= String (type (:created e)))))
       ))
   (testing "Searching without a query returns all elements"
-    (let [response (app (-> (request :get "/api/memory/search")
-                            (header "Accept" "application/transit+json")))
-          clj-data (transit->clj (:body response))]
+    (let [[response clj-data] (get-request "/api/memory/search")]
       (is response)
       (is (= 200 (:status response)))
       (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))
@@ -54,9 +71,7 @@
         (is (= String (type (:created e)))))
       ))
   (testing "Searching with a query filters the items"
-    (let [response (app (-> (request :get "/api/memory/search?q=always")
-                            (header "Accept" "application/transit+json")))
-          clj-data (transit->clj (:body response))]
+    (let [[response clj-data] (get-request "/api/memory/search?q=always")]
       (is response)
       (is (= 200 (:status response)))
       (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))
@@ -66,9 +81,7 @@
         (is (re-seq #"always" (:thought e))))))
   (testing "Passing multiple values uses them as OR"
     ;; The following could also have been passed as "?q=always+money"
-    (let [response (app (-> (request :get "/api/memory/search" {:q "always money"})
-                            (header "Accept" "application/transit+json")))
-          clj-data (transit->clj (:body response))]
+    (let [[response clj-data] (get-request "/api/memory/search" {:q "always money"})]
       (is response)
       (is (= 200 (:status response)))
       (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))


New tests: render-descriptions, render-front-page, render-navigation-bar etc.

--- test/clouseau/test_html_renderer.clj
+++ test/clouseau/test_html_renderer.clj
@@ -78,3 +78,29 @@
     (testing "if the clouseau.html-renderer/render-navigation-bar-section definition exists."
         (is (callable? 'clouseau.html-renderer/render-navigation-bar-section))))

+
+(deftest test-render-description-existence
+    "Check that the clouseau.html-renderer/render-description definition exists."
+    (testing "if the clouseau.html-renderer/render-description definition exists."
+        (is (callable? 'clouseau.html-renderer/render-description))))
+
+(deftest test-render-error-page-existence
+    "Check that the clouseau.html-renderer/render-error-page definition exists."
+    (testing "if the clouseau.html-renderer/render-error-page definition exists."
+        (is (callable? 'clouseau.html-renderer/render-error-page))))
+
+(deftest test-render-front-page-existence
+    "Check that the clouseau.html-renderer/render-front-page definition exists."
+    (testing "if the clouseau.html-renderer/render-front-page definition exists."
+        (is (callable? 'clouseau.html-renderer/render-front-page))))
+
+(deftest test-render-descriptions-existence
+    "Check that the clouseau.html-renderer/render-descriptions definition exists."
+    (testing "if the clouseau.html-renderer/render-descriptions definition exists."
+        (is (callable? 'clouseau.html-renderer/render-descriptions))))
+
+(deftest test-render-navigation-bar-section-existence
+    "Check that the clouseau.html-renderer/render-navigation-bar-section definition exists."
+    (testing "if the clouseau.html-renderer/render-navigation-bar-section definition exists."
+        (is (callable? 'clouseau.html-renderer/render-navigation-bar-section))))
+


lein: new cider-nrepl

lein: new cider-nrepl

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -2,7 +2,7 @@
                   [lein-ring "0.9.7"]
                   [lein-ancient "0.6.8"]
                   [jonase/eastwood "0.2.3"]
-                  [cider/cider-nrepl "0.10.0"]
+                  [cider/cider-nrepl "0.10.1"]
                   ]}}
 {:dev {:dependencies
        [[com.cemerick/pomegranate "0.3.0"]]


Formatting fix

Formatting fix


no print

no print


corrects the frame in a correlation-id binding block when mismatch is discovered (#461)

--- waiter/src/waiter/correlation_id.clj
+++ waiter/src/waiter/correlation_id.clj
@@ -16,7 +16,8 @@
 (ns waiter.correlation-id
   (:require [clojure.tools.logging :as log]
             [clojure.string :as str])
-  (:import (java.util Collections)
+  (:import (clojure.lang Var)
+           (java.util Collections)
            (org.apache.log4j Appender EnhancedPatternLayout Logger PatternLayout)))

 ; Use lower-case to preserve consistency with Ring's representation of headers
@@ -52,16 +53,19 @@
   `(let [correlation-id# ~correlation-id]
      (binding [dynamic-correlation-id correlation-id#]
        (let [start-thread# (Thread/currentThread)
+             start-frame# (Var/getThreadBindingFrame)
              result# (do ~@body)
-             end-thread# (Thread/currentThread)]
-         (when (not= (.getId start-thread#) (.getId end-thread#))
-           (log/warn "with-correlation-id binding executed on different threads"
+             end-thread# (Thread/currentThread)
+             end-frame# (Var/getThreadBindingFrame)]
+         (when-not (identical? start-frame# end-frame#)
+           (log/warn "with-correlation-id binding executed in different contexts, correcting frame"
                      {:end {:correlation-id (get-correlation-id)
                             :thread-id (.getId end-thread#)
                             :thread-name (.getName end-thread#)}
                       :start {:correlation-id correlation-id#
                               :thread-id (.getId start-thread#)
-                              :thread-name (.getName start-thread#)}}))
+                              :thread-name (.getName start-thread#)}})
+           (Var/resetThreadBindingFrame start-frame#))
          result#))))


more testing functions

more testing functions

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

--- acqEngine/src/org/micromanager/test/saving.clj
+++ acqEngine/src/org/micromanager/test/saving.clj
@@ -92,7 +92,7 @@
    images to a file using the direct byte buffer method."
   [num-images]
     (let [filename (str "D:/AcquisitionData/test" (rand-int 100000) ".dat")
-          file (FileOutputStream. filename false)
+          file (RandomAccessFile. filename "rw")
           channel (.getChannel file)]
       (try
         (let [buffer-queue (time (byte-buffer-queue num-images))]
@@ -110,11 +110,11 @@
   (let [buffer-queue (time (byte-buffer-queue num-images))]
     (let [filename (str "D:/AcquisitionData/test" (rand-int 100000) ".dat")
           file (RandomAccessFile. filename "rw")
-          channel (.getChannel file)
-          out (.. file getChannel (map FileChannel$MapMode/READ_WRITE 0 (* num-images 2560 2160 2)))]
+          channel (.getChannel file)]
       (try
         (dotimes-timed [i num-images] 100
-                       (let [pixels (.take buffer-queue)]
+                       (let [pixels (.take buffer-queue)
+                             out (.. file getChannel (map FileChannel$MapMode/READ_WRITE 0 (.limit pixels)))]
                          (.put out pixels)))
         (catch Exception e (println e))
         (finally (.close file))))))
@@ -132,6 +132,22 @@
           (.put storage-queue buffer)))
     storage-queue))

+(defn test-write [num-images]
+  (let [buffer (byte-buffer (* 2560 2160 2))
+        filename (str "D:/AcquisitionData/test" (rand-int 100000) ".dat")
+        file (RandomAccessFile. filename "rw")
+        channel (.getChannel file)]
+    (println filename)
+    (try
+      (dotimes-timed [i num-images] 100
+                     (.rewind buffer)
+        (.write channel buffer))
+      (catch Exception e (println e))
+      (finally
+        (.close file)))))
+
+
+
 (defn monitor-circular-buffer []
   (while (not (core isSequenceRunning))
     (Thread/sleep 100))


clojure: added a test file for new symmetry code

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -175,6 +175,6 @@
       (when (not good) (println n1 n2))
       good))

-  (doseq [f ["dia.pgr", "test.pgr", "Fivecases.cgd"]
+  (doseq [f ["dia.pgr", "test.pgr", "Fivecases.cgd", "xbad.pgr"]
           g (nets f)]
         (is (test-net g))))


ns has moved to util.ns

ns has moved to util.ns

--- src/overtone/live.clj
+++ src/overtone/live.clj
@@ -1,6 +1,5 @@
 (ns overtone.live
-  (:use [overtone.ns]
-        [overtone.util lib])
+  (:use [overtone.util lib ns])
   (:require clojure.stacktrace
             midi overtone.osc byte-spec
             [overtone.algo chance scaling position trig]


Use more idiomatic and readable way to index.

--- src/afterglow/max/Cue.clj
+++ src/afterglow/max/Cue.clj
@@ -106,10 +106,9 @@
   (let [{:keys [x y]} @(.state this)
         [_ active] (show/find-cue-grid-active-effect *show* x y)]
     (when active
-      (doseq [[i v] (map vector (range) (cue-variables this))]
+      (doseq [[outlet v] (map vector (iterate inc 1) (cue-variables this))]
       (when (string? (:key v))
-        (let [outlet (inc i)
-              cue-local-key (keyword (:key v))
+        (let [cue-local-key (keyword (:key v))
               cue-local-var (get-in active [:variables cue-local-key])
               f (fn [_ new-value] (when (number? new-value) (.outlet this outlet (float new-value))))]
           (swap! (.state this) assoc-in [:local-var-fn cue-local-var] f)
@@ -152,10 +151,9 @@
       (controllers/add-cue-fn! (:cue-grid *show*) x y f))

     ;; Set up the callback functions for changes to values of permanent show variables bound to the cue
-    (doseq [[i v] (map vector (range) (cue-variables this))]
+    (doseq [[outlet v] (map vector (iterate inc 1) (cue-variables this))]
       (when (keyword? (:key v))
-        (let [outlet (inc i)
-              f (fn [_ new-value] (when (number? new-value) (.outlet this outlet (float new-value))))]
+        (let [f (fn [_ new-value] (when (number? new-value) (.outlet this outlet (float new-value))))]
           (swap! (.state this) assoc-in [:perm-var-fn (:key v)] f)
           (show/add-variable-set-fn! (:key v) f))))))


#18 - Added the verse of the day to the kingjames.bible TOC.

--- src/biblecli/commands/staticpages.cljs
+++ src/biblecli/commands/staticpages.cljs
@@ -60,11 +60,14 @@
   text-align: center;
   page-break-before: always;
 }
-.verse {
+.verse, .votd p {
   padding: 0.18em 0.25em;
   margin: 0;
   line-height: 1.2em;
   text-indent: 0;
+}
+.votd {
+  min-height: 4em;
 }
 .ps119h {
   margin-top: 0.6em;
@@ -340,6 +343,9 @@
           [:div.content
             [:h1 "The King James Bible"]

+            [:div#votd.votd]
+            [:script "(function(w,d,t,u,v,i,n,l){w['VotdObject']=v;w[v]=w[v]||{};w[v].i=i;n=d.createElement(t),l=d.getElementsByTagName(t)[0];n.async=1;n.src=u;l.parentNode.insertBefore(n,l)})(window,document,'script','https://kingjames.bible/votd/votd.js','votd','votd');"]
+
             [:h2 "The Old Testament"]
             (->> m
               (take 39)


remove debugging event handler

remove debugging event handler

--- src/chat/client/views/new_message.cljs
+++ src/chat/client/views/new_message.cljs
@@ -244,8 +244,7 @@
                                      (highlight-clear!))))})

             (when autocomplete-open?
-              (dom/div #js {:className "autocomplete"
-                            :onWheel (fn [e] (.log js/console "wheel" e))}
+              (dom/div #js {:className "autocomplete"}
                 (if (seq results)
                   (apply dom/div nil
                     (map-indexed


cleaned up debugging

cleaned up debugging

--- src/clj/onyx_java/instance/catalog.clj
+++ src/clj/onyx_java/instance/catalog.clj
@@ -20,6 +20,4 @@
   (contains? task :java-instance/id))

 (defn id [task]
-  (let [id (get task :java-instance/id "MISSING")]
-    (println "id> " id)
-    id))
+  (get task :java-instance/id "MISSING"))


export heatmap (unexpanded version)

export heatmap (unexpanded version)

--- src/cljs/gointermod/heatmap/views.cljs
+++ src/cljs/gointermod/heatmap/views.cljs
@@ -3,6 +3,7 @@
     (:require [re-frame.core :as re-frame]
       [gointermod.search.handlers :as search]
       [gointermod.utils.utils :as utils]
+      [gointermod.utils.exportcsv :as exportcsv]
       [gointermod.utils.comms :as comms]
       [cljs.core.async :refer [put! chan <! >! timeout close!]]))

@@ -110,10 +111,21 @@
           [:td.no-go-terms {:col-span (- cols 2)} "N/A"]
 ]) empties))))

+(defn csv-counts
+  "format heatmap results as a csv for download"
+  []
+  (let [heatmap (re-frame/subscribe [:heatmap-aggregate])
+        go-terms (:headers @heatmap)
+        headers (str "Organism,Ortholog," (clojure.string/join "," go-terms) "\n")]
+    (reduce (fn [csv-str result]
+      (str csv-str (clojure.string/join "," result) "\n" )
+    ) headers (:rows @heatmap))
+))
+
 (defn heatmap []
   (re-frame/dispatch [:trigger-data-handler-for-active-view])
     [:div.heatmap
-      [:h2 "Annotation count by species"]
+      [:h2 "Annotation count by species"] [exportcsv/download-button (csv-counts)]
         [:table
           [headers]
           [counts]


refactor evidences

refactor evidences

--- src/cljs/salava/badge/ui/evidence.cljs
+++ src/cljs/salava/badge/ui/evidence.cljs
@@ -9,7 +9,7 @@
             [clojure.string :refer [blank? includes? split trim starts-with?]]
             [salava.file.icons :refer [file-icon]]
             [salava.file.ui.my :refer [send-file]]
-            [salava.badge.ui.settings :as se]))
+            #_[salava.badge.ui.settings :as se]))

 (defn url? [s]
   (when-not (blank? s)
@@ -55,7 +55,7 @@
                     :properties {:resource_type (get-in evidence [:properties :resource_type]) :hidden (get-in evidence [:properties :hidden])}}]
     (swap! state assoc :evidence evidence)))

-(defn toggle-show-evidence! [id data state init-data]
+(defn toggle-show-evidence! [id data state init-data]evidence
   (let [visibility-atom (cursor state [:evidence :properties :hidden])
         new-value (not @visibility-atom)
         badgeid (:id @state)]


fix leiningen

fix leiningen

--- singleModule/leiningen/project.clj
+++ singleModule/leiningen/project.clj
@@ -10,7 +10,7 @@
   :update :never
   :checksum :fail
   :source-paths ["src/main/clojure"]
-  :java-source-paths ["src/main/java"]  ; Java source is stored separately.
+  :java-source-paths ["src/main/java" "src/test/java"]  ; Java source is stored separately.
   :test-paths ["src/test/clojure"]
   :junit ["src/test/java"]
   ;; regex magic to include all *Test.java, but no *AbstractTest.java
@@ -22,4 +22,4 @@
   ;; Name of the jar file produced. Will be placed inside :target-path.
   ;; Including %s will splice the project version into the filename.
   :jar-name "leiningen-example.jar"
-  :auto-clean false)+  :auto-clean false)


make nav fixed position on new home

make nav fixed position on new home

--- frontend/components/landing-b.cljs
+++ frontend/components/landing-b.cljs
@@ -23,14 +23,14 @@
       (let [ab-tests (:ab-tests app)
             controls-ch (om/get-shared owner [:comms :controls])]
         (html [:div.home.page
+               [:nav.home-nav
+                [:a.promo "What is Continuous Integration?"]
+                [:a.login "Log In"]]
                [:section.home-prolog
                 [:a.home-action {:role "button"}
                  "Sign Up Free"]
                 [:div.home-cover]
-                [:div.home-top-shelf
-                 [:nav
-                  [:a.promo "What is Continuous Integration?"]
-                  [:a.login "Log In"]]]
+                [:div.home-top-shelf]
                 [:div.home-avatars
                  [:div.avatars
                   [:div.avatar-github


copy improvement based on feedback

copy improvement based on feedback

--- frontend/components/landing_b.cljs
+++ frontend/components/landing_b.cljs
@@ -288,7 +288,8 @@
                      (list
                       [:a {:on-click #(put! controls-ch [:toolset-clicked {:toolset (keyword (str/lower-case toolset))}])} toolset] ", "))
                    "we support all of your tools.
-                   Anything you can run on Linux, we can support, including your own customer tools.
+                   If it runs on Linux, then it will work on CircleCI.
+                   We'll even be around to help you install your own tools.
                    The best development teams in the world trust us as their continuous integration and delivery solution because of our unmatched support and our ability to scale with them.
                    We're built for teams."]]]
                 [:div.practice-customers