Remove height adjustment

Remove height adjustment

--- src/nightmod/screens.clj
+++ src/nightmod/screens.clj
@@ -34,9 +34,7 @@
 (defscreen main-screen
   :on-show
   (fn [screen entities]
-    (-> screen
-        (update! :renderer (stage) :camera (orthographic))
-        (height! (game :height)))
+    (update! screen :renderer (stage) :camera (orthographic))
     (when-not @u/main-dir
       (reset! u/main-dir (u/get-data-dir)))
     (let [ui-skin (skin "uiskin.json")


Update invite email copy.

Update invite email copy.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -43,7 +43,7 @@
 (def reset-button-text "reset_password")

 (def verify-message "Please verify your email")
-(def verify-instructions "Welcome to Carrot, your new company digest! Please click the link below to verify your account.")
+(def verify-instructions "Welcome to Carrot, where leaders rise above the noise to keep teams aligned. Please click the link below to verify your account.")
 (def verify-button-text "verify_email")

 (def digest-weekly-title "Your weekly brief")


Draw start screen that looks like actual instrument

--- src/musicbox/one.cljs
+++ src/musicbox/one.cljs
@@ -2,7 +2,7 @@
   (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [goog.dom :as dom]
             [goog.events :as events]
-            [cljs.core.async :refer [<! put! chan timeout merge sliding-buffer]]
+            [cljs.core.async :refer [<! put! chan timeout merge sliding-buffer close!]]
             [musicbox.util :as util]
             [musicbox.scales :as scales]))

@@ -15,18 +15,6 @@
              {:light "#D35E4C" :dark "#692B22"}
              {:light "#E18C43" :dark "#6B401C"}
              {:light "#E1B040" :dark "#69511A"}])
-
-(defn draw-start-screen [draw-ctx]
-  (let [{w-window :w h-window :h} (util/get-window-size)
-        w-text 200
-        h-text 70
-        text "Tap the screen to start"
-        center-dimension (fn [window text] (- (/ window 2) (/ text 2)))]
-    (set! (.-font draw-ctx) "20px Verdana")
-    (.fillText draw-ctx
-               text
-               (center-dimension w-window w-text)
-               (center-dimension h-window h-text))))

 (defn piano-key-width
   [piano-keys w]
@@ -54,7 +42,7 @@
 (defn create-note-synth
   [freq]
   (timbre "adsr"
-          (js-obj "a" 5 "d" 10000 "s" 0 "r" 500)
+          (js-obj "a" 5 "d" 100 "s" 0 "r" 5)
           (timbre "fami" (js-obj "freq" freq "mul" 0.1))))

 (defn create-instrument
@@ -85,7 +73,6 @@
                   :time (.-timeStamp event)})
          (for [x (range (:length touches))] ((keyword (str x)) touches)))))

-
 (defn touch->freq
   [instrument touch]
   (touch->note (get touch :clientX)
@@ -99,7 +86,8 @@
                         piano-key (get (:piano-keys instrument) freq)]
                     (if (empty? (:notes piano-key))
                       (do
-                        (.play (.bang (:synth piano-key)))
+                        (println "play" piano-key)
+                        ;; (.play (.bang (:synth piano-key)))
                         (assoc-in instrument
                                   [:piano-keys freq :notes]
                                   [{:on time :off nil :touch-id touch-id}])))))
@@ -123,22 +111,28 @@
         (.scrollTo js/window 0 0) ;; Safari leaves window part scrolled down after turn
         (assoc (assoc instrument :h h) :w w))))

