adding range search in b+tree leaf node

adding range search in b+tree leaf node

(without skipping to next nodes yet)

--- sample/src/sample/btree.clj
+++ sample/src/sample/btree.clj
@@ -1,6 +1,7 @@
 (ns sample.btree
   (:require [sample.rangemap :as rm]
             [sample.partiallycomparablekey :as pck]
+            [sample.memoryfactstore :as mfs]
             [clojure.tools.logging :as log]))

@@ -253,7 +254,14 @@
   TreeLookup

   (lookup [this k]
-    [k (get m k)]))
+    (if-let [v (get m k)]
+      [k [v]]
+      (when (< (count k) (-> m keys first count))
+        (let [klen (count k)
+              matching-keys (->> (keys m)
+                                 (filter #(= (compare (->> % (take klen) vec) k) 0)))]
+
+          [k (vec (vals (select-keys m matching-keys)))])))))

 (defrecord B+Tree [b root]
@@ -304,6 +312,17 @@
       k1 (first kv1)]
   #_(Thread/sleep 120000)
   [kv1 (count @ts) (time (lookup t k1))])
+
+#_(let [kvs (for [k1 [:a :b :c]
+                k2 [1 3 5 7 9]]
+            [[k1 k2] (str (name k1) k2)])
+      t (time (reduce (fn [t [k v]]
+                        (let [nt (insert t k v)]
+                          nt))
+                      (b+tree 3)
+                      kvs))]
+  (clojure.pprint/pprint t)
+  (lookup t [:a]))


CEO-258 Use triangulum.utils/parse-as-sh-cmd

--- src/clj/collect_earth_online/generators/external_file.clj
+++ src/clj/collect_earth_online/generators/external_file.clj
@@ -4,6 +4,7 @@
             [clojure.java.io    :as io]
             [clojure.java.shell :as sh]
             [triangulum.type-conversion :as tc]
+            [triangulum.utils :refer [parse-as-sh-cmd]]
             [collect-earth-online.utils.part-utils :as pu]
             [collect-earth-online.utils.geom    :refer [make-wkt-point]]
             [collect-earth-online.utils.project :refer [check-plot-limits check-sample-limits]]))
@@ -26,19 +27,6 @@
        (remove #(= folder-name %))
        (filter #(= ext (peek (str/split % #"\."))))
        (first)))
-
-(defn- parse-as-sh-cmd
-  "Split string into an array for use with clojure.java.shell/sh."
-  [s]
-  (loop [chars (seq s)
-         acc   []]
-    (if (empty? chars)
-      acc
-      (if (= \` (first chars))
-        (recur (->> chars (rest) (drop-while #(not= \` %)) (rest))
-               (->> chars (rest) (take-while #(not= \` %)) (apply str) (str/trim) (conj acc)))
-        (recur (->> chars (drop-while #(not= \` %)))
-               (->> chars (take-while #(not= \` %)) (apply str) (str/trim) (#(str/split % #" ")) (remove str/blank?) (into acc)))))))

 (defn- sh-wrapper [dir env & commands]
   (sh/with-sh-dir dir


fix bugs in test

fix bugs in test

- reports for tags and functions
- fixtures for tags and function
- some slight refactoring

--- bake/bake/test.clj
+++ bake/bake/test.clj
@@ -1,14 +1,8 @@
 (ns bake.test
-  (:use [cake.contrib.find-namespaces :only [find-namespaces-in-dir]])
-  (:require clojure.test
+  (:use [cake.contrib.find-namespaces :only [find-namespaces-in-dir]]
+        useful)
+  (:require [clojure.test :as test]
             [clojure.stacktrace :as stack]))
-
-(defn map-tags [nses]
-  (reduce (partial merge-with concat)
-          (for [ns nses
-                [name f] (ns-publics ns)
-                tag (:tags (meta f))]
-            {tag [f]})))

 (defn all-test-namespaces []
   (find-namespaces-in-dir (java.io.File. "test")))
@@ -23,18 +17,10 @@
         (keyword?  test) :tag
         :else            :ns))

-(defn group-opts [coll]
-  ;; don't use group-by so we are compatible with 1.1
-  (reduce
-   (fn [ret x]
-     (let [k (test-type x)]
-       (assoc ret k (conj (get ret k []) x))))
-   {}
-   coll))
-
 (defn get-grouped-tests [namespaces opts]
   (let [tests (:test opts)]
-    (group-opts
+    (group-by
+     test-type
      (if (nil? tests)
        namespaces
        (map prep-opt tests)))))
@@ -49,22 +35,26 @@
   (println (:fail m) "failures," (:error m) "errors.")
   (when (:start-time m) (timer (:start-time m))))

-(defmethod clojure.test/report :begin-test-ns [m]
-  (clojure.test/with-test-out
+(defmethod test/report :begin-test-ns [m]
+  (test/with-test-out
    (println "\nTesting" (ns-name (:ns m)))))

-(defmethod clojure.test/report :summary [m]
-  (clojure.test/with-test-out
+(defmethod test/report :summary [m]
+  (test/with-test-out
     (print-results m)))

+<<<<<<< HEAD
 (defmethod clojure.test/report :fn-summary [m]
   (clojure.test/with-test-out
     (print-results m)))

 (defmethod clojure.test/report :begin-auto [m])
+=======
+(defmethod test/report :begin-auto [m])
+>>>>>>> fix bugs in test

-(defmethod clojure.test/report :summary-auto [m]
-  (clojure.test/with-test-out
+(defmethod test/report :summary-auto [m]
+  (test/with-test-out
     (if (and (= 0 (:fail m))
              (= 0 (:error m))
              (not (:full-report? m)))
@@ -74,61 +64,69 @@
 (comment defn diff-actual [[f [_ expected actual]]]
   (diff/clean-difform expected actual))

-(defmethod clojure.test/report :fail [m]
-  (clojure.test/with-test-out
-    (clojure.test/inc-report-counter :fail)
-    (println "\nFAIL in" (clojure.test/testing-vars-str m))
-    (when (seq clojure.test/*testing-contexts*) (println (clojure.test/testing-contexts-str)))
+(defmethod test/report :fail [m]
+  (test/with-test-out
+    (test/inc-report-counter :fail)
+    (println "\nFAIL in" (test/testing-vars-str m))
+    (when (seq test/*testing-contexts*) (println (test/testing-contexts-str)))
     (when-let [message (:message m)] (println message))
     (let [expected (:expected m)
           actual   (:actual m)]
-      (println "expected:" (pr-str expected))
-      (println "  actual:" (pr-str actual))
       (comment when (seq? actual)
         (diff-actual actual)))))

 (declare start-time)

+(defn test-fn-seq [pairs]
+  (binding [test/*report-counters* (ref test/*initial-report-counters*)
+            start-time (System/nanoTime)]
+    (doseq [[ns fs] pairs]
+      (let [ns (find-ns (symbol ns))
+            once-fixture-fn (test/join-fixtures (::test/once-fixtures (meta ns)))
+            each-fixture-fn (test/join-fixtures (::test/each-fixtures (meta ns)))]
+        (once-fixture-fn
+         (fn [] (doseq [f fs]
+                  (each-fixture-fn (fn [] (test/test-var f))))))))
+    (test/report (assoc @test/*report-counters* :type :summary :start-time start-time))))
+
 (defn run-tests-for-fns [grouped-tests]
-  (when-let [input-fs (:fn grouped-tests)]
-    (println "testing functions:" (apply str (interpose ", " input-fs)))
-    (binding [clojure.test/*report-counters* (ref clojure.test/*initial-report-counters*)
-              start-time (System/nanoTime)]
-      (doseq [f input-fs]
-        (clojure.test/test-var (ns-resolve (symbol (namespace f))
-                                           (symbol (name f)))))
-      (clojure.test/report (assoc @clojure.test/*report-counters* :type :fn-summary :start-time start-time)))))
+  (when-let [input-fs (seq (for [[ns fs] (group-by namespace (:fn grouped-tests))
+                                 f fs]
+                             [ns (ns-resolve (symbol (namespace f))
+                                             (symbol (name f)))]))]
+    (test-fn-seq (reduce (fn [m [k v]] (update m k conj v)) {} input-fs))))

 (defn run-tests-for-nses [grouped-tests]
   (for [ns (:ns grouped-tests)]
-    (binding [clojure.test/*report-counters* (ref clojure.test/*initial-report-counters*)
+    (binding [test/*report-counters* (ref test/*initial-report-counters*)
               start-time (System/nanoTime)]
-      (clojure.test/report {:type :begin-test-ns :ns ns})
-      (clojure.test/test-all-vars (find-ns ns))
-      (clojure.test/report (assoc @clojure.test/*report-counters* :type :summary :start-time start-time))
-      @clojure.test/*report-counters*)))
+      (test/report {:type :begin-test-ns :ns ns})
+      (test/test-all-vars (find-ns ns))
+      (test/report (assoc @test/*report-counters* :type :summary :start-time start-time))
+      @test/*report-counters*)))
+
+(defn map-tags [nses tags]
+  (reduce (partial merge-with concat)
+          (for [ns nses
+                [name f] (ns-publics ns)
+                tag (:tags (meta f))]
+            (when (contains? (set tags) tag)
+              {ns [f]}))))

 (defn run-tests-for-tags [grouped-tests test-namespaces]
   (when-let [input-tags (:tag grouped-tests)]
-    (let [tags-to-fs (map-tags test-namespaces)]
-      (doall (for [tag input-tags]
-               (binding [clojure.test/*report-counters* (ref clojure.test/*initial-report-counters*)
-                         start-time (System/nanoTime)]
-                 (println "Testing" tag)
-                 (doseq [test (tag tags-to-fs)]
-                   (clojure.test/test-var test))
-                 (clojure.test/report (assoc @clojure.test/*report-counters* :type :summary :start-time start-time))
-                 @clojure.test/*report-counters*))))))
+    (let [input-fs (-> test-namespaces (map-tags input-tags) )]
+      (test-fn-seq input-fs))))

 (defn run-tests-for-auto [grouped-tests & full-report]
   (for [ns (:ns grouped-tests)]
-    (binding [clojure.test/*report-counters* (ref clojure.test/*initial-report-counters*)
+    (binding [test/*report-counters* (ref test/*initial-report-counters*)
               start-time (System/nanoTime)]
-      (clojure.test/report {:type :begin-auto :ns ns})
-      (clojure.test/test-all-vars ns)
-      (clojure.test/report
-       (let [report (assoc @clojure.test/*report-counters* :type :summary-auto :start-time start-time)]
+      (test/report {:type :begin-auto :ns ns})
+      (test/test-all-vars ns)
+      (test/report
+       (let [report (assoc @test/*report-counters* :type :summary-auto :start-time start-time)]
          (if (first full-report)
            (assoc report :full-report? true)
            report)))
-      @clojure.test/*report-counters*)))
+      @test/*report-counters*)))


remove unused code using mk-pipeline which is no longer there

--- test/clj/lambdacd/smoketest/pipeline.clj
+++ test/clj/lambdacd/smoketest/pipeline.clj
@@ -1,10 +1,7 @@
 (ns lambdacd.smoketest.pipeline
   (:use [lambdacd.steps.control-flow]
         [lambdacd.smoketest.steps])
-  (:require [lambdacd.core :as core]
-            [lambdacd.util :as utils]))
-
-
+  (:require [lambdacd.util :as utils]))

 (def pipeline-def
   `(
@@ -21,8 +18,3 @@

 (def config
   {:home-dir (utils/create-temp-dir)})
-
-(def pipeline (core/mk-pipeline pipeline-def config))
-
-(def app (:ring-handler pipeline))
-(def start-pipeline-thread (:init pipeline))


Removed println

Removed println

--- src/cljs/bookmarx/add.cljs
+++ src/cljs/bookmarx/add.cljs
@@ -36,7 +36,6 @@
   (let [parent-id (get-in @doc [:bookmark/parent :db/id])
         parent (session/get parent-id)
         children (:bookmark/_parent parent)]
-    (println "children" children)
     (if (:add? @doc)
         ; Add the child to the parent's children.
         (session/put! parent-id (update-in parent [:bookmark/_parent] #(conj % @doc)))


some specials have been renamed

some specials have been renamed


bugfix

bugfix

--- src/cljx/mesh/respond.cljx
+++ src/cljx/mesh/respond.cljx
@@ -1,5 +1,7 @@
 (ns mesh.respond
   (:refer-clojure :exclude [+ - * /])
+  #+cljs
+  (:require-macros [mesh.def :refer [defbreakpoint]])
   (:require [garden.core :refer [css]]
             [garden.units :as u :refer [px pt]]
             [garden.units :refer (px+ px* px- px-div em)]


(maint) Handle incomplete HTTP request maps

This commit updates the JRubyMetricsService to handle incomplete HTTP request
maps when summarizing the reason that a JRuby was borrowed by assigning a
Comidi :route-id of "unknown-http-request" to any Ring request map that lacks
Comidi info. This resolves schema errors in the JRuby metrics handlers arising
from test mocks that do not travel through the Comidi handlers in
the MasterService.

--- src/clj/puppetlabs/services/jruby/jruby_metrics_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_metrics_core.clj
@@ -143,7 +143,9 @@
     (assoc-in instance [:reason :request]
               {:uri (:uri request)
                :request-method (:request-method request)
-               :route-id (get-in request [:route-info :route-id])})
+               :route-id (get-in request
+                                 [:route-info :route-id]
+                                 "unknown-http-request")})
     instance))

 (schema/defn ^:always-validate requested-instances-info :- [InstanceRequestInfo]


Fix 'Add operation' button.

Fix 'Add operation' button.

--- src/cljs/hatnik/web/client/form/github_pull_request.cljs
+++ src/cljs/hatnik/web/client/form/github_pull_request.cljs
@@ -72,6 +72,9 @@
                                                    :value (:replace data)
                                                    :className "form-control"})))))))))

