add some basic rendering tests for the home page

--- test/gh_waiting_room/service_test.clj
+++ test/gh_waiting_room/service_test.clj
@@ -7,12 +7,29 @@
 (def service
   (::bootstrap/service-fn (bootstrap/create-servlet service/service)))

+(defn- body-of-home-page
+  []
+  (with-redefs [gh-waiting-room.github/viewable-issues
+                (constantly [{:position "1"
+                              :id "cldwalker/gh-waiting-room#1"
+                              :url "https://github.com/cldwalker/gh-waiting-room/issues/1"}])
+                gh-waiting-room.config/gh-user (constantly "Hal")]
+    (:body (response-for service :get "/"))))
+
 (deftest home-page-test
-  (is (=
-       (:body (response-for service :get "/"))
-       "Hello World!")))
-
-(deftest about-page-test
   (is (.contains
-       (:body (response-for service :get "/about"))
-       "Clojure 1.5")))
+       (body-of-home-page)
+       "
Hal's Github Waiting Room
")
+      "Owner of issues is clearly shown.")
+  (is (.contains
+       (body-of-home-page)
+       "href=\"https://github.com/cldwalker/gh-waiting-room/issues/1\"")
+      "Issues link back to their origin.")
+  (is (.contains
+       (body-of-home-page)
+       "id=\"issue_1\"")
+      "Issues can be referenced by position.")
+  (is (.contains
+       (body-of-home-page)
+       "id=\"cldwalker/gh-waiting-room#1\" href=\"#cldwalker/gh-waiting-room#1\"")
+      "Issues can be referenced by their unique id and users know of it."))


docstr for IDatasetLoader

docstr for IDatasetLoader

--- test/metabase/test/data/interface.clj
+++ test/metabase/test/data/interface.clj
@@ -26,6 +26,7 @@
 ;; ## IDatasetLoader

 (defprotocol IDatasetLoader
+  "Methods for creating, deleting, and populating *pyhsical* DBMS databases, tables, and fields."
   (engine [this]
     "Return the engine keyword associated with this database, e.g. `:h2` or `:mongo`.")


shange to select examples

shange to select examples


Use the proper Cljs exception as cause

Use the proper Cljs exception as cause

--- src/adzerk/boot_cljs/impl.clj
+++ src/adzerk/boot_cljs/impl.clj
@@ -66,7 +66,7 @@
             (cond->
               path (assoc :file path)
               (and cljs-error?) (assoc :boot.util/omit-stacktrace? true)))
-        (.getCause e)))))
+        e))))

 (defn compile-cljs
   "Given a seq of directories containing CLJS source files and compiler options


env must be a keyword

env must be a keyword

--- src/celestial/persistency.clj
+++ src/celestial/persistency.clj
@@ -49,11 +49,13 @@

 (def user-v
   {:username #{:required :String} :password #{:required :String}
-   :roles #{:required :role*} :envs #{:required :Vector}})
+   :roles #{:required :role*} :envs #{:required :env*}})

 (validation :role (when-not-nil roles (<< "role must be either ~{roles}")))

 (validation :role* (every-v #{:role}))
+
+(validation :env* (every-v #{:Keyword}))

 (defn validate-user [user]
   (validate! user user-v :error ::non-valid-user))


clean code and add TODO

clean code and add TODO

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/clj/brains_brain/core.clj
+++ src/clj/brains_brain/core.clj
@@ -2,8 +2,8 @@
   (:require [seesaw.core :refer :all]
             [seesaw.graphics :refer [draw rect style]]
             [seesaw.border :refer [line-border]]
-            [clojure.string :as str]
-            )
+            [clojure.string :as str])
+  (:use [clojure.pprint])
   (:gen-class))

 (native!)
@@ -23,6 +23,7 @@

 (println (str "size: " size))

+;; TODO: this function need a little modify to run on cljs
 (defn make-board
   []
   (let [board (make-array Integer/TYPE board-size board-size)]
@@ -31,8 +32,6 @@
       (aset-int board x y (if (< (rand-int 100) 50) 0 1))
       )
     board))
-(use 'clojure.pprint)
-

 (def a (make-board))


fix retrieve table/view metadata

fix retrieve table/view metadata

--- src/clj/dbquery/databases.clj
+++ src/clj/dbquery/databases.clj
@@ -219,12 +219,12 @@
                               "DATA_TYPE" "TYPE_NAME"
                               ["COLUMN_SIZE" :size] "NULLABLE"] :limit Integer/MAX_VALUE})))

-(defn- table-pks [meta table]
-  (with-open [rs (.getPrimaryKeys meta nil nil table)]
+(defn- table-pks [meta schema table]
+  (with-open [rs (.getPrimaryKeys meta nil schema table)]
     (read-as-map rs {:fields [["COLUMN_NAME" :name] "KEY_SEQ"]})))

-(defn- table-fks [meta table]
-  (with-open [rs (.getImportedKeys meta nil nil table)]
+(defn- table-fks [meta schema table]
+  (with-open [rs (.getImportedKeys meta nil schema table)]
     (read-as-map rs {:fields ["PKTABLE_NAME" "PKCOLUMN_NAME"
                               "FKCOLUMN_NAME" "KEY_SEQ"
                               "FK_NAME" "PK_NAME"]})))
@@ -241,9 +241,9 @@
 (defn table-cols [ds name]
   "retrieves the columns of the given table"
   (with-db-metadata [meta ds]
-    (let [cols  (future (table-columns meta nil name))
-          pks (future (table-pks meta name))
-          fks (future (table-fks meta name))]
+    (let [cols  (future (table-columns meta (:schema ds) name))
+          pks (future (table-pks meta (:schema ds) name))
+          fks (future (table-fks meta (:schema ds) name))]
       (merge-col-keys @cols @pks @fks))))

 (defn db-meta [ds]


fix findfall

fix findfall

fixes #1497

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -810,14 +810,15 @@
                                                 (trash-cards state :corp (take n (shuffle (:hand corp)))))))}} card))}

    "Windfall"
-   {:effect (req (shuffle! state :runner :deck)
-                 (let [topcard (first (:deck runner))
-                       cost (:cost topcard)]
-                   (if (is-type? topcard "Event")
-                     (do (trash state side topcard)
-                         (system-msg state side (str "shuffles their Stack and trashes "
-                          (:title topcard) " to gain 0 [Credits]")))
-                     (do (gain state side :credit cost)
-                         (trash state side topcard)
-                         (system-msg state side (str "shuffles their Stack and trashes "
-                          (:title topcard) " to gain " cost " [Credits]"))))))}})
+   {:effect (effect (shuffle! :deck)
+                    (resolve-ability
+                      {:effect (req (let [topcard (first (:deck runner))
+                                          cost (:cost topcard)]
+                                      (trash state side topcard)
+                                      (when-not (is-type? topcard "Event")
+                                        (gain state side :credit cost))
+                                      (system-msg state side
+                                                  (str "shuffles their Stack and trashes " (:title topcard)
+                                                       (when-not (is-type? topcard "Event")
+                                                         (str " to gain " cost " [Credits]"))))))}
+                     card nil))}})


fix Forged Activation Orders to account for rez cost bonuses

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -200,7 +200,7 @@
                      state :corp
                      {:prompt (msg "Rez " (:title ice) " or trash it?") :choices ["Rez" "Trash"]
                       :effect (effect (resolve-ability
-                                        (if (and (= target "Rez") (<= (:cost ice) (:credit corp)))
+                                        (if (and (= target "Rez") (<= (rez-cost state :corp ice) (:credit corp)))
                                           {:msg (msg "force the rez of " (:title ice))
                                            :effect (effect (rez :corp ice))}
                                           {:msg "trash the ICE" :effect (effect (trash :corp ice))})


Update Hello World Message

Update Hello World Message

--- src/cljs/babelfeesh/core.cljs
+++ src/cljs/babelfeesh/core.cljs
@@ -4,7 +4,7 @@

 (enable-console-print!)

-(defonce app-state (atom {:text "Hello Chestnut!"}))
+(defonce app-state (atom {:text "Hello Babelfeesh!"}))

 (defn main []
   (om/root


Fixed up POST request

Fixed up POST request

--- src/cljs/cljweb/gen_prob.cljs
+++ src/cljs/cljweb/gen_prob.cljs
@@ -73,5 +73,6 @@
         (POST "/time"
           {:params {:q-time millis-diff}
            :handler answer-handler
-           :format :json}))
+           :format :json
+           :response-format :json}))
       (println "Wrong answer!"))))


Add direction arrow pad support to controls

--- src/cljs/engine/entities.cljs
+++ src/cljs/engine/entities.cljs
@@ -10,10 +10,7 @@

 (defrecord Bunny [id sprite x y]
   Entity
-  (tick [this]
-    (let [sprite (:sprite this)
-          old-rotation (aget sprite "rotation")]
-      (aset sprite "rotation" (+ 0.01 old-rotation))))
+  (tick [this] nil)

   Renderable
   (render [this stage]
@@ -22,7 +19,6 @@
   Controllable
   (react-to-user-input [this state time]
     (let [sprite (:sprite this)
-          control-keys #{:W :A :S :D}
           input @(:input state)
           move-rate 1
           move #(condp = %
@@ -34,7 +30,17 @@
                                (+ (.-position.y sprite) move-rate))
                       :D (set! (.-position.x sprite)
                                (+ (.-position.x sprite) move-rate))
-                      :else nil)]
+                      :& (set! (.-position.y sprite)
+                               (- (.-position.y sprite) move-rate))
+                      :% (set! (.-position.x sprite)
+                               (- (.-position.x sprite) move-rate))
+                      ;; Parenths are reserved so wrap it in keyword call
+                      (keyword "(") (set! (.-position.y sprite)
+                                            (+ (.-position.y sprite) move-rate))
+                      :' (set! (.-position.x sprite)
+                               (+ (.-position.x sprite) move-rate))
+                      ;; Otherwise do nothing
+                      nil)]
       (doseq [[k v] input]
         (when (= v "on")
           (move k))))))


Remove stupid timeout from submit page. After submission switch to events page

--- src/cljs/my_money/submit.cljs
+++ src/cljs/my_money/submit.cljs
@@ -1,13 +1,14 @@
 (ns my-money.submit
     (:require [reagent.core :as r]
-              [ajax.core :refer [GET POST]]))
+              [ajax.core :refer [GET POST]]
+              [secretary.core :as secretary]))

 (def username (r/atom nil))

-(def response-data (r/atom nil))
+(defn upload-response-handler [response]
+  (js/console.log (str "response handler" response))
+  (secretary/dispatch! "/events"))

