remove unnecessary value test

remove unnecessary value test

--- cimi/src/com/sixsq/slipstream/ssclj/resources/callback_create_user_mitreid.clj
+++ cimi/src/com/sixsq/slipstream/ssclj/resources/callback_create_user_mitreid.clj
@@ -27,7 +27,7 @@
           (let [{:keys [sub] :as claims} (sign/unsign-claims access-token publicKey)]
             (log/debugf "MITREid access token claims for %s: %s" instance (pr-str claims))
             (if sub
-              (let [{:keys [givenName familyName emails] :as userinfo} (when sub (oidc-utils/get-mitreid-userinfo userProfileURL access-token))
+              (let [{:keys [givenName familyName emails] :as userinfo} (oidc-utils/get-mitreid-userinfo userProfileURL access-token)
                     email (->> emails (filter :primary) first :value)]
                 (if email
                   (if-let [matched-user (ex/create-user-when-missing! :mitreid {:external-login    sub


Improved image collection title edition behavior.

--- src/uxbox/ui/dashboard/images.cljs
+++ src/uxbox/ui/dashboard/images.cljs
@@ -80,23 +80,28 @@
   (let [local (:rum/local own)
         dashboard (rum/react dashboard-l)
         own? (:builtin coll false)]
-    (letfn [(on-title-save [e]
-              (rs/emit! (di/rename-collection (:id coll) (:coll-name @local)))
-              (swap! local assoc :edit false))
-            (on-title-edited [e]
+    (letfn [(persist [event]
+              (let [name (:coll-name @local)]
+                (rs/emit! (di/rename-collection (:id coll) name))
+                (swap! local assoc :edit false)))
+
+            (on-key-down [event]
               (cond
-                (kbd/esc? e)
+                (kbd/esc? event)
                 (swap! local assoc :edit false)

-                (kbd/enter? e)
-                (do (dom/stop-propagation e)
-                    (on-title-save e))
-
-                :else
-                (let [content (dom/event->inner-text e)]
-                  (swap! local assoc :coll-name content))))
-            (on-title-edit [e]
+                (kbd/enter? event)
+                (do
+                  (dom/stop-propagation event)
+                  (persist event))))
+
+            (on-input [event]
+              (let [content (dom/event->inner-text event)]
+                (swap! local assoc :coll-name content)))
+
+            (on-edit [e]
               (swap! local assoc :edit true :coll-name (:name coll)))
+
             (on-delete [e]
               (rs/emit! (di/delete-collection (:id coll))))]
       (html
@@ -106,7 +111,8 @@
            [:div.dashboard-title-field
             [:span.edit
              {:content-editable ""
-              :on-key-down on-title-edited}
+              :on-input on-input
+              :on-key-down on-key-down}
              (:name coll)]
             [:span.close
              {:on-click #(swap! local assoc :edit false)}
@@ -116,8 +122,8 @@
         (if (and (not own?) coll)
           [:div.edition
            (if (:edit @local)
-             [:span {:on-click on-title-save} i/save]
-             [:span {:on-click on-title-edit} i/pencil])
+             [:span {:on-click persist} i/save]
+             [:span {:on-click on-edit} i/pencil])
            [:span {:on-click on-delete} i/trash]])]))))

 (def ^:private page-title


fix test/props.clj

fix test/props.clj

--- test/clojure/test/props.clj
+++ test/clojure/test/props.clj
@@ -51,26 +51,26 @@

 (deftest ^:props props1
   (testing "properties 1"
-    (let [int_ (ds/entity-map [:Foo] {:a 1})
-          float_ (ds/entity-map [:Foo] {:a 1.0})
-          string_ (ds/entity-map [:Foo] {:a "Hello"})
-          bool_ (ds/entity-map [:Foo] {:a true})
+    (let [int_ (ds/entity-map! [:Foo] {:a 1})
+          float_ (ds/entity-map! [:Foo] {:a 1.0})
+          string_ (ds/entity-map! [:Foo] {:a "Hello"})
+          bool_ (ds/entity-map! [:Foo] {:a true})

           ;; keywords
-          map_ (ds/emap [:Foo] {:a {:b :c}})
-          vec_ (ds/emap [:Foo] {:a [:b :c]})
-          lst_ (ds/emap [:Foo] {:a '(:b :c)})
-          set_ (ds/emap [:Foo] {:a #{:b :c}})
+          map_ (ds/entity-map! [:Foo] {:a {:b :c}})
+          vec_ (ds/entity-map! [:Foo] {:a [:b :c]})
+          lst_ (ds/entity-map! [:Foo] {:a '(:b :c)})
+          set_ (ds/entity-map! [:Foo] {:a #{:b :c}})

           ;; symbols
-          map2 (ds/emap [:Foo] {:a {'b 'c}})
-          vec2 (ds/emap [:Foo] {:a ['b 'c]})
-          lst2 (ds/emap [:Foo] {:a '(b c)})
-          set2 (ds/emap [:Foo] {:a #{'b 'c}})
+          map2 (ds/entity-map! [:Foo] {:a {'b 'c}})
+          vec2 (ds/entity-map! [:Foo] {:a ['b 'c]})
+          lst2 (ds/entity-map! [:Foo] {:a '(b c)})
+          set2 (ds/entity-map! [:Foo] {:a #{'b 'c}})
           ;; FIXME: make nested quote work
-          ;; lst2 (ds/emap [:Foo] {:x '('b 'c)})
+          ;; lst2 (ds/entity-map! [:Foo] {:x '('b 'c)})

-          mix1 (ds/emap [:Foo] {:a {:b :c}
+          mix1 (ds/entity-map! [:Foo] {:a {:b :c}
                                   :b [1 2]
                                   :c '(foo bar)
                                   :d #{1 'x :y "z"}})


Added licence text to test_core

Added licence text to test_core

--- test/clouseau/test_core.clj
+++ test/clouseau/test_core.clj
@@ -1,3 +1,41 @@
+;;;
+;;;   Clouseau
+;;;
+;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;
+;;; Clouseau is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;;;
+;;; Clouseau is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Clouseau; see the file COPYING.  If not, write to the
+;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+;;; 02110-1301 USA.
+;;;
+;;; Linking this library statically or dynamically with other modules is
+;;; making a combined work based on this library.  Thus, the terms and
+;;; conditions of the GNU General Public License cover the whole
+;;; combination.
+;;;
+;;; As a special exception, the copyright holders of this library give you
+;;; permission to link this library with independent modules to produce an
+;;; executable, regardless of the license terms of these independent
+;;; modules, and to copy and distribute the resulting executable under
+;;; terms of your choice, provided that you also meet, for each linked
+;;; independent module, the terms and conditions of the license of that
+;;; module.  An independent module is a module which is not derived from
+;;; or based on this library.  If you modify this library, you may extend
+;;; this exception to your version of the library, but you are not
+;;; obligated to do so. If you do not wish to do so, delete this
+;;; exception statement from your version.
+;;;
+
 (ns clouseau.test-core
   (:require [clojure.test :refer :all]
             [clouseau.core :refer :all]))


Handle tab animation manually!

Handle tab animation manually!

--- src/cljs/gtfve/components/side_panel.cljs
+++ src/cljs/gtfve/components/side_panel.cljs
@@ -1,10 +1,13 @@
 (ns gtfve.components.side-panel
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [clojure.string :refer [join]]
+            [cljs.core.async :as async :refer [put! chan <! close! >!]]
             [om.core :as om]
             [sablono.core :as html :refer-macros [html]]
             [gtfve.async :refer [raise!]]
             [gtfve.state :as state]
-            [gtfve.utils :as utils]))
+            [gtfve.utils :as utils])
+  (:import [goog.events EventType]))

 (defn side-panel-tab [{:keys [key label tab]} owner]
   (reify
@@ -17,13 +20,13 @@
                              (raise! owner [:side-panel-changed {:key key}])
                              (.preventDefault e))} label]]))))

-(defn ^:private tab-class [tab key]
+(defn ^:private tab-class [active? in?]
   (join " "
         ["tab-pane" "fade" "side"
-         (when (= tab key)
-           "active in")]))
+         (when active? "active")
+         (when in? "in")]))

-(defn stop-panel [{:keys [panel data]} owner]
+(defn stop-panel [{:keys [panel data active? in?]} owner]
   (reify
     om/IDisplayName (display-name [_] "Stop Panel")
     om/IRender
@@ -31,7 +34,7 @@
       (let [tab (:tab panel)
             query (:stops-query panel)]
         (html
-         [:div {:className (tab-class tab :stops)}
+         [:div {:className (tab-class active? in?)}
           [:div.tab-content-wrapper
            [:form.form-horizontal
             {:on-submit #(do
@@ -54,33 +57,74 @@
                          [:p.list-group-item-text (str (:stop/latitude stop)
                                                        "/"
                                                        (:stop/longitude stop))]])
-                      data))]])))))
+                      data))
+           [:button.btn.btn-default.btn-block {:href "#"} "Load More"]]])))))

-(defn route-panel [{:keys [panel data]} owner]
+(defn route-panel [{:keys [panel data active? in?]} owner]
   (reify
     om/IDisplayName (display-name [_] "Routes Panel")
     om/IRender
     (render [_]
       (let [tab (:tab panel)]
         (html
-         [:div {:className (tab-class tab :routes)}
+         [:div {:className (tab-class active? in?)}
           [:p "Routes Panel"]])))))

-(defn trip-panel [{:keys [panel data]} owner]
+(defn trip-panel [{:keys [panel data active? in?]} owner]
   (reify
     om/IDisplayName (display-name [_] "Trips Panel")
     om/IRender
     (render [_]
       (let [tab (:tab panel)]
         (html
-         [:div {:className (tab-class tab :trips)}
+         [:div {:className (tab-class active? in?)}
           [:p "Trips Panel"]])))))

 (defn side-panel [{:keys [panel data]} owner]
   (reify
     om/IDisplayName (display-name [_] "Side Panel")
+    om/IInitState
+    (init-state [_]
+      (let [tab (:tab panel)]
+        {:active tab
+         :in tab
+         :toggle-ch (chan 1)
+         :kill-ch (chan 1)}))
+    om/IDidMount
+    (did-mount [_]
+      (let [{:keys [toggle-ch kill-ch]} (om/get-state owner)
+            transition-ch (utils/listen
+                           (om/get-node owner)
+                           EventType.TRANSITIONEND
+                           (chan 1 (filter #(= "opacity" (.. % -event_ -propertyName)))))
+            active-in-ch (chan 1)]
+        (go-loop []
+          (let [[v c] (alts! [active-in-ch toggle-ch kill-ch])]
+            (if (= c kill-ch)
+              ::done
+              (do
+                (condp = c
+                  toggle-ch (let [{:keys [active in]} (om/get-state owner)]
+                              (om/set-state! owner :in nil)
+                              (<! transition-ch)
+                              (om/set-state! owner :active v)
+                              (>! active-in-ch v)
+                              )
+                  active-in-ch (om/set-state! owner :in v))
+                (recur)))))))
+    om/IWillUnmount
+    (will-unmount [_]
+      (let [{:keys [kill-ch]} (om/get-state owner)]
+        (put! kill-ch (js/Date.))))
+    om/IDidUpdate
+    (did-update [_ _ _]
+      (let [{:keys [transition? toggle-ch active in]} (om/get-state owner)
+            tab (:tab panel)]
+        (when (and (not (nil? in))
+                   (not= in tab))
+          (put! toggle-ch (:tab panel)))))
     om/IRenderState
-    (render-state [_ {:keys [active? in?]}]
+    (render-state [_ {:keys [active in]}]
       (let [tab (:tab panel)]
         (html [:div.side-panel
                [:ul.nav.nav-tabs
@@ -93,10 +137,13 @@
                 (om/build side-panel-tab {:key :trips
                                           :label "Trips"
                                           :tab tab})]
-               [:div.tab-content
+               [:div.tab-content {:ref "tab-content"}
                 ;; stops
-                (om/build stop-panel {:panel panel :data (:stops data)})
+                (om/build stop-panel {:panel panel :data (:stops data)
+                                      :active? (= active :stops) :in? (= in :stops)})
                 ;; routes
-                (om/build route-panel {:panel panel :data (:routes data)})
+                (om/build route-panel {:panel panel :data (:routes data)
+                                       :active? (= active :routes) :in? (= in :routes)})
                 ;; trips
-                (om/build trip-panel {:panel panel :data (:trips data)})]])))))
+                (om/build trip-panel {:panel panel :data (:trips data)
+                                      :active? (= active :trips) :in? (= in :trips)})]])))))


small fix

small fix

--- src/cljs/salava/badge/ui/endorsement.cljs
+++ src/cljs/salava/badge/ui/endorsement.cljs
@@ -210,23 +210,23 @@
         [:a.list-group-item {:id "phrase1" :href "#" :on-click #(do
                                                                   (.preventDefault %)
                                                                   (process-text (t :badge/Endorsephrase1) state)
-                                                                  )} [:i.fa.fa-plus-circle](t :badge/Endorsephrase1)]
+                                                                  )} [:i.fa.fa-plus-circle][:span (t :badge/Endorsephrase1)]]
         [:a.list-group-item {:href "#" :on-click #(do
                                                     (.preventDefault %)
                                                     (process-text (t :badge/Endorsephrase2) state)
-                                                    )} [:i.fa.fa-plus-circle](t :badge/Endorsephrase2)]
+                                                    )} [:i.fa.fa-plus-circle][:span (t :badge/Endorsephrase2)]]
         [:a.list-group-item {:href "#" :on-click #(do
                                                     (.preventDefault %)
                                                     (process-text (t :badge/Endorsephrase3) state)
-                                                    ) } [:i.fa.fa-plus-circle](t :badge/Endorsephrase3)]
+                                                    ) } [:i.fa.fa-plus-circle][:span (t :badge/Endorsephrase3)]]
         [:a.list-group-item {:href "#" :on-click #(do
                                                     (.preventDefault %)
                                                     (process-text (t :badge/Endorsephrase4) state)
-                                                    ) } [:i.fa.fa-plus-circle](t :badge/Endorsephrase4)]
+                                                    ) } [:i.fa.fa-plus-circle][:span (t :badge/Endorsephrase4)]]
         [:a.list-group-item {:href "#" :on-click #(do
                                                     (.preventDefault %)
                                                     (process-text (t :badge/Endorsephrase5) state)
-                                                    )  } [:i.fa.fa-plus-circle](t :badge/Endorsephrase5)]]]]
+                                                    )  } [:i.fa.fa-plus-circle][:span (t :badge/Endorsephrase5)]]]]]

      [:div.editor
       [:div.form-group


Improve logging niceties

Improve logging niceties

Make the logs readable. They really should be EDN now.

Go ahead and deprecate the broken logger init arity: you *have* to
specify a logging context from now on. I think I've tracked down
everything that wasn't doing so.

--- src/clojure/frereth_cp/shared/logging.clj
+++ src/clojure/frereth_cp/shared/logging.clj
@@ -176,7 +176,7 @@
   ;; worth writing this way instead
   Logger
   (log! [_ msg]
-    (println (pr-str msg)))
+    (prn msg))
   ;; Q: Is there any point to calling .flush
   ;; on STDOUT?
   ;; A: Not according to stackoverflow.
@@ -224,11 +224,12 @@
     ::context context})
   ;; FIXME: Honestly, this needs a high-level context
   ;; i.e. What is the purpose of this group of logs?
