progress indicator moves as track plays

progress indicator moves as track plays

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -87,6 +87,16 @@
   (println "Sending resume signal to server...")
   (.emit socket "resume-sync-to-server"))

+(defn set-progress-ball-position [percent-completed]
+  (.css (js/$ "#progress-track-ball") #js {"left" (str (/ percent-completed 2) "%")}))
+
+(defn while-playing []
+  (let [sound (:current-sound @app-state)]
+    (println (.-position sound))
+    (println (.-duration sound))
+    (println (/ (.-position sound) (.-duration sound)))
+    (set-progress-ball-position (* 100 (/ (.-position sound) (.-duration sound))))))
+
 (defn play-sound [sound-data]
   (defn on-finish []
     (println "Song has finished!")
@@ -109,7 +119,8 @@
   (.play (:current-sound @app-state)
          #js {:onfinish on-finish
               :onpause on-pause
-              :onresume on-resume})
+              :onresume on-resume
+              :whileplaying while-playing})
   (swap! app-state assoc :current-track (+ 1 (:current-track @app-state))))

@@ -173,5 +184,3 @@
       (.emit (js/ss socket) "file" stream)
       (.pipe blob-stream stream))))

-(defn set-progress-ball-position [percent-completed]
-  (.css (js/$ "#progress-track-ball") #js {"left" (str (/ percent-completed 2) "%")}))


More useful (readable) watch for state atom

--- env/dev/cljs/asciinema_player/main.cljs
+++ env/dev/cljs/asciinema_player/main.cljs
@@ -12,7 +12,7 @@
 (defonce player-state
   (p/make-player-state 80 24 "/frames-10386.json" 148.297910690308 (merge options {:snapshot snapshot})))

-;; (add-watch player-state :foo (fn [_ id old new] (prn (:show-hud new))))
+;; (add-watch player-state :foo (fn [_ id old new] (prn (-> new (dissoc :lines) (dissoc :snapshot) (dissoc :frames)))))

 ;; "fractals"


More debugging info when comparison fails

--- env/dev/cljs/asciinema_player/main.cljs
+++ env/dev/cljs/asciinema_player/main.cljs
@@ -82,7 +82,8 @@

 (defn debug []
   (go
-    (let [v0-json (<! (fetch-json v0-url))
+    (let [check-from 24
+          v0-json (<! (fetch-json v0-url))
           v0-frames (vec (drop 1 (map #(p/acc->frame (last %)) (p/build-v0-frames v0-json))))
           v1-json (<! (fetch-json v1-url))
           v1-stdout (vec (map last (:stdout v1-json)))]
@@ -98,14 +99,18 @@
                 expected-cursor (get-in v0-frames [n :cursor])]
             (print n)
             (print "fed: " str)
-            (when (> n 0)
+            (when (>= n check-from)
               (when (not= actual-lines expected-lines)
+                (print "prev lines:")
+                (prn prev-lines)
                 (print "expected lines:")
                 (prn expected-lines)
                 (print "got lines:")
                 (prn actual-lines)
-                (print "prev lines:")
-                (prn prev-lines)
+                (print "first not matching line:")
+                (let [conflict (first (filter #(apply not= %) (map vector expected-lines actual-lines)))]
+                  (prn "expected: " (first conflict))
+                  (prn "got: " (second conflict)))
                 (throw "expectation failed"))

               (when (not= actual-cursor expected-cursor)


"Step" already implies "single"

"Step" already implies "single"

--- src/icecap/execute.clj
+++ src/icecap/execute.clj
@@ -28,8 +28,8 @@
   "Does the given URL have a supported scheme?"
   (comp supported-schemes get-scheme))

-(defn execute-single-step
-  "Execute a single step.
+(defn ^:private execute-step
+  "Execute a step.

   Returns a channel that will eventually produce the result.
   "
@@ -40,11 +40,11 @@
 (defn execute
   "Executes a plan.

-  If the plan is a single step, executes it with
-  `execute-single-step`. If it is an unordered collection of plans,
-  execute all of them in any order. If it is an ordered collection of
-  plans, executes them in order. For more details on the structure of
-  plans, see `icecap.schema`.
+  If the plan is a single step, executes it with `execute-step`. If it
+  is an unordered collection of plans, execute all of them in any
+  order. If it is an ordered collection of plans, executes them in
+  order. For more details on the structure of plans, see
+  `icecap.schema`.

   Returns a channel that will produce all of the individual results,
   and then closes.
@@ -52,7 +52,7 @@
   [plan]
   (let [c (chan)]
     (condp #(%1 %2) plan
-      map? (pipe (execute-single-step plan) c)
+      map? (pipe (execute-step plan) c)
       set? (pipe (merge (map execute plan)) c)
       ;;                       ^- recursion!!!
       vector? (go (loop [sub-plans plan]


cjl - Add docstring to clear-rows

cjl - Add docstring to clear-rows

--- src/icfp2015/board.clj
+++ src/icfp2015/board.clj
@@ -53,6 +53,7 @@
     :current-unit nil })

 (defn clear-rows
+  "Clears full rows. Moves cells above cleared row downward"
   [{:keys [width height filled] :as board}]
   (let [row-is-filled (fn [i] (->> (range width)
                                    (map (fn [j] [i j]))


System/exit appropriately depending on pass/fail count.

Also fixes super-summary, which an earlier commit had broken.

--- src/leiningen/test.clj
+++ src/leiningen/test.clj
@@ -7,27 +7,34 @@
         [leiningen.compile :only [eval-in-project]]))

 (def report-fns
-     '(let [orig-report report
-            aggregates (ref [])]
-        (defn lein-report [event]
-          (when (= (:type event) :summary)
-            (dosync (commute aggregates conj event)))
-          (orig-report event))
+     '(let [aggregates (ref [])]
+
+        (defmethod report :summary [m]
+          (with-test-out
+            (println "\nRan" (:test m) "tests containing"
+                     (+ (:pass m) (:fail m) (:error m)) "assertions.")
+            (println (:fail m) "failures," (:error m) "errors."))
+          (dosync (commute aggregates conj m))
+          (= 0 (:fail m) (:error m)))
+
+        (defn test-namespace [all-passed? n]
+          (require n)
+          (let [this-passed? (run-tests n)]
+            (and all-passed? this-passed?)))

         (defn super-summary []
           (with-test-out
             (println "\n\n--------------------\nTotal:"))
-          (orig-report (apply merge-with (fn [a b]
-                                           (if (number? a)
-                                             (+ a b)
-                                             a))
-                              @aggregates)))))
+          (report (apply merge-with (fn [a b]
+                                      (if (number? a)
+                                        (+ a b)
+                                        a))
+                         @aggregates)))))

 (defn test
   "Run the project's tests. Accept a list of namespaces for which to run all
 tests for. If none are given, runs them all."
   [project & namespaces]
-  ;; TODO: System/exit appropriately (depends on Clojure ticket #193)
   (let [namespaces (if (empty? namespaces)
                      (find-namespaces-in-dir (file (:root project) "test"))
                      (map symbol namespaces))]
@@ -36,7 +43,6 @@
      `(do
         (use ~''clojure.test)
         ~report-fns
-        (doseq [ns# '~namespaces]
-          (require ns#)
-          (binding [report ~'lein-report]
-            (run-tests ns#)))))))
+        (let [passed?# (reduce ~'test-namespace true '~namespaces)]
+          (~'super-summary)
+          (System/exit (if passed?# 0 1)))))))


Collapse test task into only a single run-tests call.

--- src/leiningen/test.clj
+++ src/leiningen/test.clj
@@ -23,21 +23,12 @@
   ([namespaces test-package result-file]
      `(do
         (require '~test-package)
+        (doseq [n# '~namespaces]
+          (require n#))
         (let [resolver# (fn [fname#]
                           (ns-resolve
                            (find-ns '~test-package) fname#))
-              add-numbers# (fn [a# b#] (if (number? a#)
-                                         (+ a# b#) a#))
-              summary# (reduce (fn [summary# n#]
-                                 (require n#)
-                                 ;; TODO: apply run-tests across all test-nses
-                                 (merge-with add-numbers#
-                                             summary#
-                                             ((resolver# ~''run-tests) n#)))
-                               {} '~namespaces)]
-          ((resolver# ~''with-test-out)
-           (println "\n\n--------------------\nTotal:")
-           ((resolver# ~''report) summary#))
+              summary# (apply (resolver# ~''run-tests) '~namespaces)]
           (when-not (= "1.5" (System/getProperty "java.specification.version"))
             (shutdown-agents))
           (with-open [w# (-> (java.io.File. ~result-file)


Fix div by zero error in 'report-progress

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -433,7 +433,9 @@
   [msg xs]
   (concat
    (let [c (count xs)
-         digits (inc (long (quot (Math/log c) (Math/log 10))))
+         digits (inc (long (if (zero? c)
+                             1
+                             (quot (Math/log c) (Math/log 10)))))
          t (new-throttle
             (fn [i]
               (printf (str "\r%s %" digits "d/%d ...") msg (inc i) c)


Adjust r-proj-path to point to project directory not project.clj.

Without this we couldn't easily unify against 'r-commit-path paths.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1169,12 +1169,12 @@
                         (map #(s/split % #"\s+" 4)))
                    :let [blob-sha (sha/mk bsha)]]
           (->/as pldb
-            (pldb/db-fact r-proj-path sha (.intern ^String path) blob-sha)
+            (pldb/db-fact r-proj-path sha (s/replace path #"(^|/)project.clj$" "") blob-sha)
             (->/when-not (first (q pldb [x] (r-proj blob-sha _ _ _) (l/== x true)))
               (->/apply pldb/db-fact
                         r-proj blob-sha (proj-fact-tail gitdir blob-sha)))))
         (->/for [dir-path (set (mapcat sub-paths (keys (:paths commit))))]
-          (pldb/db-fact r-commit-path sha (.intern ^String dir-path))))))
+          (pldb/db-fact r-commit-path sha dir-path)))))

 (defn build-shabam
   [{:keys [shabam pldb]} tips]
@@ -1222,7 +1222,7 @@
           (build-shabam (vals new-branches))
           (vary-meta assoc ::dirty true))))))

-(def voomdb-header "voom-db-5")
+(def voomdb-header "voom-db-6")

 (defn ^File git-db-file
   [gitdir]


Add 'updated-git-db to easily get correct db

Uses new 'read-git-db, updates incrementally as needed from voom-repos, and
writes using 'write-git-db if needed.  Db file is stored in .git dir, contains
a versioning header, and is gzipped.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1022,13 +1022,50 @@
        (vary-meta db assoc ::dirty true)
        blobs-to-read))))

-(defn update-git-db
+(def voomdb-header "voom-db-0")
+
+(defn git-db-file
+  [gitdir]
+  (io/file gitdir ".git" "voomdb.frs.gz"))
+
+(defn read-git-db
+  [gitdir]
+  (let [file (git-db-file gitdir)
+        [header & reldata] (-> file
+                               io/input-stream
+                               java.util.zip.GZIPInputStream.
+                               (fress/read :handlers sha/read-handlers))]
+    (if (= header voomdb-header)
+      (vdb/from-reldata
+       [r-branch r-commit r-commit-parent r-tree r-proj]
+       reldata)
+      (do
+        (println "Existing voomdb file for" (str gitdir)
+                 "has wrong header" header "needed:"
+                 voomdb-header)
+        pldb/empty-db))))
+
+(defn write-git-db
   [db gitdir]
-  (let [db (-> db
+  (with-open [w (-> (git-db-file gitdir)
+                    io/output-stream
+                    java.util.zip.GZIPOutputStream.
+                    (fress/create-writer :handlers sha/write-handlers))]
+    (fress/begin-open-list w)
+    (fress/write-object w voomdb-header)
+    (doseq [item (vdb/to-reldata db)]
+      (fress/write-object w item))))
+
+(defn updated-git-db
+  [gitdir]
+  (let [db (-> (if (.exists (git-db-file gitdir))
+                 (read-git-db gitdir)
+                 pldb/empty-db)
                (add-r-commits gitdir)
                (add-r-trees gitdir)
                (add-r-projs gitdir))]
-    ;; TODO: if dirty, write out db
+    (when (::dirty (meta db))
+      (write-git-db db gitdir))
     db))

 (def obj-patho
@@ -1058,13 +1095,8 @@
   (def xdb3 (vdb/from-reldata [r-tree] (fress/read (fress/write (vdb/to-reldata xdb1)))))
   (pldb/with-db xdb3 (l/run* [a] (r-tree a :b :c :d)))

-  (time (def db (update-git-db pldb/empty-db (io/file voom-repos "lein-voom"))))
-  (time (def db2 (update-git-db db (io/file voom-repos "lein-voom"))))
-  (time (fress-spit-seq "tmp.frs" (vdb/to-reldata db2)))
-  (time (def db3
-          (vdb/from-reldata [r-branch r-commit r-commit-parent r-tree r-proj]
-                            (fress/read "tmp.frs" :handlers sha/read-handlers))))
-  (time (def x (fress/read "tmp.frs" :handlers sha/read-handlers)))
+  (time (def db (updated-git-db (io/file voom-repos "lein-voom"))))
+  (time (def db2 (updated-git-db (io/file voom-repos "lein-voom"))))

   (time
    (let [fname "core.clj"]
@@ -1143,14 +1175,7 @@
                     (l/== q [a b c d e f g]))))
   )

-(defn fress-spit-seq
-  [filename coll]
-  (with-open [^org.fressian.FressianWriter w
-              , (fress/create-writer (io/output-stream filename)
-                                     :handlers sha/write-handlers)]
-    (fress/begin-open-list w)
-    (doseq [item coll]
-      (fress/write-object w item))))
+

 (def subtasks [#'build-deps #'deploy #'find-box #'freshen #'install


remove the old shell experiment

remove the old shell experiment

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/shell.cljs
+++ src/lt/objs/shell.cljs
@@ -1,80 +0,0 @@
-(ns lt.objs.shell
-  (:require [lt.object :as object]
-            [lt.objs.editor :as ed]
-            [lt.objs.clients :as clients]
-            [lt.objs.eval :as eval]
-            [lt.objs.proc :as proc]
-            [lt.objs.command :as cmd]))
-
-(comment
-
-(object/object* ::shell.lang
-                :tags #{:shell.lang}
-                :init (fn [this]
-                        ))
-
-(behavior ::on-eval
-                  :triggers #{:eval
-                              :eval.one}
-                  :reaction (fn [editor]
-                              (let [info {}
-                                    meta {:start {:line (-> (ed/->cursor editor "start") :line)}
-                                          :end {:line (-> (ed/->cursor editor "end") :line)}}
-                                    info (if (ed/selection? editor)
-                                           (assoc info
-                                             :code (ed/selection editor)
-                                             :meta meta)
-                                           (assoc info :code (ed/line editor (-> meta :start :line)) :meta meta))]
-                                (object/raise shell-lang :eval! {:info info
-                                                                 :origin editor}))))
-
-(behavior ::eval!
-                  :triggers #{:eval!}
-                  :reaction (fn [this event]
-                              (let [{:keys [info origin]} event]
-                                (clients/send (eval/get-client! {:command :shell.eval
-                                                                 :origin origin
-                                                                 :create open!
-                                                                 :info info})
-                                              :shell.eval
-                                              info
-                                              :only origin))))
-
-(defn shutdown [this]
-  (when (-> @this :procs)
-    (proc/kill-all (-> @this :procs)))
-  (clients/rem! this))
-
-(behavior ::send!
-                  :triggers #{:send!}
-                  :reaction (fn [this msg]
-                              (condp = (-> msg second keyword)
-                                :client.close (shutdown this)
-                                :shell.eval (-> @this :procs first (.stdin.write (str (.-code (last msg)) " \n")))
-                                (println "unknown command: " (second msg)))))
-
-(behavior ::proc.out
-                  :triggers #{:proc.out}
-                  :reaction (fn [this data]
-                              (let [data (.toString data)]
-                                (println data))))
-
-(def shell-lang (object/create ::shell.lang))
-
-(defn open! []
-  (let [c (clients/client! :shell.client)]
-    (proc/exec {:command "sh"
-                :obj c})
-    (clients/handle-connection! {:client-id (clients/->id c)
-                                 :commands [:shell.eval]
-                                 :type "Local Shell"
-                                 :name "Shell"})
-    ))
-
-(cmd/command {:command :shell.client.open
-              :desc "Shell: start a shell client"
-              :exec (fn []
-                      (open!)
-                      )})
-
-  )


made is-card-empty? private

made is-card-empty? private

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -63,7 +63,7 @@
                               (str "Pulse: " (:name pulse))
                               attachments)))

-(defn is-card-empty?
+(defn- is-card-empty?
   "Check if the card is empty"
   [card]
   (let [result (:result card)]


improve handling of target for services

improve handling of target for services

* make gae/target work for both build and monitor, and for both
  servlet and service apps

Signed-off-by: Gregg Reynolds <d0f77bc71a9867acdcb4f62f012b858edad79160@norc.org>

--- src/migae/boot_gae.clj
+++ src/migae/boot_gae.clj
@@ -435,14 +435,14 @@
    s service bool "build a service"
    v verbose bool "verbose"]
   (let [keep (or keep false)
-        verbose (or verbose false)
-        mod (str (-> (boot/get-env) :gae :module :name))]
+        verbose (or verbose false)]
+        ;; mod (str (-> (boot/get-env) :gae :module :name))]
     ;; (println "MODULE: " mod)
     (comp (install-sdk)
           (libs :verbose verbose)
           (appstats :verbose verbose)
           (builtin/javac)
-          (if prod identity (reloader :keep keep :verbose verbose))
+          (if prod identity (reloader :keep keep :service service :verbose verbose))
           (filters :keep keep :verbose verbose)
           (servlets :keep keep :verbose verbose)
           (logging :verbose verbose)
@@ -453,39 +453,35 @@
           (if service
             (comp
              (builtin/pom)
-             (builtin/jar)
-             (target :verbose verbose)
-             #_(builtin/sift :include #{(re-pattern (str mod ".*jar"))})
-             #_(builtin/install))
-            (target :verbose verbose))
+             (builtin/jar))
+            identity)
+          (target :service service :verbose verbose)
+          #_(builtin/sift :include #{(re-pattern (str mod ".*jar"))})
+          #_(builtin/install)
+          #_(target :verbose verbose)
           ;; (builtin/sift :move {#"(^.*)" (str mod "/$1")})
           ;; FIXME: use cache instead?
           ;; (builtin/target :dir #{(str "target/" mod)})
           )))

-#_(boot/deftask install
-  "install service jar.  run after build task"
-  [s service bool "build a service"
-   v verbose bool "verbose"]
-  (let [verbose (or verbose false)
-        e (boot/get-env)
-        mod (str (-> e :gae :module :name))]
-    #_(builtin/install )))
-
 (boot/deftask target
   "target, using module name"
   [C no-clean bool "Don't clean target before writing project files"
-   s service bool "service"
+   m monitor bool "monitoring - target service assembly"
+   s service bool "building as service"
    v verbose bool "verbose"]
   (let [mod      (-> (boot/get-env) :gae :module :name)
-        app-dir  (-> (boot/get-env) :gae :module :app-dir)]
+        app-dir  (-> (boot/get-env) :gae :module :app-dir)
+        dir      (if monitor
+                   (str app-dir "/target/" mod)
+                   (if service (str "target/" mod)
+                       "target"))]
     (if service
       (if (not (and mod app-dir))
         (throw (Exception. "For service targets, both :name and :app-dir must be specified in :gae map of build.boot"))))
-    (let [dir (str (if service (str app-dir "/")) "target/" mod)]
-      (println "TARGET DIR:" dir)
-      (builtin/target :dir #{dir}
-                      :no-clean (or no-clean false)))))
+    (println "TARGET DIR: " dir)
+    (builtin/target :dir #{dir}
+                    :no-clean (or no-clean false))))

 (boot/deftask cache
   "control cache: retrieve, save, clean"
@@ -930,15 +926,14 @@
   "watch etc. for gae project"
   [s service bool "service"
    v verbose bool "verbose"]
-  (let [mod (str (-> (boot/get-env) :gae :module :name))]
-    (comp (builtin/watch)
-          (builtin/notify :audible true)
-          ;;(builtin/sift :move {#"(.*\.clj$)" (str (if mod (str mod "/")) classes-dir "/$1")})
-          (builtin/sift :move {#"(.*\.clj$)" (str classes-dir "/$1")})
-          ;; (builtin/pom)
-          ;; (builtin/jar)
-          ;; NB: use gae/target, not builtin/target
-          (target :no-clean true :service service))))
+  ;;(let [mod (str (-> (boot/get-env) :gae :module :name))]
+  (comp (builtin/watch)
+        (builtin/notify :audible true)
+        ;;(builtin/sift :move {#"(.*\.clj$)" (str (if mod (str mod "/")) classes-dir "/$1")})
+        (builtin/sift :move {#"(.*\.clj$)" (str classes-dir "/$1")})
+        (if service
+          (target :no-clean true :service service :monitor true)
+          (target :no-clean true :service service :monitor false))))

 ;; FIXME: not sure what this was for.  Just moving clj sources to the right output dir?
 ;; replaced by sifting?
@@ -987,13 +982,16 @@
    m module MODULE str "module pfx"
    n gen-reloader-ns NS sym "ns for gen-reloader"
    r reloader-impl-ns NS sym "ns for reloader"
+   s service bool "build as service"
    w web-inf WEB-INF str "WEB-INF dir, default: WEB-INF"
    v verbose bool "Print trace messages."]
   (let [edn-tmp (boot/tmp-dir!)
         prev-pre (atom nil)
         web-inf (if web-inf web-inf web-inf-dir)

-        module (or module (-> (boot/get-env) :gae :module :name))
+        module (if service
+                 (or module (-> (boot/get-env) :gae :module :name))
+                 nil)

         gen-reloader-ns (if gen-reloader-ns (symbol gen-reloader-ns) (gensym "reloadergen"))
         gen-reloader-path (str gen-reloader-ns ".clj")
@@ -1111,6 +1109,7 @@

    _ modules MODULES edn "modules map"

+   s service bool "service"
    v verbose bool "verbose"]

   (boot/with-pre-wrap [fileset]
@@ -1127,6 +1126,11 @@
           ;; _ (println "ARGS: " args)
           ;; jargs (into-array String (conj jargs "build/exploded-app"))

+          target-dir (if service (str (-> (boot/get-env) :gae :module :app-dir)
+                                      "/target/"
+                                      (-> (boot/get-env) :gae :module :name))
+                         "target")
+
           checkout-vec (-> (boot/get-env) :checkouts)
           cos (map #(assoc (apply hash-map %) :coords [(first %) (second %)]) checkout-vec)
           default-mod (filter #(or (:default %) (not (:module %))) cos)
@@ -1159,7 +1163,7 @@
                         (if (not java-agent) ["--no_java_agent"])
                         (if http-port [(str "--port=" http-port)])
                         (if http-address [(str "--address=" http-address)])
-                        [(gae-app-dir)])
+                        [target-dir])
           jargs (into-array String jargs)]

       (if verbose


fix homedir on Windows

fix homedir on Windows

--- src-cljs/cljsbuild_ui/util.cljs
+++ src-cljs/cljsbuild_ui/util.cljs
@@ -30,7 +30,7 @@
 (def on-linux?
   (.test #"^linux" js/process.platform))

-(def homedir (aget js/process "env" "HOME"))
+(def homedir (aget js/process "env" (if on-windows? "USERPROFILE" "HOME")))

 (defn log
   "Log a Clojure thing."


Fix webdriver tests

Fix webdriver tests

--- src-cljs/frontend/api/path.cljs
+++ src-cljs/frontend/api/path.cljs
@@ -7,6 +7,11 @@
                   "/api/dangerzone/project/%s"
                   vcs-type)
     "github" "/api/v1/project"))
+
+(defn- base-organization-url-path [vcs-type org-name]
+  (gstring/format "/api/v1.1/organization/%s/%s"
+                  (or vcs-type "github")
+                  org-name))

 (defn branch-path [vcs-type org-name repo-name branch]
   (gstring/format


add comments

add comments

--- src/app/symbol_solver/scope.clj
+++ src/app/symbol_solver/scope.clj
@@ -32,6 +32,10 @@
 (import com.github.javaparser.ast.visitor.DumpVisitor)
 (import com.github.javaparser.ast.type.PrimitiveType)

+; ==========================================================
+; SymbolsDeclarator: we define which nodes are declarations
+; ==========================================================
+
 (defprotocol SymbolsDeclarator
   ; Return a map where the keys are the element declared and the values are the declarations
   (declared-symbols [this]))
@@ -55,6 +59,10 @@
   com.github.javaparser.ast.body.VariableDeclarator
   (declared-symbols [this]
       {(.getName (.getId this)) (.getId this)}))
+
+; ================================================
+; scope: we define which declarations are visible
+; ================================================

 (defprotocol scope
   ; for example in a BlockStmt containing statements [a b c d e], when solving symbols in the context of c


comment

comment

--- src/babel/francais/lexicon.cljc
+++ src/babel/francais/lexicon.cljc
@@ -63,7 +63,8 @@
              :synsem {:cat :lexeme-with-an-unspecified-category}
              :d-no-cat true})

-   ;; Morphology only sees :français, but needs :cat to know how to conjugate words.
+   ;; Morphology only sees :français, but needs :cat to know how to conjugate words:
+   ;; see also (defn babel.francais.morphology/pre-conjugate)
    (default {:français {:cat cat1}
              :synsem {:cat cat1}})


+indices on [:synsem :essere] and [:synsem :infl]

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -21,10 +21,14 @@
    [dag_unify.core :refer (fail? get-in remove-matching-keys strip-refs unify)]))

 (def index-lexicon-on-paths
-  [[:italiano :italiano]
+  [
+   [:italiano :italiano]
    [:synsem :aux]
    [:synsem :cat]
-   [:synsem :sem :pred]])
+   [:synsem :essere]
+   [:synsem :infl]
+   [:synsem :sem :pred]
+   ])

 (def tenses
   {"present" {:synsem {:sem {:tense :present}}}


'lo': reflexive: false

'lo': reflexive: false

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1405,6 +1405,7 @@
    [{:synsem {:cat :noun
               :pronoun true
               :case pronoun-acc
+              :reflexive false
               :agr {:gender :masc
                     :person :3rd
                     :number :sing}
@@ -1415,6 +1416,7 @@
     {:synsem {:cat :noun
               :pronoun true
               :case pronoun-acc
+              :reflexive false
               :agr {:gender :masc
                     :person :3rd
                     :number :sing}


+fail?

+fail?

--- src/babel/italiano/workbook.clj
+++ src/babel/italiano/workbook.clj
@@ -22,7 +22,7 @@
    [clojure.string :as string]
    [clojure.tools.logging :as log]
    [compojure.core :as compojure :refer [GET PUT POST DELETE ANY]]
-   [dag_unify.core :refer [fail-path-between get-in merge remove-false
+   [dag_unify.core :refer [fail? fail-path-between get-in merge remove-false
                            remove-matching-keys strip-refs unify]]
    [hiccup.core :refer [html]]
 ))


fix dijkstra

fix dijkstra

--- src/ceres_analytics/metrics.clj
+++ src/ceres_analytics/metrics.clj
@@ -27,15 +27,19 @@
 (defn dijkstra
   "Dijkstra on social news graph"
   [start]
-  (loop [q (priority-map start 0)
+  (loop [q (priority-map [start "source"] 0)
          r {}]
     (if-let [[v d] (peek q)]
-      (let [n (map :_id (mc/find-maps @db "refs" {:target v :type ["retweet" "reply" "share" "pub"]}))
+      (let [n (map (fn [{:keys [source type]}] [source type]) (mc/find-maps @db "refs" {:target (first v) :type {$in ["retweet" "reply" "share" "pub"]}}))
             dist (zipmap n (repeat (count n) (inc d)))]
         (recur
-         (merge-with min q dist)
+         (merge-with min (pop q) dist)
          (assoc r v d)))
       r)))
+
+
+(defn type-distribution []
+  (map #(mc/count @db "refs" {:type %}) ["share" "unrelated" "source" "reply" "retweet"]))

 (comment
@@ -52,6 +56,17 @@
        frequencies
        aprint)

-  (mc/count @db "refs")
+  (->> users
+       (map #(mc/count @db "refs" {:source (:_id %)})))
+
+
+  (let [vs (mc/find-maps @db "refs" {:source {$in (map :_id users)}})]
+    (->> (map (fn [{:keys [target]}] [target (dijkstra target)]) vs)
+         count
+         time
+         ))
+
+
+  (repeat (count '()) (inc 0))

   )


Extend def-arg-spec-union to take additional arguments

--- src/clj/bluebell/utils/ebmd.clj
+++ src/clj/bluebell/utils/ebmd.clj
@@ -275,9 +275,13 @@

 ;;;------- Union arg specs -------
-(defn def-arg-spec-union [key]
-  (.registerArgSpecUnion registry key))
-
 (defn extend-arg-spec [dst & extensions]
   (doseq [e extensions]
     (.extendArgSpec registry dst e)))
+
+(defn def-arg-spec-union [key & extensions]
+  (.registerArgSpecUnion registry key)
+  (doseq [e extensions]
+    (.extendArgSpec registry key e)))
+
+


Updated make-clean docs

Updated make-clean docs

--- src/clj/forma/trends/filter.clj
+++ src/clj/forma/trends/filter.clj
@@ -240,7 +240,8 @@
 (defn make-clean
   "Wrapper for `make-reliable`, `deseasonalize` and any future data cleaning
    functions we decide to include. See `make-reliable` and `deseasonalize` for
-   further documentation"
+   further documentation. We use round to remove unwarranted numerical precision
+   from cleaned timeseries values."
   [freq good-set bad-set spectral-ts reli-ts]
   (->> (make-reliable good-set bad-set spectral-ts reli-ts)
        (deseasonalize freq)


change Djinn and Leprechaun to use card targeting

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -123,7 +123,7 @@
    {:events {:successful-run {:effect (effect (add-prop card :counter 1)) :req (req (= target :rd))}
              :runner-turn-begins
                              {:req (req (>= (get-virus-counters state side card) 3)) :msg "look at the top card of R&D"
-                              :effect (effect (prompt! card (str "The top card of your R&D is "
+                              :effect (effect (prompt! card (str "The top card of R&D is "
                                                                  (:title (first (:deck corp)))) ["OK"] {}))}}}

    "Djinn"
@@ -134,11 +134,10 @@
                                        (:deck runner)))
                  :cost [:click 1 :credit 1] :effect (effect (move target :hand) (shuffle! :deck))}
                 {:label "Install a non-Icebreaker program on Djinn" :cost [:click 1]
-                 :prompt "Choose a non-Icebreaker program to install on Djinn"
-                 :choices (req (filter #(and (= (:type %) "Program")
-                                             (not (has? % :subtype "Icebreaker"))
-                                             (<= (:cost %) (:credit runner)))
-                                       (:hand runner)))
+                 :prompt "Choose a non-Icebreaker program from your Grip to install on Djinn"
+                 :choices {:req #(and (= (:type %) "Program")
+                                      (not (has? % :subtype "Icebreaker"))
+                                      (= (:zone %) [:hand]))}
                  :msg (msg "install and host " (:title target))
                  :effect (effect (gain :memory (:memoryunits target))
                                  (runner-install target {:host-card card}))}
@@ -276,10 +275,8 @@
    "Leprechaun"
    {:abilities [{:label "Install a program on Leprechaun"
                  :req (req (<= (count (:hosted card)) 2)) :cost [:click 1]
-                 :prompt "Choose a program to install on Leprechaun"
-                 :choices (req (filter #(and (= (:type %) "Program")
-                                             (<= (:cost %) (:credit runner)))
-                                       (:hand runner)))
+                 :prompt "Choose a program from your Grip to install on Leprechaun"
+                 :choices {:req #(and (= (:type %) "Program") (= (:zone %) [:hand]))}
                  :msg (msg "host " (:title target))
                  :effect (effect (gain :memory (:memoryunits target))
                                  (runner-install target {:host-card card}))}


New function: move-file

New function: move-file

--- src/clj_fileutils/fileutils.clj
+++ src/clj_fileutils/fileutils.clj
@@ -44,4 +44,8 @@
           file2 (new java.io.File filename2)]
           (.renameTo file1 file2)))

+(defn move-file
+    "Move or rename one file. On the same filesystem the rename should be atomic."
+    [filename1 filename2]
+    (mv-file filename1 filename2))


Remove retro specific placeholders

Remove retro specific placeholders

--- src/cljs/retroboard/client.cljs
+++ src/cljs/retroboard/client.cljs
@@ -53,15 +53,6 @@
             ((a/apply-action action) state))
           initial-state actions))

-(defn column-placeholder []
-  (str "Add a Column (e.g. "
-       (first (shuffle ["What Went Well"
-                        "What Needs Improvement"
-                        "Action Items"
-                        "Keep Doing"
-                        "Start Doing"
-                        "Stop Doing"]))
-       ")"))

 (defn create-column-button [connection owner]
   (reify
@@ -76,7 +67,7 @@
         (dom/div #js {:id "create-column"}
                  (dom/input #js {:id "new-column" :name "new-column"
                                  :type "text"
-                                 :placeholder (column-placeholder)
+                                 :placeholder "Add a Column"
                                  :value header
                                  :onKeyUp (fn [e]
                                             (when (= 13 (.-keyCode e))
@@ -114,14 +105,6 @@
                                         :className "cancel-delete"}
                                    "No")))))))

-(defn note-placeholder []
-  (first (shuffle ["I just think that..."
-                   "What if we..."
-                   "Why do we always..."
-                   "Maybe next time we could..."
-                   "I like that we..."
-                   "We're doing better about..."])))
-
 (defn create-note-button [app owner]
   (reify
     om/IInitState
@@ -135,7 +118,6 @@
                             (om/set-state! owner :text "")))]
         (dom/div #js {:className "new-note-wrapper"}
                  (dom/textarea #js {:className "new-note" :name "new-note"
-                                    :placeholder (note-placeholder)
                                     :type "text"
                                     :value text
                                     :onKeyDown (fn [e]


Subgraph vertex predicate requires two arguments

--- src/clojure/glittering/core.clj
+++ src/clojure/glittering/core.clj
@@ -142,4 +142,4 @@
 (defn subgraph [epred vpred graph]
   (.subgraph graph
              (new ScalaFunction1 epred)
-             (new ScalaFunction1 vpred)))
+             (new ScalaFunction2 vpred)))


Remove debug output

Remove debug output

--- src/dependable/core_resolve.clj
+++ src/dependable/core_resolve.clj
@@ -41,7 +41,6 @@
    found-packages
    absent-specs
    clauses]
-  (debug clauses)
   (if (empty? clauses)
     [:successful (set (vals found-packages))]
     (let [fclause (first clauses)
@@ -57,16 +56,8 @@
              [requirement]
              (let [{status :status id :id spec :spec} requirement
                    present-package (get present-packages id)]
-               (debug requirement)
-               (debug rclauses)
-               (debug present-package)
                (cond
                  (not (nil? present-package))
-                 (do
-                   (debug (or (and (= status :absent)
-                                  (not (safe-spec-call spec present-package)))
-                             (and (= status :present)
-                                  (safe-spec-call spec present-package))))
                    (when
                        (or (and (= status :absent)
                                 (not (safe-spec-call spec present-package)))
@@ -77,7 +68,7 @@
                       present-packages
                       found-packages
                       absent-specs
-                      rclauses)))
+                      rclauses))
                  (= status :absent)
                  (resolve-deps
                   repo


CLJS-1431: load-file doc output missing arglists

--- src/main/clojure/cljs/repl.cljc
+++ src/main/clojure/cljs/repl.cljc
@@ -1110,7 +1110,7 @@
   For each name in constructor-name-symbols, adds a mapping from name to the
   constructor named by closure-namespace to the current namespace. Use :import in the ns
   macro in preference to calling this directly."}
-    load-file {:arglist ([name])
+    load-file {:arglists ([name])
                :doc "Sequentially read and evaluate the set of forms contained in the file."}})

 (defn- repl-special-doc [name-symbol]


A few more movie-lens tweaks.

A few more movie-lens tweaks.

--- examples/movie-lens/src/movie_lens/main.clj
+++ examples/movie-lens/src/movie_lens/main.clj
@@ -42,7 +42,6 @@

 (defn- block-recorder
   [store event]
-  (log/info event)
   (let [client (:riemann/client store)
         evt (case (:type event)
               :blocks.meter/method-time
@@ -69,23 +68,25 @@
 (defn- store-constructor
   "Initialize a MerkleDAG graph store from the given config."
   [cfg]
-  (fn init
-    []
-    (require 'blocks.store.s3)
-    (require 'merkle-db.graph)
-    (require 'riemann.client)
-    (mdag/init-store
-      :encoding [:mdag :gzip :cbor]
-      :store (-> (block/->store (:blocks-url cfg))
-                 (assoc :riemann/client (when-let [host (:riemann-host cfg)]
-                                          (riemann/tcp-client
-                                            :host host
-                                            :port (:riemann-port cfg 5555)))
-                        :blocks.meter/recorder block-recorder
-                        :blocks.meter/label "s3")
-                 (component/start))
-      :cache {:total-size-limit (:cache-size cfg (* 32 1024 1024))}
-      :types merkle-db.graph/codec-types)))
+  (let [blocks-url (:blocks-url cfg)
+        label (first (str/split (:blocks-url cfg) #":" 2))]
+    (fn init
+      []
+      (require 'blocks.store.s3)
+      (require 'merkle-db.graph)
+      (require 'riemann.client)
+      (mdag/init-store
+        :encoding [:mdag :gzip :cbor]
+        :store (-> (block/->store blocks-url)
+                   (assoc :blocks.meter/label label
+                          :blocks.meter/recorder block-recorder
+                          :riemann/client (when-let [host (:riemann-host cfg)]
+                                            (riemann/tcp-client
+                                              :host host
+                                              :port (:riemann-port cfg 5555))))
+                   (component/start))
+        :cache {:total-size-limit (:cache-size cfg (* 32 1024 1024))}
+        :types merkle-db.graph/codec-types))))

 (defn- load-db
@@ -252,5 +253,4 @@
           (println "Press RETURN to exit")
           (flush)
           (read-line)))
-      (when-not @success?
-        (System/exit 1)))))
+      (System/exit (if @success? 0 1)))))


New utility function added to utils.clj module - fourth

--- src/hurvinek/utils.clj
+++ src/hurvinek/utils.clj
@@ -10,12 +10,18 @@
 ;      Pavel Tisnovsky
 ;

-(ns hurvinek.utils)
+(ns hurvinek.utils
+    "Various utility function used by other modules.")

 (defn third
     "Simple utility function - returns third item from a given sequence."
     [coll]
     (nth coll 2 nil))
+
+(defn fourth
+    "Simple utility function - returns fourth item from a given sequence."
+    [coll]
+    (nth coll 3 nil))

 (defn substring
     "Call method String.substring()."


fix for missing stats

fix for missing stats

--- iwaswhere-web/src/cljs/iwaswhere_web/store.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/store.cljs
@@ -10,6 +10,7 @@
                       (assoc-in [:entries] (:entries msg-payload))
                       (assoc-in [:entries-map] entries-map)
                       (assoc-in [:cfg :hashtags] (:hashtags msg-payload))
+                      (assoc-in [:stats] (:stats msg-payload))
                       (assoc-in [:cfg :mentions] (:mentions msg-payload)))]
     {:new-state new-state}))


fakturama url changed

fakturama url changed

--- main/src/dda/pallet/dda_managed_vm/domain.clj
+++ main/src/dda/pallet/dda_managed_vm/domain.clj
@@ -143,7 +143,7 @@
              :remove-xubuntu-unused :remove-ubuntu-unused :install-lightning
              :install-redshift}}
           (= usage-type :desktop-office)
-          {:fakturama {:app-download-url "https://files.fakturama.info/release/v2.0.3/Fakturama_linux_x64_2.0.3.deb"
+          {:fakturama {:app-download-url "https://bitbucket.org/fakturamadev/fakturama-2/downloads/Fakturama_linux_x64_2.0.3.deb"
                        :doc-download-url "https://files.fakturama.info/release/v2.0.3/Handbuch-Fakturama_2.0.3.pdf"}
            :settings
             #{:install-libreoffice :install-spellchecking-de


Fixes keyword typo.

Fixes keyword typo.

[ci skip]

--- src/onyx/peer/function.clj
+++ src/onyx/peer/function.clj
@@ -36,7 +36,7 @@
             (do (reset! (:onyx.core/pipeline event) reader)
                 (swap! (:onyx.core/n-sent-messages event) + (count outgoing))
                 {:onyx.core/batch outgoing
-                 :onyx.core/barrier (->Barrier nil (:onyx.core/irnd event)
+                 :onyx.core/barrier (->Barrier nil (:onyx.core/id event)
                                                (+ n-sent (count outgoing))
                                                (:onyx.core/task-id event)
                                                nil (:onyx.core/id event))})


Changed the peer coordindates as the barrier moves downstream.

[ci skip]

--- src/onyx/peer/function.clj
+++ src/onyx/peer/function.clj
@@ -7,6 +7,7 @@
             [onyx.extensions :as extensions]
             [clj-tuple :as t]
             [onyx.log.commands.peer-replica-view :refer [peer-site]]
+            [onyx.types :refer [->Barrier]]
             [taoensso.timbre :as timbre :refer [debug info]])
   (:import [java.util UUID]))

@@ -36,10 +37,15 @@
                      (when-let [site (peer-site peer-replica-view target)]
                        (onyx.extensions/send-messages messenger site segs)))))
                grouped)
-         (doseq [b (:onyx.core/barriers event)]
-           (when-let [target (:to-peer-id b)]
-             (when-let [site (peer-site peer-replica-view target)]
-               (onyx.extensions/send-barrier messenger site b)))))))
+         (let [downstream-task-ids (vals (:egress-ids (:task @peer-replica-view)))
+               replica @replica
+               downstream-peers (mapcat #(get-in replica [:allocations (:onyx.core/job-id event) %]) downstream-task-ids)]
+           (doseq [b (:onyx.core/barriers event)]
+             (doseq [target downstream-peers]
+               (when-let [site (peer-site peer-replica-view target)]
+                 (let [b (->Barrier target (:onyx.core/id event) (:barrier-id b))]
+                   (prn "Send off: " b)
+                   (onyx.extensions/send-barrier messenger site b)))))))))
    {}))

 (defrecord Function [replica peer-replica-view state messenger egress-tasks]


Apparently this is a meaningful distinction

--- src/oxcart/emitter/jvm.clj
+++ src/oxcart/emitter/jvm.clj
@@ -81,7 +81,7 @@
        {:op          :class
         :attr        #{:public :super :final}
         :class-name  class-name
-        :super       :java.lang.Object
+        :super       "java/lang/Object"
         :name        (s/replace class-name \. \/)
         :methods     [{:op     :method
                        :attr   #{:public :static}


raise default port to var

raise default port to var

--- figwheel-repl/src/figwheel/repl.cljc
+++ figwheel-repl/src/figwheel/repl.cljc
@@ -27,6 +27,8 @@
               [goog Promise]
               [goog.storage.mechanism HTML5SessionStorage]]
        :clj [java.util.concurrent.ArrayBlockingQueue])))
+
+(def default-port 9500)

 #?(:cljs (do

@@ -1021,7 +1023,7 @@
 (defn repl-env* [{:keys [port open-url connection-filter]
                   :or {connection-filter identity
                        open-url "http://[[server-hostname]]:[[server-port]]"
-                       port 9500} :as opts}]
+                       port default-port} :as opts}]
   (merge (FigwheelReplEnv.)
          ;; TODO move to one atom
          {:server-kill (atom nil)


Long overdue compile fix to modular.bidi tests

--- modules/bidi/test/modular/bidi_tests.clj
+++ modules/bidi/test/modular/bidi_tests.clj
@@ -3,7 +3,7 @@
 (ns modular.bidi-tests
   (:require
    [clojure.test :refer :all]
-   [modular.bidi :refer (WebService ring-handler-map uri-context routes ->ComponentAddressable ->Router)]
+   [modular.bidi :refer (WebService request-handlers uri-context routes ->ComponentAddressable ->Router)]
    [bidi.bidi :as bidi :refer (match-route path-for)]
    [com.stuartsierra.component :as component])
   )
@@ -11,7 +11,7 @@
 (deftest web-service-components
   (let [component-A
         (reify WebService
-          (ring-handler-map [_] {:a "Alpha"
+          (request-handlers [_] {:a "Alpha"
                                  :b "Beta"})
           (routes [_] ["/" {["a/" :docid] :a
                             "b" :b}])
@@ -19,7 +19,7 @@

         component-B
         (reify WebService
-          (ring-handler-map [_] {:a "Delta"
+          (request-handlers [_] {:a "Delta"
                                  :b "Gamma"})
           (routes [_] ["/" {"a" :a
                             "b" :b}])
@@ -108,7 +108,7 @@

       component-A
       (reify WebService
-        (ring-handler-map [_] {:a handler-a-a
+        (request-handlers [_] {:a handler-a-a
                                :b "Beta"})
         (routes [_] ["/" {["a/" :docid] :a
                           "b" :b}])
@@ -116,7 +116,7 @@

       component-B
       (reify WebService
-        (ring-handler-map [_] {:a "Delta"
+        (request-handlers [_] {:a "Delta"
                                :g handler-b-g})
         (routes [_] ["/" {"a" :a
                           "g" :g}])
@@ -124,7 +124,7 @@

       component-C
       (reify WebService
-        (ring-handler-map [_] {:a handler-c-a
+        (request-handlers [_] {:a handler-c-a
                                :z "Zigzag"})

         (routes [_] ["/" {"a" :a
@@ -139,7 +139,7 @@
       handlers (apply merge
                       (for [[k v] deps
                             :when (satisfies? WebService v)]
-                        {k (ring-handler-map v)}))
+                        {k (request-handlers v)}))

       this {:handlers handlers
             :routes ["" (vec (for [[k v] (sort deps)


Updates for a more streamlined pre-filled form

--- scrape-n-mail/src/scrape_n_mail/core.cljs
+++ scrape-n-mail/src/scrape_n_mail/core.cljs
@@ -18,6 +18,7 @@
 (defonce app-data (atom {:initialized false
                          :signed-in? false
                          :sheet-data nil}))
+(defonce blank-form "https://goo.gl/forms/u9R2JEREElx89yOf2")
 (defonce wellbeing-sheet "1bv6vgW-HMTz0uhKDkrJoTg387b-WK6IFkFd9y6N96hA")
 (defonce payment-link "https://www.paypal.me/pools/c/85ChNpjaRV")

@@ -184,11 +185,16 @@
               [:p submitter-email]
                [:br]
                [:p "Dear " (::submitter-name (first name-records)) ","]
-
+
+               [:p "You should have recently recieved the monthly announcement for the renewal of "
+                   "names for wellbeing. That email goes into more detail than this one and includes a photo of the altar. "]
+
                [:p "Currently, the community is holding the following names on the altar "
-                   "in support of their wellbeing at your request. This month, you can click "
+                   "in support of their wellbeing at your request. You can click "
                    "directly on each name you would like to remain and get a pre-filled form. "
-                   "Please check each submission before clicking the submit button, and let Dav know if there is anything incorrect."
+                   "Please check each submission before clicking the submit button, and let Dav know "
+                   "if there is anything incorrect."
+
                 (into [:ul {:id "content"}]
                   ; We currently assume all visible data is "current"
                   ; (filter #(s/includes? (aget % 0) "2017"))
@@ -196,15 +202,16 @@
                   (map #(vector :li (prefilled-link %)) name-records))

                 "New names may be submitted at "
-
-                [:a {:href "https://docs.google.com/forms/d/e/1FAIpQLSc_FFrH7a_ClDmpAq36vA7gdUd1njmoEK0wfhRNaYcjfLox0w/viewform"}
-                "this link"] ". If the above links don't work, you can copy-paste the form link into your browser:"]
-
-               [:p "https://docs.google.com/forms/d/e/1FAIpQLSc_FFrH7a_ClDmpAq36vA7gdUd1njmoEK0wfhRNaYcjfLox0w/viewform"]
-
-               [:p [:em "Please recall that it is traditional to offer Dana along with the submission of names."]]
-
-               [:p "If we do not hear from you, we will remove these names from the altar. Jai mitra!"]
+                [:a {:href blank-form} "this link"]
+                ". If the above links don't work, you can copy-paste the form link into your browser:"]
+
+               [:p blank-form]
+
+               [:p [:em "As explained in the group email, it is traditional to offer Dana "
+                        "along with the submission of names. Here's "
+                        [:a {:href payment-link} "the link."]]]
+
+               [:p "If we do not hear from you, we will remove these names from the altar. J'ai mitra!"]

                ; Note that the \ is an escape character!
                [:p "/|\\"]


Set clojure version to 1.9.0-alpha14.

Set clojure version to 1.9.0-alpha14.

--- profiles.clj
+++ profiles.clj
@@ -41,7 +41,7 @@
                         "-Xms4g"]
    :main ^:skip-aot bench}]

- :1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha4"]]}
+ :1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha14"]]}
  :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}

  ;; Examples


bump reactor dep

bump reactor dep

--- profiles.clj
+++ profiles.clj
@@ -3,7 +3,7 @@
                       [lein-cooper "1.2.2" :exclusions [org.clojure/clojure]]]
        :dependencies [[figwheel-sidecar "0.5.8"]
                       [starcity/mailer "0.1.0"]
-                      [starcity/reactor "0.1.0"]
+                      [starcity/reactor "0.1.2"]
                       [binaryage/devtools "0.9.2"]]
        :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}


Ensure recent version of tools.nrepl for CIDER

--- profiles.clj
+++ profiles.clj
@@ -1,7 +1,12 @@
 {;;; Modular profiles

- :cider {:dependencies [;; CIDER requires Clojure 1.7.0+ to work
-                        [org.clojure/clojure "1.8.0"]]
+ :cider {:dependencies [;; CIDER 0.13.0 requires Clojure 1.7.0+ and
+                        ;; tools.nrepl 0.2.12+ to work. These are used
+                        ;; by default, but projects might want to
+                        ;; override them. If we're using CIDER though,
+                        ;; we don't want to let them do that.
+                        [org.clojure/clojure "1.8.0"]
+                        [org.clojure/tools.nrepl "0.2.12"]]

          :plugins [;; REPL-side support for CIDER and other editor tools
                    [cider/cider-nrepl "0.13.0"]]}


Try harder to find meaningful name for components

Thereby hopefully improving warning messages a bit.

--- src/reagent/impl/component.cljs
+++ src/reagent/impl/component.cljs
@@ -157,6 +157,16 @@
       (assoc fm :cljsName (fn [] name))
       fm)))

+(defn fun-name [f]
+  (or (and (fn? f)
+           (or (.' f :displayName)
+               (.' f :name)))
+      (and (implements? INamed f)
+           (name f))
+      (let [m (meta f)]
+        (if (map? m)
+          (:name m)))))
+
 (defn wrap-funs [fmap]
   (let [fun-map (if-some [cf (:componentFunction fmap)]
                   (-> fmap
@@ -169,10 +179,9 @@
                   (str "Render must be a function, not "
                        (pr-str render-fun)))
         name (str (or (:displayName fun-map)
-                      (.' render-fun :displayName)
-                      (.' render-fun :name)
-                      ""))
-        name' (if (empty? name) (str (gensym "reagent")) name)
+                      (fun-name render-fun)))
+        name' (if (empty? name)
+                (str (gensym "reagent")) name)
         fmap (-> fun-map
                  (assoc :displayName name')
                  (add-render render-fun name'))]


removes prefixing mranderson barfs on

removes prefixing mranderson barfs on

--- src/refactor_nrepl/analyzer.clj
+++ src/refactor_nrepl/analyzer.clj
@@ -2,9 +2,8 @@
   (:refer-clojure :exclude [macroexpand-1])
   (:require [clojure.java.io :as io]
             [clojure.tools.analyzer :as ana]
-            [clojure.tools.analyzer
-             [jvm :as aj]
-             [passes :refer [schedule]]]
+            [clojure.tools.analyzer.jvm :as aj]
+            [clojure.tools.analyzer.passes :refer [schedule]]
             [clojure.tools.analyzer.jvm.utils :as ajutils]
             [clojure.tools.analyzer.passes.emit-form :as emit-form]
             [clojure.tools.analyzer.passes.jvm.validate :refer [validate]]


Add Mockito to the mixture

Add Mockito to the mixture

--- clstreams/project.clj
+++ clstreams/project.clj
@@ -22,10 +22,12 @@

   :profiles {:dev
              {:source-paths ["dev"]
-              :dependencies [[org.apache.kafka/kafka-streams "0.10.2.1" :classifier "test"]
+              :dependencies [[junit/junit "4.12"]
+                             [org.apache.kafka/kafka-streams "0.10.2.1" :classifier "test"]
                              [org.apache.kafka/kafka-clients "0.10.2.1" :classifier "test"]
                              [org.clojure/java.classpath "0.2.3"]
-                             [org.clojure/tools.namespace "0.3.0-alpha3"]]
+                             [org.clojure/tools.namespace "0.3.0-alpha3"]
+                             [org.mockito/mockito-core "1.10.19"]]
               :main ^:skip-aot user}

              :uberjar


make html-content-type the default, add a couple endpoints

--- src/semtag_web/service.clj
+++ src/semtag_web/service.clj
@@ -3,21 +3,23 @@
               [io.pedestal.service.http.route :as route]
               [io.pedestal.service.http.body-params :as body-params]
               [io.pedestal.service.http.route.definition :refer [defroutes]]
+              [io.pedestal.service.interceptor :as interceptor]
               [semtag-web.views.main :as views]
               [ring.util.response :as ring-resp]))

-(defn html-response
-  [html]
-  (ring-resp/content-type (ring-resp/response html) "text/html"))
+(defn home-page [request] (ring-resp/response (views/home)))
+(defn add-page [request] (ring-resp/response (views/home "entity_add")))
+(defn all-page [request] (ring-resp/response (views/all)))

-(defn home-page
-  [request]
-  (html-response (views/home)))
-
+(interceptor/defon-response html-content-type
+  [response]
+  (ring-resp/content-type response "text/html"))
+5
 (defroutes routes
   [[["/" {:get home-page}
-     ;; Set default interceptors for /about and any other paths under /
-     ^:interceptors [(body-params/body-params)]
+     ^:interceptors [html-content-type]
+     ["/add" {:get add-page}]
+     ["/all" {:get all-page}]
      ]]])

 ;; You can use this fn or a per-request fn via io.pedestal.service.http.route/url-for


[#89] Implemented time macro and fixed deref function

--- priv/clojure/core.clj
+++ priv/clojure/core.clj
@@ -2256,7 +2256,7 @@
   ([ref]
    (if (extends? :clojerl.IDeref ref)
      (clj_core/deref.e ref)
-     (throw (str "unimplemented deref for type " (type ref)))
+     (throw (str "unimplemented deref for type " (clj_core/type.e ref)))
      #_(deref-future ref)))
   ([ref timeout-ms timeout-val]
    (throw "unimplemented")
@@ -3895,9 +3895,11 @@
  expr."
   {:added "1.0"}
   [expr]
-  `(let [start# (. System (nanoTime))
+  `(let [start# (erlang/monotonic_time.e :nano_seconds)
          ret# ~expr]
-     (prn (str "Elapsed time: " (/ (double (- (. System (nanoTime)) start#)) 1000000.0) " msecs"))
+     (prn (str "Elapsed time: "
+               (/ (- (erlang/monotonic_time.e :nano_seconds) start#) 1000000.0)
+               " msecs"))
      ret#))


[fix] query-chat-contacts subscription params

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

--- src/status_im/contact/subs.cljs
+++ src/status_im/contact/subs.cljs
@@ -92,7 +92,7 @@
  :query-current-chat-contacts
  :<- [:get-current-chat]
  :<- [:get-contacts]
- (fn [[chat contacts [_ query-fn]]]
+ (fn [[chat contacts] [_ query-fn]]
    (contact.db/query-chat-contacts chat contacts query-fn)))

 (re-frame/reg-sub
@@ -116,7 +116,7 @@
  (fn [[_ _ chat-id] _]
    [(re-frame/subscribe [:get-chat chat-id])
     (re-frame/subscribe [:get-contacts])])
- (fn [[chat all-contacts [_ query-fn]]]
+ (fn [[chat all-contacts] [_ query-fn]]
    (contact.db/query-chat-contacts chat all-contacts query-fn)))

 (re-frame/reg-sub


Now can see which components are active.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -43,6 +43,9 @@
                                                        selection-key
                                                        template
                                                        nav-event)]
+
+      (om/update! data :active-compnents active-components)
+
       (doseq [a active-components]
         (om/update! data (vector a :active) true))


Cardinality relationship gui representation and :meta section

--- resources/edn-sources/standard_app.clj
+++ resources/edn-sources/standard_app.clj
@@ -2,16 +2,20 @@
  {:name "Pilot model"
   :author "Novak Boskov"
   :comment "This is just in the sake of a proof of concept."}
+ :meta
+ {:api-only false}
  :entities
  [{:signature "Musician"
    :properties [{:name "name" :type :str :gui-label "Name"}
                 {:name "surname" :type :str :gui-label "Surname"}
                 {:name "nickname" :type :str :gui-label "nick"}
                 {:name "honors" :type {:coll :str}}
-                {:name "band" :type {:one :ref-to :signature "Band"}
+                {:name "band" :type {:one :ref-to
+                                     :signature "Band"
+                                     :gui :select-form}
                  :gui-label "Of band"}
-                {:name "social-profile" :type {:one :ref-to :signature
-                                               "SocialMediaProfile"}
+                {:name "social-profile" :type {:one :ref-to
+                                               :signature "SocialMediaProfile"}
                  :gui-label "profile"}]}
   {:signature "Band"
    :properties [{:name "name" :type :str :gui-label "Name"}
@@ -19,23 +23,33 @@
                 {:name "largeness" :type :str :gui-label "Largeness"}
                 {:name "members" :type {:coll :ref-to :signature "Musician"}
                  :gui-label "Members"}
-                {:name "category" :type {:one :ref-to :signature "Category"}
+                {:name "category" :type {:one :ref-to
+                                         :signature "Category"
+                                         :gui :drop-list}
                  :gui-label "Category"}
-                {:name "participated" :type {:coll :ref-to :signature "Festival"}
+                {:name "participated" :type {:coll :ref-to
+                                             :signature "Festival"
+                                             :gui :table-view}
                  :gui-label "Participated in"}]}
   {:signature "Category"
    :properties [{:name "name" :type :str :gui-label "Name"}
                 {:name "subcategories" :type {:coll :ref-to :signature "Category"}
                  :gui-label "subcategories"}
-                {:name "bands" :type {:coll :ref-to :signature "Band"}
+                {:name "bands" :type {:coll :ref-to
+                                      :signature "Band"
+                                      :gui :table-view}
                  :gui-label "Bands of category"}]}
   {:signature "Festival"
    :properties [{:name "name" :type :str :gui-label "Name"}
                 {:name "location" :type :geo :gui-label "Loco"}
-                {:name "bands" :type {:coll :ref-to :signature "Band"}
+                {:name "bands" :type {:coll :ref-to
+                                      :signature "Band"
+                                      :gui :table-view}
                  :gui-label "participant bands"}]}
   {:signature "SocialMediaProfile"
-   :properties [{:name "owner" :type {:one :ref-to :signature "Musician"}
+   :properties [{:name "owner" :type {:one :ref-to
+                                      :signature "Musician"
+                                      :gui :select-form}
                  :gui-label "Name"}
                 {:name "name" :type :str :gui-label "name"}
                 {:name "provider" :type :str :gui-label "provider"}]}]}


Sync github info when loading account page

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -427,6 +427,7 @@
   (let [api-ch (get-in current-state [:comms :api])]
     (when-not (seq (get-in current-state state/projects-path))
       (api/get-projects (get-in current-state [:comms :api])))
+    (ajax/ajax :get "/api/v1/sync-github" :me api-ch)
     (ajax/ajax :get "/api/v1/user/organizations" :organizations api-ch)
     (ajax/ajax :get "/api/v1/user/token" :tokens api-ch)
     (set-page-title! "Account")))


Refactor ta with names.

Refactor ta with names.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -80,12 +80,12 @@
     (part model a b c d)))

 (def ta
-  (part
-    (phrase [4/4 5/4 3/4 4/4] (cons nil (repeat 1)))
-    (split 9/4 1/4)
-    (comp (split 10/4 1/4) (split 9/4 1/4))
-    (comp (split 11/4 1/8) (split 10/4 1/4) (split 9/4 1/4))
-    (split 4/4 1/4)))
+  (let [model (->> (phrase [5/4 3/4 4/4] (repeat 1)) (after 4/4))
+        a (split 9/4 1/4)
+        b (comp (split 10/4 1/4) a)
+        c (comp (split 11/4 1/8) b)
+        d (split 4/4 1/4)]
+    (part model a b c d)))

 (def ha
   (part


Removed print statements.

Removed print statements.

--- src/cmr_edsc_stubs/data/fake_response.clj
+++ src/cmr_edsc_stubs/data/fake_response.clj
@@ -220,9 +220,6 @@
   ([path-w-extension params headers]
     (handle-prototype-request path-w-extension params headers ""))
   ([path-w-extension params headers query-string]
-    (println "path-w-extension:" path-w-extension)
-    (println "params:" params)
-    (println "headers:" headers)
     (cond
       (string/starts-with? path-w-extension "collections")
         (get-collections path-w-extension params headers)


Fix auto-correct, auto-capitalize and spell-check options on email fields

--- src/braid/client/gateway/user_auth/views.cljs
+++ src/braid/client/gateway/user_auth/views.cljs
@@ -28,9 +28,9 @@
        [:input {:type "email"
                 :placeholder "you@awesome.com"
                 :auto-complete true
-                :auto-correct false
-                :auto-capitalize false
-                :spellcheck false
+                :auto-correct "off"
+                :auto-capitalize "off"
+                :spell-check "false"
                 :auto-focus true
                 :value value
                 :on-blur (fn [_]
@@ -206,9 +206,9 @@
        [:input {:type "email"
                 :placeholder "you@awesome.com"
                 :auto-complete true
-                :auto-correct false
-                :auto-capitalize false
-                :spellcheck false
+                :auto-correct "off"
+                :auto-capitalize "off"
+                :spell-check "false"
                 :auto-focus true
                 :value value
                 :on-blur (fn [_]


call bug

call bug

--- src/clojure/zensols/model/eval_classifier.clj
+++ src/clojure/zensols/model/eval_classifier.clj
@@ -355,7 +355,8 @@
                             (log/infof "dividing train/test split by %.3f"
                                        divide-ratio)
                             (divide-by-set divide-ratio)
-                            (compile-results (list classifier) meta-set :test-type :train-test)))
+                            (binding [*default-set-type* :train-test]
+                              (compile-results (list classifier) meta-set))))
                      (apply concat)
                      (map (fn [res]
                             (let [name (-> res :classifier cl/classifier-name)]


defonce a node require

defonce a node require

--- clojure/src/dnd/showScreen.cljs
+++ clojure/src/dnd/showScreen.cljs
@@ -6,7 +6,7 @@

 (defonce terminal (nodejs/require "terminal-kit"))

-(def bresenham (nodejs/require "bresenham-js"))
+(defonce bresenham (nodejs/require "bresenham-js"))

 (defn end-points [character]
   (let [{:keys [x y]} character


remove test ambiguity

remove test ambiguity

--- test/clj_money/trading_test.clj
+++ test/clj_money/trading_test.clj
@@ -960,7 +960,7 @@
         result (trading/split storage-spec {:commodity-id (:id commodity)
                                             :account-id (:id ira)
                                             :shares-gained 100M
-                                            :split-date (t/local-date 2016 3 2)})
+                                            :split-date (t/local-date 2016 3 3)})
         lots (lots/search storage-spec {:commodity-id (:id commodity)})
         actual-lots (map #(dissoc % :id :created-at :updated-at :commodity-id) lots)
         expected-lots [{:purchase-date (t/local-date 2016 3 2)
@@ -969,7 +969,7 @@
                         :shares-purchased 200M
                         :shares-owned 200M}]
         expected-transaction {:entity-id (:entity-id commodity)
-                              :transaction-date (t/local-date 2016 3 2)
+                              :transaction-date (t/local-date 2016 3 3)
                               :description "Split shares of AAPL 2 for 1"
                               :value 0M
                               :items [{:action :debit


Updated stats to pull from db.

Updated stats to pull from db.

--- src/hxgm30/language/app/handler/stats.clj
+++ src/hxgm30/language/app/handler/stats.clj
@@ -13,7 +13,7 @@
   (:require
     [hxgm30.httpd.kit.response :as response]
     [hxgm30.language.app.handler.util :as util]
-    [hxgm30.language.gen.corpus :as corpus]
+    [hxgm30.language.components.lang :as lang]
     [taoensso.timbre :as log]))

 (defn read-lang-stats
@@ -23,7 +23,7 @@
           gen-type (util/get-gen-type request)]
       (log/debug "Got language:" lang)
       (response/json request
-                     (corpus/undump gen-type lang)))))
+                     (lang/lang-stats component gen-type lang)))))

 (defn read-name-stats
   [component]
@@ -32,4 +32,4 @@
           name-type (util/get-name-type request)
           gen-type (util/get-gen-type request)]
       (response/json request
-                     (corpus/undump race name-type gen-type)))))
+                     (lang/name-stats component race name-type gen-type)))))


#32 test for callbacks.

#32 test for callbacks.

--- test/http/async/client/test.clj
+++ test/http/async/client/test.clj
@@ -216,6 +216,66 @@
          :minor 1)
     (is (= (:test-header headers) "test-value"))))

+(deftest test-body-part-callback
+  (testing "callecting body callback"
+    (let [parts (atom #{})
+          resp (execute-request *client*
+                                (prepare-request :get "http://localhost:8123/stream")
+                                :part (fn [response ^ByteArrayOutputStream part]
+                                        (let [p (.toString part ^String *default-encoding*)]
+                                          (swap! parts conj p)
+                                          [p :continue])))]
+      (await resp)
+      (is (contains? @parts "part1"))
+      (is (contains? @parts "part2"))
+      (is (= 2 (count @parts)))))
+  (testing "counting body parts callback"
+    (let [cnt (atom 0)
+          resp (execute-request *client*
+                                (prepare-request :get "http://localhost:8123/stream")
+                                :part (fn [_ ^ByteArrayOutputStream p]
+                                        (swap! cnt inc)
+                                        [p :continue]))]
+      (await resp)
+      (is (= 2 @cnt)))))
+
+(deftest test-body-completed-callback
+  (testing "successful response"
+    (let [finished (promise)
+          resp (execute-request *client*
+                                (prepare-request :get "http://localhost:8123/")
+                                :completed (fn [response]
+                                             (deliver finished true)))]
+      (await resp)
+      (is (true? (realized? finished)))
+      (is (true? @finished))))
+  (testing "execution time"
+    (let [finished (promise)
+          req (prepare-request :get "http://localhost:8123/")
+          start (System/currentTimeMillis)
+          resp (execute-request *client* req
+                                :completed (fn [_]
+                                             (deliver finished
+                                                      (- (System/currentTimeMillis) start))))]
+      (is (pos? @finished))))
+  (testing "failed response"
+    (let [finished (promise)
+          resp (execute-request *client*
+                                (prepare-request :get "http://not-existing-host/")
+                                :completed (fn [response]
+                                             (deliver finished true)))]
+      (await resp)
+      (is (false? (realized? finished))))))
+
+(deftest test-error-callback
+  (let [errored (promise)
+        resp (execute-request *client* (prepare-request :get "http://not-existing-host/")
+                              :error (fn [_ e]
+                                       (deliver errored e)))]
+    (await resp)
+    (is (true? (realized? errored)))
+    (is (true? (instance? java.net.ConnectException @errored)))))
+
 (deftest test-send-headers
   (let [resp (GET *client* "http://localhost:8123/" :headers {:a 1 :b 2})
         headers (headers resp)]


Formatting

Formatting

--- test/icecap/store/riak_test.clj
+++ test/icecap/store/riak_test.clj
@@ -8,28 +8,28 @@
 (deftest bucket-props-test
   (testing "default"
     (is (= (bucket-props)
-            {:n-val 3
-             :r 1
-             :w 2
-             :dw 2
+           {:n-val 3
+            :r 1
+            :w 2
+            :dw 2

-             :notfound-ok false
-             :basic-quorum true
+            :notfound-ok false
+            :basic-quorum true

-             :allow-mult false
-             :last-write-wins true})))
+            :allow-mult false
+            :last-write-wins true})))
   (testing "custom n"
     (is (= (bucket-props :n 2)
-            {:n-val 2
-             :r 1
-             :w 1
-             :dw 1
+           {:n-val 2
+            :r 1
+            :w 1
+            :dw 1

-             :notfound-ok false
-             :basic-quorum true
+            :notfound-ok false
+            :basic-quorum true

-             :allow-mult false
-             :last-write-wins true}))))
+            :allow-mult false
+            :last-write-wins true}))))

 (def ^:private store-result
   {:vclock nil,


Avoid intermediate toList for blocking/into

--- src/main/clojure/rx/lang/clojure/blocking.clj
+++ src/main/clojure/rx/lang/clojure/blocking.clj
@@ -99,7 +99,8 @@
     rx/into
   "
   [to from-observable]
-  (first (rx/into to from-observable)))
+  (with-ex-unwrap
+    (clojure.core/into to (o->seq from-observable))))

 (defn doseq*
   "*Blocks* and executes (f x) for each x emitted by xs


It works

It works

--- src/main/clojure/stl_collector/writer.clj
+++ src/main/clojure/stl_collector/writer.clj
@@ -3,13 +3,9 @@
    [stl-collector.model :as stl]
    [stl-collector.file :as stl-file]
    [clojure.java.io :as io]
-   [nio.core :as nio]
-   [clojure.pprint :as pp])
+   [nio.core :as nio])

   (:import (java.nio ByteOrder DirectByteBuffer)))
-
-(defn calculate-offset [offset n size]
-  (+ offset (* n size)))

 (defn pad [buffer offset num_bytes]
   (if (> num_bytes 0)
@@ -33,7 +29,7 @@
 (defn write-header
   [buffer count]
   (pad buffer 0 stl-file/MESSAGE_LENGTH)
-  (.putInt buffer 0 count)
+  (.putInt buffer stl-file/MESSAGE_LENGTH count)
   stl-file/HEADER_LENGTH)

 (defn write-facet
@@ -48,11 +44,18 @@
         post_vertices_offset (process_vertices buffer
                                                post_normal_offset
                                                (:vertices facet))]
-    pad buffer post_vertices_offset 2))
+    (pad buffer post_vertices_offset 2)))

 (defn calculate-file-size
   [num_facets]
   (+ stl-file/HEADER_LENGTH (* num_facets stl-file/BYTES_PER_FACET)))
+
+(defn process-facets [buffer offset facets]
+                               (if (seq facets)
+                                 (let [[f & fs] facets
+                                       new-offset (write-facet buffer offset f)]
+                                   (recur buffer new-offset fs))
+                                 offset))

 (defn write-stl
   [stl-seq ^String filename]
@@ -63,13 +66,7 @@
                                              offset
                                              length)
                                (.order ByteOrder/LITTLE_ENDIAN))
-          post-header-offset (write-header buffer num_facets)
-          process-facets     (fn [buffer offset facets]
-                               (if (seq facets)
-                                 (let [[f & fs] facets
-                                       new-offset (write-facet buffer offset f)]
-                                   (recur buffer new-offset fs))
-                                 offset))]
+          post-header-offset (write-header buffer num_facets)]
       (process-facets buffer post-header-offset stl-seq))))


Upgrade swagger-ui (#218)

Upgrade swagger-ui (#218)

--- ext/swagger/project.clj
+++ ext/swagger/project.clj
@@ -11,5 +11,5 @@
                  [yada/bidi ~VERSION]
                  [yada/webjars ~VERSION]
                  [metosin/ring-swagger "0.22.12" :exclusions [org.clojure/clojure]]
-                 [org.webjars/swagger-ui "2.2.6"]]
+                 [org.webjars/swagger-ui "3.9.3"]]
   )


indentation

indentation

--- src/metabase/events/metabot_lifecycle.clj
+++ src/metabase/events/metabot_lifecycle.clj
@@ -32,7 +32,7 @@
           (cond
             (nil? slack-token)      (metabot/stop-metabot!)
             (not metabot-enabled)   (metabot/stop-metabot!)
-            :else (metabot/restart-metabot!))))
+             :else (metabot/restart-metabot!))))
       (catch Throwable e
         (log/warn (format "Failed to process driver notifications event. %s" topic) e)))))


Get rid of unneeded println.

Get rid of unneeded println.

--- jvm/src/streamparse/commands/run.clj
+++ jvm/src/streamparse/commands/run.clj
@@ -12,7 +12,6 @@
   "Run the topology locally via LocalCluster. The topology definition is
   contained inside of topology-file which is assume to have a single var
   defined which contains the topology definition."
-  (println (str "Running " topology-file " for " run-for-secs))
   (try
     (let [topology-def (load-file topology-file) ; should only be a single var
           topology (apply topology (var-get topology-def))


(TK-202) Return TK app from restart function

To be consistent with the other app functions, this commit updates the
restart to return `this`.

--- src/puppetlabs/trapperkeeper/internal.clj
+++ src/puppetlabs/trapperkeeper/internal.clj
@@ -482,6 +482,7 @@
           (doseq [svc-id (keys services-by-id)] (swap! app-context assoc svc-id {}))
           (run-lifecycle-fns app-context s/init "init" ordered-services)
           (run-lifecycle-fns app-context s/start "start" ordered-services)
+          this
           (catch Throwable t
             (deliver shutdown-reason-promise {:cause :service-error
                                               :error t})))))))


remove unnecessary :require

remove unnecessary :require

--- src/puppetlabs/trapperkeeper/services.clj
+++ src/puppetlabs/trapperkeeper/services.clj
@@ -1,6 +1,5 @@
 (ns puppetlabs.trapperkeeper.services
   (:require [plumbing.core :refer [fnk]]
-            [slingshot.slingshot :refer [throw+]]
             [puppetlabs.trapperkeeper.app])
   (:import (puppetlabs.trapperkeeper.app TrapperKeeperApp)))


Remove duplicate code

Remove duplicate code

This filtering already occurs in -rename-file-or-dir

--- src/refactor_nrepl/rename_file_or_dir.clj
+++ src/refactor_nrepl/rename_file_or_dir.clj
@@ -175,9 +175,7 @@
          (not (str/blank? new-path))
          (or (fs/file? old-path) (fs/directory? old-path))]}
   (binding [*print-length* nil]
-    (let [affected-files (-rename-file-or-dir old-path new-path)
-          affected-files (->> affected-files (filter fs/exists?)
-                              (remove fs/directory?))]
+    (let [affected-files (-rename-file-or-dir old-path new-path)]
       (if (fs/directory? new-path)
         affected-files
         (conj affected-files new-path)))))


disable input while disconnected

disable input while disconnected

--- src/chat/client/views/new_message.cljs
+++ src/chat/client/views/new_message.cljs
@@ -211,11 +211,16 @@
             (fn [result]
               ((result :action) (config :thread-id))
               (om/set-state! owner :text ((result :message-transform) text)))
-            autocomplete-open? (and (not force-close?) (not (nil? results)))]
+            autocomplete-open? (and (not force-close?) (not (nil? results)))
+            errors-cursor (->> (om/root-cursor store/app-state) :errors
+                               om/ref-cursor (om/observe owner))
+            connected? (not-any? (fn [[k _]] (= :disconnected k))
+                                 errors-cursor)]
           (dom/div #js {:className "message new"}
             (dom/textarea #js {:placeholder (config :placeholder)
                                :ref "message-text"
                                :value (state :text)
+                               :disabled (not connected?)
                                :onChange (fn [e]
                                            (let [text (.slice (.. e -target -value) 0 5000)]
                                              (om/update-state! owner


Remove unused function

Remove unused function

--- src/cljs/react_cljs_blogpost/core.cljs
+++ src/cljs/react_cljs_blogpost/core.cljs
@@ -20,7 +20,6 @@
 ;couple of helpful predicate functions
 (defn is-matched [card] (= (:matched @card) true))
 (defn is-visible [card] (= (:visible @card) true))
-(defn is-revealed [card] (is-visible card))

 (defn revealed-cards-count [] (count (filter is-visible (:cards @state))))
 (defn matched-cards-count [] (count (filter is-matched (:cards @state))))


file upload, assertion import, backpack import

--- src/cljs/salava/badge/ui/importer.cljs
+++ src/cljs/salava/badge/ui/importer.cljs
@@ -1,5 +1,5 @@
 (ns salava.badge.ui.importer
-  (:require [reagent.core :refer [atom]]
+  (:require [reagent.core :refer [atom cursor]]
             [reagent-modals.modals :as m]
             [salava.core.ui.ajax-utils :as ajax]
             [salava.core.ui.layout :as layout]
@@ -7,7 +7,8 @@
             [salava.core.ui.notactivated :refer [not-activated-banner]]
             [salava.core.helper :refer [dump]]
             [salava.core.ui.error :as err]
-            [salava.core.i18n :refer [t translate-text]]))
+            [salava.core.i18n :refer [t translate-text]]
+            [salava.badge.ui.upload :as upload]))

 (defn import-modal [{:keys [status message saved-count error-count]}]
@@ -154,12 +155,10 @@
     [:a {:href (path-for "/badge/mybadges")} (t :badge/Mybadges)]
     " " (t :badge/Importbadgesresults3) "."]])

-(defn content [state]
+(defn mozilla-importer-block [state]
   [:div {:class "import-badges"}
-   [m/modal-window]
    [:h1.uppercase-header (t :badge/Importfrom)]
    [import-info]
-   (not-activated-banner)
    [:div.import-button
     (if (:ajax-message @state)
       [:div.ajax-message
@@ -189,6 +188,24 @@
    [badge-grid state]])

+(defn content [state]
+  (let [display-atom (cursor state [:display])]
+    [:div {:class "import-badges"}
+     [m/modal-window]
+     (if  (not-activated?)
+       (not-activated-banner)
+       [:div
+        [upload/badge-file-upload-content state]
+        [:br]
+        [:a {:style {:cursor "default"}
+              :on-click #(do (.preventDefault %)
+                          (if (identical? @display-atom "block") (reset! display-atom "none") (reset! display-atom "block")))}  (if (identical? @display-atom "none") (t :badge/Showmoreoptions) (t :badge/Hideoptions))]
+        [:div {:style {:display @display-atom}}
+         [upload/assertion-url-upload-content state]
+         [mozilla-importer-block state]
+         ]])]))
+
+
 (defn init-data [state]
   (ajax/GET (path-for "/obpv1/user/public-access")
             {:handler (fn [data]
@@ -202,10 +219,11 @@
                      :error nil
                      :ajax-message nil
                      :all-selected false
-                     :ok-badges []})]
+                     :ok-badges []
+                     :display "none"})]
     (init-data state)
     (fn []
-      (cond
+      (cond
         (= "initial" (:permission @state)) (layout/default site-navi [:div ])
         (= "success" (:permission @state))(layout/default site-navi (content state))
         :else(layout/default site-navi (err/error-content))))))


code cleanup

code cleanup

I needed to do some code cleanup so that I could list the realtime
clients from the server correctly

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -632,6 +632,7 @@

         existing-query     (get @cached-queries   query)

+        query-time         (quot (System/currentTimeMillis) 1000)
         ]
     (do
       (println (str "    " ))
@@ -644,15 +645,15 @@

       (let [the-query        (get @cached-queries   query)
-            ;clients         @(:clients @existing-query)
+            clients-atom     (:clients @the-query)
             ]
         (swap! the-query assoc  :records       result-id-vector)
         (swap! the-query assoc  :count         record-count)
-        (swap! the-query assoc  :timestamp    (quot (System/currentTimeMillis) 1000))
-
-
-        ;(println (str "    clients: " clients))
-        (comment do (for [client clients]
+        (swap! the-query assoc  :timestamp     query-time)
+
+
+        (println (str "    clients: " @clients-atom))
+        (doall (for [client @clients-atom]
               (println (str "    Client: " client))
               ))

@@ -769,11 +770,18 @@

+; ----------------------------------------------------------------
+;
+; ----------------------------------------------------------------
 (defn create-client-cache [client-realtime-id]
   (let [client-cache     (get @realtime-clients  client-realtime-id)
         ]
     (if (nil? client-cache)
       (swap! realtime-clients assoc client-realtime-id (atom {:queries (atom {})    :records (atom {})    :update-request (atom {})})))))
+
+
+
+

@@ -1011,13 +1019,6 @@
     ;(println (str "      " (keys @realtime-clients)))
     (println (str "      " client-data-atom))
     (println (str "      response: " (if response-atom  @response-atom  [])))
-     (if response-atom  @response-atom  [])
-    )
-
-    )
-
-
-(+ 1 1 )
-
-
-@realtime-clients
+     (if response-atom  @response-atom  [])))
+
+


var map pt1

var map pt1

--- src/latte_compiler/static_analysis.clj
+++ src/latte_compiler/static_analysis.clj
@@ -176,8 +176,32 @@
                           :noextclssdef (makeclassdef glob-state clssexpr false)
                           :extclssdef (makeclassdef glob-state clssexpr true))))

+(defn add-arg
+  [vmap arg]
+  (match/match arg [_ type [_ ident]]
+               (add-var vmap ident type)
+               )
+  )
+
+(defn add-args
+  [vmap args]
+  (loop
+    [vmap vmap
+     args args]
+    (if (nil? args)
+      vmap
+      (recur (add-arg vmap (first args)) (rest args))))
+  )
+
 (defn analyze-fun
   [glob-state funexpr]
+  (match/match funexpr [_ [type] _ args block]
+               (let
+                 [vars (add-args (vars-map) (rest args))]
+
+                 )
+
+               )
   (util/succ glob-state)
   )


Clarifies not-looking-for-ffers log (#1938)

--- scheduler/src/cook/kubernetes/compute_cluster.clj
+++ scheduler/src/cook/kubernetes/compute_cluster.clj
@@ -413,7 +413,7 @@
         (let [node-name->node (get @pool->node-name->node pool-name)]
           (if-not (or (cc/autoscaling? this pool-name) node-name->node)
             (log/info "In" name "compute cluster, not looking for offers for pool" pool-name
-                      ". Skipping pool because it is not a known Kubernetes pool.")
+                      "; it doesn't autoscale for, and has 0 nodes tainted for" pool-name)
             (do
               (log/info "In" name "compute cluster, looking for offers for pool" pool-name)
               (let [timer (timers/start (metrics/timer "cc-pending-offers-compute" name))


change table name of cache table

change table name of cache table

--- server-cached/src/patavi/server/server_cached.clj
+++ server-cached/src/patavi/server/server_cached.clj
@@ -23,7 +23,7 @@

 (defn cache-result [id result]
   (if (not (:error result))
-    (jdbc/update! db-url :patavi_tasks {:result (json/generate-string result)} ["id = ?" id]))
+    (jdbc/update! db-url :pataviTask {:result (json/generate-string result)} ["id = ?" id]))
   result)

 (defn handle-service-with-cache [request data]
@@ -38,8 +38,10 @@
                               :on-subscribe {handlers/service-status-uri true}
                               :on-publish {handlers/service-status-uri true}}))))

+(defn println* [x] (println x) x)
+
 (defn handle-with-cache [id req]
-  (let [call (jdbc/query db-url ["select id, method, problem, result from patavi_tasks where id = ?" (Integer. id)])]
+  (let [call (jdbc/query db-url ["select id, method, problem, result from pataviTask where id = ?" (Integer. id)])]
     (if (empty? call)
         { :status 404 :body "No such task" }
         (handle-service-with-cache req (first call)))))


lein build doesn't need to use protobufs any more.

--- leiningen/build.clj
+++ leiningen/build.clj
@@ -3,5 +3,4 @@
 (defn build [project & args]
   "Build everything! Yay!"
   (leiningen.compile/compile project)
-  (leiningen.protobuf/compile project)
   (leiningen.javac/javac project))


Fix :max aggregations for Druid :lightning:

--- src/metabase/driver/druid/query_processor.clj
+++ src/metabase/driver/druid/query_processor.clj
@@ -112,11 +112,11 @@

 (defn- ag:doubleMax [field]
   (case (dimension-or-metric? field)
-    :metric    {:type      :doubleMin
-                :name      :min
+    :metric    {:type      :doubleMax
+                :name      :max
                 :fieldName (->rvalue field)}
     :dimension {:type        :javascript
-                :name        :min
+                :name        :max
                 :fieldNames  [(->rvalue field)]
                 :fnReset     "function() { return Number.MIN_VALUE ; }"
                 :fnAggregate "function(current, x) { return Math.max(current, (parseFloat(x) || Number.MIN_VALUE)); }"


test fix

test fix

--- src/metabase/driver/mongo/query_processor.clj
+++ src/metabase/driver/mongo/query_processor.clj
@@ -162,7 +162,7 @@
                                   (constantly true))
                  field-id     (or (:field-id field)             ; Field
                                   (:field-id (:field field)))]  ; DateTimeField
-             (->> (i/field-values-lazy-seq @(ns-resolve 'metabase.driver.mongo 'driver) (sel :one field/Field :id field)) ; resolve driver at runtime to avoid circular deps
+             (->> (i/field-values-lazy-seq @(ns-resolve 'metabase.driver.mongo 'driver) (sel :one field/Field :id field-id)) ; resolve driver at runtime to avoid circular deps
                   (filter identity)
                   (map hash)
                   (map #(conj! values %))


Add comment explaining alias

Add comment explaining alias

--- src/puppetlabs/trapperkeeper/utils.clj
+++ src/puppetlabs/trapperkeeper/utils.clj
@@ -1,7 +1,10 @@
-(ns puppetlabs.trapperkeeper.utils
-  (:require [plumbing.map :refer [map-leaves-and-path]]))
+(ns puppetlabs.trapperkeeper.utils)

-(def walk-leaves-and-path map-leaves-and-path)
+(def ^{:doc "Alias for plumbing.map/map-leaves-and-path, which is named inconsistently
+            with Clojure conventions as it doesn't behave like other `map` functions.
+            Map functions typically return a `seq`, never a map, and walk functions
+            are used to modify a collection in-place without altering the structure."}
+  walk-leaves-and-path plumbing.map/map-leaves-and-path)

 (defn service-graph?
   "Predicate that tests whether or not the argument is a valid trapperkeeper


Changed to popups for installing and uninstalling extensions

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/extensions/registry.cljs
+++ src/status_im/extensions/registry.cljs
@@ -56,10 +56,9 @@
                         :active? true}
         new-extensions (assoc (:extensions account) (:url extension) extension)]
     (fx/merge cofx
-              {:ui/show-confirmation {:title     (i18n/label :t/success)
-                                      :content   (i18n/label :t/extension-installed)
-                                      :on-accept #(re-frame/dispatch [:navigate-to-clean :my-profile])
-                                      :on-cancel nil}}
+              {:utils/show-popup {:title     (i18n/label :t/success)
+                                  :content   (i18n/label :t/extension-installed)
+                                  :on-dismiss #(re-frame/dispatch [:navigate-to-clean :my-profile])}}
               (accounts.update/account-update {:extensions new-extensions} {})
               (add-to-registry (:value url) extension-data true))))

@@ -68,10 +67,8 @@
   (let [{:account/keys [account]} db
         new-extensions (dissoc (:extensions account) extension-key)]
     (fx/merge cofx
-              {:ui/show-confirmation {:title     (i18n/label :t/success)
-                                      :content   (i18n/label :t/extension-uninstalled)
-                                      :on-accept nil
-                                      :on-cancel nil}}
+              {:utils/show-popup {:title     (i18n/label :t/success)
+                                  :content   (i18n/label :t/extension-uninstalled)}}
               (remove-from-registry extension-key)
               (accounts.update/account-update {:extensions new-extensions} {}))))


testing env searching

testing env searching

--- test/celestial/integration/es/systems.clj
+++ test/celestial/integration/es/systems.clj
@@ -47,5 +47,9 @@
       (total (sys/systems-for "ronen" {:bool {:must {:term {:machine.cpus "4" }}}} 0 5)) => 1)

    (fact "find ec2 systems for su user" :integration :elasticsearch
-      (total (sys/systems-for "admin" {:bool {:must {:wildcard {:aws.endpoint "*"}}}} 0 5)) => 1)))
+      (total (sys/systems-for "admin" {:bool {:must {:wildcard {:aws.endpoint "*"}}}} 0 5)) => 1)

+   (fact "find dev systems" :integration :elasticsearch
+      (total (sys/systems-for "admin"
+         {:bool {:should [{:term {:env "dev"}}]}} 0 5)) => 3)))
+


counting

counting

--- test/celestial/integration/networking.clj
+++ test/celestial/integration/networking.clj
@@ -1,15 +1,25 @@
 (ns celestial.integration.networking
   (:use midje.sweet)
   (:require
-    [celestial.redis :refer [clear-all]]
     [celestial.fixtures :refer [with-conf]]
-    [hypervisors.networking :as n :refer (initialize-range long-to-ip list-used-ips)])
+    [hypervisors.networking :as n :refer (initialize-range long-to-ip list-used-ips clear-range)])
  )

-(with-state-changes [(before :facts (clear-all))]
-  (fact "used up ips marking" :integration :redis :ip
-    (with-conf
-       (n/gen-ip {} :proxmox :ip_address)  => {:ip_address "192.168.5.100"}
-       (n/list-used-ips :proxmox) => ["192.168.5.100" "192.168.5.170" "192.168.5.171" "192.168.5.173"]
-       (n/release-ip "192.168.5.100" :proxmox)
-       (n/list-used-ips :proxmox) => ["192.168.5.170" "192.168.5.171" "192.168.5.173"])))
+(with-conf
+  (with-state-changes [(before :facts (clear-range :proxmox))]
+    (fact "used up ips marking" :integration :redis :ip
+      (n/gen-ip {} :proxmox :ip_address)  => {:ip_address "192.168.5.100"}
+      (count (n/list-free-ips :proxmox)) => 152
+      (n/list-used-ips :proxmox) => ["192.168.5.100" "192.168.5.170" "192.168.5.171" "192.168.5.173"]
+      (n/release-ip "192.168.5.100" :proxmox)
+      (n/list-used-ips :proxmox) => ["192.168.5.170" "192.168.5.171" "192.168.5.173"]
+      (count (n/list-free-ips :proxmox)) => 153)
+
+    (fact "multiple ips" :integration :redis :ip
+      (dotimes [_ 5] (n/gen-ip {} :proxmox :ip_address))
+      (count (n/list-free-ips :proxmox)) => 147
+      (dotimes [i 5] (n/release-ip (str  "192.168.5.10" i) :proxmox))
+      (count (n/list-free-ips :proxmox)) => 153)
+    ))
+
+


Finish testing the get-db-config stuff.

Finish testing the get-db-config stuff.

--- test/circle/backend/build/test_config.clj
+++ test/circle/backend/build/test_config.clj
@@ -39,6 +39,36 @@
 (fact "template/find works with strings"
   (circle.backend.build.template/find "build") => truthy)

+;; Test inferred-config
+(fact "get-db-config returns falsy for empty project"
+  (let [project (test/test-project)
+        repo (test/test-repo "empty-project")
+        inferred-config (infer-config repo)
+        db-config (get-db-config project inferred-config)]
+    db-config => nil))
+
+
+;; Test get-db-config
+(fact "get-db-config returns falsy for empty project"
+  (let [project (test/test-project)
+        repo (test/test-repo "empty-project")
+        inferred-config (infer-config repo)
+        db-config (get-db-config project inferred-config)]
+    db-config => nil))
+
+
+(fact "get-db-config has inferred and speced steps project"
+  (let [project (test/test-project)
+        project (merge project {:test "echo a\necho b"})
+        repo (test/test-repo "database_yml_1")
+        inferred-config (infer-config repo)
+        db-config (get-db-config project inferred-config)]
+    db-config =not=> nil
+    (-> db-config :actions) => (contains [(contains {:source :inferred :name "copy database.yml" :type :setup})
+                                          (contains {:source :spec :command "echo a" :type :test})]
+                                         :gaps-ok)))
+
+;;; Test build-from-url
 (fact "build-from-url works"
   (let [project (test/test-project)
         vcs_revision "78f58846a049bb6772dcb298163b52c4657c7d45"
@@ -85,15 +115,11 @@

-
-
 (fact "build-from-url builds from database"
   (let [project (test/partially-inferred-project)
         b (build-from-url (-> project :vcs_url))]
     (-> @b :actions) =contains=> {:name "echo a" :type :test :source :spec}
     (-> @b :actions) =not=> (contains {:type :setup :source :inferred})))
-
-

 (fact "build-from-json works"
   (let [build (build-from-json test/circle-dummy-project-json)]


Fix always-true tests spotted by eastwood

--- test/hbase_region_inspector/util_test.clj
+++ test/hbase_region_inspector/util_test.clj
@@ -3,8 +3,8 @@
             [hbase-region-inspector.util :refer :all]))

 (deftest test-compare-server-names
-  (is (> (compare-server-names "foobar10" "foobar2")))
-  (is (< (compare-server-names "foo-1-bar02" "foo-1-bar010"))))
+  (is (> (compare-server-names "foobar10" "foobar2") 0))
+  (is (< (compare-server-names "foo-1-bar02" "foo-1-bar010") 0)))

 (deftest test-rand-range
   (let [min   10


delete comment lines

delete comment lines

--- src/html.clj
+++ src/html.clj
@@ -54,13 +54,8 @@
         [:p %])
      xs)])

-;(defn code [s]
-;  [:code {:class "prettyprint"} s])
-
 (defmacro code [s]
-  [:code {:class "prettyprint"} (str s)]
-  )
-
+  [:code {:class "prettyprint"} (str s)])

 (defn table
   ([bodies] (table nil bodies))


Remove end whitespaces.

Remove end whitespaces.

--- test/octet/tests/core.cljx
+++ test/octet/tests/core.cljx
@@ -281,6 +281,3 @@
     (t/is (= (buf/read buffers spec) [20 30]))
     (t/is (= (buf/read (nth buffers 0) buf/short) 20))
     (t/is (= (buf/read (nth buffers 1) buf/int32) 30))))
-
-
-


add env-placeholder-reader test

add env-placeholder-reader test

--- test/com/wsscode/pathom/core_test.cljc
+++ test/com/wsscode/pathom/core_test.cljc
@@ -315,14 +315,25 @@
   (is (= (p/entity-dispatch {:ast {:key [:user/by-id 10]}})
          :user/by-id)))

+(deftest test-env-placeholder-node
+  (is (= (parser {::p/placeholder-prefixes #{">" "ph"}
+                  ::p/reader [{:a (constantly 42)} p/env-placeholder-reader]}
+           [:a {:>/sub [:a]}])
+         {:a 42 :>/sub {:a 42}}))
+
+  (is (= (parser {::p/placeholder-prefixes #{">" "ph"}
+                  ::p/reader [{:a (constantly 42)} p/env-placeholder-reader]}
+           [:a {:ph/sub [:a]} {:>/sub [:a]}])
+         {:a 42 :ph/sub {:a 42} :>/sub {:a 42}})))
+
 (deftest test-placeholder-node
   (is (= (parser {::p/reader [{:a (constantly 42)} (p/placeholder-reader)]}
            [:a {:>/sub [:a]}])
-         {:a 42 :>/sub {:a 42}}))
+        {:a 42 :>/sub {:a 42}}))

   (is (= (parser {::p/reader [{:a (constantly 42)} (p/placeholder-reader "ph")]}
            [:a {:ph/sub [:a]}])
-         {:a 42 :ph/sub {:a 42}})))
+        {:a 42 :ph/sub {:a 42}})))

 (deftest test-map-reader
   (are [entity query res] (is (= (parser {::p/reader p/map-reader