-(defn upload-response-handler [response]
-    (reset! response-data response))

 (defn upload []
   (let [file-input (.getElementById js/document "file-input")
@@ -17,8 +18,7 @@
                     (.append "file" file file-name)
                     (.append "username" @username))]
     (POST "/upload" {:body form-data
-                     :handler upload-response-handler
-                     :timeout 100})))
+                     :handler upload-response-handler})))

 (defn submit-page []
   [:div.container


Update placeholder text

Update placeholder text

--- src/cljs/retroboard/user.cljs
+++ src/cljs/retroboard/user.cljs
@@ -72,7 +72,7 @@
       (dom/div #js {:id "login-signup"}
                (dom/form #js {:id "login"
                               :style (display (= screen :login))}
-                         (input owner :email "Your email")
+                         (input owner :email "Your username or email")
                          (input owner :password "Your password" "password")
                          (dom/button
                           #js {:onClick (fn [e]
@@ -86,7 +86,7 @@
                                 "or sign up"))
                (dom/form #js {:id "signup"
                               :style (display (= screen :signup))}
-                         (input owner :username "Chooe a username")
+                         (input owner :username "Choose a username")
                          (input owner :email "Your email")
                          (input owner :password "Choose a password" "password")
                          (dom/button


Only one video packer

Only one video packer

--- src/cljs/sbsk/views/body.cljs
+++ src/cljs/sbsk/views/body.cljs
@@ -264,8 +264,7 @@

 (defn lower-body
   [search-results? search-term videos]
-  (let [videos-by-month (when-not search-results?
-                          (videos-by-month videos))]
+  (let [videos-to-show videos]
     [:div#search-results.lower-body
      [re-com/v-box
       :class "lower"
@@ -289,30 +288,20 @@
                                       :label (if search-results?
                                                (str "Search Results for '" search-term "'")
                                                "All Videos")]]]]
-                 (if search-results?
-                   [:div.pure-g
-                    [:div
-                     {:style {:width "100%"}}
-                     [video-packed-display search-term videos]]]
-                   [:div.pure-g
-                    (for [month (keys videos-by-month)]
-                      ^{:key month}
-                      [:div
-                       {:style {:width "100%"}}
-                       [re-com/title
-                        :level :level3
-                        :label month]
-                       [video-packed-display nil (get videos-by-month month)]])
-                    [re-com/h-box
-                     :class "load-more"
-                     :justify :center
-                     :width "100%"
-                     :children [(if true #_@loading-more?
-                                    #_[re-com/throbber
-                                       :size :small]
-                                    [re-com/button
-                                     :label "Load More"
-                                     :on-click #(re-frame/dispatch [:load-more-videos])])]]])]]]))
+                 [:div.pure-g
+                  [:div
+                   {:style {:width "100%"}}
+                   [video-packed-display search-term videos]]]
+                 [re-com/h-box
+                  :class "load-more"
+                  :justify :center
+                  :width "100%"
+                  :children [(if true #_@loading-more?
+                                 #_[re-com/throbber
+                                    :size :small]
+                                 [re-com/button
+                                  :label "Load More"
+                                  :on-click #(re-frame/dispatch [:load-more-videos])])]]]]]))

 (defn panel []
   (let [videos (re-frame/subscribe [:videos])
@@ -330,7 +319,7 @@
                         (lower-body search-results
                                     @search-term
                                     (or search-results
-                                        (drop noof-highlight-videos all-videos)))]]
+                                        all-videos))]]
             [re-com/box
              :height "100%"
              :width "100%"


cleanup router

cleanup router

--- src/cljs/swarmpit/router.cljs
+++ src/cljs/swarmpit/router.cljs
@@ -7,12 +7,15 @@

 (defonce location (atom nil))

+(defn- dispatch-login!
+  []
+  (controller/dispatch {:handler :login})
+  (dispatch! (routes/path-for-frontend :login)))
+
 (defn- on-navigate
   [location]
   (if (nil? (storage/get "token"))
-    (do (controller/dispatch {:handler :login})
-        (dispatch!
-          (routes/path-for-frontend :login)))
+    (dispatch-login!)
     ;; Render to service list by default as we don't have any index page right now
     (if (= :index (:handler location))
       (controller/dispatch {:handler :service-list})


SVG icons removed from IE.

SVG icons removed from IE.

--- src/cljs/town_client/map.cljs
+++ src/cljs/town_client/map.cljs
@@ -64,13 +64,15 @@
         (.setStyle (.-data map)
                    (fn [feature]
                      (let [text (.getProperty feature "text_content")
-                           category (.getProperty feature "category")]
-                       #js{:title (if (> (count text) 0) text category)
-                           :icon #js{:path google.maps.SymbolPath.CIRCLE
-                                     :scale 3
-                                     :fillColor (color category)
-                                     :strokeWeight 0
-                                     :fillOpacity 1} })))))))
+                           category (.getProperty feature "category")
+                           marker #js{:title (if (> (count text) 0) text category)}]
+                       (if (not (browser-is-ie))
+                         (set! (.-icon marker) #js{:path google.maps.SymbolPath.CIRCLE
+                                               :scale 3
+                                               :fillColor (color category)
+                                               :strokeWeight 0
+                                               :fillOpacity 1}))
+                       marker)))))))

 (defn init
   []


Added printing of gen number at end of each generation's report

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -410,6 +410,8 @@
         (printf "Report:          %8.1f seconds, %4.1f%%\n" (/ report-time 1000.0) (* 100.0 (/ report-time total-time)))
         (printf "Other:           %8.1f seconds, %4.1f%%\n" (/ other 1000.0) (* 100.0 (/ other total-time)))))
     (println ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;")
+    (println ";; -*- End of report for generation" generation)
+    (println ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;")
     (flush)
     (when print-csv-logs (csv-print population generation argmap))
     (when print-json-logs (json-print population generation json-log-filename


fix bug for printing mean

fix bug for printing mean

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -372,7 +372,7 @@
     (let [mean (r/generation-data! [:best :mean-error] (float (/ (:total-error best)
                                                                  (count (:errors best)))))]

-      (println "Mean:"))
+      (println "Mean:") mean)
     (when (not= normalization :none)
       (println "Normalized error:" (:normalized-error best)))
     (case total-error-method


dynamic picking/running multiple parsers depending on file extension

--- src/collabsubtitles/core.cljs
+++ src/collabsubtitles/core.cljs
@@ -2,7 +2,7 @@
   (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [cljs.core.async :refer [chan <! >! timeout put! close!]]
             [jayq.core :refer [$] :as $]
-            [collabsubtitles.srt-parser :as srt]))
+            [collabsubtitles.srt-parser :refer [parse-srt]]))

 (defn log [& params]
   (.apply (.-log js/console) js/console (clj->js params))
@@ -89,6 +89,22 @@
     (.readAsText reader file)
     c))