-  ([start-clock]
-   (init "FIXME: This arity should go away" start-clock))
+  ([context]
+   (init context 0))
   ([]
    ;; the 1-arity version should include the context.
    ;; *This* is the arity that should just go away
+   (throw (RuntimeException. "Don't do this"))
    (init 0)))

 (defn file-writer-factory
@@ -260,7 +261,8 @@
   ;; The i/o costs should be quite a bit higher than
   ;; the agent overhead...though I do know that
   ;; a go-loop would be more efficient
-  (log! logger (str "Flushing logs for " context))
+  (log! logger {::what "flushing"
+                ::context context})
   (doseq [message (::entries log-state)]
     (log! logger message))
   (flush! logger)
@@ -275,7 +277,7 @@
     (-> log-state
         (update ::lamport inc)
         (assoc ::entries [])))
-  (init (inc (::lamport log-state))))
+  (init (::context log-state) (inc (::lamport log-state))))

 (s/fdef synchronize
         :args (s/cat :lhs ::state


CMR-183: Fixed typo

CMR-183: Fixed typo

--- src/cmr/indexer/data/concepts/granule.clj
+++ src/cmr/indexer/data/concepts/granule.clj
@@ -30,7 +30,7 @@
 (defn- fetch-parent-collection
   "Retrieve the parent collection umm from the db"
   [context parent-collection-id]
-  (let [parent-collection-cache (cache/cache->context context parent-collection-cache-key)
+  (let [parent-collection-cache (cache/context->cache context parent-collection-cache-key)
         concept (mdb/get-latest-concept context parent-collection-id)]
     (assoc (umm/parse-concept concept) :concept-id parent-collection-id)))


Getting errors using this system from mnist example

--- src/cortex/layers.clj
+++ src/cortex/layers.clj
@@ -1,7 +1,8 @@
 (ns cortex.layers
   (:require [cortex.protocols :as cp])
   (:require [cortex.util :as util :refer [error]]
-            [cortex.impl.layers])
+            [cortex.impl.layers]
+            [cortex.impl.wiring])
   (:require [clojure.core.matrix :as m]))

 (set! *warn-on-reflection* true)
@@ -84,11 +85,11 @@
       (cortex.impl.wiring.Split. modules))))

 (defn combine
-  "Creates a combine layer that applies a specified combination function to create the output.
+  "Creates a combine layer that applies a specified combination function to create the output.
    i.e. it behaves as a fn: [input0 input1 ....] -> output

    An optional gradient-fn may be provided, in which case the backward pass will compute a vector of input
-   gradients according to (gradient-fn input output-gradient). In the absence of a gradient-fn, input
+   gradients according to (gradient-fn input output-gradient). In the absence of a gradient-fn, input
    gradients will be zero."
   ([combine-fn]
     (cortex.impl.wiring.Combine. combine-fn))


returning more than just body in download-with-cookie

--- src/crawler/utils.clj
+++ src/crawler/utils.clj
@@ -204,7 +204,7 @@

 (defn download-with-cookie
   [a-link]
-  (try (-> a-link (client/get {:cookie-store my-cs}) :body)
+  (try (-> a-link (client/get {:cookie-store my-cs}))
        (catch Exception e nil)))

 (def *document-cache* (atom {}))


Fixed wrong starting value for c.c.a.b/concepts :next-closure

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

--- src/conexp/contrib/algorithms/bitwise.clj
+++ src/conexp/contrib/algorithms/bitwise.clj
@@ -169,17 +169,18 @@
 	object-count (int (count object-vector))
 	attribute-count (int (count attribute-vector))

+	o-prime (partial bitwise-object-derivation incidence-matrix object-count attribute-count)
+	a-prime (partial bitwise-attribute-derivation incidence-matrix object-count attribute-count)
+	start (o-prime (a-prime (BitSet.)))
+
 	intents (take-while identity
 			    (iterate #(next-closed-set object-count
 						       attribute-count
 						       incidence-matrix
 						       %)
-				     (BitSet.)))]
+				     start))]
     (map (fn [bitset]
-	   [(to-hashset object-vector (bitwise-attribute-derivation incidence-matrix
-								    object-count
-								    attribute-count
-								    bitset))
+	   [(to-hashset object-vector (a-prime bitset))
 	    (to-hashset attribute-vector bitset)])
 	 intents)))


Change npc name

Change npc name

--- src/dungeon_crusade/quests/test-quest.clj
+++ src/dungeon_crusade/quests/test-quest.clj
@@ -103,7 +103,7 @@
                                           (with-xy (current-place state)))))]
                 (add-npc state :0
                          {:id :tq0-the-dude
-                          :name "The Dude"
+                          :name "Kyle the cat enchanter"
                           :image-path "./images/npc-0.png"
                           :type :human
                           :movement-policy :constant


Add shots to wombats and zakanos.

Add shots to wombats and zakanos.

--- src/cljs/wombats_web_client/components/arena.cljs
+++ src/cljs/wombats_web_client/components/arena.cljs
@@ -43,18 +43,39 @@
   [contents meta]
   "images/poison/poison_vial.png")

-(defn- get-zakano
-  [contents meta]
+(defn- draw-zakano
+  [canvas-element contents meta x y width height]
   (let [{orientation :orientation} contents
         direction (case orientation
                     :s "front"
                     :n "back"
                     :w "left"
                     :e "right")]
-    (str "images/zakano/zakano_" direction ".png")))
-
-(defn- get-wombat
-  [contents meta]
+
+    ;; Always draw the base zakano
+    (draw-image canvas-element
+                (str "images/zakano/zakano_" direction ".png")
+                x
+                y
+                width
+                height)
+
+    ;; See if we need to add any meta to the zakano
+    (doseq [{type :type} meta]
+
+      (case type
+        :shot
+        (draw-image canvas-element
+                    (str "images/zakano/zakano_" direction "_fire.png")
+                    x
+                    y
+                    width
+                    height)
+
+        nil))))
+
+(defn- draw-wombat
+  [canvas-element contents meta x y width height]
   (let [{color :color
          orientation :orientation
          hp :hp} contents
@@ -63,7 +84,28 @@
                     :n "back"
                     :w "left"
                     :e "right")]
-    (str "images/wombats/wombat_" color "_" direction ".png")))
+
+    ;; Always draw the base wombat
+    (draw-image canvas-element
+                (str "images/wombats/wombat_" color "_" direction ".png")
+                x
+                y
+                width
+                height)
+
+    ;; See if we need to add any meta to the wombat
+    (doseq [{type :type} meta]
+
+      (case type
+        :shot
+        (draw-image canvas-element
+                    (str "images/wombats/wombat_" color "_" direction "_fire.png")
+                    x
+                    y
+                    width
+                    height)
+
+        nil))))

 (defn- draw-open
   "Draws whatever belongs on an open cell"
@@ -130,29 +172,13 @@
                   height)

       :zakano
-      (draw-image canvas-element
-                  (get-zakano contents meta)
-                  x
-                  y
-                  width
-                  height)
+      (draw-zakano canvas-element contents meta x y width height)

       :wombat
-      (draw-image canvas-element
-                  (get-wombat contents meta)
-                  x
-                  y
-                  width
-                  height)
+      (draw-wombat canvas-element contents meta x y width height)

       :open
-      (draw-open canvas-element
-                 contents
-                 meta
-                 x
-                 y
-                 width
-                 height)
+      (draw-open canvas-element contents meta x y width height)

       (js/console.log "Unhandled: " cell-type))))


