Colors used for old-way metadata and new way metadata have been made consistent (Fix 473)

--- src/paredit/parser.clj
+++ src/paredit/parser.clj
@@ -23,7 +23,10 @@
   (lr+/match #{")" "]" "}" eof} s eof?))

 (def gspaces #{:whitespace :comment :discard})
-(def only-code (partial remove (comp (conj gspaces :meta-prefix) :tag)))
+(def only-code (partial remove (comp (conj gspaces
+                                           :meta-prefix
+                                           :deprecated-meta-prefix)
+                                     :tag)))

 (defn code-children
   [e]
@@ -119,8 +122,9 @@
 (def open-char "\\")
 (def symbol-exclusion #"[^\(\[\#\{\\\"\~\%\:\,\s\!\;\'\@\`;0-9]")
 (def ^{:private true} prefixes
-  #{open-list open-vector open-map open-set open-quote open-meta open-deref open-syntax-quote
-    open-fn open-var open-deprecated-meta open-string open-regex open-unquote-splicing
+  #{open-list open-vector open-map open-set open-quote
+    open-meta open-deprecated-meta open-deref open-syntax-quote
+    open-fn open-var open-string open-regex open-unquote-splicing
     open-unquote open-anon-arg open-keyword open-discard whitespace open-comment
     open-char})

@@ -202,11 +206,10 @@
     (= :set t) (balanced :open :close-set abstract-children)
     (= :quote t) (unbalanced :open abstract-children)
     ;(= :meta t) (unbalanced :open abstract-children)
-    (= :meta t) (let [meta-target (peek abstract-children)]
-                  (concat (token :meta (- count (node-count meta-target)))
-                          (meta-target tokens-view)
-                          ;(mapcat identity (view-children-seq tokens-view (pop abstract-children)))
-                          ))
+    (#{:meta :deprecated-meta} t)
+      (let [[meta & rest] abstract-children]
+        (concat (token :meta (node-count meta))
+                (mapcat identity (view-children-seq tokens-view rest))))
     (= :reader-literal t) (let [body (peek abstract-children)]
                             (concat (token :reader-literal (- count (node-count body)))
                                     (body tokens-view)
@@ -223,7 +226,6 @@
     (= :syntax-quote t) (unbalanced :open abstract-children)
     (= :var t) (unbalanced :open-var abstract-children)
     (= :fn t) (concat (token :nest 0) (balanced :open-fn :close-fn abstract-children) (token :unnest 0))
-    (= :deprecated-meta t) (unbalanced :open abstract-children)
     (= :unquote-splicing t) (unbalanced :open abstract-children)
     (= :unquote t) (unbalanced :open abstract-children)
     (= :string t) (token :string count)
@@ -346,11 +348,11 @@
              :set
              :quote
              :meta
+             :deprecated-meta
              :deref
              :syntax-quote
              :var
              :fn
-             :deprecated-meta
              :unquote-splicing
              :unquote
              :string
@@ -376,7 +378,6 @@
                ;(p/unspaced open-string #"(?:\\.|[^\\\"])++(?!\")" :? eof)
                ;(p/unspaced open-regex #"(?:\\.|[^\\\"])++(?!\")" :? eof)
                [open-quote eof]
-               [open-deprecated-meta :expr :? eof]
                [open-deref eof]
                [open-syntax-quote eof]
                [open-var eof]
@@ -389,14 +390,16 @@
     :map [open-map :expr* "}"]
     :set [open-set :expr* "}"]
     :quote [open-quote :expr]
-    :open-meta "^"
-    :meta-prefix [:open-meta :expr]
-    :meta [:meta-prefix :expr]
+    :open-meta "^"             :open-deprecated-meta "#^"
+    :meta-prefix [:open-meta
+                  :expr]       :deprecated-meta-prefix [:open-deprecated-meta
+                                                        :expr]
+    :meta [:meta-prefix :expr] :deprecated-meta [:deprecated-meta-prefix
+                                                 :expr]
     :deref [open-deref :expr]
     :syntax-quote [open-syntax-quote :expr]
     :var [open-var :expr]
     :fn [open-fn :expr* ")"]
-    :deprecated-meta [open-deprecated-meta :expr :expr]
     :unquote-splicing [open-unquote-splicing :expr]
     :unquote [open-unquote :expr]
     :string-body #"(?:\\.|[^\\\"])++(?=\")"
@@ -440,6 +443,11 @@
 (defn parse-tree
   [state]
   state)
+
+(defn pretty [parse]
+  (if (map? parse)
+    (into [] (cons (:tag parse) (map pretty (:content parse))))
+    parse))

 (comment
 (require '[net.cgrand.parsley.lrplus :as l])
@@ -484,3 +492,4 @@
               b)]
       b))
   (= c (lu/node-text (-> (edit-buffer nil 0 0 c) (buffer-parse-tree 0))) (lu/node-text (parse c)))))
+


Fix code to clear cue OSC bindings.

Fix code to clear cue OSC bindings.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -198,7 +198,7 @@
   "Clear out any OSC cue bindings which have been established."
   []
   (doseq [[x y f path] @osc-cue-bindings]
-    (ct/clear-cue-fn! x y f)
+    (ct/clear-cue-fn! (:cue-grid *show*) x y f)
     (osc/osc-handle @core/osc-server path
                     (fn [msg] :done)))
   (reset! osc-cue-bindings #{}))


Create dimmer cues.

Create dimmer cues.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -325,6 +325,7 @@
                  (cues/function-cue :strobe-all :strobe (show/all-fixtures) :effect-name "Strobe"))

+    ;; Some cues to show the Hypnotic RGB Laser
     (ct/set-cue! (:cue-grid *show*) 0 3
                  (cues/function-cue :hypnotic-beam :beam-red (show/fixtures-named "hyp-rgb")
                                     :color :red :effect-name "Hypnotic Red"))
@@ -355,6 +356,27 @@
     (ct/set-cue! (:cue-grid *show*) 7 4
                  (cues/function-cue :hypnotic-spin :beams-cw (show/fixtures-named "hyp-rgb")
                                     :color :cyan :effect-name "Hypnotic Rotate Clockwise" :level 50))
+
+    ;; Dimmer cues to turn on and set brightness of groups of lights
+    (ct/set-cue! (:cue-grid *show*) 0 4
+                 (cues/function-cue :dimmers :dimmer (show/all-fixtures) :level 100 :color :yellow
+                                    :effect-name "All Dimmers" :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers
+                                                                          :puck-dimmers :hex-dimmers]))
+    (ct/set-cue! (:cue-grid *show*) 1 4
+                 (cues/function-cue :torrent-dimmers :dimmer (show/fixtures-named "torrent") :level 100 :color :orange
+                                    :effect-name "Torrent Dimmers" :end-keys [:dimmers]))
+    (ct/set-cue! (:cue-grid *show*) 2 4
+                 (cues/function-cue :blade-dimmers :dimmer (show/fixtures-named "blade") :level 100 :color :orange
+                                    :effect-name "Blade Dimmers" :end-keys [:dimmers]))
+    (ct/set-cue! (:cue-grid *show*) 3 4
+                 (cues/function-cue :ws-dimmers :dimmer (show/fixtures-named "ws") :level 100 :color :orange
+                                    :effect-name "Weather System Dimmers" :end-keys [:dimmers]))
+    (ct/set-cue! (:cue-grid *show*) 4 4
+                 (cues/function-cue :puck-dimmers :dimmer (show/fixtures-named "puck") :level 100 :color :orange
+                                    :effect-name "Puck Dimmers" :end-keys [:dimmers]))
+    (ct/set-cue! (:cue-grid *show*) 5 4
+                 (cues/function-cue :hex-dimmers :dimmer (show/fixtures-named "hex") :level 100 :color :orange
+                                    :effect-name "Hex Dimmers" :end-keys [:dimmers]))

     ;; The upper page of torrent config cues
     (ct/set-cue! (:cue-grid *show*) 0 15


Recursively convert nested array types

Recursively convert nested array types

This solves the case where you, for example, want to return an array of
inet addresses.


CMR-2412: Fix broken build

CMR-2412: Fix broken build

--- access-control-app/project.clj
+++ access-control-app/project.clj
@@ -8,9 +8,9 @@
    :cmr-common-app-lib "0.1.0-SNAPSHOT"})

 (def dev-projects
- "A map of development time projects to their versions"
- {:cmr-metadata-db-app "0.1.0-SNAPSHOT"
-  :cmr-mock-echo-app "0.1.0-SNAPSHOT"})
+  "A map of development time projects to their versions"
+  {:cmr-metadata-db-app "0.1.0-SNAPSHOT"
+   :cmr-mock-echo-app "0.1.0-SNAPSHOT"})

 (defn project-map->dependencies
   "Creates a list of dependencies from a project map."
@@ -35,7 +35,9 @@
                            [compojure "1.4.0"]
                            [ring/ring-core "1.4.0" :exclusions [clj-time]]
                            [ring/ring-json "0.4.0"]]
-                         (project-map->dependencies projects))
+                           ;; Temporarily fix broken build. The dev-projects depenedencies should
+                           ;; not be overall depenedencies
+                         (project-map->dependencies (merge projects dev-projects)))
   :plugins [[lein-test-out "0.3.1"]
             [lein-shell "0.4.0"]
             [lein-exec "0.3.4"]]
@@ -67,6 +69,3 @@
             "env-config-docs" ["exec" "-ep" "(do (use 'cmr.common.config) (print-all-configs-docs))"]
             ;; Creates the checkouts directory to the local projects
             "create-checkouts" ~create-checkouts-commands})
-
-
-


Fix my recent breakage

Fix my recent breakage

--- src/re_frame/cofx.cljc
+++ src/re_frame/cofx.cljc
@@ -10,7 +10,10 @@

 (def kind :cofx)
 (assert (re-frame.registrar/kinds kind))
-(def register  (partial register-handler kind))
+
+(defn reg-cofx
+  [id handler]
+  (register-handler kind id handler))

 ;; -- Interceptor -------------------------------------------------------------
@@ -55,7 +58,7 @@
 ;; :db
 ;;
 ;; Adds to coeffects the value in `app-db`, under the key `:db`
