Fix another core.async related failure.

Fix another core.async related failure.

--- test/onyx/log/percentage_multi_job_test.clj
+++ test/onyx/log/percentage_multi_job_test.clj
@@ -10,38 +10,6 @@

 (use-fixtures :once schema.test/validate-schemas)

-(def a-chan (chan 100))
-
-(def b-chan (chan (sliding-buffer 100)))
-
-(def c-chan (chan 100))
-
-(def d-chan (chan (sliding-buffer 100)))
-
-(defn inject-a-ch [event lifecycle]
-  {:core.async/chan a-chan})
-
-(defn inject-b-ch [event lifecycle]
-  {:core.async/chan b-chan})
-
-(defn inject-c-ch [event lifecycle]
-  {:core.async/chan c-chan})
-
-(defn inject-d-ch [event lifecycle]
-  {:core.async/chan d-chan})
-
-(def a-calls
-  {:lifecycle/before-task-start inject-a-ch})
-
-(def b-calls
-  {:lifecycle/before-task-start inject-b-ch})
-
-(def c-calls
-  {:lifecycle/before-task-start inject-c-ch})
-
-(def d-calls
-  {:lifecycle/before-task-start inject-d-ch})
-
 (deftest log-percentage-multi-job
   (let [onyx-id (java.util.UUID/randomUUID)
         config (load-config)
@@ -52,58 +20,36 @@
         env (onyx.api/start-env env-config)
         peer-group (onyx.api/start-peer-group peer-config)
         catalog-1 [{:onyx/name :a
-                    :onyx/plugin :onyx.plugin.core-async/input
+                    :onyx/plugin :onyx.test-helper/dummy-input
                     :onyx/type :input
-                    :onyx/medium :core.async
-                    :onyx/batch-size 20
-                    :onyx/doc "Reads segments from a core.async channel"}
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}

                    {:onyx/name :b
-                    :onyx/plugin :onyx.plugin.core-async/output
+                    :onyx/plugin :onyx.test-helper/dummy-output
                     :onyx/type :output
-                    :onyx/medium :core.async
-                    :onyx/batch-size 20
-                    :onyx/doc "Writes segments to a core.async channel"}]
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}]

         catalog-2 [{:onyx/name :c
-                    :onyx/plugin :onyx.plugin.core-async/input
+                    :onyx/plugin :onyx.test-helper/dummy-input
                     :onyx/type :input
-                    :onyx/medium :core.async
-                    :onyx/batch-size 20
-                    :onyx/doc "Reads segments from a core.async channel"}
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}

                    {:onyx/name :d
-                    :onyx/plugin :onyx.plugin.core-async/output
+                    :onyx/plugin :onyx.test-helper/dummy-output
                     :onyx/type :output
-                    :onyx/medium :core.async
-                    :onyx/batch-size 20
-                    :onyx/doc "Writes segments to a core.async channel"}]
-        lifecycles-1 [{:lifecycle/task :a
-                       :lifecycle/calls :onyx.log.percentage-multi-job-test/a-calls}
-                      {:lifecycle/task :a
-                       :lifecycle/calls :onyx.plugin.core-async/reader-calls}
-                      {:lifecycle/task :b
-                       :lifecycle/calls :onyx.log.percentage-multi-job-test/b-calls}
-                      {:lifecycle/task :b
-                       :lifecycle/calls :onyx.plugin.core-async/writer-calls}]
-        lifecycles-2 [{:lifecycle/task :c
-                       :lifecycle/calls :onyx.log.percentage-multi-job-test/c-calls}
-                      {:lifecycle/task :c
-                       :lifecycle/calls :onyx.plugin.core-async/reader-calls}
-                      {:lifecycle/task :d
-                       :lifecycle/calls :onyx.log.percentage-multi-job-test/d-calls}
-                      {:lifecycle/task :d
-                       :lifecycle/calls :onyx.plugin.core-async/writer-calls}]
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}]
         j1 (onyx.api/submit-job peer-config
                                 {:workflow [[:a :b]]
                                  :catalog catalog-1
-                                 :lifecycles lifecycles-1
                                  :percentage 70
                                  :task-scheduler :onyx.task-scheduler/balanced})
         j2 (onyx.api/submit-job peer-config
                                 {:workflow [[:c :d]]
                                  :catalog catalog-2
-                                 :lifecycles lifecycles-2
                                  :percentage 30
                                  :task-scheduler :onyx.task-scheduler/balanced})
         n-peers 10


Add DynamoDB client lib for Datomic in prod

Newer versions of Datomic no longer bundle this, so we need to provide
our own.

--- resources/leiningen/new/kraken_works/project.clj
+++ resources/leiningen/new/kraken_works/project.clj
@@ -13,6 +13,8 @@
                  [com.datomic/datomic-pro "0.9.5394"
                   :exclusions [org.slf4j/slf4j-nop
                                org.slf4j/slf4j-log4j12]]
+                 [com.amazonaws/aws-java-sdk-dynamodb "1.11.6"
+                  :exclusions [commons-codec commons-logging]]
                  [ch.qos.logback/logback-classic "1.1.7"]
                  [org.immutant/core "2.1.5"]
                  [democracyworks/kehaar "0.6.0"]]


Generate lazy "more" links for large collections

--- src/devtools/format.cljs
+++ src/devtools/format.cljs
@@ -2,6 +2,8 @@

 (def max-coll-elements 5)
 (def more-marker "…")
+(def max-number-body-items 100)
+(def body-items-more-label "more…")
 (def string-prefix-limit 20)
 (def string-postfix-limit 20)
 (def string-abbreviation-marker " … ")
@@ -10,7 +12,9 @@
 (def dq "\"")
 (def surrogate-key "$$surrogate")
 (def standard-ol-style "list-style-type:none; padding-left:0px; margin-top:0px; margin-bottom:0px; margin-left:12px")
+(def standard-ol-no-margin-style "list-style-type:none; padding-left:0px; margin-top:0px; margin-bottom:0px; margin-left:0px")
 (def standard-li-style "margin-left:12px")
+(def standard-li-no-margin-style "margin-left:0px")
 (def spacer " ")
 (def span "span")
 (def ol "ol")
@@ -155,29 +159,44 @@
 (defn build-header [value]
   (managed-pr-str value general-cljs-land-style 2))

-(defn standard-body-template [lines]
-  (template ol standard-ol-style (map #(template li standard-li-style %) lines)))
+(defn standard-body-template [lines margin?]
+  (let [ol-style (if margin? standard-ol-style standard-ol-no-margin-style)
+        li-style (if margin? standard-li-style standard-li-no-margin-style)]
+    (template ol ol-style (map #(template li li-style %) lines))))

 (defn body-line-template [index value]
   [(index-template index) spacer (managed-pr-str value (if cljs-value? general-cljs-land-style "") 3)])

-(defn body-lines-templates [value]
-  (loop [data (take 100 (seq value))                        ; TODO: generate "more" links for continuation
-         index 0
+(defn prepare-body-lines [data starting-index]
+  (loop [work data
+         index starting-index
          lines []]
-    (if (empty? data)
+    (if (empty? work)
       lines
-      (recur (rest data) (inc index) (conj lines (body-line-template index (first data)))))))
-
-(defn build-body [value]
-  (standard-body-template (body-lines-templates value)))
+      (recur (rest work) (inc index) (conj lines (body-line-template index (first work)))))))
+
+(defn body-lines-templates [value starting-index]
+  (let [seq (seq value)
+        chunk (take max-number-body-items seq)
+        rest (drop max-number-body-items seq)
+        lines (prepare-body-lines chunk starting-index)
+        continue? (not (empty? (take 1 rest)))]
+    (if-not continue?
+      lines
+      (let [surrogate-object (surrogate rest body-items-more-label)]
+        (aset surrogate-object "startingIndex" (+ starting-index max-number-body-items))
+        (conj lines (reference surrogate-object))))))
+
+(defn build-body [value starting-index]
+  (standard-body-template (body-lines-templates value starting-index) (zero? starting-index)))

 (defn build-surrogate-body [value]
   (if-let [body-template (aget value "bodyTemplate")]
     body-template
     (let [target (aget value "target")]
       (if (seqable? target)
-        (build-body target)
+        (let [starting-index (or (aget value "startingIndex") 0)]
+          (build-body target starting-index))
         (template ol standard-ol-style (template li standard-li-style (reference target (str target))))))))

 (defn want-value? [value]


Documentation improvements.

Documentation improvements.

--- src/afterglow/effects/oscillators.clj
+++ src/afterglow/effects/oscillators.clj
@@ -168,8 +168,8 @@
   source for [[sine]], [[square]], and [[triangle]].

   With no additional arguments, the waveform is defined by calling
-  `shape-fn` with an argument that ramps upward from `0` to `1` over
-  the course of each beat.
+  `shape-fn` with a phase argument that ramps upward from `0` to `1`
+  over the course of each beat.

   Passing the value `:bar` or `:phrase` with the optional keyword
   argument `:interval` makes the wave cycle over a bar or phrase
@@ -180,7 +180,10 @@
   bar, or phrase), and supplying a `:phase` will offset the oscillator
   from the underlying metronome phase by that amount. (See the
   [documentation](https://github.com/brunchboy/afterglow/blob/master/doc/oscillators.adoc#sawtooth-oscillators)
-  for an expanded explanation illustrated with graphs.)"
+  for an expanded explanation illustrated with graphs.)
+
+  The arguments after `shape-fn` can be [dynamic
+  parameters](https://github.com/brunchboy/afterglow/blob/master/doc/parameters.adoc#dynamic-parameters)."
   [shape-fn & {:keys [interval interval-ratio phase] :or {interval :beat interval-ratio 1 phase 0.0}}]
   {:pre [(or (fn? shape-fn) (satisfies? IVariableShape shape-fn))]}
   (params/validate-param-type interval clojure.lang.Keyword)


adjust balance sheet report test

adjust balance sheet report test

--- test/clj_money/models/reports_test.clj
+++ test/clj_money/models/reports_test.clj
@@ -263,7 +263,10 @@
                   {:caption "Retained Earnings"
                    :value 249M
                    :style :data
-                   :depth 0}]]
+                   :depth 0}
+                  {:caption "Liabilities + Equity"
+                   :value 749M
+                   :style :summary}]]
     (is (= expected actual) "The rpoert renders the correct data")))

 (def budget-report-context


Move the processing of wildcards to the separate function.

--- src/org/spootnik/cyanite/es_path.clj
+++ src/org/spootnik/cyanite/es_path.clj
@@ -63,16 +63,21 @@
                 (inc depth)
                 (inc nxt-dex)))))))))

