Throw if we don't match the deserialized message.

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -157,7 +157,11 @@
           (= msg-type protocol/retry-msg-id)
           (let [retry-id (protocol/read-retry buffer offset)]
             (when-let [chs (pm/peer-channels v-peers peer-id)]
-              (>!! (:retry-ch chs) retry-id))))))
+              (>!! (:retry-ch chs) retry-id)))
+
+          :else
+          (throw (ex-info "Could not deserialize incoming message from Aeron"
+                          {:msg-type msg-type})))))

 (defn start-subscriber! [bind-addr port stream-id virtual-peers decompress-f idle-strategy]
   (let [ctx (-> (Aeron$Context.)


Remove NPE when peers that are dispatched to have been removed from the peer manager

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -349,8 +349,9 @@
       ch-k))

 (defn send-messages-short-circuit [ch batch]
-  (doseq [segment batch]
-    (>!! ch segment)))
+  (when ch
+    (doseq [segment batch]
+      (>!! ch segment))))

 (def ^:const publication-backpressured? (long -2))

@@ -366,8 +367,9 @@
         (.idle ^IdleStrategy idle-strategy 0)))))

 (defn ack-messages-short-circuit [ch acks]
-  (doseq [ack acks]
-    (>!! ch ack)))
+  (when ch
+    (doseq [ack acks]
+      (>!! ch ack))))

 (defmethod extensions/internal-ack-messages AeronConnection
   [messenger event {:keys [id channel] :as conn-info} acks]
@@ -382,7 +384,8 @@
         (.idle ^IdleStrategy idle-strategy 0)))))))

 (defn complete-message-short-circuit [ch completion-id]
-  (>!! ch completion-id))
+  (when ch
+    (>!! ch completion-id)))

 (defmethod extensions/internal-complete-message AeronConnection
   [messenger event completion-id {:keys [id channel] :as conn-info}]
@@ -396,7 +399,8 @@
         (.idle ^IdleStrategy idle-strategy 0)))))

 (defn retry-message-short-circuit [ch retry-id]
-  (>!! ch retry-id))
+  (when ch
+    (>!! ch retry-id)))

 (defmethod extensions/internal-retry-message AeronConnection
   [messenger event retry-id {:keys [id channel] :as conn-info}]


synth-controller can now display controls for multiple synths.

--- src/overtone/gui/control.clj
+++ src/overtone/gui/control.clj
@@ -56,43 +56,58 @@
          (bind/filter #(>= (Math/abs (- % (value spinner))) 0.01))
          spinner))]))

-(defn synth-controller
-  "Create a GUI for the given synth or instrument.  Requires sufficient parameter metadata in the synthdef.
-
-  (defsynth foo [freq {:default 440 :min 20 :max 10000 :step 1}]
-    (out 0 (* [0.6 0.6] (env-gen (perc 0.01 0.2) :action FREE) (sin-osc freq))))
-
-  (gui-for foo) ; pops up gui window that will modify active synths and default param values
-
-  ; To reset the synth back to the original default paremeter values use
-  (reset-synth-defaults foo)
-  "
+(defn synth-controller-panel
   [synth]
-  (invoke-now
-    (let [full-params (filter #(not (or (= :none (:type %))
+  (let [full-params (filter #(not (or (= :none (:type %))
                                         (nil? (:min %))
                                         (nil? (:max %))
                                         (nil? (:step %))))
                               (:params synth))]
       (if (zero? (count full-params))
-        (alert (str "The '" (:name synth) "'"
+        (do
+          (alert (str "The '" (:name synth) "'"
                     " synth or instrument does not have any parameters"
                     " with the required meta-data. "
                     " (e.g.  [freq {:default 80 :min 40 :max 880 :step 1}])"))
+          {:synth synth
+           :panel (label :text "Missing parameters" :border (:name synth))
+           :cleanup (fn [])})
         (let [control-panes (map
                               (fn [{:keys [name default min max step value]}]
                                 (control-slider name min max step value))
                               full-params)
               cleanup       (apply juxt (map second control-panes))
-              pane (mig-panel :constraints ["" "[right][center][center]" ""]
-                              :items (mapcat first control-panes))
-              frame (frame :title (:name synth)
-                           :content pane
-                           :on-close :dispose)]
-          ; When the window is closed, unhook everything from the synth
-          ; so the ui can be garbage collected, etc.
-          (listen frame :window-closed (fn [_] (cleanup)))
-          (-> frame pack! show!))))))
+              panel (mig-panel :constraints ["" "[right][center][center]" ""]
+                               :items (mapcat first control-panes)
+                               :border (:name synth))]
+          {:synth synth
+           :panel panel
+           :cleanup cleanup}))))
+
+(defn synth-controller
+  "Create a GUI for the given synths or instruments.  Each synth must have sufficient
+   parameter metadata in the synthdef.
+
+    (defsynth foo [freq {:default 440 :min 20 :max 10000 :step 1}]
+      (out 0 (* [0.6 0.6] (env-gen (perc 0.01 0.2) :action FREE) (sin-osc freq))))
+
+    ; pops up gui window that will modify active synths and default param values
+    (synth-controller foo)
+
+    ; To reset the synth back to the original default paremeter values use
+    (reset-synth-defaults foo)
+  "
+  [& synths]
+  (invoke-now
+    (let [panels  (map synth-controller-panel synths)
+          cleanup (apply juxt (map :cleanup panels))
+          frame (frame :title "Synth Controllers"
+                       :content (vertical-panel :items (map :panel panels))
+                       :on-close :dispose)]
+      ; When the window is closed, unhook everything from the synth
+      ; so the ui can be garbage collected, etc.
+      (listen frame :window-closed (fn [_] (cleanup)))
+      (-> frame pack! show!))))

 (comment
   (use 'overtone.gui.control)


Store dev-keys of seen MIDI devices.

Store dev-keys of seen MIDI devices.

--- src/overtone/studio/midi.clj
+++ src/overtone/studio/midi.clj
@@ -9,14 +9,19 @@
 (defonce midi-devices* (atom {}))
 (defonce midi-control-agents* (atom {}))
 (defonce poly-players* (atom {}))
+(defonce seen-midi-device-keys* (atom #{}))

 (def EXCLUDED-DEVICES #{"Real Time Sequencer" "Java Sound Synthesizer"})
+
+(defn midi-mk-full-device-key
+  [dev]
+  [:midi-device (dev :vendor) (dev :name) (dev :description)])

 (defn midi-mk-full-device-event-key
   "Creates the device-specific part of the key used for events generated
   by incoming MIDI messages."
   [dev command]
-  [:midi-device (dev :vendor) (dev :name) (dev :description) command])
+  (concat (midi-mk-full-device-key dev) [command]))

 (defn midi-mk-full-control-event-key
   "Creates the full key used for events generated by incoming MIDI
@@ -28,12 +33,16 @@
 (defn midi-event
   "Place incoming midi-event onto the global event stream."
   [dev msg & [ts]]
-  (let [command (:command msg)
-        data2-f (float (/ (:data2 msg) 127))
-        msg     (assoc msg :data2-f data2-f :velocity-f data2-f)]
+  (let [command       (:command msg)
+        data2-f       (float (/ (:data2 msg) 127))
+        msg           (assoc msg :data2-f data2-f :velocity-f data2-f)
+        dev-key       (midi-mk-full-device-key dev)
+        dev-event-key (midi-mk-full-device-event-key dev command)]
     (event [:midi command] msg)
     (event (midi-mk-full-control-event-key dev command (:data1 msg)) msg)
-    (event (midi-mk-full-device-event-key dev command) msg)))
+    (event dev-event-key msg)
+    (when-not (get @seen-midi-device-keys* dev-key)
+      (swap! seen-midi-device-keys* conj dev-key))))

 (defn- detect-midi-devices
   "Designed to run periodically and update the midi-devices* atom with


[#12858] [ANDROID] Changing screen orientation results in breaking images / layout

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/navigation/roots.cljs
+++ src/status_im/navigation/roots.cljs
@@ -35,6 +35,7 @@

 (defn default-root []
   {:layout {:componentBackgroundColor colors/white
+            :orientation              "portrait"
             :backgroundColor          colors/white}})

 (defn merge-top-bar [root-options options]


Fix typo

Fix typo

--- src/test/cljc/mikron/test_util.cljc
+++ src/test/cljc/mikron/test_util.cljc
@@ -21,13 +21,14 @@
   (condp contains? (type value)
     #{runtime.processor.validate/binary-type}
     [:mikron/binary #?(:clj  (seq value)
-                       :cljs (arraybuffer->seq x))]
+                       :cljs (arraybuffer->seq value))]

     #?(:clj  #{java.lang.Double java.lang.Float}
        :cljs #{js/Number})
     (if (nan? value)
       :mikron/nan
       (double value))
+
     value))

 (defn fix-for-equality


Upload: Use :file as :key for file-list.

--- src-cljs/pepa/workflows/upload.cljs
+++ src-cljs/pepa/workflows/upload.cljs
@@ -144,6 +144,7 @@
           (if-not mini?
             (list
              [:header {:on-click toggle-mini}]
-             (om/build file-list files)
+             ;; Not sure if {:key :file} works.
+             (om/build file-list files {:key :file})
              (om/build upload-button upload))
             "Upload Files")])))))


Also, handle nil in read-edn.

Also, handle nil in read-edn.

