Ensure destruction of recent workspaces

Ensure destruction of recent workspaces

--- src/lt/objs/sidebar/workspace.cljs
+++ src/lt/objs/sidebar/workspace.cljs
@@ -496,7 +496,7 @@
                  (dom/prevent e)
                  (dom/stop-propagation e))
   :click (fn []
-           (object/raise this :recent.select!)))
+           (object/raise this :select!)))

 (defui recents [this rs]
   [:div
@@ -513,17 +513,22 @@
 (behavior ::recent!
           :triggers #{:recent!}
           :reaction (fn [this]
-                      (object/merge! this {:recents (recents this (map #(object/create ::recent-workspace %) (workspace/all)))})
-                      ))
+                      (doseq [r (:recents @this)]
+                        (object/destroy! r))
+                      (->> (workspace/all)
+                           (map #(object/create ::recent-workspace %))
+                           (hash-map :recents)
+                           (object/merge! this))))

 (behavior ::tree!
           :triggers #{:tree!}
           :reaction (fn [this]
-                      (object/merge! this {:recents nil})
-                      ))
+                      (doseq [r (:recents @this)]
+                        (object/destroy! r))
+                      (object/merge! this {:recents nil})))

 (behavior ::recent.select!
-          :triggers #{:recent.select!}
+          :triggers #{:select!}
           :reaction (fn [this]
                       (workspace/open workspace/current-ws (:path @this))
                       (object/raise sidebar-workspace :tree!)
@@ -562,7 +567,8 @@
     [:ul.root
      (object/->content tree)]]
    [:div.recent
-    (bound this :recents)
+    (bound this (fn [sw]
+                  (recents this (:recents sw))))
     ]]
   :dragover (fn [e]
               (set! (.-dataTransfer.dropEffect e) "move")


Running migrations on application start

Running migrations on application start

https://app.asana.com/0/17212341701456/41103712756236

--- src/clj/memento/handler.clj
+++ src/clj/memento/handler.clj
@@ -6,6 +6,7 @@
             [compojure.route :as route]
             [environ.core :refer [env]]
             [memento.auth :as auth]
+            [memento.db.migrations :as migrations]
             [memento.middleware :as middleware]
             [memento.routes.api :refer [api-routes]]
             [memento.routes.home :refer [home-routes]]
@@ -48,6 +49,10 @@
                            :max-size (* 512 1024)
                            :backlog  10})}})

+  (timbre/info "-=[ Applying migrations ]=-")
+  (migrations/migrate ["migrate"])
+  (timbre/info "...migrations done")
+
   (if (env :dev) (parser/cache-off!))
   (start-nrepl)
   ;;start the expired session cleanup job


PUT->PATCH for partial node modification.

--- src/clj/shale/resources.clj
+++ src/clj/shale/resources.clj
@@ -281,10 +281,10 @@
   :handle-exception handle-exception
   :delete! (fn [context]
              (nodes/destroy-node (->node-pool context) id))
-  :put! (fn [context]
-          {::node
-           (nodes/modify-node (->node-pool context) id (clojure-keys
-                                                         (::data context)))})
+  :patch! (fn [context]
+            {::node
+             (nodes/modify-node (->node-pool context) id (clojure-keys
+                                                           (::data context)))})
   :exists? (fn [context]
              (let [node-pool (->node-pool context)]
                (if (nodes/view-model-exists? node-pool id)


Webdriver util func for cross-browser proxy config

--- src/clj/shale/webdriver.clj
+++ src/clj/shale/webdriver.clj
@@ -1,14 +1,35 @@
 (ns shale.webdriver
-  (:require clj-webdriver.driver
+  (:require [schema.core :as s]
+            clj-webdriver.driver
             [clj-webdriver.core :as core]
+            [clj-webdriver.remote.driver :refer [session-id]]
+            [clj-webdriver.taxi :refer [execute-script]]
             wall.hack)
-  (:import [org.openqa.selenium.remote
-            DesiredCapabilities]
+  (:import org.openqa.selenium.remote.DesiredCapabilities
            clj_webdriver.ext.remote.RemoteWebDriverExt
-           shale.ext.ResumableRemoteWebDriver
-           java.net.URL)
-  (:use [clj-webdriver.remote.driver :only [session-id]]
-        clj-webdriver.taxi))
+           java.net.URL
+           shale.ext.ResumableRemoteWebDriver))
+
+(s/defn ^:always-validate add-prox-to-capabilities :- {s/Any s/Any}
+  [capabilities :- {s/Any s/Any}
+   proxy-type   :- (s/enum :socks5 :http)
+   proxy-host   :- s/Str ; IP address
+   proxy-port   :- s/Int]
+  (let [browser-name (get capabilities "browserName")
+        host-and-port (format "%s:%s" proxy-host proxy-port)
+        proxy-url (format "%s://%s" proxy-type host-and-port)]
+    (case browser-name
+      "chrome" (merge-with (partial merge-with into)
+                           capabilities
+                           {"chromeOptions"
+                            {"args" [(format "--proxy-server=%s" proxy-url)]}})
+      "phantomjs" (merge-with into
+                              capabilities
+                              {"phantomjs.cli.args"
+                               [(format "--proxy=%s" host-and-port)
+                                (format "--proxy-type=%s" proxy-type)]})
+      (throw (ex-info "Unknown browser for proxy config."
+                      {:browser-name browser-name})))))

 (defn new-webdriver [node capabilities]
   (clj-webdriver.driver/init-driver


When matching guess, compare surface forms too

--- src/cljs/db_quiz/logic.cljs
+++ src/cljs/db_quiz/logic.cljs
@@ -102,15 +102,19 @@
     (some has-sides-connected? (filter has-all-sides? players-fields))))

 (defn answer-matches?
-  "Test if guess matches the exepcted answer using Jaro-Winkler's string distance.
-  Fuzzy matching may be tweaked by setting threshold
+  "Test if guess matches the excepted answer (its label or any of its surface forms)
+  using Jaro-Winkler's string distance. Fuzzy matching may be tweaked by setting threshold
   from 0 (everything matches) to 1 (only exact matches)."
   [guess answer & {:keys [threshold]}]
   {:pre [(or (not threshold) (< 0 threshold 1))]}
   (if guess
-    (> (jaro-winkler (normalize-answer guess)
-                     (normalize-answer answer))
-       (or threshold (:guess-similarity-threshold config)))
+    (let [{:keys [label surface-forms]} answer
+          normalized-guess (normalize-answer guess)
+          actual-threshold (or threshold (:guess-similarity-threshold config))
+          match-fn (fn [surface-form] (> (jaro-winkler normalized-guess
+                                                       (normalize-answer surface-form))
+                                         actual-threshold))]
+      (not (nil? (some match-fn (cons label surface-forms)))))
     false))

 (defn clear-answer
@@ -184,7 +188,7 @@
 (defn make-a-guess
   []
   (let [{:keys [answer board current-field on-turn verdict]} @app-state
-        correct-answer (get-in board [current-field :label])
+        correct-answer (board current-field)
         answer-matched? (answer-matches? answer correct-answer)
         new-ownership (if answer-matched? on-turn :missed)]
     (when (nil? verdict)
@@ -192,7 +196,7 @@
       (test-winner new-ownership current-field)
       (turn :answer answer
             :answer-matched? answer-matched?
-            :correct-answer correct-answer))))
+            :correct-answer (:label correct-answer)))))

 (defn pick-field
   "A player picks a field with id on board."


Whoops, don't ignore component settings

Whoops, don't ignore component settings

--- src/cljs/kindness/game.cljs
+++ src/cljs/kindness/game.cljs
@@ -58,9 +58,11 @@
                     :z idx}]

       :else
-      [:renderable {:shape :rectangle
-                    :color "#AB4642"
-                    :z idx}])))
+      [:renderable (merge
+                    {:shape :rectangle
+                     :color "#AB4642"
+                     :z idx}
+                    (second entity))])))

 (defn build-components-array [name idx attrs]
   (filter


batching URLs option added

batching URLs option added

--- src/clueweb_disqus/main.clj
+++ src/clueweb_disqus/main.clj
@@ -10,7 +10,8 @@
 (def options [["-b" "--reboot" "Reboot the crawl by dumping restart points"]
               ["-r" "--recover TS" "Timestamp"]
               ["-s" "--stats" "Read stats"]
-              ["-t" "--threads" "Dump a list of relevant thread-ids"]])
+              ["-t" "--threads" "Dump a list of relevant thread-ids"]
+              ["-d" "--download-threads F" "Download a list of threads"]])

 (defn -main
   [& args]
@@ -25,4 +26,7 @@
           (recover/dump-restart-points)

           (:threads options)
-          (posts/dump-all-thread-ids core/disqus-jobs-dir))))
+          (posts/break-up-threads-list)
+
+          (:download-threads options)
+          (posts/download-posts-for-threads (:download-threads options)))))


Implement support methods for serialization.

--- clj_record/test/serialization_test.clj
+++ clj_record/test/serialization_test.clj
@@ -1,18 +1,35 @@
 (ns clj-record.test.serialization-test
   (:require
+    [clj-record.serialization :as serialization]
+    [clj-record.callbacks :as callbacks]
+    [clj-record.callbacks.built-ins :as callb]
     [clj-record.test.model.manufacturer :as manufacturer]
     [clj-record.test.model.product :as product])
   (:use clojure.contrib.test-is
         clj-record.test.test-helper))

+(deftest serializes-simple-clojure-types
+  (are (= _1 (serialization/serialize _2))
+    "\"123\"" "123"
+    "123" 123))
+
+(deftest serializes-and-deserializes-clojure-types-symmetrically
+  (are (= _1 (serialization/deserialize (serialization/serialize _1)))
+    nil
+    [1 2 3]
+    {:a "Aee" :b "Bee" :c "See"}
+    #{1 :b "See"}
+    '(1 2 [hey now])))
+
 (defdbtest serialized-attributes-support-common-clojure-types
-  (let [record (manufacturer/create valid-manufacturer)]
-    (are (=
-      (do
-        (manufacturer/update (assoc record :name _1))
-        _1)
-      ((manufacturer/get-record (record :id)) :name))
-      "some string" ; Cheating? This passes without serialization implemented.
-      )))
-
+  (restoring-ref (manufacturer/model-metadata)
+    ;(callbacks/add-callback "manufacturer" :before-save (callb/transform-value :name serialization/serialize))
+    ;(callbacks/add-callback "manufacturer" :after-load (callb/transform-value :name serialization/deserialize))
+    (let [record (manufacturer/create valid-manufacturer)]
+      (are (=
+        (do (manufacturer/update (assoc record :name _1)) _1)
+        ((manufacturer/get-record (record :id)) :name))
+        "some string" ; Cheating? This passes without serialization implemented.
+        ;23
+        ))))


delaney.clj: added the collapse function

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -608,6 +608,28 @@
                       (- 1 k)
                       k))))))

+(defn collapse [ds connector to-be-removed]
+  (let [to-be-removed (set to-be-removed)]
+    (assert (every? (fn [D] (to-be-removed (s ds connector D))) to-be-removed)
+            (str "element set not invariant under s" connector))
+    (let [img (fn [i D]
+                (loop [D (s ds i D)]
+                  (if (to-be-removed D)
+                    (recur (walk ds D connector i))
+                    D)))
+          remaining (filter (comp not to-be-removed) (elements ds))
+          n (count remaining)
+          emap (zipmap remaining (range 1 (inc n)))
+          idcs (indices ds)
+          ops (into {} (for [i idcs]
+                         [i (into {} (for [D remaining]
+                                       [(emap D) (emap (img i D))]))]))
+          t (DSymbol. (dim ds) n ops {})
+          vs (into {} (for [[i j] (zipmap idcs (rest idcs))]
+                        [i (into {} (for [D remaining]
+                                      [(emap D) (v ds i j D)]))]))]
+      (DSymbol. (dim ds) n ops vs))))
+
 ;; === Tests

 (deftest delaney-test


(TK-9) Update usage message

(TK-9) Update usage message

Update information on --config in the usage message to reflect
the new supported file types.

--- src/puppetlabs/trapperkeeper/internal.clj
+++ src/puppetlabs/trapperkeeper/internal.clj
@@ -116,7 +116,9 @@
    :post [(map? %)]}
   (let [specs       [["-d" "--debug" "Turns on debug mode"]
                      ["-b" "--bootstrap-config BOOTSTRAP-CONFIG-FILE" "Path to bootstrap config file"]
-                     ["-c" "--config CONFIG-PATH" "Path to .ini file or directory of .ini files to be read and consumed by services"]
+                     ["-c" "--config CONFIG-PATH"
+                      (str "Path to .ini file or directory of .ini files to be read and consumed by services."
+                           ".conf, .json, .properties, and .edn files are also supported.")]
                      ["-p" "--plugins PLUGINS-DIRECTORY" "Path to directory plugin .jars"]]
         required    []]
     (first (cli! cli-args specs required))))