+(defn process-wildcards
+  "Convert Graphite wildcards to regular expression"
+  [path]
+  (reduce (fn [s r] (str/replace s (first r) (second r)))
+          path [["." "\\."]
+                ["*" ".*"]
+                ["{" "("]
+                ["}" ")"]
+                ["," "|"]]))
+
 (defn build-es-filter
   "generate the filter portion of an es query"
   [path tenant leafs-only]
   (let [depth (path-depth path)
-        p (reduce (fn [s r] (str/replace s (first r) (second r)))
-                  path [["." "\\."]
-                        ["*" ".*"]
-                        ["{" "("]
-                        ["}" ")"]
-                        ["," "|"]])
+        p (process-wildcards path)
         f (vector
            {:range {:depth {:from depth :to depth}}}
            {:term {:tenant tenant}}


Add newline at end of file

Add newline at end of file

--- src/foreclojure/core.clj
+++ src/foreclojure/core.clj
@@ -73,4 +73,4 @@

 (defn -main [& args]
   (binding [*block-server* true]
-    (run)))+    (run)))


Support customized root query name

Support customized root query name

--- src/graphql_clj/type.clj
+++ src/graphql_clj/type.clj
@@ -114,10 +114,12 @@
          directives ((type-system-type-definitions :directive) definitions)
          schemas ((type-system-type-definitions :schema) definitions) ; validate only one schema has been defined
          schema (first schemas)
+         root-query-type-name (or (get-in schema [:schema :query-type :name])
+                                  "Query")
          ]
      {:schema schema
       :types (assoc-in (into default-types types)
-                       ["QueryRoot" :fields "__schema"]
+                       [root-query-type-name :fields "__schema"]
                        {:name "__schema" :type-field-type {:name "__Schema"}})
       :interfaces (into {} interfaces)
       :unions (into {} unions)


refactored a bit

refactored a bit

--- src/webdriver/dsl.clj
+++ src/webdriver/dsl.clj
@@ -30,9 +30,13 @@

 (defmacro with-element [term & body]
   `(if (bound? #'*element*)
-     (with-bindings {#'*element* (find-element-from-element *element* ~term)}
+     (with-bindings {#'*element* (api/find-element-from-element
+                                  *session* *element*
+                                  (make-selector ~term))}
        ~@body)
-     (with-bindings {#'*element* (find-element ~term)}
+     (with-bindings {#'*element* (api/find-element
+                                  *session*
+                                  (make-selector ~term))}
        ~@body)))

 (defn go-url [url]
@@ -70,7 +74,7 @@
 (defn wait [sec]
   (Thread/sleep (* sec 1000)))

-(deftest foo
+(deftest todo
   (with-session "127.0.0.1" 4444 {}
     (go-url "http://ya.ru")
     (wait 7)


Fix some more file encodings

Fix some more file encodings

--- src/refactor_nrepl/s_expressions.clj
+++ src/refactor_nrepl/s_expressions.clj
@@ -1,66 +1,66 @@
-(ns refactor-nrepl.s-expressions
-  (:require [rewrite-clj.zip :as zip]))
-
-(defn all-zlocs
-  "Generate a seq of all zlocs in a depth-first manner"
-  [zipper]
-  (take-while (complement zip/end?) (iterate zip/next zipper)))
-
-(defn- comment-or-string-or-nil? [zloc]
-  (or (nil? zloc)
-      (not (zip/sexpr zloc)) ; comment node
-      (string? (zip/sexpr zloc))))
-
-(defn get-next-sexp [file-content]
-  (let [zloc (zip/of-string file-content)]
-    (some (fn [zloc] (when-not (comment-or-string-or-nil? zloc)
-                       (zip/string zloc)))
-          (take-while (complement nil?) (iterate zip/right zloc)))))
-
-(defn get-last-sexp [file-content]
-  (let [zloc (->> file-content zip/of-string zip/rightmost)]
-    (some (fn [zloc] (when-not (comment-or-string-or-nil? zloc)
-                       (zip/string zloc)))
-          (take-while (complement nil?) (iterate zip/left zloc)))))
-
-(defn- zip-to
-  "Move the zipper to the node at line and col"
-  [zipper line col]
-  (let [distance (fn [zloc]
-                   (let [node (zip/node zloc)
-                         line-beg (dec (:row (meta node)))
-                         line-end (dec (:end-row (meta node)))
-                         col-beg (dec (:col (meta node)))
-                         col-end (dec (:end-col (meta node)))]
-                     (+ (* 1000 (Math/abs (- line line-beg)))
-                        (* 100 (Math/abs (- line line-end)))
-                        (* 10 (Math/abs (- col col-beg)))
-                        (Math/abs (- col col-end)))))]
-    (reduce (fn [best zloc] (if (< (distance zloc) (distance best))
-                              zloc
-                              best))
-            zipper
-            (all-zlocs zipper))))
-
-(defn get-enclosing-sexp
-  "Extracts the sexp enclosing point at LINE and COLUMN in FILE-CONTENT,
-  and optionally LEVEL.
-
-  A string is not treated as a sexp by this function. If LEVEL is
-  provided finds the enclosing sexp up to level. LEVEL defaults to 1
-  for the immediate enclosing sexp.
-
-  Both line and column are indexed from 0."
-  ([file-content line column]
-   (get-enclosing-sexp file-content line column 1))
-  ([file-content line column level]
-   (let [zloc (zip-to (zip/of-string file-content) line column)
-         zloc (nth (iterate zip/up zloc) (dec level))]
-     (cond
-       (and zloc (string? (zip/sexpr zloc))) (zip/string (zip/up zloc))
-       (and zloc (seq? (zip/sexpr zloc))) (zip/string zloc)
-       zloc (zip/string (zip/up zloc))
-       :else (throw (ex-info "Can't find sexp boundary"
-                             {:file-content file-content
-                              :line line
-                              :column column}))))))
+(ns refactor-nrepl.s-expressions
+  (:require [rewrite-clj.zip :as zip]))
+
+(defn all-zlocs
+  "Generate a seq of all zlocs in a depth-first manner"
+  [zipper]
+  (take-while (complement zip/end?) (iterate zip/next zipper)))
+
+(defn- comment-or-string-or-nil? [zloc]
+  (or (nil? zloc)
+      (not (zip/sexpr zloc)) ; comment node
+      (string? (zip/sexpr zloc))))
+
+(defn get-next-sexp [file-content]
+  (let [zloc (zip/of-string file-content)]
+    (some (fn [zloc] (when-not (comment-or-string-or-nil? zloc)
+                       (zip/string zloc)))
+          (take-while (complement nil?) (iterate zip/right zloc)))))
+
+(defn get-last-sexp [file-content]
+  (let [zloc (->> file-content zip/of-string zip/rightmost)]
+    (some (fn [zloc] (when-not (comment-or-string-or-nil? zloc)
+                       (zip/string zloc)))
+          (take-while (complement nil?) (iterate zip/left zloc)))))
+
+(defn- zip-to
+  "Move the zipper to the node at line and col"
+  [zipper line col]
+  (let [distance (fn [zloc]
+                   (let [node (zip/node zloc)
+                         line-beg (dec (:row (meta node)))
+                         line-end (dec (:end-row (meta node)))
+                         col-beg (dec (:col (meta node)))
+                         col-end (dec (:end-col (meta node)))]
+                     (+ (* 1000 (Math/abs (- line line-beg)))
+                        (* 100 (Math/abs (- line line-end)))
+                        (* 10 (Math/abs (- col col-beg)))
+                        (Math/abs (- col col-end)))))]
+    (reduce (fn [best zloc] (if (< (distance zloc) (distance best))
+                              zloc
+                              best))
+            zipper
+            (all-zlocs zipper))))
+
+(defn get-enclosing-sexp
+  "Extracts the sexp enclosing point at LINE and COLUMN in FILE-CONTENT,
+  and optionally LEVEL.
+
+  A string is not treated as a sexp by this function. If LEVEL is
+  provided finds the enclosing sexp up to level. LEVEL defaults to 1
+  for the immediate enclosing sexp.
+
+  Both line and column are indexed from 0."
+  ([file-content line column]
+   (get-enclosing-sexp file-content line column 1))
+  ([file-content line column level]
+   (let [zloc (zip-to (zip/of-string file-content) line column)
+         zloc (nth (iterate zip/up zloc) (dec level))]
+     (cond
+       (and zloc (string? (zip/sexpr zloc))) (zip/string (zip/up zloc))
+       (and zloc (seq? (zip/sexpr zloc))) (zip/string zloc)
+       zloc (zip/string (zip/up zloc))
+       :else (throw (ex-info "Can't find sexp boundary"
+                             {:file-content file-content
+                              :line line
+                              :column column}))))))


Disable buttons when connection is not selected using seesaw.bind

--- src/sqls/ui.clj
+++ src/sqls/ui.clj
@@ -1,6 +1,8 @@
+
 (ns sqls.ui
   "Deal with UI"
   (:use seesaw.core)
+  (:require [seesaw.bind :as b])
   (:require [sqls.stor :as stor])
   (:require seesaw.table)
   (:require sqls.ui.worksheet))
@@ -25,7 +27,6 @@
             :model [:columns [:name :desc :class]
                     :rows (map build-connection-list-item connections)])]
     t))
-

 (defn on-btn-add-connection-cancel
@@ -148,6 +149,21 @@
     (create-worksheet! conn-data)))

+(defn set-conn-list-frame-bindings!
+  [frame]
+  (let [conn-list-table (select frame [:#conn-list-table])
+        btn-connect (select frame [:#btn-connect])
+        btn-delete (select frame [:#btn-delete])]
+    (assert (not= conn-list-table nil))
+    (assert (not= btn-connect nil))
+    (assert (not= btn-delete nil))
+    (b/bind
+      (b/selection conn-list-table)
+      (b/transform (fn [s] (not= s nil)))
+      (b/property btn-connect :enabled?)
+      (b/property btn-delete :enabled?))))
+
+
 (defn create-login-ui
   "Create login window.
   Parameters:
@@ -161,8 +177,8 @@
   (println "settings" settings)
   (println "connections" connections)
   (let [btn-add (button :id :btn-new :text "Add" :listen [:action on-btn-add-click])
-        btn-delete (button :id :btn-delete :text "Delete" :listen [:action on-btn-delete-click])
-        btn-connect (button :id :btn-connect :text "Connect")
+        btn-delete (button :id :btn-delete :text "Delete" :enabled? false :listen [:action on-btn-delete-click])
+        btn-connect (button :id :btn-connect :text "Connect" :enabled? false)
         frame (frame :title "SQLS"
                :content (vertical-panel :id :panel
                                         :border 4
@@ -175,5 +191,6 @@
                                                                           btn-connect])])
                :on-close :exit)]
     (listen btn-connect :action (partial on-btn-connect-click frame (:create-worksheet handlers)))
+    (set-conn-list-frame-bindings! frame)
     frame))


fix base cost to have 1 user minimum instead of $10 minimum

--- src-cljs/frontend/models/plan.cljs
+++ src-cljs/frontend/models/plan.cljs
@@ -18,6 +18,6 @@
   (let [discount-pct (if (active-discount? plan)
                        (-> plan :discount/coupon :coupon/percent-off (/ 100))
                        0)
-        base-cost (* (count (:plan/active-custs plan))
+        base-cost (* (max 1 (count (:plan/active-custs plan)))
                      1000)]
-    (max 1000 (* base-cost (- 1 discount-pct)))))
+    (* base-cost (- 1 discount-pct))))


Rename EventType protocol.

Rename EventType protocol.

--- src-cljs/kixi/hecuba/history.cljs
+++ src-cljs/kixi/hecuba/history.cljs
@@ -77,7 +77,7 @@
        token->historian))

 (extend-type goog.History
-  event/EventType
+  event/IEventType
   (event-types [this]
     (into {}
           (map


don't copy paste things :( (#1068)

don't copy paste things :( (#1068)

--- src/cljs/main/broadfcui/page/workspace/notebooks/notebooks.cljs
+++ src/cljs/main/broadfcui/page/workspace/notebooks/notebooks.cljs
@@ -280,7 +280,7 @@
                   {:header "Worker Machine Type" :initial-width 150
                    :column-data (comp :workerMachineType :machineConfig)}
                   {:header "Worker Disk Size (GB)" :initial-width 150
-                   :column-data (comp :workerMachineType :machineConfig)}
+                   :column-data (comp :workerDiskSize :machineConfig)}
                   {:header "Worker Local SSDs" :initial-width 130
                    :column-data (comp :numberOfWorkerLocalSSDs :machineConfig)}
                   {:header "Preemptible Workers" :initial-width 150


Add mapv to core

Add mapv to core

--- src/aurora/ast.cljs
+++ src/aurora/ast.cljs
@@ -143,7 +143,16 @@
                     :id "append"
                     :args ["old" "new"]
                     :body `(set! notebook.next_state (cljs.core.update_in.call nil notebook.next_state cursor_old cljs.core.conj value_new))
-                    :return ["ok" nil]}})
+                    :return ["ok" nil]}
+   "mapv" {:type :prim
+           :id "mapv"
+           :args ["f" "xs"]
+           :body `(do
+                    (fn wrapped [x]
+                      (let! result (value_f x))
+                      (get! result 0))
+                    (let! result (cljs.core.mapv.call nil wrapped value_xs)))
+           :return `[result nil]}})

 (every? #(prim! core %) (vals core))


added docstrings about :default queue

added docstrings about :default queue

--- src/byplay/core.clj
+++ src/byplay/core.clj
@@ -51,7 +51,7 @@
   (str (ns-name (:ns (meta v))) "/" (:name (meta v))))

 (defn schedule-to
-  "Puts the job into the specified queue."
+  "Puts the job into the specified queue. If `nil` queue is specified then job will be scheduled to `:default` queue."
   [jdbc-conn queue job-var & args]
   (jdbc/execute (jdbc.types/->connection jdbc-conn)
                 ["INSERT INTO byplay (job, args, state, queue) values (?, ?, ?, ?)"
@@ -61,7 +61,8 @@
                  (queue-clj->sql (or queue :default))]))

 (defn schedule
-  "Puts the job into the queue specified in the job's metadata at `::queue`."
+  "Puts the job into the queue specified in the job's metadata at `::queue`.
+  If no queue is specified then job will be scheduled to `:default` queue."
   [jdbc-conn job-var & args]
   (let [queue (::queue (meta job-var))]
     (apply schedule-to jdbc-conn queue job-var args)))


