Add doc url and refactor popover sections; Fix example section

--- src/cljs/cljs_browser_repl/views.cljs
+++ src/cljs/cljs_browser_repl/views.cljs
@@ -171,16 +171,74 @@
   [v-box
    :size "0 0 auto"
    :gap "2px"
-   :children [(for [s signatures]
+   :children [[title
+               :label "Signatures"
+               :level :level4
+               :class "api-panel-popup-section-title"]
+              (for [s signatures]
                 [label
                  :label s
                  :class "api-panel-signature"])]])

+(defn build-symbol-description-ui
+  "Builds the UI for the symbol's description in the popover."
+  [sym desc]
+  [v-box
+   :size "0 0 auto"
+   :gap "4px"
+   :children [[h-box
+               :gap      "4px"
+               :children [[title
+                           :label "Docs"
+                           :level :level4
+                           :class "api-panel-popup-section-title"]
+                          [md-icon-button
+                           :md-icon-name "zmdi-info"
+                           :tooltip "See docs online"
+                           :tooltip-position :right-center
+                           :size :smaller
+                           :style {:justify-content :center}
+                           :on-click #(.open js/window (utils/symbol->clojuredocs-url sym) "_blank")]]]
+              ;; we can use `dangerouslySetInnerHTML` or construct the edn from
+              ;; the html string (using eg. hickory)
+              ;; [:div (map hickory/as-hiccup (hickory/parse-fragment desc))]
+              ;; AR - hickory performs better in flexbox container calculation)
+              [label :label (map hickory/as-hiccup (hickory/parse-fragment desc))]]])
+
+(defn build-related-symbols-ui
+  "Builds the UI for related symbols in the popover."
+  [related]
+  [v-box
+   :size "0 0 auto"
+   :gap "4px"
+   :children [[title
+               :label "Related"
+               :level :level4
+               :class "api-panel-popup-section-title"]
+              [h-box
+               :size "0 0 auto"
+               :gap "4px"
+               :children (for [rel related]
+                           [hyperlink-href
+                            :label (utils/strip-namespace rel)
+                            :href (utils/symbol->clojuredocs-url rel)
+                            :target "_blank"])]]])
+
+(defn build-example-ui
+  "Builds the UI for a single example"
+  [example]
+  [v-box
+   :size "none"
+   :gap "2px"
+   :children [[:pre
+               [:code
+                example]]]])
+
 (defn example-panel
   "Build the example panel, accepts a list of {:html ... :string ...}
   maps."
-  [example-index example-map]
-  {:pre [(:string example-map) (:html example-map)]}
+  [example-index example-string]
+  ;{:pre [(:string example-map) (:html example-map)]}
   [v-box
    :size "none"
    :gap "2px"
@@ -188,35 +246,52 @@
    :children [[h-box
                :size "1 1 auto"
                :gap "2px"
-               :children [[button
-                           :label    [:i.material-icons (str "looks_" (utils/number->word (inc example-index)))]
-                           :disabled? true]
+               :align :center
+               :children [[:i.material-icons (str "looks_" (if (< example-index 2)
+                                                             (utils/number->word (inc example-index)) ; looks_one, looks_two
+                                                             (inc example-index)))] ; looks_3, looks_4, ...
                           ;; <img src="kiwi.svg" alt="Kiwi standing on oval">
+                          [v-box
+                           :size "none"
+                           :width "70%"
+                           :children [(build-example-ui example-string)]]
                           [button
                            :label [:img {:class "api-panel-button-send-repl"
                                          :src "styles/images/cljs.svg"
                                          :alt "Send to the REPL!"}]
                            :tooltip "Load the example in the REPL"
-                           :tooltip-position :above-right
-                           :disabled? (not (app/console-created? :cljs-console))]]]
-              [box
-               :size "none"
-               :width "100%"
-               :child [label :label (map hickory/as-hiccup (hickory/parse-fragment (:html example-map)))]]]])
+                           :tooltip-position :above-left
+                           :disabled? (not (app/console-created? :cljs-console))]]]]])
+
+(defn build-examples-ui
+  "Builds the UI for the symbol's examples."
+  [examples]
+  [v-box
+   :size "0 1 auto"
+   :children [[gap :size "4px"]
+              [title
+               :label "Examples"
+               :level :level4
+               :class "api-panel-popup-section-title"]
+              [v-box
+               :size "0 0 auto"
+               :gap "2px"
+               :children (map-indexed example-panel examples)]]])

 (defn symbol-popover
   "A popover's body in which details of the given symbol will be shown."
   [showing? popover-position sym-doc-map]
   (let [{name :name
+         full-name :full-name
          desc :description-html
          examples-htmls :examples-htmls
          examples-strings :examples-strings
          sign :signature
          related :related} sym-doc-map
-        examples (map (fn [html string] {:html html :string string}) examples-htmls examples-strings)
-        popover-width  400
-        popover-height 400
-        popover-content-width (- popover-width (* 2 14) 15)] ; bootstrap padding + scrollbar width
+         examples (flatten examples-strings)
+         popover-width  400
+         popover-height 400
+         popover-content-width (- popover-width (* 2 14) 15)] ; bootstrap padding + scrollbar width
     [popover-content-wrapper
      :showing? showing?
      :position @popover-position
@@ -239,44 +314,11 @@
                        :children [(when (not-empty sign)
                                     [build-signatures-ui sign])
                                   (when (not-empty desc)
-                                    [v-box
-                                     :size "0 0 auto"
-                                     :gap "4px"
-                                     :children [[label :label (map hickory/as-hiccup (hickory/parse-fragment desc))]]]
-                                    ;; we can use `dangerouslySetInnerHTML` or construct the edn from
-                                    ;; the html string (using eg. hickory)
-                                    ;; [:div (map hickory/as-hiccup (hickory/parse-fragment desc))]
-                                    ;; AR - hickory performs better in flexbox container calculation
-                                    )
+                                    [build-symbol-description-ui full-name desc])
                                   (when (not-empty related)
-                                    [v-box
-                                     :size "0 0 auto"
-                                     :gap "4px"
-                                     :children [[title
-                                                 :label "Related"
-                                                 :level :level4
-                                                 :class "api-panel-popup-section-title"]
-                                                [h-box
-                                                 :size "0 0 auto"
-                                                 :gap "4px"
-                                                 :children (for [rel related]
-                                                             [hyperlink-href
-                                                              :label (utils/strip-namespace rel)
-                                                              :href (utils/symbol->clojuredocs-url rel)
-                                                              :target "_blank"])]]])
+                                    [build-related-symbols-ui related])
                                   (when (not-empty examples)
-                                    [v-box
-                                     :size "0 1 auto"
-                                     :children [[gap :size "4px"]
-                                                [title
-                                                 :label "Examples"
-                                                 :level :level4
-                                                 :class "api-panel-popup-section-title"]
-                                                [h-box
-                                                 :size "0 0 auto"
-                                                 :gap "2px"
-                                                 :children (map-indexed example-panel examples)]]])]]])]]))
-
+                                    [build-examples-ui examples])]]])]]))
 (defn build-symbol-ui
   "Builds the UI for a single symbol. Will be a button."
   [symbol]


work arround REPL bootstrap replacing goog.isProvided_

--- src/cljs/shadow/cljs/live_reload.cljs
+++ src/cljs/shadow/cljs/live_reload.cljs
@@ -19,11 +19,13 @@
       (.debug js/console a1 a2 a3)))
   )

+(def loaded? js/goog.isProvided_)
+
 (defn handle-changes [{:keys [public-path before-load after-load] :as config} {:keys [js] :as changes}]
   (let [js-to-reload (->> js
                           ;; only reload things we actually require'd somewhere
                           (filter (fn [{:keys [provides]}]
-                                    (some #(js/goog.isProvided_ (str %)) provides)))
+                                    (some #(loaded? (str %)) provides)))
                           (into []))]

     (when (seq js-to-reload)


Increment the id of the above card when creating a new card.

--- src/cljs/y_om/components/columns.cljs
+++ src/cljs/y_om/components/columns.cljs
@@ -25,7 +25,7 @@
                   :id)
             id (if (nil? next-id)
                  0
-                 next-id)]
+                 (inc next-id))]
         (om/transact! data :cards #(conj % {:task text :id id}))
         (set! (.-value element) "")
         (om/update! data [:state :add-card?] false)))))


(PDB-4895) Test that we don't rewrite identical catalog inputs

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -765,11 +765,14 @@
   (dotestseq [version catalog-inputs-versions
               :let [version-num (version-kwd->num version)
                     {:keys [certname] :as catalog-inputs} (-> wire-catalog-inputs
-                                                              (get-in [version-num :basic])
-                                                              (assoc :producer_timestamp (now)))
-                    make-cmd-req #(catalog-inputs->command-req version-num catalog-inputs)
-                    make-another-cmd-req #(catalog-inputs->command-req version-num (-> catalog-inputs
-                                                                                (assoc :certname "foo")))]]
+                                                              (get-in [version-num :basic]))
+                    make-cmd-req #(catalog-inputs->command-req
+                                   version-num (assoc catalog-inputs
+                                                      :producer_timestamp (now)))
+                    make-another-cmd-req #(catalog-inputs->command-req
+                                           version-num (-> catalog-inputs
+                                                           (assoc :certname "foo")
+                                                           (assoc :producer_timestamp (now))))]]
     (testing (str (command-names :replace-catalog-inputs) " " version)
       (let [inputs [{:type "hiera" :name "puppetdb::disable_cleartext"}
                     {:type "hiera" :name "puppetdb::disable_ssl"}
@@ -782,6 +785,36 @@
                    (query-to-vec "SELECT type, name FROM catalog_inputs")))
             (is (= 0 (task-count delay-pool)))
             (is (empty? (fs/list-dir (:path dlo))))))
