Checkpoint

Checkpoint

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

--- src/obcc/build/interface.clj
+++ src/obcc/build/interface.clj
@@ -20,8 +20,9 @@
 ;; aggregate all of the interfaces declared in the config, adding the implicit
 ;; "project.cci"
 (defn getinterfaces [config]
-  (let [keys [[:configuration :provides] [:configuration :consumes]]]
-        (->> (map #(config/find % config) keys) flatten (into #{}) (cons "project") (remove nil?) (into '()))))
+  (let [keys [[:configuration :provides] [:configuration :consumes]]
+        explicit (map #(config/find % config) keys)]
+    (->> explicit flatten (into #{}) (cons "project") (remove nil?) (into '()))))

 (defn open [path intf]
   (let [file (io/file path (str intf ".cci"))]
@@ -59,7 +60,7 @@

 (defn compile [path config]

-  (let [interfaces (compileall path config)
+  (let [asts (compileall path config)
         protopath (io/file path "build/proto/project.proto")]

     ;; ensure the path exists


Group by activity: run/bike/swim

Group by activity: run/bike/swim

--- src/strava_activity_graphs/core.clj
+++ src/strava_activity_graphs/core.clj
@@ -20,7 +20,11 @@

 (defn- ts-plot [x y & options]
   (doto
-    (apply time-series-plot* x y :points true options #_(conj :points true options))
+    (apply time-series-plot*
+           x y
+           :points true
+           :legend true
+           options)
     (set-point-size 4)
     (set-stroke-color java.awt.Color/GRAY)
     (set-alpha 0.8)
@@ -43,30 +47,36 @@
       (ts-plot
         (to-millis ($ :start_date_local))
         ($ :average_speed)
+        :group-by ($ :type)
         :title "Average speed over time"
         :x-label "time"
         :y-label "average speed (m/s)")
       (ts-plot
         (to-millis ($ :start_date_local))
         ($ :average_speed)
+        :group-by ($ :type)
         :title "Average speed over time"
         :x-label "time"
         :y-label "average speed (m/s)")
       (ts-plot
         (to-millis ($ :start_date_local))
         ($ :kudos_count)
+        :group-by ($ :type)
         :title "Activity kudos over time"
         :x-label "time"
         :y-label "kudos")
       (ts-plot
         (to-millis ($ :start_date_local))
         ($ :pr_count)
+        :group-by ($ :type)
         :title "Personal records over time"
         :x-label "time"
         :y-label "personal records")
       (ts-plot
         (to-millis ($ :start_date_local))
         ($ :elapsed_time)
+        :group-by ($ :type)
         :title "Activity duration over time"
         :x-label "time"
-        :y-label "activity's elapsed time (s)"))))+        :y-label "activity's elapsed time (s)"))
+    ))


Apparently CI already has ZK installed.

Apparently CI already has ZK installed.

--- test/onyx/plugin/input_test.clj
+++ test/onyx/plugin/input_test.clj
@@ -10,13 +10,13 @@
 (def id (java.util.UUID/randomUUID))

 (def env-config
-  {:zookeeper/address "127.0.0.1:2181"
+  {:zookeeper/address "127.0.0.1:2188"
    :zookeeper/server? true
-   :zookeeper.server/port 2181
+   :zookeeper.server/port 2188
    :onyx/id id})

 (def peer-config
-  {:zookeeper/address "127.0.0.1:2181"
+  {:zookeeper/address "127.0.0.1:2188"
    :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
    :onyx.messaging/impl :aeron
    :onyx.messaging/peer-port-range [40200 40400]


Fix typo.

Fix typo.

--- src/cli4clj/example.clj
+++ src/cli4clj/example.clj
@@ -48,7 +48,7 @@
                                   :long-info "The first argument will be divided by the second argument."}
                          :d :divide
 ;;;                      "h" is already a pre-defined command but it can be overridden.
-;;;                      This is shown by using the definition of an alias for test as example.
+;;;                      This is shown by using the definition of an alias to test as example.
                          :h :test
 ;;;                      The pre-defined "help" command, however, cannot be overridden.
 ;;;                      Please note that "help" and "exit" cannot be overridden by any user defined command.


optimize lazy seq -seq implementation

optimize lazy seq -seq implementation

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2014,7 +2014,11 @@
   (-hash [coll] (caching-hash coll hash-coll __hash))

   ISeqable
-  (-seq [coll] (seq (lazy-seq-value coll))))
+  (-seq [coll]
+    (lazy-seq-value coll)
+    (if-not (nil? x)
+      coll
+      ())))

 (declare ArrayChunk)


* src/cljs/cljs/core.cljs: remove truth tests from TransientVector

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2876,7 +2876,7 @@
                           ^:mutable tail]
   ITransientCollection
   (-conj! [tcoll o]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       (if (< (- cnt (tail-off tcoll)) 32)
         (do (aset tail (bit-and cnt 0x01f) o)
             (set! cnt (inc cnt))
@@ -2902,7 +2902,7 @@
       (throw (js/Error. "conj! after persistent!"))))

   (-persistent! [tcoll]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       (do (set! (.-edit root) nil)
           (let [len (- cnt (tail-off tcoll))
                 trimmed-tail (make-array len)]
@@ -2915,7 +2915,7 @@

   ITransientVector
   (-assoc-n! [tcoll n val]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       (cond
         (and (<= 0 n) (< n cnt))
         (if (<= (tail-off tcoll) n)
@@ -2943,7 +2943,7 @@
       (throw (js/Error. "assoc! after persistent!"))))

   (-pop! [tcoll]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       (cond
         (zero? cnt) (throw (js/Error. "Can't pop empty vector"))
         (== 1 cnt)                       (do (set! cnt 0) tcoll)
@@ -2969,13 +2969,13 @@

   ICounted
   (-count [coll]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       cnt
       (throw (js/Error. "count after persistent!"))))

   IIndexed
   (-nth [coll n]
-    (if (.-edit root)
+    (if ^boolean (.-edit root)
       (aget (array-for coll n) (bit-and n 0x01f))
       (throw (js/Error. "nth after persistent!"))))


Have cljs.core/compare throw on type mismatch, special-case nil as smallest

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -792,8 +792,14 @@
 (defn compare
   "Comparator. Returns a negative number, zero, or a positive number
   when x is logically 'less than', 'equal to', or 'greater than'
-  y. Uses google.array.defaultCompare."
-  [x y] (garray/defaultCompare x y))
+  y. Uses google.array.defaultCompare for objects of the same type
+  and special-cases nil to be less than any other object."
+  [x y]
+  (cond
+    (identical? (type x) (type y)) (garray/defaultCompare x y)
+    (nil? x) -1
+    (nil? y) 1
+    :else (throw (js/Error. "compare on non-nil objects of different types"))))

 (defn ^:private fn->comparator
   "Given a fn that might be boolean valued or a comparator,


range readability, remove extra -count predicate

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2356,7 +2356,7 @@
   (-first [rng] start)

   (-rest [rng]
-    (if-not (nil? (-seq rng))
+    (if (-seq rng)
       (Range. meta (+ start step) end step)
       (list)))

@@ -2375,9 +2375,9 @@

   ICounted
   (-count [rng]
-    (cond (nil? (-seq rng)) 0
-          (and (= start 0) (< start end) (= step 1)) (- end start)
-          :else (js/Math.ceil (/ (- end start) step))))
+    (if-not (-seq rng)
+      0
+      (js/Math.ceil (/ (- end start) step))))

   IIndexed
   (-nth [rng n]
@@ -2396,7 +2396,7 @@
   ISeqable
   (-seq [rng]
     (let [comp (if (pos? step) < >)]
-      (if (comp start end)
+      (when (comp start end)
         rng)))

   IReduce


cookie endpoints

cookie endpoints

--- src/cljsbin/routes.cljs
+++ src/cljsbin/routes.cljs
@@ -107,11 +107,37 @@
         response (assoc response :body (:headers response))]
     (res response)))

+(defn flatten-cookies
+  "Flatten the {:value} structure in the cookies."
+  [cookies]
+  (into {} (map (fn [[k v]] [k (:value v)]) cookies)))
+
 (def cookies "Return cookie data."
-  (json-handler (fn [req]
-                  (let [flat-cookie (fn [[k v]] [k (:value v)])
-                        flattened (into {} (map flat-cookie (:cookies req)))]
-                    {:cookies flattened}))))
+  (json-handler (fn [req] {:cookies (flatten-cookies (:cookies req))})))
+
+;; TODO should use json-handler once its apdated
+(defn set-cookies
+  "Sets one or more simple cookies."
+  [req res raise]
+  (let [cookie-map (into {} (map (fn [[k value]] [k {:value value}])
+                                 (:query-params req)))]
+    (-> {:cookies (flatten-cookies (merge (:cookies req) cookie-map))}
+        (r/ok)
+        (r/content-type "application/json")
+        (assoc :cookies cookie-map)
+        (res))))
+
+;; TODO should use json-handler once its apdated
+(defn delete-cookies
+  "Deletes one or more simple cookies."
+  [req res raise]
+  (let [remove-map (zipmap (keys (:query-params req)) (repeat {:value nil}))
+        remaining (apply dissoc (:cookies req) (keys remove-map))]
+    (-> {:cookies (flatten-cookies remaining)}
+        (r/ok)
+        (r/content-type "application/json")
+        (assoc :cookies remove-map)
+        (res))))

 (defn delay_
   "Delays responding for min(n, 10) seconds."
@@ -134,7 +160,9 @@
        ["/status/" :status] {:get status}
        ["/delay/" :n] {:get delay_}
        "/response-headers" {:get response-headers}
-       "/cookies" {:get cookies}}])
+       "/cookies" {:get cookies}
+       "/cookies/set" {:get set-cookies}
+       "/cookies/delete" {:get delete-cookies}}])

 (defn router [req res raise]
   (if-let [{:keys [handler route-params]} (bidi/match-route* routes (:uri req) req)]


Fix mlet docstring

Fix mlet docstring

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -187,16 +187,20 @@
             (bind (just (inc a))
                   (fn [b]
                     (return (* b 2))))))
+    ;=> #<Just [4]>

   Now see how this code can be more clear if you
   are using mlet macro for do it:

     (mlet [a (just 1)
-           b (just (inc b))]
+           b (just (inc a))]
       (return (* b 2)))
+    ;=> #<Just [4]>
   "
   [bindings & body]
-  (when-not (and (vector? bindings) (even? (count bindings)))
+  (when-not (and (vector? bindings)
+                 (not-empty bindings)
+                 (even? (count bindings)))
     (throw (IllegalArgumentException. "bindings has to be a vector with even number of elements.")))
   (->> (reverse (partition 2 bindings))
        (reduce (fn [acc [l r]]


Add with-graphics macro to cljs version.

--- src/cljx/quil/core.cljx
+++ src/cljx/quil/core.cljx
@@ -4550,7 +4550,6 @@
      ~@body
      (pop-matrix)))

-#+clj
 (defmacro
   ^{:requires-bindings true
     :processing-name nil


color blend modes fix

color blend modes fix

--- src/clojure2d/color.clj
+++ src/clojure2d/color.clj
@@ -440,6 +440,7 @@
              :mpegtoplight blend-mpegtoplight
              :difference blend-difference
              :divide blend-divide
+             :mdivide blend-mdivide
              :or blend-or
              :and blend-and
              :xor blend-xor


document why cursive complains about arity

--- test/clj/lambdacd/steps/support_test.clj
+++ test/clj/lambdacd/steps/support_test.clj
@@ -70,6 +70,8 @@
                                                                    [some-step-returning-the-context-passed-in
                                                                     some-other-step-returning-the-context-passed-in])))))

+; Note: if cursive complains about incorrect arity, that's cursive not knowing what the chain-macro does.
+; as long as the tests are green, you can ignore this...
 (deftest chain-test
   (testing "that we can just call a single step"
     (is (= {:status :success :foo :bar} (chain {} {} (some-step)))))


GitHub Issue #56 - press Escape key to close the modals

--- src-cljs/cuttle/pages/main.cljs
+++ src-cljs/cuttle/pages/main.cljs
@@ -12,6 +12,7 @@
     [cuttle.util :refer [date-format file-exists? homedir log js-log now
                                on-mac? uuid write-file-async!]
                        :refer-macros [while-let]]
+    goog.events.KeyCodes
     [quiescent :include-macros true]
     [sablono.core :as sablono :include-macros true]))

@@ -20,7 +21,9 @@
 (def path (js/require "path"))
 (def path-separator (aget path "sep"))

-(def ENTER-KEY 13)
+(def ENTER goog.events.KeyCodes.ENTER)
+(def ESC goog.events.KeyCodes.ESC)
+
 (def new-project-input-id (uuid))

 ;;------------------------------------------------------------------------------
@@ -596,7 +599,7 @@
   (swap! state assoc :settings-modal-showing? false))

 (defn- on-keydown-new-project-name [js-evt]
-  (when (= ENTER-KEY (aget js-evt "keyCode"))
+  (when (= ENTER (aget js-evt "keyCode"))
     (click-create-project-btn)))

 (defn- on-mount-new-project-form
@@ -804,7 +807,7 @@
         "Load an existing project from a Leiningen " [:code "project.clj"] " file."]]
     [:div.modal-bottom-050c3
       [:span.bottom-link-7d8d7 {:on-click close-add-project-modal}
-        "cancel"]]])
+        "close"]]])

 (sablono/defhtml new-project-form [app-state]
   [:div.modal-body-fe4db
@@ -997,6 +1000,30 @@
 (add-watch state :main on-change-state)

 ;;------------------------------------------------------------------------------
+;; Non-react Events
+;;------------------------------------------------------------------------------
+
+(defn- on-keydown-body [js-evt]
+  (let [key-code (aget js-evt "keyCode")
+        escape-key-pressed? (= ESC key-code)
+        current-state @state]
+    (when escape-key-pressed?
+      (when (:add-project-modal-showing? current-state)
+        (click-add-project-modal-overlay))
+      (when (:settings-modal-showing? current-state)
+        (click-settings-modal-overlay)))))
+
+(def events-added? (atom false))
+
+(defn- add-events!
+  "Add non-react events.
+   NOTE: this is a run-once function"
+  []
+  (when-not @events-added?
+    (.addEventListener js/document.body "keydown" on-keydown-body)
+    (reset! events-added? true)))
+
+;;------------------------------------------------------------------------------
 ;; Init
 ;;------------------------------------------------------------------------------

@@ -1006,6 +1033,7 @@
   (show-el! "mainPage"))

 (defn init! [proj-filenames]
+  (add-events!)
   (load-settings-file!)
   (init-projects! proj-filenames)
   (show-main-page!)


fix analyze-top hack

fix analyze-top hack

--- src/main/shadow/build/compiler.clj
+++ src/main/shadow/build/compiler.clj
@@ -235,9 +235,12 @@
            result
            (binding [*analyze-top*
                      (fn [form]
-                       ;; will be turned into statements. repl-context would turn them into :expr
-                       (let [ast (analyze state compile-state form false)]
-                         (swap! injected-forms-ref conj ast)))]
+                       ;; need to clear potential loop bindings, dunno why it doesn't use env to track these ...
+                       (binding [ana/*recur-frames* nil
+                                 ana/*loop-lets* ()]
+                         ;; will be turned into statements. repl-context would turn them into :expr
+                         (let [ast (analyze state compile-state form false)]
+                           (swap! injected-forms-ref conj ast))))]
              (-> base-env
                  ;; ana/analyze rebinds ana/*cljs-warnings* which we already did
                  ;; it seems to do this to get rid of duplicated warnings?


tags cause a nuisance here by re-appearing. added a distinct to keep things in check

--- src/crawler/rich_char_extractor.clj
+++ src/crawler/rich_char_extractor.clj
@@ -40,14 +40,15 @@

            xpaths-anchors-chars (map
                                  (fn [[xpath nodes]]
-                                   [xpath (map
-                                           (fn [a-node]
-                                             {:href (:href a-node)
-                                              :num-chars (-> a-node
-                                                             :text
-                                                             count)
-                                              :text (:text a-node)})
-                                           nodes)])
+                                   [xpath (distinct
+                                           (map
+                                            (fn [a-node]
+                                              {:href (:href a-node)
+                                               :num-chars (-> a-node
+                                                              :text
+                                                              count)
+                                               :text (:text a-node)})
+                                            nodes))])
                                  template-removed)

            page-wide-nav-chars  (reduce
@@ -70,23 +71,26 @@
                                     (-> % :hrefs count zero?)))
                                  (map
                                   (fn [[xpath info]]
-                                    {:xpath xpath
-                                     :score (reduce
-                                             (fn [acc an-info]
-                                               (+ acc (:num-chars an-info)))
-                                             0
-                                             info)
-
-                                     :hrefs (reduce
-                                             (fn [acc an-info]
-                                               (cons (:href an-info) acc))
-                                             '()
-                                             info)
-                                     :texts (reduce
-                                             (fn [acc an-info]
-                                               (cons (:text an-info) acc))
-                                             '()
-                                             info)})
+                                    (let [potential-xpath xpath
+                                          potential-score (reduce
+                                                           (fn [acc an-info]
+                                                             (+ acc (:num-chars an-info)))
+                                                           0
+                                                           info)
+                                          potential-hrefs (reduce
+                                                           (fn [acc an-info]
+                                                             (cons (:href an-info) acc))
+                                                           '()
+                                                           info)
+                                          potential-texts (reduce
+                                                           (fn [acc an-info]
+                                                             (cons (:text an-info) acc))
+                                                           '()
+                                                           info)]
+                                      {:xpath potential-xpath
+                                       :score potential-score
+                                       :hrefs potential-hrefs
+                                       :texts potential-texts}))
                                   xpaths-anchors-chars))]

        {:total-nav-info page-wide-nav-chars


Update error displaying

Update error displaying

--- src/discuss/communication/main.cljs
+++ src/discuss/communication/main.cljs
@@ -34,9 +34,10 @@
 ;;;; Handlers
 (defn error-handler
   "Generic error handler for ajax requests."
-  [{:keys [status status-text]}]
+  [{:keys [status status-text response]}]
+  (cond
+    (= 400 status) (lib/error-msg! (:error (:location (first (:errors response))))))
   (.log js/console (str "I feel a disturbance in the Force... " status " " status-text))
-  (lib/error-msg! (str status " " status-text))
   (lib/loading? false))

 (defn success-handler-next-view


fixing invalid spec reference (#201)

fixing invalid spec reference (#201)

--- server/src/spacon/components/user.clj
+++ server/src/spacon/components/user.clj
@@ -15,7 +15,7 @@
   "Creates a new user"
   [request]
   (let [user (:json-params request)]
-    (if (s/valid? :spacon.models.user/spec user)
+    (if (s/valid? :spacon.spec/user-spec user)
       (if-let [new-user (usermodel/create user)]
         (response/ok new-user))
       (response/error (str "failed to create user:\n"


update swagger-ui path, fixes #93

update swagger-ui path, fixes #93

--- examples/ring-swagger/src/example/server.clj
+++ examples/ring-swagger/src/example/server.clj
@@ -60,7 +60,7 @@
                                     "application/transit+json"}}}})
     (ring/routes
       (swagger-ui/create-swagger-ui-handler
-        {:path "", :url "/api/swagger.json"})
+        {:path "/", :url "/api/swagger.json"})
       (ring/create-default-handler))))

 (defn start []


Mild documentation.

Mild documentation.

--- test/elephantdb/common/database_test.clj
+++ test/elephantdb/common/database_test.clj
@@ -6,7 +6,9 @@
             [hadoop-util.test :as t])
   (:import [elephantdb.document KeyValDocument]))

-(defn uuid-stream []
+(defn uuid-stream
+  "Generates an infinite stream of UUIDs."
+  []
   (repeatedly #(t/uuid)))

 (defn build-test-db [root-dir remote-dir domain-seq]
@@ -23,6 +25,8 @@
                        :domains    path-map}))))

 (defmacro with-database
+  "Generates a database with the supplied sequence of domain names and
+  binds it to `sym` inside of the form."
   [[sym domain-seq] & body]
   `(t/with-fs-tmp [fs# remote#]
      (t/with-local-tmp [lfs# local#]


memoization added

memoization added

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/ui/tweets.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/ui/tweets.cljs
@@ -36,7 +36,7 @@
     [:img.pure-img-responsive {:src (str (:media_url (get media 0)) ":small")}]]])

 (defn tweet-view [raw-tweet]
-  (let [tweet (util/format-tweet raw-tweet)
+  (let [tweet ((memoize util/format-tweet) raw-tweet)
         user (:user tweet)
         screen-name (:screen_name user)
         href (str "http://www.twitter.com/" screen-name)]


MMT-2202: hotfix - update preview gem assets

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -12,7 +12,7 @@
   {:repo "https://git.earthdata.nasa.gov/scm/cmr/cmr_metadata_preview.git"
    :version "cmr_metadata_preview-0.2.1"
    :commit-id (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-                  "1d700ebba34")})
+                  "17a487401cf")})

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


music-in-queue? ignores track offset

music-in-queue? ignores track offset

--- src-cljs/core.cljs
+++ src-cljs/core.cljs
@@ -349,21 +349,15 @@
                            (om/build player-view app))
                ))))

-(defn music-in-queue? [tracknum offset]
-  (let [queue (player-queue)
-        track (nth queue tracknum nil)]
-    (if track
-      (let [len (get track "length" 0)]
-        (if (>= len offset)
-          [track offset]
-          (music-in-queue? (inc track) (- offset len))))
-      nil)))
+(defn music-in-queue? [tracknum]
+  (let [queue (player-queue)]
+    (nth queue tracknum nil)))
+

 (defn sync-transport [_ ref o n]
   (let [desired (:player n)
         actual (player-el)
-        [urls offset] (music-in-queue?
-                       (:track-number desired) (:track-offset desired))]
+        urls (music-in-queue? (:track-number desired))]

     ;; find out what track we should be playing
     (let [bits (best-media-url urls)


test for get-spec

test for get-spec

--- test/cljc/spec_tools/core_test.cljc
+++ test/cljc/spec_tools/core_test.cljc
@@ -15,6 +15,13 @@
 (s/def ::truth spec/boolean?)
 (s/def ::uuid spec/uuid?)
 (s/def ::birthdate spec/inst?)
+
+(s/def ::a spec/int?)
+(s/def ::b ::a)
+
+(deftest get-spec-test
+  (is (= spec/int? (st/get-spec ::a)))
+  (is (= spec/int? (st/get-spec ::b))))

 (deftest coerce-test
   (is (= spec/boolean? (st/coerce-spec ::truth)))


Config for deployment server

Config for deployment server

--- src/discuss/config.cljs
+++ src/discuss/config.cljs
@@ -4,7 +4,7 @@

 (def user "Q2hyaXN0aWFu")

-(def api {:host "http://localhost:4284/"
+(def api {:host "https://mayweather.cn.uni-duesseldorf.de/dbas/"
           :init "api/elektroautos"
           :base "api/"
           :add  {:add-start-statement "add/start_statement"


s/ipos/it-pos/

s/ipos/it-pos/

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -15,28 +15,28 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [babel.italiano.morphology :refer [exception-generator italian-specific-rules phonize]]
-   [babel.italiano.pos :as ipos]
+   [babel.italiano.pos :as it-pos]
    [dag_unify.core :refer [fail? get-in strip-refs]]))

 (def analyze-lexemes false)

 (def lexicon-source
-  (let [adjective ipos/adjective
-        agreement-noun ipos/agreement-noun
-        cat-of-pronoun ipos/cat-of-pronoun
-        common-noun ipos/common-noun
-        comparative ipos/comparative
-        countable-noun ipos/countable-noun
-        determiner ipos/determiner
-        intransitive ipos/intransitive
-        intransitive-unspecified-obj ipos/intransitive-unspecified-obj
-        masculine-noun ipos/masculine-noun
-        non-comparative-adjective ipos/non-comparative-adjective
+  (let [adjective it-pos/adjective
+        agreement-noun it-pos/agreement-noun
+        cat-of-pronoun it-pos/cat-of-pronoun
+        common-noun it-pos/common-noun
+        comparative it-pos/comparative
+        countable-noun it-pos/countable-noun
+        determiner it-pos/determiner
+        intransitive it-pos/intransitive
+        intransitive-unspecified-obj it-pos/intransitive-unspecified-obj
+        masculine-noun it-pos/masculine-noun
+        non-comparative-adjective it-pos/non-comparative-adjective
         preposition (let [shared (atom :top)]
                       {:synsem {:sem {:obj shared}
                                 :subcat {:1 {:sem shared}}}})
-        pronoun-acc ipos/pronoun-acc
-        pronoun-reflexive ipos/pronoun-reflexive
+        pronoun-acc it-pos/pronoun-acc
+        pronoun-reflexive it-pos/pronoun-reflexive
         reflexive (let [subject-semantics (atom {:animate true})
                         subject-agr (atom :top)]
                     {:synsem {:cat :verb
@@ -51,10 +51,10 @@
                                            :reflexive true
                                            :sem subject-semantics}}}})

-        sentential-adverb ipos/sentential-adverb
-        transitive ipos/transitive
-        verb-aux ipos/verb-aux
-        verb-subjective ipos/verb-subjective]
+        sentential-adverb it-pos/sentential-adverb
+        transitive it-pos/transitive
+        verb-aux it-pos/verb-aux
+        verb-subjective it-pos/verb-subjective]

     {"Luisa"
    {:synsem {:sem {:pred :luisa


use zipper to compute number of rounds

use zipper to compute number of rounds

--- src/bracketolojy/tournament.clj
+++ src/bracketolojy/tournament.clj
@@ -59,6 +59,19 @@
 (defn make-node [existing [upper lower]]
   (-> (assoc-in existing [:upper] upper)
       (assoc-in [:lower] lower)))
+
+(defn- compute-max-round [mx loc]
+  (if (zip/end? loc)
+    mx
+    (recur (max mx (count (zip/path loc))) (zip/next loc))))
+
+(defn max-round [tree]
+  (->> tree
+       (zip/zipper
+         branch?
+         children
+         make-node)
+       (compute-max-round 0)))

 (defn- update-round [rnd node]
   (assoc-in node [:data :round] rnd))
@@ -196,7 +209,8 @@
          bracket
          (->tournament-teams team-data))
        ->tournament-tree
-       (round-info 7)
+       (#(let [tree %]
+          (round-info (max-round tree) tree)))
        (tournament-probabilities
          pick-scoring
          upset-scoring)


catch errors when creating thumbnails

catch errors when creating thumbnails

--- src/brainbot/nozzle/extract.clj
+++ src/brainbot/nozzle/extract.clj
@@ -58,7 +58,14 @@
                                     :path path
                                     :fsid (:fsid fs)})
                     nil))
-        thumbnail (make-thumbnail extract fs path)
+        thumbnail (try
+                    (make-thumbnail extract fs path)
+                    (catch Throwable err
+                      (logging/error "error in make-thumbnail"
+                                     {:error err
+                                      :path path
+                                      :fsid (:fsid fs)})
+                      nil))
         new-body (merge body
                         (remove-nil-values {:extract extract
                                             :thumbnail thumbnail}))]


CLJS-1368: cljs.analyzer tests broken, undeclared-var warning doesn't work

loaded-ns? incorrectly considered ClojureScript namespaces. Only consider
JavaScript libraries that cannot curretnly be analyzed.

--- src/main/clojure/cljs/analyzer.cljc
+++ src/main/clojure/cljs/analyzer.cljc
@@ -549,11 +549,12 @@
   (fn [env prefix suffix]
     (warning :undeclared-var env {:prefix prefix :suffix suffix})))

-(defn loaded-ns?
+(defn loaded-js-ns?
+  "Check if a JavaScript namespace has been loaded. JavaScript vars are
+  not currently checked."
   #?(:cljs {:tag boolean})
   [env prefix]
-  (if-not (nil? (gets @env/*compiler* ::namespaces prefix))
-    true
+  (when-not (gets @env/*compiler* ::namespaces prefix)
     (let [ns (:ns env)]
       (if-not (nil? (get (:requires ns) prefix))
         true
@@ -566,19 +567,19 @@
    (let [warn (confirm-var-exist-warning env prefix suffix)]
      (confirm-var-exists env prefix suffix warn)))
   ([env prefix suffix missing-fn]
-    (let [sufstr     (str suffix)
-          suffix-str (if (and #?(:clj  (not= ".." sufstr)
-                                 :cljs (not (identical? ".." sufstr))) ;; leave cljs.core$macros/.. alone
-                              #?(:clj  (re-find #"\." sufstr)
-                                 :cljs ^boolean (.test #"\." sufstr)))
-                       (first (string/split sufstr #"\."))
-                       suffix)
-          suffix     (symbol suffix-str)]
-      (when (and (not (implicit-import? env prefix suffix))
-                 (not (loaded-ns? env prefix))
-                 (not (and (= 'cljs.core prefix) (= 'unquote suffix)))
-                 (nil? (gets @env/*compiler* ::namespaces prefix :defs suffix)))
-        (missing-fn env prefix suffix)))))
+   (let [sufstr     (str suffix)
+         suffix-str (if (and #?(:clj  (not= ".." sufstr)
+                                :cljs (not (identical? ".." sufstr))) ;; leave cljs.core$macros/.. alone
+                          #?(:clj  (re-find #"\." sufstr)
+                             :cljs ^boolean (.test #"\." sufstr)))
+                      (first (string/split sufstr #"\."))
+                      suffix)
+         suffix     (symbol suffix-str)]
+     (when (and (not (implicit-import? env prefix suffix))
+                (not (loaded-js-ns? env prefix))
+                (not (and (= 'cljs.core prefix) (= 'unquote suffix)))
+                (nil? (gets @env/*compiler* ::namespaces prefix :defs suffix)))
+       (missing-fn env prefix suffix)))))

 (defn confirm-var-exists-throw []
   (fn [env prefix suffix]


formatting

formatting

--- src/chat/client/dispatcher.cljs
+++ src/chat/client/dispatcher.cljs
@@ -141,7 +141,8 @@
     (fn [reply]
       (cond
         (reply :error) (on-error reply)
-        (= reply :chsk/timeout) (on-error {:error "Couldn't connect to server, please try again"})
+        (= reply :chsk/timeout) (on-error
+                                  {:error "Couldn't connect to server, please try again"})
         true (on-success)))))

 (defmethod dispatch! :set-preference [_ [k v]]


Added todo for managing dialog focus

Added todo for managing dialog focus

--- src/main/untangled/ui/elements.cljc
+++ src/main/untangled/ui/elements.cljc
@@ -450,6 +450,7 @@
   "Render one or more action elements (e.g. buttons) in the action area of the dialog. Should only be used in a ui-dialog"
   (om/factory DialogActions))

+;; TODO: We need to give focus to the dialog when visible, track who the initiating control is, then give focus back to the initiating control when the dialog is closed.
 (defui Dialog
   Object
   (render [this]


removing stack name from newly composed service

--- src/clj/swarmpit/docker/engine/mapper/compose.clj
+++ src/clj/swarmpit/docker/engine/mapper/compose.clj
@@ -55,7 +55,7 @@

 (defn service
   [stack-name service]
-  {(keyword (alias :serviceName stack-name service))
+  {(keyword (alias :serviceName (or stack-name (:stack service)) service))
    (ordered-map
      :image (-> service :repository :image)
      :command (some->> service :command (str/join " "))


Improved the test cases for cube-surface

There were too many test cases with the same expected output, so evolution tended to run to that attractor. This fixes that problem, and adds some other test cases, all of which seems to improve the success rate.


Fixing a recent issue with elasticsearch upgrade that was causing some intermittent failures in REPL startup. We would see shards unavailable.

--- src/cmr/elastic_utils/embedded_elastic_server.clj
+++ src/cmr/elastic_utils/embedded_elastic_server.clj
@@ -5,7 +5,8 @@
            org.elasticsearch.common.logging.log4j.LogConfigurator
            org.elasticsearch.node.NodeBuilder
            org.elasticsearch.node.Node)
-  (:require [cmr.common.lifecycle :as lifecycle]))
+  (:require [cmr.common.lifecycle :as lifecycle]
+            [clj-http.client :as client]))

 {"path" {"data" "es_data/elastic_utils"}, "index" {"store" {"type" "memory"}}, "node" {"name" "embedded-elastic"}, "script" {"disable_dynamic" "true"}, "transport" {"tcp" {"port" "9334"}}, "http" {"port" "9234"}}

@@ -66,15 +67,21 @@
    transport-port
    data-dir
    node
-  ]
+   ]

   lifecycle/Lifecycle

   (start
     [this system]
-    (let [node-settings (create-settings this)]
-      (setup-logging node-settings)
-      (assoc this :node (build-node node-settings))))
+    (let [node-settings (create-settings this)
+          _ (setup-logging node-settings)
+          this (assoc this :node (build-node node-settings))]
+      ;; See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html
+      (info (pr-str (client/get
+                         (format
+                           "http://localhost:%s/_cluster/health?wait_for_status=yellow&timeout=50s"
+                           (:http-port this)))))
+      this))

   (stop
     [this system]


Fixed process-legacy-psa to handle empty query string.

--- src/cmr/search/services/legacy_parameters.clj
+++ src/cmr/search/services/legacy_parameters.clj
@@ -106,7 +106,7 @@
   with attributes matching the new cmr csv style"
   [params query-string]
   (psa-pre-validation params)
-  (let [param-strings (map rc/url-decode (s/split query-string #"&"))
+  (let [param-strings (if (empty? query-string) [] (map rc/url-decode (s/split query-string #"&")))
         param-tuples (keep legacy-psa-param->tuple param-strings)
         param-maps (group-legacy-psa-tuples param-tuples)
         psa (map attr-map->cmr-param param-maps)]


Add additional integration tests

Add additional integration tests

--- src/test/clojure/cascade/test_integration.clj
+++ src/test/clojure/cascade/test_integration.clj
@@ -68,8 +68,52 @@
   (.click selenium (str "link=" label))
   (wait-for-page-to-load))

+(defn is-title
+  [expected]
+  (is (= (.getTitle selenium) expected)))
+
+(defn is-text
+  [locator expected]
+  (is (= (.getText selenium locator) expected)))
+
 (deftest test-index-page
   (open)
-  (is (= (.getTitle selenium) "Test Application"))
+  (is-title "Test Application")
   (click-link "Simple Output")
-  (is (= (.getTitle selenium) "It works!")))+  (is-title "It works!")
+  (click-link "index")
+  (is-title "Test Application"))
+
+(deftest simple-actions
+  (open)
+  (click-link "Simple Actions")
+  (is-title "Current Count")
+  (is-text "current" "0")
+  (click-link "here to increment")
+  (is-text "current" "1")
+  (click-link "here to decrement")
+  (is-text "current" "0")
+  (click-link "here to reset")
+  (is-text "current" "1"))
+
+(deftest simple-javascript
+  (open)
+  (click-link "Simple JavaScript")
+  (is-text "message" "ready event did fire."))
+
+(deftest context-image
+  (open)
+  (click-link "Context Image")
+  (is-title "Local Image")
+  (let [path (.getAttribute selenium "//img[1]/@src")]
+    ; TODO: Read content directly and compare to on-disk.
+    (is (.endsWith path "/images/clojure-logo.png"))))
+
+(deftest exception-report
+  (open)
+  (click-link "Forced Exception")
+  (is-title "An unexpected exception has occurred.")
+  (.isTextPresent selenium "Divide by zero")
+  (.isTextPresent selenium "java.lang.ArithmeticException"))
+
+


Remove todo cause it only for dev purpose

--- dev/pot/core/ui.cljs
+++ dev/pot/core/ui.cljs
@@ -77,7 +77,7 @@
                        [:td {:style {:width      50
                                      :height     50
                                      :border     [["1px solid black"]]
-                                     :text-align :center}   ; todo move to css
+                                     :text-align :center}
                              :key   (str "td" (+ (* yc y) x))}
                         (get-in board [y x])])))))])))))
   app-state


Patch up test.

Patch up test.

--- test/onyx/coordinator/coordinator_ha_test.clj
+++ test/onyx/coordinator/coordinator_ha_test.clj
@@ -1,7 +1,6 @@
 (ns onyx.coordinator.coordinator-ha-test
   (:require [midje.sweet :refer :all]
             [onyx.queue.hornetq-utils :as hq-util]
-            [onyx.coordinator.distributed :as d]
             [onyx.api]))

 (def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))
@@ -51,7 +50,7 @@
    :zookeeper/address "localhost:2181"
    :onyx/id id})

-(def onyx-server (d/start-distributed-coordinator coord-opts))
+(def onyx-server (onyx.api/start-distributed-coordinator coord-opts))

 (def onyx-port-2 (+ 10000 (rand-int 10000)))

@@ -71,7 +70,7 @@
    :onyx.coordinator/port onyx-port-2
    :onyx.coordinator/revoke-delay 5000})

-(def onyx-server-2 (future (d/start-distributed-coordinator coord-opts-2)))
+(def onyx-server-2 (future (onyx.api/start-distributed-coordinator coord-opts-2)))

 (def conn (onyx.api/connect :distributed coord-opts))

@@ -117,7 +116,7 @@
 (onyx.api/submit-job conn {:catalog catalog :workflow workflow})

 (Thread/sleep 10000)
-(d/stop-distributed-coordinator onyx-server)
+(onyx.api/stop-distributed-coordinator onyx-server)

 (def results (hq-util/consume-queue! hq-config out-queue echo))

@@ -125,7 +124,7 @@
   ((:shutdown-fn v-peer)))

 (onyx.api/shutdown conn)
-(d/stop-distributed-coordinator onyx-server)
+(onyx.api/stop-distributed-coordinator onyx-server)

 (let [expected (set (map (fn [x] {:n (inc x)}) (range n-messages)))]
   (fact (set (butlast results)) => expected)


Updates js/coerce to handle datetime values that are already parsed

--- umm-spec-lib/src/cmr/umm_spec/json_schema.clj
+++ umm-spec-lib/src/cmr/umm_spec/json_schema.clj
@@ -195,7 +195,9 @@
      (condp = (:type definition)

        "string"  (condp = (:format definition)
-                   "date-time" (when x (dtp/parse-datetime x))
+                   "date-time" (if (instance? org.joda.time.DateTime x)
+                                 x
+                                 (dtp/parse-datetime x))
                    (str x))

        "number"  (Double. x)
@@ -213,7 +215,7 @@
                              (when v
                                (if-let [prop-definition (get-in definition [:properties k])]
                                  [k (coerce schema prop-definition (conj key-path k) v)]
-                                 [k v])))
+                                 (throw (Exception. "oops!")))))
                        m (into {} kvs)]
                    ;; Return nil instead of empty maps/records here.
                    (when (seq m)


Neo4j have retired their Heroku add-on, so switching to Graphene.

--- src/asid/nodes.clj
+++ src/asid/nodes.clj
@@ -11,7 +11,7 @@
    :node-id (:id root-node)})

 (defn initialize! []
-  (let [neo-host (as/getenv "NEO4J_URL" "http://localhost:7474")]
+  (let [neo-host (as/getenv "GRAPHENEDB_URL" "http://localhost:7474")]
     (nr/connect! (str neo-host "/db/data"))
     (let [root (nn/get 0)
           asid-rels (nrl/outgoing-for root :types [:asid])]


Remove unused test

Remove unused test

--- test/searchthecity/test/handler.clj
+++ test/searchthecity/test/handler.clj
@@ -3,13 +3,3 @@
         ring.mock.request
         searchthecity.handler))

-(deftest test-app
-  (testing "main route"
-    (let [response (app (request :get "/"))]
-      (is (= (:status response) 200))
-      (is (= (:body response)
-             "\n    \n        <title>Welcome to searchthecity</title>\n        <link href=\"/css/screen.css\" rel=\"stylesheet\" type=\"text/css\"></link>\n    \n    \n
\n
\n
\n                    Home\n
\n
\n                    About\n
\n
\n
\n
\n
Welcome to searchthecity
\n        \n
Some links to get started

HTML templating

Accessing the database

Serving static resources

Setting response types

Defining routes

Adding middleware

Sessions and cookies

Security

Deploying the application

\n\n
        \n        Copyright ...\n    \n\n\n\n"))))
-
-  (testing "not-found route"
-    (let [response (app (request :get "/invalid"))]
-      (is (= (:status response) 404)))))


Cleanup chs more.

Cleanup chs more.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -73,7 +73,9 @@
     :end (fn [vis actx args]
            (let [[ch msg] args]
              (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))
-             (swap! vis #(dissoc-in % [:chs ch :msgs msg]))))}
+             (swap! vis #(dissoc-in % [:chs ch :msgs msg]))
+             (when (nil? msg)
+               (swap! vis #(dissoc-in % [:chs ch])))))}
    "aput"
    {:beg (fn [vis actx args]
            (let [[ch msg] args]
@@ -85,11 +87,11 @@
              (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))))}
    "aalts"
    {:beg (fn [vis actx args]
-           (let [[chs] args
+           (let [[ch-bindings] args
                  actions (map #(if (seq? %)
                                  [(first %) :put]
                                  [% :take])
-                              chs)]
+                              ch-bindings)]
              (swap! vis #(update-in % [:acts actx :wait-chs]
                                     (fn [wait-chs]
                                       (reduce (fn [acc v]
@@ -98,7 +100,14 @@
                                               wait-chs
                                               actions))))))
     :end (fn [vis actx args]
-           (let [[chs result] args] 2))}})
+           (let [[ch-bindings result] args
+                 chs (map #(if (seq? %) (first %) %) ch-bindings)
+                 [result-ch result-msg] result]
+             (doseq [ch chs]
+               (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch])))
+             (swap! vis #(dissoc-in % [:chs result-ch :msgs result-msg]))
+             (when (nil? result-msg)
+               (swap! vis #(dissoc-in % [:chs result-ch])))))}})

 (defn vis-html-actx [vis actx]
   (if actx


Remove debug output

Remove debug output

--- backend/src/circle/backend/build/run.clj
+++ backend/src/circle/backend/build/run.clj
@@ -43,9 +43,7 @@

 (defn log-result [b]
   (if (build/successful? b)
-    (do
-      (println "Build successful" (build/build-name b))
-      (infof "Build %s successful" (build/build-name b)))
+    (infof "Build %s successful" (build/build-name b))
     (errorf "Build %s failed" (build/build-name b))))

 (defn finished [b]


using literal

using literal

--- web/celestial/routes/system.clj
+++ web/celestial/routes/system.clj
@@ -8,7 +8,6 @@
     [celestial.views.layout :as layout]
     [celestial.util :as util]
     [compojure.route :as route]))
-

 (def port-view 10)

@@ -21,7 +20,7 @@
   {:pre [(> from -1)]}
   (let [to (min (+ from (* per-page port-view)) total)
         ps (partition 2 1 (range from to  per-page))
-        pages (map (fn [[f t]] (hash-map :from f :to t :pos (quot f per-page))) ps)]
+        pages (map (fn [[f t]] {:from f :to t :pos (quot f per-page)}) ps)]
      {:prev (if (> from 0) {:from (- from per-page) :to from :pos (quot (- from per-page) per-page)} nil)
       :items pages
       :next (if (< to total) {:from (- to per-page) :to to :pos (quot (- to per-page) per-page)} nil)}))


proxyCursor should realize a value on read if it doesn't end in a sub-cursor


changed scroll limits

changed scroll limits

--- src/unspun/gesture_responders.cljs
+++ src/unspun/gesture_responders.cljs
@@ -36,7 +36,7 @@
           y1 (aget gesture-state "moveY")]
       ;(prn "y0 = " y0 " y1 = " y1 " factor = " (clamp [1 10] (inc (/ (- y0 y1) (- y0 700)))) " scale = " @(:scale state))
       (when-not @(:rescaler state) (reset! (:rescaler state) y0))
-      (let [rescale (clamp [1 1000] (* @(:scale0 state) (inc (/ (- y0 y1) (- origin y0)))))]
+      (let [rescale (clamp [1 100] (* @(:scale0 state) (inc (/ (- y0 y1) (- origin y0)))))]
         (if (different rescale @(:scale state))
           (reset! (:scale state) rescale))))))


more efficiency potential in index-of

more efficiency potential in index-of

--- src/kmp_search/core.clj
+++ src/kmp_search/core.clj
@@ -32,13 +32,20 @@
   [matcher ^bytes data]
   (let [{:keys [pattern length failures state]} matcher
         [offset i j] state
-        find-match (fn [[i j] b]
-                     (let [j (match-length pattern failures j b)
-                           match [(inc i) j]]
-                       (if (= j length)
-                         (reduced match)
-                         match)))
-        [i j] (reduce find-match [i j] data)
+        limit (alength data)
+        [i j] (loop [i 0 j j]
+                (if (= i limit)
+                  [i j]
+                  (let [b (aget data i)
+                        j (loop [j j]
+                            (if (and (pos? j) (not= (aget pattern j) b))
+                              (recur (aget failures (dec j)))
+                              (if (= (aget pattern j) b)
+                                (inc j)
+                                j)))]
+                    (if (= j length)
+                      [(inc i) j]
+                      (recur (inc i) j)))))
         offset (+ offset i)]
     (if (= j length)
       [(assoc matcher :state [offset i 0]) (- offset length)]
@@ -50,4 +57,3 @@
     (if (neg? index)
       [matcher index]
       (reduced [matcher index]))))
-


fix go term label

fix go term label

--- src/wb_es/datomic/data/go_term.clj
+++ src/wb_es/datomic/data/go_term.clj
@@ -7,7 +7,8 @@
   (metadata [this] (data-util/default-metadata entity))
   (data [this]
     {:wbid (:go-term/id entity)
-     :label (:go-term/definition entity)}))
+     :label (first (:go-term/name entity))
+     :description (first (:go-term/definition entity))}))


fix bug - ring client had a missing var

fix bug - ring client had a missing var

--- src/yeller_clojure_client/ring.clj
+++ src/yeller_clojure_client/ring.clj
@@ -17,13 +17,8 @@
     :http-request (request-info request)}
    :environment (:environment options "production")})

-(defn make-client [options-or-client]
-  (if (map? options-or-client)
-    (yeller/client options)
-    options-or-client))
-
 (defn wrap-ring
-  [handler options-or-client]
+  [handler options]
   "wraps a ring handler in middleware that sends exceptions to yeller.
    takes a map of options.
    Required:
@@ -40,7 +35,7 @@
    On the other hand, it should probably sit outside of any middleware you have
    that does e.g. authentication, so it can track errors that happen in that
    middleware"
-  (let [client (make-client options-or-client)]
+  (let [client (yeller/client options)]
     (fn [request]
       (try
         (handler request)


Fix chan error

Fix chan error

--- src/zooniverse_live/data_init.cljs
+++ src/zooniverse_live/data_init.cljs
@@ -14,7 +14,7 @@
   [app]
   (comp (map #(.-data %))
         (map trim-newline)
-        (filter #(not (some (apply set %) ["Heartbeat" "Stream Start" ""])))
+        (filter #(not (or (= %  "Heartbeat") (= % "Stream Start"))))
         (map str->clj)
         (filter #(contains? (:projects @app) (keyword (:project %))))))


editor/line-count takes a native editor

editor/line-count takes a native editor

Consistently with related functions, `lt.objs.editor/line-count` now
takes a native Light Table editor, as opposed to a CodeMirror instance.

--- src/lt/objs/editor.cljs
+++ src/lt/objs/editor.cljs
@@ -195,7 +195,7 @@
   (.getRange (->cm-ed e) (clj->js from) (clj->js to)))

 (defn line-count [e]
-  (.lineCount e))
+  (.lineCount (->cm-ed e)))

 (defn insert-at-cursor [ed s]
   (replace (->cm-ed ed) (->cursor ed) s)


comment indentation.

comment indentation.

--- src/metabase/driver.clj
+++ src/metabase/driver.clj
@@ -110,14 +110,14 @@
   (execute-query ^java.util.Map [this, ^Map query]
     "Execute a query against the database and return the results.

-     The query passed in will contain:
+  The query passed in will contain:

          {:database ^DatabaseInstance
           :native   {... driver specific query form such as one returned from a call to `mbql->native` ...}
           :settings {:report-timezone \"US/Pacific\"
                      :other-setting   \"and its value\"}}

-     Results should look like:
+  Results should look like:

          {:columns [\"id\", \"name\"]
           :rows    [[1 \"Lucky Bird\"]
@@ -147,12 +147,12 @@
   (mbql->native ^java.util.Map [this, ^Map query]
     "Transpile an MBQL structured query into the appropriate native query form.

-     The input query will be a fully expanded MBQL query (https://github.com/metabase/metabase/wiki/Expanded-Queries) with
-     all the necessary pieces of information to build a properly formatted native query for the given database.
-
-     The result of this function will be passed directly into calls to `execute-query`.
-
-     For example, a driver like Postgres would build a valid SQL expression and return a map such as:
+  The input query will be a fully expanded MBQL query (https://github.com/metabase/metabase/wiki/Expanded-Queries) with
+  all the necessary pieces of information to build a properly formatted native query for the given database.
+
+  The result of this function will be passed directly into calls to `execute-query`.
+
+  For example, a driver like Postgres would build a valid SQL expression and return a map such as:

        {:query \"SELECT * FROM my_table\"}")


Fix deadlock problem.

Fix deadlock problem.

--- src/exp/asplan.clj
+++ src/exp/asplan.clj
@@ -374,7 +374,7 @@
          (cond (= (env/get-var s var) dst-val)
                  (do (assert (not (env/get-var s av))) [[]])
                (env/get-var s av)
-                 [[(make-fire-action-hla hierarchy var (env/get-var s av) #{})
+                 [[(make-fire-action-hla hierarchy var (env/get-var s av))
                    (make-if-deadlock-hla hierarchy var [] [this])]]
                :else
                  (let [p-val (env/get-var s var)
@@ -390,24 +390,28 @@
  ; Record deadlock causes,
  ; Don't try to detect deadlock, just infinitely cycle through preconds & let search take care of it?
 ; Seems real deadlock detection is best.
-(defn make-fire-action-hla
-  ([hierarchy effect-var a deadlock-set]
-    (let [reduced-pm (dissoc (:precond-map a) effect-var)]
-     (make-fire-action-hla
-      hierarchy effect-var a deadlock-set reduced-pm
-      (:full-context hierarchy ) #_
-      (util/safe-get-in hierarchy [:precondition-context-map effect-var]) #_
-      (into #{(action-var effect-var)}
-        (apply concat
-          (for [p (keys reduced-pm)]
-            (cons (free-var p)
-                  (cons (parent-var p effect-var)
-                        (get-in hierarchy [:precondition-context-map p])))))))))
- ([hierarchy effect-var a deadlock-set reduced-pm pc]
-  (let [name          [:fire-action effect-var deadlock-set]
-        child-var-map (:child-var-map hierarchy)]
+
+;; TODO: speed up somehow?
+(defn precond-deadlocked? [s precond e-var]
+  (or (and (not (env/get-var s (free-var precond)))
+           (not (env/get-var s (parent-var precond e-var))))
+      (when-let [a (env/get-var s (action-var precond))]
+        (some #(precond-deadlocked? s % precond) (remove #{precond} (keys (:precond-map a)))))))
+
+(defn make-fire-action-hla  [hierarchy effect-var a]
+  (let [name          [:fire-action effect-var]
+        reduced-pm    (dissoc (:precond-map a) effect-var)
+        child-var-map (:child-var-map hierarchy)
+        pc            (:full-context hierarchy ) #_
+                      (util/safe-get-in hierarchy [:precondition-context-map effect-var]) #_
+                      (into #{(action-var effect-var)}
+                            (apply concat
+                                   (for [p (keys reduced-pm)]
+                                     (cons (free-var p)
+                                           (cons (parent-var p effect-var)
+                                                 (get-in hierarchy [:precondition-context-map p]))))))]
 ;    (println "FA" name)
-   (reify :as this
+  (reify :as this
     env/Action
       (action-name [] name)
       (primitive?  [] false)
@@ -429,12 +433,9 @@
           ;; Active precondition -- assigned, needs its value changed, not deadlock
           (util/find-first #(and (env/get-var s (parent-var % effect-var))
                                  (not (= (env/get-var s %) (reduced-pm %)))
-                                 (not (contains? deadlock-set %)))
+                                 (not (precond-deadlocked? s % effect-var)))
                            (keys reduced-pm))
-            [[(make-achieve-precondition-hla hierarchy x (reduced-pm x))
-              (make-if-deadlock-hla hierarchy x
-                [(make-fire-action-hla hierarchy effect-var a (conj deadlock-set x) reduced-pm pc)]
-                [(make-fire-action-hla hierarchy effect-var a #{} reduced-pm pc)])]]
+            [[(make-achieve-precondition-hla hierarchy x (reduced-pm x)) this]]

           ;; Inactive precondition -- needs to be assigned.
           (util/find-first #(env/get-var s (free-var %)) (keys reduced-pm))
@@ -454,7 +455,7 @@
           ;; Nothing to do here -- return upwards, or fail if goal-var
           :else
             (when-not (= effect-var sas/goal-var-name) [[]]))))
-       (cycle-level-           [s] nil)))))
+       (cycle-level-           [s] nil))))

@@ -490,8 +491,7 @@
         :acyclic-succ-fn          (:acyclic-succ-fn env)
         :precondition-context-map pc-map}
        sas/goal-var-name
-       (env/get-var (env/initial-state env) (action-var sas/goal-var-name))
-       #{})])))
+       (env/get-var (env/initial-state env) (action-var sas/goal-var-name)))])))

 (defn asplan-skip-solution-name [sol]


Revert "Use funcool/bootutils."

Revert "Use funcool/bootutils."

This reverts commit 07adf306db6988782f96da055ff1e7c15e27ea20.

--- build.boot
+++ build.boot
@@ -2,7 +2,6 @@
  :source-paths #{"src"}
  :resource-paths #{"assets"}
  :dependencies '[[cats "0.4.0"]
-                 [funcool/bootutils "0.1.0-SNAPSHOT" :scope "test"]
                  [adzerk/boot-cljs "0.0-2814-3" :scope "test"]
                  [boot-cljs-test/node-runner "0.1.0" :scope "test"]
                  [org.clojure/clojurescript "0.0-3123"  :scope "test"]
@@ -11,18 +10,62 @@

 (require
  '[adzerk.boot-cljs :refer [cljs]]
- '[bootutils.core :refer :all]
  '[boot-cljs-test.node-runner :refer :all])

 (def +version+ "0.1.2")

-(task-options!
- pom {:project     'funcool/promesa
-      :version     +version+
-      :description "A promise library for ClojureScript"
-      :url         "https://github.com/funcool/promesa"
-      :scm         {:url "https://github.com/funcool/promesa"}
-      :license     {"BSD (2 Clause)" "http://opensource.org/licenses/BSD-2-Clause"}})
+(deftask clojars-credentials
+  []
+  (fn [next-handler]
+    (fn [fileset]
+      (let [clojars-creds (atom {})]
+        (print "Username: ")
+        (swap! clojars-creds assoc :username (read-line))
+        (print "Password: ")
+        (swap! clojars-creds assoc :password
+               (apply str (.readPassword (System/console))))
+        (merge-env!
+         :repositories [["deploy-clojars" (merge @clojars-creds {:url "https://clojars.org/repo"})]])
+        (next-handler fileset)))))
+
+(deftask push-snapshot
+  "Deploy snapshot version to Clojars."
+  [f file PATH str "The jar file to deploy."]
+  (comp (clojars-credentials)
+        (push :file file
+              :ensure-snapshot true
+              :repo "deploy-clojars"
+              :ensure-version +version+
+              :ensure-clean false
+              :ensure-branch "master")))
+
+(deftask push-release
+  "Deploy snapshot version to Clojars."
+  [f file PATH str "The jar file to deploy."]
+  (comp (clojars-credentials)
+        (push :file file
+              :ensure-release true
+              :repo "deploy-clojars"
+              :ensure-version +version+
+              :ensure-clean true
+              :ensure-branch "master")))
+
+(deftask build []
+  (comp (pom :project     'funcool/promesa
+             :version     +version+
+             :description "A promise library for ClojureScript"
+             :url         "https://github.com/funcool/promesa"
+             :scm         {:url "https://github.com/funcool/promesa"}
+             :license     {"BSD (2 Clause)" "http://opensource.org/licenses/BSD-2-Clause"})
+        (jar)))
+
+(deftask deploy-snapshot []
+  (comp (build)
+        (push-snapshot)))
+
+(deftask deploy-release []
+  (comp (build)
+        (push-release)))

 (deftask dev []
   (set-env! :source-paths #{"src" "test" "assets"})


Remove bootlaces dependency entirely

Remove bootlaces dependency entirely

--- build.boot
+++ build.boot
@@ -1,13 +1,11 @@
 (set-env!
  :source-paths #{"src"}
  :resource-paths #{"src"}
- :dependencies '[[org.clojure/clojure     "1.6.0" :scope "provided"]
+ :dependencies '[[org.clojure/clojure     "1.8.0" :scope "provided"]
                  [boot/core               "2.1.0" :scope "provided"]
-                 [junit                   "4.12"  :scope "test"]
-                 [radicalzephyr/bootlaces "0.1.15-SNAPSHOT"]])
+                 [junit                   "4.12"  :scope "test"]])

-(require '[radicalzephyr.bootlaces :refer :all]
-         '[radicalzephyr.boot-junit :refer [junit]])
+(require '[radicalzephyr.boot-junit :refer [junit]])

 (def +version+ "0.3.0-SNAPSHOT")


Replace jet with aleph for test websocket connections.

jet/jetty does not works properly with boot pods.

--- build.boot
+++ build.boot
@@ -7,13 +7,13 @@

                  ;; Boot dependencies
                  [boot-deps "0.1.4" :scope "test"]
-                 [funcool/bootutils "0.1.0" :scope "test"]
+                 [funcool/bootutils "0.2.0" :scope "test"]
                  [funcool/boot-codeina "0.1.0-SNAPSHOT" :scope "test"]
                  [adzerk/boot-test "1.0.4" :scope "test"]

                  ;; Testing dependecines
                  [clj-http "1.1.2" :scope "test"]
-                 [cc.qbits/jet "0.6.2" :scope "test"]
+                 [aleph "0.4.0" :scope "test"]
                  [org.clojure/tools.namespace "0.2.10" :scope "test"]
                  [ring/ring-core "1.3.2"
                   :scope "test"


Update build.boot with last version and some additional tasks for deploy.

--- build.boot
+++ build.boot
@@ -1,8 +1,8 @@
 (set-env!
- :source-paths #{"src" "assets"}
+ :source-paths #{"src"}
+ :resource-paths #{"assets"}
  :dependencies '[[cats "0.4.0"]
                  [adzerk/boot-cljs "0.0-2814-3" :scope "test"]
-                 [adzerk/bootlaces "0.1.11" :scope "test"]
                  [boot-cljs-test/node-runner "0.1.0" :scope "test"]
                  [org.clojure/clojurescript "0.0-3123"  :scope "test"]
                  [org.clojure/clojure "1.7.0-beta3" :scope "test"]
@@ -10,19 +10,62 @@

 (require
  '[adzerk.boot-cljs :refer [cljs]]
- '[boot-cljs-test.node-runner :refer :all]
- '[adzerk.bootlaces :refer :all])
+ '[boot-cljs-test.node-runner :refer :all])

-(def +version+ "0.1.2-SNAPSHOT")
-(bootlaces! +version+)
+(def +version+ "0.1.2")

-(task-options!
-  pom  {:project     'funcool/promesa
-        :version     +version+
-        :description "A promise library for ClojureScript"
-        :url         "https://github.com/funcool/promise"
-        :scm         {:url "https://github.com/funcool/promise"}
-        :license     {"BSD (2 Clause)" "http://opensource.org/licenses/BSD-2-Clause"}})
+(deftask clojars-credentials
+  []
+  (fn [next-handler]
+    (fn [fileset]
+      (let [clojars-creds (atom {})]
+        (print "Username: ")
+        (swap! clojars-creds assoc :username (read-line))
+        (print "Password: ")
+        (swap! clojars-creds assoc :password
+               (apply str (.readPassword (System/console))))
+        (merge-env!
+         :repositories [["deploy-clojars" (merge @clojars-creds {:url "https://clojars.org/repo"})]])
+        (next-handler fileset)))))
+
+(deftask push-snapshot
+  "Deploy snapshot version to Clojars."
+  [f file PATH str "The jar file to deploy."]
+  (comp (clojars-credentials)
+        (push :file file
+              :ensure-snapshot true
+              :repo "deploy-clojars"
+              :ensure-version +version+
+              :ensure-clean false
+              :ensure-branch "master")))
+
+(deftask push-release
+  "Deploy snapshot version to Clojars."
+  [f file PATH str "The jar file to deploy."]
+  (comp (clojars-credentials)
+        (push :file file
+              :ensure-release true
+              :repo "deploy-clojars"
+              :ensure-version +version+
+              :ensure-clean true
+              :ensure-branch "master")))
+
+(deftask build []
+  (comp (pom :project     'funcool/promesa
+             :version     +version+
+             :description "A promise library for ClojureScript"
+             :url         "https://github.com/funcool/promise"
+             :scm         {:url "https://github.com/funcool/promise"}
+             :license     {"BSD (2 Clause)" "http://opensource.org/licenses/BSD-2-Clause"})
+        (jar)))
+
+(deftask deploy-snapshot []
+  (comp (build)
+        (push-snapshot)))
+
+(deftask deploy-release []
+  (comp (build)
+        (push-release)))

 (deftask dev []
   (set-env! :source-paths #{"src" "test" "assets"})
@@ -30,7 +73,3 @@
         (cljs-test-node-runner :namespaces '[promesa.core-tests])
         (cljs :source-map true :optimizations :none)
         (run-cljs-test)))
-
-;; (deftask build []
-;;   (set-env! :source-paths #{"src"})
-;;   (comp (cljs :optimizations :advanced)))


slf4j-nop is only needed in the main alda project

--- build.boot
+++ build.boot
@@ -7,9 +7,6 @@
                   [adzerk/bootlaces      "0.1.13" :scope "test"]
                   [adzerk/boot-test      "1.0.4"  :scope "test"]
                   [str-to-argv           "0.1.0"  :score "test"]
-
-                  ; silence slf4j logging dammit
-                  [org.slf4j/slf4j-nop        "1.7.21"]

                   ; shared
                   [org.zeromq/jeromq "0.3.5"]


Fixed aggree and disagree helpers

Fixed aggree and disagree helpers

--- src/polismath/utils.clj
+++ src/polismath/utils.clj
@@ -4,11 +4,15 @@

 (defn agree? [n]
-  (< n 0))
+  (and
+    (not (nil? n))
+    (< n 0)))

 (defn disagree? [n]
-  (> n 0))
+  (and
+    (not (nil? n))
+    (> n 0)))

 (defmacro time2


added hospital metadata record

added hospital metadata record

--- src/prais2/content.cljs
+++ src/prais2/content.cljs
@@ -177,6 +177,49 @@
     (Row. "Hospital M"	"M"	0 0     1481	36	1445	97.6	95.3	95.9	97.7	98.1  nil)
     (Row. "Hospital N"	"N"	0 0     1881	67	1814	96.4	96.5	97.0	98.4	98.7  nil)]})

+
+(def hospital-metadata
+  {:RVB [[:a {:href "http://belfasttrust-cardiacsurgery.hscni.net/about-cardiac-surgery/location/"} "Belfast, Royal Victoria Hospital"]
+         [:a {:href "http://www.childrensheartbeattrust.org/"} "Children’s Heartbeat Trust"]]
+   :HSC [[:a {:href "http://theharleystreetclinic.co.uk/cardiac/congenital-heart-care"}
+        "London, Harley Street Clinic"]]
+   :GRL [[:a {:href "http://www.leicestershospitals.nhs.uk/aboutus/leicester-hospitals-charity/childrens-heart-unit/"}
+          "Leicester, Glenfield Hospital"]
+         [:a {:href "http://www.heartlink-glenfield.org.uk/"} "Heart Link"]]
+   :FRE [[:a {:href "http://www.newcastle-hospitals.org.uk/services/cardiothoracic_services_childrens-heart-unit.aspx"} "Newcastle, Freeman Hospital"]
+         [:a {:href "http://www.newcastle-hospitals.org.uk/services/cardiothoracic_services_childrens-heart-unit_childrens-heart-unit-fund-chuf.aspx"} "Newcastle Children’s Heart Unit Fund"]]
+   :RHS [[:a {:href "http://www.nhsggc.org.uk/locations/hospitals/the-royal-hospital-for-children-glasgow/"}
+          "Glasgow, Royal Hospital for Children"]
+         [:a {:href "http://www.youngheart.info/"}
+        [:p "The Scottish Association for Children with Heart Disorders (SACHD)"]]]
+   :BRC [[:a
+           {:href "http://www.uhbristol.nhs.uk/patients-and-visitors/your-hospitals/bristol-royal-hospital-for-children/the-paediatric-cardiac-service/"}
+          "Bristol Royal Hospital for Children"]
+         [:a {:href "http://www.heartfamilies.org.uk/"} "Heart Families South West"]
+         [:a {:href "http://www.heartcircle.org/"} "South West Children’s Heart Circle"]]
+   :SGH [[:a {:href "http://www.uhs.nhs.uk/OurServices/Childhealth/Childrenscongenitalcardiacservices/Childrenscongenitalcardiacservices.aspx"} "Southampton, Wessex Cardiothoracic Centre"] " (Southampton Children’s Hospital)"
+         [:a {:href "http://www.oceanward.co.uk/"} "Families of Ocean Ward"]]
+   :LGI [[:a {:href "http://www.leedsth.nhs.uk/a-z-of-services/childrens-cardiology/"} "Leeds General Infirmary"]
+         [:a {:href "http://chsf.org.uk/"} "The Childrens Heart Surgery Fund"]]
+   :OLS [[:a
+        {:href "http://www.heartchildren.ie/our-lady%E2%80%99s-children%E2%80%99s-hospital-crumlin"}
+          "Dublin, Our Lady's Children's Hospital"]
+         [:a {:href "http://www.heartchildren.ie/our-lady%E2%80%99s-children%E2%80%99s-hospital-crumlin"}
+        "Heart Children Ireland"]]
+   :NHB [[:a {:href "http://www.newcastle-hospitals.org.uk/services/cardiothoracic_services_childrens-heart-unit.aspx"} "Newcastle, Freeman Hospital"]
+         [:a {:href "http://www.thebromptonfountain.org.uk/"} "The Brompton Fountain"]]
+   :ACH [[:a {:href "http://www.alderhey.nhs.uk/departments/cardiac/"} "Liverpool, Alder Hey Hospital"]
+         [:a {:href "http://www.alderheycharity.org/"} "Alder Hey Charity"]]
+   :GUY [[:a {:href "http://www.evelinalondon.nhs.uk/our-services/hospital/heart-services/overview.aspx"}
+          "London, Evelina London Children's Hospital"]
+         [:a {:href "http://www.echo-evelina.org.uk/"} "ECHO – Evelina Children’s Heart Organisation"]]
+   :BCH [[:a {:href "http://www.bch.nhs.uk/content/heart-unit"} "Birmingham Children’s Hospital"]
+         [:a {:href "http://www.youngatheart.org.uk/"} "Young at Heart"]
+         [:a {:href "http://www.bch.org.uk"} "Birmingham Children’s Hospital Charity"]]
+   :GOS [[:a {:href "http://www.gosh.nhs.uk/medical-information/clinical-specialties/cardiothoracic-surgery-information-parents-and-visitors"}
+          "London, Great Ormond Street Hospital for Children"]
+         [:a {:href "http://www.gosh.org/"} "Great Ormond Street Hospital Charity"]]})
+
 ;;;
 ;; Comment on the meaning of each range. These texts appear in bar-chart tooltips
 ;;;


Moar https links

Moar https links

Change-Id: I5402edc1c18cfd93bba281dde77cf48e0632f4b9

--- src/qcast/feed/feed.clj
+++ src/qcast/feed/feed.clj
@@ -43,7 +43,7 @@
      (rss/language "en-US")
      (rss/generator "InfoQ-Feed-Generator/1.0")
      (rss/last-build-date change-date)
-     (atom/link "http://infoqcast.herokuapp.com/feed")
+     (atom/link "https://infoqcast.herokuapp.com/feed")
      (itunes/author "InfoQ")
      (itunes/owner "InfoQ" "info@infoq.com")
      (itunes/summary (str "InfoQ.com is a practitioner-driven "


Remove threading as dissoc takes ks

Remove threading as dissoc takes ks

--- src/riemann/hipchat.clj
+++ src/riemann/hipchat.clj
@@ -33,7 +33,7 @@
 (defn- format-event [{:keys [message] :as conf} event]
   "Creates an event suitable for posting to hipchat."
   (merge {:color (message-colour event) :from "riemann"}
-         (-> conf (dissoc :server) (dissoc :room_id))
+         (dissoc conf :server :room_id)
          (when-not message
            {:message (format-message (flatten [event]))})))


atomize part-time-fast-interval

atomize part-time-fast-interval

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -811,11 +811,10 @@
   time .95'."
   [interval points & children]
   (part-time-fast interval
-                (fn setup [] (ref []))
-                (fn add [r event] (dosync (alter r conj event)))
+                (fn setup [] (atom []))
+                (fn add [r event] (swap! r conj event))
                 (fn finish [r start end]
-                  (let [samples (dosync
-                                  (folds/sorted-sample (deref r) points))]
+                  (let [samples (folds/sorted-sample @r points)]
                     (doseq [event samples] (call-rescue event children))))))

 (defn counter


Renamed test

Renamed test

--- test/layzee/integration/conversation_examples.clj
+++ test/layzee/integration/conversation_examples.clj
@@ -11,11 +11,11 @@
 (facts "Find entire conversations like this" ;; https://dev.twitter.com/rest/public/search; https://dev.twitter.com/rest/reference/get/search/tweets
        (let [result (conversation/for settings/oauth-credential "636840679272873984")]

-         (fact "it returns the same tweet"
+         (fact "it returns the tweet"
                (:id_str result) => "636840679272873984"
                (:text result)   => "@benbiddington lolwut?! http://t.co/AC0WvYYfOI")

-         (fact "and it has the following replies"
+         (fact "and its replies"
                (map #(:text %) (:replies result)) => (contains #{"@iamkey Got latest?" "@benbiddington have just now. Still failing." "@iamkey Config file format has changed <https://t.co/66dquz6N78> (soz)" "@benbiddington chur"})

          )))


Use new generators in some of the flow condition tests.

--- test/onyx/generative/flow_conditions_gen_test.clj
+++ test/onyx/generative/flow_conditions_gen_test.clj
@@ -13,21 +13,77 @@

 (def false-pred (constantly false))

-(def gen-tasks-and-subset
-  "Returns a vector of two elements.
-   The first represents a seq of downstream
-   tasks, and the second represents a subset
-   of that seq."
+(def predicates
+  {true ::true-red
+   false ::false-pred})
+
+(defn flow-condition-gen [from-task]
+  (gen/hash-map
+   :flow/from (gen/return from-task)
+   :flow/exclude-keys (gen/vector gen/keyword)))
+
+(defn flow-to-all-gen [base-gen]
   (gen/bind
-   (gen/vector gen/keyword)
-   (fn [downstream]
-     (gen/bind
-      (gen/choose 0 (count downstream))
-      (fn [size]
-        (gen/bind
-         (gen/shuffle (take size downstream))
-         (fn [flow-to]
-           (gen/return [downstream flow-to]))))))))
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map :flow/to (gen/return :all))]
+       (gen/fmap #(merge v %) g)))))
+
+(defn flow-to-none-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map :flow/to (gen/return :none))]
+       (gen/fmap #(merge v %) g)))))
+
+(defn flow-to-tasks-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map :flow/to (gen/vector gen/keyword))]
+       (gen/fmap #(merge v %) g)))))
+
+(defn true-flow-condition-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/return ::true-pred)
+           true-gen (gen/hash-map :flow/predicate g)]
+       (gen/fmap #(merge v %) true-gen)))))
+
+(defn false-flow-condition-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/return ::false-pred)
+           false-gen (gen/hash-map :flow/predicate g)]
+       (gen/fmap #(merge v %) false-gen)))))
+
+(defn short-circuit-flow-condition-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map :flow/short-circuit? (gen/return true))]
+       (gen/fmap #(merge v %) g)))))
+
+(defn exception-flow-condition-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map
+              :flow/thrown-exception? (gen/return true)
+              :flow/short-circuit? (gen/return true)
+              :flow/post-transform (gen/one-of
+                                    [(gen/return nil)
+                                     (gen/return ::post-transform)]))]
+       (gen/fmap #(merge v %) g)))))
+
+(defn retry-flow-condition-gen [base-gen]
+  (gen/bind
+   base-gen
+   (fn [v]
+     (let [g (gen/hash-map :flow/action (gen/return :retry))]
+       (gen/fmap #(merge v %) g)))))

 (deftest nil-flow-conditions
   "No flow condition routes to all downstream tasks"
@@ -47,16 +103,20 @@
   (checking
    "The matching flow condition limits the downstream selection"
    (times 50)
-   [[downstream flow-to] gen-tasks-and-subset]
+   [fcs (gen/vector (->> :a
+                         (flow-condition-gen)
+                         (flow-to-tasks-gen)
+                         (true-flow-condition-gen))
+                    1)
+    other-downstream-tasks (gen/vector gen/keyword)]
    (let [task :a
-         fcs [{:flow/from task
-               :flow/to flow-to
-               :flow/predicate ::true-pred}]
+         target-tasks (mapcat :flow/to fcs)
+         downstream (into other-downstream-tasks target-tasks)
          compiled (c/compile-fc-norms fcs task)
          results
          (t/route-data
           {:onyx.core/compiled-norm-fcs compiled} nil nil fcs downstream)]
-     (is (= (into #{} flow-to) (:flow results)))
+     (is (= (into #{} target-tasks) (:flow results)))
      (is (nil? (:action results))))))

 (deftest conj-downstream-tasks-together
@@ -77,68 +137,6 @@
           {:onyx.core/compiled-norm-fcs compiled} nil nil flow-conditions downstream)]
      (is (= (into #{} (mapcat :flow/to flow-conditions)) (:flow results)))
      (is (nil? (:action results))))))
-
-(def predicates
-  {true ::true-red
-   false ::false-pred})
-
-(defn flow-condition-gen [from-task]
-  (gen/hash-map
-   :flow/from (gen/return from-task)
-   :flow/to (gen/one-of [(gen/return :all) (gen/return :none) (gen/vector gen/keyword)])
-   :flow/exclude-keys (gen/vector gen/keyword)))
-
-(defn true-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return ::true-pred)
-           true-gen (gen/hash-map :flow/predicate g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn false-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return ::false-pred)
-           true-gen (gen/hash-map :flow/predicate g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn short-circuit-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return true)
-           true-gen (gen/hash-map :flow/short-circuit? g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn exception-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/hash-map
-              :flow/thrown-exception? (gen/return true)
-              :flow/short-circuit? (gen/return true)
-              :flow/post-transform (gen/one-of
-                                    [(gen/return nil)
-                                     (gen/return ::post-transform)]))]
-       (gen/fmap #(merge v %) g)))))
-
-(defn retry-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/hash-map :flow/action (gen/return :retry))]
-       (gen/fmap #(merge v %) g)))))
-
-
-(clojure.pprint/pprint
- (gen/sample
-  (->> :A
-       (flow-condition-gen)
-       (true-flow-condition-gen)
-       (exception-flow-condition-gen)
-       (retry-flow-condition-gen))))


add austin brepl runner

add austin brepl runner

--- src/clj/dokkaa_builder/core.clj
+++ src/clj/dokkaa_builder/core.clj
@@ -4,7 +4,9 @@
             [org.httpkit.server :refer [run-server]]
             [ring.middleware.reload :as reload]
             [dokkaa-builder.route :as route]
-            [dokkaa-builder.util :as util]))
+            [dokkaa-builder.util :as util]
+            [cemerick.austin :as austin]
+            [cemerick.austin.repls :as brepl]))

 (defonce server (atom nil))

@@ -31,3 +33,9 @@
 (defn -main [& args]
   (start-server (Integer. (or (env :port) "8080")))
   (println "Starting Server..."))
+
+;; connect to browser repl
+(when (util/in-dev?)
+  (defn cljs-repl []
+    (let [repl-env (reset! brepl/browser-repl-env (austin/repl-env))]
+      (brepl/cljs-repl repl-env))))


allow Unregistered S&W '35 to target an executive hosted on Worlds Plaza

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -419,10 +419,12 @@
    {:abilities
     [{:cost [:click 2] :req (req (some #{:hq} (:successful-run runner-reg)))
       :label "trash a Bioroid, Clone, Executive or Sysop" :prompt "Choose a card to trash"
-      :choices (req (filter #(and (:rezzed %)
-                                  (or (has? % :subtype "Bioroid") (has? % :subtype "Clone")
-                                      (has? % :subtype "Executive") (has? % :subtype "Sysop")))
-                            (mapcat :content (flatten (seq (:servers corp))))))
+      :choices (req (let [contents (mapcat :content (flatten (seq (:servers corp))))
+                          hosted (mapcat :hosted contents)]
+                      (filter #(and (:rezzed %)
+                                    (or (has? % :subtype "Bioroid") (has? % :subtype "Clone")
+                                        (has? % :subtype "Executive") (has? % :subtype "Sysop")))
+                               (concat hosted contents))))
       :msg (msg "trash " (:title target)) :effect (effect (trash target))}]}

    "Vigil"


Show details stays when using the filter

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -61,9 +61,10 @@
 (defn add-cards!
   "Add several cards to the application state"
   [cards]
-  (let [to-id-pair #(vector (:card-id %) %)]
+  (let [default-state {::show-details false}
+        to-gui-card #(vector (:card-id %) (merge % default-state))]
     (swap! app-state
-     #(update-in % [:cards] merge (map to-id-pair cards))
+     #(update-in % [:cards] merge (map to-gui-card cards))
   )))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -105,24 +106,22 @@
    }])

 (defn render-card
-  []
-  (let [show-details (r/atom false) ; TODO - Extract show details in set of card-id
-        toggle-details #(swap! show-details not)
-        title-style #(if % :div.card__title--is-open :div.card__title)]
-    (fn [card]
-      [:div.card
-       [:div {:style (card-side-color card)}]
-       [(title-style @show-details) {:on-click toggle-details} (:title card)]
-       (when @show-details
-         [:div.card__details
-          (:description card)
-          [render-tasks card]
-          [render-add-task card]
-         ])
+  [card]
+  (let [show-details (::show-details card)
+        toggle-details #(update-card! (update-in card [::show-details] not))
+        title-style (if show-details :div.card__title--is-open :div.card__title)]
+    [:div.card
+     [:div {:style (card-side-color card)}]
+     [title-style {:on-click toggle-details} (:title card)]
+     (when show-details
+       [:div.card__details
+        (:description card)
+        [render-tasks card]
+        [render-add-task card]
        ])
-    ))
+    ]))

-(defn render-list
+(defn render-column
   [status cards]
   [:div.list
    [:h1 (status->str status)]
@@ -134,7 +133,7 @@
   [cards]
   [:div.app
    (for [status [:backlog :under-dev :done]]
-     ^{:key status} [render-list status cards])
+     ^{:key status} [render-column status cards])
   ])

 (defn render-filter


Give the comic buttons unique id's too

Give the comic buttons unique id's too

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -54,11 +54,14 @@
   (let [comic-list (rf/subscribe [:comic-list])]
     (fn []
       (when-let [comic-list @comic-list]
-        [:ul (map (id-btn-for-callback
-                   #(.log js/console
-                          (str "You clicked the "
-                               (:id %)
-                               " button!"))) comic-list)]))))
+        [:ul (map (comp
+                   (id-btn-for-callback
+                    #(.log js/console
+                           (str "You clicked the "
+                                (:id %)
+                                " button!")))
+                   #(assoc % :id (:name %)))
+                  comic-list)]))))

 (defn comic-reader []
   (let [page (rf/subscribe [:page])]


slightly better error handling

slightly better error handling

--- src/cljs/dato/lib/web_peer.cljs
+++ src/cljs/dato/lib/web_peer.cljs
@@ -73,7 +73,10 @@
                             ;; TODO: proper error handling
                             (assert (= item (queue/pop! q)) "send-queue lock must be broken, we lost some data!")))
                         (catch js/Error e
-                          (utils/merror e)))
+                          (let [item (queue/pop! q)]
+                            ;; TODO: better error handling
+                            (utils/mlog "Item that broke things:" item)
+                            (utils/merror e))))
                       ;; TODO: potential for infinite loop here, if item isn't popped correctly
                       (recur (peek @q))))))
       ;; TODO: Need to check for empty queue and unlock queue in same operation


with-meta fix forces component to reinitialize

Hacky. Should investigate further.

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -134,7 +134,7 @@
 (defn hacker [id]
   [:div
    [:h2 "Hacker News"]
-   [render id]
+   [(with-meta render {}) id]
    ])

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


fix files overflow

fix files overflow

--- src/cljs/salava/file/ui/my.cljs
+++ src/cljs/salava/file/ui/my.cljs
@@ -168,7 +168,7 @@
         max-sizetext (if (not-empty max-size)
                        (str "(" (t :file/Maxfilesize) ": "  max-size ")")
                        "")]
-    [:div {:class "row flip"
+    [:div {:class "row wrap-grid"
            :id    "grid"}
      [:div {:class "col-xs-12 col-sm-6 col-md-4"
             :id "add-element"


handle the absence of global filters

handle the absence of global filters

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -116,14 +116,14 @@
               " ]"]
              [:div#parsets {:ref "parsets-div"}]]]))
   (did-update [_ _ _]
-              (let [filters ((:ref-state (om/get-shared owner)) :filters)
-                    local-combined-query (-> (om/get-state owner) :combined-query)
-                    combined-query (:combined-query filters)]
-                (if-not (= local-combined-query combined-query)
-                  (do
-                    (om/update-state! owner #(assoc % :combined-query combined-query))
-                    (do-parsets-agg owner)))
-                (om/observe owner filters)))
+              (if-let [filters ((:ref-state (om/get-shared owner)) :filters)]
+                (let [local-combined-query (-> (om/get-state owner) :combined-query)
+                      combined-query (:combined-query filters)]
+                  (if-not (= local-combined-query combined-query)
+                    (do
+                      (om/update-state! owner #(assoc % :combined-query combined-query))
+                      (do-parsets-agg owner)))
+                  (om/observe owner filters))))
   (did-mount [_]
              (let [{:keys [comm parsets-agg]} (om/get-state owner)
                    parsets-div (om/get-node owner "parsets-div")
@@ -142,10 +142,10 @@
                          (-> svg (.datum (clj->js parsets-data))
                              (.call (chart)))
                          (.ripple js/Waves (om/get-node owner "parsets-div"))))))
-               (let [filters ((:ref-state (om/get-shared owner)) :filters)
-                     combined-query (:combined-query filters)]
-                 (om/update-state! owner #(assoc % :combined-query combined-query))
-                 (om/observe owner filters))
+               (if-let [filters ((:ref-state (om/get-shared owner)) :filters)]
+                 (let [combined-query (:combined-query filters)]
+                   (om/update-state! owner #(assoc % :combined-query combined-query))
+                   (om/observe owner filters)))
                ))
   (will-unmount [_]
                 (let [{:keys [comm]} (om/get-state owner)]


New design commit.

New design commit.

--- src/cljs/town_client/state.cljs
+++ src/cljs/town_client/state.cljs
@@ -13,10 +13,12 @@
    :opinions (atom {})})

 (def neighborhoods
-  (atom {0 {:name "ladataan" :id 0 :prev nil :next nil}}))
+  (atom {0 {:name "ladataan" :respondents 0 :id 0 :prev nil :next nil}}))

 (def rankings
-  (atom (into {} (map (fn [pair] [(first pair) {}]) aggregates))))
+  (atom (into
+         {} (map (fn [pair] [(first pair) {}])
+                 aggregates))))

 (def current-neighborhood
   (atom {:genetive "Kenen"}))


Remove commented code on hash namespace.

--- src/clojure/buddy/core/hash.clj
+++ src/clojure/buddy/core/hash.clj
@@ -36,9 +36,6 @@
                              (factory))
    (instance? IFn alg) (alg)
    (instance? Digest alg) alg))
-
-;; (java.security.Security/addProvider
- ;; (org.bouncycastle.jce.provider.BouncyCastleProvider.))

 (defprotocol DigestType
   (make-digest [input algorithm] "Low level interface, always returns bytes"))


Use correct keyword namespaces

Use correct keyword namespaces

--- src/clojure/neko/tools/repl.clj
+++ src/clojure/neko/tools/repl.clj
@@ -68,10 +68,10 @@
 (defmacro start-nrepl-server
   "Expands into nREPL server initialization if conditions are met."
   [port other-args]
-  (when (or (not (::release-build *compiler-options*))
-            (::start-nrepl-server *compiler-options*))
-    (let [build-port (::nrepl-port *compiler-options*)
-          mware (list `quote (or (::nrepl-middleware *compiler-options*)
+  (when (or (not (:neko.init/release-build *compiler-options*))
+            (:neko.init/start-nrepl-server *compiler-options*))
+    (let [build-port (:neko.init/nrepl-port *compiler-options*)
+          mware (list `quote (or (:neko.init/nrepl-middleware *compiler-options*)
                                  cider-middleware))]
       `(let [port# (or ~port ~build-port 9999)]
          (apply start-repl ~mware :port port# ~other-args)


Move tool-not-found to own def

Move tool-not-found to own def

--- src/clojure/staircase/views.clj
+++ src/clojure/staircase/views.clj
@@ -1,7 +1,7 @@
 (ns staircase.views
   (:require [hiccup.form :refer :all]
             [clojure.string :as string]
-            [hiccup.def :as d]
+            [hiccup.def :refer (defelem)]
             [persona-kit.view :as pv])
   (:use [hiccup.core :only (html)]
         [hiccup.page :only (html5 include-css include-js)]
@@ -265,6 +265,20 @@
     (str "{{" model "}}")]
    [:input.form-control {:ng-show "editing" :ng-model model}]])

+(defelem tool-not-found []
+  [:div.alert.alert-danger
+   [:h3 "Error"]
+   [:p
+    " The required tool for this step could not be found. Check with the site
+    administrator to make sure that the "
+    [:code "{{step.tool}}"]
+    " tool is installed"]
+   (update-in (mail-to contact
+                       [:span
+                        [:i.fa.fa-envelope-o]
+                        " Send a grumpy email"])
+              [1 :class] (constantly "btn btn-default"))])
+
 (def history
   [:div.container-fluid.history-view
    [:div.row
@@ -311,18 +325,7 @@

     [:div.col-xs-12.slide-left
      {:ng-class "{'col-md-8': (!expanded && nextSteps.length), 'col-md-10': (!expanded && !nextSteps.length), 'col-md-offset-2': !expanded}"}
-     [:div.alert.alert-danger {:ng-show "error.status === 404"}
-      [:h3 "Error"]
-      [:p
-       " The required tool for this step could not be found. Check with the site
-       administrator to make sure that the "
-       [:code "{{step.tool}}"]
-       " tool is installed"]
-      (update-in (mail-to contact
-                          [:span
-                           [:i.fa.fa-envelope-o]
-                           " Send a grumpy email"])
-                 [1 :class] (constantly "btn btn-default"))]
+     (tool-not-found {:ng-show "error.status === 404"})
      [:div.current-step
       {:ng-hide "error.status === 404"
        :tool "tool"


Cleaning the derivative namespace

Cleaning the derivative namespace


add ids to notifications

add ids to notifications

--- src/cljs/clj_money/notifications.cljs
+++ src/cljs/clj_money/notifications.cljs
@@ -7,7 +7,8 @@
   ([message] (notify message :info))
   ([message severity]
    (swap! notifications #(conj % {:message message
-                                  :severity severity}))))
+                                  :severity severity
+                                  :id (random-uuid)}))))

 (defn success [message] (notify message :success))
 (defn info    [message] (notify message :info))
@@ -23,4 +24,5 @@
 (defn unnotify
   [notification]
   (swap! notifications (fn [notifications]
-                         (remove notifications #(= % notification)))))
+                         (remove #(= (:id %) (:id notification))
+                                 notifications))))


install a dom element to force loading

install a dom element to force loading

--- src/cljs/infinitelives/pixi/font.cljs
+++ src/cljs/infinitelives/pixi/font.cljs
@@ -4,9 +4,7 @@
             [infinitelives.utils.dom :as dom]
             [infinitelives.pixi.sprite :as sprite]
             [infinitelives.pixi.texture :as texture]
-            [PIXI])
-
-)
+            [PIXI]))

 (def printable-characters
   " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!?@#$%^&*()-=_+[]{};':\",.<>/`~\\|")
@@ -155,6 +153,13 @@
          (dom/set-attr! :href url))
      (aget (.getElementsByTagName js/document "link") 0))))

+(defn install-google-font-dom-anchor! [url]
+  (let [elem (dom/create-element :p)]
+    (dom/append! js/document.body
+                 (-> elem
+                     (dom/set-attr! :style "font-family: '...'")
+                     (dom/set-text! " ")))))
+
 (defn install-force-loading-font-div! [fontname]
   (let [el (dom/create-element :div)]
     (-> el


Minimise all but the first load tests

Minimise all but the first load tests

--- src/cljs/load_test_om/load_tests.cljs
+++ src/cljs/load_test_om/load_tests.cljs
@@ -1,18 +1,14 @@
 (ns load-test-om.load-tests
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
-            [goog.events :as events]
-            [goog.json :as gjson]
-            [clojure.set :refer [rename]]
-            [load-test-om.load-test :as load-test])
-  (:import (goog.net WebSocket EventType)))
+            [load-test-om.load-test :as load-test]))

 (defn load-tests [load-tests owner]
   (reify
     om/IRender
     (render [_]
-      (->> (vals load-tests)
-           (sort-by :id)
-           reverse
-           (om/build-all load-test/load-test)
-           (apply dom/ul nil)))))
+      (let [ordered (->> (vals load-tests) (sort-by :id) reverse)]
+        (apply dom/ul nil
+               (map #(om/build load-test/load-test % {:init-state {:minimised? (not= % (first ordered))}
+                                                      :key :id})
+                    ordered))))))


Fix wrong protocol check on wrap-authorization middleware.

--- src/clojure/buddy/auth/middleware.clj
+++ src/clojure/buddy/auth/middleware.clj
@@ -66,7 +66,7 @@
                   (fn? backend)
                   (fn->authorization-backend backend)

-                  (satisfies? proto/IAuthentication backend)
+                  (satisfies? proto/IAuthorization backend)
                   backend)]
     (fn [request]
       (try+


Cleaning up some methods

Cleaning up some methods

--- src/pando/core.clj
+++ src/pando/core.clj
@@ -100,6 +100,19 @@
       (do (println e)
           message))))

+(defn connect! [room-name user-name]
+  (fn [conn]
+    ;; handler for disconnects
+    (s/on-closed conn #(remove-user! room-name user-name))
+
+    ;; chatrooms bus -> websocket
+    (s/connect (bus/subscribe chatrooms room-name) conn)
+
+    ;; websocket -> chatrooms bus (kind of doseq for streams)
+    (s/consume
+     #(bus/publish! chatrooms room-name (pack-room-shift! user-name room-name %))
+     (s/throttle 10 conn))))
+
 ;; HELPERS

 (defn filter-empty-vals [params]
@@ -116,11 +129,27 @@
     (let [room (site/get-room @site room-name)]
       (f room))))

-(defn with-websocket-check [req exp]
+(defn with-websocket-check [exp req]
+  (println "websocket check")
   (d/let-flow [conn (d/catch (http/websocket-connection req) (fn [_] nil))]
       (if-not conn
         #'json-non-websocket-response)
-      (exp conn)))
+      #(exp conn)))
+
+(defn with-room-check [exp room-name]
+  (println "room check")
+  (do (when (not (site/room-exists? @site room-name))
+        (add-room! room-name))
+      exp))
+
+(defn with-user-check [exp room-name user-name]
+  (println "user check")
+  (do (when (not (rooms/user-exists? (site/get-room @site room-name) user-name))
+        (add-user! room-name user-name))
+    exp))
+
+(defn run-checks [exp]
+  (apply @exp []))

 ;;; HANDLERS

@@ -136,45 +165,21 @@
     (with-websocket-check req #(s/connect (bus/subscribe chatrooms room-name) %))

     :else
-    (do
-      (when (not (site/room-exists? @site room-name))
-        (add-room! room-name))
-      (when (not (rooms/user-exists? (site/get-room @site room-name) user-name))
-        (add-user! room-name user-name))
-      (with-websocket-check req
-        (fn [conn]
-          ;; handler for disconnects
-          (s/on-closed conn #(remove-user! room-name user-name))
-
-          ;; chatrooms bus -> websocket
-          (s/connect (bus/subscribe chatrooms room-name) conn)
-
-          ;; websocket -> chatrooms bus (kind of doseq for streams)
-          (s/consume
-           #(bus/publish! chatrooms room-name (pack-room-shift! user-name room-name %))
-           (s/throttle 10 conn)))))))
+    (run-checks
+     (-> (connect! room-name user-name)
+         (with-websocket-check req)
+         (with-room-check room-name)
+         (with-user-check room-name user-name)))))

 (defn reconnect-handler [req room-name user-name]
   (println "reconnecting" user-name "to" room-name)
   (if (is-observer? user-name)
-    (with-websocket-check req #(s/connect (bus/subscribe chatrooms room-name) %))
-    (do
-      (when (not (site/room-exists? @site room-name))
-        (add-room! room-name))
-      (when (not (rooms/user-exists? (site/get-room @site room-name) user-name))
-        (add-user! room-name user-name))
-      (with-websocket-check req
-        (fn [conn]
-          ;; handler for disconnects
-          (s/on-closed conn #(remove-user! room-name user-name))
-
-          ;; chatrooms bus -> websocket
-          (s/connect (bus/subscribe chatrooms room-name) conn)
-
-          ;; websocket -> chatrooms bus (kind of doseq for streams)
-          (s/consume
-           #(bus/publish! chatrooms room-name (pack-room-shift! user-name room-name %))
-           (s/throttle 10 conn)))))))
+    (with-websocket-check req #(s/connect (bus/subscribe chatrooms room-name) %))
+    (run-checks
+     (-> (connect! room-name user-name)
+         (with-websocket-check req)
+         (with-room-check room-name)
+         (with-user-check room-name user-name)))))

 (defn remove-user-handler [req]
   (let [user-name  (get-in req [:body "user-name"])
@@ -240,4 +245,5 @@

   (def s (http/start-server #'app-routes {:port 10001}))
   (.close s)
+
   )


Code Cleanup

Code Cleanup

--- src-cljs/flyer/messaging.cljs
+++ src-cljs/flyer/messaging.cljs
@@ -67,9 +67,8 @@

 (defn like-this-channel?
   [msg-channel callback-channel]
-  (some true?
-        [(= callback-channel (default-message :channel))
-         (= msg-channel callback-channel)]))
+  (or (= callback-channel (default-message :channel))
+      (= msg-channel callback-channel)))

 (defn like-this-topic?
@@ -97,13 +96,13 @@

 (defn ^:export like-this-flyer?
   "determines if the callback should be called based on the channel
-and the topic"
+  and the topic"
   [msg-topic msg-channel msg-origin
    callback-topic callback-channel callback-origin]
-  (every? true?
-          [(like-this-channel? msg-channel callback-channel)
-           (like-this-topic? msg-topic callback-topic)
-           (like-this-origin? msg-origin callback-origin)]))
+  (and
+   (like-this-channel? msg-channel callback-channel)
+   (like-this-topic? msg-topic callback-topic)
+   (like-this-origin? msg-origin callback-origin)))

 (defn ^:export subscribe
@@ -136,8 +135,8 @@
                 msg-channel (or (aget msg-js "channel") "FOREIGN")
                 msg-topic (or (aget msg-js "topic") (default-message :topic))
                 msg-data (or (aget msg-js "data") (default-message :data))
-                msg-origin (-> event .getBrowserEvent .-origin)
-                ]
+                msg-origin (-> event .getBrowserEvent .-origin)]
+
             (when (like-this-flyer? msg-topic msg-channel msg-origin topic channel origin)
               (callback msg-data msg-topic msg-channel msg-origin))))]
     (create-broadcast-listener js/window callback-wrapper)))