Update metosin/reitit to "0.3.7"

Update metosin/reitit to "0.3.7"

--- backend/project.clj
+++ backend/project.clj
@@ -23,7 +23,7 @@
                  [funcool/cuerdas "2.2.0" :exclusions [org.clojure/spec.alpha com.google.protobuf/protobuf-java com.google.errorprone/error_prone_annotations org.clojure/clojure com.google.guava/guava org.clojure/core.specs.alpha com.google.code.findbugs/jsr305 org.clojure/tools.reader]]
                  [honeysql "0.9.4"]
                  [meta-merge "1.0.0"]
-                 [metosin/reitit "0.3.6" :exclusions [com.cognitect/transit-java org.clojure/spec.alpha org.ow2.asm/asm ring/ring-core mvxcvi/puget org.clojure/clojure ring/ring-codec org.clojure/core.rrb-vector mvxcvi/arrangement fipp r org.clojure/core.specs.alpha com.fasterxml.jackson.core/jackson-databind com.fasterxml.jackson.core/jackson-core]]
+                 [metosin/reitit "0.3.7" :exclusions [com.cognitect/transit-java org.clojure/spec.alpha org.ow2.asm/asm ring/ring-core mvxcvi/puget org.clojure/clojure ring/ring-codec org.clojure/core.rrb-vector mvxcvi/arrangement fipp r org.clojure/core.specs.alpha com.cognitect/transit-clj com.fasterxml.jackson.core/jackson-databind com.fasterxml.jackson.core/jackson-core]]
                  [org.akvo/commons "0.4.5" :exclusions [org.postgresql/postgresql org.clojure/java.jdbc]]
                  [org.akvo/resumed "1.46.266acfa5bb52c9b484af19f0bcfbfacb60b97319"]
                  [org.apache.tika/tika-core "1.18"]


Add printing examples to the repl sample code.

--- samples/repl/src/repl/test.cljs
+++ samples/repl/src/repl/test.cljs
@@ -34,9 +34,15 @@

   ;; Evaluate some basic forms
   (+ 1 1)
+  (string-print "hello")
+  (prn "foo")
+  (prn {:a :b})
+  (println "hello")
+  (doseq [next (range 20)] (println next))
   {:a :b}
   "hello"
   (reduce + [1 2 3 4 5])
+  (time (reduce + (range 10000)))
   (js/alert "Hello World!")

   (load-file "clojure/string.cljs")


Remove duplicate charset regex

Remove duplicate charset regex

--- ring-core/src/ring/util/request.clj
+++ ring-core/src/ring/util/request.clj
@@ -1,6 +1,6 @@
 (ns ring.util.request
   "Functions for augmenting and pulling information from request maps."
-  (:require [ring.util.parsing :refer [re-value]]))
+  (:require [ring.util.parsing :refer [re-charset]]))

 (defn request-url
   "Return the full URL of the request."
@@ -28,15 +28,12 @@
   (if-let [^String length (get-in request [:headers "content-length"])]
     (Long. length)))