-(register
+(reg-cofx
   :db
   (fn db-coeffects-handler
     [coeffects]


Even though they are temporary log messages, switch to use offical method.

--- src/re_frame/subs.cljs
+++ src/re_frame/subs.cljs
@@ -42,8 +42,8 @@
     (ratom/add-on-dispose! r #(do (swap! query->reaction dissoc cache-key)
                                   (console :warn "Removing subscription: " cache-key)))

-    (.log js/console "Dispatch site: ")
-    (.log js/console (:dispatch-site (meta query-v)))
+    (console :log "Dispatch site: ")
+    (console :log (:dispatch-site (meta query-v)))

     ;; cache this reaction, so it can be used to deduplicate other, identical subscriptions
     (swap! query->reaction assoc cache-key r)


Use let, not def. Fix docs

Use let, not def. Fix docs

--- src/riemann/keenio.clj
+++ src/riemann/keenio.clj
@@ -30,7 +30,6 @@
   (streams
     (let [kio (keenio \"COLLECTION_NAME\" \"PROJECT_ID\" \"WRITE_KEY\")]
       (where (state \"error\") kio)))"
-
   [collection project-id write-key]
   (fn [event]
     (post collection project-id write-key event)))


Remove earmuffs from vars that never get rebound (and never will).

--- src/cake/tasks/clojars.clj
+++ src/cake/tasks/clojars.clj
@@ -3,14 +3,14 @@
             [clojure.java.io :as io])
   (:use cake cake.core))

-(def *clojars-repo-url* "http://clojars.org/repo")
-(def *clojars-all-jars-url* (str *clojars-repo-url* "/all-jars.clj"))
-(def *clojars-all-poms-url* (str *clojars-repo-url* "/all-poms.txt"))
+(def clojars-repo-url "http://clojars.org/repo")
+(def clojars-all-jars-url (str clojars-repo-url "/all-jars.clj"))
+(def clojars-all-poms-url (str clojars-repo-url "/all-poms.txt"))

 (defn http-get-text-seq [url] (line-seq (io/reader url)))

 (defn get-latest-version [library-name]
-  (let [response (http-get-text-seq *clojars-all-jars-url*)
+  (let [response (http-get-text-seq clojars-all-jars-url)
 	lib-name (symbol library-name)]
     (second (last (filter #(= (first %) lib-name)
 			  (for [line response]
@@ -40,7 +40,7 @@
          (println s-to "wasn't found in your project.clj file.")))))

 (defn clojars-search [term]
-  (let [response (http-get-text-seq *clojars-all-jars-url*)]
+  (let [response (http-get-text-seq clojars-all-jars-url)]
     (println "\n\nLibraries on Clojars.org that contain the term: " term)
     (println "--------------------------------------------------------------------------------")
     (doseq [entry (for [line response :when (.contains line term)]
@@ -49,7 +49,7 @@
     (println "\n\n")))

 (defn clojars-versions [library-name]
-  (let [response (http-get-text-seq *clojars-all-jars-url*)]
+  (let [response (http-get-text-seq clojars-all-jars-url)]
     (println "\n\nAvailable versions for library: " library-name)
     (println "--------------------------------------------------------------------------------")
     (doseq [entry (filter #(= (first %) (symbol library-name))
@@ -67,7 +67,7 @@

 (defn get-pom-locations
   ([library-name version]
-     (let [response (http-get-text-seq *clojars-all-poms-url*)
+     (let [response (http-get-text-seq clojars-all-poms-url)
 	   pom-dir (get-pom-dir library-name version)]
        (for [line response :when (.startsWith line pom-dir)]
 	 line))))
@@ -78,7 +78,7 @@

 (defn to-clojars-url
   ([file-location]
-     (str *clojars-repo-url* "/" file-location)))
+     (str clojars-repo-url "/" file-location)))

 (defn get-latest-pom-file
   ([library-name version]


Missing parenthesis

Missing parenthesis

--- src/clj/cglossa/server.clj
+++ src/clj/cglossa/server.clj
@@ -58,7 +58,7 @@

 (defroutes search-routes
   (POST "/search" [corpus-id queries]
-    (transit-response (search/search corpus-id queries)))
+    (transit-response (search/search corpus-id queries))))

 (def http-handler
   (let [r (routes #'db-routes #'search-routes #'app-routes)


Fixing linux font rendering.

Fixing linux font rendering.

--- src/clj/nightcode/core.clj
+++ src/clj/nightcode/core.clj
@@ -74,6 +74,10 @@
       (.setSelected auto-save-button (:auto-save? @pref-state)))))

 (defn -main [& args]
+  (when (= "Linux" (System/getProperty "os.name"))
+    (do
+      (System/setProperty "prism.lcdtext" "false")
+      (System/setProperty "prism.text" "t2k")))
   (swap! runtime-state assoc :web-port (e/start-web-server!))
   (Application/launch nightcode.core (into-array String args)))


cleanup

cleanup

--- src/clj_blueflood/core.clj
+++ src/clj_blueflood/core.clj
@@ -9,8 +9,6 @@
         [ring.middleware.keyword-params :only [wrap-keyword-params]]
         [ring.middleware.nested-params :only [wrap-nested-params]]
         [ring.util.response :only [response status]]
-        ;[compojure.route :only [not-found]]
-        ;[compojure.core :only [defroutes GET POST DELETE ANY context]]
         [qbits.alia :as alia]
         [clojure.tools.cli]
         qbits.hayt
@@ -32,7 +30,6 @@
      (alia/execute-async (:session @cass-state) query opts))))

 (defn cass-prepared-insert [& data]
-  ;(log/info "Inserting the following data: " data)
   (cass-execute (:prepared-insert @cass-state) {:values data}))

 (defn init-cass


Remove unused function

Remove unused function

--- src/clj_gatling/report.clj
+++ src/clj_gatling/report.clj
@@ -41,14 +41,6 @@
   {:reporter-key :short
    :collector 'clj-gatling.report/short-summary-collector
    :generator 'clj-gatling.report/short-summary-generator})
-
-(defn short-summary-reporter2 [options]
-  {:reporter-key :short
-   :parser  (fn [_ {:keys [batch]}]
-              (rename-keys (frequencies (mapcat #(map :result (:requests %)) batch))
-                           {true :ok false :ko}))
-   :combiner #(merge-with + %1 %2)
-   :generator identity})

 (defn- parse-with-reporters [simulation batch reporters]
   (reduce


Added support for source

Added support for source

--- src/cljs/replumb/repl.cljs
+++ src/cljs/replumb/repl.cljs
@@ -4,10 +4,12 @@
   (:require [cljs.js :as cljs]
             [cljs.tagged-literals :as tags]
             [cljs.tools.reader :as r]
+            [cljs.tools.reader.reader-types :as rt]
             [cljs.analyzer :as ana]
             [cljs.env :as env]
             [cljs.repl :as repl]
             [cljs.pprint :refer [pprint]]
+            [clojure.string :as s]
             [replumb.common :as common]
             [replumb.doc-maps :as docs]
             [replumb.load :as load]
@@ -500,6 +502,41 @@
                                 (common/wrap-error error)
                                 (common/wrap-success nil)))))))))))))

+(defn fetch-source
+  [{:keys [verbose read-file-fn!]} var paths-to-try cb]
+  (load/read-files-and-callback! verbose
+                                 paths-to-try
+                                 read-file-fn!
+                                 (fn [result]
+                                   (let [source (:source result)
+                                         rdr (rt/source-logging-push-back-reader source)]
+                                     (dotimes [_ (dec (:line var))] (rt/read-line rdr))
+                                     (-> (r/read {:read-cond :allow :features #{:cljs}} rdr)
+                                         meta
+                                         :source
+                                         common/wrap-success
+                                         cb)))))
+
+(defn filenames-to-try-from-symbol
+  [sym src-paths]
+  (let [without-extension (s/replace (s/replace (name sym) #"\." "/") #"-" "_")
+        files (map #(str without-extension %) [".clj" ".cljc" ".cljs"])]
+    (for [file files src-path src-paths]
+      (str (common/normalize-path src-path) file))))
+
+(defn process-source
+  [opts cb data env sym]
+  (let [var (get-var opts env sym)
+        call-back (partial call-back! (merge opts {:no-pr-str-on-value true}) cb data)]
+    (if-let [filepath (or (:file var) (:file (:meta var)))]
+      (let [src-paths (:src-paths opts)
+            ; see discussion here: https://github.com/ScalaConsultants/replumb/issues/17#issuecomment-163832028
+            paths-to-try (if (symbol? filepath)
+                           (filenames-to-try-from-symbol filepath src-paths)
+                           (map #(str (common/normalize-path %) filepath) src-paths))]
+        (fetch-source opts var paths-to-try call-back))
+      (call-back nil))))
+
 (defn process-repl-special
   [opts cb data expression-form]
   (let [env (assoc (ana/empty-env) :context :expr
@@ -511,7 +548,7 @@
       require-macros (process-require opts cb data :require-macros (rest expression-form))
       import (process-require opts cb data :import (rest expression-form))
       doc (process-doc opts cb data env argument)
-      source (call-back! opts cb data (common/error-keyword-not-supported "source" ex-info-data)) ;; (println (fetch-source (get-var env argument)))
+      source (process-source opts cb data env argument)
       pst (process-pst opts cb data argument)
       load-file (call-back! opts cb data (common/error-keyword-not-supported "load-file" ex-info-data))))) ;; (process-load-file argument opts)


Export of EDN look-a-like repodoc works!

Well, export happens when serialized database is
copied by hand, but it's possible.

--- src/cljs/repodoc/core.cljs
+++ src/cljs/repodoc/core.cljs
@@ -46,14 +46,15 @@
 (defn serialize-db
   "Serialize annotated items into vector of maps"
   []
-  (with-out-str (cljs.pprint/pprint
-                  (vec (map
-                      (fn [item]
-                        {:path (get item "path")
-                        :title (get item "title")
-                        :mtime (get item "mtime")})
-                      (filter #(get % "mtime") (querydb [:data])))))))
-
+  (with-out-str
+    (cljs.pprint/pprint
+        (vec
+          (map
+            (fn [item]
+              {:path (get item "path")
+              :title (get item "title")
+              :mtime (get item "mtime")})
+            (filter #(get % "mtime") (querydb [:data])))))))

 ;; Utils


Implement new function of Context protocol for seq, vector and set monad.

--- src/cljx/cats/builtin.cljx
+++ src/cljx/cats/builtin.cljx
@@ -35,8 +35,8 @@

 (extend-type nil
   proto/Context
-  (get-context [_]
-    maybe/maybe-monad))
+  (get-context [_] maybe/maybe-monad)
+  (get-value [_] nil))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; (Lazy) Sequence Monad
@@ -75,8 +75,8 @@
 (extend-type #+clj clojure.lang.LazySeq
              #+cljs cljs.core.LazySeq
   proto/Context
-  (get-context [_]
-    sequence-monad))
+  (get-context [_] sequence-monad)
+  (get-value [self] (seq self)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Vector Monad
@@ -116,8 +116,8 @@
 (extend-type #+clj clojure.lang.PersistentVector
              #+cljs cljs.core.PersistentVector
   proto/Context
-  (get-context [_]
-    vector-monad))
+  (get-context [_] vector-monad)
+  (get-value [self] (seq self)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Set Monad
@@ -156,5 +156,5 @@
 (extend-type #+clj clojure.lang.PersistentHashSet
              #+cljs cljs.core.PersistentHashSet
   proto/Context
-  (get-context [_]
-    set-monad))
+  (get-context [_] set-monad)
+  (get-value [self] (seq self)))


Add 'histogram' to API.

Add 'histogram' to API.

--- src/clojure/flambo/api.clj
+++ src/clojure/flambo/api.clj
@@ -420,3 +420,16 @@
   program computes all the elements)."
   [rdd cnt]
   (.take rdd cnt))
+
+(defmulti histogram "compute histogram of an RDD of doubles"
+  (fn [_ arg & _] (type arg)))
+
+(defmethod histogram Long [rdd bucket-count]
+  (let [[buckets counts] (-> (JavaDoubleRDD/fromRDD (.rdd rdd))
+                             (.histogram bucket-count)
+                             untuple)]
+    [(into [] buckets) (into [] counts)]))
+
+(defmethod histogram :default [rdd buckets]
+  (-> (JavaDoubleRDD/fromRDD (.rdd rdd))
+      (.histogram (double-array buckets))))


pinterest site verify

pinterest site verify

--- src/clojure/nossal/web.clj
+++ src/clojure/nossal/web.clj
@@ -28,6 +28,7 @@
       [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge,chrome=1"}]
       [:meta {:name "viewport" :content "width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=0"}]
       [:meta {:name "keywords" :content (options :keywords)}]
+      [:meta {:name "p:domain_verify" :content "edd280e116c041e49ff00170c956141a"}]
       [:title title]
       [:meta {:name "description" :content (options :description)}]
       (map (fn [o] [:meta o]) (options :meta))


Remove unused arity of apply-to-keys-and-values

--- src/zweikopf/multi.clj
+++ src/zweikopf/multi.clj
@@ -99,13 +99,9 @@
   (clojurize [this _]
     this))

-(defn- apply-to-keys-and-values
-  ([m f]
-   (apply-to-keys-and-values m f f))
-  ([m key-f value-f]
-   (into {} (for [[k v] m]
-              [(key-f k) (value-f v)]))))
-
+(defn- apply-to-keys-and-values [m f]
+  (into {} (for [[k v] m]
+             [(f k) (f v)])))

 (defn- ^Ruby runtime
   [^ScriptingContainer container]


fix "poner"

fix "poner"

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -665,16 +665,16 @@
              {:synsem {:sem {:pred :be-able-to}}})])

    "poner" {:espanol {:future-stem "pondr"
-                   :present {:1sing "tengo"
-                             :2sing "tienes"
-                             :3sing "tiene"
-                             :1plur "tenemos"
-                             :2plur "tenéis"
-                             :3plur "tienen"}
-                   :preterito-stem "tuv"}
-                             :synsem {:cat :verb
-                  :sem {:subj {:animate true}
-                        :pred :put}}}
+                      :present {:1sing "pongo"
+                                :2sing "pones"
+                                :3sing "pone"
+                                :1plur "ponemos"
+                                :2plur "ponéis"
+                             :3plur "ponen"}
+                      :preterito-stem "pus"}
+            :synsem {:cat :verb
+                     :sem {:subj {:animate true}
+                           :pred :put}}}

    "quedarse" (let [subject-semantics (ref {:animate true})
                     subject-agr (ref :top)]


specify that 3rd argument to 'llamarse' is is propernoun=true

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -458,7 +458,8 @@
                      :reflexive true
                      :subj subject-semantics
                      :obj called-semantics}
-               :subcat {:1 {:agr {:number subject-number
+               :subcat {:1 {:propernoun false
+                            :agr {:number subject-number
                                   :person subject-person
                                   :gender subject-gender}}
                         :2 {:agr {:number subject-number
@@ -468,7 +469,7 @@
                             :reflexive true}
                         :3 {:agr {:number subject-number
                                   :gender subject-gender}
-                            :pronoun false
+                            :propernoun true
                             :sem called-semantics
                             :cat :noun
                             :subcat '()}}}})


Add decode edn body middleware

Add decode edn body middleware

--- src/clj/clojuredocs/entry.clj
+++ src/clj/clojuredocs/entry.clj
@@ -27,7 +27,8 @@
             [clojuredocs.site.styleguide :as styleguide]
             [clojure.pprint :refer (pprint)]
             [clojuredocs.api :as api]
-            [somnium.congomongo :as mon]))
+            [somnium.congomongo :as mon]
+            [clojure.edn :as edn]))

 (defn hiccup->html-string [body]
   (if-not (vector? body)
@@ -139,9 +140,20 @@
         (update-in res [:headers] merge {"Cache-Control" "public, max-age=31536000"})
         res))))

+(defn decode-edn-body [h]
+  (fn [r]
+    (if (= "application/edn" (get-in r [:headers "content-type"]))
+      (try
+        (h (assoc r :edn-body (-> r util/response-body edn/read-string)))
+        (catch Exception e
+          {:status 400
+           :body "Malformed edn"}))
+      (h r))))
+
 (def routes
   (-> _routes
       promote-session-user
+      decode-edn-body
       wrap-keyword-params
       wrap-nested-params
       wrap-params


Additional old site redirects

Additional old site redirects

--- src/clj/clojuredocs/entry.clj
+++ src/clj/clojuredocs/entry.clj
@@ -50,6 +50,17 @@
       (merge (with-meta (response "") (meta resp-map))
              resp-map))))

+(defroutes old-url-redirects
+  (GET "/clojure_core/:ns/:name" [ns name]
+    (fn [r]
+      (let [name (->> name
+                      util/cd-decode
+                      util/cd-encode)]
+        {:status 301
+         :headers {"Location" (str "/" ns "/" name)}})))
+  (GET "/quickref/*" [] {:status 301 :headers {"Location" "/quickref"}})
+  (GET "/clojure_core" [] {:status 301 :headers {"Location" "/"}}))
+
 (defroutes _routes
   (var site.intro/routes)
   (var site.gh-auth/routes)
@@ -62,13 +73,7 @@

   ;; Redirect old urls
-  (GET "/clojure_core/:ns/:name" [ns name]
-    (fn [r]
-      (let [name (->> name
-                      util/cd-decode
-                      util/cd-encode)]
-        {:status 301
-         :headers {"Location" (str "/" ns "/" name)}})))
+  (var old-url-redirects)

   (GET "/:ns/:name" [ns name] (site.vars/var-page ns name))
   (GET "/:ns" [ns] (site.nss/index ns))


implement Indian Union Stock Exchange

implement Indian Union Stock Exchange

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -383,6 +383,12 @@
       :derezzed-events {:runner-turn-ends corp-rez-toast}
       :abilities [choose-ability]
      })
+
+   "Indian Union Stock Exchange"
+   (let [iuse {:req (req (not= (:faction target) (:faction (:identity corp))))
+               :msg "gain 1 [Credits]"
+               :effect (effect (gain :credit 1))}]
+     {:events {:play-operation iuse :rez iuse}})

    "Isabel McGuire"
    {:abilities [{:cost [:click 1] :label "Add an installed card to HQ"


Fix command capture macro

Fix command capture macro

--- src/clj/genartlib/capture.clj
+++ src/clj/genartlib/capture.clj
@@ -101,7 +101,7 @@
        ~@body)
      @commands#))

-(defn with-command-capture
+(defmacro with-command-capture
   [output-file & body]
   `(let [commands# (capture-helper ~@body)]
      (println "Going to save commands to" ~output-file)
@@ -150,21 +150,20 @@
      (with-open [wrt# (writer ~output-file)]
        (.write wrt# (format svg-opening ~width ~height (int (w)) (int (h))))
        (doseq [cmd# commands#]
-         (try
-           (case (:type cmd#)
-             :line
-             (when (:stroke cmd#)
-               (.write wrt# (make-path [[(w (:start-x cmd#)) (h (:start-y cmd#))]
-                                        [(w (:end-x cmd#)) (h (:end-y cmd#))]])))
-
-             :shape
-             (when (:stroke cmd#)
-               (doseq [[p1# p2#] (partition 2 1 (:points cmd#))]
-                 (.write wrt# (make-path [[(w (:x p1#)) (h (:y p1#))]
-                                          [(w (:x p2#)) (h (:y p2#))]]))))
-
-             ; else
-             nil)))
+         (case (:type cmd#)
+           :line
+           (when (:stroke cmd#)
+             (.write wrt# (make-path [[(w (:start-x cmd#)) (h (:start-y cmd#))]
+                                      [(w (:end-x cmd#)) (h (:end-y cmd#))]])))
+
+           :shape
+           (when (:stroke cmd#)
+             (doseq [[p1# p2#] (partition 2 1 (:points cmd#))]
+               (.write wrt# (make-path [[(w (:x p1#)) (h (:y p1#))]
+                                        [(w (:x p2#)) (h (:y p2#))]]))))
+
+           ; else
+           nil))

        (.write wrt# "  </g>\n</svg>\n"))))


Removed conversion method (just to avoid confusion, since its now 'live-ranges' '

--- src/clj/minijava/liveness.clj
+++ src/clj/minijava/liveness.clj
@@ -35,22 +35,6 @@
                               (not (= in new-in-set))
                               (not (= out new-out-set)))]
           (recur (rest lines) new-ins new-outs changed?))))))
-
-(defn conversion [program map]
-  (let [all-temps (union-all (vals map))
-        first-index (fn [prog map temp]
-                      (loop [prog prog
-                             index 0]
-                        (if (contains? (get map (first prog)) temp)
-                            index
-                            (recur (rest prog) (inc index)))))
-        last-index (fn [prog map temp] (first-index (reverse prog) map temp))]
-    (map (fn [tmp]
-           {:id (:id tmp),
-            :start (first-index program map tmp),
-            :end (last-index program map tmp)})
-         all-temps)))
-

 (deftype Live-Range [id start end reg]
  clojure.lang.IPersistentMap)


minor reformat

minor reformat

--- src/clj/my_project/server.clj
+++ src/clj/my_project/server.clj
@@ -67,7 +67,8 @@
   (resources "/")
   (resources "/react" {:root "react"})

-  (GET ["/rez/:rez-type/:rez-name" :rez-name #".*" :rez-type #".*"] [rez-name rez-type]
+  (GET ["/rez/:rez-type/:rez-name" :rez-name #".*" :rez-type #".*"]
+       [rez-name rez-type]
        (get-rez rez-name rez-type))

   (GET "/" req (page)))
@@ -99,6 +100,3 @@

-
-
-


small-fix

small-fix

--- src/clj/salava/gallery/db.clj
+++ src/clj/salava/gallery/db.clj
@@ -360,7 +360,7 @@

 (defn gallery-stats [ctx last-login]
   {:profiles {:all (gallery-profiles-count {} (into {:result-set-fn first :row-fn :profiles_count}(get-db ctx)))
-              :since_last_login}
+              :since_last_login nil}
    :pages (gallery-pages-count {} (into {:result-set-fn first :row-fn :pages_count}(get-db ctx)))
    :badges (gallery-badges-count {} (into {:result-set-fn first :row-fn :badges_count}(get-db ctx)))})


everything needs an :input

everything needs an :input

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -1563,7 +1563,8 @@
                        :js-name "constants_table.js"
                        :name "constants_table.js"
                        :provides #{'constants-table}
-                       :requires #{}})))
+                       :requires #{}
+                       :input (atom "")})))

 (defn enable-source-maps [state]
   (assoc state :source-map "cljs.closure/make-options expects a string but we dont use it"))


Remove repl helper code from core

Remove repl helper code from core

[#174140003]

--- src/clj/time_tracker/core.clj
+++ src/clj/time_tracker/core.clj
@@ -24,24 +24,6 @@
    (reset! server (httpkit/run-server app-handler
                                       {:port (config/get-config :port)}))))

-(defn stop-server!
-  []
-  (when-not (nil? @server)
-    (@server :timeout 100)
-    (log/info {:event ::server-stop})
-    (reset! server nil)))
-
-(defn restart-server!
-  []
-  (stop-server!)
-  (start-server!))
-
-(defn start-app!
-  "REPL convenience. Starts the whole app from scratch."
-  []
-  (init!)
-  (start-server!))
-
 (defn -main
   [& args]
   (cli/init! args)


implement create by period detail

implement create by period detail

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -378,7 +378,7 @@
                 range
                 (map #(hash-map :index % :amount 0M))
                 (partition 3)))]]
-    [:input {:type :hidden :name :method :value :total}]
+    [:input {:type :hidden :name :method :value :detail}]
     [:button.btn.btn-primary {:type :submit
                               :title "Click here to save this budget item."} "Save"]
     " "
@@ -423,6 +423,17 @@
                     range
                     (mapv #(hash-map :amount amount :index %))))
         (dissoc :total))))
+
+(defmethod extract-periods :detail
+  [item budget]
+  (-> item
+      (assoc :periods (->> (range (:period-count budget))
+                           (map #(format "period-%s" %))
+                           (map keyword)
+                           (map #(% item))
+                           (map bigdec)
+                           (map-indexed #(hash-map :index %1 :amount %2))))
+      (select-keys [:budget-id :account-id :periods])))

 (defn create-item
   "Creates an budget item"


Add days survived to game over screen

Add days survived to game over screen

--- src/cljc/robinson/render.cljc
+++ src/cljc/robinson/render.cljc
@@ -1163,6 +1163,7 @@
                             (case cur-state
                               :dead 0
                               :rescued 1000)))
+        days-survived  (int (/ (get-time state) 800))
         player-name    (get-in state [:world :player :name])
         madlib         (gen-end-madlib state)]
     (clear (state :screen))
@@ -1184,9 +1185,10 @@
                                  :else                 "mysterious causes"))]
           ;; Title
           (put-string (state :screen) 10 1 (format "%s: %s." player-name madlib))
-          (put-string (state :screen) 18 2 (format "Died from %s." cause-of-death))
-          (put-string (state :screen) 10 3 (format "Points: %s." points))
-          (put-string (state :screen) 10 4 "Inventory:")
+          (put-string (state :screen) 18 2 (format "Survided for %d %s." days-survived (if (> 1 days-survived) "days" "day")))
+          (put-string (state :screen) 18 3 (format "Died from %s." cause-of-death))
+          (put-string (state :screen) 10 4 (format "Points: %s." points))
+          (put-string (state :screen) 10 5 "Inventory:")
           (doall (map-indexed
             (fn [idx item] (put-string (state :screen) 18 (+ idx 5) (item :name)))
             (-> state :world :player :inventory)))


Fix help screen

Fix help screen

--- src/cljc/robinson/render.cljc
+++ src/cljc/robinson/render.cljc
@@ -1928,7 +1928,7 @@
                            (log/info "line" (vec line))
                            (map-indexed (fn [x tile]
                                           ;(log/info "tile" tile x y)
-                                          {:c (str (cp437->unicode (get tile :ch)))
+                                          {:c (cp437->unicode (get tile :ch))
                                            :fg [(get-in tile [:fg :r])
                                                 (get-in tile [:fg :g])
                                                 (get-in tile [:fg :b])]


Only attempt to apply metadata if actually provided.

--- src/clojure/parkour/graph.clj
+++ src/clojure/parkour/graph.clj
@@ -113,8 +113,10 @@
               , [values (assoc md kw x) nil]
               (keyword? x)
               , [values md x]
+              (seq md)
+              , [(conj values (vary-meta x merge md)) {} nil]
               :else
-              , [(conj values (vary-meta x merge md)) {} nil]))
+              , [(conj values x) {} nil]))
            [[] {} nil] coll)))

 (let [id (atom 0)]


Fix a double abort bug in the server

Fix a double abort bug in the server

--- src/clojure/picard/server.clj
+++ src/clojure/picard/server.clj
@@ -347,8 +347,7 @@
            (handle-ch-disconnected state current-state))

           [err (netty/exception-event evt)]
-          (if (instance? IOException err)
-            (handle-ch-disconnected state current-state)
+          (when-not (instance? IOException err)
             (handle-err state err current-state))))))))

 (defn- create-pipeline


Fit new EDEN API and optionally add reference to json body

--- src/discuss/eden/ajax.cljs
+++ src/discuss/eden/ajax.cljs
@@ -7,7 +7,21 @@
             [discuss.utils.logging :as log]
             [discuss.eden.specs :as especs]))

-(defn after-eden-post-handler []
+(defn- assoc-reference
+  "Add reference to premise and conclusion if it has been selected. Else returns
+  the unmodified body."
+  [body reference]
+  (if (seq reference)
+    (let [ref-list [{:text reference}]]
+      (-> body
+          (assoc-in [:premise :references] ref-list)
+          (assoc-in [:conclusion :references] ref-list)))
+    body))
+(s/fdef assoc-reference
+  :args (s/cat :body map? :reference string?)
+  :ret map?)
+
+(defn- after-eden-post-handler []
   (lib/change-view-next! :eden/overview))

 (defn post-eden-argument
@@ -16,13 +30,12 @@
   (let [request-url (str (lib/host-eden) (:add/argument config/eden))
         headers {"Content-Type" "application/json"}
         handler after-eden-post-handler
-        author-id (lib/get-user-id)
-        body {:premise premise
-              :conclusion (if (nil? selected) conclusion (:text selected))
-              :author-id author-id
-              :reference reference
-              :link-type :support}]
-    (comlib/do-post request-url body handler comlib/error-handler headers)))
+        body {:premise {:text premise}
+              :conclusion {:text (if (nil? selected) conclusion (:text selected))}
+              :author-id (lib/get-user-id)
+              :link-type :support}
+        body-with-ref (assoc-reference body reference)]
+    (comlib/do-post request-url body-with-ref handler comlib/error-handler headers)))

 (defn- received-arguments-handler [response]
   (let [arguments (-> response lib/json->clj :arguments)
@@ -39,6 +52,3 @@
         {:handler received-arguments-handler
          :params {:author-name author}}))
   ([] (search-arguments-by-author (lib/get-nickname))))
-
-
-(search-arguments-by-author "woot")


Log the failing request

Log the failing request

--- src/eventframework/app.clj
+++ src/eventframework/app.clj
@@ -64,7 +64,7 @@
   (fn [req]
     (try (handler req)
          (catch Exception e
-           (log/error e "processing HTTP request")
+           (log/error e "processing HTTP request" req)
            {:status 500
             :headers {"Content-Type" "text/html"}
             :body (slurp (io/resource "error/500.html"))}))))


now outputs directly to file, separates training and test files

--- src/flow_labeller/core.clj
+++ src/flow_labeller/core.clj
@@ -16,15 +16,16 @@
 (def p1 1)
 (def p2 3)

-(def DEFAULTPATH "/home/oblivia/cs/6706-network-design+management/assignments/A2/DARPA/outside.flow") ;; for testing
-
-;;
+(def DEFAULTPATH "/home/oblivia/cs/6706-network-design+management/assignments/A2/DARPA/sample_data01.flow") ;; for testing
+
+;; Slups up /etc/services and turns it into a usable map associating
+;; [port ip_protocol] string pairs with service names.
 (def service-map
   (let [servvecs
         (let [servlist (str/split (slurp "/etc/services") #"\n")]
           (map (fn [z] (conj  [(str/split (second z) #"/")] (first z)))
                (map (fn [y] (str/split y #"\s+"))
-                    (filter (fn [x] (not (= "" x)))
+                    (filter (partial not= "")
                             (map (fn [x] (str/replace x #"#.*" ""))
                                  servlist)))))]
     (into {} servvecs)))
@@ -50,65 +51,154 @@
   "Grabs flows from flow file."
   [flow-filename]
   (let [flowvec (str/split (slurp flow-filename) #"\n")]
-   (map (fn [x] (str/split x #",")) flowvec)))
+    (shuffle (map (fn [x] (str/split x #",")) flowvec)))) ;; added a shuffle, for luck
+
+(defn writeout
+  [filename & s]
+  (doseq [item s]
+    (spit filename (str item) :append true)))
+
+(defn NOP2 [number somelist]
+  somelist)
+                                        ;
+                                        ;(map (fn [x] (spit filename x :append true)) s))
+
+;; pretty inefficient to be opening and closing the file with each spit.
+;; figure out how to keep it open and close it at the end.

 (defn arff-maker
   "Generates an arff file that is readable by Weka."
-  [flow-filename tidy-attributes]
+  [flow-filename tidy-attributes rat]
   ;; if tidy-attributes = 1, then list only used attrs in the header
   (let [the-flows (flows flow-filename)
         labels (service-lister the-flows)]
-    (let [processed-flows
-          (map (fn [x y] (conj (subvec x (+ proto-index 1)) y)) the-flows labels)]
-      (do
-        ;; Relation section
-        (print "@RELATION application\n\n")
-        ;; Attributes section
-        ;; First, the numerical fields, to which we give boring names:
-        (loop [n 1, fields (first processed-flows)]
-          (printf "@ATTRIBUTE f%d\tNUMERIC\n" n)
-          (when (seq (rest (rest fields)))
-            (recur (inc n) (rest fields))))
-        ;; Now print the list of services as a set of nominal values
-        (print "@ATTRIBUTE service\t{")
-        (loop [service-list (if tidy-attributes
-                              (distinct labels)
-                              (vals service-map))]
-      (print (first service-list))
-      (when (seq (rest service-list))
-        (print ",")
-        (recur (rest service-list))))
-    (print "}\n\n")
-    ;; Data section
-      (println "@DATA")
-      (doseq [labelled-flow processed-flows]
-        (println (apply str (interpose "," labelled-flow))))))))
-
-(defn efs-prepper
-  "Formats the flows so that they can be processed by EFS."
-  [flowpath]
-  (let [the-flows (flows flowpath)]
-    (let [processed-flows
-          (map (fn [x y] (conj x y))
-               (map (fn [x] (subvec x proto-index)) the-flows)
-               (map (fn [x] (min (bigint (x p1))
-                                (bigint (x p2)))) the-flows)) ]
-      (doseq [pf processed-flows]
-        (println (apply str (interpose "," pf)))))))
-
-(defn -main
-  "Prints a list of labels for the flow provided."
-  [& args]
-  (let [flowpath (first args)]
-    (case (second args)
-      "arff"
-      (let [tidy-opt (if (= "tidy" (second (rest args))) true nil)]
-        (arff-maker flowpath tidy-opt))
-      "efs"
-      (efs-prepper flowpath)
-      (println "Usage: java -jar <path to flow file> <format> ['tidy']\nWhere format is arff or efs."))))
-
-
-
-
-
+    (doseq [splitter
+            (if rat
+              [{:suff (str ".trainer." (numerator rat) "." (denominator rat))
+                :num (int (* (count the-flows) rat))
+                :op take}
+               {:suff (str ".tester." (numerator (- 1 rat)) "." (denominator (- 1 rat)))
+                :op drop
+                :num (int (* (count the-flows) rat))}]
+               [{:suff ""
+                 :num 0
+                 :op NOP2}])]
+      (let [out (str flow-filename (splitter :suff)
+                     (if tidy-attributes ".tidy" "")
+                     ".arff")]
+                (let [processed-flows
+                      (map (fn [x y] (conj (subvec x (+ proto-index 1)) y)) the-flows labels)]
+                  (do
+                    ;; Relation section
+                    (writeout out "@RELATION application\n\n")
+                    ;; Attributes section
+                    ;; First, the numerical fields, to which we give boring names:
+                    (loop [n 1, fields (first processed-flows)]
+                      (writeout out "@ATTRIBUTE f" n "\tNUMERIC\n")
+                      (when (seq (rest (rest fields)))
+                        (recur (inc n) (rest fields))))
+                    ;; Now print the list of services as a set of nominal values
+                    (writeout out "@ATTRIBUTE service\t{")
+                    (loop [service-list (if tidy-attributes
+                                          (distinct labels)
+                                          (vals service-map))]
+                      (writeout out (first service-list))
+                      (when (seq (rest service-list))
+                        (writeout out ",")
+                        (recur (rest service-list))))
+                    (writeout out "}\n\n")
+                    ;; Data section
+                    (writeout out "@DATA\n")
+                    ;; if splitting off testing and training arffs, do it here.
+                    (doseq [labelled-flow ((splitter :op) (splitter :num) processed-flows)]
+                      (writeout out (apply str (interpose "," labelled-flow)) "\n" ))))
+                (println "ARFF file saved as " out)))))
+
+    (defn efs-prepper
+      "Formats the flows so that they can be processed by EFS."
+      [flowpath rat]
+      (let [the-flows (flows flowpath)]
+        (doseq [splitter
+                (if rat
+                  [{:suff (str ".trainer." (numerator rat) "." (denominator rat) ".efs")
+                    :num (int (* (count the-flows) rat))
+                    :op take}
+                   {:suff (str ".tester." (numerator (- 1 rat)) "." (denominator (- 1 rat)) ".efs")
+                    :num (int (* (count the-flows) rat))
+                    :op drop}]
+                  [{:suff ".efs"
+                    :num 0
+                    :op NOP2}])]
+          (let [out (str flowpath (splitter :suff))
+                processed-flows
+                ((splitter :op) (splitter :num)
+                 (map (fn [x y] (conj x y))
+                      (map (fn [x] (subvec x proto-index)) the-flows)
+                      (map (fn [x] (min (bigint (x p1))
+                                       (bigint (x p2)))) the-flows))) ]
+            (doseq [pf processed-flows]
+              (writeout out (apply str (interpose "," pf)) "\n" ))
+          (println "Saved EFS format to " out)))))
+
+    (defn -main
+      "Prints a list of labels for the flow provided."
+      [& args]
+      (let [options (apply hash-map args)]
+        (let [flowpath (options "-f")
+              tidy (options "-t")
+              test-rat (if (options "-r")
+                         (read-string (options "-r"))
+                         nil)
+              output (options "-o")]
+          (case output
+            "arff"
+            (arff-maker flowpath tidy test-rat)
+            "efs"
+            (efs-prepper flowpath test-rat)
+            ;; default
+            (println "Usage: java -jar flow-labeller.jar <-f path to flow file> <-o arff|efs> <-r ratio-to-separate-as-training-set> <-t 1|0 (1 to tidy up arff header>")))))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Default username if left blank

Default username if left blank

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -15,7 +15,10 @@
   (reify
     om/IRender
     (render [this]
-      (dom/div nil (get user "name") (if (get user "muted") " - Muted!")))))
+      (dom/div nil
+               (let [username (get user "name")]
+                 (if (empty? username) "Anonymous" username))
+               (if (get user "muted") " - Muted!")))))

 (defn users-list-view [data owner]
   (reify


And expand further

And expand further

--- src/eulalie/instance_data.clj
+++ src/eulalie/instance_data.clj
@@ -42,7 +42,14 @@
   [path & [args]]
   (retrieve! path (assoc args :pre-path
                          [:latest :dynamic :instance-identity])))
-(def instance-metadata!! (comp util/<?! instance-identity!))
+(def instance-identity!! (comp util/<?! instance-identity!))
+
+(defn identity-key! [k]
+  (go-catching
+    (-> (instance-identity! :document {:parse-json true})
+        <?
+        (get (keyword k)))))
+(def identity-key!! (comp util/<?! identity-key!))

 (defn default-iam-role! []
   (go-catching


Extract pom.xml

Extract pom.xml

--- test/carambar/core_test.clj
+++ test/carambar/core_test.clj
@@ -24,6 +24,11 @@
       <version>4.11</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.5</version>
+    </dependency>
   </dependencies>
 </project>")

@@ -37,3 +42,18 @@
 (def pom (zip/xml-zip xml-tree))

 (fact (zip-xml/xml1-> pom :name zip-xml/text) => "simple")
+
+(fact (zip-xml/xml-> pom :dependencies :dependency (zip-xml/tag= :groupId) zip-xml/text) => ["junit" "org.slf4j"])
+
+(defn dependency->map [dependency]
+  {:groupId (zip-xml/xml1-> dependency :groupId zip-xml/text)
+   :artifactId (zip-xml/xml1-> dependency :artifactId zip-xml/text)
+   :version (zip-xml/xml1-> dependency :version zip-xml/text)
+   :scope (zip-xml/xml1-> dependency :scope zip-xml/text)})
+
+(defn pom->map
+  []
+  (let [pom (zip/xml-zip xml-tree)]
+    {:dependencies (mapv dependency->map (zip-xml/xml-> pom :dependencies :dependency))}))
+
+(pom->map)


fix document ready after adding austin

fix document ready after adding austin

--- src/foosball/views/layout.clj
+++ src/foosball/views/layout.clj
@@ -28,9 +28,10 @@
     [:p.navbar-text "Version " (:version project)]]])

 (defn footer []
-  [:script "foosball.browser.register_document_ready()"]
-  (when @cemerick.austin.repls/browser-repl-env
-    [:script (cemerick.austin.repls/browser-connected-repl-js)]))
+  [:div
+   [:script "foosball.browser.register_document_ready()"]
+   (when @cemerick.austin.repls/browser-repl-env
+     [:script (cemerick.austin.repls/browser-connected-repl-js)])])

 (defhtml base [page-title & content]
   (html5


add simple ipv6 test

add simple ipv6 test

--- test/clj_http/test/core.clj
+++ test/clj_http/test/core.clj
@@ -226,3 +226,9 @@
   (let [resp (client/get "http://localhost:18080/clojure" {:as :auto})]
     (is (= 200 (:status resp)))
     (is (= {:foo "bar" :baz 7M :eggplant {:quux #{1 2 3}}} (:body resp)))))
+
+(deftest ^{:integration true} t-ipv6
+  (run-server)
+  (let [resp (client/get "http://[::1]:18080/get")]
+    (is (= 200 (:status resp)))
+    (is (= "get" (:body resp)))))


add an additional test for json-encoded params

--- test/clj_http/test/core.clj
+++ test/clj_http/test/core.clj
@@ -5,6 +5,7 @@
             [clj-http.client :as client]
             [clj-http.core :as core]
             [clj-http.util :as util]
+            [cheshire.core :as json]
             [ring.adapter.jetty :as ring])
   (:import (java.io ByteArrayInputStream)
            (org.apache.http.message BasicHeader BasicHeaderIterator)
@@ -286,3 +287,11 @@
     (is (= "move" (:body resp2)))
     (is (= "copy" (:body resp3)))
     (is (= "patch" (:body resp4)))))
+
+(deftest ^{:integration true} t-json-encoded-form-params
+  (run-server)
+  (let [params {:param1 "value1" :param2 "value2"}
+        resp (client/post "http://localhost:18080/post" {:content-type :json
+                                                         :form-params params})]
+    (is (= 200 (:status resp)))
+    (is (= (json/encode params) (:body resp)))))


[#455] Remove print statement

[#455] Remove print statement

--- backend/src/akvo/lumen/lib/invite_impl.clj
+++ backend/src/akvo/lumen/lib/invite_impl.clj
@@ -79,7 +79,5 @@
                           "Problem completing your invite.")
             :status 422})
           (assoc :headers {"Content-Type" "text/html"})))
-    (do
-      (prn (format "Tried to verify invite with id: %s" id))
-      (response {:status 422
-                 :body "Could not verify invite."}))))
+    (response {:status 422
+               :body "Could not verify invite."})))


[#1381] Fix sharing of Area charts

[#1381] Fix sharing of Area charts

--- backend/src/akvo/lumen/lib/public_impl.clj
+++ backend/src/akvo/lumen/lib/public_impl.clj
@@ -32,6 +32,19 @@
         "datasets" { dataset-id (dissoc dataset :rows)}})))

 (defmethod visualisation "line"
+  [tenant-conn visualisation config]
+  (let [dataset-id (:datasetId visualisation)
+        [dataset-tag dataset] (dataset/fetch tenant-conn dataset-id)
+        [tag query-result] (aggregation/query tenant-conn
+                                              dataset-id
+                                              "line"
+                                              (:spec visualisation))]
+    (when (and (= tag ::lib/ok)
+               (= dataset-tag ::lib/ok))
+      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}
+        "datasets" { dataset-id (dissoc dataset :rows)}})))
+
+(defmethod visualisation "area"
   [tenant-conn visualisation config]
   (let [dataset-id (:datasetId visualisation)
         [dataset-tag dataset] (dataset/fetch tenant-conn dataset-id)


midjed test_entity

midjed test_entity

--- test/karras/test_entity.clj
+++ test/karras/test_entity.clj
@@ -3,8 +3,10 @@
   (:use karras.sugar
         karras.entity
         [karras.collection :only [drop-collection collection]]
-        clojure.test))
-
+        clojure.test
+        midje.semi-sweet))
+
+(def not-nil? (comp not nil?))
 (defonce db (karras/mongo-db :karras-testing))

 (defaggregate Street
@@ -80,7 +82,7 @@

 (deftest test-parse-fields
   (let [parsed? (fn [fields expected-parsed-fields]
-                  (is (= (parse-fields fields) expected-parsed-fields)))]
+                  (expect (parse-fields fields) =>  expected-parsed-fields))]
     (testing "empty fields"
           (parsed? nil {}))
     (testing "no type specified"
@@ -101,36 +103,29 @@
        [:keyword 'not-a-map-or-keyword]))

 (deftest test-entity-spec
-  (is (not (nil? (entity-spec Address))))
-  (is (not (nil? (entity-spec Phone))))
-  (is (not (nil? (entity-spec Person)))))
+  (doseq [e [Address Phone Person]]
+    (expect e => not-nil?)))

 (deftest test-entity-spec-in
-  (is (= (entity-spec Address) (entity-spec-of Person :address)))
-  (is (= (entity-spec java.util.List) (entity-spec-of Person :phones)))
-  (is (= (entity-spec Phone) (entity-spec-of-item Person :phones)))
-  (is (= (entity-spec Street) (entity-spec-of Person :address :street))))
-
-(deftest test-entity-spec-in
-  (is (= (entity-spec Address) (entity-spec-of Person :address)))
-  (is (= (entity-spec java.util.List) (entity-spec-of Person :phones)))
-  (is (= (entity-spec Phone) (entity-spec-of-item Person :phones)))
-  (is (= (entity-spec Street) (entity-spec-of Person :address :street))))
+  (expect (entity-spec-of Person :address) => (entity-spec Address))
+  (expect (entity-spec-of Person :phones) => (entity-spec java.util.List))
+  (expect (entity-spec-of-item Person :phones) => (entity-spec Phone))
+  (expect (entity-spec-of Person :address :street) => (entity-spec Street)))

 (deftest test-collection-name
   (testing "default name"
-    (is (= (:collection-name (entity-spec Person)) "people")))
+    (expect (:collection-name (entity-spec Person)) => "people"))
   (testing "override name"
-    (is (= (:collection-name (entity-spec Simple)) "simpletons"))))
+    (expect (:collection-name (entity-spec Simple)) => "simpletons")))

 (deftest test-make
   (let [phone (make Phone {:number "555-555-1212"})]
-    (is (= Phone (class phone))))
+    (expect (class phone) => Phone))
   (let [address (make Address {:city "Nashville"
                                :street {:number "123"
                                         :name "Main St."}})]
-    (is (= Address (class address)))
-    (is (= Street (class (:street address)))))
+    (expect (class address) => Address)
+    (expect (class (:street address)) => Street))
   (let [person (make Person
                      {:first-name "John"
                       :last-name "Smith"
@@ -139,49 +134,52 @@
                       :address {:city "Nashville"
                                 :street {:number "123"
                                          :name "Main St."}}})]
-    (is (= Address (class (-> person :address))))
-    (is (= Street (class (-> person :address :street))))
-    (is (= Phone (class (-> person :phones first)))))
+    (expect (class (-> person :address)) => Address)
+    (expect (class (-> person :address :street)) => Street)
+    (expect (class (-> person :phones first))=> Phone))
   (let [person (make Person {:last-name "Smith"})
         phone (make Phone {})]
-    (is (= #{:last-name :blood-alcohol-level} (set (keys person))))
-    (is (= 0.0 (:blood-alcohol-level person)))
-    (is (= #{:country-code} (set (keys phone))))
-    (is (= 1 (:country-code phone))))
+    (expect (keys person) => (in-any-order [:last-name :blood-alcohol-level]))
+    (expect (:blood-alcohol-level person) =>  0.0)
+    (expect (keys phone) => [:country-code])
+    (expect (:country-code phone) => 1))
+  (testing "preserves the metadata of original hash")
    (let [person (make Person #^{:meta "data"} {:first-name "Jimmy"})]
-     (is (= {:meta "data"} (meta person)) "preserves the metadata of original hash")))
+     (expect (meta person) => {:meta "data"})))
+
+(defn remove-called [e] (dissoc e :called))

 (deftest test-crud
-  (let [person (dissoc (create Person
-                               {:first-name "John"
-                                :last-name "Smith"
-                                :birthday (date 1976 7 4)
-                                :phones [{:number "123" :country-code 2}]
-                                :address {:city "Nashville"
-                                          :street {:number "123"
-                                                   :name "Main St."}}})
-                       :called)]
-    (is (= Person (class person)))
-    (is (= "1976-07-04" (:birthday person)))
-    (is (not (nil? (:_id person))))
-    (is (= (collection :people) (collection-for Person)))
-    (is (= (collection :people) (collection-for person)))
-    (is (= person (dissoc (fetch-by-id Person (:_id person)) :called)))
-    (is (= person (dissoc (first (fetch-all Person))
-                          :called)))
-    (is (= person (dissoc (first (fetch Person (where (eq :last-name "Smith"))))
-                          :called)))
-    (is (= 1 (count-instances Person)))
+  (let [person (remove-called (create Person
+                                      {:first-name "John"
+                                       :last-name "Smith"
+                                       :birthday (date 1976 7 4)
+                                       :phones [{:number "123" :country-code 2}]
+                                       :address {:city "Nashville"
+                                                 :street {:number "123"
+                                                          :name "Main St."}}}))]
+    (expect (class person) => Person)
+    (expect (:birthday person) => "1976-07-04")
+    (expect (:_id person) => not-nil?)
+    (expect (collection-for Person) => (collection :people))
+    (expect (collection-for Person) => (collection-for person))
+    (expect (remove-called (fetch-one Person (where (eq :_id (:_id person)))))
+            => person)
+    (expect (remove-called (first (fetch-all Person)))
+            => person)
+    (expect (remove-called (first (fetch Person (where (eq :last-name "Smith")))))
+            => person)
+    (expect (count-instances Person) => 1)
     (dotimes [x 5]
       (create Person {:first-name "John" :last-name (str "Smith" (inc x))}))
-    (is (= "John" (first (distinct-values Person :first-name))))
-    (is (= 6 (count-instances Person)))
+    (expect (first (distinct-values Person :first-name)) => "John")
+    (expect (count-instances Person) => 6)
     (delete person)
-    (is (= 5 (count-instances Person)))
+    (expect (count-instances Person) => 5)
     (delete-all Person (where (eq :last-name "Smith1")))
-    (is (= 4 (count-instances Person)))
+    (expect (count-instances Person) => 4)
     (delete-all Person)
-    (is (= 0 (count-instances Person)))))
+    (expect (count-instances Person) => 0)))

 (deftest test-callback-protocol
   (are [callback e] (= e (callback e))
@@ -196,18 +194,18 @@

 (deftest test-callback-impls
   (let [person (create Person {:first-name "John" :last-name "Smith"})]
-    (is (= ["before-create" "before-save" "after-save" "after-create"]
-             (:called person)))
-    (is (= ["before-update" "before-save" "after-save" "after-update"]
-             (:called (save (dissoc person :called)))))
-    (is (= ["before-delete" "after-delete"]
-             (:called (delete (dissoc person :called)))))))
+    (is (expect (:called person)
+                => ["before-create" "before-save" "after-save" "after-create"]))
+    (is (expect (:called (save (remove-called person)))
+                => ["before-update" "before-save" "after-save" "after-update"]))
+    (is (expect (:called (delete (remove-called person)))
+                => ["before-delete" "after-delete"]))))

 (deftest test-ensure-indexes
-  (is (empty? (list-indexes Person)))
+  (expect (list-indexes Person) => empty?)
   (ensure-indexes)
   ;; 2 + _id index
-  (is (= 3 (count (list-indexes Person)))))
+  (expect (count (list-indexes Person)) => 3))

 (deftest test-references
   (testing "saving"
@@ -217,21 +215,21 @@
                       (set-reference :ceo john)
                       (add-reference :employees jane)
                       save)]
-      (is (= (:_id john) (:ceo company)))
-      (is (= (:_id jane) (first (:employees company))))))
+      (expect (:ceo company) => (:_id john))
+      (expect (first (:employees company)) => (:_id jane))))
   (testing "reading"
     (let [company (fetch-one Company (where (eq :name "Acme")))
           john (get-reference company :ceo)
           [jane] (get-reference company :employees)]
-      (is (= "Smith" (:last-name john)))
-      (is (= "Doe" (:last-name jane)))))
+      (expect (:last-name john) => "Smith")
+      (expect (:last-name jane) => "Doe" )))
   (testing "updating"
     (let [bill (create Person {:first-name "Bill" :last-name "Jones"})
           company (-> (fetch-one Company (where (eq :name "Acme")))
                       (add-reference :employees bill))
           [jane bill] (get-reference company :employees)]
-      (is (= "Jane" (:first-name jane)))
-      (is (= "Bill" (:first-name bill))))))
+      (expect (:first-name jane) => "Jane")
+      (expect (:first-name bill) => "Bill"))))

 (deftest test-deffetch
   (is (= {:older-companies older-companies
@@ -240,13 +238,12 @@
   (let [jpmorgan (create Company {:name "JPMorgan Chase & Co." :date-founded "1799"})
         dell (create Company {:name "Dell" :date-founded (date 1984 11 4)})
         exxon (create Company {:name "Exxon" :date-founded "1911"})]
-    (is (= [jpmorgan] (older-companies "1800")))
-    (is (=  #{jpmorgan exxon} (set (older-companies "1913"))))
-    (is (=  [exxon jpmorgan] (older-companies "1913" :sort [(asc :name)])))
-    (is (=  [jpmorgan exxon dell]
-              (older-companies "1999" :sort [(asc :date-founded)
-                                             (asc :name)])))
-    (is (=  [dell] (modern-companies)))))
+    (expect (older-companies "1800") => [jpmorgan])
+    (expect (older-companies "1913") => (in-any-order [jpmorgan exxon]) )
+    (expect (older-companies "1913" :sort [(asc :name)]) => [exxon jpmorgan])
+    (expect (older-companies "1999" :sort [(asc :date-founded) (asc :name)])
+            => [jpmorgan exxon dell])
+    (expect (modern-companies) => [dell])))

 (deftest test-deffetch-one
   (is (= {:company-by-name company-by-name}
@@ -259,21 +256,21 @@
 (deftest test-find-and-*
   (let [foo (create Simple {:value "Foo"})
         expected (merge foo {:age 21})]
-    (is (= expected
-           (find-and-modify Simple (where (eq :value "Foo"))
-                            (modify (set-fields {:age 21}))
-                            :return-new true)))
-    (is (= expected
-           (find-and-remove Simple (where (eq :value "Foo")))))))
+    (expect (find-and-modify Simple (where (eq :value "Foo"))
+                             (modify (set-fields {:age 21}))
+                             :return-new true)
+            => expected)
+    (expect (find-and-remove Simple (where (eq :value "Foo")))
+            => expected)))

 (deftest test-map-reduce
   (dotimes [n 5]
     (create Simple {:value n}))
-  (is (= [{:_id "sum" :value (apply + (range 5))}]
-           (map-reduce-fetch-all Simple
-                                 "function() {emit('sum', this.value)}"
-                                 "function(k,vals) {
-                                                 var sum=0;
-                                                 for(var i in vals) sum += vals[i];
-                                                 return sum;
-                                              }"))))
+  (expect (map-reduce-fetch-all Simple
+                                "function() {emit('sum', this.value)}"
+                                "function(k,vals) {
+                                    var sum=0;
+                                    for(var i in vals) sum += vals[i];
+                                    return sum;
+                                 }")
+                  => [{:_id "sum" :value (apply + (range 5))}]))


Updated ring-server version

Updated ring-server version

--- src/leiningen/ring/server.clj
+++ src/leiningen/ring/server.clj
@@ -14,7 +14,7 @@
              s))))

 (defn add-server-dep [project]
-  (update-project project deps/add-if-missing '[ring-server "0.2.6"]))
+  (update-project project deps/add-if-missing '[ring-server "0.2.7"]))

 (defn server-task
   "Shared logic for server and server-headless tasks."


pull out a function for updating each rocket because the logic is about to become gross

--- src-cljs/hello.cljs
+++ src-cljs/hello.cljs
@@ -24,13 +24,15 @@
     (aset game-world
       :rockets (conj rockets new-rocket))))

+(defn update-rocket-step [rocket]
+  {:pos-x (get rocket :pos-x)
+   :pos-y (- (get rocket :pos-y) 1)
+   :angle (get rocket :angle)})
+
 (defn update [game-world]
   (aset game-world
     :rockets (map
-               (fn [r]
-                 {:pos-x (get r :pos-x)
-                  :pos-y (- (get r :pos-y) 1)
-                  :angle (get r :angle)})
+               update-rocket-step
                (aget game-world :rockets))))

 (defn clear-for-frame [graphics-context]


lein-release plugin: preparing 0.4.0 release

--- re_view/project.clj
+++ re_view/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view "0.4.0-SNAPSHOT"
+(defproject re-view "0.4.0"
   :description "ClojureScript React Library"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_view"
   :license {:name "Eclipse Public License"


Slight refactor

Slight refactor

--- src/montebot/connect4.cljc
+++ src/montebot/connect4.cljc
@@ -80,9 +80,11 @@
             #?(:cljs (.or (.shiftLeft (Long. 1) x) acc)
                :clj  (bit-set acc x))
             )
-          (Long. 0)
+          (long 0)
           v
           ))
+
+#_(crit/quick-bench (coll-to-bitfield [0 1 2 3]))

 (def victory-positions
   (->> (concat vertical-winning-positions horizontal-winning-positions diagonal-winning-positions)
@@ -224,5 +226,5 @@
                                  move-history
                                  n-iterations) move-history))

-#_(time (next-move [] 2000))
-
+#_(time (next-move [] 1000))
+


Refactor

Refactor

--- src/montebot/connect4.cljc
+++ src/montebot/connect4.cljc
@@ -1,22 +1,19 @@
 (ns montebot.connect4
   #?(:cljs (:import [goog.math Long]))
-  (:require clojure.set
-    #?(:clj [criterium.core :as crit])
-
-    #_[montebot.core :as montebot]))
+  (:require clojure.set))

 #?(:clj (set! *warn-on-reflection* true))
 #?(:cljs (enable-console-print!))

 (defn initial-state []
-  {:active :p1
+  {:active   :p1
    :occupied []
-   :p1 []
-   :p2 []})
+   :p1       []
+   :p2       []})

 (def cols (vec (range 7)))

-(def MAX_VALUE 9999999)
+(def MAX_VALUE #?(:clj Long/MAX_VALUE :cljs js/Number.MAX_VALUE))

 (defn highest-column [xs col]
   (let [max-col (filter #(= col (mod % 7)) xs)]
@@ -78,7 +75,7 @@
 (defn coll-to-bitfield [v]
   (reduce (fn [acc x]
             #?(:cljs (.or (.shiftLeft (Long. 1) x) acc)
-               :clj (bit-set acc x))
+               :clj  (bit-set acc x))
             )
           (Long. 0)
           v
@@ -209,5 +206,5 @@
                                  move-history
                                  n-iterations) move-history))

-;(time (next-move [] 2000))
-
+#_(time (next-move [] 2000))
+


fix display addevent page, when user not exist.

--- src/ombs/handler/pages.clj
+++ src/ombs/handler/pages.clj
@@ -13,4 +13,8 @@
     (pages/user username)
     (redirect "/")))

-(defn addevent [] (pages/addevent (db/get-usernames)))
+(defn addevent []
+  (if-let [username (sess/get :username)]
+    (pages/addevent (db/get-usernames))
+    (redirect "/")))
+


don't reply on standard #'clojure.string/split as it requires a regexp which might break with windows style file separators - instead use new #'split-on-char string helper fn.

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -173,10 +173,9 @@
   (let [path (resolve-tilde-path path)]
     (.length (file path))))

-(defn contains-parent-shortcut?
-  [path]
-  (let [re (re-pattern (file-separator))
-        split (str/split path re)]
+(defn contains-parent-dir-shortcut?
+  [path]
+  (let [split (split-on-char path (file-separator))]
     (some #(= ".." (str/trim %)) split)))

 (defn mkdir!


Fix BMI example in introduction

Fix BMI example in introduction

Used to have a glitch when the user first dragged the BMI control and
then the weight control.

--- demo/reagentdemo/intro.cljs
+++ demo/reagentdemo/intro.cljs
@@ -67,25 +67,28 @@
     [simple-component]
     (.-body js/document)))

-(def bmi-data (r/atom {:height 180 :weight 80}))
-
-(defn calc-bmi []
-  (let [{:keys [height weight bmi] :as data} @bmi-data
-        h (/ height 100)]
+(defn calc-bmi [{:keys [height weight bmi] :as data}]
+  (let [h (/ height 100)]
     (if (nil? bmi)
       (assoc data :bmi (/ weight (* h h)))
       (assoc data :weight (* bmi h h)))))

-(defn slider [param value min max]
+(def bmi-data (r/atom (calc-bmi {:height 180 :weight 80})))
+
+(defn slider [param value min max invalidates]
   [:input {:type "range" :value value :min min :max max
            :style {:width "100%"}
            :on-change (fn [e]
-                        (swap! bmi-data assoc param (.. e -target -value))
-                        (when (not= param :bmi)
-                          (swap! bmi-data assoc :bmi nil)))}])
+                        (let [new-value (js/parseInt (.. e -target -value))]
+                          (swap! bmi-data
+                                 (fn [data]
+                                   (-> data
+                                     (assoc param new-value)
+                                     (dissoc invalidates)
+                                     calc-bmi)))))}])

 (defn bmi-component []
-  (let [{:keys [weight height bmi]} (calc-bmi)
+  (let [{:keys [weight height bmi]} @bmi-data
         [color diagnose] (cond
                           (< bmi 18.5) ["orange" "underweight"]
                           (< bmi 25) ["inherit" "normal"]
@@ -95,14 +98,14 @@
      [:h3 "BMI calculator"]
      [:div
       "Height: " (int height) "cm"
-      [slider :height height 100 220]]
+      [slider :height height 100 220 :bmi]]
      [:div
       "Weight: " (int weight) "kg"
-      [slider :weight weight 30 150]]
+      [slider :weight weight 30 150 :bmi]]
      [:div
       "BMI: " (int bmi) " "
       [:span {:style {:color color}} diagnose]
-      [slider :bmi bmi 10 50]]]))
+      [slider :bmi bmi 10 50 :weight]]]))

 (def ns-src (s/syntaxed "(ns example
   (:require [reagent.core :as r]))"))
@@ -292,7 +295,7 @@
    [demo-component {:comp bmi-component
                     :src [:pre
                           ns-src
-                          (s/src-of [:bmi-data :calc-bmi :slider
+                          (s/src-of [:calc-bmi :bmi-data :slider
                                      :bmi-component])]}]])

 (defn complete-simple-demo []


Whitespace.

Whitespace.

--- core/test/immutant/util_test.clj
+++ core/test/immutant/util_test.clj
@@ -1,4 +1,4 @@
- ;; Copyright 2014 Red Hat, Inc, and individual contributors.
+;; Copyright 2014 Red Hat, Inc, and individual contributors.
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.


rm_case_pat_hist

--- src/pg_demo/table_defs.clj
+++ src/pg_demo/table_defs.clj
@@ -1312,6 +1312,109 @@
               PRIMARY KEY (ENTERPRISE_ID,CASE_ID,DLP_REVISION_NUMBER)
           ); " }

+    { "rm_case_pat_hist"
+          "CREATE TABLE rm_case_pat_hist (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              START_DATE timestamp,
+              START_DATE_RES numeric,
+              STOP_DATE timestamp,
+              STOP_DATE_RES numeric,
+              CONDITION_TYPE_ID numeric,
+              SORT_ID numeric,
+              CONTINUE numeric(1),
+              PARENT numeric(1),
+              ITEM_DICT numeric,
+              ITEM_CODE varchar(45),
+              START_DATE_PARTIAL varchar(20),
+              STOP_DATE_PARTIAL varchar(20),
+              CONDITION varchar(250),
+              NOTE text,
+              NOTE_J text,
+              ITEM_LLT varchar(250),
+              ITEM_HLT varchar(250),
+              ITEM_HLGT varchar(250),
+              ITEM_SOC varchar(250),
+              ITEM_LLT_CODE varchar(50),
+              ITEM_HLT_CODE varchar(50),
+              ITEM_HLGT_CODE varchar(50),
+              ITEM_SOC_CODE varchar(50),
+              ITEM_REPTD varchar(255),
+              ITEM_CODED varchar(255),
+              ITEM_SYN_CODE numeric,
+              ITEM_CODE_STATUS numeric(3),
+              DELETED timestamp,
+              INDICATION varchar(250),
+              IND_REPTD varchar(255),
+              IND_CODED varchar(255),
+              IND_PT_CODE varchar(50),
+              IND_LLT_CODE varchar(50),
+              IND_LLT varchar(250),
+              IND_HLT_CODE varchar(50),
+              IND_HLT varchar(250),
+              IND_HLGT_CODE varchar(50),
+              IND_HLGT varchar(250),
+              IND_SOC_CODE varchar(50),
+              IND_SOC varchar(250),
+              IND_SYN_CODE numeric,
+              IND_DICT_ID numeric,
+              IND_CODE_STATUS numeric(3),
+              REACTION varchar(250),
+              REACT_REPTD varchar(255),
+              REACT_CODED varchar(255),
+              REACT_PT_CODE varchar(50),
+              REACT_LLT_CODE varchar(50),
+              REACT_LLT varchar(250),
+              REACT_HLT_CODE varchar(50),
+              REACT_HLT varchar(250),
+              REACT_HLGT_CODE varchar(50),
+              REACT_HLGT varchar(250),
+              REACT_SOC_CODE varchar(50),
+              REACT_SOC varchar(250),
+              REACT_SYN_CODE numeric,
+              REACT_DICT_ID numeric,
+              REACT_CODE_STATUS numeric(3),
+              CONDITION_J varchar(250),
+              INDICATION_J varchar(250),
+              IND_CODED_J varchar(255),
+              IND_CODE_STATUS_J numeric,
+              IND_HLGT_J varchar(250),
+              IND_HLT_J varchar(250),
+              IND_LLT_CODE_J varchar(50),
+              IND_LLT_J varchar(250),
+              IND_REPTD_J varchar(255),
+              IND_SOC_J varchar(250),
+              ITEM_CODED_J varchar(255),
+              ITEM_CODE_STATUS_J numeric,
+              ITEM_HLGT_J varchar(250),
+              ITEM_HLT_J varchar(250),
+              ITEM_LLT_CODE_J varchar(50),
+              ITEM_LLT_J varchar(250),
+              ITEM_REPTD_J varchar(255),
+              ITEM_SOC_J varchar(250),
+              REACTION_J varchar(250),
+              REACT_CODED_J varchar(255),
+              REACT_CODE_STATUS_J numeric,
+              REACT_HLGT_J varchar(250),
+              REACT_HLT_J varchar(250),
+              REACT_LLT_CODE_J varchar(50),
+              REACT_LLT_J varchar(250),
+              REACT_REPTD_J varchar(255),
+              REACT_SOC_J varchar(250),
+              IND_SYN_CODE_J numeric,
+              ITEM_SYN_CODE_J numeric,
+              REACT_SYN_CODE_J numeric,
+              ITEM_DICT_J numeric,
+              ITEM_CODE_J varchar(50),
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,SEQ_NUM,DLP_REVISION_NUMBER)
+          ); " }
+
   ] ))

 (def dummy


Trim url before opening in browser

Trim url before opening in browser

--- src/status_im/utils/http.cljs
+++ src/status_im/utils/http.cljs
@@ -112,7 +112,10 @@
        (.catch (or on-error #())))))

 (defn normalize-url [url]
-  (str (when (and (string? url) (not (re-find #"^[a-zA-Z-_]+:/" url))) "https://") url))
+  (str (when (and (string? url)
+                  (not (re-find #"^[a-zA-Z-_]+:/" url)))
+         "https://")
+       ((fnil string/trim "") url)))

 (def normalize-and-decode-url (comp js/decodeURI normalize-url))


changed rimanere pred from remain to remain1

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1723,7 +1723,7 @@

 "rimanere" {:synsem {:cat :verb
                       :essere true
-                      :sem {:pred :remain}}
+                      :sem {:pred :remain1}}
              :italiano {:passato "rimasto"
                         :present {:1sing "rimango"
                                   :3plur "rimangono"}


Same fix for email invites

Same fix for email invites

--- src/braid/server/routes/api.clj
+++ src/braid/server/routes/api.clj
@@ -104,13 +104,15 @@
                   referer (get-in req [:headers "referer"] (config :site-url))
                   [proto _ referrer-domain] (string/split referer #"/")]
               (do
+                ; TODO: is there a way to combine these two txns into one?
+                (db/run-txns!
+                  (user/create-user-txn {:id user-id
+                                         :email email
+                                         :avatar avatar-url
+                                         :nickname nickname
+                                         :password password}))
                 (db/run-txns!
                   (concat
-                    (user/create-user-txn {:id user-id
-                                           :email email
-                                           :avatar avatar-url
-                                           :nickname nickname
-                                           :password password})
                     (group/user-join-group-txn user-id (invite :group-id))
                     (invitation/retract-invitation-txn (invite :id))))
                 (sync/broadcast-new-user-to-group user-id (invite :group-id)))


Implement new function of Context protocol for either monad.

--- src/cljx/cats/monad/either.cljx
+++ src/cljx/cats/monad/either.cljx
@@ -35,8 +35,8 @@

 (deftype Either [v type]
   proto/Context
-  (get-context [_]
-    either-monad)
+  (get-context [_] either-monad)
+  (get-value [_] v)

   #+clj
   Object


Simplified to-string-set

Simplified to-string-set

It's cheaper to call `lower-case` on the string before splitting it,
than lowercase'ing every element after a split.

--- src/common/relevance/utils.cljs
+++ src/common/relevance/utils.cljs
@@ -90,12 +90,11 @@
   "Split a string using commas, semi-colons or new lines, trims the resulting
   elements, and returns them as a set"
   [s]
-  (->>
-    (string/split (or s "") #",|\n|;| ")
-    (map string/trim)
-    (remove empty?)
-    (map string/lower-case)
-    (into #{})))
+  (->> (string/split (lower-case (or s ""))
+                     #",|\n|;| ")
+       (map string/trim)
+       (remove empty?)
+       (into #{})))

 (defn time-display
   "Returns a display string for a number of seconds"


Remove some printlns.

Remove some printlns.

--- src/uxbox/ui/colorpicker.cljs
+++ src/uxbox/ui/colorpicker.cljs
@@ -52,7 +52,6 @@

     (add-watch local ::key
                (fn [_ _ o v]
-                 (println "add-watch" o v)
                  (when (not= (:color o) (:color v))
                    (draw-color-gradient context1 params (:color v)))))

@@ -78,7 +77,6 @@
         r (aget (.-data image) 0)
         g (aget (.-data image) 1)
         b (aget (.-data image) 2)]
-    (println [r g b])
     (color/rgb->hex [r g b])))

 (defn- colorpicker-render


Improved performance for obtaining the image size.

--- src/uxbox/util/dom/files.cljs
+++ src/uxbox/util/dom/files.cljs
@@ -7,7 +7,8 @@
 (ns uxbox.util.dom.files
   "A interop helpers for work with files."
   (:require [beicon.core :as rx]
-            [cuerdas.core :as str]))
+            [cuerdas.core :as str]
+            [uxbox.util.blob :as blob]))

 (defn read-as-text
   [file]
@@ -27,17 +28,15 @@
        (.readAsDataURL fr file))
      (constantly nil))))

-(defn- retrieve-image-size
-  [data]
-  (rx/create
-   (fn [sick]
-     (let [img (js/Image.)]
-       (aset img "onload" #(sick (rx/end [(.-width img) (.-height img)])))
-       (set! (.-src img) data))
-     (constantly nil))))
-
 (defn get-image-size
-  "Get the real image size."
   [file]
-  (->> (read-as-dataurl file)
-       (rx/flat-map retrieve-image-size)))
+  (letfn [(on-load [sink img]
+            (let [size [(.-width img) (.-height img)]]
+              (sink (rx/end size))))
+          (on-subscribe [sink]
+            (let [img (js/Image.)
+                  uri (blob/create-uri file)]
+              (set! (.-onload img) (partial on-load sink img))
+              (set! (.-src img) uri)
+              #(blob/revoke-uri uri)))]
+    (rx/create on-subscribe)))


fixed gif making

fixed gif making

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -364,8 +364,10 @@
         (<! (paint-canvas! app idx))
         (.addFrame gif canvas #js {:delay ms :copy true}))
       (doto gif
-        (.on "finished" (fn [_]
-                          (om/update! app :result-gif)
+        (.on "finished" (fn [data]
+                          (om/update! app
+                                      :result-gif
+                                      (.createObjectURL js/URL data))
                           (om/update! app :gif-building? false)))
         (.render)))))


Fix doc string.

Fix doc string.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -58,7 +58,7 @@
     cmds))

 (defn init
-  "Init function passed to the repl :init. This is used to set up the environment."
+  "Internal init function for setting up the environment."
   [options]
   (let [cli-fns-ns 'cli4clj-cli-fns]
 	(create-ns cli-fns-ns)


fail when -g cannot be satisfied

fail when -g cannot be satisfied

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -85,6 +85,7 @@
 (defn- nml-gets [m gets no-prefix]
   (let [f (fn [[nml key]]
             (let [val (nml-get m nml key)]
+              (if (= "" val) (fail (str nml ":" key " not found")))
               (if no-prefix val (str nml ":" key "=" val))))]
     (str (string/join "\n" (map f gets)) "\n")))


Fixed typo when checking AWS keys

Fixed typo when checking AWS keys

--- src/riemann/cloudwatch.clj
+++ src/riemann/cloudwatch.clj
@@ -33,7 +33,7 @@

   :namespace   AWS CloudWatch namespace."
   [opts]
-  (let [opts (if (or (contains? opts :access-key) (contains? opts :access-key))
+  (let [opts (if (or (contains? opts :access-key) (contains? opts :secret-key))
                (merge
                     {:access-key "aws-access-key"
                      :secret-key "aws-secret-key"


accept map and vector results when merging

--- src/routom/datascript.cljs
+++ src/routom/datascript.cljs
@@ -11,7 +11,10 @@
   This function expects the app state atom to have a key :conn
   with the value being a datascript connection"
   (let [conn (:conn state)
-        tx-data (mapcat second res)
+        tx-data (mapcat #(let [tx-data (second %)]
+                           (if (map? tx-data)
+                             [tx-data]
+                             tx-data)) res)
         tx-data (strip-nil-vals tx-data)
         _ (d/transact! conn tx-data)]
     {:keys    (into [] (remove symbol?) (keys res))


a less incorrect fix

a less incorrect fix

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -498,8 +498,8 @@
           #(when z-drive
              (let [z (compute-z-position event)]
                (set-stage-position z-drive z)))
-          (doseq [runnable (event :runnables)]
-            (.run runnable))
+          (for [runnable (event :runnables)]
+            #(.run runnable))
           #(do (wait-for-pending-devices)
                (expose event)
                (collect event out-queue)


Disable ROI buttons while acquisition is running.

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -559,7 +559,8 @@
       (when (and (@state :init-continuous-focus)
                  (not (core isContinuousFocusEnabled)))
         (core enableContinuousFocus true))
-      (return-config))
+      (return-config)
+      (. gui enableRoiButtons true))
     (catch Throwable t (ReportingUtils/showError t "Acquisition cleanup failed."))))

 ;; running events
@@ -615,6 +616,7 @@
     (def acq-settings settings)
     (log (str "Starting MD Acquisition: " settings))
     (. gui enableLiveMode false)
+    (. gui enableRoiButtons false)
     (prepare-state this)
     (binding [state (.state this)]
       (def last-state state) ; for debugging


use dispatcher to use workers

use dispatcher to use workers

--- worker/src/worker/core.cljs
+++ worker/src/worker/core.cljs
@@ -20,7 +20,8 @@

 (defn ^:export wrk2 []
   (enable-console-print!)
-  (println "worker2"))
+  (println "worker2")
+  (+ 1 1))

 (defn do-some-wrk []
   (js/Promise. (fn [res rej]
@@ -31,20 +32,29 @@

 (defn do-some-wrk2 []
   (js/Promise. (fn [res rej]
-    (let [w (w/Worker)
-          wmeta (meta (var wrk2))]
-      ;;(.addEventListener w "message" #(res (worker.worker/*deserialize* (.-data %))))
-      (.postMessage w (cljs.core/clj->js [(:ns wmeta) (:name wmeta)]))
-      ))))
+    (dispatch/run
+      (fn [w]
+        (let [wmeta (meta (var wrk2))]
+          (.addEventListener w "message" #(do
+            (set! (.-onmessage w) nil)
+            (res (worker.worker/*deserialize* (.-data %)))))
+          (.postMessage w (cljs.core/clj->js [(:ns wmeta) (:name wmeta)]))
+      ))))))

 (defn ^:export main []
   (enable-console-print!)
 (w/add-worker)
 (w/add-worker)
-  (dispatch/run #(println %))
-  (dispatch/run #(println %))
-  (dispatch/run #(println %))
+(.then (do-some-wrk2) #(println %))
+(.then (do-some-wrk2) #(println %))
+(.then (do-some-wrk2) #(println %))
+(.then (do-some-wrk2) #(println %))
+(.then (do-some-wrk2) #(println %))
+(.then (do-some-wrk2) #(println %))
+  ; (dispatch/run #(println %))
+  ; (dispatch/run #(println %))
+  ; (dispatch/run #(println %))

   ; (async)


turn off commenting for reopening, no more training wheels

--- src/gh_waiting_room/service.clj
+++ src/gh_waiting_room/service.clj
@@ -31,10 +31,12 @@
         full-name (get-in! params ["repository" "full_name"])
         issue-num (get-in! params ["issue" "number"])
         issue-id (format "%s#%s" full-name issue-num)]
-    (when (some #{action} ["created" "reopened"])
+    (when (= action "created")
       (update-gh-issues)
       (create-issue-comment @db issue-id issue-num))
-    (when (and (= action "closed") (some #(= (:id %) issue-id) (viewable-issues @db)))
+    (when (and
+           (some #{action} ["closed" "reopened"])
+           (some #(= (:id %) issue-id) (viewable-issues @db)))
       (update-gh-issues)))
   {:status 200})


pull comms out state for inspector

pull comms out state for inspector

--- frontend/components/inspector.cljs
+++ frontend/components/inspector.cljs
@@ -12,4 +12,4 @@
     om/IRender
     (render [_]
       (html
-       [:code {:style {:flex "0 0 40%"}} (om/build ankha/inspector app)]))))
+       [:code {:style {:flex "0 0 40%"}} (om/build ankha/inspector (dissoc app :comms))]))))


fix z-indexes for cover

fix z-indexes for cover

--- frontend/components/landing-b.cljs
+++ frontend/components/landing-b.cljs
@@ -24,7 +24,7 @@
         (html [:div.home.page
                [:section.home-intro
                 [:a.intro-action "Sign Up Free"]
-                [:div.intro-overlay]
+                [:div.intro-cover]
                 [:nav.intro-nav
                  [:a.intro-nav-promote "What is Continuous Integration?"]
                  [:a.intro-nav-login "Log In"]]


set defaults for state, cleaned up local state

--- frontend/components/pricing-b.cljs
+++ frontend/components/pricing-b.cljs
@@ -41,16 +41,18 @@
 (defn pricing [app owner]
   (reify
     om/IDisplayName (display-name [_] "Pricing B")
-    om/IRender
-    (render [_]
-      (let [container-count (/ (om/get-state owner :drag-percent) increment)]
+    om/IInitState (init-state [_] {:drag-percent 0
+                                   :dragging? false})
+    om/IRenderState
+    (render-state [_ {:keys [drag-percent dragging?]}]
+      (let [container-count (/ drag-percent increment)]
         (html
-          [:div.pricing.page {:on-mouse-up #(om/set-state! owner :dragging (utils/inspect false))
-                              :on-mouse-down #(when (om/get-state owner :dragging)
-                                                (om/set-state! owner :drag-percent (utils/inspect (calculate-drag-percent owner %))))
-                              :on-mouse-move #(when (om/get-state owner :dragging)
-                                                (om/set-state! owner :drag-percent (utils/inspect (calculate-drag-percent owner %))))}
-           (common/nav)
+          [:div.pricing.page {:on-mouse-up #(om/set-state! owner :dragging? false)
+                              :on-mouse-down #(when dragging?
+                                                (om/set-state! owner :drag-percent (calculate-drag-percent owner %)))
+                              :on-mouse-move #(when dragging?
+                                                (om/set-state! owner :drag-percent (calculate-drag-percent owner %)))}
+           (common/nav owner)
            [:div.torso
             [:section.pricing-intro
              [:article
@@ -62,11 +64,13 @@
                [:div.controls-containers
                 [:h2 "Containers"]
                 [:p "All of your containers are shared across your entire organization."]
-                [:div.containers-range {:on-mouse-down #(om/set-state! owner :dragging (utils/inspect true))
+                [:div.containers-range {:on-click #(om/set-state! owner :drag-percent (calculate-drag-percent owner %))
+                                        :on-mouse-down #(om/set-state! owner :dragging? true)
                                         :ref "pricing-range"}
                  [:figure.range-back]
-                 [:figure.range-highlight {:style {:width (str (om/get-state owner :drag-percent) "%")}}]
-                 [:button.range-knob {:style {:left (str (om/get-state owner :drag-percent) "%")}
+                 [:figure.range-highlight {:style {:width (str drag-percent "%")}}]
+                 [:button.range-knob {:on-mouse-down #(om/set-state! owner :dragging? true)
+                                      :style {:left (str drag-percent "%")}
                                       :data-count container-count}]]]
                [:div.controls-parallelism
                 [:h2 "Parallelism"]
@@ -74,7 +78,7 @@
                  [:span "You can run "]
                  [:strong "3"]
                  [:span " concurrent builds with "]
-                 [:strong {:class (when (> container-count 9) "double-digits")} container-count]
+                 [:strong {:class (when (> container-count 9) "double-digits")} (str container-count)]
                  [:span " containers and "]
                  [:strong "2"]
                  [:span " parallelism. (Adjustable per project.)"]]


remove exclude (clojure.core/merge)

remove exclude (clojure.core/merge)

--- src/babel/say.clj
+++ src/babel/say.clj
@@ -1,5 +1,5 @@
 (ns babel.say
-  (:refer-clojure :exclude [get-in merge resolve find parents])
+  (:refer-clojure :exclude [get-in resolve find parents])
   (:require
    [clojure.data.json :refer [write-str]]
    [clojure.tools.logging :as log]


Removed unnecessary midje config file

Removed unnecessary midje config file

--- .midje.clj
+++ .midje.clj
@@ -1 +0,0 @@
-;(change-defaults :fact-filter (complement :thumbnail-integration))


Using protocol for NPR.

Using protocol for NPR.

--- src/cbfg/npr.cljs
+++ src/cbfg/npr.cljs
@@ -2,16 +2,24 @@
   (:require-macros [cbfg.ago :refer [achan-buf ago ago-loop aclose
                                      aput aput-close atake]]))

-(defn npr-client-stream-request-msg [actx client token])
-(defn npr-snapshot-beg-msg [stream-request snapshot])
-(defn npr-snapshot-end-msg [stream-request snapshot])
-(defn npr-snapshot-item-msg [stream-request snapshot item])
-(defn npr-rollback-msg [stream-request rollback])
-(defn server-take-snapshot [actx server stream-request prev-snapshot])
-(defn client-rollback [actx client stream-request rollback-msg])
-(defn client-snapshot-beg [actx client stream-request snapshot-beg])
-(defn client-snapshot-end [actx client stream-request snapshot-beg snapshot-end])
-(defn client-snapshot-item [actx client stream-request snapshot-beg snapshot-item])
+(defprotocol NPRMessage
+  "Methods to help form NPR protocol messages"
+  (npr-snapshot-beg-msg [stream-request snapshot])
+  (npr-snapshot-end-msg [stream-request snapshot])
+  (npr-snapshot-item-msg [stream-request snapshot item])
+  (npr-rollback-msg [stream-request rollback]))
+
+(defprotocol NPRSever
+  "Methods than an NPR protocol server must implement"
+  (server-take-snapshot [actx server stream-request prev-snapshot]))
+
+(defprotocol NPRClient
+  "Methods than an NPR protocol client must implement"
+  (client-stream-request-msg [actx client token])
+  (client-rollback [client actx stream-request rollback-msg])
+  (client-snapshot-beg [client actx stream-request snapshot-beg])
+  (client-snapshot-end [client actx stream-request snapshot-beg snapshot-end])
+  (client-snapshot-item [client actx stream-request snapshot-beg snapshot-item]))

 (defn make-npr-server-session [actx server stream-request to-client-ch]
   (ago-loop npr-server-session actx
@@ -46,7 +54,8 @@
              (= (:status r) :ok) (aput-close npr-client-loop out {:status :ok})
              (and snapshot-beg
                   (= (:status r) :part)
-                  (= (:sub-status r) :snapshot-item)) (if-let [err (client-snapshot-item npr-client-loop client
+                  (= (:sub-status r) :snapshot-item)) (if-let [err (client-snapshot-item client
+                                                                                npr-client-loop
                                                                                stream-request
                                                                                snapshot-beg r)]
                                                         (aput-close npr-client-loop out err)
@@ -55,7 +64,8 @@
                                                                num-snapshots (inc num-items)))
              (and snapshot-beg
                   (= (:status r) :part)
-                  (= (:sub-status r) :snapshot-end)) (if-let [err (client-snapshot-end npr-client-loop client
+                  (= (:sub-status r) :snapshot-end)) (if-let [err (client-snapshot-end client
+                                                                                npr-client-loop
                                                                                stream-request
                                                                                snapshot-beg r)]
                                                        (aput-close npr-client-loop out err)
@@ -64,7 +74,8 @@
                                                               (inc num-snapshots) num-items))
              (and (nil? snapshot-beg)
                   (= (:status r) :part)
-                  (= (:sub-status r) :snapshot-beg)) (if-let [err (client-snapshot-beg npr-client-loop client
+                  (= (:sub-status r) :snapshot-beg)) (if-let [err (client-snapshot-beg client
+                                                                                npr-client-loop
                                                                                stream-request r)]
                                                        (aput-close npr-client-loop out err)
                                                        (recur stream-request r
@@ -72,13 +83,14 @@
                                                               num-snapshots num-items))
              (and (nil? snapshot-beg)
                   (= (:status :rollback))) (aput-close npr-client-loop out
-                                                       (client-rollback npr-client-loop client
+                                                       (client-rollback client
+                                                                        npr-client-loop
                                                                         stream-request r))
              :else (aput-close npr-client-loop out {:status :unexpected-msg}))))

 (defn make-npr-client-session [actx client token to-server-ch from-server-ch]
   (let [out (achan-buf actx 1)
-        stream-request (npr-client-stream-request-msg actx client token)]
+        stream-request (client-stream-request-msg client actx token)]
     (ago npr-client-session actx
          (aput npr-client-session to-server-ch stream-request)
          (npr-client-loop npr-client-session client stream-request


Cleaned up display of msgs.

Cleaned up display of msgs.

--- src/cbfg/vis.cljs
+++ src/cbfg/vis.cljs
@@ -179,7 +179,7 @@
      (mapv (fn [ch-info]
              (let [ch-id (:id ch-info)]
                ["
" ch-id ": "
-                "" (:msgs ch-info) "
"]))
+                "" (keys (:msgs ch-info)) "
"]))
            (sort-by :id (vals (get actx-ch-ch-infos actx))))
      "

"
      (when (not (:closed actx-info))