Fixed the indentation tests for JDK 1.8

Fixed the indentation tests for JDK 1.8

--- src/test/clojure/clojure/data/xml/test_emit.clj
+++ src/test/clojure/clojure/data/xml/test_emit.clj
@@ -105,21 +105,27 @@
          (emit-str (element :comment-stuff {}
                                 "comment "
                                 (xml-comment " goes here ")
-                                " not here"))))  )
+                                " not here")))))
+
+(def xml-decl-newline?
+  (-> (System/getProperty "java.version")
+      (.startsWith "1.8")
+      not))

 (deftest test-indent
   (let [nested-xml (lazy-parse* (str "<c><d>foo</d></c>"))
-        expect (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n  "
-                    "\n    <c>\n      <d>foo</d>\n    </c>\n  \n\n")
-        sw (java.io.StringWriter.)]
-     (indent nested-xml sw)
-    (is (= expect (.toString sw)))))
+        expect (str "\n  \n    <c>\n      <d>foo</d>\n    </c>\n  \n\n")
+        sw (java.io.StringWriter.)
+        _ (indent nested-xml sw)
+        result (.toString sw)]
+     (is (= expect
+            (subs result (.indexOf result ""))))))

 (deftest test-indent-str
   (let [nested-xml (lazy-parse* (str "<c><d>foo</d></c>"))
-        expect (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n  "
-                    "\n    <c>\n      <d>foo</d>\n    </c>\n  \n\n")]
-    (is (= expect (indent-str nested-xml)))))
+        expect (str "\n  \n    <c>\n      <d>foo</d>\n    </c>\n  \n\n")
+        result (indent-str nested-xml)]
+    (is (= expect (subs result (.indexOf result ""))))))

 (deftest test-boolean
   (is (= "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>true</foo>"


Control scope of channel to ensure it rebinds

--- src/tile_game/grid.cljs
+++ src/tile_game/grid.cljs
@@ -12,7 +12,6 @@
           "#008000" "#00FF00" "#008080" "#00FFFF"
           "#0000C0" "#3030FF" "#800080" "#FF00FF"]))

-(defonce command (async/chan))
 (defonce app-state
   (r/atom {:board (b/create-board 4 :shuffle)
            :size 4
@@ -66,25 +65,29 @@
       "© 2017 Charles L.G. Comstock "
       [:a {:href "https://github.com/dgtized/tile-game"} "(github)"]]]))

+(defn controller [command]
+  (go-loop []
+    (when-let [key (async/<! command)]
+      (slide! key))
+    (recur))
+  tile-grid)
+
 (def codename
   {37 :left
    39 :right
    38 :up
    40 :down})

-(defn handle-keydown [e]
-  (when-let [key (codename (.-keyCode e))]
-    (.preventDefault e)
-    (async/put! command key)))
+(defn handle-keydown [command]
+  (fn [e]
+    (when-let [key (codename (.-keyCode e))]
+      (.preventDefault e)
+      (async/put! command key))))

 (defn init []
-  ;; Rebind onkeydown with set! so figwheel can always update
-  (set! (.-onkeydown js/window) handle-keydown)
-  (r/render-component [tile-grid] (. js/document (getElementById "grid")))
-
-  (go-loop []
-    (when-let [key (async/<! command)]
-      (slide! key))
-    (recur)))
+  (let [command (async/chan)]
+    ;; Rebind onkeydown with set! so figwheel can always update
+    (set! (.-onkeydown js/window) (handle-keydown command))
+    (r/render-component [(controller command)] (. js/document (getElementById "grid")))))

 (init)


:bug: Fix broken reference to icon.

:bug: Fix broken reference to icon.

--- frontend/src/uxbox/view/ui/viewer/sitemap.cljs
+++ frontend/src/uxbox/view/ui/viewer/sitemap.cljs
@@ -27,5 +27,5 @@
                 :on-click (partial on-click page-id)
                 :id (str "page-" page-id)
                 :key page-id}
-           [:div.page-icon i/page]
+           [:div.page-icon i/file-html]
            [:span (:name page)]]))]]))


Revert "CMR-2112 Collection search and validation code"

This reverts commit 90652619fd06203f1e6c3deccafb26b3f6d1bd6a.

--- system-int-test/test/cmr/system_int_test/ingest/ops_collections_translation_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/ops_collections_translation_test.clj
@@ -1,19 +1,27 @@
 (ns cmr.system-int-test.ingest.ops-collections-translation-test
   "Translate OPS collections into various supported metadata formats."
-  (:require [clojure.test :refer :all]
-            [clj-http.client :as client]
-            [cmr.common.xml :as cx]
-            [cmr.system-int-test.utils.fast-xml :as fx]
-            [clojure.string :as str]
-            [cmr.common.log :refer [error info]]
-            [cmr.common.mime-types :as mt]
-            [cmr.system-int-test.utils.ingest-util :as ingest]
-            [cmr.system-int-test.utils.search-util :as search]
-            [cmr.system-int-test.utils.url-helper :as url]
-            [cmr.system-int-test.system :as s]
-            [cmr.umm-spec.umm-spec-core :as umm]))
+  (:require
+    [clj-http.client :as client]
+    [clojure.string :as str]
+    [clojure.test :refer :all]
+    [cmr.common.concepts :as concepts]
+    [cmr.common.log :refer [error info]]
+    [cmr.common.mime-types :as mt]
+    [cmr.common.xml :as cx]
+    [cmr.system-int-test.system :as s]
+    [cmr.system-int-test.utils.fast-xml :as fx]
+    [cmr.system-int-test.utils.ingest-util :as ingest]
+    [cmr.system-int-test.utils.search-util :as search]
+    [cmr.system-int-test.utils.url-helper :as url]
+    [cmr.umm-spec.json-schema :as json-schema]
+    [cmr.umm-spec.test.location-keywords-helper :as lkt]
+    [cmr.umm-spec.umm-json :as umm-json]
+    [cmr.umm-spec.umm-spec-core :as umm]
+    [cmr.umm-spec.validation.umm-spec-validation-core :as umm-validation]))

 (use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1"}))
+
+(def context (lkt/setup-context-for-test lkt/sample-keyword-map))

 (def starting-page-num
   "The starting page-num to retrieve collections for the translation test."
@@ -64,7 +72,7 @@
     "C1214604063-SCIOPS" ;;Line 291 - cvc-datatype-valid.1.2.1: '<http://pubs.usgs.gov/of/2014/1040/data/undersea_features.zip>' is not a valid value for 'anyURI'.
     "C1214595389-SCIOPS" ;;Line 108 - cvc-datatype-valid.1.2.1: 'IPY  http://ipy.antarcticanz.govt.nz/projects/southern-victoria-land-geology/' is not a valid value for 'anyURI'.
     "C1214608487-SCIOPS" ;;Line 303 - cvc-datatype-valid.1.2.1: 'Scanned images: http://atlas.gc.ca/site/english/maps/archives' is not a valid value for 'anyURI'.
-    "C1214603723-SCIOPS" ;;Line 132 - cvc-datatype-valid.1.2.1: '<http://sofia.usgs.gov/projects/workplans12/jem.html>' is not a valid value for 'anyURI'.
+    "C1214603723-SCIOPS"}) ;;Line 132 - cvc-datatype-valid.1.2.1: '<http://sofia.usgs.gov/projects/workplans12/jem.html>' is not a valid value for 'anyURI'.

     ;; The following collections failed ingest validation, but not xml schema validation.
     ;; I have changed the validation from ingest validation to xml validation, so we don't
@@ -91,7 +99,7 @@
     ; "C5862870-LARC_ASDC"
     ; "C5784310-LARC_ASDC"

-    })
+

 (def valid-formats
   "Valid metadata formats that is supported by CMR."
@@ -136,6 +144,40 @@
                 (format "Failed xml schema validation when translating %s to %s for collection %s. %s"
                         (name metadata-format) (name output-format) concept-id validation-errs))))))))

+
+(defn- translate-record-to-umm
+  "Translate collection from native format to UMM-C"
+  [record]
+  (let [{:keys [metadata-format metadata concept-id]} record]
+    (umm/parse-metadata context :collection metadata-format metadata {:apply-default? true})))
+
+(defn- get-collection-validation-errors
+  "Perform the following collection validations:
+   * Validate metadata against the XML schema
+   * Validation the UMM collection record against the current UMM JSON schema
+   * Valiadte the UMM collection against UMM collection rules
+  Return a list of validation errors."
+  [record]
+  (remove empty?
+   (concat
+     (umm/validate-xml :collection (:metadata-format record) (:metadata record))
+     (json-schema/validate-umm-json (umm-json/umm->json (:collection record)) :collection)
+     (umm-validation/validate-collection record))))
+
+(defn- translate-and-validation-collection
+  "For a search result record, translate the metadata to UMM, validate the metadata and UMM record
+  and return a validation result record including the concept id, provider id, entry title, and
+  all validation errors for the record."
+  [record]
+  (let [record (assoc record :collection (translate-record-to-umm record))
+        validation-errors (get-collection-validation-errors record)
+        concept-id (:concept-id record)]
+    (when (seq validation-errors)
+      {:concept-id concept-id
+       :provider-id (:provider-id (concepts/parse-concept-id concept-id))
+       :entry-title (get-in record [:collection :EntryTitle])
+       :errors validation-errors})))
+
 (defn get-collections
   "Returns the collections as a list of maps with concept-id, revision-id, metadata-format and metadata."
   [page-size page-num]
@@ -158,16 +200,44 @@
            (cx/elements-at-path parsed [:result])
            metadatas))))

+(defn- get-ops-collections-umm-validation-errors
+  "Loops through the collections in ops with a paged search. For each collection, validate the
+  metadata against the XML schema, validate the collection translated to UMM against the current
+  UMM JSON schema, and validate the UMM collection against the validation rules.
+  Return a list of all validation errors across all collections."
+  []
+  (loop [page-num starting-page-num results []]
+    (let [collections (get-collections search-page-size page-num)
+          error-results (map translate-and-validation-collection collections)
+          all-results (concat results (remove nil? error-results))]
+      (if (and (>= (count collections) search-page-size))
+        (recur (+ page-num 1) all-results)
+        all-results))))
+
+(defn- get-ops-collections-umm-validation-errors-debug
+  []
+  (let [colls (get-collections search-page-size 1)
+        error-results (map translate-and-validation-collection colls)
+        all-results (remove nil? error-results)]
+    (if (and (>= (count colls) search-page-size) (<= 200 (count colls)))
+      all-results
+      all-results)))
+
 ;; Comment out this test so that it will not be run as part of the build.
-#_(deftest ops-collections-translation)
-  (testing "Translate OPS collections into various supported metadata formats and make sure they pass validation."
-    (loop [page-num starting-page-num]
-      (let [colls (get-collections search-page-size page-num)]
-        (info "Translating collections on page-num: " page-num)
-        (doseq [coll colls]
-          (verify-translation-via-schema-validation coll))
-        ;; We will turn on ingest validation later when ingest is backed by umm-spec-lib
-        ; (verify-translation-via-ingest-validation coll))
-        (when (>= (count colls) search-page-size)
-          (recur (+ page-num 1)))))
-    (info "Finished OPS collections translation."))
+#_(deftest ops-collections-translation
+   (testing "Translate OPS collections into various supported metadata formats and make sure they pass validation."
+     (loop [page-num starting-page-num]
+       (let [colls (get-collections search-page-size page-num)]
+         (info "Translating collections on page-num: " page-num)
+         (doseq [coll colls]
+           (verify-translation-via-schema-validation coll))
+         ;; We will turn on ingest validation later when ingest is backed by umm-spec-lib
+         ; (verify-translation-via-ingest-validation coll))
+         (when (>= (count colls) search-page-size)
+           (recur (+ page-num 1)))))
+     (info "Finished OPS collections translation.")))
+
+(deftest ops-collections-validation
+   (testing "get-collections the current collections in ops against the current UMM schema"
+     (def results (get-ops-collections-umm-validation-errors-debug))
+    (info "Finished OPS collections translation.")))


Fix fb

Fix fb

--- src/webcv/feedback.cljs
+++ src/webcv/feedback.cljs
@@ -12,7 +12,7 @@
         fb-id (first (synthdef/outputs fb))
         output (audio/gain gain 1)
         fb-edge [fb-id gain-id]]