+(defmulti read-file-cues
+  (fn [file]
+    (let [[_ ext] (re-find #"(?i)\.([a-z]+)$" (.-name file))]
+      (keyword (.toLowerCase ext)))))
+
+(defmethod read-file-cues :default [file]
+  (log "can't parse file" file)
+  identity)
+
+(defmethod read-file-cues :srt [_] parse-srt)
+(defmethod read-file-cues :vtt [_] parse-vtt)
+
+(defn track-from-file [file]
+  (go
+    {:cues ((read-file-cues file) (<! (read-file-as-text file)))}))
+
 (defn setup-subtitle-drop [video]
   (let [$video ($ video)
         add-class (partial $/add-class $video "collabsubtitles-dragover")
@@ -100,8 +116,7 @@
                      (remove-class)
                      (doseq [file (jq-event-files e)]
                        (go
-                         (let [vtt-content (<! (read-file-as-text file))]
-                           (add-subtitles video {:cues (srt/parse-srt vtt-content)}))))
+                         (add-subtitles video (<! (track-from-file file)))))
                      false)))))

 (defn setup-player-integration [video]


add missing internal helpers for proxy instrumentation


Correctly parse json response

Correctly parse json response

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -173,7 +173,7 @@

   ** Needs optimizations **"
   [response]
-  (let [res (keywordize-keys response)
+  (let [res (discuss.communication.main/process-response response)
         items (:items res)
         discussion (:discussion res)
         issues (:issues res)]


added category- and video-wise max matching scores

--- src/distillery/processing.clj
+++ src/distillery/processing.clj
@@ -292,13 +292,15 @@

 (defn match-video
   [{:keys [categories configuration] :as job} video]
-  (assoc video
-    :matches (->> categories
+  (let [matches (->> categories
                   (map #(compute-matching-score video %))
                   (filter #(>= (:score %) 0.0))
                   (map #(vector (:category-id %) %))
                   (apply concat)
-                  (apply sorted-map))))
+                  (apply sorted-map))]
+  (assoc video
+    :matches matches
+    :max-score (apply max (map :score (vals matches))))))

 (defn- lookup-matching-score
   [category video]
@@ -309,12 +311,13 @@

 (defn lookup-category-match
   [{:keys [videos] :as job} category]
-  (assoc category
-    :matches (->> videos
+  (let [matches (->> videos
                   (map #(lookup-matching-score category %))
                   (filter #(>= (:score %) 0.0))
                   (map #(vector (:video-id %) %))
                   (apply concat)
-                  (apply sorted-map))))
-
-
+                  (apply sorted-map))]
+  (assoc category
+    :matches matches
+    :max-score (apply max (map :score (vals matches))))))
+


Set schema.

Set schema.

--- src/onyx/coordinator/log/datomic.clj
+++ src/onyx/coordinator/log/datomic.clj
@@ -1,5 +1,20 @@
 (ns onyx.coordinator.log.datomic
-  (:require [onyx.coordinator.extensions :as extensions]))
+  (:require [datomic.api :as d]
+            [onyx.coordinator.extensions :as extensions]))
+
+(defn log-schema []
+  (let [resource (clojure.java.io/resource "datomic-schema.edn")]
+    (read-string (slurp resource))))
+
+(defn schema-set? [conn]
+  (seq (d/q '[:find ?e :where [?e :db/ident :peer/place]] (d/db conn))))
+
+(defn start-datomic! [uri schema]
+  (d/create-database uri)
+  (let [conn (d/connect uri)]
+    (when-not (schema-set? conn)
+      @(d/transact conn schema))
+    conn))

 (defmethod extensions/mark-peer-born :datomic
   [log peer])


added log message

added log message

--- src/ethlance_emailer/cmd.cljs
+++ src/ethlance_emailer/cmd.cljs
@@ -230,6 +230,7 @@
         job-skills (:job/skills (ethlance-db/get-job-skills job-id (:job/skills-count job) instances))]
     (loop [offset 0]
       (let [user-ids (ethlance-db/search-freelancers-by-any-of-skills job-skills 1 offset users-job-recommendation-limit instances)]
+        (u/log! "on-job-added" job-id "freelancers" (count user-ids))
         (doseq [user-id user-ids]
           (let [user (ethlance-db/get-user user-id instances)
                 body (templates/on-job-added [job])]


Remove unused imports from movement ns.

Remove unused imports from movement ns.

--- src/uxbox/ui/workspace/movement.cljs
+++ src/uxbox/ui/workspace/movement.cljs
@@ -7,9 +7,7 @@

 (ns uxbox.ui.workspace.movement
   "Shape movement in workspace logic."
-  (:require-macros [uxbox.util.syntax :refer [define-once]])
   (:require [beicon.core :as rx]
-            [lentes.core :as l]
             [uxbox.rstore :as rs]
             [uxbox.state :as st]
             [uxbox.ui.core :as uuc]


Only align when grid is activated.

Only align when grid is activated.

--- src/uxbox/ui/workspace/movement.cljs
+++ src/uxbox/ui/workspace/movement.cljs
@@ -38,9 +38,19 @@
   (-> (l/getter resolve-selected)
       (l/focus-atom st/state)))

-(def ^:const ^:privae page-options-l
-  (-> (l/key :options)
-      (l/focus-atom wb/page-l)))
+;; (def ^:const ^:privae page-options-l
+;;   (-> (l/key :options)
+;;       (l/focus-atom wb/page-l)))
+
+(def ^:const ^:private alignment-l
+  (letfn [(getter [state]
+            (let [{:keys [page flags]} (:workspace state)
+                  {:keys [options]} (get-in state [:pages-by-id page])]
+              (and (contains? flags :alignment/indexed)
+                   (contains? flags :grid)
+                   (:grid/align options false))))]
+    (-> (l/getter getter)
+        (l/focus-atom st/state))))

 ;; --- Public Api

@@ -85,9 +95,7 @@
 (defn- initialize
   []
   (let [shapes @selected-shapes-l
-        options @page-options-l
-        flags @wb/flags-l
-        indexed? (:alignment/indexed flags)
+        align? @alignment-l
         stoper (->> uuc/actions-s
                     (rx/map :type)
                     (rx/filter empty?)
@@ -99,7 +107,7 @@
                  (let [xf (map #(sh/move % delta))]
                    (into [] xf acc))) shapes $)
       (rx/mapcat (fn [items]
-                   (if (and (:grid/align options) indexed?)
+                   (if align?
                      (->> (apply rx/of items)
                           (rx/mapcat align/translate)
                           (rx/reduce conj []))


Added ship explosion textures, changed enemy explosion to 'blue/cyan'

--- desktop/src-common/ds3/explosion.clj
+++ desktop/src-common/ds3/explosion.clj
@@ -11,7 +11,8 @@
 (def ^:const layer2-width (c/screen-to-world 7))
 (def ^:const layer3-width (c/screen-to-world 6))
 (def ^:const layer4-width (c/screen-to-world 1))
-(def explosion-textures (atom []))
+(def enemy-explosion-textures (atom []))
+(def ship-explosion-textures (atom []))

 (defn create-circle-texture [c]
   (let [pix-map (pixmap* 16 16 (pixmap-format :r-g-b-a8888))]
@@ -24,37 +25,53 @@
   (let [circle-entity (create-circle-texture c)]
     (assoc circle-entity
       :width (c/screen-to-world (* 2 width)) :height (c/screen-to-world (* 2 width))
-      :ttl 12 :frame-ticks default-frame-ticks
       )))

 (defn create-explosion [x y]
-  (let [textures (cond (empty? @explosion-textures)
-                       (reset! explosion-textures
+  (let [textures (cond (empty? @enemy-explosion-textures)
+                       (reset! enemy-explosion-textures
+                               [(create-circle-entity 8 7.5 (color :black))
+                                (create-circle-entity 7 6.5 (color :blue))
+                                (create-circle-entity 6 5.5 (color :cyan));
+                                (create-circle-entity 1 1.5 (color :white))])
+                       :else @enemy-explosion-textures)
+        explosion (bundle
+                    (assoc (textures 0) :x (- x layer1-width) :y (- y layer1-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 1) :x (- x layer2-width) :y (- y layer2-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 2) :x (- x layer3-width) :y (- y layer3-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 3) :x (- x layer4-width) :y (- y layer4-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    )]
+    (sound "explosion.ogg" :play)
+    (assoc explosion :explosion? true :render-layer 100)))
+
+(defn create-ship-explosion [x y]
+  (let [textures (cond (empty? @ship-explosion-textures)
+                       (reset! ship-explosion-textures
                                [(create-circle-entity 8 7.5 (color :black))
                                 (create-circle-entity 7 6.5 (color :orange))
                                 (create-circle-entity 6 5.5 (color :yellow))
                                 (create-circle-entity 1 1.5 (color :white))])
-                       :else @explosion-textures)
+                       :else @ship-explosion-textures)
         explosion (bundle
-                    (assoc (textures 0) :x (- x layer1-width) :y (- y layer1-width))
-                    (assoc (textures 1) :x (- x layer2-width) :y (- y layer2-width))
-                    (assoc (textures 2) :x (- x layer3-width) :y (- y layer3-width))
-                    (assoc (textures 3) :x (- x layer4-width) :y (- y layer4-width))
+                    (assoc (textures 0) :x (- x layer1-width) :y (- y layer1-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 1) :x (- x layer2-width) :y (- y layer2-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 2) :x (- x layer3-width) :y (- y layer3-width) :ttl 12 :frame-ticks default-frame-ticks)
+                    (assoc (textures 3) :x (- x layer4-width) :y (- y layer4-width) :ttl 12 :frame-ticks default-frame-ticks)
                     )]
-    (sound "explosion.ogg" :play)
+    (sound "explosion2.ogg" :play)
     (assoc explosion :explosion? true :render-layer 100)))

 (defn handle-explosion [{:keys [entities] :as explosion}]
-  (let [[part1 part2 part3 {:keys [x y width height ttl frame-ticks] :as part4}] entities]
+  (let [[layer1 layer2 layer3 {:keys [x y width height ttl frame-ticks] :as layer4}] entities]
     ;(clojure.pprint/pprint part4)
     ;(prn :x x :y y :width width :height height :ttl ttl :frame-ticks frame-ticks)
     (cond (and (> ttl 0) (= 0 frame-ticks))
-          (assoc explosion :entities [part1 part2 part3 (assoc part4
+          (assoc explosion :entities [layer1 layer2 layer3 (assoc layer4
                                                           :x (- x (c/screen-to-world 0.5)) :y (- y (c/screen-to-world 0.5))
                                                           :width (+ width (c/screen-to-world 1)) :height (+ height (c/screen-to-world 1))
                                                           :ttl (- ttl 1) :frame-ticks default-frame-ticks)])
           (and (> ttl 0) (> frame-ticks 0))
-          (assoc explosion :entities [part1 part2 part3 (assoc part4 :frame-ticks (- frame-ticks 1))])
+          (assoc explosion :entities [layer1 layer2 layer3 (assoc layer4 :frame-ticks (- frame-ticks 1))])

     )))


update method syntax, remove unnecessary preventDefault

--- src/app/cljs/one/sample/history.cljs
+++ src/app/cljs/one/sample/history.cljs
@@ -24,8 +24,7 @@
 (event/listen js/window
               goog.events.EventType.HASHCHANGE
               (fn [e]
-                (. e (preventDefault))
-                (-> (.-newURL (. e (getBrowserEvent)))
+                (-> (.-newURL (.getBrowserEvent e))
                     get-token
                     keyword
                     dispatch/fire)))


more user validation tests

more user validation tests

--- test/clj_money/models/users_test.clj
+++ test/clj_money/models/users_test.clj
@@ -49,7 +49,15 @@
     (assert-throws-validation-exception
       {:first_name 'missing-required-key}
       (users/create data-store (dissoc attributes :first_name))))
+  (testing "First name cannot be empty"
+    (assert-throws-ex-info-with-key
+      [:error :first_name]
+      (users/create data-store (assoc attributes :first_name ""))))
   (testing "Last name is required"
     (assert-throws-validation-exception
       {:last_name 'missing-required-key}
-      (users/create data-store (dissoc attributes :last_name)))))
+      (users/create data-store (dissoc attributes :last_name))))
+  (testing "Last name cannot be empty"
+    (assert-throws-ex-info-with-key
+      [:error :last_name]
+      (users/create data-store (assoc attributes :last_name "")))))


Display problem restrictions

Display problem restrictions

--- src/clojure/org/bytopia/foreclojure/problem.clj
+++ src/clojure/org/bytopia/foreclojure/problem.clj
@@ -131,9 +131,9 @@
                 :on-click (fn [v] (clear-result-flags
                                   (.getContext ^View v)))}]])

-(defn make-tests-list [tests]
+(defn make-tests-list [tests under]
   (list* :linear-layout {:id ::tests-lv
-                         :layout-below ::desc-tv
+                         :layout-below under
                          :id-holder true
                          :orientation :vertical
                          :layout-margin-top [10 :dp]
@@ -182,7 +182,15 @@
     [:text-view {:id ::desc-tv
                  :layout-below ::title-tv
                  :text (render-html description)}]
-    (make-tests-list tests)
+    (when (seq restricted)
+      [:text-view {:id ::restricted-tv
+                   :layout-below ::desc-tv
+                   :text (->> restricted
+                              (interpose ", ")
+                              (apply str)
+                              (str "Special restrictions: "))}])
+    (make-tests-list tests (if (seq restricted)
+                             ::restricted-tv  ::desc-tv))
     [:edit-text {:id ::codebox
                  :layout-below ::tests-lv
                  :ime-options android.view.inputmethod.EditorInfo/IME_FLAG_NO_EXTRACT_UI


Fix typo in name

Fix typo in name

--- src/braid/client/ui/views/pills.cljs
+++ src/braid/client/ui/views/pills.cljs
@@ -40,7 +40,7 @@
                                         :query query})}
        "Search"])))

-(defn tag-car-view
+(defn tag-card-view
   [tag-id]
   (let [tag (subscribe [:tag tag-id])
         user-subscribed-to-tag? (subscribe [:user-subscribed-to-tag? tag-id])]
@@ -65,7 +65,7 @@
   [tag-id]
   [:div.tag
    [tag-pill tag-id]
-   [tag-car-view tag-id]])
+   [tag-card-view tag-id]])

 (defn user-pill
   [user-id]


broadcast when adding message from webhook

--- src/chat/server/extensions/asana.clj
+++ src/chat/server/extensions/asana.clj
@@ -12,7 +12,8 @@
                                             handle-thread-change handle-webhook
                                             handle-oauth-token extension-config
                                             str->b64 b64->str edn-response]]
-            [chat.server.crypto :refer [hmac-verify]]))
+            [chat.server.crypto :refer [hmac-verify]]
+            [chat.server.sync :as sync]))

 (def client-id (env :asana-client-id))
 (def client-secret (env :asana-client-secret))
@@ -183,7 +184,8 @@
                                      :mentioned-tag-ids ()})
                 (db/set-extension-config!
                   extension
-                  :issue->thread (assoc issue->thread resource thread-id))))
+                  :issue->thread (assoc issue->thread resource thread-id)))
+              (sync/broadcast-thread thread-id ()))
           (timbre/warnf "No such task %s" resource))))
     ; TODO: handle changed issue to add a new message to the thread
     (doseq [{:strs [resource parent] :as story} new-comments]


mobile: Fix cover image subscription

mobile: Fix cover image subscription

--- apps/mobile/src/souptitle_mobile/subs.cljs
+++ apps/mobile/src/souptitle_mobile/subs.cljs
@@ -3,7 +3,8 @@
   (:require [re-frame.core :refer [register-sub subscribe]]
             [souptitle-mobile.consts :as const]
             [clojure.string :as string]
-            [souptitle-mobile.handlers :refer [get-seasons-by-index
+            [souptitle-mobile.handlers :refer [get-serial-by-index
+                                               get-seasons-by-index
                                                get-chapters-by-index
                                                get-chapter-by-index]]))

@@ -165,7 +166,11 @@
 (register-sub
   :get-cover-image
   (fn [db _]
-    (reaction (get @db :serial-cover-image))))
+    (let [serials (subscribe [:serials])
+          active-content (reaction (:active-content @db))]
+      (reaction (-> (get-serial-by-index @serials @active-content)
+                    :meta
+                    :cover)))))

 ;; Well known words
 (register-sub


Fix permission bug

Fix permission bug

--- src/cljs/salava/badge/ui/upload.cljs
+++ src/cljs/salava/badge/ui/upload.cljs
@@ -85,12 +85,14 @@
      ]))

 (defn init-data [state]
-  (ajax/GET (path-for "/obpv1/user/public-access") {}
-            (fn [] (swap! state assoc :permission nil))))
+  (ajax/GET (path-for "/obpv1/user/public-access")
+            {:handler (fn [data]
+                        (swap! state assoc :permission "success"))}
+            (fn [] (swap! state assoc :permission "error"))))

 (defn handler [site-navi]
   (let [state (atom {:status "form"
-                     :permission true})]
+                     :permission "initial"})]
     (init-data state)
     (fn []
       (cond


fix successful verification

fix successful verification

--- src/cljs/salava/badge/ui/verify.cljs
+++ src/cljs/salava/badge/ui/verify.cljs
@@ -6,7 +6,7 @@
             [salava.core.helper :refer [dump]]
             [salava.badge.ui.helper :as bh]
             [salava.badge.ui.assertion :as a]
-            [clojure.string :refer [blank?]]
+            [clojure.string :refer [blank? upper-case]]
             [salava.core.time :refer [date-from-unix-time unix-time unix-time]]
             ))

@@ -18,21 +18,16 @@
                                 :verifying false
                                 :display "none"
                                 :style "success")))}))
-(defn code-helper [v]
-  (case v
-    200 "ok"
-    800 "not provided"
-    v
-    ))

 (defn bottom-links [state]
   [:div
    [:div
-    [:a.link {:href     "#"
+    [:a.link {:style {:float "right" :padding-bottom "5px"}
+              :href     "#"
               :on-click #(do (.preventDefault %)
                            (if (= (:display @state) "none") (swap! state assoc :display "block") (swap! state assoc :display "none"))
                            )} (if (= (:display @state) "none") (str (t :badge/Openassertion) "...") (str (t :badge/Hideassertion) "..."))]
-    [:a {:style {:float "right"} :href (str "https://badgecheck.io/?url="(:asr @state)) :target "_blank" :rel "nofollow noopener"} "use external validator"]]
+    #_[:a {:style {:float "right"} :href (str "https://badgecheck.io/?url="(:asr @state)) :target "_blank" :rel "nofollow noopener"} "use external validator"]]
    [:div {:style {:display (:display @state) :padding-top "30px"}}
     [a/assertion-content (dissoc (:assertion @state) :evidence)]]])

@@ -46,31 +41,34 @@
            [:i {:class "fa fa-cog fa-spin fa-2x "}]
            [:span (str (t :core/Loading) "...")]]
           [:div {:style {:padding-top "20px"}}
+
            (case assertion-status
              410  [:div
                    [:div {:class "revoked"}(str (t :badge/Badge) " " (t :badge/Revoked))]
-                   [:a {:target "_blank" :rel "nofollow noopener" :href (str "https://badgecheck.io/?url="asr) :style {:float "right"}} "use external validator"]
-                   ]
+                   #_[:a {:target "_blank" :rel "nofollow noopener" :href (str "https://badgecheck.io/?url="asr) :style {:float "right"}} "use external validator"]]
              500 [:div
-                  [:div {:class "expired"}
-                   (:badge-status @state)]
+                  [:div {:class "revoked"}
+                   (t :badge/Badgecheckfailed)]
                   [:br]
                   [:p [:i message]]
-                  [:a {:target "_blank" :rel "nofollow noopener" :href (str "https://badgecheck.io/?url="asr) :style {:float "right"}} "use external validator"]]
+                  #_[:a {:target "_blank" :rel "nofollow noopener" :href (str "https://badgecheck.io/?url="asr) :style {:float "right"}} "use external validator"]]
              [:div
-              #_(if (and verified_by_obf issued_by_obf) [:p (t :badge/Issuedandverifiedbyobf)])
               (cond
                 revoked? [:div [:p {:class "revoked"} (str (t :badge/Badge) " " (t :badge/Revoked))] [:p revocation_reason]]
-                expired? [:div {:class "expired"} [:p (t :badge/Badgeisexpired)]]
+                expired? [:div [:p {:class "revoked"} (t :badge/Badgeisexpired)] [bottom-links state]]
                 :else [:div
-                       [:p [:b "Assertion url"]" - " (code-helper assertion-status)]
-                       [:p [:b "Badge Image url"]" - " (code-helper badge-image-status)]
-                       [:p [:b "Badge Criteria url"]" - " (code-helper badge-criteria-status)]
-                       [:p [:b "Badge Issuer url"]" - " (code-helper badge-issuer-status)]
-                       [:p [:b (str (t :badge/Revoked))] " - " (if revoked? (t :core/Yes) (t :core/No)) ]
-                       [:p {:class "success"} (t :badge/Validbadge)]])
+                       [:p.validation-header (t :badge/Badgecheckresult)]

-              [:p [:i "last checked on " (date-from-unix-time (* 1000 (unix-time)))]]
-              [bottom-links state]])])))))
+                       [:p.validation-result  (t :badge/Assertionurl)"  " [:i {:class "fa fa-check-circle fa-lg"}]]
+                       (if (= 200 badge-image-status)
+                         [:p.validation-result (t :badge/Imageurl)"  " [:i {:class "fa fa-check-circle fa-lg test"}]])
+                       (if (= 200 badge-criteria-status)
+                         [:p.validation-result  (t :badge/Criteriaurl)"  " [:i {:class "fa fa-check-circle fa-lg"}]])
+                       (if (= 200 badge-issuer-status)
+                         [:p.validation-result (t :badge/Issuerurl)"  " [:i {:class "fa fa-check-circle fa-lg"}]])
+
+                       [:div {:class "alert alert-success"} [:i {:class "fa fa-check-circle fa-lg"}] (t :badge/Validbadge)]
+                       [bottom-links state]])
+              ])])))))


