fix typo: inflection should be :past-p, not :passe-compose (the latter is tense, not inflection)

--- src/babel/francais/pos.clj
+++ src/babel/francais/pos.clj
@@ -7,7 +7,7 @@
 (def verb-aux
   (let [sem (ref {:tense :passe-compose})]
     (unifyc {:synsem {:sem sem
-                      :subcat {:2 {:infl :passe-compose}}}}
+                      :subcat {:2 {:infl :past-p}}}}
             (let [aux (ref true)
                   pred (ref :top)
                   sem (ref {:pred pred})


Add post-process-parser-plugin helper

Add post-process-parser-plugin helper

--- src/com/wsscode/pathom/core.cljc
+++ src/com/wsscode/pathom/core.cljc
@@ -382,6 +382,16 @@

 ;; PLUGINS

+; Helpers
+
+(defn post-process-parser-plugin
+  "Helper to create a plugin to work on the parser output. `f` will run once with the parser final result."
+  [f]
+  {::wrap-parser
+   (fn transform-parser-out-plugin-external [parser]
+     (fn transform-parser-out-plugin-internal [env tx]
+       (f (parser env tx))))})
+
 ; Exception

 (defn error-str [err]


recorded-path and recording-path should be writable by group

--- src/mdr2/production.clj
+++ src/mdr2/production.clj
@@ -3,6 +3,7 @@
   (:refer-clojure :exclude [find])
   (:require [clojure.java.io :refer [file]]
             [me.raynes.fs :as fs]
+            [org.tobereplaced.nio.file :as nio]
             [clj-time.core :as t]
             [clj-time.format :as f]
             [clj-time.coerce :refer [to-date]]
@@ -70,18 +71,16 @@
               (assoc m k (to-date (f/parse value))) m))
           production [:date :source_date :produced_date :revision_date]))

-(defn create
-  "Create a production"
-  [production]
-  (as-> production p
-        (add-default-meta-data p)
-        (db/insert! p)
-        (doseq [dir (path/all p)] (fs/mkdirs dir))))
-
 (defn create-dirs
   "Create all working dirs for a `production`"
   [production]
-  (doseq [dir (path/all production)] (fs/mkdirs dir)))
+  (doseq [dir (path/all production)]
+    (fs/mkdirs dir)
+    ;; make sure recording and recorded are group writable
+    (when (#{path/recorded-path path/recording-path} dir)
+      (let [permissions (conj (nio/posix-file-permissions dir)
+                              (nio/posix-file-permission :group-write))]
+        (nio/set-posix-file-permissions! dir permissions)))))

 (defn create
   "Create a production"


WIP index/read-range.

WIP index/read-range.

--- src/merkle_db/index.clj
+++ src/merkle_db/index.clj
@@ -46,6 +46,27 @@

 ;; ## Read Functions

+(defn- assign-keys
+  "Assigns record keys to the children of this node which they would belong
+  to. Returns a lazy sequence of vectors containing the child index and a
+  sequence of record keys."
+  [split-keys record-keys]
+  (->>
+    [nil 0 split-keys record-keys]
+    (iterate
+      (fn [[_ index splits rks]]
+        (when (seq rks)
+          (if (seq splits)
+            ; Take all records coming before the next split key.
+            (let [[in after] (split-with (partial key/before? (first splits)) rks)]
+              [[index in] (inc index) (next splits) after])
+            ; No more splits, emit one final group with any remaining keys.
+            [[(inc index) rks]]))))
+    (drop 1)
+    (take-while first)
+    (map first)))
+
+
 (defn read-all
   "Read a lazy sequence of key/map tuples which contain the requested field data
   for every record in the subtree. This function works on both index nodes and
@@ -70,27 +91,6 @@
     (throw (ex-info (str "Unsupported data-tree node type: "
                          (pr-str (:data/type node)))
                     {:data/type (:data/type node)}))))
-
-
-(defn- assign-keys
-  "Assigns record keys to the children of this node which they would belong
-  to. Returns a lazy sequence of vectors containing the child index and a
-  sequence of record keys."
-  [split-keys record-keys]
-  (->>
-    [nil 0 split-keys record-keys]
-    (iterate
-      (fn [[_ index splits rks]]
-        (when (seq rks)
-          (if (seq splits)
-            ; Take all records coming before the next split key.
-            (let [[in after] (split-with (partial key/before? (first splits)) rks)]
-              [[index in] (inc index) (next splits) after])
-            ; No more splits, emit one final group with any remaining keys.
-            [[(inc index) rks]]))))
-    (drop 1)
-    (take-while first)
-    (map first)))

 (defn read-batch
@@ -120,8 +120,36 @@
                     {:data/type (:data/type node)}))))

-; TODO: read-range
-; narrow children by which could contain the range, recurse in order
+(defn read-range
+  "Read a lazy sequence of key/map tuples which contain the field data for the
+  records whose keys lie in the given range, inclusive. A nil boundary includes
+  all records in that range direction."
+  [store node fields start-key end-key]
+  (case (:data/type node)
+    :merkle-db/index-node
+    (->
+      (concat (map vector (::children node) (::keys node))
+              [[(last (::children node))]])
+      (->>
+        (partition 2 1)
+        (map (fn [[[_ start-key] [link end-key]]]
+               [link [start-key end-key]]))
+        (cons [(first (::children node)) nil (first (::key node))]))
+      (cond->>
+        start-key
+          (drop-while #(key/before? (nth % 2) start-key))
+        end-key
+          (take-while #(key/after? end-key (nth % 1))))
+      ,,,
+      #_
+      (read-tablets store part fields tablet/read-range start-key end-key))
+
+    :merkle-db/partition
+    (part/read-range store node fields start-key end-key)
+
+    (throw (ex-info (str "Unsupported data-tree node type: "
+                         (pr-str (:data/type node)))
+                    {:data/type (:data/type node)}))))

 ; TODO: read-slice


Remove select-statement-change-view since i do not refer to statements any more

--- src/discuss/references/main.cljs
+++ src/discuss/references/main.cljs
@@ -11,13 +11,6 @@
             [discuss.utils.bootstrap :as bs]
             [discuss.utils.common :as lib]
             [discuss.utils.views :as vlib]))
-
-(defn save-statement-change-view
-  "Saves the current selected statement (or the only one if there is only one available) and changes to
-   the view to configure own attitude."
-  [statement]
-  (rlib/save-selected-statement! statement)
-  (lib/change-view! :reference-agree-disagree))

 ;;;; Handlers & Queries
@@ -42,8 +35,7 @@
   [reference]
   (rlib/save-selected-reference! reference)
   (query-reference-details (:id reference))
-  (sidebar/show)
-  (lib/update-state-item! :layout :reference (fn [_] (:text reference))))
+  (sidebar/show))

 ;;;; Views


Refactoring: common job-related format are performed by one function only

--- src/emender_jenkins/rest_api.clj
+++ src/emender_jenkins/rest_api.clj
@@ -152,7 +152,7 @@

 (defn send-job-not-specified-response
     [request command]
-    (-> (create-bad-request-response command "job name is not specified")
+    (-> (create-bad-request-response (get commands command) "job name is not specified")
         (send-error-response request :bad-request)))

 (defn reload-all-results
@@ -165,61 +165,35 @@
                 (-> (create-error-response "(not needed)" "reload-all-results" (.getMessage e))
                     (send-error-response request :internal-server-error)))))

-(defn start-job
-    [request]
+(defn perform-job-command
+    [request function command]
     (let [job-name (get-job-name-from-body request)]
         (if job-name
             (if (results/job-exists? job-name)
-                (-> (clj-jenkins-api/start-job (config/get-jenkins-url request)
-                                               (config/get-jenkins-auth request)
-                                               (config/include-jenkins-reply? request)
-                                               job-name)
+                (-> (function (config/get-jenkins-url request)
+                              (config/get-jenkins-auth request)
+                              (config/include-jenkins-reply? request)
+                              job-name)
                     (reload-job-list request)
                     (send-response request))
                 (send-job-does-not-exist-response request job-name :start-job))
             (send-job-not-specified-response request :start-job))))

+(defn start-job
+    [request]
+    (perform-job-command request clj-jenkins-api/start-job :start-job))
+
 (defn enable-job
     [request]
-    (let [job-name (get-job-name-from-body request)]
-        (if job-name
-            (if (results/job-exists? job-name)
-                (-> (clj-jenkins-api/enable-job (config/get-jenkins-url request)
-                                                (config/get-jenkins-auth request)
-                                                (config/include-jenkins-reply? request)
-                                                job-name)
-                    (reload-job-list request)
-                    (send-response request))
-                (send-job-does-not-exist-response request job-name :enable-job))
-            (send-job-not-specified-response request :enable-job))))
+    (perform-job-command request clj-jenkins-api/enable-job :enable-job))

 (defn disable-job
     [request]
-    (let [job-name (get-job-name-from-body request)]
-        (if job-name
-            (if (results/job-exists? job-name)
-                (-> (clj-jenkins-api/disable-job (config/get-jenkins-url request)
-                                                 (config/get-jenkins-auth request)
-                                                 (config/include-jenkins-reply? request)
-                                                 job-name)
-                    (reload-job-list request)
-                    (send-response request))
-                (send-job-does-not-exist-response request job-name :disable-job))
-            (send-job-not-specified-response request :disable-job))))
+    (perform-job-command request clj-jenkins-api/disable-job :disable-job))

 (defn delete-job
     [request]
-    (let [job-name (get-job-name-from-body request)]
-        (if job-name
-            (if (results/job-exists? job-name)
-                (-> (clj-jenkins-api/delete-job (config/get-jenkins-url request)
-                                                (config/get-jenkins-auth request)
-                                                (config/include-jenkins-reply? request)
-                                                job-name)
-                    (reload-job-list request)
-                    (send-response request))
-                (send-job-does-not-exist-response request job-name :delete-job))
-            (send-job-not-specified-response request :delete-job))))
+    (perform-job-command request clj-jenkins-api/delete-job :delete-job))

 (defn job-invalid-input
     [job-name git-repo branch]


Rearranged the functions to isolate the plumbing.

--- src/overtunes/pitch.clj
+++ src/overtunes/pitch.clj
@@ -4,9 +4,12 @@
     [overtone.live :exclude [scale octave sharp flat sixth]]
     [overtone.inst.sampled-piano :only [sampled-piano]]))