-    (-> (digraph fb output)
+    (-> (synthdef/merge-graphs fb output)
         (add-edges fb-edge)
         (add-attr-to-edges ::synthdef/param-name ::audio/input [fb-edge]))))


(PDB-3151) admin-clean-competition: inc deref wait

Wait for 120s instead of 10s to hopefully accommodate surprising CI
behavior.

--- test/puppetlabs/puppetdb/admin_clean_test.clj
+++ test/puppetlabs/puppetdb/admin_clean_test.clj
@@ -81,7 +81,7 @@
           (finally
             (.await test-finished)
             (is (not= ::timed-out
-                      (deref cleanup-result 10000 ::timed-out)))))))))
+                      (deref cleanup-result 120000 ::timed-out)))))))))

 (defn- clean-status []
   (gauges/value (:cleaning cli-svc/admin-metrics)))


Use new compound value returns to store references in ctx, thus supporting state changes via references.

--- src/isla/interpreter.clj
+++ src/isla/interpreter.clj
@@ -22,7 +22,10 @@

 (defmethod interpret :value-assignment [node env]
   (let [assignee (extract node [:c 0])
-        value (interpret (extract node [:c 2]) env)]
+        value-node (interpret (extract node [:c 2]) env)
+        value (if (contains? value-node :ref)
+                {:ref (:ref value-node)}
+                (:val value-node))]
     (let [new-ctx (assign (:ctx env) assignee value)]
       (nreturn new-ctx))))


Update persistence.clj

Update persistence.clj

--- src/iyye/persistence.clj
+++ src/iyye/persistence.clj
@@ -56,3 +56,9 @@

 (defn load-days []
   (mongo/get-count iyye-main (str "days_" @iyye-name) {}))
+
+(defn write-io-to-db [IO input]
+  (let [doc (str "IO")
+        dbname (str @iyye-name "_IO_" (:name IO))
+        entry {:time (str (.format (java.text.SimpleDateFormat. "MM_dd_yyyy_HH_mm_ss") (java.util.Date.))) :input input}]
+    (mongo/add-entry dbname doc entry)))


Update core.clj

Update core.clj

--- src/iyye/bios/core.clj
+++ src/iyye/bios/core.clj
@@ -53,7 +53,9 @@

 (defn- init-state [name]
   (log/info "first day")
-  (persistence/set-current-iyye name))
+  (nouns/add-word "iyye.name" #(list name) nil)
+  (persistence/set-current-iyye name)
+  )

 (defn usage [options-summary]
   (->> ["Usage: iyye action/option"


Refactors update-current

Refactors update-current

--- src/wordsmith/core.cljs
+++ src/wordsmith/core.cljs
@@ -37,8 +37,9 @@
 ;; Left menu

 (defn update-current [event app]
-  (om/update! app :input (p/get-document (.. event -target -textContent)))
-  (om/update! app :title (.. event -target -textContent)))
+  (let [title (.. event -target -textContent)]
+    (om/update! app :input (p/get-document title))
+    (om/update! app :title title)))

 (defn left-menu [app owner]
   (reify


Fix size manipulation on text edition tool.

--- frontend/src/uxbox/main/ui/shapes/text.cljs
+++ frontend/src/uxbox/main/ui/shapes/text.cljs
@@ -34,7 +34,7 @@

 ;; --- Text Component

-(declare text-shape)
+(declare text-shape-html)
 (declare text-shape-wrapper)
 (declare text-shape-edit)

@@ -117,20 +117,14 @@
   (let [{:keys [width height]} (geom/size shape)
         style (make-style shape)
         props {:x x1 :y y1 :width width :height height}]
-    (letfn [#_(on-blur [ev]
-              (rlocks/release! :ui/text-edit)
-              (on-done))
-            (on-input [ev]
+    (letfn [(on-input [ev]
               (let [content (dom/event->inner-text ev)]
                 (st/emit! (uds/update-text id {:content content}))))]
-      [:g
-       #_[:rect (merge props +select-rect-attrs+)]
-       [:foreignObject props
-        [:div {:style style}
-         [:p {:ref "container"
-              ;; :on-blur on-blur
+      [:foreignObject props
+       [:div {:style style
+              :ref "container"
               :on-input on-input
-              :contentEditable true}]]]])))
+              :contentEditable true}]])))

 ;; --- Text Shape Wrapper

@@ -146,7 +140,7 @@
   [own]
   (let [[shape] (:rum/args own)
         dom (mx/ref-node own "fobject")
-        html (mx/render-static-html (text-shape shape))]
+        html (mx/render-static-html (text-shape-html shape))]
     (set! (.-innerHTML dom) html))
     own)

@@ -156,7 +150,7 @@
         [shape] (:rum/args own)]
     (when (not= shape old-shape)
       (let [dom (mx/ref-node own "fobject")
-            html (mx/render-static-html (text-shape shape))]
+            html (mx/render-static-html (text-shape-html shape))]
         (set! (.-innerHTML dom) html)))
     own))

@@ -178,10 +172,33 @@
                      :width width
                      :height height}]))

-;; --- Text Shape
-
-(mx/defc text-shape
+;; --- Text Shape Html
+
+(mx/defc text-shape-html
   [{:keys [content] :as shape}]
   (let [style (make-style shape)]
-    [:div {:style style}
-     [:p content]]))
+    [:div {:style style} content]))
+
+
+;; --- Text Shape Html
+
+(mx/defc text-shape
+  {:mixins [mx/static]
+   :did-mount text-shape-wrapper-did-mount
+   :did-remount text-shape-wrapper-did-remount}
+  [{:keys [id content tmp-resize-xform tmp-displacement] :as shape}]
+  (let [xfmt (cond-> (gmt/matrix)
+                tmp-displacement (gmt/translate tmp-displacement)
+                tmp-resize-xform (gmt/multiply tmp-resize-xform))
+
+        {:keys [x1 y1 width height] :as shape} (-> (geom/transform shape xfmt)
+                                                   (geom/size))
+        style (make-style shape)]
+    [:foreignObject {:x x1
+                     :y y1
+                     :id (str id)
+                     :ref "fobject"
+                     :width width
+                     :height height}
+     [:div {:style style}
+      [:p content]]]))


fix formatting

fix formatting