+
+        (testing "unchanged catalog-input sets don't cause postgres churn"
+          (with-message-handler {:keys [handle-message dlo delay-pool q]}
+            (handle-message (queue/store-command q (make-cmd-req)))
+            (is (= inputs (query-to-vec "SELECT type, name FROM catalog_inputs")))
+            (is (= 0 (task-count delay-pool)))
+            (is (= nil (fs/list-dir (:path dlo))))
+
+            (jdbc/do-commands "TRUNCATE catalog_inputs")
+            (is (= [] (query-to-vec "SELECT type, name FROM catalog_inputs")))
+
+            (let [old-metadata (scf-store/catalog-inputs-metadata certname)
+                  modified-inputs (vec (conj (take 2 (sort (:inputs catalog-inputs)))
+                                             ["hiera" "puppetdb::open_listen_port"]))]
+              ;; Resubmitting the same catalog inputs leaves the catalog_inputs table untouched
+              (handle-message (queue/store-command q (make-cmd-req)))
+              (is (= [] (query-to-vec "SELECT type, name FROM catalog_inputs")))
+              (is (not= old-metadata (scf-store/catalog-inputs-metadata certname)))
+
+              ;; Submitting a new catalot inputs set updates the catalog_inputs table
+              (handle-message (queue/store-command
+                               q
+                               (catalog-inputs->command-req version-num
+                                                            (assoc catalog-inputs
+                                                                   :inputs modified-inputs
+                                                                   :producer_timestamp (now)))))
+              (is (= [{:type "hiera" :name "puppetdb::disable_cleartext"}
+                      {:type "hiera" :name "puppetdb::disable_ssl"}
+                      {:type "hiera" :name "puppetdb::open_listen_port"}]
+                  (query-to-vec "SELECT type, name FROM catalog_inputs"))))))

         (testing "submitting multiple catalog inputs processed succesfully"
           (with-message-handler {:keys [handle-message dlo delay-pool q]}


Updated unit tests for ECHOLastUpdate AQL parsing change.

--- test/cmr/search/test/services/aql/conversion.clj
+++ test/cmr/search/test/services/aql/conversion.clj
@@ -112,7 +112,7 @@

 (defn- aql-date-range-elem->condition
   [aql-snippet]
-  (let [aql (format "<ECHOLastUpdate>%s</ECHOLastUpdate>" aql-snippet)
+  (let [aql (format "<ECHOLastUpdate><dateRange>%s</dateRange></ECHOLastUpdate>" aql-snippet)
         xml-struct (x/parse-str aql)]
     (a/element->condition :collection xml-struct)))


Make web start/stop messages clearer.

Make web start/stop messages clearer.

--- modules/web/src/main/clojure/immutant/web.clj
+++ modules/web/src/main/clojure/immutant/web.clj
@@ -39,7 +39,7 @@
 (defn start-handler
   "Typically not called directly; use start instead"
   [sub-context-path handler & {:keys [init destroy] :as opts}]
-  (log/info (format "Starting handler for %s at: %s%s" (util/app-name)
+  (log/info (format "Starting ring handler for %s at: %s%s" (util/app-name)
               (util/app-uri) sub-context-path))
   (start* sub-context-path
           (servlet/create-servlet (add-middleware handler opts))
@@ -72,7 +72,7 @@
   ([]
      (stop "/"))
   ([sub-context-path]
-     (log/info (str "Stopping handler at URL: " (util/app-uri) sub-context-path))
+     (log/info (str "Stopping ring handler/servlet at URL: " (util/app-uri) sub-context-path))
      (stop* sub-context-path)))

 (defn ^HttpServletRequest current-servlet-request


Version 0.6.5

Version 0.6.5

--- metlog-vault/project.clj
+++ metlog-vault/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-vault "0.6.5-SNAPSHOT"
+(defproject metlog-vault "0.6.5"
   :description "Repository for storing and displaying time series data reported by metlog-agent.."

   :license {:name "Eclipse Public License"


(PE-3864) refactor 'allowed-extension?' function

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -596,22 +596,21 @@
        {:type    :duplicate-cert
         :message (str subject " already has a requested certificate; ignoring certificate request")}))))

-(schema/defn disallowed-extension?
+(schema/defn allowed-extension?
   "A predicate that answers if an extension is allowed or not.
   This logic is copied out of the ruby CA."
   [extension :- (schema/pred utils/extension?)]
   (let [oid (:oid extension)]
-    (not
-      (or
-        (utils/subtree-of? Extensions/ppRegCertExt oid)
-        (utils/subtree-of? Extensions/ppPrivCertExt oid)))))
+    (or
+      (utils/subtree-of? Extensions/ppRegCertExt oid)
+      (utils/subtree-of? Extensions/ppPrivCertExt oid))))

 (schema/defn validate-csr-extensions!
   "Throws an error if the CSR contains any invalid extensions, according to
-  `disallowed-extension?`"
+  `allowed-extension?`"
   [csr :- (schema/pred utils/certificate-request?)]
   (let [extensions (utils/get-extensions csr)
-        bad-extensions (filter disallowed-extension? extensions)]
+        bad-extensions (filter (comp not allowed-extension?) extensions)]
     (when-not (empty? bad-extensions)
       (let [bad-extension-oids (map :oid bad-extensions)]
         (sling/throw+ {:type    :disallowed-extension


content assist quick display stops dropping a line

- Fixes Issue 510:	javadoc tooltip skips a line in the shown output

--- ccw.core/src/clj/ccw/util/doc_utils.clj
+++ ccw.core/src/clj/ccw/util/doc_utils.clj
@@ -97,6 +97,6 @@
         nb-display-lines 2
         lines (if (> (count lines) nb-display-lines)
                 (concat (take (dec nb-display-lines) lines)
-                        [(str (nth lines nb-display-lines) " ...")])
+                        [(str (nth lines (dec nb-display-lines)) " ...")])
                 lines)]
     (str/join \newline (map str/trim lines))))


Remove trailing hr from table

Remove trailing hr from table

Fixes #116

--- src/day8/re_frame/trace/panels/traces.cljs
+++ src/day8/re_frame/trace/panels/traces.cljs
@@ -165,15 +165,6 @@
              (when (pos? (count @traces))
                [:span "(" [:button.text-button {:on-click #(do (trace/reset-tracing!) (reset! traces []))} "clear"] ")"])]
             [:th {:style {:text-align "right"}} "meta"]]
-           [:tbody (render-traces visible-traces filter-items filter-input trace-detail-expansions)]
-           [:hr {:style {:unicode-bidi          "isolate"
-                         :-webkit-margin-before "0.5em"
-                         :-webkit-margin-after  "0.5em"
-                         :-webkit-margin-start  "auto"
-                         :-webkit-margin-end   "auto"
-                         :overflow              "hidden"
-                         :border-style          "inset"
-                         :border-width          "1px"     }}]]]
-            ]))))
+           [:tbody (render-traces visible-traces filter-items filter-input trace-detail-expansions)]]]]))))


cleanup

cleanup

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/tweets.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/tweets.cljs
@@ -15,16 +15,6 @@
   (swap! app
          assoc-in [tweets-map (keyword (:id_str tweet))]
          tweet))
-
-(defn add-to-tweets-map2
-  "adds tweet to tweets-map"
-  [app tweets-map tweet]
-  (swap! app
-         assoc-in [tweets-map (keyword (:id_str tweet))]
-         (if (zero? (mod (:id tweet) 1000))
-           tweet
-           {:created_at (:created_at tweet)
-            :id_str (:id_str tweet)})))

 (defn swap-when-larger
   "swaps item in priority-map when new value is larger than old value"
@@ -44,12 +34,6 @@
       (util/swap-pmap app :by-rt-since-startup rt-id (inc (get (:by-rt-since-startup state) rt-id 0)))
       (util/swap-pmap app :by-reach rt-id (+ (get (:by-reach state) rt-id 0) (:followers_count (:user tweet))))
       (when (> rt-count (:retweet_count (rt-id (:tweets-map state)))) (add-to-tweets-map! app :tweets-map rt)))))
-
-(defn ignore-tweet!
-  "only increment counter, otherwise ignore tweet"
-  [tweet app]
-  (let [state @app]
-    (swap! app assoc :count (inc (:count state)))))

 (defn add-tweet!
   "increment counter, add tweet to tweets map and to sorted sets by id and by followers"
@@ -71,7 +55,6 @@

 (go-loop [] (let [t (<! c/prev-tweets-chan)]
               (add-tweet! t state/app)
-;              (ignore-tweet! t state/app)
               (recur)))

 (go-loop []
@@ -81,7 +64,6 @@

 (go-loop []
          (let [chunk (<! c/prev-chunks-chan)]
-           (doseq [t chunk]
-             (put! c/prev-tweets-chan t))
+           (doseq [t chunk] (put! c/prev-tweets-chan t))
            (<! (timeout 50))
            (recur)))


another quickfix

another quickfix

--- src/ontrail/races.clj
+++ src/ontrail/races.clj
@@ -1,4 +1,5 @@
 (ns ontrail.races
+  (:use [ontrail mongodb])
   (:require
    [monger.collection :as mc]
    [monger.query :as mq]
@@ -11,7 +12,7 @@
   (let [with-parsed-date (-> params
                              (select-keys [:title :date :filter])
                              (assoc :jodaDate (parser/parse-date (:date params))))]
-    (-> (mc/insert-and-return races-coll with-parsed-date)
+    (-> (mc/insert-and-return *db* RACES with-parsed-date)
         (dissoc :_id))))

 (defn find-all []


fix google icon

fix google icon


Use partial instead of a gratuitous lambda.

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -29,7 +29,7 @@
       [a])))

 (def melody
-  (let [repeats #(mapcat (partial apply repeat) %)
+  (let [repeats (partial mapcat (partial apply repeat))
         runs (partial mapcat run)
         call
           {:length (repeats [[2 1/4] [1 1/2] [14 1/4] [1 3/2]])


(MAINT) Add private/public comment headers


Meaningful error message returned to user

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/proxy_redirect.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/proxy_redirect.clj
@@ -10,7 +10,9 @@
     [ring.middleware.cookies :refer [wrap-cookies]]
     [clj-time.core :refer [in-seconds]]
     [clj-time.format :refer [formatters unparse with-locale]]
-    [com.sixsq.slipstream.ssclj.middleware.base-uri :as buri])
+    [com.sixsq.slipstream.ssclj.middleware.base-uri :as buri]
+    [ring.util.response :as r]
+    [clj-stacktrace.repl :as st])
   (:import
     [java.io ByteArrayInputStream]
     [java.io InputStream]
@@ -126,11 +128,27 @@

     (update-location-header response (buri/construct-base-uri request "/"))))

+(defn- error-message
+  [exception]
+  (str  "Error when contacting upstream server. SlipStream server may be stopped. Please contact administrator.\n"
+        "Detailed error message:\n"
+        (.getMessage exception)))
+
+(defn- error-response
+  [exception]
+  (-> exception
+      error-message
+      r/response
+      (r/status 500)))
+
 (defn wrap-proxy-redirect
   [handler except-uris host]
   (fn [request]
     (let [request-uri (:uri request)]
       (if (uri-starts-with? request-uri except-uris)
         (handler request)
-        (redirect host request-uri request)))))
-
+        (try
+          (redirect host request-uri request)
+          (catch Exception e
+            (log/error (st/pst-str e))
+            (error-response e)))))))


Satisfy eastwood a bit more

Satisfy eastwood a bit more

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -89,18 +89,18 @@
    (let [ptexts [(.getBytes "four score and ")
                  (.getBytes "seven years ago")]]
      (repeated-keystream? ptexts scheme)))
