guard against bad group-id in routes

guard against bad group-id in routes

--- src/braid/client/events.cljs
+++ src/braid/client/events.cljs
@@ -571,7 +571,9 @@
 (reg-event-db
   :set-group-and-page
   (fn [state [_ [group-id page-id]]]
-    (helpers/set-group-and-page state group-id page-id)))
+    (if (some? (get-in state [:groups group-id]))
+      (helpers/set-group-and-page state group-id page-id)
+      (helpers/set-group-and-page state nil {:type :index}))))

 (reg-event-db
   :set-page-loading


tidy up

tidy up

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -85,8 +85,9 @@
          (logged-sh "jack_connect" src dest)
          (log/info "jack_connect " src " " dest)))))

-(if (= :linux (config-get :os))
-  (on-deps :server-connected ::connect-jack-ports
+(when (= :linux (config-get :os))
+  (on-deps :server-connected
+           ::connect-jack-ports
            #(when (transient-server?)
               (connect-jack-ports))))


Store the build's actions, so we can display them to the user.

--- src/circle/backend/build.clj
+++ src/circle/backend/build.clj
@@ -56,7 +56,7 @@

 (def build-dissoc-keys
   ;; Keys on build that shouldn't go into mongo, for whatever reason
-  [:actions :action-results])
+  [:action-results])

 (defn insert! [b]
   (let [return (mongo/insert! build-coll (apply dissoc @b build-dissoc-keys))]


fix sorting, typo

fix sorting, typo

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -371,12 +371,12 @@
                  :checked (= selected-filter :failed)
                  :on-change #(raise! owner [:insights-filter-changed {:new-filter :failed}])}]
         [:label {:for "insights-filter-failed"}
-         (gstring/format"failed (%s)" (count (:failed categories)))]]
+         (gstring/format"Failed (%s)" (count (:failed categories)))]]
        [:span.sorting
         [:label "Sort: "]
         [:select {:class "toggle-sorting"
                   :on-change #(raise! owner [:insights-sorting-changed {:new-sorting (keyword (.. % -target -value))}])
-                  :value (str selected-sorting)}
+                  :value (name selected-sorting)}
          [:option {:value "alphabetical"} "Alphabetical"]
          [:option {:value "recency"} "Recent"]]]]
       [:div.blocks-container


Page through all checkins for current day

Previously only the first page was being used and the date was not being
checked, so the last 20 results were always being displayed. Now results
are only displayed for the current day and the next page of results will
be called if the last item on the current page is the current date.

--- src/clj/kids_checkin/api.clj
+++ src/clj/kids_checkin/api.clj
@@ -43,10 +43,24 @@
          "Accept" "application/vnd.thecity.admin.v1+json"
          }))

