Pull render-menu function out to run in IDidMount and IDidUpdate lifecycle events.

--- sonic-jam/src/sonic_jam/core.cljs
+++ sonic-jam/src/sonic_jam/core.cljs
@@ -306,26 +306,28 @@
 (defn select-editor-builder
   ([key options-ref]
    (fn [{:keys [cursor id set-state-ch]} owner]
+     (let [render-menu #(let [node (om/get-node owner)
+                             menu (PopupMenu.)
+                             options (om/observe owner (options-ref))
+                             click-fn (fn [value]
+                                        (om/transact! cursor (fn [c] (assoc c key value)))
+                                        (go (>! set-state-ch id)))]
+                         (.attach menu node Corner.BOTTOM_START)
+                         (doall (map (fn [o] (.addItem menu (MenuItem. o))) options))
+                         (.render menu)
+                         (gevents/listen menu Component.EventType.ACTION
+                                         (fn [e] (let [value (.getValue e.target)]
+                                                   (om/update-state! owner (fn [s] (merge s {:state :init})))
+                                                   (click-fn value)))))]
      (reify
        om/IInitState
        (init-state [_]
          {:state :init
           :id (new-id)})
        om/IDidMount
-       (did-mount [_]
-         (let [node (om/get-node owner)
-               menu (PopupMenu.)
-               options (om/observe owner (options-ref))
-               click-fn (fn [value]
-                          (om/transact! cursor #(assoc % key value))
-                          (go (>! set-state-ch id)))]
-           (.attach menu node Corner.BOTTOM_START)
-           (doall (map #(.addItem menu (MenuItem. %)) options))
-           (.render menu)
-           (gevents/listen menu Component.EventType.ACTION
-                           (fn [e] (let [value (.getValue e.target)]
-                                     (om/update-state! owner (fn [s] (merge s {:state :init})))
-                                                                       (click-fn value))))))
+       (did-mount [_] (render-menu))
+       om/IDidUpdate
+       (did-update [_ _ _] (render-menu))
        om/IRenderState
        (render-state [_ state]
          (if (and (= :init (:state state))
@@ -335,7 +337,7 @@
                           :style #js {:color (:link theme)}}
                      (get cursor key))
            (dom/div #js {:className "goog-flat-menu-button"}
-                    (str "Choose a " key))))))))
+                    (str "Choose a " key)))))))))

 (def grid-type-editor
   (select-editor-builder "grid-type" grid-types))
@@ -364,82 +366,84 @@
     copy-id))

 (defn type-editor [{:keys [cursor id set-state-ch]} owner]
-  (reify
-    om/IInitState
-    (init-state [_]
-      {:state :init
-       :id (new-id)
-       :grid-copy-menu {}})
-    om/IDidMount
-    (did-mount [_]
-      (let [node (om/get-node owner)
-            grid-copy-menu (:grid-copy-menu (om/get-state owner))
-            menu (PopupMenu.)
-            sub-menu (SubMenu. "grid")
-            click-fn (fn [value]
-                       (cond
-                         (contains? grid-copy-menu value)
-                         (let [grid-id (get grid-copy-menu value)
-                               copy-id (deep-copy (om/observe owner (grids)) grid-id set-state-ch)]
-                           (om/transact! cursor (fn [c] (assoc c
-                                                               "type" "grid"
-                                                               "synth-params" {}
-                                                               "sample-params" {}
-                                                               "grid-id" copy-id))))
-                         (= "new" value)
-                         (let [grid-id (new-id)
-                               grid {"name" ""
-                                     "id" grid-id
-                                     "bpc" "1"
-                                     "tracks" []}]
-                           (om/transact! cursor (fn [c] (assoc c
-                                                               "type" "grid"
-                                                               "synth-params" {}
-                                                               "sample-params" {}
-                                                               "grid-id" grid-id)))
-                           (om/transact! (om/observe owner (grids))
-                                         (fn [c] (assoc c (get grid "id") grid)))
-                           (go (>! set-state-ch grid-id)))
-                         (= "sample" value)
-                         (om/transact! cursor (fn [c] (assoc c
-                                                             "type" value
-                                                             "sample-params" {})))
-                         (= "synth" value)
-                         (om/transact! cursor (fn [c] (assoc c
-                                                             "type" value
-                                                             "synth-params" {})))
-                         :else (print (str "Could not find: " value ". Was it renamed?")))
-                       (go (>! set-state-ch id)))]
-        (.attach menu node Corner.BOTTOM_START)
-        (.addItem menu (MenuItem. "synth"))
-        (.addItem menu (MenuItem. "sample"))
-        (.addItem menu sub-menu)
-        (.addItem sub-menu (MenuItem. "new"))
-        (doall (map #(.addItem sub-menu (MenuItem. %)) (keys grid-copy-menu)))
-        (.render menu)
-        (gevents/listen menu Component.EventType.ACTION
-                        (fn [e] (let [value (.getValue e.target)]
-                                  (om/update-state! owner (fn [s] (merge s {:state :init})))
-                                  (click-fn value))))))
-    om/IRenderState
-    (render-state [_ state]
-      (let [grid-copy-menu (apply hash-map
-                                  (apply concat (map #(let [id (first %)
-                                                            grid (second %)]
-                                                        (if (and (contains? grid "name")
-                                                                 (not (= "" (get grid "name"))))
-                                                          [(str "copy of " (get grid "name") " (" id ")") id]
-                                                          [(str "copy of " id) id]))
-                                                     (om/observe owner (grids)))))]
-        (om/set-state! owner :grid-copy-menu grid-copy-menu))
-      (if (and (= :init (:state state))
-               (contains? cursor "type")
-               (not (= "none" (get cursor "type"))))
-        (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :selecting})))
-                       :style #js {:color (:link theme)}}
-                  (get cursor "type"))
-        (dom/div #js {:className "goog-flat-menu-button"}
-                 (str "Choose a type"))))))
+  (let [render-menu #(let [node (om/get-node owner)
+                           grid-copy-menu (:grid-copy-menu (om/get-state owner))
+                           menu (PopupMenu.)
+                           sub-menu (SubMenu. "grid")
+                           click-fn (fn [value]
+                                      (cond
+                                        (contains? grid-copy-menu value)
+                                        (let [grid-id (get grid-copy-menu value)
+                                              copy-id (deep-copy (om/observe owner (grids)) grid-id set-state-ch)]
+                                          (om/transact! cursor (fn [c] (assoc c
+                                                                              "type" "grid"
+                                                                              "synth-params" {}
+                                                                              "sample-params" {}
+                                                                              "grid-id" copy-id))))
+                                        (= "new" value)
+                                        (let [grid-id (new-id)
+                                              grid {"name" ""
+                                                    "id" grid-id
+                                                    "bpc" "1"
+                                                    "tracks" []}]
+                                          (om/transact! cursor (fn [c] (assoc c
+                                                                              "type" "grid"
+                                                                              "synth-params" {}
+                                                                              "sample-params" {}
+                                                                              "grid-id" grid-id)))
+                                          (om/transact! (om/observe owner (grids))
+                                                        (fn [c] (assoc c (get grid "id") grid)))
+                                          (go (>! set-state-ch grid-id)))
+                                        (= "sample" value)
+                                        (om/transact! cursor (fn [c] (assoc c
+                                                                            "type" value
+                                                                            "sample-params" {})))
+                                        (= "synth" value)
+                                        (om/transact! cursor (fn [c] (assoc c
+                                                                            "type" value
+                                                                            "synth-params" {})))
+                                        :else (print (str "Could not find: " value ". Was it renamed?")))
+                                      (go (>! set-state-ch id)))]
+                       (.attach menu node Corner.BOTTOM_START)
+                       (.addItem menu (MenuItem. "synth"))
+                       (.addItem menu (MenuItem. "sample"))
+                       (.addItem menu sub-menu)
+                       (.addItem sub-menu (MenuItem. "new"))
+                       (doall (map (fn [o] (.addItem sub-menu (MenuItem. o))) (keys grid-copy-menu)))
+                       (.render menu)
+                       (gevents/listen menu Component.EventType.ACTION
+                                       (fn [e] (let [value (.getValue e.target)]
+                                                 (om/update-state! owner (fn [s] (merge s {:state :init})))
+                                                 (click-fn value)))))]
+    (reify
+      om/IInitState
+      (init-state [_]
+        {:state :init
+         :id (new-id)
+         :grid-copy-menu {}})
+      om/IDidMount
+      (did-mount [_] (render-menu))
+      om/IDidUpdate
+      (did-update [_ _ _] (render-menu))
+      om/IRenderState
+      (render-state [_ state]
+        (let [grid-copy-menu (apply hash-map
+                                    (apply concat (map #(let [id (first %)
+                                                              grid (second %)]
+                                                          (if (and (contains? grid "name")
+                                                                   (not (= "" (get grid "name"))))
+                                                            [(str "copy of " (get grid "name") " (" id ")") id]
+                                                            [(str "copy of " id) id]))
+                                                       (om/observe owner (grids)))))]
+          (om/set-state! owner :grid-copy-menu grid-copy-menu))
+        (if (and (= :init (:state state))
+                 (contains? cursor "type")
+                 (not (= "none" (get cursor "type"))))
+          (dom/span #js {:onClick #(om/update-state! owner (fn [s] (merge s {:state :selecting})))
+                         :style #js {:color (:link theme)}}
+                    (get cursor "type"))
+          (dom/div #js {:className "goog-flat-menu-button"}
+                   (str "Choose a type")))))))

 (defn fx-editor [{:keys [cursor id set-state-ch]} owner]
   (reify


Make the camera 20 world units high, while maintaining aspect ratio

--- totem-destroyer/desktop/src-common/totem_destroyer/core.clj
+++ totem-destroyer/desktop/src-common/totem_destroyer/core.clj
@@ -133,7 +133,11 @@
   :on-touch-down
   (fn [screen entities]
     (if-let [brick (get-entity-at-cursor screen entities)]
-      (remove #(= brick %) entities))))
+      (remove #(= brick %) entities)))
+
+  :on-resize
+  (fn [screen entities]
+    (height! screen 16)))

 (defgame totem-destroyer-game
   :on-create


Temporarily enabling TRACE for org.infinispan

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -239,12 +239,16 @@
 (defn disable-security [loc]
   (zip/edit loc update-in [:attrs] dissoc :security-realm))

+(defn logger [category level]
+  {:tag :logger
+   :attrs {:category category}
+   :content [{:tag :level
+              :attrs {:name level}}]})
+
 (defn add-logger-levels [loc]
-  (zip/append-child (zip/right
-                     (zip/insert-right loc
-                                       {:tag :logger
-                                        :attrs {:category "org.jboss.as.dependency.private"}}))
-                    {:tag :level :attrs {:name "ERROR"}}))
+  (-> loc
+      (zip/insert-right (logger "org.jboss.as.dependency.private" "ERROR"))
+      (zip/insert-right (logger "org.infinispan" "TRACE"))))

 (defn disable-hq-security [loc]
   (zip/append-child loc {:tag :security-enabled :content ["false"]}))


upgrade  to clojure 1.7.0-RC1 upgrade to clojurescript 0.0-3308 upgrade to figwheel  0.3.3

--- examples/hello-famous/project.clj
+++ examples/hello-famous/project.clj
@@ -4,9 +4,9 @@
             :license {:name "Eclipse Public License"
                       :url  "http://www.eclipse.org/legal/epl-v10.html"}

-            :dependencies [[org.clojure/clojure "1.6.0"]
-                           [org.clojure/clojurescript "0.0-3208"]
-                           [figwheel "0.2.5"]
+            :dependencies [[org.clojure/clojure "1.7.0-RC1"]
+                           [org.clojure/clojurescript "0.0-3308"]
+                           [figwheel "0.3.3"]
                            [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                            [com.famous/famous "0.5.1"]
                            [reagent "0.5.0"]]


Add String type support for client scopes

--- src/cylon/oauth/server/server.clj
+++ src/cylon/oauth/server/server.clj
@@ -91,7 +91,7 @@
                    client-id "client_id"
                    scopes-param "scope"
                    state "state"} (-> req params-request :query-params)
-                   requested-scopes (decode-scope scopes-param)]
+                   requested-scopes (decode-scope scopes-param (keyword? (first scopes)))]

               (case response-type
                 "code"


Extract out subscriptions

Extract out subscriptions

--- src/day8/re_frame/trace/subs.cljs
+++ src/day8/re_frame/trace/subs.cljs
@@ -2,24 +2,44 @@
   (:require [mranderson047.re-frame.v0v10v2.re-frame.core :as rf]))

 (rf/reg-sub
+  :settings/root
+  (fn [db _]
+    (get db :settings)))
+
+(rf/reg-sub
   :settings/panel-width%
-  (fn [db _]
-    (get-in db [:settings :panel-width%])))
+  :<- [:settings/root]
+  (fn [settings _]
+    (get settings :panel-width%)))

 (rf/reg-sub
   :settings/show-panel?
-  (fn [db _]
-    (get-in db [:settings :show-panel?])))
+  :<- [:settings/root]
+  (fn [settings _]
+    (get settings :show-panel?)))

 (rf/reg-sub
   :settings/selected-tab
+  :<- [:settings/root]
+  (fn [settings _]
+    (get settings :selected-tab)))
+
+(rf/reg-sub
+  :app-db/root
   (fn [db _]
-    (get-in db [:settings :selected-tab])))
+    (get db :app-db)))

 (rf/reg-sub
   :app-db/paths
-  (fn [db _]
-    (get-in db [:app-db :paths])))
+  :<- [:app-db/root]
+  (fn [app-db-settings _]
+    (get app-db-settings :paths)))
+
+(rf/reg-sub
+  :app-db/search-string
+  :<- [:app-db/root]
+  (fn [app-db-settings _]
+    (get app-db-settings :search-string)))

 (rf/reg-sub
   :traces/filter-items


Make Complete work with empty input (INTERIM CHECK-IN)

--- src/de/kotka/vimclojure/nails.clj
+++ src/de/kotka/vimclojure/nails.clj
@@ -158,11 +158,15 @@
   "Usage: ng de.kotka.vimclojure.nails.Complete"
   [[nspace n "Start completion in this namespace." "user"]]
   (let [_      (resolve-and-load-namespace nspace)
-        sym    (read)
-        symnam (name sym)
-        symspc (namespace sym)]
-    (println
-      (clj->vim
-        (map (fn [[sym sym-var]]
-               (make-completion-item sym sym-var))
-             (complete-var-in-namespace symnam (if symspc symspc nspace)))))))
+        eof    (Object.)
+        sym    (read *in* false eof)]
+    (if (not= sym eof)
+      (let [symnam (name sym)
+            symspc (namespace sym)]
+        (when (not= sym eof)
+          (-> (map (fn [[sym sym-var]]
+                     (make-completion-item sym sym-var))
+                   (complete-var-in-namespace symnam (if symspc symspc nspace)))
+            clj->vim
+            println)))
+      (println "[]"))))