Leave out eventstore-deps as Riak.java is not likely to be modified soon

--- project.clj
+++ project.clj
@@ -26,7 +26,7 @@
                  [incanter "1.5.6"]
                  [ring "1.3.2"]
                  [ring/ring-json "0.3.1"]
-                 [eventstore-deps "0.1.0-SNAPSHOT"]
+                 #_[eventstore-deps "0.1.0-SNAPSHOT"]
                  [com.basho.riak/riak-client "2.0.1" :exclusions [com.sun/tools]]
                  [org.json/json "20141113"]
                  [midje "1.6.3"]


pump version

pump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sync "0.9.19"
+(defproject sync "0.9.20-SNAPSHOT"
   :description "sync is a Leiningen plugin to sync same code base between different clojure projects"
   :url "https://github.com/otto-de/leinsync"
   :license {:name "Eclipse Public License"


0.3.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject tenzing/lein-template "0.3.1"
+(defproject tenzing/lein-template "0.3.2-SNAPSHOT"
   :description "Clojurescript application template built on Boot"
   :url "http://github.com/martinklepsch/tenzing"
   :license {:name "Eclipse Public License"


more whitespace

more whitespace

--- project.clj
+++ project.clj
@@ -62,7 +62,7 @@
              :dev {:plugins [[com.aphyr/prism "0.1.1"] ;; autotest support simply run: lein prism
                              [codox "0.8.10"]
                              [org.clojars.rickmoynihan/lein-repack "0.2.5-SNAPSHOT" :exclusions [org.clojure/clojure
-                                                               org.codehaus.plexus/plexus-utils]]]
+                                                                                org.codehaus.plexus/plexus-utils]]]

                    :dependencies [[com.aphyr/prism "0.1.1"]]


lein-release plugin: bumped version from 0.1.1 to 0.1.2-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject yetibot.core "0.1.1"
+(defproject yetibot.core "0.1.2-SNAPSHOT"
   :description "Core yetibot utilities, extracted for shared use among yetibot
                 and its various plugins"
   :url "https://github.com/devth/yetibot.core"


find a fn per its arg + ret, props to @alandipert

--- user.clj
+++ user.clj
@@ -122,6 +122,29 @@
 (defn envs "List of envs and their values" []
   (->> (System/getenv) keys (reduce #(assoc %1 %2 (System/getenv %2)) {}) display))

+;; https://gist.github.com/alandipert/1619740
+(defn findcore
+  "Returns a lazy sequence of functions in clojure.core that, when applied to args,
+  return ret."
+  ([args ret]
+     (findcore (filter #(not (:macro (meta %)))
+                       (vals (ns-publics 'clojure.core))) args ret))
+  ([[f & fns] args ret]
+     (lazy-seq
+      (when f
+        (if (binding [*out* (proxy [java.io.Writer] []
+                              (write [_])
+                              (close [])
+                              (flush []))]
+              (try
+                (= ret (apply f args))
+                (catch Throwable t)))
+          (cons (:name (meta f)) (findcore fns args ret))
+          (findcore fns args ret))))))
+
+(defmacro fc [args ret]
+  `(findcore '~args '~ret))
+
 ; Configuration
 (set! clojure.core/*print-length* 100)
 (set! clojure.core/*print-level* 5)


Updated deps.

Updated deps.

--- project.clj
+++ project.clj
@@ -22,8 +22,8 @@
     :url "http://www.apache.org/licenses/LICENSE-2.0"}
   :dependencies [
     [cheshire "5.8.1"]
-    [clojusc/trifl "0.3.0"]
-    [clojusc/twig "0.3.3"]
+    [clojusc/trifl "0.4.0"]
+    [clojusc/twig "0.4.0"]
     [gov.nasa.earthdata/cmr-exchange-common "0.2.0-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-jar-plugin "0.1.0-SNAPSHOT"]
     [http-kit "2.3.0"]
@@ -31,7 +31,7 @@
     [org.clojure/clojure "1.9.0"]
     [org.clojure/data.xml "0.2.0-alpha5"]
     [ring/ring-defaults "0.3.2"]
-    [selmer "1.12.1"]
+    [selmer "1.12.2"]
     [tolitius/xml-in "0.1.0"]]
   :profiles {
     :ubercompile {
@@ -39,7 +39,7 @@
       :source-paths ["test"]}
     :security {
       :plugins [
-        [lein-nvd "0.5.4"]]
+        [lein-nvd "0.5.5"]]
       :source-paths ^:replace ["src"]
       :nvd {
         :suppression-file "resources/security/false-positives.xml"}


Bump deps

Bump deps

--- project.clj
+++ project.clj
@@ -8,19 +8,19 @@

   :dependencies [[org.clojure/clojure "1.8.0"]

-                 [com.amazonaws/aws-java-sdk-s3 "1.11.213"] ; s3
-                 [com.amazonaws/aws-java-sdk-sts "1.11.213"] ; s3 with roles
-                 [org.apache.httpcomponents/httpclient "4.5.3"] ; (needed by `aws-java-sdk-s3`)
+                 [com.amazonaws/aws-java-sdk-s3 "1.11.261"] ; s3
+                 [com.amazonaws/aws-java-sdk-sts "1.11.261"] ; s3 with roles
+                 [org.apache.httpcomponents/httpclient "4.5.4"] ; (needed by `aws-java-sdk-s3`)

                  [com.jcraft/jsch "0.1.54"]                 ; sftp
                  [com.jcraft/jzlib "1.1.3"]                 ; (needed by `jsch`)

-                 [org.apache.hadoop/hadoop-common "2.8.1"   ; hdfs
+                 [org.apache.hadoop/hadoop-common "2.8.1"   ; hdfs -- 3.0.0 is there, but doesn't have HTTPS repo
                   :exclusions [org.apache.httpcomponents/httpcore]] ; conflicts with `aws-java-sdk-s3`
                  [org.apache.hadoop/hadoop-hdfs "2.8.1"]

-                 [org.apache.commons/commons-compress "1.14"] ; bzip2, xz
-                 [org.tukaani/xz "1.6"]                     ; xz (needed by `commons-compress`)
+                 [org.apache.commons/commons-compress "1.15"] ; bzip2, xz
+                 [org.tukaani/xz "1.8"]                     ; xz (needed by `commons-compress`)

                  [org.clojure/tools.cli "0.3.5"]]           ; main

@@ -31,7 +31,7 @@
   :javac-options ["-source" "1.8"
                   "-target" "1.8"]

-  :profiles {:dev {:dependencies [[midje "1.8.3"]]
+  :profiles {:dev {:dependencies [[midje "1.9.1"]]
                    :plugins      [[lein-midje "3.2.1"]]}}

   :aot [uio.main.main]
@@ -39,7 +39,7 @@

   :uberjar-name "uio.jar"
   :bin {:name "uio"}
-
+
   :plugins [[lein-bin "0.3.4"]]

   ; A trick to prevent IntelliJ from resetting compiler/module version to "1.5"


bumped up version

bumped up version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject reagent/lein-template "0.4.4"
+(defproject reagent/lein-template "0.4.5"
   :description "A Leiningen template for a ClojureScript setup with Figwheel, Austin, and Reagent."
   :url "https://github.com/reagent-project/reagent-template"
   :license {:name "MIT License"


Switch to Processing 2.1.1

Switch to Processing 2.1.1

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject quil "2.0.0"
+(defproject quil "2.1.0-SNAPSHOT"
   :description "(mix Processing Clojure)"
   :url "http://github.com/quil/quil"
   :mailing-list {:name "Quil Mailing List"
@@ -7,9 +7,9 @@
   :license {:name "Common Public License - v 1.0"
             :url "http://www.opensource.org/licenses/cpl1.0"}
   :dependencies [[org.clojure/clojure "1.5.1"]
-                 [quil/processing-core "2.2.0"]
-                 [quil/processing-pdf "2.2.0"]
-                 [quil/processing-dxf "2.2.0"]
+                 [quil/processing-core "2.2.1"]
+                 [quil/processing-pdf "2.2.1"]
+                 [quil/processing-dxf "2.2.1"]
                  [quil/jogl-all-fat "2.1.5"]
                  [quil/gluegen-rt-fat "2.1.5"]
                  [com.lowagie/itext "2.1.7"]]


Update cljs version

Update cljs version

--- project.clj
+++ project.clj
@@ -2,12 +2,12 @@
   :description "Embedding dialog-based discussions into arbitrary web-contexts"
   :url "https://discuss.cs.uni-duesseldorf.de"
   :license {:name "MIT"
-            :url  "https://choosealicense.com/licenses/mit/"}
+            :url "https://choosealicense.com/licenses/mit/"}

   :min-lein-version "2.5.3"

   :dependencies [[org.clojure/clojure "1.10.1"]
-                 [org.clojure/clojurescript "1.10.520"]
+                 [org.clojure/clojurescript "1.10.597"]
                  [org.clojure/core.async "0.4.500" :exclusions [org.clojure/tools.reader]]
                  [org.clojure/test.check "0.9.0"]
                  [org.clojure/tools.reader "1.3.2"]
@@ -40,9 +40,9 @@
   :clean-targets ^{:protect false} ["resources/public/js/compiled" "target"]

   :aliases {"fig" ["trampoline" "run" "-m" "figwheel.main" "--build" "dev" "--repl"]
-            "fig:test" ["run" "-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "discuss.test-runner"]
-            ;; "fig:test" ["trampoline" "run" "-m" "figwheel.main" "-m" "discuss.test-runner"]
-            }
+            "fig:test" ["run" "-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "discuss.test-runner"]}
+  ;; "fig:test" ["trampoline" "run" "-m" "figwheel.main" "-m" "discuss.test-runner"]
+

   :profiles {:dev {:dependencies [[binaryage/devtools "0.9.10"]
                                   [nrepl "0.6.0"]
@@ -53,28 +53,28 @@
                                   :nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}

   :cljsbuild {:builds
-              [{:id           "min"
+              [{:id "min"
                 :source-paths ["src"]
-                :compiler     {:output-to      "resources/public/js/compiled/discuss.js"
-                               :output-dir     "resources/public/js/compiled/min/out"
-                               :main           discuss.core
-                               :preloads       [discuss.utils.extensions]
-                               :optimizations  :simple
-                               :closure-defines {discuss.config/version ~(->> (slurp "project.clj")
-                                                                              (re-seq #"\".*\"")
-                                                                              (first))
-                                                 discuss.config/build-commit ~(if (.exists (clojure.java.io/as-file ".git/ORIG_HEAD"))
-                                                                                (subs (slurp ".git/ORIG_HEAD") 0 6)
-                                                                                "dev")}
-                               :parallel-build true
-                               :compiler-stats true
-                               :pretty-print   false}}]}
+                :compiler {:output-to "resources/public/js/compiled/discuss.js"
+                           :output-dir "resources/public/js/compiled/min/out"
+                           :main discuss.core
+                           :preloads [discuss.utils.extensions]
+                           :optimizations :simple
+                           :closure-defines {discuss.config/version ~(->> (slurp "project.clj")
+                                                                   (re-seq #"\".*\""
+                                                                       (first)))
+                                             discuss.config/build-commit ~(if (.exists (clojure.java.io/as-file ".git/ORIG_HEAD"))
+                                                                            (subs (slurp ".git/ORIG_HEAD") 0 6)
+                                                                            "dev")}
+                           :parallel-build true
+                           :compiler-stats true
+                           :pretty-print false}}]}
   :figwheel {:nrepl-port 7888
-             :css-dirs ["resources/public/css"]}             ;; watch and update CSS
+             :css-dirs ["resources/public/css"]}            ;; watch and update CSS

   ;; For documentation
-  :codox {:language    :clojurescript
-          :metadata    {:doc/format :markdown}
+  :codox {:language :clojurescript
+          :metadata {:doc/format :markdown}
           :source-paths ["src/discuss"]
           :source-uri "https://gitlab.cs.uni-duesseldorf.de/cn-tsn/project/discuss/blob/master/{filepath}#L{line}"
           :doc-paths ["docs"]


Source maps plz

Source maps plz

--- project.clj
+++ project.clj
@@ -48,7 +48,7 @@
           :figwheel true
           :compiler {:output-to     "resources/public/js/app.js"
                      :output-dir    "resources/public/js/out"
-                     :source-map    "resources/public/js/app.js.map"
+                     :source-map    true
                      :optimizations :none
                      :pretty-print  true}}


Fix support for Java 1.7 :crying_cat_face: :coffee: #2098

--- project.clj
+++ project.clj
@@ -120,7 +120,8 @@
                                        "-Dmb.api.key=test-api-key"
                                        "-Xverify:none"]}              ; disable bytecode verification when running tests so they start slightly faster
              :uberjar {:aot :all
-                       :jvm-opts ["-Dclojure.compiler.elide-meta=[:doc :added :file :line]"]}
+                       :jvm-opts ["-Dclojure.compiler.elide-meta=[:doc :added :file :line]" ; strip out metadata for faster load / smaller uberjar size
+                                  "-Dmanifold.disable-jvm8-primitives=true"]} ; disable Manifold Java 8 primitives (see https://github.com/ztellman/manifold#java-8-extensions)
              :generate-sample-dataset {:dependencies [[faker "0.2.2"]                   ; Fake data generator -- port of Perl/Ruby
                                                       [incanter/incanter-core "1.9.0"]] ; Satistical functions like normal distibutions}})
                                        :source-paths ["sample_dataset"]


Back to snap.

Back to snap.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject thinktopic/think.datatype "0.3.16"
+(defproject thinktopic/think.datatype "0.3.17-SNAPSHOT"
   :description "Library for efficient manipulation of contiguous mutable containers of primitive datatypes."
   :url "http://github.com/thinktopic/think.datatype"
   :license {:name "Eclipse Public License"


Start 1.2.0-SNAPSHOT

Start 1.2.0-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject nightmod "1.1.1"
+(defproject nightmod "1.2.0-SNAPSHOT"
   :description "A tool for making live-moddable games in Clojure"
   :url "https://github.com/oakes/Nightmod"
   :license {:name "Public Domain"


Update dependencies.

Update dependencies.

--- project.clj
+++ project.clj
@@ -18,13 +18,13 @@
     [clj-http "2.0.0"] ; HTTP client https://github.com/dakrone/clj-http
     [clj-json "0.5.3"] ; JSON encoding https://github.com/mmcgrana/clj-json/
     [org.clojure/data.xml "0.1.0-beta1"] ; XML encoding https://github.com/clojure/data.xml
-    [clojure-csv/clojure-csv "2.0.1"] ; CSV encoding https://github.com/davidsantiago/clojure-csv
+    [clojure-csv/clojure-csv "2.0.2"] ; CSV encoding https://github.com/davidsantiago/clojure-csv
     [enlive "1.1.6"] ; HTML templates https://github.com/cgrand/enlive
     [hiccup "1.0.5"] ; HTML generation https://github.com/weavejester/hiccup
     [tinter "0.1.1-SNAPSHOT"] ; color manipulation https://github.com/andypayne/tinter
     [clj-time "0.11.0"] ; DateTime utilities https://github.com/clj-time/clj-time
     ;; Client-side
-    [org.clojure/clojurescript "1.7.189"] ; ClojureScript compiler https://github.com/clojure/clojurescript
+    [org.clojure/clojurescript "1.7.228"] ; ClojureScript compiler https://github.com/clojure/clojurescript
     [jayq "2.5.4"] ; ClojureScript wrapper for jQuery https://github.com/ibdknox/jayq
   ]


Update to KS version 0.6.0

Update to KS version 0.6.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def ks-version "0.5.3")
+(def ks-version "0.6.0")

 (defproject puppetlabs/trapperkeeper "0.3.10-SNAPSHOT"
   :description "We are trapperkeeper.  We are one."


Bump dependencies

Bump dependencies

--- project.clj
+++ project.clj
@@ -7,8 +7,8 @@
   :source-paths ["src/clj" "src/cljs"]

   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
-                 [org.clojure/clojurescript "1.7.122" :scope "provided"]
+                 [org.clojure/core.async "0.2.371"]
+                 [org.clojure/clojurescript "1.7.145" :scope "provided"]
                  [ring-server "0.4.0"]
                  [cljsjs/mustache "1.1.0-0"]
                  [reagent "0.5.1"]
@@ -59,8 +59,8 @@
                    :dependencies [[ring-mock "0.1.5"]
                                   [ring/ring-devel "1.4.0"]
                                   [leiningen-core "2.5.3"]
-                                  [lein-figwheel "0.4.0"]
-                                  [org.clojure/tools.nrepl "0.2.11"]
+                                  [lein-figwheel "0.4.1"]
+                                  [org.clojure/tools.nrepl "0.2.12"]
                                   [pjstadig/humane-test-output "0.7.0"]
                                   [org.clojure/test.check "0.8.2"]]


next snapshot

next snapshot

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.soundcloud/prometheus-clj "2.4.0"
+(defproject com.soundcloud/prometheus-clj "2.4.1-SNAPSHOT"
   :description "Clojure wrappers for the Prometheus java client"
   :url "https://github.com/soundcloud/prometheus-clj"


Set version to 2.1.0.

Set version to 2.1.0.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject funcool/beicon "2.0.0"
+(defproject funcool/beicon "2.1.0"
   :description "Reactive Streams for Clojure(Script)"
   :url "https://github.com/funcool/beicon"
   :license {:name "Public Domain"
@@ -6,7 +6,7 @@

   :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                  [org.clojure/clojurescript "1.9.36" :scope "provided"]
-                 [funcool/promesa "1.2.0" :scope "provided"]
+                 [funcool/promesa "1.3.1" :scope "provided"]
                  [io.reactivex/rxjava "1.1.5"]]

   :deploy-repositories {"releases" :clojars


Remove ExecutionExceptions from cause stack

--- src/adzerk/boot_cljs.clj
+++ src/adzerk/boot_cljs.clj
@@ -10,7 +10,8 @@
             [boot.util :refer [dbug info warn guard]]
             [clojure.java.io :as io]
             [clojure.pprint :as pp]
-            [clojure.string :as string]))
+            [clojure.string :as string])
+  (:import [java.util.concurrent ExecutionException]))

 (def cljs-version "1.7.48")

@@ -216,7 +217,10 @@
               ;; Force realization to start compilation
               futures   (doall (map (partial compile-1 compilers *opts* macro-changes) cljs-edns))
               ;; Wait for all compilations to finish
-              results   (doall (map deref futures))
+              ;; Remove unnecessary layer of cause stack added by futures
+              results   (try (doall (map deref futures))
+                             (catch ExecutionException e
+                               (throw (.getCause e))))
               ;; Since each build has its own :output-dir we don't need to do
               ;; anything special to merge dependency ordering of files across
               ;; builds. Each :output-to js file will depend only on compiled


Update to 0.10.3-alpha1

Update to 0.10.3-alpha1

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject re-frame "0.10.3-SNAPSHOT"
+(defproject re-frame "0.10.3-alpha1"
   :description  "A Clojurescript MVC-like Framework For Writing SPAs Using Reagent."
   :url          "https://github.com/Day8/re-frame.git"
   :license      {:name "MIT"}


Version 0.1.6-SNAPSHOT

Version 0.1.6-SNAPSHOT

--- project.clj
+++ project.clj
@@ -2,7 +2,7 @@
 (def tk-version "1.1.1")
 (def tk-jetty-version "1.4.1")

-(defproject puppetlabs/trapperkeeper-authorization "0.1.5"
+(defproject puppetlabs/trapperkeeper-authorization "0.1.6-SNAPSHOT"
   :description "Trapperkeeper authorization system"
   :url "http://github.com/puppetlabs/trapperkeeper-authorization"
   :license {:name "Apache License, Version 2.0"


(SERVER-2654) Do not test invalid keylength on FIPS

FIPS has just as strict requirements on keylengths as non-FIPS, however
it also goes into an error state that causes all other tests to fail.
These tests consequently pollute the global state for other tests.

Ideally we would validate the keylength before passing them through to
the ssl-util library. However, that would best be done in a
`validate-settings!` and is a refacter we might not want to do at this
time.

--- test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
+++ test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
@@ -3,7 +3,8 @@
                     StringWriter
                     ByteArrayInputStream
                     ByteArrayOutputStream)
-           (java.security InvalidParameterException))
+           (java.security InvalidParameterException)
+           (com.puppetlabs.ssl_utils SSLUtils))
   (:require [puppetlabs.puppetserver.certificate-authority :refer :all]
             [puppetlabs.trapperkeeper.testutils.logging :as logutils]
             [puppetlabs.ssl-utils.core :as utils]
@@ -806,22 +807,23 @@
       (is (utils/public-key? key))
       (is (= 768 (utils/keylength key)))))))

-(deftest initialize-master-ssl!-test-with-incorrect-keylength
-  (let [tmp-confdir (fs/copy-dir confdir (ks/temp-dir))
-        settings (testutils/master-settings tmp-confdir)
-        ca-settings (testutils/ca-settings (str tmp-confdir "/ssl/ca"))]
-
-    (retrieve-ca-cert! (:cacert ca-settings) (:localcacert settings))
-
-    (testing "should throw an error message with too short keylength"
-      (is (thrown?
-           InvalidParameterException
-           (initialize-master-ssl! (assoc settings :keylength 128) "master" ca-settings))))
-
-    (testing "should throw an error message with too large keylength"
-      (is (thrown?
-           InvalidParameterException
-           (initialize-master-ssl! (assoc settings :keylength 32768) "master" ca-settings))))))
+(when-not (SSLUtils/isFIPS)
+  (deftest initialize-master-ssl!-test-with-incorrect-keylength
+    (let [tmp-confdir (fs/copy-dir confdir (ks/temp-dir))
+          settings (testutils/master-settings tmp-confdir)
+          ca-settings (testutils/ca-settings (str tmp-confdir "/ssl/ca"))]
+
+      (retrieve-ca-cert! (:cacert ca-settings) (:localcacert settings))
+
+      (testing "should throw an error message with too short keylength"
+        (is (thrown?
+             IllegalArgumentException
+             (initialize-master-ssl! (assoc settings :keylength 128) "master" ca-settings))))
+
+      (testing "should throw an error message with too large keylength"
+        (is (thrown?
+             IllegalArgumentException
+             (initialize-master-ssl! (assoc settings :keylength 32768) "master" ca-settings)))))))

 (deftest parse-serial-number-test
   (is (= (parse-serial-number "0001") 1))


clean up code a bit

clean up code a bit

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

 (defn abbrev-pprint-map-with-pointer [amap]
   (if-let [abr-level  (-> amap meta :abbrev)]


Make «random-context» an alias for «rand-context»

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -527,6 +527,8 @@
                    (to-set attributes)
                    (fn [_ _] (> fill-rate (rand))))))

+(defalias random-context rand-context)
+
 (defn random-contexts
   "Returns a sequence of number contexts, with random fill rate and random
   size between 0 and upper-limit."


simplify implementation of format middleware a bit

--- src/metabase/middleware/format.clj
+++ src/metabase/middleware/format.clj
@@ -21,10 +21,10 @@

 (defn- type-key
   [obj]
-  (if (coll? obj) (if (map? obj) :map
-                      :coll)
-      (if (= (type obj) org.h2.jdbc.JdbcClob) :jdbc-clob
-          :obj)))
+  (cond (map? obj) :map
+        (coll? obj) :coll
+        (= (type obj) org.h2.jdbc.JdbcClob) :jdbc-clob
+        :else :obj))

 (defn- -format-response [obj]
   (case (type-key obj)


don't trampoline if readline isn't required

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -57,7 +57,7 @@

 (defn- run-local-project [project paths-to-add requires form]
   (let [project' (cond-> project
-                   (not (false? (get-in project [:figwheel :readline])))
+                   (get-in project [:figwheel :readline] true)
                    (update-in [:dependencies] conj ['rebel-readline-cljs rebel-readline-cljs-version])
                    :finally
                    (->
@@ -538,7 +538,8 @@
         (if (and
              (or (= nil command)
                  (= ":reactor" command))
-             (get-in project [:figwheel :repl] true))
+             (get-in project [:figwheel :repl] true)
+             (get-in project [:figwheel :readline] true))
           (if tramp/*trampoline?*
             (launch-figwheel command project build-ids)
             (apply tramp/trampoline project "figwheel" command-and-or-build-ids))


take port from command line

take port from command line

--- src/block_chain/core.clj
+++ src/block_chain/core.clj
@@ -11,10 +11,10 @@
     (repl/stop-server @repl-server))
   (reset! repl-server (repl/start-server :port 7888)))

-(defn start! []
+(defn start! [& args]
   (println "****** Starting Clarke Coin *******")
   (miner/run-miner!)
-  (http/start! 3000)
+  (http/start! (Integer. (or (first args) "3000")))
   (start-repl!))

 (defn stop! []
@@ -24,7 +24,8 @@
   (repl/stop-server @repl-server))

 (defn -main [& args]
-  (start!)
+  (println "STARTING WITH ARGS: " args)
+  (apply start! args)
   (.addShutdownHook
    (Runtime/getRuntime)
    (Thread. stop!))


Remove `cats.labs.sugar` ns and the corresponding file.

--- src/cats/labs/sugar.cljc
+++ src/cats/labs/sugar.cljc
@@ -1,177 +0,0 @@
-;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.nz>
-;; Copyright (c) 2014-2015 Alejandro Gómez <alejandro@dialelo.com>
-;; All rights reserved.
-;;
-;; Redistribution and use in source and binary forms, with or without
-;; modification, are permitted provided that the following conditions
-;; are met:
-;;
-;; 1. Redistributions of source code must retain the above copyright
-;;    notice, this list of conditions and the following disclaimer.
-;; 2. Redistributions in binary form must reproduce the above copyright
-;;    notice, this list of conditions and the following disclaimer in the
-;;    documentation and/or other materials provided with the distribution.
-;;
-;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-(ns cats.labs.sugar
-  "Experimental syntax sugar for core abstractions. Sugar that
-   proves its worthiness will graduate to the cats.core namespace."
-  (:require [cats.core :as m]))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; applicative "idiomatic apply"
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defmacro ap
-  "Apply a pure function to applicative arguments, e.g.
-
-   (ap + (just 1) (just 2) (just 3))
-   ;; => #<Just [6]>
-   (ap str [\"hi\" \"lo\"] [\"bye\" \"woah\" \"hey\"])
-   ;; => [\"hibye\" \"hiwoah\" \"hihey\"
-          \"lobye\" \"lowoah\" \"lohey\"]
-
-   `ap` is essentially sugar for `(apply fapply (pure f) args)`,
-   but for the common case where you have a pure, uncurried,
-   possibly variadic function.
-
-   `ap` actually desugars in `alet` form:
-
-   (macroexpand-1 `(ap + (just 1) (just2)))
-   ;; => (alet [a1 (just 1) a2 (just 2)] (+ a1 a2))
-
-   That way, variadic functions Just Work, without needing to specify
-   an arity separately.
-
-   If you're familiar with Haskell, this is closest to writing
-   \"in Applicative style\": you can straightforwardly convert
-   pure function application to effectful application by with
-   some light syntax (<$> and <*> in case of Haskell, and `ap` here).
-
-   See the original Applicative paper for more inspiration:
-   http://staff.city.ac.uk/~ross/papers/Applicative.pdf"
-  [f & args]
-  (let [syms (repeatedly (count args) (partial gensym "arg"))]
-    `(m/alet [~@(interleave syms args)]
-        (~f ~@syms))))
-
-(defmacro ap->
-  "Thread like `->`, within an applicative idiom.
-
-  Compare:
-
-  (macroexpand-1 `(-> a b c (d e f)))
-  => (d (c (b a) e f)
-
-  with:
-
-  (macroexpand-1 `(ap-> a b c (d e f))
-  => (ap d (ap c (ap b a) e f))
-  "
-  [x & forms]
-  (loop [x x, forms forms]
-    (if forms
-      (let [form (first forms)
-            threaded (if (seq? form)
-                       (with-meta `(ap ~(first form) ~x ~@(next form)) (meta form))
-                       `(ap ~form ~x))]
-        (recur threaded (next forms)))
-      x)))
-
-(defmacro ap->>
-  "Thread like `->>`, within an applicative idiom.
-   See `cats.labs.sugar/ap->` for more in-depth discussion."
-  [x & forms]
-  (loop [x x, forms forms]
-    (if forms
-      (let [form (first forms)
-            threaded (if (seq? form)
-                       (with-meta `(ap ~(first form) ~@(next form)  ~x) (meta form))
-                       `(ap ~form ~x))]
-        (recur threaded (next forms)))
-      x)))
-
-(defmacro as-ap->
-  "Thread like `as->`, within an applicative idiom.
-   See `cats.labs.sugar/ap->` for more in-depth discussion."
-  [expr name & forms]
-  `(let [~name ~expr
-         ~@(interleave (repeat name) (for [form forms] `(ap ~@form)))]
-     ~name))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Monadic arrow macros.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defmacro ->=
-  "Like `->`, but with monadic binding instead of pure application.
-   A mnemonic for the name is a pun on `>>=`, the monadic bind operator,
-   and clojure's regular arrow macros.
-
-   You can think of it as generalizing the `some->` thread macro
-   to all Monads instead of just Maybe.
-
-   Alternatively, if you think of the regular thread macro as
-   sugar for `let`:
-
-   (-> :a b (c (other args)) d)
-   =>
-   (let [res (b :a)
-         res (c res (other args))
-         res (d res)]
-     res)
-
-   Then `->=` is sugar for cats.core/mlet:
-
-   (->= m-a b (c (other args)) d)
-   (mlet [res m-a
-          res (c res (other args))
-          res (d res)]
-     (return res))
-
-   Note that extra args in this context are assumed pure, and will
-   be evaluated along with the function itself; this also matches
-   the behavior of `some->` wrt extra args.
-
-   Threading through pure functions is somewhat awkward, but can be done:
-
-   (->= m-a
-        monadic-fn
-        (-> pure-fn
-            other-pure-fn
-            m/return)
-        other-monadic-fn)"
-  [expr & forms]
-  (let [g (gensym)
-        pstep (fn [step] `(-> ~g ~step))]
-    `(m/mlet [~g ~expr
-              ~@(interleave (repeat g) (map pstep forms))]
-           (m/return ~g))))
-
-(defmacro ->>=
-  "Like ->>, but with monadic binding instead of pure application.
-   See `cats.labs.sugar/->=` for more in-depth discussion."
-  [expr & forms]
-  (let [g (gensym)
-        pstep (fn [step] `(->> ~g ~step))]
-    `(m/mlet [~g ~expr
-              ~@(interleave (repeat g) (map pstep forms))]
-           (m/return ~g))))
-
-(defmacro as->=
-  "Like `as->`, but with monadic binding instead of pure application.
-   See `cats.labs.sugar/->=` for more in-depth discussion."
-  [expr name & forms]
-  `(m/mlet [~name ~expr
-            ~@(interleave (repeat name) forms)]
-     (m/return ~name)))


add oauth lib ref

add oauth lib ref

--- hackersome-web/project.clj
+++ hackersome-web/project.clj
@@ -12,6 +12,7 @@
                     [com.draines/postal "1.11.2"]
                     [me.raynes/fs "1.4.4"]
                     [clojurewerkz/cassaforte "2.0.0-beta8"]
+                    [clj-oauth "1.5.1"]
                     [hiccup "1.0.5"]
                     [liberator "0.12.2"]
                     [clj-time "0.7.0"]


Comment.

Comment.

--- src/oc/storage/api/entry_point.clj
+++ src/oc/storage/api/entry_point.clj
@@ -33,9 +33,9 @@
         org-uuids (set (map :uuid authed-orgs))
         org-slugs (set (map :slug authed-orgs)) ; set of the org slugs for this user
         requested-org-slug (get-in request [:params "requested"]) ; a public org may be requested specifically
-        check-for-public? (and (slugify/valid-slug? requested-org-slug)
-                               (not (or (org-uuids requested-org-slug)
-                                        (org-slugs requested-org-slug)))) ; requested and not in the list
+        check-for-public? (and (slugify/valid-slug? requested-org-slug)   ; it's a valid slug
+                               (not (or (org-uuids requested-org-slug)    ; and the requested string is or a valud uuid
+                                        (org-slugs requested-org-slug)))) ; or a valid slug of an org the user has access to
         public-org (when check-for-public? (org-if-public-boards conn requested-org-slug)) ; requested org if public
         orgs (if public-org (conj authed-orgs public-org) authed-orgs)] ; final set of orgs
     (org-rep/render-org-list orgs user)))


Fix setting URL in Firefox

Fix setting URL in Firefox

I'm actually not sure why it was broken in Firefox in the first place.
It seemed to add two items to the history, the correct url and "/#",
every time. I played with it bunch and still couldn't figure it out, so
I added this horrible hack to work around the problem. :)

--- src/clj/zetawar/app.cljs
+++ src/clj/zetawar/app.cljs
@@ -116,4 +116,10 @@
   (let [encoded-game-state (->> (current-game db)
                                 (game/get-game-state db)
                                 encode-game-state)]
+    ;; TODO: figure out why this horrible hack is necessary in Firefox
+    (set! js/window.onhashchange
+          (fn []
+            (when (not= encoded-game-state js/window.location.hash)
+              (set! js/window.location.hash encoded-game-state))
+            (set! js/window.onhashchange nil)))
     (set! js/window.location.hash encoded-game-state)))


Add marks to private fn

Add marks to private fn

--- src/cljam/bam/reader.clj
+++ src/cljam/bam/reader.clj
@@ -153,7 +153,7 @@
                 (recur (rest left)))))
           (recur (rest left-spans)))))))

