Damage system :collidable? indicates how much damage an object deals on collision. :damage-taken indicated how much damage an object has taken in the current tick.

--- src/asteroids/core.clj
+++ src/asteroids/core.clj
@@ -22,26 +22,28 @@
 (def ship-life 3)
 (def ship-acceleration 1)
 (def ship-rotation-speed 4)
+(def ship-damage 4)
 (def shot-size (/ ship-size 10))
 (def shot-speed 2.5)
+(def shot-damage 3)
 (def shot-millis 300)
 (def missile-size (/ ship-size 3))
-(def missile-speed 1)
-(def missile-acceleration 1)
+(def missile-speed 0)
+(def missile-damage 30)
+(def missile-acceleration 3)
 (def missile-millis 10000)
 (def asteroids-start-number 1)
 (def asteroid-start-size 5)
-(def asteroid-min-size 1.2)
-(def asteroid-size-variance 0.2)
+(def asteroid-min-size 1.3)
+(def asteroid-size-variance 0.1)
 (def asteroid-jaggedness 0.7)
 (def asteroid-max-speed 0.6)
 (def asteroid-max-rotation-speed 4)
-(def fragment-number 3)
-(def crit-fragment-number 30)
-(def fragment-size-reduction (Math/sqrt fragment-number))
-(def crit-fragment-size-reduction (Math/sqrt crit-fragment-number))
+(def asteroid-damage 1)
 (def debris-life-millis 3000)
 (def turn-millis 40)
+
+(def sqrt (memoize #(Math/sqrt %)))

 (def actions {
               (int \A) {:rotation (- ship-rotation-speed)}
@@ -112,7 +114,7 @@

    :life                   ship-life
    :life-colors            [(Color. 255 0 0) (Color. 255 80 75) (Color. 250 160 75) (Color. 160 160 150)]
-   :collidable?            false                            ; is set to true at first movement / shooting
+   :collidable?            false                            ; is set to ship-damage at first movement / shooting
    })

 (defn create-circle
@@ -132,7 +134,7 @@
     :direction      0
     :rotation-speed 0

-    :collidable?    true
+    :collidable?    'whatever
     }))

 (defn create-shot
@@ -151,7 +153,7 @@
     :direction      dir
     :rotation-speed 0

-    :collidable?    true
+    :collidable?    shot-damage
     })
   ([{:keys [position size direction speed] :as ship}]
    (let [dir-vec (m/rotate-vec direction [0 1])
@@ -176,7 +178,7 @@
     :direction      dir
     :rotation-speed 0

-    :collidable+?   true
+    :collidable?   missile-damage
     })
   ([{:keys [position size direction speed] :as ship}]
    (let [dir-vec (m/rotate-vec direction [0 1])
@@ -215,7 +217,7 @@
       :direction      direction
       :rotation-speed rotation-speed

-      :collidable?    (not debris?)
+      :collidable?    (if debris? false asteroid-damage)

       :life-time      (if debris? debris-life-millis nil)
       }))
@@ -262,6 +264,9 @@
         square #(* % %)]
     (<= (+ (square delta-x) (square delta-y)) (square size))))

+(defn damage [{current-damage :damage-taken :as obj} damage-amount]
+  (assoc obj :damage-taken (if current-damage (+ current-damage damage-amount) damage-amount)))
+
 (defmulti check-collision
           (fn [obj1 obj2]
             (cond
@@ -270,15 +275,11 @@
               (and (sequential? obj1) (sequential? obj2)) :seq-seq)))

 (defmethod check-collision :map-map [obj1 obj2]
-  (if (and (:collidable+? obj1)
+  (if (and (:collidable? obj1)
            (:collidable? obj2)
            (collide? obj1 obj2))
-    [(assoc obj1 :hit? true) (assoc obj2 :crit-hit? true)]
-    (if (and (:collidable? obj1)
-             (:collidable? obj2)
-             (collide? obj1 obj2))
-      [(assoc obj1 :hit? true) (assoc obj2 :hit? true)]
-      [obj1 obj2])))
+    [(damage obj1 (:collidable? obj2)) (damage obj2 (:collidable? obj1))]
+    [obj1 obj2]))

 (defmethod check-collision :map-seq [obj1 coll]
   (loop [obj1 obj1, coll coll, coll-result []]
@@ -294,51 +295,50 @@
       (let [[obj1 coll2] (check-collision (first coll1) coll2)]
         (recur (rest coll1) coll2 (conj coll1-result obj1))))))

-(defmulti handle-collision (fn [{type :type}]
+(defmulti handle-damage (fn [{type :type}]
                              (if (#{:ship :shot :asteroid} type)
                                type
                                :other)))

-(defmethod handle-collision :ship [{:keys [hit? life] :as ship}]
-  (when hit? (play-sound (if (<= (dec life) 0) "ship-destroyed" "ship-hit")))
-  (if hit?
-    (assoc ship :life (dec life)
-                :hit? false)
+(defmethod handle-damage :ship [{:keys [damage-taken life] :as ship}]
+  (when damage-taken (play-sound (if (<= life damage-taken) "ship-destroyed" "ship-hit")))
+  (if damage-taken
+    (assoc ship :life (- life damage-taken)
+                :damage-taken nil)
     ship))

-(defmethod handle-collision :shot [{:keys [hit?] :as shot}]
-  (when hit? (play-sound "asteroid-hit"))
-  (if hit?
+(defmethod handle-damage :shot [{:keys [damage-taken] :as shot}]
+  (when damage-taken (play-sound "asteroid-hit"))
+  (if damage-taken
     nil
     shot))

-(defmethod handle-collision :missile [{:keys [hit?] :as missile}]
-  (when hit? (play-sound "asteroid-hit"))
-  (if hit?
+(defmethod handle-damage :missile [{:keys [damage-taken] :as missile}]
+  (when damage-taken (play-sound "asteroid-hit"))
+  (if damage-taken
     nil
     missile))

-(defmethod handle-collision :asteroid [{:keys [hit? crit-hit? size position speed] :as asteroid}]
-  (cond
-    crit-hit? (create-asteroids crit-fragment-number (/ size crit-fragment-size-reduction) position speed)
-    hit? (create-asteroids fragment-number (/ size fragment-size-reduction) position speed)
-    :else asteroid))
-
-(defmethod handle-collision :other [{hit? :hit? :as object}]
-  (if hit?
+(defmethod handle-damage :asteroid [{:keys [damage-taken size position speed] :as asteroid}]
+  (if damage-taken
+    (create-asteroids damage-taken (/ size (sqrt damage-taken)) position speed)
+    asteroid))
+
+(defmethod handle-damage :other [{damage-taken :damage-taken :as object}]
+  (if damage-taken
     nil
     object))

 (defn resolve-all-collision [{shots :shots :as ship} asteroids]
   (let [[ship asteroids] (check-collision ship asteroids)
         [shots asteroids] (check-collision shots asteroids)
-        ship (handle-collision ship)
+        ship (handle-damage ship)
         shots (->> shots
-                   (map handle-collision)
+                   (map handle-damage)
                    flatten
                    (filter (comp not nil?)))
         asteroids (->> asteroids
-                       (map handle-collision)
+                       (map handle-damage)
                        flatten
                        (filter (comp not nil?)))]
     [(assoc ship :shots shots) asteroids]))
@@ -430,10 +430,10 @@

 (defn do-action!
   ([ship {:keys [acceleration rotation shoot fire-missile] :as action} activate?]
-   (when acceleration (dosync (alter ship assoc :acceleration (if activate? acceleration 0) :collidable? true)))
+   (when acceleration (dosync (alter ship assoc :acceleration (if activate? acceleration 0) :collidable? ship-damage)))
    (when rotation (dosync (alter ship set-rotation rotation activate?)))
-   (when shoot (dosync (alter ship assoc :shooting? activate? :collidable? true)))
-   (when fire-missile (dosync (alter ship assoc :firing? activate? :collidable? true))))
+   (when shoot (dosync (alter ship assoc :shooting? activate? :collidable? ship-damage)))
+   (when fire-missile (dosync (alter ship assoc :firing? activate? :collidable? ship-damage))))
   ([ship action]
    (do-action! ship action true)))


Added mutate-entry delete test.

Added mutate-entry delete test.

--- src/cbfg/test/kvs.cljs
+++ src/cbfg/test/kvs.cljs
@@ -260,6 +260,42 @@
                                  (dissoc (merge m8 {:status :ok})
                                          :keys)
                                  (atake tkvs res-ch8))))
+                           (let [res-ch9 (achan tkvs)
+                                 m9 {:opaque @n
+                                     :res-ch res-ch9
+                                     :op :multi-change
+                                     :kvs-ident (:kvs-ident open)
+                                     :changes [(cbfg.kvs/mutate-entry {:key :a :deleted true})]}]
+                             (aput tkvs cmd-ch m9)
+                             (and
+                              (let [res9 (atake tkvs res-ch9)]
+                                (and (:sq res9)
+                                     (e n res9
+                                        (dissoc (merge m9 {:status :ok :key :a :sq (:sq res9)})
+                                                :changes)
+                                        nil)
+                                     (e n (atake tkvs res-ch9)
+                                        (dissoc (merge m9 {:status :ok})
+                                                :changes)
+                                        (atake tkvs res-ch9))
+                                     (let [res-ch9a (achan tkvs)
+                                           m9a {:opaque @n
+                                                :res-ch res-ch9a
+                                                :op :multi-get
+                                                :kvs-ident (:kvs-ident open)
+                                                :keys [:a]}]
+                                       (aput tkvs cmd-ch m9a)
+                                       (and
+                                        (let [res9a (atake tkvs res-ch9a)]
+                                          (e n res9a
+                                             (dissoc (merge m9a {:partial :not-found
+                                                                 :key :a})
+                                                     :keys)
+                                             nil)
+                                          (e n (atake tkvs res-ch9a)
+                                             (dissoc (merge m9a {:status :ok})
+                                                     :keys)
+                                             (atake tkvs res-ch9a)))))))))
                            ))))
            "pass"
            (str "FAIL: on test-lane #" @n)))))


