add make-site-data test

add make-site-data test

--- test/misaki/test/controller.clj
+++ test/misaki/test/controller.clj
@@ -1,5 +1,5 @@
 (ns misaki.test.controller
-  (:use [misaki config controller]
+  (:use [misaki config loader controller]
         [misaki.util seq]
         misaki.test.common
         [clj-time.core :only [date-time]]
@@ -7,6 +7,17 @@
   (:use [clojure.test])
   (:require [clojure.java.io :as io]))

+(deftest* make-site-data-test
+  (let [file (io/file (str *post-dir* "2000.01.01-foo.html.clj"))
+        site (make-site-data file :base (parse-template-option file))]
+    (are [x y] (= x y)
+      file    (:file site)
+      "baz"   (:title site)
+      "world" (:hello site)
+      3       (count (:posts site))
+      ()      (:tag site)
+      '("tag1" "tag2" "tag3") (map :name (:tags site))
+      (date-time 2000 1 1) (:date site))))

 ;; Posts Test
 (deftest* get-post-data-test


Add new media received metadata column and a tooltip message for media files not uploaded successfully

--- src/hatti/ona/forms.cljs
+++ src/hatti/ona/forms.cljs
@@ -1,13 +1,16 @@
 (ns hatti.ona.forms
   (:require [chimera.js-interop :refer [format]]
             [chimera.urls :refer [last-url-param]]
+            [ona.utils.urls :as urls]
+            [ona.utils.i18n :refer [translate]]
             [chimera.date :as chimera-date]
             [cljs.pprint :refer [cl-format]]
             [clojure.string :as string]
             [hatti.constants :refer [_submission_time
                                      _submitted_by
                                      _last_edited
-                                     _id]]))
+                                     _id
+                                     _media_all_received]]))

 ;; CONSTANTS
 (def currency-regex #"£|$")
@@ -34,9 +37,15 @@
                   :label     "Last Edited"
                   :type      "date"})

+(def media_received_field {:name      _media_all_received
+                           :full-name _media_all_received
+                           :label     "All media received?"
+                           :type      "boolean"})
+
 (def extra-submission-details [last_edited
                                submission-time-field
-                               submitted-by-field])
+                               submitted-by-field
+                               media_received_field])

 ;; Formatting helpers
 (defn- format-multiline-answer
@@ -108,7 +117,8 @@
                             "instanceID"
                             "__version__"
                             "_duration"
-                            "_submitted_by"}
+                            "_submitted_by"
+                            "_media_all_received"}
                           field)
       (field-type-in-set? #{"deviceid"
                             "end"
@@ -119,7 +129,8 @@
                             "start"
                             "subscriberid"
                             "today"
-                            "uuid"}
+                            "uuid"
+                            "_media_all_received"}
                           field)))

 (defn geofield?
@@ -211,12 +222,26 @@
   (and (string? appearance-value)
        (re-matches #"^search\(.*\)$" appearance-value)))

+(defn media-files-upload-error-component
+  "Displays tip question and tooltip msg for failed media files uploads"
+  [answer & {:keys [hlp-url translation-txt record-modal?]}]
+  (if record-modal?
+    [:span.image-name answer
+     [:a.tooltip {:href hlp-url :target "_blank"}
+      [:span.tip-info translation-txt]
+      [:span.tip-question "?"]]]
+    (format " %s
+
+          %s
+          ?"
+            answer hlp-url translation-txt)))
+
 (defn format-answer
   "String representation for a particular field datapoint (answer).
    re-formatting depends on field type, eg. name->label substitution.
    Optional: compact? should be true if a short string needs to be returned."
-  [field answer & {:keys [language compact? label field-key]
-                   :or {field-key :name}}]
+  [field answer & {:keys [language compact? label field-key media record-modal?]
+                   :or {field-key :name record-modal? false}}]
   (cond
     (string/blank? answer) no-answer
     (select-one? field) (let [option (->> (:children field)
@@ -239,13 +264,27 @@
     (or (image? field)
         (video? field)) (let [image (:download_url answer)
                               thumb (or (:small_download_url answer) image)
+                              media-upload-fail-hlp-url
+                              urls/media-upload-fail-during-submission-help
+                              media-upload-fail-translation-txt
+                              (translate
+                               :table-data-view-page/media-upload-fail-err-msg)
                               fname (last-url-param (:filename answer))]
                           (cond
-                            (string? answer) answer
+                            (and (string? answer)
+                                 (not= answer "null") (nil? thumb))
+                            (media-files-upload-error-component
+                             answer
+                             :hlp-url
+                             media-upload-fail-hlp-url
+                             :translation-txt
+                             media-upload-fail-translation-txt
+                             :record-modal?
+                             record-modal?)
+                            (= answer "null") answer
                             compact? (format "

                                       %s " image fname)
-                            (nil? thumb) answer
                             :else [:a {:href image :target "_blank"}
                                    (if (image? field)
                                      [:img {:width "80px" :src thumb}]
@@ -292,10 +331,11 @@
                   "uuid"          "UUID"
                   "instanceID"    "Instance ID"
                   "phonenumber"   "Phone number"
+                  "_media_all_received"    "All media received?"
                   name)
                 (case name
-                  _submission_time "Submission time"
-                  _submitted_by    "Submitted by"
+                  _submission_time       "Submission time"
+                  _submitted_by          "Submitted by"
                   ""))]
     (cond-> field (not label) (assoc :label label))))


Don't share a core.async channel.

Don't share a core.async channel.

--- test/onyx/plugin/input_test.clj
+++ test/onyx/plugin/input_test.clj
@@ -102,10 +102,10 @@
 (def catalog-native-idx
   (update-in catalog-http-idx [0] assoc :elasticsearch/client-type :native :elasticsearch/port es-native-port))

-(def out-chan (chan (sliding-buffer (inc n-messages))))
+(def out-chan (atom nil))

 (defn inject-out-ch [event lifecycle]
-  {:core.async/chan out-chan})
+  {:core.async/chan @out-chan})

 (def out-calls
   {:lifecycle/before-task-start inject-out-ch})
@@ -148,46 +148,50 @@

   (testing "Successful Query for HTTP with Query, Map, and Index defined"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-q&map&idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo)))))))

   (testing "Successful Query for HTTP with Query and Index defined"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-q&idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo)))))))

   (testing "Successful Query for HTTP with Query defined"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-q&all
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo)))))))

   (testing "Successful Query for HTTP for all"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo))))))))

 (deftest native-test
@@ -195,48 +199,53 @@
   (esrd/create conn (.toString id) "_default_" {:foo "bar"})
   (Thread/sleep 5000)

+  (testing "Successful Query for Native with Query and Index defined"
+    (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
+      (let [job {:catalog catalog-native-q&idx
+                 :workflow workflow
+                 :lifecycles lifecycles
+                 :task-scheduler :onyx.task-scheduler/balanced}
+            {:keys [job-id]} (onyx.api/submit-job peer-config job)]
+        (onyx.api/await-job-completion peer-config job-id)
+        (let [result (take-segments! @out-chan 5000)]
+          (is (= "bar" (-> result first :_source :foo)))))))
+
+
   (testing "Successful Query for Native with Query, Map, and Index defined"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-native-q&map&idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
-          (is (= "bar" (-> result first :_source :foo)))))))
-
-  (testing "Successful Query for Native with Query and Index defined"
-    (with-test-env [test-env [2 env-config peer-config]]
-      (let [job {:catalog catalog-native-q&idx
-                 :workflow workflow
-                 :lifecycles lifecycles
-                 :task-scheduler :onyx.task-scheduler/balanced}
-            {:keys [job-id]} (onyx.api/submit-job peer-config job)]
-        (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo)))))))

   (testing "Successful Query for Native with Query defined"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-native-q&all
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo)))))))

   (testing "Successful Query for Native for all"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-native-idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= "bar" (-> result first :_source :foo))))))))

 (deftest fault-logic
@@ -247,18 +256,20 @@

   (testing "Successfully processed all messages no failure"
     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-q&map&idx
                  :workflow workflow
                  :lifecycles lifecycles
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)
+        (let [result (take-segments! @out-chan 5000)
               task-chunk-offset (extensions/read-chunk (:log (:env test-env)) :chunk :read-messages)]
           (is (= 11 (count result)))
           (is (= :complete (:status task-chunk-offset))))))

     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog (update-in catalog-http-q&map&idx [0] assoc :elasticsearch/restart-on-fail true)
                  :workflow workflow
                  :lifecycles lifecycles
@@ -269,11 +280,12 @@
           (is (= -1 (:chunk-index task-chunk-restart))))))

     (with-test-env [test-env [2 env-config peer-config]]
+      (reset! out-chan (chan (sliding-buffer (inc n-messages))))
       (let [job {:catalog catalog-http-q&map&idx
                  :workflow workflow
                  :lifecycles lifecycles-fail
                  :task-scheduler :onyx.task-scheduler/balanced}
             {:keys [job-id]} (onyx.api/submit-job peer-config job)]
         (onyx.api/await-job-completion peer-config job-id)
-        (let [result (take-segments! out-chan 5000)]
+        (let [result (take-segments! @out-chan 5000)]
           (is (= 11 (count result))))))))


Fixed random erronous paranthesis

Fixed random erronous paranthesis

