update

update

--- src/collar/piece.clj
+++ src/collar/piece.clj
@@ -15,15 +15,16 @@

 (defn head [title]
   [:head
+   (if u/is-master?
+     [:script "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-104505539-1', 'auto');ga('send', 'pageview');"])
    [:title (str title " - " u/site-name)]
    [:meta {:name "viewport"
            :content "width=device-width, initial-scale=1"}]
-   [:link {:href "/favicon.ico" :rel "icon"}]
+   [:link {:rel "icon"
+           :href "/favicon.ico"}]
    (h/include-css "/css/style.css")
-   [:link {:href "https://fonts.googleapis.com/css?family=Source+Code+Pro|Source+Sans+Pro"
-           :rel "stylesheet"}]
-   (if u/is-master?
-     [:script "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-104505539-1', 'auto');ga('send', 'pageview');"])
+   [:link {:rel "stylesheet"
+           :href "https://fonts.googleapis.com/css?family=Source+Code+Pro|Source+Sans+Pro"}]
    [:script {:src "/js/tablesort.min.js"}]])

 (defn nav [title]


fix handle-message

fix handle-message

--- src/fscrawler_tika_convert/core.clj
+++ src/fscrawler_tika_convert/core.clj
@@ -32,7 +32,7 @@

 (defn handle-message
   [ch metadata ^bytes payload]
-  (let [body (json/read-str (String. payload "UTF-8"))
+  (let [body (json/read-json (String. payload "UTF-8"))
         ;; {:keys [directory relpath] body}
         directory (:directory body)
         relpath (:relpath (:entry body))


IT COMPILES!

IT COMPILES!

Successful compilation using Quartus. There are still some quirks with
simulation, but the compiler isn't optimizing away the entire processor.
I was forgetting to move the opcode into the opcode signal, which
Quartus figured out meant that we couldn't get out of state_decode.

--- src/computer_build.clj
+++ src/computer_build.clj
@@ -12,7 +12,7 @@

 (def static-states {
   :fetch {:control-signals '(:rd_pc, :wr_MA), :next :store_instruction}
-  :store_instruction {:control-signals '(:rd_MD, :wr_ir), :next :decode}
+  :store_instruction {:control-signals '(:rd_MD, :wr_IR), :next :decode}
   :decode {:control-signals '()}
 })

@@ -81,6 +81,9 @@
     (defn realize-state [state]
       (let [highs (:control-signals state)]
         (vec (concat (map #(list 'high %) highs) (map #(list 'low %) (difference control-signals highs))))))
+    (defn tweak-instruction-fetch [body]
+      ; FIXME hard-coded
+      (vec (list* '(<= :opcode "2 downto 0" :system_bus "7 downto 5") body)))

     (list (state-machine "control_unit"
                    ; inputs
@@ -92,7 +95,9 @@
                    ; reset
                    (list* '(goto :fetch) (map #(list 'low %) control-signals))
                    ; states
-                   (mapmap realize-state states)
+                   (let [realized-states (mapmap realize-state states)] realized-states
+                         (assoc realized-states :store_instruction
+                          (tweak-instruction-fetch (:store_instruction realized-states))))
                    ; transitions
                    (concat
                      ; states
@@ -118,6 +123,7 @@
           ; defs
           [(signal :system_bus ~(std-logic-vector 7 0))
           (signal :alu_op ~(std-logic-vector 2 0))
+          (signal :opcode ~(std-logic-vector 7 5))
           (signal :wr_pc ~std-logic)
           (signal :rd_pc ~std-logic)
           (signal :wr_IR ~std-logic)


dummy actions

dummy actions

--- data/celestial/fixtures/populate.clj
+++ data/celestial/fixtures/populate.clj
@@ -26,12 +26,16 @@
 (defn add-actions
    "populates actions"
    []
-  (a/add-action d/redis-deploy))
+  (a/add-action d/redis-deploy)
+  ; these actions won't work
+  (a/add-action (assoc d/redis-deploy :name "restart-tomcat"))
+  (a/add-action (assoc d/redis-deploy :name "flush-cache")))

 (def machines
   (g/fmap (partial zipmap [:hostname])
      (g/tuple
-       (g/fmap (partial apply str) (g/tuple (g/elements ["red-" "smokeping-"]) g/nat)))))
+       (g/fmap (partial apply str)
+          (g/tuple (g/elements ["zeus-" "atlas-" "romulus-" "remus-"]) g/nat)))))

 (def host-env-gen
   (g/fmap (partial zipmap [:env :type])


Added check for get-job API call

Added check for get-job API call

--- src/emender_jenkins/rest_api.clj
+++ src/emender_jenkins/rest_api.clj
@@ -205,7 +205,12 @@
     (let [job-name (uri->job-name uri "/api/get_job/")]
         (if job-name
             (let [job-metadata (results/find-job-with-name job-name)]
-                 (send-response job-metadata request)))))
+                 (if job-metadata
+                     (send-response job-metadata request))
+                     (-> (job-does-not-exist-response job-name "get-job")
+                         (send-error-response request)))
+            (-> (job-does-not-exist-response job-name "get-job")
+                (send-error-response request)))))

 (defn update-job
     [request]


URL fix for method confs listing

URL fix for method confs listing

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
@@ -133,7 +133,7 @@
   {:component-did-mount
    (fn [{:keys [state props]}]
      (utils/ajax-orch
-       (str "/" (:selected-workspace-namespace props) "/" (:selected-workspace props) "/methodconfigs")
+       (str "/workspaces/" (:selected-workspace-namespace props) "/" (:selected-workspace props) "/methodconfigs")
        {:on-done (fn [{:keys [success? xhr]}]
                    (if success?
                      (swap! state assoc :method-confs-loaded? true :method-confs (utils/parse-json-string (.-responseText xhr)))


CMR-543: Added tests for 'unset' value in online_only and downloadable parameters.

--- test/cmr/system_int_test/search/granule_search_downloadable_test.clj
+++ test/cmr/system_int_test/search/granule_search_downloadable_test.clj
@@ -30,6 +30,9 @@
     (testing "search by downloadable false."
       (let [references (search/find-refs :granule {:downloadable false})]
         (is (d/refs-match? [gran2 gran3 gran4 gran6] references))))
+    (testing "search by online only unset."
+      (let [references (search/find-refs :granule {:downloadable "unset"})]
+        (is (d/refs-match? [gran1 gran2 gran3 gran4 gran5 gran6] references))))
     (testing "search by downloadable wrong value"
       (is (= {:status 422 :errors ["Parameter :downloadable must take value of true of false, but was wrong"]}
              (search/find-refs :granule {:downloadable "wrong"}))))))
@@ -54,6 +57,9 @@
     (testing "search by online only false."
       (let [references (search/find-refs :granule {:online-only false})]
         (is (d/refs-match? [gran2 gran3 gran4 gran6] references))))
+    (testing "search by online only unset."
+      (let [references (search/find-refs :granule {:online-only "unset"})]
+        (is (d/refs-match? [gran1 gran2 gran3 gran4 gran5 gran6] references))))
     (testing "search by online only wrong value"
       (is (= {:status 422 :errors ["Parameter :downloadable must take value of true of false, but was wrong"]}
              (search/find-refs :granule {:online-only "wrong"}))))))


(TK-168) Add test for default idle timeout

--- test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
+++ test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
@@ -52,9 +52,11 @@
   (let [client (HttpClient.)]
     (is (= 4096 (.getRequestBufferSize client)))))

-(deftest default-so-linger-timeout-test
+(deftest default-connector-settings-test
   (let [connector (ServerConnector. (Server.))]
-    (is (= -1 (.getSoLingerTime connector)))))
+    (is (= -1 (.getSoLingerTime connector)))
+    (is (= 30000 (.getIdleTimeout connector)))))

+


Formatting.

Formatting.

--- src/kolmogorov_music/kolmogorov.clj
+++ src/kolmogorov_music/kolmogorov.clj
@@ -12,9 +12,9 @@
             [kolmogorov-music.instrument :as instrument]
             [kolmogorov-music.coding :as coding]))

-;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Air on a \G String ;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Air on the \G String ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (comment (repeat 1000000000000 \G))

@@ -34,14 +34,9 @@
   `(/ (description-length ~expr) (result-length ~expr)))

 (fact "Kolmogorov randomness is the compression ratio between the description and the result."
-  (randomness (repeat 65 \G)) => 13/131)
+  (randomness (repeat 65 \G)) => 13/131
+  (randomness (->> 71 char repeat first)) => 26)

-(defmacro random? [expr]
-  `(>= (randomness ~expr) 1))
-
-(fact "A value is random if its description isn't shorter than its result."
-  (random? (repeat 65 \G)) => false
-  (random? (->> 66 char (repeat 14) (take 3))) => true)

@@ -80,8 +75,7 @@
 (fact "The definitionally macro lets us calculate on the definition of symbols."
   (definitionally description-length row-row) => 281
   (definitionally result-length row-row) => 2037
-  (definitionally randomness row-row) => 281/2037
-  (definitionally random? row-row) => false)
+  (definitionally randomness row-row) => 281/2037)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -168,10 +162,6 @@

-;;;;;;;;;;;;;;;;
-;;; Anti EP ;;;;
-;;;;;;;;;;;;;;;;
-
 ;;;;;;;;;;;;;;;;;;;;;
 ;;; Blurred Lines ;;;
 ;;;;;;;;;;;;;;;;;;;;;


fix for not importing completed visits

fix for not importing completed visits

--- iwaswhere-web/src/clj/iwaswhere_web/files.clj
+++ iwaswhere-web/src/clj/iwaswhere_web/files.clj
@@ -24,8 +24,13 @@
   [{:keys [current-state msg-payload]}]
   (let [entry-ts (:timestamp msg-payload)
         last-filter (:last-filter current-state)
-        exists? (uber/has-node? (:graph current-state) entry-ts)]
-    (if exists?
+        graph (:graph current-state)
+        exists? (uber/has-node? graph entry-ts)
+        existing (when exists? (uber/attrs graph entry-ts))]
+    ; Okay this is slightly too specific for my taste, but currently, the completion
+    ; of a visit is an update to a visit, and otherwise, the exists? logic would refuse
+    ; to import it.
+    (if (and exists? (not= (:md existing) "No departure recorded #visit"))
       (log/warn "Entry exists, skipping" msg-payload)
       (let [new-state (g/add-node current-state entry-ts msg-payload)]
         (append-daily-log msg-payload)


Store cached reactions directly on function/object

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -208,20 +208,12 @@

 (declare make-reaction)

-(defonce cached-reactions (transient {}))
-
-(defn- get-sub-map [k]
-  (let [m (get cached-reactions k)]
-    (if-not (nil? m)
-      m
-      (let [m (transient {})]
-        (->> (assoc! cached-reactions k m)
-             (set! cached-reactions))
-        m))))
-
-(defn- cached-reaction [f k1 k2 obj destroy]
-  (let [m (get-sub-map k1)
-        r (get m k2)]
+(def ^{:private true :const true} cache-key "reaction-cache")
+
+(defn- cached-reaction [f o k obj destroy]
+  (let [m (aget o cache-key)
+        m (if (nil? m) {} m)
+        r (get m k)]
     (if-not (nil? r)
       (-deref r)
       (if (nil? *ratom-context*)
@@ -229,22 +221,16 @@
         (let [r (make-reaction
                  f :on-dispose (fn [x]
                                  (when debug (swap! -running dec))
-                                 (let [c cached-reactions
-                                       m (-> (get c k1)
-                                             (dissoc! k2))
-                                       c (if (zero? (count m))
-                                           (dissoc! c k1)
-                                           (assoc! c k1 m))]
-                                   (set! cached-reactions c))
+                                 (as-> (aget o cache-key) _
+                                   (dissoc _ k)
+                                   (aset o cache-key _))
                                  (when-not (nil? obj)
                                    (set! (.-reaction obj) nil))
                                  (when-not (nil? destroy)
                                    (destroy x))
                                  nil))
               v (-deref r)]
-          (->> (assoc! m k2 r)
-               (assoc! cached-reactions k1)
-               (set! cached-reactions))
+          (aset o cache-key (assoc m k r))
           (when debug (swap! -running inc))
           (when-not (nil? obj)
             (set! (.-reaction obj) r))
@@ -257,7 +243,7 @@
   (-deref [this]
     (if-some [r reaction]
       (-deref r)
-      (cached-reaction #(apply f args) (goog/getUid f) args this nil)))
+      (cached-reaction #(apply f args) f args this nil)))

   IEquiv
   (-equiv [_ other]
@@ -371,7 +357,7 @@

 (defn with-let-values [key]
   (if-some [c *ratom-context*]
-    (cached-reaction array key (reaction-key c)
+    (cached-reaction array c key
                      nil with-let-destroy)
     (array)))

@@ -537,6 +523,10 @@
         nocache (if (nil? no-cache) false no-cache)
         reaction (Reaction. f nil dirty nil nil
                             runner on-set on-dispose nocache)]
+    (when-not (nil? capture)
+      (when-some [c (aget capture cache-key)]
+        (aset reaction cache-key c)))
+    ;; TODO: get rid of reaction-id
     (when-some [rid (some-> capture .-reaction-id)]
       (set! (.-reaction-id reaction) rid))
     (when-not (nil? derefed)


UDP server: adjust formatting of online log message

--- src/riemann/server.clj
+++ src/riemann/server.clj
@@ -212,7 +212,7 @@
                                  (InetSocketAddress. (:host opts)
                                                      (:port opts)))]
        (.add all-channels server-channel))
-     (info "UDP server " opts " online")
+     (info "UDP server" opts "online")

      ; fn to close server
      (fn []


[#200] Remove some duplication

[#200] Remove some duplication

--- api/src/clojure/org/akvo/flow_api/unilog/unilog.clj
+++ api/src/clojure/org/akvo/flow_api/unilog/unilog.clj
@@ -53,14 +53,6 @@
     lon (assoc :lon lon)
     name (assoc :name name)))

-(def form-instance-changed (comp #{"formInstanceUpdated" "formInstanceCreated"} :eventType :payload))
-(def form-instance-deleted (comp #{"formInstanceDeleted"} :eventType :payload))
-(def answer-changed (comp #{"answerUpdated" "answerCreated"} :eventType :payload))
-(def form-changed (comp #{"formUpdated" "formCreated"} :eventType :payload))
-(def form-deleted (comp #{"formDeleted"} :eventType :payload))
-(def data-point-changed (comp #{"dataPointUpdated" "dataPointCreated"} :eventType :payload))
-(def data-point-deleted (comp #{"dataPointDeleted"} :eventType :payload))
-
 (defn process-new-events [reducible]
   (let [pipeline (comp
                   (map (fn [x]
@@ -69,16 +61,18 @@
                             (catch Exception e
                               x))))
                    (map (fn [x]
-                          (if (unilog-spec/valid? x)
-                            (cond
-                              (form-instance-changed x) (assoc x ::form-instance-changed (-> x :payload :entity form-data))
-                              (answer-changed x) (assoc x ::form-instance-changed (-> x :payload :entity form-instance-data))
-                              (form-instance-deleted x) (assoc x ::form-instance-deleted (-> x :payload :entity :id))
-                              (form-changed x) (assoc x ::form-changed (-> x :payload :entity :id))
-                              (form-deleted x) (assoc x ::form-deleted (-> x :payload :entity :id))
-                              (data-point-changed x) (assoc x ::data-point-changed (-> x :payload :entity data-point-data))
-                              (data-point-deleted x) (assoc x ::data-point-deleted (-> x :payload :entity :id)))
-                            (assoc x ::x ::invalid)))))]
+                          (if-not (unilog-spec/valid? x)
+                            (assoc x ::x ::invalid)
+                            (let [[k f]
+                                  (case (-> x :payload :eventType)
+                                    ("formInstanceUpdated" "formInstanceCreated") [::form-instance-changed form-data]
+                                    ("answerUpdated" "answerCreated") [::form-instance-changed form-instance-data]
+                                    "formInstanceDeleted" [::form-instance-deleted :id]
+                                    ("formUpdated" "formCreated") [::form-changed :id]
+                                    "formDeleted" [::form-deleted :id]
+                                    ("dataPointUpdated" "dataPointCreated") [::data-point-changed data-point-data]
+                                    "dataPointDeleted" [::data-point-deleted :id])]
+                              (assoc x k (-> x :payload :entity f)))))))]
     (transduce
       pipeline
       (fn


Отладка расширения функционала пользователей

--- radiolamp-6P3S/src/ixinfestor/omut_webusers.cljs
+++ radiolamp-6P3S/src/ixinfestor/omut_webusers.cljs
@@ -36,10 +36,11 @@

 (defn webusers-edit-form [app _ {{:keys [app->row-fn row->app-fn
                                          nav-tabs-items-map
-                                         abody]
+                                         abody-fn]
                                   :or {nav-tabs-items-map {0 {:text "Логин"}
                                                            1 {:text "Роли"}}}} :specific
                                  :as opts}]
+
   (reify
       om/IWillMount
     (will-mount [_]
@@ -116,9 +117,11 @@
                 :form-body
                 (apply
                  dom/div nil
-
-                 (into
-                  [(om/build omut/nav-tabs (app :tabs)
+
+                 (reduce
+                  conj
+                  [
+                   (om/build omut/nav-tabs (app :tabs)
                              {:opts {}})

                    (omut/ui-nav-tab
@@ -162,9 +165,10 @@
                                                    title))
                                         (range))
                                        (apply dom/div nil)) ))
-                               (seq groups)) ))))]
-
-                  (or  abody []))
+                               (seq groups)) ))))
+                   ]
+
+                  (if abody-fn (abody-fn app) []))

                  )
@@ -205,9 +209,10 @@
     :modal-yes-no (assoc omut/modal-yes-no-app-init :row {})
     }))

-(defn webusers-search-view [app webuserser {:keys [selection-type
-                                                   editable?]
-                                            :or {selection-type :one}}]
+(defn webusers-search-view [app own {:keys [selection-type
+                                            webusers-edit-form-specific
+                                            editable?]
+                                     :or {selection-type :one}}]
   (reify
       om/IInitState
     (init-state [_]
@@ -226,8 +231,7 @@
                            (fn [app]
                              (ixnet/get-data "/tc/rb/webusers/list/transit"
                                              {:fts-query (get-in @app [:fts-query :value])
-                                              :page (get-in @app [:page])
-                                              :arls (get-in @app [:arls] #{})}
+                                              :page (get-in @app [:page])}
                                              (fn [response]
                                                (om/update! app :data (vec response)))))
                            :data-rendering-fn
@@ -276,7 +280,7 @@
                  (om/build omut/actions-modal (:modal-act app) {:opts {:chan-open chan-modal-act}}))

                (om/build webusers-modal-edit-form (:modal-add app)
-                         {:opts {
+                         {:opts {:specific webusers-edit-form-specific
                                  :chan-load-for-id chan-modal-add-id
                                  :post-save-fn #(do
                                                   (when chan-update


Fix for group chat invites icon in activity center

--- src/status_im/ui/screens/notifications_center/views/notification.cljs
+++ src/status_im/ui/screens/notifications_center/views/notification.cljs
@@ -6,13 +6,13 @@
             [status-im.i18n.i18n :as i18n]
             [status-im.ui.screens.notifications-center.styles :as styles]
             [status-im.utils.handlers :refer [<sub]]
-            [status-im.ui.screens.chat.photos :as photos]
-            [status-im.multiaccounts.core :as multiaccounts]
             [status-im.ui.components.icons.icons :as icons]
             [status-im.utils.contenthash :as contenthash]
             [status-im.constants :as constants]
             [status-im.ui.components.colors :as colors]
-            [status-im.ui.screens.home.views.inner-item :as home-item]))
+            [status-im.ui.screens.home.views.inner-item :as home-item]
+            [status-im.ui.components.chat-icon.screen :as chat-icon.screen]
+            [status-im.ui.components.chat-icon.styles :as chat-icon.styles]))

 (defn mention-element [from]
   (let [contact-name @(re-frame/subscribe [:contacts/contact-name-by-identity from])]
@@ -113,19 +113,20 @@
      (render-message (:parsed-text content) max-notification-length max-number-of-lines style text-weight))])

 (defn activity-text-item [home-item opts]
-  (let [{:keys [chat-id chat-name message last-message reply-message muted read group-chat timestamp type]} home-item
+  (let [{:keys [chat-id chat-name message last-message reply-message muted read group-chat timestamp type color]} home-item
         message (or message last-message)
         {:keys [community-id]} (<sub [:chat-by-id chat-id])
         {:keys [name]} @(re-frame/subscribe [:communities/community community-id])
-        contact (when message @(re-frame/subscribe [:contacts/contact-by-identity (message :from)]))
         sender (when message (first @(re-frame/subscribe [:contacts/contact-two-names-by-identity (message :from)])))]
     [react/touchable-opacity (merge {:style (styles/notification-container read)} opts)
      [react/view {:style styles/notification-content-container}
-      [react/view {:style styles/photo-container}
-       [photos/photo
-        (multiaccounts/displayed-photo contact)
-        {:size 40
-         :accessibility-label :current-account-photo}]]
+      [chat-icon.screen/chat-icon-view chat-id group-chat chat-name
+       {:container              styles/photo-container
+        :size                   40
+        :chat-icon              chat-icon.styles/chat-icon-chat-list
+        :default-chat-icon      (chat-icon.styles/default-chat-icon-chat-list color)
+        :default-chat-icon-text (chat-icon.styles/default-chat-icon-text 40)
+        :accessibility-label    :current-account-photo}]
       [quo/text {:weight              :medium
                  :color               (when muted :secondary)
                  :accessibility-label :chat-name-or-sender-text


Upgrade lein-template version

Upgrade lein-template version

--- lein-template/project.clj
+++ lein-template/project.clj
@@ -1,7 +1,7 @@
 ;; Copyright © 2014 JUXT LTD.

 ;; We call this project modular to make the invocation: lein new modular appname
-(defproject modular/lein-template "0.6.13"
+(defproject modular/lein-template "0.6.14"
   :description "Leiningen template for a full-featured component based app using modular extensions."
   :url "http://modularity.org/"
   :license {:name "The MIT License"


Bump version of lein-template

Bump version of lein-template

--- lein-template/project.clj
+++ lein-template/project.clj
@@ -1,7 +1,7 @@
 ;; Copyright © 2014 JUXT LTD.

 ;; We call this project modular to make the invocation: lein new modular appname
-(defproject modular/lein-template "0.3.0"
+(defproject modular/lein-template "0.5.0-SNAPSHOT"
   :description "Leiningen template for a full-featured component based app using modular extensions."
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}


create-network should not take training-spec as an input arg

--- src/machine_learning/network.clj
+++ src/machine_learning/network.clj
@@ -73,8 +73,8 @@

 (defn create-network
   ([sizes]
-   (create-network sizes (->DefaultWeightInitializer) (->CrossEntropyCost)))
-  ([sizes weight_initializer training_spec]
+   (create-network sizes (->DefaultWeightInitializer)))
+  ([sizes weight_initializer]
    (if (>= 2 (count sizes))
      (throw (IllegalArgumentException. (format "create-network requires sizes to have at least one element, was: %s" sizes))))
    {:num_layers (count sizes)


Cleanup

Cleanup

--- src/expound/alpha.cljc
+++ src/expound/alpha.cljc
@@ -540,12 +540,10 @@
        "")
      (let [failure nil
            non-matching-value [:expound/value-that-should-never-match]
-           problems (groups (annotate-1*
-                             failure
-                             (map #(dissoc % :reason)
-                                  (map
-                                   #(dissoc % :expound.spec.problem/type)
-                                   problems))))]
+           problems (->> problems
+                         (map #(dissoc % :expound.spec.problem/type :reason))
+                         (annotate-1* failure)
+                         groups)]
        (apply str (for [prob problems]
                     (let [in (-> prob :expound/in)]
                       (expected-str (-> prob :expound.spec.problem/type) :expound/no-spec-name non-matching-value in [prob] opts))))))))
@@ -754,19 +752,14 @@
 (defn ^:private print-explain-data [opts explain-data]
   (if-not explain-data
     "Success!\n"
-    (let [{::s/keys [failure]} explain-data
-          explain-data' (problems/annotate explain-data)
-          ;; TODO - collapse into annotate
-          explain-data' (annotate-1 explain-data')
-          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-          ;; TODO - grab everything with let binding
-          caller (:expound/caller explain-data')
-          form (:expound/form explain-data')
+    (let [;; TODO - collapse into annotate
+          explain-data' (annotate-1 (problems/annotate explain-data))
+          {:expound/keys [caller form]
+           ::s/keys [failure]} explain-data'
           problems (->> explain-data'
                         :expound/problems
                         groups
                         (safe-sort-by :expound/in paths/compare-paths))]
-
       (printer/no-trailing-whitespace
        (str
         (ansi/color (instrumentation-info failure caller) :none)


(maint) Clean up and refactor service tests

Add `with-status-service` macro for bootstrapping the status service, its
dependencies, and any other desired services, using a common config.

--- test/puppetlabs/trapperkeeper/services/status/status_service_test.clj
+++ test/puppetlabs/trapperkeeper/services/status/status_service_test.clj
@@ -10,6 +10,24 @@
             [puppetlabs.trapperkeeper.services.webserver.jetty9-service :as jetty9-service]))

 (use-fixtures :once schema-test/validate-schemas)
+
+(def status-service-config
+  {:webserver {:port 8180
+               :host "0.0.0.0"}
+   :web-router-service
+     {:puppetlabs.trapperkeeper.services.status.status-service/status-service "/status"}})
+
+(defmacro with-status-service
+  "Macro to start the status service and its dependencies (jetty9 and
+  webrouting service), along with any other services desired."
+  [app services & body]
+  `(with-app-with-config
+    ~app
+    (concat [jetty9-service/jetty9-service
+             webrouting-service/webrouting-service
+             status-service] ~services)
+    status-service-config
+    (do ~@body)))

 (defservice foo-service
   [[:StatusService register-status]]
@@ -25,16 +43,10 @@
     context))

 (deftest rollup-status-endpoint-test
-  (with-app-with-config
+  (with-status-service
     app
-    [jetty9-service/jetty9-service
-     webrouting-service/webrouting-service
-     status-service
-     foo-service
+    [foo-service
      bar-service]
-    {:webserver {:port 8180
-                 :host "0.0.0.0"}
-     :web-router-service {:puppetlabs.trapperkeeper.services.status.status-service/status-service "/status"}}
     (testing "returns latest status for all services"
       (let [req (http-client/get "http://localhost:8180/status/v1/services")
             body (json/parse-string (slurp (:body req)))]
@@ -59,15 +71,9 @@
                body))))))

 (deftest single-service-status-endpoint-test
-  (with-app-with-config
+  (with-status-service
     app
-    [jetty9-service/jetty9-service
-     webrouting-service/webrouting-service
-     status-service
-     foo-service]
-    {:webserver {:port 8180
-                 :host "0.0.0.0"}
-     :web-router-service {:puppetlabs.trapperkeeper.services.status.status-service/status-service "/status"}}
+    [foo-service]
     (testing "returns service information for service that has registered a callback"
       (let [req (http-client/get "http://localhost:8180/status/v1/services/foo")]
         (is (= 200 (:status req)))
@@ -92,14 +98,7 @@
                (json/parse-string (slurp (:body req)))))))))

 (deftest error-handling-test
-  (with-app-with-config
-    app
-    [jetty9-service/jetty9-service
-     webrouting-service/webrouting-service
-     status-service]
-    {:webserver {:port 8180
-                 :host "0.0.0.0"}
-     :web-router-service {:puppetlabs.trapperkeeper.services.status.status-service/status-service "/status"}}
+  (with-status-service app []
     (testing "returns a 400 when an invalid level is queried for"
       (let [req (http-client/get "http://localhost:8180/status/v1/services?level=bar")]
         (is (= 400 (:status req)))


fix: random.clj reflection warnings

fix: random.clj reflection warnings

--- src/main/clojure/pdok/random.clj
+++ src/main/clojure/pdok/random.clj
@@ -1,6 +1,7 @@
 (ns pdok.random
-  (:import com.fasterxml.uuid.Generators))
+  (:import [com.fasterxml.uuid Generators]
+           [com.fasterxml.uuid.impl TimeBasedGenerator]))

 (def ^:private UUIDGenerator (Generators/timeBasedGenerator))

-(defn ordered-UUID [] (locking UUIDGenerator (.generate UUIDGenerator)))
+(defn ordered-UUID [] (locking UUIDGenerator (.generate ^TimeBasedGenerator UUIDGenerator)))


Set optimization level to :simple for watch script.

--- scripts/watch.clj
+++ scripts/watch.clj
@@ -5,8 +5,8 @@
    :target :nodejs
    :output-to "out/tests.js"
    :output-dir "out"
-   :optimizations :none
+   :optimizations :simple
    :pretty-print true
-   :language-in  :ecmascript5
+   :language-in  :ecmascript6
    :language-out :ecmascript5
    :verbose true})


Minor fix on watch script.

Minor fix on watch script.

--- scripts/watch.clj
+++ scripts/watch.clj
@@ -1,8 +1,10 @@
 (require '[cljs.build.api :as b])

 (b/watch (b/inputs "test" "src")
-  {:main 'octet.tests.corek
+  {:main 'octet.tests.core
    :target :nodejs
    :output-to "out/tests.js"
    :output-dir "out"
+   :optimizations :none
+   :pretty-print true
    :verbose true})


Whitespace.

Whitespace.

--- web/dev-resources/testing/web.clj
+++ web/dev-resources/testing/web.clj
@@ -1,11 +1,11 @@
 ;; Copyright 2014 Red Hat, Inc, and individual contributors.
-;;
+;;
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
 ;; You may obtain a copy of the License at
-;;
+;;
 ;; http://www.apache.org/licenses/LICENSE-2.0
-;;
+;;
 ;; Unless required by applicable law or agreed to in writing, software
 ;; distributed under the License is distributed on an "AS IS" BASIS,
 ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.


Workaround BigQuery NULL value bug :unamused:

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -183,7 +183,11 @@
      :cols    cols
      :rows    (for [^TableRow row (.getRows response)]
                 (for [[^TableCell cell, parser] (partition 2 (interleave (.getF row) parsers))]
-                  (parser (.getV cell))))}))
+                  (when-let [v (.getV cell)]
+                    ;; There is a weird error where everything that *should* be NULL comes back as an Object. See https://jira.talendforge.org/browse/TBD-1592
+                    ;; Everything else comes back as a String luckily so we can proceed normally.
+                    (when-not (= (class v) Object)
+                      (parser v)))))}))

 (defn- process-native* [database query-string]
   (post-process-native (execute-query database query-string)))


Bump BigQuery query timeout a bit :unamused:

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -190,7 +190,7 @@
    "STRING"    identity
    "TIMESTAMP" parse-timestamp-str})

-(def ^:private ^:const query-default-timeout-seconds 30)
+(def ^:private ^:const query-default-timeout-seconds 60)

 (defn- post-process-native
   ([^QueryResponse response]


trim-with-emit-set: preserve non def forms

--- src/oxcart/passes/tree_shake.clj
+++ src/oxcart/passes/tree_shake.clj
@@ -78,8 +78,7 @@
             (info "Discarding unused def form,"
                   (util/format-line-info ast)))

-          (warn "Discarding non-def top level form,"
-                (util/format-line-info ast))))
+          (swap! new-ast update-in [m :forms] conj ast)))

       (swap! new-ast update-in [m :forms] vec))


Added exclusions support in project files.  Useful for libraries that have extra dependencies unnecessary for runtime.  (Looking at you, log4j)

--- src/leiningen/deps.clj
+++ src/leiningen/deps.clj
@@ -3,17 +3,25 @@
   (:require [lancet])
   (:use [leiningen.pom :only [default-repos]]
         [clojure.contrib.java-utils :only [file]])
-  (:import [org.apache.maven.model Dependency]
+  (:import [org.apache.maven.model Dependency Exclusion]
            [org.apache.maven.artifact.ant DependenciesTask RemoteRepository]
            [org.apache.tools.ant.util FlatFileNameMapper]))

 ;; TODO: unify with pom.clj

-(defn make-dependency [[dep version]]
-  (doto (Dependency.)
-    (.setGroupId (or (namespace dep) (name dep)))
-    (.setArtifactId (name dep))
-    (.setVersion version)))
+(defn make-exclusion [excl]
+  (doto (Exclusion.)
+    (.setGroupId (or (namespace excl) (name excl)))
+    (.setArtifactId (name excl))))
+
+(defn make-dependency [[dep version & exclusions]]
+  (let [es (map make-exclusion (when (= (first exclusions) :exclusions)
+                                 (second exclusions)))]
+    (doto (Dependency.)
+            (.setGroupId (or (namespace dep) (name dep)))
+            (.setArtifactId (name dep))
+            (.setVersion version)
+            (.setExclusions es))))

 (defn make-repository [[id url]]
   (doto (RemoteRepository.)


Oops; missed local in my let form.

Oops; missed local in my let form.

--- src/leiningen/deps.clj
+++ src/leiningen/deps.clj
@@ -38,7 +38,7 @@
     (.setId repo id)
     (if (string? settings)
       (.setUrl repo settings)
-      (let [{:keys [url username password]}]
+      (let [{:keys [url username password]} settings]
         (.setUrl repo url)
         (.addAuthentication repo (Authentication. (doto (Server.)
                                                     (.setUsername username)


Allow tasks to provide their own help function.

--- src/leiningen/help.clj
+++ src/leiningen/help.clj
@@ -8,7 +8,7 @@
                 (sort)))

 (defn get-arglists [task]
-  (for [args (:arglists (meta task))]
+  (for [args (or (:help-arglists (meta task)) (:arglists (meta task)))]
     (vec (remove #(= 'project %) args))))

 (defn help-for
@@ -16,9 +16,11 @@
   in its namespace."
   [task]
   (let [task-ns (doto (symbol (str "leiningen." task)) require)
-        task (ns-resolve task-ns (symbol task))]
+        task (ns-resolve task-ns (symbol task))
+        help-fn (ns-resolve 'task-ns 'help)]
     (str "Arguments: " (pr-str (get-arglists task)) "\n"
-         (or (:doc (meta task))
+         (or (and help-fn (help-fn))
+             (:doc (meta task))
              (:doc (meta (find-ns task-ns)))))))

 ;; affected by clojure ticket #130: bug of AOT'd namespaces losing metadata


Also don't try to read the test results doc if it's empty.

--- src/leiningen/test.clj
+++ src/leiningen/test.clj
@@ -58,7 +58,7 @@
                      (with-version-guard
                        (form-for-testing-namespaces namespaces
                                                     (.getAbsolutePath result))))
-    (if (.exists result)
+    (if (and (.exists result) (pos? (.length result)))
       (let [summary (read-string (slurp (.getAbsolutePath result)))
             success? (zero? (+ (:error summary) (:fail summary)))]
         (.delete result)


Change core.logic on-disk format.

Change core.logic on-disk format.

It's now shaped more like core.logic's pldb data, but with the indexes missing.
Added 'rels->pldb for reconstructing a full pldb including indexes from the
index-free data from disk.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -10,6 +10,7 @@
             [datomic.db :as db]
             [clojure.core.logic.pldb :as pldb]
             [clojure.core.logic :as l]
+            [clojure.core.reducers :as red]
             [leiningen.core.project :as project]
             [leiningen.core.main :as lmain]
             [org.satta.glob :refer [glob]]
@@ -1066,6 +1067,7 @@
            [fname {:keys [sha ftype]}] (git-tree gitdir tree-sha)]
        [:tree/node tree-bsha ftype fname (str->sha sha)]))))

+(pldb/db-rel r-branch name sha)
 (pldb/db-rel r-commit ^:index sha ctime tree-sha)
 (pldb/db-rel r-commit-parent ^:index sha ^:index parent-sha)
 (pldb/db-rel r-tree ^:index sha name type ^:index obj-sha)
@@ -1078,28 +1080,58 @@
      (mapcat seq
              (for [{:keys [sha ctime tree parents]} commits
                    :let [bsha (str->sha sha)]]
-               (into [[:r-commit bsha ctime (str->sha tree)]]
+               (into [[r-commit bsha ctime (str->sha tree)]]
                      (for [p parents]
-                       [:r-commit-parent bsha (str->sha p)]))))
+                       [r-commit-parent bsha (str->sha p)]))))
      (for [tree-sha (all-git-trees gitdir)
            :let [tree-bsha (str->sha tree-sha)]
            [fname {:keys [sha ftype]}] (git-tree gitdir tree-sha)]
-       [:r-tree tree-bsha fname (keyword ftype) (str->sha sha)]))))
-
-(def rel-for-kw {:r-commit r-commit
-                 :r-commit-parent r-commit-parent
-                 :r-tree r-tree})
-(defn data->relation
-  [[rel-name & data]]
-  (cons (rel-for-kw rel-name) data))
+       [r-tree tree-bsha fname (keyword ftype) (str->sha sha)]))))
+
+(defn pldb-rels
+  [db]
+  (for [[rel-name indexes] db]
+    [rel-name (::pldb/unindexed indexes)]))
+
+(defn rels->pldb
+  [rels rel-data]
+  (let [rel-index-i (into {} (for [rel [r-tree r-branch]]
+                               [(:rel-name (meta rel))
+                                (keep-indexed #(when %2 %1)
+                                              (:indexes (meta rel)))]))]
+    (reduce
+     (fn [db [rel-name unindexed]]
+       (let [unindexed (into #{} (red/map vec unindexed))]
+         (assoc db
+           rel-name
+           (into {::pldb/unindexed unindexed}
+                 (for [i (rel-index-i rel-name)]
+                   [i (persistent!
+                       (reduce (fn [index tuple]
+                                 (let [key (nth tuple i)]
+                                   (assoc! index key ((fnil conj #{})
+                                                      (get index key)
+                                                      tuple))))
+                               (transient {})
+                               unindexed))])))))
+     pldb/empty-db
+     rel-data)))

 (comment
-  (time (fress-spit-seq "tmp.frs" (git-logic-tuples "<git repo>")))
-  (take 10 (filter #(= :r-tree (first %)) (fress/read "tmp.frs" :handlers my-read-handlers)))
-  (time (last (fress/read "tmp.frs" :handlers my-read-handlers)))
-  (time (def db (apply pldb/db
-                       (map data->relation
-                            (fress/read "tmp.frs" :handlers my-read-handlers)))))
+  (def xdb1 (pldb/db [r-tree :a :b :c :d]))
+  (pldb/with-db xdb1 (l/run* [a] (r-tree a :b :c :d)))
+  (def xdb2 (rels->pldb [r-tree] (pldb-rels xdb1)))
+  (pldb/with-db xdb2 (l/run* [a] (r-tree a :b :c :d)))
+  (def xdb3 (rels->pldb [r-tree] (fress/read (fress/write (pldb-rels xdb1)))))
+  (pldb/with-db xdb3 (l/run* [a] (r-tree a :b :c :d)))
+
+  (time (def db (apply pldb/db (git-logic-tuples "<git repo>"))))
+  (time (fress-spit-seq "tmp.frs" (pldb-rels db)))
+  (time (def db2
+          (rels->pldb [r-branch r-commit r-commit-parent r-tree r-proj]
+                      (fress/read "tmp.frs" :handlers my-read-handlers))))
+  (time (def x (fress/read "tmp.frs" :handlers my-read-handlers)))
+
   (pldb/with-db db
     (l/run 10 [sha]
      (l/fresh [obj-sha]


Handle merges where all parents delete a file.

When all parents delete a file it appears as an event for all parents
but the file no longer appears in the resulting merge. This triggered
a git error as git couldn't find the file.

Now we just ignore files that no longer exist.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1009,11 +1009,14 @@
        (partition-by #{"--"})
        (remove #{'("--")})
        file-path-merges
-       (map #(-> (git {:gitdir gitdir}
-                      "rev-parse" (str sha ":" %))
-                 :out
-                 s/trim
-                 (->> (vector %))))
+       (map #(let [ret (git {:gitdir gitdir :ok-statuses #{0 128}}
+                            "rev-parse" (str sha ":" %))]
+               (if (:bool ret)
+                 (-> (:out ret)
+                     s/trim
+                     (->> (vector %)))
+                 [])))
+       (remove empty?)
        (into {})))

 (defn exported-commits


remove node-jre reference

remove node-jre reference

closes #174

--- src/main/shadow/build/classpath.clj
+++ src/main/shadow/build/classpath.clj
@@ -286,7 +286,6 @@
                     )))))))

     (catch ZipException e
-      ;; node-jre contains a weird .jar that isn't actually a jar, just pretend its empty
       (log/debug "filtered bad jar" file e)
       {})


Explode test assertions to fix reporting (#444)

* explode test assertions

* fix swap-top-two-cards-2-test

--- exercises/concept/elyses-destructured-enchantments/test/elyses_destructured_enchantments_test.clj
+++ exercises/concept/elyses-destructured-enchantments/test/elyses_destructured_enchantments_test.clj
@@ -2,25 +2,41 @@
   (:require [clojure.test :refer :all]
             [elyses-destructured-enchantments :refer :all]))

-(deftest first-card-test
-  (is (= (first-card [3]) 3))
+(deftest first-card-single-test
+  (is (= (first-card [3]) 3)))
+
+(deftest first-card-multiple-test
   (is (= (first-card [8 3 9 5]) 8)))

-(deftest second-card-test
-  (is (= (second-card [10 4]) 4))
-  (is (= (second-card [2 5 1 6]) 5))
-  (is (nil? (second-card [])))
+(deftest second-card-2-test
+  (is (= (second-card [10 4]) 4)))
+
+(deftest second-card-4-test
+  (is (= (second-card [2 5 1 6]) 5)))
+
+(deftest second-card-empty-test
+  (is (nil? (second-card []))))
+
+(deftest second-card-single-test
   (is (nil? (second-card [8]))))

-(deftest swap-top-two-cards-test
-  (is (= (swap-top-two-cards [3 6]) [6 3]))
+(deftest swap-top-two-cards-2-test
+  (is (= (swap-top-two-cards [3 6]) [6 3])))
+
+(deftest swap-top-two-cards-5-test
   (is (= (swap-top-two-cards [10 4 3 7 8]) [4 10 3 7 8])))

-(deftest discard-top-card-test
-  (is (= (discard-top-card [7]) [7 nil]))
+(deftest discard-top-card-single-test
+  (is (= (discard-top-card [7]) [7 nil])))
+
+(deftest discard-top-card-4-test
   (is (= (discard-top-card [9 2 10 4]) [9 [2 10 4]])))

-(deftest insert-face-cards-test
-  (is (= (insert-face-cards [3 10 7]) [3 "jack" "queen" "king" 10 7]))
-  (is (= (insert-face-cards [9]) [9 "jack" "queen" "king"]))
-  (is (= (insert-face-cards []) ["jack" "queen" "king"])))
+(deftest insert-face-cards-3-test
+  (is (= (insert-face-cards [3 10 7]) [3 "jack" "queen" "king" 10 7])))
+
+(deftest insert-face-cards-1-test
+  (is (= (insert-face-cards [9]) [9 "jack" "queen" "king"])))
+
+(deftest insert-face-cards-empty-test
+  (is (= (insert-face-cards []) ["jack" "queen" "king"])))


reduce redundancy and use custom comparator

should also be faster

--- clojure/adventofcode/src/adventofcode/days/day4.clj
+++ clojure/adventofcode/src/adventofcode/days/day4.clj
@@ -2,33 +2,28 @@
   (:require [clojure.string :as s]
             [clojure.java.io :as io]))

-(defn room-name [room]
-  (subs room 0 (- (count room) 11)))
-
-(defn sector-id [room]
-  (let [length (count room)]
-    (subs room (- length 10) (- length 7))))
-
-(defn checksum [room]
-  (let [length (count room)]
-    (subs room (- length 6) (- length 1))))
+(defn compare-freq [[k1 v1] [k2 v2]]
+  (or (> v1 v2)
+      (and (= v1 v2)
+           (< (compare k1 k2) 0))))

 (defn calc-checksum [room-name]
   (->> (s/replace room-name "-" "")
        (frequencies)
-       (sort-by val)
-       (reverse)
-       (partition-by val)
-       (map #(map first %))
-       (map sort)
+       (sort compare-freq)
        (flatten)
+       (take-nth 2)
        (take 5)
        (s/join)))

 (defn sector-value [room]
-  (if (= (checksum room) (calc-checksum (room-name room)))
-    (Integer. (sector-id room))
-    0))
+  (let [length (count room)]
+    (letfn [(room-name [room] (subs room 0 (- length 11)))
+            (sector-id [room] (subs room (- length 10) (- length 7)))
+            (checksum [room] (subs room (- length 6) (- length 1)))]
+      (if (= (checksum room) (calc-checksum (room-name room)))
+        (Integer. (sector-id room))
+        0))))

 (defn rooms [path]
   (line-seq (io/reader path)))


Change copyright email on core ns.

Change copyright email on core ns.

--- src/suricatta/core.clj
+++ src/suricatta/core.clj
@@ -1,4 +1,4 @@
-;; Copyright (c) 2014-2015, Andrey Antukh <niwi@niwi.be>
+;; Copyright (c) 2014-2015, Andrey Antukh <niwi@niwi.nz>
 ;; All rights reserved.
 ;;
 ;; Redistribution and use in source and binary forms, with or without


Make it clear when we redirect due to the timeout.

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -1010,7 +1010,8 @@
       (go (alt!
             track-ch ([v] (do (utils/mlog "tracked" v "... redirecting")
                               (redirect)))
-            (async/timeout 5000) (redirect)))
+            (async/timeout 5000) (do (utils/mlog "timing out waiting for analytics. redirecting.")
+                                     (redirect))))
       (redirect))))

 (defmethod control-event :language-testimonial-tab-selected


better emails

better emails

--- src/ontrail/import.clj
+++ src/ontrail/import.clj
@@ -105,7 +105,7 @@
     (.info logger (str "Importing " import-file " for user " user))
     (if (not (.exists import-file))
       (do (io/copy tempfile import-file)
-          (let [res (import-user-and-file user (.getName import-file))
+          (let [res (import-user-and-file user (str "imports/" (.getName import-file)))
                 fres (frequencies res)]
             (send-import-msg user fres)
             (if (> (fres \+) 0)


stopped nav-button redraw on wide-screen


use HOST env vars

use HOST env vars

--- src/push_ups/utils.clj
+++ src/push_ups/utils.clj
@@ -4,7 +4,7 @@
 (defn domain
   "Get domain of app"
   ([]
-   (or (System/getenv "URL")
+   (or (System/getenv "HOST")
        "http://localhost:3000"))
   ([& pathcomponents]
      (join "/" (cons (domain) pathcomponents))))


CMR-2480: Added comment to migration.

CMR-2480: Added comment to migration.

--- metadata-db-app/src/migrations/033_replace_tags_namespace_and_value_with_tag_key.clj
+++ metadata-db-app/src/migrations/033_replace_tags_namespace_and_value_with_tag_key.clj
@@ -41,6 +41,8 @@
                        (util/gzip-blob->string)
                        (edn/read-string))
           tag-key (:tag-key metadata)
+          ;; There is no way to properly recover a namespace and value that have a
+          ;; "." in the value.
           [_ namespace value] (re-matches #"(.*)\.(.*$)" tag-key)
           metadata (-> metadata
                        (assoc :namespace namespace


ability to compile expressions into powerful forms

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -565,7 +565,10 @@

 (def computation-tree [+ :a [* :b :c]])

+(defn keyword->symbol [k] (-> k name symbol))
+
 (defn collect-dependencies
+  "Collect all the dependencies of an environment"
   [tree]
   (walk/postwalk
     (fn [node]
@@ -576,30 +579,38 @@
     tree))

 (defn eval-expr-in-env
+  "Evaluate the expression in an environment"
   [tree env]
   (walk/postwalk
     (fn [node]
       (cond
         (keyword? node) (get env node)
-        (vector? node) (apply (first node) (next node))
+        (vector? node) (apply (first node) (rest node))
         :else node))
     tree))

-;; TODO - compile expression instead!
-
-(defn keyword->symbol
-  [k]
-  (symbol (name k)))
+(defn compile-eval-expr
+  "Compile the expression in optimal code"
+  [tree symbol-env]
+  (walk/postwalk
+    (fn [node]
+      (cond
+        (keyword? node) `(~node ~symbol-env)
+        (vector? node) `(~(first node) ~@(rest node))
+        :else node))
+    tree))

 (defprotocol IEvalExpr
   (eval-expr [this] "Evaluate the expression"))

 (defmacro def-data-flow
   [name tree]
-  (let [deps (sort (map keyword->symbol (collect-dependencies tree)))]
+  (let [deps (sort (map keyword->symbol (collect-dependencies tree)))
+        this (gensym "this")]
     `(defrecord ~name ~(vec deps)
        IEvalExpr
-       (eval-expr [this#] (eval-expr-in-env ~tree this#))
+       ;; (eval-expr [~this] (eval-expr-in-env ~tree ~this))
+       (eval-expr [~this] ~(compile-eval-expr tree this))
        )))

 (def-data-flow Expr [+ :a [* :b :c]])


(MAINT) Add JARS_NO_REQUIRE=true to gem subcommand (for the Nteenth time)

When the `gem` subcommand fixes were reverted in b2f83a77, the behavior
of excluding the Bouncy Castle jars from the JRuby library loading
process was lost in the shuffle.

This is a problem because acceptance tests are failing, particularly the
`puppetserver gem cleanup` command which errors out as follows:

    [root@u4e4c61i909s8tj ~]# puppetserver gem cleanup
    ERROR:  Loading command: cleanup (RuntimeError)
            you might need to reinstall the gem which depends on the missing jar
    no such file to load -- org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47 (LoadError)
    ERROR:  While executing gem ... (NoMethodError)
        undefined method `invoke_with_build_args' for nil:NilClass

This patch addresses the problem by re-introducing the JARS_NO_REQUIRE
behavior into master as part of the merge-up from stable.

--- src/clj/puppetlabs/puppetserver/cli/gem.clj
+++ src/clj/puppetlabs/puppetserver/cli/gem.clj
@@ -6,8 +6,10 @@
   [config args]
   (doto (ScriptingContainer.)
     (.setArgv (into-array String args))
-    (.setEnvironment (hash-map "GEM_HOME"
-                               (get-in config [:jruby-puppet :gem-home])))
+    (.setEnvironment
+      (hash-map
+        "GEM_HOME" (get-in config [:jruby-puppet :gem-home])
+        "JARS_NO_REQUIRE" "true"))
     (.runScriptlet "load 'META-INF/jruby.home/bin/gem'")))

 (defn -main


Move rendering to client

Move rendering to client

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -26,18 +26,10 @@
   [query-params builder]
   (apply builder (flatten query-params)))

-(defn ^:private render-query-
-  "Renders compiled query"
-  [query-params]
-  (let [renderer (if hayt/*prepared-statement*
-                   hayt/->prepared
-                   hayt/->raw)]
-    (renderer query-params)))
-
 (defn ^:private execute-
   [^Session session query-params builder]
-  (let [rendered-query (render-query- (compile-query- query-params builder))]
-    (cc/execute rendered-query session)
+  (let [compiled-query (compile-query- query-params builder)]
+    (cc/execute session compiled-query)
     ))

 (defn ^:private execute-async-
@@ -161,8 +153,7 @@
   (->> records
        (map (comp (partial apply (partial q/insert-query table)) flatten vector))
        (apply q/queries)
-       q/batch-query
-       render-query-))
+       q/batch-query))

 (defn insert-batch
   "Performs a batch insert (inserts multiple records into a table at the same time).
@@ -181,7 +172,7 @@
 (defn atomic-batch
   "Executes a group of operations as an atomic batch (BEGIN BATCH ... APPLY BATCH)"
   [^Session session & clauses]
-  (let [q (render-query- (compile-query- clauses q/batch-query))]
+  (let [q (compile-query- clauses q/batch-query)]
     (execute- session q)))

 (defn update


Add asserts for auxilitary queries

Add asserts for auxilitary queries

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -268,16 +268,24 @@
 (defn get-one
   "Executes query to get exactly one result. Does not add `limit` clause to the query, this is
    a convenience function only. Please use `limit` clause if you execute queries that potentially
-   return more than a single result."
-  [^Session session & query-params]
-  (first (execute- session query-params q/select-query)))
+   return more than a single result.
+
+   Doesn't work as a prepared query."
+  [^Session session & query-params]
+  (assert (not hayt/*prepared-statement*) "get-one query can't be executed as a prepared query")
+  (first
+   (cc/execute session
+               (compile-query- q/select-query query-params))))

 (defn perform-count
   "Helper function to perform count on a table with given query. Count queries are slow in Cassandra,
    in order to get a rough idea of how many items you have in certain table, use `nodetool cfstats`,
    for more complex cases, you can wither do a full table scan or perform a count with this function,
-   please note that it does not have any performance guarantees and is potentially expensive."
+   please note that it does not have any performance guarantees and is potentially expensive.
+
+   Doesn't work as a prepared query."
   [^Session session table & query-params]
+  (assert (not hayt/*prepared-statement*) "Count query can't be executed as a prepared query")
   (:count
    (first
     (select session table
@@ -292,6 +300,7 @@
 (defn describe-keyspace
   "Returns a keyspace description, taken from `system.schema_keyspaces`."
   [^Session session ks]
+  (assert (not hayt/*prepared-statement*) "Describe Keyspace query can't be executed as a prepared query")
   (first
    (select session :system.schema_keyspaces
            (q/where {:keyspace_name (name ks)}))))
@@ -299,6 +308,7 @@
 (defn describe-table
   "Returns a table description, taken from `system.schema_columnfamilies`."
   [^Session session ks table]
+  (assert (not hayt/*prepared-statement*) "Describe Table query can't be executed as a prepared query")
   (first
    (select session :system.schema_columnfamilies
            (q/where {:keyspace_name (name ks)
@@ -307,6 +317,7 @@
 (defn describe-columns
   "Returns table columns description, taken from `system.schema_columns`."
   [^Session session ks table]
+  (assert (not hayt/*prepared-statement*) "Describe Columns query can't be executed as a prepared query")
   (select session :system.schema_columns
           (q/where {:keyspace_name (name ks)
                     :columnfamily_name (name table)})))


Start implementation of benchmark: create requested number of customers.

--- src/vacation2/main.clj
+++ src/vacation2/main.clj
@@ -14,7 +14,17 @@
   (send logger (fn [_] (apply println args))))

 (def cli-options
-  [["-d" "--debug" "Print debug information"]
+  [["-n" "--customers N" "Number of customers"
+    :default 100
+    :parse-fn #(Integer/parseInt %)]
+   ["-r" "--reservations N" "Number of reservations"
+    ; Corresponds to parameter -t in vacation.
+    :default 1000
+    :parse-fn #(Integer/parseInt %)]
+   ;["-w" "--workers N" "Number of workers"
+   ; :default 20
+   ; :parse-fn #(Integer/parseInt %)]
+   ["-d" "--debug" "Print debug information"]
    ["-h" "--help" "Print help information"]])

 (def usage
@@ -24,6 +34,14 @@
 Options:

 " (:summary (clojure.tools.cli/parse-opts nil cli-options))))
+
+(def customer-behavior
+  (behavior
+    []
+    []
+    (log "start reservation")
+    (dosync
+      (println "TODO"))))

 (defn -main [& args]
   "Main function. `args` should be a list of command line arguments."
@@ -40,5 +58,17 @@
       (def log log-debug))
     (when-not (or print-error? print-help?)
       (log "options: " options)
-      (println "TODO")))
+      (let [reservations-per-customer
+              (quot (:reservations options) (:customers options))
+            customers
+              (for [i (range (:customers options))]
+                (spawn customer-behavior))]
+        (when (not= (rem (:reservations options) (:customers options)) 0)
+          (println "WARNING: number of reservations is not divisible by number"
+            "of customers. Using" reservations-per-customer "reservations per"
+            "customer, so only" (* reservations-per-customer (count customers))
+            "in total."))
+        (doseq [c customers]
+          (dotimes [_i reservations-per-customer]
+            (send c))))))
   (shutdown-agents))


No provides propagation and small fixes

No provides propagation and small fixes

--- src/com/wsscode/pathom/connect/planner.cljc
+++ src/com/wsscode/pathom/connect/planner.cljc
@@ -214,25 +214,6 @@
             (assoc ::root item-node-id)))
       graph)))

-(defn propagate-provides
-  "This function is used to propagate back new provides after extending a node."
-  [graph {::keys [node-id]}]
-  (loop [graph   graph
-         node-id node-id
-         visited #{}]
-    (if (contains? visited node-id)
-      (do
-        ; TODO double check if need this detection here once unreachable is properly implemented
-        (println "Cycle detected" visited node-id)
-        graph)
-      (let [{::keys [after-node provides]} (get-in graph [::nodes node-id])]
-        (if after-node
-          (recur
-            (update-in graph [::nodes after-node ::provides] merge-io (or provides {}))
-            after-node
-            (conj visited node-id))
-          graph)))))
-
 (defn remove-node
   "Remove a node from the graph. In case of resolver nodes it also removes them
   from the ::index-syms."
@@ -264,6 +245,25 @@
   (if run-next
     (assoc-in graph [::nodes node-id ::run-next] run-next)
     (update-in graph [::nodes node-id] dissoc ::run-next)))
+
+(defn propagate-provides
+  "This function is used to propagate back new provides after extending a node."
+  [graph {::keys [node-id]}]
+  graph #_(loop [graph'   graph
+                 node-id' node-id
+                 visited  #{}]
+            (if (contains? visited node-id')
+              (do
+                ; TODO double check if need this detection here once unreachable is properly implemented
+                (println "Cycle detected" visited node-id')
+                graph)
+              (let [{::keys [after-node provides]} (get-in graph' [::nodes node-id'])]
+                (if after-node
+                  (recur
+                    (merge-node-provides graph' after-node {::provides (or provides {})})
+                    after-node
+                    (conj visited node-id'))
+                  graph')))))

 (defn merge-nodes-run-next
   "Updates node-id run-next with the run-next of the last element. This will do an AND
@@ -301,7 +301,7 @@
         (merge-node-input collapse-node-id node)
         (merge-nodes-run-next env collapse-node-id node)
         (remove-node node)
-        (propagate-provides {::node-id collapse-node-id})
+        #_(propagate-provides {::node-id collapse-node-id})
         (transfer-node-source-attrs collapse-node-id node)
         #_
         (simplify-branch env))))
@@ -416,7 +416,8 @@
         (not root-node)
         (set-root-node graph node-id)

-        (= (pc-sym root-node) (pc-sym next-node))
+        (and (pc-sym root-node)
+             (= (pc-sym root-node) (pc-sym next-node)))
         (-> (collapse-nodes-branch graph env (::root graph) node-id)
             (set-root-node node-id))

@@ -541,8 +542,8 @@
                       (assoc graph ::root run-next)
                       env
                       {::node-id (::run-next node)})
-          next-node (or (get-in new-graph [::nodes run-next])
-                        (get-in graph [::nodes run-next]))]
+          next-node (or (get-node new-graph run-next)
+                        (get-node graph run-next))]
       (-> graph
           (assoc
             ::nodes (::nodes new-graph)


Rough draft on json config file done

Rough draft on json config file done

--- src/degasolv/cli.clj
+++ src/degasolv/cli.clj
@@ -490,11 +490,22 @@
    :description "Degasolv: You love me."
    :cli
    [["-c" "--config-file FILE" "Config file location **"
-     :id :config-files
+     :id :edn-config-files
      :default []
      :default-desc "./degasolv.edn"
      :assoc-fn
-     (fn [m k v] (update-in m [k] #(conj % v)))]
+     (fn [m k v] (update-in m [:config-files]
+                            #(conj %1 {:file %2
+                                       :read-fn tag/read-string})))]
+    ["-j" "--json-config FILE" "JSON config file location **"
+     :id :json-config-files
+     :default []
+     :default-desc ""
+     :assoc-fn
+     (fn [m k v] (update-in m [:config-files]
+                            (fn add-cfg [coll v]
+                              (conj coll {:file v
+                                          :read-fn #(json/read-str % :key-fn keyword)}))))]
     ["-k" "--option-pack PACK" "Specify option pack **"
      :id :option-packs
      :default []
@@ -752,31 +763,23 @@
                ""
                ""))

-
-
-
-
-
-
 (defn get-config [configs]
-  (try
-    (reduce
-     merge
-     (map
-      tag/read-string
-      (map
-       default-slurp
-       configs)))
-    (catch Exception e
-      (binding [*out* *err*]
-        (println "Warning: problem reading config files, they were not used:"
-                 (str "\n"
-                      (string/join
-                       \newline
-                       (map #(str "  - " %)
-                            configs)))))
-      (hash-map))))
-
+  (as-> configs it
+        (map default-slurp it)
+        (map (fn [{:keys [file read-fn]}]
+               (read-fn file))
+             it)
+        (reduce merge it)
+        (try it
+          (catch Exception e
+            (binding [*out* *err*]
+              (println "Warning: problem reading config files, they were not used:"
+                       (str "\n"
+                            (string/join
+                              \newline
+                              (map #(str "  - " %)
+                                   configs)))))
+            (hash-map)))))

 (defn -main [& args]
@@ -808,7 +811,8 @@
             (parseplz! subcommand (rest arguments) (get subcommand-cli subcommand))]
         (let [config-files
               (if (empty? (:config-files global-options))
-                [(fs/file (fs/expand-home "./degasolv.edn"))]
+                [{:file (fs/file (fs/expand-home "./degasolv.edn"))
+                  :read-fn tag/read-string}]
                 (:config-files global-options))
               config
               (get-config config-files)


adding html entity encoding to shorthand

--- src/xml_short/core.clj
+++ src/xml_short/core.clj
@@ -1,7 +1,15 @@
-(ns xml-short.core)
+(ns xml-short.core
+  (:require [clojure.string :as s]))

 (defn- name-to-keyword [tag]
   (keyword (str (if (nil? (namespace tag)) "" (str (namespace tag) ":")) (name tag))))
+
+(defn- encode-html-entities [s]
+  (s/escape s {\< "<"
+               \> ">"
+               \& "&"
+               \' "'"
+               \" """}))

 (defn x-pand [body]
   (let [bodynext (if (symbol? body) [body] body)
@@ -11,9 +19,10 @@
         [content attrs] (if (map? attrs)
                           [content (reduce (fn [out [k v]] (assoc out (name-to-keyword k) v)) {} attrs)]
                           [(into [attrs] content) {}])
+        attrs (reduce (fn [out [k v]] (assoc out k (encode-html-entities (str v)))) {} attrs)
         content (if (or (nil? content) (empty? content))
                   content
-                  (mapv #(if (or (vector? %) (symbol? %)) (x-pand %) %) content))]
+                  (mapv #(if (or (vector? %) (symbol? %)) (x-pand %) (encode-html-entities (str %))) content))]
     (reduce (fn [out [k v]] (if (or (empty? v) (nil? v)) out (assoc out k v)))
             {:tag tag}
             {:attrs attrs :content content})))


Mapping from intertype method declarations to the corresponding Soot method.

--- EkekoAspectJ/src/damp/ekeko/aspectj/soot.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/soot.clj
@@ -80,6 +80,7 @@
          (soot/soot-model-scene ?model ?scene)
          (soot/soot-method-signature ?soot ?signature)))

+
 (comment
   (damp.ekeko/ekeko* [?advice ?method] (advice-sootmethod ?advice ?method))


added im command

added im command

--- libs/axiom-cljs/project.clj
+++ libs/axiom-cljs/project.clj
@@ -1,6 +1,7 @@
 (defproject axiom-cljs "MONOLITH-SNAPSHOT"
   :description "A client library for Axiom"
   :url "http://axiom-clj.org"
+  :aliases {"im" ["doo" "phantom" "test" "once"]}
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Expanded page- and post migrations

Expanded page- and post migrations

--- src/portal_clj/models/migration.clj
+++ src/portal_clj/models/migration.clj
@@ -17,23 +17,29 @@
                    active BOOLEAN NOT NULL DEFAULT 1
                  )"]))

+(defn page-migration []
+  (sql/execute! db/spec
+                ["CREATE TABLE IF NOT EXISTS pages (
+                   id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+                   title VARCHAR(255) NOT NULL,
+                   body TEXT,
+                   user_id INT(11) NOT NULL FOREIGN KEY REFERENCES users(id) ON DELETE CASCADE,
+                   created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+                   slug VARCHAR(255) NOT NULL,
+                   active BOOLEAN NOT NULL DEFAULT 1
+                 )"]))
+
 (defn post-migration []
   (sql/execute! db/spec
                 ["CREATE TABLE IF NOT EXISTS posts (
                    id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
                    title VARCHAR(255) NOT NULL,
                    body TEXT,
-                   created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
-                 )"]))
-
-
-(defn page-migration []
-  (sql/execute! db/spec
-                ["CREATE TABLE IF NOT EXISTS pages (
-                   id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
-                   title VARCHAR(255) NOT NULL,
-                   body TEXT,
-                   created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+                   user_id INT(11) NOT NULL FOREIGN KEY REFERENCES users(id) ON DELETE CASCADE,
+                   commentable BOOLEAN NOT NULL DEFAULT 0,
+                   created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+                   slug VARCHAR(255) NOT NULL,
+                   active BOOLEAN NOT NULL DEFAULT 1
                  )"]))

 (defn do-migrate []


remove async-foo

remove async-foo

--- src/thi/ng/fabric/async_foo.cljc
+++ src/thi/ng/fabric/async_foo.cljc
@@ -1,310 +0,0 @@
-(ns thi.ng.fabric.async-foo)
-
-(defn async-vertex-signal
-  [vertex]
-  (let [id   (:id vertex)
-        outs @(:outs vertex)]
-    (go-loop [outs outs]
-      (let [[v [f opts]] (first outs)]
-        (when v
-          (let [signal (f vertex opts)]
-            (if-not (nil? signal)
-              (>! (input-channel v) [id signal])
-              (debug "signal fn for" (:id v) "returned nil, skipping...")))
-          (recur (next outs)))))))
-
-(defn eager-async-vertex-processor
-  [{:keys [id] :as vertex} ctx]
-  (let [{:keys [collect-thresh signal-thresh]} @ctx
-        in (input-channel vertex)]
-    (go-loop []
-      (let [[src-id sig] (<! in)]
-        (if sig
-          (do (debug id "receive from" src-id ":" (pr-str sig))
-              (receive-signal vertex src-id sig)
-              (when (should-collect? vertex collect-thresh)
-                (notify! ctx [:collect id])
-                (collect! vertex)
-                ;;(debug id "post-collection:" (pr-str @vertex))
-                (when (should-signal? vertex signal-thresh)
-                  (notify! ctx [:signal id])
-                  (signal! vertex async-vertex-signal)))
-              (recur))
-          ;;(debug id " stopped")
-          )))
-    vertex))
-
-(def default-async-context-opts
-  {:collect-thresh 0
-   :signal-thresh  0
-   :processor      eager-async-vertex-processor
-   :bus-size       16
-   :timeout        25
-   :max-ops        1e6
-   :threads        #?(:clj (inc (.availableProcessors (Runtime/getRuntime))) :cljs 1)})
-
-(defn stop-async-execution
-  [bus vertices]
-  (warn "stopping execution context...")
-  (run! close-input! vertices)
-  (run! async/close! bus))
-
-(defn async-execution-context
-  [opts]
-  (let [ctx       (merge default-async-context-opts opts)
-        bus       (vec (repeatedly (:bus-size ctx) async/chan))
-        ctx       (assoc ctx :bus bus :result (or (:result ctx) (async/chan)))
-        g         (:graph ctx)
-        processor (:processor ctx)
-        c-thresh  (:collect-thresh ctx)
-        s-thresh  (:signal-thresh ctx)
-        max-ops   (:max-ops ctx)
-        max-t     (:timeout ctx)
-        res-chan  (:result ctx)
-        watch-id  (keyword (gensym))]
-    (reify
-      #?@(:clj
-           [clojure.lang.IDeref
-            (deref [_] ctx)]
-           :cljs
-           [IDeref
-            (-deref [_] ctx)])
-      IGraphExecutor
-      (stop!
-        [_]
-        (stop-async-execution bus (vertices g))
-        (remove-watch! g :add-vertex watch-id)
-        (remove-watch! g :remove-vertex watch-id)
-        (remove-watch! g :add-edge watch-id)
-        res-chan)
-      (notify! [_ evt]
-        (go (>! (rand-nth bus) evt)))
-      (include-vertex!
-        [_ v]
-        (info "including vertex into async context" (:id v) @v)
-        (processor v _)
-        (when (should-signal? v s-thresh)
-          (signal! v async-vertex-signal))
-        #_(when (should-collect? v c-thresh)
-            (collect! v))
-        _)
-      (execute!
-        [_]
-        (let [t0 (now)]
-          (add-watch! g :add-vertex watch-id
-                      (fn [[__ v]]
-                        (info :ctx-add-vertex (:id v) @v)
-                        (processor v _)))
-          (add-watch! g :remove-vertex watch-id
-                      (fn [[__ v]] (signal! v async-vertex-signal)))
-          (add-watch! g :add-edge watch-id
-                      (fn [[__ src dest]]
-                        (info :ctx-add-edge (:id src) (:id dest))
-                        (signal! src async-vertex-signal)))
-          (go
-            (run! #(include-vertex! _ %) (vertices g))
-            (loop [colls 0, sigs 0]
-              (if (<= (+ colls sigs) max-ops)
-                (let [t (if max-t (async/timeout max-t))
-                      [[evt v ex] port] (async/alts! (if max-t (conj bus t) bus))]
-                  (if (= port t)
-                    (if (:auto-stop ctx)
-                      (do (stop! _)
-                          (async-execution-result :converged res-chan colls sigs t0))
-                      (do (async-execution-result :converged res-chan colls sigs t0)
-                          (recur colls sigs)))
-                    (case evt
-                      :collect (recur (inc colls) sigs)
-                      :signal  (recur colls (inc sigs))
-                      :error   (do (warn ex "@ vertex" v)
-                                   (when (:auto-stop ctx) (stop! _))
-                                   (async-execution-result
-                                    :error res-chan colls sigs t0
-                                    {:reason-event     evt
-                                     :reason-exception ex
-                                     :reason-vertex    v}))
-                      (do (warn "execution interrupted")
-                          (async-execution-result
-                           :stopped res-chan colls sigs t0)))))
-                (do (stop! _)
-                    (async-execution-result :max-ops-reached res-chan colls sigs t0)))))
-          res-chan)))))
-
-(defn ^java.util.TimerTask timer-task [^java.util.Timer t f]
-  (proxy [java.util.TimerTask] []
-    (run [] (.cancel t) (f))))
-
-(defn dynamic-timeout
-  [interval]
-  (let [ctrl    (async/chan (async/sliding-buffer 1))
-        out     (async/chan)
-        timer   (volatile! nil)
-        trigger #(go (warn :trigger-timeout) (>! out [:timeout]))]
-    (go-loop []
-      (if (<! ctrl)
-        (do (when @timer (.cancel ^java.util.Timer @timer))
-            (vreset! timer (doto (java.util.Timer.) (.schedule (timer-task trigger) (long interval))))
-            (recur))
-        (do (when @timer (.cancel ^java.util.Timer @timer))
-            #_(async/close! out))))
-    [ctrl out]))
-
-(defn channel-mix
-  [inputs out]
-  (go-loop []
-    (let [[x] (async/alts! inputs)]
-      (warn :mix x)
-      (if x
-        (do (>! out x)
-            (recur))
-        (do (run! async/close! inputs)
-            (async/close! out)
-            (warn :mix-closed)))))
-  out)
-
-(defn eager-async-vertex-processor2
-  [{:keys [id] :as vertex} ctx]
-  (let [{:keys [collect-thresh signal-thresh]} @ctx
-        in (input-channel vertex)]
-    (go-loop []
-      (let [[src-id sig] (<! in)]
-        (if sig
-          (do (debug id "receive from" src-id ":" (pr-str sig))
-              (receive-signal vertex src-id sig)
-              (when (should-collect? vertex collect-thresh)
-                (collect! vertex)
-                (notify! ctx [:collect vertex])
-                (when (should-signal? vertex signal-thresh)
-                  (signal! vertex async-vertex-signal)
-                  (notify! ctx [:signal vertex])))
-              (recur))
-          (warn id " stopped")
-          )))
-    vertex))
-
-(defn async-execution-context2*
-  [opts]
-  (let [ctx       (merge default-async-context-opts opts)
-        ;;bus       (vec (repeatedly (:bus-size ctx) async/chan))
-        ctx       (assoc ctx
-                         ;;:bus bus
-                         :result (or (:result ctx) (async/chan (async/dropping-buffer 1))))
-        g         (:graph ctx)
-        processor eager-async-vertex-processor2 ;; (:processor ctx)
-        c-thresh  (:collect-thresh ctx)
-        s-thresh  (:signal-thresh ctx)
-        max-ops   (:max-ops ctx)
-        res-chan  (:result ctx)
-        watch-id  (keyword (gensym))
-        sigs      (atom 0)
-        colls     (atom 0)
-        active    (atom #{})
-        result?   (atom false)
-        ctrl      (async/chan)]
-    (reify
-      #?@(:clj
-           [clojure.lang.IDeref
-            (deref [_] ctx)]
-           :cljs
-           [IDeref
-            (-deref [_] ctx)])
-      IGraphExecutor
-      (stop!
-        [_]
-        (stop-async-execution nil (vertices g))
-        (async/close! ctrl)
-        (remove-watch! g :add-vertex watch-id)
-        (remove-watch! g :remove-vertex watch-id)
-        (remove-watch! g :add-edge watch-id)
-        res-chan)
-      (notify! [_ [evt v ex]]
-        (warn :notify evt (:id v))
-        (case evt
-          :signal  (do (swap! sigs inc)
-                       (if (should-collect? v c-thresh)
-                         (do
-                           (warn :activate (:id v))
-                           (swap! active conj (:id v)))
-                         (do
-                           (warn :deactivate (:id v))
-                           (swap! active disj (:id v)))))
-          :collect (do (swap! colls inc)
-                       (if (should-signal? v s-thresh)
-                         (do
-                           (warn :activate (:id v))
-                           (swap! active conj (:id v)))
-                         (do
-                           (warn :deactivate (:id v))
-                           (swap! active disj (:id v)))))
-          (warn :unknown-notify evt))
-        (warn :active-count (count @active) :sigs @sigs :colls @colls))
-      (include-vertex!
-        [_ v]
-        (info "including vertex into async context" (:id v) @v)
-        (processor v _)
-        (when (should-signal? v s-thresh)
-          (signal! v async-vertex-signal))
-        _)
-      (execute!
-        [_]
-        (let [t0 (now)]
-          (add-watch!
-           g :add-vertex watch-id
-           (fn [[__ v]]
-             (debug :ctx-add-vertex (:id v) @v)
-             (processor v _)))
-          (add-watch!
-           g :remove-vertex watch-id
-           (fn [[__ v]]
-             (signal! v async-vertex-signal)))
-          (add-watch!
-           g :add-edge watch-id
-           (fn [[__ src dest]]
-             (debug :ctx-add-edge (:id src) (:id dest))
-             (signal! src async-vertex-signal)))
-          (reset! active
-                  (into #{}
-                        (comp
-                         (filter #(or (should-signal? % s-thresh) (should-collect? % c-thresh)))
-                         (map :id))
-                        (vertices g)))
-          (run! #(include-vertex! _ %) (vertices g))
-          res-chan)))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-#_(dotimes [i (:parallel ctx)]
-    (let [mix (channel-mix (conj bus t-out) (async/chan))]
-      (go-loop []
-        (prn :sc @sigs @colls)
-        (if (<= (+ @sigs @colls) max-ops)
-          (let [[evt v ex] (<! mix)]
-            (prn (str "thread " i "event: " evt ": " v))
-            (case evt
-              :timeout (if (:auto-stop ctx)
-                         (when-not @result?
-                           (reset! result? true)
-                           (stop! _)
-                           (async-execution-result :converged res-chan @colls @sigs t0))
-                         (do (>! t-ctrl :reset)
-                             (async-execution-result :converged res-chan @colls @sigs t0)
-                             (recur)))
-              :signal  (do (>! t-ctrl :reset) (swap! sigs inc) (recur))
-              :collect (do (>! t-ctrl :reset) (swap! colls inc) (recur))
-              :error   (do (warn ex "@ vertex" v)
-                           (reset! result? true)
-                           (stop! _)
-                           (async-execution-result
-                            :error res-chan @colls @sigs t0
-                            {:reason-event     evt
-                             :reason-exception ex
-                             :reason-vertex    v}))
-              (when-not @result?
-                (reset! result? true)
-                (warn "execution interrupted")
-                (async-execution-result
-                 :stopped res-chan @colls @sigs t0))))
-          (when-not @result?
-            (reset! result? true)
-            (stop! _)
-            (async-execution-result :max-ops-reached res-chan @colls @sigs t0))))))


fix configuration identifier; check editing

--- ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/configuration_lifecycle_test.clj
+++ ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/configuration_lifecycle_test.clj
@@ -122,6 +122,33 @@
                 (ltu/is-status 200)
                 (ltu/is-id id)))))

+      ;; try editing the configuration
+      (let [old-cfg (-> (session (ring-app))
+                        (header authn-info-header "root ADMIN")
+                        (request abs-uri)
+                        (ltu/body->json)
+                        (ltu/is-status 200)
+                        :response
+                        :body)
+            old-flag (:prsEnable old-cfg)
+            new-cfg (assoc old-cfg :prsEnable (not old-flag))
+            _ (-> (session (ring-app))
+                  (content-type "application/json")
+                  (header authn-info-header "root ADMIN")
+                  (request abs-uri
+                           :request-method :put
+                           :body (json/write-str new-cfg))
+                  (ltu/is-status 200))
+            reread-flag (-> (session (ring-app))
+                            (header authn-info-header "root ADMIN")
+                            (request abs-uri)
+                            (ltu/body->json)
+                            (ltu/is-status 200)
+                            :response
+                            :body
+                            :prsEnable)]
+        (is (not= old-flag reread-flag)))
+
       ;; admin delete succeeds
       (-> (session (ring-app))
           (header authn-info-header "root ADMIN")


Fixed demo source page links to point to master branch now that develop branch is deleted.

--- src/re_demo/utils.cljs
+++ src/re_demo/utils.cljs
@@ -4,7 +4,7 @@
 (defn github-hyperlink
   "given a label and a relative path, return a component which hyperlinks to the GitHub URL in a new tab"
   [label src-path]
-  (let [base-url (str "https://github.com/Day8/re-com/tree/" (if ^boolean js/goog.DEBUG "develop" "master") "/")]
+  (let [base-url (str "https://github.com/Day8/re-com/tree/master/")]
     [hyperlink-href
      :label  label
      ;:style  {:font-size    "13px"}


Make -deref in Reaction a little clearer

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -276,20 +276,19 @@

   IDeref
   (-deref [this]
-    (if-not (or auto-run (some? *ratom-context*))
+    (if (or auto-run (some? *ratom-context*))
+      (do
+        (notify-deref-watcher! this)
+        (if dirty?
+          (run this)
+          state))
       (do
         (when dirty?
           (let [oldstate state]
             (set! state (f))
             (when-not (identical? oldstate state)
               (-notify-watches this oldstate state))))
-        state)
-      (do
-        (when (some? *ratom-context*)
-          (notify-deref-watcher! this))
-        (if dirty?
-          (run this)
-          state))))
+        state)))

   IDisposable
   (dispose! [this]


added link to card for followup investigation of non-protein targets

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/drugbank/drugbank_rules.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/drugbank/drugbank_rules.clj
@@ -71,6 +71,7 @@
     ;; links to a protein bio-entity
     ;; of 12,704 target records, all but 225 have an associated polypeptide record
     ;; we should look into those 225 targets at some point as they are currently excluded
+    ;; There is card for this: https://trello.com/c/JulbRanl
     (_/target_record obo/BFO_0000051 _/polypeptide_record)
     (_/polypeptide_record kiao/hasTemplate iaodrugbank/PolypeptideSchema1)
     (_/polypeptide_record obo/BFO_0000051 _/polypeptide_id_field)


Docstring [ci skip]

Docstring [ci skip]

--- src-cljs/frontend/models/plan.cljs
+++ src-cljs/frontend/models/plan.cljs
@@ -52,7 +52,11 @@
          (get-in plan [:paid :template :free_containers]))
     0))

-(defn trial-containers [plan]
+(defn trial-containers
+  "How many containers are provided by this plan's trial? Note that this finds out how many
+  containers were provided by expired trials, too. You'll need to guard by `in-trial?` if you
+  don't want this behavior."
+  [plan]
   (max 0
        ;; Subtract the amount of paid containers from the number of trial containers,
        ;; so that paid-containers + trial-containers = usable-containers for plans


backport poll fixes.

backport poll fixes.

--- src-cljs/pepa/components/root.cljs
+++ src-cljs/pepa/components/root.cljs
@@ -70,7 +70,10 @@
       (draggable/resize-handle-loop owner)

       ;; Start Polling
-      (api/start-polling! state)))
+      (om/set-state! owner :poll-control (api/start-polling! state))))
+  (will-unmount [_]
+    (println "Stopping polling...")
+    (api/stop-polling! (om/get-state owner :poll-control)))
   (will-update [_ next-props next-state]
     (when-not (= (get-in (om/get-props owner) [:navigation :route])
                  (get-in next-props [:navigation :route]))


Fix history loading.

Fix history loading.

--- src/uxbox/main/data/history.cljs
+++ src/uxbox/main/data/history.cljs
@@ -36,8 +36,8 @@
                       (fetch-pinned-page-history id)))]
     (as-> rs/stream $
       (rx/filter udp/page-persisted? $)
-      (rx/delay 500 $)
-      (rx/map (comp :id :page) $)
+      (rx/debounce 500 $)
+      (rx/map (comp :id :data) $)
       (rx/on-value $ on-value))))

 ;; --- Pinned Page History Fetched


Define square

Define square

--- src/fatlip/plot.cljs
+++ src/fatlip/plot.cljs
@@ -124,6 +124,10 @@
          (map (fn [[node y]]
                 [node (+ y delta)]))
          (into {}))))
+
+
+(defn square [x]
+  (* x x))

 (defn check-alignment
@@ -415,7 +419,7 @@
   the the radius slope, or the slope of the tangent to that radius"
   [radius slope]
   {:pre [(every? number? [radius slope])]}
-  (/ radius (.sqrt js/Math (+ 1 (* slope slope)))))
+  (/ radius (.sqrt js/Math (+ 1 (square slope)))))

 (defn arc-x-distance
@@ -690,13 +694,11 @@
         intersect-y (/ (+ (* src-radius dest-y)
                           (* dest-radius src-y))
                        total-arc-radius)
-        src-radius2 (* src-radius src-radius)
+        src-radius2 (square src-radius)
         src-center-intersect-dx (- intersect-x src-x)
-        src-center-intersect-dx2 (* src-center-intersect-dx
-                                    src-center-intersect-dx)
+        src-center-intersect-dx2 (square src-center-intersect-dx)
         src-center-intersect-dy (- intersect-y src-y)
-        src-center-intersect-dy2 (* src-center-intersect-dy
-                                    src-center-intersect-dy)
+        src-center-intersect-dy2 (square src-center-intersect-dy)
         src-center-intersect-dx2-dy2 (+ src-center-intersect-dx2
                                         src-center-intersect-dy2)
         ;; In the triangle formed by arc center, tangent point, and intersect,


estimation

estimation

--- src/gobanbot/web.clj
+++ src/gobanbot/web.clj
@@ -24,6 +24,7 @@
   (log/debug "send-answer!" chat-id status)
   (when (->> "GOBANBOT_ENV"
              System/getenv
+             (#(or % ""))
              s/lower-case
              (not= "dev"))
     (if (= status :ok)


Docstring formatting

Docstring formatting

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -15,7 +15,7 @@
             [version-clj.core :as semver]))

 (defn dispatch
-  "Common dispatch function for all the API multimethods"
+  "Common dispatch function for all the API multimethods."
   [config & more]
   (v/tag config))


Use Domina's new remove-attr! fn instead of low-level JS calls

--- src/app/cljs/one/repmax/datastore_configuration/view.cljs
+++ src/app/cljs/one/repmax/datastore_configuration/view.cljs
@@ -11,8 +11,7 @@
   (d/set-attr! (d/by-id id) "disabled" "disabled"))

 (defn enable [id]
-  ;; TODO Add a remove-attr! function to Domina
-  (.removeAttribute (.getElementById js/document id) "disabled"))
+  (d/remove-attr! (d/by-id id) "disabled"))

 (defmulti render (fn [{:keys [message]}] (:action message)))


Increase wall width to 1.0

Increase wall width to 1.0

--- src/snergly/image.cljs
+++ src/snergly/image.cljs
@@ -106,7 +106,7 @@
         grid (if *optimize-drawing* grid (assoc grid :changed-cells nil))]
     (aset g "imageSmoothingEnabled" false)
     (aset g "fillStyle" background)
-    (aset g "lineWidth" 0.5)
+    (aset g "lineWidth" 1)
     (when (g/new? grid) (fill-rect g background 0 0 img-width img-height))
     (draw-cells g grid cell-size background wall (remove nil? [dist2 dist1]) path)
     )


(SERVER-1866) Remove timestamp check and reduce sleep

This commit addresses two pieces of feedback from the PR. First, the
timestamp check had the potential to cause this section of code to
indefinitely loop, given the right outside process. Second the sleep
seemed too long for write operations on the cacrl that might hold a lock
on the file.
The first issue is handled by simply removing the modification check,
trusting that if the modification happens after the loop has ended, a
new event will be triggered that will cause the copy to be retried. The
second issue is addressed by reducing the sleep to 100 milliseconds and
to increase the number of attempts to 25.

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -767,8 +767,8 @@
   ([cacrl :- schema/Str
     localcacrl :- schema/Str]
    (when (not= cacrl localcacrl)
-     (let [max-attempts 5]
-       (when (and (fs/exists? cacrl))
+     (let [max-attempts 25]
+       (when (fs/exists? cacrl)
          (ks/mkdirs! (fs/parent localcacrl))
          ;; Make up to 'max-attempts' tries to copy the cacrl file to the
          ;; localcacrl file.  The content of the cacrl file is read into memory
@@ -777,8 +777,7 @@
          ;; validation is done to protect against a partially written (which could
          ;; happen if an asynchronous revocation is in process) or corrupt
          ;; cacrl file being copied.
-         (loop [attempts-left max-attempts
-                ca-crl-last-modified (fs/mod-time cacrl)]
+         (loop [attempts-left max-attempts]
            (let [cacrl-as-string (slurp cacrl)]
              (when-let [write-exception (write-local-cacrl!
                                          localcacrl
@@ -787,12 +786,8 @@
                  (log/error (i18n/trs "Unable to synchronize crl file {0} to {1}: {2}"
                                       cacrl localcacrl (.getMessage write-exception)))
                  (do
-                   (Thread/sleep 1000)
-                   (let [new-ca-crl-last-modified (fs/mod-time cacrl)]
-                     (recur (if (= ca-crl-last-modified new-ca-crl-last-modified)
-                              (dec attempts-left)
-                              max-attempts)
-                            new-ca-crl-last-modified))))))))))))
+                   (Thread/sleep 100)
+                   (recur (dec attempts-left))))))))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Autosign


Started looking at Dice Game.

Started looking at Dice Game.

--- src/clojush/problems/software/benchmarks_v2/dice_game.clj
+++ src/clojush/problems/software/benchmarks_v2/dice_game.clj
@@ -12,17 +12,15 @@

 ; Atom generators
 (def dice-game-atom-generators
-  (concat (list
-            ;;; end constants
-            ;;; end ERCs
-            (tag-instruction-erc [:integer :boolean :exec] 1000)
-            (tagged-instruction-erc 1000)
-            ;;; end tag ERCs
-            'in1
-            'in2
-            ;;; end input instructions
-            )
-          (registered-for-stacks [:integer :boolean :exec :float])))
+  (make-proportional-atom-generators
+   (concat
+    (registered-for-stacks [:integer :boolean :exec :float])
+    (list (tag-instruction-erc [:integer :boolean :exec :float] 1000) ; tags
+          (tagged-instruction-erc 1000)))
+   (list 'in1 'in2) ; inputs
+   (list 0.0 1.0) ; constants
+   {:proportion-inputs 0.15
+    :proportion-constants 0.05}))

 (defn dice-game-input
   []


scraper now removes spoilers from messages

This should greatly reduce the number of crazy vote targets

--- src/mafia_votecount/scraper/team_liquid.clj
+++ src/mafia_votecount/scraper/team_liquid.clj
@@ -60,9 +60,15 @@
          (.contains css-class "quote")
          nil)))

+(defn- has-spoiler? [part]
+  (and (map? (:attrs part))
+       (if-some [id (-> (:attrs part) (:id))]
+         (.contains id "spoiler")
+         nil)))
+
 (defn- remove-quotes [message]
   (remove
-   #(and (map? %) (has-quote? %)) message))
+   #(and (map? %) (or (has-quote? %) (has-spoiler? %))) message))

 (defn- pair-users-messages [users messages]
   (map (fn [user message] {:user user :message (remove-quotes message)})
@@ -89,7 +95,7 @@
    (#(pair-users-messages (extract-users %) (extract-messages %)))))

 (defn- parse-and-wait [content]
-  (do (Thread/sleep 2000)
+  (do (Thread/sleep 1000)
       (get-user-message-pairs content)))

 (defn- get-player-message-maps [path]


remote state

remote state

--- src/terraboot/core.clj
+++ src/terraboot/core.clj
@@ -443,12 +443,12 @@
 (defn remote-state [region bucket profile name]
   (data "terraform_remote_state" name
         {:backend "s3"
-         :config {:bucket bucket
-                  :profile profile
-                  :encrypt true
-                  :key (str name ".tfstate")
-                  :region region
-                  :endpoint (get s3-endpoints region)}}))
+         :config (merge {:bucket bucket
+                         :encrypt true
+                         :key (str name ".tfstate")
+                         :region region
+                         :endpoint (get s3-endpoints region)}
+                        (when profile {:profile profile}))}))

 (defn remote-output-of [module name]
   (str "${" (clojure.string/join "." ["data"  "terraform_remote_state" module name]) "}"))


fixed issues with reagent template and snippet implementations

--- src/kioo/reagent.clj
+++ src/kioo/reagent.clj
@@ -33,10 +33,10 @@
   (snippet* path (list sel trans) args reagent-emit-opts))

 (defmacro template [path args trans]
-  (snippet* path trans args reagent-emit-opts))
+  (snippet* path (list trans) args reagent-emit-opts))

 (defmacro defsnippet [sym path sel args trans]
-  `(def sym ~(snippet* path (list sel trans) args reagent-emit-opts)))
+  `(def ~sym ~(snippet* path (list sel trans) args reagent-emit-opts)))

 (defmacro deftemplate [sym path args trans]
-  `(def sym ~(snippet* path args reagent-emit-opts)))
+  `(def ~sym ~(snippet* path (list trans) args reagent-emit-opts)))


Cosmetic fixes on view ui ns.

Cosmetic fixes on view ui ns.

--- src/uxbox/view/ui.cljs
+++ src/uxbox/view/ui.cljs
@@ -5,15 +5,12 @@
 ;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

 (ns uxbox.view.ui
-  (:require [sablono.core :refer-macros [html]]
-            [goog.dom :as gdom]
-            [lentes.core :as l]
-            [rum.core :as rum]
+  (:require [lentes.core :as l]
             [uxbox.util.i18n :refer (tr)]
             [uxbox.util.rstore :as rs]
             [uxbox.util.router :as rt]
             [uxbox.util.mixins :as mx]
-            [uxbox.util.data :refer (parse-int)]
+            [uxbox.util.dom :as dom]
             [uxbox.main.ui.loader :refer (loader)]
             [uxbox.main.ui.lightbox :refer (lightbox)]
             [uxbox.main.state :as st]
@@ -46,19 +43,14 @@

 ;; --- Main App (Component)

-(defn app-render
-  [own]
+(mx/defc app
+  {:mixins [mx/static mx/reactive]}
+  []
   (let [location (mx/react route-id-ref)]
     (case location
       :view/notfound (notfound-page)
       :view/viewer (viewer-page)
       nil)))
-
-(def app
-  (mx/component
-   {:render app-render
-    :name "app"
-    :mixins [mx/static mx/reactive]}))

 ;; --- Routes

@@ -75,9 +67,6 @@

 (defn init
   []
-  (let [app-dom (gdom/getElement "app")
-        lightbox-dom (gdom/getElement "lightbox")
-        loader-dom (gdom/getElement "loader")]
-    (rum/mount (app) app-dom)
-    (rum/mount (lightbox) lightbox-dom)
-    (rum/mount (loader) loader-dom)))
+  (mx/mount (app) (dom/get-element "app"))
+  (mx/mount (lightbox) (dom/get-element "lightbox"))
+  (mx/mount (loader) (dom/get-element "loader")))


another guard against invalid user

another guard against invalid user

--- src/chat/client/views/message.cljs
+++ src/chat/client/views/message.cljs
@@ -174,7 +174,9 @@
         ((aget PR "prettyPrint"))))
     om/IRender
     (render [_]
-      (let [sender (om/observe owner (helpers/user-cursor (message :user-id)))
+      (let [sender (if-let [cur (helpers/user-cursor (message :user-id))]
+                     (om/observe owner cur)
+                     {:nickname "???"})
             sender-path (routes/user-page-path {:group-id (routes/current-group)
                                                 :user-id (sender :id)})]
         (dom/div #js {:className (str "message"


Remove duplicated code

Remove duplicated code

--- src/clj/lambdacd/steps/support.clj
+++ src/clj/lambdacd/steps/support.clj
@@ -34,10 +34,8 @@
 (defn- do-chain-steps-with-execute-steps [args ctx steps step-result-producer]
   (let [execute-step-result (execute-steps/execute-steps steps args ctx
                                                      :step-result-producer step-result-producer
-                                                     :unify-results-fn unify-results)
-        sorted-step-results (step-results-sorted-by-id (:outputs execute-step-result))
-        merged-step-results (step-results/merge-step-results sorted-step-results merge-step-results-with-joined-output)]
-    (merge merged-step-results execute-step-result)))
+                                                     :unify-results-fn unify-results)]
+    (merge (unify-results (:outputs execute-step-result)) execute-step-result)))

 (defn chain-steps
   ([args ctx & steps]


Fix intermittent issues in AWS node detection on Vagrant

--- src/clj/runbld/hosting/aws_ec2.clj
+++ src/clj/runbld/hosting/aws_ec2.clj
@@ -27,6 +27,7 @@
                  {:socket-timeout 500 :conn-timeout 500}))
       (catch java.net.SocketTimeoutException _)
       (catch org.apache.http.conn.ConnectTimeoutException _)
+      (catch org.apache.http.conn.NoHttpResponseException _)
       (catch java.net.ConnectException _)
       ;; Non-AWS Windows
       (catch java.net.SocketException _)