projectiles are somewhat finished

projectiles are somewhat finished

--- src/cljs/defender_cljs/actors/projectile.cljs
+++ src/cljs/defender_cljs/actors/projectile.cljs
@@ -10,7 +10,7 @@
                           :or {color 0xffffff}}]
   (let [material (THREE.MeshBasicMaterial.
                   #js {:color color})
-        geometry (THREE.CircleGeometry. 1 8)
+        geometry (THREE.CircleGeometry. 3 5)
         circle (THREE.Mesh. geometry material)]
     (a/create-actor circle
                     :name "projectile"
@@ -66,11 +66,7 @@
         projectile
         (if (nil? proj-map)
           (add-projectile! type)
-          (do
-            (log proj-map)
-            (proj-map :obj)))
-
-        _ (log "firing projectile" projectile)
+          (proj-map :obj))
         ]
     (make-inactive! type projectile)
     (a/set-position! projectile position)
@@ -80,5 +76,4 @@
      timeout
      (scene/remove-actor! scene/main projectile)
      (make-active! type projectile))
-    (log "projectile position" (a/get-position projectile))
     projectile))


Remove unused import

Remove unused import

--- src/cljs/subman/components/search_result.cljs
+++ src/cljs/subman/components/search_result.cljs
@@ -1,5 +1,4 @@
 (ns subman.components.search-result
-  (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om :include-macros true]
             [sablono.core :refer-macros [html]]
             [om-tools.core :refer-macros [defcomponent]]


Proper rollbacks

Proper rollbacks

--- src/nube/app.clj
+++ src/nube/app.clj
@@ -56,6 +56,10 @@
 (defn load-app-instances [app] (redis! (car/smembers (str app ":instances"))))
 (defn add-app-instance [app instance] (redis! (car/sadd (str app ":instances") instance) (notify-routers)))
 (defn remove-app-instance [app instance] (redis! (car/srem (str app ":instances") instance) (notify-routers)))
+
+(defn load-pending-app-instances [app] (redis! (car/smembers (str app ":pending-instances"))))
+(defn add-pending-app-instance [app instance] (redis! (car/sadd (str app ":pending-instances") instance)))
+(defn remove-pending-app-instance [app instance] (redis! (car/srem (str app ":pending-instances") instance)))

 (defn load-hosts [] (redis! (car/smembers :hosts)))
 (defn add-host [host] (redis! (car/sadd :hosts host)))
@@ -138,8 +142,8 @@
         (stop-container host id)
         (throw (Exception. "Failed to deploy new instance.")))
       (try
-        (println "Adding" (str host ":" port) "to router")
-        (add-app-instance app (str host ":" port))
+        (println "Adding" (str host ":" port) "to as pending")
+        (add-pending-app-instance app (str host ":" port))
         (catch Exception e
           (println "Deploy failed. Rolling back.")
           (try (kill-app-instance app host port)
@@ -166,12 +170,24 @@

 (defn deploy-app-instances [app image count internal-port]
   (println "Deploying" count app "with" image)
-  (let [instances (load-app-instances app)]
-    (deploy-new-app-instances app image count internal-port)
-    (save-deployments app image count)
-    (doseq [instance instances]
-      (let [[image tag] (ssplit instance)]
-        (kill-app-instance app image tag)))))
+  (try
+    (let [instances (load-app-instances app)]
+      (deploy-new-app-instances app image count internal-port)
+      (save-deployments app image count)
+      (doseq [instance (load-pending-app-instances app)]
+        (add-app-instance app instance)
+        (remove-pending-app-instance app instance))
+      (doseq [instance instances]
+        (let [[image tag] (ssplit instance)]
+          (kill-app-instance app image tag))))
+    "App successfully deployed!"
+    (catch Exception e
+      (println "Rolling back deploy")
+      (doseq [instance (load-pending-app-instances app)]
+        (let [[host port] instance]
+          (stop-container host port))
+        (remove-pending-app-instance app instance))
+      (throw e))))

 (defn load-app-logs [app]
   (vec


Remove unused imports from cli module.

Remove unused imports from cli module.

--- src/clojure/apio/cli.clj
+++ src/clojure/apio/cli.clj
@@ -1,6 +1,5 @@
 (ns apio.cli
-  (:import (java.lang Thread)
-           (apio Queue))
+  (:import apio.Queue)
   (:require [apio.core :as core]
             [apio.concurrency.threading :as thr]
             [apio.concurrency.semaphore :as sem]


provide a position name for each snap, so that we can save the album

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@6322 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -460,8 +460,11 @@
 	               (not (.isClosed (:display @current-album))))
 	    (create-new-album tagged-image))
 	  (let [{:keys [display cache]} @current-album
-	        myTaggedImage (make-TaggedImage
-	          (assoc-in tagged-image [:tags "PositionIndex"] (@current-album :count)))]
+	        count (@current-album :count)
+	        myTaggedImage
+	          (make-TaggedImage
+	            (update-in tagged-image [:tags] merge
+	              {"PositionIndex" count "PositionName" (str "Snap" count)}))]
       (.putImage cache myTaggedImage)
       (doto display (.showImage myTaggedImage) .show)
       (swap! current-album update-in [:count] inc))))


bring to front whenever an image is added.

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@6316 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -18,7 +18,7 @@
   (:use [org.micromanager.mm :only [when-lets map-config get-config get-positions load-mm
                                     get-default-devices core log log-cmd mmc gui with-core-setting
                                     do-when if-args get-system-config-cached select-values-match?]]
-          [org.micromanager.sequence-generator :only [generate-acq-sequence]])
+        [org.micromanager.sequence-generator :only [generate-acq-sequence]])
   (:import [org.micromanager AcqControlDlg]
            [org.micromanager.api AcquisitionEngine TaggedImageAnalyzer]
            [org.micromanager.acquisition AcquisitionWrapperEngine LiveAcqDisplay TaggedImageQueue
@@ -292,7 +292,8 @@
               (when (not= z (@state :last-z-position))
                 (do (set-stage-position z-drive z)
                     (core waitForDevice z-drive)))))
-          #(do (expose event) (collect-image event out-queue))))))
+          #(do (expose event)
+               (collect-image event out-queue))))))

 (defn execute [event-fns]
   (doseq [event-fn event-fns :while (not (:stop @state))]
@@ -462,7 +463,7 @@
 	        myTaggedImage (make-TaggedImage
 	          (assoc-in tagged-image [:tags "PositionIndex"] (@current-album :count)))]
       (.putImage cache myTaggedImage)
-      (doto display (.showImage myTaggedImage))
+      (doto display (.showImage myTaggedImage) .show)
       (swap! current-album update-in [:count] inc))))

 ;; java interop


prefer qualified imports

prefer qualified imports

--- src/otto/app.clj
+++ src/otto/app.clj
@@ -5,7 +5,7 @@
             [otto.repositories     :as repos]
             [otto.web              :as web]
             [clojure.core.async    :as async :refer [<!! thread timeout]]
-            [ring.adapter.jetty    :as jetty :refer :all])
+            [ring.adapter.jetty    :as jetty])
   (:gen-class :main true))

 (defn- make-repository-update-fn
@@ -28,6 +28,6 @@
         p (config/port)
         u (config/user)
         i (config/interval)
-        r (repos/make-repositories)]
+        r (repos/make-repositories o)]
     (periodically-update o u i (make-repository-update-fn r))
-    (run-jetty (web/make-handler-fn o r) {:port p})))
+    (jetty/run-jetty (web/make-handler-fn o r) {:port p})))


(SERVER-251) Tweak jruby-flush tests because of performance issues

This commit modifies some of the work previously committed for
SERVER-251, mostly due to concerns about the length of execution time
added to the suite.

1) The `admin-api-multiple-flush-jruby-pool-test` was eliminated.  The
value of the test was already a bit dubious due to some of the variable
timing in the execution of the test and limited ability to validate the
system's behavior with concurrent flush requests.  More importantly, the
test appeared to add 5 minutes or so to the overall execution time for
the test suite - increasing from 6 minutes or so to 11 minutes or so.
This commit removes the test completely.

2) The `hold-instance-while-pool-flush-in-progress-test` was modified to
just try to initialize 2 `jruby-puppet` instances instead of 4.  This
should speed the execution of the test up a bit.  The test overall may
still take around 10 seconds to run; measurements were inconsistent from
local runs.

--- test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
@@ -138,38 +138,6 @@
         (let [flush-complete (add-watch-for-flush-complete pool-context)]
           (is (true? (trigger-flush ssl-request-options)))
           @flush-complete)
-        ;; now the pool is flushed, so the constants should be cleared
-        (is (true? (verify-no-constants pool-context 4)))))))
-
-(deftest ^:integration admin-api-multiple-flush-jruby-pool-test
-  (testing "Flushing the jruby pool multiple times results in all new JRuby instances"
-    (bootstrap/with-puppetserver-running
-      app
-      {:puppet-admin {:client-whitelist ["localhost"]}
-       :jruby-puppet {:max-active-instances 4}}
-      (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
-            context (tk-services/service-context jruby-service)
-            pool-context (:pool-context context)
-            times-to-flush 3]
-        ;; set a ruby constant in each instance so that we can recognize them
-        (is (true? (set-constants-and-verify pool-context 4)))
-        (let [times-flushed (atom 0)
-              _ (add-watch (:pool-agent pool-context)
-                           :flush-callback
-                           (fn [k _ _ _]
-                             (when (= k :flush-callback)
-                               (swap! times-flushed inc))))
-              wait-until (+ (System/currentTimeMillis) 300000)]
-          (dotimes [_ times-to-flush]
-            (is (true? (trigger-flush ssl-request-options))))
-          (while (and (< (System/currentTimeMillis) wait-until)
-                      (< @times-flushed times-to-flush))
-            (Thread/sleep 100))
-          (is (< (System/currentTimeMillis) wait-until)
-              (str "Pool not flushed expected number of times before timeout"))
-          (is (= @times-flushed times-to-flush)
-              "Pool flushed an unexpected number of times")
-          (remove-watch (:pool-agent pool-context) :flush-callback))
         ;; now the pool is flushed, so the constants should be cleared
         (is (true? (verify-no-constants pool-context 4)))))))

@@ -203,12 +171,12 @@
     (bootstrap/with-puppetserver-running
       app
       {:puppet-admin {:client-whitelist ["localhost"]}
-       :jruby-puppet {:max-active-instances 4}}
+       :jruby-puppet {:max-active-instances 2}}
       (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
             context (tk-services/service-context jruby-service)
             pool-context (:pool-context context)]
         ;; set a ruby constant in each instance so that we can recognize them
-        (is (true? (set-constants-and-verify pool-context 4)))
+        (is (true? (set-constants-and-verify pool-context 2)))
         (let [flush-complete (add-watch-for-flush-complete pool-context)
               ;; borrow an instance and hold the reference to it.
               instance (jruby-protocol/borrow-instance jruby-service)
@@ -232,7 +200,7 @@
           ;; wait until the flush is complete
           @flush-complete)
         ;; now the pool is flushed, and the constants should be cleared
-        (is (true? (verify-no-constants pool-context 4)))))))
+        (is (true? (verify-no-constants pool-context 2)))))))

 (deftest ^:integration max-requests-flush-while-pool-flush-in-progress-test
   (testing "instance from new pool hits max-requests while flush in progress"


better status codes for oauth problems

better status codes for oauth problems

--- src/io/sarnowski/swagger1st/util/security.clj
+++ src/io/sarnowski/swagger1st/util/security.clj
@@ -2,14 +2,22 @@
   (:require [ring.middleware.basic-authentication :refer [wrap-basic-authentication]]
             [clj-http.client :as client]
             [clojure.tools.logging :as log]
-            [io.sarnowski.swagger1st.util.api :as api]))
+            [io.sarnowski.swagger1st.util.api :as api]
+            [clj-time.core :as t])
+  (:import (java.io IOException)))

 ;; functions that generate security handler