-(defn read-alignments*
+(defn- read-alignments*
   [^BAMReader rdr
    ^String chr ^Long start ^Long end
    deep-or-shallow]
@@ -183,7 +183,7 @@
       (read-alignments-first-only rdr spans window read-fn)
       (filter window candidates))))

-(defn read-alignments-sequentially*
+(defn- read-alignments-sequentially*
   [^BAMReader rdr deep-or-shallow]
   (let [read-aln-fn (case deep-or-shallow
                       :shallow light-read-alignment
@@ -196,7 +196,7 @@
                     (cons a (lazy-seq (read-fn* r refs)))))]
     (read-fn rdr (.refs rdr))))

-(defn read-blocks-sequentially*
+(defn- read-blocks-sequentially*
   [^BAMReader rdr mode]
   (let [read-block-fn (case mode
                         :normal read-alignment-block
@@ -208,7 +208,7 @@
                     (cons b (lazy-seq (read-fn* r refs)))))]
     (read-fn rdr (.refs rdr))))

-(defn read-blocks*
+(defn- read-blocks*
   [^BAMReader rdr
    ^String chr ^Long start ^Long end]
   (when (nil? @(.index-delay rdr))


tested in the REPL cuz that's how I roll

--- src/cljs/bmihw/core.cljs
+++ src/cljs/bmihw/core.cljs
@@ -27,7 +27,7 @@
 ;; Views
 (defn home-page []
   [:div [:h2 "Welcome to bmihw"]
-   [:input {:type "button" :value "Auth me!"
+   [:input {:type "button" :value "Login"
             :on-click #(auth-twitter)}]
    [:div @stuff]
    [:div [:a {:href "#/about"} "go to about page"]]])


Ajax loading of games and basic display

Ajax loading of games and basic display

--- src/cljs/darts/core.cljs
+++ src/cljs/darts/core.cljs
@@ -144,9 +144,7 @@
      [:button {:on-click (fn []
                            (POST "/save-game" {:params {:game @game}
                                                :format :json}))}
-      "Save"]]
-    )
-  )
+      "Save"]]))

 (defn play-page []
   (if (game-in-progress?)
@@ -254,19 +252,56 @@
     [:li [:a {:href "#/new-game"} "New match"]]
     [:li [:a {:href "#/standings"} "Standings"]]]])

