add preconditions to `cljs.compiler/with-core-cljs`

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -907,6 +907,8 @@
   ([] (with-core-cljs nil))
   ([opts] (with-core-cljs opts (fn [])))
   ([opts body]
+    {:pre [(or (nil? opts) (map? opts))
+           (fn? body)]}
     (when-not (get-in @env/*compiler* [::ana/namespaces 'cljs.core :defs])
       (ana/analyze-file "cljs/core.cljs" opts))
     (body)))


Add more examples

Add more examples

--- src/clojure/cfbt/ch08.clj
+++ src/clojure/cfbt/ch08.clj
@@ -176,3 +176,42 @@
  (println "Here's how I feel about that thing you did: " message))

 ;; Double Evaluation (p178): TBC
+; code that does not work in the expected way
+(defmacro report
+  [to-try]
+  `(if ~to-try
+     (println (quote ~to-try) "was successful:" ~to-try)
+     (println (quote ~to-try) "was not successful:" ~to-try)))
+
+(report (do (Thread/sleep 1000) (+ 1 1)))
+
+; Proper way to avoid the double problem with auto-gensym's symbol
+(defmacro report
+  [to-try]
+  `(let [result# ~to-try]
+     (if result#
+       (println (quote ~to-try) "was successful:" result#)
+       (println (quote ~to-try) "was not successfull:" result#))))
+
+(report (do (Thread/sleep 1000) (+ 1 1)))
+
+;; Macros All the Way Down
+(report (= 1 1))
+;; => (= 1 1) was successful: true
+
+(report (= 1 2))
+;; => (= 1 2) was not successfull: false
+
+(doseq [code ['(= 1 1) '(= 1 2)]]
+  (report code))
+
+(defmacro doseq-macro
+  [macroname & args]
+  `(do
+     ~@(map (fn [arg] (list macroname arg)) args)))
+
+(doseq-macro report (= 1 1) (= 1 2))
+;; (= 1 1) was successful: true
+;; (= 1 2) was not successfull: false
+
+;; Validation Function (p180)


move count column before attributes, make smaller

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -320,34 +320,33 @@
           :else
           (let [attribute-keys (->> entity-list (map #(-> (% "attributes") keys set)) (apply union))
                 attr-col-width (->> attribute-keys count (/ 1000) int (min 400) (max 100))
-                columns [{:header "Entity Name" :starting-width 200
-                          :as-text #(% "name") :sort-by :text
-                          :content-renderer (or (:entity-name-renderer props)
-                                                (fn [entity] (entity "name")))}]
-                columns (into columns
-                          (map (fn [k] {:header k :starting-width attr-col-width :sort-by :text
-                                        :as-text
-                                        (fn [attr-value]
-                                          (cond
-                                            (is-single-ref? attr-value) (attr-value "entityName")
-                                            (is-ref-list? attr-value) (map #(% "entityName") attr-value)
-                                            :else (str attr-value)))
-                                        :content-renderer
-                                        (fn [attr-value]
-                                          (cond
-                                            (is-single-ref? attr-value) (attr-value "entityName")
-                                            (is-ref-list? attr-value) (join ", " (map #(% "entityName") attr-value))
-                                            :else ((:attribute-renderer props) attr-value)))})
-                               attribute-keys))
+                entity-column [{:header "Entity Name" :starting-width 200
+                                :as-text #(% "name") :sort-by :text
+                                :content-renderer (or (:entity-name-renderer props)
+                                                      (fn [entity] (entity "name")))}]
+                attr-columns (map (fn [k] {:header k :starting-width attr-col-width :sort-by :text
+                                           :as-text
+                                           (fn [attr-value]
+                                             (cond
+                                               (is-single-ref? attr-value) (attr-value "entityName")
+                                               (is-ref-list? attr-value) (map #(% "entityName") attr-value)
+                                               :else (str attr-value)))
+                                           :content-renderer
+                                           (fn [attr-value]
+                                             (cond
+                                               (is-single-ref? attr-value) (attr-value "entityName")
+                                               (is-ref-list? attr-value) (join ", " (map #(% "entityName") attr-value))
+                                               :else ((:attribute-renderer props) attr-value)))})
+                                  attribute-keys)
                 make-pair (fn [s]
-                            [{:header (str "# " (clojure.string/capitalize s)) :starting-width attr-col-width}
+                            [{:header (str "# " s) :starting-width 110}
                              #(count (get-in % ["attributes" s]))])
-                [count-header count-data] (cond (= selected-entity-type "sample_set") (make-pair "samples")
+                [count-column count-data] (cond (= selected-entity-type "sample_set") (make-pair "samples")
                                                 (= selected-entity-type "pair_set") (make-pair "pairs")
                                                 (= selected-entity-type "participant_set") (make-pair "participants"))
-                columns (if count-header
-                          (conj columns count-header)
-                          columns)]
+                columns (if count-column
+                          (concat entity-column [count-column] attr-columns)
+                          (concat entity-column attr-columns))]
             [Table
              (merge props
                {:key (gensym)
@@ -363,10 +362,14 @@
                                       (when-let [func (:on-filter-change props)]
                                         (func type))))
                 :data entity-list
-                :->row (fn [m]
-                         (vec (concat [m]
-                                      (map (fn [k] (get-in m ["attributes" k])) attribute-keys)
-                                      (when count-data [(count-data m)]))))})]))]))
+                :->row (if count-column
+                         (fn [m]
+                           (vec (concat [m]
+                                        [(count-data m)]
+                                        (map #(get-in m ["attributes" %]) attribute-keys))))
+                         (fn [m]
+                           (vec (concat [m]
+                                        (map #(get-in m ["attributes" %]) attribute-keys)))))})]))]))
    :component-did-mount
    (fn [{:keys [props state this]}]
      (endpoints/call-ajax-orch


Vector math implementation in MKL GE engine.

--- src/clojure/uncomplicate/neanderthal/internal/host/mkl.clj
+++ src/clojure/uncomplicate/neanderthal/internal/host/mkl.clj
@@ -131,6 +131,96 @@
       ~y)
     (dragan-says-ex "MKL vector functions accept only vectors without stride."
                     {:stride-a (.stride ~a) :stride-b (.stride ~b) :stride-y (.stride ~y)})))
+
+(defmacro ^:private full-matching-map
+  ([a b len offset-a offset-b expr-direct expr]
+   `(let [nav-a# (navigator ~a)
+          nav-b# (navigator ~b)
+          reg# (region ~b)
+          stor-a# (full-storage ~a)
+          stor-b# (full-storage ~b)
+          fd-a# (.fd stor-a#)
+          offset-a# (.offset ~a)
+          offset-b# (.offset ~b)]
+      (if (= nav-a# nav-b#)
+        (if (and (.isGapless stor-a#) (.isGapless stor-b#))
+          ~expr-direct
+          (dotimes [j# fd-a#]
+            (let [start# (.start nav-a# reg# j#)
+                  ~len (- (.end nav-a# reg# j#) start#)
+                  ~offset-a (+ offset-a# (.index stor-a# start# j#))
+                  ~offset-b (+ offset-b# (.index stor-b# start# j#))]
+              ~expr)))
+        (dragan-says-ex "MKL vectorized matrix functions require equal layout."
+                        {:nav-a (info ~a) :nav-b (info ~b)}))))
+  ([a b c len offset-a offset-b offset-c expr-direct expr]
+   `(let [nav-a# (navigator ~a)
+          nav-b# (navigator ~b)
+          nav-c# (navigator ~c)
+          reg# (region ~b)
+          stor-a# (full-storage ~a)
+          stor-b# (full-storage ~b)
+          stor-c# (full-storage ~c)
+          fd-a# (.fd stor-a#)
+          offset-a# (.offset ~a)
+          offset-b# (.offset ~b)
+          offset-c# (.offset ~c)]
+      (if (= nav-a# nav-b# nav-c#)
+        (if (and (.isGapless stor-a#) (.isGapless stor-b#) (.isGapless stor-c#))
+          ~expr-direct
+          (dotimes [j# fd-a#]
+            (let [start# (.start nav-a# reg# j#)
+                  ~len (- (.end nav-a# reg# j#) start#)
+                  ~offset-a (+ offset-a# (.index stor-a# start# j#))
+                  ~offset-b (+ offset-b# (.index stor-b# start# j#))
+                  ~offset-c (+ offset-c# (.index stor-c# start# j#))]
+              ~expr)))
+        (dragan-says-ex "MKL vectorized matrix functions require equal layout."
+                        {:nav-a (info ~a) :nav-b (info ~b) :nav-c (info ~c)})))))
+
+(defmacro matrix-math
+  ([method a y]
+   `(do
+      (when (< 0 (.dim ~a))
+        (let [buff-a# (.buffer ~a)
+              buff-y# (.buffer ~y)]
+          (full-matching-map ~a ~y len# offset-a# offset-y#
+                             (~method (.dim ~a) buff-a# (.offset ~a) buff-y# (.offset ~y))
+                             (~method len# buff-a# offset-a# buff-y# offset-y#))))
+      ~y))
+  ([method a b y]
+   `(do
+      (when (< 0 (.dim ~a))
+        (let [buff-a# (.buffer ~a)
+              buff-b# (.buffer ~b)
+              buff-y# (.buffer ~y)]
+          (full-matching-map ~a ~b ~y len# offset-a# offset-b# offset-y#
+                             (~method (.dim ~a) buff-a# (.offset ~a) buff-b# (.offset ~b) buff-y# (.offset ~y))
+                             (~method len# buff-a# offset-a# buff-b# offset-b# buff-y# offset-y#))))
+      ~y)))
+
+(defmacro matrix-powx [method a b y]
+  `(do
+     (when (< 0 (.dim ~a))
+       (let [buff-a# (.buffer ~a)
+             buff-y# (.buffer ~y)]
+         (full-matching-map ~a ~y len# offset-a# offset-y#
+                            (~method (.dim ~a) buff-a# (.offset ~a) ~b  buff-y# (.offset ~y))
+                            (~method len# buff-a# offset-a# ~b buff-y# offset-y#))))
+     ~y))
+
+(defmacro matrix-linear-frac [method a b scalea shifta scaleb shiftb y]
+  `(do
+     (when (< 0 (.dim ~a))
+       (let [buff-a# (.buffer ~a)
+             buff-b# (.buffer ~b)
+             buff-y# (.buffer ~y)]
+         (full-matching-map ~a ~b ~y len# offset-a# offset-b# offset-y#
+                            (~method (.dim ~a) buff-a# (.offset ~a) buff-b# (.offset ~b)
+                             ~scalea ~shifta ~scaleb ~shiftb buff-y# (.offset ~y))
+                            (~method len# buff-a# offset-a# buff-b# offset-b#
+                             ~scalea ~shifta ~scaleb ~shiftb buff-y# offset-y#))))
+     ~y))

 ;; ============ Integer Vector Engines ============================================

@@ -675,7 +765,105 @@
               ^RealGEMatrix u ^RealGEMatrix vt ^RealDiagonalMatrix superb)))
   (svd [_ a sigma superb]
     (ge-svd LAPACK/dgesvd ^RealGEMatrix a ^RealDiagonalMatrix sigma
-            ^RealGEMatrix zero-matrix ^RealGEMatrix zero-matrix ^RealDiagonalMatrix superb)))
+            ^RealGEMatrix zero-matrix ^RealGEMatrix zero-matrix ^RealDiagonalMatrix superb))
+  VectorMath
+  (sqr [_ a y]
+    (matrix-math MKL/vdSqr ^RealGEMatrix a ^RealGEMatrix y))
+  (mul [_ a b y]
+    (matrix-math MKL/vdMul ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (div [_ a b y]
+    (matrix-math MKL/vdDiv ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (inv [_ a y]
+    (matrix-math MKL/vdInv ^RealGEMatrix a ^RealGEMatrix y))
+  (abs [_ a y]
+    (matrix-math MKL/vdAbs ^RealGEMatrix a ^RealGEMatrix y))
+  (linear-frac [_ a b scalea shifta scaleb shiftb y]
+    (matrix-linear-frac MKL/vdLinearFrac ^RealGEMatrix a ^RealGEMatrix b
+                        scalea shifta scaleb shiftb ^RealGEMatrix y))
+  (sqrt [_ a y]
+    (matrix-math MKL/vdSqrt ^RealGEMatrix a ^RealGEMatrix y))
+  (inv-sqrt [_ a y]
+    (matrix-math MKL/vdInvSqrt ^RealGEMatrix a ^RealGEMatrix y))
+  (cbrt [_ a y]
+    (matrix-math MKL/vdCbrt ^RealGEMatrix a ^RealGEMatrix y))
+  (inv-cbrt [_ a y]
+    (matrix-math MKL/vdInvCbrt ^RealGEMatrix a ^RealGEMatrix y))
+  (pow2o3 [_ a y]
+    (matrix-math MKL/vdPow2o3 ^RealGEMatrix a ^RealGEMatrix y))
+  (pow3o2 [_ a y]
+    (matrix-math MKL/vdPow3o2 ^RealGEMatrix a ^RealGEMatrix y))
+  (pow [_ a b y]
+    (matrix-math MKL/vdPow ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (powx [_ a b y]
+    (matrix-powx MKL/vdPowx ^RealGEMatrix a b ^RealGEMatrix y))
+  (hypot [_ a b y]
+    (matrix-math MKL/vdHypot ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (exp [_ a y]
+    (matrix-math MKL/vdExp ^RealGEMatrix a ^RealGEMatrix y))
+  (expm1 [_ a y]
+    (matrix-math MKL/vdExpm1 ^RealGEMatrix a ^RealGEMatrix y))
+  (log [_ a y]
+    (matrix-math MKL/vdLn ^RealGEMatrix a ^RealGEMatrix y))
+  (log10 [_ a y]
+    (matrix-math MKL/vdLog10 ^RealGEMatrix a ^RealGEMatrix y))
+  (sin [_ a y]
+    (matrix-math MKL/vdSin ^RealGEMatrix a ^RealGEMatrix y))
+  (cos [_ a y]
+    (matrix-math MKL/vdCos ^RealGEMatrix a ^RealGEMatrix y))
+  (tan [_ a y]
+    (matrix-math MKL/vdTan ^RealGEMatrix a ^RealGEMatrix y))
+  (sincos [_ a y z]
+    (matrix-math MKL/vdSinCos ^RealGEMatrix a ^RealGEMatrix y ^RealGEMatrix z))
+  (asin [_ a y]
+    (matrix-math MKL/vdAsin ^RealGEMatrix a ^RealGEMatrix y))
+  (acos [_ a y]
+    (matrix-math MKL/vdAcos ^RealGEMatrix a ^RealGEMatrix y))
+  (atan [_ a y]
+    (matrix-math MKL/vdAtan ^RealGEMatrix a ^RealGEMatrix y))
+  (atan2 [_ a b y]
+    (matrix-math MKL/vdAtan2 ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (sinh [_ a y]
+    (matrix-math MKL/vdSinh ^RealGEMatrix a ^RealGEMatrix y))
+  (cosh [_ a y]
+    (matrix-math MKL/vdCosh ^RealGEMatrix a ^RealGEMatrix y))
+  (tanh [_ a y]
+    (matrix-math MKL/vdTanh ^RealGEMatrix a ^RealGEMatrix y))
+  (asinh [_ a y]
+    (matrix-math MKL/vdAsinh ^RealGEMatrix a ^RealGEMatrix y))
+  (acosh [_ a y]
+    (matrix-math MKL/vdAcosh ^RealGEMatrix a ^RealGEMatrix y))
+  (atanh [_ a y]
+    (matrix-math MKL/vdAtanh ^RealGEMatrix a ^RealGEMatrix y))
+  (erf [_ a y]
+    (matrix-math MKL/vdErf ^RealGEMatrix a ^RealGEMatrix y))
+  (erfc [_ a y]
+    (matrix-math MKL/vdErfc ^RealGEMatrix a ^RealGEMatrix y))
+  (erf-inv [_ a y]
+    (matrix-math MKL/vdErfInv ^RealGEMatrix a ^RealGEMatrix y))
+  (erfc-inv [_ a y]
+    (matrix-math MKL/vdErfcInv ^RealGEMatrix a ^RealGEMatrix y))
+  (cdf-norm [_ a y]
+    (matrix-math MKL/vdCdfNorm ^RealGEMatrix a ^RealGEMatrix y))
+  (cdf-norm-inv [_ a y]
+    (matrix-math MKL/vdCdfNormInv ^RealGEMatrix a ^RealGEMatrix y))
+  (gamma [_ a y]
+    (matrix-math MKL/vdGamma ^RealGEMatrix a ^RealGEMatrix y))
+  (lgamma [_ a y]
+    (matrix-math MKL/vdLGamma ^RealGEMatrix a ^RealGEMatrix y))
+  (expint1 [_ a y]
+    (matrix-math MKL/vdExpInt1 ^RealGEMatrix a ^RealGEMatrix y))
+  (floor [_ a y]
+    (matrix-math MKL/vdFloor ^RealGEMatrix a ^RealGEMatrix y))
+  (vceil [_ a y]
+    (matrix-math MKL/vdCeil ^RealGEMatrix a ^RealGEMatrix y))
+  (trunc [_ a y]
+    (matrix-math MKL/vdTrunc ^RealGEMatrix a ^RealGEMatrix y))
+  (round [_ a y]
+    (matrix-math MKL/vdRound ^RealGEMatrix a ^RealGEMatrix y))
+  (modf [_ a y z]
+    (matrix-math MKL/vdModf ^RealGEMatrix a ^RealGEMatrix y ^RealGEMatrix z))
+  (frac [_ a y]
+    (matrix-math MKL/vdFrac ^RealGEMatrix a ^RealGEMatrix y)))

 (deftype FloatGEEngine []
   Blas
@@ -789,7 +977,105 @@
               ^RealGEMatrix u ^RealGEMatrix vt ^RealDiagonalMatrix superb)))
   (svd [_ a sigma superb]
     (ge-svd LAPACK/sgesvd ^RealGEMatrix a ^RealDiagonalMatrix sigma
-            ^RealGEMatrix zero-matrix ^RealGEMatrix zero-matrix ^RealDiagonalMatrix superb)))
+            ^RealGEMatrix zero-matrix ^RealGEMatrix zero-matrix ^RealDiagonalMatrix superb))
+  VectorMath
+  (sqr [_ a y]
+    (matrix-math MKL/vsSqr ^RealGEMatrix a ^RealGEMatrix y))
+  (mul [_ a b y]
+    (matrix-math MKL/vsMul ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (div [_ a b y]
+    (matrix-math MKL/vsDiv ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (inv [_ a y]
+    (matrix-math MKL/vsInv ^RealGEMatrix a ^RealGEMatrix y))
+  (abs [_ a y]
+    (matrix-math MKL/vsAbs ^RealGEMatrix a ^RealGEMatrix y))
+  (linear-frac [_ a b scalea shifta scaleb shiftb y]
+    (matrix-linear-frac MKL/vsLinearFrac ^RealGEMatrix a ^RealGEMatrix b
+                        scalea shifta scaleb shiftb ^RealGEMatrix y))
+  (sqrt [_ a y]
+    (matrix-math MKL/vsSqrt ^RealGEMatrix a ^RealGEMatrix y))
+  (inv-sqrt [_ a y]
+    (matrix-math MKL/vsInvSqrt ^RealGEMatrix a ^RealGEMatrix y))
+  (cbrt [_ a y]
+    (matrix-math MKL/vsCbrt ^RealGEMatrix a ^RealGEMatrix y))
+  (inv-cbrt [_ a y]
+    (matrix-math MKL/vsInvCbrt ^RealGEMatrix a ^RealGEMatrix y))
+  (pow2o3 [_ a y]
+    (matrix-math MKL/vsPow2o3 ^RealGEMatrix a ^RealGEMatrix y))
+  (pow3o2 [_ a y]
+    (matrix-math MKL/vsPow3o2 ^RealGEMatrix a ^RealGEMatrix y))
+  (pow [_ a b y]
+    (matrix-math MKL/vsPow ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (powx [_ a b y]
+    (matrix-powx MKL/vsPowx ^RealGEMatrix a b ^RealGEMatrix y))
+  (hypot [_ a b y]
+    (matrix-math MKL/vsHypot ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (exp [_ a y]
+    (matrix-math MKL/vsExp ^RealGEMatrix a ^RealGEMatrix y))
+  (expm1 [_ a y]
+    (matrix-math MKL/vsExpm1 ^RealGEMatrix a ^RealGEMatrix y))
+  (log [_ a y]
+    (matrix-math MKL/vsLn ^RealGEMatrix a ^RealGEMatrix y))
+  (log10 [_ a y]
+    (matrix-math MKL/vsLog10 ^RealGEMatrix a ^RealGEMatrix y))
+  (sin [_ a y]
+    (matrix-math MKL/vsSin ^RealGEMatrix a ^RealGEMatrix y))
+  (cos [_ a y]
+    (matrix-math MKL/vsCos ^RealGEMatrix a ^RealGEMatrix y))
+  (tan [_ a y]
+    (matrix-math MKL/vsTan ^RealGEMatrix a ^RealGEMatrix y))
+  (sincos [_ a y z]
+    (matrix-math MKL/vsSinCos ^RealGEMatrix a ^RealGEMatrix y ^RealGEMatrix z))
+  (asin [_ a y]
+    (matrix-math MKL/vsAsin ^RealGEMatrix a ^RealGEMatrix y))
+  (acos [_ a y]
+    (matrix-math MKL/vsAcos ^RealGEMatrix a ^RealGEMatrix y))
+  (atan [_ a y]
+    (matrix-math MKL/vsAtan ^RealGEMatrix a ^RealGEMatrix y))
+  (atan2 [_ a b y]
+    (matrix-math MKL/vsAtan2 ^RealGEMatrix a ^RealGEMatrix b ^RealGEMatrix y))
+  (sinh [_ a y]
+    (matrix-math MKL/vsSinh ^RealGEMatrix a ^RealGEMatrix y))
+  (cosh [_ a y]
+    (matrix-math MKL/vsCosh ^RealGEMatrix a ^RealGEMatrix y))
+  (tanh [_ a y]
+    (matrix-math MKL/vsTanh ^RealGEMatrix a ^RealGEMatrix y))
+  (asinh [_ a y]
+    (matrix-math MKL/vsAsinh ^RealGEMatrix a ^RealGEMatrix y))
+  (acosh [_ a y]
+    (matrix-math MKL/vsAcosh ^RealGEMatrix a ^RealGEMatrix y))
+  (atanh [_ a y]
+    (matrix-math MKL/vsAtanh ^RealGEMatrix a ^RealGEMatrix y))
+  (erf [_ a y]
+    (matrix-math MKL/vsErf ^RealGEMatrix a ^RealGEMatrix y))
+  (erfc [_ a y]
+    (matrix-math MKL/vsErfc ^RealGEMatrix a ^RealGEMatrix y))
+  (erf-inv [_ a y]
+    (matrix-math MKL/vsErfInv ^RealGEMatrix a ^RealGEMatrix y))
+  (erfc-inv [_ a y]
+    (matrix-math MKL/vsErfcInv ^RealGEMatrix a ^RealGEMatrix y))
+  (cdf-norm [_ a y]
+    (matrix-math MKL/vsCdfNorm ^RealGEMatrix a ^RealGEMatrix y))
+  (cdf-norm-inv [_ a y]
+    (matrix-math MKL/vsCdfNormInv ^RealGEMatrix a ^RealGEMatrix y))
+  (gamma [_ a y]
+    (matrix-math MKL/vsGamma ^RealGEMatrix a ^RealGEMatrix y))
+  (lgamma [_ a y]
+    (matrix-math MKL/vsLGamma ^RealGEMatrix a ^RealGEMatrix y))
+  (expint1 [_ a y]
+    (matrix-math MKL/vsExpInt1 ^RealGEMatrix a ^RealGEMatrix y))
+  (floor [_ a y]
+    (matrix-math MKL/vsFloor ^RealGEMatrix a ^RealGEMatrix y))
+  (vceil [_ a y]
+    (matrix-math MKL/vsCeil ^RealGEMatrix a ^RealGEMatrix y))
+  (trunc [_ a y]
+    (matrix-math MKL/vsTrunc ^RealGEMatrix a ^RealGEMatrix y))
+  (round [_ a y]
+    (matrix-math MKL/vsRound ^RealGEMatrix a ^RealGEMatrix y))
+  (modf [_ a y z]
+    (matrix-math MKL/vsModf ^RealGEMatrix a ^RealGEMatrix y ^RealGEMatrix z))
+  (frac [_ a y]
+    (matrix-math MKL/vsFrac ^RealGEMatrix a ^RealGEMatrix y)))

 ;; ================= Triangular Matrix Engines =================================


add some code from ch09

add some code from ch09

--- src/r_incantations/core.clj
+++ src/r_incantations/core.clj
@@ -226,6 +226,100 @@
       :confint-input-coef (-> model :coefs-ci last)
       :adj-r-square model)))

+
+;;----------------------------
+;; Data-Driven Security ch09
+;;----------------------------
+
+(defn read-memproc-data []
+  (-> "book-data/book/ch09/data/memproc.csv"
+      (incanter.io/read-dataset :header true)))
+
+(defn ch09-01
+  "See listings 9-1 and 9-2 in the book"
+  []
+  (let [memproc (read-memproc-data)
+        summary (incanter.stats/summary memproc)
+        proc (incanter.core/$ :proc memproc)
+        mem (incanter.core/$ :mem memproc)
+        state (incanter.core/$ :state memproc)
+        chart (incanter.charts/scatter-plot proc mem :group-by state)]
+    (incanter.core/view chart)))
+
+(defn col-mean [data state col]
+  (incanter.stats/mean
+   (incanter.core/sel
+    (incanter.core/$where {:state state} data)
+    :cols col)))
+
+(defn r-test-sel []
+  ;; To compare to the book, here's the same test-sel that R generates with set.seed(1492)
+  (map dec [69 54 46 27 13 2 206 123 94 184 153 151 245 240 122 238 29 80 152 209 145 87 30 135 21 207 130 124 76 212 33 214 182 47 210 150 89 24 6 65 155 163 34 230 90 49 172 213 22 244 234 225 63 170 134 142 224 48 180 154 199 84 247 99 38 211 233 175 226 223 86 185 137 37 108 197 45 203 177 88 116 202]))
+
+(defn euclidian-distance
+  "Returns the Euclidian distance from (ax,ay) to (bx,by)."
+  [ax ay bx by]
+  (let [ax-bx (- ax bx)
+        ay-by (- ay by)
+        ax-bx-sq (incanter.core/sq ax-bx)
+        ay-by-sq (incanter.core/sq ay-by)]
+    (incanter.core/sqrt (+ ax-bx-sq ay-by-sq))))
+
+(defn compare-euclidian-distance
+  "If the Euclidian distance from (x,y) to (ax,ay) is less than the
+   Euclidian distance from (x,y) to (bx,by), return a, else return b."
+  [a ax ay b bx by x y]
+  (let [a-dist (euclidian-distance ax ay x y)
+        b-dist (euclidian-distance bx by x y)]
+    (if (<= a-dist b-dist) a b)))
+
+(defn ch09-ml-toy
+  "See listings 9-3 through 9-6.
+   Use r? true to use the same test selection that R generates."
+  [& {:keys [r?] :or [false]}]
+  (let [memproc (read-memproc-data)
+        n (count (:rows memproc))
+        test-size (int (/ n 3))
+        test-sel (if r?
+                   (r-test-sel)
+                   (take test-size (incanter.stats/sample (range n) :replacement false)))
+        test-data (incanter.core/sel memproc :rows test-sel)
+        training-data (incanter.core/sel memproc :except-rows test-sel)
+        tr-inf-proc-mean (col-mean training-data "Infected" :proc)
+        tr-inf-mem-mean (col-mean training-data "Infected" :mem)
+        tr-norm-proc-mean (col-mean training-data "Normal" :proc)
+        tr-norm-mem-mean (col-mean training-data "Normal" :mem)
+        test-data (incanter.core/add-derived-column
+                   :prediction
+                   [:proc :mem]
+                   (partial compare-euclidian-distance
+                            "Infected" tr-inf-proc-mean tr-inf-mem-mean
+                            "Normal" tr-norm-proc-mean tr-norm-mem-mean)
+                   test-data)
+        good-guesses (-> (incanter.core/query-dataset
+                          test-data
+                          ;; Is there a better way to check for
+                          ;; equality between two columns?
+                          (fn [row] (= (row :state) (row :prediction))))
+                         :rows
+                         count)
+        accuracy (-> good-guesses
+                     (/ (incanter.core/nrow test-data))
+                     float)]
+    accuracy
+    #_
+    {:tr-inf-proc-mean tr-inf-proc-mean
+     :tr-inf-mem-mean tr-inf-mem-mean
+     :tr-norm-proc-mean tr-norm-proc-mean
+     :tr-norm-mem-mean tr-norm-mem-mean}
+    #_
+    {:n n
+     :test-size test-size
+     :test-sel test-sel
+     :test-data test-data
+     :training-data training-data}))
+
+
 (comment
   ;; hist(rnorm(100))
   (incanter.core/view (incanter.charts/histogram (incanter.stats/sample-normal 100)))


more docs/options

more docs/options

--- src/bolth.clj
+++ src/bolth.clj
@@ -20,9 +20,14 @@

 ; test runner results

-;; holds a persistent queue or a list or a vector (perf test this)
-;; of test results, for later analysis by the runner
-(def ^:dynamic *test-runner-state* nil)
+(def ^{:dynamic true
+       :doc
+       "holds an (atom []) of test results, for later analysis by the runner, iff the runner is reporting slow tests"}
+  *test-runner-state* nil)
+
+       (def ^{:dynamic true
+       :doc "because we print exceptions via clojure.test's report methods, we have to stuff these options in a dynamic var"}
+  *frame-options* {:frame-limit 10})

 (defn record-test-finished [m]
   (when *test-runner-state*
@@ -109,10 +114,8 @@
       (if (instance? Throwable actual)
         (do
           (prn)
-          (io.aviso.exception/write-exception *out* actual {:frame-limit 10}))
+          (io.aviso.exception/write-exception *out* actual *frame-options*))
         (prn actual)))))
-
-

 (defn nanos->ms [nanos]
   (float (/ nanos 1000000)))
@@ -244,12 +247,16 @@
   :exit-with-error-code : an boolean (defaults to false)

   if set to a truthy value, calls (System/exit) after running, with exit code 0 if all the tests passed, or exit code 1 if any tests failed.
-  "
+
+  :frame-options : an map (defaults to {:frame-limit 10})
+
+  options for io.aviso.exception/write-exception. Defaults to just showing 10 lines from exception stacktraces. See (doc io.aviso.exception/write-exception) for full documentation."
   ([] (run-all-tests #".*"))
   ([ns-re] (run-all-tests ns-re {}))
   ([ns-re options]
    (let [writer (if (:force-real-stdout options) (java.io.PrintWriter. System/out) *out*)]
      (binding [*out* writer
+               *frame-options* (:frame-options options *frame-options*)
                clojure.test/*test-out* writer
                *test-runner-state* (if (:show-slow-tests options)
                                      (atom {:last-test-finished (System/nanoTime) :results []}))]
@@ -268,3 +275,14 @@
          (maybe-show-slow-tests results options)
          (maybe-system-exit results options)
          results)))))
+
+(defn pretty-reload
+  ([] (pretty-reload [] {}))
+  ([tools-ns-args frame-options]
+   (require 'clojure.tools.namespace.repl)
+   (require 'io.aviso.exception)
+   (let [r (apply (resolve 'clojure.tools.namespace.repl/refresh) tools-ns-args)]
+     (when (instance? Throwable r)
+       ((resolve 'io.aviso.exception/write-exception) r))
+     r))
+  )


Set :clean-targets

Set :clean-targets

--- ClojureScript/project.clj
+++ ClojureScript/project.clj
@@ -7,6 +7,7 @@
                  [org.omcljs/ambly "0.1.0-SNAPSHOT"]]
   :plugins [[lein-cljsbuild "1.0.5"]]
   :source-paths ["src"]
+  :clean-targets ["js" "out"]
   :cljsbuild {:builds {:dev
                        {:source-paths ["src"]
                         :compiler     {:output-dir     "out"


CMR-3387: Fixing missing paren

CMR-3387: Fixing missing paren

--- access-control-app/src/cmr/access_control/data/group_json_results_handler.clj
+++ access-control-app/src/cmr/access_control/data/group_json_results_handler.clj
@@ -8,7 +8,7 @@

 (def base-fields
   "The base set of fields to select from Elasticsearch"
-  ["concept-id" "revision-id" "name" "provider-id" "description" "legacy-guid" "member-count"]
+  ["concept-id" "revision-id" "name" "provider-id" "description" "legacy-guid" "member-count"])

 (def fields-with-members
   "The fields to select from Elasticsearch if members should be included"


Removed a test that depending on a particular number of sine rubrics.

--- test/simple_symbolic_regression_clojure/gp_test.clj
+++ test/simple_symbolic_regression_clojure/gp_test.clj
@@ -199,7 +199,6 @@

 (fact "sine-rubrics contain the numerical values I imagine they should"
-  (count sine-rubrics) => 32
   (map #(Math/sin (get-in % [:input :x])) sine-rubrics) => (map :output sine-rubrics))


IO: Added named binary csv output.

IO: Added named binary csv output.

--- src/main/clojure/conexp/io/contexts.clj
+++ src/main/clojure/conexp/io/contexts.clj
@@ -384,6 +384,30 @@
     (with-out-writer file
       (println "binary CSV")
       (doseq [g objs]
+        (loop [atts atts]
+          (when-let [m (first atts)]
+            (print (if (incident? ctx g m)
+                     "1"
+                     "0"))
+            (when (next atts)
+              (print ","))
+            (recur (rest atts))))
+        (println)))))
+
+(define-context-output-format :named-binary-csv
+  [ctx file]
+  (when (or (empty? (objects ctx))
+            (empty? (attributes ctx)))
+    (unsupported-operation "Cannot export empty context in binary-csv format"))
+  (let [objs (sort (objects ctx)),
+        atts (sort (attributes ctx))]
+    (with-out-writer file
+      (print "objects")
+      (doseq [m atts]
+        (print ", " m))
+      (println)
+      (doseq [g objs]
+        (print g ",")
         (loop [atts atts]
           (when-let [m (first atts)]
             (print (if (incident? ctx g m)


Using clojure.data.xml for reading contexts

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

--- src/main/clojure/conexp/io/contexts.clj
+++ src/main/clojure/conexp/io/contexts.clj
@@ -12,8 +12,8 @@
         conexp.fca.contexts
         conexp.io.util
         conexp.io.latex)
-  (:use [conexp.util.lazy-xml :exclude (attributes)]
-        [clojure.string :only (split)])
+  (:use [clojure.string :only (split)])
+  (:require [clojure.data.xml :as xml])
   (:import [java.io PushbackReader]))

@@ -157,13 +157,13 @@
 (add-context-input-format :conexp
                           (fn [rdr]
                             (try
-                             (= :ConceptualSystem (-> (parse-seq rdr) first :name))
+                             (= :ConceptualSystem (-> (xml/parse rdr) :tag))
                              (catch Exception _))))

 (define-context-input-format :conexp
   [file]
   (with-in-reader file
-    (let [xml-tree (parse-trim *in*)
+    (let [xml-tree (xml/parse *in*)
           contexts (:content (first (find-tags (:content xml-tree) :Contexts)))]
       (cond
         (= 0 (count contexts))
@@ -226,9 +226,9 @@
 (add-context-input-format :galicia
                           (fn [rdr]
                             (try
-                             (let [xml-tree (parse-seq rdr)]
-                               (and (= :Galicia_Document (-> xml-tree first :name))
-                                    (= :BinaryContext (-> xml-tree second :name))))
+                             (let [xml-tree (xml/parse rdr)]
+                               (and (= :Galicia_Document (-> xml-tree :tag))
+                                    (= :BinaryContext (-> xml-tree :content first :tag))))
                              (catch Exception _))))

 (define-context-output-format :galicia
@@ -256,7 +256,7 @@
 (define-context-input-format :galicia
   [file]
   (with-in-reader file
-    (let [ctx-xml-tree (-> (parse-trim *in*) :content first)
+    (let [ctx-xml-tree (-> (xml/parse *in*) :content first)

           nr-objs (Integer/parseInt (-> ctx-xml-tree :attrs :numberObj))
           nr-atts (Integer/parseInt (-> ctx-xml-tree :attrs :numberAtt))


No magic numbers

No magic numbers

--- src/servisne_info/utils.clj
+++ src/servisne_info/utils.clj
@@ -1,5 +1,7 @@
 (ns servisne-info.utils
   (:use fuzzy-string.core))
+
+(def fuzzy-text-search-sensitivity 5)

 (defn now []
   (java.util.Date.))
@@ -11,5 +13,5 @@

 (defn fuzzy-has-text? [s text]
   (let [partitioned-text (str-partition text (count s))]
-    (not-every? #(> % 5)
+    (not-every? #(> % fuzzy-text-search-sensitivity)
                 (map #(levenshtein s %) partitioned-text))))


remove printlns

remove printlns

--- src/smallblog/dbmigrate.clj
+++ src/smallblog/dbmigrate.clj
@@ -4,8 +4,6 @@

 (defn -main
     ([]
-     (println "migrate to max")
      (drift.execute/run []))
     ([version]
-     (println "migrate to version" version)
      (drift.execute/run ["-version" version])))


stop async context when :max-ops-reached

--- src/thi/ng/fabric/core.cljc
+++ src/thi/ng/fabric/core.cljc
@@ -131,9 +131,9 @@
          [_] @value)])
   IVertex
   (set-value!
-    [_ val] (reset! value val) #_(signal! _) _)
+    [_ val] (reset! value val) _)
   (update-value!
-    [_ f] (swap! value f) #_(signal! _) _)
+    [_ f] (swap! value f) _)
   (collect!
     [_]
     ((::collect-fn @state) _)
@@ -475,5 +475,6 @@
                       (do (warn "execution interrupted")
                           (async-execution-result
                            :stopped result colls sigs t0)))))
-                (async-execution-result :max-ops-reached result colls sigs t0))))
+                (do (stop! _)
+                    (async-execution-result :max-ops-reached result colls sigs t0)))))
           result)))))


Prefix with onyx.plugin.

Prefix with onyx.plugin.

--- src/onyx/datomic/information_model.cljc
+++ src/onyx/datomic/information_model.cljc
@@ -2,7 +2,7 @@

 (def model
   {:catalog-entry
-   {:datomic/read-datoms
+   {:onyx.plugin.datomic/read-datoms
     {:summary "Reads datoms out of a Datomic database via `datomic.api/datoms`."
      :model {:datomic/uri
              {:type :string
@@ -31,7 +31,7 @@
               :default 1000
               :doc "The number of segments to buffer after partitioning."}}}

-    :datomic/read-index-range
+    :onyx.plugin.datomic/read-index-range
     {:summary "Reads datoms from an indexed attribute via `datomic.api/index-range`."
      :model {:datomic/uri
              {:type :string
@@ -63,7 +63,7 @@
               :default 1000
               :doc "The number of segments to buffer after partitioning."}}}

-    :datomic/read-log
+    :onyx.plugin.datomic/read-log
     {:summary "Reads the transaction log via repeated chunked calls of d/tx-range. Continues to read transactions until `:datomic/log-end-tx` is reached, or forever if `:datomic/log-end-tx` is nil."
      :model {:datomic/uri
              {:type :string
@@ -94,7 +94,7 @@
               :default 1000
               :doc "The number of segments to buffer after partitioning."}}}

-    :datomic/commit-tx
+    :onyx.plugin.datomic/commit-tx
     {:summary "Writes new entity maps to datomic. Will automatically assign tempid's for the partition if a value for `:datomic/partition` is supplied and datomic transaction data is in map form. tx-data returned by `datomic.api/transact` is injected into the pipeline event map under `:datomic/written`."
      :model {:datomic/uri
              {:type :string
@@ -105,7 +105,7 @@
               :optional? true
               :doc "When supplied, :db/id tempids are added using this partition."}}}

-    :datomic/commit-bulk-tx
+    :onyx.plugin.datomic/commit-bulk-tx
     {:summary "Exactly the same as commit-bulk-tx (asynchronous), but transacts each tx completely (blocking on the returned future) before proceeding to the next. You should generally prefer the async version."
      :model {:datomic/uri
              {:type :string
@@ -116,7 +116,7 @@
               :optional? true
               :doc "When supplied, :db/id tempids are added using this partition."}}}

-    :datomic/commit-bulk-tx-async
+    :onyx.plugin.datomic/commit-bulk-tx-async
     {:summary "Writes transactions via the `:tx` segment key to a Datomic database. The value of `:tx` should be as if it were ready for `(d/transact uri tx)`. This lets you perform retractions and arbitrary db functions. tx-data returned by datomic.api/transact is injected into the pipeline event map under `:datomic/written`. Takes advantage of the Datomic transactor's ability to pipeline transactions by asynchronously transacting `:onyx/batch-size`transactions at once. Transaction futures are then derefed one by one after. Parallelism can thus be controlled by modifying the batch size appropriately. This is the recommended way to transact in bulk."
      :model {:datomic/uri
              {:type :string
@@ -128,7 +128,7 @@
               :doc "When supplied, :db/id tempids are added using this partition."}}}}

    :display-order
-   {:datomic/read-datoms
+   {:onyx.plugin.datomic/read-datoms
     [:datomic/uri
      :datomic/t
      :datomic/datoms-index
@@ -136,7 +136,7 @@
      :datomic/datoms-per-segment
      :datomic/read-buffer]

-    :datomic/read-index-range
+    :onyx.plugin.datomic/read-index-range
     [:datomic/uri
      :datomic/t
      :datomic/index-attribute
@@ -145,7 +145,7 @@
      :datomic/datoms-per-segment
      :datomic/read-buffer]

-    :datomic/read-log
+    :onyx.plugin.datomic/read-log
     [:datomic/uri
      :datomic/log-start-tx
      :datomic/log-end-tx
@@ -153,14 +153,14 @@
      :checkpoint/key
      :datomic/read-buffer]

-    :datomic/commit-tx
+    :onyx.plugin.datomic/commit-tx
     [:datomic/uri
      :datomic/partition]

-    :datomic/commit-bulk-tx
+    :onyx.plugin.datomic/commit-bulk-tx
     [:datomic/uri
      :datomic/partition]

-    :datomic/commit-bulk-tx-async
+    :onyx.plugin.datomic/commit-bulk-tx-async
     [:datomic/uri
      :datomic/partition]}})


Do not send page updates when historic item is selected.

--- src/uxbox/ui/workspace.cljs
+++ src/uxbox/ui/workspace.cljs
@@ -28,22 +28,32 @@
 ;; Workspace
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn focus-page
+(defn- focus-page
   [id]
   (as-> (ul/getter #(stpr/pack-page % id)) $
     (l/focus-atom $ st/state)))

-(defn on-page-change
+;; TODO: move out of UI.
+
+(defn- on-page-change
   [buffer]
+  #_(println "on-page-change" buffer)
   (let [page (second buffer)]
     (rs/emit! (udp/update-page page))))

-(defn subscribe-to-page-changes
+(defn- subscribe-to-page-changes
   [pageid]
   (as-> (focus-page pageid) $
     (rx/from-atom $)
+    (rx/debounce 1000 $)
+    (rx/scan (fn [acc page]
+               #_(println "change:" (:version acc) "->" (:version page))
+               (let [result (if (>= (:version page) (:version acc))
+                              page
+                              acc)]
+                 ;; (println "!!!" (:version result))
+                 result)) $)
     (rx/dedupe #(dissoc % :version) $)
-    (rx/debounce 1000 $)
     (rx/buffer 2 1 $)
     (rx/subscribe $ on-page-change #(throw %))))


Don't access empty list of points.

Don't access empty list of points.

--- src/videotest/flow_only.clj
+++ src/videotest/flow_only.clj
@@ -180,7 +180,9 @@
   ([pt]
      (draw-pt pt [0 255 0 80])))

-(defn draw-flow [{:keys [new-corners old-corners lk-status] :as state}]
+(defn draw-flow-dots
+  "Draw optical flow as dots."
+  [{:keys [new-corners old-corners lk-status] :as state}]
   (let [pts (.toList new-corners)
         old-pts (.toList old-corners)]
     (when (< 0 (count old-pts))
@@ -191,6 +193,20 @@
         (dorun
          (map draw-pt v-pts))))))

+(defn draw-flow
+  "Draw optical flow as lines."
+  [{:keys [new-corners old-corners lk-status]}]
+  (let [pts (.toList new-corners)
+        old-pts (when old-corners
+                  (.toList old-corners))]
+    (when (< 0 (count old-pts))
+      (dorun
+       (map #(draw-pt % [0 0 255 60]) old-pts)))
+    (when (< 0 (count pts))
+      (let [v-pts (valid-pts pts (.toList lk-status))]
+        (dorun
+         (map draw-pt v-pts))))))
+
 (defn draw [state]
   (let [{:keys [p-image]} state]
     (q/background 0)


No longer using capitalized 'BitAuth'

No longer using capitalized 'BitAuth'

--- src/deps.cljs
+++ src/deps.cljs
@@ -1,4 +1,4 @@
 {:foreign-libs [{:file     "bitauth/bitauth.js"
                  :file-min "bitauth/bitauth.min.js"
-                 :provides ["com.bitpay.BitAuth"]}]
+                 :provides ["com.bitpay.bitauth"]}]
  :externs ["bitauth/externs/bitauth.js"]}


don't send any app state to make-button

don't send any app state to make-button

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -94,7 +94,7 @@
   (when (not= (om/get-state owner korks) value)
     (om/set-state! owner korks value)))

-(defn make-button [app owner]
+(defn make-button [_ owner]
   (reify
     om/IRender
     (render [_]
@@ -162,7 +162,7 @@
               [:h1 "Collaborating should be simple."]
               [:p "Prototype anywhere on any device. No nonsense, just what you need when you need it."]
               [:div.calls-to-action
-               (om/build make-button app)]]]]
+               (om/build make-button {})]]]]
            [:div.our-proof
             ;; Hide this until we get testimonials/stats figured out
             ;; [:div.content "23,142 people have made 112,861 sketches in 27,100 documents."]
@@ -232,7 +232,7 @@
                [:p "Precursor is the easiest way to share ideas with your teammates, fast."]
                [:div.calls-to-action
                 (common/google-login)
-                (om/build make-button app)]]]
+                (om/build make-button {})]]]
              [:div.navigation
               [:div.content
                [:a {:role "button"} "Precursor"]


clean up landing markup/copy

clean up landing markup/copy

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -214,19 +214,10 @@
         (html
          [:div.the-why
           [:div.our-claim
-           [:div.our-philosphy-wrap
-            [:div.our-philosphy.content
-             [:h1.philosphy-headline
-              [:span.philosphy-needed "Precursor wants to simplify"]
-              [:span.philosphy-excess " your"]
-              [:span.philosphy-needed " prototyping"]
-              [:span.philosphy-excess " workflow"]
-              [:span.philosphy-needed "."]]
-             [:p.philosphy-subtext
-              [:span.philosphy-needed "No nonsense—"]
-              [:span.philosphy-needed "exactly what you need"]
-              [:span.philosphy-excess " when you need it"]
-              [:span.philosphy-needed "."]]
+           [:div.our-philosophy-wrap
+            [:div.our-philosophy.content
+             [:h1 "Prototyping and team collaboration should be simple. "]
+             [:p "And whiteboards weren't designed for teams. "]
              [:div.calls-to-action
               (om/build make-button (select-keys app [:document/id]))]]]]
           [:div.our-proof {:class (when (:show-scroll-to-arrow app) "extend")}
@@ -275,44 +266,38 @@
       (let [cast! (om/get-shared owner :cast!)]
         (html
          [:div.the-how
-          [:div.feature.content
-           {:class (when (contains? active-features "1") "art-visible") :ref "1"}
+          [:div.feature.content {:class (when (contains? active-features "1") "art-visible") :ref "1"}
            [:div.feature-story
-            [:h2.feature-headline
-             [:span "Make your ideas accessible anywhere, using any device."]]
-            [:p.feature-copy
-             [:span.content-copy
-              "Quickly find sketches on any tablet or phone and be ready when inspiration hits you.
-              Don't bother wasting time with a big app download—just pull up your favorite browser."]]]
+            [:h2.content-copy
+             "Make your ideas accessible anywhere, using any device. "]
+            [:p.content-copy
+             "Quickly find sketches on any tablet or phone and be ready when inspiration hits you. "
+             "Don't bother wasting time with a big app download—just pull up your favorite browser. "]]
            [:div.feature-media artwork-mobile]]
           [:div.feature-divider]
-          [:div.feature.content
-           {:class (when (contains? active-features "2") "art-visible") :ref "2"}
+          [:div.feature.content {:class (when (contains? active-features "2") "art-visible") :ref "2"}
            [:div.feature-story
-            [:h2.feature-headline
-             [:span "Make prototypes interactive & refine your user experience."]]
-            [:p.feature-copy
-             [:span.content-copy
-              "Easily link your wireframes together in minutes to create working demos of your idea.
-              You'll save time by pinpointing areas for improvement before you go into development."]]
-            [:a.feature-link {:href "/blog/interactive-layers" :target "_self" :role "button" :title "Read the tutorial."}
-             [:span.content-copy
-              "Read the tutorial."]]]
+            [:h2.content-copy
+             "Make prototypes interactive & refine your user experience. "]
+            [:p.content-copy
+             "Easily link your wireframes together in minutes to create working demos of your idea. "
+             "You'll save time by pinpointing areas for improvement before you go into development. "]
+            [:a.feature-link.content-copy {:href "/blog/interactive-layers"}
+             "Read the tutorial."]]
            [:div.feature-media.reverse artwork-interact]]
           [:div.feature-divider]
-          [:div.feature.content
-           {:class (when (contains? active-features "3") "art-visible") :ref "3"}
+          [:div.feature.content {:class (when (contains? active-features "3") "art-visible") :ref "3"}
            [:div.feature-story
-            [:h2.feature-headline
-             [:span "Make team collaboration more productive & engaging."]]
-            [:p.feature-copy
-             [:span.content-copy
-              "Our team features are optimized to make collaborating in real-time effortless.
-              Communicate and create new ideas with your teammates in one secure place."]]
-            [:a.feature-link {:href "/pricing" :role "button" :title "Start your trial"}
-             [:span.content-copy
-              "Try private docs."]]]
-           [:div.feature-media artwork-team]]])))))
+            [:h2.content-copy
+             "Make team collaboration more productive & engaging. "]
+            [:p.content-copy
+             "Our team features are optimized to make collaborating in real-time effortless. "
+             "Communicate and create new ideas with your teammates in one secure place. "]
+            [:a.feature-link.content-copy {:href "/pricing"}
+             "Try private docs."]]
+           [:div.feature-media artwork-team]
+
+           ]])))))

 (defn the-what [app owner]
   (reify
@@ -324,15 +309,15 @@
          [:div.the-what
           [:div.our-proof]
           [:div.our-claim
-           [:div.our-philosphy-wrap
-            [:div.our-philosphy.content
-             [:h1.philosphy-headline
-              [:span.philosphy-needed "Precursor is pure prototyping."]]
-             [:p.philosphy-subtext
-              [:span.philosphy-needed "Real-time collaboration"]
-              [:span.philosphy-excess " that makes it easy "]
-              [:span.philosphy-excess " to focus on what's important"]
-              [:span.philosphy-needed "."]]
+           [:div.our-philosophy-wrap
+            [:div.our-philosophy.content
+             [:h1.philosophy-headline
+              [:span.philosophy-needed "Precursor is pure prototyping."]]
+             [:p.philosophy-subtext
+              [:span.philosophy-needed "Real-time collaboration"]
+              [:span.philosophy-excess " that makes it easy "]
+              [:span.philosophy-excess " to focus on what's important"]
+              [:span.philosophy-needed "."]]
              (if (utils/logged-in? owner)
                [:div.calls-to-action
                 (om/build make-button (select-keys app [:document/id]))]


Updates doc strings

Updates doc strings

--- umm-spec-lib/src/cmr/umm_spec/validation/related_url.clj
+++ umm-spec-lib/src/cmr/umm_spec/validation/related_url.clj
@@ -80,7 +80,7 @@
    "DataContactURL" {"HOME PAGE" []}})

 (defn valid-url-content-types-combo?
-  "Returns true if valid SubType for URLContentType"
+  "Returns true if valid Type and SubType for URLContentType, nil otherwise."
   [url-content-type type sub-type]
   (when (and (some (partial = type) (keys (get valid-url-content-types-map url-content-type)))
              (or (nil? sub-type)
@@ -88,7 +88,7 @@
     true))

 (defn related-url-type-validation
-  "Validate the Type being valid for the accompanying URLContentType"
+  "Validate the Type and SubType being valid for the accompanying URLContentType"
   [field-path value]
   (let [url-content-type (:URLContentType value)
         type (:Type value)


add ‘morph’ argument so that arguments can be printed as words rather than feature structures

--- src/babel/engine.clj
+++ src/babel/engine.clj
@@ -32,6 +32,9 @@
         language-model (if (future? language-model)
                          @language-model
                          language-model)
+        morph (if (future? language-model)
+                (:morph @language-model)
+                (:morph language-model))

         debug (log/debug (str "pre-enriched spec: " spec))

@@ -45,7 +48,8 @@
     (forest/generate spec
                      (:grammar language-model)
                      (:lexicon language-model)
-                     (:index language-model))))
+                     (:index language-model)
+                     morph)))

 (defn generate-from-request [request]
   "respond to an HTTP client's request with a generated sentence, given the client's desired spec, language name, and language model name."


whitespace

whitespace

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -197,15 +197,15 @@
                                                  AND source.active=true
                                                  AND source.structure->'synsem'->'sem' @> '"
                                              json-source-semantics "' LIMIT 1) AS source
-                                  INNER JOIN (SELECT DISTINCT surface, target.structure->'synsem'->'sem' AS sem,
-                                                              root,structure
-                                                         FROM expression_with_root AS target
-                                                        WHERE target.language=?
-                                                          AND target.active=true
-                                                          AND target.structure->'synsem'->'sem' = '" json-target-semantics "') AS target
-                                                           ON (source.surface IS NOT NULL)
-                                                          AND (target.surface IS NOT NULL)
-                                                          AND (true)")
+                                  INNER JOIN (SELECT
+                                            DISTINCT surface, target.structure->'synsem'->'sem' AS sem,
+                                                     root,structure
+                                                FROM expression_with_root AS target
+                                               WHERE target.language=?
+                                                 AND target.active=true
+                                                 AND target.structure->'synsem'->'sem' = '" json-target-semantics "') AS target
+                                          ON (source.surface IS NOT NULL)
+                                         AND (target.surface IS NOT NULL)")
                                         [source-language target-language]]
                                        :results)]
                       (if (nil? (first (map :source results)))


Display index.html when loading URLs ending in /

--- src/asid.clj
+++ src/asid.clj
@@ -29,16 +29,31 @@
         (let [new-id (wr/save wallet-repo (w/new-wallet))]
           (created (w/uri new-id))))

-  (GET "/:id" [id]
+  (GET ["/:id", :id #"([0-9a-f]-){4,4}"] [id]
        (-> (response (json/write-str (w/to-json (wr/get-wallet wallet-repo id))))
            (content-type "application/org.asidentity.wallet+json")))

   (route/not-found (File. "resources/public/not-found.html")))

+(defn wrap-dir-index [handler]
+  (fn [req]
+    (handler
+     (update-in req [:uri] #(if (re-find #"/$" %)
+                              (str % "index.html")
+                              %)))))
+
+(fact
+  (let [wrapper (wrap-dir-index #(:uri %))]
+    (wrapper {:uri "/"}) => "/index.html"
+    (wrapper {:uri "/path/"}) => "/path/index.html"
+    (wrapper {:uri "/path/sub/"}) => "/path/sub/index.html"
+    (wrapper {:uri "/path"}) => "/path"))
+
 (def app
   (-> (handler/site main-routes)
       (wrap-resource "public")
-      (wrap-file-info)))
+      wrap-file-info
+      wrap-dir-index))

 (fact "/"
   (:status (app (mr/request :get "/"))) => 200)


Re-enable ingest delete-time validation test.

--- test/cmr/system_int_test/ingest/collection_ingest_test.clj
+++ test/cmr/system_int_test/ingest/collection_ingest_test.clj
@@ -58,8 +58,7 @@
     (is (re-find #"Invalid XML file." (first errors)))))

 ;; Verify old DeleteTime concept results in 400 error.
-;; TODO commenting out this test while delete time issue is being implemented.
-#_(deftest old-delete-time-collection-ingest-test
+(deftest old-delete-time-collection-ingest-test
   (let [coll (dc/collection {:delete-time "2000-01-01T12:00:00Z"})
         {:keys [status errors]} (ingest/ingest-concept
                                   (d/item->concept (assoc coll :provider-id "PROV1")))]


Add examples for with/using/before/after

--- src/test/clojure/examples/describe1.clj
+++ src/test/clojure/examples/describe1.clj
@@ -1,5 +1,6 @@
 (ns examples.describe1
-  (:use lazytest.describe))
+  (:use lazytest.describe
+	[lazytest.context.stateful :only (stateful)]))

 (describe +
   (it "computes the sum of 3 and 4"
@@ -33,3 +34,27 @@
 	   (< root 2))
 	 (it "is more than one"
 	   (> root 1))))
+
+(describe "Addition with a context"
+  (with [(before (println "This happens before each test example"))
+	 (after (println "This happens after each test example"))]
+    (it "adds small numbers"
+      (= 7 (+ 3 4)))
+    (it "adds large numbers"
+      (= 7000 (+ 3000 4000)))))
+
+(describe "Addition with a context"
+  (with [(before (println "This happens before all tests"))
+	 (after (println "This happens after all tests"))]
+    (testing "with a nested group"
+      (it "adds small numbers"
+	(= 7 (+ 3 4)))
+      (it "adds large numbers"
+	(= 7000 (+ 3000 4000))))))
+
+(describe "Square root of two with state"
+  (using [root (stateful (before (Math/sqrt 2)))]
+    (it "is less than 2"
+      (> 2 @root))
+    (it "is more than 1"
+      (< 1 @root))))


add input-stream-push-back-reader

add input-stream-push-back-reader

--- src/blind/reader.clj
+++ src/blind/reader.clj
@@ -135,7 +135,7 @@
      (StringReader. s (.length s) 0)))

 (defn string-push-back-reader
-  "Creates a StringPushbackReader from a given string"
+  "Creates a PushbackReader from a given string"
   ([s]
      (string-push-back-reader s 1))
   ([^String s buf-len]
@@ -145,6 +145,13 @@
   "Creates an InputStreamReader from an InputString"
   [is]
   (InputStreamReader. is nil))
+
+(defn input-stream-push-back-reader
+  "Creates a PushbackReader from a given InputString"
+  ([is]
+     (input-stream-push-back-reader is 1))
+  ([^InputStream is buf-len]
+     (PushbackReader. (input-stream-reader is) (object-array buf-len) buf-len buf-len)))

 (defn indexing-push-back-reader
   "Creates an IndexingPushbackReader from a given string"
@@ -609,23 +616,23 @@
   (if arg-env
     (throw (IllegalStateException. "Nested #()s are not allowed")))
   (with-bindings {#'arg-env (sorted-map)}
-                 (unread rdr \()
-                 (let [form (read rdr true nil true) ;; this sets bindings
-                       rargs (rseq arg-env)
-                       args (if rargs
-                              (let [higharg (key (first rargs))]
-                                (if (pos? higharg)
-                                  (let [args (loop [i 1 args (transient [])]
-                                               (if (> i higharg)
-                                                 (persistent! args)
-                                                 (recur (inc i) (conj! args (or (get arg-env i)
-                                                                                (garg i))))))
-                                        args (if (arg-env -1)
-                                               (conj args '& (arg-env -1))
-                                               args)]
-                                    args)))
-                              [])]
-                   (list 'fn* args form))))
+    (unread rdr \()
+    (let [form (read rdr true nil true) ;; this sets bindings
+          rargs (rseq arg-env)
+          args (if rargs
+                 (let [higharg (key (first rargs))]
+                   (if (pos? higharg)
+                     (let [args (loop [i 1 args (transient [])]
+                                  (if (> i higharg)
+                                    (persistent! args)
+                                    (recur (inc i) (conj! args (or (get arg-env i)
+                                                                   (garg i))))))
+                           args (if (arg-env -1)
+                                  (conj args '& (arg-env -1))
+                                  args)]
+                       args)))
+                 [])]
+      (list 'fn* args form))))

 (defn register-arg [n]
   (if arg-env
@@ -815,8 +822,8 @@
 (defn read-syntax-quote
   [rdr backquote]
   (with-bindings {#'gensym-env {}}
-                 (-> (read rdr true nil true)
-                     syntax-quote)))
+    (-> (read rdr true nil true)
+        syntax-quote)))

 (defn macros [ch]
   (let [c (char ch)]


added comos function - will need to spit out appropriate data, though

--- src/analysis/core.clj
+++ src/analysis/core.clj
@@ -122,10 +122,10 @@

 (defn cosmos
   "Returns a summary of the recommended runs for this data set"
-  [logs cosmos-extraction-fn]
+  [logs]
   (cosmos/recommended-runs (-> (for [log logs]
                                  (for [[report gen] (map #(vector %1 %2) (:reports log) (iterate inc 0))]
-                                   (for [[ord val] (cosmos-extraction-fn report)]
+                                   (for [[ord val] (seq (get report "Cosmos Data:"))]
                                      (struct-map cosmos/cosmos-data
                                        :ord ord
                                        :gen gen


fix cake-project bug

fix cake-project bug

--- src/cake.clj
+++ src/cake.clj
@@ -161,7 +161,7 @@
 (defn process-command [form]
   (let [[task args port] form]
     (binding [project         @cake-project
-              ant/ant-project (ant/init-project project server/*outs*)
+              ant/ant-project (ant/init-project @cake-project server/*outs*)
               opts            (parse-opts (keyword task) args)
               config          (read-config)
               bake-port       port


lock in try block to ensure unlock

lock in try block to ensure unlock

--- src/clj/neb/cell.clj
+++ src/clj/neb/cell.clj
@@ -56,17 +56,19 @@
   `(with-cell-meta
      ~trunk ~hash
      (do (.lockWrite *cell-meta*)
-         (let [value# (do ~@body)]
-           (.unlockWrite *cell-meta*)
-           value#))))
+         (try
+           ~@body
+           (finally
+             (.unlockWrite *cell-meta*))))))

 (defmacro with-read-lock [trunk hash & body]
   `(with-cell-meta
      ~trunk ~hash
      (do (.lockRead *cell-meta*)
-         (let [value# (do ~@body)]
-           (.unlockRead *cell-meta*)
-           value#))))
+         (try
+           ~@body
+           (finally
+             (.unlockRead *cell-meta*))))))

 (defn get-cell-id []
   (.getLocation *cell-meta*))


also store latest partition date

also store latest partition date

--- src/clj_money/db.clj
+++ src/clj_money/db.clj
@@ -36,16 +36,35 @@
   [["-n" "--dry-run" "Dry run"]
    ["-s" "--silent" "Do not output SQL commands"]])

-(defn- update-earliest-partition-date
+(defn- get-setting
+  [setting-name]
+  (when-let [record (first (jdbc/query (env :db) (-> (select :value)
+                                                     (from :settings)
+                                                     (where [:= :name setting-name])
+                                                     sql/format)))]
+    (read-string (:value record))))
+
+(defn- put-earliest-partition-date
   [date]
   (let [setting-name "earliest-partition-date"
-        existing (when-let [record (first (jdbc/query (env :db) (-> (select :value)
-                                                                    (from :settings)
-                                                                    (where [:= :name setting-name])
-                                                                    sql/format)))]
-                   (read-string (:value record)))
+        existing (get-setting setting-name)
         sql (if existing
               (when (t/before? date existing)
+                (-> (update :settings)
+                    (sset {:value (prn-str date)})
+                    (where [:= :name setting-name])))
+              (-> (insert-into :settings)
+                  (values [{:name setting-name
+                            :value (prn-str date)}])))]
+    (when sql
+      (jdbc/execute! (env :db) (sql/format sql)))))
+
+(defn- put-latest-partition-date
+  [date]
+  (let [setting-name "latest-partition-date"
+        existing (get-setting setting-name)
+        sql (if existing
+              (when (t/after? date existing)
                 (-> (update :settings)
                     (sset {:value (prn-str date)})
                     (where [:= :name setting-name])))
@@ -62,4 +81,5 @@
         end-date (or (-> arguments second parse-local-date)
                      start-date)]
     (create-partition-tables start-date end-date options)
-    (update-earliest-partition-date start-date)))
+    (put-earliest-partition-date start-date)
+    (put-latest-partition-date end-date)))


Fix several self-join bugs

Fix several self-join bugs

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -431,18 +431,23 @@
     (.maintain trieterator)
     trieterator))

-;; works on trees
+;; works on one level of a trie
 (deftype Intersection [iterators ^:mutable end? key-len]
   Object
   (key [this]
        (when (false? end?)
          (.key (aget iterators 0))))
+  (maintain [this]
+            (set! end? false)
+            (dotimes [i (alength iterators)]
+              (if (.-end? (aget iterators i))
+                (set! end? true))))
   (search [this current]
           (when (false? end?)
             (loop [current current]
               (let [max-key (.key (aget iterators (mod (- current 1) (alength iterators))))
                     min-key (.key (aget iterators current))]
-                (when-not (key= min-key max-key)
+                (when-not (== min-key max-key)
                   (.seek (aget iterators current) max-key)
                   (if (true? (.-end? (aget iterators current)))
                     (set! end? true)
@@ -494,6 +499,7 @@
         (assert (false? end?)) ;; have to be at a key to descend
         (assert (< key-ix (- (alength key-ix->intersection) 1)))
         (set! key-ix (+ key-ix 1))
+        (.maintain (aget key-ix->intersection key-ix))
         (let [iterator->present? (aget key-ix->iterator->present? key-ix)]
           (dotimes [i (alength iterator->present?)]
             (if (aget iterator->present? i)
@@ -503,6 +509,7 @@
   (up [this]
       (assert (> key-ix 0))
       (set! key-ix (- key-ix 1))
+      (.maintain (aget key-ix->intersection key-ix))
       (let [iterator->present? (aget key-ix->iterator->present? key-ix)]
         (dotimes [i (alength iterator->present?)]
           (if (aget iterator->present? i)
@@ -777,6 +784,7 @@
                  movements (gen/vector (gen-movement key-len))]
                 (run-iterator-prop min-keys key-len actions movements)))

+;; BROKEN by changing Intersection to work on values instead of arrays
 (defn run-intersection-prop [min-keys key-len actionss movements]
   (let [trees (map #(apply-to-tree (tree min-keys key-len) %) actionss)
         keys (apply clojure.set/intersection (map #(set (map (fn [[k v]] (vec k)) %)) trees))
@@ -816,13 +824,14 @@
         join-results (apply-to-iterator
                       (treeterator (join #js [iterator-a iterator-b] key-len #js [(into-array (range key-len)) (into-array (range key-len))]))
                       movements)]
-    (= iterator-results join-results)))
+    (= (map vec iterator-results) (map vec join-results))))

 (defn self-join-prop [key-len]
   (prop/for-all [min-keys gen/s-pos-int
                  actions (gen/vector (gen-action key-len))
                  movements (gen/vector (gen-next key-len))] ;; TODO use gen-movement once Treeterator supports seek
                 (run-self-join-prop min-keys key-len actions movements)))
+

 (comment
   (dc/quick-check 1000 (least-prop 1))
@@ -850,7 +859,7 @@
   (dc/quick-check 10000 (trie-tree-prop 1))
   (dc/quick-check 10000 (trie-tree-prop 2))
   (dc/quick-check 10000 (trie-tree-prop 3))
-  (dc/quick-check 100 (self-join-prop 1))
+  (dc/quick-check 10000 (self-join-prop 1))
   (dc/quick-check 100 (self-join-prop 2))
   (dc/quick-check 100 (self-join-prop 3))


Tweeks for testing.

Tweeks for testing.

--- src/videotest/flock_tune/flock_core.clj
+++ src/videotest/flock_tune/flock_core.clj
@@ -18,7 +18,7 @@
 (def PIX-CNT1 (* WIDTH HEIGHT 4))
 (def PIX-CNT2 (* WIDTH HEIGHT))

-(def NUM-VEHICLES 100)
+(def NUM-VEHICLES 500)

 ;; bArray is the temporary byte array buffer for OpenCV cv::Mat.
@@ -45,7 +45,7 @@
 (defn update [state]
   (let [upd-vehicles (partial flock/update-vehicles WIDTH HEIGHT)]
     (-> state
-        (cv/update-image-detection)
+        #_(cv/update-image-detection)
         #_(gesture/record-gestures)
         (upd-vehicles))))


Start daemon correctly

Start daemon correctly

--- src/circleci/backend/project/circleci.clj
+++ src/circleci/backend/project/circleci.clj
@@ -20,6 +20,6 @@
                           :group circle/circleci-group
                           :actions [(checkout "git@github.com:arohner/CircleCI.git")
                                     (bash [(lein deps)
-                                           (lein daemon start :web)])
+                                           (lein daemon start ":web")])
                                     ;;; Load Balancer
                                     ]))


update node client #62

update node client
#62

--- src/clj/swarmpit/docker/engine/client.clj
+++ src/clj/swarmpit/docker/engine/client.clj
@@ -194,9 +194,9 @@
   [secret]
   (try
     (->
-      (execute {:method :POST
-                :api "/secrets/create"
-                :options {:body secret
+      (execute {:method  :POST
+                :api     "/secrets/create"
+                :options {:body    secret
                           :headers {:Content-Type "application/json"}}})
       :body)
     (catch Exception ex
@@ -241,8 +241,8 @@
 (defn create-config
   [config]
   (try
-    (-> (execute {:method :POST
-                  :api "/configs/create"
+    (-> (execute {:method  :POST
+                  :api     "/configs/create"
                   :options {:body config}})
         :body)
     (catch Exception ex
@@ -264,6 +264,15 @@
                 :api    (str "/nodes/" id)})
       :body))

+(defn update-node
+  [id version node]
+  (-> (execute {:method  :POST
+                :api     (str "/nodes/" id "/update")
+                :options {:body         node
+                          :query-params {:version version}
+                          :headers      {:Content-Type "application/json"}}})
+      :body))
+
 (defn node-tasks
   [id]
   (let [query-params {:filters (generate-string {:node          [id]


CMR-4537: Resolved jar file conflicts for indexer app.

--- umm-lib/project.clj
+++ umm-lib/project.clj
@@ -4,6 +4,7 @@
                various dialects of each concept."
   :url "https://github.com/nasa/Common-Metadata-Repository/tree/master/umm-lib"
   :exclusions [
+    [org.clojure/clojure]
     [org.clojure/tools.reader]]
   :dependencies [
     [nasa-cmr/cmr-common-app-lib "0.1.0-SNAPSHOT"]


minor clean-up

minor clean-up

--- src/clj_money/models/lot_transactions.clj
+++ src/clj_money/models/lot_transactions.clj
@@ -48,8 +48,8 @@
               :create create-lot-transaction
               :after-read after-read}))

+; TODO change this name to "search" for consistancy
 (defn select
   [storage-spec criteria]
   (with-storage [s storage-spec]
-    (map after-read
-         (select-lot-transactions s criteria))))
+    (map after-read (select-lot-transactions s criteria))))


(maint) Relax schema constraints on generate-ssl-context

The addition of schemas in this library made the arguments acceptable
to `generate-ssl-context` too restrictive for the way the library was
typcially used. This commit relaxes the requirements of the
`SSLContextOptions` schema to improve backwards compatability.

--- src/clojure/puppetlabs/ssl_utils/core.clj
+++ src/clojure/puppetlabs/ssl_utils/core.clj
@@ -139,7 +139,8 @@
    (schema/optional-key :ssl-key) Readerable
    (schema/optional-key :ssl-ca-cert) Readerable
    (schema/optional-key :ssl-ca-crls) Readerable
-   (schema/optional-key :ssl-context) SSLContext})
+   (schema/optional-key :ssl-context) SSLContext
+   schema/Any schema/Any})

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Internal


Loading pattern configuration option

Loading pattern configuration option

--- src/cloverage_jenkins_reporter/config.clj
+++ src/cloverage_jenkins_reporter/config.clj
@@ -42,15 +42,22 @@
     "URL for Jenkins page with job list."
     (atom nil))

+(def pattern-for-coverage-jobs
+    "Pattern for all jobs that contains Cloverage reports."
+    (atom nil))
+
 (defn load-configuration
     [config-file-name]
     (let [configuration (config-loader/load-configuration-file config-file-name)]
         (reset! jenkins-url            (:jenkins-url configuration))
         (reset! jenkins-job-prefix-url (:jenkins-job-prefix-url configuration))
-        (reset! jenkins-job-list-url   (:jenkins-job-list-url configuration))))
+        (reset! jenkins-job-list-url   (:jenkins-job-list-url configuration))
+        (reset! pattern-for-coverage-jobs (:pattern-for-coverage-jobs configuration))))

 (defn print-configuration
     []
-    (println "jenkins-url:            " @jenkins-url)
-    (println "jenkins-job-prefix-url: " @jenkins-job-prefix-url)
-    (println "jenkins-job-list-url:   " @jenkins-job-list-url))
+    (println "jenkins-url:               " @jenkins-url)
+    (println "jenkins-job-prefix-url:    " @jenkins-job-prefix-url)
+    (println "jenkins-job-list-url:      " @jenkins-job-list-url)
+    (println "pattern-for-coverage-jobs: " @pattern-for-coverage-jobs))
+


move (defn any-possible-complement?)

move (defn any-possible-complement?)


cleanup dead code

cleanup dead code


CMR-1852: Removed ProviderId from example JSON

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
@@ -112,8 +112,7 @@
      :MetadataAssociations [{:Type "SCIENCE ASSOCIATED"
                              :Description "Associated with a collection"
                              :EntryId "AssocEntryId"
-                             :Version "V8"
-                             :ProviderId "PROV1"}]}))
+                             :Version "V8"}]}))

 (defn- prune-empty-maps
   "If x is a map, returns nil if all of the map's values are nil, otherwise returns the map with


use clojure.lang.Var internals to determine its qualified name

--- src/bract/core/impl.clj
+++ src/bract/core/impl.clj
@@ -65,5 +65,5 @@
   (ifunc
     ([this] this)
     ([this config-key] this))
-  (iname [this] (str this))
+  (iname [this] (str (.-ns ^Var this) \/ (.-sym ^Var this)))
   (iargs [this] []))


Make pipeline groups an optional config via switch

--- src/buildviz/gosync.clj
+++ src/buildviz/gosync.clj
@@ -26,10 +26,9 @@
                [""
                 "Syncs Go.cd build history with buildviz"
                 ""
-                "Usage: gosync.clj [OPTIONS] GO_URL [PIPELINE_GROUP] [ANOTHER PIPELINE GROUP] ..."
+                "Usage: gosync.clj [OPTIONS] GO_URL"
                 ""
                 "GO_URL            The URL of the Go.cd installation"
-                "PIPELINE_GROUP    Optional name of a pipeline group in Go"
                 ""
                 "Options"
                 options-summary]))
@@ -38,12 +37,16 @@
   [["-b" "--buildviz URL" "URL pointing to a running buildviz instance"
     :id :buildviz-url
     :default "http://localhost:3000"]
-   ["-f" "--from DATE" "DATE from which on builds are loaded (by default tries to pick up where the last run finished)"
+   ["-f" "--from DATE" "Date from which on builds are loaded, if not specified tries to pick up where the last run finished"
     :id :sync-start-time
     :parse-fn #(tf/parse date-formatter %)]
-   ["-j" "--sync-jobs PIPELINE" "PIPELINE for which Go jobs will be synced individually (not aggregated inside stage)"
+   ["-j" "--sync-jobs PIPELINE" "Pipeline for which Go jobs will be synced individually and not aggregated inside stage"
     :id :sync-jobs
-    :default '()
+    :default nil
+    :assoc-fn (fn [previous key val] (assoc previous key (conj (get previous key) val)))]
+   ["-g" "--pipeline-groups PIPELINE_GROUPS" "Go pipeline groups to be synced, all by default"
+    :id :pipeline-groups
+    :default nil
     :assoc-fn (fn [previous key val] (assoc previous key (conj (get previous key) val)))]
    ["-h" "--help"]])

@@ -254,7 +257,7 @@

   (let [sync-start-time (get-start-date (:sync-start-time (:options args)))
         sync-jobs-for-pipelines (set (:sync-jobs (:options args)))
-        selected-pipeline-group-names (set (drop 1 (:arguments args)))]
+        selected-pipeline-group-names (set (:pipeline-groups (:options args)))]

     (->> (goapi/get-stages go-url)
          (select-stages selected-pipeline-group-names)


Rename camel-casing functions to match the ones in clojure-useful, to ease future use of it as a dependency

--- src/cake/tasks/deps.clj
+++ src/cake/tasks/deps.clj
@@ -3,8 +3,7 @@
         [cake.utils :only [cake-exec os-name os-arch]]
         [cake.project :only [group reload reload!]]
         [bake.core :only [log]]
-        [clojure.java.shell :only [sh]]
-        [clojure.contrib.prxml :only [prxml *prxml-indent*]])
+        [clojure.java.shell :only [sh]])
   (:require [clojure.string :as s])
   (:import [org.apache.maven.artifact.ant DependenciesTask RemoteRepository WritePomTask Pom]
            [org.apache.tools.ant.taskdefs Copy Delete Move]
@@ -83,19 +82,19 @@
    (fileset-seq {:dir dest :includes "*.jar"})
    dest))

-(defn to-camel-case [str]
+(defn camelize [str]
   (s/replace str
              #"-(\w)"
              (comp s/upper-case second)))

-(defn from-camel-case [name]
+(defn dasherize [name]
   (s/replace name
              #"(?<![A-Z])[A-Z]+"
              (comp (partial str "-")
                    s/lower-case)))

 (defn pomify [key]
-  (->> key name to-camel-case (keyword nil)))
+  (->> key name camelize (keyword nil)))

 (defmulti prxml-tags
   (fn [tag value] (keyword "cake.tasks.deps" (name tag))))


Test max-lanes.

Test max-lanes.

--- src/cbfg/test/lane.cljs
+++ src/cbfg/test/lane.cljs
@@ -21,73 +21,101 @@

 (defn test-lane-pump [actx]
   (act tlp actx
-       (let [n (atom 0)
-             in-ch (achan actx)
-             out-ch (achan actx)
-             g (make-lane-pump tlp in-ch out-ch make-echo-lane)]
-         (if (and (do (aput tlp in-ch {:lane :a :op :hi :x 1})
-                      (e n
-                         (atake tlp out-ch)
-                         [:a 0 {:lane :a :op :hi :x 1}]
-                         nil))
-                  (do (aput tlp in-ch {:lane :b :x 2})
-                      (e n
-                         (atake tlp out-ch)
-                         [:b 0 {:lane :b :x 2}]
-                         nil))
-                  (do (aput tlp in-ch {:x 3})
-                      (e n
-                         (atake tlp out-ch)
-                         [nil 0 {:x 3}]
-                         nil))
-                  (do (aput tlp in-ch {:lane :a :x 10})
-                      (e n
-                         (atake tlp out-ch)
-                         [:a 1 {:lane :a :x 10}]
-                         nil))
-                  (do (aput tlp in-ch {:x 30})
-                      (e n
-                         (atake tlp out-ch)
-                         [nil 1 {:x 30}]
-                         nil))
-                  (do (aput tlp in-ch {:lane :x :op :lane-close})
-                      (e n
-                         (atake tlp out-ch)
-                         {:lane :x :op :lane-close :status :not-found}
-                         nil))
-                  (do (aput tlp in-ch {:lane :a :x 100})
-                      (e n
-                         (atake tlp out-ch)
-                         [:a 2 {:lane :a :x 100}]
-                         nil))
-                  (do (aput tlp in-ch {:lane :a :op :lane-close})
-                      (e n
-                         (atake tlp out-ch)
-                         {:lane :a :op :lane-close :status :ok}
-                         nil))
-                  (e n
-                     (atake tlp out-ch) ; For lane :a.
-                     :done
-                     nil)
-                  (do (aput tlp in-ch {:lane :a :x 1000})
-                      (e n
-                         (atake tlp out-ch)
-                         [:a 0 {:lane :a :x 1000}]
-                         nil))
-                  (do (aclose tlp in-ch)
-                      true)
-                  (e n
-                     (atake tlp out-ch) ; For lane :a.
-                     :done
-                     nil)
-                  (e n
-                     (atake tlp out-ch) ; For lane :b.
-                     :done
-                     nil)
-                  (e n
-                     (atake tlp out-ch) ; For lane nil.
-                     :done
-                     nil))
+       (let [n (atom 0)]
+         (if (and
+              (let [in-ch (achan actx)
+                    out-ch (achan actx)
+                    g (make-lane-pump tlp in-ch out-ch make-echo-lane)]
+                (and (do (aput tlp in-ch {:lane :a :op :hi :x 1})
+                         (e n
+                            (atake tlp out-ch)
+                            [:a 0 {:lane :a :op :hi :x 1}]
+                            nil))
+                     (do (aput tlp in-ch {:lane :b :x 2})
+                         (e n
+                            (atake tlp out-ch)
+                            [:b 0 {:lane :b :x 2}]
+                            nil))
+                     (do (aput tlp in-ch {:x 3})
+                         (e n
+                            (atake tlp out-ch)
+                            [nil 0 {:x 3}]
+                            nil))
+                     (do (aput tlp in-ch {:lane :a :x 10})
+                         (e n
+                            (atake tlp out-ch)
+                            [:a 1 {:lane :a :x 10}]
+                            nil))
+                     (do (aput tlp in-ch {:x 30})
+                         (e n
+                            (atake tlp out-ch)
+                            [nil 1 {:x 30}]
+                            nil))
+                     (do (aput tlp in-ch {:lane :x :op :lane-close})
+                         (e n
+                            (atake tlp out-ch)
+                            {:lane :x :op :lane-close :status :not-found}
+                            nil))
+                     (do (aput tlp in-ch {:lane :a :x 100})
+                         (e n
+                            (atake tlp out-ch)
+                            [:a 2 {:lane :a :x 100}]
+                            nil))
+                     (do (aput tlp in-ch {:lane :a :op :lane-close})
+                         (e n
+                            (atake tlp out-ch)
+                            {:lane :a :op :lane-close :status :ok}
+                            nil))
+                     (e n
+                        (atake tlp out-ch) ; For lane :a.
+                        :done
+                        nil)
+                     (do (aput tlp in-ch {:lane :a :x 1000})
+                         (e n
+                            (atake tlp out-ch)
+                            [:a 0 {:lane :a :x 1000}]
+                            nil))
+                     (do (aclose tlp in-ch)
+                         true)
+                     (e n
+                        (atake tlp out-ch) ; For lane :a.
+                        :done
+                        nil)
+                     (e n
+                        (atake tlp out-ch) ; For lane :b.
+                        :done
+                        nil)
+                     (e n
+                        (atake tlp out-ch) ; For lane nil.
+                        :done
+                        nil)))
+              ; Test max-lanes.
+              (let [in-ch (achan actx)
+                    out-ch (achan actx)
+                    g (make-lane-pump tlp in-ch out-ch make-echo-lane
+                                      :max-lanes 0)]
+                (do (aput tlp in-ch {:lane :a :op :hi :x 1})
+                    (e n
+                       (atake tlp out-ch)
+                       {:lane :a :op :hi :x 1
+                        :status :full :status-info :max-lanes}
+                       nil)))
+              (let [in-ch (achan actx)
+                    out-ch (achan actx)
+                    g (make-lane-pump tlp in-ch out-ch make-echo-lane
+                                      :max-lanes 1)]
+                (and
+                 (do (aput tlp in-ch {:lane :a :op :hi :x 1})
+                         (e n
+                            (atake tlp out-ch)
+                            [:a 0 {:lane :a :op :hi :x 1}]
+                            nil))
+                 (do (aput tlp in-ch {:lane :b :op :hi :x 2})
+                     (e n
+                        (atake tlp out-ch)
+                        {:lane :b :op :hi :x 2
+                         :status :full :status-info :max-lanes}
+                        nil)))))
            "pass"
            (str "FAIL: on test-lane #" @n)))))


indenting

indenting

--- src/celestial/redis.clj
+++ src/celestial/redis.clj
@@ -34,9 +34,9 @@

 (defn acquire
   "Acquires lock, returns uuid if successful
-  wait-time (mili) wait time for lock,
-  expiry (sec) how long the lock is valid
-  see http://dr-josiah.blogspot.co.il/2012/01/creating-lock-with-redis.html "
+   wait-time (mili) wait time for lock,
+   expiry (sec) how long the lock is valid
+   see http://dr-josiah.blogspot.co.il/2012/01/creating-lock-with-redis.html "
   [id & [{:keys [wait-time expiry] :or {wait-time 2000 expiry 2} :as opts} & _]]
   {:pre [(or (nil? opts) (associative? opts))]}
   (let [lid (lock-id id) uuid (gen-uuid)


Add driver spec

Add driver spec

--- src/com/wsscode/pathom/diplomat/http.cljc
+++ src/com/wsscode/pathom/diplomat/http.cljc
@@ -24,6 +24,8 @@
 (s/def ::response (s/keys :req [::headers]
                           :opt [::body]))

+(s/def ::driver fn?)
+
 (defn request
   ([{::keys [driver] :as request}]
    (driver request))


:headers keys should be strings

:headers keys should be strings

--- src/com/wsscode/pathom/diplomat/http.cljc
+++ src/com/wsscode/pathom/diplomat/http.cljc
@@ -12,7 +12,7 @@
 ;; pedestal and many others.
 ;; A header can be sent multiple times. So it should be a coll-of values.
 ;; Multiple values are supported both in java.net.http(req/res) and js/fetch(res).
-(s/def ::headers (s/map-of keyword? (s/coll-of string?)))
+(s/def ::headers (s/map-of string? (s/coll-of string?)))

 ;; content-type will generate a header on request. it can be overwriten by passing a explicit content-type
 ;; key on headers map. The driver will use this to convert ::form-params into ::body


no need to export set-print-fn!, not useful under advanced compilation

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -22,7 +22,7 @@
   (fn [_]
     (throw (js/Error. "No *print-fn* fn set for evaluation environment"))))

-(defn ^:export set-print-fn!
+(defn set-print-fn!
   "Set *print-fn* to f."
   [f] (set! *print-fn* f))


New version of «supports»

New version of «supports»

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

--- src/conexp/contrib/algorithms/titanic.clj
+++ src/conexp/contrib/algorithms/titanic.clj
@@ -124,14 +124,17 @@
   associated with -1."
   [context minsupp]
   (let [num-of-objects (count (objects context)),
-        minnum (* minsupp num-of-objects)]
-    (fn [coll]
-      ;; this should be done in one run through the context
-      (into {} (for [atts coll]
-                 [atts (let [num (count (attribute-derivation context atts))]
-                         (if (< num minnum)
-                           -1
-                           (/ num num-of-objects)))])))))
+        minnum         (* minsupp num-of-objects),
+        obj-deriv      (map-by-fn #(object-derivation context #{%}) (objects context))]
+    (fn [att-sets]
+      (map-by-fn
+       (fn [att-set]
+         (let [obj-count (count (filter #(subset? att-set (obj-deriv %))
+                                        (objects context)))]
+           (if (<= minnum obj-count)
+             obj-count
+             -1)))
+       att-sets))))

 (defn titanic-context-intents
   "Computes the intents of the given context via TITANIC."


Improve Performance of set-title!

Improve Performance of set-title!

--- src/cljs/lens/util.cljs
+++ src/cljs/lens/util.cljs
@@ -34,4 +34,5 @@
 ;; ---- Document --------------------------------------------------------------

 (defn set-title! [title]
-  (set! (.-title js/document) title))
+  (when-not (= title (.-title js/document))
+    (set! (.-title js/document) title)))


Docstring

Docstring

--- src/cljs_rest/core.cljs
+++ src/cljs_rest/core.cljs
@@ -104,7 +104,14 @@
   (when-let [error-chan (or (:error-chan opts) (:error-chan @config))]
     (async/put! error-chan error)))

-(defn with-keywords [m]
+(defn with-keywords
+  "Given a map `m`, returns a map preserving the original keys and appending
+  keywords for each non-keyword field. Example:
+
+  (with-keywords {\"a\" \"b\"})
+  ;;=> {\"a\" \"b\"
+  ;;    :a \"b\"}"
+  [m]
   (reduce
     (fn [acc [k v]]
       (assoc acc (keyword k) v))


add missing docstring for core macros

add missing docstring for core macros

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -290,7 +290,9 @@
 (defmacro js-in [key obj]
   (core/list 'js* "~{} in ~{}" key obj))

-(defmacro js-debugger []
+(defmacro js-debugger
+  "Emit JavaScript \"debugger;\" statement."
+  []
   (core/list 'js* "debugger;"))

 (defmacro true? [x]
@@ -308,12 +310,17 @@
   (bool-expr (core/list 'js* "typeof ~{} === 'string'" x)))

 ;; TODO: x must be a symbol, not an arbitrary expression
-(defmacro exists? [x]
+(defmacro exists?
+  "Return true if argument exists, analogous to usage of typeof operator
+   in JavaScript."
+  [x]
   (bool-expr
     (core/list 'js* "typeof ~{} !== 'undefined'"
       (vary-meta x assoc :cljs.analyzer/no-resolve true))))

-(defmacro undefined? [x]
+(defmacro undefined?
+  "Return true if argument is identical to the JavaScript undefined value."
+  [x]
   (bool-expr (core/list 'js* "(void 0 === ~{})" x)))

 (defmacro identical? [a b]
@@ -610,7 +617,45 @@
       'js/Number "number"
       'js/Function "function"})

-(defmacro reify [& impls]
+(defmacro reify
+  "reify is a macro with the following structure:
+
+ (reify options* specs*)
+
+  Currently there are no options.
+
+  Each spec consists of the protocol name followed by zero
+  or more method bodies:
+
+  protocol
+  (methodName [args+] body)*
+
+  Methods should be supplied for all methods of the desired
+  protocol(s). You can also define overrides for Object methods. Note that
+  the first parameter must be supplied to correspond to the target object
+  ('this' in JavaScript parlance). Note also that recur calls
+  to the method head should *not* pass the target object, it will be supplied
+  automatically and can not be substituted.
+
+  recur works to method heads The method bodies of reify are lexical
+  closures, and can refer to the surrounding local scope:
+
+  (str (let [f \"foo\"]
+       (reify Object
+         (toString [this] f))))
+  == \"foo\"
+
+  (seq (let [f \"foo\"]
+       (reify ISeqable
+         (-seq [this] (-seq f)))))
+  == (\\f \\o \\o))
+
+  reify always implements IMeta and IWithMeta and transfers meta
+  data of the form to the created object.
+
+  (meta ^{:k :v} (reify Object (toString [this] \"foo\")))
+  == {:k :v}"
+  [& impls]
   (let [t        (with-meta (gensym "t") {:anonymous true})
         meta-sym (gensym "meta")
         this-sym (gensym "_")
@@ -628,13 +673,18 @@
            ~@impls))
        (new ~t ~@locals ~(ana/elide-reader-meta (meta &form))))))

-(defmacro specify! [expr & impls]
+(defmacro specify!
+  "Identical to reify but mutates its first argument."
+  [expr & impls]
   (let [x (with-meta (gensym "x") {:extend :instance})]
     `(let [~x ~expr]
        (extend-type ~x ~@impls)
        ~x)))

-(defmacro specify [expr & impls]
+(defmacro specify
+  "Identical to specify but does not mutate its first argument. The first
+  argument must be an ICloneable instance."
+  [expr & impls]
   `(cljs.core/specify! (cljs.core/clone ~expr)
      ~@impls))

@@ -813,7 +863,18 @@
           (validate-impl-sigs env proto method))
         (recur (conj protos proto) impls)))))

-(defmacro extend-type [type-sym & impls]
+(defmacro extend-type
+  "Extend a type to a series of protocols. Useful when you are
+   supplying the definitions explicitly inline. Propagates the
+   type as a type hint on the first argument of all fns.
+
+  (extend-type MyType
+    ICounted
+    (-count [c] ...)
+    Foo
+    (bar [x y] ...)
+    (baz ([x] ...) ([x y & zs] ...))"
+  [type-sym & impls]
   (let [env &env
         _ (validate-impls env impls)
         resolve (partial resolve-var env)
@@ -886,7 +947,56 @@
        [~@fields]
        (new ~rname ~@field-values))))

-(defmacro deftype [t fields & impls]
+(defmacro deftype
+  "(deftype name [fields*]  options* specs*)
+
+  Currently there are no options.
+
+  Each spec consists of a protocol or interface name followed by zero
+  or more method bodies:
+
+  protocol-or-Object
+  (methodName [args*] body)*
+
+  The type will have the (by default, immutable) fields named by
+  fields, which can have type hints. Protocols and methods
+  are optional. The only methods that can be supplied are those
+  declared in the protocols/interfaces.  Note that method bodies are
+  not closures, the local environment includes only the named fields,
+  and those fields can be accessed directly. Fields can be qualified
+  with the metadata :mutable true at which point (set! afield aval) will be
+  supported in method bodies. Note well that mutable fields are extremely
+  difficult to use correctly, and are present only to facilitate the building
+  of higherlevel constructs, such as ClojureScript's reference types, in
+  ClojureScript itself. They are for experts only - if the semantics and
+  implications of :mutable are not immediately apparent to you, you should not
+  be using them.
+
+  Method definitions take the form:
+
+  (methodname [args*] body)
+
+  The argument and return types can be hinted on the arg and
+  methodname symbols. If not supplied, they will be inferred, so type
+  hints should be reserved for disambiguation.
+
+  Methods should be supplied for all methods of the desired
+  protocol(s). You can also define overrides for methods of Object. Note that
+  a parameter must be supplied to correspond to the target object
+  ('this' in JavaScript parlance). Note also that recur calls to the method
+  head should *not* pass the target object, it will be supplied
+  automatically and can not be substituted.
+
+  In the method bodies, the (unqualified) name can be used to name the
+  class (for calls to new, instance? etc).
+
+  One constructor will be defined, taking the designated fields.  Note
+  that the field names __meta and __extmap are currently reserved and
+  should not be used when defining your own types.
+
+  Given (deftype TypeName ...), a factory function called ->TypeName
+  will be defined, taking positional parameters for the fields"
+  [t fields & impls]
   (let [env &env
         r (:name (cljs.analyzer/resolve-var (dissoc env :locals) t))
         [fpps pmasks] (prepare-protocol-masks env impls)
@@ -992,7 +1102,60 @@
     `(defn ~fn-name [~ms]
        (new ~rname ~@getters nil (dissoc ~ms ~@ks) nil))))

-(defmacro defrecord [rsym fields & impls]
+(defmacro defrecord
+  "(defrecord name [fields*]  options* specs*)
+
+  Currently there are no options.
+
+  Each spec consists of a protocol or interface name followed by zero
+  or more method bodies:
+
+  protocol-or-Object
+  (methodName [args*] body)*
+
+  The record will have the (immutable) fields named by
+  fields, which can have type hints. Protocols and methods
+  are optional. The only methods that can be supplied are those
+  declared in the protocols.  Note that method bodies are
+  not closures, the local environment includes only the named fields,
+  and those fields can be accessed directly.
+
+  Method definitions take the form:
+
+  (methodname [args*] body)
+
+  The argument and return types can be hinted on the arg and
+  methodname symbols. If not supplied, they will be inferred, so type
+  hints should be reserved for disambiguation.
+
+  Methods should be supplied for all methods of the desired
+  protocol(s). You can also define overrides for
+  methods of Object. Note that a parameter must be supplied to
+  correspond to the target object ('this' in JavaScript parlance). Note also
+  that recur calls to the method head should *not* pass the target object, it
+  will be supplied automatically and can not be substituted.
+
+  In the method bodies, the (unqualified) name can be used to name the
+  class (for calls to new, instance? etc).
+
+  The type will have implementations of several ClojureScript
+  protocol generated automatically: IMeta/IWithMeta (metadata support) and
+  IMap, etc.
+
+  In addition, defrecord will define type-and-value-based =,
+  and will define ClojureScript IHash and IEquiv.
+
+  Two constructors will be defined, one taking the designated fields
+  followed by a metadata map (nil for none) and an extension field
+  map (nil for none), and one taking only the fields (using nil for
+  meta and extension fields). Note that the field names __meta
+  and __extmap are currently reserved and should not be used when
+  defining your own records.
+
+  Given (defrecord TypeName ...), two factory functions will be
+  defined: ->TypeName, taking positional parameters for the fields,
+  and map->TypeName, taking a map of keywords to field values."
+  [rsym fields & impls]
   (let [rsym (vary-meta rsym assoc :internal-ctor true)
         r    (vary-meta
                (:name (cljs.analyzer/resolve-var (dissoc &env :locals) rsym))
@@ -1006,7 +1169,47 @@
        ~(build-map-factory rsym r fields)
        ~r)))

-(defmacro defprotocol [psym & doc+methods]
+(defmacro defprotocol
+  "A protocol is a named set of named methods and their signatures:
+
+  (defprotocol AProtocolName
+    ;optional doc string
+    \"A doc string for AProtocol abstraction\"
+
+  ;method signatures
+    (bar [this a b] \"bar docs\")
+    (baz [this a] [this a b] [this a b c] \"baz docs\"))
+
+  No implementations are provided. Docs can be specified for the
+  protocol overall and for each method. The above yields a set of
+  polymorphic functions and a protocol object. All are
+  namespace-qualified by the ns enclosing the definition The resulting
+  functions dispatch on the type of their first argument, which is
+  required and corresponds to the implicit target object ('this' in
+  JavaScript parlance). defprotocol is dynamic, has no special compile-time
+  effect, and defines no new types.
+
+  (defprotocol P
+    (foo [this])
+    (bar-me [this] [this y]))
+
+  (deftype Foo [a b c]
+    P
+    (foo [this] a)
+    (bar-me [this] b)
+    (bar-me [this y] (+ c y)))
+
+  (bar-me (Foo. 1 2 3) 42)
+  => 45
+
+  (foo
+    (let [x 42]
+      (reify P
+        (foo [this] 17)
+        (bar-me [this] x)
+        (bar-me [this y] x))))
+  => 17"
+  [psym & doc+methods]
   (let [p (:name (cljs.analyzer/resolve-var (dissoc &env :locals) psym))
         psym (vary-meta psym assoc :protocol-symbol true)
         ns-name (-> &env :ns :name)
@@ -1091,7 +1294,12 @@
                false)))
          (cljs.core/native-satisfies? ~psym ~xsym)))))

-(defmacro lazy-seq [& body]
+(defmacro lazy-seq
+  "Takes a body of expressions that returns an ISeq or nil, and yields
+  a ISeqable object that will invoke the body only the first time seq
+  is called, and will cache the result and return it on all subsequent
+  seq calls."
+  [& body]
   `(new cljs.core/LazySeq nil (fn [] ~@body) nil nil))

 (defmacro delay [& body]
@@ -1189,7 +1397,30 @@
               cljs.analyzer/*cljs-file*)))))
     (assoc m test expr)))

-(defmacro case [e & clauses]
+(defmacro case
+  "Takes an expression, and a set of clauses.
+
+  Each clause can take the form of either:
+
+  test-constant result-expr
+
+  (test-constant1 ... test-constantN)  result-expr
+
+  The test-constants are not evaluated. They must be compile-time
+  literals, and need not be quoted.  If the expression is equal to a
+  test-constant, the corresponding result-expr is returned. A single
+  default expression can follow the clauses, and its value will be
+  returned if no clause matches. If no default expression is provided
+  and no clause matches, an Error is thrown.
+
+  Unlike cond and condp, case does a constant-time dispatch, the
+  clauses are not considered sequentially.  All manner of constant
+  expressions are acceptable in case, including numbers, strings,
+  symbols, keywords, and (ClojureScript) composites thereof. Note that since
+  lists are used to group multiple constants that map to the same
+  expression, a vector can be used to match a list if needed. The
+  test-constants need not be all of the same type."
+  [e & clauses]
   (core/let [default (if (odd? (count clauses))
                        (last clauses)
                        `(throw