No need to run as-int on values that are already ints

as they are passed as json

--- src/clj/hyphen_keeper/handler.clj
+++ src/clj/hyphen_keeper/handler.clj
@@ -55,9 +55,9 @@
 (defroutes api-routes
   (GET "/hyphenate" [word spelling :<< as-int] (hyphenate/hyphenate word spelling))
   (GET "/words" [search spelling  :<< as-int offset max-rows] (word-list search spelling offset max-rows))
-  (POST "/words" [word hyphenation spelling :<< as-int] (word-add word hyphenation spelling))
-  (PUT "/words" [word hyphenation spelling :<< as-int] (word-add word hyphenation spelling))
-  (DELETE "/words/:word" [word spelling :<< as-int] (word-delete word spelling))
+  (POST "/words" [word hyphenation spelling] (word-add word hyphenation spelling))
+  (PUT "/words" [word hyphenation spelling] (word-add word hyphenation spelling))
+  (DELETE "/words/:word" [word spelling] (word-delete word spelling))
   (not-found "Not Found"))

 (defroutes site-routes


remove comment

remove comment

--- src/clj/salava/badge/importer.clj
+++ src/clj/salava/badge/importer.clj
@@ -158,7 +158,6 @@
       (log/error (.toString ex))
       {:status "error" :message "badge/Errorwhileuploading" :reason (.getMessage ex)})))

-;;TODO Update recipient count and also make user badge connection
 (defn upload-badge-via-assertion [ctx assertion user]
   (let [user-id (:id user)]
     (log/info "assertion-badge-upload: got new upload from user id " user-id)


Pass upstream-deps to compiler-env when creating a repl-env.

--- src/clj/weasel/repl/websocket.clj
+++ src/clj/weasel/repl/websocket.clj
@@ -39,7 +39,11 @@
 (defn repl-env
   "Returns a JS environment to pass to repl or piggieback"
   [& {:as opts}]
-  (let [compiler-env (env/default-compiler-env opts)
+  (let [ups-deps (cljsc/get-upstream-deps (java.lang.ClassLoader/getSystemClassLoader))
+        opts (assoc opts
+               :ups-libs (:libs ups-deps)
+               :ups-foreign-libs (:foreign-libs ups-deps))
+        compiler-env (env/default-compiler-env opts)
         opts (merge (WebsocketEnv.)
                {::env/compiler compiler-env
                 :ip "127.0.0.1"


refine entity validation

refine entity validation

--- src/clj_money/models/entities.clj
+++ src/clj_money/models/entities.clj
@@ -18,7 +18,8 @@

 (def Entity
   "Schema for saved entities"
-  (merge NewEntity {:id s/Int}))
+  {:id s/Int
+   :name (s/maybe s/Str)})

 (defn- prepare-entity-for-save
   [entity]
@@ -29,8 +30,8 @@
   (rename-keys entity {:user_id :user-id}))

 (defn- validate-entity
-  [storage entity]
-  (let [validated (validate-model entity NewEntity "entity")]
+  [storage schema entity]
+  (let [validated (validate-model entity schema "entity")]
     (if (entity-exists-with-name? storage
                                   (:user-id validated)
                                   (:name validated))
@@ -40,12 +41,20 @@
                                   "entity")
       validated)))

+(defn- validate-new-entity
+  [storage entity]
+  (validate-entity storage NewEntity entity))
+
+(defn- validate-existing-entity
+  [storage entity]
+  (validate-entity storage Entity entity))
+
 (defn create
   "Creates a new entity"
   [storage-spec entity]
   (let [s (storage storage-spec)]
     (->> entity
-         (validate-entity s)
+         (validate-new-entity s)
          prepare-entity-for-save
          (create-entity s)
          prepare-entity-for-return)))
@@ -70,5 +79,5 @@
   [storage-spec entity]
   (-> storage-spec
       storage
-      (validate-entity entity)
+      (validate-existing-entity entity)
       (update-entity entity)))


Never set new tabstop over the edge of the screen

--- src/cljs/asciinema_player/vt.cljs
+++ src/cljs/asciinema_player/vt.cljs
@@ -237,8 +237,8 @@
 (defn execute-nel [vt]
   (-> vt move-cursor-down execute-cr))

-(defn execute-hts [{{x :x} :cursor :as vt}]
-  (if (pos? x)
+(defn execute-hts [{{:keys [x]} :cursor :keys [width] :as vt}]
+  (if (< 0 x width)
     (update-in vt [:tabs] conj x)
     vt))

@@ -442,10 +442,10 @@
                                      (drop (+ x n) line)
                                      (repeat n (empty-cell char-attrs))))))))

-(defn execute-ctc [{{:keys [x]} :cursor :as vt}]
+(defn execute-ctc [{{:keys [x]} :cursor :keys [width] :as vt}]
   (let [n (get-param vt 0 0)]
     (condp = n
-      0 (update-in vt [:tabs] conj x)
+      0 (if (< 0 x width) (update-in vt [:tabs] conj x) vt)
       2 (update-in vt [:tabs] disj x)
       5 (update-in vt [:tabs] empty)
       vt)))


CMR-563: Removed extra whitespace.

CMR-563: Removed extra whitespace.

--- src/cmr/umm/echo10/collection.clj
+++ src/cmr/umm/echo10/collection.clj
@@ -125,6 +125,3 @@
   "Validates the XML against the ECHO10 schema."
   [xml]
   (v/validate-xml (io/resource "schema/echo10/Collection.xsd") xml))
-
-
-


add browser tools icons

add browser tools icons


Add query parameter of email that isn't found

--- src/cylon/user/reset_password.clj
+++ src/cylon/user/reset_password.clj
@@ -68,8 +68,9 @@
                    renderer req {:email email}))
                  (respond-with-new-session! session-store req {})))

-              ;; TODO Add email-failed? as query parameter
-              (redirect (path-for @*router ::request-reset-password-form)))))
+              (redirect (format "%s?unknown-email=%s"
+                                (path-for @*router ::request-reset-password-form)
+                                email)))))
         wrap-schema-validation
         (tag ::process-reset-password-request)
         )}


Tidy up, add an html? predicate

Tidy up, add an html? predicate

--- src/doctopus/files/predicates.clj
+++ src/doctopus/files/predicates.clj
@@ -3,8 +3,13 @@

   Like, a lot.")

+;; ### The `is-type' Multimethod
+;; Dispatches on the type of an object which represents a file; returns a string
+;; representation of the fully qualified path of that file, suitable for
+;; regexing
+
 (defmulti is-type?
-  "Returns true if the type of the file matches the type given."
+  "Returns true if the type of the file matches the type regex provided."
   (fn [fobj regex] (class fobj)))

 (defmethod is-type? java.lang.String
@@ -17,16 +22,18 @@
   [file-handle type-regex]
   (is-type? (.getPath file-handle) type-regex))

+;; ### File Predicates
+;; Used for checking that an object representing a file -- whether it's a String
+;; or a java.io.File -- has a particular extension

 (defn markdown?
-  "returns true only for type files."
   [file-handle]
-  (is-type? file-handle #"(?i)md|markdown|mdown$"
-            ))
-
+  (is-type? file-handle #"(?i)md|markdown|mdown$"))

 (defn restructured-text?
-  "returns true only for type files."
   [file-handle]
-  (is-type? #"(?i)rst|rest$" (.getPath file-handle)
-            ))
+  (is-type? file-handle #"(?i)rst|rest$"))
+
+(defn html?
+  [file-handle]
+  (is-type? file-handle #"(?i)html$"))


move (and (get-in word '(:a)) (get-in word '(:b))) down below


Remove commented code.

Remove commented code.

--- src/dsbdp/data_processing_dsl.clj
+++ src/dsbdp/data_processing_dsl.clj
@@ -47,12 +47,6 @@
         [] data-processing-definition))))

 (declare create-let-expression)