-(defn- deny-response
+(defn- unauthorized
   "Send forbidden response."
   [reason]
-  (log/warnf "ACCESS DENIED because %s." reason)
+  (log/warnf "ACCESS DENIED (unauthorized) because %s." reason)
+  (api/error 401 "Unauthorized"))
+
+(defn- forbidden
+  "Send forbidden response."
+  [reason]
+  (log/warnf "ACCESS DENIED (forbidden) because %s." reason)
   (api/error 403 "Forbidden"))

 (defn allow-all
@@ -36,13 +44,22 @@
   "Checks with a tokeninfo endpoint for the token's validity and returns the session information if valid."
   [tokeninfo-url access-token]
   ; TODO make connection pool configurable!
-  (let [response (client/get tokeninfo-url
-                             {:query-params     {:access_token access-token}
-                              :throw-exceptions false
-                              :as               :json-string-keys})
-        body (:body response)]
-    (if (= 200 (:status response))
-      body
+  (try
+    (let [request-start (t/now)
+          response (client/get tokeninfo-url
+                               {:query-params     {:access_token access-token}
+                                :throw-exceptions false
+                                :as               :json-string-keys})
+          request-end (t/now)
+          body (:body response)
+          request-duration-ms (t/in-millis (t/interval request-start request-end))]
+      (when-not (< 10 request-duration-ms)
+        (log/warn "resolving tokeninfo took" request-duration-ms "ms"))
+      (if (= 200 (:status response))
+        body
+        nil))
+    (catch IOException e
+      (log/warn "could not get tokeninfo from" tokeninfo-url "because " (str e) "; rejecting token!")
       nil)))

 (defn check-consented-scopes
@@ -74,7 +91,7 @@
             ; check scopes
             (if (check-scopes-fn tokeninfo requirements)
               (assoc request :tokeninfo tokeninfo)
-              (deny-response "scopes not granted"))
-            (deny-response "invalid access token"))
+              (forbidden "scopes not granted"))
+            (unauthorized "invalid access token"))
           (api/error 503 "token info misconfigured")))
-      (deny-response "no access token given"))))
+      (unauthorized "no access token given"))))


another go at passing opts to execute

another go at passing opts to execute

--- src/er_cassandra/record.clj
+++ src/er_cassandra/record.clj
@@ -51,9 +51,11 @@
     opts]
    (session/execute
     session
-    (select-statement table key record-or-key-value
-                      (dissoc opts :columns :where :only-if :order-by :limit))
-    opts)))
+    (select-statement table
+                      key
+                      record-or-key-value
+                      (select-keys opts [:columns :where :only-if :order-by :limit]))
+    (dissoc opts :columns :where :only-if :order-by :limit))))

 (defn select-buffered
   "select a stream of records
@@ -73,10 +75,12 @@
    (let [strm (session/execute-buffered
                session
                (select-statement
-                table key record-or-key-value
-                (dissoc opts :columns :where :only-if :order-by :limit))
+                table
+                key
+                record-or-key-value
+                (select-keys opts [:columns :where :only-if :order-by :limit]))
                (-> opts
-                   (dissoc :buffer-size)))]
+                   (dissoc :columns :where :only-if :order-by :limit :buffer-size)))]
      (if buffer-size
        (s/buffer buffer-size strm)
        strm))))
@@ -115,7 +119,10 @@
    (d/chain
     (session/execute
      session
-     (insert-statement table record opts)
+     (insert-statement
+      table
+      record
+      (select-keys opts [:if-not-exists :using]))
      (dissoc opts :if-not-exists :using))
     first)))

@@ -149,7 +156,11 @@
    (d/chain
     (session/execute
      session
-     (update-statement table key record opts)
+     (update-statement
+      table
+      key
+      record
+      (select-keys opts [:only-if :if-exists :using :set-columns]))
      (dissoc opts :only-if :if-exists :using :set-columns))
     first)))

@@ -187,6 +198,10 @@
    (d/chain
     (session/execute
      session
-     (delete-statement table key record-or-key-value opts)
+     (delete-statement
+      table
+      key
+      record-or-key-value
+      (select-keys opts [:only-if :if-exists :using :where]))
      (dissoc opts :only-if :if-exists :using :where))
     first)))


Remove Integer/parseInt from server.clj

Remove Integer/parseInt from server.clj

Fixes #140

--- src/leiningen/new/re_frame/src/clj/server.clj
+++ src/leiningen/new/re_frame/src/clj/server.clj
@@ -5,5 +5,5 @@
   (:gen-class))

  (defn -main [& _args]
-   (let [port (Integer/parseInt (or (env :port) "3000"))]
+   (let [port (or (env :port) 3000)]
      (run-jetty handler {:port port :join? false})))


Code cleanup.

Code cleanup.

--- src/fcms/resources/item.clj
+++ src/fcms/resources/item.clj
@@ -7,7 +7,7 @@
 (def item-media-type "application/vnd.fcms.item+json;version=1")

 (defn- item-doc [coll-id item-slug]
-  (:doc (first (clutch/get-view "item" :all {:key [coll-id, item-slug] :include_docs true}))))
+  (:doc (first (clutch/get-view "item" :all {:key [coll-id item-slug] :include_docs true}))))

 (defn- item-from-db
   "Turn an item from its CouchDB map representation into its FCMS map representation."


RR: reset map threshold

RR: reset map threshold

--- src/hatti/constants.cljs
+++ src/hatti/constants.cljs
@@ -22,4 +22,4 @@
                  "light" "Mapbox Light"
                  "dark" "Mapbox Dark"
                  "satellite-streets" "Mapbox Satellite"})
-(def mapping-threshold 1000000)
+(def mapping-threshold 10000)


stable ids

stable ids

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

