Allow up to 500 retries and still pass

Allow up to 500 retries and still pass

--- test/onyx/peer/multi_peer_mem_test.clj
+++ test/onyx/peer/multi_peer_mem_test.clj
@@ -51,7 +51,9 @@

 (def in-chan (chan (inc n-messages)))

-(def out-chan (chan (sliding-buffer (inc n-messages))))
+(def maximum-retried-segments 500)
+
+(def out-chan (chan (sliding-buffer (+ n-messages maximum-retried-segments + 1))))

 (defn inject-in-ch [event lifecycle]
   {:core.async/chan in-chan})
@@ -80,7 +82,7 @@

 (>!! in-chan :done)

-(def v-peers (onyx.api/start-peers 4 peer-group))
+(def v-peers (onyx.api/start-peers 8 peer-group))

 (onyx.api/submit-job
  peer-config


Add tests for setting recurring expenses and both expenses and events


[scamp] pull in numeric-tower dep

[scamp] pull in numeric-tower dep

--- modules/scamp/project.clj
+++ modules/scamp/project.clj
@@ -5,4 +5,5 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.9.0-alpha14"]
                  [com.taoensso/timbre "4.3.1"]
-                 [prismatic/schema "1.1.1"]])
+                 [prismatic/schema "1.1.1"]
+                 [org.clojure/math.numeric-tower "0.0.4"]])


Further work on  "API docs". Promise more nudity.

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -16,19 +16,31 @@
     [clojure.set               :as set]))

-;; XXX move API functions up to this core level - to enable code completion and auto-generated docs
+;; This namespace defines the re-frame API
+
+;; When originally writing this re-frame API namespace, we used
+;; this technique:
+;;    (def api-name (deeper.namespace/where-the-defn-is))
+;;
+;; Turns out this technique makes it hard:
+;;   - to auto-generate API docs
+;;   - for IDEs to provide code completion on functions in the API.
+;;
+;; Which is annoying. But there are pros and cons and we haven't yet
+;; revisited the decision. So, sorry, in advance. To compensate we've
+;; added more nudity to the official docs.

 ;; --  dispatch ---------------------------------------------------------------
-(def dispatch         router/dispatch)
-(def dispatch-sync    router/dispatch-sync)
+(def dispatch       router/dispatch)
+(def dispatch-sync  router/dispatch-sync)

 ;; --  subscriptions ----------------------------------------------------------
-(def reg-sub             subs/reg-sub)
-(def subscribe           subs/subscribe)
-
-(def clear-sub    (partial registrar/clear-handlers subs/kind))
+(def reg-sub        subs/reg-sub)
+(def subscribe      subs/subscribe)
+
+(def clear-sub (partial registrar/clear-handlers subs/kind))  ;; think unreg-sub
 (def clear-subscription-cache! subs/clear-subscription-cache!)

 (defn reg-sub-raw
@@ -41,49 +53,67 @@

 ;; -- effects -----------------------------------------------------------------
 (def reg-fx      fx/register)
-(def clear-fx    (partial registrar/clear-handlers fx/kind))
+(def clear-fx    (partial registrar/clear-handlers fx/kind))  ;; think unreg-fx

 ;; -- coeffects ---------------------------------------------------------------
 (def reg-cofx    cofx/register)
 (def inject-cofx cofx/inject-cofx)
-(def clear-cofx (partial registrar/clear-handlers cofx/kind))
+(def clear-cofx (partial registrar/clear-handlers cofx/kind)) ;; think unreg-cofx

 ;; --  Events -----------------------------------------------------------------
-(def clear-event (partial registrar/clear-handlers events/kind))

 (defn reg-event-db
-  "Register the given `id`, typically a namespaced keyword, with the combination of
-  `db-handler` and an interceptor chain.
-  `db-handler` is a function: (db event) -> db
-  `interceptors` is a collection of interceptors, possibly nested (needs flattening).
-  `db-handler` is wrapped in an interceptor and added to the end of the chain, so
-   that, in the end, there is only a chain.
-   The necessary effects and coeffects handler are added to the front of the
-   interceptor chain.  These interceptors ensure that app-db is available and updated."
-  ([id db-handler]
-    (reg-event-db id nil db-handler))
-  ([id interceptors db-handler]
-   (events/register id [cofx/inject-db fx/do-fx interceptors (db-handler->interceptor db-handler)])))
+  "Register the given event `handler` (function) for the given `id`. Optionally, provide
+  an `interceptors` chain.
+  `id` is typically a namespaced keyword  (but can be anything)
+  `handler` is a function: (db event) -> db
+  `interceptors` is a collection of interceptors. Will be flattened and nils removed.
+  `handler` is wrapped in its own interceptor and added to the end of the interceptor
+   chain, so that, in the end, only a chain is registered.
+   Special effects and coeffects interceptors are added to the front of this
+   chain."
+  ([id handler]
+    (reg-event-db id nil handler))
+  ([id interceptors handler]
+   (events/register id [cofx/inject-db fx/do-fx interceptors (db-handler->interceptor handler)])))

 (defn reg-event-fx
-  ([id fx-handler]
-   (reg-event-fx id nil fx-handler))
-  ([id interceptors fx-handler]
-   (events/register id [cofx/inject-db fx/do-fx interceptors (fx-handler->interceptor fx-handler)])))
+  "Register the given event `handler` (function) for the given `id`. Optionally, provide
+  an `interceptors` chain.
+  `id` is typically a namespaced keyword  (but can be anything)
+  `handler` is a function: (coeffects-map event-vector) -> effects-map
+  `interceptors` is a collection of interceptors. Will be flattened and nils removed.
+  `handler` is wrapped in its own interceptor and added to the end of the interceptor
+   chain, so that, in the end, only a chain is registered.
+   Special effects and coeffects interceptors are added to the front of the
+   interceptor chain.  These interceptors inject the value of app-db into coeffects,
+   and, later, action effects."
+  ([id handler]
+   (reg-event-fx id nil handler))
+  ([id interceptors handler]
+   (events/register id [cofx/inject-db fx/do-fx interceptors (fx-handler->interceptor handler)])))

 (defn reg-event-ctx
+  "Register the given event `handler` (function) for the given `id`. Optionally, provide
+  an `interceptors` chain.
+  `id` is typically a namespaced keyword  (but can be anything)
+  `handler` is a function: (context-map event-vector) -> context-map
+
+  This form of registration is almost never used. "
   ([id handler]
    (reg-event-ctx id nil handler))
   ([id interceptors handler]
    (events/register id [cofx/inject-db fx/do-fx interceptors (ctx-handler->interceptor handler)])))

+(def clear-event (partial registrar/clear-handlers events/kind)) ;; think unreg-event-*

 ;; -- interceptors ------------------------------------------------------------

-;; Standard interceptors. Detailed docs in std-interceptors.cljs
+;; Standard interceptors.
+;; Detailed docs on each in std-interceptors.cljs
 (def debug       std-interceptors/debug)
 (def path        std-interceptors/path)
 (def enrich      std-interceptors/enrich)
@@ -92,9 +122,9 @@
 (def on-changes  std-interceptors/on-changes)

-;; utility functions - for creating your own interceptors
-;;
-;;  (def some-interceptor
+;; Utility functions for creating your own interceptors
+;;
+;;  (def my-interceptor
 ;;     (->interceptor                ;; used to create an interceptor
 ;;       :id     :my-interceptor     ;; an id - decorative only
 ;;       :before (fn [context]                         ;; you normally want to change :coeffects
@@ -124,8 +154,8 @@
 ;; If you are writing an extension to re-frame, like perhaps
 ;; an effects handler, you may want to use re-frame logging.
 ;;
-;; usage:  (console :error "this is bad: " a-variable " and " anotherv)
-;;         (console :warn "possible breach of containment wall at: " dt)
+;; usage: (console :error "Oh, dear God, it happened: " a-var " and " another)
+;;        (console :warn "Possible breach of containment wall at: " dt)
 (def console loggers/console)


Log warning if re-frame ever overwrites a subscription in the cache

re-frame should always be using queries from the cache if they exist.
This is a belt and suspenders check to make sure that always holds.

--- src/re_frame/subs.cljc
+++ src/re_frame/subs.cljc
@@ -54,7 +54,11 @@
                                                      (dissoc query-cache cache-key)
                                                      query-cache)))))
     ;; cache this reaction, so it can be used to deduplicate other, later "=" subscriptions
-    (swap! query->reaction assoc cache-key r)
+    (swap! query->reaction (fn [query-cache]
+                             (when debug-enabled?
+                               (when (contains? query-cache cache-key)
+                                 (console :warn "re-frame: Adding a new subscription to the cache while there is an existing subscription in the cache" cache-key)))
+                             (assoc query-cache cache-key r)))
     (trace/merge-trace! {:tags {:reaction (reagent-id r)}})
     r)) ;; return the actual reaction


Turn subnav back on for :account page

Turn subnav back on for :account page

I misread the code and put :account in the list of pages which should
have the subnav hidden. This fixes it.

--- src-cljs/frontend/components/templates/main.cljs
+++ src-cljs/frontend/components/templates/main.cljs
@@ -12,8 +12,7 @@
           :add-projects
           :build-insights
           :project-insights
-          :team
-          :account} nav-point)))
+          :team} nav-point)))

 (defn template
   "The template for building a page in the app.


Changing the demo to Spotify's Helios project instead of Facebook React

--- src-cljs/frontend/experiments/nux_bootstrap.cljs
+++ src-cljs/frontend/experiments/nux_bootstrap.cljs
@@ -135,7 +135,7 @@
                       [:a {:href "/add-projects"} "Add Projects"]
                       " page to find it."]
                      [:div
-                      "Interested in a demo? "
-                      [:a {:href "/gh/facebook/fresco"
+                      "Interested in a tour? "
+                      [:a {:href "/gh/spotify/helios/5715?appcue=-KaIkbbdxnEVnAzMAkKx"
                            :on-click #((om/get-shared owner :track-event) {:event-type :view-demo-clicked})}
-                       "See how Facebook uses CircleCI"]]])))])])))))
+                       "See how Spotify uses CircleCI"]]])))])])))))


CMR-583: Fixed missing count.

CMR-583: Fixed missing count.