Figwheel repl file for Cursive see https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL


[#1656] WIP steps to mark maps as filtered or not

--- backend/src/akvo/lumen/lib/aggregation.clj
+++ backend/src/akvo/lumen/lib/aggregation.clj
@@ -85,10 +85,33 @@
       {:datasets {dataset-id dataset}
        :visualisations {(:id visualisation) visualisation}})))

-(defn merge-dashboard-filters
+(defmulti merge-dashboard-filters
   "Merge dashboard filters into applicable visualisation spec and mark filter
   status."
-  [visualisation filters]
+  (fn [{:keys [visualisationType]} _]
+    visualisationType))
+
+(defmethod merge-dashboard-filters "map" [visualisation filters]
+  (println "@merge-dashboard-filters")
+  (clojure.pprint/pprint visualisation)
+  (clojure.pprint/pprint filters)
+  (let [layers (-> visualisation :spec "layers")
+        map-datasets-ids (reduce (fn [ids {:strs [datasetId]}]
+                                   (conj ids datasetId))
+                                 #{}
+                                 layers)]
+    (cond
+      (empty? (:columns filters))
+      (assoc visualisation :unfiltered false)
+
+      (not (contains? map-datasets-ids (:datasetId filters)))
+      (assoc visualisation :unfiltered true)
+
+      :else
+      (assoc visualisation :unfiltered false))))
+
+
+(defmethod merge-dashboard-filters :default [visualisation filters]
   (cond
     (empty? (:columns filters)) ;; No valid filter
     (assoc visualisation :unfiltered false)
@@ -101,6 +124,22 @@
     (-> visualisation
         (update-in [:spec "filters"] #(concat % (filter :value (:columns filters))))
         (assoc :unfiltered false))))
+
+#_(defn merge-dashboard-filters
+
+    [{:keys [visualisationType] :as visualisation} filters]
+    (cond
+      (empty? (:columns filters)) ;; No valid filter
+      (assoc visualisation :unfiltered false)
+
+      (not (= (:datasetId visualisation) ;; Valid filter but no match on datasets
+              (:datasetId filters)))
+      (assoc visualisation :unfiltered true)
+
+      :else ;; Valid filter and matching dataset
+      (-> visualisation
+          (update-in [:spec "filters"] #(concat % (filter :value (:columns filters))))
+          (assoc :unfiltered false))))

 (defn visualisation-response-data [tenant-conn id windshaft-url filters]
   (try


make gifs start when you hover

make gifs start when you hover

--- src/pc/views/blog/private_docs_early_access.clj
+++ src/pc/views/blog/private_docs_early_access.clj
@@ -1,6 +1,18 @@
 (ns pc.views.blog.private-docs-early-access
   (:require [ring.middleware.anti-forgery :refer (wrap-anti-forgery)]
             [pc.views.blog.common :as common]))
+
+
+(defn demo [placeholder gif & {:keys [caption]}]
+  [:figure.play-gif {:alt "demo"
+                     :onmouseover (format "this.getElementsByTagName('img')[0].src = '%s'" gif)
+                     :onmouseout (format "this.getElementsByTagName('img')[0].src = '%s'" placeholder)}
+   [:a (when caption
+         {:data-caption-black caption})
+    [:img {:src placeholder}]]])
+
+(defn demo-with-blank-canvas [gif caption]
+  (demo "/blog/private-docs-early-access/canvas.png" gif :caption caption))

 (defn private-docs-early-access []
   {:title "Private docs early access."
@@ -19,39 +31,28 @@
      [:p "Open the side menu with the button in the upper-left corner and then select \"Sharing\".
          At the bottom of the sharing menu, hover over the Private/Public toggle to expand it, then select \"Private\".
          The owner of the doc can toggle between public and private at anytime from this menu."]]
-    [:figure.play-gif {:alt "demo"}
-     [:a {:data-caption-black "Make a doc private by toggling the privacy setting at the bottom of the sharing menu."}
-      [:img {:src "/blog/private-docs-early-access/make-private.gif"}]
-      [:img {:src "/blog/private-docs-early-access/canvas.png"}]]]
+    (demo-with-blank-canvas "/blog/private-docs-early-access/make-private.gif" "Make a doc private by toggling the privacy setting at the bottom of the sharing menu.")

     [:article
      [:h3 "How do I grant access to my private doc?"]
      [:p "After the doc is made private, the creator of the doc will be the only user allowed to view its contents.
          To grant access to other users, simply enter their email in the input field near the top of the sharing menu and submit it with enter.
          That user will then be displayed in a list below the input field."]]
-    [:figure.play-gif {:alt "demo"}
-     [:a {:data-caption-black "Grant someone access with their email address."}
-      [:img {:src "/blog/private-docs-early-access/grant-access.gif"}]
-      [:img {:src "/blog/private-docs-early-access/canvas.png"}]]]
+    (demo-with-blank-canvas "/blog/private-docs-early-access/grant-access.gif" "Grant someone access with their email address.")

     [:article
      [:h3 "How do I approve access to my private doc?"]
      [:p "When someone requests access to your private doc, they will show up in a list inside the sharing menu.
          From this menu you can approve or deny requests by hovering over them and clicking either the check or the x icon.
          If you deny someone by mistake, you will still have the option to approve them."]]
-    [:figure.play-gif {:alt "demo"}
-     [:a {:data-caption-black "Approve or deny access requests from the sharing menu."}
-      [:img {:src "/blog/private-docs-early-access/approve-access.gif"}]
-      [:img {:src "/blog/private-docs-early-access/canvas.png"}]]]
+    (demo-with-blank-canvas "/blog/private-docs-early-access/approve-access.gif" "Approve or deny access requests from the sharing menu.")

     [:article
      [:h3 "How do I request access to a private doc?"]
      [:p "When other users arrive at the url for a private doc they will find an empty canvas and a prompt explaining that the doc is private.
          That prompt has a button which allows them to request access from the owner."]]
-    [:figure.play-gif {:alt "demo"}
-     [:a {:data-caption-black "Request access by going to the url and following the menu prompt."}
-      [:img {:src "/blog/private-docs-early-access/request-access.gif"}]
-      [:img {:src "/blog/private-docs-early-access/canvas.png"}]]]
+
+    (demo-with-blank-canvas "/blog/private-docs-early-access/request-access.gif" "Request access by going to the url and following the menu prompt.")

     [:article
      [:h3 "What kind of feedback should I share?"]


Untabified

Untabified

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -15,15 +15,15 @@
                 defvar-,
                 defmacro-,
                 defnk)]
-	[conexp.math.util
+        [conexp.math.util
          :only (with-doubles)]
-	[conexp.layouts
+        [conexp.layouts
          :only (*standard-layout-function*,
                 inf-additive-layout)]
-	[conexp.layouts.base
+        [conexp.layouts.base
          :only (lattice,
                 annotation)]
-	[conexp.layouts.force
+        [conexp.layouts.force
          :only (force-layout,
                 layout-energy,
                 *repulsive-amount*,
@@ -32,7 +32,7 @@
         [conexp.contrib.gui.util
          :only (with-swing-error-msg)]
         ;; drawing
-	[conexp.contrib.draw.scenes
+        [conexp.contrib.draw.scenes
          :only (add-callback-for-hook,
                 call-hook-with,
                 redraw-scene,
@@ -42,13 +42,13 @@
                 get-canvas-from-scene,
                 show-labels,
                 add-scrollbars)]
-	[conexp.contrib.draw.scene-layouts
+        [conexp.contrib.draw.scene-layouts
          :only (draw-on-scene,
                 get-layout-from-scene,
                 fit-scene-to-layout,
                 update-layout-of-scene,
                 do-nodes)]
-	[conexp.contrib.draw.nodes-and-connections
+        [conexp.contrib.draw.nodes-and-connections
          :only (move-interaction,
                 zoom-interaction,
                 move-node-by,
@@ -61,12 +61,12 @@
         conexp.contrib.draw.buttons)
   (:use [clojure.contrib.swing-utils :only (do-swing, add-action-listener)])
   (:import [javax.swing JFrame JPanel JButton JTextField JLabel
-	                JSeparator SwingConstants BoxLayout Box
-	                JScrollBar JComboBox JScrollPane JFileChooser]
-	   [javax.swing.filechooser FileNameExtensionFilter]
-	   [java.awt Canvas Color Dimension BorderLayout GridLayout Component Graphics]
-	   [java.awt.event ActionEvent ActionListener]
-	   [java.io File]))
+                        JSeparator SwingConstants BoxLayout Box
+                        JScrollBar JComboBox JScrollPane JFileChooser]
+           [javax.swing.filechooser FileNameExtensionFilter]
+           [java.awt Canvas Color Dimension BorderLayout GridLayout Component Graphics]
+           [java.awt.event ActionEvent ActionListener]
+           [java.io File]))

 (ns-doc
  "This namespace provides a lattice editor and a convenience function
@@ -77,7 +77,7 @@
 ;; editor features

 (declare single-move-mode, ideal-move-mode, filter-move-mode, chain-move-mode,
-	 infimum-additive-move-mode, supremum-additive-move-mode)
+         infimum-additive-move-mode, supremum-additive-move-mode)

 (defn- change-parameters
   "Installs parameter list which influences lattice drawing."
@@ -85,61 +85,61 @@
   ;; node radius
   (let [^JTextField node-radius (make-labeled-text-field buttons "radius" (str *default-node-radius*))]
     (add-action-listener node-radius
-			 (fn [evt]
-			   (let [new-radius (Double/parseDouble (.getText node-radius))]
-			      (do-nodes [n scn]
-				(set-node-radius! n new-radius))))))
+                         (fn [evt]
+                           (let [new-radius (Double/parseDouble (.getText node-radius))]
+                              (do-nodes [n scn]
+                                (set-node-radius! n new-radius))))))
   (make-padding buttons)

   ;; labels
   (let [^JButton label-toggler (make-button buttons "No Labels")]
     (show-labels scn false)
     (add-action-listener label-toggler
-			 (fn [evt]
-			   (do-swing
-			    (if (= "Labels" (.getText label-toggler))
-			      (do
-				(show-labels scn false)
-				(.setText label-toggler "No Labels"))
-			      (do
-				(show-labels scn true)
-				(.setText label-toggler "Labels")))
-			    (redraw-scene scn)))))
+                         (fn [evt]
+                           (do-swing
+                            (if (= "Labels" (.getText label-toggler))
+                              (do
+                                (show-labels scn false)
+                                (.setText label-toggler "No Labels"))
+                              (do
+                                (show-labels scn true)
+                                (.setText label-toggler "Labels")))
+                            (redraw-scene scn)))))

   ;; layouts
   (let [layouts {"standard" *standard-layout-function*,
-		 "inf-add"  inf-additive-layout},
+                 "inf-add"  inf-additive-layout},
         ^JButton fit (make-button buttons "Fit"),
-	^JComboBox combo-box (make-combo-box buttons (keys layouts))]
+        ^JComboBox combo-box (make-combo-box buttons (keys layouts))]
     (add-action-listener fit
                          (fn [evt]
                            (do-swing (fit-scene-to-layout scn))))
     (add-action-listener combo-box
-			 (fn [^ActionEvent evt]
-			   (let [selected (.. evt getSource getSelectedItem),
-				 layout-fn (get layouts selected)]
-			     (do-swing
-			      (update-layout-of-scene
-			       scn
-			       (layout-fn (lattice (get-layout-from-scene scn)))))))))
+                         (fn [^ActionEvent evt]
+                           (let [selected (.. evt getSource getSelectedItem),
+                                 layout-fn (get layouts selected)]
+                             (do-swing
+                              (update-layout-of-scene
+                               scn
+                               (layout-fn (lattice (get-layout-from-scene scn)))))))))

   ;; move mode
   (let [move-modes {"single" (single-move-mode),
-		    "ideal"  (ideal-move-mode),
-		    "filter" (filter-move-mode),
-		    "chain"  (chain-move-mode),
-		    "inf"    (infimum-additive-move-mode),
-		    "sup"    (supremum-additive-move-mode)}
-	^JComboBox combo-box (make-combo-box buttons (keys move-modes)),
-	current-move-mode (atom (move-modes "single"))]
+                    "ideal"  (ideal-move-mode),
+                    "filter" (filter-move-mode),
+                    "chain"  (chain-move-mode),
+                    "inf"    (infimum-additive-move-mode),
+                    "sup"    (supremum-additive-move-mode)}
+        ^JComboBox combo-box (make-combo-box buttons (keys move-modes)),
+        current-move-mode (atom (move-modes "single"))]
     (add-callback-for-hook scn :move-drag
-			   (fn [node dx dy]
-			     (@current-move-mode node dx dy)))
+                           (fn [node dx dy]
+                             (@current-move-mode node dx dy)))
     (add-action-listener combo-box
-			 (fn [^ActionEvent evt]
-			   (let [selected (.. evt getSource getSelectedItem),
-				 move-mode (get move-modes selected)]
-			     (reset! current-move-mode move-mode)))))
+                         (fn [^ActionEvent evt]
+                           (let [selected (.. evt getSource getSelectedItem),
+                                 move-mode (get move-modes selected)]
+                             (reset! current-move-mode move-mode)))))
   nil)

 (defn- single-move-mode
@@ -170,7 +170,7 @@
   "Combined ideal and filter move mode."
   []
   (let [ideal (ideal-move-mode),
-	filter (filter-move-mode)]
+        filter (filter-move-mode)]
     (fn [node dx dy]
       (ideal node dx dy)
       (filter node dx dy))))
@@ -183,7 +183,7 @@
     (do-swing
      (doseq [[n weight] (influenced-nodes node)]
        (with-doubles [dx dy weight]
-	 (move-node-by n (* dx weight) (* dy weight)))))))
+         (move-node-by n (* dx weight) (* dy weight)))))))

 (defn- infimum-additive-move-mode
   "Moves all nodes infimum-additively with node."
@@ -202,34 +202,34 @@
   "Improves layout on scene with force layout."
   [scn iterations r a g]
   (binding [*repulsive-amount* r,
-	    *attractive-amount* a,
-	    *gravitative-amount* g]
+            *attractive-amount* a,
+            *gravitative-amount* g]
     (update-layout-of-scene scn
-			    (if (<= iterations 0)
-			      (force-layout (get-layout-from-scene scn))
-			      (force-layout (get-layout-from-scene scn) iterations)))))
+                            (if (<= iterations 0)
+                              (force-layout (get-layout-from-scene scn))
+                              (force-layout (get-layout-from-scene scn) iterations)))))

 (defn- improve-layout-by-force
   "Improves layout on screen by force layout."
   [frame scn buttons]
   (let [^JTextField rep-field    (make-labeled-text-field buttons "rep"  (str *repulsive-amount*)),
-	^JTextField attr-field   (make-labeled-text-field buttons "attr" (str *attractive-amount*)),
-	^JTextField grav-field   (make-labeled-text-field buttons "grav" (str *gravitative-amount*)),
-	^JTextField iter-field   (make-labeled-text-field buttons "iter" (str "300")),
-	_                        (make-padding buttons),
-	^JButton button          (make-button buttons "Force"),
-
-	get-force-parameters     (fn []
+        ^JTextField attr-field   (make-labeled-text-field buttons "attr" (str *attractive-amount*)),
+        ^JTextField grav-field   (make-labeled-text-field buttons "grav" (str *gravitative-amount*)),
+        ^JTextField iter-field   (make-labeled-text-field buttons "iter" (str "300")),
+        _                        (make-padding buttons),
+        ^JButton button          (make-button buttons "Force"),
+
+        get-force-parameters     (fn []
                                    (let [r (Double/parseDouble (.getText rep-field)),
                                          a (Double/parseDouble (.getText attr-field)),
                                          g (Double/parseDouble (.getText grav-field)),
                                          i (Integer/parseInt (.getText iter-field))]
                                      [r a g i]))]
     (add-action-listener button (fn [evt]
-				  (do-swing
-				   (with-swing-error-msg frame "An Error occured."
-				     (let [[r a g i] (get-force-parameters)]
-				       (improve-with-force scn i r a g))))))))
+                                  (do-swing
+                                   (with-swing-error-msg frame "An Error occured."
+                                     (let [[r a g i] (get-force-parameters)]
+                                       (improve-with-force scn i r a g))))))))

 ;; zoom-move