-(def matches (atom #{}))
-
-(defn load-matches []
-  (GET "/list-matches"
-       {:handler (fn [res]
-                   (->> res
-                        (t/read (t/reader :json))
-                        (walk/keywordize-keys)
-                        (reset! matches)))}))
+(def matches (atom nil))
+
+(defn standings-component []
+  [:div
+   (println @matches)
+   [:div "Hello"]])
+
+(defn winning-player [{:keys [starting-score] :as match}]
+  (let [score-0 (reduce + 0 (:rounds (:p0 match)))]
+    (if (= starting-score score-0)
+      0
+      1)))
+
+(defn averages [match]
+  (let [rounds-0 (:rounds (:p0 match))
+        rounds-1 (:rounds (:p1 match))
+        average-0 (/ (reduce + 0 rounds-0)
+                     (count rounds-0))
+        average-1 (/ (reduce + 0 rounds-1)
+                     (count rounds-1))
+]
+    [average-0 average-1]))
+
+(defn render-match [match]
+  (str (:name (:p0 match))
+       " v. "
+       (:name (:p1 match))
+       (if (= 0 (winning-player match))
+         " 1 - 0 "
+         " 0 - 1 ")
+       "(avg. " (clojure.string/join ", " (averages match)) ")"))
+
+(defn render-matches [ms]
+  (when ms
+    (into [:ul]
+     (map-indexed (fn [i m] ^{:key i}
+                    [:li (render-match m)])
+          ms)))
+  )

 (defn standings-page []
-  #_(load-matches)
-  #_(println @matches))
+  (let [get-stuff #(GET "/list-matches"
+                        {:handler (fn [r]
+                                    (->> r
+                                         (t/read (t/reader :json))
+                                         (walk/keywordize-keys)
+                                         (reset! matches)))})]
+    (get-stuff)
+    (fn []
+      (render-matches @matches))))

 (defn current-page []
   [:div [(session/get :current-page)]])


Switch own random-string to goog getRandomString

--- src/cljs/klang/core.cljs
+++ src/cljs/klang/core.cljs
@@ -12,6 +12,7 @@
                             tap close! pub sub timeout take!]]
    ;; Google Closure
    [goog.dom :as dom]