-
-(defn- create-cond-expression
-  [input rules body-creation-fn output nesting-level]
-  (
-    )
-  )

 (defn- create-bindings-vector
   [input rules body-creation-fn output nesting-level]
@@ -162,7 +156,9 @@
                                                   `(assoc
                                                      ~(name (first rule))
                                                      ~(reverse (into '() (create-let-body-vec-clj-map-out (second rule) nil (inc nesting-level)))))))
-        :default (println "Clj Map Body: unknown element for rule:" (str rule))))
+        :default (do (println "Clj Map Body: unknown element for rule:" (str rule))
+                     (throw (RuntimeException. "Clj Map Body: unknown element for rule"))
+                     )))
     (if (nil? output)
       '[-> {}]
       '[-> output])


validation mapping

validation mapping

--- src/celestial/persistency/systems.clj
+++ src/celestial/persistency/systems.clj
@@ -23,6 +23,7 @@
     [celestial.common :refer (import-logging)]
     [physical.validations :as ph]
     [proxmox.validations :as pv]
+    [openstack.validations :as ov]
     [docker.validations :as dv]
     [aws.validations :as av]
     [vc.validations :as vc]
@@ -113,6 +114,7 @@
   (get-in (get-system id) [:machine :ip]))

 (def hyp-to-v {
+   :openstack ov/validate-entity
    :physical ph/validate-entity
    :proxmox pv/validate-entity
    :docker dv/validate-entity


Show s-attributes that are required for speech corpora

--- src/clj/cglossa/search/cwb/speech.clj
+++ src/clj/cglossa/search/cwb/speech.clj
@@ -7,17 +7,21 @@
             [cglossa.search.cwb.shared :refer [cwb-query-name cwb-corpus-name
                                                construct-query-commands run-cqp-commands]]))

+;; TODO: Fetch these from the definition of the tag set for the tagger that is being used
+(def ^:private display-attrs [:lemma :phon :pos :gender :num :type :defn
+                              :temp :pers :case :degr :descr :nlex :mood :voice])
+
 (defmethod run-queries :cwb_speech [corpus search queries]
   (let [search-id   (db/stringify-rid search)
         named-query (cwb-query-name corpus search-id)
         commands    [(str "set DataDirectory \"" (fs/tmpdir) \")
                      (cwb-corpus-name corpus queries)
-                     (str "set Context 7 s")
                      (construct-query-commands corpus queries named-query search-id 100
                                                :s-tag "sync_time")
+                     (str "set Context 7 sync_time")
                      "set LD \"{{\""
                      "set RD \"}}\""
-                     "show +sync_time"
+                     "show +sync_time +sync_end +who_name +who_line_key"
                      "cat Last"]]
     (run-cqp-commands (flatten commands))))


compution threadpool

compution threadpool

--- src/clj/morpheus/computation/base.clj
+++ src/clj/morpheus/computation/base.clj
@@ -1,5 +1,6 @@
 (ns morpheus.computation.base
-  (:require [cluster-connector.distributed-store.synced-atom :as da]))
+  (:require [cluster-connector.distributed-store.synced-atom :as da]
+            [com.climate.claypoole :as cp]))

 (da/defatom tasks {})

@@ -10,4 +11,6 @@
   (da/swap tasks dissoc id))

 (defn get-task [id]
-  (get @tasks id))+  (get @tasks id))
+
+(def compution-threadpool (cp/threadpool (cp/ncpus)))


correct default page value

correct default page value

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -365,7 +365,7 @@
                                           options )
          parsed-options (if (s/valid? ::select-options coerced-options)
                           coerced-options
-                          {:page 0
+                          {:page 1
                            :per-page 10})]
      (with-storage [s storage-spec]
        (->>


Fix for popover component layout (width, height needs to be max and size to "0 0 auto").

--- src/cljs/cljs_browser_repl/views.cljs
+++ src/cljs/cljs_browser_repl/views.cljs
@@ -169,7 +169,7 @@
   "Builds a table for the provided signatures of a symbol."
   [signatures]
   [v-box
-   :size "none"
+   :size "0 0 auto"
    :gap "2px"
    :children [(for [s signatures]
                 [label
@@ -221,25 +221,26 @@
      :showing? showing?
      :position @popover-position
      :on-cancel (handler-fn (reset! showing? false))
-     :width (str popover-width)
-     :height (str popover-height)
+     :style {:max-height (str popover-height)
+             :max-width (str popover-width)}
      :backdrop-opacity 0.1
      :close-button? false
      :title name
      :body [(fn []
               [scroller
-               :height (str (- popover-height 50))
-               :v-scroll :on
-               :h-scroll :off
+               :size "1 1 auto"
+               :max-width (str popover-width)
+               :max-height (str (- popover-height 50))
+               :scroll :auto
                :child [v-box
-                       :size "none"
-                       :gap "4px"
+                       :size "1 1 auto"
+                       :gap "8px"
                        :width (str popover-content-width)
                        :children [(when (not-empty sign)
                                     [build-signatures-ui sign])
                                   (when (not-empty desc)
                                     [v-box
-                                     :size "0 1 auto"
+                                     :size "0 0 auto"
                                      :gap "4px"
                                      :children [[label :label (map hickory/as-hiccup (hickory/parse-fragment desc))]]]
                                     ;; we can use `dangerouslySetInnerHTML` or construct the edn from
@@ -249,7 +250,7 @@
                                     )
                                   (when (not-empty related)
                                     [v-box
-                                     :size "0 1 auto"
+                                     :size "0 0 auto"
                                      :gap "4px"
                                      :children [[title
                                                  :label "Related"
@@ -299,7 +300,8 @@
        :popover [symbol-popover showing? popover-position symbol]])
     [button
      :label (str symbol)
-     :class "btn-default"]))
+     :class "btn-default"
+     :disabled? true]))

 (defn build-section-ui
   "Builds the UI for a section."
@@ -316,6 +318,7 @@
                :gap "10px"
                :children [[v-box
                            :size "1 0 auto"
+                           :gap "2px"
                            :children (for [topic (:topics section)]
                                        [title
                                         :label (:title topic)
@@ -323,6 +326,7 @@
                                         :class "api-panel-topic"])]
                           [v-box
                            :size "1 1 auto"
+                           :gap "2px"
                            :children [(for [topic (:topics section)]
                                         [h-box
                                          :size "none"


Unit tests for planck.io/fstat

Unit tests for planck.io/fstat

--- planck-cljs/test/planck/io_test.cljs
+++ planck-cljs/test/planck/io_test.cljs
@@ -2,6 +2,25 @@
   (:require [cljs.test :refer-macros [deftest testing is]]
             [planck.io]))

-(deftest a-test
-  (testing "Stub passing test"
-    (is (= 0 0))))
+(deftest fstat-test
+  (testing "fstat"
+    (is (nil? (planck.io/fstat nil)))
+    (is (nil? (planck.io/fstat "bogus")))
+    (is (map? (planck.io/fstat "/tmp")))
+    (is (keyword-identical? :symboliclink (:type (planck.io/fstat "/tmp"))))
+    (is (keyword-identical? :symboliclink (:type (planck.io/fstat (planck.io/file "/tmp")))))
+    (is (number? (:referencecount (planck.io/fstat "/tmp"))))
+    (is (number? (:permissions (planck.io/fstat "/tmp"))))
+    (is (number? (:filenumber (planck.io/fstat "/tmp"))))
+    (is (number? (:uid (planck.io/fstat "/tmp"))))
+    (is (number? (:gid (planck.io/fstat "/tmp"))))
+    (is (string? (:uname (planck.io/fstat "/tmp"))))
+    (is (string? (:gname (planck.io/fstat "/tmp"))))
+    (is (= js/Date (type (:created (planck.io/fstat "/tmp")))))
+    (is (= js/Date (type (:modified (planck.io/fstat "/tmp")))))
+    (is (number? (:creatorcode (planck.io/fstat "/tmp"))))
+    (is (number? (:typecode (planck.io/fstat "/tmp"))))
+    (is (number? (:filesize (planck.io/fstat "/tmp"))))
+    (let [extension-hidden (:extensionhidden (planck.io/fstat "/tmp"))]
+      (is (or (true? extension-hidden)
+              (false? extension-hidden))))))


Refresh pods only if clj or cljc files are changed

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -179,6 +179,20 @@
 (def ^:private +render-defaults+
   {:out-dir "public"})

+(defn- wrap-pool [pool]
+  (let [prev (atom nil)]
+    (fn [fileset]
+      ; Do not refresh on the first run
+      (let [pod (if (and @prev
+                         (seq (->> fileset
+                                   (boot/fileset-diff @prev)
+                                   boot/input-files
+                                   (boot/by-ext ["clj" "cljc"]))))
+                  (pool :refresh)
+                  (pool))]
+        (reset! prev fileset)
+        pod))))
+
 (defn- render-in-pod [pod sym file]
   {:pre [(symbol? sym) (namespace sym)]}
   (pod/with-eval-in pod
@@ -189,11 +203,11 @@
   "Render pages"
   [o out-dir  OUTDIR   str  "The output directory"
    r renderer RENDERER sym  "Page renderer. Must be fully qualified symbol which resolves to a function."]
-  (let [pods    (pod/pod-pool (boot/get-env))
+  (let [pods    (wrap-pool (pod/pod-pool (boot/get-env)))
         tmp     (boot/tmp-dir!)
         options (merge +render-defaults+ *opts*)]
     (boot/with-pre-wrap fileset
-      (let [pod   (pods :refresh)
+      (let [pod   (pods fileset)
             files (vals (get-perun-meta fileset))]
         (doseq [file files]
           (let [html          (render-in-pod pod renderer file)
@@ -219,11 +233,11 @@
    s sortby     SORTBY     code "Sort by function"
    c comparator COMPARATOR code "Sort by comparator function"
    p page       PAGE       str  "Collection result page path"]
-  (let [pods      (pod/pod-pool (boot/get-env))
+  (let [pods      (wrap-pool (pod/pod-pool (boot/get-env)))
         tmp       (boot/tmp-dir!)
         options   (merge +collection-defaults+ *opts*)]
     (boot/with-pre-wrap fileset
-      (let [pod            (pods :refresh)
+      (let [pod            (pods fileset)
             files          (vals (get-perun-meta fileset))
             filtered-files (filter (:filterer options) files)
             sorted-files   (vec (sort-by (:sortby options) (:comparator options) filtered-files))


Mix into a common node to make working with partials easier.

--- src/klangmeister/instruments.cljs
+++ src/klangmeister/instruments.cljs
@@ -49,23 +49,26 @@
 (defn destination [at context]
   (.-destination context))

-(defn blend [nodes]
+(defn blend [& nodes]
   (fn [at context]
-    (doseq [node nodes]
-      (node at context))))
+    (let [sink (volume 1.0)]
+      (doseq [node nodes]
+        (connect node sink)
+        (node at context))
+      sink)))

 (defn bell! [{:keys [time duration pitch]}]
   (let [harmonic (fn [n proportion]
                    (>>> (sin-osc (* n pitch) 1.5)
                         (percuss 0.01 proportion)
                         (volume 0.01)
-                        destination))]
-    (->>
-      (map
-        harmonic
-        [1.0 2.0 3.0 4.1 5.2]
-        [1.0 0.6 0.4 0.3 0.2])
-      blend)))
+                        destination))
+        mixture (->> (map
+                  harmonic
+                  [1.0 2.0 3.0 4.1 5.2]
+                  [1.0 0.6 0.4 0.3 0.2])
+                     (apply blend))]
+    mixture))

 (defn fuzz! [{:keys [duration pitch]}]
   (>>> (saw pitch 1.5)


fix test for bots having corresponding user-id

--- test/chat/test/server/db.clj
+++ test/chat/test/server/db.clj
@@ -517,7 +517,7 @@
                             :webhook-url ""
                             :group-id (g2 :id)})
         bot->display (fn [b] (-> b
-                                 (select-keys [:id :name :avatar])
+                                 (select-keys [:id :name :avatar :user-id])
                                  (rename-keys {:name :nickname})))]

     (is (schema/check-bot! b1))


Split tests into clj/cljs tests

Split tests into clj/cljs tests

CLJ alpha19 and before can't even parse the new ## syntax, so
just use the platform-specific literals

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -1826,20 +1826,38 @@
                 (until-unsuccessful #(s/explain-str (s/coll-of (s/fspec :args (s/cat :x int?) :ret int?))
                                                     [[]]))))))))

-(deftest form-containing-incomparables
-  (checking
-   "for any value including NaN, or Infinity, expound returns a string"
-   30
-   [form (gen/frequency
-          [[1 (gen/elements
-               [##NaN
-                ##Inf
-                ##-Inf
-                '(##NaN ##Inf ##-Inf)
-                [##NaN ##Inf ##-Inf]
-                {##NaN ##NaN
-                 ##Inf ##Inf
-                 ##-Inf ##-Inf}])]
-           [5 gen/any-printable]])]
-   (prn {:form form })
-   (is (string? (expound/expound-str (constantly false) form)))))
+#?(:clj
+   (deftest form-containing-incomparables
+     (checking
+      "for any value including NaN, or Infinity, expound returns a string"
+      30
+      [form (gen/frequency
+             [[1 (gen/elements
+                  [Double/NaN
+                   Double/POSITIVE_INFINITY
+                   Double/NEGATIVE_INFINITY
+                   '(Double/NaN Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
+                   [Double/NaN Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY]
+                   {Double/NaN Double/NaN
+                    Double/POSITIVE_INFINITY Double/POSITIVE_INFINITY
+                    Double/NEGATIVE_INFINITY Double/NEGATIVE_INFINITY}])]
+              [5 gen/any-printable]])]
+      (is (string? (expound/expound-str (constantly false) form))))))
+
+#?(:cljs
+   (deftest form-containing-incomparables
+     (checking
+      "for any value including NaN, or Infinity, expound returns a string"
+      30
+      [form (gen/frequency
+             [[1 (gen/elements
+                  [js/NaN
+                   js/Infinity
+                   js/-Infinity
+                   '(js/NaN js/Infinity js/-Infinity)
+                   [js/NaN js/Infinity js/-Infinity]
+                   {js/NaN js/NaN
+                    js/Infinity js/Infinity
+                    js/-Infinity js/-Infinity}])]
+              [5 gen/any-printable]])]
+      (is (string? (expound/expound-str (constantly false) form))))))


Fix missing paren in test

Fix missing paren in test

--- test/minijava/test_munch.clj
+++ test/minijava/test_munch.clj
@@ -10,4 +10,4 @@

 				 (is (= (select tree)
            '(Movl (MEMORY t1 (CONST 2))t2))
-				))
+				)))


Allow hints to be objects as well as maps

--- src/lt/plugins/auto_complete.cljs
+++ src/lt/plugins/auto_complete.cljs
@@ -131,16 +131,21 @@
     (w this {:string (editor/->val this)
              :pattern (.-source (get-pattern this))})))

+(defn completion [x]
+  (:completion x (.-completion x)))
+
+
+
 (defn text|completion [x]
-  (:text x (:completion x)))
+  (:text x (completion x)))

 (defn text+completion [x]
-  (str (:text x) (:completion x)))
+  (str (:text x) (completion x)))

 (def hinter (-> (scmd/filter-list {:items (fn []
                                         (when-let [cur (pool/last-active)]
                                           (if (:starting-token @hinter)
-                                            (remove #(= (-> @hinter :starting-token :string) (:completion %))
+                                            (remove #(= (-> @hinter :starting-token :string) (completion %))
                                                     (object/raise-reduce cur :hints+ []))
                                             (object/raise-reduce cur :hints+ []))))
                                :key text|completion})
@@ -183,7 +188,7 @@
                                 (object/merge! this {:active false})
                                 (if (:select c)
                                   ((:select c) (partial editor/replace (:ed @this) start end) c)
-                                  (editor/replace (:ed @this) start end (:completion c)))
+                                  (editor/replace (:ed @this) start end (completion c)))
                                 (object/raise this :escape!))))

 (object/behavior* ::select-unknown


conj lib name, not vector

conj lib name, not vector

--- src/main/clojure/cljs/closure.clj
+++ src/main/clojure/cljs/closure.clj
@@ -539,7 +539,7 @@
         compiled (-compile uri (merge opts {:output-file js-file}))]
     (cond-> compiled
       (= ["cljs.js"] (deps/-provides compiled))
-      (update-in [:requires] conj ["cljs.core$macros"]))))
+      (update-in [:requires] conj "cljs.core$macros"))))

 (defn cljs-source-for-namespace
   "Given a namespace return the corresponding source with either a .cljs or


oops path not fs

oops path not fs

--- src/main/shadow/cljs/npm/cli.cljs
+++ src/main/shadow/cljs/npm/cli.cljs
@@ -615,7 +615,7 @@
                       server-running?
                       (fs/existsSync server-pid)]

-                  (mkdirp (fs/resolve project-root cache-root))
+                  (mkdirp (path/resolve project-root cache-root))

                   (log "shadow-cljs - config:" config-path "version:" version)


Add debug statement before file removal during rendering

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -532,6 +532,7 @@
       (let [render-paths (render-paths-fn fileset options)
             new-metadata (render-to-paths render-paths (:renderer options) tmp tracer)
             rm-files (keep #(boot/tmp-get fileset (-> % :entry :path)) (vals render-paths))]
+        (perun/report-debug "render-pre-wrap" "removing files" rm-files)
         (-> fileset
             (boot/rm rm-files)
             (commit tmp)


Fixed a timezone bug in the imporation of Divvy station data

--- src/org/gensym/viddy/stations.clj
+++ src/org/gensym/viddy/stations.clj
@@ -1,14 +1,16 @@
 (ns org.gensym.viddy.stations
   (:require [clj-http.client :as client]
             [clojure.data.json :as json]
-            [clj-time.format :as time-format]))
+            [clj-time.format :as time-format]
+            [clj-time.core :as time]))

 (defn- clean-json [json-string]
   (reduce (fn [m [k v]] (assoc m k v)) {}
           (json/read-str json-string)))

 ;; 2013-08-08 11:16:01 PM
-(def time-formatter (time-format/formatter "yyyy-MM-dd hh:mm:ss a"))
+(def time-formatter (time-format/formatter "yyyy-MM-dd hh:mm:ss a"
+                                           (time/default-time-zone)))

 (defn- divvy-string->date [divvy-string]
   (->>  divvy-string


Update test for int-map.

Update test for int-map.

--- test/cavm/sqleval_test.clj
+++ test/cavm/sqleval_test.clj
@@ -4,6 +4,7 @@
   (:require [clojure.test.check :as tc])
   (:require [clojure.test.check.generators :as gen])
   (:require [clojure.test.check.clojure-test :as tcct :refer [defspec]])
+  (:require [clojure.data.int-map :as i])
   (:require [clojure.test.check.properties :as prop]))

 (def ^:dynamic *test-runs* 4000)
@@ -29,7 +30,7 @@
   (ct/testing "eval"
     (let [data {"a" [:a :b :c :d :e :f :g :h]
                 "b" (into [] (range 20 30))}
-          rows (apply sorted-set (range 8))
+          rows (into (i/int-set) (range 8))
           store {:indexed? #{}
                  :fetch (fn [rows-in field]
                           (let [r (or rows-in rows)]


Correct docstring for map-set-workflow->workflow


Remove unused import

Remove unused import

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -1,6 +1,5 @@
 (ns onyx.api
-  (:require [clojure.string :refer [split]]
-            [clojure.core.async :refer [chan >!! <!! close! alts!! timeout go promise-chan]]
+  (:require [clojure.core.async :refer [chan >!! <!! close! alts!! timeout go promise-chan]]
             [com.stuartsierra.component :as component]
             [taoensso.timbre :refer [info warn fatal error]]
             [onyx.log.entry :refer [create-log-entry]]


Re-use path already defined for cljsbuild

--- src/leiningen/new/reagent/project.clj
+++ src/leiningen/new/reagent/project.clj
@@ -34,7 +34,8 @@

   :main {{project-ns}}.server

-  :clean-targets ^{:protect false} ["resources/public/js"]
+  :clean-targets ^{:protect false} [[:cljsbuild :builds :app :compiler :output-dir]
+                                    [:cljsbuild :builds :app :compiler :output-to]]

   :minify-assets
   {:assets


Simpler expression of request handling.

Simpler expression of request handling.

--- src/asid.clj
+++ src/asid.clj
@@ -48,29 +48,30 @@
          (handler wallet)))

   (POST ["/:id/bag", :id aid/grammar] [id key value]
-        (let [wallet (wr/get-wallet repo id)]
-          (if (or (= 0 (count key))
-                  (= 0 (count value)))
-            (-> (response "Either key or value or both not supplied.")
-                (status 400))
-            (-> (wr/save repo (w/add-data wallet key value))
-                ar/resource))))
+        (if (or (= 0 (count key))
+                (= 0 (count value)))
+          (-> (response "Either key or value or both not supplied.")
+              (status 400))
+          (-> (wr/save repo (w/add-data (wr/get-wallet repo id)
+                                        key value))
+              ar/resource)))

   (POST ["/:id/trustpool", :id aid/grammar] [id :as {pool-doc :json-doc}]
-        (let [wallet (wr/get-wallet repo id)
-              name (get pool-doc "name")]
+        (let [name (get pool-doc "name")]
           (if (= 0 (count name))
             (-> (response "A name must be provided.")
                 (status 400))
             (let [challenge-keys (get pool-doc "challenge")
                   pool (tpr/save repo (tp/new-trust-pool name challenge-keys))]
-              (an/connect-nodes wallet pool :trustpool)
+              (an/connect-nodes (wr/get-wallet repo id)
+                                pool
+                                :trustpool)
               (ar/created pool)))))

   (GET "/:walletid/trustpool/:poolid" [walletid poolid]
-       (let [wallet (wr/get-wallet repo walletid)]
-         (-> (tpr/pool-from-wallet wallet poolid)
-             ar/resource)))
+       (-> (wr/get-wallet repo walletid)
+           (tpr/pool-from-wallet poolid)
+           ar/resource))

   (POST "/:walletid/trustpool/:poolid" [walletid poolid :as {calling-card :json-doc}]
         (let [wallet (wr/get-wallet repo walletid)


Remove dead wf legacy navigation code

Remove dead wf legacy navigation code

Remove code used by the navigation controller for the workflow runs page
that is no longer used. The code was originally added to implement
breadcrumbs on the page, and was later found to be unnecessary

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -193,26 +193,6 @@
             %))
         state-utils/reset-dismissed-osx-usage-level
         maybe-add-workflow-response-data))))
-
-(defmethod navigated-to :route/workflow
-  [history-imp
-   navigation-point
-   {:keys [vcs_type org repo] :as args}
-   state]
-  (assoc-in state
-            state/crumbs-path
-            [{:type :dashboard}
-             {:type :org
-              :username org
-              :vcs_type vcs_type}
-             {:type :project
-              :username org
-              :project repo
-              :vcs_type vcs_type}
-             {:type :project-workflows
-              :username org
-              :project repo
-              :vcs_type vcs_type}]))

 (defn initialize-pusher-subscriptions
   "Subscribe to pusher channels for initial messaging. This subscribes


work on bash hash output

work on bash hash output

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -204,10 +204,17 @@
              (str "&" name "\n" (apply str (map f0 (sort nvseq))) "/\n"))]
     (apply str (map f1 (sort m)))))

-;;(defn- fmt-bash [m]
-;; (let [f (fn [[name nvseq]]
-;;            (str "declare -A nml[" name "]\n" (apply str (map (fn [[dataref values]] (str "nml[" name "][" dataref "]=" values "\n")) (sort nvseq)))))]
-;;   (str "declare -A nml\n" (apply str (map f (sort m))))))
+(defn- fmt-bash [m]
+  (let [ms (sort m)
+        f0 (fn [[name nvseq]] (str "declare -A nml_" name "\n"))
+        f1 (fn [[name nvseq]]
+             (apply str
+                    (map (fn [[dataref values]]
+                           (let [v (string/replace values "\"" "\\\"")]
+                             (str "nml_" name "[" dataref "]=\"" v "\"\n")))
+                           (sort nvseq))))]
+    (str (apply str (map f0 ms))
+         (apply str (map f1 ms)))))

 ;; main


New public API fn to better support Java interop.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -300,12 +300,19 @@
 (defn ^{:added "0.6.0"} shutdown-peer
   "Shuts down the virtual peer, which releases all of its resources
    and removes it from the execution of any tasks. This peer will
-   not longer volunteer for tasks."
+   not longer volunteer for tasks. Returns nil."
   [peer]
   (>!! (:shutdown-ch peer) true)
   (<!! (:ack-ch peer))
   (close! (:shutdown-ch peer))
   (close! (:ack-ch peer)))
+
+(defn ^{:added "0.8.1"} shutdown-peers
+  "Like shutdown-peers, but takes a sequence of peers as an argument,
+   shutting each down in order. Returns nil."
+  [peers]
+  (doseq [p peers]
+    (shutdown-peer p)))

 (defn ^{:added "0.6.0"} start-env
   "Starts a development environment using an in-memory implementation ZooKeeper."


validate job on sumbit

validate job on sumbit

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -6,7 +6,8 @@
             [taoensso.timbre :refer [warn]]
             [onyx.coordinator.impl :as impl]
             [onyx.system :as system]
-            [onyx.extensions :as extensions]))
+            [onyx.extensions :as extensions]
+            [onyx.validation :as validator]))

 (defprotocol ISubmit
   "Protocol for sending a job to the coordinator for execution."
@@ -40,30 +41,12 @@
             (do (<!! ch)
                 (recur))))))))

-(defn flatten-workflow [workflow]
-  (concat (keys workflow)
-          (mapcat (fn [v]
-                    (if (map? v)
-                      (flatten-workflow v)
-                      (list v)))
-            (vals workflow))))
-
-
-(defn validate-workflow-names [{:keys [workflow catalog]}]
-  (when-let [missing-names (->> workflow
-                                flatten-workflow
-                                (remove (set (map :onyx/name catalog)))
-                                seq)]
-    (throw (Exception. (str "Catalog is missing :onyx/name values "
-                            "for the following workflow keywords: "
-                            (apply str (interpose ", " missing-names)))))))
-
 ;; A coordinator that runs strictly in memory. Peers communicate with
 ;; the coordinator by directly accessing its channels.
 (deftype InMemoryCoordinator [onyx-coord]
   ISubmit
   (submit-job [this job]
-    (validate-workflow-names job)
+    (validator/validate-job job)
     (let [ch (chan 1)
           node (extensions/create (:sync onyx-coord) :plan)
           cb #(>!! ch (extensions/read-node (:sync onyx-coord) (:path %)))]
@@ -89,7 +72,7 @@
 (deftype HttpCoordinator [conn]
   ISubmit
   (submit-job [this job]
-    (validate-workflow-names job)
+    (validator/validate-job job)
     (let [leader (extensions/leader (:sync conn) :election)
           data (extensions/read-node (:sync conn) leader)
           uri (format "http://%s:%s/submit-job" (:host data) (:port data))


Improve docstring.

Improve docstring.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -215,7 +215,8 @@
        true)))

 (defn ^{:added "0.6.0"} await-job-completion
-  "Blocks until job-id has had all of its tasks completed."
+  "Blocks until job-id has had all of its tasks completed or the job is killed.
+   Returns true if the job completed successfully, false if the job was killed."
   ([peer-config job-id]
      (await-job-completion peer-config job-id {:monitoring :no-op}))
   ([peer-config job-id monitoring-config]


CMR-710: Fixed handling of multiple values within a single science keyword term. Simplified conversion of science keyword params to condition.

--- src/cmr/search/services/parameters/converters/science_keyword.clj
+++ src/cmr/search/services/parameters/converters/science_keyword.clj
@@ -6,34 +6,42 @@
 (def science-keyword-fields
   [:category :topic :term :variable-level-1 :variable-level-2 :variable-level-3 :detailed-variable])

-(defn- science-keyword->elastic-keyword
-  "Returns the elastic keyword for the given science-keyword"
+(defn- sk-field->elastic-keyword
+  "Returns the elastic keyword for the given science-keyword field"
   [science-keyword]
   (keyword (str "science-keywords." (name science-keyword))))
+
+(defn- sk-field+value->string-condition
+  "Converts a science keyword field and value into a string condition"
+  [field value case-sensitive? pattern?]
+  (if (sequential? value)
+    (qm/string-conditions (sk-field->elastic-keyword field) value case-sensitive? pattern? :or)
+    (qm/string-condition (sk-field->elastic-keyword field) value case-sensitive? pattern?)))

 ;; Converts science keywords parameter and values into conditions
 (defmethod p/parameter->condition :science-keywords
   [concept-type param value options]
-  (let [case-sensitive (p/case-sensitive-field? param options)
-        pattern (p/pattern-field? param options)
+  (let [case-sensitive? (p/case-sensitive-field? param options)
+        pattern? (p/pattern-field? param options)
         group-operation (p/group-operation param options :and)]

-    (if (and (> (count value) 1) (map? (first (vals value))))
+    (if (map? (first (vals value)))
+      ;; If multiple science keywords are passed in like the following
+      ;;  -> science_keywords[0][category]=foo&science_keywords[1][category]=bar
+      ;; then this recurses back into this same function to handle each separately
       (qm/group-conds
         group-operation
         (map #(p/parameter->condition concept-type param % options) (vals value)))
-      (if (map? (first (vals value)))
-        (p/parameter->condition concept-type param (first (vals value)) options)
-        (qm/nested-condition
-          :science-keywords
-          (qm/and-conds
-            (map (fn [[pn pv]]
-                   (if (= :any pn)
-                     (qm/or-conds
-                       (map #(qm/string-condition
-                               (science-keyword->elastic-keyword %) pv case-sensitive pattern)
-                            science-keyword-fields))
-                     (qm/string-condition
-                       (science-keyword->elastic-keyword pn) pv case-sensitive pattern)))
-                 value)))))))

+      ;; Creates the science keyword condition for a group of science keyword fields and values.
+      (qm/nested-condition
+        :science-keywords
+        (qm/and-conds
+          (map (fn [[field-name field-value]]
+                 (if (= :any field-name)
+                   (qm/or-conds
+                     (map #(sk-field+value->string-condition % field-value case-sensitive? pattern?)
+                          science-keyword-fields))
+                   (sk-field+value->string-condition field-name field-value case-sensitive? pattern?)))
+               value))))))
+


fixing reported output directory for changed file

fix #493

--- sidecar/src/figwheel_sidecar/build_middleware/notifications.clj
+++ sidecar/src/figwheel_sidecar/build_middleware/notifications.clj
@@ -79,7 +79,7 @@
   "Formats a namespace into a map that is ready to be sent to the client."
   [st nm]
   (let [n (-> nm name utils/underscore)] ;; TODO I don't think this is needed
-    { :file (str (build-api/target-file-for-cljs-ns nm))
+    { :file (str (build-api/target-file-for-cljs-ns nm (:output-dir st)))
       :namespace (cljs.compiler/munge n)
       :type :namespace}))


Don't need to explicitly close channels

Don't need to explicitly close channels

"By default the channel will be closed after the items are copied"
(http://clojuredocs.org/clojure.core.async/onto-chan).

--- core-async-examples/src/cljs/core_async_examples/core.cljs
+++ core-async-examples/src/cljs/core_async_examples/core.cljs
@@ -49,8 +49,7 @@
     (let [ch (chan (dropping-buffer 5))
           _ (onto-chan ch (range 0 10))
           msg (<! (async/into [] ch))]
-      (set-inner-html! "example-two-output" msg)
-      (close! ch))))
+      (set-inner-html! "example-two-output" msg))))

 (defn handle-example-three-button-click
   "Write to and read from to a channel with a sliding buffer."
@@ -59,8 +58,7 @@
     (let [ch (chan (sliding-buffer 5))
           _ (onto-chan ch (range 0 10))
           msg (<! (async/into [] ch))]
-      (set-inner-html! "example-three-output" msg)
-      (close! ch))))
+      (set-inner-html! "example-three-output" msg))))

 (defn set-click-handler
   "Helper function to setting click event handlers."


some refactoring

some refactoring

--- src/cljs/org/broadinstitute/firecloud_ui/page/methods_configs_acl.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/methods_configs_acl.cljs
@@ -43,15 +43,16 @@
       (= access-level reader-level)
       (= access-level owner-level)))

+
+
+
+(defn- validate-user [acl-map]
+  (let [user (:user acl-map)]
+    (not (= "public" user))))
+
+
 (defn- filter-public [acl-vec]
-  (let [hasNotPublicUser
-        (fn [m]
-          (not
-            (and
-              (map? m)
-              (contains? m :user)
-              (= "public" (:user m)))))]
-    (filterv hasNotPublicUser acl-vec)))
+  (filter validate-user acl-vec))

 (defn- make-ui-vec [a-map]
@@ -59,27 +60,20 @@
    :role (get a-map "role")})

 (defn- extract-last-public-access-level [acl-vec]
+
   (let [hasPublicUser
         (fn [m]
-          (and
-            (map? m)
-            (contains? m :user)
-            (= "public" (:user m))))
-        justPublic (filterv hasPublicUser acl-vec)
+          (= "public" (:user m)))
+        justPublic (filter hasPublicUser acl-vec)
         numJustPublic (count justPublic)]
       (if (<= numJustPublic 0)
       ;if public isn't in the acl-return NO ACCESS
       no-access-level
-      (let [lastPublic (get justPublic (- numJustPublic 1))
+      (let [lastPublic (nth justPublic (- numJustPublic 1))
             lastPublicAccessLevel (get lastPublic :role)]
         ;if public is in the acl return the value of the last one
         lastPublicAccessLevel))))

-
-
-(defn- validate-user [acl-map]
-  (let [user (acl-map :user)]
-    (not (= "public" user))))

 (react/defc AgoraPermsEditor


Fix validation for new user form

Fix validation for new user form

--- src/braid/client/gateway/user_auth/views.cljs
+++ src/braid/client/gateway/user_auth/views.cljs
@@ -159,8 +159,8 @@
     (fn [e]
       (.preventDefault e)
       (dispatch [:gateway/submit-form
-                 {:validate-fields [:user-auth.login/email
-                                    :user-auth.login/password]
+                 {:validate-fields [:user-auth.register/email
+                                    :user-auth.register/password]
                   :dispatch-when-valid [:gateway.user/remote-register]}]))}
    [:h1 "Create a Braid Account"]
    [:p "Already have one?"


remove outdated comment

remove outdated comment

--- src/main/shadow/cljs/devtools/api.clj
+++ src/main/shadow/cljs/devtools/api.clj
@@ -451,9 +451,6 @@
            (try
              (let [^Var pvar (find-var 'cider.piggieback/*cljs-compiler-env*)]
                (when (and pvar (thread-bound? pvar))
-                 ;; for reasons I do not understand this set! fails with
-                 ;; java.lang.IllegalStateException: Can't change/establish root binding of: *cljs-compiler-env* with set
-                 ;; although I do check isBound above?
                  (.set pvar
                    (reify
                      clojure.lang.IDeref


Add a couple of type hints

Add a couple of type hints

--- src/clojure/clojurewerkz/cassaforte/query.clj
+++ src/clojure/clojurewerkz/cassaforte/query.clj
@@ -13,7 +13,7 @@
   (:require [clojurewerkz.cassaforte.aliases :as alias]
             [clojure.core.match              :refer [match]]))

-(set! *warn-on-reflection* false)
+(set! *warn-on-reflection* true)

 (def ^:dynamic *batch* false)

@@ -44,7 +44,7 @@

 (let [eq                  (fn [^String column ^Object value]
                             (QueryBuilder/eq column value))
-      in                  (fn [^String column values]
+      in                  (fn [^String column ^java.util.List values]
                             (QueryBuilder/in column values))
       lt                  (fn [^String column ^Object value]
                             (QueryBuilder/lt column value))
@@ -94,8 +94,12 @@
 ;; Select Query
 ;;

-(let [where-clause (fn [query-builder m]
-                     (reduce #(.and %1 %2)
+(defn and-clause
+  [^Select$Where where ^Clause clause]
+  (.and where clause))
+
+(let [where-clause (fn [^Select query-builder m]
+                     (reduce and-clause
                              (.where query-builder)
                              (to-clauses m)))
       order        {:what-count   1


исправление бага при выборе интервала времени - когад два поля ввода запороты, не должно происходить никаких действий

--- radiolamp-6P3S/src/r6p3s/cpt/input_date_interval.cljs
+++ radiolamp-6P3S/src/r6p3s/cpt/input_date_interval.cljs
@@ -45,11 +45,14 @@
               (println "OM: date-paginator -> chan-update -> run! ")

               (when selected-fn
-                (let [app-v             @app
-                      selected-interval [(-> app-v :from-date input/value rc/str-to-date)
-                                         (-> app-v :to-date   input/value rc/str-to-date)]]
-                  (println "OM: date-paginator -> call selected-fn -> " selected-interval)
-                  (selected-fn selected-interval))))))))
+                (let [app-v     @app
+                      from-date (-> app-v :from-date input/value rc/str-to-date)
+                      to-date   (-> app-v :to-date   input/value rc/str-to-date)]
+
+                  (when (and from-date to-date) ;; если оба распознанны как даты то тогда можем говорить что даты выбраны
+                    (let [selected-interval [from-date to-date]]
+                      (println "OM: date-paginator -> call selected-fn -> " selected-interval)
+                      (selected-fn selected-interval))))))))))

     om/IDidMount
     (did-mount [_]


split file up into core/shell/infrastructure

--- src/shoutout.clj
+++ src/shoutout.clj
@@ -2,17 +2,19 @@
   (:require [clojure.string :as s])
   (:import java.util.zip.CRC32))

+;; infrastructure
 (defn crc32 [^String s]
   (let [crc (CRC32.)]
     (.update crc (.getBytes s))
     (.getValue crc)))

-(defrecord Feature [feature-name groups users percentage])
-
 (defn split [raw pattern]
   (if (empty? raw)
     []
     (s/split raw pattern)))
+
+;; functional core
+(defrecord Feature [feature-name groups users percentage])

 (defn parse-percentage [^String raw]
   (if (empty? raw)
@@ -54,6 +56,7 @@
     (is-active-user? feature user)
     (is-active-in-group? feature group-definition user)))

+;; imperative shell
 (defprotocol ShoutoutStorage
   (read-from-storage [storage ^String feature-name])
   (write-to-storage [storage  ^String feature-name ^String serialized]))


Change  to

Change  to

--- src/metabase/models/pulse_channel.clj
+++ src/metabase/models/pulse_channel.clj
@@ -150,22 +150,22 @@
          (contains? #{:first :last :mid :other} monthday)
          (contains? #{:first :last :other} monthweek)]}
   (let [schedule-frame              (cond
-                                      (= :mid monthday)    (name :mid)
-                                      (= :first monthweek) (name :first)
-                                      (= :last monthweek)  (name :last)
+                                      (= :mid monthday)    "mid"
+                                      (= :first monthweek) "first"
+                                      (= :last monthweek)  "last"
                                       :else                "invalid")
         monthly-schedule-day-or-nil (when (= :other monthday)
                                       weekday)]
     (k/select PulseChannel
       (k/fields :id :pulse_id :schedule_type :channel_type)
       (k/where (and (= :enabled true)
-                    (or (= :schedule_type (name :hourly))
-                        (and (= :schedule_type (name :daily))
+                    (or (= :schedule_type "hourly")
+                        (and (= :schedule_type "daily")
                              (= :schedule_hour hour))
-                        (and (= :schedule_type (name :weekly))
+                        (and (= :schedule_type "weekly")
                              (= :schedule_hour hour)
                              (= :schedule_day weekday))
-                        (and (= :schedule_type (name :monthly))
+                        (and (= :schedule_type "monthly")
                              (= :schedule_hour hour)
                              (= :schedule_frame schedule-frame)
                              (or (= :schedule_day weekday)


DM + CM #107 - Fix front end handler for posting answers

--- src/objective8/handlers/front_end.clj
+++ src/objective8/handlers/front_end.clj
@@ -355,10 +355,11 @@
           :else {:status 502}))

       ::fr/invalid
-      (-> (response/redirect (utils/path-for :fe/question
-                                             :id (:id route-params)
-                                             :q-id (:q-id route-params)))
-          (assoc :flash {:validation (dissoc :status answer-data)})))))
+      (-> (response/redirect (str (utils/path-for :fe/question
+                                                  :id (:id route-params)
+                                                  :q-id (:q-id route-params))
+                                  "#add-an-answer"))
+          (assoc :flash {:validation (dissoc answer-data :status)})))))

 ;; WRITERS


(PE-3914) Updated docstring on ssl-context-factory

This commit updates the docstring on `ssl-context-factory` to include
information about the `client-auth` and `crl-path` parameters.

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
@@ -98,7 +98,13 @@

 (schema/defn ^:always-validate
   ssl-context-factory :- SslContextFactory
-  "Creates a new SslContextFactory instance from a map of options."
+  "Creates a new SslContextFactory instance from:
+
+   config      - A map of SSL keystore options.
+   client-auth - SSL client certificate authentication mode.  May be set to
+                 :need, :want or nil.
+   crl-path    - Path to a CRL (Certificate Revocation List) file.  May be
+                 set to nil in order for a CRL to not be used."
   [config :- config/WebserverSslKeystoreConfig
    client-auth :- config/WebserverSslClientAuth
    crl-path :- config/WebserverSslCrlPath]


logging is a middleware

logging is a middleware

--- src/spq/http.clj
+++ src/spq/http.clj
@@ -28,24 +28,14 @@
   [-name args & forms]
   `(defn ~-name
      ~args
-     (let [start# (System/nanoTime)]
-       (-> (let [~args [(-body-to-string (first ~args))]]
-             ~@forms)
-         (try (catch Throwable ex#
-                (timbre/error ex# "handler" '~-name "failed with" (first ~args))
-                (throw ex#)))
-         a/go
-         s/->source
-         s/take!
-         (d/on-realized
-          (fn [rep#] (let [[req#] ~args]
-                       (when (:remote-addr req#)
-                         (timbre/info (or (:status rep#) 500)
-                                      (str/upper-case (name (:request-method req#)))
-                                      (str (:uri req#) "?" (:query-string req#))
-                                      (format "%.2f%s" (/ (double (- (System/nanoTime) start#)) 1000000.0) "ms")
-                                      (:remote-addr req#)))))
-          (fn [rep#] (timbre/error "deferred" '~-name "failed with" (first ~args) rep#)))))))
+     (-> (let [~args [(-body-to-string (first ~args))]]
+           ~@forms)
+       (try (catch Throwable ex#
+              (timbre/error ex# "handler" '~-name "failed with" (first ~args))
+              (throw ex#)))
+       a/go
+       s/->source
+       s/take!)))

 (defmacro defmiddleware
   [name request-form response-form]
@@ -58,7 +48,20 @@
            ;; if :status is defined, assume this is a response and short circuit the normal handler
            (if (:status processed-request#)
              processed-request#
-             (d/chain (handler# processed-request#) #(response-fn# request# %))))))))
+             (d/chain (handler# processed-request#) #(response-fn# processed-request# %))))))))
+
+(defmiddleware logging
+  ([req]
+   (assoc req :start-time (System/nanoTime)))
+  ([req rep]
+   (when (:remote-addr req)
+     (timbre/info
+      (or (:status rep) 500)
+      (str/upper-case (name (:request-method req)))
+      (str (:uri req) "?" (:query-string req))
+      (format "%.2f%s" (/ (double (- (System/nanoTime) (:start-time req))) 1000000.0) "ms")
+      (:remote-addr req)))
+   rep))

 (defn start!
   [router & {:keys [port extra-middleware]}]
@@ -67,5 +70,6 @@
            (apply compojure/routes router)
            (concat extra-middleware
                    [keyword-params/wrap-keyword-params
-                    params/wrap-params]))
+                    params/wrap-params
+                    logging]))
    {:port port}))


CMR-7318: Bumped jetty version (#1221)

CMR-7318: Bumped jetty version (#1221)

* CMR-7318: Bumped jetty version

* CMR-7318: Bumped ring-jetty-adapter version

--- common-lib/project.clj
+++ common-lib/project.clj
@@ -36,17 +36,17 @@
                  [org.clojure/test.check "0.9.0"]
                  [org.clojure/tools.nrepl "0.2.13"]
                  [org.clojure/tools.reader "1.3.2"]
-                 [org.eclipse.jetty/jetty-http "9.4.14.v20181114"]
-                 [org.eclipse.jetty/jetty-io "9.4.14.v20181114"]
-                 [org.eclipse.jetty/jetty-servlets "9.4.14.v20181114"]
-                 [org.eclipse.jetty/jetty-util "9.4.14.v20181114"]
+                 [org.eclipse.jetty/jetty-http "9.4.39.v20210325"]
+                 [org.eclipse.jetty/jetty-io "9.4.39.v20210325"]
+                 [org.eclipse.jetty/jetty-servlets "9.4.39.v20210325"]
+                 [org.eclipse.jetty/jetty-util "9.4.39.v20210325"]
                  ;; load jts core lib first to make sure it is available for shapefile integration,
                  ;; otherwise ES referenced 1.15.0 version will be mistakenly picked for shapefile
                  [org.locationtech.jts/jts-core "1.16.1"]
                  [org.ow2.asm/asm "7.0"]
                  [potemkin "0.4.5"]
-                 [ring/ring-core "1.7.1"]
-                 [ring/ring-jetty-adapter "1.7.1"]
+                 [ring/ring-core "1.9.2"]
+                 [ring/ring-jetty-adapter "1.9.2"]
                  [ring/ring-json "0.4.0"]]
   :repositories [["jitpack.io" "https://jitpack.io"]]
   :plugins [[lein-exec "0.3.7"]


Test 0/1 return value for {:create,:drop}-index queries.

--- test/fleetdb/core_test.clj
+++ test/fleetdb/core_test.clj
@@ -328,8 +328,14 @@
     (assert-set= [:elems :foos] (core/query db1-1 [:list-collections]))))

 (deftest "create-/drop-index"
-  (let [[db1-1 _] (core/query db1   [:create-index :elems [[:name :asc]]])
-        [db1-2 _] (core/query db1-1 [:drop-index   :elems [[:name :asc]]])]
+  (let [[db1-1 r1 ] (core/query db1   [:create-index :elems [[:name :asc]]])
+        [_     r1d] (core/query db1-1 [:create-index :elems [[:name :asc]]])
+        [db1-2 r2 ] (core/query db1-1 [:drop-index   :elems [[:name :asc]]])
+        [_     r2d] (core/query db1-2 [:drop-index   :elems [[:name :asc]]])]
+    (assert= r1  1)
+    (assert= r1d 0)
+    (assert= r2  1)
+    (assert= r2d 0)
     (assert= [[[:name :asc]]] (core/query db1-1 [:list-indexes :elems]))
     (assert-nil (core/query db1-2 [:list-indexes :elems]))))


Improve Code Formatting

Improve Code Formatting

--- test/lens/handler_test.clj
+++ test/lens/handler_test.clj
@@ -32,6 +32,8 @@

 (use-fixtures :each database-fixture)

+;; ---- Subject ---------------------------------------------------------------
+
 (deftest get-subject-handler-test
   (testing "Body contains self link"
     (api/create-subject (connect) "id-181341")
@@ -51,18 +53,21 @@
                :params {}
                :conn (connect)}]
       (is (= 422 (:status ((create-subject-handler nil) req))))))
+
   (testing "Create with invalid sex fails"
     (let [req {:request-method :post
                :params {:id "id-172029"
                         :sex "foo"}
                :conn (connect)}]
       (is (= 422 (:status ((create-subject-handler nil) req))))))
+
   (testing "Create with invalid birth-date fails"
     (let [req {:request-method :post
                :params {:id "id-172029"
                         :birth-date "foo"}
                :conn (connect)}]
       (is (= 422 (:status ((create-subject-handler nil) req))))))
+
   (testing "Create with id only"
     (let [path-for (fn [_ _ id] id)
           req {:request-method :post
@@ -72,6 +77,7 @@
       (is (= 201 (:status resp)))
       (is (= "id-165339" (get-in resp [:headers "Location"])))
       (is (nil? (:body resp)))))
+
   (testing "Create with sex"
     (let [req {:request-method :post
                :params {:id "id-171917"
@@ -81,6 +87,7 @@
       (is (= 201 (:status resp)))
       (is (= :subject.sex/male
              (:subject/sex (api/subject (d/db (connect)) "id-171917"))))))
+
   (testing "Create with birth-date"
     (let [req {:request-method :post
                :params {:id "id-173133"
@@ -90,6 +97,7 @@
       (is (= 201 (:status resp)))
       (is (= (tc/to-date (t/date-time 2015 5 25))
              (:subject/birth-date (api/subject (d/db (connect)) "id-173133"))))))
+
   (testing "Create with existing id fails"
     (api/create-subject (connect) "id-182721")
     (let [req {:request-method :post
@@ -97,6 +105,8 @@
                :conn (connect)}
           resp ((create-subject-handler path-for) req)]
       (is (= 409 (:status resp))))))
+
+;; ---- Study -----------------------------------------------------------------

 (deftest study-handler-test
   (letfn [(study [id] (api/study (d/db (connect)) id))
@@ -251,11 +261,13 @@
                :params {}
                :conn (connect)}]
       (is (= 422 (:status ((create-study-handler nil) req))))))
+
   (testing "Create without name fails"
     (let [req {:request-method :post
                :params {:id "id-224305"}
                :conn (connect)}]
       (is (= 422 (:status ((create-study-handler nil) req))))))
+
   (testing "Create with id and name only"
     (let [path-for (fn [_ _ id] id)
           req {:request-method :post
@@ -265,6 +277,7 @@
       (is (= 201 (:status resp)))
       (is (= "id-224211" (get-in resp [:headers "Location"])))
       (is (nil? (:body resp)))))
+
   (testing "Create with description"
     (let [req {:request-method :post
                :params {:id "id-224401"
@@ -275,6 +288,7 @@
       (is (= 201 (:status resp)))
       (is (= "description-224339"
              (:description (api/study (d/db (connect)) "id-224401"))))))
+
   (testing "Create with existing id fails"
     (api/create-study (connect) "id-224419" "name-224431")
     (let [req {:request-method :post
@@ -282,6 +296,8 @@
                :conn (connect)}
           resp ((create-study-handler path-for) req)]
       (is (= 409 (:status resp))))))
+
+;; ----------------------------------------------------------------------------

 (defn- visit [birth-date edat]
   {:visit/subject {:subject/birth-date (tc/to-date birth-date)}


Modify test to check for missing fx handler

--- test/re-frame/fx_test.cljs
+++ test/re-frame/fx_test.cljs
@@ -4,7 +4,8 @@
     [re-frame.core :as re-frame]
     [re-frame.fx]
     [re-frame.interop :refer [set-timeout!]]
-    [re-frame.loggers :as log]))
+    [re-frame.loggers :as log]
+    [clojure.string :as str]))

 ;; ---- FIXTURES ---------------------------------------------------------------

@@ -16,13 +17,7 @@
     {:before #(reset! restore-re-frame (re-frame.core/make-restore-fn))
      :after  #(@restore-re-frame)}))

-(defn fixture-logger
-  []
-  (let [old-loggers (atom nil)]
-    {:before #(reset! old-loggers @@#'log/loggers)
-     :after  #(reset! @#'log/loggers @old-loggers)}))
-
-(use-fixtures :each (fixture-re-frame) (fixture-logger))
+(use-fixtures :each (fixture-re-frame))

 ;; ---- TESTS ------------------------------------------------------------------

@@ -51,22 +46,19 @@
       ;; kick off main handler
       (re-frame/dispatch [::later-test]))))

+(re-frame/reg-event-fx
+  ::missing-handler-test
+  (fn [_world _event-v]
+    {:fx-not-exist [:nothing :here]}))
+
 (deftest report-missing-handler
-  (let [logs (atom [])
-        log-fn (fn[& args] (swap! logs  #(conj % (clojure.string/join args))))
-        logger (zipmap [:log :warn :error] (repeat log-fn))]
-    (log/set-loggers! logger)
-
-    (re-frame/reg-event-fx
-     ::missing-handler-test
-     (fn[_world _event-v]
-       {:dispatch [:do-not-exist :handler]}))
-
-    (re-frame/dispatch [::missing-handler-test])
-
-    (async done
-           (set-timeout!
-            (fn []
-              (is (re-matches #"re-frame: no :event handler.*:do-not-exist" (first @logs)))
-              (done))
-            2))))
+  (let [logs             (atom [])
+        log-fn           (fn [& args] (swap! logs conj (str/join args)))
+        original-loggers (log/get-loggers)]
+    (try
+      (log/set-loggers! {:error log-fn})
+      (re-frame/dispatch-sync [::missing-handler-test])
+      (is (re-matches #"re-frame: no :fx handler registered for::fx-not-exist" (first @logs)))
+      (is (= (count @logs) 1))
+      (finally
+        (log/set-loggers! original-loggers)))))


CMR-1862 Fixes an intermittent test failure.

The expected conversion for ECHO Distribution/Prices was causing issues
when the string had whitespace before the number.

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
@@ -248,9 +248,10 @@
 (defn- echo10-expected-fees
   "Returns the fees if it is a number string, i.e., can be converted to a decimal, otherwise nil."
   [fees]
-  (when (and fees
-             (try (Double. fees)
-               (catch NumberFormatException e)))))
+  (when fees
+    (try
+      (format "%9.2f" (Double. fees))
+      (catch NumberFormatException e))))

 (defn- echo10-expected-distributions
   "Returns the ECHO10 expected distributions for comparing with the distributions in the UMM-C


Log metrics to timbre properly

Log metrics to timbre properly

--- src/leiningen/new/onyx_app/src/onyx_app/tasks/metrics.clj
+++ src/leiningen/new/onyx_app/src/onyx_app/tasks/metrics.clj
@@ -6,8 +6,8 @@
   ([job task opts]
    (-> job
        (update-in [:lifecycles] conj (merge {:lifecycle/task task ; Or :all for all tasks in the workflow
-                                             :lifecycle/calls :onyx.lifecycle.metrics.metrics/calls
                                              :metrics/buffer-capacity 10000
                                              :metrics/sender-fn :onyx.lifecycle.metrics.timbre/timbre-sender
+                                             :lifecycle/doc "Instruments task metrics to timbre"
                                              :lifecycle/calls :onyx.lifecycle.metrics.metrics/calls}
                                             opts)))))


Rework scrape-trs.core to be user-friendly.

--- project/scrape-trs/src/scrape_trs/core.clj
+++ project/scrape-trs/src/scrape_trs/core.clj
@@ -1,22 +1,35 @@
 (ns scrape-trs.core
-  (:require [scrape-trs.cascade-climbers.core :as cc]
+  (:require [clojure.string :as string]
+            [scrape-trs.cascade-climbers.core :as cc]
             [scrape-trs.summitpost.core :as sp]))

-(defn get-implementation
+(def ^:private implementations
+  {cc/base-url (cc/->CCScrapeTripReport)
+   sp/base-url (sp/->SPScrapeTripReport)})
+
+(defn list-supported-urls
+  "Return a sequence of the base urls of all sites with trip report scrapers."
+  []
+  (keys implementations))
+
+(defn- get-implementation
+  "Given a url whose base is in (list-supported-urls), return an
+  implementation of scrape-trs.protocol/ScrapeTripReport."
   [url]
-  (let [base-url (re-find #"https?://.*?/" url)]
-    (condp = base-url
-      cc/base-url (cc/->CCScrapeTripReport)
-      sp/base-url (sp/->SPScrapeTripReport))))
+  (second (first (filter #(string/starts-with? url (key %)) implementations))))

 (defn get-trip-reports
-  "implementation: type that implements scrape-trs.protocol/ScrapeTripReport
-  list-page: page (as a string) that lists trip reports and corresponds to the given implementation
+  "
+  url: url of list-page or the site it was retrieved from. Must correspond to
+       a supported url in (list-implementation-urls).
+  list-page: page (as a string) that lists trip reports

   Scrape all trip reports from the list-page, paging through pagination if
-  necessary, and return a sequence of scrape-trs.protocol/TripReport instances."
-  [implementation list-page]
-  (let [pager-urls (.extract-pager-urls implementation list-page)
+  necessary, and return a sequence of scrape-trs.protocol/TripReport
+  instances."
+  [url list-page]
+  (let [implementation (get-implementation url)
+        pager-urls (.extract-pager-urls implementation list-page)
         list-pages (if pager-urls (map slurp pager-urls) [list-page])
         trip-report-urls (mapcat #(.extract-trip-report-urls implementation %)
                                  list-pages)


use the goog.global.location.protocol for get-base-url (#775)

--- src/main/shadow/cljs/devtools/client/env.cljs
+++ src/main/shadow/cljs/devtools/client/env.cljs
@@ -40,6 +40,8 @@

 (goog-define use-document-host true)

+(goog-define use-document-protocol true)
+
 (goog-define devtools-url "")

 (goog-define reload-strategy "optimized")
@@ -62,6 +64,13 @@
        :runtime_id runtime-id
        :ssl ssl})

+(defn get-server-protocol []
+  (if (and use-document-protocol
+           js/goog.global.location
+           (seq js/goog.global.location.protocol))
+    (str/replace js/goog.global.location.protocol ":" "")
+    (str "http" (when ssl "s"))))
+
 (defn get-server-host []
   (cond
     (and use-document-host
@@ -78,7 +87,7 @@
 (defn get-url-base []
   (if (seq devtools-url)
     devtools-url
-    (str "http" (when ssl "s") "://" (get-server-host) ":" server-port)))
+    (str (get-server-protocol) "://" (get-server-host) ":" server-port)))

 (defn get-ws-url-base []
   (-> (get-url-base)


Updated writeResults function to write elements of timeCourseVector to a file individually. Updated output to the terminal

--- src/research_clojure/eChild/runSimulation.clj
+++ src/research_clojure/eChild/runSimulation.clj
@@ -10,8 +10,11 @@
 (defn writeResults
   "Writes the results of doesChildLearnGrammar? to output file"
   [lines]
-  (with-open [out-file (io/writer "out.csv" :append true)]
-            (csv/write-csv out-file [[(get lines 0) (get lines 1) (get lines 2)]])))
+  (let [parameterList (get lines 2)
+        convergedList (get lines 3)]
+
+      (with-open [out-file (io/writer "out.csv" :append true)]
+            (csv/write-csv out-file [[(get lines 0) (get lines 1) (get parameterList 0) (get convergedList 0) (get parameterList 1) (get convergedList 1) (get parameterList 2) (get convergedList 2) (get parameterList 3) (get convergedList 3) (get parameterList 4) (get convergedList 4) (get parameterList 5) (get convergedList 5) (get parameterList 6) (get convergedList 6) (get parameterList 7) (get convergedList 7) (get parameterList 8) (get convergedList 8) (get parameterList 9) (get convergedList 9) (get parameterList 10) (get convergedList 10) (get parameterList 11) (get convergedList 11) (get parameterList 12) (get convergedList 12)]]))))

 (defn updateTimeCourseVector
@@ -52,7 +55,7 @@
           (swap! sentenceCount inc))

         (println "Final grammar: " @grammar)
-        (writeResults [@grammar @grammarLearned @timeCourseVector])))
+        (writeResults [@grammar @grammarLearned (get @timeCourseVector 0) (get @timeCourseVector 1)])))

 (defn runSimulation
@@ -63,7 +66,7 @@

   (let [counter (atom 0)]
     (while (< @counter max_eChildren)
-      (println "eChild #" @counter)
+      (println "eChild #" (+ @counter 1))
       (doesChildLearnGrammar? sentences max_sentences)
       (swap! counter inc))))


Enable long tap on long messages

Enable long tap on long messages

Allows to copy and share text

--- src/status_im/chat/views/message/message.cljs
+++ src/status_im/chat/views/message/message.cljs
@@ -208,8 +208,7 @@
      [react/view
       [react/text {:style           (style/text-message message collapsible?)
                    :number-of-lines (when collapsible? number-of-lines)
-                   :ref             (partial reset! ref)
-                   :on-press        on-press}
+                   :ref             (partial reset! ref)}
        parsed-text
        [react/text {:style (style/message-timestamp-placeholder-text outgoing)} (timestamp-with-padding timestamp-str)]]
       (when collapsible?


STORM-205. Add REST API to Storm UI. added complete-latencies to the topology-stats

--- storm-core/src/clj/backtype/storm/ui/core.clj
+++ storm-core/src/clj/backtype/storm/ui/core.clj
@@ -284,8 +284,8 @@
     (merge-with
      (fn [s1 s2]
        (merge-with + s1 s2))
-     (select-keys agg-bolt-stats [:emitted :transferred :acked :failed])
-     (select-keys agg-spout-stats [:emitted :transferred :acked :failed])
+     (select-keys agg-bolt-stats [:emitted :transferred :acked :failed :complete-latencies])
+     (select-keys agg-spout-stats [:emitted :transferred :acked :failed :complete-latencies])
      )))

 (defn stats-times [stats-map]


Follow change in ws api

Follow change in ws api

--- src/airhead_cljs/requests.cljs
+++ src/airhead_cljs/requests.cljs
@@ -61,7 +61,7 @@

 (go
   (let [host js/window.location.host
-        ws-path (str "ws://" host "/ws")
+        ws-path (str "ws://" host "/api/ws")
         {:keys [ws-channel]} (<! (ws-ch ws-path {:format :json-kw}))]
     (loop []
       (let [{:keys [message]} (<! ws-channel)]


also update 'between _ and _' rule

also update 'between _ and _' rule

--- resources/languages/en/rules/time.clj
+++ resources/languages/en/rules/time.clj
@@ -604,17 +604,9 @@
   [#"(?i)between" {:form :time-of-day} #"and" {:form :time-of-day}]
   (interval %2 %4 true)

-  "between <time-of-day-latent> and <time-of-day-latent> (interval) am|pm"
-  [#"(?i)between" #(and (= :time-of-day (:form %)) (:latent %)) #"and" #(and (= :time-of-day (:form %)) (:latent %)) #"(?i)([ap])\.?m?\.?"]
-  (let [[p meridiem] (if (= "a" (-> %5 :groups first clojure.string/lower-case))
-                       [[(hour 0) (hour 12) false] :am]
-                       [[(hour 12) (hour 0) false] :pm])]
-    (interval
-      (-> (intersect %2 (apply interval p))
-        (assoc :form :time-of-day))
-      (-> (intersect %4 (apply interval p))
-        (assoc :form :time-of-day))
-      true))
+  "between <time-of-day-latent> and <time-of-day-ampm> (interval)"
+  [#"(?i)between" #(and (= :time-of-day (:form %)) (:latent %)) #"and" #(and (= :time-of-day (:form %)) (:ampm %))]
+  (interval (pred-nth-after %2 %4 -1) %4 true)

   ; Specific for within duration... Would need to be reworked
   "within <duration>"


figwheel.repl: allow setting the log-level of the Jetty Server

--- figwheel-repl/src/figwheel/server/jetty_websocket.clj
+++ figwheel-repl/src/figwheel/server/jetty_websocket.clj
@@ -16,7 +16,9 @@
     HandlerList]
    [org.eclipse.jetty.websocket.servlet
     WebSocketServletFactory WebSocketCreator
-    ServletUpgradeRequest ServletUpgradeResponse]))
+    ServletUpgradeRequest ServletUpgradeResponse]
+   [org.eclipse.jetty.util.log Log StdErrLog]
+   ))

 ;; ------------------------------------------------------
 ;; Jetty 9 Websockets
@@ -76,6 +78,17 @@
           (proxy-super handle target request req res))))))

+(defn set-log-level! [log-lvl]
+  (let [level (or ({:all     StdErrLog/LEVEL_ALL
+                    :debug   StdErrLog/LEVEL_DEBUG
+                    :info    StdErrLog/LEVEL_INFO
+                    :off     StdErrLog/LEVEL_OFF
+                    :warn    StdErrLog/LEVEL_WARN } log-lvl)
+                  StdErrLog/LEVEL_WARN)]
+    (doto (Log/getRootLogger)
+      (.setLevel level))
+    (doseq [[k v] (Log/getLoggers)]
+      (.setLevel v level))))

 (defn async-websocket-configurator [{:keys [websockets async-handlers]}]
   (fn [server]
@@ -104,16 +117,22 @@
                                    ws-proxy-handlers
                                    async-proxy-handlers
                                    [existing-handler]))))]
-      (.setHandler server contexts))))
-
-(defn run-jetty [handler {:keys [websockets async-handlers] :as options}]
+      (.setHandler server contexts)
+      server)))
+
+(defn run-jetty [handler {:keys [websockets async-handlers log-level] :as options}]
   (jt/run-jetty
    handler
-   (cond-> options
-     (or (not-empty websockets) (not-empty async-handlers))
-     (assoc :configurator (async-websocket-configurator
-                           (select-keys options
-                                        [:websockets :async-handlers]))))))
+   (if (or (not-empty websockets) (not-empty async-handlers))
+     (assoc options :configurator
+            (fn [server]
+              (set-log-level! log-level)
+              ((async-websocket-configurator
+                (select-keys options [:websockets :async-handlers])) server)))
+     (assoc options
+            :configurator
+            (fn [server]
+              (set-log-level! log-level))))))

 ;; Figwheel REPL adapter

@@ -171,6 +190,8 @@
   (defonce scratch (atom {}))
   (-> @scratch :adaptor (.. getSession getUpgradeRequest) build-request-map)
   )
+
+

 #_(def server (run-jetty
                (fn [ring-request]


Added explicit System.exit() call since lein run tends to hang for a while.

--- src/validation_benchmark/core.clj
+++ src/validation_benchmark/core.clj
@@ -127,4 +127,5 @@
               bench-fn (benchmark-fns (:mode options))
               results (run-benchmarks benchmarks bench-fn)]
           (save-results results results-path)
-          (final-summary groups results chart-path))))))
+          (final-summary groups results chart-path))))
+    (System/exit 0)))


add bic

add bic


Rewrite to be more idiomatic

Rewrite to be more idiomatic


test fix

test fix

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -857,7 +857,7 @@
   (with-temp-db [db (dataset-loader) defs/sad-toucan-incidents]
     (driver/process-query {:database (:id db)
                            :type     "query"
-                           :query    {:source_table (:id &events)
+                           :query    {:source_table (:id &incidents)
                                       :aggregation  ["count"]
-                                      :breakout     [(:id &events.timestamp)]
+                                      :breakout     [(:id &incidents.timestamp)]
                                       :limit        10}})))


fix up unit tests for query processor to account for adding `:preview_display` as part of the column metadata returned.

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -50,9 +50,9 @@
   [col]
   (case col
     :id   {:extra_info {} :target nil :special_type :id, :base_type (id-field-type), :description nil,
-           :name (format-name "id") :display_name "Id" :table_id (id :categories), :id (id :categories :id)}
+           :name (format-name "id") :display_name "Id" :preview_display true :table_id (id :categories), :id (id :categories :id)}
     :name {:extra_info {} :target nil :special_type :name, :base_type :TextField, :description nil,
-           :name (format-name "name") :display_name "Name" :table_id (id :categories), :id (id :categories :name)}))
+           :name (format-name "name") :display_name "Name" :preview_display true :table_id (id :categories), :id (id :categories :name)}))

 ;; #### users
 (defn- users-col
@@ -66,6 +66,7 @@
                  :description  nil
                  :name         (format-name "id")
                  :display_name "Id"
+                 :preview_display true
                  :table_id     (id :users)
                  :id           (id :users :id)}
     :name       {:extra_info   {}
@@ -75,6 +76,7 @@
                  :description  nil
                  :name         (format-name "name")
                  :display_name "Name"
+                 :preview_display true
                  :table_id     (id :users)
                  :id           (id :users :name)}
     :last_login {:extra_info   {}
@@ -84,6 +86,7 @@
                  :description  nil
                  :name         (format-name "last_login")
                  :display_name "Last Login"
+                 :preview_display true
                  :table_id     (id :users)
                  :id           (id :users :last_login)}))

@@ -104,6 +107,7 @@
                   :description  nil
                   :name         (format-name "id")
                   :display_name "Id"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :id)}
     :category_id {:extra_info   (if (fks-supported?) {:target_table_id (id :categories)}
@@ -117,6 +121,7 @@
                   :description  nil
                   :name         (format-name "category_id")
                   :display_name "Category Id"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :category_id)}
     :price       {:extra_info   {}
@@ -126,6 +131,7 @@
                   :description  nil
                   :name         (format-name "price")
                   :display_name "Price"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :price)}
     :longitude   {:extra_info   {}
@@ -135,6 +141,7 @@
                   :description  nil
                   :name         (format-name "longitude")
                   :display_name "Longitude"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :longitude)}
     :latitude    {:extra_info   {}
@@ -144,6 +151,7 @@
                   :description  nil
                   :name         (format-name "latitude")
                   :display_name "Latitude"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :latitude)}
     :name        {:extra_info   {}
@@ -153,6 +161,7 @@
                   :description  nil
                   :name         (format-name "name")
                   :display_name "Name"
+                  :preview_display true
                   :table_id     (id :venues)
                   :id           (id :venues :name)}))

@@ -173,6 +182,7 @@
                :description  nil
                :name         (format-name "id")
                :display_name "Id"
+               :preview_display true
                :table_id     (id :checkins)
                :id           (id :checkins :id)}
     :venue_id {:extra_info   (if (fks-supported?) {:target_table_id (id :venues)}
@@ -186,6 +196,7 @@
                :description  nil
                :name         (format-name "venue_id")
                :display_name "Venue Id"
+               :preview_display true
                :table_id     (id :checkins)
                :id           (id :checkins :venue_id)}
     :user_id  {:extra_info   (if (fks-supported?) {:target_table_id (id :users)}
@@ -199,6 +210,7 @@
                :description  nil
                :name         (format-name "user_id")
                :display_name "User Id"
+               :preview_display true
                :table_id     (id :checkins)
                :id           (id :checkins :user_id)}))

@@ -689,15 +701,21 @@
      order ag.0-))

-;;; ### make sure that rows where preview_display = false don't get displayed
+;;; ### make sure that rows where preview_display = false are included and properly marked up
 (datasets/expect-with-all-datasets
- [(set (->columns "category_id" "name" "latitude" "id" "longitude" "price"))
-  (set (->columns "category_id" "name" "latitude" "id" "longitude"))
-  (set (->columns "category_id" "name" "latitude" "id" "longitude" "price"))]
+ [(set (venues-cols))
+  #{(venues-col :category_id)
+    (venues-col :name)
+    (venues-col :latitude)
+    (venues-col :id)
+    (venues-col :longitude)
+    (-> (venues-col :price)
+        (assoc :preview_display false))}
+  (set (venues-cols))]
  (let [get-col-names (fn [] (Q aggregate rows of venues
                                order id+
                                limit 1
-                               return :data :columns set))]
+                               return :data :cols set))]
    [(get-col-names)
     (do (upd Field (id :venues :price) :preview_display false)
         (get-col-names))


squash! Fix != false filtering in MySQL :scream_cat: #1680

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -400,14 +400,20 @@
     aggregate count of places
     filter = liked false))

+(defn- int->bool [x]
+  (condp = x
+    0 false
+    1 true
+      x))
+
 ;;; filter = true
 (datasets/expect-with-all-engines
   [[1 true "Tempest"]
    [2 true "Bullit"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter = liked true
-     return rows))
+     filter = liked true, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;;; filter != false
 (datasets/expect-with-all-engines
@@ -415,16 +421,16 @@
    [2 true "Bullit"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter != liked false
-     return rows))
+     filter != liked false, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;;; filter != true
 (datasets/expect-with-all-engines
   [[3 false "The Dentist"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter != liked true
-     return rows))
+     filter != liked true, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;; ### FILTER -- "BETWEEN", single subclause (neither "AND" nor "OR")


Elide execute-request fn b/c it obscures Java objs

--- src/xray_charlie_charlie/core.clj
+++ src/xray_charlie_charlie/core.clj
@@ -82,8 +82,10 @@
   [session options]
   (when-let [dro (:default-request-options options)]
     (.setDefaultRequestOptions session (request-options dro)))
-  (when-let [lgr (:logger options)] (.setLogger session lgr))
-  (when-let [uo (:user-object options)] (.setUserObject session uo))
+  (when-let [lgr (:logger options)]
+    (.setLogger session lgr))
+  (when-let [uo (:user-object options)]
+    (.setUserObject session uo))
   (when-let [tm (:transaction-mode options)]
     (.setTransactionMode session (transaction-modes tm)))
   (when-let [tt (:transaction-timeout options)]
@@ -151,44 +153,27 @@
                            options)]
     (.submitRequest session request)))

-(defn execute-request
-  "Execute the given request to the database connection defined by the
-  given session. Apply request options or variables if given. Iterate
-  over results before returning them. NB: this iterating makes some
-  Java objects unusable, e.g. those used internal database reporting."
-  ;; FIXME don't make java objects unusable
-  [request-factory session query options variables]
-  (loop [rs (submit-request request-factory session query options variables)
-         data []]
-    (if (.hasNext rs)
-      (let [rsItem (.next rs)
-            item (.getItem rsItem)]
-        (recur rs (conj data (str item))))
-      (do (when-not (.isClosed rs)
-            (.close rs))
-          data))))
-
 (defn execute-xquery
   "Execute the given xquery query as a request to the database
   connection defined by the given session. Apply request options or
   variables if given."
   ([session query]
-   (execute-request (.newAdhocQuery session query) session query {} {}))
+   (submit-request (.newAdhocQuery session query) session query {} {}))
   ([session query options]
-   (execute-request (.newAdhocQuery session query) session query options {}))
+   (submit-request (.newAdhocQuery session query) session query options {}))
   ([session query options variables]
-   (execute-request (.newAdhocQuery session query) session query options variables)))
+   (submit-request (.newAdhocQuery session query) session query options variables)))

 (defn execute-module
   "Execute the named module as a request to the database connection
   defined by the given session. Apply request options or variables if
   given."
   ([session module]
-   (execute-request (.newModuleInvoke session module) session module {} {}))
+   (submit-request (.newModuleInvoke session module) session module {} {}))
   ([session module options]
-   (execute-request (.newModuleInvoke session module) session module options {}))
+   (submit-request (.newModuleInvoke session module) session module options {}))
   ([session module options variables]
-   (execute-request (.newModuleInvoke session module) session module options variables)))
+   (submit-request (.newModuleInvoke session module) session module options variables)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


fix namespace

fix namespace

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -20,7 +20,8 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [clojure.core.cache :as cache]
-   [dag_unify.core :refer [fail? get-in remove-matching-keys strip-refs unify]]))
+   [dag_unify.core :refer [fail? get-in remove-matching-keys strip-refs unify]]
+   [babel.writer :as writer]))

 (def index-lexicon-on-paths
   [[:synsem :agr :gender]
@@ -521,7 +522,7 @@
               [k filtered-v])))))

 (defn write-lexicon []
-  (babel.writer/write-lexicon "en" (compile-lexicon)))
+  (writer/write-lexicon "en" (compile-lexicon)))

 (defn model []
   (let [debug (log/info "  loading lexicon..")


+{:language "en"}: needed so that expressions are inserted with the correct 'language' column

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -629,9 +629,11 @@
                    (map #(keyword (get-in % [:rule])) grammar)
                    grammar)

+     :grammar grammar
+
+     :language "en"
      :language-keyword :english

-     :grammar grammar
      :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))
      :lexicon lexicon
      :lookup (fn [arg]


add indices to Español

add indices to Español

--- src/babel/espanol/grammar.cljc
+++ src/babel/espanol/grammar.cljc
@@ -4,9 +4,7 @@
    [babel.espanol.lexicon :refer [lexicon]]
    [babel.espanol.morphology :as morph
     :refer [analyze fo morph-walk-tree]]
-   [babel.index :refer (build-lex-sch-index
-                        create-index map-subset-by-path
-                        spec-to-phrases)]
+   [babel.index :refer [build-lex-sch-index create-indices lookup-spec]]
    [babel.lexiconfn :refer [lexicon-for-generation]]
    [babel.parse :as parse]
    [babel.stringutils :refer [show-as-tree]]
@@ -22,6 +20,11 @@
    #?(:cljs [babel.logjs :as log])
    [clojure.core.cache :as cache]
    [dag_unify.core :refer (get-in unifyc)]))
