Fix proc-test for Windows (#386)

Fix proc-test for Windows (#386)

Closes #382

--- test/etaoin/proc_test.clj
+++ test/etaoin/proc_test.clj
@@ -5,20 +5,25 @@
             [etaoin.proc :as proc]
             [clojure.string :as str]))

-(defn get-count-chromedriver-processes
+(defn get-count-chromedriver-instances
   []
-  (->> (sh "sh" "-c" "ps aux | grep chromedriver")
-       :out
-       str/split-lines
-       (drop-last 2)
-       count))
+  (let [process-count (->> (if proc/windows?
+                             (sh "tasklist")
+                             (sh "sh" "-c" "ps aux"))
+                           :out
+                           str/split-lines
+                           (filter #(str/includes? % "chromedriver"))
+                           count)]
+    (if proc/windows?
+      (/ process-count 2) ;; on Windows we seem to have 2 chromedriver.exe instances per launch
+      process-count)))

 (deftest test-prevent-process-fork
   (testing "certain driver port"
     (let [port    9999
           process (proc/run ["chromedriver" (format "--port=%d" port)])
           _       (wait-running {:port port :host "localhost"})]
-      (is (= 1 (get-count-chromedriver-processes)))
+      (is (= 1 (get-count-chromedriver-instances)))
       (is (thrown-with-msg?
             clojure.lang.ExceptionInfo
             #"already in use"
@@ -29,12 +34,12 @@
           process (proc/run ["chromedriver" (format "--port=%d" port)])
           _       (wait-running {:port port :host "localhost"})]
       (with-chrome {:args ["--no-sandbox"]} driver
-        (is (= 2 (get-count-chromedriver-processes)))
+        (is (= 2 (get-count-chromedriver-instances)))
         (proc/kill process))))
   (testing "connect to driver"
     (let [port    9999
           process (proc/run ["chromedriver" (format "--port=%d" port)])
           _       (wait-running {:port port :host "localhost"})
           driver  (chrome {:host "localhost" :port port :args ["--no-sandbox"]})]
-      (is (= 1 (get-count-chromedriver-processes)))
+      (is (= 1 (get-count-chromedriver-instances)))
       (proc/kill process))))


improved JSON filter tests

improved JSON filter tests

--- test/selmer/core_test.clj
+++ test/selmer/core_test.clj
@@ -1,5 +1,6 @@
 (ns selmer.core-test
   (:require [clojure.test :refer :all]
+            [cheshire.core :refer :all]
             [selmer.tags :refer :all]
             [selmer.filters :refer :all]
             [selmer.parser :refer :all]
@@ -510,14 +511,19 @@
   (is (= "y" (render "{{f|pluralize:y:ies}}" {:f 1})))
   (is (= "ies" (render "{{f|pluralize:y:ies}}" {:f 3}))))

+(defn unescape [s]
+  (-> (.replaceAll """ "\"")))
+
 ;; to-json is simply json here
 (deftest filter-to-json
   (is (= "1" (render "{{f|json}}" {:f 1})))
   (is (= "[1]" (render "{{f|json}}" {:f [1]})))
-  (is (= "{"dan":"awesome","foo":27}"
-         (render "{{f|json}}" {:f {:foo 27 :dan "awesome"}})))
-  (is (= "{\"dan\":\"awesome\",\"foo\":27}"
-         (render "{{f|json|safe}}" {:f {:foo 27 :dan "awesome"}})))
+  (is (= {"dan" "awesome", "foo" 27}
+         (-> (render "{{f|json}}" {:f {:foo 27 :dan "awesome"}})
+             (.replaceAll """ "\"")
+             parse-string)))
+  (is (= {"dan" "awesome", "foo" 27}
+         (parse-string (render "{{f|json|safe}}" {:f {:foo 27 :dan "awesome"}}))))
   ;; safe only works at the end
   #_(is (= "{\"foo\":27,\"dan\":\"awesome\"}"
          (render "{{f|safe|json}}" {:f {:foo 27 :dan "awesome"}})))


focus off input after query to use vimium


fix 'past perfect' : tense should be present


+(defn filtered-lexicon)

+(defn filtered-lexicon)


add :obj for all senses of the preposition "a"


fixup

fixup

--- src/clj/freestuffly/scraper.clj
+++ src/clj/freestuffly/scraper.clj
@@ -6,7 +6,7 @@
   (:require [hickory.select :as s]))

 (def ^:private interesting-keywords
-  #"(?i)paint|playstation|camp|emulsion|lamp|ladder|roller|xbox|mac|fish|marine|kitchen|new|unused|ergodox|cherry")
+  #"(?i)paint|playstation|camp|emulsion|lamp|ladder|roller|xbox|mac|fish|marine|kitchen|new|unused|ergodox|cherry|programming|roller|suitcase")

 (def ^:private freecycle-group "southwark-freecycle")
 (def ^:private freecycle-results-per-page 100)


Refactoring ideas

Refactoring ideas

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -113,9 +113,7 @@

 (defn render-card
   ; TODO - Try to avoid the update-card! use and use messages / cursors
-  ; * Add an inner ratom? Then use a watch on it to update?
-  ; * Provide a callback to provide message below?
-  ; * Or fix the filter on top of the board to provide cursors down?
+  ; * Fix the filter on top of the board to provide cursors down?
   [card]
   (let [show-details (::show-details card)
         toggle-details #(update-card! (update-in card [::show-details] not))
@@ -157,7 +155,11 @@
 (defn render-app
   []
   ; TODO - Try to go deeper with a cursor
-  ; Try to filter, providing a list of cursors instead
+  ; Solution 1: Try to filter, providing a list of cursors instead
+  ; Solution 2: Do not make such a big tree of functions
+  ; - The DOM needs to be that deep
+  ; - But you can create the card at the top
+  ; - And then you can assemble them (group-by or filter)
   (let [filter (r/cursor app-state [:filter])
         cards (reaction (filter-by-title @filter (:cards @app-state)))]
     [:div


don't use partial

don't use partial

--- src/cljs/dato/lib/web_peer.cljs
+++ src/cljs/dato/lib/web_peer.cljs
@@ -107,7 +107,7 @@
 (defn add-web-peer-metadata [db-conn send-fn meta-data]
   (assert (empty? (::tx-queue meta-data)))
   (let [q (queue/new-queue)]
-    (queue/add-consumer q (partial maybe-send-next-item db-conn send-fn))
+    (queue/add-consumer q (fn [q-atom] (maybe-send-next-item db-conn send-fn q-atom)))
     (assoc meta-data ::tx-queue {:queue q
                                  :sending (atom #{})
                                  :lock (atom nil)})))


Include the li tag in story-list-item component

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -79,33 +79,34 @@
 (defn story-list-item-fn [story]
   (let [{:keys [by id title score url kids preview -updated?]} @story]
     (when (every? identity [by title score])
-      [:div {:class (if -updated?
-                      (do
-                        (swap! story assoc :-updated? false)
-                        "new")
-                      "old")}
-       [:p.title [:a {:href url} title]]
-       [:p.subtext
-        (str score " points by " by)
-        " | "
-        [:a {:href (str "/#/items/" id)}
-         (str (count kids) " threads")]
-        " | "
-        (if preview
-          [:span {:on-click #(binding [base/closer-root [:story-list-item id]]
-                               (base/close-channel! story [])
-                               (swap! story dissoc :preview))
-                  :style {:cursor :pointer}}
-           [:i "Close"]]
-          [:span {:on-click #(binding [base/closer-root [:story-list-item id]]
-                               (base/bind! story [:preview]
-                                           (base/id->fbref id)
-                                           base/item-binder))
-                  :style {:cursor :pointer}}
-           [:i "Preview"]])]
-       (when preview
-         [comment-list (r/wrap (preview :kids)
-                               swap! story assoc-in [:preview :kids])])])))
+      [:li
+       [:div {:class (if -updated?
+                       (do
+                         (swap! story assoc :-updated? false)
+                         "new")
+                       "old")}
+        [:p.title [:a {:href url} title]]
+        [:p.subtext
+         (str score " points by " by)
+         " | "
+         [:a {:href (str "/#/items/" id)}
+          (str (count kids) " threads")]
+         " | "
+         (if preview
+           [:span {:on-click #(binding [base/closer-root [:story-list-item id]]
+                                (base/close-channel! story [])
+                                (swap! story dissoc :preview))
+                   :style {:cursor :pointer}}
+            [:i "Close"]]
+           [:span {:on-click #(binding [base/closer-root [:story-list-item id]]
+                                (base/bind! story [:preview]
+                                            (base/id->fbref id)
+                                            base/item-binder))
+                   :style {:cursor :pointer}}
+            [:i "Preview"]])]
+        (when preview
+          [comment-list (r/wrap (preview :kids)
+                                swap! story assoc-in [:preview :kids])])]])))

 (def story-list-item
   (with-meta story-list-item-fn
@@ -121,10 +122,9 @@
                                                         (keyfn %2))))
                              @stories)]
      ^{:key entry}
-     [:li
-      [story-list-item
-           (r/wrap (get @items entry)
-                   swap! items assoc entry)]])])
+     [story-list-item
+      (r/wrap (get @items entry)
+              swap! items assoc entry)])])

 ;; -------------------------
 ;; Views


(capture-audio) without args

(capture-audio) without args

--- src/cljs_audiocapture/core.cljs
+++ src/cljs_audiocapture/core.cljs
@@ -200,11 +200,13 @@
   You can use map with keys
     :buffer - core.async buffer to use
     :swf-uri - URI to Flash fallback"
-  [{:keys [buffer swf-uri]
-    :or {:buffer nil :swf-uri "audiocapture.swf"}}]
-  (cond
-    (exists? js/navigator.getUserMedia) (capture-audio-native buffer)
-    (exists? js/navigator.webkitGetUserMedia) (capture-audio-native buffer)
-    (exists? js/navigator.mozGetUserMedia) (capture-audio-native buffer)
-    :else (capture-audio-flash buffer swf-uri)))
-
+  ([]
+   (capture-audio {}))
+  ([{:keys [buffer swf-uri]
+     :or {:buffer nil :swf-uri "audiocapture.swf"}}]
+   (cond
+     (exists? js/navigator.getUserMedia) (capture-audio-native buffer)
+     (exists? js/navigator.webkitGetUserMedia) (capture-audio-native buffer)
+     (exists? js/navigator.mozGetUserMedia) (capture-audio-native buffer)
+     :else (capture-audio-flash buffer swf-uri))))
+


Handle missing tools with a modicum of grace

--- src/clojure/staircase/views.clj
+++ src/clojure/staircase/views.clj
@@ -12,7 +12,10 @@

 (def ^:dynamic require-js "/vendor/requirejs/require.js")

+;; TODO - read these from conf
 (def repo "https://github.com/alexkalderimis/staircase")