Based make-t2-cmd-handlers on req-handlers.

--- src/cbfg/world/t2.cljs
+++ src/cbfg/world/t2.cljs
@@ -18,15 +18,12 @@

 (defn cmd-handler [c] (assoc c :rq #(req-handler % c)))

-(defn make-t2-cmd-handlers [st]
-  {"add"   (fn [c] (assoc c :rq #(cbfg.world.base/example-add % c)))
-   "sub"   (fn [c] (assoc c :rq #(cbfg.world.base/example-sub % c)))
-   "count" (fn [c] (assoc c :rq #(cbfg.world.base/example-count % c)))
-   "close-lane" (fn [c] (assoc c :op :close-lane))})
+(defn make-t2-cmd-handlers []
+  (into {} (map (fn [k] [k cmd-handler]) (keys req-handlers))))

 (defn world-vis-init [el-prefix init-event-delay]
   (cbfg.world.t1/world-vis-init-t "cbfg.world.t2"
-                                  (make-t2-cmd-handlers nil) el-prefix
+                                  (make-t2-cmd-handlers) el-prefix
                                   cbfg.world.t1/ev-msg init-event-delay))

 ; --------------------------------------------


TODO comment.

TODO comment.

--- src/cbfg/world/t2.cljs
+++ src/cbfg/world/t2.cljs
@@ -21,6 +21,7 @@
            (if (= (:status res) :ok)
              (state-loop actx [:coll path rev] coll-handler {})
              (do (println "make-coll kvs-open failed" res)
+                 ; TODO: Should also consume any reqs that raced onto coll-ch.
                  (aclose coll-init coll-ch)))))
     {:rev rev
      :path path


change compiled .js name to aspire.js

change compiled .js name to aspire.js

--- src/clj/aspire/web.clj
+++ src/clj/aspire/web.clj
@@ -23,7 +23,7 @@
                 [:body
                  [:div#main
                   [:div [:p#loading "Loading..."]]
-                 [:script {:src "js/cljs.js"}]]])))
+                 [:script {:src "js/aspire.js"}]]])))

 (defresource resource-api
   :available-media-types ["application/edn"]


Fix implementations

Fix implementations

--- src/clj/brutha/geo.clj
+++ src/clj/brutha/geo.clj
@@ -43,8 +43,12 @@
 (defn p+ [p1 p2]
   (p-map + p1 p2))

+(defn p-inv [p]
+  (let [[x y] (-vec p)]
+    (point (/ 1 x) (/ 1 y))))
+
 (defn p- [p1 p2]
-  (p-map + p1 p2))
+  (p-map - p1 p2))

 (defn p* [p1 m]
   (dot p1 [m m]))
@@ -140,6 +144,12 @@
   {:pre [(p>= dims [0 0])]}
   (->Rect tl dims))

+(defn dims [b]
+  (-dims b))
+
+(defn top-left [b]
+  (-top-left b))
+
 (defn p-inside? [p b]
   (let [tl (-top-left b)
         br (-bottom-right b)]


functions for writing to text of seq files

--- src/clj/flambo/api.clj
+++ src/clj/flambo/api.clj
@@ -116,6 +116,11 @@
         (.map (function untuple))))

 ;;; Actions
+(defn save-as-text-file [rdd path]
+  (.saveAsTextFile rdd path))
+
+(defn save-as-sequence-file [rdd path]
+  (.saveAsSequenceFile rdd path))

 (def first (memfn first))
 (def count (memfn count))


Added "resolution" to the rain dataset information.

--- src/clj/forma/core.clj
+++ src/clj/forma/core.clj
@@ -47,7 +47,7 @@
   ^{:doc "Extracts ."}
   [filename month]
   (let [year (Integer/parseInt (first (re-find #"(\d{4})" filename)))]
-    (julian->period year month res)))
+    [res (julian->period year month res)]))

 ;; This has some fundamental errors. For example, what do we do for
 ;; rain data when we start getting in to higher resolution MODIS?
@@ -62,5 +62,5 @@
      (let [rain-files (all-files rain-dir)]
        (?<- (stdout) [?dataset ?res ?period]
             (rain-files ?filename ?file)
-            (extract-period [res] ?filename ?month :> ?period)
+            (extract-period [res] ?filename ?month :> ?res ?period)
             (r/unpack-rain ?file :> ?dataset ?month ?month-data)))))


Move failsafe context around launch-nrepl

This way consumers can call it more safely.

--- src/clj/reply/main.clj
+++ src/clj/reply/main.clj
@@ -63,24 +63,36 @@
                                    (assoc arg-map :skip-default-init true))
       arg-map)))