-(defn retrieve-checkins []
-  (let [url (str "https://api.onthecity.org/checkins")
-        headers (create-headers url)]
-    (client/get url {:headers headers})))
+(defn retrieve-checkins-page [page-number]
+  (let [url (str "https://api.onthecity.org/checkins?page=" page-number)
+         headers (create-headers url)]
+     (client/get url {:headers headers})))
+
+(defn get-starting-date [checkin]
+  (apply str (take 10 (get-in checkin [:event :starting_at]))))
+
+(defn retrieve-checkins
+  ([] (retrieve-checkins 1 []))
+  ([page-number checkins]
+   (let [today (.toString (time/today) "MM/dd/yyyy")
+         body (:body (retrieve-checkins-page page-number))
+         page-checkins (:checkins (json/read-str body :key-fn keyword))
+         last-checkin-date (get-starting-date (last page-checkins))]
+     (if (= today last-checkin-date)
+       (retrieve-checkins (inc page-number) (into checkins page-checkins))
+       (into checkins (filter #(= today (get-starting-date %)) page-checkins))))))

 (defn count-checkins [id checkins]
   (count (filter #(= id (get-in % [:group :id])) checkins)))
@@ -62,8 +76,7 @@
 (defn create-checkin-map [env]
   (if (false? (:dev env))
     (test-checkins)
-    (let [body (:body (retrieve-checkins))
-          checkins (:checkins (json/read-str body :key-fn keyword))]
+    (let [checkins (retrieve-checkins)]
       [{:id 108117 :max 12 :color "red" :count (count-checkins 108117 checkins) :name "Nursery"}
        {:id 108119 :max 12 :color "orange" :count (count-checkins 108119 checkins) :name "Toddlers"}
        {:id 108120 :max 12 :color "yellow" :count (count-checkins 108120 checkins) :name "Preschool #1"}


fix data export

fix data export

--- src/clj/salava/user/data.clj
+++ src/clj/salava/user/data.clj
@@ -203,10 +203,10 @@
                                                                                (when-not (blank? (:status b))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :user/Status ul) ": ")][:chunk  (str (:status b) "  ")]])
-                                                                                (when-not (blank? (:verified_by_obf b))
+                                                                                (when-not (blank? (str (:verified_by_obf b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Verifiedbyobf ul) ": ")][:chunk (str (:verified_by_obf b) "  ")]])
-                                                                                (when-not (blank? (:issued_by_obf b))
+                                                                                (when-not (blank? (str (:issued_by_obf b)))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Issuedbyobf ul) ": ")][:chunk (str (:issued_by_obf b))]"\n"])
                                                                                (when (not-empty (:tags b))


Message update.

Message update.

--- src/cljs/clj_forms/core.cljs
+++ src/cljs/clj_forms/core.cljs
@@ -27,7 +27,7 @@

 (defn weight-form
   [weight-atom]
-  (input-and-prompt "Weight(lbs):" "weight" "number" weight-atom [prompt-message "What's your weight?"]))
+  (input-and-prompt "Weight(lbs):" "weight" "number" weight-atom [prompt-message "Enter your weight?"]))

 (defn home-page []
   (let [weight (atom nil)]


Extract the ajax into its own function.

Extract the ajax into its own function.

--- src/cljs_bach/synthesis.cljs
+++ src/cljs_bach/synthesis.cljs
@@ -259,15 +259,18 @@
   [effect level]
   (add pass-through (connect-> effect (gain level))))

+(defn get-mp3 [uri callback]
+  (ajax/GET uri {:response-format {:type :arraybuffer
+                                   :read protocol/-body
+                                   :description "audio"
+                                   :content-type "audio/mpeg"}
+                 :handler callback }))
+
 (defn raw-sample
   "Play a sample addressed via a URI. Until fetching and decoding is complete, it will play silence."
   [uri]
   (let [psuedo-promise (js-obj)] ; A mutable object to close over and share between calls.
-    (ajax/GET uri {:response-format {:type :arraybuffer
-                                     :read protocol/-body
-                                     :description "audio"
-                                     :content-type "audio/mpeg"}
-                   :handler #(set! (.-data psuedo-promise) %)}) ; Deliver the data by updating the mutable object.
+    (get-mp3 uri #(set! (.-data psuedo-promise) %)) ; Deliver the data by updating the mutable object.
     (fn [context at duration]
       (source
         (let [node (.createGain context)


Improve validate-enough-peers! error message

--- src/onyx/test_helper.clj
+++ src/onyx/test_helper.clj
@@ -48,7 +48,10 @@
   [test-env job]
   (let [required-peers (n-peers job)]
     (when (< (:n-peers test-env) required-peers)
-      (throw (ex-info (format "test-env requires at least %s peers to start the job" required-peers)
+      (throw (ex-info (format "test-env requires at least %s peers to start the job.
+                               validate-enough-peers! checks your job to see whether you've started enough peers before submitting a job to the test cluster that might hang.
+                               Tasks each require at least one peer to be started, and may require more if :onyx/n-peers or :onyx/min-peers is set."
+                              required-peers)
                       {:job job
                        :n-peers (:n-peers test-env)
                        :required-n-peers required-peers})))))


Added buffers/view-category-buffers function, set title and x/y labels for generated incanter x/y plot view

--- src/overtime/buffers.clj
+++ src/overtime/buffers.clj
@@ -42,8 +42,13 @@
         buf-vals (into '() (ot/buffer-read buf))]
     (-> (ot/num-frames buf)
         range
-        (incanter.charts/xy-plot buf-vals)
+        (incanter.charts/xy-plot buf-vals :title (str (name category) " buffer: " (name key)) :x-label "range" :y-label "buffer vals")
         incanter.core/view)))
+
+(defn view-category-buffers
+  "View buffer as X/Y plot using Incanter view"
+  [category]
+  (doseq [key (buffer-keys category)] (view-buffer category key)))

 (defn- init-buffers
   [category buffers-map]


rename route to dispatch

rename route to dispatch

--- src/ow/starbuck/core.clj
+++ src/ow/starbuck/core.clj
@@ -20,7 +20,7 @@
             [taoensso.timbre :refer [trace debug info warn error fatal]]))

 (defprotocol MessageRouting
-  (route [this req]))
+  (dispatch [this req]))

 (defn safe-process [this f req & args]
   (try
@@ -43,7 +43,7 @@

        MessageRouting

-       (route [this# req#]
+       (dispatch [this# req#]
          (debug "routing message...")
          (put! ~'ch-out req#))

@@ -62,8 +62,8 @@
                          (debug "sending response(s)")
                          (cond
                            (nil? res#)        nil
-                           (sequential? res#) (dorun (map #(route ~this1 %) res#))
-                           true               (route ~this1 res#)))))
+                           (sequential? res#) (dorun (map #(dispatch ~this1 %) res#))
+                           true               (dispatch ~this1 res#)))))
                  (recur (<! ~'ch-in)))
              (info "stopped.")))
          (let [~this1 ~(if startfn


custom prefix and all-agenda-data

custom prefix and all-agenda-data

--- org-mode/src/com/gfredericks/org_agenda.clj
+++ org-mode/src/com/gfredericks/org_agenda.clj
@@ -464,13 +464,17 @@
   [deets-by-file {:keys [preamble] :as cfg} now]
   (let [today (.toLocalDate now)
         {:keys [triage deadlines by-day past-log]} (synthesize-agenda deets-by-file today)
+        custom-prefix (:custom-prefix cfg (constantly nil))
         format-todo (fn [{:keys [done todo priority-cookie header] :as item}]
-                      (format "%s%s %s%s"
+                      (format "%s%s %s%s%s"
                               (cond-> (or done todo)
                                 (= "[#C]" priority-cookie)
                                 (->> .toLowerCase (format "(%s)")))
                               (if priority-cookie
                                 (str " " priority-cookie)
+                                "")
+                              (if-let [prefix (custom-prefix today item)]
+                                (str prefix " ")
                                 "")
                               (if (:repeat? item)
                                 "[rep] "
@@ -607,10 +611,14 @@
         (doseq [item past-log]
           (print-todo-line item {:omit-effort? true}))))))

+(defn all-agenda-data
+  [directory now]
+  (into {} (for [file (all-org-files directory)]
+             [file (agenda-data-for-file file (.toLocalDate now))])))
+
 (defn do-once
   [{:keys [directory] :as cfg} now]
-  (let [by-file (into {} (for [file (all-org-files directory)]
-                           [file (agenda-data-for-file file (.toLocalDate now))]))]
+  (let [by-file (all-agenda-data directory now)]
     (write-to-agenda-file by-file cfg now)))

 (defn watch


pushed the wrong commit, recorrected it for the build to pass

--- storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -291,7 +291,7 @@
     (if (nil? (get-log-user-group-whitelist fname))
       (-> (resp/response "Page not found")
         (resp/status 404))
-      (unauthorized-user-html user)))
+      (unauthorized-user-html user))))

 (defn download-log-file [fname req resp user ^String root-dir]
   (let [file (.getCanonicalFile (File. root-dir fname))]


Temp remove malformed check on snapshot POST.

--- src/open_company/api/stakeholder_updates.clj
+++ src/open_company/api/stakeholder_updates.clj
@@ -91,7 +91,7 @@
   :available-media-types (by-method {:get [su-rep/collection-media-type]
                                      :post nil})
   :allowed-methods [:options :get :post]
-  :malformed? (fn [ctx] (common/malformed-json? ctx true)) ; true to allow JSON or nothing
+  :malformed? false ; TODO why not working on server? (fn [ctx] (common/malformed-json? ctx true)) ; true to allow JSON or nothing
   :exists? (fn [_] (list-stakeholder-updates conn company-slug))
   :processable? true


Use the options 'sort' everywhere

Use the options 'sort' everywhere

--- src/cyanite_remover/core.clj
+++ src/cyanite_remover/core.clj
@@ -44,21 +44,25 @@
   []
   (swap! inspecting? (fn [_] true)))

+(defn- get-sort-or-not-fn
+  [sort?]
+  (if sort? sort #(do %)))
+
 (defn- lookup-paths
   "Lookup paths."
-  [pstore tenant leafs-only limit-depth paths exclude-paths sort-paths
+  [pstore tenant leafs-only limit-depth paths exclude-paths sort-paths?
    & [sidefx-fn]]
   (let [lookup-fn #(pstore/lookup pstore tenant leafs-only limit-depth %
                                   exclude-paths)
         sidefx-wrapper (if sidefx-fn #(do (sidefx-fn %) %) #(do %))
-        sort (if sort-paths sort #(do %))]
+        sort (get-sort-or-not-fn sort-paths?)]
     (sort (map :path (map sidefx-wrapper (flatten (map lookup-fn paths)))))))

 (defn- get-paths
   "Get paths."
-  [pstore tenant paths-to-lookup exclude-paths sort-paths & [sidefx-fn]]
+  [pstore tenant paths-to-lookup exclude-paths sort-paths? & [sidefx-fn]]
   (let [paths (lookup-paths pstore tenant false false paths-to-lookup
-                            exclude-paths sort-paths sidefx-fn)
+                            exclude-paths sort-paths? sidefx-fn)
         title "Getting paths"]
     (newline)
     (clog/info (str title "..."))
@@ -381,7 +385,7 @@
         from (timec/to-epoch (time/minus (time/now) (time/seconds threshold)))
         title "Checking metrics"
         paths-rollups (combine-paths-rollups paths [(first rollups)])
-        sort (if (:sort options) sort #(do %))]
+        sort (get-sort-or-not-fn (:sort options))]
     (prog/set-progress-bar!
      "[:bar] :percent :done/:total Elapsed :elapseds ETA :etas")
     (prog/config-progress-bar! :width pbar-width)
@@ -470,14 +474,16 @@
       (dry-mode-warn options)
       (let [tpool (get-thread-pool options)
             pstore (pstore/elasticsearch-path-store es-url options)
+            sort (get-sort-or-not-fn (:sort options))
             processed-data (process-metrics tenant rollups paths cass-hosts
                                             pstore options
                                             remove-obsolete-metrics-processor
                                             tpool)
             obsolete-paths (->> processed-data
                                 (get-paths-from-paths-rollups)
+                                (filter #(:leaf (get @paths-info %)))
                                 (distinct)
-                                (filter #(:leaf (get @paths-info %))))]
+                                (sort))]
         (process-paths tenant obsolete-paths pstore options
                        remove-obsolete-paths-processor)))
     (catch Exception e
@@ -492,13 +498,15 @@
     (let [tpool (get-thread-pool options)
           mstore (mstore/cassandra-metric-store cass-hosts options)
           pstore (pstore/elasticsearch-path-store es-url options)
+          sort (get-sort-or-not-fn (:sort options))
           obsolete-data (->> (get-paths pstore tenant paths
                                         (:exclude-paths options)
                                         (:sort options))
                              (filter-obsolete-metrics mstore tpool tenant
                                                       rollups options)
                              (get-paths-from-paths-rollups)
-                             (distinct))]
+                             (distinct)
+                             (sort))]
       (newline)
       (dorun (map println obsolete-data)))
     (catch Exception e


Simplify static home page

Simplify static home page

--- src/clj/flux_challenge_reagent/handler.clj
+++ src/clj/flux_challenge_reagent/handler.clj
@@ -17,11 +17,7 @@
              :content "width=device-width, initial-scale=1"}]
      (include-css (if (env :dev) "css/styles.css" "css/styles.min.css"))]
     [:body
-     [:div#app
-      [:h3 "ClojureScript has not been compiled!"]
-      [:p "please run "
-       [:b "lein figwheel"]
-       " in order to start the compiler"]]
+     [:div#app]
      (include-js "js/app.js")]]))

 (defroutes routes


rollback allowed flag #111

rollback allowed flag
#111

--- src/clj/swarmpit/docker/mapper/inbound.clj
+++ src/clj/swarmpit/docker/mapper/inbound.clj
@@ -279,12 +279,13 @@
       :labels (->service-labels service-labels)
       :logdriver {:name (or (get-in service-task-template [:LogDriver :Name]) "none")
                   :opts (->service-log-options service-task-template)}
-      :deployment {:update        (->service-deployment-update service-spec)
-                   :forceUpdate   (:ForceUpdate service-task-template)
-                   :restartPolicy (->service-deployment-restart-policy service-task-template)
-                   :rollback      (->service-deployment-rollback service-spec)
-                   :autoredeploy  (->service-autoredeploy service-labels)
-                   :placement     (->service-placement-constraints service-spec)})))
+      :deployment {:update          (->service-deployment-update service-spec)
+                   :forceUpdate     (:ForceUpdate service-task-template)
+                   :restartPolicy   (->service-deployment-restart-policy service-task-template)
+                   :rollback        (->service-deployment-rollback service-spec)
+                   :rollbackAllowed (some? (:PreviousSpec service))
+                   :autoredeploy    (->service-autoredeploy service-labels)
+                   :placement       (->service-placement-constraints service-spec)})))

 (defn ->services
   [services tasks nodes-count]


inbound -> pass concrete spec

inbound -> pass concrete spec

--- src/clj/swarmpit/docker/mapper/inbound.clj
+++ src/clj/swarmpit/docker/mapper/inbound.clj
@@ -65,8 +65,8 @@
        (into [])))

 (defn ->service-ports
-  [service]
-  (->> (get-in service [:Spec :EndpointSpec :Ports])
+  [service-spec]
+  (->> (get-in service-spec [:EndpointSpec :Ports])
        (map (fn [p] {:containerPort (:TargetPort p)
                      :protocol      (:Protocol p)
                      :hostPort      (:PublishedPort p)}))
@@ -78,16 +78,16 @@
                      (:Target network)) networks)))

 (defn ->service-networks
-  [service networks]
-  (->> (get-in service [:Spec :TaskTemplate :Networks])
+  [service-spec networks]
+  (->> (get-in service-spec [:TaskTemplate :Networks])
        (map (fn [n] (->service-network n networks)))
-       (map (fn [n] {:networkName   (:Name n)
-                     :driver (:Driver n)}))
+       (map (fn [n] {:networkName (:Name n)
+                     :driver      (:Driver n)}))
        (into [])))

 (defn ->service-mounts
-  [service]
-  (->> (get-in service [:Spec :TaskTemplate :ContainerSpec :Mounts])
+  [service-spec]
+  (->> (get-in service-spec [:TaskTemplate :ContainerSpec :Mounts])
        (map (fn [v] {:containerPath (:Target v)
                      :hostPath      (:Source v)
                      :type          (:Type v)
@@ -95,8 +95,8 @@
        (into [])))

 (defn ->service-variables
-  [service]
-  (->> (get-in service [:Spec :TaskTemplate :ContainerSpec :Env])
+  [service-spec]
+  (->> (get-in service-spec [:TaskTemplate :ContainerSpec :Env])
        (map (fn [p]
               (let [variable (str/split p #"=")]
                 {:name  (first variable)
@@ -104,14 +104,14 @@
        (into [])))

 (defn ->service-secrets
-  [service]
-  (->> (get-in service [:Spec :TaskTemplate :ContainerSpec :Secrets])
+  [service-spec]
+  (->> (get-in service-spec [:TaskTemplate :ContainerSpec :Secrets])
        (map (fn [s] {:secretName (:SecretName s)}))
        (into [])))

 (defn ->service-deployment
-  [service]
-  (let [update-config (get-in service [:Spec :UpdateConfig])]
+  [service-spec]
+  (let [update-config (:UpdateConfig service-spec)]
     {:parallelism   (or (:Parallelism update-config) 1)
      :delay         (or (:Delay update-config) 0)
      :failureAction (or (:FailureAction update-config) "pause")}))
@@ -145,13 +145,14 @@

 (defn ->service
   [service tasks nodes networks]
-  (let [service-mode (str/lower-case (name (first (keys (get-in service [:Spec :Mode])))))
-        service-name (get-in service [:Spec :Name])
-        service-id (get service :ID)
+  (let [service-spec (:Spec service)
+        service-mode (str/lower-case (name (first (keys (:Mode service-spec)))))
+        service-name (:Name service-spec)
+        service-id (:ID service)
         service-tasks (filter #(= (:ServiceID %) service-id) tasks)
-        replicas (get-in service [:Spec :Mode :Replicated :Replicas])
+        replicas (get-in service-spec [:Mode :Replicated :Replicas])
         replicas-running (->service-replicas-running service-tasks)
-        image (get-in service [:Spec :TaskTemplate :ContainerSpec :Image])
+        image (get-in service-spec [:TaskTemplate :ContainerSpec :Image])
         image-info (str/split image #"@")
         image-name (first image-info)
         image-digest (second image-info)
@@ -159,8 +160,8 @@
     (array-map
       :id service-id
       :version (get-in service [:Version :Index])
-      :createdAt (date (get service :CreatedAt))
-      :updatedAt (date (get service :UpdatedAt))
+      :createdAt (date (:CreatedAt service))
+      :updatedAt (date (:UpdatedAt service))
       :repository {:image       image-name
                    :imageDigest image-digest
                    :name        (first image-segments)
@@ -171,12 +172,12 @@
       :state (->service-state replicas replicas-running service-mode)
       :status {:info   (->service-info-status replicas replicas-running service-mode)
                :update (->service-update-status service)}
-      :ports (->service-ports service)
-      :networks (->service-networks service networks)
-      :mounts (->service-mounts service)
-      :secrets (->service-secrets service)
-      :variables (->service-variables service)
-      :deployment (->service-deployment service)
+      :ports (->service-ports service-spec)
+      :networks (->service-networks service-spec networks)
+      :mounts (->service-mounts service-spec)
+      :secrets (->service-secrets service-spec)
+      :variables (->service-variables service-spec)
+      :deployment (->service-deployment service-spec)
       :tasks (->tasks service-tasks nodes service-name service-mode))))

 (defn ->services


Second round of symbol reorganization.

Second round of symbol reorganization.

--- src/cljs/cljs_repl_web/cljs_api/utils.cljs
+++ src/cljs/cljs_repl_web/cljs_api/utils.cljs
@@ -21,7 +21,6 @@

                          (Topic. "functions as data"
                                  '(apply partial comp complement juxt))])
-
               (Section. "Datatypes" ""
                         [(Topic. "maps " '({:key1 val1 :key2 val2}))
                          (Topic. "vectors" '([1 2 3] [:a :b :c]))
@@ -39,14 +38,15 @@
                                  '("#(<ACTION> |% %2 %3 OR %&|)"))])
               (Section. "Sequences" ""
                         [(Topic. "creation"
-                                 '(vector vec hash-map set for list list* sorted-map
-                                          repeat range cycle))
+                                 '(vec hash-map set for list list* sorted-map
+                                       repeat range cycle seq rseq))
                          (Topic. "inspection"
                                  '(first last rest next get get-in count keys
-                                         vals nth contains? find take ))
+                                         vals nth contains? find))
                          (Topic. "manipulation"
-                                 '(seq into conj cons assoc flatten merge assoc-in
-                                       dissoc zipmap partition update-in reverse))])
+                                 '(into conj cons assoc flatten merge assoc-in
+                                        dissoc zipmap partition update-in reverse
+                                        take drop distinct))])
               (Section. "Useful Macros" ""
                         [(Topic. "conditionals"
                                  '(if if-not if-let cond condp and or not when when-let


Addressed review comments.

Addressed review comments.

--- src/cmr/search/services/health_service.clj
+++ src/cmr/search/services/health_service.clj
@@ -12,9 +12,7 @@
         index-set-health (index-set/get-index-set-health context)
         metadata-db-context (assoc context :system (get-in context [:system :metadata-db]))
         metadata-db-health (meta-db/health metadata-db-context)
-        ok? (and (:ok? echo-rest-health)
-                 (:ok? metadata-db-health)
-                 (:ok? index-set-health))]
+        ok? (every? :ok? [echo-rest-health metadata-db-health index-set-health])]
     {:ok? ok?
      :dependencies {:echo echo-rest-health
                     :metadata-db metadata-db-health


Updated code based on changes in metadata db.

--- src/cmr/search/services/health_service.clj
+++ src/cmr/search/services/health_service.clj
@@ -2,7 +2,7 @@
   "Contains fuctions to provider health status of the search app."
   (:require [cmr.system-trace.core :refer [deftracefn]]
             [cmr.transmit.echo.rest :as rest]
-            [cmr.metadata-db.services.provider-service :as meta-db]
+            [cmr.metadata-db.services.health-service :as meta-db]
             [cmr.transmit.index-set :as index-set]))

 (deftracefn health


prioritize circle.yml tab when errors found

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -538,21 +538,22 @@
   "The default tab to show in the build page head, if they have't clicked a different tab."
   [build scopes]
   (cond
-   ;; default to ssh-info for SSH builds
-   (build-model/ssh-enabled-now? build) :ssh-info
-   ;; default to the queue tab if the build is currently usage queued, and
-   ;; the user is has the right permissions (and is logged in).
-   (and (:read-settings scopes)
-        (build-model/in-usage-queue? build))
-   :usage-queue
-   ;; If there's no SSH info, build isn't finished, show the config or commits.
+    ;; show circle.yml errors first
+    (build-model/config-errors? build) :config
+    ;; default to ssh-info for SSH builds
+    (build-model/ssh-enabled-now? build) :ssh-info
+    ;; default to the queue tab if the build is currently usage queued, and
+    ;; the user is has the right permissions (and is logged in).
+    (and (:read-settings scopes)
+         (build-model/in-usage-queue? build))
+    :usage-queue
+    ;; If there's no SSH info, build isn't finished, show the config or commits.
     ;; "config" takes up too much room for paid customers.
-   (build-model/running? build) (if (:read-settings scopes)
-                                    :usage-queue
-                                    :config)
-   (build-model/config-errors? build) :config
-   ;; Otherwise, just use the first one.
-   :else :tests))
+    (build-model/running? build) (if (:read-settings scopes)
+                                   :usage-queue
+                                   :config)
+    ;; Otherwise, just use the first one.
+    :else :tests))

 (defn link-to-user [build]
   (when-let [user (:user build)]


Require everything

Require everything

--- src-cljs/frontend/components/enterprise.cljs
+++ src-cljs/frontend/components/enterprise.cljs
@@ -76,6 +76,7 @@
           (control :input.input-lg
                    {:type "text"
                     :name "phone"
+                    :required true
                     :disabled (= :loading form-state)
                     :placeholder "Phone"})]]
         [:div.row
@@ -90,6 +91,7 @@
           (control :input.input-lg
                    {:type "text"
                     :name "developer-count"
+                    :required true
                     :disabled (= :loading form-state)
                     :placeholder "# of Developers"})]]
         [:div.row
@@ -97,7 +99,7 @@
           (control :input.input-lg
                    {:type "email"
                     :name "email"
-                    :require true
+                    :required true
                     :disabled (= :loading form-state)
                     :placeholder "Email"})]
          [:div.col-sm-6


Hide team page projects followed if user not admin

--- src-cljs/frontend/components/pages/team.cljs
+++ src-cljs/frontend/components/pages/team.cljs
@@ -19,16 +19,28 @@
             [om.core :as om :include-macros true])
   (:require-macros [frontend.utils :refer [component element html]]))

-(defn- table [users]
-  (om/build table/table
-            {:rows users
-             :key-fn :login
-             :columns [{:header "Login"
-                        :cell-fn :login}
-
-                       {:header "Projects Followed"
-                        :type #{:right :shrink}
-                        :cell-fn ::follow-count}]}))
+(defn- add-follow-counts [users projects]
+  (for [user users
+        :let [followings
+              (group-by :follower
+                        (for [project projects
+                              follower (:followers project)]
+                          {:follower follower
+                           :project project}))]]
+    (assoc user ::follow-count (count (get followings user)))))
+
+(defn- table [{:keys [users projects admin] :as selected-org}]
+  (let [rows (cond-> users
+               admin (add-follow-counts projects))
+        columns (cond-> [{:header "Login"
+                          :cell-fn :login}]
+                  admin (conj {:header "Projects Followed"
+                               :type #{:right :shrink}
+                               :cell-fn ::follow-count}))]
+    (om/build table/table
+              {:rows rows
+               :key-fn :login
+               :columns columns})))

 (defn- no-org-selected [available-orgs bitbucket-enabled?]
   (component
@@ -56,16 +68,6 @@
   ;; simple unique id available on the frontend for Om Next.
   [:organization/by-vcs-type-and-name
    [(:vcs_type org) (:login org)]])
-
-(defn- add-follow-counts [users projects]
-  (for [user users
-        :let [followings
-              (group-by :follower
-                        (for [project projects
-                              follower (:followers project)]
-                          {:follower follower
-                           :project project}))]]
-    (assoc user ::follow-count (count (get followings user)))))

 ;; functions for invite-teammates-modal component state manipulation

@@ -291,8 +293,8 @@
                          (om/build invite-teammates-modal {:selected-org (select-keys selected-org [:name :vcs_type :vcs-users])
                                                            :close-fn #(om/set-state! owner :show-invite-modal? false)
                                                            :show-modal? show-invite-modal?})]}
-               (if-let [users (:users selected-org)]
-                 (table (add-follow-counts users (:projects selected-org)))
+               (if (:users selected-org)
+                 (table (select-keys selected-org [:users :projects :admin]))
                  (html [:div.loading-spinner common/spinner])))
               (no-org-selected available-orgs (vcs-utils/bitbucket-enabled? user)))]])))))


added HTML generator functions for em and strong

--- src/distillery/view/html.clj
+++ src/distillery/view/html.clj
@@ -76,6 +76,16 @@
   "Wrappes the given text into a code and pre element."
   [text]
   {:tag :code :content [{:tag :pre :content text}]})
+
+(defn emph
+  "Wrappes the content into an emphasizing element."
+  [content]
+  {:tag :em :content (safe-content content)})
+
+(defn strong
+  "Wrappes the content int a strong emphasizing element."
+  [content]
+  {:tag :strong :content (safe-content content)})

 (defn div
   "Creates a div container with a given CSS class and some content."


Fixed possible IE bug where it doesn't recognise console

--- src/webapp/framework/client/coreclient.cljs
+++ src/webapp/framework/client/coreclient.cljs
@@ -68,7 +68,9 @@

 (defn log [s]
-  (.log js/console (str s)))
+  ;(.log js/console (str s))
+  nil
+)

 (defn send-request2 [ address ]


more ui components

more ui components

--- src_cljs/cljat_webapp/cljat_webapp/app.cljs
+++ src_cljs/cljat_webapp/cljat_webapp/app.cljs
@@ -81,6 +81,9 @@
                                                 :icon "glyphicon-comment"}}}))

+(def sidebar-tab-stats (r/atom {:active :chat
+                                :friends {}
+                                :chat {}}))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Messages
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -231,12 +234,48 @@
     [:div {:id "header-container"}
      [:nav {:class "navbar navbar-default"}]]))

-
-(defn sidebar-friends-pane []
+(defn sidebar-friends-pane [tab-stats]
+  (fn []
+    [:div {:id "sidebar-pane" :class "pane"}
+      [:div {:id "sidebar-header" :class "header"}
+        [:div {:class "title"} "Friends Header"]]
+      [:div {:class "title"} "Friends Panel"]])
   )

-(defn sidebar-chat-pane []
+(defn sidebar-threads-pane [tab-stats]
+  (fn []
+    [:div {:id "sidebar-pane" :class "pane"}
+      [:div {:id "sidebar-header" :class "header"}
+        [:div {:class "title"} "Threads Header"]]
+      [:div {:class "title"} "Threads Panel"]])
   )
+
+(defn sidebar-pane [tab-stats]
+  (fn [tab-stats]
+    (if (= (:active tab-stats) :friends)
+      [sidebar-friends-pane (:friends tab-stats)]
+      [sidebar-threads-pane (:chat tab-stats)])))
+
+(defn sidebar-tabs [tabs-stats]
+  (fn [tab-stats]
+    [:div {:id "sidebar-tabs" :class "tabs"}
+      [:div {:class "title"} "Tabs"]]))
+
+(defn sidebar [tab-stats]
+  (fn []
+    [:div {:id "sidebar"}
+     [sidebar-pane tab-stats]
+     [sidebar-tabs tab-stats]]))
+
+(defn chat []
+  (fn []
+    [:div {:id "chat"}
+      [:div {:id "chat-pane" :class "pane"}
+       [:div {:class "title"} "Chat Panel"]
+       [:div {:id "chat-header" :class "header"}
+        [:div {:class "title"} "Chat Header"]]]
+      [:div {:id "chat-input" :class "input-box"}
+       [:div {:class "title"} "Chat Input"]]]))

 (defn app []
   #_(fn []
@@ -255,18 +294,8 @@
        ]]])
   (fn []
     [:div {:id "window"}
-     [:div {:id "sidebar"}
-      [:div {:id "sidebar-pane" :class "pane"}
-       [:div {:id "sidebar-header" :class "header"}
-        [:div {:class "title"} "Friends"]]]
-      [:div {:id "sidebar-tabs" :class "tabs"}
-       [:div {:class "title"} "Tabs"]]]
-     [:div {:id "chat"}
-      [:div {:id "chat-pane" :class "pane"}
-       [:div {:id "chat-header" :class "header"}
-        [:div {:class "title"} "Messages"]]]
-      [:div {:id "chat-input" :class "input-box"}
-       [:div {:class "title"} "Chat Input"]]]]))
+     [sidebar @sidebar-tab-stats]
+     [chat]]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


CLJC: fix subs handlers to supply correct arity

--- src/re_frame/subs.cljc
+++ src/re_frame/subs.cljc
@@ -154,22 +154,37 @@
       sub-fn                   ;; first case the user provides a custom sub-fn
       (register
         sub-name
-        (fn [db q-vec d-vec]
-          (let [subscriptions (sub-fn q-vec d-vec)]    ;; this let needs to be outside the fn
-            (make-reaction
-              (fn [] (f (multi-deref subscriptions) q-vec d-vec))))))
+        (fn subs-handler-fn    ;; multi-arity to match the arities `subscribe` might invoke.
+          ([db q-vec]
+           (let [subscriptions (sub-fn q-vec)]
+             (make-reaction
+              (fn [] (f (multi-deref subscriptions) q-vec)))))
+          ([db q-vec d-vec]
+           (let [subscriptions (sub-fn q-vec d-vec)]
+             (make-reaction
+              (fn [] (f (multi-deref subscriptions) q-vec d-vec)))))))
       (seq arrow-args)              ;; the user uses the :<- sugar
       (register
         sub-name
-        (fn [db q-vec d-vec]
-          (let [subscriptions    (map subscribe arrow-subs)
-                subscriptions    (if (< 1 (count subscriptions))
-                                   subscriptions
-                                   (first subscriptions))]    ;; automatically provide a singlton
-            (make-reaction
-              (fn [] (f (multi-deref subscriptions) q-vec d-vec))))))
+        (letfn [(get-subscriptions []
+                  (let [subscriptions (map subscribe arrow-subs)]
+                    (if (< 1 (count subscriptions))
+                      subscriptions
+                      (first subscriptions))))] ;; automatically provide a singleton
+         (fn subs-handler-fn
+           ([db q-vec]
+            (let [subscriptions (get-subscriptions)]
+              (make-reaction
+               (fn [] (f (multi-deref subscriptions) q-vec)))))
+           ([db q-vec d-vec]
+            (let [subscriptions (get-subscriptions)]
+              (make-reaction
+               (fn [] (f (multi-deref subscriptions) q-vec d-vec))))))))
       :else
       (register ;; the simple case with no subs
         sub-name
-        (fn [db q-vec d-vec]
-          (make-reaction (fn [] (f @db q-vec d-vec)))))))())
+        (fn subs-handler-fn
+          ([db q-vec]
+           (make-reaction (fn [] (f @db q-vec))))
+          ([db q-vec d-vec]
+           (make-reaction (fn [] (f @db q-vec d-vec))))))))())


edit elevio thankyou message

edit elevio thankyou message

--- src-cljs/frontend/elevio.cljs
+++ src-cljs/frontend/elevio.cljs
@@ -63,6 +63,6 @@
                          "reply_placeholder" "Write your reply here"
                          "no_tickets" "Currently no existing support requests"
                          "back_to_tickets" "Back to your support requests"
-                         "thankyou" "Thanks for submitting a support request. We try to respond to all tickets within 24 - 48 hours, but are often able to respond more quickly."
+                         "thankyou" "Thanks for submitting a support request. We try to respond to all tickets within 24-48 hours. If you need assistance sooner, our community may be able to help."
                          "delayed_appearance" ""
                          "deflect" "Before you submit a support request, please check to see if your question has already been answered on Discuss."}}})))


Revert "Now that we've shipped the features page, remove it from the router"

This reverts commit d679bcac94dbf62ebbff9ed630dcbf1ab439aeab.

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -207,6 +207,11 @@
   (defroute v1-stories "/stories/:story" [story]
     (open-to-outer! nav-ch :stories {:story (keyword story)}))

+  (defroute v1-features "/features" {:as params}
+    (open-to-outer! nav-ch :features (assoc params
+                                       :_title "Continuous Integration Product and Features"
+                                       :_description "Build a better product and let CircleCI handle your testing. CircleCI helps your team improve productivity with faster development, reduced risk, and better code.")))
+
   (defroute v1-languages "/features/:language" {:as params}
     (open-to-outer! nav-ch :language-landing params))


Max value problem added

Max value problem added

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -369,4 +369,14 @@
             :times-solved 0
             :description "Regex patterns are supported with a special reader macro."
             :tags ["elementary" "regex" "syntax"]
-            :tests ["(= __ (apply str (re-seq #\"[A-Z]+\" \"bA1B3Ce \")))"]})))+            :tests ["(= __ (apply str (re-seq #\"[A-Z]+\" \"bA1B3Ce \")))"]})
+
+    (insert! :problems
+           {:_id 38
+            :title "Maximum value"
+            :times-solved 0
+	    :restricted ["max"]
+            :description "Write a function which takes a variable number of parameters and returns the maximum value."
+            :tags ["easy" "core-functions"]
+            :tests ["(= (__ 1 8 3 4) 8)"
+		    "(= (__ 30 20) 30)"]})))