-(def ^:private charset-pattern
-  (re-pattern (str ";(?:.*\\s)?(?i:charset)=(" re-value ")\\s*(?:;|$)")))
-
 (defn character-encoding
   "Return the character encoding for the request, or nil if it is not set."
   {:added "1.3"}
   [request]
   (if-let [type (get-in request [:headers "content-type"])]
-    (second (re-find charset-pattern type))))
+    (second (re-find re-charset type))))

 (defn urlencoded-form?
   "True if a request contains a urlencoded form in the body."


Make "data" a bit bigger in relation to expected size of the data structure.

--- src/org/scode/httpgctest.clj
+++ src/org/scode/httpgctest.clj
@@ -25,13 +25,23 @@

 (def data (ref #{}))

+(defn make-random-data
+  []
+  (let [r (rand)]
+    {:rand r
+     :str (str r
+               " a fairly long semi-unique string that is hopefully not very small in"
+               " comparison to the set structure itself, thus making this test a bit"
+               " more useful in testing gc behavior. this string plus the map we are"
+               " returning should hopefully be enough")}))
+
 (defn serve-gendata [request]
   (let [amount (let [amstr (:amount (:query-params request))]
                  (if amstr
                    (Integer/parseInt amstr)
                    (max 1 (count @data))))]
     (dosync
-     (alter data (fn [d] (apply conj d (map (fn [f] (f)) (repeat amount #(str (rand) "data")))))))
+     (alter data (fn [d] (apply conj d (map (fn [f] (f)) (repeat amount #(make-random-data)))))))
     {:status 200
      :headers {}
      :body (str "size is now " (count @data) " after adding " amount)}))


increase sandbox timeout

increase sandbox timeout

--- src/shuppet/core_shuppet.clj
+++ src/shuppet/core_shuppet.clj
@@ -26,7 +26,7 @@

 (defn- make-sandbox []
   (sandbox shuppet-tester
-           :timeout 2000
+           :timeout 4000
            :init '(future (Thread/sleep 6000)
                           (-> *ns* .getName remove-ns))))


update :network with proper value

update :network with proper value

--- src/status_im/init/core.cljs
+++ src/status_im/init/core.cljs
@@ -188,7 +188,7 @@
                         :accounts/accounts accounts
                         :mailserver/mailservers mailservers
                         :network-status network-status
-                        :network account-network
+                        :network account-network-id
                         :network/type (:network/type db)
                         :chain (ethereum/network->chain-name account-network)
                         :universal-links/url url


no need for io/file when slurping resource

--- src/sushi_machine/server.clj
+++ src/sushi_machine/server.clj
@@ -23,7 +23,6 @@

 (def food-servers {:isushi (-> "isushi.edn"
                                io/resource
-                               io/file
                                slurp
                                edn/read-string)})


remove unnecessary binding in let clause

--- src/vignette/media_types.clj
+++ src/vignette/media_types.clj
@@ -31,9 +31,8 @@
 (defn original-path
   [data]
   (let [image-path (clojure.string/join "/" ((juxt top-dir middle-dir) data))
-        filename (revision-filename data)
-        revision (revision data)]
-    (if (nil? revision)
+        filename (revision-filename data)]
+    (if (nil? (revision data))
       (clojure.string/join "/" [image-path filename])
       (clojure.string/join "/" [archive-dir image-path filename]))))

@@ -59,9 +58,8 @@
 (defn thumbnail-path
   [data]
   (let [image-path (clojure.string/join "/" ((juxt top-dir middle-dir) data))
-        thumbnail (thumbnail data)
-        revision (revision data)]
-    (if (nil? revision)
+        thumbnail (thumbnail data)]
+    (if (nil? (revision data))
       (clojure.string/join "/" [image-path thumbnail])
       (clojure.string/join "/" [archive-dir image-path (revision-filename data) thumbnail]))))


fix nav constructors for cljs

fix nav constructors for cljs

--- src/clj/com/rpl/specter/macros.clj
+++ src/clj/com/rpl/specter/macros.clj
@@ -380,7 +380,8 @@
               [e]

               (i/fn-invocation? e)
-              (concat (rest e) (ic-possible-params e))
+              ;; the [e] here handles nav constructors
+              (concat [e] (rest e) (ic-possible-params e))

               (vector? e)
               (ic-possible-params e)


tring to convert to vec for avoiding strange count overhead

--- src/clj/morpheus/traversal/bfs.clj
+++ src/clj/morpheus/traversal/bfs.clj
@@ -106,7 +106,7 @@
     (swap! tasks-vertices assoc task-id vertices-map)
     (proc-stack task-id initial-stack)
     (loop [level 1]
-      (let [vertices-list (.keyColl vertices-map)
+      (let [vertices-list (vec (.keyColl vertices-map))
             unvisited-tr (atom (transient []))
             stop-required? (atom false)]
         (loop [vl   vertices-list]


Use a fn for subsequent-prompt default

Use a fn for subsequent-prompt default

--- src/clj/reply/eval_modes/nrepl.clj
+++ src/clj/reply/eval_modes/nrepl.clj
@@ -166,7 +166,7 @@
           options (assoc options :prompt
                          (->fn custom-prompt (fn [ns] (str ns "=> "))))
           options (assoc options :subsequent-prompt
-                         (->fn subsequent-prompt nil))
+                         (->fn subsequent-prompt (constantly nil)))
           options (if (:color options)
                     (merge options nrepl.cmdline/colored-output)
                     options)


Fix console log

Fix console log

--- src/cljs/battle_console/index.cljs
+++ src/cljs/battle_console/index.cljs
@@ -4,6 +4,8 @@
             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [secretary.core :as secretary :refer-macros [defroute]]))
+
+(enable-console-print!)

 (defn handler
   "Handles the root page and asks for the token"


Make logging level configurable

Make logging level configurable

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -11,6 +11,8 @@
   (:require-macros [cljs.core.async.macros :refer [go-loop]]))

 (enable-console-print!)
+
+(def ^:dynamic *log-level* 1)

 (defonce app-state (atom {:canvas         (.getElementById js/document "canvas")
@@ -118,7 +120,7 @@
     (when-let [[event body] (<! messages)]
       (case event

-        :log (.log js/console (:message body))
+        :log (when (<= *log-level* (:level body)) (.log js/console (:message body)))

         :keydown (handle-keydown! messages body)


unused function removed

unused function removed

--- src/cljs/om_next_leaflet/core.cljs
+++ src/cljs/om_next_leaflet/core.cljs
@@ -82,17 +82,6 @@
     {:value v}
     {}))

-;; TODO: type、title は必須として、placeholder は optional
-;; さらに on-click 他の属性を与えたい
-;; あと、.form-group .row が前提(label の有無で切り替える？)
-(defn input-text
-  [type title placeholder]
-  (let [id (str (gensym))]
-    [:div.form-group.row
-     [:label.form-control-label {:class "col-xs-2" :for id} title]
-     [:div {:class "col-xs-4"}
-      [:input.form-control.form-control-sm {:id id :type type :placeholder placeholder}]]]))
-
 (defn get-mapobj
   [this]
   (-> (om/react-ref this :leaflet) om/get-state :mapobj))
@@ -117,13 +106,6 @@
     (om/transact! this `[(app/update-mapstate {:new-mapstate ~mapstate})])))

 (def leaflet-map-fn (om/factory leaflet/Leaflet))
-
-(defn jump-to
-  [this lat lng]
-  (let [leaflet-map (get-mapobj this)
-        marker (leaflet/create-marker lat lng)]
-    (leaflet/set-center leaflet-map lat lng)
-    (.addTo marker leaflet-map)))

 ;; add all statiions marker to 'stations-layer'
 (defn init-station-markers


simplify specs

simplify specs

--- src/cljs/triboard/logic/board.cljs
+++ src/cljs/triboard/logic/board.cljs
@@ -39,8 +39,8 @@
 ;; -----------------------------------------

 (s/def ::board (s/every (s/every ::cst/cell :count 11) :count 16))
-(s/def ::x-coord (into #{} (range cst/board-width)))
-(s/def ::y-coord (into #{} (range cst/board-height)))
+(s/def ::x-coord (set (range cst/board-width)))
+(s/def ::y-coord (set (range cst/board-height)))
 (s/def ::coord (s/tuple ::x-coord ::y-coord))

 (s/fdef new-board
@@ -81,12 +81,3 @@
   (eduction
     (filter #(= (get-cell-at board %) :empty))
     cst/all-positions))
-
-;; (s/check-asserts true)
-
-;; You can test this function by using
-;; (empty-cells (first (gen/sample (s/gen ::board) 1)))
-;; (stest/check `empty-cells)
-;; (s/explain `to-iterable to-iterable)
-;; (s/explain `empty-cells empty-cells)
-;; (stest/instrument `empty-cells)


log level

log level

--- src/clojure/zensols/model/weka.clj
+++ src/clojure/zensols/model/weka.clj
@@ -410,7 +410,7 @@
   * **test-fn** just like **train-fn** but used to create the test data set and
   it doesn't take the `java.util.Random` instance"
   [inst & {:keys [train-fn test-fn randomize-fn] :as opts}]
-  (log/infof "wrapping instance of type %s" (class inst))
+  (log/debugf "wrapping instance of type %s" (class inst))
   (let [train-state (atom nil)]
     (proxy [Instances] [inst]
       (randomize [rand]


Allow for an update function to be passed.

--- src/cmr/dev/env/manager/timing.clj
+++ src/cmr/dev/env/manager/timing.clj
@@ -38,15 +38,21 @@
   (into {} (map (partial get-passed times tracker) (keys times))))

 (defn update-interval
-  [times tracker time-key]
-  (if (pos? (get-interval times tracker time-key))
-    (assoc tracker time-key (System/currentTimeMillis))
-    tracker))
+  ([times tracker time-key]
+    (update-interval times tracker time-key (constantly true)))
+  ([times tracker time-key update-fn]
+    (if (pos? (get-interval times tracker time-key))
+      (do
+        (update-fn times tracker time-key)
+        (assoc tracker time-key (System/currentTimeMillis)))
+      tracker)))

 (defn update-tracker
-  [times tracker]
-  (loop [[time-key & time-keys] (keys times)
-         t tracker]
-    (if-not time-key
-      t
-      (recur time-keys (update-interval times t time-key)))))
+  ([times tracker]
+    (update-tracker times tracker (constantly true)))
+  ([times tracker update-fn]
+    (loop [[time-key & time-keys] (keys times)
+           t tracker]
+      (if-not time-key
+        t
+        (recur time-keys (update-interval times t time-key update-fn))))))


remove cruft

remove cruft

--- src/doctopus/doctopus/tentacle.clj
+++ src/doctopus/doctopus/tentacle.clj
@@ -43,11 +43,3 @@
     (str/join "/" ["" "docs" (:name this) (:entry-point this)]))
   (routes [this]
     (load-from-storage backend (:name this))))
-
-
-;; ### Tentacle Config Spec
-(def one-tentacle (map->Tentacle {:src-root "/tmp/doctopus"
-                                  :output-root "/tmp/doctopus/docs"
-                                  :html-command "lein"
-                                  :html-args ["marg" "-f" "index.html"]
-                                  :name "doctopus"}))


Removed more debugging.

Removed more debugging.

--- src/kixi/hecuba/data/calculate.clj
+++ src/kixi/hecuba/data/calculate.clj
@@ -119,7 +119,6 @@
   "Takes store, sensor and a range of dates and calculates difference series using resolution
   stored in the sensor data. If resolution is not specified, default 60 seconds is used."
   [store {:keys [sensor range]}]
-  (log/debugf "Sensor: %s Range: %s" sensor range)
   (let [resolution (if-let [r (:resolution sensor)] (edn/read-string r) 60)]
     (when (> resolution 0)
       (let [{:keys [start-date end-date]} range


Refactor

Refactor

--- src-cljs/game_of_life/game.cljs
+++ src-cljs/game_of_life/game.cljs
@@ -10,7 +10,7 @@
   [living-cells [location occurrence-count]]
   (or (= occurrence-count 3)
       (and (= occurrence-count 2)
-           (contains? living-cells location))))
+           (living-cells location))))

 (defn advance [living-cells]
   (->>


test-solve-class-name-referring-itself now pass

--- src/app/symbol_solver/scope.clj
+++ src/app/symbol_solver/scope.clj
@@ -163,7 +163,11 @@
   ; TODO consider imports
   (solveClass [this context nameToSolve]
     (let [typesInCu (topLevelTypes this)
-          compatibleTypes (filter (fn [t] (= nameToSolve (getName t))) typesInCu)]
-      (or (first compatibleTypes)
+          ; match types in cu using their simple name
+          compatibleTypes (filter (fn [t] (= nameToSolve (getName t))) typesInCu)
+          ; match types in cu using their qualified name
+          compatibleTypes' (filter (fn [t] (= nameToSolve (getQName t))) typesInCu)]
+      (or (first compatibleTypes)
+          (first compatibleTypes')
           (solveImportedClass this nameToSolve)
           (solveClassInPackage (getClassPackage this) nameToSolve)))))


s/unifyc/unify/

s/unifyc/unify/

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -19,7 +19,7 @@
    #?(:cljs [babel.logjs :as log])
    [clojure.core.cache :as cache]
    [clojure.repl :refer (doc)]
-   [dag_unify.core :refer (fail? get-in remove-matching-keys strip-refs unifyc)]))
+   [dag_unify.core :refer (fail? get-in remove-matching-keys strip-refs unify)]))

 (defn fo-ps [expr]
   (parse/fo-ps expr fo))
@@ -31,7 +31,7 @@
      (throw (js/Error. error-string))))

 (defn unify-check [ & vals]
-  (let [result (apply unifyc vals)]
+  (let [result (apply unify vals)]
     (if (fail? result)
       (exception (str "failed to unify grammar rule with values: " vals))
       result)))
@@ -46,7 +46,7 @@
 (def head-first
   (let [head-italian (atom :top)
         comp-italian (atom :top)]
-    (unifyc
+    (unify
      {:comp {:italiano {:initial false}}
       :head {:italiano {:initial true}}}
      {:head {:italiano head-italian}
@@ -56,7 +56,7 @@
 (def head-last
   (let [head-italian (atom :top)
         comp-italian (atom :top)]
-    (unifyc
+    (unify
      {:comp {:italiano {:initial true}}
       :head {:italiano {:initial false}}}
      {:head {:italiano head-italian}
@@ -67,14 +67,14 @@
 ;; -- BEGIN SCHEMA DEFINITIONS
 ;; <TODO: move to ug>
 (def schema-10
-  (unifyc
+  (unify
    subcat-1-principle
    head-principle
    {:first :comp
     :comp {:synsem {:subcat '()}}}))

 (def c10
-  (unifyc
+  (unify
    schema-10
    head-last
    {:comment "c10"
@@ -87,7 +87,7 @@
     :comp {:synsem {:subcat '()}}}))

 (def c21
-  (unifyc
+  (unify
    subcat-2-principle
    head-principle
    head-last
@@ -99,7 +99,7 @@
     :comment "c21"}))

 (def h11
-  (unifyc
+  (unify
    subcat-1-1-principle
    hc-agreement
    head-principle
@@ -112,7 +112,7 @@

 (def c11-comp-subcat-1
   (let [subcat (atom :top)]
-    (unifyc
+    (unify
      {:head {:synsem {:subcat {:1 subcat}}}
       :comp {:synsem {:subcat {:1 subcat}}}}
      subcat-1-1-principle-comp-subcat-1
@@ -126,7 +126,7 @@

 (def h11-comp-subcat-1
   (let [subcat (atom :top)]
-    (unifyc
+    (unify
      {:head {:synsem {:subcat {:1 subcat}}}
       :comp {:synsem {:subcat {:1 subcat}}}}
      subcat-1-1-principle-comp-subcat-1
@@ -139,7 +139,7 @@
       :comment "h11-comp-subcat-1"})))

 (def h10
-  (unifyc
+  (unify
    subcat-1-principle
    head-principle
    head-first
@@ -148,7 +148,7 @@
     :first :head}))

 (def h21
-  (unifyc
+  (unify
    subcat-2-principle
    head-principle
    head-first
@@ -159,14 +159,14 @@
 ;; h21a is a specialization of h21. it's used for vp-aux to prevent over-generation.
 (def h21a
   (merge
-   (unifyc
+   (unify
     h21
     {:head {:synsem {:subcat {:2 {:subcat {:2 '()}}}}}})
    {:comment "h21a"
     :schema-symbol 'h21a}))

 (def h22
-  (unifyc
+  (unify
    subcat-2-2-principle
    head-principle
    head-first
@@ -175,7 +175,7 @@
     :first :head}))

 (def h32
-  (unifyc
+  (unify
    subcat-5-principle
    head-principle
    head-first
@@ -210,11 +210,11 @@
 (def modified {:modified true})
 (def unmodified {:modified false})

-(def grammar (list (unifyc h21
+(def grammar (list (unify h21
                            {:rule "adjective-phrase"
                             :synsem {:cat :adjective}})

-                   (unifyc h21
+                   (unify h21
                            (let [head-synsem {:cat :intensifier
                                               :modified true}] ;; TODO: document what purpose :modified serves (if any: if none, remove).
                              {:rule "intensifier-phrase"
@@ -226,7 +226,7 @@
                          comp-synsem (atom {:sem sem
                                             :infl infl
                                             :subcat {:1 parent-subcat}})]
-                     (unifyc
+                     (unify
                       head-first
                       {:head {:synsem {:cat :adverb
                                        :sem sem
@@ -242,7 +242,7 @@
                        :rule "adverb-phrase"}))

                    ;; nbar where head (noun) is first ('h' in h11)
-                   (unifyc h11-comp-subcat-1
+                   (unify h11-comp-subcat-1
                            (let [is-propernoun? (atom :top)]
                              {:comp {:phrasal false ;; rathole prevention ;; TODO: see if this can be removed.
                                      :synsem {:cat :adjective}}
@@ -255,7 +255,7 @@
                                        :propernoun is-propernoun?}}))

                    ;; nbar where complement (adjective) is first ('c' in c11)
-                   (unifyc c11-comp-subcat-1
+                   (unify c11-comp-subcat-1
                            (let [is-propernoun? (atom :top)]
                              {:comp {:phrasal false ;; rathole prevention ;; TODO: see if this can be removed.
                                      :synsem {:cat :adjective}}
@@ -267,7 +267,7 @@
                                        :modified true
                                        :propernoun is-propernoun?}}))

-                   (unifyc c10
+                   (unify c10
                            comp-specs-head
                            (let [number-agreement (atom :top)
                                  is-propernoun? (atom :top)]
@@ -282,13 +282,13 @@
                                      :synsem {:propernoun is-propernoun?}}
                               :comp {:phrasal false}})) ;; rathole prevention ;; TODO: see if this can be removed.

-                   (unifyc h10
+                   (unify h10
                            {:rule "np-to-n-pp"
                             :synsem {:cat :noun}
                             :head {:phrasal false}
                             :comp {:synsem {:cat :prep
                                             :sem {:pred :di}}}})
-                   (unifyc c10
+                   (unify c10
                            comp-specs-head
                            (let [number-agreement (atom :top)
                                  is-propernoun? (atom :top)]
@@ -313,11 +313,11 @@
                                    :head {:synsem {:sem sem
                                                    :subcat {:1 {:reflexive reflexive}}}}}))

-;                   (unifyc h21
+;                   (unify h21
 ;                           {:rule "adjunct-prepositional-phrase"
 ;                            :synsem {:cat :prep}})

-                   (unifyc c10
+                   (unify c10
                            root-is-head-root
                            {:head {:phrasal true ;; only a vp-aux may be the head child, not simply a lexical auxiliary verb.
                                    :synsem {:aux true}}
@@ -326,7 +326,7 @@
                                      :cat :verb
                                      :sem {:aspect :perfect
                                            :tense :past}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head-root
                            {:rule "s-future-phrasal"
                             :head {:phrasal true}
@@ -334,7 +334,7 @@
                                      :infl :future
                                      :cat :verb
                                      :sem {:tense :future}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head
                            {:rule "s-future-nonphrasal"
                             :head {:phrasal false}
@@ -342,7 +342,7 @@
                                      :infl :future
                                      :cat :verb
                                      :sem {:tense :future}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head-root
                            {:rule "s-conditional-phrasal"
                             :head {:phrasal true}
@@ -350,7 +350,7 @@
                                      :infl :conditional
                                      :cat :verb
                                      :sem {:tense :conditional}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head
                            {:rule "s-conditional-nonphrasal"
                             :head {:phrasal false}
@@ -358,7 +358,7 @@
                                      :infl :conditional
                                      :cat :verb
                                      :sem {:tense :conditional}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head-root
                            {:rule "s-imperfect-phrasal"
                             :head {:phrasal true}
@@ -367,7 +367,7 @@
                                      :cat :verb
                                      :sem {:aspect :progressive
                                            :tense :past}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head
                            {:rule "s-imperfect-nonphrasal"
                             :head {:phrasal false}
@@ -376,7 +376,7 @@
                                      :cat :verb
                                      :sem {:aspect :progressive
                                            :tense :past}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head
                            {:rule "s-present-nonphrasal"
                             :head {:phrasal false}
@@ -385,7 +385,7 @@
                                      :cat :verb
                                      :sem {:aspect :progressive
                                            :tense :present}}})
-                   (unifyc c10
+                   (unify c10
                            root-is-head-root
                            {:rule "s-present-phrasal"
                             :head {:phrasal true}
@@ -394,13 +394,13 @@
                                      :cat :verb
                                      :sem {:aspect :progressive
                                            :tense :present}}})
-                   (unifyc h21
+                   (unify h21
                            root-is-head
                            {:rule "vp-infinitive"
                             :synsem {:aux false
                                      :infl :infinitive
                                      :cat :verb}})
-                   (unifyc h21a
+                   (unify h21a
                            root-is-comp-root
                            {:rule "vp-aux-phrasal-complement"
                             :head {:phrasal false
@@ -411,7 +411,7 @@
                                      :sem {:tense :past}
                                      :cat :verb}})

-                   (unifyc h21a
+                   (unify h21a
                            root-is-comp
                            {:rule "vp-aux-nonphrasal-complement"
                             :head {:phrasal false
@@ -426,7 +426,7 @@
                    ;; dependence on auxilary sense of "avere" which supplies the
                    ;; obj-agr agreement between the object and the main (non-auxilary) verb.
                    ;; Note use of :reflexive below.
-                   (unifyc h22
+                   (unify h22
                            root-is-comp
                            vp-non-pronoun
                            (let [obj-agr (atom :top)]
@@ -441,7 +441,7 @@
                                        :subcat {:2 {:agr obj-agr}}}
                               :italiano {:b {:obj-agr obj-agr}}}))

-                   (unifyc h21
+                   (unify h21
                            root-is-head
                            {:rule "vp-future"
                             :synsem {:aux false
@@ -449,7 +449,7 @@
                                      :cat :verb}}
                            vp-non-pronoun)

-                   (unifyc h21
+                   (unify h21
                            root-is-head
                            {:rule "vp-imperfect"
                             :synsem {:aux false
@@ -457,7 +457,7 @@
                                      :cat :verb}}
                            vp-non-pronoun)

-                   (unifyc h21
+                   (unify h21
                            root-is-head
                            {:rule "vp-past"
                             :synsem {:aux false
@@ -465,7 +465,7 @@
                                      :cat :verb}}
                            vp-non-pronoun)

-                   (unifyc h21
+                   (unify h21
                            root-is-head
                            {:rule "vp-present"
                             :synsem {:aux false
@@ -474,7 +474,7 @@
                                      :cat :verb}}
                            vp-non-pronoun)

-                   (unifyc c21
+                   (unify c21
                            root-is-head-root
                            {:head {:phrasal true}
                             :comp {:synsem {:cat :noun
@@ -491,7 +491,7 @@
                    ;; on intransitive verbs plus reflexives).
                    ;; Later, when we do want to generate transitive sentences with pronouns, we might need
                    ;; to split this rule into two: one for reflexives, one for transitives.
-                   (unifyc c21
+                   (unify c21
                            root-is-head
                            {:head {:phrasal false
                                    :synsem {:sem {:reflexive true}}}
@@ -504,7 +504,7 @@

                    ;; e.g. used as: "io mi chiamo Luisa" -
                    ;; [s-present-phrasal 'io' [vp-pronoun-phrasal 'mi' [vp-32 'chiamo' 'Luisa']]]
-                   (unifyc h32
+                   (unify h32
                            root-is-head
                            {:rule "vp-32"
                             :head {:phrasal false
@@ -512,7 +512,7 @@
                             :synsem {:aux false
                                      :infl {:not :past}
                                      :cat :verb}})
-                   (unifyc h10
+                   (unify h10
                            root-is-comp
                            {:head {:phrasal false
                                    :synsem {:cat :sent-modifier}}
@@ -556,7 +556,7 @@

 (defn aux-is-head-feature [phrase]
   (cond (= :verb (get-in phrase '(:synsem :cat)))
-        (unifyc phrase
+        (unify phrase
                 (let [ref (atom :top)]
                   {:synsem {:aux ref}
                    :head {:synsem {:aux ref}}}))
@@ -564,7 +564,7 @@

 (defn modal-is-head-feature [phrase]
   (cond (= :verb (get-in phrase '(:synsem :cat)))
-        (unifyc phrase
+        (unify phrase
                 (let [ref (atom :top)]
                   {:synsem {:modal ref}
                    :head {:synsem {:modal ref}}}))
@@ -846,7 +846,6 @@
      :rules rules
      :rule-map (zipmap rules
                        grammar)
-
      }))

 (defn np-grammar []


prevent reflexive-constraints from matching with "chiamarsi"

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -893,6 +893,10 @@

    {:if #(and (= (get-in % [:synsem :sem :reflexive])
                  true)
+              (not (= (get-in % [:synsem :sem :pred])
+                      :be-called))
+              (not (= (get-in % [:root :italiano :italiano])
+                      "chiamarsi"))
               (= (get-in % [:synsem :sem :tense])
                  :present)
               (= (get-in % [:synsem :sem :aspect])


whitespace

whitespace

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -999,11 +999,11 @@
                                     :3plur "sono"}
                           :passato "stato"
                           :imperfect {:1sing "ero"
-                                       :2sing "eri"
-                                       :3sing "era"
-                                       :1plur "eravamo"
-                                       :2plur "eravate"
-                                       :3plur "erano"}
+                                      :2sing "eri"
+                                      :3sing "era"
+                                      :1plur "eravamo"
+                                      :2plur "eravate"
+                                      :3plur "erano"}
                           :future {:1sing "sarò"
                                    :2sing "sarai"
                                    :3sing "sarà"


+reflexive

+reflexive

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -37,6 +37,18 @@
                                 :subcat {:1 {:sem shared}}}})
         pronoun-acc ipos/pronoun-acc
         pronoun-reflexive ipos/pronoun-reflexive
+        reflexive (let [subject-semantics (atom {:animate true})
+                        subject-agr (atom :top)]
+                    {:synsem {:sem {:subj subject-semantics
+                                    :obj subject-semantics
+                                    :reflexive true}
+                              :subcat {:1 {:agr subject-agr
+                                           :sem subject-semantics}
+                                       :2 {:agr subject-agr
+                                           :pronoun true
+                                           :reflexive true
+                                           :sem subject-semantics}}}})
+
         sentential-adverb ipos/sentential-adverb
         transitive ipos/transitive
         verb-aux ipos/verb-aux
@@ -124,21 +136,13 @@
                    :animate false
                    :pred :acqua}}}

-   "addormentarsi" (let [subject-semantics (atom {:animate true})
-                         subject-agr (atom :top)]
-                     {:synsem {:cat :verb
-                               :essere true
-                               :sem {:pred :fall-asleep
-                                     :reflexive true
-                                     :subj subject-semantics
-                                     :obj subject-semantics}
-                               :subcat {:1 {:agr subject-agr
-                                            :sem subject-semantics}
-                                        :2 {:agr subject-agr
-                                            :pronoun true
-                                            :reflexive true
-                                            :sem subject-semantics}}}})
-   "aereo" {:synsem {:agr {:gender :masc}
+     "addormentarsi"
+     {:unify [reflexive]
+      :synsem {:cat :verb
+               :essere true
+               :sem {:pred :fall-asleep}}}
+
+     "aereo" {:synsem {:agr {:gender :masc}
                      :cat :noun
                      :sem {:physical-object true
                            :pred :airplane


Update tests with last changes on poly1305 interface implementation.

--- test/buddy/test_buddy_core.clj
+++ test/buddy/test_buddy_core.clj
@@ -1,6 +1,7 @@
 (ns buddy.test_buddy_core
   (:require [clojure.test :refer :all]
             [buddy.core.codecs :refer :all]
+            [buddy.core.keys :refer :all]
             [buddy.core.hash :as hash]
             [buddy.core.hmac :refer [shmac-sha256]]
             [buddy.hashers.pbkdf2 :as pbkdf2]
@@ -10,7 +11,7 @@
             [buddy.hashers.scrypt :as scrypt]
             [buddy.core.mac.poly1305 :as poly]
             [clojure.java.io :as io])
-  (:import (java.util Arrays)))
+  (:import buddy.Arrays))

 (deftest codecs-test
   (testing "Hex encode/decode 01"
@@ -65,31 +66,35 @@
       (is (= (bytes->hex (hash/sha256 (io/input-stream path))) valid-hash)))))

 (deftest poly1305-tests
-  (testing "Poly1305 encrypt/verify (using string key)"
-    (let [plain-text "text"
-          secretkey  "secret"
-          mac-bytes1  (poly/make-poly1305 (->byte-array plain-text) secretkey)
-          mac-bytes2  (poly/make-poly1305 (->byte-array plain-text) secretkey)]
+  (let [iv        (byte-array 16) ;; 16 bytes array filled with 0
+        plaintext "text"
+        secretkey "secret"]
+    (testing "Poly1305 encrypt/verify (using string key)"
+      (let [mac-bytes1 (poly/poly1305 plaintext secretkey iv :aes)
+            mac-bytes2 (poly/poly1305 plaintext secretkey iv :aes)]
       (is (= (Arrays/equals mac-bytes1 mac-bytes2)))))

   (testing "Poly1305 explicit encrypt/verify (using string key)"
-    (let [plaintext  "text"
-          secretkey  "secret"
-          mac-bytes1 (poly/make-poly1305 (->byte-array plaintext) secretkey)]
+    (let [mac-bytes1 (poly/poly1305 plaintext secretkey iv :aes)]
       (is (= (-> mac-bytes1 (bytes->hex)) "98a94ff88861bf9b96bcb7112b506579"))))

-  (testing "Poly1305 key constructor"
-    (let [key1 (poly/make-key "secret")
-          key2 (poly/make-key "secret")]
-      (is (Arrays/equals (:key key1) (:key key2)))
-      (is (not (Arrays/equals (:iv key1) (:iv key2))))))
+  (testing "Poly1305-AES enc/verify using key with good iv"
+    (let [iv1      (make-random-bytes 16)
+          iv2      (make-random-bytes 16)
+          macbytes (poly/poly1305 plaintext secretkey iv1 :aes)]
+      (is (poly/poly1305-verify plaintext macbytes secretkey iv1 :aes))
+      (is (not (poly/poly1305-verify plaintext macbytes secretkey iv2 :aes)))))

-  (testing "Poly1305 enc/verify using key with good iv"
-    (let [plaintext "text"
-          secret1   (poly/make-key "secret")
-          secret2   (poly/make-key "secret") ;; same as secret1 but with new iv
-          macbytes  (poly/make-poly1305 plaintext secret1)]
-      (is (poly/verify-poly1305 plaintext macbytes secret1))
-      (is (not (poly/verify-poly1305 plaintext macbytes secret2)))))
-)
+  (testing "Poly1305-Twofish env/verify"
+    (let [iv2 (make-random-bytes 16)
+          signature (poly/poly1305-twofish plaintext secretkey iv2)]
+      (is (poly/poly1305-twofish-verify plaintext signature secretkey iv2))
+      (is (not (poly/poly1305-twofish-verify plaintext signature secretkey iv)))))

+  (testing "Poly1305-Serpent env/verify"
+    (let [iv2 (make-random-bytes 16)
+          signature (poly/poly1305-serpent plaintext secretkey iv2)]
+      (is (poly/poly1305-serpent-verify plaintext signature secretkey iv2))
+      (is (not (poly/poly1305-serpent-verify plaintext signature secretkey iv)))))
+))
+


Clean up import collisions

Clean up import collisions

--- test/buildviz/handler_test.clj
+++ test/buildviz/handler_test.clj
@@ -6,7 +6,7 @@
              [coerce :as tc]
              [core :as t]]
             [clojure
-             [string :refer :all]
+             [string :as str]
              [test :refer :all]]
             [ring.mock.request :refer :all]))

@@ -221,7 +221,7 @@
       (a-build app "someBuild" 3, {:start 70 :end 90 :outcome "fail" :inputs [{:source_id 42 :revision "other_revision"}]})
       (a-build app "someBuild" 4, {:start 100 :end 120 :outcome "pass" :inputs [{:source_id 42 :revision "yet_another_revision"}]})
       (is (= (:body (plain-get-request app "/jobs"))
-             (join ["job,averageRuntime,totalCount,failedCount,flakyCount\n"
+             (str/join ["job,averageRuntime,totalCount,failedCount,flakyCount\n"
                     (format "someBuild,%.8f,4,2,1\n" 0.00000023)]))))

     ;; GET should return empty map for json by default
@@ -292,7 +292,7 @@
       (a-build app "aBuild" 3, {:start (+ a-timestamp a-day) :end (+ a-timestamp a-day 4000)})
       (a-build app "anotherBuild" 1, {:start a-timestamp :end (+ a-timestamp 4000)})
       (a-build app "buildWithoutTimestamps" 1, {:outcome "pass"})
-      (is (= (join "\n" ["date,aBuild,anotherBuild"
+      (is (= (str/join "\n" ["date,aBuild,anotherBuild"
                          (format "1986-10-14,%.8f,%.8f" 0.00001737 0.00004630)
                          (format "1986-10-15,%.8f," 0.00004630)
                          ""])
@@ -302,7 +302,7 @@
     (let [app (the-app {"aBuild" {1 {:start (- a-timestamp a-day), :end (- a-timestamp a-day)}}
                         "anotherBuild" {1 {:start a-timestamp :end a-timestamp}}}
                        {})]
-      (is (= (join "\n" ["date,anotherBuild"
+      (is (= (str/join "\n" ["date,anotherBuild"
                          (format "1986-10-14,%.8f" 0.0)
                          ""])
              (:body (get-request app "/pipelineruntime" {"from" a-timestamp})))))))
@@ -367,7 +367,7 @@
                                         2 "<testsuites><testsuite name=\"a suite\"><testcase name=\"a test\" classname=\"a class\"><failure/></testcase></testsuite></testsuites>"}
                         "anotherFailingBuild" {1 "<testsuites><testsuite name=\"another suite\"><testsuite name=\"nested suite\"><testcase name=\"another test\" classname=\"some class\"><failure/></testcase></testsuite></testsuite></testsuites>"}
                         "passingBuild" {1 "<testsuites><testsuite name=\"suite\"><testcase name=\"test\" classname=\"class\"></testcase></testsuite></testsuites>"}})]
-      (is (= (join "\n" ["failedCount,job,testsuite,classname,name"
+      (is (= (str/join "\n" ["failedCount,job,testsuite,classname,name"
                          "1,anotherFailingBuild,another suite: nested suite,some class,another test"
                          "2,failingBuild,a suite,a class,a test"
                          ""])
@@ -432,14 +432,14 @@
     (let [app (the-app {"aBuild" {1 {:start 0}}}
                        {"aBuild" {1 "<testsuites><testsuite name=\"a suite\"><testcase name=\"a,test\" classname=\"a class\" time=\"10\"></testcase></testsuite></testsuites>"}})]
       (is (= (:body (get-request app "/testcases"))
-             (join ["averageRuntime,job,testsuite,classname,name\n"
+             (str/join ["averageRuntime,job,testsuite,classname,name\n"
                     (format "%.8f,aBuild,a suite,a class,\"a,test\"\n" 0.00011574)]))))

     ;; GET should handle nested testsuites in CSV
     (let [app (the-app {"aBuild" {1 {:start 0}}}
                        {"aBuild" {1 "<testsuites><testsuite name=\"a suite\"><testsuite name=\"nested suite\"><testcase name=\"a,test\" classname=\"a class\" time=\"10\"></testcase></testsuite></testsuite></testsuites>"}})]
       (is (= (:body (plain-get-request app "/testcases"))
-             (join ["averageRuntime,job,testsuite,classname,name\n"
+             (str/join ["averageRuntime,job,testsuite,classname,name\n"
                     (format "%.8f,aBuild,a suite: nested suite,a class,\"a,test\"\n" 0.00011574)]))))

     ;; GET should not include builds without test cases
@@ -481,7 +481,7 @@
                           "2" {:start 1}}}
                {"aBuild" {"1" "<testsuite name=\"a suite\"><testsuite name=\"nested suite\"><testcase name=\"testcase\" classname=\"class\" time=\"10\"/><testcase name=\"another testcase\" classname=\"class\" time=\"30\"/></testsuite></testsuite>"
                           "2" "<testsuite name=\"a suite\"><testsuite name=\"nested suite\"><testcase name=\"testcase\" classname=\"class\" time=\"60\"/></testsuite></testsuite>"}})]
-      (is (= (join ["averageRuntime,job,testsuite,classname\n"
+      (is (= (str/join ["averageRuntime,job,testsuite,classname\n"
                     (format "%.8f,aBuild,a suite: nested suite,class\n" 0.0005787)])
              (:body (plain-get-request app "/testclasses")))))

@@ -507,7 +507,7 @@
                                      "passing" {:outcome "pass" :inputs {:revision 0 :source_id 42}}}}
                {"aBuild" {"failing" "<testsuite name=\"a suite\"><testsuite name=\"nested suite\"><testcase name=\"testcase\" classname=\"class\"><failure/></testcase></testsuite></testsuite>"}
                 "anotherBuild" {"failing" "<testsuite name=\"a suite\"><testcase name=\"testcase\" classname=\"class\"><failure/></testcase></testsuite>"}})]
-      (is (= (join ["latestFailure,flakyCount,job,latestBuildId,testsuite,classname,name\n"
+      (is (= (str/join ["latestFailure,flakyCount,job,latestBuildId,testsuite,classname,name\n"
                     "1986-10-14 04:03:27,1,aBuild,failing,a suite: nested suite,class,testcase\n"
                     "1986-10-14 04:03:27,1,anotherBuild,failing,a suite,class,testcase\n"])
              (:body (plain-get-request app "/flakytestcases")))))))


Add more extend related tests now using arrays.

--- test/suricatta/extend_test.clj
+++ test/suricatta/extend_test.clj
@@ -63,41 +63,39 @@
         result1 (first result)]
     (is (= (:k result1) {:foo 1}))))

-;; (deftest inserting-json-2
-;;   (sc/execute *ctx* "create table t1 (k json)")
-;;   (sc/execute *ctx* ["insert into t1 (k) values (?)" (myjson {:foo 1})])
-;;   (let [result (sc/fetch *ctx* "select * from t1")
-;;         result1 (first result)]
-;;     (println result1)))
-
 (deftest render-json
   (let [q (-> (dsl/insert-into :t1)
               (dsl/insert-values {:data (myjson {:foo 1})}))]
     (is (= (fmt/get-sql q {:dialect :pgsql :type :inlined})
            "insert into t1 (data) values ('{\"foo\":1}'::json)"))))

-;; (deftest inserting-json-dsl
-;;   (sc/execute *ctx* "create table t1 (data json)")
-;;   (let [q (-> (dsl/insert-into :t1)
-;;               (dsl/insert-values {:data (json {:foo 1})})
-;;               (dsl/insert-values {:data (json {:bar 2})}))]
-;;     (sc/execute *ctx* q))
-;;   (-> (sc/fetch *ctx* "select * from t1")
-;;       (println)))
+(deftype MyArray [data])

+(defn myintarray
+  [data]
+  (MyArray. data))

+(extend-protocol proto/IParamType
+  MyArray
+  (render [self]
+    (let [items (->> (map str (.-data self))
+                     (interpose ","))]
+      (str "{" (apply str items) "}")))

-;; (deftest json-select
-;;   (let [q (dsl/select (.as (json {:a 1}) "dd"))]
-;;     (-> (sc/fetch *ctx* q)
-;;         (println))))
+  (bind [self stmt index]
+    (let [con (.getConnection stmt)
+          arr (into-array Long (.-data self))
+          arr (.createArrayOf con "bigint" arr)]
+      (.setArray stmt index arr))))

+(extend-protocol proto/ISQLType
+  java.sql.Array
+  (convert [self]
+    (into [] (.getArray self))))

-;; (deftest inserting-arrays
-;;   (sc/execute *ctx* "create table t1 (data int[])")
-;;   (let [data [1 2 3]]
-;;     (sc/execute *ctx* ["insert into t1 (data) values (?)" data])
-;;   (let [data (into-array Integer (map int [1 2 3]))]
-;;     (sc/execute *ctx* ["insert into t1 (data) values (?::int[])" "{1,2,3}"])
-;;     (-> (sc/fetch *ctx* "select * from t1")
-;;         (println))))
+(deftest inserting-arrays
+  (sc/execute *ctx* "create table t1 (data bigint[])")
+  (let [data (myintarray [1 2 3])]
+    (sc/execute *ctx* ["insert into t1 (data) values (?)" data]))
+  (let [result (sc/fetch *ctx* "select * from t1")]
+    (is (= result [{:data [1 2 3]}]))))


Test for function user-href

Test for function user-href

--- test/zg/html_renderer_test.clj
+++ test/zg/html_renderer_test.clj
@@ -180,5 +180,12 @@
             nil               (tab-class true false)
             nil               (tab-class "word" "world"))))

+(deftest test-user-href
+    "Checking the function zg.html-renderer/user-href."
+    (testing "the function zg.html-renderer/user-href."
+        (are [x y] (= x y)
+            [:a {:href "user-whitelist?name=username"} "username"] (user-href "username" :whitelist)
+            [:a {:href "user-blacklist?name=username"} "username"] (user-href "username" :blacklist)
+            [:a {:href "user-whitelist?name=other-user"} "other-user"] (user-href "other-user" :whitelist)
+            [:a {:href "user-blacklist?name=other-user"} "other-user"] (user-href "other-user" :blacklist))))

-


prevent vuln due to using target _blank for links

--- src/braid/ui/views/message.cljs
+++ src/braid/ui/views/message.cljs
@@ -33,6 +33,9 @@
                [:a.external {:href match
                              :title match
                              :target "_blank"
+                             ; rel to address vuln caused by target=_blank
+                             ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
+                             :rel "noopener noreferrer"
                              :tabIndex -1}
                  (abridged-url match)])}
    :users


Clarified docstring.

Clarified docstring.

--- project/scrape-summitpost-data/src/scrape_summitpost_data/get_item_texts.clj
+++ project/scrape-summitpost-data/src/scrape_summitpost_data/get_item_texts.clj
@@ -42,7 +42,8 @@
 (defn get-item-texts
   "Given a link to a search results page from summitpost (i.e. relative to the
   summitpost domain), GET all search result items (iterating through
-  pagination) and return a sequence of [item-name, item-text] pairs."
+  pagination if present) and return a sequence of [item-name, item-text]
+  pairs."
   [search-link]
   (->> (get-urls search-link)
        (map #(vector


upgrade faraday to latest (#98)

upgrade faraday to latest (#98)

--- joplin.dynamodb/project.clj
+++ joplin.dynamodb/project.clj
@@ -7,4 +7,4 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [joplin.core "0.3.10-SNAPSHOT"]
-                 [com.taoensso/faraday "1.8.0"]])
+                 [com.taoensso/faraday "1.9.0"]])


Have data coming through!

Have data coming through!

--- libs/datreactor/src/dat/reactor.cljc
+++ libs/datreactor/src/dat/reactor.cljc
@@ -138,7 +138,7 @@
 (defn with-effects
   "Registers effects on the database value. This is the mode of communication for effect message which need to get processed."
   [effects db]
-  (log/debug "Calling with-effects:" effects)
+  (log/debug "Adding effects for effect-ids:" (map first effects))
   (with-meta
     db
     (update (meta db)
@@ -206,13 +206,13 @@
     (log/debug "Handler :dat.reactor/local-tx called.")
     (let [tx-report (d/with db tx-forms)]
       (with-effect
-        [::execute-tx-report-handler tx-report]
+        [::execute-tx-report-handlers! tx-report]
         (resolve-to app db [[::resolve-tx-report tx-report]])))))

 ;; Effects

 ;; For compatibility with DataScript handlers...
-(register-effect ::fire-tx-report-handlers!
+(register-effect ::execute-tx-report-handlers!
   (fn [app db [_ tx-report]]
     ;; Hmm... would be nice to get hese from where they happen
     (log/debug "Effect handler :dat.reactor/fire-tx-report-handlers! called.")


Tests now operational

Tests now operational

--- test/aeolian/parser_test.clj
+++ test/aeolian/parser_test.clj
@@ -39,11 +39,11 @@
               (fact "becomes :method when a method length metric is found"
                     (:type (parser/parse "/Notification.java#190 LL=13 ML=16")) => :method)

-              (future-fact "becomes :class when a class declaration line is found"
-                           (:type (parser/parse "/Notification.java#190 LL=13 ML=16")) => :class)
+              (fact "becomes :class when a class declaration line is found"
+                           (:type (parser/parse "/Notification.java#190 LL=13 MC=9")) => :class)

-              (future-fact "becomes :file when a file declaration line is found"
-                           (:type (parser/parse "/Notification.java#190 LL=13 ML=16")) => :file))
+              (fact "becomes :file when a file declaration line is found"
+                           (:type (parser/parse "/Notification.java#190 LL=13 FL=169")) => :file))

        (facts "the method length"
               (fact "can be found"


Minor changes on tests.

Minor changes on tests.

--- test/promesa/core_tests.cljc
+++ test/promesa/core_tests.cljc
@@ -29,26 +29,30 @@

        (t/is (= (p/extract p1) 1)))))

-;; (t/deftest promise-from-boolean-value
-;;   (let [p1 (p/promise true)]
-;;     (t/is (p/done? p1))
-;;     (t/is (= (p/extract p1) true))))
-
-;; (t/deftest promise-from-string-value
-;;   (let [p1 (p/promise "hello")]
-;;     (t/is (p/done? p1))
-;;     (t/is (= (p/extract p1) "hello"))))
-
-;; (t/deftest promise-from-nil-value
-;;   (let [p1 (p/promise nil)]
-;;     (t/is (p/done? p1))
-;;     (t/is (nil? (p/extract p1)))))
-
-;; (t/deftest promise-from-factory
-;;   (let [p1 (p/promise (fn [resolve _] (resolve 1)))]
-;;     #?(:clj (deref p1))
-;;     (t/is (p/done? p1))
-;;     (t/is (= (p/extract p1) 1))))
+(t/deftest promise-from-nil-value
+  #?(:cljs
+     (t/async done
+       (p/then (p/promise nil)
+               (fn [v]
+                 (t/is (= v nil))
+                 (done))))
+     :clj
+     @(p/then (p/promise nil)
+              (fn [v]
+                (t/is (= v nil))))))
+
+
+(t/deftest promise-from-factory
+  #?(:cljs
+     (t/async done
+       (-> (p/promise (fn [resolve _] (resolve 1)))
+           (p/then (fn [v]
+                     (t/is (= v 1))
+                     (done)))))
+     :clj
+     @(-> (p/promise (fn [resolve _] (resolve 1)))
+          (p/then (fn [v]
+                    (t/is (= v 1)))))))

 (t/deftest promise-async-factory
   #?(:cljs


Tidiness

Tidiness

--- test/user/t_parse_errors.clj
+++ test/user/t_parse_errors.clj
@@ -3,15 +3,15 @@
         midje.test-util))

 (unfinished f)
-
-;; Check expressions
-
-
+(defn g [n] (f n))
+
+
+;; ==================                            Check expressions

 (silent-fact (f 1) =>)
 (note-that parse-error-found (fact-failed-with-note #"has the wrong shape"))

-;; Prerequisites
+;; ===================                           In-fact Prerequisites

 (silent-fact "Certain functions that cannot be faked are detected at parse time"
   (f) => 1
@@ -47,7 +47,9 @@
   (f ..new-val..) => 0
   (provided
     g =contains=> {:a 3}))
-(note-that parse-error-found (fact-failed-with-note #"there's no metaconstant"))
+(note-that parse-error-found (fact-failed-with-note #"g is not a metaconstant"))
+
+

 ;; This can only be done approximately, since the right-hand-side could be a bound symbol,
 ;; a quoted form, etc.


[REFACTOR] Use destructuring

[REFACTOR] Use destructuring

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -120,10 +120,8 @@
   (let [departmentToFacultyIndexHash (aget AUXMODULES "departmentToFaculty")
         departmentStringsArray       (aget AUXMODULES "departments")]
     (doseq [[departmentIdxString facultyIdx]
-              (filter (fn [kv]
-                        (let [departmentIdx (int (first kv))
-                              facultyIdx    (second kv)]
-                          (not= departmentIdx facultyIdx)))
+              (filter (fn [[departmentIdx facultyIdx]]
+                        (not= (int departmentIdx) facultyIdx))
                       (js->clj departmentToFacultyIndexHash))]
       (let [departmentIdx    (int departmentIdxString)
             departmentString (nth departmentStringsArray departmentIdx)


Added link to GitHub in the menu

Added link to GitHub in the menu

--- src/cljs/cljs_webrepl/core.cljs
+++ src/cljs/cljs_webrepl/core.cljs
@@ -265,6 +265,9 @@
           [:ul.mdl-menu.mdl-menu--bottom-right.mdl-js-menu.mdl-js-ripple-effect
            {:for "main-menu"}
            [:li.mdl-menu__item
+            {:on-click #(set! (.-location js/window) "https://github.com/theasp/cljs-webrepl")}
+            "GitHub"]
+           [:li.mdl-menu__item
             {:on-click show-about-dialog}
             "About"]]]]]
        [history props]


Change which lambda is used

Change which lambda is used

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -61,10 +61,11 @@
             comic-list @comic-list]
         (when (and site comic-list)
           [:ul (map (id-btn-for-callback
-                     #(go-to (read-path {:site site
-                                         :comic (:id %)
-                                         :chapter 1
-                                         :page 1})))
+                     (fn [item]
+                       (go-to (read-path {:site site
+                                          :comic (:id item)
+                                          :chapter 1
+                                          :page 1}))))
                     comic-list)])))))

 (defn reader []


fix make-getter-name to preserve case in name

--- src/main/clojure/org/dada/core.clj
+++ src/main/clojure/org/dada/core.clj
@@ -128,13 +128,11 @@
 (defn make-instance [#^Class class & args]
   (clojure.lang.Reflector/invokeConstructor class (to-array args)))

-(require '[clojure.contrib.str-utils2 :as s])
-
 ;; TODO: how do we confirm that with-meta is doing the right thing for
 ;; both input and output types...

 (defn make-getter-name [#^String property-name]
-  (str "get" (s/capitalize property-name)))
+  (str "get" (.toUpperCase (.substring property-name 0 1)) (.substring property-name 1 (.length property-name))))

 (defn getter-2 [#^Class input-type #^Class output-type #^String method-name]
   (let [method-symbol (symbol (str "." method-name))


Play clusters.

Play clusters.

--- src/cljs/leipzig_live/core.cljs
+++ src/cljs/leipzig_live/core.cljs
@@ -45,7 +45,8 @@
     (swap! state assoc-in [:music] value)))

 (defn play []
-  (beep (:music @state)))
+  (doseq [freq (:music @state)]
+    (beep freq)))

 ;; -------------------------
 ;; Views


:fire:

:fire:

--- src/cljs/sloth/views/login.cljs
+++ src/cljs/sloth/views/login.cljs
@@ -3,7 +3,6 @@
   (:require [om.core :as om :include-macros true]
             [sablono.core :as html :refer-macros [html]]
             [cljs.core.async :refer [<!]]
-            [sloth.state :as st]
             [sloth.auth :as auth]
             [sloth.state :as st]
             [sloth.xmpp :as xmpp]


Wrapping in `Object` is a no-op.

Wrapping in `Object` is a no-op.

--- src/clojure/parkour/wrapper.clj
+++ src/clojure/parkour/wrapper.clj
@@ -63,21 +63,22 @@
   [& cs] `(do ~@(map auto-wrapper* cs)))

 (extend-protocol Wrapper
+  nil
+  (unwrap [wobj] nil)
+  (rewrap [wobj obj] nil)
+
+  Object
+  (unwrap [wobj] wobj)
+  (rewrap [wobj obj] obj)
+
   NullWritable
   (unwrap [wobj] nil)
   (rewrap [wobj obj] wobj)

-  nil
-  (unwrap [wobj] nil)
-  (rewrap [wobj obj] nil)
-
   Text
   (unwrap [wobj] (.toString wobj))
   (rewrap [wobj obj]
-    (returning wobj (.set wobj ^String obj)))
-
-  Object
-  (unwrap [wobj] wobj))
+    (returning wobj (.set wobj ^String obj))))

 (auto-wrapper
   IntWritable


Support unbounded recursive queries on query->props

--- src/com/wsscode/pathom/gen.cljc
+++ src/com/wsscode/pathom/gen.cljc
@@ -3,7 +3,8 @@
             [com.wsscode.pathom.core :as p]
             [com.wsscode.spec-inspec :as si]
             [clojure.test.check.generators :as gen]
-            [fulcro.client.primitives :as fp]))
+            [fulcro.client.primitives :as fp]
+            [clojure.walk :as walk]))

 (defn coll-spec?
   "Check if a given spec is a `coll-of` spec."
@@ -62,11 +63,19 @@
   (p/parser {::p/plugins [(p/env-plugin {::p/reader spec-gen-reader})]
              :mutate     (fn [_ k params] (println "Gen mutation called" k params))}))

+(defn bound-unbounded-recursions [query n]
+  (walk/postwalk
+    (fn [x]
+      (if (= x '...) n x))
+    query))
+
 (defn query->props
   "Generates data from a given query using the spec generators for the attributes."
   ([query] (query->props {} query))
   ([env query]
-   (parser env query)))
+   (parser env (-> query
+                   (p/remove-query-wildcard)
+                   (bound-unbounded-recursions (get env ::unbounded-recursion-gen-size 3))))))

 (defn comp->props
   "Generates from a given component using spec generators for the attributes."


CMR-2920 Add some additional fields to those stored in mock urs

--- mock-echo-app/src/cmr/mock_echo/api/urs.clj
+++ mock-echo-app/src/cmr/mock_echo/api/urs.clj
@@ -15,22 +15,31 @@
   "Processes a request to get a user."
   [context name]
   (if (urs-db/user-exists? context name)
-    (let [{:keys [username password email affiliation studyArea country phone firstName lastName organization]} (urs-db/get-user context name)]
+    (let [{:keys [username password email affiliation studyArea country phone firstName lastName
+                  organization userType address1 address2 address3 city state zip]}
+          (urs-db/get-user context name)]
       {:status 200 :body (str
                           "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
                            <user>
                             <accountCreatedDate>2003-08-24T00:00:00Z</accountCreatedDate>
-                            <accountStatus>ACTIVE</accountStatus>
-                            <affiliation>" affiliation "</affiliation>
-                            <country>" country "</country>
-                            <emailAddress>" email "</emailAddress>
-                            <firstName>" firstName "</firstName>
-                            <lastName>" lastName "</lastName>
-                            <studyArea>" studyArea "</studyArea>"
+                            <accountStatus>ACTIVE</accountStatus>"
+                            (if address1 (str "<address1>" address1 "</address1>"))
+                            (if address2 (str "<address2>" address2 "</address2>"))
+                            (if address3 (str "<address3>" address3 "</address3>"))
+                            (if affiliation (str "<affiliation>" affiliation "</affiliation>"))
+                            (if city (str "<city>" city "</city>"))
+                            (if country (str "<country>" country "</country>"))
+                            "<emailAddress>" email "</emailAddress>"
+                            (if firstName (str "<firstName>" firstName "</firstName>"))
+                            (if lastName (str "<lastName>" lastName "</lastName>"))
+                            (if state (str "<state>" state "</state>"))
+                            (if studyArea (str "<studyArea>" studyArea "</studyArea>"))
                             (if organization (str "<organization>" organization "</organization>"))
                             (if phone (str "<phone>" phone "</phone>"))
-                            "<userName>" username "</userName>
-                          </user>")
+                            "<userName>" username "</userName>"
+                            (if userType (str "<userType>" userType "</userType>"))
+                            (if zip (str "<zip>" zip "</zip>"))
+                          "</user>")
        :headers {"content-type" mt/xml}})
     {:status 404 :body "Not found.\n"}))

@@ -54,7 +63,14 @@
      :phone (cx/string-at-path parsed [:phone])
      :firstName (cx/string-at-path parsed [:firstName])
      :lastName (cx/string-at-path parsed [:lastName])
-     :organization (cx/string-at-path parsed [:organization])}))
+     :organization (cx/string-at-path parsed [:organization])
+     :userType (cx/string-at-path parsed [:userType])
+     :address1 (cx/string-at-path parsed [:address1])
+     :address2 (cx/string-at-path parsed [:address2])
+     :address3 (cx/string-at-path parsed [:address3])
+     :city (cx/string-at-path parsed [:city])
+     :state (cx/string-at-path parsed [:state])
+     :zip (cx/string-at-path parsed [:zip])}))

 (defn create-users-xml
   "Processes a request to create multiple users."


Clean up boilerplate based on code review

Issue #9
Pull request #32

--- src/obb_rules/game_progress.cljc
+++ src/obb_rules/game_progress.cljc
@@ -21,7 +21,7 @@
    stashes is an associative collection in which the keys correspond to the
    players and the values to the corresponding stash."
   [stashes & [{:as options} :as args]]
-  (-> (reduce-kv (fn [board player stash] (board/set-stash board player stash))
+  (-> (reduce-kv board/set-stash
                  (board/create-board)
                  stashes)
       (cond->


Window state thread should be started after playback

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -475,8 +475,8 @@
                               (lc/invoke-before-task-start (:onyx.core/compiled pipeline-data))
                               resolve-filter-state
                               resolve-log
-                              (start-window-state-thread! ex-f)
-                              replay-windows-from-log)]
+                              replay-windows-from-log
+                              (start-window-state-thread! ex-f))]

         (>!! outbox-ch (entry/create-log-entry :signal-ready {:id id}))


Use go blocks for minor threads, send seal-output command.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -1,5 +1,5 @@
 (ns ^:no-doc onyx.peer.task-lifecycle
-    (:require [clojure.core.async :refer [alts!! <!! >!! <! timeout chan close! thread go dropping-buffer]]
+    (:require [clojure.core.async :refer [alts!! <!! >!! <! >! timeout chan close! thread go dropping-buffer]]
               [com.stuartsierra.component :as component]
               [dire.core :as dire]
               [taoensso.timbre :refer [info warn trace] :as timbre]
@@ -167,10 +167,11 @@
   (merge event (l-ext/close-temporal-resources* event)))

 (defn release-messages! [messenger event]
-  (loop []
-    (when-let [id (<!! (:release-ch messenger))]
-      (p-ext/ack-message event id)
-      (recur))))
+  (go
+   (loop []
+     (when-let [id (<! (:release-ch messenger))]
+       (p-ext/ack-message event id)
+       (recur)))))

 (defn handle-exception [e restart-ch outbox-ch job-id]
   (warn e)
@@ -192,13 +193,16 @@
           (close-temporal-resources))
       (recur init-event))))

-(defn listen-for-sealer [init-event ch]
+(defn listen-for-sealer [job task init-event seal-ch outbox-ch]
   ;; TODO: only launch for output tasks
-  (try
-    (when (<!! ch)
-      (p-ext/seal-resource init-event))
-    (catch Exception e
-      (warn e))))
+  (go
+   (try
+     (when (<! seal-ch)
+       (p-ext/seal-resource init-event)
+       (let [entry (entry/create-log-entry :seal-output {:job job :task task})]
+         (>!! outbox-ch entry)))
+     (catch Exception e
+       (warn e)))))

 (defrecord TaskLifeCycle [id log messenger-buffer messenger job-id task-id replica restart-ch outbox-ch seal-resp-ch opts]
   component/Lifecycle
@@ -243,9 +247,9 @@
           (prn "Job not covered yet. Backing off and trying again")
           (Thread/sleep 2000))

-        (thread (release-messages! messenger pipeline-data))
+        (release-messages! messenger pipeline-data)
+        (listen-for-sealer job-id task-id pipeline-data seal-resp-ch outbox-ch)
         (thread (run-task-lifecycle pipeline-data kill-ch))
-        (thread (listen-for-sealer pipeline-data seal-resp-ch))

         (assoc component :pipeline-data pipeline-data :kill-ch kill-ch :seal-ch seal-resp-ch))
       (catch Exception e


Update copyright note of GUI

Update copyright note of GUI

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/gui/base.clj
+++ src/conexp/contrib/gui/base.clj
@@ -40,7 +40,7 @@
                                             (label :text "Graphical User Interface"
                                                    :size [300 :by 16]
                                                    :halign :center)
-                                            (label :text "ⓒ 2013 Daniel Borchmann"
+                                            (label :text "ⓒ 2013, 2014 Daniel Borchmann"
                                                    :size [300 :by 30]
                                                    :halign :center
                                                    :valign :bottom)])


use project folder name in web UI title

use project folder name in web UI title

--- src/main/shadow/cljs/devtools/server/web/common.clj
+++ src/main/shadow/cljs/devtools/server/web/common.clj
@@ -9,7 +9,7 @@

 (defn not-found
   ([req]
-    (not-found req "Not found."))
+   (not-found req "Not found."))
   ([req msg]
    {:status 404
     :headers {"content-type" "text/plain"}
@@ -36,7 +36,9 @@
       ;; lol preload for local dev
       [:link {:as "script" :href "/js/app.js" :rel "preload"}]
       [:link {:href "/img/shadow-cljs.png" :rel "icon" :type "image/png"}]
-      [:title "shadow-cljs"]
+      [:title (-> (io/file ".")
+                  (.getCanonicalFile)
+                  (.getName))]
       [:link {:rel "stylesheet" :href "/css/main.css"}]
       [:meta {:name "viewport" :content "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"}]]
      [:body {:class body-class}


DM/RS - #40 Get snap ci DB config from environment

--- src/d_cent/storage/database.clj
+++ src/d_cent/storage/database.clj
@@ -1,10 +1,12 @@
 (ns d-cent.storage.database
-  (:require [korma.db :as db]))
+  (:require [korma.db :as db]
+            [d-cent.config :as config]))

 (def postgres-spec (db/postgres {:db "dcent"
-                                 :user "dcent"
-                                 :password "development" ;TODO password management
-                                 :host "localhost"}))
+                                 :user (config/get-var "SNAP_DB_PG_USER" "dcent")
+                                 :password (config/get-var "SNAP_DB_PG_PASSWORD" "development") ;TODO password management
+                                 :host (config/get-var "SNAP_DB_PG_HOST" "localhost")
+                                 :port (config/get-var "SNAP_DB_PG_PORT" 5432)}))

 (defn connect!
   "Connect to the database described by the DB spec"


Update clj compiler to 1.8.0-RC4 in :1.8 profile.

--- profiles.clj
+++ profiles.clj
@@ -9,4 +9,4 @@
             [lein-ancient "0.6.7"]]}
  :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
  :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
- :1.8 {:dependencies [[org.clojure/clojure "1.8.0-beta2"]]}}
+ :1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC4"]]}}


Fix bug in sort fn w/ indexed board lookup.

--- src/oc/storage/resources/board.clj
+++ src/oc/storage/resources/board.clj
@@ -282,7 +282,7 @@

   (->> (into [primary-key :slug :name] additional-keys)
     (db-common/read-resources conn table-name index-key index-value)
-    (sort-by "slug")
+    (sort-by :slug)
     vec)))

 ;; ----- Armageddon -----


Add a split-n test

Add a split-n test

Checks that it's the same as a particular sequence of splits.

--- src/test/clojure/clojure/test/check/random_test.clj
+++ src/test/clojure/clojure/test/check/random_test.clj
@@ -75,3 +75,19 @@
                       steps)]
           (= (random/rand-long immutable-rng)
              (.nextLong mutable-rng)))))))