+(defn add-new-operation [data owner]
+  (.log js/console "Add new operation"))
+
 (defn pull-request-operations-list [data owner]
   (reify
     om/IRender
@@ -83,7 +86,8 @@
                                           (dom/h4 nil "Operations list"))

                                  (dom/div #js {:className "col-md-6"}
-                                          (dom/button #js {:className "btn btn-primary pull-right"}
+                                          (dom/div #js {:className "btn btn-primary pull-right"
+                                                        :onClick #(add-new-operation data owner)}
                                                       "Add operation")))

                         (apply dom/div nil


correct link to the documentation, loop doc video

--- src/cljs/work_sessions/components/proxy_viewer_page.cljs
+++ src/cljs/work_sessions/components/proxy_viewer_page.cljs
@@ -12,7 +12,7 @@
 (defn proxy-viewer-page []
   (let [is-docs-visible? (subscribe [:proxy-viewer.docs/is-visible?])]
     (r/create-class
-     {:component-did-mount #(dispatch [:ui.header/show-first-details-for-type :schedule])
+     {;;:component-did-mount #(dispatch [:ui.header/show-first-details-for-type :schedule])
       :display-name "proxy-viewer-page"

       :reagent-render
@@ -23,23 +23,23 @@

          [headers-view]

-         (when true ;;@is-docs-visible?
-           [:div.documentation-container
-            [:div.documentation
-             [:div.responsive-embed.widescreen
-              [:iframe
-               {:width 560
-                :height 315
-                ;; vnd.youtube://
-                ;; :src "vnd.youtube://www.youtube.com/watch?v=Qar_jUm7yhQ?autoplay=1"
-                :src "https://www.youtube.com/embed/TuGG9Wts-zA?autoplay=1&loop=1&controls=0&start=1320&end=3900"
-                :frame-border 0
-                :auto-play 1
-                :loop 1
-                :controls 0
-                :start 1320
-                :end 3900
-                :allow-full-screen true}]]]])])})))
+         [:div.documentation-container
+          [:div.documentation
+           [:div.responsive-embed.widescreen
+            [:iframe
+             {:width 560
+              :height 315
+              ;; vnd.youtube://
+              ;; :src "vnd.youtube://www.youtube.com/watch?v=Qar_jUm7yhQ?autoplay=1"
+              :src "https://www.youtube.com/embed/zYTfUtroTJI?autoplay=1&loop=1&controls=0&playlist=zYTfUtroTJI"
+              :frame-border 0
+              :auto-play 1
+              :loop 1
+              :controls 0
+              ;; :start 1320
+              ;; :end 1340
+              ;; :end 3900
+              :allow-full-screen true}]]]]])})))

 ;; (defn proxy-viewer-page []


spend hours on macros, go figure

spend hours on macros, go figure


Document some functions in boot.core (fixes #303)

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -678,7 +678,9 @@
   (reset! *warnings* 0))

 (defn- construct-tasks
-  "FIXME: document"
+  "Given command line arguments (strings), constructs a task pipeline by
+  resolving the task vars, calling the task constructors with the arguments
+  for that task, and composing them to form the pipeline."
   [& argv]
   (loop [ret [] [op-str & args] argv]
     (if-not op-str
@@ -694,7 +696,7 @@
             (recur (conj ret (apply (var-get op) opts)) argv)))))))

 (defn- sync-target
-  "FIXME: document"
+  "Copy output files to the target directory (if BOOT_EMIT_TARGET is not 'no')."
   [before after]
   (when-not (= "no" (boot.App/config "BOOT_EMIT_TARGET"))
     (let [tgt  (get-env :target-path)
@@ -705,7 +707,8 @@
         (file/delete-empty-subdirs! tgt)))))

 (defn- run-tasks
-  "FIXME: document"
+  "Given a task pipeline, builds the initial fileset, sets the initial build
+  state, and runs the pipeline."
   [task-stack]
   (binding [*warnings* (atom 0)]
     (let [fs (commit! (reset-fileset))]


Add boot.core/by-path fileset filter

Add boot.core/by-path fileset filter

Closes #245

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -881,6 +881,19 @@
   [names files]
   (by-name names files true))

+(defn by-path
+  "This function takes two arguments: `paths` and `files`, where `path` is
+  a seq of path strings like `[\"a/b/c/foo.clj\" \"bar.xml\"]` and `files` is
+  a seq of file objects. Returns a seq of the files in `files` which have file
+  paths listed in `paths`."
+  [paths files & [negate?]]
+  ((file-filter #(fn [f] (= (.getPath f) %))) paths files negate?))
+
+(defn not-by-path
+  "This function is the same as `by-path` but negated."
+  [paths files]
+  (by-path paths files true))
+
 (defn by-ext
   "This function takes two arguments: `exts` and `files`, where `exts` is a seq
   of file extension strings like `[\".clj\" \".cljs\"]` and `files` is a seq of


Fix abort issue due to dependency conflict

--- bundles/default/project.clj
+++ bundles/default/project.clj
@@ -17,7 +17,7 @@
                  [yada/jwt ~VERSION]
                  [yada/multipart ~VERSION]
                  [yada/oauth2 ~VERSION]
-                 [yada/swagger ~VERSION]
+                 [yada/swagger ~VERSION :exclusions [clj-time]]
                  [yada/transit ~VERSION]
                  [yada/webjars ~VERSION]]


Fix User Object test

Fix User Object test

--- test/uruk/core_test.clj
+++ test/uruk/core_test.clj
@@ -173,7 +173,8 @@
        (is (and (instance? Logger (:logger session))
                 (= (.getName (:logger expected-config))
                    (.getName (:logger session)))))
-       (is (empty? (:user-object session))) ;; XXX is this all we can test user-object?
+       (is (= (:user-object expected-config)
+              (:user-object session)))
        (is (= (:transaction-timeout session)
               (:transaction-timeout expected-config)))
        (is (= (:transaction-mode session)


lein-release plugin: preparing 0.1.0 release

--- liverepl-agent/project.clj
+++ liverepl-agent/project.clj
@@ -1,4 +1,4 @@
-(defproject com.brightcove.liverepl/liverepl-agent "0.1.0-SNAPSHOT"
+(defproject com.brightcove.liverepl/liverepl-agent "0.1.0"
   :description "Brightcove local version of liverepl-agent"
   :license {:name "Copyright (C) 2009 David J. Powell.  See GitHub for license."}
   :url "https://github.com/djpowell/liverepl"


default-comparator fix

default-comparator fix

--- lib/shin/cljs/cljs/core.cljs
+++ lib/shin/cljs/cljs/core.cljs
@@ -533,7 +533,7 @@
   (fn [a b]
     (let [res (comparator (aget a 0) (aget b 0))]
       (if (== 0 res)
-        (default-comparator (aget a 1) (aget b 1))
+        (default-compare (aget a 1) (aget b 1))
         res))))

 (defn- stable-sort-array [arr comparator]


identified DOM pattern for faction information on each faction page.

--- scraper/src/scraper/core.clj
+++ scraper/src/scraper/core.clj
@@ -75,7 +75,9 @@
                            (by-tag :a))
                        )
         urls (map #(:href (first (vals %))) the-factions)]
-    (build-all-faction-urls urls)
+    (apply parse (build-all-faction-urls urls))
+
+
     ;(map println urls)
     ;(doseq [faction the-factions]
     ;  (println (:href (first (vals faction)))))


change goog.provide/require overrides

change goog.provide/require overrides

they were behaving incorrectly when loading goog.module via
REPL or hot-reload.

fixes #909

--- src/main/shadow/cljs/devtools/client/env.cljs
+++ src/main/shadow/cljs/devtools/client/env.cljs
@@ -140,11 +140,15 @@
     (reset! reset-print-fn-ref nil)))

 (defn patch-goog! []
-  (when (= "goog" module-format)
-    ;; patch away the already declared exception
-    (set! js/goog.provide js/goog.constructNamespace_)
-    ;; goog.module calls this directly
-    (set! js/goog.isProvided_ (constantly false))))
+  ;; patch away the already declared exception and checks
+  ;; otherwise hot-reload may fail
+  (set! js/goog.provide js/goog.constructNamespace_)
+  ;; also override goog.require to just return the namespace
+  ;; which is needed inside goog.module modules. otherwise
+  ;; the return is ignored anyways.
+  ;; this isn't strictly needed but ensures that loading
+  ;; actually only does what we want and not more
+  (set! js/goog.require js/goog.module.get))

 (defn add-warnings-to-info [{:keys [info] :as msg}]
   (let [warnings


Better function arg name.

Better function arg name.

--- src/onyx/scheduling/common_task_scheduler.clj
+++ src/onyx/scheduling/common_task_scheduler.clj
@@ -12,8 +12,12 @@
        (> (count (get-in replica [:allocations job task])) 0)))

 (defmulti task-distribute-peer-count
-  (fn [replica job n]
-    (get-in replica [:task-schedulers job])))
+  (fn [replica job-id n]
+    (get-in replica [:task-schedulers job-id])))
+
+(defmulti task-constraints
+  (fn [replica peer->vm task->node job-id]
+    (get-in replica [:task-schedulers job-id])))

 (defmethod task-distribute-peer-count :default
   [replica job n]


CMR-3409: Updated health check tests to be queue agnostic.

--- system-int-test/test/cmr/system_int_test/health_test.clj
+++ system-int-test/test/cmr/system_int_test/health_test.clj
@@ -38,7 +38,7 @@
    :dependencies {:elastic_search {:ok? true}
                   :echo {:ok? true}
                   :cubby good-cubby-health
-                  :rabbit-mq {:ok? true}
+                  :message-queue {:ok? true}
                   :metadata-db good-metadata-db-health
                   :index-set good-index-set-db-health}})

@@ -47,7 +47,7 @@
    :dependencies {:oracle {:ok? true}
                   :echo {:ok? true}
                   :metadata-db good-metadata-db-health
-                  :rabbit-mq {:ok? true}
+                  :message-queue {:ok? true}
                   :cubby good-cubby-health
                   :indexer good-indexer-health}})

@@ -68,7 +68,7 @@
   (s/only-with-real-database
     (is (= [200 {:elastic_search {:ok? true}
                  :echo {:ok? true}
-                 :rabbit-mq {:ok? true}
+                 :message-queue {:ok? true}
                  :metadata-db good-metadata-db-health
                  :index-set good-index-set-db-health
                  :cubby good-cubby-health}]
@@ -79,7 +79,7 @@
     (is (= [200 {:oracle {:ok? true}
                  :echo {:ok? true}
                  :metadata-db good-metadata-db-health
-                 :rabbit-mq {:ok? true}
+                 :message-queue {:ok? true}
                  :cubby good-cubby-health
                  :indexer good-indexer-health}]
            (get-app-health (url/ingest-health-url))))))
@@ -95,14 +95,14 @@
   (s/only-with-real-database
     (is (= [200 {:metadata-db good-metadata-db-health
                  :internal-metadata-db good-metadata-db-health
-                 :indexer (update-in good-indexer-health [:dependencies] dissoc :rabbit-mq)}]
+                 :indexer (update-in good-indexer-health [:dependencies] dissoc :message-queue)}]
            (get-app-health (url/bootstrap-health-url))))))

 (deftest virtual-product-health-test
   (s/only-with-real-database
     (is (= [200 {:ingest good-ingest-health
                  :metadata-db good-metadata-db-health
-                 :rabbit-mq {:ok? true}}]
+                 :message-queue {:ok? true}}]
            (get-app-health (url/virtual-product-health-url))))))

 (deftest access-control-health-test


Added elevation to CSV export.

Added elevation to CSV export.

--- src/ontrail/csv.clj
+++ src/ontrail/csv.clj
@@ -10,11 +10,11 @@
 (def #^{:private true} logger (org.slf4j.LoggerFactory/getLogger (str *ns*)))

 (defn exs [query]
-  (mq/with-collection *db* EXERCISE
-    (mq/find query)
-    (mq/fields [:creationDate :title :sport :distance :duration :avghr :pace :_id :tags])
-    (mq/sort {:creationDate 1})
-    (mq/batch-size 1000)))
+  (mq/with-collection *db* EXERCISE
+                      (mq/find query)
+                      (mq/fields [:creationDate :title :sport :distance :duration :avghr :pace :_id :tags :elevation])
+                      (mq/sort {:creationDate 1})
+                      (mq/batch-size 1000)))

 (defn csv-escape [field]
   (let [s (str field)]
@@ -23,7 +23,7 @@
 (defn to-csv-date [datetime]
   (str (time/year datetime) "-" (time/month datetime) "-" (time/day datetime)))

-(defn join-with [separator elements]
+(defn join-with [separator elements]
   (reduce (fn [a b] (str a separator b)) elements))

 (defn as-link [mid]
@@ -37,33 +37,34 @@
     ""))

 (def extract-funs
-  {"date" (comp to-csv-date :creationDate)
-   "title" :title
-   "sport" :sport
-   "distance" :distance
-   "duration" :duration
-   "pace" :pace
-   "avghr" :avghr
-   "url" (comp as-link :_id)
+  {"date"         (comp to-csv-date :creationDate)
+   "title"        :title
+   "sport"        :sport
+   "distance"     :distance
+   "duration"     :duration
+   "elevation"    :elevation
+   "pace"         :pace
+   "avghr"        :avghr
+   "url"          (comp as-link :_id)
    "distancetext" (comp to-human-distance :distance)
    "durationtext" (comp to-human-time :duration)
-   "pacetext" get-pace
-   "tags" tags})
+   "pacetext"     get-pace
+   "tags"         tags})

 (def default-keys
   ["date" "title" "sport" "distance" "duration" "pace" "avghr" "url" "distancetext" "durationtext" "pacetext" "tags"])

 (defn extract-fields [keys]
-  (apply juxt (mapv #(comp csv-escape %)
+  (apply juxt (mapv #(comp csv-escape %)
                     (mapv (partial get extract-funs) keys))))

 (defn ex-filter [year user]
   {"$and" [{:creationDate {"$gte" (time/date-time year 1 1)}} {:creationDate {"$lt" (time/date-time (inc year) 1 1)}} {:user user}]})

-(defn to-csv [keys exs]
+(defn to-csv [keys exs]
   (str
-   (join-with "," keys) "\r\n"
-   (join-with "\r\n" (map (partial join-with ",") (map (extract-fields keys) exs)))))
+    (join-with "," keys) "\r\n"
+    (join-with "\r\n" (map (partial join-with ",") (map (extract-fields keys) exs)))))

 (defn export [params]
   (.info logger (str "Exporting csv " params))


Preferring str over string/join

Preferring str over string/join

--- clojure/beer-song/beer.clj
+++ clojure/beer-song/beer.clj
@@ -1,11 +1,11 @@
 (ns beer
-  (:require [clojure.string :as str]))
+  (:require [clojure.string :as string]))

 (defn- count-string [count]
   (cond
     (zero? count) "no more bottles"
     (= count 1)   "1 bottle"
-    :else         (str/join [count, " bottles"])))
+    :else         (str count " bottles")))

 (defn- beer-string [count]
   (if (= count 1)
@@ -13,25 +13,25 @@
     "one"))

 (defn- first-strophe [count]
-  (str/capitalize
-    (str/join [(count-string count)
+  (string/capitalize
+    (str (count-string count)
       " of beer on the wall, "
       (count-string count)
-      " of beer."])))
+      " of beer.")))

 (defn- second-strophe [count]
   (if (zero? count)
     "Go to the store and buy some more, 99 bottles of beer on the wall.\n"
-    (str/join ["Take "
+    (str "Take "
       (beer-string count)
       " down and pass it around, "
       (count-string (- count 1))
-      " of beer on the wall.\n"])))
+      " of beer on the wall.\n")))

 (defn verse [count]
-  (str/join "\n" [(first-strophe count) (second-strophe count)]))
+  (str (first-strophe count) "\n" (second-strophe count)))

 (defn sing
   ([begin] (sing begin 0))
   ([begin end]
-    (str/join [(str/join "\n" (map verse (range begin (- end 1) -1))) "\n"])))+    (str (string/join "\n" (map verse (range begin (- end 1) -1))) "\n")))