Hide chat panel if you don't have any bots in the game.

--- src/cljs/wombats_web_client/panels/game-play.cljs
+++ src/cljs/wombats_web_client/panels/game-play.cljs
@@ -81,11 +81,15 @@
                                   :show-overlay? false}]))

 (defn right-game-play-panel
-  [info messages]
-  (let [winner (:game-winner @info)]
+  [info messages user]
+
+  (let [{:keys [game-winner stats]} @info
+        user-bots (filter #(= (:username %)
+                              (::user/github-username @user))
+                          stats)]
     ;; Dispatch winner modal if there's a winner
-    (when winner
-      (show-winner-modal winner))
+    (when game-winner
+      (show-winner-modal game-winner))

     [:div.right-game-play-panel

@@ -95,15 +99,17 @@
       [max-players info]
       [ranking-box info]]

-     [:div.chat-panel
-      [chat-title]
-      [chat-box @game-id messages info]]]))
+     (when (> (count user-bots) 0)
+       [:div.chat-panel
+        [chat-title]
+        [chat-box @game-id messages info]])]))

 (defn game-play []
   (let [dimensions (get-arena-dimensions)
         arena (re-frame/subscribe [:game/arena])
         info (re-frame/subscribe [:game/info])
-        messages (re-frame/subscribe [:game/messages])]
+        messages (re-frame/subscribe [:game/messages])
+        user (re-frame/subscribe [:current-user])]

     ;; TODO This should come from the router
@@ -122,4 +128,4 @@
             [:canvas {:id canvas-id
                       :width dimensions
                       :height dimensions}]]
-           [right-game-play-panel info messages]]))})))
+           [right-game-play-panel info messages user]]))})))


TRDR-46: fix typo

TRDR-46: fix typo

--- src/main/cljs/cljs/tools/reader/impl/inspect.cljs
+++ src/main/cljs/cljs/tools/reader/impl/inspect.cljs
@@ -46,7 +46,7 @@

 (defmethod inspect* :strable [truncate x] (str x))

-(defmethod inspect* cljs.coreIndexedSeq [truncate x]
+(defmethod inspect* cljs.core/IndexedSeq [truncate x]
   "<indexed seq>")

 (defmethod inspect* cljs.core/PersistentArrayMapSeq [truncate x]


Concatenating stdout to execute_result

Concatenating stdout to execute_result

--- src/ipython_clojure/messaging/execute.clj
+++ src/ipython_clojure/messaging/execute.clj
@@ -22,12 +22,14 @@
   (let [resp (repl/message (repl/client repl-conn 1000) {:op "eval" :code (get-in request [:content :code])})
         prepared-resp (prepare-resp resp)]
     (swap! nrepl-session (fn [_] (-> resp first :session)))
+    (println prepared-resp)
     (if (:value prepared-resp)
-      {:value (first (:value prepared-resp))}
-      (select-keys prepared-resp [:err :root-ex :ex]))))
+      {:value (first (:value prepared-resp)) :out (:out prepared-resp)}
+      (select-keys prepared-resp [:err :root-ex :ex :out]))))

 (defn execute-reply-message
   [execute-result]
+  (println execute-result)
   (if (:err execute-result)
     {:status "error"
      :execution_count @execution-count
@@ -38,6 +40,13 @@
      :execution_count @execution-count
      :payload [{:source "page" :data {:text/plain (str (:value execute-result))} :start 0}]
      :user_expressions {}}))
+
+(defn concatenate-out-on-front
+  [execute-result]
+  (let [original-value (if (:err execute-result) (:err execute-result) (:value execute-result))]
+    (if (:out execute-result)
+      (str (:out execute-result) original-value)
+      (str original-value))))

 (defn send-out-message!
   [iopub-socket username parent-header session-id execute-result]
@@ -51,12 +60,12 @@
                   parent-header {} session-id)
       (send-message iopub-socket "execute_result" username
                     {:execution_count @execution-count
-                     :data {:text/plain (str (:err execute-result))}
+                     :data {:text/plain (concatenate-out-on-front execute-result)}
                      :metadata {}}
                     parent-header {} session-id))
     (send-message iopub-socket "execute_result" username
                   {:execution_count @execution-count
-                   :data {:text/plain (str (:value execute-result))}
+                   :data {:text/plain (concatenate-out-on-front execute-result)}
                    :metadata {}}
                   parent-header {} session-id)))

@@ -71,6 +80,9 @@
                   parent-header {} session-id)
     (send-message iopub-socket "execute_input" username (pyin-content @execution-count message)
                   parent-header {} session-id)
+    (when (:out execute-result)
+      (send-message shell-socket "stream" username {:name "stdout" :text (:out execute-result)}
+                    parent-header {} session-id))
     (send-message shell-socket "execute_reply" username
                   (execute-reply-message execute-result)
                   parent-header


Added sponsors Cognitect and GitLab

Added sponsors Cognitect and GitLab

Registration is now OPEN
Added sponsor links to images

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/main/cljs/clojurebridgemn/client.cljs
+++ src/main/cljs/clojurebridgemn/client.cljs
@@ -593,9 +593,9 @@
      "Our next ClojureBridgeMN workshop is scheduled for 11/4-5"
      [:br]
      [:br]
-     "Check back here for news on when the "
+     "Sign up NOW on "
      [:a {:href "http://clojurebridgemn-2016.eventbrite.com"} "Eventbrite"]
-     " opens in October"
+     " !"
      ]
     }
    :logos
@@ -744,17 +744,32 @@
        [:a {:href "http://tech.puredanger.com"} "Alex Miller"]
        ", "
        [:a {:href "https://lambdaisland.com"} "Lambda Island"]
+       ", "
+       [:a {:href "http://cognitect.com"} "Cognitect"]
+       ", "
+       [:a {:href "https://gitlab.com"} "GitLab"]
        [:br]
