Better save-as behavior

Better save-as behavior

--- src/brevis/ui/core.clj
+++ src/brevis/ui/core.clj
@@ -112,10 +112,16 @@
   (config! f :content content)
   content)

-(defn select-file []
-  (let [chooser (JFileChooser.)]
+(defn select-file
+  "File selection dialog."
+  ([]
+    (let [chooser (JFileChooser.)]
     (.showDialog chooser nil "Select")
     (.getSelectedFile chooser)))
+  ([directory]
+    (let [chooser (JFileChooser. (file directory))]
+    (.showDialog chooser nil "Select")
+    (.getSelectedFile chooser))))

 (defn a-new [e]
   (let [selected (select-file)]
@@ -157,14 +163,18 @@

 (defn a-save [e]
   (let [tab-idx (current-tab-index)]
-    (spit (.getName (.getTabComponentAt (:tabbed-panel @editor-window) tab-idx))
+    (spit (.getToolTipTextAt (:tabbed-panel @editor-window) tab-idx)
           (get-text-from-tab tab-idx))))

 (defn a-save-as [e]
-  (when-let [selected (select-file)]
-    (let [tab-idx (.getSelectedIndex (:tabbed-panel @editor-window))]
-    (spit selected
-          (get-text-from-tab tab-idx)))))
+  (let [tab-idx (.getSelectedIndex (:tabbed-panel @editor-window))
+        current-filename (.getToolTipTextAt (:tabbed-panel @editor-window) tab-idx)
+        current-file (file current-filename)]
+    (when-let [selected (if current-filename
+                          (select-file (.getParent current-file))
+                          (select-file))]
+      (spit selected
+            (get-text-from-tab tab-idx)))))

 (defn a-exit  [e] (System/exit 0))
 (defn a-copy  [e] (.copy (:text-area (get-editor))))
@@ -613,6 +623,7 @@
     (reset! repl-output-window ro)
     (make-ui)
     (load-file (str "src" File/separator "brevis" File/separator "ui" File/separator "keybinds.clj"))
+    "Launched BrIDE"
     #_(add-content-tab-from-filename @current-filename params)
     #_(when-not (empty? (:current-filename @current-profile))
        (.setText (:text-area ew) (slurp @current-filename)))))


Extract the real exception out of the future.

--- src/circle/workers.clj
+++ src/circle/workers.clj
@@ -65,14 +65,14 @@
   "Block until the worker is done, and return it's result. Will only work once, next time it throws a NPE because the worker is no longer available"
   (dosync
    (let [as-int (int id)
-         fut (get @worker-store as-int)
-         ; TODO: when we dereference this, it may result in throwing the
-         ; exception that occurred within the future. We want the stack trace
-         ; that appears on error to be that stack-trace.
-         result (deref fut)]
-
+         fut (get @worker-store as-int)]
      (alter worker-store dissoc as-int)
-     result)))
+     ;; The actual clojure exception is wrapped in a ExecutionException.
+     (try
+       (let [result (deref fut)]
+         result)
+       (catch java.util.concurrent.ExecutionException e
+         (throw (.getCause e)))))))

 (defn worker-count []
   (dosync


rid may be the id of a real object, so don't remove it

--- src/clj/cglossa/db.clj
+++ src/clj/cglossa/db.clj
@@ -35,8 +35,6 @@
     (.getProperties v) $
     ;; Convert them to a Clojure hash map
     (into {} $)
-    ;; @rid is just a temporary key for the result object, so remove it
-    (dissoc $ "@rid")
     ;; Transform values as needed
     (walk/walk (fn [[k v]] [k (xform-val v)]) identity $)
     (walk/keywordize-keys $)))


Show event params in trace details

Show event params in trace details

--- src/day8/re_frame/trace.cljs
+++ src/day8/re_frame/trace.cljs
@@ -179,7 +179,9 @@
                 (.toFixed duration 1) " ms"]]
               (when show-row?
                 [:tr {:key (str id "-details")}
-                 [:td {:col-span 3} (with-out-str (pprint/pprint (dissoc tags :query-v :event :duration)))]]))))))
+                 [:td {:col-span 3} (with-out-str (pprint/pprint (if-let [params (:event tags)]
+                                                                   params
+                                                                   (dissoc tags :query-v :duration))))]]))))))

 (defn render-trace-panel []
   (let [filter-input               (r/atom "")


Reorder :nail_care:

Reorder :nail_care:


Work on implementing callback functionality for Clojure

--- src/beehive/future.clj
+++ src/beehive/future.clj
@@ -15,7 +15,7 @@
 (ns beehive.future
   (:import (clojure.lang IDeref IBlockingDeref IPending ILookup)
            (java.util.concurrent TimeUnit)
-           (net.uncontended.precipice Status RejectionReason)
+           (net.uncontended.precipice Status RejectionReason PrecipiceFunction)
            (net.uncontended.precipice.concurrent PrecipiceFuture)))

 (set! *warn-on-reflection* true)
@@ -85,4 +85,16 @@
   (->CLJRejectedFuture (get reject-enum->keyword reason)))

 (defn cancel [^CLJResilientFuture f]
-  (.cancel ^PrecipiceFuture (.future f) true))+  (.cancel ^PrecipiceFuture (.future f) true))
+
+(deftype CLJCallback [^PrecipiceFuture future fn]
+  PrecipiceFunction
+  (apply [this result]
+    (fn (:status future) result)))
+
+(defn on-complete [^CLJResilientFuture f fn]
+  (let [^PrecipiceFuture java-f (.future f)
+        cb (CLJCallback. java-f fn)]
+    (.onSuccess java-f cb)
+    (.onError java-f cb)
+    (.onTimeout java-f cb)))


Message queue: add :poll-reply key to monitor args

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -283,15 +283,17 @@
                     ndruns (or (car/as-long ndruns) 0)
                     eoq-backoff-ms* (if-not (fn? eoq-backoff-ms) eoq-backoff-ms
                                       (eoq-backoff-ms (inc ndruns)))
-                    opts* (assoc opts :eoq-backoff-ms eoq-backoff-ms*)]
-
-                (when monitor (monitor {:mid-circle-size mid-circle-size
-                                        :ndry-runs       ndruns}))
-
-                (let [poll-reply (wcar conn (dequeue qname opts*))]
-                  (if (= poll-reply "eoq-backoff")
-                    (when eoq-backoff-ms* (Thread/sleep eoq-backoff-ms*))
-                    (handle1 conn qname handler poll-reply))))
+                    opts* (assoc opts :eoq-backoff-ms eoq-backoff-ms*)
+                    poll-reply (wcar conn (dequeue qname opts*))]
+
+                (when monitor
+                  (monitor {:mid-circle-size mid-circle-size
+                            :ndry-runs       ndruns
+                            :poll-reply      poll-reply}))
+
+                (if (= poll-reply "eoq-backoff")
+                  (when eoq-backoff-ms* (Thread/sleep eoq-backoff-ms*))
+                  (handle1 conn qname handler poll-reply)))

               (catch Throwable t (timbre/fatal t "Worker error!") (throw t)))
             (when throttle-ms (Thread/sleep throttle-ms)))))
@@ -319,9 +321,9 @@
                      or returns {:status     <#{:success :error :retry}>
                                  :throwable  <Throwable>
                                  :backoff-ms <retry-or-dedupe-backoff-ms}.
-   :monitor        - (fn [{:keys [mid-circle-size ndry-runs]}]) called on each
-                     worker loop iteration. Useful for queue monitoring/logging.
-                     See also `monitor-fn`.
+   :monitor        - (fn [{:keys [mid-circle-size ndry-runs poll-reply]}]) called
+                     on each worker loop iteration. Useful for queue
+                     monitoring/logging. See also `monitor-fn`.
    :lock-ms        - Max time handler may keep a message before handler
                      considered fatally stalled and message re-queued. Must be
                      sufficiently high to prevent double handling.


Test *default-pmap-buffer*

Test *default-pmap-buffer*

--- test/com/climate/claypoole_test.clj
+++ test/com/climate/claypoole_test.clj
@@ -906,3 +906,22 @@
   (test-parallel-do
     "prun!"
     (fn [pool f s] (cp/prun! pool f s))))