+
+(def index-lexicon-on-paths
+  [[:synsem :cat]
+   [:synsem :aux]
+   [:synsem :sem :pred]])

 (defn fo-ps [expr]
   (parse/fo-ps expr fo))
@@ -440,8 +443,10 @@
                               v)]
                   (if (not (empty? filtered-v))
                     [k filtered-v]))))
-        lexicon-for-generation (lexicon-for-generation lexicon)]
+        lexicon-for-generation (lexicon-for-generation lexicon)
+        indices (create-indices lexicon index-lexicon-on-paths)]
     {:name "small"
+     :index-fn (fn [spec] (lookup-spec spec indices index-lexicon-on-paths))
      :language "es"
      :language-keyword :espanol
      :lookup (fn [arg]
@@ -452,12 +457,6 @@
                    (map #(keyword (get-in % [:rule]))
                         grammar)
                    grammar)
-
-     :pred2lex ;; map:<pred => subset of lexicon with that pred>
-     (map-subset-by-path lexicon [:synsem :sem :pred])
-
-     :cat2lex ;; map:<cat => subset of lexicon with that cat>
-     (map-subset-by-path lexicon [:synsem :cat])

      :grammar grammar
      :lexicon lexicon
@@ -467,9 +466,7 @@
      :morph-walk-tree (fn [tree]
                         (do
                           (merge tree
-                                 (morph-walk-tree tree))))
-     :index (create-index grammar (flatten (vals lexicon-for-generation)) head-principle)}))
-
+                                 (morph-walk-tree tree))))}))
 (defn medium []
   (log/info (str "Español model: medium"))
   (let [lexicon-for-generation
@@ -478,8 +475,10 @@
                 (let [filtered-v v]
                   (if (not (empty? filtered-v))
                     [k filtered-v]))))
-        lexicon-for-analysis lexicon]
+        lexicon-for-analysis lexicon
+        indices (create-indices lexicon index-lexicon-on-paths)]
     {:name "medium"
+     :index-fn (fn [spec] (lookup-spec spec indices index-lexicon-on-paths))
      :lookup (fn [arg]
                (morph/analyze arg lexicon-for-analysis))
      :morph fo
@@ -488,17 +487,9 @@
                         (do
                           (merge tree
                                  (morph-walk-tree tree))))