--- src/cmr/metadata_db/services/concept_service.clj
+++ src/cmr/metadata_db/services/concept_service.clj
@@ -229,7 +229,7 @@
   "Get the lastest version of concepts by specifiying a list of concept-ids. Results are
   returned in the order requested"
   [context concept-ids]
-  (info (format "Getting [%d] latest concepts by concept-id"))
+  (info (format "Getting [%d] latest concepts by concept-id" (count concept-ids)))
   (let [start (System/currentTimeMillis)
         parallel-chunk-size (get-in context [:system :parallel-chunk-size])
         db (util/context->db context)


Adds slider page.

Adds slider page.

--- src/cljs/reagent_toolbox_docs/components/slider.cljs
+++ src/cljs/reagent_toolbox_docs/components/slider.cljs
@@ -16,8 +16,127 @@
       "have icons to the left and right of the bar that reflect the value intensity. The "
       "interactive nature of the slider makes it a great choice for settings that reflect "
       "intensity levels, such as volume, brightness, or color saturation."]
-
-     ]))

-  (defmethod layout/pages :slider [_]
-    [view]))
+     [ui/display-and-eval-code
+      "(defn slider-test
+         []
+         (let [sliders (reagent.ratom/atom {:slider2 5 :slider3 1 :slider4 3})]
+           (fn []
+             [:section
+[:p \"Value: \" (pr-str @sliders)]
+              [:p \"Normal slider\"]
+              [reagent-toolbox.core/slider {:value (@sliders :slider1)
+                                            :on-change #(swap! sliders assoc :slider1 %)}]
+              [:p \"With steps, initial value, and editable\"]
+              [reagent-toolbox.core/slider {:value (@sliders :slider2)
+                                            :min 0
+                                            :max 10
+                                            :editable true
+                                            :on-change #(swap! sliders assoc :slider2 %)}]
+              [:p \"Pinned and with snaps\"]
+              [reagent-toolbox.core/slider {:value (@sliders :slider3)
+                                            :editable true
+                                            :pinned true
+                                            :snaps true
+                                            :min 0
+                                            :max 10
+                                            :step 1
+                                            :on-change #(swap! sliders assoc :slider3 %)}]
+              [:p \"Disabled\"]
+              [reagent-toolbox.core/slider {:value (@sliders :slider4)
+                                            :disabled true
+                                            :on-change #(swap! sliders assoc :slider4 %)}]
+
+])))
+       [slider-test]"]
+
+     [:p "This component can be styled by context providing a theme with the key RTSwitch through the theme provider."]
+
+     [:section
+      [:h2 "Properties"]
+
+      [:table
+       [:thead
+        [:tr
+         [:th "Name"]
+         [:th "Type"]
+         [:th "Default"]
+         [:th "Description"]]]
+       [:tbody
+        [:tr
+         [:td [:code "checked"]]
+         [:td [:code "boolean"]]
+         [:td [:code "false"]]
+         [:td "If true, the switch will be enabled."]]
+        [:tr
+         [:td [:code "class-name"]]
+         [:td [:code "string"]]
+         [:td [:code "''"]]
+         [:td "Sets a class to give custom styles to the switch."]]
+        [:tr
+         [:td [:code "disabled"]]
+         [:td [:code "boolean"]]
+         [:td [:code "false"]]
+         [:td "If true, component will be disabled."]]
+        [:tr
+         [:td [:code "label"]]
+         [:td [:code "string"]]
+         [:td]
+         [:td "The text string to use for the floating label element."]]
+        [:tr
+         [:td [:code "name"]]
+         [:td [:code "string"]]
+         [:td]
+         [:td "The text string used as name of the input."]]
+        [:tr
+         [:td [:code "on-blur"]]
+         [:td [:code "function"]]
+         [:td]
+         [:td "Callback function that is fired when when the switch is blurred."]]
+        [:tr
+         [:td [:code "on-change"]]
+         [:td [:code "function"]]
+         [:td]
+         [:td "Callback function that is fired when the component's value changes."]]
+        [:tr
+         [:td [:code "on-focus"]]
+         [:td [:code "function"]]
+         [:td]
+         [:td "Callback function that is fired when the switch is focused."]]
+        ]]]
+
+     [:section
+      [:h2 "Theme"]
+
+      [:table
+       [:thead
+        [:tr
+         [:th "Name"]
+         [:th "Description"]]]
+       [:tr
+        [:td [:code "disabled"]]
+        [:td "Used for the root element if the component is disabled."]]
+       [:tr
+        [:td [:code "field"]]
+        [:td "Used for the root element if the component is not disabled."]]
+       [:tr
+        [:td [:code "input"]]
+        [:td "Used for the input element."]]
+       [:tr
+        [:td [:code "off"]]
+        [:td "Used for a wrapper around the thumb if checked is false."]]
+       [:tr
+        [:td [:code "on"]]
+        [:td "Used for a wrapper around the thumb if checked is true."]]
+       [:tr
+        [:td [:code "ripple"]]
+        [:td "Used for the ripple inside the switch."]]
+       [:tr
+        [:td [:code "text"]]
+        [:td "Used for the text label element."]]
+       [:tr
+        [:td [:code "thumb"]]
+        [:td "Used for the thumb element."]]]]]))
+
+(defmethod layout/pages :slider [_]
+  [view])


Add subreddit path as link in top subreddit posts

--- src/reddio_frontend/screens/home/top_subreddits.cljs
+++ src/reddio_frontend/screens/home/top_subreddits.cljs
@@ -12,7 +12,9 @@
        [:div.subreddit-card-thumbnail
         [:img {:src (:thumbnail post)}]])]
     [:div.card-block
-     [:h3.card-title (:url-path subreddit)]
+     [:h3.card-title
+      [:a {:href (:url-path subreddit)}
+       (:url-path subreddit)]]
      [:p.card-text (:custom-description subreddit)]]]])

 (defn top-subreddits [data]


[#2215] Revert keycloak by default auth system

--- backend/src/akvo/lumen/endpoint/env.clj
+++ backend/src/akvo/lumen/endpoint/env.clj
@@ -17,7 +17,7 @@
   (fn [{tenant :tenant
         query-params :query-params
         :as request}]
-    (let [auth-type (get query-params "auth" "auth0")
+    (let [auth-type (get query-params "auth" "keycloak")
           [auth-url auth-client-id] (condp = auth-type
                                       "keycloak" (auth-data keycloak-public-client)
                                       "auth0" (auth-data auth0-public-client))]


Add 'print-db commanline function for debug.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -895,6 +895,20 @@
   Example: lein voom deploy clojars"
   [project & args]
   (apply wrap project "deploy" args))
+
+(declare print-git-db read-git-db)
+(defn print-db
+  "Prints the internal database for the specified repo in edn format.
+The repo must be specified exactly as specified in dependencies. i.e.:
+
+  git@github.com/github.com:jclaggett/seqex.git
+
+This is provided for lein-voom developer debug usage."
+  [kwargs repo]
+  (->> (repo->path repo)
+       (io/file voom-repos)
+       read-git-db
+       print-git-db))

 ;; ===== Git import =====
@@ -1163,6 +1177,12 @@
     (fress/write-object w voomdb-header)
     (doseq [item (vdb/to-reldata (:pldb db))]
       (fress/write-object w item))))
+
+(defn print-git-db
+  [db]
+  (prn [voomdb-header
+        {:pldb (for [item (vdb/to-reldata (:pldb db))]
+                 item)}]))

 (defn updated-git-db
   [gitdir]
@@ -1306,7 +1326,7 @@
 (def ^{:doc "Display this help message"} box-help help)

 (def subtasks [#'build-deps #'deploy #'fetch-all #'find-box #'freshen #'help
-               #'install #'update-repo-dbs #'ver-parse #'wrap
+               #'install #'print-db #'update-repo-dbs #'ver-parse #'wrap
                #'box #'box-new #'box-init #'box-add #'box-remove #'box-help])

 ;; Note the docstring for 'voom' is seen when the user runs any of:


Unify return status for 'git fn.

Unify return status for 'git fn.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -60,13 +60,16 @@
         all-args (concat subcmd cmd-args sh-opts)
         ;; _ (prn :calling (doall (cons 'git all-args)))
         {:keys [exit] :as rtn} (apply sh "git" all-args)
-        rtn (assoc rtn :bool (if (zero? (:exit rtn))
-                               true
-                               false))]
-    (when-not (ok-statuses exit)
-      (throw (ex-info "git error" (assoc rtn :git all-args))))
-    (assoc rtn :lines (when (not= "\n" (:out rtn))
-                        (re-seq #"(?m)^.*$" (:out rtn))))))
+        rtn (assoc rtn
+              :git all-args
+              :bool (if (zero? (:exit rtn))
+                      true
+                      false)
+              :lines (when (not= "\n" (:out rtn))
+                       (re-seq #"(?m)^.*$" (:out rtn))))]
+    (if (ok-statuses exit)
+      rtn
+      (throw (ex-info "git error" rtn)))))

 ;; === git sha-based versions ===


extracted cues examples to another file

extracted cues examples to another file

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -134,9 +134,9 @@
   ;; all the expanded, patched fixtures in it.
   '*show*)

-;(use-my-show)
-
-(use-london-show)
+(use-my-show)
+
+;(use-london-show)

 ; Logging level set to :info
 (core/init-logging)
@@ -268,15 +268,18 @@

 (defn light-sawtooth-color
   "Change light according to sawtooth osc & hue phase"
-  []
-  (let [light-param (params/build-oscillated-param
-    (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true) :max :max-lightness)
-        hue-param (params/build-oscillated-param
-    (oscillators/square-beat :beat-ratio 16 :down? true) :max 90)
-  ]
-    (show/add-effect! :color (global-color-effect
-      (params/build-color-param :h :main-hue :s 100 :l light-param :adjust-hue hue-param)))
-  )
+  ([]
+    (light-sawtooth-color (show/all-fixtures))
+    )
+  ([fixtures]
+    (let [light-param (params/build-oscillated-param
+      (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true) :max :max-lightness)
+          hue-param (params/build-oscillated-param
+      (oscillators/square-beat :beat-ratio 16 :down? true) :max 90)
+    ]
+      (show/add-effect! :color (afterglow.effects.color/color-effect
+                          "Light sawtooth color" (params/build-color-param :h :main-hue :s 100 :l light-param :adjust-hue hue-param) fixtures))
+    ))
 )

 (defn light-to-param
@@ -363,93 +366,6 @@
   (show/add-effect! :position
     (move/aim-effect "Center" (params/build-aim-param :x 0 :y 0 :z 5) (show/fixtures-named "head")))
 )
-
-
-; Big list of cues from examples
-; 2DO: learn and delete
-
-(defn global-color-cue
-  "Create a cue-grid entry which establishes a global color effect."
-  [color x y & {:keys [include-color-wheels? held]}]
-  (let [cue (cues/cue :color (fn [_] (global-color-effect color :include-color-wheels? include-color-wheels?))
-    :held held
-    :color (create-color color))]
-    (ct/set-cue! (:cue-grid *show*) x y cue)))
-
-
-(defn make-strobe-cue
-  "Create a cue which strobes a set of fixtures as long as the cue pad
-  is held down, letting the operator adjust the lightness of the
-  strobe color by varying the pressure they are applying to the pad on
-  controllers which support pressure sensitivity."
-  [name fixtures x y]
-  (ct/set-cue! (:cue-grid *show*) x y
-     (cues/cue (keyword (str "strobe-" (clojure.string/replace (clojure.string/lower-case name) " " "-")))
-         (fn [var-map] (fun/strobe (str "Strobe " name) fixtures
-             (:level var-map 50) (:lightness var-map 100)))
-         :color :purple
-         :held true
-         :priority 100
-         :variables [{:key "level" :min 0 :max 100 :start 100 :name "Level"}
-           {:key "lightness" :min 0 :max 100 :name "Lightness" :velocity true}])))
-
-(defn x-phase
-  "Return a value that ranges from zero for the leftmost fixture in a
-  show to 1 for the rightmost, for staggering the phase of an
-  oscillator in making a can-can chase."
-  [head show]
-  (let [dimensions @(:dimensions *show*)]
-    (/ (- (:x head) (:min-x dimensions)) (- (:max-x dimensions) (:min-x dimensions)))))
-
-(defn- name-torrent-gobo-cue
-  "Come up with a summary name for one of the gobo cues we are
-  creating that is concise but meaningful on a controller interface."
-  [prefix function]
-  (let [simplified (clojure.string/replace (name function) #"^gobo-fixed-" "")
-        simplified (clojure.string/replace simplified #"^gobo-moving-" "m/")
-        spaced (clojure.string/replace simplified "-" " ")]
-    (str (clojure.string/upper-case (name prefix)) " " spaced)))
-
-(defn- make-torrent-gobo-cues
-  "Create cues for the fixed and moving gobo options, stationary and
-  shaking. Takes up half a page on the Push, with the top left at the
-  coordinates specified."
-  [prefix fixtures top left]
-  ;; Make cues for the stationary and shaking versions of all fixed gobos
-  (doseq [_ (map-indexed (fn [i v]
-                           (let [blue (create-color :blue)
-                                 x (if (< i 8) left (+ left 2))
-                                 y (if (< i 8) (- top i) (- top i -1))
-                                 cue-key (keyword (str (name prefix) "-gobo-fixed"))]
-                             (ct/set-cue! (:cue-grid *show*) x y
-                                          (cues/function-cue cue-key (keyword v) fixtures :color blue
-                                                             :short-name (name-torrent-gobo-cue prefix v)))
-                             (let [function (keyword (str (name v) "-shake"))]
-                               (ct/set-cue! (:cue-grid *show*) (inc x) y
-                                            (cues/function-cue cue-key function fixtures :color blue
-                                                               :short-name (name-torrent-gobo-cue prefix function))))))
-                         ["gobo-fixed-mortar" "gobo-fixed-4-rings" "gobo-fixed-atom" "gobo-fixed-jacks"
-                          "gobo-fixed-saw" "gobo-fixed-sunflower" "gobo-fixed-45-adapter"
-                          "gobo-fixed-star" "gobo-fixed-rose-fingerprint"])])
-  ;; Make cues for the stationary and shaking versions of all rotating gobos
-  (doseq [_ (map-indexed (fn [i v]
-                           (let [green (create-color :green)
-                                 cue-key (keyword (str (name prefix) "-gobo-moving"))]
-                             (ct/set-cue! (:cue-grid *show*) (+ left 2) (- top i)
-                                          (cues/function-cue cue-key (keyword v) fixtures :color green
-                                                             :short-name (name-torrent-gobo-cue prefix v)))
-                             (let [function (keyword (str (name v) "-shake"))]
-                               (ct/set-cue! (:cue-grid *show*) (+ left 3) (- top i)
-                                            (cues/function-cue cue-key function fixtures :color green
-                                                               :short-name (name-torrent-gobo-cue prefix function))))))
-                         ["gobo-moving-rings" "gobo-moving-color-swirl" "gobo-moving-stars"
-                          "gobo-moving-optical-tube" "gobo-moving-magenta-bundt"
-                          "gobo-moving-blue-mega-hazard" "gobo-moving-turbine"])]))
-
-(defonce ^{:doc "A step parameter for controlling example chase cues.
-  Change it to experiment with other kinds of timing and fades."}
-  step-param
-  (atom nil))

 (defn new-cues
   "Create cues."
@@ -485,430 +401,4 @@
         (fn [_] (var-fx/variable-effect @var-binder :main-hue 120))
       )
     )))
-)
-
-(defn make-cues
-  "Create cues."
-  []
-  (let [hue-bar (params/build-oscillated-param  ; Spread a rainbow across a bar of music
-                 (oscillators/sawtooth-bar) :max 360)
-    desat-beat (params/build-oscillated-param  ; Desaturate a color as a beat progresses
-                (oscillators/sawtooth-beat :down? true) :max 100)
-    hue-gradient (params/build-spatial-param  ; Spread a rainbow across the light grid
-      (show/all-fixtures)
-      (fn [head] (- (:x head) (:min-x @(:dimensions *show*)))) :max 360)
-    hue-z-gradient (params/build-spatial-param  ; Spread a rainbow across the light grid front to back
-      (show/all-fixtures)
-      (fn [head] (- (:z head) (:min-z @(:dimensions *show*)))) :max 360)]
-
-  (global-color-cue "red" 0 0 :include-color-wheels? true)
-  (global-color-cue "orange" 1 0 :include-color-wheels? true)
-  (global-color-cue "yellow" 2 0 :include-color-wheels? true)
-  (global-color-cue "green" 3 0 :include-color-wheels? true)
-  (global-color-cue "blue" 4 0 :include-color-wheels? true)
-  (global-color-cue "purple" 5 0 :include-color-wheels? true)
-  (global-color-cue "white" 6 0 :include-color-wheels? true)
-
-
-    (ct/set-cue! (:cue-grid *show*) 0 1
-                 (cues/cue :color (fn [_] (global-color-effect
-                                           (params/build-color-param :s :rainbow-saturation :l 50 :h hue-bar)))
-                           :short-name "Rainbow Bar Fade"
-                           :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-                                        :type :integer}]))
-    (ct/set-cue! (:cue-grid *show*) 1 1
-                 (cues/cue :color (fn [_] (global-color-effect
-                                           (params/build-color-param :s :rainbow-saturation :l 50 :h hue-gradient)
-                                           :include-color-wheels? true))
-                           :short-name "Rainbow Grid"
-                           :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-                                        :type :integer}]))
-    (ct/set-cue! (:cue-grid *show*) 2 1
-      (cues/cue :color (fn [_] (global-color-effect
-        (params/build-color-param :s :rainbow-saturation :l 50 :h hue-gradient
-          :adjust-hue hue-bar)))
-            :short-name "Rainbow Grid+Bar"
-            :variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
-              :type :integer}]))
-    (ct/set-cue! (:cue-grid *show*) 3 1  ; Desaturate the rainbow as each beat progresses
-                 (cues/cue :color (fn [_] (global-color-effect
-                                           (params/build-color-param :s desat-beat :l 50 :h hue-gradient
-                                                                     :adjust-hue hue-bar)))
-                           :short-name "Rainbow Pulse"))
-
-    (ct/set-cue! (:cue-grid *show*) 5 1
-                 (cues/cue :color (fn [_] (global-color-effect
-                                           (params/build-color-param :s 100 :l 50 :h hue-z-gradient)
-                                           :include-color-wheels? true))
-                           :short-name "Z Rainbow Grid"))
-    (ct/set-cue! (:cue-grid *show*) 6 1
-     (cues/cue :color (fn [_] (global-color-effect
-       (params/build-color-param :s 100 :l 50 :h hue-z-gradient
-                                 :adjust-hue hue-bar)))
-      :short-name "Z Rainbow Grid+Bar"))
-
-    ;; TODO: Write a macro to make it easier to bind cue variables.
-    (ct/set-cue! (:cue-grid *show*) 0 7
-      (cues/cue :sparkle (fn [var-map] (fun/sparkle (show/all-fixtures)
-        :chance (:chance var-map 0.05)
-        :fade-time (:fade-time var-map 50)))
-          :held true
-          :priority 100
-          :variables [{:key "chance" :min 0.0 :max 0.4 :start 0.05 :velocity true}
-            {:key "fade-time" :name "Fade" :min 1 :max 2000 :start 50 :type :integer}]))
-
-    (ct/set-cue! (:cue-grid *show*) 2 7
-                 (cues/cue :transform-colors (fn [_] (color-fx/transform-colors (show/all-fixtures)))
-                           :priority 1000))
-
-
-    (ct/set-cue! (:cue-grid *show*) 7 7
-                 (cues/function-cue :strobe-all :strobe (show/all-fixtures) :effect-name "Raw Strobe"))
-
-    (ct/set-cue! (:cue-grid *show*) 1 3
-                 (cues/cue :torrent-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "torrent") :effect-name "Torrent Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 2 3
-                 (cues/cue :blade-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "blade") :effect-name "Blade Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 3 3
-                 (cues/cue :ws-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "ws") :effect-name "WS Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 4 3
-                 (cues/cue :hex-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "hex") :effect-name "Hex Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 5 3
-                 (cues/cue :puck-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "puck") :effect-name "Puck Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 6 3
-                 (cues/cue :snowball-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :down? true))
-                                    (show/fixtures-named "snowball") :effect-name "Snowball Saw Down Beat"))
-                           :color :orange :end-keys [:dimmers]))
-
-    ;; Dimmer oscillator cues: Sawtooth up over 2 beat
-    (ct/set-cue! (:cue-grid *show*) 0 4
-                 (cues/cue :dimmers (fn [_] (global-dimmer-effect
-                                             (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                             :effect-name "All Saw Up 2 Beat"))
-                           :color :yellow :end-keys [:torrent-dimmers :blade-dimmers :ws-dimmers
-                                                     :puck-dimmers :hex-dimmers :snowball-dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 1 4
-                 (cues/cue :torrent-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "torrent") :effect-name "Torrent Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 2 4
-                 (cues/cue :blade-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "blade") :effect-name "Blade Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 3 4
-                 (cues/cue :ws-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "ws") :effect-name "WS Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 4 4
-                 (cues/cue :hex-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "hex") :effect-name "Hex Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 5 4
-                 (cues/cue :puck-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "puck") :effect-name "Puck Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-    (ct/set-cue! (:cue-grid *show*) 6 4
-                 (cues/cue :snowball-dimmers
-                           (fn [_] (dimmer-effect
-                                    (params/build-oscillated-param (oscillators/sawtooth-beat :beat-ratio 2))
-                                    (show/fixtures-named "snowball") :effect-name "Snowball Saw Up 2 Beat"))
-                           :color :orange :end-keys [:dimmers]))
-
-    ;; Strobe cues
-    (make-strobe-cue "All" (show/all-fixtures) 0 6)
-    (make-strobe-cue "Torrents" (show/fixtures-named "torrent") 1 6)
-    (make-strobe-cue "Blades" (show/fixtures-named "blade") 2 6)
-    (make-strobe-cue "Weather Systems" (show/fixtures-named "ws") 3 6)
-    (make-strobe-cue "Hexes" (show/fixtures-named "hex") 4 6)
-    (make-strobe-cue "Pucks" (show/fixtures-named "puck") 5 6)
-
-    (ct/set-cue! (:cue-grid *show*) 7 6
-                 (cues/cue :adjust-strobe (fn [_] (fun/adjust-strobe))
-                           :color :purple
-                           :variables [{:key :strobe-hue :min 0 :max 360 :name "Hue" :centered true}
-                                       {:key :strobe-saturation :min 0 :max 100 :name "Saturatn"}]))
-
-    ;; The upper page of torrent config cues
-    (ct/set-cue! (:cue-grid *show*) 0 15
-                 (cues/function-cue :torrent-shutter :shutter-open (show/fixtures-named "torrent")))
-    (ct/set-cue! (:cue-grid *show*) 1 15
-                 (cues/function-cue :torrent-reset :motor-reset (show/fixtures-named "torrent")
-                                    :color (create-color :red) :held true))
-
-    (ct/set-cue! (:cue-grid *show*) 6 15
-                 (cues/function-cue :t1-focus :focus (show/fixtures-named "torrent-1") :effect-name "Torrent 1 Focus"
-                                    :color (create-color :yellow)))
-    (ct/set-cue! (:cue-grid *show*) 7 15
-                 (cues/function-cue :t2-focus :focus (show/fixtures-named "torrent-2") :effect-name "Torrent 2 Focus"
-                                    :color (create-color :yellow)))
-    (ct/set-cue! (:cue-grid *show*) 6 14
-                 (cues/function-cue :t1-prism :prism-clockwise (show/fixtures-named "torrent-1") :level 100
-                                    :effect-name "T1 Prism Spin CW" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 7 14
-                 (cues/function-cue :t2-prism :prism-clockwise (show/fixtures-named "torrent-2") :level 100
-                                    :effect-name "T2 Prism Spin CW" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 6 13
-                 (cues/function-cue :t1-prism :prism-in (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Prism In" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 7 13
-                 (cues/function-cue :t2-prism :prism-in (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Prism In" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 6 12
-                 (cues/function-cue :t1-prism :prism-counterclockwise (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Prism Spin CCW" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 7 12
-                 (cues/function-cue :t2-prism :prism-counterclockwise (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Prism Spin CCW" :color (create-color :orange)))
-    (ct/set-cue! (:cue-grid *show*) 6 11
-                 (cues/function-cue :t1-gobo-fixed :gobo-fixed-clockwise (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Fixed Gobos Swap CW" :color (create-color :blue)))
-    (ct/set-cue! (:cue-grid *show*) 7 11
-                 (cues/function-cue :t2-gobo-fixed :gobo-fixed-clockwise (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Fixed Gobos Swap CW" :color (create-color :blue)))
-    (ct/set-cue! (:cue-grid *show*) 6 10
-                 (cues/function-cue :t1-gobo-moving :gobo-moving-clockwise (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Moving Gobos Swap CW" :color (create-color :green)))
-    (ct/set-cue! (:cue-grid *show*) 7 10
-                 (cues/function-cue :t2-gobo-moving :gobo-moving-clockwise (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Moving Gobos Swap CW" :color (create-color :green)))
-    (ct/set-cue! (:cue-grid *show*) 6 9
-                 (cues/function-cue :t1-gobo-rotation :gobo-rotation-clockwise (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Spin Gobo CW" :color (create-color :cyan) :level 100))
-    (ct/set-cue! (:cue-grid *show*) 7 9
-                 (cues/function-cue :t2-gobo-rotation :gobo-rotation-clockwise (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Spin Gobo CW" :color (create-color :cyan) :level 100))
-    (ct/set-cue! (:cue-grid *show*) 6 8
-                 (cues/function-cue :t1-gobo-rotation :gobo-rotation-counterclockwise (show/fixtures-named "torrent-1")
-                                    :effect-name "T1 Spin Gobo CCW" :color (create-color :cyan)))
-    (ct/set-cue! (:cue-grid *show*) 7 8
-                 (cues/function-cue :t2-gobo-rotation :gobo-rotation-counterclockwise (show/fixtures-named "torrent-2")
-                                    :effect-name "T2 Spin Gobo CCW" :color (create-color :cyan)))
-
-    ;; Some basic moving head chases
-    (let [triangle-phrase (params/build-oscillated-param ; Move back and forth over a phrase
-                           (oscillators/triangle-phrase) :min -90 :max 90)
-          staggered-triangle-bar (params/build-spatial-param ; Bounce over a bar, staggered across grid x
-                                  (show/all-fixtures)
-                                  (fn [head]
-                                    (params/build-oscillated-param
-                                     (oscillators/triangle-bar :phase (x-phase head *show*))
-                                     :min -90 :max 0)))
-          can-can-dir (params/build-direction-param-from-pan-tilt :pan triangle-phrase :tilt staggered-triangle-bar)
-          can-can-p-t (params/build-pan-tilt-param :pan triangle-phrase :tilt staggered-triangle-bar)]
-      (ct/set-cue! (:cue-grid *show*) 0 9
-                   (cues/cue :movement (fn [var-map]
-                                         (move/direction-effect "Can Can" can-can-dir (show/all-fixtures)))))
-      (ct/set-cue! (:cue-grid *show*) 1 9
-                   (cues/cue :movement (fn [var-map]
-                                         (move/pan-tilt-effect "P/T Can Can" can-can-p-t (show/all-fixtures))))))
-
-    ;; A couple snowball cues
-    (ct/set-cue! (:cue-grid *show*) 0 10 (cues/function-cue :sb-pos :beams-fixed (show/fixtures-named "snowball")
-                                                            :effect-name "Snowball Fixed"))
-    (ct/set-cue! (:cue-grid *show*) 1 10 (cues/function-cue :sb-pos :beams-moving (show/fixtures-named "snowball")
-                                                            :effect-name "Snowball Moving"))
-
-    ;; The separate page of specific gobo cues for each Torrent
-    (make-torrent-gobo-cues :t1 (show/fixtures-named "torrent-1") 15 8)
-    (make-torrent-gobo-cues :t2 (show/fixtures-named "torrent-2") 15 12)
-
-    ;; TODO: Write a function to create direction cues, like function cues? Unless macro solves.
-    (ct/set-cue! (:cue-grid *show*) 0 8
-                 (cues/cue :torrent-dir (fn [var-map]
-                                          (move/direction-effect
-                                           "Pan/Tilt"
-                                           (params/build-direction-param-from-pan-tilt :pan (:pan var-map 0.0)
-                                                                                :tilt (:tilt var-map 0.0)
-                                                                                :degrees true)
-                                           (show/all-fixtures)))
-                           :variables [{:key "pan" :name "Pan"
-                                        :min -180.0 :max 180.0 :start 0.0 :centered true :resolution 0.5}
-                                       {:key "tilt" :name "Tilt"
-                                        :min -180.0 :max 180.0 :start 0.0 :centered true :resolution 0.5}]))
-    (ct/set-cue! (:cue-grid *show*) 1 8
-                 (cues/cue :torrent-dir (fn [var-map]
-                                          (move/aim-effect
-                                           "Aim"
-                                           (params/build-aim-param :x (:x var-map 0.0)
-                                                                   :y (:y var-map 0.0)
-                                                                   :z (:z var-map 1.0))
-                                           (show/all-fixtures)))
-                           :variables [{:key "x" :name "X"
-                                        :min -20.0 :max 20.0 :start 0.0 :centered true :resolution 0.05}
-                                       {:key "z" :name "Z"
-                                        :min -20.0 :max 20.0 :start 0.0 :centered true :resolution 0.05}
-                                       {:key "y" :name "Y"
-                                        :min 0.0 :max 20.0 :start 0.0 :centered false :resolution 0.05}]))
-    (ct/set-cue! (:cue-grid *show*) 3 8
-                 (cues/function-cue :blade-speed :movement-speed (show/fixtures-named "blade")
-                                    :color :purple :effect-name "Slow Blades"))
-
-    ;; Some fades
-    (ct/set-cue! (:cue-grid *show*) 0 12
-                 (cues/cue :color-fade (fn [var-map]
-                                         (fx/fade "Color Fade"
-                                                  (global-color-effect :red :include-color-wheels? true)
-                                                  (global-color-effect :green :include-color-wheels? true)
-                                                  (params/bind-keyword-param (:phase var-map 0) Number 0)))
-                           :variables [{:key "phase" :min 0.0 :max 1.0 :start 0.0 :name "Fade"}]
-                           :color :yellow))
-
-    (ct/set-cue!
-     (:cue-grid *show*) 1 12
-     (cues/cue :fade-test (fn [var-map]
-                            (fx/fade "Fade Test"
-                                     (fx/blank)
-                                     (global-color-effect :blue :include-color-wheels? true)
-                                     (params/bind-keyword-param (:phase var-map 0) Number 0)))
-               :variables [{:key "phase" :min 0.0 :max 1.0 :start 0.0 :name "Fade"}]
-               :color :cyan))
-
-    (ct/set-cue!
-     (:cue-grid *show*) 2 12
-     (cues/cue :fade-test-2 (fn [var-map]
-                              (fx/fade "Fade Test 2"
-                                       (move/direction-effect
-                                        "p/t" (params/build-direction-param-from-pan-tilt :pan 0 :tilt 0)
-                                        (show/fixtures-named "torrent"))
-                                       (move/direction-effect
-                                        "p/t" (params/build-direction-param-from-pan-tilt :pan 0 :tilt 0)
-                                        (show/fixtures-named "blade"))
-                                       (params/bind-keyword-param (:phase var-map 0) Number 0)))
-               :variables [{:key "phase" :min 0.0 :max 1.0 :start 0.0 :name "Fade"}]
-               :color :red))
-
-    (ct/set-cue!
-     (:cue-grid *show*) 3 12
-     (cues/cue :fade-test-3 (fn [var-map]
-                              (fx/fade "Fade Test P/T"
-                                       (move/pan-tilt-effect
-                                        "p/t" (params/build-pan-tilt-param :pan 0 :tilt 0)
-                                        (show/fixtures-named "torrent"))
-                                       (move/pan-tilt-effect
-                                        "p/t" (params/build-pan-tilt-param :pan 0 :tilt 0)
-                                        (show/fixtures-named "blade"))
-                                       (params/bind-keyword-param (:phase var-map 0) Number 0)))
-               :variables [{:key "phase" :min 0.0 :max 1.0 :start 0.0 :name "Fade"}]
-               :color :orange))
-
-    ;; Some chases
-    (ct/set-cue!
-     (:cue-grid *show*) 0 13
-     (cues/cue :chase (fn [var-map]
-                        (fx/chase "Chase Test"
-                                  [(global-color-effect :red :include-color-wheels? true)
-                                   (global-color-effect :green :lights (show/fixtures-named "hex"))
-                                   (global-color-effect :blue :include-color-wheels? true)]
-                                  (params/bind-keyword-param (:position var-map 0) Number 0)
-                                  :beyond :bounce)
-                        )
-               :variables [{:key "position" :min -0.5 :max 10.5 :start 0.0 :name "Position"}]
-               :color :purple))
-
-    ;; Set up an initial value for our step parameter
-    (reset! step-param (params/build-step-param :fade-fraction 0.3 :fade-curve :sine))
-
-    (ct/set-cue!
-     (:cue-grid *show*) 1 13
-     (cues/cue :chase (fn [var-map]
-                        (fx/chase "Chase Test 2"
-                                  [(global-color-effect :red :lights (show/fixtures-named "hex"))
-                                   (global-color-effect :green :lights (show/fixtures-named "blade"))
-                                   (global-color-effect :blue :lights (show/fixtures-named "hex"))
-                                   (global-color-effect :white :lights (show/all-fixtures))]
-                                  @step-param :beyond :loop))
-               :color :magenta))
-
-    ;; Some compound cues
-    (ct/set-cue! (:cue-grid *show*) 8 0
-                 (cues/cue :star-swirl (fn [_] (cues/compound-cues-effect
-                                                "Star Swirl" *show* [[8 12]
-                                                                     [10 9]
-                                                                     [6 15 {:level 60}]
-                                                                     [6 8 {:level 25}]]))))
-    ;; Some color cycle chases
-    (ct/set-cue! (:cue-grid *show*) 8 1
-                 (cues/cue :color (fn [_] (fun/iris-out-color-cycle-chase (show/all-fixtures)))))
-    (ct/set-cue! (:cue-grid *show*) 9 1
-                 (cues/cue :color (fn [_] (fun/wipe-right-color-cycle-chase
-                                           (show/all-fixtures) :transition-phase-function rhythm/snapshot-bar-phase))))
-    (ct/set-cue! (:cue-grid *show*) 10 1
-                 (cues/cue :color (fn [_] (fun/wipe-right-color-cycle-chase
-                                           (show/all-fixtures)
-                                           :color-index-function rhythm/snapshot-beat-within-phrase
-                                           :transition-phase-function rhythm/snapshot-beat-phase
-                                           :effect-name "Wipe Right Beat"))))
-
-    ;; Some cues to show the Hypnotic RGB Laser
-    (ct/set-cue! (:cue-grid *show*) 8 3
-                 (cues/function-cue :hypnotic-beam :beam-red (show/fixtures-named "hyp-rgb")
-                                    :color :red :effect-name "Hypnotic Red"))
-    (ct/set-cue! (:cue-grid *show*) 9 3
-                 (cues/function-cue :hypnotic-beam :beam-green (show/fixtures-named "hyp-rgb")
-                                    :color :green :effect-name "Hypnotic Green"))
-    (ct/set-cue! (:cue-grid *show*) 10 3
-                 (cues/function-cue :hypnotic-beam :beam-blue (show/fixtures-named "hyp-rgb")
-                                    :color :blue :effect-name "Hypnotic Blue"))
-    (ct/set-cue! (:cue-grid *show*) 11 3
-                 (cues/function-cue :hypnotic-beam :beam-red-green (show/fixtures-named "hyp-rgb")
-                                    :color :yellow :effect-name "Hypnotic Red Green"))
-    (ct/set-cue! (:cue-grid *show*) 12 3
-                 (cues/function-cue :hypnotic-beam :beam-red-blue (show/fixtures-named "hyp-rgb")
-                                    :color :purple :effect-name "Hypnotic Red Blue"))
-    (ct/set-cue! (:cue-grid *show*) 13 3
-                 (cues/function-cue :hypnotic-beam :beam-green-blue (show/fixtures-named "hyp-rgb")
-                                    :color :cyan :effect-name "Hypnotic Green Blue"))
-    (ct/set-cue! (:cue-grid *show*) 14 3
-                 (cues/function-cue :hypnotic-beam :beam-red-green-blue (show/fixtures-named "hyp-rgb")
-                                    :color :white :effect-name "Hypnotic Red Green Blue"))
-    (ct/set-cue! (:cue-grid *show*) 15 3
-                 (cues/function-cue :hypnotic-beam :beam-all-random (show/fixtures-named "hyp-rgb")
-                                    :color :white :effect-name "Hypnotic Random"))
-    (ct/set-cue! (:cue-grid *show*) 14 4
-                 (cues/function-cue :hypnotic-spin :beams-ccw (show/fixtures-named "hyp-rgb")
-                                    :color :cyan :effect-name "Hypnotic Rotate CCW" :level 50))
-    (ct/set-cue! (:cue-grid *show*) 15 4
-                 (cues/function-cue :hypnotic-spin :beams-cw (show/fixtures-named "hyp-rgb")
-                                    :color :cyan :effect-name "Hypnotic Rotate Clockwise" :level 50))
-
-    ;; What else?
-    ;; TODO: Refine this and make a cue
-    #_(show/add-effect! :torrent-focus (afterglow.effects.channel/function-effect
-                                        "F" :focus (params/build-oscillated-param (oscillators/sine-bar)
-                                                                                :min 20 :max 200)
-                                        (show/fixtures-named "torrent")))))
-
-
-(make-cues)+)


plead

plead

--- src/mortgage/core.cljs
+++ src/mortgage/core.cljs
@@ -162,6 +162,11 @@

 (sm/defn format-number [n :- s/Num]
   (str "$" (.toLocaleString n)))
+
+;; HELLO seriously everything below here is awful, don't look at it
+;; i was trying to debug a performance issue and changed the code until i'd resolved it and understood
+;; what the issue was, and at this point it's not worth the time to unfuck the code because i'm done with this project
+;; i promise my code is not usually this bad, don't look at the stuff below

 (sm/defn draw-bar [point :- DataPoint
                    offset :- s/Int


maintain persona handler

maintain persona handler

--- src/panpan/persona.clj
+++ src/panpan/persona.clj
@@ -10,17 +10,10 @@

 (defn- brain-key-values
   [& _]
-  (let [ks          (brain/keys)
-        key-max-len (apply max (map count ks))
-        make-spaces #(str/join "" (repeat (- key-max-len (count %)) " "))]
-    (->> ks
-         (reduce
-           (fn [res k]
-             (conj res (str " * " k (make-spaces k) " : " (brain/get k))))
-           [])
-         (str/join "\n")
-         (str "Key/Value\n"))))
-
+  (->> (brain/keys)
+       (reduce #(conj % (str " * " %2 " => " (brain/get %2))) [])
+       (str/join "\n")
+       (str "Key/Value:\n")))

 (defn persona-hear-handler
   [{:keys [user] :as arg}]
@@ -44,14 +37,14 @@
   [{:keys [text message-for-me?] :as arg}]
   (when message-for-me?
     (handler/regexp arg
-      #"ping" (constantly "pong")
+      #"ping"              (constantly "pong")
       #"^set (.+?) (.+?)$" (fn [{[_ k v] :match}] (brain/set k v) "OK")
       #"^get (.+?)$"       (fn [{[_ k]   :match}] (brain/get k))
       #"^brain$"           brain-key-values
       #".+"
       (fn [& _]
-        (when-let [res (some-> api-key
-                               (dd/talk text {;:t 30
-                                              :context (brain/get CONTEXT_KEY)}))]
-          (brain/set CONTEXT_KEY (:context res))
-          (:utt res))))))
+        (let [opt {:context (brain/get CONTEXT_KEY)}
+              res (some-> api-key (dd/talk text opt))]
+          (when res
+            (brain/set CONTEXT_KEY (:context res))
+            (:utt res)))))))


Give an attribution to the puzzle creator in the source code

--- src/puzzle/komachi.clj
+++ src/puzzle/komachi.clj
@@ -1,6 +1,6 @@
 ;; Komachi Mushi Kui Zan (小町虫食い算)
 ;;
-;; Finding a triplet of three-digit prime numbers
+;; Quiz: Find a triplet of three-digit prime numbers
 ;; where the nine digits are composed of 1, 2, 3, 4, 5, 6, 7, 8 and 9
 ;; and the sum of the triplets ('JKL' below) is a three-digit number.
 ;;
@@ -9,15 +9,20 @@
 ;; + G H I
 ;; --------
 ;;   J K L
-
+;;
+;; This puzzle was originally created by Yoshigara Takaki (吉柄貴樹)
+;; and printed on C MAGAZINE February 1996 Issue [1]
+;; published by Gijutsu-Hyohron Co., Ltd. (技術評論社).
+;;
+;; [1] http://www.amazon.co.jp/dp/B00KLPFPZE

 (ns puzzle.komachi
   (:gen-class)
   (:require [clojure.math.combinatorics :refer [combinations]]))

 (def prime-numbers
-  "Returns a lazy-seq of prime numbers
-   (from: https://gist.github.com/kohyama/8e599b2e765ad4256f32)"
+  "Returns a lazy-seq of prime numbers"
+  ;; from https://gist.github.com/kohyama/8e599b2e765ad4256f32
   ((fn f [x]
      (cons x
        (lazy-seq


fix change-nickname! to also update :user-in-room db relation too

--- src/subrosa/client.clj
+++ src/subrosa/client.clj
@@ -47,7 +47,12 @@
 (defn change-nickname! [channel new-nick]
   (let [existing-user (user-for-channel channel)]
     (alter db remove-tuple :user existing-user)
-    (alter db add-tuple :user (assoc existing-user :nick new-nick))))
+    (alter db add-tuple :user (assoc existing-user :nick new-nick))
+    (doseq [user-in-room (select @db :user-in-room
+                                 {:user-nick (:nick existing-user)})]
+      (alter db remove-tuple :user-in-room user-in-room)
+      (alter db add-tuple :user-in-room
+             (assoc user-in-room :user-nick new-nick)))))

 (defn maybe-add-authentication-step! [channel step]
   (when-not (authenticated? channel)


spacing

spacing

--- src/vc/validations.clj
+++ src/vc/validations.clj
@@ -44,7 +44,7 @@

 (def formats (into #{} (keys disk-format-types)))

-(defvalidatorset common-allocation
+(defvalidatorset common-allocation
     :pool [cv/str?]
     :hostsystem [cv/str? v/required]
     :datacenter [cv/str? v/required]


Typo fixed

Typo fixed

--- src/word_keeper/db.clj
+++ src/word_keeper/db.clj
@@ -23,7 +23,7 @@
 (defquery select-twitter-user "sql/select-twitter-user.sql")
 (defn find-twitter-user [twitter-id] (first (select-twitter-user db-spec twitter-id)))

-(defquery insert-user "sql/insert-user.sql")
+(defquery insert-user<! "sql/insert-user.sql")
 (defn create-user! [] (insert-user<! db-spec))

 (defquery insert-twitter-user! "sql/insert-twitter-user.sql")


Use options from set-options! as operational options too.

--- src/zprint/config.cljc
+++ src/zprint/config.cljc
@@ -964,6 +964,12 @@
   #?(:clj (some is-repl-stack-element (current-stack-trace))
      :cljs nil))

+(defn select-op-options
+  "Given an options map, return an options map with only the operational
+  options remaining."
+  [options]
+  (select-keys options operational-options))
+
 ;;
 ;; End "detect in a REPL" code

@@ -1005,8 +1011,10 @@
                           new-options))
   ([new-options]
    (config-set-options! new-options
-                        (str "repl or api call " (inc-explained-sequence))))
-  ([new-options doc-str] (config-set-options! new-options doc-str nil)))
+                        (str "repl or api call " (inc-explained-sequence))
+                        (select-op-options new-options)))
+  ([new-options doc-str]
+   (config-set-options! new-options doc-str (select-op-options new-options))))

 ;;
 ;; # Options Validation Functions
@@ -1350,12 +1358,6 @@
   [existing new]
   (reduce replace-existing existing new))

-(defn select-op-options
-  "Given an options map, return an options map with only the operational
-  options remaining."
-  [options]
-  (select-keys options operational-options))
-
 ;;
 ;; # Configure one map
 ;;


Add messages to checks

Add messages to checks

--- test/io/perun_test.clj
+++ test/io/perun_test.clj
@@ -314,7 +314,8 @@
         (p/paginate :renderer 'io.perun-test/render-paginate)
         (testing "paginate"
           (content-check :path "public/page-1.html"
-                         :content "paginate 7"))
+                         :content "paginate 7"
+                         :msg "`paginate` should write new files"))

         (p/render :renderer 'io.perun-test/render)
         (testing "render"
@@ -507,17 +508,23 @@
                     :meta {:paginated "mmhmm"})
         (testing "paginate"
           (content-check :path "baz/decomplect-1.html"
-                         :content "paginate 2")
+                         :content "paginate 2"
+                         :msg "`paginate` should write new files")
           (content-check :path "baz/decomplect-2.html"
-                         :content "paginate 2")
+                         :content "paginate 2"
+                         :msg "`paginate` should write new files")
           (content-check :path "baz/decomplect-3.html"
-                         :content "paginate 1")
+                         :content "paginate 1"
+                         :msg "`paginate` should write new files")
           (value-check :path "baz/decomplect-1.html"
-                       :value-fn #(meta= %1 %2 :paginated "mmhmm"))
+                       :value-fn #(meta= %1 %2 :paginated "mmhmm")
+                       :msg "`paginate` should set metadata")
           (value-check :path "baz/decomplect-2.html"
-                       :value-fn #(meta= %1 %2 :paginated "mmhmm"))
+                       :value-fn #(meta= %1 %2 :paginated "mmhmm")
+                       :msg "`paginate` should set metadata")
           (value-check :path "baz/decomplect-3.html"
-                       :value-fn #(meta= %1 %2 :paginated "mmhmm")))
+                       :value-fn #(meta= %1 %2 :paginated "mmhmm")
+                       :msg "`paginate` should set metadata"))

         (p/render :renderer 'io.perun-test/render
                   :filterer :markdown-set


Correcting multipart documentation.

Correcting multipart documentation.

--- ingest-app/src/cmr/ingest/api/multipart.clj
+++ ingest-app/src/cmr/ingest/api/multipart.clj
@@ -1,8 +1,8 @@
 (ns cmr.ingest.api.multipart
   "A modified copy of ring.middleware.multipart-params.
   Specifies a ring middleware that can parse out multipart params along with a content type with
-  each string parameter. The original version did not allow extracting a content type with the a
-  normal multipart for field."
+  each string parameter. The original version did not allow extracting a content type unless the
+  parameter sent was a file type."
   (:require [ring.util.request :as req])
   (:use [ring.util.codec :only (assoc-conj)])
   (:import [org.apache.commons.fileupload.util Streams]


Documenting cusTuples[D

Documenting cusTuples[D

--- src/app/javaparser.clj
+++ src/app/javaparser.clj
@@ -230,8 +230,7 @@
     (for [cuTuple cusTuples]
       (allClasses (:cu cuTuple)))))

-; Get tuples of [filename cu]
-(defn cusTuples [dirname]
+(defn cusTuples "Get tuples of [filename cu]" [dirname]
   (filter not-nil? (parseDirByName dirname)))

 (defn cus [dirname]


Changed restful route for example listing to return a list of maps, not a list of key/value pairs.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -14,15 +14,19 @@
   (str/capitalize
    (str/replace (str/replace filename #"_" " ") #".clj" "")))

-(defn files-as-list
+(defn example
+  [path]
+  (let [filename (peek (str/split path #"/"))]
+  {:title (filename-as-text filename)
+   :filename filename}))
+
+(defn files-as-strings
   [dir]
   (rest (map str (file-seq (clojure.java.io/file dir)))))

 (defn example-listing
   []
-  (let [filelist (map #(peek (str/split % #"/"))
-                      (files-as-list example-dir))]
-    {:body (zipmap filelist (map filename-as-text filelist))}))
+  {:body (map example (files-as-strings example-dir))})

 (defn example-file
   [filename]


Clear background in spaceship example to avoid not-erased effect while background is loading.

--- src/cljs/quil_site/examples/spaceship.cljs
+++ src/cljs/quil_site/examples/spaceship.cljs
@@ -72,9 +72,10 @@
         h (q/height)]
     (q/with-translation [(/ w 2) (/ h 2)]
       (q/scale (/ (min w h) field-size))
+      (q/background 255)

       ; Draw background and back stars
-      (draw-image state :bg [0 0])
+;      (draw-image state :bg [0 0])
       (draw-stars state (:stars2 state))

       ; Slightly move and rotate spaceship


Ingore delete-time before current time error in indexer-app.

--- src/cmr/indexer/services/index_service.clj
+++ src/cmr/indexer/services/index_service.clj
@@ -3,7 +3,6 @@
   (:require [clojure.string :as s]
             [clj-time.core :as t]
             [cmr.common.log :as log :refer (debug info warn error)]
-            [cmr.common.services.errors :as errors]
             [cmr.common.concepts :as cs]
             [cmr.transmit.metadata-db :as meta-db]
             [cmr.indexer.data.elasticsearch :as es]
@@ -36,10 +35,7 @@
         ttl (when delete-time (t/in-millis (t/interval (t/now) delete-time)))
         concept-index (idx-set/get-concept-index-name context concept-id revision-id concept)
         es-doc (concept->elastic-doc context concept umm-concept)]
-    (if (and ttl (<= ttl 0))
-      (errors/throw-service-error
-        :bad-request
-        (format "DeleteTime %s is before the current time." (str delete-time)))
+    (if-not (and ttl (<= ttl 0))
       (es/save-document-in-elastic
         context
         concept-index


Clean up 2 major problems w/ registrar loop

1. Exiting after first registration request
2. Second timeout creation was totally wrong

Along with some fairly minor issues around loop management (mainly
setting up a promise to signal done)

--- src/com/frereth/server/comms/registrar.clj
+++ src/com/frereth/server/comms/registrar.clj
@@ -73,7 +73,12 @@
                         :address (util/my-ip)
                         :protocol :tcp}
          :expires (date/to-java-date (date/plus (date/date-time) (date/days 1)))
-         :session-token (util/random-uuid)))
+         :session-token (util/random-uuid)
+         ;; FIXME: This needs to be the public key of the action-url
+         :public-key (util/random-uuid)
+         ;; It's tempting to make this a "real" URL instance
+         ;; But clojure doesn't auto-serialize those over EDN
+         :static-url "http://localhost:9000/index.html"))

 (s/defn possibly-authorize!
   "TODO: This desperately needs to happen in a background thread.
@@ -100,29 +105,30 @@
 (s/defn do-registrations :- com-skm/async-channel
   ;; TODO: This really seems like it should be a defnk
   [{:keys [done event-loop ex-chan]} :- Registrar]
-  (log/debug "Entering do-registrations loop")
-  (let [interface (:interface event-loop)
+  (let [done (promise)
+        interface (:interface event-loop)
         ->out (:in-chan interface)
         in<- (:ex-chan event-loop)
-        raw-sources [done in<-]
+        raw-sources [in<-]
         minutes-5 (partial async/timeout (* 5 (util/minute)))]
     (async/go
+      (log/debug "Entering do-registrations loop. sources w/out timeout: " raw-sources)
       (loop [[v c] (async/alts! (conj raw-sources (minutes-5)))]
-        (if (= c done)
-          (log/debug "do-registrations loop stop signalled")
-          (do
-            (if v
-              (try
-                (possibly-authorize! ->out v)
-                ;; Don't want buggy inner handling code to break the external interface
-                (catch RuntimeException ex
-                  (log/error ex "Trying to authorize:\n" v))
-                (catch Exception ex
-                  (log/error ex "Trying to authorize:\n" v)))
-              (log/debug "do-registrations: heartbeat"))
+        (if v
+          (try
+            (possibly-authorize! ->out v)
+            ;; Don't want buggy inner handling code to break the external interface
+            (catch RuntimeException ex
+              (log/error ex "Trying to authorize:\n" v))
+            (catch Exception ex
+              (log/error ex "Trying to authorize:\n" v)))
+          (if (not= c in<-)
+            (log/debug "do-registrations: heartbeat")
             (do
-              (when (not= c in<-)
-                (recur (async/alts! (conj raw-sources (async/timeout (minutes-5))))))))))
+              (log/debug "Signalling loop exit")
+              (deliver done true))))
+        (when-not (realized? done)
+          (recur (async/alts! (conj raw-sources (minutes-5))))))
       (log/debug "do-registration: Exiting"))))

 (comment


reverse the comparisons because y is negative

--- src-cljs/hello.cljs
+++ src-cljs/hello.cljs
@@ -43,8 +43,8 @@
 (defn update [game-world]
   (let [rockets (map update-rocket-step
                   (aget game-world :rockets))
-        spent (filter #(>= (get % :pos-y) (get % :threshold)) rockets)
-        remaining (filter #(< (get % :pos-y) (get % :threshold)) rockets)]
+        spent (filter #(<= (get % :pos-y) (get % :threshold)) rockets)
+        remaining (filter #(> (get % :pos-y) (get % :threshold)) rockets)]
     (aset game-world :rockets remaining)))

 (defn clear-for-frame [graphics-context]


Changing back to listener with longer deref timeout

Because I think IMMUTANT-542 applies to listeners, too, i.e. a single
session receiving all messages.

My current theory is that dynamic destination creation racism is to
blame for IMMUTANT-542.

--- integration-tests/test-clustering/integs/cluster_test.clj
+++ integration-tests/test-clustering/integs/cluster_test.clj
@@ -80,10 +80,15 @@
               ctx2 (msg/context (assoc opts :port (http-port "server-two")))]
     (let [q1 (msg/queue "/queue/cluster" :context ctx1)
           q2 (msg/queue "/queue/cluster" :context ctx2)
-          c 10]
+          received (atom [])
+          p (promise)
+          c 100]
+      (msg/listen q2 (fn [m]
+                       (mark "GOT:" m)
+                       (swap! received conj m)
+                       (when (= c (count @received))
+                         (deliver p :done))))
       (dotimes [i c]
         (msg/publish q1 i))
-      (is (= (range c)
-            (repeatedly c
-              (comp (fn [m] (mark "GOT:" m) m)
-                (partial msg/receive q2))))))))
+      (deref p 60000 nil)
+      (is (= (range c) @received)))))


Add :ext-dependencies to the jar file. Fixes #113.

--- src/cake/tasks/jar.clj
+++ src/cake/tasks/jar.clj
@@ -101,7 +101,9 @@
   (let [opts (apply hash-map opts)
         jar  (jarfile)]
     (into [jar]
-          (fileset-seq {:dir "lib" :includes "*.jar" :excludes (join "," (:excludes opts))}))))
+          (concat
+           (fileset-seq {:dir "lib" :includes "*.jar" :excludes (join "," (:excludes opts))})
+           (fileset-seq {:dir "lib/ext" :includes "*.jar"})))))

 (defn plexus-components [jar]
   (let [jarfile (JarFile. jar)]


Cleanup main

Cleanup main

--- src/cljs/app/core.cljs
+++ src/cljs/app/core.cljs
@@ -5,12 +5,11 @@
             [app.events :as events]
             [app.subs :as subs]))

-(def criteria-url "data/beers-2015-metadata-merged.json")
-
 (defn ^:export main
   "Application entry point"
   []
   (dispatch-sync [:initialize-db])
+  (let [criteria-url "data/beers-2015-metadata-merged.json"]
+    (dispatch [:load-criteria criteria-url]))
   (views/render-results)
-  (dispatch [:load-criteria criteria-url])
   (views/listen-search-input))


removed wrong comment

removed wrong comment

--- src/de/otto/tesla/stateful/configuring.clj
+++ src/de/otto/tesla/stateful/configuring.clj
@@ -11,7 +11,7 @@

 (defn config
   ([config-component]
-   (:config config-component)) ;; DO NOT USE, THIS IS FOR LEGACY SUPPORT ONLY!
+   (:config config-component))
   ([config-component key-path]
    (get-in (:config config-component) key-path))
   ([config-component key-path default]


cleanup

cleanup

--- src/babel/index.cljc
+++ src/babel/index.cljc
@@ -72,27 +72,15 @@
             set1)))

 (defn lookup-spec [spec indices index-lexicon-on-paths]
-  (log/debug (str "index-fn called with spec: "
-                  (strip-refs
-                   (dissoc (strip-refs spec)
-                           :dag_unify.core/serialized))))
   (let [result
         (reduce intersection-with-identity
                 (filter #(not (empty? %))
                         (map (fn [path]
-                               (let [result
-                                     (get (get indices path)
-                                          (get-in spec path ::undefined)
-                                          [])]
-                                 (if (not (empty? result))
-                                   (log/trace (str "subset for path:" path " => " (get-in spec path ::undefined)
-                                                   " = " (count result)))
-                                   (log/trace (str "empty result for path: " path "; spec=" (strip-refs spec))))
-                                 result))
+                               (get (get indices path)
+                                    (get-in spec path ::undefined)
+                                    []))
                              index-lexicon-on-paths)))]
-    (log/debug (str "indexed size returned: " (count result) " for spec: " (strip-refs spec)))
-    (if (and false (empty? result))
-      (throw (Exception. (str "lookup-spec failed: " (strip-refs spec)))))
     (shuffle result)))

+


make latin's generate more like other languages: allow :root to be used to generate

--- src/babel/latin.cljc
+++ src/babel/latin.cljc
@@ -1,35 +1,38 @@
 (ns babel.latin
   (:refer-clojure :exclude [get-in])
   (:require [babel.latin.morphology :as morph]
-            [babel.lexiconfn :refer [default listify]]
+            [babel.lexiconfn :refer [default listify map-function-on-map-vals]]
             [clojure.java.io :refer [reader resource]]
             [clojure.repl :refer [doc]]
-            [dag_unify.core :refer [get-in]]))
+            [dag_unify.core :refer [fail? get-in unifyc]]))

 (defn edn2lexicon [resource]
   (-> (read-string (slurp resource)) ;; read .edn file into a Clojure map.
       listify
+      (map-function-on-map-vals
+       (fn [lexicon-string lexemes]
+         (map (fn [lexeme]
+                (merge lexeme
+                       {:root lexicon-string}))
+              lexemes)))
       (default
        {:phrasal false})))

 (def lexicon (edn2lexicon "src/babel/latin/lexicon.edn"))

-(defn pred2root [pred]
-  (first (shuffle
-          (filter (fn [root]
-                    (let [vals (get lexicon root)]
-                      (not (empty? (filter (fn [val]
-                                             (= (get-in val [:synsem :sem :pred]) pred))
-                                           vals)))))
-                  (keys lexicon)))))

 (defn generate [spec]
-  (let [pred (get-in spec [:synsem :sem :pred])
-        subject (get-in spec [:synsem :sem :subj :pred])
-        verb (pred2root pred)]
-    (morph/conjugate verb {:synsem {:sem {:subj {:pred subject}}}})))
+  (first (shuffle
+          (filter #(not (fail? %))
+                  (map (fn [val]
+                         (unifyc spec val))
+                       (flatten (vals lexicon)))))))
+
+(defn fo [structure]
+  (morph/conjugate (get-in structure [:root]) structure))

 (def model {:lexicon lexicon
-            :generate generate})
+            :fo fo
+            :generate-fn generate})


enraged and hateful about caching and dynamic typing: removing caching

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -26,7 +26,6 @@
 (defn lookup [{lookup :lookup
                lexical-cache :lexical-cache
                default-fn :default-fn} k]
-  (log/debug (str "lookup: k=" k))
   (let [pre-default
         (if (or (= false parse-with-lexical-caching)
                 (nil? lexical-cache))
@@ -34,26 +33,42 @@
           (let [lookup-fn (fn [k]
                             (do (log/debug (str "cache miss for " k))
                                 (let [looked-up (lookup k)]
-                                  (if (not (empty? looked-up)) looked-up :none))))]
+                                  (if (symbol? looked-up)
+                                    (let [msg (str "looked-up is unexpectedly the symbol:" looked-up)]
+                                      (println msg)
+                                      (log/error msg)
+                                      looked-up)
+                                    looked-up))))]
             (deal-with-cache k lookup-fn lexical-cache)
+            ;; TODO: (get .. ..) : set a default value (i.e. :none)
             (let [cache-value (get @lexical-cache k)]
+              (println (str "CACHE-VALUE TYPE: " cache-value))
               (if (= cache-value :none) nil
                   cache-value))))]
     (log/trace (str "default-fn: nil? " (nil? default-fn)))
     (log/trace (str "pre-default: count: " (count pre-default)))
-    (cond (nil? default-fn)
-          pre-default
-          true
-          (map default-fn pre-default))))
+    (let [retval
+          (cond (nil? default-fn)
+                pre-default
+                true
+                (map default-fn pre-default))]
+;;      (println (str "lookup('" k "') type of retval:" retval))
+      (log/debug (str "lookup('" k "') type of retval:" retval))
+      retval)))

 ;; TODO: use dag_unify/assoc-in rather than over/over, so that we can remove babel.over.
 (defn over [grammar left right morph default-fn]
   "opportunity for additional logging before calling the real (over)"
-  (if default-fn
-    (->>
-     (over/over grammar left right)
-     (map default-fn))
-    (over/over grammar left right)))
+  (->>
+   (over/over grammar left right)
+   (map (fn [each]
+          (log/debug (str "over: left=" (string/join "," (map morph left)) "; "
+                          " right=" (string/join "," (map morph right))))
+;;          (println (str "over: left=" (string/join "," (map morph left)) "; "
+;;                        " right=" (string/join "," (map morph right))))
+          (if default-fn
+            (default-fn each)
+            each)))))

 (defn square-cross-product [x]
   (mapcat (fn [each-x]
@@ -168,8 +183,7 @@
                                                               (lookup model string))
                                                             right-strings)
                                       left-signs (lazy-cat left-lexemes (filter map? left))
-                                      right-signs (lazy-cat right-lexemes (filter map? right))
-                                      ]
+                                      right-signs (lazy-cat right-lexemes (filter map? right))]
                                   (lazy-cat
                                    (if (and (not (empty? left-signs))
                                             (not (empty? right-signs)))
@@ -227,7 +241,7 @@
   the entire tree costs about 20% time than truncating it."
   ([input model & {:keys [parse-with-truncate original-input]}]
    (let [parse-with-truncate
-         (cond (= parse-with-truncate false)
+         (cond true false (= parse-with-truncate false)
                false
                true true)
          original-input (if original-input original-input input)
@@ -258,6 +272,7 @@
                                    (map (fn [i] [(nth tokens i)])
                                         token-count-range))]
              (log/debug (str "input map:" input-map))
+;;             (println (str "input map:" input-map))
              (let [all-parses
                    (parses input-map token-count model
                            (span-map token-count) parse-with-truncate)


Add xboxlive format to `help --formats` output

--- src/bltool/core.clj
+++ src/bltool/core.clj
@@ -45,6 +45,7 @@
                      In read mode, gets all game info, not just basic info (slow!)
     bl-delete     W  Delete all listed games; all properties except ID are ignored.
     steam        R   Game list from Steam Community
+    xboxlive     R   Game list from Xbox Live
     html*         W  HTML file that can submit changes to Backloggery
     text         RW  User-editable plain text
     edn          RW  Machine-readable EDN


adventofcode - day 6

adventofcode - day 6

--- src/adventofcode/solutions.clj
+++ src/adventofcode/solutions.clj
@@ -101,22 +101,30 @@
               input))))

 ; day 6
-(def ^{:private true} instruction-regex #"(\w+) (?<x0>\d+),(?<y0>\d+) through (?<x1>\d+),(?<y1>\d+)")
+(def ^{:private true} day6-instruction-regex #"(\w+) (?<x0>\d+),(?<y0>\d+) through (?<x1>\d+),(?<y1>\d+)")

 (defn- get-instruction [line]
-  (let [[[_ action x0 y0 x1 y1]] (re-seq instruction-regex line)
+  (let [[[_ action x0 y0 x1 y1]] (re-seq day6-instruction-regex line)
         s2int #(Integer/parseInt %)]
     [(keyword action) (s2int x0) (s2int y0) (s2int x1) (s2int y1)]))

-(def ^{:private true} actions {:off    #(time (aset-int % %2 %3 0))
-                               :on     #(time (aset-int % %2 %3 1))
-                               :toggle #(let [val (aget ^ints % %2 %3)
-                                             new-val (if (zero? val) 1 0)]
-                                         (aset-int % %2 %3 new-val))})
+(def ^{:private true} actions-1 {:off    #(aset-int % %2 %3 0)
+                                 :on     #(aset-int % %2 %3 1)
+                                 :toggle #(let [val (aget ^ints % %2 %3)
+                                                new-val (if (zero? val) 1 0)]
+                                           (aset-int % %2 %3 new-val))})

-(defn day6 []
-  (let [input (take 5 (day-input-line-seq 6))
-        board (into-array (map int-array (repeatedly 1000 #(repeat 1000 0))))]
+(def ^{:private true} actions-2 {:off    #(let [val (aget ^ints % %2 %3)]
+                                           (when (pos? val)
+                                             (aset-int % %2 %3 (dec val))))
+                                 :on     #(let [val (aget ^ints % %2 %3)]
+                                           (aset-int % %2 %3 (inc val)))
+                                 :toggle #(let [val (aget ^ints % %2 %3)]
+                                           (aset-int % %2 %3 (+ 2 val)))})
+
+(defn- day6-stub [actions rf]
+  (let [input (day-input-line-seq 6)
+        board (make-array Integer/TYPE 1000 1000)]
     (doseq [l input]
       (let [[action x0 y0 x1 y1] (get-instruction l)
             x-rng (range x0 (inc x1))
@@ -124,5 +132,11 @@
             act (action actions)]
         (doseq [x x-rng y y-rng]
           (act board x y))))
-    (reduce #(+ % (count (filter (fn [x] (= 1 x)) %2))) 0 board)))
+    (reduce rf 0 board)))

+(defn day6 []
+  (day6-stub actions-1 #(+ % (count (filter (fn [x] (= 1 x)) %2)))))
+
+(defn day6-part2 []
+  (day6-stub actions-2 #(+ % (reduce + 0 %2))))
+


add TTL to the form and placeholders

add TTL to the form and placeholders

--- src/casper/core.clj
+++ src/casper/core.clj
@@ -19,7 +19,8 @@

 ; HTML for the create form
 (def create-html (str "<form method='post' action='/create'>"
-                    "<textarea type='text' name='secret' rows='4' cols='50'>What's your secret</textarea >"
+                    "<textarea type='text' name='secret' rows='4' cols='50' placeholder='What is your secret'></textarea >"
+                    "
<input type='text' name='ttl' placeholder='TTL (seconds)'/>
"
                     "
<input type='submit' />
"
                     "</form>"))
 ; HTTP response codes


Renamed to max-inflight.

Renamed to max-inflight.

--- src/cbfg/fence.cljs
+++ src/cbfg/fence.cljs
@@ -37,13 +37,13 @@
 ;; request format
 ;; {:rq function-to-call :fence true-or-false}

-(defn make-fenced-pump [actx in-ch out-ch max-inflight-chs]
+(defn make-fenced-pump [actx in-ch out-ch max-inflight]
   (ago-loop fenced-pump actx
    [inflight-chs #{}              ; chans of requests currently being processed.
     fenced-ch nil                 ; chan of last, inflight "fenced" request.
     fenced-ch-res nil]            ; last received result from last fenced request.
    (let [i (vec (if (or fenced-ch ; if we're fenced or too many inflight requests,
-                        (>= (count inflight-chs) max-inflight-chs))
+                        (>= (count inflight-chs) max-inflight))
                   inflight-chs    ; then ignore in-ch & finish existing inflight requests.
                   (conj inflight-chs in-ch)))
          [v ch] (if (empty? i)    ; empty when in-ch is closed and no inflight-chs.
@@ -123,13 +123,13 @@
                        "pass"
                        "FAIL")
                      %)
-              [["test with 2 max-inflight-chs"
+              [["test with 2 max-inflight"
                 (let [test-helper-out (test-helper test 100 1 2 reqs)
                       res (atake test test-helper-out)]
                   (atake test test-helper-out)
                   res)
                 '(6 3 12 40 41 42 43 44 11 11 6 7 8 0 1 9 32)]
-               ["test with 200 max-inflight-chs"
+               ["test with 200 max-inflight"
                 (let [test-helper-out (test-helper test 100 1 200 reqs)
                       res (atake test test-helper-out)]
                   (atake test test-helper-out)


check for nil cells when checking win-state

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -86,7 +86,7 @@
           pct   (/ 100 size)
           [x y] (get-cell-xy i size)]
       #js {
-        :height    (str (* size 100) "%")
+        :height    (str (* size 100) \%)
         :transform (t3d
           (- (+ (/ (* x pct) (:vid-ratio app)) (:vid-offset app)))
           (- (* pct y)))})))
@@ -237,8 +237,8 @@
       (.render gif))))

-(defn modal [{:keys [stream media-error? show-about? cells win-state grid-size] :as app}]
-  (let [winner?    (= cells win-state)
+(defn modal [{:keys [stream media-error show-about? result-gif cells win-state grid-size] :as app}]
+  (let [winner?    (and cells (= cells win-state))
         no-stream? (not stream)]
     (dom/div #js {
       :className (str "modal" (when (or no-stream? media-error? show-about? winner?) " active"))}


Apply->reduce to work properly with repos with one branch only

--- src/arachnida/commits_stat.clj
+++ src/arachnida/commits_stat.clj
@@ -61,7 +61,7 @@
 (defn get-commits-stat-for-all-branches
     [repo directory-name]
     (let [branches (get-local-branches repo)]
-        (apply conj
+        (reduce conj
             (for [branch branches]
                  (get-commits-stat-for-branch directory-name branch)))))