click to download gif

click to download gif

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -279,8 +279,9 @@
         result-gif
           (dom/div nil
             (dom/h1 nil "Your Cellf")
-            (dom/img #js {:src result-gif})
-            "Save this gif and share your Cellf with the world."
+            (dom/a #js {:href result-gif :download "cellf.gif" :className "download"}
+              (dom/img #js {:src result-gif}))
+            "Click this gif to save it. Share your Cellf with the world."
             (dom/button #js {:onClick #(om/update! app :result-gif nil)} "✔ done"))

         winner?


adding with-near-cache for members

adding with-near-cache for members

--- src/chazel/core.clj
+++ src/chazel/core.clj
@@ -43,6 +43,14 @@
   ([{:keys [group-name group-password]} config]
    (.setGroupConfig config (GroupConfig. group-name
                                          group-password))))
+
+(defn with-near-cache
+  ([nc-config map-name]
+   (with-near-cache nc-config map-name (Config.)))
+  ([nc-config map-name hz-config]
+   (.setNearCacheConfig (.getMapConfig hz-config map-name)
+                        (near-cache-config nc-config))
+   hz-config))

 (defmacro call [m o v]
   "calls (m o v) iff v is there"


hello.cljs: Test less markers

hello.cljs: Test less markers


Don't use ANSI escape sequences in exception stack traces, period.

--- src/active/clojure/condition.cljc
+++ src/active/clojure/condition.cljc
@@ -533,42 +533,26 @@
     [type who message (concat stuff more-stuff)]))

 #?(:clj
-(alter-var-root
- #'io.aviso.exception/*fonts*
- (constantly
-  {:exception     aviso-ansi/reset-font
-   :reset         aviso-ansi/reset-font
-   :message       aviso-ansi/reset-font
-   :property      aviso-ansi/reset-font
-   :source        aviso-ansi/reset-font
-   :function-name aviso-ansi/reset-font
-   :clojure-frame aviso-ansi/reset-font
-   :java-frame    aviso-ansi/reset-font
-   :omitted-frame aviso-ansi/reset-font})))
-
-#?(:clj
 (defn- preformat-stack-frame
   [frame]
   (cond
     (:omitted frame)
-    (assoc frame :formatted-name (str (:omitted-frame aviso-exception/*fonts*) "..." (:reset aviso-exception/*fonts*))
+    (assoc frame :formatted-name "..."
                  :file ""
                  :line nil)

     ;; When :names is empty, it's a Java (not Clojure) frame
     (-> frame :names empty?)
-    (let [full-name      (str (:class frame) "." (:method frame))
-          formatted-name (str (:java-frame aviso-exception/*fonts*) full-name (:reset aviso-exception/*fonts*))]
+    (let [formatted-name      (str (:class frame) "." (:method frame))]
       (assoc frame
         :formatted-name formatted-name))

     :else
     (let [names          (:names frame)
           formatted-name (str
-                           (:clojure-frame aviso-exception/*fonts*)
                            (->> names drop-last (string/join "/"))
                            "/"
-                           (:function-name aviso-exception/*fonts*) (last names) (:reset aviso-exception/*fonts*))]
+                           (last names))]
       (assoc frame :formatted-name formatted-name)))))

 #?(:clj
@@ -577,11 +561,9 @@
   (let [elements (map preformat-stack-frame (aviso-exception/expand-stack-trace exception))]
     (aviso-columns/write-rows writer [:formatted-name
                                       "  "
-                                      (:source aviso-exception/*fonts*)
                                       :file
                                       [#(if (:line %) ": ") :left 2]
-                                      #(-> % :line str)
-                                      (:reset aviso-exception/*fonts*)]
+                                      #(-> % :line str)]
                               elements))))

 #?(:clj


version bump; latest dependencies

version bump; latest dependencies

--- Clojure-Websockets/TwitterClient/project.clj
+++ Clojure-Websockets/TwitterClient/project.clj
@@ -1,4 +1,4 @@
-(defproject birdwatch-tc "0.1.0-SNAPSHOT"
+(defproject birdwatch-tc "0.2.0-SNAPSHOT"
   :description "Twitter client part of the BirdWatch system"
   :url "https://github.com/matthiasn/Birdwatch"
   :license {:name "Eclipse Public License"
@@ -8,14 +8,14 @@
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [clojurewerkz/elastisch "2.1.0"]
                  [org.clojure/tools.logging "0.3.1"]
-                 [com.matthiasnehlsen/inspect "0.1.11"]
+                 [com.matthiasnehlsen/inspect "0.1.12-SNAPSHOT"]
                  [ch.qos.logback/logback-classic "1.1.1"]
                  [org.clojure/core.match "0.3.0-alpha4"]
                  [clj-time "0.9.0"]
                  [pandect "0.5.1"]
                  [clj-pid "0.1.1"]
                  [com.stuartsierra/component "0.2.2"]
-                 [com.taoensso/carmine "2.9.0"]
+                 [com.taoensso/carmine "2.9.0" :exclusions [com.taoensso/encore]]
                  [metrics-clojure "2.4.0"]]

   :source-paths ["src/clj/"]


tracing hooks

tracing hooks


Force vector for examples page data

Force vector for examples page data

--- src/clj/clojuredocs/pages/vars.clj
+++ src/clj/clojuredocs/pages/vars.clj
@@ -99,7 +99,7 @@
            :body
            (common/$main
              {:body-class "var-page"
-              :page-data {:examples (map clean-example examples)
+              :page-data {:examples (mapv clean-example examples)
                           :var v
                           :notes (map clean-id notes)
                           :see-alsos (map clean-see-also see-alsos)


remove redundant authorizations

remove redundant authorizations

--- src/clj_money/web/transactions.clj
+++ src/clj_money/web/transactions.clj
@@ -173,13 +173,14 @@
 (defn new-transaction
   ([{params :params}]
    (new-transaction params
-                    (tag-resource {:entity-id (:entity-id params)
-                                   :items [{:action :debit}
-                                           {:action :credit}]
-                                   :transaction-date (t/today)} :transaction)
+                    (-> {:entity-id (:entity-id params)
+                         :items [{:action :debit}
+                                 {:action :credit}]
+                         :transaction-date (t/today)}
+                        (tag-resource :transaction)
+                        (authorize :new))
                     {}))
   ([params transaction options]
-   (authorize transaction :new)
    (with-transactions-layout "New Transaction" (:entity-id transaction) options
      (form (cond-> (path "/entities"
                          (:entity-id transaction)
@@ -225,8 +226,8 @@
   ([req] (edit req {}))
   ([{params :params transaction :transaction} options]
    (let [id (:id params)
-         transaction (authorize (or transaction
-                                    (transactions/find-by-id (env :db) id)) :edit)
+         transaction (or transaction
+                         (authorize (transactions/find-by-id (env :db) id) :edit))
          action (cond-> (path "/transactions"
                               (:id transaction))


Updating site banner to reflect successful funding

--- src/cljc/zetawar/views/common.cljc
+++ src/cljc/zetawar/views/common.cljc
@@ -93,16 +93,14 @@
   [:div.row
    [:div.col-md-12
     [:div.alert.alert-success
-     [:strong.hidden-xs
-      "Zetawar is a prototype. Support the "
+     [:strong
+      "Zetawar is "
       [:a {:href "https://www.kickstarter.com/projects/311016908/zetawar"}
-       "Zetawar Kickstarter"]
-      " to help it become a full featured open source game!"]
-     [:strong.visible-xs
-      "Support the "
-      [:a {:href "https://www.kickstarter.com/projects/311016908/zetawar"}
-       "Zetawar Kickstarter"]
-      "!"]]]])
+       "funded"]
+      "! Full-time development starts mid-August. Follow "
+      [:a {:href "https://twitter.com/ZetawarGame"}
+       "@ZetawarGame"]
+      " for updates."]]]])

 (defn footer []
   [:div.container


Remove logging from clojure.browser.repl.

--- src/cljs/clojure/browser/repl.cljs
+++ src/cljs/clojure/browser/repl.cljs
@@ -18,16 +18,11 @@
   (:require [clojure.browser.net   :as net]
             [clojure.browser.event :as event]))

-(defn log-obj [obj]
-  (.log js/console obj))
-
 (defn evaluate-javascript
   "Process a single block of JavaScript received from the server"
   [block]
-  (log-obj (str "evaluating: " block))
   (let [result (try {:status :success :value (str (js* "eval(~{block})"))}
                     (catch js/Error e {:status :exception :value (pr-str e)}))]
-    (log-obj (str "result: " result))
     (pr-str result)))

 (defn send-result [connection url data]
@@ -53,7 +48,7 @@
                                      connection
                                      url))
       (net/connect repl-connection
-                   #(log-obj "Child REPL channel connected."))
+                   (constantly nil))

       (js/setTimeout #(send-result connection url "ready") 50))
     (js/alert "No 'xpc' param provided to child iframe.")))
@@ -73,7 +68,7 @@
                              :send-result
                              (evaluate-javascript js))))
     (net/connect repl-connection
-                 #(log-obj "Parent REPL channel connection.")
+                 (constantly nil)
                  (fn [iframe]
                    (set! iframe.style.display
                          "none")))))


add hashtag replace function

add hashtag replace function

--- src/cljs/link_collective/view.cljs
+++ src/cljs/link_collective/view.cljs
@@ -73,6 +73,20 @@
                    result)))))

+(defn replace-hashtags
+  "Replace hashtags in text with html references"
+  [raw-text raw-hashtags]
+  (loop [text (clojure.string/replace raw-text #"\'" "’")
+         hashtags (map name raw-hashtags)]
+    (if (empty? hashtags)
+      text
+      (recur
+       (clojure.string/replace
+        text
+        (re-pattern (first hashtags))
+        (str"" (first hashtags) ""))
+       (rest hashtags)))))
+

 ;; --- navbar templates and functions ---

@@ -108,18 +122,9 @@

 (defsnippet topiq-comment "templates/topiqs.html" [:.comment]
   [comment]
-  {[:.comment-text] (html-content
-                     (md/mdToHtml
-                      (loop [text (clojure.string/replace (:content comment) #"\'" "’")
-                             hashtags (map name (:hashtags comment))]
-                        (if (empty? hashtags)
-                          text
-                          (recur
-                           (clojure.string/replace
-                            text
-                            (re-pattern (first hashtags))
-                            (str"" (first hashtags) ""))
-                           (rest hashtags))))))
+  {[:.comment-text] (-> (replace-hashtags (:content comment) (:hashtags comment))
+                        md/mdToHtml
+                        html-content)
    [:.comment-author] (content (:author comment))
    [:.comment-ts] (content
                    (let [time-diff (- (js/Date.) (:ts comment))]
@@ -165,17 +170,7 @@
                  (dommy/add-class! (sel1 :#send-button-icon) :glyphicon-comment)))
              (om/set-state! owner :selected-entries (conj selected-entries (:id topiq))))))))
     (set-attr "href" (str "#comments-" (:id topiq))))
-   [:.topiq-text] (html-content
-                   (loop [text (clojure.string/replace (:title topiq) #"\'" "’")
-                          hashtags (map name (:hashtags topiq))]
-                        (if (empty? hashtags)
-                          text
-                          (recur
-                           (clojure.string/replace
-                            text
-                            (re-pattern (first hashtags))
-                            (str"" (first hashtags) ""))
-                           (rest hashtags))))(md/mdToHtml (:title topiq)))
+   [:.topiq-text] (html-content (replace-hashtags (:title topiq) (:hashtags topiq)))
    [:.topiq-author] (content (:author topiq))
    [:.topiq-ts] (content
                  (let [time-diff (- (js/Date.) (:ts topiq))]


Minor: remove println

Minor: remove println

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -209,7 +209,6 @@
 (defn open-as-png!
   "Trigger a page change to "
   [canvas]
-  (println (.toDataURL canvas "image/png"))
   (.open js/window (.toDataURL canvas "image/png")))

 (defn init!
@@ -222,7 +221,7 @@
   (add-overlay-handlers! (get @app-state :overlay-canvas))

   (set! (.-onkeydown js/window)
-        (fn [e ]
+        (fn [e]
           (when (and (= (aget e "keyCode") 90)
                    (aget e "ctrlKey"))
             (undo!))))


Prevent index out of bounds exception

Prevent index out of bounds exception

--- src/clojure/nightcode/projects.clj
+++ src/clojure/nightcode/projects.clj
@@ -81,10 +81,10 @@
         new-index (cond
                     (< new-index 0) max-index
                     (> new-index max-index) 0
-                    :else new-index)
-        new-path (nth paths new-index)]
-    (binding [editors/*reorder-tabs?* false]
-      (update-project-tree new-path)))
+                    :else new-index)]
+    (when (> (count paths) 0)
+      (binding [editors/*reorder-tabs?* false]
+        (update-project-tree (nth paths new-index)))))
   true)

 (defn toggle-project-tree-selection


Hint at the namespace they might want instead

--- src/caesium/crypto/scalarmult.clj
+++ src/caesium/crypto/scalarmult.clj
@@ -1,7 +1,8 @@
 (ns caesium.crypto.scalarmult
   (:require [caesium.binding :refer [defconsts]]))
-  "**DANGER** This namespace consists of low-level details that you should
-  not use unless you know what you are doing.
+  "**DANGER** This namespace consists of low-level details that you
+  should not use unless you know what you are doing. You probably
+  want [[caesium.crypto.box]] instead.

   Scalar multiplication."


fixed column alignment for new clinvar form

--- src/clinvar_submitter/variant.clj
+++ src/clinvar_submitter/variant.clj
@@ -24,107 +24,104 @@
         approver (form/get-contribution sym-tbl interp-input "approver")
         variant-coord (:coord variant)
         hgvs (:hgvs variant)]
-    [(:id interp "") ; local id
-     (:id interp "") ; linking id - only needed if providing case data or func evidence tabs
-     (:gene variant "") ; gene symbol - not provided since we are avoiding contextual allele representation.
-     (:refseq variant) ;refseq
-     (if (some? hgvs) hgvs "") ; hgvs - not providing since we are avoiding contextual allele representation
-     (if (nil? (:refseq variant)) (:chromosome variant) "")  ; chromosome - only provide if the refseq field is nil - clinvar does not accept both fields.
-     (if (nil? hgvs) (:start variant-coord) "") ; start + 1  (from 0-based to 1-based)
-     (if (nil? hgvs) (:stop variant-coord) "")  ; stop + 1  (from 0-based to 1-based)
-     (if (nil? hgvs) (:ref variant-coord) "")   ; ref
-     (if (nil? hgvs) (:alt variant-coord) "")   ; alt
-     "" ; variant type - non sequence var only
-     "" ; outer start - non sequence var only
-     "" ; inner start - non sequence var only
-     "" ; inner stop - non sequence var only
-     "" ; outer stop - non sequence var only
-     "" ; variant length - non sequence var only
-     "" ; copy number - non sequence var only
-     "" ; ref copy number - non sequence var only
-     "" ; breakpoint 1 - non sequence var only
-     "" ; breakpoint 2 - non sequence var only
-     "" ; comment on variant - req'd if var type is complex
-     "" ; Trace or probe data - non sequence var only
-     "" ; empty
-     ;(get variant :variantIdentifier) ; Variation identifiers (http://reg.genome.network.org/allele = ABC ABC:CA123123123)
-     "" ; ClinVar does not accept the CAR identifiers? (replacing above commented code)
-     "" ; Location - N/A
-     (:alt-designations variant)    ; Alternate designations
-     "" ; Official allele name  - N/A
-     "" ; URL - bypassing for now, no set home for a public URL at this time
-     "" ; empty
+    [(:id interp "") ; (A) local id
+     (:id interp "") ; (B) linking id - only needed if providing case data or func evidence tabs
+     (:gene variant "")        ; (C) gene symbol - not provided since we are avoiding contextual allele representation.
+     (:refseq variant)         ; (D) refseq
+     (if (some? hgvs) hgvs "") ; (E) hgvs - not providing since we are avoiding contextual allele representation
+     (if (nil? (:refseq variant)) (:chromosome variant) "")  ; (F) chromosome - only provide if the refseq field is nil - clinvar does not accept both fields.
+     (if (nil? hgvs) (:start variant-coord) "") ; (G) start + 1  (from 0-based to 1-based)
+     (if (nil? hgvs) (:stop variant-coord) "")  ; (H) stop + 1  (from 0-based to 1-based)
+     (if (nil? hgvs) (:ref variant-coord) "")   ; (I) ref
+     (if (nil? hgvs) (:alt variant-coord) "")   ; (J) alt
+     "" ; (K) variant type - non sequence var only
+     "" ; (L) outer start - non sequence var only
+     "" ; (M) inner start - non sequence var only
+     "" ; (N) inner stop - non sequence var only
+     "" ; (O) outer stop - non sequence var only
+     "" ; (P) variant length - non sequence var only
+     "" ; (Q) copy number - non sequence var only
+     "" ; (R) ref copy number - non sequence var only
+     "" ; (S) breakpoint 1 - non sequence var only
+     "" ; (T) breakpoint 2 - non sequence var only
+     "" ; (U) comment on variant - req'd if var type is complex
+     "" ; (V) empty
+    ;; (get variant :variantIdentifier) ; Variation identifiers (http://reg.genome.network.org/allele = ABC ABC:CA123123123)
+     "" ; (W) ClinVar does not accept the CAR identifiers? (replacing above commented code)
+     "" ; (X) Location - N/A
+     (:alt-designations variant)    ; (Y) Alternate designations
+     "" ; (Z) URL - bypassing for now, no set home for a public URL at this time
+     "" ; (AA) empty
      ;;
-     (:id-type condition "") ; Condition ID type (PURL)- assumes variantInterpretation.condition.disease.coding[0].code match of everything before the underscore.
-     (:id-value condition "")   ; Condition ID value - assumes variantInterpretation.condition.disease.coding[0].code match of everything after the underscore.
-     (if (and (:id-type condition) (:id-value condition)) "" (:preferred-name condition ""))  ; Preferred condition name
-     "" ; Condition category
-     "" ; Condition uncertainty
-     "" ; Condition comment
-     "" ; empty
-     (:significance interp) ; Clinical significance
-     (:eval-date interp) ; Date last evaluated
+     (:id-type condition "")    ; (AB) Condition ID type (PURL)- assumes variantInterpretation.condition.disease.coding[0].code match of everything before the underscore.
+     (:id-value condition "")   ; (AC) Condition ID value - assumes variantInterpretation.condition.disease.coding[0].code match of everything after the underscore.
+     (if (and (:id-type condition) (:id-value condition)) "" (:preferred-name condition ""))  ; (AD) Preferred condition name
+     "" ; (AE) Condition uncertainty
+     "" ; (AF) Condition comment
+     "" ; (AG) empty
+     (:significance interp) ; (AH) Clinical significance
+     "" ; Assertion score
+     (:eval-date interp)    ; (AJ) Date last evaluated
      ;; the 2 following assertion fields may need more robust handling for non-vceps that don't have clinvar files submitted.
-     "" ; assertion method
-     (:file-name method ""); assertion method citations
-     (:moi condition "") ; Mode of Inheritance
+     ""                     ; (AK) assertion method
+     (:file-name method "") ; (AL)assertion method citations
+     (:moi condition "")    ; (AM) Mode of Inheritance
      (form/get-pmid-list evidence) ; significance citations
-     (str "https://erepo.clinicalgenome.org/evrepo/ui/interpretation/" (:id interp)) ; Citations or URLs for clinical significance
+     (str "https://erepo.clinicalgenome.org/evrepo/ui/interpretation/" (:id interp)) ; (AO) Citations or URLs for clinical significance
      (if (some? (:description interp))
        (:description interp)
        (form/summary-string evidence interp variant condition method approver)) ; comment on clinical significance
      "" ; explanation if clinsig is other or drug
-     ""
-     ""
-     ""
-     ""
-     "curation" ;; AX - hardcoded per LB
-     "germline" ;; AY - hardcoded per LB
-     "unknown"  ;; this is col#52 AZ - hardcoded per LB
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     ""
-     (:id variant "")  ; clinvar or clingen ar variant id
-     (first (str/split (:scv variant "") #"\.+"))  ; scv if it was able to find a match, without version info
-     (if (str/blank? (:scv variant)) "" "Update")]))  ; Novel or Update .. always update if prior column is not empty.
+     "" ; drug response condition
+     "" ; functional consequence
+     "" ; comment on functional consequence
+     "" ; empty
+     "curation" ;; (AV) - hardcoded per LB
+     "germline" ;; (AW) - hardcoded per LB
+     "unknown"  ;; (AX) - hardcoded per LB
+     "" ; structural variant method/analysis type
+     "" ; clinical features
+     "" ; comment on clinical features
+     "" ; (BB) date phenotype was evaluated
+     "" ; tissue
+     "" ; sex
+     "" ; age range
+     "" ; population group/ethnicity
+     "" ; geographic origin
+     "" ; family history
+     "" ; indication
+     "" ; total number of individuals tested
+     "" ; (BK) number of families tested
+     "" ; empty
+     "" ; number of individuals with variant
+     "" ; number of families with variant
+     "" ; number of families with segregation observed
+     "" ; (BP) secondary finding
+     "" ; mosaicism
+     "" ; number of homozygotes
+     "" ; number of single heterozygotes
+     "" ; number of compound heterozygotes
+     "" ; number of hemizygotes
+     "" ; evidence citations
+     "" ; comment on evidence
+     "" ; empty
+     "" ; (BY) test name or type
+     "" ; platform type
+     "" ; platform name
+     "" ; method
+     "" ; method purpose
+     "" ; method citations
+     "" ; software name and version
+     "" ; software purpose
+     "" ; (CG) testing laboratory
+     "" ; date variant was reported by submitter
+     "" ; testing laboratory interpretation
+     "" ; empty
+     "" ; comment
+     (:id variant "")                              ; (CL) private comment - post clinvar or clingen ar variant id here for users
+     (first (str/split (:scv variant "") #"\.+"))  ; (CM) scv if it was able to find a match, without version info
+     (if (str/blank? (:scv variant)) "" "Update")  ; (CN) Novel or Update .. always update if prior column is not empty.
+     ""])) ; replaces ClinVarAccessions

 (defn construct-variant-table
   "Construct and return variant table"
@@ -155,4 +152,3 @@
         (log/debug "Json input is valid")
         records))))

-


removed bad-value interpolation from clean-trends; only harmonic seasonal decomp now

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -95,8 +95,7 @@
   time series (with frequency `freq`) using information in an
   associated reliability time series"
   [freq spectral-ts reli-ts]
-  (->> (make-reliable #{3 2} #{1 0} reli-ts spectral-ts)
-       (harmonic-seasonal-decomposition freq 3)))
+  (->> (harmonic-seasonal-decomposition freq 3)))

 (defn clean-tele-trends
   "clean trends (i.e., filter out bad values and remove seasonal


Cats have 30 teeth (12 incisors, 10 premolars, 4 canines, and 4 molars), while dogs have 42. Kittens have baby teeth, which are replaced by permanent teeth around the age of 7 months.

--- src/clj/quiz_site/routes/quiz.clj
+++ src/clj/quiz_site/routes/quiz.clj
@@ -12,6 +12,30 @@
   (log/debug "args:   " args)
   {:error "Implementation for this method not found."})

+(defn get-quiz-results
+  [& {:keys[quiz-id] :as args}]
+  (log/debug "get-quiz")
+  (log/debug "args:   " args)
+  {:error "Implementation for this method not found."})
+
+(defn create-quiz
+  [& {:keys[quiz-id] :as args}]
+  (log/debug "create-quiz")
+  (log/debug "args:   " args)
+  {:error "Implementation for this method not found."})
+
+(defn submit-answers
+  [& {:keys[quiz-id] :as args}]
+  (log/debug "submit-answers")
+  (log/debug "args:   " args)
+  {:error "Implementation for this method not found."})
+
 (def quiz-routes
-  (context "/quiz" []
-           (GET  "/:quiz-id" {params :params} (wrap-status (mapply get-quiz params)))))
+  (defroutes document-routes
+    (context "/quiz" []
+             (POST "/" {params :params} (wrap-status (mapply create-quiz params)))
+             (context "/:quiz-id" [quiz-id]
+                      (GET  "/" {params :params} (wrap-status (mapply get-quiz       params)))
+                      (POST "/" {params :params} (wrap-status (mapply submit-answers params)))))
+    (context "/results/:results-id" [results-id]
+             (GET "/" {params :params} (wrap-status (mapply get-quiz-results params))))))


added last step

added last step

--- src/cljs/cljs_repl_web/views.cljs
+++ src/cljs/cljs_repl_web/views.cljs
@@ -30,6 +30,8 @@

 (def tour
   (make-tour [:step1 :step2 :step3 :step4 :step5 :step6 :step7 :step8 :step9 :step10]))
+
+(def current-step (reagent/atom @(:current-step tour)))

 (def tour-steps
   {:welcome {:title "Welcome to clojurescript.io!"
@@ -105,8 +107,11 @@
                    [:li "related symbols list"]]]}
    :step9 {:title  "Tour 9 of 9"
            :body [:div [:h1.tour-title "Send to repl"]
-                  [:p "click on this button to send the examples to the REPL"]]}})
-
+                  [:p "click on this button to send the examples to the REPL"]]}
+   :step10 {:title  "Excellent!"
+            :body [:div [:p "This is the end of the tutorial. If you want to report an issue or fork the repository click on the ribbon in the top-left corner."]
+                   [:p "Check also our blog at lambdax.io/blog for posts about Clojure and follow us on Twitter at @lambdax_io."]
+                   [:p "Thanks and enjoy."]]}})

 (defn welcome-modal-dialog
   []
@@ -144,36 +149,34 @@
          :style {:padding-bottom "150px"}]))))

 (defn finished-tour-modal-dialog
-  [current-step]
+  []
   (let [showing? (reagent/atom true)]
     (fn []
-      (.log js/console "test")
-      (let [finished-tour? (= current-step (dec (count (:steps tour))))]
-        (.log js/console "finished-tour?" finished-tour?)
-        (when (and @showing? finished-tour?)
-          [modal-panel
-           :backdrop-opacity 0.4
-           :child [v-box
-                   :align :center
-                   :max-width "400px"
-                   :class "welcome-popup"
-                   :children [[title
-                               :label (get-in tour-steps [:welcome :title])
-                               :style {:font-weight "bold"
-                                       :font-size "20px"
-                                       :text-align "center"
-                                       :color "rgba(68, 68, 68, 0.6)"}]
-                              [p (get-in tour-steps [:welcome :body])]
-                              [:hr {:style {:margin "10px 0 10px"}}]
-                              [button
-                               :label "finish"
-                               :on-click #(do (finish-tour tour)
-                                              (ls/set-item! :closed-tour? true)
-                                              (reset! showing? false))
-                               :class "btn-default"
-                               :style {:margin-right "15px"}]]
-                   :style {:display "inline-block"}]
-           :style {:padding-bottom "150px"}])))))
+      (.log js/console "current-step?" @current-step)
+      (when (and @showing? (= @current-step (dec (count (:steps tour)))))
+        [modal-panel
+         :backdrop-opacity 0.4
+         :child [v-box
+                 :align :center
+                 :max-width "400px"
+                 :class "welcome-popup"
+                 :children [[title
+                             :label (get-in tour-steps [:step10 :title])
+                             :style {:font-weight "bold"
+                                     :font-size "20px"
+                                     :text-align "center"
+                                     :color "rgba(68, 68, 68, 0.6)"}]
+                            [p (get-in tour-steps [:step10 :body])]
+                            [:hr {:style {:margin "10px 0 10px"}}]
+                            [button
+                             :label "finish"
+                             :on-click #(do (finish-tour tour)
+                                            (ls/set-item! :closed-tour? true)
+                                            (reset! showing? false))
+                             :class "btn-default"
+                             :style {:margin-right "15px"}]]
+                 :style {:display "inline-block"}]
+         :style {:padding-bottom "150px"}]))))

 (defn- next-tour-step
   [tour]
@@ -182,6 +185,7 @@
         new-step  (inc old-step)]
     (when (< new-step (count (:steps tour)))
       (reset! (:current-step tour) new-step)
+      (reset! current-step new-step)
       (reset! ((nth steps old-step) tour) false)
       (reset! ((nth steps new-step) tour) true))))

@@ -241,7 +245,6 @@
                                 (ls/set-item! :closed-tour? true))
                 :backdrop-opacity 0.5]
       :style (align-style :align-items :stretch)])))
-

 ;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -563,8 +566,8 @@
                                    (dispatch [:set-console-queued-forms :cljs-console (:strings example-map)]))]]
                #(do (finish-tour tour)
                     (reset! showing-atom false)
-                    (utils/scroll-to-top))]
-
+                    (utils/scroll-to-top))
+               #(reset! showing-atom false)]
               [api-example example-map]]])

 (defn api-examples
@@ -872,7 +875,7 @@
                         #(do (finish-tour tour)
                              (utils/scroll-to-top))]]
                       [welcome-modal-dialog]
-                      [finished-tour-modal-dialog @(:current-step tour)]]]
+                      [finished-tour-modal-dialog]]]
         (if (= :narrow @media-query)
           [v-box
            :size "1 1 auto"


Only enable paredit in Clojure files

Only enable paredit in Clojure files

--- src/clojure/nightcode/editors.clj
+++ src/clojure/nightcode/editors.clj
@@ -265,8 +265,8 @@

 (defn add-watchers!
   [path extension text-area completer]
-  (let [exists? (.exists (io/file path))
-        clojure? (contains? clojure-exts extension)]
+  (let [clojure? (contains? clojure-exts extension)
+        clojure-file? (and clojure? (.exists (io/file path)))]
     (add-watch font-size
                (utils/hashed-keyword path)
                (fn [_ _ _ x]
@@ -276,11 +276,11 @@
                  (utils/hashed-keyword path)
                  (fn [_ _ _ enable?]
                    (.setAutoActivationEnabled completer enable?))))
-    (when-let [toggle-paredit-fn! (init-paredit! text-area exists? clojure?)]
+    (when-let [toggle-fn! (init-paredit! text-area clojure-file? clojure?)]
       (add-watch paredit-enabled?
                  (utils/hashed-keyword path)
                  (fn [_ _ _ enable?]
-                   (toggle-paredit-fn! enable?))))))
+                   (toggle-fn! enable?))))))

 (defn add-button-watchers!
   [path pane]


use spec-info

use spec-info

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -187,23 +187,9 @@

                           (and (empty? filtered-lexical-complements)
                                (empty? phrasal-complements))
-                          (let [cat (get-in spec [:synsem :cat] :top)
-                                pred (get-in spec [:synsem :sem :pred] :top)
-                                subcat1-cat
-                                (if (empty? (get-in spec [:synsem :subcat]))
-                                  "(empty)"
-                                  (get-in spec [:synsem :subcat :1 :cat] :no-cat))
-                                subcat1-pred
-                                (if (empty? (get-in spec [:synsem :subcat]))
-                                  "(empty)"
-                                  (get-in spec [:synsem :subcat :1 :sem :pred] :no-pred))]
-                            (log/warn (str "add-complement-to-bolt: could generate neither phrasal nor lexical complements for parent: "
-                                           (get-in bolt (concat (butlast path) [:rule]) :norule) " "
-                                           "while trying to create a complement with:"
-                                           "cat: " cat "; "
-                                           "pred: " pred "; "
-                                           "subcat1 cat: " subcat1-cat "; "
-                                           "subcat1 pred: " subcat1-pred)))
+                          (log/warn (str "add-complement-to-bolt: could generate neither phrasal nor lexical complements for parent: "
+                                          (get-in bolt (concat (butlast path) [:rule]) :norule) " "
+                                          "while trying to create a complement: " (spec-info spec)))

                           lexemes-before-phrases
                           (lazy-cat (lazy-shuffle filtered-lexical-complements) phrasal-complements)


Re-add friend namespace

Re-add friend namespace

--- src/checkin/handler.clj
+++ src/checkin/handler.clj
@@ -5,6 +5,7 @@
             [clojure.tools.logging :as log]
             [checkin.auth :as auth]
             [checkin.routes.appointment :as appointment]
+            [cemerick.friend :as friend]
             [environ.core :refer [env]]
             [checkin.request-helper :as request-helper]
             [checkin.middleware :refer [log-request]]))


added phone reference

added phone reference

--- src/checkmate/views.clj
+++ src/checkmate/views.clj
@@ -31,7 +31,7 @@
   {:body
    [:div.jumbotron
     [:div.container
-     [:h1 "Check-Mate" [:small "A tiny yet friendly checklist app."]]
+     [:h1 "Check-Mate" [:small "A tiny yet friendly checklist app for you and your phone."]]
      [:p "If you came here hoping for an app about chess, I'm sorry. If not go ahead and improve your day with some checklists. No matter what brought you here, you should read Atul Gawande's great book " [:a {:href "https://en.wikipedia.org/wiki/The_Checklist_Manifesto"} "'The Checklist Manifesto'."] " You definitely will feel the urge for some checklists afterwards. :-)"]
      [:p [:div.btn-toolbar
           [:div.btn-group


Redirect / to index.html

Redirect / to index.html

--- src/clj/medusa/core.clj
+++ src/clj/medusa/core.clj
@@ -9,11 +9,13 @@
             [clj.medusa.resource :as resource]
             [clj.medusa.persona :as persona]
             [ring.middleware.reload :as reload]
+            [ring.util.response :as response]
             [cemerick.friend :as friend]
             (cemerick.friend [workflows :as workflows]
                              [credentials :as creds])))

 (defroutes app
+  (GET "/" [] (response/redirect "index.html"))
   (GET "/status" [] "ok")
   (ANY "/login" []
        (resource/login))


Remove trailing whitespace in client.clj

--- src/clj_ldap/client.clj
+++ src/clj_ldap/client.clj
@@ -75,7 +75,7 @@
   "Adds the values contained in given response control to the given map"
   [m control]
   (condp instance? control
-    PreReadResponseControl
+    PreReadResponseControl
     (update-in m [:pre-read] merge (entry-as-map (.getEntry control) false))
     PostReadResponseControl
     (update-in m [:post-read] merge (entry-as-map (.getEntry control) false))
@@ -252,8 +252,8 @@
   (if-let [n (.nextEntry source)]
     (cons n (lazy-seq (entry-seq source)))))

-;; Extended version of search-results function using a
-;; SearchRequest that uses a SimplePagedResultsControl.
+;; Extended version of search-results function using a
+;; SearchRequest that uses a SimplePagedResultsControl.
 ;; Allows us to read arbitrarily large result sets.
 ;; TODO make this lazy
 (defn- search-all-results
@@ -269,15 +269,15 @@
       (.setControls req (list (SimplePagedResultsControl. sizeLimit cookie)))
       (let [res (.search connection req)
             control (SimplePagedResultsControl/get res)
-            newres (->> (.getSearchEntries res)
-                     (map entry-as-map)
-                     (remove empty?)
+            newres (->> (.getSearchEntries res)
+                     (map entry-as-map)
+                     (remove empty?)
                      (into results))]
         (if (and
               (not-nil? control)
               (> (.getValueLength (.getCookie control)) 0))
           (recur newres (.getCookie control))
-          (seq newres))))))
+          (seq newres))))))

 (defn- search-results
   "Returns a sequence of search results for the given search criteria."
@@ -352,7 +352,7 @@
                     JKS format file, optional, defaults to trusting all
                     certificates
    :connect-timeout The timeout for making connections (milliseconds),
-                    defaults to 1 minute
+                    defaults to 1 minute
    :timeout         The timeout when waiting for a response from the server
                     (milliseconds), defaults to 5 minutes
    "
@@ -376,7 +376,7 @@
 the bind attempt will have no side-effects, leaving the state of the
 underlying connections unchanged."
   [connection bind-dn password]
-  (try
+  (try
     (let [bind-result (.bind connection bind-dn password)]
       (if (= ResultCode/SUCCESS (.getResultCode bind-result)) true false))
     (catch Exception _ false)))
@@ -439,7 +439,7 @@
    the password of the currently-authenticated user, or another user if their
    DN is provided and the caller has the required authorisation."
   ([connection new]
-    (let [request (PasswordModifyExtendedRequest. new)]
+    (let [request (PasswordModifyExtendedRequest. new)]
       (.processExtendedOperation connection request)))

   ([connection old new]
@@ -453,9 +453,9 @@
 (defn modify-rdn
   "Modifies the RDN (Relative Distinguished Name) of an entry in the connected
   ldap server.
-
+
   The new-rdn has the form cn=foo or ou=foo. Using just foo is not sufficient.
-  The delete-old-rdn boolean option indicates whether to delete the current
+  The delete-old-rdn boolean option indicates whether to delete the current
   RDN value from the target entry."
   [connection dn new-rdn delete-old-rdn]
   (let [request (ModifyDNRequest. dn new-rdn delete-old-rdn)]


add not-native definition, so that ^not-native works in other namespaces.

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -39,6 +39,8 @@
   "Internal - do not use!"
   [x]
   (js* "(~{x} != null && ~{x} !== false)"))
+
+(def not-native nil)

 (defn ^boolean identical?
   "Tests if 2 arguments are the same object"


* src/cljs/cljs/core.cljs: declared counted? fix IndexedSeq -reduce

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -393,7 +393,7 @@
            (recur (f val (-nth cicoll n)) (inc n))
            val))))

-(declare hash-coll cons pr-str)
+(declare hash-coll cons pr-str counted?)

 (deftype IndexedSeq [a i]
   Object
@@ -430,14 +430,14 @@
   (-conj [coll o] (cons o coll))

   IReduce
-  (-reduce [_ f]
+  (-reduce [coll f]
     (if (counted? a)
       (ci-reduce a f (aget a i) (inc i))
-      (ci-reduce this f (aget a i) (inc i))))
-  (-reduce [_ f start]
+      (ci-reduce coll f (aget a i) (inc i))))
+  (-reduce [coll f start]
     (if (counted? a)
       (ci-reduce a f start i)
-      (ci-reduce this f start i)))
+      (ci-reduce coll f start i)))

   IHash
   (-hash [coll] (hash-coll coll)))


Encapsulate navigation

Encapsulate navigation

--- src/cljs/virt/core.cljs
+++ src/cljs/virt/core.cljs
@@ -34,13 +34,16 @@
 (defroute ":channel-id" [channel-id]
   (swap! app-state assoc :current-channel (cljs.reader/read-string channel-id)))

-(def history (Html5History.))
-
-(events/listen history EventType.NAVIGATE
-  (fn [e] (secretary/dispatch! (.-token e))))
-
-(.setUseFragment history false)
-(.setEnabled history true)
+(def navigate
+  (let [history (Html5History.)]
+    (.setUseFragment history false)
+    (.setEnabled history true)
+    (events/listen history EventType.NAVIGATE
+      (fn [e] (secretary/dispatch! (.-token e))))
+    (fn [to]
+      (case to
+        :up (.setToken history "")
+        (.setToken history to)))))

 (defn list-item [item owner]
@@ -59,7 +62,7 @@
     om/IRenderState
     (render-state [_ {:keys [comm]}]
       (dom/header nil
-        (dom/div nil (dom/button #js {:id "back-button" :className "transparent-button" :onClick #(.back js/history)} "Back"))
+        (dom/div nil (dom/button #js {:id "back-button" :className "transparent-button" :onClick #(put! comm [:navigate :up])} "Back"))
         (dom/div nil (dom/div #js {:id "header-title"} (if-let [current-channel (:current-channel app)]
                                                          (:title (find-in-vec [:id] current-channel (:channels app)))
                                                          "Virt")))
@@ -67,7 +70,7 @@

 (defn handle-event [msg value]
   (case msg
-    :navigate (.setToken history value)
+    :navigate (navigate value)
     nil))

 (defn main [app owner]


Purge all files from the fastly CDN (#746)

Before this change, we were only purging the maven-metadata.xml (and
sums), since they were mutable. But since the CDN caches 404s,
attempts to find artifacts before they were deployed were being cached
after the deployment. This should resolve that.

--- src/clojars/storage.clj
+++ src/clojars/storage.clj
@@ -91,21 +91,21 @@

 (defn- purge
   [cdn-token cdn-url path]
-  (if (and cdn-token
-           cdn-url
-           (not= "NOTSET" cdn-token))
+  (when (and cdn-token
+             cdn-url
+             (not= "NOTSET" cdn-token))
     (let [{:keys [status] :as resp} (cdn/purge cdn-token cdn-url path)]
       (when (not= "ok" status)
-        (throw (ex-info (format "Fastly purge failed for %s" path) resp))))
-    (println "Either no CDN key or host specified, purging skipped for" path)))
+        (throw (ex-info (format "Fastly purge failed for %s" path) resp))))))

 (defrecord CDNStorage [cdn-token cdn-url]
   Storage
   (-write-artifact [_ path _ _]
-    (when (re-find #"/maven-metadata\.xml" path)
-      ;; purge maven-metadata.xml and its sums from fastly, since they
-      ;; are mutable
-      (purge cdn-token cdn-url path)))
+    ;; Purge any file in the deploy in case it has been requested in
+    ;; the last 24 hours, since fastly will cache the 404.  Run in a
+    ;; future so we don't have to wait for the request to finish to
+    ;; complete the deploy.
+    (future (purge cdn-token cdn-url path)))
   (remove-path [_ path]
     (purge cdn-token cdn-url path))
   (path-exists? [_ _])


Output stderr to console.

Output stderr to console.

Thanks to @thomasjm for the suggestion in #20.

--- src/clojupyter/core.clj
+++ src/clojupyter/core.clj
@@ -286,13 +286,13 @@
         (swap! execution-count inc)
         (busy-handler message signer execution-count)
         (let [s# (new java.io.StringWriter)
-              [output result]
+              [output result error]
               (binding [*out* s#]
                 (let [fullresult (nrepl-eval (get-in message [:content :code]) transport)
                       result (reformat-values fullresult)
-                      output (:out fullresult)]
-;                      output (str s#)]
-                  [output, result]))]
+                      output (:out fullresult)
+                      error (:err fullresult)]
+                  [output result error]))]
           (send-router-message shell-socket "execute_reply"
                                {:status "ok"
                                 :execution_count @execution-count
@@ -303,9 +303,14 @@
                                 :status "ok"
                                 :started (now)} session-id signer (:idents message))
           ;; Send stdout
-          (when  output
+          (when output
             (send-message iopub-socket "stream" {:name "stdout" :text output}
                           parent-header {} session-id signer))
+          ;; Send stderr
+          (when error
+            (send-message iopub-socket "stream" {:name "stderr" :text error}
+                          parent-header {} session-id signer))
+
           ;; Send result
           (send-message iopub-socket "execute_result"
                         {:execution_count @execution-count


Removing TODOs that were unnecessary.

Removing TODOs that were unnecessary.

--- src/cmr/oracle/user.clj
+++ src/cmr/oracle/user.clj
@@ -2,17 +2,6 @@
   "Contains functions for creating and dropping users."
   (:require [clojure.java.jdbc :as j]
             [cmr.oracle.connection :as conn]))
-
-;; TODO - need to decide which tablespaces to use
-; "create user %%CMR_USER%%
-; profile default
-; identified by %%CMR_PASSWORD%%
-; default tablespace %%DATA_TABLESPACE%%
-; temporary tablespace %%TEMP_TABLESPACE%%
-; quota unlimited on %%DATA_TABLESPACE%%
-; quota unlimited on %%INDEX_TABLESPACE%%
-; account unlock"
-

 (def create-user-sql-template
   "create user %%CMR_USER%%


Refactor:reuse :a.l.c.tenant-manager system component in dev/import

--- backend/dev/src/dev/import.clj
+++ backend/dev/src/dev/import.clj
@@ -3,15 +3,20 @@
             [akvo.lumen.test-utils :as tu]
             [clj-time.core :as tc]
             [clojure.pprint :refer [pprint]]
+            [akvo.lumen.protocols :as p]
             [clojure.spec.alpha :as s]
             [clojure.spec.test.alpha :as stest]
             [clojure.tools.logging :as log]
             [dev.commons :as commons]
+            [dev :as dev]
             [integrant.repl.state :as state :refer (system)]))

 (def error-tracker (et/local-error-tracker nil))

-(defn t1-conn [] (tu/test-tenant-conn (first commons/tenants)))
+(defn t1-conn []
+  (when-not system
+    (dev/go))
+  (p/connection (:akvo.lumen.component.tenant-manager system) (-> commons/tenants first :label)))

 (defn clj-data>dataset [{:keys [dataset-name data with-job? job]}]
   (if job


Fixes Mozilla-specific rules for buttons.

This fixes attr selectors compiling to [Object object]. There's probably a better way to use the defined selectors in Garden to generate the same code.

--- src/day8/re_frame_10x/styles.cljs
+++ src/day8/re_frame_10x/styles.cljs
@@ -90,16 +90,16 @@
     {:-webkit-appearance "button"}]

    ["button::-moz-focus-inner"
-    (str (s/attr= "type" "button") "::-moz-focus-inner")
-    (str (s/attr= "type" "reset")  "::-moz-focus-inner")
-    (str (s/attr= "type" "submit") "::-moz-focus-inner")
+    "input[type=button]::-moz-focus-inner"
+    "input[type=reset]::-moz-focus-inner"
+    "input[type=submit]::-moz-focus-inner"
     {:border-style "none"
      :padding      "0"}]

    [:button:-moz-focusring
-    (str (s/attr= "type" "button") ":-moz-focusring")
-    (str (s/attr= "type" "reset")  ":-moz-focusring")
-    (str (s/attr= "type" "submit") ":-moz-focusring")
+    "input[type=button]:-moz-focusring"
+    "input[type=reset]:-moz-focusring"
+    "input[type=submit]:-moz-focusring"
     {:outline "1px dotted ButtonText"}]

    [:textarea


Use the correct parameter names for calling github.

--- backend/src/circle/workers/github.clj
+++ backend/src/circle/workers/github.clj
@@ -25,14 +25,14 @@
   (-> json-string json/decode process-json))

-(def production-github {:client-id "78a2ba87f071c28e65bb"
-                        :secret "98cb9262b67ad26bed9191762a23445eeb2054e4"})
+(def production-github {:client_id "78a2ba87f071c28e65bb"
+                        :client_secret "98cb9262b67ad26bed9191762a23445eeb2054e4"})

-(def staging-github {:client-id "TODO"
-                     :secret "TODO"})
+(def staging-github {:client_id "TODO"
+                     :client_secret "TODO"})

-(def local-github {:client-id "586bf699b48f69a09d8c"
-                   :secret "1e93bdce2246fd69d9040875338b4137d525e400"})
+(def local-github {:client_id "586bf699b48f69a09d8c"
+                   :client_secret "1e93bdce2246fd69d9040875338b4137d525e400"})

 (defn default []
   (cond


:sparkles: Improve dispatcher impl usability.

--- backend/src/uxbox/util/dispatcher.clj
+++ backend/src/uxbox/util/dispatcher.clj
@@ -16,9 +16,9 @@
    [uxbox.util.spec :as us]
    [uxbox.util.exceptions :as ex])
   (:import
+   clojure.lang.IDeref
+   clojure.lang.MapEntry
    java.util.Map
-   java.util.List
-   java.util.Map$Entry
    java.util.HashMap))

 (definterface IDispatcher
@@ -27,8 +27,14 @@
 (deftype Dispatcher [reg attr interceptors]
   IDispatcher
   (add [this key f metadata]
-    (.put ^Map reg key (Map/entry f metadata))
+    (.put ^Map reg key (MapEntry/create f metadata))
     nil)
+
+  clojure.lang.IDeref
+  (deref [_]
+    {:registry reg
+     :attr attr
+     :interceptors interceptors})

   clojure.lang.IFn
   (invoke [_ params]
@@ -38,8 +44,8 @@
         (p/rejected (ex/error :type :not-found
                               :code :method-not-found
                               :hint "No method found for the current request."))
-        (let [f (.getKey ^Map$Entry entry)
-              m (.getValue ^Map$Entry entry)
+        (let [f (.key ^MapEntry entry)
+              m (.val ^MapEntry entry)
               d (p/deferred)]

           (sp/execute (conj interceptors f)
@@ -57,25 +63,53 @@
   `(defonce ~sname (Dispatcher. (HashMap.)
                                 ~dispatch-by
                                 ~interceptors)))
+(defn parse-defmethod
+  [args]
+  (loop [r {}
+         s 0
+         v (first args)
+         n (rest args)]
+    (case s
+      0 (if (symbol? v)
+          (recur (assoc r :sym v) 1 (first n) (rest n))
+          (throw (ex-info "first arg to `defmethod` should be a symbol" {})))
+      1 (if (qualified-keyword? v)
+          (recur (-> r
+                     (assoc :key (keyword (name v)))
+                     (assoc :meta {:spec v :doc nil}))
+                 3 (first n) (rest n))
+          (recur r (inc s) v n))
+      2  (if (simple-keyword? v)
+          (recur (-> r
+                     (assoc :key v)
+                     (assoc :meta {:doc nil}))
+                 3 (first n) (rest n))
+          (throw (ex-info "second arg to `defmethod` should be a keyword" {})))
+      3 (if (string? v)
+          (recur (update r :meta assoc :doc v) (inc s) (first n) (rest n))
+          (recur r 4 v n))
+      4 (if (map? v)
+          (recur (update r :meta merge v) (inc s) (first n) (rest n))
+          (recur r 5 v n))
+      5 (if (vector? v)
+          (assoc r :args v :body n)
+          (throw (ex-info "missing arguments vector" {}))))))

 (defmacro defmethod
-  [sname key metadata args & rest]
-  (s/assert symbol? sname)
-  (s/assert keyword? key)
-  (s/assert map? metadata)
-  (s/assert vector? args)
-  (let [f `(fn ~args ~@rest)]
+  [& args]
+  (let [{:keys [key meta sym args body]} (parse-defmethod args)
+        f `(fn ~args ~@body)]
     `(do
-       (s/assert dispatcher? ~sname)
-       (.add ~sname ~key ~f ~metadata)
-       ~sname)))
+       (s/assert dispatcher? ~sym)
+       (.add ~sym ~key ~f ~meta)
+       ~sym)))

 (def spec-interceptor
   "An interceptor that conforms the request with the user provided
   spec."
   {:enter (fn [{:keys [request] :as data}]
             (let [{:keys [spec]} (meta request)]
-              (if spec
+              (if-let [spec (s/get-spec spec)]
                 (let [result (s/conform spec request)]
                   (if (not= result ::s/invalid)
                     (assoc data :request result)


Bump default text size

Bump default text size


Bump the VCS versions to deploy

Bump the VCS versions to deploy

--- src/circle/backend/project/circle.clj
+++ src/circle/backend/project/circle.clj
@@ -12,7 +12,7 @@
                          :build-num 1
                          :vcs-type :git
                          :vcs-url "git@github.com:arohner/CircleCI.git"
-                         :vcs-revision "a2ec5dbe2d402dc926e1e8b803d4fc6738562b5c"
+                         :vcs-revision "27d62d1712f9880627012673b524d178d2cff0e7"

                          :actions [(start-nodes)
                                    (checkout)
@@ -27,7 +27,7 @@
          :type :deploy
          :vcs-type :git
          :vcs-url "git@github.com:arohner/CircleCI.git"
-         :vcs-revision "a7108a0481b64c0be7387b5082494b344104b926"
+         :vcs-revision "27d62d1712f9880627012673b524d178d2cff0e7"
          :aws-credentials circle.aws-credentials/AWS-access-credentials
          :r53-zone-id "ZBVDNEPFXWZR2"
          :num-nodes 1


snapshot of joint movement DSL using separate lists for joint names and values. However, need to computer joint speed on a per joint basis so will return to using a map of joint name to angle

--- src/main/clojure/naojure/core.clj
+++ src/main/clojure/naojure/core.clj
@@ -22,15 +22,15 @@
                     :tts "ALTextToSpeech"
                     })

-(def joint-names '("HeadYaw", "HeadPitch",
-                   "LShoulderPitch", "LShoulderRoll", "LElbowYaw", "LElbowRoll",
-                   "LWristYaw", "LHand",
-                   "LHipYawPitch", "LHipRoll", "LHipPitch",
-                   "LKneePitch", "LAnklePitch", "LAnkleRoll",
-                   "RHipYawPitch", "RHipRoll", "RHipPitch",
-                   "RKneePitch",  "RAnklePitch", "RAnkleRoll",
-                   "RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll",
-                   "RWristYaw", "RHand"))
+(def joint-names ["HeadYaw", "HeadPitch",
+                  "LShoulderPitch", "LShoulderRoll", "LElbowYaw", "LElbowRoll",
+                  "LWristYaw", "LHand",
+                  "LHipYawPitch", "LHipRoll", "LHipPitch",
+                  "LKneePitch", "LAnklePitch", "LAnkleRoll",
+                  "RHipYawPitch", "RHipRoll", "RHipPitch",
+                  "RKneePitch",  "RAnklePitch", "RAnkleRoll",
+                  "RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll",
+                  "RWristYaw", "RHand"])

 (def postures {:crouch "Crouch"
                :lying-back "LyingBack"
@@ -460,3 +460,136 @@
   (call-service robot :tts "setVolume" [(float vol)]))

 ;; motion
+(defn- concat-joints
+  [a b]
+  (let [{an :names av :values} a
+        {bn :names bv :values} b]
+    {:names (concat an bn) :values (concat av bv)}))
+
+(defn- arms_left_forward [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names [ "LShoulderPitch" "LShoulderRoll"]
+              :values [ (- angle1) angle2]}}))
+
+(defn- arms_right_forward [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names [ "RShoulderPitch"  "RShoulderRoll"]
+              :values [ (- angle1) (- angle2)]}}))
+
+(defn- arms_forward [params]
+  (concat-joints
+   (:joints (arms_left_forward params))
+   (:joints (arms_right_forward params))))
+
+
+(defn- arms_left_out [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["LShoulderPitch" "LShoulderRoll"]
+              :values [(- angle1) (+ 90 angle2)]}}))
+
+(defn- arms_right_out [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["RShoulderPitch"  "RShoulderRoll"]
+              :values [ (- angle1) (- -90 angle2)]}}))
+
+(defn- arms_out [params]
+  (concat-joints
+   (:joints (arms_left_out params))
+   (:joints (arms_right_out params))))
+
+(defn- arms_left_up [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["LShoulderPitch" "LShoulderRoll"]
+              :values [(- -90 angle1) angle2]}}))
+
+(defn- arms_right_up [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["RShoulderPitch"  "RShoulderRoll"]
+              :values [(- -90 angle1) (- angle2)]}}))
+
+(defn- arms_up [params]
+  (concat-joints
+   (:joints (arms_left_up params))
+   (:joints (arms_right_up params))))
+
+(defn- arms_left_down [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["LShoulderPitch" "LShoulderRoll"]
+              :values [ (- 90 angle1) angle2]}}))
+
+(defn- arms_right_down [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["RShoulderPitch"  "RShoulderRoll"]
+              :values [ (- 90 angle1) (- angle2)]}}))
+
+(defn- arms_down [params]
+  (concat-joints
+   (:joints (arms_left_down params))
+   (:joints (arms_right_down params))))
+
+(defn- arms_left_back [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["LShoulderPitch" "LShoulderRoll"]
+              :values [ (- 119.5 angle1) angle2]}}))
+
+(defn- arms_right_back [params]
+  (let [angle1 (get params 0 0)
+        angle2 (get params 1 0)]
+    {:joints {:names ["RShoulderPitch"  "RShoulderRoll"]
+              :values [ (- 119.5 angle1) (- angle2)]}}))
+
+(defn- arms_back [params]
+  (concat-joints
+   (:joints (arms_left_back params))
+   (:joints (arms_right_back params))))
+
+(defn arms
+  [action & params]
+  (( {:forward arms_forward
+      :left_forward arms_left_forward
+      :right_forward arms_right_forward
+      :out arms_out
+      :left_out arms_left_out
+      :right_out arms_right_out
+      :up arms_up
+      :left_up arms_left_up
+      :right_up arms_right_up
+      :down arms_down
+      :left_down arms_left_down
+      :right_down arms_right_down
+      :back arms_back
+      :left_back arms_left_back
+      :right_back arms_right_back
+      } action) params))
+
+(defn- only-joint-actions
+  "Return only the values of joint actions"
+  [actions]
+  (->> actions
+       (map :joints)
+       (filter identity)))
+
+(defn do-joints
+  "Make action for joint changes if any"
+  [joint-lists duration]
+  (if-let [{:keys [names values]}
+           (cond
+            (> 1 (count joints)) (reduce concat_joints joints)
+            (= 1 (count joints)) joints)]
+    ))
+
+;; TODO make the duration and channel params optional
+(defn donao
+  "Accepts a number of parameters specifying robot actions and executes them"
+  [robot duration chan & actions]
+  (let [joint-changes (only-joint-actions actions)]
+    ))


Hide AS7's complaining about private modules [IMMUTANT-39]

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -41,8 +41,9 @@
   (println "DONE"))

 (defn print-err [& message]
-  (comment (binding [*out* *err*]
-             (apply println message))))
+  (comment)
+  (binding [*out* *err*]
+    (apply println message)))

 (defn xml-zip [path]
   (zip/xml-zip (xml/parse path)))
@@ -149,6 +150,13 @@
 (defn disable-security [loc]
     (zip/edit loc #(update-in % [:attrs] dissoc :security-realm)))

+(defn add-logger-levels [loc]
+  (zip/append-child (zip/right
+                     (zip/insert-right loc
+                                       {:tag :logger
+                                        :attrs {:category "org.jboss.as.dependency.private"}}))
+                    {:tag :level :attrs {:name "ERROR"}}))
+
 (defn looking-at? [tag loc]
   (= tag (:tag (zip/node loc))))

@@ -167,6 +175,7 @@
             (cond
              (looking-at? :extensions loc) (add-extensions loc)
              (looking-at? :profile loc) (add-subsystems loc)
+             (looking-at? :periodic-rotating-file-handler loc) (add-logger-levels loc)
              (looking-at? :virtual-server loc) (set-welcome-root loc)
              (looking-at? :system-properties loc) (unquote-cookie-path loc)
              (looking-at? :jms-destinations loc) (zip/remove loc)
@@ -175,6 +184,7 @@
              (looking-at? :http-interface loc) (disable-security loc)
              (looking-at? :max-size-bytes loc) (zip/edit loc assoc :content ["20971520"])
              (looking-at? :address-full-policy loc) (zip/edit loc assoc :content ["PAGE"])
+
              :else loc)))))

 (defn transform-config [file]


Add tests for different types

Add tests for different types

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -399,7 +399,14 @@
                    (array-map :c (increment-by 1)))))))

-  (is (= "\n\tCREATE TABLE foo(\n\t\ta int,\n\t\tb varchar,\n\t\tc int,\n\t\td int,\n\t\te int,\n\t\tPRIMARY KEY((a, b), c, d))"
+  (is (= "
+	CREATE TABLE foo(
+		a int,
+		b varchar,
+		c int,
+		d int,
+		e int,
+		PRIMARY KEY((a, b), c, d))"
          (create-table :foo
                        (column-definitions {:a :int
                                             :b :varchar
@@ -407,4 +414,31 @@
                                             :d :int
                                             :e :int
                                             :primary-key [[:a :b] :c :d]}))))
+
+  (is (= "
+	CREATE TABLE foo(
+		a int,
+		c int,
+		d int,
+		e int,
+		b varchar,
+		PRIMARY KEY(a, c, d))"
+         (create-table :foo
+                       (column-definitions {:a :int
+                                            :b :varchar
+                                            :c :int
+                                            :d :int
+                                            :e :int
+                                            :primary-key [:a :c :d]}))))
+
+
+  (is (= "
+	CREATE TABLE foo(
+		a int,
+		b map<varchar, varchar>,
+		PRIMARY KEY(a))"
+         (create-table :foo
+                       (column-definitions {:a :int
+                                            :b (map-type :varchar :varchar)
+                                            :primary-key [:a]}))))
   )


Add z-index to frisk container

Add z-index to frisk container

In some situation, the frisk container was overlayed by site content because they had a higher z-index than the container to solve this adds some high z-index.
Fixes #13

--- src/datafrisk/core.cljs
+++ src/datafrisk/core.cljs
@@ -16,7 +16,8 @@
 (def styles
   {:shell {:backgroundColor "#FAFAFA"
            :fontFamily "Consolas,Monaco,Courier New,monospace"
-           :fontSize "12px"}
+           :fontSize "12px"
+           :z-index 9999}
    :strings {:color "#4Ebb4E"}
    :keywords {:color "purple"}
    :numbers {:color "blue"}


Improve comments

Improve comments

Thanks, @derwolfe!

--- src/desdemona/query.clj
+++ src/desdemona/query.clj
@@ -3,10 +3,13 @@

 (defn ^:private gen-query
   "Expands a query and events to a core.logic program that executes
-  it."
+  it.
+
+  This is implemented using syntax-quote because that was the easiest
+  way to produce this data structure with some values interpolated."
   [n-answers query events]
   `(l/run ~n-answers [results#]
-     (l/fresh [~'x]
+     (l/fresh [~'x] ;; ~'x means "literally x, don't gensym", see #28
        (l/== [~'x] results#)
        (l/membero ~'x ~events)
        ~query)))


I need to get cljfmt-flycheck...

I need to get cljfmt-flycheck...

--- src/desdemona/query.clj
+++ src/desdemona/query.clj
@@ -43,7 +43,6 @@
     [((= value ((attr lvar) :seq)) :seq)]
     `(l/featurec ~lvar {~attr ~value})))

-
 (defn run-dsl-query
   "Run a DSL query over some events and finds n answers (default 1)."
   ([dsl-query events]


Remove broadcast-user-change helper function

Because of the way users are stored per-group, this isn't really
useful anymore & its use can cause bugs

--- src/braid/core/server/sync_helpers.clj
+++ src/braid/core/server/sync_helpers.clj
@@ -45,19 +45,6 @@
         (chsk-send! uid [:braid.client/thread thread-with-last-opens])))
     (doseq [anon-id (@anonymous-group-readers (thread :group-id))]
       (chsk-send! anon-id [:braid.client/thread thread]))))
-
-(defn broadcast-user-change
-  "Broadcast user info change to clients that can see this user"
-  [user-id info]
-  (let [ids-to-send-to (disj
-                         (intersection
-                           (set (:any @connected-uids))
-                           (into
-                             #{} (map :id)
-                             (user/users-for-user user-id)))
-                         user-id)]
-    (doseq [uid ids-to-send-to]
-      (chsk-send! uid info))))

 (defn broadcast-group-change
   "Broadcast group change to clients that are in the group"


Projects on Project page are linked

Projects on Project page are linked

--- src-cljs/frontend/components/pages/projects.cljs
+++ src-cljs/frontend/components/pages/projects.cljs
@@ -28,25 +28,38 @@
                                      (fq/get project-model/parallelism :project)
                                      (fq/get project-model/buildable-parallelism :project))
                  :plan (fq/get project-model/buildable-parallelism :plan)}}
-  [projects plan]
+  [c projects plan]
   (build-legacy table/table
                 {:rows projects
                  :key-fn :project/vcs-url
                  :columns [{:header "Project"
-                            :cell-fn :project/name}
+                            :cell-fn
+                            (fn [project]
+                              (html
+                               (let [vcs-url (:project/vcs-url project)]
+                                 [:a
+                                  {:href (routes/v1-project-dashboard-path {:vcs_type (vcs-url/vcs-type vcs-url)
+                                                                            :org (vcs-url/org-name vcs-url)
+                                                                            :repo (vcs-url/repo-name vcs-url)})
+                                   :on-click #(analytics/track! c {:event-type :project-clicked
+                                                                   :properties {:vcs-type (vcs-url/vcs-type vcs-url)
+                                                                                :org (vcs-url/org-name vcs-url)
+                                                                                :repo (vcs-url/repo-name vcs-url)}})}
+                                  (:project/name project)])))}

                            {:header "Parallelism"
                             :type #{:right :shrink}
-                            :cell-fn #(html
-                                       (let [parallelism (project-model/parallelism %)
-                                             buildable-parallelism (when plan (project-model/buildable-parallelism plan %))
-                                             vcs-url (:project/vcs-url %)]
-                                         [:a {:href (routes/v1-project-settings-path {:vcs_type (-> vcs-url vcs-url/vcs-type vcs/->short-vcs)
-                                                                                :org (vcs-url/org-name vcs-url)
-                                                                                :repo (vcs-url/repo-name vcs-url)
-                                                                                :_fragment "parallel-builds"})}
-                                          parallelism "x"
-                                          (when buildable-parallelism (str " out of " buildable-parallelism "x"))]))}
+                            :cell-fn
+                            #(html
+                              (let [parallelism (project-model/parallelism %)
+                                    buildable-parallelism (when plan (project-model/buildable-parallelism plan %))
+                                    vcs-url (:project/vcs-url %)]
+                                [:a {:href (routes/v1-project-settings-path {:vcs_type (-> vcs-url vcs-url/vcs-type vcs/->short-vcs)
+                                                                             :org (vcs-url/org-name vcs-url)
+                                                                             :repo (vcs-url/repo-name vcs-url)
+                                                                             :_fragment "parallel-builds"})}
+                                 parallelism "x"
+                                 (when buildable-parallelism (str " out of " buildable-parallelism "x"))]))}

                            {:header "Team"
                             :type #{:right :shrink}
@@ -127,7 +140,7 @@
                    (if projects
                      (if-let [projects-with-followers
                               (seq (filter #(seq (:project/followers %)) projects))]
-                       (table projects-with-followers plan)
+                       (table this projects-with-followers plan)
                        (no-projects-available name))
                      (html [:div.loading-spinner common/spinner]))))))


Set <title> for org/project wf list page

--- src-cljs/frontend/components/pages/workflow.cljs
+++ src-cljs/frontend/components/pages/workflow.cljs
@@ -12,7 +12,7 @@
             [frontend.models.build :as build-model]
             [frontend.routes :as routes]
             [frontend.state :as state]
-            [frontend.utils :refer-macros [component element html]]
+            [frontend.utils :refer [set-page-title!] :refer-macros [component element html]]
             [frontend.utils.github :as gh-utils]
             [frontend.utils.legacy :refer [build-legacy]]
             [frontend.utils.vcs-url :as vcs-url]
@@ -236,9 +236,8 @@
          :view :projects
          :org (get-in props [:app/route-data :route-data/organization :organization/name])}))
   Object
-  ;; TODO: Title this page.
-  #_(componentDidMount [this]
-      (set-page-title! "Projects"))
+  (componentDidMount [this]
+    (set-page-title! "CircleCI"))
   (render [this]
     (let [{{org-name :organization/name
             vcs-type :organization/vcs-type} :routed-entity/organization
@@ -307,9 +306,8 @@
          :view :projects
          :org (get-in props [:app/route-data :route-data/organization :organization/name])}))
   Object
-  ;; TODO: Title this page.
-  #_(componentDidMount [this]
-      (set-page-title! "Projects"))
+  (componentDidMount [this]
+    (set-page-title! "CircleCI"))
   (render [this]
     (let [{{org-name :organization/name
             vcs-type :organization/vcs-type} :org-for-crumb}


DM + AB #116 - Fix tests

DM + AB #116 - Fix tests

--- test/objective8/integration/db/storage.clj
+++ test/objective8/integration/db/storage.clj
@@ -333,7 +333,7 @@
                      query-map {:entity :answer
                                 :question-id (:_id question)
                                 :objective-id (:objective-id question)
-                                :ordered-by :created-at}]
+                                :sorted-by :created-at}]

                  (storage/pg-retrieve-answers query-map)
                  => (contains [(contains (assoc answer :note "a real note")) ])))


Derp (update NS)

Derp (update NS)

--- src/doctopus/storage/impls/temp_fs.clj
+++ src/doctopus/storage/impls/temp_fs.clj
@@ -1,8 +1,10 @@
 (ns doctopus.storage.impls.temp-fs
   (:require [clojure.string :as str]
+            [doctopus.configuration :refer [docs-uri-prefix]]
             [doctopus.files :as files]
             [doctopus.storage.impls.fs-impl :refer [save-html-file] :as fs-impl]
             [me.raynes.fs :as fs]
+            [ring.util.response :refer [file-response]]
             [taoensso.timbre :as log]))

 ;; The root of the temp filesystem. Each Thing will store its stuff


Fix indentation.

Fix indentation.

--- src/dsbdp/data_processing_pipeline.clj
+++ src/dsbdp/data_processing_pipeline.clj
@@ -27,7 +27,7 @@
                         (.offer out-queue c))))]
     (.start proc-loop)
     {:interrupt (fn []
-                 (.interrupt proc-loop))}))
+                  (.interrupt proc-loop))}))

 (defn interrupt
   [obj]


return full records from select-upsert

return full records from select-upsert

--- src/er_cassandra/model/alia/upsert.clj
+++ src/er_cassandra/model/alia/upsert.clj
@@ -257,14 +257,15 @@
                       session
                       (get-in entity [:primary-table :name])
                       (get-in entity [:primary-table :key])
-                      (t/extract-uber-key-value entity record)))]
-
-    (upsert-changes*
-     session
-     entity
-     old-record
-     record
-     opts)))
+                      (t/extract-uber-key-value entity record)))
+        [r acqf] (upsert-changes*
+                  session
+                  entity
+                  old-record
+                  record
+                  opts)]
+    (return [(merge old-record r)
+             acqf])))

 (s/defn change*
   "change a single instance.


tweak

tweak

--- src/structural_typing/validators.clj
+++ src/structural_typing/validators.clj
@@ -5,12 +5,12 @@

 (defmacro defoptional
   "Define a validator for an optional argument.
-
-       (defoptional number
-         \"Validates against optional `number?`\" ; doc string
-         \"%s is `%s`, which is not a number\"
-         [maybe-a-number]
-         (number? maybe-a-number))
+
+         (defoptional number
+           \"Validates against optional `number?`\" ; doc string
+           \"%s is `%s`, which is not a number\"
+           [maybe-a-number]
+           (number? maybe-a-number))
 "
   [name doc message-format arglist & body]
   `(do