-       [:img {:alt "Object Partners"
-              :src "images/sponsors/ObjectPartners_400x400.png"}]
-       [:img {:alt "PurelyFunctional.tv"
-              :src "images/sponsors/Lispcast.png"}]
-       [:img {:alt "World Singles"
-              :src "images/sponsors/world-singles.svg"}]
-       [:img {:alt "Alex Miller"
-              :src "images/sponsors/puredanger.jpg"}]
-       [:img {:alt "Lambda Island"
-              :src "images/sponsors/lambdaisland.png"}]]
+       [:a {:href "https://objectpartners.com/"}
+        [:img {:alt "Object Partners"
+               :src "images/sponsors/ObjectPartners_400x400.png"}]]
+       [:a {:href "https://purelyfunctional.tv/"}
+        [:img {:alt "PurelyFunctional.tv"
+               :src "images/sponsors/Lispcast.png"}]]
+       [:a {:href "http://worldsingles.com/"}
+        [:img {:alt "World Singles"
+               :src "images/sponsors/world-singles.svg"}]]
+       [:a {:href "http://tech.puredanger.com"}
+        [:img {:alt "Alex Miller"
+               :src "images/sponsors/puredanger.jpg"}]]
+       [:a {:href "https://lambdaisland.com"}
+        [:img {:alt "Lambda Island"
+               :src "images/sponsors/lambdaisland.png"}]]
+       [:a {:href "http://cognitect.com"}
+        [:img {:alt "Cognitect"
+               :src "images/sponsors/cognitect.jpg"}]]
+       [:a {:href "https://gitlab.com"}
+        [:img {:alt "GitLab"
+               :src "images/sponsors/gitlab.png"}]]]
       [:li "November 13-14 2015: Vidku, Harbinger Partners" [:br]
        [:img {:alt "Vidku"
               :src "images/sponsors/vidku_400x400.png"}]


refactor aggregator to reduce inputs and decouple from metadata

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -118,54 +118,78 @@

 ;; make a class to hold key, version and aggregate value...

-(def Length-properties
-     (list
-      [String "type"]
-      [(Integer/TYPE) "version"]
-      [(Float/TYPE) "length"]))
+(defn make-metadata [classname pktype pkname fieldtype fieldname]
+  (let [properties (list [pktype pkname] [(Integer/TYPE) "version"] [fieldtype fieldname])]
+  (new GetterMetadata
+       (apply make-class classname Object properties)
+       (map (fn [property] (.getCanonicalName (first property))) properties)
+       (map second properties)
+       (map
+	(fn [property]
+	    (make-proxy-getter
+	     class
+	     (first property)
+	     (second property)))
+	properties))))

-(def Length
-     (apply
-      make-class
-      "org.dada.demo.whales.Length" Object Length-properties))
+(defn make-aggregator [metadata modelname pkval initial-value fieldname]
+  (let [class (.getValueClass metadata)
+	getter ((apply array-map (interleave (.getAttributeNames metadata) (.getAttributeGetters metadata))) fieldname)
+	accessor #(.get getter %)]
+    (AggregatedModelView.
+     modelname
+     metadata
+     pkval
+     (proxy
+      [AggregatedModelView$Aggregator]
+      []
+      (initialValue []
+		    initial-value)
+      (currentValue [key version value]
+		    (make-instance class key version value))
+      (aggregate [insertions updates deletions]
+		 (-
+		  (+
+		   (apply + (map #(accessor (.getNewValue %)) insertions))
+		   (apply + (map #(accessor (.getNewValue %)) updates))
+		   )
+		  (+
+		   (apply + (map #(accessor (.getOldValue %)) updates))
+		   (apply + (map #(accessor (.getOldValue %)) deletions))
+		   )))
+      (apply [currentValue delta]
+	     (+ currentValue delta))
+      )
+     )))

-(def sum
-     (AggregatedModelView.
-      "Beluga.Length"
-      (new GetterMetadata
-	   Length
-	   (map (fn [property] (.getCanonicalName (first property))) Length-properties)
-	   (map second Length-properties)
-	   (map
-	    (fn [property]
-		(make-proxy-getter
-		 Length
-		 (first property)
-		 (second property)))
-	    Length-properties))
-      "beluga whale"
-      (proxy
-       [AggregatedModelView$Aggregator]
-       []
-       (initialValue []
-		     (new Float "0"))
-       (currentValue [key version value]
-		     (make-instance Length key version value))
-       (aggregate [insertions updates deletions]
-		  (-
-		   (+
-		    (apply + (map #(.getLength (.getNewValue %)) insertions))
-		    (apply + (map #(.getLength (.getNewValue %)) updates))
-		    )
-		   (+
-		    (apply + (map #(.getLength (.getOldValue %)) updates))
-		    (apply + (map #(.getLength (.getOldValue %)) deletions))
-		    )))
-       (apply [currentValue delta]
-	      (+ currentValue delta))
-       )
-      ))
+;; classname - "org.dada.demo.whales.Length"
+;; modelname - "Beluga.Length"
+;; pktype - String
+;; pkname - "type"
+;; pkval - "beluga whale"
+;; fieldtype - (Float/TYPE)
+;; fieldname - "length"
+;; initial-value - (new Float "0")
+;; accessor - .getLength
+
+;; make-metadata [classname pktype pkname fieldtype fieldname]
+;; make-aggregator [metadata modelname pkval initial-value fieldname]
+(def
+ sum
+ (let [fieldtype (Float/TYPE) ;; could get this from metadata
+       fieldname "length"
+       initialvalue (new Float "0")
+       packagename "org.dada.demo.whales"
+       classname (str packagename "." "Length")
+       metadata (make-metadata classname String "type" fieldtype fieldname)]
+   (make-aggregator metadata "Beluga.Length" "beluga whale" initialvalue fieldname)
+   ))

 (insert *metamodel* sum)

-(connect belugas sum)+(connect belugas sum)
+
+
+;; extract output class from aggregate and create an aggregator per type of whale
+;; collect all aggregators together for length and weight
+;; pivot them into a single Model


added delete-user test

added delete-user test

--- test/server/rooms-test.cljs
+++ test/server/rooms-test.cljs
@@ -37,3 +37,8 @@
       (fn [err reply]
         (is (= [user1 user2] reply))
         (done)))))
+
+(deftest ^:async delete-user
+  (let [room "room:testfoo"
+        id   "tester"]
+    ))


Print message when RuboCop is not found

Print message when RuboCop is not found

--- src/lt/plugins/rubocop.cljs
+++ src/lt/plugins/rubocop.cljs
@@ -12,8 +12,6 @@
   (:require-macros [lt.macros :refer [defui behavior background]]))

 (def shell (load/node-module "shelljs"))
-
-(def rubocop-path (.which shell "rubocop"))

 (defui cop-marker [cops]
   [:div.rubocop-gutter-marker
@@ -102,8 +100,11 @@
 (behavior ::run-file
           :triggers #{::run-file}
           :reaction (fn [this]
-                      (let [path (-> @this :info :path)]
-                      (offences this (files/parent path) path rubocop-path))))
+                      (let [path (-> @this :info :path)
+                            rubocop-path (.which shell "rubocop")]
+                        (if rubocop-path
+                          (offences this (files/parent path) path rubocop-path)
+                          (notifos/msg* "RuboCop not found. Install with `gem install rubocop`.")))))

 (cmd/command {:command ::run-cop
               :desc "RuboCop: Run RuboCop against current file"


Fixed problem with controls not loading immediately

--- src/datview/core.cljs
+++ src/datview/core.cljs
@@ -54,55 +54,8 @@
          {:padding "5px 12px"}))

-(declare default-controls)
-
 ;; Need to standardize keys, and make schema ready
-(def default-mappings
-  {:attributes {:attr-values-view {:style h-box-styles}
-                :value-view {:style (merge h-box-styles
-                                           {:padding "3px"})}
-                :attr-view  {:style (merge v-box-styles
-                                           {:padding "5px 12px"})}
-                :label-view {:style {:font-size "14px"
-                                     :font-weight "bold"}}
-                ;:pull-view {:style (merge h-box-styles)}
-                :pull-view {:style (merge h-box-styles
-                                          {:padding "8px 15px" :width "100%"}
-                                          bordered-box-style)}
-                ;; I guess controls works a bit differently?
-                :controls {:style (merge h-box-styles
-                                         {:padding "3px"})}
-                :pull-view-summary {:style (merge v-box-styles
-                                                  {:padding "15px"
-                                                   :font-size "18px"
-                                                   :font-weight "bold"})}}
-   :controls default-controls})
-
-   ;; Stuff for pull-data-view controls and such
-        ;[re-com/v-box
-         ;;:padding "10px"
-         ;:style style
-         ;:gap "10px"
-         ;:children [;; Little title bar thing with controls
-                    ;(when controls
-                      ;[re-com/h-box
-                       ;:justify :end
-                       ;:padding "15px"
-                       ;:gap "10px"
-                       ;;:style {:background "#DADADA"}
-                       ;:children [controls conn]])]]
-
-                    ;[re-com/h-box
-                     ;;:align :center
-                     ;:gap "10px"
-                     ;:children [[re-com/v-box
-                                 ;:padding "15px"
-                                 ;:children [[entity-summary conn eid]]]
-                                ;[re-com/v-box
-                                 ;:children (for [[attr-ident values] pull-data]
-                                             ;;; Dynamatch the id functions?
-                                             ;^{:key (hash attr-ident values)}
-                                             ;[attribute-values-view conn attr-ident values])]]]
+(def default-mappings (r/atom {}))

 (defn box
   "Prefers children over child"
@@ -194,7 +147,7 @@
       (reaction
         ;(update-in
           (utils/deep-merge
-            default-mappings
+            @default-mappings
             @(default-config conn)
             (or (utils/deref-or-value (:datview/spec view-spec))
                 view-spec))))))
@@ -567,3 +520,50 @@
               (sort-by @(attr-sort-by conn attr-ident) values)
               (sort values))))

+;; Have to do this after everything else so this can reference all of the control components (etc)
+(reset! default-mappings
+  {:attributes {:attr-values-view {:style h-box-styles}
+                :value-view {:style (merge h-box-styles
+                                           {:padding "3px"})}
+                :attr-view  {:style (merge v-box-styles
+                                           {:padding "5px 12px"})}
+                :label-view {:style {:font-size "14px"
+                                     :font-weight "bold"}}
+                ;:pull-view {:style (merge h-box-styles)}
+                :pull-view {:style (merge h-box-styles
+                                          {:padding "8px 15px" :width "100%"}
+                                          bordered-box-style)}
+                ;; I guess controls works a bit differently?
+                :controls {:style (merge h-box-styles
+                                         {:padding "3px"})}
+                :pull-view-summary {:style (merge v-box-styles
+                                                  {:padding "15px"
+                                                   :font-size "18px"
+                                                   :font-weight "bold"})}}
+   :controls default-controls})
+
+   ;; Stuff for pull-data-view controls and such
+        ;[re-com/v-box
+         ;;:padding "10px"
+         ;:style style
+         ;:gap "10px"
+         ;:children [;; Little title bar thing with controls
+                    ;(when controls
+                      ;[re-com/h-box
+                       ;:justify :end
+                       ;:padding "15px"
+                       ;:gap "10px"
+                       ;;:style {:background "#DADADA"}
+                       ;:children [controls conn]])]]
+
+                    ;[re-com/h-box
+                     ;;:align :center
+                     ;:gap "10px"
+                     ;:children [[re-com/v-box
+                                 ;:padding "15px"
+                                 ;:children [[entity-summary conn eid]]]
+                                ;[re-com/v-box
+                                 ;:children (for [[attr-ident values] pull-data]
+                                             ;;; Dynamatch the id functions?
+                                             ;^{:key (hash attr-ident values)}
+                                             ;[attribute-values-view conn attr-ident values])]]]


Coerce date keys to a Java date in html parsers.

--- src/incise/parsers/html.clj
+++ src/incise/parsers/html.clj
@@ -8,6 +8,7 @@
             [incise.config :as conf]
             [taoensso.timbre :refer [info]]
             [clojure.edn :as edn]
+            [clj-time.coerce :refer [to-date]]
             [clojure.string :as s]
             [clojure.java.io :refer [file reader]])
   (:import [java.io File]))
@@ -29,7 +30,8 @@
                                    :content content} parse-meta)]
     (map->Parse
       (assoc meta-with-defaults
-             :path (meta->write-path meta-with-defaults)))))
+             :path (meta->write-path meta-with-defaults)
+             :date (-> meta-with-defaults :date to-date)))))

 (defn File->Parse
   "Read in a file and turn it into a Parse instance."


Adds more ZK paths.

Adds more ZK paths.

--- src/onyx/sync/zookeeper.clj
+++ src/onyx/sync/zookeeper.clj
@@ -22,6 +22,12 @@

 (defn ack-path [prefix]
   (str root-path "/" prefix "/ack"))
+
+(defn exhaust-path [prefix]
+  (str root-path "/" prefix "/exhaust"))
+
+(defn seal-path [prefix]
+  (str root-path "/" prefix "/seal"))

 (defn completion-path [prefix]
   (str root-path "/" prefix "/completion"))
@@ -51,6 +57,8 @@
       (zk/create conn (pulse-path prefix) :persistent? true)
       (zk/create conn (payload-path prefix)  :persistent? true)
       (zk/create conn (ack-path prefix) :persistent? true)
+      (zk/create conn (exhaust-path prefix) :persistent? true)
+      (zk/create conn (seal-path prefix) :persistent? true)
       (zk/create conn (completion-path prefix) :persistent? true)
       (zk/create conn (status-path prefix) :persistent? true)
       (zk/create conn (catalog-path prefix) :persistent? true)
@@ -102,6 +110,20 @@
     (zk/create (:conn sync) place :persistent? true)
     place))

+(defmethod extensions/create [ZooKeeper :exhaust]
+  [sync _]
+  (let [prefix (:onyx-id sync)
+        place (str (exhaust-path prefix) "/" (UUID/randomUUID))]
+    (zk/create (:conn sync) place :persistent? true)
+    place))
+
+(defmethod extensions/create [ZooKeeper :seal]
+  [sync _]
+  (let [prefix (:onyx-id sync)
+        place (str (seal-path prefix) "/" (UUID/randomUUID))]
+    (zk/create (:conn sync) place :persistent? true)
+    place))
+
 (defmethod extensions/create [ZooKeeper :completion]
   [sync _]
   (let [prefix (:onyx-id sync)


adding some more instruments

adding some more instruments

--- src/overtone/inst/synth.clj
+++ src/overtone/inst/synth.clj
@@ -9,6 +9,24 @@
   (let [snd (sin-osc (midicps note))
         env (env-gen (perc a b) :action :free)]
     (* env snd)))
+
+(definst tb303 [note 60 wave 1
+                cutoff 100 r 0.9
+                attack 0.101 decay 1.8 sustain 0.2 release 0.2
+                env 200 gate 0 vol 0.8]
+  (let [freq       (midicps note)
+        freqs      [freq (* 1.01 freq)]
+        vol-env    (env-gen (adsr attack decay sustain release)
+                            (line:kr 1 0 (+ attack decay release))
+                            :action :free)
+        fil-env    (env-gen (perc))
+        fil-cutoff (+ cutoff (* env fil-env))
+        waves     [(* vol-env (saw freqs))
+                   (* vol-env [(pulse (first freqs) 0.5)
+                               (lf-tri (second freqs))])]
+        selector   (select wave (apply + waves))
+        filt       (rlpf selector fil-cutoff r)]
+    filter))

 (definst rise-fall-pad [freq 440 t 4 amt 0.3 amp 0.8]
   (let [f-env      (env-gen (perc t t) 1 1 0 1 :free)
@@ -131,6 +149,14 @@
                       (line 1 0.05 25))
         sound (apply + sound)]
   (* (lf-saw:kr (line:kr 13 17 3)) (line:kr 1 0 dur :free) sound)))
+
+(definst bubbles [bass-freq 80]
+  (let [bub (+ bass-freq (* 3 (lf-saw:kr [8 7.23])))
+        glis (+ bub (* 24 (lf-saw:kr 0.4 0)))
+        freq (midicps glis)
+        src (* 0.04 (sin-osc freq))
+        zout (comb-n src :decaytime 4)]
+    zout))

 ;(def alien-buffer (buffer 2250))
 ;(definst alien-computer [trig 0.3]


Add pseudo control ugens to separate out control ugens to total number of params.

--- src/overtone/repl/debug.clj
+++ src/overtone/repl/debug.clj
@@ -6,13 +6,31 @@
         [overtone.sc.machinery.synthdef]
         [overtone.helpers seq lib]))

