util/hadoop.clj: added reporter & counter

--- src/org/altlaw/util/hadoop.clj
+++ src/org/altlaw/util/hadoop.clj
@@ -17,6 +17,12 @@

 (import-hadoop)

+(declare *reporter*)
+
+(defn counter
+  ([name] (.incrCounter *reporter* (name (ns-name *ns*)) name 1))
+  ([group name] (.incrCounter *reporter* group name 1)))
+
 (defn default-jobconf [this]
   (let [conf (.getConf this)
         job (JobConf. conf (.getClass this))]
@@ -27,7 +33,7 @@
     (.setInputFormat job SequenceFileInputFormat)
     (.setOutputFormat job SequenceFileOutputFormat)
     (SequenceFileOutputFormat/setOutputCompressionType job SequenceFile$CompressionType/BLOCK)
-    (.setOutputKeyClass job IntWritable)
+    (.setOutputKeyClass job Text)
     (.setOutputValueClass job Text)
     job))

@@ -78,25 +84,25 @@
   [stage corpus]
   (str (job-path stage corpus) "/docids.tsv.gz"))

-(defn standard-map [this wkey wvalue output reporter]
+(defn standard-map [map-fn this wkey wvalue output reporter]
   (let [key (read-string (str wkey))
         value (read-string (str wvalue))]
     (log/debug "Mapper input: " (pr-str key)
                " => " (log/logstr value))
     (binding [*reporter* reporter]
-      (doseq [[key value] (my-map key value)]
+      (doseq [[key value] (map-fn key value)]
         (log/debug "Mapper OUTPUT: " (pr-str key)
                    " => " (log/logstr value))
         (.collect output (Text. (pr-str key))
                   (Text. (pr-str value)))))))

-(defn standard-reduce [this wkey wvalues-iter output reporter]
+(defn standard-reduce [reduce-fn this wkey wvalues-iter output reporter]
   (let [key (read-string (str wkey))
         values (map #(read-string (str %)) (iterator-seq wvalues-iter))]
     (log/debug "Reducer input: " (pr-str key)
                " => " (log/logstr values))
     (binding [*reporter* reporter]
-      (doseq [[key value] (my-reduce key value)]
+      (doseq [[key value] (reduce-fn key values)]
         (log/debug "Reducer OUTPUT: " (pr-str key)
                    " => " (log/logstr value))
         (.collect output (Text. (pr-str key))


Modified implementation of n-members count of group-votes

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -295,12 +295,12 @@
                                          (mapv #(((votes-base tid) vote) %))
                                          (apply +)))]
                                [id
-                                {:n-members (reduce + 0
+                                {:n-members (let [bids (set members)]
                                               ; Add up the count of members in each base-cluster in this group-cluster
-                                              (map (fn [bid]
-                                                     (count (:members
-                                                         (first (filter (fn [x] (= bid (:id x))) base-clusters)))))
-                                                   members))
+                                              (->> base-clusters
+                                                   (filter #(bids (:id %)))
+                                                   (map #(count (:members %)))
+                                                   (reduce + 0)))
                                  :votes (plmb/map-from-keys
                                           (fn [tid]
                                             {:A (count-fn tid :A)


(RE-8861) Pretty print json output

(RE-8861) Pretty print json output

--- src/puppetlabs/ezbake/core.clj
+++ src/puppetlabs/ezbake/core.clj
@@ -731,7 +731,7 @@
                   "version" (get-git-sha)
                   "build_time" (local-time/format-local-time (local-time/local-now) :basic-date-time)
                   "components" deps}
-        json-string (json/generate-string metadata)]
+        json-string (json/generate-string metadata {:pretty true})]
     (io/make-parents (fs/file staging-dir "ext" "build_metadata.json"))
     (spit (fs/file staging-dir "ext" "build_metadata.json") json-string)))


fix clear history

fix clear history

Signed-off-by: yenda <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>

--- src/status_im/chat/events.cljs
+++ src/status_im/chat/events.cljs
@@ -100,7 +100,7 @@
 (handlers/register-handler-fx
  :clear-history
  (fn [{{:keys [current-chat-id]} :db :as cofx} _]
-   (models/clear-history current-chat-id cofx)))
+   (models/clear-history cofx current-chat-id)))

 (handlers/register-handler-fx
  :clear-history?


[#13059] 'Cannot read property' error on scanning invalid key

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/router/core.cljs
+++ src/status_im/router/core.cljs
@@ -69,14 +69,15 @@

 (defn match-contact-async
   [chain {:keys [user-id]} callback]
-  (let [valid-key   (and (spec/valid? :global/public-key user-id)
-                         (not= user-id ens/default-key))]
+  (let [valid-key (and (spec/valid? :global/public-key user-id)
+                       (not= user-id ens/default-key))]
     (cond
       (and valid-key)
       (callback {:type       :contact
                  :public-key user-id})

-      (and (not valid-key) (string? user-id))
+      (and (not valid-key) (string? user-id) (not (string/blank? user-id))
+           (not= user-id "0x"))
       (let [registry   (get ens/ens-registries chain)
             ens-name   (resolver/ens-name-parse user-id)
             on-success #(match-contact-async chain {:user-id %} callback)]


implement figwheel system for :dev

implement figwheel system for :dev

--- dev/src/clj/user.clj
+++ dev/src/clj/user.clj
@@ -6,9 +6,47 @@

 (def system nil)

+(defrecord Figwheel [config server]
+  component/Lifecycle
+  (start [this]
+    (if server
+      this
+      (let [server (ra/start-figwheel! config)]
+        (assoc this :server server))))
+  (stop [this]
+    (if-not server
+      this
+      (do
+        (ra/stop-figwheel!)
+        (assoc this :server nil)))))
+
+(def figwheel-config
+  {:figwheel-options {:http-server-root "public"       ;; serve static assets from resources/public/
+                      :server-port 3449                ;; default
+                      :server-ip "127.0.0.1"           ;; default
+                       :css-dirs ["resources/public/css"]
+                      :ring-handler 'om-next-leaflet.server/app
+                      :server-logfile "log/figwheel.log"
+                      :nrepl-middleware ['cemerick.piggieback/wrap-cljs-repl]}
+   :build-ids ["dev"]
+   :all-builds
+   [{:id "dev"
+     :figwheel true
+     :source-paths ["src/cljs" "dev/src/cljs"]
+     :compiler {:main 'om-next-leaflet.dev
+                :asset-path "js"
+                :output-to "resources/public/js/main.js"
+                :output-dir "resources/public/js"
+                :verbose true}}]})
+
+(defn create-system
+  []
+  (component/system-map
+   :figwheel (map->Figwheel {:config figwheel-config})))
+
 (defn init []
   (alter-var-root #'system
-    (constantly (om-next-leaflet.server/create-system {:port 3000}))))
+    (constantly (create-system))))

 (defn start []
   (alter-var-root #'system component/start))
@@ -26,22 +64,4 @@
   (refresh :after 'user/go))

 (defn browser-repl []
-  (ra/start-figwheel!
-   {:figwheel-options {:http-server-root "public"       ;; serve static assets from resources/public/
-                       :server-port 3449                ;; default
-                       :server-ip "127.0.0.1"           ;; default
-                       :css-dirs ["resources/public/css"]
-                       :ring-handler 'om-next-leaflet.server/app
-                       :server-logfile "log/figwheel.log"
-                       :nrepl-middleware ['cemerick.piggieback/wrap-cljs-repl]}
-    :build-ids ["dev"]
-    :all-builds
-    [{:id "dev"
-      :figwheel true
-      :source-paths ["src/cljs" "dev/src/cljs"]
-      :compiler {:main 'om-next-leaflet.dev
-                 :asset-path "js"
-                 :output-to "resources/public/js/main.js"
-                 :output-dir "resources/public/js"
-                 :verbose true}}]})
   (ra/cljs-repl))


rm bad ns pfx

rm bad ns pfx

--- tasklib/src/migae/boot_gae.clj
+++ tasklib/src/migae/boot_gae.clj
@@ -550,4 +550,4 @@
 (boot/deftask watch
   "watch for gae project"
   []
-  (comp (watch) (gae/clj-cp) (target :no-clean)))
+  (comp (watch) (clj-cp) (target :no-clean)))


+(deftest latin)

+(deftest latin)

--- test/babel/test/translate.cljc
+++ test/babel/test/translate.cljc
@@ -66,3 +66,24 @@

     (= "they (♂) went" english)))

+(deftest latin
+  (let [latin "ardebam"
+        latin-structure
+        (-> latin
+            babel.latin/parse
+            first
+            :parses
+            first)
+
+        semantics
+        (-> latin-structure
+            (get-in [:synsem :sem])
+            strip-refs)
+
+        english-structure
+        (->  {:synsem {:sem semantics}}
+             (babel.english/generate :model en/small))
+
+        english (babel.english.morphology/fo english-structure)]
+
+    (= "I was burning" english)))


[#2634] Logging error-data in transformation failed results

--- backend/src/akvo/lumen/lib/transformation/engine.clj
+++ backend/src/akvo/lumen/lib/transformation/engine.clj
@@ -146,10 +146,10 @@
   (let [dataset-version (db.transformation/latest-dataset-version-by-dataset-id tenant-conn {:dataset-id dataset-id})
         previous-columns (vec (:columns dataset-version))
         source-table (:table-name dataset-version)]
-    (let [{:keys [success? message columns execution-log]}
+    (let [{:keys [success? message columns execution-log error-data]}
           (try-apply-operation deps source-table previous-columns (assoc transformation :dataset-id dataset-id))]
       (when-not success?
-        (log/errorf "Failed to transform: %s, columns: %s, execution-log: %s" message columns execution-log)
+        (log/errorf "Failed to transform: %s, columns: %s, execution-log: %s, data: %s" message columns execution-log error-data)
         (throw (ex-info (or message "") {})))
       (let [new-dataset-version-id (str (util/squuid))]
         (db.transformation/clear-dataset-version-data-table tenant-conn {:id (:id dataset-version)})


Support Shift+moving up and right on Push 2.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -2175,18 +2175,18 @@

     45 ; Right arrow, scroll right in cue grid
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        ;; TODO: Shift to scroll all the way; also add shift support in web UI and other controllers
-        (when (> (- (controllers/grid-width (:cue-grid (:show controller))) x) 7)
-          (move-origin controller [(+ x 8) y])
+      (let [[x y] @(:origin controller)
+            width (max (controllers/grid-width (:cue-grid (:show controller))) 1)]
+        (when (> (- width x) 7)
+          (move-origin controller [(if (in-mode? controller :shift) (* 8 (quot (dec width) 8)) (+ x 8)) y])
           (add-button-held-feedback-overlay controller (:right-arrow control-buttons)))))

     46 ; Up arrow, scroll up in cue grid
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        ;; TODO: Shift to scroll all the way; also add shift support in web UI and other controllers
-        (when (> (- (controllers/grid-height (:cue-grid (:show controller))) y) 7)
-          (move-origin controller [x (+ y 8)])
+      (let [[x y] @(:origin controller)
+            height (max (controllers/grid-height (:cue-grid (:show controller))) 1)]
+        (when (> height 7)
+          (move-origin controller [x (if (in-mode? controller :shift) (* 8 (quot (dec height) 8))  (+ y 8))])
           (add-button-held-feedback-overlay controller (:up-arrow control-buttons)))))

     47 ; Down arrow, scroll down in cue grid


Remove extraneous old Push code.

Remove extraneous old Push code.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -1577,10 +1577,6 @@
                                    (captured-controls [this] #{note (inc note)})
                                    (captured-notes [this] #{})
                                    (adjust-interface [this _]
-                                     (write-display-cell controller 0 x "")
-                                     (write-display-cell controller 1 x "Ending:")
-                                     (write-display-cell controller 2 x (or (:name (:cue info)) (:name effect)))
-                                     (write-display-cell controller 3 x "")
                                      (swap! (:next-top-pads controller) assoc (* 2 x) red-color)
                                      (swap! (:next-top-pads controller) assoc (inc (* 2 x)) off-color)
                                      true)


basic rendering

basic rendering

--- src/clj/leiningen/midje_doc/run/renderer.clj
+++ src/clj/leiningen/midje_doc/run/renderer.clj
@@ -94,7 +94,11 @@
          output))]

     :exercice
-    [:div "exercice"]
+    [:div "exercice // TODO RENDERING"
+     [:pre (-> (:content elem)
+               str
+               (basic-html-escape))]
+     ]

     (throw (Exception. (str "not matching clause on " elem)))


whitespace

whitespace

--- src/clojure/zensols/nlparse/feature/lang.clj
+++ src/clojure/zensols/nlparse/feature/lang.clj
@@ -10,7 +10,6 @@
   (:require [zensols.nlparse.feature.util :refer :all]
             [zensols.nlparse.wordnet :as wn]
             [zensols.nlparse.parse :as pt]))
-

 ;; propbank
 (defn first-sent-propbank-label


Removing verbose commenting.

Removing verbose commenting.

--- src/cmr/indexer/data/concepts/collection.clj
+++ src/cmr/indexer/data/concepts/collection.clj
@@ -62,8 +62,7 @@
         update-time (get-in collection [:data-provider-timestamps :update-time])
         update-time (f/unparse (f/formatters :date-time) update-time)
         spatial-representation (get-in collection [:spatial-coverage :spatial-representation])
-        permitted-group-ids (acl/get-coll-permitted-group-ids context provider-id collection)
-        _ (debug "permitted-group-ids" (pr-str permitted-group-ids) "for coll" entry-title)]
+        permitted-group-ids (acl/get-coll-permitted-group-ids context provider-id collection)]
     (merge {:concept-id concept-id
             :permitted-group-ids permitted-group-ids
             :entry-id entry-id


bumping to 0.5.0-2

bumping to 0.5.0-2

--- plugin/project.clj
+++ plugin/project.clj
@@ -1,4 +1,4 @@
-(defproject lein-figwheel "0.5.0-1"
+(defproject lein-figwheel "0.5.0-2"
   :description "ClojureScript Autobuilder/Server which pushes changed files to the browser. This is the lein plugin."
   :url "https://github.com/bhauman/lein-figwheel"
   :license {:name "Eclipse Public License - v 1.0"


got rid of old file

got rid of old file

--- old.clj
+++ old.clj
@@ -1,169 +0,0 @@
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; (def system ( mk-system "shit-div" "shit-canvas" ))
-
-; (def rt-gaz
-;   (-> (get-resource-manager system)
-;       (create-render-target! "shit-canvas" 100 100)))
-
-; (def im-gaz
-;  (-> (get-resource-manager system)
-;      (load-img! "shit-tiles")))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; (defonce update-chan (chan))
-
-; (def level-dims (v2 10 10))
-
-; (def level
-;   (->
-;     (mk-tile-map (:x level-dims) (:y level-dims) :blank)
-;     (mix-it-up)))
-
-; (defn make-game-render-data [rd t rendered-level]
-;   (assoc rd
-;          :xforms
-;          (concat
-;            (list
-;              [:identity]
-;              [:clear (cos-01 (* t 1)) 0 (cos-01 (* t 20))]
-;              [:scale {:x 10 :y 10}]
-;              [:translate (v2/mul (v2/v2 (cos-01 (* t 3)) (cos-01 t)) (v2/v2 20 20))]
-;              )
-;            (list
-;                    [:box {:x 0 :y 0} {:x 20 :y 20} [0 0 0]]
-;              )
-;            rendered-level)
-;          )
-;   )
-
-; (defn make-level-render-data [rd t]
-;   (assoc rd
-;          :xforms (list
-;                    [:identity]
-;                    [:clear 0 0 1]
-;                    [:box {:x 0 :y 0} {:x 20 :y 20} [0 0 0]] )))
-
-
-; (def rendered-level (vec  (render-level level)))
-
-; (defn update-game [{:keys [tick main-render-data level-render-data] :as game} dt]
-;   (let [new-tick (+ dt  tick) ]
-;     (do
-
-;       (assoc game
-;              :level-render-data (make-level-render-data level-render-data new-tick )
-;              :main-render-data (make-game-render-data level-render-data new-tick rendered-level)
-;              :tick new-tick))
-;     ))
-
-; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; (defn make-pogue-game [renderer resource-manager]
-;   (game/make-game
-;     (reify
-;       game/IGameInit
-;       (game-init [_]
-;         (println "initialised game!"))
-
-;       game/IGameUpdate
-;       (game-update [this dt]
-;         (println "updated game!")))))
-
-; (def img-chan (chan))
-; (def rt-chan (chan))
-
-; (defn om-loader [_ owner]
-;   (reify
-;     om/IWillMount
-;     (will-mount [_]
-;       (go-loop []
-;                (let [[msg port] (alts! [img-chan rt-chan])]
-;                  (cond
-;                    (= port img-chan) (println (str "img: " msg))
-;                    (= port rt-chan) (println (str "rt: " msg))
-;                    ))
-;                (recur)))
-
-;     om/IDidUpdate
-;     (did-update [this next-props next-state]
-;       )
-
-;     om/IRender
-;     (render [_]
-;       (dom/p nil "Loaded")
-;       )
-;     )
-;   )
-
-; (defonce loader-atom (atom {:rt-chan (chan) :img-chan (chan)}))
-
-; (defn str->bytes [s]
-;   (->
-;     (fn [ch]
-;       (let [cc (.charCodeAt ch 0)]
-;         (if (> cc 255)
-;           [(bit-and cc 255) (bit-shift-right cc 8)]
-;           [cc])))
-;     (mapcat s)))
-
-; (defn col->array [col]
-;   (let [arr #js []]
-;     (doseq [i (range (count col))]
-;       (.push arr (nth col i)))
-;     arr))
-
-; (defn str->enc64 [s]
-;   (b64/encodeByteArray (-> s str->bytes col->array)))
-
-; (defn str->inline-png [s]
-;   (str "data:image/png;base64," (str->enc64 s)))
-
-; (defn <!-inline-img-enc [url]
-;   (let [ret (chan)]
-;     (go (->>
-;           (http/get url)
-;           (<!)
-;           (:body)
-;           (put! ret)))
-;     ret))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-
-
-; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; (defonce first-time? (atom true))
-
-; (defn main' []
-;   (om/root
-;     (fn [game-state owner]
-;       (reify
-;         om/IWillMount
-;         (will-mount [_ ]
-;           (go-loop []
-;                    (let [dt (<! update-chan) ]
-;                      (om/transact! game-state #(update-game % dt))
-;                      (recur))))
-
-;         om/IRender
-;         (render [_]
-;           (dom/div #js {:id "wrapper"}
-;                    (dom/div nil (dom/h1 nil (-> game-state :main-app :name)))
-;                    (dom/p nil (-> game-state :tick))
-;                    ))))
-;     app-state
-;     {:target (. js/document (getElementById "app"))})
-
-;   (when @first-time?
-;     (do
-;       (swap! first-time? not)
-;       (js/setInterval (fn [] (put! update-chan (/ 1 60))) 16))))
-
-


bump timeout to try and narrow down failing test (#1091)

Close https://github.com/threatgrid/iroh/issues/4905

As suggested by https://github.com/threatgrid/iroh/issues/4905#issuecomment-793955626

--- test/ctia/flows/hooks/redis_event_hook_test.clj
+++ test/ctia/flows/hooks/redis_event_hook_test.clj
@@ -92,7 +92,7 @@
         (is (= 201 judgement-2-status))
         (is (= 201 judgement-3-status))

-        (is (.await finish-signal 10 TimeUnit/SECONDS)
+        (is (.await finish-signal 30 TimeUnit/SECONDS)
             "Unexpected timeout waiting for subscriptions")
         (is (= [{:owner "Unknown"
                  :groups ["Administrators"]


Ensure we shut down the connection pool during testing.

Previously, an exception might have leaked an active pool; now we ensure that
it always gets shut down in our fixture.

Signed-off-by: Daniel Pittman <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@puppetlabs.com>

--- test/com/puppetlabs/cmdb/test/query/resource.clj
+++ test/com/puppetlabs/cmdb/test/query/resource.clj
@@ -14,8 +14,9 @@

 (use-fixtures :each (fn [f]
                       (query/ring-init)
-                      (with-scf-connection (f))
-                      (query/ring-destroy)))
+                      (try
+                        (with-scf-connection (f))
+                        (finally (query/ring-destroy)))))


Prevent add-task intos resulting in ()s for triggers/windows

--- test/onyx/test_boilerplate.clj
+++ test/onyx/test_boilerplate.clj
@@ -43,6 +43,8 @@
           {:workflow workflow
            :catalog []
            :lifecycles []
+           :triggers []
+           :windows []
            :task-scheduler task-scheduler}
           compact-job))


update ns ordering

update ns ordering

--- cimi-test-jar/src/com/sixsq/slipstream/ssclj/resources/lifecycle_test_utils.clj
+++ cimi-test-jar/src/com/sixsq/slipstream/ssclj/resources/lifecycle_test_utils.clj
@@ -21,13 +21,13 @@
     [com.sixsq.slipstream.ssclj.util.zookeeper :as uzk]
     [compojure.core :as cc]
     [peridot.core :refer [request session]]
+    [qbits.spandex :as spandex]
     [ring.middleware.json :refer [wrap-json-body wrap-json-response]]
     [ring.middleware.keyword-params :refer [wrap-keyword-params]]
     [ring.middleware.nested-params :refer [wrap-nested-params]]
     [ring.middleware.params :refer [wrap-params]]
     [ring.util.codec :as codec]
-    [zookeeper :as zk]
-    [qbits.spandex :as spandex])
+    [zookeeper :as zk])
   (:import [org.apache.curator.test TestingServer]))


remove unnecessary else branch

remove unnecessary else branch

--- src/hu/ssh/github_changelog/conventional.clj
+++ src/hu/ssh/github_changelog/conventional.clj
@@ -44,7 +44,7 @@
   [config :- Config
    pull :- Pull]
   (if-let [[_ type scope subject] (re-find header-pattern (:title pull))]
-    {:type type :scope scope :subject subject :issues (parse-issues config pull)} nil))
+    {:type type :scope scope :subject subject :issues (parse-issues config pull)}))

 (s/defn parse-changes :- Tag
   [config :- Config


Compute long-tail percentage from non-unique bidders

--- src/matchmaker_sparql/evaluation/metrics.clj
+++ src/matchmaker_sparql/evaluation/metrics.clj
@@ -8,12 +8,12 @@
   (let [rank (.indexOf matches match)]
     {:rank (if (not= rank -1) (inc rank) :not-found)
      :empty? (not (seq matches))
-     :matches (set matches)}))
+     :matches (zipmap matches (repeat 1))}))

 (defn- union-matches
   "Set union matches."
   [metrics]
-  (transduce (map :matches) union metrics))
+  (transduce (map :matches) (partial merge-with +) metrics))

 (defn aggregate-fold-metrics
   "Compute aggregate metrics for an evaluation fold."
@@ -27,8 +27,10 @@
   [{:keys [bidder-count contract-count long-tail?]}
    metrics]
   (let [matches (union-matches metrics)
-        matches-count (count matches)]
-    {:catalog-coverage (/ matches-count bidder-count)
-     :long-tail-percentage (/ (count (filter long-tail? matches)) matches-count)
+        long-tail-matches-count (->> matches
+                                     (filter (comp long-tail? key))
+                                     (transduce (map val) +))]
+    {:catalog-coverage (/ (count matches) bidder-count)
+     :long-tail-percentage (/ long-tail-matches-count contract-count)
      :prediction-coverage (/ (count (filter false? (mapcat :empties metrics))) contract-count)
      :ranks (mapcat :ranks metrics)}))


Cleanup immutable messenger test

Cleanup immutable messenger test

--- test/onyx/messaging/immutable_messenger_test.clj
+++ test/onyx/messaging/immutable_messenger_test.clj
@@ -9,18 +9,6 @@

 (defn switch-peer [messenger peer]
   (assoc messenger :peer-id peer))
-
-;; Implement barriers where
-;; 1. Barrier must be received in order to receive messages
-;; 2. Then reads are valid until barrier number is invalidated (via replica number)
-;; 3. Implement barrier tracking - read from subscribers that haven't read their next barrier
-;; 4. Implement position / ticket differences for reading
-;; 5. Implement replica validity - messenger should know what replica it can set messages for and skip past everything for those
-
-
-;; Need
-;; Replayable stream - onyx-seq style for inputs
-;; Implement stream rewind and just focus on correctness under these scenarios i.e. unacked stuff

 (defn process-barriers [messenger]
   (if (m/all-barriers-seen? messenger)
@@ -77,7 +65,6 @@
               (m/emit-barrier)
               (m/send-messages [:m3 :m4] [t1-queue-p2])
               ;; don't emit next barrier so that :m5 and :m6 will be blocked
-
               )
         ms (reductions (fn [m p]
                          (-> m
@@ -116,18 +103,16 @@
                      (m/emit-barrier)
                      (switch-peer :p4)
                      (m/receive-messages)
-                     (m/receive-messages))]
-        (is (m/all-barriers-seen? m-p4))
+                     (m/receive-messages))

-        ;(is (m/all-barriers-seen? (m/receive-messages (switch-peer (last mss) :p4))))
-        )
+            _ (is (m/all-barriers-seen? m-p4))

-      (let [m-p1-acks (-> (last mss)
+            m-p1-acks (-> (last mss)
                           (switch-peer :p1)
                           (m/receive-acks)
                           (m/receive-acks)
                           (m/receive-acks)
-
+
                           )
             m-p2-acks (-> m-p1-acks
                           (switch-peer :p2)
@@ -137,89 +122,7 @@
             m-p2-next-acks (-> m-p2-acks
                                (m/flush-acks)
                                (m/receive-acks)
-                               (m/receive-acks)
-                               )]
-        (println "All acks seen"
-             (m/all-acks-seen? m-p1-acks)
-                 )
+                               (m/receive-acks))]
         (is (m/all-acks-seen? m-p1-acks))
         (is (m/all-acks-seen? m-p2-acks))
         (is (m/all-acks-seen? m-p2-next-acks))))))
-
-
-;; Mutable version test - uses atom to replicate results in above test
-#_(deftest atom-messaging-test
-  ;; [:t2 :t1] [:t3 :t1]
-  (let [pg (component/start (am/atom-peer-group {}))
-        m-p1 (component/start (-> (am/atom-messenger)
-                                  (assoc :peer {:peer-group {:messaging-group pg}
-                                                :id :p1})))
-        m-p2 (component/start (-> (am/atom-messenger)
-                                  (assoc :peer {:peer-group {:messaging-group pg}
-                                                :id :p2})))
-        m-p3 (component/start (-> (am/atom-messenger)
-                                  (assoc :peer {:peer-group {:messaging-group pg}
-                                                :id :p3})))
-        t1-queue-p1 {:src-peer-id :p1 :dst-task-id :t1}
-        t1-queue-p2 {:src-peer-id :p2 :dst-task-id :t1}
-        t2-ack-queue {:src-peer-id :p3 :dst-task-id :t1}
-        _ (-> m-p1
-              (m/set-replica-version 1)
-              (m/add-publication t1-queue-p1)
-              (m/add-subscription t2-ack-queue))
-
-        _ (-> m-p2
-              (m/set-replica-version 1)
-              (m/add-publication t1-queue-p2)
-              (m/add-subscription t2-ack-queue))
-
-        m (-> m-p3
-              (m/set-replica-version 1)
-              (m/add-subscription t1-queue-p1)
-              (m/add-subscription t1-queue-p2)
-              (m/add-publication t2-ack-queue))
-
-        _ (-> m-p1
-              (m/next-epoch)
-              (m/emit-barrier)
-              (m/send-messages [:m1 :m2] [t1-queue-p1])
-              (m/next-epoch)
-              (m/emit-barrier))
-
-        _ (-> m-p2
-              (m/next-epoch)
-              (m/emit-barrier)
-              (m/send-messages [:m3 :m4] [t1-queue-p2])
-              (m/next-epoch)
-              (m/emit-barrier)
-              (m/send-messages [:m5 :m6] [t1-queue-p2]))
-        _ (process-barriers m-p3)
-        messages (map :message (mapcat (fn [_] (m/receive-messages m-p3)) (range 20)))]
-    (is (= [:m1 :m3 :m2 :m4] messages))
-    (is (m/all-barriers-seen? m))
-
-    ;; Because we've seen all the barriers we can call next epoch
-    ;; And continue reading the messages afterwards
-    (let [mnext (-> m-p3
-                    (m/ack-barrier)
-                    (m/next-epoch))
-          messages2 (map :message (mapcat (fn [_] (m/receive-messages m-p3)) (range 20)))]
-      (is (= [:m5 :m6] messages2))
-      (is (not (m/all-barriers-seen? mnext)))
-      (let [m-p1-acks (m/receive-acks m-p1)
-            m-p2-acks (m/receive-acks m-p2)
-            m-p2-next-acks (m/receive-acks m-p2)]
-        (is (not (empty? m-p1-acks)))
-        (is (not (empty? m-p2-acks)))
-        (is (empty? m-p2-next-acks))
-        ;; Late joiner :p4 on same queues at p3 should not obtain any messages
-        (let [m-p4 (component/start (-> (am/atom-messenger)
-                                        (assoc :peer {:peer-group {:messaging-group pg}
-                                                      :id :p4})))
-              m (-> m-p4
-                    (m/set-replica-version 1)
-                    (m/add-subscription t1-queue-p1)
-                    (m/add-subscription t1-queue-p2)
-                    (m/add-publication t2-ack-queue))]
-
-          (is (empty? (remove nil? (mapcat (fn [_] (m/receive-messages m-p4)) (range 20))))))))))


Fix RR.

Fix RR.

--- src/onyx/log/commands/volunteer_for_task.clj
+++ src/onyx/log/commands/volunteer_for_task.clj
@@ -15,12 +15,13 @@

 (defmethod select-task :onyx.task-scheduler/round-robin
   [replica job]
-  (let [task (get-in replica [:last-task-allocated job])
-        lead (first (get-in replica [:tasks job]))
-        tasks (cycle (get-in replica [:tasks job]))]
-    (if task
-      (second (drop-while (partial not= task) tasks))
-      lead)))
+  (let [allocations (get-in replica [:allocations job])
+        tasks (get-in replica [:tasks job])]
+    (->> tasks
+         (map (fn [t] {:task t :n (count (get allocations t))}))
+         (sort-by :n)
+         (first)
+         :task)))

 (defmethod select-task :default
   [replica job]


make sure cleaning is done for /companies as well

--- src/open_company/representations/company.clj
+++ src/open_company/representations/company.clj
@@ -120,5 +120,7 @@
    {:collection {:version common/json-collection-version
                  :href "/companies"
                  :links [(common/self-link "/companies" collection-media-type)]
-                 :companies (map #(company-links % [:self]) companies)}}
+                 :companies (->> companies
+                                 (map #(common/clean % clean-properties))
+                                 (map #(company-links % [:self])))}}
    {:pretty true}))


binding with clojure.test

binding with clojure.test

--- test2/test/test2/test/core.clj
+++ test2/test/test2/test/core.clj
@@ -1,5 +1,6 @@
 (ns test2.test.core
   (:use [test2.core])
+  (:use [clojure.test])
   (:use [midje.sweet]))

 (defn fake-finder [key] "fake value")
@@ -13,4 +14,9 @@
   (binding [finder fake-finder]
       (pretty-printer "Bob")) => "This is a fake value")

+(deftest pretty-print-with-fake
+  (is ( = "This is a fake value"
+	  (binding [finder fake-finder]
+	    (pretty-printer "Bob")) )))

+


fixed lib prepare

fixed lib prepare

--- lein-gaeshi/src/gaeshi/kuzushi/commands/prepare.clj
+++ lein-gaeshi/src/gaeshi/kuzushi/commands/prepare.clj
@@ -4,7 +4,7 @@
             [clojure.java.io :refer [file]]
             [clojure.string :as str :refer [join]]
             [joodo.kuzushi.common :refer [symbolize with-lein-project *project*]]
-;            [leiningen.util.file]
+            [leiningen.core.classpath :refer [get-classpath]]
             [lancet.core :as lancet])
   (:import [java.io File]
            [mmargs Arguments]))
@@ -41,15 +41,22 @@
 (defn- prepare-views-jar [project]
   (let [default-jar-file (File. (get-jar-filename project))
         views-jar-name (str/replace (.getName default-jar-file) #"\.jar" "_views.jar")
-        views-jar-path (.getPath (File. (.getParent default-jar-file) views-jar-name))]
-    (lancet/jar {:jarfile views-jar-path :basedir (:source-path project) :includes "**/*.hiccup*"})
+        views-jar-path (.getPath (File. (.getParent default-jar-file) views-jar-name))
+        source-path (or (:source-path project) (first (:source-paths project)))]
+    (lancet/jar {:jarfile views-jar-path :basedir source-path :includes "**/*.hiccup*"})
     (lancet/copy {:file views-jar-path :todir "war/WEB-INF/lib"})))

+;(defn- prepare-libs [project]
+;  (let [lib-dir (:library-path project)
+;        dev-lib-dir (.getPath (file lib-dir "dev"))]
+;    (lancet/copy {:todir "war/WEB-INF/lib"}
+;      (lancet/fileset {:dir lib-dir :includes "*" :excludes "dev"}))))
+
 (defn- prepare-libs [project]
-  (let [lib-dir (:library-path project)
-        dev-lib-dir (.getPath (file lib-dir "dev"))]
-    (lancet/copy {:todir "war/WEB-INF/lib"}
-      (lancet/fileset {:dir lib-dir :includes "*" :excludes "dev"}))))
+  (let [classpaths (get-classpath *project*)
+        jars (filter #(.endsWith % ".jar") classpaths)]
+    (doseq [jar jars]
+      (lancet/copy {:file jar :todir "war/WEB-INF/lib"}))))

 (defn- clean-public [project]
   (lancet/delete {:dir "war/public"})


[#12270] App crashes if first open the "Enter your seed phrase" screen, then go back, generate a new key and create a password

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/multiaccounts/create/core.cljs
+++ src/status_im/multiaccounts/create/core.cljs
@@ -102,7 +102,9 @@
 (fx/defn generate-and-derive-addresses
   {:events [:generate-and-derive-addresses]}
   [{:keys [db]}]
-  {:db (assoc-in db [:intro-wizard :processing?] true)
+  {:db (-> db
+           (update :intro-wizard #(-> % (assoc :processing? true) (dissoc :recovering?)))
+           (dissoc :recovered-account?))
    :multiaccount-generate-and-derive-addresses nil})

 (fx/defn prepare-intro-wizard


(PE-22860) Optimization for the latest report events

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -896,7 +896,11 @@
                                             :field :environments.environment}
                              "latest_report?" {:type :boolean
                                                :queryable? true
-                                               :query-only? true}}
+                                               :query-only? true}
+                             "report_id" {:type :bigint
+                                          :queryable? false
+                                          :query-only? true
+                                          :field :events.report_id}}
                :selection {:from [[:resource_events :events]]
                            :join [:reports
                                   [:= :events.report_id :reports.id]]
@@ -937,6 +941,16 @@
                :alias "latest_report"
                :subquery? false
                :source-table "latest_report"}))
+
+(def latest-report-id-query
+  "Usually used as a subquery of reports"
+  (map->Query {:projections {"latest_report_id" {:type :bigint
+                                                 :queryable? true
+                                                 :field :certnames.latest_report_id}}
+               :selection {:from [:certnames]}
+               :alias "latest_report_id"
+               :subquery? false
+               :source-table "latest_report_id"}))

 (def environments-query
   "Basic environments query, more useful when used with subqueries"
@@ -1335,6 +1349,7 @@
    "select_nodes" nodes-query
    "select_inactive_nodes" inactive-nodes-query
    "select_latest_report" latest-report-query
+   "select_latest_report_id" latest-report-id-query
    "select_params" resource-params-query
    "select_reports" reports-query
    "select_inventory" inventory-query
@@ -1489,9 +1504,9 @@
                                       ["select_latest_report"]]]

                                     :events
-                                    ["in" "report"
-                                     ["extract" "latest_report_hash"
-                                      ["select_latest_report"]]]
+                                    ["in" "report_id"
+                                     ["extract" "latest_report_id"
+                                      ["select_latest_report_id"]]]

                                     (throw (IllegalArgumentException.
                                             (tru "Field 'latest_report?' not supported on endpoint ''{0}''" entity))))]


New pattern compiler

New pattern compiler

--- src/aurora/compiler/match.cljs
+++ src/aurora/compiler/match.cljs
@@ -1,8 +1,64 @@
 (ns aurora.compiler.match
+  (:require [clojure.walk :refer [postwalk-replace]]
+            [aurora.compiler.jsth :as jsth])
   (:require-macros [aurora.macros :refer [check deftraced]]
                    [aurora.compiler.match :refer [match]]))

-(defrecord MatchFailure [])
+(defn vars [form]
+  (cond
+   (and (seq? form) (= 'quote (first form))) #{}
+   (symbol? form) #{form}
+   (coll? form) (apply clojure.set/union (map ->vars form))
+   :else #{}))
+
+(defn chain [& forms]
+  (reduce
+   (fn [tail form]
+     (clojure.walk/postwalk-replace {::tail tail} form))
+   (concat (reverse forms) [::tail])))
+
+(deftraced data->jsth [pattern] [pattern]
+  (cond
+   (or (number? pattern) (string? pattern)) pattern
+   (keyword? pattern) `(new (cljs.core.Keyword ~(namespace pattern) ~(name pattern) ~(str (namespace pattern) "/" (name pattern)) ~(hash pattern)))
+   (vector? pattern) `(cljs.core.PersistentVector.fromArray
+                       ~(vec (map data->jsth pattern)))
+   (map? pattern) `(cljs.core.PersistentHashMap.fromArrays
+                    ~(vec (map data->jsth (keys pattern)))
+                    ~(vec (map data->jsth (vals pattern))))
+   :else (check false)))
+
+(deftraced pattern->jsth [pattern] [pattern]
+  (cond
+   (= '_ pattern) ::tail
+   (symbol? pattern) `(do (let! ~pattern ::input) ::tail)
+   (or (number? pattern) (string? pattern) (keyword? pattern)) `(if (= ~(data->jsth pattern) ::input) ::tail)
+   (vector? pattern) `(if (cljs.core.vector? ::input)
+                        (if (= ~(count pattern) (cljs.core.count ::input))
+                          ~(apply chain
+                                  (for [i (range (count pattern))
+                                        :let [elem (nth pattern i)
+                                              elem-sym (gensym "elem")]]
+                                    `(do
+                                       (let! ~elem-sym (cljs.core.nth ::input ~i))
+                                       ~(postwalk-replace {::input elem-sym} (pattern->jsth elem)))))))
+   (map? pattern) `(if (cljs.core.map? ::input)
+                     ~(apply chain
+                             (for [[key val] pattern
+                                   :let [key-sym (gensym "key")
+                                         val-sym (gensym "val")]]
+                               `(do
+                                  (let! ~key-sym ~(data->jsth key))
+                                  (let! ~val-sym (cljs.core.get ::input ~key-sym ~(data->jsth ::not-found)))
+                                  (if (not (cljs.core.keyword-identical? ~key-sym ~(data->jsth ::not-found)))
+                                    ~(postwalk-replace {::input val-sym} (pattern->jsth val)))))))
+   :else (check false)))
+
+(defn pattern [pattern returns]
+  (let [input-sym (gensym "input")
+        success (postwalk-replace {::input input-sym ::tail `(return ~returns)} (pattern->jsth pattern))
+        failure `(return nil)]
+    (js/Function (jsth/munge input-sym) (jsth/statement->string `(do ~success ~failure)))))

 (comment
   (match 1


allow nbars to be nested

allow nbars to be nested

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -290,8 +290,7 @@
                                   :rest head-mod}}
                    :comp {:synsem {:cat :adjective
                                    :sem adj-sem}}
-                   :head {:phrasal false
-                          :synsem {:cat :noun
+                   :head {:synsem {:cat :noun
                                    :sem {:prop head-constraint}
                                    :mod head-mod}}}))
    ;; noun-phrase -> det nbar


working on possessive "s" synsematics

working on possessive "s" synsematics

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1425,18 +1425,26 @@
           :synsem {:cat :verb
                    :sem {:pred :run}}}

-   "s" [{:synsem {:agr {:number :sing}
-                  :cat :det
-                  :def :genitive
-                  :subcat {:1 {:cat :noun
-                               :pronoun false
-                               :subcat '()}}}}
-         {:synsem {:agr {:number :plur}
-                   :cat :det
-                   :def :genitive
-                   :subcat {:1 {:cat :noun
-                                :pronoun false
-                                :subcat '()}}}}]
+   "s" [(let [of (atom :ref)]
+          {:synsem {:agr {:number :sing}
+                    :cat :det
+                    :def :genitive
+                    :subcat {:1 {:cat :noun
+                                 :pronoun false
+                                 :sem of
+                                 :subcat '()}}
+                    :sem {:pred :of
+                          :of of}}})
+        (let [of (atom :ref)]
+          {:synsem {:agr {:number :plur}
+                    :cat :det
+                    :def :genitive
+                    :sem {:pred :of
+                          :of of}
+                    :subcat {:1 {:cat :noun
+                                 :pronoun false
+                                 :sem of
+                                 :subcat '()}}}})]

    "say" {:english {:past "said"}
           :synsem {:cat :verb


add debugging info

add debugging info

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -137,7 +137,8 @@
                                        :3plur "were"}}}]
           [;; intransitive
            (unify common
-                  {:synsem {:subcat {:1 {:cat :noun}
+                  {:sense 1
+                   :synsem {:subcat {:1 {:cat :noun}
                                      :2 '()}
                             :sem {:pred :be}}})

@@ -153,7 +154,11 @@
                                 :gender gender})] ;; prevents e.g. "Her name is John"
              (unify common
                     subject-verb-agreement
-                    {:intransitivize false
+                    {:sense 2
+                     ;; TODO: remove (in)transtivize (false|true): should not
+                     ;; need these explicit compiler directives; compilation
+                     ;; should be able to manage on its own
+                     :intransitivize false
                      :transitivize false
                      :synsem {:agr subj-agr
                               :sem {:aspect :progressive
@@ -185,7 +190,8 @@
            (let [pred (atom :top)
                  obj (atom :top)]
              (unify common
-                    {:synsem {:cat :verb
+                    {:sense 3
+                     :synsem {:cat :verb
                               :sem {:obj obj
                                     :reflexive false
                                     :pred pred
@@ -199,7 +205,8 @@
                  obj (atom :top)
                  agr (atom :top)]
              (unify common
-                    {:synsem {:cat :verb
+                    {:sense 4
+                     :synsem {:cat :verb
                               :sem {:subj obj ;; reflexive: subj=obj
                                     :obj obj
                                     :reflexive true
@@ -2314,6 +2321,7 @@

                  (default ;; intransitive verbs' :obj is :unspec.
                   {:modal-with false
+                   :applied {:rule 1}
                    :synsem {:cat :verb
                             :subcat {:1 {:top :top}
                                      :2 '()}


refine reflexive verb rule

refine reflexive verb rule

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -232,13 +232,14 @@
                       :sem {:reflexive false}
                       :subcat {:2 {:reflexive false}}}})

-   ;; for transitive, reflexive verbs, the 2nd arg is reflexive by default.
+   ;; for transitive, reflexive verbs, the 2nd arg is a reflexive pronoun by default.
    (default
     (let [subject-agr (atom :top)]
       {:synsem {:sem {:reflexive true}
                 :cat :verb
                 :subcat {:1 {:agr subject-agr}
                          :2 {:reflexive true
+                             :pronoun true
                              :agr subject-agr}}}}))
    (default
     {:synsem {:cat :verb


whitespace

whitespace

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -718,7 +718,7 @@
                                 :3sing "pone"
                                 :1plur "ponemos"
                                 :2plur "ponéis"
-                             :3plur "ponen"}
+                                :3plur "ponen"}
                       :preterito-stem "pus"}
             :synsem {:cat :verb
                      :sem {:subj {:animate true}


added addormentarsi

added addormentarsi

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -76,6 +76,21 @@
                           :animate false
                           :pred :acqua}}})

+   "addormentarsi" (let [subject-semantics (ref {:animate true})
+                   subject-agr (ref :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}}}})
+
    "affolato"
    [;; comparative
     (let [is-place (ref {:place true}) ;; only places can be crowded.


+lei (feminine 3rd person)

+lei (feminine 3rd person)

--- src/babel/latin/morphology.clj
+++ src/babel/latin/morphology.clj
@@ -17,6 +17,9 @@

      ["at"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["at"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["amus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -40,6 +43,9 @@

      ["et"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["et"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["emus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -63,6 +69,9 @@

      ["it"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["it"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["imus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -86,6 +95,9 @@

      ["it"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["it"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["imus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -109,6 +121,9 @@

      ["it"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["it"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["imus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -136,7 +151,10 @@

      ["abat"
       {:synsem {:sem {:subj {:pred :lui}}}}]
-
+
+     ["abat"
+      {:synsem {:sem {:subj {:pred :lei}}}}]
+
      ["abamus"
       {:synsem {:sem {:subj {:pred :noi}}}}]

@@ -159,6 +177,9 @@

      ["ebat"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["ebamus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -183,6 +204,9 @@
      ["ebat"
       {:synsem {:sem {:subj {:pred :lui}}}}]

+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lei}}}}]
+
      ["ebamus"
       {:synsem {:sem {:subj {:pred :noi}}}}]

@@ -205,6 +229,9 @@

      ["iebat"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["iebamus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -228,6 +255,9 @@

      ["iebat"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["iebamus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -255,6 +285,9 @@

      ["abit"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["abit"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["abimus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -278,6 +311,9 @@

      ["ebit"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebit"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["ebimus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -301,6 +337,9 @@

      ["et"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["et"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["emus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -324,6 +363,9 @@

      ["iet"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iet"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["iemus"
       {:synsem {:sem {:subj {:pred :noi}}}}]
@@ -347,6 +389,9 @@

      ["iet"
       {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iet"
+      {:synsem {:sem {:subj {:pred :lei}}}}]

      ["iemus"
       {:synsem {:sem {:subj {:pred :noi}}}}]


Update unit/inch-set

Update unit/inch-set

--- src/bakyeono/litedocx/unit.clj
+++ src/bakyeono/litedocx/unit.clj
@@ -41,7 +41,8 @@

 ;;; Conversion rate map selector
 (defconst metric-set #{:cm :km :m :mm})
-(defconst inch-set #{:dxa :emu :inch :pt :px :twip})
+(defconst inch-set (clojure.set/difference (set (keys unit-per-inch))
+                                           metric-set))

 ;;; Functions
 (defn- parse-unit


Fix fn unit/convert

Fix fn unit/convert

--- src/bakyeono/litedocx/unit.clj
+++ src/bakyeono/litedocx/unit.clj
@@ -53,7 +53,7 @@

 (defn conversion-rate
   [from to]
-  (let [sym (symbol (str from "-per-" to))]
+  (let [sym (symbol (str to "-per-" from))]
     (cond (resolve sym) (eval sym)
           (= from to) 1
           true (throw (Exception. (str "Unsupported unit conversion: "
@@ -64,8 +64,15 @@
   given to-unit.

   Parameters:
-  - value: <string or number>
-  - to: <string>"
+  - value: <string> value with unit.
+  - to: <string or keyword> target unit type.
+
+  Examples:
+  - (convert \"10px\" \"mm\")
+  - (convert \"29.7 cm\" :twip)
+
+  Supported Unit Types:
+  - Length Units: inch, cm, mm, px, pt, twip"
   [value to]
   (let [[n unit] (parse-unit value)
         rate (conversion-rate unit (name to))]


add spacing below embed content

add spacing below embed content

--- src/braid/ui/styles/embed.cljs
+++ src/braid/ui/styles/embed.cljs
@@ -6,7 +6,9 @@

 (defn embed [pad]
   [:.embed
-   {:margin [[pad (m/* -1 pad)]]}
+   {:margin [[0 (m/* -1 pad)]]
+    :padding [[pad 0]]
+    :overflow "hidden"}

    [:.content
     {:cursor "pointer"}]


use go blocks instead of threads in manage-filesystem

this uses system's :looping-qwatcher in order to convey rmqstate's
list-queues result.

--- src/brainbot/nozzle/manage.clj
+++ src/brainbot/nozzle/manage.clj
@@ -1,4 +1,5 @@
 (ns brainbot.nozzle.manage
+  (:require [clojure.core.async :refer [go thread chan mult put! close! <! <!! >! >!! timeout] :as async])
   (:require [brainbot.nozzle.routing-key :as rk]
             [brainbot.nozzle.sys :as sys]
             [brainbot.nozzle.inihelper :as inihelper]
@@ -33,18 +34,6 @@
   (reduce + (map :messages (filter-by-rkmap rkmap (filter-by-vhost vhost queue-state)))))

-(defn wait-for-zero-messages
-  [get-num-messages]
-  (loop  [zero-count 0]
-    (if (= 0 (get-num-messages))
-      (when (< zero-count 6)
-        (Thread/sleep 500)
-        (recur (inc zero-count)))
-      (do
-        (Thread/sleep 10000)
-        (recur 0)))))
-
-
 (defn start-synchronization
   [rmq-settings id filesystem]
   (let [conn (rmq/connect rmq-settings)
@@ -57,73 +46,48 @@
     (rmq/close ch)
     (rmq/close conn)))

-(defn throw-management-api-error
-  "throw a somewhat informative message about missing management rights"
-  []
-  (throw
-   (ex-info
-    "no response from RabbitMQ's management API. make sure you have added the management tag for the user in RabbitMQ"
-    {:endpoint rmqapi/*endpoint*
-     :username rmqapi/*username*})))
-
-(defn list-queues
-  "wrapper around langohr's http/list-queues. this one raises an error
-  instead of returning nil when the user has no management rights for
-  the RabbitMQ management plugin"
-  [& args]
-  (let [qs (apply rmqapi/list-queues args)]
-    (when-not qs
-      (throw-management-api-error))
-    qs))
-
-(defn get-num-messages
-  "return number of messages in the given rabbitmq vhost for the given
-  filesystem and id/prefix"
-  [vhost id filesystem]
-  (num-messages-from-queue-state
-   (list-queues vhost)
-   vhost
-   {:id id
-    :filesystem filesystem}))
-
-(defn manage-filesystem*
-  [rmq-settings id {:keys [fsid sleep-between-sync]}]
-  (let [qname (rk/routing-key-string {:id id :filesystem fsid :command "*"})
-        get-num-messages* #(get-num-messages (:vhost rmq-settings) id fsid)
-        wait-idle #(wait-for-zero-messages get-num-messages*)]
-    (while true
-      (if (zero? (get-num-messages*))
-        (do
-          (logging/info "starting synchronization of" qname)
-          (start-synchronization rmq-settings id fsid))
-        (logging/info "synchronization of" qname "already running"))
-      (Thread/sleep 10000)
-      (wait-idle)
-      (logging/info "synchronization of" qname "finished. restarting in" sleep-between-sync "seconds")
-      (Thread/sleep (* sleep-between-sync 1000)))))
+(defn wait-idle
+  [get-num-messages]
+  (go
+   (loop []
+     (if-let [n (<! (get-num-messages))]
+       (if (zero? n)
+         :idle
+         (recur))))))

 (defn manage-filesystem
-  [rmq-settings id fsextra]
-  (try-try-again {:sleep (* 60 1000)
-                  :tries :unlimited
-                  :error-hook (fn [e] (logging/error "error in manage-filesystem" (:fsid fsextra) e))}
-                 #(manage-filesystem* rmq-settings id fsextra)))
+  [rmq-settings id {:keys [fsid sleep-between-sync]} ch]
+  (let [qname (rk/routing-key-string {:id id :filesystem fsid :command "*"})
+        get-num-messages* #(go
+                            (if-let [qstate (<! ch)]
+                              (num-messages-from-queue-state qstate
+                                                             (:vhost rmq-settings)
+                                                             {:id  id :filesystem fsid})))]
+    (go
+     (loop []
+       (when-let [num-messages (<! (get-num-messages*))]
+         (if (zero? num-messages)
+           (do
+             (logging/info "starting synchronization of" qname)
+             (<! (thread (start-synchronization rmq-settings id fsid)))
+             ;; consume the next value since that may have been
+             ;; produced before the thread was started
+             (<! ch))
+           (logging/info "synchronization of" qname "already running"))
+         (<! (wait-idle get-num-messages*))
+         (logging/info "synchronization of" qname "finished. restarting in" sleep-between-sync "seconds")
+         (<! (timeout (* sleep-between-sync 1000)))
+         (recur))))))

-(defrecord ManageService [rmq-settings rmq-prefix filesystems]
+
+(defrecord ManageService [rmq-settings rmq-prefix filesystems qwatch-mult]
   worker/Service
   (start [this]
     (doseq [fs filesystems]
-      (future (manage-filesystem rmq-settings rmq-prefix fs)))))
+      (let [ch (chan (async/sliding-buffer 1))]
+        (async/tap qwatch-mult ch)
+        (manage-filesystem rmq-settings rmq-prefix fs ch)))))

-(defn http-connect!
-  "initialize langohr.http by calling its connect! method"
-  ([] (http-connect! {}))
-  ([{:keys [api-endpoint username password]
-      :or {api-endpoint "http://localhost:55672"
-           username "guest"
-           password "guest"}}]
-     (logging/info "using rabbitmq api-endpoint" api-endpoint "as user" username)
-     (rmqapi/connect! api-endpoint username password)))

 (def runner
   (reify
@@ -132,7 +96,7 @@
     (make-object-from-section [this system section-name]
       (let [rmq-settings (-> system :config :rmq-settings)
             rmq-prefix (-> system :config :rmq-prefix)
+            qwatch-mult (-> system :looping-qwatcher :mult)
             filesystem-names (sys/get-filesystems-for-section system section-name)
             filesystems (map #(vfs/make-additional-fs-map system %) filesystem-names)]
-        (http-connect! rmq-settings)
-        (->ManageService rmq-settings rmq-prefix filesystems)))))
+        (->ManageService rmq-settings rmq-prefix filesystems qwatch-mult)))))


specs for import and refer-clojure

specs for import and refer-clojure

Signed-off-by: Stuart Halloway <4dc50fc3bc007be011b5445f3f79298b9eeb51b7@cognitect.com>

--- src/clj/clojure/core/specs.clj
+++ src/clj/clojure/core/specs.clj
@@ -103,57 +103,61 @@
 (s/def ::exclude (s/coll-of simple-symbol?))
 (s/def ::only (s/coll-of simple-symbol?))
 (s/def ::rename (s/map-of simple-symbol? simple-symbol?))
+(s/def ::filters (s/keys* :opt-un [::exclude ::only ::rename]))

 (s/def ::ns-refer-clojure
   (s/spec (s/cat :clause #{:refer-clojure}
-            :filters (s/keys* :opt-un [::exclude ::only ::rename]))))
+                 :filters ::filters)))

 (s/def ::refer (s/or :all #{:all}
-                 :syms  (s/coll-of simple-symbol?)))
+                     :syms (s/coll-of simple-symbol?)))

 (s/def ::prefix-list
   (s/spec
     (s/cat :prefix simple-symbol?
-      :suffix (s/* (s/alt :lib simple-symbol? :prefix-list ::prefix-list))
-      :refer (s/keys* :opt-un [::as ::refer]))))
+           :suffix (s/* (s/alt :lib simple-symbol? :prefix-list ::prefix-list))
+           :refer (s/keys* :opt-un [::as ::refer]))))

 (s/def ::ns-require
   (s/spec (s/cat :clause #{:require}
-            :libs (s/* (s/alt :lib simple-symbol?
-                         :prefix-list ::prefix-list
-                         :flag #{:reload :reload-all :verbose})))))
+                 :libs (s/* (s/alt :lib simple-symbol?
+                                   :prefix-list ::prefix-list
+                                   :flag #{:reload :reload-all :verbose})))))

 (s/def ::package-list
   (s/spec
     (s/cat :package simple-symbol?
-      :classes (s/* simple-symbol?))))
+           :classes (s/* simple-symbol?))))
+
+(s/def ::import-list
+  (s/* (s/alt :class simple-symbol?
+              :package-list ::package-list)))

 (s/def ::ns-import
   (s/spec
     (s/cat :clause #{:import}
-      :classes (s/* (s/alt :class simple-symbol?
-                      :package-list ::package-list)))))
+           :classes ::import-list)))

 (s/def ::ns-refer
   (s/spec (s/cat :clause #{:refer}
-            :lib simple-symbol?
-            :filters (s/keys* :opt-un [::exclude ::only ::rename]))))
+                 :lib simple-symbol?
+                 :filters ::filters)))

 (s/def ::use-prefix-list
   (s/spec
     (s/cat :prefix simple-symbol?
-      :suffix (s/* (s/alt :lib simple-symbol? :prefix-list ::use-prefix-list))
-      :filters (s/keys* :opt-un [::exclude ::only ::rename]))))
+           :suffix (s/* (s/alt :lib simple-symbol? :prefix-list ::use-prefix-list))
+           :filters ::filters)))

 (s/def ::ns-use
   (s/spec (s/cat :clause #{:use}
             :libs (s/* (s/alt :lib simple-symbol?
-                         :prefix-list ::use-prefix-list
-                         :flag #{:reload :reload-all :verbose})))))
+                              :prefix-list ::use-prefix-list
+                              :flag #{:reload :reload-all :verbose})))))

 (s/def ::ns-load
   (s/spec (s/cat :clause #{:load}
-            :libs (s/* string?))))
+                 :libs (s/* string?))))

 (s/def ::name simple-symbol?)
 (s/def ::extends simple-symbol?)
@@ -165,8 +169,8 @@
 (s/def ::post-init symbol?)
 (s/def ::method (s/and vector?
                   (s/cat :name simple-symbol?
-                    :param-types ::signature
-                    :return-type simple-symbol?)))
+                         :param-types ::signature
+                         :return-type simple-symbol?)))
 (s/def ::methods (s/coll-of ::method :kind vector?))
 (s/def ::main boolean?)
 (s/def ::factory simple-symbol?)
@@ -181,23 +185,40 @@

 (s/def ::ns-gen-class
   (s/spec (s/cat :clause #{:gen-class}
-            :options (s/keys* :opt-un [::name ::extends ::implements
-                                       ::init ::constructors ::post-init
-                                       ::methods ::main ::factory ::state
-                                       ::exposes ::prefix ::impl-ns ::load-impl-ns]))))
+                 :options (s/keys* :opt-un [::name ::extends ::implements
+                                            ::init ::constructors ::post-init
+                                            ::methods ::main ::factory ::state
+                                            ::exposes ::prefix ::impl-ns ::load-impl-ns]))))

 (s/def ::ns-clauses
   (s/* (s/alt :refer-clojure ::ns-refer-clojure
-         :require ::ns-require
-         :import ::ns-import
-         :use ::ns-use
-         :refer ::ns-refer
-         :load ::ns-load
-         :gen-class ::ns-gen-class)))
+              :require ::ns-require
+              :import ::ns-import
+              :use ::ns-use
+              :refer ::ns-refer
+              :load ::ns-load
+              :gen-class ::ns-gen-class)))

 (s/fdef clojure.core/ns
   :args (s/cat :name simple-symbol?
-          :docstring (s/? string?)
-          :attr-map (s/? map?)
-          :clauses ::ns-clauses)
-  :ret any?)
+               :docstring (s/? string?)
+               :attr-map (s/? map?)
+               :clauses ::ns-clauses))
+
+(defmacro ^:private quotable
+  "Returns a spec that accepts both the spec and a (quote ...) form of the spec"
+  [spec]
+  `(s/or :spec ~spec :quoted-spec (s/cat :quote #{'quote} :spec ~spec)))
+
+(s/def ::quotable-import-list
+  (s/* (s/alt :class (quotable simple-symbol?)
+              :package-list (quotable ::package-list))))
+
+(s/fdef clojure.core/import
+  :args ::quotable-import-list)
+
+(s/fdef clojure.core/refer-clojure
+  :args (s/* (s/alt
+               :exclude (s/cat :op (quotable #{:exclude}) :arg (quotable ::exclude))
+               :only (s/cat :op (quotable #{:only}) :arg (quotable ::only))
+               :rename (s/cat :op (quotable #{:rename}) :arg (quotable ::rename)))))


Extract methods

Extract methods

--- src/clj_gatling/simulation.clj
+++ src/clj_gatling/simulation.clj
@@ -60,28 +60,36 @@
           (>! result-channel (conj results result))
           (recur (rest r) new-ctx (conj results result)))))))

+(defn- response->result [scenario result]
+  {:name (:name scenario)
+   :id (:id (first result))
+   :start (:start (first result))
+   :end (:end (last result))
+   :requests result})
+
+(defn- run-requests-constantly [runner cs timeout scenario scenario-start concurrency]
+  (let [requests (:requests scenario)
+        results (async/chan)]
+    (go-loop [^long i 0]
+      (let [[result c] (alts! cs)]
+        (when (continue-run? runner scenario-start (+ i concurrency))
+          (run-requests requests timeout (+ i concurrency) c))
+        (>! results (response->result scenario result))
+        (when (continue-run? runner scenario-start i)
+          (recur (inc i)))))
+    results))
+
 (defn run-scenario [runner concurrency number-of-requests timeout scenario]
   (println (str "Running scenario " (:name scenario) " with " concurrency " concurrency and
             " (runner-info runner) "."))
   (let [cs       (repeatedly concurrency async/chan)
         ps       (map vector (iterate inc 0) cs)
-        results  (async/chan)
         requests (:requests scenario)
         scenario-start (local-time/local-now)]
     (doseq [[user-id c] ps]
       (run-requests requests timeout user-id c))
-    (go-loop [^long i 0]
-      (let [[result c] (alts! cs)]
-        (when (continue-run? runner scenario-start (+ i concurrency))
-          (run-requests requests timeout (+ i concurrency) c))
-        (>! results {:name (:name scenario)
-                     :id (:id (first result))
-                     :start (:start (first result))
-                     :end (:end (last result))
-                     :requests result})
-        (when (continue-run? runner scenario-start i)
-          (recur (inc i)))))
-    (repeatedly number-of-requests #(<!! results))))
+    (let [results (run-requests-constantly runner cs timeout scenario scenario-start concurrency)]
+      (repeatedly number-of-requests #(<!! results)))))

 (defn- distinct-request-count [scenarios]
   (reduce + (map #(count (:requests %)) scenarios)))


Change atoms so that they all appear under the category "Atom" in the Var list

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -214,6 +214,7 @@
   (cond
    (nil? obj-type-str) "(nil)"
    (re-find #"^Var .*" obj-type-str) "Var"
+   (re-find #"^clojure\.lang\.Atom@" obj-type-str) "Atom"
    :else obj-type-str))


Replace an unused local binding with '_'

--- src/cljam/io/util/bgzf/gzi.clj
+++ src/cljam/io/util/bgzf/gzi.clj
@@ -41,7 +41,7 @@
   (let [off (unsigned-bit-shift-right compressed-offset 16)
         [uncompressed] (->> gzi
                             rseq
-                            (filter (fn [[u c]] (= (long c) off)))
+                            (filter (fn [[_ c]] (= (long c) off)))
                             first)]
     (assert uncompressed)
     (+ uncompressed (bit-and compressed-offset 0xffff))))


Reset form and atoms after submission

Reset form and atoms after submission

--- src/cljs/memoria/add_card.cljs
+++ src/cljs/memoria/add_card.cljs
@@ -5,38 +5,50 @@
             [memoria.data-binding :refer [bind-input]]
             [memoria.app :as app]))

-(defn- on-form-submit [event params]
+(def ^:private jquery (js* "$"))
+
+(def ^:private title-atom (r/atom nil))
+(def ^:private contents-atom (r/atom nil))
+(def ^:private tags-atom (r/atom nil))
+
+(defn- reset-inputs []
+  (reset! title-atom nil)
+  (reset! contents-atom nil)
+  (reset! tags-atom nil))
+
+(defn- on-form-submit [event]
   (.preventDefault event)
-  (do-post "/cards"
-           (fn [resp]
-             (app/load-latest-cards)
-             (modal/close-modal))
-           params))
+  (let [params {:title @title-atom
+                :contents @contents-atom
+                :tags @tags-atom}]
+    (do-post "/cards"
+             (fn [resp]
+               (app/load-latest-cards)
+               (reset-inputs)
+               (modal/close-modal))
+             params)))

 (defn add-card-modal []
-  (let [title (r/atom nil)
-        contents (r/atom nil)
-        tags (r/atom nil)]
+  [:div {:key "add-card-modal" :class "container memoria-modal"}
+   [:h2 {:class "ui aligned header"} "Add new card"]
+   [:div {:class "ui divider"}]

-    [:div {:key "add-card-modal" :class "container memoria-modal"}
-     [:h2 {:class "ui aligned header"} "Add new card"]
-     [:div {:class "ui divider"}]
-
-     [:form {:class "ui small form"
-             :action "#"
-             :on-submit #(on-form-submit %1 {:title @title
-                                             :contents @contents
-                                             :tags @tags})}
-      [:div {:class "required field"}
-       [:label "Title"]
-       [:input {:type "text" :on-change (bind-input title)}]]
-      [:div {:class "required field" :required true}
-       [:label "Content"]
-       [:textarea {:rows "5" :on-change (bind-input contents)}]]
-      [:div {:class "field"}
-       [:label "Tags"]
-       [:input {:type "text" :on-change (bind-input tags) :placeholder "tags are separated by spaces or commas"}]]
-      [:button {:class "ui center aligned button blue" :type "submit"} "Submit"]]]))
+   [:form {:class "ui small form"
+           :action "#"
+           :on-submit #(on-form-submit %1)}
+    [:div {:class "required field"}
+     [:label "Title"]
+     [:input {:value @title-atom :type "text" :on-change (bind-input title-atom)}]]
+    [:div {:class "required field" :required true}
+     [:label "Content"]
+     [:textarea {:value @contents-atom :rows "5" :on-change (bind-input contents-atom)}]]
+    [:div {:class "field"}
+     [:label "Tags"]
+     [:input {:type "text"
+              :value @tags-atom
+              :on-change (bind-input tags-atom)
+              :placeholder "tags are separated by spaces or commas"}]]
+    [:button {:class "ui center aligned button blue" :type "submit"} "Submit"]]])

 (defn add-card-button []
   (let [on-click (fn []


Rename KDFType protocol to IKDF and add new function for bytebuffer support)

--- src/clojure/buddy/core/kdf.clj
+++ src/clojure/buddy/core/kdf.clj
@@ -16,10 +16,11 @@
            org.bouncycastle.crypto.Mac
            clojure.lang.Keyword))

-(defprotocol KDFType
+(defprotocol IKDF
   "Generic type that unify access to any implementation
   of kdf implemented in buddy."
-  (generate-bytes! [_ length] "Generate bytes"))
+  (generate-byte-array! [_ length] "Generate byte array of specified length.")
+  (generate-byte-buffer! [_ length] "Generate byte buffer of specified length."))

 (defn- generate-byte-array
   [impl length]


Removed redundant spacing

Removed redundant spacing

--- src/cylon/signup/protocols.clj
+++ src/cylon/signup/protocols.clj
@@ -15,8 +15,6 @@
 (defprotocol EmailVerifiedRenderer
   (render-email-verified [_ req model]))

-
-
 (defprotocol Emailer
   (send-email [_ email title body]))


Set up lein

Set up lein

--- link/.lein/profiles.clj
+++ link/.lein/profiles.clj
@@ -7,6 +7,8 @@
                                 org.clojure/clojure
                                 cheshire com.fasterxml.jackson.core/jackson-core]]
                   [jonase/eastwood "0.2.3"]]
+
+        :source-paths ["~/.lein/src"]

         :injections [;; humane-test-output makes clojure.test output more better
                      ;; ...except when it's dealing with doubles...
@@ -20,8 +22,9 @@
                        [org.clojure/tools.nrepl "0.2.12"]
                        [org.clojure/tools.trace "0.7.8"]
                        [pjstadig/humane-test-output "0.8.0"]
+                       [evalive "1.1.0"]
                        [slamhound "1.5.5"]
-                       [spyscope "0.1.5"]]}
+                       [spyscope "0.1.5"]]

- :repl {:plugins [[cider/cider-nrepl "0.12.0"]
-                  [refactor-nrepl "2.2.0"]]}}
+        :repl {:plugins [[cider/cider-nrepl "0.13.0"]
+                         [refactor-nrepl "2.2.0"]]}}}


Add missing space to warning messages

Add missing space to warning messages

--- src/adzerk/boot_cljs/impl.clj
+++ src/adzerk/boot_cljs/impl.clj
@@ -107,9 +107,9 @@
                         (butil/warn (str "WARNING: "
                                          s
                                          (if (:line env)
-                                           (str "at line " (:line env) " " path)
+                                           (str " at line " (:line env) " " path)
                                            (when path
-                                             (str "in file " path)))
+                                             (str " in file " path)))
                                          "\n"))
                         (butil/dbug* "%s\n" (butil/pp-str warning-data))
                         (swap! warnings conj warning-data)))))]


fix typos

fix typos

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -286,32 +286,28 @@
                        :sem {:pred :talk
                              :subj {:human true}}}}]

-    "ir" {:espanol {:future-stem "ir"
-                       :present {:1sing "voy"
-                                 :2sing "vas"
-                                 :3sing "va"
-                                 :1plur "vamos"
-                                 :2plur "vais"
-                                 :3plur "van"}
-                      :preterito {:1sing "fui"
-                                 :2sing "fuiste"
-                                 :3sing "fue"
-                                 :1plur "fuimos"
-                                 :2plur "fuisteis"
-                                 :3plur "fueron"}
-                      :imperfecto {:1sing "iba"
-                                 :2sing "ibas"
-                                 :3sing "iba"
-                                 :1plur "ibamos"
-                                 :2plur "ibais"
-                                 :3plur "iban"}
-
-
-            :synsem {:cat :verb
-
-                     :sem {:subj {:animate true}
-                           :pred :go}}}
-
+   "ir" {:espanol {:future-stem "ir"
+                   :present {:1sing "voy"
+                             :2sing "vas"
+                             :3sing "va"
+                             :1plur "vamos"
+                             :2plur "vais"
+                             :3plur "van"}
+                   :preterito {:1sing "fui"
+                               :2sing "fuiste"
+                               :3sing "fue"
+                               :1plur "fuimos"
+                               :2plur "fuisteis"
+                               :3plur "fueron"}
+                   :imperfecto {:1sing "iba"
+                                :2sing "ibas"
+                                :3sing "iba"
+                                :1plur "ibamos"
+                                :2plur "ibais"
+                                :3plur "iban"}}
+         :synsem {:cat :verb
+                  :sem {:subj {:animate true}
+                        :pred :go}}}
     "Juan y yo"
       [{:synsem {:cat :noun
                  :pronoun true
@@ -387,7 +383,7 @@
    (let [shared-part-of-poder
                    {:espanol {:boot-stem1 "pued"
                               :boot-stem2 "pod"}
-                    :synsem {:cat :verb}}
+                    :synsem {:cat :verb}}]
      [(merge shared-part-of-poder
              {:synsem {:pred :can}})
       (merge shared-part-of-poder
@@ -395,23 +391,23 @@
       (merge shared-part-of-poder
              {:synsem {:pred :be-able-to}})])

-   "potere"
-   (let [shared-part-of-potere
-   {:synsem {:cat :verb}
-    :italiano {:future-stem "potr"
-    :drop-e true
-   :present {:1sing "posso"
-             :2sing "puoi"
-             :3sing "può"
-             :1plur "possiamo"
-             :2plur "potete"
-             :3plur "possono"}}}
-   [(merge shared-part-of-potere
-             {:synsem {:pred :can}})
-      (merge shared-part-of-potere
-             {:synsem {:pred :may}})
-           (merge shared-part-of-potere
-             {:synsem {:pred :be-able-to}})])
+   "potere"
+          (let [shared-part-of-potere
+                {:synsem {:cat :verb}
+                 :italiano {:future-stem "potr"
+                            :drop-e true
+                            :present {:1sing "posso"
+                                      :2sing "puoi"
+                                      :3sing "può"
+                                      :1plur "possiamo"
+                                      :2plur "potete"
+                                      :3plur "possono"}}}]
+            [(merge shared-part-of-potere
+                    {:synsem {:pred :can}})
+             (merge shared-part-of-potere
+                    {:synsem {:pred :may}})
+             (merge shared-part-of-potere
+                    {:synsem {:pred :be-able-to}})])

    "quedarse" (let [subject-semantics (ref {:animate true})
                     subject-agr (ref :top)]
@@ -483,8 +479,7 @@
                    :number :sing}
              :sem {:human true
                    :pred :I}
-             :subcat '()}}
-   })
+             :subcat '()}}})

 ;; see TODOs in lexiconfn/compile-lex (should be more of a pipeline as opposed to a argument-position-sensitive function.
 (def lexicon


make sidebar fixed, so prefs screen don't look so ugly

--- src/braid/ui/styles/misc.cljs
+++ src/braid/ui/styles/misc.cljs
@@ -9,7 +9,7 @@
     [:.main

      [:.sidebar
-      {:position "absolute"
+      {:position "fixed"
        :left 0
        :top 0
        :bottom 0


Use form helpers to create login form.

Use form helpers to create login form.

--- src/cadence/views/landing.clj
+++ src/cadence/views/landing.clj
@@ -4,21 +4,31 @@
             [noir.cookies :as cook])
   (:use noir.core
         hiccup.core
-        hiccup.page-helpers))
+        hiccup.page-helpers
+        hiccup.form-helpers))

 (defpage root "/" []
   (common/layout
     [:h1 "Cadence"]
     [:p "Welcome to cadence"]))

+(defn alabel [name] (label name name))
+
+(defpartial form-with-labels
+  "Returns labels and text fields for each name in the given collection."
+  [coll]
+  (for [field coll]
+    (alabel field)
+    ((if ((.toLower field) == "password") password-field text-field) field)))
+
 (defpage login "/login" []
   (common/layout
     [:h1 "Login"]
     [:p "WELCOME TO THE LOGIN PAGE!"]
-    [:form [:post "/login"]
-     [:input "Username"]
-     [:input "Password"]
-     [:input "Login"]]))
+    (with-group "login"
+                (form-to [:post "/login"]
+                         (form-with-labels ["Username" "Password"])
+                         (submit-button "Login")))))

 (defpage login-check [:post "/login"] []
   (response/empty {:hello "world"}))


spacing

spacing

--- src/celestial/api/actions.clj
+++ src/celestial/api/actions.clj
@@ -30,6 +30,7 @@
 (defmodel arguments :args {:type "Hash" :description "key value pairs {'foo':1 , 'bar':2 , ...}" })

 (defroutes- actions {:path "/actions" :description "Adhoc actions managment"}
+
   (POST- "/actions" [& ^:action action] {:nickname "addActions" :summary "Adds an actions set"}
     (wrap-errors (success {:msg "added actions" :id (a/add-action action)})))


fix imports

fix imports

--- src/ceres_geschichte/core.clj
+++ src/ceres_geschichte/core.clj
@@ -14,7 +14,8 @@
             [geschichte.platform :refer [create-http-kit-handler! <!? start stop]]
             [clojure.core.async :refer [>!!]]
             [aprint.core :refer [aprint]]
-            [taoensso.timbre :as timbre]))
+            [taoensso.timbre :as timbre])
+  (:import [java.io DataOutputStream ByteArrayOutputStream]))

 (timbre/refer-timbre)


Manually add special forms to autocomplete

--- src/clj/clojuredocs/entry.clj
+++ src/clj/clojuredocs/entry.clj
@@ -70,6 +70,41 @@
                                         :column :added :static :doc :line])))]
     (clucy/add search-index nm)))

+(def special-forms
+  [{:name 'def
+    :ns "clojure.core"
+    :doc "Creates and interns or locates a global var with the name of symbol and a namespace of the value of the current namespace (*ns*). See http://clojure.org/special_forms for more information."}
+   {:name 'if
+    :ns "clojure.core"
+    :doc "Evaluates test."}
+   {:name 'do
+    :ns "clojure.core"
+    :doc "Evaluates the expressions in order and returns the value of the last. If no expressions are supplied, returns nil. See http://clojure.org/special_forms for more information."}
+   {:name 'quote
+    :ns "clojure.core"
+    :doc "Yields the unevaluated form. See http://clojure.org/special_forms for more information."}
+   {:name 'var
+    :ns "clojure.core"
+    :doc "The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x). See http://clojure.org/special_forms for more information."}
+   {:name 'recur
+    :ns "clojure.core"
+    :doc "Evaluates the exprs in order, then, in parallel, rebinds the bindings of the recursion point to the values of the exprs."}
+   {:name 'throw
+    :ns "clojure.core"
+    :doc "Evaluates the exprs in order, then, in parallel, rebinds the bindings of the recursion point to the values of the exprs. "}
+   {:name 'try
+    :ns "clojure.core"
+    :doc "The exprs are evaluated and, if no exceptions occur, the value of the last is returned. If an exception occurs and catch clauses are provided, each is examined in turn and the first for which the thrown exception is an instance of the named class is considered a matching catch clause. If there is a matching catch clause, its exprs are evaluated in a context in which name is bound to the thrown exception, and the value of the last is the return value of the function. If there is no matching catch clause, the exception propagates out of the function. Before returning, normally or abnormally, any finally exprs will be evaluated for their side effects."}
+   {:name '.
+    :ns "clojure.core"
+    :doc "The '.' special form is the basis for access to Java. It can be considered a member-access operator, and/or read as 'in the scope of'."}
+   {:name 'set!
+    :ns "clojure.core"
+    :doc "Assignment special form. When the first operand is a field member access form, the assignment is to the corresponding field. If it is an instance field, the instance expr will be evaluated, then the expr. In all cases the value of expr is returned. Note - you cannot assign to function params or local bindings. Only Java fields, Vars, Refs and Agents are mutable in Clojure."}])
+
+(doseq [m special-forms]
+  (clucy/add search-index m))
+
 ;; https://gist.github.com/ck/960716
 (defn- compute-next-row
   "computes the next row using the prev-row current-element and the other seq"
@@ -102,7 +137,7 @@

 (defn lucene-escape [s]
   (-> s
-      (str/replace #"[\+\-\!\(\)\{\}\[\]\^\"\~\*\?\:\\]" "\\\\$0")))
+      (str/replace #"[\+\-\!\(\)\{\}\[\]\^\"\~\*\?\:\\\/]" "\\\\$0")))

 (defn search [query]
   (when-not (empty? query)


Support hoplon files

Support hoplon files

--- src/clj/nightcode/editors.clj
+++ src/clj/nightcode/editors.clj
@@ -15,7 +15,7 @@
            [javafx.scene.web WebEngine]
            [java.io File]))

-(def ^:const clojure-exts #{"boot" "clj" "cljc" "cljs" "cljx" "edn" "pxi"})
+(def ^:const clojure-exts #{"boot" "clj" "cljc" "cljs" "cljx" "edn" "pxi" "hl"})
 (def ^:const instarepl-exts #{"clj" "cljc"})
 (def ^:const wrap-exts #{"md" "txt"})
 (def ^:const max-file-size (* 1024 1024 2))


process gallery badges

process gallery badges

--- src/clj/salava/gallery/db.clj
+++ src/clj/salava/gallery/db.clj
@@ -80,16 +80,12 @@
       badges-left
       0)))

-(defn badge-sorter [sorter badges]
-  (prn sorter)
-  (prn badges)
-  (if (or (= sorter :recipients) (= sorter :ctime))
-    (sort-by sorter > badges)
-    (sort-by sorter badges)
-    #_(sort #(compare (sorter %1) (sorter %2)) badges)))
-
-(defn process-badges [sorter badges]
-  (let [p (->> badges (group-by (juxt :issuer_content_name :name)))]
+
+(defn add-index [coll]
+  (mapv #(assoc % :index (.indexOf coll %)) coll))
+
+(defn process-badges [badges]
+  (let [indexed-badge-maps (->> (add-index badges) (group-by (juxt :issuer_content_name :name)))]
     (->> (reduce-kv
            (fn [r k v]
              (conj r (if (empty? (rest v))
@@ -98,19 +94,19 @@
                              otherids (->> (map :badge_id v)
                                            (remove #(= (:badge_id badge) %))
                                            vec)]
-                         (assoc badge :other_ids otherids))))) [] p)
-         (badge-sorter sorter)
-         #_(if (= sorter (or :ctime :recipients)) (sort-by sorter >) (sort-by sorter)))))
+                         (assoc badge :other_ids otherids))))) [] indexed-badge-maps)
+         (sort-by :index <)
+         (map #(dissoc % :index)))))

 (defn select-badges [ctx badge_ids order page_count]
   (let [limit 20
         offset (* limit page_count)]
     (if (not-empty badge_ids)
       (case order
-        "recipients"          (process-badges :recipients (select-gallery-badges-order-by-recipients {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
-        "issuer_content_name" (process-badges :issuer_content_name (select-gallery-badges-order-by-ic-name {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
-        "name"                (process-badges :name (select-gallery-badges-order-by-name {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
-        (process-badges :ctime (select-gallery-badges-order-by-ctime {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))))))
+        "recipients"          (process-badges (select-gallery-badges-order-by-recipients {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
+        "issuer_content_name" (process-badges (select-gallery-badges-order-by-ic-name {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
+        "name"                (process-badges (select-gallery-badges-order-by-name {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))
+        (process-badges (select-gallery-badges-order-by-ctime {:badge_ids badge_ids :limit limit :offset offset} (get-db ctx)))))))

 (defn db-connect [ctx query params]


Don't request credentials every time

Don't request credentials every time

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -29,7 +29,7 @@
 (def ^:const git-name "Git")
 (def ^:const max-commits 50)

-; commands
+; utils

 (defn address->name
   [s]
@@ -40,26 +40,26 @@
   [^FileRepository repo]
   (-> repo .getConfig (.getString "remote" "origin" "url")))

-(defn creds
-  []
-  (proxy [CredentialsProvider] []
-    (isInteractive [] false)
-    (supports [& items] true)
-    (get [uri items]
-      (let [success? (promise)]
-        (s/invoke-later
-          (doseq [item items]
-            (when-not (realized? success?)
-              (if-let [s (dialogs/show-input-dialog! (.getPromptText item)
-                                                     (.isValueSecure item))]
-                (cond
-                  (isa? (type item) CredentialItem$CharArrayType)
-                  (.setValue item (char-array s))
-                  (isa? (type item) CredentialItem$StringType)
-                  (.setValue item s))
-                (deliver success? false))))
-          (deliver success? true))
-        @success?))))
+(def creds
+  (delay
+    (proxy [CredentialsProvider] []
+      (isInteractive [] false)
+      (supports [& items] true)
+      (get [uri items]
+        (let [success? (promise)]
+          (s/invoke-later
+            (doseq [item items]
+              (when-not (realized? success?)
+                (if-let [s (dialogs/show-input-dialog! (.getPromptText item)
+                                                       (.isValueSecure item))]
+                  (cond
+                    (isa? (type item) CredentialItem$CharArrayType)
+                    (.setValue item (char-array s))
+                    (isa? (type item) CredentialItem$StringType)
+                    (.setValue item s))
+                  (deliver success? false))))
+            (deliver success? true))
+          @success?)))))

 (defn progress-monitor
   [dialog cancelled?]
@@ -72,12 +72,14 @@
     (start [this total-tasks])
     (update [this completed])))

+; commands
+
 (defn clone!
   [^String uri f progress]
   (-> (Git/cloneRepository)
       (.setURI uri)
       (.setDirectory f)
-      (.setCredentialsProvider (creds))
+      (.setCredentialsProvider @creds)
       (.setProgressMonitor progress)
       .call
       .close))
@@ -127,14 +129,14 @@
 (defn pull!
   [^FileRepository repo ^ProgressMonitor progress]
   (-> repo Git. .pull
-      (.setCredentialsProvider (creds))
+      (.setCredentialsProvider @creds)
       (.setProgressMonitor progress)
       .call))

 (defn push!
   [^FileRepository repo ^ProgressMonitor progress]
   (-> repo Git. .push
-      (.setCredentialsProvider (creds))
+      (.setCredentialsProvider @creds)
       (.setProgressMonitor progress)
       .call))


some monadic + FP patterns playing around

--- src/clojure_learning/tmp7.clj
+++ src/clojure_learning/tmp7.clj
@@ -52,3 +52,60 @@
 (take-until 10 [1 2 [3 [4 5] 6] 7]) ;; [1 2 3 4]
 (take-until 9 (range))              ;; [0 1 2 3]
 (take-until 30 [1 2 [3 [4 [5 [6 [7 12 13]] 9]] 10] 11]) ;; [1 2 [3 [4 [5 [5 [7]]]]]]
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; the wrapper functional design-pattern
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn wrapper [func]
+  (fn [& args] (apply func args)))
+
+(defn add [a b] (+ a b))
+(defn minus [a b] (- a b))
+
+(defn add-wrapper [a b]
+  ((-> add wrapper) a b))
+
+(add-wrapper 2 2) ;; 4
+(add-wrapper 2 3) ;; 5
+
+(defn minus-wrapper [& args]
+  (apply (-> minus wrapper) args))
+
+(minus-wrapper 3 1) ;; 2
+
+;; always remember that curry is the process of transforming a multi-argument function, into a chain of
+;; single argument function, each function taking exactly ONE of the arguments, and returning another
+;; function which takes the next argumeent until the argument-list is exhausted.
+;; while partial application is the process of binding SOME of the arguments to some values, while returning
+;; another function which behaves like the one initially applied, but the returned function takes the REST of
+;; the arguments.
+
+;; building on the previous wrappers, the sequence monad would look like:
+;; every monad had two HOFs: unit + bind
+(defn unit [op-result]
+  (str "this is a higher order Type which is not compatible with the op arg-types: " op-result))
+(defn bind [func]
+  (fn [args]
+    (if (every? integer? args)
+      (apply func args)
+      (throw (IllegalArgumentException. (str "Not a number!" args))))))
+
+;; define base-operations
+(defn add [a b] (+ a b))
+(defn minus [a b] (- a b))
+
+(defn lift-add [add & args]
+  ((bind add) args))
+(defn lift-minus [minus & args]
+  ((bind minus) args))
+
+(def five (lift-add add 2 3))
+(println five)
+
+(def two (lift-minus minus 5 3))
+(println two)
+
+(def wrong-input (lift-add "str" 2)) ;; -> compiler exception
+
+(-> (lift-minus minus 3 1)
+    unit)


make maps comparable

make maps comparable

--- src/com/kaicode/infamous.cljs
+++ src/com/kaicode/infamous.cljs
@@ -55,8 +55,11 @@
                                         (famous-compare x y))

                  function (^number -compare [x y]
-                                            (println "type x=" (type x) " type y=" (type y))
-                                            (famous-compare x y)))
+                                            (famous-compare x y))
+
+                 PersistentArrayMap (^number -compare [x y]
+                                                      (famous-compare x y))
+                 )

 (def schema {:node/id         {:db/unique :db.unique/identity}
              :node/children   {:db/cardinality :db.cardinality/many


remove dead code from old collector code

--- src/com/rpl/specter/impl.cljc
+++ src/com/rpl/specter/impl.cljc
@@ -619,13 +619,6 @@
   (transform* [^CodeWalkerStructurePath this structure next-fn]
     (codewalk-until (.-afn this) next-fn structure)))

-(deftype SelectCollector [sel-fn selector])
-
-(extend-protocol p/Collector
-  SelectCollector
-  (collect-val [^SelectCollector this structure]
-    ((.-sel-fn this) (.-selector this) structure)))
-
 (defn srange-select [structure start end next-fn]
   (next-fn (-> structure vec (subvec start end))))


Add translations for clipboard buttons

Add translations for clipboard buttons

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -12,11 +12,13 @@
                      :because          "weil"
                      :chars-remaining  "Zeichen verbleibend"
                      :close            "Schließen"
+                     :delete           "Löschen"
                      :hello            "Hallo"
                      :issue            "Diskussionsthema"
                      :login            "Login"
                      :logout           "Logout"
                      :options          "Einstellungen"
+                     :select           "Auswählen"
                      :save             "Speichern"
                      :show-discuss     "Zeige discuss"
                      :start-discussion "Starte die Diskussion"
@@ -70,11 +72,13 @@
                      :because          "because"
                      :chars-remaining  "characters remaining"
                      :close            "Close"
+                     :delete           "Delete"
                      :hello            "Hello"
                      :issue            "Issue"
                      :login            "Login"
                      :logout           "Logout"
                      :options          "Options"
+                     :select           "Select"
                      :save             "Save"
                      :show-discuss     "Show discuss"
                      :start-discussion "Start Discussion"


planckconstant, rel-momentum, massofproton

--- SpecialRel.clj
+++ SpecialRel.clj
@@ -46,3 +46,15 @@

 (defn spacetimeinterval2 [t1 t2 x1 x2]
   (Math/sqrt (- (Math/pow (- t2 t1) 2) (Math/pow (- x2 x1) 2))))
+
+(def planck-constant 6.626e-34)
+
+(def mass-of-proton 1.67e-27)
+
+(defn energy [wavelength]
+  (/ (* planck-constant c)
+     wavelength))
+
+(defn rel-momentum [p m]
+  (Math/sqrt (/ (Math/pow (/ p m) 2)
+                (+ 1 (/ (Math/pow (/ p m) 2) 1)))))


use helpers provided by pedestal-api

use helpers provided by pedestal-api

--- src/ephemeris_api/service.clj
+++ src/ephemeris_api/service.clj
@@ -1,10 +1,11 @@
 (ns ephemeris-api.service
   (:require [io.pedestal.http :as bootstrap]
             [io.pedestal.interceptor :refer [interceptor]]
-            [io.pedestal.interceptor.helpers :refer [before handler]]
             [ring.util.response :refer [response not-found created resource-response content-type status redirect]]
             [schema.core :as s]
-            [pedestal-api.core :as api]
+            [pedestal-api
+             [core :as api]
+             [helpers :refer [defhandler handler]]]
             [ephemeris-api.config :refer [config]]
             [ephemeris.core :refer (calc)]))

@@ -16,15 +17,15 @@
                        :sdd s/Num}}})

 (def mundane
-  (api/annotate
+  (handler
+   ::mundane
    {:summary   "Get the current mundane planetary positions."
     :responses {200 {:body Points}}}
-   (handler ::mundane
-     (fn [request]
-       {:status 200
-        :body (calc {:angles []
-                     :houses false
-                     :meta false})}))))
+   (fn [request]
+     {:status 200
+      :body (calc {:angles []
+                   :houses false
+                   :meta false})})))

 ;; (s/with-fn-validation ;; Optional, but nice to have at compile time
 (api/defroutes routes


Changed to using Calendar instead of Instant for java 7

--- src/hphelper/live/control.clj
+++ src/hphelper/live/control.clj
@@ -21,7 +21,8 @@
 (defn current-time
   "Returns the current time as a long"
   []
-  (.toEpochMilli (java.time.Instant/now)))
+  (.getTimeInMillis (java.util.Calendar/getInstance))
+  )

 (defn- player-setup
   "Adds a uuid key under :password to a player map, performs other live setup, returns the map"