use a map with type instead of two symbols

--- src/clj/org/openforis/ceo/handler.clj
+++ src/clj/org/openforis/ceo/handler.clj
@@ -52,70 +52,63 @@
 (def proxy-routes #{"/get-tile"
                     "/get-securewatch-dates"})

-                      ;; Users API
-(def get-api-routes #{"/get-all-users"
-                      "/get-institution-users"
-                      "/get-user-details"
-                      "/get-user-stats"
-                      ;; Project API
-                      "/dump-project-aggregate-data" ; TODO these are the only two get routes that dont start with "get"
-                      "/dump-project-raw-data"
-                      "/get-all-projects"
-                      "/get-project-by-id"
-                      "/get-project-stats"
-                      ;; Plots API
-                      "/get-next-plot"
-                      "/get-plot-by-id"
-                      "/get-prev-plot"
-                      "/get-project-plots"
-                      "/get-proj-plot"
-                      ;; Institutions API
-                      "/get-all-institutions"
-                      "/get-institution-details"
-                      ;; Imagery API
-                      "/get-institution-imagery"
-                      "/get-project-imagery"
-                      "/get-public-imagery"
-                      ;; GeoDash API
-                      ;; TODO flatten routes
-                      "/geo-dash/get-by-projid"})
-
-(def post-api-routes #{"/account"
-                       "/login"
-                       "/logout"
-                       "/register"
-                       "/password-reset"
-                       "/password-request"
-                       "/update-user-institution-role"
-                       "/request-institution-membership"
-                       "/send-to-mailing-list"
-                       "/unsubscribe-mailing-list"
-                      ;; Project API
-                       "/archive-project"
-                       "/close-project"
-                       "/create-project"
-                       "/publish-project"
-                       "/update-project"
-                      ;; Plots API
-                       "/add-user-samples"
-                       "/flag-plot"
-                       "/release-plot-locks"
-                       "/reset-plot-lock"
-                      ;; Institutions API
-                       "/archive-institution"
-                       "/create-institution"
-                       "/update-institution"
-                      ;; Imagery API
-                       "/add-geodash-imagery"
-                       "/add-institution-imagery"
-                       "/update-institution-imagery"
-                       "/archive-institution-imagery"
-                      ;; GeoDash API
-                      ;; TODO flatten routes
-                       "/geo-dash/create-widget"
-                       "/geo-dash/delete-widget"
-                       "/geo-dash/gateway-request"
-                       "/geo-dash/update-widget"})
+                 ;; Users API
+(def api-routes {"/get-all-users"                  :get
+                 "/get-institution-users"          :get
+                 "/get-user-details"               :get
+                 "/get-user-stats"                 :get
+                 "/account"                        :post
+                 "/login"                          :post
+                 "/logout"                         :post
+                 "/register"                       :post
+                 "/password-reset"                 :post
+                 "/password-request"               :post
+                 "/update-user-institution-role"   :post
+                 "/request-institution-membership" :post
+                 "/send-to-mailing-list"           :post
+                 "/unsubscribe-mailing-list"       :post
+                 ;; Project API
+                 "/dump-project-aggregate-data" :get
+                 "/dump-project-raw-data"       :get
+                 "/get-all-projects"            :get
+                 "/get-project-by-id"           :get
+                 "/get-project-stats"           :get
+                 "/archive-project"             :post
+                 "/close-project"               :post
+                 "/create-project"              :post
+                 "/publish-project"             :post
+                 "/update-project"              :post
+                 ;; Plots API
+                 "/get-next-plot"      :get
+                 "/get-plot-by-id"     :get
+                 "/get-prev-plot"      :get
+                 "/get-project-plots"  :get
+                 "/get-proj-plot"      :get
+                 "/add-user-samples"   :post
+                 "/flag-plot"          :post
+                 "/release-plot-locks" :post
+                 "/reset-plot-lock"    :post
+                 ;; Institutions API
+                 "/get-all-institutions"    :get
+                 "/get-institution-details" :get
+                 "/archive-institution"     :post
+                 "/create-institution"      :post
+                 "/update-institution"      :post
+                 ;; Imagery API
+                 "/get-institution-imagery"     :get
+                 "/get-project-imagery"         :get
+                 "/get-public-imagery"          :get
+                 "/add-geodash-imagery"         :post
+                 "/add-institution-imagery"     :post
+                 "/update-institution-imagery"  :post
+                 "/archive-institution-imagery" :post
+                 ;; GeoDash API
+                 ;; TODO flatten routes
+                 "/geo-dash/get-by-projid"   :get
+                 "/geo-dash/create-widget"   :post
+                 "/geo-dash/delete-widget"   :post
+                 "/geo-dash/gateway-request" :post
+                 "/geo-dash/update-widget"   :post})

 ;; FIXME: Add any conditions you want for URLs you want to exclude up front.
 (defn bad-uri? [uri] (str/includes? (str/lower-case uri) "php"))
@@ -135,10 +128,8 @@
                             (= request-method :get))
                        (render-page uri)

-                       (or (and (contains? post-api-routes uri)
-                                (= request-method :post))
-                           (and (contains? get-api-routes uri)
-                                (= request-method :get)))
+                       (and (contains? api-routes uri)
+                            (= request-method (api-routes uri)))
                        (api-handler uri)

                        (and (contains? proxy-routes uri)


refine transaction processing

refine transaction processing

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -198,12 +198,13 @@

 (defn- get-previous-item
   "Finds the transaction item that immediately precedes the specified item"
-  [storage item transaction-date]
+  [storage {:keys [account-id transaction-date id] :as item}]
   (->> (select-transaction-items storage
-                                 {:account-id (:account-id item)
+                                 {:account-id account-id
+                                  :id [:<> id]
                                   :transaction-date [:between nil transaction-date]}
-                                 {:sort [[:transaction-date :desc] [:index :desc]]})
-       (remove #(= (:id %) (:id item)))
+                                 {:sort [[:transaction-date :desc] [:index :desc]]
+                                  :limit 1})
        first))

 (defn- process-item-balance-and-index
@@ -236,7 +237,7 @@
   with new balance and index values"
   [storage transaction-date [account-id items]]
   (let [sorted-items (sort-by :index items)
-        previous-item (get-previous-item storage (first sorted-items) transaction-date)
+        previous-item (get-previous-item storage (first sorted-items))
         previous-balance (or (get previous-item :balance)
                              (bigdec 0))
         previous-index (or (get previous-item :index) -1)]
@@ -275,7 +276,7 @@
             s
             {:account-id (:account-id reference-item)
              :index [:>= (:index reference-item)]
-             :transaction-date [:between (:transaction-date reference-item)]}
+             :transaction-date [:between (:transaction-date reference-item) (t/today)]} ; TODO: let the system look up the latest date
             {:sort [[:index :desc]]})
           (remove #(= (:id reference-item) (:id %)))
           (map after-item-read)))))
@@ -479,10 +480,7 @@
     (let [validated (validate s ::new-transaction transaction)]
       (if (validation/has-error? validated)
         validated
-
-        (create-transaction-without-balances s validated)
-
-        #_(if (delay-balances? (:entity-id transaction))
+        (if (delay-balances? (:entity-id transaction))
             (create-transaction-without-balances s validated)
             (create-transaction-and-adjust-balances s validated))))))

@@ -577,8 +575,10 @@
       (delete-transaction-item storage id))
     (->> dereferenced-account-ids
          ; fake out an item because that's what get-previous-item expects
-         (map #(hash-map :account-id % :id -1))
-         (map #(or (get-previous-item storage % (:transaction-date transaction))
+         (map #(hash-map :account-id %
+                         :id -1
+                         :transaction-date (:transaction-date transaction)))
+         (map #(or (get-previous-item storage %)
                    (assoc % :index -1 :balance (bigdec 0)))))))

 (defn update
@@ -619,7 +619,7 @@
        (map second)
        (map #(sort-by :index %))
        (map first)
-       (map #(or (get-previous-item storage % (:transaction-date transaction))
+       (map #(or (get-previous-item storage %)
                  {:account-id (:account-id %)
                   :index -1
                   :balance 0}))))


move go-loop

move go-loop

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -225,43 +225,41 @@
                                              id)])
                    ;; xch will be closed by the subscribed-composition
                    (mix-in target-mix xch)))