+(defn- control-ugen-name?
+  [ug-n]
+  (or (= "trig-control" ug-n)
+      (= "audio-control" ug-n)
+      (= "control" ug-n)))
+
+(defn- control-ugen?
+  [ug]
+  (control-ugen-name? (:name ug)))
+
+(defn- mk-control-id
+  [ug-id output-idx]
+  (str "control_" ug-id "_" output-idx))
+
 (defn- unify-input
   [input ugens constants]
   (if (= -1 (:src input))
     (nth constants (:index input))
-    (let [idx (:src input)]
-      {:name (:name (nth ugens idx))
-       :id idx})))
+    (let [idx (:src input)
+          n (:name (nth ugens idx))
+          id (if (control-ugen-name? (overtone-ugen-name n))
+               (mk-control-id idx (:index input))
+               idx)]
+      {:name n
+       :id id})))

 (defn- unify-ugen-name
   [ugen]
@@ -24,61 +42,128 @@

 (defn- unify-ugen
   [ugen ugens sdef]
-  {:name (unify-ugen-name ugen)
-   :rate (REVERSE-RATES (:rate ugen))
-   :special (:special ugen)
-   :inputs (map #(unify-input % ugens (:constants sdef)) (:inputs ugen))
+  {:name      (unify-ugen-name ugen)
+   :rate      (REVERSE-RATES (:rate ugen))
+   :special   (:special ugen)
+   :inputs    (map #(unify-input % ugens (:constants sdef)) (:inputs ugen))
    :n-outputs (count (:outputs ugen))
-   :outputs (:outputs ugen)
-   :id (:id ugen)})
+   :outputs   (:outputs ugen)
+   :id        (:id ugen)})

 (defn- fix-input-refs
+  "Resolve input references to inline their name if another ugen or the
+   value if a float."
   [inputs ugens]
   (map (fn [input]
          (if (number? input)
            input
-           {:name (overtone-ugen-name (:name input))
-            :id (index-of ugens (find-first #(= (:id %) (:id input)) ugens))}))
+           (let [n (overtone-ugen-name (:name input))]
+             {:name n
+              :id (index-of ugens (find-first #(= (:id %) (:id input)) ugens))})))
        inputs))
+
+(defn- unify-ugen-inputs
+  [ugens]
+  (map (fn [ug idx]
+         (let [inputs      (fix-input-refs (:inputs ug) ugens)
+               input-specs (or (:args (get-ugen-spec (:name ug)))
+                               [{:name "a"}
+                                {:name "b"}])]
+           (assoc ug
+             :id idx
+             :inputs (loop [res         {}
+                            inputs      inputs
+                            input-specs input-specs]
+                       (if (empty? input-specs)
+                         res
+                         (if (ugen-sequence-mode? (:mode (first input-specs)))
+                           (let [arg-seq (drop (dec (count input-specs)) inputs)
+                                 inputs  (drop-last (count arg-seq) inputs)]
+                             (recur (assoc res (keyword (:name (first input-specs))) (vec arg-seq))
+                                    inputs
+                                    (rest input-specs)))
+
+                           (recur (assoc res (keyword (:name (first input-specs))) (first inputs))
+                                  (rest inputs)
+                                  (rest input-specs))))))))
+       ugens
+       (range)))
+
+(defn- find-control-offset
+  "Calculate the output offset of the specified control ugen in the list
+   of ugens. The first control ugen has an offset of 0, the second has
+   an offest equalling the number of outputs of the first control ugen
+   and the third equalling the summation of the number of outputs of the
+   first and second control ugens, etc."
+  [c-name sdef]
+  (let [ctl-ugs (filter (fn [ug]
+                          (control-ugen-name? (overtone-ugen-name (:name ug))))
+                        (:ugens sdef))]
+    (loop [res 0
+           ugs ctl-ugs]
+      (when (empty? ugs)
+        (throw (Exception. (str "Couldn't find ugen with name " c-name
+                                " when calculating control offset val.") )))
+      (let [ug (first ugs)]
+        (if (= c-name (overtone-ugen-name (:name ug)) )
+          res
+          (recur (+ res (:n-outputs ug)) (rest ugs)))))))
+
+(defn- expand-control-ug
+  [ug c-idx sdef]
+  (reduce (fn [res idx]
+            (conj res (assoc ug
+                        :inputs {}
+                        :orig-id c-idx
+                        :control-param (nth (:unified-params sdef) (+ (find-control-offset (:name ug) sdef)))
+                        :default 1
+                        :id (mk-control-id (:id ug) idx)
+                        :outputs (nth (:outputs ug) idx))))
+          []
+          (range (:n-outputs ug))))
+
+
+(defn expand-control-ugs
+  "expands control ugens to a number of psuedo ugens which are easier to
+ understand"
+  [control-ugs sdef]
+  (mapcat (fn [ug idx]  (expand-control-ug ug idx sdef)) control-ugs (range)))
+
+(defn- unify-control-ugens
+  [ugens sdef]
+  (let [control-ugs          (filter control-ugen? ugens)
+        std-ugs              (remove control-ugen? ugens)
+        expanded-control-ugs (expand-control-ugs control-ugs sdef)]
+    (concat expanded-control-ugs std-ugs)
+))

 (defn- unify-ugens
   [orig-ugens sdef]
   (let [ugens (map (fn [ug idx] (assoc ug :id idx)) orig-ugens (range))
         ugens (map #(unify-ugen % ugens sdef) ugens)
-        ugens (map (fn [ug o-ug idx]
-                     (let [inputs      (fix-input-refs (:inputs ug) ugens )
-                           input-specs (or (:args (get-ugen-spec (:name ug)))
-                                           [{:name "a"}
-                                            {:name "b"}]) ]
-                       (assoc ug
-                         :id idx
-                         :inputs (loop [res {}
-                                        inputs inputs
-                                        input-specs input-specs]
-                                   (if (empty? input-specs)
-                                     res
-                                     (if (ugen-sequence-mode? (:mode (first input-specs)))
-                                       (let [arg-seq (drop (dec (count input-specs)) inputs)
-                                             inputs  (drop-last (count arg-seq) inputs)]
-                                         (recur (assoc res (keyword (:name (first input-specs))) (vec arg-seq))
-                                                inputs
-                                                (rest input-specs)))
-
-                                       (recur (assoc res (keyword (:name (first input-specs))) (first inputs))
-                                              (rest inputs)
-                                              (rest input-specs))))))))
-                   ugens
-                   orig-ugens
-                   (range))]
+        ugens (unify-control-ugens ugens sdef)
+        ugens (unify-ugen-inputs ugens)
+        ]
+
     (sort #(compare (:name %1) (:name %2)) ugens)))

+(defn- unify-params
+  [sdef]
+  (map (fn [pname]
+         (-> pname
+             (assoc :default (nth (:params sdef) (:index pname)))
+             (dissoc :index)))
+       (:pnames sdef)))
+
 (defn- unify-synthdef-sdef
   [sdef]
-  {:name    (:name sdef)
-   :params  (:params sdef)
-   :pnames  (:pnames sdef)
-   :n-ugens (count (:ugens sdef))
-   :ugens   (unify-ugens (:ugens sdef) sdef)})
+  (with-meta
+    (let [unified-params (unify-params sdef) ]
+      {:name    (:name sdef)
+       :params  unified-params
+       :n-ugens (count (:ugens sdef))
+       :ugens   (unify-ugens (:ugens sdef) (assoc sdef :unified-params unified-params))})
+    {:type ::unified-synthdef}))

 (defmulti unify-synthdef
   "Munge synthdef into a readable 'unified' format - ensures that two
@@ -120,6 +205,10 @@
   [sdef]
   (unify-synthdef (:sdef sdef)))

+(defmethod unify-synthdef overtone.studio.inst.Inst
+  [sdef]
+  (unify-synthdef (:sdef sdef)))
+
 (defmethod unify-synthdef :default
   [sdef]
   (throw (IllegalArgumentException. (str "Unknown synthdef type to unify: " (type sdef)))))


Fixed (possible) NPE in functions that parse job name

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -41,26 +41,32 @@

 (defn job-name->product-name
     [job-name]
-    (let [name-version (clojure.string/split job-name #"-")
-          product-name (second name-version)]
-          (if product-name
-              (clojure.string/replace product-name "_" " "))))
+    (if job-name
+        (let [name-version (clojure.string/split job-name #"-")
+              product-name (second name-version)]
+              (if product-name
+                  (clojure.string/replace product-name "_" " ")))
+        "unknown"))

 (defn job-name->version
     [job-name]
-    (let [name-version (clojure.string/split job-name #"-")
-          version      (get name-version 2)]
-          (if (and version (re-matches #"[0-9.]+" version))
-              version
-              "unknown")))
+    (if job-name
+        (let [name-version (clojure.string/split job-name #"-")
+              version      (get name-version 2)]
+              (if (and version (re-matches #"[0-9.]+" version))
+                  version
+                  "unknown"))
+        "unknown"))

 (defn job-name->book-name
     [job-name]
-    (let [name-version (clojure.string/split job-name #"-")
-          book-name    (get name-version 3)]
-          (if book-name
-              (clojure.string/replace book-name "_" " ")
-              "unknown")))
+    (if job-name
+        (let [name-version (clojure.string/split job-name #"-")
+              book-name    (get name-version 3)]
+              (if book-name
+                  (clojure.string/replace book-name "_" " ")
+                  "unknown"))
+        "unknown"))

 (defn job-name->environment
     [job-name preview-jobs-suffix stage-jobs-suffix prod-jobs-suffix]


proper redirecting /

proper redirecting /

--- src/evalback/core.clj
+++ src/evalback/core.clj
@@ -139,7 +139,7 @@

 (defroutes app
-  (ANY "/" [] (resp/file-response "index.html"))
+  (GET "/" [] (resp/redirect "index.html"))
   (ANY "/version" [] (str (.getVersion (get-api))))
   (POST "/xxx" [formalism input] old-json-answer)
   (resources "/")


Test.

Test.

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -131,7 +131,7 @@
   :malformed? #(parse-json % ::data)
   :post! (fn [context]
            (add-event-to-channel channel-id (::data context))
-           nil))
+           {}))

 (defresource channel-subscribers [channel-id]
   :allowed-methods [:post]


Fix a bug in slide-synth

Fix a bug in slide-synth

--- src/literate_2048/core.cljs
+++ src/literate_2048/core.cljs
@@ -179,8 +179,8 @@
           (case direction
             :left (map slide-synth-line rows)
             :right (map reverse-slide-synth-line rows)
-            :up (-> cols (map slide-synth-line) transpose)
-            :down (-> cols (map reverse-slide-synth-line) transpose))))))
+            :up (->> cols (map slide-synth-line) transpose)
+            :down (->> cols (map reverse-slide-synth-line) transpose))))))

 ;; A tile is added when the board changes.


Fixes bug in internal provider data where state wasn't sent together with other params to the provider.

--- src/loudmoauth/provider.clj
+++ src/loudmoauth/provider.clj
@@ -52,14 +52,14 @@

 (defn build-provider
   [provider-data]
-  (let [rtype "code"]
+  (let [rtype "code" state (util/uuid)]
   {:code (promise)
    :expires_in (ref nil)
    :refresh_token (ref nil)
    :access_token (ref nil)
-   :state (util/uuid)
+   :state state
    :response-type rtype
-   :auth-url (auth-url (merge provider-data {:response-type rtype}))
+   :auth-url (auth-url (merge provider-data {:response-type rtype :state state}))
    :token-url (token-url provider-data)}))

 (defn create-new-provider


Throughput graphs, fix graph version directories.

--- test/riemann/test/bench.clj
+++ test/riemann/test/bench.clj
@@ -6,17 +6,18 @@
   (:require [riemann.streams])
   (:use [clojure.test])
   (:use [clojure.java.shell])
+  (:use [clojure.string :only [trim-newline]])
   (:use [incanter core stats charts]))

 (defn git-version
   "Returns a human-readable version name for this commit."
   []
-  (if (re-matches #"^\r+$" (:out (sh "git" "status" "-s")))
+  (if (re-matches #"^\n*$" (:out (sh "git" "status" "-s")))
     ; Unchanged commit.
     (str
-      (:out (sh "git" "show" "-s" "--format=\"%ci\"" "HEAD"))
+      (trim-newline (:out (sh "git" "show" "-s" "--format=%ci" "HEAD")))
       " "
-      (:out (sh "git" "rev-parse" "HEAD" :out "UTF-8")))
+      (trim-newline (:out (sh "git" "rev-parse" "HEAD" :out "UTF-8"))))

     ; Changed commit.
     "HEAD"))
@@ -34,7 +35,7 @@
          ret# ~expr]
      (/ (- (. System (nanoTime)) start#) 1000000.0)))

-(defn latencies
+(defn record
   "Returns [times, latencies] of calling f"
   ([f opts]
    (let [n    (or (:n opts) 100)
@@ -48,21 +49,59 @@
                 (conj times (- (now) t0))
                 (conj latencies (time* (f)))))))))

+(defn throughput
+  "Returns [times, throughputs] of tape"
+  ([tape opts]
+   (let [[times latencies] tape
+         samples (min (dec (count times)) (max 1 (or (:samples opts) 1000)))
+         sample-size (/ (dec (count times)) samples)
+         selected-times (take-nth sample-size times)
+         throughputs (map (fn [[t1 t2]]
+                            (/ sample-size (- t2 t1)))
+                          (partition 2 1 selected-times))]
+     [(drop-last selected-times) throughputs])))
+
+(defn latencies
+  [tape opts]
+  tape)
+
+(defn save-graph [graph opts]
+  (let [file (str "bench/" (git-version-memo) "/" (:title opts) ".png")]
+    (sh "mkdir" "-p" (str "bench/" (git-version-memo)))
+    (save graph file :width 1024)
+    (println "Wrote" file)))
+
 (defn latency-graph
-  "Graphs throughput of repeated invocations of f, with options."
-  ([f] (latency-graph f {}))
-  ([f opts]
-   (let [title (or (:title opts) "latency over time")
-         file (str "bench/" (git-version-memo) "/" title ".png")
-         [times latencies] (latencies f opts)]
-     (sh "mkdir" "-p" (str "bench/" (git-version-memo)))
-     (doto (scatter-plot times latencies
+  "Graphs latencies, with options."
+  ([tape] (latency-graph tape {}))
+  ([tape opts]
+   (let [title (str (:title opts) " latency")
+         [times latencies] (latencies tape opts)]
+     (doto (scatter-plot (map #(/ % 1000) times)
+                         latencies
                          :title title
-                         :x-label "Time (ms)"
+                         :x-label "Time (s)"
                          :y-label "Latency (ms)")
-       (set-stroke :width 1 ) ; huh
-       (save file :width 1024))
-     (println "Wrote " file))))
+       (set-stroke :width 1) ; huh
+       (save-graph {:title title})))))
+
+(defn throughput-graph
+  "Graphs throughput of tape, with options."
+  ([tape] (throughput-graph tape {}))
+  ([tape opts]
+   (let [title (str (:title opts) " throughput")
+         [times throughput] (throughput tape opts)]
+     (doto (scatter-plot (map #(/ % 1000) times)
+                         (map (partial * 1000) throughput)
+                         :title title
+                         :x-label "Time (s)"
+                         :y-label "Reqs/s")
+       (save-graph {:title title})))))
+
+(defn multigraph [f opts]
+  (let [tape (record f opts)]
+    (latency-graph tape opts)
+    (throughput-graph tape opts)))

 (defn core-package
   ([] (core-package [{}]))
@@ -77,15 +116,14 @@
       :servers servers
       :streams streams})))

-  (deftest drop-latency
+(deftest drop-tcp
          (let [{:keys [core]} (core-package)
                client (tcp-client)]
            (try
-             (latency-graph (partial send-event client
-                                                 {:service "test"
-                                                  :metric 0.1})
-                                     {:title "drop events"
-                                      :n 10000})
+             (multigraph
+               #(send-event client {:service "test" :metric 0.1})
+               {:title "drop tcp events"
+                :n 100000})
              (finally
                (stop core)))))


Adjust for fact that injections are stored/retrieved by keyword key (not symbol)

--- src/io/aviso/rook.clj
+++ src/io/aviso/rook.clj
@@ -9,6 +9,17 @@
     [clojure.string :as str]
     [medley.core :as medley]))

+(defn get-injected-value
+  "Retrieves an injected value stored in the request. Throws an exception if the value is falsey."
+  {:added "0.1.10"}
+  [request injection-key]
+  {:pre [(some? request)
+         (keyword? injection-key)]}
+  (or
+    (get-in request [:io.aviso.rook/injections injection-key])
+    (throw (ex-info (format "Unable to retrieve injected value for key `%s'." injection-key)
+                    {:request request}))))
+
 (defn inject*
   "Merges the provided map of injectable argument values into the request. Keys should be keywords
   (that will match against function argument symbols, converted to keywords)."
@@ -17,7 +28,9 @@
   (medley/update request :io.aviso.rook/injections merge injection-map))

 (defn inject
-  "Merges a single symbol key and value into the map of injectable argument values."
+  "Merges a single keyword key and value into the map of injectable argument values. This is
+  associated with the :injection argument meta data. The key must be a symbol; the actual argument
+  will be converted to a keyword for lookup."
   {:added "0.1.10"}
   [request key value]
   {:pre [(keyword? key)


Fixes unbound var error for Reagent version 0.5.0.

--- src/kioo/reagent.cljs
+++ src/kioo/reagent.cljs
@@ -1,7 +1,7 @@
 (ns kioo.reagent
   (:require [kioo.core :as core]
             [kioo.util :as util :refer [flatten-nodes]]
-            [reagent.impl.template :refer [as-component]]))
+            [reagent.core :refer [as-component]]))

 (defn make-dom [node]
   (let [rnode (if (map? node)
@@ -13,13 +13,13 @@
                    (seq? c) (reduce #(conj %1 (as-component %2))
                                     [(:tag node) (:attrs node)]
                                     c)
-                   :else [(:tag node) (:attrs node) c]))
+                   :else [(:tag node) (:attrs node) c]))
                 node)]
     (as-component rnode)))

 (def content core/content)
-(def append core/append)
+(def append core/append)
 (def prepend core/prepend)

 ;;after and before need to to make-dom


Fix main-menu getting called 4 times on init

Also fixed up indentation on menu behaviors

--- src/lt/objs/menu.cljs
+++ src/lt/objs/menu.cljs
@@ -170,37 +170,37 @@
                 ]))

 (behavior ::create-menu
-           :triggers #{:init}
-           :reaction (fn [this]
-                       (when (platform/mac?)
-                         (set! (.-menu app/win) nil)
-                         )
-                       (main-menu)))
+          :triggers #{:init}
+          :reaction (fn [this]
+                      (when (platform/mac?)
+                        (set! (.-menu app/win) nil)
+                        )
+                      (main-menu)))

 (behavior ::recreate-menu
-                  :debounce 20
-                  :triggers #{:app.keys.load :init}
-                  :reaction (fn [app]
-                              (when (platform/mac?)
-                                (main-menu))))
+          :debounce 20
+          :triggers #{:app.keys.load}
+          :reaction (fn [app]
+                      (when (platform/mac?)
+                        (main-menu))))

 (behavior ::set-menu
-                  :triggers #{:focus :init}
-                  :reaction (fn [this]
-                              (when (platform/mac?)
-                                (main-menu))))
+          :triggers #{:focus}
+          :reaction (fn [this]
+                      (when (platform/mac?)
+                        (main-menu))))

 (behavior ::remove-menu-close
-                  :triggers #{:closed :blur}
-                  :reaction (fn [this]
-                               (when (platform/mac?)
-                                 (unknown-menu))))
+          :triggers #{:closed :blur}
+          :reaction (fn [this]
+                      (when (platform/mac?)
+                        (unknown-menu))))

 (behavior ::menu!
-                  :triggers #{:menu!}
-                  :reaction (fn [this e]
-                              (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [] e)))]
-                                (-> (menu items)
-                                    (show-menu)))
-                              (dom/prevent e)
-                              (dom/stop-propagation e)))
+          :triggers #{:menu!}
+          :reaction (fn [this e]
+                      (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [] e)))]
+                        (-> (menu items)
+                            (show-menu)))
+                      (dom/prevent e)
+                      (dom/stop-propagation e)))


