Remove unnecessary dependency

Remove unnecessary dependency

--- src/yada/core.clj
+++ src/yada/core.clj
@@ -8,7 +8,6 @@
    [clojure.walk :refer (keywordize-keys)]
    [byte-streams :as bs]
    [bidi.bidi :as bidi]
-   [hiccup.core :as h]
    [manifold.deferred :as d]
    ring.middleware.basic-authentication
    [ring.middleware.params :refer (assoc-query-params)]


added past participle become

added past participle become

--- src/babel/english/lexicon-verbcoach.clj
+++ src/babel/english/lexicon-verbcoach.clj
@@ -330,7 +330,8 @@
              {:synsem {:cat :verb
                        :sem {:pred :become}
                        :subcat {:2 '()}}
-              :english {:past "became"}}]
+              :english {:past "became"}
+              :past-participle "become"}]

    "begin" [{:synsem {:cat :verb
                       :sem {:pred :begin}


Better export of words into text format

Better export of words into text format

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -188,7 +188,9 @@

 (defn words->text
     [words]
-    (clojure.string/join "\n" words))
+    (->> (for [word words :when (= (:deleted word) 0)]
+             (str (:word word) "\t" (:description word)))
+         (clojure.string/join "\n")))

 (defn words->xml
     [words]


add missing cljs.analyzer/resolve-var hack arity

--- src/main/shadow/build/cljs_hacks.cljc
+++ src/main/shadow/build/cljs_hacks.cljc
@@ -151,6 +151,8 @@
   ([env sym]
    (shadow-resolve-var env sym nil))
   ([env sym confirm]
+   (shadow-resolve-var env sym confirm true))
+  ([env sym confirm default?]
    (let [locals (:locals env)
          current-ns (-> env :ns :name)
          sym-ns-str (namespace sym)]
@@ -236,7 +238,7 @@
              (resolve-ns-var full-ns sym current-ns))

            (some? (ana/gets current-ns-info :imports sym))
-           (recur env (ana/gets current-ns-info :imports sym) confirm)
+           (recur env (ana/gets current-ns-info :imports sym) confirm default?)

            (some? (ana/gets current-ns-info :defs sym))
            (do (when (some? confirm)
@@ -366,10 +368,11 @@
                                    )))))))))))

            :else
