Remove env injection capabilities

Remove env injection capabilities

--- src/oxcart.clj
+++ src/oxcart.clj
@@ -63,12 +63,11 @@
            (or *load-configuration*
                {:debug? false})))

-  ([form {:keys [debug? exec? forms env classloader]
+  ([form {:keys [debug? exec? forms classloader]
           :or   {debug? false}
           :as   options}]
      (let [mform (binding [macroexpand-1 ana.jvm/macroexpand-1]
-                   (macroexpand form
-                                (or env (ana.jvm/empty-env))))]
+                   (macroexpand form (ana.jvm/empty-env)))]

        (if (and (seq? mform)
                 (= 'do (first mform)))
@@ -96,7 +95,7 @@

          (do ;; Run the code for side-effects first
              (let [r     (-> `(^:once fn* [] ~mform)
-                             (ana.jvm/analyze (or env (ana.jvm/empty-env)))
+                             (ana.jvm/analyze (ana.jvm/empty-env))
                              (e/emit {:debug?       debug?
                                       :class-loader (or classloader
                                                         (clojure.lang.RT/makeClassLoader))}))
@@ -108,8 +107,7 @@
                                  ana/create-var    ana.jvm/create-var
                                  ana/parse         ana.jvm/parse
                                  ana/var?          var?]
-                         (ana.jvm/analyze mform
-                                          (or env (ana.jvm/empty-env))))]
+                         (ana.jvm/analyze mform (ana.jvm/empty-env)))]

                ;; Add to the accumulator for the whole read program
                ;;


Always keywordize the site parameter

Always keywordize the site parameter

--- src/clj/comic_reader/server.clj
+++ src/clj/comic_reader/server.clj
@@ -35,7 +35,7 @@
    (drop (dec chapter)
          (sort-by :url
                   (scrape/fetch-list
-                   (sites/chapter-list-data site
+                   (sites/chapter-list-data (keyword site)
                                             comic))))))

 (defn get-following-pages [site comic chapter-map page]
@@ -80,7 +80,8 @@
     (c/POST "/img" {{:keys [site page-url]} :edn-params
                     :as request}
       (if-let [img-tag (scrape/fetch-image-tag
-                        (sites/image-data site page-url))]
+                        (sites/image-data (keyword site)
+                                          page-url))]
         (edn-response img-tag)
         (edn-response (gen-error-data request) 404))))


fixup

fixup

--- src/clj/freestuffly/scraper.clj
+++ src/clj/freestuffly/scraper.clj
@@ -50,7 +50,7 @@

 (defn- presentable
   [results]
-  (string/join "\n\n" results))
+  (str "FOUND\n\n\n\n" (string/join "\n\n" results)))

 (defn scraped-content
   []


Fix whitespace

Fix whitespace

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -565,13 +565,13 @@
    "Sneakdoor Beta"
    {:abilities [{:cost [:click 1] :msg "make a run on Archives"
                  :effect (effect (run :archives
-                                      {:req (req (= target :archives))
-                                       :successful-run
-                                            {:effect (req (swap! state assoc-in [:run :server] [:hq])
-                                                          (update-run-ice state side)
-                                                          (system-msg state side
-                                                                      (str "uses Sneakdoor Beta to make a successful run on HQ")))}}
-                                      card))}]}
+                                   {:req (req (= target :archives))
+                                    :successful-run
+                                    {:effect (req (swap! state assoc-in [:run :server] [:hq])
+                                                  (update-run-ice state side)
+                                                  (system-msg state side
+                                                              (str "uses Sneakdoor Beta to make a successful run on HQ")))}}
+                                  card))}]}

    "Snitch"
    {:abilities [{:once :per-run :req (req current-ice) :msg (msg "expose " (:title current-ice))


gallery now centers first photo in list, first - more intuitive for cms upload of images

--- src/cljs/photosure/gallery.cljs
+++ src/cljs/photosure/gallery.cljs
@@ -16,7 +16,7 @@
 (def app-state
   (atom
    {:photos []
-    :curr [0 1 2]
+    :curr []
     :all-loaded false}))

 (defn on-load [app photo]
@@ -29,9 +29,10 @@
 (defn init-photos [paths]
   (let [photos (apply vector (map #(photo (str "images/gallery/" %) []) paths))]
     (swap! app-state #(assoc % :photos photos))
-    (swap! app-state #(assoc-in % [:photos 0 :pos] ["left"]))
-    (swap! app-state #(assoc-in % [:photos 1 :pos] ["center"]))
-    (swap! app-state #(assoc-in % [:photos 2 :pos] ["right"]))))
+    (swap! app-state #(assoc % :curr [(- (count photos) 1) 0 1]))
+    (swap! app-state #(assoc-in % [:photos (get (:curr @app-state) 0) :pos] ["left"]))
+    (swap! app-state #(assoc-in % [:photos (get (:curr @app-state) 1) :pos] ["center"]))
+    (swap! app-state #(assoc-in % [:photos (get (:curr @app-state) 2) :pos] ["right"]))))

 (defn photo-view [photo owner {:keys [on-load] :as opts}]
   (reify


::a/pipe-up recipe

::a/pipe-up recipe

--- src/cljs/reagent_plug/core.cljs
+++ src/cljs/reagent_plug/core.cljs
@@ -60,6 +60,11 @@
   (let [c (if chan-factory (chan-factory) (a/chan))]
     (->Plug c #(a/tap mult c false) #(a/untap mult c))))

+;; the initial argument is a channel, the injected argument is a channel piped to the original channel. Use it e.g to bubble up events.
+(defmethod make-plug ::a/pipe-up [[_] parent-chan]
+  (let [local-chan (a/chan)]
+    (->Plug local-chan #(a/pipe local-chan parent-chan false) #(a/close! local-chan))))
+
 (def ^:private gen-watch-key
   (let [next-int (atom 0)]
     (fn [] (keyword "reagent-plug.core" (str "watch-key-" (swap! next-int inc))))))
@@ -81,10 +86,6 @@
 (defmethod make-plug ::r/cursor [[_ path] ratom]
   (let [curs (r/cursor ratom path)]
     (->Plug curs #(do nil) #(reset! curs nil))))
-
-(defmethod make-plug ::async/pipe-up [[_] parent-chan]
-  (let [local-chan (async/chan)]
-    (->Plug local-chan #(async/pipe local-chan parent-chan false) #(async/close! local-chan))))

 ;; you could also imagine implementations for EventTargets, bacon.js streams etc.


Indexer+tokenizer+filters for neighborhood names.

--- src/cljs/town_client/state.cljs
+++ src/cljs/town_client/state.cljs
@@ -128,19 +128,39 @@
 (defn vector-to-array [el]
   (if (vector? el)
     (to-array (map vector-to-array el))
-    el)
-  )
+    el))
+
+(defn replacer [from to]
+  (fn [s] (clojure.string/replace s from to)))
+
+(def filters
+  (conj (apply vector
+               (map #(apply replacer %)
+                    [["å" "a"]
+                     ["ä" "a"]
+                     ["ö" "o"]]))
+        clojure.string/lower-case))
+
+(defn tokenizer
+  [s] (clojure.string/split s #"[- ]"))
+
+(defn index-neighborhoods [neighborhoods]
+  ; todo: multiple hits per token
+  ; (reduce)
+  (into {} (for [n neighborhoods
+                 token (tokenizer (:name n))]
+             [((apply comp filters) token) (:id n)])))

-(defn clj->js
-  "Recursively transforms ClojureScript maps into Javascript objects,
-other ClojureScript colls into JavaScript arrays, and ClojureScript
-keywords into JavaScript strings."
-  [x]
-  (cond
-   (string? x) x
-   (keyword? x) (name x)
-   (map? x) (.strobj (reduce (fn [m [k v]]
-                               (assoc m (clj->js k) (clj->js v))) {} x))
-   (coll? x) (apply array (map clj->js x))
-   :else x))
+;; (defn clj->js
+;;   "Recursively transforms ClojureScript maps into Javascript objects,
+;; other ClojureScript colls into JavaScript arrays, and ClojureScript
+;; keywords into JavaScript strings."
+;;   [x]
+;;   (cond
+;;    (string? x) x
+;;    (keyword? x) (name x)
+;;    (map? x) (.strobj (reduce (fn [m [k v]]
+;;                                (assoc m (clj->js k) (clj->js v))) {} x))
+;;    (coll? x) (apply array (map clj->js x))
+;;    :else x))


defn- -> core/defn- in the macros file

defn- -> core/defn- in the macros file

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -103,7 +103,7 @@
            (recur threaded (next forms)))
          x))))

-(defn- ^{:dynamic true} assert-valid-fdecl
+(core/defn- ^{:dynamic true} assert-valid-fdecl
   "A good fdecl looks like (([a] ...) ([a b] ...)) near the end of defn."
   [fdecl]
   (when (empty? fdecl)
@@ -325,10 +325,10 @@
                     (apply core/str))]
     (list* 'js* (core/str "[" strs "].join('')") xs)))

-(defn- bool-expr [e]
+(core/defn- bool-expr [e]
   (vary-meta e assoc :tag 'boolean))

-(defn- simple-test-expr? [env ast]
+(core/defn- simple-test-expr? [env ast]
   (core/and
     (#{:var :invoke :constant :dot :js} (:op ast))
     ('#{boolean seq} (cljs.analyzer/infer-tag env ast))))
@@ -674,7 +674,7 @@

 ;;; internal -- reducers-related macros

-(defn- do-curried
+(core/defn- do-curried
   [name doc meta args body]
   (core/let [cargs (vec (butlast args))]
     `(defn ~name ~doc ~meta
@@ -687,7 +687,7 @@
   [name doc meta args & body]
   (do-curried name doc meta args body))

-(defn- do-rfn [f1 k fkv]
+(core/defn- do-rfn [f1 k fkv]
   `(fn
      ([] (~f1))
      ~(clojure.walk/postwalk
@@ -705,7 +705,7 @@

 ;;; end of reducers macros

-(defn- protocol-prefix [psym]
+(core/defn- protocol-prefix [psym]
   (core/str (-> (core/str psym) (.replace \. \$) (.replace \/ \$)) "$"))

 (def #^:private base-type
@@ -806,10 +806,10 @@
   `(let [~name (js-this)]
      ~@body))

-(defn- to-property [sym]
+(core/defn- to-property [sym]
   (symbol (core/str "-" sym)))

-(defn- warn-and-update-protocol [p type env]
+(core/defn- warn-and-update-protocol [p type env]
   (when-not (= 'Object p)
     (if-let [var (cljs.analyzer/resolve-existing-var (dissoc env :locals) p)]
       (do
@@ -827,21 +827,21 @@
       (when (:undeclared cljs.analyzer/*cljs-warnings*)
         (cljs.analyzer/warning :undeclared-protocol-symbol env {:protocol p})))))

-(defn- resolve-var [env sym]
+(core/defn- resolve-var [env sym]
   (core/let [ret (-> (dissoc env :locals)
                    (cljs.analyzer/resolve-var sym)
                    :name)]
     (assert ret (core/str "Can't resolve: " sym))
     ret))

-(defn- ->impl-map [impls]
+(core/defn- ->impl-map [impls]
   (core/loop [ret {} s impls]
     (if (seq s)
       (recur (assoc ret (first s) (take-while seq? (next s)))
         (drop-while seq? (next s)))
       ret)))

-(defn- base-assign-impls [env resolve tsym type [p sigs]]
+(core/defn- base-assign-impls [env resolve tsym type [p sigs]]
   (warn-and-update-protocol p tsym env)
   (core/let [psym       (resolve p)
              pfn-prefix (subs (core/str psym) 0
@@ -860,11 +860,11 @@
 (core/defmethod extend-prefix :default
   [tsym sym] `(.. ~tsym -prototype ~(to-property sym)))

-(defn- adapt-obj-params [type [[this & args :as sig] & body]]
+(core/defn- adapt-obj-params [type [[this & args :as sig] & body]]
   (core/list (vec args)
     (list* 'this-as (vary-meta this assoc :tag type) body)))

-(defn- adapt-ifn-params [type [[this & args :as sig] & body]]
+(core/defn- adapt-ifn-params [type [[this & args :as sig] & body]]
   (core/let [self-sym (with-meta 'self__ {:tag type})]
     `(~(vec (cons self-sym args))
        (this-as ~self-sym
@@ -872,17 +872,17 @@
            ~@body)))))

 ;; for IFn invoke implementations, we need to drop first arg
-(defn- adapt-ifn-invoke-params [type [[this & args :as sig] & body]]
+(core/defn- adapt-ifn-invoke-params [type [[this & args :as sig] & body]]
   `(~(vec args)
      (this-as ~(vary-meta this assoc :tag type)
        ~@body)))

-(defn- adapt-proto-params [type [[this & args :as sig] & body]]
+(core/defn- adapt-proto-params [type [[this & args :as sig] & body]]
   `(~(vec (cons (vary-meta this assoc :tag type) args))
      (this-as ~this
        ~@body)))

-(defn- add-obj-methods [type type-sym sigs]
+(core/defn- add-obj-methods [type type-sym sigs]
   (map (fn [[f & meths :as form]]
          (core/let [[f meths] (if (vector? (first meths))
                                 [f [(rest form)]]
@@ -891,7 +891,7 @@
               ~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form)))))
     sigs))

-(defn- ifn-invoke-methods [type type-sym [f & meths :as form]]
+(core/defn- ifn-invoke-methods [type type-sym [f & meths :as form]]
   (map
     (fn [meth]
       (core/let [arity (count (first meth))]
@@ -899,7 +899,7 @@
            ~(with-meta `(fn ~meth) (meta form)))))
     (map #(adapt-ifn-invoke-params type %) meths)))

-(defn- add-ifn-methods [type type-sym [f & meths :as form]]
+(core/defn- add-ifn-methods [type type-sym [f & meths :as form]]
   (core/let [meths    (map #(adapt-ifn-params type %) meths)
              this-sym (with-meta 'self__ {:tag type})
              argsym   (gensym "args")]
@@ -914,7 +914,7 @@
              (meta form)))]
       (ifn-invoke-methods type type-sym form))))

-(defn- add-proto-methods* [pprefix type type-sym [f & meths :as form]]
+(core/defn- add-proto-methods* [pprefix type type-sym [f & meths :as form]]
   (core/let [pf (core/str pprefix f)]
     (if (vector? (first meths))
       ;; single method case
@@ -926,7 +926,7 @@
                 ~(with-meta `(fn ~(adapt-proto-params type meth)) (meta form))))
         meths))))

-(defn- proto-assign-impls [env resolve type-sym type [p sigs]]
+(core/defn- proto-assign-impls [env resolve type-sym type [p sigs]]
   (warn-and-update-protocol p type env)
   (core/let [psym      (resolve p)
              pprefix   (protocol-prefix psym)
@@ -943,7 +943,7 @@
               (add-proto-methods* pprefix type type-sym sig)))
           sigs)))))

-(defn- validate-impl-sigs [env p method]
+(core/defn- validate-impl-sigs [env p method]
   (when-not (= p 'Object)
     (core/let [var (ana/resolve-var (dissoc env :locals) p)
                minfo (-> var :protocol-info :methods)
@@ -963,7 +963,7 @@
               (ana/warning :protocol-invalid-method env {:protocol p :fname fname :invalid-arity c}))
             (recur (next sigs) (conj seen c))))))))

-(defn- validate-impls [env impls]
+(core/defn- validate-impls [env impls]
   (core/loop [protos #{} impls impls]
     (when (seq impls)
       (core/let [proto   (first impls)
@@ -1006,7 +1006,7 @@
         {:current-symbol type-sym :suggested-symbol (js-base-type type-sym)}))
     `(do ~@(mapcat #(assign-impls env resolve type-sym type %) impl-map))))

-(defn- prepare-protocol-masks [env impls]
+(core/defn- prepare-protocol-masks [env impls]
   (core/let [resolve  (partial resolve-var env)
              impl-map (->impl-map impls)
              fpp-pbs  (seq
@@ -1028,7 +1028,7 @@
                 parts
                 (range fast-path-protocol-partitions-count))]))))

-(defn- annotate-specs [annots v [f sigs]]
+(core/defn- annotate-specs [annots v [f sigs]]
   (conj v
     (vary-meta (cons f (map #(cons (second %) (nnext %)) sigs))
       merge annots)))
@@ -1050,13 +1050,13 @@
            (recur ret specs))
          ret)))))

-(defn- collect-protocols [impls env]
+(core/defn- collect-protocols [impls env]
   (->> impls
       (filter core/symbol?)
       (map #(:name (cljs.analyzer/resolve-var (dissoc env :locals) %)))
       (into #{})))

-(defn- build-positional-factory
+(core/defn- build-positional-factory
   [rsym rname fields]
   (let [fn-name (with-meta (symbol (core/str '-> rsym))
                   (assoc (meta rsym) :factory :positional))
@@ -1065,7 +1065,7 @@
        [~@fields]
        (new ~rname ~@field-values))))

-(defn- validate-fields
+(core/defn- validate-fields
   [case name fields]
   (when-not (vector? fields)
     (throw
@@ -1142,7 +1142,7 @@
        ~(build-positional-factory t r fields)
        ~t)))

-(defn- emit-defrecord
+(core/defn- emit-defrecord
   "Do not use this directly - use defrecord"
   [env tagname rname fields impls]
   (core/let [hinted-fields fields
@@ -1220,7 +1220,7 @@
          (~'defrecord* ~tagname ~hinted-fields ~pmasks
            (extend-type ~tagname ~@(dt->et tagname impls fields true)))))))

-(defn- build-map-factory [rsym rname fields]
+(core/defn- build-map-factory [rsym rname fields]
   (core/let [fn-name (with-meta (symbol (core/str 'map-> rsym))
                        (assoc (meta rsym) :factory :map))
              ms (gensym)
@@ -1534,7 +1534,7 @@
            ~gexpr ~expr]
        ~(emit gpred gexpr clauses))))

-(defn- assoc-test [m test expr env]
+(core/defn- assoc-test [m test expr env]
   (if (contains? m test)
     (throw
       #?(:clj (clojure.core/IllegalArgumentException.
@@ -1551,7 +1551,7 @@
                        cljs.analyzer/*cljs-file*))))))
     (assoc m test expr)))

-(defn- const? [env x]
+(core/defn- const? [env x]
   (core/let [m (core/and (core/list? x)
                          (ana/resolve-var env (last x)))]
     (core/when m (core/get m :const))))
@@ -1851,7 +1851,7 @@
         `(.fromArray cljs.core/PersistentHashSet (array ~@xs) true)
         assoc :tag 'cljs.core/PersistentHashSet))))

-(defn- js-obj* [kvs]
+(core/defn- js-obj* [kvs]
   (core/let [kvs-str (->> (repeat "~{}:~{}")
                        (take (count kvs))
                        (interpose ",")
@@ -1923,7 +1923,7 @@
            ~@body
            (recur (inc ~i)))))))

-(defn- check-valid-options
+(core/defn- check-valid-options
   "Throws an exception if the given option map contains keys not listed
   as valid, else returns nil."
   [options & valid-keys]
@@ -2012,7 +2012,7 @@

 (def cs (into [] (map (comp gensym core/str core/char) (range 97 118))))

-(defn- gen-apply-to-helper
+(core/defn- gen-apply-to-helper
   ([] (gen-apply-to-helper 1))
   ([n]
    (core/let [prop (symbol (core/str "-cljs$core$IFn$_invoke$arity$" n))
@@ -2120,14 +2120,14 @@
         (recur form' (ana/macroexpand-1 env form'))
         `(quote ~form')))))

-(defn- multi-arity-fn? [fdecl]
+(core/defn- multi-arity-fn? [fdecl]
   (core/< 1 (count fdecl)))

-(defn- variadic-fn? [fdecl]
+(core/defn- variadic-fn? [fdecl]
   (core/and (= 1 (count fdecl))
             (some '#{&} (ffirst fdecl))))

-(defn- variadic-fn*
+(core/defn- variadic-fn*
   ([sym method]
    (variadic-fn* sym method true))
   ([sym [arglist & body :as method] solo]
@@ -2159,7 +2159,7 @@
           (set! (. ~sym ~'-cljs$lang$applyTo)
             ~(apply-to)))))))

-(defn- variadic-fn [name meta [[arglist & body :as method] :as fdecl]]
+(core/defn- variadic-fn [name meta [[arglist & body :as method] :as fdecl]]
   (letfn [(dest-args [c]
             (map (fn [n] `(aget (js-arguments) ~n))
               (range c)))]
@@ -2192,7 +2192,7 @@
   (pp/pprint (variadic-fn 'foo {} '(([a [b & cs] & xs] xs))))
   )

-(defn- multi-arity-fn [name meta fdecl]
+(core/defn- multi-arity-fn [name meta fdecl]
   (letfn [(dest-args [c]
             (map (fn [n] `(aget (js-arguments) ~n))
               (range c)))


Fix generating stack levels

Fix generating stack levels

--- src/staplo/generator.cljs
+++ src/staplo/generator.cljs
@@ -58,10 +58,10 @@
          state-history (list start-state)]
     (let [op (generate-op-try op-seq state op-history state-history)]
       (cond
-        (nil? op) nil
         (zero? remaining) {:state state
                            :op-history op-history
                            :state-history state-history}
+        (nil? op) nil
         :else (let [new-state ((:operation op) state)]
                 (recur
                   new-state


Fixed default values for options

Fixed default values for options

--- src/video_server/main.clj
+++ src/video_server/main.clj
@@ -76,10 +76,10 @@
    ["-n" "--name NAME" "Server name"
     :default (.getHostName (InetAddress/getLocalHost))]
    [nil "--encode BOOL" "Automatically transcode videos and subtitles"
-    :default "true"
+    :default true
     :parse-fn #(Boolean/parseBoolean %)]
    [nil "--fetch BOOL" "Automatically retreive metadata from the Internet"
-    :default "true"
+    :default true
     :parse-fn #(Boolean/parseBoolean %)]
    ["-f" "--format EXT" "Output format: mkv, mp4, m4v"
     :default "mkv"
@@ -90,7 +90,7 @@
     :parse-fn #(Integer/parseInt %)
     :validate [#{480 720 1080 2160} "The size must be 480, 720, 1080 or 2160"]]
    ["-u" "--underscores BOOL" "Use underscores in generated filenames"
-    :default "false"
+    :default false
     :parse-fn #(Boolean/parseBoolean %)]
    [nil "--log-level LEVEL" "Override the default logging level"
     :parse-fn log-level
@@ -196,7 +196,9 @@
       (:help options) (exit 0 (usage summary))
       errors (exit 1 (str/join \newline errors)))
     (set-log-level (:log-level options))
-    (when-not (installed?) (exit 3 "ffmpeg not found on path."))
-    (when (:underscores options) (alter-var-root #'video-server.file/*use-underscores* (constantly true)))
+    (when-not (installed?)
+      (exit 3 "ffmpeg not found on path."))
+    (when (:underscores options)
+      (alter-var-root #'video-server.file/*use-underscores* (constantly true)))
     (.join (start arguments options))))


Four endpoints to export Glossary into JSON, text, XML, edn, and CSV formats

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -135,24 +135,54 @@
     (if-let [parameter-value (-> (:params request) (get parameter-name))]
             (clojure.string/trim parameter-value)))

+(defn read-boolean-parameter
+    [request parameter-name]
+    (if-let [parameter-value (-> (:params request) (get parameter-name))]
+            (= "true" (clojure.string/trim parameter-value))
+            false))
+
+(defn read-integer-parameter
+    [request parameter-name]
+    (if-let [parameter-value (-> (:params request) (get parameter-name))]
+            (Integer/parseInt (clojure.string/trim parameter-value))))
+
 (defn process-add-word
     "Add word provided by user (together with its description) to the blacklist or into atomic typos."
     [request title emender-page mode]
-    (println request)
-    (let [word         (read-string-parameter request "new-word")
-          description  (read-string-parameter request "description")
-          correct-form (read-string-parameter request "correct-word")
-          word-class   (read-string-parameter request "class")
-          internal     (read-string-parameter request "internal")
-          copyright    (read-string-parameter request "copyright")
-          source       (read-string-parameter request "source")
-          proper-word  (dictionary-interface/proper-word-for-blacklist? word)
-          user-name    (get-user-name request)
-          message      (add-word-message word proper-word)
-          sources      (db-interface/read-sources)]
-          (if (and proper-word (seq word))
-              (dictionary-interface/store-word word correct-form description user-name mode))
-        (finish-processing request nil sources nil message title emender-page mode)))
+    (clojure.pprint/pprint (:params request))
+    (if (= mode :glossary)
+        (let [word            (read-string-parameter request "new-word")
+              description     (read-string-parameter request "description")
+              correct-forms   (read-string-parameter request "correct-forms")
+              incorrect-forms (read-string-parameter request "incorrect-forms")
+              internal        (read-boolean-parameter request "internal")
+              copyright       (read-boolean-parameter request "copyright")
+              source          (read-integer-parameter request "source")
+              class           (read-string-parameter request "class")
+              use-it          (read-string-parameter request "use_it")
+              user-name       (get-user-name request)
+              message         (add-word-message word true)
+              classes         (db-interface/read-word-classes)
+              classes-map     (classes->map classes)
+              sources         (db-interface/read-sources)
+              sources-map     (sources->map sources)]
+              (if (seq word)
+                  (dictionary-interface/store-word word description class use-it internal copyright source correct-forms incorrect-forms user-name :glossary))
+            (finish-processing request nil sources-map classes-map message title emender-page :glossary))
+        (let [word         (read-string-parameter request "new-word")
+              description  (read-string-parameter request "description")
+              correct-form (read-string-parameter request "correct-word")
+              word-class   (read-string-parameter request "class")
+              internal     (read-string-parameter request "internal")
+              copyright    (read-string-parameter request "copyright")
+              source       (read-string-parameter request "source")
+              proper-word  (dictionary-interface/proper-word-for-blacklist? word)
+              user-name    (get-user-name request)
+              message      (add-word-message word proper-word)
+              sources      (db-interface/read-sources)]
+              (if (and proper-word (seq word))
+                  (dictionary-interface/store-word word correct-form description user-name mode))
+            (finish-processing request nil sources nil message title emender-page mode))))

 (defn process-add-words
     [request title emender-page mode]
@@ -423,6 +453,11 @@
             "/blacklist/xml"          (process-wordlist-xml  request :blacklist)
             "/blacklist/edn"          (process-wordlist-edn  request :blacklist)
             "/blacklist/csv"          (process-wordlist-csv  request :blacklist)
+            "/glossary/json"          (process-wordlist-json request :glossary)
+            "/glossary/text"          (process-wordlist-text request :glossary)
+            "/glossary/xml"           (process-wordlist-xml  request :glossary)
+            "/glossary/edn"           (process-wordlist-edn  request :glossary)
+            "/glossary/csv"           (process-wordlist-csv  request :glossary)
             ;"/delete-word"           (process-delete-word   request)
             ;"/undelete-word"         (process-undelete-word request)
             )))


add regularized cost

add regularized cost

--- src/mekena/reg-logistic-reg.clj
+++ src/mekena/reg-logistic-reg.clj
@@ -26,6 +26,11 @@

 (def lambda 1)

+(defn hypothesis
+  "sigmoid function: 1/(1+e^-z)"
+  [z]
+  (/ 1 (inc (Math/exp (- z)))))
+
 (defn map-features
   "Return vector containing powers that features will be used to generate
   the regularization parameter. map the features into all polynomial terms
@@ -44,5 +49,60 @@
   [xs]
   (let [x1 (i/sel qa-data :cols 0)
         x2 (i/sel qa-data :cols 1)
-        polynomial-terms (map-features 6)]
-    (regularize-features x1 x2 polynomial-terms)))
+        polynomial-terms (map-features 6)
+        regularized (regularize-features x1 x2 polynomial-terms)]
+    (-> x1
+        i/nrow
+        (repeat 1)
+        (i/bind-columns regularized))))
+
+; X : 118x28 theta is 28x1
+; test: (compute-cost (regularize qa-data) accepted (repeat 28 0))
+; 6.93e-01
+(defn compute-cost
+  "Calculate the cost of using theta (mse : mean square error):
+   J(θ) = −1/m(log(g(Xθ))^T.y + (log(1−g(Xθ)))^T.(1−y))
+   -1/m Sigma (1,m)[ y.log( h(theta.x) ) + (1 - y).log( 1 - h(theta.x) )]
+   input xs is dataset "
+  [xs y theta]
+  (let [theta-x      (i/mmult xs theta)
+        h-tx         (i/matrix-map hypothesis theta-x)
+        y-1-term     (i/mmult (i/trans (i/log h-tx)) y)
+        y-0-term     (i/mmult (i/trans (i/log (i/minus 1 h-tx))) (i/minus 1 y))
+        m            (count y)]
+    (-> y-1-term
+        (i/plus y-0-term)
+        (i/div (- m)))))
+
+(defn regularized-cost
+  "Compute the regularized cost, which adds the regularized parameter to the
+  logistic regression cost: adds λ/2m .Sigma j=(1,n) θj^2"
+  [xs y theta]
+  (let [cost (compute-cost xs y theta)]
+    (-> theta
+        ((juxt i/trans identity))
+        ((partial apply i/mmult))
+        (i/mult lambda)
+        (i/div (* 2 (count theta)))
+        (i/plus cost))))
+
+(defn calc-theta
+  "θ = θ − α/m.X^T.(g(Xθ)−y⃗ ))
+  Gradient descent is: theta - (alpha/m).x^T(g(x.theta) - y)
+  calculate an iteration"
+  [xs y theta]
+  (let [xs' (i/trans xs)]
+    (->> theta
+         (i/mmult xs)
+         (i/matrix-map hypothesis)
+         (i/minus y)
+         (i/mmult xs')
+         (i/mult alpha (/ -1 (count xs))))))
+
+(defn calc-next-theta
+  "calculate the next theta value"
+  [xs y theta]
+  (->> theta
+       (calc-theta xs y)
+       (i/minus theta)))
+


CMR-1396: Removing accidental capture-reveal call in the code.

--- dev-system/src/cmr/dev_system/control.clj
+++ dev-system/src/cmr/dev_system/control.clj
@@ -121,7 +121,6 @@
     ;; to do different things inside the system.
     (POST "/eval" {:keys [body]}
       (let [body-str (slurp body)]
-        (cmr.common.dev.capture-reveal/capture body-str)
         (debug (str "dev-system evaling [" body-str "]"))
         {:status 200
          :body (pr-str (eval (read-string body-str)))}))


Fix doc test.

Fix doc test.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -357,6 +357,11 @@

             :trigger/sync
             {:doc "A fully qualified, namespaced keyword pointing to a function on the classpath at runtime. This function takes the window contents as its argument. Its return value is ignored. This function is invoked when the trigger fires, and is used to do any arbitrary action with the window contents, such as sync them to a database."
+             :type :keyword
+             :optional? false}
+
+            :trigger/pred
+            {:doc "A fully qualified, namespaced keyword pointing to a function on the classpath at runtime. This function takes 5 arguments: the event map, this window-id, the lower bound of this window, the upper bound of this window, and the segment. This function should return true if the trigger should fire, and false otherwise."
              :type :keyword
              :optional? false}

@@ -920,7 +925,7 @@
    [:aggregation/init :aggregation/fn :aggregation/apply-state-update :aggregation/super-aggregation-fn]
    :trigger-entry
    [:trigger/window-id :trigger/refinement :trigger/on :trigger/sync
-    :trigger/period :trigger/threshold :trigger/fire-all-extents?
+    :trigger/period :trigger/threshold :trigger/pred :trigger/fire-all-extents?
     :trigger/doc]
    :lifecycle-entry
    [:lifecycle/task :lifecycle/calls :lifecycle/doc]


Add string generator note about utf-8

Add string generator note about utf-8

--- src/simple_check/generators.clj
+++ src/simple_check/generators.clj
@@ -260,6 +260,8 @@
 ;; String
 ;; ---------------------------------------------------------------------------

+;; TODO: make strings use the full utf-8 range
+
 (defn string
   [rand-seed size]
   (clojure.string/join (repeatedly size #(char rand-seed size))))


add app-bar support

add app-bar support


improve verbage

improve verbage

--- cljs-admin/tourneybot_admin/core.cljs
+++ cljs-admin/tourneybot_admin/core.cljs
@@ -287,9 +287,8 @@
           (when-not all-finished?
             (if one-game-left?
               (NextRoundSimulator teams games-for-this-round final-game-in-this-round simulated-scoreA simulated-scoreB)
-              [:p.msg
-                (str "When there is one game left in this round, you will be able to simulate "
-                     "the result of the last game in the table above.")]))
+              [:p.msg (str "When there is one game left in this round, you will be "
+                           "able to simulate the results of the last game here.")]))

           (when (and all-finished?
                      (not= swiss-round last-swiss-round-num))


Add an Accept header

Add an Accept header

--- test/icecap/rest_test.clj
+++ test/icecap/rest_test.clj
@@ -21,6 +21,7 @@
   [plan]
   (-> (mock/request :post "/v0/caps")
       (mock/content-type "application/edn")
+      (mock/header "Accept" "application/edn")
       (mock/body (str plan))))

 (deftest handler-tests


Test retrieve-build-definitions function error handling

--- test/build_mon/test/vso_api.clj
+++ test/build_mon/test/vso_api.clj
@@ -22,12 +22,26 @@
   (fn [url]
     (when (= stubbed-url url) response)))

-(fact "retrieve-build-definitions retrieves build definitions"
-      (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0"
-            stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"},
-                                                    {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}"
-            stub-response {:status 200 :body stub-json-body}
-            get-fn-stubbed (get-fn-stub-request expected-url stub-response)
-            vso-api (api/vso-api-fns get-fn-stubbed account project)]
-        ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"}
-                                                    {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))
+(facts "retrieve-build-definitions"
+       (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0"]
+         (fact "calls VSO api, parses response and extracts build definitions"
+               (let [stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"},
+                                    {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}"
+                     stub-response {:status 200 :body stub-json-body}
+                     get-fn-stubbed (get-fn-stub-request expected-url stub-response)
+                     vso-api (api/vso-api-fns get-fn-stubbed account project)]
+                 ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"}
+                                                             {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))
+         (fact "when response status is not 200, returns nil"
+               (let [stub-response {:status 503}
+                     get-fn-stubbed (get-fn-stub-request expected-url stub-response)
+                     vso-api (api/vso-api-fns get-fn-stubbed account project)]
+
+                 ((:retrieve-build-definitions vso-api)) => nil))
+         (fact "when response body cannot be parsed as JSON, returns nil"
+               (let [stub-response {:status 200 :body "~~INVALID_JSON~~"}
+                     get-fn-stubbed (get-fn-stub-request expected-url stub-response)
+                     vso-api (api/vso-api-fns get-fn-stubbed account project)]
+                 ((:retrieve-build-definitions vso-api)) => nil))))
+
+


Clarified testing :only in cast-all with either single column names or seq of names

--- test/semantic_csv/core_test.clj
+++ test/semantic_csv/core_test.clj
@@ -65,9 +65,17 @@
       (is (= (->> data
                   (cast-all ->int {:ignore-first true}))
              [["this" "that"] [1 2]])))
-    (testing "should work with :only"
+    (testing "should work with :only <seq>"
+      (is (= (->> data
+                  mappify
+                  (cast-all ->int {:only [:that]})
+                  first)
+             {:this "1" :that 2})))
+    (testing "should work with :only <colname>"
       (is (= (->> data
                   mappify
                   (cast-all ->int {:only :that})
                   first)
              {:this "1" :that 2})))))
+
+


Fixed incompatibility of aspect/1 with latest Ekeko.

--- damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
+++ damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
@@ -321,7 +321,7 @@
   ;see org.aspectj.weaver.World$TypeMap, consider configuring TypeMap.DONT_USE_REFS to avoid the weaver from discarding expandable types.
   (all
     (weaverworld ?world)
-    (equals ?typemap (-> ?world .getTypeMap .getMainMap))))
+    (equals ?typemap (seq (-> ?world .getTypeMap .getMainMap)))))

 (defn
@@ -447,11 +447,11 @@
     (equals ?set (-> ?aspect .getWorld .getCrosscuttingMembersSet))
     (equals
       ?members
-      (.get
-        (interop/get-invisible-field (class ^CrosscuttingMembersSet ?set)
-                                     (symbol "members")
-                                     ?set)
-        ?aspect))))
+      (seq (.get
+             (interop/get-invisible-field (class ^CrosscuttingMembersSet ?set)
+                                          (symbol "members")
+                                          ?set)
+             ?aspect)))))

 (defn


make test reporter print a list of failed tests in summary

--- test/unit/reporter.clj
+++ test/unit/reporter.clj
@@ -1,7 +1,8 @@
 ; Prettify test reports
 (ns unit.reporter
   (:require
-    [clojure.test :refer [report with-test-out inc-report-counter *testing-contexts* testing-contexts-str testing-vars-str *stack-trace-depth*]]
+    [clojure.test :refer [report with-test-out inc-report-counter *testing-contexts* *testing-vars*
+                          testing-contexts-str testing-vars-str *stack-trace-depth*]]
     [clojure.stacktrace :as stack]))

 ; Change the report multimethod to ignore namespaces that don't contain any tests.
@@ -21,23 +22,24 @@
 (def ansi-red "\u001B[31m")
 (def ansi-yellow "\u001B[33m")

-; Summary reporting with color
-(defmethod report :summary [m]
-  (try
-    (print ansi-bold)
-    (when (not (every? zero? [(:fail m) (:error m)]))
-      (print ansi-red))
+; Error reporting with color
+(def failed-tests (atom []))

-    (with-test-out
-      (println "\nRan" (:test m) "tests containing"
-               (+ (:pass m) (:fail m) (:error m)) "assertions.")
-      (println (:fail m) "failures," (:error m) "errors."))
+(defn testing-vars-short-str
+  "Returns a string representation of the current test."
+  []
+  (assert (= (count *testing-vars*) 1) "reporter doesn't know what to do in this case :/")
+  (str
+    (ns-name (:ns (meta (first *testing-vars*)))) "/"
+    (:name (meta (first *testing-vars*)))))

-    (finally
-      (print ansi-reset))))
+(defn add-failed-test!
+  []
+  (swap! failed-tests conj (testing-vars-short-str)))

-; Error reporting with color
 (defmethod report :fail [m]
+  (add-failed-test!)
+
   (try
     (print ansi-red)
     (with-test-out
@@ -53,6 +55,8 @@
       (print ansi-reset))))

 (defmethod report :error [m]
+  (add-failed-test!)
+
   (try
     (print ansi-red)
     (with-test-out
@@ -70,3 +74,26 @@

     (finally
       (print ansi-reset))))
+
+; Summary reporting with color
+(defmethod report :summary [m]
+  (try
+    (print ansi-bold)
+    (when (not (every? zero? [(:fail m) (:error m)]))
+      (print ansi-red))
+
+    (with-test-out
+      (println "\nRan" (:test m) "tests containing"
+               (+ (:pass m) (:fail m) (:error m)) "assertions.")
+      (println (:fail m) "failures," (:error m) "errors.")
+
+      ; print names of failed tests
+      (print ansi-reset)
+      (print ansi-red)
+      (println (clojure.string/join "\n" (distinct @failed-tests)))
+
+      ; clear a list of failed tests (important if tests are automatically rerun)
+      (reset! failed-tests []))
+
+    (finally
+      (print ansi-reset))))


Added posting from admin.

Added posting from admin.

--- src/portal_clj/routes/admin.clj
+++ src/portal_clj/routes/admin.clj
@@ -1,8 +1,14 @@
 (ns portal-clj.routes.admin
   (:require [compojure.core :refer :all]
+            [clojure.string :as string]
             [portal-clj.views.layout :as layout]
             [portal-clj.views.admin :as admin]
-            [portal-clj.models.user :as user]))
+            [portal-clj.models.user :as user]
+            [portal-clj.models.post :as post]))
+
+(defn sluggify [title]
+  (-> (string/lower-case title)
+      (string/replace #" " "-")))

 (defn with-session [template session]
   {:body template
@@ -13,6 +19,14 @@
         (with-session session)))

 (defn do-post [req]
+  (let [post (get req :params)]
+    (post/create! {:title (get post :title)
+                   :body (get post :post-content)
+                   :user_id (-> (get req :session) (get :user))
+                   :commentable 0
+                   :slug (sluggify (get post :title))
+                   :active 1
+                   :restricted 0}))
   (-> (layout/common (admin/post-post (get req :session)))
       (with-session (get req :session))))


basics of query composition

basics of query composition

--- src/sledge/db.clj
+++ src/sledge/db.clj
@@ -64,15 +64,55 @@
 ;; XXX async updates have to fit into this somehow eventually

 (defn query-adjunct [index adjunct-name string]
-  (let [tokenizer (:tokenize-query (get adjuncts adjunct-name))
+  (let [kw (keyword adjunct-name)
+        tokenizer (:tokenize-query (get adjuncts kw))
         tokens (tokenizer string)
-        adjunct-map (get (:adjuncts index) adjunct-name)
+        adjunct-map (get (:adjuncts index) kw)
         matches (map #(get adjunct-map %) tokens)]
     ;; return a collection of pathnames ordered by the number
     ;; of elements of matches that each appears within
-    (let [num-matches (fn [file]
-                        (count (filter #(contains? % file) matches)))]
-      (sort-by num-matches > (apply set/union matches)))))
+    (let [relevance (fn [file]
+                      (/ (count (filter #(contains? % file) matches))
+                         (count tokens)))]
+      (sort-by second >
+               (map (fn [f] [f (relevance f)])
+                    (apply set/union matches))))))
+
+(defmulti where (fn [index [op & args]] op))
+
+(defmethod where "like" [index [_ attr string]]
+  (query-adjunct index attr string))
+
+(defmethod where "=" [index [_ attr string]]
+  (let [likes (query-adjunct index attr string)
+        names @(:data index)]
+    (filter (fn [[path rel]]
+              (and (>= rel 1)
+                   (let [tags (get names path)]
+                     (= (get tags (keyword attr)) string))))
+	    likes)))
+
+;; We have a bunch of [pathname relevance] for each constituent term
+;; We want the pathnames that appear in all of the lists, with
+;; relevance computed as the product of that pathname's relevance
+;; in each constituent list
+
+(defmethod where "and" [index [_ & terms]]
+  (let [results (map #(into {} (where index %)) terms)
+        i (apply set/intersection (map #(set (keys %)) results))]
+    i))
+
+#_
+(defmethod thing-query "or" [[& terms] index]
+  (let [results (map #(thing-query % index) terms)]
+    (set/union results)))
+
+;; haven't considered numeric fields yet.  need to build some
+;; sorted-maps or similar
+
+#_
+(defmethod thing-query ">" [[_ attr value] index]
+ )

 ;; the main index maps from pathname to hash of tags


Fetch results incrementally from cursor.

--- src/sqls/jdbc.clj
+++ src/sqls/jdbc.clj
@@ -168,16 +168,14 @@

 (defn execute!
   "Execute SQL on connection.
-  This function should accept both row-returning and non-row-returning statements
-  (that this distinction is different than DML vs SELECT statements,
-  as some DML statements return rows).
-
+  This function should accept both row-returning and non-row-returning statements.
   This functions returns a cursor of query results or nil if this SQL command does not
   return rows."
   [^java.sql.Connection conn
    ^String sql]
   (assert (not= conn nil))
   (let [stmt (clojure.java.jdbc/prepare-statement conn sql)
+        _ (.setFetchSize stmt 128)
         has-result-set (.execute stmt)]
     (if has-result-set
       (clojure.java.jdbc/result-set-seq (.getResultSet stmt) :as-arrays? true)


Don't show column that references foreign table

--- src/tesq/core.clj
+++ src/tesq/core.clj
@@ -1,7 +1,9 @@
 (ns tesq.core
   (:require [tesq.config :refer [DB display-fields]]
 			[clojure.java.jdbc :as jdbc]
-			[clojure.string :refer [replace capitalize]]
+			[clojure.pprint :refer [pprint]]
+			[clojure.string :refer [replace capitalize trimr]]
+			[clojure.set :refer [difference]]
 			[compojure.core :refer [defroutes GET POST]]
 			[compojure.route :refer [resources not-found]]
 			[compojure.handler :refer [site]]
@@ -27,19 +29,37 @@
 	  s)))

+(defn trim-comma
+  "Remove comma from end of string (if present)."
+  [s]
+  (if (= \, (last s)) (apply str (butlast s)) s))
+
+
+(defn backtick
+  "Wrap string in backticks (`)."
+  [s]
+  (str "`" s "`"))
+
+
 (defn build-query
   "Given db & table, return query string that retrieves table data and
   looks up display fields from related tables."
   [dbname table]
-  (let [constraints (filter #(= table (:table_name %))(fk-constraints DB dbname))
-		sel (for [{:keys [referenced_table_name column_name]} constraints]
-			  (str ", " referenced_table_name "."
-				   (get display-fields referenced_table_name)
-				   " AS " column_name))
+  (let [constraints (filter #(= table (:table_name %)) (fk-constraints DB dbname))
+		all-columns (map :field (jdbc/query DB [(str "DESC " table)]))
+		non-lookup-columns (difference (set all-columns) (set (map :column_name constraints)))
+		related-tables (for [{:keys [referenced_table_name column_name]} constraints]
+						 (str referenced_table_name "."
+							  (backtick (get display-fields referenced_table_name))
+							  " AS " column_name "_lookup, "))
 		joins (for [{:keys [referenced_table_name referenced_column_name table_name column_name]} constraints]
 				(str " INNER JOIN " referenced_table_name " ON " table_name "." column_name
-					 " = " referenced_table_name "." referenced_column_name))]
-	(str "SELECT " table ".*" (apply str sel) " FROM " table (apply str joins))
+					 "=" referenced_table_name "." referenced_column_name))
+		table-clause (apply str
+							(concat
+							 (map #(str table "." (backtick %) ", ") non-lookup-columns)
+							 related-tables))]
+	(str "SELECT " (trim-comma (trimr table-clause)) " FROM " table (apply str joins))
 	))

@@ -47,7 +67,8 @@
   "Given table name, fetch all rows from database and return
   as HTML table."
   [dbname table]
-  (let [rows (jdbc/query DB [(build-query dbname table)])]
+  (let [_ (pprint (build-query dbname table))
+		rows (jdbc/query DB [(build-query dbname table)])]
 	(h/html
 	 [:p {:class "count"} (str (count rows) " rows found")]
 	 [:table
@@ -64,13 +85,6 @@
   "Returns list of table names for current db."
   []
   (map last (map first (vec (show-tables DB)))))
-
-
-(defn list-fields
-  "Returns list of fields for given table.
-  TODO: do this without string concat"
-  [table]
-  (jdbc/query DB [(str "DESC " table)]))

 (defn prettify


Make `update-size` event work with different types of shapes.

Thanks to the previously added `resize-dim` geom helpers.

--- src/uxbox/main/data/shapes.cljs
+++ src/uxbox/main/data/shapes.cljs
@@ -108,25 +108,14 @@

 (defn update-size
   "A helper event just for update the position
-  of the shape using the width and heigt attrs
-  instread final point of coordinates.
-
-  WARN: only works with shapes that works
-  with height and width such are ::rect"
-  [sid {:keys [width height] :as opts}]
-  (reify
-    udp/IPageUpdate
-    rs/UpdateEvent
-    (-apply-update [_ state]
-      (letfn [(resize [shape {:keys [width height] :as size}]
-                (let [x1 (:x1 shape)
-                      y1 (:y1 shape)]
-                  (assoc shape
-                         :x2 (+ x1 width)
-                         :y2 (+ y1 height))))]
-        (let [shape (get-in state [:shapes-by-id sid])
-              size (merge (geom/size shape) opts)]
-          (update-in state [:shapes-by-id sid] resize size))))))
+  of the shape using the width and height attrs
+  instread final point of coordinates."
+  [sid opts]
+  (reify
+    udp/IPageUpdate
+    rs/UpdateEvent
+    (-apply-update [_ state]
+      (update-in state [:shapes-by-id sid] geom/resize-dim opts))))

 (defn update-vertex-position
   [id {:keys [vid delta]}]


cosets.clj: keep cosets in order when compressing

--- clojure/org/gavrog/clojure/cosets.clj
+++ clojure/org/gavrog/clojure/cosets.clj
@@ -63,7 +63,7 @@
     (reduce (fn [[t p] w] (scan t p w (equiv 0))) [table equiv] subgens)))

 (defn- compressed-table [table equiv]
-  (let [reps (into #{} (filter #(= % (equiv %)) (keys table)))
+  (let [reps (into (sorted-set) (filter #(= % (equiv %)) (keys table)))
         rep-to-idx (into {} (map vector reps (range)))
         canon (comp rep-to-idx equiv)]
     (into {} (for [[i row] table :when (reps i)]


Refactor feature handling

Refactor feature handling

--- src/tobias/cv.clj
+++ src/tobias/cv.clj
@@ -68,19 +68,19 @@
   "Returns a normalized response for the features in the image"
   ([image]
    (get-features image [sightcorp microsoft]))
-
   ([image providers]
-   (let [merged-channels (->> providers
-                              (map (fn [provider]
-                                     (async/thread
-                                       (timed (name provider)
-                                              (->> image
-                                                   (features provider)
-                                                   (extract-json-body)
-                                                   (normalize provider))))))
-                              (async/merge))
-         one (first (async/<!! merged-channels))
-         two (first (async/<!! merged-channels))
-         combined-results (merge one two)]
-     (prn combined-results)
-     (conj [] combined-results))))
+   (let [timed-features (fn [provider]
+                          (async/thread
+                            (timed (name provider)
+                                   (->> image
+                                        (features provider)
+                                        (extract-json-body)
+                                        (normalize provider)))))]
+     (->> providers
+          (map timed-features)      ; do the call
+          (async/merge)             ; merge into single channel
+          (vector)                  ; put channel into vector for mapping
+          (async/map first)         ; only get the first person from each result if multiple
+          (async/reduce merge {})   ; merge results
+          (async/into [])           ; conj results into vector
+          (async/<!!)))))


Change the default on queue size that was much too low

--- src/io/cyanite/engine/queue.clj
+++ src/io/cyanite/engine/queue.clj
@@ -12,7 +12,7 @@

 (defonce workers 4)
-(defonce default-capacity (int 1024))
+(defonce default-capacity (int 1048576))

 (defprotocol QueueEngine
   (shutdown! [this])


DM + GR #107 - Front end test for validation messages on writer note form posts

--- test/objective8/integration/front_end/validations.clj
+++ test/objective8/integration/front_end/validations.clj
@@ -177,3 +177,45 @@
           "Jenny"                          "invalid-email" "a reason"                        "clj-writer-email-invalid-error"
           "Jenny"                          "a@b.com"       ""                                "clj-writer-reason-empty-error"
           "Jenny"                          "a@b.com"       (ih/string-of-length 5001)        "clj-writer-reason-length-error")))
+
+(tabular
+ (facts "about writer notes"
+        (binding [config/enable-csrf false
+                  the-user           writer-for-objective]
+          (fact "validation errors are reported on the questions dashboard"
+                (against-background
+                 (http-api/retrieve-questions OBJECTIVE_ID anything) => {:status ::http-api/success
+                                                                         :result [{}]}
+                 (http-api/retrieve-answers anything anything) => {:status ::http-api/success
+                                                                   :result [{:uri "/answer/uri"}]})
+                (-> user-session
+                    ih/sign-in-as-existing-user
+                    (p/request (utils/path-for :fe/post-writer-note)
+                               :request-method :post
+                               :params {:note ?note
+                                        :note-on-uri "/answer/uri"
+                                        :refer (utils/local-path-for :fe/dashboard-questions :id OBJECTIVE_ID)})
+                    p/follow-redirect
+                    :response
+                    :body) => (contains ?expected-error-message))
+
+          (fact "validation errors are reported on the comments dashboard"
+                (against-background
+                 (http-api/get-all-drafts anything) => {:status ::http-api/success
+                                                        :result [{:_created_at "2015-04-04T12:00:00.000Z"}]}
+                 (http-api/get-comments anything anything) => {:status ::http-api/success
+                                                               :result [{:uri "/comment/uri"
+                                                                         :_created_at "2015-01-01T01:01:00.000Z"}]})
+                (-> user-session
+                    ih/sign-in-as-existing-user
+                    (p/request (utils/path-for :fe/post-writer-note)
+                               :request-method :post
+                               :params {:note ?note
+                                        :note-on-uri "/comment/uri"
+                                        :refer (utils/local-path-for :fe/dashboard-comments :id OBJECTIVE_ID)})
+                    p/follow-redirect
+                    :response
+                    :body) => (contains ?expected-error-message))))
+
+ ?note     ?expected-error-message
+ ""        "clj-writer-note-empty-error")


Require war roots to be on the classpath of the application.

--- src/appengine_magic/core.clj
+++ src/appengine_magic/core.clj
@@ -14,12 +14,15 @@
 ;;; servlet, or deploy to App Engine.

-(defmacro def-appengine-app [app-var-name handler war-root]
-  `(def ~app-var-name
-        (let [handler# ~handler
-              war-root# ~war-root]
-          {:handler (wrap-file (environment-decorator handler#) (str war-root#))
-           :war-root war-root#})))
+;;; TODO: When Clojure 1.2 comes out, change this to use the destructuring
+;;; syntax for keyword arguments, if it works with macros.
+(defmacro def-appengine-app [app-var-name handler & [args]]
+  (let [{:keys [war-root] :or {war-root "war"}} args]
+    `(def ~app-var-name
+         (let [handler# ~handler
+               war-root# (-> (clojure.lang.RT/baseLoader) (.getResource ~war-root) .getFile)]
+           {:handler (wrap-file (environment-decorator handler#) war-root#)
+            :war-root war-root#}))))

 ;;; TODO: When Clojure 1.2 comes out, change this to use the destructuring


pmap for speed

pmap for speed

--- src/babel/espanol/writer.clj
+++ src/babel/espanol/writer.clj
@@ -56,7 +56,7 @@
                    (log/trace (str "verb: " (strip-refs verb)))
                    (let [root-form (get-in verb [:espanol :espanol])]
                      (log/info (str "generating with verb: '" root-form "'"))
-                     (.size (map (fn [tense]
+                     (.size (pmap (fn [tense]
                                    (let [spec (unify {:root {:espanol {:espanol root-form}}}
                                                      tense)]
                                      (.size


[inbox] Add clarifying comment

[inbox] Add clarifying comment

--- src/braid/page_inbox/ui.cljs
+++ src/braid/page_inbox/ui.cljs
@@ -65,6 +65,6 @@
      [:div.intro
       (:intro group)
       [clear-inbox-button-view]]
-     ^{:key group-id}
+     ^{:key group-id} ;; necessary to prevent component-reuse when switching groups
      [threads-view {:new-thread-view [new-thread-view {:group-id group-id}]
                     :threads open-threads}]]))


Add format-source-code fn to common.

Add format-source-code fn to common.

--- src/cadence/views/common.clj
+++ src/cadence/views/common.clj
@@ -1,5 +1,6 @@
 (ns cadence.views.common
-  (:require [clojure.string :as string]
+  (:require (clojure [string :as string]
+                     [pprint :as pp])
             [cemerick.friend :as friend]
             [ring.util.anti-forgery :refer [anti-forgery-metas]]
             [cadence.model :as m]
@@ -7,7 +8,20 @@
             [cadence.security :refer [admin?]]
             [noir.validation :as vali]
             [cadence.model.flash :as flash])
-  (:use (hiccup core def page)))
+  (:use (hiccup core def page))
+  (:import (java.io StringWriter)))
+
+
+(defn format-source-code [form]
+  (let [string-writer (StringWriter.)]
+    (pp/write form
+              :dispatch pp/code-dispatch
+              :stream string-writer
+              :pretty true)
+    (->> (str string-writer)
+         string/split-lines
+         (map #(str "  " %))
+         (string/join "\n"))))

 (defn base-layout [& content]
   (html5


refactored OLS regression to run on a text file, using cascalog

--- src/clj/forma/playground.clj
+++ src/clj/forma/playground.clj
@@ -101,18 +101,19 @@
     "converts a text line of numbers to a float vector."
     (vector (map #(Float. %) (s/split txtln #" "))))

+(defn time-cofactors [pd]
+    "creates a pd x 2 matrix of ones and incremental timeseries"
+    (let [ones (i/trans (i/matrix 1 1 pd))
+          ind (i/trans [(map inc (range pd))])]
+        (i/bind-columns ones ind)))

-(defn test-mult
-  [m pd]
-  (let [row (vector m)
-        col (i/trans row)
-        ones (i/trans (i/matrix 1 1 pd))
-        ind (i/trans [(map inc (range pd))])
-        X (i/bind-columns ones ind)
-        Xt (i/trans X)
-        ssX (i/solve (i/mmult Xt X))
-        beta (i/mmult ssX (i/trans X) col)]
-    (vector (i/sel beta 1 0))))
+(defn ols
+    "OLS timeseries regression on a sequence m, with intercept"
+    [m pd]
+    (let [y-col (i/trans (vector m))
+        X (time-cofactors pd)
+        ssX (i/solve (i/mmult (i/trans X) X))]
+    (vector (i/sel (i/mmult ssX (i/trans X) y-col) 1 0))))

 (defn wordcount
@@ -120,4 +121,4 @@
     (?<- (stdout) [?sum]
         ((hfs-textline path) ?line)
         (text->num ?line :> ?vector)
-        (test-mult ?vector pd :> ?sum)))+        (ols ?vector pd :> ?sum)))


Remove automatic on delete to avoid killing conventions with content

--- src/clj/herder/web/lobos.clj
+++ src/clj/herder/web/lobos.clj
@@ -15,7 +15,7 @@
   (let [cname (-> (->> ptable name butlast (apply str))
                   (str "_id")
                   keyword)]
-    (uuid table cname [:refer ptable :id :on-delete :set-null])))
+    (uuid table cname [:refer ptable :id])))

 (defmacro tbl [name & elements]
   `(-> (table ~name


nicer shadow

nicer shadow

--- src/clj/just_married/css.clj
+++ src/clj/just_married/css.clj
@@ -135,7 +135,7 @@
                        :line-height ".1em"
                        :margin-right ".25em"
                        :vertical-align "-.2em"
-                       :box-shadow "0 0 20px #999c"}]
+                       :box-shadow (format "0 0 20px %s" (:dark-red COLOR-PALLETTE))}]

    [:app {:background-color (:marsala COLOR-PALLETTE)}]
    ;; maybe the image containing the rest should actually be an element


Updating app-state.cljs with kludge to display a modal.

--- src/cljs/y_om/app-state.cljs
+++ src/cljs/y_om/app-state.cljs
@@ -12,17 +12,38 @@
                                                         :id 0}]
                                  :state {:add-header? false
                                          :add-card? false
-                                         :card-modal {:display true
-                                                      :id 0}}}
+                                         :card-modal {:display false
+                                                      :id 10}}}
                                 {:name "Doing" :cards [{:task "Drag Lists"
                                                         :id 1}
                                                        {:task "Drag Cards"
-                                                        :id 1}
+                                                        :id 2}
                                                        {:task "Make it look pretty"
-                                                        :id 1}
-                                                       {:task "Handle Resizing`"}]
-                                 :state {:add-header? true
-                                         :add-card? false}}
+                                                        :id 3}
+                                                       {:task "Handle Resizing"
+                                                        :id 10}
+                                                       {:task "placeholder"
+                                                        :id 11}
+                                                       {:task "placeholder"
+                                                        :id 12}
+                                                       {:task "placeholder"
+                                                        :id 13}
+                                                       {:task "placeholder"
+                                                        :id 14}
+                                                       {:task "placeholder"
+                                                        :id 15}
+                                                       {:task "placeholder"
+                                                        :id 16}
+                                                       {:task "placeholder"
+                                                        :id 17}
+                                                       {:task "placeholder"
+                                                        :id 18}]
+                                 :state {:add-header? false
+                                         :add-card? false
+                                         :card-modal {:display false
+                                                      :id 0}}}
                                 {:name "Done" :cards []
                                  :state {:add-header? false
-                                         :add-card? false}}]}))
+                                         :add-card? false
+                                         :card-modal {:display false
+                                                      :id 0}}}]}))


Another exclude-nses.

Another exclude-nses.

--- src/leiningen/droid/compile.clj
+++ src/leiningen/droid/compile.clj
@@ -56,7 +56,7 @@
         (group-by #(instance? Pattern %) include)

         {exclude-nses false, exclude-regexps true}
-        (group-by #(instance? Pattern %) exclude)]
+        (group-by #(instance? Pattern %) exclude-nses)]
     (->> (set/difference (set (map str (if (seq include-regexps)
                                          all-nses include-nses)))
                          (set exclude-nses))


Support backslashes in resource path (adds windows support)

--- src/leiningen/less/compiler.clj
+++ src/leiningen/less/compiler.clj
@@ -2,7 +2,8 @@
   (:refer-clojure :exclude [compile])
   (:require (leiningen.less [nio :as nio]
                             [engine :as engine])
-            [clojure.java.io :as io])
+            [clojure.java.io :as io]
+            [clojure.string :as string])
   (:import [java.nio.file Path]
            (java.io IOException)
            (javax.script ScriptEngineManager ScriptEngine ScriptContext)
@@ -20,12 +21,17 @@
   (engine/eval! (io/resource less-js) less-js)
   (engine/eval! (io/resource lessc-js) lessc-js))

+(defn escape-string
+  [s]
+  (-> s str (string/replace #"\\" "\\\\\\\\")))

 (defn compile-resource
   "Compile a single less resource."
   [src dst]
   (nio/create-directories (nio/parent dst))
-  (engine/eval! (format "lessc.compile('%s', '%s');" (nio/absolute src) (nio/absolute dst))))
+  (engine/eval! (format "lessc.compile('%s', '%s');"
+                        (escape-string (nio/absolute src))
+                        (escape-string (nio/absolute dst)))))

 (defn compile-project


playing with styles!!

playing with styles!!

--- src/cljs/dashboard_clj/widgets/line_chart.cljs
+++ src/cljs/dashboard_clj/widgets/line_chart.cljs
@@ -11,7 +11,15 @@

 (def line-chart-config
   {:chart {:type "column"
-           :backgroundColor "transparent" }})
+           :backgroundColor "transparent"
+           :renderTo "container"
+           :style {:labels {
+                            :fontFamily "monospace"
+                            :color "#FFFFFF"}}}
+   :yAxis {:title {:text "Commits"
+                   :style {:color "#000000"}}
+           :labels { :color "#ffffff"}}
+   :xAxis {:labels {:style {:color "#fff"}}}})

 (defn plot-line [this]


Don't plan on adding ST support in the near future

--- src/cljs/koeeoadi/components/themeactions.cljs
+++ src/cljs/koeeoadi/components/themeactions.cljs
@@ -173,7 +173,9 @@
         (dom/button #js {:className "export-button"
                          :onClick #(export-theme-file current-theme :vim)} "Vim (GUI only)")

-        (dom/button #js {:className "export-button"
-                         :onClick #(tb/build-sublime-text)} "Sublime Text")))))
+        ;;;; Wishful thinking
+        ;; (dom/button #js {:className "export-button"
+        ;;                  :onClick #(tb/build-sublime-text)} "Sublime Text")
+        ))))

 (def theme-actions (om/factory ThemeActions))


Make the design a bit more palatable

Make the design a bit more palatable

Roughly put the elements in the right places. Very roughly. There are no
colours, yet.

--- src/theatralia/welcome_page.clj
+++ src/theatralia/welcome_page.clj
@@ -2,12 +2,14 @@
   (:require [net.cgrand.enlive-html :as html]
             [garden.core :refer [css]]
             [garden.stylesheet :refer [at-font-face]]
+            [garden.units :as u]
             [clojure.string :as string]
             [clojure.java.io :as io]))
 ;;; Credits:
 ;;;  - https://github.com/cgrand/enlive
 ;;;  - https://github.com/swannodette/enlive-tutorial/
 ;;;  - http://clojurewebdev.com/workshop/slides/
+;;;  - http://stackoverflow.com/questions/15193848/i-want-my-label-to-vertically-align-with-my-input-field
 ;;;  - http://www.w3schools.com/css/default.asp

 (def ^:private main-html (io/resource "templates/around.html"))
@@ -29,9 +31,6 @@
   [:#main-content] (html/content (welcome-snippet))
   [:#global-tools] (html/content (login-snippet)))

-(def css-data [[:html {:font-family "sans-serif"}]
-               [:#theatralia {:font-family "fancy"}]
-               [:#login {:float "right"}]])
 (def ^:private css-map-for-style
   {\R {}
    \B {:font-weight "bold"}
@@ -56,6 +55,20 @@
     (build-font-css "my-sans" "/fonts" "LinBiolinum" ["R" "RB" "RI"])
     (build-font-css "my-serif" "/fonts" "LinLibertine" ["R" "RB" "RI" "RBI"])))

+(def ^:private css-data
+  (concat
+    font-declaration
+    [[:* {:font-family "my-sans"}]
+     [:.theatralia {:font-family "my-serif" :font-weight "bold"}]
+     [:#main-content {:float "left"}]
+     [:p {:max-width (u/ch 65)}]
+     [:#global-tools {:float "left"}]
+     [:label :input {:display "block"}]
+     [:footer {:clear "both"
+               :text-align "center"
+               :font-size "small"
+               :padding-top (u/ex 2)}]]))
+
 (defn main-css []
   {:status 200
    :headers {"Content-Type" "text/css"}


Emoji routing

Emoji routing

--- test/cljc/reitit/core_test.cljc
+++ test/cljc/reitit/core_test.cljc
@@ -102,6 +102,7 @@
                             ["/files/file-{name}.html" ::html]
                             ["/files/file-{name}.json" ::json]
                             ["/{eskon}/{saum}/pium\u2215paum" ::loru]
+                            ["/{🌈}🤔/🎈" ::emoji]
                             ["/extra-end}s-are/ok" ::bracket]]
                            {:router r})
                   by-path #(-> router (r/match-by-path %) ((juxt (comp :name :data) :path-params)))]
@@ -121,6 +122,7 @@
               (is (= [::html {:name "10"}] (by-path "/files/file-10.html")))
               (is (= [::loru {:eskon "viitan", :saum "aa"}] (by-path "/viitan/aa/pium\u2215paum")))
               (is (= [nil nil] (by-path "/ei/osu/pium/paum")))
+              (is (= [::emoji {:🌈 "brackets"}] (by-path "/brackets🤔/🎈")))
               (is (= [::bracket {}] (by-path "/extra-end}s-are/ok")))))

           (testing "invalid syntax fails fast"


fix: incomplete no-state persistence

fix: incomplete no-state persistence

--- src/main/clojure/pdok/featured/persistence.clj
+++ src/main/clojure/pdok/featured/persistence.clj
@@ -404,7 +404,11 @@
     this)
   (flush [this]
     this)
-  (child-collections [this parent-collection]
+  (collections [persistence]
+    #{})
+  (create-collection [persistence collection parent-collection]
+    nil)
+  (child-collections [persistence parent-collection]
     nil)
   (stream-exists? [persistence collection id]
     false)


Fix logging

Fix logging

--- src/whisper2cyanite/logging.clj
+++ src/whisper2cyanite/logging.clj
@@ -4,7 +4,12 @@
             [clojure.tools.logging :as log]
             [org.spootnik.logconfig :as logconfig]))

-(logconfig/start-logging! {:level "off" :console false :files ""})
+(defn disable-logging!
+  "Disable logging."
+  []
+  (logconfig/start-logging! {:level "off" :console false :files ""}))
+
+(disable-logging!)

 (def ^:const default-log-file "whisper2cyanite.log")
 (def ^:const default-log-level "info")
@@ -19,9 +24,10 @@
   (swap! print-log? (fn [_] (:disable-progress options @print-log?)))
   (swap! disable-log? (fn [_] (:disable-log options @disable-log?)))
   (swap! stop-on-error? (fn [_] (:stop-on-error options @stop-on-error?)))
-  (logconfig/start-logging!
-   {:level (:log-level options default-log-level)
-    :files [(:log-file options default-log-file)]}))
+  (if-not @disable-log?
+    (logconfig/start-logging! {:level (:log-level options default-log-level)
+                               :files [(:log-file options default-log-file)]})
+    (disable-logging!)))

 (defn info-always
   "Always log info."


Add comment on doing schema concat inside resolver

--- src/graphql_clj/resolver.clj
+++ src/graphql_clj/resolver.clj
@@ -18,7 +18,7 @@
       (match/match
        [type-name field-name]
        [root-query-name "__schema"] (fn [context parent & args]
-                                      {:types (concat (vals (:types schema))
+                                      {:types (concat (vals (:types schema)) ;; TODO do this in the outer loop, not the inner
                                                       ;; Work around for graphiql to treat interface as type.
                                                       (vals (:interfaces schema))
                                                       ;; Work around for graphiql to treat enum as type.


checked a timed-out prisoner

checked a timed-out prisoner

--- test/acceptance/push_prison.clj
+++ test/acceptance/push_prison.clj
@@ -53,217 +53,22 @@
 (def prisoners
   [
   ;; caught exception: java.lang.Exception: Push Parsing Error: Cannot interpret '' as a Push item. running
-    {
-    :program  [
-      #{\$
-      [4583 1557 2337 3923 3334 3216 446]
-      :set-savestack
-      :set-cutstack
-      '(:booleans-concat :chars-byexample :refs-print :integer-store :circle-nested?)
-      ["§i" "zÀEi/b^" "0KuÉ" "^ÁISkk"]
-      '(false #{:integer-multiply :string-occurrencesofchar :integers-set [\Ä \M \1 \®] :code-do*times :log-stackdepth false 968965594} #{:integer-sign "¦ÀË&" :code-againlater \j :line-cutflip :integers-reverse [\V \i] (:line-intersect? :boolean-echo :float-ln [2771 1622 979] true)} :set-comprehension ([0.01953125 0.09765625 0.12109375 0.02734375 0.125] :booleans-last 293.9921875 781196427 (:string-equal? [] :strings-pop :float-later :boolean-flipstack)))
-      '([true false false] :booleans-emptyitem? :chars-stackdepth [1670 2863 811 1721 1980 2937 3949 4074 3979] [\¾ \µ \Ð \e  \m \¥])
-      }
-      :string-echoall
-      :tagspace-new
-      :booleans-portion
-      [0.1484375 0.09765625 0.0625]
-      :point-stackdepth
-      :floats-rotate
-      :strings->code
-      :integer->float
-      []
-      :char-dup
-      :booleans-echo
-      :integer-echoall
-      \@
-      :set-cycler
-      :char-savestack
-      [true false true true false true false]
-      :ref-swap
-      :floats-savestack
-      :char-flipstack
-      :code-notequal?
-      :code-liftstack
-      :string-echoall
-      :ref-cutflip
-      :line-later
-      [true]
-      true
-      337.3203125
-      '(:float-arccosine [0.06640625 0.11328125 0.1328125 0.0703125] true #{217.6171875 [] :boolean-swap \K :chars-swap #{:booleans->code [true false false true] :set-dup [4608] :tagspace-echoall :input!4 :string-yank ["=QAÒ7" "|*/Ñ]2£" "QIGLÎK" ":tJm·½aÆ" "¶{ÓU" "b" "&3F|¾!&([º´±teÂ"]} 70912956 :tagspace-return-pop} 86.1875)
-      [true false false false]
-      :string-store
-      :floats-butlast
-      :circle-later
-      :generator-reset
-      '(false 133.625 :input!10 #{:point-storestack 173.9609375 :line->points :vector-concat ["8ª-ÁÎabµ¬oÍFÉzs1" "eÐe" "_È[Nºf" "F»2Ð?<*um" "ºR#~KÇoº" ">Fn5P" "ÏP¢f)ÓnfM4¡2zÍ®"] :vector-sampler (:floats-echoall :strings-replace :exec-comprehension :circle-storestack :exec-comprehension) :chars-contains?} :circle-tangent?)
-      :input!8
-      :char-echoall
-      :log-stackdepth
-      []
-      "XC"
-      :floats-storestack
-      '([3568 186 3747 1426] false [\space \¿ \Æ] :line-intersect? :booleans-stackdepth)
-      :booleans-length
-      :vector-echo
-      :integer-notequal?
-      :float-liftstack
-      :integers-build
-      :integer-few
-      ["£-ÈÌE|ZN" "¾#&hµiW}#(~" "BÏ"]
-      :input!4
-      :string-storestack
-      :strings-cutstack
-      :chars-reverse
-      [0.07421875 0.12109375 0.015625 0.125 0.0859375 0.12109375]
-      :float->asciichar
-      :exec-noop
-      [false false]
-      '(["f¯Q8"] :point-cutstack "EÔ¢5D¶K5Ge!b" :strings-rerunall :integers-comprehension)
-      :exec-save
-      true
-      :float-π
-      :tagspace-lookupintegers
-      :code-notequal?
-      :code-if
-      :push-counter
-      [0.09375 0.078125 0.0546875 0.04296875 0.12890625]
-      :generator-save
-      :booleans-portion
-      72984301
-      :chars-conj
-      :refs-print
-      :refs-return
-      :input!1
-      [0.0625 0.078125 0.10546875 0.06640625 0.1484375]
-      false
-      600895337
-      false
-      :chars-pop
-      :exec-pop
-      '(:code-empty? [false false false true true true] :input!4 :exec-return-pop :code-append)
-      ["EË" " q6Ó" "²k¢©," "(ÄÕÂWIGLV%/®rl" "qvDÉdtRm=S³6P"]
-      298.265625
-      ["¿" "¯lu Å} T"]
-      '(true :floats-yank "kHSJUµa1f-" :refs-echo :integer-flush)
-      :input!8
-      "_fR¾5Ä^O6¬)"
-      :ref-flush
-      :booleans-storestack
-      :refs-set
-      #{46.796875 :refs-stackdepth :generator-savestack "R-Rz5(ÒÒQs*ÄF)°b" [2263 4020 2897] "^b!gAyº¥!J" :integers-dup :integers-flush}
-      false
-      :ref-cutstack
-      :exec-s
-      :chars-againlater
-      :input!1
-      false
-      :float-store
-      :refs-echo
-      :circle-store
-      [\Q \È \É \ª \· ]
-      :string-replace
-      [true]
-      :ref-flush
-      ["Vev5" "±'?cH%±;Y«_g" "?<vvy|z1&" "Ð¬¦h%°n=j$^ÑsÒ"]
-      \~
-      [true true false true]
-      [\ \L]
-      :string-occurrencesofchar
-      [0.03125 0.125 0.09765625 0.04296875 0.0234375 0.015625 0.1328125 0.11328125]
-      :input!1
-      "¶NYTi{®»"
-      :integers-butlast
-      :integers-empty?
-      "Ï&:¢6¿[/®¶f!Ãa"
-      :strings-butlast
-      [\ \À \Õ \o \ \R]
-      '("¸y" false :integer-echoall :set-tagwithinteger #{:float->boolean (:refs-take :chars-shove :string-solid? :line-equal? :chars-echo) :refs-tagwithinteger true :strings-yank [false true false false true true false false] :chars-shatter :point-save})
-      384.69140625
-      :floats-againlater
-      :strings-occurrencesof
-      :exec-s
-      302.1171875
-      '(:refs-notequal? [307 3657 2041] ["T³" "0³_Æeq" "S²dÇReI¬,·" "ÆÍs~³u³¾¿»"] true :code-drop)
-      #{67.1484375 :float->boolean :float-dup :char-pop :code-cons :code-savestack :chars-shatter :chars-nth}
-      :input!7
-      '(#{:exec-do*count :string-flush :boolean-liftstack :tagspace-cutflip :float-store true ("$9#±r=Y~" :point-equal? :tagspace-liftstack ["nÊb^w" "ÁElÅsm¸"] (false :float-subtract "8" :circle-cutstack "ºs«VW¶_Ç")) (:floats-notequal? [0.125 0.09375 0.05078125 0.00390625 0.08203125 0.0546875 0.0703125 0.05859375] [\Q \ \½ \Y] [] :integers-build)} :float-dec :refs-shatter :tagspace->code :input!9)
-      :refs-contains?
-      ["¤LªÏAÁ" "É¥¾" "¾<="]
-      :generator-yankdup
-      "1PC"
-      [0.02734375 0.015625]
-      :string-max
-      "r]$pSsÒÈ¿²j"
-      [0.13671875]
-      ["ÍuP4Ge'¼" "_k¨SJaAS" "Êtbªd" "&7" "KyFN&¾©33ÌNÓ©UÈ_"]
-      :refs-notequal?
-      :char-rotate
-      305.13671875
-      :float-pop
-      [4204 845]
-      317.359375
-      []
-      :boolean-pop
-      :string->chars
-      [0.1015625 0.02734375 0.078125 0.01953125 0.02734375 0.11328125]
-      "V°7·ª)7ÑEIÌ6©©>"
-      [0.05078125 0.10546875 0.09765625 0.05859375 0.125 0.02734375 0.09765625 0.078125 0.0390625]
-      :code-list
-      :input!4
-      [\Ç \ \P \r \ \W \L \ \.]
-      :boolean-againlater
-      []
-      '(:floats-tagwithfloat false true ["ÆÊµD]}4h}lU¤ov"] :tagspace-swap)
-      [true true true]
-      :circle-pop
-      :strings-yankdup
-      :chars-yank
-      :floats-last
-      false
-      :point-shove
-      :generator-swap
-      [1503 3111 137 3857 1450 2230 4309]
-      :refs-return
-      :tagspace-shove
-      :chars-concat
-      :booleans-flush
-      :vector-replacefirst
-      \j
-      :boolean-flush
-      342.3359375
-      #{:environment-new "Ê'J" :integer->string true :ref-rerunall false [false false] :booleans-tagwithinteger}
-      :vector-echoall
-      :code-store
-      :generator-totalisticint3
-      '((:strings-conj :code-yankdup "ZWIpJB¾-" \m :line-storestack) [false true false true true false false true false] 307.1796875 [4032 3293] [879 4021 678 982])
-      :chars-swap
-      :integer-lots
-      :generator-shove
-      :generator-stepper
-      :char≤?
-      [\ \Ì \ \Ð \® \Ð ]
-      :char<?
-      :float-store
-      :float-shove
-      :chars-indexof
-      [3955 673 4344 2442 475 327 264 1558]
-      :integer-later
-      [0.0 0.12109375 0.01953125 0.0859375 0.09375 0.078125 0.0625 0.0234375]
-      [0.015625]
-      '([0.07421875 0.04296875 0.0 0.1015625 0.015625 0.015625 0.01171875 0.015625] :float-storestack :exec-savestack [0.03515625 0.015625 0.15234375 0.0078125] :strings-rerunall)
-      :generator-flipstack
-      [" ;&@#7KVI" "nk½Æ " "¤®NS>?__¸P"]
-      :ref-forget
-      :integers-portion
-      :generator-dup
-      370016329
-      :strings-empty?]
-  :bindings {:input!2 [\1 \k \b \$ \S \$], :input!9 :exec-do*range, :input!3 :integers-yank, :input!10 :char-cutflip, :input!1 65.05859375, :input!8 [1472 0 3034], :input!4 :set-echoall, :input!7 :vector-portion, :input!5 :float-tagwithinteger, :input!6 :tagspace-flush}
-  }
+ {
+    :program
+
+    '[[\µ \] [2762 2389 4909 4444 158 1738] [1633 2388 4635 1377 627 1400] ["+ÄLj¿Å·d ·Ë" "YCGnrÂ¹P;Ñd" "J7¼ZC]Ô Ée0\\" "Är`|Òr?{ $«|Ì" "v¿SÂn6f@+" "ÄnFÃ5Ð"] :code-later :string-conjchar [] #{112.140625 :integers-pop :char-notequal? :string-replacefirstchar \4 :tagspace-comprehension :floats-rerunall #{[4815 3408 1352 1612 675] :boolean-liftstack :generator-empty? :code-store :generator-reset ["Â¿s¥Ã±0±Ò^º" "ft«µLdKj!" "ne !~"] :float-flush #{342.1796875 :boolean-return-pop [\ \9 \E \¶ \ \q] [] 899231696 false :boolean-tagwithinteger 412188890}}} :input!1 :chars-comprehension [false false false true false true] [2095 4843 1613 1479 1752] :chars-byexample "¾mde¢ªÔ" :string->float [true true true true false true false true] :char-whitespace? 46.5 [0.015625 0.1015625 0.0625] [true false false false] 316946313 :vector-yankdup 200.99609375 :boolean-savestack "dSTeED'xj,ËdÈ*" \ª [false] \Ç :refs-return :exec-y :generator-rerunall :ref->code :booleans-cycler :chars-save 490192015 :boolean-rotate 371.0390625 :code-empty? :ref-cutstack :chars->tagspacefloat [false false true true] false :floats-butlast :booleans-yank \° [true] :floats-return :refs-nth :set-tagwithfloat (true :tagspace-lookupint :floats-flipstack [\N \£ \½ \e] #{134.6015625 :strings-generalize ((:input!5 :chars->code [true] #{["fHº+Á" "7`sÕ`\\c ¦¯C&" "O" ".È§Á" "®SÀl" "±~Faq[¾$Kl$\"\\°JÏQ" "?BÏÂ¦©±Ç1." "jDÒ« ÇÎÇiW(M3x" "´k4±newË.!KT´yNe"] :boolean-storestack [0.12109375 0.05078125] true \² :float≤? :float-mod :floats-comprehension} :vector-byexample) 100.55859375 :generator-flush :tagspace-flush \.) :tagspace-new [] :float->asciichar :string-echo [2918 3195 309 874 4534 4697]}) :char-save [] :booleans-conj 92.76953125 [] :boolean-echoall [\Â] [3046 4885 349 2717 1322 515] :refs-butlast 995450434 170.26171875 :floats-cycler :string≤? :ref-fullquote :vector-swap :ref-return :refs-sampler 535341800 :refs-rest :set-againlater ["nÐËÎ3bL&nD¤ÕyblM" "TÊ_>:¢Q¸z¯l" "Ï¢Cj¿-ÔÕÕ\"P_¶" "GÌ9ÕhºWF¥}|»¾r" "¤G" "6Ò¸ºO|_¡" ")µB«?"] :input!2 (:input!4 :generator-store ["aÍcÈ" "Ä¤{l!JLÈ{.ÍE¨" "A»ÁXÁ~g¡É.Ê" "]¬´³vR//^»xÂ¢aHº" "O,v¯´OC²qÅ}È" "ÈÄÒ¶!ªkB"] ".^|W°«Õt=" "KG \\eÂEJ)") :tagspace-lookupfloat :char-cutstack [\J \f \¦ \l] [] :input!4 #{:vector-againlater :booleans-generalizeall :floats-shove [true false false false true true false true false] :input!1 :string-reverse :integer-stackdepth :integers-flush} (:string-return 141.1484375 :code-wrap :boolean-or 267028121) [0.11328125 0.0859375 0.1015625 0.0234375 0.04296875 0.01953125 0.12890625 0.09375 0.05078125] [\- \E \n \X] true (:chars-return-pop :tagspace-cutflip 961507742 105.6796875 [\u \% \ª \] \`]) :generator-rerunall :char-whitespace? :set-subset? :code-liftstack :exec-cutflip ((:set-againlater [0.08203125 0.03515625 0.140625 0.03125 0.1328125] :chars-stackdepth "Nd¡Î=E-(H°~Ë6Í" [true true true]) :input!5 "t" :float-E [false false true true false true]) (false :code-nth :integer-many :generator-totalisticint3 :floats-new) :integers-pop :input!9 :char-flush 222.51953125 :ref-echo [true false true false true false false] [\B \Ó  \§] :char-tagwithfloat :vector-take (:booleans-reverse :float-multiply #{:strings-cutflip :integers-later [\"] :input!3 :tagspace-merge :booleans->tagspaceint :float-E [\¼ \Y \q \¼]} :floats-replacefirst [true false false false false]) #{[\Ï \£] :integers-return-pop :tagspace-cycler [0.03125] :float-notequal? :refs-save :chars-save (:string-save "Æºev¹NL9" :booleans-occurrencesof [0.0859375 0.15234375 0.03515625] :generator-swap)} 312.6171875 :booleans-do*each :string-pop "´" (:booleans-flipstack (:chars-shove :input!8 :push-counter :boolean-tagwithinteger :strings-portion) :set-swap :char-savestack :refs-replacefirst) :chars-return-pop [0.1328125 0.14453125 0.10546875 0.0234375 0.015625 0.0625 0.09765625 0.125] 40.56640625 :booleans-cutflip [0.0234375] :vector-empty? \Q true :boolean-store :set-empty? [3358 1457 2844 4494] [\u \G \g] [false false false true false false false] :chars-byexample :char-againlater :vector-flipstack 17.48046875 :input!3 #{:vector-return-pop :tagspace-liftstack :strings-generalizeall :refs-notequal? :vector-emptyitem? [2442 277] :boolean-tagwithfloat :boolean-and} :input!5 #{:integer-max 386.9609375 [true false false true] ["kV«q+¿gÔ½LÆh%" "QDN¬E/" "Z¸¸Lb¶9" "c?1(\"¾(62n7Ó" "8¦¡/» vi=³:L/¿`"] :exec-k :integer-dec [\X \³ \Î] :exec-liftstack} :input!6 :environment-end :integer-notequal? :input!1 #{233.7578125 246.4609375 :string-dup [0.1015625 0.0078125 0.1484375 0.1171875] :ref-storestack [true true true] (:exec-y :integer-rotate :refs-later :input!9 :set-equal?) [3442 2790]} :floats-cycler (:vector-echoall :vector-shove :refs-replacefirst :boolean-yankdup :integer-divide) :exec-while ["2/"] :tagspace-cutflip :floats->code ["¶Ä±Ä1" "µJ·+"] :refs-dup [0.11328125 0.09375 0.0234375 0.0234375 0.05859375] :integers-do*each :boolean-rerunall :strings-new :refs-stackdepth \ :ref-store 70907018 :string-concat false :chars-replacefirst [\i \x \6] ["&µz#ÄoQ³µ(XÅ" "(ÁeÊ{¨ª9$!+D¨" "Æ+®J7b*i" "k¨«G¡ÕÇS" "¦¦NU" "[@Î" "y;2¼¬m¸" "l·¦,ÒQaÍÌB»Zv" "4Ð³A[i²,®^O2s"] :tagspace-max 223366584 :char-flush \L :boolean-or \ :booleans-cutstack :vector->set 469863439 :vector-portion :strings-length :error-empty? [113 4360 3896 4402] [\É \ª \N \j \9 \Ô] :ref->code :char-yankdup [\T \N] :booleans-echoall ["\"|ypEe¼tkF(" "vÍª³Ë|Ì)" "%O«tÃÈ.~UÅo4ÃÓ' " "<¤"] :integers-comprehension :strings-store :string-splitonspaces :ref-stackdepth [true false false true] 768638563 :ref-tagwithinteger :integers-build :tagspace-splitwithfloat :refs-set [\Ê \Õ \´ \Ñ] :vector-flipstack [\8 \¦] :float->integer [\z] :exec-tagwithinteger :float-π :ref-clear true 387.23046875 ([3371 2054] [false true true true false] :integer-tagwithfloat [0.0546875] :char≥?) :booleans-notequal? :refs-stackdepth :chars-return []]
+
+    :bindings
+
+    '{:input!2 (:vector-dup), :input!9 (:vector-new), :input!3 (:floats->tagspaceint), :input!10 (:char-yankdup), :input!1 (422776526), :input!8 ("±£M"), :input!4 (:floats-shove), :input!7 (:tagspace-cutflip), :input!5 ("=:¶,+op"), :input!6 (:floats-first)}
+}
+
   ])


base keys* tests in place

base keys* tests in place

--- src/test/clojure/clojure/test_clojure/spec.clj
+++ src/test/clojure/clojure/test_clojure/spec.clj
@@ -298,19 +298,31 @@

 (defn add [& {:keys [a b]}] (+ a b))
 (s/def ::a any?)
-(s/def ::b any?)
-(s/fdef add :args (s/keys* :opt [::a ::b]))
+(s/def ::c any?)
+(s/fdef add :args (s/keys* :opt [::a ::c]))
 (stest/instrument `add)

 (deftest keys-star
   (let [mspec (s/keys* :req-un [::a ::c])]
-    (testing "gens, and that explain data looks correct"
+    (testing "conform and unform"
       (check-conform-unform
        mspec
        [[:a 1 :c 2]]
-       [{:a 1 :c 2}]))
-    (testing "gens, and that explain data looks correct"
-      )))
+       [{:a 1 :c 2}])
+
+      (is (= {:a 1 :c 2} (s/conform mspec [:a 1 :c 2]))))
+    (testing "gens"
+      (is (= #{[:a :c]}
+             (->> (s/exercise mspec 200)
+                  (map (comp vec sort #(take-nth 2 %) first))
+                  (into #{})))))
+    (testing "that explain data looks correct"
+      (are [val expected]
+        (= expected (-> (s/explain-data mspec val) ::s/problems first :pred))
+        [:a 1 :c 2] nil
+        [:c 2 :a 1] nil
+        [:a 1]      '(clojure.core/fn [%] (clojure.core/contains? % :c))
+        []          '(clojure.core/fn [%] (clojure.core/contains? % :a))))))

 (comment
 (testing "that a seq of a singleton map is accepted in the keys* position"


Add missing cljs-time dependency

Add missing cljs-time dependency

--- build.boot
+++ build.boot
@@ -51,6 +51,7 @@
                  [cljsjs/jquery-daterange-picker "0.0.8-0"]
                  [cljsjs/jquery-timepicker "1.8.10-0"]
                  [secretary "1.2.3"]
+                 [com.andrewmcveigh/cljs-time "0.4.0"]

                  [adzerk/boot-cljs "1.7.228-1" :scope "test"]
                  [ajchemist/boot-figwheel "0.5.0-2"] ;; latest release


Update boot-cljs

Update boot-cljs

--- build.boot
+++ build.boot
@@ -7,7 +7,7 @@
                   [org.clojure/clojurescript "1.7.170"]

                   [boot/core              "2.3.0"      :scope "test"]
-                  [adzerk/boot-cljs       "1.7.170-2"  :scope "test"]
+                  [adzerk/boot-cljs       "1.7.170-3"  :scope "test"]
                   [adzerk/boot-cljs-repl  "0.3.0"      :scope "test"]
                   [com.cemerick/piggieback "0.2.1"     :scope "test"]
                   [weasel                 "0.7.0"      :scope "test"]


Explicitly require boot.repl

Explicitly require boot.repl

It isn't always included, it's possible that it was only being pulled in
through the context of the cider task previously

--- build.boot
+++ build.boot
@@ -56,6 +56,7 @@

     (pod/with-eval-in p
       (require '[boot.pod :as pod])
+      (require '[boot.repl])
       (require '[clojure.tools.namespace.repl :as repl])
       (apply repl/set-refresh-dirs (-> pod/env :directories))


rm unused httpclient dependency

rm unused httpclient dependency

--- build.boot
+++ build.boot
@@ -16,8 +16,6 @@
                   [com.beust/jcommander                 "1.48"]
                   [commons-io/commons-io                "2.5"]
                   [org.apache.commons/commons-lang3     "3.4"]
-                  ; probably don't need this dependency anymore
-                  [org.apache.httpcomponents/httpclient "4.5.1"]
                   [com.google.code.gson/gson            "2.6.1"]
                   [org.fusesource.jansi/jansi           "1.11"]
                   [us.bpsm/edn-java                     "0.4.6"]


Added unit test runner.

Added unit test runner.

--- build.boot
+++ build.boot
@@ -1,5 +1,7 @@
 (set-env! :resource-paths #{"src"}
-          :dependencies '[[org.clojure/clojure "1.8.0"]
+          :dependencies '[
+                 [adzerk/boot-test "1.2.0" :scope "test"]
+                 [org.clojure/clojure "1.8.0"]
                  [org.clojure/data.csv "0.1.4"]
                  [org.clojure/tools.cli "0.3.5"]
                  [org.clojure/tools.trace "0.7.9"]
@@ -10,6 +12,8 @@
                  ;TODO: handle drivers sanely
                  [org.xerial/sqlite-jdbc "3.19.3"]
                  [com.h2database/h2 "1.4.195"]])
+(require '[adzerk.boot-test :refer :all])
+(set-env! :source-paths #{"test"})

 (deftask build
   "Builds an uberjar of this project that can be run with java -jar"


Added one test into config-test module

Added one test into config-test module

--- test/clj_mrazik/config_test.clj
+++ test/clj_mrazik/config_test.clj
@@ -14,3 +14,21 @@
   (:require [clojure.test :refer :all]
             [clj-mrazik.config :refer :all]))

+;
+; Common functions used by tests.
+;
+
+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+
+;
+; Tests for various functions
+;
+
+(deftest test-parse-int-existence
+    "Check that the clj-mrazik.config/parse-int definition exists."
+    (testing "if the clj-mrazik.config/parse-int definition exists."
+        (is (callable? 'clj-mrazik.config/parse-int))))
+


Add template tests

Add template tests

--- test/cljc/mikron/test/core.cljc
+++ test/cljc/mikron/test/core.cljc
@@ -1,6 +1,7 @@
 (ns mikron.test.core
   "Actual unit test cases."
   (:require [clojure.test :as test]
+            [mikron.compiler.template]
             [mikron.runtime.core :as mikron]
             [mikron.test.core-macros :as test-macros :refer [def-mikron-tests]])
   #?(:clj (:import [java.util Arrays])))
@@ -65,3 +66,9 @@
    t-record       [:record {:a :int :b :string :c :byte}]
    t-multi        [:multi number? {true :int false :string}]
    t-wrapped      [:wrapped unchecked-inc-int unchecked-dec-int :int]})
+
+(let [schema-1 (mikron/schema [:record {:a :int}])
+      schema-2 (mikron/schema [:record {:b :string}])
+      schema-3 (mikron/schema [:record {:c [:enum #{:cat :dog}]}])]
+  (def-mikron-tests [:pack :diff :valid? :interp]
+    {t-template #mikron/merged [schema-1 schema-2 schema-3]}))


await composing test.

await composing test.

--- test/http/async/client/test.clj
+++ test/http/async/client/test.clj
@@ -315,6 +315,11 @@
         (is (contains? headers :x-user-agent))
         (is (= (:x-user-agent headers) ua-brand))))))

+(deftest await-string
+  (let [resp (GET "http://localhost:8123/stream")
+        body (string (await resp))]
+    (is (= body "part1part2"))))
+
 ;;(deftest profile-get-stream
 ;;  (let [gets (repeat (GET "http://localhost:8123/stream"))
 ;;        seqs (repeat (stream-seq :get "http://localhost:8123/stream"))


Is it unhappy about the client id?

Is it unhappy about the client id?

--- test/icecap/store/riak_test.clj
+++ test/icecap/store/riak_test.clj
@@ -10,7 +10,7 @@

 (defn connect
   [f]
-  (let [conn (wc/connect "http://localhost:8098/riak" "icecap-test")
+  (let [conn (wc/connect "http://localhost:8098/riak")
         store (riak-store conn "test-bucket")]
     (try
       (wb/update conn "test-bucket" (bucket-props))


Minor changes on pages tests.

Minor changes on pages tests.

--- test/uxbox/tests/test_pages.clj
+++ test/uxbox/tests/test_pages.clj
@@ -2,10 +2,10 @@
   (:require [clojure.test :as t]
             [promesa.core :as p]
             [suricatta.core :as sc]
-            [clj-uuid :as uuid]
             [catacumba.testing :refer (with-server)]
             [buddy.core.codecs :as codecs]
             [uxbox.db :as db]
+            [uxbox.util.uuid :as uuid]
             [uxbox.frontend.routes :as urt]
             [uxbox.services.projects :as uspr]
             [uxbox.services.pages :as uspg]
@@ -42,7 +42,7 @@
   (with-open [conn (db/connection)]
     (let [user (th/create-user conn 1)
           proj (uspr/create-project conn {:user (:id user) :name "proj1"})
-          data {:id (uuid/v4)
+          data {:id (uuid/random)
                 :user (:id user)
                 :project (:id proj)
                 :version 0
@@ -68,7 +68,7 @@
   (with-open [conn (db/connection)]
     (let [user (th/create-user conn 1)
           proj (uspr/create-project conn {:user (:id user) :name "proj1"})
-          data {:id (uuid/v4)
+          data {:id (uuid/random)
                 :user (:id user)
                 :project (:id proj)
                 :version 0
@@ -94,7 +94,7 @@
   (with-open [conn (db/connection)]
     (let [user (th/create-user conn 1)
           proj (uspr/create-project conn {:user (:id user) :name "proj1"})
-          data {:id (uuid/v4)
+          data {:id (uuid/random)
                 :user (:id user)
                 :project (:id proj)
                 :version 0
@@ -142,7 +142,7 @@
   (with-open [conn (db/connection)]
     (let [user (th/create-user conn 1)
           proj (uspr/create-project conn {:user (:id user) :name "proj1"})
-          data {:id (uuid/v4)
+          data {:id (uuid/random)
                 :user (:id user)
                 :project (:id proj)
                 :version 0
@@ -184,7 +184,7 @@
   (with-open [conn (db/connection)]
     (let [user (th/create-user conn 1)
           proj (uspr/create-project conn {:user (:id user) :name "proj1"})
-          data {:id (uuid/v4)
+          data {:id (uuid/random)
                 :user (:id user)
                 :project (:id proj)
                 :version 0


up version for release

up version for release

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -1,4 +1,4 @@
-(defproject kafka-clj "3.5.1-PERF-SNAPSHOT"
+(defproject kafka-clj "3.5.1"
   :description "fast kafka library implemented in clojure"
   :url "https://github.com/gerritjvv/kafka-fast"
   :license {:name "Eclipse Public License"


update version

update version

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -1,4 +1,4 @@
-(defproject kafka-clj "0.1.9-SNAPSHOT"
+(defproject kafka-clj "0.2.0-SNAPSHOT"
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"


Specify types explicitly

Specify types explicitly

--- benchmarks/caesium/crypto/secretbox_benchmark.clj
+++ benchmarks/caesium/crypto/secretbox_benchmark.clj
@@ -21,10 +21,10 @@
                s/secretbox-easy-to-direct-byte-bufs!
                s/secretbox-easy-to-byte-bufs-nocast!
                s/secretbox-easy-refl!]]
-      (println f (fmt-bytes size))
       (let [key (random-direct-byte-buf s/keybytes)
             nonce (random-direct-byte-buf s/noncebytes)
             out (ByteBuffer/allocateDirect (+ s/macbytes size))]
+        (println f (fmt-bytes size) (mapv type out msg nonce key))
         (bench (f out msg nonce key))))

     (println "secretbox to-buf! with indirect bufs")
@@ -34,18 +34,18 @@
                s/secretbox-easy-to-indirect-byte-bufs!
                s/secretbox-easy-to-byte-bufs-nocast!
                s/secretbox-easy-refl!]]
-      (println f (fmt-bytes size))
       (let [key (random-indirect-byte-buf s/keybytes)
             nonce (random-indirect-byte-buf s/noncebytes)
             out (ByteBuffer/allocate (+ s/macbytes size))]
+        (println f (fmt-bytes size) (mapv type out msg nonce key))
         (bench (f out msg nonce key))))

     (println "secretbox to-buf! with byte arrays")
     (println "these bufs already exist, so there is no allocation")
     (doseq [[size msg] (map (juxt identity randombytes) sizes)
             f [s/secretbox-easy-to-buf!]]
-      (println f (fmt-bytes size))
       (let [key (randombytes s/keybytes)
             nonce (randombytes s/noncebytes)
             out (byte-array (+ s/macbytes size))]
+        (println f (fmt-bytes size) (mapv type out msg nonce key))
         (bench (f out msg nonce key))))))


All public pipeline API consumers get the opportunity to modify the updated event payload.

--- src/onyx/peer/task_pipeline.clj
+++ src/onyx/peer/task_pipeline.clj
@@ -74,8 +74,8 @@
     event))

 (defn munge-close-temporal-resources [event]
-  (internal-ext/close-temporal-resources event)
-  (merge event (p-ext/close-temporal-resources event)))
+  (merge event (internal-ext/close-temporal-resources
+                (merge event (p-ext/close-temporal-resources event)))))

 (defn munge-close-resources [{:keys [queue session producers consumers reserve?] :as event}]
   (doseq [producer producers] (extensions/close-resource queue producer))
@@ -528,8 +528,11 @@
     (close! (:seal-dead-ch component))
     (close! (:complete-task-dead-ch component))

-    (internal-ext/close-pipeline-resources (:pipeline-data component))
-    (p-ext/close-pipeline-resources (:pipeline-data component))
+    (dorun
+     (merge (:pipeline-data component)
+            (p-ext/close-pipeline-resources
+             (merge (:pipeline-data component)
+                    (internal-ext/close-pipeline-resources (:pipeline-data component))))))

     component))


dissoc later

dissoc later

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -419,12 +419,12 @@
         (update-in [:drawing :layers 0]
                    (fn [layer]
                      (-> layer
-                         (dissoc :points :force-even? :layer/current-x :layer/current-y)
                          (assoc :layer/end-x snap-x
                                 :layer/end-y snap-y)
                          (#(if (:force-even? layer)
                              (layers/force-even %)
                              %))
+                         (dissoc :points :force-even? :layer/current-x :layer/current-y)
                          (#(merge %
                             (when (= :circle (get-in state state/current-tool-path))
                               {:layer/rx (Math/abs (- (:layer/start-x %)


Add asset-path function, for resolving a context asset to a path

--- src/main/clojure/cascade.clj
+++ src/main/clojure/cascade.clj
@@ -108,6 +108,11 @@
        (.sendRedirect response link-path)
        true))

+(defn asset-path
+  "Returns the path to a context asset as a string."
+  [env path]
+  (to-asset-path env (get-context-asset path)))
+
 (defn classpath-asset-path
   "Returns the path to the given classpath asset as a string."
   [env asset-path]