Preserve link names, add more label customizations.

--- src/merkle_db/viz.clj
+++ src/merkle_db/viz.clj
@@ -34,9 +34,8 @@
   function will be called with the source node `:data/type` and a link, and
   should determine whether to follow the link or not. Returns a map of
   multihash ids to loaded node maps."
-  [store root follow?]
-  ; TODO: would be cool to save the path
-  (loop [visited (hash-map (::node/id root) root)
+  [store visited root follow?]
+  (loop [visited (assoc visited (::node/id root) root)
          pending (enqueue-links (clojure.lang.PersistentQueue/EMPTY) root)]
     (if-let [[source-type link] (peek pending)]
       (if (visited (::link/target link))
@@ -63,8 +62,7 @@
   (str
     (when-let [title (get-in node [::node/data :data/title])]
       (str title \newline))
-    (get-in node [::node/data :data/type] "???")
-    \newline
+    ;(get-in node [::node/data :data/type] "???") \newline
     (some-> node ::node/id multihash/base58 (subs 0 8))
     (when-let [size (::node/size node)]
       (format " (%d B)" size))))
@@ -78,17 +76,27 @@
         {:shape :house
          :label (node-label node)}
       :merkle-db/table
+        ; idea: show short record count
         {:shape :ellipse
-         :label (node-label node)}
+         :label (str (node-label node)
+                     (when-let [rc (:merkle-db.data/count (::node/data node))]
+                       (format "\n%d records" rc)))}
       :merkle-db/patch
         {:shape :hexagon
-         :label (node-label node)}
+         :label (str (node-label node)
+                     (when-let [changes (:merkle-db.patch/changes (::node/data node))]
+                       (format "\n%d changes" (count changes))))}
       :merkle-db/index
+        ; idea: show start/end keys
         {:shape :trapezium
          :label (node-label node)}
       :merkle-db/partition
+        ; idea: show start/end keys
+        ; idea: show short record count
         {:shape :rect
-         :label (node-label node)}
+         :label (str (node-label node)
+                     (when-let [rc (:merkle-db.data/count (::node/data node))]
+                       (format "\n%d records" rc)))}
       :merkle-db/tablet
         {:shape :hexagon
          :label (node-label node)}
@@ -103,9 +111,11 @@

 (defn- link-label
   [from to]
-  (some #(when (= (::node/id to) (::link/target %))
-           (::link/name %))
-        (::node/links from)))
+  (or
+    (::link/name (meta to))
+    (some #(when (= (::node/id to) (::link/target %))
+             (::link/name %))
+          (::node/links from))))

 (defn- edge->descriptor
@@ -122,13 +132,16 @@
                   (pr-str db)))))
   (let [nodes (find-nodes
                 (.store db)
+                {}
                 (mdag/get-node (.store db) (::node/id db))
                 (constantly true))]
     (rhizome/view-graph
       (vals nodes)
       (fn adjacent
         [node]
-        (keep (comp nodes ::link/target) (::node/links node)))
+        (keep #(when-let [target (get nodes (::link/target %))]
+                 (vary-meta target assoc ::link/name (::link/name %)))
+              (::node/links node)))
       :node->descriptor node->descriptor
       :edge->descriptor edge->descriptor
       ; :options