--- src/ardoq/swagger/api.clj
+++ src/ardoq/swagger/api.clj
@@ -99,7 +99,7 @@

 (defn swagger-api [{:keys [config] :as system}]
   (routes
-   (route/resources ")/public")
+   (route/resources "/public")
    (GET "/socket" {}
         (partial handler system))
    (GET "/" {session :session


improve kafka performance and notes

improve kafka performance and notes

--- kafka-clj/src/kafka_clj/consumer/consumer.clj
+++ kafka-clj/src/kafka_clj/consumer/consumer.clj
@@ -326,6 +326,8 @@
     ;add threads that will consume from the load-pool and run f-delegate, that will in turn put data on the msg-ch
     (dotimes [i consumer-threads]
       (let [ch (ch-vec i)
+            ;PERFORMANCE note: pipe per channel is faster than pipe merge channels
+            ;we use separate channels per thread to avoid Mutex write waits.
             _ (do (async/pipe ch msg-ch))
             f-delegate2 (fn [state resp-data]
                           (>!! ch resp-data))]


Add one more subtask-help test.

Add one more subtask-help test.

--- test/test_help.clj
+++ test/test_help.clj
@@ -3,6 +3,7 @@
         [clojure.test]))

 (def formatted-docstring @#'leiningen.help/formatted-docstring)
+(def get-subtasks-and-docstrings-for @#'leiningen.help/get-subtasks-and-docstrings-for)
 (def formatted-help @#'leiningen.help/formatted-help)
 (def resolve-task @#'leiningen.help/resolve-task)

@@ -19,7 +20,9 @@
   (is (= "This is an
               AWESOME command
             For real!"
-      (formatted-docstring "install" "This is an\n  AWESOME command\nFor real!" 5))))
+      (formatted-docstring
+        "install"
+        "This is an\n  AWESOME command\nFor real!" 5))))

 (deftest test-formatted-help
   (is (= "install           This is an
@@ -27,3 +30,8 @@
                   For real!"
       (formatted-help "install" "This is an\nAWESOME command\nFor real!" 15))))

+(deftest test-get-subtasks
+  (let [m (get-subtasks-and-docstrings-for (second (resolve-task "plugin")))]
+    (is (= ["install" "uninstall"]
+           (sort (keys m))))))
+


Updated wrap-cookies doc string

Updated wrap-cookies doc string

--- ring-core/src/ring/middleware/cookies.clj
+++ ring-core/src/ring/middleware/cookies.clj
@@ -123,7 +123,24 @@

 (defn wrap-cookies
   "Parses the cookies in the request map, then assocs the resulting map
-  to the :cookies key on the request."
+  to the :cookies key on the request.
+
+  Each cookie is represented as a map, with its value being held in the
+  :value key. A cookie may optionally contain a :path, :domain or :port
+  attribute.
+
+  To set cookies, add a map to the :cookies key on the response. The values
+  of the cookie map can either be strings, or maps containing the following
+  keys:
+
+  :value     - the new value of the cookie
+  :path      - the subpath the cookie is valid for
+  :domain    - the domain the cookie is valid for
+  :port      - the port the cookie is valid for
+  :max-age   - the maximum age in seconds of the cookie
+  :expires   - a date string at which the cookie will expire
+  :secure    - set to true if the cookie is valid for HTTPS only
+  :http-only - set to true if the cookie is valid for HTTP only"
   [handler]
   (fn [request]
     (let [request (if (request :cookies)


fix undeclared-ns warnings

fix undeclared-ns warnings

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -293,7 +293,7 @@
              ;; macros may refer to namespaces never explicitly required
              ;; confirm that the library at least exists
              (nil? (io/resource (ns->relpath ns-sym)))
-             (:undeclared *cljs-warnings*))
+             (:undeclared-ns *cljs-warnings*))
     (warning :undeclared-ns env {:ns-sym ns-sym})))

 (defn core-name?
@@ -960,7 +960,7 @@

 (defn check-uses [uses env]
   (doseq [[sym lib] uses]
-    (when (and (:undeclared *cljs-warnings*)
+    (when (and (:undeclared-ns-form *cljs-warnings*)
                (= (get-in @env/*compiler* [::namespaces lib :defs sym] ::not-found) ::not-found))
       (warning :undeclared-ns-form env {:type :var :lib lib :sym sym}))))


Add compiler support for literal vectors. Refs #1, #7

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -83,6 +83,9 @@

 (defmethod emit-constant clojure.lang.PersistentList$EmptyList [x]
   (print 'cljs.core.List.EMPTY))
+
+(defmethod emit-constant clojure.lang.PersistentVector [x]
+  (print "cljs.core.vec([" (comma-sep x) "])"))

 (defmulti emit :op)


add repl ns alias to keep reader from crashing on new version

--- src/cljs_api_gen/read.clj
+++ src/cljs_api_gen/read.clj
@@ -22,7 +22,8 @@
                                                    spec cljs.spec
                                                    stc cljs.test.check
                                                    env cljs.env
-                                                   comp cljs.compiler}]
+                                                   comp cljs.compiler
+                                                   repl cljs.repl}]
                       (reader/read {:read-cond :allow, :features #{:clj}} r))
                     (catch Exception e
                       (let [eof? (string/includes? (.getMessage e) "EOF")]


typesetting

typesetting

--- src/clojure/yaw/world.clj
+++ src/clojure/yaw/world.clj
@@ -115,7 +115,7 @@
 ;;CAMERA MANAGEMENT------------------------------------------------
 (defn camera "Retrieve the main camera of the world" [world] (.getCamera world))

-;; Collision
+;;COLLISIONS------------------------------------------------------

 (defn create-bouding-box!
   "Create a boundingbox in the `world` with the


Set *colored-output* in print-value.

Set *colored-output* in print-value.

--- src/vault/format/edn.clj
+++ src/vault/format/edn.clj
@@ -91,8 +91,8 @@
 (defn- print-value
   "Prints the canonical EDN representation for the given Clojure value."
   [value]
-  (let [opts {:width blob-width}]
-    (puget/pprint value opts)))
+  (binding [puget/*strict-mode* true]
+    (puget/pprint value {:width blob-width})))

 (defn- edn-str
@@ -100,8 +100,7 @@
   Clojure value."
   ^String
   [value]
-  (binding [puget/*colored-output* false
-            puget/*strict-mode* true]
+  (binding [puget/*colored-output* false]
     (str/trim (with-out-str (print-value value)))))


Update chart namespace; default to Shadow theme

--- clojure/src/evolution_programs/chart.clj
+++ clojure/src/evolution_programs/chart.clj
@@ -1,8 +1,10 @@
 (ns evolution-programs.chart
   (:require [evolution-programs.population-statistic :as stat])
-  (:import [org.jfree.chart ChartFactory ChartPanel]
+  (:import [org.jfree.chart ChartFactory ChartPanel StandardChartTheme]
            [org.jfree.data.category DefaultCategoryDataset]
            [org.jfree.ui ApplicationFrame]))
+
+(ChartFactory/setChartTheme (StandardChartTheme. "JFree/Shadow" true))

 (defn- chart [dataset]
   (doto (ChartFactory/createLineChart "Population Analysis" "Generation" "Fitness" dataset)


[#2964] Use count(*) instead of count(col_name)

https://stackoverflow.com/questions/2054235/why-doesnt-postgres-group-by-null-select-counts

--- backend/src/akvo/lumen/lib/aggregation/bar.clj
+++ backend/src/akvo/lumen/lib/aggregation/bar.clj
@@ -67,7 +67,8 @@
     (format
      (case aggregation-method
        nil                         "NULL"
-       ("min" "max" "count" "sum") (str aggregation-method  "(%s)")
+       ("min" "max" "sum")         (str aggregation-method  "(%s)")
+       "count"                     (str aggregation-method  "(*)")
        "mean"                      "avg(%s)"
        "median"                    "percentile_cont(0.5) WITHIN GROUP (ORDER BY %s)"
        "distinct"                  "COUNT(DISTINCT %s)"


Added annotation to TikZ layout output

Added annotation to TikZ layout output

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

--- src/conexp/io/layouts.clj
+++ src/conexp/io/layouts.clj
@@ -147,30 +147,16 @@

 (define-layout-output-format :tikz
   [layout file]
-  (let [infs         (set (inf-irreducibles layout)),
-        sups         (set (sup-irreducibles layout)),
-        insu         (intersection infs sups),
-        vertex-pos   (positions layout),
-        sorted       (sort #(let [[x_1 y_1] (vertex-pos %1),
-                                  [x_2 y_2] (vertex-pos %2)]
-                              (or (< y_1 y_2)
-                                  (and (= y_1 y_2)
-                                       (< x_1 x_2))))
-                           (nodes layout)),
-        vertex-idx   (into {}
-                           (map-indexed (fn [i v] [v i])
-                                        sorted)),
-        vertex-lines (map (fn [v]
-                            (let [i     (vertex-idx v),
-                                  [x y] (vertex-pos v)]
-                              (str "        " i "/"
-                                   (cond
-                                    (contains? insu v)  "divertex"
-                                    (contains? sups v)  "jivertex"
-                                    (contains? infs v)  "mivertex"
-                                    :else               "vertex")
-                                   "/" x "/" y)))
-                          sorted)]
+  (let [vertex-pos      (positions layout),
+        sorted-vertices (sort #(let [[x_1 y_1] (vertex-pos %1),
+                                     [x_2 y_2] (vertex-pos %2)]
+                                 (or (< y_1 y_2)
+                                     (and (= y_1 y_2)
+                                          (< x_1 x_2))))
+                              (nodes layout)),
+        vertex-idx      (into {}
+                              (map-indexed (fn [i v] [v i])
+                                           sorted-vertices))]
     (with-out-writer file
       (println "\\colorlet{mivertexcolor}{blue}")
       (println "\\colorlet{jivertexcolor}{red}")
@@ -188,9 +174,23 @@
       (println "  \\begin{scope} %for scaling and the like")
       (println "    \\begin{scope} %draw vertices")
       (println "      \\foreach \\nodename/\\nodetype/\\xpos/\\ypos in {%")
-      (doseq [x (interpose ",\n" vertex-lines)]
-        (print x))
-      (println)
+      (let [infs         (set (inf-irreducibles layout)),
+            sups         (set (sup-irreducibles layout)),
+            insu         (intersection infs sups),
+            vertex-lines (map (fn [v]
+                                (let [i     (vertex-idx v),
+                                      [x y] (vertex-pos v)]
+                                  (str "        " i "/"
+                                       (cond
+                                        (contains? insu v)  "divertex"
+                                        (contains? sups v)  "jivertex"
+                                        (contains? infs v)  "mivertex"
+                                        :else               "vertex")
+                                       "/" x "/" y)))
+                              sorted-vertices)]
+        (doseq [x (interpose ",\n" vertex-lines)]
+          (print x))
+        (println))
       (println "      } \\nodex[\\nodetype] (\\nodename) at (\\xpos, \\ypos) {};")
       (println "    \\end{scope}")
       (println "    \\begin{scope} %draw connections")
@@ -199,7 +199,21 @@
       (println "    \\end{scope}")
       (println "    \\begin{scope} %add labels")
       (println "      \\foreach \\nodename/\\labelpos/\\labelopts/\\labelcontent in {%")
-      'todo
+      (let [ann       (annotation lay),
+            ann-lines (mapcat (fn [v]
+                                (let [[u l] (ann v),
+                                      lines (if-not (= "" u)
+                                              (list (str "        " (vertex-idx v) "/above//{" u "}"))
+                                              ()),
+                                      lines (if-not (= "" l)
+                                              (conj lines
+                                                    (str "        " (vertex-idx v) "/below//{" l "}"))
+                                              lines)]
+                                    lines))
+                              sorted-vertices)]
+        (doseq [x (interpose ",\n" ann-lines)]
+          (print x))
+        (println))
       (println "      } \\coordinate[label={[\\labelopts]\\labelpos:{\\labelcontent}}](c) at (\\nodename);")
       (println "    \\end{scope}")
       (println "  \\end{scope}")


add :> syntax for interop with React

add :> syntax for interop with React

--- src/daiquiri/compiler.clj
+++ src/daiquiri/compiler.clj
@@ -276,6 +276,10 @@
   "Returns the compilation strategy to use for a given element."
   [[tag attrs & content :as element] env]
   (cond
+    ;; e.g. [:> ...]
+    (= tag :>)
+    ::react-interop
+
     ;; e.g. [:span "foo"]
     (every? literal? element)
     ::all-literal
@@ -315,6 +319,10 @@
           element."
   {:private true}
   element-compile-strategy)
+
+(defmethod compile-element ::react-interop
+  [element env]
+  `(rum.core/adapt-class ~@(rest element)))

 (defmethod compile-element ::all-literal
   [element env]


Fill out a little more variation.

Fill out a little more variation.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -55,7 +55,7 @@
       (+ (* 1/8 (sin-osc 9) (sin-osc (* 4.99 freq))))
       (+ (* 1/8 (sin-osc (* 7.01 freq))))
       (clip2 0.8)
-      (rlpf (line:kr freq (* 7 freq) 0.4) 1/3)
+      (rlpf (line:kr (* 2 freq) (* 7 freq) 0.8))
       (* (env-gen (adsr 0.2 0.4 0.15 0.2) (line:kr 1 0 0.1) :action FREE))
       (pan2 pan)
       (* vol)))
@@ -83,9 +83,10 @@
   (let [model (->> (phrase [5/4 3/4 4/4] (repeat 1)) (after 4/4))
         a (split 9/4 1/4)
         b (comp (split 10/4 1/4) a)
-        c (comp (split 11/4 1/8) b)
-        d (split 4/4 1/4)]
-    (part model a b c d)))
+        c (comp (accent 11/4) (split 11/4 1/8) b) ; 17
+        d (split 4/4 1/4)
+        e (comp (omit 10/4) c)] ; 8
+    (part model a b c d e)))

 (def ha
   (let [model (->> (phrase [12/4 2/4] (repeat 2)) (after 2/4))


Fix mistake in last commit ccd993. Apply change to fn call correctly.

--- lein-light-nrepl/src/lighttable/nrepl/cljs.clj
+++ lein-light-nrepl/src/lighttable/nrepl/cljs.clj
@@ -470,8 +470,8 @@
           (when pos
             (core/respond msg :editor.eval.cljs.location (clojure.core/meta (first forms))))
           (with-compiler-env compiler-env
-            nil
             (comp/with-core-cljs
+              nil
              (if-not (first forms)
                (core/respond msg :editor.eval.cljs.no-op {})
                (core/respond msg :editor.eval.cljs.code {:results (doall (for [f forms]


Updates for Feb 2020

Updates for Feb 2020

--- scrape-n-mail/src/scrape_n_mail/core.cljs
+++ scrape-n-mail/src/scrape_n_mail/core.cljs
@@ -192,8 +192,9 @@
       [:p submitter-email]
       [:br]
       [:p "Dear " (first-name (::submitter-name (first name-records))) ","]
-
-      [:p "Our general call for names for Wellbeing for January 2020 has gone out to the newDharma mailing list."]
+
+      [:p "Our general call for names for Wellbeing for February 2020 has gone out to the newDharma mailing list."
+          " Please respond to the inquiry there about a collective online ceremony!"]

       [:p "Currently, the community is holding the following names on the altar "
           "in support of their wellbeing at your request. Click "


Make errors not count as a chip off the old block if zero

--- src/clojush/pushgp/selection/preselection.clj
+++ src/clojush/pushgp/selection/preselection.clj
@@ -94,7 +94,7 @@
         (throw
          (Exception.
           ":print-history must be true for :knock-off-chip-off-the-old-block"))
-        (let [knock-spec (if (= true knock-spec) [true] knock-spec)
+        (let [knock-spec (if (= true knock-spec) [2 2] knock-spec)
               min2? (= :min2 (first knock-spec))
               knock-spec (if min2? (rest knock-spec) knock-spec)
               subset? (= :subset (first knock-spec))
@@ -110,43 +110,40 @@
                     (map (fn [errs]
                            (for [i keepers] (nth errs i)))
                          (:history ind))))
-                :history)]
-          (if (= true (first knock-spec))
-            (let [changed (vec (filter #(not= (first (filtered-history %))
-                                              (second (filtered-history %)))
-                                       pop))]
-              (if (empty? changed)
-                (do (println "Universal violation of knock-off-chip-off-the-old-block constraint.")
-                    pop)
-                changed))
-            (let [diffs (first knock-spec)
-                  outof (second knock-spec)
-                  limit (if (= outof :random) (nth knock-spec 2) nil)
-                  outof (if (= outof :random)
-                          (if min2?
-                            (inc (inc (lrand-int (dec limit))))
-                            (inc (lrand-int limit)))
-                          outof)
-                  diffs (if (= diffs :random)
-                          (inc (if (> (count knock-spec) 3)
-                                 (let [mindiff (int (* (nth knock-spec 3) outof))
-                                       maxdiff (if (> (count knock-spec) 4)
-                                                 (int (* (nth knock-spec 4) outof))
-                                                 outof)]
-                                   (+ mindiff (lrand-int (max 1 (- maxdiff mindiff)))))
-                                 (if min2?
-                                   (inc (lrand-int (dec outof)))
-                                   (lrand-int outof))))
-                          diffs)
-                  changed (vec (filter #(or (< (count (filtered-history %)) diffs)
-                                            (>= (count (distinct (take outof
-                                                                       (filtered-history %))))
-                                                diffs))
-                                       pop))]
-              (if (empty? changed)
-                (do (println "Universal violation of knock-off-chip-off-the-old-block constraint.")
-                    pop)
-                changed))))))))
+                :history)
+              diffs (first knock-spec)
+              outof (second knock-spec)
+              limit (if (= outof :random) (nth knock-spec 2) nil)
+              outof (if (= outof :random)
+                      (if min2?
+                        (inc (inc (lrand-int (dec limit))))
+                        (inc (lrand-int limit)))
+                      outof)
+              diffs (if (= diffs :random)
+                      (inc (if (> (count knock-spec) 3)
+                             (let [mindiff (int (* (nth knock-spec 3) outof))
+                                   maxdiff (if (> (count knock-spec) 4)
+                                             (int (* (nth knock-spec 4) outof))
+                                             outof)]
+                               (+ mindiff (lrand-int (max 1 (- maxdiff mindiff)))))
+                             (if min2?
+                               (inc (lrand-int (dec outof)))
+                               (lrand-int outof))))
+                      diffs)
+              changed (vec (filter (fn [ind]
+                                     (let [hist (filtered-history ind)
+                                           case-hists (apply map list hist)]
+                                       (every? (fn [h]
+                                                 (or (zero? (first h))
+                                                     (< (count h) diffs)
+                                                     (>= (count (distinct (take outof h)))
+                                                         diffs)))
+                                               case-hists)))
+                                   pop))]
+          (if (empty? changed)
+            (do (println "Universal violation of knock-off-chip-off-the-old-block constraint.")
+                pop)
+            changed))))))

 (defn preselect


[#161] Give GAE dev server more time to start

When Travis is having network troubles, 1 min is not enough for the GAE dev server to download the DB and start up

--- api/test/clojure/org/akvo/flow_api/fixtures.clj
+++ api/test/clojure/org/akvo/flow_api/fixtures.clj
@@ -22,7 +22,7 @@
            (= status# ::error) (throw (RuntimeException. (str "Failed: " ~msg) return#)))))))

 (defn wait-for-server [url]
-  (try-for (str "Not 200 for " url) 60
+  (try-for (str "Not 200 for " url) 180
     (= 200 (:status (clj-http.client/get url)))))

 (defn check-servers-up []


looks better this way

looks better this way

--- src/crawler/dom.clj
+++ src/crawler/dom.clj
@@ -268,11 +268,12 @@
                           (and (-> a-tag
                                    (.getAttributes)
                                    (.getNamedItem "href"))
-                               (try (not= (-> a-tag
-                                              (.getAttributes)
-                                              (.getNamedItem "rel")
-                                              (.getValue))
-                                          "nofollow")
+                               (try
+                                 (not= (-> a-tag
+                                           (.getAttributes)
+                                           (.getNamedItem "rel")
+                                           (.getValue))
+                                       "nofollow")
                                     (catch NullPointerException e true))))
                         a-tags)


linkify chats!

linkify chats!

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -11,6 +11,18 @@
             [om.dom :as dom :include-macros true])
   (:require-macros [frontend.utils :refer [html]])
   (:import [goog.ui IdGenerator]))
+
+(def url-regex #"(?im)\b(?:https?|ftp)://[-A-Za-z0-9+@#/%?=~_|!:,.;]*[-A-Za-z0-9+@#/%=~_|]")
+
+(defn linkify [text]
+  (let [matches (re-seq url-regex text)
+        ;; may need to add [""], split can return empty array
+        parts (or (seq (str/split text url-regex)) [""])]
+    (reduce (fn [acc [pre url]]
+              (conj acc [:span pre] (when url [:a {:href url :target "_blank"} url])))
+            [:span] (partition-all 2 (concat (interleave parts
+                                                         matches)
+                                             [(last parts)])))))

 (defn chat-aside [{:keys [db chat-body client-uuid aside-menu-opened chat-bot]} owner]
   (reify
@@ -64,12 +76,15 @@
                                 (if (= (str (:session/uuid chat))
                                        client-uuid)
                                   "You"
-                                  id))]]
+                                  id))
+                       chat-body (if (string? (:chat/body chat))
+                                   (linkify (:chat/body chat))
+                                   (:chat/body chat))]]
              (html [:div.message {:key (:db/id chat)}
                     [:span {:style {:color (or (:chat/color chat) (str "#" id))}}
                      name]
                     " "
-                    (:chat/body chat)]))]
+                    chat-body]))]
           [:form {:on-submit #(do (cast! :chat-submitted)
                                   false)
                   :on-key-down #(when (and (= "Enter" (.-key %))


Adds workflows link to sidebar nav (behind LD flag)

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -426,6 +426,15 @@
               [:i.material-icons "storage"]
               [:div.nav-label "Builds"]])

+           (when (ld/feature-on? "workflows-poc")
+             [:a.aside-item {:class (when (= :v1-workflow current-route) "current")
+                             :data-placement "right"
+                             :data-trigger "hover"
+                             :title "Workflows"
+                             :href (routes/v1-workflow-path :github "circleci" "workflows-poc" "main-workflow")}
+              [:i.material-icons "storage"]
+              [:div.nav-label "Workflows"]])
+
            (when show-aside-icons?
              [:a.aside-item {:class (when (= :build-insights current-route) "current")
                              :data-placement "right"


added the option to choose not to install vbox-guest

--- main/src/dda/pallet/dda_managed_ide/domain.clj
+++ main/src/dda/pallet/dda_managed_ide/domain.clj
@@ -34,7 +34,7 @@
   (merge
     vm-domain/DdaVmUser
     vm-domain/DdaVmBookmarks
-    {:vm-type (s/enum :remote :desktop)
+    {:vm-type (s/enum :remote :desktop :desktop-novbox)
      :dev-platform (s/enum :clojure-atom :clojure-nightlight)
      (s/optional-key :lein-auth) [RepoAuth]}))

@@ -81,7 +81,8 @@
         {:bookmarks bookmarks})
       {:type (cond
                (= vm-type :remote) :remote
-               (= vm-type :desktop) :desktop-office)})))
+               (= vm-type :desktop) :desktop-office
+               (= vm-type :desktop-novbox) :desktop-novbox)})))

 (s/defn ^:always-validate
   infra-configuration :- InfraResult


DXML-21: Rename deftests so they all have unique names

to avoid some tests being ignored completely.

Signed-off-by: Ryan Senior <a80ad5efb605456f02270ee65419cafd23760e74@puppetlabs.com>

--- src/test/clojure/clojure/data/xml/test_emit.clj
+++ src/test/clojure/clojure/data/xml/test_emit.clj
@@ -35,7 +35,7 @@
                     "")]
     (is (= expect (emit-str deep-tree)))))

-(deftest defaults
+(deftest defaults-2
   ;;XML below should be updated when namespace support is in
   (let [expect (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?><bar item=\"1\"><baz item=\"2\">done</baz></bar>")]
     (is (= expect (emit-str (element "foo/bar" {"foo/item" 1} [(element "foo/baz" {"foo/item" 2} "done")]))))))
@@ -122,7 +122,7 @@
                     "\n    <c>\n      <d>foo</d>\n    </c>\n  \n\n")]
     (is (= expect (indent-str nested-xml)))))

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


Add fix for :tags nil

Add fix for :tags nil

--- src/main/clj/com/climate/services/aws/emr.clj
+++ src/main/clj/com/climate/services/aws/emr.clj
@@ -268,10 +268,12 @@
   Parse it into a sequence of Tag objects."
   [tags]
   (letfn [(->tag [[k v]] (Tag. k v))]
-    (->> (s/split tags #",")
-         (map s/trim)
-         (map #(s/split % #"="))
-         (map ->tag))))
+    (if (empty? tags)
+      []
+      (->> (s/split tags #",")
+           (map s/trim)
+           (map #(s/split % #"="))
+           (map ->tag)))))

 (defn start-job-flow [name steps {:keys [log-uri bootstrap-actions ami-version
                                          supported-products visible-to-all-users


remove some clutter, don't start at Warning #0 label

--- src/main/shadow/cljs/devtools/server/util.clj
+++ src/main/shadow/cljs/devtools/server/util.clj
@@ -122,10 +122,10 @@
                    (/ 1000))))

     (when (seq warnings)
-      (println (format "====== %d Warnings" (count warnings)))
+      (println)
       (doseq [[idx w] (map-indexed vector warnings)]
-        (print-warning (assoc w ::idx idx)))
-      (println "======"))))
+        (print-warning (assoc w ::idx (inc idx))))
+      )))

 (defn print-build-failure [{:keys [build-config e] :as x}]
   (println (format "[%s] Build failure:" (:id build-config)))


:include-macros should now be :refer-macros

for the latest clojurescript versions

--- src/leiningen/new/yawt/src-cljs/root_ns/client/main.cljs
+++ src/leiningen/new/yawt/src-cljs/root_ns/client/main.cljs
@@ -1,7 +1,7 @@
 (ns {{root-ns}}.client.main
   (:require [weasel.repl :as ws-repl]
             [reagent.core :as reagent]
-            [secretary.core :as secretary :include-macros true :refer [defroute]]
+            [secretary.core :as secretary :refer-macros [defroute]]
             [{{root-ns}}.client.page-components :refer [app-page]]
             [{{root-ns}}.client.utils :refer [hook-browser-navigation! dev? supports-ws?]]
             [{{root-ns}}.client.routes.home :refer [home-page]]


update core.clj to https://github.com/clojure/clojurescript/commit/54b75eca6fdb6a5959253a9b2addbcf3119567a7 https://github.com/clojure/clojurescript/commit/f9ce62637bca40d0ab1d0db855ea03ae8cf9e310

--- src/main/clojure/clojure/tools/analyzer/js/cljs/core.clj
+++ src/main/clojure/clojure/tools/analyzer/js/cljs/core.clj
@@ -1678,10 +1678,23 @@
        (this-as this#
          (cljs.core/es6-iterator this#)))))

+(defmacro var [sym]
+  (core/let [{sym-ns :ns sym-name :name :as info} (a/resolve-sym sym (dissoc &env :locals))]
+    `(cljs.core/Var. ~sym
+                     (symbol ~(name sym-ns) ~(name sym-name))
+                     (merge
+                      {:ns (symbol ~(name sym-ns))
+                       :name (symbol ~(name sym-name))
+                       :file ~(:file (meta info))
+                       :line ~(:line (meta info))
+                       :column ~(:column (meta info))}
+                      ~(when (:test info)
+                         `{:test (.-cljs$lang$test ~sym)})))))
+
 (defmacro ns-interns
   "Returns a map of the intern mappings for the namespace."
   [[quote ns]]
   (core/assert (core/and (= quote 'quote) (core/symbol? ns))
                "Argument to ns-interns must be a quoted symbol")
-  `(into {} ~(mapv (fn [[sym {:keys [ns name]}]] `[~sym ~(core/symbol (core/name ns) (core/name name))])
+  `(into {} ~(mapv (fn [[sym {:keys [ns name]}]] `[~sym (cljs.core/var ~(core/symbol (core/name ns) (core/name name)))])
                    (get-in (env/deref-env) [:namespaces ns :mappings]))))


fix 9e58ea3913247adb7dca15cd81073b1842cb23e4

--- src/main/clojure/clojure/tools/analyzer/js/cljs/core.clj
+++ src/main/clojure/clojure/tools/analyzer/js/cljs/core.clj
@@ -1576,7 +1576,7 @@
         m           (if (meta mm-name)
                       (conj (meta mm-name) m)
                       m)
-        mm-ns (-> &env :ns :name core/str)]
+        mm-ns (-> &env :ns core/str)]
     (when (= (count options) 1)
       (throw (Exception. "The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)")))
     (let [options   (apply core/hash-map options)
@@ -1588,7 +1588,7 @@
                method-cache# (atom {})
                cached-hierarchy# (atom {})
                hierarchy# (get ~options :hierarchy (cljs.core/get-global-hierarchy))]
-           (cljs.core/MultiFn. ~(cljs.core/symbol ~mm-ns (name mm-name)) ~dispatch-fn ~default hierarchy#
+           (cljs.core/MultiFn. (cljs.core/symbol ~mm-ns ~(name mm-name)) ~dispatch-fn ~default hierarchy#
                                method-table# prefer-table# method-cache# cached-hierarchy#))))))

 (defmacro defmethod


ui fix

ui fix

--- src/cljs/salava/badge/ui/upload.cljs
+++ src/cljs/salava/badge/ui/upload.cljs
@@ -79,10 +79,10 @@

 (defn assertion-upload-info []
   [:div
-   [:p (t :badge/Importbadgesviaassertioninfo1)]
+   [:p (t :badge/Importbadgeswithassertioninfo1)]
    [:ul
     [:li {:dangerouslySetInnerHTML
-          {:__html (str (t :badge/Importbadgesviaassertioninfo2) " " (t :badge/Importbadgesviaassertioninfo3))}}]]
+          {:__html (str (t :badge/Importbadgeswithassertioninfo2) " " (t :badge/Importbadgeswithassertioninfo3))}}]]
    [:p
     (t :badge/Uploadbagesfromresult1) " "
     [:a {:href (path-for "/badge/mybadges")} (t :badge/Mybadges)] " " (t :badge/page) ". "
@@ -93,7 +93,7 @@
 (defn badge-file-upload-content [state]
   (let [status  (:status @state)]
     [:div
-     [:h1.uppercase-header (t :badge/Importbadges)]
+     [:h2.uppercase-header (t :badge/Uploadbadgefrom)]
      [upload-info]
      (cond
        (= "loading" status) [:div.ajax-message
@@ -112,7 +112,7 @@
   (let [assertion-url (cursor state [:assertion-url])
         status  (:status @state)]
     [:div
-     [:h1.uppercase-header (t :badge/Importbadgesviaassertion)]
+     [:h2.uppercase-header (t :badge/Importbadgeswithassertion)]
      [assertion-upload-info]
      (cond
        (= "loading" status) [:div.ajax-message


small fix

small fix

--- src/cljs/salava/badge/ui/verify.cljs
+++ src/cljs/salava/badge/ui/verify.cljs
@@ -44,8 +44,8 @@
          [:div;.panel {:style {:padding-top "20px"}}
           [:hr.border]
           [:div;.panel-body
-           [:div ;.close-button
-            [:a.cancel.pull-right {
+           [:div.close {:style {:opacity 1}};.close-button
+            [:a {
                       :aria-label "OK"
                       :on-click   #(do
                                      (.preventDefault %)


fix register form facebook and linkedin

fix register form facebook and linkedin

--- src/cljs/salava/oauth/ui/helper.cljs
+++ src/cljs/salava/oauth/ui/helper.cljs
@@ -23,7 +23,7 @@
          redirect-uri (js/encodeURIComponent (str (session/get :site-url) (path-for redirect-path)))
          facebook-url (str "https://www.facebook.com/dialog/oauth?client_id=" fb-app-id "&redirect_uri=" redirect-uri "&scope=email")]
      (if fb-app-id
-       [:button {:class "btn btn-default  btn-oauth btn-facebook" :href facebook-url :rel "nofollow"}
+       [:a {:class "btn btn-default  btn-oauth btn-facebook" :href facebook-url :rel "nofollow"}
         [:i {:class "fa fa-facebook"}]
         (t :oauth/RegisterwithFacebook)
         ])))
@@ -41,7 +41,7 @@
   (let [redirect-uri (js/encodeURIComponent (str (session/get :site-url) (path-for "/oauth/linkedin")))
         random-state (-> (make-random-uuid) (uuid-string))
         linkedin-url (str "https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" linkedin-app-id "&redirect_uri=" redirect-uri "&state=" random-state "&scope=r_basicprofile%20r_emailaddress")]
-    [:button {:class "btn btn-oauth btn-linkedin" :href linkedin-url :rel "nofollow"}
+    [:a {:class "btn btn-oauth btn-linkedin" :href linkedin-url :rel "nofollow"}
      [:i {:class "fa fa-linkedin"}]
      (t :oauth/RegisterwithLinkedin)]))


Adds `import-all-projects`

Adds `import-all-projects`

--- src/great_things_done/import_db.cljs
+++ src/great_things_done/import_db.cljs
@@ -26,4 +26,8 @@
     (state/load-project! project)
     project))

-;; (defn import-all-projects)
+(defn import-all-projects
+  []
+  (let [root    (platform/database-projects-path)
+        folders (fs/read-dir root)]
+    (map import-project folders)))


explicit namespace alias

explicit namespace alias

--- src/io/cyanite/carbon.clj
+++ src/io/cyanite/carbon.clj
@@ -3,7 +3,7 @@
   (:require [clojure.string        :as s]
             [io.cyanite.store      :as store]
             [io.cyanite.path       :as path]
-            [io.cyanite.tcp        :as tc]
+            [io.cyanite.tcp        :as tcp]
             [io.cyanite.util       :refer [partition-or-time]]
             [clojure.tools.logging :refer [info debug]]
             [clojure.core.async    :as async :refer [<! >! >!! go chan]]))
@@ -63,5 +63,5 @@
         chan (chan 100000)
         handler (format-processor chan indexch (:rollups carbon) insertch)]
     (info "starting carbon handler: " carbon)
-    (tc/start-tcp-server
+    (tcp/start-tcp-server
      (merge carbon {:response-channel chan}))))


forgot class name

forgot class name

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -229,7 +229,7 @@
               [:span.philosphy-needed "."]]
              [:div.calls-to-action
               (om/build make-button (select-keys app [:document/id]))]]]]
-          [:div.our-proof {:class (when (:show-scroll-to-arrow app))}
+          [:div.our-proof {:class (when (:show-scroll-to-arrow app) "extend")}
            ;; probably kill this when customers are ready
            (when (:show-scroll-to-arrow app)
              [:a {:role "button"


whoops forgot param

whoops forgot param

--- src-cljs/flatride/frontend.cljs
+++ src-cljs/flatride/frontend.cljs
@@ -87,7 +87,7 @@
   (set! *mapInstance* (window/google.maps.Map. (sel1 :#div-map-canvas) (map-config-obj latlng)))
     (.geocode geocoder (js-obj "latLng" latlng) fill-from-field)))

-(defn get-position-error [c]
+(defn get-position-error []
   "Handler Error in case of geolocation failure"
    (set! *mapInstance* (window/google.maps.Map. (sel1 :#div-map-canvas)
         (js-obj


CMR-1799: Removed unsused index set mappings


(maint) Add a post-ssl-or-throw test utils func

--- test/puppetlabs/puppetdb/testutils/services.clj
+++ test/puppetlabs/puppetdb/testutils/services.clj
@@ -311,6 +311,20 @@
          :ssl-cert default-cert
          :ssl-key  default-ssl-key}))

+(pls/defn-validated post-ssl-or-throw
+  [url-str :- String
+   body]
+  "Same as `post-ssl` except will throw if an error status is returned."
+  (let [resp (post-ssl url-str body)]
+    (if (>= (:status resp) 400)
+      (throw
+       (ex-info (format "Failed request to '%s' with status '%s'"
+                        url-str (:status resp))
+                {:url url-str
+                 :response resp
+                 :status (:status resp)}))
+      resp)))
+
 (defn certname-query
   "Returns a function that will query the given endpoint (`suffix`)
   for the provided `certname`"


Part of the PersistentTreeMap tests. The apply tests needs the seq varargs rewrite.

--- test/cljs/core_test.cljs
+++ test/cljs/core_test.cljs
@@ -1333,29 +1333,29 @@
   ;;           (assert (= s (set (remove #(zero? (mod % 3)) (range 100))))))))))

   ;; ;; PersistentTreeMap
-  ;; (let [m1 (sorted-map)
-  ;;       c2 (comp - compare)
-  ;;       m2 (sorted-map-by c2)]
-  ;;   (assert (identical? cljs.core.PersistentTreeMap (type m1)))
-  ;;   (assert (identical? cljs.core.PersistentTreeMap (type m2)))
-  ;;   (assert (identical? compare (.-comp m1)))
-  ;;   (assert (zero? (count m1)))
-  ;;   (assert (zero? (count m2)))
-  ;;   (assert (nil? (rseq m1)))
-  ;;   (let [m1 (assoc m1 :foo 1 :bar 2 :quux 3)
-  ;;         m2 (assoc m2 :foo 1 :bar 2 :quux 3)]
-  ;;     (assert (= (count m1) 3))
-  ;;     (assert (= (count m2) 3))
-  ;;     (assert (= (seq m1) (list [:bar 2] [:foo 1] [:quux 3])))
-  ;;     (assert (= (seq m2) (list [:quux 3] [:foo 1] [:bar 2])))
-  ;;     (assert (= (seq m1) (rseq m2)))
-  ;;     (assert (= (seq m2) (rseq m1)))
-  ;;     (assert (= (conj m1 [:wibble 4]) {:foo 1 :bar 2 :quux 3 :wibble 4}))
-  ;;     (assert (= (count (conj m1 [:wibble 4])) 4))
-  ;;     (assert (= (conj m2 [:wibble 4]) {:foo 1 :bar 2 :quux 3 :wibble 4}))
-  ;;     (assert (= (count (conj m2 [:wibble 4])) 4))
-  ;;     (assert (= (map key (assoc m1 nil 4)) (list nil :bar :foo :quux)))
-  ;;     (assert (= (map key (assoc m2 nil 4)) (list :quux :foo :bar nil)))))
+  (let [m1 (sorted-map)
+        c2 (comp - compare)
+        m2 (sorted-map-by c2)]
+    ;; (assert (identical? cljs.core.PersistentTreeMap (type m1)))
+    ;; (assert (identical? cljs.core.PersistentTreeMap (type m2)))
+    (assert (identical? compare (.-comp m1)))
+    (assert (zero? (count m1)))
+    (assert (zero? (count m2)))
+    (assert (nil? (rseq m1)))
+    (let [m1 (assoc m1 :foo 1 :bar 2 :quux 3)
+          m2 (assoc m2 :foo 1 :bar 2 :quux 3)]
+      (assert (= (count m1) 3))
+      (assert (= (count m2) 3))
+      (assert (= (seq m1) (list [:bar 2] [:foo 1] [:quux 3])))
+      (assert (= (seq m2) (list [:quux 3] [:foo 1] [:bar 2])))
+      (assert (= (seq m1) (rseq m2)))
+      (assert (= (seq m2) (rseq m1)))
+      (assert (= (conj m1 [:wibble 4]) {:foo 1 :bar 2 :quux 3 :wibble 4}))
+      (assert (= (count (conj m1 [:wibble 4])) 4))
+      (assert (= (conj m2 [:wibble 4]) {:foo 1 :bar 2 :quux 3 :wibble 4}))
+      (assert (= (count (conj m2 [:wibble 4])) 4))
+      (assert (= (map key (assoc m1 nil 4)) (list nil :bar :foo :quux)))
+      (assert (= (map key (assoc m2 nil 4)) (list :quux :foo :bar nil)))))
   ;; (let [m (->> [[0 10] [20 30] [10 20] [50 60] [30 40] [40 50]]
   ;;              (mapcat (partial apply range))
   ;;              (mapcat #(list % %))
@@ -1365,16 +1365,16 @@
   ;;   (assert (= (count m) 60))
   ;;   (assert (= (seq m) s1))
   ;;   (assert (= (rseq m) s2)))
-  ;; (let [m (sorted-map :foo 1 :bar 2 :quux 3)]
-  ;;   (assert (= (dissoc m :foo) (hash-map :bar 2 :quux 3)))
-  ;;   (assert (= (count (dissoc m :foo)) 2))
-  ;;   (assert (= (hash m) (hash (hash-map :foo 1 :bar 2 :quux 3))))
-  ;;   (assert (= (subseq m < :foo)  (list [:bar 2])))
-  ;;   (assert (= (subseq m <= :foo) (list [:bar 2] [:foo 1])))
-  ;;   (assert (= (subseq m > :foo)  (list [:quux 3])))
-  ;;   (assert (= (subseq m >= :foo) (list [:foo 1] [:quux 3])))
-  ;;   (assert (= (map #(reduce (fn [_ x] x) %) m) (list 2 1 3)))
-  ;;   (assert (= (map #(reduce (fn [x _] x) 7 %) m) (list 7 7 7))))
+  (let [m (sorted-map :foo 1 :bar 2 :quux 3)]
+    (assert (= (dissoc m :foo) (hash-map :bar 2 :quux 3)))
+    (assert (= (count (dissoc m :foo)) 2))
+    (assert (= (hash m) (hash (hash-map :foo 1 :bar 2 :quux 3))))
+    (assert (= (subseq m < :foo)  (list [:bar 2])))
+    (assert (= (subseq m <= :foo) (list [:bar 2] [:foo 1])))
+    (assert (= (subseq m > :foo)  (list [:quux 3])))
+    (assert (= (subseq m >= :foo) (list [:foo 1] [:quux 3])))
+    (assert (= (map #(reduce (fn [_ x] x) %) m) (list 2 1 3)))
+    (assert (= (map #(reduce (fn [x _] x) 7 %) m) (list 7 7 7))))

   ;; ;; PersistentTreeSet
   ;; (let [s1 (sorted-set)


more tests added

more tests added

--- test/etaoin/api_test.clj
+++ test/etaoin/api_test.clj
@@ -6,13 +6,13 @@
             [etaoin.api :refer :all])
   (:import javax.imageio.ImageIO))

-;; (defmacro with-tmp-file [prefix suffix bind & body]
-;;   `(let [tmp# (java.io.File/createTempFile ~prefix ~suffix)
-;;          ~bind (.getAbsolutePath tmp#)]
-;;      (try
-;;        ~@body
-;;        (finally
-;;          (.delete tmp#)))))
+(defmacro with-tmp-file [prefix suffix bind & body]
+  `(let [tmp# (java.io.File/createTempFile ~prefix ~suffix)
+         ~bind (.getAbsolutePath tmp#)]
+     (try
+       ~@body
+       (finally
+         (.delete tmp#)))))

 (defn numeric? [val]
   (or (instance? Double val)
@@ -266,14 +266,9 @@
           (= "active-el-input")
           is))))

-;; (deftest test-element-text
-;;   (with-text "//*[@id='element-text']" text
-;;     (is (= text "Element text goes here."))))
-
-;; (deftest test-element-value
-;;   (when-chrome
-;;       (with-value "//*[@id='element-value']" value
-;;         (is (= value "value text")))))
+(deftest test-element-text
+  (let [text (get-element-text *driver* {:id :element-text})]
+    (is (= text "Element text goes here."))))

 ;; (deftest test-cookies
 ;;   (testing "getting all cookies"
@@ -372,12 +367,12 @@
 ;;     (with-cookies cookies
 ;;       (is (= cookies [])))))

-;; (deftest test-page-source
-;;   (let-source src
-;;     (when-firefox
-;;         (is (str/starts-with? src "")))
-;;     (skip-firefox
-;;         (is (str/starts-with? src "<!DOCTYPE html>")))))
+(deftest test-page-source
+  (let [src (get-source *driver*)]
+    (when-firefox *driver*
+      (is (str/starts-with? src "")))
+    (skip-firefox *driver*
+     (is (str/starts-with? src "<!DOCTYPE html>")))))

 ;; (deftest test-element-properties
 ;;   (when-firefox
@@ -387,13 +382,13 @@
 ;;                (is (= innerHTML "
Inner HTML
"))
 ;;                (is (= tagName "DIV")))))

-;; (deftest test-screenshot
-;;   (with-tmp-file "screenshot" ".png" path
-;;     (screenshot path)
-;;     (-> path
-;;         io/file
-;;         ImageIO/read
-;;         is)))
+(deftest test-screenshot
+  (with-tmp-file "screenshot" ".png" path
+    (screenshot *driver* path)
+    (-> path
+        io/file
+        ImageIO/read
+        is)))

 ;; (deftest test-js-execute
 ;;   (testing "simple result"


Read/write memorizations to file, resolves #5, #7, #8

--- src/memorystone/core.clj
+++ src/memorystone/core.clj
@@ -4,11 +4,14 @@
   (:require [cljminecraft.bukkit :as bk])
   (:require [cljminecraft.logging :as log]
             [cljminecraft.commands :as cmd]
-            [cljminecraft.world :as w])
+            [cljminecraft.world :as w]
+            [cljminecraft.items :as i])
   (:require [cljminecraft.files :as files]))

 (defonce plugin (atom nil))
 (defonce memorystones (atom #{}))
+(defonce memorizedstones (atom {}))
+

 ;; Persistence handling
 (defn memstone-to-file [{:keys [block name] :as memstone}]
@@ -33,7 +36,26 @@
   (let [{:keys [stones]} (files/read-json-file @plugin "stones.json")]
     (reset! memorystones (set (map memstone-from-file stones)))))

+(defn write-memory [player-name]
+  (let [memory (get @memorizedstones player-name)]
+    (files/write-json-file
+     @plugin
+     (str "memory-" player-name ".json")
+     {:memory memory})))
+
+(defn read-memory [player-name]
+  (let [{:keys [memory]} (files/read-json-file @plugin (str "memory-" player-name ".json"))]
+    (swap! memorizedstones update-in [player-name] (comp set concat) memory)))
+
 ;; Event Handling
+(defn memorize-stone! [player {:keys [name] :as memstone}]
+  (swap! memorizedstones update-in [player] (comp set conj) name)
+  (write-memory player))
+
+(defn unmemorize-stone! [player {:keys [name] :as memstone}]
+  (swap! memorizedstones update-in [player] (comp set disj) name)
+  (write-memory player))
+
 (defn sign-change [ev]
   (let [[type name] (seq (.getLines ev))]
     (cond
@@ -43,29 +65,51 @@
      (do
        (swap! memorystones conj {:block (.getBlock ev) :name name})
        (write-memstones)
-       (pl/send-msg ev "You placed a Memory Stone. Well done.")))))
+       {:msg "You placed a Memory Stone. Well done."}))))

 (defn memstone-for-block [block]
   (first (filter #(.equals block (:block %)) @memorystones)))

 (defn sign-break [ev]
   (when-let [memstone (memstone-for-block (.getBlock ev))]
-    (pl/send-msg ev "You broke a Memory Stone! oh dear.")
     (swap! memorystones disj memstone)
-    (write-memstones)))
+    (doseq [[player memorized] @memorizedstones]
+      (if (contains? memorized (:name memstone))
+        (unmemorize-stone! player memstone)))
+    (write-memstones)
+    {:msg "You broke a Memory Stone! oh dear."}))
+
+(defn player-interact [ev]
+  (if (and
+       (= (.getAction ev) (get ev/actions :left_click_block))
+       (i/is-block? (.getClickedBlock ev) :wall_sign :sign_post))
+    (if-let [memstone (memstone-for-block (.getClickedBlock ev))]
+      (do
+        (memorize-stone! (.getName (pl/get-player ev)) memstone)
+        {:msg (format "Memorized %s" (:name memstone))}))))
+
+(defn player-login [ev]
+  (read-memory (.getName (pl/get-player ev))))

 (defn events
   []
   [(ev/event "block.sign-change" #'sign-change)
-   (ev/event "block.block-break" #'sign-break)])
+   (ev/event "block.block-break" #'sign-break)
+   (ev/event "player.player-interact" #'player-interact)
+   (ev/event "player.player-login" #'player-login)])

 ;; Command Handling
+(defn get-memorized-stones [named]
+  (let [stones (get @memorizedstones (.getName named) #{})]
+    (filter #(contains? stones (:name %)) @memorystones)))
+
 (defmethod cmd/convert-type :memorystone [sender type arg]
-  (first (filter #(= (.toLowerCase (:name %)) (.toLowerCase arg)) @memorystones)))
+  (log/info "Converting %s" (get @memorizedstones (.getName sender) #{}))
+  (first (filter #(= (.toLowerCase (:name %)) (.toLowerCase arg)) (get-memorized-stones sender))))

 (defmethod cmd/param-type-tabcomplete :memorystone [sender type arg]
   (let [lower (.toLowerCase arg)]
-    (filter #(.startsWith % lower) (map #(.toLowerCase (:name %)) @memorystones))))
+    (filter #(.startsWith % lower) (map #(.toLowerCase (:name %)) (get-memorized-stones sender)))))

 (defn go-command [sender memorystone]
   (when memorystone


resolves #2329 by adding in hourly syncs for just the basic schema introspection.

--- src/metabase/task/sync_databases.clj
+++ src/metabase/task/sync_databases.clj
@@ -1,10 +1,12 @@
 (ns metabase.task.sync-databases
-  (:require [clojure.tools.logging :as log]
+  (:require [clj-time.core :as t]
+            [clojure.tools.logging :as log]
             (clojurewerkz.quartzite [jobs :as jobs]
                                     [triggers :as triggers])
             [clojurewerkz.quartzite.schedule.cron :as cron]
             (metabase [db :as db]
                       [task :as task])
+            [metabase.driver :as driver]
             [metabase.models.database :refer [Database]]
             [metabase.sync-database :as sync-database]))

@@ -18,10 +20,15 @@
 (jobs/defjob SyncDatabases
   [ctx]
   (dorun
-    (for [database (db/sel :many Database :is_sample false)] ; skip Sample Dataset DB
+    (for [database (db/sel :many Database :is_sample true)] ; skip Sample Dataset DB
       (try
         ;; NOTE: this happens synchronously for now to avoid excessive load if there are lots of databases
-        (sync-database/sync-database! database)
+        (if-not (and (= 0 (t/hour (t/now)))
+                     (driver/driver-supports? (:engine database) :dynamic-schema))
+          ;; most of the time we do a quick sync and avoid the lengthy analysis process
+          (sync-database/sync-database! database :full-sync? false)
+          ;; at midnight we run the full sync
+          (sync-database/sync-database! database :full-sync? true))
         (catch Throwable e
           (log/error "Error syncing database: " (:id database) e))))))

@@ -37,7 +44,7 @@
                                    (triggers/with-identity (triggers/key sync-databases-trigger-key))
                                    (triggers/start-now)
                                    (triggers/with-schedule
-                                     ;; run at midnight daily
-                                     (cron/cron-schedule "0 0 0 * * ? *"))))
+                                     ;; run at the end of every hour
+                                     (cron/cron-schedule "0 50 * * * ? *"))))
   ;; submit ourselves to the scheduler
   (task/schedule-task! @sync-databases-job @sync-databases-trigger))


remove debug code

remove debug code

--- etc/synthdefs/synth-designs.clj
+++ etc/synthdefs/synth-designs.clj
@@ -267,7 +267,6 @@
            env       (env-gen:kr (env-adsr-ng attack decay sustain release attack_level sustain_level env_curve) :action FREE)]
        (out out_bus (pan2 (* amp-fudge env snd) pan amp))))

-   ;;   (show-graphviz-synth sonic-pi-beep)

    (defsynth sonic-pi-pulse [note 52
                              note_slide 0


Fix misleading indentation and remove useless (do ...)

--- src/clj/reply/eval_modes/standalone.clj
+++ src/clj/reply/eval_modes/standalone.clj
@@ -30,14 +30,13 @@
         failure-sentinel (Object.)
         result (if (empty? form)
                  failure-sentinel
-                 (do
-                   (try (reply-read-eval form)
-                   (catch InterruptedException e nil)
-                   (catch Throwable t
-                     (let [e (clojure.main/repl-exception t)]
-                       ((or print-err print) e)
-                       (println))
-                 failure-sentinel))))]
+                 (try (reply-read-eval form)
+                 (catch InterruptedException e nil)
+                 (catch Throwable t
+                   (let [e (clojure.main/repl-exception t)]
+                     ((or print-err print) e)
+                     (println))
+                   failure-sentinel)))]
     ;lazyseq: (1 2 3 4 5 ...)
     ;pr: "(1 2 3 4 5 ...)"
     (when (not= failure-sentinel result)


use PIXI namespace

use PIXI namespace

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -47,9 +47,9 @@

         ;; make the renderer
         rend (case engine
-               :webgl (js/PIXI.WebGLRenderer. wid hig canvas opts)
-               :canvas (js/PIXI.CanvasRenderer. wid hig canvas opts)
-               (js/PIXI.autoDetectRenderer. wid hig canvas opts))
+               :webgl (PIXI/WebGLRenderer. wid hig canvas opts)
+               :canvas (PIXI/CanvasRenderer. wid hig canvas opts)
+               (PIXI/autoDetectRenderer. wid hig canvas opts))

         ;; details of the generated renderer
         actual-canvas (.-view rend)


better handling of passed in canvas

better handling of passed in canvas

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -52,13 +52,13 @@
   :width         width of new canvas
   :height        height of new canvas"
   [{:keys [expand x y width height canvas engine background]
-      :or {expand false
-           x 0
-           y 0
-           width 800
-           height 600
-           background 0x500000
-           engine :auto}}]
+    :or {expand false
+         x 0
+         y 0
+         width 800
+         height 600
+         background 0x500000
+         engine :auto}}]
   (let [fswidth (.-innerWidth js/window)
         fsheight (.-innerHeight js/window)

@@ -92,9 +92,9 @@
       ;; and add it to the DOM
       (do
         (dom/set-style! actual-canvas
-                          :left (if expand 0 x)
-                          :top (if expand 0 y)
-                          :position "absolute")
+                        :left (if expand 0 x)
+                        :top (if expand 0 y)
+                        :position "absolute")
         (dom/append! (.-body js/document) actual-canvas)))

     (let [wind-width (if expand fswidth canvas-width)
@@ -220,14 +220,14 @@
   "
   [opts]
   (let [{:keys [renderer canvas layer layers stage
-                origins] :or {origins {}} :as world}
+                origins fullscreen-button] :or {origins {}} :as world}
         (into (make opts)
               (make-stage opts))]
     ;; add the stages to the canvas
     (doall
      (map
       (fn [[name layer-obj]]
-        ;(log "adding to:" (str stage) " layer:" (str layer-obj))
+                                        ;(log "adding to:" (str stage) " layer:" (str layer-obj))
         (.addChild stage layer-obj)
         (center-container! canvas layer-obj (or (origins name) :center)))
       layer))


Added SQL statement logging support to BoneCP.

BoneCP has some statement logging features that allow better understanding of
database operation; they are also now exposed to the world for configuration.

The test database setup enables unconditional logging by default.

Signed-off-by: Daniel Pittman <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@puppetlabs.com>

--- src/com/puppetlabs/cmdb/scf/storage.clj
+++ src/com/puppetlabs/cmdb/scf/storage.clj
@@ -1,5 +1,6 @@
 (ns com.puppetlabs.cmdb.scf.storage
-  (:import (com.jolbox.bonecp BoneCPDataSource BoneCPConfig))
+  (:import (com.jolbox.bonecp BoneCPDataSource BoneCPConfig)
+           (java.util.concurrent TimeUnit))
   (:require [com.puppetlabs.cmdb.catalog :as cat]
             [com.puppetlabs.utils :as utils]
             [clojure.java.jdbc :as sql]
@@ -14,7 +15,8 @@
        :dynamic true}
   *db* {:classname "org.h2.Driver"
         :subprotocol "h2"
-        :subname "mem:cmdb;DB_CLOSE_DELAY=-1"})
+        :subname "mem:cmdb;DB_CLOSE_DELAY=-1"
+        :log-statements true})

@@ -275,21 +277,29 @@
 (defn- new-connection-pool-instance
   "Create a new connection pool for the SCF database, configured appropriately,
 and return it."
-  [{:keys [subprotocol subname username password] :as db}]
+  [{:keys [subprotocol subname username password
+           partition-conn-min partition-conn-max partition-count
+           stats log-statements log-slow-statements]
+    :or {partition-conn-min 1
+         partition-conn-max 10
+         partition-count    5
+         stats              true}
+    :as db}]
   (let [config (doto (new BoneCPConfig)
-                 ;; constants
                  (.setDefaultAutoCommit false)
                  (.setLazyInit true)
-                 ;; configurable with default
-                 (.setStatisticsEnabled (get db :stats true))
-                 (.setMinConnectionsPerPartition (get db :partition-conn-min 1))
-                 (.setMaxConnectionsPerPartition (get db :partition-conn-max 10))
-                 (.setPartitionCount (get db :partition-count 5))
+                 (.setMinConnectionsPerPartition partition-conn-min)
+                 (.setMaxConnectionsPerPartition partition-conn-max)
+                 (.setPartitionCount partition-count)
+                 (.setStatisticsEnabled stats)
                  ;; paste the URL back together from parts.
                  (.setJdbcUrl (str "jdbc:" subprotocol ":" subname)))]
     ;; configurable without default
     (when username (.setUsername config username))
     (when password (.setPassword config password))
+    (when log-statements (.setLogStatementsEnabled config log-statements))
+    (when log-slow-statements
+      (.setQueryExecuteTimeLimit config log-slow-statements (TimeUnit/SECONDS)))
     ;; ...aaand, create the pool.
     (BoneCPDataSource. config)))


Update default reactions.

Update default reactions.

--- src/oc/storage/config.clj
+++ src/oc/storage/config.clj
@@ -79,6 +79,6 @@
   "Press"
   "Sales"})

-(def default-reactions ["👌" "👀" "🇫🇰"])
+(def default-reactions ["👌" "👀" "💥"])

 (def default-limit 20)


(PDB-4807) Disable schema checks during schema mismatch test

So we don't request a shutdown during the test.

--- test/puppetlabs/puppetdb/migration_coordination_test.clj
+++ test/puppetlabs/puppetdb/migration_coordination_test.clj
@@ -24,11 +24,15 @@
   (doseq [db-upgraded? [true false]]
     (with-unconnected-test-db
        (call-with-puppetdb-instance
-       (-> (create-temp-config)
-           (assoc :database *db*)
-           ;; Allow client connections to timeout more quickly to speed test
-           (assoc-in [:database :connection-timeout] 300)
-           (assoc-in [:database :gc-interval] 0))
+        (assoc (create-temp-config)
+               :database (merge *db*
+                                ;; Allow client connections to timeout
+                                ;; more quickly to speed test, and
+                                ;; don't shutdown on schema
+                                ;; mismatches.
+                                {:connection-timeout 300
+                                 :gc-interval 0
+                                 :schema-check-interval 0}))
        (fn []
          (jdbc/with-transacted-connection *db*
            ;; Simulate either the db or pdb being upgraded before the other.


Fix routing acks which start out as zero

--- src/onyx/messaging/acking_daemon.clj
+++ src/onyx/messaging/acking_daemon.clj
@@ -27,17 +27,17 @@
         (swap!
           (:ack-state daemon)
           (fn [state]
-            (let [ack (get state message-id)
-                  updated-ack-val (if-let [current-ack-val (:ack-val ack)]
-                                    (bit-xor current-ack-val ack-val))]
-              (cond (nil? updated-ack-val)
-                    (assoc state message-id (->Ack nil completion-id ack-val))
-                    (zero? updated-ack-val)
-                    (dissoc state message-id)
-                    :else
-                    (assoc state message-id (assoc ack :ack-val updated-ack-val))))))]
-    (when-not (get rets message-id)
-      (>!! (:completions-ch daemon) {:id message-id :peer-id completion-id}))))
+            (if-let [ack (get state message-id)]
+              (let [updated-ack-val (bit-xor (:ack-val ack) ack-val)]
+                (if (zero? updated-ack-val)
+                  (dissoc state message-id)
+                  (assoc state message-id (assoc ack :ack-val updated-ack-val))))
+              (if (zero? ack-val)
+                state
+                (assoc state message-id (->Ack nil completion-id ack-val))))))]
+    (when (get rets message-id)
+      (>!! (:completions-ch daemon) {:id message-id
+                                     :peer-id completion-id}))))

 (defn gen-message-id
   "Generates a unique ID for a message - acts as the root id."
@@ -58,3 +58,5 @@
         (persistent! coll)
         (recur (inc n)
                (conj! coll (.nextLong rng)))))))
+
+


[#2537] UI error are only displayed on 4xx errors

--- backend/src/akvo/lumen/endpoint/aggregation.clj
+++ backend/src/akvo/lumen/endpoint/aggregation.clj
@@ -29,7 +29,7 @@
              {:message (format "JSON parse exception: %s" (.getMessage e))}))
           (catch Exception e
             (log/error e)
-            (http/internal-server-error {:message (.getMessage e)})))
+            (http/bad-request {:message (.getMessage e)})))
         (http/bad-request {:message "No query supplied"})))))

 (defn routes [{:keys [tenant-manager] :as opts}]


Use lowercase (for better readability)

Use lowercase (for better readability)

--- src/braid/client/register/views/user.cljs
+++ src/braid/client/register/views/user.cljs
@@ -45,7 +45,7 @@

 (defn returning-user-view []
   [:div.returning-user
-   [:h1 "Log In to Braid"]
+   [:h1 "Log in to Braid"]
    [:p "Don't have an account?"
     [:button {:on-click (fn [_]
                      (dispatch [:register.user/set-user-register? true]))}


+vp-32

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -379,6 +379,18 @@
                             :rule "vp-pronoun-nonphrasal"
                             :synsem {:cat :verb
                                      :infl {:not :past}}})
+
+                   ;; e.g. used as: "io mi chiamo Luisa" -
+                   ;; [s-present-phrasal 'io' [vp-pronoun-phrasal 'mi' [vp-32 'chiamo' 'Luisa']]]
+                   (unifyc h32
+                           root-is-head
+                           {:rule "vp-32"
+                            :head {:phrasal false}
+                            :synsem {:aux false
+                                     :infl {:not :past}
+                                     :cat :verb}})
+
+
                    (unifyc h10
                            root-is-comp
                            {:head {:phrasal false


(analyze) can accept a model as well as a function - if a model, then it should be a map with a :lookup key; and the value of this key should be a function.

--- src/babel/italiano/workbook.clj
+++ src/babel/italiano/workbook.clj
@@ -67,9 +67,12 @@

 (defn analyze
   ([surface-form]
-   (morph/analyze surface-form (:lookup medium)))
+   (analyze surface-form medium))
   ([surface-form model]
-   (morph/analyze surface-form (:lookup medium))))
+   (cond (fn? model)
+         (morph/analyze surface-form model)
+         true
+         (morph/analyze surface-form (:lookup model)))))

 (defn over
   ([arg1]


[clojure/plumbing] update clojure 1.6 + plumbing 0.3.3

--- src/picsou/time/pred.clj
+++ src/picsou/time/pred.clj
@@ -384,7 +384,7 @@

       [token]) ; default for other dims
     (catch Throwable e
-      (.printStackTrace e)
+      (errorf e "Error while resolving %s" (dissoc token :route))
       (print-token token)
       (throw (ex-info (format "Error while resolving %s" (dissoc token :route)) {})))))


Display last spec (rather than first one) as the spec applied

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -132,7 +132,7 @@
               println)
          (print-data "Original" chunk)
          (println (pad-left "Spec" 10))
-         (print-spec "Applied" (:spec (first chunk))))))))
+         (print-spec "Applied" (:spec (peek chunk))))))))

 (defn pinpoint-out
   ([ed] (pinpoint-out ed {}))


Support seqs

Support seqs

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -9,10 +9,13 @@
   (if (empty? in)
     (let [pos (dec (second (z/position z)))]
       [pos (+ pos (z/length z))])
-    (cond (z/vector? z) (recur (z/get z k) more)
-          (z/map? z) (let [z' (z/get z k)]
-                       (recur (if (= (first more) 0) (z/left z') z')
-                              (rest more))))))
+    (cond (or (z/seq? z) (z/vector? z))
+          (recur (z/get z k) more)
+
+          (z/map? z)
+          (let [z' (z/get z k)]
+            (recur (if (= (first more) 0) (z/left z') z')
+                   (rest more))))))

 (defn extract [val in]
   (let [z (z/of-string (pp/pr-str val) {:track-position? true})]


Resolve event storm bug

Resolve event storm bug

Also quiets peer browser sessions showing a spinner or
giving a status message when loading files.
Closes #33

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/planviz/actions.cljs
+++ src/planviz/actions.cljs
@@ -145,13 +145,15 @@
     true)) ;; for deferreds

 (defn my-user-action [action]
-  (let [action (if (or (:plid action) (= (:type action) :chat)) action
-                   (assoc action
-                     :plid (:ui/show-plan (st/get-ui-opts))))]
-    (println "MY USER-ACTION" action)
-    ;; (rmethod {:success-fn generic-reply :error-fn generic-reply}
-    (rmethod {}
-      :user-action action)))
+  (let [action-type (:type action)
+        chat? (= action-type :chat)
+        plid (or (:plid action) (:ui/show-plan (st/get-ui-opts)))
+        action (if chat? action (assoc action :plid plid))]
+    (when (or chat? (not= plid :none))
+      (println "MY USER-ACTION" action)
+      ;; (rmethod {:success-fn generic-reply :error-fn generic-reply}
+      (rmethod {}
+        :user-action action))))

 (defn update-tpn-end [plid]
   (let [end (if (= (st/app-get-plan-value plid :type) :tpn-network)
@@ -313,7 +315,7 @@
                 (on-realized (new-plan (normalize-plan plan-id plan))
                   #(do
                      (success! d %)
-                     (status-msg "loaded" plan-id)
+                     ;; (status-msg "loaded" plan-id)
                      (st/app-set :app/loading nil)
                      (apply-network-updates true))
                   #(do
@@ -906,11 +908,12 @@
 (defn highlight-relevant [&[remote]]
   (let [{:keys [ui/show-plan ui/show-network ui/network-type]} (st/get-ui-opts)
         {:keys [corresponding selection]} (st/app-get-plan show-plan)
-        csel (if corresponding (st/app-get-plan-value corresponding :selection))
+        csel (if (and corresponding selection)
+               (st/app-get-plan-value corresponding :selection))
         auto-on? (auto?)]
     (println "HIGHLIGHT-RELEVANT" show-plan show-network network-type
       "CORRESPONDING" corresponding
-      "SELECTION" selection)
+      "SELECTION" selection "CSEL" csel)
     (when csel
       (case network-type
         :hem-network
@@ -1100,7 +1103,7 @@
           "focus" focus)
         (if (and plid-loaded? (not load-corresponding?))
           (do
-            (status-msg "display-plan" plid)
+            ;; (status-msg "display-plan" plid)
             (st/app-set :app/title (name plid))
             (st/tooltips tooltips?)
             (st/show-plan plid)
@@ -1175,8 +1178,8 @@
             (chain dtimeout #(load-plan plan-id opts)))
           :else
           (do
-            (status-msg "loading" plan-id)
-            (st/loading true)
+            ;; (status-msg "loading" plan-id)
+            ;; (st/loading true)
             (st/app-set :app/loading d)
             (request-plan-part plan-id have-parts)
             dtimeout
@@ -1464,13 +1467,16 @@
         to-show (if (and auto-on? ;; assuming we want to show HTN or TPN
                       (not= remote client))
                   (or corresponding plid))
-        ready? (and plid-loaded? (not load-corresponding?)
+        ready? (or
+                 (= :chat action-type)
+                 (and plid-loaded? (not load-corresponding?))
                  ;; do NOT require showing this HTN or TPN
                  ;; (= showing to-show)
                  )
         opts {:auto true}]
     (when (not= remote client)
-      (println "USER-ACTION" action))
+      (println "USER-ACTION" action "ready?" ready? "plid-loaded?" plid-loaded?
+        "load-corresponding?" load-corresponding?))
     (if ready?
       (do
         (case action-type


Move symbol

Move symbol

--- src/play_clj/physics.clj
+++ src/play_clj/physics.clj
@@ -146,6 +146,8 @@
 (defmacro polygon-shape [& body] `(p2d/polygon-shape ~@body))
 (defmacro polygon-shape! [& body] `(p2d/polygon-shape! ~@body))

+
+(def init-bullet p3d/init-bullet)
 (def bullet-3d* p3d/bullet-3d*)
 (defmacro bullet-3d [& body] `(p3d/bullet-3d ~@body))
 (defmacro bullet-3d! [& body] `(p3d/bullet-3d! ~@body))
@@ -173,7 +175,3 @@
 (def sphere-shape* p3d/sphere-shape*)
 (defmacro sphere-shape [& body] `(p3d/sphere-shape ~@body))
 (defmacro sphere-shape! [& body] `(p3d/sphere-shape! ~@body))
-
-(defn init-bullet!
-  []
-  @p3d/init-bullet)


Convert lesson 02 to function-first-api

Convert lesson 02 to function-first-api

--- src/cljs/gampg/learn_gamma/lesson_02.cljs
+++ src/cljs/gampg/learn_gamma/lesson_02.cljs
@@ -1,14 +1,11 @@
 (ns gampg.learn-gamma.lesson-02
-    (:require [clojure.string :as s]
+  (:require [clojure.string :as s]
             [gamma.api :as g]
             [gamma.program :as p]
-            [gamma.tools :as gt]
+            [gamma-driver.api :as gd]
             [gamma-driver.drivers.basic :as driver]
-            [gamma-driver.protocols :as dp]
-            [goog.webgl :as ggl]
             [thi.ng.geom.core :as geom]
-            [thi.ng.geom.core.matrix :as mat :refer [M44]]
-            [thi.ng.geom.webgl.arrays :as arrays]))
+            [thi.ng.geom.core.matrix :as mat :refer [M44]]))

 (def title
   "2. Adding colour")
@@ -70,7 +67,7 @@
   (let [w                 (.-clientWidth node)
         h                 (.-clientHeight node)
         driver            (make-driver gl)
-        program           (dp/program driver program-source)
+        program           program-source
         p                 (get-perspective-matrix w h)
         mv                (mat/matrix44)
         triangle-vertices [[ 0  1  0]
@@ -91,6 +88,6 @@
     (.clearColor gl 0 0 0 1)
     (.clear gl (bit-or (.-COLOR_BUFFER_BIT gl) (.-DEPTH_BUFFER_BIT gl)))
     (let [mv (geom/translate mv [-1.5 0 -7])]
-      (driver/draw-arrays driver program (get-data p mv triangle-vertices triangle-colors) {:draw-mode :triangles}))
+      (gd/draw-arrays driver (gd/bind driver program (get-data p mv triangle-vertices triangle-colors)) {:draw-mode :triangles}))
     (let [mv (geom/translate mv [3 0 -7])]
-      (driver/draw-arrays driver program (get-data p mv square-vertices square-colors) {:draw-mode :triangle-strip}))))
+      (gd/draw-arrays driver (gd/bind driver program (get-data p mv square-vertices square-colors)) {:draw-mode :triangle-strip}))))


docker container support

docker container support

--- src/clojure/hurricane/superviser/core.clj
+++ src/clojure/hurricane/superviser/core.clj
@@ -50,6 +50,7 @@
                          "-v" (str proj-path ":" "/opt")
                          "-p" (str worker-port ":" worker-port)
                          "-d"
+                         "clojure"
                          "lein" "trampoline" "run"
                          "worker"
                          (str "--port=" worker-port)


CMR-778: Added :no-spatial to GSR check.

--- src/cmr/indexer/data/concepts/granule.clj
+++ src/cmr/indexer/data/concepts/granule.clj
@@ -60,6 +60,9 @@
       (or (= gsr :geodetic) (= gsr :cartesian))
       (let [geometries (seq (get-in granule [:spatial-coverage :geometries]))]
         (spatial/spatial->elastic-docs gsr granule))
+
+      (= gsr :no-spatil)
+      nil

       (= gsr :orbit)
       (let [orbit (get-in granule [:spatial-coverage :orbit])


Reliably shutdown

Reliably shutdown

Apparently the RMQ broker won't send basic.cancel-ok untill all the
unack'd messages have been ack'd. To achieve this, begin draining
pending messages immediately after sending basic.cancel.

--- src/com/farmlogs/conduit/subscription.clj
+++ src/com/farmlogs/conduit/subscription.clj
@@ -96,9 +96,6 @@
                (:queue-name queue-config))
     (rmq.basic/cancel rmq-chan consumer-tag)

-    ;; Wait until the server acknowledges the cancellation of our subscription
-    @cancelled?
-
     ;; Close pending-messages so we can drain it
     (a/close! pending-messages)

@@ -108,6 +105,9 @@
       (when-not (nil? unhandled-msg)
         (a/>!! result-chan :retry)
         (recur (a/<!! pending-messages))))
+
+    ;; Wait until the server acknowledges the cancellation of our subscription
+    @cancelled?

     ;; Let the ack-process know it can terminate
     (a/close! new-messages)


Modify list migrations to return a nice sequence of maps.

--- src/cadence/model/migration.clj
+++ src/cadence/model/migration.clj
@@ -35,10 +35,15 @@

 (defn list-migrations
   ([db]
-  (let [defined @rag/defined-migrations
-        applied (rag/applied-migrations db)
-        all (union (set defined) (set applied))]
-    all))
+  (let [defined (vals @rag/defined-migrations)
+        applied-ids (rag/applied-migration-ids db)]
+    (map (fn [migration]
+           (let [doc (:doc (meta migration))
+                 id (:id migration)]
+             {:id (str id)
+              :doc doc
+              :applied? (contains? applied-ids (:id migration))}))
+         defined)))
   ([] (list-migrations mo/*mongodb-database*)))

 (defn run-migrations


Re-implement core to gain performance and simplify code #44 - intermediate refactoring for changes ByteBuffers collecting for sending to remote

--- src/flatgui/samples/forms/viswindow.clj
+++ src/flatgui/samples/forms/viswindow.clj
@@ -36,14 +36,9 @@
      :background (awt/color 9 17 26)
      :click-happened false
      :evolvers {:click-happened click-happened-evolver}
-     :children {:c1_1 (fg/defcomponent
-                      floatingbar/floatingbar
-                      :c1_1
-                      {:position-matrix (m/translation 0.25 0.25)
-                       :clip-size (m/defpoint 0.5 0.5)
-                       :background (awt/color 26 86 17)
-                       :look bar-look
-                       })}}
+     :children {
+
+                }}

     (fg/defcomponent
       floatingbar/floatingbar
@@ -52,6 +47,19 @@
        :clip-size (m/defpoint 2 2)
        :background (awt/color 86 26 17)
        :look bar-look
-       :visible false
-       :evolvers {:visible visible-evolver}
+       :visible true
+       :click-happened false
+       :evolvers {:visible visible-evolver
+                  :click-happened click-happened-evolver}
+       :children {:c1_1 (fg/defcomponent
+                          floatingbar/floatingbar
+                          :c1_1
+                          {:position-matrix (m/translation 0.25 0.25)
+                           :clip-size (m/defpoint 0.5 0.5)
+                           :background (awt/color 26 86 17)
+                           :look bar-look
+                           :popup true
+                           :visible false
+                           :evolvers {:visible visible-evolver}
+                           })}
        })))


Type-hint Tundra disk writes

Type-hint Tundra disk writes

--- src/taoensso/carmine/tundra/disk.clj
+++ src/taoensso/carmine/tundra/disk.clj
@@ -20,7 +20,8 @@

 (defn- read-ba  [path] (Files/readAllBytes (path* path)))
 (defn- write-ba [path ba]
-  (Files/write (path* path) ba
+  (Files/write ^Path (path* path) ^bytes ba
+    ^"[Ljava.nio.file.OpenOption;"
     (into-array OpenOption [StandardOpenOption/CREATE
                             StandardOpenOption/TRUNCATE_EXISTING
                             StandardOpenOption/WRITE


Tundra disk: fix missing type hints

Tundra disk: fix missing type hints

--- src/taoensso/carmine/tundra/disk.clj
+++ src/taoensso/carmine/tundra/disk.clj
@@ -15,7 +15,7 @@
 (comment (<fname-safe (>fname-safe "hello f8 8 93#**#\\// !!$")))

 (defn- path*  [path] (Paths/get "" (into-array String [path])))
-(defn- mkdirs [path] (.mkdirs (.toFile (path* path))))
+(defn- mkdirs [path] (.mkdirs ^java.io.File (.toFile ^Path (path* path))))
 (defn- mv [path-source path-dest]
   (Files/move (path* path-source) (path* path-dest)
     (into-array CopyOption [StandardCopyOption/ATOMIC_MOVE


Make Ash's effect sit in :replace-access instead of :successful-run for better interactions with other "successful run" effects like Sneakdoor Beta.

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -19,8 +19,9 @@
                          :effect (req (max-access state side 0)
                                       (let [ash card]
                                         (swap! state update-in [:run :run-effect]
-                                               #(assoc % :successful-run
-                                                         {:effect (effect (handle-access [ash])) :card ash}))))
+                                               #(assoc % :replace-access
+                                                         {:mandatory true
+                                                          :effect (effect (handle-access [ash])) :card ash}))))
                          :msg "prevent the Runner from accessing cards other than Ash 2X3ZB9CY"}}]}

    "Awakening Center"


Stick to JSON for js.

Stick to JSON for js.

--- src/clj/geschichte/platform.clj
+++ src/clj/geschichte/platform.clj
@@ -74,7 +74,7 @@
                                                         (.write out (:value m))
                                                         (.toByteArray out)))
                                    (let [baos (ByteArrayOutputStream. (* 100 1024 1024))
-                                         writer (transit/writer baos :msgpack)]
+                                         writer (transit/writer baos :json)]
                                      (.write baos (byte-array 1 (byte 1)))
                                      (transit/write writer m)
                                      (cli/send ws :byte (.toByteArray baos)))
@@ -98,7 +98,7 @@

                                  1
                                  (let [bais (ByteArrayInputStream. blob)
-                                       reader (transit/reader bais :msgpack)
+                                       reader (transit/reader bais :json)
                                        m (transit/read reader)]
                                    (debug "client received transit blob from:"
                                           url (take 10 (map byte blob)))
@@ -152,7 +152,7 @@
                                                          (.write out (:value m))
                                                          (.toByteArray out)))
                                  (let [baos (ByteArrayOutputStream. (* 100 1024 1024))
-                                       writer (transit/writer baos :msgpack)]
+                                       writer (transit/writer baos :json)]
                                    (.write baos (byte-array 1 (byte 1)))
                                    (transit/write writer m)
                                    (send! channel (.toByteArray baos) #_(str " " (pr-str m))))))
@@ -182,7 +182,7 @@

                                                    1
                                                    (let [bais (ByteArrayInputStream. blob)
-                                                         reader (transit/reader bais :msgpack)
+                                                         reader (transit/reader bais :json)
                                                          m (transit/read reader)]
                                                      (debug "client received transit blob from:"
                                                             url (take 10 (map byte blob)))


Increase blob size.

Increase blob size.

--- src/clj/geschichte/platform.clj
+++ src/clj/geschichte/platform.clj
@@ -204,7 +204,7 @@
                                            first
                                            second
                                            read-string)
-                                :max-body (* 100 1024 1024)}))))
+                                :max-body (* 512 1024 1024)}))))

 (defn stop [peer]


Support for the 'like' operator in SQL

Support for the 'like' operator in SQL

--- src/clj_mrazik/db_interface.clj
+++ src/clj_mrazik/db_interface.clj
@@ -47,21 +47,33 @@
                      :copyrighted     copyrighted
                      :source          source}))

+(defn update-word
+    [word use-like]
+    (if use-like
+        (-> word .toLowerCase (.replaceAll "\\*" "%"))
+        (-> word .toLowerCase)))
+
+(defn add-where-clause
+    [word use-like]
+    (if use-like
+        "where lower(term) like ?"
+        "where lower(term)=?"))
+
 (defn select-words
-    [word]
+    [word use-like]
     (jdbc/query db-spec/mrazik-db
-        ["select term, description,
+        [("select term, description,
                  (select class from classes where classes.id=dictionary.class) as class,
                  use, incorrect_forms, correct_forms, see_also, internal, verified, copyrighted,
                  (select source from sources where sources.id=dictionary.source) as source,
                  (select product from products where products.id=dictionary.product) as product
-                 from dictionary where lower(term)=?" (.toLowerCase word)]))
+                 from dictionary " (add-where-clause word use-like)) (update-word word use-like)]))

 (defn select-word-count
-    [word]
+    [word use-like]
     (->
         (jdbc/query db-spec/mrazik-db
-            ["select count(*) as cnt from dictionary where lower(term)=?" (.toLowerCase word)])
+            [(str "select count(*) as cnt from dictionary " (add-where-clause word use-like)) (update-word word use-like)])
         first
         :cnt))


Shift placement of `moduleDescription` in let

putting it before `jsModule`

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -49,6 +49,8 @@
                                 departmentToFacultyIndexHash
                                 departmentStringsArray
                                 auxModuleArrayRepr)
+            moduleDescription (aux-module-array-repr/get-module-description
+                                auxModuleArrayRepr)
             ; This will be pushed onto the `modulesArray` to be returned by
             ; the function
             jsModule          (js-obj "type" "Module", "label" moduleCode,
@@ -58,9 +60,7 @@
                                       "exam" moduleExamDate,
                                       "lectureTimings" lectureTimings,
                                       "tutorialTimings" tutorialTimings,
-                                      "department" moduleDepartment)
-            moduleDescription (aux-module-array-repr/get-module-description
-                                auxModuleArrayRepr)]
+                                      "department" moduleDepartment)]
         (if (not= moduleDescription -1)
             (aset jsModule "description" moduleDescription))
         (if (< idx 10)


trigger deploy

trigger deploy

--- src/cljs/oxylab/components.cljs
+++ src/cljs/oxylab/components.cljs
@@ -43,11 +43,11 @@

 (defn bars []
   [:div
-   [:h5 "Species bars"]
+   [:h4 "Species bars"]
    (when (seq (get-in @s/state [:world :cells [0 0] :populations]))
      (for [[k p] (get-in @s/state [:world :cells [0 0] :populations])]
        [bar (str k) (:size p) (get-in @s/state [:world :species k :max-size])]))
-   [:h5 "Resource bars"]
+   [:h4 "Resource bars"]
    (when (seq (get-in @s/state [:world :cells [0 0] :resources]))
      (for [[k v] (get-in @s/state [:world :cells [0 0] :resources])]
        [bar (str k) (:size v) (:max-size v)]))])