Fix wording, remove redundancy

Fix wording, remove redundancy

--- src/foreclojure/problems.clj
+++ src/foreclojure/problems.clj
@@ -366,8 +366,8 @@
           (show-solutions-page problem-id)
           (flash-error "You must solve this problem before you can see others' solutions!" (str "/problem/" problem-id))))
       (do
-        (session/session-put! :login-to (str "/problem/solutions/" problem-id))
-        (flash-error "You must login to see solutions!" "/login")))))
+        (session/session-put! :login-to *url*)
+        (flash-error "You must log in to see solutions!" "/login")))))

 (let [checkbox-img (image-builder {true ["/images/checkmark.png" "completed"]
                                    false ["/images/empty-sq.png" "incomplete"]})]


Hiding unapproved problems

Hiding unapproved problems

--- src/foreclojure/problems.clj
+++ src/foreclojure/problems.clj
@@ -2,6 +2,7 @@
   (:use (foreclojure utils
                      [social :only [tweet-link gist!]]
                      [feeds :only [create-feed]])
+        [foreclojure.config :only [advanced-user-count]]
         [clojail core testers]
         somnium.congomongo
         (hiccup form-helpers page-helpers core)
@@ -20,6 +21,7 @@
   (from-mongo
    (fetch :problems
           :only [:_id :title :tags :times-solved]
+          :where {:approved true}
           :sort {:_id 1})))

 (defn get-next-id []


in-ns blacklisted

in-ns blacklisted

--- src/foreclojure/problems.clj
+++ src/foreclojure/problems.clj
@@ -54,7 +54,7 @@
     (flash-msg (str message " " gist-link) "/problems")))

 (defn get-tester [restricted]
-  (into secure-tester (concat [:use :require] (map symbol restricted))))
+  (into secure-tester (concat ['use 'require 'ns] (map symbol restricted))))

 (def sb (sandbox*))


Accessibility improvements

Accessibility improvements

--- src/cljs/salava/extra/passport/ui/block.cljs
+++ src/cljs/salava/extra/passport/ui/block.cljs
@@ -69,6 +69,7 @@
     [:p "La déclaration de protection des données complète les conditions d’utilisation et y est intégrée par référence."]
     [:div {:style {:padding "15px"}}
      [:h1 {:style {:text-align "center"}} "Déclaration de protection des données"]
+     [:h2 {:style {:display "none"}} "Déclaration de protection des données"]
      [:div
       [:p {:style {:text-align "center"}} "Mis à jour le 29.1.2019 "]
       [:p " "]
@@ -203,9 +204,11 @@
     [:p "The Privacy Notice document complements the Terms of Use and is incorporated into these Terms of Use by reference."]
     [:div #_{:style {:padding "15px"}}
      [:h1 {:style {:text-align "center"}} " Privacy Notice"]
+     [:h2 {:style {:display "none"}} "Privacy Notice"]
      [:div
       [:p {:style {:text-align "center"}} "Updated 29.01.2019"]
       [:p ""]
+
       [:ol {:style {:list-style-type "none"}}
        [:li [:h3 "Controller"]
         [:div


Remove some unneeded stuff

Remove some unneeded stuff

--- src/ipython_clojure/core.clj
+++ src/ipython_clojure/core.clj
@@ -36,8 +36,6 @@
                                           :session (get-in message [:header :session])
                                           :msg_type "kernel_info_reply"
                                           :version "5.0"})]
-    (println message)
-    (println header)
     header))

 (defn close-comm-header [message]
@@ -240,8 +238,6 @@
                            :ename (.getSimpleName (.getClass e))
                            :evalue (.getLocalizedMessage e)
                            :traceback (map #(.toString %) (.getStackTrace e))
-                           :user_variables {}
-                           :user_expressions {}
                            }
                           parent-header {} session-id signer)

@@ -252,8 +248,7 @@
                                   :ename (.getSimpleName (.getClass e))
                                   :evalue (.getLocalizedMessage e)
                                   :traceback (map #(.toString %) (.getStackTrace e))
-                                  :user_variables {}
-                                  :user_expressions {}}
+                                  }
                                  parent-header
                                  {:dependencies_met "True"
                                   :engine session-id


Delay effect start notifications slightly.

Allow the functions which create effects to get their IDs as return
values before the start notifications are posted, so they can reconize
them as being their "own" effects. afterglow-max uses this.

--- src/afterglow/controllers.clj
+++ src/afterglow/controllers.clj
@@ -200,10 +200,12 @@
                (midi/midi-note-on device note velocity channel)
                (midi/midi-note-off device note channel)))))
        (doseq [[f _] (get @(:fn-feedback grid) [x y])]
-         (if (some? id)
-           (f :started (:key cue) id)
-           (when (some? former-id)
-             (f :ended (:key cue) former-id))))))))
+         (when (some? former-id)
+             (f :ended (:key cue) former-id))
+         (when (some? id)
+           ;; Delay :started notifications so watchers can recognize the ID that
+           ;; show/add-effect-from-cue-grid! is about to return to them.
+           (at-at/after 1 #(f :started (:key cue) id) pool)))))))

 (defn report-cue-ending
   "Calls any registered functions that want updates about the cue


Added owlapi_error ns

Added owlapi_error ns

--- src/kabob/core/namespace.clj
+++ src/kabob/core/namespace.clj
@@ -60,6 +60,8 @@
         ("semanticscience", "http://semanticscience.org/resource/")

         ("reactome_download", "http://www.reactome.org/download/current/")
+
+        ("owlapi_error", "http://org.semanticweb.owlapi/error#")
         ;; ---------------------------------------------------------------------------

         ;; the bp namespace is a convenience for working with biopax data


Some fns got moved to utils/

Some fns got moved to utils/

--- src/desdemona/launcher/launch_prod_peers.clj
+++ src/desdemona/launcher/launch_prod_peers.clj
@@ -12,14 +12,14 @@

 (defn -main [n & args]
   (let [n-peers (Integer/parseInt n)
-        {:keys [peer-config env-config]} (read-config!)
+        {:keys [peer-config env-config]} (utils/read-config!)
         peer-group (onyx.api/start-peer-group peer-config)
         env (onyx.api/start-env env-config)
         peers (onyx.api/start-peers n-peers peer-group)]
     (println "Connecting to Zookeeper: " (:zookeeper/address peer-config))
-    (add-shutdown-hook! (fn []
-                          (onyx.api/shutdown-peers peers)
-                          (onyx.api/shutdown-peer-group peer-group)
-                          (shutdown-agents)))
+    (utils/add-shutdown-hook! (fn []
+                                (onyx.api/shutdown-peers peers)
+                                (onyx.api/shutdown-peer-group peer-group)
+                                (shutdown-agents)))
     (println "Started peers. Blocking forever.")
     (utils/block-forever!)))


remove extraneous parens in :note

remove extraneous parens in :note

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -866,7 +866,7 @@
    "snap" {:synsem {:cat :verb
                     :sem {:pred :snap-pictures}}
            :english {:past "snapped"
-                     :note "(pictures)"}}
+                     :note "pictures"}}

    "some"
    [{:synsem {:cat :det


added put

added put

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -951,6 +951,11 @@
    "print"  {:synsem {:cat :verb
                       :sem {:pred :stampare}}}

+   "put" {:english {:past "put"
+                    :participle "putting"}
+          :synsem {:cat :verb
+                   :sem {:pred :put}}}
+
    "read" ;; if this was a phonetic dictionary, there would be two entries for each pronounciation (i.e. both "reed" or "red" pronounciations)
    {:english {:past "read (past)"}
     :synsem {:cat :verb


added "oir"

added "oir"

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -849,7 +849,23 @@

    ;; 2nd person plural informal 'vosotros/as' (ES-only)

-   "oir" {}
+   "oir" {:espanol {:futuro-stem "oir"
+                   :present {:1sing "oigo"
+                             :2sing "oyes"
+                             :3sing "oye"
+                             :1plur "oímos"
+                             :2plur "oís"
+                             :3plur "oyen"}
+                   :preterito {:1sing "oí"
+                               :2sing "oiste"
+                               :3sing "oyó"
+                               :1plur "oímos"
+                               :2plur "oísteis"
+                               :3plur "oyeron"}}
+         :synsem {:cat :verb
+                  :sem {:subj {:animate true}
+                        :pred :hear}}}
+
    "olvidar" {}
    "organizar" {}
    "pagar" {}


Add LED Techno Strobe RGB.

Add LED Techno Strobe RGB.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -3,6 +3,33 @@
   {:doc/format :markdown}
   (:require [afterglow.channels :as chan]
             [afterglow.effects.channel :refer [function-value-scaler]]))
+
+(defn led-techno-strobe-rgb
+  "[LED Techno Strobe RGB](http://www.chauvetlighting.com/led-techno-strobe-rgb.html)
+  color mixing strobe light.
+
+  This was created by Afterglow from the QLC+ Fixture Definintion
+  (.qxf) file, and revised by James Elliott.
+
+  The original fixture defintition was created by Davey D
+  using Q Light Controller Plus version 4.6.0.
+  QLC+ Fixture Type: Color Changer."
+  {:doc/format :markdown}
+  []
+  {:channels [(chan/functions :control 1
+                              0 {:type :rgb-control
+                                 :label "RGB control"
+                                 :range :fixed}
+                              (range 25 224 25) "program"
+                              225 :sound-active)
+              (chan/color 2 :red)
+              (chan/color 3 :green)
+              (chan/color 4 :blue)
+              (chan/fine-channel :speed 5
+                                 :function-name "Speed"
+                                 :var-label "fast to slow")
+              (chan/dimmer 6)]
+   :name "LED Techno Strobe RGB"})

 (defn slimpar-hex3-irc
   "[SlimPAR HEX 3 IRC](http://www.chauvetlighting.com/slimpar-hex3irc.html)
@@ -17,7 +44,8 @@
   channels are mixed in when creating colors by passing a boolean
   value with `:mix-amber` and `:mix-uv`. The default for each is
   `true`."
-  {:doc/format :markdown}
+  {:doc/format :markdown
+   :author "James Elliott"}
   ([]
    (slimpar-hex3-irc :12-channel))
   ([mode & {:keys [mix-amber mix-uv] :or {mix-amber true mix-uv true}}]


Add Intimidator Spot LED 150.

Add Intimidator Spot LED 150.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -2,7 +2,7 @@
   "Models for fixtures provided by [Chauvet Lighting](http://www.chauvetlighting.com)."
   {:doc/format :markdown}
   (:require [afterglow.channels :as chan]
-            [afterglow.effects.channel :refer [function-value-scaler]]))
+            [afterglow.fixtures.qxf :refer [sanitize-name]]))

 (defn color-strip-mini
   "[ColorStrip](http://www.chauvetlighting.com/colorstrip.html) LED fixture.
@@ -34,6 +34,121 @@
               (chan/color 3 :green)
               (chan/color 4 :blue)]
    :name "ColorStrip"})
+
+(defn intimidator-spot-led-150
+  "[Intimidator Spot LED 150](http://www.chauvetlighting.com/intimidator-spot-led-150.html) moving yoke.
+
+  This was created by Afterglow from the QLC+ Fixture Definintion
+  (.qxf) file, and heavily revised by James Elliott.
+
+  The original fixture defintition was created by Tavon Markov
+  using Q Light Controller Plus version 4.8.3 GIT.
+
+  QLC+ Fixture Type: Moving Head."
+  ([]
+   (intimidator-spot-led-150 :11-channel))
+  ([mode]
+   (let [build-color-wheel (fn [channel]
+                             (chan/functions :color channel
+                                             0 "Color Wheel Open"
+                                             (range 6 47 6) (chan/color-wheel-hue ["yellow" "magenta" "green" "red"
+                                                                                "cyan" "orange" "blue"])
+                                             48 "Color Wheel Light Green"
+                                             54 (chan/color-wheel-hue 45 :label "Color Wheel Amber")
+                                             64 "Color Wheel White + Yellow"
+                                             70 "Color Wheel Yellow + Magenta"
+                                             76 "Color Wheel Magenta + Green"
+                                             82 "Color Wheel Green + Red"
+                                             88 "Color Wheel Red + Cyan"
+                                             94 "Color Wheel Cyan + Orange"
+                                             100 "Color Wheel Orange + Blue"
+                                             106 "Color Wheel Blue + Light Green"
+                                             112 "Color Wheel Light Green + Amber"
+                                             118 "Color Wheel Amber + White"
+                                             128 {:type :color-clockwise
+                                                  :label "Color Wheel Clockwise (fast->slow)"
+                                                  :var-label "CW (fast->slow)"
+                                                  :range :variable}
+                                             192 {:type :color-counterclockwise
+                                                  :label "Color Wheel Counterclockwise (slow->fast)"
+                                                  :var-label "CCW (fast->slow)"
+                                                  :range :variable}))
+         build-shutter (fn [channel]
+                         (chan/functions :shutter channel
+                                         0 "Shutter Closed"
+                                         4 "Shutter Open"
+                                         8 {:type :strobe
+                                            :label "Strobe (0-20Hz)"
+                                            :scale-fn (partial function-value-scaler 0 200)
+                                            :range :variable}
+                                         216 "Shutter Open 2"))
+         gobo-names ["Quotes" "Warp Spots" "4 Dots" "Sail Swirl" "Starburst" "Star Field" "Optical Tube"
+                     "Sun Swirl" "Star Echo"]
+         build-gobo-entries (fn [shake? names]
+                              (map (fn [entry]
+                                     (let [label (str "Gobo " entry (when shake? " shake"))
+                                           type-key (keyword (sanitize-name label))]
+                                       (merge {:type type-key
+                                               :label label
+                                               :range (if shake? :variable :fixed)}
+                                              (when shake? {:var-label "Shake Speed"}))))
+                                   names))
+         build-gobo-wheel (fn [channel]
+                            (chan/functions :gobo channel
+                                            (range 0 63 6) (build-gobo-entries false (concat ["Open"] gobo-names))
+                                            (range 64 121 6) (build-gobo-entries true (reverse gobo-names))
+                                            122 "Gobo Open 2"
+                                            128 {:type :gobo-clockwise
+                                                 :label "Gobo Clockwise Speed"
+                                                 :var-label "CW Speed"
+                                                 :range :variable}
+                                            192 {:type :gobo-counterclockwise
+                                                 :label "Gobo Counterclockwise Speed"
+                                                 :var-label "CCW Speed"
+                                                 :range :variable}))]
+        (merge {:name "Intimidator Spot LED 150"
+                :mode mode}
+               (case mode
+                 :11-channel
+                 {:pan-center 128 :pan-half-circle 128 ; TODO: Fix these values
+                  :tilt-center 128 :tilt-half-circle 128 ; TODO: Fix these values
+                  :channels [(chan/pan 1 3)
+                             (chan/tilt 2 4)
+                             (chan/fine-channel :pan-tilt-speed 5
+                                                :function-name "Pan / Tilt Speed"
+                                                :var-label "P/T fast->slow")
+                             (build-color-wheel 6)
+                             (build-shutter 7)
+                             (chan/dimmer 8)
+                             (build-gobo-wheel 9)
+                             (chan/functions :control-functions 10
+                                             0 nil
+                                             8 "Blackout while moving Pan/Tilt"
+                                             28 "Blackout while moving Gobo Gheel"
+                                             48 "Disable blackout while Pan/Tilt / moving Gobo Wheel"
+                                             68 "Blackout while moving Color Wheel"
+                                             88 "Disable blackout while Pan/Tilt / moving Color Wheel"
+                                             108 "Disable blackout while moving Gobo/Color Wheel"
+                                             128 "Diable blackout while moving all options"
+                                             148 "Reset Pan"
+                                             168 "Reset Tilt"
+                                             188 "Reset Color Wheel"
+                                             208 "Reset Gobo Wheel"
+                                             228 "Reset All Channels"
+                                             248 nil)
+                             (chan/functions :movement-macros 11
+                                             0 nil
+                                             (range 8 135 16) "Program"
+                                             (range 136 255 16) "Sound Active")]}
+                 :6-channel
+                 {:pan-center 128 :pan-half-circle 128 ; TODO: Fix these values
+                  :tilt-center 128 :tilt-half-circle 128 ; TODO: Fix these values
+                  :channels [(chan/pan 1)
+                             (chan/tilt 2)
+                             (build-color-wheel 3)
+                             (build-shutter 4)
+                             (chan/dimmer 5)
+                             (build-gobo-wheel 6)]})))))

 (defn led-techno-strobe
   "[LED Techno Strobe](http://www.chauvetlighting.com/led-techno-strobe.html)


Refer to has-admin?

Refer to has-admin?

--- src/kixi/hecuba/data/measurements/upload.clj
+++ src/kixi/hecuba/data/measurements/upload.clj
@@ -14,7 +14,7 @@
             [kixi.hecuba.data.parents  :as parents]
             [kixi.hecuba.data.sensors  :as sensors]
             [kixi.hecuba.data.validate :as v]
-            [kixi.hecuba.security      :as sec]
+            [kixi.hecuba.security :refer (has-admin? has-programme-manager? has-project-manager? has-user?) :as sec]
             [kixi.hecuba.storage.db    :as db]
             [kixi.hecuba.time          :as time]
             [kixipipe.ioplus           :as ioplus]


Add test TODOs. Test Logger name on Session.

--- test/uruk/core_test.clj
+++ test/uruk/core_test.clj
@@ -122,21 +122,21 @@
   (testing "A session with explicitly-set options must reflect those options"
     (let [sess-opts (session-options
                      (create-session db
-                                     {:default-request-options {:timeout-millis 75}
+                                     {;; TODO test default Req Opts more?
+                                      :default-request-options {:timeout-millis 75}
+                                      :logger (Logger/getLogger "test-logger")
                                       ;; TODO test user-object
-                                      ;; TODO test Logger more deeply
-                                      ;; TODO test default Req Opts more?
                                       ;; TODO test effective Req Opts more?
                                       :transaction-timeout 56
                                       :transaction-mode :query}))]
       (and (is (= 75
                   (.getTimeoutMillis (:default-request-options sess-opts))
                   (.getTimeoutMillis (:effective-request-options sess-opts))))
-           (is (instance? Logger (:logger sess-opts)))
+           (is (and (instance? Logger (:logger sess-opts))
+                    (= "test-logger" (.getName (:logger sess-opts)))))
            (is (empty? (:user-object sess-opts)))
            (is (= 56 (:transaction-timeout sess-opts)))
            (is (= :query (:transaction-mode sess-opts)))))))
-

 ;; (deftest accept-only-valid-session-options
 ;;   (testing "Invalid session options should throw an error"
@@ -217,8 +217,13 @@
                                    :shape :single!}))))))

 ;; TODO more variable testing