+
+(def contact "alex@intermine.org")

 (defn- entry-point [ep]
   (->> (include-js require-js)
@@ -95,7 +98,7 @@
     [:a.dropdown-toggle
      "get in touch! " [:b.caret]]
     (unordered-list {:class "dropdown-menu"}
-                    [(mail-to "alex.kalderimis@gmail.com" ;; TODO: Make configurable.
+                    [(mail-to contact
                               [:span
                                [:i.fa.fa-envelope-o]
                                " Contact"])
@@ -308,8 +311,21 @@

     [:div.col-xs-12.slide-left
      {:ng-class "{'col-md-8': (!expanded && nextSteps.length), 'col-md-10': (!expanded && !nextSteps.length), 'col-md-offset-2': !expanded}"}
+     [:div.alert.alert-danger {:ng-show "error.status === 404"}
+      [:h3 "Error"]
+      [:p
+       " The required tool for this step could not be found. Check with the site
+       administrator to make sure that the "
+       [:code "{{step.tool}}"]
+       " tool is installed"]
+      (update-in (mail-to contact
+                          [:span
+                           [:i.fa.fa-envelope-o]
+                           " Send a grumpy email"])
+                 [1 :class] (constantly "btn btn-default"))]
      [:div.current-step
-      {:tool "tool"
+      {:ng-hide "error.status === 404"
+       :tool "tool"
        :step "step"
        :full-size "expanded"
        :has-items "setItems(key, type, ids)"


Add syntax highlighting to arglists in api docs

--- docs/src/ns_to_markdown.clj
+++ docs/src/ns_to_markdown.clj
@@ -79,7 +79,7 @@
   [name-without-ns arglists]
   (reduce
     (fn [markdown arglist]
-      (str markdown "\n" (format "`(%s%s)`" name-without-ns (arglist->markdown arglist))))
+      (str markdown "\n" (format "`#!clj (%s%s)`" name-without-ns (arglist->markdown arglist))))
     ""
     arglists))


Add test for a mixed string-latch definitions vector.


Put PR next to commit SHA

Put PR next to commit SHA

--- src-cljs/frontend/components/builds_table.cljs
+++ src-cljs/frontend/components/builds_table.cljs
@@ -149,7 +149,19 @@
          " #"
          (:build_num build)]]

-       [:div.metadata
+       [:div.metadata
+
+        (when-let [pusher-name (build-model/ui-user build)]
+          [:div.metadata-item.recent-user
+           {:title pusher-name}
+           (if-let [avatar-url (-> build :user :avatar_url)]
+             [:img.dashboard-icon
+              ;; Adding `&s=N` to the avatar URL returns an NxN version of the
+              ;; avatar (except, for some reason, for default avatars, which are
+              ;; always returned full-size, but they're sized with CSS anyhow).
+              {:src (-> avatar-url url/url (assoc-in [:query "s"] "20") str)}]
+             (dashboard-icon "Builds-Author"))])
+
         (when-let [urls (seq (:pull_request_urls build))]
           [:div.metadata-item.pull-requests {:title "Pull Requests"}
            (dashboard-icon "Builds-PullRequest")
@@ -160,17 +172,6 @@
                               (let [n (re-find #"/\d+$" url)]
                                 (if n (subs n 1) "?"))])
                    urls))]])
-
-        (when-let [pusher-name (build-model/ui-user build)]
-          [:div.metadata-item.recent-user
-           {:title pusher-name}
-           (if-let [avatar-url (-> build :user :avatar_url)]
-             [:img.dashboard-icon
-              ;; Adding `&s=N` to the avatar URL returns an NxN version of the
-              ;; avatar (except, for some reason, for default avatars, which are
-              ;; always returned full-size, but they're sized with CSS anyhow).
-              {:src (-> avatar-url url/url (assoc-in [:query "s"] "20") str)}]
-             (dashboard-icon "Builds-Author"))])

         [:div.metadata-item.revision
          (if-not (:vcs_revision build)


used pos? instead of > 0

used pos? instead of > 0

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -1085,7 +1085,7 @@
                 (pluralize (pm/days-left-in-trial plan) "more day")
                 ".")])
         (when (and (pm/paid? plan)
-                   (> (pm/paid-containers plan) 0))
+                   (pos? (pm/paid-containers plan)))
           [:p
            (str (pm/paid-containers plan) " of these are paid")
            (if piggiebacked? ". "


Updating FAQ's for OSX.

Updating FAQ's for OSX.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -239,68 +239,62 @@
   (if (= num 1) (infl/singular word) (infl/plural word)))

 (def osx-faq-items
-  [{:question (list
-               [:p "This is a separate service? How will I be billed?"])
-    :answer (list
-             [:p "Yes! This is a standalone service. The charge will be pro-rated and added to your existing plan."]
-             [:p (str
-                  "The word \"container\" has been pretty vague in the engineering landscape and we’ve done nothing to help with that :). "
-                  "There is a non-trivial difference regarding an OS X-capable container and a linux container "
-                  "because any commercial provider needs to run OS X builds on Apple hardware.")]
-             [:p (str "The underlying delivery system is very different, from our cost structure to our software tooling."
-                      " Accordingly, we’re currently offering access primarily based on your concurrency needs (use of multiple containers).")])}
-   {:question (list
-               [:p "What is concurrency vs. parallelism?"])
-    :answer (list
-             [:p (str "In a linux setting, parallelism refers to splitting a build across multiple containers. "
-                      "This is not currently a feature of OS X builds - however, there are still speed gains from concurrency.")]
-             [:p "Concurrency refers to running multiple jobs at the same time (e.g., two jobs on two containers).  This is a feature of the OS X product."])}
-   {:question (list
-               [:p "Wait...in the beta, how did my access to containers work?"])
-    :answer (list
-             [:p (str "During the beta, we used your current plan on linux containers as a proxy to enable access to Apple machines. "
-                      "It was just a shortcut on our side to help folks build as soon as possible and a thank-you to customers that pay for multiple linux containers.")])}
-   {:question (list
-               [:p "So what plan should I choose? / I’m concerned about how many minutes I have used?"])
-    :answer (list
-             [:p "If you have questions, please feel free reach out to "
-              [:a {:href "mailto:sayhi@circleci.com"}
-               "sayhi@circleci.com"]
-              (str " and we’ll provide some guidance regarding your recent usage. "
-                   "In the near future, we’ll display your usage within the app.")])}
-   {:question (list
-               [:p [:sup.bold "*"] "What if I go over the minute limit?"])
-    :answer (list
-             [:p (str "Tiering is to help make sure we can stabilize capacity and offer competitive price points "
-                      "which should hopefully lead to the greatest possible utility all around.")
-              [:p (str "In this release, we will not charge overages. We may suspend accounts if minute usage far exceeds the plan limit. "
-                       "We’ll have our team keeping an eye on usage and we will reach out proactively if you get close to your respective plan limit.")]
-              [:p "In the near future, we’ll display your usage within the app."]])}
-   {:question (list
-               [:p "What if I don’t choose a plan?"])
-    :answer (list
-             [:p (str "Starting November 30th, organizations that have not chosen a plan may see degraded performance (as long as we have "
-                      "capacity, we’ll do our best to build while you determine which plan works best for you!).")])}
-   {:question (list
-               [:p "What if we’re building open-source?"])
-    :answer (list
-             [:p "Please reach out to our team at "
-              [:a {:href "mailto:sayhi@circleci.com"}
-               "sayhi@circleci.com"]
-              " - we’re happy to provide significant discounts for open-source projects!"])}])
+  [{:question "Why would I choose an OS X plan (as opposed to a Linux Plan)?"
+    :answer [[:div "If you develop for Apple-related software (e.g., you are an iOS developer), you will likely need an OS X plan to ensure your tests run on our secure, private cloud of OS X machines."]
+             [:div "OS X plans start with a two-week trial with access to our Growth Plan (5x concurrent builds). At the end of your two-week trial, you may choose the plan that fits your needs best."]
+             [:div "Linux plans allow customers to build on multiple isolated Linux systems. All customers get 1 free linux container and then Linux plans offer access to additional containers available at $50/container."]]}
+
+   {:question "What plan do I need?"
+    :answer [[:div "We’ve provided recommendations based on the ranges of builds but every team is different regarding their frequency and length of builds - as well as their need for engineer support."]
+             [:div "To solve for this, everyone starts with a free 2-week trial at the Growth Plan which will help you determine all of those factors. We are happy to help you work through which plan is right for your team."]]}
+
+   {:question "What is concurrency?"
+    :answer [[:div "Concurrency refers to running multiple jobs at the same time (e.g., with 2x concurrency, two builds triggered at the same time will both kick off, but on 1x concurrency one build will queue, waiting for resources)."]
+             [:div "Concurrency avoids slow-downs in work as your builds may otherwise queue behind the builds of someone else on your team."]]}
+
+
+   {:question "*What if I go over the minutes allotted for a given plan?"
+    :answer [[:div  "Minutes and overages ensure we can stabilize capacity while offering as much power as possible which should hopefully lead to the greatest possible utility all around."]
+             [:p "Overages are as follows:"]
+             [:p "Seed & Startup: .08/minute"]
+             [:p "Venture: .05/minute"]
+             [:p "Mobile Focused: .035/minute"]
+             [:div "Users will be alerted in-app as they approach the limit and upon passing their respective limit."]
+             "Feel free to reach out to "
+             [:a {:href "mailto:billing@circleci.com"} "billing@circleci.com"]
+             " with any additional questions"]}
+
+   {:question "Can I change my plan at a later time? Can I cancel anytime?"
+    :answer [[:p "Yes and yes!"]
+             "Please reach out to "
+             [:a {:href "mailto:billing@circleci.com"} "billing@circleci.com"]
+             " to cancel." ]}
+
+   {:question "What if I want something customer?"
+    :answer ["Feel free to contact us "
+             [:a {:href "mailto:billing@circleci.com"} "billing@circleci.com"]]}
+
+   {:question "What if I am building open-source?"
+    :answer ["We also offer the Seed plan for OS X open-source projects. Contact us at "
+             [:a {:href "mailto:billing@circleci.com"} "billing@circleci.com"]
+             " for access. If you are building a bigger open-source project and need more resources, let us know how we can help you!"]}])
+
+(defn faq-answer [answer]
+  (apply merge [:dd]
+         (mapv #(vector :span %) answer)))

 (defn osx-faq [items owner]
   (reify
     om/IRender
     (render [_]
       (html
-       [:fieldset.osx-faq
-        [:legend "FAQs"]
-        [:dl
-         (for [{:keys [question answer]} items]
-           (list
-            [:dt question]
-            [:dd answer]))]]))))
+        [:fieldset.osx-faq
+         [:legend "FAQs"]
+         (apply merge [:dl]
+                (for [{:keys [question answer]} items]
+                  [:dt
+                   [:dt question]
+                   (faq-answer answer)]))]))))

 (defn plan-payment-button [{:keys [text loading-text disabled? on-click-fn]} owner]
   (reify


Moving the osx faq out of the way.

Moving the osx faq out of the way.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -236,47 +236,6 @@

 (defn pluralize-no-val [num word]
   (if (= num 1) (infl/singular word) (infl/plural word)))
-
-(defn osx-plan-ga [{:keys [plan-type plan price current-plan]} owner]
-  (reify
-    om/IRender
-    (render [_]
-      (html
-        [:h1 "An osx plan"]))))
-
-(defn osx-plan [{:keys [plan-type plan price current-plan]} owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [plan-type-key (keyword (str "osx-" plan-type))
-            new-plan-fn #(do (raise! owner [:new-osx-plan-clicked
-                                            {:plan-type {:template plan-type-key}
-                                             :price price
-                                             :description (str "OS X " (clojure.string/capitalize plan-type) " - $" price "/month.")}])
-                             false)
-            update-plan-fn #(do (raise! owner [:update-osx-plan-clicked {:plan-type {:template plan-type-key}}])
-                                false)
-            plan-selected? (= plan-type-key (keyword current-plan))
-            plan-img     [:img {:src (utils/cdn-path (str "img/inner/" plan-type "-2x.png"))}]
-            loading-img  [:img {:src (utils/cdn-path (str "img/inner/" plan-type "-loading-2x.png"))}]]
-        (html
-          (if (pm/stripe-customer? plan)
-            (if plan-selected?
-              [:img.selected {:src (utils/cdn-path (str "img/inner/" plan-type "-selected-2x.png"))}]
-              (forms/managed-button
-                [:a.unselected
-                 {:data-success-text plan-img
-                  :data-loading-text loading-img
-                  :data-failed-text plan-img
-                  :on-click update-plan-fn}
-                 plan-img]))
-            (forms/managed-button
-              [:a.unselected
-               {:data-success-text plan-img
-                :data-loading-text plan-img
-                :data-failed-text plan-img
-                :on-click new-plan-fn}
-               plan-img])))))))

 (def osx-faq-items
   [{:question (list
@@ -341,6 +300,47 @@
            (list
             [:dt question]
             [:dd answer]))]]))))