--- src/konserve/filestore.clj
+++ src/konserve/filestore.clj
@@ -181,10 +181,9 @@
                    (let [bais (ByteArrayInputStream. (.array bb))]
                      (try
                        (let [value (-deserialize serializer read-handlers bais)]
-                         (put! res-ch
-                               (if (not-empty rkey)
-                                 (get-in value rkey)
-                                 value)))
+                         (if-let [value (if (not-empty rkey) (get-in value rkey))]
+                           (put! res-ch value)
+                           (close! res-ch)))
                        (catch Exception e
                          (ex-info "Could not read key."
                                   {:type      :read-error


Reset history when restarting the discussion

--- src/discuss/communication/lib.cljs
+++ src/discuss/communication/lib.cljs
@@ -123,7 +123,7 @@
    (init! (:init config/api)))
   ([slug]
    (log/fine (format "Initializing discussion: %s" (:init config/api)))
-   (hdis/save-discussion-url! slug)
+   (hdis/save-discussion-urls! [slug])
    (ajax-get-and-change-view slug :default index-handler)))
 (s/fdef init!
   :args (s/? (s/cat :slug string?)))


Typo in error message.

Typo in error message.

--- src/midje/midje_forms/translating.clj
+++ src/midje/midje_forms/translating.clj
@@ -30,7 +30,7 @@
 		 (rest in-progress))

 	  :else
-	  (throw (Error. (str "This doesn't look like part of a background: %s"
+	  (throw (Error. (str "This doesn't look like part of a background: "
 			      (vec in-progress)))))))

 (defn- replace-with-magic-form [form]


Added multimethod to remove temporary directory

--- src/emender_service/file_utils.clj
+++ src/emender_service/file_utils.clj
@@ -1,4 +1,6 @@
 (ns emender-service.file-utils)
+
+(require '[hozumi.rm-rf    :as rm-rf])

 (def temporary-name-prefix
     "emender-service-")
@@ -55,6 +57,25 @@
         (.mkdir temp-dir)
         temp-dir))

+(defmulti remove-temporary-directory
+    "Remove (delete) temporary directory that resides in /tmp (at least on Linux)."
+    class)
+
+(defmethod remove-temporary-directory java.io.File
+    [directory-name]
+    (let [abs-path (.getAbsolutePath directory-name)]
+        ; make sure we are not going to remove wrong directory!
+        (if (.startsWith abs-path "/tmp")
+            (rm-rf/rm-r directory-name))))
+
+(defmethod remove-temporary-directory java.lang.String
+    [directory-name]
+    (remove-temporary-directory (new java.io.File directory-name)))
+
+(defn remove-directory
+    [directory]
+    (rm-rf/rm-r directory))
+
 (defn move-file
     "Move or rename one file. On the same filesystem the rename should be atomic."
     [filename1 filename2]


Make the feature a direct link.

Make the feature a direct link.

--- src/cljs/onyx_cheat_sheet/core.cljs
+++ src/cljs/onyx_cheat_sheet/core.cljs
@@ -219,8 +219,7 @@
                :id (str (keyword-sanitize-? k))}
               (dom/pre #js {:className "key-header"}
                        (dom/a #js {:href (str "#" (name section) "/" (keyword-sanitize-? k))}
-                              (dom/i #js {:className "fa fa-link"}))
-                       (str k)
+                              (str k))
                        (if deprecated?
                          (r/badge {:class "deprecated-badge onyx-badge"} "deprecated"))
                        (requirements section k))


imports are :js-var

imports are :js-var

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -367,9 +367,9 @@
                       {:ns           ns
                        :js-namespace true})
                (swap! env/*env* update-in [:namespaces ns :mappings] merge
-                      (reduce (fn [m k] (assoc m k {:op          :js-var
-                                                   :name        k
-                                                   :namespace   ns}))
+                      (reduce (fn [m k] (assoc m k {:op   :js-var
+                                                   :name k
+                                                   :ns   ns}))
                               {} refer)))
           (analyze-ns ns)))))

@@ -383,7 +383,9 @@
 (defn populate-env
   [{:keys [import require require-macros refer-clojure]} ns-name env]
   (let [imports (reduce-kv (fn [m prefix suffixes]
-                             (merge m (into {} (mapv (fn [s] [s (symbol (str prefix "." s))]) suffixes)))) {} import)
+                             (merge m (into {} (mapv (fn [s] [s {:op   :js-var
+                                                                :ns   prefix
+                                                                :name s}]) suffixes)))) {} import)
         require-aliases (reduce (fn [m [ns {:keys [as]}]]
                                   (if as
                                     (assoc m as ns)


Support destructuring in :given vectors

Support destructuring in :given vectors

--- src/main/clojure/com/stuartsierra/lazytest.clj
+++ src/main/clojure/com/stuartsierra/lazytest.clj
@@ -15,8 +15,10 @@
 (defmacro with-context
   "Establishes a local binding of sym to the state returned by context
   c in all groups and examples found within body."
-  [sym c & body]
-  `(let [~(with-meta sym {::local true ::order (local-counter)}) ~c]
+  [form c & body]
+  `(let [~(with-meta (gensym) {::local true
+			       ::order (local-counter)
+			       ::arg form}) ~c]
      ~@body))

 (defmacro wrap-context
@@ -34,6 +36,12 @@
   [env]
   (vec (sort-by #(::order (meta %))
                 (filter #(::local (meta %)) (keys env)))))
+
+(defn- find-local-args
+  "Returns a vector of the function argument forms of locals bound by
+  with-context in the environment."
+  [env]
+  (vec (map #(::arg (meta %)) (find-locals env))))

 (defmacro context
   "Creates a context object, using existing local contexts.
@@ -83,7 +91,7 @@
   (let [[doc args] (get-arg string? args)
 	[opts body] (get-options args)
 	metadata (merge (standard-metadata &form doc) opts)]
-    `(with-meta (fn ~(find-locals &env) ~@body)
+    `(with-meta (fn ~(find-local-args &env) ~@body)
        '~metadata)))

 (defn run-tests [& args]


Update spec for add mutation, use ::pc/params instead of ::pc/args

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -130,7 +130,7 @@
 (s/fdef add-mutation
   :args (s/cat :indexes (s/or :index ::indexes :blank #{{}})
                :sym ::sym
-               :sym-data (s/? (s/keys :opt [::args ::output])))
+               :sym-data (s/? (s/keys :opt [::params ::output])))
   :ret ::indexes)

 (defn sort-resolvers [{::p/keys [request-cache]} resolvers e]


Shim removed and use Cljs :main instead

Shim removed and use Cljs :main instead

--- src/adzerk/boot_cljs/middleware.clj
+++ src/adzerk/boot_cljs/middleware.clj
@@ -29,65 +29,6 @@
   [forms]
   (->> forms (map pr-str) (string/join "\n\n") (format "%s\n")))

-(defn- file->goog
-  "Given a CLJS source file, returns the corresponding goog.require() JS expr."
-  [path]
-  (format "goog.require('%s');" (util/path->js path)))
-
-(defn- write-src
-  "Returns a JS expr that uses writeScript() to add a <script> tag to the
-  document with the given src attribute and no body."
-  [src]
-  (format "  writeScript(\"<script src='\" + prefix + \"%s'></script>\");\n" src))
-
-(defn- write-body
-  "Returns a JS expr that uses writeScript() to add a <script> tag to the
-  document with the given body and no src attribute."
-  [body]
-  (format "  writeScript(\"<script>%s</script>\");\n" body))
-
-(def ^:private shim-js
-"// boot-cljs shim
-(function() {
-  var shimRegex = new RegExp('(.*)%s$');
-
-  function findPrefix() {
-    var els = document.getElementsByTagName('script');
-    for (var i = 0; i < els.length; i++) {
-      var src = els[i].getAttribute('src');
-      var match = src && src.match(shimRegex);
-      if (match) return match[1]; }
-    return ''; }
-
-  var prefix = findPrefix();
-  var loadedSrcs = {};
-  var scripts = document.getElementsByTagName('script');
-
-  for (var i = 0; i < scripts.length; i++)
-    if (scripts[i].src !== undefined)
-      loadedSrcs[scripts[i].src] = true;
-
-  function writeScript(src) {
-    var newElem;
-    if (window.__boot_cljs_shim_loaded === undefined)
-      document.write(src);
-    else {
-      newElem = document.createElement('div');
-      newElem.innerHTML = src;
-      if (newElem.src !== undefined && loaded[newElem.src] === undefined) {
-        document.getElementsByTagName('head')[0].appendChild(newElem); }}}
-
-%s%s
-  window.__boot_cljs_shim_loaded = true; })();
-")
-
-(defn- output-path-for
-  "Given the path to the shim JS file, returns the corresponding output-to
-  path to be given to the CLJS compiler. This is the JS file the shim will
-  actually load."
-  [shim-path]
-  (->> shim-path util/get-name (str "boot-cljs-") (util/replace-path shim-path) .getPath))
-
 ;; middleware ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn main
@@ -98,6 +39,8 @@
   [{:keys [tmp-src tmp-out main files opts] :as ctx}]
   (let [[path file] ((juxt core/tmppath core/tmpfile) main)
         base-name   (-> file .getName deps/strip-extension)
+        ; FIXME: WINDOWS!
+        parent-path (.getParent (io/file path))
         js-path     (.getPath (io/file tmp-out (str base-name ".js")))
         cljs-path   (.getPath (io/file "boot" "cljs" (str base-name ".cljs")))
         cljs-file   (doto (io/file tmp-src cljs-path) io/make-parents)
@@ -109,42 +52,17 @@
     (->> (main-ns-forms cljs-ns init-nss init-fns) format-ns-forms (spit cljs-file))
     (-> ctx
         (assoc-in [:opts :output-to] js-path)
+        (assoc-in [:opts :main] cljs-ns)
+        ; FIXME:
+        (assoc-in [:opts :asset-path] (str parent-path "/" "out"))
         (update-in [:opts] (partial merge-with util/into-or-latest) (:compiler-options main-edn)))))

 (defn shim
-  "Middleware to create the JS shim that automatically loads goog/base.js and
-  does the necessary goog.require()'s to bootstrap the compiled JS file when
-  :optimizations is :none (i.e. when the Google Closure compiler is not being
-  used to produce a single compiled JS file). When using any other compilation
-  level this middleware adds external JS files to the compiler preamble and
-  doesn't create a shim."
   [{:keys [tmp-src tmp-out main files opts docroot] :as ctx}]
-  (cond
-    (= :nodejs (:target opts))
-    ctx
-
-    (not= :none (:optimizations opts))
-    (let [incs (->> (:incs files)
-                    (map core/tmppath)
-                    (remove #(contains? (set (:preamble opts)) %)))]
-      (update-in ctx [:opts :preamble] (comp vec distinct into) incs))
-
-    :else
-    (let [base-name   (-> main core/tmpfile .getName deps/strip-extension)
-          shim-path   (:output-to opts)
-          shim-name   (util/get-name shim-path)
-          output-to   (output-path-for shim-path)
-          output-dir  (util/get-name (:output-dir opts))
-          cljs-paths  (map core/tmppath (:cljs files))
-          rooted-path #(util/rooted-relative docroot (core/tmppath %))
-          scripts     (-> (:incs files)
-                          (->> (mapv rooted-path))
-                          (conj (str output-dir "/goog/base.js"))
-                          (conj (util/get-name output-to)))]
-      (->> (write-body (file->goog (str "boot/cljs/" base-name)))
-           (format shim-js shim-name (apply str (map write-src scripts)))
-           (spit shim-path))
-      (assoc-in ctx [:opts :output-to] output-to))))
+  (let [incs (->> (:incs files)
+                  (map core/tmppath)
+                  (remove #(contains? (set (:preamble opts)) %)))]
+    (update-in ctx [:opts :preamble] (comp vec distinct into) incs)))

 (defn externs
   "Middleware to add externs files (i.e. files with the .ext.js extension) and


Starting mapping of Pixellicious2.

Starting mapping of Pixellicious2.

--- src/afterglow/fixtures/blizzard.clj
+++ src/afterglow/fixtures/blizzard.clj
@@ -417,3 +417,17 @@
                                    :range :variable})
               (chan/functions :control 9 0 nil
                               128 {:type :sound-active :var-label "Sensitivity" :range :variable})]})
+
+(defn pixellicious-2
+  "12x12 LED pixel tile in 432 channel mode."
+  []
+  {:name "Blizzard Pixellicious2"
+   :channels []
+   :heads (for [i (range 144)]
+            (let [x (+ (* (rem i 12) 0.025) -0.15)
+                  y (+ (* (quot i 12) 0.025) -0.15)
+                  c (+ (* i 3) 1)]
+              {:channels [(chan/color c :red)
+                          (chan/color (inc c) :green)
+                          (chan/color (+ 2 c) :blue)]
+               :x x :y y}))})


Fix for changed-href?

Fix for changed-href?

All functions that use changed-href? expect a goog.Uri. instance where
they can call .makeUnique on.

This fixes:
- reload-css
- reload-img
- reload-html

--- src/adzerk/boot_reload/reload.cljs
+++ src/adzerk/boot_reload/reload.cljs
@@ -21,7 +21,7 @@
   (when href-or-uri
     (let [path (normalize-href-or-uri href-or-uri)]
       (when (not-empty (filter #(ends-with? (normalize-href-or-uri %) path) changed))
-        path))))
+        (guri/parse path)))))

 (defn- reload-css [changed]
   (let [sheets (.. js/document -styleSheets)]


Correct doc reference to handlers/register-base

--- src/re_frame/middleware.cljs
+++ src/re_frame/middleware.cljs
@@ -18,7 +18,7 @@
   You don't have to use this middleware directly. It is automatically applied to
   your handler's middleware when you use \"register-handler\".
   In fact, the only way to by-pass automatic use of \"pure\" in your middleware
-  is to use the low level registration function \"re-frame.handlers/register-handler-base\""
+  is to use the low level registration function \"re-frame.handlers/register-base\""
   [handler]
   (fn pure-handler
     [app-db event-vec]


fix dev server

fix dev server

--- src/misaki/server.clj
+++ src/misaki/server.clj
@@ -2,6 +2,7 @@
   "misaki: development server"
   (:use
     [misaki core config]
+    [misaki.util.file :only [add-path-slash]]
     watchtower.core
     [compojure.core :only [routes]]
     [compojure.route :only [files]]
@@ -9,9 +10,6 @@

 (defn- blue [s] (str "\033[36m" s "\033[0m"))
 (defn- red  [s] (str "\033[31m" s "\033[0m"))
-
-(defn- add-path-slash [path]
-  (if path (if (.endsWith path "/") path (str path "/"))))

 ; =print-result
 (defn print-result


fixing classes merger

fixing classes merger

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -87,7 +87,7 @@
   (let [opts (or run-opts {:args [] :classes {}})]
     (-> module
       (update-in [:args] (fn [a] (concat a (opts :args))))
-      (merge (select-keys opts [:classes]))
+      ((partial merge-with merge) (select-keys opts [:classes]))
       (assoc :hostname (machine :hostname)))))

 (defmethod pconstruct :puppet-std


added require that I missed

added require that I missed

--- src/clj/onyx_java/utils/map_fns.clj
+++ src/clj/onyx_java/utils/map_fns.clj
@@ -1,5 +1,6 @@
 (ns onyx-java.utils.map-fns
   (:gen-class)
+  (:require [clojure.java.io :refer [resource]])
   (:import clojure.lang.IPersistentMap
            org.onyxplatform.api.java.OnyxMap))


Default to Seti theme

Default to Seti theme

--- src/cljs/asciinema_player/view.cljs
+++ src/cljs/asciinema_player/view.cljs
@@ -148,7 +148,7 @@
     [:div.loader]])

 (defn player-class-name [theme-name]
-  (str "asciinema-theme-" (or theme-name "tango")))
+  (str "asciinema-theme-" (or theme-name "seti")))

 (defn player-style [] {})


fix issue in deckbuilder

fix issue in deckbuilder

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -330,7 +330,7 @@
                 [:h3 (:name deck)]
                 [:div.header
                  [:img {:src (image-url identity)}]
-                 [:h4.fake-link {:on-mouse-enter #((put! zoom-channel identity))
+                 [:h4.fake-link {:on-mouse-enter #(put! zoom-channel identity)
                                  :on-mouse-leave #(put! zoom-channel false)} (:title identity)]
                  (let [count (card-count cards)
                        min-count (:minimumdecksize identity)]
@@ -368,7 +368,7 @@
                          (let [card (:card line)]
                            [:span
                             [:span {:class (if (allowed? card identity) "fake-link" "invalid")
-                                    :on-mouse-enter #((put! zoom-channel card))
+                                    :on-mouse-enter #(put! zoom-channel card)
                                     :on-mouse-leave #(put! zoom-channel false)} name]
                             (when-not (or (= (:faction card) (:faction identity))
                                           (zero? (:factioncost card)))


Improve key code recognition

Improve key code recognition

--- src/clojure/paredit_widget/core.clj
+++ src/clojure/paredit_widget/core.clj
@@ -37,7 +37,7 @@
     (.setSelectionStart w (:offset pe))
     (.setSelectionEnd w (+ (:offset pe) (:length pe)))))

-(def os-x-charmap
+(def ^:const os-x-charmap
   {"‚" ")" ;;close and round newline
    "Æ" "\"" ;; meta double quote
    "…" ";"  ;; paredit-commit-dwim
@@ -91,18 +91,15 @@

 (defn convert-key-event [event]
   (let [key-code (.getKeyCode event)
-        key-char (.getKeyChar event)
-        key-text (KeyEvent/getKeyText key-code)]
-    (when *debug* (println [event key-code key-char key-text]))
+        key-char (.getKeyChar event)]
     [(cond
+       (and (.isAltDown event) (.isControlDown event)) nil
        (.isAltDown event) "M"
        (.isControlDown event) "C"
        :else nil)
-     (if (.isControlDown event)
-       key-text
-       (if (get #{"Left" "Right"} key-text)
-         key-text
-         (str key-char)))]))
+     (if (= KeyEvent/CHAR_UNDEFINED key-char)
+       (KeyEvent/getKeyText key-code)
+       (str key-char))]))

 (defn key-event-handler [w buffer enable?]
   (reify KeyListener


changed server url

changed server url

--- src/name_bazaar/ui/db.cljs
+++ src/name_bazaar/ui/db.cljs
@@ -16,7 +16,7 @@
     district0x.ui.db/default-db
     {:node-url "https://mainnet.infura.io/" #_ "http://localhost:8549" #_ "http://localhost:8545"
      :load-node-addresses? false
-     :server-url #_ "http://localhost:6200" "http://52.27.20.88:6200"
+     :server-url #_ "http://localhost:6200" "https://api.namebazaar.io"
      :active-page (d0x-ui-utils/match-current-location constants/routes)
      :smart-contracts smart-contracts
      :now (t/now)


moved around how templates are laid out for buttons

--- src/noteServer/handler.clj
+++ src/noteServer/handler.clj
@@ -37,21 +37,25 @@
                    (include-css "frontend/style.css"
                                 "frontend/svg-style.css")]
                   [:body
-                   [:template#module-adder-template
+                   [:template#meta-control-template
+                   ;[:template#module-adder-template
                     [:div.module-adder-module {:role "module"}
-                     [:button.module-btn.header-module-btn {:data-type "header"} "H"]
-                     [:button.module-btn.text-module-btn   {:data-type "text"  } "T"]
-                     [:button.module-btn.list-module-btn   {:data-type "list"  } "L"]
-                     [:button.module-btn.image-module-btn  {:data-type "image" } "I"]]]
-                   [:template#remove-confirm-template
+                     [:div.button-spacer
+                      [:button.module-btn.header-module-btn {:data-type "header"} "H"]
+                      [:button.module-btn.text-module-btn   {:data-type "text"  } "T"]
+                      [:button.module-btn.list-module-btn   {:data-type "list"  } "L"]
+                      [:button.module-btn.image-module-btn  {:data-type "image" } "I"]]]
+                   ;[:template#remove-confirm-template
                     [:div.remove-confirm-module {:role "module"}
+                     [:div.button-spacer
                      [:button.remove-confirm-btn {:name "confirm"} "Really Delete"]
                      [:button.remove-cancel-btn {:name "cancel"} "Cancel"]]]
-                   [:template#meta-control-template
+                   ;[:template#meta-control-template
                     [:div.meta-control-module {:role "module"}
-                     [:button.edit-module-btn [:object {:type "image/svg+xml" :data "icons/edit.svg"}]]
-                     [:button.new-module-btn [:object {:type "image/svg+xml" :data "icons/new.svg"}]]
-                     [:button.remove-module-btn [:object {:type "image/svg+xml" :data "icons/delete.svg"}]]]]
+                     [:div.button-spacer
+                      [:button.edit-module-btn   [:object { :type "image/svg+xml" :data "icons/edit.svg"}]]
+                      [:button.new-module-btn    [:object { :type "image/svg+xml" :data "icons/new.svg"}]]
+                      [:button.remove-module-btn [:object { :type "image/svg+xml" :data "icons/delete.svg"}]]]]]

                    [:section#note-container (html/format-notes (db/query-notes))]]))


Replace candidate-message function with one in clj-sub-command

--- src/cljam/cli.clj
+++ src/cljam/cli.clj
@@ -2,7 +2,7 @@
   "Implementations of the command-line tool."
   (:refer-clojure :exclude [sort merge])
   (:require [clojure.string :as cstr]
-            [clj-sub-command.core :refer [sub-command]]
+            [clj-sub-command.core :refer [sub-command candidate-message]]
             [clojure.tools.cli :refer [parse-opts]]
             (cljam [core :refer [reader writer]]
                    [sam :as sam]
@@ -34,16 +34,6 @@
   [errors]
   (str "The following errors occurred while parsing your command:\n\n"
        (cstr/join \newline errors)))
-
-(defn- candidate-msg
-  "Returns a message  of candidate sub-commands."
-  [candidates]
-  (->> candidates
-       (map (partial str "        "))
-       (cons (if (= (count candidates) 1)
-               "Did you mean this?"
-               "Did you mean one of these?"))
-       (cstr/join \newline)))

 ;; Sub-commands
 ;; ------------
@@ -401,4 +391,4 @@
       (do (println "Invalid command. See 'cljam --help'.")
           (when (seq cands)
             (newline)
-            (exit 1 (candidate-msg cands)))))))
+            (exit 1 (candidate-message cands)))))))


[core][api] prediction fn

[core][api] prediction fn

--- src/og/clj_dstream/api.clj
+++ src/og/clj_dstream/api.clj
@@ -8,6 +8,15 @@
 (defn get-clusters [state]
   "Get cilantro"
   (core/state->clusters state))
+
+(defn predict-cluster-or-outlier [raw-datum state]
+  "For a state (trained) and a raw datum,
+  get the cluster the data would belong to or nil,
+  where nil means the datum is an outlier of the model"
+  (let [idx (core/position-value->position-index (merge raw-datum (::core/properties state)))
+        grid-cells (::core/grid-cells state)]
+    (when (contains?  grid-cells idx)
+      (::core/cluster (get grid-cells idx)))))

 (defn put-next-data [state data]
   "Take a seq of raw data representing the next time step


More secure and notifying

More secure and notifying

Removes printing of the environment variables and changed the println to an exception thrown.

--- src/rmfu/core.clj
+++ src/rmfu/core.clj
@@ -23,9 +23,8 @@
 (defn check-env
   "Checks if an environment variable exists"
   [env-var]
-  (if (nil? (System/getenv env-var))
-    (str env-var " is missing.")
-    (str env-var ": " (System/getenv env-var))))
+  (when (nil? (System/getenv env-var))
+    (throw (Exception. (str env-var " is missing.")))))

 (if (env :dev?)
   (do


You can never have enough tests, right?

You can never have enough tests, right?

Right.

--- formatter/test/formatter/Extensions/thread_last_test.clj
+++ formatter/test/formatter/Extensions/thread_last_test.clj
@@ -91,4 +91,8 @@
     (deftest binding-exclusion
       (testing "Checks to see that rebound do-not-nest excludes."
         (is (not
-          (contains? binding-suggestions "(html/defsnippet")))))))+          (contains? binding-suggestions "(html/defsnippet")))))))
+
+(deftest single-form
+  (testing "Testing that it doesn't explode when passed a single form."
+    (is (= 0 (count (get-suggestions ":a"))))))


Fix bug in nav-switch top description.

Fix bug in nav-switch top description.

--- src/angelic/domains/nav_switch.clj
+++ src/angelic/domains/nav_switch.clj
@@ -244,8 +244,8 @@
     (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))] [{} p]))
   (optimistic-set-and-reward- [a ss]
     [(state/set-vars ss (util/map-vals (fn [x] #{x}) finish))
-     (* -2 (+ (- gx (util/safe-singleton (state/get-var ss '[x])))
-              (- gy (util/safe-singleton (state/get-var ss '[y])))))])
+     (* -2 (+ (util/abs (- gx (util/safe-singleton (state/get-var ss '[x]))))
+              (util/abs (- gy (util/safe-singleton (state/get-var ss '[y]))))))])
   (pessimistic-set-and-reward- [a ss]
     [(state/set-vars ss (util/map-vals (fn [x] #{x}) finish))
      (nav-reward-from-set ss gx gy min)]))


Expand unnecessarily condensed fn name

Expand unnecessarily condensed fn name

--- src/uruk/core.clj
+++ src/uruk/core.clj
@@ -429,7 +429,7 @@
 ;;      }
 ;;     ))

-(defn usr-creds->map
+(defn user-credentials->map
   "Given a UserCredentials object, returns a map describing its
   configuration. See also methods `toHttpNegotiateAuth` and
   `toHttpDigestAuth`."
@@ -452,7 +452,7 @@
    :content-source (.getContentSource session)
    :xaresource (.getXAResource session)
    :user-object (.getUserObject session)
-   :user-credentials (usr-creds->map (.getUserCredentials session))
+   :user-credentials (user-credentials->map (.getUserCredentials session))
    :closed? (.isClosed session) ;; TODO maybe create (defn closed? [session] ...) ? Except it wouldn't be specific to Session in this ns, and ResultSequence also has isClosed, so it's ambiguous.
    :cached-transaction-timeout (.getCachedTxnTimeout session)
    :transaction-timeout (.getTransactionTimeout session)


Filter out html, trying to avoid some security issues. Explicitly transform line breaks with html <br>

--- src/notes/handler.clj
+++ src/notes/handler.clj
@@ -4,9 +4,11 @@
         [hiccup.form]
         [hiccup.page]
         [hiccup.element]
+        [hiccup.util]
         [ring.util.response]
         [clojure.data])
-  (:require [compojure.handler :as handler]
+  (:require [clojure.string :as s]
+            [compojure.handler :as handler]
             [compojure.route :as route]
             [clojure.java.io :as io]
             [monger.core :as mg]
@@ -67,9 +69,9 @@
                                                        [:button.btn {:type "submit"} "Create Note!"]])]]

          [:div.span8 (for [{:keys [_id, heading, body, added? ts]} notes]
-           [(if added? :div#added.note :div.note) [:div.row-fluid [:div.span11 [:legend heading]]
+           [(if added? :div#added.note :div.note) [:div.row-fluid [:div.span11 [:legend (escape-html heading)]]
                                       [:div.span1 [:div.del (form-to [:delete "./"] (hidden-field :id _id) [:button.btn.btn-mini.btn-link {:type "submit"} [:i.icon-remove ]])]]]
-                      [:div body]
+                      [:div (s/replace (escape-html body) #"\n" "<br>")]
                       [:p.text-info [:small ts]]])]]]

       [:footer


moved stuff into comment

moved stuff into comment

--- support/src/figwheel/auto_builder.clj
+++ support/src/figwheel/auto_builder.clj
@@ -15,6 +15,10 @@
                (fn [f] (.lastModified f)))
                (map :source-file files)))))

+
+
+
+(comment

   (def options {
                 :output-to "resources/public/js/compiled/example.js"
@@ -40,9 +44,6 @@
                  :version "0.1.7-SNAPSHOT",
                  :css-dirs ["resources/public/css"],
                  :http-server-root "public"})
-
-(comment
-

   (get-dependency-mtimes ["src"] options)


Fix spec of output to support unions

Fix spec of output to support unions

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -14,7 +14,8 @@
 (s/def ::idents ::attributes-set)
 (s/def ::input ::attributes-set)
 (s/def ::out-attribute (s/or :plain ::attribute :composed (s/map-of ::attribute ::output)))
-(s/def ::output (s/coll-of ::out-attribute :kind vector? :min-count 1))
+(s/def ::output (s/or :attribute-list (s/coll-of ::out-attribute :kind vector? :min-count 1)
+                      :union (s/map-of ::attribute ::output)))
 (s/def ::params ::output)

 (s/def ::resolver-data (s/keys :req [::sym] :opt [::input ::output ::cache?]))


Slightly clarify code

Slightly clarify code

--- src/playmary/one.cljs
+++ src/playmary/one.cljs
@@ -152,13 +152,12 @@
                 (let [freqs-on (atom [])
                       instrument (assoc instrument :notes
                                         (doall
-                                         (map (fn [note]
-                                                (if (= touch-id (-> note :touch-id))
+                                         (map (fn [{freq :freq :as note}]
+                                                (if (= touch-id (note :touch-id))
                                                   (do
-                                                    (swap! freqs-on conj (-> note :freq))
+                                                    (swap! freqs-on conj freq)
                                                     ;; (println "release")
-                                                    (.release (:synth (get piano-keys
-                                                                           (-> note :freq))))
+                                                    (.release ((get piano-keys freq) :synth))
                                                     (assoc note :off time))
                                                   note))
                                               (-> instrument :notes))))]


Fixing axis alignment issues.

Fixing axis alignment issues.

--- src-cljs/frontend/components/build_timings.cljs
+++ src-cljs/frontend/components/build_timings.cljs
@@ -7,6 +7,7 @@
 (def padding-right 20)

 (def top-axis-height 20)
+(def top-axis-offset 5)
 (def left-axis-width 20)

 (def bar-height 20)
@@ -45,25 +46,27 @@
       (gstring/format "%d:%02dm" m s))))

 (defn create-y-axis [number-of-containers]
-  (let [axis-scale (-> (js/d3.scale.linear)
-                       (.domain #js [0 number-of-containers])
-                       (.range  #js [0 (timings-height number-of-containers)]))]
+  (let [range-start (+ bar-height (/ container-bar-height 2))
+        range-end   (+ (timings-height number-of-containers) (/ container-bar-height 2))
+        axis-scale  (-> (js/d3.scale.linear)
+                        (.domain #js [0 number-of-containers])
+                        (.range  #js [range-start range-end]))]
   (-> (js/d3.svg.axis)
       (.tickValues (clj->js (range 0 number-of-containers)))
       (.scale axis-scale)
       (.tickFormat #(js/Math.floor %))
-      (.innerTickSize 5)
       (.orient "left"))))

 (defn create-x-axis [build-duration]
-  (let [axis-scale (-> (js/d3.scale.linear)
-                       (.domain #js [0 build-duration])
-                       (.range  #js [0 (timings-width)]))]
+  (let [range-start  top-axis-offset
+        range-end    (- (timings-width) top-axis-offset)
+        axis-scale   (-> (js/d3.scale.linear)
+                         (.domain #js [0 build-duration])
+                         (.range  #js [range-start range-end]))]
   (-> (js/d3.svg.axis)
       (.tickValues (clj->js (range 0 (inc build-duration) (/ build-duration 4))))
       (.scale axis-scale)
       (.tickFormat time-axis-tick-formatter)
-      (.innerTickSize 5)
       (.orient "top"))))

 (defn build-duration [start-time stop-time]
@@ -117,10 +120,9 @@
     (draw-step-start-line! x-scale step)
     (draw-containers! x-scale step)))

-(defn draw-axis! [chart axis class-name [x-translation y-translation]]
+(defn draw-axis! [chart axis class-name]
   (-> chart
       (.append "g")
-      (.attr "transform" (gstring/format "translate(%d,%d)" x-translation y-translation))
       (.attr "class" class-name)
       (.call axis)))

@@ -129,8 +131,8 @@
         chart   (create-root-svg parallel)
         x-axis  (create-x-axis (build-duration start_time stop_time))
         y-axis  (create-y-axis parallel)]
-    (draw-axis! chart x-axis "x-axis" [0  0])
-    (draw-axis! chart y-axis "y-axis" [0 top-axis-height])
+    (draw-axis! chart x-axis "x-axis")
+    (draw-axis! chart y-axis "y-axis")
     (draw-steps! x-scale chart steps)))

 ;;;; Main component


Update class name of user page

Update class name of user page

--- src/braid/ui/views/pages/user.cljs
+++ src/braid/ui/views/pages/user.cljs
@@ -32,7 +32,7 @@
                                       reverse))]

     (fn []
-      [:div.page.channel
+      [:div.page.userpage
        [:div.title
         [user-pill-view (@user :id)]]
        [:div.content


Fix bug in render-map rendering

Fix bug in render-map rendering

--- src/yada/body.clj
+++ src/yada/body.clj
@@ -121,7 +121,7 @@
 (defmethod render-map "text/html"
   [m representation]
   (-> (html5
-       [:head [:style (slurp (io/resource) "json.human.css")]]
+       [:head [:style (slurp (io/resource "json.human.css"))]]
          (jh/edn->html m))
       (str \newline) ; annoying on the command-line otherwise
       (to-body representation) ; for string encoding


Yada API

Yada API

--- src/yada/core.clj
+++ src/yada/core.clj
@@ -135,6 +135,7 @@
                 (when (:delete rmap) :delete)))))))

 (defn make-endpoint
+  "Create a yada endpoint (Ring handler)"
   [resource
    {:keys
     [service-available?                 ; async-supported
@@ -704,9 +705,30 @@
                              [:pre (with-out-str (apply str (interpose "\n" (seq (.getStackTrace %)))))]])}))))))))

 (defn yada
-  ([resource]
-   (yada resource {}))
-  ([resource opts]
-   (if (keyword? resource)
-     (throw (ex-info "Deprecated usage" {}))
-     (make-endpoint resource opts))))
+  "The Yada API. The first form takes the resource."
+  ([arg & otherargs]
+   (apply make-endpoint
+          (cond
+            ;; If the only argument is a map, it's the options
+            (and (map? arg) (nil? otherargs))
+            [nil arg]
+
+            ;; If the only argument is not a keyword, it's the resource
+            (and (not (keyword? arg)) (nil? otherargs))
+            [arg {}]
+
+            ;; If the first argument is a map, the whole arg list are the options
+            (and (keyword? arg) (odd? otherargs))
+            [nil (into {} (cons arg otherargs))]
+
+            ;; If there are just two args, the second is the options, if it's a map
+            (and (= 1 (count otherargs)) (map? (first otherargs)))
+            [arg (first otherargs)]
+
+            (and (pos? (count otherargs))
+                 (even? (count otherargs))
+                 (not (keyword? arg)))
+            [arg (into {} (map vec (partition 2 otherargs)))]
+
+            :otherwise
+            (throw (ex-info "The yada function does not support this form" {:args (cons arg otherargs)}))))))


Added some tests for the multi-valued metadata.

--- test/lambda_blog/md_parser_test.clj
+++ test/lambda_blog/md_parser_test.clj
@@ -39,3 +39,16 @@
   (is (= (parse just-metadata2)
          {:metadata {}
           :contents "
Meta: Test
"})))
+
+(def metadata-multi "Meta: test1
+      test2
+      test3
+Data: foo bar baz
+
+# Header")
+
+(deftest can-add-multi-values-metadata
+  (is (= (parse metadata-multi)
+         {:metadata {:meta ["test1" "test2" "test3"]
+                     :data "foo bar baz"}
+          :contents "
Header
"})))


minor refactoring of macros

minor refactoring of macros

--- src/clj/com/rpl/specter/macros.clj
+++ src/clj/com/rpl/specter/macros.clj
@@ -9,13 +9,13 @@
 (defn ^:no-doc gensyms [amt]
   (vec (repeatedly amt gensym)))

-(defn ^:no-doc determine-params-impls [[name1 & impl1] [name2 & impl2]]
-  (if-not (= #{name1 name2} #{'select* 'transform*})
-    (i/throw-illegal "defnav must implement select* and transform*, instead got "
-                     name1 " and " name2))
-  (if (= name1 'select*)
-    [impl1 impl2]
-    [impl2 impl1]))
+(defn ^:no-doc determine-params-impls [impls]
+  (let [grouped (->> impls (map (fn [[n & body]] [n body])) (into {}))]
+    (if-not (= #{'select* 'transform*} (-> grouped keys set))
+      (i/throw-illegal "defnav must implement select* and transform*, instead got "
+                       (keys grouped)))
+    grouped
+    ))

 (defmacro richnav
   "Defines a navigator with full access to collected vals, the parameters array,
@@ -24,8 +24,9 @@
   `next-fn` will automatically skip ahead in params array by `num-params`, so the
   index passed to it is ignored.
   This is the lowest level way of making navigators."
-  [num-params impl1 impl2]
-  (let [[[s-params & s-body] [t-params & t-body]] (determine-params-impls impl1 impl2)
+  [num-params & impls]
+  (let [{[s-params & s-body] 'select*
+         [t-params & t-body] 'transform*} (determine-params-impls impls)
         s-next-fn-sym (last s-params)
         s-pidx-sym (nth s-params 2)
         t-next-fn-sym (last t-params)
@@ -63,9 +64,9 @@
        )))

 (defmacro ^:no-doc rich-nav-with-bindings [num-params-code bindings & impls]
-  (let [[[[_ s-structure-sym s-next-fn-sym] & s-body]
-         [[_ t-structure-sym t-next-fn-sym] & t-body]]
-        (apply determine-params-impls impls)
+  (let [{[[_ s-structure-sym s-next-fn-sym] & s-body] 'select*
+         [[_ t-structure-sym t-next-fn-sym] & t-body] 'transform*}
+        (determine-params-impls impls)
         params-sym (gensym "params")
         params-idx-sym (gensym "params-idx")
         ]


parallel proc return msg

parallel proc return msg

--- src/clj/morpheus/traversal/bfs.clj
+++ src/clj/morpheus/traversal/bfs.clj
@@ -56,13 +56,17 @@
   (let [[superstep-id vertices-stack] data
         deepth (get-in @tasks-vertices [task-id :current-level])]
     (a/go
-      (doseq [[vertex-res edges-res] vertices-stack]
+      (cp/pdoseq
+        compute/compution-threadpool
+        [[vertex-res edges-res] vertices-stack]
         (let [vertex-id (:*id* vertex-res)]
           (swap! tasks-vertices update-in [task-id vertex-id]
                  #(merge % vertex-res
                          {:*visited* true
                           :*edges* edges-res}))
-          (doseq [edge edges-res]
+          (cp/pdoseq
+            compute/compution-threadpool
+            [edge edges-res]
             (let [opp-id (:*opp* edge)]
               (swap! tasks-vertices update-in [task-id opp-id]
                      #(if % (if-not (:*visited* %)


Change channel format name

Change channel format name

--- src/cljs/sloth/views/channels.cljs
+++ src/cljs/sloth/views/channels.cljs
@@ -20,7 +20,6 @@
     om/IRender
     (render [_]
       (let [name (:local channel)
-            hashname (str "#" name)
             current (is-current-chan? state name)
             unread (get channel :unread 0)
             attrs {:on-click #(navigate (room-route {:name name}))
@@ -31,8 +30,8 @@
                                 :else "")}]
         (s/html
          (if (> unread 0)
-           [:li attrs hashname [:i unread] [:i.close-channel "x"]]
-           [:li attrs hashname [:i.close-channel "x"]]))))))
+           [:li attrs [:span "#"] name [:i unread] [:i.close-channel "x"]]
+           [:li attrs [:span "#"] name [:i.close-channel "x"]]))))))

 (defn channels
   [state owner]


Fix toggling of REPL buttons

Fix toggling of REPL buttons

--- src/clojure/nightcode/builders.clj
+++ src/clojure/nightcode/builders.clj
@@ -37,11 +37,13 @@
         thread (atom nil)
         in (utils/get-console-input console)
         out (utils/get-console-output console)
+        build-group (s/border-panel
+                      :center (s/config! console :id :build-console))
         run-action (fn [e]
-                     (toggle-repl-buttons @utils/ui-root false)
+                     (toggle-repl-buttons build-group false)
                      (lein/run-project process thread in out path))
         run-repl-action (fn [e]
-                          (toggle-repl-buttons @utils/ui-root true)
+                          (toggle-repl-buttons build-group true)
                           (lein/run-repl-project process thread in out path)
                           (s/request-focus! (.getView (.getViewport console))))
         eval-repl-action (fn [e]
@@ -50,16 +52,16 @@
                              (.insertCode console (str "(do " code ")")))
                            (s/request-focus! (.getView (.getViewport console))))
         build-action (fn [e]
-                       (toggle-repl-buttons @utils/ui-root false)
+                       (toggle-repl-buttons build-group false)
                        (lein/build-project process thread in out path))
         test-action (fn [e]
-                      (toggle-repl-buttons @utils/ui-root false)
+                      (toggle-repl-buttons build-group false)
                       (lein/test-project process thread in out path))
         clean-action (fn [e]
-                       (toggle-repl-buttons @utils/ui-root false)
+                       (toggle-repl-buttons build-group false)
                        (lein/clean-project process thread in out path))
         stop-action (fn [e]
-                      (toggle-repl-buttons @utils/ui-root false)
+                      (toggle-repl-buttons build-group false)
                       (lein/stop-process process)
                       (lein/stop-thread thread))
         btn-group (utils/wrap-panel
@@ -94,10 +96,8 @@
                             (s/button :id :sdk-button
                                       :text (utils/get-string :android_sdk)
                                       :listen [:action set-android-sdk]
-                                      :focusable? false)])
-        build-group (s/border-panel
-                      :north btn-group
-                      :center (s/config! console :id :build-console))]
+                                      :focusable? false)])]
+    (s/config! build-group :north btn-group)
     (toggle-repl-buttons build-group false)
     (shortcuts/create-mappings build-group
                                {:run-button run-action


we don't need a couple of our work arounds for the activity test anymore.

--- test/metabase/api/activity_test.clj
+++ test/metabase/api/activity_test.clj
@@ -97,9 +97,7 @@
       :custom_id    nil
       :details      $})]
   (->> ((user->client :crowberto) :get 200 "activity")
-       (map #(dissoc % :timestamp))
-       ;; a little hacky, but we limit the possible results to just the test activity we manually generated
-       (filter #(contains? #{(:id activity1) (:id activity2) (:id activity3)} (:id %)))))
+       (map #(dissoc % :timestamp))))

 ;; GET /recent_views
@@ -158,7 +156,8 @@
                         :model    model
                         :model_id model-id
                         :timestamp (u/new-sql-timestamp))
-                      (Thread/sleep 25))]
+                      ;; we sleep a few milliseconds to ensure no events have the same timestamp
+                      (Thread/sleep 5))]
     (do
       (create-view (user->id :crowberto) "card" (:id card2))
       (create-view (user->id :crowberto) "dashboard" (:id dash1))


boot -u to 2.7.1; boot-logservice to 1.2.0

--- build.boot
+++ build.boot
@@ -25,9 +25,9 @@
                   [proto-repl-charts        "0.3.2"         :scope "provided"]

                   ;; boot clj
-                  [boot/core              "2.6.0"           :scope "provided"]
+                  [boot/core              "2.7.1"           :scope "provided"]
                   [adzerk/bootlaces       "0.1.13"          :scope "test"]
-                  [adzerk/boot-logservice "1.0.1"           :scope "test"]
+                  [adzerk/boot-logservice "1.2.0"           :scope "test"]
                   [adzerk/boot-test       "1.1.1"           :scope "test"]
                   [tolitius/boot-check    "0.1.2"           :scope "test"]


cleanup

cleanup

--- build.boot
+++ build.boot
@@ -3,25 +3,19 @@
 #tailrecursion.boot.core/version "2.0.0"

 (set-env!
-  :project       'bootstrap-test
-  :version       "1.0.0-SNAPSHOT"
-  :description   "Hoplon UI kit for Twitter Bootstrap."
-  :url           "https://github.com/tailrecursion/bootstrap-test"
-  :license       {:name "Eclipse Public License",
-                  :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies  [['tailrecursion/boot.core "2.0.0"]
-                  ['tailrecursion/boot.task "2.0.0"]
-                  ['tailrecursion/hoplon "5.0.0"]
+  :dependencies  [['tailrecursion/boot.core   "2.0.0"]
+                  ['tailrecursion/boot.task   "2.0.0"]
+                  ['tailrecursion/hoplon      "5.0.0"]
                   ['org.clojure/clojurescript "0.0-2156"]
-                  ['markdown-clj "0.9.38"]]
+                  ['markdown-clj              "0.9.38"]]
   :src-paths     #{"src"}
   :out-path      "resources/public")

 (add-sync! (get-env :out-path) #{"resources/assets"})

 (require
-  ['tailrecursion.hoplon.boot :refer :all]
-  ['tailrecursion.boot.task :refer :all])
+  ['tailrecursion.boot.task   :refer :all]
+  ['tailrecursion.hoplon.boot :refer :all])

 (deftask dev
   "Build hoplon.io for local development."


Refactor

Refactor

--- build.boot
+++ build.boot
@@ -1,14 +1,13 @@
 (set-env! :resource-paths #{"src" "dev"}
-          :dependencies '[[zprint "0.2.9"] [org.clojure/tools.nrepl "0.2.12"]
-                          [org.clojure/tools.namespace "0.2.11"]])
+          :dependencies '[[zprint "0.2.9"]]
+          :repositories
+          [["clojars"
+            (cond-> {:url "https://clojars.org/repo/"}
+              (System/getenv "CLOJARS_USER")
+              (merge {:username (System/getenv "CLOJARS_USER"),
+                      :password (System/getenv "CLOJARS_PASS")}))]])

 (require '[boot-fmt.core :refer [fmt]] '[boot-fmt.impl :as impl])
-
-(defn get-version []
-  (read-string (slurp "release.edn")))
-
-(defn format-version [{:keys [version]}]
-  (clojure.string/join "." version))

 (task-options! pom
                {:project 'boot-fmt/boot-fmt,
@@ -16,22 +15,20 @@
                 :url "https://github.com/pesterhazy/boot-fmt",
                 :scm {:url "https://github.com/pesterhazy/boot-fmt"},
                 :license {"Eclipse Public License"
-                          "http://www.eclipse.org/legal/epl-v10.html"}})
+                          "http://www.eclipse.org/legal/epl-v10.html"}}

-
-(set-env! :repositories
-          [["clojars"
-            (cond-> {:url "https://clojars.org/repo/"}
-              (System/getenv "CLOJARS_USER")
-              (merge {:username (System/getenv "CLOJARS_USER"),
-                      :password (System/getenv "CLOJARS_PASS")}))]])
-
-(task-options! fmt
+               fmt
                {:mode :diff
                 :options {:fn-map {":require" :force-nl-body, "ns" :arg1-body},
                           :style :community,
                           :fn-force-nl #{:force-nl :noarg1 :noarg1-body
                                          :force-nl-body :binding}}})
+
+(defn get-version []
+  (read-string (slurp "release.edn")))
+
+(defn format-version [{:keys [version]}]
+  (clojure.string/join "." version))

 ;!zprint {:format :skip}
 (deftask dogfood


Nicer looking db test.

Nicer looking db test.

--- test/clj/clj_templates/db/db_test.clj
+++ test/clj/clj_templates/db/db_test.clj
@@ -28,7 +28,8 @@
 (use-fixtures :each system-fixture)

 (deftest test-template-table
-  (let [template {:template-name "Foo" :description "Bar" :build-system "lein"}]
+  (let [template {:template-name "Foo" :description "Bar" :build-system "lein"}
+        changed-template (assoc template :description "Baz")]

     (testing "Upserting a record affects a row"
       (is (= (db/upsert-template @test-db template)
@@ -38,12 +39,10 @@
       (is (= (db/all-templates @test-db)
              [template])))

-    (let [changed-template (assoc template :description "Baz")]
+    (testing "Upserting again does not result in an error"
+      (is (= (db/upsert-template @test-db changed-template)
+             1)))

-      (testing "Upserting again does not result in an error"
-        (is (= (db/upsert-template @test-db changed-template)
-               1)))
-
-      (testing "Getting all templates again returns the updated template"
-        (is (= (db/all-templates @test-db)
-               [changed-template]))))))
+    (testing "Getting all templates again returns the updated template"
+      (is (= (db/all-templates @test-db)
+             [changed-template])))))


add another reducer benchmark

add another reducer benchmark

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -315,6 +315,12 @@
 (println ";; transducers")
 (simple-benchmark [xs (into [] (range 1000000))] (transduce (comp (map inc) (map inc) (map inc)) + 0 xs) 1)

+(println ";; reduce range 1000000 many ops")
+(simple-benchmark [xs (range 1000000)] (reduce + 0 (map inc (map inc (map inc xs)))) 1)
+
+(println ";; transduce range 1000000 many ops ")
+(simple-benchmark [xs (range 1000000)] (transduce (comp (map inc) (map inc) (map inc)) + 0 xs) 1)
+
 (println "\n")

 (println ";; multimethods")


Add new implementation for create and delete project events.

For backend integration.

--- src/uxbox/data/projects.cljs
+++ src/uxbox/data/projects.cljs
@@ -37,9 +37,17 @@
    :layout [sc/required sc/string]
    :width [sc/required sc/integer]
    :height [sc/required sc/integer]
+   :data [sc/required]
    :project [sc/required sc/uuid]})

 (def ^:static +update-page-schema+
+  {:name [sc/required sc/string]
+   :width [sc/required sc/integer]
+   :height [sc/required sc/integer]
+   :data [sc/required]
+   :layout [sc/required sc/string]})
+
+(def ^:static +update-page-metadata-schema+
   {:name [sc/required sc/string]
    :width [sc/required sc/integer]
    :height [sc/required sc/integer]
@@ -126,7 +134,7 @@

 (defn update-page
   [{:keys [id name width height layout] :as data}]
-  (sc/validate! +create-page-schema+ data)
+  (sc/validate! +update-page-schema+ data)
   (reify
     rs/UpdateEvent
     (-apply-update [_ state]
@@ -157,28 +165,35 @@
 (defn create-project
   [{:keys [name width height layout] :as data}]
   (sc/validate! +project-schema+ data)
-  (let [uuid (random-uuid)]
-    (reify
-      rs/UpdateEvent
-      (-apply-update [_ state]
-        (let [proj {:id uuid
-                    :name name
-                    :created (dt/now)}]
-          (stpr/assoc-project state proj)))
-
-      rs/EffectEvent
-      (-apply-effect [_ state]
-        (rs/emit! (create-page {:name "Page 1"
-                                :layout layout
-                                :width width
-                                :height height
-                                :project uuid}))))))
+  (letfn [(on-success [project]
+            (rx/of (rs/swap #(stpr/assoc-project % project))
+                   (create-page (assoc data
+                                       :project (:id project)
+                                       :name "Page 1"
+                                       :data []))))
+          (on-failure [err]
+            (println "on-failure" err)
+            (uum/error (tr "errors.create-project")))]
+    (reify
+      rs/WatchEvent
+      (-apply-watch [_ state]
+        (->> (rp/do :create/project {:name name})
+             (rx/from-promise)
+             (rx/mapcat on-success)
+             (rx/catch on-failure))))))
+
 (defn delete-project
   [proj]
-  (reify
-    rs/UpdateEvent
-    (-apply-update [_ state]
-      (stpr/dissoc-project state proj))))
+  (letfn [(on-success [_]
+            (rs/swap #(stpr/dissoc-project % proj)))
+          (on-failure [e]
+            (uum/error (tr "errors.delete-project")))]
+    (reify
+      rs/WatchEvent
+      (-apply-watch [_ state]
+        (->> (rp/do :delete/project proj)
+             (p/map on-success)
+             (p/err on-failure))))))

 (defn go-to
   "A shortcut event that redirects the user to the


fix aget order

fix aget order

--- frontend/env.cljs
+++ frontend/env.cljs
@@ -3,7 +3,7 @@
 (def ^:dynamic env-var nil)

 (defn env []
-  (or env-var (let [render-context (aget "renderContext" js/window)]
+  (or env-var (let [render-context (aget js/window "renderContext")]
                 (if render-context
                   (-> render-context (aget "env") keyword)
                   :development))))


implementing foob

implementing foob

--- test/synthesis_crawlers/core_test.clj
+++ test/synthesis_crawlers/core_test.clj
@@ -138,6 +138,13 @@
       (is (= (result "http://piyo.com") {:title []}))
       )))

+(deftest find-container-nodes-test
+  (testing "finds nodes which can be candidates of conainters"
+    (is (= (find-container-nodes
+             {"http://foo.com" "<html></html>"}
+             {"http://foo.com" {:title [(first (.getAllElements (Jsoup/parse "")))]}})
+           nil))))
+
 #_(deftest a-test
     (testing ""
       (is (= nil


Added placeholder text to last wish input boxes

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -45,8 +45,8 @@
 (defpartial wish-li-last []
   [:li.wish.last
    [:div.delete]
-   [:input {:type "text" :class "description"}]
-   [:input {:type "text" :class "url"}]])
+   [:input {:type "text" :class "description" :placeholder "Description"}]
+   [:input {:type "text" :class "url" :placeholder "URL"}]])

 (defpartial wish-ul [wishes]
   [:ul.wishes
@@ -119,6 +119,7 @@
    to list."
   (.attr $elem "id" (:id wish))
   (.removeClass $elem "last")
+  (.attr (find $elem ".url") "placeholder" "")
   (append ($ wish-ul) (wish-li-last)))

 (defn value-changed?! [$this]


importing find and val in cljs

importing find and val in cljs

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -1,7 +1,7 @@
 (ns wishlistd.client.main
   (:require [crate.core :as crate]
             [fetch.remotes :as remotes])
-  (:use [jayq.core :only [$ append empty delegate data]])
+  (:use [jayq.core :only [$ append empty find val delegate data]])
   (:use-macros [crate.macros :only [defpartial]]
                [fetch.macros :only [letrem]]))


fixed test

fixed test

--- test/tic_tac_toe/tic_tac_toe_test.clj
+++ test/tic_tac_toe/tic_tac_toe_test.clj
@@ -114,7 +114,7 @@
     (is (false? (array-cell-empty? horizontal-win 0 0)))

     (is (false? (array-full? (player-input-random-array))))
-    (is (= 2 (player-input-random-array array-after-input) (count (remove nil? (flatten array-after-input)))))
+    (is (= 2 (count (remove nil? (flatten (player-input-random-array array-after-input))))))

   )
 )


fix gitlib references on different disk breaking everything

fixes #966

--- src/main/shadow/build/classpath.clj
+++ src/main/shadow/build/classpath.clj
@@ -715,11 +715,38 @@
       (.getCanonicalFile)
       (.toPath)))

+;; can fail to relativize when on different disks, see https://github.com/thheller/shadow-cljs/issues/966
+;; the only purpose for this path currently is the build report in a relative manner so it doesn't show
+;; machine specific details
+;; eg. ../shadow-experiments/src/main
+;; instead of C:/Users/thheller/code/shadow-experiments/src/main
+;; if that fails we show the entire path regardless with a special case for gitlibs
 (defn project-rel-path [^File dir]
-  (-> (.relativize project-root-path
-        (-> dir (.getAbsoluteFile) (.toPath)))
-      (str)
-      (rc/normalize-name)))
+  (if-not (is-gitlib-file? dir)
+    (try
+      (-> (.relativize project-root-path
+            (-> dir (.getAbsoluteFile) (.toPath)))
+          (str)
+          (rc/normalize-name))
+      (catch Exception e
+        (.getAbsolutePath dir)))
+
+    ;; gitlib files
+    (let [^File gitlib-root
+          (loop [curr dir]
+            (if (= ".gitlibs" (.getName curr))
+              (io/file curr "libs")
+              (recur (.getParentFile curr))))
+
+          dir-abs
+          (.getAbsolutePath dir)
+
+          root-abs
+          (.getAbsolutePath gitlib-root)]
+
+      ;; C:\Users\thheller\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src
+      ;; gitlibs://re-frame/re-frame/8cf68c30722a4c6f8f948a134c900d7a656ecad4/src
+      (str "gitlibs:/" (rc/normalize-name (subs dir-abs (count root-abs)))))))

 (defn make-fs-resource
   ([^File file name]


Filter out null chars

Filter out null chars

--- src/clj/cglossa/data_import/metadata_values.clj
+++ src/clj/cglossa/data_import/metadata_values.clj
@@ -65,8 +65,7 @@
   (with-open [orig-tsv-file (io/reader orig-tsv-path)
               tsv-file      (io/writer tsv-path)]
     (let [[headers & rows] (utils/read-csv orig-tsv-file)
-          [tid-header & other-headers] headers
-          non-blank? (complement str/blank?)]
+          [tid-header & other-headers] headers]
       (assert (= "tid" tid-header)
               (str "Format error: Expected first line to contain column headers "
                    "with 'tid' (text ID) as the first header."))
@@ -82,7 +81,9 @@
                                      (mapcat (fn [[header col-vals]]
                                                (map (fn [val] [(str corpus "_" header) val]) col-vals)))
                                      set
-                                     (filter #(non-blank? (second %)))
+                                     (filter (fn [[_ val]]
+                                               (not (or (str/blank? val)
+                                                        (= "\\N" val)))))
                                      (cons ["corpus_cat" "value"]))))))

 (defn- create-tid-config! [corpus config-path orig-tsv-path]


resolved merge conflicts

resolved merge conflicts

--- src/cljs/wombats_web_client/constants/urls.cljs
+++ src/cljs/wombats_web_client/constants/urls.cljs
@@ -1,19 +1,14 @@
 (ns wombats-web-client.constants.urls)

-<<<<<<< HEAD
-(def base-api-url "//54.145.152.66")
-=======
+(def base-ws-url "//54.145.152.66")
 (def base-api-url "http://dev.wombats.io")
->>>>>>> 9a2dc21... Update base url, add modal flow, add button component

 (def self-url (str base-api-url "/api/v1/self"))
 (def github-signout-url (str base-api-url "/api/v1/auth/github/signout"))
 (def github-signin-url (str base-api-url "/api/v1/auth/github/signin"))

-<<<<<<< HEAD
-(def game-url (str "ws:" base-api-url "/ws/game"))
-=======
+(def game-url (str "ws:" base-ws-url "/ws/game"))
+
 (defn my-wombats-url
   [id]
   (str base-api-url "/api/v1/users/" id "/wombats"))
->>>>>>> 25ca65d... submitting a new wombat, success & error cbs


remove whitespace from team names

remove whitespace from team names

--- src/pc/http/routes/api.clj
+++ src/pc/http/routes/api.clj
@@ -63,7 +63,7 @@

 (defpage create-team [:post "/api/v1/create-team"] [req]
   (let [params (some-> req :body slurp edn/read-string)
-        subdomain (some-> params :subdomain str/lower-case)
+        subdomain (some-> params :subdomain str/lower-case str/trim)
         coupon-code (some-> params :coupon-code)
         cust (get-in req [:auth :cust])]
     (cond (empty? cust)


Make the run function sleep less and use torus geometry

--- src/petulant_life/life.clj
+++ src/petulant_life/life.clj
@@ -76,6 +76,6 @@
            (populate (empty-board 6 6))
            pprint)
       (println)
-      (Thread/sleep 1000)
+      (Thread/sleep 750)
       (recur (dec steps)
-             (rect-step board)))))
+             (torus-step board)))))


extract audio transcript correctly

extract audio transcript correctly

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -212,14 +212,16 @@
     (create-entry! conn entry)))

 (defn update-video-data [conn video entry]
-  (when (not (:video-processed entry))
-    (let [video-processed (> (:state video) 4)
-          video-transcript (:audio_transcription (:default_stream video))]
-      (update-entry-no-user! conn
-                             (:uuid entry)
-                             (-> entry
-                                 (assoc :video-processed video-processed)
-                                 (assoc :video-transcript video-transcript))))))
+  (let [video-processed (> (:state video) 4)
+        video-transcript-data (get-in video [:original_stream :audio_transcription :text])
+        video-transcript (if video-transcript-data
+                           video-transcript-data
+                           (:video-transcript entry))]
+    (update-entry-no-user! conn
+                           (:uuid entry)
+                           (-> entry
+                               (assoc :video-processed video-processed)
+                               (assoc :video-transcript video-transcript)))))

 (schema/defn ^:always-validate publish-entry! :- (schema/maybe common/Entry)
   "


DocResource.clj: removed extraneous execute-search definition

--- src/org/altlaw/www/DocResource.clj
+++ src/org/altlaw/www/DocResource.clj
@@ -22,8 +22,6 @@
   (doto (SolrQuery. (str "docid:" docid))
     (.setQueryType "standard")
     (.setFields *display-fields*)))
-
-(defn execute-search [query])

 (defn get-document
   "Searches Solr for the document with the given docid.


Expose require errors

Expose require errors

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -133,21 +133,29 @@
         (recur (next extensions)))
       (cb nil))))

+(declare print-error)
+
 (defn require [macros-ns? sym reload]
   (cljs/require
-    {:*compiler*     st
-     :*load-fn*      load
-    sym
-    reload
-    {:macros-ns  macros-ns?
-     :verbose    (:verbose @app-env)
-     :source-map true}
-    (fn [res]
-      #_(println "require result:" res))))
+   {:*compiler*     st
+    :*load-fn*      load}
+   sym
+   reload
+   {:macros-ns  macros-ns?
+    :verbose    (:verbose @app-env)
+    :source-map true}
+   (fn [{:keys [error value] :as res}]
+     (cond error (print-error error)
+           (not value) (print-error (js/Error. (str "Unable to load " (second sym))))))))
+
+(defn valid-require? [[ns-form require]]
+  (and (list? ns-form) (= (first ns-form) 'quote)))

 (defn require-destructure [macros-ns? args]
-  (let [[[_ sym] reload] args]
-    (require macros-ns? sym reload)))
+  (if (valid-require? args)
+    (let [[[_ sym] reload] args]
+      (require macros-ns? sym reload))
+    (print-error (js/Error. (str "Invalid require form: " (pr-str (cons 'require args)))))))

 (defn ^:export run-main [main-ns args]
   (let [main-args (js->clj args)]


Use *ns* instead of @current-ns

Use *ns* instead of @current-ns

Partially addresses #288 (when not loading cached code)

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -1416,7 +1416,7 @@

 (defn- eval
   ([form]
-   (eval form @current-ns))
+   (eval form (.-name *ns*)))
   ([form ns]
    (let [result (atom nil)]
      (cljs/eval st form
@@ -1435,7 +1435,7 @@

 (defn- resolve
   [sym]
-  (ns-resolve @current-ns sym))
+  (ns-resolve (.-name *ns*) sym))

 (defn- ^:export wrap-color-err
   []


Only show error indicator when in REPL

Only show error indicator when in REPL

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -1446,7 +1446,8 @@
     (binding [*print-fn* *print-err-fn*]
       (when-not (empty? warning-string)
         (when-let [column (:column env)]
-          (println (wrap-warning-font (form-indicator column @current-ns))))
+          (when (:repl @app-env)
+            (println (wrap-warning-font (form-indicator column @current-ns)))))
         (print (wrap-warning-font warning-string))))))

 (defn- call-form?


Change var name again

Change var name again

--- src/obb_api/gateways/mongodb/battle_gateway.clj
+++ src/obb_api/gateways/mongodb/battle_gateway.clj
@@ -9,7 +9,7 @@
   (:import [org.bson.types ObjectId]
            [com.mongodb DB WriteConcern]))

-(def mongodb-uri (or (env :mongo-uri) "mongodb://127.0.0.1/obb?maxPoolSize=128&waitQueueMultiple=5;waitQueueTimeoutMS=150;socketTimeoutMS=5500&autoConnectRetry=true;safe=false&w=1;wtimeout=2500;fsync=true"))
+(def mongodb-uri (or (env :obb-mongo-uri) "mongodb://127.0.0.1/obb?maxPoolSize=128&waitQueueMultiple=5;waitQueueTimeoutMS=150;socketTimeoutMS=5500&autoConnectRetry=true;safe=false&w=1;wtimeout=2500;fsync=true"))
 (def collection-name "battles")
 (def master-conn (mg/connect-via-uri mongodb-uri))


More programmes tidy up.

More programmes tidy up.

--- src/kixi/hecuba/api/programmes.clj
+++ src/kixi/hecuba/api/programmes.clj
@@ -62,7 +62,7 @@

 (defresource index [store]
   :allowed-methods #{:get :post}
-  :available-media-types ["text/html" "application/json" "application/edn"]
+  :available-media-types ["application/json" "application/edn"]
   :known-content-type? #{"application/edn"}
   :authorized? (authorized? store :programme)
   :allowed? (allowed? store :programme)
@@ -72,7 +72,7 @@

 (defresource resource [store]
   :allowed-methods #{:get}
-  :available-media-types ["text/html" "application/json" "application/edn"]
+  :available-media-types ["application/json" "application/edn"]
   :known-content-type? #{"application/edn"}
   :authorized? (authorized? store :programme)
   :allowed? (allowed? store :programme)


fixed distribution impel

fixed distribution impel

--- src/tango/domain.cljc
+++ src/tango/domain.cljc
@@ -40,16 +40,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Utils

-(defn distrubution-counts [c n]
-  (let [m (int (/ c n))
-        k (mod c n)
-        big-counts (repeat k (inc m))
-        small-counts (repeat (- n k) m)]
-    (vec (concat big-counts small-counts))
-    )
-  )
-
-(defn distrubution-counts [coll n]
+;; TODO - move utils to its own file
+(defn- distribute [coll n]
   ;; Distributes the elements in n vectors as evenly as possible
   ;; Each vector will have m or m+1 elements, where m is (/ (count coll n))
   ;; The order of the elements is preserved in each group.
@@ -58,12 +50,13 @@
         k (mod c n)
         big-counts (repeat k (inc m))
         small-counts (repeat (- n k) m)]
-    (vec (concat big-counts small-counts))
-    )
-  )
+    (vec (concat big-counts small-counts))))

-(int (/ 8 3))
-(mod 8 3)
-
-(distrubute [1 2 3 4 5 6 7 8] 3)
-(distrubute [1 2 3 4 5 6 7 8] 3)
+;; TODO - guess this could be more elegant..
+(defn create-distribution [coll n]
+  (let [distribution-sizes (distribute coll n)]
+    (reduce
+      (fn [x y]
+        (conj x (vec (take y (drop (count (flatten x)) coll)))))
+      []
+      distribution-sizes)))


Added sorting of classes, activities, adjs and panels

--- src/tango/cljs/client.cljs
+++ src/tango/cljs/client.cljs
@@ -11,7 +11,6 @@
             [tango.presentation :as presentation]))

 ;; TODO - All Adjudicators 'r valbart i ui m[ste fixa, kolla hur de behandlas i importen
-;; TODO sortera p[ position ;aven klasser

 ;; TODO - IntelliJ, emacs ctrl+u
 ;; TODO - IntelliJ, emacs send to repl
@@ -64,10 +63,8 @@
     (log "Handle Q R")
     (if (vector? d)
       (let [clean-data {:competitions d}]
-        (log "Compsss")
         (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions]))
       (let [clean-data (uidb/sanitize d)]
-        (log "Crazzzy")
         (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions])))
     (om/transact! reconciler `[(app/set-import-status {:status :none})])
     (om/transact! reconciler `[(app/status {:status :running})])))
@@ -253,8 +250,7 @@
   Object
   (render
     [this]
-    (let [adjudicators (:competition/adjudicators (om/props this))]
-      (log adjudicators)
+    (let [adjudicators (sort-by :adjudicator/name (:competition/adjudicators (om/props this)))]
       (dom/div nil
         (dom/h2 {:className "sub-header"} "Domare")
         (dom/table
@@ -289,7 +285,7 @@
   Object
   (render
     [this]
-    (let [panels (:competition/panels (om/props this))]
+    (let [panels (sort-by :adjudicator-panel/name (:competition/panels (om/props this)))]
       (log panels)
       (dom/div nil
         (dom/h2 {:className "sub-header"} "Domarpaneler")
@@ -390,7 +386,8 @@
   Object
   (render
     [this]
-    (let [classes (:competition/classes (om/props this))]
+    (let [classes (sort-by :class/position
+                           (:competition/classes (om/props this)))]
       (dom/div nil
         (dom/h2 {:className "sub-header"} "Klasser")
         (dom/table
@@ -445,7 +442,8 @@
   Object
   (render
     [this]
-    (let [activites (:competition/activities (om/props this))]
+    (let [activites (sort-by :activity/position
+                             (:competition/activities (om/props this)))]
       (dom/div nil
         (dom/h2 nil "Time Schedule")
         (dom/table


Cleanup temp images

Cleanup temp images

--- src/tax_extractor/core.clj
+++ src/tax_extractor/core.clj
@@ -83,12 +83,14 @@
         renderer (doto (SimpleRenderer.)
                    (.setResolution 300))
         [page-one page-two] (.render renderer doc 7 8)
-        file-one (File. "one.png")
-        file-two (File. "two.png")]
+        filename-one (str (java.util.UUID/randomUUID) ".png")
+        filename-two (str (java.util.UUID/randomUUID) ".png")
+        file-one (File. filename-one)
+        file-two (File. filename-two)]
     (ImageIO/write page-one "png" file-one)
     (ImageIO/write page-two "png" file-two)
-    (threshold "one.png")
-    (threshold "two.png")
+    (threshold filename-one)
+    (threshold filename-two)
     (loop [idx 0
            records []]
       (if-let [record (try
@@ -101,7 +103,10 @@
             (flush)
             (recur (inc idx)
                    (conj records record)))
-        records))))
+        (do
+          (.delete file-one)
+          (.delete file-two)
+          records)))))

 (defn process-pdf [pdf out-path]
   (print "Processing" (.getName pdf))


www/DocResource.clj: change to get data from Solr and content store

--- src/org/altlaw/www/DocResource.clj
+++ src/org/altlaw/www/DocResource.clj
@@ -1,9 +1,63 @@
 (ns org.altlaw.www.DocResource
   (:gen-class :extends org.restlet.resource.Resource)
   (:require [org.altlaw.db.content :as content]
+            [org.altlaw.db.privacy :as privacy]
+            [org.altlaw.www.case-pages :as pages]
+            [org.altlaw.www.render :as rend]
+            [org.altlaw.util.date :as date]
+            [org.altlaw.util.courts :as courts]
             [clojure.contrib.stacktrace :as stack])
   (:import (org.restlet.resource Variant StringRepresentation ResourceException)
-           (org.restlet.data MediaType Language CharacterSet Reference Status)))
+           (org.restlet.data MediaType Language CharacterSet Reference Status)
+           (org.apache.solr.client.solrj SolrQuery)))
+
+
+(declare *solr*)
+
+(def *display-fields*
+     (into-array ["doctype" "docid" "name" "citations"
+                  "date" "court" "html_content_sha1"]))
+
+(defn get-document-query [docid]
+  (doto (SolrQuery. (str "docid:" docid))
+    (.setQueryType "standard")
+    (.setFields *display-fields*)))
+
+(defn execute-search [query])
+
+(defn get-document
+  "Searches Solr for the document with the given docid.
+  Returns a SolrDocument.
+  Throws ResourceException 404 if not found, or 410 if removed."
+  [docid]
+  (if (privacy/removed? docid)
+    (throw (ResourceException. Status/CLIENT_ERROR_GONE))
+    (let [response (.query *solr* (get-document-query docid))
+          results (.getResults response)]
+      (if (zero? (.getNumFound results))
+        (throw (ResourceException. Status/CLIENT_ERROR_NOT_FOUND))
+        (first results)))))
+
+(defn prepare-html-document
+  "Given a SolrDocument, returns a document map suitable
+  for use by case-pages/gen-case-page"
+  [doc]
+  {:docid (.getFieldValue doc "docid")
+   :name (.getFieldValue doc "name")
+   :date (.getFieldValue doc "date")
+   :court (.getFieldValue doc "court")
+   :citations (.getFieldValues doc "citations")
+   :html (content/get-content-string (.getFieldValue doc "html_content_sha1"))})
+
+(defmulti represent (fn [docid media-type] media-type))
+
+(defmethod represent MediaType/TEXT_HTML [docid media-type]
+  (StringRepresentation.
+   (pages/gen-case-page
+    :text (prepare-html-document (get-document docid)))
+   MediaType/TEXT_HTML
+   Language/ENGLISH_US
+   CharacterSet/UTF_8))

 ;;; RESOURCE METHODS

@@ -14,12 +68,9 @@

 (defn -represent [this variant]
   (try
-   (let [path (.. this getRequest getOriginalRef (getPath true))
-         ;; Truncate the initial "/" from path:
-         content (content/get-page (str (.substring path 1) ".html"))]
-     (StringRepresentation.
-      content
-      MediaType/TEXT_HTML Language/ENGLISH_US CharacterSet/UTF_8))
+   (binding [*solr* (.. this getContext getAttributes (get "org.altlaw.solr.server"))]
+     (let [docid (.. this getRequest getAttributes (get "docid"))]
+       (represent docid (.getMediaType variant))))
    (catch Exception e
      (if (and (instance? org.jets3t.service.S3ServiceException
                          (stack/root-cause e)))


full health during intermission

full health during intermission

--- src/cljs/wombats_web_client/components/game_ranking.cljs
+++ src/cljs/wombats_web_client/components/game_ranking.cljs
@@ -9,7 +9,7 @@

 (defn get-adjusted-hp [info]
   (let [game-status (:status info)
-        is-starting? (or (= game-status :pending-open) (= game-status :pending-closed))]
+        is-starting? (or (= game-status :pending-open) (= game-status :pending-closed) (= game-status :active-intermission))]
     (if is-starting? 100 0)))

 (defn render-wombat-status [info stat]


require re-frame

require re-frame

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -4,7 +4,8 @@
               [secretary.core :as secretary :include-macros true]
               [goog.events :as events]
               [goog.history.EventType :as EventType]
-              [cljsjs.react :as react])
+              [cljsjs.react :as react]
+              [re-frame.core :as re-frame])
     (:import goog.History))

 ;; -------------------------