--- src/aurora/editor/core.cljs
+++ src/aurora/editor/core.cljs
@@ -230,9 +230,9 @@

         (rule "translate ui/editor-computed-id"
               (when "compile rule" {:rule-id 'rule})
-              (when "ui/editor-computed-id" {:rule-id 'rule :id 'id :parent 'parent :pos 'pos :root-clause-id '_})
+              (when "ui/editor-computed-id" {:rule-id 'rule :id 'id :parent 'parent :pos 'pos :root-clause-id 'rootClause})
               (func 'neue "parent + \" + \\\"-\\\" + \" + pos")
-              (func 'clause "aurora.util.core.new_id()")
+              (func 'clause "'computedid' + rootClause + pos + id + rule")
               (pretend "compiled clauses" {:rule-id 'rule :when|know|remember|forget "when" :clause-id 'clause :name "=function"})
               (pretend "compiled clause-fields" {:clause-id 'clause :constant|variable "variable" :val 'id :key "variable"})
               (pretend "compiled clause-fields" {:clause-id 'clause :constant|variable "constant" :val 'neue :key "js"})
@@ -279,9 +279,10 @@

        (rule "submit project item"
              (when "ui/onKeyDown" {:elem-id "create-project" :key 13})
+             (when "time" {:time "time"})
              (func 'newName "document.querySelector('.create-project').value")
              (when "filter" {:js "newName != ''"})
-             (func 'newId "aurora.util.core.new_id()")
+             (func 'newId "'project' + newName + time")
              (remember "projects" {:project-id 'newId :name 'newName})
              )

@@ -315,7 +316,7 @@
              (when "ui/onClick" {:elem-id "addrule"})
              (when "active project" {:project-id 'project})
              (when "time" {:time 'time})
-             (func 'ruleId "aurora.util.core.new_id()")
+             (func 'ruleId "'rule' + project + time")
              (remember "editor rules" {:rule-id 'ruleId :project-id 'project :timestamp time})
              (change "matcher state" {:active 'active :state 'state} {:active "true" :state 'state})
              (change "rule editor active" {:rule-id 'prev} {:rule-id 'ruleId}))
@@ -505,7 +506,7 @@
              (when "add clause" {:rule-id 'rule :madlib-id 'madlib :type 'type})
              (when "editor base clause types" {:clause-type 'type})
              (when "time" {:time 'timestamp})
-             (func 'clause "aurora.util.core.new_id()")
+             (func 'clause "'claus' + rule + madlib + timestamp + type")
              (remember "editor clauses" {:rule-id rule :type 'type :clause-id clause :madlib-id 'madlib :timestamp 'timestamp})
              (pretend "add clause placeholders" {:rule-id 'rule :madlib-id 'madlib :clause-id clause})
              (change "cursor" {:clause-id 'old} {:clause-id 'clause})
@@ -514,9 +515,9 @@
        (rule "add change clause"
              (when "add clause" {:rule-id 'rule :madlib-id 'madlib :type "change"})
              (when "time" {:time 'timestamp})
-             (func 'rootClause "aurora.util.core.new_id()")
-             (func 'toClause "aurora.util.core.new_id()")
-             (func 'fromClause "aurora.util.core.new_id()")
+             (func 'rootClause "'root change' + timestamp + madlib + rule")
+             (func 'toClause "'to change' + timestamp + madlib + rule")
+             (func 'fromClause "'from change' + timestamp + madlib + rule")
              (remember "change clauses" {:rule-id 'rule :clause-id 'rootClause :from|to "from" :table 'madlib :sub-clause-id 'fromClause :timestamp 'timestamp})
              (remember "change clauses" {:rule-id 'rule :clause-id 'rootClause :from|to "to" :table 'madlib :sub-clause-id 'toClause :timestamp 'timestamp})
              (pretend "add clause placeholders" {:rule-id 'rule :madlib-id 'madlib :clause-id rootClause})
@@ -528,8 +529,8 @@
        (rule "add draw clause"
              (when "add clause" {:rule-id 'rule :madlib-id 'madlib :type "draw"})
              (when "time" {:time 'timestamp})
-             (func 'rootClause "aurora.util.core.new_id()")
-             (func 'elemClause "aurora.util.core.new_id()")
+             (func 'rootClause "'draw root' + rule + madlib + timestamp")
+             (func 'elemClause "'elem clause' + rule + madlib + timestamp")
              (func 'elemClause2 "elemClause")
              (remember "ui/editor-root" {:rule-id 'rule :clause-id rootClause :root elemClause :timestamp 'timestamp})
              (remember "ui/editor-elem" {:rule-id 'rule :root-clause-id rootClause :clause-id 'elemClause})
@@ -878,7 +879,8 @@
              (when "matcher filter" {:filter 'text})
              (when "filter" {:js "text.indexOf('[') > -1"})
              (when "matcher clause" {:clause-type type})
-             (func 'neue "aurora.util.core.new_id()")
+             (when "time" {:time 'time})
+             (func 'neue "'madlib' + rule + time")
              (forget "matcher clause" {:clause-type 'type})
              (change "matcher filter" {:filter 'text} {:filter ""})
              (change "matcher state" {:active 'active :state 'state} {:active "false" :state "clause"})
@@ -1032,7 +1034,7 @@
              (when "ui/editor-root" {:rule-id 'rule :clause-id 'rid :root 'root  :timestamp '_})
              (when "editor clause fields" {:rule-id rule :clause-id clause :constant|variable|expression 'cv2 :val 'elem :key "elem-id"})
              (when "draw editor active elem" {:elem-id 'elem})
-             (func 'final "elem.length > 30 && elem[8] == '_' ? '' : elem")
+             (func 'final "elem.length > 30 && elem.substring(0,11) == 'elem clause' ? '' : elem")
              (pretend "ui/child" {:parent-id "preview-elem-editor-body" :pos 0 :child-id "draw-id-editor-row"})
              (draw* [:tr {:id "draw-id-editor-row"} [:td {} "name"] [:td {} [:input {:id "draw-id-editor" :className "draw-id-editor" :events ["onChange" "onClick"] :value 'final}]]])
              )
@@ -1094,7 +1096,7 @@
              (when "rule editor active" {:rule-id rule})
              (when "cursor" {:clause-id 'rid})
              (when "draw editor active elem" {:elem-id 'elem})
-             (func 'clause "aurora.util.core.new_id()")
+             (func 'clause "'event' + rule + rid + elem + event")
              (remember "ui/editor-event-listener" {:rule-id 'rule :clause-id 'clause :root-clause-id 'rid})
              (remember "editor clause fields" {:rule-id rule :clause-id clause :constant|variable|expression "constant" :val "" :key "entity"})
              (remember "editor clause fields" {:rule-id rule :clause-id clause :constant|variable|expression "constant" :val "" :key "event-key"})
@@ -1121,11 +1123,12 @@
              (when "ui/onClick" {:elem-id "add-child-button"})
              (when "rule editor active" {:rule-id rule})
              (when "ui/editor-root" {:rule-id 'rule :clause-id 'rid :root 'root  :timestamp '_})
+             (when "time" {:time 'time})
              (when "cursor" {:clause-id 'rid})
              (when "draw editor active elem" {:elem-id 'elem})
-             (func 'elemClause "aurora.util.core.new_id()")
+             (func 'elemClause "'added child elem' + rule + rid +  time")
              (func 'elemClause2 "elemClause")
-             (func 'childClause "aurora.util.core.new_id()")
+             (func 'childClause "'added child child elem' + rule + rid +  time")
              (change "draw editor active elem" {:elem-id 'elem} {:elem-id 'elemClause})
              (remember "ui/editor-elem" {:rule-id 'rule :root-clause-id 'rid :clause-id 'elemClause})
              (remember "editor clause fields" {:rule-id 'rule :clause-id 'elemClause :constant|variable|expression "constant" :val 'elemClause2 :key "elem-id"})
@@ -1143,9 +1146,9 @@
              (when "cursor" {:clause-id 'rid})
              (when "draw editor active elem" {:elem-id 'elem})
              (when "time" {:time 'time})
-             (func 'elemClause "aurora.util.core.new_id()")
+             (func 'elemClause "'text' + time + rule + rid")
              (func 'elemClause2 "elemClause")
-             (func 'childClause "aurora.util.core.new_id()")
+             (func 'childClause "'text child' + time + rule + rid")
              (func 'ctx "elemClause + '|text'")
              (remember "ui/editor-text" {:rule-id 'rule :root-clause-id 'rid :clause-id 'elemClause})
              (remember "editor clause fields" {:rule-id 'rule :clause-id 'elemClause :constant|variable|expression "constant" :val 'elemClause2 :key "elem-id"})


CMR-3277 fixes name change

CMR-3277 fixes name change

--- access-control-app/src/cmr/access_control/services/permitted_concept_id_search.clj
+++ access-control-app/src/cmr/access_control/services/permitted_concept_id_search.clj
@@ -5,7 +5,7 @@
     [cmr.common-app.services.search.query-model :as common-qm]
     [cmr.umm-spec.umm-spec-core :as umm-spec]))

-(defn- create-generic-permitted-concept-id-condition
+(defn- create-generic-collection-applicable-condition
   "Constructs query condition for searching permitted_concept_ids by
    collection-applicable acls without a collection identifier"
   []


namedItems won't be reset on each code update, only on restart or calling reset-named-items

--- src/hphelper/shared/sql.clj
+++ src/hphelper/shared/sql.clj
@@ -15,9 +15,17 @@

 ;; Until reset, this will save all references. The same number crisis will
 ;; continue to return the same names for ##REF-TAGS##
-(def namedItems
-  "A map atom with references as keys and named items as values"
-  (atom {}))
+;; It is done this way so names aren't overwritten during frequent updating
+;; (resaving source files will re-load them into memory)
+(defn init-named-items
+  "Checks if namedItems is initialised. If not, initialise it"
+  []
+  (if (not (resolve 'namedItems))
+    (def namedItems
+      "A map atom with references as keys and named items as values"
+      (atom {}))))
+
+(init-named-items)

 (defn reset-named-items!
   "Resets the namedItems atom"
@@ -27,11 +35,13 @@
 (defn get-name
   "Returns the referenced name from namedItems, or nil if not existing"
   [keyName]
+  (init-named-items)
   (get @namedItems keyName))

 (defn named-exists?
   "Returns true if the named item already exists in namedItems, else false"
   [refName]
+  (init-named-items)
   (if (some #{refName} (vals @namedItems))
     true
     false))
@@ -40,6 +50,7 @@
   "Adds the reference name pair to namedItems, overwriting any previous allocation.
   Returns the added name"
   ([keyRef valName]
+   (init-named-items)
    (swap! namedItems assoc keyRef valName)
    valName)
   ([[keyRef valName]]


Fix reset email.

Fix reset email.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -539,7 +539,8 @@
                     :reset reset-instructions
                     :verify verify-instructions)
     :instructions-2 (case token-type
-                     :verify verify-instructions-2)
+                     :verify verify-instructions-2
+                     :reset "")
     :button-text (case token-type
                     :reset reset-button-text
                     :verify verify-button-text)


Expand the button devcards a bit

Expand the button devcards a bit

--- src-cljs/frontend/components/pieces/button.cljs
+++ src-cljs/frontend/components/pieces/button.cljs
@@ -222,7 +222,8 @@
     tooltip text and given to screen readers as the ARIA label.

     Icon buttons are only styled as secondary buttons, and should only be used
-    where a secondary button would be appropriate."
+    where a secondary button would be appropriate. They come in a single size,
+    which matches the Medium size of text buttons."

     (button-display
      [[(icon {:label "Icon"
@@ -287,15 +288,19 @@
     "A **icon link-button** is a link-button which displays a single icon, like an
     icon button."
     (button-display
-      [[(icon-link {:href "#"
-                    :label "Labels are provided for accessibility"}
-                   (icon/settings))]]))
+     [[(icon-link {:href "#"
+                   :label "Labels are provided for accessibility"}
+                  (icon/settings))]]))
+
   (defcard bordered-buttons
     "Buttons with borders are used in the header. This is design debt."
     (button-display
-      [[(icon {:label "Bordered GitHub icon button"
-               :bordered? true}
-              (icon/github))]
-       [(icon-link {:label "Bordered Bitbucket icon link-button"
-                    :bordered? true}
-                   (icon/bitbucket))]])))
+     [[(managed-button {:bordered? true
+                        :size :medium}
+                       "Bordered Button")]
+      [(icon {:label "Bordered GitHub icon button"
+              :bordered? true}
+             (icon/github))]
+      [(icon-link {:label "Bordered Bitbucket icon link-button"
+                   :bordered? true}
+                  (icon/bitbucket))]])))


Change not to use q/background

Change not to use q/background

--- src/overtone_workspace/layers/lines_layer.clj
+++ src/overtone_workspace/layers/lines_layer.clj
@@ -8,22 +8,28 @@
 (defn- update-state [state] {})

 (defn- draw-state [state]
-  (let [r (/ (q/width) num-of-lines)
-        rr (- r)]
+  (let [r (/ (q/width) num-of-lines)]
     (q/smooth)

+    (q/no-stroke)
+    (q/color-mode :hsb)
+    (q/fill (.backgroundColor (q/current-graphics)) 100)
+    (q/rect 0 0 (q/width) (q/height))
+
     (q/color-mode :rgb)
-    (q/background 200)
+;    (q/background 200)
+
     (q/fill 220)
     (q/stroke 220)
+    (q/stroke-weight r)

     (dorun
       (for [i (range 0 num-of-lines)]
-        (let [x (+ (* i (/ (q/width) num-of-lines)) (q/random rr r))
-            y 2
-            x2 (+ (* i (/ (q/width) num-of-lines)) (q/random rr r))
-            y2 (- (q/height) 2)]
-          (q/stroke-weight r)
+        (let [top 2
+              x (+ (* i (/ (q/width) num-of-lines)) (q/random (- r) r))
+              y top
+              x2 (+ (* i (/ (q/width) num-of-lines)) (q/random (- r) r))
+              y2 (- (q/height) top)]
           (q/line x y x2 y2))
       )))
   )


Open some links in new window and add support email link

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -52,10 +52,12 @@
                "Updates" [:i.material-icons "keyboard_arrow_down"]]
               [:ul.dropdown-menu.pull-right.animated.slideInDown
                (when-not (config/enterprise?)
-                 [:li [:a (html/open-ext {:href "https://circleci.com/changelog/"})
+                 [:li [:a (html/open-ext {:href "https://circleci.com/changelog/"
+                                          :target "_blank"})
                        [:div.heading "Changelog"]
                        [:div.description "The latest CircleCI product updates."]]])
-               [:li [:a (html/open-ext {:href "https://discuss.circleci.com/c/announcements"})
+               [:li [:a (html/open-ext {:href "https://discuss.circleci.com/c/announcements"
+                                        :target "_blank"})
                      [:div.heading "Announcements"]
                      [:div.description "Important announcements from CircleCI about upcoming features and updates."]]]]]
              [:li.dropdown
@@ -66,23 +68,26 @@
                "Support" [:i.material-icons "keyboard_arrow_down"]]
               [:ul.dropdown-menu.pull-right.animated.slideInDown
                [:li
-                [:a (html/open-ext {:href "https://circleci.com/docs/"})
+                [:a (html/open-ext {:href "https://circleci.com/docs/"
+                                    :target "_blank"})
                  [:div.heading "Docs"]
                  [:div.description "Read about building, testing, and deploying your software on CircleCI."]]]
                [:li
-                [:a (html/open-ext {:href "https://discuss.circleci.com/"})
+                [:a (html/open-ext {:href "https://discuss.circleci.com/"
+                                    :target "_blank"})
                  [:div.heading "Discuss"]
                  [:div.description "Get help and meet developers talking about testing, continuous integration, and continuous delivery."]]]
                [:li
-                 ;; FIXME: NEED TO ADD LINK TO ELEV.IO SUPPORT WIDGET
-                [:a.support-info {:href "/support"}
+                [:a (common/contact-support-a-info owner)
                  [:div.heading "Support"]
                  [:div.description "Send us a message. We are here to help!"]]]
                [:li
-                [:a (html/open-ext {:href "https://discuss.circleci.com/c/feature-request"})
+                [:a (html/open-ext {:href "https://discuss.circleci.com/c/feature-request"
+                                    :target "_blank"})
                  [:div.heading "Suggest a feature"]]]
                [:li
-                [:a (html/open-ext {:href "https://discuss.circleci.com/c/bug-reports"})
+                [:a (html/open-ext {:href "https://discuss.circleci.com/c/bug-reports"
+                                    :target "_blank"})
                  [:div.heading "Report an issue"]]]]]
              [:li.dropdown.user-menu
               [:button.dropdown-toggle


Fix display of csv tab.

Fix display of csv tab.

--- src-cljs/kixi/hecuba/tabs/property_details.cljs
+++ src-cljs/kixi/hecuba/tabs/property_details.cljs
@@ -115,9 +115,9 @@
     (render-state [_ state]
       (let [selected-property-id    (-> data :active-components :properties)
             property-details        (get-property-details selected-property-id data)
-            {:keys [project_id
+            {:keys [project_id
                     property_data
-                    editable]} property-details]
+                    editable]} property-details]
         (html
          [:div
           [:h3 "Overview"]
@@ -194,7 +194,7 @@
                   [:li {:class (if (= active-tab :sensors) "active" nil)}
                    [:a {:onClick (fn [_ _] (om/set-state! owner :active-tab :sensors))}
                     "Sensor Data"]]
-                  (when (and editable (seq devices))
+                  (when editable
                     [:li {:class (if (= active-tab :upload) "active" nil)}
                      [:a {:onClick (fn [_ _] (om/set-state! owner :active-tab :upload))}
                       "CSV"]])]
@@ -211,15 +211,15 @@
                  [:div {:class (if (not= active-tab :upload) "hidden" "col-md-12")}
                   [:div {:style {:padding-top "15px"}}
                    ;; Download measurements template
-                   [:div.panel.panel-default
+                   [:div {:class (if (seq devices) "panel panel-default" "hidden")}
                     [:div.panel-body
                      [:div
                       [:h4 "Download CSV measurements template"]
                       [:a {:class "btn btn-primary"
                            :type "button"
-                           :href (str "/4/templates/for-entity/" selected-property-id)} "Download"]]]]]
+                           :href (str "/4/templates/for-entity/" selected-property-id)} "Download"]]]]]
                   ;; Upload measurements
-                  [:div.panel.panel-default
+                  [:div {:class (if (seq devices) "panel panel-default" "hidden")}
                    [:div.panel-body
                     [:div
                      [:h4 "Upload measurements CSV"]


Add methods to enable/disable identities.

--- src/clj/game/core-cards.clj
+++ src/clj/game/core-cards.clj
@@ -1,8 +1,8 @@
 (in-ns 'game.core)

 (declare all-active all-installed cards deactivate card-flag? get-card-hosted handle-end-run ice?
-         has-subtype? remove-from-host rezzed?
-         trash update-hosted! update-ice-strength remove-icon)
+         has-subtype? register-events remove-from-host remove-icon rezzed?
+         trash update-hosted! update-ice-strength unregister-events)

 ; Functions for loading card information.
 (defn card-def
@@ -152,3 +152,24 @@
   [state card]
   (let [z (:zone card)]
     (get-in @state [:corp :servers (second z)])))
+
+(defn disable-identity
+  "Disables the side's identity"
+  [state side]
+  (let [id (assoc (:identity (side @state)) :disabled true)]
+    (update! state side id)
+    (unregister-events state side id)
+    (when-let [leave-play (:leave-play (card-def id))]
+      (leave-play state side id nil))))
+
+(defn enable-identity
+  "Enables the side's identity"
+  [state side]
+  (let [id (assoc (:identity (side @state)) :disabled false)
+        cdef (card-def id)
+        events (:events cdef)]
+    (update! state side id)
+    (when-let [eff (:effect cdef)]
+      (eff state side id nil))
+    (when events
+      (register-events state side events id))))


remove erroneous printout

remove erroneous printout

--- src/clj/yambox/database.clj
+++ src/clj/yambox/database.clj
@@ -63,7 +63,6 @@

 (sc/defn ^:always-validate add-campaign
   [campaign :- Campaign]
-  (prn (to-underscore campaign))
   (j/insert! @db-spec
     :campaigns
     (to-underscore campaign)))


don't block animation adding values to cache

--- src/pc/cache.clj
+++ src/pc/cache.clj
@@ -1,30 +1,40 @@
 (ns pc.cache
   (:require [clj-statsd :as statsd]
             [clojurewerkz.spyglass.client :as c]
-            [pc.profile :as profile]))
+            [pc.profile :as profile]
+            [pc.rollbar :as rollbar]))

 (defonce conn (atom nil))
 (defn connect! []
   (when-let [server (profile/memcached-server)]
     (reset! conn (c/bin-connection server))))

-(def sentinel (Object.))
+(defonce sentinel (Object.))
+
+(defonce add-agent (agent nil
+                          :error-mode :continue
+                          :error-handler (fn [a e]
+                                           (rollbar/report-exception e))))
+
+(defn fast-add [connection cache-key timeout value]
+  (send-off add-agent (fn [a]
+                        (c/add connection cache-key timeout value))))

 (defn wrap-memcache
   "Doesn't cache nils"
   [cache-key f & args]
   (if-not @conn
     (apply f args)
-    (let [cached-value (deref (c/async-get @conn cache-key) 10 sentinel)]
+    (let [cached-value (deref (c/async-get @conn cache-key) 25 sentinel)]
       (cond (nil? cached-value)
             (do (statsd/increment "memcached.cache-miss")
                 (let [res (apply f args)]
-                  (c/add @conn cache-key Integer/MAX_VALUE res)
+                  (fast-add @conn cache-key Integer/MAX_VALUE res)
                   res))
             (identical? cached-value sentinel)
             (do (statsd/increment "memcached.cache-timeout")
                 (let [res (apply f args)]
-                  (c/add @conn cache-key Integer/MAX_VALUE res)
+                  (fast-add @conn cache-key Integer/MAX_VALUE res)
                   res))
             :else
             (do (statsd/increment "memcached.cache-hit")


Ideas and minor changes

Ideas and minor changes

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -187,7 +187,7 @@
 ;; ARTIFICIAL INTELLIGENCE
 ;; -----------------------------------------

-(defn compute-cell-strength
+(defn- compute-cell-strength
   "Compute a cell strength based on the number of walls it has"
   [board point]
   (let [neighbors (coord-neighbors point)
@@ -202,24 +202,25 @@
       #(assoc %1 %2 (compute-cell-strength board %2))
       {} all-positions)))

-(defn move-strength
+(defn- move-strength
   "Compute the strength of a move, based on the converted cells"
   [cells-strength converted-filter [move converted]]
   (transduce
     (comp
-      (filter converted-filter)
+      (filter converted-filter) ;; TODO - Extract this part (specific to worst move)
       (mapcat :taken)
       (map cells-strength))
     + converted))

-(defn worst-immediate-loss
+(defn- worst-immediate-loss
   "Return the next worse lost game move for 'looser' if 'player' plays"
   [game player looser]
   (let [converted-filter #(= looser (:looser %))
         all-moves (get-in game [:moves player])]
     (transduce
       (map #(move-strength (:cells-strength game) converted-filter %))
-      max all-moves)))
+      max
+      all-moves)))

 (defn best-move
   "[SIMPLISTIC] Return the best move for a player based on:


comments

comments

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -85,6 +85,7 @@
     (range-coord [x y] [dx dy])))

 (defn convertible-cells
+  "Indicates the convertible cells for the provided player - when clicking at [x y]"
   [board [x y] [dx dy] player]
   (let [cells (range-cells board [(+ x dx) (+ y dy)] [dx dy])
         [head tail :as cell-groups] (partition-by identity cells)]


Tweak hardocded resilience

Tweak hardocded resilience

--- src/clojush/meta_errors.clj
+++ src/clojush/meta_errors.clj
@@ -168,7 +168,7 @@
         0
         (if (> (/ (count (distinct hist))
                   (count hist))
-               1/5)
+               2/5)
           0
           1)))))


End greedy selection if there are no candidates

--- src/rdf_path_examples/diversification.clj
+++ src/rdf_path_examples/diversification.clj
@@ -21,7 +21,7 @@
     (loop [solutions solutions
            candidates (apply disj paths solutions)
            solutions-count 2]
-      (if (= solutions-count n)
+      (if (or (= solutions-count n) (empty? candidates))
         solutions
         (let [solution (generate-solution candidates solutions)]
           (recur (conj solutions solution)


Use underscore for method parameters that aren't used

--- src/io/aviso/twixt/jade.clj
+++ src/io/aviso/twixt/jade.clj
@@ -18,8 +18,8 @@
   (reify TemplateLoader
     ;; getLastModified is only needed for caching, and we disable Jade's caching
     ;; in favor of Twixt's.
-    (getLastModified [this name] -1)
-    (getReader [this name]
+    (getLastModified [_ name] -1)
+    (getReader [_ name]
       (if (= name (:asset-path root-asset))
         (-> root-asset :content io/reader)
         (let [full-name (add-missing-extension name ".jade")]


Tweak

Tweak

--- src/leancloud/data/json.clj
+++ src/leancloud/data/json.clj
@@ -133,7 +133,7 @@
 (defn- read-quoted-string [^PushbackReader stream]
   ;; Expects to be called with the head of the stream AFTER the
   ;; opening quotation mark.
-  (let [buffer (StringBuilder.)]
+  (let [buffer (StringBuilder. 10)]
     (loop []
       (let [c (.read stream)]
         (when (neg? c)
@@ -146,7 +146,7 @@
               (recur)))))))

 (defn- read-integer [^String string]
-  (if (< (count string) 18)  ; definitely fits in a Long
+  (if (< (.length string) 18)  ; definitely fits in a Long
     (Long/valueOf string)
     (or (try (Long/valueOf string)
              (catch NumberFormatException e nil))
@@ -158,7 +158,7 @@
     (Double/valueOf string)))

 (defn- read-number [^PushbackReader stream]
-  (let [buffer (StringBuilder.)
+  (let [buffer (StringBuilder. 4)
         decimal? (loop [decimal? false]
                    (let [c (.read stream)]
                      (codepoint-case c
@@ -288,9 +288,9 @@
     "Print object to PrintWriter out as JSON"))

 (defn- write-string [^CharSequence s ^PrintWriter out]
-  (let [sb (StringBuilder. (count s))]
+  (let [sb (StringBuilder. (.length s))]
     (.append sb \")
-    (dotimes [i (count s)]
+    (dotimes [i (.length s)]
       (let [cp (int (.charAt s i))]
         (codepoint-case cp
           ;; Printable JSON escapes


Keep using version 18 by default

Keep using version 18 by default

--- src/leiningen/droid/new.clj
+++ src/leiningen/droid/new.clj
@@ -133,7 +133,7 @@
               :package-sanitized (sanitize package-name)
               :path (package-to-path (sanitize package-name))
               :activity (get options ":activity" "MainActivity")
-              :target-sdk (get options ":target-sdk" "21")
+              :target-sdk (get options ":target-sdk" "18")
               :min-sdk (get options ":min-sdk" "15")
               :app-name (get options ":app-name" project-name)
               :library (get options ":library" false)


Moved flare.event/register! call to start-fn!

--- src/traveler.clj
+++ src/traveler.clj
@@ -12,11 +12,11 @@

 (defn init!
   [system]
-  (flare.event/register! (:db-conn system) :traveler :user
-                         (traveler.schema/attribute-names :user))
   system)

 (defn start!
   "Galleon start up fn that registers events with Flare."
   [system]
+  (flare.event/register! (:db-conn system) :traveler :user
+                         (traveler.schema/attribute-names :user))
   system)


doc fixes and cleanup

doc fixes and cleanup

--- src/corpus_utils/kokken.clj
+++ src/corpus_utils/kokken.clj
@@ -8,7 +8,7 @@
             [corpus-utils.document]
             [corpus-utils.ndc :as ndc])
   (:import [fast_zip.core ZipperLocation]
-           (java.io File)))
+           [java.io File]))

 ;; :sentence -> :s
 ;; + metadata is in file
@@ -94,7 +94,7 @@
   :ret :corpus/document)

 (defn parse-document-seq
-  "Each XML file from The Sun corpus contains several articles, so we return a vector of documents."
+  "Each XML file from The Sun corpus contains several articles, so we return a sequence of documents."
   [filename]
   (let [root-loc (-> filename
                      io/input-stream


Enable the '--jobs' options for the 'list-obsolete-data' command

--- src/cyanite_remover/cli.clj
+++ src/cyanite_remover/cli.clj
@@ -166,7 +166,7 @@
   "Run command 'list-obsolete-data'."
   [command arguments options summary]
   (check-arguments "list-obsolete-data" arguments 5 5)
-  (check-options command #{:threshold :exclude-paths :cassandra-keyspace
+  (check-options command #{:threshold :exclude-paths :jobs :cassandra-keyspace
                            :cassandra-options :elasticsearch-index}
                  options)
   (let [{:keys [tenant rollups paths cass-hosts es-url


minor refactoring, a couple issues fixed

--- src/leiningen/fore_prob.clj
+++ src/leiningen/fore_prob.clj
@@ -14,7 +14,10 @@
 (defn- title->fn
   "Convert a problem title into a valid function name"
   [title]
-  (.toLowerCase (cs/replace title #"\W" "-")))
+  (.toLowerCase
+    (-> title
+      (cs/replace #"^\W+|\W+$" "") ; trim special chars
+      (cs/replace #"\W+" "-"))))

 (defn- drop-replace-me
   "Remove 'replace-me' tests from a file"
@@ -35,15 +38,18 @@
    indentation"
   ([desc] (desc->comments desc 1))
   ([desc i]
-    (str
-      (indent i) ";; " (cs/replace desc #"\r?\n" (str "\n" (indent i) ";; ")))))
+    (if (empty? desc)
+      ""
+      (str
+        (indent i) ";; "
+        (cs/replace desc #"\r?\n" (str "\n" (indent i) ";; ")) "\n"))))

 (defn- add-stub [project prob]
   (let [src (io/file "src" (ns->path (project :group)) "core.clj")]
     (if-not (re-find (re-pattern (str "(?m)^\\(defn " prob)) (slurp src))
       (spit src
             (str "\n(defn " prob "-solution [] ; Update args as needed!\n"
-                 (-> project :description desc->comments) "\n"
+                 (-> project :description desc->comments)
                  (indent) "nil)\n")
             :append true))))

@@ -62,8 +68,9 @@
   "expand a problem string"
   [prob tests]
   (->>
+   ;; TODO factorize this '-solution' appending in a function
    (map #(cs/replace % #"\b__\b" (str prob "-solution")) tests)
-   (map #(cs/replace % #"\r?\n" "\n"))
+   (map #(cs/replace % #"\r\n" "\n"))
    (map #(cs/join " " [(str (indent) "(is") % "\"" (enquote %) "\")"]))
    (cs/join "\n")))


Update lein plugin versions

Update lein plugin versions

¯\_(ツ)_/¯

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,4 +1,4 @@
-{:user {:plugins [[cider/cider-nrepl "0.14.0-SNAPSHOT"]
-                  [refactor-nrepl "2.3.0-SNAPSHOT"]
-                  [lein-pprint "1.1.2"]]
-        :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}
+{:user {:plugins [[cider/cider-nrepl "0.23.0-SNAPSHOT"]
+                  [refactor-nrepl "2.5.0-SNAPSHOT"]
+                  [lein-pprint "1.2.0"]]
+        :dependencies [[org.clojure/tools.nrepl "0.7.0-SNAPSHOT"]]}}


Add dependency on tools.nrepl

Add dependency on tools.nrepl

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -33,6 +33,7 @@
                        [nrepl-inspect "0.3.0"]
                        [org.codehaus.plexus/plexus-utils "3.0"]
                        [org.clojure/tools.namespace "0.2.10"]
+                       [org.clojure/tools.nrepl "0.2.10"]
                        [pjstadig/humane-test-output "0.7.0"]
                        ;; Q: Is there any point to this next one?
                        [ritz/ritz-nrepl-middleware "0.7.0"]


Update test

Update test

--- src/test/discuss/references/lib_test.cljs
+++ src/test/discuss/references/lib_test.cljs
@@ -12,6 +12,6 @@
   (testing "Given a reference, only highlight it in text if this has not been done yet."
     (let [highlighted (rlib/get-highlighted)
           input "\"Wenn man ein 0:2 kassiert, dann ist ein 1:1 nicht mehr möglich\" - Satz des Pythagoras"]
-      (is (s/def highlighted set?))
+      (is (set? highlighted))
       (rlib/highlight! input)
       (is (rlib/highlighted? input)))))


changes to make-app

changes to make-app

--- src/maqueta/application.clj
+++ src/maqueta/application.clj
@@ -39,21 +39,17 @@
             (init this))
           (simpleUpdate [tpf]
             (update this tpf))
-          (onAction
-            [name is-pressed tpf]
-            (when-let [callback (on-action (read-string name))]
+          (onAction [name is-pressed tpf]
+            (if-let [callback (on-action (read-string name))]
               (callback this is-pressed tpf)))
-          (onAnalog
-            [name value tpf]
-            (when-let [callback (on-analog (read-string name))]
+          (onAnalog [name value tpf]
+            (if-let [callback (on-analog (read-string name))]
               (callback this value tpf)))
-          (onAnimChange
-            [control channel name]
-            (when-let [callback (on-anim-change name)]
+          (onAnimChange [control channel name]
+            (if-let [callback (on-anim-change name)]
               (callback this control channel)))
-          (onAnimCycleDone
-            [control channel name]
-            (when-let [callback (on-anim-cycle-done name)]
+          (onAnimCycleDone [control channel name]
+            (if-let [callback (on-anim-cycle-done name)]
               (callback this control channel))))
     (.setShowSettings show-settings)
     (.setSettings *app-settings*)))


[JE CS] add all caps YES to boolean check

--- src/vip/data_processor/validation/csv.clj
+++ src/vip/data_processor/validation/csv.clj
@@ -64,7 +64,7 @@

 (defn booleanize [field]
   (fn [row] (assoc row field
-                  (if (= "yes" (row field))
+                  (if (#{"YES" "yes"} (row field))
                     1 0))))

 (defn find-input-file [ctx filename]


Fixed bug where Oracle realtime crashes

Fixed bug where Oracle realtime crashes

oracle realtime would crash after an update to the code

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -961,7 +961,7 @@
               ""))
         ]
     (do
-      ;(println "SQL::: " sql "," id)
+      (println "SQL::: " sql "," id , ":fields:" fields)
       (sql-1  sql [id])
       )))

@@ -1096,7 +1096,9 @@
     (println (pr-str "Read fields: " fields-entry))

     (if fields-entry
-      fields-entry)))
+      fields-entry
+      [:id];if we cant find the fields then just return the ID field
+      )))


Make each application in appshare connected to a different database schema

This will be done by saying that each application can have many
environments, such as dev, test, prod, etc, and so we use the
"appshare_application_schemas" table to link an application to a schema

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -832,6 +832,48 @@

+
+
+
+
+
+(defn make-app-schemas-table []
+  (let [sql-to-create-app-schemas-table
+        (cond
+          (= *database-type* "postgres" )
+          "
+          CREATE TABLE appshare_application_schemas
+          (
+          id                                               serial NOT NULL,
+          fk_appshare_application_id                       character varying,
+          application_environment                          character varying,
+          database_schema_name                             character varying,
+          CONSTRAINT appshare_applications_schemas_pkey    PRIMARY KEY (id)
+          );
+          "
+
+          (= *database-type* "oracle" )
+          "
+          CREATE TABLE appshare_application_schemas
+          (
+          id                                             NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
+          fk_appshare_application_id                     VARCHAR2(200 BYTE),
+          application_environment                        VARCHAR2(200 BYTE),
+          database_schema_name                           VARCHAR2(200 BYTE),
+          CONSTRAINT  APPSHARE_APPLICATION_SCHEMAS_PK    PRIMARY KEY (ID)
+          )")
+        ]
+
+    (if (not (does-table-exist  "appshare_application_schemas"))
+      (korma.core/exec-raw   [sql-to-create-app-schemas-table []]   [])
+      nil)))
+
+
+
+
+
+
+
 (defn make-figwheel-table []
   (let [sql-to-create-figwheel-processes-table
         (cond
@@ -1068,6 +1110,7 @@
 (make-users-publisers-table)
 (make-logins-table)
 (make-applications-table)
+(make-app-schemas-table)
 (make-triggers-table)
 (make-log-table)
 (make-figwheel-table)


maybe monad with the do notation macro

maybe monad with the do notation macro

--- src/monad/clojure/monad.clj
+++ src/monad/clojure/monad.clj
@@ -164,9 +164,9 @@
 ;;just read the algo.monads source code
 ;;algo.monads提供了自定义monad的能力 只要实现m-result m-bind m-zero m-plus四个函数就可以利用domonad来使用monad的威力
 (def list-monad {:m-result (fn [v] [v])
-                 :m-bind (fn [mv f]
-                         (if (seq mv)
-                           (apply concat (map f mv)) []))})
+                 :m-bind   (fn [mv f]
+                             (if (seq mv)
+                               (apply concat (map f mv)) []))})

 ;;just list comprehension again
 ;;由于clojure缺乏type inference的能力(强类型动态语言硬伤)所以在monad的时候必须显式指名monad的类型 而无法通过类型系统自动判断使用哪一个monad
@@ -258,12 +258,12 @@

 (defn do-bind [lst]
   (bind lst
-       (fn [elem]
-         (bind (half-double elem)
-              (fn [halfdouble]
-                (inc-int halfdouble))))))
-
-(do-bind [8 10])                                               ;;'(9 14 21 26 10 15 25 30)
+        (fn [elem]
+          (bind (half-double elem)
+                (fn [halfdouble]
+                  (inc-int halfdouble))))))
+
+(do-bind [8 10])                                            ;;'(9 14 21 26 10 15 25 30)

 ;;and without monad

@@ -275,8 +275,8 @@

 (def list-m {
              :return (fn [v] (list v))
-             :bind (fn [mv f]
-                     (mapcat f mv))
+             :bind   (fn [mv f]
+                       (mapcat f mv))
              })

 (let [bind (:bind list-m)
@@ -288,7 +288,7 @@
                   (return [a b]))))))

 (defn m-steps [m [name val & bindings] body]
-  (println (str name val (vec bindings)))
+  ;;(println (str name val (vec bindings)))
   (if (seq bindings)
     `(-> ~val
          ((:bind ~m) (fn [~name]
@@ -300,7 +300,39 @@
 (defmacro do-m [m bindings body]
   (m-steps m bindings body))

-(do-m list-m
-      [a [1 2 3]
-       b [4 5]]
-      [a b])+(defn combinations [ma mb]
+  (do-m list-m
+        [a ma
+         b mb]
+        [a b]))
+
+(combinations [1 2 3] [4 5])
+
+;;just list comprehension nothing new here
+
+(for [a [1 2 3]
+      b [4 5]]
+  [a b])
+
+;;maybe monad with the do notation macro
+
+(defn add [a b]
+  (+ a b))
+
+(add 1 2)
+;;(add 1 nil)                                                 ;;CompilerException java.lang.NullPointerException
+
+(def monad-maybe {
+                  :return (fn [v] v)
+                  :bind   (fn [mv f]
+                            (when mv
+                              (f mv)))
+                  })
+
+(defn m-add [ma mb]
+  (do-m monad-maybe [a ma
+                     b mb]
+        (+ a b)))
+
+(m-add 1 2)
+(m-add 1 nil)


Allow short circuiting.

Allow short circuiting.

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -90,9 +90,6 @@
                      :onyx/id id
                      :onyx.messaging/bind-addr (slurp "http://169.254.169.254/latest/meta-data/local-ipv4")
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
-                     :onyx.messaging/allow-short-circuit? false
-                     ;:onyx.messaging/peer-link-gc-interval 99999999
-                     ;:onyx.messaging.aeron/embedded-driver? false
                      :onyx.peer/join-failure-back-off 500
                      :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
                      :onyx.messaging/impl (keyword messaging)}


Try aeron low restart latency

Try aeron low restart latency

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -90,6 +90,8 @@
                      :onyx/id id
                      :onyx.messaging/bind-addr (slurp "http://169.254.169.254/latest/meta-data/local-ipv4")
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
+                     :onyx.messaging.aeron/offer-idle-strategy :low-restart-latency
+                     :onyx.messaging.aeron/poll-idle-strategy :low-restart-latency
                      :onyx.messaging.aeron/subscriber-count 2
                      :onyx.peer/join-failure-back-off 500
                      :onyx.peer/job-scheduler :onyx.job-scheduler/greedy


spacing

spacing

--- src/proxmox/validations.clj
+++ src/proxmox/validations.clj
@@ -2,7 +2,7 @@
   "Proxmox based validations"
   (:use
     [clojure.core.strint :only (<<)]
-    [bouncer [core :as b] [validators :as v :only (defvalidatorset )]])
+    [bouncer [core :as b] [validators :as v :only (defvalidatorset)]])
   (:require
     [celestial.validations :as cv]))


[#7549] Fix universal link to public chat

--- src/status_im/utils/universal_links/core.cljs
+++ src/status_im/utils/universal_links/core.cljs
@@ -65,7 +65,7 @@

 (fx/defn handle-public-chat [cofx public-chat]
   (log/info "universal-links: handling public chat" public-chat)
-  (chat/start-public-chat cofx public-chat {:navigation-reset? true}))
+  (chat/start-public-chat cofx public-chat {}))

 (fx/defn handle-view-profile [{:keys [db] :as cofx} public-key]
   (log/info "universal-links: handling view profile" public-key)


Fixed docstring.

Fixed docstring.

--- test/cmr/opendap/tests/system/ous/granule.clj
+++ test/cmr/opendap/tests/system/ous/granule.clj
@@ -1,5 +1,5 @@
 (ns cmr.opendap.tests.system.ous.granule
-  "Note: this namespace is exclusively for unit tests."
+  "Note: this namespace is exclusively for system tests."
   (:require
     [clojure.test :refer :all]
     [cmr.opendap.ous.granule :as granule]


Add test snapshotting current match state behaviour

--- test/day8/re_frame/trace/metamorphic_test.clj
+++ test/day8/re_frame/trace/metamorphic_test.clj
@@ -39,31 +39,99 @@
     (is (= (:operation (m/matched-event m6)) :acme.myapp.events/success-bootstrap))))

 #_(deftest parse-todomvc-trace1-test
-  (let [rt      (m/parse-traces (trace-events "todomvc-trace1.edn"))
-        matches (:matches rt)
-        [m1 m2 m3 m4 m5 m6] matches]
-    (is (= (count matches) 3))
+    (let [rt      (m/parse-traces (trace-events "todomvc-trace1.edn"))
+          matches (:matches rt)
+          [m1 m2 m3 m4 m5 m6] matches]
+      (is (= (count matches) 3))

-    (is (= (m/beginning-id m1) 1))
-    (is (= (m/ending-id m1) 34))
-    (is (= (:operation (m/matched-event m1)) :bootstrap))
+      (is (= (m/beginning-id m1) 1))
+      (is (= (m/ending-id m1) 34))
+      (is (= (:operation (m/matched-event m1)) :bootstrap))

-    (is (= (m/beginning-id m2) 35))
-    (is (= (m/ending-id m2) 38))
-    (is (= (:operation (m/matched-event m2)) :acme.myapp.events/boot-flow))
+      (is (= (m/beginning-id m2) 35))
+      (is (= (m/ending-id m2) 38))
+      (is (= (:operation (m/matched-event m2)) :acme.myapp.events/boot-flow))

-    (is (= (m/beginning-id m3) 39))
-    (is (= (m/ending-id m3) 42))
-    (is (= (:operation (m/matched-event m3)) :acme.myapp.events/init-db))
+      (is (= (m/beginning-id m3) 39))
+      (is (= (m/ending-id m3) 42))
+      (is (= (:operation (m/matched-event m3)) :acme.myapp.events/init-db))

-    (is (= (m/beginning-id m4) 43))
-    (is (= (m/ending-id m4) 47))
-    (is (= (:operation (m/matched-event m4)) :acme.myapp.events/boot-flow))
+      (is (= (m/beginning-id m4) 43))
+      (is (= (m/ending-id m4) 47))
+      (is (= (:operation (m/matched-event m4)) :acme.myapp.events/boot-flow))

-    (is (= (m/beginning-id m5) 48))
-    (is (= (m/ending-id m5) 49))
-    (is (= (:operation (m/matched-event m5)) :acme.myapp.events/start-intercom))
+      (is (= (m/beginning-id m5) 48))
+      (is (= (m/ending-id m5) 49))
+      (is (= (:operation (m/matched-event m5)) :acme.myapp.events/start-intercom))

-    (is (= (m/beginning-id m6) 50))
-    (is (= (m/ending-id m6) 181))
-    (is (= (:operation (m/matched-event m6)) :acme.myapp.events/success-bootstrap))))
+      (is (= (m/beginning-id m6) 50))
+      (is (= (m/ending-id m6) 181))
+      (is (= (:operation (m/matched-event m6)) :acme.myapp.events/success-bootstrap))))
+
+(def sub-state '{"rx48" {:subscription [:todos], :value ({:id 3, :title "def", :done false})}, "rx47" {:subscription [:sorted-todos], :value {3 {:id 3, :title "def", :done false}}, :previous-value {3 {:id 3, :title "def", :done false}}, :run? true, :order [:sub/run]}, "rx52" {:subscription [:visible-todos], :value ({:id 3, :title "def", :done false})}, "rx51" {:subscription [:showing], :value :all, :previous-value :all, :run? true, :order [:sub/run]}, "rx53" {:subscription [:all-complete?], :value false}, "rx56" {:subscription [:footer-counts], :value [1 0]}, "rx57" {:subscription [:completed-count], :value 0}})
+
+(def filtered-traces '({:id 91, :operation :initialise-db, :op-type :event, :tags {:event [:initialise-db], :app-db-before {:todos {3 {:id 3, :title "def", :done false}}, :showing :all}, :app-db-after {:todos {3 {:id 3, :title "def", :done false}}, :showing :all}}, :child-of nil, :start 647756.055, :duration 0.8649999999906868, :end 647756.93} {:id 92, :operation :sorted-todos, :op-type :sub/run, :tags {:query-v [:sorted-todos], :reaction "rx47", :input-signals ("ra24"), :value {3 {:id 3, :title "def", :done false}}}, :child-of nil, :start 647757.0300000001, :duration 0.08999999996740371, :end 647757.1250000001} {:id 93, :operation :showing, :op-type :sub/run, :tags {:query-v [:showing], :reaction "rx51", :input-signals ("ra24"), :value :all}, :child-of nil, :start 647757.16, :duration 0.05500000005122274, :end 647757.2150000001} {:id 94, :operation "todomvc.views.todo_app", :op-type :render, :tags {:component-path "todomvc.views.todo_app", :reaction "rx49", :input-signals ("rx48")}, :child-of nil, :start 647757.6200000001, :duration 0.2999999999301508, :end 647757.925} {:id 95, :operation :todos, :op-type :sub/create, :tags {:query-v [:todos], :cached? true, :reaction "rx48"}, :child-of 94, :start 647757.655, :duration 0.07499999995343387, :end 647757.735} {:id 96, :operation "todomvc.views.task_entry", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_entry", :reaction nil, :input-signals nil}, :child-of nil, :start 647758.14, :duration 0.1150000001071021, :end 647758.26} {:id 97, :operation "todomvc.views.todo_input", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_entry >  > todomvc.views.todo_input", :reaction "rx50", :input-signals ("ra59")}, :child-of nil, :start 647758.4750000001, :duration 0.24999999988358468, :end 647758.725} {:id 98, :operation "ReagentInput", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_entry >  > todomvc.views.todo_input > ReagentInput", :reaction nil, :input-signals nil}, :child-of nil, :start 647758.87, :duration 0.11000000010244548, :end 647758.9850000001} {:id 99, :operation "todomvc.views.task_list", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_list", :reaction "rx54", :input-signals ("rx52" "rx53")}, :child-of nil, :start 647759.36, :duration 0.4050000000279397, :end 647759.77} {:id 100, :operation :visible-todos, :op-type :sub/create, :tags {:query-v [:visible-todos], :cached? true, :reaction "rx52"}, :child-of 99, :start 647759.39, :duration 0.06499999994412065, :end 647759.4600000001} {:id 101, :operation :all-complete?, :op-type :sub/create, :tags {:query-v [:all-complete?], :cached? true, :reaction "rx53"}, :child-of 99, :start 647759.4800000001, :duration 0.044999999925494194, :end 647759.525} {:id 102, :operation "ReagentInput", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_list >  > ReagentInput", :reaction nil, :input-signals nil}, :child-of nil, :start 647759.95, :duration 0.06500000006053597, :end 647760.015} {:id 103, :operation "todomvc.views.todo_item", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_list >  >  > todomvc.views.todo_item", :reaction "rx55", :input-signals ("ra60" "ra60")}, :child-of nil, :start 647760.255, :duration 0.2500000001164153, :end 647760.51} {:id 104, :operation "ReagentInput", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.task_list >  >  > todomvc.views.todo_item >  >  > ReagentInput", :reaction nil, :input-signals nil}, :child-of nil, :start 647760.8550000001, :duration 0.08999999996740371, :end 647760.9450000001} {:id 105, :operation "todomvc.views.footer_controls", :op-type :render, :tags {:component-path "todomvc.views.todo_app >  >  > todomvc.views.footer_controls", :reaction "rx58", :input-signals ("rx56" "rx51")}, :child-of nil, :start 647761.39, :duration 0.8050000000512227, :end 647762.2} {:id 106, :operation :footer-counts, :op-type :sub/create, :tags {:query-v [:footer-counts], :cached? true, :reaction "rx56"}, :child-of 105, :start 647761.43, :duration 0.2850000000325963, :end 647761.7200000001} {:id 107, :operation :showing, :op-type :sub/create, :tags {:query-v [:showing], :cached? true, :reaction "rx51"}, :child-of 105, :start 647761.7550000001, :duration 0.05999999993946403, :end 647761.8150000001} {:id 108, :operation nil, :op-type :raf, :tags nil, :child-of nil, :start 647771.8600000001, :duration 0.09999999997671694, :end 647771.9600000001} {:id 109, :operation nil, :op-type :raf-end, :tags nil, :child-of 108, :start 647771.885, :duration 0.005000000121071935, :end 647771.8950000001} {:id 110, :operation nil, :op-type :reagent/quiescent, :tags nil, :child-of 108, :start 647771.9400000001, :duration 0.005000000004656613, :end 647771.9500000001}))
+
+(def new-matches '([{:id 91, :operation :initialise-db, :op-type :event, :tags {:event [:initialise-db], :app-db-before {:todos {3 {:id 3, :title "def", :done false}}, :showing :all}, :app-db-after {:todos {3 {:id 3, :title "def", :done false}}, :showing :all}}, :child-of nil, :start 647756.055, :duration 0.8649999999906868, :end 647756.93} {:id 110, :operation nil, :op-type :reagent/quiescent, :tags nil, :child-of 108, :start 647771.9400000001, :duration 0.005000000004656613, :end 647771.9500000001}]))
+
+(deftest subscription-match-state-test
+  (let [sub-state2 (m/subscription-match-state sub-state filtered-traces new-matches)]
+    (is (= '({"rx47" {:order          [:sub/run]
+                      :previous-value {3 {:done  false
+                                          :id    3
+                                          :title "def"}}
+                      :run?           true
+                      :subscription   [:sorted-todos]
+                      :value          {3 {:done  false
+                                          :id    3
+                                          :title "def"}}}
+              "rx48" {:subscription [:todos]
+                      :value        ({:done  false
+                                      :id    3
+                                      :title "def"})}
+              "rx51" {:order          [:sub/run]
+                      :previous-value :all
+                      :run?           true
+                      :subscription   [:showing]
+                      :value          :all}
+              "rx52" {:subscription [:visible-todos]
+                      :value        ({:done  false
+                                      :id    3
+                                      :title "def"})}
+              "rx53" {:subscription [:all-complete?]
+                      :value        false}
+              "rx56" {:subscription [:footer-counts]
+                      :value        [1
+                                     0]}
+              "rx57" {:subscription [:completed-count]
+                      :value        0}}
+              {"rx47" {:order          [:sub/run]
+                       :previous-value {3 {:done  false
+                                           :id    3
+                                           :title "def"}}
+                       :run?           true
+                       :subscription   [:sorted-todos]
+                       :value          {3 {:done  false
+                                           :id    3
+                                           :title "def"}}}
+               "rx48" {:subscription [:todos]
+                       :value        ({:done  false
+                                       :id    3
+                                       :title "def"})}
+               "rx51" {:order          [:sub/run]
+                       :previous-value :all
+                       :run?           true
+                       :subscription   [:showing]
+                       :value          :all}
+               "rx52" {:subscription [:visible-todos]
+                       :value        ({:done  false
+                                       :id    3
+                                       :title "def"})}
+               "rx53" {:subscription [:all-complete?]
+                       :value        false}
+               "rx56" {:subscription [:footer-counts]
+                       :value        [1
+                                      0]}
+               "rx57" {:subscription [:completed-count]
+                       :value        0}})
+           sub-state2))))


[#161] Test big headers in backend

[#161] Test big headers in backend

--- api/test/clojure/org/akvo/flow_api/end_to_end.clj
+++ api/test/clojure/org/akvo/flow_api/end_to_end.clj
@@ -41,4 +41,12 @@
       (is (=
             #{}
             (check-perms "unknown@user.com"
-              valid-surveys))))))+              valid-surveys))))))
+
+(deftest huge-headers
+  (testing "Keycloak Bearer token header is bigger than 8k"
+    (is (= 200
+          (:status (clj-http.client/get "http://mainnetwork:3000/"
+                     {:as :json
+                      :headers {"huge" (apply str (repeat 30000 "x"))}
+                      :content-type :json}))))))


lock/unklock/is-locked refacto

lock/unklock/is-locked refacto

--- src/sandbox/multithread.clj
+++ src/sandbox/multithread.clj
@@ -64,33 +64,17 @@
          (map :lock-id)
          (into []))))

-(defn lock
-  "locks lock lock-id in locks map"
-  [locks process-id lock-id]
+(defn lock [locks process-id lock-id]
   (assoc locks lock-id {:locker process-id :locked true}))
-(defn unlock
-  "unlocks lock lock-id in locks map"
-  [locks process-id lock-id]
+
+(defn unlock [locks process-id lock-id]
   (assoc locks lock-id {:locker process-id :locked false}))
-;;=> The locks state contains its locked state and which process
-;; did lock it.
-
-(defn is-locked?
-  [process-id
-   instructions
-   locks
-   instruction]
-  (let [inst-locks (the-locks-inst-depends-on instructions
-                                              instruction)]
-    (some true? (map #(and (not= process-id ((get locks %)
-                                             :locker))
-                           ((get locks %) :locked))
-                     inst-locks))))
-;;=> If some of the locks the instruction depend on are locked (:locked true)
-;; and the locker is not its process, then it is considered as
-;; locked.
-
-(defn scheduled-processes-parts
+
+(defn is-locked? [process-id instructions locks instruction]
+  (->> (the-locks-inst-depends-on instructions instruction)
+       (some #(and (not= process-id ((get locks %) :locker))
+                   ((get locks %) :locked)))))
+
   [scheduled]
   (into [] (map  (fn [p] {:process-id (:process-id p)
                           :instructions (into []


Fix duplicate definitions in util after bad merge

When rebasing on the windows machine at work git inserts ^M everywhere
and that wreaks complete havoc on any merge diffs.

The previous versions appeared earlier in the file so they were being
overwritten by the more recent versions so all the tests passed.

--- src/refactor_nrepl/util.clj
+++ src/refactor_nrepl/util.clj
@@ -37,67 +37,11 @@
     (throw (IllegalArgumentException.
             "Refactor nrepl doesn't work on cljs or cljx files!"))))

-(defn- search-sexp-boundary
-  "Searches sexp open or close of depth depending on the passed in pred.
-
-   If search is to be done backwards pass the string in reversed."
-  ([pred s]
-   (let [open #{\[ \{ \(}
-         close #{\] \} \)}]
-     (if (some (set/union open close) s)
-       (loop [chars s
-              cnt 0
-              op-cl 0
-              ready false]
-         (let [[ch & rest-chars] chars]
-           (cond (and ready (pred op-cl))
-                 (if (and (= (nth s cnt) \#)
-                          (= (nth s (dec cnt) \{)))
-                   (inc cnt)
-                   cnt)
-
-                 (open ch)
-                 (recur rest-chars (inc cnt) (inc op-cl) true)
-
-                 (close ch)
-                 (recur rest-chars (inc cnt) (dec op-cl) true)
-
-                 :else
-                 (recur rest-chars (inc cnt) op-cl ready))))
-       0))))
-
 (defn- read-first-form [form]
   (let [f-string (str form)]
     (when (some #{\) \} \]} f-string)
       (-> f-string
           read-string))))
-
-(defn get-enclosing-sexp
-  "Extracts the sexp enclosing point at LINE and COLUMN in FILE-CONTENT.
-
-  A string is not treated as a sexp by this function.
-
-  Line is indexed from 1, and column is indexed from 0 (this is how
-  emacs does it)."
-  [file-content line column]
-  (let [lines (str/split-lines file-content)
-        line-index (dec line)
-        char-count-for-lines (->> lines
-                                  (take line-index)
-                                  (map count)
-                                  (reduce + line-index))
-        content-to-point (-> char-count-for-lines
-                             (+ column)
-                             (take file-content))
-        sexp-start (->> content-to-point
-                        reverse
-                        (search-sexp-boundary (partial < 0))
-                        (- (count content-to-point)))
-        content-from-sexp (.substring file-content sexp-start)
-        sexp-end (+ sexp-start
-                    (->> content-from-sexp
-                         (search-sexp-boundary (partial = 0))))]
-    (.substring file-content sexp-start sexp-end)))

 (defn node-for-sexp?
   "Is NODE the ast node for SEXP?"


Found a better place for the content-type header.

--- src/statuses/views/main.clj
+++ src/statuses/views/main.clj
@@ -5,7 +5,7 @@
             [clj-time.local :as local])
   (:use [statuses.backend.persistence :only [db get-save-time]]
         [noir.core :only [defpage defpartial render]]
-        [noir.response :only [redirect set-headers content-type]]
+        [noir.response :only [redirect set-headers]]
         [noir.request :only [ring-request]]
         [hiccup.element]
         [hiccup.form]
@@ -63,7 +63,7 @@
   (str (:time item)))

 (defn list-page [items next]
-  (set-headers {"etag" (make-etag (first items))}
+  (set-headers {"etag" (make-etag (first items)) "content-type" "text/html;charset=utf-8"}
    (common/layout
      (list [:div (entry-form)]
            [:div [:ul.updates (map (fn [item] [:li.post (update item)]) items)]]
@@ -98,14 +98,13 @@
     [q lmt off next]))

 (defpage "/statuses/authors/:author" {:keys [author] :as req}
-  (content-type "text/html;charset=utf-8"
-    (let [[query limit offset next] (parse-args req)]
-      (let [current-etag (make-etag (first (core/get-latest @db 1 offset author)))
-            last-etag (get-in (ring-request) [:headers "if-none-match"])]
-        (println "Current ETag:" current-etag "Last ETag: " last-etag)
-        (if (not= current-etag last-etag)
-          (list-page (core/get-latest @db limit offset author) next)
-          (redirect (:uri (ring-request)) :not-modified))))))
+  (let [[query limit offset next] (parse-args req)]
+    (let [current-etag (make-etag (first (core/get-latest @db 1 offset author)))
+          last-etag (get-in (ring-request) [:headers "if-none-match"])]
+      (println "Current ETag:" current-etag "Last ETag: " last-etag)
+      (if (not= current-etag last-etag)
+        (list-page (core/get-latest @db limit offset author) next)
+        (redirect (:uri (ring-request)) :not-modified)))))

 (defpage "/statuses/search" {:as req}


Remove unused exclude from workspace ns.

--- src/uxbox/ui/workspace.cljs
+++ src/uxbox/ui/workspace.cljs
@@ -1,5 +1,4 @@
 (ns uxbox.ui.workspace
-  (:refer-clojure :exclude [dedupe])
   (:require [sablono.core :as html :refer-macros [html]]
             [rum.core :as rum]
             [beicon.core :as rx]


Remove some commented code.

Remove some commented code.

--- src/uxbox/ui/workspace.cljs
+++ src/uxbox/ui/workspace.cljs
@@ -88,12 +88,6 @@
         [:section.workspace-canvas
          {:class classes
           :ref "workspace-canvas"}
-         #_(when (and (:selected workspace)
-                    (= (count (:selected workspace)) 1))
-           (let [shape-id (first (:selected workspace))
-                 shape (l/focus-atom (l/in [:shapes-by-id shape-id]) st/state)]
-             (element-opts shape)))
-
          [:section.viewport-container
           {:ref "viewport-container"
            :width wb/viewport-width


Remove unnecessary "Development" header text.

--- src/viewer/view/mastery.clj
+++ src/viewer/view/mastery.clj
@@ -23,11 +23,18 @@
 (defn remove-html [str]
   (clojure.string/replace str #"<[^>]+>" ""))

+;; Development\r\n
+(defn remove-development [str]
+  (clojure.string/replace str #"Development\r\n" ""))
+
 (defn render-ship [ship masteries]
   [:div.ship
    [:div.ship-info
     [:h1.ship-name (:typename ship)]
-    [:div.ship-desc (clojure.string/replace (remove-html (:description ship)) #"\n" "
")]]
+    [:div.ship-desc (clojure.string/replace
+                     (remove-development (:description ship))
+                     #"\n"
+                     "
")]]
    [:div.masteries
     (map (partial render-mastery (:typename ship)) masteries)]])


add :auto-stop execution-context option, if not enabled context still sends result but doesn't stop when graph is converged

--- src/thi/ng/fabric/core.cljc
+++ src/thi/ng/fabric/core.cljc
@@ -251,6 +251,7 @@

 (defn stop-execution
   [bus vertices]
+  (info "stopping execution context...")
   (run! close! bus)
   (run! close-input! vertices))

@@ -305,24 +306,23 @@
                 (let [t (if max-t (timeout max-t))
                       [[evt v ex] port] (alts! (if max-t (conj bus t) bus))]
                   (if (= port t)
-                    (do (stop! _)
-                        (execution-result :converged result colls sigs t0))
+                    (if (:auto-stop ctx)
+                      (do (stop! _)
+                          (execution-result :converged result colls sigs t0))
+                      (do (execution-result :converged result colls sigs t0)
+                          (recur colls sigs)))
                     (case evt
                       :collect (recur (inc colls) sigs)
                       :signal  (recur colls (inc sigs))
                       :error   (do (warn ex "@ vertex" v)
-                                   (stop! _)
+                                   (when (:auto-stop ctx) (stop! _))
                                    (execution-result
                                     :error result colls sigs t0
-                                    {:reason           :error
-                                     :reason-event     evt
+                                    {:reason-event     evt
                                      :reason-exception ex
                                      :reason-vertex    v}))
                       (do (warn "execution interrupted")
                           (execution-result
-                           :interrupted result colls sigs t0
-                           {:reason        :terminated
-                            :reason-event  evt
-                            :reason-vertex v})))))
+                           :stopped result colls sigs t0)))))
                 (execution-result :max-ops-reached result colls sigs t0))))
           result)))))


Fixed query in protein_class_consolidation_by_shared_label rule

--- resources/rules/pre_identifier_merge/step_b_id_exact_match/shared_label/protein_class_consolidation_by_shared_label.clj
+++ resources/rules/pre_identifier_merge/step_b_id_exact_match/shared_label/protein_class_consolidation_by_shared_label.clj
@@ -5,10 +5,10 @@
   :title         "creates exactMatch mappings between Class identifiers whose classes have the label 'protein'. Generally we have excluded collapsing any PR concepts based on shared label for fear of accidentally collapsing genes with proteins. In the case of 'protein' however, we do want to collapse CHEBI:protein with PR:protein."
   :head          ((?/id1 skos/exactMatch ?/id2))
   :sparql-string "prefix franzOption_clauseReorderer: <franz:identity>
-                 prefix franzOption_chunkProcessingAllowed: <franz:yes>
-  prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-    prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
-select ?c1 ?c2 ?label {
+                  prefix franzOption_chunkProcessingAllowed: <franz:yes>
+                  prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                  prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
+                  select ?id1 ?id2 {
                        ?c1 oboInOwl:hasOBONamespace ?ns1 .
                        ?c1 rdf:type owl:Class .
                        ?c1 rdfs:label ?label .


Add HttpOnly to set-extra-attrs test.

Add HttpOnly to set-extra-attrs test.

--- ring-core/test/ring/middleware/test/cookies.clj
+++ ring-core/test/ring/middleware/test/cookies.clj
@@ -50,10 +50,10 @@
            (:headers resp)))))

 (deftest wrap-cookies-set-extra-attrs
-  (let [cookies {"a" {:value "b", :path "/", :secure true}}
+  (let [cookies {"a" {:value "b", :path "/", :secure true, :http-only true }}
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})]
-    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure")}
+    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly")}
            (:headers resp)))))

 (deftest wrap-cookies-always-assocs-map


formatting

formatting

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -329,7 +329,9 @@
            :internal (boot-internal-server)
            :external (boot-external-server port opts))
          (wait-until-deps-satisfied :server-ready)))
-     (print-ascii-art-overtone-logo (overtone.config.store/config-get :user-name) OVERTONE-VERSION-STR)))
+     (print-ascii-art-overtone-logo
+      (overtone.config.store/config-get :user-name)
+      OVERTONE-VERSION-STR)))

 (defn shutdown-server
   "Quit the SuperCollider synth process."


Remove unnecessary dependency

Remove unnecessary dependency

--- src/rdf_path_examples/integrity_constraints.clj
+++ src/rdf_path_examples/integrity_constraints.clj
@@ -1,7 +1,6 @@
 (ns rdf-path-examples.integrity-constraints
   (:require [rdf-path-examples.sparql :refer [construct-query]]
-            [clojure.java.io :as io]
-            [yesparql.sparql :refer [model->json-ld]])
+            [clojure.java.io :as io])
   (:import [org.apache.jena.rdf.model Model]
            [org.apache.jena.query Dataset]
            [com.github.jsonldjava.utils JsonUtils]))


bug #6768 - updating enabled tokens before navigation to wallet

Signed-off-by: Goran Jovic <fc686822162e6f379ea05b6f92d78d206147085c@gmail.com>

--- src/status_im/ui/screens/wallet/navigation.cljs
+++ src/status_im/ui/screens/wallet/navigation.cljs
@@ -6,11 +6,15 @@

 (defmethod navigation/preload-data! :wallet
   [db _]
+  ;;TODO(goranjovic) - get rid of this preload hook completely
+  (re-frame/dispatch [:wallet.ui/pull-to-refresh])
   (re-frame/dispatch [:update-wallet])
   (assoc-in db [:wallet :current-tab] 0))

 (defmethod navigation/preload-data! :wallet-modal
   [db _]
+  ;;TODO(goranjovic) - get rid of this preload hook completely
+  (re-frame/dispatch [:wallet.ui/pull-to-refresh])
   (re-frame/dispatch [:update-wallet])
   (re-frame/dispatch [:update-transactions])
   (assoc-in db [:wallet :modal-history?] false))


[#2181] Fixing backend tests

[#2181] Fixing backend tests

--- backend/test/akvo/lumen/lib/transformation_test.clj
+++ backend/test/akvo/lumen/lib/transformation_test.clj
@@ -617,7 +617,7 @@
         new-column-name      "Derived column name"
         uncategorized-value  "Uncategorised value"
         new-derived-column   {:sort       nil,
-	                      :type       "number",
+	                      :type       "text",
 	                      :title      new-column-name
 	                      :hidden     false,
 	                      :direction  nil,


get reader literals right for cljs

get reader literals right for cljs

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

--- lein-light-nrepl/src/lighttable/nrepl/cljs.clj
+++ lein-light-nrepl/src/lighttable/nrepl/cljs.clj
@@ -14,6 +14,7 @@
             [clojure.test :as test]
             [cljs.closure :as cljsc]
             [clojure.java.io :as io]
+            [cljs.tagged-literals :as tags]
             [clojure.set :as set :refer [difference union intersection]]
             [clojure.tools.nrepl.transport :as transport]
             [clojure.tools.nrepl.middleware :refer [set-descriptor!]]
@@ -107,6 +108,7 @@
                                 )
          bindings# (merge source-map-bindings#
                           {#'*ns* (eval/require|create-ns cur-ns#)
+                           #'reader/*data-readers* tags/*cljs-data-readers*
                            #'cljs/*cljs-ns* cur-ns#
                            #'*file* file#
                            #'cljs/*cljs-file* file#
@@ -412,6 +414,7 @@
           extra-bindings {#'*ns* (eval/require|create-ns cur-ns)
                           #'cljs/*cljs-ns* cur-ns
                           #'*file* path
+                          #'reader/*data-readers* tags/*cljs-data-readers*
                           #'cljs/*cljs-file* path
                           #'*source-path* path}
           bindings (merge @session extra-bindings)]


delaney2d.clj: new function (proto-spherical?)

--- clojure/org/gavrog/clojure/delaney2d.clj
+++ clojure/org/gavrog/clojure/delaney2d.clj
@@ -33,3 +33,5 @@
                      (v ds i j D))
              n (count cones)]
          (and (not= 1 n) (or (not= 2 n) (= (first cones) (second cones)))))))
+
+(defn proto-spherical? [ds] (pos? (curvature ds 1)))


Spec a.l.component.handler middleware

Spec a.l.component.handler middleware

--- backend/src/akvo/lumen/component/handler.clj
+++ backend/src/akvo/lumen/component/handler.clj
@@ -2,6 +2,8 @@
   (:require [compojure.core :as compojure.core]
             [compojure.response :as compojure.res]
             [integrant.core :as ig]
+            [akvo.lumen.specs.components :refer (integrant-key)]
+            [clojure.spec.alpha :as s]
             [ring.middleware.defaults]
             [ring.middleware.json]
             [ring.middleware.stacktrace]
@@ -40,11 +42,43 @@
 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-json-body  [_ opts]
   ring.middleware.json/wrap-json-body)

+(defmethod integrant-key :akvo.lumen.component.handler/wrap-json-body [_]
+  (s/cat :kw keyword?
+         :config empty?))
+
 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-json-response  [_ opts]
   ring.middleware.json/wrap-json-response)

 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-defaults  [_ opts]
   #(ring.middleware.defaults/wrap-defaults % opts))
+
+(create-ns  'akvo.lumen.component.handler.wrap-defaults.params)
+(alias 'wrap-defaults.params 'akvo.lumen.component.handler.wrap-defaults.params)
+
+(create-ns  'akvo.lumen.component.handler.wrap-defaults.responses)
+(alias 'wrap-defaults.responses 'akvo.lumen.component.handler.wrap-defaults.responses)
+
+
+(s/def ::wrap-defaults.responses/not-modified-responses boolean?)
+(s/def ::wrap-defaults.responses/absolute-redirects boolean?)
+(s/def ::wrap-defaults.responses/content-types boolean?)
+(s/def ::wrap-defaults.responses/default-charset #{"utf-8"})
+
+(s/def ::wrap-defaults.params/urlencoded boolean?)
+(s/def ::wrap-defaults.params/keywordize boolean?)
+
+(s/def ::params (s/keys :req-un [::wrap-defaults.params/urlencoded
+                                 ::wrap-defaults.params/keywordize]))
+
+(s/def ::responses (s/keys :req-un [::wrap-defaults.responses/not-modified-responses
+                                    ::wrap-defaults.responses/absolute-redirects
+                                    ::wrap-defaults.responses/content-types
+                                    ::wrap-defaults.responses/default-charset]))
+
+(defmethod integrant-key :akvo.lumen.component.handler/wrap-defaults [_]
+  (s/cat :kw keyword?
+         :config (s/keys :req-un [::params ::responses])))
+

 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-hide-errors  [_ {:keys [error-response]}]
   (fn [handler]
@@ -56,6 +90,12 @@
               (ring.response/content-type "text/html")
               (ring.response/status 500)))))))

+(s/def ::error-response string?)
+
+(defmethod integrant-key :akvo.lumen.component.handler/wrap-hide-errors [_]
+  (s/cat :kw keyword?
+         :config (s/keys :req-un [::error-response])))
+
 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-not-found  [_ {:keys [error-response]}]
   (fn [handler]
     (fn [request]
@@ -63,3 +103,7 @@
           (-> (compojure.res/render error-response request)
               (ring.response/content-type "text/html")
               (ring.response/status 404))))))
+
+(defmethod integrant-key :akvo.lumen.component.handler/wrap-not-found [_]
+  (s/cat :kw keyword?
+         :config (s/keys :req-un [::error-response])))


improve nrepl init failure error

improve nrepl init failure error

fixes #997

--- src/main/shadow/cljs/devtools/server/nrepl.clj
+++ src/main/shadow/cljs/devtools/server/nrepl.clj
@@ -28,7 +28,13 @@
       (next msg))))

 (defn shadow-cljs-repl [repl-env & options]
-  {:pre [(keyword? repl-env)]}
+  (when-not (keyword? repl-env)
+    (throw
+      (ex-info
+        (str "shadow-cljs nREPL initialization failure!\n"
+             "Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.\n"
+             "Instead got a " (pr-str repl-env))
+        {})))
   (api/nrepl-select repl-env))

 ;; api method, does too much stuff we don't need


Added unit tests verifying that #2 is fixed

--- test/hiccups/core_test.cljs
+++ test/hiccups/core_test.cljs
@@ -16,6 +16,8 @@
   (t/is (= (hiccups/html ["div"]) "

"))
   (t/is (= (hiccups/html ['div]) "

"))
   (t/is (= (hiccups/html [:div#foo]) "

"))
+  (t/is (= (hiccups/html [:form#sign-in]) "<form id=\"sign-in\"></form>"))
+  (t/is (= (hiccups/html [:input#sign-in-email]) "<input id=\"sign-in-email\" />"))
   (t/is (= (hiccups/html [:div.foo]) "

"))
   (t/is (= (hiccups/html [:div.foo (str "bar" "baz")])
            "
barbaz
"))


Replace scary comment with issue

Replace scary comment with issue

Refs #2.

--- test/icecap/schema_test.clj
+++ test/icecap/schema_test.clj
@@ -22,10 +22,7 @@
     (are [example reason] (= (pr-str (s/check Plan example))
                              (pr-str reason))
       [#{} simple-http-action] ['(not ("collection of one or more plans" #{})) nil]))
-  (testing "plans with unknown/unsupported schemes don't validate"
-    ;; Comparing string representations isn't great, but it's the best
-    ;; easily available tool until maybe one day cddr/integrity's
-    ;; humanize function is on Clojars + can humanize these errors :-)
-    (are [example reason] (= (pr-str (s/check Plan example))
-                             (pr-str reason))
-         simple-ftp-action {:target '(not ("supported-scheme?" "ftp://example.test"))})))
+  (testing "plans with unknown/unsupported schemes don't validate"))
+(are [example reason] (= (pr-str (s/check Plan example))
+                         (pr-str reason))
+     simple-ftp-action {:target '(not ("supported-scheme?" "ftp://example.test"))})


Test for converging 50 peers into the cluster.

--- test/onyx/log/full_test.clj
+++ test/onyx/log/full_test.clj
@@ -20,15 +20,31 @@
   {:inbox-capacity 100
    :outbox-capacity 100})

-(def v-peers (onyx.api/start-peers! onyx-id 10 (:peer config) peer-opts))
+(def n-peers 50)

-#_(doseq [v-peer v-peers]
+(def v-peers (onyx.api/start-peers! onyx-id n-peers (:peer config) peer-opts))
+
+(def ch (chan n-peers))
+
+(extensions/subscribe-to-log (:log env) 0 ch)
+
+(def replica
+  (loop [replica {}]
+    (let [position (<!! ch)
+          entry (extensions/read-log-entry (:log env) position)
+          new-replica (extensions/apply-log-entry entry replica)]
+      (if (< (count (:pairs new-replica)) n-peers)
+        (recur new-replica)
+        new-replica))))
+
+(fact (:prepared replica) => {})
+(fact (:accepted replica) => {})
+(fact (count (:peers replica)) => n-peers)
+
+(doseq [v-peer v-peers]
   (try
     ((:shutdown-fn v-peer))
     (catch Exception e (prn e))))

-;;(component/stop env)
+(component/stop env)

-
-
-


Increased timeout from 10 to 20 seconds for message confirms

--- metadata-db-app/src/cmr/metadata_db/config.clj
+++ metadata-db-app/src/cmr/metadata_db/config.clj
@@ -65,6 +65,6 @@
 (defconfig publish-timeout-ms
   "Number of milliseconds to wait for a publish request to be confirmed before considering the
   request timed out."
-  {:default 10000 :type Long})
+  {:default 20000 :type Long})


don't deref

don't deref

--- src/er_cassandra/model/alia/select_buffered.clj
+++ src/er_cassandra/model/alia/select_buffered.clj
@@ -76,7 +76,7 @@
                           (get-in model [:primary-table :key])
                           pkv
                           primary-opts))))
-         (stream/map deref)
+         stream/realize-each
          (stream/filter identity))))

 (defn select-buffered*


don't need to extract-key-value yet

don't need to extract-key-value yet

--- src/er_cassandra/model/alia/select_buffered.clj
+++ src/er_cassandra/model/alia/select_buffered.clj
@@ -27,12 +27,11 @@
      (r/select-buffered session (:name table) opts)))

   ([^Session session ^Entity entity table key record-or-key-value opts]
-   (let [kv (k/extract-key-value key record-or-key-value opts)
-         opts (-> opts
+   (let [opts (-> opts
                   (dissoc :key-value)
                   (assoc :row-generator (ms/->EntityInstanceRowGenerator)))]

-     (r/select-buffered session (:name table) key kv opts))))
+     (r/select-buffered session (:name table) key record-or-key-value opts))))

 (defn select-buffered-from-lookup-table
   "two fetches - use the lookup-key to get a stream of uber-keys, then


splatting

splatting

--- test/celestial/fixtures.clj
+++ test/celestial/fixtures.clj
@@ -38,9 +38,9 @@

 (defmacro with-conf
   "Using fixture/.celestial.edn conf file"
-  [body]
+  [& body]
  `(with-redefs [celestial.config/config celestial.fixtures/local-prox]
-   ~body
+   ~@body
     ))

 (def host (.getHostName (java.net.InetAddress/getLocalHost)))