+
+(deftest test-default-pmap-buffer
+  (testing "binding *default-pmap-buffer* has the desired effect"
+    ;; *default-pmap-buffer* is only used if we can't get the pool size for
+    ;; some reason.
+    (with-redefs [impl/get-pool-size (constantly nil)]
+      (let [start (promise)
+            started (atom [])
+            tasks (binding [cp/*default-pmap-buffer* 3]
+                    (cp/pmap 10
+                             (fn [i]
+                               (swap! started conj i)
+                               (deref start))
+                             (range 10)))]
+        (Thread/sleep 100)
+        ;; As requested, only 3 items have been started
+        (is (= @started (range 3)))
+        (deliver start true)
+        (dorun tasks)))))


use nrepl in repl only

use nrepl in repl only

--- profiles.clj
+++ profiles.clj
@@ -1,7 +1,10 @@
 {:user {
-        :plugins [[cider/cider-nrepl "0.9.1"]
+        :plugins [
                   [refactor-nrepl "1.1.0"]
                   [lein-midje "3.1.3"]]
         :dependencies [[org.clojure/tools.nrepl "0.2.7"]
                        [slamhound "1.5.5"]]
-        }}
+        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
+        }
+ :repl {:plugins [[cider/cider-nrepl "0.9.1"]]}
+ }


Fix kw-grouping test. Need more grouping peers and need to wait for peers to shutdown before checking output atom so that after-task-stop has been called.

--- test/onyx/peer/kw_grouping_test.clj
+++ test/onyx/peer/kw_grouping_test.clj
@@ -57,7 +57,7 @@
     :onyx/fn :onyx.peer.kw-grouping-test/sum-balance
     :onyx/type :function
     :onyx/group-by-key :name
-    :onyx/min-peers 1
+    :onyx/min-peers 2
     :onyx/flux-policy :kill
     :onyx/batch-size 40}

@@ -154,7 +154,7 @@
 (>!! in-chan :done)
 (close! in-chan)

-(def v-peers (onyx.api/start-peers 3 peer-group))
+(def v-peers (onyx.api/start-peers 4 peer-group))

 (onyx.api/submit-job
  peer-config
@@ -164,7 +164,12 @@

 (def results (take-segments! out-chan))

+(doseq [v-peer v-peers]
+  (onyx.api/shutdown-peer v-peer))
+
 (def out-val @output)
+
+(fact (not (empty? out-val)))

 ;;; Scan the key set, dropping any nils. Count the distinct keys.
 ;;; Do the same for the right hand side of the expression, but turn it into a set.
@@ -174,10 +179,6 @@

 (fact results => [:done])

-(doseq [v-peer v-peers]
-  (onyx.api/shutdown-peer v-peer))
-
 (onyx.api/shutdown-peer-group peer-group)

 (onyx.api/shutdown-env env)
-


See if mobile experience is better with mousedown event rather than click

--- src/ez_snake/core.cljs
+++ src/ez_snake/core.cljs
@@ -51,10 +51,12 @@

 (defn handle-buttons []
   (let [ch (chan)]
-    (doseq [id ["east" "west" "north" "south"]]
-      (listen ch (dom/getElement id) "click"))
+    (doseq [id ["east" "west" "north" "south"]
+            evt ["mousedown"]]
+      (listen ch (dom/getElement id) evt))
     (go-loop []
           (when-let [event (<! ch)]
+            ;(.log js/console event)
             (turn! (keyword (.. event -target -id)))
             (recur)))))


Preserve namespace metadata for 'ns

Preserve namespace metadata for 'ns

https://github.com/clojure/clojurescript/commit/edd35fa206d8285b2d671264347a1f0024631b13

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -392,7 +392,7 @@
         [metadata & args]  (if (map? (first args))
                              args
                              (cons {} args))
-
+        name (vary-meta name merge metadata)
         ns-opts (doto (desugar-ns-specs args form env)
                   (validate-ns-specs form env)
                   (populate-env name env))]


Refactoring function process-add-word

Refactoring function process-add-word

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -125,11 +125,16 @@
         (->> (clojure.string/split input #"[\s,\n]")
              (filter seq))))

+(defn read-string-parameter
+    [request parameter-name]
+    (if-let [parameter-value (-> (:params request) (get parameter-name))]
+            (clojure.string/trim parameter-value)))
+
 (defn process-add-word
-    "Add word provided by user (together with its description) to the blacklist."
-    [request title emender-page mode]
-    (let [word        (-> (:params request) (get "new-word") clojure.string/trim)
-          description (-> (:params request) (get "description") clojure.string/trim)
+    "Add word provided by user (together with its description) to the blacklist or into atomic typos."
+    [request title emender-page mode]
+    (let [word        (read-string-parameter request "new-word")
+          description (read-string-parameter request "description")
           proper-word (dictionary-interface/proper-word-for-blacklist? word)
           user-name (get-user-name request)
           message   (add-word-message word proper-word)]
@@ -342,9 +347,10 @@
             "/deleted-words-in-whitelist"    (process-deleted-words request title emender-page :whitelist)
             "/deleted-words-in-blacklist"    (process-deleted-words request title emender-page :blacklist)
             "/deleted-words-in-atomic-typos" (process-deleted-words     request title emender-page :atomic-typos)
-            "/add-word-to-blacklist"  (process-add-word      request title emender-page :blacklist)
+            "/add-word-to-blacklist"    (process-add-word      request title emender-page :blacklist)
             ;"/find-words"       (process-find-words    request)
-            "/add-words-to-whitelist" (process-add-words     request title emender-page :whitelist)
+            "/add-words-to-whitelist"   (process-add-words     request title emender-page :whitelist)
+            "/add-word-to-atomic-typos" (process-add-word     request title emender-page :atomic-typos)
             "/users-whitelist"        (process-user-list     request title :whitelist)
             "/users-blacklist"        (process-user-list     request title :blacklist)
             "/user-whitelist"         (process-user-info     request title :whitelist)


Only change needed (#1044)

Only change needed (#1044)

--- src/cljs/main/broadfcui/page/billing/billing_management.cljs
+++ src/cljs/main/broadfcui/page/billing/billing_management.cljs
@@ -80,7 +80,7 @@
                   :style table-style/table-light
                   :data-props {:row (fn [project] {:data-test-id (str (:projectName project) "-row")})}
                   :columns
-                  [{:id "Status Icon" :initial-width 16
+                  [{:id "Status Icon" :initial-width 32
                     :resizable? false :sortable? false :filterable? false
                     :column-data :creationStatus
                     :render


GAWB-1930: Billing table auto refreshes when new project added

--- src/cljs/main/broadfcui/page/billing/billing_management.cljs
+++ src/cljs/main/broadfcui/page/billing/billing_management.cljs
@@ -62,8 +62,10 @@

 (react/defc BillingProjectTable
   {:reload
-   (fn [{:keys [this]}]
-     (react/call :load-data this))
+   (fn [{:keys [this refs after-update]}]
+     (utils/cljslog "now we're up here")
+     (react/call :load-data this)
+     (after-update #((@refs "table") :refresh-rows)))
    :render
    (fn [{:keys [props state this]}]
      (cond


grep works

grep works

--- src/celestial/repl.clj
+++ src/celestial/repl.clj
@@ -27,57 +27,69 @@
 (defprotocol Repl
   "Basic shell like functions on Celestial model types"
   (ls [this] [this & opts])
-  (find [& opts])
-  (rm [& opts])
-  )
-
-
-(defrecord Systems [] Repl
-  (ls [this]
-    (with-admin (celestial.api.systems/systems-range 0 10)))
-  (ls [this & opts]
-   (let [m (apply hash-map opts)]
-     ))
-  (find [& opts])
-  (rm [& opts])
-  )
-
-(def systems (Systems.))
-
-(defrecord Types [] Repl
-  (ls [this]
-    {:types (map t/get-type (t/all-types))})
-  (ls [this & opts])
-  (find [& opts])
-  (rm [& opts]))
-
-(def types (Types.))
+  (find [this exp])
+  (rm [this items])
+  (grep [this items k v]))

 (defn select-keys* [m & paths]
   (into {} (map (fn [p] [(last p) (get-in m p)])) paths))

+(defn grep-system [k v [id system]]
+  (let [sub (select-keys* system [:owner] [:machine :hostname] [:machine :os] [:machine :ip])]
+    (= v (sub k))
+    ))
+
+(defrecord Systems [] Repl
+  (ls [this]
+    (with-admin
+      (let [systems (into [] (s/systems-for (celestial.api.systems/working-username)))]
+        [this {:systems (doall (map (juxt identity s/get-system) systems))}])))
+  (ls [this & opts]
+   (let [m (apply hash-map opts)]))
+  (find [this exp])
+  (rm [this systems]
+    (doseq [id (map first systems)]
+      (s/delete-system! (Integer/valueOf id))))
+  (grep [this systems k v]
+      [this {:systems (filter (partial grep-system k v) (systems :systems))}]))
+
+
+(defrecord Types [] Repl
+  (ls [this]
+    [this {:types (map t/get-type (t/all-types))}])
+  (ls [this & opts])
+  (find [this exp])
+  (rm [this types ])
+  (grep [this types k v])
+  )

 (defmulti pretty
-  (fn [m] (clojure.set/intersection (into #{} (keys m)) #{:systems :types})))
+  (fn [[_ m]] (clojure.set/intersection (into #{} (keys m)) #{:systems :types})))

 (defn render [[id m]]
  (-> m
    (select-keys* [:owner] [:machine :hostname] [:machine :os] [:machine :ip])
    (assoc :id id)))

-(defmethod pretty #{:systems} [{:keys [meta systems]}]
-  (let [formatter (format-columns blue-font [:right 10] "  " reset-font [:right 2] "  "[:right 5] "  " [:right 12] "  " :none)]
-    (write-rows *out* formatter [:hostname :id :owner :os :ip] (map render systems))))
-
-(defmethod pretty #{:systems} [{:keys [meta systems]}]
-  (let [formatter (format-columns blue-font [:right 10] "  " reset-font [:right 2] "  "[:right 5] "  " [:right 12] "  " :none)]
+(defmethod pretty #{:systems} [[_ {:keys [systems]}]]
+  (let [formatter (format-columns bold-white-font [:right 10] "  " reset-font [:right 2] "  "
+                     [:right 5] "  " [:right 12] "  " :none)]
     (write-rows *out* formatter [:hostname :id :owner :os :ip] (map render systems))))

-(defmethod pretty #{:types} [{:keys [types]}]
+(defmethod pretty #{:types} [[_ {:keys [types]}]]
   (let [formatter (format-columns bold-white-font [:right 10] "  " reset-font [:right 10] "  "[:right 20] :none)]
     (write-rows *out* formatter [:type (comp first keys) :description] types)))

+(defmacro |> [source fun]
+  (let [f (first fun) args (rest fun)]
+   `(let [[this# res#] ~source]
+      (~f this# res# ~@args))))
+
+
+(def systems (Systems.))
+(def types (Types.))
+
 ;; (pretty (ls types))
-;; (pretty (ls systems))
-
+;; (macroexpand-1 '(|> (ls systems) (grep :os :ubuntu-14.04 :four)))
+;; (pretty (|> (ls systems) (grep :os :ubuntu-14.04 )))


Search for public-id data by simple-path

We've already got a really fast index (64kb?) for these attributes by
simple-path (how Metis does it), so why not use the same fast index
here? The alternative is a 36GB index that gunks up the works.

--- src/vip/data_processor/db/postgres.clj
+++ src/vip/data_processor/db/postgres.clj
@@ -101,11 +101,20 @@
                     " ~ '" path "'"))))

 (defn find-value-for-simple-path [import-id simple-path]
-  (-> xml-tree-values
-      (korma/select
+  (-> (korma/select xml-tree-values
         (korma/fields :value)
         (korma/where {:results_id import-id
                       :simple_path (path->ltree simple-path)}))
+      first
+      :value))
+
+(defn find-single-xml-tree-value [results-id path]
+  (-> (korma/select xml-tree-values
+        (korma/fields :value)
+        (korma/where {:results_id results-id})
+        (korma/where (ltree-match xml-tree-values
+                                  :path
+                                  path)))
       first
       :value))

@@ -149,26 +158,16 @@
      :state state
      :import-id import-id}))

-(defn find-single-xml-tree-value [results-id path]
-  (-> (korma/select xml-tree-values
-        (korma/fields :value)
-        (korma/where {:results_id results-id})
-        (korma/where (ltree-match xml-tree-values
-                                  :path
-                                  path)))
-      first
-      :value))
-
 (defn get-xml-tree-public-id-data [{:keys [import-id] :as ctx}]
-  (let [state (find-single-xml-tree-value
+  (let [state (find-value-for-simple-path
                import-id
-               "VipObject.0.State.*{1}.Name.*{1}")
-        date (find-single-xml-tree-value
+               "VipObject.State.Name")
+        date (find-value-for-simple-path
               import-id
-              "VipObject.0.Election.*{1}.Date.*{1}")
-        election-type (find-single-xml-tree-value
+              "VipObject.Election.Date")
+        election-type (find-value-for-simple-path
                        import-id
-                       "VipObject.0.Election.*{1}.ElectionType.*{1}.Text.*{1}")]
+                       "VipObject.Election.ElectionType.Text")]
     {:date date
      :election-type election-type
      :state state


Cleanup

Cleanup

--- src/yetibot/core/util/command_info.clj
+++ src/yetibot/core/util/command_info.clj
@@ -65,41 +65,3 @@
       (throw (ex-info
                (str "Invalid command, only simple commands are supported")
                {:parsed parsed})))))
-
-(comment
-
-  (command-execution-info
-    "echo hi")
-
-  (command-execution-info
-    "head 2" {:opts ["one" "two" "three"]})
-
-  {:parse-tree [:expr [:cmd [:words "head" [:space " "] "2"]]]
-   :sub-commands (#"(\d+)" #'yetibot.core.commands.collections/head-n #".*" #'yetibot.core.commands.collections/head-1)
-   :matched-sub-cmd [["2" "2"] #'yetibot.core.commands.collections/head-n]
-   :command "head"
-   :command-args "2"}
-
-  {:parse-tree [:expr [:cmd [:words "head" [:space " "] "2"]]]
-   :sub-commands ["^head$" (#"(\d+)" #'yetibot.core.commands.collections/head-n #".*" #'yetibot.core.commands.collections/head-1)
-                  ]}
-
-  @hooks/hooks
-
-  [:expr [:cmd [:words "words"]] [:cmd [:words "bar"]]]
-
-  (get-in
-    [:expr [:cmd [:words "words"]] [:cmd [:words "bar"]]]
-    [1 1 1]
-    )
-
-  [:expr [:cmd [:words "bar"]]]
-
-  (->> [:expr [:cmd [:words "foo" [:space " "] [:expr [:cmd [:words "bar"]]]]]]
-       flatten
-       (filter (partial = :expr))
-       count
-       )
-
-
-  )


The Underway spoilers implementation

The Underway spoilers implementation

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -446,6 +446,14 @@
                                            card nil))}
                            card nil))}}}}

+   "Contract Killer"
+   {:advanceable :always
+    :abilities [{:label "Trash a connection" :cost [:click 1] :req (req (>= (:advance-counter card) 2))
+                 :choices {:req #(has? % :subtype "Connection")}
+                 :msg (msg "to trash " (:title target)) :effect (effect (trash card) (trash target))}
+                {:cost [:click 1] :req (req (>= (:advance-counter card) 2))
+                 :msg "do 2 meat damage" :effect (effect (trash card) (damage :meat 2 {:card card}))}]}
+
    "Corporate Shuffle"
    {:effect (effect (shuffle-into-deck :hand) (draw 5))}

@@ -584,6 +592,10 @@
    "Dedicated Technician Team"
    {:recurring 2}

+   "Defective Brainchips"
+   {:events {:pre-damage {:req (req (= target :brain)) :msg "to do 1 additional meat damage"
+                          :effect (effect (damage-bonus :brain 1))}}}
+
    "Déjà Vu"
    {:prompt "Choose a card to add to Grip" :choices (req (:discard runner))
     :msg (msg "add " (:title target) " to his Grip")
@@ -651,6 +663,15 @@

    "Duggars"
    {:abilities [{:cost [:click 4] :effect (effect (draw 10)) :msg "draw 10 cards"}]}
+
+   "Drive By"
+   {:choices {:req #(and (= (second (:zone %)) :remote)
+                         (= (last (:zone %)) :content)
+                         (not (:rezzed %)))}
+    :msg (msg "expose " (:title target) (when (#{"Asset" "Upgrade"} (:type target)) " and trash it"))
+    :effect (req (expose state side target)
+                 (when (#{"Asset" "Upgrade"} (:type target))
+                   (trash state side (assoc target :seen true))))}

    "Dyson Fractal Generator"
    {:recurring 1}
@@ -784,6 +805,12 @@
     [{:cost [:click 1] :msg "make a run on HQ"
       :effect (effect (run :hq {:replace-access
                                 {:msg (msg "reveal cards in HQ: " (map :title (:hand corp)))}} card))}]}
+
+   "Exposé"
+   {:advanceable :always
+    :abilities [{:label "Remove 1 bad publicity for each advancement token on Exposé"
+                 :msg (msg "remove " (:advance-counter card) " bad publicities")
+                 :effect (effect (trash card) (lose :bad-publicity (:advance-counter card)))}]}

    "Express Delivery"
    {:prompt "Choose a card to add to your Grip" :choices (req (take 4 (:deck runner)))


local sketches copy

local sketches copy

--- src/clj/inky/entry.clj
+++ src/clj/inky/entry.clj
@@ -254,26 +254,25 @@
       [:section.local-dev
        [:h3 "Sketching Locally"]
        [:p
-        "We've got a lein plugin to help you bring your tools to bear on inky sketches."
-        " First, add "
-        [:code "[lein-inky \"0.1.4\"]"]
-        " to your "
-        [:code "~/.lein/profiles.clj"]
-        ". Then:"]
+        "We've got a lein plugin to help you bring your tools to bear on inky sketches. Why do this? Short compile times and source-maps."]
        [:ol
+        [:li
+         "Add "
+         [:code "[lein-inky " common/inky-version "]"]
+         " to the plugins section of your user profile in "
+         [:code "~/.lein/profiles.clj"]]
         [:li
          "Fork "
          [:a {:href "https://gist.github.com/zk/8108564"} "this gist"]]
         [:li
          "Clone that gist locally: "
-         [:code "git clone git@gist.github.com/<gist-id>.git"]
-         "."]
+         [:code "git clone git@gist.github.com/<gist-id>.git"]]
         [:li [:code "cd <gist-id>"]]
         [:li "Run " [:code "lein inky"]]]
        [:p
         "You'll see something like the following output. Visit "
         [:a {:href "http://localhost:4659"} "http://localhost:4659"]
-        " and start editing your sketch w/ source maps."]
+        " and start editing your sketch."]
        [:p
         "When you're done editing, commit, push, and visit "
         [:code "http://inky.cc/<github-login>/<gist-id>"]


white

white


test remote

test remote

--- src/cljs/vko/core.cljs
+++ src/cljs/vko/core.cljs
@@ -18,7 +18,7 @@

 (defn template-page []
   [:div
-    [:button {:class "waves-effect waves-light btn red"} "test"]
+    [:button {:class "waves-effect waves-light btn black"} "test"]
          ] )

 (defn login-page []


CMR-6612 - moving to let instead of def

CMR-6612 - moving to let instead of def

--- ingest-app/test/cmr/ingest/test/services/jobs.clj
+++ ingest-app/test/cmr/ingest/test/services/jobs.clj
@@ -12,31 +12,32 @@

 (deftest email-granule-url-list-test
  "This tests the utility function that unpacts a list of urls and turns it into markdown"
- (def actual (jobs/email-granule-url-list
-   '("https://cmr.link/g1" "https://cmr.link/g2" "https://cmr.link/g3")))
- (def expected (str "* [https://cmr.link/g1](https://cmr.link/g1)\n"
-  "* [https://cmr.link/g2](https://cmr.link/g2)\n"
-  "* [https://cmr.link/g3](https://cmr.link/g3)"))
- (is (= actual expected)))
+ (let [actual (jobs/email-granule-url-list '("https://cmr.link/g1"
+        "https://cmr.link/g2"
+        "https://cmr.link/g3"))
+       expected (str "* [https://cmr.link/g1](https://cmr.link/g1)\n"
+        "* [https://cmr.link/g2](https://cmr.link/g2)\n"
+        "* [https://cmr.link/g3](https://cmr.link/g3)")]
+  (is (= actual expected))))

 (deftest create-email-test
  "This tests the HTML output of the email generation"
- (def actual (jobs/create-email-content
-  "cmr-support@earthdata.nasa.gov"
-  "someone@gmail.com"
-  '("https://cmr.link/g1" "https://cmr.link/g2" "https://cmr.link/g3")
-  {:metadata {:SubscriberId "tcherry"}}))
- (are [exp act] (= exp act)
-  (:to actual) "someone@gmail.com"
-  (:subject actual) "Email Subscription Notification"
-  (:type (first (:body actual))) "text/html"
-  (:content (first (:body actual))) (str "
You have subscribed to receive "
-   "notifications when the following query is updated:
"
-   "
Since this query was last run at, the following granules have been "
-   "added or updated:
"
-   "

https://cmr.link/g1

"
-   "https://cmr.link/g2

"
-   "https://cmr.link/g3

"
-   "
To unsubscribe from these notifications, or if you have any questions, "
-   "please contact us at "
-   "cmr-support@earthdata.nasa.gov.
")))
+ (let [actual (jobs/create-email-content
+   "cmr-support@earthdata.nasa.gov"
+   "someone@gmail.com"
+   '("https://cmr.link/g1" "https://cmr.link/g2" "https://cmr.link/g3")
+   {:metadata {:SubscriberId "tcherry"}})]
+  (are [exp act] (= exp act)
+   (:to actual) "someone@gmail.com"
+   (:subject actual) "Email Subscription Notification"
+   (:type (first (:body actual))) "text/html"
+   (:content (first (:body actual))) (str "
You have subscribed to receive "
+    "notifications when the following query is updated:
"
+    "
Since this query was last run at, the following granules have been "
+    "added or updated:
"
+    "

https://cmr.link/g1

"
+    "https://cmr.link/g2

"
+    "https://cmr.link/g3

"
+    "
To unsubscribe from these notifications, or if you have any questions, "
+    "please contact us at "
+    "cmr-support@earthdata.nasa.gov.
"))))


Added support for OPTIONS method

Added support for OPTIONS method

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

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


cjl - Formatting

cjl - Formatting

--- src/icfp2015/board.clj
+++ src/icfp2015/board.clj
@@ -56,7 +56,7 @@
   [{:keys [width height filled] :as board}]
   (let [row-is-filled (fn [i] (->> (range width)
                                    (map (fn [j] [i j]))
-                                   (every? #(contains? filled %))))
+                                   (every? (partial contains? filled))))
         filled-rows (filter row-is-filled (range height))
         partition-cells (fn [cells i] [(set (filter (fn [[ii _]] (< ii i)) cells))
                                        (set (filter (fn [[ii _]] (> ii i)) cells))])


RDC - Add interface for rotations in transition-board.

--- src/icfp2015/board.clj
+++ src/icfp2015/board.clj
@@ -64,6 +64,11 @@
   "Given a board and command, returns a new (possibly invalid) board"
   [board [command arg]]
   (case command
+    :rotate (let [unit-fn (apply unit/rotate (unit/rotations arg))]
+             { :width (:width board)
+               :height (:height board)
+               :filled (:filled board)
+               :current-unit (unit-fn (:current-unit board)) })
     :move (let [unit-fn (apply unit/translate (unit/translations arg))]
              { :width (:width board)
                :height (:height board)


fix wrong type-hint

fix wrong type-hint

--- src/java_time/data.clj
+++ src/java_time/data.clj
@@ -22,7 +22,7 @@
           (ZoneId/of)))

 (defn- zone-offset
-  ^ZoneId [x]
+  ^ZoneOffset [x]
   (cond-> x
           (string? x)
           (ZoneOffset/of)))


Add 'find-box to locate .voom-box parent directory.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -485,6 +485,17 @@
           :when (.contains ^String proj dep) ]
       proj)))

+(defn find-box
+  "Locates voom-box root starting from current working directory."
+  [& args]
+  (loop [path (File. (System/getProperty "user.dir"))]
+    (let [ppath (.getCanonicalPath path)
+          pfile (File. (str ppath "/.voom-box"))]
+      (when-not (= "/" ppath)
+        (if (.exists pfile)
+          path
+          (recur (.getParentFile path)))))))
+
 (defn box-add
   [proj & deps]
   (doseq [dep deps]


In ClojureScript, satisfies? is a macro

In ClojureScript, satisfies? is a macro

Thus `partial` can't be used with it.

--- modules/reitit-ring/src/reitit/ring/spec.cljc
+++ modules/reitit-ring/src/reitit/ring/spec.cljc
@@ -7,7 +7,7 @@
 ;; Specs
 ;;

-(s/def ::middleware (s/coll-of (partial satisfies? middleware/IntoMiddleware)))
+(s/def ::middleware (s/coll-of #(satisfies? middleware/IntoMiddleware %)))

 (s/def ::data
   (s/keys :req-un [::rs/handler]


Replace 'catch js/global.Error' with 'catch :default'

--- src/lt/objs/files.cljs
+++ src/lt/objs/files.cljs
@@ -286,7 +286,7 @@
        (if cb
          (cb fs)
          fs))
-     (catch js/global.Error e
+     (catch :default e
        (when cb
          (cb nil))
        nil))))
@@ -303,7 +303,7 @@
        (:files opts) (filter #(file? (join path %)) fs)
        (:dirs opts) (filter #(dir? (join path %)) fs)
        :else fs))
-    (catch js/global.Error e
+    (catch :default e
       nil)))

 (defn full-path-ls


[#2361] SVN_ASP_DOT_NET_HACK fix and cvs uppercase

--- src/lt/objs/files.cljs
+++ src/lt/objs/files.cljs
@@ -31,7 +31,7 @@

 (def ignore-pattern
   "Regex pattern consisting of files, folders, etc... to ignore."
-  #"(^\..*)|\.class$|target/|^svn$|^cvs$|\.git|\.pyc|~|\.swp|\.jar|.DS_Store")
+  #"(^\..*)|\.class$|target/|^[_.]svn$|^CVS$|\.git|\.pyc|~|\.swp|\.jar|.DS_Store")

 (declare files-obj)


Don't render sparkline if there's only one row

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -377,12 +377,17 @@
         aggregation (-> card :dataset_query :query :aggregation first)]
     (cond
       (or (= aggregation :rows)
-          (contains? #{:pin_map :state :country} (:display card)))        nil
-      (zero? row-count)                                                   :empty
-      (and (= col-count 1) (= row-count 1))                               :scalar
-      (and (= col-count 2) (datetime-field? col-1) (number-field? col-2)) :sparkline
-      (and (= col-count 2) (number-field? col-2))                         :bar
-      :else                                                               :table)))
+          (contains? #{:pin_map :state :country} (:display card))) nil
+      (zero? row-count)             :empty
+      (and (= col-count 1)
+           (= row-count 1))         :scalar
+      (and (= col-count 2)
+           (> row-count 1)
+           (datetime-field? col-1)
+           (number-field? col-2))   :sparkline
+      (and (= col-count 2)
+           (number-field? col-2))   :bar
+      :else                         :table)))

 (defn render-pulse-card
   [card data render-img include-title include-buttons]


sending emails using futures

sending emails using futures

--- src/ontrail/emails.clj
+++ src/ontrail/emails.clj
@@ -14,7 +14,7 @@

 (defn send-import-msg [user fres]
   (try
-    (.info logger (str (postal/send-message (import-message user fres))))
+    (future (.info logger (str (postal/send-message (import-message user fres)))))
     (catch Exception exception
        (.error logger (str exception))
        (stacktrace/print-stack-trace exception 100)
@@ -22,30 +22,28 @@

 (defn reg-body [user]
   (str "Hei " user "!\n\n"
-       "Tervetuloa käyttämään Ontrailia! Olemme vielä kehitysvaiheessa ja palvelua kehitetään jatkuvasti, "
-       "tällä hetkellä työn alla ovat viikkonäkymä, sekä kaverilistat. Palvelu saatetaan ensimmäiseen versioonsa "
+       "Tervetuloa käyttämään Ontrailia! Olemme vielä kehitysvaiheessa ja palvelun ominaisuuksia päivitetään jatkuvasti, "
+       "Tällä hetkellä työn alla ovat viikkonäkymä, sekä kaverilistat. Palvelu saatetaan ensimmäiseen versioonsa "
        "vuoden loppuun mennnessä\n\n"

        "Lenkkisi varmuuskopioidaan kahdesti päivässä. Halutessasi kaikki sinuun liittyvä data poistetaan "
        "palvelimelta tai siirretään haluamassasi muodossa sinulle takaisin.\n\n"

-       "Kehitystä voit myös seurata facebook-ryhmässä: https://www.facebook.com/groups/ontrail/ Palvelun teknisiin "
-       "yksityiskohtiin voin tutustua osoitteessa http://www.github.com/jrost/ontrail\n\n"
+       "Kehitystä voit myös seurata Facebook-ryhmässä: https://www.facebook.com/groups/ontrail/ Palvelun teknisiin "
+       "yksityiskohtiin voin tutustua osoitteessa http://www.github.com/jrosti/ontrail\n\n"

        "Jos palvelusta on jotain kysyttävää, niin voit lähettää sähköpostia suoraan meille tai liittyä facebook-ryhmään, "
        "josta voit seurata palvelun toimintaa, ominaisuuksia ja kehitystyötä lähemmin.\n\n"

        "Ystävällisin terveisin, Ontrail-tiimi"))
-

 (defn send-register-msg [user email]
     (try
-      (.info logger (str (postal/send-message {:from "ontrail@ontrail.net"
+      (future (.info logger (str (postal/send-message {:from "ontrail@ontrail.net"
                                                :to [email]
                                                :cc [admin]
-                                               :bcc "hanna_liisa@hotmail.com"
                                                :subject "Tervetuloa Ontrailiin!"
-                                               :body (reg-body user) })))
+                                               :body (reg-body user) }))))
       (catch Exception exception
         (.error logger (str exception))
         (stacktrace/print-stack-trace exception 100)


Do not dissoc comments in try-get-one

Do not dissoc comments in try-get-one

--- src/ontrail/search.clj
+++ src/ontrail/search.clj
@@ -143,7 +143,7 @@

 (defn try-get-one [id]
   (try
-    (dissoc (mc/find-one-as-map *db* EXERCISE {:_id id}) :comments)
+    (mc/find-one-as-map *db* EXERCISE {:_id id})
     (catch Exception exception
       (.error logger (str "Unable to get ex " id " " exception)))))


fixes for the most comments view

fixes for the most comments view

--- src/ontrail/unread.clj
+++ src/ontrail/unread.clj
@@ -32,8 +32,8 @@
   (ex/decorate-results user (filter (partial is-own? user) (get-unread-objs user))))

 (defn most-comments-oids []
-  (let [two-weeks-ago (time/minus (time/now) (time/days 21))]
-    (mc/aggregate "exercise" [{"$match" {:lastModifiedDate {"$gte" two-weeks-ago}}} {"$unwind" "$comments"} {"$group" {"_id" "$_id" "size" {"$sum" 1}}} {"$sort" {"size" -1}} {"$limit" 30}])))
+  (let [two-weeks-ago (time/minus (time/now) (time/days 30))]
+    (mc/aggregate "exercise" [{"$match" {:lastModifiedDate {"$gte" two-weeks-ago}}} {"$unwind" "$comments"} {"$group" {"_id" "$_id" "size" {"$sum" 1}}} {"$sort" {"size" -1}} {"$limit" 50}])))

 (defn most-comments [user]
   (ex/decorate-results user (map (comp find-exercise :_id) (most-comments-oids))))


Indication of the state of the parse tree (broken or not, aka having chimeras, or some unexpecteds)

--- src/paredit/parser.clj
+++ src/paredit/parser.clj
@@ -122,6 +122,9 @@
          :count count
          :content-cumulative-count combined
          :abstract-node abstract-node
+         :broken? (or (#{::unexpected :chimera} t)
+                      (some #{::unexpected :chimera} (cons t (map :tag parse-tree-children)))
+                      false)
          ;:tokens (tokens t parse-tree-children count)
          }))))


Replace EventSource just with WebSockets.

Because websockets are more widely supported that
server sent events (strange).

--- src/postal/client.cljs
+++ src/postal/client.cljs
@@ -3,11 +3,14 @@
             [promesa.core :as p]
             [beicon.core :as s]
             [goog.crypt.base64 :as b64]
+            [goog.events :as events]
             [httpurr.client :as http]
             [httpurr.status :as http-status]
             [httpurr.client.xhr :as xhr])
-  (:import goog.Uri.QueryData
-           goog.Uri))
+  (:import [goog.net WebSocket]
+           [goog.net.WebSocket EventType]
+           [goog.Uri QueryData]
+           [goog Uri Timer]))

 (def ^:private
   +default-headers+
@@ -139,30 +142,52 @@
 ;; EventSource
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defprotocol ISubscription
-  (-stream [_] "Get the stream")
-  (-close [_] "Close subscription"))
+(defn socket
+  ([client dest]
+   (socket client dest nil nil))
+  ([client dest data]
+   (socket client dest data nil))
+  ([client dest data {:keys [params] :or {params {}}}]
+   (let [req (prepare-request client data :get params)
+         uri (Uri. (:url req))]
+     (.setQuery uri (:query-string req))
+     (.setScheme uri (if (= (.getScheme uri) "http") "ws" "wss"))
+     (let [ws (WebSocket. (.toString uri))
+           timer (Timer. 5000)
+           busin (s/bus)
+           streamin (s/filter #(not= (:type %) :ping) busin)
+           busout (s/bus)]
+       (letfn [(on-ws-message [event]
+                 (let [frame (decode (.-data event))]
+                   (s/push! busin frame)))
+               (on-ws-error [event]
+                 (s/error! busin event)
+                 (.close ws))
+               (on-timer-tick [_]
+                 (let [frame {:type :ping}]
+                   (s/push! busout frame)))
+               (on-busout-value [msg]
+                 (let [data (encode msg)]
+                   (.send ws data)))
+               (on-busout-end []
+                 (.close ws))]
+         (s/on-end busout on-busout-end)
+         (s/on-value busout on-busout-value)

-(deftype Subscription [bus closed evs]
-  (-stream [_]
-    (s/to-observable bus))
-  (-close [_]
-    (.close evs)
-    (s/end! bus)))
+         (events/listen ws EventType.MESSAGE on-ws-message)
+         (events/listen ws EventType.ERROR on-ws-error)
+         (events/listen timer Timer.TICK on-timer-tick)
+
+         [streamin busout])))))

 (defn subscribe
-  [client dest data {:keys [params] :or {params {}}}]
-  (let [req (prepare-request client data :get params)
-        uri (Uri. (:url req))
-        bus (s/bus)]
-    (.setQuery uri (:query-string req))
-    (letfn [(on-message [event]
-              (let [message (decode (.-data event))]
-                (s/push bus message)))
-            (on-error [event]
-              (s/error! bus event))]
-      (let [evs (js/EventSOurce (.toString uri))]
-        (.addEventListener evs "open" on-open)
-        (.addEventListener evs "message" on-message)
-        (.addEventListener evs "error" on-error)
-        (Subscription. bus (atom false) evs)))))
+  ([client dest]
+   (subscribe client dest nil nil))
+  ([client dest data]
+   (subscribe client dest data nil))
+  ([client dest data {:keys [params] :or {params {}} :as opts}]
+   (let [[in out] (socket client dest data opts)
+         bus (s/bus)]
+     (s/subscribe in #(s/push! bus %) #(s/error! bus %) #(s/end! bus))
+     (s/on-end bus #(s/end! out))
+     bus)))


Fix NPE when from address is nil

Fix NPE when from address is nil

--- src/postal/message.clj
+++ src/postal/message.clj
@@ -176,6 +176,9 @@
                    :date :subject :body :message-id
                    :user-agent :sender]
          charset (or (:charset msg) default-charset)
+         from-address (let [{:keys [from sender]} msg]
+                        ^InternetAddress
+                        (make-address (or from sender) charset))
          jmsg (proxy [MimeMessage] [^Session session]
                 (updateMessageID []
                   (.setHeader
@@ -185,9 +188,8 @@
        (add-recipients! Message$RecipientType/TO (:to msg) charset)
        (add-recipients! Message$RecipientType/CC (:cc msg) charset)
        (add-recipients! Message$RecipientType/BCC (:bcc msg) charset)
-       (.setFrom (let [{:keys [from sender]} msg]
-                   ^InternetAddress
-                   (make-address (or from sender) charset)))
+       (cond-> from-address
+         (.setFrom from-address))
        (.setReplyTo (when-let [reply-to (:reply-to msg)]
                       (make-addresses reply-to charset)))
        (.setSubject (:subject msg) ^String charset)


add comment about usage

add comment about usage

--- src/babel/english/lab.clj
+++ src/babel/english/lab.clj
@@ -21,20 +21,29 @@
                                    }}} :model verbcoach)
          :from-language "it"))))

-(defn run2 [n]
-  (take (Integer. n)
-        (repeatedly
-         #(println
-           (fo
-            (generate {:synsem {:cat :verb
-                                :sem {:pred :top
-                                      :subj {:mod '()}
-                                      :obj {:pred :top
-                                            :mod '()}}}
-                     :modified false
-                       :head {:comp {:synsem {:pronoun false}}}})
-            :for "it")))))
+;; lein run -m babel.english.lab/run2 20 5
+(defn run2 [batches at-a-time]
+  (count
+   (take (Integer. batches)
+         (repeatedly
+          #(println
+            (clojure.string/join
+             "\n"
+             (pmap
+              (fn [x]
+                (fo
+                 (generate {:synsem {:cat :verb
+                                     :sem {:pred :top
+                                           :subj {:mod '()}
+                                           :obj {:pred :top
+                                                 :mod '()}}}
+                            :modified false
+                            :head {:comp {:synsem {:pronoun false}}}})
+                 :from-language "it"))
+              (range 0 (Integer. at-a-time)))))))))

+

+


[#1142] Use 75% color saturation for aggregation colors for now

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -140,7 +140,7 @@
                   'grey'
                 ELSE
                   concat(
-                    'hsl(%s, 100%%, ',
+                    'hsl(%s, 75%%, ',
                     100 - floor(
                       (
                         (aggregation::decimal - (select min(aggregation) from temp_table)::decimal) /


add project-opened? function

add project-opened? function

--- src/lt/plugins/ltinator.cljs
+++ src/lt/plugins/ltinator.cljs
@@ -18,6 +18,12 @@

 (defonce opened-project-path (atom nil))

+(defn- project-opened?
+  []
+  (if @opened-project-path
+    true
+    false))
+
 (defn- check-project-dir
   []
   (if (files/dir? @project-directory)
@@ -223,6 +229,6 @@
               :desc "Ltinator: Save project"
               :exec (fn []
                       (when (check-project-dir)
-                        (if @opened-project-path
+                        (if (project-opened?)
                           (save @opened-project-path (current-project))
                           (cmd/exec! :ltinator.save-project-as))))})


Remove generated names from Data-Specs

Remove generated names from Data-Specs

--- modules/reitit-spec/src/reitit/coercion/spec.cljc
+++ modules/reitit-spec/src/reitit/coercion/spec.cljc
@@ -39,19 +39,19 @@
   (into-spec [this name]))

 (defn- ensure-name [?name]
-  (or ?name (keyword "" (name (gensym "spec")))))
+  (or ?name (keyword "spec" (name (gensym "")))))

 (extend-protocol IntoSpec

   #?(:clj  clojure.lang.PersistentArrayMap
      :cljs cljs.core.PersistentArrayMap)
   (into-spec [this name]
-    (ds/spec (ensure-name name) this))
+    (dissoc (ds/spec (ensure-name name) this) :name))

   #?(:clj  clojure.lang.PersistentHashMap
      :cljs cljs.core.PersistentHashMap)
   (into-spec [this name]
-    (ds/spec (ensure-name name) this))
+    (dissoc (ds/spec (ensure-name name) this) :name))

   Maybe
   (into-spec [this name]


Use reify instead of proxy when possible

--- src/braid/server/util.clj
+++ src/braid/server/util.clj
@@ -40,8 +40,8 @@
         packer (.createPacker (MessagePack.) out)
         emitter (MsgpackEmitter. packer handlers)
         write-cache (fake-cache)
-        wrtr (proxy [Writer] []
-               (write [o]
+        wrtr (reify Writer
+               (write [_ o]
                  (try
                    (.emit emitter o false (.init write-cache))
                    (.flush out)


Loop is tests

Loop is tests

--- test/is/loop.cljs
+++ test/is/loop.cljs
@@ -1,5 +1,7 @@

 (ns tests.loop)
+
+(println "Loop tests")

 (defn recur?
     [value]
@@ -8,4 +10,13 @@
 (is (recur? (recur 1 2)))

 (let [result (recur 1 2 3)]
-    (is (= (.length result ()) 3))+    (is (= (.length result ()) 3))
+    (is (= (.get result (0)) 1))
+    (is (= (.get result (1)) 2))
+    (is (= (.get result (2)) 3)))
+
+(let [result (loop [x 0 y 3]
+            (if (> y 0)
+                (recur (+ x y) (- y 1))
+                x))]
+    (is (= result 6)))


fixed tests when running from lein

fixed tests when running from lein

--- test/io/aviso/rook/core_test.clj
+++ test/io/aviso/rook/core_test.clj
@@ -47,16 +47,16 @@
 (in-ns 'io.aviso.rook.core-test)

 (deftest namespace-middleware-test
-  (let [test-mw (is (namespace-middleware (fn [request] ((:test-fun request) request)) *ns*))
+  (let [test-mw (is (namespace-middleware (fn [request] ((:test-fun request) request)) 'io.aviso.rook.core-test))
              test-mw2 (is (namespace-middleware (fn [request] ((:test-fun request) request)) 'io.aviso.rook.core-test2))]
     (is (= {:arg-resolvers nil :metadata (meta #'io.aviso.rook.core-test/index) :function #'io.aviso.rook.core-test/index
-             :namespace *ns*}
+             :namespace 'io.aviso.rook.core-test}
             (test-mw (assoc (mkrequest :get "/?limit=100") :test-fun :rook))))
     (is (= {:arg-resolvers nil :metadata (meta #'io.aviso.rook.core-test/show) :function #'io.aviso.rook.core-test/show
-             :namespace *ns*}
+             :namespace 'io.aviso.rook.core-test}
             (test-mw (assoc (mkrequest :get "/123") :test-fun :rook))))
     (is (= {:arg-resolvers nil :metadata (meta #'io.aviso.rook.core-test/activate) :function #'io.aviso.rook.core-test/activate
-             :namespace *ns*}
+             :namespace 'io.aviso.rook.core-test}
             (test-mw (assoc (mkrequest :post "/123/activate") :test-fun :rook))))
     (is (nil? (test-mw (assoc (mkrequest :get "/123/activate") :test-fun :rook))))
     (is (nil? (test-mw (assoc (mkrequest :put "/") :test-fun :rook))))
@@ -68,7 +68,7 @@
            (test-mw2 (assoc (mkrequest :get "/?offset=100") :test-fun :rook))))))

 (deftest namespace-handler-test
-  (when-let [test-mw (is (namespace-middleware rook-handler *ns*))]
+  (when-let [test-mw (is (namespace-middleware rook-handler 'io.aviso.rook.core-test))]
     (is (= {:status 200 :body "limit=100"}
             (test-mw (mkrequest :get "/?limit=100"))))
     (is (= {:status 200 :body "id=123"}
@@ -86,7 +86,7 @@
                                                     (build-map-arg-resolver :test1 "TEST!" :test2 "TEST@" :test3 "TEST#" :request-method :1234)
                                                     (build-fn-arg-resolver :test4 (fn [request] (str "test$" (:uri request))))
                                                     #'request-arg-resolver)
-                           *ns*))]
+                           'io.aviso.rook.core-test))]
     (is (= "test1=TEST!,id=123,test2=TEST@,test3=TEST#,test4=test$/123/activate,request=13,meth=:1234"
           (test-mw (mkrequest :post "/123/activate?test1=1test"))))))

@@ -126,8 +126,8 @@
                                                                   rook-handler)
                                                                   'io.aviso.rook.core-test2))
                                            rook-handler)
-                                         *ns*)))
-        test-mw2 (is (namespace-handler "/merchant" *ns*
+                                         'io.aviso.rook.core-test)))
+        test-mw2 (is (namespace-handler "/merchant" 'io.aviso.rook.core-test
                        (compojure/GET "/test" [] {:body "test!"})
                        (namespace-handler "/:id/activate" 'io.aviso.rook.core-test2
                          (namespace-handler "/:key" 'io.aviso.rook.core-test3))))


Fix duplicate tables in DBs without schemas :disappointed: #1633

--- src/metabase/driver/sync.clj
+++ src/metabase/driver/sync.clj
@@ -78,7 +78,6 @@
   (sync-database-active-tables! driver (for [table (sel :many Table, :db_id (:id database) :active true)]
                                          ;; replace default delays with ones that reuse database (and don't require a DB call)
                                          (assoc table :db (delay database)))))
-

 (defn- -sync-database! [driver database]
   (let [active-tables      (driver/active-tables driver database)


More version checks

More version checks

--- src/midje/util/ecosystem.clj
+++ src/midje/util/ecosystem.clj
@@ -1,6 +1,7 @@
 (ns ^{:doc "Environmental factors."}
   midje.util.ecosystem
   (:require [clojure.string :as str]
+            midje.clojure.backwards-compatibility
             [leiningen.core.project :as project]))

 (def issues-url "https://github.com/marick/Midje/issues")
@@ -20,6 +21,14 @@

 (defmacro when-1-3+ [& body]
   (when-not (= 2 (:minor *clojure-version*))
+    `(do ~@body)))
+
+(defmacro when-1-3- [& body]
+  (when (< (:minor *clojure-version*) 4)
+    `(do ~@body)))
+
+(defmacro when-1-4+ [& body]
+  (when (>= (:minor *clojure-version*) 4)
     `(do ~@body)))

 (defmacro unless-1-2-0


add ^:export to init so it doesn't get munged in advanced compile

--- src/chat/client/core.cljs
+++ src/chat/client/core.cljs
@@ -9,7 +9,7 @@

 (enable-console-print!)

-(defn init []
+(defn ^:export init []
   (.addEventListener js/document "visibilitychange"
                 (fn [e] (store/set-window-visibility! (= "visible" (.-visibilityState js/document)))))
   (sync/start-router!))


Revert "Fix movable?"

Revert "Fix movable?"

This reverts commit d9207eef0420e763250e2c40f464e6fcc8a8e0ab.

--- src/chessground/data.cljs
+++ src/chessground/data.cljs
@@ -32,9 +32,7 @@

 (defn movable? [state orig]
   (when-let [piece (chess/get-piece (:chess state) orig)]
-    (or (and
-          (= (-> state :movable :color) "both")
-          (= (:turn-color state) (:color piece)))
+    (or (= (-> state :movable :color) "both")
         (= (-> state :movable :color)
            (:turn-color state)
            (:color piece)))))


make down-chan a file-scope var that can be written to by other input methods

--- src/client/game/core.cljs
+++ src/client/game/core.cljs
@@ -95,7 +95,16 @@
 (def quit-chan nil)

 ; required for pausing/resuming the gravity routine
+(declare go-go-gravity!)
+
 (def stop-grav (chan))
+(defn stop-gravity! []
+  (put! stop-grav 0))
+
+(defn refresh-gravity! []
+  (stop-gravity!)
+  (go-go-gravity!))
+

 (def battle
   "Boolean flag signaling whether we are in solo or battle mode."
@@ -116,6 +125,24 @@
 (def music-playing?
   "Boolean flag signaling if the music is playing or not"
   (atom false))
+
+;;------------------------------------------------------------------------------
+;; Piece Control Throttling
+;;------------------------------------------------------------------------------
+
+; These channels can received boolean signals indicating on/off status.
+; Duplicate signals are ignored with the (dedupe) transducer.
+(def move-down-chan (chan 1 (dedupe)))
+
+(defn go-go-control-soft-drop!
+  "Monitor move-down-chan to update the gravity speed."
+  []
+  (go-loop []
+    (let [[value c] (alts! [quit-chan move-down-chan])]
+      (when (= c move-down-chan)
+        (swap! state assoc :soft-drop value)
+        (refresh-gravity!)
+        (recur)))))

 ;;------------------------------------------------------------------------------
 ;; State Monitor
@@ -208,9 +235,6 @@
     (doseq [y (reverse (range n-rows))]
       (<! (timeout 10))
       (swap! state assoc-in [:board y] (game-over-row)))))
-
-(declare go-go-gravity!)
-(declare stop-gravity!)

 (defn spawn-piece!
   "Spawns the given piece at the starting position."
@@ -366,16 +390,6 @@
       (when (= c time-)
         (apply-gravity!)
         (recur)))))
-
-(defn stop-gravity!
-  []
-  (put! stop-grav 0))
-
-(defn refresh-gravity!
-  []
-  (stop-gravity!)
-  (go-go-gravity!))
-

 ;;------------------------------------------------------------
 ;; Input-driven STATE CHANGES
@@ -510,9 +524,9 @@
                      nil)
                    (when (not @paused?)
                      (case (key-name e)
-                       :down  (put! down-chan true)
                        :left  (try-move! -1 0)
                        :right (try-move!  1 0)
+                       :down  (put! move-down-chan true)
                        :space (hard-drop!)
                        :up    (try-rotate!)
                        nil))
@@ -521,7 +535,7 @@
         key-up (fn [e]
                  (when-not (:quit @state)
                    (case (key-name e)
-                     :down  (put! down-chan false)
+                     :down  (put! move-down-chan false)
                      ;:shift (toggle-record!)
                      nil)))]

@@ -574,6 +588,8 @@
   (size-canvas! "mainGameCanvas" empty-board cell-size rows-cutoff)
   (size-canvas! "nextPieceCanvas" (next-piece-board) cell-size)

+  (go-go-control-soft-drop!)
+
   (try-spawn-piece!)
   (add-key-events)
   (go-go-draw!)


Test clean-up: deleting all nodes involved in a relationship

--- test/tropefest/test/db_nodes.clj
+++ test/tropefest/test/db_nodes.clj
@@ -11,14 +11,9 @@

 (defn wipe-test-db []
   (let [conn (get-test-connection)]
-    (cy/tquery conn "MATCH (n)-[r]-() DELETE n,r")          ; Delete notes with relationships
+    (cy/tquery conn "MATCH (n)-[r]-(m) DELETE n,r,m")       ; Delete notes with relationships
     (cy/tquery conn "MATCH (n) DELETE n")                   ; Delete singletons
     ))
-
-
-(deftest test-query-nodes-when-empty
-  (is (= (count (query-nodes-to-crawl (get-test-connection) 100)) 0))
-  (is (= (query-nodes-to-crawl (get-test-connection) 100) '())))

 (deftest test-create-node


source maps work with incremental compilation now

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -14,8 +14,10 @@
             [clojure.string :as string]
             [clojure.tools.reader :as reader]
             [cljs.tagged-literals :as tags]
-            [cljs.analyzer :as ana])
-  (:import java.lang.StringBuilder))
+            [cljs.analyzer :as ana]
+            [cljs.source-map :as sm])
+  (:import java.lang.StringBuilder
+           java.io.File))

 (def js-reserved
   #{"abstract" "boolean" "break" "byte" "case"
@@ -825,6 +827,9 @@
          (ana/analyze-file "cljs/core.cljs"))
        ~@body))

+(defn url-path [^File f]
+  (.getPath (.toURL (.toURI f))))
+
 (defn compile-file*
   ([src dest] (compile-file* src dest nil))
   ([src dest opts]
@@ -849,20 +854,32 @@
                      (if (= (:op ast) :ns)
                        (recur (rest forms) (:name ast) (merge (:uses ast) (:requires ast)))
                        (recur (rest forms) ns-name deps))))
-               (merge
-                 {:ns (or ns-name 'cljs.user)
-                  :provides [ns-name]
-                  :requires (if (= ns-name 'cljs.core)
-                              (set (vals deps))
-                              (set
-                                (remove nil?
-                                  (conj (set (vals deps)) 'cljs.core
-                                    (when ana/*track-constants* 'constants-table)))))
-                  :file dest
-                  :source-file src
-                  :lines @*cljs-gen-line*}
-                 (when (:source-map opts)
-                   {:source-map @*cljs-source-map*})))))))))
+               (do
+                 (when (and (:source-map opts)
+                            (= (:optimizations opts) :none))
+                   (let [sm-file (io/file (str (.getPath ^java.io.File dest) ".map"))]
+                     (emits "\n//@ sourceMappingURL=" (.getName sm-file))
+                     (spit sm-file
+                       (sm/encode {(url-path src) @*cljs-source-map*}
+                         {:lines (+ @*cljs-gen-line* 2)
+                          :file  (url-path dest)}))))
+                 (merge
+                   {:ns (or ns-name 'cljs.user)
+                    :provides [ns-name]
+                    :requires (if (= ns-name 'cljs.core)
+                                (set (vals deps))
+                                (set
+                                  (remove nil?
+                                    (conj (set (vals deps)) 'cljs.core
+                                      (when ana/*track-constants* 'constants-table)))))
+                    :file dest
+                    :source-file src
+                    :lines (+ @*cljs-gen-line*
+                             (if (and (:source-map opts)
+                                   (= (:optimizations opts) :none))
+                               2 0))}
+                   (when (:source-map opts)
+                     {:source-map @*cljs-source-map*}))))))))))

 (defn requires-compilation?
   "Return true if the src file requires compilation."


Updated helmsman definition to not have all routes nested under "/".

--- src/clj/traveler/core.clj
+++ src/clj/traveler/core.clj
@@ -45,15 +45,15 @@
    ^{:name "Traveler"
      :id :traveler/root
      :main-menu true}
-   [:any "/" dash-redirect
-    ^{:name "Dashboard" :id :traveler/dashboard}
-    [:any "/dashboard" (:dashboard liberator-resources)]
-    ^{:name "Manage Users" :id :traveler/users}
-    [:any "/users" (:users liberator-resources)]
-    ^{:name "Manage User" :id :traveler/user}
-    [:any "/user/:id-sk" (:user liberator-resources)]
-    ^{:name "View System" :id :traveler/system}
-    [:any "/system" (:system liberator-resources)]]
+   [:any "/" dash-redirect]
+   ^{:name "Dashboard" :id :traveler/dashboard}
+   [:any "/dashboard" (:dashboard liberator-resources)]
+   ^{:name "Manage Users" :id :traveler/users}
+   [:any "/users" (:users liberator-resources)]
+   ^{:name "Manage User" :id :traveler/user}
+   [:any "/user/:id-sk" (:user liberator-resources)]
+   ^{:name "View System" :id :traveler/system}
+   [:any "/system" (:system liberator-resources)]
    (into [:context "/api"] api-routes)
    ;;middleware
    [wrap-params]


Make SegmentContainers contain edges instead of Segments

Previously, Segments seemed to be a useful abstraction, but they ended
up only containing single Edges. Apparently this section of the code was
forgotten when the change from Segment -> Edge was made

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -14,7 +14,6 @@
 (defrecord Edge [src dest characters])
 (defrecord Layer [id duration nodes])
 (defrecord SegmentContainer [segments])
-(defrecord Segment [edge])
 (defrecord AccumulatorNode [weight node-edges is-seg-c])

@@ -300,9 +299,9 @@
                   (mapcat #(if (instance? SegmentContainer %)
                              (:segments %)
                              [%]))
-                  (map #(if (and (instance? Segment %)
-                                 (contains? qs (-> % :edge :dest)))
-                          (-> % :edge :dest)
+                  (map #(if (and (instance? Edge %)
+                                 (contains? qs (:dest %)))
+                          (:dest %)
                           %)))
         with-qs (loop [f flat
                        seg-c (take 1 segment-containers)
@@ -312,7 +311,7 @@
                       layer
                       (conj layer seg-c))
                     (let [item (first f)]
-                      (if (instance? Segment item)
+                      (if (instance? Edge item)
                         (recur (rest f) (update-in seg-c [:segments] conj item) layer)
                         (if (empty? (:segments seg-c))
                           (recur (rest f) seg-c (conj layer item))


git weirdness, changed genomes

git weirdness, changed genomes

--- src/cljs/neat/genome.cljs
+++ src/cljs/neat/genome.cljs
@@ -14,7 +14,7 @@

 (defn genome
   ([settings] (genome settings default-mutate))
-  ([settings mutates] (mutate (base settings mutates))))
+  ([settings mutates] (mutates (base settings mutates))))

 (defn coin-flip []
   (rand-nth [true false]))


Tests for auth.handlers.authenticate.

Tests for auth.handlers.authenticate.

--- test/lunchlotto/auth/handlers_test.clj
+++ test/lunchlotto/auth/handlers_test.clj
@@ -111,3 +111,13 @@
       (let [resp (handlers/confirm-user (assoc-in valid-params [:params :location] nil))]
         (is (= 400 (:status resp)))
         (is (contains (:body resp) "location must be present"))))))
+
+(deftest authenticate
+  (testing "successful authentication"
+    (with-redefs [models/authenticate-user (fn [_ _ _] {:id "abc-123"})]
+      (let [resp (handlers/authenticate {:username "jdoe" :password "secret"})]
+        (is (= {:roles #{:lunchlotto.auth.handlers/user} :username "jdoe" :id "abc-123"} resp)))))
+  (testing "invalid credentials"
+    (with-redefs [models/authenticate-user (fn [_ _ _])]
+      (let [resp (handlers/authenticate {})]
+        (is (nil? resp))))))


RS + AB | 179 | Fix test

RS + AB | 179 | Fix test

--- test/mooncake/integration/db/mongo.clj
+++ test/mooncake/integration/db/mongo.clj
@@ -9,7 +9,7 @@
 (defn test-fetch [database]
   (fact {:midje/name (str (type database) " -- creating mongo store from mongo uri creates a MongoDatabase which can be used to store-with-id! and fetch")}
         (mongo/store-with-id! database collection-name :some-index-key {:some-index-key "barry" :some-other-key "other"})
-        (mongo/fetch database collection-name "barry" true) => {:some-index-key "arry" :some-other-key "other"}
+        (mongo/fetch database collection-name "barry" true) => {:some-index-key "barry" :some-other-key "other"}
         (mongo/fetch database collection-name "barry" false) => {"some-index-key" "barry" "some-other-key" "other"}))

 (defn test-store-with-id [database]


Correct deprecation version for compojure.handler

--- src/compojure/handler.clj
+++ src/compojure/handler.clj
@@ -2,7 +2,7 @@
   "Functions to create Ring handlers from routes.

   This namespace has been DEPRECATED in favor of the ring-defaults library."
-  {:deprecated "1.3"}
+  {:deprecated "1.2"}
   (:use [ring.middleware params
                          keyword-params
                          nested-params
@@ -22,7 +22,7 @@
     - wrap-params
     - wrap-nested-params
     - wrap-keyword-params"
-  {:deprecated "1.3"}
+  {:deprecated "1.2"}
   [routes]
   (-> routes
       wrap-keyword-params
@@ -43,7 +43,7 @@
   A map of options may also be provided. These keys are provided:
     :session   - a map of session middleware options
     :multipart - a map of multipart-params middleware options"
-  {:deprecated "1.3"}
+  {:deprecated "1.2"}
   [routes & [opts]]
   (-> (api routes)
       (with-opts wrap-multipart-params (:multipart opts))


Get rid of date object from task

Get rid of date object from task

--- src/exploud/asgard.clj
+++ src/exploud/asgard.clj
@@ -10,6 +10,7 @@
 (def tp (at-at/mk-pool))

 (def asgard-date-formatter (fmt/formatter "YYYY-MM-dd_HH:mm:ss"))
+(def date-formatter (fmt/formatters :date-time))

 (def asgard-url
   (env :service-asgard-url))
@@ -73,11 +74,11 @@

 (defn- split-log-message [log]
   (let [[date message] (clojure.string/split log #" " 2)]
-    {:date (fmt/parse asgard-date-formatter date) :message message}))
+    {:date (fmt/unparse date-formatter (fmt/parse asgard-date-formatter date)) :message message}))

-(defn- munge-task [{:keys [log] :as task}]
+(defn- munge-task [task]
   "Converts an Asgard task to a desired form"
-  (merge task {:log (map #(split-log-message %) log)}))
+  (update-in task [:log] (map #(split-log-message %))))

 (defn task [region run-id workflow-id]
   "Retrives information about a task from Asgard"


whitespace

whitespace

--- src/corpus_utils/text.clj
+++ src/corpus_utils/text.clj
@@ -12,7 +12,7 @@

 (defn convert-half-to-fullwidth
   [^String s]
-    (.transliterate ^Transliterator half-to-fullwidth s))
+  (.transliterate ^Transliterator half-to-fullwidth s))

 (defn normalize-nfkc
   [^String s]


btset removed type hints

btset removed type hints

--- src/datascript/btset.cljs
+++ src/datascript/btset.cljs
@@ -3,46 +3,42 @@

 (declare BTSet Node LeafNode)

-(def ^:const ^number min-len 64)
-(def ^:const ^number max-len 128)
-(def ^:const ^number level-shift (->> (range 31 -1 -1)
+(def ^:const min-len 64)
+(def ^:const max-len 128)
+(def ^:const level-shift (->> (range 31 -1 -1)
                               (filter #(bit-test max-len %))
                               first
                               inc))
-(def ^:const ^number path-mask (dec (bit-shift-left 1 level-shift)))
-(def ^:const ^number empty-path 0)
+(def ^:const path-mask (dec (bit-shift-left 1 level-shift)))
+(def ^:const empty-path 0)
 (def ^:dynamic *cmp*)

-(defn ^number path-get [^number path
-                        ^number level]
+(defn path-get [path level]
   (bit-and path-mask
            (unsigned-bit-shift-right path level)))

-(defn ^number path-set [^number path
-                        ^number level
-                        ^number idx]
+(defn path-set [path level idx]
   (bit-or path
           (bit-shift-left idx level)))

-(defn eq ^boolean [^number a
-                   ^number b]
+(defn eq [a b]
   (== 0 (*cmp* a b)))

-(defn ^number half [^number x]
+(defn half [x]
   (fix (/ x 2)))

-(defn ^number binary-search [^array arr ^number l ^number r k]
+(defn binary-search [arr l r k]
   (if (<= l r)
     (let [m   (half (+ l r))
           mk  (aget arr m)
-          cmp ^number (*cmp* mk k)]
+          cmp (*cmp* mk k)]
       (cond
         (neg? cmp) (recur arr (inc m) r k)
         (pos? cmp) (recur arr l (dec m) k)
         :else m))
     l))

-(defn ^number lookup-exact [^array arr key]
+(defn lookup-exact [arr key]
   (let [arr-l (alength arr)
         idx   (binary-search arr 0 (dec arr-l) key)]
     (if (and (< idx arr-l)
@@ -50,20 +46,20 @@
       idx
       -1)))

-(defn ^number lookup-range [^array arr key]
+(defn lookup-range [arr key]
   (let [arr-l (alength arr)
         idx   (binary-search arr 0 (dec arr-l) key)]
     (if (== idx arr-l)
       -1
       idx)))

-(defn ^number lookup-insert-leaf [^array arr key]
+(defn lookup-insert-leaf [arr key]
   (binary-search arr 0 (- (alength arr) 1) key))

-(defn ^number lookup-insert-node [^array arr key]
+(defn lookup-insert-node [arr key]
   (binary-search arr 0 (- (alength arr) 2) key))

-(defn ^number -seek [set key]
+(defn -seek [set key]
   (loop [node  (.-root set)
          path  empty-path
          level (.-shift set)]
@@ -74,18 +70,13 @@
                (path-set path level idx)
                (- level level-shift))))))

-(defn ^number seek [set key]
+(defn seek [set key]
   (binding [*cmp* (.-comparator set)]
     (-seek set key)))

 ;; Array operations

-(defn ^array cut-n-splice [^array  arr
-                           ^number cut-from
-                           ^number cut-to
-                           ^number splice-from
-                           ^number splice-to
-                           ^array  xs]
+(defn cut-n-splice [arr cut-from cut-to splice-from splice-to xs]
   (let [arr-l   (alength arr)
         xs-l    (alength xs)
         l1      (- splice-from cut-from)
@@ -101,24 +92,18 @@
     new-arr))

 (defn cut
-  (^array [^array arr ^number cut-from]
+  ([arr cut-from]
     (.slice arr cut-from))
-  (^array [^array arr ^number cut-from ^number cut-to]
+  ([arr cut-from cut-to]
     (.slice arr cut-from cut-to)))

-(defn ^array splice [^array  arr
-                     ^number splice-from
-                     ^number splice-to
-                     ^array  xs]
+(defn splice [arr splice-from splice-to xs]
   (cut-n-splice arr 0 (alength arr) splice-from splice-to xs))

-(defn ^array insert [^array arr
-                     ^number idx
-                     ^array xs]
+(defn insert [arr idx xs]
   (cut-n-splice arr 0 (alength arr) idx idx xs))

-(defn ^array merge-n-split [^array a1
-                            ^array a2]
+(defn merge-n-split [a1 a2]
   (let [a1-l    (alength a1)
         a2-l    (alength a2)
         total-l (+ a1-l a2-l)
@@ -133,13 +118,7 @@
                   (if (< i a1-l) i (- i a1-l)))))
     #js [r1 r2]))

-(defn ^boolean eq-arr [^array  a1
-                       ^number a1-from
-                       ^number a1-to
-                       ^array  a2
-                       ^number a2-from
-                       ^number a2-to
-                       cmp]
+(defn ^boolean eq-arr [a1 a1-from a1-to a2 a2-from a2-to cmp]
   (let [len (- a1-to a1-from)]
     (and
       (== len (- a2-to a2-from))
@@ -153,10 +132,7 @@
           :else
             (recur (inc i)))))))

-(defn ^array check-n-splice [^array  arr
-                             ^number from
-                             ^number to
-                             ^array  new-arr]
+(defn check-n-splice [arr from to new-arr]
   (if (eq-arr arr from to new-arr 0 (alength new-arr) eq)
     arr
     (splice arr from to new-arr)))
@@ -301,7 +277,7 @@
         (let [new-keys (splice keys idx (inc idx) #js [])]
           (rotate (LeafNode. new-keys) root? left right))))))

-(defn ^array keys-for [set ^number path]
+(defn keys-for [set path]
   (loop [level (.-shift set)
          node  (.-root set)]
     (if (pos? level)
@@ -355,9 +331,7 @@

 ;; iteration

-(defn ^number -next-path [node
-                          ^number path
-                          ^number level]
+(defn -next-path [node path level]
   (let [idx (path-get path level)]
     (if (pos? level)
       ;; inner node
@@ -382,10 +356,7 @@
   (-next-path (.-root set) path (.-shift set)))

-(deftype BTSetIter [^BTSet  set
-                    ^number path
-                    ^array  keys
-                    ^number idx]
+(deftype BTSetIter [set path keys idx]
   ISeqable
   (-seq [this]
     (when keys this))


cleaned up a bit

cleaned up a bit

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -261,7 +261,7 @@
       (if-not (nil? last-current-sound-id)
         (player/destroy-track last-current-sound-id)))

-      (if (nil? (get (:music-files @app-state) track-id))
+      (if-not (is-track-downloaded? track-id)
         (request-file-download track-id)
         (.emit socket "ready-to-start" sound-id))))


[leiningen.core] Fix extraneous map wrapping.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -355,7 +355,7 @@
                      (str ":expected-version--" version)
                      "install"]
         _ (apply println "install-versioned-artifact:" install-cmd {:dir proot})
-        rtn {:exit (apply subprocess {:dir proot} install-cmd)}]
+        rtn (apply subprocess {:dir proot} install-cmd)]
     (when-not (zero? (:exit rtn))
       (throw (ex-info "lein voom install error" (assoc rtn :cmd install-cmd))))
     rtn))


build-deps resolves without :dev or :user profiles

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -293,19 +293,20 @@
     (close [])))

 (defn try-once-resolve-voom-version [project]
-  (try
-    (with-log-level Level/OFF
-      #(binding [*err* null-writer]
-         (leiningen.core.classpath/resolve-dependencies :dependencies project)))
-    :ok
-    (catch Exception e
-      ;; lein resolve-dependencies wraps a
-      ;; DependencyResolutionException in an ex-info, so if we want
-      ;; the real cause of failure we have to dig for it:
-      (if-let [arts (seq (missing-artifacts-from-exception e))]
-        (doseq [art arts]
-          (resolve-artifact e art))
-        (throw e)))))
+  (let [non-dev-proj (project/set-profiles project [] [:dev :user])]
+    (try
+      (with-log-level Level/OFF
+        #(binding [*err* null-writer]
+           (leiningen.core.classpath/resolve-dependencies :dependencies non-dev-proj)))
+      :ok
+      (catch Exception e
+        ;; lein resolve-dependencies wraps a
+        ;; DependencyResolutionException in an ex-info, so if we want
+        ;; the real cause of failure we have to dig for it:
+        (if-let [arts (seq (missing-artifacts-from-exception e))]
+          (doseq [art arts]
+            (resolve-artifact e art))
+          (throw e))))))

 (defn build-deps
   "Like 'lein deps', but also builds voom-versioned things as needed."


More robust catching of missing artifacts in build-deps

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -27,6 +27,7 @@
             Closeable]
            [java.util.logging Logger Handler Level]
            [org.sonatype.aether.util.version GenericVersionScheme]
+           [org.sonatype.aether.resolution ArtifactDescriptorException]
            [org.sonatype.aether.transfer ArtifactNotFoundException]))

 (set! *warn-on-reflection* true)
@@ -280,9 +281,14 @@
   [e]
   (for [^Exception cause (iterate #(.getCause ^Exception %) e)
         :while cause
-        :when (instance? ArtifactNotFoundException cause)]
-    (let [art (.getArtifact ^ArtifactNotFoundException cause)]
-      (select-keys (bean art) [:groupId :artifactId :version]))))
+        :let [artifact (cond
+                        (instance? ArtifactNotFoundException cause)
+                        (.getArtifact ^ArtifactNotFoundException cause)
+
+                        (instance? ArtifactDescriptorException cause)
+                        (.getArtifact (.getResult ^ArtifactDescriptorException cause)))]
+        :when artifact]
+    (select-keys (bean artifact) [:groupId :artifactId :version])))

 ;; === build-deps ===


Inbox: Store search-strings in the URL.

Inbox: Store search-strings in the URL.

--- src-cljs/pepa/workflows/inbox2.cljs
+++ src-cljs/pepa/workflows/inbox2.cljs
@@ -17,7 +17,8 @@

             [pepa.components.page :as page]

-            [cljs.reader :refer [read-string]])
+            [cljs.reader :refer [read-string]]
+            [goog.string :as gstring])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]
                    [cljs.core.match.macros :refer [match]])
   (:import [cljs.core.ExceptionInfo]
@@ -132,7 +133,7 @@

 (declare search-ui)

-(defrecord SearchColumn [id]
+(defrecord SearchColumn [id search]
   SpecialColumn
   (special-column-ui [_] search-ui))

@@ -277,7 +278,7 @@
       [:button {:on-click (fn [e]
                             (ui/cancel-event e)
                             (let [current-columns (current-columns state)]
-                              (when-not (some #(= :search (first %)) current-columns)
+                              (when-not (some (fn [[k _]] (= :search k)) current-columns)
                                 (add-column! current-columns [:search nil]))))}
        "Open"]]]))

@@ -291,10 +292,32 @@
         [:.created (document/format-datetime modified)])
       (om/build tags/tags-list (:tags document))]]))

+(defn- run-search! [search owner]
+  (if-let [query (search/parse-query-string search)]
+    (async/take! (api/search-documents query)
+                 (fn [documents]
+                   (println "Found documents:" documents)
+                   (om/set-state! owner :documents documents)))
+    (om/set-state! owner :documents nil))
+  ;; Set the node's value to the right string
+  (when-let [node (om/get-node owner "search")]
+    (set! (.-value node) search)))
+
 (ui/defcomponent search-ui [[state column] owner]
-  (will-update [_ next-props next-state]
+  (will-mount [_]
+    ;; Run search (if we have a search string in the url)
+    (when-let [search (:search column)]
+      (run-search! search owner)))
+  (will-update [_ [next-props next-column] next-state]
+    ;; Run search if the search-string changes (note that an empty or
+    ;; nil search-string is fine and will just clear the results)
+    (let [search (:search next-column)]
+      (when-not (= search (:search column))
+        (run-search! search owner)))
+    ;; Fetch documents after the results of the search arrive
     (when-let [documents (:documents next-state)]
-      (when-not (= documents  (om/get-render-state owner :documents))
+      (when-not (= documents (om/get-render-state owner :documents))
+        ;; TODO: Only fetch documents we don't have locally
         (api/fetch-documents! documents))))
   (render-state [_ {:keys [documents]}]
     [:.column.search
@@ -302,23 +325,20 @@
       [:form {:on-submit (fn [e]
                            (ui/cancel-event e)
                            (let [text (.-value (om/get-node owner "search"))
-                                 query (search/parse-query-string text)]
-                             (if query
-                               (async/take! (api/search-documents query)
-                                            (fn [documents]
-                                              (println "Found documents:" documents)
-                                              (om/set-state! owner :documents documents)))
-                               (om/set-state! owner :documents nil))))}
+                                 columns (->> (current-columns state)
+                                              (remove #(= % [:search (:search column)])))]
+                             (add-column! columns [:search text])))}
        [:input.search {:type "text"
                        :ref "search"
-                       :placeholder "Search Documents"}]
+                       :placeholder "Search Documents"
+                       :default-value (or (:search column) "")}]
        [:button {:type "submit"}
         "Search"]]]
      [:ul.search-results
       (om/build-all search-result-row (map #(get-in state [:documents %]) documents)
                     {:opts {:on-click (fn [document]
                                         (let [columns (->> (current-columns state)
-                                                           (remove #(= % [:search nil])))]
+                                                           (remove (fn [[k _]] (= k :search))))]
                                           (add-column! columns [:document (:id document)])))}})]]))

 (defn ^:private inbox-handle-drop! [state owner page-cache target source page-ids target-idx]
@@ -367,14 +387,20 @@
   (let [entries (s/split param #",")
         pairs (mapv #(s/split % #":") entries)]
     (for [[k v] pairs]
-      (let [key (case k
-                  "d" :document
-                  "f" :file
-                  "i" :inbox
-                  "n" :new-document
-                  "s" :search)
-            value (try (let [n (js/parseInt v 10)] (when (integer? n) n)) (catch js/Error e nil))]
-        [key value]))))
+      (if-let [key (case k
+                       "d" :document
+                       "f" :file
+                       "i" :inbox
+                       "n" :new-document
+                       "s" :search
+                       nil)]
+        (let [value (if (= :search key)
+                      (if v (gstring/urlDecode v) "")
+                      (try (let [n (js/parseInt v 10)]
+                             (when (integer? n) n))
+                           (catch js/Error e nil)))]
+          [key value])
+        (js/console.warn "Invalid column-spec: " (str k))))))

 (defn- serialize-column-param [columns]
   (s/join "," (for [column columns]
@@ -382,12 +408,13 @@
                   [[:document id]] (str "d:" id)
                   [[:inbox _]] "i"
                   [[:new-document _]] "n"
-                  [[:search _]] "s"))))
+                  [[:search s]] (str "s:" (gstring/urlEncode (or s "")))))))

 (defn- current-columns [props]
-  (-> (or (get-in props [:navigation :query-params :columns])
-          "i,n")
-      (parse-column-param)))
+  (->> (or (get-in props [:navigation :query-params :columns])
+           "i,n")
+       (parse-column-param)
+       (remove nil?)))

 (defn- add-column! [columns column]
   {:pre [(vector? column)
@@ -418,7 +445,7 @@
                         [[:document id]]    (->DocumentColumnSource (.getNextUniqueId gen) id)
                         [[:inbox _]]        (->InboxColumnSource (.getNextUniqueId gen))
                         [[:new-document _]] (->NewDocumentColumn (.getNextUniqueId gen))
-                        [[:search _]]       (->SearchColumn (.getNextUniqueId gen))))]
+                        [[:search s]]       (->SearchColumn (.getNextUniqueId gen) s)))]
         (filterv identity columns)))))

 (defn- prepare-columns! [props state owner]


Fail fast on bad tag

Fail fast on bad tag

I've had issues with exceptions caused by trying assoc meta-data to
values that don't implement IAssoc (e.g. Strings).

I don't think Aero should recover from an undefined tag as it may reveal
a critical mistake by the programmer.

--- src/aero/core.clj
+++ src/aero/core.clj
@@ -14,9 +14,7 @@

 (defmethod reader :default
   [_ tag value]
-  (if tag
-    (with-meta value {::tag tag})
-    value))
+  (throw (ex-info (format "No reader for tag %s" tag) {:tag tag :value value})))

 (defmethod reader 'env
   [opts tag value]


add _stack support that dumps Thread/getAllStackTraces

--- src/bzzz/core.clj
+++ src/bzzz/core.clj
@@ -139,6 +139,10 @@
                                              (:query input))
       :get (case uri
              "/_stat" (stat)
+             "/_stack" (into {} (for [[^Thread t traces] (Thread/getAllStackTraces)]
+                                  [(str (.getName t) "@" (.getId t))
+                                   (into [] (for [^StackTraceElement s traces]
+                                              (.toString s)))]))
              "/favicon.ico" "" ;; XXX
              (index-search/search input))
       :put (search-many (:hosts input) (dissoc input :hosts))
@@ -297,7 +301,7 @@
     (every 10000 #(log/trace "up:" @timer* @index-directory/identifier* @discover-hosts* @peers*) (mk-pool) :desc "dump")
     (repeatedly
      (try
-       (run-server handler {:port @port* :threads @http-threads* :ip (:bind options)})
+       (run-server handler {:port @port* :threads @http-threads* :ip (:bind options) :worker-name-prefix "http-kit-worker"})
        (catch Throwable e
          (do
            (log/warn (ex-str e))


Add region option to pileup command

Add region option to pileup command

--- src/cljam/cli.clj
+++ src/cljam/cli.clj
@@ -200,39 +200,61 @@

 (def ^:private pileup-cli-options
   [["-s" "--simple" "Output only pileup count."]
-   ["-r" "--ref FASTA" "Reference file in the FASTA format."
+   ["-r" "--region REGION" "Only pileup in region. (e.g. chr6:1000-2000)"]
+   ["-f" "--ref FASTA" "Reference file in the FASTA format."
     :default nil]
    ["-h" "--help"]])

 (defn- pileup-usage [options-summary]
   (->> ["Generate pileup for the BAM file."
         ""
-        "Usage: cljam pileup [-s] [-r FASTA] <in.bam>"
+        "Usage: cljam pileup [-s] [-r REGION] [-f FASTA] <in.bam>"
         ""
         "Options:"
         options-summary]
        (cstr/join \newline)))

 (defn- pileup-simple
-  [rdr]
-  (doseq [rname (map :name (io/read-refs rdr))
-          line  (plp/pileup rdr rname)]
-    (println line)))
+  ([rdr]
+   (doseq [rname (map :name (io/read-refs rdr))
+           line  (plp/pileup rdr rname)]
+     (println line)))
+  ([rdr rname start end]
+   (doseq [line (plp/pileup rdr rname start end)]
+     (println line))))

 (defn- pileup-with-ref
-  [rdr ref-fa]
-  (with-open [fa-rdr (fa/reader ref-fa)]
-    (doseq [rname (map :name (io/read-refs rdr))
-            line  (plp/mpileup rdr rname -1 -1 :ref-fasta fa-rdr)]
-      (if-not (zero? (:count line))
-        (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual])))))))
+  ([rdr ref-fa]
+   (with-open [fa-rdr (fa/reader ref-fa)]
+     (doseq [rname (map :name (io/read-refs rdr))
+             line  (plp/mpileup rdr rname -1 -1 :ref-fasta fa-rdr)]
+       (if-not (zero? (:count line))
+         (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual])))))))
+  ([rdr ref-fa rname start end]
+   (with-open [fa-rdr (fa/reader ref-fa)]
+     (doseq [line  (plp/mpileup rdr rname start end :ref-fasta fa-rdr)]
+       (if-not (zero? (:count line))
+         (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual]))))))))

 (defn- pileup-without-ref
-  [rdr]
-  (doseq [rname (map :name (io/read-refs rdr))
-          line  (plp/mpileup rdr rname)]
-    (if-not (zero? (:count line))
-      (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual]))))))
+  ([rdr]
+   (doseq [rname (map :name (io/read-refs rdr))
+           line  (plp/mpileup rdr rname)]
+     (if-not (zero? (:count line))
+       (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual]))))))
+  ([rdr rname start end]
+   (doseq [line  (plp/mpileup rdr rname start end)]
+     (if-not (zero? (:count line))
+       (println (cstr/join \tab (map #(% line) [:rname :pos :ref :count :seq :qual])))))))
+
+(defn- parse-region
+  [region-str]
+  (if-let [m (re-find #"^([^:]+)$" region-str)]
+    (conj (vec (rest m)) -1 -1)
+    (if-let [m (re-find #"^([^:]+):([0-9]+)-([0-9]+)$" region-str)]
+      (-> (vec (rest m))
+          (update-in [1] #(Integer/parseInt %))
+          (update-in [2] #(Integer/parseInt %))))))

 (defn pileup [args]
   (let [{:keys [options arguments errors summary]} (parse-opts args pileup-cli-options)]
@@ -246,10 +268,17 @@
           (exit 1 "Not support SAM file"))
         (when-not (sorter/sorted-by? r)
           (exit 1 "Not sorted"))
-        (cond
-          (:simple options) (pileup-simple r)
-          (pileup-without-ref r)
-          (pileup-with-ref r (:ref options))))))
+        (if (:region options)
+          (if-let [region (parse-region (:region options))]
+            (cond
+              (:simple options) (apply pileup-simple r region)
+              (:ref options) (apply pileup-with-ref r (:ref options) region)
+              :else (apply pileup-without-ref r region))
+            (exit 1 "Invalid region format"))
+          (cond
+            (:simple options) (pileup-simple r)
+            (:ref options) (pileup-with-ref r (:ref options))
+            :else (pileup-without-ref r))))))
   nil)

 ;; ### faidx command


util/date.clj: added filename-timestamp

util/date.clj: added filename-timestamp

--- src/org/altlaw/util/date.clj
+++ src/org/altlaw/util/date.clj
@@ -1,12 +1,16 @@
 (ns org.altlaw.util.date
   (:use [clojure.contrib.test-is :only (with-test is)])
-  (:import (java.text SimpleDateFormat FieldPosition ParsePosition)))
+  (:import (java.text SimpleDateFormat FieldPosition ParsePosition)
+           (java.util Date)))

 (def #^{:private true} *iso-date-format*
      (SimpleDateFormat. "yyyy-MM-dd"))

 (def #^{:private true} *long-date-format*
      (SimpleDateFormat. "MMMM d, yyyy"))
+
+(def #^{:private true} *datetime-filename-format*
+     (SimpleDateFormat. "yyyyMMddHHmmss"))

 (with-test
     (defn format-long-date
@@ -21,3 +25,5 @@
                       (FieldPosition. 0)))))
   (is (= "January 1, 2009" (format-long-date "2009-01-01"))))

+(defn filename-timestamp []
+  (.format *datetime-filename-format* (Date.)))


Fixed capitalisation and missing letter.

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -621,7 +621,7 @@
      note ))

 (defn- simplify-chord
-  "expects notes to contain 0 (the root note) Reduces all notes into 2
+  "Expects notes to contain 0 (the root note) Reduces all notes into 2
   octaves. This will allow identification of fancy jazz chords, but
   will miss some simple chords if they are spread over more than 1
   octave."
@@ -629,9 +629,9 @@
   (set (map (fn [x] (fold-note x)) notes)))

 (defn- compress-chord
-  "expects notes to contain 0 (the root note) Reduces all notes into 1
+  "Expects notes to contain 0 (the root note) Reduces all notes into 1
   octave. This will lose all the fancy jazz chords but recognise
-  sparse multiple octave smple chords"
+  sparse multiple octave simple chords"
   [notes]
   (set (map (fn [x] (mod x 12)) notes)))


Use underscores for multihash type properties.

--- src/multihash/core.clj
+++ src/multihash/core.clj
@@ -61,23 +61,23 @@
 ;;   application-specific algorithm code.
 ;; - `:digest` is a string holding the hex-encoded algorithm output.
 (deftype Multihash
-  [^long code ^String digest _meta]
+  [^long _code ^String _digest _meta]

   Object

   (toString [this]
-    (str "hash:" (name (:name (get-algorithm code))) \: digest))
+    (str "hash:" (name (:name (get-algorithm _code))) \: _digest))

   (equals [this that]
     (cond
       (identical? this that) true
       (instance? Multihash that)
-        (and (= code   (.code   ^Multihash that))
-             (= digest (.digest ^Multihash that)))
+        (and (= _code   (._code   ^Multihash that))
+             (= _digest (._digest ^Multihash that)))
       :else false))

   (hashCode [this]
-    (hash-combine code digest))
+    (hash-combine _code _digest))

   Comparable
@@ -85,19 +85,19 @@
   (compareTo [this that]
     (cond
       (= this that) 0
-      (< code (.code that)) -1
-      (> code (.code that)) 1
-      :else (compare digest (.digest that))))
+      (< _code (._code that)) -1
+      (> _code (._code that)) 1
+      :else (compare _digest (._digest that))))

   clojure.lang.ILookup

   (valAt [this k not-found]
     (case k
-      :code code
-      :algorithm (:name (get-algorithm code))
-      :length (/ (count digest) 2)
-      :digest (hex/decode digest)
+      :code _code
+      :algorithm (:name (get-algorithm _code))
+      :length (/ (count _digest) 2)
+      :digest (hex/decode _digest)
       not-found))

   (valAt [this k]
@@ -111,8 +111,13 @@

   clojure.lang.IObj

-  (withMeta [_ m]
-    (Multihash. code digest m)))
+  (withMeta [_ meta-map]
+    (Multihash. _code _digest meta-map)))
+
+
+(defmethod print-method Multihash
+  [v ^java.io.Writer w]
+  (.write w (str v)))


Make body-type private again

Make body-type private again

--- src/play_clj/g2d_physics.clj
+++ src/play_clj/g2d_physics.clj
@@ -39,7 +39,7 @@

 ; bodies

-(defn body-type
+(defn ^:private body-type
   [k]
   (u/gdx-class :physics :box2d :BodyDef
                (str "BodyType/" (u/key->pascal k) "Body")))


Add connection to mongohq database

Add connection to mongohq database

--- src/sleuth/handler.clj
+++ src/sleuth/handler.clj
@@ -11,8 +11,10 @@
             [sleuth.sites :as sites]
             [sleuth.events :as events]
             [monger.core :as m]))
+(if-let [mongo-uri (get (System/getenv) "MONGOHQ_URL")]
+  (m/connect-via-uri! mongo-uri)
+  (m/connect!))

-(m/connect!)
 (m/set-db! (m/get-db "sleuth-dev"))


clean up typos etc

clean up typos etc

--- src/subpar/better.cljs
+++ src/subpar/better.cljs
@@ -37,7 +37,7 @@
   (and (multi-opener? c)
        (multi-second? next)))

-(declare ;; see comments in spar.macros to learn what these are:
+(declare ;; see comments in subpar.macros to learn what these are:
  ;; 'classifiers' 'peekers' and 'steppers'.

  peek-code
@@ -204,14 +204,6 @@
   ([s]        (parse s peek-default))
   ([s peeker] (parse s peeker "" [] 0))
   ([s peeker code depth next-depth]
-   ;; (println "parse")
-   ;; (println (str "s \"" s "\""))
-   ;; (println "peeker" peeker)
-   ;; (println (str "code \"" code "\""))
-   ;; (println "depth" depth)
-   ;; (println "ndepth" next-depth)
-
-   ;; TODO profile
    (trampoline peeker code depth next-depth s)))

 (def plain-typing-mode (atom true))
@@ -227,7 +219,7 @@
   (reset! depth d))

 (defn reject [change]
-  (println "rejecting change: unbalanced parens")
+  (println "rejecting change: unbalanced parentheses")
   (.cancel change))

 (defn get-next-depth


Fixed 2 typos.

Fixed 2 typos.

--- src/untangled/dom.cljs
+++ src/untangled/dom.cljs
@@ -9,11 +9,11 @@

 (defn toggle-class
-  "Adds the 'visble' class and removes the 'hidden' class to the pre-supplied class string based on the truthiness
+  "Adds the 'visible' class and removes the 'hidden' class to the pre-supplied class string based on the truthiness
   of the value in data at key.

   Parameters:
-  `data`: A map containg the component's state.
+  `data`: A map containing the component's state.
   `key`: A key within `data`.
   `always-classes`: A string that has the CSS classes to always return in the returned string.


remove prn

remove prn

--- src/wb_es/web/core.clj
+++ src/wb_es/web/core.clj
@@ -4,8 +4,6 @@

 (defn wrap-query-lower-case [handler]
   (fn [request]
-    (prn request)
-;;    (handler request)))
     (handler (update-in request [:params :q] #(some-> % clojure.string/lower-case)))))


make the ship deep enough

make the ship deep enough

--- cartagena-web/src/cartagena_web/main.cljs
+++ cartagena-web/src/cartagena_web/main.cljs
@@ -51,7 +51,7 @@
     {:x (to-scale 400)
      :y (to-scale 240)
      :width (to-scale 90)
-     :height (to-scale 50)
+     :height (to-scale 60)
      :stroke "black"
      :fill "sienna"}]
    [:g


Added trap to handle problem tuples

Added trap to handle problem tuples

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -165,7 +165,8 @@
         (log/logistic-prob-wrap ?beta ?val ?neighbor-val :> ?prob)
         (log/mk-timeseries ?pd ?prob :> ?prob-series)
         (:distinct false)
-        (= ?pd 827)))
+        (= ?pd 827)
+        (:trap (hfs-seqfile "s3://formaresults/trapped"))))

 (defn prep-for-betas
   [dynamic-src static-src]


Added trapping

Added trapping

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -165,7 +165,7 @@
         (log/mk-timeseries ?pd ?prob :> ?prob-series)
         (= ?pd 827)
         (:distinct false)
-        ;;(:trap (hfs-seqfile trap-tap))
+        (:trap (hfs-seqfile trap-tap))
         )))

 (comment


Use .lumo-cache as global cache folder

Use .lumo-cache as global cache folder

--- src/cljs/bundled/lumo/analyzer.cljs
+++ src/cljs/bundled/lumo/analyzer.cljs
@@ -221,7 +221,7 @@
    (cache-base-path path nil))
   ([path opts]
    (path/join (os/homedir)
-     ".cljs" ".aot_cache" (util/clojurescript-version)
+     ".cljs" ".lumo_cache" (util/clojurescript-version)
      (build-affecting-options-sha path opts))))

 (defn cacheable-files