+(defmacro with-launching-context [& body]
+  `(try
+    (.addShutdownHook (Runtime/getRuntime) (Thread. #(reader.jline/shutdown-reader)))
+    (concurrency/set-signal-handler! "CONT" handle-resume)
+    (with-redefs [clojure.core/print-sequential hacks.printing/print-sequential
+                  clojure.repl/pst clj-stacktrace.repl/pst]
+      ~@body)
+    (catch Exception e# (clojure.repl/pst e#))
+    (finally (exit))))
+
 (defn launch-nrepl [options]
   "Launches the nREPL version of REPL-y, with options already
   parsed out"
-  (reader.jline/with-jline-in
-    (evaluation.nrepl/main options)))
+  (with-launching-context
+    (reader.jline/with-jline-in
+      (evaluation.nrepl/main options))))

 (defn launch-standalone
   "Launches the streamed (non-nREPL) version of REPL-y, with options already
   parsed out"
   [options]
-  (concurrency/set-signal-handler! "INT" handle-ctrl-c)
-  (clojure.main/repl :read reply-read
-        :eval reply-eval
-        :print reply-print
-        :init #(initialization/eval-in-user-ns
-                (initialization/construct-init-code options))
-        :prompt (constantly false)
-        :need-prompt (constantly false)))
+  (with-launching-context
+    (concurrency/set-signal-handler! "INT" handle-ctrl-c)
+    (clojure.main/repl :read reply-read
+          :eval reply-eval
+          :print reply-print
+          :init #(initialization/eval-in-user-ns
+                  (initialization/construct-init-code options))
+          :prompt (constantly false)
+          :need-prompt (constantly false))))

 (declare -main) ; for --help
 (defn launch
@@ -89,16 +101,9 @@
 Available options: [:help :custom-init :skip-default-init :nrepl :attach :port :color]
 See -main for descriptions."
   [options]
-  (try
-    (.addShutdownHook (Runtime/getRuntime) (Thread. #(reader.jline/shutdown-reader)))
-    (concurrency/set-signal-handler! "CONT" handle-resume)
-    (with-redefs [clojure.core/print-sequential hacks.printing/print-sequential
-                  clojure.repl/pst clj-stacktrace.repl/pst]
-      (cond (:help options) (println (clojure.repl/doc -main))
-            (:nrepl options) (launch-nrepl options)
-            :else (launch-standalone options)))
-  (catch Exception e (clojure.repl/pst e))
-  (finally (exit))))
+  (cond (:help options) (do (println (clojure.repl/doc -main)) (exit))
+        (:nrepl options) (launch-nrepl options)
+        :else (launch-standalone options)))

 (defn -main
   "Launches a REPL. Customizations available:


Fallback to default-config when config.clj is missing at load time.

This was breaking uberjar deployments.

--- src/clojars/config.clj
+++ src/clojars/config.clj
@@ -3,8 +3,6 @@
             [clojure.java.io :as io]
             [clojure.string :as str]
             [ring.util.codec :as codec]))
-
-(def config (when-not *compile-files* (read-string (slurp (io/resource "config.clj")))))

 (def default-config
   {:port 8080
@@ -17,6 +15,13 @@
           :ssl false
           :from "noreply@clojars.org"}
    :bcrypt-work-factor 12})
+
+(defn parse-resource [f]
+  (when-let [r (io/resource f)] (read-string (slurp r))))
+
+;; we attempt to read a config.clj from the classpath at load time
+;; this is handy for interactive development and unit tests
+(def config (merge default-config (parse-resource "config.clj")))

 (defn url-decode [s]
   (java.net.URLDecoder/decode s "UTF-8"))
@@ -87,9 +92,6 @@
 (defn parse-file [f]
   (read-string (slurp (io/file f))))

-(defn parse-resource [f]
-  (when-let [r (io/resource f)] (read-string (slurp r))))
-
 (defn remove-nil-vals [m]
   (into {} (remove #(nil? (val %)) m)))


Update text

Update text

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -151,7 +151,10 @@
                (dom/span #js {:className "input-group-addon pointer"
                               :onClick   lib/remove-selection}
                          (vlib/fa-icon "fa-times")))
-      (dom/p #js {:className "text-center"} "Möchtest du deine Aussage durch eine Referenz von dieser Seite stützen? Dann markiere einfach einen Teil des Textes mit der Maus."))))
+      (dom/p #js {:className "text-center"}
+             "Möchten Sie Ihre Aussage durch eine Referenz von dieser Seite stützen? Dann markieren Sie einfach einen Teil des Textes mit der Maus."
+             (dom/br nil)
+             "Das Markieren von Textpassagen über mehrere Absätze hinweg und das doppelte markieren schon markierter Textstellen wurde noch nicht implementiert."))))

 (defn add-element
   "Show form to add a new statement."


specs.types: Fix the specs for ::ref and ::ref-many

--- src/main/workflo/macros/specs/types.cljc
+++ src/main/workflo/macros/specs/types.cljc
@@ -80,9 +80,9 @@

 ;;;; Simple reference types

-(s/def ::ref ::id)
-(s/def ::ref-many (s/or :vector (s/coll-of ::id :kind vector?)
-                        :set (s/coll-of ::id :kind set?)))
+(s/def ::ref (s/keys :req [:workflo/id]))
+(s/def ::ref-many (s/or :vector (s/coll-of ::ref :kind vector?)
+                        :set (s/coll-of ::ref :kind set?)))

 ;;;; Entity references


Remove ns

Remove ns

--- src/expound/alpha.cljc
+++ src/expound/alpha.cljc
@@ -10,8 +10,7 @@
             [expound.printer :as printer]
             [expound.util :as util]
             [expound.ansi :as ansi]
-            [clojure.spec.gen.alpha :as gen]
-            [expound.paths :as paths]))
+            [clojure.spec.gen.alpha :as gen]))

 ;;;;;; registry ;;;;;;

@@ -263,7 +262,7 @@
  Dispatch value:        `%s`"
      (pr-str mm)
      (pr-str retag)
-     (pr-str (if retag (retag (paths/value-in form path)) nil)))))
+     (pr-str (if retag (retag (problems/value-in form path)) nil)))))

 (defmulti ^:no-doc problem-group-str (fn [type _spec-name _form _path _problems _opts] type))
 (defmulti ^:no-doc expected-str (fn [type  _spec-name _form _path _problems _opts] type))
@@ -300,7 +299,7 @@
                       ;; who provides their own *value-str-fn*
                       ;; could use this
                         ::no-value-found
-                        (paths/value-in form path))]
+                        (problems/value-in form path))]
     (printer/format
      "%s%s"
      (*value-str-fn* spec-name form path invalid-value)
@@ -433,7 +432,7 @@
    "Cannot find spec for

 %s"
-   (show-spec-name spec-name (*value-str-fn* spec-name form path (paths/value-in form path)))))
+   (show-spec-name spec-name (*value-str-fn* spec-name form path (problems/value-in form path)))))

 (defmethod problem-group-str :expound.problem/missing-spec [type spec-name form path problems opts]
   (printer/format
@@ -690,7 +689,7 @@

    (ansi/color (printer/indent (pr-str (:expound/check-fn-call (first problems)))) :bad-value)

-   (*value-str-fn* spec-name form path (paths/value-in form path))
+   (*value-str-fn* spec-name form path (problems/value-in form path))
    (expected-str _type spec-name form path problems opts)))

 (defmethod expected-str :expound.problem/unknown [_type spec-name form path problems opts]


Added missing subclass relations

Added missing subclass relations

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/goa/goa.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/goa/goa.clj
@@ -4,10 +4,11 @@
   :head (
          (?/bp rdfs/subClassOf ?/go) ;interaction

+         (?/protein rdfs/subClassOf ?/bioentity)

          (?/hr1 rdf/type owl/Restriction)
          (?/hr1 owl/onProperty obo/RO_0000057) ; has_participant
-         (?/hr1 owl/someValuesFrom ?/bioentity)
+         (?/hr1 owl/someValuesFrom ?/protein)

          ;;make the interaction be necessarily part of these 3 restrictions
          ;;still need to add a sufficient definition
@@ -53,17 +54,18 @@

 `{:name "goa-cc"
   :head (
-          ;;(?/bioentity kiao/STANDIN_bio_go ?/go)
-
          (?/loc rdfs/subClassOf obo/GO_0051179) ;localization

+         (?/protein rdfs/subClassOf ?/bioentity)
+         (?/gocc rdfs/subClassOf ?go)
+
          (?/of1 rdf/type owl/Restriction)
          (?/of1 owl/onProperty obo/RO_0002313) ;transports or maintains localization of
-         (?/of1 owl/someValuesFrom ?/bioentity)
+         (?/of1 owl/someValuesFrom ?/protein)

          (?/to1 rdf/type owl/Restriction)
-         (?/to1 owl/onProperty obo/RO_0002344) ; results in transport to from or in
-         (?/to1 owl/someValuesFrom ?/go)
+         (?/to1 owl/onProperty obo/RO_0002339) ; has target end location
+         (?/to1 owl/someValuesFrom ?/gocc)

          ;;make the interaction be necessarily part of these 3 restrictions
          ;;still need to add a sufficient definition


using explicit threads

using explicit threads

--- src/fowles/fetcher.clj
+++ src/fowles/fetcher.clj
@@ -5,7 +5,7 @@
              ;; [com.keminglabs.zmq-async.core :refer [register-socket!]]
             [org.httpkit.client :as http]
             [clojure.core.async
-             :refer [chan go partition map< split >! <! take! alts!!]
+             :refer [chan go partition map< split >! <! take! alts! alts!!]
              :as async]))

 (def BASE_URI "https://www.googleapis.com/youtube/v3/videos")
@@ -22,7 +22,6 @@
   (->> (async/to-chan video-ids)
        (async/partition IDS_PER_QUERY)
        (async/map< #(uris/mk-video-uri api-key %))
-       ;; http://http-kit.org/client.html
        (async/map< http/get)))

 ;; Could also do this?
@@ -32,18 +31,30 @@
   [api-key video-ids]
   (mk-pipeline-chan api-key video-ids))