grey for solid blocks... like rocks

grey for solid blocks... like rocks

--- clojure/src/dnd/level.cljs
+++ clojure/src/dnd/level.cljs
@@ -24,10 +24,12 @@
         inhabitants (if (and (not solid) has-inhabitant)
                       [(assoc base-character :char "e" :color (rand-int 256))]
                       [])
-        color (color-to-array (if (and walkable (> (rand) 0.9))
-                (COLOR "blue")
-                (COLOR "green")
-                ))]
+        color (color-to-array
+                (if-not walkable
+                  (COLOR "grey")
+                  (if (> (rand) 0.9)
+                    (COLOR "blue")
+                    (COLOR "green"))))]
     (assoc block
            :x x
            :y y


Add documentation example test.

Add documentation example test.

--- test/dsbdp/test/data_processing_dsl_tests.clj
+++ test/dsbdp/test/data_processing_dsl_tests.clj
@@ -14,6 +14,21 @@
             [dsbdp.data-processing-dsl :refer :all]
             [dsbdp.experiment-helper :refer :all])
   (:import (java.util ArrayList HashMap List Map)))
+
+
+
+(deftest simple-documenation-example-test-1
+  (let [in-vector [1.23 "FOO" 42 "bar" "baz"]
+        expected "{\"myFloat\":1.23,\"myStr\":\"foo\",\"myRatio\":0.42,\"myStr2\":\"barbaz\"}"
+        dsl-expression {:output-type :json-str
+                        :rules [['myFloat '(nth 0)]
+                                ['myStr '(clojure.string/lower-case (nth 1)) :string]
+                                ['myRatio '(float (/ (nth 2) 100.0))]
+                                ['myStr2 '(str (nth 3) (nth 4)) :string]]}
+        data-processing-fn (create-proc-fn dsl-expression)]
+    (is (= expected (str (data-processing-fn in-vector))))))
+
+

 ;;;
 ;;; Tests for byte array input and various output types.


add a test for BETWEEN w/ dates

add a test for BETWEEN w/ dates

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -387,6 +387,20 @@
    :breakout [nil]
    :limit nil})

