Add a view for a login page

Add a view for a login page

--- src/todo_repl_webapp/views.clj
+++ src/todo_repl_webapp/views.clj
@@ -1,10 +1,10 @@
 (ns todo-repl-webapp.views
   (:require [hiccup.form :as form]
             [hiccup.page :as page]
-            [hiccup.core :as core]))
+            [hiccup.core :as h]))

 (def instructions
-  (core/html
+  (h/html
     [:div.alert.alert-info
       [:div [:b "Instructions"]]
       [:div.row
@@ -37,7 +37,7 @@
 (defn task-item
   "Given a task (map), return a div representing the task"
   [task-map]
-  (core/html
+  (h/html
       [:div.col-md-1
         [:span.label.label-primary.taskIndex]]
       [:div.col-md-7
@@ -54,25 +54,25 @@
 (defn task-line-item
   "When given a single task (map), return a html table line representing the task"
   [task-map]
-  (core/html [:div.panel.panel-default
+  (h/html [:div.panel.panel-default
                [:div.panel-body
                  (task-item task-map)]]))

 (defn task-table
   "When given a vector of tasks (maps), return an html table representing those tasks"
   [task-vec]
-  (core/html
+  (h/html
       (clojure.string/join
         (map task-line-item task-vec))))

 (defn display [x & xs]
   (if-not (empty? x)
-    (core/html [:h2 "list"]
+    (h/html [:h2 "list"]
           #_[:h3 x]
             (task-table (vec x)))))

 (defn home [tasks]
-  (core/html [:head
+  (h/html [:head
           [:title "todo-repl"]
           (page/include-css "css/bootstrap.min.css")
           (page/include-js "http://code.jquery.com/jquery-1.10.1.min.js"
@@ -93,3 +93,16 @@
           [:div#display.col-md-7.col-md-offset-2
             (display tasks)]
           (page/include-js "js/eval.js")]))
+
+(defn login-page []
+  (h/html
+    [:div.row
+     [:div
+      [:h3 "Login"
+       [:div.row
+        (form/form-to
+                      [:post "/login"]
+                      (form/text-field {:class "form-control"}
+                                               "username")
+                      (form/password-field "password")
+                      (form/submit-button "Login!"))]]]]))


Minor changes.

Minor changes.

--- src/suricatta/core.clj
+++ src/suricatta/core.clj
@@ -20,10 +20,7 @@

 (defn execute
   "Execute a query and return a number of rows affected."
-  ([query]
-     (assert (or (types/query? query) (types/result-query? query))
-             "execute/1 only works with query/queryresult instances")
-     (proto/execute query nil))
+  ([query] (proto/execute query nil))
   ([^Context ctx query] (proto/execute query ctx)))

 (defn fetch
@@ -48,9 +45,12 @@
   "ResultQuery constructor"
   ([^Context ctx q]
     (proto/result-query q ctx {}))
-
   ([^Context ctx q opts]
     (proto/result-query q ctx opts)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Transactions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn transaction
   [^Context ctx func]


(SERVER-977) unalign let bindings in handle-delete-cert.-req.-test

--- test/unit/puppetlabs/services/ca/certificate_authority_core_test.clj
+++ test/unit/puppetlabs/services/ca/certificate_authority_core_test.clj
@@ -120,11 +120,11 @@
       (is (= version-number (get-in response [:headers "X-Puppet-Version"]))))))

 (deftest handle-delete-certificate-request!-test
-  (let [settings      (assoc (testutils/ca-sandbox! cadir)
-                             :allow-duplicate-certs true
-                             :autosign false)
-        subject       "foo-agent"
-        csr-stream    (io/input-stream (test-pem-file "foo-agent-csr.pem"))
+  (let [settings (assoc (testutils/ca-sandbox! cadir)
+                        :allow-duplicate-certs true
+                        :autosign false)
+        subject "foo-agent"
+        csr-stream (io/input-stream (test-pem-file "foo-agent-csr.pem"))
         expected-path (ca/path-to-cert-request (:csrdir settings) subject)]
     (logutils/with-test-logging
       (testing "successful csr deletion"


Change start button position.

Change start button position.

--- src/cljs/beatha/core.cljs
+++ src/cljs/beatha/core.cljs
@@ -187,6 +187,14 @@
           #js {:className "row"}
           (dom/div
            #js {:className "col-sm-2"}
+           (let [started (:started data)]
+             (dom/div
+              #js {:className "row"}
+              (dom/button
+               #js {:type "button"
+                    :className "btn btn-primary btn-lg btn-block"
+                    :onClick #(put! (:started state) (not started))}
+               (if-not started "Start" "Stop"))))
            (dom/div
             #js {:className "row"}
             (om/build grid-config-view
@@ -202,15 +210,7 @@
                       {:init-state
                        (merge state
                               {:width (get-in data [:display :width])
-                               :height (get-in data [:display :height])})}))
-           (let [started (:started data)]
-             (dom/div
-              #js {:className "row"}
-              (dom/button
-               #js {:type "button"
-                    :className "btn btn-primary btn-lg btn-block"
-                    :onClick #(put! (:started state) (not started))}
-               (if-not started "Start" "Stop")))))
+                               :height (get-in data [:display :height])})})))
           (dom/div #js {:className "col-sm-10"}
                    (om/build grid-view
                              data


allow for different port on LB and on target group

--- src/terraboot/core.clj
+++ src/terraboot/core.clj
@@ -221,7 +221,7 @@
 ;; health_check https://www.terraform.io/docs/providers/aws/r/alb_target_group.html# sensible defaults

 (defn alb-listener
-  [name-fn {:keys [account-number protocol port alb-name name ssl-policy cert]}]
+  [name-fn {:keys [account-number protocol lb-port port alb-name name ssl-policy cert]}]
   (let [cluster-resource (partial resource name-fn)
         cluster-output-of (fn [type name output] (output-of type (name-fn name) output))
         ssl-cert-arn (str "arn:aws:iam::" account-number ":server-certificate/" cert)
@@ -229,7 +229,7 @@
         alb-arn (cluster-output-of "aws_alb" alb-name "arn")]
     (cluster-resource "aws_alb_listener" name
                       (add-cert-if-present {:load_balancer_arn alb-arn
-                                            :port port
+                                            :port (or lb-port port) ;; lb-port is optional
                                             :protocol protocol
                                             :default_action {:target_group_arn (cluster-output-of "aws_alb_target_group" name "arn")
                                                              :type "forward"}}))))
@@ -307,8 +307,8 @@
                             :health_check_grace_period (spec :health_check_grace_period)
                             :launch_configuration (cluster-output-of "aws_launch_configuration" name "name")
                             :lifecycle { :create_before_destroy true }
-                            :load_balancers (concat (mapv #(cluster-output-of "aws_elb" (:name %) "name") (:elb spec))
-                                                    (mapv #(cluster-output-of "aws_alb" (:name %) "name") (:alb spec)))
+                            :load_balancers (mapv #(cluster-output-of "aws_elb" (:name %) "name") (:elb spec))
+                            :target_group_arns (mapv #(cluster-output-of "aws_alb_target_group" (:name %) "arn") (:listeners (spec :alb)))
                             :tag {:key "Name"
                                   :value (name-fn name)
                                   :propagate_at_launch true


Close render channel on window quit

Close render channel on window quit

--- src/tile_game/core.clj
+++ src/tile_game/core.clj
@@ -61,13 +61,12 @@
              KeyEvent/VK_RIGHT (slide! render :right)
              KeyEvent/VK_UP    (slide! render :up)
              KeyEvent/VK_DOWN  (slide! render :down)
-             KeyEvent/VK_Q     (.dispose #^JFrame frame)
+             KeyEvent/VK_Q     (do (.dispose #^JFrame frame) (a/close! render))
              KeyEvent/VK_R     (do (shuffle-board! dim) (.repaint panel))
              KeyEvent/VK_S     (apply slide! (cons render (solve-next @board)))
              true)))))
     (doto frame (.setContentPane panel) .pack .show)
-    (a/go (while true
-            (a/<! render)
+    (a/go (while (a/<! render)
             (.repaint panel)))
     render))


cleanup some deadend code

cleanup some deadend code

--- src/tile_game/core.clj
+++ src/tile_game/core.clj
@@ -70,39 +70,6 @@
 (defn solved? [board]
   (= (concat (range 1 (count board)) '(0)) board))

-(defn solver [best-move history board]
-  (if (solved? board)
-    nil
-    (lazy-seq (let [best (best-move history
-                                    board
-                                    (legal-moves board))]
-                (cons best (solver best-move
-                                   (cons best history)
-                                   (move board best)))))))
-
-(defn random-walk [board piece history depth]
-  (take depth (solver (fn [h _ ms]
-                        (rand-nth (remove #(= (first h) %) ms)))
-                      history
-                      (move board piece))))
-
-(defn best-carlo [history board moves]
-  (first (sort-by (fn [m]
-                    (count (random-walk board m history 100)))
-                  (remove #(= (first history) %) moves))))
-
-(def solve (partial solver best-carlo '()))
-
-;; (defn path-to
-;;   [board piece [goal-x goal-y :as goal]]
-;;   (let [[empty-x empty-y :as empty] (coords board 0)
-;;         [x y :as current] (coords board piece)]
-;;     (if (= current goal)
-;;       '()
-;;       (cons (path-to board ))))
-;;   [board goal]
-;;   ())
-
 (defn path-to [board goal]
   (let [current (coords board 0)]
     (if (= current goal)


fixing hierarchies

fixing hierarchies

--- src-clj/mappt/database/sqlite/core.clj
+++ src-clj/mappt/database/sqlite/core.clj
@@ -420,8 +420,10 @@
   (hierarchy-get-parents [this child-uuid]
     (jdbc/with-db-connection [conn db-spec]
       (let [query
-            "SELECT * FROM mappt_hierarchies
-             WHERE child_uuid = ?"
+            "SELECT *.obj FROM mappt_hierarchies AS hierarchy
+             INNER JOIN mappt_objects AS obj
+             ON obj.uuid = hierarchy.parent_uuid
+             WHERE hierarchy.child_uuid = ?"
             result
             (jdbc/query conn [query child-uuid])]
         result)))
@@ -429,6 +431,8 @@
   (hierarchy-get-children [this parent-uuid]
     (jdbc/with-db-connection [conn db-spec]
       (let [query
-            "SELECT * FROM mappt_hierarchies
-             WHERE parent_uuid = ?"]
+            "SELECT *.obj FROM mappt_hierarchies AS hierarchy
+             INNER JOIN mappt_objects AS obj
+             ON obj.uuid = hierarchy.parent_uuid
+             WHERE hierarchy.parent_uuid = ?"]
         (jdbc/query conn [query parent-uuid])))))


Bump serverless template version

Bump serverless template version

--- templates/serverless/project.clj
+++ templates/serverless/project.clj
@@ -1,4 +1,4 @@
-(defproject serverless-cljs/lein-template "0.1.5"
+(defproject serverless-cljs/lein-template "0.1.6"
   :description "Clojurescript on AWS Lambda via Serverless"
   :url         "https://github.com/nervous-systems/cljs-lambda"
   :license     {:name "Unlicense" :url "http://unlicense.org/UNLICENSE"}


CMR-7197: Updated error messages for when check-valid-user fails

--- ingest-app/src/cmr/ingest/api/subscriptions.clj
+++ ingest-app/src/cmr/ingest/api/subscriptions.clj
@@ -186,11 +186,11 @@
   (when (string/blank? user-id)
     (errors/throw-service-error
      :bad-request
-     "INGEST FAILED - No ID was provided. Please provide a SubscriberId or pass in a valid token."))
+     "Subscription creation failed - No ID was provided. Please provide a SubscriberId or pass in a valid token."))
   (when-not (urs/user-exists? context user-id)
     (errors/throw-service-error
      :bad-request
-     (format "The user-id [%s] must correspond to a valid EDL account."
+     (format "Subscription creation failed - The user-id [%s] must correspond to a valid EDL account."
              user-id))))

 (defn generate-native-id


Update core.cljc

Update core.cljc

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -264,7 +264,7 @@
 (defn reg-sub-raw
   "This is a low level, advanced function.  You should probably be
   using reg-sub instead.
-  Docs in https://github.com/day8/re-frame/blob/master/docs/SubscriptionFlow.md"
+  Docs in https://github.com/day8/re-frame/blob/master/docs/flow-mechanics.md"
   [query-id handler-fn]
   (registrar/register-handler subs/kind query-id handler-fn))


WIP - 2ème version du code pour le contest CG "Mean Max - Buggy Road" en "Wood League 1"

--- clojure/codingame/competition/mean-max/src/mean_max/core.clj
+++ clojure/codingame/competition/mean-max/src/mean_max/core.clj
@@ -33,26 +33,35 @@
   "Test whether 'my-unit' is 'near' an 'other-unit'"
   (< (distance (:x my-unit) (:y my-unit) (:x other-unit) (:y other-unit)) (+ (:radius other-unit) (:radius my-unit))))

-(defn compute-reaper-action [my-reaper next-wreck]
-  (cond
-    (nil? next-wreck) "WAIT"
-    (in my-reaper next-wreck) "WAIT"
-    (near my-reaper next-wreck) (str (:x next-wreck) " " (:y next-wreck) " 150")
-    true (str (:x next-wreck) " " (:y next-wreck) " 300")))
+(defn compute-reaper-action [my-reaper wrecks-with-water tankers]
+  (let [next-wreck (first (sort-by #(distance (:x my-reaper) (:y my-reaper) (:x %) (:y %)) wrecks-with-water))
+        tankers-sorted-by-distance (sort-by #(distance (:x my-reaper) (:y my-reaper) (:x %) (:y %)) tankers)
+        next-tanker (first tankers-sorted-by-distance)]
+    (cond
+      (and (nil? next-wreck) (nil? next-tanker)) "WAIT"
+      (and (nil? next-wreck) (not (nil? next-tanker))) (str (:x next-tanker) " " (:y next-tanker) " 150")
+      (in my-reaper next-wreck) "WAIT"
+      (near my-reaper next-wreck) (str (:x next-wreck) " " (:y next-wreck) " 200")
+      true (str (:x next-wreck) " " (:y next-wreck) " 300"))))

-(defn compute-destroyer-action [my-destroyer next-tanker my-rage tankers]
-  (cond
-    (nil? next-tanker) "WAIT"
-    (in my-destroyer next-tanker) (str (:x next-tanker) " " (:y next-tanker) " 0")
-    (and (or (in my-destroyer next-tanker) (near my-destroyer next-tanker)) (> my-rage 200)) (str "SKILL " (:x (last tankers)) " " (:y (last tankers)))
-    (> my-rage 150) (str "SKILL " (:x next-tanker) " " (:y next-tanker))
-    true (str (:x next-tanker) " " (:y next-tanker) " 300")))
+(defn compute-destroyer-action [my-destroyer tankers enemy-reapers my-rage]
+  (let [nearest-enemy-reaper (first (sort-by #(distance (:x my-destroyer) (:y my-destroyer) (:x %) (:y %)) enemy-reapers))
+        tankers-sorted-by-distance (sort-by #(distance (:x my-destroyer) (:y my-destroyer) (:x %) (:y %)) tankers)
+        next-tanker (first tankers-sorted-by-distance)
+        last-tankers (last tankers-sorted-by-distance)]
+    (cond
+      (nil? next-tanker) (str (:x nearest-enemy-reaper) " " (:y nearest-enemy-reaper) " 300")
+      (in my-destroyer next-tanker) (str (:x next-tanker) " " (:y next-tanker) " 0")
+      (and (near my-destroyer next-tanker) (> my-rage 200)) (str "SKILL " (:x last-tankers) " " (:y last-tankers))
+      (> my-rage 150) (str "SKILL " (:x last-tankers) " " (:y last-tankers))
+      true (str (:x next-tanker) " " (:y next-tanker) " 300"))))

 (defn compute-doof-action [my-doof enemy-reapers my-rage]
   (let [nearest-enemy-reaper (first (sort-by #(distance (:x my-doof) (:y my-doof) (:x %) (:y %)) enemy-reapers))]
-    (cond
-      (>= my-rage 300) "WAIT"
-      true (str (:x nearest-enemy-reaper) " " (:y nearest-enemy-reaper) " 300"))))
+    ;;(cond
+    ;;  (>= my-rage 300) "WAIT"
+    ;;  true (str (:x nearest-enemy-reaper) " " (:y nearest-enemy-reaper) " 300"))))
+    (str (:x nearest-enemy-reaper) " " (:y nearest-enemy-reaper) " 300")))

 (defn -main [& args]
   (while true
@@ -84,10 +93,7 @@
             enemy-doofs (filter #(not= (:player-id %) 0) doofs)
             my-reaper (first (filter #(= (:player-id %) 0) reapers))
             my-destroyer (first (filter #(= (:player-id %) 0) destroyers))
-            my-doof (first (filter #(= (:player-id %) 0) doofs))
-            next-wreck (first (sort-by #(distance (:x my-reaper) (:y my-reaper) (:x %) (:y %)) wrecks-with-water))
-            tankers-sorted-by-distance (sort-by #(distance (:x my-destroyer) (:y my-destroyer) (:x %) (:y %)) tankers)
-            next-tanker (first tankers-sorted-by-distance)]
+            my-doof (first (filter #(= (:player-id %) 0) doofs))]
         (binding [*out* *err*] (println "wrecks : " (string/join " " (map #(into {} %) wrecks)))
                                (println "wrecks with water: " (string/join " " (map #(into {} %) wrecks-with-water)))
                                (println "tankers : " (string/join " " (map #(into {} %) tankers)))
@@ -97,17 +103,7 @@
                                (println "enemy destroyers: " (string/join " " (map #(into {} %) enemy-destroyers)))
                                (println "my reaper : " (string/join " " my-reaper))
                                (println "my destroyer : " (string/join " " my-destroyer))
-                               (println "my doof : " (string/join " " my-doof))
-                               (println "next wreck : " (string/join " " next-wreck))
-                               (println "next tanker : " (string/join " " next-tanker)))
-        (println (compute-reaper-action my-reaper next-wreck))
-        (println (compute-destroyer-action my-destroyer next-tanker my-rage tankers-sorted-by-distance))
+                               (println "my doof : " (string/join " " my-doof)))
+        (println (compute-reaper-action my-reaper wrecks-with-water tankers))
+        (println (compute-destroyer-action my-destroyer tankers enemy-reapers my-rage))
         (println (compute-doof-action my-doof enemy-reapers my-rage))))))
-
-      ; (binding [*out* *err*]
-      ;   (println "Debug messages..."))
-
-      ; Write action to stdout
-      ;(println "WAIT")
-      ;(println "WAIT")
-      ;(println "WAIT"))))


Improve REPL usability of network tests toggle

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -132,7 +132,7 @@
     (catch java.net.UnknownHostException e
       false)))

-(def run-network-tests? true)
+(defonce run-network-tests? (atom false))

 (defn try-fetch-url [url]
   (some-> url
@@ -145,7 +145,7 @@

 (defn test-scrape-urls []
   (and
-   run-network-tests?
+   @run-network-tests?

    (test-url root-url)
    (test-url manga-url)
@@ -160,7 +160,7 @@
 (defn test-full-site-traversal [site]
   (and
    (call-with-options site #(ensure-all-dependencies))
-   run-network-tests?
+   @run-network-tests?

    (is (not
         (nil?


Create a function for testing all the root urls

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -2,7 +2,8 @@
   (:require [clojure.test :refer :all]
             [comic-reader.sites :refer :all]
             [comic-reader.scrape :as scrape]
-            [net.cgrand.enlive-html :as html]))
+            [net.cgrand.enlive-html :as html]
+            [clj-http.client :as client]))

 (defmacro test-data-functions-not-nil []
   `(are [selector] (is (not= (selector)
@@ -28,9 +29,18 @@
      page-normalize-format
      page-normalize-pattern))

+(defmacro test-url-format-strings []
+  `(are [url-fn] (is (= (:status (client/head (url-fn)))
+                        200)
+                     (str (url-fn) "does not appear to exist."))
+     root-url
+     manga-url
+     manga-list-url))
+
 (deftest extract-comics-list-test
   (binding [options (read-site-options "manga-fox")]
     (test-data-functions-not-nil)
+    (test-url-format-strings)

     (let [html (html/html [:div {}])
           comics (extract-comics-list html)]


Add cursor assert test

Add cursor assert test

--- test/reagenttest/testcursor.cljs
+++ test/reagenttest/testcursor.cljs
@@ -468,3 +468,6 @@
     (f)
     (is (= @spy false))
     (dispose r)))
+
+(deftest cursor-assert-test
+  (is (thrown-with-msg? :default #"src must be a reactive atom or a function, not nil while attempting to get path: \[:foo :bar\]" (r/cursor nil [:foo :bar]))))


gui: file handling

gui: file handling

* added converter from project node to lwf structure

--- src/gui/project-tree.clj
+++ src/gui/project-tree.clj
@@ -36,9 +36,16 @@
 	                            (second %))
 	                         (dissoc data :__description)))))
    (catch java.io.FileNotFoundException e
-     (alert (str "Die Datei " f " konnte nicht gefunden werden!")))
-   ))
-
+     (alert (str "Die Datei " f " konnte nicht gefunden werden!")))))
+
+(defn node2lwf-structure
+  [n]
+  (when (.path n)
+    (apply hash-map (flatten (conj
+                               (map
+                                 (fn [node] [(keyword (.name node)) (.content node)])
+                                 (.children n))
+                               [:__description (.content n)])))))

 (defn- projects
   [file-vector]


wip digital-result-format

wip digital-result-format

--- src/main/clojure/gpio/core.clj
+++ src/main/clojure/gpio/core.clj
@@ -39,6 +39,41 @@
           "0"   \0
           value)))

+(defn- do-format
+  [raw-value high low]
+  (if  (= \1 raw-value) high low))
+
+(defmulti format-raw-digital
+  "Formats the raw values received from digital reads of pin state,
+      or digital events.
+
+        The type specified is a keyword."
+  (fn [type _] type))
+
+(defmethod format-raw-digital :keyword
+  [_ raw-value]
+  (do-format raw-value :high :low))
+
+(defmethod format-raw-digital :boolean
+  [_ raw-value]
+  (= \1 raw-value))
+
+(defmethod format-raw-digital :symbol
+  [_ raw-value]
+  (do-format raw-value 'high 'low))
+
+(defmethod format-raw-digital :integer
+  [_ raw-value]
+  (do-format raw-value 1 0))
+
+(defmethod format-raw-digital :char
+  [_ raw-value]
+  raw-value)
+
+(defmethod format-raw-digital :default
+  [_ raw-value]
+  raw-value)
+
 (defprotocol Closeable
   (close! [self] "Closes this object"))

@@ -67,42 +102,46 @@
       * :direction - sets the initial direction
       * :active-low? - sets the port as \"active low\", value true or false
       * :initial-value - sets the intitial value of the pin.
+      * :digital-result-format - describes the format for digital values on read
+          This can be one of #{:keyword :symbol }
       * :from-raw-fn - a converter function, which takes the `char`
           value (\1 or \0) read and converts it into a meaningful value.
-          The default converts the values to :high and :low respectively "
+          Overrides the default formatter"
   [port & [opts]]
   (export! port)
-  (let [{:keys [from-raw-fn direction active-low? initial-value]
-         :or {from-raw-fn #(if (= \1 %) :high :low)}} opts
+  (let [{:keys [digital-result-format from-raw-fn direction active-low? initial-value]
+         :or {digital-result-format :keyword}} opts
+        _ (println digital-result-format)
+        formatter (or from-raw-fn (partial format-raw-digital digital-result-format))
         filename (value-file port)
         raf (random-access filename)
         props {:port port, :file-name filename, :file raf}
         gpio-port (reify
-                   clojure.lang.ILookup
-
-                   (valAt [_ k not-found] (get props k not-found))
-                   (valAt [_ k] (k props))
-
-                   GpioPort
-
-                   (set-direction! [_ direction] (do-set-direction! port direction))
-
-                   (set-active-low! [_ active-low?] (do-set-active-low port active-low?))
-
-                   (read-value
-                    [_]
-                    (.seek raf 0)
-                    (from-raw-fn (char (.read raf))))
-
-                   (write-value!
-                    [_ value]
-                    (.seek raf 0)
-                    (.writeByte raf (high-low-value value)))
-
-                   Closeable
-                   (close! [_]
-                           (.close raf)
-                           (unexport! port)))]
+                    clojure.lang.ILookup
+
+                    (valAt [_ k not-found] (get props k not-found))
+                    (valAt [_ k] (k props))
+
+                    GpioPort
+
+                    (set-direction! [_ direction] (do-set-direction! port direction))
+
+                    (set-active-low! [_ active-low?] (do-set-active-low port active-low?))
+
+                    (read-value
+                      [_]
+                      (.seek raf 0)
+                      (formatter (char (.read raf))))
+
+                    (write-value!
+                      [_ value]
+                      (.seek raf 0)
+                      (.writeByte raf (high-low-value value)))
+
+                    Closeable
+                    (close! [_]
+                      (.close raf)
+                      (unexport! port)))]
     (try
       (when direction (set-direction! gpio-port direction))
       (when active-low? (set-active-low! gpio-port active-low?))
@@ -110,9 +149,7 @@
       gpio-port
       (catch Exception e
         (close! gpio-port)
-        (throw e)))
-
-))
+        (throw e)))))

 (defn- tap-and-wrap-chan [mult-ch out-ch]
   (a/tap mult-ch out-ch)
@@ -133,7 +170,7 @@

 (defn open-channel-port
   "Opens a port which can be used for listening to value changes.  In addition to the
-  options map for a basic port, the following are available:
+  options map for [[open-port]], the following are available:
   * :event-buffer-size - the size of the change events buffer.  Defaults to 1
   * :timeout - sets a timeout for the OS polling wait time.  Defaults to -1, which waits indefinitely
   * :edge - sets the edge value- :rising, :falling, or :both"
@@ -177,13 +214,13 @@
       GpioChannelProvider

       (set-edge! [_ setting]
-                 (do-set-edge! port setting))
+        (do-set-edge! port setting))

       (create-edge-channel [_] (tap-and-wrap-chan mult-ch (create-channel)))

       Closeable
       (close! [_]
-              (a/close! write-ch)
-              (a/close! read-ch)
-              (.close poller)
-              (close! gpio-port)))))
+        (a/close! write-ch)
+        (a/close! read-ch)
+        (.close poller)
+        (close! gpio-port)))))


Fixed small bug in count-in length-in

Fixed small bug in count-in length-in

--- src/selmer/filters.clj
+++ src/selmer/filters.clj
@@ -202,13 +202,15 @@
      ;;; Return true when the count of the coll matches the argument
      :length-is
      (fn [coll n]
-       (throw-when-expecting-seqable coll)
+       (when-not (nil? coll)
+         (throw-when-expecting-seqable coll))
        (let [n (Long/valueOf ^String n)]
          (= n (count coll))))

      :count-is
      (fn [coll n]
-       (throw-when-expecting-seqable coll)
+       (when-not (nil? coll)
+         (throw-when-expecting-seqable coll))
        (let [n (Long/valueOf ^String n)]
          (= n (count coll))))


Alter ASG's with ALBs and rules to associate target groups

--- src/terraboot/core.clj
+++ src/terraboot/core.clj
@@ -372,7 +372,11 @@
                             :launch_configuration (cluster-output-of "aws_launch_configuration" name "name")
                             :lifecycle { :create_before_destroy true }
                             :load_balancers (mapv #(cluster-output-of "aws_elb" (:name %) "name") (:elb spec))
-                            :target_group_arns (mapv #(cluster-output-of "aws_alb_target_group" (:name %) "arn") (mapcat :listeners (:alb spec)))
+                            :target_group_arns (let [listeners (mapcat :listeners (:alb spec))
+                                                     target-groups (mapcat :target-groups listeners)
+                                                     names (concat (map :name listeners)
+                                                                   (map :name target-groups))]
+                                                 (mapv #(cluster-output-of "aws_alb_target_group" % "arn") names))
                             :tag {:key "Name"
                                   :value (name-fn name)
                                   :propagate_at_launch true


Refactor maps elements rendering

Refactor maps elements rendering

Do not use `into` as this causes react-key warnings.

--- src/cljs/gtfve/components/maps_canvas/google.cljs
+++ src/cljs/gtfve/components/maps_canvas/google.cljs
@@ -181,6 +181,7 @@
                                             "click"
                                             (om/get-state owner :data-click-ch))
             kill-ch (om/get-state owner :kill-ch)]
+        (om/set-state! owner :stops-xf (comp second-xf filter-stops-xf))
         (om/set-state! owner :data-click-mult (async/mult data-click-ch))
         (om/set-state! owner :gmap google-map)
         (.setStyle data #js {:icon "http://mt.google.com/vt/icon?psize=25&font=fonts/Roboto-Bold.ttf&color=ff135C13&name=icons/spotlight/spotlight-waypoint-a.png&ax=44&ay=50&text=%E2%80%A2"})
@@ -213,25 +214,21 @@
           (.setOptions gmap (clj->js options)))))
     om/IRenderState
     (render-state [_ {:keys [gmap info-window data-click-mult] :as state}]
-      (let [stops (:stops-search-results data)]
+      (let [stops (:stops-search-results data)
+            modes (->> ui :modes (filter second) (map first))]
         (html
-         (->> [:div.maps-viewport
-               #_(om/build maps-canvas-dev (:stops data) {:state {:gmap gmap}})
-               [:div.maps-canvas {:ref "gmap"}]]
-              (#(if gmap
-                  (into
-                   %
-                   (om/build-all search-stop-marker stops {:key :stop/name
-                                                           :state {:gmap gmap
-                                                                   :info-window info-window
-                                                                   :data-click-mult data-click-mult}}))
-                  %))
-              (#(if gmap
-                  (into
-                   %
-                   (om/build-all stop-marker
-                                 (:stops data)
-                                 {:key :stop/id
-                                  :state {:gmap gmap}}))
-                  %))
-              ))))))
+         [:div.maps-viewport
+          #_(om/build maps-canvas-dev (:stops data) {:state {:gmap gmap}})
+          [:div.maps-canvas {:ref "gmap"}]
+          (when (and gmap
+                     (some #{:stops?} modes)
+                     (<= 16 (.getZoom gmap)))
+            (om/build-all stop-marker
+                          (:stops data)
+                          {:key :db/id
+                           :state {:gmap gmap}}))
+          (when gmap
+            (om/build-all search-stop-marker stops {:key :stop/name
+                                                    :state {:gmap gmap
+                                                            :info-window info-window
+                                                            :data-click-mult data-click-mult}}))])))))


Remove unnecessary vector in :import causing spec error

```
-- Spec failed --------------------

  (... ... (... [org.apache.zookeeper.KeeperException$NoNodeException]))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

should satisfy

  simple-symbol?

or

should have additional elements. The next element ":classes" should satisfy

  simple-symbol?
```

--- src/onyx/peer_query/job_query.clj
+++ src/onyx/peer_query/job_query.clj
@@ -4,7 +4,7 @@
             [onyx.static.planning :refer [find-task]]
             [onyx.peer-query.replica-query :as rq]
             [onyx.extensions :as extensions])
-  (:import [org.apache.zookeeper.KeeperException$NoNodeException]))
+  (:import org.apache.zookeeper.KeeperException$NoNodeException))

 (defn ^{:no-doc true} get-log [log]
   (:log (:env log)))


fixing test

fixing test

--- src/hydrox/meta/util.clj
+++ src/hydrox/meta/util.clj
@@ -120,7 +120,7 @@
   (->> project
        path-type
        (#(if (sequential? %) % [%]))
-       (map (fn [dir] (file-seq (io/file (if (.startsWith dir "/")
+       (mapcat (fn [dir] (file-seq (io/file (if (.startsWith dir "/")
                                               dir
                                               (str (:root project) "/" dir))))))
        (filter (fn [file] (and (.isFile file)


Add tests to check, working endpoint, path and tenant values

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -361,6 +361,12 @@
                                                            :axisLabelX "Age"
                                                            :bucketColumn "c2"))}))
                      body-kw :series first :data)))))
+
+      (testing "/metrics & proper values passed: path and tenant"
+        (let [r (h (get*  "/metrics"))]
+          (is (= 200 (:status r)))
+          (is (some? (re-find #"path=\"/api/aggregation/:dataset-id/:visualisation-type\",tenant=\"t1\""
+                              (:body r))))))

       (testing "/transformations/:id/transform & /transformations/:id/undo"
         (let [title "GDP-dataset"


:date parsed to DateTime in events (parser.clj).

--- src/vertigo/parser.clj
+++ src/vertigo/parser.clj
@@ -16,7 +16,7 @@
        :title (xml1-> show :Title text)
        :original-title (xml1-> show :OriginalTitle text)
        :theatre (xml1-> show :TheatreAndAuditorium text)
-       :date (xml1-> show :dttmShowStart text)
+       :date (parse (xml1-> show :dttmShowStart text))
        :day (str (.toLocalDate (parse (xml1-> show :dttmShowStart text))))
        :genres (into #{} (split (xml1-> show :Genres text) #", "))
        :image (xml1-> show :Images :EventLargeImagePortrait text)})))


Fix previous commit

Fix previous commit

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -368,5 +368,5 @@
 (def ring-handler (middleware/war-handler app))

 (defn -main [& args]
-  [port (Integer/parseInt (System/getenv "PORT"))]
-  (run-server #'ring-handler {:port port}))
+  (let [port (Integer/parseInt (System/getenv "PORT"))]
+    (run-server #'ring-handler {:port port})))


Some potential future code for dealing with fns in option maps.

--- src/zprint/config.cljc
+++ src/zprint/config.cljc
@@ -1070,6 +1070,32 @@
           error-string (apply str (interpose ", " error-seq))]
       (if (empty? error-string) nil error-string))))

+(defn validate-fn-option-pairs-extended
+  "Given a seq of fn-option pairs, validate the options maps in the
+  pairs.  Returns nil for success and an error string with any errors."
+  [fn-option-pairs source-str]
+  (when (not (empty? fn-option-pairs))
+    (let
+      [error-seq
+         (mapv
+           #(if (map? (second %))
+              (validate-options
+                (second %)
+                (str ":fn-map, in the options map assocated with the function: "
+                     (first %)))
+              (if (fn? (second %))
+                nil
+                (str
+                  "In "
+                  source-str
+                  " :fn-map, in the vector associated with the function: "
+                  (first %)
+                  " the second element of the vector must be a map or a function.")))
+           fn-option-pairs)
+       error-seq (remove nil? error-seq)
+       error-string (apply str (interpose ", " error-seq))]
+      (if (empty? error-string) nil error-string))))
+
 (defn validate-options
   "Validate an options map, source-str is a descriptive phrase
   which will be included in the errors (if any). Returns nil
@@ -1191,7 +1217,9 @@
                                " because " e)]))]
             (if file-error
               (if optional? nil [nil file-error full-path])
-              (try (let [opts-file (clojure.edn/read-string (apply str lines))]
+              (try (let [opts-file
+                           #_(load-file filename)
+                           (clojure.edn/read-string (apply str lines))]
                      [opts-file nil full-path])
                    (catch Exception e
                      [nil


Fix 440: REPL view should handle responses for the *session*, not start a new future for each message sent

--- ccw.core/src/clj/ccw/repl/view_helpers.clj
+++ ccw.core/src/clj/ccw/repl/view_helpers.clj
@@ -85,7 +85,6 @@
                 (if (log-styles k)
                   (log log-component v k)
                   (CCWPlugin/log (str "Cannot handle REPL response: " k (pr-str resp)))))
-              ;(CCWPlugin/log (str resp))
               (doseq [status status]
                 (case status
                   "interrupted" (log log-component (eval-failure-msg status expr) :err)
@@ -95,10 +94,10 @@
 (defn eval-expression
   [repl-view log-component client expr]
   (try
-    (handle-responses repl-view log-component expr
-      (repl/message client (if (map? expr)
-                             expr
-                             {:op :eval :code expr :ns (.getCurrentNamespace repl-view)})))
+    (repl/message client
+      (if (map? expr)
+        expr
+        {:op :eval :code expr :ns (.getCurrentNamespace repl-view)}))
     (catch Throwable t
       (CCWPlugin/logError (eval-failure-msg nil expr) t)
       (log log-component (eval-failure-msg nil expr) :err))))
@@ -109,7 +108,8 @@
                                                         .getLaunch
                                                         ccw.launching.LaunchUtils/getProjectName))
         ^StyledText input-widget (.viewerWidget repl-view)
-        ; a bunch of atoms are just fine, since access to them is already serialized via the SWT event thread
+        ; a bunch of atoms are just fine, since access to them is already
+        ; serialized via the SWT event thread
         history (atom history)
         current-step (atom -1)
         retained-input (atom nil)
@@ -133,6 +133,11 @@
         session-client (repl/client-session repl-client :session session-id)
         responses-promise (promise)]
     (.setHistoryActionFn repl-view history-action-fn)
+
+    ;; TODO need to make client-session accept a single arg to avoid
+    ;; dummy message sends
+    (handle-responses repl-view log-panel nil (session-client {:op "describe"}))
+
     (comp (partial eval-expression repl-view log-panel session-client)
       (fn [expr add-to-log?]
         (reset! retained-input nil)


check the secure uuid in the token and in the request

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -595,7 +595,10 @@
   :allowed-methods [:options :get]

   ;; Authorization
-  :allowed? true
+  :allowed? (fn [ctx]
+              (if (:id-token ctx)
+                (= secure-uuid (:secure-uuid (:user ctx)))
+                true))

   ;; Media type client accepts
   :available-media-types (by-method {


Better names for flow compilation functions.

--- src/onyx/peer/task_compile.clj
+++ src/onyx/peer/task_compile.clj
@@ -19,10 +19,10 @@
        (assoc condition :flow/predicate (build-pred-fn (:flow/predicate condition) condition)))
      conditions)))

-(defn compile-fc-norms [flow-conditions task-name]
+(defn compile-fc-happy-path [flow-conditions task-name]
   (compile-flow-conditions flow-conditions task-name (comp not :flow/thrown-exception?)))

-(defn compile-fc-exs [flow-conditions task-name]
+(defn compile-fc-exception-path [flow-conditions task-name]
   (compile-flow-conditions flow-conditions task-name :flow/thrown-exception?))

 (defn resolve-lifecycle-calls [calls]
@@ -212,9 +212,9 @@
 (defn flow-conditions->event-map [event flow-conditions task-name]
   (-> event
       (assoc :onyx.core/compiled-norm-fcs
-             (compile-fc-norms flow-conditions task-name))
+             (compile-fc-happy-path flow-conditions task-name))
       (assoc :onyx.core/compiled-ex-fcs
-             (compile-fc-exs flow-conditions task-name))))
+             (compile-fc-exception-path flow-conditions task-name))))

 (defn lifecycles->event-map [event lifecycles task-name]
   (-> event


util/hadoop.clj: fix counter for single names

--- src/org/altlaw/util/hadoop.clj
+++ src/org/altlaw/util/hadoop.clj
@@ -20,8 +20,10 @@
 (declare *reporter*)

 (defn counter
-  ([name] (.incrCounter *reporter* (name (ns-name *ns*)) name 1))
-  ([group name] (.incrCounter *reporter* group name 1)))
+  ([counter-name]
+     (.incrCounter *reporter* "Custom counters" counter-name 1))
+  ([group counter-name]
+     (.incrCounter *reporter* group counter-name 1)))

 (defn default-jobconf [this]
   (let [conf (.getConf this)


Make the piano sample index-buffer public

--- src/overtone/samples/piano.clj
+++ src/overtone/samples/piano.clj
@@ -47,7 +47,7 @@
 ;; Silent buffer used to fill in the gaps.
 (defonce ^:private silent-buffer (buffer 0))

-(defonce ^:private index-buffer
+(defonce index-buffer
   (let [tab (note-index piano-samples piano-note-fn)
         buf (buffer 128)]
     (buffer-fill! buf (:id silent-buffer))


Added comments and the function lower.

Added comments and the function lower.

--- src/overtunes/pitch/chords.clj
+++ src/overtunes/pitch/chords.clj
@@ -14,13 +14,16 @@
            names
            (eval values))))

+; Basic intervals
 (def semitone 1)
 (def tone (* semitone 2))
 (def octave (* 12 semitone))

+; Operations on intervals
 (def sharp #(+ % semitone))
 (def flat #(- % semitone))
 (def raise #(+ % octave))
+(def lower #(- % octave))

 (defn scale
   "Define a scale as a cumulative sum of intervals."


Adds remainder of link page copy.

Adds remainder of link page copy.

--- src/cljs/reagent_toolbox_docs/components/link.cljs
+++ src/cljs/reagent_toolbox_docs/components/link.cljs
@@ -22,8 +22,74 @@
                                         :href \"/link\"
                                         :label \"Work\"
                                         :count 4
-                                        :icon \"business\"}]]))
-       [link-text]"]]))
+                                        :icon \"business\"}]
+            [reagent-toolbox.core/link {:href \"/link\"
+                                        :label \"Blog\"
+                                        :icon \"speaker_notes\"}]
+            [reagent-toolbox.core/link {:href \"/link\"
+                                        :label \"Explore\"
+                                        :icon \"explore\"}]]))
+       [link-text]"]
+
+     [:p "If you want to provide a theme via context, the component key is RTLink."]
+
+     [:section
+      [:h2 "Properties"]
+      [:p "You can add as many properties as you want to be directly transferred to the output "
+       "anchor element. Apart from them you have the following properties:"]
+
+      [:table
+       [:thead
+        [:tr
+         [:th "Name"]
+         [:th "Type"]
+         [:th "Default"]
+         [:th "Description"]]]
+       [:tbody
+        [:tr
+         [:td [:code "active"]]
+         [:td [:code "boolean"]]
+         [:td [:code "false"]]
+         [:td "If true, adds active style to link."]]
+        [:tr
+         [:td [:code "class-name"]]
+         [:td [:code "string"]]
+         [:td [:code "''"]]
+         [:td "Sets a custom class name to add styles to the link."]]
+        [:tr
+         [:td [:code "count"]]
+         [:td [:code "integer"]]
+         [:td]
+         [:td "Sets a count number."]]
+        [:tr
+         [:td [:code "icon"]]
+         [:td [:code "string or element"]]
+         [:td]
+         [:td "An icon key string to include a font-icon component in front of the text."]]
+        [:tr
+         [:td [:code "label"]]
+         [:td [:code "string"]]
+         [:td]
+         [:td "The text string used for the text content of the link."]]]]]
+
+     [:section
+      [:h2 "Theme"]
+
+      [:table
+       [:thead
+        [:tr
+         [:th "Name"]
+         [:th "Description"]]]
+       [:tbody
+        [:tr
+         [:td [:code "active"]]
+         [:td "Added to the root element if the link is active."]]
+        [:tr
+         [:td [:code "icon"]]
+         [:td "Used for the icon element if it's present."]]
+        [:tr
+         [:td [:code "link"]]
+         [:td "Used for the root element."]]]]]]))

 (defmethod layout/pages :link [_]
   [view])


add id-sk attributes to comp-tag

add id-sk attributes to comp-tag

--- src/navigator/schema.clj
+++ src/navigator/schema.clj
@@ -11,7 +11,10 @@
             [:tags :ref :many]]
     :dbfns [(constraints/unique :comp :name :version)]}
    {:namespace :comp-tag
-    :attrs [[:name :string :indexed] ; not null
+    :attrs [[:id-sk :string]
+            [:id-sk-origin :keyword]
+            [:id-sk-with-origin :string :db.unique/identity]
+            [:name :string :indexed] ; not null
             [:description :string]
             [:version :string]     ; not null
             [:type :string :indexed] ; not null
@@ -19,13 +22,13 @@
             [:icon :uri]
             [:status :enum [:active :archived]] ; not null
             [:isfinal :boolean] ; default f
-            [:disp-ctxs :ref :many]
+            ;; [:disp-ctxs :ref :many]
             [:child-tags :ref :many]
             [:child-perf-asmts :ref :many]
             [:child-comps :ref :many]]
     :dbfns [(constraints/unique :comp-tag :name :version)]}
-   {:namespace :comp-tag-disp-ctx
-    :attrs [[:name :string]]}
+;;   {:namespace :comp-tag-disp-ctx
+;;    :attrs [[:name :string]]}
    {:namespace :user2comp
     :attrs [[:sis-user-id :bigint :indexed]
             [:comp :ref :indexed]


fixed getting an ex

fixed getting an ex

--- src/ontrail/exercise.clj
+++ src/ontrail/exercise.clj
@@ -23,7 +23,7 @@

 (defn get-exercise [id]
   (let [exercise (mc/find-one-as-map EXERCISE {:_id (ObjectId. id)})
-        user-profile (get :profile (mc/find-one-as-map ONUSER {:_id (get exercise :user)}))
+        user-profile (get (mc/find-one-as-map ONUSER {:_id (get exercise :user)}) :profile)
         heart-rate-reserve (get-heart-rate-reserve exercise user-profile)]
     {:heading (get exercise :heading)
      :body (get exercise :body)


(PE-4709) Correct one more instance of 'jvm-puppet'

--- src/clj/puppetlabs/services/config/puppet_server_config_service.clj
+++ src/clj/puppetlabs/services/config/puppet_server_config_service.clj
@@ -1,5 +1,5 @@
 (ns ^{:doc
-       "Implementation of the JvmPuppetConfigService."}
+       "Implementation of the PuppetServerConfigService."}
     puppetlabs.services.config.puppet-server-config-service

   (:require [puppetlabs.trapperkeeper.core :as tk]


Fix exclude of logger from junit4 runners

Incorrectly changed the gen-runners call to exclude the logger
namespace, but this is now fixed.

--- modules/gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/clojure_test_junit4.clj
+++ modules/gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/clojure_test_junit4.clj
@@ -152,5 +152,5 @@
                 `(gen-class :name ~(with-meta (symbol ns#) {'org.junit.runner.RunWith 'gradle_clojure.tools.ClojureTestRunner})))
               nses))))
 (gen-runners (remove #{"gradle-clojure.tools.clojure-test-junit4"
-                       "gradle-clojure.tools.logger"})
-             gradle-clojure.tools.clojure-compiler/*namespaces*)
+                       "gradle-clojure.tools.logger"}
+                     gradle-clojure.tools.clojure-compiler/*namespaces*))


formatting

formatting

--- src/chat/client/views/pages/inbox.cljs
+++ src/chat/client/views/pages/inbox.cljs
@@ -12,14 +12,16 @@
         (dom/div #js {:className "title"} "Inbox")
         (apply dom/div #js {:className "threads"
                             :ref "threads-div"
-                            :onWheel (fn [e]
-                                       (let [target-classes (.. e -target -classList)
-                                             this-elt (om/get-node owner "threads-div")]
-                                         ; TODO: check if threads-div needs to scroll?
-                                         (when (and (or (.contains target-classes "thread")
-                                                        (.contains target-classes "threads"))
-                                                 (= 0 (.-deltaX e) (.-deltaZ e)))
-                                           (set! (.-scrollLeft this-elt) (- (.-scrollLeft this-elt) (.-deltaY e))))))}
+                            :onWheel ; make the mouse wheel scroll horizontally
+                            (fn [e]
+                              (let [target-classes (.. e -target -classList)
+                                    this-elt (om/get-node owner "threads-div")]
+                                ; TODO: check if threads-div needs to scroll?
+                                (when (and (or (.contains target-classes "thread")
+                                               (.contains target-classes "threads"))
+                                        (= 0 (.-deltaX e) (.-deltaZ e)))
+                                  (set! (.-scrollLeft this-elt)
+                                        (- (.-scrollLeft this-elt) (.-deltaY e))))))}
           (concat
             [(new-thread-view {})]
             (map (fn [t] (om/build thread-view t {:key :id}))


Revert "Don't draw actor entities twice"

This reverts commit bb7de511154dca3ba735ef1bfe28983196d62eed.

--- src/play_clj/core_graphics.clj
+++ src/play_clj/core_graphics.clj
@@ -492,14 +492,13 @@
   (let [^Batch batch (.getBatch renderer)]
     (.begin batch)
     (doseq [{:keys [additive? opacity] :as entity} entities]
-      (when-not (instance? Actor (:object entity))
-        (when additive?
-          (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one)))
-        (.setColor batch (color 1 1 1 (or opacity 1.0)))
-        (e/draw! entity screen batch)
-        (.setColor batch (color 1 1 1 1))
-        (when additive?
-          (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one-minus-src-alpha)))))
+      (when additive?
+        (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one)))
+      (.setColor batch (color 1 1 1 (or opacity 1.0)))
+      (e/draw! entity screen batch)
+      (.setColor batch (color 1 1 1 1))
+      (when additive?
+        (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one-minus-src-alpha))))
     (.end batch))
   entities)


Use more readable group position keywords

--- src/overtone/sc/node.clj
+++ src/overtone/sc/node.clj
@@ -555,10 +555,10 @@

 (defn- setup-core-groups
   []
-  (let [input-group   (with-server-sync #(group 0 0))
-        root-group    (with-server-sync #(group 3 input-group))
-        mixer-group   (with-server-sync #(group 3 root-group))
-        monitor-group (with-server-sync #(group 3 mixer-group))]
+  (let [input-group   (with-server-sync #(group :head 0))
+        root-group    (with-server-sync #(group :after input-group))
+        mixer-group   (with-server-sync #(group :after root-group))
+        monitor-group (with-server-sync #(group :after mixer-group))]
     (dosync
       (alter core-groups* assoc
              :input   input-group


Cleaned out time2 calls in conversation update graph

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -67,33 +67,26 @@
                     opts))

    :rating-mat  (plmb/fnk [conv votes]
-                  (time2 "rating-mat"
                   (update-nmat (:rating-mat conv)
-                               (map (fn [v] (vector (:pid v) (:tid v) (:vote v))) votes))))
+                               (map (fn [v] (vector (:pid v) (:tid v) (:vote v))) votes)))

    :n           (plmb/fnk [rating-mat]
-                  "count the participants"
-                  (time2 "counting-ptpts"
-                    (count (rownames rating-mat))))
+                  (count (rownames rating-mat)))

    :n-cmts      (plmb/fnk [rating-mat]
-                  "count comments"
-                  (time2 "counting-comments"
-                    (count (colnames rating-mat))))
+                  (count (colnames rating-mat)))

    :user-vote-counts
                 (plmb/fnk [rating-mat votes]
-                  "This counts the number of actual votes each user has"
-                  (time2 "user-vote-count"
-                    (mapv
-                      (fn [rowname row] [rowname (count (remove nil? row))])
-                      (rownames rating-mat)
-                      (get-matrix rating-mat))))
+                  (mapv
+                    (fn [rowname row] [rowname (count (remove nil? row))])
+                    (rownames rating-mat)
+                    (get-matrix rating-mat)))

    :in-conv     (plmb/fnk [conv user-vote-counts n-cmts]
-                  "This keeps track of which ptpts are in the conversation (to be considered
-                  for base-clustering) based on home many votes they have. Once a ptpt is in,
-                  they will remain in."
+                  ; This keeps track of which ptpts are in the conversation (to be considered
+                  ; for base-clustering) based on home many votes they have. Once a ptpt is in,
+                  ; they will remain in.
                   (as-> (or (:in-conv conv) #{}) in-conv
                     ; Start with whatever you have, and join it with anything that meets the criteria
                     (into in-conv
@@ -127,25 +120,22 @@
   (merge
      base-conv-update-graph
      {:mat (plmb/fnk [rating-mat]
-             "swap nils for zeros - most things need the 0s, but repness needs the nils"
-             (time2 "mat"
-               (greedy
+             ; swap nils for zeros - most things need the 0s, but repness needs the nils"
+             (greedy
                (map (fn [row] (map #(if (nil? %) 0 %) row))
-                 (get-matrix rating-mat)))))
+                 (get-matrix rating-mat))))

       :pca (plmb/fnk [conv mat opts']
-             (time2 "pca"
-               (wrapped-pca mat (:n-comps opts')
-                            :start-vectors (get-in conv [:pca :comps])
-                            :iters (:pca-iters opts'))))
+             (wrapped-pca mat (:n-comps opts')
+                          :start-vectors (get-in conv [:pca :comps])
+                          :iters (:pca-iters opts')))

       :proj (plmb/fnk [mat pca]
-              (time2 "proj" (pca-project mat pca)))
+              (pca-project mat pca))

       :base-clusters
             (plmb/fnk [conv rating-mat proj in-conv opts']
-              (time2 "base-clusters"
-                (greedy
+              (greedy
                 (let [proj-mat
                         (named-matrix (rownames rating-mat) ["x" "y"] proj)
                       in-conv-mat (rowname-subset proj-mat in-conv)]
@@ -153,7 +143,7 @@
                     (kmeans in-conv-mat
                       (:base-k opts')
                       :last-clusters (:base-clusters conv)
-                      :cluster-iters (:base-iters opts')))))))
+                      :cluster-iters (:base-iters opts'))))))

       :base-clusters-proj
             (plmb/fnk [base-clusters]
@@ -161,8 +151,7 @@

       :bucket-dists
             (plmb/fnk [base-clusters-proj]
-              (time2 "bucket-dists"
-                (named-dist-matrix base-clusters-proj)))
+              (named-dist-matrix base-clusters-proj))

       ; Compute group-clusters for multiple k values
       :group-clusterings
@@ -173,7 +162,6 @@
                   (fn [k]
                     [k
                       (sort-by :id
-                        (time2 (str "group-clusters-k=" k)
                         (kmeans base-clusters-proj k
                           :last-clusters
                             ; A little pedantic here in case no clustering yet for this k
@@ -181,7 +169,7 @@
                               (if last-clusterings
                                 (last-clusterings k)
                                 last-clusterings))
-                          :cluster-iters (:group-iters opts'))))])
+                          :cluster-iters (:group-iters opts')))])
                   (range 2 (inc (max-k-fn base-clusters-proj (:max-k opts')))))))

       ; Compute silhouette values for the various clusterings
@@ -200,24 +188,21 @@
                 (max-key group-clusterings-silhouettes (keys group-clusterings))))

       :bid-to-pid (plmb/fnk [base-clusters]
-                     (time2 "bid-to-pid"
-                      (greedy
-                       (map :members (sort-by :id base-clusters)))))
+                    (greedy
+                      (map :members (sort-by :id base-clusters))))

       ;; returns {tid {
       ;;           :agree [0 4 2 0 6 0 0 1]
       ;;           :disagree [3 0 0 1 0 23 0 ]}
       ;; where the indices in the arrays are bids
       :votes-base (plmb/fnk [bid-to-pid rating-mat]
-                     (time2 "votes-base"
-                       (->> rating-mat
-                          colnames
-                          (map (fn [tid]
-                             {:tid tid
-                              :A (agg-bucket-votes-for-tid bid-to-pid rating-mat agree? tid)
-                              :D (agg-bucket-votes-for-tid bid-to-pid rating-mat disagree? tid)}))
-                          (reduce (fn [o entry] (assoc o (:tid entry) (dissoc entry :tid)))))))
-
+                    (->> rating-mat
+                      colnames
+                      (map (fn [tid]
+                        {:tid tid
+                         :A (agg-bucket-votes-for-tid bid-to-pid rating-mat agree? tid)
+                         :D (agg-bucket-votes-for-tid bid-to-pid rating-mat disagree? tid)}))
+                      (reduce (fn [o entry] (assoc o (:tid entry) (dissoc entry :tid))))))
      ; End of large-update
      }))

@@ -239,7 +224,7 @@
                                                        (dimension-count old-val 0)) 0))]
                   (+ (* forget-rate old-val) (* learning-rate new-val))))]
     (fn [pca']
-      "Actual updater lambda"
+      ; Actual updater lambda"
       {:center (learn (:center pca') (:center part-pca))
        :comps  (mapv #(learn %1 %2) (:comps pca') (:comps part-pca))})))

@@ -263,7 +248,6 @@
   "Same as small-conv-update-graph, but uses mini-batch PCA"
   (merge small-conv-update-graph
     {:pca (plmb/fnk [conv mat opts']
-            (time2 "mb-pca"
             (let [n-ptpts (matrix/dimension-count mat 0)
                   sample-size (sample-size n-ptpts)]
               (loop [pca (:pca conv) iter (:pca-iters opts')]
@@ -271,7 +255,7 @@
                       pca          ((partial-pca mat pca rand-indices) pca)]
                   (if (= iter 0)
                     (recur pca (dec iter))
-                    pca))))))}))
+                    pca)))))}))

 (def small-conv-update (graph/eager-compile small-conv-update-graph))


Further update-nmat cleanup; now implemented more cleanly as a reduce

--- src/polismath/named_matrix.clj
+++ src/polismath/named_matrix.clj
@@ -12,28 +12,23 @@

 (defn update-nmat [nmat values]
-  "This is a recursive function for taking new reactions and inserting them into the rating matrix."
-  ; be careful about first v last wrt spout order; want to make sure the last thing in overrides
-  ; anything earlier... If there are new reaactions, proceed
-  (if-let [[rown coln value] (first values)]
-    ; Long series of let assignments leading up to the recursive call
-    (let [{:keys [rows cols matrix]} nmat
-          [row-index col-index] (map
-                                   #(.indexOf %1 %2)
-                                   [rows cols] [rown coln])
-          [rows cols] (map (fn [xs x i] (if (= -1 i) (conj xs x) xs))
-                            [rows cols] [rown coln] [row-index col-index])
-          ; If necessary, insert new columns and/or rows of zeros
-          matrix (if (= -1 col-index) (mapv #(conj % 0) matrix) matrix)
-          matrix (if (> (count rows) (count matrix)) (conj matrix (into [] (repeat (count cols) 0))) matrix)
-          ; Get the indices of the matrix position to be updated (note that .indexOf above gives
-          ; us -1 if the item is not in the collection)
-          indices (mapv (fn [xs i] (if (= -1 i) (- (count xs) 1) i))
-                        [rows cols] [row-index col-index])
-          matrix (assoc-in matrix indices value)]
-      (recur (assoc nmat :rows rows :cols cols :matrix matrix) (rest values)))
-    ; else nothing to add; return matrix as is
-    nmat))
+  "This takes (rowname, colname, value) pairs and inserts them into a named matrix, adding rows and columns
+  if necessary."
+  (reduce
+    (fn [{:keys [rows cols matrix] :as nmat} [row col value]]
+      (let [[row-index col-index] (map #(.indexOf %1 %2) [rows cols] [row col])
+            [rows cols] (map (fn [xs x i] (if (= -1 i) (conj xs x) xs))
+                          [rows cols] [row col] [row-index col-index])
+            ; If necessary, insert new columns and/or rows of zeros
+            matrix (if (= -1 col-index) (mapv #(conj % 0) matrix) matrix)
+            matrix (if (> (count rows) (count matrix)) (conj matrix (into [] (repeat (count cols) 0))) matrix)
+            ; Get the indices of the matrix position to be updated (note that .indexOf above gives
+            ; us -1 if the item is not in the collection)
+            indices (mapv (fn [xs i] (if (= -1 i) (- (count xs) 1) i))
+                          [rows cols] [row-index col-index])
+            matrix (assoc-in matrix indices value)]
+      (assoc nmat :rows rows :cols cols :matrix matrix)))
+    nmat values))

 (defn row-subset [nmat row-indices]


formatting

formatting

--- src/com/zensol/cisql/process_query.clj
+++ src/com/zensol/cisql/process_query.clj
@@ -46,23 +46,23 @@
                 (reset! lines-left 0)
                 (reset! directive dir))]
         (while (> @lines-left 0)
-   (log/tracef "lines left: %d" @lines-left)
-   (let [user-input (.readLine *std-in*)]
-     (log/debugf "line: %s" user-input)
-     (if-not user-input
-       (do
-         (log/debugf "read EOF from input")
-         (end :end-file))
-       (let [dir (add-line user-input)]
-         (log/tracef "dir: %s" dir)
-         (log/tracef "query so far: %s" *query*)
-         (case dir
-           :end-query (end dir)
-           :end-session (end dir)
-           :continue (log/tracef "continue...")
-           :default (throw (IllegalStateException.
-                            (str "unknown directive: " dir)))))))
-   (swap! lines-left dec)))
+          (log/tracef "lines left: %d" @lines-left)
+          (let [user-input (.readLine *std-in*)]
+            (log/debugf "line: %s" user-input)
+            (if-not user-input
+              (do
+                (log/debugf "read EOF from input")
+                (end :end-file))
+              (let [dir (add-line user-input)]
+                (log/tracef "dir: %s" dir)
+                (log/tracef "query so far: %s" *query*)
+                (case dir
+                  :end-query (end dir)
+                  :end-session (end dir)
+                  :continue (log/tracef "continue...")
+                  :default (throw (IllegalStateException.
+                                   (str "unknown directive: " dir)))))))
+          (swap! lines-left dec)))
       {:query (str/trim (.toString *query*))
        :directive @directive})))


use refs for db connections

use refs for db connections

--- src/polismath/poller.clj
+++ src/polismath/poller.clj
@@ -67,12 +67,14 @@
                (encode-seq (into-array v) jsonGenerator)))

-(def poll-interval 1000)
-(def pg-spec         (heroku-db-spec (env/env :database-url)))
-(def mg-db           (mongo-connect! (env/env :mongo-url)))
+(def poll-interval   1000)
+(def pg-spec         (ref nil))
+(def mg-db           (ref nil))
 (def last-timestamp  (atom 0))
 (def conversations   (atom {})) ; generated artifacts
 (def pending-votes   (ref {})) ; zid -> votes
+
+

 (def dinner-bell (Object.))
 (def active-zids (ref #{}))
@@ -188,6 +190,10 @@
 (defn -main []
   (println "launching poller " (System/currentTimeMillis))

+  (dosync
+   (ref-set pg-spec  (heroku-db-spec (env/env :database-url)))
+   (ref-set mg-db (mongo-connect! (env/env :mongo-url))))
+
   (let [threads (map #(Thread. %1)
                      (map make-worker-thread
                           (range 4)))]
@@ -197,9 +203,10 @@

   (endlessly poll-interval
       (println "poll >" @last-timestamp)
-      (let [new-votes (poll pg-spec @last-timestamp)
+      (let [new-votes (poll @pg-spec @last-timestamp)
             zid-to-votes (group-by :zid new-votes)
             zid-votes (into [] zid-to-votes)
+
             ]
         (if (> (count zid-votes) 0)
           (do


Refactored: use the @ reader macro instead of deref

--- src/rpi_challenger/controller.clj
+++ src/rpi_challenger/controller.clj
@@ -19,11 +19,11 @@

 (defn get-participants
   []
-  (t/participants (deref tournament)))
+  (t/participants @tournament))

 (defn get-participant-by-id
   [id]
-  (t/participant-by-id (deref tournament) id))
+  (t/participant-by-id @tournament id))

 (defn nil-or-str
   [object]
@@ -56,7 +56,7 @@
     (alter tournament t/record-strike participant (s/make-strike response challenge)))
   ; TODO: load state on restart
   ; TODO: save state less often
-  (io/object-to-file "rpi-challenger-state.clj" (deref tournament)))
+  (io/object-to-file "rpi-challenger-state.clj" @tournament))

 (defn poll-participant
   [participant challenges]


fixed typo in regular expression for clojush->klapaucius

--- src/push/util/legacy.clj
+++ src/push/util/legacy.clj
@@ -533,7 +533,7 @@
 (defn translate-item
   [item]
   (cond
-    (and (symbol? item) (re-seq #"^in\d" (str item)))
+    (and (symbol? item) (re-seq #"^in\d+" (str item)))
       (translate-input item)
     (symbol? item)
       (translate-instruction item)


assembly corrected for combination of operation and 0

--- src/selectscript/disassembler.clj
+++ src/selectscript/disassembler.clj
@@ -54,7 +54,9 @@
                         [(dis:key (+ 128 (first prog))) true]
                         [(dis:key (first prog)) false])]
     (print (format "/*%04d*/" addr))
-    (if (keyword? op_code)
+    (if (and (keyword? op_code)
+             (not (= :OP op_code))
+             (not (= :OPX op_code)))
       (print (clojure.string/join (repeat space "           "))
              (format "%-11s" (str (name op_code) (if pop "|P," ","))))
       (print (clojure.string/join (repeat space "           "))))
@@ -154,16 +156,21 @@
                       (let [[c a _] (dis:prog (nthrest code 3) (+ 3 addr) [] (inc space))]
                         (println "//////////////////////////////////////////////////////////")
                         (dis:prog c a data space)))
-      (if (not (keyword? op_code))
-        (do
-          (if (<= (:OPX OP) op_code)
+      (if (or (not (keyword? op_code))
+              (= :OP op_code)
+              (= :OPX op_code))
+        (let [op_code2 (case op_code
+                         :OP  (:OP OP)
+                         :OPX (:OPX OP)
+                         op_code)]
+          (if (<= (:OPX OP) op_code2)
             (println (format " OPX|%s%-4s %d, // params: %d"
-                             (name (dis:key (- op_code (:OPX OP)) op))
+                             (name (dis:key (- op_code2 (:OPX OP)) op))
                              (if pop "|P," ",")
                              (first code)
-                             (inc (byte->uint8 (first  code)))))
+                             (inc (byte->uint8 (first code)))))
             (println (format " OP|%s%-4s %d, // params: %d"
-                             (name (dis:key (- op_code (:OP OP)) op))
+                             (name (dis:key (- op_code2 (:OP OP)) op))
                              (if pop "|P," ",")
                              (first code)
                              (inc (byte->uint8 (first  code))))))


[#92] Useful error when there is no multimethod

--- priv/clojure/core.clj
+++ priv/clojure/core.clj
@@ -1662,6 +1662,10 @@
              [& args#]
              (let [val# (apply ~dispatch-fn args#)
                    f#    (clojerl.MultiFn/get_method.e ~(name mm-name) val# ~default ~hierarchy)]
+               (when (nil? f#)
+                 (throw (str "No multimethod defined for dispatch value " val#
+                             " in " '~mm-name
+                             )))
                (apply f# args#))))))))

 (defmacro defmethod


[#218] Remove unused :inline and :inline-arities metadata

--- priv/clojure/core.clj
+++ priv/clojure/core.clj
@@ -687,9 +687,7 @@

 (defn identical?
   "Tests if 2 arguments are the same object"
-  {:inline '(fn [x y] `(erlang/=:=.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x y] (erlang/=:=.e x y)))

 ;equiv-based
@@ -699,9 +697,7 @@
   numbers and collections in a type-independent manner.  Clojure's immutable data
   structures define equals() (and thus =) as a value, not an identity,
   comparison."
-  {:inline '(fn [x y] `(clj_core/equiv.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (clj_core/equiv.e x y))
   ([x y & more]
@@ -744,9 +740,7 @@
   y. Same as Java x.compareTo(y) except it also works for nil, and
   compares numbers and collections in a type-independent manner. x
   must implement Comparable"
-  {
-   :inline '(fn [x y] `(. clojure.lang.Util compare ~x ~y))
-   :added "1.0"}
+  {:added "1.0"}
   [x y]
   (clj_utils/compare.e x y))

@@ -777,21 +771,18 @@
 ;;;;;;;;;;;;;;;;;;; sequence fns  ;;;;;;;;;;;;;;;;;;;;;;;
 (defn zero?
   "Returns true if num is zero, else false"
-  {:inline '(fn [x] `(erlang/==.e ~x 0))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (erlang/==.e x 0))

 (defn count
   "Returns the number of items in the collection. (count nil) returns
   0.  Also works on strings, arrays, and Java Collections and Maps"
-  {:inline '(fn  [x] `(clj_core/count.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [coll] (clj_core/count.e coll))

 (defn int
   "Coerce to int"
-  {:inline '(fn  [x] `(erlang/trunc.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (erlang/trunc.e x))

 (defn nth
@@ -799,18 +790,14 @@
   bounds, nth throws an exception unless not-found is supplied.  nth
   also works for strings, Java arrays, regex Matchers and Lists, and,
   in O(n) time, for sequences."
-  {:inline '(fn  [c i & nf] `(clj_core/nth.e ~c ~i ~@nf))
-   :inline-arities #{2 3}
-   :added "1.0"}
+  {:added "1.0"}
   ([coll index] (clj_core/nth.e coll index))
   ([coll index not-found] (clj_core/nth.e coll index not-found)))

 (defn <
   "Returns non-nil if nums are in monotonically increasing order,
   otherwise false."
-  {:inline '(fn [x y] `(erlang/<.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (erlang/<.e x y))
   ([x y & more]
@@ -823,15 +810,13 @@
 (defn inc'
   "Returns a number one greater than num. Supports arbitrary precision.
   See also: inc"
-  {:inline '(fn [x] `(erlang/+.e ~x 1))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (erlang/+.e x 1))

 (defn inc
   "Returns a number one greater than num. Does not auto-promote
   longs, will throw on overflow. See also: inc'"
-  {:inline '(fn [x] `(inc' ~x))
-   :added "1.2"}
+  {:added "1.2"}
   [x] (inc' x))

 ;; reduce is defined again later after InternalReduce loads
@@ -854,26 +839,10 @@
   [coll]
   (reduce1 conj '() coll))

-;;math stuff
-(defn ^:private nary-inline
-  ([op]
-   (fn
-     ([x] `(~op ~x))
-     ([x y] `(~op ~x ~y))
-     ([x y & more]
-      (reduce1
-         (fn [a b] `(~op ~a ~b))
-         `(~op ~x ~y)) more))))
-
-(defn ^:private >1? [n] (erlang/>.e n 1))
-(defn ^:private >0? [n] (erlang/>.e n 0))
-
 (defn +'
   "Returns the sum of nums. (+) returns 0. Supports arbitrary precision.
   See also: +"
-  {:inline '(nary-inline 'erlang/+.e)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([] 0)
   ([x] x)
   ([x y] (erlang/+.e x y))
@@ -883,9 +852,7 @@
 (defn +
   "Returns the sum of nums. (+) returns 0. Does not auto-promote
   longs, will throw on overflow. See also: +'"
-  {:inline '(nary-inline 'add)
-   :inline-arities '>1?
-   :added "1.2"}
+  {:added "1.2"}
   ([] 0)
   ([x] x)
   ([x y] (erlang/+.e x y))
@@ -895,9 +862,7 @@
 (defn *'
   "Returns the product of nums. (*) returns 1. Supports arbitrary precision.
   See also: *"
-  {:inline '(nary-inline 'erlang/*.e)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([] 1)
   ([x] x)
   ([x y] (erlang/*.e x y))
@@ -907,9 +872,7 @@
 (defn *
   "Returns the product of nums. (*) returns 1. Does not auto-promote
   longs, will throw on overflow. See also: *'"
-  {:inline '(nary-inline 'multiply)
-   :inline-arities '>1?
-   :added "1.2"}
+  {:added "1.2"}
   ([] 1)
   ([x] x)
   ([x y] (*' x y))
@@ -919,9 +882,7 @@
 (defn /
   "If no denominators are supplied, returns 1/numerator,
   else returns numerator divided by all of the denominators."
-  {:inline '(nary-inline 'divide)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([x] (/ 1 x))
   ([x y] (erlang//.e x y))
   ([x y & more]
@@ -931,9 +892,7 @@
   "If no ys are supplied, returns the negation of x, else subtracts
   the ys from x and returns the result. Supports arbitrary precision.
   See also: -"
-  {:inline '(nary-inline 'erlang/-.e)
-   :inline-arities '>0?
-   :added "1.0"}
+  {:added "1.0"}
   ([x] (erlang/-.e x))
   ([x y] (erlang/-.e x y))
   ([x y & more]
@@ -943,9 +902,7 @@
   "If no ys are supplied, returns the negation of x, else subtracts
   the ys from x and returns the result. Does not auto-promote
   longs, will throw on overflow. See also: -'"
-  {:inline '(nary-inline 'minus)
-   :inline-arities '>0?
-   :added "1.2"}
+  {:added "1.2"}
   ([x] (-' x))
   ([x y] (-' x y))
   ([x y & more]
@@ -954,9 +911,7 @@
 (defn <=
   "Returns non-nil if nums are in monotonically non-decreasing order,
   otherwise false."
-  {:inline '(fn [x y] `(erlang/=<.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (erlang/=<.e x y))
   ([x y & more]
@@ -969,9 +924,7 @@
 (defn >
   "Returns non-nil if nums are in monotonically decreasing order,
   otherwise false."
-  {:inline '(fn [x y] `(erlang/>.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (erlang/>.e x y))
   ([x y & more]
@@ -984,9 +937,7 @@
 (defn >=
   "Returns non-nil if nums are in monotonically non-increasing order,
   otherwise false."
-  {:inline '(fn [x y] `(erlang/>=.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (erlang/>=.e x y))
   ([x y & more]
@@ -999,9 +950,7 @@
 (defn ==
   "Returns non-nil if nums all have the equivalent
   value (type-independent), otherwise false"
-  {:inline '(fn [x y] `(erlang/==.e ~x ~y))
-   :inline-arities #{2}
-   :added "1.0"}
+  {:added "1.0"}
   ([x] true)
   ([x y] (erlang/==.e x y))
   ([x y & more]
@@ -1013,9 +962,7 @@

 (defn max
   "Returns the greatest of the nums."
-  {:added "1.0"
-   :inline-arities '>1?
-   :inline '(nary-inline 'max)}
+  {:added "1.0"}
   ([x] x)
   ([x y] (if (< x y) y x))
   ([x y & more]
@@ -1023,9 +970,7 @@

 (defn min
   "Returns the least of the nums."
-  {:added "1.0"
-   :inline-arities '>1?
-   :inline '(nary-inline 'min)}
+  {:added "1.0"}
   ([x] x)
   ([x y] (if (> x y) y x))
   ([x y & more]
@@ -1034,40 +979,34 @@
 (defn dec'
   "Returns a number one less than num. Supports arbitrary precision.
   See also: dec"
-  {:inline '(fn [x] `(erlang/-.e ~x 1))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (erlang/-.e x 1))

 (defn dec
   "Returns a number one less than num. Does not auto-promote
   longs, will throw on overflow. See also: dec'"
-  {:inline '(fn [x] `(erlang/-.e ~x 1))
-   :added "1.2"}
+  {:added "1.2"}
   [x] (erlang/-.e x 1))

 (defn pos?
   "Returns true if num is greater than zero, else false"
-  {:inline '(fn [x] `(> ~x 0))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (> x 0))

 (defn neg?
   "Returns true if num is less than zero, else false"
-  {:inline '(fn [x] `(< ~x 0))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (< x 0))

 (defn quot
   "quot[ient] of dividing numerator by denominator."
-  {:added "1.0"
-   :inline '(fn [x y] `(erlang/trunc.e (/ ~x ~y)))}
+  {:added "1.0"}
   [num div]
   (erlang/trunc.e (/ num div)))

 (defn rem
   "remainder of dividing numerator by denominator."
-  {:added "1.0"
-   :inline '(fn [x y] `(erlang/rem.e ~x ~y))}
+  {:added "1.0"}
   [num div]
   (erlang/rem.e num div))

@@ -1075,43 +1014,34 @@

 (defn bit-not
   "Bitwise complement"
-  {:inline '(fn [x] `(erlang/bnot.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (erlang/bnot.e x))

 (defn bit-and
   "Bitwise and"
-   {:inline '(nary-inline 'and)
-    :inline-arities '>1?
-    :added "1.0"}
+   {:added "1.0"}
    ([x y] (erlang/band.e x y))
    ([x y & more]
       (reduce1 bit-and (bit-and x y) more)))

 (defn bit-or
   "Bitwise or"
-  {:inline '(nary-inline 'or)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([x y] (erlang/bor.e x y))
   ([x y & more]
     (reduce1 bit-or (bit-or x y) more)))

 (defn bit-xor
   "Bitwise exclusive or"
-  {:inline '(nary-inline 'xor)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([x y] (erlang/bxor.e x y))
   ([x y & more]
     (reduce1 bit-xor (bit-xor x y) more)))

 (defn bit-and-not
   "Bitwise and with complement"
-  {:inline '(nary-inline 'andNot)
-   :inline-arities '>1?
-   :added "1.0"}
+  {:added "1.0"}
   ([x y] (bit-not (bit-and x y)))
   ([x y & more]
     (reduce1 bit-and-not (bit-and-not x y) more)))
@@ -1144,20 +1074,17 @@

 (defn bit-shift-left
   "Bitwise shift left"
-  {:inline '(fn [x n] `(erlang/bsl.e ~x ~n))
-   :added "1.0"}
+  {:added "1.0"}
   [x n] (erlang/bsl.e x n))

 (defn bit-shift-right
   "Bitwise shift right"
-  {:inline '(fn [x n] `(erlang/bsr.e ~x ~n))
-   :added "1.0"}
+  {:added "1.0"}
   [x n] (erlang/bsr.e x n))

 (defn unsigned-bit-shift-right
   "Bitwise shift right, without sign-extension."
-  {:inline '(fn [x n] `(erlang/bsr.e ~x ~n))
-   :added "1.6"}
+  {:added "1.6"}
   [x n]
   (throw "unsupported unsigned operation"))

@@ -1239,9 +1166,7 @@

 (defn get
   "Returns the value mapped to key, not-found or nil if key not present."
-  {:inline '(fn  [m k & nf] `(clj_core/get.e ~m ~k ~@nf))
-   :inline-arities #{2 3}
-   :added "1.0"}
+  {:added "1.0"}
   ([map key]
    (clj_core/get.e map key))
   ([map key not-found]
@@ -2522,9 +2447,7 @@

 (defn reduced?
   "Returns true if x is the result of a call to reduced"
-  {:inline '(fn [x] `(clj_core/is_reduced.e ~x ))
-   :inline-arities #{1}
-   :added "1.5"}
+  {:added "1.5"}
   [x]
   (clojerl.Reduced/is_reduced.e x))

@@ -3123,7 +3046,6 @@
 (defn num
   "Coerce to Number"
   {:tag clojerl.Integer
-   :inline '(fn  [x] `(if (erlang/is_number.e x) x (throw "Not a number")))
    :added "1.0"}
   [x]
   (if (erlang/is_number.e x)
@@ -3132,50 +3054,43 @@

 (defn long
   "Coerce to long"
-  {:inline '(fn  [x] `(erlang/trunc.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [x]
   (erlang/trunc.e x))

 (defn float
   "Coerce to float"
-  {:inline '(fn  [x] `(erlang/float.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [x]
   (erlang/float.e x))

 (defn double
   "Coerce to double"
-  {:inline '(fn  [x] `(erlang/float.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [^Number x]
   (erlang/float.e x))

 (defn short
   "Coerce to short"
-  {:inline '(fn  [x] `(clj_core/short.e x))
-   :added "1.0"}
+  {:added "1.0"}
   [^Number x]
   (clj_core/short.e x))

 (defn byte
   "Coerce to byte"
-  {:inline '(fn  [x] `(clj_core/byte.e x))
-   :added "1.0"}
+  {:added "1.0"}
   [^Number x]
   (clj_core/byte.e x))

 (defn char
   "Coerce to char"
-  {:inline '(fn  [x] `(clj_core/to_char.e x))
-   :added "1.1"}
+  {:added "1.1"}
   [x]
   (clj_core/char.e x))

 (defn boolean
   "Coerce to boolean"
-  {:inline '(fn  [x] `(clj_core/boolean.e ~x))
-   :added "1.0"}
+  {:added "1.0"}
   [x] (clj_core/boolean.e x))

 (defn number?


bumps version to 1.8.4-SNAPSHOT

bumps version to 1.8.4-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.8.3"
+(defproject cook "1.8.4-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


fix stack overflow

fix stack overflow

--- src/shuppet/campfire.clj
+++ src/shuppet/campfire.clj
@@ -42,4 +42,4 @@
                               (error-messages m))))
                     error-rooms))))
   ([m]
-     (error *error-rooms*)))
+     (error m *error-rooms*)))


Snooker

Snooker

--- src/skidskytte/namer.clj
+++ src/skidskytte/namer.clj
@@ -155,6 +155,7 @@
                 "styrkelyft"
                 "störtlopp"
                 "snowboard"
+                "snooker"
                 "sumobrottning"
                 "tennis"
                 "tjurfäktning"


Fix copyright year on sign tests.

Fix copyright year on sign tests.

--- test/buddy/test_buddy_sign.clj
+++ test/buddy/test_buddy_sign.clj
@@ -1,4 +1,4 @@
-;; Copyright 2014 Andrey Antukh <niwi@niwi.be>
+;; Copyright 2014-2015 Andrey Antukh <niwi@niwi.be>
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License")
 ;; you may not use this file except in compliance with the License.


Add test to ensure that future value is not reassigned

--- test/clojure/patterns_test.clj
+++ test/clojure/patterns_test.clj
@@ -92,5 +92,16 @@
                                                 :service3 action-fn}
                                                Long/MAX_VALUE)))
       (.countDown action-blocking-latch)
-      (.await test-blocking-latch 1000 TimeUnit/MILLISECONDS)
-      (is (= 2 @counter)))))
+      (.await test-blocking-latch)
+      (is (= 2 @counter)))
+    (testing "Result is from the the first services to response"
+      (reset! counter 0)
+      (let [f (patterns/submit-shotgun-actions shotgun
+                                               {:service1 action-fn
+                                                :service2 action-fn
+                                                :service3 action-fn}
+                                               Long/MAX_VALUE)]
+        @f
+        (.countDown action-blocking-latch)
+        (.await test-blocking-latch)
+        (is (= 1 @f))))))


Revert "put entire project.clj in loader-info"

This reverts commit 648e03fd592df0b44d62e5adb1be0900095e4d9c.

--- src/tailrecursion/boot/loader.clj
+++ src/tailrecursion/boot/loader.clj
@@ -19,8 +19,11 @@
 (defn info
   "Returns a map of version information for tailrecursion.boot.loader"
   []
-  (let [[_ & kvs] (guard (read-string (slurp (io/resource "project.clj"))))]
-    (->> kvs (partition 2) (map (partial apply vector)) (into {}))))
+  (let [[_ proj vers & kvs] (guard (read-string (slurp (io/resource "project.clj"))))
+        {:keys [description url license]} (->> (partition 2 kvs)
+                                               (map (partial apply vector))
+                                               (into {}))]
+    {:proj proj :vers vers :description description :url url :license license}))

 (defn index-of [v val]
   (ffirst (filter (comp #{val} second) (map vector (range) v))))


CMR-3284 addresses pr comment

CMR-3284 addresses pr comment

--- 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
@@ -79,7 +79,7 @@
         stop-date (if (= concept-type :granule)
                     (umm-lib-time/end-date :granule (:temporal parsed-metadata))
                     (spec-time/collection-end-date parsed-metadata))
-        stop-date (if (or (= :present stop-date) (not stop-date))
+        stop-date (if (or (= :present stop-date) (nil? stop-date))
                     (t/now)
                     stop-date)]
     (gc/and


Read scores from 'teams' field instead of calculating from 'scoringPlays'

Once in a full moon, the 'scoringPlays' field seems to remain empty for a
long time even when goals have been scored. Read the team scores from the
'teams' field which hopefully updates more reliably. This also makes it
possible to detect discrepancies between the scores and goals.

The scores could also be read from the 'linescore' field but that field is
missing from older test data files, and it would be quite a bit of work to
retrieve it realistically.

(Hopefully, partially) solves #3.

--- src/nhl_score_api/fetchers/nhlstats/game_scores.clj
+++ src/nhl_score_api/fetchers/nhlstats/game_scores.clj
@@ -141,16 +141,12 @@
        (add-overtime-flag goals)
        (add-shootout-flag goals)))

-(defn- filter-team-goals [awayOrHomeKey goals team-details]
-  (let [team-id (:id (awayOrHomeKey team-details))]
-    (filter #(= team-id (:id (:team %))) goals)))
-
 (defn- parse-scores [api-game team-details]
   (let [goals (:scoring-plays api-game)
-        away-goals (filter-team-goals :away goals team-details)
-        home-goals (filter-team-goals :home goals team-details)
-        team-goal-counts {(:abbreviation (:away team-details)) (count away-goals)
-                          (:abbreviation (:home team-details)) (count home-goals)}]
+        away-goals (get-in api-game [:teams :away :score])
+        home-goals (get-in api-game [:teams :home :score])
+        team-goal-counts {(:abbreviation (:away team-details)) away-goals
+                          (:abbreviation (:home team-details)) home-goals}]
     (add-score-flags team-goal-counts goals)))

 (defn- parse-team-details [awayOrHomeKey api-game]


fillRect appears to be same speed as delayed

--- src/sierpinski_sieve/core.cljs
+++ src/sierpinski_sieve/core.cljs
@@ -25,7 +25,7 @@
   (doseq [[x value] (map-indexed vector row)]
     (let [disp-x (+ (* (- size y) 0.5) x)]
       (if (odd? value)
-        (.rect ctx disp-x y 1 1)))))
+        (.fillRect ctx disp-x y 1 1)))))

 (defn paint [canvas-id size sieve]
   (when-let [canvas-element (. js/document getElementById canvas-id)]
@@ -35,8 +35,7 @@
         (.fillRect ctx 0 0 size size)
         (set! (.-fillStyle ctx) "white")
         (doseq [[y row] (reverse (map-indexed vector sieve))]
-          (paint-row ctx y row size))
-        (.fill ctx)))))
+          (paint-row ctx y row size))))))

 (defn render-canvas [size]
   (fn []


More key errors

More key errors

--- src/squelch/audio_context.cljs
+++ src/squelch/audio_context.cljs
@@ -26,7 +26,7 @@
   Returns an AudioDestinationNode representing the final destination of all
   audio in the context. It can be thought of as the audio-rendering device."
   [ctx]
-  (.-currentTime ctx))
+  (.-destination ctx))

 (defn get-listener
   "Read only.


WIP - Evolution du bot CSB en Clojure avec l'objectif d'améliorer le classement en ligue argent

--- clojure/codingame/competition/coders-strike-back/src/coders_strike_back/Player.clj
+++ clojure/codingame/competition/coders-strike-back/src/coders_strike_back/Player.clj
@@ -1,7 +1,7 @@
 (ns Player
   (:gen-class))

-(def checkpoint-core-size 300)
+(def checkpoint-core-size 200)
 (def delay-between-shield-use 10)
 (def min-distance-to-activate-shield 950)

@@ -38,8 +38,8 @@
   (let [d (distance x1 y1 x2 y2) dx (/ (- x2 x1) d) dy (/ (- y2 y1) d) angle (convert-radian-to-degree (Math/acos dx))]
     (if (< dy 0) (- 360.0 angle) angle)))

-(defn adjustement-from-angle [value next-checkpoint-angle]
-  (+ value (* checkpoint-core-size (convert-to-int (Math/signum (Math/cos next-checkpoint-angle))))))
+(defn adjustment-from-angle [next-checkpoint-angle]
+  (* checkpoint-core-size (convert-to-int (Math/signum (Math/cos next-checkpoint-angle)))))

 (defn compute-x-y [x y next-checkpoint-x next-checkpoint-y next-checkpoint-angle next-checkpoint-distance]
@@ -48,6 +48,10 @@
     (and (> x next-checkpoint-x) (< y next-checkpoint-y)) (str (+ next-checkpoint-x checkpoint-core-size) " " (- next-checkpoint-y checkpoint-core-size))
     (and (> x next-checkpoint-x) (> y next-checkpoint-y)) (str (+ next-checkpoint-x checkpoint-core-size) " " (+ next-checkpoint-y checkpoint-core-size))
     (and (< x next-checkpoint-x) (> y next-checkpoint-y)) (str (- next-checkpoint-x checkpoint-core-size) " " (+ next-checkpoint-y checkpoint-core-size))
+    ;(and (< x next-checkpoint-x) (< y next-checkpoint-y)) (str (- next-checkpoint-x (adjustment-from-angle next-checkpoint-angle)) " " (- next-checkpoint-y (adjustment-from-angle next-checkpoint-angle)))
+    ;(and (> x next-checkpoint-x) (< y next-checkpoint-y)) (str (+ next-checkpoint-x (adjustment-from-angle next-checkpoint-angle)) " " (- next-checkpoint-y (adjustment-from-angle next-checkpoint-angle)))
+    ;(and (> x next-checkpoint-x) (> y next-checkpoint-y)) (str (+ next-checkpoint-x (adjustment-from-angle next-checkpoint-angle)) " " (+ next-checkpoint-y (adjustment-from-angle next-checkpoint-angle)))
+    ;(and (< x next-checkpoint-x) (> y next-checkpoint-y)) (str (- next-checkpoint-x (adjustment-from-angle next-checkpoint-angle)) " " (+ next-checkpoint-y (adjustment-from-angle next-checkpoint-angle)))
     true (str next-checkpoint-x " " next-checkpoint-y)))

 (defn compute-boost-from-angle [next-checkpoint-angle]
@@ -57,7 +61,7 @@
 (defn compute-boost [next-checkpoint-distance next-checkpoint-angle]
   (cond
     (<= next-checkpoint-distance 1000) "40"
-    (<= (Math/abs next-checkpoint-angle) 36) "100"
+    (<= (Math/abs next-checkpoint-angle) 18) "100"
     true (compute-boost-from-angle (Math/abs next-checkpoint-angle))))

 (defn use-boost? [next-checkpoint-distance next-checkpoint-angle boost-used? game-loop-counter last-shield-usage last-boost-value]


Utility conversion functions

Utility conversion functions

--- src/test_utils/core.cljc
+++ src/test_utils/core.cljc
@@ -1,6 +1,7 @@
 (ns test-utils.core
   (:require [clojure.string :as cljstr]
-            [kixi.stats.distribution :as ksd]))
+            [kixi.stats.distribution :as ksd])
+  (:import (java.time Duration LocalDateTime LocalTime)))

 #?(:cljs (enable-console-print!))

@@ -114,3 +115,12 @@
         minutes (quot (rem total-seconds 3600) 60)
         seconds (rem (rem total-seconds 3600) 60)]
     [hours minutes seconds]))
+
+(defn timestamp->java-time [time-stamp]
+  "Converts a timestamp to a `java.time.LocalDateTime`."
+  (apply #(LocalDateTime %1 %2 %3 %4 %5 %6) time-stamp))
+
+(defn java-time->timestamp [java-time]
+  "Converts a `java.time.LocalDateTime` to a timestamp."
+  (juxt [#(.getYear %) #(.getMonthValue %) #(.getDayOfMonth %)
+         #(.getHour %) #(.getMinute %) #(.getSecond %)] java-time))


Whoops

Whoops

--- src/tools/figwheel_middleware.clj
+++ src/tools/figwheel_middleware.clj
@@ -8,4 +8,4 @@

 (def app
   ;; static resources in resources/public
-  ; (wrap-resource "public"))
+  (wrap-resource handler "public"))


Fix alphabet sorting

Fix alphabet sorting

--- src/teach_by_friends/subs.cljs
+++ src/teach_by_friends/subs.cljs
@@ -14,13 +14,12 @@
 (defmethod chapter-word-list :by-alphabet
   [_ chapter]
   (->> chapter
-       (keys)
-       (sort-by identity)))
+       (map (fn [[key [first-val]]] {:term key :sentence (:sentence first-val)}))
+       (sort-by :term)))

 (defmethod chapter-word-list :default
   [_ chapter]
-  (->> chapter
-       (keys)))
+  (chapter-word-list :by-rank chapter))

 (defn ms-to-mm:ss [ms]
   (let [minutes (js/Math.floor (/ ms 60000))


added a few 'winning' scripts; revised println at end of design spike in gp.clj

--- test/simple_symbolic_regression_clojure/gp_test.clj
+++ test/simple_symbolic_regression_clojure/gp_test.clj
@@ -208,13 +208,13 @@

 (def sine-rubrics
-  (repeatedly 10
+  (repeatedly 32
     #(let [x (rand (* 2 Math/PI))]
       (->Rubric {:x x} (Math/sin x)))))

 (fact "sine-rubrics contain the numerical values I imagine they should"
-  (count sine-rubrics) => 10
+  (count sine-rubrics) => 32
   (map #(Math/sin (get-in % [:input :x])) sine-rubrics) => (map :output sine-rubrics))

@@ -290,6 +290,6 @@
   (iterate #(one-seasonal-cycle % mutation-rate rubrics) initial-pop))

-(println (first (sort-by
-            :score
-            (nth (future-history initial-sine-population 0.05 sine-rubrics) 10))))
+(println (map
+          winners
+          (take 10 (future-history initial-sine-population 0.05 sine-rubrics))))


Fix up indentation in kairosdb test

Fix up indentation in kairosdb test

--- test/riemann/kairosdb_test.clj
+++ test/riemann/kairosdb_test.clj
@@ -7,24 +7,25 @@
 (logging/init)

 (deftest ^:kairosdb ^:integration kairosdb-test
-         (let [k (kairosdb {:block-start true})]
-           (k {:host "riemann.local"
-               :service "kairosdb test"
-               :state "ok"
-               :description "all clear, uh, situation normal"
-               :metric -2
-               :time (unix-time)}))
+  (let [k (kairosdb {:block-start true})]
+    (k {:host "riemann.local"
+        :service "kairosdb test"
+        :state "ok"
+        :description "all clear, uh, situation normal"
+        :metric -2
+        :time (unix-time)}))

-         (let [k (kairosdb {:block-start true})]
-           (k {:service "kairosdb test"
-               :state "ok"
-               :description "all clear, uh, situation normal"
-               :metric 3.14159
-               :time (unix-time)}))
+  (let [k (kairosdb {:block-start true})]
+    (k {:service "kairosdb test"
+        :state "ok"
+        :description "all clear, uh, situation normal"
+        :metric 3.14159
+        :time (unix-time)}))

-         (let [k (kairosdb {:block-start true})]
-           (k {:host "no-service.riemann.local"
-               :state "ok"
-               :description "Missing service, not transmitted"
-               :metric 4
-               :time (unix-time)})))
+  (let [k (kairosdb {:block-start true})]
+    (k {:host "no-service.riemann.local"
+        :state "ok"
+        :description "Missing service, not transmitted"
+        :metric 4
+        :time (unix-time)})))
+


implement join queries for more than 2 patterns

--- src/thi/ng/fabric/triples.cljc
+++ src/thi/ng/fabric/triples.cljc
@@ -132,7 +132,7 @@
                            (fn [r] (not= (r 1) (r 2))))
     :else                (constantly true)))

-(defn param-query
+(defn add-param-query!
   [g id [s p o]]
   (let [vs?        (qvar? s), vp? (qvar? p), vo? (qvar? o)
         vmap       (bind-translator vs? vp? vo? s p o)
@@ -154,7 +154,7 @@
 (defn score-collect-join
   [vertex] (if (== (count (::f/signal-map @(:state vertex))) 2) 1 0))

-(defn add-join
+(defn add-join!
   [g qa qb]
   (let [jv (f/add-vertex!
             g {:val (delay nil)
@@ -163,19 +163,24 @@
                  (let [state (:state vertex)
                        a @(get-in @state [::f/signal-map (:id (:qvar-result qa))])
                        b @(get-in @state [::f/signal-map (:id (:qvar-result qb))])]
-                   ;;(info :join-sets a b)
+                   (info :join-sets a b)
                    (swap! state assoc :val (delay (set/join a b)))))
                ::f/score-collect-fn
                score-collect-join})]
+    (info :add-join jv :a qa :b qb)
     (f/add-edge! g (:qvar-result qa) jv f/signal-forward nil)
     (f/add-edge! g (:qvar-result qb) jv f/signal-forward nil)
-    {:a qa :b qb :join jv}))
-
-(defn add-join-query
-  [g a b]
-  (add-join g
-            (param-query g (keyword (gensym)) a)
-            (param-query g (keyword (gensym)) b)))
+    {:a qa :b qb :qvar-result jv}))
+
+(defn add-join-query!
+  [g [a b & more]]
+  (reduce
+   (fn [acc p]
+     (add-join! g acc (add-param-query! g (keyword (gensym)) p)))
+   (add-join! g
+             (add-param-query! g (keyword (gensym)) a)
+             (add-param-query! g (keyword (gensym)) b))
+   more))

 (defn collect-inference
   [g production]
@@ -257,7 +262,7 @@
       (f/signal! pred)
       (f/signal! obj)
       (swap! queries assoc id {:acc acc :result res})
-      {:acc acc :result res}))
+      {:pattern [s p o] :acc acc :result res}))
   (query-result
     [_ id] (when-let [q (@queries id)] @@(:res q)))
   (add-rule!
@@ -304,8 +309,8 @@
         num-projects (add-counter! g projects)
         num-types (add-counter! g types)
         inf1 (add-rule! g :knows [nil 'knows nil] (fn [[s p o]] [[s 'type 'person] [o 'type 'person] [o 'knows s]]))
-        pq (:qvar-result (param-query g :pq '[?s knows ?o]))
-        jq (:join (add-join-query g '[?p author ?prj] '[?prj type project]))
+        pq (:qvar-result (add-param-query! g :pq '[?s knows ?o]))
+        jq (:qvar-result (add-join-query! g '[[?p author ?prj] [?prj type project] [?p type person]]))
         ctx (f/async-context {:graph g :processor f/eager-vertex-processor :timeout nil})]
     (f/execute! ctx)
     (mapv
@@ -313,15 +318,16 @@
      '[[toxi author fabric]
        [fabric type project]
        [toxi type person]])
-    (info :inf-vertices (get-in inf1 [:query :result :id]) (get-in inf1 [:inf :id]))
-    {:g   g
-     :ctx ctx
-     :all all
-     :toxi toxi
-     :types types
-     :knows knows
+    ;;(info :inf-vertices (get-in inf1 [:query :result :id]) (get-in inf1 [:inf :id]))
+    {:g        g
+     :ctx      ctx
+     :all      all
+     :toxi     toxi
+     :types    types
+     :knows    knows
      :projects projects
-     :pq pq
-     :jq jq
+     :pq       pq
+     :jq       jq
      :num-projects num-projects
-     :num-types num-types}))
+     :num-types num-types
+     }))


Updated error message checking due to search app change.

--- test/cmr/system_int_test/search/collection_temporal_search_test.clj
+++ test/cmr/system_int_test/search/collection_temporal_search_test.clj
@@ -91,7 +91,7 @@
         (let [status (get-in (ex-data e) [:object :status])
               body (get-in (ex-data e) [:object :body])]
           (is (= 422 status))
-          (is (re-find #"temporal date is invalid:.*" body))))))
+          (is (re-find #"temporal datetime is invalid:.*" body))))))
   (testing "search by invalid temporal start-date after end-date."
     (try
       (search/find-collection-refs {"temporal[]" "2011-01-01T10:00:00Z,2010-01-10T12:00:00Z"})