+
+(defspec split-n-spec 40
+  (prop/for-all [seed gen-seed
+                 n gen/nat]
+    (let [rng (random/make-random seed)]
+      ;; checking that split-n returns the same generators that we
+      ;; would get by doing a particular series of splits manually
+      (= (map random/rand-long (random/split-n rng n))
+         (map random/rand-long
+              (if (zero? n)
+                []
+                (loop [v [], rng rng]
+                  (if (= (dec n) (count v))
+                    (conj v rng)
+                    (let [[rng1 rng2] (random/split rng)]
+                      (recur (conj v rng2) rng1))))))))))


Guard container removal

Guard container removal

- Since boot reload doesn't own the DOM it can't assume that the
  container will exist.

--- src/adzerk/boot_reload/display.cljs
+++ src/adzerk/boot_reload/display.cljs
@@ -118,7 +118,9 @@
 (defn display [messages opts]
   (swap! current-container
          (fn [container]
-           (when container (remove-container! container))
+           (when container
+             (try (remove-container! container)
+                  (catch js/Error _)))
            (let [id (gen-id)]
              (insert-container! id messages)
              id))))


Fix typo

Fix typo

--- src/replme/components/docker.clj
+++ src/replme/components/docker.clj
@@ -8,15 +8,14 @@
   (start [component]
     (if (:client component)
       component
-      (do
-        (log/info (str "Connecting to docker server at " url))
-        (assoc component :client (docker/make-client url)))))
+      (do (log/info (str "Connecting to docker server at " url))
+          (assoc component :client (docker/make-client url)))))

   (stop [component]
     (if-not (:client component)
       component
-      (log/info "Disconnected from Docker")
-      (dissoc component :client))))
+      (do (log/info "Disconnected from Docker")
+          (dissoc component :client)))))

 (defn new-docker
   [url]


Updated Vim article

Updated Vim article

--- resources/fragments/onvim.clj
+++ resources/fragments/onvim.clj
@@ -8,8 +8,11 @@
       ]
   ", a version of Emacs that's been overhauled to operate like Vim."]