-  ([ptexts scheme]
+  ([[p1 p2 :as ptexts] scheme]
    (let [shortest (apply min (map alength ptexts))
          just-ctext (fn [^bytes ptext]
                       (->> (scheme ptext)
                            (drop (+ s/noncebytes s/macbytes))
                            (take shortest)
                            byte-array))
-         ctexts (map just-ctext ptexts)
+         [c1 c2] (map just-ctext ptexts)
          xord-ptexts (byte-array shortest)
          xord-ctexts (byte-array shortest)]
-     (apply #'ms/xor! xord-ptexts ptexts)
-     (apply #'ms/xor! xord-ctexts ctexts)
+     (#'ms/xor! xord-ptexts p1 p2)
+     (#'ms/xor! xord-ctexts c1 c2)
      (bb/bytes= xord-ptexts xord-ctexts))))

 (deftest secretbox-pfx-test


Fix ns.

Fix ns.

--- test/onyx/messaging/messaging_gen_test.clj
+++ test/onyx/messaging/messaging_gen_test.clj
@@ -1,5 +1,5 @@
 (ns onyx.messaging.messaging-gen-test
-  (:require [onyx.messaging.aeron :as aeron :refer [aeron]]
+  (:require [onyx.messaging.aeron :as aeron :refer [aeron-messenger]]
             [onyx.messaging.protocol-aeron :as protocol-aeron]
             [clojure.set :refer [intersection]]
             [clojure.test.check :as tc]
@@ -116,8 +116,8 @@
       (with-redefs [aeron/handle-sent-message (handle-sent-message received)
                     aeron/handle-aux-message (handle-aux-message received)]
         (let [server-port 53001
-              recv-messenger (component/start (aeron peer-group))
-              send-messenger (component/start (aeron peer-group))]
+              recv-messenger (component/start (aeron-messenger peer-group))
+              send-messenger (component/start (aeron-messenger peer-group))]

           (try
             (let [_ (ext/register-acker recv-messenger {:onyx.messaging/bind-addr "127.0.0.1"


GAWB-2173: Show request access modal when clicking on greyed out workspaces (#836)

* show request access modal when clicking on grey workspaces

* cleanup, get rid of unnecessary components

--- src/cljs/main/broadfcui/page/workspaces_list.cljs
+++ src/cljs/main/broadfcui/page/workspaces_list.cljs
@@ -28,29 +28,6 @@

 (def non-dbGap-disabled-text "Click to request access.")

-(react/defc StatusCell
-  {:render
-   (fn [{:keys [props]}]
-     (let [{:keys [data]} props
-           {:keys [status no-access? hover-text workspace-id]} data]
-       [:a {:href (if no-access?
-                    "javascript:;"
-                    (nav/get-link :workspace-summary workspace-id))
-            :style {:display "block" :position "relative"
-                    :backgroundColor (if no-access?
-                                       (:disabled-state style/colors)
-                                       (style/color-for-status status))
-                    :cursor (when no-access? "default")
-                    :margin "2px 0 2px 2px" :height (- row-height-px 4)}
-            :title hover-text}
-        [:span {:style {:position "absolute" :top 0 :right 0 :bottom 0 :left 0
-                        :backgroundColor "rgba(0,0,0,0.2)"}}]
-        (style/center {}
-          (case status
-            "Complete" [icons/CompleteIcon]
-            "Running" [icons/RunningIcon]
-            "Exception" [icons/ExceptionIcon]))]))})
-
 (react/defc RequestAuthDomainAccessDialog
   {:get-initial-state
    (fn [{:keys [props state]}]
@@ -70,7 +47,7 @@
         (let [{:keys [my-auth-domains ws-instructions error]} @state]
           (cond
             (not (or (and my-auth-domains ws-instructions) error))
-            [comps/Spinner {:text "Loading authorization domains..."}]
+            [comps/Spinner {:text "Loading Authorization Domains..."}]
             error
             (case (:code error)
               (:unknown :parse-error)
@@ -158,40 +135,6 @@
                   (swap! state update-in [:ws-auth-domains group-index :data]
                          assoc :requesting? false :requested? true))}))})

-(react/defc WorkspaceCell
-  {:render
-   (fn [{:keys [props]}]
-     (let [{:keys [data]} props
-           {:keys [status restricted? no-access? hover-text workspace-id]} data
-           {:keys [namespace name]} workspace-id
-           color (style/color-for-status status)]
-       [:a {:href (if no-access?
-                    "javascript:;"
-                    (nav/get-link :workspace-summary workspace-id))
-            :style {:display "flex" :alignItems "center"
-                    :backgroundColor (if no-access? (:disabled-state style/colors) color)
-                    :cursor (when no-access? "default")
-                    :color "white" :textDecoration "none"
-                    :height (- row-height-px 4)
-                    :margin "2px 0"}
-            :title hover-text}
-        (when restricted?
-          [:span {:style {:display "block" :position "relative"}}
-           [:span {:style {:display "block" :position "absolute" :left -17 :top -9
-                           :width (- row-height-px 4) :padding "4px 0"
-                           :backgroundColor "white" :color "#666" :fontSize "xx-small"
-                           :transform "rotate(-90deg)"}}
-            "RESTRICTED"]])
-        [:div {:style {:paddingLeft 24}}
-         [:div {:style {:fontSize "80%"}} namespace]
-         [:div {:style {:fontWeight 600}} name]]]))
-   :-show-request-access-modal
-   (fn [{:keys [props]}]
-     (modal/push-modal
-      [RequestAuthDomainAccessDialog
-       {:workspace-id (get-in props [:data :workspace-id])
-        :ws-auth-domains (get-in props [:data :auth-domains])}]))})
-
 (defn- get-workspace-name-string [column-data]
   (str (get-in column-data [:workspace-id :namespace]) "/" (get-in column-data [:workspace-id :name])))

@@ -239,6 +182,12 @@
        (apply clojure.set/union)))

+(defn- push-request-access-modal [workspace-id auth-domains]
+  (modal/push-modal
+   [RequestAuthDomainAccessDialog
+    {:workspace-id workspace-id
+     :ws-auth-domains auth-domains}]))
+
 (react/defc WorkspaceTable
   {:get-initial-state
    (fn []
@@ -256,8 +205,7 @@
             :total-count (count (:workspaces props))))
    :render
    (fn [{:keys [props state this locals]}]
-     (let [{:keys [nav-context]} props
-           {:keys [filters-expanded?]} @state]
+     (let [{:keys [filters-expanded?]} @state]
        [Table
         {:persistence-key "workspace-table" :v 2
          :data (this :-filter-workspaces) :total-count (:total-count @locals)
@@ -266,7 +214,7 @@
           (let [column-data (fn [ws]
                               (let [no-access? (= (:accessLevel ws) "NO ACCESS")
                                     tcga? (and no-access? (= (get-in ws [:workspace :authorizationDomain :membersGroupName])
-                                                                 config/tcga-authorization-domain))]
+                                                             config/tcga-authorization-domain))]
                                 {:workspace-id (select-keys (:workspace ws) [:namespace :name])
                                  :status (:status ws)
                                  ;; this will very soon return multiple auth domains, so im future-proofing it now
@@ -283,12 +231,12 @@
             [{:id "Status" :header [:span {:style {:marginLeft 7}} "Status"]
               :sortable? false :resizable? false :filterable? false :initial-width row-height-px
               :column-data column-data :as-text :status
-              :render (fn [data] [StatusCell (utils/restructure data nav-context)])}
+              :render #(this :-render-status-cell %)}
              {:id "Workspace" :header [:span {:style {:marginLeft 24}} "Workspace"]
               :initial-width 300
               :column-data column-data :as-text get-workspace-name-string
               :sort-by #(mapv clojure.string/lower-case (replace (:workspace-id %) [:namespace :name]))
-              :render (fn [data] [WorkspaceCell (utils/restructure data nav-context)])}
+              :render #(this :-render-workspace-cell %)}
              {:id "Description" :header [:span {:style {:marginLeft 14}} "Description"]
               :initial-width 350
               :column-data get-workspace-description
@@ -308,16 +256,12 @@
               :initial-width 132 :resizable? false
               :column-data column-data
               :sort-by (zipmap access-levels (range)) :sort-initial :asc
-              :render (fn [data]
-                        (let [access-level (:access-level data)]
-                          [:div {:style {:paddingLeft 14}}
-                           (if (= access-level "NO ACCESS")
-                             (style/create-link {:text (prettify access-level)
-                                                 :onClick #(modal/push-modal
-                                                            [RequestAuthDomainAccessDialog
-                                                             {:workspace-id (:workspace-id data)
-                                                              :ws-auth-domains (:auth-domains data)}])})
-                             (prettify access-level))]))}])
+              :render (fn [{:keys [access-level workspace-id auth-domains]}]
+                        [:div {:style {:paddingLeft 14}}
+                         (if (= access-level "NO ACCESS")
+                           (style/create-link {:text (prettify access-level)
+                                               :onClick #(push-request-access-modal workspace-id auth-domains)})
+                           (prettify access-level))])}])
           :behavior {:reorderable-columns? false}
           :style {:header-row {:color (:text-lighter style/colors) :fontSize "90%"}
                   :header-cell {:padding "0.4rem 0"}
@@ -338,12 +282,55 @@
                                                 :onClick #(swap! state update :filters-expanded? not)})]
                            [:div {:style {:clear "both"}}]
                            (when filters-expanded?
-                             (this :-side-filters))]}
+                             (this :-render-side-filters))]}
          :paginator {:style {:clear "both"}}}]))
    :component-did-update
    (fn [{:keys [state]}]
      (persistence/save {:key persistence-key :state state}))
-   :-side-filters
+   :-render-status-cell
+   (fn [_ {:keys [status no-access? hover-text workspace-id auth-domains]}]
+     [:a {:href (if no-access?
+                  "javascript:;"
+                  (nav/get-link :workspace-summary workspace-id))
+          :onClick (if no-access? #(push-request-access-modal workspace-id auth-domains))
+          :style {:display "block" :position "relative"
+                  :backgroundColor (if no-access?
+                                     (:disabled-state style/colors)
+                                     (style/color-for-status status))
+                  :margin "2px 0 2px 2px" :height (- row-height-px 4)}
+          :title hover-text}
+      [:span {:style {:position "absolute" :top 0 :right 0 :bottom 0 :left 0
+                      :backgroundColor "rgba(0,0,0,0.2)"}}]
+      (style/center {}
+                    (case status
+                      "Complete" [icons/CompleteIcon]
+                      "Running" [icons/RunningIcon]
+                      "Exception" [icons/ExceptionIcon]))])
+   :-render-workspace-cell
+   (fn [_ {:keys [status restricted? no-access? hover-text workspace-id auth-domains]}]
+     (let [{:keys [namespace name]} workspace-id
+           color (style/color-for-status status)]
+       [:a {:href (if no-access?
+                    "javascript:;"
+                    (nav/get-link :workspace-summary workspace-id))
+            :onClick (if no-access? #(push-request-access-modal workspace-id auth-domains))
+            :style {:display "flex" :alignItems "center"
+                    :backgroundColor (if no-access? (:disabled-state style/colors) color)
+                    :color "white" :textDecoration "none"
+                    :height (- row-height-px 4)
+                    :margin "2px 0"}
+            :title hover-text}
+        (when restricted?
+          [:span {:style {:display "block" :position "relative"}}
+           [:span {:style {:display "block" :position "absolute" :left -17 :top -9
+                           :width (- row-height-px 4) :padding "4px 0"
+                           :backgroundColor "white" :color "#666" :fontSize "xx-small"
+                           :transform "rotate(-90deg)"}}
+            "RESTRICTED"]])
+        [:div {:style {:paddingLeft 24}}
+         [:div {:style {:fontSize "80%"}} namespace]
+         [:div {:style {:fontWeight 600}} name]]]))
+   :-render-side-filters
    (fn [{:keys [state refs locals]}]
      (let [{:keys [filters]} @state]
        (apply


Remove resize listener properly.

Remove resize listener properly.

--- src/cljs/wombats_web_client/panels/game-play.cljs
+++ src/cljs/wombats_web_client/panels/game-play.cljs
@@ -14,6 +14,31 @@
 (defonce canvas-id "arena-canvas")

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Lifecycle Methods
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn- component-did-mount [cmpnt-state]
+  ;; Add resize listener
+  (.addEventListener js/window
+                     "resize"
+                     (:resize-fn @cmpnt-state))
+  (resize-canvas))
+
+(defn- component-will-mount [game-id]
+  (ws/send-message :join-game {:game-id game-id}))
+
+(defn- component-will-unmount [game-id cmpnt-state]
+  (re-frame/dispatch [:game/update-frame nil])
+  (re-frame/dispatch [:game/clear-chat-messages])
+  (ws/send-message :leave-game {:game-id game-id})
+  (re-frame/dispatch [:set-modal nil])
+
+  ;; Remove resize listener
+  (.removeEventListener js/window
+                        "resize"
+                        (:resize-fn @cmpnt-state)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Helper Methods
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@@ -25,23 +50,10 @@
     (set! (.-width canvas-element) half-width)
     (set! (.-height canvas-element) half-width)))

-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Lifecycle Methods
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn- component-did-mount []
-  ;; Add resize listener
-  (.addEventListener js/window "resize" #(resize-canvas) true)
-  (resize-canvas))
-
-(defn- component-will-mount [game-id]
-  (ws/send-message :join-game {:game-id game-id}))
-
-(defn- component-will-unmount [game-id]
-  (re-frame/dispatch [:game/update-frame nil])
-  (re-frame/dispatch [:game/clear-chat-messages])
-  (ws/send-message :leave-game {:game-id game-id})
-  (re-frame/dispatch [:set-modal nil]))
+(defn- show-winner-modal
+  [winner]
+  (re-frame/dispatch [:set-modal {:fn #(winner-modal winner)
+                                  :show-overlay? false}]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Render Methods
@@ -89,11 +101,6 @@
   [:div.chat-title
    [:span "CHAT"]])

-(defn- show-winner-modal
-  [winner]
-  (re-frame/dispatch [:set-modal {:fn #(winner-modal winner)
-                                  :show-overlay? false}]))
-
 (defn- right-game-play-panel
   [game messages user game-id]

@@ -125,14 +132,15 @@

 (defn game-play [{:keys [game-id]}]
   (let [arena (re-frame/subscribe [:game/arena])
+        cmpnt-state (reagent/atom {:resize-fn #(resize-canvas)})
         messages (re-frame/subscribe [:game/messages])
         user (re-frame/subscribe [:current-user])
         games (re-frame/subscribe [:games])]

     (reagent/create-class
-     {:component-did-mount #(component-did-mount)
+     {:component-did-mount #(component-did-mount cmpnt-state)
       :component-will-mount #(component-will-mount game-id)
-      :component-will-unmount #(component-will-unmount game-id)
+      :component-will-unmount #(component-will-unmount game-id cmpnt-state)
       :display-name "game-play-panel"
       :reagent-render
       (fn []


deploy automation

deploy automation

--- build/leiningen/circleci.clj
+++ build/leiningen/circleci.clj
@@ -6,4 +6,5 @@
 (defn circleci [project & args]
   (let [branch (System/getenv "CIRCLE_BRANCH")]
     (condp re-find branch
-      #"master" (deploy/deploy project "clojars"))))+      #"master" (deploy/deploy project "clojars")
+      nil)))


Sanitize HTML before sticking it into innerHTML

--- src-cljs/frontend/components/documentation.cljs
+++ src-cljs/frontend/components/documentation.cljs
@@ -11,6 +11,8 @@
             [frontend.utils.docs :as doc-utils]
             [goog.dom]
             [goog.string :as gstring]
+            [goog.string.html :as ghtml]
+            goog.string.html.htmlSanitize
             [goog.string.format])
   (:require-macros [frontend.utils :refer [defrender html]]
                    [cljs.core.async.macros :as am :refer [go go-loop alt!]])
@@ -99,7 +101,7 @@
                   (for [result query-results]
                     [:li
                      [:a {:href (:url result)} (:title result)]
-                     [:p {:dangerouslySetInnerHTML {:__html  (:snippet_text result)}}]
+                     [:p {:dangerouslySetInnerHTML {:__html  (ghtml/htmlSanitize (:snippet_text result))}}]
                      ])]]
                 query
                 [:p "No articles found matching \"" [:strong query] "\""]


Update markdown

Update markdown

--- src-cljs/frontend/components/pieces/button.cljs
+++ src-cljs/frontend/components/pieces/button.cljs
@@ -88,8 +88,7 @@

 (dc/do
   (defcard buttons
-    "These are our buttons in their normal, `:full` size (the default) and in
-    `:medium` size to be used in table rows and anywhere vertical space is at a premium."
+    "These are our buttons in their normal, `:full` size (the default) and in `:medium` size to be used in table rows and anywhere vertical space is at a premium."

     (html
      [:div {:style {:display "flex"}}
@@ -155,19 +154,11 @@
                 "Flat Medium")]]]))

   (defcard link-buttons
-    "These are our link buttons, when you need to style a link as a button.
-    There are `:medium` size link buttons to be used in table rows and
-    anywhere vertical space is at a premium.

A link-button's label,
-    like an ordinary button's, should be an action—that is, an imperative
-    verb. Like a normal button, clicking it initiates that action. Clicking
-    a link-button in particular \"initiates\" the action by navigating to a
-    place in the app where the user can continue the action. For instance,
-    \"Add Projects\" is a link, because it navigates to the Add Projects page,
-    but it is a link-button in particular because it takes the user there to
-    perform the \"Add Projects\" action.

Viewing more information is
-    not an action. \"Build #5\" would not be an appropriate label for a
-    link-button; neither would \"View Build #5\". Instead, \"Build #5\"
-    should be a normal link."
+    "These are our link buttons, when you need to style a link as a button. There are `:medium` size link buttons to be used in table rows and anywhere vertical space is at a premium.
+
+    A link-button's label, like an ordinary button's, should be an action—that is, an imperative verb. Like a normal button, clicking it initiates that action. Clicking a link-button in particular \"initiates\" the action by navigating to a place in the app where the user can continue the action. For instance, \"Add Projects\" is a link, because it navigates to the Add Projects page, but it is a link-button in particular because it takes the user there to perform the \"Add Projects\" action.
+
+    Viewing more information is not an action. \"Build #5\" would not be an appropriate label for a link-button; neither would \"View Build #5\". Instead, \"Build #5\" should be a normal link."

     (html
      [:div {:style {:display "flex"}}


Simplify screen code

Simplify screen code

--- dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
+++ dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
@@ -96,9 +96,6 @@
 (defscreen npc-health-screen
   :on-show
   (fn [screen entities]
-    (update! screen
-             :renderer (-> main-screen :screen deref :renderer)
-             :camera (-> main-screen :screen deref :camera))
     (shape :filled))
   :on-render
   (fn [screen entities]
@@ -116,7 +113,7 @@
                     :set-color (color :green)
                     :rect bar-x bar-y (* bar-w pct) u/npc-bar-h)
              vector
-             (draw! screen))))))
+             (draw! (-> main-screen :screen deref)))))))

 (defscreen overlay-screen
   :on-show


refactor: rm Arrow

refactor: rm Arrow

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -7,24 +7,6 @@
 (defonce DOMElement (.. famous -domRenderables -DOMElement))
 (defonce FamousEngine (.. famous -core -FamousEngine))
 (defonce GestureHandler (.. famous -components -GestureHandler))
-
-(defn Arrow [node options]
-  (let [direction (:direction options)
-        arrow-direction (if (= direction 1)
-                          ">"
-                          "<")
-        el (.. (DOMElement. node)
-               (setProperty "color" "white")
-               (setContent arrow-direction)
-               (setProperty "fontSize" "40px")
-               (setProperty "lineHeight" "40px")
-               (setProperty "cursor" "pointer")
-               (setProperty "textHighlight" "none")
-               (setProperty "zIndex" "2"))]
-    {:node      node
-     :el        el
-     :direction direction}))
-

 (defn decorate-arrow-node [arrow-node text]
   (.. (DOMElement. arrow-node)


All works?

All works?

--- src/angelic/search/implicit/fah_astar_eval2.clj
+++ src/angelic/search/implicit/fah_astar_eval2.clj
@@ -261,7 +261,7 @@
                                     (output-set      [s] out-set)
                                     (tree-summarizer [s] @ts-atom)
                                     (terminal?       [s] terminal?)
-                                    (refine-input    [s ni]
+                                    (refine-input    [s ni] ;; Note ni may have different context.
                                       (if (= ni (input-set stub)) stub (ri-fn s ni))))]
     (reset! ts-atom (make-tree-summarizer ret init-bound))
     (when subsuming-sp (summaries/connect! @ts-atom (tree-summarizer subsuming-sp) true))
@@ -280,6 +280,12 @@
               (simple-stub [:OS (stub-name inner-stub) in-set] in-set)])]
     (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-output-collecting-subproblem ret %)))
     ret))
+
+
+(defn =-state-sets [s1 s2]
+  (util/assert-is (= (state/current-context s1)
+                     (state/current-context s2)) "%s" [s1 s2])
+  (= s1 s2))

 ;; TODO: check out set equality issues...
 ;; TODO: remove extra layers here ?  Don't actually seem to help.
@@ -293,12 +299,10 @@
                                     (terminal?       [s] false)
                                     (refine-input    [s ni] (refine-input inner-sp ni)))
         child-watch (fn child-watch [o]
-                      (if (= (output-set inner-sp) (output-set o))
+                      (if (=-state-sets (output-set inner-sp) (output-set o))
                         (do (connect-and-watch! ret o child-watch)
                             (summaries/summary-changed! ret))
-                        (do (util/assert-is (= (first (stub-name (stub o))) :OS))
-                            (util/assert-is (= (state/current-context (output-set inner-sp))
-                                               (state/current-context (output-set o))) "%s" [stb inner-sp])
+                        (do (util/assert-is (#{:OS :SA} (first (stub-name (stub o)))))
                             (add-sp-child! ret o))))]
     (connect-and-watch! ret inner-sp child-watch)
     ret))
@@ -309,8 +313,8 @@
     (make-output-collecting-stub stub)
     stub))

-;; TODO: unwrap
-
+;; TODO: can we safely unwrap?
+;; Does not work --
 (defn get-base-stub [stub]
   (if (= :SA (first (stub-name stub)))
     (get-base-stub (get-inner-sp (tree-summarizer stub)))
@@ -320,15 +324,12 @@
 ;; (or takes input-set as arg, e.g.)
 (declare make-state-abstracted-subproblem)
 (defn make-state-abstracted-stub [inner-stub in-set]
-;  (println "MSAS" inner-stub in-set)
-  (if false #_(= in-set (input-set inner-stub)) ;; TODO
-    inner-stub
-    (let [inner-stub (get-base-stub inner-stub)
-          ret (traits/reify-traits
-               [simple-cached-node simple-watched or-summarizable
-                (simple-stub [:SA (stub-name inner-stub) in-set] in-set)])]
-      (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-state-abstracted-subproblem ret %)))
-      ret)))
+ ; (println "MSAS" inner-stub in-set)
+  (let [ret (traits/reify-traits
+             [simple-cached-node simple-watched or-summarizable
+              (simple-stub [:SA (stub-name inner-stub) in-set] in-set)])]
+    (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-state-abstracted-subproblem ret %)))
+    ret))

 ;; Note: subsumed subproblems can have different irrelevant vars
 (defn make-state-abstracted-subproblem [stb inner-sp]
@@ -341,15 +342,16 @@
                                     (output-set      [s] out)
                                     (tree-summarizer [s] ts)
                                     (terminal?       [s] (terminal? inner-sp))
-                                    (refine-input    [s ni] (if (= ni in) stb (refine-input inner-sp ni))))]
+                                    (refine-input    [s ni] (if (=-state-sets ni in) stb (refine-input inner-sp ni))))]
     (connect-and-watch! ret inner-sp
-      (fn [o]
-        (assert (= (first (stub-name (stub o))) :OS))
-        (connect-and-watch! ret (make-state-abstracted-stub (stub o) in) #(add-sp-child! ret %))))
+      (fn [o] (connect-and-watch! ret (make-state-abstracted-stub (stub o) in) #(add-sp-child! ret %))))

     ret))

+;; TODO: getting multi-levels of wrapping...
+;; Must state abstract when
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;     Subproblem Types and Stubs     ;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -358,7 +360,6 @@

 (declare make-fs-seq-stub get-atomic-stub)

-;; TODO: getting multi-levels of wrapping...

 (defn- make-atomic-subproblem [stub function-set subsuming-sp out-set reward status]
   (let [inp-set  (input-set stub)
@@ -418,22 +419,18 @@
     (connect-subsuming! ret subsuming-sp)
     (output-wrap ret)))

+;; Note: we must always wrap in S-A stub to get effects out of logger.
 ;; TODO: do something more with subsuming?
 (defn- get-atomic-stub [subsuming-sp inp-set function-set]
   (let [full-name [:Atomic (fs/fs-name function-set)
                    (if *state-abstraction* (fs/extract-context function-set inp-set) inp-set)]
         name [:Atomic (fs/fs-name function-set)]]
     (if-let [^HashMap dc *decompose-cache*]
-      (if-let [cache-val (.get dc full-name)]
-        (if *state-abstraction*
-          (make-state-abstracted-stub cache-val inp-set)
-          cache-val)
-        (let [in (if *state-abstraction* (fs/get-logger function-set inp-set) inp-set)
-              stub (make-atomic-stub name subsuming-sp in function-set)]
-          (.put dc full-name stub)
-          (if *state-abstraction*
-          (make-state-abstracted-stub stub inp-set) ;; TODO: needed?
-          stub)))
+      (if *state-abstraction*
+        (let [logged-inp (fs/get-logger function-set inp-set)
+              stub (util/cache-with dc full-name (make-atomic-stub name subsuming-sp logged-inp function-set))]
+          (make-state-abstracted-stub stub inp-set))
+        (util/cache-with dc full-name (make-atomic-stub name subsuming-sp inp-set function-set)))
      (make-atomic-stub name subsuming-sp inp-set function-set))))


Remove trials.created_at from dispatch order

--- src/cider_ci/dispatcher/dispatch/next_trial.clj
+++ src/cider_ci/dispatcher/dispatch/next_trial.clj
@@ -98,8 +98,6 @@
       (sql-order-by [:jobs.priority :desc]
                     [:jobs.created_at :asc]
                     [:tasks.priority :desc]
-                    [:tasks.created_at :asc]
-                    [:trials.created_at :asc]
                     [:tasks.name :asc])))

 ;##############################################################################


Add `iterate-example`

Add `iterate-example`

--- test/com/nomistech/clojure_the_language/c_270_interview_type_code/s_010_reduce_example_test.clj
+++ test/com/nomistech/clojure_the_language/c_270_interview_type_code/s_010_reduce_example_test.clj
@@ -38,3 +38,33 @@
                   :total-age 0
                   :hair-colours {}}
                  people))))