@@ -237,27 +237,27 @@
   "Install zoom-move-toggler."
   [frame scn buttons]
   (let [zoom-factors (fn []
-		       (let [[zoom-x zoom-y] (get-zoom-factors scn)]
-			 (with-out-str
-			   (printf "%1.2f" zoom-x)
-			   (print " x ")
-			   (printf "%1.2f" zoom-y)))),
-	^JButton zoom-move (make-button buttons "Move"),
-	^JLabel  zoom-info (make-label buttons " -- ")]
+                       (let [[zoom-x zoom-y] (get-zoom-factors scn)]
+                         (with-out-str
+                           (printf "%1.2f" zoom-x)
+                           (print " x ")
+                           (printf "%1.2f" zoom-y)))),
+        ^JButton zoom-move (make-button buttons "Move"),
+        ^JLabel  zoom-info (make-label buttons " -- ")]
     (add-action-listener zoom-move
-			 (fn [evt]
-			   (do-swing
-			    (if (= "Move" (.getText zoom-move))
-			      (do
-				(start-interaction scn zoom-interaction)
-				(.setText zoom-move "Zoom"))
-			      (do
-				(start-interaction scn move-interaction)
-				(.setText zoom-move "Move"))))))
+                         (fn [evt]
+                           (do-swing
+                            (if (= "Move" (.getText zoom-move))
+                              (do
+                                (start-interaction scn zoom-interaction)
+                                (.setText zoom-move "Zoom"))
+                              (do
+                                (start-interaction scn move-interaction)
+                                (.setText zoom-move "Move"))))))
     (add-callback-for-hook scn :image-changed
-			   (fn []
-			     (do-swing
-			      (.setText zoom-info (zoom-factors))))))
+                           (fn []
+                             (do-swing
+                              (.setText zoom-info (zoom-factors))))))
   nil)

 ;; export images to files
@@ -266,7 +266,7 @@
   "Returns file extension of given file."
   [^File file]
   (let [name (.getName file),
-	idx  (.lastIndexOf name ".")]
+        idx  (.lastIndexOf name ".")]
     (if-not (= -1 idx)
       (.toLowerCase (.substring name (+ 1 idx)))
       nil)))