-        ch-in (subs-fn endpoint id)
-
-        transport
-        (go-loop []
-          (if-some [delta (<! ch-in)]
-            (let [[{:keys [subs-one subs-many unsubs]} delta]
-                  (extract-hooks conformed-spec delta)
-
-                  subs-by-pks (group-by-pks @subs)]
-              (doseq [[ks [xch unsubs-fn]]
-                      (->> unsubs
-                           (mapcat (fn [ks]
-                                     (concat (->> (get subs-by-pks ks)
-                                                  (map rest))
-                                             (some-> (find @subs ks)
-                                                     (vector)))))
-                           distinct)]
-                (unsubs-fn)
-                (mix-out target-mix xch)
-                (vswap! subs dissoc ks))
-
-              (when delta ;; (it is possible that all deltas got eaten up)
-                (>! target delta)) ;; Block until evt is put so that
-                                   ;; subscriptions are put after and
-                                   ;; unsubscriptions are in effect
-
-              (doseq [[ks id] subs-one]
-                (do-sub ks id false))
-
-              (doseq [[ks ids] subs-many
-                      id ids]
-                (do-sub ks id true))
-              (recur))
-            (do
-              (close! target) ;; implicit mix-out
-              (doseq [[_ unsubs-fn] (vals @subs)]
-                (unsubs-fn)))))]
+        ch-in (subs-fn endpoint id)]
+    (go-loop []
+      (if-some [delta (<! ch-in)]
+        (let [[{:keys [subs-one subs-many unsubs]} delta]
+              (extract-hooks conformed-spec delta)
+
+              subs-by-pks (group-by-pks @subs)]
+          (doseq [[ks [xch unsubs-fn]]
+                  (->> unsubs
+                       (mapcat (fn [ks]
+                                 (concat (->> (get subs-by-pks ks)
+                                              (map rest))
+                                         (some-> (find @subs ks)
+                                                 (vector)))))
+                       distinct)]
+            (unsubs-fn)
+            (mix-out target-mix xch)
+            (vswap! subs dissoc ks))
+
+          (when delta ;; (it is possible that all deltas got eaten up)
+            (>! target delta)) ;; Block until evt is put so that
+                               ;; subscriptions are put after and
+                               ;; unsubscriptions are in effect
+
+          (doseq [[ks id] subs-one]
+            (do-sub ks id false))
+
+          (doseq [[ks ids] subs-many
+                  id ids]
+            (do-sub ks id true))
+          (recur))
+        (do
+          (close! target) ;; implicit mix-out
+          (doseq [[_ unsubs-fn] (vals @subs)]
+            (unsubs-fn)))))
     (fn [] (unsubs-fn ch-in))))

 (defn compscribe


Tidy a namespace

Tidy a namespace

--- src/refactor_nrepl/rename_file_or_dir.clj
+++ src/refactor_nrepl/rename_file_or_dir.clj
@@ -1,10 +1,8 @@
 (ns refactor-nrepl.rename-file-or-dir
   (:require [clojure.string :as str]
-            [clojure.tools.namespace.file :as file]
             [me.raynes.fs :as fs]
-            [refactor-nrepl.core :as core]
             [refactor-nrepl
-             [config :as config]
+             [core :as core]
              [util :as util]]
             [refactor-nrepl.ns
              [ns-parser :as ns-parser]


fix goog-define docstring

fix goog-define docstring

add-implicit-options only munges symbol keys,
string keys remain untouched

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -698,7 +698,10 @@
     (ns your-app.core)
     (goog-define DEBUG! false)
     ;; can be overridden with
-    :closure-defines {\"your-app.core.DEBUG!\" true}"
+    :closure-defines {\"your-app.core.DEBUG_BANG_\" true}
+    or
+    :closure-defines {'your-app.core/DEBUG! true}"
+
   [sym default]
   (assert-args goog-define
    (core/or (core/string? default)


defn needs to be marked as a macro

defn needs to be marked as a macro

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -2742,7 +2742,8 @@
               ;;must figure out how to convey primitive hints to self calls first
               (cons `fn fdecl))))))

-#?(:clj (. (var defn) (setMacro)))
+#?(:clj  (. (var defn) (setMacro))
+   :cljs (set! (. defn -cljs$lang$macro) true))

 (def
   ^{:doc "Like defn, but the resulting function name is declared as a


Showing a page with somewhat relevant data

--- scrape-n-mail/src/scrape_n_mail/core.cljs
+++ scrape-n-mail/src/scrape_n_mail/core.cljs
@@ -1,6 +1,7 @@
 (ns scrape-n-mail.core
     (:require [rum.core :as rum]
               [cljs-http.client :as http]
+              [clojure.string :as s]
               [cljs.core.async :refer [<!]])
     (:require-macros [cljs.core.async.macros :refer [go go-loop]])
     )
@@ -19,10 +20,13 @@
   (->
     (.get js/gapi.client.sheets.spreadsheets.values
           (clj->js {:spreadsheetId wellbeing-sheet
-                     :range "Form Responses!A1:F"}) )
+                    :range "Form Responses!A1:F"}) )
+    ; values is the parsed version
     (.then #(swap! app-data assoc :sheet-data (.. % -result -values))) ))

+; This gets registered below as the callback for when authorization state changes
+; It's also called once after the gapi client is set up to initialize things if we're already logged in
 (defn update-after-auth [is-signed-in]
   (swap! app-data assoc :signed-in? is-signed-in)
   (if is-signed-in
@@ -37,7 +41,9 @@
                ; Set up a listener per Google's tutorial
                (.listen is-signed-in update-after-auth)
                ; Also set the initial value
-               (update-after-auth  (.get is-signed-in)) ))))
+               ; Unfortunrately, this often doesn't work if we were already signed in...
+               ; I'm missing something
+               (update-after-auth (.get is-signed-in)) ))))

 ; In retrospect, this was not really useful (these keys aren't secret).
 ; We're also hurting performance a little, but it's not relevant to our
@@ -49,9 +55,11 @@
                 {:discoveryDocs ["https://sheets.googleapis.com/$discovery/rest?version=v4"]
                  :scope "https://www.googleapis.com/auth/spreadsheets.readonly"}
                 (merge (:body keys-resp))
+                ; We definitely need this to undo the auto-converstion to EDN
+                ; that http/get does
                 clj->js )]
           (.load js/gapi "client:auth2" #(init-client config-keys)) )
-        (println keys-resp) )))
+        #_(println keys-resp) )))

 (rum/defc hello-world < rum/reactive []
   [:div
@@ -61,9 +69,17 @@
       [:button {:id "authorize-button" :on-click #(.. js/gapi.auth2 getAuthInstance signIn)} "Authorize"]
       [:button {:id "sign-out-button" :on-click #(.. js/gapi.auth2 getAuthInstance signOut)} "Sign Out"]
       )
-    [:pre {:id "content"}]
-    ; [:h1 (:text @app-state)]
-    ; [:h3 "Edit this and watch it change!"]
+    ; Since I already react to app-data above, I don't seem to need to again...
+    [:pre {:id "content"}
+     (->> (:sheet-data @app-data)
+          ; For now, this is the criterion for which folks I look at
+          ; It'd be nice to figure out which are hiddne to play nicer with Svani's workflow
+          (filter #(s/includes? (aget % 0) "2017"))
+          ; Each line is a list, this joins them in to one string
+          (map #(s/join " " %))
+          ; Then we join the lines
+          (s/join "\n") )
+          ]
   ])

 (rum/mount (hello-world)


fix(cider-nrepl): protect completion against nil :candidates from compliment

--- ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
+++ ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
@@ -231,15 +231,17 @@
                                      "ns" current-namespace
                                      "session"  (.getSessionId repl)}))]
               (when-let [completions
-                         (seq (map
-                                #(hash-map
-                                   :completion (:candidate %)
-                                   :match (:candidate %)
-                                   :type (:type %)
-                                   :ns (:ns %)
-                                   :filter (serverrepl/textmate-filter (:candidate %) prefix)
-                                   :metadata nil)
-                                (:completions response)))]
+                         (seq (->>
+                                (:completions response)
+                                (filter :candidate) ; protection against nil candidates returned by compliment
+                                (map
+                                  #(hash-map
+                                     :completion (:candidate %)
+                                     :match (:candidate %)
+                                     :type (:type %)
+                                     :ns (:ns %)
+                                     :filter (serverrepl/textmate-filter (:candidate %) prefix)
+                                     :metadata nil))))]
                 completions)))))

 (defn context-info-data


Fix bug with calculating number of docs with a given term in it.

--- test/flambo/tfidf.clj
+++ test/flambo/tfidf.clj
@@ -66,6 +66,7 @@

           ;; number of documents with a given term in it
           doc-frequencies (-> doc-term-seq
+                              f/distinct
                               (f/group-by (f/fn [[_ term]] term))
                               (f/map (f/fn [[term doc-seq]] [term (count doc-seq)]))
                               f/cache)


changed 1 futuro to future

changed 1 futuro to future

--- it.clj
+++ it.clj
@@ -45,7 +45,7 @@
                                                 :target-model it/small}
                                                :count count}])))
                                 (list {:synsem {:sem {:tense :conditional}}}
-                                      {:synsem {:sem {:tense :futuro}}}
+                                      {:synsem {:sem {:tense :future}}}
                                       {:synsem {:sem {:tense :present}}}
                                       {:synsem {:sem {:aspect :perfect
                                                       :tense :past}}})))))


CMR-3369: Changed db back to in-memory

CMR-3369: Changed db back to in-memory

--- dev-system/dev/user.clj
+++ dev-system/dev/user.clj
@@ -80,8 +80,8 @@
   ;; MAKE SURE YOU DISABLE SYMANTEC ANTIVIRUS BEFORE STARTING THE TESTS WITH EXTERNAL DB
   ;; Renable them when you're done

-  ; (system/set-dev-system-db-type! :in-memory)
-  (system/set-dev-system-db-type! :external)
+  (system/set-dev-system-db-type! :in-memory)
+  ; (system/set-dev-system-db-type! :external)

   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


typo broke test

typo broke test

--- test/such/f_casts.clj
+++ test/such/f_casts.clj
@@ -13,6 +13,6 @@
   (cast/as-var-name-symbol 'foo) => 'foo
   (cast/as-var-name-symbol 'clojure.core/foo) => 'foo
   (cast/as-var-name-symbol #'clojure.core/even?) => 'even?
-  (cast/as-var-name-symbol #'local) => 'localnxxg
+  (cast/as-var-name-symbol #'local) => 'local
   (cast/as-var-name-symbol "local") => 'local)


Add filterapply tests

Add filterapply tests


add noop logger

add noop logger

--- build.boot
+++ build.boot
@@ -5,6 +5,7 @@
                   [perun "0.3.0"]
                   [confetti "0.1.2-SNAPSHOT"]
                   [deraen/boot-sass "0.2.1"]
+                  [org.slf4j/slf4j-nop "1.7.13" :scope "test"]
                   [pandeiro/boot-http "0.7.3"]
                   [org.martinklepsch/boot-gzip "0.1.1"]])


cut v0.0.2

cut v0.0.2

--- build.boot
+++ build.boot
@@ -15,7 +15,7 @@
          '[adzerk.boot-test :refer [test]]
          '[boot.core        :as core :refer [deftask]])

-(def +version+ "0.0.2-SNAPSHOT")
+(def +version+ "0.0.2")

 (bootlaces! +version+)


Include resources/ in dist resources

Include resources/ in dist resources

--- build.boot
+++ build.boot
@@ -1,7 +1,7 @@
 (set-env!
   :project 'irresponsible/overload
   :version "0.1.1"
-  :resource-paths #{"src"}
+  :resource-paths #{"src" "resources"}
   :source-paths #{"src"}
   :description "Dynamic loading and lookup"
   :url "https://github.com/irresponsible/overload/"


added env into source paths

added env into source paths

--- build.boot
+++ build.boot
@@ -58,13 +58,13 @@
    :source-map-timestamp true})

 (deftask build []
-  (set-env! :source-paths #{"src/clj" "src/cljs"})
+  (set-env! :source-paths #{"src/clj" "src/cljs" "env/prod"})
   (comp (cljs :compiler-options compiler-options)))

 (deftask dev
   "Start the dev env..."
   []
-  (set-env! :source-paths #{"src/clj" "src/cljs"})
+  (set-env! :source-paths #{"src/clj" "src/cljs" "env/dev"})
   (comp (serve :dir "resources/public")
         (watch)
         (cljs-repl)


cjl - More translation tests

cjl - More translation tests

--- test/icfp2015/unit_test.clj
+++ test/icfp2015/unit_test.clj
@@ -24,9 +24,23 @@
           expected-unit { :members #{ [1 0] [1 1] } :pivot [1 0] }]
       (is (= expected-unit actual-unit))))

+  (testing "translate odd row southwest"
+    (let [unit { :members #{ [1 1] [1 2] } :pivot [1 1] }
+          f (translate :southwest)
+          actual-unit (f unit)
+          expected-unit { :members #{ [2 1] [2 2 ] } :pivot [2 1] }]
+      (is (= expected-unit actual-unit))))
+
   (testing "translate even row southeast"
     (let [unit { :members #{ [0 0] [0 1] } :pivot [0 1] }
           f (translate :southeast)
           actual-unit (f unit)
           expected-unit { :members #{ [1 0] [1 1] } :pivot [1 1] }]
+      (is (= expected-unit actual-unit))))
+
+  (testing "translate odd row southeast"
+    (let [unit { :members #{ [1 0] [1 1] } :pivot [1 1] }
+          f (translate :southeast)
+          actual-unit (f unit)
+          expected-unit { :members #{ [2 1] [2 2] } :pivot [2 2] }]
       (is (= expected-unit actual-unit)))))


Test with lists instead of vectors

Test with lists instead of vectors

--- test/magician/list_test.clj
+++ test/magician/list_test.clj
@@ -3,7 +3,7 @@
             [magician.list :refer :all]))

 (deftest numerics-test
-  (is (= [1 2.0 -3] (numerics [1 2.0 -3])))
-  (is (= [] (numerics ["string"])))
-  (is (= [] (numerics [])))
-  (is (= [1 3] (numerics [1, "two", 3, "four"]))))
+  (is (= '(1 2.0 -3) (numerics '(1 2.0 -3))))
+  (is (= () (numerics '("string"))))
+  (is (= () (numerics ())))
+  (is (= '(1 3) (numerics '(1 "two" 3 "four")))))


fix ns

fix ns

--- test/pc/views/blog_test.clj
+++ test/pc/views/blog_test.clj
@@ -1,4 +1,4 @@
-(ns pc.views.test-blog
+(ns pc.views.blog-test
   (:require [clojure.test :refer :all]
             [clojure.string :as str]
             [hiccup.core :as hiccup]


Don't search if empty

Don't search if empty

--- src-cljs/client/core.cljs
+++ src-cljs/client/core.cljs
@@ -154,13 +154,15 @@
       (when-let [search-init-event (<! search-init-events)]
         (let [is-button-click? (h/has-event-type? :click search-init-event)
               is-key-press-up? (h/has-event-type? :keyup search-init-event)
-              is-enter-key?    (h/pressed-key-is? (:enter h/key-types) search-init-event)]
-          (when (or is-button-click?
-                    (and is-key-press-up?
-                         is-enter-key?))
-            (let [value (.-value (goog.dom/getElement "search-field"))
-                  message (Message. :search value)]
-              (>! app-channel message)))
+              is-enter-key?    (h/pressed-key-is? (:enter h/key-types) search-init-event)
+              value            (.-value (goog.dom/getElement "search-field"))
+              value-not-empty? (not (= value ""))
+              message          (Message. :search value)]
+          (when (and value-not-empty?
+                     (or is-button-click?
+                         (and is-key-press-up?
+                              is-enter-key?)))
+            (>! app-channel message))
           (recur))))

     (go-loop


more tests, tricky to figure out this bug of the repl not being able to apply a fn to a list of args

--- test/cljs/lisp_interpreter/core-test.cljs
+++ test/cljs/lisp_interpreter/core-test.cljs
@@ -148,6 +148,11 @@
   (is (= (list 99 32) (l/eval-sub-exps (l/operands (list '(fn (x) (+ x 1))  99 32)) atom-env))))

 (deftest apply-functions
+  (let [fun '(fn (q) (* q 2))
+        proc (l/make-proc (l/lambda-params fun) (l/lambda-body fun) atom-env)]
+    (is (= (list 'proc (list 'q) (list '* 'q 2) atom-env) proc)))
+  (is (= 5  (l/my-apply (list 'proc '(x) (list '(- x 5)) atom-env)  (list 10))))
+  (is (= 12  (l/my-apply (list 'proc '(a b c) (list '(- (+ a b) c)) atom-env)  (list 10 5 3))))
   (let [_ (l/my-apply (l/my-eval (l/operator (list '(fn (x) (+ x 1)) 42)) atom-env) (list 32))]
     (is (= 32 (l/lookup-variable "x" atom-env)))
     (is (not (= 4322 (l/lookup-variable "x" atom-env))))


support :client-retry so you can change the default retry from 3s

--- src/ninjudd/eventual/server.clj
+++ src/ninjudd/eventual/server.clj
@@ -12,7 +12,9 @@
         disconnect (if-let [t (:timeout opts)]
                      (timeout t)
                      (chan))]
-    (go (loop []
+    (go (when-let [retry (:client-retry opts)]
+          (>! out (str "retry: " retry "\n")))
+        (loop []
           (let [keepalive (timeout (:keepalive opts 25000))
                 [event ch] (alts! [events keepalive disconnect])]
             (cond


ensure httpkit is only stopped if started + oc-system constructor

--- src/open_company/components.clj
+++ src/open_company/components.clj
@@ -8,34 +8,46 @@
   component/Lifecycle
   (start [component]
     (let [handler (get-in component [:handler :handler] handler)
-          server (httpkit/run-server handler options)]
-      (timbre/info "Starting HTTPKit server")
+          server  (httpkit/run-server handler options)]
       (assoc component :server server)))
   (stop [component]
-    (when server
-      (server)
-      component)))
+    ;; (prn component)
+    (if-not server
+      component
+      (do
+        (server)
+        (dissoc component :server)))))

 (defrecord RethinkPool [size regenerate-interval pool]
   component/Lifecycle
   (start [component]
-    (timbre/info "Starting RethinkDB connection pool")
     (let [pool (pool/fixed-pool pool/init-conn pool/close-conn
                                 {:size size :regenerate-interval 15})]
       (assoc component :pool pool)))
   (stop [component]
-    (when pool
-      (do
-        (timbre/info "Stopping RethinkDB connection pool")
+    (if pool
+      (do
         (pool/shutdown-pool! pool)
         (dissoc component :pool))
       component)))

 (defrecord Handler [handler-fn]
+  component/Lifecycle
   (start [component]
     (assoc component :handler (handler-fn component)))
   (stop [component]
     (dissoc component :handler)))

-(def pool
-  (map->RethinkPool {:size 5 :regenerate-interval 10}))
+;; (def pool
+;;   (map->RethinkPool {:size 5 :regenerate-interval 10}))
+
+(defn oc-system [opts]
+  (let [{:keys [host port handler-fn]} opts]
+    (component/system-map
+     :db-pool (map->RethinkPool {:size 5 :regenerate-interval 5})
+     :handler (component/using
+               (map->Handler {:handler-fn handler-fn})
+               [:db-pool])
+     :server  (component/using
+               (map->HttpKit {:options {:port port}})
+               [:handler]))))


Remove an unnecessary `html`

Remove an unnecessary `html`

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -224,23 +224,22 @@
   (reify
     om/IRenderState
     (render-state [_ {:keys [show-modal?]}]
-      (html
-       (card/titled {:title "Beta Program"}
-                    (html
-                     [:div
-                      (when show-modal?
-                        (om/build beta-terms-modal {:close-fn #(om/set-state! owner :show-modal? false)}))
-                      [:p "We invite you to join Inner Circle, our new
+      (card/titled {:title "Beta Program"}
+                   (html
+                    [:div
+                     (when show-modal?
+                       (om/build beta-terms-modal {:close-fn #(om/set-state! owner :show-modal? false)}))
+                     [:p "We invite you to join Inner Circle, our new
                            beta program. As a member of CircleCI’s
                            Inner Circle you get exclusive access to
                            new features and settings before they are
                            released publicly!"]
-                      (button/button
-                       {:on-click #(do
-                                     (om/set-state! owner :show-modal? true)
-                                     ((om/get-shared owner :track-event) {:event-type :beta-join-clicked}))
-                        :primary? true}
-                       "Join Beta Program")]))))))
+                     (button/button
+                      {:on-click #(do
+                                    (om/set-state! owner :show-modal? true)
+                                    ((om/get-shared owner :track-event) {:event-type :beta-join-clicked}))
+                       :primary? true}
+                      "Join Beta Program")])))))

 (defn beta-program-member [app owner]
   (reify


Add copyright header.

Add copyright header.

--- modules/scheduling/src/test/clojure/wunderboss/scheduling_tests.clj
+++ modules/scheduling/src/test/clojure/wunderboss/scheduling_tests.clj
@@ -1,3 +1,17 @@
+;; Copyright 2014 Red Hat, Inc, and individual contributors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
 (ns wunderboss.scheduling-tests
   (:require [clojure.test :refer :all])
   (:import org.projectodd.wunderboss.WunderBoss


Fix crash

Fix crash

Turned out to be a classic bug on my part - overshadowing a global
function with a function parameter of the same name.

--- src/tensorflow_clj/core.clj
+++ src/tensorflow_clj/core.clj
@@ -38,21 +38,21 @@
     {"dtype" org.tensorflow.DataType/DOUBLE
      "shape" (org.tensorflow.Shape/scalar)}))

-(defn run-and-fetch [name]
+(defn run-and-fetch [op-name]
   (with-open [sess (org.tensorflow.Session. graph)]
     (let [runner (.runner sess)]
       (print (-> runner
-               (.fetch (name name))
+               (.fetch (name op-name))
                (.run)
                (.get 0)
                (.toString))))))

-(defn run-feed-and-fetch [name]
+(defn run-feed-and-fetch [op-name]
   (with-open [sess (org.tensorflow.Session. graph)]
     (let [runner (.runner sess)]
       (print (-> runner
-               (.feed (name name) (tensor 234.0))
-               (.fetch (name name))
+               (.feed (name op-name) (tensor 234.0))
+               (.fetch (name op-name))
                (.run)
                (.get 0)
                (.toString))))))


Remove unused requires [skip ci]

Remove unused requires [skip ci]

--- src/afterglow/web/routes/show_control.clj
+++ src/afterglow/web/routes/show_control.clj
@@ -11,12 +11,9 @@
             [afterglow.util :as util]
             [afterglow.web.layout :as layout]
             (clj-time core format coerce)
-            [clojure.data.json :refer [read-json write-str]]
             [com.evocomputing.colors :as colors]
-            [org.httpkit.server :refer [with-channel on-receive on-close]]
-            [overtone.at-at :refer [now after]]
+            [overtone.at-at :refer [now]]
             [ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
-            [ring.util.http-response :refer [ok]]
             [ring.util.response :refer [response]]
             [selmer.parser :as parser]
             [taoensso.timbre :as timbre :refer [warn error]]))


Created helper - didn't use it :-)

Created helper - didn't use it :-)

--- src/aeolian/abc/notes.clj
+++ src/aeolian/abc/notes.clj
@@ -20,14 +20,14 @@
 	   	(<= 40 method-length) "\"B\""
 	   	:else "\"C\""))

-(defn- pick-not-from-octave [octave line-length]
+(defn- pick-note-from-octave [octave line-length]
 	(nth octave (mod line-length (count octave))))

 (defn pick-note-for-line-length [line-length]
 	(cond
 		(< line-length 10) rest-note
-	   	(<= 10 line-length 39) (nth octave-1 (mod line-length (count octave-1)))
-	   	(<= 40 line-length 79) (nth octave-2 (mod line-length (count octave-2)))
-	   	(<= 80 line-length 99) (nth octave-3 (mod line-length (count octave-3)))
-	   	(<= 100 line-length 119) (nth octave-4 (mod line-length (count octave-4)))
-	   	(<= 120 line-length) (nth octave-5 (mod line-length (count octave-5)))))+	   	(<= 10 line-length 39) (pick-note-from-octave octave-1 line-length)
+	   	(<= 40 line-length 79) (pick-note-from-octave octave-2 line-length)
+	   	(<= 80 line-length 99) (pick-note-from-octave octave-3 line-length)
+	   	(<= 100 line-length 119) (pick-note-from-octave octave-4 line-length)
+	   	(<= 120 line-length) (pick-note-from-octave octave-5 line-length)))


Remove unused styles

Remove unused styles

--- src/braid/core/client/ui/styles/misc.cljs
+++ src/braid/core/client/ui/styles/misc.cljs
@@ -44,9 +44,6 @@
    [:.page.users>.title::before
     (mixins/fontawesome \uf0c0)]

-   [:.page.channels>.title::before
-    (mixins/fontawesome \uf02c)]
-
    [:.page.settings>.title::before
     (mixins/fontawesome \uf013)]

@@ -57,10 +54,7 @@
     (mixins/fontawesome \uf007)]

    [:.page.userpage>.title::before
-    (mixins/fontawesome \uf007)]
-
-   [:.page.channel>.title::before
-    (mixins/fontawesome \uf02b)]])
+    (mixins/fontawesome \uf007)]])

 (defn threads [pad]


fix problem getting the get-lateset-snapshot-id

--- src/wb_es/snapshot/core.clj
+++ src/wb_es/snapshot/core.clj
@@ -30,7 +30,7 @@
                     (re-matches id-pattern (:id snapshot)))))
          (sort-by (fn [snapshot]
                     (let [[_ _ version-id] (re-matches id-pattern (:id snapshot))]
-                      version-id)))
+                      (Integer. version-id))))
          (last)
          (:id))))


Delete unneeded import

Delete unneeded import

--- src/beehive_http/core.clj
+++ src/beehive_http/core.clj
@@ -21,8 +21,7 @@
            (com.ning.http.client.providers.netty NettyAsyncHttpProviderConfig
                                                  NettyAsyncHttpProvider)
            (com.ning.http.client.providers.netty.response NettyResponse)
-           (net.uncontended.precipice AsyncService
-                                      ServiceProperties
+           (net.uncontended.precipice ServiceProperties
                                       RejectedActionException)
            (net.uncontended.precipice_implementations.asynchttp HttpAsyncService
                                                                 Transformer)


add arity to 'induce-exit' fn to change app exit code

--- src/bract/core/keydef.clj
+++ src/bract/core/keydef.clj
@@ -126,9 +126,14 @@

 (defn induce-exit
-  "Update given context with {:bract.core/exit? true} to bail out of the inducer-chain at all levels."
-  [context]
-  (assoc context (key ctx-exit?) true))
+  "Update given context with {:bract.core/exit? true} to bail out of the inducer-chain at all levels. Optionally, add
+  application exit code when exiting inducer chain."
+  ([context]
+    (assoc context (key ctx-exit?) true))
+  ([context ^long exit-code]
+    (-> context
+      (assoc (key ctx-app-exit-code) exit-code)
+      (assoc (key ctx-exit?) true))))

 (defn print-config


Fix broken seed file

Fix broken seed file

--- src/braid/server/seed.clj
+++ src/braid/server/seed.clj
@@ -13,10 +13,14 @@
   (db/init! (config :db-url)))

 (defn seed! []
-  (let [[group-1 group-2] (db/run-txns!
-                            (concat
-                              (group/create-group-txn {:id (db/uuid) :name "Braid"})
-                              (group/create-group-txn {:id (db/uuid) :name "Chat"})))
+  (let [_ (println "Create Groups")
+        [group-1 group-2]
+        (db/run-txns!
+          (concat
+            (group/create-group-txn {:id (db/uuid) :name "Braid"})
+            (group/create-group-txn {:id (db/uuid) :name "Chat"})))
+
+        _ (println "Create Users")
         [user-1 user-2]
         (db/run-txns!
           (concat
@@ -32,21 +36,25 @@
                :nickname "bar"
                :password "bar"
                :avatar "data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})))
+
+        _ (println "Add Users to Groups and Make Users Admins")
         _ (db/run-txns!
             (concat
               (group/user-add-to-group-txn (user-1 :id) (group-1 :id))
               (group/user-add-to-group-txn (user-2 :id) (group-1 :id))
               (group/user-add-to-group-txn (user-1 :id) (group-2 :id))
               (group/user-add-to-group-txn (user-2 :id) (group-2 :id))
+              (group/user-make-group-admin-txn (user-1 :id) (group-1 :id))
+              (group/user-make-group-admin-txn (user-2 :id) (group-2 :id))))

-              (group/user-make-group-admin! (user-1 :id) (group-1 :id))
-              (group/user-make-group-admin! (user-2 :id) (group-2 :id))))
+        _ (println "Create Tags")
+        [tag-1 tag-2]
+        (db/run-txns!
+          (concat
+            (tag/create-tag-txn {:id (db/uuid) :group-id (group-1 :id) :name "braid"})
+            (tag/create-tag-txn {:id (db/uuid) :group-id (group-1 :id) :name "watercooler"})))

-        [tag-1 tag-2] (db/run-txns!
-                        (concat
-                          (tag/create-tag-txn {:id (db/uuid) :group-id (group-1 :id) :name "braid"})
-                          (tag/create-tag-txn {:id (db/uuid) :group-id (group-1 :id) :name "watercooler"})))
-
+        _ (println "Subscribe Users to Tags")
         _ (db/run-txns!
             (concat
               (tag/user-subscribe-to-tag-txn (user-1 :id) (tag-1 :id))
@@ -54,31 +62,34 @@
               (tag/user-subscribe-to-tag-txn (user-1 :id) (tag-2 :id))
               (tag/user-subscribe-to-tag-txn (user-2 :id) (tag-2 :id))))

-        [msg1 msg2 msg3 msg4]
+        _ (println "Create Messages")
+        [msg-1]
+        (db/run-txns!
+          (message/create-message-txn {:id (db/uuid)
+                                       :group-id (group-1 :id)
+                                       :user-id (user-1 :id)
+                                       :thread-id (db/uuid)
+                                       :created-at (java.util.Date.)
+                                       :content "Hello?"
+                                       :mentioned-tag-ids [(tag-1 :id)]}))
+        [msg-2 msg-3 msg-4]
         (db/run-txns!
           (concat
             (message/create-message-txn {:id (db/uuid)
                                          :group-id (group-1 :id)
-                                         :user-id (user-1 :id)
-                                         :thread-id (db/uuid)
-                                         :created-at (java.util.Date.)
-                                         :content "Hello?"
-                                         :mentioned-tag-ids [(tag-1 :id)]})
-            (message/create-message-txn {:id (db/uuid)
-                                         :group-id (group-1 :id)
-                                         :thread-id (msg :thread-id)
+                                         :thread-id (msg-1 :thread-id)
                                          :user-id (user-2 :id)
                                          :created-at (java.util.Date.)
                                          :content "Hi!"})
             (message/create-message-txn {:id (db/uuid)
-                                         :thread-id (msg :thread-id)
+                                         :thread-id (msg-1 :thread-id)
                                          :group-id (group-1 :id)
                                          :user-id (user-1 :id)
                                          :created-at (java.util.Date.)
                                          :content "Oh, great, someone else is here."})
             (message/create-message-txn {:id (db/uuid)
                                          :group-id (group-1 :id)
-                                         :thread-id (msg :thread-id)
+                                         :thread-id (msg-1 :thread-id)
                                          :user-id (user-2 :id)
                                          :created-at (java.util.Date.)
                                          :content "Yep"})))
@@ -102,9 +113,7 @@
                                          :mentioned-tag-ids [(tag-3 :id)]})
             (message/create-message-txn {:id (db/uuid)
                                          :group-id (group-2 :id)
-                                         :thread-id (msg :thread-id)
+                                         :thread-id (msg-1 :thread-id)
                                          :user-id (user-2 :id)
                                          :created-at (java.util.Date.)
-                                         :content "Hi!"})))]
-    (println "users" user-1 user-2)
-    (println "tags" tag-2 tag-2)))
+                                         :content "Hi!"})))]))


Remove dead auth code

Remove dead auth code

--- src/catalog/web/views.clj
+++ src/catalog/web/views.clj
@@ -198,29 +198,3 @@

 (defn editorial [request editorial recommended]
   (response/redirect-after-post "/"))
-
-(defn login-form []
-  (layout/common nil
-   [:h3 "Login"]
-   (form/form-to
-    [:post "/login"]
-    (anti-forgery-field)
-    [:div.form-group
-     (form/label "username" "Username:")
-     (form/text-field {:class "form-control"} "username")]
-    [:div.form-group
-     (form/label "password" "Password:")
-     (form/password-field {:class "form-control"} "password")]
-    (form/submit-button {:class "btn btn-default"} "Login"))))
-
-(defn unauthorized [request]
-  (let [identity (friend/identity request)]
-    (->
-     (layout/common identity
-      [:h2
-       [:div.alert.alert-danger
-        "Sorry, you do not have sufficient privileges to access "
-        (:uri request)]]
-      [:p "Please ask an administrator for help"])
-     response/response
-     (response/status 401))))


namespace usage

namespace usage

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -6,7 +6,7 @@
    [babel.lexiconfn :refer [compile-lex if-then map-function-on-map-vals unify]]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
-   [babel.italiano.morphology :as morph]
+   [babel.italiano.morphology :refer [exception-generator italian-specific-rules phonize]]
    [babel.italiano.pos :refer [adjective agreement-noun cat-of-pronoun
                                common-noun comparative countable-noun determiner
                                drinkable-noun feminine-noun noun intransitive intransitivize
@@ -2156,8 +2156,8 @@

 ;; see TODOs in lexiconfn/compile-lex (should be more of a pipeline as opposed to a argument-position-sensitive function.
 (def lexicon (-> (compile-lex lexicon-source
-                              morph/exception-generator
-                              morph/phonize morph/italian-specific-rules)
+                              exception-generator
+                              phonize italian-specific-rules)

                  (map-function-on-map-vals
                   (fn [k vals]
@@ -2234,7 +2234,7 @@
                                           }}}
                           {:synsem {:sem {:obj :unspec}}})

-                 ;; subject of verbs must have nominative case
+                 ;; subject of verbs must have nominative case: prevents wrong things like article-less noun "casa" being the subject of a sentence.
                  (if-then {:synsem {:cat :verb}}
                           {:synsem {:subcat {:1 {:case :nom}}}})


Check if control exists before showing/hiding tabs

--- src/clj/nightcode/shortcuts.clj
+++ src/clj/nightcode/shortcuts.clj
@@ -107,24 +107,25 @@
     (add-tooltip! "")))

 (defn update-tabs! [^Scene scene pref-state runtime-state]
-  (let [tabs (.lookup scene "#tabs")
-        tooltip (.getTooltip tabs)
-        selected-path (:selection pref-state)
-        names (map (fn [path]
-                     (let [format-str (if (u/parent-path? selected-path path) "-> %s <-" "   %s   ")
-                           file-name (-> path io/file .getName)]
-                       (format format-str file-name)))
-                (-> runtime-state :editor-panes keys))
-        names (str/join "\n" names)]
-    (.setText tooltip (str "   PgUp PgDn   \n\n" names))))
+  (when-let [tabs (.lookup scene "#tabs")]
+    (let [tooltip (.getTooltip tabs)
+          selected-path (:selection pref-state)
+          names (map (fn [path]
+                       (let [format-str (if (u/parent-path? selected-path path) "-> %s <-" "   %s   ")
+                             file-name (-> path io/file .getName)]
+                         (format format-str file-name)))
+                  (-> runtime-state :editor-panes keys))
+          names (str/join "\n" names)]
+      (.setText tooltip (str "   PgUp PgDn   \n\n" names)))))

 (defn show-tabs! [^Stage stage ^Node node]
-  (let [tabs (.lookup node "#tabs")
-        content (.lookup node "#content")]
-    (show-tooltip! stage tabs content)))
+  (when-let [tabs (.lookup node "#tabs")]
+    (when-let [content (.lookup node "#content")]
+      (show-tooltip! stage tabs content))))

 (defn hide-tabs! [^Node node]
-  (hide-tooltip! (.lookup node "#tabs")))
+  (when-let [tabs (.lookup node "#tabs")]
+    (hide-tooltip! tabs)))

 (defn run-shortcut! [^Scene scene actions ^String text shift?]
   (when-let [id (key-char->id (if shift? text (.toLowerCase text)))]


Give all buttons radius'd corners

Give all buttons radius'd corners

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -29,7 +29,7 @@
         :as data}]
     ^{:key id}
     [:li
-     [:a.large.button
+     [:a.large.button.radius
       {:href (click-address data)}
       name]]))

@@ -87,7 +87,7 @@
          (map #(conj ^{:key (str "filter-" %)}
                      [filter-element site cl-filter]
                      %)))]
-   [:a.tiny.secondary.button
+   [:a.tiny.secondary.button.radius
     {:href (r/comics-path
             {:site site})}
     "clear filters"]])


removed legacy files that were causing a weird error

--- src/cljs/go_intermod/views.cljs
+++ src/cljs/go_intermod/views.cljs
@@ -1,11 +0,0 @@
-(ns gointermod.views
-    (:require [re-frame.core :as re-frame]
-              [gointermod.search.views :as search]
-              [gointermod.icons :as icons]))
-
-(defn main-panel []
-  (fn []
-    [:div
-      [icons/icons]
-     "HHH" [:svg.icon.icon-cog [:use {:xlinkHref "#icon-cog"}]] "JJJ"
-    [search/search]]))


refactor display.clj for more common clj style and inline protocol impls

--- src/clojupyter/misc/display.clj
+++ src/clojupyter/misc/display.clj
@@ -12,10 +12,9 @@

 ;; Incanter Plot

-(defrecord IncanterPlot [chart width height])
+(defrecord IncanterPlot [chart width height]

-(extend-protocol mc/PMimeConvertible
-  IncanterPlot
+  mc/PMimeConvertible
   (to-mime [plot]
     (let [out (io/java.io.ByteArrayOutputStream.)
           {:keys [chart width height]} plot]
@@ -31,26 +30,24 @@

 ;; Html

-(defrecord Html [html])
+(defrecord Html [html]

-(extend-protocol mc/PMimeConvertible
-  Html
-  (to-mime [self]
-      (mc/stream-to-string
-       {:text/html (:html self)})))
+  mc/PMimeConvertible
+  (to-mime [_]
+    (mc/stream-to-string
+     {:text/html html})))

 (defn make-html [html]
   (Html. html))

 ;; Latex

-(defrecord Latex [latex])
+(defrecord Latex [latex]

-(extend-protocol mc/PMimeConvertible
-  Latex
-  (to-mime [self]
+  mc/PMimeConvertible
+  (to-mime [_]
     (mc/stream-to-string
-      {:text/latex (:latex self)})))
+     {:text/latex latex})))

 (defn make-latex [latex]
   (Latex. latex))
@@ -58,13 +55,12 @@

 ;; Markdown

-(defrecord Markdown [markdown])
+(defrecord Markdown [markdown]

-(extend-protocol mc/PMimeConvertible
-  Markdown
-  (to-mime [self]
+  mc/PMimeConvertible
+  (to-mime [_]
     (mc/stream-to-string
-      {:text/markdown (:markdown self)})))
+     {:text/markdown markdown})))

-(defn make-markdown [latex]
-  (Markdown. latex))
+(defn make-markdown [markdown]
+  (Markdown. markdown))


Don't swallow query failure exceptions.

Don't swallow query failure exceptions.

Printing exceptions and continuing during the build process is
pointless.  Unless someone is watching the (fairly noisy, which, to be
fair is on me) output, the error will go unnoticed.  Any automated build
process will complete, seemingly successfully.

Given the desired outcome is a coherently enriched KB, it seems
preferable to fail outright if the rules are not properly applied than
to give the impression that everything completed as expected.

--- kabob-build/src/main/clojure/edu/ucdenver/ccp/kabob/build/run_rules.clj
+++ kabob-build/src/main/clojure/edu/ucdenver/ccp/kabob/build/run_rules.clj
@@ -175,11 +175,6 @@
             target-connection (rule-output-kb (:output-directory args) rule)]
         (try (time (run-forward-rule source-connection target-connection rule))
              true
-             (catch Exception e
-               (println "query failed.")
-               (prn e)
-               (.printStackTrace e)
-               nil)
              (finally (close target-connection)
                       (close source-connection)))))))


remove debug statement

remove debug statement

--- src/cljs/gointermod/heatmap/handlers.cljs
+++ src/cljs/gointermod/heatmap/handlers.cljs
@@ -94,7 +94,6 @@
         organisms-present (keys counts)
         missing-organisms (find-missing-organisms counts)]
       ;(.clear js/console)
-    (.log js/console (clj->js missing-organisms))
     {:rows final-heatmap-matrix :headers go-terms :max-count max-count :missing-organisms missing-organisms }
     ))


Add placeholder info window on marker click

--- src/cljs/gtfve/components/maps_panel.cljs
+++ src/cljs/gtfve/components/maps_panel.cljs
@@ -40,17 +40,41 @@
                              :properties #js {}
                              :geometry (maps/Data.Point.
                                         (maps/Maps.LatLng. (:stop/latitude data)
-                                                           (:stop/longitude data)))}})
+                                                           (:stop/longitude data)))}
+       :kill-ch (chan)})
     om/IWillMount
     (will-mount [_]
-      (let [gmap (om/get-state owner :gmap)
-            feature-options (om/get-state owner :feature-options)
+      (let [{:keys [gmap
+                    data-click-mult
+                    info-window
+                    feature-options kill-ch]} (om/get-state owner)
+            data-click-tap (chan (async/sliding-buffer 5))
             feature (.. gmap -data (add feature-options))]
-        (om/set-state! owner :feature feature)))
+        (async/tap data-click-mult data-click-tap)
+        (om/set-state! owner :feature feature)
+        (go-loop []
+          (let [[v ch] (alts! [kill-ch data-click-tap])]
+            (if (= ch kill-ch)
+              ::done
+              (do
+                (when (= (.-feature v) feature)
+                  (doto info-window
+                    (.setContent (html/render
+                                  (html
+                                   [:div.panel.panel-primary
+                                    [:div.panel-heading (:stop/name data)]
+                                    [:div.panel-body (pr-str data)]])))
+                    (.setPosition (.. v -feature (getGeometry) (get)))
+                    (.setOptions #js {:pixelOffset (maps/Maps.Size. 0 -30)})
+                    (.open gmap)))
+                (recur))))
+          (.close info-window)
+          (.. gmap -data (remove feature))
+          (async/untap data-click-mult data-click-tap))))
     om/IWillUnmount
     (will-unmount [_]
-      (let [{:keys [feature gmap]} (om/get-state owner)]
-        (.. gmap -data (remove feature))))
+      (let [{:keys [kill-ch]} (om/get-state owner)]
+        (put! kill-ch (js/Date.))))
     om/IRender
     (render [_]
       (html [:noscript]))))
@@ -62,6 +86,8 @@
       {:opts default-map-opts
        :gmap nil
        :bounds nil
+       :info-window (maps/Maps.InfoWindow.)
+       :data-click-ch (chan)
        :kill-ch (chan)})
     om/IDisplayName (display-name [_] "Maps View")
     om/IDidMount
@@ -71,7 +97,11 @@
             google-map (Maps.Map. node (clj->js opts))
             bounds-changed-ch (-> (maps/listen google-map "bounds_changed")
                                   (utils/debounce 100))
+            data-click-ch (maps/data-listen (.-data google-map)
+                                            "click"
+                                            (om/get-state owner :data-click-ch))
             kill-ch (om/get-state owner :kill-ch)]
+        (om/set-state! owner :data-click-mult (async/mult data-click-ch))
         (om/set-state! owner :gmap google-map)
         (go-loop []
           (let [[v ch] (alts! [kill-ch bounds-changed-ch])]
@@ -85,13 +115,15 @@
       (when-let [kill-ch (:kill-ch (om/get-state owner))]
         (put! kill-ch (js/Date.))))
     om/IRenderState
-    (render-state [_ {:keys [gmap] :as state}]
+    (render-state [_ {:keys [gmap info-window data-click-mult] :as state}]
       (let [stops (:stops-search-results data)]
         (html
          (into [:div.maps-viewport [:div.maps-canvas {:ref "gmap"}]]
                (when gmap
                  (om/build-all stop-marker stops {:key :stop/id
-                                                  :state {:gmap gmap}}))
+                                                  :state {:gmap gmap
+                                                          :info-window info-window
+                                                          :data-click-mult data-click-mult}}))
                ))))))

 (defn map-toolbar-button [{:keys [link control active?]} owner]


CLJS-470: fix `resolve-var` (.contains s ".") case

The issue was that `defprotocol` in the core.clj macros file emits
the native type dispatch cases with `foo.-bar`, `resolve-var`
would treat this as normal var resolution which it is not - use of
the `.` in symbols without a namespace clearly represents some
kind of interop or implementation detail.

`resolve-var` no longers warns on symbols that include `.` but not
`/`.

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -174,12 +174,9 @@
                  lb (-> env :locals prefix)]
              (if lb
                {:name (symbol (str (:name lb) suffix))}
-               (do
-                 (when confirm
-                   (confirm env prefix (symbol suffix)))
-                 (merge (get-in @namespaces [prefix :defs (symbol suffix)])
-                        {:name (if (= "" prefix) (symbol suffix) (symbol (str prefix) suffix))
-                         :ns prefix}))))
+               (merge (get-in @namespaces [prefix :defs (symbol suffix)])
+                 {:name (if (= "" prefix) (symbol suffix) (symbol (str prefix) suffix))
+                  :ns prefix})))

            (get-in @namespaces [(-> env :ns :name) :uses sym])
            (let [full-ns (get-in @namespaces [(-> env :ns :name) :uses sym])]


Set default name to "Anonymous"

Set default name to "Anonymous"

--- src/cljs/chat42/core.cljs
+++ src/cljs/chat42/core.cljs
@@ -101,7 +101,9 @@
 ;; Material UI with Om
 (defn create-msg [name text]
   {:text text
-   :name name
+   :name (if (= name "")
+            "Anonymous"
+            name)
    :date (.getTime (js/Date.))})


Improved layout, fixed resource handling logic.

--- src/cljs/medusa/core.cljs
+++ src/cljs/medusa/core.cljs
@@ -28,36 +28,47 @@
                  :on-click #(go (>! event-channel [:detector-selected detector]))}
                 (:name detector)])]))))

-;(html [:select {:ref "metrics-list"
-                ;:on-change #(let [selected-metric (get name>metric (.. % -target -value))]
-                              ;(go
-                                ;(>! event-channel [:metric-selected selected-metric])))}
-       ;(for [metric metrics]
-         ;[:option (:name metric)])])
+(defn metrics-list [{:keys [metrics selected-metric]} owner]
+  (reify
+    om/IDidMount
+    (did-mount [_]
+      (let [jq-element (js/$ (om/get-node owner "metrics-selector"))]
+        (.select2 jq-element #js {:placeholder ""
+                                  :allowClear true})))

-(defn metrics-list [{:keys [metrics]} owner]
-  (reify
     om/IDidUpdate
     (did-update [_ _ _]
       (let [event-channel (om/get-state owner :event-channel)
             name->metric (zipmap (map :name metrics) metrics)
             element (om/get-node owner "metrics-selector")
-            jq-element (js/$ element)
-            data (clj->js(for [metric metrics]
-                           #js {:id (:name metric), :text (:name metric)}))]
-        (.select2 jq-element #js {:placeholder "Bite me"
-                                  :data data})
+            jq-element (js/$ element)]
+        (.select2 jq-element #js {:placeholder ""
+                                  :allowClear true})
         (.on jq-element "change" (fn [e]
                                    (let [selected-metric (get name->metric (.-val e))]
                                      (go
-                                       (>! event-channel [:metric-selected selected-metric])))
-                                   ))))
-
+                                       (>! event-channel [:metric-selected selected-metric])))))))
     om/IRenderState
     (render-state [_ {:keys [event-channel]}]
-      (html [:div.form-group
-             [:div.input-group.select2-bootstrap-append
-              [:input.form-control.select2-allow-clear {:ref "metrics-selector" }] ]]))))
+      (html
+        [:div.form-group
+         [:label {:for "metrics-selector"} "Metric:"]
+         [:select.form-control {:ref "metrics-selector"
+                                :id "metrics-selector"}
+          [:option ""]
+          (for [metric metrics]
+            [:option (when (= metric selected-metric) {:selected true}) (:name metric)])]]))))
+
+
+(defn query-controls [{:keys [metrics selected-metric] :as state} owner]
+  (reify
+    om/IRenderState
+    (render-state [_ {:keys [event-channel]}]
+      (html
+        [:form
+         (om/build metrics-list
+                   (select-keys state [:metrics :selected-metric])
+                   {:init-state {:event-channel event-channel}})]))))

 (defn alerts-list [{:keys [alerts]}]
   (reify
@@ -108,36 +119,43 @@
             (condp = topic
               :detector-selected
               (do
+                (om/update! state [:selected-detector] message)
                 (om/update! state [:error :message] "")
-                (om/update! state [:selected-detector] message))
+                (om/update! state [:selected-metric] nil)
+                (om/update! state [:alerts] nil))

               :metric-selected
               (let [detector (:selected-detector @state)]
-                (om/update! state [:error :message] "")
-                (om/update! state [:selected-metric] message)))
+                (om/update! state [:selected-metric] message)
+                (om/update! state [:error :message] "")))
             ;retrieve resources
             (let [selected-detector (:selected-detector @state)
                   selected-metric (:selected-metric @state)]
               (match [selected-detector selected-metric]
                 [_ nil]
                 (do
-                  (update-resource state :metrics (str "/detectors/" (:id @message) "/metrics/"))
-                  (update-resource state :alerts (str "/detectors/" (:id @message) "/alerts/")))
+                  (update-resource state :metrics (str "/detectors/" (:id @selected-detector) "/metrics/"))
+                  (update-resource state :alerts (str "/detectors/" (:id @selected-detector) "/alerts/")))

                 [_ _]
-                (update-resource state :alerts (str "/detectors/" (:id @selected-detector) "/metrics/" (:id @message) "/alerts/"))))
+                (update-resource state :alerts (str "/detectors/" (:id @selected-detector) "/metrics/" (:id @selected-metric) "/alerts/"))))
             (recur)))))

     om/IRenderState
     (render-state [_ {:keys [event-channel]}]
-      (html [:div.container-fluid
-             (om/build detector-list
-                       (select-keys state [:detectors :selected-detector])
-                       {:init-state {:event-channel event-channel}})
-             (om/build metrics-list
-                       (select-keys state [:metrics])
-                       {:init-state {:event-channel event-channel}})
-             (om/build alerts-list (select-keys state [:alerts]))
-             (om/build error-notification (select-keys state [:error]))]))))
+      (html [:div.container
+             [:div.page-header
+              [:h1 "Telemetry alerting dashboard"]]
+             [:div.row
+              [:div.col-md-3
+               (om/build detector-list
+                         (select-keys state [:detectors :selected-detector])
+                         {:init-state {:event-channel event-channel}})
+               (om/build query-controls
+                         (select-keys state[:metrics :selected-metric])
+                         {:init-state {:event-channel event-channel}})
+               (om/build error-notification (select-keys state [:error]))]
+              [:div.col-md-9
+               (om/build alerts-list (select-keys state [:alerts]))]]]))))

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


When canvas element is reused - destroy previous processing object so it doesn't interfere with the new one.

--- src/cljs/quil/sketch.cljs
+++ src/cljs/quil/sketch.cljs
@@ -79,6 +79,10 @@
       (aset (aget sketch "options") "globalKeyEvents" true))
     sketch))

+(defn destroy-previous-sketch [host-elem]
+  (when-let [proc-obj (.-processing-obj host-elem)]
+    (.exit proc-obj)))
+
 (defn sketch [& opts]
   (let [opts-map (apply hash-map opts)
         host-elem (dom/getElement (:host opts-map))
@@ -89,8 +93,10 @@
           (when-not (= renderer (.-processing-context host-elem))
             (.warn js/console "WARNING: Using different context on one canvas!"))
           (set! (.-processing-context host-elem) renderer))
-        (js/Processing. host-elem (make-sketch opts-map)))
-      (.warn js/console "WARNING: Cannot create sketch. :host is not specified."))))
+        (destroy-previous-sketch host-elem)
+        (set! (.-processing-obj host-elem)
+              (js/Processing. host-elem (make-sketch opts-map))))
+      (.error js/console "ERROR: Cannot create sketch. :host is not specified."))))

 (def sketch-init-list (atom (list )))


abstract port

abstract port

--- src/cljs/server/core.cljs
+++ src/cljs/server/core.cljs
@@ -11,19 +11,20 @@
 (defonce body-parser (nodejs/require "body-parser"))

 (def app (express))
+(def port 3779)

 ;; attach body-parser
 (.use app (.urlencoded body-parser #js {:extended false}))
 (.use app (.json body-parser))

-(. app (get "/api" (fn [req res] (.send res "Hello, World!"))))
+(. app (get "/api/graph" (fn [req res] (.send res "Hello, World!"))))

 (. app (use (serve-static "resources/public" #js {:index "index.html"})))

 (def -main
   (fn []
       (doto (.createServer http #(app %1 %2))
-            (.listen 3779))))
+            (.listen port))))

 (set! *main-cli-fn* -main)


added speclj.run.spec to core.cljs.  this fixes dynamic var warning during cljs testing

--- src/cljs/speclj/core.cljs
+++ src/cljs/speclj/core.cljs
@@ -1,5 +1,6 @@
 (ns speclj.core
   "Speclj's API.  It contains nothing but macros, so that it can be used
   in both Clojure and ClojureScript."
-  (:require [clojure.data]))
+  (:require [clojure.data]
+            [speclj.run.standard]))


better cumulative graph

better cumulative graph

if i did nothing until halfway along, the graph should be at 0 for a
long time, then jump up, instead of going up gradually to where i
started

--- src/cljs/tictag/subs.cljs
+++ src/cljs/tictag/subs.cljs
@@ -101,9 +101,11 @@
  (fn [[pings query-fn] _]
   (map #(assoc % :active? (query-fn %)) pings)))

-(defn daily-total [prev [day freq]]
-  (let [[_ ytotal] (or (last prev) [nil 0])]
-    (conj prev [day (+ freq ytotal)])))
+(defn daily-total [freqs]
+  (fn [prev today]
+    (let [[_ ytotal] (or (last prev) [0 0])]
+      (conj prev [today (+ (freqs today) ytotal)]))))
+

 (reg-sub
  :day-cum-totals
@@ -115,11 +117,8 @@
          freqs           (->> pings
                               (filter :active?)
                               (map :days-since-epoch)
-                              (frequencies)
-                              (into (sorted-map)))
-         most            (reduce daily-total [[first-day 0]] freqs)
-         [_ final-total] (last most)]
-     (conj most [last-day final-total]))))
+                              (frequencies))]
+     (reduce (daily-total freqs) [] (range first-day last-day)))))

 (reg-sub


Rename function, indent lines.

Rename function, indent lines.

--- src/cljs/tunnit/core.cljs
+++ src/cljs/tunnit/core.cljs
@@ -31,7 +31,7 @@
 (def date-format
   (f/formatter "dd.MM."))

-(defn parse-date [date]
+(defn unparse-date [date]
   (f/unparse date-format date))

 (defn week-day-nr [date]
@@ -48,8 +48,8 @@
   (let [today-nr (week-day-nr (t/now))
         date (t/minus (t/now)
                       (t/days (- today-nr k)))]
-    [k (assoc v :date (parse-date date))]
-  ))
+    [k (assoc v :date (unparse-date date))]
+    ))

 (defn week-dates []
   (map-kv day-map count-date))
@@ -60,7 +60,7 @@
                         (map (fn [day]
                                (ot/output {:class "day-label"}
                                           (str (:name day) " " (:date day))))
-                              (vals (week-dates)))
+                             (vals (week-dates)))
                         )))

 (defcomponent app-view [app owner]


Moar.

Moar.

--- src/clojurecraft/core.clj
+++ src/clojurecraft/core.clj
@@ -15,6 +15,7 @@
      0x06 :spawnposition
      0x07 :useentity
      0x08 :updatehealth
+     0x09 :respawn
 })
 (def packet-ids (apply assoc {} (mapcat reverse packet-types)))

@@ -88,6 +89,11 @@

       (-write-string16 conn message))

+(defn write-packet-respawn [conn {world :world}]
+      (-write-byte conn (:respawn packet-ids))
+
+      (-write-bool conn world))
+

 ; Writing Wrappers -----------------------------------------------------------------
 (defn flushc [conn]
@@ -97,7 +103,9 @@
       (cond
         (= packet-type :keepalive) (write-packet-handshake conn payload)
         (= packet-type :handshake) (write-packet-handshake conn payload)
-        (= packet-type :login) (write-packet-login conn payload)
+        (= packet-type :login)     (write-packet-login conn payload)
+        (= packet-type :chat)      (write-packet-chat conn payload)
+        (= packet-type :respawn)   (write-packet-respawn conn payload)
         )
       (flushc conn))

@@ -174,6 +182,10 @@
 (defn read-packet-updatehealth [conn]
       (-> {}
           (assoc :health (-read-short conn))))
+
+(defn read-packet-respawn [conn]
+      (-> {}
+          (assoc :world (-read-byte conn))))

 ; Reading Wrappers -----------------------------------------------------------------
@@ -183,15 +195,16 @@
         (println "\n----->")
         (println
           (cond
-            (= packet-type :keepalive) (read-packet-keepalive conn)
-            (= packet-type :handshake) (read-packet-handshake conn)
-            (= packet-type :login) (read-packet-login conn)
-            (= packet-type :chat) (read-packet-chat conn)
-            (= packet-type :timeupdate) (read-packet-timeupdate conn)
-            (= packet-type :equipment) (read-packet-equipment conn)
+            (= packet-type :keepalive)     (read-packet-keepalive conn)
+            (= packet-type :handshake)     (read-packet-handshake conn)
+            (= packet-type :login)         (read-packet-login conn)
+            (= packet-type :chat)          (read-packet-chat conn)
+            (= packet-type :timeupdate)    (read-packet-timeupdate conn)
+            (= packet-type :equipment)     (read-packet-equipment conn)
             (= packet-type :spawnposition) (read-packet-spawnposition conn)
-            (= packet-type :useentity) (read-packet-useentity conn)
-            (= packet-type :updatehealth) (read-packet-updatehealth conn)
+            (= packet-type :useentity)     (read-packet-useentity conn)
+            (= packet-type :updatehealth)  (read-packet-updatehealth conn)
+            (= packet-type :respawn)       (read-packet-respawn conn)
             :else (str "UNKNOWN PACKET TYPE: " packet-id)
             ))
         (println "\n\n\n")))


Check new payload.

Check new payload.

--- test/onyx/coordinator/simulation_test.clj
+++ test/onyx/coordinator/simulation_test.clj
@@ -282,7 +282,7 @@

         (let [next-payload-node (extensions/create sync :payload)]
           (extensions/write-place sync peer-node next-payload-node)
-;          (extensions/on-change sync next-payload-node #(>!! sync-spy %))
+          (extensions/on-change sync next-payload-node #(>!! sync-spy %))

           (testing "Touching the completion node triggers the callback"
             (let [nodes (:nodes (extensions/read-place sync payload-node))]
@@ -303,8 +303,8 @@
                               [?p :node/completion ?completion]]
                       result (d/q query db peer-node)]
                   (is (empty? result))))))
-
-          #_(testing "The payload node is populated"
+
+          (testing "The payload node is populated"
             (let [event (<!! sync-spy)]
               (is (= (:path event) next-payload-node)))))))
     {:eviction-delay 500000}))


CMR-627: Removed extra logging.

CMR-627: Removed extra logging.

--- src/cmr/search/services/query_service.clj
+++ src/cmr/search/services/query_service.clj
@@ -105,10 +105,7 @@
     (debug "query-creation-time:" query-creation-time
            "query-execution-time:" query-execution-time
            "result-gen-time:" result-gen-time)
-    (info (format "Found %d %ss in %d ms in format %s with params %s."
-                  (:hits results) (name concept-type) total-took (:result-format query) (pr-str params)))
     {:results result-str :hits (:hits results) :took took :total-took total-took}))
-

 (deftracefn find-concepts-by-parameters
   "Executes a search for concepts using the given parameters. The concepts will be returned with


fixes to allow removing multiple actors at once, and adding actors within a BundleEntity.

--- src/play_clj/core_listeners.clj
+++ src/play_clj/core_listeners.clj
@@ -192,14 +192,19 @@
         (.setWorldSize (. camera viewportWidth) (. camera viewportHeight))
         (.update (game :width) (game :height) true))))
   ([{:keys [^Stage renderer ui-listeners]} entities]
-     (let [current (->> (map :object entities)
+     (let [bundle? #(instance? BundleEntity %)
+           current (->> entities
+                        (mapcat #(tree-seq bundle? :entities %))
+                        (map :object)
                         (filter #(instance? Actor %))
                         (into #{}))
-           new-actors (apply disj current (.getActors renderer))]
-       (doseq [^Actor a (.getActors renderer)
-               :when (not (current a))]
+           ;; realize this before removing from it, since mutable
+           previous (set (.getActors renderer))
+           entering (clojure.set/difference current previous)
+           exiting (clojure.set/difference previous current)]
+       (doseq [^Actor a exiting]
          (.remove a))
-       (doseq [^Actor a new-actors]
+       (doseq [^Actor a entering]
          (.addActor renderer a)
          (doseq [[_ listener] ui-listeners]
            (.addListener a listener))))))


Refactor end-to-end-test to make it more readable

--- test/lambdacd_git/end_to_end_test.clj
+++ test/lambdacd_git/end_to_end_test.clj
@@ -42,46 +42,75 @@

 ; ======================================================================================================================

-
-
 (defn trigger-id [ctx build-number step-id]
   (let [step-result (lambdacd-state/get-step-result ctx build-number step-id)]
     (:trigger-id step-result)))

-(defn- trigger-manually [pipeline]
+(defn- trigger-manually-internal [pipeline]
   (let [ctx (:context pipeline)]
     (test-utils/while-with-timeout 10000 (nil? (trigger-id ctx 1 [1 1]))
-                        (Thread/sleep 1000))
+                                   (Thread/sleep 1000))
     (manualtrigger/post-id ctx (trigger-id ctx 1 [1 1]) {})))
+
+(defn- init-state [& {:keys [config pipeline-structure]}]
+  (atom {:config             config
+         :pipeline           (lambdacd/assemble-pipeline pipeline-structure config)
+         :pipeline-structure pipeline-structure}))
+
+(defn- start-pipeline [state]
+  (let [pipeline-structure (:pipeline-structure @state)
+        ctx                (:context (:pipeline @state))]
+    (swap! state #(assoc % :future-pipeline-result
+                           (future
+                             (lambdacd-execution/run pipeline-structure ctx)))))
+  state)
+
+(defn- trigger-manually [state]
+  (trigger-manually-internal (:pipeline @state))
+  state)
+
+(defn pipeline-result [state]
+  (deref (:future-pipeline-result @state) 60000 :timeout))
+
+(defn wait-for-completion [state]
+  (pipeline-result state)
+  state)
+
+(defmacro expect-success [state]
+  ; macro is inlined, therefore convinces cursive to mark the call location of the check as failed, not the implementation
+  `(let [pipeline-result# (pipeline-result ~state)]
+     (is (= :success (:status pipeline-result#)) (str "No success in " pipeline-result#))
+     ~state))
+
+; ======================================================================================================================

 (deftest example-pipeline-test
   (testing "the example-pipeline"
-    (let [config                 {:home-dir (lambdacd-util/create-temp-dir)}
-          pipeline               (lambdacd/assemble-pipeline simple-pipeline/pipeline-structure config)
-          future-pipeline-result (future
-                                   (lambdacd-execution/run (:pipeline-def pipeline) (:context pipeline)))]
-      (trigger-manually pipeline)
-      (let [pipeline-result (deref future-pipeline-result 60000 :timeout)]
-        (is (= :success (:status pipeline-result)) (str "No success in " pipeline-result))))))
+    (-> (init-state :config {:home-dir (lambdacd-util/create-temp-dir)}
+                    :pipeline-structure simple-pipeline/pipeline-structure)
+        (start-pipeline)
+        (trigger-manually)
+        (wait-for-completion)
+        (expect-success))))

 (deftest ^:e2e-with-auth end-to-end-with-auth-test
   (testing "a complete pipeline with all features against private repositories using https and ssh"
     (doseq [repo-config [{:repo-uri (or (System/getenv "LAMBDACD_GIT_TESTREPO_SSH") "git@gitlab.com:flosell-test/testrepo.git")
-                          :git {:ssh {:strict-host-key-checking "no"}}}
+                          :git      {:ssh {:strict-host-key-checking "no"}}}
                          {:repo-uri (or (System/getenv "LAMBDACD_GIT_TESTREPO_HTTPS") "https://gitlab.com/flosell-test/testrepo.git")
                           :git      {:credentials-provider (UsernamePasswordCredentialsProvider. (System/getenv "LAMBDACD_GIT_TESTREPO_USERNAME")
                                                                                (System/getenv "LAMBDACD_GIT_TESTREPO_PASSWORD"))}}]]
       (testing (:repo-uri repo-config)
-        (let [config                 (assoc repo-config :home-dir (lambdacd-util/create-temp-dir))
-              pipeline               (lambdacd/assemble-pipeline pipeline-structure config)
-              future-pipeline-result (future
-                                       (lambdacd-execution/run (:pipeline-def pipeline) (:context pipeline)))]
-          (trigger-manually pipeline)
-          (let [pipeline-result (deref future-pipeline-result 60000 :timeout)]
-            (is (= :success (:status pipeline-result)) (str "No success in " pipeline-result)))
-          ; Run pipeline again, this time it should be triggered by wait-for git that picks up the tag created in the previous run
-          (let [future-second-pipeline-result (future
-                                                (lambdacd-execution/run (:pipeline-def pipeline) (:context pipeline)))
-                pipeline-result               (deref future-second-pipeline-result 60000 :timeout)]
-            (is (= :success (:status pipeline-result)) (str "No success in " pipeline-result))))))))
+        (-> (init-state :config (assoc repo-config :home-dir (lambdacd-util/create-temp-dir))
+                        :pipeline-structure pipeline-structure)
+            (start-pipeline)
+            (trigger-manually)
+            (wait-for-completion)

+            (expect-success)
+
+            (start-pipeline)
+            (wait-for-completion)
+
+            (expect-success))))))
+


use BIT in place of BOOLEAN

use BIT in place of BOOLEAN

--- test/metabase/test/data/mysql.clj
+++ test/metabase/test/data/mysql.clj
@@ -13,7 +13,7 @@

 (def ^:private ^:const field-base-type->sql-type
   {:BigIntegerField "BIGINT"
-   :BooleanField    "BOOL" ;; TODO
+   :BooleanField    "BIT" ; There's no boolean type in MySQL (!)
    :CharField       "VARCHAR(254)"
    :DateField       "DATE"
    :DateTimeField   "TIMESTAMP"


Multiply two matrix variables

Multiply two matrix variables


[#2861] Add "created" to transformation spec [specs]

--- backend/specs/akvo/lumen/specs/transformation.clj
+++ backend/specs/akvo/lumen/specs/transformation.clj
@@ -11,7 +11,8 @@
             [clojure.spec.alpha :as s]
             [clojure.spec.gen.alpha :as gen]
             [clojure.string :as string]
-            [clojure.tools.logging :as log]))
+            [clojure.tools.logging :as log])
+  (:import [java.time Instant]))

 (def columnName? string?)

@@ -29,6 +30,8 @@

 (create-ns 'akvo.lumen.specs.transformation.engine)
 (alias 'transformation.engine.s 'akvo.lumen.specs.transformation.engine)
+
+(s/def ::transformation.engine.s/created (s/with-gen #(instance? Instant %) (fn [] lumen.s/instant-gen)))

 (s/def ::transformation.engine.s/onError #{"leave-empty" "fail" "delete-row" "default-value"})

@@ -63,11 +66,17 @@
 (s/def ::transformation.delete-column/args
   (s/keys :req-un [::db.dsv.column.s/columnName]))

+
+(s/def ::transformation.delete-column/args
+  (s/keys :req-un [::db.dsv.column.s/columnName]))
+
+
 (defmethod op-spec "core/delete-column"  [_]
   (s/keys
    :req-un [::transformation.delete-column/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.change-datatype)
@@ -87,7 +96,8 @@
   (s/keys
    :req-un [::transformation.change-datatype/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.combine)
 (alias 'transformation.combine 'akvo.lumen.specs.transformation.combine)
@@ -106,7 +116,8 @@
   (s/keys
    :req-un [::transformation.combine/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.derive)
@@ -127,7 +138,8 @@
   (s/keys
    :req-un [::transformation.derive/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.filter-column)
@@ -147,7 +159,8 @@
   (s/keys
    :req-un [::transformation.filter-column/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.generate-geopoints)
@@ -167,7 +180,8 @@
   (s/keys
    :req-un [::transformation.generate-geopoints/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.merge-datasets)
 (alias 'transformation.merge-datasets 'akvo.lumen.specs.transformation.merge-datasets)
@@ -315,7 +329,8 @@
   (s/keys
    :req-un [::transformation.extract-multiple/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.rename-column)
@@ -332,7 +347,8 @@
   (s/keys
    :req-un [::transformation.rename-column/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

@@ -386,7 +402,8 @@
   (s/keys
    :req-un [::transformation.sort-column/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.remove-sort)
 (alias 'transformation.remove-sort 'akvo.lumen.specs.transformation.remove-sort)
@@ -400,7 +417,8 @@
   (s/keys
    :req-un [::transformation.remove-sort/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.split-column)
 (alias 'transformation.split-column 'akvo.lumen.specs.transformation.split-column)
@@ -421,7 +439,8 @@
   (s/keys
    :req-un [::transformation.split-column/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.trim)
 (alias 'transformation.trim 'akvo.lumen.specs.transformation.trim)
@@ -433,7 +452,8 @@
   (s/keys
    :req-un [::transformation.trim/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.to-lowercase)
 (alias 'transformation.to-lowercase 'akvo.lumen.specs.transformation.to-lowercase)
@@ -445,7 +465,8 @@
   (s/keys
    :req-un [::transformation.to-lowercase/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.to-uppercase)
 (alias 'transformation.to-uppercase 'akvo.lumen.specs.transformation.to-uppercase)
@@ -457,7 +478,8 @@
   (s/keys
    :req-un [::transformation.to-uppercase/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.to-titlecase)
 (alias 'transformation.to-titlecase 'akvo.lumen.specs.transformation.to-titlecase)
@@ -469,7 +491,8 @@
   (s/keys
    :req-un [::transformation.to-titlecase/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.transformation.trim-doublespace)
 (alias 'transformation.trim-doublespace 'akvo.lumen.specs.transformation.trim-doublespace)
@@ -481,7 +504,8 @@
   (s/keys
    :req-un [::transformation.trim-doublespace/args
             ::transformation.engine.s/onError
-            ::transformation.engine.s/op]))
+            ::transformation.engine.s/op]
+   :opt-un [::transformation.engine.s/created]))

 (create-ns  'akvo.lumen.specs.dataset-version.transformation)
 (alias 'db.dsv.transformation 'akvo.lumen.specs.dataset-version.transformation)


Fix bench utils

Fix bench utils

--- benchmarks/caesium/crypto/secretbox_benchmark.clj
+++ benchmarks/caesium/crypto/secretbox_benchmark.clj
@@ -4,6 +4,7 @@
              [binding :refer [sodium]]
              [byte-bufs :as bb]
              [randombytes :refer [randombytes]]]
+            [byte-streams :as bs]
             [caesium.crypto.secretbox :as s]
             [clojure.test :refer [deftest]]
             [criterium.core :refer [bench]])


Fix basic cljs-repl function

Fix basic cljs-repl function

This loses the rebel integration, when you drop into figwheel. This is
because figwheel's REPL takes over.

--- app/dev/dev.clj
+++ app/dev/dev.clj
@@ -1,18 +1,19 @@
 ;; Copyright © 2016-2018, JUXT LTD.
 (ns dev
   (:require
+   [clojure.core.async :as a :refer [>! <! >!! <!! chan buffer dropping-buffer sliding-buffer close! timeout alts! alts!! go-loop]]
+   [clojure.java.io :as io]
    [clojure.pprint :refer [pprint]]
-   [clojure.test :refer [run-all-tests]]
    [clojure.reflect :refer [reflect]]
    [clojure.repl :refer [apropos dir doc find-doc pst source]]
+   [clojure.test :refer [run-all-tests]]
    [clojure.tools.namespace.repl :refer [refresh refresh-all]]
-   [clojure.java.io :as io]
    [com.stuartsierra.component :as component]
-   [clojure.core.async :as a :refer [>! <! >!! <!! chan buffer dropping-buffer sliding-buffer close! timeout alts! alts!! go-loop]]
    [edge.system :as system]
-   [reloaded.repl :refer [system init start stop reset reset-all]]
-   [yada.test :refer [response-for]]
-   [io.aviso.ansi]))
+   [figwheel-sidecar.repl-api]
+   [io.aviso.ansi]
+   [reloaded.repl :refer [system init start stop go reset reset-all]]
+   [yada.test :refer [response-for]]))

 (when (System/getProperty "edge.load_krei")
   (require 'load-krei))
@@ -42,9 +43,7 @@
 (defn cljs-repl
   "Start a ClojureScript REPL"
   []
-  (eval
-   '(do (in-ns 'boot.user)
-        (start-repl))))
+  (figwheel-sidecar.repl-api/cljs-repl))

 ;; REPL Convenience helpers


Instrumenting with log-info Increase all users loop timeout

--- jar-async/src/slipstream/async/collector.clj
+++ jar-async/src/slipstream/async/collector.clj
@@ -19,7 +19,7 @@
 (def collector-chan-size 64)
 (def metrics-update-chan-size 64)
 (def number-of-readers 32)
-(def timeout-all-users-loop (seconds-in-msecs 120))
+(def timeout-all-users-loop (seconds-in-msecs 240))
 (def timeout-online-loop (seconds-in-msecs 10))
 (def timeout-collect (seconds-in-msecs 15))
 (def timeout-processing-loop (seconds-in-msecs 600))
@@ -59,12 +59,13 @@
   (let [ch (chan 1)]
     (go
       (let [[v c] (alts! [ch (timeout timeout-collect)])]
-        (when (nil? v)
+        (if (nil? v)
           (log/log-error
             "Timeout collecting vms for user "
             (.getName user)
             " on cloud "
-            (.getConnectorInstanceName connector)))))
+            (.getConnectorInstanceName connector))
+          (log/log-info (str "executed collect request for " (.getName user) " and " (.getConnectorInstanceName connector))))))
     (go (>! ch (Collector/collect user connector)))))

 (defn update-metric!
@@ -72,10 +73,11 @@
   (let [ch (chan 1)]
     (go
       (let [[v c] (alts! [ch (timeout timeout-collect)])]
-        (when (nil? v)
+        (if (nil? v)
           (log/log-error
             "Timeout updating metrics for user "
-            (.getName user)))))
+            (.getName user))
+          (log/log-info (str "executed update-metric request for " (.getName user))))))
     (go (>! ch (updator/update user)))))

 (def not-nil? (complement nil?))
@@ -91,6 +93,7 @@
           (if (nil? user)
             (log/log-info "Collect reader " i " loop idle. Looping...")
             (try
+              (log/log-info (str "executing collect request for " (.getName user) " and " (.getConnectorInstanceName connector)))
               (collect! user connector)
               (catch Exception e (log/log-error "caught exception: " (.getMessage e))))))))))

@@ -107,6 +110,7 @@
           (if (nil? user)
             (log/log-info "Metric reader " i " loop idle. Looping...")
             (try
+              (log/log-info (str "executing update request for " (.getName user)))
               (update-metric! user)
               (catch Exception e (log/log-error "caught exception: " (.getMessage e))))))))))

@@ -115,7 +119,7 @@
 (defn insert-collection-requests
   [users]
   (doseq [user users
-        connector (connectors)]
+          connector (connectors)]
     (go
       (>! collector-chan [user connector]))))