+   [goog.string :as gstring]
    [goog.style :as gstyle])
   (:import
    goog.date.DateTime
@@ -175,20 +176,7 @@
   (or (= c p)
       (parent? p c)))

-;; TODO: Just use a simple counter instead
-;; OR use goog.string.getRandomString
-(defn make-random-uuid
-  " Returns pseudo randomly generated UUID,
-  like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
-  []
-  (letfn [(f [] (.toString (rand-int 16) 16))
-          (g [] (.toString  (bit-or 0x8 (bit-and 0x3 (rand-int 15))) 16))]
-    (clojure.string/join (concat
-                          (repeatedly 8 f) "-"
-                          (repeatedly 4 f) "-4"
-                          (repeatedly 3 f) "-"
-                          (g) (repeatedly 3 f) "-"
-                          (repeatedly 12 f)))))
+(def random-uuid gstring/getRandomString)

 (defn time-formatter
   [time]
@@ -205,7 +193,7 @@
   [msg]
   (if (:uuid msg)
     msg
-    (assoc msg :uuid (make-random-uuid))))
+    (assoc msg :uuid (random-uuid))))

 (defn ensure-msg-vec
   "Ensures the :msg is a vector. Can happen that it's not if raw-log was called"
@@ -908,7 +896,7 @@
   [db pred? which color]
   {:pre [(keyword? which) (or (= :ns which) (= :type which))]}
   (register-transducer!
-   db (keyword (make-random-uuid))
+   db (keyword (random-uuid))
    (map
     (fn [msg]
       (if (pred? (which msg)) ;; pluck out :ns or :type


Debug

Debug

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -404,7 +404,7 @@
                 1.0)
               (= cat :favoritism)
               (if (and (:parent1-genome ind) (:parent2-genome ind))
-                (Math/abs (- (sequence-similarity (:genome ind) (:parent1-genome ind))
+                (math/abs (- (sequence-similarity (:genome ind) (:parent1-genome ind))
                              (sequence-similarity (:genome ind) (:parent2-genome ind))))
                 1.0)
               ;


fix a bug

fix a bug

--- src/codeitlater/core.clj
+++ src/codeitlater/core.clj
@@ -6,7 +6,7 @@
 (def testKeyword "TODO") ; using keyword to filter which is which

 (defn make-pattern [commentMark]
-  (re-pattern (str commentMark ".+")))
+  (re-pattern (str "[^\"]" commentMark ".+")))

 (defn read-comments-inline [pattern line]
   (let [result (re-find pattern line)]
@@ -56,6 +56,5 @@

 (defn -main [& args]
   (println args)
-  (println (read-comments-inline (make-pattern testMark) "aaa//test"))
   (println (read-files (partial read-comments-inline (make-pattern ";")) "./src" "clj" ""))
 )


More on atoms.

More on atoms.

--- test/com/nomistech/clojure_the_language/intro_to_state.clj
+++ test/com/nomistech/clojure_the_language/intro_to_state.clj
@@ -107,7 +107,7 @@

 (def competing-updates-atom (atom 0))

-(def n-competitors 100)
+(def n-competitors 1000)

 (defn demo-competition-to-modify-atom []
   (let [n-attempts-atom (atom 0)]
@@ -117,7 +117,7 @@
                                    (swap! competing-updates-atom
                                           (fn [n]
                                             (swap! n-attempts-atom inc)
-                                            (Thread/sleep (rand-int 200))
+                                            (Thread/sleep (rand-int 100))
                                             (inc n))))))))
             (report-on-what-is-happenning []
               (loop []


Change some doall map to doseq.

Change some doall map to doseq.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -831,10 +831,10 @@
                                        :chromEnd (a-probe :chromEnd)
                                        :strand (a-probe :strand)})))
     (p :probemap-insert-genes
-       (dorun (map #(insert probe_gene (values {:probemap_id pmid ; XXX doseq?
-                                                :probe_id pmp
-                                                :gene %}))
-                   (a-probe :genes))))))
+       (doseq [gene (a-probe :genes)]
+         (insert probe_gene (values {:probemap_id pmid
+                                     :probe_id pmp
+                                     :gene gene}))))))

 ; kdb/transaction will create a closure of our parameters,
 ; so we can't pass in the matrix seq w/o blowing the heap. We
