Add delete keypair fns

Add delete keypair fns

--- src/circle/backend/ec2.clj
+++ src/circle/backend/ec2.clj
@@ -1,6 +1,7 @@
 (ns circle.backend.ec2
   (:use [circle.aws-credentials :only (aws-credentials)])
   (:use [clojure.tools.logging :only (infof)])
+  (:use [clojure.core.incubator :only (-?>)])
   (:import com.amazonaws.services.ec2.AmazonEC2Client
            (com.amazonaws.services.ec2.model DescribeInstancesResult
                                              TerminateInstancesRequest
@@ -35,7 +36,8 @@
   (->>
    (reservations)
    (mapcat :instances)
-   (map bean)))
+   (map bean)
+   (filter #(not= :terminated (-?> % :state (bean) :name (keyword))))))

 (defn all-instance-ids []
   (map :instanceId (instances)))
@@ -89,11 +91,19 @@

 (defn delete-keypair
   [name]
-  (println "deleting keypair %s" name)
+  (println "deleting keypair" name)
   (with-ec2-client client
     (-> client
         (.deleteKeyPair (DeleteKeyPairRequest. name)))))

 (defn delete-keypairs-matching [re]
   (doseq [kp (filter #(re-find re (:keyName %)) (keypairs))]
-    (delete-keypair (-> kp :keyName))))+    (delete-keypair (-> kp :keyName))))
+
+(defn delete-unused-jclouds-keypairs
+  []
+  (let [keep (into #{} (map :keyName (instances)))]
+    (doseq [k (->> (keypairs)
+                   (filter #(re-find #"^jclouds" (:keyName %)))
+                   (filter #(not (contains? keep (:keyName %)))))]
+      (delete-keypair (:keyName k)))))


avoid deducting Runner credits with Tollbooth if on fewer than 3

--- src/clj/game/cards-ice.clj
+++ src/clj/game/cards-ice.clj
@@ -730,8 +730,8 @@
    {:trace {:base 2 :msg "keep TMI rezzed" :unsuccessful {:effect (effect (derez card))}} :abilities [end-the-run]}

    "Tollbooth"
-   {:abilities [{:msg "force the Runner to lose 3 [Credits]"
-                 :effect (effect (lose :runner :credit 3))}
+   {:abilities [{:msg "make the Runner pay 3 [Credits], if able"
+                 :effect (effect (pay :runner :credit 3))}
                 end-the-run]}

    "Tour Guide"


Remove println

Remove println

--- src/cljc/precept/core.cljc
+++ src/cljc/precept/core.cljc
@@ -165,7 +165,6 @@
                                  s/*event-coords
                                  [])))
                            (l/replace-listener session))]
-        (println "Diff ops: " ops)
         (swap-session! next-session)
         (>! out ops)
         (recur)))


Bugfix: Showing the thread dialog was re-quering the first page

We will now only query the back end if the page index being requested is
higher than the last one we loaded.

Also, clean up: we don't need to force a search, since we now handle that
by disposing of the search history on edit/add.

--- src/cljs/memento/core.cljs
+++ src/cljs/memento/core.cljs
@@ -223,9 +223,8 @@
                    (get-in app-state [:search-state :list])
                    [])
           p      (or page-index (get-in app-state [:ui-state :results-page]))]
-      (if (or (get-in app-state [:search-state :force?])
-              (not= q last-q)
-              (not= p (get-in app-state [:search-state :page-index])))
+      (if (or (not= q last-q)
+              (> p (or (get-in app-state [:search-state :page-index]) -1)))
         (do
           (GET "/api/memory/search" {:params        {:q q :page p}
                                      :headers       {:authorization (str "Token " (get-in app-state [:credentials :token]))}
@@ -300,7 +299,6 @@
           (assoc-in [:note :edit-note] "")
           (assoc-in [:note :focus] nil)
           (assoc :search-state nil)
-          #_(assoc-in [:search-state :force?] true)
           ))))

 (register-handler
@@ -332,7 +330,6 @@
         (assoc-in [:note :thread] nil)
         (assoc-in [:ui-state :show-thread?] false)
         (assoc-in [:note :focus] nil)
-        #_(assoc-in [:search-state :force?] true)
         (assoc :search-state nil)
         )))


using worker pool

using worker pool

--- src/cljs/smgui/search.cljs
+++ src/cljs/smgui/search.cljs
@@ -12,10 +12,12 @@
             [smgui.organize]
             [sm.core :as sm]
             [cljs.core.async :refer [put! chan <! >! close! pipe]]
-            [swannodette.utils.reactive :as r]))
+            [wilkerdev.util.reactive :as r]))

 (defn define-status [icon detail]
   { :icon icon :detail detail })
+
+(def worker-pool (r/channel-pool 5))

 (defn- status-website-link [status]
   (let [url (-> status :download :source-url)]
@@ -35,14 +37,14 @@

 (defn state-download [in]
   (let [out (chan)]
-    (go-loop [state {}]
+    (go-loop [state {:status :init}]
+             (>! out state)
              (if-let [data (<! in)]
                (let [[status info] data
                      new-info (merge state {:status (if (contains? status-map status)
                                                       status
                                                       (:status state))
                                             status info})]
-                 (>! out new-info)
                  (recur new-info))
                (close! out)))
     out))
@@ -50,11 +52,12 @@
 (def cache-storage (engine/local-storage-cache))

 (defn download-chan [path]
-  (state-download (sm/process {:path      path
-                               :sources   (sm/default-sources)
-                               :languages (smgui.settings/languages)
-                               :cache     cache-storage}
-                              (chan 1))))
+  (state-download (->> (sm/process {:path      path
+                                    :sources   (sm/default-sources)
+                                    :languages (smgui.settings/languages)
+                                    :cache     cache-storage}
+                                   (chan 1))
+                       (r/pool-enqueue worker-pool))))

 (defn status-icon [icon]
   (dom/img #js {:src (str "images/icon-" icon ".svg") :className "status"}))


Add created-by parameter to maps and scenarios

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -640,6 +640,7 @@
   {:sterlings-aruba
    {:id :sterlings-aruba
     :description "Sterling's Aruba"
+    :created-by "David Whittington"
     :terrains
     [;; Row 1
      {:q 1 :r 0 :terrain-type :plains}
@@ -728,6 +729,7 @@
    :city-sprawl
    {:id :city-sprawl
     :description "City Sprawl"
+    :created-by "David Whittington"
     :terrains
     [;; Row 1
      {:q 2 :r 0 :terrain-type :woods}
@@ -953,6 +955,7 @@
   {:sterlings-aruba-multiplayer
    {:id :sterlings-aruba-multiplayer
     :description "Sterling's Aruba Multiplayer"
+    :created-by "David Whittington"
     :ruleset-id :zetawar
     :map-id :sterlings-aruba
     :max-count-per-unit 10
@@ -980,6 +983,7 @@
    :city-sprawl-multiplayer
    {:id :city-sprawl-multiplayer
     :description "City Sprawl Multiplayer"
+    :created-by "David Whittington"
     :ruleset-id :zetawar
     :map-id :city-sprawl
     :max-count-per-unit 10


Import only

Import only

--- src/cljs/zetawar/game.cljs
+++ src/cljs/zetawar/game.cljs
@@ -6,7 +6,7 @@
    [zetawar.data :as data]
    [zetawar.db :as db :refer [e find-by qe qes qess]]
    [zetawar.hex :as hex]
-   [zetawar.util :refer [breakpoint inspect oonly]]))
+   [zetawar.util :refer [breakpoint inspect oonly only]]))

 ;; TODO: improve exception data


Removes unnecessary anonymous function

Removes unnecessary anonymous function


[n.debug] Add keep-screen-on

[n.debug] Add keep-screen-on

--- src/clojure/neko/debug.clj
+++ src/clojure/neko/debug.clj
@@ -2,6 +2,7 @@
   "Contains useful tools to be used while developing the application."
   (:require [neko log notify])
   (:import android.app.Activity
+           android.view.WindowManager$LayoutParams
            java.util.WeakHashMap))

 ;;; Simplify REPL access to Activity objects.
@@ -55,4 +56,13 @@
   [f]
   (fn [] (safe-for-ui (f))))

+(defmacro keep-screen-on
+  "A conditional macro that will enforce the screen to stay on while the
+  application is run in the debug mode."
+  [^Activity activity]
+  (if (:neko.init/release-build *compiler-options*)
+    nil
+    `(.addFlags (.getWindow ~activity)
+                WindowManager$LayoutParams/FLAG_KEEP_SCREEN_ON)))

+


More `clojure.java.io` integration.

More `clojure.java.io` integration.

--- src/clojure/parkour/fs.clj
+++ src/clojure/parkour/fs.clj
@@ -6,7 +6,7 @@
             [parkour (conf :as conf) (reducers :as pr)]
             [parkour.util :refer [ignore-errors returning map-vals mpartial]])
   (:import [java.net URI URL]
-           [java.io File IOException InputStream Writer]
+           [java.io File IOException InputStream OutputStream Reader Writer]
            [org.apache.hadoop.fs FileStatus FileSystem Path]
            [org.apache.hadoop.filecache DistributedCache]))

@@ -128,9 +128,43 @@
   {:tag `InputStream}
   ([p] (input-stream (conf/ig) p))
   ([conf p]
-     (if-let [fs (ignore-errors (path-fs conf p))]
-       (path-open fs p)
-       (io/input-stream p))))
+     (let [p (path p)]
+       (if-let [fs (ignore-errors (path-fs conf p))]
+         (path-open fs p)
+         (io/input-stream (io/as-url p))))))
+
+(defn path-create
+  "Create an output stream on `p` for `fs`, or default `fs` if not provided."
+  ([p] (path-create (path-fs p) p))
+  ([fs p] (.create ^FileSystem fs (path p))))
+
+(extend Path
+  io/IOFactory
+  (assoc io/default-streams-impl
+    :make-input-stream (fn [p opts]
+                         (if-let [fs (or (:fs opts) (path-fs p))]
+                           (io/make-input-stream (path-open fs p) opts)
+                           (io/input-stream (io/as-url p))))
+    :make-output-stream (fn [p opts]
+                          (if-let [fs (or (:fs opts) (path-fs p))]
+                            (io/make-output-stream (path-open fs p) opts)
+                            (io/output-stream (io/as-url p))))))
+
+;; Private for some reason, so copy internally
+(def ^:private do-copy @#'io/do-copy)
+
+(defmethod do-copy [Path OutputStream]
+  [input output opts] (do-copy (io/input-stream input) output opts))
+(defmethod do-copy [Path Writer]
+  [input output opts] (do-copy (io/reader input) output opts))
+(defmethod do-copy [Path File]
+  [input output opts] (do-copy (io/input-stream input) output opts))
+(defmethod do-copy [InputStream Path]
+  [input output opts] (do-copy input (io/output-stream output) opts))
+(defmethod do-copy [Reader Path]
+  [input output opts] (do-copy input (io/writer output) opts))
+(defmethod do-copy [File Path]
+  [input output opts] (do-copy input (io/output-stream output) opts))

 (def ^:dynamic *temp-dir*
   "Default path to system temporary directory on the default


need xiangqi files

need xiangqi files

--- src/cloxiang/handlers.cljs
+++ src/cloxiang/handlers.cljs
@@ -79,6 +79,6 @@
           with-player (if (player? player)
                         (assoc game (keyword player) socket)
                         game)]
-        (println game)
+        (println with-player)
         (swap! games #(assoc % id with-player))
         "connected"))


changes in discussion with dominik

changes in discussion with dominik

--- src/main/clojure/conexp/layouts/dim_draw.clj
+++ src/main/clojure/conexp/layouts/dim_draw.clj
@@ -79,12 +79,6 @@
       (map edge->vec (lg/edges (transitive-orientation C)))
       nil)))

-(defn maximum-bipartite-subgraph
-  [I]
-  42)
-
-(def ?? nil)
-(def ??remove-nodes nil)

 (defn compute-coordinates
   [P <=]
@@ -93,8 +87,7 @@
         (let [<=C' (compute-conjugate-order P <=)]
           (if (= <=C' nil)
             (let [I (incompatibility-graph P <=)
-                  B (maximum-bipartite-subgraph I)
-                  C (?? (??remove-nodes I B))]
+                  C (sat-reduction I)]
               (compute-conjugate-order P (union <= (transitive-closure C))))
             <=C'))
         <=1 (union <=as-set <=C)


Add styling to api docs

Add styling to api docs

--- docs/src/ns_to_markdown.clj
+++ docs/src/ns_to_markdown.clj
@@ -88,9 +88,12 @@
     (catch Exception e
       (println e))))

+(def markdown-styles
+  "<style>\n.md-typeset h3 {\nbackground: #777;\ncolor: white;\npadding-left: 5px;\nline-height: 1.15em;\nheight: 2em;\n}\n</style>\n\n")
+
 (defn ns->markdown
   [m]
-  (format "# %s\n\n" (:name m)))
+  (format "%s# %s\n\n" markdown-styles (:name m)))

 (defn arglist->markdown
   [arglist]


Only re-root figwheel opts when key is present

Previously we were calling update-in on a bunch of settings, even if
they weren't already present, which caused them to be present with
null/empty values OR failing due to NPEs.

Now we check that the key exists before calling update-in.

A big use case for fixing this is proper support of modules with
Figwheel, since you end up without an output-to in the root compiler
options.

This fixes #104.

--- gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/figwheel.clj
+++ gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/figwheel.clj
@@ -4,32 +4,31 @@
             [clojure.java.io :as io])
   (:import [java.nio.file Files Paths LinkOption]))

+(defn safe-update-in [m ks f & args]
+  (if (get-in m ks)
+    (apply update-in m ks f args)
+    m))
+
 (defn re-root [path from to]
-  (str (.resolve to (.relativize from (Paths/get path (into-array String []))))))
+  (if (string? path)
+    (str (.resolve to (.relativize from (Paths/get path (into-array String [])))))
+    path))

 (defn map-vals [f m]
   (reduce (fn [m2 [k v]] (assoc m2 k (f v))) {} m))

-(defn re-root-modules [build from-dir to-dir]
-  (if (get-in build [:compiler :modules])
-    (update-in build [:compiler :modules] (fn [modules]
-                                            (map-vals #(update-in % [:output-to] re-root from-dir to-dir) modules)))
-    build))
-
-(defn re-root-source-map [build from-dir to-dir]
-  (if (string? (get-in build [:compiler :source-map]))
-    (update-in build [:compiler :source-map] re-root from-dir to-dir)
-    build))
+(defn re-root-modules [modules from-dir to-dir]
+  (map-vals #(update-in % [:output-to] re-root from-dir to-dir) modules))

 (defn re-root-build [build output-dir]
   (let [from-dir (Paths/get (:output-dir build) (into-array String []))
         to-dir (Paths/get output-dir (into-array String []))]
     (-> build
-        (update-in [:compiler :output-to] re-root from-dir to-dir)
-        (update-in [:compiler :output-dir] re-root from-dir to-dir)
-        (update-in [:figwheel :target-dir] re-root from-dir to-dir)
-        (re-root-source-map from-dir to-dir)
-        (re-root-modules from-dir to-dir))))
+        (safe-update-in [:figwheel :target-dir] re-root from-dir to-dir)
+        (safe-update-in [:compiler :output-to] re-root from-dir to-dir)
+        (safe-update-in [:compiler :output-dir] re-root from-dir to-dir)
+        (safe-update-in [:compiler :modules] re-root-modules from-dir to-dir)
+        (safe-update-in [:compiler :source-map] re-root from-dir to-dir))))

 (defn real-dirs [dirs]
   (let [xf (comp (map #(Paths/get % (into-array String [])))


Update pedestal-toolbox dependency to 0.6.2

Fixes an issue with `body-params` for some requests.

--- resources/leiningen/new/kraken_http_api/project.clj
+++ resources/leiningen/new/kraken_http_api/project.clj
@@ -18,7 +18,7 @@

                  [io.pedestal/pedestal.service "0.4.0"]
                  [io.pedestal/pedestal.service-tools "0.4.0"]
-                 [democracyworks/pedestal-toolbox "0.6.1"]
+                 [democracyworks/pedestal-toolbox "0.6.2"]

                  ;; this has to go before pedestal.immutant
                  ;; until this is fixed:


Fixed encoded parsing tests by adding results as provided by JSON.parse

--- test/pjson/escaping_test.clj
+++ test/pjson/escaping_test.clj
@@ -1,17 +1,13 @@
 (ns
-  ^{:doc "Test reading data that has characters {} [] in the string values of lazy objects do not throw exceptions"}
-  pjson.escaping-test
+    ^{:doc "Test reading data that has characters {} [] in the string values of lazy objects do not throw exceptions"}
+    pjson.escaping-test
   (:require
-    [pjson.core :as pjson]
-    [cheshire.core :as cheshire]
-    [clojure.test :refer :all]))
-
-
+   [pjson.core :as pjson]
+   [cheshire.core :as cheshire]
+   [clojure.test :refer :all]))

 (def ^String CONVERSION-MSG-OBJ "{\"mykey\":{\"mykey2\": \"abc}\"}}")
 (def ^String CONVERSION-MSG-LIST "{\"mykey\":[\"mykey2\", \"abc]\"]}")
-
-

 (defn test-fail-message
   "Throw an exception if the message is not correct"
@@ -19,28 +15,21 @@
   (cheshire/parse-string (pjson/write-str (pjson/read-str msg))))

 (deftest test-conversion-lazy-obj []
-         (is (not (nil? (test-fail-message CONVERSION-MSG-OBJ)))))
-
-
+  (is (not (nil? (test-fail-message CONVERSION-MSG-OBJ)))))

 (deftest test-conversion-lazy-list []
-         (is (not (nil? (test-fail-message CONVERSION-MSG-LIST)))))
-
+  (is (not (nil? (test-fail-message CONVERSION-MSG-LIST)))))

 (deftest test-read-escapes []
-                           (let [data [
-                                       ["{\"a\": \"a\\ \\ a\"}"      {"a" "a\\\\a"}]
-                                       ["[{\"a\":\"J\\\\\\\"\"}]"  [{"a" "J\\\\"}]
-                                        "[{\"a\":\"J\\\\\"}]"      [{"a" "J\\"}]]]
-
-                                 test-fn (fn [[t result]]
-                                              (= (pjson/read-str t) result))]
-                             (is (every? test-fn data))))
+  (are [source expected-parsed] (= expected-parsed (pjson/read-str source))
+    "{\"a\": \"a\\ \\ a\"}"   {"a" "a  a"}
+    "[{\"a\":\"J\\\\\\\"\"}]" [{"a" "J\\"}]
+    "[{\"a\":\"J\\\\\"}]"     [{"a" "J\\"}]
+    "[\"\\n\"]"               ["\n"]))

 (deftest test-write-escapes []
-                           (let [data [[["b\\"] "[\"b\\\\\"]"]]
+  (let [data [[["b\\"] "[\"b\\\\\"]"]]

-                                 test-fn (fn [[t result]]
-                                           (= (pjson/write-str t) result))]
-                             (is (every? test-fn data))))
-
+        test-fn (fn [[t result]]
+                  (= (pjson/write-str t) result))]
+    (is (every? test-fn data))))


Remove cljs-testrunners from tests code.

--- test/promesa/core_tests.cljs
+++ test/promesa/core_tests.cljs
@@ -1,6 +1,5 @@
 (ns promesa.core-tests
-  (:require [cljs-testrunners.node :as node]
-            [cljs.test :as t]
+  (:require [cljs.test :as t]
             [promesa.core :as p]
             [cats.core :as m]))

@@ -105,7 +104,3 @@
       (p/then p1 (fn [x]
                    (t/is (= x 3))
                    (done))))))
-
-
-(defn main [] (node/run-tests))
-(set! *main-cli-fn* main)


#57 Fix a typo preventing successful shutdown of cron component

--- src/org/zalando/stups/friboo/system/cron.clj
+++ src/org/zalando/stups/friboo/system/cron.clj
@@ -96,5 +96,5 @@
        (assoc this# :pool ~(symbol "pool")))

      (stop [this#]
-       (at/stop-and-reset-pool! (:pool this#) :kill)
+       (at/stop-and-reset-pool! (:pool this#) :strategy :kill)
        (dissoc this# :pool))))


Better documentation for crypto_box

Better documentation for crypto_box

--- src/caesium/crypto/box.clj
+++ src/caesium/crypto/box.clj
@@ -74,7 +74,10 @@
     {:public pk :secret sk}))

 (defn encrypt
-  "Encrypt with `crypto_box_easy`."
+  "Encrypt with `crypto_box_easy`.
+
+  To encrypt, use the recipient's public key and the sender's secret
+  key."
   [^bytes public-key
    ^bytes secret-key
    nonce
@@ -84,7 +87,10 @@
     (.encrypt (Box. pbk pvk) nonce plaintext)))

 (defn decrypt
-  "Decrypt with `crypto_box_open_easy`."
+  "Decrypt with `crypto_box_open_easy`.
+
+  To decrypt, use the sender's public key and the recipient's secret
+  key."
   [^bytes public-key
    ^bytes secret-key
    nonce


MOAR on my quest to add bfs/dfs. Added a TODO.

--- test/degasolv/resolver/search_strat_test.clj
+++ test/degasolv/resolver/search_strat_test.clj
@@ -284,3 +284,4 @@
               :conflict-strat :prioritized
               :search-strat :depth-first
               :compare cmp))))))
+;; TODO: Add test using conflict strat as prioritized


Fixed resources bug for uberjars.

Fixed resources bug for uberjars.

--- src/profanity_power_index/site_generator.clj
+++ src/profanity_power_index/site_generator.clj
@@ -65,7 +65,7 @@
     (io/copy (io/file (second (:arguments options))) data-file)

     ;; Copy js.
-    (io/copy (-> "js/profanitypowerindex.js" io/resource io/file) js-file)
+    (io/copy (-> "js/profanitypowerindex.js" io/resource slurp) js-file)

     ;; Write index.html out.
     (spit index-file


(PDB-5161) engine/validate-dotted-field: drop in favor of parse-field

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -53,11 +53,6 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Plan - functions/transformations of the internal query plan
-
-(defn validate-dotted-field
-  [dotted-field]
-  ;; Q: why isn't parameters in here (cf. :dotted-fields below)
-  (and (string? dotted-field) (re-find #"^(facts|trusted)\..+" dotted-field)))

 (def field-schema (s/cond-pre s/Keyword
                               SqlCall SqlRaw
@@ -1866,7 +1861,14 @@
   [node]
   (cm/match [node]

-            [[(op :guard #{"=" ">" "<" "<=" ">=" "~"}) (column :guard validate-dotted-field) value]]
+            [[(op :guard #{"=" ">" "<" "<=" ">=" "~"})
+              ;; Q: why isn't "parameters" included in the guard set
+              ;; (cf. :dotted-fields below)?
+              (column :guard #(and (string? %)
+                                   (#{"facts" "trusted"} (-> (parse/parse-field %)
+                                                             first
+                                                             :name))))
+              value]]
             ;; (= :inventory (get-in (meta node) [:query-context :entity]))
             (maybe-add-match-function-filter op column value)


add code to get the houses

add code to get the houses

--- src/clj/ephemeris/core.clj
+++ src/clj/ephemeris/core.clj
@@ -8,23 +8,37 @@
                :geo {:lat nil :lon nil}
                :bodies []
                :angles []
-               :houses false})
+               :houses \O})

 (defn calc [stuff]
   (let [want (merge defaults stuff)
         sw (SwissEph.)
         jd (utc-to-jd (:utc want))
         flag (. SweConst SEFLG_SPEED)]
-    (for [i (flatten [(:bodies want)])]
-      (let [what (if (known? i) (lookup i) i)
-            res (double-array 6)
-            err (StringBuffer.)
-            rc (.swe_calc_ut sw
-                             jd
-                             what
-                             flag
-                             res
-                             err)]
-        {(lookup what) {:lon (aget res 0)
-                        :lat (aget res 1)
-                        :sdd (aget res 3)}}))))
+    (merge
+      (into {}
+        (for [i (flatten [(:bodies want)])]
+          (let [what (if (known? i) (lookup i) i)
+                res (double-array 6)
+                err (StringBuffer.)
+                rc (.swe_calc_ut sw
+                                 jd
+                                 what
+                                 flag
+                                 res
+                                 err)]
+            {(lookup what) {:lon (aget res 0)
+                            :lat (aget res 1)
+                            :sdd (aget res 3)}})))
+      (if (not (empty? (:angles want)))
+        (let [cusps (double-array 13)
+              ascmc (double-array 10)
+              rc (.swe_houses sw
+                              jd
+                              0 ;; what flag?
+                              (:lat (:geo want))
+                              (:lon (:geo want))
+                              (int (:houses want))
+                              cusps
+                              ascmc)]
+          (zipmap (range 1 13) (rest cusps)))))))


all-installed now also searches recursively for hosted corp cards

--- src/clj/game/core-misc.clj
+++ src/clj/game/core-misc.clj
@@ -79,8 +79,12 @@
     (let [servers (->> (:corp @state) :servers seq flatten)
           content (mapcat :content servers)
           ice (mapcat :ices servers)
-          hosted-on-content (mapcat :hosted content)]
-      (concat ice content hosted-on-content))))
+          top-level-cards (concat ice content)]
+      (loop [unchecked top-level-cards installed ()]
+        (if (empty? unchecked)
+          installed
+          (let [[card & remaining] unchecked]
+            (recur (filter identity (into remaining (:hosted card))) (into installed [card]))))))))

 (defn all-active
   "Returns a vector of all active cards for the given side. Active cards are either installed, the identity,


Restart server

Restart server

--- src/clj/movement/db/db.clj
+++ src/clj/movement/db/db.clj
@@ -288,8 +288,6 @@

 ;; ------ LAB -------

-#_(add-user! "andflak@gmail.com" "Andreas" "mumrikM9n8b7v6" (str (UUID/randomUUID)))
-
 (def movement-urls ["balancing.edn" "climbing.edn" "crawling.edn" "hanging.edn" "jumping.edn" "lifting.edn" "rolling.edn" "running.edn" "throwing-catching.edn"
                     "walking.edn" "mobility/mobility.edn" "other/core.edn" "other/footwork.edn" "other/hand-balance.edn" "other/leg-strength.edn"
                     "other/planche-lever.edn" "other/pulling.edn" "other/pushing.edn" "other/ring.edn"])
@@ -366,4 +364,6 @@

 #_(let [tables (<!! (h/list-tables! creds {}))]
     (doseq [i (range (count tables))]
-      (h/delete-table! creds (get tables i))))+      (h/delete-table! creds (get tables i))))
+
+#_()


Fix a couple mistakes in app => view-ctx change

--- src/clj/zetawar/views.cljs
+++ src/clj/zetawar/views.cljs
@@ -112,9 +112,9 @@
      [board-unit view-ctx q r]
      [tile-mask view-ctx q r]]))

-(defn tiles [view-ctx]
+(defn tiles [{:as view-ctx :keys [conn]}]
   (into [:g]
-        (for [terrain @(subs/terrains view-ctx)]
+        (for [terrain @(subs/terrains conn)]
           [tile view-ctx terrain])))

 ;; TODO: computer board size based on map size
@@ -122,10 +122,10 @@
   [:svg#board {:width 500 :height 500}
    [tiles view-ctx]])

-(defn faction-credits [view-ctx]
-  (let [{:keys [faction/credits]} @(subs/current-faction view-ctx)
-        {:keys [map/credits-per-base]} @(subs/game-map view-ctx)
-        income @(subs/current-income view-ctx)]
+(defn faction-credits [{:as view-ctx :keys [conn]}]
+  (let [{:keys [faction/credits]} @(subs/current-faction conn)
+        {:keys [map/credits-per-base]} @(subs/game-map conn)
+        income @(subs/current-income conn)]
     [:p#faction-credits
      [:strong (str credits " Credits")]
      [:span.text-muted.pull-right (str "+" income)


Update namespace documentation.

Update namespace documentation.

--- src/clj_ravendb/client.clj
+++ src/clj_ravendb/client.clj
@@ -1,4 +1,10 @@
 (ns clj-ravendb.client
+  "The client namespace is the main entry point for the library
+  and allows creation of a RavenDB client using the `client` function.
+
+  The API documentation is available [here](http://markwoodhall.github.io/clj-ravendb).
+  "
+  {:author "Mark Woodhall"}
   (:require [clj-ravendb.rest :refer [rest-client]]
             [clj-ravendb.caching :refer [caching-client]]))


Added new projects and compositions (2020 Feb).

--- src/cljs/website/core.cljs
+++ src/cljs/website/core.cljs
@@ -77,6 +77,18 @@

 (defn about-page []
   [:div.timeline
+    [:div.container.right
+      [:div.content
+        [:h2 "2020"]
+        [:p "-"]]]
+    [:div.container.left
+      [:div.content
+        [:h2 "2019"]
+        [:p "-"]]]
+    [:div.container.right
+      [:div.content
+        [:h2 "2018"]
+        [:p "-"]]]
     [:div.container.left
       [:div.content
         [:h2 "2017"]
@@ -106,7 +118,25 @@
       [:a {:href
         (str "#/notebook/" (js/btoa "https://raw.githubusercontent.com/ianchute/trump-tweeter/master/trump.ipynb"))}
         [:img {:src (str js/context "/img/experiments/trump.png")}] "Tweeting like Trump"]
-    ]]])
+    ]]
+
+    [:div.row
+    [:div.col-md-12.card-section.my-menu
+      [:h3 "GitHub Projects"]
+      [:a {:href "https://github.com/ianchute/LambdaML"}
+        [:img {:src (str js/context "/img/social/github.png")}] "LambdaML: A lambda-based machine learning library"]
+      [:a {:href "https://github.com/ianchute/shapley-attribution-model"}
+        [:img {:src (str js/context "/img/social/github.png")}] "Shapley Value Methods for Attribution Modeling"]
+      [:a {:href "https://github.com/ianchute/goalpost-detector"}
+        [:img {:src (str js/context "/img/social/github.png")}] "Goalpost Detector: Using traditional CV techniques"]
+      [:a {:href "https://github.com/ianchute/extract_image_data"}
+        [:img {:src (str js/context "/img/social/github.png")}] "Images2CSV: Fast multithreaded script for converting a large number of images to CSV data"]
+      [:a {:href "https://github.com/ianchute/toady"}
+        [:img {:src (str js/context "/img/social/github.png")}] "toady: Easily visualize high-dimensional data in 2d space"]
+      [:a {:href "https://github.com/ianchute/StockCache/blob/master/chutychart.js"}
+        [:img {:src (str js/context "/img/social/github.png")}] "chutychart.js: A stock data graphing and analysis library"]
+    ]]
+  ])

 (defn games-page []
   [:div.container
@@ -125,6 +155,12 @@
     [:div.row
     [:div.col-md-12.card-section.my-menu
       [:h3 "Compositions"]
+      [:a {:href "https://www.youtube.com/watch?v=0bhL6w0ueuw"}
+        [:img {:src (str js/context "/img/music.png")}] "Wilted Roses"]
+      [:a {:href "https://www.youtube.com/watch?v=IQZD-bu7dhE"}
+        [:img {:src (str js/context "/img/music.png")}] "Frozen Lake"]
+      [:a {:href "https://www.youtube.com/watch?v=m0nvlX4sl4c"}
+        [:img {:src (str js/context "/img/music.png")}] "An Empty Epiphany"]
       [:a {:href
         (str "#/music/" (js/btoa "https://musescore.com/user/25292271/scores/4583261/embed"))}
         [:img {:src (str js/context "/img/music.png")}] "Elegy in D Minor"]


Import only

Import only

--- src/cljs/zetawar/game.cljs
+++ src/cljs/zetawar/game.cljs
@@ -6,7 +6,7 @@
    [zetawar.data :as data]
    [zetawar.db :as db :refer [e find-by qe qes qess]]
    [zetawar.hex :as hex]
-   [zetawar.util :refer [breakpoint inspect oonly]]))
+   [zetawar.util :refer [breakpoint inspect oonly only]]))

 ;; TODO: improve exception data


Add n-peers back in.

Add n-peers back in.

--- test/onyx/coordinator/linear_cluster_sim.clj
+++ test/onyx/coordinator/linear_cluster_sim.clj
@@ -128,6 +128,7 @@
 (def linear-cluster-model-data
   [{:db/id linear-model-id
     :model/type :model.type/linear-cluster
+    :model/n-peers 5
     :model/peek-peers 50
     :model/peer-rate 200
     :model/silence-gap 5000


Accepting and prepping peers are disallowed in evictor

--- src/onyx/log/commands/prepare_join_cluster.clj
+++ src/onyx/log/commands/prepare_join_cluster.clj
@@ -30,6 +30,12 @@
 (defn already-joined? [replica joiner]
   (some #{joiner} (:peers replica)))

+(defn disallowed-candidates [{:keys [peers pairs accepted prepared] :as replica}]
+  (let [all-prepared-deps (keys prepared)
+        prep-watches (map (fn [dep] (get (map-invert pairs) dep)) all-prepared-deps)
+        accepting-deps (keys accepted)]
+    (set (concat all-prepared-deps accepting-deps prep-watches))))
+
 (s/defmethod extensions/apply-log-entry :prepare-join-cluster :- Replica
   [{:keys [args message-id]} :- LogEntry replica]
   (let [peers (:peers replica)
@@ -37,10 +43,7 @@
         n (count peers)]
     (if (> n 0)
       (let [all-joined-peers (set (into (keys (:pairs replica)) peers))
-            all-prepared-deps (set (keys (:prepared replica)))
-            prep-watches (set (map (fn [dep] (get (map-invert (:pairs replica)) dep)) all-prepared-deps))
-            accepting-deps (set (keys (:accepted replica)))
-            candidates (difference all-joined-peers all-prepared-deps accepting-deps prep-watches #{joiner})
+            candidates (difference all-joined-peers (disallowed-candidates replica) #{joiner})
             sorted-candidates (sort (remove nil? candidates))]
         (cond (already-joined? replica joiner)
               replica
@@ -99,12 +102,12 @@
    (cond ;; Handles the cases where all peers are actually dead.
          ;; This can happen if a single node cluster comes down
          ;; and is rebooted. We pick a predictably-random peer
-         ;; and knock it down if it's not up. This garuntees
+         ;; and knock it down if it's not up. This guarantees
          ;; progress even if the cluster has experiences total failure.
          (and (= (:id state) (:subject diff)) (nil? diff))
-         (let [candidates (keys (:prepared new))
-               k (mod message-id (count candidates))
-               target (nth candidates k)]
+         (let [disallowed (disallowed-candidates new)
+               k (mod message-id (count disallowed))
+               target (nth disallowed k)]
            (when-not (extensions/peer-exists? log target)
              (extensions/write-log-entry
               (:log state)


Fixed bug with client not reporting meta events due to overzealous default security

--- lib/compojure/cometd/cometd.clj
+++ lib/compojure/cometd/cometd.clj
@@ -26,7 +26,7 @@
           type
           (recur (rest rules))))
       false)))
-
+
 (defn create-security-policy
   "Create a extensible security policy for a cometd implementation."
   [subscribe-rules publish-rules]
@@ -34,11 +34,15 @@
     (canHandshake [message]
       true)
     (canCreate [client channel message]
-      true)
+      (and client (not (.startsWith channel "/meta/"))))
     (canSubscribe [client channel message]
-      (rules-allow? @subscribe-rules client channel message))
+      (and (not (.startsWith channel "/meta/")
+           (not= channel "/*")
+           (not= channel "/**")
+           (rules-allow? @subscribe-rules client channel message))))
     (canPublish [client channel message]
-      (rules-allow? @publish-rules client channel message))))
+      (or (= channel "/meta/handshake")
+          (rules-allow? @publish-rules client channel message)))))

 (defn- match-channel
   "Match a channel name to a string with wildcards."
@@ -72,11 +76,11 @@
 ;;;; Default servlet and rule chains ;;;;

 (defvar *subscribe-rules*
-  (ref [])
+  (ref (list))
   "Default rule chain for subscriptions.")

 (defvar *publish-rules*
-  (ref [])
+  (ref (list))
   "Default rule chain for publishing.")

 (defvar *cometd*
@@ -113,6 +117,7 @@

 (allow-subscribe local-client?)   ; Allow local access by default
 (allow-publish local-client?)
+(allow-publish "/meta/*")         ; Allow client to report meta events

 ;;;; Sending and receiving ;;;;


Removed the links page, since we aren't using it.

--- src/foreclojure/static.clj
+++ src/foreclojure/static.clj
@@ -1,15 +1,6 @@
 (ns foreclojure.static
   (:use compojure.core
         foreclojure.utils))
-
-(def-page links-page []
-  [:div
-   [:li [:a {:href "http://clojure.org/getting_started"} "Clojure.org: Getting Started"]]
-   [:li [:a {:href "http://clojure.org/cheatsheet"} "Clojure.org: Cheatsheet"]]
-   [:li [:a {:href "http://try-clojure.org"} "try-clojure.org"]]
-   [:li [:a {:href "https://github.com/functional-koans/clojure-koans"} "Clojure Koans"]]
-   [:li [:a {:href "http://stackoverflow.com/questions/2285437/a-gentle-tutorial-to-emacs-swank-paredit-for-clojure"}
-         "StackOverflow.com: A Gentle Tutorial to Emacs/Swank/Paredit for Clojure"]]])

 (def-page welcome-page []
   [:div#welcome
@@ -74,4 +65,4 @@

 (defroutes static-routes
   (GET "/links" [] (links-page))
-  (GET "/directions" [] (getting-started-page)))
+  (GET "/directions" [] (getting-started-page)))


fixed current track highlighting

fixed current track highlighting

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -116,14 +116,14 @@
   (reify
     om/IInitState
     (init-state [_]
-      {:playing? false
-       :track-id (.-id data)})
+      {:playing? false})
     om/IWillReceiveProps
     (will-receive-props [_ _]
       (let [state (om/get-state owner)
             playing? (:playing? state)
-            track-id (:track-id state)]
-        (if (= track-id (:current-track-id @core/app-state))
+            track-id (.-id data)
+            current-track-id (:current-track-id @core/app-state)]
+        (if (= track-id current-track-id)
           (if-not playing?
             (om/set-state! owner (merge state {:playing? true})))
           (if playing?


parsed json string should not come in a vector

--- src/gangway/validation.clj
+++ src/gangway/validation.clj
@@ -41,7 +41,7 @@
   Returns true or false."
   [msg]
   (if (valid-json? msg)
-    (let [parsed-msg (first (json/read-str msg :key-fn keyword))
+    (let [parsed-msg (json/read-str msg :key-fn keyword)
           header (:header parsed-msg)
           op (keyword (:operation header))
           entity-type (keyword (:entity-type header))


Fix: Don't close results too early on SPARQL queries.

--- src/grafter/rdf/sesame.clj
+++ src/grafter/rdf/sesame.clj
@@ -539,8 +539,9 @@
                        (if (.hasNext results)
                          (let [current-result (try
                                                 (converter-f (.next results))
-                                                (finally
-                                                  (.close results)))]
+                                                (catch Exception e
+                                                  (.close results)
+                                                  (throw e)))]
                            (lazy-cat
                             [current-result]
                             (pull-query)))


Use boot.util/fail to print error message

--- boot/pod/src/boot/file.clj
+++ boot/pod/src/boot/file.clj
@@ -29,12 +29,17 @@
 (defmacro guard [& exprs]
   `(try (do ~@exprs) (catch Throwable _#)))

+(def fail
+  (delay
+    (require 'boot.util)
+    (var-get (resolve 'boot.util/fail))))
+
 (defn delete-file
   [f]
   (try
     (io/delete-file f)
     (catch Exception err
-      (println "ERROR deleting" f err))))
+      (@fail "ERROR deleting" f err))))

 (defn clean! [& files]
   (doseq [f files]


jstavel/edeposit#454 doplnil jsem testy pro vsechny handlery.

--- test/edeposit/amqp/kramerius/handlers_test.clj
+++ test/edeposit/amqp/kramerius/handlers_test.clj
@@ -32,26 +32,38 @@
     (def result (h/save-request  [[nil payload] tmpdir]))

     (is (.exists tmpdir))
+    (is (.exists (io/file tmpdir "uuid")))
+    (is (.exists (io/file tmpdir "urnnbn")))
     (is (.exists (io/file tmpdir "oai_marc.xml")))
     (is (.exists (io/file tmpdir "oai_marc.xml.b64")))
-    (is (.exists (io/file tmpdir "robotandbaby.pdf")))
-    (is (.exists (io/file tmpdir "robotandbaby.pdf.b64")))
-    (is (.exists (io/file tmpdir "filename")))
-    (is (.exists (io/file tmpdir "uuid")))
-
+
+    (is (.exists (io/file tmpdir "img_full")))
+    (is (.exists (io/file tmpdir "img_full" "robotandbaby.pdf")))
+    (is (.exists (io/file tmpdir "img_full" "mimetype")))
+    (is (.exists (io/file tmpdir "img_full" "filename")))
+
+    (is (.exists (io/file tmpdir "img_preview")))
+    (is (.exists (io/file tmpdir "img_preview" "robotandbaby_001.jpg")))
+    (is (.exists (io/file tmpdir "img_preview" "mimetype")))
+    (is (.exists (io/file tmpdir "img_preview" "filename")))
+
     (is (= (fs/size (io/file tmpdir "oai_marc.xml"))
-           (fs/size (io/file "resources" "oai_marc.xml"))
-           ))
-
-    (is (= (fs/size (io/file tmpdir "robotandbaby.pdf"))
-           (fs/size (io/file "resources" "robotandbaby.pdf"))
-           ))
+           (fs/size (io/file "resources" "oai_marc.xml"))))
+
+    (is (= (fs/size (io/file tmpdir "img_full" "robotandbaby.pdf"))
+           (fs/size (io/file "resources" "robotandbaby.pdf"))))
+
+    (is (= (fs/size (io/file tmpdir "img_preview" "robotandbaby_001.jpg"))
+           (fs/size (io/file "resources" "robotandbaby_001.jpg"))))

-    (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61"
-           (slurp (io/file tmpdir "uuid"))))
-    (is (-> (slurp (io/file tmpdir "filename"))
-            (= "resources/robotandbaby.pdf")
-            ))
+    (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61" (slurp (io/file tmpdir "uuid"))))
+    (is (= "urn:nbn:cz:mzk-0005ol" (slurp (io/file tmpdir "urnnbn"))))
+
+    (is (= "robotandbaby.pdf" (slurp (io/file tmpdir "img_full" "filename"))))
+    (is (= "application/pdf" (slurp (io/file tmpdir "img_full" "mimetype"))))
+    (is (= "robotandbaby_001.jpg" (slurp (io/file tmpdir "img_preview" "filename"))))
+    (is (= "image/jpeg" (slurp (io/file tmpdir "img_preview" "mimetype"))))
+
     (fs/delete-dir tmpdir)
     )
   )
@@ -138,6 +150,7 @@

           [oai_dcs response-tmpdir] (-> (h/save-marcxml2mods-response [actual-metadata payload])
                                         h/parse-mods-files
+                                        h/add-urnnbn-to-first-mods
                                         h/mods->oai_dcs
                                         )
           ]
@@ -153,11 +166,45 @@
         (is (=  (zx/xml1-> root :dc:title  zx/text)  "Umění programování v UNIXu"))
         (is (=  (zx/xml1-> root :dc:date zx/text) "2004"))
         (is (=  (set (zx/xml-> root :dc:identifier zx/text))
-                #{"uuid:asd" "ccnb:cnb001492461" "isbn:80-251-0225-4 (brož.)" "oclc:85131856"}))))
+                #{"urnnbn:urn:nbn:cz:mzk-0005ol" "uuid:asd" "ccnb:cnb001492461"
+                  "isbn:80-251-0225-4 (brož.)" "oclc:85131856"}))))

     (fs/delete-dir tmpdir))
   )

+(deftest save-img-files-test
+  (testing "save img files to FOXML dir"
+    (def payload (slurp "resources/export-request.json"))
+    (def tmpdir (fs/temp-dir "test-export-to-kramerius-request-"))
+
+    (h/save-request  [[nil payload] tmpdir])
+
+    (let [metadata (read-string (slurp "resources/marcxml2mods-response-metadata.clj"))
+          payload (slurp "resources/marcxml2mods-response-payload.json")
+          actual-metadata (-> metadata (assoc :headers
+                                              (-> metadata :headers (assoc "UUID" (.toString tmpdir)))))
+
+          [full-file preview-file result-tmpdir]
+          (-> (h/parse-mods-files (h/save-marcxml2mods-response [actual-metadata payload]))
+              h/save-img-files)
+
+          uuid (slurp (io/file result-tmpdir "uuid"))]
+
+      (is (= (.toString result-tmpdir) (.toString tmpdir)))
+      (is (.isDirectory (io/file result-tmpdir uuid)))
+      (is (.isDirectory (io/file result-tmpdir uuid "img")))
+
+      (is (.exists (io/file result-tmpdir uuid "img" (-> full-file :filename))))
+      (is (= :img_full (-> full-file :img-type)))
+      (is (= "application/pdf" (-> full-file :mime-type)))
+
+      (is (.exists (io/file result-tmpdir uuid "img" (-> preview-file :filename))))
+      (is (= :img_preview (-> preview-file :img-type)))
+      (is (= "image/jpeg" (-> preview-file :mime-type))))
+
+    (fs/delete-dir tmpdir)
+    )
+  )

 (deftest foxml
   (testing "make FOXML"
@@ -172,7 +219,8 @@
                                               (-> metadata :headers (assoc "UUID" (.toString tmpdir)))))
           [mods tmpdir-0] (h/parse-mods-files (h/save-marcxml2mods-response [actual-metadata payload]))
           [oai_dcs tmpdir-1] (h/mods->oai_dcs [mods tmpdir-0])
-          [fname result-tmpdir] (h/make-foxml [mods tmpdir-0] [oai_dcs tmpdir-1])
+          [full-file preview-file tmpdir-2] (h/save-img-files [mods tmpdir-0])
+          [fname result-tmpdir] (h/make-foxml [mods tmpdir-0] [oai_dcs tmpdir-1] [full-file preview-file tmpdir-2] "/var/fedora/import/")
           uuid (slurp (io/file result-tmpdir "uuid"))
           ]

@@ -185,11 +233,29 @@
                      xml/parse
                      zip/xml-zip
                      )]
+        ;(def root (-> (io/file "/tmp/aa.xml") io/input-stream xml/parse zip/xml-zip))
+        (let [ref (zx/xml1-> root :datastream [(zx/attr= :ID "IMG_FULL")] :datastreamVersion :contentLocation (zx/attr :REF)) ]
+          (is (= (.toString (io/file "file:/var/fedora/import/" uuid "img" (-> full-file :filename))) ref))
+          )
+        (let [ref (zx/xml1-> root :datastream [(zx/attr= :ID "IMG_PREVIEW")] :datastreamVersion :contentLocation (zx/attr :REF)) ]
+          (is (= (.toString (io/file "file:/var/fedora/import/" uuid "img" (-> preview-file :filename))) ref))
+          )
         )
+
       ;(pp/pprint result-tmpdir)
       ;(println (slurp (io/file result-tmpdir uuid (str uuid ".xml"))))
       )

-    (fs/delete-dir tmpdir)
-    )
-  )
+    ;(fs/delete-dir tmpdir)
+    )
+  )
+
+
+
+
+
+
+
+
+
+


Move the sigtuna files properly

Move the sigtuna files properly

--- src/mdr2/abacus/import.clj
+++ src/mdr2/abacus/import.clj
@@ -257,7 +257,7 @@

 (defn format-sigtuna-move [production]
   (let [old (nio/resolve-path old-production-root (prod/dam-number production))]
-    (format "mv %s %s\n" old (path/structured-path production))))
+    (format "mv %s/* %s\n" old (path/structured-path production))))

 (defn format-recode-xml [production]
   (let [path (path/structured-path production)


stub out future implementation for query execution endpoint.

--- src/metabase/api/query.clj
+++ src/metabase/api/query.clj
@@ -102,9 +102,9 @@
   {:success true})

-;(defendpoint POST "/:id" [id]
-;  ;; TODO - permissions check
-;  (->404 (sel :one Org :id id)))
+(defendpoint POST "/:id" [id]
+  ;; TODO - implementation (execute a query)
+  {:TODO "TODO"})

 (define-routes)


check for database read access on query create.

--- src/metabase/api/query.clj
+++ src/metabase/api/query.clj
@@ -34,6 +34,7 @@
                 (order :name :ASC)))
     (hydrate :creator :database)))

+
 (defn query-clone
   "Create a new query by cloning an existing query.  Returns a 403 if user doesn't have acces to read query."
   [query-id]
@@ -46,30 +47,35 @@
                     :creator_id *current-user-id*))
          (mapply ins Query))))

+
 (defn query-create
   "Create a new query from user posted data."
-  [{:keys [name sql timezone public_perms database]}]
-  (require-params database)             ; sql, timezone?
-  (check (exists? Database :id database) [400 "Specified database does not exist."])
-  ;; TODO - validate that user has perms to create against this database
+  [{:keys [name sql timezone public_perms database]
+    :or {name (str "New Query: " (java.util.Date.))
+         public_perms common/perms-none}}]
+  (require-params database sql)
+  (read-check Database (:id database))
   (ins Query
     :type "rawsql"
-    :name (or name (str "New Query: " (java.util.Date.)))
+    :name name
     :details {:sql sql
               :timezone timezone}
-    :public_perms (or public_perms common/perms-none)
+    :public_perms public_perms
     :creator_id *current-user-id*
     :database_id database))
+

 (defendpoint POST "/" [:as {{:keys [clone] :as body} :body}]
   (if clone
     (query-clone clone)
     (query-create body)))

+
 (defendpoint GET "/:id" [id]
   (->404 (sel :one Query :id id)
          read-check
          (hydrate :creator :database :can_read :can_write)))
+

 (defendpoint PUT "/:id" [id :as {{:keys [sql timezone version] :as body} :body}]
   ;; TODO - check that database exists and user has permission (if specified)


Refactored cycler to just be a lazy list that doesn't save tons of values.

--- test/simple_symbolic_regression_clojure/gp_test.clj
+++ test/simple_symbolic_regression_clojure/gp_test.clj
@@ -7,15 +7,15 @@
 ;; helpers for testing

 (defn cycler
-  [numbers]
-  (atom {:step 0, :values (cycle numbers)})
+  [returns]
+  (atom (cycle returns))
   )

 (defn step-cycler
   [c]
-  (let [result (nth (:values @c) (:step @c))]
+  (let [result (first @c)]
     (do
-      (swap! c assoc :step (inc (:step @c)))
+      (swap! c rest)
       result
   )))


Remove contrib dependencies from r.m.file-info.

--- ring-core/src/ring/middleware/file_info.clj
+++ ring-core/src/ring/middleware/file_info.clj
@@ -1,12 +1,11 @@
 (ns ring.middleware.file-info
   "Augment Ring File responses."
-  (:use [clojure.contrib.def :only (defvar-)]
-        ring.util.response)
+  (:use ring.util.response)
   (:import java.io.File
            [java.util Date Locale TimeZone]
            java.text.SimpleDateFormat))

-(defvar- base-mime-types
+(def ^{:private true} base-mime-types
   {"ai"    "application/postscript"
    "asc"   "text/plain"
    "avi"   "video/x-msvideo"


Revert "Eliminate extra ns form"

Revert "Eliminate extra ns form"

This reverts commit f8103d0ddd851d80a10825eb738ba5e298312d7a.

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -48,6 +48,7 @@
   (and (seq? form) (= 'in-ns (first form))))

 (defn ^:export read-eval-print [line]
+  (ns cljs.user)
   (binding [ana/*cljs-ns* @current-ns
             *ns* (create-ns @current-ns)
             r/*data-readers* tags/*cljs-data-readers*]


Adding support for XPaths with selecting ranges of child indexes.

--- umm-spec-lib/src/cmr/umm_spec/simple_xpath.clj
+++ umm-spec-lib/src/cmr/umm_spec/simple_xpath.clj
@@ -11,7 +11,7 @@
   * Subselect by element equality: /catalog/books[price='5.95']/title
   * Subselect by child index: /catalog/books[1]/author
   * Subselect by range of child indexes /catalog/books[2..4]/author.  Openended ranges like [2..]
-  are supported as well
+  are supported as well. (Note this is not a standard XPath feature.)

   Note that there will be undefined behavior if an unsupported XPath is used.


[#228] Storing system in an atom

[#228] Storing system in an atom

--- api/src/clojure/org/akvo/flow_api/main.clj
+++ api/src/clojure/org/akvo/flow_api/main.clj
@@ -9,6 +9,8 @@
             [nrepl.server :as repl]
             [org.akvo.flow-api.utils :as utils])
   (:import (java.io FileNotFoundException)))
+
+(defonce the-system (atom nil))

 (defn secret-value
   "Reads the value of a secret from a file. It expects an
@@ -40,7 +42,8 @@
                   'event-log-host (secret-value "event-log-host")
                   'event-log-port (Integer/parseInt (secret-value "event-log-port"))}
         system   (->> (load-system [(io/resource "org/akvo/flow_api/system.edn")] bindings)
-                      (component/start))]
+                      (component/start)
+                      (reset! the-system))]
     (add-shutdown-hook ::stop-system #(component/stop system))
     (println "Started HTTP server on port" (-> system :http :port))
     (let [repl-server (repl/start-server :port (Integer/parseInt (:repl-port env "0")))]


move functional core around file

move functional core around file

--- src/shoutout.clj
+++ src/shoutout.clj
@@ -34,6 +34,25 @@
     (s/join "," (:users feature))
     "|"
     (s/join "," (:groups feature))))
+
+(defn is-active-in-percentage [{percentage :percentage} user]
+  (< (mod (crc32 user) 100) percentage))
+
+(defn is-active-user? [{active-users :users} user]
+  (contains? active-users user))
+
+(defn is-active-in-group? [{active-groups :groups} group-definition user]
+  (some
+    (fn [group-name]
+      ((group-definition group-name (constantly false)) user))
+
+    active-groups))
+
+(defn active-feature? [feature group-definition user]
+  (or
+    (is-active-in-percentage feature user)
+    (is-active-user? feature user)
+    (is-active-in-group? feature group-definition user)))

 (defprotocol ShoutoutStorage
   (read-from-storage [storage ^String feature-name])
@@ -94,25 +113,6 @@
              :percentage
              percent))))

-(defn is-active-in-percentage [{percentage :percentage} user]
-  (< (mod (crc32 user) 100) percentage))
-
-(defn is-active-user? [{active-users :users} user]
-  (contains? active-users user))
-
-(defn is-active-in-group? [{active-groups :groups} group-definition user]
-  (some
-    (fn [group-name]
-      ((group-definition group-name (constantly false)) user))
-
-    active-groups))
-
-(defn active-feature? [feature group-definition user]
-  (or
-    (is-active-in-percentage feature user)
-    (is-active-user? feature user)
-    (is-active-in-group? feature group-definition user)))
-
 (defn active? [{storage :storage groups :groups} feature-name user]
   (active-feature? (get-from-storage storage feature-name) groups user))


Support item 10 checkings in query mode

Support item 10 checkings in query mode

--- src/app/cli.clj
+++ src/app/cli.clj
@@ -16,7 +16,7 @@
               ["-i" "--interactive" "launch interactive mode" :flag true :default false]
               ["-l" "--linter" "launch linter mode" :flag true :default false]
               ["-d" "--dir DIRNAME" "directory containing the code to check (default current dir)" :default "."]
-              ["-q" "--query QUERYNAME" "REQUIRED: Query to perform: mc=many constructors, mcp=many constructor parameters, st=singleton type, u=utils classes"]
+              ["-q" "--query QUERYNAME" "REQUIRED: Query to perform: mc=many constructors, mcp=many constructor parameters, st=singleton type, ts=overrides toString()?, u=utils classes"]
               ["-t" "--threshold VALUE" "Threshold to be used in the query" :default 0
                :parse-fn #(Integer/parseInt %)
                :validate [#(>= % 0) "Must be a number equal or greater to 0"]]])
@@ -26,6 +26,7 @@
    :mc classesWithManyConstructorsOp
    :mcp constructorsWithManyParametersOp
    :st classesAndSingletonTypeOp
+   :ts toStringOp
    :u utilsClassesOp})

 (defn run [opts]


Updated with new dependency versions

Updated with new dependency versions

--- test/test.clj
+++ test/test.clj
@@ -5,17 +5,17 @@
 (require 'test.compojure.html.form-helpers)
 (require 'test.compojure.validation)

-(.println *test-out* "compojure.html:")
+(println "compojure.html:")
 (print-color-results (verify-facts 'test.compojure.html))
-(.println *test-out*)
+(println)

-(.println *test-out* "compojure.html.form-helpers:")
+(println "compojure.html.form-helpers:")
 (print-color-results (verify-facts 'test.compojure.html.form-helpers))
-(.println *test-out*)
+(println)

-(.println *test-out* "compojure.http.routes:")
+(println "compojure.http.routes:")
 (print-color-results (verify-facts 'test.compojure.http.routes))
-(.println *test-out*)
+(println)

-(.println *test-out* "compojure.validation:")
+(println "compojure.validation:")
 (print-color-results (verify-facts 'test.compojure.validation))


waiting for start and preventing start on a running machine conflict

--- src/openstack/provider.clj
+++ src/openstack/provider.clj
@@ -66,6 +66,14 @@
     {:type ::openstack:status-failed :timeout timeout}
       "Timed out on waiting for ip to be available"))

+(defn running? [this] (= (.status this) "running"))
+
+(defn wait-for-start [this timeout]
+  "Wait for an ip to be avilable"
+  (wait-for {:timeout timeout} #(running? this)
+    {:type ::openstack:status-failed :timeout timeout}
+      "Timed out on waiting for ip to be available"))
+
 (defn system-val
   "grabbing instance id of spec"
    [spec ks]
@@ -83,6 +91,7 @@
   "update instance id"
   (when (s/system-exists? (spec :system-id))
      (s/partial-system (spec :system-id) {:openstack {:instance-id id}})))
+

 (defconstrainedrecord Instance [tenant spec user]
   "An Openstack compute instance"
@@ -106,10 +115,12 @@

   (start [this]
      (with-instance-id
-       (debug "starting" instance-id )
-       (.action (servers tenant) instance-id Action/START)
-       (wait-for-ssh
-         (system-val spec [:machine :ip]) (get-in spec [:machine :user]) [5 :minute])))
+       (when-not (running? this)
+         (debug "starting" instance-id )
+         (.action (servers tenant) instance-id Action/START)
+         (wait-for-start this [5 :minute])
+         (wait-for-ssh
+           (system-val spec [:machine :ip]) (get-in spec [:machine :user]) [5 :minute]))))

   (delete [this]
      (with-instance-id


Commenting corrections

Commenting corrections

--- src/polismath/clusters.clj
+++ src/polismath/clusters.clj
@@ -61,7 +61,7 @@

 (defn cluster-step
-  "Performs one step of an interative K-means:
+  "Performs one step of an iterative K-means:
   data-iter: seq of pairs (id, position), eg (pid, person-rating-row)
   clusters: array of clusters"
   [data-iter k clusters]
@@ -72,7 +72,7 @@
     ; Apply mean to get updated centers
     (map #(-> (assoc % :center (mean (:positions %)))
             (dissoc :positions)))
-    ; Filter out clusters that don't hvae any members (should maybe log on verbose?)
+    ; Filter out clusters that don't have any members (should maybe log on verbose?)
     (filter #(> (count (:members %)) 0))))


moved control

moved control

--- src/pomodoro/pomodoro.cljs
+++ src/pomodoro/pomodoro.cljs
@@ -84,27 +84,28 @@
       (dom/div
         #js {:className "timer-controls"}
         ;; play button
-        (dom/div #js {:className "play-control-outer control-outer"}
-                 (dom/div #js {:className "control-inner"}
-                          (dom/div #js {:className "control-icon control-icon-play"
-                                        :onClick #(om/transact! on (fn [_] true))}
-                                   (dom/i #js {:className "icon-play"}))))
+        (dom/div
+          #js {:className "play-control-outer control-outer"}
+          (dom/div #js {:className "control-inner"
+                        :onClick #(om/transact! on (fn [_] true))}
+                   (dom/div #js {:className "control-icon control-icon-play"}
+                            (dom/i #js {:className "icon-play"}))))

         ;; Stop button
-        (dom/div #js {:className "stop-control-outer control-outer"}
-                 (dom/div #js {:className "control-inner"}
-                          (dom/div #js {:className "control-icon control-icon-stop"
-                                        :onClick #(om/transact! on (fn [_] false))}
-                                   (dom/i #js {:className "icon-stop"}))))
+        (dom/div
+          #js {:className "stop-control-outer control-outer"}
+          (dom/div #js {:className "control-inner"
+                        :onClick #(om/transact! on (fn [_] false))}
+                   (dom/div #js {:className "control-icon control-icon-stop"}
+                            (dom/i #js {:className "icon-stop"}))))
         ;; Reset button
-        (dom/div #js {:className "reset-control-outer control-outer"}
-                 (dom/div #js {:className "control-inner"
-                               :onClick #(when (not (.valueOf on))
-                                           (om/transact!
-                                             cursor
-                                             (fn [c] (into c (default-state)))))}
-                          (dom/div #js {:className "control-icon"}
-                                   (dom/i #js {:className "icon-refresh"}))))))))
+        (dom/div
+          #js {:className "reset-control-outer control-outer"}
+          (dom/div #js {:className "control-inner"
+                        :onClick #(when (not (.valueOf on))
+                                    (om/transact! cursor (fn [c] (default-state))))}
+                   (dom/div #js {:className "control-icon"}
+                            (dom/i #js {:className "icon-refresh"}))))))))
 ; END timer-controls

 ; START timer-view
@@ -132,7 +133,6 @@
 ; END timer-middle

 ; START timer-bottom
-;; TODO implement current time
 (defn timer-bottom [cursor owner]
   (reify
     om/IInitState
@@ -146,7 +146,6 @@
     (render [_]
       (dom/div
         #js {:className "timer-bottom"}
-        (dom/div #js {:className "timer-current-title"} "Current Time:")
         (dom/div #js {:className "timer-current-time"}
                  (.format (js/moment) "h:mm:ss a" (om/get-state owner :now)))))))
 ; END timer-bottom
@@ -186,5 +185,4 @@
         (om/build timer-bottom cursor)))))
 ; END pom-view

-(om/root pom-view app-state
-  {:target (. js/document (getElementById "app"))})
+(om/root pom-view app-state {:target (. js/document (getElementById "app"))})


undo for text resizing

undo for text resizing

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -228,7 +228,7 @@
                                                                                (:layer/font-family layer state/default-font-family)))
               :layer/end-y (- (:layer/start-y layer) font-size)})))
     seq
-    (d/transact! (:db state))))
+    (#(d/transact! (:db state) % {:can-undo? true}))))

 (defmethod handle-keyboard-shortcut-after :shrink-text
   [state shortcut-name]


Update client tests

Update client tests

--- test/clojure_template/client/core_test.cljs
+++ test/clojure_template/client/core_test.cljs
@@ -2,5 +2,6 @@
   (:require-macros [cljs.test :refer :all])
   (:require [cljs.test]))

-(testing "Example test"
-  (is (= 1 1)))
+(deftest core-test
+  (testing "Example test"
+    (is (= 1 1))))


CMR-4152: Set request log format to log timestamps the same way as our debug log. See if that addresses Splunk issue of combining distinct entries into a single event.

--- common-lib/src/cmr/common/api/web_server.clj
+++ common-lib/src/cmr/common/api/web_server.clj
@@ -9,6 +9,7 @@
    [ring.adapter.jetty :as jetty])
   (:import
    (java.io ByteArrayInputStream InputStream)
+   (java.util TimeZone)
    (org.eclipse.jetty.server Server NCSARequestLog Connector HttpConnectionFactory)
    (org.eclipse.jetty.server.handler RequestLogHandler)
    (org.eclipse.jetty.servlets.gzip GzipHandler)))
@@ -94,7 +95,9 @@
     (.setHandler existing-handler)
     (.setRequestLog
       (doto (NCSARequestLog.)
-        (.setLogLatency true)))))
+        (.setLogLatency true)
+        (.setLogTimeZone (.getID (TimeZone/getDefault)))
+        (.setLogDateFormat "yyyy-MM-dd hh:mm:ss.SSS")))))

 (defn- create-gzip-handler
   "Setup gzip compression for responses.  Compression will be used for any response larger than


fix tests for new arities in A* funcs

fix tests for new arities in A* funcs


Ensure *print-newline* is set to true, even if bootstrapped

--- Clojure/src/ambly/core.clj
+++ Clojure/src/ambly/core.clj
@@ -582,9 +582,7 @@
                      (js/CLOSURE_IMPORT_SCRIPT
                        (if (some? goog/debugLoader_)
                          (.getPathFromDeps_ goog/debugLoader_ name)
-                         (js* "~{}[~{}]" (.. js/goog -dependencies_ -nameToPath) name))))))))
-          (repl/evaluate-form repl-env env "<cljs repl>"
-            '(set! *print-newline* true)))
+                         (js* "~{}[~{}]" (.. js/goog -dependencies_ -nameToPath) name)))))))))
         (let [expected-clojurescript-version (cljs.util/clojurescript-version)
               actual-clojurescript-version (:value (jsc-eval repl-env "cljs.core._STAR_clojurescript_version_STAR_"))]
           (when (and (some? actual-clojurescript-version)
@@ -594,6 +592,8 @@
                 "\n         is running ClojureScript " actual-clojurescript-version
                 ", while the Ambly REPL is\n         set up to use ClojureScript "
                 expected-clojurescript-version ".\n")))))
+      (repl/evaluate-form repl-env env "<cljs repl>"
+        '(set! *print-newline* true))
       {:merge-opts {:output-dir webdav-mount-point}})
     (catch Throwable t
       (tear-down repl-env)


fdef for transpose

fdef for transpose


show midi notes and frequencies

show midi notes and frequencies


Update test_parser.clj

Update test_parser.clj

--- src/selmer/test_parser.clj
+++ src/selmer/test_parser.clj
@@ -1,7 +1,6 @@
 (ns selmer.test-parser)

-(declare parse)
-(declare expr-tag)
+(declare parse expr-tag)

 (defn render [template params]
   (->> (for [element template]


Bring query interface back into consistency with the rest

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -16,20 +16,35 @@
   "Main namespace for working with CQL, prepared statements. Convenience functions
    for key operations built on top of CQL."
   (:refer-clojure :exclude [update])
-  (:require [qbits.hayt.cql                 :as hayt]
-            [clojurewerkz.cassaforte.query  :as q]
+  (:require [clojurewerkz.cassaforte.query  :as q]
+            [qbits.hayt.cql                 :as hayt]
             [clojurewerkz.cassaforte.client :as cc])
   (:import com.datastax.driver.core.Session))

+(defn ^:private compile-query-
+  "Compiles query from given `builder` and `query-params`"
+  [query-params builder]
+  (apply builder (flatten query-params)))
+
+(defn ^:private render-query-
+  "Renders compiled query"
+  [query-params]
+  (let [renderer (if hayt/*prepared-statement*
+                   hayt/->prepared
+                   hayt/->raw)]
+    (renderer query-params)))
+
 (defn ^:private execute-
   [^Session session query-params builder]
-  (let [rendered-query (cc/render-query (cc/compile-query query-params builder))]
-    (cc/execute session rendered-query {:prepared hayt/*prepared-statement*})))
+  (let [rendered-query (render-query- (compile-query- query-params builder))]
+    (cc/execute rendered-query session)
+    ))

 (defn ^:private execute-async-
   [^Session session query-params builder]
-  (let [rendered-query (cc/render-query (cc/compile-query query-params builder))]
-    (cc/execute-async session rendered-query {:prepared hayt/*prepared-statement*})))
+  (comment ;;; doesnt work yet
+    (let [rendered-query (render-query- (compile-query- query-params builder))]
+      (cc/execute-async rendered-query session))))

 ;;
 ;; Schema operations
@@ -147,7 +162,7 @@
        (map (comp (partial apply (partial q/insert-query table)) flatten vector))
        (apply q/queries)
        q/batch-query
-       cc/render-query))
+       render-query-))

 (defn insert-batch
   "Performs a batch insert (inserts multiple records into a table at the same time).
@@ -155,19 +170,19 @@
   and the clauses in a vector"
   [^Session session table records]
   (let [query (batch-query-from table records)]
-    (cc/execute session query {:prepared hayt/*prepared-statement*})))
+    (execute- session query)))

 (defn insert-batch-async
   "Same as insert-batch but returns a future"
   [^Session session table records]
   (let [query (batch-query-from table records)]
-    (cc/execute-async session query {:prepared hayt/*prepared-statement*})))
+    (execute-async- session query)))

 (defn atomic-batch
   "Executes a group of operations as an atomic batch (BEGIN BATCH ... APPLY BATCH)"
   [^Session session & clauses]
-  (let [q (cc/render-query (cc/compile-query clauses q/batch-query))]
-    (cc/execute session q {:prepared hayt/*prepared-statement*})))
+  (let [q (render-query- (compile-query- clauses q/batch-query))]
+    (execute- session q)))

 (defn update
   "Updates one or more columns for a given row in a table. The `where` clause


Add http cache support.

Add http cache support.


free scope buffer (if it exists) when scope is closed

--- src/overtone/gui/scope.clj
+++ src/overtone/gui/scope.clj
@@ -217,6 +217,8 @@
                (server-connected?))
       (try
         (kill bus-synth)
+        (when-let [b (:buf s)]
+          (buffer-free b))
         (catch Exception e)))
     (dosync (alter scopes* dissoc id))))


add out-bus as an arg for sample-playing synths

--- src/overtone/sc/sample.clj
+++ src/overtone/sc/sample.clj
@@ -16,35 +16,35 @@
   (do
     (defsynth mono-player
       "Plays a single channel audio buffer."
-      [buf 0 rate 1.0 start-pos 0.0 loop? 0 vol 1]
-      (out 0 (* vol
-                (pan2
-                 (scaled-play-buf 1 buf rate
-                                  1 start-pos loop?
-                                  FREE)))))
+      [out-bus 0 buf 0 rate 1.0 start-pos 0.0 loop? 0 vol 1]
+      (out out-bus (* vol
+                      (pan2
+                       (scaled-play-buf 1 buf rate
+                                        1 start-pos loop?
+                                        FREE)))))

     (defsynth stereo-player
       "Plays a dual channel audio buffer."
-      [buf 0 rate 1.0 start-pos 0.0 loop? 0 vol 1]
-      (out 0 (* vol
-                (scaled-play-buf 2 buf rate
-                                 1 start-pos loop?
-                                 FREE))))
+      [out-bus 0 buf 0 rate 1.0 start-pos 0.0 loop? 0 vol 1]
+      (out out-bus (* vol
+                      (scaled-play-buf 2 buf rate
+                                       1 start-pos loop?
+                                       FREE))))

     (defsynth mono-stream-player
       "Plays a single channel streaming buffer-cue. Must be freed manually when
       done."
-      [buf 0 rate 1 loop? 0 vol 1]
-      (out 0 (* vol
-                (pan2
-                 (scaled-v-disk-in 1 buf rate loop?)))))
+      [out-bus 0 buf 0 rate 1 loop? 0 vol 1]
+      (out out-bus (* vol
+                      (pan2
+                       (scaled-v-disk-in 1 buf rate loop?)))))

     (defsynth stereo-stream-player
       "Plays a dual channel streaming buffer-cue. Must be freed manually when
       done."
-      [buf 0 rate 1 loop? 0 vol 1]
-      (out 0 (* vol
-                (scaled-v-disk-in 2 buf rate loop?))))))
+      [out-bus 0 buf 0 rate 1 loop? 0 vol 1]
+      (out out-bus (* vol
+                      (scaled-v-disk-in 2 buf rate loop?))))))

 (defonce loaded-samples* (ref {}))


improve docstring for at macro

improve docstring for at macro

--- src/overtone/sc/server.clj
+++ src/overtone/sc/server.clj
@@ -50,15 +50,34 @@
   (= :external (:connection-type (connection-info))))

 (defmacro at
-  "All messages sent within the body will be sent in the same
-  timestamped OSC bundle.  This bundling is thread-local, so you don't
-  have to worry about accidentally scheduling packets into a bundle
-  started on another thread.
-
-  Warning, all liveness and node blocking when not ready checks and
-  functionality is disabled within the context of this macro. This means
-  that it's perfectly possible for the node you wish to control to either have
-  been since terminated or not had time to be initialised."
+  "Schedule server communication - specify that communication messages
+   execute on the server at a specific time in the future:
+
+   ;; control synth foo to change :freq to 150
+   ;; one second from now:
+   (at (+ (now) 1000) (ctl foo :freq 150))
+
+   Only affects code that communicates with the server using OSC
+   messaging i.e. synth triggering and control. All code in the body of
+   the at macro is executed immediately. Any OSC messages which are
+   triggered as a result of executing the body are not immediately sent
+   but are instead captured and then sent in a single OSC bundle with
+   the specified timestamp once the body has completed. The server then
+   stores these bundles and executes them at the specified time. This
+   allows you to schedule the triggering and control of synths for
+   specific times.
+
+   The bundling is thread-local, so you don't have to worry about
+   accidentally scheduling packets into a bundle started on another
+   thread.
+
+   Be careful not to confuse at with apply-at and apply-by which
+   directly affect Clojure code.
+
+   Warning, all liveness and 'node blocking when not ready' checks are
+   disabled within the context of this macro. This means that it will
+   fail silently if a server node you wish to control either has been
+   since terminated or not had time to be initialised."
   [time-ms & body]
   `(with-inactive-modification-error :silent
      (without-node-blocking


update at macro docstring to communicate that users are on their own with ensuring that the nodes they are controlling are the nodes they actually want to control...

--- src/overtone/sc/server.clj
+++ src/overtone/sc/server.clj
@@ -53,7 +53,15 @@
   "All messages sent within the body will be sent in the same
   timestamped OSC bundle.  This bundling is thread-local, so you don't
   have to worry about accidentally scheduling packets into a bundle
-  started on another thread."
+  started on another thread.
+
+  Warning, all liveness and node blocking when not ready checks and
+  functionality is disabled within the context of this macro. This means
+  that it's perfectly possible for you to be controlling a different
+  node than you expect to be controlling if your control message is
+  being executed in the future and in the meantime, the node you wished
+  to control has been terminated and another node has been created with
+  the same id (ids are recycled). "
   [time-ms & body]
   `(binding [overtone.sc.dyn-vars/*inactive-node-modification-error*   :silent
              overtone.sc.dyn-vars/*inactive-buffer-modification-error* :silent


change "devbar" to use bootstrap navbar functionality

--- src/leiningen/new/lein_quick_om/devbar.cljs
+++ src/leiningen/new/lein_quick_om/devbar.cljs
@@ -17,19 +17,13 @@
 (defn new-container-el
   "get a new container element"
   []
-  (let [new-el (.createElement js/document "div")]
+  (let [new-el (.createElement js/document "nav")]
     (.setAttribute new-el "id" container-id)
-    (.setAttribute new-el "class" "container")
+    (.setAttribute new-el "class" "navbar navbar-default")
     new-el))

 (def bar-attrs
-  {:style {:width "100%"
-           :borderStyle "solid"
-           :borderWidth "1px"
-           :borderTop "none"
-           ;:heig;t "50pt"
-           }
-   :className "row"})
+  {:className "container-fluid"})

 (defn get-body-div
   "gets a container div at the top of the body, creating it if necessary."
@@ -43,24 +37,19 @@

 (defn dev-button
   [[f label]]
-  (b/button {:bs-style "primary"
-             :bs-size "xsmall"
-             :onClick f}
-            label)
-  )
+  (dom/li nil
+          (dom/a #js {:href "#"
+                      :onClick f}
+                 label)))

 (defn button-section
   [button-pairs]
-  (apply b/toolbar nil
-         (mapv dev-button button-pairs)
-         ))
+  (apply dom/ul #js {:className "nav navbar-nav navbar-right"}
+         (mapv dev-button button-pairs)))

-(defn app-title
-  [title]
-  (dom/h3 #js {:style #js {
-                           :marginTop 0
-                           :marginBottom 0}}
-(str "dev: " "“" title "”")))
+(def app-title
+  (dom/h3 #js {:style #js {:className "navbar-brand"}}
+          (str "dev: “{{name}}”")))

 (defn dev-bar
@@ -70,9 +59,8 @@
       om/IRender
       (render [_]
         (dom/div (clj->js bar-attrs)
-                 (dom/div #js {:className "col-xs-3"}
-                         (app-title "{{name}}"))
-                 (dom/div #js {:className "col-xs-5"} nil)
+                 (dom/div #js {:className "navbar-header"}
+                          app-title)
                  (button-section button-pairs)
                  )))))


The predicate is no longer needed

The predicate is no longer needed

--- src/time_tracker/invoices/handlers/spec.clj
+++ src/time_tracker/invoices/handlers/spec.clj
@@ -35,12 +35,6 @@
                             ::core-spec/utc-offset])
            ::invoices-spec/date-range))

-(defn- invoice-data-pred
-  [{:keys [user-rates users] :as invoice-data}]
-  (let [rate-user-ids  (set (map :user-id user-rates))
-        users-user-ids (set (keys users))]
-    (= rate-user-ids users-user-ids)))
-
 (s/def ::users (users-spec/normalized-users-spec 1))
 (s/def ::timers (timers-spec/normalized-timers-spec 0))


Simplified rendering of options toolbox.

--- src/uxbox/ui/workspace/sidebar/options.cljs
+++ src/uxbox/ui/workspace/sidebar/options.cljs
@@ -15,6 +15,7 @@
             [uxbox.ui.colorpicker :refer (colorpicker)]
             [uxbox.ui.workspace.recent-colors :refer (recent-colors)]
             [uxbox.ui.workspace.base :as wb]
+            [uxbox.util.lens :as ul]
             [uxbox.util.dom :as dom]
             [uxbox.util.data :refer (parse-int parse-float read-string)]))

@@ -101,11 +102,11 @@
          [:option {:value ":dashed"} "Dashed"]
          [:option {:value ":mixed"} "Mixed"]]
         [:input.input-text
-        {:placeholder "Width"
-        :type "number"
-        :min "0"
-        :value (:stroke-width shape "1")
-        :on-change on-width-change}]]
+         {:placeholder "Width"
+          :type "number"
+          :min "0"
+          :value (:stroke-width shape "1")
+          :on-change on-width-change}]]

        ;; SLIDEBAR FOR ROTATION AND OPACITY
        [:span "Color"]
@@ -536,7 +537,6 @@
 (defn options-menus-render
   [own shape]
   (let [local (:rum/local own)
-        shape (rum/react shape)
         menus (get +menus-map+ (:type shape))
         active-menu (:menu @local (first menus))]
     (html
@@ -558,16 +558,20 @@
   (mx/component
    {:render options-menus-render
     :name "options-menus"
-    :mixins [mx/static rum/reactive (mx/local)]}))
+    :mixins [mx/static (mx/local)]}))
+
+(def ^:const selected-shape-l
+  (letfn [(getter [state]
+            (let [selected (get-in state [:workspace :selected])]
+              (when (= 1 (count selected))
+                (get-in state [:shapes-by-id (first selected)]))))]
+    (as-> (ul/getter getter) $
+      (l/focus-atom $ st/state))))

 (defn options-toolbox-render
   [own]
-  (let [workspace (rum/react wb/workspace-l)
-        close #(rs/emit! (dw/toggle-flag :element-options))
-        shape (when (and (:selected workspace)
-                         (= (count (:selected workspace)) 1))
-                (let [shape-id (first (:selected workspace))]
-                  (l/focus-atom (l/in [:shapes-by-id shape-id]) st/state)))]
+  (let [shape (rum/react selected-shape-l)
+        close #(rs/emit! (dw/toggle-flag :element-options))]
     (html
      [:div.elementa-options.tool-window
       [:div.tool-window-bar


Added probability to method signature. Reuse merge-bounds from pamela.tpn/

--- src/pamela/inheritance.clj
+++ src/pamela/inheritance.clj
@@ -1,20 +1,21 @@
-;; Copyright © 2016 Dynamic Object Language Labs Inc.
+;; Copyright © 2017 Dynamic Object Language Labs Inc.
 ;;
 ;; This software is licensed under the terms of the
 ;; Apache License, Version 2.0 which can be found in
 ;; the file LICENSE at the root of this distribution.

-;;; Acknowledgement and Disclaimer:
-;;; This material is based upon work supported by the Army Contracting
-;;; and DARPA under contract No. W911NF-15-C-0005.
-;;; Any opinions, findings and conclusions or recommendations expressed
-;;; in this material are those of the author(s) and do necessarily reflect the
-;;; views of the Army Contracting Command and DARPA.
+;; Acknowledgement and Disclaimer:
+;; This material is based upon work supported by the Army Contracting
+;; and DARPA under contract No. W911NF-15-C-0005.
+;; Any opinions, findings and conclusions or recommendations expressed
+;; in this material are those of the author(s) and do necessarily reflect the
+;; views of the Army Contracting Command and DARPA.

 (ns pamela.inheritance
   (:require [clojure.pprint :refer :all]
-            [pamela.utils :as putils]))
+            [pamela.utils :as putils]
+            [pamela.tpn]))

 (defn get-parents [clas ir]
@@ -43,7 +44,7 @@
 ; methods are uniquely identified by name-symbol, args( number of args)
 ; and following keys
 (def method-signature #{:pre :post :temporal-constraints :cost :reward
-                        :controllable :primitive :args-count})
+                        :controllable :primitive :args-count :probability})

 (defn make-method-signature
   "Given a method (map describing the method), return signature of the method"
@@ -62,9 +63,9 @@
                 (do (putils/dbg-println :warn "pamela.inheritance assoc-method method:"
                                         method-sym "has multiple methods with same signature" msig "\ncurrent will stay")
                     (putils/dbg-println :warn "current")
-                    (pprint (get msig result))
+                    (putils/dbg-println :warn (with-out-str (pprint (get msig result))))
                     (putils/dbg-println :warn "another")
-                    (pprint method))
+                    (putils/dbg-println :warn (with-out-str (pprint method))))
                 (merge result {msig method}))))
           {} m-vec))

@@ -99,16 +100,6 @@
                                  {} clist)]
     (methods-from-signature-map m-with-signature)))

-(defn merge-bounds
-  "Return new bounds with min and max values of either a or b"
-  [a b]
-  (let [la (first a)
-        lb (first b)
-        ua (second a)
-        ub (second b)]
-    [(apply min (remove nil? [la lb]))
-     (apply max (remove nil? [ua ub]))]))
-
 (defn merge-transition
   "More specific transition overrides specific transition.
   However, if they have :temporal-constraints, they are merged such that the
@@ -117,7 +108,7 @@
   (let [has-tc? (or (:temporal-constraints specific) (:temporal-constraints more-specific))
         trans (or more-specific specific)]
     (if has-tc?
-      (conj trans {:temporal-constraints [{:type :bounds :value (merge-bounds (-> specific :temporal-constraints first :value)
+      (conj trans {:temporal-constraints [{:type :bounds :value (pamela.tpn/merge-bounds (-> specific :temporal-constraints first :value)
                                                                               (-> more-specific :temporal-constraints first :value))}]
                    })
       trans)))


Fixed PermGen space crash; was due to graph-compile reifying inside of a function call

--- src/polismath/clusters.clj
+++ src/polismath/clusters.clj
@@ -283,17 +283,23 @@
     (count (filter filt-fn votes))))

-(defn- initial-comment-stats [vote-col]
-  ((gr/eager-compile
-     {:na (fnk [votes] (count-votes votes -1))
-      :nd (fnk [votes] (count-votes votes  1))
-      :ns (fnk [votes] (count-votes votes))
-      ; XXX - Change when we flip votes!!!
-      :pa (fnk [na ns] (/ (+ 1 na) (+ 2 ns)))
-      :pd (fnk [nd ns] (/ (+ 1 nd) (+ 2 ns)))
-      :pat (fnk [na ns] (prop-test na ns))
-      :pdt (fnk [nd ns] (prop-test nd ns))})
-    {:votes vote-col}))
+(let [initial-comment-stats-graphimpl
+        (gr/eager-compile
+          {:na (fnk [votes] (count-votes votes -1))
+           :nd (fnk [votes] (count-votes votes  1))
+           :ns (fnk [votes] (count-votes votes))
+           ; XXX - Change when we flip votes!!!
+           :pa (fnk [na ns] (/ (+ 1 na) (+ 2 ns)))
+           :pd (fnk [nd ns] (/ (+ 1 nd) (+ 2 ns)))
+           :pat (fnk [na ns] (prop-test na ns))
+           :pdt (fnk [nd ns] (prop-test nd ns))})]
+  ; The graph implementation is in a closure so that we don't reify classes every time function is called.
+  ; This can cause PermGen space crashes.
+  (defn- initial-comment-stats
+    "Vote count stats for a given vote column. This vote column should represent the votes for a specific
+    comment and group. Group comparisons happen later."
+    [vote-col]
+    (initial-comment-stats-graphimpl {:votes vote-col})))

 (defn- add-comparitive-stats [in-stats rest-stats]


Adding group-votes to the hash-map-subset on loading mongo conv; hopefully fix validation poop

--- src/polismath/conv_man.clj
+++ src/polismath/conv_man.clj
@@ -232,10 +232,15 @@
           (log/error "Unable to perform conv-update dump for" zid-str))))))

+;; XXX This is really bad, now that I think of it. There should be a data-driven declarative specification of
+;; what the sape of a conversation is, what is required, what needs to be modified etc, so everything is all
+;; in one place. This problem with teh :lastVoteTimestamp and group-votes etc came up precisely because there
+;; wasn't "one place to go" for modifying all of the potential points of interest for these kind of changes.
+
 (defn restructure-mongo-conv
   [conv]
   (-> conv
-      (hash-map-subset #{:rating-mat :lastVoteTimestamp :zid :pca :in-conv :n :n-cmts :group-clusters :base-clusters})
+      (hash-map-subset #{:rating-mat :lastVoteTimestamp :zid :pca :in-conv :n :n-cmts :group-clusters :base-clusters :group-votes})
       (assoc :last-vote-timestamp (get conv :lastVoteTimestamp)
              :last-mod-timestamp  (get conv :lastModTimestamp))
       ; Make sure there is an empty named matrix to operate on


Don't stop on interrupt

Don't stop on interrupt

Appears that the http client library or something sometimes causes unwanted interrupts

--- src/rpi_challenger/app.clj
+++ src/rpi_challenger/app.clj
@@ -67,11 +67,9 @@
         (poll-participant app participant (rest challenges))))))

 (defn ^:dynamic poll-participant-loop [app participant]
-  (while (not (Thread/interrupted))
+  (while true
     (try
       (poll-participant app participant (t/generate-challenges (:tournament @app)))
-      (catch InterruptedException e
-        (.interrupt (Thread/currentThread)))
       (catch Throwable e
         (.error logger (str "Unhandled error in polling participant " (:url participant)) e)))))


formatting

formatting

--- src/selmer/test_parser.clj
+++ src/selmer/test_parser.clj
@@ -105,8 +105,8 @@
               (.setLength buf 0)
               (recur (read-char rdr) tags [] end-tags))
             (let [content (-> content
-                                  (conj (.toString buf))
-                                  (conj (parse-tag tag rdr)))]
+                              (conj (.toString buf))
+                              (conj (parse-tag tag rdr)))]
               (.setLength buf 0)
               (recur (read-char rdr) tags content end-tags))))
         :else


this function was deleted

this function was deleted

--- src/tabby/client_state.clj
+++ src/tabby/client_state.clj
@@ -61,6 +61,22 @@
                         :body {:value :ok}}))
       state)))

+(defn- check-reads
+     "takes a client-id client map pair and a state and returns the same
+   but updated."
+  [state client-id]
+  (let [client (get-in state [:clients client-id])]
+    (if (and (has-reads? client)
+             (utils/quorum? (count (:peers state))
+                            (inc (count (:hb-count (:pending-read client)))))) ; count yourself
+     (if (get-in client [:pending-read :cas])
+       (handle-read-cas state client-id)
+       (-> (assoc-in state  [:clients client-id :pending-read] {})
+           (utils/transmit
+            {:client-dst client-id :uuid (:uuid (:pending-read client))
+             :body {:value (log/read-value state (:key (:pending-read client)))}})))
+     state)))
+
 (defn check-clients [state]
   (reduce (fn [state client-id]
             (-> (check-reads state client-id)


Migrate schemas on startup

Migrate schemas on startup

--- src/territory_bro/main.clj
+++ src/territory_bro/main.clj
@@ -3,40 +3,40 @@
 ;; The license text is at http://www.apache.org/licenses/LICENSE-2.0

 (ns territory-bro.main
-  (:refer-clojure :exclude [parse-opts])
-  (:require [clojure.tools.cli :refer [parse-opts]]
+  (:require [clojure.tools.cli :as cli]
             [clojure.tools.logging :as log]
             [luminus-migrations.core :as migrations]
             [luminus.http-server :as http]
             [luminus.repl-server :as repl]
             [mount.core :as mount]
-            [territory-bro.config :refer [env]]
-            [territory-bro.router :as router])
+            [territory-bro.config :as config]
+            [territory-bro.db :as db]
+            [territory-bro.router :as router]
+            [territory-bro.congregation :as congregation])
   (:gen-class))

-(def cli-options
+(def ^:private cli-options
   [["-p" "--port PORT" "Port number"
     :parse-fn #(Integer/parseInt %)]])

 (mount/defstate ^{:on-reload :noop} http-server
   :start
   (http/start
-    (-> env
+    (-> config/env
         (assoc :handler #'router/app)
         (update :io-threads #(or % (* 2 (.availableProcessors (Runtime/getRuntime)))))
-        (update :port #(or (-> env :options :port) %))))
+        (update :port #(or (-> config/env :options :port) %))))
   :stop
   (http/stop http-server))

 (mount/defstate ^{:on-reload :noop} repl-server
   :start
-  (when (get env :nrepl-port)
-    (repl/start {:bind (get env :nrepl-bind)
-                 :port (get env :nrepl-port)}))
+  (when (:nrepl-port config/env)
+    (repl/start {:bind (:nrepl-bind config/env)
+                 :port (:nrepl-port config/env)}))
   :stop
   (when repl-server
     (repl/stop repl-server)))
-

 (defn stop-app []
   (doseq [component (:stopped (mount/stop))]
@@ -44,30 +44,39 @@
   (shutdown-agents))

 (defn start-app [args]
-  (doseq [component (-> args
-                        (parse-opts cli-options)
-                        mount/start-with-args
-                        :started)]
+  (doseq [component (:started (mount/start-with-args (cli/parse-opts args cli-options)))]
     (log/info component "started"))
+
+  (log/info "Migrating master schema" (:database-schema config/env))
+  (-> (db/master-schema (:database-schema config/env))
+      (.migrate))
+
+  (doseq [congregation (db/with-db [conn {}]
+                         (congregation/get-congregations conn))]
+    (log/info "Migrating tenant schema" (::congregation/schema-name congregation))
+    (-> (db/tenant-schema (::congregation/schema-name congregation))
+        (.migrate)))
+
   (-> (Runtime/getRuntime)
-      (.addShutdownHook (Thread. ^Runnable stop-app))))
+      (.addShutdownHook (Thread. ^Runnable stop-app)))
+  (log/info "Started"))

 (defn -main [& args]
-  (mount/start #'territory-bro.config/env)
+  (mount/start #'config/env)
   (cond
-    (nil? (get env :database-url))
+    (nil? (:database-url config/env))
     (do
       (log/error "Database configuration not found, :database-url must be set before running")
       (System/exit 1))

     (some #{"init"} args)
     (do
-      (migrations/init (select-keys env [:database-url :init-script]))
+      (migrations/init (select-keys config/env [:database-url :init-script]))
       (System/exit 0))

     (migrations/migration? args)
     (do
-      (migrations/migrate args (select-keys env [:database-url]))
+      (migrations/migrate args (select-keys config/env [:database-url]))
       (System/exit 0))

     :else


fix moderation updates not updating math blobs; run postgres updates in async/thread to not block go thread pool (better parallelization)

--- src/polismath/conv_man.clj
+++ src/polismath/conv_man.clj
@@ -94,7 +94,7 @@
           (.printStackTrace e)))
       (log/debug "Profile data for zid" (:zid conv) ": " prof))))

-;; XXX WIP; need to flesh out and think about all the ins and outs
+;; XXX This is temporary; should be switching to schema work in conversation ns
 ;; Also, should place this in conversation, but for now...
 (def Conversation
   "A schema for what valid conversations should look like (WIP)"
@@ -133,14 +133,6 @@
           (log/error "Validation error: Conversation value does not match schema for conv zid:" zid)
           (throw (Exception. (str "Validation error: Conversation Value does not match schema: "
                                   validation-errors))))
-        ; Format and upload main results
-        (doseq [[prep-fn uploader] [[prep-main db/upload-math-main] ; main math results, for client
-                                    [prep-bidToPid db/upload-math-bidtopid] ; bidtopid mapping, for server
-                                    [prep-ptpt-stats db/upload-math-ptptstats]]]
-          (->> updated-conv
-               prep-fn
-               (uploader pg zid)))
-        (log/info "Finished uploading math results for zid:" zid)
         ; Return the updated conv
         updated-conv)
       ; In case anything happens, run the error-callback handler. Agent error handlers do not work here, since
@@ -150,6 +142,18 @@
         (error-callback votes start-time (:opts' conv) e)
         conv))))

+(defn write-conv-updates!
+  [{:as conv-man :keys [postgres]} {:as updated-conv :keys [zid]}]
+  ;; TODO Really need to extract these writes so that mod updates do whta they're supposed to! And also run in async/thread for better parallelism
+  ; Format and upload main results
+  (async/thread
+    (doseq [[prep-fn uploader] [[prep-main db/upload-math-main] ; main math results, for client
+                                [prep-bidToPid db/upload-math-bidtopid] ; bidtopid mapping, for server
+                                [prep-ptpt-stats db/upload-math-ptptstats]]]
+      (->> updated-conv
+           prep-fn
+           (uploader postgres zid)))
+    (log/info "Finished uploading math results for zid:" zid)))

 ;; Maybe switch over to using this with arbitrary attrs map with zid and other data? XXX
 ;(defmacro try-with-error-log
@@ -314,8 +318,10 @@
   (let [rid (:rid report-data)
         tids (map :tid (postgres/query (:postgres conv-man) (postgres/report-tids rid)))
         corr-mat (corr/compute-corr conv tids)]
-    (postgres/insert-correlationmatrix! postgres rid corr-mat)
-    (postgres/mark-task-complete! postgres (-> report-data :task-record :rid))))
+    (async/thread
+      (postgres/insert-correlationmatrix! postgres rid corr-mat)
+      ;; TODO update to submit usng task type and task bucket
+      (postgres/mark-task-complete! postgres (-> report-data :task-record :rid)))))

 ;; Need to think about what to do if failed conversations lead to messages piling up in the message queue XXX
@@ -344,14 +350,18 @@
           ;; If nil comes through as the first message, then the chan is closed, and we should be done, not continue looping forever
           (when-not (async/poll! kill-chan)
             (when-let [first-msg (<! message-chan)]
+              ;; If there are any retry messages from a failed recompute, we put them at the front of the message stack.
+              ;; But retry messages only get processed in this way if there are new messages that have come in triggering the
+              ;; first-msg take above, ensuring we don't just loop forever on a broken message/update.
+              (log/info "Message chan put in queue-message-batch! for zid:" zid)
               (let [retry-msgs (async/poll! retry-chan)
-                    _ (log/info "Message chan put in queue-message-batch! for zid:" zid)
                     msgs (vec (concat retry-msgs [first-msg] (take-all! message-chan)))
+                    ;; Regardless, now we split the messages by message type and process them as below
                     {:as split-msgs :keys [votes moderation generate_report_data]} (split-batches msgs)
+                    ;; Here we construct an error handler that gets passed to the conv update process, wrapping the retry queue,
+                    ;; error reporting, etc.
                     error-handler (build-update-error-handler conv-man retry-chan conv)
-                    _ (log/info "About to run updaters")
-                    ;; TODO Oh... is this how we're failing to get moderation affecting repness? We're presently only updating blob
-                    ;; (via `update`) if there are also votes. (see below)
+                    ;; Run moderation and vote updates
                     conv (if moderation
                            (conv/mod-update conv moderation)
                            conv)
@@ -359,11 +369,14 @@
                     conv (if votes
                            (conv-update conv-man conv votes error-handler)
                            conv)]
+                (log/info "Completed computing conversation zid:" zid)
+                (write-conv-updates! conv-man conv)
+                ;; Run reports corr matrix stuff (etc)
                 (doseq [report-task generate_report_data]
                   (generate-report-data! conv-man conv report-task))
-                (log/info "Completed computing conversation zid:" zid)
                 (swap! conversations assoc-in [zid :conv] conv)
-                (doseq [[k f] @listeners] (try (f conv) (catch Exception e (log/error "Listener error") (.printStackTrace e))))
+                (async/thread
+                  (doseq [[k f] @listeners] (try (f conv) (catch Exception e (log/error "Listener error") (.printStackTrace e)))))
                 (recur conv)))))))))


Changed log level for profile submission failure (since not super critical)

--- src/polismath/conv_man.clj
+++ src/polismath/conv_man.clj
@@ -154,7 +154,7 @@
                    extra-data)
             ((partial mongo-insert-results (db/mongo-collection-name "profile"))))
         (catch Exception e
-          (log/error "Unable to submit profile data for zid:" (:zid conv))
+          (log/warn "Unable to submit profile data for zid:" (:zid conv))
           (.printStackTrace e)))
       (log/debug "Profile data for zid" (:zid conv) ": " prof))))


do not generate UUID for every instrumented task

--- src/preflex/instrument.clj
+++ src/preflex/instrument.clj
@@ -145,7 +145,7 @@
   shared context with a volatile seed and calls (invoker callable-as-no-arg-fn volatile-context)."
   [f]
   (reify CallableDecorator
-    (wrapCallable [this callable] (let [volatile-context (volatile! {:id (.toString (UUID/randomUUID))})
+    (wrapCallable [this callable] (let [volatile-context (volatile! {})
                                         wrapped-callable (reify Callable
                                                            (call [this] (f #(.call callable) volatile-context)))]
                                     (SharedContextCallable. wrapped-callable volatile-context)))))
@@ -156,7 +156,7 @@
   shared context with a volatile seed and calls (invoker runnable-as-no-arg-fn volatile-context)."
   [f]
   (reify RunnableDecorator
-    (wrapRunnable [this runnable] (let [volatile-context (volatile! {:id (.toString (UUID/randomUUID))})
+    (wrapRunnable [this runnable] (let [volatile-context (volatile! {})
                                         wrapped-runnable (reify Runnable
                                                            (run [this] (f #(.run runnable) volatile-context)))]
                                     (SharedContextRunnable. wrapped-runnable volatile-context)))))
@@ -165,13 +165,13 @@
 (def default-shared-context-callable-decorator
   "A preflex.instrument.concurrent.CallableDecorator instance that initializes shared context with a volatile map."
   (reify CallableDecorator
-    (wrapCallable [this callable] (SharedContextCallable. callable (volatile! {:id (.toString (UUID/randomUUID))})))))
+    (wrapCallable [this callable] (SharedContextCallable. callable (volatile! {})))))

 (def default-shared-context-runnable-decorator
   "A preflex.instrument.concurrent.RunnableDecorator instance that initializes shared context with a volatile map."
   (reify RunnableDecorator
-    (wrapRunnable [this runnable] (SharedContextRunnable. runnable (volatile! {:id (.toString (UUID/randomUUID))})))))
+    (wrapRunnable [this runnable] (SharedContextRunnable. runnable (volatile! {})))))

 (defn make-shared-context-thread-pool-event-handlers