add missing io/make-parents call

add missing io/make-parents call

avoids race condition when trying to write output file without
having created the directory first.

--- src/main/shadow/build/targets/browser.clj
+++ src/main/shadow/build/targets/browser.clj
@@ -514,6 +514,7 @@
           ;; else
           out)]

+    (io/make-parents target)
     (spit target out)))

 (defn flush-unoptimized!


minor tweak

minor tweak

--- jetty/config/resources.clj
+++ jetty/config/resources.clj
@@ -5,8 +5,7 @@
    {:runtime 'hello.scripts/app :uri "scripts/app.js"}])

 (def statics
-  [{:runtime 'hello.resources/statics
-    :uri "target"}])
+  [{:runtime 'hello.resources/statics :uri "target"}])

 (def styles
   [{:runtime 'hello.styles/app :uri "styles/app.css"}])


Restructured ns.

Restructured ns.

--- src/sablono/core.cljx
+++ src/sablono/core.cljx
@@ -1,11 +1,10 @@
 (ns sablono.core
-  (:refer-clojure :exclude [replace])
-  (:require [clojure.string :refer [replace upper-case]]
+  #+cljs (:require-macros [sablono.core :refer [defelem]])
+  (:require [clojure.string :refer [upper-case]]
             [clojure.walk :refer [postwalk-replace]]
             [sablono.util :refer [as-str to-uri]]
-            [sablono.interpreter :as render]
-            #+clj [sablono.compiler :as compiler])
-  #+cljs (:require-macros [sablono.core :refer [defelem]]))
+            [sablono.interpreter :as interpreter]
+            #+clj [sablono.compiler :as compiler]))

 (defmacro html
   "Render Clojure data structures via Facebook's React."


removed unused function

removed unused function

--- src/server/rooms.cljs
+++ src/server/rooms.cljs
@@ -266,14 +266,6 @@
   (get-room-from-user-id socket-id
     (fn [room-id]
       )))
-
-; TODO: Transit should translate this(?)
-(defn get-music-info [room track-id callback]
-  (.hget redis-client (redis-room-prefix room "music-info") track-id
-    (fn [err reply]
-      (.get redis-client (str "file-hash:" reply)
-        (fn []
-          (callback reply))))))

 (defn get-music-file [room track-id callback]
   (.hget redis-client (redis-room-prefix room "music-files") track-id


Fix nesting

Fix nesting

--- src/matchmaker_sparql/evaluation/core.clj
+++ src/matchmaker_sparql/evaluation/core.clj
@@ -9,11 +9,11 @@

 (defn run-evaluation
   []
-  (let [params (:evaluation config)]
-    (timbre/info "Starting evaluation...")
-    (try (let [{:keys [limits-and-offsets]
-                :as evaluation-params} (setup/setup-evaluation params)]
-           (->> limits-and-offsets
-                (map (partial fold/run-fold evaluation-params))
-                (metrics/aggregate-evaluation-metrics evaluation-params)))
+  (timbre/info "Starting evaluation...")
+  (let [{:keys [evaluation]} config
+        {:keys [limits-and-offsets]
+         :as evaluation-params} (setup/setup-evaluation evaluation)]
+    (try (->> limits-and-offsets
+              (map (partial fold/run-fold evaluation-params))
+              (metrics/aggregate-evaluation-metrics evaluation-params))
          (finally (teardown/teardown-evaluation evaluation-params)))))


RS & AB | 2 | Change sign-in-form require

--- src/stonecutter/handler.clj
+++ src/stonecutter/handler.clj
@@ -6,6 +6,7 @@
             [environ.core :refer [env]]
             [scenic.routes :refer [scenic-handler]]
             [stonecutter.view.register :as register]
+            [stonecutter.view.sign-in :as sign-in]
             [stonecutter.translation :refer [load-translations-from-file]]
             [stonecutter.validation :as v]
             [stonecutter.storage :as s]
@@ -33,7 +34,7 @@

 (defn show-sign-in-form [request]
   (let [context {:translator (translations-fn translation-map)}]
-    (html-response (register/sign-in-form context))))
+    (html-response (sign-in/sign-in-form context))))

 (defn register-user [request]
   (let [params (:params request)


update new async context: add graph watches, refactor compute of active vertices, update sync-vertex-signal to return vec of signaled neighbors, update vertex processors & combine-stats to build new set of active verts, change arg order of execution-result

--- src/thi/ng/fabric/core.cljc
+++ src/thi/ng/fabric/core.cljc
@@ -86,14 +86,16 @@
   [vertex]
   (let [id   (:id vertex)
         outs @(:outs vertex)]
-    (loop [outs outs]
+    (loop [active (transient []), outs outs]
       (let [[v [f opts]] (first outs)]
-        (when v
+        (if v
           (let [signal (f vertex opts)]
             (if-not (nil? signal)
-              (receive-signal v id signal)
-              (debug "signal fn for" (:id v) "returned nil, skipping...")))
-          (recur (next outs)))))))
+              (do (receive-signal v id signal)
+                  (recur (conj! active v) (next outs)))
+              (do (debug "signal fn for" (:id v) "returned nil, skipping...")
+                  (recur active (next outs)))))
+          (persistent! active))))))

 (def default-vertex-state
   {::uncollected      []
@@ -147,8 +149,7 @@
     [_ handler]
     (reset! prev-val @value)
     (swap! state assoc ::new-edges 0)
-    (handler _)
-    _)
+    (handler _))
   (receive-signal
     [_ src sig]
     (if-not (= sig ((::signal-map @state) src))
@@ -232,7 +233,7 @@
 (defn- now [] #?(:clj (System/nanoTime) :cljs (.getTime (js/Date.))))

 (defn execution-result
-  [type colls sigs t0 & [opts]]
+  [type sigs colls t0 & [opts]]
   (->> {:collections colls
         :signals     sigs
         :type        type
@@ -250,8 +251,7 @@
       (let [v (first verts)]
         (if (should-signal? v thresh)
           (do (debug (:id v) "signaling")
-              (signal! v sync-vertex-signal)
-              (recur (inc sigs) (next verts)))
+              (recur (long (+ sigs (signal! v sync-vertex-signal))) (next verts)))
           (recur sigs (next verts))))
       sigs)))

@@ -297,9 +297,9 @@
         sig-fn    (:signal-fn ctx)
         max-iter  (:max-iter ctx)
         watch-id  (keyword (gensym))
-        ->result  (fn [type iter colls sigs t0]
+        ->result  (fn [type iter sigs colls t0]
                     (remove-watch! g :remove-vertex watch-id)
-                    (execution-result type colls sigs t0 {:iterations iter}))]
+                    (execution-result type sigs colls t0 {:iterations iter}))]
     (reify
       #?@(:clj
            [clojure.lang.IDeref
@@ -323,42 +323,44 @@
                     colls' (coll-fn verts c-thresh)]
                 (if (or (pos? sigs') (pos? colls'))
                   (recur (inc i) (long (+ colls colls')) (long (+ sigs sigs')))
-                  (->result :converged colls sigs t0 i)))
-              (->result :max-iter-reached colls sigs t0 i))))))))
+                  (->result :converged sigs colls t0 i)))
+              (->result :max-iter-reached sigs colls t0 i))))))))

 (defn default-async-vertex-processor
   [s-thresh c-thresh]
-  (fn [[sigs colls :as acc] v]
-    (if (< (rand) 0.5)
-      (if (should-signal? v s-thresh)
-        (do (signal! v sync-vertex-signal)
-            [(inc sigs) colls])
-        acc)
-      (if (should-collect? v c-thresh)
-        (do (collect! v)
-            [sigs (inc colls)])
-        acc))))
+  (fn [[active sigs colls] v]
+    (let [active (conj active v)]
+      (if (< (rand) 0.5)
+        (if (should-signal? v s-thresh)
+          (let [vsigs (signal! v sync-vertex-signal)]
+            [(into active vsigs) (+ sigs vsigs) colls])
+          [active sigs colls])
+        (if (should-collect? v c-thresh)
+          (do (collect! v)
+              [active sigs (inc colls)])
+          [active sigs colls])))))

 (defn eager-async-vertex-processor
   [s-thresh c-thresh]
-  (fn [[sigs colls :as acc] v]
-    (if (< (rand) 0.5)
-      (if (should-signal? v s-thresh)
-        (do (signal! v sync-vertex-signal)
-            [(inc sigs) colls])
-        acc)
-      (if (should-collect? v c-thresh)
-        (do (collect! v)
-            (if (should-signal? v s-thresh)
-              (do (signal! v sync-vertex-signal)
-                  [(inc sigs) (inc colls)])
-              [sigs (inc colls)]))
-        acc))))
+  (fn [[active sigs colls] v]
+    (let [active (conj active v)]
+      (if (< (rand) 0.5)
+        (if (should-signal? v s-thresh)
+          (let [vsigs (signal! v sync-vertex-signal)]
+            [(into active vsigs) (+ sigs (count vsigs)) colls])
+          [active sigs colls])
+        (if (should-collect? v c-thresh)
+          (do (collect! v)
+              (if (should-signal? v s-thresh)
+                (let [vsigs (signal! v sync-vertex-signal)]
+                  [(into active vsigs) (+ sigs (count vsigs)) (inc colls)])
+                [active sigs (inc colls)]))
+          [active sigs colls])))))

 (defn combine-stats
-  ([] [0 0])
+  ([] [#{} 0 0])
   ([acc] acc)
-  ([[as ac] [s c]] [(+ as s) (+ ac c)]))
+  ([[act as ac] [act' s c]] [(into act act') (+ as s) (+ ac c)]))

 (defn default-async-context-opts
   []
@@ -377,7 +379,13 @@
         max-ops   (:max-ops ctx)
         processor ((:processor ctx) s-thresh c-thresh)
         threads   (:threads ctx)
-        watch-id  (keyword (gensym))]
+        watch-id  (keyword (gensym))
+        v-filter  (filter #(or (should-signal? % s-thresh) (should-collect? % c-thresh)))
+        ->result  (fn [type sigs colls t0]
+                    (remove-watch! g :add-vertex watch-id)
+                    (remove-watch! g :remove-vertex watch-id)
+                    (remove-watch! g :add-edge watch-id)
+                    (execution-result type sigs colls t0))]
     (reify
       #?@(:clj
            [clojure.lang.IDeref
@@ -391,17 +399,27 @@
       (include-vertex! [_ v] (err/unsupported!))
       (execute!
         [_]
-        (let [t0 (now)]
+        (let [t0 (now)
+              active (atom (sequence v-filter (vertices g)))
+              enable (atom #{})]
+          (add-watch! g :add-vertex watch-id
+                      (fn [[__ v]] (swap! enable into (signal! v sync-vertex-signal))))
+          (add-watch! g :remove-vertex watch-id
+                      (fn [[__ v]] (swap! enable into (signal! v sync-vertex-signal))))
+          (add-watch! g :add-edge watch-id
+                      (fn [[__ src dest]] (swap! enable into [src dest])))
           (loop [colls 0, sigs 0]
-            (let [active (filter #(or (should-signal? % s-thresh) (should-collect? % c-thresh))
-                                 (vertices g))]
-              ;;(warn :active-count (count active))
-              (if (seq active)
-                (if (<= (+ colls sigs) max-ops)
-                  (let [[sigs' colls'] (r/fold
-                                        (max 512 (long (/ (count active) threads)))
-                                        combine-stats
-                                        processor active)]
-                    (recur (long (+ colls colls')) (long (+ sigs sigs'))))
-                  (execution-result :max-ops-reached colls sigs t0))
-                (execution-result :converged colls sigs t0)))))))))
+            ;;(warn :active-count (count @active))
+            (if (seq @active)
+              (if (<= (+ colls sigs) max-ops)
+                (let [[act' sigs' colls']
+                      (r/fold
+                       (max 512 (long (/ (count @active) threads)))
+                       combine-stats
+                       processor @active)]
+                  ;;(warn :auto (count @enable))
+                  (reset! active (into (into #{} v-filter act') @enable))
+                  (reset! enable #{})
+                  (recur (long (+ colls colls')) (long (+ sigs sigs'))))
+                (->result :max-ops-reached sigs colls t0))
+              (->result :converged sigs colls t0))))))))


Return all the boards, let the client decide which one to show or not.

--- src/oc/storage/api/orgs.clj
+++ src/oc/storage/api/orgs.clj
@@ -265,11 +265,8 @@
                              full-boards (if show-draft-board?
                                             (conj allowed-boards (board-res/drafts-board org-id user))
                                             allowed-boards)
-                             filter-publisher-boards (filter #(or (not (:publisher-board %))
-                                                                  (= (-> % :author :user-id) (:user-id user)))
-                                                      full-boards)
                              board-reps (map #(board-rep/render-board-for-collection slug % draft-entry-count)
-                                          filter-publisher-boards)
+                                          full-boards)
                              authors (:authors org)
                              author-reps (map #(org-rep/render-author-for-collection org % (:access-level ctx)) authors)
                              has-sample-content? (> (entry-res/sample-entries-count conn org-id) 1)]


