Fixed age-related breakage of instructions wrapping genetic operators; lein release :patch.

--- src/clojush/instructions/genome.clj
+++ src/clojush/instructions/genome.clj
@@ -299,7 +299,7 @@
         (->> (pop-item :float state)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-instruction-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap {:uniform-mutation-rate rate}))))
                         :genome)))
       state)))
@@ -317,7 +317,7 @@
              (pop-item :float)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-integer-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap
                                                {:uniform-mutation-constant-tweak-rate rate
                                                 :uniform-mutation-int-gaussian-standard-deviation stdev}))))
@@ -337,7 +337,7 @@
              (pop-item :float)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-float-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap
                                                {:uniform-mutation-constant-tweak-rate rate
                                                 :uniform-mutation-float-gaussian-standard-deviation stdev}))))
@@ -357,7 +357,7 @@
              (pop-item :float)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-tag-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap
                                                {:uniform-mutation-rate rate
                                                 :uniform-mutation-tag-gaussian-standard-deviation stdev}))))
@@ -377,7 +377,7 @@
              (pop-item :float)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-string-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap
                                                {:uniform-mutation-rate rate1
                                                 :uniform-mutation-string-char-change-rate rate2}))))
@@ -395,7 +395,7 @@
         (->> (pop-item :float state)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-boolean-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap {:uniform-mutation-rate rate}))))
                         :genome)))
       state)))
@@ -413,7 +413,7 @@
              (pop-item :float)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-close-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap
                                                {:uniform-close-mutation-rate rate1
                                                 :close-increment-rate rate2}))))
@@ -431,7 +431,7 @@
         (->> (pop-item :float state)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-silence-mutation
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap {:uniform-silence-mutation-rate rate}))))
                         :genome)))
       state)))
@@ -447,7 +447,7 @@
         (->> (pop-item :float state)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-deletion
-                                        {:genome genome}
+                                        {:genome genome :age 0}
                                         (merge @push-argmap {:uniform-deletion-rate rate}))))
                         :genome)))
       state)))
@@ -464,7 +464,7 @@
              (pop-item :genome)
              (push-item (vec (take (int (/ (:max-points @push-argmap) 4))
                                    (:genome (uniform-addition
-                                              {:genome genome}
+                                              {:genome genome :age 0}
                                               (merge @push-argmap
                                                      {:uniform-addition-rate rate})))))
                         :genome)))
@@ -482,7 +482,7 @@
              (pop-item :genome)
              (push-item (vec (take (int (/ (:max-points @push-argmap) 4))
                                    (:genome (uniform-addition-and-deletion
-                                              {:genome genome}
+                                              {:genome genome :age 0}
                                               (merge @push-argmap
                                                      {:uniform-addition-and-deletion-rate rate})))))
                         :genome)))
@@ -502,8 +502,8 @@
              (pop-item :genome)
              (push-item (vec (take (int (/ (:max-points @push-argmap) 4))
                                    (:genome (uniform-combination-and-deletion
-                                              {:genome genome1}
-                                              {:genome genome2}
+                                              {:genome genome1 :age 0}
+                                              {:genome genome2 :age 0}
                                               (merge @push-argmap
                                                      {:uniform-combination-and-deletion-rate rate})))))
                         :genome)))
@@ -524,8 +524,8 @@
              (pop-item :genome)
              (pop-item :genome)
              (push-item (vec (:genome (alternation
-                                        {:genome genome1}
-                                        {:genome genome2}
+                                        {:genome genome1 :age 0}
+                                        {:genome genome2 :age 0}
                                         (merge @push-argmap
                                                {:alternation-rate rate
                                                 :alignment-deviation dev}))))
@@ -542,8 +542,8 @@
         (->> (pop-item :genome state)
              (pop-item :genome)
              (push-item (vec (:genome (two-point-crossover
-                                        {:genome genome1}
-                                        {:genome genome2}
+                                        {:genome genome1 :age 0}
+                                        {:genome genome2 :age 0}
                                         @push-argmap)))
                         :genome)))
       state)))
@@ -558,8 +558,8 @@
         (->> (pop-item :genome state)
              (pop-item :genome)
              (push-item (vec (:genome (uniform-crossover
-                                        {:genome genome1}
-                                        {:genome genome2}
+                                        {:genome genome1 :age 0}
+                                        {:genome genome2 :age 0}
                                         @push-argmap)))
                         :genome)))
       state)))
@@ -623,3 +623,4 @@

+


Trivial formatting change to test the CI integration

--- src/chip8_clj/instructions.clj
+++ src/chip8_clj/instructions.clj
@@ -221,7 +221,8 @@
         result (if is-borrow?
                  (+ (- reg-y-val reg-x-val) 256)
                  (- reg-y-val reg-x-val))]
-    (trace machine-state opcode "8XY7 sb7 V[%d](0x%02x) = V[%d](0x%02x) - V[%d](0x%02x)" reg-x-num result reg-y-num reg-y-val reg-x-num reg-x-val)
+    (trace machine-state opcode "8XY7 sb7 V[%d](0x%02x) = V[%d](0x%02x) - V[%d](0x%02x)"
+           reg-x-num result reg-y-num reg-y-val reg-x-num reg-x-val)
     (-> (if is-borrow?
           (machine-state/set-register machine-state 0xF 0)
           (machine-state/set-register machine-state 0xF 1))
@@ -236,7 +237,8 @@
         reg-x-val (machine-state/get-register machine-state reg-x-num)
         result-x (bit-and (bit-shift-left reg-x-val 1) 0xFF)
         result-f (bit-and (bit-shift-right reg-x-val 7) 0x1)]
-    (trace machine-state opcode "8XYE shl V[%d](0x%02x) = V[%d](0x%02x) << 1" reg-x-num result-x reg-x-num reg-x-val)
+    (trace machine-state opcode "8XYE shl V[%d](0x%02x) = V[%d](0x%02x) << 1"
+           reg-x-num result-x reg-x-num reg-x-val)
     (-> (machine-state/set-register machine-state 0xF result-f)
         (machine-state/set-register reg-x-num result-x)
         (machine-state/increment-pc))))
@@ -248,7 +250,8 @@
         reg-x-val (machine-state/get-register machine-state reg-x-num)
         reg-y-num (utils/get-nibble2 opcode)
         reg-y-val (machine-state/get-register machine-state reg-y-num)]
-    (trace machine-state opcode "9XY0 seq V[%d](0x%02x) == V[%d](0x%02x)" reg-x-num reg-x-val reg-y-num reg-y-val)
+    (trace machine-state opcode "9XY0 seq V[%d](0x%02x) == V[%d](0x%02x)"
+           reg-x-num reg-x-val reg-y-num reg-y-val)
     (if (not= reg-x-val reg-y-val)
       (machine-state/skip-next-pc machine-state)
       (machine-state/increment-pc machine-state))))
@@ -297,7 +300,8 @@
         reg-x-val (machine-state/get-register machine-state reg-x-num)
         reg-y-val (machine-state/get-register machine-state reg-y-num)
         addr-reg (machine-state/get-addr-reg machine-state)]
-    (trace machine-state opcode "DXVN drw V[%d](0x%02x), V[%d](0x%02x), %d, I(0x%04x)" reg-x-num reg-x-val reg-y-num reg-y-val imm addr-reg)
+    (trace machine-state opcode "DXVN drw V[%d](0x%02x), V[%d](0x%02x), %d, I(0x%04x)"
+           reg-x-num reg-x-val reg-y-num reg-y-val imm addr-reg)

     (as-> machine-state $
       (machine-state/clear-carry-flag $)
@@ -429,7 +433,8 @@
         ones (mod reg-x-val 10)
         tens (quot (mod reg-x-val 100) 10)
         hundreds (quot (mod reg-x-val 1000) 100)]
-    (trace machine-state opcode "FX33 bcd V[%d](0x%02x), I(0x%04x), %d-%d-%d" reg-x-num reg-x-val addr-reg, hundreds, tens, ones)
+    (trace machine-state opcode "FX33 bcd V[%d](0x%02x), I(0x%04x), %d-%d-%d"
+           reg-x-num reg-x-val addr-reg, hundreds, tens, ones)
     (-> machine-state
         (machine-state/set-memory addr-reg hundreds)
         (machine-state/set-memory (+ addr-reg 1) tens)


Remove script timeout default

Remove script timeout default

--- src/cider_ci/builder/tasks.clj
+++ src/cider_ci/builder/tasks.clj
@@ -112,9 +112,7 @@
                                                script-defaults)))
            context)))

-(def ^:private script-base-defaults
-  {:timeout (* 15 60)
-   })
+(def ^:private script-base-defaults {})

 (defn build-tasks
   "Build the tasks for the given top-level specification."


technically this was already trimmed

technically this was already trimmed

--- src/clj/cljspazzer/scanner.clj
+++ src/clj/cljspazzer/scanner.clj
@@ -26,7 +26,7 @@
     (if (and (> (count s) 4)
          (= "the " (subs result 0 4)))
       (s/trim (subs result 4))
-      (s/trim result))))
+      result)))

 (defn get-info [f]
   (let [id3tags (try


Revert "Removed unnecessary call to open-domain as load-domain calls it internally and returns the result."
It's the else part and we need it.

This reverts commit 5bf78c20d57c25ef96d00ed49af7f0d0c6a4b65f.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -76,6 +76,9 @@
                      remote-path
                      (domain/host-shards (domains-info domain))))
       ;; use cached domain from local-dir (no update needed)
+      (open-domain local-config
+                   (str (path local-dir domain))
+                   (domain/host-shards (domains-info domain)))
       )))

 (defn sync-data-updated [domains-info global-config local-config]


Remove version2 postfix from function names

--- src/clj_gatling/simulation.clj
+++ src/clj_gatling/simulation.clj
@@ -62,7 +62,7 @@
           (>! result-channel (conj results result))
           (recur (rest r) (conj results result)))))))

