Adds `whole-text-files` function and enables min-partitions for `text-file`

--- src/clojure/flambo/api.clj
+++ src/clojure/flambo/api.clj
@@ -125,8 +125,15 @@
 (defn text-file
   "Reads a text file from HDFS, a local file system (available on all nodes),
   or any Hadoop-supported file system URI, and returns it as an `JavaRDD` of Strings."
-  [spark-context filename]
-  (.textFile spark-context filename))
+  ([spark-context filename] (.textFile spark-context filename))
+  ([spark-context filename min-partitions] (.textFile spark-context filename min-partitions)))
+
+(defn whole-text-files
+  "Read a directory of text files from HDFS, a local file system (available on all nodes),
+  or any Hadoop-supported file system URI, and returns it as a `JavaPairRDD` of (K, V) pairs,
+  where, K is the path of each file, V is the content of each file."
+  ([spark-context path] (.wholeTextFiles spark-context path))
+  ([spark-context path min-partitions] (.wholeTextFiles spark-context path min-partitions)))

 (defn parallelize
   "Distributes a local collection to form/return an RDD"


Added -v option

Added -v option

--- src/video_server/main.clj
+++ src/video_server/main.clj
@@ -89,13 +89,17 @@
    [nil "--log-level LEVEL" "Override the default logging level"
     :parse-fn log-level
     :validate [identity "The log level must be one of ALL, TRACE, DEBUG, INFO, WARN, ERROR or OFF"]]
+   ["-v" "--version"]
    ["-h" "--help"]])
+
+(defn version []
+  (str "Videos@Home " (version/get-version "com.hudren.homevideo" "video-server")))

 (defn usage
   "Returns a console formatted usage message."
   [summary]
   (str/join \newline
-            [(str "Videos@Home " (version/get-version "com.hudren.homevideo" "video-server"))
+            [(version)
              "Usage: video-server [options] [folder]" ""
              (str "The default folder is " (default-folder)) ""
              "Options:" summary]))
@@ -125,6 +129,7 @@
   [& args]
   (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
     (cond
+      (:version options) (exit 0 (version))
       (:help options) (exit 0 (usage summary))
       (> (count arguments) 1) (exit 1 "Only one folder is allowed.")
       errors (exit 1 (str/join \newline errors)))


docstrings for core

docstrings for core

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -15,9 +15,10 @@
     [boot.util                   :as util]
     [boot.from.clojure.tools.cli :as cli])
   (:import
-   [java.net URLClassLoader URL]
-   java.lang.management.ManagementFactory
-   [java.util.concurrent LinkedBlockingQueue TimeUnit]))
+    [java.io File]
+    [java.net URLClassLoader URL]
+    [java.lang.management ManagementFactory]
+    [java.util.concurrent LinkedBlockingQueue TimeUnit]))

 (declare watch-dirs sync! on-env! get-env set-env! tmpfile tmpdir ls)