+
+(defn osx-plan-ga [{:keys [plan-type plan price current-plan]} owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+        [:h1 "An osx plan"]))))
+
+(defn osx-plan [{:keys [plan-type plan price current-plan]} owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [plan-type-key (keyword (str "osx-" plan-type))
+            new-plan-fn #(do (raise! owner [:new-osx-plan-clicked
+                                            {:plan-type {:template plan-type-key}
+                                             :price price
+                                             :description (str "OS X " (clojure.string/capitalize plan-type) " - $" price "/month.")}])
+                             false)
+            update-plan-fn #(do (raise! owner [:update-osx-plan-clicked {:plan-type {:template plan-type-key}}])
+                                false)
+            plan-selected? (= plan-type-key (keyword current-plan))
+            plan-img     [:img {:src (utils/cdn-path (str "img/inner/" plan-type "-2x.png"))}]
+            loading-img  [:img {:src (utils/cdn-path (str "img/inner/" plan-type "-loading-2x.png"))}]]
+        (html
+          (if (and (pm/osx? plan) (not (pm/osx-trial-plan? plan)))
+            (if plan-selected?
+              [:img.selected {:src (utils/cdn-path (str "img/inner/" plan-type "-selected-2x.png"))}]
+              (forms/managed-button
+                [:a.unselected
+                 {:data-success-text plan-img
+                  :data-loading-text loading-img
+                  :data-failed-text plan-img
+                  :on-click update-plan-fn}
+                 plan-img]))
+            (forms/managed-button
+              [:a.unselected
+               {:data-success-text plan-img
+                :data-loading-text plan-img
+                :data-failed-text plan-img
+                :on-click new-plan-fn}
+               plan-img])))))))

 (defn osx-plans-list-ga [plan owner]
   (reify


Fix Committer header

Fix Committer header

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -689,12 +689,12 @@
                                                                    :stop (or (:queued_at build) (:stop_time build))})
                                " waiting for builds to finish"])]))
                (when (build-model/author-isnt-committer build)
-                 [:th "Committer"]
-                 [:td
-                  (if-not (:committer_email build)
-                    [:span (build-model/committer build)]
-                    [:a {:href (str "mailto:" (:committer_email build))}
-                     (build-model/committer build)])])]
+                 (list [:th "Committer"]
+                       [:td
+                        (if-not (:committer_email build)
+                          [:span (build-model/committer build)]
+                          [:a {:href (str "mailto:" (:committer_email build))}
+                           (build-model/committer build)])]))]
               [:tr
                [:th "Parallelism"]
                [:td


Persisting handler response

Persisting handler response

--- src/helda/listeners/invoker.clj
+++ src/helda/listeners/invoker.clj
@@ -20,26 +20,34 @@

 (defn invoke-listener [db listener action-event]
   (println "Posting " action-event)
-  (let [
-    response (client/post (:action-url listener) {
-      :form-params action-event
-      :content-type :json
-      :as :json-strict
-      })
-    entities (-> response :body :action-ctx vals)
+  (if-let [
+    action-ctx (get-in
+      (client/post (:action-url listener) {
+        :form-params action-event
+        :content-type :json
+        :as :json-strict
+        })
+      [:body :action-ctx]
+      )
     ]
-    (mapv #(save-entity db %) entities)
+    {:action-ctx
+      (zipmap
+        (keys action-ctx)
+        (->> action-ctx vals (mapv #(save-entity db %)))
+        )
+      }
     )
   )

 (defn fire-action [db action-request]
   (let [action-event (populate-action-event db action-request)]
-    (map
-      #(invoke-listener db % action-event)
+    (->>
       (find-listeners-by-entity-id db
         (:target-entity-id action-request)
         (:action action-request)
         )
+      (map #(invoke-listener db % action-event))
+      first
       )
     )
   )


pull thread out into

pull thread out into


fix typo

fix typo

--- src/babel/italiano/morphology/determiners.cljc
+++ src/babel/italiano/morphology/determiners.cljc
@@ -11,14 +11,14 @@
   [

    {:p [#"^dell$" "del"]
-    :unify-with {:cat :det
-                 :agr {:number :sing
-                       :gender :masc}}}
+    :u {:cat :det
+        :agr {:number :sing
+              :gender :masc}}}

    {:p [#"^dell$" "della"]
-    :unify-with {:cat :det
-                 :agr {:number :sing
-                       :gender :fem}}}
+    :u {:cat :det
+        :agr {:number :sing
+              :gender :fem}}}

    {:p [#"^gli$" "i"] ;; "gli" -> "i"
     :u {:synsem {:cat :det


Update chunker devcards to operate on JS arrays/data

--- src/devcards/audio_utils/devcards/chunker.cljs
+++ src/devcards/audio_utils/devcards/chunker.cljs
@@ -6,6 +6,7 @@
             [sablono.core :refer-macros [html]]
             [audio-utils.chunker :as c]
             [audio-utils.web-audio :as a]
+            [audio-utils.util :as u]
             [audio-utils.viz :refer [linear-distribution
                                      plot-buffers
                                      sine-wave]]
@@ -27,9 +28,9 @@
                                         :output-channels 1})
         chunks      #js []
         exit-node   (w/main-exit-node worker
-                                      (fn [channel-chunks]
-                                        (let [chunk (channel-chunks 0)]
-                                          (.push chunks chunk))))
+                                      (fn [chnks]
+                                        (let [chunk (u/anth chnks 0)]
+                                          (u/aconj chunks chunk))))
         dest        (.createMediaStreamDestination ctx)]
     (.connect source entry-node)
     (.connect entry-node dest)


Дополнил кнопку опцией для описания стилей

--- src-cljs/ixinfestor/omut.cljs
+++ src-cljs/ixinfestor/omut.cljs
@@ -255,7 +255,8 @@
                          block?
                          disabled?
                          active?
-                         on-click]
+                         on-click
+                         style]
                   :or {text "Кнопка"
                        type :default}}]
   (dom/button #js {:className (str "btn "
@@ -277,6 +278,7 @@
                    :disabled (if disabled? "disabled" "")
                    :onClick    (on-click-com-fn on-click)
                    :onTouchEnd (on-click-com-fn on-click)
+                   :style style
                    }
               text))


Parse heroku database_url into jdbc/hikaricp compatible url.

--- src/clj/clj_templates/config/main_config.clj
+++ src/clj/clj_templates/config/main_config.clj
@@ -1,12 +1,19 @@
 (ns clj-templates.config.main-config
   (:require [integrant.core :as ig]
-            [environ.core :refer [env]]))
+            [environ.core :refer [env]]
+            [clojure.string :as str])
+  (:import (java.net URI)))
+
+(defn get-jdbc-url []
+  (let [uri (URI. (env :database-url))
+        [name pwd] (str/split (.getUserInfo uri) #":")]
+    (str "jdbc:postgresql://" (.getHost uri) (.getPath uri) "?user=" name "&password=" pwd)))

 (def main-config
   {:handler/main        {:es-client (ig/ref :search/elastic)}
    :server/jetty        {:handler (ig/ref :handler/main)
                          :opts    {:join? false}}
-   :db/postgres         {:jdbc-url          (env :db-url)
+   :db/postgres         {:jdbc-url          (get-jdbc-url)
                          :driver-class-name "org.postgresql.Driver"}
    :logger/timbre       {:appenders {:println {:stream :auto}}}
    :jobs/scheduled-jobs {:hours-between-jobs 8


Only wrap lists/vectors when using wrap-in-do

--- src/clj/jest/compiler/NativeJestCompiler.clj
+++ src/clj/jest/compiler/NativeJestCompiler.clj
@@ -16,7 +16,8 @@
                          JestParser$BlockContext JestParser$VarScopeContext
                          JestParser$ClojureVectorContext JestParser$ClojureMapContext JestParser$ClojureGetContext)
            (jest.compiler ClojureSourceGenerator$BadSource)
-           (sun.reflect.generics.reflectiveObjects NotImplementedException))
+           (sun.reflect.generics.reflectiveObjects NotImplementedException)
+           (java.util List))
   (:gen-class
     :extends jest.grammar.JestBaseVisitor
     :prefix "-"
@@ -406,9 +407,11 @@
 (defn- wrap-in-do
   [expressions]
   (cond
+    (not (instance? List expressions)) expressions
     (= 0 (count expressions)) (throw (new NotImplementedException))
     (= 1 (count expressions)) (first expressions)
     :else `(do ~@expressions)))
+

 (defn -visitConditional
   [this ^JestParser$ConditionalContext ctx]


small-fix

small-fix

--- src/cljs/salava/extra/passport/ui/block.cljs
+++ src/cljs/salava/extra/passport/ui/block.cljs
@@ -28,7 +28,7 @@
    [:div
     [:h2 "Informations générales sur l’utilisation du service Open Badge Passport"]
     [:p  "Le service Open Badge Passport (ci-après dénommé ” le service ”) est
-     proposé par Discendum Oy (ci-après dénommé ” le prestataire de services ”).
+     proposé par Open Badge Factory Oy (ci-après dénommé ” le prestataire de services ”).
      Le service fourni par le prestataire de services consiste en une plate-forme basée
      sur le cloud permettant aux bénéficiaires de badges ouverts de recevoir, partager,
      gérer et publier leurs badges.  Les conditions d’utilisation s’appliquent aux utilisateurs du service (ci-après dénommés ” l’utilisateur ” ou ” les utilisateurs ”). Le terme d’utilisateur correspond à deux niveaux d’utilisateur : 1) les utilisateurs qui utilisent le service à des fins personnelles ; 2) l’organisation du client, qui dispose de son propre environnement dans le service."]


THA add a newline

THA add a newline

--- examples/stolen/src/core.cljs
+++ examples/stolen/src/core.cljs
@@ -28,6 +28,7 @@
       http/wrap-android-cors-bugfix
       http/wrap-method
       http/wrap-url))
+
 (defn raw-get
   [url & [req]]
   "Returns raw get output given a url, without decoding json/edn/transit output."


fix data format PEBCAK.

fix data format PEBCAK.

--- src/kixi/hecuba/data/measurements/download.clj
+++ src/kixi/hecuba/data/measurements/download.clj
@@ -107,13 +107,16 @@
                 step           (fn [xs] (map (fn [f v] (f v)) fns xs))]
             (recur (step ms) (concat data [out-row]))))))))

+(defn measurements->columns [ms]
+  (map (fn [[x & more]] (apply vector (:timestamp x) (:value x) (map :value more))) ms))
+
 (defn generate-file [store item]
   (let [{:keys [header data]} item
         tmpfile (ioplus/mk-temp-file! "hecuba" ".csv-download")]
     (try
       (with-open [out (io/writer tmpfile)]
         (csv/write-csv out header)
-        (csv/write-csv out (filled-measurements data))
+        (csv/write-csv out (measurements->columns (filled-measurements data)))
         (s3/store-file (:s3 store) (update-in item [:uuid] str "/data")))
       (write-status store (assoc (update-in item [:uuid] str "/status") :status "SUCCESS"))
       (catch Throwable t


Remove weird spurious reference

Remove weird spurious reference

--- worker/src/patavi/worker/pirate/core.clj
+++ worker/src/patavi/worker/pirate/core.clj
@@ -6,7 +6,6 @@
             [patavi.worker.pirate.util :as pirate]
             [clojure.tools.logging :as log]
             [environ.core :refer [env]]
-            [zeromq.zmq :as zmq]
             [me.raynes.fs :as fs]
             [cheshire.core :as json :only [encode decode]]
             [crypto.random :as crypto])


Improve logging for publication GC

Improve logging for publication GC

--- src/onyx/messaging/aeron/publication_group.clj
+++ src/onyx/messaging/aeron/publication_group.clj
@@ -31,6 +31,7 @@
                                            (filter (fn [[k v]] (>= (- t ^long @(:last-used v)) idle-timeout))
                                                    snapshot))]
                         (doseq [k to-remove]
+                          (info (format "Publication %k GC'd after non use within %s" k idle-timeout))
                           (pubm/stop (:publication (snapshot k)))))
                       (catch InterruptedException e
                         (throw e))


Move parameter resolution out of loop.

Move parameter resolution out of loop.

--- src/afterglow/effects/fun.clj
+++ src/afterglow/effects/fun.clj
@@ -95,17 +95,18 @@
   (colors/create-color "white"))

 (defn- remove-finished-sparkles
-  "Filters out any sparkles that were created longer ago than the fade time.
-  sparkles is a map from head to the timestamp at which the sparkle was created."
+  "Filters out any sparkles that were created longer ago than the fade
+  time. `sparkles` is a map from head to the timestamp at which the
+  sparkle was created."
   [sparkles show snapshot fade-time]
   (pspy :remove-finished-sparkles
-        (let [now (:instant snapshot)]
+        (let [now (:instant snapshot)
+              fade-time (params/resolve-param fade-time show snapshot)]
           (reduce
            (fn [result [where creation-time]]
-             (let [fade-time (params/resolve-param fade-time show snapshot)]
-               (if (< (- now creation-time) fade-time)
-                 (assoc result where creation-time)
-                 result)))
+             (if (< (- now creation-time) fade-time)
+               (assoc result where creation-time)
+               result))
            {}
            sparkles))))


+{:synsem {:subcat '()}}

+{:synsem {:subcat '()}}

--- src/babel/italiano/writer.clj
+++ src/babel/italiano/writer.clj
@@ -60,6 +60,7 @@
                    (log/debug (str "tutti: verb: " (strip-refs verb)))
                    (let [root-form (get-in verb [:italiano :italiano])]
                      (generate-one-verb (unify
+                                         {:synsem {:subcat '()}}
                                          {:synsem {:sem
                                                    (get-in verb [:synsem :sem] :top)}}
                                          {:root {:italiano {:italiano root-form}}})


chat properties from subscribed atom

chat properties from subscribed atom

Former-commit-id: f34170a3c13f315eaf2c802b2ea60440e39a6338

--- syng-im/src/syng_im/components/chat/plain_message_input.cljs
+++ syng-im/src/syng_im/components/chat/plain_message_input.cljs
@@ -42,7 +42,7 @@
                                               (reset! text new-text)
                                               (r/flush))
                      :onSubmitEditing       (fn [e]
-                                              (let [{:keys [group-chat chat-id]} @chat]
+                                              (let [{:keys [group-chat chat-id]} (:chat-id @chat)]
                                                 (if group-chat
                                                   (dispatch [:send-group-chat-msg chat-id @text])
                                                   (dispatch [:send-chat-msg chat-id @text])))


Undo effect of reader conditional on docstring

Fixes #242

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -1016,6 +1016,20 @@
                         (filter matches? (public-syms ns)))))
             (all-ns)))))

+(defn- undo-reader-conditional-whitespace-docstring
+  "Undoes the effect that wrapping a reader conditional around
+  a defn has on a docstring."
+  [s]
+  ;; We look for five spaces (or six, in case that the docstring
+  ;; is not aligned under the first quote) after the first newline
+  ;; (or two, in case the doctring has an unpadded blank line
+  ;; after the first), and then replace all five (or six) spaces
+  ;; after newlines with two.
+  (when-not (nil? s)
+    (if (re-find #"[^\n]*\n\n?      ?\S.*" s)
+      (s/replace-all s #"\n      ?" "\n  ")
+      s)))
+
 (defn- doc*
   [sym]
   (if-let [special-sym ('{&       fn
@@ -1040,7 +1054,8 @@
               var (assoc var :forms (-> var :meta :forms second)
                              :arglists (-> var :meta :arglists second))
               m   (select-keys var
-                    [:ns :name :doc :forms :arglists :macro :url])]
+                    [:ns :name :doc :forms :arglists :macro :url])
+              m   (update m :doc undo-reader-conditional-whitespace-docstring)]
           (cond-> (update-in m [:name] name)
             (:protocol-symbol var)
             (assoc :protocol true


Refactor system/exec; WARN potentially incompatible

--- src/cider_ci/utils/system.clj
+++ src/cider_ci/utils/system.clj
@@ -7,25 +7,31 @@
   (:require
     [clj-commons-exec :as commons-exec]
     [clojure.tools.logging :as logging]
+    [clj-logging-config.log4j :as logging-config]
     ))
+
+  ;(logging-config/set-logger! :level :debug)

 (defn exec
   ([command]
    (exec command {}))
   ([command opts]
-   (let [options (conj {:watchdog 1000} opts)
-         res @(commons-exec/sh command options)]
-     (logging/debug exec {:res res})
+   (let [options (conj {:watchdog 1000}
+                       opts)]
+     @(commons-exec/sh command options))))
+

-     (if (not= 0 (:exit res))
-       (throw (IllegalStateException. (str "Unsuccessful shell execution"
-                                           command
-                                           options
-                                           {:result res})))
-       res)
-     )))
+(defn exec-with-success-or-throw [& args]
+  (let [res (apply exec args)]
+    (if (= 0 (:exit res))
+      res
+      (throw (IllegalStateException.
+               (str "Unsuccessful shell execution"
+                    [args]
+                    {:result res}))))))

-;(exec ["ls" "-lah"]{:dir "/tmp"})
-;(exec ["sleep" "1"])
+(defn exec-with-success? [& args]
+  (= 0 (:exit (apply exec args))))
+


Have the ring server redirect to the index.html

--- src/clj/comic_reader/core.clj
+++ src/clj/comic_reader/core.clj
@@ -12,7 +12,7 @@
    :body (pr-str data)})

 (c/defroutes routes
-  (c/GET "/" [] "Hello World!")
+  (c/GET "/" [] (response/redirect "/index.html"))
   (c/context "/api/v1" []
     (c/GET "/sites" []
       (edn-response (vec (map #(select-keys % [:name :url])


Apocalypse refactor

Apocalypse refactor

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -28,13 +28,15 @@
                    (trash state side c))
                  ;; do hosted cards first so they don't get trashed twice
                  (doseq [c (all-installed state :runner)]
-                   (if (or (= ["onhost"] (get c :zone)) (= '(:onhost) (get c :zone)))
-                     (do (move state side c [:rig :facedown])
-                         (deactivate state side c))))
+                   (when (or (= ["onhost"] (get c :zone)) (= '(:onhost) (get c :zone)))
+                     (move state side c [:rig :facedown])
+                     (if (:memoryunits c)
+                       (gain state :runner :memory (:memoryunits c)))))
                  (doseq [c (all-installed state :runner)]
-                   (if (not (or (= ["onhost"] (get c :zone)) (= '(:onhost) (get c :zone))))
-                     (do (move state side c [:rig :facedown])
-                         (deactivate state side c)))))}
+                   (when (not (or (= ["onhost"] (get c :zone)) (= '(:onhost) (get c :zone))))
+                     (move state side c [:rig :facedown])
+                     (if (:memoryunits c)
+                       (gain state :runner :memory (:memoryunits c))))))}

    "Blackmail"
    {:req (req (> (:bad-publicity corp) 0)) :prompt "Choose a server" :choices (req servers)


implement Employee Strike

implement Employee Strike

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -98,6 +98,12 @@
    "Emergency Shutdown"
    {:req (req (some #{:hq} (:successful-run runner-reg))) :msg (msg "derez " (:title target))
     :choices {:req #(and (has? % :type "ICE") (:rezzed %))} :effect (effect (derez target))}
+
+   "Employee Strike"
+   {:msg "disable the Corp's identity"
+    :effect (req (unregister-events state side (:identity corp)))
+    :leave-play (req (when-let [events (:events (card-def (:identity corp)))]
+                       (register-events state side events (:identity corp))))}

    "Escher"
    (let [ice-index (fn [state i] (first (keep-indexed #(when (= (:cid %2) (:cid i)) %1)


add test for Eve Campaign

add test for Eve Campaign

--- src/clj/test/cards-assets.clj
+++ src/clj/test/cards-assets.clj
@@ -11,6 +11,7 @@
       (take-credits state :corp 2)
       (take-credits state :runner)
       (is (= 6 (get-in @state [:corp :credit])))
+      (is (= 9 (get-in (refresh ac) [:counter])))
       )))

 (deftest aggressive-secretary
@@ -56,6 +57,20 @@
       (is (= 4 (get-in @state [:corp :credit])))
       (card-ability state :corp alix 0)
       (is (= 8 (get-in @state [:corp :credit])))
+      )))
+
+(deftest eve-campaign
+  (do-game
+    (new-game (default-corp [(qty "Eve Campaign" 1)]) (default-runner))
+    (play-from-hand state :corp "Eve Campaign" "New remote")
+    (let [eve (first (get-in @state [:corp :servers :remote1 :content]))]
+      (core/rez state :corp eve)
+      (is (= 0 (get-in @state [:corp :credit])))
+      (is (= 16 (get-in (refresh eve) [:counter])))
+      (take-credits state :corp 2)
+      (take-credits state :runner)
+      (is (= 4 (get-in @state [:corp :credit])))
+      (is (= 14 (get-in (refresh eve) [:counter])))
       )))

 (deftest franchise-city


update charts on state update

update charts on state update

--- src/cljs/takarabako/core.cljs
+++ src/cljs/takarabako/core.cljs
@@ -203,6 +203,15 @@
             :checked (:input-type-toggle (om/get-state component))
             :on-click (fn [_] (om/update-state! component update :input-type-toggle not))}]])

+(defn draw-charts [component]
+  (let [{:keys [account/balance]} (om/props component)
+        daily-data (clj->js {:labels ["mo" "di" "mi" "do" "fr"]
+                             :series [[0 5 11 2 8]]})
+        total-data (clj->js {:labels ["income" "expense"]
+                             :series [[(:total-income balance) (:total-expense balance)]]})]
+    (js/Chartist.Line. ".ct-line" daily-data)
+    (js/Chartist.Bar. ".ct-bar" total-data)))
+
 (defui App
   static om/IQueryParams
   (params [this]
@@ -219,13 +228,10 @@
                          :input-value ""
                          :input-search ""}))
   (componentDidMount [this]
-    (let [{:keys [account/balance]} (om/props this)
-          daily-data (clj->js {:labels ["mo" "di" "mi" "do" "fr"]
-                    :series [[0 5 11 2 8]]})
-          total-data (clj->js {:labels ["income" "expense"]
-                         :series [[(:total-income balance) (:total-expense balance)]]})]
-      (js/Chartist.Line. ".ct-line" daily-data)
-      (js/Chartist.Bar. ".ct-bar" total-data)))
+    (draw-charts this))
+  (componentDidUpdate
+   [this prev-props prev-state]
+   (draw-charts this))
   (render [this]
     (let [{:keys [account/balance transactions/list]} (om/props this)]
       (html


Formatting.

Formatting.

--- src/cljs/town_client/map.cljs
+++ src/cljs/town_client/map.cljs
@@ -49,8 +49,7 @@
     "black"
     ))

-(defn browser-is-ie
-  []
+(defn browser-is-ie []
   (= (.-appName js/navigator) "Microsoft Internet Explorer"))

 (defn add-data
@@ -67,11 +66,12 @@
                            category (.getProperty feature "category")
                            marker #js{:title (if (> (count text) 0) text category)}]
                        (if (not (browser-is-ie))
-                         (set! (.-icon marker) #js{:path google.maps.SymbolPath.CIRCLE
-                                               :scale 3
-                                               :fillColor (color category)
-                                               :strokeWeight 0
-                                               :fillOpacity 1}))
+                         (set! (.-icon marker)
+                               #js{:path google.maps.SymbolPath.CIRCLE
+                                   :scale 3
+                                   :fillColor (color category)
+                                   :strokeWeight 0
+                                   :fillOpacity 1}))
                        marker)))))))

 (defn init


Only set job JAR in basic cstep when still unset.

--- src/clojure/parkour/cstep.clj
+++ src/clojure/parkour/cstep.clj
@@ -3,7 +3,8 @@
             [parkour.util :refer [returning]])
   (:import [clojure.lang APersistentMap APersistentVector IFn]
            [org.apache.hadoop.conf Configuration]
-           [org.apache.hadoop.mapreduce Job]))
+           [org.apache.hadoop.mapreduce Job]
+           [parkour.hadoop Mappers]))

 (defprotocol ConfigStep
   "Protocol for objects which add a job configuration step."
@@ -32,7 +33,7 @@
   (fn [^Job job]
     (doto job
       (.setJobName jname)
-      (.setJarByClass parkour.hadoop.Mappers)
+      (cond-> (nil? (.getJar job)) (.setJarByClass Mappers))
       (conf/assoc! #_job
         "mapreduce.task.classpath.user.precedence" true
         "mapreduce.job.user.classpath.first" true


Upgrade stencil

Upgrade stencil

--- modules/stencil/project.clj
+++ modules/stencil/project.clj
@@ -1,11 +1,11 @@
 ;; Copyright © 2015 JUXT LTD.

-(defproject juxt.modular/stencil "0.1.0"
+(defproject juxt.modular/stencil "0.1.1"
   :description "A modular extension that provides a Stencil templater for juxt.modular/template"
   :url "https://github.com/juxt/modular/tree/master/modules/stencil"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[com.stuartsierra/component "0.2.2"]
-                 [stencil "0.4.0" :exclusions [slingshot]]
+                 [stencil "0.5.0"]
                  [juxt.modular/template "0.6.3"]
                  ])


Rewrite the no-seed impl of make-random

Rewrite the no-seed impl of make-random

This makes it closer to the CLJ version, which uses split rather than
creating a new seed on each call.

--- src/main/clojure/cljs/test/check/random.cljs
+++ src/main/clojure/cljs/test/check/random.cljs
@@ -120,11 +120,6 @@
 (def ^:private golden-gamma
   (hex-long "9e3779b97f4a7c15"))

-(let [last-seed (atom 0)]
-  (defn ^:private next-seed
-    []
-    (swap! last-seed #(max (inc %) (.valueOf (js/Date.))))))
-
 (defn make-java-util-splittable-random
   [seed]
   (JavaUtilSplittableRandom. golden-gamma
@@ -132,9 +127,19 @@
                                  (throw (ex-info "Bad random seed!"
                                                  {:seed seed})))))

+(def ^:private next-rng
+  (let [a (atom {:state
+                 (make-java-util-splittable-random (.valueOf (js/Date.)))})]
+    (fn []
+      (:returned
+       (swap! a (fn [{:keys [state]}]
+                  (let [[r1 r2] (split state)]
+                    {:state r1 :returned r2})))))))
+
+
 (defn make-random
   "Given an optional integer (or goog.math.Long) seed, returns an
   implementation of the IRandom protocol."
-  ([] (make-random (next-seed)))
+  ([] (next-rng))
   ([seed]
    (make-java-util-splittable-random seed)))


eliminate reflection warnings

eliminate reflection warnings

--- src/main/clojure/clojure/tools/namespace.clj
+++ src/main/clojure/clojure/tools/namespace.clj
@@ -35,7 +35,7 @@
   Returns a sequence of File objects, in breadth-first sort order."
   [^File dir]
   ;; Use sort by absolute path to get breadth-first search.
-  (sort-by #(.getAbsolutePath %)
+  (sort-by #(.getAbsolutePath ^File %)
            (filter clojure-source-file? (file-seq dir))))

 (defn comment?
@@ -88,7 +88,7 @@
 (defn clojure-sources-in-jar
   "Returns a sequence of filenames ending in .clj found in the JAR file."
   [^JarFile jar-file]
-  (filter #(.endsWith % ".clj") (classpath/filenames-in-jar jar-file)))
+  (filter #(.endsWith ^String % ".clj") (classpath/filenames-in-jar jar-file)))

 (defn read-ns-decl-from-jarfile-entry
   "Attempts to read a (ns ...) declaration from the named entry in the


add test for partial project file upgrading. (see #51)

--- test/leiningen/ancient/artifact/files_test.clj
+++ test/leiningen/ancient/artifact/files_test.clj
@@ -87,6 +87,28 @@
             artifacts => (contains #{'[artifact  [:dependencies 0]]})
             (write-string! upgraded) => expected))))

+(fact "about partial project file upgrading."
+      (let [opts (const-opts "0.1.1")
+            mk #(format
+                  (str "(defproject project-x \"0.1.1-SNAPSHOT\"\n"
+                       "  :dependencies [[artifact %s]"
+                       "                 [artifact2 %s :upgrade? false]"
+                       "                 [artifact3 %s :upgrade? true]])")
+                  (pr-str %1)
+                  (pr-str %2)
+                  (pr-str %1))]
+        (with-temp-file [tmp (mk "0.1.0" "0.1.0")]
+          (let [f (read! (project-file tmp))
+                outdated (check! f opts)
+                artifacts (map (juxt (comp :symbol :artifact) :path) outdated)
+                upgraded (upgrade! f outdated)
+                expected (mk "0.1.1" "0.1.0")]
+            (count outdated) => 2
+            artifacts => (contains #{'[artifact [:dependencies 0]]})
+            artifacts =not=> (contains #{'[artifact2 [:dependencies 1]]})
+            artifacts => (contains #{'[artifact3 [:dependencies 2]]})
+            (write-string! upgraded) => expected))))
+
 (fact "about project file upgrading with multiple identical artifacts."
       (let [opts (const-opts "0.1.1")
             mk #(format


Humane test output

Humane test output

--- functions/project.clj
+++ functions/project.clj
@@ -5,7 +5,10 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/data.json "0.2.6"]
-                 [com.amazonaws/aws-lambda-java-core "1.0.0"]]
+                 [com.amazonaws/aws-lambda-java-core "1.0.0"]
+                 [pjstadig/humane-test-output "0.8.2"]]
+  :injections [(require 'pjstadig.humane-test-output)
+               (pjstadig.humane-test-output/activate!)]
   :plugins [[lein-cljfmt "0.5.6"]]
   :main ^:skip-aot wort.core
   :target-path "target/%s"


(PCP-487) Increase PCP message expiry in tests

The tests were prone to hitting the expiry limit, especially on
slower HW. By increasing the limit we are increasing the chances
the tests succeed on such HW.

--- test/utils/puppetlabs/pcp/testutils/client.clj
+++ test/utils/puppetlabs/pcp/testutils/client.clj
@@ -44,7 +44,7 @@
       (assoc :message_type "http://puppetlabs.com/associate_request"
              :targets ["pcp:///server"]
              :sender uri)
-      (message/set-expiry 3 :seconds)))
+      (message/set-expiry 10 :seconds)))

 (defn connect
   "Makes a client for testing"


Fix bad merge

Fix bad merge

--- src/status_im/ui/screens/accounts/utils.cljs
+++ src/status_im/ui/screens/accounts/utils.cljs
@@ -9,10 +9,10 @@
   Optionally, one can specify event to be dispatched after fields are persisted."
   ([new-account-fields cofx]
    (account-update new-account-fields nil cofx))
-  ([new-account-fields after-update-event {{:accounts/keys [accounts current-account-id] :as db} :db :as cofx}]
-   (let [current-account (get accounts current-account-id)
+  ([new-account-fields after-update-event {:keys [db] :as cofx}]
+   (let [current-account (:account/account db)
          new-account     (merge current-account new-account-fields)
-         fx              {:db                      (assoc-in db [:accounts/accounts current-account-id] new-account)
+         fx              {:db                      (assoc db :account/account new-account)
                           :data-store/save-account (assoc new-account :after-update-event after-update-event)}
          {:keys [name photo-path]} new-account]
      (if (or (:name new-account-fields) (:photo-path new-account-fields))


Remove debug output

Remove debug output

--- backend/src/circle/sh.clj
+++ backend/src/circle/sh.clj
@@ -4,9 +4,7 @@
   (:require [clojure.java.shell :as sh])
   (:use [circle.util.predicates :only (named?)])
   (:use [circle.backend.build :only (*env*)])
-  ;; (:require [circle.backend.build.pwd :as pwd])
-  (:use [circle.util.core :only (apply-if)])
-  (:use [arohner.utils :only (inspect)]))
+  (:use [circle.util.core :only (apply-if)]))

 (defmacro quasiquote [& forms]
   `(pallet.stevedore/quasiquote ~forms))
@@ -43,7 +41,7 @@
   ;; don't use c.j.shell's built-in support for :env and :dir, because
   ;; we'll have to use this code remotely, so prefer consistency
   ;; between local and remote.
-  (sh/sh "bash" :in (inspect (emit-form body :environment environment :pwd pwd))
+  (sh/sh "bash" :in (emit-form body :environment environment :pwd pwd)
          :return-map true))

 (defmacro shq


resource path

resource path

--- bot/dl.clj
+++ bot/dl.clj
@@ -10,7 +10,7 @@

 (def db-spec {:classname "org.sqlite.JDBC"
               :subprotocol "sqlite"
-              :subname (str (io/resource "butterfly.db"))})
+              :subname (.getPath (io/file (io/resource "butterfly.db")))})

 (defn- url-encode [url] (some-> url (java.net.URLEncoder/encode "UTF-8") (.replace "+" "%20")))


Remove unnecessary no-gen and fix spec

Remove unnecessary no-gen and fix spec

--- src/github_changelog/core.clj
+++ src/github_changelog/core.clj
@@ -40,13 +40,13 @@
 (defn find-pull [pulls sha]
   (first (filter #(= (github/get-sha %) sha) pulls)))

-(defn ^:no-gen assoc-pulls [pulls {:keys [commits] :as tag}]
+(defn assoc-pulls [pulls {:keys [commits] :as tag}]
   (->> commits
        (keep (partial find-pull pulls))
        (assoc tag :pulls)))

 (s/fdef assoc-pulls
-  :args (s/cat :pulls (s/* ::github/pull) :tag ::core-spec/tag)
+  :args (s/cat :pulls (s/coll-of ::github/pull) :tag ::core-spec/tag)
   :ret ::core-spec/tag-with-pulls)

 (defn ^:no-gen collect-tags [config]


Fixed reset of sessions

Fixed reset of sessions

- removed double sess.wrapper

--- src/clj_gamification/handler.clj
+++ src/clj_gamification/handler.clj
@@ -1,8 +1,5 @@
 (ns clj-gamification.handler
-  (:use compojure.core
-;;        ring.middleware.session.store ;; TODO delete
-        )
-;;  (:import java.util.UUID) ;; TODO rm
+  (:use compojure.core)
   (:require [compojure.handler :as handler]
             [compojure.route :as route]
             [hiccup.page :refer [html5 include-js]]
@@ -11,7 +8,6 @@
             [ring.middleware.session :refer [wrap-session]]
             [ring.middleware.session.memory :refer [memory-store]]
             [ring.middleware.file-info :refer :all]
-            ;[ring.middleware.file :refer :all]
             [hiccup.bootstrap.middleware :refer [wrap-bootstrap-resources]]
             [hiccup.bootstrap.page :refer :all]
             [clojure.pprint]
@@ -25,7 +21,6 @@

 (def change-events (atom [])) ;; TODO move to the state object
 (def change-callbacks (atom #{}))
-
 (defn toint [numstr] (Integer/parseInt numstr))

 (defn include-changepoll-js [& event-keys]
@@ -197,14 +192,14 @@
   (or
    (:voted? session)))

-(defn show-page-for-step [{:keys [teams state]}
+(defn show-page-for-step [{:keys [teams state] :as system}
                           {:keys [remote-addr session] :as req}]
   "Show the right page for the current stage: gamemaster, team registr., voting"
   (let [first-visitor? (compare-and-set! state :not-started :brainstorming)
         gm? (:gamemaster? session)]
    (cond
     (or gm? first-visitor?) (do
-                              (info (str "GM access; first? " first-visitor? ", session id" (-> req :cookies (get "ring-session") :value) ", ip " (:remote-addr req) ", sess " session))
+                              (info (str "GM access; first? " first-visitor? ", session id" (-> req :cookies (get "ring-session") :value) ", ip " (:remote-addr req) ", sess " session ", sess.store: " @(:session-atom system)))
                               {:session {:gamemaster? true},
                               :body (page-gamemaster)})
     (= @state :brainstorming) (page-team-registration)
@@ -358,38 +353,10 @@
   (reset! (:teams system) {})
   (reset! (:votes system) {})
   (reset! (:voter-ips system) #{})
-  (reset! (:projector system) :prestart))
+  (reset! (:projector system) :prestart)
+  (reset! (:session-atom system) {}))

 (def current-system-for-repl "Reference to the latest system created to have access to it from the REPL; don't use anywhere else" (atom nil))
-
-;; TODO It seems that reset of session doesn't work properly but the problem is likely somehwere else
-;; Sometimes nothing is written into the session atom, which is weird. This works, results in discovering
-;; non-exist. session and creating/writing a new one:
-;; (def sys (system {}))
-;; (def h (-> #(show-page-for-step sys %) (wrap-session {:store (MyMemoryStore. tmp-sess-atm)})))
-;; (h {:Iam "req", :headers {"cookie" "ring-session=my-dummy-sess-key;Path=/"}})
-;; =>
-;; Reading session my-dummy-sess-key from #<Atom@2c826d6: {}> => nil
-;; Written session  9dd1968f-e33a-4f4a-a058-8a5297ae7b0a -> {:gamemaster? true}  to  #<Atom@2c826d6: {9dd1968f-e33a-4f4a-a058-8a5297ae7b0a {:gamemaster? true}}>
-;; TBD Verify with a browser with existing cookie that the value gets updated;
-;; Then, why is the tmp-sess-atom always empty??
-;; !!!! ANONYM. WINS IN CHROME SHARE COOKIES -> set in one, E in all - so it seems
-;;(def tmp-sess-atm (atom {}))
-;; FIXME: Open anon. FF -> become GM; reload in Chrome that was GM before reset (and has cookie) => GM too
-
-(comment deftype MyMemoryStore [session-map] ;; was here for testing/experiments only
-  SessionStore
-  (read-session [_ key]
-     (println "Reading session" key "from" session-map "=>" (@session-map key))
-    (@session-map key))
-  (write-session [_ key data]
-    (let [key (or key (str (UUID/randomUUID)))]
-      (swap! session-map assoc key data)
-      (println "Written session " key "->" data " to " session-map)
-      key))
-  (delete-session [_ key]
-    (swap! session-map dissoc key)
-    nil))

 (defn init
   "Init the current system, optionally with a default system, returning a Ring handler"
@@ -397,10 +364,8 @@
   ([defaults]
      (let [system (system defaults)]
        (swap! current-system-for-repl (constantly system))
-       (-> (handler/site (make-app-routes system))
-           (wrap-session {:store
-                          ;; (MyMemoryStore. tmp-sess-atm) ; TODO remove - fro troubleshooting only
-                          (memory-store (:session-atom system))})
+       (-> (handler/site (make-app-routes system)
+                         {:session {:store (memory-store (:session-atom system))}})
            (wrap-bootstrap-resources)
            (wrap-file-info)))))


Add select-shape event.

Add select-shape event.

--- frontend/uxbox/data/workspace.cljs
+++ frontend/uxbox/data/workspace.cljs
@@ -65,6 +65,18 @@
     (-pr-writer [mv writer _]
       (-write writer "#<event:u.d.w/select-for-drawing>"))))

+(defn select-shape
+  "Mark a shape selected for drawing in the canvas."
+  [id]
+  (reify
+    rs/UpdateEvent
+    (-apply-update [_ state]
+      (let [selected (get-in state [:workspace :selected])]
+        (if (contains? selected id)
+          (update-in state [:workspace :selected] disj id)
+          (update-in state [:workspace :selected] conj id))))))
+
+
 ;; TODO: validate shape

 (defn add-shape


Got rid of unnecessary load calls.

Got rid of unnecessary load calls.

--- src/app/core.clj
+++ src/app/core.clj
@@ -6,13 +6,6 @@
   (:use [app.interactive])
   (:use [app.cli])
   (:gen-class :main true))
-
-(load "javaparser")
-(load "operations")
-(load "itemsOnLifecycle")
-(load "interactive")
-(load "linter")
-(load "cli")

 (def self-exclusive-modes-error
   "Linter, interactive and query mode are self exclusive")


Remove unused binding.

Remove unused binding.


GAWB-1818: Changing to a ? icon link with an explanatory tooltip

--- src/cljs/main/broadfcui/page/workspace/method_configs/launch_analysis.cljs
+++ src/cljs/main/broadfcui/page/workspace/method_configs/launch_analysis.cljs
@@ -82,7 +82,14 @@
    [:div {:style {:marginTop "1em"}}
     [comps/Checkbox
     {:ref "callCache-check"
-     :label [:span {:style {:marginBottom "0.8em"}} "Use Call Caching. " [:a {:href (config/call-caching-guide-url) :target "_blank"} "Learn More"]]
+     :label [:span {:style {:marginBottom "0.8em"}} "Use Call Caching"
+             [:a {:href (config/call-caching-guide-url)
+                  :target "_blank"
+                  :style {:color (:text-light style/colors) :fontSize "1.2rem"
+                          :lineHeight "0.6rem" :padding "0.4rem" :marginRight "0.5rem"}}
+              [common/FoundationTooltip {:text (icons/icon {} :help)
+                                         :style {:border "none" :cursor "pointer"}
+                                         :tooltip "Guide to Call Caching"}]]]
      :initial-checked? true
      :disabled-text (case (:protected-option @state)
                       :not-loaded "Call Caching status has not finished loading."


Emit events for both begin and end of ago API.

--- src/cbfg/ago.clj
+++ src/cbfg/ago.clj
@@ -34,18 +34,26 @@

 (defmacro aclose [actx ch]
   `(let [w# (actx-top ~actx)]
-     (actx-event ~actx ["aclose" ~actx ~ch])
+     (actx-event ~actx [:beg "aclose" ~actx ~ch])
      (swap! (:chs w#) dissoc ~ch)
-     (cljs.core.async/close! ~ch)))
+     (let [result# (cljs.core.async/close! ~ch)]
+       (actx-event ~actx [:end "aclose" ~actx ~ch result#])
+       result#)))

 (defmacro atake [actx ch]
-  `(do (actx-event ~actx ["atake" ~actx ~ch])
-       (cljs.core.async/<! ~ch)))
+  `(do (actx-event ~actx [:beg "atake" ~actx ~ch])
+       (let [result# (cljs.core.async/<! ~ch)]
+         (actx-event ~actx [:end "atake" ~actx ~ch result#])
+         result#)))

 (defmacro aput [actx ch msg]
-  `(do (actx-event ~actx ["aput" ~actx ~msg])
-       (cljs.core.async/>! ~ch ~msg)))
+  `(do (actx-event ~actx [:beg "aput" ~actx ~msg])
+       (let [result# (cljs.core.async/>! ~ch ~msg)]
+         (actx-event ~actx [:end "aput" ~actx ~msg result#])
+         result#)))

 (defmacro aalts [actx chs]
-  `(do (actx-event ~actx ["aalts" ~actx ~chs])
-       (cljs.core.async/alts! ~chs)))
+  `(do (actx-event ~actx [:beg "aalts" ~actx ~chs])
+       (let [result# (cljs.core.async/alts! ~chs)]
+         (actx-event ~actx [:end "aalts" ~actx ~chs result#])
+         result#)))


Bump dependencies to satisfy lein-nvd

Bump dependencies to satisfy lein-nvd

This bumps clojure library deps that have a new versions, as well as adding
exclusions/explicit dependencies on some libraries in order to satisfy the
National Vulnerability Database

Semi-related to #446

--- project.clj
+++ project.clj
@@ -15,18 +15,21 @@
                  [commons-codec "1.11"]
                  [commons-io "2.6"]
                  [slingshot "0.12.2"]
-                 [potemkin "0.4.4"]]
+                 [potemkin "0.4.5"]]
   :resource-paths ["resources"]
   :profiles {:dev {:dependencies [;; optional deps
                                   [cheshire "5.8.0"]
-                                  [crouton "0.1.2"]
+                                  [crouton "0.1.2" :exclusions [[org.jsoup/jsoup]]]
+                                  [org.jsoup/jsoup "1.11.3"]
                                   [org.clojure/tools.reader "1.2.2"]
-                                  [com.cognitect/transit-clj "0.8.300"]
-                                  [ring/ring-codec "1.1.0"]
+                                  [com.cognitect/transit-clj "0.8.309"]
+                                  [ring/ring-codec "1.1.1"]
                                   ;; other (testing) deps
                                   [org.clojure/clojure "1.9.0"]
                                   [org.clojure/tools.logging "0.4.0"]
-                                  [ring/ring-jetty-adapter "1.6.3"]
+                                  [ring/ring-jetty-adapter "1.6.3"
+                                   :exclusions [[org.eclipse.jetty/jetty-server]]]
+                                  [org.eclipse.jetty/jetty-server "9.4.9.v20180320"]
                                   [ring/ring-devel "1.6.3"]
                                   ;; caching example deps
                                   [org.clojure/core.cache "0.7.1"]
@@ -34,7 +37,10 @@
                                   [org.apache.logging.log4j/log4j-api "2.11.0"]
                                   [org.apache.logging.log4j/log4j-core "2.11.0"]
                                   [org.apache.logging.log4j/log4j-1.2-api "2.11.0"]]
-                   :plugins [[lein-ancient "0.6.15"]]}
+                   :plugins [[lein-ancient "0.6.15"]
+                             [jonase/eastwood "0.2.5"]
+                             [lein-kibit "0.1.5"]
+                             [lein-nvd "0.5.2"]]}
              :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
              :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
              :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}}


Use Cassandra 1.2.6 in development

Use Cassandra 1.2.6 in development

--- project.clj
+++ project.clj
@@ -20,7 +20,7 @@
                          :resource-paths ["resources"]
                          :dependencies [[org.xerial.snappy/snappy-java      "1.0.5"]
                                         [commons-lang/commons-lang          "2.6"]
-                                        [org.apache.cassandra/cassandra-all "1.2.4"]
+                                        [org.apache.cassandra/cassandra-all "1.2.6"]
                                         [org.clojure/tools.trace            "0.7.5"]
                                         ]}}
   :aliases        {"all" ["with-profile" "dev:dev,1.4:dev,1.6:dev,master"]}


lein-release plugin: bumped version from 0.1.1 to 0.1.2-SNAPSHOT for next development cycle


AW + CW | 260 | use prep task to compile cljs

--- project.clj
+++ project.clj
@@ -95,7 +95,7 @@
                                                                    :pretty-print  true}}
                                                  ]
                                         :test-commands {"phantom" ["phantomjs" :runner "target/cljs/testable.js"]}}}}
-             :uberjar {:hooks       [leiningen.cljsbuild]
+             :uberjar {:prep-tasks  ["compile" ["cljsbuild" "once"]]
                        :env         {:production true}
                        :aot         :all
                        :omit-source true


Version bump

Version bump

--- project.clj
+++ project.clj
@@ -6,7 +6,7 @@
 ;; the terms of this license.
 ;; You must not remove this notice, or any other, from this software.

-(defproject conexp-clj "2.0.2-SNAPSHOT"
+(defproject conexp-clj "2.0.3-SNAPSHOT"
   :min-lein-version "2.0.0"
   :description "A ConExp rewrite in clojure"
   :url "http://github.com/tomhanika/conexp-clj/"


Updated: Clojure -> 1.7.0-alpha6, cljs -> 0.0-3178, compojure -> 1.3.3

--- project.clj
+++ project.clj
@@ -4,8 +4,8 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :min-lein-version "2.0.0"
-  :dependencies [[org.clojure/clojure "1.7.0-alpha5"]
-                 [org.clojure/clojurescript "0.0-3165"]
+  :dependencies [[org.clojure/clojure "1.7.0-alpha6"]
+                 [org.clojure/clojurescript "0.0-3178"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [com.stuartsierra/component "0.2.3"]
                  [environ "1.0.0"]
@@ -14,7 +14,7 @@

                  [ring/ring-core "1.3.2"]
                  [ring/ring-defaults "0.1.4"]
-                 [compojure "1.3.2"]
+                 [compojure "1.3.3"]
                  [http-kit "2.1.19"]

                  [com.taoensso/sente "1.4.1" :exclusions [org.clojure/tools.reader]]


clean up project.clj whitespace

clean up project.clj whitespace

--- project.clj
+++ project.clj
@@ -79,17 +79,11 @@
                                        :css-dirs         ["resources/public/css"]}

                         :env          {:dev? true}
-
                         :cljsbuild    {:builds        {:app {:source-paths ["env/dev/cljs"]
                                                              :compiler     {:main          "lambdacd.dev"
                                                                             :optimizations :none
                                                                             :source-map    true}}
-                                                       :test {:source-paths   ["src/cljs" "test/cljs"]
-                                                              :compiler       {
-                                                                               :optimizations :none
-                                                                               :main "lambdacd.runner"
-                                                                               :pretty-print  true
-                                                                               }
-                                                              }
-                                                       }
-                                       }}})+                                                       :test {:source-paths ["src/cljs" "test/cljs"]
+                                                              :compiler     {:optimizations :none
+                                                                             :main "lambdacd.runner"
+                                                                             :pretty-print  true}}}}}})


updated deps

updated deps

--- project.clj
+++ project.clj
@@ -4,8 +4,8 @@
   :license {:name "Apache License, Version 2.0"
             :url "https://www.apache.org/licenses/LICENSE-2.0.html"}
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [dda/dda-pallet-commons "0.7.1-SNAPSHOT"]
-                 [dda/dda-pallet "0.6.5"]
+                 [dda/dda-pallet-commons "0.8.0-SNAPSHOT"]
+                 [dda/dda-pallet "0.7.0-SNAPSHOT"]
                  [dda/dda-user-crate "0.7.0"]
                  [dda/dda-serverspec-crate "0.4.0"]
                  [dda/dda-git-crate "0.2.2"]
@@ -25,8 +25,8 @@
                    [[org.clojure/test.check "0.10.0-alpha2"]
                     [org.domaindrivenarchitecture/pallet-aws "0.2.8.2"]
                     [com.palletops/pallet "0.8.12" :classifier "tests"]
-                    [dda/dda-pallet-commons "0.7.1-SNAPSHOT" :classifier "tests"]
-                    [ch.qos.logback/logback-classic "1.2.3"]
+                    [dda/dda-pallet-commons "0.8.0-SNAPSHOT" :classifier "tests"]
+                    [ch.qos.logback/logback-classic "1.3.0-alpha0"]
                     [org.slf4j/jcl-over-slf4j "1.8.0-beta0"]]
                    :plugins
                    [[lein-sub "0.3.0"]]
@@ -42,6 +42,6 @@
                        :aot :all
                        :main dda.pallet.dda-managed-vm.main
                        :dependencies [[org.clojure/tools.cli "0.3.5"]
-                                      [ch.qos.logback/logback-classic "1.2.3"]
+                                      [ch.qos.logback/logback-classic "1.3.0-alpha0"]
                                       [org.slf4j/jcl-over-slf4j "1.8.0-beta0"]]}}
   :local-repo-classpath true)


lein-release plugin: bumped version from 0.1.5 to 0.1.6-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject re-view-material "0.1.5"
+(defproject re-view-material "0.1.6-SNAPSHOT"
   :description "Material design components in re-view"
   :url "https://www.github.com/re-view/re-view-material"
   :license {:name "MIT License"


Add scm map

Add scm map


More incompatible changes -> next release will be 0.3.0.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.damballa/parkour "0.2.2-SNAPSHOT"
+(defproject com.damballa/parkour "0.3.0-SNAPSHOT"
   :description "Hadoop MapReduce in idiomatic Clojure."
   :url "http://github.com/damballa/parkour"
   :license {:name "Eclipse Public License"


Add `devcards` back to `source-paths`

Add `devcards` back to `source-paths`

--- project.clj
+++ project.clj
@@ -101,7 +101,7 @@
                                             ;; Speeds up Figwheel cycle, at the risk of dependent namespaces getting out of sync.
                                             :recompile-dependents false}}

-                           :devcards {:source-paths ["src-cljs" "test-cljs"]
+                           :devcards {:source-paths ["src-cljs" "test-cljs" "devcards"]
                                       :figwheel {:devcards true
                                                  :websocket-url "wss://prod.circlehost:4444/figwheel-ws"
                                                  :on-cssload "frontend.core/handle-css-reload"}


release 1.0.2

release 1.0.2


Add obb-rules dep

Add obb-rules dep

--- project.clj
+++ project.clj
@@ -12,6 +12,7 @@
                  [javax.servlet/servlet-api "2.5"]
                  [ring/ring-jetty-adapter "1.2.2"]
                  [environ "0.5.0"]
+                 [obb-rules "1.0.0-SNAPSHOT"]
                  [compojure "1.2.0"]]

   :plugins [[environ/environ.lein "0.2.1"]


Up version to 0.2.0.

Up version to 0.2.0.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject fixturex "0.1.0"
+(defproject fixturex "0.2.0"
   :description "A library of helpful test fixture macros and functions."
   :url "http://www.ryanmcg.com/fixturex/"
   :license {:name "Eclipse Public License"


Release version 0.9.11.0-alpha1.

Release version 0.9.11.0-alpha1.


Add cloverage plugin.

Add cloverage plugin.

--- project.clj
+++ project.clj
@@ -13,7 +13,8 @@
                  [org.bouncycastle/bcpkix-jdk15on "1.50"]]
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
-  :plugins [[codox "0.6.6"]]
+  :plugins [[codox "0.6.6"]
+            [lein-cloverage "1.0.2"]]
   :codox {:output-dir "doc/api"
           :src-dir-uri "http://github.com/niwibe/buddy/blob/master/"
           :src-linenum-anchor-prefix "L"}


Deploying using shell to avoid gpg file

Deploying using shell to avoid gpg file

--- project.clj
+++ project.clj
@@ -3,7 +3,8 @@
   :url "https://github.com/johanhaleby/fake-http"
   :license {:name "Eclipse Public License"
             :url  "http://www.eclipse.org/legal/epl-v10.html"}
-  :lein-release {:deploy-via :clojars}
+  :lein-release {:deploy-via :shell
+                 :shell      ["lein" "deploy" "clojars"]}
   :min-lein-version "2.0.0"
   :dependencies [[org.nanohttpd/nanohttpd "2.3.0"]]
   :profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0"]


Release version 0.8.1.0-alpha1.

Release version 0.8.1.0-alpha1.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-kafka "0.8.0.3-SNAPSHOT"
+(defproject org.onyxplatform/onyx-kafka "0.8.1.0-alpha1"
   :description "Onyx plugin for Kafka"
   :url "https://github.com/MichaelDrogalis/onyx-kafka"
   :license {:name "Eclipse Public License"


bumping flax version to 2.0.4

bumping flax version to 2.0.4

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject co.nclk/linen "2.1.3"
+(defproject co.nclk/linen "2.1.4"
   :description "Implementation of an interpreter for flax, a domain specific
                language for modeling coordinated, distributed processes."
   :url "https://github.com/tjb1982/linen"
@@ -11,7 +11,7 @@
                  [cheshire "5.6.3"]
                  [clj-ssh "0.5.14"]
                  [co.nclk/clj-yaml "1.0.0"]
-                 [co.nclk/flax "2.0.3"]
+                 [co.nclk/flax "2.0.4"]
                  ]
   :aot :all
   :main co.nclk.linen.core)


Start 0.3.6-SNAPSHOT

Start 0.3.6-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject nightcode "0.3.5"
+(defproject nightcode "0.3.6-SNAPSHOT"
   :description "An IDE for Clojure and Java"
   :url "https://github.com/oakes/Nightcode"
   :license {:name "Public Domain"


Version 3.1.0

Version 3.1.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject salava "3.1.0-SNAPSHOT"
+(defproject salava "3.1.0"
   :description "Salava application server"
   :url "http://salava.org"
   :license {:name "Apache 2.0"


update version/deps

update version/deps

--- project.clj
+++ project.clj
@@ -1,5 +1,5 @@
-(defproject thi.ng/fabric "0.1.0-SNAPSHOT"
-  :description  "Signal/Collect inspired compute graph"
+(defproject thi.ng/fabric "0.1.0"
+  :description  "Signal/Collect inspired compute graph infrastructure"
   :url          "http://thi.ng/fabric"
   :license      {:name "Apache Software License 2.0"
                  :url "http://www.apache.org/licenses/LICENSE-2.0"
@@ -9,7 +9,8 @@

   :min-lein-vesion "2.4.0"

-  :dependencies [[org.clojure/clojure "1.8.0-alpha4"]
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 ;;[org.clojure/clojure "1.8.0-alpha4"]
                  [org.clojure/clojurescript "1.7.48"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [com.taoensso/timbre "4.0.2"]
@@ -20,20 +21,20 @@
                        :plugins      [[com.cemerick/clojurescript.test "0.3.3"]
                                       [lein-cljsbuild "1.0.6"]]
                        :global-vars {*warn-on-reflection* true}
-                       :jvm-opts ^:replace []
+                       :jvm-opts ^:replace [] ;;["-XX:+PrintCompilation" "-XX:+UnlockDiagnosticVMOptions" "-XX:+PrintInlining"]
                        :aliases {"cleantest" ["do" "clean," "test," "cljsbuild" "test"]}}}

   :cljsbuild    {:builds [{:id "test"
                            :source-paths ["src" "test"]
                            :compiler {:optimizations :whitespace
                                       :pretty-print true
-                                      :output-to "target/fabric-0.1.0-SNAPSHOT.js"}}
+                                      :output-to "target/fabric-0.1.0.js"}}
                           {:id "prod"
                            :source-paths ["src"]
                            :compiler {:optimizations :advanced
                                       :pretty-print false
-                                      :output-to "target/fabric-0.1.0-SNAPSHOT.js"}}]
-                 :test-commands {"unit-tests" ["phantomjs" :runner "target/fabric-0.1.0-SNAPSHOT.js"]}}
+                                      :output-to "target/fabric-0.1.0.js"}}]
+                 :test-commands {"unit-tests" ["phantomjs" :runner "target/fabric-0.1.0.js"]}}

   :pom-addition [:developers [:developer
                               [:name "Karsten Schmidt"]


Version 1.4.1-SNAPSHOT

Version 1.4.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/kitchensink "1.4.0"
+(defproject puppetlabs/kitchensink "1.4.1-SNAPSHOT"
   :description "Clojure utility functions"
   :license {:name "Apache License, Version 2.0"
             :url "http://www.apache.org/licenses/LICENSE-2.0.html"}


GM: Add cljsjs moment dependency

GM: Add cljsjs moment dependency

--- project.clj
+++ project.clj
@@ -33,7 +33,9 @@
                  [clavatar "0.2.1"]
                  [com.keminglabs/cljx "0.6.0" :exclusions [org.clojure/clojure]]
                  [environ "1.0.0"]
-                 [clj-redis-session "2.1.0"]]
+                 [clj-redis-session "2.1.0"]
+                 ;; CLSJS Dependencies
+                 [cljsjs/moment "2.9.0-0"]]

   :plugins [[com.keminglabs/cljx "0.6.0" :exclusions [org.clojure/clojure]]
             [lein-cljsbuild "1.0.5"]


Add lein-ancient plugin and set "provided" scope for clojure.

--- project.clj
+++ project.clj
@@ -3,10 +3,11 @@
   :url "https://github.com/funcool/buddy-hashers"
   :license {:name "Apache 2.0"
             :url "http://www.apache.org/licenses/LICENSE-2.0"}
-  :dependencies [[org.clojure/clojure "1.6.0"]
+  :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"]
                  [buddy/buddy-core "0.5.0"]
                  [clojurewerkz/scrypt "1.2.0"]]
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
   :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
-  :test-paths ["test"])
+  :test-paths ["test"]
+  :profiles {:dev {:plugins [[lein-ancient "0.6.7"]]}})


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-dashboard "0.8.7.0-alpha2"
+(defproject org.onyxplatform/onyx-dashboard "0.8.7.0-SNAPSHOT"
   :description "Dashboard for the Onyx distributed computation system"
   :url "http://github.com/lbradstreet/onyx-dashboard"
   :license {:name "Eclipse Public License"


ordered no longer limits us to Clojure 1.3

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def common-deps '[[ordered "1.1.0"]
+(def common-deps '[[ordered "1.2.0"]
                    [org.clojure/math.combinatorics "0.0.1"]
                    [org.clojure/algo.monads "0.1.0"]
                    [org.clojure/core.unify "0.5.2"]
@@ -11,8 +11,8 @@
 (defproject midje "1.4.0-SNAPSHOT"
   :description "A TDD library for Clojure that supports top-down ('mockish') TDD, encourages readable tests, provides a smooth migration path from clojure.test, balances abstraction and concreteness, and strives for graciousness."
   :url "https://github.com/marick/Midje"
-  :dependencies ~(conj common-deps
-                       '[org.clojure/clojure "1.4.0"])
+  :dependencies ~(cons '[org.clojure/clojure "1.4.0"]
+                       common-deps)

   :multi-deps {"1.2.0" [[org.clojure/clojure "1.2.0"]]
                "1.2.1" [[org.clojure/clojure "1.2.1"]]


a bit of a rehash

a bit of a rehash

--- dada-core/src/test/clojure/org/dada/core/test_clojure.clj
+++ dada-core/src/test/clojure/org/dada/core/test_clojure.clj
@@ -1,15 +1,18 @@
 (ns org.dada.core.test-clojure
     (:use
      [clojure test]
+     [clojure.contrib math]
      )
     )

 (set! *warn-on-reflection* true)

+;;--------------------------------------------------------------------------------
 ;; test the speed of various bits of clojure to help ascertain which way DADA should do things

 (defmacro millis [times body]
   `(do
+     (System/gc)
      (print (quote ~body))
      (let [start# (System/currentTimeMillis)]
        (do (dotimes [_# ~times] ~body) nil)
@@ -17,14 +20,21 @@
 	 (println ": " elapsed# " millis")
 	 elapsed#))))

-;; todo - time rhs and lhs on different threads ?
 (defmacro faster [times lhs rhs]
-  `(< (millis ~times ~lhs) (millis ~times ~rhs)))
-
-(defrecord Value [v])
+  `(let [l# (millis ~times ~lhs) r# (millis ~times ~rhs)] (< l# r#)))
+
+(defmacro slower [times lhs rhs]
+  `(let [l# (millis ~times ~lhs) r# (millis ~times ~rhs)] (> l# r#)))
+
+(defmacro similar [times tolerance lhs rhs]
+  `(let [l# (millis ~times ~lhs) r# (millis ~times ~rhs)] (< (abs (- l# r#)) ~tolerance)))

 (defn ibm? []
   (.contains (.toLowerCase (System/getProperty "java.vm.vendor")) "ibm"))
+
+;;--------------------------------------------------------------------------------
+
+(defrecord Value [v])

 ;; (if (not (ibm?)) ;TODO - these assumptions do not hold true on IBM - maybe we should generate code accordingly ?
 ;;   (do
@@ -46,16 +56,18 @@
 ;;     (let [^{:tag (type (into-array Object []))} a (into-array Object [0])]
 ;;       (is (faster 100000000 (Value. 0) (.newInstance c a))))))

-;; I'm not going to test this - just make a note of it...
-(deftest test-record-vs-pojo
-  (let [^Value r (Value. 0)
-	^String p ""]
-    (faster 100000000 (.v r)(.length p))))
-
-;; this may be needed for where we need to access a field via a function rather than a java accessor... - not much in it...
-
-;; (deftest test-get
-;;   (let [^Value v (Value. 0)] (is (faster 1000000000 ((fn [^Value v] (.v v)) v) (:v v)))))
+;; is accessing a record attribute using dot notation comparable in speed to dot notation method invocation ?
+(deftest test-record-access-vs-pojo-method
+  (let [^Value r (Value. 0)] (is (similar 100000000 30 (.v r)(.getClass r)))))
+
+;; is accessing a record attribute faster by dot notation than by keyward ?
+;; looks like it is currently 5x faster...
+(deftest test-get
+  (let [^Value v (Value. (Object.))] (is (faster 1000000000 (.v v) (:v v)))))
+
+;; if we wrap the dot notation in a function, is it still faster ?
+(deftest test-getter
+  (let [^Value v (Value. (Object.)) f (fn [^Value v] (.v v))] (is (faster 1000000000 (f v) (:v v)))))

 ;; doseq nearly twice as fast

@@ -65,70 +77,54 @@

 ;; seems to be true - but so close I can't rely on it not to fail build

-;;(deftest assoc-vs-conj
-;;  (is (faster 1 (reduce (fn [r i] (assoc r i i)) {} (range 3000000)) (reduce (fn [r i] (conj r [i i])) {} (range 3000000)))))
-
-;; surely some mistake (on my part) here - I can look up a field in a record 100o x faster than I can in an array - I expected it to be faster, but...
-;; this is down to reflection - investigate how to use an Object array efficiently
-;; type hint was wrong - but why ?
+;; (deftest assoc-vs-conj
+;;   (is (let [n 1000000 i (range n)]
+;;         (faster
+;;          1
+;;          (reduce (fn [r i] (assoc r i i)) {} i)
+;;          (reduce (fn [r i] (conj r [i i])) {} i)))))
+
+;; There does not seem to be much difference between record attribute
+;; access via dot notation and array access via index. Perhaps rows
+;; should be implemented by arrays ?
 (if (not (ibm?))
   (deftest record-vs-array-access
-    (let [^Value r (Value. 0)
-	  ^objects a (into-array Object [0])]
-      (is (faster 1000000000 (.v r) (aget a 0))))))
-
-;; but accessing a record field still appears to be 10 times faster than an array - is the int being boxed on the way out ?
-(if (not (ibm?))
-  (deftest record-vs-int-array-access
-    (let [^Value r (Value. 0)
-	  ^ints a (int-array [0])]
-      (is (faster 1000000000 (.v r) (aget a 0))))))
-
-;; no it's not autoboxing slowing down the int-array test - array access is slower than record access - by a factor of 10
-(if (not (ibm?))
-  (deftest record-vs-object-array-access
-    (let [^Value r (Value. 0)
-	  ^objects a (object-array [0])]
-      (is (faster 1000000000 (.v r) (aget a 0))))))
+    (let [^Value r (Value. 0) ^objects a (into-array Object [0])] (is (faster 1000000000 (.v r) (aget a 0))))))
+

 (defrecord Foo (^int a))
 (defrecord Bar (^Integer a))

-;; int is faster (5x) - to be expected
-
-;; (if (not (ibm?))
-;;   (deftest record-int-vs-integer
-;;     (let [f (Foo. 1)
-;; 	  b (Bar. 1)]
-;;       (is (faster 1000000000 (.a b)  (.a f))))))
+;; reading an int out of a record is about 2x as slow as reading an
+;; Integer - I guess that this is due to autoboxing...
+(if (not (ibm?))
+  (deftest record-int-vs-integer
+    (let [f (Foo. 1) b (Bar. 1)] (is (slower 1000000000 (.a f) (.a b))))))

 ;; interesting - reading an int out of a record and pssing it into
 ;; another fn (causing it to be auto-boxed) is still 5-10x faster than
 ;; just reading an Integer out of a record and passing it straight
 ;; into the same fn...

-(if (not (ibm?))
-  (deftest record-boxed-int-vs-integer
-    (let [f (Foo. 1)
-	  b (Bar. 1)]
-      (is (faster 1000000000 (identity (.a b))  (identity (.a f)))))))
-
 (import 'java.util.concurrent.locks.ReadWriteLock)
 (import 'java.util.concurrent.locks.ReentrantReadWriteLock)
 (import 'java.util.concurrent.locks.Lock)
 (import 'java.util.Map)
 (import 'java.util.HashMap)

-;; (deftest rw-mutable-vs-immutable
-;;   (let [lock ^ReadWriteLock (ReentrantReadWriteLock.)
-;; 	wr (.writeLock lock)
-;; 	m ^Map (HashMap.)
-;; 	a (atom {})
-;; 	n 10000000]
-;;     (is (faster 1
-;; 		(dotimes [i n] (try (.lock wr) (.put m i i) (catch Exception e)(finally (.unlock wr))))
-;; 		(dotimes [i n] (swap! a conj [i i]))
-;; 		))))
+;; taking a lock, putting an item into a mutable map, releasing the
+;; lock appears quicker than swapping a value onto the end of an
+;; immutable map in an atom...
+(deftest rw-mutable-vs-immutable
+  (let [lock ^ReadWriteLock (ReentrantReadWriteLock.)
+ 	wr (.writeLock lock)
+ 	m ^Map (HashMap.)
+ 	a (atom {})
+ 	n 1000000]
+    (is (faster 1
+ 		(dotimes [i n] (try (.lock wr) (.put m n i) (catch Exception e)(finally (.unlock wr))))
+ 		(dotimes [i n] (swap! a conj [i i]))
+ 		))))

 ;; atom 4 times faster on J6/C1.3a4
 ;; (if (not (ibm?))