+(defn create-input-channel
+  [canvas-id]
+  (merge [(util/listen (dom/getElement canvas-id) :touchstart)
+          (util/listen (dom/getElement canvas-id) :touchend)]))
+
 (let [canvas-id "canvas"
       c-app-state (chan)
       c-instrument (chan)
       c-orientation-change (util/listen js/window :orientation-change)
-      c-touch-start (util/listen (dom/getElement canvas-id) :touchstart)
-      c-touch-end (util/listen (dom/getElement canvas-id) :touchend)]
+      c-input (create-input-channel canvas-id)]

   (go
-   (<! c-touch-start) (<! c-touch-end) ;; start after first touch so don't break sound
-   (>! c-app-state "start"))
+   ;; start after input so don't break sound
+   (let [c-start (create-input-channel canvas-id)]
+     (<! c-start)
+     (close! c-start)
+     (>! c-app-state "start")))

   (go
    (let [draw-ctx (util/get-ctx canvas-id)]
      (util/set-canvas-size! canvas-id (util/get-window-size))
-     (draw-start-screen draw-ctx)
-     (loop [instrument (<! c-instrument)]
+     (loop [instrument nil]
        (let [[data c] (alts! [c-instrument (timeout 30)])]
          (condp = c
            c-instrument (recur data)
@@ -146,12 +140,11 @@
                (recur instrument)))))))

   (go
-   (<! c-app-state)
    (loop [instrument (update-size (create-instrument (scales/c-minor)) canvas-id)]
      (>! c-instrument instrument)
-     (let [[data c] (alts! [c-touch-start c-touch-end
-                            c-orientation-change])]
+     (let [[data c] (alts! [c-input c-orientation-change c-app-state])]
        (condp = c
+         c-app-state (recur (add-synths-to-instrument instrument))
          c-orientation-change (recur (update-size instrument canvas-id))
          (recur (reduce fire-event-on-instrument
                         instrument


Mark functions as private

Mark functions as private

--- src/naughtmq/core.clj
+++ src/naughtmq/core.clj
@@ -3,7 +3,7 @@
             [pandect.core :as p]
             [clojure.java.io :as io]))

-(defn os-specific-path
+(defn- os-specific-path
   "Finds the OS specific path for the given library name."
   [s]
   (let [os-arch (. (System/getProperty "os.arch") toLowerCase)
@@ -27,7 +27,7 @@
                          (str "Unsupported platform: " os-name ", " os-arch
                               " for library " s))))))

-(defn copy-stream
+(defn- copy-stream
   "Copies in to out."
   [^java.io.InputStream in ^java.io.OutputStream out]
   (with-local-vars [buf (byte-array (* 16 1024))]
@@ -37,7 +37,7 @@
           (.write out buf 0 cnt)
           (recur))))))

-(defn save-library
+(defn- save-library
   [s]
   (let [lib-name (os-specific-path s)
         lib-path (str "/native/" lib-name)
@@ -56,7 +56,7 @@
           (log/info (str "Saved lib to: " path))
           path)))))

-(defn load-library
+(defn- load-library
   "Loads the given path (string) as a native library."
   [s]
   (let [file_path (save-library s)]


Macro to do expression if bucket exist, otherwise show not found

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -53,6 +53,10 @@
         bucket-names (store/list-image-dirs images-dir)]
     (json-list-response bucket-names)))

+(defmacro if-bucket-exist [bucket expression]
+  `(if (bucket-exist? ~bucket)
+     ~expression
+     (not-found ~bucket)))

 (defroutes app-routes
   (GET "/" [:as request] (root-route request "" [:images :buckets :random]))
@@ -61,9 +65,7 @@
   (GET "/random" [] (serve-random-image-route no-bucket))
   (GET "/buckets" request list-buckets-route)
   (GET "/buckets/:bucket" [bucket :as request]
-       (if (bucket-exist? bucket)
-         (root-route request "/" [:images :random])
-         (not-found bucket)))
+       (if-bucket-exist bucket (root-route request "/" [:images :random])))
   (GET "/buckets/:bucket/images" [bucket :as request] (list-images-route request bucket))
   (GET "/buckets/:bucket/images/:image" [bucket image] (serve-image-route bucket image))
   (GET "/buckets/:bucket/random" [bucket] (serve-random-image-route bucket))


fix emdash in site title for blog

fix emdash in site title for blog

--- src/pc/views/content.clj
+++ src/pc/views/content.clj
@@ -41,7 +41,7 @@
 (defn layout [view-data & content]
   [:html
    [:head
-    [:title "Precursor—fast prototyping web app, makes collaboration easy."]
+    [:title "Precursor—fast prototyping web app, makes collaboration easy."]
     [:meta {:charset    "utf-8"}]
     [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}]


let people set read-only docs from the backend

--- src/pc/http/sente.clj
+++ src/pc/http/sente.clj
@@ -656,11 +656,12 @@
   (check-document-access (-> ?data :document/id) req :owner)
   (let [doc-id (-> ?data :document/id)
         cust (-> req :ring-req :auth :cust)
+        setting (-> ?data :setting)
         ;; XXX: only if they try to change it to private
         _ (assert (or (:document/team (doc-model/find-by-id (:db req) doc-id))
+                      (contains? #{:document.privacy/public :document.privacy/read-only} setting)
                       (contains? (:flags cust) :flags/private-docs)))
         ;; letting datomic's schema do validation for us, might be a bad idea?
-        setting (-> ?data :setting)
         annotations {:transaction/document doc-id
                      :cust/uuid (:cust/uuid cust)
                      :transaction/broadcast true}


Remove :on-dispose (no different than :on-hide)

--- src/play_clj/core.clj
+++ src/play_clj/core.clj
@@ -63,8 +63,7 @@

 (defn defscreen*
   [screen entities
-   {:keys [on-show on-render on-hide on-pause
-           on-resize on-resume on-dispose on-timer]
+   {:keys [on-show on-render on-hide on-pause on-resize on-resume on-timer]
     :as options}]
   (let [execute-fn! (fn [func & {:keys [] :as options}]
                       (when func
@@ -115,8 +114,7 @@
      :resize (fn [w h]
                (execute-fn! on-resize :width w :height h)
                (update-screen! @screen))
-     :resume #(execute-fn! on-resume)
-     :dispose #(execute-fn! on-dispose)}))
+     :resume #(execute-fn! on-resume)}))

 (defmacro defscreen
   "Defines a screen, and creates vars for all the functions inside of it. All
@@ -512,7 +510,6 @@
   (let [run-fn! (fn [k & args]
                   (doseq [screen screen-objects]
                     (apply (get screen k) args)))]
-    (some-> game-object .getScreen .dispose)
     (.setScreen game-object
       (reify Screen
         (show [this]
@@ -526,7 +523,7 @@
         (pause [this] (run-fn! :pause))
         (resize [this w h] (run-fn! :resize w h))
         (resume [this] (run-fn! :resume))
-        (dispose [this] (run-fn! :dispose))))))
+        (dispose [this])))))

 (defn set-screen-wrapper!
   "Sets a function that wraps around all screen functions, allowing you to


Adapting the promesa implementation to the cats changes.

--- src/promesa/core.cljs
+++ src/promesa/core.cljs
@@ -25,6 +25,7 @@
 (ns promesa.core
   (:refer-clojure :exclude [delay spread some])
   (:require [cats.core :as m]
+            [cats.context :as mctx]
             [cats.protocols :as cats]
             [promesa.protocols :as proto]
             [org.bluebird]))
@@ -257,7 +258,7 @@
       (promise v))

     (mbind [mn mv f]
-      (let [ctx m/*context*]
+      (let [ctx mctx/*context*]
         (then mv (fn [v]
                     (m/with-monad ctx
                       (f v))))))))


Assign default parallelism on scheduler executor constructor

--- src/promesa/exec.cljc
+++ src/promesa/exec.cljc
@@ -334,8 +334,9 @@
    (defn scheduled-executor
      "A scheduled thread pool constructor."
      [& {:keys [parallelism factory] :or {parallelism 1}}]
-     (let [factory (or (some-> factory resolve-thread-factory)
-                       (default-thread-factory :name "promesa/scheduled/%s"))]
+     (let [parallelism (or parallelism (get-available-processors))
+           factory     (or (some-> factory resolve-thread-factory)
+                           (default-thread-factory :name "promesa/scheduled/%s"))]
        (Executors/newScheduledThreadPool (int parallelism) factory))))

 #?(:clj


Updated documentation for the new attribute

--- src/re_com/dropdown.cljs
+++ src/re_com/dropdown.cljs
@@ -201,7 +201,7 @@
    {:name :filter-box?   :required false :default false   :type "boolean"                                                      :description "if true, a filter text field is placed at the top of the dropdown"}
    {:name :regex-filter? :required false :default false   :type "boolean | atom"                                               :description "if true, the filter text field will support JavaScript regular expressions. If false, just plain text"}
    {:name :placeholder   :required false                  :type "string"                        :validate-fn string?           :description "background text when no selection"}
-   {:name :title?        :required false :default false   :type "boolean"                                                      :description "if true, it displays the title for the selected dropdown"}
+   {:name :title?        :required false :default false   :type "boolean"                                                      :description "if true, it allows the title for the selected dropdown to be displayed via a mouse over."}
    {:name :width         :required false :default "100%"  :type "string"                        :validate-fn string?           :description "the CSS width. e.g.: \"500px\" or \"20em\""}
    {:name :max-height    :required false :default "240px" :type "string"                        :validate-fn string?           :description "the maximum height of the dropdown part"}
    {:name :tab-index     :required false                  :type "integer | string"              :validate-fn number-or-string? :description "component's tabindex. A value of -1 removes from order"}


Fixed synatx

Fixed synatx

--- src/salvador/handler.clj
+++ src/salvador/handler.clj
@@ -17,6 +17,7 @@
 (def aws-gateway-options
   {:x-amazon-apigateway-integration
    {:responses {:default {:statusCode "200"
+                          :responseParameters {"method.response.header.Content-Type" "integration.response.body.headers.X-Content-Type"}
                           :responseTemplates {"application/json" "$input.json('$.body')"
                                               "text/html" "$input.json('$body.template-body')"}}}
     :requestTemplates { "application/json" (slurp (io/resource "bodymapping.vm")) }


handler improvements, hopefully

handler improvements, hopefully

--- src/seathree/handler.clj
+++ src/seathree/handler.clj
@@ -6,6 +6,7 @@
            [cheshire.core :as json]
            [ring.adapter.jetty :refer (run-jetty)]
            [ring.middleware.gzip :refer :all]
+           [ring.util.response :refer [response]]
            [taoensso.timbre :as log]
            [seathree.config :as cfg]
            [seathree.data :as data]
@@ -15,15 +16,15 @@
 (def default-cfg-path "resources/secrets.clj")

 (defroutes routes
-    (GET "/tweets" [user-data] {:status 200
-                                :content-type "application/json"
-                                :body (json/generate-string
-                                       (routes/tweets config
-                                                      (json/parse-string true user-data)))}))
+    (GET "/tweets-for-user" [user-data] (response (routes/tweets config (json/parse-string true user-data))))
+    (GET "/tweets-for-many" [user-data-list] (response
+                                              (map (partial routes/tweets config)
+                                                   (json/parse-string true user-data-list)))))

 (def app
   (-> routes
-      (wrap-json-response)))
+      (wrap-json-response)
+      (wrap-gzip)))

 (defn -main
   [& args]


Improve efficiency of goto event.

Improve efficiency of goto event.

--- src/uxbox/main/data/projects.cljs
+++ src/uxbox/main/data/projects.cljs
@@ -12,7 +12,7 @@
             [uxbox.main.repo :as rp]
             [uxbox.main.data.pages :as udp]
             [uxbox.util.rstore :as rs]
-            [uxbox.util.router :as r]
+            [uxbox.util.router :as rt]
             [uxbox.util.i18n :refer (tr)]
             [uxbox.util.forms :as sc]
             [uxbox.main.data.pages :as udp]))
@@ -184,39 +184,32 @@

 ;; --- Go To & Go To Page

-(defrecord GoTo [projectid]
-  rs/EffectEvent
-  (-apply-effect [_ state]
-    (reset! st/loader true))
-
-  rs/WatchEvent
-  (-apply-watch [_ state s]
-    (letfn [(navigate [pages]
-              (let [pageid (:id (first pages))
-                    params {:project (str projectid)
-                            :page (str pageid)}]
-                (r/navigate :workspace/page params)))]
-      (rx/merge
-       (rx/of #(assoc % :loader true)
-              (udp/fetch-pages projectid))
-       (->> (rx/filter udp/pages-fetched? s)
-            (rx/take 1)
-            (rx/map :pages)
-            (rx/do #(reset! st/loader false))
-            (rx/map navigate))))))
-
-(defrecord GoToPage [projectid pageid]
-  rs/WatchEvent
-  (-apply-watch [_ state s]
-    (let [params {:project (str projectid)
-                  :page (str pageid)}]
-      (rx/of (r/navigate :workspace/page params)))))
+(defrecord GoTo [project-id]
+  rs/WatchEvent
+  (-apply-watch [_ state stream]
+    (let [page-id (get-in state [:projects project-id :page-id])
+          params {:project project-id
+                  :page page-id}]
+      (rx/of (udp/fetch-pages project-id)
+             (rt/navigate :workspace/page params)))))
+
+(defrecord GoToPage [project-id page-id]
+  rs/WatchEvent
+  (-apply-watch [_ state s]
+    (let [params {:project project-id
+                  :page page-id}]
+      (rx/of (rt/navigate :workspace/page params)))))

 (defn go-to
   "A shortcut event that redirects the user to the
   first page of the project."
-  ([projectid] (GoTo. projectid))
-  ([projectid pageid] (GoToPage. projectid pageid)))
+  ([project-id]
+   {:pre [(uuid? project-id)]}
+   (GoTo. project-id))
+  ([project-id page-id]
+   {:pre [(uuid? project-id)
+          (uuid? page-id)]}
+   (GoToPage. project-id page-id)))

 ;; --- Update Opts (Filtering & Ordering)


Update deps in generated project.clj.

Update deps in generated project.clj.

--- src/leiningen/new/quil_cljs/project.clj
+++ src/leiningen/new/quil_cljs/project.clj
@@ -3,9 +3,9 @@
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.5.1"]
+  :dependencies [[org.clojure/clojure "1.6.0"]
   				      [org.clojars.norgat/quil "2.0.0-alpha"]
-  				      [org.clojure/clojurescript "0.0-2234"]]
+  				      [org.clojure/clojurescript "0.0-2268"]]

   :plugins [[lein-cljsbuild "1.0.3"]]
   :hooks [leiningen.cljsbuild]


remove unused declaration

remove unused declaration

--- src/main/clojure/clojure/spec/alpha.clj
+++ src/main/clojure/clojure/spec/alpha.clj
@@ -346,8 +346,6 @@
   "Returns spec registered for keyword/symbol/var k, or nil."
   [k]
   (get (registry) (if (keyword? k) k (->sym k))))
-
-(declare map-spec)

 (defmacro spec
   "Takes a single predicate form, e.g. can be the name of a predicate,


Update core.clj

Update core.clj

--- src/swagger_gen/core.clj
+++ src/swagger_gen/core.clj
@@ -98,7 +98,7 @@

    (fn [spec] (merge additional-params spec))

-   (fn [spec] (assoc spec :foo "bar"))
+   (fn [spec] (assoc spec :foo \"bar\"))

    or *transform* a swagger spec by restructuring it
    in a way that is more acceptable for template rendering.


Added ring request to trace log

Added ring request to trace log

--- src/tango/web_socket.clj
+++ src/tango/web_socket.clj
@@ -8,7 +8,9 @@
 (log/refer-timbre)

 (defn event-msg-handler* [messages-receive-chan {:as ev-msg :keys [id ?data event ring-req]}]
-  (async/>!! messages-receive-chan {:topic id :payload ?data :sender (:uid (:session ring-req))}))
+  (do
+    (log/trace "Ring request: " ring-req)
+    (async/>!! messages-receive-chan {:topic id :payload ?data :sender (:uid (:session ring-req))})))

 (defrecord WSRingHandlers [ajax-post-fn ajax-get-or-ws-handshake-fn])


Enable (again) the full shape movement.

Enable (again) the full shape movement.

Instead treat path like a rect.

--- src/uxbox/main/geom.cljs
+++ src/uxbox/main/geom.cljs
@@ -42,8 +42,8 @@
     :rect (move-rect shape dpoint)
     :text (move-rect shape dpoint)
     :line (move-rect shape dpoint)
-    ;; :path (move-path shape dpoint)
-    :path (move-rect shape dpoint)
+    :path (move-path shape dpoint)
+    ;; :path (move-rect shape dpoint)
     :circle (move-circle shape dpoint)
     :group (move-group shape dpoint)))


Added new test test-get-calendar-3

Added new test test-get-calendar-3

--- test/clouseau/test_calendar.clj
+++ test/clouseau/test_calendar.clj
@@ -111,6 +111,22 @@
             (is (=  (.get calendar (java.util.Calendar/DAY_OF_MONTH)) 1)))
 ))

+(deftest test-get-calendar-3
+    "Check the function clouseau.calendar/get-calendar."
+    (testing "the function clouseau.calendar/get-calendar."
+        (is (not (nil? (get-calendar))))
+        (is (>= (.get (get-calendar) (java.util.Calendar/HOUR)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/HOUR)) 11))
+        (is (>= (.get (get-calendar) (java.util.Calendar/HOUR_OF_DAY)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/HOUR_OF_DAY)) 23))
+        (is (>= (.get (get-calendar) (java.util.Calendar/MINUTE)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/MINUTE)) 59))
+        (is (>= (.get (get-calendar) (java.util.Calendar/SECOND)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/SECOND)) 59))
+        (is (>= (.get (get-calendar) (java.util.Calendar/MILLISECOND)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/MILLISECOND)) 999))
+))
+
 (deftest test-format-date-using-desired-format
     "Check the function clouseau.calendar/format-date-using-desired-format"
     (testing "the function clouseau.calendar/format-date-using-desired-format."


:8ball: clojure RNA Transcription - map hashmap directly

--- clojure/rna-transcription/rna_transcription.clj
+++ clojure/rna-transcription/rna_transcription.clj
@@ -1,8 +1,6 @@
 (ns rna-transcription)

-(defn- single-to-rna [c]
+(defn to-rna [s]
   (def rna-map {\A \U, \C \G, \G \C, \T \A})
-  (assert (contains? rna-map c) (str "Unknown nucleotide: " c))
-  (get rna-map c))
-
-(defn to-rna [s] (apply str (map single-to-rna s)))
+  (assert (every? (partial contains? rna-map) s) (str "Invalid RNA strand: " s))
+  (apply str (map rna-map s)))


Live-ranges now passes both test cases.

Live-ranges now passes both test cases.

--- test/minijava/test_liveness.clj
+++ test/minijava/test_liveness.clj
@@ -58,7 +58,7 @@
         {:id a, :start 4, :end 5}]))))

- (deftest test-live-range
+ (deftest test-live-range-2
   (tm/reset-num!)
   (let [l1 (tm/label)
         a (tm/temp)
@@ -74,3 +74,23 @@
    (is (= (live-ranges (live prog))
        (hash-map  b [(live-range b 0 5)]
  									c [(live-range c 0 5)])))))
+
+(deftest test-live-range-1
+  (tm/reset-num!)
+  (let [t (tm/label)
+        f (tm/label)
+        a (tm/temp "a")
+        b (tm/temp "b")
+        other (tm/label)
+        prog  (vector
+               (LABEL other)
+               (cmpl a b)
+               (jcc := t)
+               (jmp f)
+               (LABEL t)
+               (jmp other)
+               (LABEL f))]
+  (is (= (live-ranges (live prog))
+					(hash-map a [(live-range a 0 2) (live-range a 4 5)]
+ 										b [(live-range b 0 2) (live-range b 4 5)])
+        ))))


Add Fedora-style host-key for source.nokia.com


Add missing type hint on one function on codecs ns.

--- src/buddy/core/codecs.clj
+++ src/buddy/core/codecs.clj
@@ -29,7 +29,7 @@

 (defn bytes->str
   "Convert octets to String."
-  ([data]
+  ([^bytes data]
    (bytes->str data "UTF-8"))
   ([^bytes data, ^String encoding]
    (String. data encoding)))


pedantic reordering

pedantic reordering


Make state atom behavior more true to this.state.


add java.net.URL type into hierarchy

add java.net.URL type into hierarchy

--- src/pipeline/grafter/pipeline/types.clj
+++ src/pipeline/grafter/pipeline/types.clj
@@ -142,6 +142,8 @@
 (swap! parameter-types derive ::url ::uri)

 (swap! parameter-types derive java.net.URI ::uri)
+
+(swap! parameter-types derive java.net.URL ::url)

 (swap! parameter-types derive ::map ::value)


Adjust keymap to use new text editing actions

--- src/flense_nw/keymap.cljs
+++ src/flense_nw/keymap.cljs
@@ -15,15 +15,15 @@

 (def keymap
   {#{:down} (some-fn text/begin-editing completions/next-completion z/down)
-   #{:left} z/left-or-wrap
-   #{:right} z/right-or-wrap
+   #{:left} (some-fn text/prev-char z/left-or-wrap)
+   #{:right} (some-fn text/next-char z/right-or-wrap)
    #{:up} (some-fn text/cease-editing completions/prev-completion z/up)
    #{:shift :left} z/prev
    #{:shift :right} z/next
    #{:meta :shift :k} model/prev-placeholder
    #{:meta :shift :l} model/next-placeholder

-   #{:backspace} #(or (text/delete-char %) (paredit/delete %))
+   #{:backspace} (some-fn text/delete-char paredit/delete)
    #{:shift :backspace} paredit/delete
    #{:shift :space} paredit/insert-left
    #{:space} (maybe-insert-char \space paredit/insert-right)


parallelize evaluation!

parallelize evaluation!

--- src/search/algorithms/base/evaluate.clj
+++ src/search/algorithms/base/evaluate.clj
@@ -1,6 +1,5 @@
 (ns search.algorithms.base.evaluate
   (:require [schema.core :as s]
-            [com.rpl.specter :as sp]

             [search.core :as search]
             [search.utils :refer [defnk-fn]]))
@@ -10,7 +9,10 @@
    based on its genome"
   [genome->traits :- (s/=> search/Traits search/Genome)]
   [generation :- search/Generation]
-  (sp/compiled-transform
-    (sp/comp-paths :individuals sp/ALL (sp/collect-one :genome) :traits)
-    (fn [genome _] (genome->traits genome))
-    generation))
+  (assoc generation :individuals
+    (set
+      (pmap
+        (fn [ind]
+          (let [traits (-> ind :genome genome->traits)]
+            (assoc ind :traits traits)))
+        (generation :individuals)))))


can now create and destroy multiple inspectors while swt loop runs happily in background

--- dada-swt/src/main/clojure/org/dada/swt/new.clj
+++ dada-swt/src/main/clojure/org/dada/swt/new.clj
@@ -35,19 +35,26 @@

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

-(def *display* (Display.))
+(.start
+ (Thread.
+  (fn []
+      (def *display* (Display.))
+      (swt-loop *display*))))

 (defn inspect [query]
-  (let [[metadata-fn data-fn] query
-	results (data-fn)
-	[metamodel metamodel-name details operation] results
-	shell (create-shell *display* (.getName metamodel))
-	component (create operation metamodel shell)]
-    (println results)
-    (.pack component)
-    (.pack shell)
-    (println "LOOP" shell)
-    (shell-loop shell)))
+  (.asyncExec
+   *display*
+   (fn []
+       (let [[metadata-fn data-fn] query
+	     results (data-fn)
+	     [metamodel metamodel-name details operation] results
+	     shell (create-shell *display* (.getName metamodel))
+	     component (create operation metamodel shell)]
+	 (println results)
+	 (.pack component)
+	 (.pack shell)))))
+
+

 ;;--------------------------------------------------------------------------------
 ;; example queries


reduced gzipped test precision

reduced gzipped test precision

--- test/asset_minifier/core_test.clj
+++ test/asset_minifier/core_test.clj
@@ -13,7 +13,7 @@
     (.delete file)))

 (defn round-gzipped [m]
-  (update-in m [:gzipped-size] #(when % (int (/ % 10)))))
+  (update-in m [:gzipped-size] #(when % (int (/ % 100)))))

 (defmacro run-test [fn result]
   `(do


Test that multiple no-paren method calls are left-associative

--- test/clojure_ruby/parser_test.clj
+++ test/clojure_ruby/parser_test.clj
@@ -138,7 +138,16 @@
            [:reference "alpha"]
            "beta"
            [:number "1"]
-           [:number "2"]]])))
+           [:number "2"]]]))
+  (is (unambigous?    "a b c 1"))
+  (is (= (ruby-parser "a b c 1")
+         [[:method-call-self-no-parens
+           "a"
+           [:method-call-self-no-parens
+            "b"
+            [:method-call-self-no-parens
+             "c"
+             [:number "1"]]]]])))

 (deftest implict-object-method-calls
   (is (unambigous?    "a()"))


tweak test to test jvm version dep issue

--- test/dalap/test/html/selector.clj
+++ test/dalap/test/html/selector.clj
@@ -78,7 +78,8 @@

          ;; the following anon function doesn't get wrapped in 32 bit
          ;; jvms for some reason
-         [CustomType] :a
+         ;;[CustomType] :a   ; this also fails sometimes
+         [#(= CustomType (type %))] :a
          [CustomType2] (fn [o w] ["*" (:a o) "*"])
          [#(= CustomType3 (type %))] #(do ["*" (:a %) "*"])


Display titles instead of names

Display titles instead of names

--- src/app/core.cljs
+++ src/app/core.cljs
@@ -39,24 +39,30 @@
 (defonce Guest (.extend (.-Object parse/Parse) "Guest"))

 (defn save-parties [parties]
-  (go (doseq [{:keys [names contact has-plus-one]} parties]
-        (let [party (<! (parse/save Party {:contact contact
-                                           :additional (if has-plus-one 1 0)}))]
-          (doseq [name names]
-            (<! (parse/save Guest {:name name
-                                   :party party})))))))
+  (go (doseq [{:keys [title names contact has-plus-one]} parties]
+        (let [[result party-or-error] (<! (parse/save Party {:contact contact
+                                                             :additional (if has-plus-one 1 0)
+                                                             :title title}))]
+          (if (= :success result)
+            (doseq [name names]
+              (let [[result guest-or-error] (<! (parse/save Guest {:name name
+                                                                   :party party-or-error}))]
+                (if (= :success result)
+                  (js/console.log "Saved guest.")
+                  (js/console.error "Error saving guest: " guest-or-error))))
+            (js/console.error "Error saving party: " party-or-error))))))

 (defn search-guests [search-str]
-  (go (if-let [result (<! (-> (parse/query Guest)
-                              (parse/matches "name" search-str {:insensitive true})
-                              (parse/include "party")
-                              (parse/query-find)))]
-        (-> (mapv (fn [guest]
-                    (-> guest
-                        (parse/parse-obj->map)
-                        (update-in [:party] parse/parse-obj->map)))
-                  (js->clj result)))
-        [])))
+  (go (let [result (<! (parse/query-find (doto (parse/query Guest)
+                                           (.matches "name" search-str "i")
+                                           (.include "party"))))]
+        (if result
+          (-> (mapv (fn [guest]
+                      (-> guest
+                          (parse/parse-obj->map)
+                          (update-in [:party] parse/parse-obj->map)))
+                    (js->clj result)))
+          []))))

 (defn guests-in-party [party-id]
   (go (if-let [result (<! (-> (parse/query Guest)
@@ -177,7 +183,7 @@
        [:main
         [:h2 "RSVP"]
         [:form {:id "rsvpsearch"
-                :onSubmit #(do (.. % (preventDefault))
+                :onSubmit #(do (.preventDefault %)
                                (go (if (>= (count name) 3)
                                      (do (om/update! data :error nil)
                                          (let [guests (<! (search-guests name))]
@@ -300,7 +306,7 @@
         [:ul {:id "rsvpresults"}
          (map-indexed (fn [n {:keys [name party]}]
                         [:li
-                         [:span name]
+                         [:span (get-in party [:title])]
                          [:button
                           {:onClick #(select-party! owner party)}
                           "Select"]])
@@ -349,7 +355,7 @@
 (defn main-view [{:keys [selected rsvp-search] :as data} owner]
   (reify om/IRender
     (render [_]
-      (println "@app-state" data)
+      #_(println "@app-state" data)
       (html
        [:div
         (om/build nav-view data)


Two tests for function get-and-check-port

--- test/zg/core_test.clj
+++ test/zg/core_test.clj
@@ -83,4 +83,20 @@
         (is (thrown? AssertionError (get-port "65537")))
         (is (thrown? AssertionError (get-port "1000000")))))

+(deftest test-get-and-check-port
+    "Check the function zg.core/get-and-check-port."
+    (testing "the function zg.core/get-and-check-port."
+        (is (= (get-and-check-port "1")     "1"))
+        (is (= (get-and-check-port "2")     "2"))
+        (is (= (get-and-check-port "65534") "65534"))
+        (is (= (get-and-check-port "65535") "65535"))))

+(deftest test-get-and-check-port-negative
+    "Check the function zg.core/get-and-check-port."
+    (testing "the function zg.core/get-and-check-port."
+        (is (thrown? AssertionError (get-and-check-port "-1")))
+        (is (thrown? AssertionError (get-and-check-port "0")))
+        (is (thrown? AssertionError (get-and-check-port "65536")))
+        (is (thrown? AssertionError (get-and-check-port "65537")))
+        (is (thrown? AssertionError (get-and-check-port "1000000")))))
+


Add resource templates as defaults

Add resource templates as defaults

--- src/runbld/opts.clj
+++ src/runbld/opts.clj
@@ -50,7 +50,9 @@
    :email
    {:host "localhost"
     :port 587
-    :tls true}})
+    :tls true
+    :template-txt "templates/email.mustache.txt"
+    :template-html "templates/email.mustache.html"}})

 (defn expand-date-pattern [s]
   (if (string? s)


More kvs.cljs sketching.

More kvs.cljs sketching.

--- src/cbfg/kvs.cljs
+++ src/cbfg/kvs.cljs
@@ -1,5 +1,6 @@
 (ns cbfg.kvs
-  (:require-macros [cbfg.act :refer [act act-loop achan aput atake aalts]])
+  (:require-macros [cbfg.act :refer [act act-loop achan
+                                     aput-close aput atake aalts]])
   (:require [cbfg.misc :refer [dissoc-in]]))

 ; A kvs is an abstraction of ordered-KV store.  Concrete examples
@@ -18,65 +19,96 @@
   {:name name
    :uuid uuid
    :keys (sorted-map)    ; key -> sq
-   :changes (sorted-map) ; sq -> {:key k, :sq s, :deleted true | :val v}
+   :changes (sorted-map) ; [sq key] -> {:key k, :sq s, :deleted true | :val v}
    :next-sq 1})
+
+(defn kvs-sq-by-key [kvs key]
+  (get (:keys kvs) key))
+
+(defn kvs-entry-by-key-sq [kvs key sq]
+  (get (:changes kvs) [sq key]))
+
+(defn kvs-entry-by-key [kvs key]
+  (kvs-entry-by-key-sq kvs key (kvs-sq-by-key kvs key)))

 ; TODO: Track age, utilization, compaction for simulated performance.

 ; TODO: Cannot use atoms because they prevent time travel.

+; TODO: Add snapshot ability.
+
+(defn state-work [actx state-ch m work-fn]
+  (act state-work actx
+       (let [res-ch (:res-ch m)
+             help-ch (achan state-work)]
+         (aput state-work state-ch [work-fn help-ch])
+         (aput state-work res-ch
+               (merge m (or (atake state-work help-ch) {:status :error}))))))
+
+(defn kvs-work [actx state-ch m work-fn]
+  (state-work actx state-ch m
+              #(if-let [[name uuid] (:kvs-ident m)]
+                 (if-let [kvs (get-in % [:kvss name])]
+                   (if (= uuid (:uuid kvs))
+                     (work-fn % kvs)
+                     [% {:status :mismatch :sub-status :wrong-uuid}])
+                   [% {:status :not-found :sub-status :no-kvs}])
+                 [% {:status :invalid :sub-status :no-kvs-ident}])))
+
 (def op-handlers
   {:kvs-open
-   (fn [actx kvss m]
-     (act kvs-open actx
-          (let [{:keys [res-ch name]} m
-                kvs (get-in (swap! kvss
-                                   #(if (get-in % [:kvss name])
-                                      %
-                                      (let [next-uuid (or (:next-uuid %) 0)]
-                                        (-> %
-                                            (update-in [:kvss name]
-                                                       (make-kvs name next-uuid))
-                                            (update-in [:next-uuid]
-                                                       (inc next-uuid))))))
-                            [:kvss name])]
-            (aput kvs-open res-ch (merge m {:kvs kvs})))))
+   (fn [actx state-ch m]
+     (state-work actx state-ch m
+                 #(if-let [name (:name m)]
+                    (if-let [kvs (get-in % [:kvss name])]
+                      [% {:status :ok :kvs-ident [name (:uuid kvs)]}]
+                      [(-> %
+                           (update-in [:kvss name] (make-kvs name (:next-uuid %)))
+                           (assoc :next-uuid (inc (:next-uuid %))))
+                       {:status :ok :kvs-ident [name (:next-uuid %)]}])
+                    [% {:status :invalid :sub-status :no-name}])))

    :kvs-remove
-   (fn [actx kvss m]
-     (act kvs-remove actx
-          (let [{:keys [res-ch name]} m
-                err (atom nil)]
-            (swap! kvss #(if (get-in % [:kvss name])
-                           (dissoc-in % [:kvss name])
-                           (do (reset! err :missing)
-                               %)))
-            (aput kvs-remove res-ch (merge m {:err err})))))
+   (fn [actx state-ch m]
+     (kvs-work actx state-ch m
+               (fn [state kvs]
+                 [(dissoc-in state [:kvss (:name kvs)]) {:status :ok}])))

    :multi-get
-   (fn [actx kvss [res-ch name keys]]
-     (act kvs-multi-get actx))
+   (fn [actx state-ch m]
+     (kvs-work actx state-ch m
+               (fn [state kvs]
+                 [state {:status :ok
+                         :results (map #(kvs-entry-by-key kvs %) (:keys m))}])))

    :multi-change
-   (fn [actx kvss [res-ch name changes]])
+   (fn [actx state-ch [res-ch name changes]])

    :scan-keys
-   (fn [actx kvss [res-ch name from-key to-key]])
+   (fn [actx state-ch [res-ch name from-key to-key]])

    :scan-changes
-   (fn [actx kvss [res-ch name from-sq to-sq]])
+   (fn [actx state-ch [res-ch name from-sq to-sq]])

    :sync
-   (fn [actx kvss [res-ch name]])})
+   (fn [actx state-ch [res-ch name]])})

 (defn make-kvs-mgr [actx]
   (let [cmd-ch (achan actx)
-        kvss (atom {})] ; { :next-uuid 0
-                        ;   :kvss => { name => kvs } }.
-    (act-loop kvs actx [tot-ops 0]
-              (when-let [m (atake kvs cmd-ch)]
+        state-ch (achan actx)]
+    (act-loop kvs-mgr-in actx [tot-ops 0]
+              (when-let [m (atake kvs-mgr-in cmd-ch)]
                 (if-let [op-handler (get op-handlers (:op m))]
-                  (do (op-handler kvs kvss m)
+                  (do (op-handler kvs-mgr-in state-ch m)
                       (recur (inc tot-ops)))
-                  (println :UNKNOWN-KVS-OP m))))
+                  (println :kvs-mgr-in-unknown-op-exit m))))
+
+    ; Using kvs-mgr-state to avoid atoms, which prevent time-travel.
+    (act-loop kvs-mgr-state actx [state { :next-uuid 0 :kvss {} }]
+              (if-let [[state-fn res-ch] (atake kvs-mgr-state state-ch)]
+                (if-let [[next-state res] (state-fn state)]
+                  (do (aput-close kvs-mgr-state res-ch res)
+                      (recur next-state))
+                  (println :kvs-mgr-state-fn-exit))
+                (println :kvs-mgr-state-ch-exit)))
     cmd-ch))


Renamed run! to run-app! to remove confusion with core run!

--- src/riemann/bin.clj
+++ src/riemann/bin.clj
@@ -112,7 +112,7 @@
     (when-not (instance? DynamicClassLoader cl)
       (.setContextClassLoader thread (DynamicClassLoader. cl)))))

-(defn run!
+(defn run-app!
   "Start Riemann with the given setup function. The setup function is responsible
   for executing code that you would normally put into your riemann.config file,
   e.g. setting up streams."
@@ -136,7 +136,7 @@
    (case command
      "start" (try
                (set-config-file! config)
-               (run! #(riemann.config/include @config-file))
+               (run-app! #(riemann.config/include @config-file))
                (catch Exception e
                  (error e "Couldn't start")))


rename redis-conn -> redis-conn-opts

rename redis-conn -> redis-conn-opts

--- src/shale/redis.clj
+++ src/shale/redis.clj
@@ -2,8 +2,8 @@
   (:require [taoensso.carmine :as car :refer (wcar)])
   (:use [shale.configurer :only [config]]))

-(def redis-conn  {:pool {} :spec (config :redis)})
-(defmacro with-car*  [& body] `(car/wcar redis-conn ~@body))
+(def redis-conn-opts  {:pool {} :spec (config :redis)})
+(defmacro with-car*  [& body] `(car/wcar redis-conn-opts ~@body))

 (def redis-key-prefix "_shale")


Removed zipper for stack

Removed zipper for stack

--- src/tubax/core.cljs
+++ src/tubax/core.cljs
@@ -3,24 +3,58 @@
             [clojure.zip :as zip]
             [clojure.string :as str]))

+; (defn- new-document []
+;   (zip/vector-zip []))
+;
+; (defn- add-node-document [node document]
+;   (let [keytag (keyword (.-name node))
+;         att-map (js->clj (.-attributes node) :keywordize-keys true)
+;         node-value [keytag att-map nil]]
+;     (-> document
+;         (zip/append-child (vector keytag att-map []))
+;         zip/down
+;         zip/rightmost
+;         zip/down
+;         zip/rightmost)))
+;
+; (defn- close-node-document [node document]
+;   (-> document zip/up zip/up))
+;
+; (defn- add-text [text document]
+;   (if (not (empty? text))
+;     (zip/append-child document text)
+;     document))
+;
+; (defn- format-document [document]
+;   (first (zip/root document)))
+
+(defn- new-document []
+  (list))
+
 (defn- add-node-document [node document]
   (let [keytag (keyword (.-name node))
         att-map (js->clj (.-attributes node) :keywordize-keys true)
-        node-value [keytag att-map nil]]
-    (-> document
-        (zip/append-child (vector keytag att-map []))
-        zip/down
-        zip/rightmost
-        zip/down
-        zip/rightmost)))
+        node-value [keytag att-map []]]
+    (-> document (conj node-value))))

 (defn- close-node-document [node document]
-  (-> document zip/up zip/up))
+  (if (not (empty? (rest document)))
+    (let [current-node    (first document)
+          father-node     (first (rest document))
+          father-children (nth father-node 2)
+          new-father (assoc father-node 2 (conj father-children current-node))]
+      (conj (rest (rest document)) new-father))
+    document))

 (defn- add-text [text document]
   (if (not (empty? text))
-    (zip/append-child document text)
+    (let [current-node (first document)
+          new-node-value (assoc current-node 2 (conj (nth current-node 2) text))]
+      (conj (rest document) new-node-value))
     document))
+
+(defn- format-document [document]
+  (first document))

 (defn xml->clj [source & {:keys [strict trim normalize
                                 lowercase xmlns position
@@ -37,7 +71,7 @@
                                            "xmlns" xmlns
                                            "position" position
                                            "strictEntities" strict-entities})
-        document (atom (zip/vector-zip []))
+        document (atom (new-document))
         result (atom nil)]
     ;; OPEN TAG
     (set! (.-onopentag parser)
@@ -54,7 +88,7 @@
     ;; END PARSING
     (set! (.-onend parser)
           #(when (nil? @result)
-            (reset! result {:success (first (zip/root @document))})))
+            (reset! result {:success (format-document @document)})))

     ;; ERROR
     (set! (.-onerror parser)


Add support for javascript modules mime-type

Javascript's module system has a suggested mjs extension, which has
received some degree of adoption (Node [1]), tooling support (Babel [2],
VSCode [3]), and is already present on Google's JS Modules documentation
[4].

The only requirement is that they're sent with JS's MIME.

[1] -
http://2ality.com/2017/05/es-module-specifiers.html#why-new-extension
[2] - https://github.com/babel/babel/pull/5624
[3] - https://github.com/Microsoft/vscode/pull/25747
[4] - https://developers.google.com/web/fundamentals/primers/modules

--- ring-core/src/ring/util/mime_type.clj
+++ ring-core/src/ring/util/mime_type.clj
@@ -51,6 +51,7 @@
    "mov"      "video/quicktime"
    "m3u8"     "application/x-mpegurl"
    "m4v"      "video/mp4"
+   "mjs"      "text/javascript"
    "mp3"      "audio/mpeg"
    "mp4"      "video/mp4"
    "mpd"      "application/dash+xml"


Added "managers" to cloud credentials. (#1614)

* Added "managers" to cloud credentials.

* force type of collection

--- cimi/src/com/sixsq/slipstream/ssclj/resources/spec/credential_template_cloud.cljc
+++ cimi/src/com/sixsq/slipstream/ssclj/resources/spec/credential_template_cloud.cljc
@@ -1,19 +1,25 @@
 (ns com.sixsq.slipstream.ssclj.resources.spec.credential-template-cloud
   (:require
     [clojure.spec.alpha :as s]
+    [com.sixsq.slipstream.ssclj.util.spec :as su]
     [com.sixsq.slipstream.ssclj.resources.spec.common :as cimi-common]
-    [com.sixsq.slipstream.ssclj.resources.spec.core :as cimi-core]))
+    [com.sixsq.slipstream.ssclj.resources.spec.core :as cimi-core]
+    [com.sixsq.slipstream.ssclj.resources.spec.acl :as cimi-acl]))

 ;; FIXME: see https://github.com/slipstream/SlipStreamServer/issues/1309
 (s/def ::key string?)                                       ;; ::cimi-core/nonblank-string
 (s/def ::secret string?)                                    ;; ::cimi-core/nonblank-string
 (s/def ::connector ::cimi-common/resource-link)
 (s/def ::quota nat-int?)
+(s/def ::manager (su/only-keys :req-un [::cimi-acl/principal
+                                        ::cimi-acl/type]))
+(s/def ::managers (s/coll-of ::manager :min-count 1 :kind vector?))

 (def credential-template-cloud-keys-spec
   {:req-un [::key
             ::secret
             ::connector
-            ::quota]})
+            ::quota]
+   :opt-un [::managers]})

 (def credential-template-create-keys-spec credential-template-cloud-keys-spec)


CMR-4075 - Refactored docs-gen for more generalized usage.

In particular, this will allow us to use any templating mechanism in
conjunction with the CMR-native docs generation facility.

Also contains changes addressing review feedback from @chris-durbin.

--- common-app-lib/src/cmr/common_app/api_docs.clj
+++ common-app-lib/src/cmr/common_app/api_docs.clj
@@ -151,23 +151,43 @@
   "Defines the footer of the generated documentation page."
   "
")

+(defn renderer
+  "Given a hash-map of HTML page data, renders a complete HTML page."
+  [data]
+  (str (header (:page-title data))
+       (:page-content data)
+       footer))
+
+(defn md->html
+  "Given markdown and an optional markdown processor, converts it to HTML.
+  If a processor is not provided, one will be created."
+  ([markdown]
+   (let [processor (PegDownProcessor.
+                     (int (bit-or Extensions/AUTOLINKS
+                                  Extensions/HARDWRAPS
+                                  Extensions/TABLES
+                                  Extensions/FENCED_CODE_BLOCKS)))]
+     (md->html processor markdown)))
+  ([processor markdown]
+   (.markdownToHtml processor markdown)))
+
 (defn generate
   "Generates the API documentation HTML page from the markdown source.
   Args
   * page-title - The title to use in the generated documentation page.
-  * docs-source - The file containing the markdown API documentation. Example: api_docs.md
+  * docs-source - The file containing the markdown API documentation.
+    Example: `api_docs.md`
   * docs-target - The file that will be generated with the API documentation.
-  Examplae resources/public/site/api_docs.html"
-  [page-title docs-source docs-target]
-  (println "Generating" docs-target "from" docs-source)
-  (io/make-parents docs-target)
-  (let [processor (PegDownProcessor.
-                    (int (bit-or Extensions/AUTOLINKS
-                                 Extensions/HARDWRAPS
-                                 Extensions/TABLES
-                                 Extensions/FENCED_CODE_BLOCKS)))]
-    (spit docs-target (str (header page-title)
-                           (.markdownToHtml processor (slurp docs-source))
-                           footer)))
-
-  (println "Done"))
+    Example: `resources/public/site/api_docs.html`
+  * render-fn - An optional 0-arity function that will replace the default
+     render function."
+  ([page-title docs-source docs-target]
+    (let [data {:page-title page-title
+                :page-content (md->html (slurp docs-source))}
+          render-fn (fn [] (renderer data))]
+      (generate page-title docs-source docs-target render-fn)))
+  ([page-title docs-source docs-target render-fn]
+   (println (format "Generating %s from %s ..." docs-target docs-source))
+   (io/make-parents docs-target)
+   (spit docs-target (render-fn))
+   (println "Done.")))


Add dedicated namespace for storage initialization.

--- src/uxbox/media.clj
+++ src/uxbox/media.clj
@@ -5,42 +5,25 @@
 ;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

 (ns uxbox.media
-  "A media storage persistence layer."
-  (:require [uxbox.media.proto :as p]
-            [uxbox.media.fs :as fs]
-            [uxbox.media.impl]))
+  "A media storage impl for uxbox."
+  (:require [mount.core :as mount :refer (defstate)]
+            [cuerdas.core :as str]
+            [storages.core :as st]
+            [storages.fs :refer (filesystem)]
+            [storages.misc :refer (hashed)]
+            [uxbox.config :refer (config)]))

-(defn save
-  "Perists a file or bytes in the storage. This function
-  returns a relative path where file is saved.
+(defn- resolve-basedir
+  [^String basedir]
+  (or (io/resource basedir)
+      basedir))

-  The final file path can be different to the one provided
-  to this function and the behavior is totally dependen on
-  the storage implementation."
-  [storage path content]
-  (p/-save storage path content))
+(defn- initialize-storage
+  [{:keys [basedir baseuri] :as config}]
+  (let [basedir (resolve-basedir basedir)]
+    (-> (filesystem {:basedir basedir
+                     :baseuri baseuri})
+        (hashed))))

-(defn lookup
-  "Resolve provided relative path in the storage and return
-  the local filesystem absolute path to it.
-  This method may be not implemented in all storages."
-  [storage path]
-  {:pre [(satisfies? p/ILocalStorage storage)]}
-  (p/-lookup storage path))
-
-(defn exists?
-  "Check if a  relative `path` exists in the storage."
-  [storage path]
-  (p/-exists? storage path))
-
-(defn delete
-  "Delete a file from the storage."
-  [storage path]
-  (p/-delete storage path))
-
-(defn path
-  "Create path from string or more than one string."
-  [fst & more]
-  (if (seq more)
-    (p/-path (cons fst more))
-    (p/-path fst)))
+(defstate storage
+  :start (initialize-storage (:storage config)))


add missing notes to dubstep example

add missing notes to dubstep example

--- test/example/dubstep.clj
+++ test/example/dubstep.clj
@@ -100,6 +100,7 @@
   ;;For connecting with a monome to control the wobble and note
   (require '(polynome [core :as poly]))
   (def m (poly/init "/dev/tty.usbserial-m64-0790"))
+  (def notes (reverse [25 27 28 35 40 41 50 78]))
   (poly/on-press m (fn [x y s]
                    (do
                      (let [wobble (inc y)


Update main parsing test

Update main parsing test

--- test/jest/parse_test.clj
+++ test/jest/parse_test.clj
@@ -20,7 +20,7 @@
 (deftest func-def-test
   (test-code
    "defn foobar(a, b, c){ 10 };"
-   ["(defn foobar[ a b c] 10)"]))
+   ["(defn foobar [ a b c ] 10)"]))

 (deftest import-test
   (test-code


Added raw-report.

Added raw-report.

--- test/midje/test_util.clj
+++ test/midje/test_util.clj
@@ -31,4 +31,5 @@
   (every? #(= (:type %) :pass) (deref reported)))
 (defn only-one-result? []
   (= 1 (count (deref reported))))
-
+
+(defn raw-report [] (println @reported))


Removes generated repl file that I'm not using

--- src/wordly/repl.clj
+++ src/wordly/repl.clj
@@ -1,34 +0,0 @@
-(ns wordly.repl
-  (:use wordly.handler
-        ring.server.standalone
-        [ring.middleware file-info file]))
-
-(defonce server (atom nil))
-
-(defn get-handler []
-  ;; #'app expands to (var app) so that when we reload our code,
-  ;; the server is forced to re-resolve the symbol in the var
-  ;; rather than having its own copy. When the root binding
-  ;; changes, the server picks it up without having to restart.
-  (-> #'app
-    ; Makes static assets in $PROJECT_DIR/resources/public/ available.
-    (wrap-file "resources")
-    ; Content-Type, Content-Length, and Last Modified headers for files in body
-    (wrap-file-info)))
-
-(defn start-server
-  "used for starting the server in development mode from REPL"
-  [& [port]]
-  (let [port (if port (Integer/parseInt port) 8080)]
-    (reset! server
-            (serve (get-handler)
-                   {:port port
-                    :init init
-                    :auto-reload? true
-                    :destroy destroy
-                    :join true}))
-    (println (str "You can view the site at http://localhost:" port))))
-
-(defn stop-server []
-  (.stop @server)
-  (reset! server nil))


Fix comment author var name and a comment.

--- src/oc/storage/async/storage_notification.clj
+++ src/oc/storage/async/storage_notification.clj
@@ -120,17 +120,18 @@
   (pool/with-pool [conn db-pool]
     (if-let* [entry-uuid (:item-id body)
               entry-data (entry-res/get-entry conn entry-uuid)
-              comment-publisher (first (:users body))
+              comment-author (first (:users body))
               org (org-res/get-org conn (:org-uuid entry-data))
               board (board-res/get-board conn (:board-uuid entry-data))
               user-visibility (get entry-data :user-visibility {})]
+      ;; Send a message to all following users to force refresh inbox
       (do
         (when (= (:status entry-data) "published")
-          ;; For every following user
+          ;; For every following user except the comment author
           (when-let [user-ids (seq (remove nil?
                                (for [user-key (keys user-visibility)]
                                  (when (and ;; user is not the comment publisher
-                                            (not= (name user-key) (:user-id comment-publisher))
+                                            (not= (name user-key) (:user-id comment-author))
                                             ;; user is following the post
                                             (->> user-key (get user-visibility) :follow))
                                     (name user-key)))))]


Change prod env to retroboard.herokuapp.com

--- environments/production/retroboard/config.cljs
+++ environments/production/retroboard/config.cljs
@@ -1,3 +1,3 @@
 (ns retroboard.config)

-(def ws-url "ws://arcane-bastion-5301.herokuapp.com/ws")
+(def ws-url "ws://retroboard.herokuapp.com/ws")


turn off logging

turn off logging

--- src/om_next_datascript_localisation_demo/logging.cljc
+++ src/om_next_datascript_localisation_demo/logging.cljc
@@ -2,7 +2,7 @@

 ;; change this def to true/false to turn logging on/off
 ;; when off, all logging is removed from code
-(def logging-is-on true)
+(def logging-is-on false)

 (defmacro log [& args]
   `(when logging-is-on


rename "schema" column to plane

rename "schema" column to plane

--- src/storaged/src/leela/storaged/cassandra/metrics.clj
+++ src/storaged/src/leela/storaged/cassandra/metrics.clj
@@ -24,37 +24,29 @@

 (defn create-schema []
   (conn/create-table-ifne metrics-table
-                          (stmt/column-definitions [["schema"  :int]
-                                                    [:metric   :int]
-                                                    [:bucket   :bigint]
-                                                    [:offset   :int]
-                                                    [:datum    :blob]
-                                                    [:primary-key [["schema" :metric :bucket] :offset]]])
+                          (stmt/column-definitions [[:plane  :int]
+                                                    [:metric :int]
+                                                    [:bucket :bigint]
+                                                    [:offset :int]
+                                                    [:datum  :blob]
+                                                    [:primary-key [[:plane :metric :bucket] :offset]]])
                           (stmt/with {:compaction {:class "SizeTieredCompactionStrategy"
                                                    :cold_reads_to_omit "0"}
                                       :compact-storage :true}))
   (conn/create-table-ifne metrics-idx-table
-                          (stmt/column-definitions [["schema"  :int]
+                          (stmt/column-definitions [[:plane    :int]
                                                     [:metric   :int]
                                                     [:bucket   :bigint]
                                                     [:location :text]
-                                                    [:primary-key [["schema" :metric] :bucket :location]]])
+                                                    [:primary-key [[:plane :metric] :bucket :location]]])
                           (stmt/with {:compaction {:class "LeveledCompactionStrategy"
                                                    :sstable_size_in_mb "256"}
                                       :clustering-order [[:bucket :desc]]}))
   (conn/create-trigger-ifne metrics-trigger metrics-table mtrigger-class))

-
-(defn index-metric [schema metric bucket location]
-  (cql/insert *cluster* (conn/fqn metrics-idx-table)
-              {"schema" schema
-               :metric metric
-               :bucket bucket
-               :location location}))
-
-(defn store-metric [schema metric bucket offset datum]
+(defn store-metric [plane metric bucket offset datum]
   (cql/insert *cluster* (conn/fqn metrics-table)
-              {"schema" schema
+              {:plane  plane
                :metric metric
                :bucket bucket
                :offset offset
@@ -75,21 +67,21 @@
                    (stmt/limit *limit*))))

 (defn fetch-index
-  ([schema metric]
-   (fetch-index-with- [[= "schema" schema]
+  ([plane metric]
+   (fetch-index-with- [[= :plane plane]
                        [= :metric metric]]))
-  ([schema metric bucket]
-   (fetch-index-with- [[= "schema" schema]
+  ([plane metric bucket]
+   (fetch-index-with- [[= :plane plane]
                        [= :metric metric]
                        [< :bucket bucket]])))

 (defn fetch-metric
-  ([schema metric bucket]
-   (fetch-metric-with- [[= "schema" schema]
+  ([plane metric bucket]
+   (fetch-metric-with- [[= :plane plane]
                         [= :metric metric]
                         [= :bucket bucket]]))
-  ([schema metric bucket offset]
-   (fetch-metric-with- [[= "schema" schema]
+  ([plane metric bucket offset]
+   (fetch-metric-with- [[= :plane plane]
                         [= :metric metric]
                         [= :bucket bucket]
                         [> :offset offset]])))


Add some more Jloj examples to the bottom of core.clj

--- src/jloj/core.clj
+++ src/jloj/core.clj
@@ -249,6 +249,9 @@
   (Jloj/and [true nil true])

   (.orElse (Jloj/pipe (Jloj/and [true nil true])) 42)
+  (Jloj/or [(Jloj/pipe (Jloj/and [true nil true])) 42])
+  (.orElse (Jloj/pipe 1 [inc (fn [x] nil) inc]) 5)
+  (Jloj/or [(Jloj/pipe 1 [inc (fn [x] nil) inc]) 5])
   (Jloj/or [(Jloj/and [true nil true]) 42])
   (= (Jloj/or [(Jloj/and [true nil true]) false nil "x"])
      (Jloj/or [(Jloj/and [true nil true]) "x" false nil]))
@@ -266,4 +269,6 @@
               nil 2
               true 3])

+  (deref (Jloj/atom 5))
+
   )


maybe not on radix

maybe not on radix

--- src/kvdb/core.clj
+++ src/kvdb/core.clj
@@ -31,9 +31,17 @@
   [db k]
   (contains? @db k))

+;;; From https://stackoverflow.com/questions/11670941/generate-character-sequence-from-a-to-z-in-clojure
+(defn char-range [start end]
+  (map char (range (int start) (inc (int end)))))
+
 (defn empty-db
   []
   (atom {}))
+; (atom (into {} (map #([% (atom {})]) (char-range \A \z))))
+(defn db-subset
+  [db character]
+  (get @db character))

 (defn kv-whole-map
   "Returns a hashmap snapshot of the entire database


Adjust signature of nav-handler

Adjust signature of nav-handler

It doesn't make a ton of sense for us to tell clients of this function
about the join param, so stop destructuring it in the method sig

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -122,7 +122,7 @@
    (analytics/track-message (first value))))

 (defn nav-handler
-  [[navigation-point {:keys [inner?] {:keys [join] :as query-params} :query-params :as args} :as value] state history]
+  [[navigation-point {:keys [inner? query-params] :as args} :as value] state history]
   (when (log-channels?)
     (mlog "Navigation Verbose: " value))
   (swallow-errors
@@ -131,7 +131,7 @@
        (swap! state (partial nav-con/navigated-to history navigation-point args))
        (nav-con/post-navigated-to! history navigation-point args previous-state @state)
        (analytics/register-last-touch-utm query-params)
-       (when join (analytics/track-join-code join))
+       (when-let [join (:join query-params)] (analytics/track-join-code join))
        (analytics/track-view-page (if inner? :inner :outer))))))

 (defn api-handler


Update REPL usage notes.

Update REPL usage notes.


remove random chars in sample-looper

remove random chars in sample-looper

--- examples/sample_looper.clj
+++ examples/sample_looper.clj
@@ -75,7 +75,7 @@
         vals (range from to step)]
     (dorun (map #(do (ctl loop-synth :rate (reset! rate* %)) (Thread/sleep 35)) vals))))

-;;(tempo-slide sdlkfjsf lsdjfsdlkjf 0)
+;;(tempo-slide  2)
 ;;(volume 1.5)
 ;;(reset-samples!)
 ;;(trigger 1 1)


Try to fallback to jar if unzip isn't found [IMMUTANT-16]

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -28,11 +28,19 @@
             [org.satta.glob                 :as glob])
   (:use [clojure.pprint :only [pprint]]))

+(defn unzip* [& sh-args]
+  (let [result (apply shell/sh sh-args)]
+    (if (not= (:exit result) 0)
+      (println "ERROR: zip extraction failed:" (:err result)))
+    (:out result)))
+
 (defn unzip [zip-file dest-dir]
-  (let [result (shell/sh "unzip" "-q" "-d" (str dest-dir) zip-file)]
-    (if (not= (:exit result) 0)
-      (println "ERROR: unzip failed:" (:err result)))
-    (:out result)))
+  (try
+    (unzip* "unzip" "-q" "-d" (str dest-dir) zip-file)
+    (catch java.io.IOException e
+      (println "'unzip' not found, trying 'jar'...")
+      (unzip* "jar" "xvf" zip-file :dir (doto (io/file dest-dir)
+                                          (.mkdir))))))

 (defn with-message [message & body]
   (print (str message "... "))


add log appender(file), remove lein sass (temporary)

--- dev/user.clj
+++ dev/user.clj
@@ -7,14 +7,18 @@
             [reloaded.repl :refer [system init]]
             [ring.middleware.reload :refer [wrap-reload]]
             [figwheel-sidecar.repl-api :as figwheel]
-            [om-next-leaflet.components.shell-component :refer [shell-component]]
+            [taoensso.timbre :as timbre :refer [log trace debug info warn error fatal]]
+            [taoensso.timbre.appenders.core :as appenders]
+            ;;[om-next-leaflet.components.shell-component :refer [shell-component]]
             [om-next-leaflet.config :refer [config]]))

 (defn dev-system []
+  (timbre/merge-config! {:appenders {:spit (appenders/spit-appender {:fname "log/om-next-leaflet.log"})}})
   (assoc (om-next-leaflet.application/app-system (config))
     :figwheel-system (fw-sys/figwheel-system (fw-config/fetch-config))
     :css-watcher (fw-sys/css-watcher {:watch-paths ["resources/public/css"]})
-    :sass (shell-component "lein" "auto" "sassc" "once")))
+    ;;:sass (shell-component "lein" "auto" "sassc" "once")
+    ))

 (set-refresh-dirs "src" "dev")
 (reloaded.repl/set-init! #(dev-system))


get (reset) and (reset-and-delete-db! :delete-db) working

--- dev/user.clj
+++ dev/user.clj
@@ -10,11 +10,26 @@
             [galleon]
             [navigator]))

+(defn stop! []
+  (alter-var-root #'galleon/system galleon/stop-system!))
+
+(defn start! []
+  (alter-var-root #'galleon/system galleon/start-system!))
+
 (defn reset
   "If you are accustomed to tools.namespace and reset, you can use this.
    It makes you feel better."
   []
-  (reload-project!))
+  (stop!)
+  (reload-project!)
+  (start!))
+
+(defn reset-and-delete-db! [delete-db]
+  (when (= :delete-db delete-db)
+    (stop!)
+    (d/delete-database (get-in galleon/system [:config :datomic-url]))
+    (reload-project!)
+    (start!)))

 (defn touch-that
   "Execute the specified query on the current DB and return the


Victorianify former core.

Victorianify former core.

--- src/manners/victorian.clj
+++ src/manners/victorian.clj
@@ -8,60 +8,60 @@
   (fn [& more]
     (try (apply func more) (catch Exception _))))

-(defn- unmemoized-manners
-  "Return a memoized function which takes a value to run the given validations
+(defn- unmemoized-coach
+  "Return a memoized function which takes a value to run the given etiquette
    on."
-  [validations]
-  {:pre [(sequential? validations)]}
+  [etiquette]
+  {:pre [(sequential? etiquette)]}
   (memoize (fn [value]
-             (for [[predicate & message] validations
+             (for [[predicate & message] etiquette
                    :when ((-> predicate wrap-try complement) value)]
                (apply str message)))))

-(def manners
+(def coach
   "Create a function from a sequence of validators that returns a sequence of
-   faults."
-  (memoize unmemoized-manners))
+   bad manners."
+  (memoize unmemoized-coach))

-(defn faults
-  "Return all faults found with the given validations on the given value."
-  [validations value]
-  ((manners validations) value))
+(defn bad-manners
+  "Return all bad manners found with the given etiquette on the given value."
+  [etiquette value]
+  ((coach etiquette) value))

 (defn proper?
-  "A predicate to determine if the given value has any faults according to the
+  "A predicate to determine if the given value has any bad manners according to the
    validations."
-  [validations value]
-  (empty? (faults validations value)))
+  [etiquette value]
+  (empty? (bad-manners etiquette value)))

-(def rude? (complement faultless?))
+(def rude? (complement proper?))

 (defn falter
-  "Throw an AssertionError when there are faults."
-  ([prefix-sym faults]
+  "Throw an AssertionError when there are bad manners."
+  ([prefix-sym bad-manners]
    (let [full-prefix (when prefix-sym (str "Invalid " prefix-sym ": "))]
-     (when-not (empty? faults)
-       (throw (AssertionError. (str full-prefix (s/join ", " faults)))))))
-  ([faults] (falter nil faults)))
+     (when-not (empty? bad-manners)
+       (throw (AssertionError. (str full-prefix (s/join ", " bad-manners)))))))
+  ([bad-manners] (falter nil bad-manners)))

-(defn faultless!
-  "Throw an AssertionError if there are any faults found on the given value with
+(defn avow!
+  "Throw an AssertionError if there are any bad manners found on the given value with
    the given validations."
-  ([prefix validations value] (falter prefix (faults validations value)))
-  ([validations value] (faultless! nil validations value)))
+  ([prefix etiquette value] (falter prefix (bad-manners etiquette value)))
+  ([etiquette value] (avow! nil etiquette value)))

-(defmacro demannerss
-  [obj-sym & validations]
-  (let [faults-sym (symbol (str obj-sym "-faults"))
-        faultless?-sym (symbol (str "faultless-" obj-sym \?))
-        faulty?-sym (symbol (str "faulty-" obj-sym \?))
-        faultless!-sym (symbol (str "faultless-" obj-sym \!))]
+(defmacro defmanners
+  [obj-sym & etiquette]
+  (let [bad-manners-sym (symbol (str "bad-" obj-sym "-manners"))
+        proper?-sym (symbol (str "proper-" obj-sym \?))
+        rude?-sym (symbol (str "rude-" obj-sym \?))
+        avow!-sym (symbol (str "avow-" obj-sym \!))]
     `(do
-       (def ~faults-sym
-         (partial faults [~@validations]))
-       (def ~faultless?-sym
-         (partial faultless? [~@validations]))
-       (def ~faulty?-sym
-         (partial faulty? [~@validations]))
-       (defn ~faultless!-sym [value#]
-         (faultless! (quote ~obj-sym) [~@validations] value#)))))
+       (def ~bad-manners-sym
+         (partial bad-manners [~@etiquette]))
+       (def ~proper?-sym
+         (partial proper? [~@etiquette]))
+       (def ~rude?-sym
+         (partial rude? [~@etiquette]))
+       (defn ~avow!-sym [value#]
+         (avow! (quote ~obj-sym) [~@etiquette] value#)))))


Fix mouse-button case exception.

Fix mouse-button case exception.

Use condp, rather, than case, since we need the value of the PConstants.

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -2331,10 +2331,10 @@
   or :center depending on which button is pressed."
   []
   (let [button-code   (.-mouseButton (current-applet))]
-    (case button-code
-      LEFT :left
-      RIGHT :right
-      CENTER :center)))
+    (condp = button-code
+      PConstants/LEFT :left
+      PConstants/RIGHT :right
+      PConstants/CENTER :center)))

 (defn
   ^{:requires-bindings true


Allow adding dependencies

Allow adding dependencies

--- lein-light-nrepl/src/lighttable/nrepl/core.clj
+++ lein-light-nrepl/src/lighttable/nrepl/core.clj
@@ -7,7 +7,18 @@
             [clojure.tools.nrepl.middleware :refer [set-descriptor!]]
             [clj-stacktrace.repl :refer [pst+]]
             [fs.core :as fs]
-            [clojure.repl :as repl]))
+            [clojure.repl :as repl]
+            [cemerick.pomegranate :as pomegranate]))
+
+(defn depend-on [{:keys [libs paths nss]}]
+  (pomegranate/add-dependencies
+   :coordinates libs
+   :repositories (merge cemerick.pomegranate.aether/maven-central
+                        {"clojars" "http://clojars.org/repo"}))
+  (doseq [path paths]
+    (pomegranate/add-classpath path))
+  (for [ns nss]
+    (require ns)))

 (def ^{:dynamic true} *ltmsg* nil)
 (def server (atom nil))


:fire: Remove unused code.

:fire: Remove unused code.

--- frontend/src/uxbox/util/components.cljs
+++ frontend/src/uxbox/util/components.cljs
@@ -41,26 +41,3 @@
       (mf/use-effect {:deps true :fn #(after-render state)})
       (for [item (:current @state)]
         (children item)))))
-
-(defn wrap-catch
-  ([component error-component] (wrap-catch component error-component (constantly nil)))
-  ([component error-component on-error]
-   (let [ctor (fn [props]
-                (this-as this
-                  (unchecked-set this "state" #js {})
-                  (.call js/React.Component this props)))
-         _    (goog/inherits ctor js/React.Component)
-         prot (unchecked-get ctor "prototype")]
-    (unchecked-set ctor "displayName" (str "Catch(" (unchecked-get component "displayName") ")"))
-    (unchecked-set ctor "getDerivedStateFromError" (fn [error] #js {:error error}))
-    (unchecked-set prot "componentDidCatch" (fn [e i] (on-error e i)))
-    (unchecked-set prot "render"
-                   (fn []
-                     (this-as this
-                       (let [state (unchecked-get this "state")
-                             error (unchecked-get state "error")]
-                         (if error
-                           (mf/element error-component #js {:error error})
-                           (mf/element component #js {}))))))
-
-    ctor)))


Eliminate dead code (#829)

Eliminate dead code (#829)

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

 (defn- handle-error
   [e include-stacktrace?]
-  (let [cause                     (or (.-cause e) e)]
+  (do
     (print-error e include-stacktrace?)
     (if (not (:repl @app-env))
       (js/PLANCK_EXIT_WITH_VALUE 1)


remove comment

remove comment

--- src/matcha.clj
+++ src/matcha.clj
@@ -10,20 +10,7 @@
             [clojure.test :as test]
             [clojure.data :as data]
             [clojure.pprint :as pprint]))
-;; Matcher
-;; Match
-;;
-;; is :: a -> Matcher a
-;; allOf [Matcher a] -> Matcher a
-;; runMatcher -> Matcher a -> a -> Match
-
-;; a matcher is a map with three fields, each of whose values are functions:
-;; {:match ;; a -> Bool
-;;  :description :: String
-;;  :describe-mismatch :: a -> String }
-;;
-;;  a match is a map with pass? and message, message will be a string
-;;  if pass? if false
+
 (defn describe-list [call xs]
   (str "(" call " " (clojure.string/join " " xs) ")"))


Multiline textfield - fixed wrong cusror positioning on mouse click

--- flatguiwidgets/src/flatgui/widgets/textfield.clj
+++ flatguiwidgets/src/flatgui/widgets/textfield.clj
@@ -335,10 +335,9 @@

 (fg/defevolverfn :caret-visible
   (if (= :has-focus (:mode (get-property [:this] :focus-state)))
-    ;(if (timer/timer-event? component)
-    ;  (not old-caret-visible)
-    ;  old-caret-visible)
-    true
+    (if (timer/timer-event? component)
+      (not old-caret-visible)
+      old-caret-visible)
     false))

 (defn textfield-dflt-text-suplier [component]


internal/ -> wboss/ to make the source ns clearer.

--- web/src/immutant/web.clj
+++ web/src/immutant/web.clj
@@ -17,7 +17,7 @@
   (:require [immutant.internal.options :refer [boolify opts->set set-valid-options!
                                                validate-options extract-options]]
             [immutant.internal.util    :refer [kwargs-or-map->map]]
-            [immutant.web.internal.wunderboss :as internal]
+            [immutant.web.internal.wunderboss :as wboss]
             [immutant.web.undertow :as undertow])
   (:import [org.projectodd.wunderboss.web Web Web$CreateOption Web$RegisterOption]))

@@ -86,12 +86,12 @@
   (let [options (-> options
                   kwargs-or-map->map
                   (validate-options run)
-                  internal/available-port
+                  wboss/available-port
                   undertow/options-maybe
-                  (->> (merge internal/create-defaults internal/register-defaults)))]
-    (let [server (internal/server options)]
-      (internal/mount server handler options)
-      (update-in options [:contexts server] conj (internal/mounts options)))))
+                  (->> (merge wboss/create-defaults wboss/register-defaults)))]
+    (let [server (wboss/server options)]
+      (wboss/mount server handler options)
+      (update-in options [:contexts server] conj (wboss/mounts options)))))

 (set-valid-options! run (-> (opts->set Web$CreateOption Web$RegisterOption)
                           (conj :contexts)
@@ -112,7 +112,7 @@
   (let [opts (-> options
                kwargs-or-map->map
                (validate-options run "stop"))
-        contexts (:contexts opts {(internal/server opts) [(internal/mounts opts)]})
+        contexts (:contexts opts {(wboss/server opts) [(wboss/mounts opts)]})
         stopped (some boolean (doall (for [[^Web s os] contexts, o os]
                                        (.unregister s (extract-options o Web$RegisterOption)))))]
     (doseq [^Web server (keys contexts)]
@@ -132,7 +132,7 @@
                       (resolve handler))
                   `(var ~handler)
                   handler)]
-    `(internal/run-dmc* run ~handler ~@options)))
+    `(wboss/run-dmc* run ~handler ~@options)))

 (defn server
   "Returns the web server instance associated with a particular set of
@@ -155,8 +155,8 @@
   [& options]
   (let [options (->> options
                   kwargs-or-map->map
-                  (merge internal/create-defaults internal/register-defaults))
-        servers (keys (:contexts options {(internal/server options) nil}))]
+                  (merge wboss/create-defaults wboss/register-defaults))
+        servers (keys (:contexts options {(wboss/server options) nil}))]
     (if (= 1 (count servers))
       (first servers)
       servers)))


upgrade to CLJS version that has pprint

upgrade to CLJS version that has pprint

--- pp-node-server/project.clj
+++ pp-node-server/project.clj
@@ -9,6 +9,6 @@
            :output-to "server.js",
            :target :nodejs,
            :pretty-print true}}]}
-  :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2665"]]
-  :plugins [[lein-cljsbuild "1.0.4"]])
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 [org.clojure/clojurescript "1.7.170"]]
+  :plugins [[lein-cljsbuild "1.1.3"]])


Exclude the kibit linter.

Exclude the kibit linter.

--- lein/.lein/profiles.clj
+++ lein/.lein/profiles.clj
@@ -1,5 +1,6 @@
 {:user
- {:env {:squiggly {:checkers [:eastwood]}}
+ {:env {:squiggly {:checkers [:eastwood]
+                   :eastwood-exclude-linters [:kibit]}}
   :plugin-repositories [["private-plugins"
                          {:url "private repo url"}]]
         :singing {:gpg-key "matthew.russell@wormbase.org"}


CMR-6119: Changed providers cache to consistent cache so that clear-cache will work for providers.

--- ingest-app/src/cmr/ingest/services/providers_cache.clj
+++ ingest-app/src/cmr/ingest/services/providers_cache.clj
@@ -1,14 +1,19 @@
 (ns cmr.ingest.services.providers-cache
   "Defines functions for creating, configuring and retrieving values from providers cache.
-  The providers cache is a TTL cache with only one key :providers and all providers as its value."
+  The providers cache is a consistent cache with only one key :providers and all providers as its value."
   (:require [cmr.common.cache :as cache]
             [cmr.common.config :as cfg :refer [defconfig]]
-            [cmr.common.cache.in-memory-cache :as mem-cache]
-            [cmr.ingest.services.provider-service :as ps]))
+            [cmr.ingest.services.provider-service :as ps]
+            [cmr.transmit.cache.consistent-cache :as consistent-cache]))

 (def providers-cache-key
   "The cache key for the providers cache."
   :providers)
+
+(def providers-keys-to-track
+  "The collection of keys which should be deleted from redis whenever someone attempts to clear the
+  providers cache."
+  [":providers-hash-code"])

 (defconfig providers-cache-time-seconds
   "The number of seconds providers information will be cached."
@@ -17,7 +22,9 @@
 (defn create-providers-cache
   "Creates a cache for providers."
   []
-  (mem-cache/create-in-memory-cache :ttl {} {:ttl (* 1000 (providers-cache-time-seconds))}))
+  (consistent-cache/create-consistent-cache
+   {:ttl (providers-cache-time-seconds)
+    :keys-to-track providers-keys-to-track}))

 (defn get-providers-from-cache
   [context]


adjust test backend server to also serve the frontend

--- backend/src/lambdaui/api.clj
+++ backend/src/lambdaui/api.clj
@@ -2,7 +2,8 @@
   (:require [org.httpkit.server :as http :refer [with-channel on-close on-receive send!]]
             [compojure.core :refer [routes GET POST defroutes]]
             [lambdaui.dummy-data :as frontend-dummy]
-            [ring.middleware.json :as ring-json])
+            [ring.middleware.json :as ring-json]
+            [compojure.route :as route])
   )

@@ -18,7 +19,9 @@

 (defn backend-for-frontend []
   (ring-json/wrap-json-response
-    (routes (GET "/summaries" [] (frontend-dummy/build-summaries))))
+    (routes (GET "/summaries" [] (frontend-dummy/build-summaries))
+            (route/resources "/" {:root "public"})
+            ))
   )


register! method added react-shim applied by default for react-native environment

--- src/core.cljs
+++ src/core.cljs
@@ -22,22 +22,31 @@
 (def text (partial element (:text modules)))
 (def text-input (partial element (:text-input modules)))

-(def register-component (aget (:registry modules) "registerComponent"))
+(def register-component
+  (when-let [registry (:registry modules)]
+    (aget registry "registerComponent")))

-(defn register! [name mount]
-  (let [registered? (seq (.getAppKeys (:registry modules)))
-        root-tag 1]
-    (if registered?
-      (mount root-tag)
-      (.registerRunnable (:registry modules) #(mount (.rootTag %))))))
-
-(defn shim-react! []
-  (aset (aget (js/eval "goog") "global") "React" (js-obj "Component" (:react-element modules)
-                                                         "createElement" (.-createElement (:react-element modules)))))
+(defn register! [app-name mount node]
+  "If we have any app in registry - simply re-mount the app to the root node,
+   we need it for the REPL staff. If nothing exists yet - register in
+   a usual way. If we are in a browser - mount to the browser node"
+  (if react-native?
+    (if (seq (.getAppKeys (:registry modules)))
+      (mount react-native-root)
+      (.registerRunnable (:registry modules) app-name #(mount (aget % "rootTag"))))
+    (mount (node))))

 (def om-options
-  {:root-render (.-render (:react modules))
-   :root-unmount (.-unmountComponentAtNode (:react modules))})
+  (if react-native?
+    {:root-render (.-render (:react modules))
+     :root-unmount (.-unmountComponentAtNode (:react modules))}
+    {}))

 (defn class [m]
-  ((aget (:react modules) "createClass") (clj->js m)))
+  (when-let [react (:react modules)]
+    ((aget react "createClass") (clj->js m))))
+
+(when react-native?
+  (this-as self
+           (aset self "React" (js-obj "Component" (:react-element modules)
+                                      "createElement" (.-createElement (:react-element modules))))))


Need to pass arg in condition that hadn't triggered before, yay dynamic langs

--- src/clj/clj_git/core.clj
+++ src/clj/clj_git/core.clj
@@ -40,8 +40,8 @@
          exit (:exit res)]
      (if (pos? exit)
        (case exit
-         128 (if (.contains (:err res) "bad object") nil (err))
-         (err))
+         128 (if (.contains (:err res) "bad object") nil (err res))
+         (err res))
        res))))

 (defn git


Fix broken advanced mode compilation.

Fix broken advanced mode compilation.

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -262,7 +262,7 @@
   [m]
   (let [path (.getAbsolutePath (:file m))
         js (if (:provides m)
-             m
+             (map->javascript-file m)
              (if-let [js (get @compiled-cljs path)]
                js
                (read-js (:file m))))]


support gen overrides by name in addition to path

--- src/clj/clojure/spec.clj
+++ src/clj/clojure/spec.clj
@@ -221,7 +221,8 @@
 (defn- gensub
   [spec overrides path rmap form]
   ;;(prn {:spec spec :over overrides :path path :form form})
-  (let [spec (specize spec)]
+  (let [spec (c/or (get overrides spec) spec)
+        spec (specize spec)]
     (if-let [g (c/or (get overrides path) (gen* spec overrides path rmap))]
       (gen/such-that #(valid? spec %) g 100)
       (throw (IllegalStateException. (str "Unable to construct gen at: " path " for: " (abbrev form)))))))
@@ -229,12 +230,13 @@
 (defn gen
   "Given a spec, returns the generator for it, or throws if none can
   be constructed. Optionally an overrides map can be provided which
-  should map paths (vectors of keywords) to generators. These will be
-  used instead of the generators at those paths. Note that parent
-  generator (in the spec or overrides map) will supersede those of any
-  subtrees. A generator for a regex op must always return a
-  sequential collection (i.e. a generator for s/? should return either
-  an empty sequence/vector or a sequence/vector with one item in it)"
+  should map spec names or paths (vectors of keywords) to
+  generators. These will be used instead of the generators at those
+  names/paths. Note that parent generator (in the spec or overrides
+  map) will supersede those of any subtrees. A generator for a regex
+  op must always return a sequential collection (i.e. a generator for
+  s/? should return either an empty sequence/vector or a
+  sequence/vector with one item in it)"
   ([spec] (gen spec nil))
   ([spec overrides] (gensub spec overrides [] {::recursion-limit *recursion-limit*} spec)))


Make clojure spec explain printer pluggable.

Moved old printer to clojure.spec/explain-printer.
Added dynamic variable clojure.spec/*explain-out*.
Set default *explain-out* to explain-printer.
Changed explain-out to invoke *explain-out*.
Changed repl to bind *explain-out* so it can be set!'ed.

Signed-off-by: Rich Hickey <2f3b32171da334ad5d7d0db393d0928eef4308ab@gmail.com>

--- src/clj/clojure/spec.clj
+++ src/clj/clojure/spec.clj
@@ -175,8 +175,8 @@
   [spec x]
   (explain-data* spec [] (if-let [name (spec-name spec)] [name] []) [] x))

-(defn explain-out
-  "prints explanation data (per 'explain-data') to *out*."
+(defn explain-printer
+  "Default printer for explain-data. nil indicates a successful validation."
   [ed]
   (if ed
     (do
@@ -205,6 +205,14 @@
           (pr v)
           (newline))))
     (println "Success!")))
+
+(def ^:dynamic *explain-out* explain-printer)
+
+(defn explain-out
+  "Prints explanation data (per 'explain-data') to *out* using the printer in *explain-out*,
+   by default explain-printer."
+  [ed]
+  (*explain-out* ed))

 (defn explain
   "Given a spec and a value that fails to conform, prints an explanation to *out*."


fix db pool cache expire

fix db pool cache expire

--- src/clj/dbquery/core.clj
+++ src/clj/dbquery/core.clj
@@ -46,9 +46,9 @@

 (defn expire-cache [cache-ref entry-id]
   (log/info "expiring cache entry:" entry-id)
-  (if-let [ds (cache/lookup @cache-ref entry-id)]
-    (swap! cache-ref #(cache/evict % entry-id)
-    (future (-> ds :datasource .close)))))
+  (when-let [ds (cache/lookup @cache-ref entry-id)]
+    (swap! cache-ref cache/evict entry-id)
+    (future (-> ds :datasource .close))))

 (defn get-ds [ds-id]
   (with-cache ds-cache ds-id


Adds small TODO about put/Post etc.

Adds small TODO about put/Post etc.

--- src/clj_spotify/core.clj
+++ src/clj_spotify/core.clj
@@ -77,6 +77,7 @@
   )

 ;TODO - solve json data in request body on put/post etc.
+;       (= "get" (name 'verb)) add one of these for default, put and post.
 ;TODO - better doc string
 (defmacro def-spotify-api-call
   "Creates a function f with doc-string d that calls the http-verb verb for url url."


Improve `decode-cigar`

Improve `decode-cigar`

--- src/cljam/bam/reader.clj
+++ src/cljam/bam/reader.clj
@@ -116,18 +116,17 @@
 (defn- decode-cigar-op [op]
   (get cigar-op-map op))

-(defn- decode-cigar*
-  [^ByteBuffer buf]
-  (when (.hasRemaining buf)
-    (let [b  (.getInt buf)
-          op (bit-and b 0xf)
-          n  (bit-shift-right b 4)]
-      (cons n (cons (decode-cigar-op op) (decode-cigar* buf))))))
-
 (defn decode-cigar [cigar-bytes]
   (let [buf (ByteBuffer/wrap cigar-bytes)]
     (.order buf ByteOrder/LITTLE_ENDIAN)
-    (apply str (decode-cigar* buf))))
+    (loop [sb (StringBuilder.)]
+      (if (.hasRemaining buf)
+        (let [b  (.getInt buf)
+              op (bit-and b 0xF)
+              n  (bit-shift-right b 4)]
+          (recur (doto sb (.append n)
+                          (.append (decode-cigar-op op)))))
+        (str sb)))))

 (defn- decode-next-ref-id [refs n rname]
   (cond


Backspace and checking for validity of score

--- src/cljs/darts/core.cljs
+++ src/cljs/darts/core.cljs
@@ -54,41 +54,70 @@
 (defn remaining-points [{:keys [rounds]} starting-score]
   (- starting-score (reduce + 0 rounds)))

+(def message (atom ""))
+
 (def game example-game)

 (def score (atom ""))
-(def next-player (atom 0))
+(def current-player (atom 0))
+
+(defn valid-score? [score points]
+  (and (<= score 180)
+       (<= score points)))
+
+(defn points [player]
+  (remaining-points (get @game player) (:starting-score @game)))
+
+(defn record-score [player new-score]
+  (swap! game #(update-in %1 [%2 :rounds] conj (js/parseInt %3))
+         player
+         new-score)
+  (reset! score "")
+  (swap! current-player #(mod (inc %) 2)))
+
+(defn clear-message []
+  (reset! message ""))

 (defn numpad []
   [:div
-   (map (fn [n] ^{:key n}[:button {:on-click #(swap! score str n)}
-                          n]) (range 10))
-   [:button {:on-click #(reset! score "")} "Clear"]
+   (map (fn [n]
+          ^{:key n}[:button
+                    {:on-click (fn []
+                                 (swap! score str n)
+                                 (clear-message))}
+                    n])
+        (range 10))
    [:button {:on-click (fn []
-                         (swap! game #(update-in %1 [%2 :rounds] conj (js/parseInt %3))
-                                @next-player
-                                @score)
+                         (swap! score #(subs % 0 (dec (count %)))))} "←"]
+   [:button {:on-click (fn []
                          (reset! score "")
-                         (swap! next-player #(mod (inc %) 2)))} "Enter"]])
+                         (clear-message))} "Clear"]
+   [:button {:on-click (fn []
+                         (let [new-score (js/parseInt @score)
+                               points (points @current-player)]
+                           (if (valid-score? new-score points)
+                             (record-score @current-player @score)
+                             (reset! message "Score not valid"))))} "Enter"]])
+
+

 (defn play-page []
-  (let [
-        ]
-    [:div
-     [:div
-      [:span "Player 1: " (remaining-points (get @game 0) (:starting-score @game))]
-      [:br]
-      [:span "Player 2: " (remaining-points (get @game 1) (:starting-score @game))]]
-     [:div
-      [:br ]
-      (str "Player " (+ 1 @next-player) " turn")
-      [:br]
-      [:input {:type :text
-               :disabled true
-               :value @score}]
-      [:br]
-      [numpad]
-      (println @game)]]))
+  [:div
+   @message
+   [:div
+    [:span "Player 1: " (remaining-points (get @game 0) (:starting-score @game))]
+    [:br]
+    [:span "Player 2: " (remaining-points (get @game 1) (:starting-score @game))]]
+   [:div
+    [:br ]
+    (str "Player " (+ 1 @current-player) " turn")
+    [:br]
+    [:input {:type :text
+             :disabled true
+             :value @score}]
+    [:br]
+    [numpad]
+    (println @game)]])

 (defn select-game-pane []


Use a range with intervals of 10 seconds for the timer

--- src/cljs/kenny/core.cljs
+++ src/cljs/kenny/core.cljs
@@ -411,7 +411,7 @@
                                     )
                             (dom/tr nil
                                     (dom/th nil "Spiel Dauer")
-                                    (om/build table-cell (get-in app [:hero :time]) {:init-state {:options (mapv (fn [i] [i]) (range 30 61))}})
+                                    (om/build table-cell (get-in app [:hero :time]) {:init-state {:options (mapv (fn [i] [i]) (range 30 130 10))}})
                                     )
                             )


Fix wrong attribute access for clojurescript on previously added method.


a bit

a bit

--- src/codeitlater/core.clj
+++ src/codeitlater/core.clj
@@ -74,11 +74,11 @@
                     filepath))))))

 ;;:= TODO: make diferent behavior of deffirent args.
-;;:= TODO: make tags options
+;;:= TODO: make tags options, for example, -json file.json
 (defn -main [& args]
   (let [commentDict (read-json)
         [root & filetypes] args]
-    (println args)
-    (println filetypes)
+    ;(println args)
+    ;(println filetypes)
     (println (read-files commentDict root filetypes)))
 )


fix No second Wallet screen when send two Tx one after another in Dapps

--- src/status_im/ui/screens/wallet/send/events.cljs
+++ src/status_im/ui/screens/wallet/send/events.cljs
@@ -133,7 +133,10 @@
          {:keys [payload message-id] :as queued-transaction} (last transactions-queue)
          {:keys [method params id]} payload
          db' (update-in db [:wallet :transactions-queue] drop-last)]
-     (when (and (not (= :wallet-transaction-sent (:view-id db))) (not (:id send-transaction)) queued-transaction)
+     (when (and (not (contains? #{:wallet-transaction-sent
+                                  :wallet-transaction-sent-modal}
+                                (:view-id db)))
+                (not (:id send-transaction)) queued-transaction)
        (cond

          ;;SEND TRANSACTION


[#797][backend] Adapt failing scenario to 409 default status response

--- backend/src/akvo/lumen/transformation/split_column.clj
+++ backend/src/akvo/lumen/transformation/split_column.clj
@@ -35,7 +35,7 @@
 (defn col-name [args]
   (-> (selected-column args) :columnName))

-(defn pattern [args]
+(defn pattern* [args]
   (-> args :pattern))

 (defn new-column-name [args]
@@ -45,7 +45,7 @@
   [op-spec]
   (let [{:keys [onError op args] :as op-spec} (keywordize-keys op-spec)]
     (and (engine/valid-column-name? (col-name args))
-         (pattern args))))
+         (pattern* args))))

 (defn- add-name-to-new-columns
   [columns new-columns]
@@ -70,31 +70,33 @@
   [{:keys [tenant-conn]} table-name columns op-spec]
   (log/debug :engine/apply-operation :core/split-column table-name)
   (jdbc/with-db-transaction [tenant-conn tenant-conn]
-    (let [{:keys [onError op args] :as op-spec}                          (keywordize-keys op-spec)
-          column-name                                                    (col-name args)
-          pattern                                                        (pattern args)
-          re-pattern                                                     (re-pattern (Pattern/quote pattern))
-          values                                                         (map (comp str (keyword column-name)) (select-column-data tenant-conn {:table-name table-name :column-name column-name}))
-          _ (log/error :values values)
-          splitable                                                      (splitable #(frequencies (re-seq re-pattern %))
-                                                                                values)
-          _ (log/error :Splitable splitable)
-          analysis                                                       (get-in splitable [:split-column-analysis pattern])
-          _ (log/error :analysis analysis)
-          number-new-rows                                                (inc (:max-coincidences-in-one-row analysis))
-          new-columns                                                    (columns-to-extract (new-column-name args) number-new-rows (selected-column args) columns)
-          add-db-columns                                                 (doseq [c new-columns]
-                                                                           (add-column tenant-conn {:table-name      table-name
-                                                                                :column-type     (:type c)
-                                                                                :new-column-name (:id c)}))
-          update-db-columns                                              (->> (select-rnum-and-column tenant-conn {:table-name table-name :column-name column-name})
-                                                                              (map
-                                                                               #(let [value       ((keyword column-name) %)
-                                                                                values      (string/split value  re-pattern)
-                                                                                update-vals (map (fn [a b]
-                                                                                [(keyword (:id a)) b]) new-columns values)]
-                                                                                (update-row tenant-conn table-name (:rnum %) update-vals)))
-                                                                              doall)]
-      {:success?      true
-       :execution-log [(format "Splitted column %s with pattern %s" column-name pattern)]
-       :columns       (into columns (vec new-columns))})))
+    (let [{:keys [onError op args]} (keywordize-keys op-spec)
+          column-name               (col-name args)
+          pattern                   (pattern* args)
+          re-pattern                (re-pattern (Pattern/quote pattern))
+          values                    (map (comp str (keyword column-name))
+                                         (select-column-data tenant-conn {:table-name table-name :column-name column-name}))
+          splitable                 (splitable #(frequencies (re-seq re-pattern %))
+                                               values)]
+      (if-let [analysis (get-in splitable [:split-column-analysis pattern])]
+        (let [_ (log/error :analysis analysis)
+              number-new-rows   (inc (:max-coincidences-in-one-row analysis))
+              new-columns       (columns-to-extract (new-column-name args) number-new-rows (selected-column args) columns)
+              add-db-columns    (doseq [c new-columns]
+                                  (add-column tenant-conn {:table-name      table-name
+                                                           :column-type     (:type c)
+                                                           :new-column-name (:id c)}))
+              update-db-columns (->> (select-rnum-and-column tenant-conn {:table-name table-name :column-name column-name})
+                                     (map
+                                      #(let [value       ((keyword column-name) %)
+                                             values      (string/split value  re-pattern)
+                                             update-vals (map (fn [a b]
+                                                                [(keyword (:id a)) b]) new-columns values)]
+                                         (update-row tenant-conn table-name (:rnum %) update-vals)))
+                                     doall)]
+          {:success?      true
+           :execution-log [(format "Splitted column %s with pattern %s" column-name pattern)]
+           :columns       (into columns (vec new-columns))})
+        {:success? false
+         :message (format "No results trying to split column '%s' with pattern '%s'" (:title (selected-column args)) (pattern* args))}))))
+


update CLJS logo on the cheatsheet

update CLJS logo on the cheatsheet

--- cljs-cheatsheet/cljs_cheatsheet/html.cljs
+++ cljs-cheatsheet/cljs_cheatsheet/html.cljs
@@ -1042,7 +1042,7 @@

 (hiccups/defhtml header []
   [:div.header-2a8a6
-    [:img.logo-6ced3 {:src "/img/clojure-logo.png" :alt "Clojure Logo"}]
+    [:img.logo-6ced3 {:src "/img/cljs-ring.svg" :alt "ClojureScript Logo"}]
     [:h1.title-7a29c "ClojureScript Cheatsheet"]
     [:input#searchInput.search-70fb8 {:type "text" :placeholder "Search"}]
     ; [:label#toggleTooltips.tooltips-label-68aa0


fac.clj

fac.clj


Adding the "neighbors" method only if it doesn't exist

This makes the code hot-reloadable by figwheel, otherwise we get an
exception and the reload process doesn't complete.


remove another geschichte code

remove another geschichte code