+
+(defn ^:private allocate-item [{:keys [outstanding-items
+                                       people-cycle
+                                       allocated-items]
+                                :as _allocation-info}]
+  (assert (seq outstanding-items))
+  (let [[item & other-items]    outstanding-items
+        [person & other-people] people-cycle]
+    {:people-cycle      other-people
+     :outstanding-items other-items
+     :allocated-items   (update allocated-items
+                                (:name person)
+                                (fnil conj [])
+                                item)}))
+
+(deftest iterate-example
+  (is (= {"Alice" [0 4 8]
+          "Bob"   [1 5 9]
+          "Cath"  [2 6]
+          "Dean"  [3 7]}
+         (let [items                   (range 10)
+               initial-allocation-info {:people-cycle      (cycle people)
+                                        :outstanding-items items
+                                        :allocated-items   {}}
+               final-allocation-info   (->> initial-allocation-info
+                                            (iterate allocate-item)
+                                            (filter #(empty?
+                                                      (:outstanding-items %)))
+                                            first)]
+           (:allocated-items final-allocation-info)))))


Unnecessary renaming

Unnecessary renaming

--- src/playmary/one.cljs
+++ src/playmary/one.cljs
@@ -176,7 +176,7 @@
         (.scrollTo js/window 0 0) ;; Safari leaves window part scrolled down after turn
         (assoc (assoc instrument :h h) :w w))))