+ [:p "I've watched "[:a {:href "https://vimeo.com/53144573"} "Drew Neil's talk on Vim"] " and bought his book, which I'm still working throuh. I've run through the VimTutor more than once, in Vim and in Spacemacs, and I've used Spacemacs for real work (both client work and to build the static site generator that creates these pages)."]
  [:ul
-  [:li "The mouse is BAD (not if you've played video games all your life, it's not; first-person shooters are ALL ABOUT hitting arbitrary tiny targets fast, and I've been doing that for a decade or more for fun; and these days the touchpad on laptops is always in the same place, vastly reducing time needed to find & use it)"]
+  [:li "The mouse is BAD (not if you've played video games all your life, it's not; first-person shooters are ALL ABOUT hitting arbitrary tiny targets fast, and I've been doing that for a decade or more for fun; and these days the touchpad on laptops is always in the same place, vastly reducing time needed to find & use it). For example, Neil (around 33 minutes into his talk) talks about a notional touch interaction where you've to pick out the opening and closing brackets/tags/quotes of a section of text to highlight them. But who would suggest that?! There's already a great way of selecting the matching closing tag in a text using a mouse: double-click the opening (or closing) tag. IntelliJ does this, and I'm sure others do too. It works " [:emphasis "without"] " you having to even consider the type of tag and finding it's matching symbol on the keyboard. The v-a-t workflow Neil describes is " [:strong "great"] ", but made-up examples of poor alternatives don't sell it."]
   [:li "The cursor keys are BAD because... reasons?"]
-  [:li "Macros! Macros are the best. (Story about editing 23MB file here, long line lengths, v-a-t, automating in a macro)"]]]
+  [:li "Macros! Macros are the best. (Story about editing 23MB file here, long line lengths, v-a-t, automating in a macro)"]
+  [:li "Going backwards through text or shrinking text selections seems arbitrarily hard"]
+  [:li "The God-damned pound symbol (aka why I gave up on Emacs more than once)"]]]