+;; Use 'send' w/ agent?
 (defn enq-responses
-  [out-ch n-times]
-  (let [in-ch (chan)]
-    (go (dotimes [_ n-times]
-          (async/>! in-ch (deref (async/<! out-ch)))))
-    in-ch))
+  [from-ch to-ch]
+  ;; Thread dedicated to gathering responses.
+  (.start (Thread.
+           #(loop []
+              ;; alts!! blocks until completed.
+              (let [[v c] (async/alts!! [from-ch])]
+                (if (nil? v)
+                  ;; (async/close! to-ch)
+                  nil
+                  (do
+                    (async/go (async/>! to-ch (deref v)))
+                    (recur))))))))

 (defn deq-responses
-  [out-ch n-times]
-  (dotimes [_ n-times]
-    (let [[v c] (async/alts!! [out-ch])]
-      (println v))))
+  [from-ch]
+  (.start (Thread. #(loop []
+                      (let [[v c] (async/alts!! [from-ch])]
+                        (if (nil? v)
+                          nil
+                          (do
+                            (println v)
+                            (recur))))))))

 (defn query-count [seq]
   (/ (count seq) IDS_PER_QUERY))
@@ -52,11 +63,10 @@
   (if-let [api-key (cfg/get-api-key)]
     (time
      (let [video-ids    ["7lCDEYXw3mM" "MjtOzLfebgY" "6QIw1BQIvT4" "2xJWQPdG7jE"]
-           n-times      (query-count video-ids)
-           promises-ch  (enq-fetches api-key video-ids)
-           responses-ch (enq-responses promises-ch n-times)]
-       (deq-responses responses-ch n-times)
-       (async/close! promises-ch)
-       (async/close! responses-ch)
+           promise-ch   (enq-fetches api-key video-ids)
+           response-ch  (chan)]
+       (enq-responses promise-ch response-ch)
+       (deq-responses response-ch)
+       (while true)
        ))))


destroy track locally

destroy track locally

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -291,4 +291,9 @@
           new-music-info  (vec (remove #(= track-id (.-id %1))
                                        (:music-info @app-state)))]
       (swap! app-state assoc :music-files new-music-files)
-      (swap! app-state assoc :music-info new-music-info))))
+      (swap! app-state assoc :music-info new-music-info)
+      (if (= track-id (:current-track-id @app-state))
+        (do
+          (player/destroy-track (:current-sound-id @app-state))
+          (swap! app-state assoc :current-track-id nil)
+          (swap! app-state assoc :current-sound-id nil))))))


implemented autoscroll

implemented autoscroll

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -34,8 +34,12 @@
   (reify
     om/IRender
     (render [this]
-      (apply dom/div nil
-        (om/build-all message-view (:messages data))))))
+      (apply dom/span nil
+        (om/build-all message-view (:messages data))))
+    om/IDidUpdate
+      (did-update [_ _ _]
+        (let [div (js/$ "#messages")]
+          (.scrollTop div (.prop div "scrollHeight"))))))

 (om/root users-list-view app-state {:target (. js/document (getElementById "userslist"))})
 (om/root messages-view app-state {:target (. js/document (getElementById "messages"))})


fix #439

fix #439