--- src/zombie_run/game.clj
+++ src/zombie_run/game.clj
@@ -56,7 +56,8 @@
   (terrain/get-property terrain (player-position game) ::terrain/health))

 (defn configure-player-weapon [{terrain :terrain :as game} overrides]
-  (update game ::terrain/terrain-map
+  (update game
+          ::terrain/terrain-map
           terrain/update-property
           (player-position game)
           ::weapon/weapon
@@ -67,9 +68,11 @@
   ([game new-pos] (set-player game new-pos :up))
   ([game new-pos direction]
    (-> game
-       (update ::terrain/terrain-map terrain/remove-terrain
+       (update ::terrain/terrain-map
+               terrain/remove-terrain
                (player-position game))
-       (update ::terrain/terrain-map terrain/make-terrain
+       (update ::terrain/terrain-map
+               terrain/make-terrain
                new-pos
                {::terrain/type      :player
                 ::terrain/health    player-default-health
@@ -98,7 +101,8 @@
         (assoc game ::terrain/terrain-map (-> terrain
                                               (terrain/set-property player-pos ::weapon/weapon weapon)
                                               (terrain/damage target-pos damage))))
-      (update game ::terrain/terrain-map
+      (update game
+              ::terrain/terrain-map
               terrain/update-property
               player-pos
               ::weapon/weapon
@@ -110,7 +114,8 @@
 (def zombie-default-direction [0 1])

 (defn configure-zombie-weapon [game pos overrides]
-  (update game ::terrain/terrain-map
+  (update game
+          ::terrain/terrain-map
           terrain/update-property
           pos
           ::weapon/weapon
@@ -132,7 +137,8 @@

 (defn- set-zombie [game position]
-  (update game ::terrain/terrain-map
+  (update game
+          ::terrain/terrain-map
           terrain/make-terrain
           position
           {::terrain/type      :zombie
@@ -155,7 +161,9 @@
                                               (terrain/set-property current-pos ::weapon/weapon weapon)
                                               (terrain/damage player-pos damage))))
       (let [action (calculate-zombie-action current-pos player-pos)]
-        (update game ::terrain/terrain-map terrain/move
+        (update game
+                ::terrain/terrain-map
+                terrain/move
                 current-pos
                 action
                 world-size)))
@@ -182,7 +190,9 @@
   (if-let [player-position (player-position game)]
     (if (= :fire player-action)
       (player-attack game player-position)
-      (update game ::terrain/terrain-map terrain/move
+      (update game
+              ::terrain/terrain-map
+              terrain/move
               player-position
               (action->coords player-action)
               world-size))


(TK-202) Add some debug logging around the HUP signal in test

--- test/puppetlabs/trapperkeeper/services_test.clj
+++ test/puppetlabs/trapperkeeper/services_test.clj
@@ -12,7 +12,8 @@
             [puppetlabs.trapperkeeper.internal :as internal]
             [puppetlabs.trapperkeeper.testutils.logging :refer [with-test-logging]]
             [puppetlabs.trapperkeeper.core :as tk]
-            [puppetlabs.kitchensink.testutils :as ks-testutils])
+            [puppetlabs.kitchensink.testutils :as ks-testutils]
+            [clojure.tools.logging :as log])
   (:import (java.util.concurrent ExecutionException)))

 (use-fixtures :once schema-test/validate-schemas with-no-jvm-shutdown-hooks)
@@ -151,7 +152,9 @@
                 :start-service1 :start-service2 :start-service3]
                @call-seq))
         (internal/register-sighup-handler [app])
+        (log/debugf "About to HUP the app. Hold onto your butts!")
         (beckon/raise! "HUP")
+        (log/debugf "Have HUPped the app. Did anything happen yet?")
         (let [start (System/currentTimeMillis)]
           (while (and (not= (count @call-seq) 15)
                      (< (- (System/currentTimeMillis) start) 1000))


log pod metadata (#1552)

log pod metadata (#1552)

--- scheduler/src/cook/kubernetes/controller.clj
+++ scheduler/src/cook/kubernetes/controller.clj
@@ -101,6 +101,7 @@
         (dissoc :pod)
         (assoc
           :node-name (api/pod->node-name pod)
+          :pod-metadata (some-> pod .getMetadata)
           :pod-status (some-> pod .getStatus)))
     (catch Throwable t
       (log/error t "Error preparing k8s actual state for logging:" k8s-actual-state-dict)


matcher-combinators: Change some test names

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -123,7 +123,7 @@
   (is (match? (m/in-any-order [odd? odd? even?])
               [1 2 3])))

-(deftest test-matching-sets
+(deftest sets-test
   ;; A set is also interpreted as an `equals` matcher.
   (is (match? #{1 2 3} #{3 2 1}))
   (is (match? #{odd? even?} #{1 2}))
@@ -136,7 +136,7 @@
   ;; Avoid applying this to large sets.
   )

-(deftest test-matching-nested-datastructures
+(deftest nested-datastructures-test
   ;; Maps, sequences, and sets follow the same semantics whether at
   ;; the top level or nested within a structure.
   (is (match? {:band/members [{:name/first "Alfredo"}


remove yellowbox warnings for componentWillMount and WillUpdate

--- src/status_im/core.cljs
+++ src/status_im/core.cljs
@@ -12,7 +12,11 @@
             cljs.core.specs.alpha))

 (if js/goog.DEBUG
-  (.ignoreWarnings (.-YellowBox js-dependencies/react-native) #js ["re-frame: overwriting"])
+  (.ignoreWarnings (.-YellowBox js-dependencies/react-native)
+                   #js
+                    ["re-frame: overwriting"
+                     "Warning: componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount."
+                     "Warning: componentWillUpdate is deprecated and will be removed in the next major version. Use componentDidUpdate instead. As a temporary workaround, you can rename to UNSAFE_componentWillUpdate."])
   (aset js/console "disableYellowBox" true))

 (defn init [app-root]


Schema insert works now

Schema insert works now

We use the public schema for all system calls!

--- src/webapp/framework/server/db_helper.clj
+++ src/webapp/framework/server/db_helper.clj
@@ -89,8 +89,9 @@
        update-only?
        ;-----------
        (do
+
          (korma.db/transaction
-           (korma.core/exec-raw [(str "set schema ' " use-schema "'") []])
+           (korma.core/exec-raw [(str "set schema '" use-schema "'") []])
            (korma.core/exec-raw [sql-in params])
            (korma.core/exec-raw [(str "set schema 'public'") []]))
          [])
@@ -151,6 +152,6 @@

-(comment korma.db/transaction
+( korma.db/transaction
   (korma.core/exec-raw [(str "set schema 'public'") []])
-  (korma.core/exec-raw ["select id from appshare_applications" []] :results))
+  (korma.core/exec-raw ["insert into appshare_applications (application_name) values ('........')" []]))


fixed type hints

fixed type hints

--- src/syncserver/core.clj
+++ src/syncserver/core.clj
@@ -15,10 +15,10 @@
 (defn modify [path f]
   (fn [s] (update-in s path f)))

-(defn mk-fn [^ISyncFunction f]
+(defn mk-fn [^IFunction1 f]
   (fn [x] (.invoke f x)))

-(defn jmodify [f path-array]
+(defn jmodify [^IFunction1 f path-array]
   (modify (map keyword (into [] path-array)) (mk-fn f)))

 (defn jconj [e path-array]


CMR-4023 passes metadata db search POST params as form parameters (#92)

--- transmit-lib/src/cmr/transmit/metadata_db.clj
+++ transmit-lib/src/cmr/transmit/metadata_db.clj
@@ -144,7 +144,7 @@
     (client/post request-url (merge
                               (config/conn-params conn)
                               {:accept :json
-                               :query-params params
+                               :form-params params
                                :headers (ch/context->http-headers context)
                                :throw-exceptions false}))))


Reorders code

Reorders code

--- src/wordsmith/core.cljs
+++ src/wordsmith/core.cljs
@@ -9,6 +9,9 @@

 (enable-console-print!)

+;; Implements ICloneable on string and js/string so that
+;; React can handle these properly.
+
 (extend-type string
   ICloneable
   (-clone [s] (js/String. s)))
@@ -65,9 +68,40 @@
                        :onClick #(new-document-click app)}
                   "new"))))

+;; Save button
+
+(defn save-button-click
+  "Sends a :save command on the app channel."
+  [app]
+  (put! (:channel @app) [:save nil]))
+
+(defn saved?
+  "Determines whether or not the app state has changed since last
+   save."
+  [{:keys [input last-input title last-title]}]
+  (and
+    (= input last-input)
+    (= title last-title)))
+
+(defn save-button
+  "Component that renders the save button. The button is disabled
+   when there are no changes to title or input. Clicking the save
+   button triggers the app state to update and saves to localStorage."
+  [app owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/button #js {:id "save-button"
+                       :disabled (saved? app)
+                       :className (when (saved? app) "disabled")
+                       :onClick #(save-button-click app)}
+                  (if (saved? app)
+                    "saved"
+                    "save")))))
+
 ;; Left menu

-(defn update-current
+(defn change-current
   "Sends a :change command on the app channel."
   [event app]
   (let [title (.. event -target -textContent)]
@@ -97,40 +131,9 @@
                   (dom/span #js {:className "delete-button"
                                  :onClick (fn [e] (delete-click % app))} "x")
                   (dom/span #js {:className "left-menu-title"
-                                 :onClick (fn [e] (update-current e app))}
+                                 :onClick (fn [e] (change-current e app))}
                     (om/value %)))
                (:titles app)))))))
-
-;; Save button
-
-(defn save-button-click
-  "Sends a :save command on the app channel."
-  [app]
-  (put! (:channel @app) [:save nil]))
-
-(defn saved?
-  "Determines whether or not the app state has changed since last
-   save."
-  [{:keys [input last-input title last-title]}]
-  (and
-    (= input last-input)
-    (= title last-title)))
-
-(defn save-button
-  "Component that renders the save button. The button is disabled
-   when there are no changes to title or input. Clicking the save
-   button triggers the app state to update and saves to localStorage."
-  [app owner]
-  (reify
-    om/IRender
-    (render [_]
-      (dom/button #js {:id "save-button"
-                       :disabled (saved? app)
-                       :className (when (saved? app) "disabled")
-                       :onClick #(save-button-click app)}
-                  (if (saved? app)
-                    "saved"
-                    "save")))))

 ;; Editor

@@ -161,10 +164,10 @@
                :id "output-area"
                :dangerouslySetInnerHTML #js {:__html (marked input)}})))))

-;; The main app
+;; State transformations

 (defn update-many!
-  "Sequentially updates multiple keys on Om cursor to the given value."
+  "Updates multiple keys on Om cursor to the given value."
   [app ks v]
   (doseq [k ks]
     (om/update! app k v)))
@@ -230,6 +233,8 @@
             (= 83 (.-keyCode %)))
        (.preventDefault %)
        (put! (:channel @app) [:save nil]))))
+
+;; The main app

 (defn wordsmith-app
   "The starting point of the wordsmith app. Implements will-mount and


Websockets HTTP routing: improve error handling

Fixed a bug which caused the HTTP server to throw confusing exceptions
when it couldn't find a requested path.

--- src/riemann/transport/websockets.clj
+++ src/riemann/transport/websockets.clj
@@ -176,9 +176,9 @@
       #"/events/?"       (put-events-handler @core stats ch req)
       #"/index/?"        (ws-index-handler @core stats ch req)
       #"/pubsub/[^/]+/?" (ws-pubsub-handler @core stats ch req)
-      :else (do
-              (info "Unknown URI " (:uri req) ", closing")
-              (close ch)))))
+      (do
+        (info "Unknown URI " (:uri req) ", closing")
+        (close ch)))))

 (defrecord WebsocketServer [host port core server stats]
   ServiceEquiv


fixed gen-auth-url to have proper query params

--- src/saved_for_reddit/reddit-api.cljs
+++ src/saved_for_reddit/reddit-api.cljs
@@ -9,14 +9,14 @@
 (def redirect-uri "http://127.0.0.1:3449/")

 (defn gen-auth-url []
-  (let [cem-url (url/url "https://www.reddit.com/api/v1/authoriz"
-                         :query  {:client_id client-id
-                                  :response_type "code"
-                                  :state "abcdef"
-                                  :redirect_uri redirect-uri
-                                  :duration "temporary"
-                                  :scope "save"} )]
-    (str cem-url)))
+  (let [cem-url (url/url "https://www.reddit.com/api/v1/authorize")
+        query-param  {:client_id client-id
+                      :response_type "code"
+                      :state "abcdef"
+                      :redirect_uri redirect-uri
+                      :duration "temporary"
+                      :scope "save"}]
+    (str (assoc cem-url :query query-param))))

 (defn make-remote-call [endpoint]
   (go (let [response (<! (http/get endpoint {:with-credentials? false}))]


Encode device metadata as json and then stringify it.

--- src/kixi/hecuba/amon.clj
+++ src/kixi/hecuba/amon.clj
@@ -363,7 +363,7 @@
         {entity-id :entity-id} :route-params
         method :request-method} :request}]
     (case method
-      :post (let [body (-> body read-json-body ->shallow-kebab-map)]
+      :post (let [body (-> body read-json-body ->shallow-kebab-map)] ;; This turns json into a clojure map
               ;; We need to assert a few things
               (if
                   (or
@@ -379,10 +379,11 @@
           [username _]  (sec/get-username-password request querier)
           user-id       (-> (items querier :user {:username username}) first :id)
           device-id     (upsert! commander :device (-> body
-                                                       stringify-values
                                                        (assoc :user-id user-id)
+                                                       (update-in [:metadata] encode)
+                                                       (update-in [:location] encode)
                                                        (dissoc :readings)
-                                                       (update-in [:location] encode)))]
+                                                       stringify-values))]
       (when-not (empty? (first (items querier :entity {:id entity-id})))
         (doseq [reading (:readings body)]
           (let [sensor (-> reading


Please work

Please work

--- src/lazubot/master.clj
+++ src/lazubot/master.clj
@@ -21,7 +21,7 @@
         [request-in request-out] (repeatedly 2 #(chan (sliding-buffer 10)))]
     (register-socket! {:in request-in :out request-out :socket-type :req
                        :configurator (fn [socket] (.bind socket addr))})
-    (println (:out (sh "docker" "build" "--no-cache" "-t lazubot-worker" "-" "<" "/lazubot/resources/public/WorkerDockerfile")))
+    (println (:out (sh "docker" "build" "-no-cache=true" "-t=lazubot-worker" "/lazubot/resources/public/WorkerDockerfile")))
     (println (:out (sh "docker" "run" "-rm=true" "-t" "-i" "-name client" "-link master:linked-master"
         "lazubot-worker" "lein with-profile worker run")))
     (go


CMR-3812: Science keyword facet results should not be affected by science keyword in query.

--- search-app/src/cmr/search/services/query_execution.clj
+++ search-app/src/cmr/search/services/query_execution.clj
@@ -166,9 +166,7 @@
   ;; are not in the query, then we merge this base result with only the facets for each individual
   ;; facet field that is in the query.
   (let [facet-fields-in-query (keep #(when (facet-condition-resolver/has-field? query %) %)
-                                    ;; CMR-3812: once science-keywords is fixed, we will include science-keywords
-                                    (drop 1 fv2rf/facets-v2-params))
-                                    ; fv2rf/facets-v2-params)
+                                    fv2rf/facets-v2-params)
         base-facet-fields (set/difference (set fv2rf/facets-v2-params) (set facet-fields-in-query))
         query (assoc query :complicated-facets false :facet-fields base-facet-fields)
         base-result (common-qe/execute-query context query)


CMR-2263: Updated docstring

CMR-2263: Updated docstring

--- search-app/src/cmr/search/services/query_execution.clj
+++ search-app/src/cmr/search/services/query_execution.clj
@@ -14,7 +14,7 @@
            cmr.search.models.query.StringCondition))

 (def transformer-supported-format?
-  "Returns true if the format is supported by the transformer."
+  "The set of formats supported by the transformer."
   #{:echo10 :dif :dif10 :iso19115 :iso-smap})

 (def specific-elastic-items-format?


Require 'leiningen.help on-demand to address issue #28.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -12,7 +12,6 @@
             [clojure.walk :as walk]
             [leiningen.core.project :as project]
             [leiningen.core.main :as lmain]
-            [leiningen.help]
             [leiningen.voom.long-sha :as sha :only [mk]]
             [leiningen.voom.pldb :as vdb]
             [leiningen.voom.shabam :refer [shabam-new shabam-contains? shabam-add
@@ -1260,11 +1259,18 @@
      :repo found-repo
      :branch found-branch}))

+(defn- lein-help
+  [& args]
+  ;; NOTE: The below require is done on-demand as to avoid problems
+  ;; with Immutant's classloader. cf. lein-voom issue #28.
+  (do (require 'leiningen.help)
+      (apply (resolve 'leiningen.help/help) args)))
+
 (defn help
   "Display this help message"
   ([] nil) ;; Tell lein not to use this fn as help for voom
-  ([project] (leiningen.help/help project "voom"))
-  ([project subtask] (leiningen.help/help project "voom" subtask)))
+  ([project] (lein-help project "voom"))
+  ([project subtask] (lein-help project "voom" subtask)))

 (def ^{:doc "Display this help message"} box-help help)


Update play-cljs template

Update play-cljs template

--- build.boot
+++ build.boot
@@ -14,7 +14,7 @@
                   [leiningen "2.8.1" :exclusions [leiningen.search]]
                   [ring "1.6.1"]
                   [hawk "0.2.11"]
-                  [play-cljs/lein-template "0.10.2"]
+                  [play-cljs/lein-template "0.11.0"]
                   [eval-soup "1.2.3" :exclusions [org.clojure/core.async]]
                   [org.eclipse.jgit/org.eclipse.jgit "4.6.0.201612231935-r"]]
   :repositories (conj (get-env :repositories)


add code quality tooling

add code quality tooling

--- build.boot
+++ build.boot
@@ -41,6 +41,9 @@
                             ;; Testing
                             [adzerk/boot-test "1.1.2" :scope "test"]

+                            ;; Code Analysis
+                            [tolitius/boot-check "0.1.4" :scope "test"]
+
                             ;; Logging
                             [org.slf4j/jul-to-slf4j     "1.7.21"]
                             [org.slf4j/jcl-over-slf4j   "1.7.21"]
@@ -61,6 +64,9 @@

 ;; Load datomic Move this task into its own file
 (require '[datomic.api :as d])
+
+;; Load code analysis tasks
+(require '[tolitius.boot-check :as check])

 (deftask dev []
   (set-env! :source-paths #(conj % "dev/src"))
@@ -101,3 +107,9 @@
                       (get-env :project)
                       (get-env :version)))
    (target)))
+
+(deftask check-sources
+  "Analyzes source code"
+  []
+  (comp
+   (check/with-eastwood)))


Bump re-frame version

Bump re-frame version


Added tablesort.js

Added tablesort.js

--- build.boot
+++ build.boot
@@ -1,54 +1,68 @@
 (set-env!
-	:resource-paths #{"resources"}
-	:dependencies '[
-		[adzerk/bootlaces "0.1.9" :scope "test"]
-		[cljsjs/boot-cljsjs "0.4.6" :scope "test"]
-		[cljsjs/jquery "1.8.2-2"]])
+  :resource-paths #{"resources"}
+  :dependencies '[
+                  [adzerk/bootlaces "0.1.9" :scope "test"]
+                  [cljsjs/boot-cljsjs "0.4.6" :scope "test"]
+                  [cljsjs/jquery "1.8.2-2"]])

 (require
-	'[adzerk.bootlaces :refer :all]
-	'[cljsjs.boot-cljsjs.packaging :refer :all])
+  '[adzerk.bootlaces :refer :all]
+  '[cljsjs.boot-cljsjs.packaging :refer :all])

 (def +ver+ "2.0.6")
 (def +version+ (str +ver+ "-SNAPSHOT"))
 (bootlaces! +version+)

 (task-options!
-	pom { :project 'exicon/semantic-ui
-		:version +version+
-		:description (str "Semantic is a UI component framework"
-			" based around useful principles from natural language.")
-		:url "http://semantic-ui.com"
-		:license {"MIT" "http://opensource.org/licenses/MIT"}
-		:scm {:url "https://github.com/exicon/hoplon-semantic-ui"}})
+  pom { :project 'exicon/semantic-ui
+       :version +version+
+       :description (str "Semantic is a UI component framework"
+                         " based around useful principles from natural language.")
+       :url "http://semantic-ui.com"
+       :license {"MIT" "http://opensource.org/licenses/MIT"}
+       :scm {:url "https://github.com/exicon/hoplon-semantic-ui"}})

 (deftask download-semantic-ui []
-	(download
-		:url (str "https://github.com/Semantic-Org/Semantic-UI/archive/" +ver+ ".zip")
-		:unzip true))
+  (download
+    :url (str "https://github.com/Semantic-Org/Semantic-UI/archive/" +ver+ ".zip")
+    :unzip true))
+
+(deftask download-tablesort []
+  (download
+    :url (str "http://semantic-ui.com/javascript/library/tablesort.js")))
+
+(deftask download-tablesort-min []
+  (download
+    :url (str "http://semantic-ui.com/javascript/library/tablesort.min.js")))

 (deftask package5 []
-	(task-options! pom { :project 'exicon/hoplon5-semantic-ui })
-	(comp
-		(download-semantic-ui)
-		(sift :move {
-			#"^Semantic-UI-.*/dist/semantic.css" "semantic-ui.inc.css"
-			#"^Semantic-UI-.*/dist/semantic.js" "semantic-ui.inc.js"
-			#"^Semantic-UI-.*/dist/themes/" "_hoplon/themes/"
-			})
-		(sift :include #{#"_hoplon/" #"semantic-ui"})))
+  (task-options! pom { :project 'exicon/hoplon5-semantic-ui })
+  (comp
+    (download-semantic-ui)
+    (sift :move
+          {
+           #"^Semantic-UI-.*/dist/semantic.css" "semantic-ui.inc.css"
+           #"^Semantic-UI-.*/dist/semantic.js" "semantic-ui.inc.js"
+           #"^Semantic-UI-.*/dist/themes/" "_hoplon/themes/"
+           })
+    (sift :include #{#"_hoplon/" #"semantic-ui"})))

 (deftask package []
-	(comp
-		(download-semantic-ui)
-		(sift :move {
-			#"^Semantic-UI-.*/dist/semantic.css" "cljsjs/development/semantic-ui.inc.css"
-			#"^Semantic-UI-.*/dist/semantic.js" "cljsjs/development/semantic-ui.inc.js"
-			#"^Semantic-UI-.*/dist/semantic.min.css" "cljsjs/production/semantic-ui.min.inc.css"
-			#"^Semantic-UI-.*/dist/semantic.min.js" "cljsjs/production/semantic-ui.min.inc.js"
-			#"^Semantic-UI-.*/dist/themes/" "cljsjs/common/themes/"
-			#"semantic-ui.ext.js" "cljsjs/common/semantic-ui.ext.js"
-			})
-		(sift :include #{#"^cljsjs"})
-		(deps-cljs :name "exicon.semantic-ui"
-			:requires ["cljsjs.jquery"])))
+  (comp
+    (download-semantic-ui)
+    (download-tablesort)
+    (download-tablesort-min)
+    (sift :move
+          {
+           #"^Semantic-UI-.*/dist/semantic.css" "cljsjs/development/semantic-ui.inc.css"
+           #"^Semantic-UI-.*/dist/semantic.js" "cljsjs/development/semantic-ui.inc.js"
+           #"^Semantic-UI-.*/dist/semantic.min.css" "cljsjs/production/semantic-ui.min.inc.css"
+           #"^Semantic-UI-.*/dist/semantic.min.js" "cljsjs/production/semantic-ui.min.inc.js"
+           #"^Semantic-UI-.*/dist/themes/" "cljsjs/common/themes/"
+           #"semantic-ui.ext.js" "cljsjs/common/semantic-ui.ext.js"
+           #"tablesort.js" "cljsjs/development/tablesort.inc.js"
+           #"tablesort.min.js" "cljsjs/production/tablesort.min.inc.js"
+           })
+    (sift :include #{#"^cljsjs"})
+    (deps-cljs :name "exicon.semantic-ui"
+               :requires ["cljsjs.jquery"])))


Bump Om dependency to 1.0.0-alpha20-SNAPSHOT

--- build.boot
+++ build.boot
@@ -26,7 +26,7 @@
                   [cljs-ajax "0.5.1"]
                   [cljsjs/highlight "8.4-0"]
                   [org.clojure/clojurescript "1.7.170"]
-                  [org.omcljs/om "1.0.0-alpha19-SNAPSHOT"]
+                  [org.omcljs/om "1.0.0-alpha20-SNAPSHOT"]

                   ; Other dependencies
                   [devcards "0.2.0-8"]])


remove boot

remove boot

--- build.boot
+++ build.boot
@@ -1,54 +0,0 @@
-(def +version+ "0.2.3")
-
-(task-options!
-  pom {:project     'replify
-       :version     +version+
-       :description "A fast Clojurescript REPL and minimalist build tool "
-       :url         "https://github.com/priyatam/replify"
-       :scm         {:url "https://github.com/priyatam/replify"}
-       :license     {"Eclipse Public License"
-                     "http://www.eclipse.org/legal/epl-v10.html"}})
-
-(set-env!
-  :source-paths #{"src"}
-  :resource-paths #{"src"}
-  :dependencies '[[org.clojure/clojure       "1.7.0"          :scope "provided"]
-                  [org.clojure/clojurescript "1.7.28"         :scope "provided"]
-                  [org.clojure/core.async    "0.1.346.0-17112a-alpha" :scope "provided"]
-                  [org.clojure/tools.cli     "0.3.1"]
-                  [me.raynes/fs              "1.4.6"]
-                  [alembic                   "0.3.2"]
-                  [adzerk/boot-cljs          "0.0-3308-0"     :scope "test"]
-                  [adzerk/boot-reload        "0.3.1"          :scope "test"]
-                  [adzerk/boot-cljs-repl     "0.1.9"          :scope "test"]
-                  [pandeiro/boot-http        "0.6.3-SNAPSHOT" :scope "test"]
-                  [adzerk/bootlaces          "0.1.11"         :scope "test"]])
-
-(require '[adzerk.boot-cljs      :refer [cljs]]
-         '[adzerk.boot-reload    :refer [reload]]
-         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
-         '[pandeiro.boot-http    :refer [serve]]
-         '[adzerk.bootlaces      :refer :all])
-
-(bootlaces! +version+)
-
-(deftask dev []
-  (comp (serve :dir ".")
-        (watch)
-        (cljs-repl)
-        (cljs :optimizations :none
-              :source-map    true
-              :unified-mode  true)))
-
-(deftask prod []
-  (cljs :optimizations :advanced))
-
-(deftask uberjar []
-  (comp
-   (pom :project 'replify
-        :version +version+)
-   (uber)
-   (jar)))
-
-(deftask deploy []
-  (comp (build-jar) (push-release :ensure-clean false)))


Uncomment versioning based on tags

Uncomment versioning based on tags

--- build.boot
+++ build.boot
@@ -39,8 +39,7 @@
  '[clojure.string :as str])

 (def +version+
-  "1.0.0-SNAPSHOT"
-  #_(let [{:keys [exit out]} (shell/sh "git" "describe" "--tags")
+  (let [{:keys [exit out]} (shell/sh "git" "describe" "--tags")
         tag (second (re-find #"v(.*)\n" out))]
     (if (zero? exit)
       (if (.contains tag "-")


update build.boot to latest deps

update build.boot to latest deps

--- build.boot
+++ build.boot
@@ -1,39 +1,44 @@
-(def +project+ 'org.mobileink/migae.datastore)
+(def +project+ 'migae/datastore)
+;; (def +project+ 'org.mobileink/migae.datastore)
 (def +version+ "0.4.0-SNAPSHOT")

 (set-env!
- :gae {:app-id "boot-test"
-       :module "bulkops"
-       :version +version+}
+ ;; :gae {:app-id "boot-test"
+ ;;       :module "bulkops"
+ ;;       :version +version+}
  :asset-paths #{"resources"}
  :resource-paths #{"src/clj"}
- :source-paths #{"src/clj-compile"}
- :repositories {"clojars" "https://clojars.org/repo"
-                "central" "http://repo1.maven.org/maven2/"
-                "maven-central" "http://mvnrepository.com"}
- :dependencies   '[[org.clojure/clojure "1.8.0" :scope "runtime"]
+ ;; :source-paths #{"src/clj-aot"}
+ ;; :repositories {"clojars" "https://clojars.org/repo"
+ ;;                "central" "http://repo1.maven.org/maven2/"
+ ;;                "maven-central" "http://mvnrepository.com"}
+ :dependencies   '[[org.clojure/clojure "1.10.0" :scope "runtime"]
+
+                   [javax.servlet/javax.servlet-api "3.1.0" :scope "provided"]

                    ;; the java sdk is not used by app code, it's just there for the devserver
                    ;; and test service stubs, so it should have :scope provided
                    ;; even though it will not in fact be provided by the prod env
-                   [com.google.appengine/appengine-java-sdk LATEST :scope "provided" :extension "zip"]
+                   ;; this is for the GAE runtime (NB: scope provided):
+                   [com.google.appengine/appengine-java-sdk RELEASE :scope "provided" :extension "zip"]
+                   ;; [com.google.appengine/appengine-java-sdk LATEST :scope "provided" :extension "zip"]

+                   ;; this is for the GAE services like datastore (NB: scope runtime):
                    ;; NOTE: the api sdk is runtime scoped, since we do not compile our clojure files
-                   [com.google.appengine/appengine-api-1.0-sdk LATEST :scope "runtime"]
+                   [com.google.appengine/appengine-api-1.0-sdk RELEASE :scope "runtime"]
+                   ;; [com.google.appengine/appengine-api-1.0-sdk LATEST :scope "runtime"]

                    ;; test service stubs
-                   [com.google.appengine/appengine-api-labs "1.9.34" :scope "test"]
-                   [com.google.appengine/appengine-api-stubs "1.9.34" :scope "test"]
-                   [com.google.appengine/appengine-tools-sdk "1.9.34" :scope "test"]
+                   [com.google.appengine/appengine-api-labs RELEASE :scope "test"]
+                   [com.google.appengine/appengine-api-stubs RELEASE :scope "test"]
+                   [com.google.appengine/appengine-tools-sdk RELEASE :scope "test"]

                    ;; setup utils
-                   [com.google.appengine/appengine-testing "1.9.34" :scope "test"]
+                   [com.google.appengine/appengine-testing RELEASE :scope "test"]

                    ;; [org.mobileink/migae.datastore "0.3.3-SNAPSHOT" :scope "runtime"]
                    ;; [org.mobileink/migae.mail "0.1.0-SNAPSHOT" :scope "runtime"]
-
-                   ;; [javax.servlet/servlet-api "2.5" :scope "provided"]

                    ;; GCM
                    ;; [com.ganyo/gcm-server "1.0.2"]
@@ -51,15 +56,15 @@
                    ;; data
                    ;; [cheshire/cheshire "5.5.0" :scope "runtime"]
                    ;; [fogus/ring-edn "0.3.0" :scope "runtime"]
-                   [org.clojure/tools.reader "1.0.0-beta1" :scope "runtime"]
+                   [org.clojure/tools.reader "1.3.2" :scope "runtime"]
                    ;; [commons-io/commons-io "2.4" :scope "runtime"]
                    ;; [commons-fileupload/commons-fileupload "1.3.1" :scope "runtime"]
                    [prismatic/schema "1.0.1"]

-                   [potemkin "0.4.3"]
-                   [org.clojure/tools.logging "0.3.1"]
-                   [org.apache.logging.log4j/log4j-core "2.5"]
-                   [org.apache.logging.log4j/log4j-slf4j-impl "2.5"]
+                   [potemkin "0.4.5"]
+                   [org.clojure/tools.logging "0.4.1"]
+                   [org.apache.logging.log4j/log4j-core "2.11.1"]
+                   [org.apache.logging.log4j/log4j-slf4j-impl "2.11.1"]
                    ;; [org.apache.logging.log4j/log4j-api "2.5"]
                    ;; [log4j "1.2.17" :exclusions [javax.mail/mail
                    ;;                              javax.jms/jms
@@ -67,9 +72,9 @@
                    ;;                              com.sun.jmx/jmxri]]

                    ;; [org.clojure/tools.namespace "0.2.11"]
-                   [ns-tracker/ns-tracker "0.3.0" :scope "test"]
-                   [adzerk/boot-test "1.1.1" :scope "test"]
-                   [migae/boot-gae "0.1.0-SNAPSHOT" :scope "test"]])
+                   [ns-tracker/ns-tracker "0.3.1" :scope "test"]
+                   [adzerk/boot-test "1.2.0" :scope "test"]
+                   [migae/boot-gae "0.2.1-SNAPSHOT" :scope "test"]])

 (require '[migae.boot-gae :as gae]
          '[boot.task.built-in :as boot]
@@ -81,7 +86,6 @@
                          :war "target/bulkops"}]})

 (task-options!
- gae/ear modules
  gae/run modules
  pom  {:project     +project+
        :version     +version+


Rename test task

Rename test task

--- build.boot
+++ build.boot
@@ -24,7 +24,9 @@
    (jar)
    (install)))

-(deftask run-tests []
+(ns-unmap *ns* 'test)
+
+(deftask test []
   (comp
     (bat-test)))

@@ -32,12 +34,12 @@
   (comp
    (watch)
    (repl :server true)
-   (run-tests)
+   (test)
    (build)
    (target)))

 (deftask deploy []
   (comp
-    (run-tests)
+    (test)
     (build)
     (push :repo "clojars" :gpg-sign (not (.endsWith +version+ "-SNAPSHOT")))))


Allow records to overwrite Object's methods.

--- src/active/clojure/record_clj_internals.clj
+++ src/active/clojure/record_clj_internals.clj
@@ -261,7 +261,7 @@
                                                      ['java.util.Map 'clojure.lang.IPersistentMap])
                                                    (:remove-interfaces opts))))))

-          interfaces (vec (keys new-interfaces+methods))
+          interfaces (vec (remove #{'Object 'java.lang.Object} (keys new-interfaces+methods)))
           methods (apply concat (vec (vals new-interfaces+methods)))]
        `(deftype* ~(symbol (name (ns-name *ns*)) (name tagname)) ~classname
           ~(conj hinted-fields '__meta '__extmap


stub update-url

stub update-url

--- test/shorty/web_test.clj
+++ test/shorty/web_test.clj
@@ -14,6 +14,7 @@
 (defmacro with-stubs [[io-name io-val] & body]
   `(let [~io-name ~io-val]
      (with-redefs [shorty.db/create-url (fn [~'_] {:id (swap! ~io-name inc)})
+                   shorty.db/update-url (fn [~'_] 1)
                    shorty.db/increment-counter (fn [~'_] {:id (swap! ~io-name inc)})
                    clojure.core/future (fn [~'f] ~'f)]
        ~@body)))


better

better

--- exercism/clojure/word-count/src/word_count.clj
+++ exercism/clojure/word-count/src/word_count.clj
@@ -3,7 +3,6 @@

 (defn word-count [s]
   (->> s
-       (map str/lower-case)
-       str/join
-       (re-seq #"[a-z0-9]+")
+       str/lower-case
+       (re-seq #"\w+")
        frequencies))


Graceful shutdown, again.

Graceful shutdown, again.

--- src/circle/backend/action/load_balancer.clj
+++ src/circle/backend/action/load_balancer.clj
@@ -1,6 +1,8 @@
 (ns circle.backend.action.load-balancer
   (:import com.amazonaws.AmazonClientException)
   (:require [circle.backend.nodes :as nodes])
+  (:require [clj-http.client :as http])
+  (:use [clojure.tools.logging :only (infof)])
   (:use [circle.backend.action :only (defaction abort!)])
   (:use [circle.util.except :only (throw-if-not)])
   (:use [circle.backend.build :only (build-log)])
@@ -57,6 +59,14 @@
                     (not= (-> tag :value) current-rev))))
      (map #(-> % :resourceId)))))

+(defn graceful-shutdown [instance-id]
+  (infof "asking %s to shutdown gracefully" instance-id)
+  (let [resp (http/post (format "https://%s/api/system/shutdown" (ec2/public-ip instance-id))
+                        {:basic-auth ["bot@circleci.com" "brick amount must thirty"]
+                         ;; ignore SSL errors, in case this is a staging instance
+                         :insecure? true})]
+    (infof "graceful shutdown: got resp %s" resp)))
+
 (defaction shutdown-remove-old-revisions []
   {:name "remove old revisions"}
   (fn [build]
@@ -68,7 +78,7 @@
         (println "shutdown-remove-old:" old-instances)
         (when (seq old-instances)
           (lb/remove-instances lb-name old-instances)
-          (apply ec2/terminate-instances! old-instances))
+          (doall (map graceful-shutdown old-instances)))
         (when (seq terminated-instances)
           (lb/remove-instances lb-name terminated-instances))
         {:success true})


Fix tests due to spec issues

Fix tests due to spec issues

--- test/com/wsscode/pathom/connect_test.cljc
+++ test/com/wsscode/pathom/connect_test.cljc
@@ -1058,30 +1058,33 @@
 #?(:clj
    (deftest test-call-resolver*
      (testing "return value"
-       (is (= (pc/call-resolver* {::pc/resolver-dispatch (fn [_ _] "foo")} {})
+       (is (= (pc/call-resolver* {::pc/resolver-data {::pc/sym 'foo}
+                                  ::pc/resolver-dispatch (fn [_ _] "foo")} {})
              "foo")))

      (testing "return value async"
-       (is (= (async/<!! (pc/call-resolver* {::pc/resolver-dispatch (fn [_ _] (go "foo"))} {}))
+       (is (= (async/<!! (pc/call-resolver* {::pc/resolver-data {::pc/sym 'foo}
+                                             ::pc/resolver-dispatch (fn [_ _] (go "foo"))} {}))
              "foo")))

      (testing "throw sync error"
        (let [trace (atom [])]
          (is (thrown? ExceptionInfo
-               (pc/call-resolver* {::pc/resolver-dispatch (fn [_ _] (throw (ex-info "Error" {})))
+               (pc/call-resolver* {::pc/resolver-data {::pc/sym 'foo}
+                                   ::pc/resolver-dispatch (fn [_ _] (throw (ex-info "Error" {})))
                                    ::pt/trace*            trace} {})))
          (is (= (comparable-trace @trace)
-               [{:com.wsscode.pathom.connect/input-data {}
-                 :com.wsscode.pathom.connect/sym        nil
-                 :com.wsscode.pathom.core/path          []
-                 :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
-                 :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
-                 :com.wsscode.pathom.trace/label        nil
-                 :key                                   nil}
-                {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error - {}"
-                 :com.wsscode.pathom.core/path       []
-                 :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
-                 :com.wsscode.pathom.trace/event     :com.wsscode.pathom.connect/call-resolver}]))))))
+                '[{:com.wsscode.pathom.connect/input-data {}
+                   :com.wsscode.pathom.connect/sym        foo
+                   :com.wsscode.pathom.core/path          []
+                   :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
+                   :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        foo
+                   :key                                   nil}
+                  {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error - {}"
+                   :com.wsscode.pathom.core/path       []
+                   :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
+                   :com.wsscode.pathom.trace/event     :com.wsscode.pathom.connect/call-resolver}]))))))

 #?(:clj
    (deftest test-parallel


Improve default gauge color.

Improve default gauge color.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -107,6 +107,11 @@
   "The color for dim white buttons."
   (colors/darken white-color 90))

+(def default-track-color
+  "The color gauge tracks will use unless otherwise specified."
+  (colors/darken white-color 50))
+
+
 (defn send-sysex
   "Send a MIDI System Exclusive command to the Push 2 with the proper
   prefix. The `command` argument begins with the Command ID of the
@@ -635,7 +640,7 @@
   default color for both the track and active area is dim white."
   [controller index encoder-count value & {:keys [lowest highest track-color active-color]
                                            :or {lowest 0 highest 100
-                                                track-color dim-white-color active-color track-color}}]
+                                                track-color default-track-color active-color track-color}}]
   (let [graphics (create-graphics controller)
         range (- highest lowest)
         fraction (/ (- value lowest)  range)


unset the current doc when searching

unset the current doc when searching

--- frontpage-client/src/frontpage_client/core.cljs
+++ frontpage-client/src/frontpage_client/core.cljs
@@ -38,7 +38,8 @@
           (om/update! app :docs docs)
           (om/update! app :highlighting highlighting)
           (om/update! app :nof-docs nof-docs)
-          (om/update! app :facet-fields facet-fields)))))
+          (om/update! app :facet-fields facet-fields)
+          (om/update! app :current nil)))))
   ([app owner]
      "Search with retrieving the parameters from the app state, runs async."
        (let [{:keys [q page page-size selected-facet-values]} @app]


fix problems with datascript's design

fix problems with datascript's design

--- src-cljs/frontend/sente.cljs
+++ src-cljs/frontend/sente.cljs
@@ -88,6 +88,13 @@
                  (map ds/datom->transaction datoms)
                  {:server-update true})))

+;; Hack to deal with datascript's design decisions: https://github.com/tonsky/datascript/issues/76
+(defn sort-datoms [datoms]
+  (let [c (fn [d1 d2]
+            (compare (count (set/intersection #{:comment/parent :issue/votes :issue/comments} (set (keys d1))))
+                     (count (set/intersection #{:comment/parent :issue/votes :issue/comments} (set (keys d2))))))]
+    (sort c datoms)))
+
 (defmethod handle-message :issue/transaction [app-state message data]
   (let [datoms (:tx-data data)]
     (d/transact! (:issue-db @app-state)
@@ -98,7 +105,8 @@
                                      (merge {:db/id e}
                                             (reduce (fn [acc datom]
                                                       (assoc acc (:a datom) (:v datom)))
-                                                    {} datoms)))))
+                                                    {} datoms))))
+                              sort-datoms)
                        retracts (remove :added datoms)]
                    (concat adds
                            (map ds/datom->transaction retracts)))


(PE-962) Clean up SQL for initial `latest_reports` population

--- src/com/puppetlabs/puppetdb/scf/migrate.clj
+++ src/com/puppetlabs/puppetdb/scf/migrate.clj
@@ -334,13 +334,13 @@
   (sql/do-commands
     "INSERT INTO latest_reports (node, report)
         SELECT reports.certname, reports.hash
-        FROM reports
-           INNER JOIN (
+        FROM reports INNER JOIN (
           SELECT reports.certname, MAX(reports.end_time) as max_end_time
              FROM reports
              GROUP BY reports.certname
-           ) latest ON reports.certname = latest.certname AND reports.end_time = latest.max_end_time
-           ORDER BY reports.certname"))
+        ) latest
+          ON reports.certname = latest.certname
+          AND reports.end_time = latest.max_end_time"))

 ;; The available migrations, as a map from migration version to migration
 ;; function.


PDB-70 Add index on catalog_resources.exported

This increases performance for exported resource collection queries. For
postgresql the index is only a partial on exported = true, since indexing on
the very common 'false' case is not that effective.

Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>

--- src/com/puppetlabs/puppetdb/scf/migrate.clj
+++ src/com/puppetlabs/puppetdb/scf/migrate.clj
@@ -550,6 +550,18 @@
     "CREATE INDEX idx_catalog_resources_type_title
       ON catalog_resources (type)"))

+(defn add-index-on-exported-column
+  "This migration adds an index to catalog_resources.exported. It will
+  optionally create a partial index on PostgreSQL to reduce disk space, and
+  since the more common value is false its not useful to index this."
+  []
+  (sql/do-commands
+    (if (postgres?)
+      "CREATE INDEX idx_catalog_resources_exported_true
+         ON catalog_resources (exported) WHERE exported = true"
+      "CREATE INDEX idx_catalog_resources_exported
+         ON catalog_resources (exported)")))
+
 ;; The available migrations, as a map from migration version to migration function.
 (def migrations
   {1 initialize-store
@@ -568,7 +580,8 @@
    14 add-parameter-cache
    15 drop-duplicate-indexes
    16 drop-resource-tags-index
-   17 use-bigint-instead-of-catalog-hash})
+   17 use-bigint-instead-of-catalog-hash
+   18 add-index-on-exported-column})

 (def desired-schema-version (apply max (keys migrations)))


Inline spec docs on planner

Inline spec docs on planner

--- src/com/wsscode/pathom/connect/planner.cljc
+++ src/com/wsscode/pathom/connect/planner.cljc
@@ -7,54 +7,105 @@
             [com.wsscode.pathom.misc :as p.misc]
             [edn-query-language.core :as eql]))

-(>def ::node-id pos-int?)
-(>def ::node-id-set (s/coll-of ::node-id :kind set?))
-(>def ::graph (s/keys :req [::nodes]))
-(>def ::available-data :com.wsscode.pathom.connect/io-map)
-(>def ::after-nodes ::node-id-set)
-(>def ::attr-deps-trail :com.wsscode.pathom.connect/attributes-set)
-(>def ::branch-type #{::run-or ::run-and})
-(>def ::node-type #{::node-resolver ::node-and ::node-or ::node-unknown})
-(>def ::input :com.wsscode.pathom.connect/io-map)
-(>def ::index-attrs (s/map-of :com.wsscode.pathom.connect/attribute ::node-id))
-(>def ::index-syms (s/map-of :com.wsscode.pathom.connect/sym ::node-id-set))
-(>def ::node-depth nat-int?)
-(>def ::nodes (s/map-of ::node-id (s/keys)))
-(>def ::previous-graph ::graph)
-(>def ::requires :com.wsscode.pathom.connect/io-map)
-(>def ::root ::node-id)
-(>def ::run-and ::node-id-set)
-(>def ::run-next ::node-id)
-(>def ::run-next-trail (s/coll-of :com.wsscode.pathom.connect/sym :kind set?))
-(>def ::run-or ::node-id-set)
-(>def ::source-for-attrs :com.wsscode.pathom.connect/attributes-set)
-(>def ::source-sym :com.wsscode.pathom.connect/sym)
-(>def ::unreachable-attrs :com.wsscode.pathom.connect/attributes-set)
-(>def ::unreachable-syms (s/coll-of :com.wsscode.pathom.connect/sym :kind set?))
-
-(p.misc/spec-doc ::after-nodes "A node-id that points to the node before the current node. In regular execution nodes, this is the reverse of ::run-next, but in case of immediate children of branch nodes, this points to the branch node.")
-(p.misc/spec-doc ::available-data "An IO-MAP style declaring which data is already available when the planner starts.")
-(p.misc/spec-doc ::attr-deps-trail "A set containing attributes already in consideration when computing dependencies.")
-(p.misc/spec-doc ::branch-type "A set containing attributes already in consideration when computing dependencies.")
-(p.misc/spec-doc ::id-counter "An atom with a number, used to get the next node-id when creating new nodes.")
-(p.misc/spec-doc ::input "An IO-MAP description of required inputs to run the node.")
-(p.misc/spec-doc ::index-attrs "A index pointing from attribute to the node that provides its value.")
-(p.misc/spec-doc ::index-syms "An index from resolver symbol to a set of execution nodes where its used.")
-(p.misc/spec-doc ::node-id "ID for a execution node in the planner graph.")
-(p.misc/spec-doc ::node-depth "The node depth on the graph, starts on zero.")
-(p.misc/spec-doc ::nodes "The nodes index.")
-(p.misc/spec-doc ::node-type "Type of the nde, can be resolver, AND, OR or unknown.")
-(p.misc/spec-doc ::previous-graph "Graph before modifications, this is used to restore previous graph when some path ends up being unreachable.")
-(p.misc/spec-doc ::requires "An IO-MAP description of what is required from this execution node to returns.")
-(p.misc/spec-doc ::root "A node-id that defines the root in the planner graph.")
-(p.misc/spec-doc ::run-and "Vector containing nodes ids to run in a AND branch.")
-(p.misc/spec-doc ::run-next "A node-id that points to the next node to run.")
-(p.misc/spec-doc ::run-next-trail "A set containing node ids already in consideration when computing dependencies.")
-(p.misc/spec-doc ::run-or "Vector containing nodes ids to run in a AND branch.")
-(p.misc/spec-doc ::source-for-attrs "Set of attributes that are provided by this node.")
-(p.misc/spec-doc ::source-sym "On dynamic resolvers, this points to the original source resolver in the foreign parser.")
-(p.misc/spec-doc ::unreachable-attrs "A set containing the attributes that can't be reached considering current graph and available data.")
-(p.misc/spec-doc ::unreachable-syms "A set containing the resolvers that can't be reached considering current graph and available data.")
+(>def ::node-id
+  "ID for a execution node in the planner graph."
+  pos-int?)
+
+(>def ::node-id-set
+  "A set of node ids."
+  (s/coll-of ::node-id :kind set?))
+
+(>def ::graph
+  "The graph container, requires nodes."
+  (s/keys :req [::nodes]))
+
+(>def ::available-data
+  "An IO-MAP style declaring which data is already available when the planner starts."
+  :com.wsscode.pathom.connect/io-map)
+
+(>def ::after-nodes
+  "A node-id that points to the node before the current node. In regular execution nodes, this is the reverse of ::run-next, but in case of immediate children of branch nodes, this points to the branch node."
+  ::node-id-set)
+
+(>def ::attr-deps-trail
+  "A set containing attributes already in consideration when computing missing dependencies."
+  :com.wsscode.pathom.connect/attributes-set)
+
+(>def ::branch-type
+  "The branch type for a branch node, can be AND or OR"
+  #{::run-or ::run-and})
+
+(>def ::id-counter
+  "An atom with a number, used to get the next node-id when creating new nodes."
+  any?)
+
+(>def ::node-type
+  "Type of the nde, can be resolver, AND, OR or unknown."
+  #{::node-resolver ::node-and ::node-or ::node-unknown})
+
+(>def ::input
+  "An IO-MAP description of required inputs to run the node."
+  :com.wsscode.pathom.connect/io-map)
+
+(>def ::index-attrs
+  "A index pointing from attribute to the node that provides its value."
+  (s/map-of :com.wsscode.pathom.connect/attribute ::node-id))
+
+(>def ::index-syms
+  "An index from resolver symbol to a set of execution nodes where its used."
+  (s/map-of :com.wsscode.pathom.connect/sym ::node-id-set))
+
+(>def ::node-depth
+  "The node depth on the graph, starts on zero."
+  nat-int?)
+
+(>def ::nodes
+  "The nodes index."
+  (s/map-of ::node-id (s/keys)))
+
+(>def ::previous-graph
+  "Graph before modifications, this is used to restore previous graph when some path ends up being unreachable."
+  ::graph)
+
+(>def ::requires
+  "An IO-MAP description of what is required from this execution node to returns."
+  :com.wsscode.pathom.connect/io-map)
+
+(>def ::root
+  "A node-id that defines the root in the planner graph."
+  ::node-id)
+
+(>def ::run-and
+  "Vector containing nodes ids to run in a AND branch."
+  ::node-id-set)
+
+(>def ::run-next
+  "A node-id that points to the next node to run."
+  ::node-id)
+
+(>def ::run-next-trail
+  "A set containing node ids already in consideration when computing dependencies."
+  (s/coll-of :com.wsscode.pathom.connect/sym :kind set?))
+
+(>def ::run-or
+  "Vector containing nodes ids to run in a AND branch."
+  ::node-id-set)
+
+(>def ::source-for-attrs
+  "Set of attributes that are provided by this node."
+  :com.wsscode.pathom.connect/attributes-set)
+
+(>def ::source-sym
+  "On dynamic resolvers, this points to the original source resolver in the foreign parser."
+  :com.wsscode.pathom.connect/sym)
+
+(>def ::unreachable-attrs
+  "A set containing the attributes that can't be reached considering current graph and available data."
+  :com.wsscode.pathom.connect/attributes-set)
+
+(>def ::unreachable-syms
+  "A set containing the resolvers that can't be reached considering current graph and available data."
+  (s/coll-of :com.wsscode.pathom.connect/sym :kind set?))

 (def pc-sym :com.wsscode.pathom.connect/sym)
 (def pc-dyn-sym :com.wsscode.pathom.connect/dynamic-sym)
@@ -111,6 +162,7 @@
     graph))

 (defn update-node
+  "Update a given node in a graph, like Clojure native update."
   ([graph node-id k f]
    (if (get-node graph node-id)
      (update-in graph [::nodes node-id k] f)
@@ -144,7 +196,10 @@
     (assoc graph ::root node-id)
     (dissoc graph ::root)))

-(defn node-branches [node]
+(>defn node-branches
+  [node]
+  [(? (s/keys))
+   => (? (s/or :and ::run-and :or ::run-or))]
   (or (::run-and node)
       (::run-or node)))

@@ -154,7 +209,9 @@
   [::graph :com.wsscode.pathom.connect/attribute => (? ::node-id)]
   (get-in graph [::index-attrs attribute]))

-(defn branch-node? [node]
+(>defn branch-node?
+  [node]
+  [(? (s/keys)) => boolean?]
   (boolean (node-branches node)))

 (>defn node-kind


Added support for deleting tasks from queues.

--- src/appengine_magic/services/task_queues.clj
+++ src/appengine_magic/services/task_queues.clj
@@ -30,7 +30,9 @@
              queue)))))

-(defn add! [& {:keys [queue url join-current-transaction? params headers payload method
+;; TODO: Support adding multiple tasks at once.
+(defn add! [& {:keys [queue url task-name
+                      join-current-transaction? params headers payload method
                       countdown-ms eta-ms eta]
                :or {join-current-transaction? false
                     params {}
@@ -45,6 +47,9 @@
     ;; headers
     (doseq [[header-name header-value] headers]
       (.header opts header-name header-value))
+    ;; task naming
+    (when task-name
+      (.taskName opts task-name))
     ;; params
     (doseq [[param-name param-value] params]
       (.param opts
@@ -90,3 +95,14 @@
     (if join-current-transaction?
         (.add queue-obj ds/*current-transaction* opts)
         (.add queue-obj opts))))
+
+
+(defn purge! [& {:keys [queue]}]
+  (let [queue-obj (get-task-queue :queue queue)]
+    (.purge queue-obj)))
+
+
+;; TODO: Support deleting multiple tasks at once.
+(defn delete! [task & {:keys [queue]}]
+  (let [queue-obj (get-task-queue :queue queue)]
+    (.deleteTask queue-obj task)))


Speed up counting results by a factor of the number of CPU cores

--- src/clj/codejam_practice_solutions/practice/b_always_turn_left.clj
+++ src/clj/codejam_practice_solutions/practice/b_always_turn_left.clj
@@ -327,15 +327,16 @@

 (defn solve-file [file-name file-contents]
   (spit file-name
-        (s/join (map-indexed solve-and-print
-                             file-contents))))
+        (s/join (pmap solve-and-print
+                      (range)
+                      file-contents))))

 (comment

   (profile :info :whatever
-           (solve-file "input-small-output.txt"
+           (solve-file "B-small-practice.out"
                        input-small))

   (profile :info :whatever
-           (solve-file "input-large-output.txt"
+           (solve-file "B-large-practice.out"
                        input-large)))


Adapted lattice plugin to new context-editor structure

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/gui/editors/lattices.clj
+++ src/conexp/contrib/gui/editors/lattices.clj
@@ -15,7 +15,7 @@
 	[conexp.layout.base :only (lattice)]
 	conexp.graphics.draw
 	conexp.contrib.gui.util
-        conexp.contrib.gui.editors.context-editor
+        conexp.contrib.gui.editors.context-editor.context-editor
 	conexp.contrib.gui.plugins.base)
   (:use clojure.contrib.swing-utils)
   (:import [java.io File]))


fix test: subject's semantics should be {:human true}

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -631,7 +631,8 @@
                   :spec {:def :def}}
             :mod {:first {:pred :see
                           :tense :present
-                          :subj {:pred :lei}}}}})
+                          :subj {:pred :lei
+                                 :human true}}}}})

 (deftest generate-with-relative-clause
   (is (= "the woman she sees"


Move ack-error together with all the other events

--- src/cljs/mdr2/productions/in_production.cljs
+++ src/cljs/mdr2/productions/in_production.cljs
@@ -74,6 +74,11 @@
       (if empty?
         {:db db :dispatch [::fetch-productions]}
         {:db db}))))
+
+(rf/reg-event-db
+ ::ack-error
+ (fn [db [_ path]]
+   (fork/set-server-message db path nil)))

 (rf/reg-event-db
  ::ack-failure
@@ -290,11 +295,6 @@
           ^{:key option}
           [:option {:value option} option])]]]]]])

-(rf/reg-event-db
- ::ack-error
- (fn [db [_ path]]
-   (fork/set-server-message db path nil)))
-
 (defn split-form [id]
   [fork/form {:initial-values {:volumes 2
                                :sample-rate 22050


More docs

More docs

--- test/compound/docs.cljc
+++ test/compound/docs.cljc
@@ -385,7 +385,7 @@
    "L001" #{{:id 1, :name "bananas", :category "Long fruit"}},
    "P003" #{{:id 3, :name "tomatoes", :category "Pretend fruit"}}})

-"Built in Secondary indexes can have a custom keys too. It works the same way."
+"The built-in secondary indexes can have a custom keys too. It works the same way."

 (fact
   (-> (c/compound {:primary-index-def {:key :id


Linking to the latest docs from challenge 2-3

--- test/workshop/jobs/challenge_2_3_test.clj
+++ test/workshop/jobs/challenge_2_3_test.clj
@@ -34,7 +34,7 @@
 ;; so if you need a bit more of an explanation, you might want to consult
 ;; the documentation on this feature for hints:
 ;;
-;; https://github.com/onyx-platform/onyx/blob/0.8.x/doc/user-guide/functions.md#grouping--aggregation
+;; https://github.com/onyx-platform/onyx/blob/0.10.x/doc/user-guide/functions.adoc#grouping--aggregation
 ;;
 ;; Try it with:
 ;;


test for type-desc and class keywords

test for type-desc and class keywords

--- test/insn/util_test.clj
+++ test/insn/util_test.clj
@@ -65,4 +65,8 @@
   (testing "type seqs"
     (is (= "[I" (util/type-desc (list :int))))
     (is (= "[[Ljava/lang/Long;"
-           (util/type-desc [[Long]])))))
+           (util/type-desc [[Long]]))))
+
+  (testing "special keywords"
+    (binding [util/*this* "Foo"]
+      (is (= "LFoo;" (util/type-desc :this))))))


Fix share post copy.

Fix share post copy.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -31,7 +31,7 @@
 (def invite-instructions "%s has invited you to join the %s digest.")
 (def invite-button "Accept invitation")

-(def share-message "sent you a post")
+(def share-message "%s sent you a post on Carrot")
 (def share-cta "Read post")

 (def board-invite-message "%s invited you to join a private section")
@@ -142,12 +142,14 @@
          "circle/"
          filestack-resource)))

-(defn- note-author [avatar-url author]
+(defn- note-author [avatar-url author divider-line?]
   [:table {:class "row"}
     [:tr
       [:th {:class "small-12 large-12"}
-        horizontal-line
-        (spacer 16)
+        (when divider-line?
+          horizontal-line)
+        (when divider-line?
+          (spacer 16))
         [:img {:class "note-author-avatar" :src (circle-image avatar-url 32)}]
         [:span {:class "note-author-name"} author]]]])

@@ -307,7 +309,7 @@
       (spacer 40)
       (paragraph (format board-invite-explainer board-name board-url))
       (when show-note? (spacer 40))
-      (when show-note? (note-author from-avatar from))
+      (when show-note? (note-author from-avatar from true))
       (when show-note? (spacer 16))
       (when show-note? (paragraph note))
       (spacer 20)
@@ -339,7 +341,7 @@
       (h1 invite-message)
       (spacer 40)
       (paragraph (format invite-instructions from org-name))
-      (when show-note? (note-author from-avatar from))
+      (when show-note? (note-author from-avatar from true))
       (when show-note? (spacer 16))
       (when show-note? (paragraph note))
       (spacer 20)
@@ -369,9 +371,9 @@
       (spacer 40)
       (when logo? (org-logo entry))
       (when logo? (spacer 40))
-      (h1 (str from " " share-message))
+      (h1 (format share-message from))
       (when show-note? (spacer 40))
-      (when show-note? (note-author from-avatar from))
+      (when show-note? (note-author from-avatar from false))
       (when show-note? (spacer 16))
       (when show-note? (paragraph note))
       (spacer 40)


More playing with LinClosure

More playing with LinClosure

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/algorithms/linclosure.clj
+++ src/conexp/contrib/algorithms/linclosure.clj
@@ -7,81 +7,76 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.contrib.algorithms.linclosure
-  (:use [conexp.fca.implications :only (premise conclusion)])
-  (:import [java.util HashMap HashSet]))
+  (:use [conexp.base :only (difference)]
+        [conexp.fca.implications :only (premise conclusion make-implication)]))

 ;;;

-(defn close-under-implications
-  "Computes smallest superset of start being closed under given implications."
-  [implications start]
-  ;; this is LinClosure
-  (let [^HashMap counts (HashMap.),
-        ^HashMap list   (HashMap.),
-        ^HashSet update (HashSet. ^java.util.Collection start),
-        ^HashSet newdep (HashSet. ^java.util.Collection start)]
-    (doseq [impl implications,
-            :let [impl-count (count (premise impl))]]
-      (.put counts impl impl-count)
-      (if (zero? impl-count)
-        (do (.addAll update (conclusion impl))
-            (.addAll newdep (conclusion impl)))
-        (doseq [a (premise impl)]
-          (.put list a (conj (.get list a) impl)))))
-    (while (not (.isEmpty update))
-      (let [a (first update)]
-        (.remove update a)
-        (doseq [impl (.get list a)
-                :let [impl-count (.get counts impl)]]
-          (.put counts impl (dec impl-count))
-          (when (zero? (dec impl-count))
-            (doseq [x (conclusion impl)
-                    :when (not (.contains newdep x))]
-              (.add newdep x)
-              (.add update x))))))
-    (set newdep)))
-
-(defn close-under-implications*  ;; this is LinClosure
+(defn close-under-implications  ;; this is LinClosure
   "Computes smallest superset of start being closed under given implications."
   [implications start]
   (let [[counts list newdep] (loop [implications implications,
-                                    counts       {},
-                                    list         {},
+                                    counts       (transient {}),
+                                    list         (transient {}),
                                     newdep       (set start)]
                                (if-let [impl (first implications)]
                                  (let [impl-count (count (premise impl))]
-                                   (recur (rest implications)
-                                          (if (zero? impl-count)
+                                   (if (zero? impl-count)
+                                     (recur (rest implications)
                                             counts
-                                            (assoc counts impl impl-count))
-                                          (if (zero? impl-count)
                                             list
+                                            (into newdep (conclusion impl)))
+                                     (recur (rest implications)
+                                            (assoc! counts impl impl-count)
                                             (reduce (fn [list a]
-                                                      (assoc list a (conj (get list a) impl)))
+                                                      (assoc! list a (conj (get list a) impl)))
                                                     list
-                                                    (premise impl)))
-                                          (if (zero? impl-count)
-                                            (into newdep (conclusion impl))
+                                                    (premise impl))
                                             newdep)))
                                  [counts list newdep]))]
-    (loop [counts counts,
-           update (seq newdep),
+    (loop [counts (persistent! counts)
+           update newdep,
            newdep newdep]
       (if (empty? update)
         newdep
-        (let [a      (first update),
-              update (rest update),
-              counts (reduce (fn [counts impl]
-                               (assoc counts impl (dec (get counts impl))))
-                             counts
-                             (get list a)),
-              newdep (reduce (fn [newdep impl]
-                               (if (zero? (counts impl))
-                                 (into newdep (conclusion impl))
-                                 newdep))
-                             newdep
-                             (get list a))]
+        (let [a (first update),
+              [counts newdep update]
+                (reduce (fn [[counts newdep update] impl]
+                          (let [cnt (dec (get counts impl))]
+                            (if (zero? cnt)
+                              [(assoc counts impl cnt)
+                               (into newdep (conclusion impl))
+                               (into update (difference (conclusion impl) newdep))]
+                              [(assoc counts impl cnt)
+                               newdep
+                               update])))
+                        [counts newdep (disj update a)]
+                        (get list a))]
           (recur counts update newdep))))))
+
+(defn stem-base-from-base
+  "For a given set of implications returns its stem-base."
+  [implications]
+  (loop [stem-base    #{},
+         implications (pmap #(make-implication (premise %)
+                                               (close-under-implications implications
+                                                                         (into (premise %) (conclusion %))))
+                            implications),
+         all          (vec implications)]
+    (if (empty? implications)
+      stem-base
+      (let [A->B         (first implications),
+            implications (rest implications),
+            all          (subvec all 1)
+            A*           (close-under-implications all (premise A->B)),
+            A*->B        (make-implication A* (conclusion A->B))]
+        (if (not-empty (conclusion A*->B))
+          (recur (conj stem-base A*->B)
+                 implications
+                 (conj all A*->B))
+          (recur stem-base
+                 implications
+                 all))))))

 ;;;

@@ -96,7 +91,6 @@
                                B subsets-10])))

   (time (close-under-implications impls #{}))
-  (time (close-under-implications* impls #{}))
   (time (cm/close-under-implications impls #{}))

   nil)


Continue add co2 per capita diagram

Continue add co2 per capita diagram

--- src/clj_simple_chart/bp/bp_co2_per_capita_select.clj
+++ src/clj_simple_chart/bp/bp_co2_per_capita_select.clj
@@ -34,6 +34,9 @@
                        "Non OECD"
                        "China"
                        "India"
+                       ;"Qatar"
+                       ;"Singapore"
+                       "Bangladesh"
                        "South Africa"
                        "Brazil"
                        "Indonesia"])


GAWB-1688: Making preview disappear for empty file previews

--- src/cljs/main/broadfcui/common/gcs_file_preview.cljs
+++ src/cljs/main/broadfcui/common/gcs_file_preview.cljs
@@ -28,8 +28,7 @@
           (labeled "Google Bucket" (:bucket-name props))
           (labeled "Object" (:object props))
           [:div {:style {:marginTop "1em"}}
-           [:div {} (if (or (= data-size "0") (clojure.string/blank? data-size))
-                      "File empty"
+           [:div {} (when-not (or (= data-size "0") (clojure.string/blank? data-size))
                       "Previews for some filetypes may be unsupported. ")]
            (when (> data-size preview-byte-count) (str "Last " (:preview-line-count @state)
                                                        " lines are shown. Use link below to view entire file."))
@@ -47,18 +46,22 @@
             [:div {:style {:marginTop "1em"}}
              (labeled "File size"
                       (common/format-filesize data-size)
-                      [:span {:style {:marginLeft "1em"}}
-                       [:a {:href (common/gcs-object->download-url (:bucket-name props) (:object props))
-                            :onClick #(utils/set-access-token-cookie (utils/get-access-token))
-                            :target "_blank"}
-                        "Open"]
-                       [:span {:style {:fontStyle "italic" :color (:text-light style/colors)}}
-                        " (right-click to download)"]])
-             (labeled "Estimated download fee"
-                      (if (nil? cost) "Unknown" (common/format-price cost))
-                      [:span {:style {:marginLeft "1em"}}
-                       [:span {:style {:fontStyle "italic" :color (:text-light style/colors)}}
-                        " (non-US destinations may be higher)"]])
+                      (if (or (= data-size "0") (clojure.string/blank? data-size))
+                        (react/create-element [:span {:style {:marginLeft "2em" :fontWeight "bold"}} "File Empty"])
+                        (react/create-element
+                          [:span {:style {:marginLeft "1em"}}
+                           [:a {:href (common/gcs-object->download-url (:bucket-name props) (:object props))
+                                :onClick #(utils/set-access-token-cookie (utils/get-access-token))
+                                :target "_blank"}
+                            "Open"]
+                           [:span {:style {:fontStyle "italic" :color (:text-light style/colors)}}
+                            " (right-click to download)"]])))
+             (when-not (or (= data-size "0") (clojure.string/blank? data-size))
+               (labeled "Estimated download fee"
+                        (if (nil? cost) "Unknown" (common/format-price cost))
+                        [:span {:style {:marginLeft "1em"}}
+                         [:span {:style {:fontStyle "italic" :color (:text-light style/colors)}}
+                          " (non-US destinations may be higher)"]]))
              (if (:show-details? @state)
                [:div {}
                 (labeled "Created" (common/format-date (:timeCreated data)))


CMR-790: Added range validation to additional attribute parameter and aql search.

--- src/cmr/search/services/aql/converters/attribute.clj
+++ src/cmr/search/services/aql/converters/attribute.clj
@@ -5,7 +5,9 @@
             [cmr.search.models.query :as qm]
             [cmr.search.models.group-query-conditions :as gc]
             [cmr.search.services.parameters.converters.attribute :as p]
-            [cmr.common.date-time-parser :as date-time-parser]))
+            [cmr.search.services.messages.attribute-messages :as msg]
+            [cmr.common.date-time-parser :as date-time-parser]
+            [cmr.common.services.errors :as errors]))

 (defn- attrib-value->condition
   [attrib-type attrib-name value]
@@ -109,17 +111,19 @@
     ;; There is no datetimeRange element for AdditionalAttribute in AQL,
     ;; the dateRange element covers both the date type and datetime type of AA.
     ;; This is different from parameter search of AA.
-    (gc/or-conds
-      [(qm/map->AttributeRangeCondition
-         {:type :datetime
-          :name attrib-name
-          :min-value start-date
-          :max-value stop-date})
-       (qm/map->AttributeRangeCondition
-         {:type :date
-          :name attrib-name
-          :min-value start-date
-          :max-value stop-date})])))
+    (if (or start-date stop-date)
+      (gc/or-conds
+        [(qm/map->AttributeRangeCondition
+           {:type :datetime
+            :name attrib-name
+            :min-value start-date
+            :max-value stop-date})
+         (qm/map->AttributeRangeCondition
+           {:type :date
+            :name attrib-name
+            :min-value start-date
+            :max-value stop-date})])
+      {:errors [(msg/one-of-min-max-msg)]})))

 (defmethod attrib-value-element->condition :time
   [attrib-name value-elem]
@@ -130,11 +134,13 @@
 (defmethod attrib-value-element->condition :timeRange
   [attrib-name value-elem]
   (let [[start-time stop-time] (parse-time-range-element value-elem)]
-    (qm/map->AttributeRangeCondition
-      {:type :time
-       :name attrib-name
-       :min-value start-time
-       :max-value stop-time})))
+    (if (or start-time stop-time)
+      (qm/map->AttributeRangeCondition
+        {:type :time
+         :name attrib-name
+         :min-value start-time
+         :max-value stop-time})
+      {:errors [(msg/one-of-min-max-msg)]})))

 (defn- additional-attribute-element->conditions
   "Returns the query conditions of the given additionalAttribute element"
@@ -142,6 +148,13 @@
   (let [attrib-name (cx/string-at-path additional-attribute [:additionalAttributeName])
         attrib-value (first (cx/content-at-path additional-attribute [:additionalAttributeValue]))]
     (attrib-value-element->condition attrib-name attrib-value)))
+
+(defn- raise-condition-errors
+  "Raise condition errors if there are validation errors in the conditions"
+  [conditions]
+  (let [validation-errors (mapcat :errors conditions)]
+    (when (seq validation-errors)
+      (errors/throw-service-errors :bad-request validation-errors))))

 ;; Converts additionalAttributes element into query condition, returns the converted condition
 (defmethod a/element->condition :attribute
@@ -152,6 +165,7 @@
         attrib-condition (if (= "OR" operator)
                            (gc/or-conds conditions)
                            (gc/and-conds conditions))]
+    (raise-condition-errors conditions)
     (if (= :granule concept-type)
       ;; Granule attribute queries will inherit values from their parent collections.
       (gc/or-conds [attrib-condition (qm/->CollectionQueryCondition attrib-condition)])


Forces processing when state scanning in k8s (#1614)

--- scheduler/src/cook/kubernetes/controller.clj
+++ scheduler/src/cook/kubernetes/controller.clj
@@ -582,23 +582,27 @@

 (defn synthesize-state-and-process-pod-if-changed
   "Synthesizes the k8s-actual-state for the given
-  pod and calls process if the state changed."
-  [{:keys [k8s-actual-state-map name] :as compute-cluster} pod-name ^V1Pod pod]
-  (let [new-state {:pod pod
-                   :synthesized-state (api/pod->synthesized-pod-state pod)
-                   :sandbox-file-server-container-state (api/pod->sandbox-file-server-container-state pod)}
-        old-state (get @k8s-actual-state-map pod-name)]
-    ; We always store the updated state, but only reprocess it if it is genuinely different.
-    (swap! k8s-actual-state-map assoc pod-name new-state)
-    (let [new-file-server-state (:sandbox-file-server-container-state new-state)
-          old-file-server-state (:sandbox-file-server-container-state old-state)]
-      (when (and (= new-file-server-state :running) (not= old-file-server-state :running))
-        (record-sandbox-url pod-name new-state)))
-    (when-not (k8s-actual-state-equivalent? old-state new-state)
-      (try
-        (process compute-cluster pod-name)
-        (catch Exception e
-          (log/error e "In compute-cluster" name ", error while processing pod" pod-name))))))
+  pod and calls process if the state changed, or
+  if force-process? is true."
+  ([compute-cluster pod-name ^V1Pod pod]
+   (synthesize-state-and-process-pod-if-changed compute-cluster pod-name pod false))
+  ([{:keys [k8s-actual-state-map name] :as compute-cluster} pod-name ^V1Pod pod force-process?]
+   (let [new-state {:pod pod
+                    :synthesized-state (api/pod->synthesized-pod-state pod)
+                    :sandbox-file-server-container-state (api/pod->sandbox-file-server-container-state pod)}
+         old-state (get @k8s-actual-state-map pod-name)]
+     ; We always store the updated state, but only reprocess it if it is genuinely different.
+     (swap! k8s-actual-state-map assoc pod-name new-state)
+     (let [new-file-server-state (:sandbox-file-server-container-state new-state)
+           old-file-server-state (:sandbox-file-server-container-state old-state)]
+       (when (and (= new-file-server-state :running) (not= old-file-server-state :running))
+         (record-sandbox-url pod-name new-state)))
+     (when (or force-process?
+               (not (k8s-actual-state-equivalent? old-state new-state)))
+       (try
+         (process compute-cluster pod-name)
+         (catch Exception e
+           (log/error e "In compute-cluster" name ", error while processing pod" pod-name)))))))

 (defn pod-update
   "Handles a pod update from the pod watch."
@@ -667,4 +671,4 @@
       name
       pod-name
       (let [{:keys [pod]} (get @k8s-actual-state-map pod-name)]
-        (synthesize-state-and-process-pod-if-changed compute-cluster pod-name pod)))))
+        (synthesize-state-and-process-pod-if-changed compute-cluster pod-name pod true)))))


Release 0.10.0.

Release 0.10.0.

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

-(defproject uncomplicate/neanderthal "0.10.0-SNAPSHOT"
+(defproject uncomplicate/neanderthal "0.11.0-SNAPSHOT"
   :description "Neanderthal is a Clojure library for fast matrix and linear algebra computations."
   :url "https://github.com/uncomplicate/neanderthal"
   :scm {:name "git"


up deps

up deps

- cljs, mesh, nrepl, figwheel

--- project.clj
+++ project.clj
@@ -16,10 +16,10 @@
                  [sablono "0.3.4"]
                  [secretary "1.2.3"]
                  [cljs-http "0.1.30"]
-                 [garden "1.2.5"]
-                 [facjure/mesh "0.2.7"]]
+                 [facjure/mesh "0.3.0"]]

-  :plugins [[lein-cljsbuild "1.0.6"]
+  :plugins [[cider/cider-nrepl "0.9.1"]
+            [lein-cljsbuild "1.0.6"]
             [com.cemerick/clojurescript.test "0.2.3"]
             [lein-figwheel "0.3.3"]
             [lein-garden "0.2.5"]
@@ -47,18 +47,19 @@
               :test-commands {"unit-tests" ["phantomjs" :runner]}}

   :garden {:builds [{:id "design"
-                     :source-paths ["src/design"]
+                     :source-paths ["src"]
                      :stylesheet layout.index/styles
                      :compiler {:output-to "resources/public/css/styles.css"
                                 :pretty-print true}}
                     {:id "prod"
-                     :source-paths ["src/design"]
+                     :source-paths ["src"]
                      :stylesheet layout.index/styles
                      :compiler {:output-to "dist/styles.min.css"
                                 :pretty-print? false}}]}

   :profiles {:dev {:env {:is-dev true}
-                   :dependencies [[com.cemerick/clojurescript.test "0.3.3"]
+                   :dependencies [[org.clojure/tools.nrepl "0.2.10"]
+                                  [com.cemerick/clojurescript.test "0.3.3"]
                                   [figwheel "0.3.3"]
                                   [figwheel-sidecar "0.3.3"]
                                   [ring/ring-json "0.3.1"]


(maint) Update clj-parent to 4.6.24

(maint) Update clj-parent to 4.6.24

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (def pdb-version "6.16.2-SNAPSHOT")

-(def clj-parent-version "4.6.23")
+(def clj-parent-version "4.6.24")

 (defn true-in-env? [x]
   (#{"true" "yes" "1"} (System/getenv x)))


bump to RC9

bump to RC9

--- project.clj
+++ project.clj
@@ -39,7 +39,7 @@
        (vec (set (concat (get JVMOPTS :any)
                          (get JVMOPTS os))))))

-(defproject overtone "0.8.0-RC8"
+(defproject overtone "0.8.0-RC9"
   :description "Collaborative Programmable Music. (http://overtone.github.com)"
   :url "http://overtone.github.com/"
   :dependencies [[org.clojure/clojure "1.3.0"]