-           (do (when (some? confirm)
-                 (confirm env current-ns sym))
-               (resolve-cljs-var current-ns sym)
-               )))))))
+           (when default?
+             (when (some? confirm)
+               (confirm env current-ns sym))
+             (resolve-cljs-var current-ns sym)
+             )))))))

 (defn shadow-resolve-var-checked
   ([env sym]


make build-report/generate accept a map for build config only

fixes #1022

--- src/main/shadow/cljs/build_report.clj
+++ src/main/shadow/cljs/build_report.clj
@@ -230,8 +230,9 @@
   (spit data-file (core-ext/safe-pr-str bundle-info)))

 (defn generate
-  [build-id {:keys [tag print-table report-file data-file] :or {tag "latest"} :as opts}]
+  [{:keys [build-id] :as build-config} {:keys [tag print-table report-file data-file] :or {tag "latest"} :as opts}]
   {:pre [(keyword? build-id)
+         (map? build-config)
          (string? tag)
          (seq tag)]}
   (api/with-runtime
@@ -246,7 +247,7 @@
           (keyword (str (name build-id) "-release-snapshot"))

           build-config
-          (-> (api/get-build-config build-id)
+          (-> build-config
               (assoc
                 :build-id build-id-alias
                 ;; not required, the files are never going to be used
@@ -297,7 +298,7 @@
       )

   (generate
-    :ui
+    (api/get-build-config :ui)
     {:report-file ".shadow-cljs/build-report/index.html"
      :inline false})
   )
@@ -351,9 +352,15 @@

 ;; FIXME: parse args properly, need support for tag and output-dir
 (defn -main [build-id report-file]
-  (generate (keyword build-id) {:print-table true
-                                :report-file report-file}))
+  (generate
+    (api/get-build-config
+      (keyword build-id))
+    {:print-table true
+     :report-file report-file}))

 (comment
-  (generate :browser {:print-table true :report-file "tmp/report.html"}))+  (generate
+    (api/get-build-config :browser)
+    {:print-table true
+     :report-file "tmp/report.html"}))


Use correct namespace for `+meta-key`

Use correct namespace for `+meta-key`

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -56,7 +56,7 @@
 (defn add-filedata [tmp-files]
   (pod/with-call-in @filedata-pod
     (io.perun.filedata/filedatas
-     ~(vec (map (juxt boot/tmp-path #(.getPath (boot/tmp-file %)) perun/+meta-key+) tmp-files)))))
+     ~(vec (map (juxt boot/tmp-path #(.getPath (boot/tmp-file %)) pm/+meta-key+) tmp-files)))))

 (deftask base
   "Add some basic information to the perun metadata and


finished reading 11.1, futures

finished reading 11.1, futures

--- src/joy/ch11.clj
+++ src/joy/ch11.clj
@@ -2,13 +2,14 @@
   (:require (clojure [xml :as xml]))
   (:require (clojure [zip :as zip]))
   (:import (java.util.regex Pattern)))
+
 (time (let [x (future (do (Thread/sleep 5000)
                           (+ 41 1)))]
         [@x @x]))

 (defn feed->zipper [uri-str]
-  (->> xml/parse uri-str)
-  zip/xml-zip)
+  (->> (xml/parse uri-str)
+       zip/xml-zip))

 (defn normalize [feed]
   (if (= :feed (:tag (first feed)))
@@ -31,7 +32,7 @@

 (defn count-text-task [extractor txt feed]
   (let [items (feed-children feed)
-        re (Pattern/compile (str "(?i" txt ))]
+        re (Pattern/compile (str "(?i)" txt))]
     (->> items
          (map extractor)
          (mapcat #(re-seq re %))
@@ -41,3 +42,30 @@
  title
  "Erlang"
  "http://feeds.feedburner.com/ElixirLang")
+
+(def feeds #{"http://feeds.feedburner.com/ElixirLang"
+            "http://blog.fogus.me/feed/"})
+
+(let [results (for [feed feeds]
+                (future
+                  (count-text-task title "Elixir" feed)))]
+  (reduce + (map deref results)))
+
+(defmacro as-futures [[a args] & body]
+  (let [parts (partition-by #{'=>} body)
+        [acts _ [res]] (partition-by #{:as} (first parts))
+        [_ _ task] parts]
+    `(let [~res (for [~a ~args] (future ~@acts))]
+       ~@task)))
+
+(defn occurrences [extractor tag & feeds]
+  (as-futures [feed feeds]
+              (count-text-task extractor tag feed)
+              :as results
+              =>
+              (reduce + (map deref results))))
+
+#_(occurrences title "released"
+            "http://blog.fogus.me/feed/"
+            "http://feeds.feedburner.com/ElixirLang"
+            "http://www.ruby-lang.org/en/feeds/news.rss")


Fixing typo in "PUT" (removing line break)

--- src/kilo/web.clj
+++ src/kilo/web.clj
@@ -16,8 +16,7 @@
   (PUT "/kilo/user/:id" [id] (k-user/set-user id))

   (GET "/kilo/group/:id" [id] (k-group/get-group id))
-  (PU
-   T "/kilo/group/:id" [id] (k-group/set-group id))
+  (PUT "/kilo/group/:id" [id] (k-group/set-group id))
   )

 (def handler


Adding search with lines to the cmr demos.

--- src/cmr/demos/visual_spatial_search.clj
+++ src/cmr/demos/visual_spatial_search.clj
@@ -58,17 +58,24 @@
   [spatial-type ords]
   (apply p/point ords))

+(defmethod ords->shape :line
+  [spatial-type ords]
+  (apply l/ords->line-string :geodetic ords))
+
 (defn handle-search-area-moved
   "This is the VDD callback function. Everytime the search area is moved this will be called with the
   new ordinates of the search area. It removes the existing MBR and LR of the search area, recalculates
   and displays them. It then searches for matches and says the number of hits that match."
   [id-ords-str]
-  (println "Search area moved: " id-ords-str)
+  (println "Search area moved:" id-ords-str)

   (let [[id ords-str] (str/split id-ords-str #":")
         spatial-type (keyword id)
         ords (map #(Double. ^String %) (str/split ords-str #","))
         shape (ords->shape spatial-type ords)]
+
+        (println "shape:" (pr-str shape))
+        (println "encoded:" (pr-str (cmr.spatial.codec/url-encode shape)))

     (let [results (search/find-refs :granule {spatial-type (cmr.spatial.codec/url-encode
                                                              shape)})
@@ -152,6 +159,7 @@
         wide-south-cart (polygon :cartesian -70 -30, 70 -30, 70 -20, -70 -20, -70 -30)
         very-wide-cart (polygon :cartesian -179 40, -179 35, 179 35, 179 40, -179 40)
         very-tall-cart (polygon :cartesian -160 90, -160 -90, -150 -90, -150 90, -160 90)
+        normal-poly-cart (polygon :cartesian 1.534 -16.52, 6.735 -14.102, 3.745 -9.735, -1.454 -11.802, 1.534 -16.52)

         ;; Cartesian With holes
         outer-cart (rr/ords->ring :cartesian -5.26 -22.59 11.56 -22.77 10.47 -11.29 -5.86 -11.37 -5.26 -22.59)
@@ -165,40 +173,44 @@
         normal-point (p/point 10 22)
         am-point (p/point 180 22)

-        search-area (assoc (polygon :geodetic -6.45,-3.74,12.34,-4.18,12,9.45,-6.69,9.2,-6.45,-3.74)
-                            :options {:id "polygon"})
+        ;search-area (assoc (polygon :geodetic -6.45,-3.74,12.34,-4.18,12,9.45,-6.69,9.2,-6.45,-3.74)
+        ;                    :options {:id "polygon"})

         ;search-area (assoc (m/mbr -23.43 5 25.54 -6.31) :options {:id "bounding_box"})

         ;search-area (assoc (p/point 0 0) :options {:id "point"})
+
+        search-area (assoc (l/ords->line-string :geodetic -0.37 -14.07 4.75 1.27 25.13 -15.51) :options {:id "line"})
+

         ]
     (visual-interactive-search [
-                                ; touches-sp
-                                ; across-am-br
-                                ; touches-np
-                                ; normal-br1
-                                ; normal-br2
+                                touches-sp
+                                across-am-br
+                                touches-np
+                                normal-br1
+                                normal-br2

                                 normal-geod-line
                                 normal-cart-line

-                                ; wide-north
-                                ; wide-south
-                                ; across-am-poly
-                                ; on-np
-                                ; on-sp
-                                ; normal-poly
-                                ; polygon-with-holes
-                                ; wide-north-cart
-                                ; wide-south-cart
-                                ; very-wide-cart
-                                ; very-tall-cart
-                                ; polygon-with-holes-cart
-                                ; north-pole
-                                ; south-pole
-                                ; normal-point
-                                ; am-point
+                                wide-north
+                                wide-south
+                                across-am-poly
+                                on-np
+                                on-sp
+                                normal-poly
+                                polygon-with-holes
+                                wide-north-cart
+                                wide-south-cart
+                                very-wide-cart
+                                very-tall-cart
+                                normal-poly-cart
+                                polygon-with-holes-cart
+                                north-pole
+                                south-pole
+                                normal-point
+                                am-point
                                 ] search-area))


Working with hipache

Working with hipache

--- src/nube/app.clj
+++ src/nube/app.clj
@@ -49,7 +49,7 @@
 (defn remove-app-env [app env] (redis! (car/hdel (str app ":envs") env)))
 (defn load-app-envs [app] (apply hash-map (redis! (car/hgetall (str app ":envs")))))

-(defn load-app-instances [app] (mapv #(subs % 7) (redis! (car/lrange (str "frontend:" app) 0 -1))))
+(defn load-app-instances [app] (mapv #(subs % 7) (next (redis! (car/lrange (str "frontend:" app) 0 -1)))))
 (defn add-app-instance [app instance] (redis! (car/rpush (str "frontend:" app) (str "http://" instance))))
 (defn remove-app-instance [app instance] (redis! (car/lrem (str "frontend:" app) 0 (str "http://" instance))))

@@ -118,9 +118,11 @@
     (docker! :post host (str "images/create?fromImage=" image (if tag (str "&tag=" tag) "")))))

 (defn kill-app-instance [app host port]
-  (println "Killing instance at" (str host ":" port))
-  (stop-container-by-port host port)
-  (remove-app-instance app (str host ":" port)))
+  (try
+    (println "Killing instance at" (str host ":" port))
+    (stop-container-by-port host port)
+    (remove-app-instance app (str host ":" port))
+    (catch Exception e nil)))

 (defn deploy-app-instance [app host port internal-port image]
   (println "Pulling new tags for" image)


Bounce to index.html

Bounce to index.html

--- src/tfe/main.clj
+++ src/tfe/main.clj
@@ -11,7 +11,8 @@
       (app request))))

 (defn handler [request]
-  {:status 200})
+  {:status 302
+   :headers {"Location" "/index.html"}})

 (def app
   (-> handler


TNS-38: ignore dependency on self, for CLJS

In Clojure (.clj) code, a namespace depending on itself makes no sense.
But it is perfectly reasonable for a ClojureScript (.cljs) file to
depend on a Clojure (.clj) file for macro definitions in the same
namespace, via :require-macros.

More generally, this means that a "namespace" is logically defined in
multiple files, which tools.namespace does not yet handle.

This causes spurious circular-dependency error in tools. See, for
example, https://github.com/clojure-emacs/refactor-nrepl/issues/127

It is easy to work around the specific case of self-dependency via
:require-macros, which has no meaning anywhere else.

As a consequence, tools.namespace will no longer throw an exception if
an ordinary Clojure namespace tries to :require itself.

--- src/main/clojure/clojure/tools/namespace/parse.cljc
+++ src/main/clojure/clojure/tools/namespace/parse.cljc
@@ -123,6 +123,9 @@
 (defn deps-from-ns-decl
   "Given an (ns...) declaration form (unevaluated), returns a set of
   symbols naming the dependencies of that namespace.  Handles :use and
-  :require clauses but not :load."
+  :require clauses but not :load. Ignores a namespace depending on
+  itself, for example a .cljs file with :require-macros on the .clj
+  file of the same namespace."
   [decl]
-  (set (mapcat deps-from-ns-form decl)))
+  (disj (set (mapcat deps-from-ns-form decl))
+        (name-from-ns-decl decl)))


Added tests for UP03 and UP04.

Added tests for UP03 and UP04.

--- src/alfresco_technical_validation/source_validation.clj
+++ src/alfresco_technical_validation/source_validation.clj
@@ -59,10 +59,10 @@
   {
     :module-properties {
         :module-version #"module\.version\s*=(.*)\z"
-        :repo-min       #"module\.repo\.version\.min\s*=(.*)\z"
-        :repo-max       #"module\.repo\.version\.max\s*=(.*)\z"
-        :alf-edition    #"module\.edition\s*=(.*)\z"
         :com03          #"module\.id\s*=(.*)\z"
+        :up03-min       #"module\.repo\.version\.min\s*=(.*)\z"
+        :up03-max       #"module\.repo\.version\.max\s*=(.*)\z"
+        :up04           #"module\.edition\s*=(.*)\z"
       }
     :java {
         :stb08-stb09    #"(?:^|\s)synchronized(?:\s|$)"
@@ -122,19 +122,19 @@

 (defn- alfresco-min-versions
   [content-index]
-  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :repo-min (:regex-id %)) content-index)))
+  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :up03-min (:regex-id %)) content-index)))
         message (s/join "," matches)]
     { "AlfrescoVersionMin" (if (empty? message) "Not specified" message) }))

 (defn- alfresco-max-versions
   [content-index]
-  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :repo-max (:regex-id %)) content-index)))
+  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :up03-max (:regex-id %)) content-index)))
         message (s/join "," matches)]
     { "AlfrescoVersionMax" (if (empty? message) "Not specified" message) }))

 (defn- alfresco-editions
   [content-index]
-  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :alf-edition (:regex-id %)) content-index)))
+  (let [matches (distinct (map #(second (first (:re-seq %))) (filter #(= :up04 (:regex-id %)) content-index)))
         message (s/join "," matches)]
     { "AlfrescoEditions" (if (empty? message) "Not specified" message) }))

@@ -197,14 +197,14 @@
                          "STB08"
                          "Uses of synchronized"
                          true
-                         "The technology does not synchronized.")
+                         "The technology does not synchronize.")
     (standard-validation source
                          content-index
                          :stb08-stb09
                          "STB09"
                          "Uses of synchronized"
                          true
-                         "The technology does not synchronized.")))
+                         "The technology does not synchronize.")))

 (defn- stb19-stb20-web-script-transaction-setting
   [source content-index]
@@ -232,7 +232,8 @@
                        "PERF02"
                        "Indexed content model properties"
                        true
-                       "The technology does not index any content model properties."))
+                       "The technology does not index any content model properties."
+                       #(if (empty? %) true nil)))

 (defn- perf03-dont-store-property-values
   [source content-index]
@@ -274,6 +275,29 @@
     (declare-result "UP01"
                     (empty? matches)
                     (if (empty? matches) "The technology does not extend the Explorer UI." message))))
+
+(defn- up03-repo-min-max
+  [source content-index]
+  (let [repo-mins (distinct (map #(second (first (:re-seq %))) (filter #(= :up03-min (:regex-id %)) content-index)))
+        repo-maxs (distinct (map #(second (first (:re-seq %))) (filter #(= :up03-max (:regex-id %)) content-index)))]
+    (declare-result "UP03"
+                    (or (not (empty? repo-mins)) (not (empty? repo-maxs)))
+                    (s/join "\n"
+                      (filter identity
+                              (vector
+                                (if (not-empty repo-mins)                       (str "module.repo.version.min(s): " (s/join "," repo-mins)))
+                                (if (not-empty repo-maxs)                       (str "module.repo.version.max(s): " (s/join "," repo-maxs)))
+                                (if (and (empty? repo-mins) (empty? repo-maxs)) "The technology does not specify module.editions in its module.properties file(s).")))))))
+
+(defn- up04-module-editions
+  [source content-index]
+  (let [matches  (distinct (map #(second (first (:re-seq %))) (filter #(= :up04 (:regex-id %)) content-index)))
+        editions (s/join "," matches)]
+    (declare-result "UP04"
+                    (not (empty? matches))
+                    (if (empty? matches)
+                      "The technology does not specify module.editions in its module.properties file(s)."
+                      (str "module.editions:" editions)))))

 (defn validate
   "Runs all source-based validations."
@@ -296,6 +320,8 @@
          (sec03-none-authentication-in-web-scripts   source content-index)
          (sec05-use-of-eval                          source content-index)
          (up01-explorer-ui-extension                 source file-index)
+         (up03-repo-min-max                          source content-index)
+         (up04-module-editions                       source content-index)
        )
        (stb08-stb09-use-of-synchronized            source content-index)
        (stb19-stb20-web-script-transaction-setting source content-index)


fix ui logic bug (#937)

fix ui logic bug (#937)

--- src/cljs/main/broadfcui/page/workspace/summary/tab.cljs
+++ src/cljs/main/broadfcui/page/workspace/summary/tab.cljs
@@ -243,14 +243,13 @@
                              :onClick #(this :-lock-or-unlock isLocked)}])
            (when (and owner? (not editing?))
              (let [published? (:library:published library-attributes)
-                   publisher? (and curator? (or catalog-with-read? owner?))
-                   published-and-publisher? (and published? publisher?)]
+                   publisher? (and curator? (or catalog-with-read? owner?))]
                [SidebarButton {:style :light :margin :top :color (if isLocked :text-lighter :exception-state)
                                :text "Delete" :icon :delete
                                :data-test-id "delete-workspace-button"
                                :disabled? (cond isLocked
                                                 "This workspace is locked."
-                                                (not published-and-publisher?)
+                                                (and published? (not publisher?))
                                                 {:type :error :header "Alert" :icon-color :warning-state
                                                  :text [:div {}
                                                         [:p {:style {:margin 0}}


upgrade run task to support multiple microservices

--- src/migae/boot_gae.clj
+++ src/migae/boot_gae.clj
@@ -1267,14 +1267,134 @@
          identity)
      )))

+;; (boot/deftask run
+;;   "Run devappserver"
+;;   [;; DevAppServerMain.java
+;;    u unit-test bool "run in unit-testing config"
+;;    _ sdk-server VAL str "--server"
+;;    _ http-address VAL str "The address of the interface on the local machine to bind to (or 0.0.0.0 for all interfaces).  Default: 127.0.0.1"
+;;    _ http-port VAL int "The port number to bind to on the local machine. Default: 8080"
+;;    _ disable-update-check bool "Disable the check for newer SDK versions. Default: true"
+;;    _ generated-dir DIR str "Set the directory where generated files are created."
+;;    ;; GENERATED_DIR_PROPERTY = "appengine.generated.dir";
+;;    _ default-gcs-bucket VAL str  "Set the default Google Cloud Storage bucket name."
+;;    _ instance-port bool "--instance_port"
+;;    _ disable-filesapi-warning bool "-disable_filesapi_warning"
+;;    _ enable-filesapi bool "--enable_filesapi"
+
+;;    ;; SharedMain.java
+;;    _ sdk-root PATH str "--sdk_root"
+;;    _ disable-restricted-check bool "--disable_restricted_check"
+;;    _ external-resource-dir VAL str "--external_resource_dir"
+;;    _ allow-remote-shutdown bool "--allow_remote_shutdown"
+;;    a java-agent bool "use javaagaent (default: false).\n\t\tCAVEAT: setting to true may result in a dramatic increase in servlet startup time; setting false removes some security checks" ;; --no_java_agent
+
+;;    ;; Kickstart.java
+;;    _ address VAL str "address; default: localhost"
+;;    _ generate-war bool "--generate_war"
+;;    _ generated-war-dir PATH str "Set the directory where generated files are created."
+;;    _ jvm-flags FLAG #{str} "--jvm_flags"
+;;    _ start-on-first-thread bool "--startOnFirstThread"
+;;    _ enable-jacoco bool "--enable_jacoco"
+;;    _ jacoco-agent-jar VAL str"--jacoco_agent_jar"
+;;    _ jacoco-agent-args VAL str"--jacoco_agent_args"
+;;    _ jacoco-exec VAL str "--jacoco_exec"
+
+;;    _ modules MODULES edn "modules map"
+
+;;    s servlet bool "servlet app DEPRECATED"
+;;    v verbose bool "verbose"]
+
+;;   (boot/with-pre-wrap [fileset]
+;;     (let [appengine-edn-fs (->> fileset
+;;                                 boot/input-files
+;;                                 (boot/by-name [appengine-edn]))
+
+;;           appengine-edn-f (condp = (count appengine-edn-fs)
+;;                             0 (throw (Exception. appengine-edn " file not found"))
+;;                             1 (first appengine-edn-fs)
+;;                             (throw (Exception. (str "Only one " appengine-edn " file allowed"))))
+
+;;           appengine-config-map (-> (boot/tmp-file appengine-edn-f) slurp read-string)
+
+
+;;           ;; (println "*OPTS*: " *opts*)
+;;           args (->args *opts*)
+;;           ;; _ (println "ARGS: " args)
+;;           ;; jargs (into-array String (conj jargs "build/exploded-app"))
+
+;;           target-dir (if unit-test "target/default" "target") ;; (get-target-dir fileset servlet))
+;;           #_(if servlet "target"
+;;                                     (if (-> appengine-config-map :services)
+;;                                       "target/default"
+;;                                       (str "target/" (-> appengine-config-map :module :name))))
+
+;;           checkout-vec (-> (boot/get-env) :checkouts)
+;;           cos (map #(assoc (apply hash-map %) :coords [(first %) (second %)]) checkout-vec)
+;;           default-mod (filter #(or (:default %) (not (:module %))) cos)
+;;           _ (if (> (count default-mod) 1)
+;;               (throw (Exception. "Only one default module allowed" (count default-mod))))
+
+
+;;           mod-ports (remove nil?
+;;                             (into [] ;; (for [[mod port] (-> (boot/get-env) :gae :modules)]
+;;                                   (map #(if (:module %)
+;;                                           (str "--jvm_flag=-Dcom.google.appengine.devappserver_module."
+;;                                                (:module %)
+;;                                                ".port="
+;;                                                (str (:port %)))
+;;                                           nil)
+;;                                        cos)))
+;;                             ;; modules))
+
+;;           _ (println "MOD PORTS: " mod-ports)
+
+;;           http-port (or http-port (if-let [p (:port (first default-mod))] p nil))
+;;           _ (println "HTTP-PORT: " http-port)
+
+;;           jvm-flags (for [flag jvm-flags] (str "--jvm_flag=" flag))
+;;           jargs (concat ["com.google.appengine.tools.development.DevAppServerMain"
+;;                          (str "--sdk_root=" (:sdk-root config-map))
+;;                          "--jvm_flag=-Dappengine.fullscan=1"]
+;;                         mod-ports
+;;                         jvm-flags
+;;                         (if disable-restricted-check ["--disable_restricted_check"])
+;;                         ;;(if (not java-agent) ["--no_java_agent"])
+;;                         (if http-port [(str "--port=" http-port)])
+;;                         (if http-address [(str "--address=" http-address)])
+;;                         ;; KickStarter gets the abs path only for the last arg (the target dir)
+;;                         ;; to support multiple services we need to call (.getAbsolutePath (io/file dir))
+;;                         [target-dir])
+;;           jargs (into-array String jargs)]
+
+;;       (if verbose
+;;         (do (println "jargs:")
+;;             (doseq [a jargs] (println "\t" a))))
+;;       (validate-tools-api-jar)
+;;       ;; (println "system classpath: " (System/getenv "java.class.path"))
+
+;;       (let [class-loader (-> (Thread/currentThread) (.getContextClassLoader))
+;;             cl (.getParent class-loader)
+;;             ;; _ (println "class-loader: " class-loader (type class-loader))
+;;             kick-start (Class/forName "com.google.appengine.tools.KickStart" true class-loader)
+;;             ]
+;;         ;; (println "kick-start: " kick-start (type kick-start))
+;;         (def method (first (filter #(= (. % getName) "main") (. kick-start getMethods))))
+;;         ;;(let [parms (.getParameterTypes method)] (println "param types: " parms))
+;;         (def invoke-args (into-array Object [jargs]))
+;;         (. method invoke nil invoke-args)
+;;         ))
+;;     fileset))
+
 (boot/deftask run
-  "Run devappserver"
+  "Run cloud devserver"
   [;; DevAppServerMain.java
+   ;;w wardirs WARDIRS [str] "wardirs"
    u unit-test bool "run in unit-testing config"
    _ sdk-server VAL str "--server"
    _ http-address VAL str "The address of the interface on the local machine to bind to (or 0.0.0.0 for all interfaces).  Default: 127.0.0.1"
    _ http-port VAL int "The port number to bind to on the local machine. Default: 8080"
-   _ disable-update-check bool "Disable the check for newer SDK versions. Default: true"
+
    _ generated-dir DIR str "Set the directory where generated files are created."
    ;; GENERATED_DIR_PROPERTY = "appengine.generated.dir";
    _ default-gcs-bucket VAL str  "Set the default Google Cloud Storage bucket name."
@@ -1289,7 +1409,7 @@
    _ allow-remote-shutdown bool "--allow_remote_shutdown"
    a java-agent bool "use javaagaent (default: false).\n\t\tCAVEAT: setting to true may result in a dramatic increase in servlet startup time; setting false removes some security checks" ;; --no_java_agent

-   ;; Kickstart.java
+   ;; Kickstart.java, DevAppServerMain.java
    _ generate-war bool "--generate_war"
    _ generated-war-dir PATH str "Set the directory where generated files are created."
    _ jvm-flags FLAG #{str} "--jvm_flags"
@@ -1299,30 +1419,18 @@
    _ jacoco-agent-args VAL str"--jacoco_agent_args"
    _ jacoco-exec VAL str "--jacoco_exec"

-   _ modules MODULES edn "modules map"
+   _ services SERVICES edn "services map, keys :service, :port"

    s servlet bool "servlet app DEPRECATED"
    v verbose bool "verbose"]

   (boot/with-pre-wrap [fileset]
-    (let [appengine-edn-fs (->> fileset
-                                boot/input-files
-                                (boot/by-name [appengine-edn]))
-
-          appengine-edn-f (condp = (count appengine-edn-fs)
-                            0 (throw (Exception. appengine-edn " file not found"))
-                            1 (first appengine-edn-fs)
-                            (throw (Exception. (str "Only one " appengine-edn " file allowed"))))
-
-          appengine-config-map (-> (boot/tmp-file appengine-edn-f) slurp read-string)
-
-
-          ;; (println "*OPTS*: " *opts*)
+    (let [;; (println "*OPTS*: " *opts*)
           args (->args *opts*)
           ;; _ (println "ARGS: " args)
           ;; jargs (into-array String (conj jargs "build/exploded-app"))

-          target-dir (if unit-test "target/default" "target") ;; (get-target-dir fileset servlet))
+          ;;target-dir (if unit-test "target/default" "target") ;; (get-target-dir fileset servlet))
           #_(if servlet "target"
                                     (if (-> appengine-config-map :services)
                                       "target/default"
@@ -1334,33 +1442,42 @@
           _ (if (> (count default-mod) 1)
               (throw (Exception. "Only one default module allowed" (count default-mod))))

-
-          mod-ports (remove nil?
-                            (into [] ;; (for [[mod port] (-> (boot/get-env) :gae :modules)]
-                                  (map #(if (:module %)
-                                          (str "--jvm_flag=-Dcom.google.appengine.devappserver_module."
-                                               (:module %)
-                                               ".port="
-                                               (str (:port %)))
-                                          nil)
-                                       cos)))
+          ;; FIXME: get service name from config/appengine.edn for each service?
+          service-ports (remove nil?
+                            (into [] (map #(if (:name %)
+                                             (str "--jvm_flag=-Dcom.google.appengine.devappserver_module."
+                                                  (:name %)
+                                                  ".port="
+                                                  (str (:port %)))
+                                             nil)
+                                          services)))
                             ;; modules))

-          _ (println "MOD PORTS: " mod-ports)
+          wardirs (remove nil?
+                          (into [] (map #(if (:wardir %)
+                                           (.getAbsolutePath (io/file (:wardir %)))
+                                           nil)
+                                          services)))
+
+          _ (println "WARDIRS: " wardirs)

           http-port (or http-port (if-let [p (:port (first default-mod))] p nil))
           _ (println "HTTP-PORT: " http-port)

           jvm-flags (for [flag jvm-flags] (str "--jvm_flag=" flag))
+          ;;war-dirs (for [wardir wardirs] (.getAbsolutePath (io/file wardir)))
+
           jargs (concat ["com.google.appengine.tools.development.DevAppServerMain"
-                         (str "--sdk_root=" (:sdk-root config-map))]
-                        mod-ports
+                         (str "--sdk_root=" (:sdk-root config-map))
+                         ;; "--jvm_flag=-Dappengine.fullscan.seconds=1"
+                         ]
+                        service-ports
                         jvm-flags
                         (if disable-restricted-check ["--disable_restricted_check"])
-                        (if (not java-agent) ["--no_java_agent"])
+                        ;; (if (not java-agent) ["--no_java_agent"])
                         (if http-port [(str "--port=" http-port)])
                         (if http-address [(str "--address=" http-address)])
-                        [target-dir])
+                        wardirs)
           jargs (into-array String jargs)]

       (if verbose


Revert "CMR-4152: Request logs are still logging the incorrect time in NGAP. (#105)"

This reverts commit 0bd54b8dfbd44b180dadd428e6206e974c1a9823.

--- common-lib/src/cmr/common/api/web_server.clj
+++ common-lib/src/cmr/common/api/web_server.clj
@@ -9,6 +9,7 @@
    [ring.adapter.jetty :as jetty])
   (:import
    (java.io ByteArrayInputStream InputStream)
+   (java.util TimeZone)
    (org.eclipse.jetty.server Server NCSARequestLog Connector HttpConnectionFactory)
    (org.eclipse.jetty.server.handler RequestLogHandler)
    (org.eclipse.jetty.servlets.gzip GzipHandler)))
@@ -41,9 +42,9 @@
   ONE_MB)

 (def MAX_REQUEST_BODY_SIZE
- "The maximum size of a request to body. This is set to 5 MB prevent large requests coming in
+ "The maximum size of a request to body. This is set to 500KB prevent large requests coming in
   that cause out of memory exceptions. A large ISO document like AST_L1A can be 120K characters which
-  would take up about 240KB in Java."
+  would take up about 240KB in Java. This value is set to 5 MB."
  (* 5 ONE_MB))

 (defn- routes-fn-verify-size
@@ -85,19 +86,6 @@
                                                  (+ total-bytes-read bytes-read)))))
               (recur (+ total-bytes-read bytes-read)))))))))

-(defconfig time-zone
-  "The time zone where the web server is running. Needed because getting the time zone using
-   java.util.TimeZone is not returning the correct information on EC2 instances running in NGAP.
-
-   The default value of \"America/New_York\" will work for all of our NGAP EC2 instances (they are
-   all in US_EAST_1) and for developers working on the east coast.
-
-   If you enable access logging locally and need to set a different time zone you can figure out
-   the string to set by running:
-
-   (.getID (java.util.TimeZone/getDefault)))"
-  {:default "America/New_York"})
-
 (defn create-access-log-handler
   "Setup access logging for each application. Access log entries will go to stdout similar to
   application logging. As a result the access log entries will be in the same log as the
@@ -108,7 +96,6 @@
     (.setRequestLog
       (doto (NCSARequestLog.)
         (.setLogLatency true)
-        (.setLogTimeZone (time-zone))
         (.setLogDateFormat "yyyy-MM-dd hh:mm:ss.SSS")))))

 (defn- create-gzip-handler


one more thing to parser

one more thing to parser


component to render a single value

component to render a single value

--- src/main/cljs/emotions_demo/client.cljs
+++ src/main/cljs/emotions_demo/client.cljs
@@ -19,7 +19,10 @@
   [{:keys [history] :as old-state}
    {:keys [sv valence arousal percepts motivations]}]
   (let [cur-state (-> sv (assoc :valence valence) (assoc :arousal arousal))]
-    {:motivations motivations :cur-state cur-state :history {}}
+    {:motivations motivations
+     :cur-state cur-state
+     :history
+     (reduce (fn [a k] (assoc a k (conj (k history []) (k cur-state)))) {} (keys cur-state))}
     ))

 (defn bind-state [{:keys [ws data]}]
@@ -32,19 +35,29 @@
                                      (reader/read-string update))))
       (recur))))

+(defn single-value [{:keys [data] :as c} owner
+                    {:keys [label path] :as opts}]
+  (reify
+    om/IRender
+    (render [_]
+      (let [value (get-in data path)]
+        (dom/div #js {:className "single_value"}
+                 (dom/span #js {:className "label"} label)
+                 (dom/span #js {:className "value"} value))))))
+
 (defn valence-arousal [{:keys [data] :as c} owner opts]
   (reify
     om/IRender
     (render [_]
-      (let [valence (get-in data [:cur-state :valence])
-            arousal (get-in data [:cur-state :arousal])]
-        (dom/div #js {:className "valence_arousal"}
-                 (dom/div nil
-                          (dom/span nil "Valence")
-                          (dom/span nil valence))
-                 (dom/div nil
-                          (dom/span nil "Arousal")
-                          (dom/span nil arousal)))))))
+      (dom/div #js {:className "valence_arousal"}
+               (om/build single-value c
+                         {:opts
+                          {:label "Valence"
+                           :path [:cur-state :valence]}})
+               (om/build single-value c
+                         {:opts
+                          {:label "Arousal"
+                           :path [:cur-state :arousal]}})))))

 (defn satisfaction-vector [app owner opts]
   (reify
@@ -60,12 +73,13 @@
       (dom/div #js {:className "motivations"}
                (dom/span nil "motivations")))))

-(defn history [app owner opts]
+(defn history [{:keys [data] :as c} owner opts]
   (reify
     om/IRender
     (render [_]
-      (dom/div #js {:className "history"}
-               (dom/span nil "history")))))
+      (let [history (:history data)]
+        (dom/div #js {:className "history"}
+                 (dom/span nil "history"))))))

 (defn emotion-display-app [app owner]


Adding capture-reveal to the namespaces available in the REPL.

--- dev/user.clj
+++ dev/user.clj
@@ -11,7 +11,8 @@
             [vdd-core.core :as vdd])
   (:use [clojure.test :only [run-all-tests]]
         [clojure.repl]
-        [alex-and-georges.debug-repl]))
+        [alex-and-georges.debug-repl]
+        [cmr.common.dev.capture-reveal]))

 (def system nil)


Change call signature of frame constructors and add missing frame constructors.

--- src/postal/frames.cljc
+++ src/postal/frames.cljc
@@ -6,66 +6,89 @@

 (defn frame
   "A generic frame constructor."
-  ([command headers]
-   (frame command headers ""))
-  ([command headers body]
+  ([command]
+   (frame command "" {}))
+  ([command body]
+   (frame command body ""))
+  ([command body headers]
    (Frame. command headers body)))

 (defn query
   "A QUERY frame constructor."
-  ([headers]
-   (query headers ""))
-  ([headers body]
-   (frame :query headers body)))
+  ([body]
+   (query body {}))
+  ([body headers]
+   (frame :query body headers)))

 (defn novelty
   "A NOVELTY frame constructor."
-  ([headers]
-   (novelty headers ""))
-  ([headers body]
-   (frame :novelty headers body)))
+  ([body]
+   (novelty body {}))
+  ([body headers]
+   (frame :novelty body headers)))

 (defn subscribe
   "A SUBSCRIBE frame constructor."
-  ([headers]
-   (subscribe headers ""))
-  ([headers body]
-   (frame :subscribe headers body)))
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :subscribe body headers)))

 (defn unsubscribe
   "A UNSUBSCRIBE frame constructor."
-  ([headers]
-   (unsubscribe headers ""))
-  ([headers body]
-   (frame :unsubscribe headers body)))
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :unsubscribe body headers)))

 (defn publish
   "A PUBLISH frame constructor."
-  ([headers]
-   (publish headers ""))
-  ([headers body]
-   (frame :publish headers body)))
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :publish body headers)))

 (defn put
   "A PUT frame constructor."
-  ([headers]
-   (put headers ""))
-  ([headers body]
-   (frame :put headers body)))
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :put body headers)))

 (defn take
   "A TAKE frame constructor."
-  ([headers]
-   (take headers ""))
-  ([headers body]
-   (frame :take headers body)))
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :take body headers)))

 (defn consume
-  "A TAKE frame constructor."
-  ([headers]
-   (consume headers ""))
-  ([headers body]
-   (frame :consume headers body)))
+  "A CONSUME frame constructor."
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :consume body headers)))
+
+(defn response
+  "A RESPONSE frame constructor."
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :response body headers)))
+
+(defn message
+  "A MESSAGE frame constructor."
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :message body headers)))
+
+(defn error
+  "A ERROR frame constructor."
+  ([body]
+   (subscribe body {}))
+  ([body headers]
+   (frame :error body headers)))

 (defn frame?
   "Return true if a provided frame is a true
@@ -86,3 +109,10 @@
   [frame]
   (and (frame? frame)
        (= (:command frame) :response)))
+
+(defn message?
+  "Return true if a provided frame is a true
+  instance of Frame and it is of message type."
+  [frame]
+  (and (frame? frame)
+       (= (:command frame) :message)))


string replacements need to be applied in order and include '.' to handle javax.sql.Timestamp

--- dada-core/src/main/clojure/org/dada/core.clj
+++ dada-core/src/main/clojure/org/dada/core.clj
@@ -110,17 +110,19 @@
 (defmethod attribute-key Date [#^Date date] (attribute-key (str "attribute" date)))
 (defmethod attribute-key clojure.lang.Keyword [#^Keyword keyword] (attribute-key (name keyword)))

-(def string-replacements {
+(def string-replacements
+     (array-map
      "_" "_underscore_"
      " " "_space_"
      ":" "_colon_"
+     "." "_fullstop_"
      "*" "_asterisk_"
      "+" "_plus_"
      "-" "_minus_"
      "/" "_divide_"
      "(" "_openroundbracket_"
      ")" "_closeroundbracket_"
-     })
+     ))

 (defmethod attribute-key String [#^String string]
   (reduce (fn [#^String string [#^String key #^String value]] (.replace string key value))


Refactor continuation analysis to determine which values are used?

--- src/skylark/continuation_analysis.clj
+++ src/skylark/continuation_analysis.clj
@@ -56,11 +56,15 @@
 (defn env-either [E E'] (env-combine f-either E E'))
 (defn env-both [E E'] (env-combine f-both E E'))

+;;(def value-env {:effects {:value :linear}})
+;;(defn &using-value
+;;  ([&x fural] (&let [x &x] (with-meta x (assoc-in (meta x) [:capturing :effects :value] fural))))
+;;  ([&x] (&using-value &x true)))

 (declare &A &A* &Aargs)

 (defn &A* [xs] (&let [r (&map &A (reverse xs))] (vec (reverse r))))
-(defn &Aargs [x]
+(defn &Aargs [x] ;; &using-value everywhere
   (if-let [[args star-arg more-args kw-arg] x]
     (&let [kw-arg (&A kw-arg)
            more-args (&A* more-args)
@@ -68,10 +72,6 @@
            args (&A* args)]
           [(vec args) star-arg (vec more-args) kw-arg])
     &nil))
-
-;;(defn &use-value [E] [nil (assoc-in E [:effects :value] :linear)])
-;;(defn &ignore-value [E] [nil (assoc-in E [:effects :value] false)])
-;;(def value-env {:effects {:value :linear}})

 (defn &A [x]
   ;; NB: reverse order matters in listing effect capturing
@@ -82,7 +82,7 @@
         [nil] &nil
         [[:id s]] (&do (&update-in [:vars s] f-once-more) (&r x))
         [[:bind [:id s] :as n a]] (&let [_ (&assoc-in [:vars s] false)
-                                         a (&A a)
+                                         a (&A a) ;; (&using-value ...)
                                          * (&r [:bind n a])])
         [[:unbind [:id s]]] (&do (&assoc-in [:vars s] false) (&r x))
         [[:constant c]] (&r x)


fix cumulative sum

fix cumulative sum

--- src/metabase/driver/query_processor.clj
+++ src/metabase/driver/query_processor.clj
@@ -161,44 +161,39 @@

 ;; ### PREPROCESS-CUMULATIVE-SUM

-;;; TODO !
-;; (defn preprocess-cumulative-sum
-;;   "Rewrite queries containing a cumulative sum (`cum_sum`) aggregation to simply fetch the values of the aggregate field instead.
-;;    (Cumulative sum is a special case; it is implemented in post-processing)."
-;;   [{[ag-type ag-field :as aggregation] :aggregation, breakout-fields :breakout, order-by :order_by, :as query}]
-;;   (let [cum-sum?                    (= ag-type "cum_sum")
-;;         cum-sum-with-breakout?      (and cum-sum?
-;;                                          (not (empty? breakout-fields)))
-;;         cum-sum-with-same-breakout? (and cum-sum-with-breakout?
-;;                                          (= (count breakout-fields) 1)
-;;                                          (= (first breakout-fields) ag-field))]
-
-;;     ;; Cumulative sum is only applicable if it has breakout fields
-;;     ;; For these, store the cumulative sum field under the key :cum_sum so we know which one to sum later
-;;     ;; Cumulative summing happens in post-processing
-;;     (cond
-;;       ;; If there's only one breakout field that is the same as the cum_sum field, re-write this as a "rows" aggregation
-;;       ;; to just fetch all the values of the field in question.
-;;       cum-sum-with-same-breakout? (-> query
-;;                                       (dissoc :breakout)
-;;                                       (assoc :cum_sum     ag-field     ; TODO - move this to *internal-context* instead?
-;;                                              :aggregation ["rows"]
-;;                                              :fields      [ag-field]))
-
-;;       ;; Otherwise if we're breaking out on different fields, rewrite the query as a "sum" aggregation
-;;       cum-sum-with-breakout? (assoc query
-;;                                     :cum_sum     ag-field
-;;                                     :aggregation ["sum" ag-field])
-
-;;       ;; Cumulative sum without any breakout fields should just be treated the same way as "sum". Rewrite query as such
-;;       cum-sum? (assoc query
-;;                       :aggregation ["sum" ag-field])
-
-;;       ;; Otherwise if this isn't a cum_sum query return it as-is
-;;       :else               query)))
-
-(defn preprocess-cumulative-sum [query]
-  query)
+(defn preprocess-cumulative-sum
+  "Rewrite queries containing a cumulative sum (`cum_sum`) aggregation to simply fetch the values of the aggregate field instead.
+   (Cumulative sum is a special case; it is implemented in post-processing)."
+  [{{{ag-type :aggregation-type, ag-field :field} :aggregation, breakout-fields :breakout, order-by :order_by} :query, :as query}]
+  (let [cum-sum?                    (= ag-type :cumulative-sum)
+        cum-sum-with-breakout?      (and cum-sum?
+                                         (seq breakout-fields))
+        cum-sum-with-same-breakout? (and cum-sum-with-breakout?
+                                         (= (count breakout-fields) 1)
+                                         (= (first breakout-fields) ag-field))]
+
+    ;; Cumulative sum is only applicable if it has breakout fields
+    ;; For these, store the cumulative sum field under the key :cumulative-sum so we know which one to sum later
+    ;; Cumulative summing happens in post-processing
+    (cond
+      ;; If there's only one breakout field that is the same as the cum_sum field, re-write this as a "rows" aggregation
+      ;; to just fetch all the values of the field in question.
+      cum-sum-with-same-breakout? (update-in query [:query] #(-> %
+                                                                 (dissoc :breakout)
+                                                                 (assoc :cumulative-sum ag-field
+                                                                        :aggregation    (expand/map->Aggregation {:aggregation-type :rows})
+                                                                        :fields         [ag-field])))
+
+      ;; Otherwise if we're breaking out on different fields, rewrite the query as a "sum" aggregation
+      cum-sum-with-breakout? (-> query
+                                 (assoc-in [:query :cumulative-sum] ag-field)
+                                 (assoc-in [:query :aggregation]    (expand/map->Aggregation {:aggregation-type :sum, :field ag-field})))
+
+      ;; Cumulative sum without any breakout fields should just be treated the same way as "sum". Rewrite query as such
+      cum-sum? (assoc-in query [:query :aggregation] (expand/map->Aggregation {:aggregation-type :sum, :field ag-field}))
+
+      ;; Otherwise if this isn't a cum_sum query return it as-is
+      :else               query)))

 ;; # POSTPROCESSOR
@@ -208,12 +203,12 @@
 (defn post-process-cumulative-sum
   "Cumulative sum the values of the aggregate `Field` in RESULTS."
   {:arglists '([query results])}
-  [{cum-sum-field :cum_sum, :as query} {rows :rows, cols :cols, :as results}]
+  [{cum-sum-field :cumulative-sum, :as query} {rows :rows, cols :cols, :as results}]
   (if-not cum-sum-field results
           (let [ ;; Determine the index of the field we need to cumulative sum
                 cum-sum-field-index (->> cols
                                          (u/indecies-satisfying #(or (= (:name %) "sum")
-                                                                     (= (:id %) cum-sum-field)))
+                                                                     (= (:id %) (:field-id cum-sum-field))))
                                          first)
                 _                   (assert (integer? cum-sum-field-index))
                 ;; Now make a sequence of cumulative sum values for each row


RS & AB | #0 | Add print to try and debug obscure bug on /drafts page for 'write proposals' objective

--- src/objective8/templates/draft_list.clj
+++ src/objective8/templates/draft_list.clj
@@ -34,6 +34,7 @@

 (defn drafts-wrapper [{:keys [translations data user] :as context}]
   (let [drafts (:drafts data)
+        _ (prn "DRAFTS" drafts)
         objective (:objective data)]
     (html/at drafts-wrapper-snippet
              [:.clj-latest-draft-wrapper] (if (empty? drafts)
@@ -52,7 +53,8 @@
              [:.clj-writer-item-list] (html/content (pf/writer-list context)))))

 (defn draft-list-page [{:keys [translations data doc] :as context}]
-  (let [objective (:objective data)]
+  (let [objective (:objective data)
+        _ (prn "OBJECTIVE" objective)]
     (apply str
            (html/emit*
              (tf/translate context


Switch the messenger inbound-ch to a sliding buffer

--- src/onyx/messaging/messenger_buffer.clj
+++ src/onyx/messaging/messenger_buffer.clj
@@ -1,5 +1,5 @@
 (ns ^:no-doc onyx.messaging.messenger-buffer
-  (:require [clojure.core.async :refer [chan >!! <!! thread alts!! close!]]
+  (:require [clojure.core.async :refer [chan >!! <!! thread alts!! close! sliding-buffer]]
             [com.stuartsierra.component :as component]
             [taoensso.timbre :as timbre]))

@@ -9,7 +9,7 @@
   (start [component]
     (taoensso.timbre/info "Starting Messenger Buffer")

-    (let [inbound-ch (chan (or (:onyx.messenger/inbound-capacity opts) 20000))]
+    (let [inbound-ch (chan (sliding-buffer (or (:onyx.messenger/inbound-capacity opts) 20000)))]
       (assoc component :inbound-ch inbound-ch)))

   (stop [component]


fix emoji keyboard height for ios devices (#12759)

--- src/status_im/ui/components/emoji_thumbnail/styles.cljs
+++ src/status_im/ui/components/emoji_thumbnail/styles.cljs
@@ -1,5 +1,6 @@
 (ns status-im.ui.components.emoji-thumbnail.styles
   (:require [quo.design-system.colors :as colors]
+            [status-im.utils.platform :as platform]
             [status-im.ui.components.emoji-thumbnail.utils :as emoji-utils]))

 (defn emoji-thumbnail-icon [color size]
@@ -24,7 +25,8 @@

 (def emoji-thumbnail-preview-size 60)

-(def emoji-picker-upper-components-size 350)
+(def emoji-picker-upper-components-size
+  (if platform/android? 350 405))

 (defn emoji-picker-gray-color []
   (if (colors/dark?) "#c3c3bc99" "#3C3C4399"))


Cast long to int

Cast long to int

--- src/puppeteer/domain/usecase/deploy.clj
+++ src/puppeteer/domain/usecase/deploy.clj
@@ -79,7 +79,7 @@
                     [(HTTPIngressPath.
                        (IngressBackend.
                          service-name
-                         80)
+                         (int 80))
                        "/*")])))))))))

 (defn apply


(PDB-4550) Always analyze small-tables at startup

This shouldn't be expensive and will make sure that these tables are
always analyzed, since we had a good long period where the
post-migration analysis infrastructure wasn't actually working.

See 45f3d233eb7f9b473ce6faa167a4d8beb5f7d490 for additional
information.

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -1660,6 +1660,10 @@
         true)
       (do
         (log/info (trs "There are no pending migrations"))
+        ;; Always analyze these since we had a good long period where
+        ;; the post-migration analysis above wasn't actually working,
+        ;; and since this shouldn't be expensive.
+        (analyze small-tables)
         false))))

 (defn migrate! [db-connection-pool]


make logging atomic

make logging atomic

--- src/spq/lib.clj
+++ src/spq/lib.clj
@@ -1,5 +1,6 @@
 (ns spq.lib
   (:require [cheshire.core :as json]
+            [clojure.stacktrace :as st]
             [clojure.core.async :as a]
             [clojure.java.shell :as sh]
             [confs.core :as confs :refer [conf]]
@@ -20,22 +21,36 @@
   (timbre/merge-config!
    {:appenders
     {:println
-     {:fn (if short-format
-            #(let [{:keys [msg_ ?err_]} %]
-               (println (force msg_)
-                        (if-let [err (force ?err_)]
-                          (str "\n" (timbre/stacktrace err))
-                          "")))
-            #(let [{:keys [msg_ hostname_ timestamp_ instant level ?ns-str ?err_]} %]
-               (println
-                (.toString (.toInstant instant))
-                level
-                (force ?ns-str)
-                (force hostname_)
-                (force msg_)
-                (if-let [err (force ?err_)]
-                  (str "\n" (timbre/stacktrace err))
-                  ""))))}}}))
+     {:fn (let [atomic-print (fn [x]
+                               (print x)
+                               (flush))]
+            (if short-format
+              #(let [{:keys [msg_ ?err_]} %]
+                 (atomic-print
+                  (str
+                   (force msg_)
+                   " "
+                   (if-let [err (force ?err_)]
+                     (str "\n" (st/print-stack-trace err))
+                     "")
+                   "\n")))
+              #(let [{:keys [msg_ hostname_ timestamp_ instant level ?ns-str ?err_]} %]
+                 (atomic-print
+                  (str
+                   (.toString (.toInstant instant))
+                   " "
+                   level
+                   " "
+                   (force ?ns-str)
+                   " "
+                   (force hostname_)
+                   " "
+                   (force msg_)
+                   " "
+                   (if-let [err (force ?err_)]
+                     (str "\n" (st/print-stack-trace err))
+                     "")
+                   "\n")))))}}}))

 (defn shutdown
   []


Add a case covering local rebinding

Add a case covering local rebinding

Make sure that for nested definitions of bar, the correct one is the one
used after lambda lifting occurs.

--- test/oxcart/passes/lambda_lift_test.clj
+++ test/oxcart/passes/lambda_lift_test.clj
@@ -65,6 +65,23 @@
                (ll/lift-lambdas {})
                (eclj/emit-clojure {})
                (eval)))))
+
+  ;; Local rebinding case
+  ;; --------------------
+  (let [case '(let [x 1]
+                (letfn [(bar [z] (+ x z))]
+                  (letfn [(bar [z] (* (wat z) 3))
+                          (wat [z] (* 3 z))]
+                    ((juxt bar wat) x))))]
+
+    (is (= (eval case)
+           (oxcart/eval case)
+           (-> (let [forms (atom {})]
+                 (oxcart/eval case {:forms forms})
+                 @forms)
+               (ll/lift-lambdas {})
+               (eclj/emit-clojure {})
+               (eval)))))

   ;; Closure of closures case
   ;; ------------------------


Adds addtup

Adds addtup


CMR-3044: Removed unused imports

CMR-3044: Removed unused imports

--- message-queue-lib/src/cmr/message_queue/queue/sqs.clj
+++ message-queue-lib/src/cmr/message_queue/queue/sqs.clj
@@ -18,11 +18,7 @@
             [cmr.common.util :as u]
             [cmr.message-queue.config :as config]
             [cmr.message-queue.services.queue :as queue])
-  (:import com.amazonaws.AmazonClientException
-           com.amazonaws.AmazonServiceException
-           com.amazonaws.auth.AWSCredentials
-           com.amazonaws.auth.DefaultAWSCredentialsProviderChain
-           com.amazonaws.auth.policy.actions.SQSActions
+  (:import com.amazonaws.auth.policy.actions.SQSActions
            com.amazonaws.auth.policy.Condition
            com.amazonaws.auth.policy.conditions.ConditionFactory
            com.amazonaws.auth.policy.Policy
@@ -38,9 +34,6 @@
            com.amazonaws.services.sqs.model.SendMessageResult
            com.amazonaws.services.sqs.model.SetQueueAttributesRequest
            com.amazonaws.ClientConfiguration
-           com.amazonaws.Protocol
-           com.amazonaws.regions.Region
-           com.amazonaws.regions.Regions
            java.util.ArrayList
            java.util.HashMap
            java.io.IOException))


move count to the bottom and a yes/no validate fn.

--- clojure/nucleotide-count/dna.clj
+++ clojure/nucleotide-count/dna.clj
@@ -4,16 +4,6 @@

 (def valid-nucleotides
   (conj (set (keys default-counts)) \U))
-
-(defn- validate-neucleotide
-  [n]
-  (if-not (contains? valid-nucleotides n)
-    (throw (IllegalArgumentException.))))
-
-(defn count
-  [nucleotide strand]
-  (validate-neucleotide nucleotide)
-  (get (nucleotide-counts strand) nucleotide 0))

 (defn- extract-nucleotides
   [s]
@@ -25,3 +15,13 @@
   [strand]
   (merge default-counts
          (frequencies (extract-nucleotides strand))))
+
+(defn- valid-neucleotide?
+  [n]
+  (contains? valid-nucleotides n))
+
+(defn count
+  [nucleotide strand]
+  (if (valid-neucleotide? nucleotide)
+    (get (nucleotide-counts strand) nucleotide 0)
+    (throw (IllegalArgumentException. "invalid nucleotide"))))


Use a StreamsConfig object to pass configuration options to KafkaStreams.

--- clstreams/src/clstreams/core.clj
+++ clstreams/src/clstreams/core.clj
@@ -41,17 +41,12 @@
       .close)))

 (def count-words-props
-  (doto (java.util.Properties.)
-    (.put StreamsConfig/APPLICATION_ID_CONFIG "streams-wordcount")
-    (.put StreamsConfig/BOOTSTRAP_SERVERS_CONFIG "kafka:9092")
-    (.put StreamsConfig/KEY_SERDE_CLASS_CONFIG (-> (Serdes/String) .getClass .getName))
-    (.put StreamsConfig/VALUE_SERDE_CLASS_CONFIG (-> (Serdes/String) .getClass .getName))
-
-    ; setting offset reset to earliest so that we can re-run the demo
-    ; code with the same pre-loaded data
-    ; Note: To re-run the demo, you need to use the offset reset tool:
-    ; https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Streams+Application+Reset+Tool
-    (.put ConsumerConfig/AUTO_OFFSET_RESET_CONFIG "earliest")))
+  (StreamsConfig.
+   {StreamsConfig/APPLICATION_ID_CONFIG "streams-wordcount"
+    StreamsConfig/BOOTSTRAP_SERVERS_CONFIG "kafka:9092"
+    StreamsConfig/KEY_SERDE_CLASS_CONFIG (-> (Serdes/String) .getClass .getName)
+    StreamsConfig/VALUE_SERDE_CLASS_CONFIG (-> (Serdes/String) .getClass .getName)
+    ConsumerConfig/AUTO_OFFSET_RESET_CONFIG "earliest"}))

 (defn run-topology
   [build-topology-fn props]


Test 10000.

Test 10000.

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -40,7 +40,7 @@
 (defn- generate-markers
   "return a string with the javascript code to generate addressPoints."
   [params]
-  (let [mons (take 50000 (wcar* (car/smembers "frfrim")))
+  (let [mons (take 10000 (wcar* (car/smembers "frfrim")))
         all (remove #(nil? %)
                     (for [m mons]
                       (let [res (read-string (wcar* (car/get m)))


GAWB-1500 Added display of realm to summary tab of realm-protected workspaces. (#664)

--- src/cljs/main/broadfcui/page/workspace/summary/tab.cljs
+++ src/cljs/main/broadfcui/page/workspace/summary/tab.cljs
@@ -147,7 +147,8 @@
 (defn- render-main [{:keys [workspace curator? owner? writer? reader? can-share? bucket-access? editing? submissions-count
                             user-access-level library-schema request-refresh workspace-id storage-cost]}]
   (let [{:keys [owners]
-         {:keys [createdBy createdDate bucketName description workspace-attributes library-attributes]} :workspace} workspace
+         {:keys [createdBy createdDate bucketName description workspace-attributes library-attributes realm]} :workspace} workspace
+        realm-name (:realmName realm)
         render-detail-box (fn [order title & children]
                             [:div {:style {:flexBasis "50%" :order order}}
                              (style/create-section-header title)
@@ -168,7 +169,11 @@
                                               [AclEditor {:workspace-id workspace-id
                                                           :user-access-level user-access-level
                                                           :request-refresh request-refresh}])})
-              ")"])]))
+              ")"])]
+          (when realm-name
+            [:div {:style {:paddingTop "0.5rem"}}
+             [:div {:style {:fontStyle "italic"}} "Access restricted to realm:"]
+             [:div {} realm-name]])))
       (render-detail-box
         3
         "Created By"


added docstrings and tests

added docstrings and tests

--- solutions/day12/solution.clj
+++ solutions/day12/solution.clj
@@ -1,5 +1,4 @@
 (require '[clojure.data.json :as json])
-(def input (json/read-str (slurp "input.txt")))

 (defn seqsum
   "Returns the sum of all numbers in a sequence"
@@ -14,12 +13,16 @@
     (+ numsum ssum msum)))

 (defn mapsum
+  "Returns the sum of all numbers in a map's keys and values"
   [m]
+  {:test (defn f[] (assert (= (6 mapsum {1 2 2 1}))))}
   (+ (seqsum (keys m))
      (seqsum (vals m))))

 (defn filter-by-val
+  "Recursively removes any branches in a map whose values contain the specified string"
   [v m]
+  {:test (defn f[] (assert (= {1 2 3 nil} (filter-by-val {1 2 3 {4 "red"}}))))}
   (cond
     (sequential? m) (map #(filter-by-val v %) m)
     (map? m)
@@ -31,5 +34,6 @@
              m)))
     :else m))

+(def input (json/read-str (slurp "input.txt")))
 (println "part 1: " (mapsum input))
 (println "part 2: " (mapsum (filter-by-val "red" input)))


Maybe actually test something?

Maybe actually test something?

--- web/test/immutant/web/undertow_test.clj
+++ web/test/immutant/web/undertow_test.clj
@@ -43,11 +43,11 @@
          "bufferSize"       3
          "buffersPerRegion" 4
          "directBuffers"    false)
-    (is #{"AJP" "HTTP"} (->> v
-                          :configuration
-                          (reflect "listeners")
-                          (map (comp str (partial reflect "type")))
-                          set)))
+    (is (= #{"AJP" "HTTP"} (->> v
+                             :configuration
+                             (reflect "listeners")
+                             (map (comp str (partial reflect "type")))
+                             set))))
   ;; Make sure kwargs and true :direct-buffers works
   (let [v (:configuration (options :io-threads 44 :direct-buffers? true))]
     (is (= 44 (reflect "ioThreads" v)))


changing fixtures parent paths

changing fixtures parent paths

--- data/celestial/fixtures/data.clj
+++ data/celestial/fixtures/data.clj
@@ -1,44 +1,48 @@
 (ns celestial.fixtures.data
   "loading fixtures data"
   (:require
+    [clojure.core.strint :refer  (<<)]
     [celestial.common :refer (slurp-edn)]
     [celestial.fixtures.core :refer (host)]))

 (def admin {:envs [:dev :qa :prod] :roles #{:celestial.roles/admin} :username "admin" :password "foo"})

 (def ronen {:envs [:dev] :roles #{:celestial.roles/user} :username "ronen" :password "bar"})
+
+(defn read-fixture [fixture]
+  (slurp-edn (<< "data/resources/~{fixture}.edn")))

-(def redis-prox-spec (slurp-edn "fixtures/redis-system.edn"))
+(def redis-prox-spec (read-fixture "redis-system"))

-(def redis-bridged-prox (slurp-edn "fixtures/redis-system-bridged.edn"))
+(def redis-bridged-prox (read-fixture "redis-system-bridged"))

-(def redis-type (slurp-edn "fixtures/redis-type.edn"))
+(def redis-type (read-fixture "redis-type"))

 (def redis-ec2-spec
-  (assoc-in (slurp-edn "fixtures/redis-ec2-system.edn") [:aws :key-name] host))
+  (assoc-in (read-fixture "redis-ec2-system") [:aws :key-name] host))

 (def redis-ec2-centos
-  (assoc-in (slurp-edn "fixtures/redis-ec2-centos.edn") [:aws :key-name] host))
+  (assoc-in (read-fixture "redis-ec2-centos") [:aws :key-name] host))

-(def redis-physical (slurp-edn "fixtures/redis-physical.edn"))
+(def redis-physical (read-fixture "redis-physical"))

-(def redis-vc-spec (slurp-edn "fixtures/redis-vc-system.edn"))
+(def redis-vc-spec (read-fixture "redis-vc-system"))

-(def redis-docker-spec (slurp-edn "fixtures/redis-docker-system.edn"))
+(def redis-docker-spec (read-fixture "redis-docker-system"))

-(def local-prox (slurp-edn "fixtures/celestial.edn"))
+(def local-prox (read-fixture "celestial"))

-(def proxmox-3 (slurp-edn "fixtures/proxmox-3.edn"))
+(def proxmox-3 (read-fixture "proxmox-3"))

-(def clustered-prox (slurp-edn "fixtures/celestial-cluster.edn"))
+(def clustered-prox (read-fixture "celestial-cluster"))

-(def redis-deploy (slurp-edn "fixtures/redis-deploy.edn"))
+(def redis-deploy (read-fixture "redis-deploy"))

-(def redis-runall (slurp-edn "fixtures/redis-runall.edn"))
+(def redis-runall (read-fixture "redis-runall"))

-(def basic-audit (slurp-edn "fixtures/basic-audit.edn"))
+(def basic-audit (read-fixture "basic-audit"))

-(def user-quota (slurp-edn "fixtures/user-quota.edn"))
+(def user-quota (read-fixture "user-quota"))

 (def local-conf
   (let [path (me.raynes.fs/expand-home "~/.celestial.edn")]


Fix gen tests

Fix gen tests

--- test/com/wsscode/pathom/gen_test.cljc
+++ test/com/wsscode/pathom/gen_test.cljc
@@ -65,7 +65,7 @@
          {::fixed-number 43}))

   (is (= (sgen/query->props [[::fixed-number '_]])
-         {::fixed-number 42}))
+         {[::fixed-number '_] 42}))

   (is (= (sgen/query->props [{[::some-id 123]
                               [::some-id ::fixed-str]}])
@@ -142,7 +142,7 @@
          {::fixed-number 43}))

   (is (= (gen/generate (sgen/query-props-generator [[::fixed-number '_]]))
-         {::fixed-number 42}))
+         {[::fixed-number '_] 42}))

   (is (= (gen/generate (sgen/query-props-generator [{[::some-id 123]
                                                      [::some-id ::fixed-str]}]))


Fix No.

Fix No.

--- src/cljs/hatnik/web/client/form/github_pull_request.cljs
+++ src/cljs/hatnik/web/client/form/github_pull_request.cljs
@@ -59,7 +59,7 @@
                          (dom/a #js {:data-toggle "collapse"
                                      :data-parent (str "#gh-pull-req-op-" (:id data))
                                      :href (str "#gh-pull-req-op-col-" (:id data))}
-                                (str "Operation №" (+ 1 (:id data))))))
+                                (str "Operation No. " (+ 1 (:id data))))))

                 (dom/div
                  #js {:className "panel-collapse collapse in"


Fix spec for modules

Fix spec for modules

--- sidecar/src/figwheel_sidecar/schemas/cljs_options.clj
+++ sidecar/src/figwheel_sidecar/schemas/cljs_options.clj
@@ -236,7 +236,7 @@
 (def-key ::modules (s/map-of
                     keyword?
                     (strict-keys
-                     :req-un [:cljs.options-schema.modules/output-dir
+                     :req-un [:cljs.options-schema.modules/output-to
                               ::entries]
                      :opt-un [::depends-on]))

@@ -288,8 +288,8 @@
 ;; ** TODO name collision don't want docs to collide
 ;; this is the only name collision in this
 (def-key :cljs.options-schema.modules/output-dir    non-blank-string?)
-(def-key ::entries       (s/every non-blank-string? :min-count 1 :into [] :kind sequential?))
-(def-key ::depends-on    (s/every ::string-or-named :min-count 1 :into [] :kind sequential?))
+(def-key ::entries       (s/every ::string-or-symbol :min-count 1 :into [] :kind  (some-fn sequential? set?)))
+(def-key ::depends-on    (s/every ::string-or-named :min-count 1 :into [] :kind (some-fn sequential? set?)))

 (def-key ::source-map-path            string?


Fix indentation :scream_cat:

Fix indentation :scream_cat:

--- test/metabase/test/data/interface.clj
+++ test/metabase/test/data/interface.clj
@@ -96,7 +96,7 @@
      (e.g., `h2` would want to upcase these names; `mongo` would want to use `\"_id\"` in place of `\"id\"`.")

   (id-field-type [this]
-                 "*OPTIONAL* Return the `base_type` of the `id` `Field` (e.g. `:IntegerField` or `:BigIntegerField`). Defaults to `:IntegerField`."))
+    "*OPTIONAL* Return the `base_type` of the `id` `Field` (e.g. `:IntegerField` or `:BigIntegerField`). Defaults to `:IntegerField`."))

 (def IDatasetLoaderDefaultsMixin
   {:expected-base-type->actual (fn [_ base-type] base-type)


RR: add datasets-routes test

RR: add datasets-routes test

--- tests/clj/ona/viewer/routes_tests.clj
+++ tests/clj/ona/viewer/routes_tests.clj
@@ -1,11 +1,13 @@
 (ns ona.viewer.routes_tests
   (:require [midje.sweet :refer :all]
             [ona.viewer.routes :refer :all]
-            [ona.viewer.views.accounts :as accounts]))
+            [ona.viewer.views.accounts :as accounts]
+            [ona.viewer.views.datasets :as datasets]))

 (def username "username")
 (def session {:account :fake-account})
 (def result {:body :something})
+(def dataset-id "1")

 (defn- route-params
   "Make route params"
@@ -54,3 +56,11 @@
                                         session)) => (contains result)
              (provided
                (accounts/logout :fake-account) => result)))
+
+(facts "dataset-routes"
+       (fact "GET /forms/:dataset-id calls dataview"
+             (dataset-routes (route-params :get
+                                           (str "/forms/" dataset-id)
+                                           session)) => (contains result)
+             (provided
+               (datasets/dataview :fake-account dataset-id) => result)))


added workaround for Google Chrome bug in menu admin

--- cljs/src/views/editor.cljs
+++ cljs/src/views/editor.cljs
@@ -508,10 +508,13 @@

 (defn get-link-data-from-li [el]
   (when-not (classes/has el "add-item-node") ; ignore "Add Item" in nested ul
-    (let [children (util/get-children el)
-          item-detail-elements (util/get-children (first children))]
-      {:label (.-textContent (nth item-detail-elements 0))
-       :uri (.-textContent (nth item-detail-elements 1))
+    ;; remove meta tag (sometimes added due to a bug in Chrome)
+    (let [children (remove #(= (.-tagName %) "meta") (util/get-children el))
+          item-detail-elements (vec (util/get-children (first children)))
+          label-el (nth item-detail-elements 0)
+          uri-el (nth item-detail-elements 1)]
+      {:label (. label-el -textContent)
+       :uri (. uri-el -textContent)
        :children (when (= (.-tagName (last children)) "UL")
                    (get-links-from-ul (last children)))})))

@@ -636,41 +639,25 @@
   (ui/trigger-on-class
    "add-sub-item"
    "click"
-   (fn [e]
-     (. e (preventDefault))
-
+   (fn [evt]
      (let [new-ul (dom/createElement "ul")]
        (classes/add new-ul "new-node")
        (set! (.-draggable new-ul) false)
-       (dom/appendChild (util/get-parent (util/get-parent (.-target e)))
+       (dom/appendChild (util/get-parent (util/get-parent (.-target evt)))
                         new-ul)
-       (ui/display-dialog
-        "Add Menu Item"
-        (ui/render-template-as-string
-         tpl/add-menu-item-dialog
-         {:feeds feeds
-          :documents documents})
-        (partial menu-item-dialog-callback
-                 feeds
-                 documents
-                 new-ul)))))
+
+       (add-menu-item-callback feeds documents new-ul evt))))

   (ui/trigger-on-class
    "add-item-to-nested-menu"
    "click"
-   (fn [e]
-     (. e (preventDefault))
-
-     (ui/display-dialog
-      "Add Menu Item"
-      (ui/render-template-as-string
-       tpl/add-menu-item-dialog
-       {:feeds feeds
-        :documents documents})
-      (partial menu-item-dialog-callback
-               feeds
-               documents
-               (util/get-parent (util/get-parent (.-target e))))))))
+   (fn [evt]
+     (add-menu-item-callback feeds
+                             documents
+                             (util/get-parent
+                              (util/get-parent
+                               (.-target evt)))
+                             evt))))

 (defn menu-container-el? [el]
   (= (.-id el) "menu-container"))
@@ -682,7 +669,7 @@
                            (get-links-from-ul menu-container-el)
                            feeds
                            documents))))
-
+
 (defn menu-item-dialog-callback [feeds documents parent-el e]
   (if (= "ok" (.-key e))
     (let [nested (classes/has parent-el "new-node")
@@ -752,35 +739,43 @@
                           (remove-self-from-documents self-slug
                                                       documents))})))

-(defn add-menu-item-callback [feeds documents evt]
-  (ui/display-dialog "Add Menu Item"
-                     (ui/render-template-as-string
-                      tpl/add-menu-item-dialog
-                      {:feeds feeds
-                       :documents documents})
-                     (partial menu-item-dialog-callback
-                              feeds
-                              documents
-                              (dom/getElement "menu-container")))
+(defn add-menu-item-callback
+  ([feeds documents evt]
+     (add-menu-item-callback feeds
+                             documents
+                             (dom/getElement "menu-container")
+                             evt))
+  ([feeds documents el evt]
+     (. evt (preventDefault))
+
+     (ui/display-dialog "Add Menu Item"
+                        (ui/render-template-as-string
+                         tpl/add-menu-item-dialog
+                         {:feeds feeds
+                          :documents documents})
+                        (partial menu-item-dialog-callback
+                                 feeds
+                                 documents
+                                 el))

-  (let [feed-el (dom/getElement "internal-link-feed")]
-    (events/listen feed-el
-                   "change"
-                   (fn []
-                     (let [feed-pair (util/pair-from-string
-                                      (.-value feed-el))]
-                       (document/get-documents-for-feed
-                        (first feed-pair)
-                        (last feed-pair)
-                        menu-dialog-upd-link-mode-xhr-callback)))))
+     (let [feed-el (dom/getElement "internal-link-feed")]
+       (events/listen feed-el
+                      "change"
+                      (fn []
+                        (let [feed-pair (util/pair-from-string
+                                         (.-value feed-el))]
+                          (document/get-documents-for-feed
+                           (first feed-pair)
+                           (last feed-pair)
+                           menu-dialog-upd-link-mode-xhr-callback)))))

-  (events/listen (dom/getElement "link-type-external")
-                 "change"
-                 menu-link-type-change-callback)
+     (events/listen (dom/getElement "link-type-external")
+                    "change"
+                    menu-link-type-change-callback)

-  (events/listen (dom/getElement "link-type-internal")
-                 "change"
-                 menu-link-type-change-callback))
+     (events/listen (dom/getElement "link-type-internal")
+                    "change"
+                    menu-link-type-change-callback)))

 (defn add-related-page-link-callback [self-slug feeds documents evt]
   (ui/display-dialog "Add Related Page"
@@ -807,12 +802,13 @@
                          self-slug)))))))

 (defn get-related-pages [related-page-el]
-  (map (fn [li-el]
-         (let [slug-el (first (util/get-children-by-tag li-el "input"))
-               title-el (first (util/get-children-by-tag li-el "span"))]
-           {:slug (.-value slug-el)
-            :title (.-textContent title-el)}))
-       (util/get-children related-page-el)))
+  (when related-page-el
+    (map (fn [li-el]
+           (let [slug-el (first (util/get-children-by-tag li-el "input"))
+                 title-el (first (util/get-children-by-tag li-el "span"))]
+             {:slug (.-value slug-el)
+              :title (.-textContent title-el)}))
+         (util/get-children related-page-el))))

 (defn add-related-page-dialog-callback [feeds documents related-pages-el e]
   (when (= "ok" (.-key e))


Simplify R/start-system! to just accept project root namespace

--- etc/repl.clj
+++ etc/repl.clj
@@ -63,23 +63,25 @@
 (def system-status (atom {}))

 (defn start-system!
-  "Given a namespace, usually some-service.user, do the following:
+  "Given a namespace, usually some-service, do the following:
+  - find some-service.user namespace (by convention)
   - refresh
-  - require the user ns
+  - require the user ns e.g. some-service.user
   - start  system, invoking somer-service.user/start
   Warning: best if the system is not running, or things will go south

-  Example: (R/start-system! 'foo.user)"
-  [an-ns]
-  (if (get @system-status an-ns)
-    (println "!!  System possibly running")
-    (do
-      (println "!! Refreshing and reloading " an-ns)
-      (refresh)
-      (require an-ns)
-      (let [f (ns-resolve an-ns 'start)]
-        (f)
-        (swap! system-status (fn [s] (assoc s an-ns true)))))))
+  Example: (R/start-system! 'foo)"
+  [pj-ns-root]
+  (let [an-ns (symbol pj-ns-root ".user")]
+    (if (get @system-status an-ns)
+      (println "!!  System possibly running")
+      (do
+        (println "!! Refreshing and reloading " an-ns)
+        (refresh)
+        (require an-ns)
+        (let [f (ns-resolve an-ns 'start)]
+          (f)
+          (swap! system-status (fn [s] (assoc s an-ns true))))))))

 (defn stop-system!
   "Given a namespace, usually some-service.user, stop the system. If not passed, stops currently running system"


DM #11 - Fix build

DM #11 - Fix build

--- integration/objective8/integration/api/up_down_votes.clj
+++ integration/objective8/integration/api/up_down_votes.clj
@@ -10,7 +10,7 @@

 (def app (ih/test-context))

-(facts "POST /api/v1/up-down-votes"
+(facts "POST /api/v1/up-down-votes" :integration
        (against-background
         (m/valid-credentials? anything anything anything) => true)
        (against-background
@@ -18,7 +18,7 @@
                                (ih/truncate-tables)))
          (after :facts (ih/truncate-tables))]

-       (future-fact "Upvotes an answer" ;; Make this generic
+       (future-fact "Upvotes an answer" :integration ;; Make this generic
              (let [{ueid :ueid user-id :user-id} (sh/store-an-answer)
                    {response :response} (p/request app (utils/path-for :api/post-up-down-vote)
                                                    :request-method :post
@@ -29,7 +29,7 @@
                (:status response) => 200))

-       (future-fact "A second upvote on the same answer is not permitted"
+       (future-fact "A second upvote on the same answer is not permitted" :integration
               (let [{ueid :ueid user-id :user-id} (sh/store-an-answer)
                     {response :response} (-> app
                                              (p/request (utils/path-for :api/post-up-down-vote)


remove commented code

remove commented code

--- test/cljx/jamesmacaulay/zelkova/impl/signal_test.cljx
+++ test/cljx/jamesmacaulay/zelkova/impl/signal_test.cljx
@@ -41,99 +41,3 @@
       (async/onto-chan live-graph [event1 event2])
       (is (= [expected1 expected2]
              (<! (async/into [] output)))))))
-
-;
-;(defn handle-event
-;  [graph-signal graph-state event-topic event-value event-timestamp]
-;  (let [event-inputs (-> graph-signal (impl/inputs-by-topic) (get event-topic))
-;        sorted-sigs (impl/topsort graph-signal)
-;        signal->index (zipmap sorted-sigs (range))
-;        kids-map (impl/kids-map graph-signal)
-;        signals->sorted-index-set #(into (sorted-set) (map signal->index) %)
-;        kid-indexes-map (zipmap (keys kids-map)
-;                                (map signals->sorted-index-set (vals kids-map)))]
-;    (loop [fresh-values (zipmap event-inputs (repeat event-value))
-;           dirty-indexes (into (sorted-set) (mapcat kid-indexes-map event-inputs))]
-;      (let [signal->message (fn [sig]
-;                              (if (contains? fresh-values sig)
-;                                (impl/fresh (get fresh-values sig))
-;                                (impl/cached (get graph-state sig))))]
-;        (if (empty? dirty-indexes)
-;          (merge graph-state fresh-values)
-;          (let [index (first dirty-indexes)
-;                sig (get sorted-sigs index)
-;                msg-fn (:msg-fn sig)
-;                sig-value (impl/value (msg-fn (get graph-state sig)
-;                                              (mapv signal->message
-;                                                    (:sources sig))))]
-;            (recur (assoc fresh-values sig sig-value)
-;                   (disj dirty-indexes index))))))))
-;
-;(deftest test-handle-event
-;  (let [in1 (z/input 0 :in1)
-;        in2 (z/input 0 :in2)
-;        graph-signal (z/map vector in1 in2)
-;        sorted-sigs (impl/topsort graph-signal)
-;        graph-state (zipmap sorted-sigs
-;                            (for [sig sorted-sigs]
-;                              ((:init-fn sig) nil {})))
-;        graph-state' (handle-event graph-signal graph-state :in1 1 99)]
-;    (is (= {in1 1 in2 0 graph-signal [1 0]}
-;           graph-state'))))
-;
-;(defn graph-init-state
-;  [signal live-graph opts]
-;  (let [sorted-sigs (impl/topsort signal)]
-;    (-> (zipmap sorted-sigs
-;                (for [sig sorted-sigs]
-;                  ((:init-fn sig) live-graph opts)))
-;        (with-meta {:graph-signal signal}))))
-;
-;(defn- wrap-msg-fn
-;  [msg-fn]
-;  (fn [prev ]))
-;
-;(defn exposed-state-transducer
-;  ([signal graph-atom]
-;   (exposed-state-transducer signal graph-atom impl/topic impl/value impl/timestamp))
-;  ([signal graph-atom topic-fn value-fn timestamp-fn]
-;   (let [kid-indexes-map (impl/kid-indexes-map signal)
-;         inputs-by-topic (impl/inputs-by-topic signal)]
-;     (fn [rf]
-;       (fn
-;         ([] (rf))
-;         ([result] (rf result))
-;         ([result event]
-;          (let [topic (topic-fn event)
-;                value (value-fn event)
-;                timestamp (timestamp-fn event)
-;                event-inputs (get inputs-by-topic topic)
-;                init-messages (zipmap event-inputs (repeat (impl/fresh value event)))
-;                init-dirty-indexes (into (sorted-set)
-;                                         (mapcat kid-indexes-map)
-;                                         event-inputs)]
-;            (loop [fresh-values init-fresh-values
-;                   dirty-indexes init-dirty-indexes]
-;              (let [signal->message (fn [sig]
-;                                      (if (contains? fresh-values sig)
-;                                        (impl/fresh (get fresh-values sig))
-;                                        (impl/cached (get graph-state sig))))])))))))))
-;
-
-;(defn atom-state-transducer
-;  [signal graph-state-atom topic-fn value-fn]
-;  (let [state ()
-;        rf (fn [result [timestamp topic value :as event]]
-;             (let [state @graph-state-atom]))]
-;    (fn
-;      ([] (rf))
-;      ([result] (rf result)))))
-
-;
-;(deftest atom-state-transducer-test
-;  (let [in1 (z/input 0 :in1)
-;        in2 (z/input 0 :in2)
-;        combined (z/map vector in1 in2)
-;        state-atom (atom {})
-;        atom-state-transducer (atom-state-transducer )]))
-


Added (ignored) divvy history concatenation test

--- test/org/gensym/viddy/queries/divvy_history_tests.clj
+++ test/org/gensym/viddy/queries/divvy_history_tests.clj
@@ -13,32 +13,18 @@
     (is (= 8 (dh/weekdays-in-range #inst "2013-01-07" #inst "2013-01-16")))))

 (comment   (testing "Should concat"
-    (let [d1 {:start #inst "2014-01-06"
-              :end #inst "2013-01-07"
-              :data {"percentile-25"
-                     {"Monday" 12, "Tuesday" 17, "Wednesday" 18}
-                     "percentile-50"
-                     {"Monday" 6, "Tuesday" 12, "Wednesday" 18}
-                     "percentile-75"
-                     {"Monday" 36, "Tuesday" 66, "Wednesday" 18}}}
-          d2 {:start #inst "2013-01-13"
-              :end #inst "2013-01-16"
-              :data {"percentile-25"
-                     {"Monday" 12 "Tuesday" 11 "Wednesday" 18}
-                     "percentile-50"
-                     {"Monday" 15 "Tuesday" 30 "Wednesday" 18}
-                     "percentile-75"
-                     {"Monday" 42 "Tuesday" 102 "Wednesday" 18}}}
-          expected {:start #inst "2013-01-06"
-                    :end #inst "2013-01-17"
-                    :data {"percentile-25"
-                           {"Monday" 12 "Tuesday" 13 "Wednesday" 18}
-                           "percentile-50"
-                           {"Monday" 11 "Tuesday" 22 "Wednesday" 18}
-                           "percentile-75"
-                           {"Monday" 40 "Tuesday" 90 "Wednesday" 18}}}]

-      (is (= expected (dh/concat-available-bikes-weekdays d1 d2))))))
+             (not (= {:data {"percentile-50"
+                             {"Tuesday" 22, "Monday" 11, "Wednesday" 18},
+                             "percentile-75"
+                             {"Tuesday" 90, "Monday" 40, "Wednesday" 18},
+                             "percentile-25"
+                             {"Tuesday" 13, "Monday" 12, "Wednesday" 18}},
+                      :start #inst "2013-01-06T00:00:00.000-00:00",
+                      :end #inst "2013-01-17T00:00:00.000-00:00"}
+                     {:start #inst "2014-01-06T00:00:00.000-00:00",
+                      :end #inst "2013-01-16T00:00:00.000-00:00", :data {"percentile-25" {"Tuesday" 2185/128, "Monday" 12, "Wednesday" 18}, "percentile-75" {"Tuesday" 4197/64, "Monday" 4599/128, "Wednesday" 18}, "percentile-50" {"Tuesday" 1509/128, "Monday" 1509/256, "Wednesday" 18}}}))
+))

 (deftest concat-available-bikes-weekdays-tests
   (testing "should concat equivalent data"
@@ -51,6 +37,35 @@
           expected {:start #inst "2013-01-06"
                     :end #inst "2013-01-16"
                     :data {"percentile" {"Monday" 12}}}]
-      (is (= expected (dh/concat-available-bikes-weekdays d1 d2))))))
+      (is (= expected (dh/concat-available-bikes-weekdays d1 d2)))))
+
+  (comment
+    (testing "should concat data with same types of datapoints"
+      (let [d1 {:start #inst "2014-01-06"
+                :end #inst "2013-01-07"
+                :data {"percentile-25"
+                       {"Monday" 12, "Tuesday" 17, "Wednesday" 18}
+                       "percentile-50"
+                       {"Monday" 6, "Tuesday" 12, "Wednesday" 18}
+                       "percentile-75"
+                       {"Monday" 36, "Tuesday" 66, "Wednesday" 18}}}
+            d2 {:start #inst "2013-01-13"
+                :end #inst "2013-01-16"
+                :data {"percentile-25"
+                       {"Monday" 12 "Tuesday" 11 "Wednesday" 18}
+                       "percentile-50"
+                       {"Monday" 15 "Tuesday" 30 "Wednesday" 18}
+                       "percentile-75"
+                       {"Monday" 42 "Tuesday" 102 "Wednesday" 18}}}
+            expected {:start #inst "2013-01-06"
+                      :end #inst "2013-01-17"
+                      :data {"percentile-25"
+                             {"Monday" 12 "Tuesday" 13 "Wednesday" 18}
+                             "percentile-50"
+                             {"Monday" 11 "Tuesday" 22 "Wednesday" 18}
+                             "percentile-75"
+                             {"Monday" 40 "Tuesday" 90 "Wednesday" 18}}}]
+
+        (is (= expected (dh/concat-available-bikes-weekdays d1 d2)))))))


add specific rule for dictated phone numbers in EN

--- resources/duckling/rules/en.communication.clj
+++ resources/duckling/rules/en.communication.clj
@@ -3,6 +3,13 @@
  #"(?i)(\+?[0-9\(][0-9\- \(\)\.]{6,16}( ?e?xt?\.? ?\d+)?)"
  {:dim :phone-number
   :value (-> %1 :groups first)}
+
+  "phone number given by each number" ;;eight nine nine one two six seven four three nine
+  [(integer 0 9) (integer 0 9) (integer 0 9) (integer 0 9) (integer 0 9) (integer 0 9)
+  	(integer 0 9) (integer 0 9) (integer 0 9) (integer 0 9)]
+  {:dim :phone-number
+  :value (clojure.string/join "" [(:value %1) (:value %2) (:value %3) (:value %4) ;; To be improved
+  			(:value %5) (:value %6) (:value %7) (:value %8) (:value %9) (:value %10)])}

  "url"
  #"((https?://)?(\w+\.)+\w{2,4}(:\d+)?[^ ]*)"


adding the history support so one can go back using the browser back button

--- src-cljs/bitfondue/core.cljs
+++ src-cljs/bitfondue/core.cljs
@@ -116,6 +116,11 @@
 (defroute "/about" [] (page about))
 (defroute "*" [] (page not-found))

+;; Quick and dirty history configuration.
+(let [h (History.)]
+  (goog.events/listen h EventType/NAVIGATE #(secretary/dispatch! (.-token %)))
+  (doto h (.setEnabled true)))
+
 ;; load the data from the API
 (fetch-chunks)


Move step! function

Move step! function

--- minimal-3d-physics/desktop/src-common/minimal_3d_physics/core.clj
+++ minimal-3d-physics/desktop/src-common/minimal_3d_physics/core.clj
@@ -76,8 +76,8 @@
   (fn [screen entities]
     (clear!)
     (->> entities
-         (render! screen)
-         (step! screen)))
+         (step! screen)
+         (render! screen)))
   :on-resize
   (fn [{:keys [width height] :as screen} entities]
     (size! screen width height))


Add `mime-type` test with parameters

Add `mime-type` test with parameters

--- test/io/perun_test.clj
+++ test/io/perun_test.clj
@@ -303,6 +303,13 @@
                       :value-fn #(meta= %1 %2 :canonical-url "http://example.com/foo.htm")
                       :msg "`canonical-url` should be implicitly set"))

+        (p/mime-type :filterer :markdown-set
+                     :extensions [".htm"])
+        (testing "mime-type"
+          (value-test :path "hammock/foo.htm"
+                      :value-fn #(and (meta= %1 %2 :mime-type "text/html")
+                                      (meta= %1 %2 :file-type "text"))
+                      :msg "`mime-type` should be set `:mime-type` and `:file-type` metadata"))

         (p/sitemap :filterer :markdown-set
                    :extensions [".htm"]


work on tests

work on tests

--- test/nml/core_test.clj
+++ test/nml/core_test.clj
@@ -6,39 +6,60 @@
 (let [tree (nml-tree "test/nml/nl")]

   (deftest get-string
-    (is (= (nml-get tree "na" "C0") "'foo'"                         ))
-    (is (= (nml-get tree "NA" "c1") "'BAR'"                         ))
-    (is (= (nml-get tree "nA" "c2") "\"baz\""                       ))
-    (is (= (nml-get tree "Na" "C3") "'qu\nx'"                       ))
-    (is (= (nml-get tree "Na" "c4") "'a','b'"                       ))
-    (is (= (nml-get tree "Na" "c5") "'c','d'"                       )))
+    (is (= (nml-get tree "na" "C0") "'foo'"                                         ))
+    (is (= (nml-get tree "NA" "c1") "'BAR'"                                         ))
+    (is (= (nml-get tree "nA" "c2") "\"baz\""                                       ))
+    (is (= (nml-get tree "Na" "C3") "'qu\nx'"                                       ))
+    (is (= (nml-get tree "Na" "c4") "'a','b'"                                       ))
+    (is (= (nml-get tree "Na" "c5") "'c','d'"                                       )))

   (deftest get-integer
-    (is (= (nml-get tree "nb" "I0") "88"                            ))
-    (is (= (nml-get tree "nb" "I1") "+88"                           ))
-    (is (= (nml-get tree "NB" "i2") "-88"                           ))
-    (is (= (nml-get tree "nb" "i3") ""                              )))
+    (is (= (nml-get tree "nb" "I0") "88"                                            ))
+    (is (= (nml-get tree "nb" "I1") "+88"                                           ))
+    (is (= (nml-get tree "NB" "i2") "-88"                                           ))
+    (is (= (nml-get tree "nb" "i3") ""                                              )))

   (deftest get-logical
-    (is (= (nml-get tree "NC" "t0") "t"                             ))
-    (is (= (nml-get tree "NC" "t1") "t"                             ))
-    (is (= (nml-get tree "NC" "t2") "t"                             ))
-    (is (= (nml-get tree "NC" "t3") "t"                             ))
-    (is (= (nml-get tree "NC" "t4") "t"                             ))
-    (is (= (nml-get tree "NC" "t5") "t"                             ))
-    (is (= (nml-get tree "nc" "f0") "f"                             ))
-    (is (= (nml-get tree "nc" "f1") "f"                             ))
-    (is (= (nml-get tree "nc" "f2") "f"                             ))
-    (is (= (nml-get tree "nc" "f3") "f"                             ))
-    (is (= (nml-get tree "nc" "f4") "f"                             ))
-    (is (= (nml-get tree "nc" "f5") "f"                             )))
+    (is (= (nml-get tree "NC" "t0") "t"                                             ))
+    (is (= (nml-get tree "NC" "t1") "t"                                             ))
+    (is (= (nml-get tree "NC" "t2") "t"                                             ))
+    (is (= (nml-get tree "NC" "t3") "t"                                             ))
+    (is (= (nml-get tree "NC" "t4") "t"                                             ))
+    (is (= (nml-get tree "NC" "t5") "t"                                             ))
+    (is (= (nml-get tree "nc" "f0") "f"                                             ))
+    (is (= (nml-get tree "nc" "f1") "f"                                             ))
+    (is (= (nml-get tree "nc" "f2") "f"                                             ))
+    (is (= (nml-get tree "nc" "f3") "f"                                             ))
+    (is (= (nml-get tree "nc" "f4") "f"                                             ))
+    (is (= (nml-get tree "nc" "f5") "f"                                             )))

   (deftest get-complex
-    (is (= (nml-get tree "nd" "C0") "(1.,2.)"                       ))
-    (is (= (nml-get tree "nd" "C1") "(1.1,2.2)"                     )))
+    (is (= (nml-get tree "nd" "C0") "(1.,2.)"                                       ))
+    (is (= (nml-get tree "nd" "C1") "(1.1,2.2)"                                     )))

   (deftest get-real
-    (is (= (nml-get tree "ne" "r0") "1.,1.0,-1.0,+1.0"              ))
-    (is (= (nml-get tree "ne" "r1") "1.1e2,1.1d2,1.1e-2,1.1d+2"     ))
-    (is (= (nml-get tree "ne" "r2") "-1.1e2,+1.1e2,-1.1d-2,+1.1d+2" )))
-  )
+    (is (= (nml-get tree "ne" "r0") "1.,1.0,-1.0,+1.0"                              ))
+    (is (= (nml-get tree "ne" "r1") "1.1e2,1.1d2,1.1e-2,1.1d+2"                     ))
+    (is (= (nml-get tree "ne" "r2") "-1.1e2,+1.1e2,-1.1d-2,+1.1d+2"                 )))
+
+  (deftest set-string
+    (is (= (nml-get (nml-set tree "na" "c0" "'FOO'") "na" "c0") "'FOO'"             ))
+    (is (= (nml-get (nml-set tree "na" "x0" "'FOO'") "na" "x0") "'FOO'"             ))
+    (is (= (nml-get (nml-set tree "zz" "x0" "'FOO'") "zz" "x0") "'FOO'"             )))
+
+  (deftest set-integer
+    (is (= (nml-get (nml-set tree "nb" "i0" "99") "nb" "i0") "99"                   ))
+    (is (= (nml-get (nml-set tree "nb" "x0" "1, +2 -3") "nb" "x0") "1,+2,-3"        ))
+    (is (= (nml-get (nml-set tree "nb" "x0" "1\n2") "nb" "x0") "1,2"                )))
+
+  (deftest set-logical
+    (is (= (nml-get (nml-set tree "nc" "f0" "T,F") "nc" "f0") "t,f"                 ))
+    (is (= (nml-get (nml-set tree "nc" "f0" ".false.,.true.") "nc" "f0") "f,t"      ))
+    (is (= (nml-get (nml-set tree "nc" "x0" ".t1234") "nc" "x0") "t"                ))
+    (is (= (nml-get (nml-set tree "ZZ" "F0" ".fasdf") "zz" "f0") "f"                )))
+
+  (deftest set-complex
+    (is (= (nml-get (nml-set tree "ND" "C0" "(3.14,2.18)") "nd" "c0") "(3.14,2.18)" )))
+
+  (deftest set-real
+    (is (= (nml-get (nml-set tree "NE" "R0" "+314.e-2") "ne" "r0") "+314.e-2"       ))))


rm unused files

rm unused files

--- figwheel.clj
+++ figwheel.clj
@@ -1,17 +0,0 @@
-(require '[figwheel-sidecar.repl :as r]
-         '[figwheel-sidecar.repl-api :as ra])
-
-(ra/start-figwheel!
-  {:figwheel-options {}
-   :build-ids ["dev"]
-   :all-builds
-   [{:id "dev"
-     :figwheel true
-     :source-paths ["src/cljs"]
-     :compiler {:main 'bulldog.core
-                :asset-path "js"
-                :output-to "resources/public/js/main.js"
-                :output-dir "resources/public/js"
-                :verbose true}}]})
-
-(ra/cljs-repl)


[#177] Provisional hack to append expected nginx url suffix and scheme

--- api/src/clojure/org/akvo/flow_api/endpoint/utils.clj
+++ api/src/clojure/org/akvo/flow_api/endpoint/utils.clj
@@ -13,9 +13,9 @@
        (s/join "&")))

 (defn get-api-root [request]
-  (let [scheme (name (:scheme request))
-        hostname (get (:headers request) "host")]
-    (str scheme "://" hostname "/")))
+  (let [hostname (get (:headers request) "host")
+        [scheme suffix] (if (s/includes? hostname "flow-api-internal") ["http" ""] ["https" "flow/"])]
+    (str scheme "://" hostname "/" suffix)))

 (defn url-builder
   ([api-root instance path]