add log4j lib dep

add log4j lib dep

--- build.boot
+++ build.boot
@@ -63,6 +63,7 @@

                    [potemkin "0.4.5"]
                    [org.clojure/tools.logging "0.4.1"]
+                   [org.apache.logging.log4j/log4j-api "2.11.1"]
                    [org.apache.logging.log4j/log4j-core "2.11.1"]
                    [org.apache.logging.log4j/log4j-slf4j-impl "2.11.1"]
                    ;; [org.apache.logging.log4j/log4j-api "2.5"]


Bump up version

Bump up version

--- build.boot
+++ build.boot
@@ -5,7 +5,7 @@
                   [boot/core           "2.5.5"     :scope "provided"]
                   [http-kit            "2.1.19"    :scope "test"]])

-(def +version+ "0.4.6")
+(def +version+ "0.4.7-SNAPSHOT")

 (task-options!
   pom {:project     'adzerk/boot-reload


Remove controller ns from namespace list

--- build.boot
+++ build.boot
@@ -12,7 +12,6 @@
   pom {:project 'nightcode
        :version "2.0.0-SNAPSHOT"}
   aot {:namespace '#{net.sekao.nightcode.core
-                     net.sekao.nightcode.controller
                      net.sekao.nightcode.lein}}
   jar {:main 'net.sekao.nightcode.core
        :manifest {"Description" "An IDE for Clojure and ClojureScript"


Benchmark.

Benchmark.

--- shootout/pandect.clj
+++ shootout/pandect.clj
@@ -10,4 +10,4 @@
   "--sha384"  [pandect.core/sha384  pandect.core/sha384-file]
   "--sha512"  [pandect.core/sha512  pandect.core/sha512-file]
   "--adler32" [pandect.core/adler32 pandect.core/adler32-file]
-  "--crc32"   [pandect.core/crc32   pandect.core/crc32*-file])
+  "--crc32"   [pandect.core/crc32   pandect.core/crc32-file])


Bugfix, could not connect audio nodes to params

--- src/alder/node-graph.cljs
+++ src/alder/node-graph.cljs
@@ -64,9 +64,9 @@
     (when-not (= (:type output-data) :null-node)
       (debug "Connection indices" output-index input-index)
       (case (:type input-data)
-        :param (f from-audio-node (aget to-audio-node input-name) output-index input-index)
-        :node (f from-audio-node to-audio-node output-index input-index)
-        :gate (f from-audio-node to-audio-node output-index)
+        :param (f from-audio-node [(aget to-audio-node input-name) output-index])
+        :node (f from-audio-node [to-audio-node output-index input-index])
+        :gate f from-audio-node [to-audio-node output-index]
         :null-node nil))))

 (s/defn connect-nodes :- NodeGraph
@@ -78,7 +78,7 @@
     (if (node/can-connect [from-node from-slot-id] [to-node to-slot-id])
       (do
         (debug "connect nodes" from to)
-        (set-connection node-graph from to #(.call (aget %1 "connect") %1 %2 %3 %4))
+        (set-connection node-graph from to #(.apply (aget %1 "connect") %1 (clj->js %2)))
         (update-in node-graph [:connections]
                    (fn [conns] (conj conns [from to]))))
       node-graph)))
@@ -86,7 +86,7 @@
 (s/defn disconnect-nodes :- NodeGraph
   [node-graph :- NodeGraph from :- SlotRef to :- SlotRef]
   (debug "disconnect nodes" from to)
-  (set-connection node-graph from to #(.call (aget %1 "disconnect") %1 %2 %3 %4))
+  (set-connection node-graph from to #(.apply (aget %1 "disconnect") %1 (clj->js %2)))
   (update-in node-graph [:connections]
              (fn [conns] (vec (remove #(= % [from to]) conns)))))


Fix: share images bug that freezes app

Fix: share images bug that freezes app

Signed-off-by: jo-mut <d4a6f406e82d8862547aead32e429239e01a7132@gmail.com>

--- src/status_im/ui/screens/chat/message/reactions.cljs
+++ src/status_im/ui/screens/chat/message/reactions.cljs
@@ -55,8 +55,7 @@
                               (fn []
                                 (reset! actions nil)
                                 (reset! visible false)
-                                (picker-on-close))
-                              reaction-picker/animation-duration))
+                                (picker-on-close))))
             on-open        (fn [pos]
                              (picker-on-open)
                              (reset! position pos)


Correctly qualify boot names

Correctly qualify boot names

--- src/radicalzephyr/boot_junit.clj
+++ src/radicalzephyr/boot_junit.clj
@@ -6,10 +6,10 @@
 (defn destructure-results [result]
   {})

-(deftask junit
+(core/deftask junit
   "Run the jUnit test runner."
   [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
-  (with-pre-wrap fileset
+  (core/with-pre-wrap fileset
     (let [result (JUnitCore/runClasses
                   (into-array Class
                               [#_ (magic goes here to find all test classes)]))]


Add a packages set parameter to the task

I'm going to follow the lead of adzerk's clojure.test runner and require
the user to specify where to run tests from. The nice thing here is that
they can just specify their base package and then we'll do reflection to
find all of the tests.

--- src/radicalzephyr/boot_junit.clj
+++ src/radicalzephyr/boot_junit.clj
@@ -5,7 +5,7 @@

 (deftask junit
   "Run the jUnit test runner."
-  []
+  [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
   (with-pre-wrap fileset
     (let [result (JUnitCore/runClasses
                   (into-array [#_ (magic goes here to find all test classes)]))]


invoke inducer with latency capture

invoke inducer with latency capture

--- src/bract/core/config.clj
+++ src/bract/core/config.clj
@@ -47,11 +47,11 @@
   ([context inducer-name]
     (apply-inducer-by-name "inducer" (key cfg-inducer-names) context inducer-name))
   ([inducer-type config-key context inducer-name]
-    (echo/echo (format "Looking up %s '%s'" inducer-type inducer-name))
+    (echo/echo (format "Looking up %s `%s`" inducer-type inducer-name))
     (let [f (kputil/str->var->deref config-key inducer-name)]
-      (echo/echo (format "Executing  %s '%s'" inducer-type inducer-name))
-      (echo/with-inducer-name inducer-name
-        (f context)))))
+      (echo/with-latency-capture (format "Executing  %s `%s`" inducer-type inducer-name)
+        (echo/with-inducer-name inducer-name
+          (f context))))))

 (defn run-app


fix project name

fix project name

--- build.boot
+++ build.boot
@@ -1,4 +1,4 @@
-(def +project+ 'miraj/gae-simple)
+(def +project+ 'migae/gae-hello-boot)
 (def +version+ "0.1.0-SNAPSHOT")

 (set-env!


Simplify test runs

Simplify test runs

--- build.boot
+++ build.boot
@@ -12,7 +12,7 @@
                   [adzerk/boot-test         "1.1.2"  :scope "test"]
                   [org.clojure/tools.nrepl  "0.2.12" :scope "test"]])

-(require '[adzerk.boot-test :as boot-test])
+(require '[adzerk.boot-test :as t])

 (task-options!
   pom {:url         (get-env :url)
@@ -32,11 +32,12 @@
   target  {:dir #{"target"}})

 (deftask testing []
+  (set-env! :resource-paths #(conj % "test"))
   (set-env! :source-paths #(conj % "test")))

 (deftask test []
   (testing)
-  (comp (target) (speak) (javac) (boot-test/test)))
+  (t/test))

 (deftask autotest []
   (comp (watch) (test)))


Remove test scoping on dependencies

Remove test scoping on dependencies

They're not actually test scope on the boot task since that should
boot-junit should itself be test scoped.

--- build.boot
+++ build.boot
@@ -3,10 +3,10 @@
  :resource-paths #{"src"}
  :dependencies '[[org.clojure/clojure         "1.6.0"  :scope "provided"]
                  [boot/core                   "2.1.0"  :scope "provided"]
-                 [junit                       "4.12"   :scope "test"]
-                 [org.reflections/reflections "0.9.10" :scope "test"]
-                 [org.glassfish/javax.servlet "3.0"    :scope "test"]
-                 [radicalzephyr/clansi        "1.2.0"  :scope "test"]])
+                 [junit                       "4.12"  ]
+                 [org.reflections/reflections "0.9.10"]
+                 [org.glassfish/javax.servlet "3.0"   ]
+                 [radicalzephyr/clansi        "1.2.0" ]])

 (require '[radicalzephyr.boot-junit :refer [junit]])


Upgrade dependencies

Upgrade dependencies

--- build.boot
+++ build.boot
@@ -2,23 +2,23 @@
  :resource-paths #{"resources"}
  :source-paths #{"src/clj" "src/cljs"}
  :dependencies '[[adzerk/boot-cljs "1.7.228-1"]
-                 [adzerk/boot-reload "0.4.5"]
+                 [adzerk/boot-reload "0.4.11"]
                  [pandeiro/boot-http "0.7.3"]
                  [org.martinklepsch/boot-garden "1.3.0-0"]
-                 [ring "1.4.0"]
+                 [ring "1.5.0"]
                  [amalloy/ring-gzip-middleware "0.1.3"]
-                 [compojure "1.4.0"]
+                 [compojure "1.5.1"]
                  [hiccup "1.0.5"]
                  [clj-rss "0.2.3"]
-                 [clj-time "0.11.0"]
+                 [clj-time "0.12.0"]
                  [java-jdbc/dsl "0.1.3"]
-                 [buddy/buddy-auth "0.9.0"]
+                 [buddy/buddy-auth "1.1.0"]
                  [org.postgresql/postgresql "9.4.1208"]
                  [org.omcljs/om "1.0.0-alpha28"]
-                 [org.clojure/clojure "1.8.0"]
-                 [org.clojure/clojurescript "1.7.228"]
-                 [org.clojure/core.async "0.2.371"]
-                 [org.clojure/java.jdbc "0.4.2"]
+                 [org.clojure/clojure "1.9.0-alpha9"]
+                 [org.clojure/clojurescript "1.9.89"]
+                 [org.clojure/core.async "0.2.385"]
+                 [org.clojure/java.jdbc "0.6.2-alpha1"]
                  [org.clojure/math.numeric-tower "0.0.4"]])

 (require


Add :static-fns in dev for Safari, closes #183

--- build.boot
+++ build.boot
@@ -69,6 +69,7 @@
   {:source-map-timestamp true
    :elide-asserts true
    :closure-defines {"clairvoyant.core.devmode" true}
+   :static-fns true
    :foreign-libs foreign-libs})

 (def prod-compiler-options


minor adjustment on parameter

minor adjustment on parameter


Increment dependency versions (mostly clojure)

Up to 1.9-RC2

--- build.boot
+++ build.boot
@@ -3,13 +3,23 @@

 (set-env! :resource-paths #{"src/clojure"}
           :dependencies '[[adzerk/boot-test "RELEASE" :scope "test"]
+                          ;; This uses a version of netty that's about 6 months
+                          ;; old.
+                          ;; That might not be a huge deal...but there have been
+                          ;; 6 bug fix releases since then.
+                          ;; TODO: Switch to newer version and see how it works.
+                          ;; (The current version includes an exception that has
+                          ;; started showing up when I allocate an uninitialized
+                          ;; unpooled buffer. I don't know why I haven't seen
+                          ;; this before. According to the github issue, it's
+                          ;; harmless).
                           [aleph "0.4.4" :exclusions [org.clojure/tools.logging]]
                           ;; TODO: Eliminate these logging dependencies.
                           ;; I have no business imposing them on library
                           ;; users
-                          [org.apache.logging.log4j/log4j-core "2.9.1" :scope "test"]
-                          [org.apache.logging.log4j/log4j-1.2-api "2.9.1" :scope "test"]
-                          [org.clojure/clojure "1.9.0-RC1"]
+                          [org.apache.logging.log4j/log4j-core "2.10.0" :scope "test"]
+                          [org.apache.logging.log4j/log4j-1.2-api "2.10.0" :scope "test"]
+                          [org.clojure/clojure "1.9.0-RC2"]
                           [org.clojure/spec.alpha "0.1.143"]
                           [org.clojure/test.check "0.10.0-alpha2" :scope "test" :exclusions [org.clojure/clojure]]
                           ;; TODO: Eliminate this dependency. It's another one
@@ -68,7 +78,13 @@

 (deftask testing
   []
-  (merge-env! :dependencies '[[gloss "0.2.6" :scope "test"]]
+  (merge-env! :dependencies '[[gloss "0.2.6"
+                               :scope "test"
+                               :exclusions [byte-streams
+                                            io.aleph/dirigiste
+                                            manifold
+                                            org.clojure/tools.logging
+                                            riddley]]]
               :source-paths #{"test"})
   identity)


Fix middleware and it's dependencies for nrepl

--- build.boot
+++ build.boot
@@ -50,18 +50,17 @@
 (deftask server
   "Develop the server backend"
   []
-  (let [p (pod/make-pod {:dependencies server-deps
-                         :directories #{"src" "resources" "dev"}})]
+  (let [p (pod/make-pod {:dependencies (concat server-deps @@(resolve 'boot.repl/*default-dependencies*))
+                         :directories #{"src" "resources" "dev"}
+                         :middleware @@(resolve 'boot.repl/*default-middleware*)})]

     (pod/with-eval-in p
-      (require 'boot.repl)
       (require '[boot.pod :as pod])
       (require '[clojure.tools.namespace.repl :as repl])
       (apply repl/set-refresh-dirs (-> pod/env :directories))

       (boot.repl/launch-nrepl {:init-ns 'user :port 5700 :server true
-                               :default-middleware @@(resolve 'boot.repl/*default-middleware*)
-                               :default-dependencies @@(resolve 'boot.repl/*default-dependencies*)}))))
+                               :middleware (:middleware pod/env)}))))

 (deftask frontend
   "Simple alias to run frontend application"


Allow deploying as a library

Allow deploying as a library

--- build.boot
+++ build.boot
@@ -14,7 +14,11 @@
                   [ring "1.6.1"]
                   [play-cljs/lein-template "0.10.1-5"]
                   [eval-soup "1.2.3" :exclusions [org.clojure/core.async]]
-                  [org.eclipse.jgit/org.eclipse.jgit "4.6.0.201612231935-r"]])
+                  [org.eclipse.jgit/org.eclipse.jgit "4.6.0.201612231935-r"]]
+  :repositories (conj (get-env :repositories)
+                  ["clojars" {:url "https://clojars.org/repo/"
+                              :username (System/getenv "CLOJARS_USER")
+                              :password (System/getenv "CLOJARS_PASS")}]))

 (require
   '[adzerk.boot-cljs :refer [cljs]]
@@ -59,3 +63,11 @@
       (.renameTo (io/file "target/public/paren-soup.js") (io/file "resources/public/paren-soup.js"))
       (.renameTo (io/file "target/public/codemirror.js") (io/file "resources/public/codemirror.js")))))

+(deftask local []
+  (set-env! :resource-paths #{"src/clj" "src/cljs"})
+  (comp (pom) (jar) (install)))
+
+(deftask deploy []
+  (set-env! :resource-paths #{"src/clj" "src/cljs"})
+  (comp (pom) (jar) (push)))
+


Add a task for running all tests

Add a task for running all tests

--- build.boot
+++ build.boot
@@ -34,10 +34,17 @@
   (ns-unmap 'boot.user 'test))

 (deftask test
-  "Compile and run my jUnit tests."
+  "Compile and run my jUnit unit tests."
   []
   (comp (javac)
         (junit)))
+
+(deftask test-all
+  "Compile and run all jUnit tests."
+  []
+  (comp (javac)
+        (junit :classes #{"UnitTests"
+                          "IntegrationTests"})))

 (deftask build
   "Build my http server."


update boot script

update boot script

--- build.boot
+++ build.boot
@@ -57,9 +57,8 @@
    [f b f o b o]])

 (defn arena-2
-  [player player2]
+  [player]
   (let [w (gu/sanitize-player player)
-        w2 (gu/sanitize-player player2)
         a1 (assoc a :uuid "a1")
         a2 (assoc a :uuid "a2")
         a3 (assoc a :uuid "a3")]
@@ -67,9 +66,9 @@
      [b a1 o o a2 o o o o o o o o o o b]
      [b o o p o f o o f o o p o o o b]
      [b f o o o o o o f o p o o o o b]
-     [b f o o o o o o o w2 o o o o o b]
+     [b f o o o o o o o o o o o o o b]
      [b p o o o o o o f o o f o o o b]
-     [b b b b o f o o o o o o o o o b]
+     [b b b b o f o o w o o o o o o b]
      [b o o o p o o b o o o o f b o b]
      [b f o o o o f o o f o o o b o b]
      [b f o o o o f o o f o b b b o b]
@@ -77,7 +76,7 @@
      [b o o o o o f o o o f o f a3 o b]
      [b f o o o o o o o o o o o o o b]
      [b f o o o o f o o o o f o o o b]
-     [b w o o o o p o o o o o o o o b]
+     [b o o o o o p o o o o o o o o b]
      [b b b b b b b b b b b b b b b b]]))

 (deftask sim
@@ -118,16 +117,15 @@
   (let [{:keys [code ratelimit-message]} (get-bot-code-simulator username repo token)
         arena-number (min 2 (or arena 1))
         player {:_id "1"
+                :uuid "1"
                 :type "player"
                 :login username
                 :hp (or hp 100)
                 :bot code
                 :saved-state {}
                 :frames []}
-        player2 (assoc player :_id "2")
-
-        initial-game-state {:clean-arena ((ns-resolve *ns* (symbol (str "arena-" arena-number))) player player2)
-                            :players [player player2]}
+        initial-game-state {:clean-arena ((ns-resolve *ns* (symbol (str "arena-" arena-number))) player)
+                            :players [player]}
         initial-frame-count (min 100 (or frames 1))
         sleep-time (or sleep 2000)]
     (println "Running Simulation...")


Update re-console to 0.1.3

Update re-console to 0.1.3

--- build.boot
+++ build.boot
@@ -22,7 +22,7 @@
                  [re-frame                    "0.5.0"]
                  [replumb/replumb             "0.2.2-SNAPSHOT"]
                  [cljsjs/highlight            "8.4-0"]
-                 [re-console                  "0.1.3-SNAPSHOT"]
+                 [re-console                  "0.1.3"]
                  [re-com                      "0.7.0-alpha2"]
                  [cljs-ajax                   "0.5.1"]
                  [hickory                     "0.5.4"]


Update play-cljs template

Update play-cljs template

--- build.boot
+++ build.boot
@@ -14,7 +14,7 @@
                   [leiningen "2.8.1" :exclusions [leiningen.search]]
                   [ring "1.6.1"]
                   [hawk "0.2.11"]
-                  [play-cljs/lein-template "0.11.0.2"]
+                  [play-cljs/lein-template "0.11.1"]
                   [eval-soup "1.2.3" :exclusions [org.clojure/core.async]]
                   [org.eclipse.jgit/org.eclipse.jgit "4.6.0.201612231935-r"]]
   :repositories (conj (get-env :repositories)


Bump version

Bump version

--- build.boot
+++ build.boot
@@ -7,7 +7,7 @@

 (require '[adzerk.boot-test :refer [test]])

-(def +version+ "0.4.12")
+(def +version+ "0.4.13-SNAPSHOT")

 (task-options!
   pom {:project     'adzerk/boot-reload


STORM-1629 Files/move doesn't work properly with non-empty directory in Windows

* Use FileUtils/moveDirectory on Windows
  * It copies whole contents inside directory, and delete directory
* Keep using Files/move on non-Windows
  * it's still better option since doesn't require copying contents inside directory

--- storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
+++ storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
@@ -1060,9 +1060,13 @@
     (if (download-blobs-for-topology-succeed? (ConfigUtils/supervisorStormConfPath tmproot) tmproot)
       (do
         (log-message "Successfully downloaded blob resources for storm-id " storm-id)
-        (FileUtils/forceMkdir (File. stormroot))
-        (Files/move (.toPath (File. tmproot)) (.toPath (File. stormroot))
-          (doto (make-array StandardCopyOption 1) (aset 0 StandardCopyOption/ATOMIC_MOVE)))
+        (if (Utils/isOnWindows)
+          ; Files/move with non-empty directory doesn't work well on Windows
+          (FileUtils/moveDirectory (File. tmproot) (File. stormroot))
+          (do
+            (FileUtils/forceMkdir (File. stormroot))
+            (Files/move (.toPath (File. tmproot)) (.toPath (File. stormroot))
+                        (doto (make-array StandardCopyOption 1) (aset 0 StandardCopyOption/ATOMIC_MOVE)))))
         (setup-storm-code-dir conf (clojurify-structure (ConfigUtils/readSupervisorStormConf conf storm-id)) stormroot))
       (do
         (log-message "Failed to download blob resources for storm-id " storm-id)


update deps

update deps

--- build.boot
+++ build.boot
@@ -1,14 +1,14 @@
 (set-env!
   :source-paths #{"test"}
   :resource-paths #{"src" "resources"}
-  :dependencies '[[boot/core "2.3.0" :scope "provided"]
-                  [adzerk/bootlaces "0.1.12" :scope "test"]
+  :dependencies '[[boot/core "2.4.2" :scope "provided"]
+                  [adzerk/bootlaces "0.1.13" :scope "test"]
                   [org.pegdown/pegdown "1.6.0" :scope "test"]
-                  [circleci/clj-yaml "0.5.3" :scope "test"]
+                  [circleci/clj-yaml "0.5.4" :scope "test"]
                   [time-to-read "0.1.0" :scope "test"]
                   [sitemap "0.2.4" :scope "test"]
                   [clj-rss "0.2.3" :scope "test"]
-                  [gravatar "0.1.0" :scope "test"]
+                  [gravatar "1.1.1" :scope "test"]
                   [clj-time "0.11.0"]])

 (require '[adzerk.bootlaces :refer :all])


Removed uneeeded lines from build.boot

Removed uneeeded lines from build.boot

These are the old lines needed for jdk7 support

--- build.boot
+++ build.boot
@@ -83,21 +83,6 @@
                (into-array String
                  (str-to-argv/split-args (or ~args ""))))))))

-;; (deftask assert-jdk7-bootclasspath
-;;   "Ensures that the JDK7_BOOTCLASSPATH environment variable is set, as required
-;;    to compile a final jar file that supports Java 1.7+."
-;;   []
-;;   (with-pre-wrap fileset
-;;     (assert (not (empty? (System/getenv "JDK7_BOOTCLASSPATH")))
-;;             (str "Alda requires JDK7 in order to build its uberjar, in order "
-;;                  "to provide out-of-the-box support for users who may have "
-;;                  "older versions of Java. Please install JDK7 and set the "
-;;                  "environment variable JDK7_BOOTCLASSPATH to the path to your "
-;;                  "JDK7 classpath jar, e.g. (OS X example) "
-;;                  "/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/"
-;;                  "Home/jre/lib/rt.jar"))
-;;     fileset))
-
 (deftask package
   "Builds jar file."
   []


boot specs -> boot spec

boot specs -> boot spec

--- build.boot
+++ build.boot
@@ -37,7 +37,7 @@
 (deftask build []
   (comp (aot) (pom) (uber) (jar)))

-(deftask specs []
+(deftask spec []
   (comp
     (aot)
     (with-pre-wrap fileset


bump CLJS and codox

bump CLJS and codox

--- build.boot
+++ build.boot
@@ -3,8 +3,8 @@
 (set-env!
  :source-paths    #{"src/main"}
  :resource-paths  #{"resources"}
- :dependencies '[[org.clojure/clojurescript   "1.9.93"         :scope "provided"]
                  [org.omcljs/om               "1.0.0-alpha41"  :scope "provided"]
+ :dependencies '[[org.clojure/clojurescript   "1.9.216"        :scope "provided"]
                  [com.ladderlife/cellophane   "0.3.5"          :scope "provided"]
                  [com.cognitect/transit-clj   "0.8.288"        :scope "test"]
                  [org.clojure/core.async      "0.2.385"        :scope "test"]
@@ -20,11 +20,11 @@
                  [org.clojure/tools.nrepl     "0.2.12"         :scope "test"]
                  [org.clojure/tools.namespace "0.3.0-alpha3"   :scope "test"]
                  [weasel                      "0.7.0"          :scope "test"]
-                 [boot-codox                  "0.9.5"          :scope "test"]])
+                 [boot-codox                  "0.9.6"          :scope "test"]])

 (require
  '[adzerk.boot-cljs      :refer [cljs]]
- '[adzerk.boot-cljs-repl :as cr :refer [cljs-repl-env start-repl]]
+ '[adzerk.boot-cljs-repl :as cr :refer [cljs-repl start-repl]]
  '[adzerk.boot-reload    :refer [reload]]
  '[adzerk.boot-test :as bt-clj]
  '[adzerk.bootlaces      :refer [bootlaces! push-release]]
@@ -60,7 +60,7 @@
   (comp
     (serve)
     (watch)
-    (cljs-repl-env)
+    (cljs-repl)
     (reload)
     (speak)
     (cljs :source-map true


Start on trying to reformat with Boot

Start on trying to reformat with Boot

--- build.boot
+++ build.boot
@@ -31,13 +31,39 @@
                  [ring/ring-mock "0.3.0" :scope "test"]
                  [midje "1.8.3" :scope "test"]
                  [peridot "0.4.3" :scope "test"]
-                 [com.h2database/h2 "1.3.172"]])
+                 [com.h2database/h2 "1.3.172"]
+                 [cljfmt "0.4.1"]])

 (require '[adzerk.boot-test :refer :all])

 (defn build []
   (javac)
   (aot :namespace '#{schedule.solver.types}))
+
+(require '[cljfmt.core :refer [reformat-string]]
+         '[clojure.java.io :as io])
+
+(defn grep [re dir]
+  (filter #(re-find re (str %)) (file-seq (io/file dir))))
+
+(defn find-files [f]
+  (let [f (io/file f)]
+    (when-not (.exists f) (println "No such file:" (str f)))
+    (if (.isDirectory f)
+      (grep #"\.clj[sx]?$" f)
+      [f])))
+
+(defn reformat-str [s]
+  (cljfmt.core/reformat-string s {}))
+
+(defn fix
+  [files]
+  (doseq [f     (find-files files)
+          :let  [original (slurp f)
+                 revised  (reformat-str original)]
+          :when (not= original revised)]
+    (println "Reformatting" f)
+    (spit f revised)))

 (deftask solver []
   (comp


upgrade to ClojureScript 1.9.521

upgrade to ClojureScript 1.9.521

--- build.boot
+++ build.boot
@@ -2,7 +2,7 @@
  :source-paths #{"src/cljs/snapshot"}
  :asset-paths #{"src/js" "src/cljs/bundled"}
  :dependencies '[[org.clojure/clojure         "1.9.0-alpha15"]
-                 [org.clojure/clojurescript   "1.9.518"]
+                 [org.clojure/clojurescript   "1.9.521"]
                  [org.clojure/tools.reader    "1.0.0-beta4"]
                  [com.cognitect/transit-cljs  "0.8.239"]
                  [malabarba/lazy-map          "1.3"]


Remove dev build because fast-build now handles hot-reloading

--- build.boot
+++ build.boot
@@ -60,17 +60,6 @@
                              'tictactoe-app.db
                              'reagent-native.react
                              'tictactoe-app.subs])))
-(deftask dev []
-  (set-env! :target-path "app/build")
-  (comp (watch)
-     (reload :on-jsload 'tictactoe-android.core/on-js-reload
-             :port 8079
-             :ws-host "matt-dev")
-     (cljs-repl :ws-host "matt-dev"
-                :ip "0.0.0.0")
-     (cljs :source-map true
-           :optimizations :none)
-     ))

 (deftask fast-build []
   (set-env! :target-path "app/build")


Removing another reference to devcards build #16

--- build.boot
+++ build.boot
@@ -148,7 +148,7 @@
 (deftask build-cljs
   "Build ClojureScript for production and staging deployments."
   []
-  (cljs :ids ["js/main" "js/devcards"]
+  (cljs :ids ["js/main"]
         :optimizations :advanced
         :source-map true
         :compiler-options {:parallel-build true}))


Update build.boot

Update build.boot

--- build.boot
+++ build.boot
@@ -12,7 +12,7 @@
                           [boot/new                    "0.5.3"]
                           ;[degree9/covenant            "0.1.0-SNAPSHOT"]
                           ;[degree9/boot-docker         "0.1.0-SNAPSHOT"]
-                          [degree9/boot-nodejs         "1.3.0"]
+                          [degree9/boot-nodejs         "1.4.0"]
                           [degree9/boot-npm            "1.11.0"]
                           ;[degree9/boot-exec           "1.1.0-SNAPSHOT"]
                           [degree9/boot-semver         "1.8.0"]


Automatically apply changes to loaded sketch in development

--- build.boot
+++ build.boot
@@ -49,7 +49,7 @@
    (serve)
    (watch)
    (cljs-repl)
-   (reload)
+   (reload :on-jsload 'chronograph.sketch/reset)
    (cljs :optimizations :none
          :source-map true
          :compiler-options {:preloads '[chronograph.dev]})))


Add more project info stuff over from Lein

--- build.boot
+++ build.boot
@@ -88,7 +88,14 @@
             ))

 (task-options!
- pom {:project 'radicalzephyr/comic-reader})
+ pom {:project 'radicalzephyr/comic-reader
+      :version "0.1.0-SNAPSHOT"
+      :description "An app for reading comics/manga on or offline"
+      :url "https://github.com/radicalzephyr/comic-reader"
+      :scm {:name "git"
+            :url "https://github.com/radicalzephyr/comic-reader"}
+      :license {:name "Eclipse Public License"
+                :url "http://www.eclipse.org/legal/epl-v10.html"}})

 (require
  '[adzerk.boot-test      :refer [test] :rename {test test-clj}]


1. load-resource 한번만 처리하도록 수정

1. load-resource 한번만 처리하도록 수정

--- src/clj/cauca/factory.clj
+++ src/clj/cauca/factory.clj
@@ -25,7 +25,8 @@
   )

 (defn get-obj [key]
-  (load-resource beans-map beans)
+  (if (nil? @beans-map)
+    (load-resource beans-map beans))
   (dosync
     (get @beans-map key)
     )


default-warning-handler* -> error-message

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -46,76 +46,76 @@

 (declare message namespaces)

-(defmulti default-warning-handler* (fn [warning-type & _] warning-type))
-
-(defmethod default-warning-handler* :undeclared-var
+(defmulti error-message (fn [warning-type & _] warning-type))
+
+(defmethod error-message :undeclared-var
   [warning-type extra]
   (str "Use of undeclared Var " (:prefix extra) "/" (:suffix extra)))

-(defmethod default-warning-handler* :undeclared-ns
+(defmethod error-message :undeclared-ns
   [warning-type extra]
   (str "No such namespace: " (:ns-sym extra)))

-(defmethod default-warning-handler* :dynamic
+(defmethod error-message :dynamic
   [warning-type extra]
   (str (:name extra) " not declared ^:dynamic"))

-(defmethod default-warning-handler* :redef
+(defmethod error-message :redef
   [warning-type extra]
   (str (:sym extra) " already refers to: " (symbol (str (:ns extra)) (str (:sym extra)))
     " being replaced by: " (symbol (str (:ns-name extra)) (str (:sym extra)))))

-(defmethod default-warning-handler* :fn-var
+(defmethod error-message :fn-var
   [warning-type extra]
   (str (symbol (str (:ns-name extra)) (str (:sym extra)))
     " no longer fn, references are stale"))

-(defmethod default-warning-handler* :fn-arity
+(defmethod error-message :fn-arity
   [warning-type extra]
   (str "Wrong number of args (" (:argc extra) ") passed to "
     (or (:ctor extra)
       (:name extra))))

-(defmethod default-warning-handler* :fn-deprecated
+(defmethod error-message :fn-deprecated
   [warning-type extra]
   (str (-> extra :fexpr :info :name) " is deprecated."))

-(defmethod default-warning-handler* :undeclared-ns-form
+(defmethod error-message :undeclared-ns-form
   [warning-type extra]
   (str "Referred " (:type extra) " " (:lib extra) "/" (:sym extra) " does not exist"))

-(defmethod default-warning-handler* :protocol-deprecated
+(defmethod error-message :protocol-deprecated
   [warning-type extra]
   (str "Protocol " (:protocol extra) " is deprecated"))

-(defmethod default-warning-handler* :undeclared-protocol-symbol
+(defmethod error-message :undeclared-protocol-symbol
   [warning-type extra]
   (str "Can't resolve protocol symbol " (:protocol extra)))

-(defmethod default-warning-handler* :invalid-protocol-symbol
+(defmethod error-message :invalid-protocol-symbol
   [warning-type extra]
   (str "Symbol " (:protocol extra) " is not a protocol"))

-(defmethod default-warning-handler* :multiple-variadic-overloads
+(defmethod error-message :multiple-variadic-overloads
   [warning-type extra]
   (str (:name extra) ": Can't have more than 1 variadic overload"))

-(defmethod default-warning-handler* :variadic-max-arity
+(defmethod error-message :variadic-max-arity
   [warning-type extra]
   (str (:name extra) ": Can't have fixed arity function with more params than variadic function"))

-(defmethod default-warning-handler* :overload-arity
+(defmethod error-message :overload-arity
   [warning-type extra]
   (str (:name extra) ": Can't have 2 overloads with same arity"))

-(defmethod default-warning-handler* :extending-base-js-type
+(defmethod error-message :extending-base-js-type
   [warning-type extra]
   (str "Extending an existing JavaScript type - use a different symbol name "
        "instead of " (:current-symbol extra) " e.g " (:suggested-symbol extra)))

 (defn ^:private default-warning-handler [warning-type env extra]
   (when (warning-type *cljs-warnings*)
-    (when-let [s (default-warning-handler* warning-type extra)]
+    (when-let [s (error-message warning-type extra)]
       (binding [*out* *err*]
         (println (message env (str "WARNING: " s)))))))


Fix handler request param destructuring

Fix handler request param destructuring

--- src/clj/gtfve/handler.clj
+++ src/clj/gtfve/handler.clj
@@ -64,7 +64,7 @@
   (ANY "/trips" [] gtfs-trips)
   (ANY "/routes" [] gtfs-routes)
   (ANY "/routes/:id" [id] (gtfs-route id))
-  (GET "/stops-search" {:keys [query] :as req} (gtfs-stops query))
+  (GET "/stops-search" [query] (gtfs-stops query))
   (resources "/")
   (not-found "Not Found"))


Add deprecation metadata on lambdacd.util

--- src/clj/lambdacd/util.clj
+++ src/clj/lambdacd/util.clj
@@ -17,81 +17,98 @@

 (defn no-file-attributes
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   []
   (into-array FileAttribute []))

-(def temp-prefix temp-utils/temp-prefix) ; DEPRECATED, WILL BE REMOVED SOON
+(def ^{:doc "DEPRECATED, WILL BE REMOVED SOON"
+       :deprecated "0.12.1"} temp-prefix temp-utils/temp-prefix) ; DEPRECATED, WILL BE REMOVED SOON

 (defn create-temp-dir
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   ([]
     (temp-utils/create-temp-dir))
   ([parent]
    (temp-utils/create-temp-dir parent)))

-(defn create-temp-file []
+(defn create-temp-file
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
+  []
   (temp-utils/create-temp-file))

 (defmacro with-temp
   "DEPRECATED, WILL BE REMOVED SOON
   evaluates the body, then deletes the given file or directory.
   returns the result of the evaluation of the body"
+  {:deprecated "0.12.1"}
   [f body]
   `(temp-utils/with-temp ~f ~body))

 (defn write-as-json
   "UNUSED AND DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [file data]
   (spit file (json/write-str data)))

 (defn bash
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [cwd & commands]
   (apply bash-utils/bash cwd commands))

-(defn map-if [pred f coll]
+(defn map-if
   "UNUSED AND DEPRECATED, WILL BE REMOVED SOON" ; only used by test
+  {:deprecated "0.12.1"}
+  [pred f coll]
   (map #(if (pred %)
          (f %)
          %) coll))

 (defn put-if-not-present
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [m k v]
   (map-utils/put-if-not-present m k v))

 (defn parse-int
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [int-str]
   (sugar-utils/parse-int int-str))

 (defn contains-value?
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [v coll]
   (map-utils/contains-value? v coll))

 (defn to-json
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [v]
   (ui-utils/to-json v))

 (defn buffered
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [ch]
   (async-utils/buffered ch))

 (defn json
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [data]
   (ui-utils/json data))

 (defn ok
   "UNUSED AND DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   []
   {:headers { "Content-Type" "application/json"}
    :body "{}"
@@ -99,10 +116,12 @@

 (defn fill
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [coll length filler]
   (coll-utils/fill coll length filler))

 (defn merge-with-k-v
   "DEPRECATED, WILL BE REMOVED SOON"
+  {:deprecated "0.12.1"}
   [f & maps]
   (apply map-utils/merge-with-k-v f maps))


rename function

rename function

--- src/cljc/cyrats/tick.cljc
+++ src/cljc/cyrats/tick.cljc
@@ -12,12 +12,12 @@
 (defn game-register [game games]
   (conj games game))

-(defn game-can-tick [game]
+(defn game-can-tick? [game]
   (> 1 (count (filter game/player-is-alive? (:players game)))))

 (defn tick [game]
-  (if (game-can-tick game)
+  (if (game-can-tick? game)
     (assoc game :running? false)
     (-> game
         (update :tick inc)
@@ -28,7 +28,7 @@
 (defn tick-loop [games]
   (->> games)
   (map tick)
-  (filter game-can-tick))
+  (filter game-can-tick?))

 (def process-user-input [game msg]
   (case (:type msg)


updating with range for many counters

updating with range for many counters

--- src/cljs/hello2/core.cljs
+++ src/cljs/hello2/core.cljs
@@ -7,7 +7,12 @@

 (enable-console-print!)

-(def app-state {:counters [{:count 0 :id 0} {:count 1 :id 1}]})
+(def app-state (->> (range 0 1000)
+                    (map #(assoc {:count 1} :id %))
+                    vec
+                    (assoc {} :counters)))
+
+(println app-state)

 (defn get-counters [state key]
   (let [st @state]
@@ -37,13 +42,24 @@
   Object
   (render [this]
           (let [{:keys [count id] :as props} (om/props this)]
+            (println "rendering counter: " id)
             (dom/div nil
-                     (dom/span nil (str "Count: " count " id: " id))
+                     (dom/span nil (str "Id: " id " count: " count))
                      (dom/button
                       #js {:onClick
-                           (fn [e] (om/transact! this `[(counter/increment ~props) :count]))}
-                      "Click me!")))))
+                           (fn [e] (om/transact! this `[(counter/increment ~props)]))}
+                      "+")))))
 (def counter-view (om/factory Counter {:keyfn :id}))
+
+(defui Totals
+  Object
+  (render [this]
+          (println "rendering total")
+          (dom/div nil "total counters:"
+                   (->> (om/props this)
+                        (map :count)
+                        (reduce +)))))
+(def total-view (om/factory Totals))

 (defui MyRoot
   static om/IQuery
@@ -52,15 +68,10 @@
            [{:counters subquery}]))
   Object
   (render [this]
-          (println "root" (om/props this))
+          (println "rendering root" (om/props this))
           (let [{:keys [counters]} (om/props this)]
             (dom/div nil
-                     (str
-                      "total: "
-                      (->> counters
-                           (map :count)
-                           (reduce +)))
-                     (dom/div nil "hi")
+                     (total-view counters)
                      (dom/div nil
                               (map counter-view counters))))))


Use keyword-specified properties

Use keyword-specified properties

--- src/clojure/neko/init.clj
+++ src/clojure/neko/init.clj
@@ -18,36 +18,40 @@
   "Checks if the given property keyword is set to true during the
   compilation of neko."
   [property]
-  (= (System/getProperty property) "true"))
+  (= (System/getProperty (name property)) "true"))
+
+;; A list of all properties supported and tracked by neko.
+;;
+(def ^{:private true} properties-list
+  [:android-dynamic-compilation :android-start-nrepl-server
+   :android-release-build])

 ;; Gather JVM properties during the compile time that indicates the
 ;; parameters of the build.
 ;;
 (def ^{:private true} properties
-  {:enable-dynamic-compilation (property-set? "android_dynamic_compilation")
-   :start-nrepl-server (property-set? "android_start_nrepl_server")
-   :release-build (property-set? "android_release_build")})
+  (zipmap properties-list (map property-set? properties-list)))

 (defmacro enable-dynamic-compilation?
   "Returns true if the current build is a debuggable one or if
   either the dynamic compillation or nREPL server are enabled
   explicitly."
   []
-  (or (not (properties :release-build))
-      (properties :start-nrepl-server)
-      (properties :enable-dynamic-compilation)))
+  (or (not (properties :android-release-build))
+      (properties :android-start-nrepl-server)
+      (properties :android-enable-dynamic-compilation)))

 (defmacro start-nrepl-server?
   "Returns true if the current build is a debuggable one or if the
   nREPL server is enabled explicitly."
   []
-  (or (not (properties :release-build))
-      (properties :start-nrepl-server)))
+  (or (not (properties :android-release-build))
+      (properties :android-start-nrepl-server)))

 (defmacro is-debug?
   "Returns true if the current build is a debuggable one."
   []
-  (not (properties :release-build)))
+  (not (properties :android-release-build)))

 (defn start-repl
   "Starts a remote nREPL server. Creates a `user` namespace because
@@ -76,3 +80,20 @@
     ;; Ensure that `:port` is provided, pass all other arguments as-is.
     (apply start-repl :port port
            (mapcat identity (dissoc args :classes-dir :port)))))
+
+(defmacro with-properties
+  "Sets the given properties specified by keywords to the respective
+  values to run the code provided in `body`. At the end restore the
+  initial property values."
+  [bindings & body]
+  (let [bindings (partition 2 bindings)
+        initial (gensym)]
+    `(let [~initial (hash-map ~@(mapcat (fn [[prop _]]
+                                          [prop `(str (System/getProperty (name ~prop)))])
+                                        bindings))]
+       ~@(for [[prop newval] bindings]
+           `(System/setProperty (name ~prop) (str ~newval)))
+       (let [result# (do ~@body)]
+         ~@(for [[prop newval] bindings]
+             `(System/setProperty (name ~prop) (get ~initial ~prop)))
+         result#))))


Setup thread factory from Neko (deprecate custom nREPL build)

Redef clojure.tools.nrepl.middleware.interruptible-eval/configure-thread-factory
as described at http://dev.clojure.org/jira/browse/NREPL-8.

--- src/clojure/neko/init.clj
+++ src/clojure/neko/init.clj
@@ -12,7 +12,9 @@
 (ns neko.init
   "Contains functions for neko initialization and setting runtime options."
   (:require [neko context log resource compilation threading])
-  (:import android.content.Context))
+  (:import android.content.Context
+           java.util.concurrent.atomic.AtomicLong
+           java.util.concurrent.ThreadFactory))

 (defmacro
   ^{:private true
@@ -25,6 +27,20 @@
             (::enable-dynamic-compilation *compiler-options*))
     `(neko.compilation/init ~context ~classes-dir)))

+(defn android-thread-factory
+  "Returns a new ThreadFactory with increased stack size. It is used
+  to substitute nREPL's native `configure-thread-factory` on Android
+  platform."
+  []
+  (let [counter (AtomicLong. 0)]
+    (reify ThreadFactory
+      (newThread [_ runnable]
+        (doto (Thread. (.getThreadGroup (Thread/currentThread))
+                       runnable
+                       (format "nREPL-worker-%s" (.getAndIncrement counter))
+                       1048576) ;; Hardcoded stack size of 1Mb
+          (.setDaemon true))))))
+
 (defn start-repl
   "Starts a remote nREPL server. Creates a `user` namespace because
   nREPL expects it to be there while initializing. References nrepl's
@@ -34,7 +50,10 @@
   (binding [*ns* (create-ns 'user)]
     (refer-clojure)
     (use 'clojure.tools.nrepl.server)
-    (apply (resolve 'start-server) repl-args)))
+    (require '[clojure.tools.nrepl.middleware.interruptible-eval :as ie])
+    (with-redefs-fn {(resolve 'ie/configure-thread-factory)
+                     android-thread-factory}
+      #(apply (resolve 'start-server) repl-args))))

 (defmacro
   ^{:private true


[#10443] Remove sensitive information from keycard logs


fix interval ruel  that conflict with alarm intent

--- resources/duckling/rules/en.time.clj
+++ resources/duckling/rules/en.time.clj
@@ -564,7 +564,7 @@
   ; Specific for time-of-day, to help resolve ambiguities

   "<time-of-day> - <time-of-day> (interval)"
-  [{:form :time-of-day} #"\-|to|th?ru|through" {:form :time-of-day}]
+  [#(and (= :time-of-day (:form %)) (not (:latent %))) #"\-|to|th?ru|through" {:form :time-of-day}] ; Prevent set alarm 1 to 5pm
   (interval %1 %3 true)

   "from <time-of-day> - <time-of-day> (interval)"


Remove print.

Remove print.

--- src/onyx/coordinator/async.clj
+++ src/onyx/coordinator/async.clj
@@ -97,7 +97,6 @@
   component/Lifecycle

   (start [component]
-    (println "Starting the coordinator")
     (let [planning-ch-head (chan ch-capacity)
           born-peer-ch-head (chan ch-capacity)
           dead-peer-ch-head (chan ch-capacity)
@@ -156,8 +155,6 @@
         :completion-mult completion-mult)))

   (stop [component]
-    (println "Stopping the coordinator")
-
     (clojure.core.async/close! (:planning-ch-head component))
     (clojure.core.async/close! (:born-peer-ch-head component))
     (clojure.core.async/close! (:dead-peer-ch-head component))


Fixed bug in ionian.

Fixed bug in ionian.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -18,7 +18,7 @@
 (def note# (comp sampled-piano ground))
 (defn chord# [chord] (doseq [note (vals chord)] (note# note)))

-(def ionian #([0 2 4 5 7 9 11] (mod % 7)))
+(def ionian #(+ (* 12 (quot % 7)) ([0 2 4 5 7 9 11] (mod % 7))))
 (defn triad [scale root]
   (zipmap [:i :iii :v]
           [(scale root)
@@ -53,13 +53,13 @@
     (if notes
       (even-melody# (from timing 1) notes))))

-(defn play []
-  (let [timing (from (bpm 240) 2)]
+(defn play# []
+  (let [timing (from (bpm 120) 2)]
     (even-melody# timing (take 32 (cycle [9 7])))
     (rythm-n-bass# timing (take 16 (cycle progression)))
     (even-melody# (speed-up (from timing 31) 2) (map ionian [2 4 5 4 4 2 4]))
-    (even-melody# (speed-up (from timing 39) 2) (map ionian [5 1 2 1 1 5 1]))
-    (even-melody# (speed-up (from timing 47) 2) (map ionian [5 1 2 1 1 5 1 2 3 4]))
-    (even-melody# (speed-up (from timing 55) 2) (map ionian [5 1 2 1 1 5 1 2 1 6]))))
+    (even-melody# (speed-up (from timing 39) 2) (map ionian [-3 1 2 1 1 -3 1]))
+    (even-melody# (speed-up (from timing 47) 2) (map ionian [-3 1 2 1 1 -3 1 2 3 4]))
+    (even-melody# (speed-up (from timing 55) 2) (map ionian [-3 1 2 1 1 -3 1 2 1 -1]))))

-(play)
+(play#)


Drop the rests.

Drop the rests.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -22,7 +22,7 @@
   (chord :Eb4 :major)
   (chord :Eb4 :major)
   (chord :Bb3 :major)
-  ()
+  (chord :Bb3 :major)
 ])

 (def variation-section [
@@ -41,7 +41,7 @@
   (chord :Eb4 :major)
   (chord :Eb4 :major)
   (chord :Bb3 :major)
-  ()
+  (chord :Bb3 :major)
 ])

 (defn play-chord [notes duration] ( do


Remove prns.

Remove prns.

--- src/merkle_db/partition.clj
+++ src/merkle_db/partition.clj
@@ -305,7 +305,6 @@
       (map
         (fn make-partition
           [partition-records]
-          (prn :from-records/make-partition partition-records)
           (store-node!
             store
             {:data/type data-type
@@ -340,7 +339,6 @@
                            (tablet/from-records)
                            (tablet/update-records additions deleted-keys))
         record-count (count (tablet/read-all virtual-tablet))]
-    (prn :apply-patch/virtual-tablet virtual-tablet)
     (cond
       ; Empty partitions are not valid, so return nil.
       (zero? record-count) nil


just use in-ns

just use in-ns

--- clojure/project.clj
+++ clojure/project.clj
@@ -11,14 +11,14 @@
   :plugins [[lein-cljsbuild "1.1.1"]
             [lein-figwheel "0.5.0-2"]]

-  :source-paths ["src" "src/dev"]
+  :source-paths ["src"]

   :clean-targets ["server.js"
                   "target"]

   :cljsbuild {
     :builds [{:id "dev"
-              :source-paths ["src" "src/dev"]
+              :source-paths ["src"]
               :figwheel true
               :compiler {
                 :main dnd.core


modernize repl connect in repl sample

modernize repl connect in repl sample

--- samples/repl/src/repl/test.cljs
+++ samples/repl/src/repl/test.cljs
@@ -11,7 +11,8 @@
             ;[clojure.reflect :as reflect]
             ))

-(repl/connect "http://localhost:9000/repl")
+(defonce conn
+  (repl/connect "http://localhost:9000/repl"))

 (comment


~(defn sentence): add more alternatives for generation

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -298,7 +298,7 @@
   (let [specs
         [

-         ;; [s [np [vp v np]]]
+         ;; [s [np det n] [vp v [np det n]]]
          {:synsem {:cat :verb
                    :subcat []}
           :head {:phrasal true
@@ -311,7 +311,33 @@
                   {:cat :verb
                    :subcat {:2 {:pronoun false
                                 :propernoun false}}}}}}
-         ;; [np [det n]]
+
+         ;; [s [N [vp v np]]]
+         {:synsem {:cat :verb
+                   :subcat []}
+          :head {:phrasal true
+                 :synsem
+                 {:subcat {:1 {:cat :noun}}}
+                 :head
+                 {:synsem
+                  {:cat :verb
+                   :subcat {:2 {:pronoun false
+                                :propernoun false}}}}}}
+
+         ;; [s [N [vp v X]]]
+         {:synsem {:cat :verb
+                   :subcat []}
+          :head {:phrasal true
+                 :synsem
+                 {:subcat {:1 {:cat :noun
+                               :pronoun false
+                               :propernoun false}}
+                 :head
+                 {:synsem
+                  {:cat :verb
+                   :subcat {:2 {:cat :top}}}}}}}
+
+         ;; [np [det N]]
          {:phrasal true
           :synsem {:cat :noun
                    :subcat []}}


separate timing for generation and parsing

--- test/babel/test/fr.cljc
+++ test/babel/test/fr.cljc
@@ -678,14 +678,13 @@
     (is (= times
            (count (take times
                         (repeatedly
-                         #(time (do
-                                  (println (fo (generate spec :model (medium))))
-                                  (println (string/join ","
-                                                        (map (:morph-ps (medium))
-                                                             (parse (fo (generate spec :model (medium)))
-                                                                    :model (medium)
-                                                                    :parse-with-truncate false)))))))))))))
-
+                         #(let [expr (fo (time (generate spec :model model)))]
+                            (println expr)
+                            (println (string/join ","
+                                                  (map (:morph-ps model)
+                                                       (take 1 (time (parse expr
+                                                                            :model model
+                                                                            :parse-with-truncate false))))))))))))))
 (deftest speed-test-1
   ;; these should all take relatively the same time, but
   ;; for now, the more general the spec, the longer it takes to generate.


Oops, wasn't formatting dates for display

--- src/mars_ogler/scrape.clj
+++ src/mars_ogler/scrape.clj
@@ -190,9 +190,11 @@
                             :released reverse
                             :taken-marstime identity
                             :taken-utc reverse)
-                   sorted (-> (sort-by time-type imgs) resort)
-                   str-dated (map format-dates sorted)]
-               [time-type (-> (sort-by time-type imgs) resort doall)]))))
+                   sorted (-> (sort-by time-type imgs) resort)]
+               [time-type (->> (sort-by time-type imgs)
+                            resort
+                            (map format-dates)
+                            doall)]))))

 ;;
 ;; State & Main


Adds resource requests to job-submitted event (#1922)

--- scheduler/src/cook/rest/api.clj
+++ scheduler/src/cook/rest/api.clj
@@ -2184,11 +2184,14 @@
                          time-until-out-of-debt (rate-limit/time-until-out-of-debt-millis! rate-limit/job-submission-rate-limiter user)
                          in-debt? (not (zero? time-until-out-of-debt))]
                      (try
-                       (doseq [{:keys [uuid name]} jobs]
+                       (doseq [{:keys [cpus gpus mem name uuid]} jobs]
                          (passport/log-event
-                           {:event-type passport/job-submitted
+                           {:cpus cpus
+                            :event-type passport/job-submitted
+                            :gpus (or gpus 0)
                             :job-name name
                             :job-uuid (str uuid)
+                            :mem mem
                             :pool pool-name
                             :pool-header pool-header
                             :pool-param pool-param


Moved several functions to make linker happy

--- src/arachnida/server.clj
+++ src/arachnida/server.clj
@@ -25,6 +25,37 @@
 (require '[arachnida.config        :as config])
 (require '[arachnida.db-interface  :as db-interface])
 (require '[arachnida.html-renderer :as html-renderer])
+
+(defn start-of-year
+    [year]
+    (str year "-01-01"))
+
+(defn end-of-year
+    [year]
+    (str year "-12-31"))
+
+(defn read-stat-for-product
+    [product-id start-year end-year]
+    (into (sorted-map)
+        (for [year (range start-year (inc end-year))]
+            [year (db-interface/read-statistic-for-product product-id (start-of-year year) (end-of-year year))])))
+
+(defn read-stat-for-product-repo
+    [product-id start-year end-year]
+    (into (sorted-map)
+        (for [year (range start-year (inc end-year))]
+            [year (db-interface/read-statistic-for-product-repo product-id (start-of-year year) (end-of-year year))])))
+
+(defn read-stat-for-product-and-repo
+    [product-id repository-name start-year end-year]
+    (into (sorted-map)
+        (for [year (range start-year (inc end-year))]
+            [year (db-interface/read-statistic-for-product-and-repo product-id repository-name (start-of-year year) (end-of-year year))])))
+
+(defn get-year-data
+    [stat what]
+    (for [s stat]
+        [(key s) (or (get (val s) what) 0)]))

 (defn read-stat-per-weeks
     [first-day last-day]
@@ -310,7 +341,7 @@
     [request]
     (let [params (:params request)
           author-name     (get params "name")
-          statistic       (db-interface/read-statistic-for-author author-name)
+          statistic       (db-interface/read-statistic-for-author author-name )
           last-week       (calendar/get-week (calendar/get-calendar))
           weeks-stat      (get-weeks-stat last-week author-name)
           week-graph-data [{:values (get-data weeks-stat :stat-for-author :commits-count) :label "Commits"}
@@ -352,32 +383,6 @@
         (-> (html-renderer/render-author-week-repo-page author-name selected-week stat-for-week product repo @config/mailto)
             continue-processing)))

-(defn start-of-year
-    [year]
-    (str year "-01-01"))
-
-(defn end-of-year
-    [year]
-    (str year "-12-31"))
-
-(defn read-stat-for-product
-    [product-id start-year end-year]
-    (into (sorted-map)
-        (for [year (range start-year (inc end-year))]
-            [year (db-interface/read-statistic-for-product product-id (start-of-year year) (end-of-year year))])))
-
-(defn read-stat-for-product-repo
-    [product-id start-year end-year]
-    (into (sorted-map)
-        (for [year (range start-year (inc end-year))]
-            [year (db-interface/read-statistic-for-product-repo product-id (start-of-year year) (end-of-year year))])))
-
-(defn read-stat-for-product-and-repo
-    [product-id repository-name start-year end-year]
-    (into (sorted-map)
-        (for [year (range start-year (inc end-year))]
-            [year (db-interface/read-statistic-for-product-and-repo product-id repository-name (start-of-year year) (end-of-year year))])))
-
 (defn perform-product-page
     [request]
     (let [params (:params request)
@@ -392,11 +397,6 @@
           ;product-repo (read-stat-for-product-repo product-id @config/start-year @config/end-year)]
         (-> (html-renderer/render-product-page product-name repositories product-stat @config/mailto year-graph-data-1 year-graph-data-2)
             continue-processing)))
-
-(defn get-year-data
-    [stat what]
-    (for [s stat]
-        [(key s) (or (get (val s) what) 0)]))

 (defn perform-repository-page
     [request]


Separated benchmark data generation from benchmark runner.


hopefully make this easier to read

hopefully make this easier to read

--- src/babel/directory.cljc
+++ src/babel/directory.cljc
@@ -102,29 +102,38 @@
         persons [:1st :2nd :3rd]
         numbers [:sing :plur]]
     (doall
-     (map (fn [root-verb]
-            (do (println (str "" root-verb))
-                (let [root-verb-spec (get root-verb-specs root-verb)]
-                  (doall (map (fn [tense]
-                                (println (str " " tense))
-                                (doall (map (fn [number]
-                                              (let [number-spec {:comp {:synsem {:agr {:number number}}}}]
-                                                (doall (map (fn [person]
-                                                              (let [person-spec {:comp {:synsem {:agr {:person person}}}}]
-                                                                (println
-                                                                 (str "  "
-                                                                      (let [pair
-                                                                            (generate language (unify root-verb-spec
-                                                                                (get tenses tense)
-                                                                                number-spec
-                                                                                person-spec))]
-                                                                        (str "\"" (:source pair) "\" -> \""
-                                                                             (:target pair) "\""))))))
-                                                            persons))))
-                                            numbers)))
-                              (sort (keys tenses)))))
-                (println)))
-          (sort (keys root-verb-specs))))))
+     (->>
+      (sort (keys root-verb-specs))
+      (map (fn [root-verb]
+             (do (println (str "" root-verb))
+                 (let [root-verb-spec (get root-verb-specs root-verb)]
+                   (doall
+                    (->>
+                     (sort (keys tenses))
+                     (map (fn [tense]
+                            (println (str " " tense))
+                            (doall
+                             (->>
+                              numbers
+                              (map
+                               (fn [number]
+                                 (let [number-spec {:comp {:synsem {:agr {:number number}}}}]
+                                   (doall
+                                    (->>
+                                     persons
+                                     (map (fn [person]
+                                            (let [person-spec {:comp {:synsem {:agr {:person person}}}}]
+                                              (println
+                                               (str "  "
+                                                    (let [pair
+                                                          (generate language (unify root-verb-spec
+                                                                                (get tenses tense)
+                                                                                number-spec
+                                                                                person-spec))]
+                                                      (str "\"" (:source pair) "\""
+                                                           " -> "
+                                                           "\""  (:target pair) "\"")))))))))))))))))))
+                 (println))))))))

 (defn generate [language spec]
   (let [model @((-> models language))


Update tests for tools-deps 1.10.1.478

Update tests for tools-deps 1.10.1.478


[core] Add 'handle-peer-liveness for :alive? state transitions.

--- src/birdie_tell/core.clj
+++ src/birdie_tell/core.clj
@@ -236,6 +236,23 @@
          (filter identity) ; eliminate 'nil peers (empty categories)
          first))) ; return the first

+(defn- handle-peer-liveness
+  "Take a 'state atom, an 'alive? predicate, and a 'peer-host-port.
+
+  Find the first UUID corresponding to the specified 'peer-host-port.
+  TODO: Figure out how to protect against / handle duplicate 'peer-host-port values in 'state.
+
+  'swap! the 'alive? predicate for the specified 'peer-host-port into 'state.
+  "
+  [state alive? peer-host-port]
+  (util/debug :handle-peer-liveness @state alive? peer-host-port)
+  (if-let [uuid (->> @state
+                     :peers
+                     :identified
+                     (filter (fn [[k v]] (= peer-host-port (:host-port v))))
+                     ffirst)]
+    (swap! state assoc-in [:peers :identified uuid :alive?] alive?)))
+
 (defn choose-news
   "Choose all the latest hot news that I have in my little bird-brain.


almost working solution

almost working solution

--- src/hackerrank/security/security_involution.clj
+++ src/hackerrank/security/security_involution.clj
@@ -12,8 +12,13 @@

 (with-in-str input
   (let [n (parseInt (read-line))
-        numbers (concat [0](map parseInt (split (read-line) #" ")))]
+        numbers (concat [0](map parseInt (split (read-line) #" ")))
+        numbers2 (for [x numbers] (nth numbers (dec x)))]
+
+      n
+      numbers
+;;       (println numbers2)

       (doseq [i (range 1 (inc n))]
 ;;         (println i (nth numbers i))
-        (println (nth numbers (nth numbers i))))))
+        (println (nth numbers (nth numbers i))))))


Dump to a different log file for testing purposes.

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -1,4 +1,4 @@
-(ns onyx-benchmark.peer
+cd69211780584b9f5bfae11f87f5b7655b178e19 onyx-benchmark.peer
   (:require [clojure.core.async :refer [chan dropping-buffer <!!]]
             [clojure.data.fressian :as fressian]
             [riemann.client :as r]
@@ -59,7 +59,7 @@
                                :async? false
                                :max-message-per-msecs nil
                                :fn rotor/appender-fn}}
-           :shared-appender-config {:rotor {:path "onyx.log"
+           :shared-appender-config {:rotor {:path "onyx-benchmark.log"
                                             :max-size (* 512 102400) :backlog 5}}}
     (not-empty yeller-token)
     (assoc :yeller (yeller-timbre-appender/make-yeller-appender


CMR-1297 Extracts duplicate error throwing code into function.

--- search-app/src/cmr/search/services/query_service.clj
+++ search-app/src/cmr/search/services/query_service.clj
@@ -177,6 +177,12 @@
                   aql))
     results))

+(defn- throw-id-not-found
+  [concept-id]
+  (err/throw-service-error
+   :not-found
+   (format "Concept with concept-id: %s could not be found" concept-id)))
+
 (deftracefn find-concept-by-id
   "Executes a search to metadata-db and returns the concept with the given cmr-concept-id."
   [context result-format concept-id]
@@ -188,16 +194,13 @@
                                       :result-format result-format})
           results (qe/execute-query context query)]
       (when (zero? (:hits results))
-        (err/throw-service-error :not-found
-                                 (format "Concept with concept-id: %s could not be found" concept-id)))
+        (throw-id-not-found concept-id))
       {:results (single-result->response context query results)})
     ;; else
-    (let [concepts (t/get-latest-formatted-concepts context [concept-id] result-format)]
-      (when-not (seq concepts)
-        (err/throw-service-error
-         :not-found
-         (format "Concept with concept-id: %s could not be found" concept-id)))
-      (first concepts))))
+    (let [concept (first (t/get-latest-formatted-concepts context [concept-id] result-format))]
+      (when-not concept
+        (throw-id-not-found concept-id))
+      concept)))

 (deftracefn get-granule-timeline
   "Finds granules and returns the results as a list of intervals of granule counts per collection."


Fix base-hp ref

Fix base-hp ref

--- src/main/cljc/clojure_club/rpg_spec/mgrimm.cljc
+++ src/main/cljc/clojure_club/rpg_spec/mgrimm.cljc
@@ -71,7 +71,7 @@
 (defn create-character []
   (let [{cls ::class {con ::con} ::attributes :as ch} (one-sample ::character)
         start-cls (first (seq cls))
-        hp (+ con (base-hp start-cls))]
+        hp (+ con (class-base-hp start-cls))]
     (assoc ch ::hp hp)))

 #_(clojure.pprint/pprint (create-character))


remove needless checks around source map logic

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -1003,30 +1003,28 @@
   (when (contains? opts :output-dir)
     (assert (string? output-dir)
             (format ":output-dir %s must specify a directory"
-                    (pr-str output-dir)))
-    (assert (contains? opts :output-to)
-            (format ":output-dir cannot be specified without also specifying :output-to")))
+                    (pr-str output-dir))))
   true)

 (defn check-source-map [{:keys [output-to source-map output-dir] :as opts}]
   "When :source-map is specified in opts, "
-  (when (contains? opts :source-map)
+  (when (and (contains? opts :source-map)
+             (not (= (:optimizations opts) :none)))
     (assert (and (contains? opts :output-to)
                  (contains? opts :output-dir))
-            ":source-map cannot be specied without also specifying :output-to and :output-dir")
-    (when-not (= (:optimizations opts) :none)
-      (assert (string? source-map)
-        (format ":source-map %s must specify a file in the same directory as :output-to %s if optimization setting applied"
-          (pr-str source-map)
-          (pr-str output-to)))
-      (assert (in-same-dir? source-map output-to)
-        (format ":source-map %s must specify a file in the same directory as :output-to %s if optimization setting applied"
-          (pr-str source-map)
-          (pr-str output-to)))
-      (assert (same-or-subdirectory-of? (absolute-parent output-to) output-dir)
-        (format ":output-dir %s must specify a directory in :output-to's parent %s if optimization setting applied"
-          (pr-str output-dir)
-          (pr-str (absolute-parent output-to))))))
+      ":source-map cannot be specied without also specifying :output-to and :output-dir if optimization setting applied")
+    (assert (string? source-map)
+      (format ":source-map %s must specify a file in the same directory as :output-to %s if optimization setting applied"
+        (pr-str source-map)
+        (pr-str output-to)))
+    (assert (in-same-dir? source-map output-to)
+      (format ":source-map %s must specify a file in the same directory as :output-to %s if optimization setting applied"
+        (pr-str source-map)
+        (pr-str output-to)))
+    (assert (same-or-subdirectory-of? (absolute-parent output-to) output-dir)
+      (format ":output-dir %s must specify a directory in :output-to's parent %s if optimization setting applied"
+        (pr-str output-dir)
+        (pr-str (absolute-parent output-to)))))
   true)

 (defn check-source-map-path [{:keys [source-map-path] :as opts}]
@@ -1034,10 +1032,10 @@
     (assert (string? source-map-path)
             (format ":source-map-path %s must be a directory"
                     source-map-path))
-    (assert (and (contains? opts :output-to)
-                 (contains? opts :output-dir)
-                 (contains? opts :source-map))
-            ":source-map-path cannot be specified without also specifying :output-to, :output-dir, and :source-map"))
+    (when-not (= (:optimizations opts) :none)
+      (assert (and (contains? opts :output-to)
+                   (contains? opts :source-map))
+        ":source-map-path cannot be specified without also specifying :output-to and :source-map if optimization setting applied")))
   true)

 (defn build


Fix typo.

Fix typo.

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -911,7 +911,7 @@
   "returns a merged map containing all upstream dependencies defined
   by libraries on the classpath. Should be run in the main thread. If
   not, pass (java.lang.ClassLoader/getSystemClassLoader) to use the
-  system classloder."
+  system classloader."
   ([]
    (get-upstream-deps* (. (Thread/currentThread) (getContextClassLoader))))
   ([classloader]


handling an exception, and allowing to change logging

--- src/clj_discord/core.clj
+++ src/clj_discord/core.clj
@@ -7,6 +7,10 @@
   (:import (org.eclipse.jetty.util.ssl SslContextFactory)
            (org.eclipse.jetty.websocket.client WebSocketClient)))

+(def default-max-text-message-size (* 64 1024))
+(defn default-log-function [& args] (println "\n" args))
+(def default-log-events? true)
+
 (defonce the-token (atom nil))
 (defonce the-gateway (atom nil))
 (defonce the-socket (atom nil))
@@ -14,8 +18,6 @@
 (defonce the-keepalive (atom false))
 (defonce the-seq (atom nil))
 (defonce reconnect-needed (atom false))
-
-(def default-max-text-message-size (* 64 1024))

 (defn disconnect []
   (reset! reconnect-needed false)
@@ -28,63 +30,73 @@
   (reset! the-heartbeat-interval nil))

 (defn connect
-  ([token functions log-events]
-   (connect token functions log-events default-max-text-message-size))
-  ([token functions log-events max-text-message-size]
-   (disconnect)
-   (reset! the-keepalive true)
-   (reset! the-token (str "Bot " token))
-   (reset! the-gateway (str
-                        (get
-                         (json/read-str
-                          (:body (http/get "https://discordapp.com/api/gateway"
-                                           {:headers {:authorization @the-token}})))
-                         "url")
-                        "?v=6&encoding=json"))
-   (reset! the-socket
-           (let [client (new WebSocketClient (new SslContextFactory))]
-             (.setMaxTextMessageSize (.getPolicy client) max-text-message-size)
-             (.start client)
-             (ws/connect
-              @the-gateway
-              :client client
-              :on-receive #(let [received (json/read-str %)
-                                 logevent (if log-events (println "\n" %))
-                                 op (get received "op")
-                                 type (get received "t")
-                                 data (get received "d")
-                                 seq (get received "s")]
-                             (if (= 10 op) (reset! the-heartbeat-interval (get data "heartbeat_interval")))
-                             (if (not (nil? seq)) (reset! the-seq seq))
-                             (if (not (nil? type)) (doseq [afunction (get functions type (get functions "ALL_OTHER" []))]
-                                                     (afunction type data)))))))
-   (.start (Thread. (fn []
-                      (try
-                        (while @the-keepalive
-                          (if (nil? @the-heartbeat-interval)
-                            (Thread/sleep 100)
-                            (do
-                              (if log-events (println "\nSending heartbeat " @the-seq))
-                              (ws/send-msg @the-socket (json/write-str {:op 1, :d @the-seq}))
-                              (Thread/sleep @the-heartbeat-interval)
-                              )))
-                        (catch Exception e (do
-                                             (println "\nCaught exception: " (.getMessage e))
-                                             (reset! reconnect-needed true)
-                                             ))))))
-   (Thread/sleep 1000)
-   (ws/send-msg @the-socket (json/write-str {:op 2, :d {"token" @the-token
-                                                        "properties" {"$os" "linux"
-                                                                      "$browser" "clj-discord"
-                                                                      "$device" "clj-discord"
-                                                                      "$referrer" ""
-                                                                      "$referring_domain" ""}
-                                                        "compress" false}}))
-   (while (not @reconnect-needed) (Thread/sleep 1000))
-   (connect token functions log-events max-text-message-size)))
+  ([token functions]
+    (connect token functions default-log-events? default-log-function default-max-text-message-size))
+  ([token functions log-events?]
+    (connect token functions log-events? default-log-function default-max-text-message-size))
+  ([token functions log-events? max-text-message-size]
+    (connect token functions log-events? default-log-function max-text-message-size))
+  ([token functions log-events? log-function max-text-message-size]
+    (disconnect)
+    (reset! the-keepalive true)
+    (reset! the-token (str "Bot " token))
+    (reset! the-gateway (str
+                          (get
+                            (json/read-str
+                              (:body (http/get "https://discordapp.com/api/gateway"
+                                               {:headers {:authorization @the-token}})))
+                            "url")
+                          "?v=6&encoding=json"))
+    (reset! the-socket
+            (let [client (new WebSocketClient (new SslContextFactory))]
+              (.setMaxTextMessageSize (.getPolicy client) max-text-message-size)
+              (.start client)
+              (ws/connect
+                @the-gateway
+                :client client
+                :on-receive #(let [received (json/read-str %)
+                                   logevent (if log-events? (log-function %))
+                                   op (get received "op")
+                                   type (get received "t")
+                                   data (get received "d")
+                                   seq (get received "s")]
+                               (if (= 10 op) (reset! the-heartbeat-interval (get data "heartbeat_interval")))
+                               (if (not (nil? seq)) (reset! the-seq seq))
+                               (if (not (nil? type)) (doseq [afunction (get functions type (get functions "ALL_OTHER" []))]
+                                                       (afunction type data)))))))
+    (.start (Thread. (fn []
+                       (try
+                         (while @the-keepalive
+                           (if (nil? @the-heartbeat-interval)
+                             (Thread/sleep 100)
+                             (do
+                               (if log-events? (log-function "Sending heartbeat " @the-seq))
+                               (ws/send-msg @the-socket (json/write-str {:op 1, :d @the-seq}))
+                               (Thread/sleep @the-heartbeat-interval)
+                               )))
+                         (catch Exception e (do
+                                              (log-function "Caught exception: " (.getMessage e))
+                                              (reset! reconnect-needed true)
+                                              ))))))
+    (Thread/sleep 1000)
+    (ws/send-msg @the-socket (json/write-str {:op 2, :d {"token" @the-token
+                                                         "properties" {"$os" "linux"
+                                                                       "$browser" "clj-discord"
+                                                                       "$device" "clj-discord"
+                                                                       "$referrer" ""
+                                                                       "$referring_domain" ""}
+                                                         "compress" false}}))
+    (while (not @reconnect-needed) (Thread/sleep 1000))
+    (try
+      (connect token functions log-events? log-function max-text-message-size)
+      (catch java.net.UnknownHostException e
+        (do
+          (log-function "Caught exception: " (.getMessage e))
+          (Thread/sleep 10000)
+          (connect token functions log-events? log-function max-text-message-size))))))

-(defn post-message [channel_id message]
-  (http/post (str "https://discordapp.com/api/channels/" channel_id "/messages")
+(defn post-message [channel-id message]
+  (http/post (str "https://discordapp.com/api/channels/" channel-id "/messages")
              {:body (json/write-str {:content message
                                      :nonce (str (System/currentTimeMillis))
                                      :tts false})
@@ -92,16 +104,16 @@
               :content-type :json
               :accept :json}))

-(defn post-message-with-file [channel_id message file_name]
-  (http/post (str "https://discordapp.com/api/channels/" channel_id "/messages")
+(defn post-message-with-file [channel-id message filename]
+  (http/post (str "https://discordapp.com/api/channels/" channel-id "/messages")
              {:multipart [{:name "content" :content message}
                           {:name "nonce" :content (str (System/currentTimeMillis))}
                           {:name "tts" :content "false"}
-                          {:name file_name :part_name "file" :content (io/file file_name)}]
+                          {:name filename :part_name "file" :content (io/file filename)}]
               :headers {:authorization @the-token}}))

-(defn post-message-with-mention [channel_id message user_id]
-  (post-message channel_id (str "<@" user_id ">" message)))
+(defn post-message-with-mention [channel-id message user-id]
+  (post-message channel-id (str "<@" user-id ">" message)))

 (defn answer-command [data command answer]
   (if (= command (get data "content"))


Pass scenario to simulation runner

Pass scenario to simulation runner

--- src/clj_gatling/core.clj
+++ src/clj_gatling/core.clj
@@ -22,11 +22,11 @@
       {:result :requests})
     :id id :name (:name scenario)))

-(defn run-simulation [users]
+(defn run-simulation [scenario users]
   (println (str "Run simulation with " users " users"))
   (let [cs (repeatedly users async/chan)
         ps (map vector (iterate inc 0) cs)]
-    (doseq [[i c] ps] (go (>! c (run-scenario example/test-scenario i))))
+    (doseq [[i c] ps] (go (>! c (run-scenario scenario i))))
     (let [result (for [i (range users)]
       (let [[v c] (async/alts!! cs)]
         v))]
@@ -41,7 +41,7 @@
     (ReportsGenerator/generateFor "out" (FileDataReader. "23"))))

 (defn -main [users]
-  (let [result (run-simulation (read-string users))
+  (let [result (run-simulation example/test-scenario (read-string users))
         csv (csv/write-csv (report/create-result-lines result) :delimiter "\t" :end-of-line "\n")]
     (println csv)
     (spit "results/23/simulation.log" csv)


Add failing task test.

Add failing task test.

--- src/clojure/apio/cli.clj
+++ src/clojure/apio/cli.clj
@@ -53,4 +53,6 @@
         (tasks/send-task "hellow-world" 1 2 3)
         (thr/sleep 1000)
         (tasks/send-task "hellow-world" 4 5 6)
+        (thr/sleep 1000)
+        (tasks/send-task "hellow-world2" 4 5 6)
         (thr/join thr)))))


Experiment more with meta-errors

Experiment more with meta-errors

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -414,7 +414,7 @@
                          0
                          1)))
                 (vec (repeat (count (:errors ind)) 1)))
-              (if (and (:parent1-errors ind) (:parent2-errors ind))
+              #_(if (and (:parent1-errors ind) (:parent2-errors ind))
                 (vec (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
                                              (:errors ind)
                                              (:parent1-errors ind)
@@ -423,6 +423,31 @@
                          0
                          1)))
                 (vec (repeat (count (:errors ind)) 1)))
+              #_(if (and (:parent1-errors ind) (:parent2-errors ind))
+                (vec (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
+                                             (:errors ind)
+                                             (:parent1-errors ind)
+                                             (:parent2-errors ind))]
+                       (cond
+                         (< e (min p1e p2e)) 0
+                         (= e (min p1e p2e)) 1
+                         (< e (max p1e p2e)) 2
+                         (= e (max p1e p2e)) 3
+                         :else 4)))
+                (vec (repeat (count (:errors ind)) 5)))
+              (if (and (:parent1-errors ind) (:parent2-errors ind))
+                (vec (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
+                                             (:errors ind)
+                                             (:parent1-errors ind)
+                                             (:parent2-errors ind))]
+                       (cond
+                         (zero? e) 0
+                         (< e (min p1e p2e)) 1
+                         (= e (min p1e p2e)) 2
+                         (< e (max p1e p2e)) 3
+                         (= e (max p1e p2e)) 4
+                         :else 5)))
+                (vec (repeat (count (:errors ind)) 6)))
               ;
               (= cat :error-neglect)
               #_(if (and (:parent1-errors ind) (:parent2-errors ind))
@@ -435,12 +460,21 @@
                               0
                               1)))
                 (count (:errors ind)))
+              #_(if (and (:parent1-errors ind) (:parent2-errors ind))
+                (reduce + (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
+                                                  (:errors ind)
+                                                  (:parent1-errors ind)
+                                                  (:parent2-errors ind))]
+                            (if (< e (max p1e p2e))
+                              0
+                              1)))
+                (count (:errors ind)))
               (if (and (:parent1-errors ind) (:parent2-errors ind))
                 (reduce + (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
                                                   (:errors ind)
                                                   (:parent1-errors ind)
                                                   (:parent2-errors ind))]
-                            (if (< e (max p1e p2e))
+                            (if (<= e (min p1e p2e))
                               0
                               1)))
                 (count (:errors ind)))


To compile with cljs

To compile with cljs

--- src/plan_schema/coerce.cljc
+++ src/plan_schema/coerce.cljc
@@ -5,8 +5,10 @@
 ;; the file LICENSE at the root of this distribution.

 (ns plan-schema.coerce
-  (:require [clojure.pprint :refer :all]
-            [clojure.set :as set]))
+  (:require [clojure.set :as set]
+    #?(:clj
+            [clojure.pprint :refer [pprint]]
+       :cljs [cljs.pprint :refer [pprint]])))

 ; TODO network and network-id serve the same purpose.
 ; Consider network-id deprecated and removed in future.


left and right commands work

left and right commands work

--- src/playwood_logo/core.cljs
+++ src/playwood_logo/core.cljs
@@ -1,5 +1,5 @@
 (ns playwood-logo.core
-    (:require [reagent.core :as reagent :refer [atom]]))
+  (:require [reagent.core :as reagent :refer [atom]]))

 (enable-console-print!)

@@ -7,136 +7,154 @@

 ;; define your app data so that it doesn't get over-written on reload

-(defonce app-state (atom
+(def initial-turtle-state
   {
-    :program {
-      :mode :stop
-      :step 0
-      :code [
-        [:left]
-        [:forward 1]
-        [:right]
-        [:forward 1]
-        [:left]
-        [:forward 1]
-      ]
-    }
-
-    :grid {
-      :width 500
-      :height 400
-      :num-rows 21
-      :num-cols 17
-    }
-
-    :turtle {
-      :x 11
-      :y 1
-      :dir :S
-    }
-
-  }))
-
-  (def turtle-circles
-    [
-      ; body
-      { :cx 0.5 :cy 0.6 :r 0.25 }
-      ; head
-      { :cx 0.5 :cy 0.25 :r 0.1 }
-      ; legs
-      { :cx 0.75 :cy 0.38 :r 0.05 }
-      { :cx 0.25 :cy 0.38 :r 0.05 }
-      { :cx 0.75 :cy 0.83 :r 0.05 }
-      { :cx 0.25 :cy 0.83 :r 0.05 }
-      ])
-
-
-  (def dirs [:N :E :S :W])
-
-  (defn dir-to-offset [dir]
-    (case dir
-      :N [0 -1]
-      :E [-1 0]
-      :S [0 1]
-      :W [1 0]
-      [0 0]))
-
-  (defn dir-to-rotation [dir]
-    (case dir
-      :N 0
-      :E 90
-      :S 180
-      :W 270
-      0))
+   :x   11
+   :y   1
+   :dir :S
+   })
+
+(defonce app-state
+         (atom {
+                :program {
+                          :mode :stop
+                          :step 0
+                          :code [
+                                 [:left]
+                                 [:forward 1]
+                                 [:right]
+                                 [:forward 1]
+                                 [:left]
+                                 [:forward 1]
+                                 ]
+                          }
+
+                :grid    {
+                          :width    400
+                          :height   300
+                          :num-rows 21
+                          :num-cols 17
+                          }
+
+                :turtle initial-turtle-state
+                }))
+
+(def turtle-circles
+  [
+   ; body
+   { :cx 0.5 :cy 0.6 :r 0.25 }
+   ; head
+   { :cx 0.5 :cy 0.25 :r 0.1 }
+   ; legs
+   { :cx 0.75 :cy 0.38 :r 0.05 }
+   { :cx 0.25 :cy 0.38 :r 0.05 }
+   { :cx 0.75 :cy 0.83 :r 0.05 }
+   { :cx 0.25 :cy 0.83 :r 0.05 }
+   ])
+
+
+(def dirs [:N :E :S :W])
+
+(defn rotate-right [dir]
+  (let [idx (.indexOf dirs dir)] (get dirs (inc idx) (first dirs))))
+
+(defn rotate-left [dir]
+  (let [idx (.indexOf dirs dir)] (get dirs (dec idx) (last dirs))))
+
+(defn dir-to-offset [dir]
+  (case dir
+    :N [0 -1]
+    :E [-1 0]
+    :S [0 1]
+    :W [1 0]
+    [0 0]))
+
+(defn dir-to-rotation [dir]
+  (case dir
+    :N 0
+    :E 90
+    :S 180
+    :W 270
+    0))

 (defn play! []
   (swap! app-state assoc-in [:program :mode] :play))

+(defn reset-turtle! []
+  (swap! app-state assoc :turtle initial-turtle-state))
+
 (defn apply-stop [prev-state]
   (-> prev-state
-    (assoc-in [:program :mode] :stop)
-    (assoc-in [:program :step] 0)))
+      (assoc-in [:program :mode] :stop)
+      (assoc-in [:program :step] 0)))

 (defn stop! []
   (swap! app-state apply-stop))

-(defn apply-step-code [turtle-state step-code]
+(defn apply-command [turtle-state step-code]
   (let [[cmd arg] step-code]
-  (case cmd
-    :forward
+    (case cmd
+      :left
+      (-> turtle-state
+                  (update :dir rotate-left))
+      :right
+      (-> turtle-state
+                  (update :dir rotate-right))
+
+      :forward
       (let [[dx dy] (dir-to-offset (:dir turtle-state))]
         (-> turtle-state
-          (update :x + (* arg dx))
-          (update :y + (* arg dy))))
-    turtle-state)))
+            (update :x + (* arg dx))
+            (update :y + (* arg dy))))
+      turtle-state)))

 (defn next-step! []
   (swap! app-state
-    (fn [prev-state]
-      (let [program (:program prev-state)
-            num-steps (-> program :code count dec)]
-        (if (and
-              (= (:mode program) :play)
-              (< (:step program) num-steps))
-            (-> prev-state
-              (update-in [:program :step] inc)
-              (update-in [:turtle] apply-step-code
-                (-> program :code (nth (-> program :step inc)))))
-            (apply-stop prev-state))))))
-
-
-
-
-
-(defn turtle [{:keys [x y dir]}]
+         (fn [prev-state]
+           (let [program (:program prev-state)
+                 num-steps (-> program :code count dec)]
+             (if (and
+                   (= (:mode program) :play)
+                   (< (:step program) num-steps))
+               (-> prev-state
+                   (update-in [:program :step] inc)
+                   (update-in [:turtle] apply-command
+                              (-> program :code (nth (-> program :step inc)))))
+               (apply-stop prev-state))))))
+
+
+
+
+
+(defn Turtle [{:keys [x y dir]}]
   [:g
-    {:transform
-      (str "translate(" x "," y ")" "rotate(" (dir-to-rotation dir) ")")
+   {:transform
+    (str "translate(" x "," y ")" "rotate(" (dir-to-rotation dir) ")")
     }
-    (for [c turtle-circles]
-        [:circle (merge c  {
-          :key (-> c vals str)
-          :stroke "#161"
-          :fill "#7a7"
-          :stroke-width 0.05
-          })])
-    ])
-
-(defn cell [{:keys [x y]}]
+   (for [c turtle-circles]
+     [:circle (merge c  {
+                         :key (-> c vals str)
+                         :stroke "#161"
+                         :fill "#7a7"
+                         :stroke-width 0.05
+                         })])
+   ])
+
+(defn Cell [{:keys [x y]}]
   [:rect {
-    :x x
-    :y y
-    :width 1 :height 1
-    :stroke-width 0.025
-    :stroke "#fff"
-    :fill "#cee"
-    }])
-
-
-(defn board []
+          :x x
+          :y y
+          :width 1 :height 1
+          :stroke-width 0.025
+          :stroke "#fff"
+          :fill "#cee"
+          }])
+
+
+(defn Board []
   (let [grid (:grid @app-state)
         width (:width grid)
         height (:height grid)
@@ -144,40 +162,38 @@
         num-cols (:num-cols grid)]
     [:svg {:width width
            :height height}
-           [:g {:transform
-             (str "scale(" (/ width num-rows) "," (/ height num-cols) ")")}
-            (for [x (range num-rows)]
-            (for [y (range num-cols)]
-              [cell {:key (str x ":" y) :x x :y y}]
-            ))
-            [turtle (:turtle @app-state)]
-          ]
-       ]))
+     [:g {:transform
+          (str "scale(" (/ width num-rows) "," (/ height num-cols) ")")}
+      (for [x (range num-rows)]
+        (for [y (range num-cols)]
+          [Cell {:key (str x ":" y) :x x :y y}]
+          ))
+      [Turtle (:turtle @app-state)]
+      ]
+     ]))

 (defn controls []
   [:div {:style {
-     :display "flex" :flex-direction "column" :align-items "center"
-     :width 200
-    }}
-    [:div {:style {:padding 5}}
-      (case (-> @app-state :program :mode)
-        :play [:button {:on-click stop! } "Stop"]
-        :stop [:button {:on-click play! } "Play"])]
-    [:textarea {
-      :rows 20 :cols 20
-      :style { :font-family "monospace" }
-      :value (-> @app-state :program :code (#(apply str %)))} ]
-
-    [:div  "Step: " (-> @app-state :program :step)]
-  ])
+                 :display "flex" :flex-direction "column" :align-items "center"
+                 }}
+   [:div {:style {:padding 5}}
+    (case (-> @app-state :program :mode)
+      :play [:button {:on-click stop! } "Stop"]
+      :stop [:button {:on-click play! } "Play"])
+    [:button {:on-click reset-turtle! } "Reset"]]
+   [:textarea {
+               :style { :font-family "monospace" :width 400 :height 300 }
+               :value (-> @app-state :program :code (#(apply str %)))} ]
+
+   [:div  "Step: " (-> @app-state :program :step)]
+   ])

 (defn world []
-  [:div {:style { :display "flex" :flex-direction "row" }}
-  ;  [:h1 "Playwood Logo"]
-     [board]
-     [controls]
+  [:div {:style { :display "flex" :flex-direction "column" }}
+   [Board]
+   [controls]
    ])

@@ -190,4 +206,4 @@
   ;; optionally touch your app-state to force rerendering depending on
   ;; your application
   ;; (swap! app-state update-in [:__figwheel_counter] inc)
-)
+  )


use the correct headers to discover vhost name

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/base_uri.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/base_uri.clj
@@ -5,14 +5,17 @@

 (defn get-host-port
   "Gets the originating host and port, preferring the 'forwarded'
-   headers, if they exist.  The 'x-forwarded-for' is used instead
-   of 'x-forwarded-host'."
+   headers, if they exist. If neither the x-forwarded-host or host
+   headers exist, then the default is the server-name and server-port
+   from the ring request."
   [{:keys [headers server-name server-port]}]
-  (if-let [host (get headers "x-forwarded-for")]
+  (if-let [host (get headers "x-forwarded-host")]
     (if-let [port (get headers "x-forwarded-port")]
       (format "%s:%s" host port)
       host)
-    (format "%s:%s" server-name server-port)))
+    (if-let [host (get headers "host")]
+      host
+      (format "%s:%s" server-name server-port))))

 (defn get-scheme
   "Get the scheme for the originating host, preferring the 'forwarded'
@@ -22,8 +25,10 @@
       (name scheme)))

 (defn construct-base-uri
-  [req]
-  (format "%s://%s%s" (get-scheme req) (get-host-port req) p/service-context))
+  ([req]
+    (construct-base-uri req p/service-context))
+  ([req service-context]
+        (format "%s://%s%s" (get-scheme req) (get-host-port req) service-context)))

 (defn wrap-base-uri
   "adds the :base-uri key to the request with the base URI value"


Fix missed require.

Fix missed require.

--- src/datascript/query.cljs
+++ src/datascript/query.cljs
@@ -2,7 +2,8 @@
   (:require
     [clojure.set :as set]
     [clojure.walk :as walk]
-    [datascript.core :as dc]))
+    [datascript.core :as dc]
+    [cljs.reader]))

 ;; Records


add ACK debug again

add ACK debug again

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -202,7 +202,7 @@

   (ack-segment [_ _ segment-id]
     (when-let [offset (:offset (get @pending-messages segment-id))]
-      ;; (clojure.pprint/pprint ["ACK" (get @pending-messages segment-id)])
+      (clojure.pprint/pprint ["ACK" (get @pending-messages segment-id)])
       (swap! pending-commits conj offset))
     (swap! pending-messages dissoc segment-id))


Switch to much simpler (also non-explosive) implementation of topological-sort-ugens

Thanks to Rich Hickey for the patch.

Fixes #231

--- src/overtone/sc/synth.clj
+++ src/overtone/sc/synth.clj
@@ -397,45 +397,31 @@

 (defn topological-sort-ugens
   "Sort into a vector where each node in the directed graph of ugens
-  will always be preceded by its upstream dependencies."
+   will always be preceded by its upstream dependencies.  Depth first,
+   from:
+
+   http://en.wikipedia.org/wiki/Topological_sorting,
+
+   following the advice here:
+
+   http://supercollider.svn.sourceforge.net/viewvc/supercollider/trunk/common/build/Help/ServerArchitecture/Synth-Definition-File-Format.html
+
+   'For greatest efficiency:
+
+   Unit generators should be listed in an order that permits efficient
+   reuse of connection buffers, which means that a depth first
+   topological sort of the graph is preferable to breadth first.'"
   [ugens]
-  (loop [ugens ugens
-         ; start with leaf nodes that don't have any dependencies
-         leaves (set (filter (fn [ugen]
-                          (every?
-                            #(or (not (sc-ugen? %))
-                                 (control-proxy? %))
-                            (:args ugen)))
-                        ugens))
-         sorted-ugens []
-         rec-count 0]
-
-    ; bail out after 1000 iterations, either a bug in this code, or a bad synth graph
-    (when (= 1000 rec-count)
-      (throw (Exception. "Invalid ugen tree passed to topological-sort-ugens, maybe you have cycles in the synthdef...")))
-
-    (if (empty? leaves)
-      sorted-ugens
-      (let [last-ugen          (last sorted-ugens)
-            ;; try to always place the downstream ugen from the last-ugen if all other
-            ;; deps are satisfied, which keeps internal buffers in cache as long as possible
-            next-ugen          (first (filter #((set (ugen-children %)) last-ugen) leaves))
-            [next-ugen leaves] (if next-ugen
-                                 [next-ugen (disj leaves next-ugen)]
-                                 [(first leaves) (set (next leaves))])
-            sorted-ugens       (conj sorted-ugens next-ugen)
-            sorted-ugen-set    (set sorted-ugens)
-            ugens              (set/difference ugens sorted-ugen-set leaves)
-            leaves             (set
-                                (reduce
-                                 (fn [rleaves ug]
-                                   (let [children (ugen-children ug)]
-                                     (if (set/subset? children sorted-ugen-set)
-                                       (conj rleaves ug)
-                                       rleaves)))
-                                 leaves
-                                 ugens))]
-        (recur ugens leaves sorted-ugens (inc rec-count))))))
+  (let [visit (fn visit [[ret visited path :as acc] ug]
+                (cond
+                 (visited ug) acc
+                 (path ug)    (throw (Exception. "ugen graph contains cycle"))
+                 :else
+                 (let [[ret visited path :as acc]
+                       (reduce visit [ret visited (conj path ug)] (ugen-children ug))]
+                   [(conj ret ug) (conj visited ug) path])))]
+    (first (reduce visit [[] #{} #{}] ugens))))
+

 (comment
   ; Some test synths, while shaking out the bugs...


Remove test: relativize has been promoted to bidi

--- test/yada/bidi_test.clj
+++ test/yada/bidi_test.clj
@@ -7,25 +7,7 @@
    [bidi.vhosts :refer [vhosts-model make-handler]]
    [clojure.test :refer :all]
    [ring.mock.request :refer [request]]
-   [yada.context :refer [relativize]]
    [yada.yada :refer [uri-for resource]]))
-
-(deftest relativize-test
-  (are [source dest href] (= href (relativize source dest))
-    ;; TODO: Test to itself
-    "" "" nil
-    "/abc/cd/d.html" "/abc/" "../"
-    "/abc/foo.html" "/abc/bar.html" "bar.html"
-    "/abc/foo/a.html" "/abc/bar/b.html" "../bar/b.html"
-    "/abc/foo/a/b" "/abc/bar/b" "../../bar/b"
-    "/abc.html" "/abc.html" "abc.html"
-    "/a/abc.html" "/a/abc.html" "abc.html"
-
-    "/a/" "/a/abc.html" "abc.html"
-    "/a" "/a/abc.html" "a/abc.html"
-
-    "/a/abc.html" "/a/" ""
-    ))

 (deftest uri-for-test
   (let [h