+;; ### FILTER -- "BETWEEN" with dates
+(qp-expect-with-all-datasets
+ {:rows [[29]]
+  :columns ["count"]
+  :cols [{:base_type :IntegerField
+          :special_type :number
+          :name "count"
+          :id nil
+          :table_id nil
+          :description nil}]}
+ {:source_table (id :checkins)
+  :filter ["AND" ["BETWEEN" (id :checkins :date) "2015-04-01" "2015-05-01"]]
+  :aggregation ["count"]})
+
 ;; ### FILTER -- "OR", "<=", "="
 (qp-expect-with-all-datasets
     {:rows [[1 4 3 -165.374 10.0646 "Red Medicine"]


Increase time before stopping kafka server

--- test/onyx/plugin/input_broker_reboot_test.clj
+++ test/onyx/plugin/input_broker_reboot_test.clj
@@ -117,7 +117,7 @@
   :lifecycles lifecycles
   :task-scheduler :onyx.task-scheduler/balanced})

-(Thread/sleep 10000)
+(Thread/sleep 20000)

 (def stopped-server (component/stop kafka-server))


Danny's lowercased too

Danny's lowercased too

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -136,7 +136,7 @@
                                         :mult (async/mult mouse-up-ch)}})
               (browser-settings/restore-browser-settings)
               (update-in (state/doc-chat-bot-path document-id)
-                         #(if % % (rand-nth ["daniel" "Danny" "prcrsr"])))))))
+                         #(if % % (rand-nth ["daniel" "danny" "prcrsr"])))))))

 (defn log-channels?
   "Log channels in development, can be overridden by the log-channels query param"


CMR-4238 - Update the docstring for the alternate test runner.

--- dev-system/dev/user.clj
+++ dev-system/dev/user.clj
@@ -245,7 +245,32 @@
   "Runs the suites defined by the ltest runner (unit and integration), first
   setting the log level to `:fatal` to keep the terminal output cleaner. To
   run with the usual error messages to STDOUT, simply use `ltest/run-suites`
-  directly."
+  directly.
+
+  To run just a single suite:
+  ```
+  (ltest/run-unit-tests)
+  ```
+  or
+  ```
+  (ltest/run-integration-tests)
+  ```
+
+  Furthermore, to run a test namespace (or collection of namespaces) using
+  this runner:
+  ```
+  (ltest/run-tests ['cmr.system-int-test.health-test])
+  ```
+
+  You can also run a single test function using this runner by passing a test
+  function var:
+  ```
+  (ltest/run-test #'cmr.system-int-test.health-test/index-set-health-test)
+  ```
+
+  Note that none of the `(ltest/*)` functions silence logging; only the
+  `run-suites` function defined in this `user` namespace provides that
+  convenience."
   ([]
     (let [orig-log-level @settings/logging-level]
       (set-logging-level! :fatal)


Front end code clean up before reorganization

--- src-cljs/tropology/core.cljs
+++ src-cljs/tropology/core.cljs
@@ -10,6 +10,11 @@
   (:require-macros [secretary.core :refer [defroute]]))

+
+;
+; Components
+;
+
 (defn row [label & body]
   [:div.row
    [:div.col-md-2 [:span label]]
@@ -20,9 +25,7 @@
                                    :id    id}]))

-; Original code:
-
-(defn button-item [tag label url]
+(defn button-item [label url]
   [:li {:class "button"}
    [:a {:on-click #(secretary/dispatch! (str "#/" url))} label]])

@@ -240,8 +243,7 @@
                    (swap! state assoc :current-trope response :tropes (:tropes response))
                    (pick-random-piece)
                    )}
-       )
-  )
+       ))

 (defn handle-trope-view
   "Called when a trope view is dispatched for a code"
@@ -261,42 +263,37 @@
     (fn []
       [:div
        [bind-fields trope-code-form form-data]
-       (cond
-         (= :home (session/get :page)) [:div
-                                        [:input {:type     "button"
-                                                 :value    "Graph!"
-                                                 :on-click #(redraw-graph (:trope-code @form-data))}]
-                                        [:div {:id "graph-container"}]]
-         (= :tropes (session/get :page)) [:div
-                                          [:input {:type     "button"
-                                                   :value    "Retrieve tropes"
-                                                   :on-click #(list-tropes (:trope-code @form-data))}]
-                                          [:div {:id "current-trope"}
-                                           [:h2 {:class "trope-title"} (get-in @state [:current-trope :title])]
-                                           [:p (get-in @state [:current-trope :description])]
-                                           ]
-                                          [:div {:id "current-piece"}
-                                           [:h3 "Random reference"]
-                                           [:p (process-trope (:current-piece @state))]
-                                           (if (:current-piece @state)
-                                             [:div [:span (str "(" (count (:tropes @state)) " remaining)")]]
-
-                                             [:div {:class "trope-vote"}
-                                              [:ul
-                                               (button-item :trope-like "Interesting" "vote/like")
-                                               (button-item :trope-like "Skip" "vote/skip")
-                                               ]
-                                              ]
-                                             )
-                                           [:div {:id "trope-list-container"}
-                                            [:p "Selected items: "]
-                                            [:ul
-                                             (for [trope (:like-list @state)]
-                                               [:li (process-trope trope)])
-                                             ]
-                                            ]
-                                           ]
-                                          :else "Nope"
+       (condp = (session/get :page)
+         :home [:div
+                [:input {:type     "button"
+                         :value    "Graph!"
+                         :on-click #(redraw-graph (:trope-code @form-data))}]
+                [:div {:id "graph-container"}]]
+         :tropes [:div
+                  [:input {:type     "button"
+                           :value    "Retrieve references"
+                           :on-click #(list-tropes (:trope-code @form-data))}]
+                  [:div {:id "current-trope"}
+                   [:h2 {:class "trope-title"} (get-in @state [:current-trope :title])]
+                   [:p (get-in @state [:current-trope :description])]]
+                  [:div {:id "current-piece"}
+                   [:h3 "Random reference"]
+                   [:p (process-trope (:current-piece @state))]
+                   (if (:current-piece @state)
+                     [:div [:span (str "(" (count (:tropes @state)) " remaining)")]]
+
+                     [:div {:class "trope-vote"}
+                      [:ul
+                       (button-item "Interesting" "vote/like")
+                       (button-item "Skip" "vote/skip")]]
+                     )
+                   [:div {:id "trope-list-container"}
+                    [:p "Selected items: "]
+                    [:ul
+                     (for [trope (:like-list @state)]
+                       [:li (process-trope trope)])]]
+                   ]]
+
          )])
     ))


clojure: TODO comment added on morphism function

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -134,6 +134,7 @@
             :else
             (let [nv (Morphism/neighborVectors a)
                   nw (Morphism/neighborVectors b)]
+              ;; TODO this does not work with next-nearest neighbor collisions
               (recur (assoc src2img a b)
                      (into (pop q)
                            (for [d (keys nv)


set HTTP timeout based on environment; increase default.

--- src/ancient_clj/io/http.clj
+++ src/ancient_clj/io/http.clj
@@ -13,12 +13,25 @@
 (def ^:private valid-content-types
   #{"text/xml" "application/xml"})

+(defn- base-opts
+  []
+  {:timeout
+   (if-let [v (System/getenv "http_timeout")]
+     (if (not= v "0")
+       (Long/parseLong v)
+       (* 60 60 1000))
+     (if (some
+           #(System/getenv %)
+           ["http_proxy" "https_proxy"])
+       30000
+       5000))
+   :as :text})
+
 (defn http-loader
   "Create version loader for a HTTP repository."
   [repository-uri & [{:keys [username passphrase]}]]
   (let [opts (merge
-               {:timeout 3000
-                :as :text}
+               (base-opts)
                (when (string? username)
                  {:basic-auth [username passphrase]}))]
     (fn [group id]


Backwards compatibility functions for generating URLs

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -73,6 +73,10 @@
   (defroute v1-org-settings "/gh/organizations/:org/settings"
     [org _fragment]
     (open-to-inner! nav-ch :org-settings {:org org :subpage (keyword _fragment)}))
+  (defn v1-org-settings-subpage [params]
+    (apply str (v1-org-settings params)
+         (when-let [subpage (:subpage params)]
+           ["#" subpage])))
   (defroute v1-org-dashboard-alternative "/gh/organizations/:org" {:as params}
     (open-to-inner! nav-ch :dashboard params))
   (defroute v1-org-dashboard "/gh/:org" {:as params}
@@ -94,6 +98,10 @@
                                               :subpage (keyword _fragment)
                                               :org org
                                               :repo repo}))
+  (defn v1-project-settings-subpage [params]
+    (apply str (v1-project-settings params)
+           (when-let [subpage (:subpage params)]
+             ["#" subpage])))
   (defroute v1-add-projects "/add-projects" []
     (open-to-inner! nav-ch :add-projects {}))
   (defroute v1-invite-teammates "/invite-teammates" []


Fixing how we shell out for gcc4

Fixing how we shell out for gcc4

--- config/software/gecode.clj
+++ config/software/gecode.clj
@@ -17,7 +17,7 @@
 ;;

 (let
-  [env (if (= 0 (get (clojure.java.shell/sh "test" :args [ "-f" "/usr/bin/gcc44" ] :return-map true) :exit))
+  [env (if (= 0 (get (clojure.java.shell/sh "test" "-f" "/usr/bin/gcc44") :exit))
          { "CC" "gcc44" "CXX" "g++44" }
          { })]


simplify selector function arguments

simplify selector function arguments

--- src/chessground/common.cljs
+++ src/chessground/common.cljs
@@ -17,12 +17,12 @@

 (defn has-class [dom-element class] (.contains (.-classList dom-element) class))

-(defn $ [selector & [context]]
+(defn $ [selector context]
   (if context
     (.querySelector context selector)
     (.querySelector js/document selector)))

-(defn $$ [selector & [context]]
+(defn $$ [selector context]
   (if context
     (.querySelectorAll context selector)
     (.querySelectorAll js/document selector)))


Removed extra comments and dependencies from io.

--- src/clj/forma/hadoop/io.clj
+++ src/clj/forma/hadoop/io.clj
@@ -6,7 +6,6 @@

 (ns forma.hadoop.io
   (:use cascalog.api
-        [clojure.contrib.def :only (defnk)]
         [clojure.string :only (join)]
         [cascalog.tap :only (hfs-tap)])
   (:require [forma.source.modis :as m]
@@ -21,8 +20,6 @@
             ModisPixelLocation ModisChunkLocation]
            [java.util ArrayList]
            [cascading.tuple Fields]
-           [cascading.scheme Scheme]
-           [cascading.tap TemplateTap SinkMode GlobHfs]
            [org.apache.hadoop.io BytesWritable]))

 ;; ## Custom File Input
@@ -100,61 +97,21 @@
   will be returned as 2-tuples, formatted as `<filename, file>` The
   filename is a text object, while the entire, unchopped file is
   encoded as a Hadoop `BytesWritable` object."
-  [path & {:keys [outfields] :or {outfields Fields/ALL} :as opts}]
-  (let [opts (apply concat opts)
-        scheme (whole-file outfields)]
+  [path & opts]
+  (let [scheme (-> (:outfields opts Fields/ALL)
+                   (whole-file))]
     (apply hfs-tap scheme path opts)))

-;; ## Backend Data Processing Queries
-;;
-;; The following cascalog queries provide us with a way to process raw
-;; input files into bins based on various datafields, and read them
-;; back out again into a hadoop cluster for later analysis.
-;;
-;; ### Data to Bucket
-;;
-;; The idea of this portion of the project is to process all input
-;; data into chunks in of data MODIS sinusoidal projection, tagged
-;; with metadata to identify the chunk's position and spatial and
-;; temporal resolutions. We sink these tuples into Hadoop
-;; SequenceFiles binned into a custom directory structure on S3,
-;; designed to facilitate easy access to subsets of the data. The
-;; data bins are formatted as:
-;;
-;;     s3n://<dataset>/<s-res>-<t-res>/<tileid>/<jobtag>/seqfile
-;;     ex: s3n://ndvi/1000-32/008006/20110226T234402Z/part-00000
-;;
-;; `s-res` is the spatial resolution of the data, limited to `1000`,
-;; `500`, and `250`. `t-res` is the temporal resolution, keyed to the
-;; MODIS system of monthly, 16-day, or 8-day periods (`t-res` = `32`,
-;; `16` or `8`). `tileid` is the MODIS horizontal and vertical tile
-;; location, formatted as `HHHVVV`.
-;;
-;; As discussed in [this thread](http://goo.gl/jV4ut) on
-;; cascading-user, Hadoop can't append to existing
-;; SequenceFiles. Rather than read in every file, append, and write
-;; back out, we decided to bucket our processed chunks by
-;; `jobid`. This is the date and time, down to seconds, at which the
-;; run was completed. The first run we complete will be quite large,
-;; containing over 100 time periods. Subsequent runs will be monthly,
-;; and will be quite small. On a yearly basis, we plan to read in all
-;; tuples from every `jobid` directory, and bin them into a new
-;;`jobid`. This is to limit the number of small files in the sytem.
-;;
-;; Note that the other way to combat the no-append issue would have
-;; been to sink tuples into a deeper directory structure, based on
-;; date. The downside here is that every sequencefile would be 5MB, at
-;; 1km resolution. Hadoop becomes efficient when mappers are allowed
-;;to deal with splits of 64MB. By keeping our sequencefiles large, we
-;;take advantage of this property.
-
-;; ### Bucket to Cluster
+;; ## Bucket to Cluster
 ;;
 ;; To get tuples back out of our directory structure on S3, we employ
 ;; Cascading's [GlobHFS] (http://goo.gl/1Vwdo) tap, along with an
 ;; interface tailored for datasets stored in the MODIS sinusoidal
 ;; projection. For details on the globbing syntax, see
 ;; [here](http://goo.gl/uIEzu).
+;;
+;; GlobHfs is activated through the `:source-pattern` argument to one
+;; of the hfs- taps.

 (defn tiles->globstring
   [& tiles]
@@ -182,32 +139,6 @@
                     (coll? x) (format "{%s}" (join "," x))
                     :else x)))
        (join "/")))
-
-(defn chunk-tap
-  "Generalized source and sink for the chunk tuples stored and
-  processed by the FORMA system. The source is a cascading tap that
-  sinks MODIS tuples into a directory structure based on dataset,
-  temporal and spatial resolution, tileid, and a custom `jobtag`. The
-  `chunk-tap`source makes use of Cascading's
-  [TemplateTap](http://goo.gl/txP2a).
-
-  The sink makes use of `hfs-seqfile`'s `:source-pattern` argument to
-  draw tuples back out of the directory structure using a globstring
-  constructed out of the supplied basepath and collections of
-  datasets, resolutions, tiles and specific data runs, identified by
-  jobtag."
-  ([out-dir]
-     (chunk-tap out-dir "%s/%s-%s/%s/"))
-  ([out-dir pattern]
-     (hfs-seqfile out-dir :sink-template (str pattern (date/jobtag) "/")))
-  ([basepath datasets resolutions]
-     (chunk-tap basepath datasets resolutions * *))
-  ([basepath datasets resolutions tiles]
-     (chunk-tap basepath datasets resolutions tiles *))
-  ([basepath datasets resolutions tiles batches]
-     (hfs-seqfile basepath :source-pattern (globstring datasets
-                                                       resolutions
-                                                       tiles batches *))))

 ;; ## BytesWritable Interaction
 ;;


indent

indent

--- src/clj/just_married/db.clj
+++ src/clj/just_married/db.clj
@@ -65,7 +65,7 @@
   ;; if the email address is not available then how do we
   ;; link it directly to the right person?
   (let [person-id
-        (or (get-person! email)
+          (or (get-person! email)
             (add-person! name email))]

     (add-confirmation! person-id coming)))


Run database migrators at application startup.

--- src/clj_codetip/handler.clj
+++ src/clj_codetip/handler.clj
@@ -10,6 +10,8 @@
             [compojure.core :refer [defroutes ANY GET POST]]
             [compojure.route :as route]
             [environ.core :refer [env]]
+            [joplin.core :as joplin]
+            [joplin.jdbc.database]
             [clj-time.core :as t]
             [clj-codetip.database :as db]
             [clj-codetip.view :as view]
@@ -85,6 +87,10 @@
    Schedule unexpired paste deletes and delete expired pastes."
   [db-spec]
   (let [now (t/now)]
+    (joplin/migrate-db
+     {:db {:type :jdbc
+           :url (:connection-uri db-spec)}
+      :migrator "migrators/sql"})
     (db/schedule-unexpired-deletes db-spec now)
     (db/delete-expired-pastes! db-spec now)))


handle validation errors

handle validation errors

--- src/clj_money/web/users.clj
+++ src/clj_money/web/users.clj
@@ -1,7 +1,8 @@
 (ns clj-money.web.users
   (:require [hiccup.core :refer :all]
             [hiccup.page :refer :all]
-            [clojure.tools.logging :as log])
+            [clojure.tools.logging :as log]
+            [ring.util.response :refer :all])
   (:use [clj-money.web.shared]
         [clj-money.models.users :as users]))

@@ -24,9 +25,8 @@
 (defn create-user
   "Creates the user, redirects on success"
   [params]
-  (let [validated (validate-user params)]
-    (if (seq (:errors validate))
-      (new-user validated)
-      (do
-        (users/create (env :db) validated)
-        (redirect "/")))))
+  (try
+    (new-user params)
+    (redirect "/")
+    (catch clojure.lang.ExceptionInfo e
+      (new-user (merge params (ex-data e))))))


Only store events with an intent in history

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -299,10 +299,11 @@
         context         (merge additional-context api {:dato dato
                                                        :ss   ss})
         update-history! (fn [tx-report]
-                          (swap! history update-in [:log] conj {:tx/intent     (get-in tx-report [:tx-meta :tx/intent])
-                                                                :time          (js/Date.)
-                                                                :tx            tx-report
-                                                                :tx/transient? (get-in tx-report [:tx-meta :tx/transient?])}))]
+                          (when (get-in tx-report [:tx-meta :tx/intent])
+                            (swap! history update-in [:log] conj {:tx/intent     (get-in tx-report [:tx-meta :tx/intent])
+                                                                  :time          (js/Date.)
+                                                                  :tx            tx-report
+                                                                  :tx/transient? (get-in tx-report [:tx-meta :tx/transient?])})))]
     ;; XXX: Uneasy with:
     ;; 1. Hard-coding history-listener here (what about other plugins?)
     ;; 2. Transactions needing history-listener-specific metadata (plugging it in now becomes difficult)


Disallow freed owls from colliding with the player and killing her

--- src/cljs/kindness/game.cljs
+++ src/cljs/kindness/game.cljs
@@ -366,29 +366,33 @@
   (let [[[x1 y1] [x2 y2]] (map object-center [e1 e2])
         proximity (Math/sqrt (+ (Math/pow (- x1 x2) 2)
                    (Math/pow (- y1 y2) 2)))]
-    ;; (println "obect centers:" (map object-center [e1 e2]) "proximity:" proximity "min:" minimum)
+    ;; (println "object centers:" (map object-center [e1 e2]) "proximity:" proximity "min:" minimum)
     (<= proximity minimum)))

 (defn collide?
   [a b]
   (let [both [a b]
+        boundables (map (partial utils/find-component :boundable) both)
         [[x1 y1 w1 h1] [x2 y2 w2 h2]] (map utils/position-and-bounds both)]
-    (or (tap-print
-         "top-right"
-         (and (<= x1 x2 (+ x1 w1))
-              (<= y2 y1 (+ y2 h2))))
-        (tap-print
-         "bottom-right"
-         (and (<= x1 x2 (+ x1 w1))
-              (<= y1 y2 (+ y1 h1))))
-        (tap-print
-         "bottom-left"
-         (and (<= x2 x1 (+ x2 w2))
-              (<= y1 y2 (+ y1 h1))))
-        (tap-print
-         "top-left"
-         (and (<= x2 x1 (+ x2 w2))
-              (<= y2 y1 (+ y2 h2)))))))
+    ;; nobody can collide with
+    ;; an entity that doesn't have bounds
+    (and (seq (filter identity boundables))
+         (or (tap-print
+              "top-right"
+              (and (<= x1 x2 (+ x1 w1))
+                   (<= y2 y1 (+ y2 h2))))
+             (tap-print
+              "bottom-right"
+              (and (<= x1 x2 (+ x1 w1))
+                   (<= y1 y2 (+ y1 h1))))
+             (tap-print
+              "bottom-left"
+              (and (<= x2 x1 (+ x2 w2))
+                   (<= y1 y2 (+ y1 h1))))
+             (tap-print
+              "top-left"
+              (and (<= x2 x1 (+ x2 w2))
+                   (<= y2 y1 (+ y2 h2))))))))

 (defn collision?
   [entity others]
@@ -464,7 +468,9 @@

 (defn trigger-entity!
   [entity]
-  (replace-entity (assoc-in entity [:components :movable :velocity] [0 -0.5])))
+  (replace-entity (-> entity
+                      (update-in [:components] dissoc :boundable :weaponised)
+                      (assoc-in [:components :movable :velocity] [0 -0.5]))))

 (defn try-activate!
   []


remove namespace from symbol search keys (close #58)

--- src/cljs_api_gen/docset.clj
+++ src/cljs_api_gen/docset.clj
@@ -88,7 +88,7 @@
                            (slurp ref-file)))
                 full-name (decode-fullname encoded-name)
                 item (get syms full-name)]
-            {:name full-name
+            {:name (:name item)
              :type (type->dash (:type item))
              :path (resolve-path "refs/" encoded-name ".html")}
             ))))


Removes unused code.

Removes unused code.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -281,14 +281,6 @@
       :else
       (c/assertion-violation `clause-lens "not a valid clause" clause))))

-;; (def binding-lens
-;;   "Returns a function that when applied to a clause, returns a lens focusing on
-;;   the binding of the clause."
-;;   (clause-lens key-matches-with-binding-clause-binding
-;;                path-matches-with-binding-clause-binding
-;;                key-exists-with-binding-clause-binding
-;;                path-exists-with-binding-clause-binding))
-
 (def matcher-lens
   "Returns a function that when applied to a clause, returns a lens focusing on
   the matcher of the clause."
@@ -308,12 +300,6 @@
                key-exists-with-binding-clause-key
                key-exists-without-binding-clause-key
                path-exists-with-binding-clause-path))
-
-;; (defn bind-match
-;;   "Takes a clause and replaces it's binding with `binding`."
-;;   [clause binding]
-;;   {:pre [(and (clause? clause) (symbol? binding))]}
-;;   (lens/shove clause (binding-lens clause) binding))

 ;;;; Parse
 ;; Translate pattern expressions for `active.clojure.match` to clauses


Add unary analysis/conversion

Add unary analysis/conversion

--- src/angelic/sas/analysis.clj
+++ src/angelic/sas/analysis.clj
@@ -3,7 +3,7 @@
             [edu.berkeley.ai.util [queues :as queues] [graphviz :as gv] [graphs :as graphs]]
             [angelic [sas :as sas] [env :as env]]
             [angelic.env.util :as env-util])
-  (:import [java.util HashMap HashSet]))
+  (:import [java.util HashMap HashSet ArrayList]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;; Causal graphs, DTGS, etc.          ;;;;;;;;;;;;;;;;;;;;;;;;
@@ -43,8 +43,7 @@
 (defn standard-causal-graph
   "Return an edge list for a standard causal graph of the problem."
   [sas-problem]
-  (let [vars    (:vars sas-problem)
-        actions (:actions sas-problem)]
+  (let [actions (:actions sas-problem)]
     (distinct
      (for [action actions
            precondition (concat (:precond-map action) (:effect-map action))
@@ -128,6 +127,48 @@
        (util/assert-is (apply = #{var} (map (comp util/keyset :effect-map) actions)))
        (apply = (map (comp util/keyset :precond-map) actions))))
    (domain-transition-graphs sas-problem)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;             Homogeneity            ;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn degree [sas-problem]
+  (reduce max (map #(count (:effect-map %)) (:actions sas-problem))))
+
+(defn unary? [sas-problem] (<= (degree sas-problem) 1))
+
+;; TODO: do we have to lock preconds ?
+(defn unarize [sas-problem]
+  (let [{:keys [ vars init actions]} sas-problem
+        cg-edges    (standard-causal-graph sas-problem)
+        dep-graph   (graphs/make-undirected-graph
+                     (util/keyset vars)
+                     (into {} (for [e cg-edges :when (not (apply = e))] [(set e) 1])))
+        goal-distances (into {} (for [[e c] (:edges (graphs/shortest-path-graph dep-graph))
+                                      :when (contains? e sas/goal-var-name)]
+                                  [(first (disj e sas/goal-var-name)) c]))
+        final-var-vals (HashMap. (util/map-vals (comp vec :vals) vars))
+        final-actions  (ArrayList.)]
+    (doseq [a actions]
+      (let [{:keys [name precond-map effect-map reward]} a]
+        (case (count effect-map)
+          1 (.add final-actions a)
+          2 (let [primary-evar (apply max-key goal-distances (keys effect-map))
+                  primary-eval (util/safe-get effect-map primary-evar)
+                  other-evar   (util/safe-singleton (keys (dissoc effect-map primary-evar)))
+                  other-eval   (util/safe-get effect-map other-evar)
+                  new-val      [:doing name]]
+              (.put final-var-vals primary-evar (conj (.get final-var-vals primary-evar) new-val))
+              (.add final-actions (env-util/make-factored-primitive
+                                   [:start name] precond-map {primary-evar new-val} reward))
+              (.add final-actions (env-util/make-factored-primitive
+                                   [:aux name] {primary-evar new-val other-evar (util/safe-get precond-map other-evar)} {other-evar other-eval} 0))
+              (.add final-actions (env-util/make-factored-primitive
+                                   [:finish name] {primary-evar new-val other-evar other-eval} {primary-evar primary-eval} 0))))))
+    (sas/make-sas-problem
+     (into {} (for [[k v] final-var-vals] [k (sas/make-sas-var k v)]))
+     init
+     (seq final-actions))))
+
+

 ;(defn homogenize [sas-problem]
 ;  )


Removes unused lenses.

Removes unused lenses.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -399,46 +399,6 @@
       :else
       (c/assertion-violation `clause-lens "not a valid clause" clause))))

-(def matcher-lens
-  "Returns a function that when applied to a clause, returns a lens focusing on
-  the matcher of the clause."
-  (clause-lens key-exists-without-binding-clause-matcher
-               key-exists-with-binding-clause-matcher
-               optional-key-exists-without-binding-clause-matcher
-               optional-key-exists-with-binding-clause-matcher
-               path-exists-without-binding-clause-matcher
-               path-exists-with-binding-clause-matcher
-               optional-path-exists-without-binding-clause-matcher
-               optional-path-exists-with-binding-clause-matcher
-               key-matches-without-binding-clause-matcher
-               key-matches-with-binding-clause-matcher
-               optional-key-matches-without-binding-clause-matcher
-               optional-key-matches-with-binding-clause-matcher
-               path-matches-without-binding-clause-matcher
-               path-matches-with-binding-clause-matcher
-               optional-path-matches-without-binding-clause-matcher
-               optional-path-matches-with-binding-clause-matcher))
-
-(def path-lens
-  "Returns a function that when applied to a clause, returns a lens focusing on
-  the path of the clause."
-  (clause-lens key-exists-without-binding-clause-key
-               key-exists-with-binding-clause-key
-               optional-key-exists-without-binding-clause-key
-               optional-key-exists-with-binding-clause-key
-               path-exists-without-binding-clause-path
-               path-exists-with-binding-clause-path
-               optional-path-exists-without-binding-clause-path
-               optional-path-exists-with-binding-clause-path
-               key-matches-without-binding-clause-key
-               key-matches-with-binding-clause-key
-               optional-key-matches-without-binding-clause-key
-               optional-key-matches-with-binding-clause-key
-               path-matches-without-binding-clause-path
-               path-matches-with-binding-clause-path
-               optional-path-matches-without-binding-clause-path
-               optional-path-matches-with-binding-clause-path))
-
 ;;;; Parse
 ;; Translate pattern expressions for `active.clojure.match` to clauses


[#1077] Switch lat/long order in bounding box (with @kardan)

--- backend/src/akvo/lumen/lib/visualisation/map_metadata.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_metadata.clj
@@ -9,8 +9,8 @@
         [left right] (str/split box-string #",")
         [west south] (str/split left #" ")
         [east north] (str/split right #" ")]
-    [[(Double/parseDouble west) (Double/parseDouble south)]
-     [(Double/parseDouble east) (Double/parseDouble north)]]))
+    [[(Double/parseDouble south) (Double/parseDouble west)]
+     [(Double/parseDouble north) (Double/parseDouble east)]]))

 (defn bounds [tenant-conn table-name geom-column where-clause]
   (-> (jdbc/query tenant-conn


Eagerly convert child components to renderers

--- src/ashiba/ui_component.cljs
+++ src/ashiba/ui_component.cljs
@@ -54,6 +54,11 @@
           sorted-keys (dep/topo-sort graph)]
       (:main (resolved-system components sorted-keys)))))

+(defn component->renderer [parent component]
+  (renderer (-> component
+                (assoc :commands-chan (:commands-chan parent))
+                (assoc :url-fn (or (:url-fn component) (:url-fn parent))))))
+
 (defprotocol IUIComponent
   (url [this params])
   (subscription [this name])
@@ -69,14 +74,15 @@
   (subscription [this name]
     (get-in this [:subscriptions name]))
   (component [this name]
-    (let [component (get-in this [:components name])]
-      (renderer (-> component
-                    (assoc :commands-chan (:commands-chan this))
-                    (assoc :url-fn (or (:url-fn component) (:url-fn this)))))))
+    (get-in this [:components name]))
   (send-command [this command args]
     (put! (:commands-chan this) [[(:topic this) command] args]))
   (renderer [this]
-    (partial (:renderer this) this)))
+    (let [child-components (:components this)
+          child-renderers (reduce-kv (fn [c k v]
+                                       (assoc c k (component->renderer this v)))
+                                     child-components child-components)]
+      (partial (:renderer this) (assoc this :components child-renderers)))))

 (defrecord UIComponent [component-deps subscription-deps renderer]
   IUIComponent)