Moved reliability threshold into let

Moved reliability threshold into let

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -80,19 +80,20 @@
       (:distinct false)))

 (defmapcatop tele-clean
-  "Return clean timeseries with telescoping window, nil if no good training data"
+  "Return clean timeseries with telescoping window, nil if no (or not enough) good training data"
   [{:keys [est-start est-end t-res]}
    good-set bad-set start-period val-ts reli-ts]
-  (let [freq (date/res->period-count t-res)
+  (let [reli-thresh 0.5
+        freq (date/res->period-count t-res)
         [start-idx end-idx] (date/relative-period t-res start-period
                                                   [est-start est-end])
         training-reli (take start-idx reli-ts)
         training-reli-set (set training-reli)
         clean-fn (comp vector (partial f/make-clean freq good-set bad-set))]
     (cond (f/reliable?
-           good-set 0.5 training-reli) (map clean-fn
-                                            (f/tele-ts start-idx end-idx val-ts)
-                                            (f/tele-ts start-idx end-idx reli-ts))
+           good-set reli-thresh training-reli) (map clean-fn
+                                                (f/tele-ts start-idx end-idx val-ts)
+                                                (f/tele-ts start-idx end-idx reli-ts))
           :else [[nil]])))

 (defn dynamic-clean


Re-align

Re-align

--- src/cljs/asciinema_player/core.cljs
+++ src/cljs/asciinema_player/core.cljs
@@ -8,14 +8,16 @@
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

 (defn make-player-state [snapshot]
-  (atom {:width 80
-   :height 24
-   :current-time 23
-   :duration 148.297910690308
-   :frames-url "/frames.json"
-   :font-size "small"
-   :theme "seti"
-   :lines snapshot }))
+  (atom {
+         :width 80
+         :height 24
+         :duration 148.297910690308
+         :frames-url "/frames.json"
+         :font-size "small"
+         :theme "seti"
+         :lines snapshot
+         :play-from 0
+         :current-time 23}))

 (defn apply-changes [state changes]
   (if-let [line-changes (seq (:lines changes))]
@@ -38,8 +40,8 @@

 (defn prev-changes [frames seconds]
   (loop [frames frames
-        seconds seconds
-        candidate nil]
+         seconds seconds
+         candidate nil]
     (let [[delay changes :as frame] (first frames)]
       (if (or (nil? frame) (< seconds delay))
         candidate
@@ -89,10 +91,10 @@
 (defn fetch-frames [state dispatch]
   (let [url (:frames-url state)]
     (GET
-      url
-      {:format :json
-       :handler #(dispatch [:frames-response %])
-       :error-handler #(dispatch [:bad-response %])})
+     url
+     {:format :json
+      :handler #(dispatch [:frames-response %])
+      :error-handler #(dispatch [:bad-response %])})
     (assoc state :loading true)))

 (defn new-position [current-time total-time offset]


Improve paredit behavior

Improve paredit behavior

--- src/clojure/paredit_widget/core.clj
+++ src/clojure/paredit_widget/core.clj
@@ -62,19 +62,23 @@
    [nil "\b"] :paredit-backward-delete
    [nil "DEL"] :paredit-forward-delete
    [nil "\""] :paredit-doublequote ;; \"
-   ; ["C" "K"] :paredit-kill
    ["M" "("] :paredit-wrap-round
-   ; ["M" ")"] :paredit-close-round-and-newline
    ["M" "s"] :paredit-splice-sexp
    ["M" "r"] :paredit-raise-sexp
+   ["C" "9"] :paredit-backward-slurp-sexp
    ["C" "0"] :paredit-forward-slurp-sexp
-   ["C" "9"] :paredit-backward-slurp-sexp
-   ["C" "Close Bracket"] :paredit-forward-barf-sexp
-   ["C" "Open Bracket"] :paredit-backward-barf-sexp
+   ["C" "["] :paredit-backward-barf-sexp
+   ["C" "]"] :paredit-forward-barf-sexp
    ["M" "S"] :paredit-split-sexp
    ["M" "J"] :paredit-join-sexps
-   ["M" "Right"] :paredit-expand-right
-   ["M" "Left"] :paredit-expand-left})
+   ["M" "Left"] :paredit-expand-left
+   ["M" "Right"] :paredit-expand-right})
+
+(def ^:const advanced-alternative-keymap
+  {[nil "⌫"] :paredit-backward-delete
+   [nil "⌦"] :paredit-forward-delete
+   ["M" "←"] :paredit-expand-left
+   ["M" "→"] :paredit-expand-right})

 (def ^:const foreign-keymap
   {["M" "["] :paredit-open-square
@@ -91,6 +95,7 @@
                           (default-keymap k))
                      (and @enable-advanced?
                           (or (advanced-keymap k)
+                              (advanced-alternative-keymap k)
                               (foreign-keymap k))))]
     (insert-result! w (exec-command! cmd w buffer))
     cmd))
@@ -104,9 +109,10 @@
        (.isAltDown event) "M"
        (.isControlDown event) "C"
        :else nil)
-     (if (= KeyEvent/CHAR_UNDEFINED key-char)
-       (KeyEvent/getKeyText key-code)
-       (str key-char))]))
+     (if (or (Character/isLetterOrDigit key-char)
+             (special-chars (str key-char)))
+       (str key-char)
+       (KeyEvent/getKeyText key-code))]))

 (defn key-event-handler
   [w buffer enable-default? enable-advanced?]


By default, use the abracad Avro data model.

--- src/clojure/parkour/graph/cstep.clj
+++ src/clojure/parkour/graph/cstep.clj
@@ -31,8 +31,10 @@
   (fn [^Job job]
     (doto job
       (.setJobName jname)
-      (conf/set! "mapreduce.task.classpath.user.precedence" true)
-      (.setJarByClass parkour.hadoop.Mappers))))
+      (.setJarByClass parkour.hadoop.Mappers)
+      (conf/assoc! #_job
+        "mapreduce.task.classpath.user.precedence" true
+        "avro.serialization.data.model" "abracad.avro.ClojureData"))))

 (defn step-map
   "Map of job configuration keys and values implemented by `step`."


[#12585] Clear modal's dissmissing state after reopening app with enabled background service

--- src/status_im/navigation/core.cljs
+++ src/status_im/navigation/core.cljs
@@ -179,6 +179,8 @@
 (defonce rset-app-launched
   (.registerAppLaunchedListener (.events Navigation)
                                 (fn []
+                                  (reset! curr-modal false)
+                                  (reset! dissmissing false)
                                   (if (or (= @root-id :multiaccounts) (= @root-id :multiaccounts-keycard))
                                     (re-frame/dispatch-sync [::set-multiaccount-root])
                                     (when @root-id


Update ja.cljs

Update ja.cljs

--- src/status_im/translations/ja.cljs
+++ src/status_im/translations/ja.cljs
@@ -4,36 +4,51 @@
   {
    ;common
    :members-title                         "メンバー"
-   :not-implemented                       "！実装されていません"
+   :not-implemented                       "実装されていません"
    :chat-name                             "チャット名"
    :notifications-title                   "通知と音声"
    :offline                               "オフライン"
+   :search-for                            "検索..."
+   :cancel                                "キャンセル"
+   :next                                  "次へ"
+   :type-a-message                        "メッセージを入力する..."
+   :type-a-command                        "コマンドを入力する..."
+   :error                                 "エラー"
+
+   :camera-access-error                   "カメラを利用できません。設定よりカメラの使用を許可してください。"
+   :photos-access-error                   "写真を取得できません。設定より写真へのアクセスを許可してください。"

    ;drawer
    :invite-friends                        "友だちを招待"
    :faq                                   "よくある質問"
-   :switch-users                          "ユーザーを切り替え"
+   :switch-users                          "ユーザーの切り替え"
+   :feedback                              "フィードバックがある場合はスマホを振って下さい！"
+   :view-all                              "全て見る"
+   :current-network                       "現在のネットワーク"

    ;chat
-   :is-typing                             "タイプ中です"
-   :and-you                               "そしてあなた"
+   :is-typing                             "が入力中"
+   :and-you                               "とあなた"
    :search-chat                           "チャットを検索"
    :members                               {:one   "1人のメンバー"
                                            :other "{{count}}人のメンバー"
                                            :zero  "メンバーがいません"}
-   :members-active                        {:one   "1人のメンバー、1人がアクティブ"
-                                           :other "{{count}}人のメンバー、{{count}}人がアクティブ"
-                                           :zero  "メンバーがいません"}
+   :members-active                        {:one   "1人がアクティブ"
+                                           :other "{{count}}人がアクティブ"
+                                           :zero  "アクティブなメンバーはいません"}
+   :public-group-status                   "公開"
    :active-online                         "オンライン"
    :active-unknown                        "不明"
    :available                             "利用可能"
    :no-messages                           "メッセージがありません"
    :suggestions-requests                  "リクエスト"
    :suggestions-commands                  "コマンド"
+   :faucet-success                        "フォーセットリクエストを受け取りました"
+   :faucet-error                          "フォーセットリクエストエラー"

    ;sync
    :sync-in-progress                      "同期中..."
-   :sync-synced                           "同期しています"
+   :sync-synced                           "同期しました"

    ;messages
    :status-sending                        "送信中"
@@ -45,6 +60,7 @@
    :status-failed                         "失敗しました"

    ;datetime
+   :datetime-ago-format                   "{{number}} {{time-intervals}} {{ago}}"
    :datetime-second                       {:one   "秒"
                                            :other "秒"}
    :datetime-minute                       {:one   "分"
@@ -53,13 +69,14 @@
                                            :other "時間"}
    :datetime-day                          {:one   "日"
                                            :other "日"}
-   :datetime-multiple                     "秒"
+   :datetime-multiple                     ""
    :datetime-ago                          "前"
    :datetime-yesterday                    "昨日"
    :datetime-today                        "今日"

    ;profile
    :profile                               "プロフィール"
+   :edit-profile                          "プロフィールを編集"
    :report-user                           "ユーザーを通報"
    :message                               "メッセージ"
    :username                              "ユーザー名"
@@ -67,44 +84,78 @@
    :public-key                            "公開鍵"
    :phone-number                          "電話番号"
    :email                                 "メールアドレス"
-   :profile-no-status                     "ステータスがありません"
+   :update-status                         "ステータスを更新..."
+   :add-a-status                          "ステータスを追加..."
+   :status-prompt                         "あなたのオファーを知らせるためにステータスを作成してください。#hashtagsも使用できます。"
    :add-to-contacts                       "連絡先に追加"
+   :in-contacts                           "連絡先"
+   :remove-from-contacts                  "連絡先から削除"
+   :start-conversation                    "会話を始める"
+   :send-transaction                      "トランザクションを送信"
+   :share-qr                              "QRを共有"
    :error-incorrect-name                  "別の名前を選択してください"
-   :error-incorrect-email                 "間違ったメールアドレス"
+   :error-incorrect-email                 "メールアドレスが正しくありません"

    ;;make_photo
    :image-source-title                    "プロフィール画像"
-   :image-source-make-photo               "キャプチャ"
+   :image-source-make-photo               "カメラを起動"
    :image-source-gallery                  "ギャラリーから選択"
    :image-source-cancel                   "キャンセル"
+
+   ;;sharing
+   :sharing-copy-to-clipboard             "クリップボードにコピー"
+   :sharing-share                         "共有..."
+   :sharing-cancel                        "キャンセル"
+
+   :browsing-title                        "閲覧"
+   :browsing-browse                       "@閲覧"
+   :browsing-open-in-web-browser          "ブラウザーで閲覧"
+   :browsing-cancel                       "キャンセル"

    ;sign-up
    :contacts-syncronized                  "連絡先が同期されました"
    :confirmation-code                     (str "ありがとうございます！ 確認コードが記載されたメッセージが"
                                                "送信されました。電話番号を確認するにはそのコードを入力してください")
-   :incorrect-code                        (str "申し訳ありませんがコードが間違っています。もう一度入力してください")
-   :generate-passphrase                   (str "パスフレーズを生成してアクセスを復元したり、"
-                                               "別のデバイスからログインしたりすることができます")
+   :incorrect-code                        (str "申し訳ありません。コードが間違っています。もう一度入力してください")
+   :generate-passphrase                   (str "パスフレーズを生成すると、アクセスを復元したり、"
+                                               "別のデバイスからログインしたりすることができます。")
    :phew-here-is-your-passphrase          "*お疲れ様でした。*これがパスフレーズです。*書き留めて安全な場所に保管してください！*アカウントの復元に必要になります。"
    :here-is-your-passphrase               "これがパスフレーズです。*書き留めて安全な場所に保管してください！*アカウントの復元に必要になります。"
    :written-down                          "書き留めて安全な場所に保管してください。"
    :phone-number-required                 "ここをタップして電話番号を入力するとお友達を検索します。"
+   :shake-your-phone                      "問題点や改善点を報告する場合は、スマホを振って下さい！"
    :intro-status                          "チャットしてアカウントを設定し、設定を変更してください！"
-   :intro-message1                        "ステータスにようこそ\nこのメッセージをタップしてパスワードを設定して開始しましょう！"
-   :account-generation-message            "少々お待ちください。アカウントを生成するには複雑な計算が必要です！"
+   :intro-message1                        "ステータスにようこそ\nこのメッセージをタップして、パスワードを設定し開始しましょう！"
+   :account-generation-message            "少々お待ちください。アカウントの生成するにはお時間がかかります。"
+   :move-to-internal-failure-message      "いくつかの重要なファイルを外部メディアに保存します。続行するには、許可が必要です。（将来的には外部メディアを使用しないようにします。）"
+   :debug-enabled                         "デバッグサーバーを起動しました！ *status-dev-cli scan*を実行すると、同じネットワーク上のコンピュータからサーバーを見つけることができます。"
+
+   ;phone types
+   :phone-e164                            "国際 1"
+   :phone-international                   "国際 2"
+   :phone-national                        "国内"
+   :phone-significant                     "Significant"

    ;chats
    :chats                                 "チャット"
    :new-chat                              "新規チャット"
+   :delete-chat                           "チャットを削除"
    :new-group-chat                        "新規グループチャット"
+   :new-public-group-chat                 "公開チャットに参加"
+   :edit-chats                            "チャットを偏執"
+   :search-chats                          "チャットを検索"
+   :empty-topic                           "空のトピック"
+   :topic-format                          "間違った形式 [a-z0-9\\-]+"
+   :public-group-topic                    "トピック"

    ;discover
-   :discover                             "発見"
+   :discover                              "発見"
    :none                                  "なし"
    :search-tags                           "ここに検索タグを入力してください"
    :popular-tags                          "人気のタグ"
    :recent                                "最近"
-   :no-statuses-discovered                "ステータスが見つかりませんでした"
+   :no-statuses-discovered                "ステータスを発見できませんでした"
+   :no-statuses-found                     "ステータスが見つかりませんでした"

    ;settings
    :settings                              "設定"
@@ -112,21 +163,32 @@
    ;contacts
    :contacts                              "連絡先"
    :new-contact                           "新規連絡先"
+   :delete-contact                        "連絡先を削除"
+   :delete-contact-confirmation           "連絡帳よりこの連絡先を削除します"
+   :remove-from-group                     "グループから削除"
+   :edit-contacts                         "連絡先を偏執"
+   :search-contacts                       "連絡先を検索"
    :show-all                              "全て表示"
    :contacts-group-dapps                  "ÐApps"
    :contacts-group-people                 "人々"
    :contacts-group-new-chat               "新規チャットを開始"
+   :choose-from-contacts                  "連絡先から選択"
    :no-contacts                           "まだ連絡先がありません"
    :show-qr                               "QRを表示"
+   :enter-address                         "アドレスを入力してください"
+   :more                                  "もっと"

    ;group-settings
    :remove                                "削除"
    :save                                  "保存"
+   :delete                                "削除"
    :change-color                          "色を変更"
-   :clear-history                         "履歴を消去"
-   :delete-and-leave                      "削除して閉じる"
+   :clear-history                         "履歴の消去"
+   :mute-notifications                    "お知らせをミュート"
+   :leave-chat                            "チャットから退出"
+   :delete-and-leave                      "削除し退出する"
    :chat-settings                         "チャット設定"
-   :edit                                  "編集"
+   :edit                                  "偏執"
    :add-members                           "メンバーを追加"
    :blue                                  "ブルー"
    :purple                                "パープル"
@@ -139,7 +201,7 @@
    :phone-command-description             "電話番号を送信"
    :phone-request-text                    "電話番号をリクエスト"
    :confirmation-code-command-description "確認コードを送信"
-   :confirmation-code-request-text        "確認コードリクエスト"
+   :confirmation-code-request-text        "確認コードをリクエスト"
    :send-command-description              "位置を送信"
    :request-command-description           "リクエストを送信"
    :keypair-password-command-description  ""
@@ -151,9 +213,18 @@

    ;new-group
    :group-chat-name                       "チャット名"
-   :empty-group-chat-name                 "名前を入力してください"
-   :illegal-group-chat-name               "別の名前を選択してください"
-
+   :empty-group-chat-name                 "名前を入力して下さい"
+   :illegal-group-chat-name               "別の名前を洗濯して下さい"
+   :new-group                             "新しいグループ"
+   :reorder-groups                        "グループを並び替え"
+   :group-name                            "グループ名"
+   :edit-group                            "グループを偏執"
+   :delete-group                          "グループを削除"
+   :delete-group-confirmation             "このグループを削除します。連絡先には影響を与えません。"
+   :delete-group-prompt                   "連絡先には影響を与えません。"
+   :group-members                         "グループメンバー"
+   :contact-s                             {:one   "連絡先"
+                                           :other "連絡先"}
    ;participants
    :add-participants                      "参加者を追加"
    :remove-participants                   "参加者を削除"
@@ -170,13 +241,15 @@
    :add-new-contact                       "新規連絡先を追加"
    :import-qr                             "インポート"
    :scan-qr                               "QRをスキャン"
+   :swow-qr                               "QRを表示"
    :name                                  "名前"
-   :whisper-identity                      "Whisper Identity"
-   :address-explication                   "ここにアドレスについての説明やどこで見つけられるのかを入力してください"
+   :whisper-identity                      "Whisper識別子"
+   :address-explication                   "ここにアドレスについての説明や、どこで見つけられるのかを入力してください"
    :enter-valid-address                   "有効なアドレスを入力するかQRコードをスキャンしてください"
+   :enter-valid-public-key                "有効な公開鍵を入力するかQRコードをスキャンしてください"
    :contact-already-added                 "連絡先はすでに追加されています"
    :can-not-add-yourself                  "自分自身を追加することはできません"
-   :unknown-address                       "不明のアドレス"
+   :unknown-address                       "不明なアドレス"

    ;login
@@ -184,23 +257,27 @@
    :address                               "アドレス"
    :password                              "パスワード"
    :login                                 "ログイン"
+   :sign-in-to-status                     "ステータスにサインイン"
+   :sign-in                               "サインイン"
    :wrong-password                        "パスワードが間違っています"

    ;recover
    :recover-from-passphrase               "パスフレーズから復元"
-   :recover-explain                       "パスワードのためにパスフレーズを入力してアクセスを復元してください"
+   :recover-explain                       "アクセスを復元するには、パスワードのパスフレーズを入力してください"
    :passphrase                            "パスフレーズ"
    :recover                               "復元"
    :enter-valid-passphrase                "パスフレーズを入力してください"
    :enter-valid-password                  "パスワードを入力してください"
+   :twelve-words-in-correct-order         "正しい順序で12ワード"

    ;accounts
    :recover-access                        "アクセスを復元"
    :add-account                           "アカウントを追加"
+   :create-new-account                    "新規アカウントを作成"

    ;wallet-qr-code
    :done                                  "完了"
-   :main-wallet                           "主要のウォレット"
+   :main-wallet                           "メインウォレット"

    ;validation
    :invalid-phone                         "無効な電話番号"
@@ -208,15 +285,30 @@
    :not-enough-eth                        (str "十分なETH残高がありません"
                                                "({{balance}} ETH)")
    ;transactions
+   :confirm                               "確認"
    :confirm-transactions                  {:one   "トランザクションを確認"
                                            :other "{{count}}トランザクションを確認"
                                            :zero  "トランザクションがありません"}
+   :transactions-confirmed                {:one   "トランザクションを確認済み"
+                                           :other "{{count}}トランザクションを確認済み"
+                                           :zero  "確認済みトランザクションはありません"}
+   :transaction                           "トランザクション"
+   :unsigned-transactions                 "署名されていないトランザクション"
+   :no-unsigned-transactions              "署名されていないトランザクションはありません"
+   :enter-password-transactions           {:one   "パスワードを入力してトランザクションを確認する"
+                                           :other "パスワードを入力してトランザクションを確認する"}
    :status                                "ステータス"
-   :pending-confirmation                  "確認が保留中です"
+   :pending-confirmation                  "確認作業が保留中です"
    :recipient                             "受信者"
-   :one-more-item                         "さらに一つの項目"
+   :one-more-item                         "もう一つの項目"
    :fee                                   "手数料"
+   :estimated-fee                         "予想される手数料"
    :value                                 "値"
+   :to                                    "宛先"
+   :from                                  "送信元"
+   :data                                  "データ"
+   :got-it                                "理解しました"
+   :contract-creation                     "契約作成"

    ;:webview
    :web-view-error                        "おっと、エラーが発生しました。"})


Update Bahasa Malaysia translation

Update Bahasa Malaysia translation

Translated the new added/fixed strings on the tracked en.cljs following commit https://github.com/status-im/status-react/commit/5051d1ce9e3e7acae6266827092db735c0e31443 and https://github.com/status-im/status-react/commit/41ee6bfa89f4ea8bb98ea52565bc07da317b05c8 plus properly translated the word `Wallet`.

--- src/status_im/translations/ms.cljs
+++ src/status_im/translations/ms.cljs
@@ -202,7 +202,7 @@
    :phone-request-text                    "Permintaan nombor telefon"
    :confirmation-code-command-description "Hantar kod pengesahan"
    :confirmation-code-request-text        "Permintaan kod pengesahan"
-   :send-command-description              "Hantar lokasi"
+   :send-command-description              "Hantar arahan"
    :request-command-description           "Hantar permintaan"
    :keypair-password-command-description  ""
    :help-command-description              "Bantuan"
@@ -210,6 +210,16 @@
    :chat-send-eth                         "{{amount}} ETH"
    :chat-send-eth-to                      "{{amount}} ETH ke {{chat-name}}"
    :chat-send-eth-from                    "{{amount}} ETH dari {{chat-name}}"
+
+   ;location command
+   :your-current-location                 "Lokasi terkini anda"
+   :places-nearby                         "Tempat berhampiran"
+   :search-results                        "Hasil carian"
+   :dropped-pin                           "Pin dilepaskan"
+   :location                              "Lokasi"
+   :open-map                              "Buka peta"
+   :sharing-copy-to-clipboard-address     "Salin alamat"
+   :sharing-copy-to-clipboard-coordinates "Salin koordinat"

    ;new-group
    :group-chat-name                       "Nama perbualan"
@@ -277,7 +287,7 @@

    ;wallet-qr-code
    :done                                  "Selesai"
-   :main-wallet                           "Wallet utama"
+   :main-wallet                           "Dompet utama"

    ;validation
    :invalid-phone                         "Nombor telefon salah"


yo dawg

yo dawg

--- src/vignette/util/filesystem.clj
+++ src/vignette/util/filesystem.clj
@@ -9,7 +9,7 @@
 (declare file-exists?)

 (def temp-file-location (or (env :vignette-temp-file-location)
-                            "/tmp/vignette/_temp"))
+                            "/tmp/vignette"))

 (defn create-local-path
   [path]


fixed wrong boolean cli argument parsing

--- src/ctia/task/migrate_es_stores.clj
+++ src/ctia/task/migrate_es_stores.clj
@@ -201,6 +201,6 @@
   (migrate-store-indexes prefix
                          (map keyword (string/split migrations #","))
                          (read-string batch-size)
-                         (boolean (or confirm? false)))
+                         (or (boolean (read-string confirm?)) false))
   (log/info "migration complete")
   (System/exit 0))


Hide tooltip on click

Hide tooltip on click

--- src/discuss/components/tooltip.cljs
+++ src/discuss/components/tooltip.cljs
@@ -72,6 +72,6 @@
                          " Speichern")
                (vlib/safe-space) "  " (vlib/safe-space)
                (dom/span #js {:className "pointer"
-                              :onClick   sidebar/show}
+                              :onClick   (fn [] (sidebar/show) (hide))}
                          (vlib/fa-icon "fa-comment")
                          " Zeige Discuss")))))