-(defn run-scenario-version2 [runner concurrency number-of-requests timeout scenario]
+(defn run-scenario [runner concurrency number-of-requests timeout scenario]
   (println (str "Running scenario " (:name scenario) " with " concurrency " concurrency and
             " (runner-info runner) "."))
   (let [cs       (repeatedly concurrency async/chan)
@@ -85,11 +85,11 @@
           (recur (inc i)))))
     (repeatedly number-of-requests #(<!! results))))

-(defn run-scenarios-version2 [runner concurrency number-of-requests timeout scenarios]
+(defn run-scenarios [runner concurrency number-of-requests timeout scenarios]
   (let [results (async/chan)]
     (go-loop [s scenarios]
       (>! results
-          (run-scenario-version2 runner concurrency number-of-requests timeout (first scenarios)))
+          (run-scenario runner concurrency number-of-requests timeout (first scenarios)))
       (when-not (empty? (rest s))
         (recur (rest s))))
   (apply concat (repeatedly (count scenarios) #(<!! results)))))
@@ -101,4 +101,4 @@
         runner (if (nil? duration)
                  (FixedRequestNumberRunner. requests)
                  (DurationRunner. duration))]
-    (run-scenarios-version2 runner users requests step-timeout scenarios)))
+    (run-scenarios runner users requests step-timeout scenarios)))


make sure a date is specified to create partition name

--- src/clj_money/partitioning.clj
+++ src/clj_money/partitioning.clj
@@ -12,6 +12,8 @@
   "Given a date and a base table name, returns the name
   of the partition table where the date belongs"
   [date root]
+  (if-not date
+    (throw (IllegalArgumentException. "Argument \"date\" cannot be nil")))
   (let [[year month] ((juxt t/year t/month) (to-local-date date))]
     (format "%s_%04d_%02d" (name root) year month)))


Prevent touches on nav from closing nav

Prevent touches on nav from closing nav

--- src/cljs/clojuredocs/main.cljs
+++ src/cljs/clojuredocs/main.cljs
@@ -176,6 +176,11 @@
     (let [h (fn [_] (dommy/remove-class! (sel1 :body) :mobile-push))]
       (dommy/listen! $el :click h :touchstart h)))

+  :.navbar-nav
+  (fn [$el]
+    (let [h (fn [e] (.stopPropagation e))]
+      (dommy/listen! $el :click h :touchstart h)))
+
   :.sg-quick-lookup
   (fn [$el]


Minor code structure adjustments.

Minor code structure adjustments.

--- src/cljs/movement/session.cljs
+++ src/cljs/movement/session.cljs
@@ -107,17 +107,15 @@
    [:span.pure-u {:style {:padding-top 10}} name]])

 (defn m-title [{:keys [name]}]
-  [:div.pure-g
-    [:div.pure-u-1 {:style {:display 'flex :text-align 'center}}
-      [:h3.title {:style {:margin 'auto}} name]]])
+  [:div.pure-u-1 {:style {:display 'flex}}
+    [:h3.title name]])

 (defn m-image [{:keys [name image]}]
-  [:div.pure-u-1
     [:img.graphic {:src (str "http://s3.amazonaws.com/mumrik-movement-images/" image)
-                  :title name :alt name}]])
+                   :title name
+                   :alt name}])

 (defn m-spec [{:keys [weight rep distance duration rest]}]
-  [:div.pure-g
     [:div.pure-u-1
       [:div.pure-g
        [:div.pure-u-1
@@ -132,7 +130,7 @@
         (when (pos? duration) (r-component {:data duration :name "s"}))]]
       [:div.pure-g
        [:div.pure-u-1
-        (when (pos? rest) (r-component {:data rest :name "s pause"}))]]]])
+        (when (pos? rest) (r-component {:data rest :name "s pause"}))]]])

 #_(defn m-adjust [{:keys [id rep distance duration weight rest] parts pos}]
   [:div.pure-g
@@ -173,27 +171,26 @@
     text])

 (defn movement-component
-  [{:keys [id name image slot-category measurement previous next
-           rep set performed-sets distance duration weight rest] :as m}
-   part-number]
+  [{:keys [id previous next] :as m} part-number]
   (let [parts (session/get-in [:movement-session :parts])
         pos (positions #{m} (get parts part-number))
         expand (atom true)]
     (fn []
       [:div.pure-g.movement {:id id}
-        [:div.pure-u-2-3
-          [:div.pure-g
-            [m-title m]]
-          [:div.pure-g
-            [m-spec m]]
+
+        [:div.pure-u-1-2
           [:div.pure-g
             [m-adjust m :remove part-number "Remove"]
             [m-adjust m :swap part-number "Swap"]
             (when previous [m-adjust m :previous part-number "Easier"])
-            (when next [m-adjust m :next part-number "Harder"])]]
-        [:div.pure-u-1-3
-          [:div.pure-g
-            [m-image m]]]])))
+            (when next [m-adjust m :next part-number "Harder"])]
+          [:div.pure-g
+            [m-title m]]
+          [:div.pure-g
+            [m-spec m]]]
+
+        [:div.pure-u-1-2
+          [m-image m]]])))

 (defn all-movements [e show-search-input?]
   (.preventDefault e)


Fixed incorrect docstrings.

Fixed incorrect docstrings.

--- src/cmr/opendap/auth/token.clj
+++ src/cmr/opendap/auth/token.clj
@@ -13,7 +13,7 @@
    [xml-in.core :as xml-in]))

 (def token-info-resource
-  "The path segment to the CMR Access Control API resource that is queried
+  "The path segment to the ECHO REST API resource that is queried
   in order to get user/token mappings."
   "/tokens/get_token_info")

@@ -61,7 +61,7 @@
   [base-url token]
   (let [url (str base-url token-info-resource)
         data (str "id=" token)]
-    (log/trace "Making token-info query to CMR:" url)
+    (log/trace "Making token-info query to ECHO REST:" url)
     (request/async-post
       url
       (-> {:body data}


Remove old specs

Remove old specs

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -107,8 +107,6 @@
   (s/def ::path-coordinate (s/tuple ::attribute ::sym))
   (s/def ::plan-path (s/coll-of ::path-coordinate))
   (s/def ::plan (s/coll-of ::plan-path))
-  (s/def ::path-provides ::pp/provides)
-  (s/def ::self-provides ::pp/provides)
   (s/def ::sort-plan (s/fspec :args (s/cat :env ::p/env :plan ::plan-path)))
   (s/def ::transform fn?))


Add timestamp of the moment an element is added to the channel

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -529,7 +529,8 @@
                                    (pt/trace-leave env tid {::pt/event ::schedule-resolver})
                                    (try
                                      (call-resolver* env entity)
-                                     (catch #?(:clj Throwable :cljs :default) e e)))})))
+                                     (catch #?(:clj Throwable :cljs :default) e e)))
+                           :ts  (pt/now)})))
         out)
       (call-resolver* env entity))))


Updating ingest to allow components to be optional.

--- src/cmr/ingest/system.clj
+++ src/cmr/ingest/system.clj
@@ -42,7 +42,7 @@
      (info "System starting")
      (let [started-system (reduce (fn [system component-name]
                                     (update-in system [component-name]
-                                               #(lifecycle/start % system)))
+                                               #(when % (lifecycle/start % system))))
                                   this
                                   component-order)]
        (info "System started")
@@ -55,7 +55,7 @@
      (info "System shutting down")
      (let [stopped-system (reduce (fn [system component-name]
                                     (update-in system [component-name]
-                                               #(lifecycle/stop % system)))
+                                               #(when % (lifecycle/stop % system))))
                                   this
                                   (reverse component-order))]
        (info "System stopped")


adding #! to local scripts

adding #! to local scripts

--- src/co/nclk/flax/node.clj
+++ src/co/nclk/flax/node.clj
@@ -63,11 +63,12 @@
 (defn- invoke-local
   [checkpoint]
   (binding [*log* (not (false? (:log checkpoint)))]
-    (let [tmpfile-name (str ".flax-temp-script-" (java.util.UUID/randomUUID))
+    (let [tmpfile-name (str (System/getProperty "user.dir") ".flax-temp-script-" (java.util.UUID/randomUUID))
           argv (remove nil?
                  (flatten
-                   [(if-let [u (:user checkpoint)] ["sudo" "-u" u]) "bash" tmpfile-name]))]
+                   [(if-let [u (:user checkpoint)] ["sudo" "-u" u]) tmpfile-name]))]
       (spit tmpfile-name (:invocation checkpoint))
+      (-> (java.io.File. tmpfile-name) (.setExecutable true))
       (let [proc (-> (Runtime/getRuntime)
                    (.exec (into-array String argv)))
             stdout (clojure.java.io/reader (.getInputStream proc))


no need to delay building default handlers - they always get built

--- src/cognitect/transit.clj
+++ src/cognitect/transit.clj
@@ -29,7 +29,7 @@
 (defn- transit-format
   "Converts a keyword to a TransitFactory$Format value."
   [kw]
-  (TransitFactory$Format/valueOf
+  (TransitFactory$Format/valueOf
    (str/join "_" (-> kw
                      name
                      str/upper-case
@@ -73,52 +73,47 @@
          (stringRep [_ o] (when str-rep-fn (str-rep-fn o)))
          (getVerboseHandler [_] (when verbose-handler-fn (verbose-handler-fn)))))))

-(def default-write-handlers*
-  (delay
-   {
-    java.util.List
-    (reify WriteHandler
-      (tag [_ l] (if (seq? l) "list" "array"))
-      (rep [_ l] (if (seq? l) (TransitFactory/taggedValue "array" l ) l))
-      (stringRep [_ _] nil)
-      (getVerboseHandler [_] nil))
-
-    clojure.lang.BigInt
-    (reify WriteHandler
-      (tag [_ _] "n")
-      (rep [_ bi] (str (biginteger bi)))
-      (stringRep [this bi] (.rep this bi))
-      (getVerboseHandler [_] nil))
-
-    clojure.lang.Keyword
-    (reify WriteHandler
-      (tag [_ _] ":")
-      (rep [_ kw] (nsed-name kw))
-      (stringRep [_ kw] (nsed-name kw))
-      (getVerboseHandler [_] nil))
-
-    clojure.lang.Ratio
-    (reify WriteHandler
-      (tag [_ _] "ratio")
-      (rep [_ r] (TransitFactory/taggedValue "array" [(numerator r) (denominator r)]))
-      (stringRep [_ _] nil)
-      (getVerboseHandler [_] nil))
-
-    clojure.lang.Symbol
-    (reify WriteHandler
-      (tag [_ _] "$")
-      (rep [_ sym] (nsed-name sym))
-      (stringRep [_ sym] (nsed-name sym))
-      (getVerboseHandler [_] nil))
-}))
-
-(defn default-write-handlers
+(def default-write-handlers
   "Returns a map of default WriteHandlers for
    Clojure types. Java types are handled
    by the default WriteHandlers provided by the
    transit-java library."
-  []
-  @default-write-handlers*)
+  {
+   java.util.List
+   (reify WriteHandler
+     (tag [_ l] (if (seq? l) "list" "array"))
+     (rep [_ l] (if (seq? l) (TransitFactory/taggedValue "array" l ) l))
+     (stringRep [_ _] nil)
+     (getVerboseHandler [_] nil))
+
+   clojure.lang.BigInt
+   (reify WriteHandler
+     (tag [_ _] "n")
+     (rep [_ bi] (str (biginteger bi)))
+     (stringRep [this bi] (.rep this bi))
+     (getVerboseHandler [_] nil))
+
+   clojure.lang.Keyword
+   (reify WriteHandler
+     (tag [_ _] ":")
+     (rep [_ kw] (nsed-name kw))
+     (stringRep [_ kw] (nsed-name kw))
+     (getVerboseHandler [_] nil))
+
+   clojure.lang.Ratio
+   (reify WriteHandler
+     (tag [_ _] "ratio")
+     (rep [_ r] (TransitFactory/taggedValue "array" [(numerator r) (denominator r)]))
+     (stringRep [_ _] nil)
+     (getVerboseHandler [_] nil))
+
+   clojure.lang.Symbol
+   (reify WriteHandler
+     (tag [_ _] "$")
+     (rep [_ sym] (nsed-name sym))
+     (stringRep [_ sym] (nsed-name sym))
+     (getVerboseHandler [_] nil))
+   })

 (deftype Writer [w])

@@ -134,7 +129,7 @@
   ([out type] (writer out type {}))
   ([^OutputStream out type opts]
      (if (#{:json :json-verbose :msgpack} type)
-       (let [handlers (merge (default-write-handlers) (:handlers opts))]
+       (let [handlers (merge default-write-handlers (:handlers opts))]
          (Writer. (TransitFactory/writer (transit-format type) out handlers)))
        (throw (ex-info "Type must be :json, :json-verbose or :msgpack" {:type type})))))

@@ -169,9 +164,13 @@
     (fromRep [_ o] (from-rep o))
     (arrayReader [_] (array-reader))))

-(def default-read-handlers*
-  (delay
-     {":"
+
+(def default-read-handlers
+  "Returns a map of default ReadHandlers for
+   Clojure types. Java types are handled
+   by the default ReadHandlers provided by the
+   transit-java library."
+  {":"
    (reify ReadHandler
      (fromRep [_ o] (keyword o)))

@@ -228,15 +227,7 @@
                    (aset next-key 0 marker)
                    (assoc! m k item)))))
            (complete [_ m] (persistent! m))))))
-}))
-
-(defn default-read-handlers
-  "Returns a map of default ReadHandlers for
-   Clojure types. Java types are handled
-   by the default ReadHandlers provided by the
-   transit-java library."
-  []
-  @default-read-handlers*)
+   })

 (defn map-builder
   "Creates a MapBuilder that makes Clojure-
@@ -277,7 +268,7 @@
   ([in type] (reader in type {}))
   ([^InputStream in type opts]
      (if (#{:json :json-verbose :msgpack} type)
-       (let [handlers (merge (default-read-handlers) (:handlers opts))
+       (let [handlers (merge default-read-handlers (:handlers opts))
              default-handler (:default-handler opts)
              reader (TransitFactory/reader (transit-format type)
                                            in


Fix npcs so that they follor player

Fix npcs so that they follor player

--- src/dungeon_crusade/update.clj
+++ src/dungeon_crusade/update.clj
@@ -629,11 +629,6 @@
                        (fn [[x y]]
                          (and (< 0 x width)
                               (< 0 y height)
-                              (or (and (= (-> npc :pos :x) x)
-                                       (= (-> npc :pos :y) y))
-                                  (not-any? (fn [n] (and (= (-> n :pos :x) x)
-                                                         (= (-> n :pos :y) y)))
-                                            npcs))
                               (contains? #{:floor
                                            :open-door
                                            :corridor}


1.3-ifying examples.pagie-hogeweg

1.3-ifying examples.pagie-hogeweg

--- src/examples/pagie_hogeweg.clj
+++ src/examples/pagie_hogeweg.clj
@@ -7,7 +7,7 @@

 (ns examples.pagie-hogeweg
   (:use [clojush])
-  (:require [clojure.contrib.math :as math]))
+  (:require [clojure.math.numeric-tower :as math]))

 (defn data-point-2D "Generate a 2D data point from:
 f(x,y) = 1 / (1 + x^-4) + 1 / ( 1 + y^-4 )"


Allow extra methods on components.

Allow extra methods on components.

--- src/dmohs/react/core.cljs
+++ src/dmohs/react/core.cljs
@@ -124,6 +124,20 @@
          (when component-will-unmount (component-will-unmount (default-arg-map this)))))})))

+(def react-component-api-method-keys
+  #{:render
+    :get-initial-state
+    :get-default-props
+    :display-name
+    :component-will-mount
+    :component-did-mount
+    :component-will-receive-props
+    :should-component-update
+    :component-will-update
+    :component-did-update
+    :component-will-unmount})
+
+
 (defn create-class [fn-map]
   (let [class-def #js{}
         fn-map (wrap-fn-defs fn-map)]
@@ -173,6 +187,10 @@
                          :prev-props (.-cljsProps prevProps)
                          :prev-state (.-snapshot prevState)))))))
     (set! (. class-def -componentWillUnmount) (:component-will-unmount fn-map))
+    (let [remaining-methods (apply dissoc fn-map react-component-api-method-keys)]
+      (doseq [[k f] remaining-methods]
+        (aset class-def (name k) (fn [& args]
+                                   (this-as this (apply f (default-arg-map this) args))))))
     (React.createClass class-def)))


