(PDB-4905) Add debug logging for factset hashing

--- src/puppetlabs/puppetdb/scf/hash.clj
+++ src/puppetlabs/puppetdb/scf/hash.clj
@@ -3,6 +3,8 @@
             [puppetlabs.kitchensink.core :as kitchensink]
             [puppetlabs.puppetdb.package-util :refer [package-tuple hashed-package-tuple
                                                       package-tuple-hash]]
+            [clojure.tools.logging :as log]
+            [puppetlabs.i18n.core :refer [trs]]
             [schema.core :as s])
   (:import [java.security MessageDigest]))

@@ -222,13 +224,24 @@
   and producer.
   "
   [fact-data]
-  (-> ;; If the :package_inventory is not a seq (ie. empty) in fact-data
-      ;; we remove package-inventory key entirely because an absent
-      ;; and empty package inventory are stored identically so there's no
-      ;; way to tell them apart during sync, and we need the the hashing
-      ;; to be consistent.
-      (if (seq (:package_inventory fact-data))
-        fact-data
-        (dissoc fact-data :package_inventory))
-      (dissoc :timestamp :producer_timestamp :producer)
-      generic-identity-hash))
+  (let [id-hash (-> ;; If the :package_inventory is not a seq (ie. empty) in fact-data
+                    ;; we remove package-inventory key entirely because an absent
+                    ;; and empty package inventory are stored identically so there's no
+                    ;; way to tell them apart during sync, and we need the the hashing
+                    ;; to be consistent.
+                    (if (seq (:package_inventory fact-data))
+                      fact-data
+                      (dissoc fact-data :package_inventory))
+                    (dissoc :timestamp :producer_timestamp :producer)
+                    generic-identity-hash)
+        package-count (if-let [packages (get fact-data :package_inventory nil)]
+                        (count packages)
+                        "no")]
+    (log/debug (trs "Factset hash for {0} in {1} at {2} with {3} keys and {4} packages produced {5}"
+                    (:certname fact-data)
+                    (:environment fact-data)
+                    (:producer_timestamp fact-data)
+                    (count (keys (:values fact-data)))
+                    package-count
+                    id-hash))
+    id-hash))


referenced by sente

referenced by sente

--- cljx/plongeur-clj/project.clj
+++ cljx/plongeur-clj/project.clj
@@ -21,7 +21,7 @@
                  [ring "1.4.0"]
                  [compojure "1.5.0"]
                  [clojurewerkz/route-one "1.2.0"]
-                 [http-kit "2.1.18"]
+                 ;[http-kit "2.1.18"]
                  [com.taoensso/sente "1.8.1"]
                  [com.taoensso/timbre "4.3.1"]


controls-handler now accepts keys for fns