@@ -860,7 +860,8 @@
               (load-related-sources
                 probemap_source :probemap_id pmid files))
            (p :probemap-probes
-              (dorun (map add-probe probes))))))))) ; XXX change to doseq?
+              (doseq [probe probes]
+                (add-probe probe)))))))))

 (defn create-db [file & [{:keys [classname subprotocol delimiters make-pool?]
                           :or {classname "org.h2.Driver"
@@ -878,7 +879,8 @@

 ; execute a sequence of sql statements
 (defn- exec-statements [stmts]
-  (dorun (map exec-raw stmts))) ; XXX doseq
+  (doseq [s stmts]
+    (exec-raw s)))

 (defn run-query [q]
   ; XXX should sanitize the query


update PAX Token

update PAX Token

Signed-off-by: Churikova Tetiana <df59d4ef10565572befc1f25db27f19bd387b29a@gmail.com>

--- src/status_im/ethereum/tokens.cljs
+++ src/status_im/ethereum/tokens.cljs
@@ -526,8 +526,8 @@
                     :name     "Numeraire"}
                    {:address  "0x8E870D67F660D95d5be530380D0eC0bd388289E1"
                     :decimals 18
-                    :symbol   :PAX
-                    :name     "Paxos Standard"}
+                    :symbol   :USDP
+                    :name     "Pax Dollar"}
                    {:address  "0xEA26c4aC16D4a5A106820BC8AEE85fd0b7b2b664"
                     :decimals 18
                     :symbol   :QKC


Remove swearing

Remove swearing

--- src/engulf/comm/netchan.clj
+++ src/engulf/comm/netchan.clj
@@ -41,8 +41,6 @@
   [msg]
   (to-buf-seq (encode-msg msg)))

-(println "WTF\n")
-
 (defn formatted-channel
   "Takes a channel from a tcp server or client, and returns a new channel that automatically
    decodes and encodes values"


Update core.clj

Update core.clj

--- src/hasta_la_vista/core.clj
+++ src/hasta_la_vista/core.clj
@@ -126,7 +126,7 @@

   There is a query parameter that can be passed: stale
   <quote>If stale=ok is set, Couchbase will not refresh the view even if it
-  is stale. The benefit of this   is a an improved query latency. If stale=update_after is set,
+  is stale. The benefit of this is improved query latency. If stale=update_after is set,
   Couchbase will update the view after the stale result is returned. If stale=false is set,
   Couchbase will refresh the view and return you most updated results.<quote>


Make save uploads occur in seperate thread, and fix it

--- src/robinson/update.clj
+++ src/robinson/update.clj
@@ -2595,28 +2595,35 @@
             (update-quests)
             (arg-when-> [state] (contains? (-> state :world :player :status) :dead)
               ((fn [state]
-                 (let [devmode false]
-                   ;; if UPLOADVERSION file is present, upload save/world.edn as json to aaron-santos.com:8888/upload
-                   (when (or (.exists (io/file "config/.feedbackparticipant"))
-                             devmode)
-                     (when (not (.exists (io/file "config/.userid")))
-                       (spit "config/.userid" (doto (java.util.UUID/randomUUID)
-                                                    (.toString))))
-                     (let [version (if devmode "SNAPSHOT"  (slurp "VERSION"))
-                           userid  (slurp "config/.userid")
-                           url     (format "http://aaron-santos.com:3000/saves/%s" userid)
-                           body    (as-> (get state :world) world
-                                         (assoc world :version version)
-                                         (clojure.walk/postwalk (fn [v] (if (char? v)
-                                                                          (str v)
-                                                                          v))
-                                                                 world)
-                                         (json/write-str world))]
-                       (System/setProperty "https.protocols" "TLSv1,TLSv1.1,TLSv1.2")
-                       (http/post url
-                         {:insecure? true
-                          :body body
-                          :content-type :json}))))
+                 ;; if UPLOADVERSION file is present, upload save/world.edn as json to aaron-santos.com:8888/upload
+                 (when (.exists (io/file "config/.feedbackparticipant"))
+                   (when (not (.exists (io/file "config/.userid")))
+                     (spit "config/.userid" (doto (java.util.UUID/randomUUID)
+                                                  (.toString))))
+                   (let [version (if (.exists (io/file "VERSION"))
+                                   (slurp "VERSION")
+                                   "SNAPSHOT")
+                         userid  (slurp "config/.userid")
+                         url     (format "https://aaron-santos.com/saves/%s" userid)
+                         body    (as-> (get state :world) world
+                                       (assoc world :version version)
+                                       (clojure.walk/postwalk (fn [v] (if (char? v)
+                                                                        (str v)
+                                                                        v))
+                                                               world)
+                                       (json/write-str world))]
+                     (info "Uploading save file version" version "userid" userid "to" url)
+                     (async/thread
+                       (try
+                         (info "Starting upload")
+                         (System/setProperty "https.protocols" "TLSv1.2")
+                         (http/post url
+                           {:insecure? true
+                            :body body
+                            :content-type :json})
+                         (info "Done uploading save file")
+                         (catch Exception e
+                           (error "Caught exception while uploading save" e))))))
                  (doseq [file (filter (fn [file] (re-matches #".*edn" (.getName file))) (file-seq (io/file "save")))]
                    (.delete file))
                 state))


Fix escape packet when writing

Fix escape packet when writing

--- src/robip_up/esprom.clj
+++ src/robip_up/esprom.clj
@@ -110,15 +110,26 @@
 (defn bytes-append [a b]
   (byte-array (concat (seq a) (seq b))))

-(defn print-data [label & data]
+(defn print-data [label data]
   (doseq [x data]
-    (println (apply str (map #(format "%x  " %) (seq (serial/to-bytes x)))))))
+    (println (apply str (map #(format "%x " %) (seq (serial/to-bytes x))))))
+  (println))

 (defn- write [{:keys [port] :as esp} packet]
-  (serial/write port [0xc0] packet [0xc0]))
+  (let [buffer (apply concat
+                      [[0xc0]
+                       (map (fn [x]
+                              (condp = (byte->unsigned x)
+                                0xdb [0xdb 0xdd]
+                                0xc0 [0xdb 0xdc]
+                                [x]))
+                                packet)
+                       [0xc0]])]
+    #(print-data :write buffer)
+    (apply serial/write (cons port buffer))))

 (defn- command [esp & [op data chk]]
-  (println "command" op (count data) chk (count data))
+  (println "command" op (count data) chk)
   (if op
     (let [packet (concat (pack "bbsi" 0, op, (count data), (or chk 0))
                          data)]


Record the schema for changed records

Record the schema for changed records

We need this for AppShare as each app will have its own database schema

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -883,6 +883,7 @@
           (
           id                  serial NOT NULL,
           record_timestamp    timestamp(3),
+          record_table_schema character varying,
           record_table_name   character varying,
           record_id           character varying,
           record_id_type      character varying,
@@ -896,6 +897,7 @@
           (
           id                  NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
           record_timestamp    TIMESTAMP,
+          record_table_schema VARCHAR2(200 BYTE),
           record_table_name   VARCHAR2(200 BYTE),
           record_id           VARCHAR2(200 BYTE),
           record_id_type      VARCHAR2(200 BYTE),
@@ -939,9 +941,9 @@
         $BODY$
         BEGIN
         INSERT INTO appshare_realtime_log
-        (record_timestamp,  record_table_name,  record_id, record_id_type, record_operation)
+        (record_timestamp,  record_table_schema, record_table_name,  record_id, record_id_type, record_operation)
         VALUES
-        ( now(),   TG_TABLE_NAME ,  NEW.id,
+        ( now(),   TG_TABLE_SCHEMA , TG_TABLE_NAME ,  NEW.id,
         (select data_type from information_schema.columns where column_name='id' and table_name = TG_TABLE_NAME),
         'INSERT');
         RETURN NULL;
@@ -987,9 +989,9 @@
         $BODY$
         BEGIN
         INSERT INTO appshare_realtime_log
-        (record_timestamp,  record_table_name,  record_id, record_id_type,  record_operation)
+        (record_timestamp,  record_table_schema, record_table_name,  record_id, record_id_type,  record_operation)
         VALUES
-        ( now(),   TG_TABLE_NAME ,  NEW.id,
+        ( now(),   TG_TABLE_SCHEMA ,TG_TABLE_NAME ,  NEW.id,
         (select data_type from information_schema.columns where column_name='id' and table_name = TG_TABLE_NAME),
         'UPDATE');
         RETURN NULL;
@@ -1031,9 +1033,9 @@
         $BODY$
         BEGIN
         INSERT INTO appshare_realtime_log
-        (record_timestamp,  record_table_name,  record_id, record_id_type,  record_operation)
+        (record_timestamp,  record_table_schema, record_table_name,  record_id, record_id_type,  record_operation)
         VALUES
-        ( now(),   TG_TABLE_NAME ,  OLD.id,
+        ( now(),   TG_TABLE_SCHEMA, TG_TABLE_NAME ,  OLD.id,
         (select data_type from information_schema.columns where column_name='id' and table_name = TG_TABLE_NAME),
         'DELETE');
         RETURN NULL;


Partially revert lifecycle update

Partially revert lifecycle update

--- re_view/src/re_view/core.cljs
+++ re_view/src/re_view/core.cljs
@@ -54,8 +54,6 @@
                                                  (d/listen patterns #(force-update this))))
           (vswap! re$view assoc :view/re-db.patterns patterns))
         value))))
-
-

 (def ^:private kmap
   "Mapping of methods-map keys to React lifecycle keys."
@@ -90,16 +88,16 @@
                                                          (last fns)
                                                          (apply compseq fns))))) methods methods)))

-(defn finish-lifecycle
-  "After a component has updated, or after :should-update has returned false, set prev-props and prev-state to the current props and state,
-  prepared for the next lifecycle."
-  [component]
-  (let [re$view (aget component "re$view")
+(defn finish-lifecycle [this]
+  "after update, update prev-props and prev-state"
+  (let [re$view (aget this "re$view")
         {prev-props :view/props
          state      :view/state
          children   :view/children} @re$view]
     (vreset! re$view
-             (cond-> (assoc @re$view :view/prev-props prev-props :view/prev-children children)
+             (cond-> (assoc @re$view
+                       :view/prev-props prev-props
+                       :view/prev-children children)
                      state (assoc :view/prev-state @state)))))

 (defn- wrap-methods
@@ -131,12 +129,6 @@
       (fn []
         (this-as this
           (apply f this (:view/children @(gobj/get this "re$view")))))
-      :view/should-update
-      (fn [& args]
-        (this-as this
-          (let [result (apply f this args)]
-            (when-not result (finish-lifecycle this))
-            result)))
       (fn [& args]
         (this-as this
           (apply f this args))))))
@@ -184,10 +176,14 @@
   [methods]
   (->> (collect [{:view/will-receive-props (fn [this props]
                                              ;; when a component receives new props, update internal state.
-                                             (let [next-props (aget props "props")]
-                                               (vswap! (gobj/get this "re$view") assoc
-                                                       :view/props next-props
-                                                       :view/children (aget props "children"))))
+                                             (let [{prev-props :view/props prev-children :view/children :as this} this]
+                                               (let [next-props (aget props "props")]
+                                                 (vswap! (gobj/get this "re$view")
+                                                         assoc
+                                                         :view/props next-props
+                                                         :view/prev-props prev-props
+                                                         :view/children (aget props "children")
+                                                         :view/prev-children prev-children))))
                   :view/should-update      (fn [{:keys [view/props
                                                         view/prev-props
                                                         view/children
@@ -207,14 +203,10 @@
                                        (when-let [un-sub (aget this "reactiveUnsubscribe")]
                                          (un-sub))
                                        (some-> state (remove-watch this)))
-                  :view/did-update   (fn [this]
-                                       ;; after update, update prev-props and prev-state
-                                       (finish-lifecycle this))}])
+                  :view/did-update   finish-lifecycle}])
        (reduce-kv (fn [obj method-k method]
                     (doto obj
                       (gobj/set (get kmap method-k) (wrap-methods method-k method)))) #js {})))
-
-

 (defn swap-silently!
   "Swap a component's state atom without forcing an update (render)"


corrected the tag mappings in espa.clj, making all swir tags read swir1 to match OLI

--- src/lcmap/aardvark/espa.clj
+++ src/lcmap/aardvark/espa.clj
@@ -15,7 +15,7 @@
    "LANDSAT_4/TM/sr_band2"         #{"green"}
    "LANDSAT_4/TM/sr_band3"         #{"red"}
    "LANDSAT_4/TM/sr_band4"         #{"nir"}
-   "LANDSAT_4/TM/sr_band5"         #{"swir"}
+   "LANDSAT_4/TM/sr_band5"         #{"swir1"}
    "LANDSAT_4/TM/sr_band6"         #{"thermal"}
    "LANDSAT_4/TM/sr_band7"         #{"swir2"}
    "LANDSAT_4/TM/cfmask"           #{"qa"}
@@ -23,7 +23,7 @@
    "LANDSAT_5/TM/sr_band2"         #{"green"}
    "LANDSAT_5/TM/sr_band3"         #{"red"}
    "LANDSAT_5/TM/sr_band4"         #{"nir"}
-   "LANDSAT_5/TM/sr_band5"         #{"swir"}
+   "LANDSAT_5/TM/sr_band5"         #{"swir1"}
    "LANDSAT_5/TM/sr_band6"         #{"thermal"}
    "LANDSAT_5/TM/sr_band7"         #{"swir2"}
    "LANDSAT_5/TM/cfmask"           #{"qa"}
@@ -31,7 +31,7 @@
    "LANDSAT_7/ETM/sr_band2"        #{"green"}
    "LANDSAT_7/ETM/sr_band3"        #{"red"}
    "LANDSAT_7/ETM/sr_band4"        #{"nir"}
-   "LANDSAT_7/ETM/sr_band5"        #{"swir"}
+   "LANDSAT_7/ETM/sr_band5"        #{"swir1"}
    "LANDSAT_7/ETM/sr_band6"        #{"thermal"}
    "LANDSAT_7/ETM/sr_band7"        #{"swir2"}
    "LANDSAT_7/ETM/cfmask"          #{"qa"}
@@ -51,21 +51,21 @@
    "LANDSAT_4/TM/toa_band2"        #{"green"}
    "LANDSAT_4/TM/toa_band3"        #{"red"}
    "LANDSAT_4/TM/toa_band4"        #{"nir"}
-   "LANDSAT_4/TM/toa_band5"        #{"swir"}
+   "LANDSAT_4/TM/toa_band5"        #{"swir1"}
    "LANDSAT_4/TM/toa_band6"        #{"thermal"}
    "LANDSAT_4/TM/toa_band7"        #{"swir2"}
    "LANDSAT_5/TM/toa_band1"        #{"blue"}
    "LANDSAT_5/TM/toa_band2"        #{"green"}
    "LANDSAT_5/TM/toa_band3"        #{"red"}
    "LANDSAT_5/TM/toa_band4"        #{"nir"}
-   "LANDSAT_5/TM/toa_band5"        #{"swir"}
+   "LANDSAT_5/TM/toa_band5"        #{"swir1"}
    "LANDSAT_5/TM/toa_band6"        #{"thermal"}
    "LANDSAT_5/TM/toa_band7"        #{"swir2"}
    "LANDSAT_7/ETM/toa_band1"       #{"blue"}
    "LANDSAT_7/ETM/toa_band2"       #{"green"}
    "LANDSAT_7/ETM/toa_band3"       #{"red"}
    "LANDSAT_7/ETM/toa_band4"       #{"nir"}
-   "LANDSAT_7/ETM/toa_band5"       #{"swir"}
+   "LANDSAT_7/ETM/toa_band5"       #{"swir1"}
    "LANDSAT_7/ETM/toa_band6"       #{"thermal"}
    "LANDSAT_7/ETM/toa_band7"       #{"swir2"}
    "LANDSAT_8/OLI_TIRS/toa_band1"  #{"coastal" "aerosol" "plurpal"}


write-problem-* functions fixed

write-problem-* functions fixed

--- src/leiningen/fore_prob.clj
+++ src/leiningen/fore_prob.clj
@@ -110,17 +110,17 @@
         (str existing-tests
              (mk-template
                (cons "\n\n" test-template)
-               {:prob-fn prob
+               {:prob-fn (prob->fn prob)
                 :tests (expand-prob-tests prob)}))))

 (defn- write-problem-src
-  "add a function for a given problem in the current project"
+  "add a given problem function in the current project"
   [project prob]
   (spit (src-path project)
         (mk-template
           (cons "\n\n" solution-template)
-          {:prob-fn prob
-           :description (-> project :description desc->comments)})
+          {:prob-fn (prob->fn prob)
+           :description (-> prob :description desc->comments)})
         :append true))

 (defn- write-prob


Load entire BL games list in raw form

Load entire BL games list in raw form

--- src/steamtools/core.clj
+++ src/steamtools/core.clj
@@ -34,21 +34,37 @@
       (:cookies response)
       nil)))

-(defn- bl-username [cookies] ((cookies "c_user") :value))
+(defn- bl-more-games
+  [cookies user params]
+  (let [params (conj params
+                     {"user" user
+                      "console" "" "rating" "" "status" "" "unplayed" "" "own" "" "search" ""
+                      "comments" "" "region" "" "region_u" "0" "wish" "" "alpha" ""})
+        response (http/get "http://backloggery.com/ajax_moregames.php"
+                           {:cookies cookies
+                            :query-params params
+                            :headers {"referer" (str "http://backloggery.com/games.php?user=" user)}})]
+    (-> response :body java.io.StringReader. html/parse)))
+
+(defn bl-extract-params [body]
+  (some->> body (tag-seq :input) first :attrs :onclick
+           (re-find #"getMoreGames\(([^,]+), *'([^']+)', *'([^']+)', *([^)]+)\)")
+           rest
+           (zipmap ["aid" "temp_sys" "ajid" "total"])))

 (defn- bl-games
   "Retrieve your Backloggery game list."
-  [cookies]
-  (let [username (bl-username cookies)
-        response (http/get "http://backloggery.com/games.php"
-                           {:cookies cookies
-                            :query-params {"user" username}})]
-    (->> response
-         :body .getBytes html/parse
-         (tag-seq :footer) first
-         (tag-seq :script) first
-         :content)))
+  [user pass]
+  (let [cookies (bl-login user pass)]
+    (loop [games []
+           params { "aid" "1" "temp_sys" "ZZZ" "ajid" "0" "total" "0" }]
+      (println (count games) params)
+      (if params
+        (let [page (bl-more-games cookies user params)]
+          (recur (conj games page) (bl-extract-params page)))
+        games))))

 (defn -main
   [& args]
-  (->> args (apply bl-login) (bl-games) println))
+  (println (apply bl-games args)))
+


convert java crap into proper collections

--- src/syncserver/core.clj
+++ src/syncserver/core.clj
@@ -94,13 +94,24 @@
         d3 (if (seq new-in-b) (conj d2 [:merge path new-in-b]) d2)]
     d3))

+(defn- primitive-array? [o]
+  (.isArray (class o)))
+
+(defn immutable [b]
+  (cond
+   (map? b) (into {} b)
+   (or  (seq? b)
+        (primitive-array? b)) (into [] b)
+   :otherwise b))
+
+
 (defn ddiff [path a b diffs]
   (debug "ddiff" a b "@" path " : " diffs)
   (cond
    (= a b) diffs
    (every? vector? [a b]) (vector-diff path a b diffs)
    (every? map? [a b]) (map-diff path a b diffs)
-   :otherwise (conj diffs [:set path b])))
+   :otherwise (conj diffs [:set path (immutable b)])))

 (defn- compute-delta [os cs]


Added tests for dynamic-filter and filter-query - issues 218 & 219

--- test/clj/forma/hadoop/jobs/forma_test.clj
+++ test/clj/forma/hadoop/jobs/forma_test.clj
@@ -47,6 +47,11 @@
 (def gadm-src   [(conj loc-vec 40132)])
 (def border-src [(conj loc-vec 4)])

+(def sample-ts-dc-src
+  (let [ts (thrift/TimeSeries* 693 [1 2 3])]
+    [["pailpath" (thrift/DataChunk* "ndvi" pixel-loc ts "16")]
+     ["pailpath" (thrift/DataChunk* "ndvi" (thrift/ModisPixelLocation* "500" 28 9 0 0) ts "16")]]))
+
 (def sample-hansen-dc
   (thrift/DataChunk* "hansen" pixel-loc 100 t-res))

@@ -91,6 +96,21 @@
                :est-end "2006-01-01"
                :t-res t-res} src)) => (produces [[s-res 28 8 0 0 (sample-fire-series 827 2)]]))

+(fact
+  "Check that `filter-query` properly screens out the pixel with VCF < 25, and keeps the one with VCF >= 25."
+  (let [vcf-limit 25
+        static-src [["500" 28 8 0 0 25 0 0 0 0]
+                    ["500" 28 9 0 0 10 0 0 0 0]]
+        ts-src sample-ts-dc-src]
+    (filter-query static-src vcf-limit ts-src)) => (produces [["500" 28 8 0 0 693 [1 2 3]]]))
+
+(fact
+  "Check that `dynamic-filter` properly truncates values where timeseries lengths don't line up."
+  (let [ndvi-src [["500" 28 8 0 0 693 [1 2 3]]]
+        reli-src [["500" 28 8 0 0 693 [0 0 3]]]
+        rain-src [["500" 28 8 0 0 693 [0.1 0.2]]]]
+    (dynamic-filter ndvi-src reli-src rain-src)) => (produces [["500" 28 8 0 0 693 [1 2] [0.1 0.2] [0 0]]]))
+
 (tabular
  (fact
    "Check that pixel telescoping works as expected, avoiding any


Test that the count works with nested sexprs.

--- test/kolmogorov_music/test/kolmogorov.clj
+++ test/kolmogorov_music/test/kolmogorov.clj
@@ -3,13 +3,17 @@
             [midje.sweet :refer :all]))

 (defn foo [x] (inc x))
-(def bar (comp foo foo))
+(defn bar [x] (+ (inc x) x))
+(def baz (comp foo foo))

 (fact "Kolmogorov complexity is how many symbols a definition comprises."
   (kolmogorov/complexity foo) => 2)

+(fact "The symbol count includes nested sexprs."
+  (kolmogorov/complexity bar) => 4)
+
 (fact "The symbol count is recursive within the current namespace."
-  (kolmogorov/complexity bar) => 7)
+  (kolmogorov/complexity baz) => 7)

 (fact "Symbols outside the current namespace are considered atoms."
   (kolmogorov/complexity inc) => 0)


Rename function

Rename function

--- src/try_lwjgl/logic.clj
+++ src/try_lwjgl/logic.clj
@@ -73,7 +73,7 @@
   (player-moved)
   @player-position)

-(defn move-sideways [amount]
+(defn strife [amount]
   (move (rotate-direction @player-direction 1 (* -0.5 Math/PI)) amount))

 (defn move-forward [amount]
@@ -108,8 +108,8 @@
     (handle-movement-key-up key event key-down-at)
     (handle-movement-key-down key event key-down-at move-fn)))

-(defn strife [key event]
-  (event-move key event (fn [key] (move-sideways (key {:a -0.1 :d 0.1})))))
+(defn event-strife [key event]
+  (event-move key event (fn [key] (strife (key {:a -0.1 :d 0.1})))))

 (defn event-move-forward [key event]
   (event-move key event (fn [key] (move-forward (key {:w 0.1 :s -0.1})))))
@@ -124,8 +124,8 @@
 (def key-listeners
   {:w event-move-forward
    :s event-move-forward
-   :a strife
-   :d strife
+   :a event-strife
+   :d event-strife
    :1 (fn [key event] (when (and event (event :down?) (not (event :repeat?)))
                         (swap! show-player? #(not %))))
    :space event-move-vertical


separate out job scheduling from job execuation

--- src/wb_es/bulk/core.clj
+++ src/wb_es/bulk/core.clj
@@ -44,7 +44,7 @@
   "turn a list datomic entity ids to batches of the given size.
   attach some metadata for debugging"
   ([eids] (make-batches 500 nil))
-  ([eids batch-size order-info]
+  ([batch-size order-info eids]
    (->> eids
         (sort)
         (partition batch-size batch-size [])
@@ -68,12 +68,10 @@
     (do
       (http/put index-url {:headers {:content-type "application/json"}
                            :body (json/generate-string index-settings)})
-      (let [eids (get-eids-by-type db :go-term/id)
-            n-max (dec (count eids))
-            batch-size 1000
-            jobs (make-batches eids batch-size nil)
-            n-threads 4
+      (let [n-threads 4
             scheduler (chan n-threads)]
+
+        ;; multiple independent workers to execute jobs
         (dotimes [i n-threads]
           (go
             (loop []
@@ -85,9 +83,16 @@
                   (run-index-batch db job)
                   (recur))
                 ))))
+
         (do
-          (doseq [job jobs]
-            (>!! scheduler job))
+          ;; add jobs to scheduler in sequence
+          (let [eids (get-eids-by-type db :go-term/id)
+                jobs (make-batches 1000 :go-term eids)]
+            (doseq [job jobs]
+              (>!! scheduler job)))
+          ;; close the channel to indicate no more input
+          ;; existing jobs on the channel will remain available for consumers
+          ;; https://clojure.github.io/core.async/#clojure.core.async/close!
           (close! scheduler))
         ))))


'join' worker threads with the main in a attempt to prevent docker exiting

--- src/wb_es/bulk/core.clj
+++ src/wb_es/bulk/core.clj
@@ -303,48 +303,42 @@
     ))

-(defn run [db]
-  (let [n-threads 4]
-
-    ;; multiple independent workers to execute jobs
-    (dotimes [i n-threads]
-      (go
-       (loop []
-         (debug "Stats" (scheduler-stats))
-         (if-let [job-ref (scheduler-take!)]
-           ;; normal batches won't be nil
-           ;; only get nil when no more jobs are added to the queue for a period of time
-           (do
-             (try
-               (let [job (deref job-ref)
-                     job-meta (meta job)]
-                 (try
-                   (debug "Starting" job-meta)
-                   (case (:action job-meta)
-                     "snapshot" (let [index-id (:index job-meta)
-                                      repository-name (:repository job-meta)
-                                      snapshot-id (get-next-snapshot-id repository-name release-id)]
-                                  (save-snapshot index-id repository-name snapshot-id)
-                                  (debug "Snapshot created" job-meta))
-                     (do
-                       (run-index-batch db release-id job)
-                       (debug "Indexed" job-meta)))
-
-                   (scheduler-complete! job-ref)
-
-                   (catch Exception e
-                     (error e)
-                     (warn "Failed and scheduled to retry" job-meta)
-                     (scheduler-retry! job-ref) ; retried items are added at the end of the queue
-                     )))
-               (catch java.io.IOException e
-                 (error "Corrupted reference" job-ref)
-                 (scheduler-complete! job-ref)))
-             (recur))
-
-           ))))
-
-    )
+(defn worker [db]
+  (future
+    (loop []
+      (debug "Stats" (scheduler-stats))
+      (if-let [job-ref (scheduler-take!)]
+        ;; normal batches won't be nil
+        ;; only get nil when no more jobs are added to the queue for a period of time
+        (do
+          (try
+            (let [job (deref job-ref)
+                  job-meta (meta job)]
+              (try
+                (debug "Starting" job-meta)
+                (case (:action job-meta)
+                  "snapshot" (let [index-id (:index job-meta)
+                                   repository-name (:repository job-meta)
+                                   snapshot-id (get-next-snapshot-id repository-name release-id)]
+                               (save-snapshot index-id repository-name snapshot-id)
+                               (debug "Snapshot created" job-meta))
+                  (do
+                    (run-index-batch db release-id job)
+                    (debug "Indexed" job-meta)))
+
+                (scheduler-complete! job-ref)
+
+                (catch Exception e
+                  (error e)
+                  (warn "Failed and scheduled to retry" job-meta)
+                  (scheduler-retry! job-ref) ; retried items are added at the end of the queue
+                  )))
+            (catch java.io.IOException e
+              (error "Corrupted reference" job-ref)
+              (scheduler-complete! job-ref)))
+          (recur))
+
+        )))
   )

@@ -363,12 +357,20 @@
                     :delete-existing true)
       (let [db (d/db datomic-conn)]
         (do
-          (run db)
           (schedule-jobs-all db)
           (connect-snapshot-repository repository-name)
           (scheduler-put! (with-meta {} {:action "snapshot"
                                          :index index-id
-                                         :repository repository-name}))))
+                                         :repository repository-name}))
+          (->> (partial worker db)
+               (repeatedly 4)
+               (map deref) ; wait for the futures to return
+               (doall) ; force the side effects
+               )
+
+          (info "Stopping!" (scheduler-stats))
+
+          ))

       ))
   )