-
-     :pred2lex ;; map:<pred => subset of lexicon with that pred>
-     (map-subset-by-path lexicon [:synsem :sem :pred])
-
-     :cat2lex ;; map:<cat => subset of lexicon with that cat>
-     (map-subset-by-path lexicon [:synsem :cat])
-
      :grammar grammar
      :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))
      :lexicon lexicon
-     :index (create-index grammar (flatten (vals lexicon-for-generation)) head-principle)
      }))

 (defn parse [surface]


pred imparare to learn

pred imparare to learn

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -227,7 +227,7 @@
                            :sem {:pred :support}}}

    "apprendere"  {:synsem {:cat :verb
-                           :sem {:pred :imparare}}}
+                           :sem {:pred :learn}}}

    "approfittare"  {:synsem {:cat :verb
                              :sem {:pred :take-advantage-of}}}


Need to capture negative sign in maps regex

--- src/braid/map_embeds/core.cljc
+++ src/braid/map_embeds/core.cljc
@@ -7,7 +7,7 @@
        [[org.httpkit.client :as http]
         [braid.core.server.conf :refer [config]]])))

-(def google-regex #"^https://www.google.com/maps/.*/@\-?(\d+\.\d+),\-?(\d+.\.\d+).*")
+(def google-regex #"^https://www.google.com/maps/.*/@(\-?\d+\.\d+),(\-?\d+.\.\d+).*")

 #?(:cljs
    (defn- map-embed-view


Fix for a test failure in CMR2, build #331

--- system-int-test/test/cmr/system_int_test/search/granule_search_format_test.clj
+++ system-int-test/test/cmr/system_int_test/search/granule_search_format_test.clj
@@ -330,7 +330,8 @@
                                   :stop-orbit-number 4.0
                                   :equator-crossing-longitude -45.0
                                   :equator-crossing-date-time "2011-01-01T12:00:00.000Z"}]})