update trig arg docstring

update trig arg docstring

--- src/overtone/sc/machinery/ugen/metadata/trig.clj
+++ src/overtone/sc/machinery/ugen/metadata/trig.clj
@@ -19,7 +19,7 @@

       {:name "Trig1"
        :args [{:name "trig", :default 0.0 :doc "trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive."}
-              {:name "dur", :default 0.1 :doc "duration of the trigger output."}]
+              {:name "dur", :default 0.1 :doc "duration of the trigger output in seconds."}]
        :signal-range :unipolar
        :default-rate :kr
        :doc "outputs one for dur seconds whenever the input goes from negative to positive"}


tweak reader conditional

tweak reader conditional

--- src/main/compassus/core.cljc
+++ src/main/compassus/core.cljc
@@ -1,6 +1,6 @@
 (ns compassus.core
   #?(:clj (:refer-clojure :exclude [read]))
-  (:require #?@(:cljs [[goog.object :as gobj]])
+  (:require #?(:cljs [goog.object :as gobj])
             [om.next :as om #?(:clj  :refer
                                :cljs :refer-macros) [ui]]
             [om.util :as util]


separate parser generation into 2 fns

separate parser generation into 2 fns

--- src/main/compassus/core.cljs
+++ src/main/compassus/core.cljs
@@ -74,36 +74,41 @@
      (om/transact! reconciler (cond-> `[(update-route! {:route ~next-route})]
                                 queue? (conj ::route-data))))))

+(defn- generate-parser-read [user-parser]
+  (fn read [{:keys [state query target] :as env} k params]
+    (let [st @state
+          top-level-prop? (nil? query)
+          [route _] (get st ::route)
+          query (cond-> query
+                  ;; not full-query
+                  (map? query) (select-keys [route]))]
+      {:value
+       (if top-level-prop?
+         (get st k)
+         (let [ret (user-parser (merge env {:parser user-parser}) [query] target)]
+           (get ret route)))})))
+
+(defn- generate-parser-mutate [user-parser]
+  (fn mutate [{:keys [state target ast] :as env} k params]
+    (let [tx [(om/ast->query ast)]
+          update-route? (symbol-identical? k 'compassus.core/update-route!)]
+      (if update-route?
+        (let [{:keys [route]} params]
+          {:value {:keys [::route ::route-data]}
+           :action #(swap! state assoc ::route route)})
+        ;; TODO: this is potentially a problem for returning mutation results
+        ;; maybe we need to wrap it inside an `:action` thunk
+        ;; probably also problematic
+        (user-parser (assoc env :parser user-parser) tx target)))))
+
 ;; TODO:
 ;; - probably need to make this a multimethod, because of ::route and ::route-data
-;; - maybe separate this out into 2 or 3 fns
 ;; - check behavior for (not= target nil)
 ;; - check behavior for `full-query`
 (defn- make-parser [user-parser]
-  (letfn [(read [{:keys [state query target] :as env} k params]
-            (let [st @state
-                  top-level-prop? (nil? query)
-                  [route _] (get st ::route)
-                  query (cond-> query
-                          ;; not full-query
-                          (map? query) (select-keys [route]))]
-              {:value
-               (if top-level-prop?
-                 (get st k)
-                 (let [ret (user-parser (merge env {:parser user-parser}) [query] target)]
-                   (get ret route)))}))
-          (mutate [{:keys [state target ast] :as env} k params]
-            (let [tx [(om/ast->query ast)]
-                  update-route? (symbol-identical? k 'compassus.core/update-route!)]
-              (if update-route?
-                (let [{:keys [route]} params]
-                  {:value {:keys [::route ::route-data]}
-                   :action #(swap! state assoc ::route route)})
-                ;; TODO: this is potentially a problem for returning mutation results
-                ;; maybe we need to wrap it inside an `:action` thunk
-                ;; probably also problematic
-                (user-parser (assoc env :parser user-parser) tx target))))]
-    (om/parser {:read read :mutate mutate})))
+  (om/parser {:read (generate-parser-read user-parser)
+              :mutate (generate-parser-mutate user-parser)}))
+

 (defn- find-index-route [routes]
   (let [first-route (ffirst routes)


[#1078] Improve error reporting if source dataset has been deleted

--- backend/src/akvo/lumen/transformation/merge_columns.clj
+++ backend/src/akvo/lumen/transformation/merge_columns.clj
@@ -71,7 +71,10 @@
   [conn table-name columns op-spec]
   (let [source (get-in op-spec ["args" "source"])
         source-dataset-id (get source "datasetId")
-        source-dataset (latest-dataset-version-by-dataset-id conn {:dataset-id source-dataset-id})
+        source-dataset (if-let [source-dataset (latest-dataset-version-by-dataset-id conn {:dataset-id source-dataset-id})]
+                         source-dataset
+                         (throw (ex-info (format "Dataset %s does not exist" source-dataset-id)
+                                         {:spec op-spec})))
         source-table-name (:table-name source-dataset)
         source-key-column-name (get source "keyColumn")
         source-merge-column-names (get source "mergeColumns")


fix test for clojure 1.3

fix test for clojure 1.3

--- src/test/clojure/clojure/tools/metadata_test.clj
+++ src/test/clojure/clojure/tools/metadata_test.clj
@@ -1,6 +1,6 @@
 (ns clojure.tools.metadata-test
-  (:refer-clojure :exclude [read *default-data-reader-fn*])
-  (:use [clojure.tools.reader :only [read *default-data-reader-fn*]]
+  (:refer-clojure :exclude [read *default-data-reader-fn* read-string])
+  (:use [clojure.tools.reader :only [read *default-data-reader-fn* read-string]]
         [clojure.test :only [deftest is]])
   (:require [clojure.tools.reader.reader-types :as reader-types]
             [clojure.string :as str]
@@ -148,7 +148,7 @@
          ^{:line 4, :column 25, :end-line 4, :end-column 27, :file "vector.clj"}
          [],
          :line 4, :column 29, :end-line 4, :end-column 32, :file "vector.clj"}))
-     #inst "2010-11-12T13:14:15.666-00:00")
+     (read-string "#inst \"2010-11-12T13:14:15.666-00:00\""))
     {:line 1 :column 1 :end-line 6 :end-column 3 :file "vector.clj"}))

 (deftest read-metadata2


Bump up permgen.

Bump up permgen.

--- support/fntest/src/main/clojure/fntest/jboss.clj
+++ support/fntest/src/main/clojure/fntest/jboss.clj
@@ -58,7 +58,7 @@
 (defn start-command []
   (let [java-home (System/getProperty "java.home")
         jboss-home (.getCanonicalFile (io/file home))]
-  (str java-home "/bin/java -Xms64m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.boot.log.file=" jboss-home "/standalone/log/boot.log -Dlogging.configuration=file:" jboss-home "/standalone/configuration/logging.properties -jar " jboss-home "/jboss-modules.jar -mp " jboss-home "/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=" jboss-home)))
+  (str java-home "/bin/java -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.boot.log.file=" jboss-home "/standalone/log/boot.log -Dlogging.configuration=file:" jboss-home "/standalone/configuration/logging.properties -jar " jboss-home "/jboss-modules.jar -mp " jboss-home "/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=" jboss-home)))

 (defn start
   "Start up a JBoss or toss exception if one is already running"


Remove midi event keys from previous version - overtone/midi now uses the :command key not :cmd.

--- src/overtone/studio/midi.clj
+++ src/overtone/studio/midi.clj
@@ -13,8 +13,7 @@
 (defn midi-event
   "Trigger a global midi event."
   [dev msg & [ts]]
-  (let [command (or (:cmd msg)
-                    (:command msg))]
+  (let [command (:command msg)]
     (event [:midi command] msg)
     (event [:midi-device (dev :vendor) (dev :name) (dev :description) command] msg)))


Make the jdbc monkeypatching work under 1.3.0 [IMMUTANT-85]

--- modules/xa/src/main/clojure/immutant/xa/transaction.clj
+++ modules/xa/src/main/clojure/immutant/xa/transaction.clj
@@ -59,10 +59,11 @@

 ;;; Monkey-patchery to prevent calls to setAutoCommit/commit/rollback on connection
 (in-ns 'clojure.java.jdbc)
+(def ^{:dynamic true} xa-transaction* nil)
 (clojure.core/refer 'clojure.core :exclude '[resultset-seq])
 (try
   (use '[clojure.java.jdbc :only [transaction*]])
-  (def ^{:dynamic true} xa-transaction* @(resolve 'transaction*))
+  (alter-var-root #'xa-transaction* (constantly @(resolve 'transaction*)))
   (defn transaction* [& args] (apply xa-transaction* args))
   (catch Throwable e
     (clojure.tools.logging/warn "Using XA with java.jdbc 0.1.x is not supported:" (.getMessage e))))


Add test for malformed JSON.

Add test for malformed JSON.

--- spec/freefrog/rest_spec.clj
+++ spec/freefrog/rest_spec.clj
@@ -57,4 +57,14 @@
                                      :body (json/generate-string
                                              {:name "Test Circle!"})}))
     (it "should return a bad request"
-      (should= 400 (:status @response)))))+      (should= 400 (:status @response))
+      (should-contain "IllegalArgumentException" (:body @response))))
+
+  (context "upon creating a circle with malformed json"
+    (with response (http-client/post "http://localhost:3000/circles"
+                                    {:throw-exceptions false
+                                     :content-type :json
+                                     :body "{\"name\" :: \"Bill\"}"}))
+    (it "should return a bad request"
+      (should= 400 (:status @response))
+      (should-contain "IOException" (:body @response)))))


Fix missing model refer

Fix missing model refer

--- src/onyx/doc.cljc
+++ src/onyx/doc.cljc
@@ -1,5 +1,5 @@
 (ns onyx.doc
-  (:require [onyx.information-model]))
+  (:require [onyx.information-model :refer [model]]))

 (defn lookup-categories [model kw]
   (->> (keys model)


Fixed "missing tea list" problem.  Two fwd, one back.

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -71,12 +71,12 @@
 (def edit-tea-snap (reagent/atom nil))
 (def show-edit (reagent/atom false))

-(def app-db (reagent/atom {:teas-list nil
+(defonce app-db (reagent/atom {:teas-list nil}
                            :new-tea nil
                            :edit-tea-id nil
                            :edit-tea nil
                            :edit-tea-snap nil
-                           :show-edit false}))
+                           :show-edit false))

 (defn get-teas
   "Gets the list of all teas from the website"
@@ -120,6 +120,7 @@
   "The page component for listing tea"
   []
   (fn []
+    (get-teas)
     [:div.row
      [:ul
       [:table.table.table-striped


Define layouts.html/eval-with-context.

Define layouts.html/eval-with-context.

Takes a list containg clojure expressions and evaluates it in
a generated namespace. Define parses and tags for easy consumption.

--- src/incise/layouts/html.clj
+++ src/incise/layouts/html.clj
@@ -56,6 +56,15 @@
                (fn [f# & args#] (~replacement (apply f# args#))))
      ""))

+(defn eval-with-context [code]
+  (binding [*ns* (create-ns `user#)]
+    (require '[clojure.core :refer :all])
+    (require '[incise.layouts.html :refer [*site-options* *parse*]])
+    (eval `(do
+             (def ~'parses (vals @incise.parsers.core/parses))
+             (def ~'tags (incise.utils/slot-by :tags ~'parses))
+             ~@code))))
+
 (defn use-layout
   "Use the given layout function by calling it with *site-options* and *parse*."
   [layout-fn] (layout-fn *site-options* *parse*))


font-available? doesn't blow up

font-available? doesn't blow up

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -921,7 +921,7 @@
   "Returns true if font (specified as a string) is available on this
   system, false otherwise"
   [font-str]
-  (if (some #{font-str} available-fonts)
+  (if (some #{font-str} (available-fonts))
     true
     false))


Paste in .

Paste in .

--- src/klangmeister/music.cljs
+++ src/klangmeister/music.cljs
@@ -47,7 +47,21 @@
      (before? a b) (cons a (lazy-seq (with other-as bs)))
      :otherwise    (cons b (lazy-seq (with as other-bs)))))
   ([as bs & others] (reduce with (cons as (cons bs others)))))
-  ")
+
+(defn after [wait notes]
+  (where :time (from wait) notes))
+
+(defn duration
+  [notes]
+  (let [length (fn [{:keys [time duration]}] (+ time duration))]
+    (->> notes
+         (map length)
+         (reduce max 0))))
+
+(defn then [later earlier]
+  (->> later
+       (after (duration earlier))
+       (with earlier)))")

 (defn play-on! [instrument! notes]
   (doseq [{:keys [pitch time duration]} notes]


add activate/deactivate functions for giving/removing "active" class on view divs

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -1,6 +1,7 @@
 (ns ^{:doc "Render the views for the application."}
   one.sample.view
-  (:use [domina :only [append! destroy-children!]]
+  (:use [domina :only [append! destroy-children! remove-class! add-class!
+                       nodes]]
         [query  :only [$]])
   (:require-macros [one.sample.snippets :as snippets])
   (:require [one.dispatch               :as dispatch]))
@@ -15,12 +16,24 @@
   :state)

 (defn load-templates []
-  (let [content ($ "#content")
-        login (:login snippets)]
+  (let [content ($ "#content")]
     (destroy-children! content)
-    (append! content login)))
+    (append! content (:login snippets))
+    (append! content (:workspace snippets))))

 (defmethod render :init [_]
   (load-templates))
-
+
+(defn- deactivate [id-or-node-or-nodes]
+  (remove-class! (if (string? id-or-node-or-nodes)
+                   ($ id-or-node-or-nodes)
+                   (nodes id-or-node-or-nodes))
+                 "active"))
+
+(defn- activate [id-or-node-or-nodes]
+  (add-class! (if (string? id-or-node-or-nodes)
+                ($ id-or-node-or-nodes)
+                (nodes id-or-node-or-nodes))
+              "active"))
+
 (dispatch/react-to #{:state-change} (fn [_ m] (render m)))


formatting, writing problems in fore-prob function

--- src/leiningen/fore_prob.clj
+++ src/leiningen/fore_prob.clj
@@ -134,7 +134,7 @@
       (println "tests already exist, skipping."))
     (if-not (has-problem-src? src probfn)
       (write-problem-src project prob)
-      (println "source already exist, skipping."))))
+      (println "source already exists, skipping."))))

 ;; == 4clojure API interaction ==

@@ -161,5 +161,10 @@
   "main function, used by leiningen"
   [project prob-num]
   (if-let [prob (get-prob prob-num)]
-    (println "Problem" (str \" (prob :title) \") "added!")
+    (try
+      (write-prob project prob)
+      (println "Problem" (str \" (prob :title) \") "added!")
+      (catch Exception e
+        (println "An error occured when writing the problem."
+                 (. e getMessage))))
     (println (str "Cannot get problem " prob-num "."))))


remove println ^^

remove println ^^

--- src/leiningen/new/closp.clj
+++ src/leiningen/new/closp.clj
@@ -23,9 +23,6 @@
         _ (io/make-parents o)
         is (io/input-stream i)
         os (io/output-stream o)]
-    ;(println "i" i)
-    ;(println "o: " o)
-    (println "name-proj: " name-proj)
     (io/copy is os)
     (.flush os)))


Default to returning first last-known-ccr result, as it should be

--- src/route_ccrs/route_ccr.clj
+++ src/route_ccrs/route_ccr.clj
@@ -8,7 +8,10 @@
 (def buffer-factor 1.5)

 (defquery best-end-date "route_ccrs/sql/best_end_date.sql")
-(defquery get-last-known-ccr "route_ccrs/sql/last_known_ccr.sql")
+(defquery last-known-ccr "route_ccrs/sql/last_known_ccr.sql")
+
+(defn get-last-known-ccr [r opt]
+  (last-known-ccr r (merge {:result-set-fn first} opt)))

 (defquery insert-history-entry! "route_ccrs/sql/insert_history.sql")
 (defquery insert-current-ccr! "route_ccrs/sql/insert_ccr.sql")


add link to generate slack hook url, fixes #87

--- priv/ui/src/cljs/holiday_ping_ui/views.cljs
+++ priv/ui/src/cljs/holiday_ping_ui/views.cljs
@@ -169,10 +169,13 @@
                                      :options  ["slack"]
                                      :value    "slack"
                                      :required true}
-                                    {:key      :url
-                                     :type     "text"
-                                     :label    "Slack hook url"
-                                     :required true}
+                                    {:key       :url
+                                     :type      "text"
+                                     :label     "Slack hook url"
+                                     :help-text [:span "You can get the hook url "
+                                                 [:a {:href   "https://my.slack.com/services/new/incoming-webhook/"
+                                                      :target "blank"} "here."]]
+                                     :required  true}
                                     {:key       :channels
                                      :type      "text"
                                      :label     "Targets"
@@ -203,11 +206,14 @@
                                      :options  ["slack"]
                                      :value    "slack"
                                      :required true}
-                                    {:key      :url
-                                     :type     "text"
-                                     :label    "Slack hook url"
-                                     :value    (get-in channel [:configuration :url])
-                                     :required true}
+                                    {:key       :url
+                                     :type      "text"
+                                     :label     "Slack hook url"
+                                     :value     (get-in channel [:configuration :url])
+                                     :help-text [:span "You can get the hook url "
+                                                 [:a {:href   "https://my.slack.com/services/new/incoming-webhook/"
+                                                      :target "blank"} "here."]]
+                                     :required  true}
                                     {:key       :channels
                                      :type      "text"
                                      :label     "Targets"


shorten more

shorten more

--- boot/core/src/boot/tmpregistry.clj
+++ boot/core/src/boot/tmpregistry.clj
@@ -22,14 +22,15 @@
     (doseq [child (.listFiles delete)] (delete! child))
     (.delete delete)))

-(defn pid! []
-  (format "%s-%s"
+(defn dir-id []
+  (apply str
     (-> (->> (.. ManagementFactory getRuntimeMXBean getName)
           (take-while (partial not= \@))
           (apply str)
           Long/parseLong)
       (Long/toString 36))
-    (Long/toString @pod/pod-id 36)))
+    (when-not (= 1 @pod/pod-id)
+      ["-" (Long/toString @pod/pod-id 36)])))

 (defn mark-delete-me! [dir]
   #(when (.exists dir) (.createNewFile (io/file dir ".delete-me"))))
@@ -108,4 +109,4 @@
     (when (f/parent? dir f) f)))

 (defn registry [dir]
-  (TmpRegistry. (io/file dir (pid!)) (atom false) (atom {}) (atom {})))
+  (TmpRegistry. (io/file dir (dir-id)) (atom false) (atom {}) (atom {})))


Assert units

Assert units

--- src/tick/core.clj
+++ src/tick/core.clj
@@ -247,7 +247,9 @@
   Number
   (duration
     ([n] (duration n :seconds))
-    ([n u] (Duration/of n (units u)))))
+    ([n u] (let [unit (units u)]
+             (assert unit (str "Not a unit: " u))
+             (Duration/of n unit)))))

 (defn between [i1 i2]
   (Duration/between (instant i1) (instant i2)))


update comment

update comment

--- src/midje/checking/core.clj
+++ src/midje/checking/core.clj
@@ -53,8 +53,9 @@
     [false {:thrown ex}])))

 (defn detailed-extended-=
-  "Equality check that coerces arguments into comparable values. Returns tuple
-  contains the check result boolean and a failure detail map"
+  "Equality check that can handle checker functions and compare arguments of
+  different types. Returns a tuple containing the boolean result and a failure
+  detail map"
   [actual expected]
   (try
     (cond


allow toggle of edit and run modes

allow toggle of edit and run modes

I tried to put these two buttons together as it saves space which makes
the IDE more useable on a mobile phone

--- idecode/myappshare/mainapp.cljs
+++ idecode/myappshare/mainapp.cljs
@@ -350,14 +350,6 @@
                                           )
                                         )) } "New")

-            (button {:className    (if (small-screen) "btn btn-default"  "btn-lg btn-default")
-                     :style {:display "inline-block" :marginLeft (if (small-screen) "2px"  "30px")
-                             :fontFamily "Ubuntu"    :fontSize "1em"       :marginTop "0.3em"
-                             :opacity  (if (= (read-ui app [:mode]) "view")  "1.0" "0.4")
-                             }
-                     :onClick     #(go (write-ui app [:mode] "edit"))
-                     :disabled     (if (= (read-ui app [:mode]) "view") "" "true")
-                             } "Edit")

             (cond
@@ -373,24 +365,36 @@

-
-                   (button {:className    (if (small-screen) "btn btn-default"  "btn-lg btn-default")
-                        :style       {:display "inline-block" :marginLeft (if (small-screen) "2px"  "30px") :fontFamily "Ubuntu" :fontSize "1em" :marginTop "0.3em"
-                                      :backgroundColor "lightgreen"
-                                      :opacity  (if (= (read-ui app [:mode]) "edit")  "1.0" "0.4")
-
-                                      }
-                        :onClick     #(do
-                                        (write-ui app [:mode] "view")
-                                        (reeval  (read-ui app [:app-id])))
+(cond
+  (not (= (read-ui app [:mode]) "edit"))
+            (button {:className    (if (small-screen) "btn btn-default"  "btn-lg btn-default")
+                     :style {:display "inline-block" :marginLeft (if (small-screen) "2px"  "30px")
+                             :fontFamily "Ubuntu"    :fontSize "1em"       :marginTop "0.3em"
+                             :opacity  (if (= (read-ui app [:mode]) "view")  "1.0" "0.4")
+                             }
+                     :onClick     #(go (write-ui app [:mode] "edit"))
+                     :disabled     (if (= (read-ui app [:mode]) "view") "" "true")
+                     } "Edit")
+
+
+  (= (read-ui app [:mode]) "edit")
+            (button {:className    (if (small-screen) "btn btn-default"  "btn-lg btn-default")
+                     :style       {:display "inline-block" :marginLeft (if (small-screen) "2px"  "30px") :fontFamily "Ubuntu" :fontSize "1em" :marginTop "0.3em"
+                                   :backgroundColor "lightgreen"
+                                   :opacity  (if (= (read-ui app [:mode]) "edit")  "1.0" "0.4")
+
+                                   }
+                     :onClick     #(do
+                                     (write-ui app [:mode] "view")
+                                     (reeval  (read-ui app [:app-id])))
                      :disabled  (if (= (read-ui app [:mode]) "edit") "" "true")
                      }
-                           "Run"
-                           (span {:style {:marginLeft "4px"}
-                                  :className (str "glyphicon glyphicon-play")
-                                  :aria-hidden "true"})
-                       )
-
+                    "Run"
+                    (span {:style {:marginLeft "4px"}
+                           :className (str "glyphicon glyphicon-play")
+                           :aria-hidden "true"})
+                    )
+)

             (button {:className    (if (small-screen) "btn btn-default"  "btn-lg btn-default")


fix typo, remove old code

fix typo, remove old code

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/examples/todomvc2.cljs
+++ src/aurora/examples/todomvc2.cljs
@@ -14,15 +14,6 @@
     (know env "todo-editing" #js ["todo-id" "editing?"] #js [x "saved"])
     (know env "todo-completed" #js ["todo-id" "completed?"] #js [x "active"]))
   )
-
-(defn click! [env elem]
-  (.assoc! (index env "ui/onClick") #js[elem] 0))
-
-(defn change! [env elem ]
-  (.assoc! (index env "ui/onChange") #js[elem "foo bar"] 0))
-
-(defn blur! [elem]
-  (.assoc! (index env "ui/onBlur") #js[elem] 0))

 (defn defaults [env]
   ;((aget (aget env "ctx") "remember!") "todo-to-add" #js ["hey"])
@@ -233,7 +224,7 @@
              (change "todo-to-add" {:value 'to-add} {:value ""})
              (remember "todo" {:todo-id 'time :text 'to-add})
              (remember "todo-editing" {:todo-id 'time :editing? "saved"})
-             (remember "todo-completed" {:todo-id 'time :completed? "acitve"})))
+             (remember "todo-completed" {:todo-id 'time :completed? "active"})))

 (defn run []
@@ -242,6 +233,7 @@
      (do (defaults todomvc)
        (fill-todos todomvc 10)
        (re-run todomvc)))))
+

 (comment


Monitoring config no longer requires host-id

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -63,7 +63,7 @@
         env (onyx.api/start-env env-config)

         host-id (str (java.util.UUID/randomUUID))
-        m-cfg (monitoring/monitoring-config host-id 10000)
+        m-cfg (monitoring/monitoring-config 10000)
         riemann-config {:riemann/address riemann-addr :riemann/port (Integer/parseInt riemann-port)}
         monitoring-thread (riemann/riemann-sender riemann-config (:monitoring/ch m-cfg))
         peers (onyx.api/start-peers n-peers-parsed peer-group m-cfg)]


Fix yeller appender.

Fix yeller appender.

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -67,9 +67,10 @@
            :shared-appender-config {:rotor {:path "onyx-benchmark.log"
                                             :max-size (* 512 102400) :backlog 5}}}
     (not-empty yeller-token)
-    (assoc :yeller (yeller-timbre-appender/make-yeller-appender
-                     {:token yeller-token
-                      :environment "production"}))))
+    (assoc-in [:appenders :yeller]
+              (yeller-timbre-appender/make-yeller-appender
+                {:token yeller-token
+                 :environment "production"}))))

 (defn -main [zk-addr riemann-addr id n-peers & args]
   (let [peer-config {:zookeeper/address zk-addr


comment out extensions shortcut for now

comment out extensions shortcut for now

--- src/chat/client/views/header.cljs
+++ src/chat/client/views/header.cljs
@@ -63,14 +63,15 @@
                      (map (fn [tag]
                             (dom/div nil (om/build tag-view tag)))))))))

-        (let [path (routes/extensions-page-path {:group-id (routes/current-group)})]
-          (dom/div #js {:className (str "extensions shortcut "
-                                        (when (routes/current-path? path) "active"))}
-            (dom/a #js {:href path
-                        :className "title"
-                        :title "Extensions"})
-            (dom/div #js {:className "modal"}
-              (dom/div nil "extensions"))))
+        (comment
+          (let [path (routes/extensions-page-path {:group-id (routes/current-group)})]
+            (dom/div #js {:className (str "extensions shortcut "
+                                          (when (routes/current-path? path) "active"))}
+              (dom/a #js {:href path
+                          :className "title"
+                          :title "Extensions"})
+              (dom/div #js {:className "modal"}
+                (dom/div nil "extensions")))))

         (let [path (routes/help-page-path {:group-id (routes/current-group)})]
           (dom/div #js {:className (str "help shortcut "


Extend protocol IResultSetReadColumn to handle pg arrays

--- src/cider_ci/utils/rdbms/json.clj
+++ src/cider_ci/utils/rdbms/json.clj
@@ -3,8 +3,12 @@
 ; See the "LICENSE.txt" file provided with this software.

 (ns cider-ci.utils.rdbms.json
-  (:require [clojure.java.jdbc :as jdbc]
-            [clojure.data.json :as json])
+  (:require
+    [clj-logging-config.log4j :as logging-config]
+    [clojure.data.json :as json]
+    [clojure.java.jdbc :as jdbc]
+    [clojure.tools.logging :as logging]
+    )
   (:import org.postgresql.util.PGobject))

 (defn value-to-json-pgobject [value]
@@ -24,7 +28,21 @@
   (result-set-read-column [pgobj metadata idx]
     (let [type  (.getType pgobj)
           value (.getValue pgobj)]
+      ;(logging/debug [type value])
       (case type
         "json" (json/read-str value)
         :else value))))

+(extend-protocol jdbc/IResultSetReadColumn
+  org.postgresql.jdbc4.Jdbc4Array
+  (result-set-read-column [pgobj metadata idx]
+    (logging/debug [pgobj metadata idx])
+    (.getArray pgobj)))
+
+
+;### Debug ####################################################################
+;(debug/debug-ns *ns*)
+;(logging-config/set-logger! :level :debug)
+;(logging-config/set-logger! :level :info)
+
+


Fix trailing white space

Fix trailing white space

--- src/clj/chili_dog_night/views.clj
+++ src/clj/chili_dog_night/views.clj
@@ -60,7 +60,7 @@
 (defn comma-separate [coll]
   (reduce into (concat
                 (map #(vec [% ", "])
-                     (drop-last 2 coll))
+                     (drop-last 2 coll))
                 (reduce #(vec [[ % ", and "] [%2]])
                         (take-last 2 coll)))))


correct Diversified Portfolio counting of remote servers with contents

--- src/clj/game/cards-operations.clj
+++ src/clj/game/cards-operations.clj
@@ -135,9 +135,9 @@
                           :once :per-turn :effect (effect (damage-bonus :brain 1))}}}

    "Diversified Portfolio"
-   {:msg (msg "gain " (count (filter #(not (empty? (cons % [:content]))) (get-remotes @state)))
+   {:msg (msg "gain " (count (filter #(not (empty? %)) (map #(:content (second %)) (get-remotes @state))))
               " [Credits]")
-    :effect (effect (gain :credit (count (filter #(not (empty? (cons % [:content]))) (get-remotes @state)))))}
+    :effect (effect (gain :credit (count (filter #(not (empty? %)) (map #(:content (second %)) (get-remotes @state))))))}

    "Fast Track"
    {:prompt "Choose an Agenda" :choices (req (filter #(has? % :type "Agenda") (:deck corp)))


type hint consumer.simple

type hint consumer.simple

--- src/clj_kafka/consumer/simple.clj
+++ src/clj_kafka/consumer/simple.clj
@@ -6,7 +6,7 @@
 (defn consumer
   "Create a consumer to connect to host and port. Port will
    normally be 9092."
-  [host port client-id & {:keys [timeout buffer-size] :or {timeout 100000 buffer-size 10000}}]
+  [host ^Long port client-id & {:keys [^Long timeout ^Long buffer-size] :or {timeout 100000 buffer-size 10000}}]
   (SimpleConsumer. host
                    (Integer/valueOf port)
                    (Integer/valueOf timeout)
@@ -14,14 +14,14 @@
                    client-id))

 (defn fetch-request
-  [client-id topic partition offset fetch-size]
+  [client-id topic ^Long partition offset fetch-size]
   (.build (doto (FetchRequestBuilder. )
             (.clientId client-id)
             (.addFetch topic (Integer/valueOf partition) offset fetch-size))))

 (defn messages
-  [consumer client-id topic partition offset fetch-size]
+  [^SimpleConsumer consumer client-id topic partition offset fetch-size]
   (let [fetch (fetch-request client-id topic partition offset fetch-size)]
-    (iterator-seq (.iterator (.messageSet (.fetch consumer fetch)
+    (iterator-seq (.iterator (.messageSet ^kafka.javaapi.FetchResponse (.fetch consumer ^kafka.api.FetchRequest fetch)
                                           topic
                                           partition)))))


don't look up account with nil id

don't look up account with nil id

--- src/clj_money/models/accounts.clj
+++ src/clj_money/models/accounts.clj
@@ -141,8 +141,9 @@
 (defn find-by-id
   "Returns the account having the specified id"
   [storage-spec id]
-  (with-storage [s storage-spec]
-    (prepare-for-return (find-account-by-id s id))))
+  (when id
+    (with-storage [s storage-spec]
+      (prepare-for-return (find-account-by-id s id)))))

 (defn find-by-name
   "Returns the account having the specified name"


raise post-filter-changed event use it to reset the result count

--- src/cljs/apollo/client/pages.cljs
+++ src/cljs/apollo/client/pages.cljs
@@ -51,9 +51,12 @@
         (loop []
           (let [e (<! (om/get-state owner :keypress-chan))
                 key-code (.-keyCode (:event (:message e)))
-                n (om/get-node owner "filter-input")]
+                n (om/get-node owner "filter-input")
+                ov (:value (state/ref-post-filter))]
             (om/transact! (state/ref-post-filter)
                           (fn [p] (assoc p :value (.-value n))))
+            (when (not (= ov (.-value n)))
+              (events/publish events/event-chan :post-filter-changed (.-value n)))
             (when (= key-code 191)
               (om/set-state! owner :visible true)
               (.focus n)))
@@ -134,11 +137,14 @@
     (init-state [_]
       {:result-count 20
        :scroll-chan (chan (dropping-buffer 1))
+       :keypress-chan (chan (dropping-buffer 1))
        :result-inc 1.05})
     om/IWillMount
     (will-mount [_]
-      (let [scroll-chan (om/get-state owner :scroll-chan)]
+      (let [scroll-chan (om/get-state owner :scroll-chan)
+            keypress-chan (om/get-state owner :keypress-chan)]
         (sub events/event-bus :at-bottom scroll-chan)
+        (sub events/event-bus :post-filter-changed keypress-chan)
         (go
           (loop []
             (let [e (<! scroll-chan)
@@ -147,10 +153,17 @@
                        old-result-count)
                   the-i (if (> (- i old-result-count) 100) i (+ 100 old-result-count))]
               (om/set-state! owner :result-count the-i))
+            (recur)))
+        (go
+          (loop []
+            (let [post-filter (:value (om/observe owner (state/ref-post-filter)))
+                  e (<! keypress-chan)]
+              (om/set-state! owner :result-count 20))
             (recur)))))
     om/IWillUnmount
     (will-unmount [_]
-      (unsub events/event-bus :at-bottom (om/get-state owner :scroll-chan)))
+      (unsub events/event-bus :at-bottom (om/get-state owner :scroll-chan))
+      (unsub events/event-bus :keypress (om/get-state owner :keypress-chan)))
     om/IRender
     (render [this]
       (let [result-count (om/get-state owner :result-count)
@@ -162,8 +175,7 @@
                                                     c-a-b (str (a "album"))
                                                     c-a-a (str (a "artist"))]
                                                 (or (utils/str-contains? c-a-b c-f)
-                                                    (utils/str-contains? c-a-a c-f))))
-                                      )
+                                                    (utils/str-contains? c-a-a c-f)))))
                                     (:albums data))
             buckets (group-by
                      (fn [x]


Add ac type display

Add ac type display

--- src/cljs/clojuredocs/widgets.cljs
+++ src/cljs/clojuredocs/widgets.cljs
@@ -207,29 +207,35 @@

 (defmulti ac-entry :type)

-(defmethod ac-entry :function [{:keys [name ns doc] :as func}]
+(defmethod ac-entry :function [{:keys [name ns doc type] :as func}]
   (dom/div {:class "ac-entry"}
-    (dom/i )
+    (dom/span {:class "ac-type"} "fn")
     (dom/h4
+      #_(dom/i {:class "fa fa-exclamation"})
       (dom/a {:href (var-url func)}
         name " (" ns ")"))
     (dom/p (ellipsis 225 doc))))

-(defmethod ac-entry :macro [{:keys [name ns doc]}]
-  (dom/div
+(defmethod ac-entry :macro [{:keys [name ns doc type]}]
+  (dom/div {:class "ac-entry"}
+    (dom/span {:class "ac-type"} "macro")
     (dom/h4
       name " (" ns ")")
     (dom/p (ellipsis 225 doc))))

-(defmethod ac-entry :ns [{:keys [ns doc]}]
-  (dom/div
+(defmethod ac-entry :ns [{:keys [ns doc type]}]
+  (dom/div {:class "ac-entry"}
+    (dom/span {:class "ac-type"} "ns")
     (dom/h4
+      #_(dom/i {:class "fa fa-cube"})
       (dom/a {:href "#"} ns))
     (dom/p (ellipsis 225 doc))))

-(defmethod ac-entry :page [{:keys [title desc]}]
-  (dom/div
+(defmethod ac-entry :page [{:keys [title desc type]}]
+  (dom/div {:class "ac-entry"}
+    (dom/span {:class "ac-type"} "page")
     (dom/h4
+      #_(dom/i {:class "fa fa-bolt"})
       (dom/a {:href "#"} title))
     (dom/p (ellipsis 255 desc))))


small fix

small fix

--- src/cljs/salava/page/ui/edit.cljs
+++ src/cljs/salava/page/ui/edit.cljs
@@ -324,52 +324,53 @@
   (let [block-type-map (if (some #(= "profile" (:type %)) @block-atom)
                          (into []  (remove #(= "profile" (:value %)) block-type-map)) block-type-map)]
     (fn []
-      [:div#block-modal
-       [:div.modal-body
-        [:p.block-title (t :page/Addblock)]
-        [:p (t :page/Choosecontent)]
-        (reduce-kv
-          (fn [r k v]
-            (let [new-field-atom (atom {:type (:value v)})]
-              (conj r
-                    [:div.row
-                     [:div.col-md-12
-                      [:div.content-type {:style {:display "inline-table"}} [:a.link {:on-click #(do
-                                                                                (.preventDefault %)
-                                                                                (case (:value v)
-                                                                                "badge" (open-modal [:badge :my] {:type "pickable" :new-field-atom new-field-atom  :block-atom block-atom  :index (or index nil)})
-                                                                                (if index
-                                                                                (f/add-field block-atom {:type (:value v)} index )
-                                                                                (f/add-field block-atom {:type (:value v)} ))))
-                                                                                :data-dismiss (case (:value v)
-                                                                                ("badge") nil
-                                                                                "modal")
-                                                                                }
-                                                                             [:div
-
-                                                                              [:i {:class (str "fa icon " (:icon v))}]
-                                                                              [:span (:text v)]]]]
-                      [:span {:style {:display "inline"}}
-                       [info {:placement "right" :content (case (:value v)
-                                                            "badge" (t :page/Badgeinfo)
-                                                            "tag" (t :page/Badgegroupinfo)
-                                                            "heading" (t :page/Headinginfo)
-                                                            "sub-heading" (t :page/Subheadinginfo)
-                                                            "file" (t :page/Filesinfo)
-                                                            "html" (t :page/Htmlinfo)
-                                                            "showcase" (t :page/Badgeshowcaseinfo)
-                                                            "profile" (t :profile/Addprofileinfo)
-                                                            )
-                              :style {:font-size "15px"}}]
-                       ]]])))
-          [:div.block-types] block-type-map)]
-       [:div.modal-footer
-        [:button.btn.btn-warning {:on-click #(do
-                                               (.preventDefault %)
-                                               (m/close-modal!)
-                                               )}
-         (t :core/Cancel)]]
-       ])))
+      [:div#page-edit
+       [:div#block-modal
+        [:div.modal-body
+         [:p.block-title (t :page/Addblock)]
+         [:p (t :page/Choosecontent)]
+         (reduce-kv
+           (fn [r k v]
+             (let [new-field-atom (atom {:type (:value v)})]
+               (conj r
+                     [:div.row
+                      [:div.col-md-12
+                       [:div.content-type {:style {:display "inline-table"}} [:a.link {:on-click #(do
+                                                                                (.preventDefault %)
+                                                                                (case (:value v)
+                                                                                "badge" (open-modal [:badge :my] {:type "pickable" :new-field-atom new-field-atom  :block-atom block-atom  :index (or index nil)})
+                                                                                (if index
+                                                                                (f/add-field block-atom {:type (:value v)} index )
+                                                                                (f/add-field block-atom {:type (:value v)} ))))
+                                                                                :data-dismiss (case (:value v)
+                                                                                ("badge") nil
+                                                                                "modal")
+                                                                                }
+                                                                              [:div
+
+                                                                               [:i {:class (str "fa icon " (:icon v))}]
+                                                                               [:span (:text v)]]]]
+                       [:span {:style {:display "inline"}}
+                        [info {:placement "right" :content (case (:value v)
+                                                             "badge" (t :page/Badgeinfo)
+                                                             "tag" (t :page/Badgegroupinfo)
+                                                             "heading" (t :page/Headinginfo)
+                                                             "sub-heading" (t :page/Subheadinginfo)
+                                                             "file" (t :page/Filesinfo)
+                                                             "html" (t :page/Htmlinfo)
+                                                             "showcase" (t :page/Badgeshowcaseinfo)
+                                                             "profile" (t :profile/Addprofileinfo)
+                                                             )
+                               :style {:font-size "15px"}}]
+                        ]]])))
+           [:div.block-types] block-type-map)]
+        [:div.modal-footer
+         [:button.btn.btn-warning {:on-click #(do
+                                                (.preventDefault %)
+                                                (m/close-modal!)
+                                                )}
+          (t :core/Cancel)]]
+        ]])))

 (defn field-after [blocks state index initial?]


Accessibility Improvements

Accessibility Improvements

--- src/cljs/salava/user/ui/data.cljs
+++ src/cljs/salava/user/ui/data.cljs
@@ -18,8 +18,8 @@
 (defn export-data-to-pdf [state]
   (let [user-id (:user-id @state)]
     (ajax/GET
-      (path-for (str "obpv1/user/export-to-pdf/" user-id))
-      {:handler (js-navigate-to (str "obpv1/user/export-to-pdf/" user-id))})))
+     (path-for (str "obpv1/user/export-to-pdf/" user-id))
+     {:handler (js-navigate-to (str "obpv1/user/export-to-pdf/" user-id))})))

 (defn email-address-table [email]
   [:table.table.hidden-xs
@@ -31,15 +31,14 @@
      [:th (t :user/BackpackID)]]]
    [:tbody
     (doall
-      (for [e email
-            :let [{:keys [email verified primary_address backpack_id]} e]]
-
-        ^{:key e}[:tr
+     (for [e email
+           :let [{:keys [email verified primary_address backpack_id]} e]]
+
+       ^{:key e} [:tr
                   [:td email]
                   [:td.text-center (if verified [:i {:class "fa fa-check"}])]
                   [:td (if primary_address [:i {:class "fa fa-check"}])]
                   [:td backpack_id]]))]])
-

 (defn email-address-table-mobile [email]
   [:table.table.visible-xs
@@ -48,16 +47,15 @@
      [:th (t :user/Email)]]]
    [:tbody
     (doall
-      (for [e email
-            :let [{:keys [email verified primary_address backpack_id]} e]]
-        ^{:key e}[:tr
+     (for [e email
+           :let [{:keys [email verified primary_address backpack_id]} e]]
+       ^{:key e} [:tr
                   [:td email
                    [:p (t :user/verified) ": " (if verified [:i {:class "fa fa-check"}])]
                    (if backpack_id
                      [:p (t :user/BackpackID) ": "  [:i backpack_id]])
                    (if primary_address
                      [:p (t :user/Loginaddress) ": " [:i {:class "fa fa-check"}]])]]))]])
-

 (defn content [state]
   (let [{location :location user_followers :user_followers user_following :user_following pending_badges :pending_badges connections :connections events :events user_files :user_files user_badges :user_badges endorsements :endorsements
@@ -97,10 +95,10 @@
                                                                      :alt fullname}]]])
           [:div {:class "col-md-9 col-sm-9 col-xs-12"}
            [:div {:id "profile-data" :class "row"}
-            [:div.col-xs-12 [:b (t :user/UserID)": "] id]
+            [:div.col-xs-12 [:b (t :user/UserID) ": "] id]
             [:div.col-xs-12 [:b (str (t :user/Role) ": ")] (if (= "user" role) (t :social/User) (t :admin/Admin))]
-            [:div.col-xs-12 [:b (str (t :user/Firstname)": ")] (capitalize first_name)]
-            [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Lastname)": ")] (capitalize last_name)]
+            [:div.col-xs-12 [:b (str (t :user/Firstname) ": ")] (capitalize first_name)]
+            [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Lastname) ": ")] (capitalize last_name)]
             [:div
              [:div.col-xs-12 [:b (t :user/Aboutme) ":"]]
              [:div.col-xs-12 {:style {:margin-bottom "20px"}} about]]
@@ -109,6 +107,11 @@
                [:div.col-xs-12 [:b (t :user/Contactinfo) ":"]]
                [:div.col-xs-12
                 [:table.table
+                 [:thead
+                  [:tr
+                   [:th {:style {:display "none"}} "Field"]
+                   [:th {:style {:display "none"}} "Value"]]]
+
                  (into [:tbody]
                        (for [profile-field (sort-by :order profile)
                              :let [{:keys [field value]} profile-field
@@ -120,22 +123,22 @@
                           [:td.profile-field (t key) ":"]
                           [:td (cond
                                  (or (re-find #"www." (str value)) (re-find #"^https?://" (str value)) (re-find #"^http?://" (str value))) (hyperlink value)
-                                 (and (re-find #"@" (str value)) (= "twitter" field)) [:a {:href (str "https://twitter.com/" value) :target "_blank" } (t value)]
+                                 (and (re-find #"@" (str value)) (= "twitter" field)) [:a {:href (str "https://twitter.com/" value) :target "_blank"} (t value)]
                                  (and (re-find #"@" (str value)) (= "email" field)) [:a {:href (str "mailto:" value)} (t value)]
-                                 (and  (empty? (re-find #" " (str value))) (= "facebook" field)) [:a {:href (str "https://www.facebook.com/" value) :target "_blank" } (t value)]
-                                 (= "twitter" field) [:a {:href (str "https://twitter.com/" value) :target "_blank" } (t value)]
-                                 (and  (empty? (re-find #" " (str value))) (= "pinterest" field)) [:a {:href (str "https://www.pinterest.com/" value) :target "_blank" } (t value)]
-                                 (and  (empty? (re-find #" " (str value))) (= "instagram" field)) [:a {:href (str "https://www.instagram.com/" value) :target "_blank" } (t value)]
+                                 (and  (empty? (re-find #" " (str value))) (= "facebook" field)) [:a {:href (str "https://www.facebook.com/" value) :target "_blank"} (t value)]
+                                 (= "twitter" field) [:a {:href (str "https://twitter.com/" value) :target "_blank"} (t value)]
+                                 (and  (empty? (re-find #" " (str value))) (= "pinterest" field)) [:a {:href (str "https://www.pinterest.com/" value) :target "_blank"} (t value)]
+                                 (and  (empty? (re-find #" " (str value))) (= "instagram" field)) [:a {:href (str "https://www.instagram.com/" value) :target "_blank"} (t value)]
                                  (= "blog" field) (hyperlink value)
                                  :else (t value))]]))]]])

-            [:div.col-xs-12 [:b (t :user/Language)": "] (upper-case language)]
-            [:div.col-xs-12 [:b (t :user/Country)": "] country]
+            [:div.col-xs-12 [:b (t :user/Language) ": "] (upper-case language)]
+            [:div.col-xs-12 [:b (t :user/Country) ": "] country]
             [:div.col-xs-12 [:b (str (t :user/Emailnotifications) ": ")]  (if (true? email_notifications) (t :core/Yes) (t :core/No))]
             [:div.col-xs-12 [:b (str (t :user/Privateprofile) ": ")] (if (true? private) (t :core/Yes) (t :core/No))]
             [:div.col-xs-12 [:b (str (t :user/Activated) ": ")] (if (true? activated?) (t :core/Yes) (t :core/No))]
-            [:div.col-xs-12  [:b (str (t :user/Profilevisibility) ": ")] (t (keyword (str "core/"(capitalize profile_visibility))))]
-            (when-not (and (nil? (:lat location)) (nil? (:lng location)))[:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :location/Location) ": ")] (str (:lat location) "," (:lng location))])]]]
+            [:div.col-xs-12  [:b (str (t :user/Profilevisibility) ": ")] (t (keyword (str "core/" (capitalize profile_visibility))))]
+            (when-not (and (nil? (:lat location)) (nil? (:lng location))) [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :location/Location) ": ")] (str (:lat location) "," (:lng location))])]]]

          [:div {:class "row col-md-12 col-sm-12 col-xs-12 th-align" :style {:margin-bottom "10px"}}
           [:h2 {:class "uppercase-header"} [:a {:href (path-for "/user/edit/email-addresses")} (str (if (empty? (rest email)) (t :user/Email) (t :user/Emailaddresses)))]]
@@ -143,141 +146,125 @@
           (email-address-table-mobile email)]

          [:div {:class "row col-md-12 col-sm-12 col-xs-12" :style {:margin-bottom "20px"}}
-          [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")}(str (t :badge/Mybadges) ": ")(count user_badges)]]
+          [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")} (str (t :badge/Mybadges) ": ") (count user_badges)]]
           (when (seq user_badges)
             (doall
-              (for [b user_badges]
-                ^{:key b}[:div.col-xs-12 [:a {:href "#"
+             (for [b user_badges]
+               ^{:key b} [:div.col-xs-12 [:a {:href "#"
                                               :on-click #(do
                                                            (.preventDefault %)
                                                            (mo/open-modal [:gallery :badges] {:badge-id (:badge_id b)}))}
-                                             (:name b)]])))]
+                                          (:name b)]])))]
          [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
           (when (seq pending_badges)
             [:div
              [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")} (str (t :badge/Pendingbadges) ": ") (count pending_badges)]]
              (doall
-               (for [p pending_badges]
-                 ^{:key p}[:div
+              (for [p pending_badges]
+                ^{:key p} [:div
                            [:div.col-xs-12 [:b (str (t :badge/Name) ": ")] (:name p)]
-                           [:div.col-xs-12 [:b (str (t :page/Description) ": ")] (:description p)]]))])]
-
-
-
-         (when (seq user_pages)
-           [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-            [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/page")} (str (t :page/Mypages) ": ") (count user_pages)]]
-            (doall
-              (for [p user_pages]
-                ^{:key p}[:div.col-xs-12 [:a {:href "#"
-                                              :on-click #(do
-                                                           (.preventDefault %)
-                                                           (mo/open-modal [:page :view] {:page-id (:id p)}))}
-                                             (:name p)]]))])
-
-
-         (when (seq user_files)
-           [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-            [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/files")} (str (t :file/Files) ": ") (count user_files)]]
-            (doall
-              (for [f user_files]
-                ^{:key f}[:div.col-xs-12 [:a {:href  (str "/" (:path f)) :target "_blank"}
-                                          (:name f)]]))])
-
-
-         [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-          [:h1 {:class "uppercase-header" :style {:text-align "center"}} (t :user/Activity)]
-          (when (pos? connections)
-            [:div
-             [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/badge") :on-click #(session/put! :visible-area :badges)} (str (t :user/Badgeconnections) ": ")  connections]]])
-          (when (pos? endorsements)
-            [:div
-             [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/endorsement")} (str (t :badge/Myendorsements) ": ")  endorsements]]])
-          (when (or (seq user_following) (seq user_followers))
-            [:div
-             [:h2 {:class "uppercase-header"} (str (t :user/Socialconnections) ": ") (+ (count user_followers) (count user_following))]
-             (when (seq user_followers)
-               [:div
-                [:h3 (str (t :social/Followersusers) ": ")]
-                (for [follower user_followers
-                      :let [id (:owner_id follower)
-                            fname (:first_name follower)
-                            lname (:last_name follower)
-                            status (:status follower)]]
-                  ^{:key follower}[:div
-                                   [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"} [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:owner_id follower)})} (str (:first_name follower) " " (:last_name follower) )] ", "[:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status follower))))]]
-                                   #_[:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status follower))))]])
-
-                [:br]])
-
-             (when (seq user_following)
-               [:div
-                [:h3 (str (t :social/Followedusers) ": ")]
-                (for [f user_following
-                      :let [fid (:user_id f)
-                            fname (:first_name f)
-                            lname (:last_name f)
-                            status (:status f)]]
-                  ^{:key f}[:div
-                            [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"}  [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:user_id f)})} (str (:first_name f) " " (:last_name f) )] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status f))))]]])])])
-
-
-
-          (when (seq events)
-            [:div.th-align
-             [:h2 {:class "uppercase-header"} (str (t :user/Activityhistory) ": ") (count events)]
-             [:table.table
-              [:thead
-               [:tr
-                [:th (t :social/Action)]
-                [:th (t :social/Object)]
-                [:th (t :badge/Name)]
-                [:th (t :social/Created)]]]
-              [:tbody
-               (doall
-                 (for [e (->> (reverse events) (remove #(= "-" (:info %))))]
-                   ^{:key e}[:tr
-                             [:td [:div (t (keyword (str "social/"(:verb e))))]]
-                             [:td [:div (case (:type e)
-                                          "page" (t :social/Emailpage)
-                                          "badge" (t :social/Emailbadge)
-                                          "user" (lower-case (t :social/User))
-                                          "admin" (lower-case (t :admin/Admin))
-                                          "-")]]
-                             [:td [:div (case (str (:verb e)(:type e))
-                                          "publishpage"  (or (get-in e [:info :object_name]) "-")
-                                          "unpublishpage" (or (get-in e [:info :object_name]) "-")
-                                          "publishbadge" (or (get-in e [:info :object_name]) "-")
-                                          "unpublishbadge" (or (get-in e [:info :object_name]) "-")
-                                          "messagebadge" [:div {:style {:max-width "550px"}}
-                                                          (or (get-in e [:info :object_name]) "-")"\n"
-                                                          [:br][:br]
-                                                          [:p [:i (or (get-in e [:info :message :message]) "comment-removed")]]]
-                                          "congratulatebadge" (or (get-in e [:info :object_name]) "-")
-                                          "followbadge" (or (get-in e [:info :object_name]) "-")
-                                          "followuser" (or (get-in e [:info :object_name]) "-")
-                                          "ticketadmin" (or (get-in e [:info :object_name]) "-")
-                                          "request_endorsementbadge" [:div {:style {:max-width "550px"}}
-                                                                       (or (get-in e [:info :object_name]) "-")"\n"
-                                                                       [:br][:br]
-                                                                       [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
-                                          "endorse_badgebadge" [:div {:style {:max-width "550px"}}
-                                                                 (or (get-in e [:info :object_name]) "-") "\n"
-                                                                 [:br][:br]
-                                                                 [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
-                                          "-")]]
-                             [:td [:div (date-from-unix-time (* 1000 (:ctime e)))]]]))]]])]]])]))
-
-
+                           [:div.col-xs-12 [:b (str (t :page/Description) ": ")] (:description p)]]))])] (when (seq user_pages)
+                                                                                [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/page")} (str (t :page/Mypages) ": ") (count user_pages)]]
+                                                                                (doall
+                                                                                (for [p user_pages]
+                                                                                ^{:key p} [:div.col-xs-12 [:a {:href "#"
+                                                                                :on-click #(do
+                                                                                (.preventDefault %)
+                                                                                (mo/open-modal [:page :view] {:page-id (:id p)}))}
+                                                                                (:name p)]]))]) (when (seq user_files)
+                                                                                [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/files")} (str (t :file/Files) ": ") (count user_files)]]
+                                                                                (doall
+                                                                                (for [f user_files]
+                                                                                ^{:key f} [:div.col-xs-12 [:a {:href  (str "/" (:path f)) :target "_blank"}
+                                                                                (:name f)]]))]) [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                [:h1 {:class "uppercase-header" :style {:text-align "center"}} (t :user/Activity)]
+                                                                                (when (pos? connections)
+                                                                                [:div
+                                                                                [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/badge") :on-click #(session/put! :visible-area :badges)} (str (t :user/Badgeconnections) ": ")  connections]]])
+                                                                                (when (pos? endorsements)
+                                                                                [:div
+                                                                                [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/endorsement")} (str (t :badge/Myendorsements) ": ")  endorsements]]])
+                                                                                (when (or (seq user_following) (seq user_followers))
+                                                                                [:div
+                                                                                [:h2 {:class "uppercase-header"} (str (t :user/Socialconnections) ": ") (+ (count user_followers) (count user_following))]
+                                                                                (when (seq user_followers)
+                                                                                [:div
+                                                                                [:h3 (str (t :social/Followersusers) ": ")]
+                                                                                (for [follower user_followers
+                                                                                :let [id (:owner_id follower)
+                                                                                fname (:first_name follower)
+                                                                                lname (:last_name follower)
+                                                                                status (:status follower)]]
+                                                                                ^{:key follower} [:div
+                                                                                [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"} [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:owner_id follower)})} (str (:first_name follower) " " (:last_name follower))] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status follower))))]]
+                                                                                #_[:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status follower))))]])
+
+                                                                                [:br]])
+
+                                                                                (when (seq user_following)
+                                                                                [:div
+                                                                                [:h3 (str (t :social/Followedusers) ": ")]
+                                                                                (for [f user_following
+                                                                                :let [fid (:user_id f)
+                                                                                fname (:first_name f)
+                                                                                lname (:last_name f)
+                                                                                status (:status f)]]
+                                                                                ^{:key f} [:div
+                                                                                [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"}  [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:user_id f)})} (str (:first_name f) " " (:last_name f))] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status f))))]]])])]) (when (seq events)
+                                                                                [:div.th-align
+                                                                                [:h2 {:class "uppercase-header"} (str (t :user/Activityhistory) ": ") (count events)]
+                                                                                [:table.table
+                                                                                [:thead
+                                                                                [:tr
+                                                                                [:th (t :social/Action)]
+                                                                                [:th (t :social/Object)]
+                                                                                [:th (t :badge/Name)]
+                                                                                [:th (t :social/Created)]]]
+                                                                                [:tbody
+                                                                                (doall
+                                                                                (for [e (->> (reverse events) (remove #(= "-" (:info %))))]
+                                                                                ^{:key e} [:tr
+                                                                                [:td [:div (t (keyword (str "social/" (:verb e))))]]
+                                                                                [:td [:div (case (:type e)
+                                                                                "page" (t :social/Emailpage)
+                                                                                "badge" (t :social/Emailbadge)
+                                                                                "user" (lower-case (t :social/User))
+                                                                                "admin" (lower-case (t :admin/Admin))
+                                                                                "-")]]
+                                                                                [:td [:div (case (str (:verb e) (:type e))
+                                                                                "publishpage"  (or (get-in e [:info :object_name]) "-")
+                                                                                "unpublishpage" (or (get-in e [:info :object_name]) "-")
+                                                                                "publishbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                "unpublishbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                "messagebadge" [:div {:style {:max-width "550px"}}
+                                                                                (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                [:br] [:br]
+                                                                                [:p [:i (or (get-in e [:info :message :message]) "comment-removed")]]]
+                                                                                "congratulatebadge" (or (get-in e [:info :object_name]) "-")
+                                                                                "followbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                "followuser" (or (get-in e [:info :object_name]) "-")
+                                                                                "ticketadmin" (or (get-in e [:info :object_name]) "-")
+                                                                                "request_endorsementbadge" [:div {:style {:max-width "550px"}}
+                                                                                (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                [:br] [:br]
+                                                                                [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
+                                                                                "endorse_badgebadge" [:div {:style {:max-width "550px"}}
+                                                                                (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                [:br] [:br]
+                                                                                [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
+                                                                                "-")]]
+                                                                                [:td [:div (date-from-unix-time (* 1000 (:ctime e)))]]]))]]])]]])]))

 (defn init-data [user-id state]
   (ajax/GET
-    (path-for (str "obpv1/user/data/" user-id) true)
-    {:handler (fn [data]
-                (reset! state (assoc data
-                                :user-id user-id))
-                (swap! state assoc :initializing false))}
-    (fn [] (swap! state assoc :permission "error"))))
+   (path-for (str "obpv1/user/data/" user-id) true)
+   {:handler (fn [data]
+               (reset! state (assoc data
+                                    :user-id user-id))
+               (swap! state assoc :initializing false))}
+   (fn [] (swap! state assoc :permission "error"))))

 (defn handler [site-navi params]
   (let [user-id (:user-id params)


Remove debugging print

Remove debugging print

--- src/braid/uploads/core.cljc
+++ src/braid/uploads/core.cljc
@@ -144,7 +144,6 @@
        (core/register-private-http-route!
          [:get "/s3-policy"
           (fn [req]
-            (println (get-in req [:session :user-id]))
             (if (user/user-id-exists? (get-in req [:session :user-id]))
               (if-let [policy (s3/generate-policy)]
                 {:status 200


Add long<->bytes transformations to codecs namespace.

--- src/clojure/buddy/core/codecs.clj
+++ src/clojure/buddy/core/codecs.clj
@@ -2,7 +2,9 @@
   "Util functions for make conversion between string, bytes
 and encode them to base64 ot hex format."
   (:require [clojure.string :as str])
-  (:import (org.apache.commons.codec.binary Base64 Hex)))
+  (:import org.apache.commons.codec.binary.Base64
+           org.apache.commons.codec.binary.Hex
+           java.nio.ByteBuffer))

 (defn bytes?
   "Test if a first parameter is a byte
@@ -108,6 +110,19 @@
       (str/replace "_" "/")
       (base64->bytes)))

+(defn long->bytes
+  [^Long input]
+  (let [buffer (ByteBuffer/allocate (/ Long/SIZE 8))]
+    (.putLong buffer input)
+    (.array buffer)))
+
+(defn bytes->long
+  [^bytes input]
+  (let [buffer (ByteBuffer/allocate (/ Long/SIZE 8))]
+    (.put buffer input)
+    (.flip buffer)
+    (.getLong buffer)))
+
 (defprotocol ByteArray
   "Facility for convert input parameters
 to bytes array with default implementation


measuring all workflows

measuring all workflows

--- src/celestial/workflows.clj
+++ src/celestial/workflows.clj
@@ -33,6 +33,7 @@
     openstack.model
     [celestial.persistency.systems :as s]
     [clojure.tools.macro :as tm]
+    [metrics.timers :refer  [deftimer time!]]
    )
   (:import
     [celestial.puppet_standalone Standalone]
@@ -56,14 +57,18 @@
   "Defines a basic flow functions with post-success and post-error hooks"
   [fname & args]
   (let [[name* attrs] (tm/name-with-attributes fname args)
+        timer (symbol (str name* "-time"))
         meta-map (meta name*)
         hook-args (or (some-> (meta-map :hook-args) name symbol) 'spec)]
-    `(defn ~name* ~@(when (seq meta-map) [meta-map]) ~(first attrs)
-       (try ~@(next attrs)
-         (run-hooks ~hook-args ~(keyword name*) :success)
-         (catch Throwable t#
-           (run-hooks ~hook-args ~(keyword name*) :error)
-           (throw t#))))))
+    `(do
+       (deftimer ~timer)
+       (defn ~name* ~@(when (seq meta-map) [meta-map]) ~(first attrs)
+         (time! ~timer
+          (try ~@(next attrs)
+           (run-hooks ~hook-args ~(keyword name*) :success)
+           (catch Throwable t#
+             (run-hooks ~hook-args ~(keyword name*) :error)
+             (throw t#))))))))

 (defn updated-system
    "grabs system and associates system id"
@@ -153,14 +158,16 @@
     (s/delete-system system-id)
     (info "system deleted"))

+
 (deflow puppetize
   "Provisions an instance"
   [type {:keys [machine] :as spec}]
-    (info "starting to provision")
-    (trace type spec)
-    (running! (vconstruct spec))
-    (.apply- (pconstruct type spec))
-    (info "done provisioning"))
+
+      (info "starting to provision")
+      (trace type spec)
+      (running! (vconstruct spec))
+      (.apply- (pconstruct type spec))
+      (info "done provisioning"))

 (defn stage
   "create and provision"


Don't print out event-map with exception.

--- src/overtone/libs/event.clj
+++ src/overtone/libs/event.clj
@@ -127,9 +127,7 @@
                                (try
                                  (handler event-map)
                                  (catch Exception e
-                                   (log/error "Handler Exception - with event-map: "
-                                              event-map
-                                              "\n"
+                                   (log/error "Handler Exception: "
                                               (with-out-str (.printStackTrace e)))))))
         [old _] (swap-returning-prev! lossy-workers* assoc key worker)]
     (when-let [old-worker (get old key)]


beef up music.time docs

beef up music.time docs

--- src/overtone/music/time.clj
+++ src/overtone/music/time.clj
@@ -2,12 +2,12 @@
   ^{:doc "Functions to help manage and structure computation in time."
      :author "Jeff Rose and Sam Aaron"}
   overtone.music.time
-  (:import (java.util.concurrent ScheduledThreadPoolExecutor TimeUnit
-                                 PriorityBlockingQueue))
   (:use [overtone.libs event]
         [overtone.util lib])
   (:require [overtone.at-at :as at-at]))

+;;Scheduled thread pool (created by at-at) which is to be used by default for
+;;all scheduled musical functions (players).
 (defonce player-pool* (at-at/mk-pool))

 (defn now
@@ -27,6 +27,8 @@
   ([ms-period fun initial-delay]
      (at-at/every ms-period fun initial-delay player-pool*)))

+;;Ensure all scheduled player fns are stopped when Overtone is reset
+;;(typically triggered by a call to stop)
 (on-sync-event :reset #(at-at/stop-and-reset-pool! player-pool* true) ::player-reset)

 (defn stop-player
@@ -34,7 +36,12 @@
   ([sched-fn] (at-at/cancel sched-fn))
   ([sched-fn cancel-immediately?] (at-at/cancel sched-fn cancel-immediately?)))

-(def ^{:dynamic true} *apply-ahead* 300)
+(def ^{:dynamic true} *apply-ahead*
+  "Amount of time apply-at is scheduled to execute *before* it was scheduled
+  by the user. This is to give room for any computation/gc cycles and to allow
+  the executing fn to schedule actions on scsynth ahead of time using the at
+  macro."
+  300)

 (defn apply-at
   "Recursion in Time. Calls (apply f args argseq) *apply-ahead* ms before


teach find-ug to print the full docstring of the match if only one is returned

--- src/overtone/repl/ugens.clj
+++ src/overtone/repl/ugens.clj
@@ -73,7 +73,8 @@
 (defmacro find-ug
   "Find a ugen containing the specified terms which may be either strings or
   regexp patterns. Will search the ugen's docstrings for occurrances of all the
-  specified terms. Prints out a list of summaries of each matching ugen
+  specified terms. Prints out a list of summaries of each matching ugen.
+  If only one matching ugen is found, prints out full docstring.

   (find-ug foo)         ;=> finds all ugens containing the word foo
   (find-ug foo \"bar\") ;=> finds all ugens containing the words foo AND bar
@@ -83,9 +84,15 @@
         specs            (find-matching-ugen-specs search-terms)
         names            (map #(overtone-ugen-name (:name %)) specs)
         longest-name-len (length-of-longest-string names)]
-    (if (empty? specs)
-      (println "Sorry, unable to find a matching ugen.")
-      (print-ug-summaries specs longest-name-len))))
+    (cond
+     (empty? specs)
+     (println "Sorry, unable to find a matching ugen.")
+
+     (= 1 (count specs))
+     (print-ug-docs specs)
+
+     :default
+     (print-ug-summaries specs longest-name-len))))

 (defmacro find-ug-doc
   "Find a ugen containing the specified terms which may be either strings or


added intern

added intern

--- src/uawa/core.clj
+++ src/uawa/core.clj
@@ -2,7 +2,6 @@
 ;; (use 'uawa.core)

 ;; макроси
-(defmacro визначення "див. def" [символ документація значення] `(def ~символ ~документація ~значення))
 (defmacro змінна "див. def" [назва] `(def ~назва))
 (defmacro присвой "див. def" [назва значення] `(let [v# (def ~назва)](def ~назва ~значення)))
 (defmacro постійна "див. defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))
@@ -71,7 +70,7 @@
 (функція потребуй "див. require" [& args] (застосуй require args))
 (defmacro спробуй ([вираз винятоковий-вираз] `(try ~вираз ~винятоковий-вираз )) ([вираз винятоковий-вираз остаточний-вираз] `(try ~вираз ~винятоковий-вираз ~остаточний-вираз )) )
 (функція встав "див. interpose" ([sep] (interpose sep)) ([sep col] (interpose sep col)))
-
+(функція інтернуй "див intern"  ([ns name] (intern ns name)) ([ns name val] (intern ns name val)))
 ;; різні

 (функція дай-випадкове "див. rand-int" [максимальне] (rand-int максимальне))