@@ -275,21 +275,21 @@
   "Installs a file exporter."
   [frame scn buttons]
   (let [^JButton save-button (make-button buttons "Save"),
-	^JFileChooser fc (JFileChooser.),
-	jpg-filter (FileNameExtensionFilter. "JPEG Files" (into-array ["jpg" "jpeg"])),
-	gif-filter (FileNameExtensionFilter. "GIF Files"  (into-array ["gif"])),
-	png-filter (FileNameExtensionFilter. "PNG Files"  (into-array ["png"]))]
+        ^JFileChooser fc (JFileChooser.),
+        jpg-filter (FileNameExtensionFilter. "JPEG Files" (into-array ["jpg" "jpeg"])),
+        gif-filter (FileNameExtensionFilter. "GIF Files"  (into-array ["gif"])),
+        png-filter (FileNameExtensionFilter. "PNG Files"  (into-array ["png"]))]
     (doto fc
       (.addChoosableFileFilter jpg-filter)
       (.addChoosableFileFilter gif-filter)
       (.addChoosableFileFilter png-filter))
     (add-action-listener save-button
-			 (fn [evt]
-			   (let [retVal (.showSaveDialog fc frame)]
-			     (when (= retVal JFileChooser/APPROVE_OPTION)
-			       (let [^File file (.getSelectedFile fc)]
-				 (with-swing-error-msg frame "Error while saving"
-				   (save-image scn file (get-file-extension file)))))))))
+                         (fn [evt]
+                           (let [retVal (.showSaveDialog fc frame)]
+                             (when (= retVal JFileChooser/APPROVE_OPTION)
+                               (let [^File file (.getSelectedFile fc)]
+                                 (with-swing-error-msg frame "Error while saving"
+                                   (save-image scn file (get-file-extension file)))))))))
   nil)

 ;; save changes
@@ -299,20 +299,20 @@
   saves the image."
   [frame scn buttons]
   (let [saved-layouts (atom {}),
-	^JComboBox combo (make-combo-box buttons @saved-layouts),
-	save-layout   (fn [_]
-			(do-swing
-			 (let [layout (get-layout-from-scene scn),
-			       key    (now)]
-			   (swap! saved-layouts conj [key, layout])
-			   (.addItem combo key))))]
+        ^JComboBox combo (make-combo-box buttons @saved-layouts),
+        save-layout   (fn [_]
+                        (do-swing
+                         (let [layout (get-layout-from-scene scn),
+                               key    (now)]
+                           (swap! saved-layouts conj [key, layout])
+                           (.addItem combo key))))]
     (add-callback-for-hook scn :move-stop save-layout)
     (add-action-listener combo
-			 (fn [^ActionEvent evt]
-			   (do-swing
-			    (let [selected (.. evt getSource getSelectedItem),
-				  layout (@saved-layouts selected)]
-			      (update-layout-of-scene scn layout)))))
+                         (fn [^ActionEvent evt]
+                           (do-swing
+                            (let [selected (.. evt getSource getSelectedItem),
+                                  layout (@saved-layouts selected)]
+                              (update-layout-of-scene scn layout)))))
     (save-layout nil)))

@@ -324,32 +324,32 @@
   `(do
      (make-padding ~buttons)
      ~@(map (fn [method#]
-	      `(~method# ~frame ~scene ~buttons))
-	    (interpose (fn [_ _ buttons]
-			 (make-padding buttons)
-			 (make-separator buttons)
-			 (make-padding buttons))
-		       methods))))
+              `(~method# ~frame ~scene ~buttons))
+            (interpose (fn [_ _ buttons]
+                         (make-padding buttons)
+                         (make-separator buttons)
+                         (make-padding buttons))
+                       methods))))

 ;;; Constructor

-(let [scenes (ref {})]			;memory leak possible
+(let [scenes (ref {})]                  ;memory leak possible

   (defn make-lattice-editor
     "Creates a lattice editor with initial layout."
     [frame layout]
     (let [^JPanel main-panel (JPanel. (BorderLayout.)),

-	  scn (draw-on-scene layout),
-	  ^Canvas canvas (get-canvas-from-scene scn),
-
-	  ^JPanel canvas-panel (JPanel. (BorderLayout.)),
-	  ^JScrollBar hscrollbar (JScrollBar. JScrollBar/HORIZONTAL),
-	  ^JScrollBar vscrollbar (JScrollBar. JScrollBar/VERTICAL),
-
-	  ^JPanel buttons (JPanel.),
-	  box-layout (BoxLayout. buttons BoxLayout/Y_AXIS)]
+          scn (draw-on-scene layout),
+          ^Canvas canvas (get-canvas-from-scene scn),
+
+          ^JPanel canvas-panel (JPanel. (BorderLayout.)),
+          ^JScrollBar hscrollbar (JScrollBar. JScrollBar/HORIZONTAL),
+          ^JScrollBar vscrollbar (JScrollBar. JScrollBar/VERTICAL),
+
+          ^JPanel buttons (JPanel.),
+          box-layout (BoxLayout. buttons BoxLayout/Y_AXIS)]

       ;; save scene
       (dosync (alter scenes assoc main-panel scn))
@@ -359,25 +359,25 @@
       (.setPreferredSize buttons (Dimension. *toolbar-width* 600))
       (with-layout-modifiers frame scn buttons
         toggle-zoom-move
-	change-parameters
-	improve-layout-by-force
-	snapshot-saver
-	export-as-file)
+        change-parameters
+        improve-layout-by-force
+        snapshot-saver
+        export-as-file)

       ;; drawing area
       (doto canvas-panel
-	(.add canvas BorderLayout/CENTER)
-	(.add hscrollbar BorderLayout/SOUTH)
-	(.add vscrollbar BorderLayout/EAST))
+        (.add canvas BorderLayout/CENTER)
+        (.add hscrollbar BorderLayout/SOUTH)
+        (.add vscrollbar BorderLayout/EAST))
       (add-scrollbars scn hscrollbar vscrollbar)

       ;; main panel
       (doto main-panel
-	(.add canvas-panel BorderLayout/CENTER)
-	(.add (JScrollPane. buttons JScrollPane/VERTICAL_SCROLLBAR_ALWAYS
-			    JScrollPane/HORIZONTAL_SCROLLBAR_NEVER)
-	      BorderLayout/WEST)
-	(.setMinimumSize (Dimension. 0 0)))
+        (.add canvas-panel BorderLayout/CENTER)
+        (.add (JScrollPane. buttons JScrollPane/VERTICAL_SCROLLBAR_ALWAYS
+                            JScrollPane/HORIZONTAL_SCROLLBAR_NEVER)
+              BorderLayout/WEST)
+        (.setMinimumSize (Dimension. 0 0)))

       ;;
       main-panel))


Add some logging

Add some logging

--- src/cyanite_remover/metric_store.clj
+++ src/cyanite_remover/metric_store.clj
@@ -67,17 +67,26 @@

 (defmacro log-deletion
   "Log a deletion."
-  [rollup period path & [times]]
-  `(log/debug (str "Removing metrics: "
-                   (string-or-empty ~rollup "rollup: ")
-                   (string-or-empty ~period ", period: ")
-                   (string-or-empty ~path ", path: ")
-                   (string-or-empty (vec ~times) ", time: "))))
+  [log-fn rollup period path & [times times-title]]
+  `(~log-fn (str "Removing metrics: "
+                 (string-or-empty ~rollup "rollup: ")
+                 (string-or-empty ~period ", period: ")
+                 (string-or-empty ~path ", path: ")
+                 (string-or-empty ~times (str ", " ~times-title ": ")))))

 (defmacro log-binding
   "Log a binding."
   [cql values]
   `(log/trace (format "Bind: CQL: %s, values: %s" ~cql ~values)))