PLD: fix docstrings

PLD: fix docstrings

--- src/hatti/map/viewby.cljs
+++ src/hatti/map/viewby.cljs
@@ -13,9 +13,7 @@
    Saturated red+brown disabled due to clash with the :clicked color."
   ["#1f78b4"
    "#33a02c"
-   ;"#e31a1c"
    "#6a3d9a"
-   ;"#ff7f00"
    "#ffff99"
    "#b15928"
    "#a6cee3"
@@ -48,9 +46,10 @@
   [answers]
   (merge (zipmap answers (repeat true)) {nil false}))

-(defn preprocess-answers [field raw-answers]
+(defn preprocess-answers
   "Preproccesses answers depending on the field. For multi-selects, return type
    is a list of list of strings. For other types, a list of strings."
+  [field raw-answers]
   (cond
     (f/select-one? field) raw-answers
     (f/text? field) raw-answers
@@ -60,8 +59,9 @@
     (f/select-all? field) (->> raw-answers
                                (map #(when % (s/split % #" "))))))

-(defn field->colors [field]
+(defn field->colors
   "Returns the appropriate set of colors given the field."
+  [field]
   (cond
     ;; if too many options w/in select-one field, fall back to select-all style
     (f/select-one? field) (if (<= (count (:children field))
@@ -128,9 +128,9 @@
       (mu/bring-to-top-if-selected id-selected? marker))))

 (defn filter-answer-data-structures
-  [answers query field language]
   "Given a list of answers + query, returns map from answers to true/false.
    True if query is in the answer, false if not."
+  [answers query field language]
   (let [query-present? (fn [ans]
                          (when ans
                            (re-find (safe-regex query)
@@ -148,17 +148,17 @@
                                 (= (set visible)
                                    (->> a->s (filter second) keys set)))]
     (if (nil? answer)
-      ; nil cannot be selected or deselected: no-change
+      ;; nil cannot be selected or deselected: no-change
       answer->selected?
-      ; else -> the logic begins
+      ;; else -> the logic begins
       (if (all-visible-selected? answer->selected? visible-answers)
-        ; first click -> *just* select this answer
+        ;; first click -> *just* select this answer
         (merge (zipmap all-answers (repeat false)) {answer true})
-        ; not first click ->  toggle this answer, leave the rest
+        ;; not first click ->  toggle this answer, leave the rest
         (let [toggled (update-in answer->selected? [answer] not)]
           (if (every? false? (vals toggled))
-            ; special rule: nothing is clicked -> make everything clicked
+            ;; special rule: nothing is clicked -> make everything clicked
             (merge (zipmap all-answers (repeat false))
                    (all-but-nil-selected visible-answers))
-            ; else: some things are clicked -> leave alone
+            ;; else: some things are clicked -> leave alone
             toggled))))))


CMR-4819: Fixed indentation.

CMR-4819: Fixed indentation.


remove unneeded {:pronoun false}

remove unneeded {:pronoun false}

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -438,7 +438,6 @@
                         :pred :go}}}

    "Juan" {:synsem {:cat :noun
-                    :pronoun false
                     :propernoun true
                     :case :nom
                     :agr {:gender :masc


Fix wrap-authentication to correctly apply parameters.

--- src/buddy/auth/middleware.clj
+++ src/buddy/auth/middleware.clj
@@ -40,7 +40,7 @@
   handler. When multiple `backends` are given each of them gets a
   chance to authenticate the request."
   [handler & backends]
-  (fn [request] (handler (authentication-request request [backends]))))
+  (fn [request] (handler (apply authentication-request request backends))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Authorization


Only emit the recommendation if it is not blank

Also pack the recommendation inside a level2

Related to #11

--- src/catalog/layout/dtbook.clj
+++ src/catalog/layout/dtbook.clj
@@ -257,13 +257,15 @@
         [:p {:brl:class (format "nr_%s" issue)}]
         [:p {:brl:class (format "jr_%s" year)}]])
       [:bodymatter
-       [:level1
-        [:h1 (translations :recommendations)]
-        (md-to-dtbook recommendations)]
        (when (not (string/blank? editorial))
          [:level1
           [:h1 (translations :editorial)]
           (md-to-dtbook editorial)])
+       (when (not (string/blank? recommendation))
+         [:level1
+          [:h1 (translations :recommendations)]
+          [:level2
+           (md-to-dtbook recommendation)]])
        (when-let [items (not-empty
                          (dissoc items :musiknoten :taktilesbuch))]
          [:level1 [:h1 (translations :braille)]


Added raw support

Added raw support

--- src/clj/brutha/svg/hiccup.clj
+++ src/clj/brutha/svg/hiccup.clj
@@ -3,17 +3,31 @@

 (declare render-element)

+(defprotocol IRaw
+  (-content [r]))
+
+(defn content [r]
+  (-content r))
+
+(defrecord Raw [h]
+  IRaw
+  (-content [_]
+    h))
+
+(defn raw [h]
+  (->Raw h))
+
 (defn render [e]
   (cond
    (sequential? e) (map render e)
    (satisfies? el/IElement e) (render-element e)
+   (satisfies? IRaw e) (content e)
    :else e))

 (defn xform-str
   [s p]
-  (when p
-    (let [[x y] p]
-      (str s "(" x "," y ")"))))
+  (when-let [[x y] p]
+    (str s "(" x "," y ")")))

 (defn norm-scale
   [s]


High-stakes Job.

High-stakes Job.

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -273,6 +273,14 @@
                    :msg "force the Corp to trash 1 card from HQ at random"
                    :effect (effect (trash (first (shuffle (:hand corp)))))}}}

+   "High-stakes Job"
+   {:prompt "Choose a server"
+    :choices (req (let [unrezzed-ice #(seq (filter (complement rezzed?) (:ices (second %))))
+                        ok-servs (filter unrezzed-ice (get-in @state [:corp :servers]))]
+                    (map (comp zone->name first) ok-servs)))
+    :effect (effect (run target {:end-run {:req (req (:successful run)) :msg " gain 12 [Credits]"
+                                           :effect (effect (gain :runner :credit 12))}} card))}
+
    "Hostage"
    {:prompt "Choose a Connection"
     :choices (req (cancellable (filter #(has-subtype? % "Connection") (:deck runner)) :sorted))


log for scan

log for scan

--- src/clj/hdfs_cleaner/hdfs.clj
+++ src/clj/hdfs_cleaner/hdfs.clj
@@ -85,6 +85,7 @@
     (doseq [user-dir (.listStatus HDFS/dfs path)]
       (let [user-path (.getPath user-dir)
             user-name (.getName user-path)
+            _ (log/info "scan" user-name)
             size (scan-size user-path)
             size-readable (bytes->human-readable size)]
         (when (>= size one-TB)


small fix

small fix

--- src/clj/salava/badge/cron.clj
+++ src/clj/salava/badge/cron.clj
@@ -45,8 +45,8 @@
         (jdbc/execute! db-conn
                        ["UPDATE user_badge SET revoked = 1, last_checked = UNIX_TIMESTAMP() WHERE id = ?"
                         (:id user-badge)])
-        (if delete-user-metabadge (clean-metabadge-tables! ctx db-conn (:id user-badge)))
-        )
+        (if delete-user-metabadge (delete-user-metabadge ctx db-conn (:id user-badge))))
+
       ;; still valid, check verified issuer
       (jdbc/with-db-transaction [t-con db-conn]
         (jdbc/execute! t-con ["UPDATE badge SET remote_url = ? WHERE id = ? AND remote_url IS NULL"


Simplified backend path

Simplified backend path

--- src/cljc/swarmpit/routes.cljc
+++ src/cljc/swarmpit/routes.cljc
@@ -1,5 +1,6 @@
 (ns swarmpit.routes
   (:require [bidi.bidi :as b]
+            #?(:clj [environ.core :refer [env]])
             [cemerick.url :refer [map->query]]
             [clojure.string :as str]))

@@ -153,4 +154,4 @@
 (defn path-for-backend
   ([handler] (path-for-backend handler {} nil))
   ([handler params] (path-for-backend handler params nil))
-  ([handler params query] (str/replace (path backend "/" handler params query) #"^/" "")))
+  ([handler params query] (path backend "" handler params query)))


updates

updates

--- src/cljs/crawler_ui/core.cljs
+++ src/cljs/crawler_ui/core.cljs
@@ -29,15 +29,20 @@
     (as/<! (as/timeout 1000))
     (recur)))

+(defn build-host-link [host]
+  (dom/a #js {:href (str "ftp://" host)} host))
+
 (defn result-view [file owner]
   (reify
     om/IRender
     (render [this]
-      (dom/tr nil
-              (dom/td nil (format-size (get file "size")))
-              (dom/td nil
-                      (dom/a #js {:href (get file "url")}
-                             (js/decodeURI (get file "url"))))))))
+      (let [{size "size" host "ip" url "url" name "name"} file]
+        (dom/tr nil
+                (dom/td nil (format-size size))
+                (dom/td nil (build-host-link host))
+                (dom/td nil
+                        (dom/a #js {:href url}
+                               name)))))))

 (defn results-view [data owner]
   (reify
@@ -51,7 +56,8 @@
                      (dom/thead nil
                                 (dom/tr nil
                                         (dom/th nil "Size")
-                                        (dom/th nil "Url")))
+                                        (dom/th nil "Host")
+                                        (dom/th nil "Name")))
                      (apply dom/tbody nil
                             (om/build-all result-view (sort-by #(get % "name") (:results data))))))))))

@@ -59,10 +65,11 @@
   (reify
     om/IRender
     (render [this]
-      (dom/tr nil
-              (dom/td nil (get value "ip"))
-              (dom/td nil (get value "files"))
-              (dom/td nil (format-size (get value "size")))))))
+      (let [{ip "ip" files "files" size "size"} value]
+        (dom/tr nil
+                (dom/td nil (build-host-link ip))
+                (dom/td nil files)
+                (dom/td nil (format-size size)))))))

 (defn sort-statistics [data]
   (sort-by #(mapv js/parseInt (string/split (first %) #"\.")) data))
@@ -127,7 +134,8 @@
         (dom/div nil
                  (dom/div nil "Query accepts standard lucene queries: "
                           (dom/a #js {:href "https://lucene.apache.org/core/2_9_4/queryparsersyntax.html"} "click here"))
-                 (dom/div nil "Example queries: \"bdsm AND mp4\" (All bdsm files in mp4), \"ebooks AND algorithms\" (ebooks about algorithms), \"apocalyptica AND mp3\" (files with apocalyptica that contain mp3)")
+                 (dom/div nil "Example queries: \"predestination AND torrent\" (Predestination movie as a torrent), \"bdsm AND mp4\" (All bdsm files in mp4), \"ebooks AND algorithms\" (ebooks about algorithms), \"apocalyptica AND mp3\" (files with apocalyptica that contain mp3)")
+                 (dom/div nil "The \"AND\" has to be in upper case!")
                  (dom/div nil "Press enter for search. Results are limited to 10000, if your browser dies, it's your fault.")
                  (dom/div nil
                           (dom/input #js {:type :text


fix help wording

fix help wording

--- src/cljs/crawler_ui/core.cljs
+++ src/cljs/crawler_ui/core.cljs
@@ -127,7 +127,7 @@
         (dom/div nil
                  (dom/div nil "Query accepts standard lucene queries: "
                           (dom/a #js {:href "https://lucene.apache.org/core/2_9_4/queryparsersyntax.html"} "click here"))
-                 (dom/div nil "Example queries: \"bdsm AND .mp4$\" (All bdsm files that end in .mp4), \"ebooks AND algorithms\" (ebooks about algorithms), \"apocalyptica AND .mp3$\" (files with apocalyptica in it that end in .mp3)")
+                 (dom/div nil "Example queries: \"bdsm AND mp4\" (All bdsm files in mp4), \"ebooks AND algorithms\" (ebooks about algorithms), \"apocalyptica AND mp3\" (files with apocalyptica that contain mp3)")
                  (dom/div nil "Press enter for search. Results are limited to 10000, if your browser dies, it's your fault.")
                  (dom/div nil
                           (dom/input #js {:type :text


Check changed date before leave days calculation implemented

--- src/cljs/t5pmobile/leave.cljs
+++ src/cljs/t5pmobile/leave.cljs
@@ -310,6 +310,11 @@
   )
 )

+(defn setNewLeaveAppValue [key val]
+  (swap! app-state assoc-in [:leaveapp (keyword key)] val)
+  (CheckCalcLeave)
+)
+
 (defn setdatepicker [field]
   (let [custom-formatter2  (tf/formatter (:datemask (:User @t5pcore/app-state)) )]

@@ -326,7 +331,7 @@
            (.on "show"
              (fn [e] (
                 let [
-                  ;;dt (js/Date (.. e -date))
+                  dt (js/Date (.. e -date))
                   ;dtstring (tf/parse custom-formatter1 (subs (str (.. e -date)  )  4 24)  )
                   dtstring (if
                     (= (count (.. e -dates) ) 0)
@@ -337,17 +342,31 @@

                 ]
                 ;;(swap! app-state assoc-in [:leavetypes :ivyt03 :fields :leavefromdate :value] (str (subs dt 8 10)  "/05/"    (subs dt 11 16)  ) )
-               ;;(.log js/console dt)
+
                ;;(.log js/console (str (.. e -date)  ) )
                ;(.log js/console (count (.. e -dates)))
                ;(.log js/console (subs (str (.. e -date)  ) 4 24))
                  (
                    if (= dtstring nil) "nil"
                    (
-                     ;(.log js/console (tf/unparse custom-formatter2 dtstring))
-                     (swap! app-state assoc-in [:leaveapp (keyword (.. e -target -id))] (tf/unparse custom-formatter2 dtstring))
-                     (CheckCalcLeave)
-                   )
+                    ;;.log js/console (keyword (.. e -target -id))
+                    if (not=
+                                        ;( (keyword (.. e -target -id)) (:leaveapp @app-state)  )
+                        ( (keyword (.. e -target -id)) (:leaveapp @app-state))
+                        (tf/unparse custom-formatter2 dtstring)
+
+                        )
+                    (
+                      setNewLeaveAppValue (.. e -target -id) (tf/unparse custom-formatter2 dtstring)
+;;  (swap! app-state assoc-in [:leaveapp (keyword (.. e -target -id))] (tf/unparse custom-formatter2 dtstring))
+;;  (CheckCalcLeave)
+
+
+                    )
+
+
+                                        ;(.log js/console (tf/unparse custom-formatter2 dtstring))
+                    )
                  )
                )
              )


Report age stats.

Report age stats.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -408,6 +408,11 @@
              (*' 1.0 (mean (map count-points (map :program sorted)))))
     (printf "Average percent parens in population: %.3f\n"
             (mean (map #(double (/ (count-parens (:program %)) (count-points (:program %)))) sorted)))
+    (let [ages (map :age population)]
+      (println "Average age in population:"
+               (* 1.0 (mean ages)))
+      (println "Median age in population:"
+               (median ages)))
     (println "--- Population Diversity Statistics ---")
     (let [genome-frequency-map (frequencies (map :genome population))]
       (println "Min copy number of one Plush genome:" (apply min (vals genome-frequency-map)))


Expose `with-open` to CLJS.

Expose `with-open` to CLJS.

--- src/datomish/test_macros.cljc
+++ src/datomish/test_macros.cljc
@@ -3,6 +3,7 @@
 ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.

 (ns datomish.test-macros
+  (:refer-clojure :exclude [with-open])
   (:require
    [datomish.pair-chan]))

@@ -35,3 +36,35 @@
        ~(with-meta name {:async true})
        (let [[v# e#] (clojure.core.async/<!! (datomish.pair-chan/go-pair ~@body))]
          (clojure.test/is (= e# nil))))))
+
+;; CLJS doesn't expose `with-open`, for reasons unknown.  Duplicate the definition of
+;; `with-open` (and `assert-args`) here.
+;; See https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L3679-L3698.
+(defmacro ^{:private true} assert-args
+  [& pairs]
+  `(do (when-not ~(first pairs)
+         (throw (IllegalArgumentException.
+                  (str (first ~'&form) " requires " ~(second pairs) " in " ~'*ns* ":" (:line (meta ~'&form))))))
+       ~(let [more (nnext pairs)]
+          (when more
+            (list* `assert-args more)))))
+
+(defmacro with-open
+  "bindings => [name init ...]
+  Evaluates body in a try expression with names bound to the values
+  of the inits, and a finally clause that calls (.close name) on each
+  name in reverse order."
+  {:added "1.0"}
+  [bindings & body]
+  (assert-args
+    (vector? bindings) "a vector for its binding"
+    (even? (count bindings)) "an even number of forms in binding vector")
+  (cond
+    (= (count bindings) 0) `(do ~@body)
+    (symbol? (bindings 0)) `(let ~(subvec bindings 0 2)
+                              (try
+                                (with-open ~(subvec bindings 2) ~@body)
+                                (finally
+                                  (. ~(bindings 0) close))))
+    :else (throw (java.lang.IllegalArgumentException.
+                   "with-open only allows Symbols in bindings"))))


Переработка defroute на routes

Переработка defroute на routes

--- src/ixinfestor/core_handler.clj
+++ src/ixinfestor/core_handler.clj
@@ -49,22 +49,22 @@
 ;;**************************************************************************************************

 (defn routes-ix* [cms-roles-set]
-  (defroutes routes-for-ix-pathes*
-
-    (ANY "/ix/set" request
-         (cw/ix-accoc-parametr request))
-
-    (GET "/ixinfestor" request
-         (friend/authorize
-          cms-roles-set
-          (-> request
-              cwb/page-ixcms-main
-              ring.util.response/response
-              (ring.util.response/header "Content-Type" "text/html; charset=utf-8"))
-          )
-         )
-
-    ))
+  (routes routes-for-ix-pathes*
+
+          (ANY "/ix/set" request
+               (cw/ix-accoc-parametr request))
+
+          (GET "/ixinfestor" request
+               (friend/authorize
+                cms-roles-set
+                (-> request
+                    cwb/page-ixcms-main
+                    ring.util.response/response
+                    (ring.util.response/header "Content-Type" "text/html; charset=utf-8"))
+                )
+               )
+
+          ))

@@ -79,60 +79,60 @@
 ;;------------------------------------------------------------------------------

 (defn routes-file* [edit-roles-set]
-  (defroutes routes-for-file-upload*
-
-    (POST "/files/list" {{:keys [page page-size fts-query]
-                          :or {page 1 page-size 10 fts-query ""}} :params}
-          (-> ix/files-select*
-              (ix/com-pred-page* (dec page) page-size)
-
-              (as-> query
-                  (let [fts-query (clojure.string/trim fts-query)]
-                    (if (empty? fts-query)
-                      (korma.core/order query :id :desc)
-                      (ix/files-pred-search* query fts-query))))
-
-              ix/com-exec
-              ring.util.response/response))
-
-
-    (multipart/wrap-multipart-params
-     (POST "/files/upload" request
-           (friend/authorize
-            edit-roles-set
-            (do
-              (web-file-upload ix/file-upload (-> request :params :image-uploader))
-              (ring.util.response/response "OK") ))))
-
-    (POST "/files/edit" request
+  (routes
+
+   (POST "/files/list" {{:keys [page page-size fts-query]
+                         :or {page 1 page-size 10 fts-query ""}} :params}
+         (-> ix/files-select*
+             (ix/com-pred-page* (dec page) page-size)
+
+             (as-> query
+                 (let [fts-query (clojure.string/trim fts-query)]
+                   (if (empty? fts-query)
+                     (korma.core/order query :id :desc)
+                     (ix/files-pred-search* query fts-query))))
+
+             ix/com-exec
+             ring.util.response/response))
+
+
+   (multipart/wrap-multipart-params
+    (POST "/files/upload" request
           (friend/authorize
            edit-roles-set
-           (-> request
-               :params
-               ix/files-save
-               ring.util.response/response)))
-
-    (POST "/files/delete" request
-          (friend/authorize
-           edit-roles-set
-           (-> request
-               :params
-               ix/files-delete
-               ((fn [_] {:result "OK"}))
-               ring.util.response/response
-               cw/error-response-json)))
-
-    ;; Кэшированный источник файлов для картинок
-    (GET "/image/*" {{path :*} :params :as request}
-         {:stawebuser 200
-          :headers {"Cache-Control" (str "max-age=" (* 60 60 24 7)) }
-          :body (clojure.java.io/file (str @ix/files-root-directory "/" path))})
-
-    ;; Источник файлов
-    (GET "/file/*" {{path :*} :params :as request}
-         (clojure.java.io/file (str @ix/files-root-directory "/" path)))
-
-    ))
+           (do
+             (web-file-upload ix/file-upload (-> request :params :image-uploader))
+             (ring.util.response/response "OK") ))))
+
+   (POST "/files/edit" request
+         (friend/authorize
+          edit-roles-set
+          (-> request
+              :params
+              ix/files-save
+              ring.util.response/response)))
+
+   (POST "/files/delete" request
+         (friend/authorize
+          edit-roles-set
+          (-> request
+              :params
+              ix/files-delete
+              ((fn [_] {:result "OK"}))
+              ring.util.response/response
+              cw/error-response-json)))
+
+   ;; Кэшированный источник файлов для картинок
+   (GET "/image/*" {{path :*} :params :as request}
+        {:stawebuser 200
+         :headers {"Cache-Control" (str "max-age=" (* 60 60 24 7)) }
+         :body (clojure.java.io/file (str @ix/files-root-directory "/" path))})
+
+   ;; Источник файлов
+   (GET "/file/*" {{path :*} :params :as request}
+        (clojure.java.io/file (str @ix/files-root-directory "/" path)))
+
+   ))
 ;; -----------------------------------------------------------------------------

 ;;**************************************************************************************************
@@ -144,84 +144,86 @@
 ;;**************************************************************************************************

 (defn routes-webusers* [roles-set]
-  (context "/tc/rb/webusers" []
-           (POST "/list" {{:keys [page page-size fts-query]
-                           :or {page 1 page-size 10 fts-query ""}} :params}
+  (routes
+   (context "/tc/rb/webusers" []
+            (POST "/list" {{:keys [page page-size fts-query]
+                            :or {page 1 page-size 10 fts-query ""}} :params}
+                  (friend/authorize
+                   roles-set
+                   (ring.util.response/response
+                    (-> ix/webuser-select*
+                        (ix/com-pred-page* (dec page) page-size)
+
+                        (as-> query
+                            (let [fts-query (clojure.string/trim fts-query)]
+                              (if (empty? fts-query)
+                                (korma.core/order query :id :desc)
+                                (ix/webdoc-pred-search* query fts-query))))
+
+                        ix/com-exec
+                        ((partial map #(dissoc % :password)))))))
+
+
+            (GET "/find/new" []
                  (friend/authorize
                   roles-set
-                  (ring.util.response/response
-                   (-> ix/webuser-select*
-                       (ix/com-pred-page* (dec page) page-size)
-
-                       (as-> query
-                           (let [fts-query (clojure.string/trim fts-query)]
-                             (if (empty? fts-query)
-                               (korma.core/order query :id :desc)
-                               (ix/webdoc-pred-search* query fts-query))))
-
-                       ix/com-exec
-                       ((partial map #(dissoc % :password)))))))
-
-
-           (GET "/find/new" []
-                (friend/authorize
-                 roles-set
-                 (-> {}
-                     (assoc :troles-set [(ix/webrole-list) #{}])
-                     ring.util.response/response)))
-           (GET "/find/:id" [id]
-                (friend/authorize
-                 roles-set
-                 (-> id Long/parseLong
-                     ((partial ix/com-find ix/webuser))
-                     (dissoc :password)
-                     (as-> row
-                         (assoc row :troles-set [(ix/webrole-list)
-                                                 (ix/webuserwebrole-own-get-rels-set row)]))
-                     ring.util.response/response)))
-
-
-           (POST "/save" request
+                  (-> {}
+                      (assoc :troles-set [(ix/webrole-list) #{}])
+                      ring.util.response/response)))
+            (GET "/find/:id" [id]
                  (friend/authorize
                   roles-set
-                  (cw/error-response-json
-                   (let [{:keys [row user-roles-keys-set]} (request :params)
-                         row (-> row
-                                 ix/print-debug->>>
-                                 (as-> row
-                                     (if (empty? (:password row)) (dissoc row :password)
-                                         (update-in row [:password] creds/hash-bcrypt)))
-                                 ix/print-debug->>>
-                                 ((partial ix/com-save-for-id ix/webuser))
-                                 (dissoc :password))]
-
-                     (when user-roles-keys-set
-                       (println (map keyword user-roles-keys-set))
-                       (ix/webuserwebrole-add-rels-for-keynames row (map keyword user-roles-keys-set)))
-
-                     (ring.util.response/response row)))))
-
-           (POST "/change-password" request
-                 (-> request
-                     :params
-                     (update-in [:password] creds/hash-bcrypt)
-                     (assoc :username (-> request :session :cemerick.friend/identity :current))
-                     ix/webuser-save-for-username
-                     ring.util.response/response
-                     cw/error-response-json))
-
-           (POST "/delete" request
-                 (friend/authorize
-                  roles-set
+                  (-> id Long/parseLong
+                      ((partial ix/com-find ix/webuser))
+                      (dissoc :password)
+                      (as-> row
+                          (assoc row :troles-set [(ix/webrole-list)
+                                                  (ix/webuserwebrole-own-get-rels-set row)]))
+                      ring.util.response/response)))
+
+
+            (POST "/save" request
+                  (friend/authorize
+                   roles-set
+                   (cw/error-response-json
+                    (let [{:keys [row user-roles-keys-set]} (request :params)
+                          row (-> row
+                                  ix/print-debug->>>
+                                  (as-> row
+                                      (if (empty? (:password row)) (dissoc row :password)
+                                          (update-in row [:password] creds/hash-bcrypt)))
+                                  ix/print-debug->>>
+                                  ((partial ix/com-save-for-id ix/webuser))
+                                  (dissoc :password))]
+
+                      (when user-roles-keys-set
+                        (println (map keyword user-roles-keys-set))
+                        (ix/webuserwebrole-add-rels-for-keynames row (map keyword user-roles-keys-set)))
+
+                      (ring.util.response/response row)))))
+
+            (POST "/change-password" request
                   (-> request
                       :params
-                      :id
-                      ((partial ix/com-delete-for-id ix/webuser))
-                      ((fn [_] {:result "OK"}))
+                      (update-in [:password] creds/hash-bcrypt)
+                      (assoc :username (-> request :session :cemerick.friend/identity :current))
+                      ix/webuser-save-for-username
                       ring.util.response/response
-                      cw/error-response-json)))
-
-           )
+                      cw/error-response-json))
+
+            (POST "/delete" request
+                  (friend/authorize
+                   roles-set
+                   (-> request
+                       :params
+                       :id
+                       ((partial ix/com-delete-for-id ix/webuser))
+                       ((fn [_] {:result "OK"}))
+                       ring.util.response/response
+                       cw/error-response-json)))
+
+            )
+   )
   )

 ;; END Users reference book
@@ -236,81 +238,83 @@
 ;;**************************************************************************************************

 (defn routes-stext* [edit-roles-set]
-  (context "/tc/rb/stext" []
-
-           (POST "/list" {{:keys [page page-size fts-query]
-                           :or {page 1 page-size 10 fts-query ""}} :params}
-                 (-> ix/stext-select*
-                     (ix/com-pred-page* (dec page) page-size)
-
-                     (as-> query
-                         (let [fts-query (clojure.string/trim fts-query)]
-                           (if (empty? fts-query)
-                             (korma.core/order query :id :desc)
-                             (ix/webdoc-pred-search* query fts-query))))
-
-                     ix/com-exec
-                     ((partial map #(dissoc % :password)))
-                     ring.util.response/response))
-
-           (GET "/find/:id" [id] (-> id
-                                     Long/parseLong
-                                     ((partial ix/com-find ix/stext))
-                                     ring.util.response/response))
-
-           (POST "/save" request
-                 (friend/authorize
-                  edit-roles-set
-                  (-> request
-                      :params
-                      :row
-                      ((partial ix/com-save-for-id ix/stext))
-                      ring.util.response/response
-                      cw/error-response-json))
-
-                 )))
+  (routes
+   (context "/tc/rb/stext" []
+
+            (POST "/list" {{:keys [page page-size fts-query]
+                            :or {page 1 page-size 10 fts-query ""}} :params}
+                  (-> ix/stext-select*
+                      (ix/com-pred-page* (dec page) page-size)
+
+                      (as-> query
+                          (let [fts-query (clojure.string/trim fts-query)]
+                            (if (empty? fts-query)
+                              (korma.core/order query :id :desc)
+                              (ix/webdoc-pred-search* query fts-query))))
+
+                      ix/com-exec
+                      ((partial map #(dissoc % :password)))
+                      ring.util.response/response))
+
+            (GET "/find/:id" [id] (-> id
+                                      Long/parseLong
+                                      ((partial ix/com-find ix/stext))
+                                      ring.util.response/response))
+
+            (POST "/save" request
+                  (friend/authorize
+                   edit-roles-set
+                   (-> request
+                       :params
+                       :row
+                       ((partial ix/com-save-for-id ix/stext))
+                       ring.util.response/response
+                       cw/error-response-json))
+
+                  ))))
 ;; END Spec text reference book
 ;;..................................................................................................

 (defn routes-tag* [edit-roles-set]
-  (context "/tag" []
-
-
-           (GET "/:id/path-and-chailds" [id]
-                (ring.util.response/response
-                 (ix/tag-get-tree-path-and-childs
-                  {:id (if (= id "root") nil (Long/parseLong id))})))
-
-           (GET "/tree-as-flat-groups" []
-                (ring.util.response/response
-                 (ix/tag-tree-as-flat-groups)))
-
-           ;; TAGS WORK ------------------------------------------------------
-
-
-           (POST "/save" request
-                 (friend/authorize
-                  edit-roles-set
-                  (-> request
-                      :params
-                      ix/tag-save
-                      ring.util.response/response
-                      cw/error-response-json)))
-
-           (POST "/delete" request
-                 (friend/authorize
-                  edit-roles-set
-                  (-> request
-                      :params
-                      ix/tag-delete
-                      ((fn [_] {:result "OK"}))
-                      ring.util.response/response
-                      cw/error-response-json)))
-
-           ;; TAGS WORK ------------------------------------------------------
-           )
+  (routes
+   (context "/tag" []
+
+
+            (GET "/:id/path-and-chailds" [id]
+                 (ring.util.response/response
+                  (ix/tag-get-tree-path-and-childs
+                   {:id (if (= id "root") nil (Long/parseLong id))})))
+
+            (GET "/tree-as-flat-groups" []
+                 (ring.util.response/response
+                  (ix/tag-tree-as-flat-groups)))
+
+            ;; TAGS WORK ------------------------------------------------------
+
+
+            (POST "/save" request
+                  (friend/authorize
+                   edit-roles-set
+                   (-> request
+                       :params
+                       ix/tag-save
+                       ring.util.response/response
+                       cw/error-response-json)))
+
+            (POST "/delete" request
+                  (friend/authorize
+                   edit-roles-set
+                   (-> request
+                       :params
+                       ix/tag-delete
+                       ((fn [_] {:result "OK"}))
+                       ring.util.response/response
+                       cw/error-response-json)))
+
+            ;; TAGS WORK ------------------------------------------------------
+            ))
   )

 ;;**************************************************************************************************
@@ -333,145 +337,145 @@
                              context-path "/tc/rb/webdocs"
                              webdoc-save-fn ix/webdoc-save}
                         :as init-row}]
-
-  (context context-path []
-
-           (POST "/bytag" {{:keys [tag-id page page-size fts-query]
-                            :or {page 1 page-size 10 fts-query ""}} :params}
-                 (do
-                   (-> webdoc-select* ;;; SRC
-                       (ix/webdoc-pred-search-for-the-child-tree-tags*
-                        {:id (if (= tag-id "root") nil tag-id)})
-
-                       (as-> query
-                           (let [fts-query (clojure.string/trim fts-query)]
-                             (if (empty? fts-query)
-                               (korma.core/order query :id :desc)
-                               (ix/webdoc-pred-search* query fts-query))))
-
-
-                       (ix/com-pred-page* (dec page) page-size)
-                       ix/com-exec
-                       korma.db/transaction
+  (routes
+   (context context-path []
+
+            (POST "/bytag" {{:keys [tag-id page page-size fts-query]
+                             :or {page 1 page-size 10 fts-query ""}} :params}
+                  (do
+                    (-> webdoc-select* ;;; SRC
+                        (ix/webdoc-pred-search-for-the-child-tree-tags*
+                         {:id (if (= tag-id "root") nil tag-id)})
+
+                        (as-> query
+                            (let [fts-query (clojure.string/trim fts-query)]
+                              (if (empty? fts-query)
+                                (korma.core/order query :id :desc)
+                                (ix/webdoc-pred-search* query fts-query))))
+
+
+                        (ix/com-pred-page* (dec page) page-size)
+                        ix/com-exec
+                        korma.db/transaction
+                        ring.util.response/response
+                        cw/error-response-json)))
+
+            (GET "/edit/new" [] (ring.util.response/response {}))
+            (GET "/edit/:id" [id]
+                 ;;TODO: Попробовать сделать все в рамках одной транзакции
+                 (let [id (Long/parseLong id)]
+                   (-> {:webdoc-row (ix/com-find webdoc-entity id)  ;;; SRC
+                        }
                        ring.util.response/response
                        cw/error-response-json)))

-           (GET "/edit/new" [] (ring.util.response/response {}))
-           (GET "/edit/:id" [id]
-                ;;TODO: Попробовать сделать все в рамках одной транзакции
-                (let [id (Long/parseLong id)]
-                  (-> {:webdoc-row (ix/com-find webdoc-entity id)  ;;; SRC
-                       }
+            (POST "/webdoctags-edit-table" request
+                  (-> request
+                      :params
+                      (ix/webdoctag-tag-tree-as-flat-groups-with-patches :path)
                       ring.util.response/response
-                      cw/error-response-json)))
-
-           (POST "/webdoctags-edit-table" request
+                      cw/error-response-json))
+
+            (POST "/save" {{:keys [webdoc-row webdoctag-ids-for-updating swops]} :params}
+                  (friend/authorize
+                   edit-roles-set
+                   (cw/error-response-json
+                    (let [new-webdoc-row (when webdoc-row
+                                           (-> webdoc-row
+                                             ;;; SPEC HANDLER
+                                               ;;(update-in-if-not-nil? [:price] bigdec)
+                                               ;;(update-in-if-not-nil? [:orderindex] parseLong)
+                                               ;;(update-in-if-not-nil? [:showbdate] #(new java.util.Date %))
+                                               ;;(update-in-if-not-nil? [:showedate] #(new java.util.Date %))
+                                               covertors-fn
+                                               webdoc-save-fn
+                                               ))]
+
+                      (ring.util.response/response {:result-code 0
+                                                    :webdoc-row new-webdoc-row
+                                                    :webdoctag-rows (when (and new-webdoc-row
+                                                                               webdoctag-ids-for-updating)
+                                                                      (->> webdoctag-ids-for-updating
+                                                                           (map (partial assoc {} :id))
+                                                                           ((partial ix/webdoctag-update-tags new-webdoc-row))
+                                                                           doall))
+                                                    })))))
+
+            (POST "/delete" request
+                  (friend/authorize
+                   edit-roles-set
+                   (-> request
+                       :params
+                       ix/webdoc-delete
+                       ((fn [_] {:result "OK"}))
+                       ring.util.response/response
+                       cw/error-response-json)))
+
+            (GET "/images-list" request
                  (-> request
                      :params
-                     (ix/webdoctag-tag-tree-as-flat-groups-with-patches :path)
+                     (update-in [:id] parseLong)
+                     (ix/files_rel-select-files-by-* :webdoc_id)
+                     ix/file-pred-images*
+                     ix/com-exec
                      ring.util.response/response
                      cw/error-response-json))

-           (POST "/save" {{:keys [webdoc-row webdoctag-ids-for-updating swops]} :params}
-                 (friend/authorize
-                  edit-roles-set
-                  (cw/error-response-json
-                   (let [new-webdoc-row (when webdoc-row
-                                          (-> webdoc-row
-                                             ;;; SPEC HANDLER
-                                              ;;(update-in-if-not-nil? [:price] bigdec)
-                                              ;;(update-in-if-not-nil? [:orderindex] parseLong)
-                                              ;;(update-in-if-not-nil? [:showbdate] #(new java.util.Date %))
-                                              ;;(update-in-if-not-nil? [:showedate] #(new java.util.Date %))
-                                              covertors-fn
-                                              webdoc-save-fn
-                                              ))]
-
-                     (ring.util.response/response {:result-code 0
-                                                   :webdoc-row new-webdoc-row
-                                                   :webdoctag-rows (when (and new-webdoc-row
-                                                                              webdoctag-ids-for-updating)
-                                                                     (->> webdoctag-ids-for-updating
-                                                                          (map (partial assoc {} :id))
-                                                                          ((partial ix/webdoctag-update-tags new-webdoc-row))
-                                                                          doall))
-                                                   })))))
-
-           (POST "/delete" request
-                 (friend/authorize
-                  edit-roles-set
-                  (-> request
-                      :params
-                      ix/webdoc-delete
-                      ((fn [_] {:result "OK"}))
-                      ring.util.response/response
-                      cw/error-response-json)))
-
-           (GET "/images-list" request
-                (-> request
-                    :params
-                    (update-in [:id] parseLong)
-                    (ix/files_rel-select-files-by-* :webdoc_id)
-                    ix/file-pred-images*
-                    ix/com-exec
-                    ring.util.response/response
-                    cw/error-response-json))
-
-           (GET "/files-list" request
-                (-> request
-                    :params
-                    (update-in [:id] parseLong)
-                    (ix/files_rel-select-files-by-* :webdoc_id)
-                    (ix/file-pred-images* :not-image)
-                    ix/com-exec
-                    ring.util.response/response
-                    cw/error-response-json))
-
-           (context "/upload/:id" [id]
-
-                    (multipart/wrap-multipart-params
-                     (POST "/image/avatar" request
-                           (friend/authorize
-                            edit-roles-set
-                            (ring.util.response/response
-                             (let [id (parseLong id)
-                                   [{path :path} _] (web-file-upload
-                                                     (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id id})
-                                                     (-> request :params :file-uploader))]
-                               (ix/webdoc-save {:id id :web_title_image path})
-                               "OK")))))
-
-                    (multipart/wrap-multipart-params
-                     (POST "/image" request
-                           (friend/authorize
-                            edit-roles-set
-                            (ring.util.response/response
-                             (do (web-file-upload
-                                  (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id (parseLong id)})
-                                  (-> request :params :image-uploader))
-                                 "OK")))))
-
-                    (multipart/wrap-multipart-params
-                     (POST "/file" request
-                           (friend/authorize
-                            edit-roles-set
-                            (ring.util.response/response
-                             (do
-                               (web-file-upload
-                                (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id (parseLong id)})
-                                (-> request :params :file-uploader))
-                               "OK")))))
-
-                    )
-
-           (POST "/files_rel/delete" {{:keys [webdoc-id file-id]} :params}
-                 (friend/authorize
-                  edit-roles-set
-                  (-> (ix/files_rel-delete :webdoc_id {:id file-id} {:id webdoc-id})
-                      ring.util.response/response
-                      cw/error-response-json))
-                 ))
-
+            (GET "/files-list" request
+                 (-> request
+                     :params
+                     (update-in [:id] parseLong)
+                     (ix/files_rel-select-files-by-* :webdoc_id)
+                     (ix/file-pred-images* :not-image)
+                     ix/com-exec
+                     ring.util.response/response
+                     cw/error-response-json))
+
+            (context "/upload/:id" [id]
+
+                     (multipart/wrap-multipart-params
+                      (POST "/image/avatar" request
+                            (friend/authorize
+                             edit-roles-set
+                             (ring.util.response/response
+                              (let [id (parseLong id)
+                                    [{path :path} _] (web-file-upload
+                                                      (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id id})
+                                                      (-> request :params :file-uploader))]
+                                (ix/webdoc-save {:id id :web_title_image path})
+                                "OK")))))
+
+                     (multipart/wrap-multipart-params
+                      (POST "/image" request
+                            (friend/authorize
+                             edit-roles-set
+                             (ring.util.response/response
+                              (do (web-file-upload
+                                   (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id (parseLong id)})
+                                   (-> request :params :image-uploader))
+                                  "OK")))))
+
+                     (multipart/wrap-multipart-params
+                      (POST "/file" request
+                            (friend/authorize
+                             edit-roles-set
+                             (ring.util.response/response
+                              (do
+                                (web-file-upload
+                                 (partial ix/file-upload-rel-on webdoc-entity :webdoc_id {:id (parseLong id)})
+                                 (-> request :params :file-uploader))
+                                "OK")))))
+
+                     )
+
+            (POST "/files_rel/delete" {{:keys [webdoc-id file-id]} :params}
+                  (friend/authorize
+                   edit-roles-set
+                   (-> (ix/files_rel-delete :webdoc_id {:id file-id} {:id webdoc-id})
+                       ring.util.response/response
+                       cw/error-response-json))
+                  ))
+   )
   )

 ;; END Products reference book


added stubbed out snap partial

added stubbed out snap partial

--- src/lcmap/clownfish/changes.clj
+++ src/lcmap/clownfish/changes.clj
@@ -84,10 +84,15 @@
   [{:keys [x y]}]
   true)

+;;; TODO - query landsat/tile-specs/all
 (defstate tile-specs
   :start {:tile_x 10 :tile_y 10 :shift_x 0 :shift_y 0})

-(defn snap [x y]
+;;; load ts in fn's sig and you have a loaded partial ready to go.
+(defstate snap
+  :start (partial (fn [ts x y](tile/snap x y ts))))
+
+(defn snap [tile-specs x y]
   (tile/snap x y tile-specs))

 (defn get-change-results


More fixes. WIP.

More fixes. WIP.

[ci skip]

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -52,18 +52,18 @@
        (last)))

 (defn commit-loop [consumer m topic kpartition commit-interval pending-commits]
-  (future
-    (try
-      (loop []
-        (Thread/sleep commit-interval)
-        (when-let [offset (highest-offset-to-commit @pending-commits)]
-          (kzk/set-offset! m consumer topic kpartition offset)
-          (swap! pending-commits (fn [coll] (remove (fn [k] (<= k offset)) coll))))
-        (recur))
-      (catch InterruptedException e
-        (throw e))
-      (catch Throwable e
-        (fatal e)))))
+  (try
+    (loop []
+      (Thread/sleep commit-interval)
+      (when-let [offset (highest-offset-to-commit @pending-commits)]
+        (log/info "Writing offset to ZooKeeper: " offset)
+        (kzk/set-offset! m consumer topic kpartition offset)
+        (swap! pending-commits (fn [coll] (remove (fn [k] (<= k offset)) coll))))
+      (recur))
+    (catch InterruptedException e
+      (throw e))
+    (catch Throwable e
+      (fatal e))))

 (defn reader-loop [m client-id group-id topic partitions kpartition task-map ch pending-commits]
   (try
@@ -77,15 +77,18 @@
               messages (kc/messages consumer "onyx" topic kpartition offset fetch-size)
               empty-read-back-off (or (:kafka/empty-read-back-off task-map) (:kafka/empty-read-back-off defaults))
               commit-interval (or (:kafka/commit-interval task-map) (:kafka/commit-interval defaults))
-              commit-fut (future (commit-loop m topic kpartition commit-interval pending-commits))]
-          (log/debug "Opening Kafka consumer" task-map)
-          (log/debug (str "Kafka consumer is starting at offset " offset))
-          (loop [ms messages]
-            (if (first ms)
-              (>!! ch {:message (read-string (String. (.value ^KafkaMessage (first ms)) "UTF-8"))
-                       :offset (.offset ^int (first ms))})
-              (Thread/sleep empty-read-back-off))
-            (recur (rest ms))))
+              commit-fut (future (commit-loop consumer m topic kpartition commit-interval pending-commits))]
+          (log/info "Opening Kafka consumer" task-map)
+          (log/info (str "Kafka consumer is starting at offset " offset))
+          (try
+            (loop [ms messages]
+              (if (first ms)
+                (>!! ch {:message (read-string (String. (.value ^KafkaMessage (first ms)) "UTF-8"))
+                         :offset (.offset ^int (first ms))})
+                (Thread/sleep empty-read-back-off))
+              (recur (rest ms)))
+            (finally
+             (future-cancel commit-fut))))
         (catch InterruptedException e
           (throw e))
         (catch Throwable e
@@ -117,7 +120,7 @@
         max-pending (or (:onyx/max-pending task-map) 10000)
         batch-size (:onyx/batch-size task-map)
         max-segments (min (- max-pending pending) batch-size)
-        ms (or (:onyx/batch-timeout task-map) 500)
+        ms (or (:onyx/batch-timeout task-map) 50)
         timeout-ch (timeout ms)
         batch (->> (range max-segments)
                    (map (fn [_]
@@ -133,7 +136,7 @@

 (defmethod p-ext/ack-message :kafka/read-messages
   [{:keys [kafka/pending-messages kafka/pending-commits onyx.core/log onyx.core/task-id]} message-id]
-  (when-let [offset (:offset (get pending-messages message-id))]
+  (when-let [offset (:offset (get @pending-messages message-id))]
     (swap! pending-commits conj offset))
   (swap! pending-messages dissoc message-id))


bugfix export-scene (using direct stream writes & as-byte-array instead of writing via spit), add type hints

--- src/thi/ng/luxor/core.clj
+++ src/thi/ng/luxor/core.clj
@@ -56,7 +56,7 @@
             "")))

 (defn- path-filename
-  [path] (.getName (File. path)))
+  [path] (.getName (File. ^String path)))

 (defn- include-file*
   [path]
@@ -140,7 +140,9 @@
       serialized-map
       (fn [_ path body]
         (println "exporting:" path)
-        (spit path body))))
+        (with-open [out (io/output-stream path)]
+          (let [buf ^bytes (as-byte-array body)]
+            (.write out buf 0 (alength buf)))))))
   ([serialized-map f]
      (doseq [[id {:keys [path body]}] serialized-map]
        (when (and path body)
@@ -153,9 +155,9 @@
     (.setMethod zip ZipOutputStream/DEFLATED)
     (doseq [[id {:keys [path body]}] serialized-map]
       (when (and path body)
-        (let [buf (as-byte-array body)]
+        (let [buf ^bytes (as-byte-array body)]
           (doto zip
-            (.putNextEntry (ZipEntry. path))
+            (.putNextEntry (ZipEntry. ^String path))
             (.write buf 0 (alength buf)))))))
   serialized-map)

@@ -643,6 +645,14 @@
   (assoc-in scene [:__config :mesh-streamer] f))

 (defn configure-mesh-collector
+  "Configures the scene to use given fn as mesh collector during
+  serialization. The fn needs to accept the scene as single arg and
+  return a map of:
+
+    {mesh-id {:path export-path :body mesh}
+
+  The :body value must satisfy the PAsByteArray protocol defined in
+  this namespace."
   [scene f]
   (assoc-in scene [:__config :mesh-collector] f))


Add more translation strings.

Add more translation strings.

--- src/uxbox/locales/en.cljs
+++ src/uxbox/locales/en.cljs
@@ -12,5 +12,10 @@
                       "%s elements"]

    "ds.recent-colors" "Recent colors"
+   "ds.tools" "Tools"
+
+   "ds.help.rect" "Box (Ctrl + B)"
+   "ds.help.circle" "Circle (Ctrl + E)"
+   "ds.help.line" "Line (Ctrl + L)"

    })


Kibit

Kibit

--- src/desdemona/tasks/swift.clj
+++ src/desdemona/tasks/swift.clj
@@ -3,10 +3,9 @@
 (defn add-swift-output
   "Adds a Swift output task to a job"
   [job task opts]
-  (-> job
-      (update :catalog conj (merge {:onyx/name task
+  (update job :catalog conj (merge {:onyx/name task
                                     :onyx/plugin :desdemona.plugins.swift/write-batch
                                     :onyx/type :output
                                     :onyx/medium :swift
                                     :onyx/doc "Write segments to Swift"}
-                                   opts))))
+                                   opts)))


if-not -> core/if-not in macros file

if-not -> core/if-not in macros file

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -1845,7 +1845,7 @@
              [part bit] (fast-path-protocols p)
              msym       (symbol
                           (core/str "-cljs$lang$protocol_mask$partition" part "$"))]
-    (if-not (core/symbol? x)
+    (core/if-not (core/symbol? x)
       `(let [~xsym ~x]
          (if ~xsym
            (if (or ~(if bit `(unsafe-bit-and (. ~xsym ~msym) ~bit) false)
@@ -1871,7 +1871,7 @@
              [part bit] (fast-path-protocols p)
              msym       (symbol
                           (core/str "-cljs$lang$protocol_mask$partition" part "$"))]
-    (if-not (core/symbol? x)
+    (core/if-not (core/symbol? x)
       `(let [~xsym ~x]
          (if-not (nil? ~xsym)
            (if (or ~(if bit `(unsafe-bit-and (. ~xsym ~msym) ~bit) false)


CLJS-1307: Doc for ns missing

CLJS-1307: Doc for ns missing

Adds docstring for ns

--- src/main/clojure/cljs/repl.cljc
+++ src/main/clojure/cljs/repl.cljc
@@ -947,6 +947,50 @@
                (.-instanceField instance)]
        :doc "The instance member form works for methods and fields.
   They all expand into calls to the dot operator at macroexpansion time."}
+    ns {:forms [(name docstring? attr-map? references*)]
+        :doc "You must currently use the ns form only with the following caveats
+
+    * You must use the :only form of :use
+    * :require supports :as and :refer
+      - both options can be skipped
+      - in this case a symbol can be used as a libspec directly
+        - that is, (:require lib.foo) and (:require [lib.foo]) are both
+          supported and mean the same thing
+      - prefix lists are not supported
+    * The only option for :refer-clojure is :exclude
+    * :import is available for importing Google Closure classes
+      - ClojureScript types and records should be brought in with :use
+        or :require :refer, not :import ed
+    * Macros are written in Clojure, and are referenced via the new
+      :require-macros / :use-macros options to ns
+      - :require-macros and :use-macros support the same forms that
+        :require and :use do
+
+  Implicit macro loading: If a namespace is required or used, and that
+  namespace itself requires or uses macros from its own namespace, then
+  the macros will be implicitly required or used using the same
+  specifications. This oftentimes leads to simplified library usage,
+  such that the consuming namespace need not be concerned about
+  explicitly distinguishing between whether certain vars are functions
+  or macros.
+
+  Inline macro specification: As a convenience, :require can be given
+  either :include-macros true or :refer-macros [syms...]. Both desugar
+  into forms which explicitly load the matching Clojure file containing
+  macros. (This works independently of whether the namespace being
+  required internally requires or uses its own macros.) For example:
+
+  (ns testme.core
+  (:require [foo.core :as foo :refer [foo-fn] :include-macros true]
+            [woz.core :as woz :refer [woz-fn] :refer-macros [app jx]]))
+
+  is sugar for
+
+  (ns testme.core
+  (:require [foo.core :as foo :refer [foo-fn]]
+            [woz.core :as woz :refer [woz-fn]])
+  (:require-macros [foo.core :as foo]
+                   [woz.core :as woz :refer [app jx]]))"}
     def {:forms [(def symbol doc-string? init?)]
          :doc "Creates and interns a global var with the name
   of symbol in the current namespace (*ns*) or locates such a var if


Fix println

Fix println

--- src/main/resources/builtins.clj
+++ src/main/resources/builtins.clj
@@ -49,5 +49,5 @@
 (defn char-at [s pos]
   (subs s pos (+ pos 1)))

-(defn println [& args]
-  (apply print args "\n"))
+(defmacro println [args]
+  (list 'apply 'print args "\n"))


Added file-seq cljs implementation

Added file-seq cljs implementation

Former-commit-id: 5019ef92a62fac7aefff437fda915ce76f7a9efd

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -302,3 +302,8 @@
           (catch :default e
             (set! *e e)
             (print-error e)))))))
+
+(defn file-seq
+  "A tree seq on PLKFiles"
+  [dir]
+  (js/PLANCK_IO_FILESEQ dir))


add `with-tmp-dir` for tests (#316)

add `with-tmp-dir` for tests (#316)

--- test/etaoin/api_test2.clj
+++ test/etaoin/api_test2.clj
@@ -3,7 +3,19 @@
             [etaoin.proc]
             [clojure.test :refer :all])
   (:import (java.nio.file Files)
+           (java.io File)
+           (org.apache.commons.io FileUtils)
            (java.nio.file.attribute FileAttribute)))
+
+(defmacro with-tmp-dir [prefix bind & body]
+  `(let [tmp#  (str (Files/createTempDirectory
+                      ~prefix
+                      (into-array FileAttribute [])))
+         ~bind tmp#]
+     (try
+       ~@body
+       (finally
+         (FileUtils/deleteDirectory (File. tmp#))))))

 (deftest test-firefox-driver-args
   (with-redefs
@@ -32,13 +44,12 @@
                (:args @driver)))))))

 (deftest test-chrome-profile
-  (let [profile-path (str (Files/createTempDirectory
-                            "chrome-profile"
-                            (into-array FileAttribute [])))]
-    (with-chrome {:profile profile-path :args ["--no-sandbox"]} driver
-      (go driver "chrome://version")
-      (is profile-path
-          (get-element-text driver :profile_path)))))
+  (with-tmp-dir "chrome-dir" chrome-dir
+    (let [profile-path (str (File. chrome-dir "chrome-profile"))]
+      (with-chrome {:profile profile-path :args ["--no-sandbox"]} driver
+        (go driver "chrome://version")
+        (is profile-path
+            (get-element-text driver :profile_path))))))

 (deftest test-fail-run-driver
   (is (thrown-with-msg?


Write contents to sync

Write contents to sync

--- src/onyx/coordinator/async.clj
+++ src/onyx/coordinator/async.clj
@@ -33,15 +33,13 @@
       (let [payload-node (extensions/create sync :payload)
             ack-node (extensions/create sync :ack)
             complete-node (extensions/create sync :completion)
-            status-node (extensions/create sync :status)]
+            status-node (extensions/create sync :status)
+            nodes {:payload payload-node :ack ack-node
+                   :completion complete-node :status status-node}]
         (extensions/on-change sync payload-node ack-cb)
         (extensions/on-change sync ack-node complete-cb)
-        (extensions/mark-offered log task peer
-                                 {:payload payload-node
-                                  :ack ack-node
-                                  :completion complete-node
-                                  :status status-node})
-        #_(extensions/write-place sync)))))
+        (extensions/mark-offered log task peer nodes)
+        (extensions/write-place sync payload-node {:task task :nodes nodes})))))

 (defn complete-task [log sync queue task]
   (extensions/delete sync task)


start middleware logging & cond. app.

start middleware logging & cond. app.

--- src/clj/clj_money/web/server.clj
+++ src/clj/clj_money/web/server.clj
@@ -208,26 +208,74 @@
      :credential-fn (partial clj-money.models.users/authenticate (env :db))
      :redirect-on-auth? false}))

+(defn- api?
+  [{uri :uri}]
+  (when uri
+    (re-find #"^/api" uri)))
+
+(def ^:private open-route-rules
+  ["/"
+   [:get "/login"]
+   [:get "/signup"]
+   [:post "/users"]
+   [:get "/users/:token/password"]
+   [:post "/users/:token/password"]])
+
+(defn- open?
+  [{uri :uri method :request-method}]
+  (some (fn [rule]
+          (if (coll? rule)
+            (and (= uri (second rule))
+                 (= method (first rule)))
+            (= uri rule)))
+        open-route-rules))
+
+(defn- apply-wrapper
+  [handler wrapper]
+  (let [[wrapper-fn
+         description
+         test-fn] (if (= 2 (count wrapper))
+                    (conj wrapper (constantly true))
+                    wrapper)
+        wrapped-fn (wrapper-fn handler)]
+    (fn [request]
+
+      (when-not request
+        (throw (IllegalArgumentException. "request cannot be nil")))
+
+      (if (test-fn request)
+        (do
+          (log/debug "apply middleware " (:uri request) description)
+          (handler (wrapped-fn request)))
+        (do
+          (log/debug "ignore middleware " (:uri request) description)
+          (handler request))))))
+
+(defn-  wrap-routes
+  [handler & wrappers]
+  (reduce apply-wrapper
+          handler
+          wrappers))
+
+(def wrapped-routes
+  (wrap-routes (routes open-routes
+                       api-routes
+                       protected-routes)
+               [wrap-multipart-params               "multipart params" (complement api?)]
+               [wrap-keyword-params                 "keyword params"   (complement api?)]
+               [wrap-json-params                    "json params"      api?]
+               [wrap-json-response                  "json response"    api?]
+               [wrap-keyword-params                 "keyword params"]
+               [wrap-params                         "params"]
+               [wrap-exception-handling             "excpetion handling"]
+               [wrap-content-type                   "content-type"]
+               [#(wrap-resource % "public")         "public resources"]
+               [#(friend/wrap-authorize % #{:user}) "authorization"    (complement open?)]
+               [wrap-authenticate                   "authentication"   (complement open?)]
+               [wrap-session                        "session"]))
+
 (defroutes app
-  (-> (routes (-> (routes open-routes
-                          (-> protected-routes
-                              wrap-multipart-params
-                              wrap-keyword-params
-                              wrap-params
-                              (friend/wrap-authorize #{:user})
-                              wrap-authenticate))
-                  wrap-anti-forgery)
-              (-> api-routes
-                  wrap-json-response
-                  wrap-keyword-params
-                  wrap-json-params
-                  wrap-params
-                  (friend/wrap-authorize #{:user})
-                  wrap-authenticate))
-      wrap-exception-handling
-      wrap-content-type
-      (wrap-resource "public")
-      wrap-session)
+  wrapped-routes
   (friend/logout (POST "/logout" [] (redirect "/")))
   (ANY "*" req
        (do


Don't resolve env vars for node providers.

That's now handled across all config.

--- src/clj/shale/node_providers.clj
+++ src/clj/shale/node_providers.clj
@@ -1,9 +1,9 @@
 (ns shale.node-providers
   (:require [amazonica.aws.ec2 :as ec2]
-            [clj-kube.core :as kube]
-            [environ.core :as env])
-  (:import java.io.FileNotFoundException))
-
+            [cemerick.url :refer [url]]
+            [clj-kube.core :as kube])
+  (:import java.io.FileNotFoundException
+           java.net.MalformedURLException))
 (try
   (require '[amazonica.aws.ec2])
   (catch FileNotFoundException e))
@@ -127,10 +127,10 @@
   "Use pods with the given kubernetes label. Label is a map containing a single key & value. port-name is the named container port to connect on"
   (assert (= :kube (:provider options)))
   (assert api-url)
-  (let [api-url (if (and (keyword? api-url) (= "env" (namespace api-url)))
-                  (do
-                    (assert (get env/env (keyword (name api-url))))
-                    (str "https://" (get env/env (keyword (name api-url)))))
-                  api-url)
+  (let [api-url (try
+                  (str (url api-url))
+                  (catch MalformedURLException e
+                    (if (.contains (.msg e) "no protocol")
+                      (str (url (str "https://" api-url))))))
         options (assoc options :api-url api-url)]
     (map->KubeNodeProvider options)))


allow :find or :reload in update-fn

allow :find or :reload in update-fn

--- src/clj_money/models/helpers.clj
+++ src/clj_money/models/helpers.clj
@@ -101,7 +101,9 @@
         (if (validation/valid? validated)
           (do
             (process-options options s validated :before-save :update)
-            ((:find options) s (:id validated)))
+            (if (:find options)
+              ((:find options) s (:id validated))
+              ((:reload options) s validated)))
           validated)))))

 (defn throw-if-nil


fix a critical bug for converting sam/bam #13

--- src/clojure/cljam/bam/writer.clj
+++ src/clojure/cljam/bam/writer.clj
@@ -122,7 +122,8 @@
     \A (lsb/write-char writer (char value))
     \i (lsb/write-int    writer (int value))
     \f (lsb/write-float  writer (float value))
-    \Z (lsb/write-string writer value)
+    \Z (do (lsb/write-string writer value)
+           (lsb/write-char writer (char 0)))
     ;; \H nil
     \B (let [[array-type & array] (split value #",")]
          (case (first array-type)