Fix outer-rect calculation for neested groups and add inner-rect function.

--- src/uxbox/util/geom.cljs
+++ src/uxbox/util/geom.cljs
@@ -306,25 +306,169 @@
          :rx (mth/abs (- x2 x1))
          :ry (mth/abs (- y2 y1))))

+;; --- Inner Rect
+
+(declare apply-rotation-transformation)
+(declare generic-inner-rect)
+(declare circle-inner-rect)
+(declare group-inner-rect)
+
+(defn inner-rect
+  ([shape] (inner-rect @st/state shape))
+  ([state shape]
+   (case (:type shape)
+     :icon (generic-inner-rect state shape)
+     :rect (generic-inner-rect state shape)
+     :text (generic-inner-rect shape shape)
+     :line (generic-inner-rect state shape)
+     :circle (circle-inner-rect state shape)
+     :group (group-inner-rect state shape))))
+
+(defn- generic-inner-rect
+  [state {:keys [x1 y1] :as shape}]
+  (-> (assoc shape :x x1 :y y1)
+      (merge (size shape))
+      (apply-rotation-transformation)))
+
+(defn- circle-inner-rect
+  [state {:keys [cx cy rx ry group] :as shape}]
+  (let [props {:x (- cx rx)
+               :y (- cy ry)
+               :width (* rx 2)
+               :height (* ry 2)}]
+    (-> (merge shape props)
+        (apply-rotation-transformation))))
+
+(defn- group-inner-rect
+  [state {:keys [id group rotation dx dy] :as shape}]
+  (let [shapes (->> (:items shape)
+                    (map #(get-in state [:shapes-by-id %]))
+                    (map #(inner-rect state %)))
+        x (apply min (map :x shapes))
+        y (apply min (map :y shapes))
+        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
+        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
+        width (- x' x)
+        height (- y' y)
+        x (+ x dx)
+        y (+ y dy)]
+    (-> (merge shape {:width width :height height :x x :y y})
+        (apply-rotation-transformation))))
+
 ;; --- Outer Rect

 (declare generic-outer-rect)
-(declare line-outer-rect)
 (declare circle-outer-rect)
 (declare group-outer-rect)
 (declare apply-rotation-transformation)
+(declare apply-parent-deltas)

 (defn outer-rect
   ([shape]
    (outer-rect @st/state shape))
   ([state shape]
-   (case (:type shape)
-     :rect (generic-outer-rect state shape)
-     :text (generic-outer-rect state shape)
-     :icon (generic-outer-rect state shape)
-     :line (line-outer-rect state shape)
-     :circle (circle-outer-rect state shape)
-     :group (group-outer-rect state shape))))
+   (let [shape (case (:type shape)
+                 :rect (generic-outer-rect state shape)
+                 :text (generic-outer-rect state shape)
+                 :icon (generic-outer-rect state shape)
+                 :line (generic-outer-rect state shape)
+                 :circle (circle-outer-rect state shape)
+                 :group (group-outer-rect state shape))]
+     (if (:group shape)
+       (let [group (get-in state [:shapes-by-id (:group shape)])]
+         (apply-parent-deltas state shape (:group group)))
+       shape))))
+
+(defn- apply-parent-deltas
+  [state {:keys [x y] :as shape} id]
+  (if-let [group (get-in state [:shapes-by-id id])]
+    (let [props {:x (+ x (:dx group 0))
+                 :y (+ y (:dy group 0))}]
+      (apply-parent-deltas state (merge shape props) (:group group)))
+    shape))
+
+(defn- generic-outer-rect
+  [state {:keys [x1 y1 x2 y2 group] :as shape}]
+  (let [group (get-in state [:shapes-by-id group])
+        props {:x (+ x1 (:dx group 0))
+               :y (+ y1 (:dy group 0))
+               :width (- x2 x1)
+               :height (- y2 y1)}]
+    (-> (merge shape props)
+        (apply-rotation-transformation))))
+
+(defn- circle-outer-rect
+  [state {:keys [cx cy rx ry group] :as shape}]
+  (let [group (get-in state [:shapes-by-id group])
+        props {:x (+ (- cx rx) (:dx group 0))
+               :y (+ (- cy ry) (:dy group 0))
+               :width (* rx 2)
+               :height (* ry 2)}]
+    (-> (merge shape props)
+        (apply-rotation-transformation))))
+
+(defn- group-outer-rect
+  [state {:keys [id group rotation dx dy] :as shape}]
+  (let [shapes (->> (:items shape)
+                    (map #(get-in state [:shapes-by-id %]))
+                    (map #(outer-rect state %)))
+        x (apply min (map :x shapes))
+        y (apply min (map :y shapes))
+        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
+        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
+        width (- x' x)
+        height (- y' y)]
+    (-> (merge shape {:width width :height height :x x :y y})
+        (apply-rotation-transformation))))
+
+(declare apply-rotation)
+
+(defn- apply-rotation-transformation
+  [{:keys [x y width height rotation] :as shape}]
+  (let [center-x (+ x (/ width 2))
+        center-y (+ y (/ height 2))
+
+        angle (mth/radians (or rotation 0))
+        x1 (- x center-x)
+        y1 (- y center-y)
+
+        x2 (- (+ x width) center-x)
+        y2 (- y center-y)
+
+        [rx1 ry1] (apply-rotation [x1 y1] rotation)
+        [rx2 ry2] (apply-rotation [x2 y2] rotation)
+
+        [d1 d2] (cond
+                  (and (>= rotation 0)
+                       (< rotation 90))
+                  [(mth/abs ry1)
+                   (mth/abs rx2)]
+
+                  (and (>= rotation 90)
+                       (< rotation 180))
+                  [(mth/abs ry2)
+                   (mth/abs rx1)]
+
+                  (and (>= rotation 180)
+                       (< rotation 270))
+                  [(mth/abs ry1)
+                   (mth/abs rx2)]
+
+                  (and (>= rotation 270)
+                       (<= rotation 360))
+                  [(mth/abs ry2)
+                   (mth/abs rx1)])
+        final-x (- center-x d2)
+        final-y (- center-y d1)
+        final-width (* d2 2)
+        final-height (* d1 2)]
+    (merge shape
+           {:x final-x
+            :y final-y
+            :width final-width
+            :height final-height})))
+
+;; --- Outer Rect Coll

 (defn outer-rect-coll
   [shapes]
@@ -340,95 +484,6 @@
      :height height
      :x x
      :y y}))
-
-(defn- generic-outer-rect
-  [state {:keys [x1 y1] :as shape}]
-  (-> (assoc shape :x x1 :y y1)
-      (merge (size shape))
-      (apply-rotation-transformation)))
-
-(defn- line-outer-rect
-  [state {:keys [x1 y1 x2 y2 group] :as shape}]
-  (let [group (get-in state [:shapes-by-id group])
-        props {:x (+ x1 (:dx group 0))
-               :y (+ y1 (:dy group 0))
-               :width (- x2 x1)
-               :height (- y2 y1)}]
-    (-> (merge shape props)
-        (apply-rotation-transformation))))
-
-(defn- circle-outer-rect
-  [state {:keys [cx cy rx ry group] :as shape}]
-  (let [group (get-in state [:shapes-by-id group])
-        props {:x (+ (- cx rx) (:dx group 0))
-               :y (+ (- cy ry) (:dy group 0))
-               :width (* rx 2)
-               :height (* ry 2)}]
-    (-> (merge shape props)
-        (apply-rotation-transformation))))
-
-(defn- group-outer-rect
-  [state {:keys [id group rotation dx dy] :as shape}]
-  (let [shapes (->> (:items shape)
-                    (map #(get-in @st/state [:shapes-by-id %]))
-                    (map (partial outer-rect state)))
-        x (apply min (map :x shapes))
-        y (apply min (map :y shapes))
-        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
-        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
-        width (- x' x)
-        height (- y' y)
-        x (+ x dx)
-        y (+ y dy)]
-    (-> (merge shape {:width width :height height :x x :y y})
-        (apply-rotation-transformation))))
-
-(declare apply-rotation)
-
-(defn- apply-rotation-transformation
-  [{:keys [x y width height rotation] :as shape}]
-  (let [center-x (+ x (/ width 2))
-        center-y (+ y (/ height 2))
-
-        angle (mth/radians (or rotation 0))
-        x1 (- x center-x)
-        y1 (- y center-y)
-
-        x2 (- (+ x width) center-x)
-        y2 (- y center-y)
-
-        [rx1 ry1] (apply-rotation [x1 y1] rotation)
-        [rx2 ry2] (apply-rotation [x2 y2] rotation)
-
-        [d1 d2] (cond
-                  (and (>= rotation 0)
-                       (< rotation 90))
-                  [(mth/abs ry1)
-                   (mth/abs rx2)]
-
-                  (and (>= rotation 90)
-                       (< rotation 180))
-                  [(mth/abs ry2)
-                   (mth/abs rx1)]
-
-                  (and (>= rotation 180)
-                       (< rotation 270))
-                  [(mth/abs ry1)
-                   (mth/abs rx2)]
-
-                  (and (>= rotation 270)
-                       (<= rotation 360))
-                  [(mth/abs ry2)
-                   (mth/abs rx1)])
-        final-x (- center-x d2)
-        final-y (- center-y d1)
-        final-width (* d2 2)
-        final-height (* d1 2)]
-    (merge shape
-           {:x final-x
-            :y final-y
-            :width final-width
-            :height final-height})))

 ;; --- Transformation Matrix

@@ -496,7 +551,7 @@
   [state {:keys [dx dy rotation items] :or {rotation 0} :as shape}]
   (let [shapes-by-id (get state :shapes-by-id)
         shapes (map #(get shapes-by-id %) items)
-        {:keys [x y width height]} (outer-rect shapes)
+        {:keys [x y width height]} (outer-rect-coll shapes)
         center-x (+ x (/ width 2))
         center-y (+ y (/ height 2))]
     (-> (gmt/matrix)


Switch to metadata for tagged value doc detection.

--- src/vault/data/print.clj
+++ src/vault/data/print.clj
@@ -139,15 +139,14 @@

 (defmethod canonize :tagged-value
   [v]
-  [:span (color-text (str \# (data/tag v)) :red) " " (canonize (data/value v))])
+  ^:tagged-value
+  [:span (color-text (str \# (data/tag v)) :red)
+   " " (canonize (data/value v))])

 (defn- tagged-value-doc?
   [doc]
-  (and (seq doc)
-       (= (first doc) :span)
-       (string? (second doc))
-       (re-matches #"#[\w\/.-]+" (second doc))))
+  (:tagged-value (meta doc)))

 (defmethod canonize :default


CMR-343: corrected commented items

CMR-343: corrected commented items

--- test/cmr/system_int_test/search/granule_search_test.clj
+++ test/cmr/system_int_test/search/granule_search_test.clj
@@ -17,7 +17,7 @@

   )

-#_(deftest search-by-provider-id
+(deftest search-by-provider-id
   (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV2" (dc/collection {}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:granule-ur "Granule1"}))
@@ -56,7 +56,7 @@
         (is (is (= #{"Granule1" "Granule2" "Granule3"}
                    (set (map :name refs)))))))))

-#_(deftest search-by-dataset-id
+(deftest search-by-dataset-id
   (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {:entry-title "OneCollectionV1"}))
         coll2 (d/ingest "CMR_PROV1" (dc/collection {:entry-title "AnotherCollectionV1"}))
         coll3 (d/ingest "CMR_PROV2" (dc/collection {:entry-title "OneCollectionV1"}))
@@ -127,7 +127,7 @@
                  {:entry-title "TestCollection"
                   :granule-ur "sampleur3"}]})

-#_(deftest search-by-granule-ur
+(deftest search-by-granule-ur
   (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV2" (dc/collection {}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:granule-ur "Granule1"}))
@@ -186,7 +186,7 @@
         (is (= #{"SampleUR1" "SampleUR2" "sampleur3"}
                (set (map :name refs))))))))

-
+(deftest search-by-cloud-cover
   (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV2" (dc/collection {}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:cloud-cover 0.8}))


Added when-selected macro

Added when-selected macro

Makes for an easier time defining actions.

--- desktop/src-common/escape_game/core.clj
+++ desktop/src-common/escape_game/core.clj
@@ -64,6 +64,15 @@
     :action (fn
               [ent# screen# entities#]
               (switch-to-room (:current-room screen#) ~target))))
+
+;; these macros capture the symbols ent, screen and entities so they
+;; can be used in the body
+(defmacro when-selected
+  [item & body]
+  `(fn ~['ent 'screen 'entities]
+     (if (selected? ~'screen ~item)
+       (do ~@body)
+       ~'ent)))

 ;; small macro to make code more terse


schema bug, that requires :cljsbuild when :figwheel :builds are present

--- sidecar/src/figwheel_sidecar/schemas/config.clj
+++ sidecar/src/figwheel_sidecar/schemas/config.clj
@@ -900,9 +900,9 @@

 (def-key ::lein-project-with-figwheel-builds
   (strict-keys
-   :opt-un [:figwheel.lein-project.require-builds/figwheel]
+   :req-un [:figwheel.lein-project.require-builds/figwheel]
    ;; don't require builds in cljsbuild
-   :req-un [:cljsbuild.lein-project/cljsbuild]))
+   :opt-un [:cljsbuild.lein-project/cljsbuild]))

 (defn must-have-one-opt-none-build [with-builds]
   (if (and (or (map? (:builds with-builds))


Add the layout to the new post page

Add the layout to the new post page

--- src/blog/pages.clj
+++ src/blog/pages.clj
@@ -11,19 +11,15 @@
           (include-js "/javascripts/main.js")]))

 (defn new-post []
-  (html5 [:head
-          [:title "Blog"]
-          (include-css "/css/main.css")]
-         [:body
-          [:h1 "Blog"]
-          (form/form-to [:post "/posts/new"]
-                        (form/label :title "Title")
-                        (form/text-field :title)
-                        (form/label :content "Body")
-                        (form/text-area :content)
-                        (form/submit-button "Create New Post"))
-          [:a {:href "/"} "Back"]
-          (include-js "/javascripts/main.js")]))
+  (layout "New Post"
+         [:h1 "New Post"]
+         (form/form-to [:post "/posts/new"]
+                       (form/label :title "Title")
+                       (form/text-field :title)
+                       (form/label :content "Body")
+                       (form/text-area :content)
+                       (form/submit-button "Create New Post"))
+         [:a {:href "/"} "Back"]))

 (defn show-post [post]
   (layout (str "Blog - " (:title post))


small api changes

small api changes

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -906,10 +906,8 @@
 (def default-interval 0.1)

 (defn wait
-  ([driver sec]
-   (wait sec))
-  ([sec]
-   (Thread/sleep (* sec 1000))))
+  [sec]
+  (Thread/sleep (* sec 1000)))

 (defn wait-predicate
   ([pred]
@@ -937,11 +935,20 @@
 (defn wait-exists [driver q & [opt]]
   (wait-predicate #(exists? driver q) opt))

+(defn wait-absent [driver q & [opt]]
+  (wait-predicate #(absent? driver q) opt))
+
 (defn wait-visible [driver q & [opt]]
   (wait-predicate #(visible? driver q) opt))

+(defn wait-invisible [driver q & [opt]]
+  (wait-predicate #(invisible? driver q) opt))
+
 (defn wait-enabled [driver q & [opt]]
   (wait-predicate #(enabled? driver q) opt))
+
+(defn wait-disabled [driver q & [opt]]
+  (wait-predicate #(disabled? driver q) opt))

 (defn wait-has-alert [driver & [opt]]
   (wait-predicate #(has-alert? driver) opt))


Use utils for image

Use utils for image

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -3,7 +3,7 @@
             [frontend.components.common :as common]
             [frontend.config :as config]
             [frontend.utils.html :as html]
-
+            [frontend.utils :as utils :include-macros true]
             [frontend.models.build :as build-model]
             [frontend.models.project :as project-model]
             [frontend.models.plan :as pm]
@@ -29,7 +29,7 @@
         (common/ico :logo)]
        [:a.logomark-narrow.hidden-md-up {:href "/dashboard"
                      :aria-label "Dashboard"}
-        [:img {:src (common/icon-path "Logo-Wordmark")}]]
+        [:img {:src (utils/cdn-path "/img/inner/icons/Logo-Wordmark.svg")}]]
        [:ul.nav-items.collapsing-nav
          [:li
            [:a.has-icon {:href "/dashboard"


update comment

update comment

--- test/misaki/test/core.clj
+++ test/misaki/test/core.clj
@@ -173,21 +173,7 @@
     (is (.exists file))
     (.delete file)))

-; ---------------
-
-;;; default site data
-(deftest* default-site-data-test
-  (let [file (template-name->file "site.html.clj")]
-    (is (= "
default title
" (html (generate-html file))))))
-
-;;; format
-(deftest* template-format-test
-  (are [x y] (= x (:format (meta (generate-html (template-name->file y)))))
-    "html5" "no_format.html.clj"
-    "xhtml" "with_format.html.clj"
-    "html4" "with_layout_format.html.clj"))
-
-
+;;; compile-template
 (deftest* compile-template-test
   (let [tmpl (io/file (str *template-dir* "index.html.clj"))
         res (compile-template tmpl)
@@ -196,6 +182,20 @@
     (is (.exists file))
     (.delete file)))

+;;; default site data
+(deftest* default-site-data-test
+  (let [file (template-name->file "site.html.clj")]
+    (is (= "
default title
" (html (generate-html file))))))
+
+;;; format check
+(deftest* template-format-test
+  (are [x y] (= x (:format (meta (generate-html (template-name->file y)))))
+    "html5" "no_format.html.clj"
+    "xhtml" "with_format.html.clj"
+    "html4" "with_layout_format.html.clj"))
+
+
+;;; functions in template test
 (deftest* html-function-template-test
   (is (= "
link
"
          (-> "html.test.html.clj" template-name->file generate-html html))))


OK fine cap-key

OK fine cap-key

--- src/icecap/api.clj
+++ src/icecap/api.clj
@@ -12,9 +12,9 @@
   "Creates a capability."
   [plan & {store :store kdf :kdf scheme :scheme}]
   (let [cap (crypto/make-cap)
-        {index :index key :key} (crypto/derive kdf cap)
+        {index :index cap-key :cap-key} (crypto/derive kdf cap)
         encoded-plan (nippy/freeze plan)
-        blob (crypto/encrypt scheme key encoded-plan)
+        blob (crypto/encrypt scheme cap-key encoded-plan)
         ch (create! store index blob)]
     (async/into {:cap cap} ch)))


cyanite: typo snuck through

cyanite: typo snuck through

--- src/io/cyanite.clj
+++ src/io/cyanite.clj
@@ -98,7 +98,7 @@
       (sig/with-handler :hup
         (info "caught SIGHUP, reloading")
         (swap! system (comp component/start-system
-                            component/stop-sytsem)))
+                            component/stop-system)))

       (info "ready to start the system")
       (swap! system component/start-system)))


network/create -> fix checkboxes

network/create -> fix checkboxes

--- src/cljs/swarmpit/component/network/create.cljs
+++ src/cljs/swarmpit/component/network/create.cljs
@@ -49,19 +49,22 @@
 (defn- form-internal [value]
   (comp/checkbox
     {:checked  value
-     :onChange #(state/update-value [:internal] (-> % .-target .-value) state/form-value-cursor)}))
+     :value    value
+     :onChange #(state/update-value [:internal] (-> % .-target .-checked) state/form-value-cursor)}))

 (defn- form-attachable [value ingres?]
   (comp/checkbox
     {:checked  value
      :disabled ingres?
-     :onCheck  #(state/update-value [:attachable] (-> % .-target .-value) state/form-value-cursor)}))
+     :value    value
+     :onChange #(state/update-value [:attachable] (-> % .-target .-checked) state/form-value-cursor)}))

 (defn- form-ingress [value attachable?]
   (comp/checkbox
     {:checked  value
      :disabled attachable?
-     :onCheck  #(state/update-value [:ingress] (-> % .-target .-value) state/form-value-cursor)}))
+     :value    value
+     :onChange #(state/update-value [:ingress] (-> % .-target .-checked) state/form-value-cursor)}))

 (defn- section-general
   [{:keys [name internal attachable ingress]}]
@@ -99,8 +102,9 @@

 (defn- form-ipv6 [value]
   (comp/checkbox
-    {:checked value
-     :onCheck #(state/update-value [:enableIPv6] (-> % .-target .-value) state/form-value-cursor)}))
+    {:checked  value
+     :value    value
+     :onChange #(state/update-value [:enableIPv6] (-> % .-target .-checked) state/form-value-cursor)}))

 (defn- form-subnet [value]
   (comp/text-field


fixed ls for wildcard paths (regex)

fixed ls for wildcard paths (regex)

--- src/mapfs/core.clj
+++ src/mapfs/core.clj
@@ -66,6 +66,10 @@
   [r]
   (instance? java.util.regex.Pattern r))

+(defn wildcard-path?
+  [key-path]
+  (regex? (second (path-split key-path))))
+
 (defn- get-absolute-path
   [path]
   (reduce
@@ -80,7 +84,7 @@
   (let [p (if (keyword? parts) [parts] parts)
         [base last-path] (path-split p)]
     (if (regex? last-path)
-      (let [base-path (resolve-path base)
+      (let [base-path (resolve-single-path base)
             base-dir (get-in @FS_ROOT base-path)
             ks (filter #(re-matches last-path (str %)) (keys base-dir))]
         (if (empty? ks)
@@ -103,7 +107,7 @@
   (let [p (resolve-path key-path)
         paths (.paths p)
         values
-        (if (= 1 (count paths))
+        (if (not (wildcard-path? key-path))
           (map #(conj (first paths) %)
                (sort (keys (get-in @FS_ROOT (first paths)))))
           (sort paths))]


example: v0.1.11-SNAPSHOT

example: v0.1.11-SNAPSHOT

--- example/project.clj
+++ example/project.clj
@@ -1,10 +1,10 @@
-(defproject example "0.1.10"
+(defproject example "0.1.11-SNAPSHOT"
   :description "Example Application for Inspect Library"
   :url "https://github.com/matthiasn/inspect"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [com.matthiasnehlsen/inspect "0.1.10"]
+                 [com.matthiasnehlsen/inspect "0.1.11-SNAPSHOT"]
                  [clj-pid "0.1.1"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]]


Fix title display

Fix title display

--- src/pomo/core.cljs
+++ src/pomo/core.cljs
@@ -23,8 +23,8 @@
 (defn update-title [to]
   (aset js/document "title" to))

-(add-watch app-state :update-title (fn [_ _ _ {s :seconds}]
-                                     (update-title (fmtsecs s))))
+(add-watch app-state :update-title (fn [_ _ _ n]
+                                     (update-title (fmtsecs (model/seconds-remaining s)))))

 (add-watch app-state :times-up (fn [_ _ o n]
                                  (when (and (>= (model/seconds-remaining o) 0) (< (model/seconds-remaining n) 0))


Simplify by removing future - we really need to stay synchronous

--- src/reply/core.clj
+++ src/reply/core.clj
@@ -6,51 +6,60 @@
            [java.io File
                     PrintWriter]))

-(def input-getter (atom (future)))
+; TODO: allow multi-line input
+(defn actual-read [input request-prompt request-exit]
+  (binding [*in* (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. input))]
+    (clojure.main/repl-read request-prompt request-exit)))
+
+(def main-thread (Thread/currentThread))
+(def jline-reader (atom nil))

 (defn handle-ctrl-c [signal]
   (println "^C")
-  (future-cancel @input-getter))
+  (.interrupt main-thread)
+  (-> (.getCursorBuffer @jline-reader)
+      (.clear)))

-(defn jline-read [reader request-prompt request-exit]
+(defn make-reader []
+  (let [reader (ConsoleReader.)
+        home (System/getProperty "user.home")
+        history (FileHistory. (File. home ".jline-reply.history"))]
+    (doto reader
+      (.setBellEnabled false)
+      (.setHistory history))))
+
+(defn interpret-input [input request-prompt request-exit]
+  (cond (not input)
+          request-exit
+        (= :interrupt-caught input)
+          request-prompt
+        (= :found-old-interrupt input)
+          ""
+        (every? #(Character/isWhitespace %) input)
+          request-prompt
+        :else
+          (actual-read input request-prompt request-exit)))
+
+(defn jline-read [request-prompt request-exit]
   (try
-    (let [future-input (future
-                         (try
-                           (.setPrompt reader (format "%s=> " (ns-name *ns*)))
-                           (.readLine reader)
-                           (catch Throwable e
-                             nil)))
-          _ (reset! input-getter future-input)
-          input (deref future-input)]
-      (cond (not input)
-              request-exit
-            (every? #(Character/isWhitespace %) input)
-              request-prompt
-            :else
-              (read (java.io.PushbackReader. (java.io.StringReader. input)))))
-    (catch Throwable e
-      (-> (.getCursorBuffer reader)
+    (.setPrompt @jline-reader (format "%s=> " (ns-name *ns*)))
+    (let [input (.readLine @jline-reader)]
+      (interpret-input input request-prompt request-exit))
+    (catch InterruptedException e
+      (-> (.getCursorBuffer @jline-reader)
           (.clear))
-      request-prompt)))
+      (request-prompt))))

 (defn -main [& args]
   (set-break-handler! handle-ctrl-c)
-    (try
-      (let [reader (ConsoleReader.)
-            home (System/getProperty "user.home")
-            history (FileHistory. (File. home ".jline-reply.history"))]
-        (doto reader
-          (.setBellEnabled false)
-          (.setHistory history))

-        (repl :read (partial jline-read reader)
-              :prompt (constantly ""))
+  (reset! jline-reader (make-reader))

-        (.flush history))
+  (repl :read jline-read
+        :prompt (constantly ""))

-      ; TODO: surely we can avoid this - not sure what's keeping the jvm alive.
-      (System/exit 0)
+  (.flush (.getHistory @jline-reader))

-      (catch Exception e
-        (prn e))))
+  (shutdown-agents))

+


Add metadata for when some new functions were added

--- src/main/clojure/clojure/test/check/generators.clj
+++ src/main/clojure/clojure/test/check/generators.clj
@@ -518,7 +518,9 @@
        (fmap (fn [[c cs]]
                (core/keyword (clojure.string/join ":" (cons c cs)))))))

-(def keyword-ns
+(def
+  ^{:added "0.5.9"}
+  keyword-ns
   "Generate keywords with optional namespaces."
   (->> (tuple namespace char-keyword-first (vector char-keyword-rest))
        (fmap (fn [[ns c cs]]
@@ -541,7 +543,9 @@
                         (fmap (fn [[c cs]] (core/symbol (clojure.string/join (cons c cs))))))]
               [1 (return '/)]]))

-(def symbol-ns
+(def
+  ^{:added "0.5.9"}
+  symbol-ns
   "Generate symbols with optional namespaces."
   (frequency [[100 (->> (tuple namespace char-symbol-first (vector char-symbol-rest))
                         (such-that (fn [[_ c [d]]] (not (+-or---digit? c d))))
@@ -578,7 +582,9 @@
                 container-gen-fn scalar-gen
                 scalar-size children-size (dec height))))))

-(defn recursive-gen
+(defn
+  ^{:added "0.5.9"}
+  recursive-gen
   "This is a helper for writing recursive (tree-shaped) generators. The first
   argument should be a function that takes a generator as an argument, and
   produces another generator that 'contains' that generator. The vector function


Add week to sort range options

Add week to sort range options

--- src/reddio_frontend/screens/listings/listings.cljs
+++ src/reddio_frontend/screens/listings/listings.cljs
@@ -25,6 +25,7 @@
                     :top]
         sort-ranges [:hour
                      :day
+                     :week
                      :month
                      :year
                      :all]]


Fix get-id's, participations swaying.

Fix get-id's, participations swaying.

--- src/ombs/db.clj
+++ src/ombs/db.clj
@@ -58,32 +58,26 @@
   "Return map of events"
   (sql/select events))

+
+(defn get-uid [uname]
+  (:id (first (sql/select users (sql/fields :id)
+              (sql/where (= :name uname))))))
+
+(defn get-eid [ename]
+  (:id (first (sql/select events (sql/fields :id)
+              (sql/where (= :name ename))))))
+
+(defn participapated? [uid eid]
+  (do (println (str "TRACE:::::::: " uid " E: " eid))
+    (not (empty? (sql/select participants (sql/where
+                                            (and (= :uid uid)
+                                                 (= :eid eid))))))))
+
+(defn add-participate [uid eid]
+  (println (str uid ":" eid))
+  (sql/insert participants (sql/values {:uid uid :eid eid })) )
+
 (defn get-user-events [uname]
   (sql/select participants (sql/fields)
               (sql/with users (sql/where (= :name uname)) (sql/fields))
-              (sql/with events)))
-
-(defn get-uid [uname]
-  (first (sql/select users (sql/fields :id)
-              (sql/where (= :name uname)))))
-
-(defn get-eid [ename]
-  (first (sql/select events (sql/fields :id)
-              (sql/where (= :name ename)))))
-
-(defn participapated? [uname ename]
-  (not (empty?
-    (sql/select participants
-      (sql/where
-        (and (= :uid (get-uid uname))
-             (= :eid (get-eid ename)) ))))))
-
-(defn add-participate [uname ename]
-  (if-not (participapated? uname ename)
-    (do
-      (sql/insert participants (sql/values {:uid (get-uid uname) :eid (get-eid ename)}))
-      "Success." )
-    (str uname " already participate " ename " event.")) )
-
-(defn get-events [& [username]]
-  (sql/select participation) )
+              (sql/with events (sql/fields [:name :event]))))


change test naming

change test naming

--- test/cljx/jamesmacaulay/async_tools/core_test.cljx
+++ test/cljx/jamesmacaulay/async_tools/core_test.cljx
@@ -21,13 +21,13 @@
                                  "another"
                                  {}])))

-(deftest constant-test
+(deftest test-constant
   (go
     (let [c (tools/constant 1)]
       (is (= [1 1 1]
              [(<! c) (<! c) (<! c)])))))

-(deftest cast-as-readport-test
+(deftest test-cast-as-readport
   (go
     (let [channel (chan)
           not-a-channel {}]
@@ -36,32 +36,32 @@
       (is (identical? not-a-channel
                       (<! (tools/cast-as-readport not-a-channel)))))))

-(deftest async-future*-test
+(deftest test-async-future*
   (go
     (let [fut (tools/async-future* (fn [resolve]
                                (go (resolve (<! (to-chan [1]))))))]
       (is (= [1 1 1]
              [(<! fut) (<! fut) (<! fut)])))))

-(deftest async-future<-test
+(deftest test-async-future<
   (go
     (let [fut (tools/async-future< (to-chan [1]))]
       (is (= [1 1 1]
              [(<! fut) (<! fut) (<! fut)])))))

-(deftest then<-test
+(deftest test-then<
   (go
     (let [fut (tools/then< inc (go 1))]
       (is (= [2 2 2]
              [(<! fut) (<! fut) (<! fut)])))))

-(deftest all<-test
+(deftest test-all<
   (go
     (let [fut (tools/all< [1 (go 2) 3 (go 4)])]
       (is (= [[1 2 3 4] [1 2 3 4] [1 2 3 4]]
              [(<! fut) (<! fut) (<! fut)])))))

-(deftest race<-test
+(deftest test-race<
   (go
     (let [fut (tools/race< [(go 1) 2])]
       (is (= [2 2 2]


PDB-473 Adapt for new queue message format

PDB-472 changes the format of the messages received from the queue so that
headers are top-level. This patch just ammends the work to support that.

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

--- test/com/puppetlabs/puppetdb/test/http/command.clj
+++ test/com/puppetlabs/puppetdb/test/http/command.clj
@@ -118,13 +118,13 @@
         command-app-v3)

     (let [[good-msg bad-msg] (mq/bounded-drain-into-vec! fixt/*conn* "com.puppetlabs.puppetdb.commands" 2)
-          good-command       (json/parse-string good-msg true)]
+          good-command       (json/parse-string (:body good-msg) true)]
       (testing "should be timestamped when parseable"
-        (let [timestamp (get-in good-command [:annotations :received])]
+        (let [timestamp (get-in good-msg [:headers :received])]
           (time/parse (time/formatters :date-time) timestamp)))

       (testing "should be left alone when not parseable"
-        (is (= bad-msg bad-payload))))))
+        (is (= (:body bad-msg) bad-payload))))))

 (deftest receipt-timestamping-v4
   (let [good-payload  (json/generate-string {:command "my command" :version 1 :payload "{}"})


Changing how version is specified for the es-spatial-plugin leiningen project.

--- es-spatial-plugin/project.clj
+++ es-spatial-plugin/project.clj
@@ -1,4 +1,11 @@
-(def version "0.1.0-SNAPSHOT")
+(def version
+  "Parses the version out of this file to use in names of referenced files"
+  (let [project-clj-lines (-> "project.clj" slurp (clojure.string/split #"\n"))]
+    (-> (filter (partial re-find #"^\(defproject") project-clj-lines)
+        first
+        (clojure.string/split #" ")
+        last
+        (clojure.string/replace "\"" ""))))

 (def uberjar-name
   (str "target/cmr-es-spatial-plugin-" version "-standalone.jar"))
@@ -6,7 +13,7 @@
 (def plugin-zip-name
   (str "target/cmr-es-spatial-plugin-" version ".zip"))

-(defproject nasa-cmr/cmr-es-spatial-plugin version
+(defproject nasa-cmr/cmr-es-spatial-plugin "0.1.0-SNAPSHOT"
   :description "A Elastic Search plugin that enables spatial search entirely within elastic."
   :url "***REMOVED***projects/CMR/repos/cmr-es-spatial-plugin/browse"
   :dependencies [[org.clojure/clojure "1.6.0"]
@@ -20,8 +27,6 @@
   :plugins [[lein-shell "0.4.0"]
             [lein-test-out "0.3.1"]]

-  :global-vars {*warn-on-reflection* true
-                *assert* false}

   ;; This is the minimum that must be AOT'd for running in an embeded elastic. AOT :all for installing
   ;; in an elastic vm.
@@ -33,6 +38,9 @@
   {:dev {:dependencies [[nasa-cmr/cmr-elastic-utils-lib "0.1.0-SNAPSHOT"]
                         [org.clojure/tools.namespace "0.2.5"]
                         [org.clojars.gjahad/debug-repl "0.3.3"]]
+
+         :global-vars {*warn-on-reflection* true
+                       *assert* false}

          ;; The ^replace is done to disable the tiered compilation for accurate benchmarks
          ;; See https://github.com/technomancy/leiningen/wiki/Faster


move to using oneshot-sync-events (which still remove themselves and others, but are guaranteed to only be called once).

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -98,17 +98,17 @@
 (defn- setup-connect-handlers []
   (let [handler-fn
         (fn [event-info]
+          (remove-handler ::connected-handler1)
+          (remove-handler ::connected-handler2)
           (dosync
            (ref-set connection-status* :connected))
           (server-notifications-on) ; turn on notifications now that we can communicate
           (satisfy-deps :server-connected)
           (event :connection-complete)
-          (remove-handler ::connected-handler1)
-          (remove-handler ::connected-handler2)
           (log/debug "Server connection established")
           (println "--> Connection established"))]
-    (on-sync-event "status.reply" handler-fn ::connected-handler1)
-    (on-sync-event "/status.reply" handler-fn ::connected-handler2)))
+    (oneshot-sync-event "status.reply" handler-fn ::connected-handler1)
+    (oneshot-sync-event "/status.reply" handler-fn ::connected-handler2)))

 (defn- connect-internal
   []


fix missing channel list route

fix missing channel list route

--- priv/ui/src/holiday_ping_ui/routes.cljs
+++ priv/ui/src/holiday_ping_ui/routes.cljs
@@ -5,6 +5,7 @@

 ;; maybe slugify names instead of having to put a regex here?
 (def app-routes ["/" [[""                                         :landing]
+                      ["channels"                                 :channel-list]
                       ["channels/new/"                            :channel-create]
                       [["channels/" [#".+" :channel] "/edit"]     :channel-edit]
                       [["channels/" [#".+" :channel] "/holidays"] :holidays]


Set scan time shorter as example of react-native-ble-manager

--- src/re_natal_esp32control_app/android/core.cljs
+++ src/re_natal_esp32control_app/android/core.cljs
@@ -31,7 +31,7 @@
   (dispatch [:add-device (js->clj data :keywordize-keys true)]))

 (defn ble-scan []
-  (-> (.scan BleManager (clj->js []) 30 true)
+  (-> (.scan BleManager (clj->js []) 5 true)
       (.then (fn []
                (prn :finished-scan)))))


looking forward to loading changed dependents

--- support/src/figwheel/client/file_reloading.cljs
+++ support/src/figwheel/client/file_reloading.cljs
@@ -12,6 +12,25 @@
 (declare reload-file*)

 (defonce ns-meta-data (atom {}))
+
+;; dependency resolution
+
+#_(defn dependencies []
+  (let [relevant-nms (filter (fn [n]
+                               (and
+                                (not (.startsWith goog.string n "goog"))
+                                (not (.startsWith goog.string n "cljs"))
+                                (not (.startsWith goog.string n "clojure"))))
+                             (js-keys (.. js/goog -dependencies_ -nameToPath)))]
+    (reduce (fn [am nm]
+              (let [pth (aget (.. js/goog -dependencies_ -nameToPath) nm)
+                    reqs (js-keys (aget (.. js/goog -dependencies_ -requires) pth))]
+                (reduce (fn [amm r] (assoc-in amm [r nm] true)) am reqs)))
+            {}
+            relevant-nms)))
+
+#_(defn ns-that-depend-on [nm]
+  (keys (get (dependencies) nm)))

 ;; this assumes no query string on url
 (defn add-cache-buster [url]


AB | 205 | Test fixed to return :from-date :invalid if invalid date parameter is passed

--- test/objective8/unit/back_end_requests_test.clj
+++ test/objective8/unit/back_end_requests_test.clj
@@ -83,7 +83,7 @@
         {:limit "not-an-integer"}                    nil
         {:offset "not-an-integer"}                   nil
         {:as_ordered_collection "someting"}          {:limit nil :offset nil :wrapped false :from-date nil :to-date nil}
-        {:from "not-a-datetime"}                     {:limit nil :offset nil :wrapped false :from-date nil :to-date nil}
+        {:from "not-a-datetime"}                     {:limit nil :offset nil :wrapped false :from-date :invalid :to-date nil}
         {:from "2015-09-11T16:00:00.000Z"
          :to "2015-09-12T16:00:00.000Z"}             {:limit nil :offset nil :wrapped false
                                                       :from-date "2015-09-11T16:00:00.000Z"


Add some logging

Add some logging

--- services/make-maps.clj
+++ services/make-maps.clj
@@ -12,9 +12,9 @@
            (if (pg/eoi? rec)
              (if (pg/done? rec)
                (do
-                 (infof "Closing stream %s" ot)
+                 (infof "Closing stream %s" (deref ot))
                  (pg/close-stream (deref ot))
-                 (str "Finished writing " map-file))
+                 (infof "Finished writing %s" map-file))
                ;;Else
                (infof "End input stream: %s, REC: %s" (type rec) rec))
              (let [instg (str (deref leftover) (String. rec))


Add init log message

Add init log message

--- vertx-chat-robot/src/clj/vertx_chat_robot/core.clj
+++ vertx-chat-robot/src/clj/vertx_chat_robot/core.clj
@@ -29,4 +29,5 @@

 (defn init []
   (let [robot-name (format "Robo%d" (swap! robot-count inc))]
+    (log/info "Initializing " robot-name)
     (eb/on-message "chat" (partial message-handler robot-name))))


Swap *entry-fn* for *main-cli-fn* entirely

--- library/src/doo/runner.cljs
+++ library/src/doo/runner.cljs
@@ -29,23 +29,6 @@
   (println "Testing" (name (:ns m))))

 ;; ======================================================================
-;; Start Testing
-
-(def ^:dynamic *run-fn* nil)
-
-;; Karma starts the runner with arguments
-(defn ^:export run! [a]
-  (*run-fn* a))
-
-(defn set-entry-point!
-  "Sets the function to be run when starting the script"
-  [f]
-  {:pre [(ifn? f)]}
-  (if (node?)
-    (set! *main-cli-fn* f)
-    (set! *run-fn* f)))
-
-;; ======================================================================
 ;; Finish Testing

 (def ^:dynamic *exit-fn* nil)
@@ -54,12 +37,36 @@
   "Sets the fn to be called when exiting the script.
    It should take one bool argument: successful?"
   [f]
-  {:pre [(ifn? f)]}
+  {:pre [(fn? f)]}
   (set! *exit-fn* f))

+(defn exit! [success?]
+  (if (node?)
+    (let [process-exit (gobj/get js/process "exit")]
+      (process-exit (if success? 0 1)))
+    (try
+      (*exit-fn* success?)
+      (catch :default e
+        (println "WARNING: doo's exit function was not properly set")
+        (println e)))))
+
 (defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
-  (let [success? (successful? m)]
-    (if (node?)
-      (let [process-exit (gobj/get js/process "exit")]
-        (process-exit (if success? 0 1)))
-      (*exit-fn* success?))))
+  (exit! (successful? m)))
+
+;; ======================================================================
+;; Start Testing
+
+;; Karma starts the runner with arguments
+(defn ^:export run! [a]
+  (try
+    (*main-cli-fn* a)
+    (catch :default e
+      (println "WARNING: doo's init function was not set")
+      (println e)
+      (exit! false))))
+
+(defn set-entry-point!
+  "Sets the function to be run when starting the script"
+  [f]
+  {:pre [(fn? f)]}
+  (set! *main-cli-fn* f))


bug fixes. Mostly working

bug fixes. Mostly working

--- src-cljs/app/main.cljs
+++ src-cljs/app/main.cljs
@@ -65,24 +65,18 @@
   "zero pad timepicker digits"
   (goog.string/format "%02d" num))

-(defn get-hours []
-  (.getHours @selected-time))
-
-(defn get-minutes []
-  (.getMinutes @selected-time))
-
-(defn set-hours! [new-hours]
-  (swap! selected-time #(doto % (.setHours new-hours))))
-
-(defn set-minutes! [new-mins]
-  (swap! selected-time #(doto % (.setMinutes new-mins))))
+(defn minutes-to-ms [mins]
+  (* mins 60000))
+
+(defn hours-to-ms [hours]
+  (* hours 3600000))

 (defn sync-time-with-snapshot! []
-  (reset! selected-time (js/Date. (:time (@snapshot-list @snapshot-index)))))
+  (reset! selected-time (:time (@snapshot-list @snapshot-index))))

 ; TODO: This could be improved. Probably need to rethink my data model
 (defn show-closest-snapshot! []
-  (let [timestamp (.getTime @selected-time)
+  (let [timestamp @selected-time
         earlier-index (first (keep-indexed #(if (>= timestamp (:time %2)) %1) @snapshot-list))
         later-index (max (dec earlier-index) 0)
         later (:time (@snapshot-list later-index))
@@ -93,7 +87,7 @@
     (reset! snapshot-index display-index)))

 (defn set-url! [timestamp]
-  (let [base-url (.split js/document.URL "?")
+  (let [base-url (first (.split js/document.URL "?"))
         new-url (str base-url "?time=" timestamp)]
     (.replaceState js/history nil nil new-url)))

@@ -104,38 +98,42 @@
 (defn on-snapshot-list-change [_ _ _ snapshot-list]
   (let [start-date (js/Date. (:time (last snapshot-list)))
         end-date (js/Date. (:time (first snapshot-list)))
-        datepicker-el ($ "#datePicker")]
+        datepicker-el ($ "#datepicker")]
     (.datepicker datepicker-el "remove")
     (.datepicker datepicker-el
       (js-obj
         "startDate" start-date
         "endDate" end-date))))

-(add-watch selected-time :_ on-snapshot-list-change)
+(add-watch snapshot-list :_ on-snapshot-list-change)

 (defn on-selected-time-change [_ _ _ new-time]
-  (let [hour (.getHours new-time)
-        meridian (if (> 11 hour) "PM" "AM")
-        hour (if (> 12 hour) (- hour 12) hour)]
+  (let [datetime (js/Date. new-time)
+        hour (.getHours datetime)
+        meridian (if (>= hour 12) "PM" "AM")
+        hour (if (> hour 12) (- hour 12) hour)
+        hour (if (and (= meridian "AM") (= hour 0)) 12 hour)]
     (val ($ "#hour") (pad hour))
-    (val ($ "#minute") (pad (.getMinutes new-time)))
+    (val ($ "#minute") (pad (.getMinutes datetime)))
     (val ($ "#meridian") meridian)
-    (.datepicker ($ "#datepicker") "update" new-time)))
+    (println (.toString datetime))
+    (.datepicker ($ "#datepicker") "update" datetime)))

 (add-watch selected-time :_ on-selected-time-change)

 (defn on-snapshot-index-change [_ _ _ new-index]
   (let [snapshot (@snapshot-list new-index)
-        time (js/Date. (:time snapshot))
+        timestamp (:time snapshot)
+        datetime (js/Date. timestamp)
         image (:image snapshot)
-        time-display (str (.toDateString time) " " (.toLocaleTimeString time))]
+        time-display (str (.toDateString datetime) " " (.toLocaleTimeString datetime))]
     (attr ($ "#currentSnapshot") "src" image)
     (text ($ "#imageDateTime") time-display)
     (prop ($ "#earlier") "disabled" (= (inc new-index) (count @snapshot-list)))
     (prop ($ "#later") "disabled" (zero? new-index))
     ; delay updating the url in case user is rapidly switching times
     (js/clearTimeout @url-update-timeout)
-    (swap! url-update-timeout #(js/setTimeout set-url! time 200))))
+    (reset! url-update-timeout (js/setTimeout (fn [] (set-url! timestamp)) 200))))

 (add-watch snapshot-index :_ on-snapshot-index-change)

@@ -148,32 +146,35 @@
     (reset! selected-time (.-time e))))

 (defn on-datetime-change []
-  (let [date (.datepicker ($ "#datepicker") "getDate")
-        new-time (doto date
-                    (.setMinutes (.getMinutes @selected-time))
-                    (.setHours (.getHours @selected-time)))]
-    (reset! selected-time new-time)))
+  (let [selected-date (.datepicker ($ "#datepicker") "getDate")
+        datetime (js/Date. @selected-time)
+        new-time (doto selected-date
+                    (.setMinutes (.getMinutes datetime))
+                    (.setHours (.getHours datetime)))]
+    (println (.toString new-time))
+    (reset! selected-time (.getTime new-time))
+    (show-closest-snapshot!)))

 (defn click-toggle-meridian []
-  (let [hours (+ (get-hours) 12)
-        hours (if (>= 24 ) (- 24 hours) hours)]
-    (set-hours! hours)
+  (let [meridian (val ($ "#meridian"))
+        hours (if (= meridian "AM") 12 -12)]
+    (swap! selected-time + (hours-to-ms hours))
     (show-closest-snapshot!)))

 (defn click-decrement-hour []
-  (set-hours! (dec (get-hours)))
+  (swap! selected-time - (hours-to-ms 1))
   (show-closest-snapshot!))

 (defn click-increment-hour []
-  (set-hours! (inc (get-hours)))
+  (swap! selected-time + (hours-to-ms 1))
   (show-closest-snapshot!))

 (defn click-decrement-Minute []
-  (set-minutes! (dec (get-minutes)))
+  (swap! selected-time - (minutes-to-ms 1))
   (show-closest-snapshot!))

 (defn click-increment-minute []
-  (set-minutes! (inc (get-minutes)))
+  (swap! selected-time + (minutes-to-ms 1))
   (show-closest-snapshot!))

 (defn click-later []
@@ -200,6 +201,7 @@
   (on ($ js/document) "keydown" on-keydown)

   (-> ($ "body")
+    (on "click" ".timepicker-widget a" (fn [e] (.preventDefault e)))
     (on "click" ".toggle-meridian" click-toggle-meridian)
     (on "click" ".decrement-hour" click-decrement-hour)
     (on "click" ".increment-hour" click-increment-hour)
@@ -214,9 +216,9 @@

 (defn init-snapshot-list []
   (->> (.-SNAPSHOT_LIST js/window) ; server injected to this in a <script>
-        (js->clj)
-        (clojure.walk/keywordize-keys)
-        (reset! snapshot-list)))
+       (js->clj)
+       (clojure.walk/keywordize-keys)
+       (reset! snapshot-list)))

 (defn init-snapshot-index []
   (let [image (attr ($ "#currentSnapshot") "src")


Removing tunnel commands from committed code.

--- dev/user.clj
+++ dev/user.clj
@@ -16,75 +16,9 @@

 (def system nil)

-(defn tunnel-system-wl
-  "Allows tunneling the search to a indexer and elasticsearch running on a different system"
-  []
-  ;; workload can be tunnelled by running these
-  ;; ssh -L4005:localhost:3005 cmr-wl-app1.dev.echo.nasa.gov
-  ;; ssh -L9211:localhost:9200 cmr-wl-elastic1.dev.echo.nasa.gov
-  ;; ssh -L1557:dbrac1node1.dev.echo.nasa.gov:1521 wlapp3.dev.echo.nasa.gov
-  (cfg/set-config-value! :elastic-port 9211)
-  (cfg/set-config-value! :index-set-port 4005)
-
-  (cfg/set-config-value! :echo-rest-host "api-wkld.echo.nasa.gov")
-  (cfg/set-config-value! :echo-rest-port 80)
-  (cfg/set-config-value! :echo-rest-context "/echo-rest")
-
-  (cfg/set-config-value! :db-url "thin:@localhost:1557:OPSDB1")
-
-  ;; Set the following but do not commit them
-  (cfg/set-config-value! :echo-system-token "XXXXX")
-  (cfg/set-config-value! :metadata-db-password "XXXXX"))
-
-(defn tunnel-system-uat
-  "Allows tunneling the search to a indexer and elasticsearch running on a different system"
-  []
-  ;; UAT can be tunnelled by running these
-  ;; ssh -L4005:localhost:3005 cmr-uat-app1.dev.echo.nasa.gov
-  ;; ssh -L9213:localhost:9200 cmr-uat-elastic1.dev.echo.nasa.gov
-  ;; ssh -L1559:dbrac1node1.dev.echo.nasa.gov:1521 ptkernel4.dev.echo.nasa.gov
-  (cfg/set-config-value! :elastic-port 9213)
-  (cfg/set-config-value! :index-set-port 4005)
-
-  (cfg/set-config-value! :echo-rest-protocol "https")
-  (cfg/set-config-value! :echo-rest-host "api-test.echo.nasa.gov")
-  (cfg/set-config-value! :echo-rest-port 443)
-  (cfg/set-config-value! :echo-rest-context "/echo-rest")
-
-  (cfg/set-config-value! :db-url "thin:@localhost:1559/ptdb.dev.echo.nasa.gov")
-
-  ;; Set the following but do not commit them
-  (cfg/set-config-value! :echo-system-token "XXXXX")
-  (cfg/set-config-value! :metadata-db-password "XXXXX"))
-
-(defn tunnel-system-sit
-  "Allows tunneling the search to a indexer and elasticsearch running on a different system"
-  []
-  ;; sit can be tunnelled by running these
-  ;; ssh -L4005:localhost:3005 cmr-sit-app1.dev.echo.nasa.gov
-  ;; ssh -L9212:localhost:9200 cmr-sit-elastic1.dev.echo.nasa.gov
-  ;; ssh -L1558:tbdb.dev.echo.nasa.gov:1521 tbkernel4.dev.echo.nasa.gov
-  (cfg/set-config-value! :elastic-port 9212)
-  (cfg/set-config-value! :index-set-port 4005)
-
-  (cfg/set-config-value! :echo-rest-protocol "https")
-  (cfg/set-config-value! :echo-rest-host "testbed.echo.nasa.gov")
-  (cfg/set-config-value! :echo-rest-port 443)
-  (cfg/set-config-value! :echo-rest-context "/echo-rest")
-
-  (cfg/set-config-value! :db-url "thin:@localhost:1558/tbdb.dev.echo.nasa.gov")
-
-  ;; Set the following but do not commit them
-  (cfg/set-config-value! :echo-system-token "XXXXXX")
-  (cfg/set-config-value! :metadata-db-password "XXXXXX"))

 (defn create-system
   []
-  ;; Uncomment this to tunnel to another system for testing.
-  ; (tunnel-system-uat)
-  ; (tunnel-system-wl)
-  ; (tunnel-system-sit)
-
   ;; Set the default job start delay to avoid jobs kicking off with tests etc.
   (cfg/set-config-value! :default-job-start-delay (str (* 3 3600)))


Clean up requires in user ns.

Clean up requires in user ns.

--- dev/user.clj
+++ dev/user.clj
@@ -10,16 +10,13 @@
     [com.stuartsierra.component :as component]
     (org.playasophy.wonderdome
       [config :as config]
-      [state :as state]
       [system :as system])
     (org.playasophy.wonderdome.display
-      [pixel-pusher :refer [pixel-pusher]]
       [processing :as processing])
     (org.playasophy.wonderdome.geometry
       [layout :as layout])
     (org.playasophy.wonderdome.input
       [gamepad :as gamepad]
-      [middleware :as middleware]
       [timer :as timer])))


add cognitect logo to common/icon

add cognitect logo to common/icon


remove reply button when comments can't nest anymore

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -100,30 +100,35 @@
 (defn comment-form [{:keys [issue-id parent-id close-callback]} owner {:keys [issue-db]}]
   (reify
     om/IDisplayName (display-name [_] "Comment form")
-    om/IInitState (init-state [_] {:comment-body ""})
+    om/IInitState (init-state [_] {:comment-body ""
+                                   :input-height 64})
     om/IRenderState
-    (render-state [_ {:keys [comment-body]}]
+    (render-state [_ {:keys [comment-body input-height]}]
       (let [issue-db (om/get-shared owner :issue-db)
             cust (om/get-shared owner :cust)]
         (html
          [:form.comment-form {:on-submit #(do (utils/stop-event %)
-                                            (when (seq comment-body)
-                                              (d/transact! issue-db [{:db/id issue-id
-                                                                      :issue/comments (merge {:db/id -1
-                                                                                :comment/created-at (datetime/server-date)
-                                                                                :comment/body (str/trim comment-body)
-                                                                                :comment/author (:cust/email cust)
-                                                                                :frontend/issue-id (utils/squuid)}
-                                                                                (when parent-id
-                                                                                {:comment/parent parent-id}))}])
-                                              (om/set-state! owner :comment-body ""))
-                                            (when (fn? close-callback)
-                                              (close-callback)))}
+                                              (when (seq comment-body)
+                                                (d/transact! issue-db [{:db/id issue-id
+                                                                        :issue/comments (merge {:db/id -1
+                                                                                :comment/created-at (datetime/server-date)
+                                                                                :comment/body (str/trim comment-body)
+                                                                                :comment/author (:cust/email cust)
+                                                                                :frontend/issue-id (utils/squuid)}
+                                                                                (when parent-id
+                                                                                {:comment/parent parent-id}))}])
+                                                (om/set-state! owner :comment-body ""))
+                                              (when (fn? close-callback)
+                                                (close-callback)))}
           [:div.adaptive
            [:textarea {:required true
+                       :style {:height input-height}
                        :value comment-body
                        :disabled (when-not (utils/logged-in? owner) true)
-                       :onChange #(om/set-state! owner :comment-body (.. % -target -value))}]
+                       :onChange #(do (om/set-state! owner :comment-body (.. % -target -value))
+                                      (let [node (.-target %)]
+                                        (when (not= (.-scrollHeight node) (.-clientHeight node))
+                                          (om/set-state! owner :input-height (max 64 (.-scrollHeight node))))))}]
            [:label {:data-label (if (utils/logged-in? owner)
                                   "What do you think?"
                                   "Sign in to comment on this issue.")
@@ -324,7 +329,8 @@
            [:span (:comment/author comment)]
            [:span " on "]
            [:span (datetime/month-day (:comment/created-at comment))]
-           (when (utils/logged-in? owner)
+           (when (and (utils/logged-in? owner)
+                      (> 4 (count ancestors)))
              (list
               [:span.pre "  •  "]
               [:a {:role "button"


Fix inaccurate default-template-properties.

--- frontend/models/plan.cljs
+++ frontend/models/plan.cljs
@@ -5,11 +5,9 @@
             [cljs-time.format :as time-format]))

 ;; The template tells how to price the plan
-;; TODO: fix this to work from the backend db; how? Failing that, must
-;; update this code when we change the definition of p18
-(def default-template-properties {:price 19 :container_cost 50 :id
-                                  "p18" :max_containers 1000 :free_containers 1})
-;(def default-template-properties {:price 0 :container_cost 50 :id "p18" :max_containers 1000 :free_containers 0})
+;; TODO: fix this to work from the backend db; how?
+(def default-template-properties {:price 0 :container_cost 50 :id
+                                  "p18" :max_containers 1000 :free_containers 0})

 (defn max-parallelism
   "Maximum parallelism that the plan allows (usually 16x)"


Adds missing newline at end of file.

Adds missing newline at end of file.

--- umm-spec-lib/src/cmr/umm_spec/models/common.clj
+++ umm-spec-lib/src/cmr/umm_spec/models/common.clj
@@ -793,4 +793,4 @@
    ;; Describes the sub type of the URL. These are keywords that a user selects
    Subtype
   ])
-(record-pretty-printer/enable-record-pretty-printing ContentTypeType)+(record-pretty-printer/enable-record-pretty-printing ContentTypeType)


Parallizing Uwe's algorithm

Parallizing Uwe's algorithm

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

--- src/conexp/contrib/experimental/ryssel_algorithm.clj
+++ src/conexp/contrib/experimental/ryssel_algorithm.clj
@@ -46,32 +46,29 @@
                         {}
                         (attributes ctx)),
         M      (set (keys gens))]       ;all attribute extents
-    (loop [implications #{},
-           extents      M]
-      (if (empty? extents)
-        (collapse-equal-premises implications)
-        (let [A            (first extents),
-              implications (into implications
-                                 (for [N M
-                                       :when (subset? A N),
-                                       m (gens A),
-                                       :when (not= (gens N) #{m})]
-                                   (make-implication #{m} (gens N)))),
-              candidates   (set-of U | U (disj M A),
-                                       :let [UcapA (intersection U A)]
-                                       :when (not (exists [V M]
-                                                    (and (proper-subset? V A)
-                                                         (subset? UcapA V))))),
-              candidates   (difference candidates
-                                       (set-of (intersection X Y) | X candidates, Y candidates
-                                                                    :when (and (not (subset? X Y))
-                                                                               (not (subset? Y X))))),
-              covers       (cover (objects ctx) candidates A),
-              B            (oprime A),
-              implications (into implications
-                                 (for [X covers]
-                                   (make-implication (set-of m | Y X, m (gens Y)) B)))]
-          (recur implications (rest extents)))))))
+    (collapse-equal-premises
+     (reduce into
+             #{}
+             (pmap (fn [A]
+                     (let [candidates (set-of U | U (disj M A),
+                                                  :let [U-cap-A (intersection U A)]
+                                                  :when (not (exists [V M]
+                                                               (and (proper-subset? V A)
+                                                                    (subset? U-cap-A V))))),
+                           candidates (difference candidates
+                                                  (set-of (intersection X Y) | X candidates, Y candidates
+                                                                              :when (and (not (subset? X Y))
+                                                                                (not (subset? Y X))))),
+                           covers     (cover (objects ctx) candidates A),
+                           B          (oprime A)]
+                      (concat (for [N M
+                                    :when (subset? A N),
+                                    m (gens A),
+                                    :when (not= (gens N) #{m})]
+                                (make-implication #{m} (gens N)))
+                              (for [X covers]
+                                (make-implication (set-of m | Y X, m (gens Y)) B)))))
+                  M)))))

 ;;;


by default, do not truncate when generating: doing so removes :comp, which babel.espanol.writer uses to see if a new sentence needs to be generated

--- src/babel/espanol.cljc
+++ src/babel/espanol.cljc
@@ -59,7 +59,7 @@
   [spec & {:keys [max-total-depth model truncate-children]
            :or {max-total-depth generate/max-total-depth
                 model nil
-                truncate-children true}}]
+                truncate-children false}}]
   (log/debug (str "generating with spec: " (strip-refs spec) " with max-total-depth: " max-total-depth))
   (if (nil? model)
     (let [error-message


(SERVER-876) Refactor get-environment-from-request as suggested in PR feedback

--- src/clj/puppetlabs/services/request_handler/request_handler_core.clj
+++ src/clj/puppetlabs/services/request_handler/request_handler_core.clj
@@ -329,7 +329,9 @@
   "Gets the environment from a request, after the params map has been populated
   via wrap-params-for-jruby."
   [req]
-  ((:params (wrap-params-for-jruby req)) "environment"))
+  (-> req
+      wrap-params-for-jruby
+      (get-in [:params "environment"])))

 (defn wrap-with-code-id
   "Specialized middleware for catalogs. Adds code_id to the request before passing


Unused ns

Unused ns

--- ClojureScript/planck/src/planck/core.cljs
+++ ClojureScript/planck/src/planck/core.cljs
@@ -3,7 +3,6 @@
   (:require [cljs.js :as cljs]
             [cljs.tagged-literals :as tags]
             [cljs.tools.reader :as r]
-            [cljs.tools.reader.reader-types :refer [string-push-back-reader]]
             [cljs.analyzer :as ana]
             [cljs.repl :as repl]
             [planck.io]))


separate -re present verbs for clarity

separate -re present verbs for clarity

--- src/babel/francais/morphology/verbs.cljc
+++ src/babel/francais/morphology/verbs.cljc
@@ -56,7 +56,6 @@

 (def present-nonreflexive-ir-verb
   [
-   ;; <ir verbs>
    {:p [#"^([^' ]+)is$"         "$1ir"]
     :g [#"^([^' ]+)ir$"         "$1is"]
     :u {:synsem {:subcat {:1 {:agr {:number :sing
@@ -92,9 +91,10 @@
     :u {:synsem {:subcat {:1 {:agr {:number :plur
                                     :person :3rd}}}
                  :infl :present}}}
-   ;; </ir verbs>
-
-   ;; <re verbs>
+   ])
+
+(def present-nonreflexive-re-verb
+  [
    {:p [#"^([^' ]+)$"          "$1re"]
     :g [#"^([^' ]+)re$"        "$1"]
     :u {:synsem {:subcat {:1 {:agr {:number :sing
@@ -708,6 +708,7 @@
           past-reflexive
           present-nonreflexive-er-verb
           present-nonreflexive-ir-verb
+          present-nonreflexive-re-verb
           present-reflexive
           future
           ]))


working on making morphology more separable from code

--- src/babel/italiano/morphology/verbs.cljc
+++ src/babel/italiano/morphology/verbs.cljc
@@ -59,132 +59,20 @@

 (def morph-map (compile-morphology))

-;; <conditional>
 (defonce patterns-conditional
   (get morph-map "conditional"))
-
-(defn regular-conditional [word]
-  (let [unifying-patterns
-        (mapcat #(when (not (= :fail (unify word
-                                            {:agr (:agr %)})))
-                   (:g %))
-                patterns-conditional)
-        ;; if the word has a future-stem, use it; otherwise, use :italiano, which
-        ;; is expected to be the infinitive for verbs.
-        infinitive (get-in word [:future-stem]
-                           (get-in word [:italiano]))]
-    (first (do-replace-on infinitive unifying-patterns))))
-
-;; </conditional>
-
-;; <future>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/future.edn")
-          slurp
-          read-string
-          patterns-with-agr)]
-  (defonce patterns-future
-    (compile-patterns
-     {:synsem {:infl :future}}
-     source)))
-
-(defn regular-future [word]
-  (let [unifying-patterns
-        (remove nil? (mapcat #(when (not (= :fail
-                                            (unify word
-                                                   {:agr (:agr %)})))
-                                (:g %))
-                             patterns-future))
-        ;; if the word has a future-stem, use it; otherwise, use :italiano, which
-        ;; is expected to be the infinitive for verbs.
-        infinitive (get-in word [:future-stem]
-                           (get-in word [:italiano]))]
-    (log/debug (str "infinitive: " infinitive "; unifying patterns: " (string/join "," unifying-patterns)))
-    (first (do-replace-on infinitive unifying-patterns))))
-;; </future>
-
-;; <imperfect>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/imperfetto.edn")
-          slurp
-          read-string
-          patterns-with-agr)]
-  (defonce patterns-imperfect
-    (compile-patterns
-     {:synsem {:infl :imperfect}}
-     source)))
-
-(defn regular-imperfect [word]
-  (let [unifying-patterns
-        (remove nil? (mapcat #(when (not (= :fail
-                                            (unify word
-                                                   {:agr (:agr %)})))
-                                (:g %))
-                             patterns-imperfect))
-        infinitive (get-in word [:italiano])]
-    (first (do-replace-on infinitive unifying-patterns))))
-;; </imperfect>
-
-;; <present>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/present.edn")
-          slurp
-          read-string
-          patterns-with-agr)]
-  (defonce patterns-present
-    (compile-patterns
-     {:synsem {:infl :present}}
-     source)))
-;; </present>
-
-;; <passato>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/passato.edn")
-          slurp
-          read-string
-          patterns-with-agr
-          patterns-with-essere)]
-  (defonce patterns-passato
-    (compile-patterns
-     {:synsem {:infl :past}}
-     source)))
-
-(defn regular-passato [word]
-  (let [unifying-patterns
-        (remove nil? (mapcat
-                      #(when (not (= :fail
-                                     (unify word
-                                            {:agr (:agr % :top)
-                                             :essere (get-in % [:u :synsem :essere] :top)})))
-                                (:g %))
-                             patterns-passato))
-        infinitive (get-in word [:italiano])]
-    (first (do-replace-on infinitive unifying-patterns))))
-
-;; </passato>
-
-;; <subjunctive>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/subjunctive.edn")
-          slurp
-          read-string
-          patterns-with-agr)]
-  (defonce patterns-subjunctive
-    (compile-patterns
-     {:synsem {:infl :subjunctive}}
-     source)))
-;; </subjunctive>
-
-;; <gerund>
-(let [source
-      (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/gerund.edn")
-          slurp
-          read-string)]
-  (defonce patterns-gerund
-    (compile-patterns
-     {:synsem {:infl :participle}}
-     source)))
-;; </gerund>
+(defonce patterns-future
+  (get morph-map "future"))
+(defonce patterns-gerund
+  (get morph-map "gerund"))
+(defonce patterns-imperfect
+  (get morph-map "imperfect"))
+(defonce patterns-present
+  (get morph-map "present"))
+(defonce patterns-passato
+  (get morph-map "passato"))
+(defonce patterns-subjunctive
+  (get morph-map "subjunctive"))

 (defonce patterns
   (map (fn [each]
@@ -204,6 +92,54 @@
         patterns-passato
         patterns-present
         patterns-subjunctive)))
+
+(defn regular-conditional [word]
+  (let [unifying-patterns
+        (mapcat #(when (not (= :fail (unify word
+                                            {:agr (:agr %)})))
+                   (:g %))
+                patterns-conditional)
+        ;; if the word has a future-stem, use it; otherwise, use :italiano, which
+        ;; is expected to be the infinitive for verbs.
+        infinitive (get-in word [:future-stem]
+                           (get-in word [:italiano]))]
+    (first (do-replace-on infinitive unifying-patterns))))
+
+(defn regular-future [word]
+  (let [unifying-patterns
+        (remove nil? (mapcat #(when (not (= :fail
+                                            (unify word
+                                                   {:agr (:agr %)})))
+                                (:g %))
+                             patterns-future))
+        ;; if the word has a future-stem, use it; otherwise, use :italiano, which
+        ;; is expected to be the infinitive for verbs.
+        infinitive (get-in word [:future-stem]
+                           (get-in word [:italiano]))]
+    (log/debug (str "infinitive: " infinitive "; unifying patterns: " (string/join "," unifying-patterns)))
+    (first (do-replace-on infinitive unifying-patterns))))
+
+(defn regular-imperfect [word]
+  (let [unifying-patterns
+        (remove nil? (mapcat #(when (not (= :fail
+                                            (unify word
+                                                   {:agr (:agr %)})))
+                                (:g %))
+                             patterns-imperfect))
+        infinitive (get-in word [:italiano])]
+    (first (do-replace-on infinitive unifying-patterns))))
+
+(defn regular-passato [word]
+  (let [unifying-patterns
+        (remove nil? (mapcat
+                      #(when (not (= :fail
+                                     (unify word
+                                            {:agr (:agr % :top)
+                                             :essere (get-in % [:u :synsem :essere] :top)})))
+                                (:g %))
+                             patterns-passato))
+        infinitive (get-in word [:italiano])]
+    (first (do-replace-on infinitive unifying-patterns))))

 (defonce exceptions-rules
   [;; 1. passato exceptions


more tag inference

more tag inference

--- src/main/clojure/clojure/tools/analyzer/passes/js/infer_tag.clj
+++ src/main/clojure/clojure/tools/analyzer/passes/js/infer_tag.clj
@@ -6,7 +6,9 @@
 ;;   the terms of this license.
 ;;   You must not remove this notice, or any other, from this software.

-(ns clojure.tools.analyzer.passes.js.infer-tag)
+(ns clojure.tools.analyzer.passes.js.infer-tag
+  (:require [clojure.tools.analyzer.env :as env]
+            [clojure.tools.analyzer.utils :refer [arglist-for-arity]]))

 (defmulti -infer-tag :op)
 (defmethod -infer-tag :default [ast] ast)
@@ -38,6 +40,53 @@
 (defmethod -infer-tag :loop
   [{:keys [body] :as ast}]
   (merge ast (select-keys body [:return-tag :arglists :ignore-tag :tag])))
+
+(defmethod -infer-tag :binding
+  [{:keys [init atom] :as ast}]
+  (let [ast (if init
+              (merge (select-keys init [:return-tag :arglists :ignore-tag :tag]) ast)
+              ast)]
+    (swap! atom merge (select-keys ast [:return-tag :arglists :ignore-tag :tag]))
+    ast))
+
+(defmethod -infer-tag :local
+  [{:keys [atom] :as ast}]
+  (merge ast @atom))
+
+(defmethod -infer-tag :def
+  [{:keys [init var] :as ast}]
+  (let [info (select-keys init [:return-tag :arglists :ignore-tag :tag])]
+    (swap! env/*env* update-in [:namespaces (:ns var) :mappings (:name var)] merge info)
+    (merge ast info)))
+
+(defmethod -infer-tag :var
+  [{:keys [var] :as ast}]
+  (let [info (-> (env/deref-env)
+               (get-in [:namespaces (:ns var) :mappings (:name var)])
+               (select-keys [:return-tag :arglists :ignore-tag :tag]))]
+    (merge ast info)))
+
+(defmethod -infer-tag :set!
+  [{:keys [target] :as ast}]
+  (if-let [tag (:tag target)]
+    (assoc ast :tag tag)
+    ast))
+
+(defmethod -infer-tag :invoke
+  [{:keys [fn args] :as ast}]
+  (if (:arglists fn)
+    (let [argc (count args)
+          arglist (arglist-for-arity fn argc)
+          tag (or (:tag (meta arglist))
+                  (:return-tag fn)
+                  (and (= :var (:op fn))
+                       (:tag (meta (:var fn)))))]
+      (merge ast
+             (when tag
+               {:tag     tag})))
+    (if-let [tag (:return-tag fn)]
+      (assoc ast :tag tag)
+      ast)))

 (defn =-arglists? [a1 a2]
   (let [tag (fn [x] (-> x meta :tag))]
@@ -83,7 +132,7 @@
      ast)))

 (defn infer-tag
-  [{:keys [tag] :as tag}]
+  [{:keys [tag] :as ast}]
   (merge (-infer-tag ast)
          (when tag
            {:tag tag})))


in run-linter-mode collapse when not in when-not

--- src/app/core.clj
+++ src/app/core.clj
@@ -64,7 +64,7 @@
     (usageError banner opts self-exclusive-modes-error)))

 (defn run-linter-mode [opts]
-  (when (not (:dir opts))
+  (when-not (:dir opts)
     (info "Linter, no directory indicated. Using current directory")
     (linter ".")
     (System/exit 0))


Restart after playmode change

Restart after playmode change

--- src/app/ctl.cljs
+++ src/app/ctl.cljs
@@ -72,9 +72,15 @@
              ["#playmode input.pairs" (if (= @playmode "pairs") {:checked "true"} {})]
              ["#playmode input.single" (if (= @playmode "single") {:checked "true"} {})]
              ["#textareaimport-button" {:on-click #(put! eventbus-in :textarea-import)}]
-             ["#playmode .drizzle" {:on-change #(dispatch-sync [:set-playmode "drizzle"])}]
-             ["#playmode .pairs" {:on-change #(dispatch-sync [:set-playmode "pairs"])}]
-             ["#playmode .single" {:on-change #(dispatch-sync [:set-playmode "single"])}]
+             ["#playmode .drizzle" {:on-change (fn []
+                                                 (dispatch-sync [:set-playmode "drizzle"])
+                                                 (dispatch-sync [:start]))}]
+             ["#playmode .pairs" {:on-change (fn []
+                                               (dispatch-sync [:set-playmode "pairs"])
+                                               (dispatch-sync [:start]))}]
+             ["#playmode .single" {:on-change (fn []
+                                                (dispatch-sync [:set-playmode "single"])
+                                                (dispatch-sync [:start]))}]
              ["#ipm" {:value (Math/floor (* 60  @items-per-sec))
                       :on-change (fn [evt] (dispatch-sync [:set-ipm
                                                            (cljs.reader/read-string (.. evt -target -value ))]))}]


fix compile errors

fix compile errors

--- src/clj/backtype/storm/daemon/nimbus.clj
+++ src/clj/backtype/storm/daemon/nimbus.clj
@@ -31,7 +31,7 @@
    :uploaders (file-cache-map conf)
    :uptime (uptime-computer)
    :timer (mk-timer :kill-fn (fn [t]
-                               (log-error t "Error when processing event " r)
+                               (log-error t "Error when processing event")
                                (halt-process! 20 "Error when processing an event")
                                ))
    })
@@ -52,7 +52,7 @@
    (.update-storm! storm-cluster-state
                    storm-id
                    {:status status})
-   (log-message "Updated " storm-name " with status " status)
+   (log-message "Updated " storm-id " with status " status)
    ))

 (declare reassign-topology)


time quantities

time quantities

--- src/cljx/jamesmacaulay/zelkova/time.cljx
+++ src/cljx/jamesmacaulay/zelkova/time.cljx
@@ -1,12 +1,24 @@
 #+clj
-(ns jamesmacaulay.zelkova.time)
+(ns jamesmacaulay.zelkova.time
+  (:refer-clojure :exclude [second]))

 #+cljs
 (ns jamesmacaulay.zelkova.time
+  (:refer-clojure :exclude [second])
   (:require [jamesmacaulay.zelkova.signal :as z]
             [goog.events :as events]
             [cljs.core.async :as async :refer [>! <!]])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
+
+(def millisecond 1)
+(def second 1000)
+(def minute (* 60 second))
+(def hour (* 60 minute))
+
+(defn in-milliseconds [n] (/ n millisecond))
+(defn in-seconds [n] (/ n second))
+(defn in-minutes [n] (/ n minute))
+(defn in-hours [n] (/ n hour))

 #+cljs
 (defn- listen


Add more examples

Add more examples

--- src/clojure_walkthrough/cjia/ch05_xx.clj
+++ src/clojure_walkthrough/cjia/ch05_xx.clj
@@ -52,3 +52,42 @@

 (. rnd (nextInt 10)) ;; 3 ;; result will vary
 (. rnd (nextInt 10)) ;; 6 ;; result will vary
+
+(import '(java.util Calendar TimeZone))
+
+;; Compare this
+(. (. (Calendar/getInstance) getTimeZone) getDisplayName) ;; "Australian Eastern Standard Time (Victoria)"
+
+;; To this
+(.. (Calendar/getInstance) (getTimeZone) (getDisplayName)) ;; "Australian Eastern Standard Time (Victoria)"
+
+;; This can be simplified to this
+(.. (Calendar/getInstance) getTimeZone getDisplayName)     ;; "Australian Eastern Standard Time (Victoria)"
+
+;; If using method signaturs that accepted arguments
+(.. (Calendar/getInstance)
+  getTimeZone
+  (getDisplayName true TimeZone/SHORT)) ;; "AEDT"
+
+;; Look at this example without the 'doto' macro
+(import '(java.util Calendar))
+(defn the-past-midnight-1 []
+ (let [calendar-obj (Calendar/getInstance)]
+  (.set calendar-obj Calendar/AM_PM Calendar/AM)
+  (.set calendar-obj Calendar/HOUR 0)
+  (.set calendar-obj Calendar/MINUTE 0)
+  (.set calendar-obj Calendar/SECOND 0)
+  (.set calendar-obj Calendar/MILLISECOND 0)
+  (.getTime calendar-obj))) ;; #'clojure-walkthrough.cjia.ch05-xx/the-past-midnight-1
+
+;; With the use of 'doto' macro
+(import '(java.util Calendar))
+(defn the-past-midnight-2 []
+  (let [calendar-obj (Calendar/getInstance)]
+    (doto calendar-obj
+      (.set Calendar/AM_PM Calendar/AM)
+      (.set Calendar/HOUR 0)
+      (.set Calendar/MINUTE 0)
+      (.set Calendar/SECOND 0)
+      (.set Calendar/MILLISECOND 0))
+    (.getTime calendar-obj)))


Fixed bug in uniform-integer-mutation (would never mutate).

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -141,12 +141,13 @@
                              (if (integer? const)
                                (assoc token
                                  :instruction
-                                 (round (perturb-with-gaussian-noise uniform-mutation-int-gaussian-standard-deviation const)))
+                                 (round (perturb-with-gaussian-noise
+                                          uniform-mutation-int-gaussian-standard-deviation const)))
                                token)))
         token-mutator (fn [token]
                         (if (< (lrand) uniform-mutation-constant-tweak-rate)
-                          (constant-mutator token))
-                        token)
+                          (constant-mutator token)
+                          token))
         new-genome (mapv token-mutator (:genome ind))]
     (make-individual :genome new-genome
                      :history (:history ind)


precede 'selects' string output with meta

--- src/com/billpiel/sayid/string_output.clj
+++ src/com/billpiel/sayid/string_output.clj
@@ -328,7 +328,8 @@
                                 tree))
         sel-map (util/apply-to-map-vals sel-fn
                                         selects)]
-    (indent-map tree sel-map)))
+    [(get-line-meta tree)
+     (indent-map tree sel-map)]))

 (defmacro when-sel
   [kw & body]


travis does not love c.t.n.repl

travis does not love c.t.n.repl

--- src/block_chain/db.clj
+++ src/block_chain/db.clj
@@ -4,11 +4,7 @@
             [block-chain.queries :as q]
             [environ.core :refer [env]]
             [block-chain.wallet :as wallet]
-            [clojure.tools.namespace.repl]
-            [clj-leveldb :as ldb]
-            ))
-
-(clojure.tools.namespace.repl/disable-reload!)
+            [clj-leveldb :as ldb]))

 (def genesis-block (read-json (slurp (io/resource "genesis.json"))))


Disoplay counts of file content hashes

Disoplay counts of file content hashes

--- src/bookshelf/core.clj
+++ src/bookshelf/core.clj
@@ -47,24 +47,28 @@
                   :path (.getPath file)})))

 (defn library-files-html []
-  (hiccup/html5
-   [:head
-    [:title "bookshelf"]
-    (hiccup/include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css")]
-   [:table.table.table-hover.table-bordered
-    [:thead
-     [:tr
-      [:td "Name"]
-      [:td "Size"]
-      [:td "Hash"]
-      [:td "Path"]]]
-    [:tbody
-     (for [row (sql/query db "SELECT * FROM books")]
+  (let [rows (sql/query db "SELECT * FROM books")
+        counts (frequencies (map :hash rows))]
+    (hiccup/html5
+     [:head
+      [:title "bookshelf"]
+      (hiccup/include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css")]
+     [:table.table.table-hover.table-bordered
+      [:thead
        [:tr
-        [:td (:name row)]
-        [:td (humanize/filesize (:size row))]
-        [:td (:hash row)]
-        [:td (:path row)]])]]))
+        [:td "Name"]
+        [:td "Size"]
+        [:td "Hash"]
+        [:td "Notes"]
+        [:td "Path"]]]
+      [:tbody
+       (for [row rows]
+         [:tr
+          [:td (:name row)]
+          [:td (humanize/filesize (:size row))]
+          [:td (:hash row)]
+          [:td (get counts (:hash row))]
+          [:td (:path row)]])]])))

 (defroutes handler
   (GET "/" [] (library-files-html))


Check defroutes behavior

Check defroutes behavior

defroutes does not evaluate handler functions until a request matching
the route is made.

--- src/bookshelf/core.clj
+++ src/bookshelf/core.clj
@@ -6,8 +6,14 @@
   (:use [compojure.core :refer :all])
   (:use [compojure.route :as route]))

+(defn write-to-file []
+  (with-open [w (clojure.java.io/writer "/tmp/out" :append true)]
+    (.write w "hello\n"))
+  "wrote to file")
+
 (defroutes handler
   (GET "/" [] "Hello World")
+  (GET "/write" [] (write-to-file))
   (route/not-found "Invalid request"))

 (def app


Fix wrong error type raising when decrypting jwe tokens when using gcm related ciphers.

--- src/buddy/sign/jwe.clj
+++ src/buddy/sign/jwe.clj
@@ -143,7 +143,7 @@
         (crypto/calculate-authtag! cipher output offset)
         (catch InvalidCipherTextException e
           (let [message (str "Couldn't validate gcm authentication tag: " (.getMessage e))]
-            (throw+ {:type :encryption :cause :authtag :message message} e))))
+            (throw+ {:type :validation :cause :authtag :message message} e))))
       output)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Exclude negatives values when caculating sum

--- src/main/hbase_region_inspector/core.clj
+++ src/main/hbase_region_inspector/core.clj
@@ -151,7 +151,7 @@
         ;; Sort the regions in each server
         grouped (map #(update % :regions sort-fn) grouped)
         ;; Find the local sum of the metric of each region
-        grouped (map #(assoc % :sum (reduce + (map metric (:regions %))))
+        grouped (map #(assoc % :sum (reduce + (filter pos? (map metric (:regions %)))))
                      grouped)
         ;; Find the max of the sums
         group-max (if (not-empty grouped)


Issue: #76 fixed by killing core.match in this file.

--- src/midje/checkers/extended_equality.clj
+++ src/midje/checkers/extended_equality.clj
@@ -1,7 +1,6 @@
 (ns ^{:doc "`=` extended for regular expressions, functions, etc."}
   midje.checkers.extended-equality
-  (:use [clojure.core.match :only [match]]
-        [midje.checkers.extended-falsehood :only [data-laden-falsehood?]]
+  (:use [midje.checkers.extended-falsehood :only [data-laden-falsehood?]]
         [midje.util.form-utils :only [classic-map? extended-fn? pairs record? regex?]]))

 (defn extended-= [actual expected]
@@ -11,14 +10,28 @@
                 false
                 function-result)))]
     (try
-      (match [actual expected]
-        [(a :when data-laden-falsehood?) _]    actual
-        [_ (e :when data-laden-falsehood?)]    expected
-        [_ (e :when extended-fn?)]                 (evaluate-extended-fn)
-        [(a :when regex?)  (e :when regex?)]       (= (str actual) (str expected))
-        [_                 (e :when regex?)]       (re-find expected actual)
-        [(a :when record?) (e :when classic-map?)] (= (into {} actual) expected)
-        :else                                      (= actual expected))
+      (cond (data-laden-falsehood? actual)
+            actual
+
+            (data-laden-falsehood? expected)
+            expected
+
+            (extended-fn? expected)
+            (evaluate-extended-fn)
+
+            (and (regex? actual)
+                 (regex? expected))
+            (= (str actual) (str expected))
+
+            (regex? expected)
+            (re-find expected actual)
+
+            (and (record? actual)
+                 (classic-map? expected))
+            (= (into {} actual) expected)
+
+            :else
+            (= actual expected))
       (catch Throwable ex false))))

 (defn extended-list-=


Fixes CLJC catch class.

Fixes CLJC catch class.

--- src/onyx/flow_conditions/fc_routing.cljc
+++ src/onyx/flow_conditions/fc_routing.cljc
@@ -20,7 +20,7 @@
            (try
              {:success? true
               :result ((:flow/predicate entry) [event (:root result) message (:leaves result)])}
-             (catch Throwable t
+             (catch #?(:clj Throwable :cljs js/Error) t
                {:success? false
                 :result {:old (:root result)
                          :new message


Remove confusing Xs on side nav

Remove confusing Xs on side nav

These Xs just re-navigate to root, which doesn't necessarily always
make sense because it usually just means the top item in the list.
We've talked about removing them for awhile, so I figured I'd do it
while I was here.

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -246,8 +246,6 @@
       (let [subpage (-> app :navigation-data :subpage)]
         (html
          [:div.aside-user
-          [:a.close-menu {:href "./"} ; This may need to change if we drop hashtags from url structure
-           (common/ico :fail-light)]
           [:div.aside-user-options
            (expand-menu-items (project-settings-nav-items app owner) subpage)]])))))

@@ -288,10 +286,7 @@
       (let [subpage (-> app :navigation-data :subpage)]
         (html
           [:div.aside-user {:class (when (= :account (:navigation-point app)) "open")}
-           [:header
-            [:h4 "Account Settings"]
-            [:a.close-menu {:href "./"} ; This may need to change if we drop hashtags from url structure
-             (common/ico :fail-light)]]
+           [:header [:h4 "Account Settings"]]
            [:div.aside-user-options
             (expand-menu-items (account-settings-nav-items) subpage)]])))))

@@ -318,10 +313,7 @@
       (let [subpage (-> app :navigation-data :subpage)]
         (html
          [:div.aside-user
-          [:header
-           [:h4 "Admin Settings"]
-           [:a.close-menu {:href "./"} ; This may need to change if we drop hashtags from url structure
-            (common/ico :fail-light)]]
+          [:header [:h4 "Admin Settings"]]
           [:div.aside-user-options
            (expand-menu-items (admin-settings-nav-items) subpage)]])))))

@@ -354,10 +346,7 @@
             subpage (redirect-org-settings-subpage (-> app :navigation-data :subpage) plan (:name org-data) (:vcs_type org-data))
             items (org-settings-nav-items plan org-data)]
         (html
-         [:div.aside-user
-          [:header.aside-item.aside-heading "Organization Settings"
-           [:a.close-menu {:href "./"} ; This may need to change if we drop hashtags from url structure
-            (common/ico :fail-light)]]
+         [:div.aside-user [:header.aside-item.aside-heading "Organization Settings"]
           [:div.aside-user-options
            (expand-menu-items items subpage)]])))))


In React 0.13, you can't call classes as functions

Instead we need to create a factory first.

--- src-cljs/frontend/components/build.cljs
+++ src-cljs/frontend/components/build.cljs
@@ -334,7 +334,10 @@
                                           :build-running? build-running?}))
           (om/build sticky {:content div :content-class "containers"})])))))

-(def css-trans-group (-> js/React (aget "addons") (aget "CSSTransitionGroup")))
+(def css-trans-group (-> js/React
+                         (aget "addons")
+                         (aget "CSSTransitionGroup")
+                         js/React.createFactory))

 (defn transition-group
   [opts component]


(maint) Fix log message accidentally converted to a warning

--- src/puppetlabs/trapperkeeper/plugins.clj
+++ src/puppetlabs/trapperkeeper/plugins.clj
@@ -98,7 +98,7 @@
         (do
           (verify-no-duplicate-resources plugins)
           (doseq [jar (jars-in-dir plugins)]
-            (log/warn (i18n/trs "Adding plugin {0} to classpath." (.getAbsolutePath jar)))
+            (log/info (i18n/trs "Adding plugin {0} to classpath." (.getAbsolutePath jar)))
             (kitchensink/add-classpath jar)
             (kitchensink/add-classpath jar (clojure.lang.RT/baseLoader))))
         (throw (IllegalArgumentException.


Fixed 'cleanup' mutator card.

Fixed 'cleanup' mutator card.

--- src/clj/funstructor/cards_functions.clj
+++ src/clj/funstructor/cards_functions.clj
@@ -337,7 +337,7 @@
 (defmethod apply-card
   :mutator-cleanup
   [game player-key card & args]
-  (let [opponent (get-opponent game-map player-key)]
+  (let [opponent (get-opponent game player-key)]
     ((apply-to-funstruct game player-key)
      (fn [funstruct]
        (filterv #(not= :gap (:terminal %)) funstruct)))))


add mobile menu and search css

add mobile menu and search css

--- src/cljs/daveconservatoire/site/ui.cljs
+++ src/cljs/daveconservatoire/site/ui.cljs
@@ -317,7 +317,7 @@
                   (dom/form #js {:className "navbar-form"
                                  :onSubmit  #(.preventDefault %)}
                     (dom/button #js {:type "submit" :style #js {:display "none"}})
-                    (dom/div #js {:style #js {:width    "100%"
+                    (dom/div #js {:style #js {:width    "80%"
                                               :position "relative"}}
                       (dom/div #js {:style #js {:background "#fff"
                                                 :border     "1px solid #ccc"
@@ -409,7 +409,7 @@
                   (dom/form #js {:className "navbar-form"
                                  :onSubmit  #(.preventDefault %)}
                     (dom/button #js {:type "submit" :style #js {:display "none"}})
-                    (dom/div #js {:style #js {:width    "80%"
+                    (dom/div #js {:style #js {:width    "100%"
                                               :position "relative"}}
                       (dom/div #js {:style #js {:background "#fff"
                                                 :border     "1px solid #ccc"


fix: [bug] react error: unable to find element...

--- src/cljs/expense_tracker/net_worth.cljs
+++ src/cljs/expense_tracker/net_worth.cljs
@@ -7,14 +7,15 @@

 (defn nw-helper [children]
   [:table.table.table-bordered.table-striped
-   (map (fn [n]
-          ^{:key (u/random)}
-          [:tr [:td [:a.text-capitalize {:href (str "/trans/" (:name n))} (:name n)]]
-           [:td (or (:balance n) 0)]])
-        children)
-   [:tr [:td [:strong "Total"]]
-    [:td (reduce + (map #(or (:balance %) 0)
-                        children))]]])
+   [:tbody
+    (map (fn [n]
+           ^{:key (u/random)}
+           [:tr [:td [:a.text-capitalize {:href (str "/trans/" (:name n))} (:name n)]]
+            [:td (or (:balance n) 0)]])
+         children)
+    [:tr [:td [:strong "Total"]]
+     [:td (reduce + (map #(or (:balance %) 0)
+                         children))]]]])

 (defn get-children [parent]
   (:children (first (filter #(= parent (:name %)) @g/accounts))))


Update regex used for JS obj printing

Update regex used for JS obj printing

fixes #221

--- src/cljs/snapshot/lumo/pprint/data.cljs
+++ src/cljs/snapshot/lumo/pprint/data.cljs
@@ -64,7 +64,7 @@
       (object? x)
       (let [kvs (map (fn [k]
                        [(cond-> k
-                          (some? (re-matches #"[A-Za-z][\w\*\+\?!\-']*" k))
+                          (some? (re-matches #"[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*" k))
                           keyword)
                         (gobj/get x k)])
                   (js-keys x))]


fix header search icon warning

fix header search icon warning

--- src/cljs/swarmpit/component/header.cljs
+++ src/cljs/swarmpit/component/header.cljs
@@ -159,7 +159,7 @@
          {:key           "menu-search"
           :aria-haspopup "true"
           :onClick       #(state/update-value [:mobileSearchOpened] true state/layout-cursor)
-          :color         "inherit"} icon/search))
+          :color         "inherit"} (icon/search {})))
      (when (some? actions)
        (comp/icon-button
          {:key           "menu-more"


Fix atom-map-reader

Fix atom-map-reader

--- src/com/wsscode/pathom/connect/gen.cljc
+++ src/com/wsscode/pathom/connect/gen.cljc
@@ -87,7 +87,7 @@
    ::attrs
    (fn attrs [{::p/keys  [path]
                ::pc/keys [indexes]}]
-     (-> (pc/discover-attrs indexes path) keys seq))
+     (-> (pc/discover-attrs indexes (rseq path)) keys seq))

    ::idents
    (fn idents [{::pc/keys [indexes]}]
@@ -96,7 +96,7 @@
    ::nestable-keys
    (fn nestable-keys [{::pc/keys [indexes]
                        ::p/keys  [path]}]
-     (->> (pc/discover-attrs indexes path)
+     (->> (pc/discover-attrs indexes (rseq path))
           (keep (fn [[k v]] (if (seq v) k)))
           seq))


Added move-column to table control

Added move-column to table control

--- src/conexp/contrib/gui/editors/util.clj
+++ src/conexp/contrib/gui/editors/util.clj
@@ -496,6 +496,14 @@
     [(.rowAtPoint (get-control otable) (Point. x y)),
      (.columnAtPoint (get-control otable) (Point. x y))]))

+(defn-typecheck-swing move-column ::table-control
+  "Moves the column at view index old-view to be viewed at view index
+   new-view."
+  [otable old-view new-view]
+  (let [ control (get-control otable)
+         col-model (.getColumnModel control) ]
+    (.moveColumn col-model old-view new-view)))
+
 (defn- table-change-hook
   [otable column first-row last-row type]
   (if (and (= 0 type)
@@ -558,9 +566,15 @@
                                   (not= (deref drag-start) nil))
                               (let [ start (deref drag-start)
                                      end (get-view-coordinates-at-point
-                                           widget (:position x))]
+                                           widget (:position x))
+                                     start-row (first start)
+                                     start-col (second start)
+                                     end-row (first end)
+                                     end-col (second end)]
                                 (dosync
                                   (ref-set drag-start nil))
+                                (if (not= start-col end-col)
+                                  (move-column widget start-col end-col))
                                 (show-data [start end])))),