-(def note! sampled-piano)
-(def chord! #(map note! %))
+; Basic intervals
+(def semitone 1)
+(def tone (* semitone 2))
+(def octave (* 12 semitone))

+; Plumbing
 (defmacro defall
   "Define multiple values at once."
   [names values]
@@ -28,17 +31,16 @@
   "Gets the keys from m, excluding any that are present in ks."
   [m ks] (difference (set (keys m)) ks))

-; Basic intervals
-(def semitone 1)
-(def tone (* semitone 2))
-(def octave (* 12 semitone))
+(defn grounding [offset]
+  "Takes an offset from root and produces a function for rendering chords."
+  (fn
+    ([octave-number]
+     (+ offset (* octave-number octave)))
+    ([octave-number chord]
+     (map #(+ offset % (* octave-number octave)) (vals chord)))))

-; Operations on intervals
-(def sharp #(+ % semitone))
-(def flat #(- % semitone))
-(def raise #(+ % octave))
-(def lower #(- % octave))
-
+; Define a major scale. We could easily define other modes,
+; but they aren't needed at present.
 (defn scale
   "Define a scale as a cumulative sum of intervals."
   ([] '(0))
@@ -49,19 +51,17 @@
                    [:i :ii :iii :iv :v :vi :vii :viii]
                    (scale tone tone semitone tone tone tone semitone)))

-(defn grounding [offset]
-  "Takes an offset from root and produces a function for rendering chords."
-  (fn
-    ([octave-number]
-     (+ offset (* octave-number octave)))
-    ([octave-number chord]
-     (map #(+ offset % (* octave-number octave)) (vals chord)))))
-
 ; Name notes
 (defall [C D E F G A B]
         (map
           grounding
-          (sort (vals  major-scale))))
+          (sort (vals major-scale))))
+
+; Operations on intervals
+(def sharp #(+ % semitone))
+(def flat #(- % semitone))
+(def raise #(+ % octave))
+(def lower #(- % octave))

 ; Qualities
 (def major (select-keys major-scale [:i :iii :v]))
@@ -81,3 +81,7 @@
 (def thirteenth #(assoc (eleventh %) :xi (raise (:vi major-scale))))
 (def first-inversion #(update-values % (keys-except % [:i]) lower))
 (def second-inversion #(update-values % (keys-except % [:i :iii]) lower))
+
+; Let's play!
+(def note! sampled-piano)
+(def chord! #(map note! %))


Improve reporting of problems w/ route or path spec

Fixes #17

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -98,6 +98,7 @@
   [path-spec]
   (if-not (nil? path-spec)
     (let [[method path] path-spec
+          _ (assert (instance? String path))
           paramify (fn [seg]
                      (if (.startsWith ^String seg ":")
                        (keyword (subs seg 1))
@@ -653,11 +654,12 @@
            ns-publics
            (keep (fn [[k v]]
                    (if (ifn? @v)
-                     (if-let [route-spec (or (:route-spec (meta v))
-                                             (path-spec->route-spec
-                                               (:path-spec (meta v)))
-                                             (get default-mappings k))]
-                       (conj route-spec (symbol (name ns-sym) (name k)))))))
+                     (t/track #(format "Building route mapping for `%s/%s'." ns-sym k)
+                       (if-let [route-spec (or (:route-spec (meta v))
+                                               (path-spec->route-spec
+                                                 (:path-spec (meta v)))
+                                               (get default-mappings k))]
+                         (conj route-spec (symbol (name ns-sym) (name k))))))))
            (list* context-pathvec middleware)
            vec)])))


Adopt '#' as a suffix meaning that this function makes noise.

--- src/overtunes/pitch.clj
+++ src/overtunes/pitch.clj
@@ -83,5 +83,5 @@
 (def second-inversion #(update-values % (keys-except % [:i :iii]) lower))

 ; Let's play!
-(def note! sampled-piano)
-(def chord! #(map note! %))
+(def note# sampled-piano)
+(def chord# #(map note# %))


Key Test perf improvement

Key Test perf improvement

--- src/main/cljs/lean_map/core.cljs
+++ src/main/cljs/lean_map/core.cljs
@@ -84,7 +84,7 @@
         (let [idx (bitmap-indexed-node-index datamap bit)
               k (aget arr (* 2 idx))]
           (set! (.-modified changed?) true)
-          (if (= k key)
+          (if (key-test k key)
             (.copy-and-set-value inode aedit bit val)
             (let [v (aget arr (inc (* 2 idx)))
                   new-node (.merge-two-kv-pairs inode aedit (+ shift 5) k v hash key val)]
@@ -92,7 +92,7 @@
               (.copy-and-migrate-to-node inode aedit bit new-node))))
         (not (zero? (bit-and nodemap bit)))
         (let [sub-node (aget arr (node-at arr nodemap bit))
-              sub-node-new (.inode_assoc sub-node aedit shift hash key val changed?)]
+              sub-node-new (.inode-assoc sub-node aedit (+ shift 5) hash key val changed?)]
           (if (.-modified changed?)
             (.copy-and-set-node inode aedit bit sub-node-new)
             inode))


small hash change for local storage

small hash change for local storage

--- src/pp/client/data.cljs
+++ src/pp/client/data.cljs
@@ -3,7 +3,7 @@
     [ajax.core :refer [GET POST]]
     [pp.client.util :refer [js-log log]]))

-(def id "9c9fb")
+(def id "9c9fc")

 (defn format-input [state handler error-handler]
   (POST (:uri state) {:params {:input (:value state)


allow for custom background and tooltip styles

--- src/re_com/popover.cljs
+++ src/re_com/popover.cljs
@@ -374,22 +374,18 @@
    {:name :showing?      :required true  :default false         :type "boolean atom"                                             :description "an atom. When the value is true, the tooltip shows"}
    {:name :on-cancel     :required false                        :type "-> nil"                 :validate-fn fn?                  :description "a function which takes no params and returns nothing. Called when the popover is cancelled (e.g. user clicks away)"}
    {:name :close-button? :required false :default false         :type "boolean"                                                  :description "when true, displays the close button"}
-   {:name :status        :required false                        :type "keyword"                :validate-fn popover-status-type? :description [:span "controls background color of the tooltip. " [:code "nil/omitted"] " for black or one of " popover-status-types-list]}
    {:name :anchor        :required true                         :type "hiccup"                 :validate-fn string-or-hiccup?    :description "the component the tooltip is attached to"}
    {:name :position      :required false :default :below-center :type "keyword"                :validate-fn position?            :description [:span "relative to this anchor. One of " position-options-list]}
    {:name :width         :required false                        :type "string"                 :validate-fn string?              :description "specifies width of the tooltip"}
-   {:name :style         :required false                        :type "CSS style map"          :validate-fn css-style?           :description "override component style(s) with a style map, only use in case of emergency"}])
+   {:name :style         :required false                        :type "CSS style map"          :validate-fn css-style?           :description "override component style(s) with a style map, only use in case of emergency"}
+   {:name :popover-color :required false                        :type "string"                 :validate-fn string?              :description "specifies background color of tooltip"}
+   {:name :tooltip-style :required false                        :type "CSS style map"          :validate-fn css-style?           :description "ovverride tooltip style(s) with a style map"}])

 (defn popover-tooltip
   "Renders text as a tooltip in Bootstrap popover style"
-  [& {:keys [label showing? on-cancel close-button? status anchor position width style] :as args}]
+  [& {:keys [label showing? on-cancel close-button? anchor position width style popover-color tooltip-style] :as args}]
   {:pre [(validate-args-macro popover-tooltip-args-desc args "popover-tooltip")]}
-  (let [label         (deref-or-value label)
-        popover-color (case status
-                        :warning "#f57c00"
-                        :error   "#d50000"
-                        :info    "#333333"
-                        "black")]
+  (let [label         (deref-or-value label)]
     [popover-anchor-wrapper
      :showing? showing?
      :position position
@@ -401,19 +397,16 @@
                :on-cancel      on-cancel
                :width          width
                :tooltip-style? true
-               :popover-color  popover-color
+               :popover-color  (if popover-color popover-color "black")
                :padding        "3px 8px"
                :arrow-length   6
                :arrow-width    12
                :body           [v-box
-                                :style (if (= status :info)
-                                         {:color       "white"
-                                          :font-size   "14px"
-                                          :padding     "4px"}
-                                         {:color       "white"
-                                          :font-size   "12px"
-                                          :font-weight "bold"
-                                          :text-align  "center"})
+                                :style (if tooltip-style tooltip-style
+                                                         {:color       "white"
+                                                          :font-size   "12px"
+                                                          :font-weight "bold"
+                                                          :text-align  "center"})
                                 :children [label (when close-button?
                                                    [close-button showing? on-cancel {:font-size   "20px"
                                                                                :color       "white"


Fix browser history sorting

Fix browser history sorting

Signed-off-by: Brian Sztamfater <760e7dab2836853c63805033e514668301fa9c47@status.im>

--- src/status_im/subs.cljs
+++ src/status_im/subs.cljs
@@ -1433,7 +1433,7 @@
  :browser/browsers-vals
  :<- [:browser/browsers]
  (fn [browsers]
-   (vals browsers)))
+   (reverse (vals browsers))))

 (re-frame/reg-sub
  :get-current-browser


Remove extra logging that makes computing the result more expen… (#1326)

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -585,24 +585,18 @@
             (when is-rate-limited?
               (swap! user->rate-limit-count update user #(inc (or % 0))))
             (not (and is-rate-limited? enforcing-job-launch-rate-limit?))))
-        quota-filter-jobs (util/filter-based-on-quota user->quota user->usage pending-jobs)
-        allowed-to-start-jobs (filter (fn [job] (util/job-allowed-to-start? db job)) quota-filter-jobs)
-        within-launch-rate-jobs (filter user-within-launch-rate-limit?-fn allowed-to-start-jobs)
-        launch-plugin-jobs (filter launch-plugin/filter-job-launches within-launch-rate-jobs)
-        considerable-jobs (take num-considerable launch-plugin-jobs)
-        ; Force this to be taken eagerly so that the log line is accurate.
-        considerable-jobs* (doall considerable-jobs)]
+        considerable-jobs
+        (->> pending-jobs
+             (util/filter-based-on-quota user->quota user->usage)
+             (filter (fn [job] (util/job-allowed-to-start? db job)))
+             (filter user-within-launch-rate-limit?-fn)
+             (filter launch-plugin/filter-job-launches)
+             (take num-considerable)
+             ; Force this to be taken eagerly so that the log line is accurate.
+             (doall))]
     (swap! pool->user->number-jobs update pool-name (constantly @user->number-jobs))
     (log/info "Users whose job launches are rate-limited " @user->rate-limit-count "( enforcing =" enforcing-job-launch-rate-limit? ")")
-    (log/info "In" pool-name "pool, there are"
-              (count pending-jobs) "pending ->"
-              (count quota-filter-jobs) "quota-filtered ->"
-              (count allowed-to-start-jobs) "allowed-to-start ->"
-              (count within-launch-rate-jobs) "within-launch-rate ->"
-              (count launch-plugin-jobs) "allowed by launch-plugin ->"
-              "and"
-              (count considerable-jobs*) "considerable jobs")
-    considerable-jobs*))
+    considerable-jobs))

 (defn matches->job-uuids


Use LRU cache instead of FIFO cache (#348)

--- scheduler/src/cook/components.clj
+++ scheduler/src/cook/components.clj
@@ -245,7 +245,7 @@
      :mesos-pending-jobs-atom (fnk [] (atom {}))
      :mesos-offer-cache (fnk [[:settings [:offer-cache max-size ttl-ms]]]
                           (-> {}
-                              (cache/fifo-cache-factory :threshold max-size)
+                              (cache/lru-cache-factory :threshold max-size)
                               (cache/ttl-cache-factory :ttl ttl-ms)
                               atom))
      :curator-framework curator-framework}))


Restrict geocoding to city limits.

Restrict geocoding to city limits.

--- src/clj/hbg_crime/core.clj
+++ src/clj/hbg_crime/core.clj
@@ -50,10 +50,20 @@
      :address (str/trim (nth matches 3))
      :description (str/trim (nth matches 4))}))

+;; Harrisburg city zips (not perfect)
+(def zips #{"17101" "17102" "17103" "17104" "17120" "17110"})
+(defn- first-zip-match
+  [results]
+  (first (filter #(not (empty? (filter
+                                (fn [el]
+                                  (contains? zips (:short-name el)))
+                                (:address-components %))))
+                 results)))
+
 (defn geocode-report
   [report]
-  (let [res (first (geo/geocode-address
-                    (str (:address report) ", Harrisburg, PA")))
+  (let [res (first-zip-match (geo/geocode-address
+                              (str (:address report) ", Harrisburg, PA")))
         loc (get-in res [:geometry :location])]
     (merge report loc)))


Move stream-spitting to closure

Move stream-spitting to closure

--- src/clj/runbld/util/io.clj
+++ src/clj/runbld/util/io.clj
@@ -37,30 +37,32 @@
       (throw+ {:error ::resource-not-found
                :msg (format "cannot find %s" path)}))))

-(defn spit-stream [^java.io.PrintWriter viewer
-                   ^java.io.InputStream input
-                   ^java.io.PrintWriter logfile]
+(defn capture-to-writer [wtr]
+  (fn [line]
+    (binding [*out* wtr]
+      (println line)
+      (flush))))
+
+(defn spit-stream [^java.io.InputStream input
+                   processors]
   (let [bs (atom 0)]
     (doseq [line (line-seq (jio/reader input))]
-      ;; write to the wrapper's inherited IO
-      (binding [*out* viewer]
-        (println line)
-        (flush))
-
-      ;; write to the logfile
-      (binding [*out* logfile]
-        (println line)
-        (flush))
-
-      ;; update the stats
+      (doseq [processor processors]
+        (processor line))
       (swap! bs + (inc ;; for the newline
                    (count (.getBytes line)))))
     @bs))

 (defn spit-process [out-is out-wtr
                     err-is err-wtr]
-  [(future (spit-stream *out* out-is out-wtr))
-   (future (spit-stream *err* err-is err-wtr))])
+  [(future
+     (spit-stream out-is
+                  [(capture-to-writer *out*)
+                   (capture-to-writer out-wtr)]))
+   (future
+     (spit-stream err-is
+                  [(capture-to-writer *err*)
+                   (capture-to-writer err-wtr)]))])

 (defn which [name]
   (let [res (sh/sh "which" name)]


Random inputs

Random inputs

--- src/clj_mrazik/irc_bot.clj
+++ src/clj_mrazik/irc_bot.clj
@@ -53,6 +53,9 @@
                           "time"     (calendar/format-time (calendar/get-calendar))
                           "sunrise"  (schedule/get-sunrise (:geolocation @dyncfg/configuration))
                           "sunset"   (schedule/get-sunset  (:geolocation @dyncfg/configuration))
+                          "die"      "thanks for your feedback, I appreciate it"
+                          "Good bot" "I know"
+                          "Good bot." "I know"
                           "?")]
         (str prefix response)))


Better styling

Better styling

--- src/cljs/chatapp/core.cljs
+++ src/cljs/chatapp/core.cljs
@@ -47,35 +47,36 @@

 ;; Other stuff
 (defn message [message]
-  [:div
-   [:span {:class (:style message)}
-    (:message message)]])
+  [:li {:class "list-group-item"}
+   (:message message)])

 (defn message-list []
   (let [messages (re-frame/subscribe [:messages])]
     (fn []
-      [:div
+      [:ul {:class "list-group"}
        (for [m @messages]
          (message m))])))

 (defn demo []
   (let [val (re-frame/subscribe [:message-text])]
     (fn []
-      [:div {:class "row"}
-       [:div {:class "col-lg-6"}
-        [:div {:class "input-group"}
-         [:input {:type        "text"
-                  :value       @val
-                  :placeholder "Enter text to reverse!"
-                  :class       "form-control"
-                  :on-change   #(re-frame/dispatch [:new-message-text (-> % .-target .-value)])}]
-         [:span {:class "input-group-btn"}
-          [:button {:type     "button"
-                    :class    "btn btn-default"
-                    :on-click #(re-frame/dispatch [:send-message])}
-           "Send"]]
-         ]]
-       [message-list]])))
+      [:div {:class "container-fluid"}
+       [:div
+        [message-list]]
+       [:div {:class "row"}
+        [:div {:class "col-lg-6"}
+         [:div {:class "input-group"}
+          [:input {:type        "text"
+                   :value       @val
+                   :placeholder "Enter text to reverse!"
+                   :class       "form-control"
+                   :on-change   #(re-frame/dispatch [:new-message-text (-> % .-target .-value)])}]
+          [:span {:class "input-group-btn"}
+           [:button {:type     "button"
+                     :class    "btn btn-default"
+                     :on-click #(re-frame/dispatch [:send-message])}
+            "Send"]]
+          ]]]])))

 (defn start []
   (re-frame/dispatch-sync [:initialise-db])


Removing freestanding URL transformer

Removing freestanding URL transformer

See https://app.asana.com/0/17212341701456/45675284737104 for details.

--- src/cljs/memento/core.cljs
+++ src/cljs/memento/core.cljs
@@ -21,18 +21,6 @@
 ;;;; Data and helpers
 ;;;;------------------------------

-(defn autourl-freestanding-transformer
-  "Transforms a URL even if it's not surrounded by <>"
-  [text state]
-  [(if (:code state)
-     text
-     (clojure.string/replace
-       text
-       #"https?://[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]"
-       #(str "" % "")))
-   state])
-
-
 (defn paragraph-on-single-line
   "Adds a
 even when we're at the end of the file and the last line is empty, so that
   we consistently return lines wrapped in paragraph even if it's free-standing text.
@@ -62,7 +50,6 @@
    transformers/inline-code
    transformers/autoemail-transformer
    transformers/autourl-transformer
-   autourl-freestanding-transformer
    transformers/link
    transformers/reference-link
    transformers/li


Showing refined thought date on the panel header

--- src/cljs/memento/core.cljs
+++ src/cljs/memento/core.cljs
@@ -365,7 +365,7 @@
     (if @focus
       [:div {:class "col-sm-10 col-sm-offset-1"}
        [:div {:class "panel panel-default"}
-        [:div {:class "panel-heading"} "Refining..."
+        [:div {:class "panel-heading"} "Refining... " [:i [:small "(from " (:created @focus) ")"]]
          [:button {:type "button" :class "close" :aria-hidden "true" :on-click #(dispatch [:refine nil])} "×"]]
         [:div {:class "panel-body"}
          [:p {:dangerouslySetInnerHTML {:__html (md->html (:thought @focus) :replacement-transformers md-transformers)}}]


Refactor tools.reader call in replumb.repl/read and read-string

This patch also starts using tools.reader.impl.commons/skip-line, which is not a public API and
might change in the future.

--- src/cljs/replumb/repl.cljs
+++ src/cljs/replumb/repl.cljs
@@ -5,6 +5,7 @@
             [cljs.tagged-literals :as tags]
             [cljs.tools.reader :as r]
             [cljs.tools.reader.reader-types :as rt]
+            [cljs.tools.reader.impl.commons :as rc]
             [cljs.analyzer :as ana]
             [cljs.env :as env]
             [cljs.repl :as repl]
@@ -58,15 +59,26 @@
   [f m]
   (reduce-kv (fn [r k v] (assoc r (f k) v)) {} m))

-(defn repl-read-string
-  "Try to read a string binding all the standard data readers. This
-  function throws if a valid form cannot be found."
-  [line]
+(defn read
+  "Reading forms from a reader (see clojure.tools.reader.reader-types
+  for reader implementations). This function throws if a valid form
+  cannot be found."
+  [opts rdr]
   (binding [ana/*cljs-ns* (:current-ns @app-env)
             env/*compiler* st
             r/*data-readers* tags/*cljs-data-readers*
             r/resolve-symbol ana/resolve-symbol]
-    (r/read-string {:read-cond :allow :features #{:cljs}} line)))
+    (r/read opts rdr)))
+
+(defn read-string
+  "Reading forms from a string. This function throws if a valid one
+  cannot be found."
+  [opts s]
+  (binding [ana/*cljs-ns* (:current-ns @app-env)
+            env/*compiler* st
+            r/*data-readers* tags/*cljs-data-readers*
+            r/resolve-symbol ana/resolve-symbol]
+    (r/read-string opts s)))

 (defn ns-form?
   [form]
@@ -77,12 +89,6 @@
   cljs.analyzer/resolve-macro-var) a macro?"
   [var]
   (:macro var))
-
-(defn extract-namespace
-  [source]
-  (let [first-form (repl-read-string source)]
-    (when (ns-form? first-form)
-      (second first-form))))

 (defn resolve
   "From cljs.analyzer.api.clj. Given an analysis environment resolve a
@@ -640,8 +646,10 @@
                                                  r/resolve-symbol ana/resolve-symbol]
                                          (let [source (:source result)
                                                rdr (rt/source-logging-push-back-reader source)]
-                                           (dotimes [_ (dec (:line var))] (rt/read-line rdr))
-                                           (-> (r/read {:read-cond :allow :features #{:cljs}} rdr)
+                                           ;; AR - Skip lines using cljs.tools.reader.impl.commons
+                                           ;; not a public API so it might change in the future
+                                           (dotimes [_ (dec (:line var))] (rc/skip-line rdr))
+                                           (-> (read {:read-cond :allow :features #{:cljs}} rdr)
                                                meta
                                                :source
                                                common/wrap-success
@@ -715,13 +723,11 @@

 (defn last-form
   [source]
-  (let [rdr (rt/string-push-back-reader source)
-        eof (js-obj)
-        read #(r/read {:eof eof} rdr)]
+  (let [eof (js-obj)
+        read #(read-string {:eof eof} source)]
     (loop [first-form (read)
            second-form (read)]
-      (if (identical? eof second-form)
-        first-form
+      (if (identical? eof second)
         (recur second-form (read))))))

 (defn process-load-file
@@ -949,7 +955,7 @@
   read-eval-call."
   [opts cb source]
   (try
-    (let [expression-form (repl-read-string source)
+    (let [expression-form (read-string {:read-cond :allow :features #{:cljs}} source)
           opts (normalize-opts opts) ;; AR - does the whole user option processing
           data {:form expression-form
                 :ns (:current-ns @app-env)


Rename side-effecting functions in data in order to follow -fn convention

--- src/cljs/replumb/repl.cljs
+++ src/cljs/replumb/repl.cljs
@@ -237,13 +237,13 @@

 (defn call-side-effect!
   "Execute the correct side effecting function from data.
-  Handles :side-effect!, :on-error! and on-success!."
+  Handles :side-effect-fn!, :on-error-fn! and on-success-fn!."
   [data {:keys [value error]}]
-  (if-let [f! (:side-effect! data)]
+  (if-let [f! (:side-effect-fn! data)]
     (f!)
     (if-not error
-      (when-let [s! (:on-success! data)] (s!))
-      (when-let [e! (:on-error! data)] (e!)))))
+      (when-let [s! (:on-success-fn! data)] (s!))
+      (when-let [e! (:on-error-fn! data)] (e!)))))

 (defn warning-error-map!
   "Checks if there has been a warning and if so will return the correct
@@ -269,11 +269,11 @@
   additional stuff:

   * :form the source form that has been eval-ed
-  * :on-success! 0-arity function that will be executed on success
-  * :on-error! 0-arity function that will be executed on error
-  * :side-effect! 0-arity function that if present will be executed for
-    both success and error, effectively disabling the individual
-    on-success!  and on-error!
+  * :on-success-fn! 0-arity function that will be executed on success
+  * :on-error-fn! 0-arity function that will be executed on error
+  * :side-effect-fn! 0-arity function that if present will be executed
+  for both success and error, effectively disabling the individual
+  on-success-fn! and on-error-fn!

   Call-back! supports the following opts:

@@ -285,8 +285,8 @@
   1. The opts map passed here overrides the environment options.
   2. This function will also clear the :last-eval-warning flag in
   app-env.
-  3. It will execute (:side-effect!) or (on-success!)  and (on-error!)
-  *before* the callback is called.
+  3. It will execute (:side-effect-fn!) or (on-success-fn!)
+  and (on-error-fn!)  *before* the callback is called.

   ** Every function in this namespace should call call-back! as
   single point of exit. **"
@@ -295,7 +295,7 @@
   ([opts cb data res]
    (when (:verbose opts)
      (common/debug-prn "Calling back!\n" (with-out-str (pprint {:opts (common/filter-fn-keys opts)
-                                                                :data data
+                                                                :data (common/filter-fn-keys data)
                                                                 :res res}))))
    (let [new-map (warning-error-map! opts res)]
      (let [{:keys [value error]} new-map]
@@ -329,8 +329,8 @@
                  (fn [{error :error}]
                    (call-back! opts cb
                                (merge data
-                                      {:side-effect! #(when is-self-require?
-                                                        (swap! app-env assoc :current-ns restore-ns))})
+                                      {:side-effect-fn! #(when is-self-require?
+                                                           (swap! app-env assoc :current-ns restore-ns))})
                                (if error
                                  error
                                  (common/wrap-success nil))))))))
@@ -377,7 +377,7 @@
            (call-back! opts cb data (common/error-argument-must-be-symbol "in-ns" ex-info-data))
            (if (some (partial = ns-symbol) (known-namespaces))
              (call-back! opts cb
-                         (merge data {:side-effect! #(swap! app-env assoc :current-ns ns-symbol)})
+                         (merge data {:side-effect-fn! #(swap! app-env assoc :current-ns ns-symbol)})
                          (common/wrap-success nil))
              (let [ns-form `(~'ns ~ns-symbol)]
                (cljs/eval
@@ -387,7 +387,7 @@
                 (fn [error]
                   (call-back! opts
                               cb
-                              (merge data {:on-success! #(swap! app-env assoc :current-ns ns-symbol)})
+                              (merge data {:on-success-fn! #(swap! app-env assoc :current-ns ns-symbol)})
                               (if error
                                 (common/wrap-error error)
                                 (common/wrap-success nil)))))))))))))
@@ -521,8 +521,8 @@
                              (common/debug-prn "Evaluation returned: " res))
                            (call-back! opts cb
                                        (merge data
-                                              {:on-success! #(do (process-1-2-3 data expression-form (:value res))
-                                                                 (swap! app-env assoc :current-ns (:ns res)))})
+                                              {:on-success-fn! #(do (process-1-2-3 data expression-form (:value res))
+                                                                    (swap! app-env assoc :current-ns (:ns res)))})
                                        res))))))
     (catch :default e
       (when (:verbose opts)


Add :end-turn-alert text for modal

Add :end-turn-alert text for modal

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -60,6 +60,7 @@
     (str "To play multiplayer follow the instructions "
          ""
          "here.")
+    :end-turn-alert "Are you sure you want to end your turn? You still have available moves."
     }})

 ;; TODO: remove redundant id keys (?)


Should be checking that repairer not target can repair

Not sure when this got changed...

--- src/cljs/zetawar/game.cljs
+++ src/cljs/zetawar/game.cljs
@@ -728,7 +728,7 @@

 (defn field-repair-tx
   ([db game repairer target]
-   (let [new-state (check-can-field-repair db game target)]
+   (let [new-state (check-can-field-repair db game repairer)]
      (check-in-range db repairer target)
      (check-repairable db game target)
      (check-has-repairable-armor-type db game repairer target)


Revert "Adding failing test to test ci."

This reverts commit 788e5af5fbec49f0b77ea36b05831145dd610c23.


CMR-1297 Removes extraneous update-in.

CMR-1297 Removes extraneous update-in.

--- search-app/src/cmr/search/results_handlers/atom_results_handler.clj
+++ search-app/src/cmr/search/results_handlers/atom_results_handler.clj
@@ -464,4 +464,4 @@

 (defmethod qs/single-result->response :atom
   [context query results]
-  (qs/search-results->response context query (update-in results [:items] (partial take 1))))
+  (qs/search-results->response context query results))


updating header

updating header

--- test/simplecl/verlet_test.clj
+++ test/simplecl/verlet_test.clj
@@ -1,4 +1,6 @@
 (ns simplecl.verlet-test
+  "2D Verlet physics cloth simulation example."
+  ^{:author "Karsten Schmidt"}
   (:import
     [java.awt Color Graphics2D RenderingHints]
     [java.awt.image BufferedImage]


added TODO comment

added TODO comment

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -95,6 +95,7 @@
     om/IRender
     (render [this]
       (dom/span nil
+        ; TODO: download progress should be somewhere else...
         (if-not (nil? (:download-progress data))
           (dom/div nil "Downloading: " (:download-progress data) "%"))
         (apply dom/div nil


also make the branch picker a component

also make the branch picker a component

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -38,32 +38,38 @@
    [:li [:a {:href "#heroku"} "Heroku"]]
    [:li [:a {:href "#deployment"} "Other Deployments"]]])

-(defn branch-picker [project-data controls-ch & {:keys [button-text channel-message channel-args]
-                                                 :or {button-text "Start a build"
-                                                      channel-message :started-edit-settings-build}}]
-  (let [project (:project project-data)
-        project-id (project-model/id project)
-        default-branch (:default_branch project)
-        settings-branch (get project-data :settings-branch default-branch)]
-    [:form
-     [:input {:name "branch"
-              :required true
-              :type "text"
-              :value settings-branch
-              ;; XXX typeahead
-              :on-change #(utils/edit-input controls-ch state/project-settings-branch-path %)}]
-     [:label {:placeholder "Test settings on..."}]
-     (forms/stateful-button
-      [:input
-       {:value button-text
-        :on-click #(do (put! controls-ch [channel-message (merge {:project-id project-id
-                                                                  :branch settings-branch}
-                                                                 channel-args)])
-                       false)
-        :data-api-count 2
-        :data-loading-text "Starting..."
-        :data-success-text "Started..."
-        :type "submit"}])]))
+(defn branch-picker [project-data owner opts]
+  (reify
+    om/IRender
+    (render [_]
+      (let [{:keys [button-text channel-message channel-args]
+             :or {button-text "Start a build"
+                  channel-message :started-edit-settings-build}} opts
+            project (:project project-data)
+            project-id (project-model/id project)
+            default-branch (:default_branch project)
+            settings-branch (get project-data :settings-branch default-branch)
+            controls-ch (om/get-shared owner [:comms :controls])]
+        (html
+         [:form
+          [:input {:name "branch"
+                   :required true
+                   :type "text"
+                   :value settings-branch
+                   ;; XXX typeahead
+                   :on-change #(utils/edit-input controls-ch state/project-settings-branch-path %)}]
+          [:label {:placeholder "Test settings on..."}]
+          (forms/stateful-button
+           [:input
+            {:value button-text
+             :on-click #(do (put! controls-ch [channel-message (merge {:project-id project-id
+                                                                       :branch settings-branch}
+                                                                      channel-args)])
+                            false)
+             :data-api-count 2
+             :data-loading-text "Starting..."
+             :data-success-text "Started..."
+             :type "submit"}])])))))

 (defn overview [project-data owner]
   (reify
@@ -195,7 +201,7 @@
        (list
         (when (:parallelism-edited project-data)
           [:div.try-out-build
-           (branch-picker project-data controls-ch :button-text (str "Try a build!"))])
+           (om/build branch-picker project-data {:opts {:button-text (str "Try a build!")}})])
         [:form.parallelism-items
          (for [parallelism (range 1 (max (plan-model/max-parallelism plan)
                                          (inc 24)))]
@@ -364,12 +370,13 @@
                                                                     :extra extra}}])
                                      false)}])
             [:div.try-out-build
-             (branch-picker project-data controls-ch
-                            :button-text "Save & Go!"
-                            :channel-message :saved-test-commands-and-build
-                            :channel-args {:project-id project-id
-                                           :settings {:test test
-                                                      :extra extra}})]]]])))))
+             (om/build branch-picker
+                       project-data
+                       {:opts {:button-text "Save & Go!"
+                               :channel-message :saved-test-commands-and-build
+                               :channel-args {:project-id project-id
+                                              :settings {:test test
+                                                         :extra extra}}}})]]]])))))

 (defn fixed-failed-input [project controls-ch field]
   (let [notify_pref (get project field)


crudely display time

crudely display time

--- src/mccarthy_animation/core.cljc
+++ src/mccarthy_animation/core.cljc
@@ -20,7 +20,7 @@
   (quil/color-mode :hsb) ; Set color mode to HSB (HSV) instead of default RGB.

   ;; text
-  (quil/text-font (quil/create-font "DejaVu Sans" 10 true))
+  (quil/text-font (quil/create-font "DejaVu Sans" 64 true))

   ;; setup function returns initial state. It contains
   ;; circle color and position.
@@ -88,6 +88,9 @@

   ;;(js/console.log (str "hero: " (:position (:hero state))))

+  ;; hard-code the sizes in pixels, it's the only way to fly in 1983
+  (quil/text (str (let [h (str (quil/hour))] (if (= 1 (count h)) (str " " h) h)) ":" (let [m (str (quil/minute))] (if (= 1 (count m)) (str "0" m) m))) 135 70)
+
   ;; draw hero
   (quil/image (char/get-image (:hero state))
            (get-in state [:hero :position :x])


Now boot test executes both frontend and backend

--- resources/leiningen/new/lambone/common/dev/boot.clj
+++ resources/leiningen/new/lambone/common/dev/boot.clj
@@ -105,14 +105,15 @@
 (defn test-backend
   "Run tests once for the backend (uses clojure.test)."
   [options]
-  (util/dbug "Options:\n%s\n" (with-out-str (pprint options)))
-  (apply-options! options)
-  (require 'adzerk.boot-test)
-  (let [test (resolve 'adzerk.boot-test/test)]
-    (comp (with-pass-thru _
-            (util/info "Testing the backend, prepend with watch for auto testing...\n"))
-          (apply test (flatten (seq (:test options)))))))
-<% endif %><% if any frontend %>
+  (comp (with-pass-thru _
+          (util/dbug "Options:\n%s\n" (with-out-str (pprint options)))
+          (apply-options! options)
+          (require 'adzerk.boot-test))
+        (with-pre-wrap fs
+          (let [test (resolve 'adzerk.boot-test/test)
+                middleware (apply test (flatten (seq (:test options))))]
+            ((middleware identity) fs)))))<% endif %>
+<% if any frontend %>
 (defn build-frontend
   "Return a boot task for building the frontend.

@@ -170,11 +171,11 @@
   optionally accepts (a set of) symbols that are used for testing only
   some namespaces."
   [options]
-  (util/dbug "Options:\n%s\n" (with-out-str (pprint options)))
-  (apply-options! options)
-  (require 'crisptrutski.boot-cljs-test)
-  (let [test-cljs (resolve 'crisptrutski.boot-cljs-test/test-cljs)]
-    (comp (with-pass-thru _
-            (util/info "Testing the frontend, prepend with watch for auto testing...\n"))
-          (apply test-cljs (flatten (seq (:test-cljs options)))))))
-<% endif %>
+  (comp (with-pass-thru _
+          (util/dbug "Options:\n%s\n" (with-out-str (pprint options)))
+          (apply-options! options)
+          (require 'crisptrutski.boot-cljs-test))
+        (with-pre-wrap fs
+          (let [test-cljs (resolve 'crisptrutski.boot-cljs-test/test-cljs)
+                middleware (apply test-cljs (flatten (seq (:test-cljs options))))]
+            ((middleware identity) fs)))))<% endif %>


[FLINK-10754] Enable local recovery for Jepsen based tests

--- flink-jepsen/src/jepsen/flink/db.clj
+++ flink-jepsen/src/jepsen/flink/db.clj
@@ -57,7 +57,7 @@
    :taskmanager.numberOfTaskSlots      taskmanager-slots
    :yarn.application-attempts          99999
    :slotmanager.taskmanager-timeout    10000
-   :state.backend.local-recovery       "false"
+   :state.backend.local-recovery       "true"
    :taskmanager.registration.timeout   "30 s"})

 (defn write-configuration!


avoid boxed-integer addition

avoid boxed-integer addition

--- src/asphalt/internal/param.clj
+++ src/asphalt/internal/param.clj
@@ -60,7 +60,7 @@
                                         `(count (get ~params-sym ~(get param-keys-vec idx)))))
                          param-types-vec)]
       `(reduce (fn [cv# ^long pcount#]
-                 (conj cv# (unchecked-add (last cv#) pcount#)))
+                 (conj cv# (unchecked-add (int (last cv#)) pcount#)))
          (vector-of :int 1)
          [~@multi-counts]))))


Refactor attack to provide attack-type used

--- src/obb_rules/actions/attack.clj
+++ src/obb_rules/actions/attack.clj
@@ -8,22 +8,18 @@

 (defn- advance-and-check-target
   "Goes to the next coordinate and checks if the target is valid"
-  [board attacker target current-coordinate distance]
+  [board attacker target current-coordinate distance bypassed-element?]
   (let [unit (element-unit attacker)
         direction (element-direction attacker)
         next-coordinate (dir/update direction current-coordinate)
         next-element (get-element board next-coordinate)
-        may-try-next? (or (nil? next-element) (element/catapult-attack? attacker))]
+        may-try-next? (or (nil? next-element) (element/catapult-attack? attacker))
+        bypassed? (or bypassed-element? (nil? next-element))]
     (cond
-      (= next-element target) true
-      (>= distance (unit-range unit)) false
-      may-try-next? (recur board attacker target next-coordinate (+ 1 distance))
-      :else false)))
-
-(defn- in-range?
-  "Checks if the target element is in range"
-  [board attacker target]
-  (advance-and-check-target board attacker target (element-coordinate attacker) 1))
+      (= next-element target) (if bypassed? :catapult :direct)
+      (>= distance (unit-range unit)) :out-of-range
+      may-try-next? (recur board attacker target next-coordinate (+ 1 distance) bypassed?)
+      :else :out-of-range)))

 (defn- attack-restrictions
   "Checks if the attack is possible"
@@ -34,8 +30,17 @@
     (frozen? attacker) "FrozenElement"
     (nil? target) "EmptyTarget"
     (simplify/not-name= player (element-player attacker)) "NotOwnedElement"
-    (not (in-range? board attacker target)) "OutOfRange"
     (= (element-player attacker) (element-player target)) "SamePlayer"))
+
+(defn- resolve-attack
+  "Checks if the target element is in range"
+  [board player attacker target]
+  (if-let [error-msg (attack-restrictions board player attacker target)]
+    [false error-msg]
+    (let [lock-target (advance-and-check-target board attacker target (element-coordinate attacker) 1 false)]
+      (if (= :out-of-range lock-target)
+        [false "OutOfRange"]
+        [true lock-target]))))

 (defn- process-attack
   "Processes the attack"
@@ -51,8 +56,9 @@
   [[coord target-coord]]
   (fn attacker [board player]
     (let [attacker (get-element board coord)
-          target (get-element board target-coord)]
-      (if-let [error (attack-restrictions board player attacker target)]
-        (action-failed error)
+          target (get-element board target-coord)
+          [success? info] (resolve-attack board player attacker target)]
+      (if-not success?
+        (action-failed info)
         (process-attack board attacker target)))))


use apply-default-if, not apply-default

use apply-default-if, not apply-default

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -50,7 +50,8 @@
   (log/debug (str "English: do-defaults (pre) on tree: " (parse/fo-ps tree fo)))
   (let [result
         (-> tree
-            (apply-default
+            (apply-default-if
+             verb-default?
              {:synsem {:cat :verb
                        :sem {:tense :present
                              :aspect :simple}


Killed job reaction for greedy.

Killed job reaction for greedy.

--- src/onyx/log/commands/common.clj
+++ src/onyx/log/commands/common.clj
@@ -316,12 +316,27 @@
        (anticipating-coverage? old new job-id)))

 (defmulti volunteer-via-new-job?
-  (fn [scheduler old new diff]
+  (fn [scheduler old new diff state]
     scheduler))

+(defmulti volunteer-via-killed-job?
+  (fn [scheduler old new diff state]
+    scheduler))
+
 (defmethod volunteer-via-new-job? :onyx.job-scheduler/greedy
-  [scheduler old new diff]
+  [scheduler old new diff state]
   (when (zero? (count (incomplete-jobs old)))
     (let [tasks (get-in new [:tasks (:job diff)])]
       (>= (count (get-in [new :peers])) (count tasks)))))

+(defmethod volunteer-via-killed-job? :onyx.job-scheduler/greedy
+  [scheduler old new diff state]
+  (let [peers (get-in [old :allocations (first diff)])]
+    (when (some #{(:id state)} (into #{} peers))
+      (seq
+       (filter
+        (fn [job]
+          (let [tasks (get-in new [:tasks job])]
+            (>= (count (get-in [new :peers])) (count tasks))))
+        (:jobs new))))))
+


defaults related to reflexive verbs and their arguments

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -226,13 +226,20 @@
    ;; reflexive=false
    (default {:synsem {:cat :verb
                       :sem {:reflexive false}}})
-
+
+   ;; for transitive, non-reflexive verbs, the 2nd arg is non-reflexive by default.
+   (default {:synsem {:cat :verb
+                      :sem {:reflexive false}
+                      :subcat {:2 {:reflexive false}}}})
+
+   ;; for transitive, reflexive verbs, the 2nd arg is reflexive by default.
    (default
     (let [subject-agr (atom :top)]
       {:synsem {:sem {:reflexive true}
                 :cat :verb
                 :subcat {:1 {:agr subject-agr}
-                         :2 {:agr subject-agr}}}}))
+                         :2 {:reflexive true
+                             :agr subject-agr}}}}))
    (default
     {:synsem {:cat :verb
               :subcat {:2 {:subcat '()}}}})


Replayed state should be written via trace.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -330,7 +330,7 @@
     (swap! window-state
            (fn [wstate]
              (let [replayed-state (state-extensions/playback-log-entries state-log event wstate)]
-               (info (:onyx.core/task-id event) "replayed state:" replayed-state)
+               (trace (:onyx.core/task-id event) "replayed state:" replayed-state)
                replayed-state))))
   event)


added venir

added venir

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -841,6 +841,16 @@
                    :pred :voi}
              :subcat '()}}

+   "venir" {:espanol {:futuro-stem "vendr"
+                      :present {:1sing "vengo"
+                                :2sing "vienes"
+                                :3sing "viene"
+                                :3plur "vienen"}
+                      :preterito-stem "vin"}
+            :synsem {:cat :verb
+                     :sem {:subj {:animate true}
+                           :pred :come}}}
+
    "ver" {:espanol  {:present {:1sing "veo"
                                :2plur "veis"}
                      :preterito {:1sing "vi"


added farsi male male

added farsi male male

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -1073,13 +1073,25 @@
      [(merge shared-part-of-fare
              {:synsem {:pred :do}})
       (merge shared-part-of-fare
-             {:synsem {:pred :make}})])
-
-
-
-
-
-
+             {:synsem {:pred :make}})
+      (merge shared-part-of-fare
+             (let [subject-semantics (ref {:human true})
+                  subject-agr (ref :top)]
+               {:synsem {:cat :verb
+                         :essere true
+                         :sem {:pred :hurt-oneself
+                               :reflexive true
+                               :subj subject-semantics
+                               :obj subject-semantics}
+                         :subcat {:1 {:agr subject-agr
+                                      :sem subject-semantics}
+                                  :2 {:agr subject-agr
+                                      :pronoun true
+                                      :reflexive true
+                                      :sem subject-semantics}
+                                  :3 {:cat :adverb
+                                      :sem {:pred :bad}}}}}))])
+
       "finire"  {:italiano {:boot-stem1 "finisc"
                             :boot-stem2 "fin"}
                  :synsem {:cat :verb
@@ -1442,6 +1454,9 @@
                           :pred :madre
                           :child false}}})

+    "male" {:synsem {:cat :adverb
+                     :sem {:pred :bad}}}
+
    "mancare"  {:italiano {:future-stem "mancher"}
                :synsem {:cat :verb
                         :sem {:pred :mancare}}}


Rearrange and comment.

Rearrange and comment.

--- src/klangmeister/core.cljs
+++ src/klangmeister/core.cljs
@@ -9,15 +9,14 @@
     [accountant.core :as accountant]
     [secretary.core :as secretary :include-macros true]))

-(defn empty-state []
-  (reagent/atom
-    {:audiocontext (if js/window.AudioContext.
-                     (js/window.AudioContext.)
-                     (js/window.webkitAudioContext.))}))
+(defn audio-context
+  "Construct an audio context in a way that works even if it's prefixed."
+  []
+  (if js/window.AudioContext. ; Some browsers e.g. Safari don't use the unprefixed version yet.
+    (js/window.AudioContext.)
+    (js/window.webkitAudioContext.)))

-(defonce state-atom (empty-state))
-
-(def handle! (framework/handler-for state-atom))
+(defonce state-atom (reagent/atom {:audiocontext (audio-context)}))

 (secretary/defroute "/klangmeister/"            [query-params] (session/put! :gist (:gist query-params))
                                                                (session/put! :current-page view/about))
@@ -31,19 +30,20 @@
 (secretary/defroute "/klangmeister/reference"   [] (session/put! :current-page view/reference))
 (secretary/defroute "/klangmeister/about"       [] (session/put! :current-page view/about))

-(defn current-page []
+(def handle!
+  "An handler that components can use to raise events."
+  (framework/handler-for state-atom))
+
+(defn current-page
+  "Extract the current page from the session and use it to build the page."
+  []
   [(session/get :current-page) handle! state-atom])

 (defn mount-root []
-  (let [default (or (session/get :gist) "4b04fd7f2d361c6604c4")]
-    (handle! (action/->Import default :main))
-    (reagent/render
-      [current-page]
-      js/document.body)))
-
-(defn main []
   (accountant/configure-navigation!)
   (accountant/dispatch-current!)
-  (mount-root))
+  (let [default (or (session/get :gist) "4b04fd7f2d361c6604c4")]
+    (handle! (action/->Import default :main)) ; Pull in the content of the main code pane.
+    (reagent/render [current-page] js/document.body)))

-(main)
+(mount-root)


Add our first style, just a bit of margin

--- src/lab_notebook/core.cljs
+++ src/lab_notebook/core.cljs
@@ -8,7 +8,7 @@
   (reify
     om/IRender
     (render [this]
-      (dom/div nil
+      (dom/div #js {:style #js {:marginTop "2em"}}
         (dom/div nil (:summary cursor))
         (dom/div nil (:date-time cursor))
         (dom/div nil (:notes cursor))))))


increasing await time

increasing await time

--- test/celestial/test/hooks.clj
+++ test/celestial/test/hooks.clj
@@ -45,12 +45,12 @@
           (send-off hosts fail)
           (update-dns {:event :success :workflow :create :system-id 1
                        :domain "local" :dnsmasq "192.168.1.1" :user "foo" }) => truthy
-          (await-for 4000 hosts) => true
+          (await-for 8000 hosts) => true
           (agent-error hosts) => nil)

     (with-redefs [execute fail]
       (fact "failing execution in action"
           (update-dns {:event :success :workflow :create :system-id 1
                        :domain "local" :dnsmasq "192.168.1.1" :user "foo" }) => truthy
-          (await-for 2000 hosts) => true
+          (await-for 8000 hosts) => true
           (agent-error hosts) => nil))))


Delete capability for tracks.

Delete capability for tracks.

--- sonic-jam/src/sonic_jam/core.cljs
+++ sonic-jam/src/sonic_jam/core.cljs
@@ -3,7 +3,7 @@
                    [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
-            [cljs.core.async :refer [chan <! >!]]
+            [cljs.core.async :refer [chan put! <! >!]]
             [chord.client :refer [ws-ch]]))

 (enable-console-print!)
@@ -33,26 +33,20 @@

 (declare grid-view)

-(defn track-editor [{:keys [cursor id index set-state-ch]} owner]
+(defn track-editor [{:keys [cursor id delete-ch]} owner]
   (reify
     om/IInitState
     (init-state [_]
       {:state :init})
     om/IRenderState
-    (render-state [_ state]
-      (let [delete #(let [grid (get (om/observe owner (grids)) id)]
-                      (om/transact! (get grid "tracks")
-                                    (fn [s]
-                                      (print index)
-                                      (vec (concat (subvec s 0 index)
-                                                   (subvec s (+ 1 index) (count s)))))))]
-        (condp = (:state state)
-          :init (dom/p #js {:style #js {:color "#999"}}
-                       (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :open})))} "{~}"))
-          :open (dom/p #js {:style #js {:color "#999"}}
-                       (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :init})))} "{-")
-                       (dom/span #js {:onClick delete} " delete? ")
-                       (dom/span nil "}")))))))
+    (render-state [this state]
+      (condp = (:state state)
+        :init (dom/p #js {:style #js {:color "#999"}}
+                     (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :open})))} "{~}"))
+        :open (dom/p #js {:style #js {:color "#999"}}
+                     (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :init})))} "{-")
+                     (dom/span #js {:onClick #(go (>! delete-ch cursor))} " delete? ")
+                     (dom/span nil "}"))))))

 (defn track-builder [{:keys [cursor id set-state-ch]} owner]
   (reify
@@ -128,7 +122,7 @@
                      (dom/span #js {:onClick commit} " commit? ")
                      (dom/span nil "}")))))))

-(defn track-view [{:keys [cursor id index]} owner]
+(defn track-view [{:keys [cursor id delete-ch]} owner]
   (reify
     om/IInitState
     (init-state [_]
@@ -153,7 +147,7 @@
                                             (repeat id))]
                            (om/build-all cell-view cursors {:state state})))))
                 (dom/td #js {:style #js {:color "#999" :paddingRight "10px"}}
-                        (om/build track-editor {:id id :index index}))
+                        (om/build track-editor {:cursor cursor :id id :delete-ch delete-ch}))
                 (dom/td nil
                         (when (= "grid" (get cursor "type"))
                           (let [id (get cursor "id")
@@ -165,7 +159,19 @@
   (reify
     om/IInitState
     (init-state [_]
-      {:grid-expanded false})
+      (let [delete-ch (chan)]
+        {:grid-expanded false
+         :delete-ch delete-ch}))
+    om/IWillMount
+    (will-mount [this]
+      (let [delete-ch (:delete-ch (om/get-state owner))
+            set-state-ch (:set-state-ch (om/get-state owner))]
+        (go-loop []
+          (let [track (<! delete-ch)
+                cursor (get-in (om/observe owner (grids)) [id "tracks"])]
+            (om/update! cursor (vec (remove (partial = track) cursor)))
+            (put! set-state-ch id)
+            (recur)))))
     om/IRenderState
     (render-state [_ state]
       (let [cursor (get (om/observe owner (grids)) id)]
@@ -181,10 +187,10 @@
                                         :style #js {:color "#999"}}
                                    (str "[-] " id " (" (get cursor "bpc") ")"))
                             (apply dom/table nil
-                                   (let [cursors (map #(hash-map :cursor %1 :id %2 :index %3)
+                                   (let [cursors (map #(hash-map :cursor %1 :id %2 :delete-ch %3)
                                                       (get cursor "tracks")
                                                       (repeat id)
-                                                      (range))]
+                                                      (repeat (:delete-ch state)))]
                                      (om/build-all track-view cursors {:state state})))
                             (om/build track-builder {:cursor (get cursor "tracks")
                                                      :id id


Default cases for condp statements.

Default cases for condp statements.

--- sonic-jam/src/sonic_jam/core.cljs
+++ sonic-jam/src/sonic_jam/core.cljs
@@ -140,7 +140,8 @@
                      (condp = (get cursor "type")
                        "sample" (dom/span nil (str "sample: " (get cursor "sample")))
                        "play" (dom/span nil (str "note: " (get cursor "note")))
-                       "grid" (dom/span nil nil))
+                       "grid" (dom/span nil nil)
+                       (print "Unable to show open type: " (get cursor "type") " This is a bug."))
                      (dom/span nil
                                (om/build param-editor {:cursor (get cursor "params") :id id :set-state-ch set-state-ch}))
                      (dom/span #js {:onClick #(go (>! delete-ch cursor))} " delete? ")
@@ -186,7 +187,7 @@
                                (transition {:state :init})
                                (om/update! cursor tracks)
                                (go (>! set-state-ch id)))
-                      :else (print "cannot commit"))]
+                      (print "Cannot commit."))]
         (condp = (:state state)
           :init (p (dom/span #js {:onClick #(transition {:state :width})} "{+}"))
           :type (p (dom/span #js {:onClick #(transition {:state :init})} (str "{- " (:width state) " ... "))


Fix war task for leiningen 2.0 preview3.

--- src/leiningen/ring/war.clj
+++ src/leiningen/ring/war.clj
@@ -225,11 +225,12 @@
   ([project]
      (war project (default-war-name project)))
   ([project war-name]
-     (when (zero? (compile/compile project))
-       (let [war-path (war-file-path project war-name)]
-         (compile-servlet project)
-         (if (has-listener? project)
-           (compile-listener project))
-         (write-war project war-path)
-         (println "Created" war-path)
-         war-path))))
+     (let [res (compile/compile project)]
+       (when-not (and (number? res) (pos? res))
+         (let [war-path (war-file-path project war-name)]
+           (compile-servlet project)
+           (if (has-listener? project)
+             (compile-listener project))
+           (write-war project war-path)
+           (println "Created" war-path)
+           war-path)))))


Fix up Insights card headers

Fix up Insights card headers

* Link uses route function to build URL.
* Swap `a` and `span` as an quick way to get the style to apply.

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -265,9 +265,10 @@
            [:div.last-build-status
             (om/build svg {:class "badge-icon"
                            :src (-> latest-build build/status-icon common/icon-path)})]
-           [:a {:href (str "/build-insights/dashboard/"
-                           (project :username) "/" (project :reponame))}
-            [:span.project-name (formatted-project-name project)]]
+           [:span.project-name
+            [:a {:href (routes/v1-insights-dashboard {:org (:username project)
+                                                      :repo (:reponame project)})}
+             (formatted-project-name project)]]
            [:div.github-icon
             [:a {:href (:vcs_url project)}
              [:i.octicon.octicon-mark-github]]]


Switch ZK port to not interfere with a running ZK.

--- test/onyx/hornetq/vm_test.clj
+++ test/onyx/hornetq/vm_test.clj
@@ -67,15 +67,15 @@
 (def coord-opts {:hornetq/mode :vm
                  :hornetq/server? true
                  :zookeeper/server? true
-                 :zookeeper.server/port 2181
-                 :zookeeper/address "127.0.0.1:2181"
+                 :zookeeper.server/port 2182
+                 :zookeeper/address "127.0.0.1:2182"
                  :onyx/id id
                  :onyx.coordinator/revoke-delay 5000})

 (def conn (onyx.api/connect (str "onyx:memory//localhost/" id) coord-opts))

 (def peer-opts {:hornetq/mode :vm
-                :zookeeper/address "127.0.0.1:2181"
+                :zookeeper/address "127.0.0.1:2182"
                 :onyx/id id})

 (def v-peers (onyx.api/start-peers conn 1 peer-opts))


Whitespace

Whitespace

--- test/onyx/log/notify_test.clj
+++ test/onyx/log/notify_test.clj
@@ -118,5 +118,3 @@
 (fact (:args entry) => {:id "d"})

 (onyx.api/shutdown-env env)
-
-


Added a todo

Added a todo

--- test/ranked_set/core_test.clj
+++ test/ranked_set/core_test.clj
@@ -9,7 +9,9 @@
          (testing "Adding to an empty set."
                   (is (= (ranked-set-add (empty-ranked-set) 2 5)
                          (->RankedNode nil 2 5 1 nil)))))
-
+; TODO: Add a test which tests the path of:
+; If I attempt to add an element with equivalent magnitude,
+; I don't add it to my set.
 (deftest ranked-set-add-tree
          (let [first-test-tree
                (->RankedNode


Rename migrator functions

Rename migrator functions

--- src/madouc/db/migrator.clj
+++ src/madouc/db/migrator.clj
@@ -8,7 +8,7 @@
   {:store :database
    :migration-dir "migrations/"
    :db {:classname "org.postgresql.Driver"
-        :subprotocol "postgres"
+        :subprotocol "postgresql"
         :subname (format "//%s/%s" (:db-host config) (:db-name config))
         :user (:db-user config)
         :password (:db-password config)}})


Fixed a bug with omitting deadlines in calls to URL fetch.

--- src/appengine_magic/services/url_fetch.clj
+++ src/appengine_magic/services/url_fetch.clj
@@ -58,7 +58,8 @@
     (if follow-redirects
       (.followRedirects fetch-options)
       (.doNotFollowRedirects fetch-options))
-    (.setDeadline fetch-options (double deadline))
+    (when-not (nil? deadline)
+      (.setDeadline fetch-options (double deadline)))
     (let [method-obj (method {:delete HTTPMethod/DELETE
                               :get    HTTPMethod/GET
                               :head   HTTPMethod/HEAD


added subscribe for db objects

added subscribe for db objects

--- src/cljs/dbquery/handlers.cljs
+++ src/cljs/dbquery/handlers.cljs
@@ -36,6 +36,15 @@
        (GET (str "/ds/" db-id "/queries") :handler #(rf/dispatch [:change [:queries db-id] %])
             :error-handler #(rf/dispatch [:change :status [:error (c/error-text %)]])))
      queries)))
+
+(rf/register-sub
+ :dbobjects
+ (fn [state [_ db-id]]
+   (let [dbobjects (reaction (get-in state [:dbobjects db-id]))]
+     (when-not @dbobjects
+       (GET (str "/ds/" db-id "/tables") :handler #(rf/dispatch [:change [:dbobjects db-id] %])
+            :error-handler #(rf/dispatch [:change :status [:error (c/error-text %)]])))
+     dbobjects)))

 ;; event handlers


Change default window size

Change default window size

--- src/clojure/nightcode/core.clj
+++ src/clojure/nightcode/core.clj
@@ -105,8 +105,7 @@
       (s/top-bottom-split (get-editor-pane)
                           (get-builder-pane)
                           :divider-location 0.8
-                          :resize-weight 0.5)
-      :divider-location 0.4)))
+                          :resize-weight 0.5))))

 (defn -main
   "Launches the main window."
@@ -120,7 +119,7 @@
                                  " "
                                  (utils/get-version))
                      :content (get-window-content)
-                     :width 1024
+                     :width 1152
                      :height 768
                      :on-close :exit)
         ; create the shortcut hints for the main buttons


Go back to using KeyListener

Go back to using KeyListener

--- src/clojure/nightmod/input.clj
+++ src/clojure/nightmod/input.clj
@@ -1,11 +1,7 @@
 (ns nightmod.input
-  (:require [nightcode.shortcuts :as shortcuts]
-            [nightcode.ui :as ui]
-            [nightmod.utils :as u]
-            [play-clj.core :as play-clj])
-  (:import [java.awt KeyboardFocusManager KeyEventDispatcher]
-           [java.awt.event ComponentAdapter KeyEvent]
-           [com.badlogic.gdx.backends.lwjgl LwjglInput]
+  (:require [play-clj.core :as play-clj])
+  (:import [com.badlogic.gdx.backends.lwjgl LwjglInput]
+           [java.awt.event KeyListener]
            [nightmod KeyCodeConverter]
            [org.lwjgl.input Keyboard]
            [org.lwjgl.opengl InputImplementation]))
@@ -31,51 +27,28 @@
         impl (proxy [InputImplementation] []
                (pollKeyboard [bb])
                (readKeyboard [bb]))]
-    (.addKeyEventDispatcher
-      (KeyboardFocusManager/getCurrentKeyboardFocusManager)
-      (proxy [KeyEventDispatcher] []
-        (dispatchKeyEvent [^KeyEvent e]
-          (cond
-            ; a key was released in a game
-            (and @ui/tree-selection
-                 (shortcuts/focused-window? window)
-                 (not (.isVisible @u/editor))
-                 (= (.getID e) KeyEvent/KEY_RELEASED))
-            (do
-              (.set impl-field nil impl)
-              (.put key-buf (awt->lwjgl (.getKeyCode e)) (byte 0))
-              (-> game
-                  .getInput
-                  .getInputProcessor
-                  (.keyUp (awt->libgdx (.getKeyCode e)))
-                  play-clj/on-gl)
-              true)
-            ; a key was typed in a game
-            (and @ui/tree-selection
-                 (shortcuts/focused-window? window)
-                 (not (.isVisible @u/editor))
-                 (= (.getID e) KeyEvent/KEY_TYPED))
-            (do
-              (-> game
-                  .getInput
-                  .getInputProcessor
-                  (.keyTyped (.getKeyChar e))
-                  play-clj/on-gl)
-              true)
-            ; a key was pressed in a game
-            (and @ui/tree-selection
-                 (shortcuts/focused-window? window)
-                 (not (.isVisible @u/editor))
-                 (= (.getID e) KeyEvent/KEY_PRESSED))
-            (do
-              (.set impl-field nil impl)
-              (.put key-buf (awt->lwjgl (.getKeyCode e)) (byte 8))
-              (-> game
-                  .getInput
-                  .getInputProcessor
-                  (.keyDown (awt->libgdx (.getKeyCode e)))
-                  play-clj/on-gl)
-              true)
-            ; don't handle
-            :else
-            false))))))
+    (.addKeyListener
+      window
+      (reify KeyListener
+        (keyReleased [this e]
+          (.set impl-field nil impl)
+          (.put key-buf (awt->lwjgl (.getKeyCode e)) (byte 0))
+          (-> game
+              .getInput
+              .getInputProcessor
+              (.keyUp (awt->libgdx (.getKeyCode e)))
+              play-clj/on-gl))
+        (keyTyped [this e]
+          (-> game
+              .getInput
+              .getInputProcessor
+              (.keyTyped (.getKeyChar e))
+              play-clj/on-gl))
+        (keyPressed [this e]
+          (.set impl-field nil impl)
+          (.put key-buf (awt->lwjgl (.getKeyCode e)) (byte 1))
+          (-> game
+              .getInput
+              .getInputProcessor
+              (.keyDown (awt->libgdx (.getKeyCode e)))
+              play-clj/on-gl))))))


Fixing bad function

Fixing bad function

--- src/com/okl/tokenmgr/views.clj
+++ src/com/okl/tokenmgr/views.clj
@@ -78,7 +78,7 @@
                          ""
                          (url-encode app))]
     (html5
-     (gen-dynamic-header (str my-name ":" app))
+     (gen-header (str my-name ":" app))
      [:body
       [:h1 (generate-breadcrumbs app)]
       [:div {:id "testdiv" :style "width:80%;height:300px;"} ""]


logging

logging

--- src/clojure/com/zensol/cisql/db_access.clj
+++ src/clojure/com/zensol/cisql/db_access.clj
@@ -108,7 +108,7 @@
         header (doall (map #(.getColumnLabel meta %)
                            (range 1 (+ 1 col-count))))
         rows (slurp-result-set rs meta)]
-    (log/infof "col-count %d" col-count)
+    (log/debugf "col-count %d" col-count)
     {:header header
      :rows (if (empty? rows) [{}] rows)}))


Add base target="_blank" so links open in new tabs

--- template/index.html.clj
+++ template/index.html.clj
@@ -38,4 +38,5 @@
   (post-list)
   (prev-next-page-link)]

+[:base {:target "_blank"}]


Remove obsolete imports

Remove obsolete imports

--- src/de/kotka/gorilla/nails.clj
+++ src/de/kotka/gorilla/nails.clj
@@ -32,7 +32,6 @@
   (:import
      com.martiansoftware.nailgun.NGContext
      clojure.lang.LineNumberingPushbackReader
-     (clojure.lang Var Compiler)
      (java.io InputStreamReader OutputStreamWriter PrintWriter)))

 (defmacro defnail


GAWB-3660: Infinite spinner due to error in Dockstore "Launch With Firecloud" (#1333)

* simple solution

* pass up at least the status code and status text

--- src/cljs/main/broadfcui/page/external_importer.cljs
+++ src/cljs/main/broadfcui/page/external_importer.cljs
@@ -68,16 +68,16 @@
      (let [{:keys [id version]} props]
        (endpoints/dockstore-get-wdl
         id version
-        (fn [{:keys [success? get-parsed-response]}]
+        (fn [{:keys [success? get-parsed-response status-code status-text]}]
           (if success?
             (swap! state assoc :wdl (:descriptor (get-parsed-response)))
-            (swap! state assoc :load-error (get-parsed-response false)))))))
+            (swap! state assoc :load-error (str "(" status-code ") " status-text)))))))
    :-render-error
    (fn [{:keys [state]}]
      [:div {}
       [:div {:style {:margin "0.5rem 0"}}
        "Error loading WDL. Please verify the workflow path and version and ensure this workflow supports WDL."]
-      [comps/ErrorViewer {:error (:load-error @state)}]])
+      [:div {} "Message from Dockstore: " (:load-error @state)]])
    :-render-export
    (fn [{:keys [props state locals this]}]
      (let [{:keys [id]} props


Refacto.

Refacto.

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -1,7 +1,7 @@
 (ns ^{:doc "Render the views for the application."}
   one.sample.view
   (:use [domina :only (set-html! append! set-styles! styles by-id set-style!
-                       by-class value set-value! set-text! nodes single-node)]
+                       by-class value set-value! set-text! nodes single-node destroy-children!)]
         [domina.xpath :only (xpath)]
         [one.browser.animation :only (play)])
   (:require-macros [one.sample.snippets :as snippets])
@@ -150,7 +150,8 @@

     (set-styles! nsn {:display "block"})

-    (set-html! nsn (str "
" (first lns) "
"))
+    (destroy-children! nsn)
+    (append! nsn (str "
" (first lns) "
"))
     (append! nsn (str "
" (second lns) "
"))))

 (dispatch/react-to #{:state-change-fnx} (fn [_ m] (render-fnx m)))


add diagnostic

add diagnostic

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -1,7 +1,7 @@
 (ns babel.test.en
   (:refer-clojure :exclude [get-in])
   (:require [babel.engine :as engine]
-            [babel.english.grammar :refer [small small-plus-vp-pronoun medium]]
+            [babel.english.grammar :refer [small small-plus-plus-np small-plus-vp-pronoun medium]]
             [babel.english.lexicon :refer [lexicon]]
             [babel.english.morphology :refer [fo get-string]]
             [babel.english.workbook :refer [analyze generate parse]]


Add samse test

Add samse test

--- test/clj_bwa/t_core.clj
+++ test/clj_bwa/t_core.clj
@@ -33,7 +33,9 @@
 (def test-db-files ["test-resources/test.fa.amb"
                     "test-resources/test.fa.ann"
                     "test-resources/test.fa.bwt"
-                    "test-resources/test.fa.pac"])
+                    "test-resources/test.fa.pac"
+                    "test-resources/test.fa.sa"])
+(def test-sai-file "test-resources/test.sai")
 (def test-fq-file "test-resources/test.fq")

 (def temp-fa-file (str temp-dir "/test.fa"))
@@ -67,5 +69,22 @@
     (with-out-file temp-out
       (bwa/aln (str temp-dir "/test.fa")
                (str temp-dir "/test.fq")
-               (str temp-dir "/test.sai")
+               (str temp-dir "/out.sai")
                (bwa/aln-option))) => anything))
+
+;; samse test
+;; ----------
+
+(with-state-changes [(before :facts (do (prepare-cache!)
+                                        (doseq [f test-db-files]
+                                          (fs/copy f (str temp-dir "/" (fs/base-name f))))
+                                        (fs/copy test-sai-file (str temp-dir "/test.sai"))
+                                        (fs/copy test-fq-file (str temp-dir "/test.fq"))))
+                     (after :facts (clean-cache!))]
+  (fact "about samse"
+    (with-out-file temp-out
+      (bwa/samse (str temp-dir "/test.fa")
+                 (str temp-dir "/test.sai")
+                 (str temp-dir "/test.fq")
+                 (str temp-dir "/out.sam")
+                 (bwa/samse-option))) => anything))


comment out line that is causing reactjs errors for the moment

--- src/cljs/apollo/client/pages.cljs
+++ src/cljs/apollo/client/pages.cljs
@@ -44,8 +44,10 @@
     om/IWillMount
     (will-mount [_]
       (om/set-state! owner :keypress-chan (chan (dropping-buffer 1)))
-      (om/transact! (state/ref-post-filter)
-                    (fn [p] (assoc p :value nil)))
+      ;; this is causing errors in react, dont know why
+      ;; (om/transact! (state/ref-post-filter)
+      ;;               (fn [p] (assoc p :value nil)))
+
       (sub events/event-bus :keypress (om/get-state owner :keypress-chan))
       (go
         (loop []


Add a fn for merging data received via ajax with the card-list

--- src/cljs/decktouch/card-data.cljs
+++ src/cljs/decktouch/card-data.cljs
@@ -27,9 +27,21 @@
                                                     status-text)))})
     c))

+(defn add-more-card-data [list-o-cards card-data]
+  "Return a vector based on list-o-cards but every item in
+   list-o-cards with a matching 'name' value as card-data
+   will be merged with card-data"
+  (into []
+        (for [c list-o-cards]
+          (do
+          (if (= (get card-data "name") (get c "name"))
+            card-data
+            c)))))
+
 (defn add-card-to-list! [card-name]
   (do
     (swap! card-list conj {"name" card-name})
     (go
-      (let [response (<! (<lookup-card-data card-name))]
-        (.log js/console response)))))+      (let [response (js->clj (.parse js/JSON (<! (<lookup-card-data card-name))))]
+        (swap! card-list add-more-card-data response)
+        (.log js/console (str @card-list))))))


refactor move

refactor move

--- src/cljs/triboard/logic/move.cljs
+++ src/cljs/triboard/logic/move.cljs
@@ -77,38 +77,7 @@
     (board/update-cells board updates)))

-;; -----------------------------------------
-;; Public API
-;; -----------------------------------------
-
-;; TODO - Refactor to get two things out
-;; 1. A new board
-;; 2. A list of the converted cells
-;; All grouped by point and by player
-
-
-#_(s/fdef all-available-moves
-    :args (s/tuple ::board/board)
-    :ret ::available-moves)
-
-#_(s/fdef apply-conversion
-    :args (s/tuple ::board/board ::conversion)
-    :ret ::board/board)
-
-
-(defn all-available-moves
-  "Return all move available on the board, grouped by player and by move"
-  [board]
-  (dissoc
-    (transduce
-      (mapcat #(available-conversions-at board %))
-      #(update-in %1 [(:winner %2) (:point %2)] conj %2)    ;; TODO - List of conversions
-      {}
-      (board/empty-cells board))
-    nil))                                                   ;; TODO - find why we have nil
-
-
-(defn apply-conversions
+(defn- apply-conversions
   [board moves]
   (if-let [move (first moves)]
     (reduce
@@ -117,19 +86,21 @@
       (conj moves (empty-cell-conversion (:winner move) (:point move)))
       )))

+;; -----------------------------------------
+;; Public API
+;; -----------------------------------------
+
+#_(s/fdef all-available-moves
+    :args (s/tuple ::board/board)
+    :ret ::available-moves)
+

 ;; (require '[clojure.test.check.generators :as gen])
 ;; (def b (first (gen/sample (s/gen ::board/board) 1)))

-(defn group-by-in
-  "Group a collection of elements based on some keys to extract"
-  [xf keys coll]
-  (dissoc (transduce
-            xf
-            #(update-in %1 ((apply juxt keys) %2) conj %2)
-            {}
-            coll)
-    nil))
+(defn group-by-reducer
+  [keys]
+  #(update-in %1 ((apply juxt keys) %2) conj %2))

 (defn map-values
   "Apply a function to the values of a key-value collection"
@@ -148,11 +119,9 @@
          :board (delay (apply-conversions board moves))}
         ))

-    (group-by-in
+    (transduce
       (mapcat #(available-conversions-at board %))
-      [:winner :point]
-      (board/empty-cells board)))
-  )
+      (group-by-reducer [:winner :point])
+      (board/empty-cells board))
+    ))

-
-


Add test for `of-days`

Add test for `of-days`

--- test/tick/api_test.cljc
+++ test/tick/api_test.cljc
@@ -356,6 +356,10 @@
   (is (= (t/of-hours 10) (java.time.Duration/ofHours 10))))

+;; Periods. Convenience functions to create periods of specific
+;; units.
+(deftest period-functions-test
+  (is (= (t/of-days 10) (java.time.Period/ofDays 10))))

 (deftest predicates-test
   (is (true? (t/clock? (t/clock))))


Fixed false negative

Fixed false negative

--- test/zg/config_test.clj
+++ test/zg/config_test.clj
@@ -99,8 +99,9 @@
     "Check the behaviour of function zg.config/parse-int."
     (are [x] (thrown? NumberFormatException x)
         (parse-int "")
-        (parse-int "xyzzy")
-        (parse-int "+1")))
+        (parse-int " ")
+        (parse-int "xyzzy")))
+       ; (parse-int "+1"))) ; removed, not compatible with all supported JDKs

 (deftest test-parse-float-zero
     "Check the behaviour of function zg.config/parse-float."


Added new tests: test-add-word-message-existence, test-add-words-message-existence, test-split-words-existence, test-proper-word?-existence, and test-process-add-word-existence

--- test/zg/server_test.clj
+++ test/zg/server_test.clj
@@ -7,7 +7,7 @@
 ;  http://www.eclipse.org/legal/epl-v10.html
 ;
 ;  Contributors:
-;      Pavel Tisnovsky
+;      Pavel Tisnovsky
 ;

 (ns zg.server-test
@@ -87,6 +87,36 @@
         (is (callable? 'zg.server/store-words))))

+(deftest test-add-word-message-existence
+    "Check that the zg.server/add-word-message definition exists."
+    (testing "if the zg.server/add-word-message definition exists."
+        (is (callable? 'zg.server/add-word-message))))
+
+
+(deftest test-add-words-message-existence
+    "Check that the zg.server/add-words-message definition exists."
+    (testing "if the zg.server/add-words-message definition exists."
+        (is (callable? 'zg.server/add-words-message))))
+
+
+(deftest test-split-words-existence
+    "Check that the zg.server/split-words definition exists."
+    (testing "if the zg.server/split-words definition exists."
+        (is (callable? 'zg.server/split-words))))
+
+
+(deftest test-proper-word?-existence
+    "Check that the zg.server/proper-word? definition exists."
+    (testing "if the zg.server/proper-word? definition exists."
+        (is (callable? 'zg.server/proper-word?))))
+
+
+(deftest test-process-add-word-existence
+    "Check that the zg.server/process-add-word definition exists."
+    (testing "if the zg.server/process-add-word definition exists."
+        (is (callable? 'zg.server/process-add-word))))
+
+
 ;
 ; Test for function behaviours
 ;


Custom handler for resource 404

Custom handler for resource 404

--- modules/reitit-ring/src/reitit/ring.cljc
+++ modules/reitit-ring/src/reitit/ring.cljc
@@ -160,11 +160,12 @@
      | :index-files     | optional vector of index-files to look in a resource directory, defaults to `[\"index.html\"]`"
      ([]
       (create-resource-handler nil))
-     ([{:keys [parameter root path loader allow-symlinks? index-files paths]
+     ([{:keys [parameter root path loader allow-symlinks? index-files paths not-found-handler]
         :or {parameter (keyword "")
              root "public"
              index-files ["index.html"]
-             paths (constantly nil)}}]
+             paths (constantly nil)
+             not-found-handler (constantly {:status 404, :body "", :headers {}})}}]
       (let [options {:root root, :loader loader, :allow-symlinks? allow-symlinks?}
             path-size (count path)
             create (fn [handler]
@@ -193,8 +194,7 @@
                         (let [uri (:uri request)
                               path (-> request :path-params parameter)]
                           (or (path-or-index-response path uri)
-                              ;; TODO: use generic not-found handler
-                              {:status 404}))))]
+                              (not-found-handler request)))))]
         (create handler)))))

 (defn ring-handler


do not exit the `auto-test` task

do not exit the `auto-test` task

--- build.boot
+++ build.boot
@@ -38,14 +38,17 @@

 (ns-unmap 'boot.user 'test)

-(deftask test []
-  (set-env! :source-paths #(conj % "src/test"))
-  (test-cljs :js-env :node
-             :suite-ns 'compassus.runner
-             :exit? true))
+(deftask test
+  [e exit?     bool  "Enable flag."]
+  (let [exit? (cond-> exit?
+                (nil? exit?) not)]
+    (set-env! :source-paths #(conj % "src/test"))
+    (test-cljs :js-env :node
+               :suite-ns 'compassus.runner
+               :exit? exit?)))

 (deftask auto-test []
   (comp
     (watch)
     (speak)
-    (test)))
+    (test :exit? false)))


Vastly simplify the implementation of run-sym

--- build.boot
+++ build.boot
@@ -111,36 +111,20 @@
  '[clojure.string :as str]
  '[boot.util :as util])

-(defn- get-ns-and-sym [sym]
-  (str/split (name sym) #"/" 2))
-
-(defn- get-ns [sym]
-  (let [[ns s] (get-ns-and-sym sym)]
-    (when s
-      (symbol ns))))
-
-(defn- exists-but-no-ns? [sym]
-  (if (nil? sym)
-    false
-    (let [[ns just-sym] (get-ns-and-sym sym)]
-      (if (nil? just-sym)
-        true
-        false))))
-
 (deftask run-sym
   "Run vars as a pre- and post- tasks."
   [b before SYM sym "The symbol to run inside a pre-wrap task"
    a after  SYM sym "The symbol to run inside a post-wrap task"]
   (let [run-symbol (fn [s]
                      (when s
-                       (when-let [ns (get-ns s)]
+                       (when-let [ns (-> s namespace symbol)]
                          (require ns))
                        (if-let [v (resolve s)]
                          (v)
-                         (util/warn "Could not find var '%s\n" s))))]
-    (when (exists-but-no-ns? before)
+                         (util/warn "Could not find var #'%s\n" s))))]
+    (when (and before (not (namespace before)))
       (util/warn "Before symbol `%s` should be fully namespace qualified.\n" (pr-str before)))
-    (when (exists-but-no-ns? after)
+    (when (and after (not (namespace after)))
       (util/warn "After symbol `%s` should be fully namespace qualified.\n" (pr-str after)))
     (comp
      (if before


Reverting order as it was in previous version.

--- build.boot
+++ build.boot
@@ -110,12 +110,11 @@
   []
   ;; (let [dir (if (seq dir) dir #{"target"})]
   (comp
+    (sift :include #{#"~$"} :invert true) ;; don't include emacs backups
+    (cljs)
     (aot)
-    ;; (pom)
     (uber)
     (jar :file (str (name project) ".jar"))
-    (sift :include #{#"~$"} :invert true) ;; don't include emacs backups
-    (cljs)
     (target :dir #{"target"}))
   ;;)
   )


Changed version 0.0.2

Changed version 0.0.2

--- build.boot
+++ build.boot
@@ -5,7 +5,7 @@
     (list)
     s))

-(def version "0.0.2-SNAPSHOT")
+(def version "0.0.2")
 (def prefix "META-INF/resources")
 (def distribution-path (str prefix "/webjars/collie/" version "/dist/"))
 (def js-distribution-path (str distribution-path "js/"))


friend added as dependency

friend added as dependency

--- build.boot
+++ build.boot
@@ -16,7 +16,7 @@
                  [org.danielsz/system        "0.3.2-SNAPSHOT"]
                  [environ                    "1.1.0"]
                  [boot-environ               "1.1.0"]
-
+                 [com.cemerick/friend        "0.2.3"]

                  [adzerk/boot-cljs           "1.7.228-2"      :scope "test"]
                  [deraen/boot-less           "0.6.0"          :scope "test"]
@@ -38,7 +38,7 @@
 (require '[funcool.boot-codeina :refer [apidoc]]
          '[taoensso.sente])

-(def VERSION       "0.9.0-SNAPSHOT")
+(def VERSION       "0.10.0-SNAPSHOT")
 (def DESCRIPTION   "A simple full-stack web framework for clojure")


Use ProcessBuilder directly instead of conch

--- build.boot
+++ build.boot
@@ -13,7 +13,6 @@
                     [crisptrutski/boot-cljs-test "0.3.0"  :scope "test"]
                     [boot-codox                  "0.10.3" :scope "test"]

-                    [me.raynes/conch             "0.8.0"  :scope "test"]
                     [com.cemerick/piggieback     "0.2.1"  :scope "test"]
                     [weasel                      "0.7.0"  :scope "test"]
                     [org.clojure/tools.nrepl     "0.2.13" :scope "test"]
@@ -28,8 +27,7 @@
          '[adzerk.boot-cljs-repl :as boot-cljs-repl]
          '[pandeiro.boot-http :as boot-http]
          '[crisptrutski.boot-cljs-test :as boot-cljs-test]
-         '[codox.boot :as boot-codox]
-         '[me.raynes.conch.low-level :as conch])
+         '[codox.boot :as boot-codox])

 (task-options!
   pom  {:project     'moxaj/mikron
@@ -53,19 +51,16 @@
     (.replaceAll s "/" "\\\\")
     s))

-(defn host-process
-  "Connects the stdin and stdout to a process."
-  [process]
-  (future (conch/feed-from process System/in))
-  (future (while true (conch/flush process) (Thread/sleep 100)))
-  (conch/stream-to-out process :out))
-
-;; Tasks
-
 (defn proc
   "Returns a task which runs the args as a shell command."
   [& args]
-  (with-pass-thru _ (host-process (apply conch/proc args))))
+  (with-pass-thru _
+    (-> (ProcessBuilder. args)
+        (.inheritIO)
+        (.start)
+        (.waitFor))))
+
+;; Tasks

 (deftask testing
   "Adds the test files to the fileset."


Don't uninstall the application when installing

--- src/leiningen/droid/deploy.clj
+++ src/leiningen/droid/deploy.clj
@@ -56,7 +56,7 @@
         device (get-device-args adb-bin device-args)]
     (ensure-paths apk-path)
     ;; Uninstall old APK first.
-    (sh adb-bin device "uninstall" (get-package-name manifest-path))
+    ;; (sh adb-bin device "uninstall" (get-package-name manifest-path))
     (sh adb-bin device "install" "-r" apk-path)))

 (defn run


Opts are keyword args

Opts are keyword args

--- src/main/clojure/gpio/core.clj
+++ src/main/clojure/gpio/core.clj
@@ -45,9 +45,9 @@

 (defmulti format-raw-digital
   "Formats the raw values received from digital reads of pin state,
-      or digital events.
+   or digital events.

-        The type specified is a keyword."
+   The type specified is a keyword."
   (fn [type _] type))

 (defmethod format-raw-digital :keyword
@@ -107,11 +107,10 @@
       * :from-raw-fn - a converter function, which takes the `char`
           value (\1 or \0) read and converts it into a meaningful value.
           Overrides the default formatter"
-  [port & [opts]]
+  [port & opts]
   (export! port)
   (let [{:keys [digital-result-format from-raw-fn direction active-low? initial-value]
          :or {digital-result-format :keyword}} opts
-        _ (println digital-result-format)
         formatter (or from-raw-fn (partial format-raw-digital digital-result-format))
         filename (value-file port)
         raf (random-access filename)
@@ -174,11 +173,11 @@
   * :event-buffer-size - the size of the change events buffer.  Defaults to 1
   * :timeout - sets a timeout for the OS polling wait time.  Defaults to -1, which waits indefinitely
   * :edge - sets the edge value- :rising, :falling, or :both"
-  [port & [opts]]
+  [port & opts]
   (let [{:keys [event-buffer-size timeout edge]
          :or {event-buffer-size 1, timeout -1}} opts
         create-channel (fn [] (chan (sliding-buffer event-buffer-size)))
-        gpio-port (open-port port opts)
+        gpio-port (apply open-port port opts)
         poller (EventPolling/create)
         write-ch (chan 1)
         read-ch (create-channel)