@@ -132,12 +136,14 @@
     (while true
       (<!! (timeout timeout-online-loop))
       (let [users (online-users)]
+        (log/log-info "inserting online users requests")
         (insert-collection-requests users)
         (insert-update-metric-requests users))))
   (thread
     (while true
       (<!! (timeout timeout-all-users-loop))
       (let [users (users)]
+        (log/log-info "inserting all users requests")
         (insert-collection-requests users))
         (insert-update-metric-requests users))))


Don't confuse Jim.

Don't confuse Jim.

--- modules/web/src/main/clojure/fnbox/web.clj
+++ modules/web/src/main/clojure/fnbox/web.clj
@@ -4,11 +4,11 @@
   (:import (javax.servlet.http HttpServletRequest
                                HttpServletResponse)))

-(defn handler [handler]
+(defn handler [app]
   (fn [^HttpServletRequest request
        ^HttpServletResponse response]
     (.setCharacterEncoding response "UTF-8")
-    (if-let [response-map (handler (servlet/build-request-map request))]
+    (if-let [response-map (app (servlet/build-request-map request))]
       (servlet/update-servlet-response response response-map)
       (throw (NullPointerException. "Handler returned nil.")))))


Try serving up project files.

Try serving up project files.

--- src/gorilla_repl/core.clj
+++ src/gorilla_repl/core.clj
@@ -90,7 +90,8 @@
            (GET "/gorilla-files" [] (wrap-api-handler gorilla-files))
            (GET "/config" [] (wrap-api-handler config))
            (GET "/repl" [] ws-relay/ring-handler)
-           (route/resources "/"))
+           (route/resources "/")
+           (route/files "/project" [:root "."]))

 (defn run-gorilla-server


Oikea default-url

Oikea default-url

--- mtg-pairings-wer/src/mtg_pairings/core.clj
+++ mtg-pairings-wer/src/mtg_pairings/core.clj
@@ -27,7 +27,7 @@
   (watcher/save-state! "wer.edn"))

 (def default-properties {:db (str (System/getenv "APPDATA") "\\Wizards of the Coast\\Event Reporter\\TournamentData.dat")
-                         :url "http://mtgsuomi.fi/pairings"
+                         :url "http://p.mtgsuomi.fi"
                          :api-key ""})

 (defn property [key]


Avoids calling krb5_prestash in test-kerberos-authenticator (#33)

--- waiter/test/waiter/auth/kerberos_test.clj
+++ waiter/test/waiter/auth/kerberos_test.clj
@@ -110,9 +110,10 @@
         (is (nil? (check-has-prestashed-tickets query-chan nil "service-id")))))))

 (deftest test-kerberos-authenticator
-  (let [config {:password "test-password"
-                :prestash-cache-refresh-ms 100
-                :prestash-cache-min-refresh-ms 10
-                :prestash-query-host "example.com"}
-        authenticator (kerberos-authenticator config)]
-    (is (= :kerberos (auth/auth-type authenticator)))))
+  (with-redefs [start-prestash-cache-maintainer (constantly nil)]
+    (let [config {:password "test-password"
+                  :prestash-cache-refresh-ms 100
+                  :prestash-cache-min-refresh-ms 10
+                  :prestash-query-host "example.com"}
+          authenticator (kerberos-authenticator config)]
+      (is (= :kerberos (auth/auth-type authenticator))))))


Correct wording in icon button demo

Correct wording in icon button demo

--- src/re_demo/md_icon_button.cljs
+++ src/re_demo/md_icon_button.cljs
@@ -32,7 +32,7 @@
                                            :gap "15px"
                                            :children [[example-icons selected-icon]
                                                       [gap :size "10px"]
-                                                      [p "Here's what the chosen icon looks like in a Circle Icon Button."]
+                                                      [p "Here's what the chosen icon looks like in an Icon Button."]
                                                       [h-box
                                                        :gap      "20px"
                                                        :align    :center