-        gran4 (d/ingest "PROV1" (dg/granule coll1 {:granule-ur "Granule4"}) :iso-smap)
+        gran4 (d/ingest "PROV1" (dg/granule coll1 {:granule-ur "Granule4"
+                                                   :spatial-coverage (dg/spatial (p/point 1 2))}) :iso-smap)
         ;; Granule #5 is added for CMR-1115, where a granule with orbit spatial but no
         ;; OrbitCalculatedSpatialDomains will not have polygon info in its atom/json representation.
         gran5 (make-gran coll3 {:granule-ur "OrbitGranuleWithoutOrbitCalculatedSpatialDomains"


Show prompt without namespace on additional lines

refs #74

--- src/clj/reply/reader/jline.clj
+++ src/clj/reply/reader/jline.clj
@@ -40,9 +40,11 @@
       (.setPaginationEnabled true)
       (.addCompleter completer))))

+(def prompt-end "=> ")
+
 (defmulti get-prompt type)
 (defmethod get-prompt :default [ns]
-  (format "%s=> " ns))
+  (format (str "%s" prompt-end) ns))
 (defmethod get-prompt clojure.lang.Namespace [ns]
   (get-prompt (ns-name ns)))

@@ -53,7 +55,10 @@
 (defn set-empty-prompt []
   (.setPrompt
     @jline-reader
-    (apply str (repeat (count (@prompt-fn (eval-state/get-ns))) \space))))
+    (apply str
+      (concat (repeat (- (count (@prompt-fn (eval-state/get-ns))) (count prompt-end))
+                      \space)
+              prompt-end))))

 (defn setup-reader! [options]
   (when-not (System/getenv "JLINE_LOGGING")


Fix scroll-to in safari

Fix scroll-to in safari

--- src/cljs/clojuredocs/anim.cljs
+++ src/cljs/clojuredocs/anim.cljs
@@ -37,10 +37,23 @@
 (defn scroll-to-top []
   (scroll-to (sel1 :body)))

+;; From dommy.attrs
+(defn bounding-client-rect
+  "Returns a map of the bounding client rect of `elem`
+   as a map with [:top :left :right :bottom :width :height]"
+  [elem]
+  (let [r (.getBoundingClientRect (node elem))]
+    {:top (.-top r)
+     :bottom (.-bottom r)
+     :left (.-left r)
+     :right (.-right r)
+     :width (.-width r)
+     :height (.-height r)}))
+
 (defn scroll-into-view
   [elem & [opts]]
   (let [elem (node elem)
-        {:keys [top bottom]} (dom/bounding-client-rect elem)]
+        {:keys [top bottom] :as res} (bounding-client-rect elem)]
     (when (or (< js/window.innerHeight
                 (+ top (.-offsetHeight elem)))
               (< top 0))


Editing and adding items now works

Editing and adding items now works

--- src/cljs/modern_cljs/core.cljs
+++ src/cljs/modern_cljs/core.cljs
@@ -24,7 +24,7 @@

 (def db
   {:var (str "tosi:" (rand-int 10))
-   :start 10
+   :start 0
    :editing {}})

 (defn ^:export updatedb [fields value]
@@ -53,12 +53,25 @@
 (defn update_field [id value]
   (set! db (assoc-in db [:editing id] value)))

-(defn save []
-  (println "Saved!" (str (:editing db))))
-
 (defn clear []
   (updatedb [:editing] {})
   (println "Cleared!"))
+
+(defn edit [item pos]
+  (println "editing" pos item)
+  (updatedb [:editing] (merge {:pos pos} item)))
+
+(defn save []
+  (let [doc (:editing db)
+        data (:data db)
+        pos (:pos doc)]
+    (if (not (empty? doc))
+      (do
+        (if (not (nil? pos))
+          (updatedb [:data] (assoc data pos (dissoc doc :pos)))
+          (updatedb [:data] (into [doc] data)))
+        (clear)
+        (println "Saved!" (str doc))))))

 ;
 ; View
@@ -93,10 +106,11 @@

 (defn notes [data start]
   "Returns 10 items from data"
-  (map
-    (fn [item]
+  (map-indexed
+    (fn [i item]
       (let [title (get item "title")]
-          (m "li" nil title)))
+          (m "li" nil [(m "button" {:onclick #(edit item i)} "Edit")
+                       title])))
     (take PAGESIZE (drop start data))))

 (defn page [start direction count]


Cosmetic and docstrings improvements on maybe monad ns.

--- src/cljx/cats/monad/maybe.cljx
+++ src/cljx/cats/monad/maybe.cljx
@@ -122,36 +122,47 @@
     false))

 (defn just
-  ([v]
-     (Just. v))
-  ([]
-     (Just. nil)))
+  "A Just type constructor.
+
+  Without arguments it returns a Just instance
+  with nil as wrapped value."
+  ([] (Just. nil))
+  ([v] (Just. v)))

 (defn nothing
+  "A Nothing type constructor."
   []
   (Nothing.))

 (defn just?
+  "Returns true if `v` is an instance
+  of `Just` type."
   [v]
   (instance? Just v))

 (defn nothing?
+  "Returns true if `v` is an instance
+  of `Nothing` type or is nil."
   [v]
   (or
    (nil? v)
    (instance? Nothing v)))

 (defn from-maybe
-  "Return inner value from maybe monad. Accepts an optional default value.
+  "Return inner value from maybe monad.
+
+  This is a specialized version of `cats.core/extract`
+  for Maybe monad types that allows set up
+  the default value.

   Let see some examples:

       (from-maybe (just 1))
       ;=> 1
-      (from-maybe (just 1) 42)
-      ;=> 1
+
       (from-maybe (nothing))
       ;=> nil
+
       (from-maybe (nothing) 42)
       ;=> 42
   "
@@ -162,14 +173,15 @@
   ([mv default]
    {:pre [(maybe? mv)]}
    (if (just? mv)
-     (.-v mv)
+     (proto/extract mv)
      default)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Monad definition
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def maybe-monad
+(def ^{:no-doc true}
+  maybe-monad
   (reify
     proto/Functor
     (fmap [_ f mv]
@@ -207,7 +219,9 @@
 ;; Monad transformer definition
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn maybe-transformer [inner-monad]
+(defn maybe-transformer
+  "The maybe transformer constructor."
+  [inner-monad]
   (reify
     proto/Functor
     (fmap [_ f fv]


Adds function remove-node for removing game nodes.

--- src/clojure/clj_chess/game.clj
+++ src/clojure/clj_chess/game.clj
@@ -233,6 +233,18 @@
   (add-key-value-pair game :pre-comment cmt node-id))

+(defn remove-node
+  "Removes a node (by default, the current node) from the game, and returns
+  a modified game with the current node set to the parent of the deleted
+  node."
+  [game & [node-id]]
+  (let [node-id (or node-id (-> game :current-node :node-id))
+        z (game-zip game node-id)
+        zr (zip/remove z)]
+    (assoc game :root-node (zip/root zr)
+                :current-node (if (= (zip/up z) (zip/prev z))
+                                (zip/node zr)
+                                (zip/node (zip/up zr))))))

 (defn goto-node-matching
   "Returns a game equal to the input game, except that :current-node is set to
@@ -366,7 +378,7 @@
             (let [board (node :board)
                   children (node :children)]
               (str
-                (when children
+                (when-not (empty? children)
                   (str
                     ;; Pre-comment for first child move:
                     (when include-comments?


Remove read size restriction

Remove read size restriction

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -28,11 +28,10 @@
 (defn read-file
   [path]
   (let [length (.length (java.io/file path))]
-    (when (< length 500000)
-      (let [data-barray (byte-array length)]
-        (with-open [bis (java.io/input-stream path)]
-          (.read bis data-barray))
-        data-barray))))
+    (let [data-barray (byte-array length)]
+      (with-open [bis (java.io/input-stream path)]
+        (.read bis data-barray))
+      data-barray)))

 (defn get-project-clj-path
   [path]