-(defn create-input-channel
+(defn create-touch-input-channel
   [canvas-id]
   (async/merge [(util/listen (dom/getElement canvas-id) :touchstart)
                 (util/listen (dom/getElement canvas-id) :touchend)]))
@@ -184,7 +184,7 @@
 (let [canvas-id "canvas"
       c-instrument (chan)
       c-orientation-change (util/listen js/window :orientation-change)
-      c-touch (create-input-channel canvas-id)]
+      c-touch (create-touch-input-channel canvas-id)]

   (go
    (let [draw-ctx (util/get-ctx canvas-id)]


Add unified *options* map for printer.

Add unified *options* map for printer.

--- src/puget/printer.clj
+++ src/puget/printer.clj
@@ -11,6 +11,22 @@

 ;; CONTROL VARS

+; TODO: the dynamism here is probably overkill and makes var resolution much
+; more expensive. The control functions below use alter-var-root anyway, so
+; it's probably better to make these normal vars. Potentially, overrides can
+; be supported better through an 'opts' map passed to the printer functions.
+
+(def ^:dynamic *options*
+  "Printer control options.
+
+  TODO: document individual options."
+  {:map-delimiter ""
+   :color-scheme {}
+   :print-color false
+   :print-meta nil    ; default to clojure.core/*print-meta* ?
+   :strict false})
+
+
 (def ^:dynamic *strict-mode*
   "If true, throw an exception if there is no canonical EDN representation for
   a given value. This generally applies to any non-primitive value which does
@@ -78,8 +94,8 @@
   "Constructs a text doc, which may be colored if *colored-output* is true.
   Element must be a key from the color-scheme map."
   [element text]
-  (let [codes (seq (*color-scheme* element))]
-    (if (and *colored-output* codes)
+  (let [codes (-> *options* :color-scheme (get element) seq)]
+    (if (and (:print-color *options*) codes)
       [:span [:pass (ansi/esc codes)] text [:pass (ansi/escape :none)]]
       text)))

@@ -90,8 +106,8 @@
   Puget, but which is not directly printed by the library. Note that this
   function still obeys the *colored-output* var."
   [element text]
-  (let [codes (seq (*color-scheme* element))]
-    (if (and *colored-output* codes)
+  (let [codes (-> *options* :color-scheme (get element) seq)]
+    (if (and (:print-color *options*) codes)
       (str (ansi/esc codes) text (ansi/escape :none))
       text)))

@@ -176,7 +192,7 @@
                      (map canonize-kv))]
     [:group
      (color-doc :delimiter "{")
-     [:align (interpose [:span *map-delimiter* :line] entries)]
+     [:align (interpose [:span (:map-delimiter *options*) :line] entries)]
      (color-doc :delimiter "}")]))


review test

review test

--- test/cljs_workcalendar/spider/consultantru_test.clj
+++ test/cljs_workcalendar/spider/consultantru_test.clj
@@ -6,130 +6,89 @@
   (:require [cljs-workcalendar.spider.workcalendarsource :as source])
   (:require [clojure.test :refer :all]))

-(deftest calendar-2015-special-day-count
-  (is (= 14 (count (filter #(= 2015 (:year %))
-                           (source/get-work-calendar (ConsultantRuWorkCalendarSource.)))))))
+(defn- special-days-for-year [year]
+  (let [all-items (source/get-work-calendar (ConsultantRuWorkCalendarSource.))]
+    (sort-by (fn [x] (+ (* 31 (get x 0))
+                        (get x 1)))
+             (map #(vector (:month %)
+                           (:day %)
+                           (:type %))
+                  (filter #(= (:year %) year) all-items)))))

 (deftest calendar-2015
-  (let [items (source/get-work-calendar (ConsultantRuWorkCalendarSource.))]
-    (are [m d type]
-      (= 1
-         (count (filter #(and
-                          (= (:year %) 2015)
-                          (= (:month %) m)
-                          (= (:day %) d)
-                          (= (:type %) type)
-                          )
-                        items)))
-      1 1  :holiday
-      1 2  :holiday
-      1 5  :holiday
-      1 6  :holiday
-      1 7  :holiday
-      1 8  :holiday
-      1 9  :holiday
-      2 23 :holiday
-      3 9  :holiday
-      5 1  :holiday
-      5 4  :holiday
-      5 11 :holiday
-      6 12 :holiday
-      11 4 :holiday)))
-
-(deftest calendar-2014-special-day-count
-  (is (= 14 (count (filter #(= 2014 (:year %))
-                           (source/get-work-calendar (ConsultantRuWorkCalendarSource.)))))))
+  (is (= [[1 1  :holiday]
+          [1 2  :holiday]
+          [1 5  :holiday]
+          [1 6  :holiday]
+          [1 7  :holiday]
+          [1 8  :holiday]
+          [1 9  :holiday]
+          [2 23 :holiday]
+          [3 9  :holiday]
+          [5 1  :holiday]
+          [5 4  :holiday]
+          [5 11 :holiday]
+          [6 12 :holiday]
+          [11 4 :holiday]]
+         (special-days-for-year 2015))))

 (deftest calendar-2014
-  (let [items (source/get-work-calendar (ConsultantRuWorkCalendarSource.))]
-    (are [m d type]
-      (= 1
-         (count (filter #(and
-                          (= (:year %) 2014)
-                          (= (:month %) m)
-                          (= (:day %) d)
-                          (= (:type %) type)
-                          )
-                        items)))
-      1 1  :holiday
-      1 2  :holiday
-      1 3  :holiday
-      1 6  :holiday
-      1 7  :holiday
-      1 8  :holiday
-      3 10  :holiday
-      5 1  :holiday
-      5 2  :holiday
-      5 9  :holiday
-      6 12  :holiday
-      6 13  :holiday
-      11 3  :holiday
-      11 4  :holiday)))
-
-(deftest calendar-2013-special-day-count
-  (is (= 14 (count (filter #(= 2013 (:year %))
-                           (source/get-work-calendar (ConsultantRuWorkCalendarSource.)))))))
+  (is (=[ [1 1  :holiday]
+          [1 2  :holiday]
+          [1 3  :holiday]
+          [1 6  :holiday]
+          [1 7  :holiday]
+          [1 8  :holiday]
+          [3 10 :holiday]
+          [5 1  :holiday]
+          [5 2  :holiday]
+          [5 9  :holiday]
+          [6 12 :holiday]
+          [6 13 :holiday]
+          [11 3 :holiday]
+          [11 4 :holiday]]
+        (special-days-for-year 2014))))

 (deftest calendar-2013
-  (let [items (source/get-work-calendar (ConsultantRuWorkCalendarSource.))]
-    (are [m d type]
-      (= 1
-         (count (filter #(and
-                          (= (:year %) 2013)
-                          (= (:month %) m)
-                          (= (:day %) d)
-                          (= (:type %) type)
-                          )
-                        items)))
-      1 1  :holiday
-      1 2  :holiday
-      1 3  :holiday
-      1 4  :holiday
-      1 7  :holiday
-      1 8  :holiday
-      3 8  :holiday
-      5 1  :holiday
-      5 2  :holiday
-      5 3  :holiday
-      5 9  :holiday
-      5 10  :holiday
-      6 12  :holiday
-      11 4  :holiday)))
-
-(deftest calendar-2012-special-day-count
-  (is (= 24 (count (filter #(= 2012 (:year %))
-                           (source/get-work-calendar (ConsultantRuWorkCalendarSource.)))))))
+  (is (=[[1 1  :holiday]
+         [1 2  :holiday]
+         [1 3  :holiday]
+         [1 4  :holiday]
+         [1 7  :holiday]
+         [1 8  :holiday]
+         [3 8  :holiday]
+         [5 1  :holiday]
+         [5 2  :holiday]
+         [5 3  :holiday]
+         [5 9  :holiday]
+         [5 10  :holiday]
+         [6 12  :holiday]
+         [11 4  :holiday]]
+        (special-days-for-year 2013))))

 (deftest calendar-2012
-  (let [items (source/get-work-calendar (ConsultantRuWorkCalendarSource.))]
-    (are [m d type]
-      (= 1
-         (count (filter #(and
-                          (= (:year %) 2012)
-                          (= (:month %) m)
-                          (= (:day %) d)
-                          (= (:type %) type)
-                          )
-                        items)))
-      1 2   :holiday
-      1 3   :holiday
-      1 4   :holiday
-      1 5   :holiday
-      1 6   :holiday
-      2 23  :holiday
-      3 8   :holiday
-      3 9   :holiday
-      3 11  :workday
-      4 28  :workday
-      4 30  :holiday
-      5 1   :holiday
-      5 7   :holiday
-      5 8   :holiday
-      5 9   :holiday
-      5 12  :workday
-      6 9   :workday
-      6 11  :holiday
-      6 12  :holiday
-      11 5  :holiday
-      12 29 :workday
-      12 31 :holiday)))
+  (is (= [[1 2   :holiday]
+          [1 3   :holiday]
+          [1 4   :holiday]
+          [1 5   :holiday]
+          [1 6   :holiday]
+          [1 9   :holiday]
+          [2 23  :holiday]
+          [3 8   :holiday]
+          [3 9   :holiday]
+          [3 11  :workday]
+          [4 28  :workday]
+          [4 30  :holiday]
+          [5 1   :holiday]
+          [5 5   :workday]
+          [5 7   :holiday]
+          [5 8   :holiday]
+          [5 9   :holiday]
+          [5 12  :workday]
+          [6 9   :workday]
+          [6 11  :holiday]
+          [6 12  :holiday]
+          [11 5  :holiday]
+          [12 29 :workday]
+          [12 31 :holiday]]
+         (special-days-for-year 2012))))


Fix test

Fix test

--- test/clojure/clojurewerkz/cassaforte/query_test.clj
+++ test/clojure/clojurewerkz/cassaforte/query_test.clj
@@ -589,9 +589,9 @@
          (normalize-string
           (alter-keyspace "new_cql_keyspace"
                           (with {:durable-writes false
-                                 :replication    {"class" "NetworkTopologyStrategy"
-                                                  "dc1"   1
-                                                  "dc2"   2}})))))
+                                 :replication    (array-map "class" "NetworkTopologyStrategy"
+                                                            "dc1"   1
+                                                            "dc2"   2)})))))

   (is (= "ALTER KEYSPACE foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"


Move some stuff and tidy.

Move some stuff and tidy.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -242,55 +242,54 @@
 (fact (== 2 2N 2M 2.0M 2.0) => true) ; true even for inexact things

 ;;;; ___________________________________________________________________________
-;;;; ---- Going from Longs to bigger or smaller ----
+;;;; ---- Going from Longs to BigInts and vice versa, or not ----

 (def max-long-plus-1 9223372036854775808N)

-(fact "The 'ordinary' operators"
+(fact "About the 'ordinary' arithmetic operators"
   (fact "Throw exceptions on overflow"
-    (inc Long/MAX_VALUE) => (throws ArithmeticException "integer overflow"))
+    (inc Long/MAX_VALUE)
+    => (throws ArithmeticException "integer overflow"))
   (fact "We can avoid overflow exceptions by coercing to BigInt first"
-    (inc (bigint Long/MAX_VALUE)) => max-long-plus-1))
-
-(fact "The xxxx' operators"
+    (inc (bigint Long/MAX_VALUE))
+    => max-long-plus-1)
+  (fact "Do not demote from BigInt"
+    (type (- max-long-plus-1 Long/MAX_VALUE))
+    => clojure.lang.BigInt)
+  (fact "When the ratio of two BigInts is an integer, the result is a BigInt"
+    (type (/ 4N 2N))
+    => clojure.lang.BigInt)
+  (fact "When the ratio of two BigInts is not an integer, the result is a Ratio"
+    (/ 3N 2N) => 3/2
+    (let [v (+' Long/MAX_VALUE 2)]
+      (type v)        => clojure.lang.BigInt
+      (type (/ v 2))) => clojure.lang.Ratio))
+
+(fact "About the xxxx' operators"
   (fact "Auto-promote"
-    (inc' Long/MAX_VALUE) => max-long-plus-1)
+    (inc' Long/MAX_VALUE)
+    => max-long-plus-1)
   (fact "Do not promote if unnecessary"
-    (type (inc' 1)) => Long)
+    (type (inc' 1))
+    => Long)
   (fact "Do not demote"
     (type (dec' (inc' Long/MAX_VALUE)))
     => clojure.lang.BigInt))

 (def boxed-max-long Long/MAX_VALUE)

-(fact "The unchecked-xxxx operators"
+(fact "About the unchecked-xxxx operators"
   (fact "Don't check for overflow"
-    (unchecked-inc Long/MAX_VALUE) => Long/MIN_VALUE)
+    (unchecked-inc Long/MAX_VALUE)
+    => Long/MIN_VALUE)
   (fact "Only do what you expect on longs, not Longs"
     ;; The doc strings for unchecked operations only define what happens
     ;; for (unboxed) longs, not for (boxed) Longs.
     ;; - See https://groups.google.com/d/msg/clojure/1tefVmYKmpc/2hKlXU-c13sJ
     (fact "With a boxed value it seems weird"
-      (unchecked-inc boxed-max-long) => (throws ArithmeticException
-                                                "integer overflow"))
+      (unchecked-inc boxed-max-long)
+      => (throws ArithmeticException "integer overflow"))
     (fact "But with an unboxed value it's as you'd expect"
       (let [unboxed-max-long Long/MAX_VALUE]
         (unchecked-inc unboxed-max-long))
       => Long/MIN_VALUE)))
-
-;;;; ___________________________________________________________________________
-;;;; ---- Going from BigInts to other things ----
-
-(fact "Does not demote from BigInt"
-  (type (- max-long-plus-1 Long/MAX_VALUE))
-  => clojure.lang.BigInt)
-
-(fact "When the ratio of two BigInts is an integer, the result is a BigInt"
-  (type (/ 4N 2N))
-  => clojure.lang.BigInt)
-
-(fact "When the ratio of two BigInts is not an integer, the result is a Ratio"
-  (/ 3N 2N) => 3/2
-  (let [v (+' Long/MAX_VALUE 2)]
-    (type v)        => clojure.lang.BigInt
-    (type (/ v 2))) => clojure.lang.Ratio)


Fixnums.

Fixnums.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -20,6 +20,13 @@
 ;;;; ---- `identical?` ----
 ;;;; Tests whether two arguments are the same object.

+;;; /Clojure Programming/ p433 says:
+;;;     In general, numbers will never be identical?, even if provided as
+;;;     literals.
+
+;;; Here are my first thoughts (partly inspired by my understanding of Common
+;;; Lisp):
+
 (fact (identical? 2 2)       => true)  ; Of course
 (fact (identical? 2N 2N)     => false) ; Possibly surprising
 (fact (identical? 2/3 2/3)   => false) ; Possibly surprising
@@ -33,6 +40,17 @@
 (fact (identical? 2 2M)      => false) ; Not surprising
 (fact (identical? 2 2.0M)    => false) ; Not surprising
 (fact (identical? 2.0 2.0)   => false) ; Not surprising
+
+;;; But then I found this:
+(fact (identical?  127  127) => true)
+(fact (identical?  128  128) => false)
+(fact (identical? -128 -128) => true)
+(fact (identical? -129 -129) => false)
+;;; /Clojure Programming/ p433 says:
+;;;     The exception is that the JVM (and therefore Clojure) provides for a
+;;;     limited range of fixnums. Fixnums are a pool of boxed integer values
+;;;     that are always used in preference to allocating a new integer. [...]
+;;;     The Oracle JVM’s fixnum range is ±127.

 ;;;; ---------------------------------------------------------------------------
 ;;;; ---- `=` ----
@@ -103,17 +121,6 @@
 ;; Maybe mention java.math.BigInteger

 ;;;; ___________________________________________________________________________
-;;;; ---- Large values ----
-
-;;; Interesting:
-;;;   I got into this when playing with Long/MAX_VALUE.
-;;;     (fact (identical? Long/MAX_VALUE Long/MAX_VALUE) => false)
-;;;   Is this a Java thing?
-(fact (identical? 128 128) => false)  ; **** Huh?
-(fact (= 128 128) => true)            ;      So 8 bits?
-(fact (identical? 127 127) => true)   ;      Hmmmm.
-
-;;;; ___________________________________________________________________________
 ;;;; ---- =-and-same-type ----

 (defn =-and-same-type


Updated to deal with intermittent issues loading Clojure pre-1.4.0.
Caused by metrics-clojure having a hard dependency range.

Issue raised and resolved on the lein-ring project:
https://github.com/weavejester/lein-ring/issues/54

Huge thanks to @weavejester (lein-ring) for his help sorting this out!

--- 2-collectors/clojure-collector/project.clj
+++ 2-collectors/clojure-collector/project.clj
@@ -18,12 +18,12 @@
   :dependencies     [[org.clojure/clojure "1.4.0"]
                      [ring/ring-core "1.1.6"]
                      [compojure "1.1.3"]
-                     [metrics-clojure "0.9.1"]
+                     [metrics-clojure "0.9.1" :exclusions [org.clojure/clojure]]
                      [metrics-clojure-ring "0.9.1"]
                      [commons-codec/commons-codec "1.7"]]
   ;; The jetty adapter is only used during development
-  :dev-dependencies [[ring/ring-devel "1.1.6"]
-                     [ring/ring-jetty-adapter "1.1.6"]]
+  :profiles         {:dev {:dependencies [[ring/ring-devel "1.1.6"]
+                                          [ring/ring-jetty-adapter "1.1.6"]]}}
   :plugins          [[lein-ring "0.7.5"]
                      [lein-beanstalk "0.2.6"]]
   :ring {:handler snowplow.clojure-collector.beanstalk/app}) ; .beanstalk -> .core if you don't need Beanstalk support


[#2254] Refactor

[#2254] Refactor

--- backend/test/akvo/lumen/lib/transformation_test.clj
+++ backend/test/akvo/lumen/lib/transformation_test.clj
@@ -116,6 +116,15 @@
     (conform ::transformation.engine.s/op-spec (assoc s :op op-name :args args))

     (tu/clj>json>clj (assoc s :op op-name :args args))))
+
+(def change-datatype-tx (fn [column-name & [new-type]]
+   {:type :transformation
+    :transformation
+    (-> (gen-transformation
+         "core/change-datatype" {::db.dataset-version.column.s/columnName column-name
+                                 ::transformation.change-datatype.s/newType (or new-type "number")
+                                 ::transformation.engine.s/onError "default-value"})
+        (assoc-in ["args" "defaultValue"] nil))}))

 (deftest ^:functional test-transformations
   (testing "Transformation application"
@@ -313,19 +322,11 @@
       )))

 (deftest ^:functional derived-column-test
-  (let [change-datatype-transformation (fn [column-name]
-                                         {:type :transformation
-                                          :transformation
-                                          (-> (gen-transformation
-                                               "core/change-datatype" {::db.dataset-version.column.s/columnName "column-name"
-                                                                      ::transformation.change-datatype.s/newType "number"
-                                                                      ::transformation.engine.s/onError "default-value"})
-                                              (assoc-in ["args" "defaultValue"] nil))})
-        dataset-id (import-file *tenant-conn* *error-tracker* {:has-column-headers? true
+  (let [dataset-id (import-file *tenant-conn* *error-tracker* {:has-column-headers? true
                                                                :file "derived-column.csv"})
         apply-transformation (partial async-tx-apply {:tenant-conn *tenant-conn*} dataset-id)]
-    (do (apply-transformation (change-datatype-transformation "c2"))
-        (apply-transformation (change-datatype-transformation "c3")))
+    (do (apply-transformation (change-datatype-tx "c2"))
+        (apply-transformation (change-datatype-tx "c3")))

     (testing "Import and initial transforms"
       (is (= (latest-data dataset-id)


removed unused dep

removed unused dep

--- src/main/shadow/cljs/devtools/server/worker.clj
+++ src/main/shadow/cljs/devtools/server/worker.clj
@@ -7,7 +7,6 @@
             [shadow.cljs.devtools.server.system-msg :as sys-msg]
             [shadow.cljs.devtools.server.worker.impl :as impl]
             [shadow.cljs.devtools.server.util :as util]
-            [shadow.cljs.devtools.server.web.common :as common]
             [shadow.build.classpath :as cp]
             [shadow.build.npm :as npm]
             [shadow.cljs.devtools.server.fs-watch :as fs-watch]


Explicitly disallow non realtime mode - patches (with associated working examples) accepted to fix this...

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -241,11 +241,13 @@
 (defn- scsynth-arglist
   "Returns a sequence of args suitable for use as arguments to the scsynth command"
   [args]
+  (when (not= 1 (:realtime? args))
+    (throw (Exception. "Non-realtime server mode not currently supported. Patches accepted - please contact the mailing list.")))
   (let [udp?             (:udp? args)
         port             (:port args)
         ugens-paths      (or (:ugens-paths args) [])
         args             (select-keys args (keys SC-ARG-INFO))
-        args             (dissoc args :udp? :port)
+        args             (dissoc args :udp? :port :realtime? :nrt-cmd-filename :nrt-output-filename :nrt-output-header-format :nrt-output-sample-format)
         port-arg         (if (= 1 udp?)
                            ["-u" port]
                            ["-t" port])


add a blurb

add a blurb

--- src/pc/views/blog/private_docs_early_access.clj
+++ src/pc/views/blog/private_docs_early_access.clj
@@ -4,7 +4,7 @@

 (defn private-docs-early-access []
   {:title "Private docs early access."
-   :blurb ""
+   :blurb "How to access and use our new privacy settings"
    :author "Danny"
    :body
    (list


AB & RS | 127 | Update description of activity to use the content key as defined in w3 activity streams vocabulary - fix functional tests

--- test/objective8/functional/functional_tests.clj
+++ test/objective8/functional/functional_tests.clj
@@ -143,7 +143,7 @@
             (throw e)))
         => (every-checker
              (contains "[{\"@context\":\"http://www.w3.org/ns/activitystreams\",\"@type\":\"Create\"")
-             (contains "\"displayName\":\"Functional test headline\",\"description\":\"Functional test description with lots of hipster-ipsum:")))
+             (contains "\"displayName\":\"Functional test headline\",\"content\":\"Functional test description with lots of hipster-ipsum:")))

   (fact "Can star an objective"
         (try (wd/to (:objective-url @journey-state))


Drop pod spec in watch-state-details output (#1319)

We only need enough information in this endpoint so see if Waiter knows
about a particular pod, not the full definition of that pod. If we need
the full pod spec, we should go query that directly from Kubernetes.

--- waiter/src/waiter/scheduler/kubernetes.clj
+++ waiter/src/waiter/scheduler/kubernetes.clj
@@ -869,9 +869,13 @@
                        (dissoc :service-id->health-check-context)))
       (or (contains? include-flags "watch-state")
           (contains? include-flags "watch-state-details"))
-      (assoc :watch-state (cond-> @watch-state
-                            (not (contains? include-flags "watch-state-details"))
-                            (dissoc :service-id->pod-id->pod :service-id->service)))))
+      (assoc :watch-state (if (contains? include-flags "watch-state-details")
+                            (update @watch-state :service-id->pod-id->pod
+                                    (fn [service-id->pod-id->pod]
+                                      (pc/map-vals (fn [pod-id->pod]
+                                                     (pc/map-vals #(dissoc % :spec) pod-id->pod))
+                                                   service-id->pod-id->pod)))
+                            (dissoc @watch-state :service-id->pod-id->pod :service-id->service)))))

   (validate-service [this service-id]
     (let [{:strs [run-as-user]} (retrieve-service-description this service-id)]


Prevent keys starting with numbers

Prevent keys starting with numbers

--- src/sparql_to_graphviz/graphviz.clj
+++ src/sparql_to_graphviz/graphviz.clj
@@ -22,7 +22,7 @@
   {:point-size 14})

 (def ^:private to-key
-  (comp keyword util/sha1))
+  (comp keyword (partial str "k") util/sha1))

 (defn- property-selector
   [property-class]


Match settings to normal usage.

Match settings to normal usage.

--- test/monocle/test/rabbitmq.clj
+++ test/monocle/test/rabbitmq.clj
@@ -8,11 +8,11 @@

 (def ssluri "amqps://localhost")

-(def exch "test.exchange")
+(def exch "test.direct")

 (def queue "test.foo")

-(def _key "foo")
+(def _key "test.foo")

 (defmacro with-test-rabbit [[ch cfg] & body]
   `(with-rabbit [~ch ~cfg]


compiler hack for function invoke

compiler hack for function invoke

apparently missed keyword? when I wrote the patch that added this change. I think I finally reached my threshold and will reimplement the entire parse-invoke and emit. too much work done in emit should be done in analyze and it keeps getting worse.

--- src/main/shadow/build/cljs_hacks.cljc
+++ src/main/shadow/build/cljs_hacks.cljc
@@ -684,10 +684,16 @@
                      (assoc :tag (symbol type))))))
        (js/goog.define ~defname ~default))))

+;; https://github.com/clojure/clojurescript/commit/1589e5848ebb56ab451cb73f955dbc0b01e7aba0
+;; oops, seem to have missed keyword?
+(defn shadow-all-values? [exprs]
+  (every? #(or (nil? %) (symbol? %) (string? %) (number? %) (keyword? %) (true? %) (false? %)) exprs))
+
 (defn install-hacks! []
   ;; cljs.analyzer tweaks
   (replace-fn! #'ana/load-core shadow-load-core)
   (replace-fn! #'ana/resolve-var shadow-resolve-var)
+  (replace-fn! #'ana/all-values? shadow-all-values?)

   ;; cljs.compiler tweaks
   (replace-fn! #'comp/emits shadow-emits)


implement general schema validation caching

in general, a single data object can be validated against multiple schemas

https://github.com/Prismatic/schema/issues/256

--- cljs/src/common/plastic/validator.cljs
+++ cljs/src/common/plastic/validator.cljs
@@ -5,17 +5,34 @@

 ; shared validation utils

-; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet
-(assert js/WeakSet)
-(defonce *valid-objects* (js/WeakSet.))
+(assert js/WeakSet)                                                                                ; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet
+(assert js/WeakMap)                                                                                ; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
+(defonce *cached-validations* (js/WeakMap.))                                                                          ; object -> WeakSet of schemas
+
+(defn cache-hit? [obj schema]
+  (if-let [schema-set (.get *cached-validations* obj)]
+    (.has schema-set schema)))
+
+(defn make-weak-set [& items]
+  (let [weak-set (js/WeakSet.)]
+    (doseq [item items]
+      (.add weak-set item))
+    weak-set))
+
+(defn cache-validation [obj schema]
+  (if-let [schema-set (.get *cached-validations* obj)]
+    (.add schema-set schema)
+    (.set *cached-validations* obj (make-weak-set schema))))

 (defn check-or-update-cache! [schema obj]
-  (if (.has *valid-objects* obj)
-    true
-    (when (nil? (s/check schema obj))
-      (.add *valid-objects* obj)
-      true)))
+  (if (goog/isObject obj)                                                                                ; WeakMap must have object keys, anyways primitive values are cheap to check
+    (if (cache-hit? obj schema)
+      true
+      (when (nil? (s/check schema obj))                                                                               ; when validation fails (rare), bail out and let else branch of s/if do proper validation reporting
+        (cache-validation obj schema)
+        true))))

-;  to speed up validation we can cache some expensive validation results
+; to speed up validation we can cache some expensive validation results
+; see https://github.com/Prismatic/schema/issues/256
 (defn cached [schema]
   (s/if (partial check-or-update-cache! schema) s/Any schema))


[#160] Fix reader-conditional

[#160] Fix reader-conditional

--- priv/clojure/core.clj
+++ priv/clojure/core.clj
@@ -6370,7 +6370,7 @@
   If true, splicing? indicates read-cond-splicing."
   {:added "1.7"}
   [form ^Boolean splicing?]
-  (clojerl.reader.ReaderConditional/create.e form splicing?))
+  (new clojerl.reader.ReaderConditional form splicing?))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; data readers ;;;;;;;;;;;;;;;;;;


Whitespace.

Whitespace.

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -69,7 +69,7 @@
    re-use the JMS Connection created by this function unless the
    nested calls' connection-related options differ."
   [options & body]
-  `(immutant.messaging.core/with-connection (fn [] ~@body) ~options ))
+  `(immutant.messaging.core/with-connection (fn [] ~@body) ~options))

 (defn publish
   "Send a message to a destination. dest can either be the name of the


added event handling

added event handling

--- src-cljs/tranjlator/core.cljs
+++ src-cljs/tranjlator/core.cljs
@@ -2,7 +2,7 @@
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [chord.client :refer [ws-ch]]
-            [cljs.core.async :as a]
+            [cljs.core.async :refer [chan <! >! put!] :as a]
             [sablono.core :as html :refer-macros [html]])
   (:require-macros [cljs.core.async.macros :refer [go]]))

@@ -16,8 +16,58 @@
 (def sample-translation {:topic "German" :language "German" :content "Guten Tag"
                          :original-sha "XYZ" :content-sha "ABC" :user-name "bob"})

+(def sample-users ["Eric" "Colin" "Brian" "Rick"])
+
 (def app-state (atom {:original [sample-source]
-                      :translated [sample-translation]}))
+                      :translated [sample-translation]
+                      :users sample-users}))
+
+(defn handle-incoming [listener-ch server-ch]
+  (go
+   (loop []
+     (when-let [msg (<! server-ch)]
+       (do (>! listener-ch msg)
+           (recur))))))
+
+(defn handle-outgoing [sender-ch server-ch]
+  (go
+   (loop []
+     (when-let [msg (<! sender-ch)]
+       (>! server-ch msg)
+       (recur)))))
+
+(defn make-socket [listener-ch sender-ch]
+  (go
+   (let [{:keys [ws-channel error]} (<! (ws-ch +ws-url+))]
+     (when ws-channel
+       (do
+         (handle-incoming listener-ch ws-channel)
+         (handle-outgoing sender-ch ws-channel))))))
+
+(defn clear-text [owner]
+  (om/set-state! owner :text ""))
+
+(defn post-message [target text]
+  (println text)
+  #_(put! target text)
+  false)
+
+(defn check-for-enter [e owner {:keys [text sender-ch]}]
+  (when (or (= 13 (.-keyCode e))
+            (= 13 (.-which e)))
+    (do
+      (post-message sender-ch text)
+      clear-text owner)))
+
+(defn text-entry [e owner {:keys [text]}]
+  (om/set-state! owner :text (.. e -target -value)))
+
+(defn users-view [app owner]
+  (reify
+    om/IRender
+    (render [this]
+      (apply dom/ul nil
+             (map (fn [item] (dom/li nil item)) app)))))

 (defn chat-view [app owner]
   (reify
@@ -28,20 +78,45 @@

 (defn master-view [app owner]
   (reify
-    om/IRender
-    (render [this]
+    om/IInitState
+    (init-state [_]
+      (let [listener-ch (chan)
+            sender-ch (chan)]
+        (make-socket listener-ch sender-ch)
+        {:listener-ch listener-ch
+         :sender-ch sender-ch
+         :text ""}))
+    om/IWillMount
+    (will-mount [_]
+      (let [listener-ch (om/get-state owner :listener-ch)
+            sender-ch (om/get-state owner :sender-ch)]
+        (go (loop []
+              (let [msg (<! listener-ch)]
+                ;; do something cool with the message
+                (recur))))))
+    om/IRenderState
+    (render-state [this {:keys [sender-ch text] :as state}]
       (dom/div #js {:className "container"}
                (dom/h3 nil "Enter Chat stuff")
-               (dom/form #js {:className "form-horizontal"}
+               (dom/div #js {:className "form-horizontal"}
                          (dom/div nil
+                                  (dom/div nil
+                                           (om/build users-view (:users app)))
                                   (dom/div nil
                                            (om/build chat-view (:original app)))
                                   (dom/div nil
                                            (om/build chat-view (:translated app))))
                          (dom/div #js {:className "form-group"}
-                                  (dom/input #js {:className "form-control" :type "text"}))
+                                  (dom/input #js {:className "form-control" :type "text"
+                                                  :value text
+                                                  :onKeyPress (fn [e] (check-for-enter e owner state))
+                                                  :onChange #(text-entry % owner state)}))
                          (dom/div #js {:className "col-xs-offset-2 col-xs-10"}
-                                  (dom/button #js {:type "button" :className "button"}
+                                  (dom/button #js {:type "button" :className "button"
+                                                   :onClick (fn [e] (do
+                                                                     (post-message sender-ch text)
+                                                                     (clear-text owner))
+                                                              )}
                                               "click me")))))))

 (om/root


Fixing nit-picks :)

Fixing nit-picks :)

--- test/cia/test_helpers/generator.clj
+++ test/cia/test_helpers/generator.clj
@@ -44,16 +44,16 @@

 (defn schema-kw->schema [schema-kw]
   "get a schema from a schema keyword"
-  (schema-kw schema-mapping))
+  (get schema-mapping schema-kw))

-(defn generate [nb schema]
-  "generate nb records of a schema"
+(defn generate [num schema]
+  "generate num records of a schema"
   (gen/sample
-   (g/generator schema leaf-generators) nb))
+   (g/generator schema leaf-generators) num))

-(defn generate-by-kw [nb schema-kw]
-  "generate nb records of a schema-kw"
-  (generate nb (schema-kw->schema schema-kw)))
+(defn generate-by-kw [num schema-kw]
+  "generate num records of a schema-kw"
+  (generate num (schema-kw->schema schema-kw)))

 (defn generate-random-model-record []
   (let [model (->> schema-mapping


test-format-date-using-desired-format[1-3]

--- test/clj_calendar/calendar_test.clj
+++ test/clj_calendar/calendar_test.clj
@@ -144,7 +144,7 @@

 (deftest test-get-calendar-3
     "Check the function clj-calendar.calendar.calendar/get-calendar."
-    (testing "the function clj-calendar.calendar.calendar/get-calendar."
+    (testing "the function clj-calendar.calendar.calendar/get-calendar."
         (is (not (nil? (get-calendar))))
         (is (>= (.get (get-calendar) (java.util.Calendar/HOUR)) 0))
         (is (<= (.get (get-calendar) (java.util.Calendar/HOUR)) 11))
@@ -158,3 +158,36 @@
         (is (<= (.get (get-calendar) (java.util.Calendar/MILLISECOND)) 999))
 ))

+(deftest test-format-date-using-desired-format
+    "Check the function clj-calendar.calendar.calendar/format-date-using-desired-format"
+    (testing "the function clj-calendar.calendar.calendar/format-date-using-desired-format."
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 01 01 10 20 30)
+            (is (= "2000" (format-date-using-desired-format calendar "yyyy")))
+            (is (= "02"   (format-date-using-desired-format calendar "MM")))
+            (is (= "01"   (format-date-using-desired-format calendar "dd")))
+            (is (= "10"   (format-date-using-desired-format calendar "hh")))
+            (is (= "20"   (format-date-using-desired-format calendar "mm")))
+            (is (= "30"   (format-date-using-desired-format calendar "ss"))))))
+
+(deftest test-format-date-using-desired-format-2
+    "Check the function clj-calendar.calendar.calendar/format-date-using-desired-format"
+    (testing "the function clj-calendar.calendar.calendar/format-date-using-desired-format."
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 01 01 10 20 30)
+            (is (= "2000-02"    (format-date-using-desired-format calendar "yyyy-MM")))
+            (is (= "2000-02-01" (format-date-using-desired-format calendar "yyyy-MM-dd")))
+            (is (= "02-01"      (format-date-using-desired-format calendar "MM-dd")))
+            (is (= "2000-01"    (format-date-using-desired-format calendar "yyyy-dd"))))))
+
+(deftest test-format-date-using-desired-format-3
+    "Check the function clj-calendar.calendar.calendar/format-date-using-desired-format"
+    (testing "the function clj-calendar.calendar.calendar/format-date-using-desired-format."
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 01 01 10 20 30)
+            (is (= "10:20"      (format-date-using-desired-format calendar "hh:mm")))
+            (is (= "10:20:30"   (format-date-using-desired-format calendar "hh:mm:ss")))
+            (is (= "2000-02-01 10"  (format-date-using-desired-format calendar "yyyy-MM-dd hh")))
+            (is (= "2000-02-01 10:20"  (format-date-using-desired-format calendar "yyyy-MM-dd hh:mm")))
+            (is (= "2000-02-01 10:20:30"  (format-date-using-desired-format calendar "yyyy-MM-dd hh:mm:ss"))))))
+


test issues

test issues

--- test/cljs/triboard/test_runner.cljs
+++ test/cljs/triboard/test_runner.cljs
@@ -1,6 +1,8 @@
 (ns ^:figwheel-always triboard.test-runner
   (:require
     [cljs.test :refer [run-tests]]
+    [triboard.algo-test]
+    [triboard.core-test]
     ))

 (run-tests


Correct project.clj

Correct project.clj

The build did fail, although not because a test failed. Instead I had
overlooked some things about how to configure everything correctly for
Travis. Hope it works now.

--- project.clj
+++ project.clj
@@ -1,5 +1,7 @@
 (defproject theatralia "0.0.1-SNAPSHOT"
   :description "Cool new project to do things and stuff"
   :dependencies [[org.clojure/clojure "1.6.0"]]
-  :profiles {:dev {:dependencies [[midje "1.6.3"]]}})
-
+  :profiles {:dev {:dependencies
+                   [[midje "1.6.3" :exclusions [org.clojure/clojure]]]
+                   :plugins
+                   [[lein-midje "3.1.3"]]}})


Fix project.clj version to match boot's

Fix project.clj version to match boot's

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject mount "0.1.12-SNAPSHOT"
+(defproject mount "0.1.15-SNAPSHOT"
   :description "managing Clojure and ClojureScript app state since (reset)"
   :url "https://github.com/tolitius/mount"
   :license {:name "Eclipse Public License"


Remove quickie plugin.

Remove quickie plugin.

--- project.clj
+++ project.clj
@@ -3,7 +3,6 @@
   :url "https://github.com/markwoodhall/clj-ravendb"
   :license {:name "MIT License"
             :url "http://opensource.org/licenses/mit-license.php"}
-  :plugins [[quickie "0.2.5"]]
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [clj-http "2.1.0"]
                  [cheshire "5.4.0"]


Replaced sassc with sass

Replaced sassc with sass

--- project.clj
+++ project.clj
@@ -112,11 +112,11 @@
   :scss  {:builds
           {:dev {:source-dir "src/scss"
                  :dest-dir   "target/generated/public/css"
-                 :executable "sassc"
+                 :executable "sass"
                  :args       ["--line-numbers" "-I" "src/scss" "-t" "nested"]}
            :adv {:source-dir "src/scss"
                  :dest-dir   "target/adv/public/css"
-                 :executable "sassc"
+                 :executable "sass"
                  :args       ["-I" "src/scss/" "-t" "compressed"]}}}


lein-release plugin: bumped version from 0.2.4 to 0.2.5-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject se.haleby/stub-http "0.2.4"
+(defproject se.haleby/stub-http "0.2.5-SNAPSHOT"
   :description "A client library agonistic way to stub HTTP responses"
   :url "https://github.com/johanhaleby/stub-http"
   :license {:name         "MIT License"


use SpringJDBC 4.0.2

use SpringJDBC 4.0.2

--- project.clj
+++ project.clj
@@ -11,7 +11,7 @@
   :javac-options {:destdir "target/classes/"
                   :source  "1.5"
                   :target  "1.5"}
-  :dependencies [[org.springframework/spring-jdbc "4.0.1.RELEASE"]]
+  :dependencies [[org.springframework/spring-jdbc "4.0.2.RELEASE"]]
   :profiles {:dev {:dependencies [[oss-jdbc "0.8.0"]
                                   [clj-dbcp "0.8.1"]
                                   [net.mikera/cljunit "0.3.0"]]}


update to cljs-react-material-ui "0.2.33"

--- project.clj
+++ project.clj
@@ -5,7 +5,7 @@
             :url  "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.8.40"]
-                 [org.omcljs/om "1.0.0-alpha37" :exclusions [cljsjs/react]]
+                 [org.omcljs/om "1.0.0-alpha37" :exclusions [cljsjs/react cljsjs/react-dom]]
                  [com.stuartsierra/component "0.3.1"]
                  [com.cemerick/piggieback "0.2.1"]
                  [figwheel-sidecar "0.5.0-2" :scope "test"]
@@ -19,7 +19,7 @@
                  [juxt.modular/wire-up "0.5.0"]
                  [juxt.modular/aleph "0.1.4"]
                  [com.andrewmcveigh/cljs-time "0.4.0"]
-                 [cljs-react-material-ui "0.2.30"]
+                 [cljs-react-material-ui "0.2.33"]
                  [prismatic/schema "1.1.1"]
                  [print-foo-cljs "2.0.0"]]


Story ID: develop Merge branch 'develop' of gitlab.buehner-fry.com:navis/untangled-client into develop

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@
                  [org.omcljs/om "1.0.0-alpha30" :scope "test"]
                  [figwheel-sidecar "0.5.0-3" :scope "provided"]]

-  :repositories [["releases" "https://artifacts.buehner-fry.com/artifactory/internal-release"]]
+  :repositories [["releases" "https://artifacts.buehner-fry.com/artifactory/release"]]

   :deploy-repositories [["releases" {:url           "https://artifacts.buehner-fry.com/artifactory/navis-maven-release"
                                      :sign-releases false}]


(SERVER-2213) Upgrade to latest jetty release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def jetty-version "9.4.4.v20170414")
+(def jetty-version "9.4.11.v20180605")

 (defproject puppetlabs/trapperkeeper-webserver-jetty9 "2.1.3-SNAPSHOT"
   :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."


Bump version of kibit

Bump version of kibit


lein-release plugin: bumped version from 0.2.8 to 0.2.9-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.clojars.mhuebert/re-view "0.2.8"
+(defproject org.clojars.mhuebert/re-view "0.2.9-SNAPSHOT"
   :description "Tiny React wrapper"
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"


Start testing with Clojure 1.8.0-RC3

Start testing with Clojure 1.8.0-RC3

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :jvm-opts ["-Dapple.awt.UIElement=true"]  ; Suppress dock icon and focus stealing when compiling on a Mac.
-  :dependencies [[org.clojure/clojure "1.7.0"]
+  :dependencies [[org.clojure/clojure "1.8.0-RC3"]
                  [org.clojure/core.cache "0.6.4"]
                  [org.clojure/core.async "0.2.374"]
                  [org.clojure/data.json "0.2.6"]


Revert "Reduce max allowed memory size"

Revert "Reduce max allowed memory size"

This reverts commit 544e029b388c51be247db51e8e9b7c3c578c8782.

--- project.clj
+++ project.clj
@@ -20,11 +20,6 @@
                  [markdown-clj "0.9.86"]
                  [hiccup "1.0.5"]]

-  :jvm-opts ["-Xss16m"
-             "-Xms512m"
-             "-Xmx512m"
-             "-XX:MaxPermSize=512m"
-             "-Djava.awt.headless=true"]
   :resource-paths ["resources" "doc"]
   :ring {:handler cia.handler/app
          :init cia.init/init!


Version 0.0.9-SNAPSHOT

Version 0.0.9-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject pe-core-utils "0.0.8"
+(defproject pe-core-utils "0.0.9-SNAPSHOT"
   :description "A Clojure library providing a set of helper functions."
   :url "https://github.com/evanspa/pe-core-utils"
   :license {:name "MIT"


prepare 0.1.1-SNAPSHOT

prepare 0.1.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lyceum "0.1.0"
+(defproject lyceum "0.1.1-SNAPSHOT"
   :description "A riemann plugin to build and deploy modular rules."
   :url "https://github.com/spotify/lyceum"
   :license {:name "Apache License 2.0"


Removed clojure.tools.cli.

Removed clojure.tools.cli.

--- project.clj
+++ project.clj
@@ -11,7 +11,6 @@
   :repositories {"releases"
                  "http://oss.sonatype.org/content/repositories/releases/"}
   :dependencies [[org.clojure/clojure "1.3.0"]
-                 [org.clojure/tools.cli "0.1.0"]
                  [org.clojure/math.numeric-tower "0.0.1"]
                  [incanter/incanter-core "1.3.0-SNAPSHOT"]
                  [clj-time "0.3.1"]


fixes files included in jar

fixes files included in jar

--- project.clj
+++ project.clj
@@ -8,7 +8,7 @@

   :jar-exclusions [#"\.cljx|\.swp|\.swo|\.DS_Store"]
   :javac-options ["-target" "1.5" "-source" "1.5"]
-  :source-paths ["src/clj" "src/cljs"]
+  :source-paths ["src/clj" "src/cljs" "target/src/clj" "target/src/cljs"]
   :test-paths ["spec/clj" "target/src/clj"]

   :dependencies [[org.clojure/clojure "1.6.0"]