--- src/status_im/navigation/handlers.cljs
+++ src/status_im/navigation/handlers.cljs
@@ -74,7 +74,7 @@
     (-> db
         (assoc :prev-tab-view-id (:view-id db))
         (assoc :prev-view-id (:view-id db))
-        (replace-view view-id))))
+        (push-view view-id))))

 (register-handler :on-navigated-to-tab
   (enrich preload-data!)


turn off cacheinggit add src/aerobio/server.clj

--- src/aerobio/server.clj
+++ src/aerobio/server.clj
@@ -324,7 +324,7 @@
           reqtype (get-in reqmap [:headers "reqtype"])]
       (if (= reqtype "cmdline")
         (try
-          (let [_ (when (not (cmn/get-exp eid)) (cmn/set-exp eid))
+          (let [_ (cmn/set-exp eid)
                 exp (cmn/get-exp-info eid :exp)
                 work-item (if action action cmd)
                 tempnm (str (name exp) "-" work-item "-job-template")


Minor cleanup of make-repository.

Minor cleanup of make-repository.

--- src/leiningen/deps.clj
+++ src/leiningen/deps.clj
@@ -36,13 +36,13 @@
 (defn make-repository [[id settings]]
   (let [repo (RemoteRepository.)]
     (.setId repo id)
-    (cond
-     (string? settings) (.setUrl repo settings)
-     (map? settings) (do (.setUrl repo (:url settings))
-                         (let [server (doto (Server.)
-                                        (.setUsername (:username settings))
-                                        (.setPassword (:password settings)))]
-                           (.addAuthentication repo (Authentication. server)))))
+    (if (string? settings)
+      (.setUrl repo settings)
+      (let [{:keys [url username password]}]
+        (.setUrl repo url)
+        (.addAuthentication repo (Authentication. (doto (Server.)
+                                                    (.setUsername username)
+                                                    (.setPassword password))))))
     repo))

 (defn get-repository-list [project]


Promoted 'marked-newest-voom-ver-by-spec to 'newest-voom-ver-by-spec.

This required a change in box-repo-add to handle LongShas instead of
strings.

The leiningen.voom namespace is a wreck and needs some slamhound love.
For now I put a forward declaration for 'newest-voom-ver-by-spec.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -554,77 +554,7 @@
       (prn c))
     (throw (ex-info "Failed to find version for commit." {}))))

-(defn newest-voom-ver-by-spec
-  [proj-name {:keys [version repo branch path allow-snaps]
-              :or {version "" allow-snaps true}}]
-  (for [gitdir (all-repos-dirs)
-        :when (or (nil? repo) (= repo (-> (remotes gitdir) :origin :fetch)))
-        :let [ptn (s/join "--" ["voom"
-                                (str (namespace proj-name) "%" (name proj-name))
-                                (str version "*")])
-              tags (set (:lines (git {:gitdir gitdir} "tag" "--list" ptn)))
-              tspecs (if (= tags [""])
-                       []
-                       (map parse-tag tags))
-              paths (set (map :path tspecs))]
-        found-path paths
-        :when (or (= found-path path) (nil? path))
-        found-branch (origin-branches gitdir)
-        :when (or (= found-branch branch) (nil? branch))
-        :let [;; All the tags NOT accessible via this branch (we will exclude them):
-              not-not-tags (set (mapcat #(:refs (parse-sha-refs %))
-                                        (:lines (git {:gitdir gitdir} "log" "--pretty=format:%H,%cd,%p,%d" "--all"
-                                                     "--simplify-by-decoration" "-m" (str "^origin/" found-branch)))))
-              ;; yes-yes-tags are the matching tags reachable via this branch:
-              yes-yes-tags (set/difference tags not-not-tags)
-              tags-here (filter #(= found-path (:path (parse-tag %))) yes-yes-tags)]
-        ;; If this branch contains no matching tags, the
-        ;; project+version we're looking for must not be on this
-        ;; branch. Skip it.
-        :when (seq tags-here)
-        :let [tags-here-with-parents (remove #(.endsWith ^String % "--no-parent") tags-here)
-              neg-tags (map #(str "^" % "^@") tags-here-with-parents)
-              ;; All commits on the current branch more recent than
-              ;; (and including) the most recent tag matching our
-              ;; version spec:
-              commits
-              , (map
-                 parse-sha-refs
-                 (:lines (apply git {:gitdir gitdir} "log"
-                                "--pretty=format:%H,%cd,%p,%d" "--full-history" "--reverse"
-                                (concat neg-tags [(str "origin/" found-branch) "--" found-path]))))]
-        :when (seq commits)
-        :let [refs (-> commits first :refs)
-              reflist (filter #(and
-                                (= (str proj-name) (:proj %))
-                                (= found-path (:path %)))
-                              (map parse-tag refs))
-              ver (-> reflist first :version)
-              snaps (-> reflist first :snaps)]
-        :when (or allow-snaps (not snaps))]
-    (do
-      (assert-good-version ver proj-name version tags found-branch neg-tags commits)
-      ;; Walk forward through time, looking for when the next commit
-      ;; is one too far (meaning: we have no further commits to
-      ;; consider or the project at this path has changed version or
-      ;; project name):
-      (some (fn [[current next-commit]]
-              (when (or (= :end next-commit)
-                        ;; Find if any of the refs of this commit are
-                        ;; voom tags at the same path:
-                        (some #(let [t (parse-tag %)]
-                                 (and
-                                  (= "voom" (:prefix t))
-                                  (= found-path (:path t))))
-                              (:refs next-commit)))
-                {:sha (:sha current)
-                 :ctime (:ctime current)
-                 :version ver
-                 :path found-path
-                 :proj proj-name
-                 :gitdir gitdir
-                 :branch found-branch}))
-            (partition 2 1 (concat commits [:end]))))))
+(declare newest-voom-ver-by-spec)

 (defn print-repo-infos
   [repo-infos]
@@ -786,7 +716,8 @@
 (defn box-repo-add
   [{:keys [gitdir branch sha proj path]}]
   (if-let [bdir (find-box)]
-    (let [pname (-> (str proj)
+    (let [sha (str sha)
+          pname (-> (str proj)
                     (s/replace #"/" "--"))
           pdir (adj-path bdir pname)
           checkout (adj-path bdir task-dir pname)
@@ -1285,7 +1216,7 @@
   (when (seq xs)
     (reduce #(if (neg? (compare %1 %2)) %2 %1) xs)))

-(defn marked-newest-voom-ver-by-spec
+(defn newest-voom-ver-by-spec
 "
   proj dir change -> commit where a change happened in a subtree rooted with a project.clj
   - mark all project directory changes with project.clj version info
@@ -1353,83 +1284,6 @@
      :gitdir gitdir
      :branch found-branch}))

-
-;; ===== point filtering query =====
-
-#_
-(defn bm-newest-voom-ver-by-spec
-"
-- given a particular projname at a path and version criteria
-- for each branch separately
-- find stop points matching projname, path and version criteria (oldver matches, newver doesn't)
-- find start points matching projname, path and version criteria (newver matches, oldver don't care)
-- find project paths matching path
-- find stop points, parenter to branch
-- find start points, parenter to branch
-- find project paths, parenter to branch
-- find project paths, childer to some start point and not childer to any stop point
-- find project paths with no childer project paths
-"
-  [db shabam proj-name {:keys [version repo branch path allow-snaps]
-                     :or {version "" allow-snaps true}}]
-  (for [gitdir (all-repos-dirs)
-        :when (or (nil? repo) (= repo (-> (remotes gitdir) :origin :fetch)))
-        :let [ptn (s/join "--" ["voom"
-                                (str (namespace proj-name) "%" (name proj-name))
-                                (str version "*")])
-              tags (set (:lines (git {:gitdir gitdir} "tag" "--list" ptn)))
-              tspecs (if (= tags [""])
-                       []
-                       (map parse-tag tags))
-              paths (set (map :path tspecs))]
-        found-path paths
-        :when (or (= found-path path) (nil? path))
-        found-branch (origin-branches gitdir)
-        :when (or (= found-branch branch) (nil? branch))
-        :let [branch-sha (first (q db [?sha] (r-branch repo found-branch ?sha)))
-              not-matches-spec? (complement version-in-range?) ;; needed for l/pred
-              ver-stop-pts (->>
-                            (q db [?sha]
-                               (l/fresh [ver pver]
-                                        (r-proj ?sha found-path proj-name ver pver _)
-                                        (l/pred not-matches-spec? [version ver])
-                                        (l/pred version-in-range? [version pver])))
-                            (into #{}))
-              {:keys [snap-stop-pts all-start-pts]}
-              , (->>
-                 (q db [?sha ?snaps]
-                    (l/fresh [ver]
-                             (r-proj ?sha found-path proj-name ver _ ?snaps)
-                             (l/pred version-in-range? [version ver])))
-                 (group-by second)
-                 (map (fn [[k v]]
-                        [(get {true :snap-stop-pts} k :all-start-pts)
-                         v])))
-              all-stop-pts (into #{} (concat ver-stop-pts snap-stop-pts))
-              all-proj-pts (->>
-                            (q db [?sha] (r-commit-path ?sha found-path))
-                            (into #{}))
-              branch-stop-pts (sha-ancestors shabam branch-sha all-stop-pts)
-              branch-start-pts (sha-ancestors shabam branch-sha all-start-pts)
-              branch-proj-pts (sha-ancestors shabam branch-sha all-proj-pts)
-              ;; need to consider stops that are successor of each found start point
-              valid-proj-pts (filter #(and (< 0 (sha-successors shabam % branch-start-pts))
-                                           (= 0 (sha-successors shabam % branch-stop-pts)))
-                               branch-proj-pts)
-              ;; Do we find starting points if they are the most recent thing?...
-              latest-proj-pts (filter #(= 0 (sha-successors shabam % valid-proj-pts))
-                               valid-proj-pts)]
-        sha latest-proj-pts
-        :let [ctime (first (q db [ctime] (r-commit sha ctime _ _)))
-              ver (:version (robust-read-project gitdir sha found-path))]]
-    {:sha sha
-     :ctime ctime
-     :version ver
-     :path found-path
-     :proj proj-name
-     :gitdir gitdir
-     :branch found-branch}))
-
 (def subtasks [#'build-deps #'deploy #'find-box #'freshen #'install
                #'retag-all-repos #'update-repo-dbs #'ver-parse #'wrap])


removed erroneous character

removed erroneous character

--- src/aristotle/core.clj
+++ src/aristotle/core.clj
@@ -1,4 +1,4 @@
-j(ns aristotle.core
+(ns aristotle.core
   (:require [aristotle.config-loader :as config]
             [aristotle.server :as server]
             [aristotle.youtube-captions-downloader :as yt]


Add multiple fonts support

Add multiple fonts support

--- src/lt/objs/style.cljs
+++ src/lt/objs/style.cljs
@@ -12,7 +12,8 @@
             [lt.util.dom :as dom]
             [lt.util.load :as load]
             [crate.binding :refer [bound -value subatom]]
-            [crate.compiler :refer [dom-attr]])
+            [crate.compiler :refer [dom-attr]]
+            [clojure.string :as string])
   (:require-macros [lt.macros :refer [behavior defui]]))

 (defn css-expr [k v]
@@ -21,12 +22,17 @@
 (defn selector [sel & body]
   (str sel " { " (apply str body) " }"))

+(defn str-font-family [x]
+  (if (vector? x)
+    (string/join ", " (map pr-str x))
+    (pr-str x)))
+
 (defn ->css [settings]
   (selector ".CodeMirror"
             (when (:line-height settings)
               (css-expr :line-height (str (:line-height settings) "em")))
             (when (:font-family settings)
-              (css-expr :font-family (pr-str (:font-family settings))))
+              (css-expr :font-family (str-font-family (:font-family settings))))
             (when (:font-size settings)
               (css-expr :font-size (str (:font-size settings) "pt")))))


Max age cond clause uses wrong comparison direction

Switches from lt to gt so that the conditional evaluates to false when the difference between `:iat` and `now` is less than the max-age of the jws token.

--- src/buddy/sign/jws.clj
+++ src/buddy/sign/jws.clj
@@ -179,7 +179,7 @@
           (and (:nbf claims) (> now (:nbf claims)))
           (either/left (format "Token is older than :nbf (%s)" (:nbf claims)))

-          (and (:iat claims) (number? max-age) (< (- now (:iat claims)) max-age))
+          (and (:iat claims) (number? max-age) (> (- now (:iat claims)) max-age))
           (either/left (format "Token is older than max-age (%s)" max-age))

           :else


Add validate-no-missing-ids to v5 pipeline

--- src/vip/data_processor/validation/v5.clj
+++ src/vip/data_processor/validation/v5.clj
@@ -4,4 +4,5 @@

 (def validations
   [email/validate-emails
-   id/validate-unique-ids])
+   id/validate-unique-ids
+   id/validate-no-missing-ids])


Clean up aleph routing test sync

Clean up aleph routing test sync

Use core.async to make sure server knows what to expect from client. It
isn't pretty, but it's better than previous commit.

--- test/com/frereth/common/aleph_test.clj
+++ test/com/frereth/common/aleph_test.clj
@@ -1,7 +1,8 @@
 (ns com.frereth.common.aleph-test
   (:require [clojure.edn :as edn]
             [clojure.test :refer (deftest is testing)]
-            [com.frereth.common.aleph :as aleph]))
+            [com.frereth.common.aleph :as aleph]
+            [clojure.core.async :as async]))

 (deftest count-messages
   (testing "Count minimalist requests/responses"
@@ -34,29 +35,25 @@
     (let [connections (atom {})
           port 12081
           expected-message (atom nil)
+          sync-ch (async/chan)
           handler (fn [msg]
                     (println "Handler received" msg
                              "expected:" @expected-message)
-                    (is (= msg @expected-message)))
+                    (is (= msg @expected-message))
+                    (async/>!! sync-ch ::next))
           server (aleph/start-server!
                   (aleph/router connections handler)
                   port)]
       (try
         (let [client (aleph/start-client! "localhost" port)]
           (testing "Receiving"
-            (comment) (doseq [n (range 10)]
-                        (let [msg {:payload n}]
-                          (reset! expected-message msg)
-                          (aleph/put! client msg))
-                        ;; Really need a good way to synchronize
-                        ;; the message send, the put!, and the take!
-                        ;; from the handler.
-                        ;; Arbitrary delays are one thing, that
-                        ;; seem to be showing that this approach
-                        ;; seems really slow.
-                        ;; But they aren't portable/sustainable.
-                        (Thread/sleep 30)))
-          (Thread/sleep 100)
+            (doseq [n (range 10)]
+              (let [msg {:payload n}]
+                (reset! expected-message msg)
+                (aleph/put! client msg)
+                (let [[_ ch] (async/alts!! [(async/timeout 500)
+                                            sync-ch])]
+                  (is (= ch sync-ch))))))
           ;; This really isn't very interesting with just 1 client
           ;; But it was finicky
           (testing "Sending"


TODO note.

TODO note.

--- src/cbfg/world/t2.cljs
+++ src/cbfg/world/t2.cljs
@@ -21,6 +21,7 @@
 (defn make-coll [actx rev path kvs-mgr-ch]
   (let [coll-ch (achan actx)]
     (act coll-init actx
+         ; TODO: Have a kvs per shard instead of per coll.
          (let [res (areq coll-init kvs-mgr-ch {:op :kvs-open :name [path rev]})]
            (if (= (:status res) :ok)
              (state-loop actx [:coll path rev] coll-handler


enforce unique email

enforce unique email

--- src/chat/server/db.clj
+++ src/chat/server/db.clj
@@ -29,6 +29,7 @@
       {:db/ident :user/email
        :db/valueType :db.type/string
        :db/cardinality :db.cardinality/one
+       :db/unique :db.unique/identity
        :db/id #db/id [:db.part/db]
        :db.install/_attribute :db.part/db}
       {:db/ident :user/password-token


Make ssh logging less verbose

Make ssh logging less verbose

--- src/circle/logging.clj
+++ src/circle/logging.clj
@@ -40,7 +40,10 @@
   (set-level "org.mortbay.log" Level/INFO)

   (set-level "org.apache.http.wire" Level/OFF)
-  (set-level "org.apache.http.headers" Level/OFF))
+  (set-level "org.apache.http.headers" Level/OFF)
+
+  (set-level "clj-ssh.ssh" Level/WARN))
+

 (defn add-file-appender [loggername filename]


stop Caissa from revealing unrezzed ice

stop Caissa from revealing unrezzed ice

Saw a report in chat tonight that Caissa are revealing the names of unrezzed ice. Added in a check used on cards like Psychographics, et al.

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -209,11 +209,12 @@
     :effect (effect (card-init target))}

    "Bishop"
-   {:abilities [{:label "Host Bishop on a piece ICE" :cost [:click 1]
+   {:abilities [{:label "Host Bishop on a piece of ICE" :cost [:click 1]
                  :choices {:req #(and (= (:type %) "ICE")
                                       (= (last (:zone %)) :ices)
                                       (not (some (fn [c] (has? c :subtype "Caïssa")) (:hosted %))))}
-                 :msg (msg "host it on " (:title target)) :effect (effect (host target card))}]
+                 :msg (msg "host it on " (if (:rezzed target) (:title target) "a piece of ICE"))
+                 :effect (effect (host target card))}]
     :events {:pre-ice-strength
              {:req (req (and (= (:cid target) (:cid (:host card))) (:rezzed target)))
               :effect (effect (ice-strength-bonus -2))}}}
@@ -1585,11 +1586,12 @@
    {:recurring 2}

    "Pawn"
-   {:abilities [{:label "Host Pawn on a piece ICE" :cost [:click 1]
+   {:abilities [{:label "Host Pawn on a piece of ICE" :cost [:click 1]
                  :choices {:req #(and (= (:type %) "ICE")
                                       (= (last (:zone %)) :ices)
                                       (not (some (fn [c] (has? c :subtype "Caïssa")) (:hosted %))))}
-                 :msg (msg "host it on " (:title target)) :effect (effect (host target card))}]}
+                 :msg (msg "host it on " (if (:rezzed target) (:title target) "a piece of ICE"))
+                 :effect (effect (host target card))}]}

    "Paywall Implementation"
    {:events {:successful-run {:msg "gain 1 [Credits]" :effect (effect (gain :corp :credit 1))}}}
@@ -1894,11 +1896,12 @@
                  :msg "do 3 net damage" :effect (effect (damage :net 3 {:card card}) (trash card))}]}

    "Rook"
-   {:abilities [{:label "Host Rook on a piece ICE" :cost [:click 1]
+   {:abilities [{:label "Host Rook on a piece of ICE" :cost [:click 1]
                  :choices {:req #(and (= (:type %) "ICE")
                                       (= (last (:zone %)) :ices)
                                       (not (some (fn [c] (has? c :subtype "Caïssa")) (:hosted %))))}
-                 :msg (msg "host it on " (:title target)) :effect (effect (host target card))}]
+                 :msg (msg "host it on " (if (:rezzed target) (:title target) "a piece of ICE"))
+                 :effect (effect (host target card))}]
     :events {:pre-rez {:req (req (= (:zone (:host card)) (:zone target)))
                        :effect (effect (rez-cost-bonus 2))}}}

@@ -2697,12 +2700,13 @@
                  :effect (effect (pump card 1 true))}]}

    "Knight"
-   {:abilities [{:label "Host Knight on a piece ICE" :cost [:click 1]
+   {:abilities [{:label "Host Knight on a piece of ICE" :cost [:click 1]
                  :choices {:req #(and (= (:type %) "ICE")
                                       (= (last (:zone %)) :ices)
                                       (not (some (fn [c] (has? c :subtype "Caïssa")) (:hosted %))))}
-                 :msg (msg "host it on " (:title target)) :effect (effect (host target card))}
-                {:cost [:credit 2] :msg "break 1 subroutine on the hosted ICE"}]}
+                 :msg (msg "host it on " (if (:rezzed target) (:title target) "a piece of ICE"))
+                 :effect (effect (host target card))}
+                {:cost [:credit 2] :msg "break 1 subroutine on the host ICE"}]}

    "Leviathan"
    {:abilities [{:cost [:credit 3] :msg "break up to 3 code gate subroutines"}


Fix for Leela.

Fix for Leela.

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -1200,7 +1200,9 @@
    {:events {:agenda-scored {:choices {:req #(not (:rezzed %))} :msg "add 1 unrezzed card to HQ"
                              :player :runner :effect (effect (move :corp target :hand))}
              :agenda-stolen {:choices {:req #(not (:rezzed %))} :msg "add 1 unrezzed card to HQ"
-                             :effect (effect (move :corp target :hand))}}}
+                             :effect (req (move state :corp target :hand)
+                                          (swap! state update-in [:runner :prompt] rest)
+                                          (handle-end-run state side))}}}

    "Legwork"
    {:effect (effect (run :hq) (access-bonus 2))}


one more thing

one more thing

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
@@ -106,12 +106,9 @@
           :columns [{:header "Name" :starting-width 200 :filter-by #(% "name") :sort-by #(% "name")
                      :content-renderer
                      (fn [row-index conf]
-                       [:a
-                        {:onClick
-                         (fn []
-                           (on-config-selected conf))
-                         :href "javascript:;"
-                         :style {:color (:button-blue style/colors) :textDecoration "none"}}
+                       [:a {:href "javascript:;"
+                            :onClick #(on-config-selected conf)
+                            :style {:color (:button-blue style/colors) :textDecoration "none"}}
                         (conf "name")])}
                     {:header "Namespace" :starting-width 200 :sort-by :value}
                     {:header "Snapshot Id" :starting-width 100 :sort-by :value}


made the "Add Imports" buttonw cause the window to go away tidied up some comments and whitespace

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
@@ -7,7 +7,6 @@
     [org.broadinstitute.firecloud-ui.common :as common]
     [org.broadinstitute.firecloud-ui.common.table :as table]
     [org.broadinstitute.firecloud-ui.common.style :as style]))
-

 (defn- create-mock-methodconfs []
@@ -38,10 +37,9 @@
     (str k "," (get the_map k) " ; ")))

-
 (react/defc ImportWorkspaceMethodsConfigurationsList
   {:render
-   (fn [{:keys [props refs state]}]
+   (fn [{:keys [props]}]
      [:div {}
       (if (zero? (count (:method-confs props)))
         [:div {:style {:textAlign "center" :backgroundColor (:background-gray style/colors)
@@ -56,20 +54,13 @@
                cell (fn [children] [:span {:style {:paddingLeft 16}} children])]
            {:columns [{:header-component [:div {:style {:padding "13px 0 12px 12px"
                                                         :backgroundColor (:header-darkgray style/colors)}}
-                                          [:input {:type "checkbox" :ref "allcheck"}]
+                                          [:input {:type "checkbox" :ref "imcallcheck"}]
                                           ]
                        :starting-width 42 :resizable? false
                        :cell-renderer (fn [row-num conf]
                                     [:div
                                       {:style {:paddingLeft 12}} [:input {
-                                         :type "checkbox" :id (str "import_mc_checkbox_" row-num )
-                                                          :onClick (fn [e] (let [
-                                                            check_box_id_str (str "import_mc_checkbox_" row-num )
-                                                            clicked_checkbox_element (.getElementById js/document (name check_box_id_str))
-                                                            checked_status (.-checked clicked_checkbox_element)]
-                                                            nil
-                                                            ;TODO something here that modifies the "Import Selected Workspaces" button
-                                                            ))}]])}
+                                         :type "checkbox" :ref (str "imc_" row-num)}]])}
                       {:header-component (header "Name") :starting-width 200
                        :cell-renderer (fn [row-num conf]
                                         (cell [:a {:href "javascript:;"
@@ -110,23 +101,20 @@
    :position "fixed" :zIndex 9999
    :top 0 :right 0 :bottom 0 :left 0})

+
 (def ^:private modal-import-content
   {
-   ;:transform "translate(-50%, 0px)" ORIGINAL
-   :transform "translate(-50%,0px)"
+   :transform "translate(-50%, 0px)"
    :backgroundColor (:background-gray style/colors)
    :position "relative" :marginBottom 60
    :top 60
-   ;:left "50%"  ORIGINAL
    :left "50%"
-   ;:width 500 ORIGINAL
    :width "75%"
    })

-(defn- render-import-overlay [state refs]
+(defn- render-import-overlay [state]
   (let [clear-import-overlay (fn []
-      (common/clear! refs "wsName" "wsDesc" "shareWith")
       (swap! state assoc :import-overlay-shown? false))]
     [:div {
       :style (modal-import-background state)
@@ -144,18 +132,15 @@
         [ImportWorkspaceMethodsConfigurationsList {:method-confs (utils/parse-json-string
                                                                   (utils/->json-string
                                                                     (create-mock-methodconfs)))}]]
-        [comps/Button {:style :add   :text "Add selected to workspace" :onClick
-                        ;TODO
-                        ; 1) acquire list of selected confs and
-                        ; 2) use orch API (post) to copy them to the workspace
-                       (fn [] nil)}]]]]))
+        [comps/Button {:style :add   :text "Add selected to workspace"
+                       :onClick #(swap! state assoc :import-overlay-shown? false)}]]]]))

 (react/defc WorkspaceMethodsConfigurationsList
   {:render
    (fn [{:keys [props refs state]}]
      [:div {}
-      (render-import-overlay state refs)
+      (render-import-overlay state)
       [comps/Button {:text "Import Configurations ..."
                      :onClick #(swap! state assoc :import-overlay-shown? true)}]
       (if (zero? (count (:method-confs props)))


Unmap automatic multihash constructor.

Unmap automatic multihash constructor.

--- src/multihash/core.clj
+++ src/multihash/core.clj
@@ -153,7 +153,8 @@
     (Multihash. code digest m)))

-; TODO: unset ->Multihash
+;; Remove automatic constructor function.
+(ns-unmap *ns* '->Multihash)

 (defn create


Test that the value remains unchanged when there's an error.

--- test/klangmeister/test/processing.cljs
+++ test/klangmeister/test/processing.cljs
@@ -26,4 +26,10 @@
        {:foo {:value [{:time 0 :pitch 69 :duration 1}] :text "(phrase [1] [69])" :error nil}}))
     (is
       ((comp :error :foo)
-       (framework/process (action/->Refresh "(phrase [1] [6" :foo) ignore! {})))))
+       (framework/process (action/->Refresh "(phrase [1] [6" :foo) ignore! {})))
+    (is
+      (=
+       (-> (framework/process (action/->Refresh "(phrase [1] [6" :foo) ignore! {:foo {:value [{:time 0 :pitch 69 :duration 1}]}})
+           :foo
+           :value)
+       [{:time 0 :pitch 69 :duration 1}]))))


Added support for PATCH method

Added support for PATCH method

--- src/compojure/core.clj
+++ src/compojure/core.clj
@@ -141,6 +141,10 @@
   [path args & body]
   (compile-route :options path args body))

+(defmacro PATCH "Generate a PATCH route."
+  [path args & body]
+  (compile-route :patch path args body))
+
 (defmacro ANY "Generate a route that matches any method."
   [path args & body]
   (compile-route nil path args body))


Minor fix: virtual streams when exporting list

--- src/photon/streams.clj
+++ src/photon/streams.clj
@@ -144,8 +144,8 @@
     {:streams
      (let [active-streams (get @active-streams this)]
        (map #(hash-map :stream %)
-            (conj (:real-streams active-streams)
-                  (:virtual-streams active-streams))))})
+            (concat (:real-streams active-streams)
+                    (:virtual-streams active-streams))))})
   ColdStream
   (clean! [this] (db/delete-all! db))
   (data-from [this stream-name date-string]


Make compatible to react 15

Make compatible to react 15

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -115,7 +115,7 @@
 (defn items-view [data]
   (dom/div nil
            (apply dom/ul #js {:id (lib/prefix-name "items-main")}
-                  (om/build-all item-view (:items data)))))
+                  (map #(om/build item-view (lib/merge-react-key %)) (:items data)))))

 (defn discussion-elements [data]
   (dom/div nil


Switch back on the timer

Switch back on the timer

--- app/pyrexia/src/pyrexia/core.cljs
+++ app/pyrexia/src/pyrexia/core.cljs
@@ -65,8 +65,7 @@
       (fetch-events)
       (. timer (start))
       (swap! c/app-state assoc :timer timer)
-      ;(events/listen timer goog.Timer/TICK fetch-events)
-)))
+      (events/listen timer goog.Timer/TICK fetch-events))))

 (if (-> (:timer @c/app-state) nil? not)
   (.stop (:timer @c/app-state)))


Deletes comment

Deletes comment

--- src/expound/alpha.cljc
+++ src/expound/alpha.cljc
@@ -535,21 +535,3 @@
           (section-label)
           (count grouped-problems)
           (if (= 1 (count grouped-problems)) "error" "errors")))))))
-
-(comment
-  (require '[clojure.spec.alpha :as s])
-  (require '[expound.alpha :as expound])
-
-  (s/def :example.place/city string?)
-  (s/def :example.place/state string?)
-  (s/def :example/place (s/keys :req-un [:example.place/city :example.place/state]))
-
-  (println (s/explain-str :example/place {}))
-  ;; val: {} fails spec: :example/place predicate: (contains? % :city)
-  ;; val: {} fails spec: :example/place predicate: (contains? % :state)
-  ;; :clojure.spec.alpha/spec  :example/place
-  ;; :clojure.spec.alpha/value  {}
-
-  (println (expound/expound :example/place {}))
-
-  )


LocalStore opens up a can of worms around dependencies (transit, reader, etc).  Remove for the moment.

--- src/re_frame/cofx.cljc
+++ src/re_frame/cofx.cljc
@@ -65,12 +65,6 @@
 ;; Because this interceptor is used so much, we reify it
 (def inject-db (inject-cofx :db))

-(register
-  :local-store
-  (fn local-store-handler
-    [coeffects k]
-    ()XXXX
-    (assoc coeffects :db @app-db)))

 ;; -- Further Example  --------------------------------------------------------


Correct spelling.

Correct spelling.

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -45,9 +45,9 @@

 ;; --  subscriptions
 (defn reg-sub-raw
-  "Associate a `query id` with a given subscription handler fucntion `handler-fn`
+  "Associate a given `query id` with a given subscription handler fucntion `handler-fn`
    which is expected to take two arguments: app-db and query vector, and return
-   a `recation`.
+   a `reaction`.

   This is a low level, advanced function.  You should probably be using re-sub
   instead."


Indentation and privacy fixes suggested by @aphyr

--- src/riemann/keenio.clj
+++ src/riemann/keenio.clj
@@ -6,12 +6,12 @@
 (def ^:private event-url
   "https://api.keen.io/3.0/projects/")

-(defn- post
+(defn post
   "POST to Keen IO."
   [collection project-id write-key request]

   (let [final-event-url
-    (str event-url project-id "/events/" collection)]
+       (str event-url project-id "/events/" collection)]

   (client/post final-event-url
                {:body (json/generate-string request)
@@ -27,10 +27,10 @@
   returns a function that accepts an event and sends it to Keen IO. The full
   event will be sent.

-(streams
-  (let [kio (keenio \"COLLECTION_NAME\" \"PROJECT_ID\" \"WRITE_KEY\")]
-    (where (state \"error\") kio)))"
+  (streams
+    (let [kio (keenio \"COLLECTION_NAME\" \"PROJECT_ID\" \"WRITE_KEY\")]
+      (where (state \"error\") kio)))"

-  [collection project-id, write-key]
+  [collection project-id write-key]
   (fn [event]
     (post collection project-id write-key event)))


fixed download bug

fixed download bug

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -34,6 +34,7 @@
     (.emit socket "chat-message" room-id (.val (js/$ "#m")))
     (.val (js/$ "#m") "")
     false))
+
 (defn upload-file [file]
   (let [stream (.createStream js/ss)
         blob-stream (.createBlobReadStream js/ss file)]
@@ -220,7 +221,8 @@
         (swap! app-state assoc :is-file-downloading? false)
         (swap! app-state assoc :download-progress nil)
         (swap! app-state assoc :data-downloaded 0)
-        (request-new-track)
+        (if-not (:is-file-downloading? @app-state)
+          (request-new-track))
         (if (= (:current-track-id @app-state) track-id)
           (.emit socket "ready-to-start"))))))


Can tap to zoom in

Can tap to zoom in

--- src/graphito/core.cljs
+++ src/graphito/core.cljs
@@ -242,9 +242,9 @@

 (defn zoom-in-to-pos! [current-state pos animation-signaller]
   (swap-state-animated! animation-signaller
-                          current-state assoc
-                          :projection :fisheye
-                          :camera-pos pos))
+                        current-state assoc
+                        :projection :fisheye
+                        :camera-pos pos))

 ;; Layout

@@ -388,6 +388,7 @@
         (.recognizeWith (.get manager "pan")))
     (-> manager (.add (js/Hammer.Pinch.))
         (.recognizeWith (.get manager "pan")))
+    (-> manager (.add (js/Hammer.Tap.)))
     manager))

 (defn gesture-observable [manager svg gesture]
@@ -481,6 +482,26 @@
       #(if (= (:projection @current-state) :zoom-out)
          (zoom-in-to-pos! current-state
                           (zoom-out->world-pos @current-state (:center %))
+                          animation-signaller)))))
+
+;; Gestures - tap
+
+(defn tap-observable
+  "Stream of locations as math vectors."
+  [manager svg]
+  (.map (gesture-observable manager svg "tap")
+        (fn [e] (math-vec (-> e .-center .-x) (-> e .-center .-y)))))
+
+(defn zoom-in-on-tap! [manager
+                       current-state
+                       animation-observable
+                       animation-signaller]
+  (let [taps (tap-observable manager (:svg @current-state))]
+    (.subscribe
+      taps
+      #(if (= (:projection @current-state) :zoom-out)
+         (zoom-in-to-pos! current-state
+                          (zoom-out->world-pos @current-state %)
                           animation-signaller)))))

 ;; Exported function to do magic
@@ -505,4 +526,6 @@
     (switch-zoom-on-spacebar!
       current-state animation-observable animation-signaller)
     (zoom-on-pinch!
+      gesture-manager current-state animation-observable animation-signaller)
+    (zoom-in-on-tap!
       gesture-manager current-state animation-observable animation-signaller)))


fixing version typo

fixing version typo

--- src/speclj/version.clj
+++ src/speclj/version.clj
@@ -4,7 +4,7 @@

 (def major 1)
 (def minor 5)
-(def tiny 2git)
+(def tiny 2)
 (def snapshot false)
 (def string
   (str


do not convert numbers to zone offset implicitly

--- src/java_time/zone.clj
+++ src/java_time/zone.clj
@@ -35,11 +35,6 @@
   (fn [^CharSequence s, ^ZoneOffset zo]
     (ZoneId/ofOffset s zo)))

-(conversion! Number ZoneOffset
-  (fn [n]
-    (let [[h m s] (to-hms n)]
-      (ZoneOffset/ofHoursMinutesSeconds h m s))))
-
 (defn- ^ZoneOffset clock->zone-offset [^Clock c]
   (-> (.getZone c)
       (.getRules)
@@ -68,7 +63,10 @@

              (number? o)
              (let [[h m s] (to-hms o)]
-               (zone-offset h m s))))
+               (zone-offset h m s))
+
+             :else (throw (java.time.DateTimeException.
+                            (format "Could not convert %s to a ZoneOffset!" o)))))
   ([h m] (ZoneOffset/ofHoursMinutes h m))
   ([h m s] (ZoneOffset/ofHoursMinutesSeconds h m s)))


Fix redundant 'into and add missing 'into/'concat in 'git-trees.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1015,8 +1015,10 @@

 (defn git-trees
   [gitdir tree-shas]
-  (for [s tree-shas]
-    {s (into {} (git-tree gitdir s))}))
+  (into {}
+        (concat
+         (for [s tree-shas]
+           {s (git-tree gitdir s)}))))

 (defprotocol Sha
   (get-byte-array [_])


fix(ccw.api.repl): changed default values for 'send optional values

--- ccw.core/src/clj/ccw/api/repl.clj
+++ ccw.core/src/clj/ccw/api/repl.clj
@@ -10,16 +10,18 @@
    add-to-history:   truthy if the expression should be added to the history of
                      sent repl commands (defaults to false)
    print-to-log:     truthy if the expression should be logged in the log area
-                     of the repl (defaults to false)
+                     of the repl (defaults to true)
    repeat-last-eval: truthy if the preferences for repeating the last
                      user sent expression should be honored (defaults to false)"
-  ([repl expr] (send repl expr false false false))
+  ([repl expr] (send repl expr false true false))
   ([repl expr add-to-history print-to-log repeat-last-eval]
+    (println "repl:" repl "expr:" expr)
     (when (and repl expr)
       (.evalExpression repl expr
         (boolean add-to-history)
         (boolean print-to-log)
-        (boolean repeat-last-eval)))))
+        (boolean repeat-last-eval)))
+    (println "done sending")))

 (defn namespace
   "Get the current namespace for the repl connection"