@@ -100,6 +101,11 @@
         (apply file/sync :theirs (first d) s)))))

 (defn- set-fake-class-path!
+  "Sets the fake.class.path system property to reflect all JAR files on the
+  pod class path plus the :source-paths and :resource-paths. Note that these
+  directories are not actually on the class path (this is why it's the fake
+  class path). This property is a workaround for IDEs and tools that expect
+  the full class path to be determined by the java.class.path property."
   []
   (let [dirs (->> (get-env)
                   ((juxt :source-paths :resource-paths))
@@ -114,6 +120,8 @@
          (System/setProperty "fake.class.path"))))

 (defn- set-user-dirs!
+  "Resets the file watchers that sync the project directories to their
+  corresponding temp dirs, reflecting any changes to :source-paths, etc."
   []
   (@src-watcher)
   (->> [:source-paths :resource-paths :asset-paths]
@@ -125,19 +133,23 @@
   (sync-user-dirs!))

 (defn- do-cleanup!
+  "Cleanup handler. This is run after the build process is complete. Tasks can
+  register cleanup callbacks via the cleanup macro below."
   []
   (doseq [f @cleanup-fns] (util/guard (f)))
   (reset! cleanup-fns []))

 (defn- printable-readable?
-  "FIXME: document"
+  "If the form can be round-tripped through pr-str -> read-string -> pr-str
+  then form is returned, otherwise nil."
   [form]
   (or (nil? form)
       (false? form)
       (try (read-string (pr-str form)) (catch Throwable _))))

 (defn- rm-clojure-dep
-  "FIXME: document"
+  "Remove the org.clojure/clojure dependency (if one exists) from a Maven
+  dependencies vector."
   [deps]
   (vec (remove (comp (partial = 'org.clojure/clojure) first) deps)))

@@ -163,7 +175,8 @@
       (if (not= o n) (on-env! k o n new)))))

 (defn- add-wagon!
-  "FIXME: document this."
+  "Adds a maven wagon dependency to the worker pod and initializes it with an
+  optional map of scheme handlers."
   ([maven-coord scheme-map]
    (add-wagon! nil [maven-coord] (get-env) scheme-map))
   ([old new env]
@@ -175,13 +188,17 @@
    new))

 (defn- order-set-env-keys
-  "FIXME: document"
+  "Ensures that :dependencies are processed last, because changes to other
+  keys affect dependency resolution."
   [kvs]
   (let [dk :dependencies]
     (->> kvs (sort-by first #(cond (= %1 dk) 1 (= %2 dk) -1 :else 0)))))

 (defn- parse-task-opts
-  "FIXME: document"
+  "Given and argv and a tools.cli type argspec spec, returns a vector of the
+  parsed option map and a list of remaining non-option arguments. This is how
+  tasks in a pipeline created on the cli are separated into individual tasks
+  and task options."
   [argv spec]
   (loop [opts [] [car & cdr :as argv] argv]
     (if-not car
@@ -191,6 +208,7 @@
         (if (seq (:arguments parsd)) [opts argv] (recur opts* cdr))))))

 (defmacro ^:private daemon
+  "Evaluate the body in a new daemon thread."
   [& body]
   `(doto (Thread. (fn [] ~@body)) (.setDaemon true) .start))

@@ -219,17 +237,21 @@
   (tmpd/file tmpfile))

 (defn fileset-diff
-  "FIXME: document this"
+  "Returns a new fileset containing files that were added or modified. Removed
+  files are not considered."
   [before after]
   (if-not before after (tmpd/diff before after)))

 ;; TmpFileSet API

 (defn user-dirs
+  "Get a list of directories containing files that originated in the project's
+  source, resource, or asset paths."
   [fileset]
   (get-dirs fileset #{:user}))

 (defn input-dirs
+  "Get a list of directories containing files with input roles."
   [fileset]
   (get-dirs fileset #{:input}))

@@ -238,30 +260,43 @@
   (get-dirs fileset #{:output}))

 (defn user-files
+  "Get a list of TmpFile objects corresponding to files that originated in
+  the project's source, resource, or asset paths."
   [fileset]
   (get-files fileset #{:user}))

 (defn input-files
+  "Get a list of TmpFile objects corresponding to files with input role."
   [fileset]
   (get-files fileset #{:input}))

 (defn output-files
+  "Get a list of TmpFile objects corresponding to files with output role."
   [fileset]
   (get-files fileset #{:output}))

 (defn ls
+  "Get a list of TmpFile objects for all files in the fileset."
   [fileset]
   (tmpd/ls fileset))

 (defn commit!
+  "Make the underlying temp directories correspond to the immutable fileset
+  tree structure."
   [fileset]
   (tmpd/commit! fileset))

 (defn rm
+  "Removes files from the fileset tree, returning a new fileset object. This
+  does not affect the underlying filesystem in any way."
   [fileset files]
   (tmpd/rm fileset files))

 (defn- non-user-dir-for
+  "Given a fileset and a directory d in that fileset's set of underlying temp
+  directories, returns a directory of the same type (ie. source, resource, or
+  asset) but not a user dir (ie. not one of the directories that is synced to
+  project dirs)."
   [fileset d]
   (let [u (user-dirs fileset)]
     (or (and (not (u d)) d)
@@ -271,22 +306,27 @@
              (get-add-dir fileset)))))

 (defn cp
-  [fileset src-file dest-tmpfile]
+  "Given a fileset and a dest-tmpfile from that fileset, overwrites the dest
+  tmpfile with the contents of the java.io.File src-file."
+  [fileset ^File src-file dest-tmpfile]
   (->> (tmpdir dest-tmpfile)
        (non-user-dir-for fileset)
        (assoc dest-tmpfile :dir)
        (tmpd/cp fileset src-file)))

 (defn add-asset
-  [fileset dir]
+  "Add the contents of the java.io.File dir to the fileset's assets."
+  [fileset ^File dir]
   (tmpd/add fileset (get-add-dir fileset #{:asset}) dir))

 (defn add-source
-  [fileset dir]
+  "Add the contents of the java.io.File dir to the fileset's sources."
+  [fileset ^File dir]
   (tmpd/add fileset (get-add-dir fileset #{:source}) dir))

 (defn add-resource
-  [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:resource}) dir))
+  "Add the contents of the java.io.File dir to the fileset's resources."
+  [fileset ^File dir] (tmpd/add fileset (get-add-dir fileset #{:resource}) dir))

 ;; Tempdir helpers

@@ -418,7 +458,10 @@
   `(swap! @#'boot.core/cleanup-fns conj (fn [] ~@body)))

 (defn reset-fileset
-  [fileset]
+  "Updates the user directories in the fileset with the latest project files,
+  returning a new immutable fileset. When called with no args returns a new
+  fileset containing only the latest project files."
+  [& [fileset]]
   (sync-user-dirs!)
   (-> (if-not fileset
         (new-fileset)
@@ -428,11 +471,13 @@
       (add-user-resource (first (user-resource-dirs)))))

 (defn reset-build!
-  "FIXME: document"
+  "Resets mutable build state to default values. This includes such things as
+  warning counters etc., state that is relevant to a single build cycle. This
+  function should be called before each build iteration."
   []
   (reset! *warnings* 0))

-(defn construct-tasks
+(defn- construct-tasks
   "FIXME: document"
   [& argv]
   (loop [ret [] [op-str & args] argv]
@@ -448,7 +493,7 @@
           (let [[opts argv] (parse-task-opts args spec)]
             (recur (conj ret (apply (var-get op) opts)) argv)))))))

-(defn run-tasks
+(defn- run-tasks
   "FIXME: document"
   [task-stack]
   (let [sync! #(let [tgt (get-env :target-path)]
@@ -458,7 +503,7 @@
                  (sync-user-dirs!))]
     (binding [*warnings* (atom 0)]
       (reset-build!)
-      ((task-stack #(do (sync! %) %)) (commit! (reset-fileset nil))))))
+      ((task-stack #(do (sync! %) %)) (commit! (reset-fileset))))))

 (defmacro boot
   "Builds the project as if `argv` was given on the command line."
@@ -467,9 +512,9 @@
         ->app  (fn [xs] `(apply comp (filter fn? [~@xs])))]
     `(try @(future
              (util/with-let [_# nil]
-               (run-tasks
+               (#'run-tasks
                  ~(if (every? string? argv)
-                    `(apply construct-tasks [~@argv])
+                    `(apply #'construct-tasks [~@argv])
                     (->app (map ->list argv))))))
           (finally (#'do-cleanup!)))))

@@ -533,7 +578,12 @@

   (task-options!
     repl {:port     12345}
-    jar  {:manifest {:howdy \"world\"}})"
+    jar  {:manifest {:howdy \"world\"}})
+
+  You can update options, too:
+
+  (task-options!
+    jar {:manifest #(assoc % :i-like \"turtles\")})"
   [& task-option-pairs]
   `(do ~@(for [[task opts] (partition 2 task-option-pairs)]
            `(let [opt# ~opts
@@ -576,7 +626,10 @@
   [f]
   (.setLastModified f (System/currentTimeMillis)))

-(defn git-files [& {:keys [untracked]}]
+(defn git-files
+  "Returns a list of files roughly equivalent to what you'd get with the git
+  command line `git ls-files`. The :untracked option includes untracked files."
+  [& {:keys [untracked]}]
   (git/ls-files :untracked untracked))

 (defn file-filter


Warning of deftask override prints the stack trace in case of -vvv

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -831,8 +831,10 @@
     `(do
        (when-let [existing-deftask# (resolve '~sym)]
          (when (= *ns* (-> existing-deftask# meta :ns))
-           (boot.util/warn
-             "Warning: deftask %s/%s was overridden\n" *ns* '~sym)))
+           (let [msg# (delay (format "deftask %s/%s was overridden\n" *ns* '~sym))]
+             (boot.util/warn (if (<= @util/*verbosity* 2)
+                               @msg#
+                               (ex/format-exception (Exception. @msg#)))))))
        (cli2/defclifn ~(vary-meta sym assoc ::task true)
          ~@heads
          ~bindings


Evaluate forms in ./profile.boot in addition to BOOT_HOME/profile.boot

--- boot/core/src/boot/main.clj
+++ boot/core/src/boot/main.clj
@@ -68,11 +68,12 @@
     forms
     [`(comment ~(format "end %s" tag))]))

-(defn emit [boot? argv userscript bootscript import-ns]
+(defn emit [boot? argv userscript localscript bootscript import-ns]
   (let [boot-use '[boot.core boot.util boot.task.built-in]]
     `(~(list 'ns 'boot.user
          (list* :use (concat boot-use import-ns)))
-      ~@(when userscript (with-comments "profile" userscript))
+      ~@(when userscript (with-comments "global profile" userscript))
+      ~@(when localscript (with-comments "local profile" localscript))
       ~@(with-comments "boot script" bootscript)
       (let [boot?# ~boot?]
         (if-not boot?#
@@ -148,15 +149,18 @@
                               (util/warn "** Please use $BOOT_HOME/profile.boot instead.\n")
                               (util/warn "** See: https://github.com/boot-clj/boot/issues/157\n")))
               userscript  (or userscript (exists? (io/file (App/getBootDir) "profile.boot")))
+              localscript (exists? (io/file "profile.boot"))
               profile?    (not (:no-profile opts))
               bootforms   (some->> arg0 slurp util/read-string-all)
               userforms   (when profile?
                             (some->> userscript slurp util/read-string-all))
+              localforms  (when profile?
+                            (some->> localscript slurp util/read-string-all))
               initial-env (->> [:source-paths :resource-paths :asset-paths :target-path :dependencies]
                                (reduce #(if-let [v (opts %2)] (assoc %1 %2 v) %1) {})
                                (merge {} (:set-env opts)))
               import-ns   (export-task-namespaces initial-env)
-              scriptforms (emit boot? args userforms bootforms import-ns)
+              scriptforms (emit boot? args userforms localforms bootforms import-ns)
               scriptstr   (binding [*print-meta* true]
                             (str (string/join "\n\n" (map pr-str scriptforms)) "\n"))]


Start add oil price

Start add oil price

--- src/clj_simple_chart/ssb/petroskattdiagrammonthly.clj
+++ src/clj_simple_chart/ssb/petroskattdiagrammonthly.clj
@@ -7,17 +7,21 @@
             [clj-simple-chart.rect :as rect]
             [clj-simple-chart.point :as point]
             [clj-simple-chart.opentype :as opentype]
+            [clojure.test :as test]
             [clojure.string :as string]))

 (def ordinaer (keyword "Ordinær skatt på utvinning av petroleum"))
 (def saerskatt (keyword "Særskatt på utvinning av petroleum"))

+(def oil-date-to-usd brentoilprice/brent-12-mma-dato-to-usd)
+
 (def data (->> petroskatt/twelve-mma-mrd
                (mapv #(assoc % :year (read-string (subs (:dato %) 0 4))))
                (mapv #(assoc % :sum (+ (get % ordinaer) (get % saerskatt))))
+               (mapv #(assoc % :oilprice (get oil-date-to-usd (:dato %) ::none)))
                #_(filter #(>= (:year %) 2010))))

-(def oil-date-to-usd brentoilprice/brent-12-mma-dato-to-usd)
+(test/is (= 0 (count (filter #(= ::none (:oilprice %)) data))))

 (def x-domain (map :dato data))

@@ -92,11 +96,11 @@
 (def yy {:type        :linear
          :orientation :left
          ;:ticks       5
-         :domain      [0 260]})
+         :domain      [0 270]})

 (def yy2 {:type        :linear
           :orientation :right
-          :domain      [0 120]})
+          :domain      [0 (apply max (map :oilprice data))]})

 (def available-height (- svg-height (:height (meta header)) (:height (meta footer))))

@@ -115,7 +119,7 @@

 (def x (:x c))
 (def y (:y c))
-(def y2 (:y c))
+(def y2 (:y2 c))

 (def xfn (partial point/center-point x))
 (def yfn (partial point/center-point y))
@@ -138,7 +142,10 @@
                    :text        (string/replace (format "%.1f" summ) "." ",")})])

 (defn add-oil-price-line []
-  )
+  [:g (map (fn [{dato :dato oilprice :oilprice}]
+             [:g {:transform (core/translate (xfn dato) (y2fn oilprice))}
+              [:circle {:r 5 :fill-opacity "0.5"}]
+              ]) data)])

 (defn diagram []
   [:svg {:xmlns "http://www.w3.org/2000/svg" :width svg-width :height svg-height}
@@ -148,10 +155,9 @@
     (axis/render-axis (:y c))
     (axis/render-axis (:y2 c))
     [:g (bars (mapv make-rect data))]
+    [:g (add-oil-price-line)]
     [:g (map make-txt end-of-year-data)]
-    [:g (add-oil-price-line)]
     detail
-
     (axis/render-axis (:x c))]
    [:g {:transform (core/translate 0 (+ (:height (meta header)) available-height))} footer]
    [:g {:transform (core/translate 0 (+ (:height (meta header)) available-height))} footer2]


Add Token function

Add Token function

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -12,6 +12,10 @@
      (QueryBuilder/bindMarker))
   ([name]
      (QueryBuilder/bindMarker name)))
+
+(defn token
+  [& column-names]
+  (QueryBuilder/token (into-array column-names)))

 (def select-command-order
   [QueryBuilder Select$Selection Select Select$Where])


Make basic where statements work

Make basic where statements work

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -6,23 +6,19 @@

-(defn where
-  [query-builder m]
-
-  )
-
 (defn from
   [table-name]
   [2 (fn from-query [builder]
-       (.from builder table-name))])
+       (.from builder table-name)
+       )])

 (defn all
   []
-  [1 (fn all-query [^Select$Selection query-builder] (.all query-builder))])
+  [1 (fn all-query [query-builder] (.all query-builder))])

 (defn column
   [column]
-  [1 (fn column-query [^Select$Selection query-builder]
+  [1 (fn column-query [query-builder]
        (.column query-builder column))])

 (defn columns
@@ -36,60 +32,77 @@
 ;; Clause eq(String name, Object value)
 (defn- ^Clause eq
   [^String column ^Object value]
-  (QueryBuilder/eq name value))
+  (QueryBuilder/eq column value))

 (defn- ^Clause in
   [^String column ^java.util.List values]
-  (QueryBuilder/in name values))
+  (QueryBuilder/in column values))

 (defn- ^Clause lt
   [^String column ^Object value]
-  (QueryBuilder/lt name value))
+  (QueryBuilder/lt column value))

 (defn- ^Clause gt
   [^String column ^Object value]
-  (QueryBuilder/gt name value))
+  (QueryBuilder/gt column value))

 (defn- ^Clause lte
   [^String column ^Object value]
-  (QueryBuilder/lte name value))
+  (QueryBuilder/lte column value))

 (defn- ^Clause gte
   [^String column ^Object value]
-  (QueryBuilder/gte name value))
+  (QueryBuilder/gte column value))
+
+(def ^:private query-type-map
+  {:in in
+   :=  eq
+   =   eq
+   :>  gt
+   >   gt
+   :>= gte
+   :<  lt
+   <   lt
+   :<= lte})

 (defprotocol WhereBuilder
   (build-where [construct query-builder]))

 (extend-protocol WhereBuilder
   clojure.lang.IPersistentVector
-  (build-where [construct query-builder]
+  (build-where [construct ^Select$Where query-builder]
     (reduce
-     (fn [])
-     query-builder)
+     (fn [^Select$Where builder [query-type column value]]
+       (.and builder ((query-type-map query-type) (name column) value)))
+     query-builder
+     construct)
     )
   clojure.lang.IPersistentMap
-  (build-where [construct query-builder]
-    ))
+  (build-where [construct ^Select$Where query-builder]
+    (reduce
+     (fn [^Select$Where builder [column value]]
+       (.and builder (eq (name column) value)))
+     query-builder
+     construct)))

 (defn where
   [m]
   [3 (fn where-query [query-builder]
-       ()
-       )]
-  )
+       (build-where m (.where query-builder)))])

 (defn select
   [table-name & statements]
-  (let [query-builder (QueryBuilder/select)]
-    (->> (conj statements (from table-name))
-         (sort-by first)
-         (map second)
-         (reduce (fn [builder statement]
-                   (statement builder))
-                 query-builder
-                 )
-         (.toString))))
+  (->> (conj statements (from (name table-name)))
+       (sort-by first)
+       ;; (map println)
+       (map second)
+       (reduce (fn [builder statement]
+                 (println builder statement)
+                 (statement builder))
+               (QueryBuilder/select)
+               )
+       (.toString)
+       ))


update/rollback init values #212

update/rollback init values
#212

--- src/cljs/swarmpit/component/service/create_config.cljs
+++ src/cljs/swarmpit/component/service/create_config.cljs
@@ -96,9 +96,11 @@
                                     :attempts  0}
                     :update        {:parallelism   1
                                     :delay         0
+                                    :order         "stop-first"
                                     :failureAction "pause"}
                     :rollback      {:parallelism   1
                                     :delay         0
+                                    :order         "stop-first"
                                     :failureAction "pause"}} deployment/form-value-cursor)
   (state/set-value {:reservation {:cpu    0.000
                                   :memory 0}


Cleaned up code a bit

Cleaned up code a bit

--- src/descent/pom_parser.clj
+++ src/descent/pom_parser.clj
@@ -1,42 +1,6 @@
 (ns descent.pom-parser
   (:use [clojure.xml :only (parse)])
   (:require [clojure.java.io :as io]))
-
-(defn load-pom [pom-location] (parse (java.io.File. pom-location)))
-
-(def pom (load-pom "resources/pom.xml"))
-
-
-;(:tag pom)
-;(:attrs pom)
-
-;; :content once takes us to the 1st level of data
-;(:content pom)
-
-;(def library (-> pom :content (nth 2) :content first))
-;(def version (-> pom :content (nth 5) :content first))
-
-(defn- get-library-name-from-pom
-  "Given a pom, extract the project name."
-  [pom]
-  (-> pom :content (nth 2) :content first))
-
-(defn- get-library-version-from-pom
-  "Given a pom, extract the project version."
-  [pom]
-  (-> pom :content (nth 5) :content first))
-
-;(get-properties-from-pom pom)
-
-;(def properties (get-properties-from-pom pom))
-;(first properties)
-
-
-
-;(contains-version? {:tag :apple.hh})
-;(contains-version? {:tag :rivulet.version})
-
-;(filter-out-properties-without-version properties)

 ;;;; Access the project dependencies through the following logic:
@@ -45,11 +9,28 @@
 ;;;;      if dependencyManagement is absent, just process dependencies instead
 ;;;;   3. extract version nmumbers from dependencies and if needed use the properties map

+
+;;; Load the pom.xml file and get basic info from it
+
+(defn load-pom [pom-location] (parse (java.io.File. pom-location)))
+
+
+(defn- get-library-name-from-pom
+  "Given a pom, extract the project name."
+  [pom]
+  (-> pom :content (nth 2) :content first))
+
+
+(defn- get-library-version-from-pom
+  "Given a pom, extract the project version."
+  [pom]
+  (-> pom :content (nth 5) :content first))
+
+
 ;;; Functions to check if certain pom sections exist

 (defn- tag-equals? [m tag] (= (:tag m) tag))

-;(get-in pom [:content])

 (defn- pom-has-properties?
   [pom]
@@ -107,7 +88,7 @@
       (subs 1)))

-(defn get-dependencies-from-properties
+(defn- get-dependencies-from-properties
   "Given the properties portion of a pom, return a seq of "
   [pom]
   (if (pom-has-properties? pom)
@@ -118,8 +99,6 @@
       (persistent! properties-map))
     nil))

-(get-dependencies-from-properties pom)
-

 ;;; Functions to process dependencyManagement

@@ -128,8 +107,6 @@
   [pom]
   (-> (filter #(tag-equals? % :dependencyManagement) (:content pom))
       first :content first :content))
-
-(get-deps-from-dependency-management pom)

 (defn- first-char-is-$? [s] (= "$" (subs s 0 1)))
@@ -145,14 +122,12 @@
           first
           keyword))))

-(parse-version-variable "${dep1.version}")

 (defn- parse-group-id
   [gid]
   (-> (clojure.string/split gid #"\.")
       last keyword))

-(parse-group-id "a.b.c")

 (defn- make-dependency-version-pair
   [m properties]
@@ -167,27 +142,7 @@
        version)]))

-(def x {:tag :dependency
-        :attrs nil
-        :content [{:tag :groupId
-                   :attrs nil
-                   :content ["com.company.dep1"]}
-
-                  {:tag :artifactId
-                   :attrs nil
-                   :content ["dep1-core"]}
-
-                  {:tag :version
-                   :attrs nil
-                   :content ["${dep1.version}"]}
-
-                  {:tag :type
-                   :attrs nil
-                   :content ["tar.gz"]}]})
-
-(make-dependency-version-pair x {:dep1 "1.0.0-SNAPSHOT"})
-
-(defn process-dependency-management
+(defn- process-dependency-management
   [pom]
   (if (pom-has-dependencyManagement? pom)
     (let [properties (get-dependencies-from-properties pom)
@@ -195,8 +150,6 @@
           deps-seq (map #(make-dependency-version-pair % properties) deps)]
       (into {} deps-seq))
     nil))
-
-(process-dependency-management pom)

 ;;; Functions to process dependencies
@@ -207,10 +160,8 @@
   (-> (filter #(tag-equals? % :dependencies) (:content pom))
       first :content))

-(get-deps-from-dependencies-section pom)

-
-(defn process-dependencies-section
+(defn- process-dependencies-section
   [pom]
   (if (pom-has-dependencies? pom)
     (let [properties (get-dependencies-from-properties pom)
@@ -219,22 +170,21 @@
       (into {} deps-seq))
     nil))

-(process-dependencies-section pom)
-

 ;;; Process entire pom

 (defn process-pom
   "Given a pom file, extract it's dependencies and versions and place in a hash-map."
-  [pom]
-  (let [project-name (get-library-name-from-pom pom)
+  [path-to-pom]
+  (let [pom (load-pom path-to-pom)
+        project-name (get-library-name-from-pom pom)
         version (get-library-version-from-pom pom)
         dep-management (process-dependency-management pom)
         deps (process-dependencies-section pom)
         dependencies (merge dep-management deps)]
     {:name project-name :version version :dependencies dependencies}))

-(process-pom pom)
+;(process-pom "resources/pom.xml")


Make date fields read-only

Make date fields read-only

--- src/cljs/elevent_client/components/date_selector.cljs
+++ src/cljs/elevent_client/components/date_selector.cljs
@@ -114,6 +114,7 @@
         :reagent-render
         (fn [input-attrs]
           [:input (assoc input-attrs
+                    :read-only true
                     :on-change #(reset! date-atom (-> %
                                                       .-target
                                                       .-value


Fix problem with object / multitype arrays

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -273,12 +273,12 @@
 (defn values
   ([m]
      [:values
-      (fn order-by-query [query-builder]
-        (.values query-builder (into-array (keys m)) (into-array (vals m))))])
+      (fn values-query [query-builder]
+        (.values query-builder (into-array (map name (keys m))) (object-array (vals m))))])
   ([key-seq value-seq]
      [:values
       (fn order-by-query [query-builder]
-        (.values query-builder (into-array key-seq) (object-array value-seq)))]))
+        (.values query-builder (into-array (map name key-seq)) (object-array value-seq)))]))

 (let [with-values {:timestamp #(QueryBuilder/timestamp %)
                    :ttl       #(QueryBuilder/ttl %)}]


Unbalanced parens in docstring

Unbalanced parens in docstring

--- src/main/clojure/clojure/test/check/clojure_test.cljc
+++ src/main/clojure/clojure/test/check/clojure_test.cljc
@@ -73,11 +73,11 @@
   `trial-report-dots`

   (Note that all reporting requires running `quick-check` within the scope of a
-  clojure.test run (via `test-ns`, `test-all-vars`, etc.)
+  clojure.test run (via `test-ns`, `test-all-vars`, etc.))

   Reporting functions offered by clojure.test.check include `trial-report-dots` and
   `trial-report-periodic` (which prints more verbose trial progress information
-  every `*trial-report-period*` milliseconds."
+  every `*trial-report-period*` milliseconds)."
   false)

 (def ^:dynamic *report-shrinking*


Improve "resolution" in golf histograms by making each x value its own bar

--- src/foreclojure/graphs.clj
+++ src/foreclojure/graphs.clj
@@ -34,7 +34,9 @@
         chart (chart/histogram chart-data
                                :title (str "League scores: problem " id)
                                :x-label "Solution length"
-                               :y-label "How often")]
+                               :y-label "How often"
+                               :nbins (- (apply max (keys freqs))
+                                         (apply min (keys freqs))))]
     (when best
       (chart/add-pointer chart best (freqs best 0)
                          :text "best"


fixed bar width

fixed bar width

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -210,23 +210,28 @@
       (apply dom/span nil
         (om/build-all track-view (:music-info data))))))

-(defn render-track-bar [data display-bar-id progress-bar-id progress-ball-id ball-position]
-  (dom/div nil
-    (let [height 10
-          top (/ height 2)
-          style #js {:height (str height "px")
-                     :top (str top "px")}]
-      (dom/div #js {:id display-bar-id
-                    :style style}))
-
-    (dom/div #js {:id progress-bar-id
-                  :className "track-bar"}
-      (let [percent-completed (ball-position)
-            style #js {:left (str percent-completed "%")}]
-          (dom/div #js {:id progress-ball-id
-                        :className "bar-tracker"
-                        :style style}
-            (dom/div #js {:className "track-ball-display"}))))))
+(defn render-track-bar [data root-id display-bar-id progress-bar-id progress-ball-id ball-position]
+  (let [height 10]
+    (dom/div nil
+      (let [top (/ height 2)
+            width (+ (.height (js/$ "#display-bar-id")))
+            display-style #js {:height (str height "px")
+                       :top (str top "px")}]
+        (dom/div #js {:id display-bar-id
+                      :style display-style}))
+
+      (let [root-width (.width (js/$ root-id))
+            bar-width (- root-width height)
+            bar-style #js {:width bar-width}]
+        (dom/div #js {:id progress-bar-id
+                      :className "track-bar"
+                      :style bar-style}
+          (let [percent-completed (ball-position)
+                style #js {:left (str percent-completed "%")}]
+              (dom/div #js {:id progress-ball-id
+                            :className "bar-tracker"
+                            :style style}
+                (dom/div #js {:className "track-ball-display"}))))))))

 (defn track-bar-did-mount [data owner ball-id containment start stop]
   (.addEventListener js/window "resize" #(om/refresh! owner))
@@ -240,7 +245,8 @@
   (reify
     om/IRender
     (render [this]
-      (render-track-bar data "progress-track-bar-display"
+      (render-track-bar data "#progress-track"
+                             "progress-track-bar-display"
                              "progress-track-bar"
                              "progress-track-ball"
                              #(if (nil? (:current-sound data))
@@ -283,4 +289,4 @@
                                       nil
                                       core/on-volume-drag-stop))))

-(om/root volume player/app-state {:target (. js/document (getElementById "volume"))})
+;(om/root volume player/app-state {:target (. js/document (getElementById "volume"))})


Streamline recursion for detect-cycles

Streamline recursion for detect-cycles

--- src/graphql_clj/validator/rules/no_fragment_cycles.clj
+++ src/graphql_clj/validator/rules/no_fragment_cycles.clj
@@ -5,19 +5,15 @@
             [clojure.string :as str]))

 (defn- fragment-cycle-error [{:keys [name]} spread-path]
-  (let [joined (when (> (count spread-path) 1)
-                 (str " via '" (str/join "," (rest spread-path)) "'"))]
+  (let [joined (when (> (count spread-path) 1) (str " via '" (str/join "," (rest spread-path)) "'"))]
     (format "Cannot spread fragment '%s' within itself%s." name joined)))

 (defn- accumulate-errors [s errors]
   (apply ve/update-errors s (map #(fragment-cycle-error % (:spread-path s)) errors)))

-(declare detect-cycles)
-
-(defn- recur-detect-cycles [s errors {:keys [spec]}]
-  (into errors (detect-cycles (get-in s [:spec-map spec]) s))) ;; TODO stackoverflow risk?
-
-(defn- get-spread-nodes [{:keys [selection-set]}]
+(defn- get-spread-nodes
+  "Recursively gather fragment spreads from the current selection-set, and any selection sets nested within fields"
+  [{:keys [selection-set]}]
   (let [spread-nodes (filter #(= :fragment-spread (:node-type %)) selection-set)
         fields (filter #(= :field (:node-type %)) selection-set)]
     (reduce #(into %1 (get-spread-nodes %2)) spread-nodes fields))) ;; TODO stackoverflow risk?
@@ -31,7 +27,7 @@
             s' (-> (update s :visited-frags conj name)
                    (update :spread-path conj name)
                    (accumulate-errors errors))]
-        (reduce (partial recur-detect-cycles s') (:errors s') non-errors)))))
+        (reduce #(into %1 (detect-cycles (get-in s' [:spec-map (:spec %2)]) s')) (:errors s') non-errors))))) ;; TODO stackoverflow risk?

 (defnodevisitor fragment-cycles :pre :fragment-definition [n s]
   (when-let [cycles (detect-cycles n (assoc s :visited-frags #{} :spread-path []))]


Add grafter DSL support for literal Booleans.

--- src/grafter/rdf/sesame.clj
+++ src/grafter/rdf/sesame.clj
@@ -4,7 +4,8 @@
   (:import [grafter.rdf.protocols IStatement Triple Quad])
   (:import [org.openrdf.model Statement Value Resource Literal URI BNode ValueFactory]
            [org.openrdf.model.impl CalendarLiteralImpl ValueFactoryImpl URIImpl
-            LiteralImpl IntegerLiteralImpl NumericLiteralImpl StatementImpl BNodeImpl ContextStatementImpl]
+            BooleanLiteralImpl LiteralImpl IntegerLiteralImpl NumericLiteralImpl
+            StatementImpl BNodeImpl ContextStatementImpl]
            [org.openrdf.repository Repository RepositoryConnection]
            [org.openrdf.repository.sail SailRepository]
            [org.openrdf.sail.memory MemoryStore]
@@ -27,6 +28,11 @@
   (->sesame-rdf-type [this]))

 (extend-protocol ISesameRDFConverter
+
+  java.lang.Boolean
+  (->sesame-rdf-type [this]
+    (BooleanLiteralImpl. this))
+
   java.lang.String
   ;; Assume URI's are the norm not strings
   (->sesame-rdf-type [this]


use keyword instead of symbol for vm inst name

--- src/kondolisp/compiler.clj
+++ src/kondolisp/compiler.clj
@@ -11,40 +11,40 @@
 (def *inst-width* 4)

 (def *vm-inst-list*
-     '[(VM_DUMMY nil)
+     '[(:VM_DUMMY nil)

        ;; basic stack and register operation
-       (VM_IVAL lispval)
-       (VM_IVAL_PUSH lispval)
-       (VM_VREF_PUSH lispval-symbol)
-       (VM_PUSH nil)
-       (VM_POP nil)
+       (:VM_IVAL lispval)
+       (:VM_IVAL_PUSH lispval)
+       (:VM_VREF_PUSH lispval-symbol)
+       (:VM_PUSH nil)
+       (:VM_POP nil)

        ;; control flow
-       (VM_JMP integer)
-       (VM_BIF integer)
-       (VM_BIFN integer)
-       (VM_PUSH_FRAME nil)
-       (VM_FUNCALL lispval)
+       (:VM_JMP integer)
+       (:VM_BIF integer)
+       (:VM_BIFN integer)
+       (:VM_PUSH_FRAME nil)
+       (:VM_FUNCALL lispval)

        ;; lisp namespace operation
-       (VM_BIND lispval-symbol)	;; bind stack-top value to symbol(operand)
-       (VM_UNBIND integer) ;; unbind symbol(operand)
-       (VM_VREF lispval-symbol)	  ;; refer value of symbol(operand)
-       (VM_VSET lispval-symbol)	  ;; overwrite symbol(operand) by %val
+       (:VM_BIND lispval-symbol)	;; bind stack-top value to symbol(operand)
+       (:VM_UNBIND integer) ;; unbind symbol(operand)
+       (:VM_VREF lispval-symbol)	  ;; refer value of symbol(operand)
+       (:VM_VSET lispval-symbol)	  ;; overwrite symbol(operand) by %val

        ;; basic arithmetic operation
-       (VM_LT nil)
-       (VM_GT nil)
-       (VM_LE nil)
-       (VM_GE nil)
-       (VM_EQ nil)
-       (VM_PLUS nil)
-       (VM_MINUS nil)
+       (:VM_LT nil)
+       (:VM_GT nil)
+       (:VM_LE nil)
+       (:VM_GE nil)
+       (:VM_EQ nil)
+       (:VM_PLUS nil)
+       (:VM_MINUS nil)

        ;; lisp data operation
-       (VM_CONS nil)	      ;; (cons <stack-top> <%val>)
-       (VM_IVAL_CONS lispval) ;; (cons <stack-top> <immval>)
+       (:VM_CONS nil)	      ;; (cons <stack-top> <%val>)
+       (:VM_IVAL_CONS lispval) ;; (cons <stack-top> <immval>)
        ])

 (def *vm-builtin-funs*
@@ -86,15 +86,9 @@
 	(recur (+ idx 1) pred (rest coll)))))
   (inner-index 0 pred coll))

-(defn unqualify-symbol [sym]
-  (let [sym-ns (namespace sym)]
-    (if sym-ns
-      (symbol (subs (str sym) (+ 1 (count sym-ns))))
-      sym)))
-
 (defn #^{:doc "Encode a VM instruction to bytes"}
   encode-inst [inst]
-  (let [inst-name (unqualify-symbol (first inst)),
+  (let [inst-name (first inst),
 	inst-operand (or (second inst) 0),
 	inst-spec (some (fn [inst-spec] (= inst-name (first inst-spec)))
 			*vm-inst-list*)]
@@ -190,7 +184,7 @@
 (defn pp-program [insts]
   (dotimes [i (count insts)]
     (let [inst (nth insts i),
-	  inst-name (unqualify-symbol (first inst))
+	  inst-name (first inst)
 	  inst-spec (some (fn [spec] (and (= inst-name (first spec)) spec))
 			  *vm-inst-list*)
 	  inst-operand (second inst)
@@ -211,38 +205,38 @@
    (or (and (coll? exp)
 	    (empty? exp))
        (= 'nil exp))
-   `((VM_IVAL ~(make-nil)))
-   ;;
-   (or (= 't exp) (= 'T exp))		`((VM_IVAL ~(make-t)))
-   (symbol? exp)			`((VM_IVAL ~(make-sym exp)))
-   (number? exp)			`((VM_IVAL ~(make-num exp)))
+   `((:VM_IVAL ~(make-nil)))
+   ;;
+   (or (= 't exp) (= 'T exp))		`((:VM_IVAL ~(make-t)))
+   (symbol? exp)			`((:VM_IVAL ~(make-sym exp)))
+   (number? exp)			`((:VM_IVAL ~(make-num exp)))
    (coll? exp)				`(~@(compile-quote (first exp))
-					  (VM_PUSH)
+					  (:VM_PUSH)
 					  ~@(compile-quote (rest exp))
-					  (VM_CONS))
+					  (:VM_CONS))
    ))

 (defn compile-let [bindings body]
   `(~@(apply concat
        (map (fn [binding]
 	      `(~@(compile-pass1 (second binding))
-		(VM_BIND ~(make-sym (first binding)))))
+		(:VM_BIND ~(make-sym (first binding)))))
 	    bindings))
     ~@(apply concat
 	     (map compile-pass1 body))
-    (VM_UNBIND ~(count bindings))))
+    (:VM_UNBIND ~(count bindings))))

 (defn builtin-fun-id [fname]
   (index (fn [pair] (= (first pair) fname))
 	 *vm-builtin-funs*))

 (defn compile-funcall [fname args]
-  `((VM_PUSH_FRAME)
+  `((:VM_PUSH_FRAME)
     ~@(apply concat
        (map (fn [arg] (concat (compile-pass1 arg)
-			      `((VM_PUSH))))
+			      `((:VM_PUSH))))
 	    (reverse args)))
-    (VM_FUNCALL ~(if (some (fn [fun-spec] (= (first fun-spec) fname))
+    (:VM_FUNCALL ~(if (some (fn [fun-spec] (= (first fun-spec) fname))
 			   *vm-builtin-funs*)
 		   (make-num (builtin-fun-id fname))
 		   (make-sym fname)))))
@@ -251,37 +245,37 @@
   (cond
    (or (nil? exp)
        (and (coll? exp) (empty? exp)))
-   `((VM_IVAL ~(make-nil)))
+   `((:VM_IVAL ~(make-nil)))
    ;;
    (or (= 't exp) (= 't exp))
-   `((VM_IVAL ~(make-t)))
+   `((:VM_IVAL ~(make-t)))
    ;;
    (symbol? exp)
-   `((VM_VREF ~(make-sym exp)))
+   `((:VM_VREF ~(make-sym exp)))
    ;;
    (number? exp)
-   `((VM_IVAL ~(make-num exp)))
+   `((:VM_IVAL ~(make-num exp)))
    ;;
    (coll? exp)
    (match exp
 	  ('quote x)	(compile-quote x)
 	  ;;
 	  ('progn & body)	(if (empty? body)
-			    `((VM_IVAL ~(make-nil)))
+			    `((:VM_IVAL ~(make-nil)))
 			    (apply concat (map compile-pass1 body)))
 	  ;;
 	  ('let bindings & body)	(compile-let bindings body)
 	  ;;
 	  ('setq sym val)	`(~@(compile-pass1 val)
-				  (VM_VSET ~(make-sym sym)))
+				  (:VM_VSET ~(make-sym sym)))
 	  ;;
 	  ('if pred then-body else-body)
 	  (let [end-label (gensym),
 		else-label (gensym)]
 	    `(~@(compile-pass1 pred)
-	       (VM_BIFN ~else-label)
+	       (:VM_BIFN ~else-label)
 	       ~@(compile-pass1 then-body)
-	       (VM_JMP ~end-label)
+	       (:VM_JMP ~end-label)
 	       ~else-label
 	       ~@(compile-pass1 else-body)
 	       ~end-label))
@@ -290,31 +284,31 @@
 				      end-label (gensym)]
 				  `(~retry-label
 				    ~@(compile-pass1 pred)
-				    (VM_BIFN ~end-label)
+				    (:VM_BIFN ~end-label)
 				    ~@(apply concat (map compile-pass1 body))
-				    (VM_JMP ~retry-label)
+				    (:VM_JMP ~retry-label)
 				    ~end-label))
 	  ;;
 	  ('dotimes (var num) & body)
 	  (let [end-label (gensym),
 		retry-label (gensym)]
-	    `((VM_IVAL ~(make-num 0))
-	      (VM_BIND ~(make-sym var))
+	    `((:VM_IVAL ~(make-num 0))
+	      (:VM_BIND ~(make-sym var))
 	      ~retry-label
 	      ~@(apply concat (map compile-pass1 body))
-	      (VM_VREF ~(make-sym var))
-	      (VM_PUSH)
-	      (VM_IVAL ~(make-num 1))
-	      (VM_PLUS)
-	      (VM_VSET ~(make-sym var))
-	      (VM_VREF ~(make-sym var))
-	      (VM_PUSH)
-	      (VM_IVAL ~(make-num num))
-	      (VM_LE)
-	      (VM_BIF ~end-label)
-	      (VM_JMP ~retry-label)
+	      (:VM_VREF ~(make-sym var))
+	      (:VM_PUSH)
+	      (:VM_IVAL ~(make-num 1))
+	      (:VM_PLUS)
+	      (:VM_VSET ~(make-sym var))
+	      (:VM_VREF ~(make-sym var))
+	      (:VM_PUSH)
+	      (:VM_IVAL ~(make-num num))
+	      (:VM_LE)
+	      (:VM_BIF ~end-label)
+	      (:VM_JMP ~retry-label)
 	      ~end-label
-	      (VM_UNBIND 1)))
+	      (:VM_UNBIND 1)))
 	  ;;
 	  _	(compile-funcall (first exp) (rest exp)))
    ;;


Newlines are cool.

Newlines are cool.

--- src/leiningen/protobuf.clj
+++ src/leiningen/protobuf.clj
@@ -38,7 +38,8 @@
     (when-not (empty? files)
       (let [proto (peek files)
             files (pop files)]
-        (if (or (.exists (io/file "proto" proto)) (.exists (io/file "build/proto" proto)))
+        (if (or (.exists (io/file "proto" proto))
+                (.exists (io/file "build/proto" proto)))
           (recur files)
           (let [location (str "proto/" proto)
                 proto-file (io/file "build" location)]
@@ -69,7 +70,7 @@
   (flush)
   (join (.readPassword (System/console))))

-(defn fetch [project]
+(defn fetch []
   (when-not (.exists (io/file srcdir))
     (with-open [stream (.openStream url)]
       (io/copy stream (io/file zipfile)))
@@ -77,7 +78,7 @@

 (defn uninstall
   "Remove protoc if it is installed."
-  [project]
+  []
   (when (installed?)
     (let [password (read-pass)]
       (sh "sudo" "-S" "make" "uninstall"
@@ -85,9 +86,9 @@

 (defn install
   "Compile and install protoc to /usr/local."
-  [project]
+  []
   (when-not (installed?)
-    (fetch nil)
+    (fetch)
     (when-not (.exists (io/file srcdir "src" "protoc"))
       (.setExecutable (io/file srcdir "configure") true)
       (.setExecutable (io/file srcdir "install-sh") true)
@@ -128,7 +129,7 @@
      (protoc project files)))

 (defn google
-  [project]
+  []
   (let [proto-files (io/file "proto/google/protobuf")]
     (.mkdirs proto-files)
     (io/copy
@@ -146,8 +147,8 @@
   ([project] (println (help-for "protobuf")))
   ([project subtask & args]
      (case subtask
-       "proto"     (apply google project args)
-       "fetch"     (apply fetch project args)
-       "install"   (apply install project args)
-       "uninstall" (apply uninstall project args)
-       "compile"   (apply compile project args))))+       "proto"     (apply google args)
+       "fetch"     (apply fetch args)
+       "install"   (apply install args)
+       "uninstall" (apply uninstall args)
+       "compile"   (apply compile args))))


trim selector, validate and error to user if invalid selector

--- src/link_checker/check.clj
+++ src/link_checker/check.clj
@@ -56,7 +56,6 @@

 (defn- body->links
   [string options]
-  (prn options)
   (-> string
       (java.io.StringReader.)
       enlive/html-resource
@@ -90,23 +89,30 @@
             distinct
             (remove invalid-link?))))))

+(defn- valid-selector?
+  [selector]
+  (re-find #"^[\.#a-zA-Z0-9_-]+$" selector))
+
 (defn- stream-links*
   "Sends 3 different sse events (message, results, end-message) depending on
 what part of the page it's updating."
   [send-event-fn sse-context url options]
-  (let [send-to (partial send-event-fn sse-context)]
-    (if-let [links (url->links url options)]
-      (do
-        (send-to "message"
-                 (format "%s has %s links. Fetching data... "
-                         url (count links)))
-        (let [start-time (System/currentTimeMillis)
-              link-results (doall (pmap (partial fetch-link-and-send-row send-to url) links))]
-          (send-final-message send-to (calc-time start-time) link-results))
-        (send-to "end-message" (str "result?url=" url
-                                    (if (seq (:selector options))
-                                      (str "&selector=" (:selector options)) ""))))
-      (send-to "error" "Unable to fetch the given url."))))
+  (let [send-to (partial send-event-fn sse-context)
+        selector (clojure.string/trim (:selector options))]
+    (if (and (seq selector) (not (valid-selector? selector)))
+      (send-to "error" "Selector is invalid. Try again.")
+      (if-let [links (url->links url (assoc options :selector selector))]
+       (do
+         (send-to "message"
+                  (format "%s has %s links. Fetching data... "
+                          url (count links)))
+         (let [start-time (System/currentTimeMillis)
+               link-results (doall (pmap (partial fetch-link-and-send-row send-to url) links))]
+           (send-final-message send-to (calc-time start-time) link-results))
+         (send-to "end-message" (str "result?url=" url
+                                     (if (seq (:selector options))
+                                       (str "&selector=" (:selector options)) ""))))
+       (send-to "error" "Unable to fetch the given url.")))))

 (defn stream-links
   "Streams a url's verified links with a given fn and sse-context."
@@ -115,7 +121,7 @@
     (try
       (stream-links* send-event-fn sse-context url options)
       {:status 200}
-      #_(catch Exception exception
+      (catch Exception exception
         (log/error :msg (str "Unexpected error: " exception))
         (send-event-fn sse-context "error" "An unexpected error occurred. :(")))
     (log/error :msg "No url given to verify links. Ignored.")))


Set mda-piano ugen's sustain default to 0 to match SuperCollider

--- src/overtone/sc/machinery/ugen/metadata/extras/mda.clj
+++ src/overtone/sc/machinery/ugen/metadata/extras/mda.clj
@@ -66,7 +66,7 @@
                   higher)."}

            {:name "sustain"
-            :default 0.1
+            :default 0
             :doc "If positive, act as if the piano's sustain pedal is
                   pressed."}]
     :rates #{:ar}


Make response decoding clearer

Make response decoding clearer

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- testdata/example02/client/cljs/src/example02/core.cljs
+++ testdata/example02/client/cljs/src/example02/core.cljs
@@ -29,7 +29,9 @@
               :args (app.Entity. #js {:id id})
               :cb (fn [resp]
                     (if (= (->> resp :result :status) "OK")
-                      (println "Success: Balance =" (->> resp :result :message app.BalanceResult.decode64 .-balance))
+                      (let [result (->> resp :result :message app.BalanceResult.decode64)]
+                        (println "Success: Balance =" (.-balance result)))
+                      ;; else
                       (println "Failure:" resp)))}))

 (defn run [{:keys [host port] :as options}]


CMR-1980: Cleanup blank lines

CMR-1980: Cleanup blank lines

--- search-app/test/cmr/search/test/api/keyword.clj
+++ search-app/test/cmr/search/test/api/keyword.clj
@@ -3,8 +3,6 @@
   (:require [clojure.test :refer :all]
             [cmr.search.api.keyword :as k]
             [cmr.common.util :as util]))
-
-

 (deftest parse-hierarchical-keywords
   (util/are2


Reformat docstrings

Reformat docstrings

--- src/overtone/sc/buffer.clj
+++ src/overtone/sc/buffer.clj
@@ -11,16 +11,18 @@
 (defrecord BufferInfo [id size n-channels rate n-samples rate-scale duration])

 (defn buffer-info
-  "Fetch the information for buffer associated with buf-id (either an integer or
-  an associative with an :id key). Synchronous.
+  "Fetch the information for buffer associated with buf-id (either an
+  integer or an associative with an :id key). Synchronous.

   Information returned is as follows:

   :size       - number of frames in the buffer
   :n-channels - number of audio channels stored in the buffer
-  :rate       - rate of the buffer (typical rate is 44100 samples per second)
+  :rate       - rate of the buffer (typical rate is 44100 samples per
+                second)
   :n-samples  - total number of samples in the buffer (* size n-channels)
-  :rate-scale - rate to specify in order to play the buffer correctly according
+  :rate-scale - rate to specify in order to play the buffer correctly
+                according
                 to the server's sample rate (/ rate (server-sample-rate))
   :duration   - duration of the buffer in seconds
   :id         - unique id for the buffer"
@@ -49,8 +51,8 @@
 (defrecord Buffer [id size n-channels rate allocated-on-server])

 (defn buffer
-  "Synchronously allocate a new zero filled buffer for storing audio data with
-  the specified size and num-channels."
+  "Synchronously allocate a new zero filled buffer for storing audio
+  data with the specified size and num-channels."
   ([size] (buffer size 1))
   ([size num-channels]
      (let [id   (with-server-self-sync
@@ -69,11 +71,12 @@
 (defrecord BufferFile [id size n-channels rate allocated-on-server path])

 (defn buffer-alloc-read
-  "Synchronously allocates a buffer with the same number of channels as the
-  audio file given by 'path'. Reads the number of samples requested ('n-frames')
-  into the buffer, or fewer if the file is smaller than requested. Reads sound
-  file data from the given starting frame ('start') in the file. If 'n-frames'
-  is less than or equal to zero, the entire file is read."
+  "Synchronously allocates a buffer with the same number of channels as
+  the audio file given by 'path'. Reads the number of samples
+  requested ('n-frames') into the buffer, or fewer if the file is
+  smaller than requested. Reads sound file data from the given starting
+  frame ('start') in the file. If 'n-frames' is less than or equal to
+  zero, the entire file is read."
   ([path]
      (buffer-alloc-read path 0 -1))
   ([path start]
@@ -132,11 +135,12 @@
     buf))

 (defn buffer-read
-  "Read a section of an audio buffer. Defaults to reading the full buffer if no
-  start and len vals are specified. Returns a float array of vals.
-
-  This is extremely slow for large portions of data. For more efficient reading
-  of buffer data with the internal server, see buffer-data."
+  "Read a section of an audio buffer. Defaults to reading the full
+  buffer if no start and len vals are specified. Returns a float array
+  of vals.
+
+  This is extremely slow for large portions of data. For more efficient
+  reading of buffer data with the internal server, see buffer-data."
   ([buf] (buffer-read buf 0 (:size buf)))
   ([buf start len]
      (assert (buffer? buf))
@@ -164,10 +168,11 @@
            samples)))))

 (defn buffer-write!
-  "Write into a section of an audio buffer which modifies the buffer in place on
-  the server. Data can either be a single number or a collection of numbers.
-  Accepts an optional param start-idx which specifies an initial offset into the
-  buffer from which to start writing the data (defaults to 0)."
+  "Write into a section of an audio buffer which modifies the buffer in
+  place on the server. Data can either be a single number or a
+  collection of numbers.  Accepts an optional param start-idx which
+  specifies an initial offset into the buffer from which to start
+  writing the data (defaults to 0)."
   ([buf data] (buffer-write! buf 0 data))
   ([buf start-idx data]
      (assert (buffer? buf))
@@ -181,9 +186,9 @@
          (apply snd "/b_setn" (:id buf) start-idx size doubles)))))

 (defn buffer-fill!
-  "Fill a buffer range with a single value. Modifies the buffer in place on the
-  server. Defaults to filling in the full buffer unless start and len vals are
-  specified. Asynchronous."
+  "Fill a buffer range with a single value. Modifies the buffer in place
+  on the server. Defaults to filling in the full buffer unless start and
+  len vals are specified. Asynchronous."
   ([buf val]
      (assert (buffer? buf))
      (buffer-fill! buf 0 (:size buf) val))
@@ -192,8 +197,8 @@
      (snd "/b_fill" (:id buf) start len (double val))))

 (defn buffer-set!
-  "Write a single value into a buffer. Modifies the buffer in place on the
-  server. Index defaults to 0 if not specified."
+  "Write a single value into a buffer. Modifies the buffer in place on
+  the server. Index defaults to 0 if not specified."
   ([buf val] (buffer-set! buf 0 val))
   ([buf index val]
      (assert (buffer? buf))
@@ -250,9 +255,10 @@
 (defrecord BufferOutStream [id size n-channels header samples rate allocated-on-server path open?])

 (defn buffer-stream
-  "Returns a buffer-stream which is similar to a regular buffer but may be used
-  with the disk-out ugen to stream to a specific file on disk.
-  Use #'buffer-stream-close to close the stream to finish recording to disk.
+  "Returns a buffer-stream which is similar to a regular buffer but may
+  be used with the disk-out ugen to stream to a specific file on disk.
+  Use #'buffer-stream-close to close the stream to finish recording to
+  disk.

   Options:

@@ -296,8 +302,8 @@
   (isa? (type bs) ::buffer-out-stream))

 (defn buffer-stream-close
-  "Close a buffer stream created with #'buffer-stream. Also frees the internal
-  buffer. Returns the path of the newly created file."
+  "Close a buffer stream created with #'buffer-stream. Also frees the
+  internal buffer. Returns the path of the newly created file."
   [buf-stream]
   (assert (file-buffer? buf-stream))
   (when-not @(:open? buf-stream)
@@ -311,8 +317,8 @@
 (defrecord BufferInStream [id size n-channels rate allocated-on-server path open?])

 (defn buffer-cue
-  "Returns a buffer-cue which is similar to a regular buffer but may be used
-  with the disk-in ugen to stream from a specific file on disk.
+  "Returns a buffer-cue which is similar to a regular buffer but may be
+  used with the disk-in ugen to stream from a specific file on disk.
   Use #'buffer-cue-close to close the stream when finished.

   Options:
@@ -392,9 +398,9 @@

 (defn create-buffer-data
   "Create a sequence of floats for use as a buffer.  Result will contain
-   values obtained by calling f with values linearly interpolated between
-   range-min (inclusive) and range-max (exclusive).  For most purposes size
-   must be a power of 2.
+   values obtained by calling f with values linearly interpolated
+   between range-min (inclusive) and range-max (exclusive).  For most
+   purposes size must be a power of 2.

    Examples:

@@ -421,8 +427,9 @@

 (defmulti write-wav
   "Write data as a wav file. Accepts either a buffer or a sequence of values.
-  When passing a sequence, you also need to specify the frame-rate and n-channels.
-  For both, you need to pass the path of the new file as the 2nd arg.
+  When passing a sequence, you also need to specify the frame-rate and
+  n-channels.  For both, you need to pass the path of the new file as
+  the 2nd arg.

   Required args:
   buffer [data path]


pass 'args' parameter on to 'load-samples'

--- src/overtone/sc/sample.clj
+++ src/overtone/sc/sample.clj
@@ -116,7 +116,7 @@

   "
   [path & args]
-  (let [s          (load-sample path)
+  (let [s          (load-sample path args)
         player     (fn [& pargs]
                      (let [id (:id (get @loaded-samples* [path args]))]
                        (if (empty? pargs)


Clearer stats comment in repful stuff

Clearer stats comment in repful stuff

--- src/polismath/clusters.clj
+++ src/polismath/clusters.clj
@@ -413,7 +413,7 @@
         ; Inner reduce folds data into result for each group in comment stats
         (reduce
           (fn [inner-result [gid comment-conv-stats]]
-            ; Heplper functions for building our result
+            ; Heplper functions for building our result; ir = inner-result
             (letfn [(ir-get   [ir & ks]
                       (get-in ir (into [gid] ks)))
                     (ir-assoc [ir & ks-and-val]


CMR-5065 Converts property based tests from defspec for-all to checking.

--- umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
@@ -3,8 +3,10 @@
   (:require
    [clojure.java.io :as io]
    [clojure.test :refer :all]
+   [clojure.test.check.generators :as gen]
    [clojure.test.check.properties :refer [for-all]]
    [cmr.common.date-time-parser :as dtp]
+   [cmr.common.test.test-check-ext :as ext :refer [checking checking-with-seed]]
    [cmr.common.test.test-check-ext :refer [defspec]]
    [cmr.spatial.line-string :as l]
    [cmr.spatial.mbr :as mbr]
@@ -26,14 +28,16 @@
       (dissoc :orbit-calculated-spatial-domains)
       umm-lib-g/map->UmmGranule))

-(defspec generate-granule-is-valid-umm-g-test 100
-  (for-all [granule generators/umm-g-granules]
+(deftest generate-granule-is-valid-umm-g-test
+  (checking "umm-g validate metadata" 100
+    [granule (gen/no-shrink generators/umm-g-granules)]
     (let [granule (sanitizer/sanitize-granule granule)
           metadata (core/generate-metadata {} granule :umm-json)]
       (empty? (core/validate-metadata :granule :umm-json metadata)))))

-(defspec generate-and-parse-umm-g-granule-test 100
-  (for-all [granule generators/umm-g-granules]
+(deftest generate-and-parse-umm-g-granule-test
+  (checking "umm-g round tripping" 100
+    [granule (gen/no-shrink generators/umm-g-granules)]
     (let [granule (sanitizer/sanitize-granule granule)
           umm-g-metadata (core/generate-metadata {} granule :umm-json)
           parsed (core/parse-metadata {} :granule :umm-json umm-g-metadata)


don't use document.hostname in chrome exts

--- src/main/shadow/build/targets/chrome_extension.clj
+++ src/main/shadow/build/targets/chrome_extension.clj
@@ -50,9 +50,15 @@
               (assoc :background {:entries [background] :depends-on #{:shared}})

               content-script
-              (assoc :content-script {:entries [content-script] :depends-on #{:shared}})))]
+              (assoc :content-script {:entries [content-script] :depends-on #{:shared}})))
+
+        config
+        (update config :devtools merge
+          {:use-document-host false
+           :autoload true})]

     (-> state
+        (assoc ::b/config config)
         (build-api/merge-build-options
           {:output-dir output-dir
            :asset-path "out"})
@@ -143,7 +149,7 @@
           :key-fn (fn [key]
                     (-> key name (str/replace #"-" "_"))))))

-    #_ (pprint manifest)
+    #_(pprint manifest)

     state))


add properties to event

add properties to event

--- src-cljs/frontend/components/pieces/page_header.cljs
+++ src-cljs/frontend/components/pieces/page_header.cljs
@@ -256,7 +256,11 @@
                                    :kind :primary
                                    :size :small
                                    :href "mailto:beta+ui@circleci.com?Subject=Topbar%20UI%20Feedback"
-                                   :on-click #((om/get-shared owner :track-event) {:event-type :feedback-clicked})}
+                                   :on-click #((om/get-shared owner :track-event) {:event-type :feedback-clicked
+                                                                                :properties (:component "topbar"
+                                                                                :treatment "top-bar-beta")})}
+
+
                                   "Provide Feedback")])
                  (button/link {:fixed? true
                                :kind (if has-topbar?


Fix :db/id not being queried for a view in the screen app example

--- src/examples/workflo/macros/examples/screen_app.cljs
+++ src/examples/workflo/macros/examples/screen_app.cljs
@@ -123,7 +123,7 @@
    (dom/h2 nil (str "User " id ": " name))))

 (defview UserTitle
-  (query [({user [user [name]]} {db/id ?user-id})])
+  (query [({user [db [id] user [name]]} {db/id ?user-id})])
   (render
    (user-title-view user)))


updated the tests for the org settings componenets

--- test-cljs/frontend/components/test_org_settings.cljs
+++ test-cljs/frontend/components/test_org_settings.cljs
@@ -79,11 +79,11 @@
              (overview (example-plan :trial) "circleci"))
       (is-re #"All Linux builds will be distributed across 7 containers."
              (overview (example-plan :free :trial) "circleci"))
-      (is-re #"All Linux builds will be distributed across 6 containers."
+      (is-re #"All Linux builds will be distributed across 10 containers."
              (overview (example-plan :trial :paid) "circleci"))
       (is-re #"All Linux builds will be distributed across 5 containers."
              (overview (example-plan :free :paid) "circleci"))
-      (is-re #"All Linux builds will be distributed across 7 containers."
+      (is-re #"All Linux builds will be distributed across 11 containers."
              (overview (example-plan :free :paid :trial) "circleci")))
     (testing "trials are described appropriately"
       (is-re #"5 more days" (overview (example-plan :trial) "circleci")))
@@ -93,11 +93,11 @@
     (testing "it shows the right amounts for trial and paid, and minds their interactions."
       ;; Trials are currently upper bounds on plans...
       (let [text (overview (example-plan :trial :paid) "circleci")]
-        (is-re #"2 of these are provided by a trial" text)
+        (is-re #"6 of these are provided by a trial" text)
         (is-re #"4 of these are paid." text))
       ;; so we shouldn't describe one if the paid plan is bigger then it.
       (let [text (overview (example-plan :trial :big-paid) "circleci")]
-        (is (not (re-find #"provided by a trial" text)))
+        (is (re-find #"provided by a trial" text))
         (is-re #"60 of these are paid." text)))
     (testing "it tells you if you're grandfathered"
       (is-re #"grandfathered" (overview (example-plan :grandfathered) "circleci")))))


Fix exception handling in acquisition engine. Only one place where exceptions are caught and shown; a few places where they are explicitly throw by acq eng.

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10603 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -78,6 +78,9 @@
 (def active-slice-sequence (atom nil))

 (def pixel-type-depths {"GRAY8" 1 "GRAY16" 2 "RGB32" 4 "RGB64" 8})
+
+(defn throw-exception [msg]
+  (throw (Exception. msg)))

 ;; time

@@ -185,7 +188,7 @@
         (when false
           (do (log "reload and try a third time")
           (successful? (reload-device ~device) (attempt#))))) ; third attempt after reloading
-      (throw (Exception. (str "Device failure: " ~device)))
+      (throw-exception (str "Device failure: " ~device))
       (swap! state assoc :stop true)
       nil)))

@@ -315,17 +318,6 @@
 (defn first-trigger-missing? []
   (= "1" (get-property-value (core getCameraDevice) "OutputTriggerFirstMissing")))

-(defn keep-collecting-from-circular-buffer?
-  "Returns true if there is no reason to stop popping images
-   from the circular buffer."
-  []
-  (when (. mmc isBufferOverflowed)
-    (swap! state assoc :circular-buffer-overflow true))
-  (and (not (@state :stop))
-       (or (pos? (. mmc getRemainingImageCount))
-           (and (. mmc isSequenceRunning)
-                (not (@state :circular-buffer-overflow))))))
-
 (defn init-burst [length trigger-sequence relative-z]
   (core setAutoShutter (@state :init-auto-shutter))
   (load-property-sequences (:properties trigger-sequence))
@@ -339,26 +331,22 @@

 (defn pop-tagged-image []
   (try (core popNextTaggedImage)
-       (catch Exception e nil))) ;(println e))))
+       (catch Exception e nil)))

 (defn pop-tagged-image-timeout
   [timeout-ms]
   (let [start-time (System/currentTimeMillis)]
     (loop []
-      (when (keep-collecting-from-circular-buffer?)
-        (if-let [image (pop-tagged-image)]
-          image
-          (if (< timeout-ms (- (System/currentTimeMillis) start-time))
-            (do (println "Timed out waiting for image to arrive from camera.")
-                (throw (Exception. "Timed out waiting for image to arrive from camera.")))
-            (do (Thread/sleep 1)
-                (recur))))))))
+      (if-let [image (pop-tagged-image)]
+        image
+        (if (< timeout-ms (- (System/currentTimeMillis) start-time))
+          (throw-exception "Timed out waiting for image\nto arrive from camera.")
+          (do (Thread/sleep 1)
+              (recur)))))))

 (defn pop-burst-image
   [timeout-ms]
   (let [tagged-image (pop-tagged-image-timeout timeout-ms)]
-    ;(println "pop")
-        ;(println tagged-image)
     {:pix (.pix tagged-image)
      :tags (json-to-data (.tags tagged-image))}))

@@ -381,8 +369,8 @@
    burst-events))

 (defn burst-cleanup []
- (when (@state :circular-buffer-overflow)
-   (ReportingUtils/showError "Circular buffer overflowed."))
+ (when (core isBufferOverflowed)
+   (throw-exception "Circular buffer overflowed."))
  (while (and (not (@state :stop)) (. mmc isSequenceRunning))
    (Thread/sleep 5)))

@@ -412,31 +400,17 @@
         time-stamp (burst-time (:tags image) @state)]
     (annotate-image image event @state time-stamp)))

-(defmacro doseq-parallel [seq-exprs & body]
-  `(let [pool# (-> (Runtime/getRuntime) .availableProcessors Executors/newFixedThreadPool)]
-     (println (.getCorePoolSize pool#))
-     (doseq ~seq-exprs
-       (let [body-fn# (cast Runnable (fn []
-                                       ;(println (str (Thread/currentThread)))
-                                       ~@body))]
-         (.submit pool# body-fn#)))
-     (.shutdown pool#)
-     (.awaitTermination pool# 10 TimeUnit/DAYS)))
-
 (defn produce-burst-images
   "Pops images from circular buffer and sends them to output queue."
   [burst-events camera-channel-names timeout-ms out-queue]
   (let [total (* (count burst-events)
                  (count camera-channel-names))
-        camera-index-tag (str (. mmc getCameraDevice) "-CameraChannelIndex")
-        images (map (fn [_] (pop-burst-image timeout-ms)) (range total))]
-    (time
-    (doseq [image images]
+        camera-index-tag (str (. mmc getCameraDevice) "-CameraChannelIndex")]
+    (doseq [_ (range total)]
       (.put out-queue
-            (-> image
-                ;(time)
+            (-> (pop-burst-image timeout-ms)
                 (tag-burst-image burst-events camera-channel-names camera-index-tag)
-                make-TaggedImage)))))
+                make-TaggedImage))))
   (burst-cleanup))

 (defn collect-burst-images [event out-queue]
@@ -570,44 +544,43 @@

 ;; startup and shutdown

-(defn prepare-state [this]
+(defn prepare-state [state]
   (let [default-z-drive (core getFocusDevice)
         default-xy-stage (core getXYStageDevice)
         z (get-z-stage-position default-z-drive)
         xy (get-xy-stage-position default-xy-stage)
         exposure (core getExposure)]
-    (swap! (.state this) assoc
-             :pause false
-             :stop false
-             :finished false
-             :last-wake-time (jvm-time-ms)
-             :last-stage-positions (into {} [[default-z-drive z]
-                                             [default-xy-stage xy]])
-             :reference-z z
-             :start-time (jvm-time-ms)
-             :init-auto-shutter (core getAutoShutter)
-             :init-exposure exposure
-             :init-shutter-state (core getShutterOpen)
-             :exposure {(core getCameraDevice) exposure}
-             :default-z-drive default-z-drive
-             :default-xy-stage default-xy-stage
-             :init-z-position z
-             :init-system-state (get-system-config-cached)
-             :init-continuous-focus (core isContinuousFocusEnabled)
-             :init-width (core getImageWidth)
-             :init-height (core getImageHeight)
-             :binning (core getProperty (core getCameraDevice) "Binning")
-             :bit-depth (core getImageBitDepth)
-             :pixel-size-um (core getPixelSizeUm)
-             :source (core getCameraDevice)
-             :pixel-type (get-pixel-type)
-      )))
+    (swap! state assoc
+           :pause false
+           :stop false
+           :finished false
+           :last-wake-time (jvm-time-ms)
+           :last-stage-positions (into {} [[default-z-drive z]
+                                           [default-xy-stage xy]])
+           :reference-z z
+           :start-time (jvm-time-ms)
+           :init-auto-shutter (core getAutoShutter)
+           :init-exposure exposure
+           :init-shutter-state (core getShutterOpen)
+           :exposure {(core getCameraDevice) exposure}
+           :default-z-drive default-z-drive
+           :default-xy-stage default-xy-stage
+           :init-z-position z
+           :init-system-state (get-system-config-cached)
+           :init-continuous-focus (core isContinuousFocusEnabled)
+           :init-width (core getImageWidth)
+           :init-height (core getImageHeight)
+           :binning (core getProperty (core getCameraDevice) "Binning")
+           :bit-depth (core getImageBitDepth)
+           :pixel-size-um (core getPixelSizeUm)
+           :source (core getCameraDevice)
+           :pixel-type (get-pixel-type)
+           )))

 (defn cleanup []
   (try
     (attempt-all
       (log "cleanup")
-      ; (do-when #(.update %) (:display @state))
       (state-assoc! :finished true :display nil)
       (when (core isSequenceRunning)
         (core stopSequenceAcquisition))
@@ -621,8 +594,8 @@
                  (not (core isContinuousFocusEnabled)))
         (enable-continuous-focus true))
       (. gui enableRoiButtons true))
-    (catch Throwable t (do (.printStackTrace t)
-                           (ReportingUtils/showError t "Acquisition cleanup failed.")))))
+    (catch Throwable t
+           (ReportingUtils/showError t "Acquisition cleanup failed."))))

 ;; running events

@@ -674,26 +647,23 @@
     (await-resume)))

 (defn run-acquisition [this settings out-queue cleanup?]
-  (try
-    (def acq-settings settings)
-    (log "Starting MD Acquisition: " settings)
-    (. gui enableLiveMode false)
-    (. gui enableRoiButtons false)
-    (prepare-state this)
-    (binding [state (.state this)]
+  (binding [state (.state this)]
+    (try
+      (def acq-settings settings)
+      (log "Starting MD Acquisition: " settings)
+      (. gui enableLiveMode false)
+      (. gui enableRoiButtons false)
+      (prepare-state state)
       (def last-state state) ; for debugging
       (let [acq-seq (generate-acq-sequence settings @attached-runnables)]
         (def acq-sequence acq-seq)
-        (execute (mapcat #(make-event-fns % out-queue) acq-seq))
+        (execute (mapcat #(make-event-fns % out-queue) acq-seq)))
+      (catch Throwable t
+             (ReportingUtils/showError t "Acquisition failed."))
+      (finally
         (when cleanup?
           (cleanup))
-        (.put out-queue TaggedImageQueue/POISON)
-        ))
-    (catch Throwable t (do (ReportingUtils/showError t "Acquisition failed.")
-                           (.printStackTrace t)
-                           (when cleanup?
-                             (cleanup))
-                           (.put out-queue TaggedImageQueue/POISON)))))
+        (.put out-queue TaggedImageQueue/POISON)))))

 ;; generic metadata


Fix links in dropdown

Fix links in dropdown

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -66,14 +66,18 @@
                 [:i.material-icons "add"] "Get Help"]
                [:ul.dropdown-menu.pull-right.animated.slideInDown
                 [:li
+                 ;; FIXME: NEED TO ADD QUICK START PAGE
+                 [:a {:href "/quick-start"}
+                  "Quick Start"]]
+                [:li
                  [:a (html/open-ext {:href "https://circleci.com/docs/"})
                   "Docs"]]
                 [:li
                  [:a (html/open-ext {:href "https://discuss.circleci.com/"})
                   "Discuss"]]
                 [:li
-                 ;; FIXME: NEED TO ADD THIS AGAIN IN THE DEFN
-                 [:a.support-info
+                 ;; FIXME: NEED TO ADD LINK TO SUPPORT
+                 [:a.support-info {:href "/suport"}
                   "Support"]]
                 [:li
                  [:a (html/open-ext {:href "/"})


remove stray `replace-params` code.  we are going to tackle that at a later time.

--- src/metabase/driver/generic_sql/query_processor.clj
+++ src/metabase/driver/generic_sql/query_processor.clj
@@ -298,35 +298,12 @@
     (apply-clauses driver (k/select* entity) inner-query)))

-(def ^:private formatter (tf/formatter "YYYY-MM-dd" (t/default-time-zone)))
-
-;; TODO: we may need to make this part of ISQLDriver interface and let other dbs override as needed
-;; Boolean, Long, Double, String, Timestamp
-(defn- sql-param
-  "Format a single value properly for inclusion in a SQL statement"
-  [param]
-  ;; TODO: we need to handle sql date/time/timestamp values here (do actual jdbc drivers have functions for this?)
-  (cond
-    (u/is-temporal? param) (str "'" (tf/unparse formatter (tc/from-sql-time param)) "'")
-    (string? param)        (str "'" param "'")
-    :else                  (str param)))
-
-(defn- replace-params
-  "Replace any positional parameters in a SQL statement `?` with a value from a list of parameters.
-   e.g. SELECT * FROM mytable WHERE id = ?, [1]  ->  SELECT * FROM mytable WHERE id = 1"
-  [sql params]
-  (if (empty? params) sql
-                      (let [param (first params)
-                            new-str (s/replace-first sql #"\?" (sql-param param))]
-                        (replace-params new-str (rest params)))))
-
 (defn mbql->native
   "Transpile MBQL query into a native SQL statement."
   [driver {{:keys [source-table]} :query, database :database, :as outer-query}]
   (let [entity        ((resolve 'metabase.driver.generic-sql/korma-entity) database source-table)
         korma-form    (build-korma-form driver outer-query entity)
         form-with-sql (kengine/bind-query korma-form (kengine/->sql korma-form))]
-    ;; (replace-params (:sql-str form-with-sql) (:params form-with-sql))
     {:query  (:sql-str form-with-sql)
      :params (:params form-with-sql)}))


Fix NullPointerException when referencing expression that doesn't exist :cry:

--- src/metabase/driver/generic_sql/query_processor.clj
+++ src/metabase/driver/generic_sql/query_processor.clj
@@ -46,11 +46,12 @@
 (defn- expression-with-name
   "Return the `Expression` referenced by a given EXPRESSION-NAME."
   [expression-name]
-  (some (fn [expression]
-          (when (= (name (:expression-name expression))
-                   (name expression-name))
-            expression))
-        (:expressions (:query *query*))))
+  (or (some (fn [expression]
+              (when (= (name (:expression-name expression))
+                       (name expression-name))
+                expression))
+            (:expressions (:query *query*)))
+      (throw (Exception. (format "No expression named '%s'." (name expression-name))))))

 (defprotocol ^:private IGenericSQLFormattable
   (formatted [this]


sqs no longer returns a future, no need to deref consumer-id

--- src/vip/data_processor.clj
+++ src/vip/data_processor.clj
@@ -110,4 +110,4 @@
                                    (log/info "VIP Data Processor shutting down...")
                                    (q/publish {:id id :event "stopping"} "qa-engine.status")
                                    (sqs/stop-consumer consumer-id))))
-      @consumer-id)))
+      consumer-id)))


Fix typo

Fix typo

--- test/cia/handler_test.clj
+++ test/cia/handler_test.clj
@@ -14,7 +14,7 @@
 (defmacro deftest-for-each-store [test-name & body]
   `(helpers/deftest-for-each-fixture ~test-name
      {:memory-store helpers/fixture-in-memory-store
-      :sql-tore     (join-fixtures [db-helpers/fixture-sql-store
+      :sql-store    (join-fixtures [db-helpers/fixture-sql-store
                                     db-helpers/fixture-clean-db])}
      ~@body))


fix EDN lookup in non-hierarchical config test

--- test/keypin/core_test.clj
+++ test/keypin/core_test.clj
@@ -25,7 +25,7 @@
     (doseq [config-fileset [["test-config/myconf.properties"]
                             ["test-config/myconf.edn"]]]
       (println "----------")
-      (let [props (read-config ["test-config/myconf.properties"])]
+      (let [props (read-config config-fileset)]
         (is (instance? Map props))
         (is (= "new-version" (get props "service.version")))
         (is (nil? (get props "app.version")))


Update main_test

Update main_test

--- test/server/main_test.clj
+++ test/server/main_test.clj
@@ -1,7 +1,7 @@
 (ns server.main-test
   (:require [com.stuartsierra.component :as component]
             [server.main :refer [system-map prod-system]]
-            [server.infrastructure.database :refer [new-database]]))
+            [server.infrastructure.persistence.database :refer [new-database]]))

 (def test-system-map
   (-> system-map


CMR-1280 Updates iso-mends to make parse-collection-test pass

--- umm-lib/test/cmr/umm/test/iso_mends/collection.clj
+++ umm-lib/test/cmr/umm/test/iso_mends/collection.clj
@@ -173,6 +173,7 @@
                        :single-date-times
                        [(p/parse-datetime "2010-01-05T05:30:30.550-05:00")]
                        :periodic-date-times []})
+                    :spatial-coverage (umm-c/map->SpatialCoverage {:geometries ()})
                     :science-keywords
                     [(umm-c/map->ScienceKeyword
                        {:category "EARTH SCIENCE"


Fixes ISO MENDS collections after updating to use new GML lib

--- umm-lib/test/cmr/umm/test/iso_mends/collection.clj
+++ umm-lib/test/cmr/umm/test/iso_mends/collection.clj
@@ -22,12 +22,13 @@
             [cmr.spatial.derived :as d]))

 (defn- spatial-coverage->expected-parsed
-  [{:keys [geometries spatial-representation] :as sc}]
+  "Returns the expected parsed ISO MENDS SpatialCoverage from a UMM collection."
+  [{:keys [geometries spatial-representation]}]
   (when geometries
     (umm-c/map->SpatialCoverage
      {:spatial-representation spatial-representation
       :granule-spatial-representation spatial-representation
-      :geometries geometries})))
+      :geometries (map #(umm-s/set-coordinate-system spatial-representation %) geometries)})))

 (defn- related-urls->expected-parsed
   "Returns the expected parsed related-urls for the given related-urls."
@@ -152,9 +153,12 @@
   (for-all [collection coll-gen/collections]
     (let [xml (iso/umm->iso-mends-xml collection)
           parsed-iso (c/parse-collection xml)
-          parsed-iso (update-in parsed-iso [:spatial-coverage] derive-geometries)
           echo10-xml (echo10/umm->echo10-xml parsed-iso)
           parsed-echo10 (echo10-c/parse-collection echo10-xml)
+          ;; fudge the spatial coverage here because ECHO 10 doesn't
+          ;; apply the collection spatial representation to the
+          ;; geometries it contains...
+          parsed-echo10 (update-in parsed-echo10 [:spatial-coverage] spatial-coverage->expected-parsed)
           expected-parsed (test-echo10/umm->expected-parsed-echo10 (umm->expected-parsed-iso collection))]
       (and (= parsed-echo10 expected-parsed)
            (= 0 (count (echo10-c/validate-xml echo10-xml)))))))


[cuda] Limit the conv net sizes to support larger models. (#22)

--- gpu-compute/src/think/compute/nn/cuda_backend.clj
+++ gpu-compute/src/think/compute/nn/cuda_backend.clj
@@ -446,8 +446,8 @@
                  filter-desc
                  conv-desc
                  output-tensor
-                 cudnn/CUDNN_CONVOLUTION_FWD_PREFER_FASTEST
-                 0
+                 cudnn/CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT
+                 100000
                  forward-algo))
     (cudnn-call (cudnn/cudnnGetConvolutionForwardWorkspaceSize
                  cudnn-context
@@ -463,8 +463,8 @@
                  output-tensor
                  conv-desc
                  filter-desc
-                 cudnn/CUDNN_CONVOLUTION_BWD_FILTER_PREFER_FASTEST
-                 0
+                 cudnn/CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT
+                 100000
                  backward-filter-algo))
     (cudnn-call (cudnn/cudnnGetConvolutionBackwardFilterWorkspaceSize
                  cudnn-context
@@ -480,8 +480,8 @@
                  output-tensor
                  conv-desc
                  input-tensor
-                 cudnn/CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST
-                 0
+                 cudnn/CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT
+                 100000
                  backward-data-algo))
     (cudnn-call (cudnn/cudnnGetConvolutionBackwardDataWorkspaceSize
                  cudnn-context


Actually query for the org's vcs-type

Actually query for the org's vcs-type

Well that's embarrassing.

--- src-cljs/frontend/components/pages/workflow.cljs
+++ src-cljs/frontend/components/pages/workflow.cljs
@@ -180,7 +180,8 @@
   (query [this]
     [:branch/name
      {:branch/project [:project/name
-                       {:project/organization [:organization/name]}]}
+                       {:project/organization [:organization/vcs-type
+                                               :organization/name]}]}
      `{(:routed/page {:page/connection :branch/workflow-runs
                       :page/count 30})
        ~(om-next/get-query RunList)}


[#2281] Fix reset-password spelling bug

[#2281] Fix reset-password spelling bug

--- backend/src/akvo/lumen/component/keycloak.clj
+++ backend/src/akvo/lumen/component/keycloak.clj
@@ -374,7 +374,7 @@
                              {:body    (json/encode {"temporary" true
                                                      "type"      "password"
                                                      "value"     tmp-password})
-                              "headers" headers})))
+                              :headers headers})))
   (remove-user
     [this tenant author-claims user-id]
     (do-remove-user this tenant author-claims user-id))


One more bit of cleanup

One more bit of cleanup

--- storm-core/src/clj/backtype/storm/daemon/worker.clj
+++ storm-core/src/clj/backtype/storm/daemon/worker.clj
@@ -181,8 +181,6 @@
   (let [cluster-state (cluster/mk-distributed-cluster-state conf)
         storm-cluster-state (cluster/mk-storm-cluster-state cluster-state)
         storm-conf (read-supervisor-storm-conf conf storm-id)
-        _temp (read-worker-executors storm-conf storm-cluster-state storm-id assignment-id port assignment-versions)
-        _ (log-message (str "Worker assignments: " _temp))
         executors (set (read-worker-executors storm-conf storm-cluster-state storm-id assignment-id port assignment-versions))
         transfer-queue (disruptor/disruptor-queue "worker-transfer-queue" (storm-conf TOPOLOGY-TRANSFER-BUFFER-SIZE)
                                                   :wait-strategy (storm-conf TOPOLOGY-DISRUPTOR-WAIT-STRATEGY))


puppet works

puppet works

--- test/celestial/integration/workflows/openstack.clj
+++ test/celestial/integration/workflows/openstack.clj
@@ -33,6 +33,11 @@
           (wf/reload (spec)) => nil
           (wf/destroy (spec)) => nil)

+      (fact "openstack puppetization" :integration :openstack :workflow
+          (wf/create (spec)) => nil
+          (wf/puppetize redis-type (spec)) => nil
+          (wf/destroy (spec)) => nil)
+
       #_(fact "openstack floating ip":integration :openstack :workflow
         ; will be run only if EIP env var is defined
         (when-let [eip (System/getenv "EIP")]
@@ -46,9 +51,6 @@
            (wf/destroy (spec)) => nil
           ))

-      #_(fact "openstack puppetization" :integration :openstack :workflow
-          (wf/create (spec)) => nil
-          (wf/puppetize redis-type (spec)) => nil
-          (wf/destroy (spec)) => nil)
+

       )))


These tests no longer make sense here. The responsibility of arg-matchers is abstracted from the fake. As far as its concerned it gets a function that is used to match arguments, not the internal details of how that works

--- test/midje/parsing/2_to_lexical_maps/t_expects.clj
+++ test/midje/parsing/2_to_lexical_maps/t_expects.clj
@@ -72,16 +72,6 @@
       (:call-text-for-failures fake-1) => "(faked-function some-variable)"
       (deref (:call-count-atom fake-0)) => 0)

-    (fact "argument matching"
-      (count (:arg-matchers fake-0)) => 0)
-
-    (fact "Note that lexical scoping is obeyed"
-      (count (:arg-matchers fake-1)) => 1
-      (pile/apply-pairwise (:arg-matchers fake-1) [5] [nil]) => [[true] [false]]
-      (count (:arg-matchers fake-2)) => 2
-      (pile/apply-pairwise (:arg-matchers fake-2) [5 5] [1 1]) => [  [false true]
-                                                                     [true false] ])
-
     (fact "Result supplied"
       ((:result-supplier fake-0)) => 2
       ((:result-supplier fake-1)) => (+ 2 some-variable)


adjust format

adjust format

--- test/src/dda/pallet/dda_managed_ide/infra_test.clj
+++ test/src/dda/pallet/dda_managed_ide/infra_test.clj
@@ -17,9 +17,9 @@

 (ns dda.pallet.dda-managed-ide.infra-test
   (:require
-    [clojure.test :refer :all]
-    [schema.core :as s]
-    [dda.pallet.dda-managed-ide.infra :as sut]))
+   [clojure.test :refer :all]
+   [schema.core :as s]
+   [dda.pallet.dda-managed-ide.infra :as sut]))

 (s/set-fn-validation! true)

@@ -28,24 +28,22 @@
    :ide-settings #{}})

 (def basic-atom-config
-   {:atom
-    {:plugins ["proto-repl"]}})
+  {:atom
+   {:plugins ["proto-repl"]}})

 (def wrong-atom-config
-   {:atom
-    {:plugins [:proto-repl]}})
-
+  {:atom
+   {:plugins [:proto-repl]}})

 (deftest test-schema
   (testing
-    "test the ide schema"
+   "test the ide schema"
     (is (s/validate sut/DdaIdeConfig basic-config))
     (is (s/validate sut/DdaIdeConfig (merge basic-config basic-atom-config)))
     (is (thrown? Exception (s/validate sut/DdaIdeConfig (merge basic-config wrong-atom-config))))
     (is (thrown? Exception (s/validate sut/DdaIdeConfig {:unsuported-key :unsupported-value})))))

-
 (deftest plan-def
   (testing
-    "test plan-def"
+   "test plan-def"
     (is sut/with-dda-ide)))


a whole new world

a whole new world

--- ros/angelic_planning/src/ros/robot_actions.clj
+++ ros/angelic_planning/src/ros/robot_actions.clj
@@ -455,7 +455,7 @@
 (defmethod execute-robot-primitive ::GripperAction [nh action]
   (println "Executing move_gripper action (via actuate gripper action)")
   (move-gripper-to-state nh (:goal action))
-  (Thread/sleep 3000)
+  (Thread/sleep 6000)
   (when (:holding (:goal action))
     (assert (> (get-current-gripper-separation nh (isa? (:class (:goal action)) :ros.robot/Right)) 0.02))))


CMR-662: Fixed expected resulted for sort-key.

--- test/cmr/system_int_test/search/aql_search_test.clj
+++ test/cmr/system_int_test/search/aql_search_test.clj
@@ -127,7 +127,7 @@
          "SHORT" {:page-size 1} [coll1]
          "SHORT" {:page-size 1 :page-num 3} [coll3]
          ; TODO - enable this test when sort-key is supported
-         ;"SHORT" {:sort-key :entry-title} [coll2]
+         ;"SHORT" {:sort-key :entry-title} [coll1 coll2 coll3 coll4]
          "SHORT" {} [coll1 coll2 coll3 coll4])))


add configurable :devtools :repl-timeout

--- src/main/shadow/cljs/devtools/server/worker.clj
+++ src/main/shadow/cljs/devtools/server/worker.clj
@@ -58,11 +58,15 @@
   [proc client-id client-out]
   (impl/repl-eval-connect proc client-id client-out))

-(defn worker-request [{:keys [proc-control] :as worker} request]
+(defn worker-request [{:keys [proc-control state-ref] :as worker} request]
   {:pre [(impl/proc? worker)
          (map? request)
          (keyword? (:type request))]}
-  (let [result-chan (async/chan 1)]
+  (let [result-chan
+        (async/chan 1)
+
+        repl-timeout
+        (get-in @state-ref [:build-config :devtools :repl-timeout] 10000)]

     (>!! proc-control (assoc request :result-chan result-chan))

@@ -72,7 +76,7 @@
         ([x] x)

         ;; FIXME: things that actually take >10s will timeout and never show their result
-        (async/timeout 10000)
+        (async/timeout repl-timeout)
         ([_]
           {:type :repl/timeout}))


Path validation returns Clojure map

Path validation returns Clojure map

--- src/rdf_path_examples/integrity_constraints.clj
+++ src/rdf_path_examples/integrity_constraints.clj
@@ -2,7 +2,8 @@
   (:require [rdf-path-examples.sparql :refer [construct-query]]
             [clojure.java.io :as io]
             [yesparql.sparql :refer [model->json-ld]])
-  (:import [org.apache.jena.rdf.model Model]))
+  (:import [org.apache.jena.rdf.model Model]
+           [com.github.jsonldjava.utils JsonUtils]))

 (defonce integrity-constraints
   (->> "sparql/integrity_constraints"
@@ -28,8 +29,8 @@

 (defn validate-path
   "Validate RDF `path`.
-  Returns nil if path is valid. Otherwise, return JSON-LD string containing validation errors."
+  Returns nil if path is valid. Otherwise, returns JSON-LD hash-map containing validation errors."
   [^Model path]
   (let [validation-results (execute-validation path)]
     (when-not (valid-path? validation-results)
-      (model->json-ld validation-results))))
+      (into {} (JsonUtils/fromString (model->json-ld validation-results))))))


CW & JC | Pulled out a variable in change-password test

--- test-cljs/stonecutter/test/change_password.cljs
+++ test-cljs/stonecutter/test/change_password.cljs
@@ -14,6 +14,7 @@
 (def valid-password "12345678")
 (def valid-new-password "23456789")

+(def change-password-form :.clj--change-password__form)
 (def current-password-input :#current-password)
 (def current-password-field :.clj--current-password)
 (def new-password-field :.clj--new-password)
@@ -67,21 +68,21 @@
          (cp/start)

          (testing "submitting empty form"
-                  (press-submit :.clj--change-password__form)
+                  (press-submit change-password-form)
                   (test-field-has-class current-password-field field-error-class)
                   (test-field-has-class new-password-field field-error-class)
                   (has-focus? current-password-input))

          (testing "submitting form with only valid current-password"
                   (enter-text current-password-input valid-password)
-                  (press-submit :.clj--change-password__form)
+                  (press-submit change-password-form)
                   (test-field-doesnt-have-class current-password-field field-error-class)
                   (test-field-has-class new-password-field field-error-class)
                   (has-focus? new-password-input))

          (testing "submitting form with all valid inputs"
                   (enter-text new-password-input valid-new-password)
-                  (press-submit :.clj--change-password__form)
+                  (press-submit change-password-form)
                   (test-field-doesnt-have-class current-password-field field-error-class)
                   (test-field-doesnt-have-class new-password-field field-error-class)))


Load protocol specs as needed from resources

Don't keep protocol specs in memory all the time. Load them when
needed from resources.

--- src/clj_chrome_devtools/protocol_definitions.clj
+++ src/clj_chrome_devtools/protocol_definitions.clj
@@ -1,19 +1,19 @@
 (ns clj-chrome-devtools.protocol-definitions
   "Loads CDP protocol definition JSON files for consumption by def macros."
-  (:require [cheshire.core :as cheshire]))
+  (:require [cheshire.core :as cheshire]
+            [clojure.java.io :as io]))

 (defn- load-json [json-file]
   (as-> json-file it
-       (str "resources/devtools-protocol/json/" it)
-       (slurp it)
-       (cheshire/parse-string it true)))
+    (str "devtools-protocol/json/" it)
+    (io/resource it)
+    (slurp it)
+    (cheshire/parse-string it true)))

-(def browser-protocol-json (load-json "browser_protocol.json"))
-(def js-protocol-json (load-json "js_protocol.json"))
+(def protocol-files ["browser_protocol.json" "js_protocol.json"])

 (defn all-domains []
-  (concat (:domains browser-protocol-json)
-          (:domains js-protocol-json)))
+  (mapcat (comp :domains load-json) protocol-files))

 (defn commands-for-domain [domain]
   (->> (all-domains)


dynamic ui

dynamic ui

--- src/clojure/com/datayumyum/helloDroid/script.clj
+++ src/clojure/com/datayumyum/helloDroid/script.clj
@@ -14,7 +14,7 @@
       (make-ui main-layout) ))

 (import '(com.rabbitmq.client ConnectionFactory Connection Channel MessageProperties QueueingConsumer))
-(defn sendQueue [msg]
+(defn send [msg]
   (do
     (def factory (ConnectionFactory.))
     (.setHost factory "obi.kaicode.com")
@@ -23,10 +23,12 @@
     (def queue "han.printer")
     (.queueDeclare channel queue true false false nil)
     (.basicPublish channel "" queue MessageProperties/PERSISTENT_TEXT_PLAIN (.getBytes msg))
+    (.close channel)
+    (.close connection)
     )
 )

-(defn readQeue []
+(defn read []
     (def factory (ConnectionFactory.))
     (.setHost factory "obi.kaicode.com")
     (def connection (.newConnection factory))
@@ -37,5 +39,15 @@
     (.basicConsume channel queue true consumer)
     (def delivery (.nextDelivery consumer))
     (def message (String. (.getBody delivery)))
+    (.close channel)
+    (.close connection)
     (println message)
+    (render (eval (read-string message)))
 )
+
+(defn render [ui]
+  (on-ui
+   (set-content-view! a
+                      (make-ui ui) ) )
+)
+


CMR-1280: Simplifies a test support function

--- umm-lib/test/cmr/umm/test/iso_mends/collection.clj
+++ umm-lib/test/cmr/umm/test/iso_mends/collection.clj
@@ -127,13 +127,10 @@
 (defn derive-geometries
   "Returns SpatialCoverage with all geometries updated by calling
   calculate-derived with the collection coordinate system."
-  [{:keys [spatial-representation] :as sc}]
+  [{cs :spatial-representation :as sc}]
   (when sc
-    (update-in sc [:geometries] (fn [geoms]
-                                  (map #(d/calculate-derived
-                                         (umm-s/set-coordinate-system spatial-representation
-                                                                      %))
-                                       geoms)))))
+    (let [derive #(d/calculate-derived (umm-s/set-coordinate-system cs %))]
+      (update-in sc [:geometries] (partial map derive)))))

 (defspec generate-collection-is-valid-xml-test 100
   (for-all [collection coll-gen/collections]


CMR-1280: Adds pending ISO MENDS spatial XSLT text

The test is commented out and can be reinstated when the ECHO-to-ISO
XSLT is fixed.

--- umm-lib/test/cmr/umm/test/iso_mends/collection.clj
+++ umm-lib/test/cmr/umm/test/iso_mends/collection.clj
@@ -8,6 +8,8 @@
             [clojure.java.io :as io]
             [cmr.common.joda-time]
             [cmr.common.date-time-parser :as p]
+            ;; this is not needed until the ECHO to ISO XSLT is fixed
+            ;; [cmr.common.xml.xslt :as xslt]
             [cmr.umm.test.generators.collection :as coll-gen]
             [cmr.umm.iso-mends.collection :as c]
             [cmr.umm.echo10.collection :as echo10-c]
@@ -156,6 +158,24 @@
           expected-parsed (test-echo10/umm->expected-parsed-echo10 (umm->expected-parsed-iso collection))]
       (and (= parsed-echo10 expected-parsed)
            (= 0 (count (echo10-c/validate-xml echo10-xml)))))))
+
+(comment
+  ;; This test is currently failing pending an update to the XSLT file
+  ;; to generate closed polygons per the GML spec
+
+(def echo-to-iso-xslt
+  (xslt/read-template
+   (io/resource "schema/iso_mends/resources/transforms/ECHOToISO.xsl")))
+
+  (defspec umm-to-echo-to-iso-mends-via-xslt-to-umm-test 100
+    (for-all [collection coll-gen/collections]
+      (let [echo10-xml (echo10/umm->echo10-xml collection)
+            iso-xml    (xslt/transform echo10-xml echo-to-iso-xslt)
+            parsed-iso (c/parse-collection iso-xml)]
+        ;; only comparing the parsed :spatial-coverage, since there are
+        ;; funky parts in the rest of the XSLT output
+        (= (:spatial-coverage (umm->expected-parsed-iso collection))
+           (:spatial-coverage (umm->expected-parsed-iso parsed-iso)))))))

 ;; This is a made-up include all fields collection xml sample for the parse collection test
 (def all-fields-collection-xml


update clojurescript dependency -> 1.9.562

--- resources/leiningen/new/tenzing/build.boot
+++ resources/leiningen/new/tenzing/build.boot
@@ -8,7 +8,7 @@
                  [com.cemerick/piggieback   "0.2.1"      :scope "test"]
                  [org.clojure/tools.nrepl   "0.2.12"     :scope "test"]
                  [weasel                    "0.7.0"      :scope "test"]
-                 [org.clojure/clojurescript "1.9.293"]{{{deps}}}])
+                 [org.clojure/clojurescript "1.9.562"]{{{deps}}}])

 (require
  '[adzerk.boot-cljs      :refer [cljs]]


Abstract directions

Abstract directions

--- day-01/src/solver/core.clj
+++ day-01/src/solver/core.clj
@@ -11,4 +11,6 @@
 (defn -main
   "I don't do a whole lot ... yet."
   [& args]
-  (println (determine-floor (clojure.string/split (slurp "input") #""))))
+  (let [directions (clojure.string/split (slurp "input") #"")]
+    (println (determine-floor directions))))
+


Create a grid of lights

Create a grid of lights

--- day-06/src/solver/core.clj
+++ day-06/src/solver/core.clj
@@ -1,5 +1,13 @@
 (ns solver.core
   (:gen-class))
+
+(defn create-grid
+  ([] (create-grid 1000))
+  ([w] (create-grid w w))
+  ([w h] (let [row (vec (map (fn [x] false) (range w)))
+               grid (vec (map (fn [x] row) (range h)))]
+           grid)))
+

 (defn -main
   "I don't do a whole lot ... yet."


core: bigfloat?

core: bigfloat?

--- data/core.clj
+++ data/core.clj
@@ -1736,3 +1736,8 @@
    :added "1.0"}
   [r]
   (denominator* r))
+
+(defn bigfloat?
+  "Returns true if n is a BigFloat"
+  {:added "1.0"}
+  [n] (instance? BigFloat n))