Use cljs.build.api

Use cljs.build.api

--- src/adzerk/boot_cljs/impl.clj
+++ src/adzerk/boot_cljs/impl.clj
@@ -5,13 +5,8 @@
     [boot.kahnsort   :as kahn]
     [boot.file       :as file]
     [cljs.env        :as env]
-    [cljs.closure    :as cljs]
-    [cljs.analyzer   :as ana]))
-
-(defrecord CljsSourcePaths [paths]
-  cljs/Compilable
-  (-compile [this opts]
-    (mapcat #(cljs/-compile % opts) paths)))
+    [cljs.analyzer   :as ana]
+    [cljs.build.api  :as build]))

 (def ^:private stored-env (atom nil))

@@ -55,7 +50,7 @@
                           (swap! counter inc))))]
     (ana/with-warning-handlers handler
       (binding [env/*compiler* (cljs-env opts)]
-        (cljs/build (CljsSourcePaths. (filter #(.exists (io/file %)) src-paths)) opts)
+        (build/build (apply build/inputs (filter #(.exists (io/file %)) src-paths)) opts)
         (reset! stored-env env/*compiler*)
         {:warnings  @counter
          :dep-order (dep-order @env/*compiler* opts)}))))


Reworking Force Layout

Reworking Force Layout

again. And it still doesn't work as expected...

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

--- src/conexp/layout/force.clj
+++ src/conexp/layout/force.clj
@@ -110,7 +110,8 @@
 	   case-2 (cond
 		   F_4          (nth (unit-vector [x y] [x_2 y_2]) part),
 		   (or F_5 F_7) (nth (unit-vector [x_2 y_2] [x y]) part))
-	   case-3 (let [[x_b, y_b] [(+ x_1 (* r (- x_2 x_1))), (+ y_1 (* r (- y_2 y_1)))], ; projection of [x y]
+	   case-3 (let [;; projection of [x y] on line [[x_1 y_1] [x_2 y_2]]
+			[x_b, y_b] [(+ x_1 (* r (- x_2 x_1))), (+ y_1 (* r (- y_2 y_1)))],
 			normal (unit-vector [x_b y_b] [x y])]
 		    (cond
 		     F_3 (* (Math/sqrt (/ (- (line-length-squared [x y] [x_2 y_2])
@@ -130,17 +131,17 @@
   "Computes given part of repulsive force in layout on the
   inf-irreducible element n_i."
   [[node-positions node-connections] n_i part information]
-  (sum [v (keys node-positions),
+  (sum [v (keys node-positions)
+	:let [pos-v (node-positions v)],
 	[x y] node-connections,
-	:when (not (contains? #{x,y} v))]
-    (let [pos-v (node-positions v),
-	  pos-x (node-positions x),
-	  pos-y (node-positions y)]
-      (* (/ (square (node-line-distance pos-v [pos-x, pos-y])))
-	 (node-line-distance-derivative v [x, y]
+	:when (not (contains? #{x,y} v)),
+	:let [pos-x (node-positions x),
+	      pos-y (node-positions y)]]
+      (/ (node-line-distance-derivative v [x, y]
 					pos-v [pos-x, pos-y]
 					n_i part
-					(:order information))))))
+					(:order information))
+	 (square (node-line-distance pos-v [pos-x, pos-y])))))

 ;; Attractive Energy and Force
@@ -161,7 +162,7 @@
     (* 2 (sum [[v_1 v_2] edges,
 	       :when (and (order [v_1 n_i])
 			  (not (order [v_2 n_i])))]
-	      (- (nth (pos v_2) part) (nth (pos v_1) part))))))
+	    (- (nth (pos v_2) part) (nth (pos v_1) part))))))

 ;; Gravitative Energy and Force
@@ -179,14 +180,14 @@
   [[node-positions node-connections] information]
   (let [inf-irrs (:inf-irrs information),
 	upper-neighbours (:upper-neighbours-of-inf-irrs information),
-
-	phi_0 (double (/ Math/PI (+ 1 (count inf-irrs)))),
+	phi_0 (:phi_0 information),
+
 	E_0   (double (+ (- phi_0) (- (* (Math/sin phi_0) (Math/cos phi_0))))),
 	E_1   (double (+ E_0 Math/PI))]
     (try
-     (sum [n inf-irrs]
-       (let [phi_n (double (phi (node-positions n)
-				(node-positions (upper-neighbours n))))]
+     (sum [n inf-irrs,
+	   :let [phi_n (double (phi (node-positions n)
+				(node-positions (upper-neighbours n))))]]
 	 (cond
 	  (<= 0 phi_n phi_0)
 	  (+ phi_n
@@ -200,7 +201,7 @@
 		(Math/tan phi_n))
 	     E_1),

-	  :else 0)))
+	  :else 0))
      (catch Exception e
        Double/POSITIVE_INFINITY))))

@@ -209,7 +210,7 @@
   inf-irreducible element n_i."
   [layout n_i part information]
   (let [upper-neighbours (:upper-neighbours-of-inf-irrs information),
-	inf-irrs (:inf-irrs information),
+	phi_0 (:phi_0 information),
 	positions (first layout),

 	pos-n_i (positions n_i),
@@ -218,8 +219,7 @@
 		   (- (second pos-u_i) (second pos-n_i))]
 	edge-rot [(- y_e), x_e],	; rotated edge from n_i to u_i

-	phi_n_i (double (phi pos-n_i pos-u_i)),
-	phi_0 (double (/ Math/PI (+ 1 (count inf-irrs))))]
+	phi_n_i (double (phi pos-n_i pos-u_i))]
     (cond
      (<= 0 phi_n_i phi_0)
      (* (nth edge-rot part)
@@ -261,49 +261,39 @@
 	(* *attractive-amount* (attractive-force layout n_i part information))
 	(* *gravitative-amount* (gravitative-force layout n_i part information))))))

+;;
+
 (defn- energy-by-inf-irr-positions
-  "Returns a function calculating the energy of an attribute additive
-  layout of lattice given by the positions of the infimum irreducible
-  elements. seq-of-inf-irrs gives the order of the infimum irreducible
-  elements."
-  [lattice seq-of-inf-irrs]
-  (let [information {:upper-neighbours-of-inf-irrs
-		     (hashmap-by-function (fn [n]
-					    (first (lattice-upper-neighbours lattice n)))
-					  seq-of-inf-irrs),
-		     :inf-irrs seq-of-inf-irrs}]
-    (fn [& point-coordinates]
-      (let [points (partition 2 point-coordinates),
-	    inf-irr-placement (apply hash-map
-				     (interleave seq-of-inf-irrs
-						 points))]
-	(layout-energy (layout-by-placement lattice inf-irr-placement)
-		       information)))))
-
-(defn- neg-force-by-inf-irr-positions
-  "Returns a function representing the negative forces on the infimum
-  irreducible elements of lattice. The function returned takes as
-  input an index representing the coordinate to derive at and returns
-  itself a function from a placement of the inf-irreducible elements
-  to the force component given by the index. seq-of-inf-irrs gives the
-  order of the inf-irreducible elements."
+  "Returns pair of energy function and function returning n-th partial
+  derivative when given index n."
   [lattice seq-of-inf-irrs]
   (let [information {:upper-neighbours-of-inf-irrs
 		     (hashmap-by-function (fn [n]
 					    (first (lattice-upper-neighbours lattice n)))
 					  seq-of-inf-irrs),
 		     :inf-irrs seq-of-inf-irrs,
-		     :order (order lattice)}]
-    (fn [index]
-      (fn [& point-coordinates]
-	(let [points (partition 2 point-coordinates),
-	      inf-irr-placement (apply hash-map
-				       (interleave seq-of-inf-irrs
-						   points))]
-	  (- (layout-force (layout-by-placement lattice inf-irr-placement)
-			   seq-of-inf-irrs
-			   index
-			   information)))))))
+		     :order (order lattice),
+		     :phi_0 (double (/ Math/PI (+ 1 (count seq-of-inf-irrs))))},
+
+	energy   (fn [& point-coordinates]
+		   (let [points (partition 2 point-coordinates),
+			 inf-irr-placement (apply hash-map
+						  (interleave seq-of-inf-irrs
+							      points))]
+		     (layout-energy (layout-by-placement lattice inf-irr-placement)
+				    information))),
+
+	d-energy (fn [index]
+		   (fn [& point-coordinates]
+		     (let [points (partition 2 point-coordinates),
+			   inf-irr-placement (apply hash-map
+						    (interleave seq-of-inf-irrs
+								points))]
+		       (- (layout-force (layout-by-placement lattice inf-irr-placement)
+					seq-of-inf-irrs
+					index
+					information)))))]
+    [energy, d-energy]))

 ;;; Force Layout
@@ -326,10 +316,9 @@
 			    inf-irr-points),

 	;; minimize layout energy with above placement as initial value
-	energy         (energy-by-inf-irr-positions lattice inf-irrs),
-	neg-force          (neg-force-by-inf-irr-positions lattice inf-irrs),
+	[energy, neg-force] (energy-by-inf-irr-positions lattice inf-irrs),
 	[new-points, value] (minimize energy
-				      neg-force
+				      ;;neg-force
 				      (apply concat inf-irr-points)),

 	;; make hash
@@ -346,7 +335,6 @@
 						 [(+ x top-x), (+ y top-y)])
 					       (vals placement))))]

-    ;; (pprint placement)
     [placement connections]))


Perf test CLJS, confirmed activation groups work

--- src/clj/libx/perf_tuple.cljc
+++ src/clj/libx/perf_tuple.cljc
@@ -63,16 +63,17 @@
 (def activation-group-fn (util/make-activation-group-fn :normal))
 (def activation-group-sort-fn (util/make-activation-group-sort-fn groups :normal))

-;; TODO. Test activation groups w/ our macro in CLJ, CLJS
-;(def-tuple-session tuple-session
-;  'libx.perf-tuple)
+(def-tuple-session tuple-session
+  'libx.perf-tuple
+  :activation-group-fn activation-group-fn
+  :activation-group-sort-fn activation-group-sort-fn)

-(def tuple-session
-  (cr/mk-session 'libx.perf-tuple
-   :fact-type-fn :a
-   :ancestors-fn (fn [type] [:all])
-   :activation-group-fn activation-group-fn
-   :activation-group-sort-fn activation-group-sort-fn))
+;(def tuple-session
+;  (cr/mk-session 'libx.perf-tuple
+;   :fact-type-fn :a
+;   :ancestors-fn (fn [type] [:all])
+;   :activation-group-fn activation-group-fn
+;   :activation-group-sort-fn activation-group-sort-fn))

 (defn n-facts-session [n]
   (-> tuple-session
@@ -108,12 +109,12 @@
 ;; ~~~~~~~~~~~~~~~~~~NO AGENDA GROUPS~~~~~~~~~~~~~~~~~~~~~~~~~~
 ;; ~~~~~~~~~~~~~~~~~~add-item-cleanup NOT FIRING~~~~~~~~~~~~~~~
 ;; ~~~~No queries~~~~
-;; loop                47ms
+;; loop                 47ms
 ;; loading file       1776ms
 ;;
 ;; ~~~~Including queries in the session def~~~~
 ;; qav-
-;;     loop             47ms
+;;     loop              47ms
 ;;     loading file    2086ms
 ;;
 ;; entity-
@@ -123,4 +124,31 @@
 ;; ~~~~Tracing, new one every loop, no queries~~~~
 ;; loop                  74ms
 ;; loading file          22ms (wtf?)
+;;
+;; ~~~~~~~~~~~~~~~~~~AGENDA GROUPS~~~~~~~~~~~~~~~~~~~~~~~~~~
+;; ~~~~~~~~~~~~~~~~~~add-item-cleanup NOT FIRING~~~~~~~~~~~~~~~
+;; ~~~~No queries~~~~
+;; loop                 42ms
+;; loading file       4359ms
+;;
+;; ~~~~~~~~~~~~~~~~~~add-item-cleanup FIRING~~~~~~~~~~~~~~~
+;; ~~~~No queries~~~~
+;; loop                 70ms
+;; loading file       4446ms
+;;
+;;
+;;*********************************************************
+;;*********************************************************
+;; ~~~~~~~~~~~~~~~~~~~~~~ CLJS ~~~~~~~~~~~~~~~~~~~~~~~~~~~

+;; ~~~~~~~~~~~~~~~~~~AGENDA GROUPS~~~~~~~~~~~~~~~~~~~~~~~~~~
+;; ~~~~~~~~~~~~~~~~~~add-item-cleanup NOT FIRING~~~~~~~~~~~~~~~
+;; ~~~~No queries~~~~
+;; loop                137ms
+;; loading file      24388ms (bc :cache false in cljsbuild?)
+;
+;; ~~~~~~~~~~~~~~~~~~add-item-cleanup FIRING~~~~~~~~~~~~~~~
+;; ~~~~No queries~~~~
+;; loop                185ms
+;; loading file      21199ms (bc :cache false in cljsbuild?)
+


add duration-in-seconds

add duration-in-seconds

This is the reverse of human-duration.

--- src/clj/runbld/util/date.clj
+++ src/clj/runbld/util/date.clj
@@ -3,7 +3,8 @@
             [clj-time.core :as t]
             [clj-time.format :as f]
             [clojure.string :as str]
-            [slingshot.slingshot :refer [throw+]]))
+            [slingshot.slingshot :refer [throw+]])
+  (:import [org.joda.time Period]))

 (defn now []
   (t/now))
@@ -55,6 +56,9 @@
 ;; Thanks Devin Humbert!
 ;; https://www.cromulentbits.com/clojure-readable-time-duration/
 (defn human-duration
+  "Takes a number of seconds and returns a human readable version of
+  the duration.  e.g. 1232352 -> '14d 6h 19m 12s'.  Currently only
+  handles up to a granularity in days."
   [secs]
   (let [isecs (int secs)
         days (quot isecs 86400)
@@ -71,3 +75,25 @@
                    (when (> hours 0) (str hours "h"))
                    (when (> minutes 0) (str minutes "m"))
                    (str seconds "s"))))))
+
+(defn duration-in-seconds
+  "This is the other side of 'human-duration' and will convert output
+  like '14d 6h 19m 12s' to 1232352.  It handles granularity up to
+  daily (again, like 'human-duration')"
+  [duration-str]
+  (-> duration-str
+      str/lower-case
+      (str/replace #"\s" "")
+      (str/replace #"^([0-9]+d)?(.*)$"
+                   (fn [[_ p t]]
+                     (format "P%s%s"
+                             (if-not (empty? p)
+                               p
+                               "")
+                             (if-not (empty? t)
+                               (str "T" t)
+                               ""))))
+      (Period/parse)
+      (.toStandardDuration)
+      (.getMillis)
+      (/ 1000)))


Remove unneeded middleware

Remove unneeded middleware

--- src/clj_crud/system/ring.clj
+++ src/clj_crud/system/ring.clj
@@ -46,23 +46,6 @@
       (response/redirect (subs uri 0 (dec (count uri))))
       (handler req))))

-(defn wrap-form-request-method [handler]
-  ;; browser only do get and post, fake through post when a form/query
-  ;; has _method=put hidden input
-  (fn [req]
-    (let [rm (get-in req [:params :_method])]
-      (if-let [action (get {"put" :put
-                            "delete" :delete} rm)]
-        (let [res (handler (-> req
-                               (assoc :request-method action)
-                               (assoc :original-request-method rm)))]
-          (if (and (= 204 (:status res))
-                   (get-in res [:headers "Location"]))
-            ;; to enact redirects for put and delete fake them back to post 303's
-            (assoc res :status 303)
-            res))
-        (handler req)))))
-
 (defn wrap-accept-uri [handler]
   ;; when uri ends with .json / .edn then use that for accept header
   (fn [{:keys [uri] :as req}]
@@ -101,7 +84,6 @@

 (defn wrap-common [handler]
   (let [handler (-> handler
-                    wrap-form-request-method
                     ;; anti-forgery-token is set on response, for
                     ;; auto-templating we want it available through
                     ;; the request


fixed removing when previous node is a text node

--- src/cljs/slice/document.cljs
+++ src/cljs/slice/document.cljs
@@ -47,11 +47,15 @@

 (defn protected [zipper f]
   (let [new-zipper (f zipper)]
-    (if (and new-zipper (zip/branch? new-zipper))
-      new-zipper
-      (do
-        (u/log "protection error")
-        zipper))))
+    (cond
+     (nil? new-zipper) (do
+                         (u/log "protection error")
+                         zipper)
+     (zip/branch? new-zipper) new-zipper
+     (string? (zip/node new-zipper)) (zip/up new-zipper)
+     :else (do
+             (u/log "something is wrong")
+             zipper))))

 (defn edit-protected [zipper f & args]
   (if (zip/branch? zipper)


We're getting flag values!

We're getting flag values!

--- src/com/lemonodor/gflags.clj
+++ src/com/lemonodor/gflags.clj
@@ -5,21 +5,43 @@
    [com.lemonodor.getopt :as getopt]))

+(defn set-flag-value [flag value-string]
+  (assoc flag
+    :value ((:parser flag) value-string)
+    :present true))
+
+
 (defprotocol FlagValuesProtocol
   (register-flag [this flag ns])
+  (update-flag-values [this optlist])
   (flag-map [this]))
+
+
+
+(defn flag-name [optname]
+  (let [[_ name] (re-matches #"--?(.+)" optname)]
+    name))

 (defrecord FlagValues [__flags __flags_by_ns]
   FlagValuesProtocol
   (register-flag [this flag ns]
-    (let [flags-by-ns (:__flags_by_ns this)
-          name-entries (if (:short-name flag)
-                         {(:short-name flag) flag
-                          (:name flag) flag}
-                         {(:name flag) flag})]
+    ;; We set the flag's value to be its default here (but it's still
+    ;; not considered present).
+    (let [flag (atom (assoc flag :value (:default flag)))
+          flags-by-ns (:__flags_by_ns this)
+          name-entries (if (:short-name @flag)
+                         {(:short-name @flag) flag
+                          (:name @flag) flag}
+                         {(:name @flag) flag})]
       (->FlagValues (merge (:__flags this) name-entries)
                     (assoc flags-by-ns ns (conj (flags-by-ns ns) flag)))))
+  (update-flag-values [this optlist]
+    (doseq [[optname value-string] optlist]
+      (let [name (flag-name optname)]
+        (pr "updating flag" name ((:__flags this) name))
+        (swap! ((:__flags this) name) set-flag-value value-string)))
+    this)
   (flag-map [this]
     (:__flags this)))

@@ -38,7 +60,7 @@
 ;; values without actually creating a map, right?
 (defn flags
   ([values] (into {}
-                  (for [[name flag] (:__flags @values)] [name (:value flag)])))
+                  (for [[name flag] (:__flags @values)] [name (:value @flag)])))
   ([] (flags *flags*)))

 (defrecord Flag
@@ -63,6 +85,7 @@

 (defn define-flag [flagvalues flag ns]
   (swap! flagvalues register-flag flag ns))
+

 (defn define [parser name default help serializer & args]
   (define-flag
@@ -91,6 +114,7 @@
      :else
      (throw (Exception. (str "Non boolean argument to boolean flag: " argument))))))

+
 (defn define-boolean [name default help & args]
   (apply define boolean-parser name default
          (or help "a boolean value")
@@ -115,4 +139,5 @@
            [optlist, unparsed-args] (getopt/getopt args shortopts longopts)]
        (prn "optlist returned by getopt" optlist)
        (prn "unparsed args returned by getopt" unparsed-args)
+       (swap! flagvalues update-flag-values optlist)
        unparsed-args)))


calculating sending satoshis!

calculating sending satoshis!

--- src/bitsplit_cli/client.cljs
+++ src/bitsplit_cli/client.cljs
@@ -18,8 +18,8 @@
                             (into-array args))))))))

 (defn account->amount [account]
-    {"address" (.getAddress account)
-     "amount" (-> account .balance js/Number)})
+    {(.getAddress account)
+     (-> account .balance js/Number)})

 (defrecord Client [coin]
     Queries
@@ -31,13 +31,13 @@
     (unspent-amounts [this]
         (let [unspent (->> coin .-accounts (map account->amount))]
             (println unspent)
-            unspent))
+            (apply merge unspent)))
     (unspent-channel [this]
         (let [return (chan)]
             (js/setInterval
                 (fn []
                     (let [unspent (unspent-amounts this)]
-                        (put! return { })))
+                        (put! return unspent)))
                 1000)
             return))
     Operations


adjust database name

adjust database name

--- src/ceres_analytics/core.clj
+++ src/ceres_analytics/core.clj
@@ -15,7 +15,7 @@
 (def db (atom
          (let [^MongoOptions opts (mg/mongo-options :threads-allowed-to-block-for-connection-multiplier 300)
                ^ServerAddress sa  (mg/server-address (or (System/getenv "DB_PORT_27017_TCP_ADDR") "127.0.0.1") 27017)]
-           (mg/get-db (mg/connect sa opts) "hera"))))
+           (mg/get-db (mg/connect sa opts) "juno"))))

 (def time-interval {$gt (t/date-time 2014 8 1) $lt (t/date-time 2014 9 1)})


Remove debug output

Remove debug output

--- src/clj/clj_similar/core.clj
+++ src/clj/clj_similar/core.clj
@@ -107,5 +107,4 @@
                 (with-meta (:value e) {:jaccard-index ji})))
          nearest (.nearest ^KDTree (:tree similar) ^doubles (double-array sig*) ^int n)
          sf #(:jaccard-index (meta %))]
-     (println (flatten (vec nearest)))
      (take n (filter ff (reverse (sort-by sf (map mf (flatten (vec nearest))))))))))


More pedestal NSs blacklisted on logger

More pedestal NSs blacklisted on logger

--- src/clj/hellhound/logger.clj
+++ src/clj/hellhound/logger.clj
@@ -93,7 +93,7 @@
     :enabled? true
     :output-fn formatter/default-dev-formatter
     :middleware [middlewares/exceptions]
-    :ns-blacklist [#"org.eclipse.*"]
+    :ns-blacklist [#"org.eclipse.*" #"io.pedestal.*"]
     :appenders
     {:debug-appender {:enabled? true :min-level :debug :output-fn  :inherit
                       :fn (fn [data]


Use map-method to call select (munch) in compile

--- src/clj/minijava/compile.clj
+++ src/clj/minijava/compile.clj
@@ -39,5 +39,6 @@

 (defn compile-program [program]
   (let [treemap  (apply-tree (parse program))
-        canonmap (map-method canon treemap)]
-    canonmap))
+        canonmap (map-method canon treemap)
+        munchmap (map-method select treemap)]
+    munchmap))


add validation for positive BigDecimal

add validation for positive BigDecimal

--- src/clj_money/validation.clj
+++ src/clj_money/validation.clj
@@ -22,6 +22,17 @@
   (when (and (symbol? pred)
              (= 'non-empty-string? pred))
     [path (format "%s cannot be empty" (humanize (last path)))]))
+
+(defn positive-big-dec?
+  [value]
+  (and (instance? BigDecimal value)
+       (pos? value)))
+
+(defn- interpret-positive-big-dec-failure
+  [{:keys [path pred]}]
+  (when (and (symbol? pred)
+             (= 'positive-big-dec? pred))
+    [path (format "%s must be a positive number" (humanize (last path)))]))

 (defn- interpret-regex-failure
   [{:keys [path pred]}]
@@ -63,6 +74,7 @@
   [interpret-required-failure
    interpret-regex-failure
    interpret-empty-string-failure
+   interpret-positive-big-dec-failure
    interpret-collection-count-failure
    interpret-set-inclusion-failure
    interpret-unknown-failure])


Make poisonous gas spread

Make poisonous gas spread

--- src/cljc/robinson/traps.cljc
+++ src/cljc/robinson/traps.cljc
@@ -293,17 +293,17 @@
 (defn update-poisonous-gas-trap
   [state idx]
   (let [place-id    (rw/current-place-id state)
-        xy->density (second (get-in state [:world :places place-id :traps idx :locations] []))
+        xy->density (get-in state [:world :places place-id :traps idx :locations] {})
         _ (log/info "xy->density" xy->density)
         target-xys  (set (mapcat (fn [[x y]] (adj-passable-xys state x y)) (keys xy->density)))
         _ (log/info "target-xys" target-xys)
         xy->density (reduce (fn [xy->density-acc [x y]]
                               ;; sum adjacent densities, divide by 4 and subtract decay
                               (let [density (reduce (fn [density src-xy]
-                                                      (+ density (get xy->density src-xy)))
+                                                      (+ density (get xy->density src-xy 0)))
                                                     0
                                                     (adj-passable-xys state x y))
-                                    density (- (/ density 4) 0.01)]
+                                    density (- (/ density 4) 0.005)]
                               (if (> density 0.0)
                                 (assoc xy->density-acc [x y] density)
                                 xy->density-acc)))


adding multiple arity to engine namespace fns

--- src/cljs/t3/game/engine.cljs
+++ src/cljs/t3/game/engine.cljs
@@ -31,49 +31,73 @@
   (if (= :player1 player) :player1-spaces :player2-spaces))

 ;; ----------
-(defn which-player-turn? []
-  (if (@game-state :player1-turn?) :player1 :player2))

-(defn change-player-turn []
-  (put! :player1-turn? (not (@game-state :player1-turn?))))
+;; NOTE: The following functions will have multiple arity. The first will work on atoms which are used during actual gameplay in the UI. However the second will work on a snapshot of that atom in the form of a map.  The snapshot will be used to determine the best-next-space using the minimax algorithm.

 ;; ----------
-(defn player-spaces [player]
-  (@game-state (player-spaces-keyword player)))
+(defn which-player-turn?
+  ([] (if (@game-state :player1-turn?) :player1 :player2))
+  ([snapshot] (if (snapshot :player1-turn?) :player1 :player2)))

-(defn other-player-spaces [player]
-  (@game-state (player-spaces-keyword (other-player player))))
-
-(defn take-space [space]
-  (let [player-spaces-k (player-spaces-keyword (which-player-turn?))]
-    (put! player-spaces-k (conj (@game-state player-spaces-k) space))))
-
-(defn all-taken-spaces []
-  (union (@game-state :player1-spaces) (@game-state :player2-spaces)))
-
-(defn all-remaining-spaces []
-  (difference (into (sorted-set) (board-spaces (@game-state :board-size)))
-              (all-taken-spaces)))
-
-(defn space-available? [space]
-  (if (space (all-remaining-spaces)) true false))
+(defn change-player-turn
+  ([] (put! :player1-turn? (not (@game-state :player1-turn?))))
+  ([snapshot] (assoc snapshot :player1-turn? (not (snapshot :player1-turn?)))))

 ;; ----------
-(defn player-win? [player]
-  (some #(every? (@game-state (player-spaces-keyword player)) %)
-        (board-wins (@game-state :board-size))))
+(defn player-spaces
+  ([player] (@game-state (player-spaces-keyword player)))
+  ([snapshot player] (snapshot (player-spaces-keyword player))))

-(defn cats-game? []
-  (and (empty? (all-remaining-spaces))
-       (not (player-win? :player1))
-       (not (player-win? :player2))))
+(defn other-player-spaces
+  ([player] (@game-state (player-spaces-keyword (other-player player))))
+  ([snapshot player] (snapshot (player-spaces-keyword (other-player player)))))

-(defn game-over? []
-  (or (cats-game?) (player-win? :player1) (player-win? :player2)))
+(defn take-space
+  ([space] (let [player-spaces-k (player-spaces-keyword (which-player-turn?))]
+             (put! player-spaces-k (conj (@game-state player-spaces-k) space))))
+  ([snapshot space] (let [player-spaces (player-spaces-keyword (which-player-turn? snapshot))]
+                (assoc snapshot player-spaces (conj (snapshot player-spaces) space)))))
+
+(defn all-taken-spaces
+  ([] (union (@game-state :player1-spaces) (@game-state :player2-spaces)))
+  ([snapshot] (union (snapshot :player1-spaces) (snapshot :player2-spaces))))
+
+(defn all-remaining-spaces
+  ([] (difference (into (sorted-set) (board-spaces (@game-state :board-size)))
+                  (all-taken-spaces)))
+  ([snapshot] (difference (into (sorted-set) (board-spaces (snapshot :board-size)))
+                    (all-taken-spaces snapshot))))
+
+(defn space-available?
+  ([space] (if (space (all-remaining-spaces)) true false))
+  ([snapshot space] (if (space (all-remaining-spaces snapshot)) true false)))

 ;; ----------
-(defn player-turn-sequence [space]
-  (when (and (space-available? space)
-             (not (game-over?)))
-    (take-space space)
-    (change-player-turn)))
+(defn player-win?
+  ([player] (some #(every? (@game-state (player-spaces-keyword player)) %)
+                  (board-wins (@game-state :board-size))))
+  ([snapshot player] (some #(every? (snapshot (player-spaces-keyword player)) %)
+                           (board-wins (snapshot :board-size)))))
+
+(defn cats-game?
+  ([] (and (empty? (all-remaining-spaces))
+           (not (player-win? :player1))
+           (not (player-win? :player2))))
+  ([snapshot] (and (empty? (all-remaining-spaces snapshot))
+                   (not (player-win? snapshot :player1))
+                   (not (player-win? snapshot :player2)))))
+
+(defn game-over?
+  ([] (or (cats-game?) (player-win? :player1) (player-win? :player2)))
+  ([snapshot] (or (cats-game? snapshot) (player-win? snapshot :player1) (player-win? snapshot :player2))))
+
+;; ----------
+(defn player-turn-sequence
+  ([space] (when (and (space-available? space)
+                      (not (game-over?)))
+             (take-space space)
+             (change-player-turn)))
+  ([snapshot space] (when (and (space-available? snapshot space)
+                               (not (game-over? snapshot)))
+                      (->> (take-space snapshot space)
+                           (change-player-turn)))))


Fix bug

Fix bug

--- src/cljs/todogo_cljs/db.cljs
+++ src/cljs/todogo_cljs/db.cljs
@@ -65,7 +65,7 @@

 (defn prepare-todo [data]
   (let [todo (keywordize-keys data)]
-    (if (= (:dead_line_at todo) "0001-01-01T00:00:00Z")
+    (if (= (:dead_line_at todo) nil)
       (assoc todo :dead_line_at nil)
       (assoc todo :dead_line_at (f/parse custom-formatter-from (:dead_line_at todo))))))


Stop the `JobClient` from complaining.

Stop the `JobClient` from complaining.

--- src/clojure/parkour/tool.clj
+++ src/clojure/parkour/tool.clj
@@ -28,6 +28,7 @@

   Tool
   (run [_ args]
+    (conf/assoc! conf "mapred.used.genericoptionsparser" true)
     (integral
      (conf/with-default conf
        (apply f conf (seq args))))))


Finished refactoring but seeing memory leak issues again.

--- src-cljs/freactive/core.cljs
+++ src-cljs/freactive/core.cljs
@@ -2,7 +2,20 @@
   (:refer-clojure :exclude [atom])
   (:require [goog.object]))

-;; (def ^:dynamic *invalidate-rx* nil)
+;; Core API
+
+(deftype BindingInfo [raw-deref add-watch remove-watch clean-watch])
+
+(defprotocol IReactive
+  (-get-binding-fns [this]))
+
+(def ^:dynamic *register-dep* nil)
+
+(defn register-dep [dep id binding-info]
+  (when-let [rdep *register-dep*]
+    (rdep dep id binding-info)))
+
+;; END Core API

 (def ^:dynamic *lazy* nil)

@@ -16,31 +29,6 @@
   (let [id auto-reactive-id]
     (set! auto-reactive-id (inc auto-reactive-id))
     (str "-r." id)))
-
-(deftype BindingInfo [raw-deref add-watch remove-watch clean-watch])
-
-(defprotocol IReactive
-  (-get-binding-fns [this]))
-
-(def ^:dynamic *register-dep* nil)
-
-;; (defn register-dep [dep id binding-info]
-;;   (when-let [invalidate *invalidate-rx*]
-;;     (when *trace-capture* (*trace-capture* dep))
-;;     (aset (.-deps invalidate) id
-;;           (fn [key]
-;;             ((or (.-clean-watch binding-info)
-;;                  (.-remove-watch binding-info))
-;;              dep key)))
-;;     ((.-add-watch binding-info)
-;;      dep (.-id invalidate)
-;;      (fn []
-;;        ((.-remove-watch binding-info) dep id)
-;;        (invalidate)))))
-
-(defn register-dep [dep id binding-info]
-  (when-let [rdep *register-dep*]
-    (rdep dep id binding-info)))

 (def ^:private iwatchable-binding-fns
   (BindingInfo. cljs.core/-deref cljs.core/-add-watch
@@ -182,29 +170,26 @@
   ([x] (ReactiveAtom. (new-reactive-id )x nil nil nil #js {} 0))
   ([x & {:keys [meta validator]}] (ReactiveAtom. (new-reactive-id) x meta validator nil #js {} 0)))

-(defn- make-invalidate-fn [reactive id]
-  (let [invalidate-fn
-        (fn invalidate []
-          (when-not (.-dirty reactive)
-            (set! (.-dirty reactive) true)
-            (if (> (.-watchers reactive) 0)
-              ;; updates state and notifies watches
-              (when (.compute reactive)
-                (.notifyInvalidationWatches reactive))
-              ;; updates only invalidation watches
-              (.notifyInvalidationWatches reactive))))]
-    (set! (.-id invalidate-fn) id)
-    (set! (.-deps invalidate-fn) #js {})
-    invalidate-fn))
+;; (defn- make-invalidate-fn [reactive id]
+;;   (let [invalidate-fn
+;;         (fn invalidate []
+;;           (when-not (.-dirty reactive)
+;;             (set! (.-dirty reactive) true)
+;;             (if (> (.-watchers reactive) 0)
+;;               ;; updates state and notifies watches
+;;               (when (.compute reactive)
+;;                 (.notifyInvalidationWatches reactive))
+;;               ;; updates only invalidation watches
+;;               (.notifyInvalidationWatches reactive))))]
+;;     (set! (.-id invalidate-fn) id)
+;;     (set! (.-deps invalidate-fn) #js {})
+;;     invalidate-fn))

 (defn- make-register-dep [rx]
   (fn do-register-dep [dep id binding-info]
     (when *trace-capture* (*trace-capture* dep))
-    (aset (.-deps rx) id
-          (fn []
-            ((or (.-clean-watch binding-info)
-                 (.-remove-watch binding-info))
-             dep (.-id rx))))
+    (aset (.-deps rx) id #js [dep binding-info])
+    ;; (println "cur deps:" (.-deps rx))
     ((.-add-watch binding-info)
      dep (.-id rx)
      (fn []
@@ -315,11 +300,17 @@
   (clean [this key]
     (.removeFWatch this key)
     (.removeInvalidationWatch this key)
+    ;; (println "trying to clean" watchers iwatchers deps)
     (when (identical? 0 (.-watchers this)) (identical? 0 (.-iwatchers this))
-          ;; (println "cleaning" (.-id this) key)
-          (goog.object/forEach (.-deps (.-invalidate this))
+          ;; (println "cleaning" (.-id this) key deps)
+          (goog.object/forEach deps
                                (fn [val key obj]
-                                 (val)
+                                 ;; (println "cleaning:" key val)
+                                 (let [dep (aget val 0)
+                                       binding-info (aget val 1)]
+                                   ((or (.-clean-watch binding-info)
+                                        (.-remove-watch binding-info))
+                                    dep id))
                                  (js-delete obj key)))
           (set! (.-dirty this) true)))

@@ -368,7 +359,7 @@
   ([f lazy]
    (let [id (new-reactive-id)
          reactive (ReactiveExpression. id nil true f #js {} nil nil #js {} 0 #js {} 0 nil lazy
-                                       (or *do-trace-captures* (fn [_])))]
+                                       *do-trace-captures*)]
      (set! (.-register-dep-fn reactive) (make-register-dep reactive))
      reactive)))

@@ -389,7 +380,7 @@
         (set! (.-state cursor) new-value)
         (when (> watchers 0)
           (.notifyFWatches cursor old-value new-value))
-        (when-not (> iwatchers 0)
+        (when (> iwatchers 0)
           (.notifyInvalidationWatches cursor))
         new-value)))
   (clean [this key]


Add comment explaining build-invite-data state path

--- src-cljs/frontend/state.cljs
+++ src-cljs/frontend/state.cljs
@@ -70,9 +70,12 @@
 (def user-path [:current-user])

 (def build-data-path [:current-build-data])
+
+;; state related to the first-green-build invite box
 (def build-invite-data-path (conj build-data-path :invite-data))
 (def build-invite-members-path (conj build-invite-data-path :org-members))
 (defn build-invite-member-path [index] (conj build-invite-members-path index))
+
 (def build-path [:current-build-data :build])
 (def dismiss-invite-form-path (conj build-invite-data-path :dismiss-invite-form))
 (def dismiss-config-errors-path (conj build-data-path :dismiss-config-errors))