+;; TODO test `as-is?`
+;; TODO test (all?) variable types
+;; TODO test default xs_string map structure
+

 ;;;; TODO Type conversion
+

 ;;;; Invalid query
 (deftest error-on-invalid-query
@@ -229,9 +234,12 @@
                  (with-open [sess (create-session db)]
                    (execute-xquery sess "let $uri := xdmp:get-request-field(\"uri\")returnif"))))))

+
 ;;;; TODO Shape

+
 ;;;; TODO Transactions
+

 ;;;; Element insertion


Stop allocating String Buffers

Stop allocating String Buffers

Instead of allocating string buffers every time we read a string
simply use one string buffer and initialize it for every string read

--- src/longshi/fressian/js.cljs
+++ src/longshi/fressian/js.cljs
@@ -296,7 +296,7 @@
         bos))))

 (def string-reader (make-string-reader))
-
+(def ^:private string-buffer (StringBuffer.))
 (defn read-string-buffer!
   "Reads a string from a byte array
   bis (ByteInputStream) - Fressian input stream to get bytes from
@@ -431,18 +431,21 @@
             (Long. il32 ih32)
             (+ (* ih32 two-power-32) il32)))
         (== code (.-STRING c/codes))
-        (let [string-buffer (StringBuffer.)]
-          (do
+        (let [string-buffer string-buffer]
+          (do
+            (.set string-buffer "")
             (read-string-buffer! bis string-buffer (p/read-object! bis))
             (.toString string-buffer)))
         (<= 0xDA code 0xE1)
-        (let [string-buffer (StringBuffer.)]
-          (do
+        (let [string-buffer string-buffer]
+          (do
+            (.set string-buffer "")
             (read-string-buffer! bis string-buffer (- code (.-STRING_PACKED_LENGTH_START c/codes)))
             (.toString string-buffer)))
         (== code (.-STRING_CHUNK c/codes))
-        (let [string-buffer (StringBuffer.)]
-          (do
+        (let [string-buffer string-buffer]
+          (do
+            (.set string-buffer "")
             (read-string-buffer! bis string-buffer (p/read-object! bis))
             (loop []
               (let [next-code (bsp/read! bis)]


changed how indexes work so that it can be used in add and del

--- src/lseq_tree/lseq_node.cljc
+++ src/lseq_tree/lseq_node.cljc
@@ -37,6 +37,7 @@

 (defn add
   "adds a node with one child at each level(a limb) to the children of a node"
+  ; TODO use a indexes func on a limb instead of this
   [{:keys [children triple] :as node}
    {-children :children -element :element -triple :triple
     :as limb}]
@@ -75,7 +76,9 @@
 (defn index-of
   "returns the zero-based index of a limb in a node"
   [node limb]
-  (if-let [paths (indexes node limb)]
+  (let [paths (indexes node limb)]
+    (if (some nil? paths)
+      nil
       (loop [paths paths,
              node node,
              acc (if (:element node) 1 0)]
@@ -85,12 +88,12 @@
             (recur tail
                    (nth children head)
                    (+ acc (left-to-right head node)))
-            (dec acc)))) ;zero-based index
-      nil))
+            (dec acc))))))) ;zero-based index

 (defn indexes
   "returns a vector of numbers for each level that the index of a limb is
-  located at in a node"
+  located at in a node. returns nil instead of a number when it can't find the
+  limb (eg [1 2 3 nil])"
   [node limb]
   (loop [path [], node node, limb limb]
     (let [{:keys [children]} node
@@ -98,7 +101,7 @@
       ;does the node contain the limb
       (if (or (< index 0)
               (and (= index 0) (= (count children) 0)))
-        nil
+        (conj path nil)
         ;does the limb have more children
         (if (or (= (count (:children limb)) 0)
                 (= (count children) 0))


close sidebar when click outside

close sidebar when click outside

--- src/braid/mobile/sidebar.cljs
+++ src/braid/mobile/sidebar.cljs
@@ -52,15 +52,17 @@
                       (let [x (.-clientX (aget (.-changedTouches e) 0))
                             dragging? (get-dragging?)
                             open? (get-open?)]
-                        (when @dragging?
-                          (.stopPropagation e)
-                          (if @open?
-                            (if (< x open-width)
-                              (close!)
-                              (open!))
-                            (if (> x fudge-x)
-                              (open!)
-                              (close!))))))]
+                        (if (not @dragging?)
+                          (close!)
+                          (do
+                            (.stopPropagation e)
+                            (if @open?
+                              (if (< x open-width)
+                                (close!)
+                                (open!))
+                              (if (> x fudge-x)
+                                (open!)
+                                (close!)))))))]
     (r/create-class
       {:component-did-mount
        (fn []


CLJS-1303 wip

CLJS-1303 wip

add cljs.core mappings to nses by default if mappings not explicitly supplied

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -9864,7 +9864,8 @@
   ([sym]
    (create-ns sym (find-ns-obj sym)))
   ([sym ns-obj]
-   (create-ns sym (find-ns-obj sym) (ns-interns* sym)))
+   (create-ns sym (find-ns-obj sym)
+     (merge (ns-interns* 'cljs.core) (ns-interns* sym))))
   ([sym ns-obj mappings]
    (Namespace. ns-obj sym (atom mappings))))


Fix exception monad to catch any throwable instead of only exceptions

--- src/cats/monad/exception.cljc
+++ src/cats/monad/exception.cljc
@@ -73,7 +73,7 @@
   "Return true if `v` is an instance of
   the Throwable or js/Error type."
   [e]
-  (instance? #?(:clj Exception :cljs js/Error) e))
+  (instance? #?(:clj Throwable :cljs js/Error) e))

 ;; --- Types and implementations.