+
+(defmacro log-fetching
+  [title rollup period path & [from to]]
+  `(log/debug (str ~title
+                   "rollup: " ~rollup ", "
+                   "period: " ~period ", "
+                   "path: " ~path
+                   (string-or-empty ~from ", from: ")
+                   (string-or-empty ~to ", to: "))))

 (defn- prepare-cqls
   "Prepare a family of CQL queries."
@@ -171,18 +180,16 @@
                 cql (:cql statement)
                 _ (log-binding cql values)
                 query (alia/bind prepared values)]
-            (log/debug (str "Fetching metrics: "
-                            "rollup: " rollup ", "
-                            "period: " period ", "
-                            "path: " path
-                            (string-or-empty from ", from: ")
-                            (string-or-empty to ", to: ")))
-            (alia/execute session query))
+            (log-fetching "Fetching metrics: " rollup period path from to)
+            (let [data (alia/execute session query)]
+              (log-fetching (format "Fetched %s metrics: " (count data)) rollup
+                            period path from to)
+              data))
           (catch Exception e
             (log-error e rollup period path stats-errors)
             :mstore-error)))
       (delete [this tenant rollup period path]
-        (log-deletion rollup period path)
+        (log-deletion log/debug rollup period path)
         (swap! stats-processed inc)
         (let [values (build-values tenant rollup period path)]
           (swap! batch
@@ -191,7 +198,10 @@
                     (do (async/>!! channel {:values (conj % values)}) [])))))
       (delete-times [this tenant rollup period path times]
         (swap! stats-processed inc)
-        (log-deletion rollup period path times)
+        (log-deletion log/debug rollup period path (count times)
+                      "number of time points")
+        (log-deletion log/trace rollup period path (vec times)
+                      "time points")
         (let [series (map #(build-values tenant rollup period path %) times)
               batches (partition-all batch-size series)]
           (dorun (map #(async/>!! channel {:values %


revert :fn-invoke-direct default due to problems in reagent

--- src/main/shadow/build/api.clj
+++ src/main/shadow/build/api.clj
@@ -61,7 +61,10 @@
 (def default-compiler-options
   {:optimizations :none
    :static-fns true
-   :fn-invoke-direct true
+   ;; Seems to be causing issues in reagent
+   ;; TypeError: "'requestAnimationFrame' called on an object that does not implement interface Window"
+   ;; https://github.com/reagent-project/reagent/blob/901607c45fa82868c319fbf87d853b5bab3fa64e/src/reagent/impl/batching.cljs#L16-L24
+   ;; :fn-invoke-direct true
    :elide-asserts false
    :closure-configurators []
    :infer-externs true


Dispatch maps, separated for base vs. logger.

--- src/org/timmc/heim_logger.clj
+++ src/org/timmc/heim_logger.clj
@@ -13,65 +13,50 @@
   [server room]
   (format "wss://%s/room/%s/ws" server (pencode room)))

-(def nick "hillbot")
-
 (defn send-message
   [{:as session :keys [sender wc]} msg]
   (send sender (fn serial-send [_]
                  (doto wc (s/put! (json/generate-string msg)))))
   nil)

-(defn auto-respond
-  [{:as session :keys [state sender]} msg]
-  (dosync
-   (case (:type msg)
-     "hello-event"
-     (do (alter state assoc :whoami (-> msg :data :id))
-         (send-message session {:type "nick" :data {:name nick}}))

-     "ping-event"
+(defn base-dispatch
+  "Base dispatch map for message types."
+  [nick]
+  {"hello-event"
+   (fn [{:as session :keys [state]} msg]
+     (alter state assoc-in [:base :whoami] (-> msg :data :id))
+     (send-message session {:type "nick" :data {:name nick}}))
+
+   "ping-event"
+   (fn [session msg]
      (send-message session
                    {:type "ping-reply"
-                    :data {:time (-> msg :data :time)}})
+                    :data {:time (-> msg :data :time)}}))

-     "snapshot-event"
-     (alter state assoc :lifecycle :joined)
+   "snapshot-event"
+   (fn [{:as session :keys [state]} msg]
+     (alter state assoc-in [:base :lifecycle] :joined))

-     "bounce-event"
-     (alter state assoc :lifecycle :authing)
+   "bounce-event"
+   (fn [{:as session :keys [state]} msg]
+     (alter state assoc-in [:base :lifecycle] :authing))
+   })

-     "send-event"
-     (println (format "%s \"%s\" said:\n%s"
-                      (-> msg :data :sender :id)
-                      (-> msg :data :sender :name)
-                      (-> msg :data :content)))
-
-     "join-event"
-     (println (format "%s \"%s\" joined"
-                      (-> msg :data :id)
-                      (-> msg :data :name)))
-
-     "part-event"
-     (println (format "%s \"%s\" left"
-                      (-> msg :data :id)
-                      (-> msg :data :name)))
-
-     "nick-event"
-     (println (format "%s changed nick from \"%s\" to \"%s\""
-                      (-> msg :data :id)
-                      (-> msg :data :from)
-                      (-> msg :data :to)))
-
-     ("nick-reply")
-     nil
-
-     (prn msg))))
+(defn auto-respond
+  [session msg dispatch]
+  (dosync
+   (when-let [pre-handler (get dispatch :pre)]
+     (pre-handler session msg))
+   (when-let [handler (get dispatch (:type msg)
+                           (:unknown-type dispatch))]
+     (handler session msg))))

 (defn react-to
-  [{:as session :keys [wc state sender]}]
+  [{:as session :keys [wc state sender dispatch]}]
   (while true ;; (not= (:lifecycle @state) :end)
     (let [msg (json/parse-string @(s/take! wc) true)]
-      (auto-respond session msg))))
+      (auto-respond session msg dispatch))))

 (def initial-state
   {:lifecycle :handshake})
@@ -82,7 +67,7 @@
 - :state A ref of session state
 - :wc Websocket client
 - :sender An agent used to send messages in coordination with state changes"
-  [server room]
+  [server room dispatch]
   (let [url (address server room)
         wc @(ah/websocket-client url)
         state (ref initial-state)
@@ -93,7 +78,8 @@
                       :error-mode :fail)
         session {:state state
                  :wc wc
-                 :sender sender}
+                 :sender sender
+                 :dispatch dispatch}
         reactor (future (try (react-to session)
                              (catch Throwable t
                                (.printStackTrace t)
@@ -105,8 +91,39 @@
         (println "Throttled, sleeping.")
         (Thread/sleep 300))

+;; ============
+
+(defn do-nothing
+  [session msg])
+
+(def logger-dispatch
+  (merge
+   (base-dispatch "hillbot")
+   {"send-event"
+    do-nothing
+
+    "join-event"
+    do-nothing
+
+    "part-event"
+    do-nothing
+
+    "nick-event"
+    do-nothing
+
+    "nick-reply"
+    do-nothing
+
+    :pre
+    (fn [session msg]
+      (prn msg))
+
+    :unknown-type
+    (fn [session msg]
+      (println "Unknown event type:" (:type msg)))}))
+
 (defn -main
   "Demo connection to heim"
   [server room]
-  (let [session (run server room)]
+  (let [session (run server room logger-dispatch)]
     ))


remove the unused foo function

remove the unused foo function

--- src/bitfondue/handler.clj
+++ src/bitfondue/handler.clj
@@ -6,8 +6,3 @@
   (GET "/" [] "Success!"))

 (def app app-routes)
-
-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))


still new positive tests

still new positive tests

--- src/paredit/core_commands.clj
+++ src/paredit/core_commands.clj
@@ -558,7 +558,7 @@
                  "(a\n|]" "(a\n  |]"
                  " #(a\n|]" " #(a\n    |]"
                  }]
-      #_["C-j"     :paredit-newline
+      #"C-j"     :paredit-newline
                 {"(ab|cd)" "(ab\n  |cd)"
                  "(ab|     cd)" "(ab\n  |cd)"
                  "   a|" "   a\n   |"


Sort synths and samples.

Sort synths and samples.

--- sonic-jam/src/sonic_jam/core.cljs
+++ sonic-jam/src/sonic_jam/core.cljs
@@ -757,10 +757,10 @@
                     (om/transact! cursor :grids #(assoc % (first params) grid)))
                   (= "/samples" (get message "Address"))
                   (let [samples (js->clj (js/JSON.parse (first params)))]
-                    (om/transact! cursor :samples #(into % samples)))
+                    (om/transact! cursor :samples #(sort (into % samples))))
                   (= "/synths" (get message "Address"))
                   (let [synths (js->clj (js/JSON.parse (first params)))]
-                    (om/transact! cursor :synths #(into % synths)))
+                    (om/transact! cursor :synths #(sort (into % synths))))
                   (= "/errors" (get message "Address"))
                   (let [errors (js->clj (js/JSON.parse (first params)))]
                     (om/update! cursor :errors errors))


fix: [bug] c-data rendering table outside table

--- src/bulk_trader/core.cljs
+++ src/bulk_trader/core.cljs
@@ -123,17 +123,18 @@
                                        [:button {:className "btn btn-default"
                                                  :onClick e-upload-data}
                                         "Upload"]]]]
-                           [:div nil [:div nil [:label nil
-                                                [:button {:className "btn btn-default"
-                                                          :onClick e-edit-data}
-                                                 "Edit Trading Data"]
-                                                [:label nil
-                                                 [:button {:className "btn btn-default"
-                                                           :onClick e-trade}
-                                                  "Execute Trades!!!"]]]]
+                           [:div nil
+                            [:div nil [:label nil
+                                       [:button {:className "btn btn-default"
+                                                 :onClick e-edit-data}
+                                        "Edit Trading Data"]
+                                       [:label nil
+                                        [:button {:className "btn btn-default"
+                                                  :onClick e-trade}
+                                         "Execute Trades!!!"]]]]
                             [:h4 nil "Existing Trading Data:"]
                             [:table {:className "table table-striped table-bordered"}
-                             (map #(om/build c-data %) (:data data))]])]))))
+                             [:tbody (map #(om/build c-data %) (:data data))]]])]))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; roots


Long lines in store.

Long lines in store.

--- src/cbfg/world/store.cljs
+++ src/cbfg/world/store.cljs
@@ -54,43 +54,45 @@

 (defn world-vis-init [el-prefix init-event-delay]
   (let [cmd-inject-ch (chan)]
-    (vis-init (fn [world vis-chs]
-                (let [store (store/make-store world)
-                      store-cmd-handlers (make-store-cmd-handlers store)
-                      cmd-ch (replay-cmd-ch cmd-inject-ch (keys store-cmd-handlers)
-                                            (fn [ev] {:op (.-id (.-target ev))}))
-                      client-hist (atom {}) ; Keyed by opaque -> [request, replies]
-                      in-ch (achan-buf world 100)
-                      out-ch (achan-buf world 0)]
-                  (act-loop client world [num-ins 0 num-outs 0]
-                            (let [[v ch] (aalts client [cmd-ch out-ch])
-                                  ts (+ num-ins num-outs)]
-                              (cond
-                               (= ch cmd-ch) (if (= (:op v) "replay")
-                                               (world-replay in-ch vis-chs world-vis-init el-prefix
-                                                             @client-hist (:replay-to v))
-                                               (let [op (:op v)
-                                                     op-fence (= (get-el-value (str op "-fence")) "1")
-                                                     [params handler] (get store-cmd-handlers op)
-                                                     cmd2 (-> v
-                                                              (assoc :opaque ts)
-                                                              (assoc :fence op-fence))
-                                                     cmd3 (reduce #(if (get %1 (keyword %2))
-                                                                     %1 ; Allows cmd2 to have precedence.
-                                                                     (assoc %1 (keyword %2)
-                                                                            (get-el-value (str op "-" %2))))
-                                                                  cmd2 params)]
-                                                 (render-client-hist (swap! client-hist
-                                                                            #(assoc % ts [cmd3 nil])))
-                                                 (aput client in-ch (assoc cmd3 :rq (handler cmd3)))
-                                                 (recur (inc num-ins) num-outs)))
-                               (= ch out-ch) (when v
-                                               (do (render-client-hist (swap! client-hist
-                                                                              #(update-in % [(:opaque v) 1]
-                                                                                conj [ts v])))
-                                                   (recur num-ins (inc num-outs)))))))
-                  (make-fenced-pump world "main" in-ch out-ch @store-max-inflight true)))
-              el-prefix nil init-event-delay)
+    (vis-init
+     (fn [world vis-chs]
+       (let [store (store/make-store world)
+             store-cmd-handlers (make-store-cmd-handlers store)
+             cmd-ch (replay-cmd-ch cmd-inject-ch (keys store-cmd-handlers)
+                                   (fn [ev] {:op (.-id (.-target ev))}))
+             client-hist (atom {}) ; Keyed by opaque -> [request, replies]
+             in-ch (achan-buf world 100)
+             out-ch (achan-buf world 0)]
+         (act-loop
+          client world [num-ins 0 num-outs 0]
+          (let [[v ch] (aalts client [cmd-ch out-ch])
+                ts (+ num-ins num-outs)]
+            (cond
+             (= ch cmd-ch) (if (= (:op v) "replay")
+                             (world-replay in-ch vis-chs world-vis-init el-prefix
+                                           @client-hist (:replay-to v))
+                             (let [op (:op v)
+                                   op-fence (= (get-el-value (str op "-fence")) "1")
+                                   [params handler] (get store-cmd-handlers op)
+                                   cmd2 (-> v
+                                            (assoc :opaque ts)
+                                            (assoc :fence op-fence))
+                                   cmd3 (reduce #(if (get %1 (keyword %2))
+                                                   %1 ; Allows cmd2 to have precedence.
+                                                   (assoc %1 (keyword %2)
+                                                          (get-el-value (str op "-" %2))))
+                                                cmd2 params)]
+                               (render-client-hist (swap! client-hist
+                                                          #(assoc % ts [cmd3 nil])))
+                               (aput client in-ch (assoc cmd3 :rq (handler cmd3)))
+                               (recur (inc num-ins) num-outs)))
+             (= ch out-ch) (when v
+                             (do (render-client-hist (swap! client-hist
+                                                            #(update-in % [(:opaque v) 1]
+                                                                        conj [ts v])))
+                                 (recur num-ins (inc num-outs)))))))
+         (make-fenced-pump world "main" in-ch out-ch @store-max-inflight true)))
+     el-prefix nil init-event-delay)
     cmd-inject-ch))

 (start-test "store" cbfg.test.store/test)


Fix move-piece

Fix move-piece

--- src/chessground/ctrl.cljs
+++ src/chessground/ctrl.cljs
@@ -51,7 +51,7 @@
     (if (= orig dest)
       ; dragging to same square: replace piece to origin
       (let [new-state (-> state (assoc :dragging false))]
-        [state (fn [root chans] (show/move root orig dest))])
+        [new-state (fn [root chans] (show/move root orig dest))])
       ; moving to a non allowed square:
       (if (and (not (:dragging state)) (data/is-movable? state dest))
         ; when not dragging, allow to reselect movable pieces with a single click/touch


initialize the game state everytime game page initializes

--- src/client/game/core.cljs
+++ src/client/game/core.cljs
@@ -44,21 +44,27 @@
 ;; STATE OF THE GAME
 ;;------------------------------------------------------------

-(def state (atom {:next-piece nil
-                  :piece nil
-                  :position nil
-                  :board empty-board
-
-                  :theme 0
-
-                  :score 0
-                  :level 0
-                  :level-lines 0
-                  :total-lines 0
-
-                  :soft-drop false
-
-                  :quit-chan nil}))
+(def state (atom nil))
+
+(defn init-state!
+  "Set the initial state of the game."
+  []
+  (reset! state {:next-piece nil
+                 :piece nil
+                 :position nil
+                 :board empty-board
+
+                 :theme 0
+
+                 :score 0
+                 :level 0
+                 :level-lines 0
+                 :total-lines 0
+
+                 :soft-drop false
+
+                 :game-over false
+                 :quit-chan (chan)}))

 ; required for pausing/resuming the gravity routine
 (def pause-grav (chan))
@@ -388,8 +394,7 @@

 (defn init []

-  ; Create new quit channel (used to stop go-blocks)
-  (swap! state assoc :quit-chan (chan))
+  (init-state!)

   (size-canvas! "game-canvas" empty-board cell-size rows-cutoff)
   (size-canvas! "next-canvas" (next-piece-board) cell-size)


whitespace

whitespace

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -870,7 +870,6 @@
 (defn url-path [^File f]
   (.getPath (.toURL (.toURI f))))

-
 (defn compile-file*
   ([src dest] (compile-file* src dest nil))
   ([src dest opts]


Munge emitted var names and names in goog.provide and goog.require. Refs #CLJS-23.

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -236,7 +236,7 @@

 (defmethod emit :var
   [{:keys [info env] :as arg}]
-  (emit-wrap env (print (:name info))))
+  (emit-wrap env (print (munge (:name info)))))

 (defmethod emit :meta
   [{:keys [expr meta env]}]
@@ -506,11 +506,11 @@

 (defmethod emit :ns
   [{:keys [name requires requires-macros env]}]
-  (println (str "goog.provide('" name "');"))
+  (println (str "goog.provide('" (munge name) "');"))
   (when-not (= name 'cljs.core)
     (println (str "goog.require('cljs.core');")))
   (doseq [lib (vals requires)]
-    (println (str "goog.require('" lib "');"))))
+    (println (str "goog.require('" (munge lib) "');"))))

 (defmethod emit :deftype*
   [{:keys [t fields]}]


Markdown tweak

Markdown tweak

--- src/clj_bots/pin_ctrl.clj
+++ src/clj_bots/pin_ctrl.clj
@@ -97,7 +97,7 @@
          new-val (if (= current-val :low) :high :low)]
      (write-value! board pin-n new-val))))

-;; ### Edge detection functionality
+;; ## Edge detection functionality

 (defn set-edge!
   "Set the edge direction of a pin. Accepts `:falling`, `:rising` and `:both`."


fix(hover): adjust docstring indent to remove leading spaces

--- ccw.core/src/clj/ccw/core/doc_utils.clj
+++ ccw.core/src/clj/ccw/core/doc_utils.clj
@@ -79,11 +79,25 @@
            :text " ")
          (optional-meta renderer m))))

+(defn adjust-docstring-indent
+  "docstrings Generally have their first line start at column 0, while
+   the following lines may start at column 0, 1, 2, 3, etc.
+   This function finds the minimum number of spaces of each line but the first,
+   and removes this number of spaces from the head of each line, but the first."
+  [d]
+  (let [lines (str/split-lines d)
+        padding (apply min (map #(- (count %) (count (str/triml %))) (remove str/blank? (rest lines))))]
+    (str/join "\n"
+      (concat
+        [(first lines)]
+        (map #(subs % (min padding (count %))) (rest lines))))))
+
 (defn doc-doc [renderer {:keys [doc]}]
   (when-not (str/blank? doc)
-    (let [body (condp = renderer
-                 :html (str "
" doc "
")
-                 :text doc)]
+    (let [d (adjust-docstring-indent doc)
+          body (condp = renderer
+                 :html (str "
" d "
")
+                 :text d)]
       (render-section renderer
                       ClojureEditorMessages/DocUtils_doc_label
                       body))))


Empty tmp directory on each run

Empty tmp directory on each run

--- src/afrey/boot_asset_fingerprint.clj
+++ src/afrey/boot_asset_fingerprint.clj
@@ -8,7 +8,7 @@
 (defn- pod-deps []
   (remove pod/dependency-loaded? '[[enlive "1.1.6"]]))

-(defn- init
+(defn- pod-init
   [fresh-pod]
   (pod/with-eval-in fresh-pod
     (require '[afrey.boot-asset-fingerprint.impl])))
@@ -26,16 +26,16 @@
   [s skip bool "Skips file fingerprinting and replaces each asset url with bare TODO"]

   (let [updated-env (update (core/get-env) :dependencies into (pod-deps))
-        pods (pod/pod-pool updated-env :init init)]
+        pods (pod/pod-pool updated-env :init pod-init)
+        tmp-dir (core/tmp-dir!)]
     (core/cleanup (pods :shutdown))
     (core/with-pre-wrap fileset
+      (core/empty-dir! tmp-dir)
       (let [worker-pod (pods :refresh)
-            tmp-dir (core/tmp-dir!)
             html-files (fileset->html-files fileset)
             file-hashes (into {}
                           (map (juxt :path :hash))
                           (core/output-files fileset))]
-
         (doseq [file html-files
                 :let [path (:path file)
                       input-path (-> file core/tmp-file .getPath)


print output of test tasks instead of swallowing it.

--- src/leiningen/ancient/utils/test.clj
+++ src/leiningen/ancient/utils/test.clj
@@ -10,9 +10,7 @@
   (try
     (let [[task-name & task-args] task]
       (main/info "Running Test Task" (pr-str task) "...")
-      (binding [main/*exit-process?* false
-                main/*info* false
-                main/*debug* false]
+      (binding [main/*exit-process?* false]
         (main/apply-task task-name project task-args)
         true))
     (catch Exception ex false)))


Add the ability for admins to kick users

--- src/braid/client/ui/views/pills.cljs
+++ src/braid/client/ui/views/pills.cljs
@@ -101,6 +101,12 @@
                                         ; [:a.pm "PM"]
                                         ; [:a.mute "Mute"]
       [search-button-view (str "@" (@user :nickname))]
+      (when (and @viewer-admin? (not= user-id @(subscribe [:user-id])))
+        [:button.ban
+         {:on-click (fn [_] (dispatch [:remove-from-group
+                                      {:group-id @open-group-id
+                                       :user-id user-id}]))}
+         "Kick from Group"])
       (when (and @viewer-admin? (not @admin?))
                                         ; TODO: make this not ugly
         [:button.make-admin


Add documentation for concept stability

Add documentation for concept stability

Signed-off-by: Daniel Borchmann <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@algebra20.de>

--- src/main/clojure/conexp/fca/misc.clj
+++ src/main/clojure/conexp/fca/misc.clj
@@ -212,7 +212,7 @@
 ;;; Concept Stability

 (defn intent-stability
-  "TODO."
+  "Compute intent stability of `concept' in `context'."
   [context concept]

   ;; Sanity checking
@@ -226,23 +226,30 @@
   ;; Actual Computation
   (let [[extent intent] [(first concept) (second concept)]
         counter         (fn counter
-                          [fixed-elements rest-elements]
-                          (if (empty? rest-elements)
+                          ;; Perform depth-first search to count all subsets of
+                          ;; `intent' whose derivation in context yields `extent'.
+                          ;; For this we keep the list `fixed-included' of already
+                          ;; considered elements to be included in the target
+                          ;; subset of `intent', and the list `unfixed' of
+                          ;; unconsidered elements for which it is still to be
+                          ;; decided of whether they will be included or not.
+                          [fixed-included unfixed]
+                          (if (empty? unfixed)
                             1
-                            (let [some-element (first rest-elements)]
-                              (+ (counter (conj fixed-elements some-element)
-                                          (disj rest-elements some-element))
-                                 (if (= extent (attribute-derivation context
-                                                                     (union fixed-elements
-                                                                            (disj rest-elements
-                                                                                some-element))))
-                                   (counter fixed-elements (disj rest-elements some-element))
+                            (let [some-element (first unfixed)]
+                              (+ (counter (conj fixed-included some-element)
+                                          (disj unfixed some-element))
+                                 (if (= extent
+                                        (attribute-derivation context
+                                                              (union fixed-included
+                                                                     (disj unfixed some-element))))
+                                   (counter fixed-included (disj unfixed some-element))
                                    0)))))]
     (/ (counter #{} intent)
        (expt 2 (count intent)))))

 (defn extent-stability
-  "TODO."
+  "Compute extent stability of `concept' in `context'."
   [context concept]

   (assert (context? context)


Make `replace-variables` fall back to the literal variable.

--- src-cljs/frontend/utils/docs.cljs
+++ src-cljs/frontend/utils/docs.cljs
@@ -58,13 +58,17 @@
                     (let [[name & path] (string/split m1 #"\.")
                           var (case name
                                 "versions" (aget js/window "CI" "Versions")
-                                "api_data" (aget js/window "circle_api_data"))
-                          val (apply aget var path)
+                                "api_data" (aget js/window "circle_api_data")
+                                nil)
+                          val (when var (apply aget var path))
                           filter (case m2
                                    "code-list" code-list-filter
                                    "api-endpoint" api-endpoint-filter
                                    identity)]
-                      (filter (utils/js->clj-kw val))))))
+                      ;; Fall back to the full string if it doesn't match here.
+                      (if-not val
+                        s
+                        (filter (utils/js->clj-kw val)))))))

 (defn replace-asset-paths [html]
   (string/replace html #"\(asset:/(/.*?)\)"


remove data printing

remove data printing

--- src/cljs/swarmpit/event/handler.cljs
+++ src/cljs/swarmpit/event/handler.cljs
@@ -8,7 +8,6 @@

 (defmethod handle :service-list
   [_ event]
-  (print event)
   (state/update-value [:data] event service-list/cursor))

 (defmethod handle :node-list


Trigger Sign-in and Sign-up by pressing enter

--- src/cljs/todogo_cljs/components.cljs
+++ src/cljs/todogo_cljs/components.cljs
@@ -93,10 +93,10 @@
                  :on-blur     (fn [] (update-todo todo))
                  :on-change   #(re-frame/dispatch [:set-todo (assoc todo :note (-> % .-target .-value))])}]]
     [:div {:class "form-group"}
-     [:a {:class "btn btn-success"
-          :type :submit
-          :on-click (fn [] (update-todo todo))}
-      "Save"]
+     [:input {:class "btn btn-success"
+              :type :submit
+              :on-click (fn [] (update-todo todo))
+              :value "Save"}]
      [:a {:class "button btn btn-danger pull-right"
           :type :submit
           :on-click (fn [] (do (nav! (str "/lists/" (:todo_list_id todo)))
@@ -126,10 +126,10 @@
      [:span "Or go to "]
      [:a {:href "#/sign-up"} "Sign up"]
      [:span " page"]]]
-   [:a {:class "button btn btn-success"
-        :type :submit
-        :on-click (fn [] (sign-in user))}
-    "Sign in"]])
+   [:input {:class "button btn btn-success"
+            :type :submit
+            :on-click (fn [] (sign-in user))
+            :value "Sign in"}]])

 (defn sign-up-form [user]
   [:form {:class "form-signin"
@@ -159,10 +159,10 @@
      [:span "Or go to "]
      [:a {:href "#/sign-in"} "Sign in"]
      [:span " page"]]]
-   [:a {:class "button btn btn-success"
-        :type :submit
-        :on-click (fn [] (sign-up user))}
-    "Sign up"]])
+   [:input {:class "button btn btn-success"
+            :type :submit
+            :on-click (fn [] (sign-up user))
+            :value "Sign up"}]])

 (defn todo-lists [lists]


Also ignore `Error`s during namespace loading.

Attempting to load all namespaces which were loaded client-side will
occasionally generate `Error`s we can safely ignore, such as
`ExceptionInInitializerError`.  Rather than attempt to enumerate all
known such “safe” `Error`s, just log and continue on all `Throwable`s
during initial namespace load.

--- src/clojure/parkour/remote/basic.clj
+++ src/clojure/parkour/remote/basic.clj
@@ -16,7 +16,7 @@
   [ns]
   (try
     (returning true (require ns))
-    (catch Exception e
+    (catch Throwable e
       (returning false
         (log/warnf e "%s: failed to load namespace." ns)))))


Fized typos in docstrings

Fized typos in docstrings

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -387,7 +387,7 @@
       (get-layout-from-scene scn)))

   (defn- get-scene-from-panel
-    "If the given panel contains a lattice editor, retusnt eh
+    "If the given panel contains a lattice editor, returns the
     corresponding scene, nil otherwise."
     [panel]
     (get @scenes panel nil))
@@ -400,7 +400,7 @@
 (defnk draw-lattice
   "Draws given lattice with given layout-function on a canvas. Returns
   the panel of the lattice editor. The following options are allowed,
-  their default values are given in paranthese:
+  their default values are given in parantheses:

     - layout-fn (*standard-layout-function*)
     - visible (true)