--- src/spacetime/controls/original.cljs
+++ src/spacetime/controls/original.cljs
@@ -34,7 +34,7 @@

 (defn controls-handler
   "Move camera according to player controls"
-  [left-fn up-fn right-fn down-fn & [space-fn]]
+  [{:keys [left-fn up-fn right-fn down-fn space-fn]}]
   ;; perhaps I can think of something more clever later on, but remember
   ;; cond/condp won't work because you have to account for when two keys
   ;; are held simultaneously!


Mac can start hosted mode now

Mac can start hosted mode now

Finally managed to get the subprocesses to work

--- src/webapp/framework/server/core.clj
+++ src/webapp/framework/server/core.clj
@@ -220,6 +220,9 @@

 (println "********************************")
 (def max-figwheel-processes 1)
+
+(println (str "******************************** *hosted-mode* = " *hosted-mode*))
+
 ; deletes the realtime log every time the file is reloaded, or the server is restarted
 (if *hosted-mode*
   (let [figwheel-index    (range 0 max-figwheel-processes)]
@@ -271,7 +274,7 @@
                  (println (str "***DONE CHMOD +X "))

                  (println (str "***STARTING APP   " a))
-                 (comment let [p  (cond (is-mac-osx) (me.raynes.conch.low-level/proc (str  *project-root-mac*      "figwheel_dev_envs/app0/coils/start_figwheel_client.sh"))
+                 (let [p  (cond (is-mac-osx) (me.raynes.conch.low-level/proc (str  *project-root-mac*      "figwheel_dev_envs/app0/coils/start_figwheel_client.sh"))
                                 :else        (me.raynes.conch.low-level/proc (str  *project-root-windows* "figwheel_dev_envs\\app0\\coils\\start_figwheel_client.bat")))]
                    (future (do
                              (me.raynes.conch.low-level/stream-to-out p :out)


CMR-6221 added comments for fields

CMR-6221 added comments for fields

--- common-app-lib/src/cmr/common_app/services/search/query_model.clj
+++ common-app-lib/src/cmr/common_app/services/search/query_model.clj
@@ -229,10 +229,23 @@
   [])

 (defrecord MatchCondition
-  [field value])
+  [
+    ;; The field being searched
+    field
+
+    ;; The value of the field
+    value])

 (defrecord MatchFilterCondition
-  [field value filter])
+  [
+    ;; The field being searched
+    field
+
+    ;; The value of the field
+    value
+
+    ;; A filter condition for the match.
+    filter])

 (defrecord RelatedItemQueryCondition
   [


implement initial structure of core

implement initial structure of core

--- src/aspire/core.clj
+++ src/aspire/core.clj
@@ -1,12 +1,25 @@
 (ns aspire.core
-  (:require [jdbc-pg-init.core :as jpi]
-            [clojure.edn :as edn]))
+  (:require [aspire.conf :as a-conf]
+            [aspire.cli :as a-cli]
+            [aspire.util :as a-util]
+            [aspire.sql-db :as a-sql-db])
+  (:gen-class))

-(def schema (edn/read-string (slurp "schema.edn")))
+(defn aspire [conf]
+  (println :aspire "Do it. Do it now."))

-(comment
-  (use '[clojure.tools.namespace.repl :only (refresh)])
-  (def db (edn/read-string (slurp "sample-config.edn")))
-  (def db (assoc db :password "" :subname "//kirk.office.vlacs.org/moodletest2_vlacs_org"))
-  (jpi/init! db schema)
-  )
+(defn -main [& args]
+  ;; work around dangerous default behaviour in Clojure
+  (alter-var-root #'*read-eval* (constantly false))
+  (let [opts (a-cli/get-opts args)
+        conf (a-conf/getconf a-conf/configs opts)
+        db (:conf-sql-db conf)]
+    (a-util/output! :opts opts :conf conf :db db)
+
+    (cond
+     (:init-sql opts) (a-sql-db/init! db)
+     (:zero-out opts) (a-sql-db/print-drop-sql!)
+     :else (aspire conf))))
+
+
+


more logging

more logging

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -188,23 +188,28 @@
 (defn moreover-comp [parent child lexfn-sem-impl]
   (log/trace (str "moreover-comp type parent: " (type parent)))
   (log/trace (str "moreover-comp type comp:" (type child)))
+  (log/debug (str "moreover-comp: child cat: " (get-in child [:synsem :cat])))
+  (log/debug (str "moreover-comp: parent comp cat: " (get-in parent [:comp :synsem :cat])))

-  (let [result
-        (if (comp-pre-checks parent child)
+  (let [pre-check (comp-pre-checks parent child)
+        result
+        (if pre-check
           (do
-            (log/trace (str "child: " child " failed pre-check."))
+            (log/debug (str "child failed pre-check."))
             :fail)
           (unifyc parent
                   {:comp child}
                   {:comp {:synsem {:sem (lexfn-sem-impl (get-in child '(:synsem :sem) :top))}}}))]
     (if (not (fail? result))
-      (merge {:comp-filled true}
-             result)
+      (do (log/debug "unification was successful.")
+          (merge {:comp-filled true}
+                 result))
       ;; else: fail:
       (do
         (log/trace (str "moreover-comp: fail: " result))
-        (log/debug (str "moreover-comp: fail-path-between:"
-                        (fail-path-between parent {:comp child})))
+        (if (= false pre-check)
+          (log/warn (str "moreover-comp: pre-checked missed: fail-path-between:"
+                         (fail-path-between parent {:comp child}))))
         (log/trace (str "moreover-comp: fail: child: " (strip-refs child)))
         (if (and
              *throw-exception-if-failed-to-add-complement*


improve (defn spec-info) a bit

improve (defn spec-info) a bit

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -47,6 +47,12 @@
    (merge
     (if-let [cat (get-in spec [:synsem :cat])]
       {:cat cat})
+    (if-let [subcat (get-in spec [:synsem :subcat])]
+      {:subcat subcat})
+    (if-let [rule (get-in spec [:rule])]
+      {:rule rule})
+    (if-let [mod (get-in spec [:synsem :mod])]
+      {:mod mod})
     (if-let [essere (get-in spec [:synsem :essere])]
       {:essere essere})
     (if-let [pred (get-in spec [:synsem :sem :pred])]


whitespace

whitespace

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -53,19 +53,18 @@
    (check-vals parent child [:head :synsem :aux]            [:synsem :aux])
    (check-vals parent child [:head :synsem :pronoun]        [:synsem :pronoun])
    (check-vals parent child [:head :synsem :propernoun]     [:synsem :propernoun])
-   (check-vals parent child [:head :synsem :subcat]         [:synsem :subcat]))
-  )
+   (check-vals parent child [:head :synsem :subcat]         [:synsem :subcat])
+  ))

 (defn comp-pre-checks [parent child]
   (or
-   (check-vals parent child [:comp :synsem :cat]       [:synsem :cat])
-   (check-vals parent child [:comp :synsem :agr]       [:synsem :agr])
-   (check-vals parent child [:comp :synsem :case]      [:synsem :case])
-   (check-vals parent child [:comp :synsem :sem]       [:synsem :sem])
-   (check-vals parent child [:comp :synsem :reflexive] [:synsem :reflexive])
-   (check-vals parent child [:comp :synsem :pronoun]   [:synsem :pronoun])
-   (check-vals parent child [:comp :synsem :subcat]    [:synsem :subcat])
-
+   (check-vals parent child [:comp :synsem :cat]            [:synsem :cat])
+   (check-vals parent child [:comp :synsem :agr]            [:synsem :agr])
+   (check-vals parent child [:comp :synsem :case]           [:synsem :case])
+   (check-vals parent child [:comp :synsem :sem]            [:synsem :sem])
+   (check-vals parent child [:comp :synsem :reflexive]      [:synsem :reflexive])
+   (check-vals parent child [:comp :synsem :pronoun]        [:synsem :pronoun])
+   (check-vals parent child [:comp :synsem :subcat]         [:synsem :subcat])
    ))

 (defn moreover-head [parent child & [morph]]


System-Env port

System-Env port

Runs on the port from env-variable PORT or 8080. Required for deploying
in Heroku.

--- src/cine/server.clj
+++ src/cine/server.clj
@@ -36,7 +36,9 @@
       (wrap-defaults site-defaults)))

 (defn -main
-  "Main Entry point of the app"
+  "Starting the immutant server"
   []
-  (run app {:host "localhost" :port 9003}))
+  (let [PORT (Integer . (or (System/getenv "PORT") "8080"))]  ;; getting PORT number form env-variable $PORT
+                                                              ;;for deploying to heroku
+    (run app {:host "localhost" :port PORT})))


Allow seqable things to be come sets

Allow seqable things to be come sets

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

--- src/conexp/base.clj
+++ src/conexp/base.clj
@@ -45,7 +45,7 @@
   [thing]
   (cond
    (integer? thing) (set-of-range thing),
-   (coll? thing)    (set thing),
+   (seqable? thing) (set thing),
    :else            (illegal-argument "Cannot create set from " thing)))


email verfication

email verfication

--- priv/ui/src/holiday_ping_ui/common/tags.cljs
+++ priv/ui/src/holiday_ping_ui/common/tags.cljs
@@ -13,7 +13,7 @@

 (defn trim-separator
   [value]
-  (if last-separator?
+  (if (last-separator? value)
     (apply str (butlast value))
     value))


Playing around with examples

Playing around with examples

--- examples/cljs/transom/examples/counters.cljs
+++ examples/cljs/transom/examples/counters.cljs
@@ -11,7 +11,16 @@
   (patch [this edit]
     (println "You done goofed!")
     (println (pr-str this))
-    (println (pr-str edit))))
+    (println (type this))))
+
+(extend-type default
+  impl/WithTransformableEdit
+  (transform [this _ _]
+    (println "You done goofed!")
+    (println (pr-str this))
+    (println (type this))))
+
+(defn- rand-char [] ((vec (map char (range 97 123))) (rand-int 26)))

 (defn x-ray
   [data owner]
@@ -39,7 +48,8 @@
   (letfn
     [(create [_]
        (om/transact! data [:counters]
-                     #(conj % {:id (-> % last :id inc) :value "grrr"})))]
+                     #(conj % {:id (-> % last :id inc)
+                               :value (apply str (repeat (inc (rand-int 5)) "g"))})))]
     (reify
       om/IRender
       (render [_]
@@ -50,37 +60,35 @@
                         {:key :id
                          :opts {:parent-data (get data :counters)}}))))))

-(def app-state {:counters (mapv (fn [n] {:id n :value ""}) (range 10))})
+(def app-state {:counters (mapv (fn [n] {:id n
+                                         :value (apply str (repeat n "f"))})
+                                (range 10))})
+
 (def !app-state (atom app-state))
 (def !composed (atom {}))
-(def !transformed (atom {}))
+(def concurrent {[:counters] [[:delete 5] [:retain 5]]
+                 [:counters 0 :value] [[:retain 5] [:insert "hey!"]]
+                 [:counters 4 :value] [[:retain 9]]})

 (defn tx-listener
   [{:keys [path old-value new-value old-state new-state]}]
   (let [edit-map {path (transom/diff old-value new-value)}
-        test-map {[:counters 1 :value] [[:insert "fuck"]]
-                  [:counters] [[:retain 5] [:insert [{:id -1 :value "blah"}]] [:retain 5]]}
         new-state' (transom/patch old-state edit-map)]
     (swap! !composed #(transom/compose old-state % edit-map))
-    (let [[test-map' composed'] (transom/transform app-state
-                                                   test-map
-                                                   @!composed)]
-      (println (pr-str test-map'))
-      (println (pr-str composed'))
-      (when-not (= (transom/patch app-state test-map composed')
-                 (transom/patch app-state @!composed test-map'))
-        (println "You done goofed!")
-        (println
-          (str
-            \newline
-            (pr-str (transom/patch app-state test-map composed'))
-            \newline
-            (pr-str (transom/patch app-state @!composed test-map'))))))
-    (let [new-state'' (transom/patch app-state @!composed)]
+    (let [composed @!composed
+          new-state'' (transom/patch app-state composed)]
       (assert (= new-state new-state' new-state'')
               (str \newline (pr-str new-state)
                    \newline (pr-str new-state')
-                   \newline (pr-str new-state''))))))
+                   \newline (pr-str new-state'')))
+      (let [[concurrent' composed'] (transom/transform app-state concurrent composed)]
+        (println concurrent' composed')
+        (assert (= (transom/patch app-state composed concurrent')
+                   (transom/patch app-state concurrent composed'))
+                (str \newline (pr-str composed)
+                     \newline (pr-str concurrent)
+                     \newline (pr-str composed')
+                     \newline (pr-str concurrent')))))))

 (om/root
   counter-view


Update alfa.clj

Update alfa.clj

--- practice/alfa.clj
+++ practice/alfa.clj
@@ -1,17 +1,17 @@
 (ns euler.practice.alfa)

 ;;take
-(defn take' [a b]
-  (if (= (count b) a)
-    b
-    (take' a (butlast b))))
-
-(defn take'' [a b]
-  (loop [la (dec a)
-         lb '()]
-    (if (= la -1)
-      lb
-      (recur (dec la) (conj lb (nth b la))))))
+(defn take' [n col]
+  (if (= (count col) n)
+    col
+    (take' n (butlast col))))
+
+(defn take'' [n col]
+  (loop [i (dec n)
+         res '()]
+    (if (= i -1)
+      res
+      (recur (dec i) (conj res (nth col i))))))

 (defn take$$ [n ls]
   (loop [i 1 res [] raw ls]


Set charset to UTF-8 for JSON responses.

--- src/ruuvi_server/client_api.clj
+++ src/ruuvi_server/client_api.clj
@@ -74,7 +74,7 @@
               (str jsonp-function "(" (json/generate-string converted-data) ")")
               (json/generate-string converted-data))]
   {:status (or status 200)
-   :headers {"Content-Type" "application/json"}
+   :headers {"Content-Type" "application/json;charset=UTF-8"}
    :body body}))

 (defn- ping [request]


fix #1499 chat: don't persist null properties

--- src/status_im/chat/handlers/commands.cljs
+++ src/status_im/chat/handlers/commands.cljs
@@ -44,7 +44,7 @@
                                          (update result :markup cu/generate-hiccup)
                                          result)]
                             (dispatch [:set-in [:message-data data-type message-id] result'])
-                            (when (= :preview data-type)
+                            (when (and result (= :preview data-type))
                               ;; update message in realm with serialized preview
                               (messages/update {:message-id message-id
                                                 :preview (prn-str result)}))


refine printing a bit

refine printing a bit

--- src/strictly-specing/annotated_pprint.clj
+++ src/strictly-specing/annotated_pprint.clj
@@ -52,23 +52,20 @@
       [aseq (seq amap)]
       (when-let [[k v] (first aseq)]
         (pp/pprint-logical-block
-         (print-colored (when-not (get-in comments [k :value])
-                          (get-in comments [k :key-colors]))
+         (print-colored (get-in comments [k :key-colors])
                         k)
          (.write ^java.io.Writer *out* " ")
          (pp/pprint-newline :linear)
          ;; (set! pp/*current-length* 0)     ; always print both parts of the [k v] pair
-         (if-let [val-comment (-> comments k :value)]
-           (pp/pprint-logical-block
-            (pp/pprint-logical-block
-             (print-colored (get-in comments [k :value-colors]) v))
-            (pp/pprint-newline :mandatory)
-            (print-colored (get-in comments [k :value-comment-colors]) val-comment))
-           (print-colored (get-in comments [k :value-colors]) v)))
-        (if-let [key-comment (-> comments k :key)]
+         (print-colored (get-in comments [k :value-colors])
+                        (if (and (comments k)
+                                 (coll? v))
+                          (vary-meta v assoc :abbrev :tight)
+                          v)))
+        (if-let [key-comment (-> comments k :comment)]
           (do
             (pp/pprint-newline :mandatory)
-            (print-colored (get-in comments [k :key-comment-colors]) key-comment)
+            (print-colored (get-in comments [k :comment-colors]) key-comment)
             (pp/pprint-newline :mandatory))
           (when (next aseq)
             (.write ^java.io.Writer *out* " ")
@@ -79,20 +76,19 @@
           (recur (next aseq))))))))

 (defn abbrev-pprint-map-with-pointer [amap]
-  (if (-> amap meta :abbrev)
-    (binding [*print-level* (+ 3 @(resolve 'clojure.pprint/*current-level*))
-              *print-length* 4]
-      (pprint-map-with-pointer amap))
+  (if-let [abr-level  (-> amap meta :abbrev)]
+    (let [length (if (= :tight abr-level) 2 4)
+          level  (if (= :tight abr-level) 2 3)]
+      (binding [*print-level* (+ level
+                                 (or @(resolve 'clojure.pprint/*current-level*) 0))
+                *print-length* length]
+        (pprint-map-with-pointer amap)))
     (pprint-map-with-pointer amap)))

-(defn pprint-comment-pointer [comm-point]
-  (pp/pprint-logical-block
-   (pp/print-length-loop
-    [aseq (map symbol (string/split (:text comm-point) #"\n"))]
-    (pp/write-out (first aseq))
-    (pp/pprint-newline :linear)
-    (when (next aseq)
-      (recur (next aseq))))))
+(let [pprint-message (pp/formatter-out "^---- ~5I~@{~a~^ ~_~}~0I")]
+  (defn pprint-comment-pointer [comm-point]
+    (apply pprint-message (string/split (:text comm-point)
+                                  #"\n"))))

 (use-method error-path-dispatch clojure.lang.IPersistentMap abbrev-pprint-map-with-pointer)
 (use-method error-path-dispatch CommentPointer pprint-comment-pointer)
@@ -120,18 +116,20 @@
 (defn annotate-path [data path annotation]
   (path-only-data-structure data path #(vary-meta % merge annotation)))

-
-#_(cl/with-color-when true
-    (pp/with-pprint-dispatch error-path-dispatch
-      (pp/pprint
-       (annotate-path test-data
-                      [:cljsbuild :builds 0 :figwheel]
-                      {:abbrev true
-                       :comments {:on-jsload {:key-colors [:red]
-                                              :key-comment-colors [:magenta]
-                                              :key (CommentPointer. "^--- is missing yep ") }}})
-
-       )))
+(cl/with-color-when true
+  (pp/with-pprint-dispatch error-path-dispatch
+    (pp/pprint
+     (annotate-path test-data
+                    [:cljsbuild :builds 0 :figwheel]
+                    {:abbrev true
+                     :comments {:compiler {;:value-colors [:red]
+                                           :key-colors [:green]
+                                           :value-colors [:red]
+                                           :comment-colors [:magenta]
+                                           :comment (CommentPointer. " is missing yep ")
+                                           }}})
+
+     )))

@@ -150,8 +148,8 @@
                                  :asdfasdfasf {:asdfasdfasdf 3}}
                              :f {:asdfasdfasfd {:asdfasdfasdf 3}
                                  :asdfasdfasf {:asdfasdfasdf 3}}}
-                   {:comments {:c {:key (CommentPointer. "^--- is missing yep ")
-                                   ; :value (CommentPointer. "^--- is missing yep ")
+                   {:comments {:c {:key (CommentPointer. "is missing yep ")
+                                   ; :value (CommentPointer. "is missing yep ")
                                    :skip-value true
                                    ;:key-comment-colors   [:green]

@@ -175,7 +173,8 @@
                            :figwheel
                            { :websocket-host "localhost"
                             :compiler { :main 'example.core
-                                      :asset-path "js/out"
+                                       :asset-path "js/out"
+                                       :libsers ["libs_src" "libs_sscr/tweaky.js"]
                                       :output-to "resources/public/js/example.js"
                                       :output-dir "resources/public/js/out"
                                       :libs ["libs_src" "libs_sscr/tweaky.js"]
@@ -232,11 +231,13 @@
   )

-#_
-(binding [pp/*print-right-margin* 60
-          *print-level* 8]
-
-  (pp/with-pprint-dispatch error-path-dispatch
+
+(binding [;pp/*print-right-margin* 80
+          ;*print-level* 8
+          ]
+
+  (cl/with-color
+    (pp/with-pprint-dispatch error-path-dispatch
     (pp/pprint {:cljsbuild {
                             :builds [{ :id "example"
                                       :source-paths 1 #_["src" #_"dev" #_"tests" #_"../support/src"]
@@ -249,7 +250,9 @@
                                         ; :debug true
                                                    }
                                                   {:comments {:on-jsload
-                                                              {:value (CommentPointer. "^--- hey")}}})
+                                                              {:value-comment-colors [:red]
+                                                               :key-colors [:green]
+                                                               :value (CommentPointer. "hey asdf asdf asdf asdf\n asdf asdf as df as df asd f asd fa sd fa \n sd f asd fa sd f asd f asd fasd fa sdf a sdf asdf a sdf a\n sdf a sdf a sdf")}}})
                                       :compiler { :main 'example.core
                                                  :asset-path "js/out"
                                                  :output-to "resources/public/js/example.js"
@@ -259,7 +262,7 @@
                                                  :foreign-libs [{:file "foreign/wowza.js"
                                                                  :provides ["wowzacore"]}]
                                                  ;; :recompile-dependents true
-                                                 :optimizations :none}}]}})))
+                                                 :optimizations :none}}]}}))))

 #_(binding [*print-level* 4]
   (pp/pprint {:cljsbuild {


Update show-files task to show input and user files as well.

--- examples/haml/build.boot
+++ examples/haml/build.boot
@@ -25,7 +25,9 @@
   "A debug task to println any files with :ext in the fileset"
   [e ext PATH [str] "extensions to show"]
   (with-pre-wrap fileset
-    (doseq [:let [out-f (output-files fileset)]
+    (doseq [:let [out-f (->> [user-files input-files output-files]
+                          (mapcat #(% fileset))
+                          set)]
             f (if (seq ext) (by-ext ext out-f) out-f)]
       (println (str "\n" (tmppath f) ":\n\n")
         (slurp (tmpfile f))))


server null pointer exception

server null pointer exception

Not sure why this happened ???

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -1432,7 +1432,8 @@
                   (let [
                         clients-atom        (get cached-record :clients)
                         ]
-                    (swap!  clients-atom  conj  client-id)
+                    (if clients-atom
+                      (swap!  clients-atom  conj  client-id))
                     )


Add sum command; fix devth/yetibot#562

Add sum command; fix devth/yetibot#562

--- src/yetibot/core/commands/collections.clj
+++ src/yetibot/core/commands/collections.clj
@@ -236,6 +236,16 @@
 (cmd-hook #"count"
           _ count-cmd)

+; sum
+(defn sum-cmd
+  "sum <list> # sum the items in <list>"
+  {:yb/cat #{:util}}
+  [{items :opts}]
+  (reduce + (map (comp read-string str) (ensure-items-collection items))))
+
+(cmd-hook #"sum"
+          _ sum-cmd)
+
 ; sort
 (defn sort-cmd
   "sort <list> # sort a list"


Seek command always works and always plays something

For this, we preload the audio when we hover the audio, otherwise we
don't know where to seek to.

--- src/sinusoides/views/think.cljs
+++ src/sinusoides/views/think.cljs
@@ -71,7 +71,7 @@

                update-status
                (fn [status]
-                 (prn "status changed:")
+                 (prn "audio player: status changed")
                  (prn "   - source: " @source)
                  (prn "   - status: " status)
                  (swap! state assoc-in [:status] status))]
@@ -97,8 +97,10 @@
                                          (.load audio))
                                        (.play audio) (recur))
                     [:pause]       (do (.pause audio) (recur))
+                    [:preload]     (do (set! (.-preload audio) true) (recur))
                     [[:seek time]] (do (set! (.-currentTime audio) time) (recur))
-                    :else nil))))
+                    [nil]          nil
+                    [bad-command]  (prn "audio player: bad command, " bad-command)))))

        :component-will-unmount
        (fn [this]
@@ -134,8 +136,12 @@
                                        (/ (.-offsetWidth (.-target %)))
                                        (* (:duration @state))))

+               enable-preload
+               #(go (>! command-ch :preload))
+
                seek-time
-               #(go (>! command-ch [:seek @mouse-time]))]
+               #(go (>! command-ch [:seek @mouse-time])
+                    (>! command-ch :play))]

     [:div.audio-player {:class (str "state-" (clj->js (:status @state))
                                     (when (is-playing) " is-playing")
@@ -145,6 +151,7 @@

      [:div.seek-bar
       {:on-click seek-time
+       :on-mouse-over enable-preload
        :on-mouse-move update-mouse-time}

       (when (pos? @mouse-time)


:bug: Fix unexpected exception on websocket handler.

--- backend/src/uxbox/http/ws.clj
+++ backend/src/uxbox/http/ws.clj
@@ -17,6 +17,7 @@
    [uxbox.util.uuid :as uuid]
    [uxbox.util.transit :as t]
    [uxbox.util.blob :as blob]
+   [vertx.core :as vc]
    [vertx.http :as vh]
    [vertx.web :as vw]
    [vertx.util :as vu]
@@ -87,12 +88,12 @@
 (defn handler
   [{:keys [user] :as req}]
   (letfn [(on-init [ws]
-            (let [vsm (::vw/execution-context req)
+            (let [ctx (vc/current-context)
                   fid (get-in req [:path-params :file-id])
                   ws  (assoc ws
                              :user-id user
                              :file-id fid)
-                  sem (start-eventbus-consumer! vsm ws fid)]
+                  sem (start-eventbus-consumer! ctx ws fid)]
               (handle-message ws {:type :connect})
               (assoc ws ::sem sem)))


Changed docstring for defelem

Changed docstring for defelem

--- src/hiccup/core.clj
+++ src/hiccup/core.clj
@@ -254,10 +254,9 @@
       (make-html (cons options content)))))

 (defmacro defelem
-  "Defines a function adding an optional map argument in the first position.
-   fdecl has the same form used by clojure.core/defn. The resuting function must return a vector.
-   If the first argument passed to the result function is a map, it will be inserted as second element in vector.
-   If in that position there is a map already, both will be merged"
+  "Defines a function that will return a tag vector. If the first argument
+  passed to the resulting function is a map, it merges it with the attribute
+  map of the returned tag value."
   [name & fdecl]
   (let [[m fdecl] (if (string? (first fdecl))
                     [{:doc (first fdecl)} (next fdecl)]
@@ -269,7 +268,6 @@
                     [(conj m (last fdecl)) (butlast fdecl)]
                     [m fdecl])
         m (conj (or (meta name) {}) m)]
-
     `(defn ~name ~m [& [atts# & more# :as args#]]
        (let [f# (fn ~name ~@fdecl)]
          (if (map? atts#)
@@ -278,4 +276,3 @@
                     (list* tag# (merge (first r#) atts#) (next r#))
                     (list* tag# atts# r#))))
            (apply f# args#))))))
-


Added media URL to recommendation view

Added media URL to recommendation view

--- src/kmg/client.cljs
+++ src/kmg/client.cljs
@@ -55,12 +55,18 @@
 (defn media-title [media]
   (str (media-icon-span media) (:media/title media) " " ))

+(defn media-url [media]
+  (if (:media/url media)
+    (str "" (:media/url media) "
 ")
+    ""))
+
 (em/defsnippet recommendation tmpl ".recommendation" [{:keys [recommendation media backgrounds translations authors]}]
   "#recommendation-title" (ef/content (media-title media))
   "#recommendation-subtitle" (ef/content (str (:media/subtitle media) " " ))
   "#recommendation-authors" (ef/content (authors-string authors))
   "#recommendation-description" (ef/content
-     (str (:recommendation/description recommendation) "
 "
+     (str (media-url media)
+          (:recommendation/description recommendation) "
 "
           (:media/isbn media)
           " Year of issue: " (:media/year media)
           " Necessary: " (:recommendation/necessary recommendation) " Priority: " (:recommendation/priority recommendation)


Delete test.

Delete test.

--- test/onyx/coordinator/simulation_test.clj
+++ test/onyx/coordinator/simulation_test.clj
@@ -172,9 +172,7 @@

             (>!! (:completion-ch-head coordinator) {:path node-path})
             (let [failure (<!! failure-ch-spy)]
-              (is (= (:ch failure) :complete)))))
-
-        (testing "Offer task cases")))
+              (is (= (:ch failure) :complete)))))))
     {:eviction-delay 50000}))

 (deftest plan-one-job-no-peers


pass all test

pass all test

--- src/synthesis_crawlers/core.clj
+++ src/synthesis_crawlers/core.clj
@@ -491,15 +491,16 @@
                :threshold double?))
 (defn generate-attr-exprs
   [container-descriptions nodes-in-pages pages threshold]
-  (into {}
-        (for [attr (flatten (map keys (vals nodes-in-pages)))]
-          (let [nodes (map #(parse-css-selector
-                              (do
-                                (create-relative-path
+  (let [attr-nodes (flatten-attributed-nodes nodes-in-pages pages)]
+    (into {}
+          (for [attr (keys attr-nodes)]
+            (let [nodes (map #(parse-css-selector
+                                (do
+                                  (create-relative-path
                                     (decode-node-path container-descriptions) %)))
-                           (flatten (map #(vec (% attr)) (vals nodes-in-pages))))]
-            [attr (decode-node-path
-                    (unify-exprs (zipmap nodes (repeat (count nodes) 1)) threshold))]))))
+                             (attr-nodes attr))]
+              [attr (decode-node-path
+                      (unify-exprs (zipmap nodes (repeat (count nodes) 1)) threshold))])))))

 (s/fdef generate-extractors
         :args (s/cat :pages ::pages


rename (def): remove references to 'conjugated'

--- src/babel/francais/grammar.cljc
+++ src/babel/francais/grammar.cljc
@@ -30,15 +30,12 @@
    "past perfect" {:synsem {:sem {:aspect :perfect
                                   :tense :past}}}})

-;; TODO: remove 'conjugated' mentions from grammar
-(def head-is-conjugated-and-imperfect-infl
-  {:head {:français {:conjugated :top}
-          :phrasal false
+(def head-imperfect-infl
+  {:head {:phrasal false
           :synsem {:infl :imperfect}}})

-(def head-is-conjugated-and-present-infl
-  {:head {:français {:conjugated :top}
-          :phrasal false
+(def head-present-infl
+  {:head {:phrasal false
           :synsem {:infl :present}}})

 (declare against-pred)
@@ -365,7 +362,7 @@
                                            :tense :past}}})
                    (unify c10
                           root-is-head
-                          head-is-conjugated-and-imperfect-infl
+                          head-imperfect-infl
                            {:rule "s-imperfect-nonphrasal"
                             :synsem {:aux false
                                      :cat :verb
@@ -382,7 +379,7 @@
                                            :tense :present}}})
                    (unify c10
                           root-is-head
-                          head-is-conjugated-and-present-infl
+                          head-present-infl
                           {:rule "s-present-nonphrasal"
                            :synsem {:aux false
                                     :cat :verb
@@ -404,7 +401,7 @@
                                      :cat :verb}})
                    (unify h21a
                           root-is-comp
-                          head-is-conjugated-and-present-infl
+                          head-present-infl
                           {:rule "vp-aux"
                            :synsem {:aux true
                                     :sem {:tense :past}
@@ -413,7 +410,7 @@
                    ;; [nous [être + naître]] => nous somme nées
                    (unify h22
                           root-is-comp
-                          head-is-conjugated-and-present-infl
+                          head-present-infl
                           (let [obj-agr (atom :top)] ;; TODO: Remove: this obj-agr is not used.
                             {:head {:phrasal false}
                              :rule "vp-aux-22"
@@ -448,9 +445,9 @@
                    ;; [s-present-phrasal 'je' [vp-pronoun-phrasal 'm'' [vp32 'se appeler' 'Jean']]]
                    (unify h32
                           root-is-head
-                          ;; TODO: why does adding head-is-conjugated-and-present-infl
+                          ;; TODO: why does adding head-present-infl
                           ;; cause the test 'generate-named-sentence' to fail?
-                          ;;                          head-is-conjugated-and-present-infl
+                          ;;                          head-present-infl
                           {:rule "vp-32"
                            :head {:phrasal false}
                            :synsem {:aux false


remove references to merge

remove references to merge

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -1,5 +1,5 @@
 (ns babel.italiano.grammar
-  (:refer-clojure :exclude [get-in merge resolve])
+  (:refer-clojure :exclude [get-in resolve])
   (:require
    [babel.enrich :refer [enrich]]
    [babel.index :refer [create-index]]
@@ -46,7 +46,7 @@
    #?(:cljs [babel.logjs :as log])
    [clojure.core.cache :as cache]
    [clojure.java.io :as io]
-   [dag_unify.core :refer (fail? get-in merge remove-matching-keys unifyc)]))
+   [dag_unify.core :refer (fail? get-in remove-matching-keys unifyc)]))

 (def lexicon (future (edn2lexicon
                       (io/resource "babel/italiano/lexicon.edn"))))


Fix test

Fix test

--- test/buildviz/teamcity/sync_test.clj
+++ test/buildviz/teamcity/sync_test.clj
@@ -32,6 +32,5 @@
         (with-out-str (sut/sync-jobs (url/url "http://teamcity:8000") (url/url "http://buildviz:8010") ["the_project"]))
         (is (= {:start 1460261449000
                 :end 1460261460000
-                :outcome "pass"
-                :inputs []}
+                :outcome "pass"}
                (get @build-puts "/builds/theProject%20theJob/2")))))))


fix debounce option on watch task: clojure's natural numbers are java longs so no worries

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -130,7 +130,7 @@
   Debouncing time is 10ms by default."

   [q quiet         bool "Suppress all output from running jobs."
-   d debounce MSEC long "The time to wait (millisec) for filesystem to settle down."
+   d debounce MSEC int "The time to wait (millisec) for filesystem to settle down."
    v verbose       bool "Print which files have changed."]

   (pod/require-in @pod/worker-pod "boot.watcher")
@@ -162,6 +162,7 @@
                     (try (reset! return (-> fileset core/reset-fileset core/commit! next-task))
                          (catch Throwable ex (util/print-ex ex)))
                     (util/info "Elapsed time: %.3f sec\n\n" (float (/ (etime) 1000)))))
+                (println "recuring...")
                 (recur (util/guard [(.take q)]))))))
         @return))))

@@ -248,7 +249,7 @@

   The include and exclude options specify sets of regular expressions that will
   be used to filter the fileset.
-
+
   The move option applies a find/replace transformation on all paths in the
   output fileset."


Set Prefetch Count to 1

Set Prefetch Count to 1

--- src/lens/broker.clj
+++ src/lens/broker.clj
@@ -177,6 +177,7 @@
       (let [env {:broker (assoc broker :ch ch :exchange exchange
                                        :event-pub event-pub)}]
         (doseq [ch batch-chs]
+          (lb/qos ch 1)
           (subscribe ch batch-queue (delivery-fn env) (consumer-tag ch))))
       (aa/sub exchange "#" event-ch)
       (assoc broker :conn conn :ch ch :event-ch event-ch :event-pub event-pub)))


put menu items on recent docs

put menu items on recent docs

--- src-cljs/frontend/components/doc_viewer.cljs
+++ src-cljs/frontend/components/doc_viewer.cljs
@@ -24,11 +24,11 @@
         (html
          [:div.menu-view {:class (str "menu-prompt-" "username")}
           [:article
-           [:h2 "Remember that one idea?"]
-           [:p "Neither do we—well, not yet at least.
+           [:h2.menu-item "Remember that one idea?"]
+           [:p.menu-item "Neither do we—well, not yet at least.
                Sign up and we'll remember your ideas for you.
                Never lose a great idea again!"]
-           [:a.menu-button {:href (auth/auth-url)
+           [:a.menu-button.menu-item {:href (auth/auth-url)
                             :role "button"
                             :on-click #(do
                                          (.preventDefault %)


Bump cider-nrepl version

Bump cider-nrepl version

--- extra/profiles.clj
+++ extra/profiles.clj
@@ -1,5 +1,5 @@
 {:user
- {:plugins [[cider/cider-nrepl "0.12.0-SNAPSHOT"]
+ {:plugins [[cider/cider-nrepl "0.13.0-SNAPSHOT"]
             [lein-pprint "1.1.1"]
             [refactor-nrepl "2.0.0-SNAPSHOT"]
             [venantius/ultra "0.4.1"]]


Finish beat grid visualization.

Finish beat grid visualization.


Update back end to accept number of times to review each plot

--- src/clj/collect_earth_online/db/projects.clj
+++ src/clj/collect_earth_online/db/projects.clj
@@ -157,6 +157,9 @@
 (defn- insert-project-imagery! [project-id imagery-list]
   (doseq [imagery imagery-list]
     (call-sql "insert_project_imagery" project-id imagery)))
+
+(defn- cycle-list [coll]
+  (cons (last coll) (butlast coll)))

 ;;;
 ;;; Create project
@@ -213,18 +216,20 @@

 (defn- assign-qaqc
   "Assigns additional plots to users based on QA/QC method.  The two options are:
-   {:qaqcMethod \"overlap\"
-    :percent    50}
+   {:qaqcMethod    \"overlap\"
+    :percent       50
+    :timesToReview 2}
    and
    {:qaqcMethod \"sme\"
     :percent    100
     :smes       [2 5]}"
   [assigned-plots design-settings]
   (when (seq assigned-plots)
-    (let [{qaqc-method :qaqcMethod
-           percent    :percent
-           smes       :smes} (:qaqcAssignment design-settings)
-          {:keys [users]}    (:userAssignment design-settings)]
+    (let [{qaqc-method     :qaqcMethod
+           percent         :percent
+           times-to-review :timesToReview
+           smes            :smes} (:qaqcAssignment design-settings)
+          {:keys [users]}         (:userAssignment design-settings)]
       (if (= "none" qaqc-method)
         assigned-plots
         (concat assigned-plots
@@ -238,9 +243,17 @@
                                                    "overlap" (remove #(= user-id %) users)
                                                    "sme"     smes
                                                    nil)]
-                                 (concat acc (equally-assign-users user-plots
-                                                                   other-users
-                                                                   :plot_rid))))
+                                 (loop [to-users     other-users
+                                        cycles-left  (dec (or times-to-review 2))
+                                        new-assigned acc]
+                                   (if (pos? cycles-left)
+                                     (recur (cycle-list to-users)
+                                            (dec cycles-left)
+                                            (concat new-assigned
+                                                    (equally-assign-users user-plots
+                                                                          to-users
+                                                                          :plot_rid)))
+                                     new-assigned))))
                              [])))))))

 (defn- create-project-samples! [project-id


cleanup

cleanup

--- src/clj/com/matthiasnehlsen/inspect/http.clj
+++ src/clj/com/matthiasnehlsen/inspect/http.clj
@@ -5,7 +5,7 @@
     [org.httpkit.server :as http-kit-server]
     [ring.middleware.defaults]
     [com.matthiasnehlsen.inspect.index :refer [index-page]]
-    [ring.util.response :refer [resource-response response content-type]]
+    [ring.util.response :refer [response content-type]]
     [compojure.core :refer (defroutes GET POST)]
     [compojure.route :as route]
     [com.stuartsierra.component :as component]))


reorganize

reorganize

--- src/cljx/jamesmacaulay/async_tools/core.cljx
+++ src/cljx/jamesmacaulay/async_tools/core.cljx
@@ -11,10 +11,6 @@
             [cljs.core.async.impl.channels :as channels])
   (:require-macros [cljs.core.async.macros :refer [go]]))

-(defn readport?
-  [x]
-  (satisfies? impl/ReadPort x))
-
 (defrecord ConstantReadPort [boxed-value]
   impl/ReadPort
   (take! [_ _] boxed-value))
@@ -23,9 +19,15 @@
   [x]
   (ConstantReadPort. (channels/box x)))

-(defn cast-as-readport
-  [x]
-  (if (readport? x) x (constant x)))
+(defrecord AsyncFuture [state-atom]
+  impl/ReadPort
+  (take! [_ handler]
+    (-> state-atom
+        (swap! (fn [state]
+                 (if (nil? (:boxed-value state))
+                   (update-in state [:handlers] conj handler)
+                   state)))
+        :boxed-value)))

 (defn- async-future-state-atom
   [f]
@@ -44,16 +46,6 @@
     (f resolve!)
     state-atom))

-(defrecord AsyncFuture [state-atom]
-  impl/ReadPort
-  (take! [_ handler]
-    (-> state-atom
-        (swap! (fn [state]
-                 (if (nil? (:boxed-value state))
-                   (update-in state [:handlers] conj handler)
-                   state)))
-        :boxed-value)))
-
 (defn async-future*
   [f]
   (AsyncFuture. (async-future-state-atom f)))
@@ -61,6 +53,14 @@
 (defn async-future<
   [ch]
   (async-future* (partial async/take! ch)))
+
+(defn readport?
+  [x]
+  (satisfies? impl/ReadPort x))
+
+(defn cast-as-readport
+  [x]
+  (if (readport? x) x (constant x)))

 (defn then<
   [f ch]


Fix toast bug

Fix toast bug

--- src/clojure/org/bytopia/foreclojure/main.clj
+++ src/clojure/org/bytopia/foreclojure/main.clj
@@ -75,7 +75,7 @@
            (when (pos? (+ (count new-ids) (count to-download) (count to-upload)))
              (on-ui (toast (format "Downloaded %d new problem(s).\nDiscovered %d server solution(s).\nUploaded %d local solution(s)."
                                    (count new-ids) (count to-download) (count to-upload))))))
-         (on-ui "Can't login to 4clojure.com. Working in offline mode.")))
+         (on-ui (toast "Can't login to 4clojure.com. Working in offline mode."))))
      (on-ui (refresh-ui a)))))

 ;; (reload-from-server (*a))


Show operations in result

Show operations in result

--- src/clojure_club/x106_number_maze/mgrimm.clj
+++ src/clojure_club/x106_number_maze/mgrimm.clj
@@ -5,10 +5,10 @@
   (loop [seen #{} q (conj PersistentQueue/EMPTY [start 1 [start]])]
     (let [[x depth path] (peek q)]
       (if (= x end)
-        [depth (->> q seq (filter (fn [[y d p]] (and (= y end) (= d depth)))) (map last))]
+        [depth (->> q seq (filter (fn [[y d p]] (and (= y end) (= d depth)))) (map #(nth % 2)))]
         (recur (conj seen x)
                (let [a (+ x 2) b (* x 2) c (/ x 2)]
                  (cond-> (pop q)
-                         (not (seen a)) (conj [a (inc depth) (conj path a)])
-                         (not (seen b)) (conj [b (inc depth) (conj path b)])
-                         (not (or (seen c) (odd? x))) (conj [c (inc depth) (conj path c)]))))))))
+                   (not (seen a)) (conj [a (inc depth) (conj path :add2 a)])
+                   (not (seen b)) (conj [b (inc depth) (conj path :doub b)])
+                   (not (or (seen c) (odd? x))) (conj [c (inc depth) (conj path :halv c)]))))))))


Join lines.

Join lines.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -271,8 +271,7 @@
                                                             f
                                                             (count v))))
                                                       pes
-                                                      (subvec new-proc-fns-vec (count pes))
-                                                      )))
+                                                      (subvec new-proc-fns-vec (count pes)))))
                              (reset! out-queue (get-out-queue (last @proc-elements)))
                              (reset! out-proc-loop (doto (create-out-proc-loop) (.start)))
                              (reset! running true))


give threads component display name

give threads component display name

--- src/braid/ui/views/threads.cljs
+++ src/braid/ui/views/threads.cljs
@@ -7,7 +7,8 @@
   [new-thread-args threads]
   (let [this-elt (r/atom nil)]
     (r/create-class
-      {:component-did-mount
+      {:display-name "threads-view"
+       :component-did-mount
        (fn [this]
          (reset! this-elt (r/dom-node this)))


When a book is stereo only we need twice as much space

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -75,7 +75,7 @@
   [production]
   (let [dtb (path/recorded-path production)
         duration (quot (dtb/audio-length dtb) 1000) ; convert from millisecs to secs
-        sampling-ratio (if (dtb/mono? dtb) 1/2 1)
+        sampling-ratio (if (dtb/mono? dtb) 1 2)
         max-bitrate (/ (* (/ max-size duration sampling-ratio) 8) 1000)]
     (loop [bitrates bitrates]
       (when-first [bitrate bitrates]


Fixing small bug on memory-store where we were using boolean as a map


Randomized available plantations

Randomized available plantations

--- src/cljs/puertorico/client.cljs
+++ src/cljs/puertorico/client.cljs
@@ -196,18 +196,30 @@
    :trader []
    :governor 0
    :log []
-   :fields [:quarry 8 :coffee 8 :tobacco 9 :corn 10 :sugar 11 :indigo 12]})
+   :quarry 8
+   :fields {:coffee 8 :tobacco 9 :corn 10 :sugar 11 :indigo 12}})

 (defn create-game
   ([p1 p2 p3]
    (merge common
-          {:vp 75 :colonists 55 :ships [4 5 6]
+          {:n-player 3
+           :vp 75 :colonists 55 :ships [4 5 6]
            :colonist-ship 3
            :players [(create-player p1 2 :indigo)
                      (create-player p2 2 :indigo)
                      (create-player p3 1 :corn)]})))

 (def game (atom (apply create-game ["Kanwei" "Lauren" "Ted"])))
+
+
+(defn randomize-fields []
+  (->> (for [[field-type field-num] (:fields @game)]
+        (repeat field-num field-type))
+      flatten
+      shuffle
+      (take (inc (:n-player @game)))))
+
+(swap! game update-in [:available-fields] randomize-fields)

 (defn buy-building [b-name]
   (println "Trying to buy " b-name))
@@ -314,6 +326,9 @@
           (for [ship (:ships current)]
             (render-ship ship))
           [:h3 "Trader"] (render-trader (:trader current))
+          [:h3 "Fields"]
+          (for [field (:available-fields current)]
+            [:div {:class (name field)} (name field)])
           [:h3 "Roles"]
           (for [role (:roles current)]
             [:div.rolecard {:on-click #(player-pick-role role)}


handle agg term with dot

handle agg term with dot

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -122,23 +122,22 @@
     (put! (:comm (om/get-state owner)) (highlight parsets-data sel-facets))))

 (defn- build-bar [cursor owner agg-prefix-terms term-name sub-agg]
-  (om/build mg/mg-bar
-            cursor
-            {:opts {:id (str term-name "_pie")
-                    :title term-name
-                    :height 150
-                    :x (-> (dim-accessor sub-agg) name)
-                    :y "key"
-                    :trans-fn (fn [data-cursor]
-                                (-> data-cursor
-                                    (get-agg-buckets [:terms-aggs :aggregations (keyword (str agg-prefix-terms term-name)) :buckets])
-                                    (flatten-agg-buckets [:key (dim-accessor sub-agg)])))
-                    :on-click-cb (fn [d i]
-                                   (let [the-bar (-> js/d3 (.select (str "#" term-name "_pie")) (.selectAll ".mg-bar") js->clj (get-in [0 i]))
-                                         was-highlighted? (-> js/d3 (.select the-bar) (.classed "highlight"))
-                                         selected [(keyword term-name) (-> d js->clj (get "key"))]]
-                                     (-> js/d3 (.select the-bar) (.classed "highlight" (not was-highlighted?)))
-                                     (select! owner (if was-highlighted? disj conj) selected)))}}))
+  (let [chart-id (str (clojure.string/replace term-name #"\." "-") "_bar")
+        chart-sel (str "#" chart-id)]
+    (om/build mg/mg-bar
+              cursor
+              {:opts {:id chart-id :title term-name :height 150
+                      :x (-> (dim-accessor sub-agg) name) :y "key"
+                      :trans-fn (fn [data-cursor]
+                                  (-> data-cursor
+                                      (get-agg-buckets [:terms-aggs :aggregations (keyword (str agg-prefix-terms term-name)) :buckets])
+                                      (flatten-agg-buckets [:key (dim-accessor sub-agg)])))
+                      :on-click-cb (fn [d i]
+                                     (let [the-bar (-> js/d3 (.select chart-sel) (.selectAll ".mg-bar") js->clj (get-in [0 i]))
+                                           was-highlighted? (-> js/d3 (.select the-bar) (.classed "highlight"))
+                                           selected [(keyword term-name) (-> d js->clj (get "key"))]]
+                                       (-> js/d3 (.select the-bar) (.classed "highlight" (not was-highlighted?)))
+                                       (select! owner (if was-highlighted? disj conj) selected)))}})))

 (defcomponent parsets [cursor owner {:keys [agg value-path url height] :or {height 600 value-path ["doc_count"]} :as opts}]
   (init-state [_]
@@ -171,13 +170,13 @@
                  [:.card {:ref "parsets-card"}
                   [:.card-content
                    [:.row
-                    [:div.right {:style {:max-width "50%"}}
+                    [:div.right {:style {:max-width "65%"}}
                      (let [label-string (->> (get-agg-terms) (map name) (clojure.string/join " "))]
                        (om/build labels/labels cursor
                                  {:opts {:labels (labels/labelize label-string)
                                          :on-label-updated! (partial update-agg-terms-with-label owner)}}))
                      ]
-                    [:span.card-title.black-text "# PARSETS [ " [:strong (->> parsets-agg (map name) (clojure.string/join " > "))] " ]"]
+                    [:span.card-title.black-text [:p "# PARSETS"] [:p "[ " [:strong (->> parsets-agg (map name) (clojure.string/join " > "))] " ]"]]
                     [:p
                      [:input {:type "checkbox" :class "filled-in" :checked show-dimensions
                               :id "toggle-show-dimensions" :ref "toggle-show-dimensions"


I can resize an image!

I can resize an image!

--- src/mosaic/tile.clj
+++ src/mosaic/tile.clj
@@ -2,6 +2,13 @@
   (import java.io.File)
   (import java.awt.Color)
   (import java.awt.image.BufferedImage)
-  (import javax.imageio.ImageIO))
+  (import java.awt.image.Raster)
+  (import javax.imageio.ImageIO)
+  (import com.mortennobel.imagescaling.ResampleOp))
+
 (defn test-mosaic []
-  (File. "test/resources/image.jpg"))+  (ImageIO/read
+   (File. "test/resources/image.jpg")))
+
+(defn rescale [x y ^BufferedImage b]
+  (. (ResampleOp. x y) (filter b nil)))


todo for ns filtering

todo for ns filtering

--- src/mount/mount.clj
+++ src/mount/mount.clj
@@ -52,6 +52,14 @@
           (throw (RuntimeException. (str "could not stop [" name "] due to") t)))))
     (alter-meta! var assoc :started? false)))

+;; TODO: narrow down by {:mount {:include-ns
+;;                                {:starts-with ["app.foo" "bar.baz"]
+;;                                 :nss ["app.nyse" "app.tools.datomic"] }
+;;                               :exclude-ns
+;;                                {:starts-with ["dont.want.this" "app.debug"]
+;;                                 :nss ["dev" "app.stage"]}}}
+;;
+;; would come from lein dev profile
 (defn- f-states [f order]
   (->> (all-ns)
        (mapcat ns-interns)


boolean? is now provided by clojurescript core

--- src/hildebrand/internal/platform/number.cljs
+++ src/hildebrand/internal/platform/number.cljs
@@ -22,6 +22,3 @@
     (if (and (= -1 (.indexOf s ".")) (<= (.precision v) 15))
       (js/parseInt s)
       v)))
-
-(defn boolean? [x]
-  (= (type x) (type true)))


update ragtime

update ragtime

--- src/leiningen/new/clanhr_service/project.clj
+++ src/leiningen/new/clanhr_service/project.clj
@@ -16,7 +16,7 @@
                  [org.clojure/data.json "0.2.6"]
                  [com.novemberain/validateur "2.4.2"]
                  [compojure "1.4.0"]
-                 [ragtime "0.5.1"]
+                 [ragtime "0.5.2"]
                  [aleph "0.4.0"]
                  [postgresql "9.3-1102.jdbc41"]
                  [clanhr/result "0.9.2"]


First version of approximate computation of canonical base

Signed-off-by: Daniel Borchmann <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@algebra20.de>

--- src/main/clojure/conexp/fca/implications.clj
+++ src/main/clojure/conexp/fca/implications.clj
@@ -682,6 +682,27 @@
   [implications]
   #(every? (fn [implication] (respects? % implication)) implications))

+;;; Approximate Computation of the Canonical Base
+
+(defn approx-canonical-base
+  ""
+  ([ctx ε δ]
+   (approx-canonical-base ctx ε δ #(set (random-sample 0.5 (attributes ctx)))))
+  ([ctx ε δ subset-sampler]
+   (let [intent?       #(= % (adprime ctx %))
+         nr-iter       (inc (ceil (* (/ ε) (Math/log (/ δ)))))
+         respects-all? (fn [set impls]
+                         (every? (fn [impl] (respects? set impl)) impls))]
+     (learn-implications-by-queries (attributes ctx)
+                                    intent?
+                                    (fn [implications]
+                                      (or (some (fn [test-set]
+                                                  (when (not (<=> (intent? test-set)
+                                                                  (respects-all? test-set implications)))
+                                                    test-set))
+                                                (repeatedly nr-iter subset-sampler))
+                                          true))))))
+
 ;;; The End

 true


try catching js/Error first

try catching js/Error first

--- frontend/utils.clj
+++ frontend/utils.clj
@@ -29,13 +29,20 @@
   "wraps errors in a try/catch statement, logging issues to the console
    and optionally rethrowing them if configured to do so."
   [& action]
-  `(try ~@action
-        (catch :default e#
-          (merror e#)
-          (rollbar/push e#)
-          (when (:rethrow-errors? initial-query-map)
-            (js/eval "debugger")
-            (throw e#)))))
+  `(try
+     (try ~@action
+          (catch js/Error e#
+            (merror e#)
+            (rollbar/push e#)
+            (when (:rethrow-errors? initial-query-map)
+              (js/eval "debugger")
+              (throw e#))))
+     (catch :default e2#
+       (merror e2#)
+       (rollbar/push e2#)
+       (when (:rethrow-errors? initial-query-map)
+         (js/eval "debugger")
+         (throw e2#)))))

 (defmacro defrender
   "Reifies an IRender component that only has a render function and


Add my own update implementation

Add my own update implementation

--- src/oxcart/util.clj
+++ src/oxcart/util.clj
@@ -62,6 +62,11 @@
       (recur f dat'))))

+(defn update [map key f & args]
+  (assoc map key
+         (apply f (get map key) args)))
+
+
 (defn format-line-info
   "λ AST → (Option String)


raw-schema-name -> schema-name

raw-schema-name -> schema-name

--- src/spec/cljc/mikron/compiler/core_spec.cljc
+++ src/spec/cljc/mikron/compiler/core_spec.cljc
@@ -12,19 +12,19 @@
   (s/def ::type
     (s/+ symbol?))

-  (defn raw-schema-name
+  (defn schema-name
     "Returns the name of `schema`."
     [schema]
-    (let [schema-name (if (vector? schema)
-                        (first schema)
-                        schema)]
-      (if (schema/schema-names schema-name)
-        schema-name
+    (let [name (if (vector? schema)
+                 (first schema)
+                 schema)]
+      (if (schema/schema-names name)
+        name
         :custom)))

   (defmulti schema-spec
     "Returns a spec for a schema definition."
-    raw-schema-name :hierarchy #'schema/extended-hierarchy)
+    schema-name :hierarchy #'schema/extended-hierarchy)

   (defmethod schema-spec :simple [_]
     (schema-spec* []))


Fix RR test.

Fix RR test.

--- test/onyx/log/round_robin_multi_job_test.clj
+++ test/onyx/log/round_robin_multi_job_test.clj
@@ -3,6 +3,7 @@
             [midje.sweet :refer :all]
             [onyx.peer.task-lifecycle-extensions :as l-ext]
             [onyx.plugin.core-async :refer [take-segments!]]
+            [onyx.extensions :as extensions]
             [onyx.api]))

 (def onyx-id (java.util.UUID/randomUUID))
@@ -29,7 +30,6 @@
     :onyx/type :input
     :onyx/medium :core.async
     :onyx/batch-size 20
-    :onyx/max-peers 1
     :onyx/doc "Reads segments from a core.async channel"}

    {:onyx/name :b
@@ -42,7 +42,6 @@
     :onyx/type :output
     :onyx/medium :core.async
     :onyx/batch-size 20
-    :onyx/max-peers 1
     :onyx/doc "Writes segments to a core.async channel"}])

 (def catalog-2
@@ -51,7 +50,6 @@
     :onyx/type :input
     :onyx/medium :core.async
     :onyx/batch-size 20
-    :onyx/max-peers 1
     :onyx/doc "Reads segments from a core.async channel"}

    {:onyx/name :e
@@ -64,7 +62,6 @@
     :onyx/type :output
     :onyx/medium :core.async
     :onyx/batch-size 20
-    :onyx/max-peers 1
     :onyx/doc "Writes segments to a core.async channel"}])

 (def n-messages 1000)
@@ -132,63 +129,7 @@
         (recur new-replica)
         new-replica))))

-(def task-a (nth (get-in replica-1 [:tasks j1]) 0))
-
-(def task-b (nth (get-in replica-1 [:tasks j1]) 1))
-
-(def task-c (nth (get-in replica-1 [:tasks j1]) 2))
-
-(def task-d (nth (get-in replica-1 [:tasks j2]) 0))
-
-(def task-e (nth (get-in replica-1 [:tasks j2]) 1))
-
-(def task-f (nth (get-in replica-1 [:tasks j2]) 2))
-
-(fact "6 peers are assigned to each task" true => true)
-
-(def entry (create-log-entry :complete-task {:job j2 :task task-d}))
-
-(extensions/write-log-entry (:log env) entry)
-
-(def replica-2
-  (loop [replica replica-1]
-    (let [position (<!! ch)
-          entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
-      (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 6)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 6)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 6)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 9)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 9))
-        (recur new-replica)
-        new-replica))))
-
-(fact "The peers rebalanced after job 2, task D completes" true => true)
-
-(def entry (create-log-entry :complete-task {:job j2 :task task-e}))
-
-(extensions/write-log-entry (:log env) entry)
-
-(def replica-3
-  (loop [replica replica-2]
-    (let [position (<!! ch)
-          entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
-      (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 6)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 6)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 6)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 18))
-        (recur new-replica)
-        new-replica))))
-
-(fact "The peers rebalanced after job 2, task E completes" true => true)
-
-(def entry (create-log-entry :complete-task {:job j1 :task task-a}))
-
-(extensions/write-log-entry (:log env) entry)
+(onyx.api/kill-job peer-config j1)

 (def replica-4
   (loop [replica replica-3]
@@ -196,75 +137,13 @@
           entry (extensions/read-log-entry (:log env) position)
           new-replica (extensions/apply-log-entry entry replica)]
       (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 9)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 9)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 18))
+                   (= (count (get (get (:allocations new-replica) j1) task-b)) 0)
+                   (= (count (get (get (:allocations new-replica) j1) task-c)) 0)
+                   (= (count (get (get (:allocations new-replica) j2) task-d)) 12)
+                   (= (count (get (get (:allocations new-replica) j2) task-e)) 12)
+                   (= (count (get (get (:allocations new-replica) j2) task-f)) 12))
         (recur new-replica)
         new-replica))))
-
-(fact "The peers rebalanced after job 1, task A completes" true => true)
-
-(def entry (create-log-entry :complete-task {:job j2 :task task-f}))
-
-(extensions/write-log-entry (:log env) entry)
-
-(def replica-5
-  (loop [replica replica-4]
-    (let [position (<!! ch)
-          entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
-      (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 18)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 18)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 0))
-        (recur new-replica)
-        new-replica))))
-
-(fact "The peers rebalanced after job 2, task F completes" true => true)
-
-(def entry (create-log-entry :complete-task {:job j1 :task task-b}))
-
-(extensions/write-log-entry (:log env) entry)
-
-(def replica-6
-  (loop [replica replica-5]
-    (let [position (<!! ch)
-          entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
-      (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 36)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 0))
-        (recur new-replica)
-        new-replica))))
-
-(fact "The peers rebalanced after job 1, task B completes" true => true)
-
-(def entry (create-log-entry :complete-task {:job j1 :task task-c}))
-
-(extensions/write-log-entry (:log env) entry)
-
-(def replica-7
-  (loop [replica replica-6]
-    (let [position (<!! ch)
-          entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
-      (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-b)) 0)
-                   (= (count (get (get (:allocations new-replica) j1) task-c)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-d)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-e)) 0)
-                   (= (count (get (get (:allocations new-replica) j2) task-f)) 0))
-        (recur new-replica)
-        new-replica))))
-
-(fact "The peers stop working after job 1, task C completes" true => true)

 (doseq [v-peer v-peers]
   (onyx.api/shutdown-peer v-peer))


Update button string to be clear

Update button string to be clear

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -756,7 +756,7 @@
                                                                           :vcs-type org-vcs_type
                                                                           :selected-piggieback-orgs selected-piggieback-orgs}])
                  :kind :primary}
-                "Pay for organizations")]])]])))))
+                "Save")]])]])))))

 (defn transfer-organizations-list [[{:keys [vcs_type]} :as users-and-orgs] selected-transfer-org owner]
   ;; split user-orgs from orgs and grab the first (and only) user-org


Added four tests into config_test

Added four tests into config_test

--- test/clj_mrazik/config_test.clj
+++ test/clj_mrazik/config_test.clj
@@ -202,4 +202,38 @@
         (parse-float "xyzzy")
         (parse-float "-1xyzzy")))

-
+(deftest test-print-configuration
+    "Check the behaviour of function clj-mrazik.config/print-configuration."
+        ; use mock instead of clojure.pprint/pprint
+        (with-redefs [pprint/pprint (fn [configuration] (str configuration))]
+            (is (not (nil? (print-configuration {:first 1 :second 2}))))
+            (is (= (type (print-configuration   {:first 1 :second 2})) java.lang.String))))
+
+(deftest test-load-configuration-1
+    "Check the behaviour of function clj-mrazik.config/load-configuration."
+    (let [cfg (load-configuration "test/test1.ini")]
+        (is (not (nil? cfg)))))
+
+(deftest test-load-configuration-2
+    "Check the behaviour of function clj-mrazik.config/load-configuration."
+    (let [cfg (load-configuration "test/test1.ini")]
+        (is (not (nil? (:server cfg))))
+        (is (not (nil? (:bot cfg))))
+        (is (nil? (:other cfg)))))
+
+(deftest test-load-configuration-3
+    "Check the behaviour of function clj-mrazik.config/load-configuration."
+    (let [cfg (load-configuration "test/test1.ini")]
+        (are [x y] (= x y)
+            (-> cfg :server :name)     "test.com"
+            (-> cfg :server :port)     6667
+            (-> cfg :server :channels) "#botwar"
+            (-> cfg :server :nick)     "clj-mrazik"
+            (-> cfg :server :other)    nil)))
+
+(deftest test-load-configuration-4
+    "Check the behaviour of function clj-mrazik.config/load-configuration."
+    (let [cfg (load-configuration "test/test1.ini")]
+        (are [x y] (= x y)
+            (-> cfg :bot :prefix)     "?")))
+


remove unused import, fix some formatting

--- src/clj/lambdacd/presentation/pipeline_state.clj
+++ src/clj/lambdacd/presentation/pipeline_state.clj
@@ -1,6 +1,5 @@
 (ns lambdacd.presentation.pipeline-state
-  (:require [lambdacd.util :as util]
-            [lambdacd.internal.pipeline-state :as pipeline-state]
+  (:require [lambdacd.internal.pipeline-state :as pipeline-state]
             [clj-time.core :as t]
             [clojure.tools.logging :as log]
             [clj-timeframes.core :as tf]
@@ -45,8 +44,8 @@

 (defn earliest-first-update [step-ids-and-results]
   (->> (vals step-ids-and-results)
-      (filter not-retriggered?)
-      (first-with-key-ordered-by asc :first-updated-at)))
+       (filter not-retriggered?)
+       (first-with-key-ordered-by asc :first-updated-at)))

 (defn latest-most-recent-update [step-ids-and-results]
   (first-with-key-ordered-by desc :most-recent-update-at (vals step-ids-and-results)))
@@ -91,9 +90,9 @@

 (defn most-recent-step-result-with [key ctx]
-  (let [state (pipeline-state/get-all (:pipeline-state-component ctx))
-        step-id (:step-id ctx)
-        step-results (map second (reverse (sort-by first (seq state))))
-        step-results-for-id (map #(get % step-id) step-results)
+  (let [state                 (pipeline-state/get-all (:pipeline-state-component ctx))
+        step-id               (:step-id ctx)
+        step-results          (map second (reverse (sort-by first (seq state))))
+        step-results-for-id   (map #(get % step-id) step-results)
         step-results-with-key (filter key step-results-for-id)]
     (first step-results-with-key)))


CMR-276: Merged changes.

CMR-276: Merged changes.

--- src/cmr/metadata_db/services/concept_service.clj
+++ src/cmr/metadata_db/services/concept_service.clj
@@ -31,7 +31,7 @@

 (def concept-truncation-batch-size
   "Maximum number of concepts to process in each iteration of the delete old concepts job."
-  5000)
+  50000)

 ;;; utility methods


Better colors in KML.

Better colors in KML.

--- src/com/lemondronor/orbital_detector/log2kml.clj
+++ src/com/lemondronor/orbital_detector/log2kml.clj
@@ -57,9 +57,8 @@
   (:Agency (extended-data icao)))

-(defn type [icao]
+(defn vehicle-type [icao]
   (:Type (extended-data icao)))
-

 (defn has-position? [r]
@@ -67,9 +66,6 @@
        (>= (Math/abs ^double (:lon (:position r))) 0.1)))

-(defn random-rgb []
-  (map #(rand-int %) (repeat 3 255)))
-
 (defn rgb-hex [rgb]
   (str "7f" (string/join (map #(format "%02x" %) rgb))))

@@ -78,29 +74,30 @@

 (def path-colors
-  [
-   0xA6CEE3
-   0x1F78B4
-   0xB2DF8A
-   0x33A02C
-   0xFB9A99
-   0xE31A1C
-   0xFDBF6F
-   0xFF7F00
-   0xCAB2D6
-   0xFF0000
-   0x00FF00
-   0x0000FF
-   0xF15854 ;; (red))
-   0xB276B2 ;; (purple)
-   0xDECF3F ;; (yellow)
-   0x4D4D4D ;; (gray)
-   0x5DA5DA ;; (blue)
-   0xFAA43A ;; (orange)
-   0x60BD68 ;; (green)
-   0xF17CB0 ;; (pink)
-   0xB2912F ;; (brown)
-   ])
+  (cycle
+   [
+    0xA6CEE3
+    0x1F78B4
+    0xB2DF8A
+    0x33A02C
+    0xFB9A99
+    0xE31A1C
+    0xFDBF6F
+    0xFF7F00
+    0xCAB2D6
+    0xFF0000
+    0x00FF00
+    0x0000FF
+    0xF15854 ;; (red))
+    0xB276B2 ;; (purple)
+    0xDECF3F ;; (yellow)
+    0x4D4D4D ;; (gray)
+    0x5DA5DA ;; (blue)
+    0xFAA43A ;; (orange)
+    0x60BD68 ;; (green)
+    0xF17CB0 ;; (pink)
+    0xB2912F ;; (brown)
+    ]))

 (defn feet-to-meters [f]
@@ -173,12 +170,20 @@
    records))

-(defn kmldoc [tracks]
+(defn kmldoc [vehicle-groups tracks]
   [:kml {:xmlns "http://www.opengis.net/kml/2.2"}
    [:Document
     [:name "Recent law enforcement aircraft tracks"]
     [:description
-     (str (count tracks) " sessions")]
+     (str
+      (count vehicle-groups) " vehicles, "
+      (count tracks) " sessions, "
+      (format "%.1f km flown"
+              (/ (reduce
+                  +
+                  (for [[_ reports] vehicle-groups]
+                    (reduce + (map distance reports (next reports)))))
+                 1000.0)))]
     (map-indexed
      (fn [idx color]
        [:Style {:id (str "color" idx)}
@@ -187,7 +192,7 @@
          [:width 4]]
         [:PolyStyle
          [:color "7f00ff00"]]])
-     path-colors)
+     (take 100 path-colors))
     tracks]])

@@ -215,8 +220,8 @@
      [(if-let [agency (agency (:icao r))]
         (str "Agency: " agency)
         "")
-      (if-let [type (type (:icao r))]
-        (str "Type: " type)
+      (if-let [vtype (vehicle-type (:icao r))]
+        (str "Type: " vtype)
         "")
       (str "Duration: "
            (time/in-minutes
@@ -263,22 +268,23 @@
 (defn -main [& args]
   (let [args (gflags/parse-flags (cons nil args))]
     (load-extended-data)
-    (let [tracks (->> args
-                      (mapcat orbdet/read-log)
-                      (filter-icaos (gflags/flags :icaos))
-                      (filter has-position?)
-                      (print-count)
-                      (partition-all 1000)
-                      (mapcat distinct)
-                      (print-count)
-                      (group-by :icao)
-                      (map second)
-                      (map #(filter-speed 30000.0 %))
-                      (mapcat #(partition-sessions 600000 %))
-                      (map distinct)
-                      (filter #(> (count %) 10))
-                      (map-indexed kmltrack))]
-      (-> (kmldoc tracks)
+    (let [vehicle-groups (->> args
+                              (mapcat orbdet/read-log)
+                              (filter-icaos (gflags/flags :icaos))
+                              (filter has-position?)
+                              (print-count)
+                              (partition-all 1000)
+                              (mapcat distinct)
+                              (print-count)
+                              (group-by :icao))
+          kml-tracks (->> vehicle-groups
+                          (map second)
+                          (map #(filter-speed 30000.0 %))
+                          (mapcat #(partition-sessions 600000 %))
+                          (map distinct)
+                          (filter #(> (count %) 10))
+                          (map-indexed kmltrack))]
+      (-> (kmldoc vehicle-groups kml-tracks)
           xml/sexp-as-element
           xml/emit-str
           println))))


Additional css-class for input rendering uses :className instead of :class

--- src/guide/untangled/ui/forms_overview_cards.cljs
+++ src/guide/untangled/ui/forms_overview_cards.cljs
@@ -42,7 +42,7 @@
   (initial-state [this params] (f/build-form this (or params {})))
   static f/IForm
   (form-spec [this] [(f/id-field :db/id)                    ; Mark which thing is the ID of this entity
-                     (f/text-input :phone/number :class "form-control")
+                     (f/text-input :phone/number :className "form-control")
                      (f/dropdown-input :phone/type [(f/option :home "Home") (f/option :work "Work")])])
   static om/IQuery
   (query [this] [:db/id :phone/type :phone/number f/form-key]) ; Don't forget f/form-key!


CMR-350: Added test for non-numeric values in catlago-rest sytle arguments.

--- test/cmr/system_int_test/search/granule_search_orbit_equator_crossing_test.clj
+++ test/cmr/system_int_test/search/granule_search_orbit_equator_crossing_test.clj
@@ -69,4 +69,8 @@
         (is (d/refs-match? [gran3 gran4] references))))
     (testing "catalog-rest-style-orbit-number max range"
       (let [references (search/find-refs :granule {"equator-crossing-longitude[maxValue]" "95.5"})]
-        (is (d/refs-match? [gran1 gran2 gran5 gran6 gran7 gran8] references))))))
+        (is (d/refs-match? [gran1 gran2 gran5 gran6 gran7 gran8] references))))
+    (testing "non-numeric value in catalog rest style range"
+      (let [{:keys [status errors]} (search/find-refs :granule {"equator-crossing-longitude[maxValue]" "1,X"})]
+        (is (= 422 status))
+        (is (= errors [(on-m/non-numeric-equator-crossing-longitude-parameter)]))))))


:art: Updated copyright notice

:art: Updated copyright notice

--- test/data/SinglePassTests/FolderStructureTests/make-large-folder-structure.clj
+++ test/data/SinglePassTests/FolderStructureTests/make-large-folder-structure.clj
@@ -1,6 +1,6 @@
 #!/usr/bin/env lein-exec
 ;
-; Copyright (C) 2007-2015 Peter Monks.
+; Copyright (C) 2007-2016 Peter Monks.
 ;
 ; Licensed under the Apache License, Version 2.0 (the "License");
 ; you may not use this file except in compliance with the License.


Factor out Datomic batch size.

Factor out Datomic batch size.

--- test/onyx/plugin/input_test.clj
+++ test/onyx/plugin/input_test.clj
@@ -42,6 +42,8 @@

 (def t (d/next-t db))

+(def batch-size 1000)
+
 (def hornetq-host "localhost")

 (def hornetq-port 5445)
@@ -83,7 +85,7 @@
     :onyx/bootstrap? true
     :datomic/uri db-uri
     :datomic/t t
-    :onyx/batch-size 1000
+    :onyx/batch-size batch-size
     :datomic/partition :com.mdrogalis/people
     :onyx/doc "Creates ranges over an :eavt index to parellelize loading datoms"}

@@ -92,7 +94,7 @@
     :onyx/fn :onyx.plugin.datomic/load-datoms
     :onyx/type :transformer
     :onyx/consumption :concurrent
-    :onyx/batch-size 1000
+    :onyx/batch-size batch-size
     :datomic/uri db-uri
     :datomic/t t
     :onyx/doc "Reads and enqueues a range of the :eavt datom index"}
@@ -101,7 +103,7 @@
     :onyx/fn :onyx.plugin.input-test/my-test-query
     :onyx/type :transformer
     :onyx/consumption :concurrent
-    :onyx/batch-size 1000
+    :onyx/batch-size batch-size
     :onyx/doc "Queries for names of 5 characters or fewer"}

    {:onyx/name :persist
@@ -112,7 +114,7 @@
     :hornetq/queue-name out-queue
     :hornetq/host hornetq-host
     :hornetq/port hornetq-port
-    :onyx/batch-size 1000
+    :onyx/batch-size batch-size
     :onyx/doc "Output source for intermediate query results"}])

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


✅ Fix transaction conflict during test runs

Why:
- Syncing GIS changes from the test thread conflicted with the worker
  thread which was triggered by DB notifications

--- test/territory_bro/api_test.clj
+++ test/territory_bro/api_test.clj
@@ -76,13 +76,17 @@

 (defn refresh-projections! []
   ;; TODO: do synchronously, or propagate errors from the async thread?
+  ;;           - GIS changes cannot be synced in test thread, because
+  ;;             it will produce transaction conflicts with the worker
+  ;;             thread which is triggered by DB notifications
   ;; TODO: propagating errors might be useful also in production
   (projections/refresh-async!)
   (projections/await-refreshed (Duration/ofSeconds 10)))

 (defn sync-gis-changes! []
-  (projections/refresh-gis-changes!)
-  (refresh-projections!))
+  (projections/refresh-gis-async!)
+  (projections/await-gis-refreshed (Duration/ofSeconds 10))
+  (projections/await-refreshed (Duration/ofSeconds 10)))

 ;;;; API Helpers


fix short version

fix short version

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

--- prod/status_im/i18n_resources.cljs
+++ prod/status_im/i18n_resources.cljs
@@ -66,7 +66,7 @@
 (defn valid-language [lang]
   (if (contains? prod-translations lang)
     lang
-    (let [short-lang (keyword (subs (name lang) 0 2))]
+    (let [short-lang (keyword (first (string/split (name lang) #"_")))]
       (when (contains? prod-translations short-lang)
         short-lang))))


ignore ssl errors

ignore ssl errors

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -70,7 +70,8 @@
                      :headers headers
                      :query-params params
                      ;; :debug true
-                     :form-params payload})
+                     :form-params payload
+                     :insecure? true})
     (catch ExceptionInfo e
       (.getData e))))


handle new global-env interface, cache analyzed code

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -15,11 +15,12 @@
              :rename {analyze -analyze}]
             [clojure.tools.analyzer
              [utils :refer [resolve-var ctx -source-info]]
-             [ast :refer [prewalk]]]
+             [ast :refer [prewalk]]
+             [env :as env :refer [*env*]]]
             [clojure.tools.analyzer.passes
              [cleanup :refer [cleanup]]]
             [clojure.tools.analyzer.js.utils
-             :refer [desugar-ns-specs validate-ns-specs ns-resource source-path]]
+             :refer [desugar-ns-specs validate-ns-specs ns-resource source-path res-path]]
             [clojure.java.io :as io]
             [cljs.tagged-literals :as tags]
             [clojure.tools.reader :as reader]
@@ -41,25 +42,24 @@

 (def ^:dynamic *ns* 'cljs.user)

-(def namespaces
-  (atom '{cljs.user {:mappings       {}
-                     :aliases        {}
-                     :macro-mappings {}
-                     :macro-aliases  {}
-                     :ns             cljs.user}
-          cljs.core {:mappings       {}
-                     :aliases        {}
-                     :macro-mappings {}
-                     :macro-aliases  {}
-                     :ns             cljs.core}}))
+(defn global-env []
+  (atom '{:namespaces {cljs.user {:mappings       {}
+                                  :aliases        {}
+                                  :macro-mappings {}
+                                  :macro-aliases  {}
+                                  :ns             cljs.user}
+                       cljs.core {:mappings       {}
+                                  :aliases        {}
+                                  :macro-mappings {}
+                                  :macro-aliases  {}
+                                  :ns             cljs.core}}}))

 (defn empty-env
   "Returns an empty env map"
   []
   {:context    :statement
    :locals     {}
-   :ns         *ns*
-   :namespaces namespaces})
+   :ns         *ns*})

 (defn desugar-host-expr [[op & expr :as form]]
   (if (symbol? op)
@@ -80,27 +80,29 @@
        :else form))
     form))

-(defn maybe-macro [sym {:keys [namespaces ns]}]
+(defn maybe-macro [sym {:keys [ns]}]
   (let [var (if-let [sym-ns (namespace sym)]
-              (if-let [full-ns (get-in @namespaces [ns :macro-aliases] (symbol sym-ns))]
+              (if-let [full-ns (get-in (env/deref-env)
+                                       [:namespaces ns :macro-aliases (symbol sym-ns)])]
                 (ns-resolve full-ns (symbol (name sym)))
                 (ns-resolve (symbol sym-ns) (symbol (name sym))))
-              (get-in @namespaces [ns :mcacro-mappings sym]))]
+              (get-in (env/deref-env) [:namespaces ns :mcacro-mappings sym]))]
     (when (:macro (meta var))
       var)))

 (defn macroexpand-1 [form env]
-  (if (seq? form)
-    (let [op (first form)]
-      (if (specials op)
-        form
-        (let [clj-macro (maybe-macro op env)]
-          (if (and clj-macro
-                   (not (resolve-var op env))
-                   (not (-> env :locals (get op))))
-            (apply clj-macro form env (rest form)) ; (m &form &env & args)
-            (desugar-host-expr form)))))
-        form))
+  (env/ensure (global-env)
+    (if (seq? form)
+      (let [op (first form)]
+        (if (specials op)
+          form
+          (let [clj-macro (maybe-macro op env)]
+            (if (and clj-macro
+                     (not (resolve-var op env))
+                     (not (-> env :locals (get op))))
+              (apply clj-macro form env (rest form)) ; (m &form &env & args)
+              (desugar-host-expr form)))))
+      form)))

 (defn create-var
   [sym {:keys [ns]}]
@@ -137,7 +139,7 @@
     (ana/-analyze-form form env)))

 (defn parse-type
-  [op [_ name fields pmasks :as form] {:keys [ns namespaces] :as env}]
+  [op [_ name fields pmasks :as form] {:keys [ns] :as env}]
   (let [fields-expr (mapv (fn [name]
                             {:env     env
                              :form    name
@@ -148,7 +150,7 @@
                           fields)
         protocols (-> name meta :protocols)]

-    (swap! namespaces assoc-in [ns :mappings name]
+    (swap! *env* assoc-in [:namespaces ns :mappings name]
            {:op        :type
             :name      name
             :ns        ns
@@ -196,12 +198,12 @@
         :children [:args]}))))

 (declare analyze-ns)
-(defn ensure-loaded [ns {:keys [namespaces] :as env}]
-  (or (@namespaces ns)
+(defn ensure-loaded [ns env]
+  (or (-> (env/deref-env) :namespaces ns)
       (analyze-ns ns env)))

 (defn populate-env
-  [{:keys [import require require-macros refer-clojure]} ns-name {:keys [namespaces] :as env}]
+  [{:keys [import require require-macros refer-clojure]} ns-name env]
   (let [imports (reduce-kv (fn [m prefix suffixes]
                              (merge m (into {} (mapv (fn [s] [s (symbol (str prefix "." s))]) suffixes)))) {} import)
         require-aliases (reduce (fn [m [ns {:keys [as]}]]
@@ -210,9 +212,10 @@
                                     m)) {} require)
         require-mappings (reduce (fn [m [ns {:keys [refer]}]]
                                    (ensure-loaded ns env)
-                                   (reduce #(assoc %1 %2 (get-in @namespaces [ns :mappings %2])) m refer))
+                                   (reduce #(assoc %1 %2 (get-in (env/deref-env)
+                                                                 [:namespaces ns :mappings %2])) m refer))
                                  {} require)
-        core-mappings (apply dissoc (get-in @namespaces ['cljs.core :mappings]) (:exclude refer-clojure))
+        core-mappings (apply dissoc (get-in (env/deref-env) [:namespaces 'cljs.core :mappings]) (:exclude refer-clojure))
         macro-aliases (reduce (fn [m [ns {:keys [as]}]]
                                 (if as
                                   (assoc m as ns)
@@ -222,7 +225,7 @@
                                  (reduce #(assoc %1 %2 (ns-resolve ns (symbol (name %2)))) m refer))
                                {} require-macros)]

-    (swap! namespaces assoc-in [ns-name]
+    (swap! *env* assoc-in [:namespaces ns-name]
            {:ns             ns-name
             :mappings       (merge core-mappings require-mappings)
             :aliases        (merge imports require-aliases)
@@ -272,7 +275,8 @@
                             #'ana/var?          var?
                             #'ana/analyze-form  analyze-form}
                            (:bindings opts))
-       (run-passes (-analyze form env)))))
+       (env/ensure (global-env)
+         (run-passes (-analyze form env))))))

 (defn analyze'
   "Like `analyze` but runs cleanup on the AST"
@@ -281,25 +285,29 @@
   ([form env opts]
      (prewalk (analyze form env opts) cleanup)))

-;; TODO: handle env/*compiler*, cache analyzed code
 (defn analyze-ns [ns env]
-  (let [res (ns-resource ns)]
-    (assert res (str "Can't find " ns " in classpath"))
-    (let [filename (source-path res)]
-      (binding [*ns* *ns*]
-        (with-open [rdr (io/reader res)]
-          (let [pbr (readers/indexing-push-back-reader
-                     (java.io.PushbackReader. rdr) 1 filename)
-                eof (Object.)
-                env (empty-env)]
-            (loop []
-              (let [form (binding [c.c/*ns* (create-ns *ns*)
-                                   reader/*data-readers* tags/*cljs-data-readers*
-                                   reader/*alias-map* (apply merge {}
-                                                             (-> env :namespaces deref (get *ns*)
-                                                                (select-keys #{:aliases :macro-aliases})
-                                                                vals))]
-                           (reader/read pbr nil eof))]
-                (when-not (identical? form eof)
-                  (analyze form (assoc env :ns *ns*))
-                  (recur))))))))))
+  (env/ensure (global-env)
+    (let [res (ns-resource ns)]
+      (assert res (str "Can't find " ns " in classpath"))
+      (let [filename (source-path res)
+            path (res-path res)]
+        (when-not (get-in *env* [::analyzed-cljs path])
+          (binding [*ns* *ns*]
+            (with-open [rdr (io/reader res)]
+              (let [pbr (readers/indexing-push-back-reader
+                         (java.io.PushbackReader. rdr) 1 filename)
+                    eof (Object.)
+                    env (empty-env)]
+                (loop []
+                  (let [form (binding [c.c/*ns* (create-ns *ns*)
+                                       reader/*data-readers* tags/*cljs-data-readers*
+                                       reader/*alias-map* (apply merge {}
+                                                                 (-> (env/deref-env) :namespaces (get *ns*)
+                                                                    (select-keys #{:aliases :macro-aliases})
+                                                                    vals))]
+                               (reader/read pbr nil eof))]
+                    (when-not (identical? form eof)
+                      (swap! *env* update-in [::analyzed-cljs path]
+                             (fnil conj [])
+                             (analyze form (assoc env :ns *ns*)))
+                      (recur))))))))))))


Fix givens expansion

Fix givens expansion

--- src/main/clojure/com/stuartsierra/lazytest.clj
+++ src/main/clojure/com/stuartsierra/lazytest.clj
@@ -286,7 +286,7 @@
          (even? (count bindings))]}
   (let [givens (vec (reverse (filter #(::context-state-local (meta %)) (keys &env))))]
     `(using ~(vec (interleave (firsts bindings)
-                              (map (fn [expr] `(Context. ~givens (fn ~givens expr) nil))
+                              (map (fn [expr] `(Context. ~givens (fn ~givens ~expr) nil))
                                    (seconds bindings))))
             ~@body)))


Tag parameter `s` as `CharSequence`

Tag parameter `s` as `CharSequence`

--- src/toucan/util.clj
+++ src/toucan/util.clj
@@ -16,5 +16,5 @@
   `clojure.string/lower-case` uses the default locale in conversions, turning
   `ID` into `ıd`, in the Turkish locale. This function always uses the
   `Locale/US` locale."
-  [s]
+  [^CharSequence s]
   (.. s toString (toLowerCase (Locale/US))))


jstavel/edeposit#454 doplnil jsem parsovani xml v testu.

--- test/edeposit/amqp/kramerius/handlers_test.clj
+++ test/edeposit/amqp/kramerius/handlers_test.clj
@@ -182,7 +182,9 @@
       (is (.isDirectory (io/file result-tmpdir uuid)))
       (let [root (-> (io/file result-tmpdir uuid (str uuid ".xml"))
                      io/input-stream
-                     xml/parse)]
+                     xml/parse
+                     zip/xml-zip
+                     )]
         )
       ;(pp/pprint result-tmpdir)
       ;(println (slurp (io/file result-tmpdir uuid (str uuid ".xml"))))


add accusative pronoun "l'" (L apostrophe); contraction of "la" or "lo"

--- src/babel/italiano/morphology/nouns.cljc
+++ src/babel/italiano/morphology/nouns.cljc
@@ -4,11 +4,25 @@
    [clojure.string :as string]
    [clojure.string :refer (trim)]
    #?(:clj [clojure.tools.logging :as log])
+   [babel.italiano.pos :refer [pronoun-acc]]
    #?(:cljs [babel.logjs :as log])
    [dag_unify.core :refer (copy dissoc-paths fail? get-in merge ref? strip-refs unifyc)]))

 (def replace-patterns
   [
+
+   {:p [#"^l$" "la"] ;; "l'" -> "la"
+    :u {:synsem {:cat :noun
+                 :pronoun true
+                 :case pronoun-acc
+                 :agr {:number :sing
+                       :gender :fem}}}}
+   {:p [#"^l$" "lo"] ;; "l'" -> "lo"
+    :u {:synsem {:cat :noun
+                 :pronoun true
+                 :case pronoun-acc
+                 :agr {:number :sing
+                       :gender :masc}}}}

    {:p [#"(.*)e$" "$1a"] ;; "donne" -> "donna"
     :u {:synsem {:cat :noun


Improve few snippets.

Improve few snippets.

--- src/cljc/quil/snippets/image/pixels.cljc
+++ src/cljc/quil/snippets/image/pixels.cljc
@@ -64,7 +64,7 @@
   (q/background 255)
   (let [orig (q/create-graphics 100 100)
         modes [[:threshold]
-               [:threshold 0.7]
+               [:threshold 0.2]
                [:gray]
                [:invert]
                [:posterize 20]
@@ -101,7 +101,7 @@
   (q/background 255)
   (let [orig (q/create-graphics 100 100)
         modes [[:threshold]
-               [:threshold 0.7]
+               [:threshold 0.2]
                [:gray]
                [:invert]
                [:posterize 20]
@@ -225,7 +225,7 @@
     (q/update-pixels)))

 (defsnippet set-image
-  "set-image"
+  ["set-image" "set-pixel"]
   {}

   (q/background 255)


Warn about old Clojure instead of trying to automatically update it

--- src/adzerk/boot_cljs.clj
+++ src/adzerk/boot_cljs.clj
@@ -13,31 +13,17 @@
     [adzerk.boot-cljs.js-deps    :as deps]))

 (def cljs-version "0.0-3269")
-(def clj-version "1.7.0-RC1")

 (def ^:private deps
   "ClojureScript dependency to load in the pod if
    none is provided via project"
   (delay (remove pod/dependency-loaded? `[[org.clojure/clojurescript ~cljs-version]])))

-(def ^:private clj? #{'org.clojure/clojure})
-(defn- assert-clojure-version
-  "Update Clojure dependency if the user has not required version 1.7
-   using BOOT_CLOJURE_VERSION or env :dependencies."
-  [deps]
-  (if (some (comp clj? second) deps)
-    (map (fn [[pkg version :as v]]
-           (if (and (clj? pkg) (neg? (compare version "1.7.0")))
-             (do
-               (info (format "Using Clojure %s for Cljs compiler\n" clj-version))
-               [pkg clj-version])
-             v))
-         deps)
-    (if (neg? (compare (clojure-version) "1.7.0"))
-      (do
-        (info (format "Adding Clojure %s for Cljs compiler\n" clj-version))
-        (conj deps ['org.clojure/clojure clj-version]))
-      deps)))
+(defn- assert-clojure-version!
+  "Warn user if Clojure 1.7 is not found"
+  [pod]
+  (when (neg? (compare (pod/with-eval-in @pod (clojure-version)) "1.7.0"))
+    (warn "ClojureScript requires Clojure 1.7.\nSee https://github.com/boot-clj/boot/wiki/Setting-Clojure-version.\n")))

 (defn warn-on-cljs-version-differences []
   (let [proj-deps  (core/get-env :dependencies)
@@ -159,14 +145,14 @@
    s source-map            bool "Create source maps for compiled JS."
    c compiler-options OPTS edn  "Options to pass to the Clojurescript compiler."]

-  (let [pod-env    (-> (core/get-env) (update-in [:dependencies] into (vec (seq @deps))) (update-in [:dependencies] assert-clojure-version))
+  (let [pod-env    (-> (core/get-env) (update-in [:dependencies] into (vec (seq @deps))))
         pod        (future (pod/make-pod pod-env))
         tmp-src    (core/tmp-dir!)
         tmp-out    (core/tmp-dir!)
         tmp-result (core/tmp-dir!)
         ctx        (initial-context tmp-out tmp-src tmp-result *opts*)]
-
     (warn-on-cljs-version-differences)
+    (assert-clojure-version! pod)
     (comp
       (default-main :context ctx)
       (core/with-pre-wrap fileset


Support listening

Support listening

--- src/juzi/core.clj
+++ src/juzi/core.clj
@@ -22,12 +22,17 @@
   (future (sh "/usr/bin/say" chinese)))

 (defmulti question :mode)
-(defmethod question :en->zh [{:keys [en]}]
+(defmethod question :speak [{en :en}]
   (str "What's Chinese for \"" en "\"?"))
+(defmethod question :listen [{:keys [zh]}]
+  (future (Thread/sleep 500) (say zh))
+  (str "What's the meaning of word(s) you've just heard?"))

 (defmulti answer :mode)
-(defmethod answer :en->zh [{:keys [pi zh]}]
+(defmethod answer :speak [{:keys [pi zh]}]
   (str pi (when zh (do (say zh) (str " (" zh ")")))))
+(defmethod answer :listen [{:keys [pi zh en]}]
+  (str "You've heard \"" pi "\" (" zh ") which means \"" en "\"."))

 (defn start []
   (clear-screen)
@@ -35,7 +40,8 @@
     (clear-screen)
     (loop [s (s/make-session (expand-data (load-sources)))]
       (if-let [w (s/next-word s)]
-        (let [r (assoc w :mode :en->zh)]
+        (let [m (if (:zh w) (first (shuffle [:speak :listen])) :speak)
+              r (assoc w :mode m)]
           (println (question r))
           (println)
           (println "Press any key to see the answer ...")


fixing build

fixing build

--- src/kvm/clone.clj
+++ src/kvm/clone.clj
@@ -3,8 +3,8 @@
     java.text.SimpleDateFormat
     org.libvirt.Connect)
   (:require
-     [libvirt.disks :refer (get-disks find-volume clone-disks update-disks)]
-     [libvirt.common :refer (connect tree-edit)]
+     [kvm.disks :refer (get-disks find-volume clone-disks update-disks)]
+     [kvm.common :refer (connect tree-edit)]
      [clojure.pprint :refer (pprint)]
      [clojure.zip :as zip]
      [clojure.data.zip.xml :as zx]


Add Max Memory and CPU Number at Production Startup