Refactored register-listener to allow specifying green or real thread

--- src/ctia/lib/async.clj
+++ src/ctia/lib/async.clj
@@ -2,7 +2,7 @@
   (:require [ctia.lib.time :as time]
             [ctia.schemas.common :as c]
             [ctia.schemas.verdict :as v]
-            [clojure.core.async :as a :refer [go-loop alt! chan tap]]
+            [clojure.core.async :as a :refer [go-loop alt! alt!! chan tap thread]]
             [schema.core :as s :refer [=>]])
   (:import [clojure.core.async.impl.protocols Channel]
            [clojure.core.async.impl.buffers FixedBuffer]
@@ -54,6 +54,20 @@
           (recur timeout)
           (count chan-buf))))))

+(defmacro ^:private listen
+  "Helper for register-listener below that handles the mode
+   selection (real/green thread)"
+  [& {:keys [mode pred listener-fn events end-chan]}]
+  (let [loop-fn (case mode :blocking 'thread :compute 'go-loop)
+        alt-fn (case mode :blocking 'alt!! :compute 'alt!)]
+    `(~loop-fn []
+      (if-let [event# (~alt-fn [~events ~end-chan] ([v#] v#))]
+        (do
+          (when (~pred event#)
+            (~listener-fn event#))
+          (recur))
+        (do (close! ~end-chan)
+            (close! ~events))))))

 (s/defn register-listener :- Channel
   "Creates a GO loop to direct events to a function.
@@ -63,28 +77,40 @@
    ec - An event channel, created with new-event-channel.
    f - user provided function that will be called when an event arrives on the event channel.
    pred - a predicate to test events. The user function will only be run if this predicate passes.
-   shutdown-fn - an optional function to run at system shutdown time. May be nil."
-  [{m :mult :as ec} :- EventChannel
-   listener-fn :- (=> s/Any Event)
-   pred :- (=> s/Bool Event)
-   shutdown-fn :- (s/maybe (=> s/Any))]
-  (let [events (chan)]
-    (tap m events)
-    (let [end-chan (chan)]
-      (go-loop []
-        (if-let [event (alt! [events end-chan] ([v] v))]
-          (do
-            (when (pred event)
-              (listener-fn event))
-            (recur))
-          (do
-            (close! end-chan)
-            (close! events))))
-      (.addShutdownHook (Runtime/getRuntime)
-                        (Thread. #(do (a/close! end-chan)
-                                      (when (fn? shutdown-fn)
-                                        (shutdown-fn)))))
-      end-chan)))
+   shutdown-fn - an optional function to run at system shutdown time. May be nil.
+   mode - can be :compute (for a green thread) or :blocking (for a real thread)"
+  ([ec :- EventChannel
+    listener-fn :- (=> s/Any Event)
+    pred :- (=> s/Bool Event)
+    shutdown-fn :- (s/maybe (=> s/Any))]
+   (register-listener ec listener-fn pred shutdown-fn :compute))
+  ([{m :mult :as ec} :- EventChannel
+    listener-fn :- (=> s/Any Event)
+    pred :- (=> s/Bool Event)
+    shutdown-fn :- (s/maybe (=> s/Any))
+    mode :- (s/enum :compute :blocking)]
+   (let [events (chan)
+         end-chan (chan)]
+     (tap m events)
+     (case mode
+       :blocking
+       (listen :mode :blocking
+               :pred pred
+               :listener-fn listener-fn
+               :events events
+               :end-chan end-chan)
+
+       :compute
+       (listen :mode :compute
+               :pred pred
+               :listener-fn listener-fn
+               :events events
+               :end-chan end-chan))
+     (.addShutdownHook (Runtime/getRuntime)
+                       (Thread. #(do (a/close! end-chan)
+                                     (when (fn? shutdown-fn)
+                                       (shutdown-fn)))))
+     end-chan)))

 (s/defn drain :- [s/Any]
   "Extract elements from a channel into a lazy-seq.


make "docs" and "contact us" links

make "docs" and "contact us" links

--- src-cljs/frontend/components/build_config.cljs
+++ src-cljs/frontend/components/build_config.cljs
@@ -143,7 +143,11 @@
              ". "
              "These may be causing your builds to fail. "
              "We recommend that you fix them as soon as possible. "
-             "You may want to look at our docs or contact us if you’re having trouble."]
+             "You may want to look at "
+             [:a {:href "/docs/configuration"} "our docs"]
+             " or "
+             (common/contact-us-inner owner)
+             " us if you’re having trouble."]
             [:ol
              (for [error errors]
                (om/build config-error {:error error


Add success hook to form builder

Add success hook to form builder

--- src-cljs/frontend/components/contact_form.cljs
+++ src-cljs/frontend/components/contact_form.cljs
@@ -116,9 +116,11 @@
   Optionally, if a :params-filter is given, it will be called when the form is
   submitted with a map of the params the form would normally submit. It should
   return a map of params for the form to actually submit. Both maps should have
-  string keys and values."
+  string keys and values. Also, if :success-hook is given, it will be called
+  after a successful form submission."
   ([props children-f] (contact-form-builder props {} children-f))
-  ([props {:keys [params-filter] :or {params-filter identity}} children-f]
+  ([props {:keys [params-filter success-hook]
+           :or {params-filter identity success-hook identity}} children-f]
    (fn [_ owner]
      (reify
        om/IInitState
@@ -160,6 +162,7 @@
                                         (if (= (:status resp) :success)
                                           (do
                                             (om/set-state! owner :form-state :success)
+                                            (success-hook)
                                             (reset-form form))
                                           (do
                                             (om/set-state! owner :form-state :idle)


Putting build usage table behind a feature flag.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -1052,7 +1052,8 @@
           [:p "If you are in the limited-release beta, you may also choose an iOS plan "
               [:a {:href "#containers"} "here"]
               ". We will support general release in the near future!"])]
-       (when (pm/osx? plan)
+       (when (and (feature/enabled? :ios-build-usage)
+                  (pm/osx? plan))
          (om/build osx-usage-table {:plan plan}))]))))

 (def main-component


Edited enemy effect for level 2.

Edited enemy effect for level 2.

--- src/divergence/entity/enemy.cljs
+++ src/divergence/entity/enemy.cljs
@@ -70,8 +70,8 @@

 ;;organization - enemy entities should be passed their move paths here
 (def flappy (partial e/enemy 1 1 [e/enemyATextureRight] normal-path 0 true))
-(def flappy2 (partial e/enemy 1 1 [e/enemyATextureRight] updown-path 0 ))
-(def flappy3 (partial e/enemy 1 1 [e/enemyATextureRight] normal-path 2))
-(def flappy4 (partial e/enemy 1 1 [e/enemyATextureRight] updown-path 2))
-(def shark (partial e/enemy 0.3 0.3 [e/enemyBTextureRight] normal-path 0))
-(def shark2 (partial e/enemy 0.3 0.3 [e/enemyBTextureLeft] normal-path 0))
+(def flappy2 (partial e/enemy 1 1 [e/enemyATextureRight] updown-path 0 true))
+(def flappy3 (partial e/enemy 1 1 [e/enemyATextureRight] normal-path 2 true))
+(def flappy4 (partial e/enemy 1 1 [e/enemyATextureRight] updown-path 2 true))
+(def shark (partial e/enemy 0.3 0.3 [e/enemyBTextureRight] normal-path 0 true))
+(def shark2 (partial e/enemy 0.3 0.3 [e/enemyBTextureLeft] normal-path 0 true))


only append $macros to ns if not already present in find-macro-ns

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -9900,7 +9900,9 @@
   (create-ns ns (find-ns-obj ns)))

 (defn find-macros-ns [ns]
-  (let [ns (symbol (str ns "$macros"))]
+  (let [ns (cond-> ns
+             (not (gstring/contains (str ns) "$macros"))
+             (-> (str "$macros") symbol))]
     (create-ns ns (find-ns-obj ns))))

 (defn ns-name [ns-obj]


query and params mixins no longer exist

query and params mixins no longer exist

--- src/main/compassus/core.cljc
+++ src/main/compassus/core.cljc
@@ -344,18 +344,6 @@
                                          (dom/h1 nil \"App title\")
                                          (factory props))))

-                        `compassus.core/query`:
-
-                          - builds a mixin that will add its parameter (a query)
-                          to the root application's query. Useful to query for data
-                          that is to be used e.g. in the `wrap-render` mixin.
-
-                        `compassus.core/params`:
-
-                          - builds a mixin that will add its parameter (query params)
-                          to the root application's query params. Similar to the
-                          `query` mixin, but for `om.next/IQueryParams`.
-
      :history         - a map with keys `:setup` and `:teardown`. Values should
                         be functions of no arguments that will be called when the
                         application mounts and unmounts, respectively. Used to


New functions: job-results-html-handler etc.

--- src/emender_service/rest_api.clj
+++ src/emender_service/rest_api.clj
@@ -96,7 +96,37 @@
         (db-interface/log-job-results job-name results)
         (println "job name" job-name)
         (println "results:" results)
-        (results/add-new-results job-name results)
+        ; not needed ATM, we don't need to use memory cache
+        ;(results/add-new-results job-name results)
+        ;(pprint/pprint results)
+        (send-response {:status :ok})))
+
+(def html-to-json-separator
+    "\n{\n")
+
+(defn get-html-and-json-part
+    [content]
+    (let [index (.indexOf content html-to-json-separator)]
+        (if index
+            {:html-part (subs content 0 (inc index))
+             :json-part (subs content (inc index))})))
+
+(defn job-results-html-handler
+    [request]
+    (let [job-name (read-job-name-from-request request)
+          results  (read-request-body request)
+          parts    (get-html-and-json-part results)
+          html-part (:html-part parts)
+          json-part (-> (:json-part parts) body->results)]
+        (db-interface/log-job-results job-name nil nil json-part html-part)
+        (println "job name" job-name)
+       ;(println "JSON" (:html-part parts))
+       ;(println "HTML" (:json-part parts))
+       ;(spit "test.all" results)
+       ;(spit "test.json" (:json-part parts))
+       ;(spit "test.html" (:html-part parts))
+        ; not needed ATM, we don't need to use memory cache
+        ;(results/add-new-results job-name results)
         ;(pprint/pprint results)
         (send-response {:status :ok})))


Add button to toggle sidebar

Add button to toggle sidebar

--- src/discuss/debug.cljs
+++ src/discuss/debug.cljs
@@ -26,6 +26,10 @@
            (dom/button #js {:className "btn btn-default"
                             :onClick   #(discuss.communication/ajax-get "api/town-has-to-cut-spending")}
                        (vlibs/fa-icon "fa-building"))
+           " "
+           (dom/button #js {:className "btn btn-default"
+                            :onClick   #(discuss.sidebar/toggle)}
+                       (vlibs/fa-icon "fa-clipboard"))
            " "
            (dom/button #js {:className "btn btn-default"
                             :onClick   #(discuss.communication/ajax-get (get-in data [:debug :last-api]))}


Add dismissible menu for modal

Add dismissible menu for modal

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -21,20 +21,26 @@
             [discuss.views.add :as vadd]
             [discuss.views.login :as vlogin]))

-(def modal-name (lib/prefix-name "overlay"))
+(def ^:private modal-name
+  (lib/prefix-name "overlay"))
+
+(def ^:private dismissable-views
+  #{:login :options :create/argument :eden/overview})

 (defn close-button-next
   "Close current panel and switch view."
   []
-  (html
-   [:div [:br]
-    [:div.text-center
-     (bs/button-default-sm
-      (fn [e]
-        (when (lib/inside-overlay? (.-target e)) (lib/hide-overlay))
-        (lib/change-to-next-view!))
-      (vlib/fa-icon "fa-times")
-      (t :common :close :space))]]))
+  (html [:div [:br]
+         [:div.text-center
+          (bs/button-default-sm
+           (fn [e]
+             (if (lib/inside-overlay? (.-target e))
+               (if (some #{(lib/current-view)} dismissable-views)
+                 (lib/change-to-next-view!)
+                 (lib/hide-overlay))
+               (lib/change-to-next-view!)))
+           (vlib/fa-icon "fa-times")
+           (t :common :close :space))]]))

 (defn control-elements-next
   "Back and restart button."


Convert error-msg to full react component

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -27,16 +27,20 @@
 ;;;; Elements
 (defn error-view
   "Display error message if there are errors."
-  []
-  (when (lib/error?)
-    (dom/div #js {:className "alert alert-info alert-dismissable"
-                  :role      "alert"}
-             (dom/button #js {:className    "close"
-                              :data-dismiss "alert"
-                              :aria-label   "Close"}
-                         (dom/span #js {:aria-hidden "true"}
-                                   (vlib/safe-html "×")))
-             (lib/get-error))))
+  [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (om/observe owner (lib/get-cursor :layout))
+      (when (lib/error?)
+        (dom/div #js {:className "alert alert-info alert-dismissable"
+                      :role      "alert"}
+                 (dom/button #js {:className    "close"
+                                  :data-dismiss "alert"
+                                  :aria-label   "Close"}
+                             (dom/span #js {:aria-hidden "true"}
+                                       (vlib/safe-html "×")))
+                 (lib/get-error))))))

 (defn control-elements []
   (bs/center
@@ -73,7 +77,7 @@
     om/IRenderState
     (render-state [_ {:keys [nickname password]}]
       (dom/div nil
-               (error-view)
+               (om/build error-view {})
                (bs/center "Login")
                (dom/div #js {:className "input-group"}
                         (dom/span #js {:className "input-group-addon"}
@@ -166,12 +170,12 @@
     (render-state [_ {:keys [statement]}]
       (om/observe owner (lib/get-cursor :user))
       (dom/div #js {:className  "panel panel-default"
-                    :onDragOver discuss.components.clipboard/allow-drop
-                    :onDrop     discuss.components.clipboard/update-reference-drop}
+                    :onDragOver clipboard/allow-drop
+                    :onDrop     clipboard/update-reference-drop}
                (dom/div #js {:className "panel-body"}
                         (dom/h4 #js {:className "text-center"} (lib/get-add-text))
                         (dom/h5 #js {:className "text-center"} (vlib/safe-html (lib/get-add-premise-text)))
-                        (error-view)
+                        (om/build error-view {})
                         (dom/div #js {:className "input-group"}
                                  (dom/span #js {:className "input-group-addon"}
                                            (vlib/fa-icon "fa-comment"))


Enhanced rands for autoconstruction; rule30_dynamic problem.

--- src/clojush/problems/boolean/rule30_dynamic.clj
+++ src/clojush/problems/boolean/rule30_dynamic.clj
@@ -85,7 +85,7 @@

    :max-points 512
    :max-genome-size-in-initial-program 128
-   :evalpush-limit 512
+   :evalpush-limit 2048
    :genetic-operator-probabilities {:alternation 0.2
                                     :uniform-mutation 0.2
                                     :uniform-close-mutation 0.1
@@ -103,8 +103,8 @@
                                       (vec (take number-of-rule30-datapoints-per-generation
                                                  (lshuffle rule30-data))))
                                 (println "rule30-data-this-generation:" @rule30-data-this-generation))
-   :autoconstructive-integer-rand-enrichment 3
-   :autoconstructive-boolean-rand-enrichment 3
+   :autoconstructive-integer-rand-enrichment -1
+   :autoconstructive-boolean-rand-enrichment 7
    })

 (defn total-error-on-all-rule30-data ;; for validation


added support for background color

added support for background color

--- src/mastersign/wordcloud.clj
+++ src/mastersign/wordcloud.clj
@@ -30,6 +30,7 @@
    :allow-rotation true
    :final-refine true
    :order-mode :value1 ; :id, :text, :value1, :value2
+   :background-color (Color. 0 0 0 0)
    :color-fn #'default-color-fn
    })

@@ -237,11 +238,12 @@
      :test-area *test-area*}))

 (defn- cloud-painter
-  [{:keys [word-infos test-area]} g w h]
+  [{:keys [args word-infos test-area]} g w h]
   (let [c (point (/ w 2.0) (/ h 2.0))
         bg (translate-area test-area c)]
     (doto g
       setup
+      (fill-rect (rectangle 0 0 w h) :color (:background-color args))
       ;(draw-rect (rectangle 0 0 (dec w) (dec h)))
       ;(fill-shape bg)
       ;(draw-shape bg)


Drop some log lines in cache store.

Drop some log lines in cache store.

--- src/blocks/store/cache.clj
+++ src/blocks/store/cache.clj
@@ -97,8 +97,7 @@
   (start
     [this]
     (if @state
-      (do (log/info "CachingStore is already initialized")
-          this)
+      this
       (do
         (when-not primary
           (throw (IllegalStateException.
@@ -106,7 +105,6 @@
         (when-not cache
           (throw (IllegalStateException.
                    "Cannot start caching store without backing cache store")))
-        (log/debug "Scanning cache store to build state...")
         (let [initial-state (scan-state cache)
               cached-bytes (:total-size initial-state)]
           (reset! state initial-state)


Connection open-db needs another arity.

Connection open-db needs another arity.

--- src/merkle_db/connection.clj
+++ src/merkle_db/connection.clj
@@ -170,20 +170,22 @@

 (defn- -open-db
-  [^Connection conn db-name opts]
-  (let [version (if-let [^java.time.Instant at-inst (:at-inst opts)]
-                  (first (drop-while #(.isBefore at-inst (::ref/time %))
-                                     (ref/get-history (.tracker conn) db-name)))
-                  (ref/get-ref (.tracker conn) db-name))]
-    (if (::ref/value version)
-      ; Load database.
-      (db/load-database (.store conn) (ref-version-info version))
-      ; No version found.
-      (throw (ex-info (str "No version found for database " db-name
-                           " with options " (pr-str opts))
-                      {:type ::no-database-version
-                       :db-name db-name
-                       :opts opts})))))
+  ([conn db-name]
+   (-open-db conn db-name nil))
+  ([^Connection conn db-name opts]
+   (let [version (if-let [^java.time.Instant at-inst (:at-inst opts)]
+                   (first (drop-while #(.isBefore at-inst (::ref/time %))
+                                      (ref/get-history (.tracker conn) db-name)))
+                   (ref/get-ref (.tracker conn) db-name))]
+     (if (::ref/value version)
+       ; Load database.
+       (db/load-database (.store conn) (ref-version-info version))
+       ; No version found.
+       (throw (ex-info (str "No version found for database " db-name
+                            " with options " (pr-str opts))
+                       {:type ::no-database-version
+                        :db-name db-name
+                        :opts opts}))))))

 (defn- -commit!


oops.  fix typo.

oops.  fix typo.

--- src/metabase/models/user.clj
+++ src/metabase/models/user.clj
@@ -49,7 +49,7 @@
     (cascade-delete 'Session :user_id id)
     (cascade-delete 'Dashboard :creator_id id)
     (cascade-delete 'Card :creator_id id)
-    (cascade-delete 'Pulse :creator_id)
+    (cascade-delete 'Pulse :creator_id id)
     (cascade-delete 'Activity :user_id id)
     (cascade-delete 'ViewLog :user_id id)))


pagination

pagination


implemented incr/decr-upload-slots

implemented incr/decr-upload-slots

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -202,10 +202,14 @@
                                                              {:paused? true})}))))

 (defn incr-upload-slots []
-  (println "Decrementing upload slots"))
+  (println "Incrementing upload slots")
+  (.emit socket "change-upload-slots" (+ (:upload-slots @app-state)
+                                         1)))

 (defn decr-upload-slots []
-  (println "Decrementing upload slots"))
+  (println "Decrementing upload slots")
+  (.emit socket "change-upload-slots" (- (:upload-slots @app-state)
+                                         1)))

 (defn change-track [track-num]
   (.emit socket "change-track" track-num (.v4 js/uuid)))


Remove django based generic signing implementation (replaced by compact).

--- src/buddy/sign/generic.clj
+++ src/buddy/sign/generic.clj
@@ -1,112 +0,0 @@
-;; Copyright (c) 2014 Andrey Antukh <niwi@niwi.be>
-;;
-;; Licensed under the Apache License, Version 2.0 (the "License")
-;; you may not use this file except in compliance with the License.
-;; You may obtain a copy of the License at
-;;
-;;     http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns buddy.sign.generic
-  "The generic singin is mainly based on django's Cryptographic signing
-  library but extended with various signing algorithms and cryptography
-  support.
-
-  NOTE: deprecated since 0.4.0."
-  (:require [buddy.core.codecs :refer :all]
-            [buddy.core.keys :refer :all]
-            [buddy.core.mac.hmac :as hmac]
-            [buddy.core.sign.rsapss :as rsapss]
-            [buddy.core.sign.rsapkcs15 :as rsapkcs]
-            [buddy.core.sign.ecdsa :as ecdsa]
-            [buddy.core.util :refer [maybe-let]]
-            [clojure.string :as str]
-            [taoensso.nippy :as nippy])
-  (:import clojure.lang.Keyword))
-
-(def ^{:doc "List of supported signing algorithms"
-       :dynamic true}
-  *signers-map* {:hs256 {:signer   #(hmac/hmac %1 %2 :sha256)
-                         :verifier #(hmac/verify %1 %2 %3 :sha256)}
-                 :hs512 {:signer   #(hmac/hmac %1 %2 :sha512)
-                         :verifier #(hmac/verify %1 %2 %3 :sha512)}
-                 :rs256 {:signer   #(rsapkcs/rsapkcs15 %1 %2 :sha256)
-                         :verifier #(rsapkcs/verify %1 %2 %3 :sha256)}
-                 :rs512 {:signer   #(rsapkcs/rsapkcs15 %1 %2 :sha512)
-                         :verifier #(rsapkcs/verify %1 %2 %3 :sha512)}
-                 :ps256 {:signer   #(rsapss/rsapss %1 %2 :sha256)
-                         :verifier #(rsapss/verify %1 %2 %3 :sha256)}
-                 :ps512 {:signer   #(rsapss/rsapss %1 %2 :sha512)
-                         :verifier #(rsapss/verify %1 %2 %3 :sha512)}
-                 :es256 {:signer   #(ecdsa/ecdsa %1 %2 :sha256)
-                         :verifier #(ecdsa/verify %1 %2 %3 :sha256)}
-                 :es512 {:signer   #(ecdsa/ecdsa %1 %2 :sha512)
-                         :verifier #(ecdsa/verify %1 %2 %3 :sha512)}})
-
-(defn timestamp-millis
-  "Get current timestamp in millis."
-  []
-  (System/currentTimeMillis))
-
-(defn- make-signature
-  "Make timestamped signature"
-  [^bytes input ^bytes pkey ^bytes salt ^bytes stamp ^Keyword alg]
-  (maybe-let [signer (get-in *signers-map* [alg :signer])
-              input  (concat-byte-arrays input salt stamp)]
-    (signer input pkey)))
-
-(defn- verify-signature
-  [^bytes input ^bytes signature ^bytes pkey ^bytes salt ^bytes stamp ^Keyword alg]
-  (maybe-let [verifier (get-in *signers-map* [alg :verifier])
-              input    (concat-byte-arrays input salt stamp)]
-    (verifier input signature pkey)))
-
-(defn sign
-  "Sign arbitrary length string/byte array."
-  [^String input pkey & [{:keys [sep alg]
-                          :or {sep ":" alg :hs256}}]]
-  {:pre [(alg *signers-map*)]}
-  (maybe-let [input (->byte-array input)
-              salt  (make-random-bytes 8)
-              stamp (long->bytes (timestamp-millis))
-              s     (make-signature input pkey salt stamp alg)]
-    (str/join sep [(bytes->safebase64 input)
-                   (bytes->safebase64 s)
-                   (bytes->safebase64 salt)
-                   (bytes->safebase64 stamp)])))
-
-(defn unsign
-  [^String input, pkey & [{:keys [sep alg max-age]
-                           :or {sep ":" alg :hs256}}]]
-  {:pre [(alg *signers-map*)]}
-  (let [[input signature salt stamp] (str/split input (re-pattern sep))]
-    (maybe-let [input     (when input (safebase64->bytes input))
-                signature (when signature (safebase64->bytes signature))
-                stamp     (when stamp (safebase64->bytes stamp))
-                salt      (when salt (safebase64->bytes salt))]
-      (when (verify-signature input signature pkey salt stamp alg)
-        (if (nil? max-age)
-          (bytes->str input)
-          (let [oldstamp (bytes->long stamp)
-                newstamp (timestamp-millis)
-                age      (- newstamp oldstamp)]
-            (if (> age (* max-age 1000)) nil (bytes->str input))))))))
-
-(defn dumps
-  "Sign a complex data strucutres using
-  serialization as intermediate step."
-  [data & args]
-  (let [encoded (bytes->base64 (nippy/freeze data))]
-    (apply sign encoded (vec args))))
-
-(defn loads
-  "Unsign data signed with dumps."
-  [s & args]
-  (let [unsigned (apply unsign s (vec args))]
-    (when-not (nil? unsigned)
-      (nippy/thaw (base64->bytes unsigned)))))


add try-catch around app-state validation

on error, rollback state, display error banner, and log detailed error
info to the console

--- src/chat/client/store.cljs
+++ src/chat/client/store.cljs
@@ -1,6 +1,7 @@
 (ns chat.client.store
   (:require [cljs-utils.core :refer [flip]]
             [cljs-uuid-utils.core :as uuid]
+            [taoensso.timbre :as timbre :refer-macros [errorf]]
             [clojure.set :as set]
             [schema.core :as s :include-macros true]
             [braid.common.schema :as app-schema]
@@ -53,11 +54,17 @@
 (defn- key-by-id [coll]
   (into {} (map (juxt :id identity)) coll))

-; TODO: write schema for app-state, make transact! verify
+(declare display-error!)
 (defn- transact! [ks f]
-  (swap! app-state update-in ks f)
-  (println "updating " ks (get-in @app-state ks))
-  (check-app-state! @app-state))
+  (let [old-state @app-state]
+    (swap! app-state update-in ks f)
+    (try
+      (check-app-state! @app-state)
+      (catch ExceptionInfo e
+        (errorf "State consistency error updating %s to %s: %s"
+                ks (get-in @app-state ks) (ex-data e))
+        (reset! app-state old-state)
+        (display-error! :internal-consistency "Something has gone wrong")))))

 ; login state


Allow `interpret` fn to take optional starting context.

--- src/isla/interpreter.clj
+++ src/isla/interpreter.clj
@@ -7,8 +7,11 @@

 (defmulti interpret (fn [& args] (:tag (first args))))

-(defmethod interpret :root [node]
-  (run-sequence (:content node) (get-initial-context)))
+(defmethod interpret :root [node & args]
+  (let [content (:content node)]
+    (if (not= nil args)
+      (run-sequence content (first args))
+      (run-sequence content (get-initial-context)))))

 (defmethod interpret :block [node context]
   (run-sequence (:content node) context))


Rename a local

Rename a local

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -324,19 +324,19 @@
    (fn rook-map-traversal-dispatcher [request]
      (loop [pathvec (second (request-route-spec request))
             dispatch dispatch-map
-            route-params []]
+            route-param-vals []]
        (if-let [seg (first pathvec)]
          (if (contains? dispatch seg)
-           (recur (next pathvec) (get dispatch seg) route-params)
+           (recur (next pathvec) (get dispatch seg) route-param-vals)
            (if-let [dispatch' (::param dispatch)]
-             (recur (next pathvec) dispatch' (conj route-params seg))
+             (recur (next pathvec) dispatch' (conj route-param-vals seg))
              ;; no match on path
              not-found-response))
          (if-let [{:keys [handler route-param-keys]}
                   (or (get dispatch (:request-method request))
                       (get dispatch :all))]
-           (handler (assoc request
-                      :route-params (zipmap route-param-keys route-params)))
+           (let [route-params (zipmap route-param-keys route-param-vals)]
+             (handler (assoc request :route-params route-params)))
            ;; unsupported method for path
            not-found-response))))))


style

style

--- src/java_time/graph.cljc
+++ src/java_time/graph.cljc
@@ -83,15 +83,15 @@
   (possible-conversions [_ src]))

 (defn- expand [[a b]]
-  (when-not (empty? b)
+  (when-some [[bf & br] (seq b)]
     (cons
-      [(conj a (first b)) (rest b)]
-      (expand [a (rest b)]))))
+      [(conj a bf) br]
+      (expand [a br]))))

 (defn- combinations [n s]
   (letfn [(combos [n s]
             (if (zero? n)
-              (list (vector (vector) s))
+              (list [[] s])
               (mapcat expand (combos (dec n) s))))]
     (map first (combos n s))))

@@ -99,15 +99,15 @@
   (u/fast-memoize
     (fn [n]
       (let [rng (range n)]
-        (->> (map inc rng)
-             (map #(combinations % rng))
-             (apply concat)
-             (filterv #(apply = 1 (map - (rest %) %))))))))
+        (into [] (comp (map inc )
+                       (map #(combinations % rng))
+                       cat
+                       (filter #(apply = 1 (map - (rest %) %))))
+              rng)))))

 (defn- as-source [types-so-far t [dst c]]
-  (vector
-    (vector (types (conj types-so-far t)) dst)
-    c))
+  [[(types (conj types-so-far t)) dst]
+   c])

 (defn- search-for-possible-sources
   [vresult m types-so-far k more-arity-steps]
@@ -124,10 +124,9 @@
 (defn- collect-targets [v]
   (reduce
     (fn [r [k v]]
-      (if (map? v)
-        (concat r (collect-targets v))
-        (concat r v)))
-    (vector) v))
+      (concat r (cond-> v
+                  (map? v) collect-targets)))
+    [] v))

 (defn- add-conversion [m ^Types src dst conversion]
   (let [add #(update % (peek (.types src))
@@ -189,34 +188,33 @@
     (conj (.visited? p) dst)
     (+ (.cost p) (.cost c))))

-(def graph-conversion-path
-  (fn [g src dst]
-    (let [path (ConversionPath. (vector) (vector) #{src} 0)]
-      (if (assignable? src dst)
-        path
-        (let [q #?(:bb (atom ())
-                   :default (PriorityQueue.))
-              add #?(:bb #(swap! q (fn [prev]
-                                     (sort-by (fn [^ConversionPath p]
-                                                [(.cost p) (count (.path p))])
-                                              (fn [a b] (compare b a))
-                                              (conj prev %))))
-                     :default #(.add q %))
-              poll #?(:bb #(-> (swap-vals! q next) first first)
-                      :default #(.poll q))
-              _ (add path)
-              dsts (equivalent-targets g dst)]
-          (loop []
-            (when-some [^ConversionPath p (poll)]
-              (let [curr (or (-> p .path last second) src)]
-                (if (some #(assignable? curr %) dsts)
-                  p
-                  (do (run! (fn [[[src dst] c]]
-                              (when (and (> max-path-length (count (.path p)))
-                                         (not ((.visited? p) dst)))
-                                (add (conj-path p src dst c))))
-                            (possible-conversions g curr))
-                      (recur)))))))))))
+(defn graph-conversion-path [g src dst]
+  (let [path (ConversionPath. [] [] #{src} 0)]
+    (if (assignable? src dst)
+      path
+      (let [q #?(:bb (atom ())
+                 :default (PriorityQueue.))
+            add #?(:bb #(swap! q (fn [prev]
+                                   (sort-by (fn [^ConversionPath p]
+                                              [(.cost p) (count (.path p))])
+                                            (fn [a b] (compare b a))
+                                            (conj prev %))))
+                   :default #(.add q %))
+            poll #?(:bb #(-> (swap-vals! q next) ffirst)
+                    :default #(.poll q))
+            _ (add path)
+            dsts (equivalent-targets g dst)]
+        (loop []
+          (when-some [^ConversionPath p (poll)]
+            (let [curr (or (-> p .path last second) src)]
+              (if (some #(assignable? curr %) dsts)
+                p
+                (do (run! (fn [[[src dst] c]]
+                            (when (and (> max-path-length (count (.path p)))
+                                       (not ((.visited? p) dst)))
+                              (add (conj-path p src dst c))))
+                          (possible-conversions g curr))
+                    (recur))))))))))

 (defn- replace-range [v replacement idxs]
   (concat (subvec v 0 (first idxs))
@@ -307,7 +305,7 @@
               [new-conversions g'] (with-conversions g more-conversions)
               accepted-conversions (filter (fn [[conv-src _ _ cost]]
                                              (>= max-cost cost)) new-conversions)]
-          (recur g' (reduce (fn [q [_ dst _ _]] (conj q (vector dst (inc step))))
+          (recur g' (reduce (fn [q [_ dst _ _]] (conj q [dst (inc step)]))
                             (pop q) accepted-conversions))))
       g)))


[#818] Show secret key once

[#818] Show secret key once

--- Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/user_details.cljs
+++ Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/user_details.cljs
@@ -179,11 +179,21 @@
        [:div.apiKeySection.topMargin
         [:h2 "Manage API key:"]
         [:p "You can (re)generate or revoke an api key for this user"]
+        (when secret
+           [:div.alert.alert-success {:role "alert"}
+            (b/icon :ok) " The secret key will only be shown once. If it gets lost you will need to generate a new one."])
         [:form
          [:div.form-group
           [:label.control-label.text-left "Access key"]
           [:input.form-control {:type "text"
                                 :value access-key}]]
+         (when secret
+           [:div.form-group
+            [:label.control-label.text-left "Secret"]
+            [:input.form-control {:type "text"
+                                  :value secret}]])
+
+
          [:div.btn-group
           [:button.btn.btn-default {:on-click #(do (.preventDefault %)
                                                    (generate-apikeys owner user))}


Use the correct arguments to sleep when waiting on an AMI

--- src/circle/backend/ec2.clj
+++ src/circle/backend/ec2.clj
@@ -351,7 +351,7 @@

 (defn image-wait-for-ready [image-name]
   (try-try-again
-   {:sleep 15
+   {:sleep 15000
     :tries (* 4 10)}
    #(throw-if-not (= :available (image-state image-name)) "AMI did not become available in timeout window")))

@@ -362,5 +362,6 @@
     (let [ami (-> client
                   (.createImage (CreateImageRequest. instance-id image-name))
                   (.getImageId))]
+      (println image-name "=>" ami)
       (image-wait-for-ready ami)
       ami)))


assert effect map if corresponding spec exists

--- src/citrus/reconciler.cljs
+++ src/citrus/reconciler.cljs
@@ -1,5 +1,6 @@
 (ns citrus.reconciler
-  (:require-macros [citrus.macros :as m]))
+  (:require-macros [citrus.macros :as m])
+  (:require [cljs.spec.alpha :as s]))

 (defn- queue-effects! [queue f]
   (vswap! queue conj f))
@@ -87,6 +88,9 @@
                         effects (ctrl st cofx)]
                     (m/doseq [effect (dissoc effects :state)]
                       (let [[id effect] effect]
+                        (when (s/check-asserts?)
+                          (when-let [spec (s/get-spec id)]
+                            (s/assert spec effect)))
                         (when-let [handler (get effect-handlers id)]
                           (handler this cname effect))))
                     (if (contains? effects :state)
@@ -112,6 +116,9 @@
       (m/doseq [effect effects]
         (let [[id effect] effect
               handler (get effect-handlers id)]
+          (when (s/check-asserts?)
+            (when-let [spec (s/get-spec id)]
+              (s/assert spec effect)))
           (cond
             (= id :state) (swap! state assoc cname effect)
             handler (handler this cname effect)


Change regex to allow for greater range of characters.

--- src/kixi/hecuba/amon.clj
+++ src/kixi/hecuba/amon.clj
@@ -178,6 +178,10 @@
                               (assoc :href (path-for routes (:project @handlers) :project-id (:id %))))))]

       (case mime
+        "application/json" (-> coll
+                               downcast-to-json
+                               camelify
+                               encode)
         "text/html" (render-items-html coll)
         ;; Liberator's default rendering of application/edn seems wrong
         ;; (it wraps the data in 'clojure.lang.PersistentArrayMap', so
@@ -210,6 +214,10 @@
   (fn [{item ::item {mime :media-type} :representation {routes :modular.bidi/routes} :request}]
     (let [item (assoc item :properties (path-for routes (:properties @handlers) :project-id (:id item)))]
       (case mime
+        "application/json" (-> item
+                               downcast-to-json
+                               camelify
+                               encode)
         "text/html" (html
                      [:body
                       [:h1 (:name item)]
@@ -699,7 +707,7 @@
                  })))

-(def sha1-regex #"[0-9a-f-]+")
+(def sha1-regex #"[0-9a-z-]+")

 (defn make-routes [handlers]
   ;; AMON API here


Use TABLES pegdown extension.

Use TABLES pegdown extension.

--- src/main/clojure/ssblog/core.clj
+++ src/main/clojure/ssblog/core.clj
@@ -2,7 +2,7 @@
   (:require [clojure.java.shell :refer [sh]]
             [cheshire.core :refer [generate-string]])
   (:import [java.io File]
-           [org.pegdown PegDownProcessor]))
+           [org.pegdown PegDownProcessor Extensions]))

  ;; config
@@ -120,8 +120,11 @@
  ;; md

+(def extensions
+  [Extensions/FENCED_CODE_BLOCKS Extensions/TABLES])
+
 (def peg-down-processor
-  (PegDownProcessor. org.pegdown.Extensions/FENCED_CODE_BLOCKS))
+  (PegDownProcessor. (int (apply bit-or extensions))))

 (def split-file-on-triple-dash
   (partial split-file-on "---"))
@@ -171,5 +174,5 @@

 (defn -main [& args]
   (println "Processing files")
-  (process-org-files (get-orgbuild-config))
+  (process-md-files (get-mdbuild-config))
   (System/exit 0))


emit JS arrays of path components that are joined in the Node.js REPL process at runtime

--- src/clj/cljs/repl/node.clj
+++ src/clj/cljs/repl/node.clj
@@ -9,6 +9,7 @@
 (ns cljs.repl.node
   (:require [clojure.string :as string]
             [clojure.java.io :as io]
+            [cljs.util :as util]
             [cljs.analyzer :as ana]
             [cljs.compiler :as comp]
             [cljs.repl :as repl]
@@ -70,6 +71,12 @@
   (node-eval repl-env
     (str "goog.require('" (comp/munge (first provides)) "')")))

+(defn seq->js-array [v]
+  (str "[" (apply str (interpose ", " (map pr-str v))) "]"))
+
+(defn platform-path [v]
+  (str "path.join.apply(null, " (seq->js-array v) ")"))
+
 (defn setup
   ([repl-env] (setup repl-env nil))
   ([repl-env opts]
@@ -88,8 +95,13 @@
           proc (.start bldr)
           env  (ana/empty-env)
           core (io/resource "cljs/core.cljs")
-          root-path (.getCanonicalFile output-dir)
-          rewrite-path (str (.getPath root-path) File/separator "goog")]
+          ;; represent paths as vectors so we can emit JS arrays, this is to
+          ;; paper over Windows issues with minimum hassle - David
+          path (.getPath (.getCanonicalFile output-dir))
+          [fc & cs] (rest (util/path-seq path)) ;; remove leading empty string
+          root (.substring path 0 (+ (.indexOf path fc) (count fc)))
+          root-path (vec (cons root cs))
+          rewrite-path (conj root-path "goog")]
       ;; TODO: temporary hack, should wait till we can read the start string
       ;; from the process - David
       (Thread/sleep 300)
@@ -114,19 +126,19 @@
       ;; properly due to how we are running it - David
       (node-eval repl-env
         (-> (slurp (io/resource "cljs/bootstrap_node.js"))
-          (string/replace "__dirname"
-            (str "\"" (str rewrite-path File/separator "bootstrap") "\""))
+          (string/replace "path.resolve(__dirname, '..', 'base.js')"
+            (platform-path (conj rewrite-path "bootstrap" ".." "base.js")))
           (string/replace
             "path.join(\".\", \"..\", src)"
-            (str "path.join(\"" rewrite-path "\", src)"))
+            (str "path.join(" (platform-path rewrite-path) ", src)"))
           (string/replace
             "var CLJS_ROOT = \".\";"
-            (str "var CLJS_ROOT = \"" (.getPath root-path) "\";"))))
+            (str "var CLJS_ROOT = " (platform-path root-path) ";"))))
       ;; load the deps file so we can goog.require cljs.core etc.
       (node-eval repl-env
-        (str "require('"
-          (.getPath root-path)
-          File/separator "node_repl_deps.js')"))
+        (str "require("
+             (platform-path (conj root-path "node_repl_deps.js"))
+             ")"))
       ;; monkey-patch isProvided_ to avoid useless warnings - David
       (node-eval repl-env
         (str "goog.isProvided_ = function(x) { return false; };"))


implement Resistor

implement Resistor

--- src/clj/game/cards-ice.clj
+++ src/clj/game/cards-ice.clj
@@ -480,6 +480,11 @@
    "Rainbow"
    {:abilities [end-the-run]}

+   "Resistor"
+   {:strength-bonus (req (get-in @state [:runner :tag]))
+    :abilities [{:label "Trace 4 - End the run"
+                 :trace {:base 4 :msg "end the run" :effect (effect (end-run))}}]}
+
    "Rototurret"
    {:abilities [trash-program end-the-run]}


have all-installed search of Runner cards include programs hosted on ICE

--- src/clj/game/core-misc.clj
+++ src/clj/game/core-misc.clj
@@ -67,8 +67,11 @@
   but not including 'inactive hosting' like Personal Workshop."
   [state side]
   (if (= side :runner)
-    (let [installed (flatten (for [t [:program :hardware :resource]] (get-in @state [:runner :rig t])))]
-      (concat installed (filter :installed (mapcat :hosted installed))))
+    (let [installed (flatten (for [t [:program :hardware :resource]] (get-in @state [:runner :rig t])))
+          hosted-on-ice (->> (:corp @state) :servers seq flatten (mapcat :ices) (mapcat :hosted))]
+      (concat installed
+              (filter :installed (mapcat :hosted installed))
+              (filter #(= (:side %) "Runner") hosted-on-ice)))
     (let [servers (->> (:corp @state) :servers seq flatten)
           content (mapcat :content servers)
           ice (mapcat :ices servers)


Sort active registers correctly in `expire`.

--- src/clj/minijava/alloc.clj
+++ src/clj/minijava/alloc.clj
@@ -1,7 +1,8 @@
 (ns minijava.alloc
   "Register allocation, using a linear scan algorithm.
    See Poletto and Sarkar[1999]"
-  (:use [minijava flow gas]))
+  (:use [minijava flow gas])
+  (:require [clojure.set :as set]))

 (declare expire spill)

@@ -20,7 +21,7 @@
       (swap! active expire i dead)
       (if (= (count @active) (count regs))
         (swap! spilled conj (spill i active))
-        (let [reg (first (clojure.set/difference regs @allocd))
+        (let [reg (first (set/difference regs @allocd))
               i   (assoc i :reg reg)]
           (swap! allocd conj reg)
           (swap! active conj i))))
@@ -29,7 +30,8 @@
 (defn- expire
   "Expire registers that've been freed from intrvl and intrvl - 1."
   [active intrvl dead]
-  (let [[active died] (split-with #(>= (:end %) (:start intrvl)) active)]
+  (let [[active died] (split-with #(>= (:end %) (:start intrvl))
+                                  (sort-by :end active))]
     (swap! dead concat died)
     active))


Implemented emit

Implemented emit

--- src/clj/minijava/munch.clj
+++ src/clj/minijava/munch.clj
@@ -5,13 +5,23 @@
 (defn isit? [x t]
 (= (type x) t)
 )
+
+(def instr '())

 (defn emit [x]
 ;;I'm not sure what the best way to implement this is yet. But emit just appends x to the end of a list, so theres not too much to it.
 ;;emit should return nil.
-	nil
+	(do
+			(set! instr (cons x instr))
+	nil)
 )
+
+(defn select [irtree]
+	(do
+		(set! instr '()) ;;reset instr to empty list
+		(munch irtree)
+		 instr))

 ;;ir is the root of the ir tree to munch; args is an (optional) list of the 'children' of the root node, for pattern matching purposes.
 ;;its ok to omit args.


more cubes

more cubes

--- src/cljs/cezanne/core.cljs
+++ src/cljs/cezanne/core.cljs
@@ -14,17 +14,26 @@
                     0.1
                     1000)
         renderer (js/THREE.WebGLRenderer.)
-        geometry (js/THREE.CubeGeometry. 2 2 0.2)
+        geometry (js/THREE.CubeGeometry. 2 2 5e-2)
         material (js/THREE.MeshNormalMaterial. )
-        cube (js/THREE.Mesh. geometry material)]
+        cube (js/THREE.Mesh. geometry material)
+        cube-2 (js/THREE.Mesh. geometry material)
+        cube-4 (js/THREE.Mesh. geometry material)
+        cube-3 (js/THREE.Mesh. geometry material)]
     (.setSize renderer (.-innerWidth js/window) (.-innerHeight js/window))
     (.. js/document -body (appendChild (.-domElement renderer)))
     (.add scene cube)
+    (.add scene cube-2)
+    (.add scene cube-3)
+    (.add scene cube-4)
     (set! (.. camera -position -z) 5)
     (reset! state
           {:scene scene
            :camera camera
            :cube cube
+           :cube-2 cube-2
+           :cube-3 cube-3
+           :cube-4 cube-4
            :renderer renderer})))

@@ -32,8 +41,15 @@
 (defn render []
   (js/requestAnimationFrame render)
   (.render (:renderer @state) (:scene @state) (:camera @state))
-  #_(set! (.. (:cube @state) -rotation -x) (+ (.. (:cube @state) -rotation -x) 0.05))
-  (set! (.. (:cube @state) -rotation -y) (+ (.. (:cube @state) -rotation -y) 0.15)))
+  (set! (.. (:cube @state) -rotation -x) (+ (.. (:cube @state) -rotation -x) 1e-2))
+  (set! (.. (:cube @state) -rotation -y) (+ (.. (:cube @state) -rotation -y) 8e-2))
+  (set! (.. (:cube-2 @state) -rotation -x) (+ (.. (:cube-2 @state) -rotation -x) 8e-2))
+  (set! (.. (:cube-2 @state) -rotation -y) (+ (.. (:cube-2 @state) -rotation -y) 1e-2))
+  (set! (.. (:cube-3 @state) -rotation -x) (+ (.. (:cube-3 @state) -rotation -x) 4e-2))
+  (set! (.. (:cube-3 @state) -rotation -y) (+ (.. (:cube-3 @state) -rotation -y) 1e-2))
+  (set! (.. (:cube-4 @state) -rotation -x) (+ (.. (:cube-4 @state) -rotation -x) 1e-2))
+  (set! (.. (:cube-4 @state) -rotation -y) (+ (.. (:cube-4 @state) -rotation -y) 4e-2))
+  )

 (init-all)


Update UI

Update UI

--- src/cljs/russyll/core.cljs
+++ src/cljs/russyll/core.cljs
@@ -2,17 +2,18 @@
   (:require [reagent.core :as reagent :refer [atom]]
             [reagent.session :as session]
             [reagent.core :as r]
-            [text]
+            [russyll.text :as text]
+            [russyll.globals :as globals]
             [re-frame.core :as re-frame]
             [secretary.core :as secretary :include-macros true]
             [goog.events :as events]
             [goog.history.EventType :as EventType])

   (:use
-   [globals :only [sformat]]
-   [syllab :only [syll-single]]
-   [orphoep :only [orpho-single ++ --]]
-   [usertest :only [serve-words-rand calc-stats]]
+   [russyll.globals :only [sformat]]
+   [russyll.syllab :only [syll-single]]
+   [russyll.orphoep :only [orpho-single ++ --]]
+   [russyll.usertest :only [serve-words-rand calc-stats]]
    )
   (:import goog.History)
   )
@@ -148,7 +149,7 @@
        {:style {:margin-top "10px"}}
        [:div.progress-bar.progress-bar-success {:style {:width (str @user-progress "%")}}]])))

-(def textarea-style {:width "100%" :height 200})
+(def textarea-style {:width "100%" :height 200 :margin-bottom "10px"})

 (def models
   [
@@ -159,6 +160,8 @@
    {:i 4 :name "SSP" :short "SM5"}
    ])

+(def punctuation-set #{" " "," "?" "." "-" "!" "’" ":"})
+
 (defn textarea []
   (let [
         table (re-frame/subscribe [:key-in-db :table-syllabied])
@@ -168,8 +171,9 @@
         splitted-mapped (re-frame/subscribe [:key-in-db :splitted=mapped])
         ]
     (fn []
-      [:div
+      [:div.panel.panel-default
        [:h2.ribbon (str "Put in some data!")]
+       [:label {:style {:margin-top "20px" :font-size "large"}}  "Choose a syllabification model"]
        [:select.form-control
         {
          :on-change (fn [evt]
@@ -180,15 +184,19 @@
         (for [{:keys [name i]} models]
           [:option {:value i :key i} name])
         ]
+
+       [:label {:style {:margin-top "20px" :font-size "large"}} "Input a text"]
        [:textarea
         {:style textarea-style
          :on-change (fn [evt] (do (re-frame/dispatch [:change-text (-> evt .-target .-value)]) (re-frame/dispatch [:syllaby]))) :value @text-in}]
-       [:pre @text-syllabied]
+       [:label {:style {:margin-top "20px" :font-size "large"}} "This is the output"]
+       [:p {:style {:background "azure"}} @text-syllabied]
+       [:label {:style {:margin-top "20px" :font-size "large"}} "The text in table form (without punctuation)"]
        [:table.table.table-striped.table-bordered.table-hover.table-condensed.syllabied
         [:tbody
          [:tr [:th] (for [{:keys [short name]} models] [:th {:key name :title name} short])]
          (for
-             [[word syll-models] (filter #(not= (first %) " ") @splitted-mapped)]
+             [[word syll-models] (filter #(not (contains? punctuation-set (first %))) @splitted-mapped)]
            [:tr {:key (rand) :value (not= word " ")} [:td word]
             (map-indexed (fn [ix word] [:td {:key ix} word]) syll-models)
             ]
@@ -210,10 +218,10 @@
         done (re-frame/subscribe [:key-in-db :done])
         ]
     (fn []
-      [:div
+      [:div.panel.panel-default {:style {:padding "20px"}}
        [:h2.ribbon "Your turn!"]
        [:h4 "Here you can check yourself: Which model follows your intution?"]
-       [:div.well.bg-warning
+       [:div
         [:strong "Important: "]
         "Set the division with a dash '-': 'игорь' -> 'и-горь'. There will be 10 words to divide."
         [:div.input-group.col-sm-4
@@ -234,9 +242,17 @@

 (defn home-page []
-  [:div [:h1.header.navbar "Welcome to " [:strong "russyll"] ", the automatic syllable divider"]
+  [:div
    [:div#app-body
+   [:div.jumbotron {:style {:text-align "center"}}
+    [:h1 "Russyll"]
+    [:h3 "Welcome to the automatic syllable divider of Russian. Just type in a text and it gets processed automatically."
+     [:br]
+     ]
+    ]
+
     ((check-yourself))
+
     ((textarea))
     (table-text)
     ]


Add reference option to pileup command

Add reference option to pileup command

--- src/clojure/cljam/core.clj
+++ src/clojure/cljam/core.clj
@@ -128,10 +128,26 @@
     (bai/create-index f (str f ".bai"))
     nil))

+(defn- pileup-with-ref
+  [rdr ref-fa]
+  (with-open [fa-rdr (fa/reader ref-fa)]
+   (doseq [rname (map :name (read-refs rdr))
+           line  (plp/mpileup rdr rname -1 -1 :ref-fasta fa-rdr)]
+     (if-not (zero? (:count line))
+       (println (clojure.string/join \tab (map val line)))))))
+
+(defn- pileup-without-ref
+  [rdr]
+  (doseq [rname (map :name (read-refs rdr))
+          line  (plp/mpileup rdr rname)]
+    (if-not (zero? (:count line))
+      (println (clojure.string/join \tab (map val line))))))
+
 (defn pileup [args]
   (let [[opt [f _] help] (cli args
                               "Usage: cljam pileup <in.bam>"
-                              ["-h" "--help" "Print help" :default false :flag true])]
+                              ["-h" "--help" "Print help" :default false :flag true]
+                              ["-r" "--ref" "Reference file in the FASTA format."])]
     (when (:help opt)
       (exit-with 0 (println help)))
     (with-open [r (reader f)]
@@ -139,10 +155,9 @@
         (exit-with 1 (println "Not support SAM file")))
       (when-not (sorter/sorted? r)
         (exit-with 1 (println "Not sorted")))
-      (doseq [rname (map :name (read-refs r))
-              line  (plp/mpileup r rname)]
-        (if-not (zero? (:count line))
-          (println (clojure.string/join \tab (map val line))))))
+      (if (nil? (:ref opt))
+        (pileup-without-ref r)
+        (pileup-with-ref r (:ref opt))))
     nil))

 (defn faidx [args]


fix route

fix route

--- src/clojure/nossal/app.clj
+++ src/clojure/nossal/app.clj
@@ -106,8 +106,10 @@
                                 (debug request))

   (GET "/demo" request
-    (iframe-demo request)) (POST "/short/create-db" []
-                             (create-database))
+    (iframe-demo request))
+
+  (GET "/short/create-db" []
+    (create-database))

   (POST "/short/new/:url" [url]
     (new-url url))
@@ -126,12 +128,6 @@
   (ANY "*" []
     (route/not-found (slurp (io/resource "404.html")))))

-(def app-bidi-routes ["/" {;"" (resources-maybe {:prefix "public/"})
-                      ; "" index
-                           "debug" debug
-                           "sw.js.map"  (fn [req] (service-worker ".map"))
-                           "sw.js" (service-worker "")
-                           "manifest.json" pwa-manifest}])

 (def app
   (-> app-routes
@@ -151,4 +147,4 @@

 (defn -main [& [port]]
   (let [port (Integer. (or port (env :port) 3000))]
-    (jetty/run-jetty (site #'app) {:port port :join? false})))
+    (jetty/run-jetty #'app {:port port :join? false})))


Remove debug.

Remove debug.

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -66,31 +66,21 @@
           acker-stream-id (rand-stream-id)
           completion-stream-id (rand-stream-id)

-          _ (prn "Driver ...")
           driver (MediaDriver/launch)
-          _ (prn "Ctd ...")
           ctx (Aeron$Context.)
-          _ (prn "Aeron ...")
           aeron (Aeron/connect ctx)
-          _ (prn "Done")

           send-handler (data-handler (partial handle-sent-message inbound-ch))
           acker-handler (data-handler (partial handle-acker-message daemon))
           completion-handler (data-handler (partial handle-completion-message release-ch))

-          _ (prn "Add")
           send-subscriber (.addSubscription aeron channel send-stream-id send-handler)
-          _ (prn "Next")
           acker-subscriber (.addSubscription aeron channel acker-stream-id acker-handler)
           completion-subscriber (.addSubscription aeron channel completion-stream-id completion-handler)]

-      (prn "La")
       (future (.accept (consumer 10) send-subscriber))
-      (prn "Ba")
       (future (.accept (consumer 10) acker-subscriber))
-      (prn "Ma")
       (future (.accept (consumer 10) completion-subscriber))
-      (prn "Eee")

       (assoc component :driver driver :channel channel :send-stream-id send-stream-id
              :acker-stream-id acker-stream-id :completion-stream-id completion-stream-id)))


fix cake test unprintable object bug with a crazy hack

--- dev/bake/test.clj
+++ dev/bake/test.clj
@@ -1,11 +1,13 @@
 (ns bake.test
   (:use clojure.test
+        [clojure.walk :only [postwalk]]
         [clojure.string :only [trim-newline]]
         [cake :only [*config*]]
         [bake.core :only [verbose? log all with-timing]]
         [bake.reload :only [last-reloaded last-modified reload]]
         [bake.notify :only [notify]]
-        [bake.clj-stacktrace])
+        [bake.clj-stacktrace]
+        [useful.fn :only [to-fix given]])
   (:import [java.io StringWriter IOException]))

 (defn test-vars [nses {:keys [tags functions namespaces]}]
@@ -34,14 +36,20 @@
   (set! *out* (StringWriter.))
   (set! *err* *out*))

+(defn unprintable? [obj]
+  (not (get-method print-dup (type obj))))
+
+(defn make-printable [obj]
+  (symbol (format "#=(symbol %s)" (pr-str (pr-str obj)))))
+
 (defn update-results [& objects]
   (doseq [object objects]
     (let [object (if (instance? StringWriter object)
                    (do (reset-streams!)
                        (not-empty (trim-newline (.toString object))))
-                   (if (seq *testing-contexts*)
-                     (assoc object :testing-contexts (testing-contexts-str))
-                     object))]
+                   (-> (postwalk (to-fix unprintable? make-printable) object)
+                       (given (seq *testing-contexts*)
+                              assoc :testing-contexts (testing-contexts-str))))]
       (when object
         (swap! *ns-results* update-in [*current-test*] (fnil conj []) object)))))


fix Database pre-update when JSON :details aren't passed

--- src/metabase/models/database.clj
+++ src/metabase/models/database.clj
@@ -75,9 +75,8 @@
          :engine (name engine)))

 (defmethod pre-update Database [_ {:keys [details] :as database}]
-  (assoc database
-         :updated_at (new-sql-timestamp)
-         :details (json/write-str details)))
+  (cond-> (assoc database :updated_at (new-sql-timestamp))
+    details (assoc :details (json/write-str details))))

 (defn databases-for-org
   "Selects the ID and NAME for all databases available to the given org-id."


switch from `load-string` to `eval`, prep for #12

--- src/main/om_css/core.clj
+++ src/main/om_css/core.clj
@@ -143,8 +143,9 @@
 (defn defui* [name forms env]
   (let [ns-name (-> env :ns :name str)
         component-style (some->> (get-component-style forms)
-                          (str "(clojure.core/refer 'clojure.core)")
-                          load-string
+                          (list '(clojure.core/refer 'clojure.core))
+                          (cons 'do)
+                          eval
                           (format-style-classes ns-name (str name)))
         css-str (when component-style
                   (garden/css component-style))


rename endpoint

rename endpoint

--- src/clj/murakami/routes/home.clj
+++ src/clj/murakami/routes/home.clj
@@ -30,7 +30,7 @@
   (GET "/" []
     (OK {:message "It's dangerous to go alone. Take this! c=[====>"}))

-  (GET "/poo" []
+  (GET "/snake_case" []
     (OK {:message-break "LIMIT BREAK"}))

   (GET "/app" [] loading-page)


ENH: chapter 6, exercise 2: implement comp function

--- src/clj_prj03/ch6_additional.clj
+++ src/clj_prj03/ch6_additional.clj
@@ -45,3 +45,15 @@

 ((attr :intelligence) character)
 ((attr :strength) character)
+
+;; Exercise 2: implement the comp function
+
+(defn gabe-comp
+  "my implementation of the comp function"
+  [& fns]
+  (fn [& args]
+    (if (empty? fns)
+      args
+      ((last fns) (apply (gabe-comp (butlast fns)) args)))))
+
+((gabe-comp inc *) 6 2)  ; --> should be 13


Fixing clj/cljs macro referral

Fixing clj/cljs macro referral

--- src/cljc/sanakone/translate.cljc
+++ src/cljc/sanakone/translate.cljc
@@ -1,5 +1,6 @@
 (ns sanakone.translate
-  (:require [sanakone.macros :refer-macros [defdata]]
+  (:require #?(:clj  [sanakone.macros :refer [defdata]]
+               :cljs [sanakone.macros :refer-macros [defdata]])
             [clojure.string :as string]))

 (defdata verbs "verbs.edn")


Now devtools is installed only when not in prod

--- src/cljs/cljs_repl_web/core.cljs
+++ src/cljs/cljs_repl_web/core.cljs
@@ -11,8 +11,10 @@

 (defonce console-key :cljs-console)

-(devtools/set-pref! :install-sanity-hints true) ; this is optional
-(devtools/install!)
+;; https://github.com/binaryage/cljs-devtools/releases/tag/v0.5.3
+(when-not (:production? config/defaults)
+  (devtools/set-pref! :install-sanity-hints true)
+  (devtools/install!))

 (enable-console-print!)


Showing code signing error messages in upload modal.

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1369,7 +1369,6 @@
               [:input.save {:data-failed-text "Failed",
                             :data-success-text "Uploaded",
                             :data-loading-text "Uploading...",
-                            :data-dismiss "modal"
                             :value "Upload",
                             :type "submit"
                             :disabled (not (and file-content description))
@@ -1397,11 +1396,12 @@
            [:td (datetime/as-time-since uploaded_at)]
            [:td {:on-click #(raise! owner [:delete-p12 {:project-name project-name :id id}])} [:i.material-icons "cancel"]]])))))

-(defn code-signing [{:keys [project osx-keys]} owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [project-name (vcs-url/project-name (:vcs_url project))]
+(defn code-signing [{:keys [project-data error-message]} owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [{:keys [project osx-keys]} project-data
+            project-name (vcs-url/project-name (:vcs_url project))]
         (html
           [:section.code-signing-page
            [:article
@@ -1432,6 +1432,7 @@
                 [:div.modal-title "Upload a New Apple Code Signing Key"]
                 [:i.material-icons.modal-close {:data-dismiss "modal"} "clear"]]
                [:div.modal-body.upload
+                (om/build common/flashes error-message)
                 (om/build p12-upload-form {:project-name project-name})]]]]]])))))

 (defn project-settings [data owner]
@@ -1440,12 +1441,16 @@
     (render [_]
       (let [project-data (get-in data state/project-data-path)
             user (:current-user data)
-            subpage (:project-settings-subpage data)]
+            subpage (:project-settings-subpage data)
+            error-message (get-in data state/error-message-path)]
         (html
          (if-not (get-in project-data [:project :vcs_url]) ; wait for project-settings to load
            [:div.loading-spinner-big common/spinner]
            [:div#project-settings
-            (om/build common/flashes (get-in data state/error-message-path))
+            ; Temporarly disable top level error messsage for the set of subpages while we
+            ; transition them. Each subpage will eventually handle their own error messages.
+            (when-not (contains? #{:code-signing} subpage)
+              (om/build common/flashes error-message))
             [:div#subpage
              (condp = subpage
                :parallel-builds (om/build parallel-builds project-data)
@@ -1464,6 +1469,6 @@
                :aws (om/build aws project-data)
                :aws-codedeploy (om/build aws-codedeploy project-data)
                :code-signing (if (feature/enabled? :show-ios-code-signing)
-                               (om/build code-signing project-data)
+                               (om/build code-signing {:project-data project-data :error-message error-message})
                                (om/build overview project-data))
                (om/build overview project-data))]]))))))


Point to the correct place on discuss for code-signing

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1525,8 +1525,10 @@
             [:hr.divider]
             [:div.info "The following code-signing identities will be added to the system keychain when your build
                         begins, and will be available to sign iOS and OSX apps. For more information about code-signing
-                        on CircleCI see the "
-             [:a "code-signing section of the docs."]]
+                        on CircleCI see our "
+             [:a
+              {:href "https://discuss.circleci.com/t/ios-code-signing/1231"}
+              "code-signing documentation."]]
             (if-not (empty? osx-keys)
               (om/build p12-key-table {:rows (->> osx-keys
                                                   (map (partial merge {:project-name project-name})))})


apply w/ vector no longer slow, set operations are really slow mark them

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -91,7 +91,7 @@
 (simple-benchmark [] (list 1 2 3 4 5) 1000000)
 (simple-benchmark [xs (array-seq (array 1 2 3 4 5))] (apply list xs) 1000000)
 (simple-benchmark [xs (list 1 2 3 4 5)] (apply list xs) 1000000)
-(simple-benchmark [xs [1 2 3 4 5]] (apply list xs) 1000000) ;; slow
+(simple-benchmark [xs [1 2 3 4 5]] (apply list xs) 1000000)
 (println)

 (println ";; update-in")
@@ -170,9 +170,9 @@
 (println)

 (println ";;; set ops")
-(simple-benchmark [] #{} 100000)
-(simple-benchmark [] #{1 2 3} 100000)
-(simple-benchmark [coll #{1 2 3}] (conj coll 4) 100000)
+(simple-benchmark [] #{} 100000) ;; SLOW
+(simple-benchmark [] #{1 2 3} 100000) ;; SLOW
+(simple-benchmark [coll #{1 2 3}] (conj coll 4) 100000) ;; SLOW
 (println)

 (println ";;; seq ops")


* benchmark/cljs/benchmark_runner.cljs: keyword invoke currently slow, bring iters down an order of magnitude

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -31,9 +31,9 @@
 (println ";;; map / record ops")
 (simple-benchmark [coll {:foo 1 :bar 2}] (get coll :foo) 1000000)
 (simple-benchmark [coll {:foo 1 :bar 2}] (-lookup coll :foo nil) 1000000)
-(simple-benchmark [coll {:foo 1 :bar 2}] (:foo coll) 1000000)
+(simple-benchmark [coll {:foo 1 :bar 2}] (:foo coll) 100000)
 (defrecord Foo [bar baz])
-(simple-benchmark [coll (Foo. 1 2)] (:bar coll) 1000000)
+(simple-benchmark [coll (Foo. 1 2)] (:bar coll) 100000)
 (simple-benchmark [coll {:foo 1 :bar 2}] (assoc coll :baz 3) 100000)
 (println)


recomment out send request

recomment out send request

--- src/test/clojure/me/moocar/logbackgelf/end_to_end_test.clj
+++ src/test/clojure/me/moocar/logbackgelf/end_to_end_test.clj
@@ -301,7 +301,4 @@
     (let [logger (LoggerFactory/getLogger "this_logger")]
       (dotimes [_ 10]
         (future (.debug logger (string/join (repeatedly (* 512 5) #(rand-nth "abcdefghijklmnopqrstuvwxyz"))) #_(ex-info "ERROR ME TIMBER" {}))))
-      (.debug logger (string/join (repeatedly 30 #(rand-nth "abcdefghijklmnopqrstuvwxyz"))) #_(ex-info "ERROR ME TIMBER" {})))))
-
-(send-request)
-;; (require 'me.moocar.logbackgelf.end-to-end-test)
+      #_(.debug logger (string/join (repeatedly 30 #(rand-nth "abcdefghijklmnopqrstuvwxyz"))) #_(ex-info "ERROR ME TIMBER" {})))))


Updated Hiccup to 1.0.0

Updated Hiccup to 1.0.0

--- ring-devel/project.clj
+++ ring-devel/project.clj
@@ -2,6 +2,6 @@
   :description "Ring development and debugging libraries."
   :url "http://github.com/mmcgrana/ring"
   :dependencies [[ring/ring-core "1.1.0-RC1"]
-                 [hiccup "1.0.0-RC3"]
+                 [hiccup "1.0.0"]
                  [clj-stacktrace "0.2.4"]
                  [ns-tracker "0.1.1"]])


fixed use error in karras.collection

fixed use error in karras.collection

--- src/karras/example.clj
+++ src/karras/example.clj
@@ -1,5 +1,6 @@
 (ns karras.example
   (:use karras.core
+        karras.collection
         karras.sugar
         clojure.pprint))


check registered before task queue

check registered before task queue

--- cloc-scheduler/src/cloc_scheduler/core.clj
+++ cloc-scheduler/src/cloc_scheduler/core.clj
@@ -38,6 +38,14 @@
     ;; remove cancellation
     (car/wcar redis-spec (car/srem "cancellations" task))))

+(defn- registered
+  [{db-conn :db-conn} target]
+  (> (-> (r/table "users")
+         (r/get (format "github/%s" target))
+         (r/count)
+         (r/run db-conn))
+    0))
+
 (defn- run-task
   [{:keys [redis-spec db-conn docker-client] :as spec} counter]
   (let [running-count @counter
@@ -46,7 +54,8 @@
         [target task-id] (car/wcar redis-spec (car/zrange "scheduling" 0 0 "withscores"))]

     ;; run container
-    (when (and task-id (< running-count running-max))
+    ;; check user has been registered
+    (when (and task-id (< running-count running-max) (registered spec target))

       (let [[status state] (active-tasks/try-start-task spec target task-id)]
         (when (= :ok status)


Fix arity bug.

Fix arity bug.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -441,7 +441,7 @@

         (let [replay-messages-ch (replay-messages! messenger pipeline-data replay-interval task-kill-ch)
               aux-ch (launch-aux-threads! messenger pipeline-data outbox-ch seal-resp-ch completion-ch task-kill-ch)
-              task-lifecycle-ch (thread (run-task-lifecycle pipeline-data seal-resp-ch kill-ch task-kill-ch ex-f))]
+              task-lifecycle-ch (thread (run-task-lifecycle pipeline-data seal-resp-ch kill-ch ex-f))]
           (assoc component
             :pipeline-data pipeline-data
             :seal-ch seal-resp-ch


Add a TODO comment.

Add a TODO comment.

--- src/posthere/capture_request.clj
+++ src/posthere/capture_request.clj
@@ -120,6 +120,7 @@
   (let [processed-request
     (-> request
       (add-time-stamp) ; save the time of the request
+      ;; TODO add this back in w/o the dissoc-in crash, maybe file a bug on it
       ;(dissoc-in [:headers "host"]) ; remove host from headers
       (parse-query-string) ; handle any query string parameters
       (limit-body-request-size) ; deal with bodies that are bigger than the maximum allowed


Replies -> Comments

Replies -> Comments

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -450,7 +450,7 @@
               [:td
                 [:a.digest-group-link {:href (:url replies)}
                   [:label.digest-group-title
-                    "Replies"]]]])
+                    "Comments"]]]])
           (when replies?
             [:tr
               [:td


Better logging in runner

Better logging in runner

--- src/polismath/runner.clj
+++ src/polismath/runner.clj
@@ -6,7 +6,7 @@
             ;; TODO Replace this with the canonical clojure.tools.cli once storm is removed
             [clojure.newtools.cli :as cli]
             [clojure.tools.namespace.repl :as namespace.repl]
-            [clojure.tools.logging :as log]
+            [taoensso.timbre :as log]
             [clojure.string :as string]
             [com.stuartsierra.component :as component]))

@@ -79,12 +79,14 @@

 (defn -main [& args]
   (let [{:keys [arguments options errors summary]} (cli/parse-opts args cli-options)]
-    (log/info "Submitting storm topology")
+    (log/info "Runner main function executed")
     (cond
       (:help options)   (utils/exit 0 (usage summary))
       (:errors options) (utils/exit 1 (str "Found the following errors:" \newline (:errors options)))
       :else
-      (let [system-map-generator (subcommands (first arguments))
+      (let [subcommand (first arguments)
+            system-map-generator (subcommands subcommand)
+            _ (log/info "Running subcommand:" subcommand)
             system (system/create-and-run-system! system-map-generator options)]
         (loop []
           (Thread/sleep 1000)


add insecure flag for influxdb in case cert is self-signed for https

--- src/riemann/influxdb.clj
+++ src/riemann/influxdb.clj
@@ -181,7 +181,8 @@
         (cond->
           {:socket-timeout (:timeout opts 5000) ; ms
            :conn-timeout   (:timeout opts 5000) ; ms
-           :content-type   "text/plain"}
+           :content-type   "text/plain"
+	   :insecure? (:insecure opts false)}
           (:username opts)
             (assoc :basic-auth [(:username opts)
                                 (:password opts)]))
@@ -229,6 +230,8 @@

   `:password`       Password to authenticate with. (optional)

+  `:insecure`       If scheme is https and certficate is self-signed. (optional)
+
   See `influxdb-8` and `influxdb-9` for version-specific options."
   [opts]
   (let [opts (merge {:version :0.8


Uncomment DOM modification - now it's safe to run tests with them

--- src/text_justification/core.cljs
+++ src/text_justification/core.cljs
@@ -12,11 +12,12 @@
 ;;;; TODO mark right margin
 ;;;; TODO line length should be part of state too

-(defonce space-char (gstring/unescapeEntities " ")) ;; \u00A0 ?
+(defonce ^:const SPACE-CHAR (gstring/unescapeEntities " ")) ;; \u00A0 ?

-(defn get-slider-el   [] (dom/getElement "page-width"))
-(defn get-checkbox-el [] (dom/getElement "preserve-paragraphs"))
-(defn get-text-el     [] (dom/getElement "text"))
+(defn get-result-view-el [] (dom/getElement "justified-text"))
+(defn get-slider-el      [] (dom/getElement "page-width"))
+(defn get-checkbox-el    [] (dom/getElement "preserve-paragraphs"))
+(defn get-text-el        [] (dom/getElement "text"))

 (defn get-text "get text to justify as string" []
   (.-value (get-text-el)))
@@ -25,23 +26,17 @@
   ; (println "notify")
   (model/text-justification (get-text) (.-checked (get-checkbox-el)) (.-value (get-slider-el))))

-(comment
+
 ;;;;
 ;;;; listeners
 ;;;;

 (defn reload-element
-  "allows for listeners removal"
-  [el]
-  (.replaceChild (.-parentNode el) (.cloneNode el true) el))
-  ; (if el
-    ; (.replaceChild (.-parentNode el) (.cloneNode el true) el))
-    ; ())
-
-
-(reload-element (get-text-el))
-(reload-element (get-slider-el))
-(reload-element (get-checkbox-el))
+  "make element reloadable"
+  [el listener-bind]
+  (let [new-el (.cloneNode el true)]
+    (.replaceChild (.-parentNode el) new-el el)
+    (listener-bind new-el) ))

 (defn char-keypress? [e]
   ; (.log js/console e)
@@ -51,9 +46,15 @@
     (not (contains? #{37 38 39 40} (.-keyCode e))) )) ;; arrows

-(.addEventListener (get-text-el) "keyup" (utils/call-if char-keypress? notify-model))
-(.addEventListener (.-parentNode (get-slider-el)) "mouseup" notify-model)
-(.addEventListener (get-checkbox-el) "change" notify-model)
+(if-let [el (get-text-el)]
+  (reload-element el
+    #(.addEventListener % "keyup" (utils/call-if char-keypress? notify-model))) )
+(if-let [el (get-slider-el)]
+  (reload-element el
+    #(.addEventListener (.-parentNode %) "mouseup" notify-model)) )
+(if-let [el (get-checkbox-el)]
+  (reload-element el
+    #(.addEventListener % "change" notify-model)) )

 ;;;;
@@ -80,7 +81,7 @@
                   (= word-id (dec word-count)) (- max-width (count res) (count word) (count (last words)))
                   (zero? (mod word-id extra-space-every-X-words)) (inc spaces-per-break-i) ; add one more space the usual
                   :else spaces-per-break-i)
-              spaces (apply str (repeat space-count space-char))]
+              spaces (apply str (repeat space-count SPACE-CHAR))]
              ; (println word "(" (= word-id (dec word-count)) "):" max-width "-" (count res) "-" (count word))
             [(inc word-id) (str res word spaces)]))
         [1 ""]
@@ -109,8 +110,8 @@

 ;; place react component
-(reagent/render-component [text-justified-component]
-                          (. js/document (getElementById "justified-text")))
+(if-let [el (get-result-view-el)]
+  (reagent/render-component [text-justified-component] el))

 ; (defn on-js-reload []
@@ -122,4 +123,3 @@
 ;; (model/text-justification "halo !\nLorem" false 25 )
 ;; (model/text-justification "11111222223333344444555556666677777888889999900" false 25 )
 (model/text-justification "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam cursus ornare nunc eu tincidunt." false 25 )
-)


Change the jetty call to use the secured app

--- src/todo_repl_webapp/handler.clj
+++ src/todo_repl_webapp/handler.clj
@@ -67,5 +67,5 @@

 (defn -main [port]
   (jetty/run-jetty
-    (handler/site app-routes)
+    secured-app
     {:port (Integer. port) :join? false}))


AW | 344 | fixed sign in helper text translation bug

--- src/objective8/front_end/templates/sign_in.clj
+++ src/objective8/front_end/templates/sign_in.clj
@@ -26,11 +26,12 @@
 (defn set-helper-text-translation! []
   (cond
     (and (twitter-credentials-present?)
-         (facebook-credentials-present?)) (html/set-attr "data-l8n" "content:sign-in/twitter-and-facebook-helper-text")
-    (facebook-credentials-present?) (html/set-attr "data-l8n" "content:sign-in/facebook-helper-text")
-    (twitter-credentials-present?) (html/set-attr "data-l8n" "content:sign-in/twitter-helper-text")))
+         (facebook-credentials-present?)) (do (prn "twitter and facebook")
+                                              (html/set-attr :data-l8n "content:sign-in/twitter-and-facebook-helper-text"))
+    (facebook-credentials-present?) (html/set-attr :data-l8n "content:sign-in/facebook-helper-text")
+    (twitter-credentials-present?) (html/set-attr :data-l8n "content:sign-in/twitter-helper-text")))

-(defn sign-in-page [{:keys [data doc] :as context}]
+(defn sign-in-page [{:keys [doc] :as context}]
   (html/at sign-in-template
            [(and (html/has :meta) (html/attr= :name "description"))] (html/set-attr "content" (:description doc))
            [:.clj-masthead-signed-out] (html/substitute (f/masthead context))


RS + AB | #144 | Add some print statements to debug twitter problems

--- src/objective8/front_end/workflows/twitter.clj
+++ src/objective8/front_end/workflows/twitter.clj
@@ -26,8 +26,11 @@
   (try
     (let [consumer (:consumer twitter-config)
           callback-url (:callback-url twitter-config)
+          _ (prn "Before oauth/request-token")
           request-token-response (oauth/request-token consumer callback-url)
-          approval-uri (oauth/user-approval-uri consumer (:oauth_token request-token-response))]
+          _ (prn "After oauth/request-token")
+          approval-uri (oauth/user-approval-uri consumer (:oauth_token request-token-response))
+          _ (prn "Approval uri:" approval-uri)]
       (response/redirect approval-uri))
     (catch clojure.lang.ExceptionInfo e
       (do (log/warn (str "Could not get request token from twitter: " e))
@@ -36,9 +39,11 @@
 (defn twitter-callback [{:keys [params session twitter-config] :as request}]
   (try
     (let [consumer (:consumer twitter-config)
+          _ (prn "Before oauth/acces-token")
           twitter-response (oauth/access-token consumer
                                                params
                                                (:oauth_verifier params))
+          _ (prn "After oauth/acces-token")
           twitter-user-id (str "twitter-" (:user_id twitter-response))
           twitter-screen-name (:screen_name twitter-response)
           the-response (into (response/redirect (str utils/host-url "/sign-up"))


all-on

all-on

--- src/launchpad/core.clj
+++ src/launchpad/core.clj
@@ -22,3 +22,7 @@
   (light m x y 0))

 (defn reset [m] (midi-control m 0 0))
+
+  (defn all-on "brightness is 1, 2 or 3"
+    [m brightness]
+    (midi-control m 0 (+ 124 brightness)))


Fix broken loop recur

Fix broken loop recur

--- src/lazubot/worker.clj
+++ src/lazubot/worker.clj
@@ -11,6 +11,7 @@
     (register-socket! {:in reply-in :out reply-out :socket-type :rep
                        :configurator (fn [socket] (.bind socket addr))})
     (println "Worker initialized")
-    (when-let [message (String. (<!! reply-out))]
-      (>!! reply-in message)
-      (recur))))
+    (loop []
+      (when-let [message (String. (<!! reply-out))]
+        (>!! reply-in message)
+        (recur)))))


Consolidate date formatting logic.

Consolidate date formatting logic.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -72,17 +72,17 @@

 (def timestamp-fmt "yyyyMMdd_HHmmss")

+(defn gmt-date-formatter [^String fmt]
+  (doto (java.text.SimpleDateFormat. fmt java.util.Locale/US)
+    (.setTimeZone (java.util.SimpleTimeZone. 0 "GMT"))))
+
 (defn formatted-timestamp
   [^String fmt t]
-  (.format (doto (java.text.SimpleDateFormat. fmt java.util.Locale/US)
-             (.setTimeZone (java.util.SimpleTimeZone. 0 "GMT")))
-           t))
+  (.format (gmt-date-formatter fmt) t))

 (defn parse-formatted-timestamp
   [^String fmt ^String ts]
-  (.parse (doto (java.text.SimpleDateFormat. fmt java.util.Locale/US)
-             (.setTimeZone (java.util.SimpleTimeZone. 0 "GMT")))
-           ts))
+  (.parse (gmt-date-formatter fmt) ts))

 (defn get-voom-version
   [path & {:keys [long-sha? gitdir]}]


delaney.clj: added an (invariant) function in pure Clojure

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -92,9 +92,26 @@
                        emap (if new? (assoc emap D n) emap)
                        n (if new? (inc n) n)
                        head (if (= i :root) [-1] [(imap i) (emap (s ds i D))])
-                       tail (if new? (map (fn [[i j]] (m ds i j D)) ipairs) [])]
+                       tail (if new? (map (fn [[i j]] (v ds i j D)) ipairs) [])]
                    (concat head [E] tail (step xs emap n)))))]
     (step traversal {} 1)))
+
+(defn invariant [ds]
+  (when (seq (elements ds))
+    (let [idcs (indices ds)
+          cmp-seq (fn [s1 s2]
+                    (cond (empty? s1)
+                          -1
+                          (empty? s2)
+                          1
+                          (= 0 (compare (first s1) (first s2)))
+                          (recur (rest s1) (rest s2))
+                          :else
+                          (compare (first s1) (first s2))))
+          min-seq (fn [[x & xs]]
+                    (reduce #(if (> 0 (cmp-seq %1 %2)) %1 %2) x xs))]
+      (min-seq (for [D (elements ds)]
+                 (protocol ds idcs (pretty-traversal ds idcs [D])))))))

 (defn orbit-reps
   ([ds indices seeds]
@@ -369,9 +386,6 @@
 (defn minimal? [ds]
   (-> ds java-dsymbol .isMinimal))

-(defn invariant [ds]
-  (into [] (.invariant (java-dsymbol ds))))
-
 (defn automorphisms [ds]
   (for [m (-> ds java-dsymbol DSMorphism/automorphisms)]
     (into {} (for [D (elements ds)] [D (.get m (Integer. D))]))))


Use Drag n Drop to assign new reference

Use Drag n Drop to assign new reference

--- src/discuss/clipboard.cljs
+++ src/discuss/clipboard.cljs
@@ -2,6 +2,8 @@
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [discuss.lib :as lib]))
+
+(def counter (atom 0))

 (defn get-stored-selections
   "Return all stored selections."
@@ -34,8 +36,7 @@

 (defn drag-event [ev]
   (let [target (.. ev -target)]
-    (lib/update-state-item! :clipboard :current (fn [_] target)))
-  (.setData ev.dataTransfer "text" (.. ev -target -id)))
+    (lib/update-state-item! :clipboard :current (fn [_] target))))

 (defn drop-event [ev]
   (.preventDefault ev)
@@ -44,19 +45,16 @@
 (defn item-view [data owner]
   (reify om/IRender
     (render [_]
-      (dom/div #js {:className   "bs-callout bs-callout-info"
-                    :data-id     100
+      (dom/div #js {:react-key   (swap! counter inc)
+                    :className   "bs-callout bs-callout-info"
                     :draggable   true
                     :onDragStart drag-event}
                data))))
+

 (defn view [data owner]
   (reify om/IRender
     (render [_]
       (dom/div nil
-               (dom/div #js {:className  "panel panel-body"
-                             :onDragOver allow-drop
-                             :onDrop     drop-event}
-                        (lib/get-selection))
                (dom/h5 nil "Clipboard")
-               (om/build-all item-view (get-stored-selections) {:key (rand-int 1000)})))))+               (om/build-all item-view (get-stored-selections))))))


bind midi devices as func

bind midi devices as func

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -121,20 +121,24 @@
 ;(def hue-param (params/build-oscillated-param
 ;                 (oscillators/sawtooth-bar) :max 360))

-(show/add-midi-control-to-var-mapping
-  "Traktor Kontrol Z1 Input" 0 4 :knob-1 :max 360)
+(defn bind-midi
+  "Bind MIDI devices"
+  []
+  (show/add-midi-control-to-var-mapping
+    "Traktor Kontrol Z1 Input" 0 4 :knob-1 :max 360)

-(show/add-midi-control-to-var-mapping
-  "midi-net" 0 1 :audio-drums :max 30)
+  (show/add-midi-control-to-var-mapping
+    "midi-net" 0 1 :audio-drums :max 30)

-(show/add-midi-control-to-var-mapping
-  "midi-net" 0 2 :audio-bass :max 30)
+  (show/add-midi-control-to-var-mapping
+    "midi-net" 0 2 :audio-bass :max 30)

-(show/add-midi-control-to-var-mapping
-  "midi-net" 0 3 :audio-percussion :min 10 :max 30)
+  (show/add-midi-control-to-var-mapping
+    "midi-net" 0 3 :audio-percussion :min 10 :max 30)

-(show/add-midi-control-to-var-mapping
-  "midi-net" 0 5 :audio-solo :max 30)
+  (show/add-midi-control-to-var-mapping
+    "midi-net" 0 5 :audio-solo :max 30)
+)

 (def light-param (params/build-oscillated-param
                  (oscillators/triangle-beat :beat-ratio 4) :max 20))


More cosmetics.

More cosmetics.

--- src/eventframework/app.clj
+++ src/eventframework/app.clj
@@ -11,7 +11,7 @@
     lamina.core
     cheshire.core))

-(defn getevents [user position]
+(defn get-events [user position]
   (if (not (valid-position? position))
     (cheshire.core/generate-string {:goaway true})
     (let [ch (lamina.core/channel)]
@@ -31,7 +31,7 @@
   (GET "/events/:user/:position" [user position]
        {:status  200
         :headers {"content-type" "application/json"}
-        :body    (getevents user position)})
+        :body    (get-events user position)})

   (PUT "/command/:type/:id"
        {route-params :route-params
@@ -40,7 +40,7 @@
        (let [{type :type id :id} route-params]
          (put-command! id
                       {:type        (keyword type)
-                       :id           id
+                       :id          id
                        :remote-addr remote-addr
                        :body        (zipmap (map keyword
                                                  (keys form-params))


some cleanup

some cleanup

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -57,7 +57,7 @@
       (dom/div #js {:id "messages-window"}
         ))))

-(defn upload-view [data owner]
+(defn hashing-progress-view [data owner]
   (reify
     om/IRender
     (render [this]
@@ -73,6 +73,15 @@
           " "
           hashing-percent-completion
           "%")))))
+
+(defn upload-view [data owner]
+  (reify
+    om/IRender
+    (render [this]
+      (let [info (second data)]
+        (cond
+          (= :hash (:type info))
+            (om/build hashing-progress-view data))))))

 (defn track-queue-view [data owner]
   (reify


fixed typo

fixed typo

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -160,7 +160,7 @@
       (dommy/listen! (sel1 :#chat-input) :keydown (om/get-state owner :enter-key-handler)))
     om/IWillUnmount
     (will-unmount [_]
-      (dommy/unlisten! (sel1 :#chat-input) :k:ydown (om/get-state owner :enter-key-handler)))
+      (dommy/unlisten! (sel1 :#chat-input) :keydown (om/get-state owner :enter-key-handler)))
     om/IRender
     (render [_]
       (dom/textarea #js {:id "chat-input"} nil))))


no-doc deprecated function

no-doc deprecated function

--- src/such/function_makers.clj
+++ src/such/function_makers.clj
@@ -183,7 +183,7 @@
   (println "any-pred has been deprecated in favor of pred:any?")
   (apply pred:any? args))

-(defn wrap-pred-with-catcher [& args]
+(defn ^:no-doc wrap-pred-with-catcher [& args]
   (println "any pred has been deprecated in favor of pred:exception->false")
   (apply pred:exception->false args))


NB: Fix `with-conn` error throwing

NB: Fix `with-conn` error throwing

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -38,15 +38,15 @@

   Use `make-conn-pool` and `make-conn-spec` to generate the required arguments."
   [connection-pool connection-spec & body]
-  `(try
-     (let [pool# (or ~connection-pool conns/non-pooled-connection-pool)
-           spec# (or ~connection-spec (make-conn-spec))
-           conn# (conns/get-conn pool# spec#)]
-       (try
-         (let [response# (protocol/with-context conn# ~@body)]
-           (conns/release-conn pool# conn#) response#)
-         (catch Exception e# (conns/release-conn pool# conn# e#) (throw e#))))
-     (catch Exception e# (throw (Exception. "Carmine connection error")))))
+  `(let [pool# (or ~connection-pool conns/non-pooled-connection-pool)
+         spec# (or ~connection-spec (make-conn-spec))
+         conn# (try (conns/get-conn pool# spec#)
+                    (catch Exception e#
+                      (throw (Exception. "Carmine connection error"))))]
+     (try
+       (let [response# (protocol/with-context conn# ~@body)]
+         (conns/release-conn pool# conn#) response#)
+       (catch Exception e# (conns/release-conn pool# conn# e#) (throw e#)))))

 ;;;; Misc


fix build-sift, keep-config

fix build-sift, keep-config

Signed-off-by: Gregg Reynolds <d0f77bc71a9867acdcb4f62f012b858edad79160@norc.org>

--- src/migae/boot_gae.clj
+++ src/migae/boot_gae.clj
@@ -550,9 +550,14 @@
                             (boot/add-asset workspace :exclude #{(re-pattern (str "/META-INF/.*"))})
                             (boot/commit!)))))))

-(boot/deftask build-sift
+(boot/deftask keep-config
+  "Retain master config file"
   []
-  ;; [u unit-test bool "sift for unit-test config"]
+  (builtin/sift :to-resource #{(re-pattern (str ".*" boot-config-edn))}))
+
+(boot/deftask clj
+  "Move *.clj and *.class files WEB-INF/classes for output to target"
+  []
   (fn middleware [next-handler]
     (fn handler [fileset]
       (let [;; module (if unit-test "default" (get-module-name fileset false))
@@ -563,11 +568,6 @@
                                )
             target-handler (target-middleware next-handler)]
         (target-handler fileset)))))
-
-(boot/deftask keep-config
-  "Retain master config file"
-  []
-  (builtin/sift :to-resource #{(re-pattern (str ".*" boot-config-edn))}))

 (boot/deftask build
   "Configure and build servlet or service app"
@@ -588,9 +588,9 @@
           (logging :verbose verbose)
           (webxml :verbose verbose)
           (appengine :verbose verbose)
-          (build-sift)
-          (if keep identity (keep-config))
-          (builtin/target)
+          (if keep (keep-config) identity)
+          (clj)
+          ;; (builtin/target)
           ;; (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
           ;; (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
           ;; (if servlet


clean up parser for unused kind

clean up parser for unused kind

--- src/graphql_clj/parser.clj
+++ src/graphql_clj/parser.clj
@@ -58,7 +58,7 @@
                                identity]

    :type-definition           ["<'type'> <ignored> ident ( <ignored> implements )? <ignored>? type-fields"
-                               (fn [ident & decls] (apply merge {:tag :type-definition :name ident :kind :OBJECT} decls))]
+                               (fn [ident & decls] (apply merge {:tag :type-definition :name ident} decls))]

    :implements                ["<'implements'> ( <ignored> basic-type-no-req )+" (fn [ & types ] {:implements types})]

@@ -68,22 +68,22 @@
                                #(with-meta (assoc % :tag :extend-type-definition) nil)]

    :interface-definition      ["<'interface'> <ignored> ident <ignored>? type-fields"
-                               #(merge {:tag :interface-definition :name %1 :kind :INTERFACE} %2)]
+                               #(merge {:tag :interface-definition :name %1} %2)]

    :input-definition          ["<'input'> <ignored> ident <ignored>? type-fields"
-                               #(mmerg {:tag :input-definition :name %1 :kind :INPUT_OBJECT} %2)]
+                               #(mmerg {:tag :input-definition :name %1} %2)]

    ;; members are coearsed to match the result of basic-type but
    ;; without the required.
    :union-definition          ["<'union'> <ignored> ident <ignored>? <'='> <ignored>? basic-type-no-req ( <ignored>? <'|'> <ignored>? basic-type-no-req )*"
                                (fn [ident & members]
-                                 {:tag :union-definition :name ident :kind :UNION :members (vec members)})]
+                                 {:tag :union-definition :name ident :members (vec members)})]

    :schema-definition         ["<'schema'> <ignored>? <'{'> <ignored>? ( schema-type <ignored>? )* <'}'>"
                                (fn [ & members ] {:tag :schema-definition :members (vec members)})]

    :enum-definition           ["<'enum'> <ignored> ident <ignored>? <'{'> <ignored>? ( enum-constant <ignored>? )* <'}'>"
-                               (fn [ ident & constants ] {:tag :enum-definition :name ident :kind :ENUM :constants (vec constants) })]
+                               (fn [ ident & constants ] {:tag :enum-definition :name ident :constants (vec constants) })]

    :enum-constant             ["ident ( <ignored>? directives )?"
                                (fn enum-constant


tuple goes directly into array.

tuple goes directly into array.

--- test/elephantdb/cascading/integration_test.clj
+++ test/elephantdb/cascading/integration_test.clj
@@ -145,11 +145,11 @@
   optional JobConf instance, supplied with the :conf keyword argument)
   and sinks all key-value pairs into the tap. Returns the original tap
   instance.."
-  [kv-tap kv-pairs]
+  [kv-tap tuples]
   (with-open [collector (-> (HadoopFlowProcess. (job-conf))
                             (.openTapForWrite kv-tap))]
-    (doseq [[k v] kv-pairs]
-      (.add collector (Tuple. (into-array Object [k v])))))
+    (doseq [tuple tuples]
+      (.add collector (Tuple. (into-array Object tuple)))))
   kv-tap)

 (defn populate-edb!
@@ -186,7 +186,7 @@
   (let [opt-map   (apply hash-map opts)
         log-level (:log-level opt-map :off)
         conf      (:conf opt-map *default-conf*)]
-    `(binding [*default-conf* (or ~conf)]
+    `(binding [*default-conf* (or ~conf {})]
        (log/with-log-level ~log-level
          (test/with-fs-tmp [fs# tmp#]
            (let [~sym (elephant-tap tmp# ~shard-count ~@opts)]


add test describing the intended :only/:exclude behaviour.

--- test/leiningen/ancient/artifact/check_test.clj
+++ test/leiningen/ancient/artifact/check_test.clj
@@ -33,6 +33,27 @@
      :check-clojure? true
      :profiles? false}                     '[group/artifact group/plugin org.clojure/clojure]))

+(let [data '{:dependencies [[snapshot "0-SNAPSHOT"]
+                            [qualified "0-alpha"]
+                            [release "0"]]
+             :plugins [[snapshot-plugin "0-SNAPSHOT"]
+                       [qualified-plugin "0-alpha"]
+                       [plugin "0"]]}]
+  (tabular
+    (fact "about selective artifact collection."
+          (let [opts (o/options ?opts)
+                artifacts (collect-artifacts opts data)]
+            (set (map (comp :symbol :artifact) artifacts)) => (set ?artifacts)))
+    ?opts                              ?artifacts
+    {:only [:qualified]}               '[qualified qualified-plugin]
+    {:only [:dependencies :qualified]} '[qualified]
+    {:only [:plugins :qualified]}      '[qualified-plugin]
+    {:exclude [:qualified]}            '[snapshot release snapshot-plugin plugin]
+    {:only [:dependencies]
+     :exclude [:qualified]}            '[snapshot release]
+    {:only [:snapshots]}               '[snapshot snapshot-plugin]
+    {:exclude [:snapshots]}            '[qualified release qualified-plugin plugin]))
+
 (let [artifact (read-artifact [:path] '[artifact "0.1.0" :exclusions []])
       const-opts #(o/options
                     {:repositories


Formatting fix

Formatting fix

Signed-off-by: Njagi Mwaniki <b6a4ba60ad861b9c9afb6daea7294be4be68f44c@urbanslug.com>

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -317,7 +317,7 @@
     om/IRenderState
     (render-state [_ {:keys [name-or-label language]}]
       (let [options {:label [:strong "Label"]
-                     :name [:strong "Name"]}
+                     :name  [:strong "Name"]}
             {:keys [flat-form]} (om/get-shared owner)
             new-language (:current (om/observe owner (shared/language-cursor)))
             colset! #(put! shared/event-chan
@@ -464,8 +464,7 @@
               [:div.slickgrid {:id table-id}
                (if (and no-data? (zero? num_of_submissions))
                  [:p.alert.alert-warning "No data"]
-                 [:span
-                  [:i.fa.fa-spinner.fa-pulse] "Loading..."])]]))))
+                 [:span [:i.fa.fa-spinner.fa-pulse] "Loading..."])]]))))
       om/IDidMount
       (did-mount [_]
         (when active?


Save stats as pretty-printed data.

Save stats as pretty-printed data.

This makes reating diffs easier as well as visual examination of data files
easier.

--- src/hxgm30/language/io.clj
+++ src/hxgm30/language/io.clj
@@ -2,6 +2,7 @@
   (:require
     [clojure.edn :as edn]
     [clojure.java.io :as io]
+    [clojure.pprint :as pprint]
     [clojure.string :as string]))

 (defn load-lines
@@ -27,7 +28,7 @@

 (defn dump
   [fullpath data]
-  (spit fullpath data))
+  (spit fullpath (with-out-str (pprint/pprint data))))

 (defn undump
   [fullpath]


Add missing imports on media impl.

Add missing imports on media impl.

--- src/uxbox/media/impl.clj
+++ src/uxbox/media/impl.clj
@@ -12,6 +12,8 @@
   (:import java.io.File
            java.io.ByteArrayInputStream
            java.io.InputStream
+           java.net.URL
+           java.net.URI
            java.nio.file.Path
            java.nio.file.Paths
            java.nio.file.Files


fix netTime

fix netTime

--- src/jx/reporter/karma.cljs
+++ src/jx/reporter/karma.cljs
@@ -24,6 +24,7 @@
 (defmethod cljs.test/report :karma [m])

 (defmethod cljs.test/report [::karma :begin-test-var] [m]
+  (vreset! test-var-time-start (now))
   (vreset! test-var-result []))

 (defmethod cljs.test/report [::karma :end-test-var] [m]


More logging, less ellipsis.

More logging, less ellipsis.

--- src/leiningen/protobuf.clj
+++ src/leiningen/protobuf.clj
@@ -77,9 +77,11 @@
   (let [target (:target-dir project)]
     (when-not (.exists (io/file target srcdir))
       (let [zipped (io/file target zipfile)]
+        (println "Downloading" zipfile)
         (with-open [stream (.openStream url)]
           (io/copy stream (io/file zipped)))
-        (unzip (io/file zipped) (:target-dir project))))))
+        (println "Unzipping" zipfile "to" target)
+        (unzip (io/file zipped) target)))))

 (defn uninstall
   "Remove protoc if it is installed."
@@ -99,13 +101,13 @@
       (when-not (.exists (io/file source "src" "protoc"))
         (.setExecutable (io/file source "configure") true)
         (.setExecutable (io/file source "install-sh") true)
-        (println "Configuring protoc...")
+        (println "Configuring protoc")
         (sh "./configure" :dir source)
-        (println "Running 'make'...")
+        (println "Running 'make'")
         (sh "make" :dir source))
+      (println "Installing")
       (let [password (str (read-pass) "\n")
             opts     {:dir source :input-string (str password "\n")}]
-        (println "Installing...")
         (if (= :linux (get-os))
           (sh "script" "-q" "-c" "sudo -S make install" "/dev/null"
               :dir source :in password)