CMR-2708: Fixing problem with unlimited page size

--- common-app-lib/src/cmr/common_app/services/search/elastic_search_index.clj
+++ common-app-lib/src/cmr/common_app/services/search/elastic_search_index.clj
@@ -125,7 +125,7 @@
             (update-in [:took] + took-total)
             (update-in [:hits :hits] concat prev-items))
         ;; We need to keep searching subsequent pages
-        (recur (+ offset (:page-size query))
+        (recur (+ offset unlimited-page-size)
                (concat prev-items current-items)
                (+ took-total (:took results)))))))


bump version

bump version

--- storm-kafka/project.clj
+++ storm-kafka/project.clj
@@ -1,4 +1,4 @@
-(defproject storm/storm-kafka "0.7.2-SNAPSHOT"
+(defproject storm/storm-kafka "0.7.3-SNAPSHOT"
   :source-path "src/clj"
   :java-source-path "src/jvm"
   :javac-options {:debug "true" :fork "true"}


Ensure checkpointing is done in a separate go-loop so reading is not bottlenecked by zookeeper

--- src/onyx/plugin/datomic.clj
+++ src/onyx/plugin/datomic.clj
@@ -1,5 +1,5 @@
 (ns onyx.plugin.datomic
-  (:require [clojure.core.async :refer [chan >! >!! <!! close! go timeout alts!!]]
+  (:require [clojure.core.async :refer [chan >! >!! <!! close! thread timeout alts!! go-loop sliding-buffer]]
             [datomic.api :as d]
             [onyx.peer.pipeline-extensions :as p-ext]
             [onyx.peer.function :as function]
@@ -42,6 +42,18 @@
 (defn safe-datoms-per-segment [task-map]
   (or (:datomic/datoms-per-segment task-map)
       (throw (ex-info ":datomic/datoms-per-segment missing from write-datoms task-map." task-map))))
+
+(defn close-read-datoms-resources
+  [{:keys [datomic/producer-ch datomic/commit-ch datomic/read-ch] :as event} lifecycle]
+  (close! read-ch)
+  (close! commit-ch)
+  (close! producer-ch))
+
+(defn start-commit-loop! [commit-ch log task-id]
+  (go-loop []
+           (when-let [content (<!! commit-ch)]
+             (extensions/force-write-chunk log :chunk content task-id)
+             (recur))))

 (defn inject-read-datoms-resources
   [{:keys [onyx.core/task-map onyx.core/log onyx.core/task-id onyx.core/pipeline] :as event} lifecycle]
@@ -57,22 +69,27 @@
             db (safe-as-of task-map conn)
             datoms-per-segment (safe-datoms-per-segment task-map)
             unroll (partial unroll-datom db)
-            num-ignored (* start-index datoms-per-segment)]
-        (go
-          (try
-            (loop [chunk-index (inc start-index)
-                   datoms (seq (drop num-ignored
-                                     (datoms-sequence db task-map)))]
-              (when datoms
-                (>!! ch (assoc (t/input (java.util.UUID/randomUUID)
-                                        {:datoms (map unroll (take datoms-per-segment datoms))})
-                               :chunk-index chunk-index))
-                (recur (inc chunk-index)
-                       (seq (drop datoms-per-segment datoms)))))
-            (>!! ch (t/input (java.util.UUID/randomUUID) :done))
-            (catch Exception e
-              (fatal e))))
+            num-ignored (* start-index datoms-per-segment)
+            commit-loop-ch (start-commit-loop! (:commit-ch pipeline) log task-id)
+            producer-ch (thread
+                          (try
+                            (loop [chunk-index (inc start-index)
+                                   datoms (seq (drop num-ignored
+                                                     (datoms-sequence db task-map)))]
+                              (when datoms
+                                (let [success? (>!! ch (assoc (t/input (java.util.UUID/randomUUID)
+                                                                       {:datoms (map unroll (take datoms-per-segment datoms))})
+                                                              :chunk-index chunk-index))]
+                                  (if success?
+                                    (recur (inc chunk-index)
+                                           (seq (drop datoms-per-segment datoms)))))))
+                            (>!! ch (t/input (java.util.UUID/randomUUID) :done))
+                            (catch Exception e
+                              (fatal e))))]
+
         {:datomic/read-ch ch
+         :datomic/commit-ch (:commit-ch pipeline)
+         :datomic/producer-ch producer-ch
          :datomic/drained? (:drained pipeline)
          :datomic/top-chunk-index (:top-chunk-index pipeline)
          :datomic/top-acked-chunk-index (:top-acked-chunk-index pipeline)
@@ -89,7 +106,7 @@
 (defrecord DatomicInput [log task-id max-pending batch-size batch-timeout
                          pending-messages drained?
                          top-chunk-index top-acked-chunk-index pending-chunk-indices
-                         read-ch]
+                         read-ch commit-ch]
   p-ext/Pipeline
   (write-batch
     [this event]
@@ -110,7 +127,7 @@
     (when (and (= 1 (count @pending-messages))
                (= (count batch) 1)
                (= (:message (first batch)) :done))
-      (extensions/force-write-chunk log :chunk {:status :complete} task-id)
+      (>!! commit-ch {:status :complete})
       (reset! drained? true))
     {:onyx.core/batch batch}))

@@ -119,9 +136,8 @@
   (ack-segment [_ _ segment-id]
     (let [chunk-index (:chunk-index (@pending-messages segment-id))]
       (swap! pending-chunk-indices disj chunk-index)
-      (let [new-top-acked (highest-acked-chunk @top-acked-chunk-index @top-chunk-index @pending-chunk-indices)
-            updated-content {:chunk-index new-top-acked :status :incomplete}]
-        (extensions/force-write-chunk log :chunk updated-content task-id)
+      (let [new-top-acked (highest-acked-chunk @top-acked-chunk-index @top-chunk-index @pending-chunk-indices)]
+        (>!! commit-ch {:chunk-index new-top-acked :status :incomplete})
         (reset! top-acked-chunk-index new-top-acked))
       (swap! pending-messages dissoc segment-id)))

@@ -144,7 +160,8 @@
         max-pending (or (:onyx/max-pending catalog-entry) (:onyx/max-pending defaults))
         batch-size (:onyx/batch-size catalog-entry)
         batch-timeout (or (:onyx/batch-timeout catalog-entry) (:onyx/batch-timeout defaults))
-        read-ch (chan (or (:datomic/read-buffer catalog-entry) 1000))]
+        read-ch (chan (or (:datomic/read-buffer catalog-entry) 1000))
+        commit-ch (chan (sliding-buffer 1))]
     (->DatomicInput (:onyx.core/log pipeline-data)
                     (:onyx.core/task-id pipeline-data)
                     max-pending batch-size batch-timeout
@@ -153,7 +170,8 @@
                     (atom -1)
                     (atom -1)
                     (atom #{})
-                    read-ch)))
+                    read-ch
+                    commit-ch)))

 (defn read-datoms [pipeline-data]
   (shared-input-builder pipeline-data))