Remove log statement.

Remove log statement.

--- src/onyx/peer/operation.clj
+++ src/onyx/peer/operation.clj
@@ -46,7 +46,6 @@
     link
     (let [site (get-in @replica [link-type peer-id])
           link (extensions/connect-to-peer messenger event site)]
-      (taoensso.timbre/info (str (:onyx.core/task event) " is sending to " site " <- Mike"))
       (swap! state assoc-in [peer-id link-type] link)
       link)))


Make sure FORCE-SYNC? is dynamic

Make sure FORCE-SYNC? is dynamic

--- src/overtone/libs/event.clj
+++ src/overtone/libs/event.clj
@@ -9,7 +9,7 @@
   (:require [overtone.util.log :as log]))

 (def NUM-THREADS (cpu-count))
-(def FORCE-SYNC? false)
+(def ^{:dynamic true} *FORCE-SYNC?* false)
 (defonce thread-pool (Executors/newFixedThreadPool NUM-THREADS))
 (defonce event-handlers* (ref {}))
 (defonce sync-event-handlers* (ref {}))
@@ -133,7 +133,7 @@
   (log/debug "event: " event-type args)
   (let [event (apply hash-map :event-type event-type args)]
     (handle-event sync-event-handlers* event)
-    (if FORCE-SYNC?
+    (if *FORCE-SYNC?*
       (handle-event event-handlers* event)
       (.execute thread-pool #(handle-event event-handlers* event)))))

@@ -143,5 +143,5 @@
   events, these will revert back to the default behaviour of event (i.e. not
   forced sync). See event."
   [& args]
-  (binding [FORCE-SYNC? true]
+  (binding [*FORCE-SYNC?* true]
     (apply event args)))


Preserve an instrument's metadata - also allowing for instrument docstrings.

--- src/overtone/studio/rig.clj
+++ src/overtone/studio/rig.clj
@@ -240,8 +240,20 @@
        (= ::instrument (:type o))))

 (defmacro definst [i-name & inst-form]
+  "Define an instrument and return a player function. The instrument definition
+  will be loaded immediately. Instruments differ from basic synths in that they
+  will automatically add pan2 and out ugens when necessary to create a stereo
+  synth. Also, each instrument is assigned its own group which all instances
+  will automatically be placed in. This allows you to control all of an
+  instrument's running synths with one command:
+
+  (ctrl inst-name :param val)
+
+  You may also kill an all of an instrument's running synths:
+
+  (kill inst-name)"
   (let [[i-name params ugen-form] (synth-form i-name inst-form)
-        i-name (with-meta i-name {:type ::instrument})]
+        i-name (with-meta i-name (merge (meta i-name) {:type ::instrument}))]
     `(def ~i-name (inst ~i-name ~params ~ugen-form))))

 (defmethod print-method ::instrument [ins w]


fix get-next-snapshot-id

fix get-next-snapshot-id

--- src/wb_es/snapshot/core.clj
+++ src/wb_es/snapshot/core.clj
@@ -38,9 +38,13 @@
   [repository-name release-id]
   (let [pattern (re-pattern (format "snapshot_%s(_v(\\d+))?" release-id))
         current-id (get-lateset-snapshot-id repository-name release-id)
-        [_ _ version-id] (re-matches pattern current-id)]
-    (format "snapshot_%s_v%s" release-id (or (+ 1 (Integer. version-id))
-                                             0))))
+        next-version-id (if current-id
+                          (->> (re-matches pattern current-id)
+                               (last)
+                               (Integer.)
+                               (+ 1))
+                          0)]
+    (format "snapshot_%s_v%s" release-id next-version-id)))

 (defn save-snapshot
   [index-id repository-name snapshot-id]


Change VPN user-data to use vpn-user-data

--- src/terraboot/vpc.clj
+++ src/terraboot/vpc.clj
@@ -101,13 +101,8 @@

             (in-vpc vpc-name
                     (aws-instance "vpn" {
-                                         :user_data (from-template "vpn-config" {:range-start (cidr-start vpc-cidr-block)
-                                                                                :fallback-dns (fallback-dns vpc-cidr-block)
-                                                                                :ta-key (snippet "vpn-keys/ta.key")
-                                                                                :ca-cert (snippet "vpn-keys/ca.crt")
-                                                                                :vpn-key (snippet "vpn-keys/mesos-vpn-gw.key")
-                                                                                :vpn-cert (snippet "vpn-keys/mesos-vpn-gw.crt")
-                                                                                :dh-param (snippet "vpn-keys/dh2048.pem")})
+                                         :user_data (vpn-user-data {:range-start (cidr-start vpc-cidr-block)
+                                                                    :fallback-dns (fallback-dns vpc-cidr-block)})
                                          :subnet_id (id-of "aws_subnet" "public-b")
                                          :ami "ami-bc5b48d0"
                                          :vpc_security_group_ids [(id-of "aws_security_group" "vpn")


Fixed API typo, wasn't returning related node links

Need to decide if I'm keeping this API or not, add tests.

--- src/tropology/api.clj
+++ src/tropology/api.clj
@@ -47,7 +47,7 @@
 (defn query-related-from
   [conn code-from node]
   {:node       node
-   :links-from (db/query-common-nodes-from conn code-from (node "id"))})
+   :links-from (db/query-common-nodes-from conn code-from (node "code"))})

 (defn rand-range [n]
   (- (rand n) (/ n 2)))


Make shape types hierarchy as public.

Make shape types hierarchy as public.


Moved update functions from sprite record types to a standalone function

--- src/retro_fever/sprite.cljs
+++ src/retro_fever/sprite.cljs
@@ -71,9 +71,24 @@
     :x (if velocity-x (+ x velocity-x) x)
     :y (if velocity-x (+ y velocity-y) y)))

+(defn- update-sprite
+  [& [sprite scene :as args]]
+   (if-let [update-fn (:update-fn sprite)]
+     (apply update-fn args)
+     (let [updated-sprite (move sprite)]
+       (if scene
+         (assoc-in scene [(:se-id (meta sprite))] updated-sprite)
+         updated-sprite))))
+
+(defn- update-animated-sprite
+  ([sprite]
+     (update-animated-sprite sprite nil))
+  ([sprite scene]
+     (update-sprite (update-in sprite [:animation] update-frame (:animation sprite)) scene)))
+
 (defprotocol SpriteActions
   (render [this context])
-  (update [this]))
+  (update [this] [this scene]))

 (defrecord ImageSprite [image width height x y]
   TypeInfo
@@ -81,28 +96,24 @@
   SpriteActions
   (render [this context] (render-image context (:image image) x y width height 0 0 width height
                                        (* (/ width 2) -1) (* (/ height 2) -1)))
-  (update [this] (if-let [update-fn (:update-fn this)]
-                   (update-fn this)
-                   (move this))))
+  (update [this] (update-sprite this))
+  (update [this scene] (update-sprite this scene)))

 (defrecord SpritesheetSprite [spritesheet width height cell x y]
   TypeInfo
   (get-type [this] :spritesheet-sprite)
   SpriteActions
   (render [this context] (render-frame context spritesheet cell x y))
-  (update [this] (if-let [update-fn (:update-fn this)]
-                   (update-fn this)
-                   (move this))))
+  (update [this] (update-sprite this))
+  (update [this scene] (update-sprite this scene)))

 (defrecord AnimatedSprite [animation width height x y]
   TypeInfo
   (get-type [this] :animated-sprite)
   SpriteActions
   (render [this context] (render-frame context (:spritesheet animation) (get-cell animation) x y))
-  (update [this] (let [updated-sprite (if-let [update-fn (:update-fn this)]
-                                        (update-fn this)
-                                        (move this))]
-                   (assoc updated-sprite :animation (update-frame (:animation updated-sprite))))))
+  (update [this] (update-animated-sprite this))
+  (update [this scene] (update-animated-sprite this scene)))

 (defn ^:export sprite
   "Creates a sprite record based on graphics resource"


One second timeout for requests

One second timeout for requests

--- src/rpi_challenger/core.clj
+++ src/rpi_challenger/core.clj
@@ -40,7 +40,7 @@
 (defn post-request
   [url body]
   (with-open [client (http/create-client)]
-    (-> (http/POST client url :body body)
+    (-> (http/POST client url :body body :timeout 1000)
       http/await
       simple-http-response)))


gen-processes-cycles refacto

gen-processes-cycles refacto

--- src/sandbox/multithread.clj
+++ src/sandbox/multithread.clj
@@ -192,26 +192,16 @@
 (defn prepare-scheduled [processes]
   (vec (map #(update % :instructions add-times) processes)))

-;;=> We prepare "scheduled" as being the same thing as the
-;;   "processes" map
-;;   with empty ":times" vectors added.
-
 (defn prepare-locks [processes]
   (->> (ps->is processes)
        (filter #(= (:inst-type %) :lock))
        (map #((juxt :process-id :inst-id) %))
        (reduce (partial apply unlock) {} )))

-(defn gen-processes-cycles
-  [processes]
-  (let [sorted-procs-by-prio (sort-by :priority > processes)
-        procs-pattern (mapcat #(repeat (:priority %)
-                                       %)
-                              sorted-procs-by-prio)]
-    ;;=> A pattern is a single repetition "priority" times of each
-    ;;   process
-    (cycle procs-pattern)))
-;;=> Generates an infinite sequence like we described above.
+(defn gen-processes-cycles [processes]
+  (->> (sort-by :priority > processes)
+       (mapcat #(repeat (:priority %) %))
+       (cycle)))

 (defn total-time [processes]
   (->> (ps->is processes)