added svg attributes to the attribute map

--- src/kioo/util.cljx
+++ src/kioo/util.cljx
@@ -48,7 +48,9 @@
                :colSpan :contentEditable :contextMenu :dateTime :encType
                :formNoValidate :frameBorder :htmlFor :httpEquiv :maxLength
                :noValidate :radioGroup :readOnly :rowSpan :scrollLeft :scrollTop
-               :spellCheck :srcDoc :tabIndex])
+               :spellCheck :srcDoc :tabIndex :gradientTransform :gradientUnits
+               :spreadMethod :stopColor :stopOpacity :strokeLinecap :strokeWidth
+               :textAnchor :viewBox])
     :class
     :className))


bugfix

bugfix

--- src/latte/prop.clj
+++ src/latte/prop.clj
@@ -473,13 +473,13 @@
               (if-not (stx/prod? body)
                 [:ko nil nil]
                 (let [[_ [_ AC] C'] body]
-                  (if-not (and (= C' C) (stx/prod? AC))
+                  (if-not (clojure.core/and (= C' C) (stx/prod? AC))
                     [:ko nil nil]
                     (let [[_ [_ A] C'] AC]
-                      (if-not (and (= C' C) (stx/prod? body))
+                      (if-not (clojure.core/and (= C' C) (stx/prod? body))
                         [:ko nil nil]
                         (let [[_ [_ BC] C'] body]
-                          (if-not (and (= C' C) (stx/prod? AC))
+                          (if-not (clojure.core/and (= C' C) (stx/prod? AC))
                             [:ko nil nil]
                             (let [[_ [_ B] C'] BC]
                               (if-not (= C' C)


CMR-3780: Added tests after re-enable

CMR-3780: Added tests after re-enable

--- access-control-app/int_test/cmr/access_control/int_test/enable_disable_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/enable_disable_test.clj
@@ -45,17 +45,17 @@
   "Options map to pass on POST requests to enable/disable writes in access control."
   {:headers {transmit-config/token-header (transmit-config/echo-system-token)}})

-(deftest enable-disable-enable-write-acl
+(deftest enable-disable-re-enable-write-acl
   (let [token (e/login (u/conn-context) "admin")
-        resp (ac/create-acl (u/conn-context) system-acl {:raw? true :token token})
-        concept-id (get-in resp [:body :concept_id])
+        first-resp (ac/create-acl (u/conn-context) system-acl {:raw? true :token token})
+        concept-id (get-in first-resp [:body :concept_id])
         ;; Create a second ACL to test update/delete after disable
-        resp2 (ac/create-acl (u/conn-context) provider-acl {:token token})
-        concept-id2 (:concept_id resp2)]
+        second-resp (ac/create-acl (u/conn-context) provider-acl {:token token})
+        concept-id2 (:concept_id second-resp)]

-    (testing "save and delete acl works before disable"
+    (testing "save, udate, and delete acl works before disable"
       ;; check save response
-      (is (= 200 (:status resp)))
+      (is (= 200 (:status first-resp)))
       ;; test update
       (is (= 200 (:status (ac/update-acl (u/conn-context) concept-id catalog-item-acl {:token token :raw? true}))))
       ;; test delete
@@ -64,7 +64,7 @@
     ;; disable writes for access control service
     (u/disable-access-control-writes post-options)

-    (testing "save and delete acl fails after disable"
+    (testing "save, update, and delete acl fails after disable"
       (let [token (e/login (u/conn-context) "admin")
             resp (ac/create-acl (u/conn-context) system-acl {:raw? true :token token})
             concept-id (get-in resp [:body :concept_id])]
@@ -73,5 +73,19 @@
         ;; test update
         (is (= 503 (:status (ac/update-acl (u/conn-context) concept-id2 provider-acl {:token token :raw? true}))))
         ;; test delete
-        (is (= 503 (:status (ac/delete-acl (u/conn-context) concept-id2 {:token token :raw? true}))))))))
+        (is (= 503 (:status (ac/delete-acl (u/conn-context) concept-id2 {:token token :raw? true}))))))

+    ;; re-enable writes for access control service
+    (u/enable-access-control-writes post-options)
+
+    (testing "save, upate, and delete acl works after re-enable"
+      (let [token (e/login (u/conn-context) "admin")
+            resp (ac/create-acl (u/conn-context) system-acl {:raw? true :token token})
+            concept-id (get-in resp [:body :concept_id])]
+        ;; check save response
+        (is (= 200 (:status resp)))
+        ;; test update
+        (is (= 200 (:status (ac/update-acl (u/conn-context) concept-id2 provider-acl {:token token :raw? true}))))
+        ;; test delete
+        (is (= 200 (:status (ac/delete-acl (u/conn-context) concept-id2 {:token token :raw? true}))))))))
+


Adding a test that the combination of consistent cache and single thread lookup cache still functions as a consistent cache.

--- common-app-lib/test/cmr/common_app/test/cache/consistent_cache.clj
+++ common-app-lib/test/cmr/common_app/test/cache/consistent_cache.clj
@@ -5,7 +5,9 @@
             [cmr.common.cache.in-memory-cache :as mem-cache]
             [cmr.common.cache.cache-spec :as cache-spec]
             [cmr.common-app.cache.consistent-cache-spec :as consistent-cache-spec]
-            [cmr.common.cache :as c]))
+            [cmr.common.cache :as c]
+            [cmr.common.cache.single-thread-lookup-cache :as slc]
+            [cmr.common.lifecycle :as l]))

 ;; Test the consistent cache with just in memory caches
 (deftest consistent-cache-functions-as-cache-test
@@ -18,3 +20,21 @@
     (consistent-cache-spec/assert-consistent-cache
       (cc/create-consistent-cache (mem-cache/create-in-memory-cache) hash-cache)
       (cc/create-consistent-cache (mem-cache/create-in-memory-cache) hash-cache))))
+
+(deftest consistent-cache-with-single-thread-cache-functions-as-consistent-cache-test
+  (let [hash-cache (mem-cache/create-in-memory-cache)
+        slc-cache1 (l/start (slc/create-single-thread-lookup-cache
+                               (cc/create-consistent-cache
+                                 (mem-cache/create-in-memory-cache)
+                                 hash-cache))
+                            nil)
+        slc-cache2 (l/start (slc/create-single-thread-lookup-cache
+                               (cc/create-consistent-cache
+                                 (mem-cache/create-in-memory-cache)
+                                 hash-cache))
+                            nil)]
+    (try
+      (consistent-cache-spec/assert-consistent-cache slc-cache1 slc-cache2)
+      (finally
+        (l/stop slc-cache1 nil)
+        (l/stop slc-cache2 nil)))))


Pos int already defined.

Pos int already defined.

--- src/onyx/spec.cljc
+++ src/onyx/spec.cljc
@@ -14,9 +14,6 @@

 (defn namespaced-keyword? [x]
   (and (keyword? x) (namespace x)))
-
-(defn pos-int? [x]
-  (and (integer? x) (pos? x)))

 (s/def :job/workflow
   (s/coll-of (s/coll-of :onyx/name :kind vector? :count 2)


Fix url all fields production monthly

Fix url all fields production monthly

--- src/clj_simple_chart/ncs/all_fields_production_monthly.clj
+++ src/clj_simple_chart/ncs/all_fields_production_monthly.clj
@@ -5,7 +5,7 @@
             [clj-http.client :as client])
   (:import (java.time YearMonth)))

-(def url "http://factpages.npd.no/ReportServer?/FactPages/TableView/field_production_totalt_NCS_month__DisplayAllRows&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=77.13.13.136&CultureCode=en")
+(def url "https://factpages.npd.no/ReportServer_npdpublic?/FactPages/TableView/field_production_totalt_NCS_month__DisplayAllRows&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.220.29.120&CultureCode=en")

 (defonce raw-data (-> url
                       (client/get)


Double click column resizing thingy to reset column width

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -89,13 +89,14 @@
      ((:onChange props)))})

-(defn- render-cell [{:keys [width onResizeMouseDown onSortClick sortOrder] :as props}]
+(defn- render-cell [{:keys [width onResizeMouseDown onResizeDoubleClick onSortClick sortOrder] :as props}]
   [:div {:style (merge {:float "left" :position "relative" :width width :minWidth 10}
                   (:cell-style props))}
    (when (:onResizeMouseDown props)
      [:div {:style {:position "absolute" :width 20 :top 0 :bottom 0 :left (- width 10) :zIndex 1
                     :cursor "col-resize"}
-            :onMouseDown onResizeMouseDown}])
+            :onMouseDown onResizeMouseDown
+            :onDoubleClick onResizeDoubleClick}])
    (when onSortClick
      [:div {:style {:position "absolute" :top 0 :bottom 0 :left 0 :width (if onResizeMouseDown (- width 10) width)
                     :cursor "pointer"}
@@ -110,37 +111,39 @@

 (defn- render-header [state props]
-[:div {:style (merge
-                {:fontWeight 500 :fontSize "80%"
-                 :color "#fff" :backgroundColor (:header-darkgray style/colors)}
-                (:header-row-style props))}
- (map-indexed
-   (fn [i column]
-     (let [onResizeMouseDown (when (get column :resizable? (:resizable-columns? props))
-                               (fn [e] (swap! state assoc
-                                         :dragging? true :mouse-x (.-clientX e) :drag-column i)))]
-       (render-cell
-         {:width (nth (:column-widths @state) i)
-          :content (:header column)
-          :cell-style (when onResizeMouseDown {:borderRight "1px solid #777777" :marginRight -1})
-          :cell-padding-left (or (:cell-padding-left props) 0)
-          :content-container-style (merge
-                                     {:padding (str "0.8em 0 0.8em " (or (:cell-padding-left props) 0))}
-                                     (:header-style props))
-          :onResizeMouseDown onResizeMouseDown
-          :onSortClick (when-let [sorter (:sort-by column)]
-                         #(if (= i (:sort-column @state))
-                           (case (:sort-order @state)
-                             :asc (swap! state assoc :sort-order :desc)
-                             :desc (swap! state dissoc :sort-column :sort-order :key-fn)
-                             (assert false "bad state"))
-                           (swap! state assoc :sort-column i :sort-order :asc
-                             :key-fn (if (= :value sorter)
-                                       (fn [row] (nth row i))
-                                       (fn [row] (sorter (nth row i)))))))
-          :sortOrder (when (= i (:sort-column @state)) (:sort-order @state))})))
-   (:columns props))
- (common/clear-both)])
+  [:div {:style (merge
+                  {:fontWeight 500 :fontSize "80%"
+                   :color "#fff" :backgroundColor (:header-darkgray style/colors)}
+                  (:header-row-style props))}
+   (map-indexed
+     (fn [i column]
+       (let [onResizeMouseDown (when (get column :resizable? (:resizable-columns? props))
+                                 (fn [e] (swap! state assoc
+                                           :dragging? true :mouse-x (.-clientX e) :drag-column i)))]
+         (render-cell
+           {:width (nth (:column-widths @state) i)
+            :content (:header column)
+            :cell-style (when onResizeMouseDown {:borderRight "1px solid #777777" :marginRight -1})
+            :cell-padding-left (or (:cell-padding-left props) 0)
+            :content-container-style (merge
+                                       {:padding (str "0.8em 0 0.8em " (or (:cell-padding-left props) 0))}
+                                       (:header-style props))
+            :onResizeMouseDown onResizeMouseDown
+            :onResizeDoubleClick #(swap! state update-in [:column-widths]
+                                     assoc i (get-in props [:columns i :starting-width]))
+            :onSortClick (when-let [sorter (:sort-by column)]
+                           #(if (= i (:sort-column @state))
+                             (case (:sort-order @state)
+                               :asc (swap! state assoc :sort-order :desc)
+                               :desc (swap! state dissoc :sort-column :sort-order :key-fn)
+                               (assert false "bad state"))
+                             (swap! state assoc :sort-column i :sort-order :asc
+                               :key-fn (if (= :value sorter)
+                                         (fn [row] (nth row i))
+                                         (fn [row] (sorter (nth row i)))))))
+            :sortOrder (when (= i (:sort-column @state)) (:sort-order @state))})))
+     (:columns props))
+   (common/clear-both)])

 (react/defc Body


Hot reloading fix.

Hot reloading fix.

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -301,6 +301,16 @@
             data)))

+(defn- create-ordered-columns [columns]
+  (vec (map-indexed
+        (fn [index col]
+          (assoc col
+                 :index index :showing? true
+                 :width (or (:starting-width col) 100)
+                 :starting-width (or (:starting-width col) 100)))
+        columns)))
+
+
 (react/defc Table
   {:get-default-props
    (fn []
@@ -312,13 +322,7 @@
       :filterable? true})
    :get-initial-state
    (fn [{:keys [props]}]
-     {:ordered-columns (vec (map-indexed
-                             (fn [index col]
-                               (assoc col
-                                      :index index :showing? true
-                                      :width (or (:starting-width col) 100)
-                                      :starting-width (or (:starting-width col) 100)))
-                             (:columns props)))
+     {:ordered-columns (create-ordered-columns (:columns props))
       :dragging? false})
    :render
    (fn [{:keys [this state props refs]}]
@@ -375,7 +379,8 @@
        (react/call :set-rows (@refs "body") (react/call :get-body-rows this rows))
        (react/call :set-num-rows-visible (@refs "paginator") (count rows))))
    :component-will-receive-props
-   (fn [{:keys [state next-props refs]}]
+   (fn [{:keys [props next-props state refs]}]
+     (swap! state assoc :ordered-columns (create-ordered-columns (:columns props)))
      (react/call :make-desynced (@refs "filterer")))
    :component-did-mount
    (fn [{:keys [this state]}]


Add pepa.model/set-pages!.

Add pepa.model/set-pages!.

--- src/pepa/model.clj
+++ src/pepa/model.clj
@@ -180,6 +180,13 @@
 (defn add-pages! [db document page-ids]
   (log/info db "Adding pages to document" (str document ":") page-ids)
   (db/with-transaction [db db]
+    (add-pages*! db document page-ids)
+    (db/notify! db :documents/updated {:id document})))
+
+(defn set-pages! [db document page-ids]
+  (log/info db "Replacing pages for document" (str document ":") page-ids)
+  (db/with-transaction [db db]
+    (db/delete! db :document_pages ["document = ?" document])
     (add-pages*! db document page-ids)
     (db/notify! db :documents/updated {:id document})))


(SERVER-2795) Fix CSR DELETE API

(SERVER-2795) Fix CSR DELETE API

This commit fixes a misplaced parenthesis that accidentally removed the
API for deleting a CSR.

--- src/clj/puppetlabs/services/ca/certificate_authority_core.clj
+++ src/clj/puppetlabs/services/ca/certificate_authority_core.clj
@@ -311,9 +311,9 @@
         (GET [""] [subject]
           (handle-get-certificate-request subject ca-settings))
         (PUT [""] [subject :as {body :body}]
-          (handle-put-certificate-request! subject body ca-settings)))
+          (handle-put-certificate-request! subject body ca-settings))
         (DELETE [""] [subject]
-          (handle-delete-certificate-request! subject ca-settings))
+          (handle-delete-certificate-request! subject ca-settings)))
       (GET ["/certificate_revocation_list/" :ignored-node-name] []
         (handle-get-certificate-revocation-list ca-settings)))
     (comidi/not-found "Not Found")))


minor cleanup of code.

minor cleanup of code.

--- src/cmr/search/results_handlers/atom_json_results_handler.clj
+++ src/cmr/search/results_handlers/atom_json_results_handler.clj
@@ -27,27 +27,27 @@
   (let [{:keys [id title short-name version-id summary updated dataset-id collection-data-type
                 processing-level-id original-format data-center archive-center start-date end-date
                 atom-links associated-difs online-access-flag browse-flag coordinate-system shapes]} reference
-        result-head {:id id
-                     :title title
-                     :summary summary
-                     :updated updated
-                     :dataset_id dataset-id
-                     :short_name short-name
-                     :version_id version-id
-                     :original_format original-format
-                     :collection_data_type collection-data-type
-                     :data_center data-center
-                     :archive_center archive-center
-                     :processing_level_id processing-level-id
-                     :time_start start-date
-                     :time_end end-date
-                     :links (map atom/atom-link->attribute-map atom-links)
-                     :coordinate_system coordinate-system}
         shape-result (atom-spatial/shapes->json shapes)
-        result-bottom {:dif_ids associated-difs
+        result (merge {:id id
+                       :title title
+                       :summary summary
+                       :updated updated
+                       :dataset_id dataset-id
+                       :short_name short-name
+                       :version_id version-id
+                       :original_format original-format
+                       :collection_data_type collection-data-type
+                       :data_center data-center
+                       :archive_center archive-center
+                       :processing_level_id processing-level-id
+                       :time_start start-date
+                       :time_end end-date
+                       :dif_ids associated-difs
                        :online_access_flag online-access-flag
-                       :browse_flag browse-flag}
-        result (merge result-bottom shape-result result-head)]
+                       :browse_flag browse-flag
+                       :links (map atom/atom-link->attribute-map atom-links)
+                       :coordinate_system coordinate-system}
+                      shape-result)]
     ;; remove entries with nil value
     (apply dissoc
            result
@@ -59,24 +59,24 @@
   (let [{:keys [id title updated dataset-id producer-gran-id size original-format
                 data-center start-date end-date atom-links online-access-flag browse-flag
                 day-night cloud-cover coordinate-system shapes]} reference
-        result-head {:id id
-                     :title title
-                     :updated updated
-                     :dataset_id dataset-id
-                     :producer_granule_id producer-gran-id
-                     :granule_size size
-                     :original_format original-format
-                     :data_center data-center
-                     :time_start start-date
-                     :time_end end-date
-                     :links (map atom/atom-link->attribute-map atom-links)
-                     :coordinate_system coordinate-system}
         shape-result (atom-spatial/shapes->json shapes)
-        result-bottom {:online_access_flag online-access-flag
+        result (merge {:id id
+                       :title title
+                       :updated updated
+                       :dataset_id dataset-id
+                       :producer_granule_id producer-gran-id
+                       :granule_size size
+                       :original_format original-format
+                       :data_center data-center
+                       :time_start start-date
+                       :time_end end-date
+                       :links (map atom/atom-link->attribute-map atom-links)
+                       :online_access_flag online-access-flag
                        :browse_flag browse-flag
                        :day_night_flag day-night
-                       :cloud_cover cloud-cover}
-        result (merge result-bottom shape-result result-head)]
+                       :cloud_cover cloud-cover
+                       :coordinate_system coordinate-system}
+                      shape-result)]
     ;; remove entries with nil value
     (apply dissoc
            result
@@ -91,9 +91,10 @@
         items (if (= :granule (:concept-type query))
                 (atom/append-collection-links context items)
                 items)
-        response-results {:feed {:updated (str (time/now))
-                          :id (url/atom-request-url context concept-type result-format)
-                          :title (atom/concept-type->atom-title (:concept-type query))
-                          :entry (map atom-reference-to-json-fn items)}}]
+        response-results {:feed
+                          {:updated (str (time/now))
+                           :id (url/atom-request-url context concept-type result-format)
+                           :title (atom/concept-type->atom-title (:concept-type query))
+                           :entry (map atom-reference-to-json-fn items)}}]
     (json/generate-string response-results {:pretty (:pretty? query)})))


stats never negative

stats never negative

--- src/spq/server.clj
+++ src/spq/server.clj
@@ -124,8 +124,9 @@
                   s @state]
               (fn [m k v]
                 (assoc m k
-                       {:queued (- (:enqueued v) (:completed v))
-                        :active (:in-progress v)
+                       ;; (max 0), is this a bug upstream? can be negative? data race?
+                       {:queued (max 0 (- (:enqueued v) (:completed v)))
+                        :active (max 0 (:in-progress v))
                         :puts/sec      (double (/ (count (drop-while #(> (- now %) (* 1e9 (conf :stats :window-seconds))) (get-in s [:stats k :puts])))      (conf :stats :window-seconds)))
                         :completes/sec (double (/ (count (drop-while #(> (- now %) (* 1e9 (conf :stats :window-seconds))) (get-in s [:stats k :completes]))) (conf :stats :window-seconds)))})))
             {})
@@ -133,8 +134,8 @@

 (defn periodic-task
   [stop-periodic-task]
-  (future
-    (when-not @stop-periodic-task
+  (when-not @stop-periodic-task
+    (future
       (try
         (let [to-retry (->> @state
                          :tasks


Fix the text opacity handling.

Fix the text opacity handling.

Fixes #74

--- frontend/src/uxbox/main/ui/shapes/text.cljs
+++ frontend/src/uxbox/main/ui/shapes/text.cljs
@@ -92,7 +92,7 @@
                   (color/rgb->str))]
     (merge
      {:fontSize (str font-size "px")
-      :color fill-color
+      :color color
       :whiteSpace "pre-wrap"
       :textAlign text-align
       :fontFamily font-family


Extend TaggedValue to BlobRefs.

Extend TaggedValue to BlobRefs.

--- src/vault/blob.clj
+++ src/vault/blob.clj
@@ -1,5 +1,6 @@
 (ns vault.blob
   (:require [clojure.string :as string]
+            [vault.print :as vp]
             digest))

@@ -46,6 +47,12 @@
     (str (name algorithm) ":" digest)))

+(extend-type BlobRef
+  vp/TaggedValue
+  (edn-tag [this] 'vault/ref)
+  (edn-value [this] (str this)))
+
+
 (defmethod print-method BlobRef
   [value ^java.io.Writer w]
   (.write w (str "#vault/ref " \" value \")))


WIP - Travail sur SkyNetRevolution 1 en Clojure

--- clojure/codingame/practice/medium/skynet-revolution-1/src/Player.clj
+++ clojure/codingame/practice/medium/skynet-revolution-1/src/Player.clj
@@ -12,7 +12,12 @@
       (let [n1 (read) n2 (read)]
           ; n1: n1 and n2 defines a link between these nodes
         (recur (dec i) (merge-with {n1  n2, n2 n1} graph))) (graph))))
-
+(defn create-indexes-of-exits-from-read-input [number-of-exits]
+  (loop [i number-of-exits index-of-exits #{}]
+    (if (> i 0)
+      (let [exit-index (read)]
+          ; EI: the index of a gateway node
+        (recur (dec i) (conj index-of-exits exit-index))) index-of-exits)))

 (defn -main [& _]
   (let [number-of-nodes (read)
@@ -21,16 +26,8 @@
     ; number-of-nodes: the total number of nodes in the level, including the gateways
     ; number-of-links: the number of links
     ; number-of-exits: the number of exit gateways
-        graph (loop [i number-of-links map-of-nodes {}]
-                (if (> i 0)
-                  (let [n1 (read) n2 (read)]
-          ; n1: n1 and n2 defines a link between these nodes
-                    (recur (dec i) (merge-with {n1  n2, n2 n1} map-of-nodes))) (map-of-nodes)))
-        index-of-exits (loop [i number-of-exits exits #{}]
-                         (if (> i 0)
-                           (let [exit-index (read)]
-          ; EI: the index of a gateway node
-                             (recur (dec i) (conj exits exit-index))) exits))]
+        graph (create-graph-from-read-input number-of-links)
+        index-of-exits (create-indexes-of-exits-from-read-input number-of-exits)]
     (while true
       (let [skynet-index (read)]
         ; SI: The index of the node on which the Skynet agent is positioned this turn


Rename document-name header to document-label.

--- project/scrape-summitpost-data/src/scrape_summitpost_data/core.clj
+++ project/scrape-summitpost-data/src/scrape_summitpost_data/core.clj
@@ -48,7 +48,7 @@
                          get-item-texts-with-children
                          get-item-texts)]
     (csv/write-csv out-file
-                   (cons ["document-url", "document-name", "document-text"]
+                   (cons ["document-url", "document-label", "document-text"]
                          (get-texts-fn search-link))))))

 (defn -main [& args]


Fixes clause->lhs optionals.

Fixes clause->lhs optionals.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -866,15 +866,11 @@
           binding (key-exists-with-binding-clause-binding clause)]
       {(convert-path-element key) (symbol binding)})

-    ;; FIXME: should this be {}
     (optional-key-exists-without-binding-clause? clause)
-    (let [key     (optional-key-exists-without-binding-clause-key clause)]
-      `{~key ~'_})
+    {}

     (optional-key-exists-with-binding-clause? clause)
-    (let [key     (key-exists-with-binding-clause-key clause)
-          binding (key-exists-with-binding-clause-binding clause)]
-      {(convert-path-element key) (symbol binding)})
+    {}

     (path-exists-without-binding-clause? clause)
     (let [path    (path-exists-without-binding-clause-path clause)]
@@ -886,13 +882,10 @@
       (assoc-in {} (map convert-path-element path) (symbol binding)))

     (optional-path-exists-without-binding-clause? clause)
-    (let [path    (optional-path-exists-without-binding-clause-path clause)]
-      (assoc-in {} (map convert-path-element path) '_))
+    {}

     (optional-path-exists-with-binding-clause? clause)
-    (let [path    (optional-path-exists-with-binding-clause-path clause)
-          binding (optional-path-exists-with-binding-clause-binding clause)]
-      (assoc-in {} (map convert-path-element path) (symbol binding)))
+    {}

     (key-matches-without-binding-clause? clause)
     (let [key         (key-matches-without-binding-clause-key clause)
@@ -911,20 +904,10 @@
         `{~key ~(match-value message [key])}))

     (optional-key-matches-without-binding-clause? clause)
-    (let [key         (optional-key-matches-without-binding-clause-key clause)
-          matcher     (optional-key-matches-without-binding-clause-matcher clause)
-          match-value (matcher->value matcher)]
-      (if (predicate-matcher? matcher)
-        `({~key ~'_} :guard ~(match-value message [key]))
-        `{~key ~(match-value message [key])}))
+    {}

     (optional-key-matches-with-binding-clause? clause)
-    (let [key         (optional-key-matches-with-binding-clause-key clause)
-          matcher     (optional-key-matches-with-binding-clause-matcher clause)
-          match-value (matcher->value matcher)]
-      (if (predicate-matcher? matcher)
-        `({~key ~'_} :guard ~(match-value message [key]))
-        `{~key ~(match-value message [key])}))
+    {}

     (path-matches-without-binding-clause? clause)
     (let [path        (path-matches-without-binding-clause-path clause)
@@ -943,20 +926,10 @@
         (fold-path path (match-value message path))))

     (optional-path-matches-without-binding-clause? clause)
-    (let [path        (optional-path-matches-without-binding-clause-path clause)
-          matcher     (optional-path-matches-without-binding-clause-matcher clause)
-          match-value (matcher->value matcher)]
-      (if (predicate-matcher? matcher)
-        `(~(fold-path path '_) :guard ~(match-value message path))
-        (fold-path path (match-value message path))))
+    {}

     (optional-path-matches-with-binding-clause? clause)
-    (let [path        (optional-path-matches-with-binding-clause-path clause)
-          matcher     (optional-path-matches-with-binding-clause-matcher clause)
-          match-value (matcher->value matcher)]
-      (if (predicate-matcher? matcher)
-        `(~(fold-path path '_) :guard ~(match-value message path))
-        (fold-path path (match-value message path))))))
+    {}))

 (defn reduce-lhs


complete other methods

complete other methods

--- src/bitsplit_cli/client.cljs
+++ src/bitsplit_cli/client.cljs
@@ -5,12 +5,15 @@
         (Queries addresses unspent-amounts unspent-channel
          Operations send-amounts! new-address!)]))

+(def fake-addresses (atom
+    ["dke98di398fdjr98feijr3oifsoij"
+     "kdi9d9ekdkjeufjeueudjudd"
+     "83dkm3mde030dk3kd3jdmjewkdi"]))
+(def findex (atom 0))
+
 (defrecord FakeClient [info]
     Queries
-    (addresses [this]
-        ["dke98di398fdjr98feijr3oifsoij"
-         "kdi9d9ekdkjeufjeueudjudd"
-         "83dkm3mde030dk3kd3jdmjewkdi"])
+    (addresses [this] @fake-addresses)
     (unspent-amounts [this]
         (vec
             (map (fn [address amount] {"address" address "amount" amount})
@@ -18,15 +21,17 @@
     (unspent-channel [this]
         (let [amounts (unspent-amounts this)
               index (atom 0)
-              return (chan)]
+              return (chan)
+              inc-mod (comp #(mod % 3) inc)]
             (js/setInterval
                 (fn []
-                    (put! return (amounts @index))
-                    (swap! index inc)
-                    (swap! index #(mod % 3)))
+                    (put! return
+                        (amounts (swap! index inc-mod))))
                 1000)
             return))
     Operations
-    (send-amounts! [this amounts])
-    (new-address! [this]))
+    (send-amounts! [this amounts] (println "sending" amounts))
+    (new-address! [this]
+        (swap! fake-addresses conj
+            (str "newest-address" (swap! findex inc)))))


Transform one-arg if to when

Transform one-arg if to when

--- src/braid/client/events.cljs
+++ src/braid/client/events.cljs
@@ -123,7 +123,7 @@
 (reg-event-fx
   :new-message
   (fn [{state :db :as cofx} [_ data]]
-    (if-not (string/blank? (data :content))
+    (when-not (string/blank? (data :content))
       (let [message (schema/make-message
                       {:user-id (helpers/current-user-id state)
                        :content (identify-mentions state (data :content))
@@ -141,10 +141,8 @@
            2000
            (fn [reply]
              (when (not= :braid/ok reply)
-               ; TODO
                (dispatch [:display-error [(str :failed-to-send (message :id))
                                           "Message failed to send!"]])
-               ; TODO
                (dispatch [:set-message-failed message]))))
          :db (-> state
                  (helpers/add-message message)


CMR-1885 Addressed issues with pull request

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
@@ -80,10 +80,10 @@
                                        :NumberOfOrbits 2.0
                                        :StartCircularLatitude 50.0}}
      :TilingIdentificationSystems [{:TilingIdentificationSystemName "Tiling System Name"
-                                     :Coordinate1 {:MinimumValue 1.0
-                                                   :MaximumValue 10.0}
-                                     :Coordinate2 {:MinimumValue 1.0
-                                                   :MaximumValue 10.0}}]
+                                    :Coordinate1 {:MinimumValue 1.0
+                                                  :MaximumValue 10.0}
+                                    :Coordinate2 {:MinimumValue 1.0
+                                                  :MaximumValue 10.0}}]
      :AccessConstraints {:Description "Restriction Comment: Access constraints"
                          :Value "0"}
      :UseConstraints "Restriction Flag: Use constraints"
@@ -354,23 +354,6 @@
     (seq? x)    (seq (keep prune-empty-maps x))
     :else x))

-(defn- prune-nil-maps
-  "If x is a map, returns nil if all of the map's values are nil, otherwise returns the map with
-  prune-empty-maps applied to all values. If x is a collection, returns the result of keeping the
-  non-nil results of calling prune-empty-maps on each value in x."
-  [x]
-  (cond
-    (map? x) (let [pruned (reduce (fn [m [k v]]
-                                    (assoc m k (prune-empty-maps v)))
-                                  x
-                                  x)]
-               (when (seq (keep val pruned))
-                 pruned))
-    (vector? x) (when-let [pruned (prune-empty-maps (seq x))]
-                  (vec pruned))
-    (seq? x)    (seq (keep prune-empty-maps x))
-    :else x))
-
 (defmulti ^:private convert-internal
   "Returns UMM collection that would be expected when converting the source UMM-C record into the
   destination XML format and parsing it back to a UMM-C record."
@@ -693,17 +676,15 @@
     aas
     (conj aas (cmn/map->AdditionalAttributeType {:Name attribute-name
                                                  :Description (format "Root SERF %s Object" attribute-name)
-                                                 :Value su/not-provided
-                                                 :Group nil}))))
+                                                 :Value su/not-provided}))))

 (defn- default-serf-additional-attributes
   "Modifies attributes in serf from expected-conversion"
   [aa]
-  (let [u-date (:UpdateDate aa)]
   (-> aa
       (select-keys [:Description :Name :Value :Group :UpdateDate :DataType :Value])
-      (assoc :Name (or (:Name aa) su/not-provided))
-      (cmn/map->AdditionalAttributeType))))
+      (assoc :Name (get aa :Name su/not-provided))
+      (cmn/map->AdditionalAttributeType)))

 (defn- fix-serf-aa-update-date-format
   "Fixes SERF update-date format to conform to a specific rule"
@@ -711,6 +692,7 @@
   (if-let [u-date (:UpdateDate aa)]
     (assoc aa :UpdateDate (t/date-time (t/year u-date) (t/month u-date) (t/day u-date)))
     aa))
+
 (defn- fix-expected-serf-additional-attributes
   "Check and see if Metadata_Name and Metadata_Version are in serf additional attributes.
   If not, you need to inject them so that a comparison will work"
@@ -719,11 +701,17 @@
       (default-serf-required-additional-attributes "Metadata_Name")
       (default-serf-required-additional-attributes "Metadata_Version")))

+(defn- convert-serf-additional-attributes
+  [additional-attributes]
+  (fix-expected-serf-additional-attributes
+    (vec (for [attribute additional-attributes]
+      (-> attribute
+          default-serf-additional-attributes
+          fix-serf-aa-update-date-format)))))
+
 (defn- expected-serf-contacts
   [contacts]
   (seq (filter #(#{"email" "phone" "fax"} (:Type %)) contacts)))
-
-

 (defn- make-sure-organization-exists
   "Make sure a UMM-S Responsibilities element contains exactly one role that can correlate
@@ -731,7 +719,7 @@
   [resps]
   (if (some #(= serf-organization-role (:Role %)) resps)
     (concat (remove #(= serf-organization-role (:Role %)) resps)
-          (take 1 (filter #(= serf-organization-role (:Role %)) resps)))
+            (take 1 (filter #(= serf-organization-role (:Role %)) resps)))
     (conj resps
           (cmn/map->ResponsibilityType
             {:Role serf-organization-role
@@ -752,43 +740,40 @@

 (defn- serf-expected-person
   [person]
-   (-> person
-    (assoc
-    :Uuid nil
-    :FirstName (:FirstName person)
-    :MiddleName (:MiddleName person)
-    :LastName (or (:LastName person) su/not-provided))
-    cmn/map->PersonType))
+  (-> person
+      (assoc
+        :Uuid nil
+        :FirstName (:FirstName person)
+        :MiddleName (:MiddleName person)
+        :LastName (or (:LastName person) su/not-provided))
+      cmn/map->PersonType))

 (defn- remove-organization-role-and-related-urls
   "Removes an organization-role and related-urls if present from a UMM-S Responsibility"
   [resp]
-  (cmr.common.dev.capture-reveal/capture-all)
   (-> resp
-  (update-in [:Party :Person] serf-expected-person)
-  (assoc-in [:Party :OrganizationName] nil)
-  (assoc-in [:Party :RelatedUrls] nil)))
+      (update-in [:Party :Person] serf-expected-person)
+      (assoc-in [:Party :OrganizationName] nil)
+      (assoc-in [:Party :RelatedUrls] nil)))

 (defn- fix-organization-name-in-party
   "Modifies generated UMM-S Responsibility to conform to SERF rules"
   [resp]
-  (cmr.common.dev.capture-reveal/capture-all)
   (let [{:keys [Role Party]} resp]
     ;; SERF only recognizes OrganizationName under a RESOURCEPROVIDER role.
     (if (= serf-organization-role Role)
       (-> resp
-          (update-in [:Party :Person] #(or % (cmn/map->PersonType {:LastName su/not-provided})))
-          (update-in [:Party :OrganizationName] #(or %
-                                                    (cmn/map->OrganizationNameType
-                                                      {:ShortName su/not-provided
-                                                       :Uuid nil})))
+          (update-in [:Party :Person] (fn [p] (or p (cmn/map->PersonType {:LastName su/not-provided}))))
+          (update-in [:Party :OrganizationName] (fn [o] (or o
+                                                            (cmn/map->OrganizationNameType
+                                                              {:ShortName su/not-provided
+                                                               :Uuid nil}))))
           (assoc-in [:Party :OrganizationName :Uuid] nil)
           (assoc-in [:Party :Person :Uuid] nil))
       (let [resp (remove-organization-role-and-related-urls resp)]
         (if (seq (:Person (:Party resp)))
           resp
-          (-> resp
-            (assoc-in [:Party] (cmn/map->PersonType {:LastName su/not-provided}))))))))
+          (assoc-in resp [:Party] (cmn/map->PersonType {:LastName su/not-provided})))))))

 (defn- serf-expected-addresses
   "Modify UMM-S Addresses to conform to SERF rules"
@@ -807,29 +792,26 @@

 (defn- expected-related-urls-for-serf-party
   [related-urls]
-  (seq
-    (for [related-url (take 1 related-urls)]
-      (cmn/map->RelatedUrlType {:URLs (take 1 (:URLs related-url))}))))
+  (when-let [related-url (first related-urls)]
+    [(cmn/map->RelatedUrlType {:URLs (take 1 (:URLs related-url))})]))

 (defn- expected-serf-responsibility
   [resp]
-  (cmr.common.dev.capture-reveal/capture resp)
   (-> resp
       (update-in [:Party :RelatedUrls] expected-related-urls-for-serf-party)
       fix-organization-name-in-party
       (update-in [:Party :Contacts] expected-serf-contacts)
-      (update-in [:Party] remove-party-elements-not-in-serf)
-      ))
+      (update-in [:Party] remove-party-elements-not-in-serf)))

 (defn- filter-unused-serf-datetypes
   [dates]
-  (seq (remove #(= "DELETE" (:Type %)) dates)))
+  (remove #(= "DELETE" (:Type %)) dates))

 (defn- filter-unique-serf-dates
   [dates]
   (let [dates-by-type (group-by :Type dates)]
-     (keep #(first (get dates-by-type %))
-           ["CREATE" "UPDATE" "REVIEW"])))
+    (keep #(first (get dates-by-type %))
+          ["CREATE" "UPDATE" "REVIEW"])))

 (defn- expected-metadata-dates-for-serf
@@ -842,11 +824,12 @@
 (defn- fix-publication-reference-url
   [some-url]
   (when some-url
-  (cmn/map->RelatedUrlType {:URLs (->> some-url :URLs (take 1))})))
+    (cmn/map->RelatedUrlType {:URLs (->> some-url :URLs (take 1))})))

 (defn- expected-serf-service-citation
   [citation]
-  (assoc citation :DOI nil
+  (assoc citation
+         :DOI nil
          :ReleasePlace nil
          :SeriesName nil
          :DataPresentationForm nil
@@ -856,13 +839,8 @@
          :OtherCitationDetails nil
          :RelatedUrl (fix-publication-reference-url (:RelatedUrl citation))))

-(defn- convert-to-vector
-  [some-list]
-  (vec some-list))
-
 (defn remove-empty-objects
   [objects]
-  (cmr.common.dev.capture-reveal/capture-all)
   (filter #(some val %) objects))

 (defn- fix-serf-doi
@@ -879,8 +857,7 @@

 (defn fix-serf-project
   [project]
-  (-> project
-      (assoc :EndDate nil :StartDate nil :Campaigns nil)))
+  (assoc project :EndDate nil :StartDate nil :Campaigns nil))

 (defn fix-metadata-associations
   [metadata-association]
@@ -890,34 +867,28 @@

 (defmethod convert-internal :serf
   [umm-service _]
-  (cmr.common.dev.capture-reveal/capture-all)
   (-> umm-service
       (update-in [:Responsibilities] make-sure-organization-exists)
       (update-in-each [:Responsibilities] expected-serf-responsibility)
-      (update-in-each [:AdditionalAttributes] default-serf-additional-attributes)
-      (update-in [:AdditionalAttributes] convert-to-vector)
-      (update-in [:AdditionalAttributes] fix-expected-serf-additional-attributes)
-      (update-in-each [:AdditionalAttributes] fix-serf-aa-update-date-format)
+      (update-in [:AdditionalAttributes] convert-serf-additional-attributes)
       (update-in [:RelatedUrls] expected-related-urls-for-dif-serf)
       (update-in [:MetadataDates] expected-metadata-dates-for-serf)
       (update-in-each [:ServiceCitation] expected-serf-service-citation)
       (update-in [:ServiceCitation] remove-empty-objects)
       (update-in [:ServiceCitation] seq)
       (update-in-each [:Projects] fix-serf-project)
-      (update-in-each [:Platforms] assoc :Type nil :Characteristics nil)
       (update-in [:AccessConstraints] fix-access-constraints)
       (update-in-each [:MetadataAssociations] assoc :Description nil :Type nil :Version nil)
       (update-in [:MetadataAssociations] fix-metadata-associations)
       (update-in-each [:PublicationReferences] fix-serf-doi)
       (update-in-each [:PublicationReferences] update-in [:RelatedUrl] fix-publication-reference-url)
-      (assoc :Platforms nil)
-      ))
+      (assoc :Platforms nil)))

 ;; ISO 19115-2

 (defn propagate-first
   "Returns coll with the first element's value under k assoc'ed to each element in coll.
-
+
   Example: (propagate-first :x [{:x 1} {:y 2}]) => [{:x 1} {:x 1 :y 2}]"
   [k coll]
   (let [v (get (first coll) k)]
@@ -1175,9 +1146,9 @@
   (if (contains? #{:serf} metadata-format)
     record
     (reduce (fn [r field]
-            (assoc r field nil))
-          record
-          not-implemented-fields)))
+              (assoc r field nil))
+            record
+            not-implemented-fields)))

 ;;; Public API


Clearer names for arguments that are functions.

--- src/clj/com/rpl/specter.cljx
+++ src/clj/com/rpl/specter.cljx
@@ -270,11 +270,11 @@
     (next-fn (afn structure))
     ))

-(defpath parser [parse unparse]
-  (select* [this structure next-fn]
-    (next-fn (parse structure)))
-  (transform* [this structure next-fn]
-    (unparse (next-fn (parse structure)))
+(defpath parser [parse-fn unparse-fn]
+  (select* [this structure next-fn]
+    (next-fn (parse-fn structure)))
+  (transform* [this structure next-fn]
+    (unparse-fn (next-fn (parse-fn structure)))
     ))

 (defn selected?


pdf fix test

pdf fix test

--- src/clj/salava/badge/pdf.clj
+++ src/clj/salava/badge/pdf.clj
@@ -54,7 +54,7 @@
 (defn process-markdown-helper [markdown id context]
   (let [file (java.io.File/createTempFile "markdown" ".pdf")]
     (try
-      (pdf/pdf [{} (markdown->clj-pdf {:spacer {:extra-starting-value 1 :allow-extra-line-breaks? true :single-value 2} :wrap {:global-wrapper :paragraph}} markdown)] (.getAbsolutePath file))
+      (pdf/pdf [{} (markdown->clj-pdf {:wrap {:global-wrapper :paragraph}} markdown)] (.getAbsolutePath file))
       true
       (catch Exception e
         (log/error (str "Markdown Error in Badge id:  "id " in " context))


data export fix

data export fix

--- src/clj/salava/user/data.clj
+++ src/clj/salava/user/data.clj
@@ -195,28 +195,28 @@
                                                                                template #(cons [:paragraph][[:paragraph
                                                                                [:chunk.chunk (str (t :badge/BadgeID ul) ": ")][:chunk (str (or (:badge_id b ) "-"))]"\n"
                                                                                [:chunk.chunk (str (t :badge/Name ul) ": ") ][:chunk (or (:name %) "-")]"\n"
-                                                                                (when-not (blank? (:description %))
+                                                                                (when-not (blank? (str (:description %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :page/Description ul) ": ")][:chunk (str (:description %))]"\n"])
-                                                                                (when-not (blank? (:image_file %))
+                                                                                (when-not (blank? (str (:image_file %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Imagefile ul) ": ")][:chunk (str site-url "/"(:image_file %))]"\n"])
-                                                                                (when-not (blank? (:issuer_content_name %))
+                                                                                (when-not (blank? (str (:issuer_content_name %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Issuedby ul) ": ")] [:chunk (str (:issuer_content_name %)"  ")]])
-                                                                                (when-not (blank? (:issuer_content_url %))
+                                                                                (when-not (blank? (str (:issuer_content_url %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Issuerurl ul) ": ")][:chunk (str (:issuer_content_url %))]"\n"])
-                                                                                (when-not (blank? (:issuer_contact %))
+                                                                                (when-not (blank? (str (:issuer_contact %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Issuercontact ul) ": ")] [:chunk (str (:issuer_contact %))]"\n"])
-                                                                                (when-not (blank? (:creator_name %))
+                                                                                (when-not (blank? (str (:creator_name %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Createdby ul) ": ")][:chunk (str (:creator_name %))]"\n"])
-                                                                                (when-not (blank? (:creator_url %))
+                                                                                (when-not (blank? (str (:creator_url %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Creatorurl ul) ": ")][:chunk (str (:creator_url %))]"\n"])
-                                                                                (when-not (blank? (:creator_email %))
+                                                                                (when-not (blank? (str (:creator_email %)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Creatorcontact ul) ": ")][:chunk (str (:creator_email %))]"\n"])
                                                                                (when-not (blank? (str (:criteria_url %)))
@@ -225,13 +225,13 @@
                                                                                (when-not (blank? (str (:criteria_content %)))
                                                                                [:paragraph
                                                                                [:chunk.chunk (str (t :badge/Criteria ul) ": ")][:paragraph (strip-html-tags (:criteria_content %))]"\n"])
-                                                                                (when-not (blank? (:status b))
+                                                                                (when-not (blank? (str (:status b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :user/Status ul) ": ")][:chunk  (capitalize (str (t (keyword (str "social/"(:status b))) ul) "  "))]])
                                                                                (when-not (blank? (str (:verified_by_obf b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Verifiedbyobf ul) ": ")][:chunk (str (if (true? (:verified_by_obf b)) (t :core/Yes ul) (t :core/No ul)) "  ")]])
-                                                                                (when-not (blank? (:issued_by_obf b))
+                                                                                (when-not (blank? (str (:issued_by_obf b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Issuedbyobf ul) ": ")][:chunk (str (if (true? (:issued_by_obf b)) (t :core/Yes ul) (t :core/No ul)))]"\n"])
                                                                                (when (not-empty (:tags b))
@@ -249,14 +249,14 @@
                                                                                (when-not (blank? (str (:revoked b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Revoked ul) ": ")] [:chunk (str (if (true? (:revoked b)) (t :core/Yes ul) (t :core/No ul)) "  ")]])
-                                                                                (when-not (blank? (:visibility b) )
+                                                                                (when-not (blank? (str (:visibility b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Badgevisibility ul) ": ")] [:chunk (t (keyword (str "core/" (capitalize (:visibility b)))) ul)]"\n"])

-                                                                                (when-not (blank? (:obf_url b))
+                                                                                (when-not (blank? (str (:obf_url b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/OBFurl ul) ": ")] [:chunk (:obf_url b)]"\n"])
-                                                                                (when-not (blank? (:assertion_url more-badge-info))
+                                                                                (when-not (blank? (str (:assertion_url more-badge-info)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Assertionurl ul) ": ")] [:chunk.link (str (:assertion_url more-badge-info))]"\n"])
                                                                                (when-not (blank? (str (:assertion_json more-badge-info)))
@@ -266,7 +266,7 @@
                                                                                (when-not (blank? (str (:rating more-badge-info)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Badgerating ul) ": ") ] [:chunk (str (:rating more-badge-info) "  ")]])
-                                                                                (when-not (blank? (:evidence_url more-badge-info))
+                                                                                (when-not (blank? (str (:evidence_url more-badge-info)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Evidenceurl ul) ": ")] [:chunk (str (:evidence_url more-badge-info) " ")]]"\n"
                                                                                )


cleanup

cleanup

--- src/cljs/scrabble/views.cljs
+++ src/cljs/scrabble/views.cljs
@@ -51,10 +51,6 @@
                :class "tile-input"
                :on-change #(dispatch [:set-tile idx (-> % .-target .-value)])}])))

-(defn sample-form-two []
-  (fn []
-    [:div "Hello"]))
-
 (defn available-letters []
   (fn []
     (into


amp analytics fix gtag 3

amp analytics fix gtag 3

--- src/clojure/nossal/data.cljc
+++ src/clojure/nossal/data.cljc
@@ -54,10 +54,9 @@
                    :url "https://noss.al"})

 (def data-analytics
-  {:vars {:gtag_id (ga-tracking-id)}
-   (ga-tracking-id) {:config {:groups "default"}}
-   :triggers {;:trackPageview {:on "visible" :request "pageview"}
-              :outboundLinks {:on "click"
+  {:vars {:gtag_id (ga-tracking-id)
+          :config {(ga-tracking-id) {:groups "default"}}}
+   :triggers {:outboundLinks {:on "click"
                               :selector "a.out"
                               :request "event"
                               :vars {:eventCategory "outbound"


boot -u to 2.7.1; boot-logservice to 1.2.0

--- build.boot
+++ build.boot
@@ -12,8 +12,8 @@
                   [clj-wallhack "1.0.1"]

                   ;; boot clj
-                  [boot/core               "2.6.0"           :scope "provided"]
-                  [adzerk/boot-logservice  "1.0.1"           :scope "test"]
+                  [boot/core               "2.7.1"           :scope "provided"]
+                  [adzerk/boot-logservice  "1.2.0"           :scope "test"]
                   [adzerk/bootlaces        "0.1.13"          :scope "test"]])

 (require '[adzerk.bootlaces :refer :all]


Add dedicated task to build with optimizations (for gh-pages)

--- build.boot
+++ build.boot
@@ -31,6 +31,14 @@
   (comp
     (cljs :source-map true
           :optimizations :none
+          :pretty-print true
+          :compiler-options {:devcards true})))
+
+(deftask build-docs
+  []
+  (comp
+    (cljs :optimizations :advanced
+          :pretty-print false
           :compiler-options {:devcards true})))

 (deftask dev
@@ -41,3 +49,8 @@
     (reload)
     (build-dev)
     (serve :dir "target")))
+
+(deftask docs
+  []
+  (comp
+    (build-docs)))


Add TCP sample data.

Add TCP sample data.


New function job-name->environment to distinguish environment for given job(s)

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -60,6 +60,13 @@
           (if book-name
               (clojure.string/replace book-name "_" " ")
               "unknown")))
+
+(defn job-name->environment
+    [job-name preview-jobs-suffix stage-jobs-suffix prod-jobs-suffix]
+    (cond
+        (.endsWith job-name preview-jobs-suffix) :preview
+        (.endsWith job-name stage-jobs-suffix)   :stage
+        (.endsWith job-name prod-jobs-suffix)    :prod))

 (defn compute-job-status
     [jenkins-job-status buildable?]


Attach wiring metadata to the view when wiring it up.

--- src/fm/simrunner/gui/wiring.clj
+++ src/fm/simrunner/gui/wiring.clj
@@ -68,8 +68,13 @@
   view)

 (defn wire-up! [view on-event]
-  (io!
-    (-> view
-        (wire-toolbar-buttons on-event)
-        (wire-inputs on-event))))
+  (io! "Do not wire-up a view in a transaction!"
+    (let [wired?   (atom true)
+          on-event (fn [& args]
+                     (when @wired?
+                       (apply on-event args)))]
+      (-> view
+          (wire-toolbar-buttons on-event)
+          (wire-inputs on-event)
+          (vary-meta assoc ::wiring {:wired? wired?})))))


removed unneeded code

removed unneeded code

--- src/ctia/stores/es/query.clj
+++ src/ctia/stores/es/query.clj
@@ -16,8 +16,7 @@
             filters)))

 (defn filter-map->terms-query
-  "transforms a filter map to en ES terms query
-   only supports one level of nesting"
+  "transforms a filter map to en ES terms query"
   [filter-map]

   (let [terms (map (fn [[k v]]
@@ -29,7 +28,7 @@
       :filter (q/bool {:must (nested-terms terms)})}}))

 (defn indicators-by-judgements-query
-  "nested filter to get all indicators
+  "filter to get all indicators
    matching a set of judgement ids"
   [judgement-ids]


fixed function name of HTML generator for ordered list

--- src/distillery/view/html.clj
+++ src/distillery/view/html.clj
@@ -93,7 +93,7 @@
   [css-class items]
   {:tag :ul :attrs {:class css-class} :content (vec items)})

-(defn ulist
+(defn olist
   "Creates an ordered list with a given CSS class and a sequence of list items."
   [css-class items]
   {:tag :ol :attrs {:class css-class} :content (vec items)})


Extend repo fn with 2-arity version

Extend repo fn with 2-arity version

--- src/hu/ssh/github_changelog.clj
+++ src/hu/ssh/github_changelog.clj
@@ -8,8 +8,8 @@

 (defn repo
   "Gets the repository from its name"
-  [name]
-  (vector "pro" name))
+  ([name] (repo "pro" name))
+  ([org repo] [org repo]))

 (defn parse-semver
   "Checks for semantic versions with or without v predicate"


Property invoke the asset-resolver, passing a nil options

--- src/io/aviso/twixt/fs_cache.clj
+++ src/io/aviso/twixt/fs_cache.clj
@@ -21,7 +21,7 @@
   [asset-resolver asset-path cached-checksum]
   (->
     asset-path
-    asset-resolver
+    (asset-resolver nil)
     :checksum
     (= cached-checksum)))


fix labels

fix labels

--- src/jarkeeper/views/project.clj
+++ src/jarkeeper/views/project.clj
@@ -129,7 +129,7 @@
        [:section.installation-instructions.row
         [:h2 "Clojars downloads badge - Markdown with SVG image"]
         [:code
-           (str "[![Dependencies Status]"
+           (str "[![Downloads]"
                 "(https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
@@ -147,7 +147,7 @@
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
-                "\" title=\"Dependencies status\"><img src=\"https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)


Secret test added to max value problem

Secret test added to max value problem

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -379,4 +379,5 @@
             :description "Write a function which takes a variable number of parameters and returns the maximum value."
             :tags ["easy" "core-functions"]
             :tests ["(= (__ 1 8 3 4) 8)"
-		    "(= (__ 30 20) 30)"]})))+		    "(= (__ 30 20) 30)"]
+	    :secret-tests ["(= (__ 45 67 11) 67)"]})))


parse M from input

parse M from input

--- src/hackerrank/even_tree.clj
+++ src/hackerrank/even_tree.clj
@@ -11,6 +11,23 @@

 (defn numbers [string]
   (map parseInt (split string #" ")))
+
+(definterface INode
+  (get-left [])
+  (get-right [])
+  (insert [k v]))
+
+(deftype Node
+  [key
+   val
+   ^:volatile-mutable ^INode left
+   ^:volatile-mutable ^INode right]
+
+  INode
+  (get-left [_] left)
+  (get-right [_] right)
+
+  (insert [this k v]))

 (defn even-tree
@@ -28,3 +45,7 @@

 ;; uncomment after copy-paste to hackerrank buffer
 ;; (even-tree)
+
+;; tree-seq
+;; http://macromancy.com/2014/04/09/data-structures-clojure-trees.html
+;; http://www.ibm.com/developerworks/library/j-treevisit/


Autowhitespace would sneak in and cause ambiguity

By squishing all into one regexp, no more whitespace issues

--- src/instaparse_c/comment.clj
+++ src/instaparse_c/comment.clj
@@ -8,9 +8,7 @@
   {:c11/comment (altnt :c11.comment/mutliple-lines
                        :c11.comment/single-line)
    :c11.comment/mutliple-lines
-   (cat (hs "/*")
-        (regexp "([\\s\\S])*?(?=\\*/)")
-        (hs "*/"))
+   (regexp "/\\*([\\s\\S])*?(?=\\*/)\\*/")
    :c11.comment/single-line
    (cat (hs "//")
         (regexp ".*")


test hook

test hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 64
+                 3  {:db/id 3 :person/name "Allie" :person/age 63
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}


Call correct driver implementation for sync DB

--- src/metabase/api/meta/db.clj
+++ src/metabase/api/meta/db.clj
@@ -6,7 +6,7 @@
             [metabase.api.common :refer :all]
             [metabase.db :refer :all]
             [metabase.driver :as driver]
-            [metabase.driver.postgres.sync :as pgsync]
+            [metabase.driver.sync :as sync]
             (metabase.models common
                              [hydrate :refer [hydrate]]
                              [database :refer [Database]]
@@ -68,7 +68,7 @@

 (defendpoint POST "/:id/sync" [id]
   (let-404 [db (sel :one Database :id id)]   ; TODO - run sync-tables asynchronously
-           (pgsync/sync-tables db))          ; TODO - this only works for Postgres right now (since that's the only driver we have)
+           (sync/sync-tables db))
   {:status :ok})

 (define-routes)


loop-recur is working.

loop-recur is working.

--- src/numerics/runge_kutta.clj
+++ src/numerics/runge_kutta.clj
@@ -46,9 +46,9 @@
 ;      [(* dt (Math/pow (/ tol error-estimate) 0.25)) y])))

 ;;;; 1 D
-(defn ki [f tn yn dt { :keys [a c]} k i]
-  (f [(+ tn (* dt (get c i 0)))
-      (+ yn (* dt (reduce + 0 (for [j (range (count k))] (* (get-in a [i j] 0) (get k j 0))))))]))
+(defn ki [f tn yn dt a c k]
+  (f [(+ tn (* dt c))
+      (+ yn (* dt (reduce + 0 (for [j (range (count k))] (* (a j) (get k j 0))))))]))

 (defn f [[x y]] (- (* 4.0 (Math/exp (* 0.8 x))) (* 0.5 y)))
 (prn (ks [f] [0 2] 0.5 tableaus/classic-fourth-order))
@@ -79,21 +79,24 @@
 ;    (f [(+ tn (* dt (get c i 0)))
 ;        (+ yn (* dt (reduce + 0 (for [j (range (count c))] (* (get-in a [i j] 0) (get k j 0))))))])))

-;(loop [k []]
-;  (if true
-;  k
-;  (recur )))
+(prn "XXXXXXXXXXXXXXXX")
+;(def k0 (ki f tn yn dt a c []))
+;(prn k0)
+;(def k1 (ki f tn yn dt (-> a rest) (-> c rest) [k0]))
+;(prn k1)
+;(def k2 (ki f tn yn dt (-> a rest rest) (-> c rest rest) [k0 k1]))
+;(prn k2)
+;(def k3 (ki f tn yn dt (-> a rest rest rest) (-> c rest rest rest) [k0 k1 k2]))
+;(prn k3)
+;(def k4 (ki f tn yn dt (-> a rest rest rest rest) (-> c rest rest rest rest) [k0 k1 k2 k3]))
+;(prn k4)
+;(def k5 (ki f tn yn dt (-> a rest rest rest rest rest) (-> c rest rest rest rest rest) [k0 k1 k2 k3 k4]))
+;(prn k5)

-(def k0 (ki f tn yn dt tableaus/cash-karp [] 0))
-(prn k0)
-(def k1 (ki f tn yn dt tableaus/cash-karp [k0] 1))
-(prn k1)
-(def k2 (ki f tn yn dt tableaus/cash-karp [k0 k1] 2))
-(prn k2)
-(def k3 (ki f tn yn dt tableaus/cash-karp [k0 k1 k2] 3))
-(prn k3)
-(def k4 (ki f tn yn dt tableaus/cash-karp [k0 k1 k2 k3] 4))
-(prn k4)
-(def k5 (ki f tn yn dt tableaus/cash-karp [k0 k1 k2 k3 k4] 5))
-(prn k5)
+(prn "YYYYYYYYY")
+(def kk (loop [ks [] ai a ci c]
+  (if-not (first ci)
+    ks
+    (recur (conj ks (ki f tn yn dt (first ai) (first ci) ks)) (rest ai) (rest ci)))))

+(prn kk)


Do not delete aeron directory if not using embedded-driver

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -215,10 +215,10 @@
           subscribers (mapv (fn [stream-id]
                               (start-subscriber! bind-addr port stream-id virtual-peers decompress-f receive-idle-strategy))
                             (range subscriber-count))]
-      (.addShutdownHook (Runtime/getRuntime)
-                        (Thread. (fn []
-                                   (.deleteAeronDirectory ^MediaDriver$Context media-driver-context))))
-
+      (when embedded-driver?
+        (.addShutdownHook (Runtime/getRuntime)
+                          (Thread. (fn []
+                                     (.deleteAeronDirectory ^MediaDriver$Context media-driver-context)))))
       (assoc component
              :bind-addr bind-addr
              :external-addr external-addr


Don't throw an error on JVM shutdown hook if Aeron directory is gone.

After turning up the log levels sufficiently high, we've revealed
that deleting the Aeron directories on shutdown virtually always
throws a not-found exception. We've never seen this before since
JVM shutdown hook threads suppress their exceptions, and we didn't
have the log levels up high enough to see it.

This patch suppresses the exception -- which looks scary when
seen from the console, but is ultimately harmless.

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -212,10 +212,13 @@
           subscribers (mapv (fn [stream-id]
                               (start-subscriber! bind-addr port stream-id virtual-peers decompress-f receive-idle-strategy))
                             (range subscriber-count))]
-      (when embedded-driver?
-        (.addShutdownHook (Runtime/getRuntime)
-                          (Thread. (fn []
-                                     (.deleteAeronDirectory ^MediaDriver$Context media-driver-context)))))
+      (when embedded-driver?
+        (.addShutdownHook (Runtime/getRuntime)
+                          (Thread.
+                           (fn []
+                             (try
+                               (.deleteAeronDirectory ^MediaDriver$Context media-driver-context)
+                               (catch java.nio.file.NoSuchFileException nfe))))))
       (assoc component
              :bind-addr bind-addr
              :external-addr external-addr


Update docstrings

Update docstrings

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -134,7 +134,7 @@
     matches))

 (defn note-map
-  "Takes a match array returned by a regexp match and returns a map of
+  "Takes a string representing a midi note such as C4 and returns a map of
   note info"
   [midi-string]
   (let [[match pitch-class octave] (validate-midi-string! midi-string)
@@ -146,7 +146,6 @@
      :octave      (Integer. octave)
      :interval    interval
      :midi-note   (octave-note octave interval)}))
-

 (defn mk-midi-string
   "Takes a string or keyword representing a pitch and a number
@@ -342,8 +341,10 @@

 (defn degree->interval
   "Converts the degree of a scale given as a roman numeral keyword and
-  converts it to the number of intervals (semitones) from the tonic of
+  converts it to the number of semitones from the tonic of
   the specified scale.
+
+  (degree->interval :ii :major) ;=> 2

   Trailing #, b, + - represent sharps, flats, octaves up and down
   respectively.  An arbitrary number may be added in any order."


CMR-2482: Removed debug output

CMR-2482: Removed debug output

--- metadata-db-app/src/cmr/metadata_db/services/concept_constraints.clj
+++ metadata-db-app/src/cmr/metadata_db/services/concept_constraints.clj
@@ -88,7 +88,6 @@
                                                    transaction-revisions))]
     (some (fn [tran-rev]
             (let [{:keys [transaction-id revision-id]} tran-rev]
-              (println "transaction-id: " transaction-id)
               (or (when (and (< revision-id this-revision-id)
                              (> transaction-id this-transaction-id))
                         [(format (str "Revision [%d] of concept [%s] has transaction-id [%d] "


updating dependencies

updating dependencies

--- resources/leiningen/new/ow_app/project.clj
+++ resources/leiningen/new/ow_app/project.clj
@@ -6,10 +6,10 @@
   :min-lein-version "2.6.1"

   :dependencies [;;; core:
-                 [org.clojure/clojure       "1.8.0"]    ;; the language (jvm)
-                 [org.clojure/clojurescript "1.9.562"]  ;; the language (js)
-                 [org.clojure/core.async    "0.2.395"]  ;; async communication channels
-                 [environ                   "1.0.3"]    ;; handling environment vars
+                 [org.clojure/clojure       "1.9.0-alpha17"]    ;; the language (jvm)
+                 [org.clojure/clojurescript "1.9.562"]          ;; the language (js)
+                 [org.clojure/core.async    "0.3.443"]          ;; async communication channels
+                 [environ                   "1.0.3"]            ;; handling environment vars

                  ;;; program flow / lifecycle:
                  [integrant       "0.4.1"]           ;; component lifecycle management
@@ -19,7 +19,7 @@

                  ;;; http:
-                 [ring/ring-core         "1.4.0"]  ;; basic middlewares
+                 [ring/ring-core         "1.6.2"]  ;; basic middlewares
                  [http-kit               "2.2.0"]  ;; http server
                  [ring/ring-defaults     "0.2.1"]  ;; common middlewares
                  [bk/ring-gzip           "0.1.1"]
@@ -27,9 +27,10 @@
                  [ring.middleware.logger "0.5.0"]

                  ;;; api:
-                 [metosin/compojure-api "1.1.9"]   ;; rest api with swagger docs
-                 [liberator             "0.14.1"]  ;; correct http responses
-                 [ataraxy               "0.4.0"]   ;; bidirectional routing
+                 [metosin/compojure-api "2.0.0-alpha5"]   ;; rest api with swagger docs
+                 [metosin/spec-tools    "0.3.0"]          ;; for using clojure.spec as schema
+                 [liberator             "0.14.1"]         ;; correct http responses
+                 [ataraxy               "0.4.0"]          ;; bidirectional routing

                  ;;; html:
                  ;;; TODO: add preferred libs
@@ -66,7 +67,7 @@
                                   [figwheel-sidecar        "0.5.8"]
                                   [com.cemerick/piggieback "0.2.1"]
                                   [org.clojure/tools.nrepl "0.2.12"]
-                                  [ring/ring-devel         "1.4.0"]]
+                                  [ring/ring-devel         "1.6.2"]]
                    :plugins [[lein-figwheel "0.5.8"]]
                    :source-paths ["dev"]
                    :repl-options {:init-ns repl


fix improper quoting

fix improper quoting

--- plugins/matross/tasks/temp_file.clj
+++ plugins/matross/tasks/temp_file.clj
@@ -18,7 +18,7 @@

         :else
         `(let [~@(interleave bindings
-                             (map (fn [b] '(get-in (run-task conn {:type :temp-file}) [:data :path])) bindings))]
+                             (map (fn [b] `(get-in (run-task ~conn {:type :temp-file}) [:data :path])) bindings))]
            (try
              ~@body
              (finally


CMR-2201: Re-enabling fixture to try to fix broken test.

--- metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/cleanup_test.clj
+++ metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/cleanup_test.clj
@@ -15,7 +15,8 @@
 (use-fixtures :each (join-fixtures
                       [(util/reset-database-fixture {:provider-id "REG_PROV" :small false}
                                                     {:provider-id "SMAL_PROV1" :small true}
-                                                    {:provider-id "SMAL_PROV2" :small true})]))
+                                                    {:provider-id "SMAL_PROV2" :small true})
+                       tk/freeze-resume-time-fixture]))

 (defn concept-revision-exists?
   "Returns true if the revision of the concept exists"


Don't refer to clojure.core/count in metrics.meters

--- metrics-clojure-core/src/metrics/meters.clj
+++ metrics-clojure-core/src/metrics/meters.clj
@@ -1,4 +1,5 @@
 (ns metrics.meters
+  (:refer-clojure :except [count])
   (:use [metrics.utils :only (metric-name desugared-title)])
   (:import (com.yammer.metrics Metrics))
   (:import (com.yammer.metrics.core Meter))


add dot export & large scale SSSP test sketch

--- src/thi/ng/fabric/async.cljc
+++ src/thi/ng/fabric/async.cljc
@@ -205,7 +205,7 @@
         result)
       (execute! [_]
         (if-not (realized? result)
-          (let [t0  (System/nanoTime)]
+          (let [t0 (System/nanoTime)]
             (go
               (loop [verts (vertices (:graph ctx))]
                 (when-let [v (first verts)]
@@ -243,6 +243,30 @@
             result)
           (throw (IllegalStateException. "Context already executed once")))))))

+(defn dot
+     [path g flt]
+     (->> (vertices g)
+          (filter flt)
+          (mapcat
+           (fn [v]
+             (if-let [outs @(:outs v)]
+               (->> outs
+                    (map
+                     (fn [[k [_ opts]]]
+                       (str (:id v) "->" (:id k) "[label=" (pr-str opts) "];\n")))
+                    (cons
+                     (format
+                      "%d[label=\"%d (%s)\"];\n"
+                      (:id v) (:id v) (pr-str @v)))))))
+          (apply str)
+          (format "digraph g {
+node[color=black,style=filled,fontname=Inconsolata,fontcolor=white,fontsize=9];
+edge[fontname=Inconsolata,fontsize=9];
+ranksep=1;
+overlap=scale;
+%s}")
+          (spit path)))
+
 (def g (compute-graph))
 (def ctx (async-context {:graph g :processor eager-vertex-processor}))

@@ -254,27 +278,83 @@
    (fn [val uncollected]
      (if val (reduce min val uncollected) (reduce min uncollected)))))

-(def a (add-vertex! g {::val 0   ::collect-fn collect-sssp}))
-(def b (add-vertex! g {::val nil ::collect-fn collect-sssp}))
-(def c (add-vertex! g {::val nil ::collect-fn collect-sssp}))
-(def d (add-vertex! g {::val nil ::collect-fn collect-sssp}))
-
-(connect-to! a b signal-sssp 1)
-(connect-to! a c signal-sssp 3)
-(connect-to! b c signal-sssp 1)
-(connect-to! c d signal-sssp 1)
-
-;;(prn @(execute! ctx))
-
-(prn @a)
-(prn @b)
-(prn @c)
-(prn @d)
-
-
 (comment
-  (close-input! a)
-  (close-input! b)
-  (close-input! c)
-  (close-input! d)
-  )
+  (def a (add-vertex! g {::val 0   ::collect-fn collect-sssp}))
+  (def b (add-vertex! g {::val nil ::collect-fn collect-sssp}))
+  (def c (add-vertex! g {::val nil ::collect-fn collect-sssp}))
+  (def d (add-vertex! g {::val nil ::collect-fn collect-sssp}))
+
+  (connect-to! a b signal-sssp 1)
+  (connect-to! a c signal-sssp 3)
+  (connect-to! b c signal-sssp 1)
+  (connect-to! c d signal-sssp 1)
+
+  (prn @(execute! ctx))
+
+  (prn @a)
+  (prn @b)
+  (prn @c)
+  (prn @d))
+
+(defn make-strand
+  [verts e-length]
+  (let [n (count verts)
+        l (+ 1 (rand-int 3))
+        s (rand-int (- n (* l 2)))]
+    (reduce
+     (fn [acc i]
+       (let [v (+ (inc (peek acc)) (rand-int (/ (- n (peek acc)) 2)))]
+         (if (< v n)
+           (conj acc v)
+           (reduced acc))))
+     [s] (range l))))
+
+(defn sssp-test-linked
+  [g num-verts num-edges e-length]
+  (let [vspec {::collect-fn collect-sssp}
+        verts (->> (range num-verts)
+                   (map (fn [_] (add-vertex! g vspec)))
+                   (cons (add-vertex! g (assoc vspec ::val 0)))
+                   vec)]
+    (dotimes [i num-edges]
+      (->> (make-strand verts e-length)
+           (partition 2 1)
+           (map (fn [[a b]] (connect-to! (verts a) (verts b) signal-sssp 1)))
+           (doall)))
+    nil))
+
+(comment
+  (def g (compute-graph))
+  (def ctx (async-context {:graph g :processor eager-vertex-processor}))
+
+  (def types
+    '[animal vertebrae mammal human dog fish shark plant tree oak fir])
+
+  (def hierarchy
+    '[[animal vertebrae]
+      [vertebrae mammal]
+      [vertebrae fish]
+      [fish shark]
+      [mammal human]
+      [mammal dog]
+      [plant tree]
+      [tree oak]
+      [tree fir]])
+
+  (def rdfs-collect
+    (simple-collect
+     (fn [val incoming]
+       (reduce into val incoming))))
+
+  (def verts
+    (let [vspec {::collect-fn rdfs-collect
+                 ;;::score-collect-fn (constantly 1)
+                 ;;::score-signal-fn (constantly 1)
+                 }
+          verts (reduce
+                 (fn [acc v] (assoc acc v (add-vertex! g (assoc vspec ::val #{v}))))
+                 {} types)]
+      (doseq [[a b] hierarchy]
+        (connect-to! (verts a) (verts b) signal-forward nil))
+      verts)))
+


use new consul default prod tag

use new consul default prod tag

--- src/vignette/util/consul.clj
+++ src/vignette/util/consul.clj
@@ -4,7 +4,7 @@

 (def default-consul-hostname "localhost")
 (def default-consul-http-port 8500)
-(def default-service-query-tag "production")
+(def default-service-query-tag "prod")

 (def service-query-tag (env :consul-query-tag default-service-query-tag))


Guard against nil strings.

Guard against nil strings.

--- src-cljs/kixi/hecuba/tabs/hierarchy/property_details.cljs
+++ src-cljs/kixi/hecuba/tabs/hierarchy/property_details.cljs
@@ -120,10 +120,10 @@
     "Type Missing"))

 (defn fix-sensor-type [sensor-type]
-  (-> sensor-type
-      (clojure.string/replace "__SPACE__" " ")
-      (clojure.string/replace "__AMPERSAND__" "&")
-      (clojure.string/replace "__SLASH__" "/")))
+  (some-> sensor-type
+          (clojure.string/replace "__SPACE__" " ")
+          (clojure.string/replace "__AMPERSAND__" "&")
+          (clojure.string/replace "__SLASH__" "/")))

 ;; Change property_data to calcs and remove calcs from the let and all will be fine.
 (defn summary-stats [property_data owner]


Cleanup profiling code

Cleanup profiling code

--- src/clj/codejam_practice_solutions/practice/b_always_turn_left.clj
+++ src/clj/codejam_practice_solutions/practice/b_always_turn_left.clj
@@ -99,10 +99,9 @@
     :wall "⎕"
     :empty " "))

-(defn non-unknown-rows [{:keys [maze] :as labyrinth}]
-  (p :non-unknown-rows
-     (let [new-maze (vec (filter :row-has-wall maze))]
-       (assoc labyrinth :maze new-maze))))
+(defnp non-unknown-rows [{:keys [maze] :as labyrinth}]
+  (let [new-maze (vec (filter :row-has-wall maze))]
+    (assoc labyrinth :maze new-maze)))

 (defn get-cells-with-coordinates [maze]
   (for [[row-index row] (map vector (range) maze)
@@ -125,29 +124,27 @@
     (apply min (filter (comp not nil?)
                        indices))))

-(defn only-non-unknown-columns [{:keys [maze player] :as labyrinth}]
-  (p :only-non-unknown-columns
-     (let [row-cells (map :cells maze)
-           row-length (count (first row-cells))
-           earliest-column (first-non-unknown-index row-cells)
-           latest-column (first-non-unknown-index (map reverse row-cells))
-           new-maze (map (fn [row]
-                           (update-in row [:cells]
-                                      #(vec (take (- row-length
-                                                     latest-column
-                                                     earliest-column)
-                                                  (drop earliest-column %)))))
-                         maze)
-           new-player (update-in player [:x] - earliest-column)]
-       (-> labyrinth
-           (assoc :maze new-maze)
-           (assoc :player new-player)))))
-
-(defn compress-labyrinth [labyrinth]
-  (p :compress-labyrinth
-     (->> labyrinth
-          non-unknown-rows
-          only-non-unknown-columns)))
+(defnp only-non-unknown-columns [{:keys [maze player] :as labyrinth}]
+  (let [row-cells (map :cells maze)
+        row-length (count (first row-cells))
+        earliest-column (first-non-unknown-index row-cells)
+        latest-column (first-non-unknown-index (map reverse row-cells))
+        new-maze (map (fn [row]
+                        (update-in row [:cells]
+                                   #(vec (take (- row-length
+                                                  latest-column
+                                                  earliest-column)
+                                               (drop earliest-column %)))))
+                      maze)
+        new-player (update-in player [:x] - earliest-column)]
+    (-> labyrinth
+        (assoc :maze new-maze)
+        (assoc :player new-player))))
+
+(defnp compress-labyrinth [labyrinth]
+  (->> labyrinth
+       non-unknown-rows
+       only-non-unknown-columns))

 (defn render-labyrinth
   "Render a debug version of the labyrinth. Draws the player and all
@@ -271,12 +268,11 @@
       turn-player-right
       mark-unknown-as-empty-at-player-left))

-(defn move-route-and-back [{:keys [forward backward]}]
-  (p :move-route-and-back
-     (-> (create-unsolved-labyrinth (longest forward backward))
-         (move-route forward)
-         turn-around-at-end-of-labyrinth
-         (move-route backward))))
+(defnp move-route-and-back [{:keys [forward backward]}]
+  (-> (create-unsolved-labyrinth (longest forward backward))
+      (move-route forward)
+      turn-around-at-end-of-labyrinth
+      (move-route backward)))

 (defn get-rooms [maze]
   (->> (get-cells-with-coordinates maze)
@@ -307,17 +303,16 @@
           (can-walk-west row column maze)  (bit-or 2r0100)
           (can-walk-east row column maze)  (bit-or 2r1000)))

-(defn convert-labyrinth-to-solution-format [{:keys [maze] :as labyrinth}]
-  (p :convert-labyrinth-to-solution-format
-     (let [row-cells (vec (map :cells maze))
-           rooms (get-rooms maze)]
-       (map
-        (fn [row-of-rooms]
-          (->> row-of-rooms
-               (map (partial encode-room row-cells))
-               (map (partial format "%x"))
-               s/join))
-        rooms))))
+(defnp convert-labyrinth-to-solution-format [{:keys [maze] :as labyrinth}]
+  (let [row-cells (vec (map :cells maze))
+        rooms (get-rooms maze)]
+    (map
+     (fn [row-of-rooms]
+       (->> row-of-rooms
+            (map (partial encode-room row-cells))
+            (map (partial format "%x"))
+            s/join))
+     rooms)))

 (defn solve [line]
   (-> (parse-input line)
@@ -338,9 +333,9 @@
 (comment

   (profile :info :whatever
-           (solve (nth input-large 5)))
-
-  (solve-file "input-small-output.txt"
-              input-small)
-  (solve-file "input-large-output.txt"
-              (nth input-large 3)))
+           (solve-file "input-small-output.txt"
+                       input-small))
+
+  (profile :info :whatever
+           (solve-file "input-large-output.txt"
+                       input-large)))


In ants, move def of JFrame into comment to avoid it appearing when loading the project or when running tests.

--- src/com/nomistech/clojure_the_language/ants_by_rich_hickey.clj
+++ src/com/nomistech/clojure_the_language/ants_by_rich_hickey.clj
@@ -281,8 +281,6 @@
                                      (* scale dim)
                                      (* scale dim)))))

-(def frame (doto (new JFrame) (.add panel) .pack .show))
-
 (def animator (agent nil))

 (defn animation [x]
@@ -306,6 +304,7 @@
   ;; demo
   ;; (load-file "/Users/rich/dev/clojure/ants.clj")
   (do
+    (def frame (doto (new JFrame) (.add panel) .pack .show))
     (def ants (setup))
     (send-off animator animation)
     (dorun (map #(send-off % behave) ants))


(MAINT) Remove csr attrs and oid error logging

Previously, an error was logged if the configured CSR Attributes
file path or the configured Custom Trusted OID Mappings file
path failed an fs/file? check. However, Puppet has a default
value for both of these settings, meaning the error would be
logged on startup unless the user specifically adds those
configuration files.

This removes the logging of that error.

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -596,18 +596,17 @@
   "Parse the CSR attributes yaml file at the given path and create a list of
   certificate extensions from the `extensions_requests` section."
   [csr-attributes-file :- schema/Str]
-  (when csr-attributes-file
-    (if (fs/file? csr-attributes-file)
-      (let [csr-attrs (yaml/parse-string (slurp csr-attributes-file))
-            ext-req (:extension_requests csr-attrs)]
-        (map (fn [[oid value]]
-               {:oid      (or (get puppet-short-names oid)
-                              (name oid))
-                :critical false
-                :value    (str value)})
-             ext-req))
-      (log/error (format "%s is not a valid file path. CSR Attributes will not be loaded."
-                         csr-attributes-file)))))
+  (if (fs/file? csr-attributes-file)
+    (let [csr-attrs (yaml/parse-string (slurp csr-attributes-file))
+          ext-req (:extension_requests csr-attrs)]
+      (map (fn [[oid value]]
+             {:oid (or (get puppet-short-names oid)
+                       (name oid))
+              :critical false
+              :value (str value)})
+           ext-req))
+    (log/debugf "No CSR Attributes configuration file found at %s, CSR Attributes will not be loaded"
+                csr-attributes-file)))

 (schema/defn create-master-extensions :- (schema/pred utils/extension-list?)
   "Create a list of extensions to be added to the master certificate."
@@ -1224,13 +1223,12 @@
 (schema/defn ^:always-validate get-custom-oid-mappings :- (schema/maybe OIDMappings)
   "Given a path to a custom OID mappings file, return a map of all oids to
   shortnames"
-  [custom-oid-mapping-file :- (schema/maybe schema/Str)]
-  (when custom-oid-mapping-file
-    (if (fs/file? custom-oid-mapping-file)
-      (let [oid-mappings (:oid_mapping (yaml/parse-string (slurp custom-oid-mapping-file)))]
-        (into {} (for [[oid names] oid-mappings] [(name oid) (keyword (:shortname names))])))
-      (log/error (format "%s is not a valid file path. Custom OID Mappings will not be loaded."
-                         custom-oid-mapping-file)))))
+  [custom-oid-mapping-file :- schema/Str]
+  (if (fs/file? custom-oid-mapping-file)
+    (let [oid-mappings (:oid_mapping (yaml/parse-string (slurp custom-oid-mapping-file)))]
+      (into {} (for [[oid names] oid-mappings] [(name oid) (keyword (:shortname names))])))
+    (log/debugf "No custom OID mapping configuration file found at %s, custom OID mappings will not be loaded"
+                custom-oid-mapping-file)))

 (schema/defn ^:always-validate get-oid-mappings :- OIDMappings
   [custom-oid-mapping-file :- (schema/maybe schema/Str)]


Addressed review comments.

Addressed review comments.

--- test/cmr/system_int_test/search/granule_search_index_name_test.clj
+++ test/cmr/system_int_test/search/granule_search_index_name_test.clj
@@ -1,5 +1,6 @@
 (ns cmr.system-int-test.search.granule-search-index-name-test
-  "Integration tests for searching granules based on the configured index-names"
+  "Integration tests for searching granules based on the configured index-names.
+  This tests that the cmr-search-app and cmr-indexer-app will both put and find data in the correct granule index."
   (:require [clojure.test :refer :all]
             [cmr.common.config :as config]
             [cmr.system-int-test.utils.ingest-util :as ingest]
@@ -15,8 +16,11 @@
     ;; flush the elastic index so that the updated index-set doc will be available
     (index/flush-elastic-index)

-    ;; this set up the environment variable that configures which collection will
-    ;; have its own granule index
+    ;; This set up the environment variable that configures which collection will
+    ;; have its own granule index. This is only for working in the REPL.
+    ;; When this test is run in CI the set variable will not influence the cmr-search-app
+    ;; or cmr-indexer-app which are running in a separate process.
+    ;; The CI script must set this environment variable to make those work.
     (config/set-config-value! :separate-coll-index "C1-SEP_PROV1,C2-SEP_PROV1")
     (ingest/reset)
     (ingest/create-provider "SEP_PROV1")
@@ -40,7 +44,7 @@

     (index/flush-elastic-index)

-    (testing "search for granules in separate colletion index."
+    (testing "search for granules in separate collection index."
       (is (d/refs-match?
             [gran1 gran4]
             (search/find-refs :granule {"granule-ur[]" ["Granule1" "Granule4"]}))))


Finished first draft of semi-sweet examples.

--- example/semi-sweet-simple/test/semi_sweet_simple/core_test.clj
+++ example/semi-sweet-simple/test/semi_sweet_simple/core_test.clj
@@ -2,8 +2,11 @@
 (ns semi-sweet-simple.core-test
   (:use [semi-sweet-simple.core] :reload-all)
   (:use [clojure.test])
+  (:use [midje.checkers])
   (:use [midje.semi-sweet])
 )
+
+                       ;;;

 ;; This is an example of the Midje version of a clojure.test test that would
 ;; look like this:
@@ -23,8 +26,123 @@

 ;; You can also use functions on the right-hand side. In that case,
 ;; the actual result is passed as the function's single argument.
-
 (deftest example-of-a-function-as-right-hand-side
   (expect ( #(+ 1 %) 3) => odd?))
+;; The failing test will look slighly different:
+;;     FAIL at (core_test.clj:28)
+;;     Actual result did not pass expected function.
+;;     expected function: odd?
+;;         actual result: 4
+
+;; If you're testing something that produces a function, use
+;; (exactly):
+(deftest example-of-a-function-as-right-hand-side
+  (expect (first [even? odd?]) => (exactly odd?)))
+;;     Actual result did not pass expected function.
+;;     expected function: (exactly odd?)
+;;         actual result: #<core$even_QMARK___4680 clojure.core$even_QMARK___4680@494b6bed>
+
+;; There are a number of matching functions available. You can find them all with
+;;            (ns-publics (40 'midje.checkers))
+;; They have doc strings.
+;; Here's one of them:
+(deftest example-of-in-any-order
+  (expect '[3 1 2] => (in-any-order [1 2 3]))  ;; succeeds
+  (expect '[3 3 1 2] => (in-any-order [1 2 3])))  ;; fails
+;;     FAIL at (core_test.clj:51)
+;;     Actual result did not pass expected function.
+;;     expected function: (in-any-order [1 2 3])
+;;         actual result: [3 3 1 2]

+;; In the semi-sweet version of Midje, functions can be faked out as follows.
+;; As with normal functions, faked functions have to be declared before use.
+(declare first-fake another-fake)
+
+;; Let's suppose we want to test this function but we haven't gotten around to
+;; writing first-fake yet.
+(defn function-under-test-1 [& rest]
+  (apply first-fake rest))
+
+;; The following test fakes the first-fake so that it returns a
+;; predefined value when it's called. After that, the result of
+;; function-under-test is checked in the normal way.
+(deftest example-of-simple-fake
+  (expect (function-under-test-1 3) => 5
+      (fake (first-fake 3) => 5)))
+
+;; Here's the failure when a fake is never called
+(defn function-under-test-2 [_] 5)
+(deftest example-of-simple-fake-failure
+  (expect (function-under-test-2 3) => 5
+      (fake (first-fake 3) => 5)))
+;;     FAIL for (core_test.clj:80)
+;;     This expectation was never satisfied:
+;;     (first-fake 3) should be called at least once.
+
+;; If you rerun this test, you'll find that the line number in the
+;; actual error will point to the line containing the (fake)
+;; call. I go to some trouble to get line numbers right. For example,
+;; they should be correct even if the expect and fake are generated by
+;; a macro. Let me know of cases where line numbers are wrong.
+
+
+;; You can describe more than one call to the faked function, and you
+;; can fake more than one function.
+(defn function-under-test-3 []
+   (+ (first-fake 1) (first-fake 2 2) (another-fake)))
+(deftest example-of-multiple-faked-functions
+  (expect (function-under-test-3) => 111
+     (fake (first-fake 1) => 1)
+     (fake (first-fake 2 2) => 10)
+     (fake (another-fake) => 100)))
+
+;; When looking for a matching fake, Midje uses the same rules as when
+;; checking a function-under-test's actual result. That means you can
+;; use single-argument matching functions and you must use (exactly) to
+;; match a functional argument.
+(defn function-under-test-4 []
+  (+ (first-fake 1 2 '(a blue cow))
+     (another-fake inc)))
+
+(deftest example-of-interesting-functional-args
+  (expect (function-under-test-4) => 11
+     (fake (first-fake odd? even? anything) => 1)
+     (fake (another-fake (exactly inc)) => 10)))
+
+;; The return values of a fake don't follow the rules for fake
+;; arguments. I suppose I could be convinced that a "returning" a
+;; function should be interpreted as returning the value that function
+;; produces when given the actual arguments. I've never seen a need
+;; for that. If you do, let me know.
+
+
+;; Right now, you can't fake a function outside the current
+;; namespace. There's a saying from the OO world: "don't mock objects
+;; you don't own", so maybe this limitation is OK. If you want it, let
+;; me know, but I'm not sure it's possible.
+(comment
+    (defn function-under-test-5 [arg]
+      (inc arg))
+
+    (deftest example-of-mocking-functions-from-another-namespace
+      (expect (function-under-test-5 1) => 5
+   	   (fake (clojure.core/inc 1) => 5)))
+)
+
+;; My development style is "programming by wishful thinking"
+;; (Sussman). Suppose I'm writing function (quux). If I hit anything
+;; hard, I say "I really really believe there's already a function
+;; (frozzle) that does just what I need". I then fake (frozzle) until
+;; I'm done writing (quux). Later I'll get around to writing
+;; (frozzle). In the meantime I need to define it somehow. Preferably
+;; I'll define it in a way that will make it really obvious what
+;; happens if I try to run the whole program before I've got a real
+;; (frozzle). The way (declare) fails is not revealing enough. So I
+;; use this:
+
+(only-mocked frozzle another-function)
+
+;; If I call (frozzle), I get this:
+;;      Exception in thread "main" java.lang.Error: frozzle has no
+;;      implementation. It's used in mock tests. (core_test.clj:1)


remove unused task

remove unused task

Signed-off-by: Gregg Reynolds <d0f77bc71a9867acdcb4f62f012b858edad79160@norc.org>

--- standard-env/greeter/build.boot
+++ standard-env/greeter/build.boot
@@ -50,27 +50,6 @@
 (def web-inf-dir "WEB-INF")
 (def classes-dir (str web-inf-dir "/classes"))

-;; same as gae/build:
-(deftask btest
-  "assemble, configure, and build app"
-  [k keep bool "keep intermediate .clj and .edn files"
-   p prod bool "production build, without reloader"
-   v verbose bool "verbose"]
-  (comp (gae/install-sdk :verbose verbose)
-        (gae/libs :verbose verbose)
-        (gae/logging :verbose verbose)
-        (gae/appstats :verbose verbose)
-        (builtin/javac) ;; :options ["-verbose"])
-        (if prod identity (gae/reloader :keep keep :verbose verbose))
-        (gae/filters :keep keep :verbose verbose)
-        (gae/servlets :keep keep :verbose verbose)
-        (gae/webxml :verbose verbose)
-        (gae/appengine :verbose verbose)
-        (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
-        (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
-        ))
-
-
 (deftask build
   "Configure and build servlet or service app"
   [k keep bool "keep intermediate .clj and .edn files"


successful passing function in using new constructor rather than dot

http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/

--- statspop/src/statspop/core.cljs
+++ statspop/src/statspop/core.cljs
@@ -19,17 +19,17 @@
   [chart-data]
   (let [{:keys [func data options]} chart-data]
     (.log js/console (str "showing line chart with: " data))
-    (func ".ct-chart" (clj->js data) (clj->js options))))
+    (new func ".ct-chart" (clj->js data) (clj->js options))))

-(def test-line-data1 {:func js/Chartist.Line.
+(def test-line-data1 {:func js/Chartist.Line
                       :data {:labels ["Mar-2012" "Jun-2012" "Nov-2012" "Oct-2013" "Nov-2014"]
                              :series [[1 1 6 15 25]]}
                       :options {:width  "700px"
                                 :height "380px"}
                        :class "ct-chart ct-perfect-fourth"})

-(def test-line-data2 {:func js/Chartist.Line.
+(def test-line-data2 {:func js/Chartist.Line
                       :data {:labels ["Mar-2013" "Jun-2013" "Nov-2013" "Oct-2014" "Nov-2015"]
                              :series [[25 15 6 1 1]]}
                       :options {:width  "700px"


remove file

remove file

--- test/gamma_driver/core_test.clj
+++ test/gamma_driver/core_test.clj
@@ -1,7 +0,0 @@
-(ns gamma-webgl-driver.core-test
-  (:require [clojure.test :refer :all]
-            [gamma-webgl-driver.core :refer :all]))
-
-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))