@@ -218,10 +236,12 @@
     (->DatomicWriteBulkDatoms conn)))

 (def read-datoms-calls
-  {:lifecycle/before-task-start inject-read-datoms-resources})
+  {:lifecycle/before-task-start inject-read-datoms-resources
+   :lifecycle/after-task-stop close-read-datoms-resources})

 (def read-index-range-calls
-  {:lifecycle/before-task-start inject-read-datoms-resources})
+  {:lifecycle/before-task-start inject-read-datoms-resources
+   :lifecycle/after-task-stop close-read-datoms-resources})

 (def write-tx-calls
   {:lifecycle/before-task-start inject-write-tx-resources})


Bump subscriber count test

Bump subscriber count test

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -30,7 +30,7 @@
                      :onyx.messaging.aeron/offer-idle-strategy :low-restart-latency
                      :onyx.messaging.aeron/poll-idle-strategy :low-restart-latency
                      :onyx.messaging.aeron/embedded-driver? false
-                     :onyx.messaging.aeron/subscriber-count 2
+                     :onyx.messaging.aeron/subscriber-count 4
                      ;; more accurate benching locally
                      :onyx.messaging/allow-short-circuit? (if local? false true)
                      :onyx.peer/join-failure-back-off 500


Moving DB pool size down to 40 which seems to work on the server.

--- src/open_company/config.clj
+++ src/open_company/config.clj
@@ -10,7 +10,7 @@
 (defonce db-host (or (env :db-host) "localhost"))
 (defonce db-port (or (env :db-port) 28015))
 (defonce db-name (or (env :db-name) "open_company"))
-(defonce db-pool-size (or (env :db-pool-size) 50))
+(defonce db-pool-size (or (env :db-pool-size) 40))

 (defonce db-map {:host db-host :port db-port :db db-name})
 (defonce db-options (flatten (vec db-map))) ; k/v sequence as clj-rethinkdb wants it


(PE-6014) Removed need for empty puppet.conf

--- test/puppetlabs/services/ca/certificate_authority_disabled_test.clj
+++ test/puppetlabs/services/ca/certificate_authority_disabled_test.clj
@@ -9,32 +9,34 @@
             [puppetlabs.trapperkeeper.testutils.logging :as logutils]
             [puppetlabs.trapperkeeper.testutils.bootstrap :as tk-testutils]))

-(def puppet-conf
-  "./dev-resources/puppetlabs/services/ca/certificate_authority_disabled_test/master/conf/puppet.conf")
-
-(use-fixtures :each (jruby-testutils/with-puppet-conf puppet-conf))
+(def puppet-conf-dir
+  "./target/test/certificate_authority_disabled_test")

 (deftest ca-disabled-files-test
   (testing "Ensure no certificates are generated when CA disabled service is enabled."
-    (logutils/with-test-logging
-      (tk-testutils/with-app-with-config
-        app
+    (try
+      (fs/mkdirs puppet-conf-dir)
+      (logutils/with-test-logging
+        (tk-testutils/with-app-with-config
+          app

-        [profiler/puppet-profiler-service
-         jruby/jruby-puppet-pooled-service
-         disabled/certificate-authority-disabled-service]
+          [profiler/puppet-profiler-service
+           jruby/jruby-puppet-pooled-service
+           disabled/certificate-authority-disabled-service]

-        (-> (jruby-testutils/jruby-puppet-tk-config
-              (jruby-testutils/jruby-puppet-config 1))
-            (assoc-in [:jruby-puppet :master-conf-dir]
-                      jruby-testutils/conf-dir))
+          (-> (jruby-testutils/jruby-puppet-tk-config
+                (jruby-testutils/jruby-puppet-config 1))
+              (assoc-in [:jruby-puppet :master-conf-dir]
+                        puppet-conf-dir))

-        (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]
-          (jruby/with-jruby-puppet
-            jruby-puppet jruby-service
-            (let [ssl-dir (str jruby-testutils/conf-dir "/ssl")]
-              (is (not (nil? (fs/list-dir ssl-dir))))
-              (is (empty? (fs/list-dir (str ssl-dir "/ca")))))))))))
+          (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]
+            (jruby/with-jruby-puppet
+              jruby-puppet jruby-service
+              (let [ssl-dir (str jruby-testutils/conf-dir "/ssl")]
+                (is (not (nil? (fs/list-dir ssl-dir))))
+                (is (empty? (fs/list-dir (str ssl-dir "/ca")))))))))
+      (finally
+        (fs/delete-dir puppet-conf-dir)))))