Can now specify table schema with load-job

--- bigquery/src/gclouj/bigquery.clj
+++ bigquery/src/gclouj/bigquery.clj
@@ -1,7 +1,7 @@
 (ns gclouj.bigquery
   (:require [clojure.walk :as walk]
             [clj-time.coerce :as tc])
-  (:import [com.google.cloud.bigquery BigQueryOptions BigQuery$DatasetListOption DatasetInfo DatasetId BigQuery$TableListOption StandardTableDefinition TableId BigQuery$DatasetOption BigQuery$TableOption Schema Field Field$Type Field$Mode StandardTableDefinition$StreamingBuffer InsertAllRequest InsertAllRequest$RowToInsert InsertAllResponse BigQueryError BigQuery$DatasetDeleteOption QueryRequest QueryResponse QueryResult JobId Field Field$Type$Value FieldValue FieldValue$Attribute LoadConfiguration BigQuery$JobOption JobInfo$CreateDisposition JobInfo$WriteDisposition JobStatistics JobStatistics$LoadStatistics JobStatus JobStatus$State FormatOptions UserDefinedFunction JobInfo LoadJobConfiguration QueryJobConfiguration QueryJobConfiguration$Priority Table BigQuery$QueryResultsOption TableInfo]
+  (:import [com.google.cloud.bigquery BigQueryOptions BigQuery$DatasetListOption DatasetInfo DatasetId BigQuery$TableListOption StandardTableDefinition TableId BigQuery$DatasetOption BigQuery$TableOption Schema Field Field$Type Field$Mode StandardTableDefinition$StreamingBuffer InsertAllRequest InsertAllRequest$RowToInsert InsertAllResponse BigQueryError BigQuery$DatasetDeleteOption QueryRequest QueryResponse QueryResult JobId Field Field$Type$Value FieldValue FieldValue$Attribute LoadConfiguration BigQuery$JobOption JobInfo$CreateDisposition JobInfo$WriteDisposition JobStatistics JobStatistics$LoadStatistics JobStatus JobStatus$State FormatOptions UserDefinedFunction JobInfo LoadJobConfiguration QueryJobConfiguration QueryJobConfiguration$Priority Table BigQuery$QueryResultsOption TableInfo ViewDefinition CsvOptions]
            [com.google.common.hash Hashing]
            [java.util List Collections]
            [java.util.concurrent TimeUnit]))
@@ -37,9 +37,11 @@
   (to-clojure [x] {:location          (.location x)
                    :bytes             (.numBytes x)
                    :rows              (.numRows x)
-                   :streaming-buffer  (when-let [sb (.streamingBuffer x)]
-                                        (to-clojure sb))
-                   :schema            (to-clojure (.schema x))})
+                   :streaming-buffer  (when-let [sb (.streamingBuffer x)] (to-clojure sb))
+                   :schema            (when-let [schema (.schema x)] (to-clojure schema))})
+  ViewDefinition
+  (to-clojure [x] {:schema (when-let [schema (.schema x)]
+                             (to-clojure schema))})
   Table
   (to-clojure [x] {:creation-time (.creationTime x)
                    :description   (.description x)
@@ -115,7 +117,11 @@
                (.iterateAll))]
     (map to-clojure (iterator-seq it))))

-(defn tables [service {:keys [project-id dataset-id] :as dataset}]
+(defn tables
+  "Returns a sequence of table-ids. For complete table
+  information (schema, location, size etc.) you'll need to also use the
+  `table` function."
+  [service {:keys [project-id dataset-id] :as dataset}]
   (let [it (-> service
                (.listTables (DatasetId/of project-id dataset-id)
                             (into-array BigQuery$TableListOption []))
@@ -302,7 +308,14 @@
                          :truncate JobInfo$WriteDisposition/WRITE_TRUNCATE})

 (defn load-job
-  [service {:keys [project-id dataset-id table-id] :as table} {:keys [format create-disposition write-disposition max-bad-records]} & uris]
+  "Loads data from Cloud Storage URIs into the specified table. Options:
+  `create-disposition` controls whether tables are created if
+  necessary, or assume to have been created already (default).
+  `write-disposition`  controls whether data should :append (default),
+  :truncate or :empty to fail if table exists.
+  :format              :json or :csv
+  :schema              sequence describing the table schema.[{:name \"foo\" :type :record :fields [{:name \"bar\" :type :integer}]}]"
+  [service {:keys [project-id dataset-id table-id] :as table} {:keys [format create-disposition write-disposition max-bad-records schema]} uris]
   (let [builder (LoadJobConfiguration/builder (TableId/of project-id dataset-id table-id)
                                               uris
                                               ({:json (FormatOptions/json)
@@ -310,6 +323,8 @@
     (.createDisposition builder (create-dispositions (or create-disposition :never)))
     (.writeDisposition builder (write-dispositions (or write-disposition :append)))
     (.maxBadRecords builder (int (or max-bad-records 0)))
+    (when schema
+      (.schema builder (mkschema schema)))
     (let [load-config (.build builder)]
       (to-clojure (.create service (.build (JobInfo/builder load-config)) (into-array BigQuery$JobOption []))))))


use tags in opsgenie event alias

use tags in opsgenie event alias

--- src/riemann/opsgenie.clj
+++ src/riemann/opsgenie.clj
@@ -40,7 +40,8 @@
   "Generate OpsGenie alias based on event"
   [event]
   (hash (str (:host event) " "
-       (:service event))))
+       (:service event) " "
+       (apply str (:tags event)))))

 (defn- create-alert
   "Create alert in OpsGenie"
@@ -62,7 +63,7 @@

 (defn opsgenie
   "Creates an OpsGenie adapter. Takes your OG service key, and returns a map of
-  functions which trigger and resolve events. clojure/hash from event host and service
+  functions which trigger and resolve events. clojure/hash from event host, service and tags
   will be used as the alias.

   (let [og (opsgenie \"my-service-key\" \"recipient@example.com\")]


Fix typo

Fix typo

--- test/caesium/util_test.clj
+++ test/caesium/util_test.clj
@@ -22,7 +22,7 @@
       "ff" [-1]
       "010203" [1 2 3])))

-(deftest hexify-text
+(deftest hexify-test
   (testing "hexify works"
     (are [hex raw] (= hex (u/hexify (byte-array raw)))
       "" []


Add unit tests for BED intersection/subtraction/complement

--- test/cljam/io/bed_test.clj
+++ test/cljam/io/bed_test.clj
@@ -171,6 +171,89 @@
          [{:chr "chr1" :start 1 :end 13} {:chr "chr1" :start 15 :end 20} {:chr "chr2" :start 1 :end 10}]))
   (is (= (bed/merge-fields [{:chr "chr1" :start 1 :end 10 :name "chr1:1-10"} {:chr "chr1" :start 4 :end 13 :name "chr1:4-13"}])
          [{:chr "chr1" :start 1 :end 13 :name "chr1:1-10+chr1:4-13"}])))
+
+(deftest bed-intersect
+  (are [?xs ?ys ?result] (= ?result (bed/intersect-fields ?xs ?ys))
+    []
+    []
+    []
+
+    [{:chr "chr1" :start 10 :end 40}]
+    []
+    []
+
+    []
+    [{:chr "chr1" :start 10 :end 40}]
+    []
+
+    [{:chr "chr1" :start 10 :end 40}]
+    [{:chr "chr1" :start 50 :end 60}]
+    []
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 5 :end 20}]
+    [{:chr "chr1" :start 10 :end 20}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 20 :end 30}]
+    [{:chr "chr1" :start 20 :end 30}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 30 :end 60} {:chr "chr1" :start 70 :end 90}]
+    [{:chr "chr1" :start 30 :end 40} {:chr "chr1" :start 50 :end 60} {:chr "chr1" :start 70 :end 80}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80} {:chr "chr2" :start 10 :end 40}]
+    [{:chr "chr1" :start 10 :end 20} {:chr "chr2" :start 30 :end 40}]
+    [{:chr "chr1" :start 10 :end 20} {:chr "chr2" :start 30 :end 40}]))
+
+(deftest bed-subtract
+  (are [?xs ?ys ?result] (= ?result (bed/subtract-fields ?xs ?ys))
+    []
+    []
+    []
+
+    [{:chr "chr1" :start 10 :end 40}]
+    []
+    [{:chr "chr1" :start 10 :end 40}]
+
+    []
+    [{:chr "chr1" :start 10 :end 40}]
+    []
+
+    [{:chr "chr1" :start 10 :end 40}]
+    [{:chr "chr1" :start 50 :end 60}]
+    [{:chr "chr1" :start 10 :end 40}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 5 :end 20}]
+    [{:chr "chr1" :start 21 :end 40} {:chr "chr1" :start 50 :end 80}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 20 :end 30}]
+    [{:chr "chr1" :start 10 :end 19} {:chr "chr1" :start 31 :end 40} {:chr "chr1" :start 50 :end 80}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80}]
+    [{:chr "chr1" :start 30 :end 60} {:chr "chr1" :start 70 :end 90}]
+    [{:chr "chr1" :start 10 :end 29} {:chr "chr1" :start 61 :end 69}]
+
+    [{:chr "chr1" :start 10 :end 40} {:chr "chr1" :start 50 :end 80} {:chr "chr2" :start 10 :end 40}]
+    [{:chr "chr1" :start 10 :end 20} {:chr "chr2" :start 5 :end 30}]
+    [{:chr "chr1" :start 21 :end 40} {:chr "chr1" :start 50 :end 80} {:chr "chr2" :start 31 :end 40}]))
+
+(deftest bed-complement
+  (are [?xs ?result]
+      (= ?result (bed/complement-fields {"chr1" 1000, "chr2" 800} ?xs))
+    []
+    [{:chr "chr1" :start 0 :end 1000} {:chr "chr2" :start 0 :end 800}]
+
+    [{:chr "chr1" :start 0 :end 300}]
+    [{:chr "chr1" :start 300 :end 1000} {:chr "chr2" :start 0 :end 800}]
+
+    [{:chr "chr1" :start 0 :end 300} {:chr "chr1" :start 900 :end 1000} {:chr "chr2" :start 0 :end 300}]
+    [{:chr "chr1" :start 300 :end 900} {:chr "chr2" :start 300 :end 800}])
+
+  (is (thrown? IllegalArgumentException
+               (bed/complement-fields {"chr1" 1000} [{:chr "chr2" :start 0 :end 100}]))))

 (deftest bed-reader-and-bam-reader
   (with-open [bam (sam/bam-reader test-sorted-bam-file)]


test count-divisors

test count-divisors

--- test/euler/helper_test.clj
+++ test/euler/helper_test.clj
@@ -48,7 +48,7 @@
   (fact "narcissistic?"
         (narcissistic? 1634 4))

-  ; (fact-qc "factors vs divisors"
-  ;         [n gen/nat]
-  ;         (factors n) => (divisors n))
+   (fact-qc "factors vs count-divisors"
+           [n gen/nat]
+           (count (factors n)) => (count-divisors n))
   )


updated timeseries data

updated timeseries data


some more tests we need to add

some more tests we need to add

--- test/merlion/core_test.clj
+++ test/merlion/core_test.clj
@@ -179,3 +179,6 @@
                      (str "localhost:" new-port))
             (Thread/sleep 2000)
             (is (= (slurp "test/fixtures/excerpt.txt") @f))))))))
+
+;;# close frontend when there are no backends?
+;;# server quits unless there is a minimal correct config in etcd


Remove stale comment

Remove stale comment

--- src/braid/client/quests/list.cljs
+++ src/braid/client/quests/list.cljs
@@ -25,8 +25,6 @@
     :quest/video "/images/quests/conversation-new.gif"
     :quest/goal 3
     :quest/listener (fn [state [event data]]
-                      ; TODO: by the time this sees state, new-thread-id is out of date
-                      ; check if it's new by looking at the thread
                       (and
                         (= event :new-message)
                         (->>


change nthpath to richnav for performance

--- src/clj/com/rpl/specter/navs.cljc
+++ src/clj/com/rpl/specter/navs.cljc
@@ -506,15 +506,15 @@
      (do-keypath-transform vals structure k next-fn)
      structure)))

-(defnav nthpath*
+(defrichnav nthpath*
   ^{:doc "Navigates to the given position in the sequence. Setting the value to NONE
           will remove it from the sequence. Works for all sequence types."}
   [i]
-  (select* [this structure next-fn]
-    (next-fn (nth structure i)))
-  (transform* [this structure next-fn]
+  (select* [this vals structure next-fn]
+    (next-fn vals (nth structure i)))
+  (transform* [this vals structure next-fn]
     (if (vector? structure)
-      (let [newv (next-fn (nth structure i))]
+      (let [newv (next-fn vals (nth structure i))]
         (if (identical? newv i/NONE)
           (i/srange-transform* structure i (inc i) (fn [_] []))
             (assoc structure i newv)))
@@ -523,7 +523,7 @@
         i
         (inc i)
         (fn [[e]]
-          (let [v (next-fn e)]
+          (let [v (next-fn vals e)]
            (if (identical? v i/NONE)
              []
              [v])


Fragments can be listed and treated RESTfullish.

--- src/clj/post_to_screen/server.clj
+++ src/clj/post_to_screen/server.clj
@@ -10,7 +10,15 @@
             [ring.adapter.jetty :refer [run-jetty]]
             [hiccup.page :as page]
             [hiccup.form :as form]
-            [hiccup.util :as util]))
+            [hiccup.util :as util]
+            [ring.util.response :refer [redirect]]))
+
+; State
+
+(def posts (ref {}))
+(def nextId (ref 1))
+
+; Post form

 (defn page-layout [title & body]
   (page/html5
@@ -25,6 +33,17 @@
       body]
      (page/include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js")]))

+(defn post-form []
+  (page-layout
+    "Post to Screen"
+    [:h1 "Post to Screen"]
+    (form/form-to {:role "form"}
+                  [:post "/posts"]
+                  [:div.form-group
+                   (form/text-area {:class "form-control" :rows 20} "code")]
+                  (form/submit-button {:class "btn btn-primary"} "Post code"))))
+
+; Show code

 (defn code-layout [title & body]
   (page/html5
@@ -42,21 +61,33 @@
       body]
      (page/include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js")]))

-(defn post-form []
+(defn show-code [id]
+  (let [code (get @posts (read-string id))]
+    (if code
+      (code-layout
+        (str "Fragment " id)
+        [:h1 (str "Fragment " id)]
+        [:pre
+         [:code (util/escape-html code)]])
+      (page-layout
+        "Unexisten fragment"
+        [:div {:class "alert alert-danger" :role "alert"} "Unexistent fragment"]))))
+
+(defn post-code [code]
+  (dosync
+    (alter posts assoc @nextId code)
+    (alter nextId inc))
+  (redirect "/"))
+
+; Show list of posts
+
+(defn show-posts []
   (page-layout
-    "Post to Screen"
-    [:h1 "Post to Screen"]
-    (form/form-to {:role "form"}
-      [:post "/"]
-      [:div.form-group
-       (form/text-area {:class "form-control" :rows 20} "code")]
-      (form/submit-button {:class "btn btn-primary"} "Post code"))))
-
-(defn show-code [code]
-  (code-layout
-    "Posted code"
-    [:pre
-     [:code (util/escape-html code)]]))
+    "List of fragments"
+    [:h1 "List of fragments"]
+    [:ul
+     (for [k (reverse (sort (keys @posts)))]
+       [:li [:a {:href (str "/posts/" k)} (str "Fragment " k)]])]))

 (deftemplate page
   (io/resource "index.html") [] [:body] (if is-dev? inject-devmode-html identity))
@@ -64,9 +95,15 @@
 (defroutes routes
   (resources "/")
   (resources "/react" {:root "react"})
+
   (GET "/" [_] (post-form))
-  (POST "/" [code] (show-code code))
-  (GET "/*" req (page)))
+
+  (GET  "/posts" [_] (show-posts))
+  (POST "/posts" [code] (post-code code))
+
+  (GET "/posts/:id" [id] (show-code id))
+
+  #_(GET "/*" req (page)))

 (def http-handler
   (if is-dev?


Render deploy button

Render deploy button

--- src/cljs/battle_console/game.cljs
+++ src/cljs/battle_console/game.cljs
@@ -217,6 +217,16 @@
     "disabled"
     ""))

+(defn- deploy-disabled
+  "Checks if the deploy button should be disabled"
+  [state]
+  (let [player-code (get-in state [:game-data "viewed-by" "player-code"])]
+    (cond
+      (state :processing-action) "disabled"
+      (not= "deploy" (get-in state [:original-game-data "battle" "state"])) "disabled"
+      (empty? (get-in state [:game-data "battle" "stash" player-code])) ""
+      :else "disabled")))
+
 (defn- render-action-console
   "Renders the action management console"
   [state]
@@ -225,7 +235,8 @@
     (dom/label #js {:for "newAction" :className "control-label"} "Action:")
     (dom/input #js {:type "text" :id "newAction" :className "form-control"})
     (dom/button #js {:id "resetActionButton" :onClick reset-actions :className "btn btn-default"} "Reset")
-    (dom/button #js {:id "addActionButton" :onClick add-action :className "btn btn-info" :disabled (add-action-disabled state)} "Add")))
+    (dom/button #js {:id "addActionButton" :onClick add-action :className "btn btn-info" :disabled (add-action-disabled state)} "Add")
+    (dom/button #js {:id "deployButton" :onClick add-action :className "btn btn-info" :disabled (deploy-disabled state)} "Deploy")))

 (defn- render-game
   "Renders the index page"


New game disabled state

New game disabled state

--- src/cljs/netrunner/gamelobby.cljs
+++ src/cljs/netrunner/gamelobby.cljs
@@ -60,7 +60,6 @@

 (defn leave-game [cursor owner]
   (send {:action "leave" :gameid (:gameid @app-state)})
-  (om/set-state! owner :in-game false)
   (om/update! cursor :gameid nil)
   (om/update! cursor :message []))

@@ -130,8 +129,9 @@
        [:div.lobby.panel.blue-shade
         [:div.games
          [:div.button-bar
-          [:button {:class (if (:in-game state) "disabled" "")
-                    :on-click #(new-game cursor owner)} "New game"]]
+          (if gameid
+            [:button {:class "disabled"} "New game"]
+            [:button {:on-click #(new-game cursor owner)} "New game"])]
          [:div.game-list
           (if (empty? games)
             [:h4 "No game"]


Fix undo issue with cutting

Fix undo issue with cutting

--- src/clojure/nightcode/editors.clj
+++ src/clojure/nightcode/editors.clj
@@ -412,7 +412,7 @@
                    (mwm/update-edit-history! edit-history))

               (and (or (.isControlDown e) (.isMetaDown e))
-                (= (.getKeyCode e) KeyEvent/VK_V))
+                (contains? #{KeyEvent/VK_V KeyEvent/VK_X} (.getKeyCode e)))
               (->> (get-parinfer-state text-area true)
                    (refresh-content! text-area)
                    (mwm/update-edit-history! edit-history))))


CMr-3780: Fixed parinfer induced error

CMr-3780: Fixed parinfer induced error

--- access-control-app/src/cmr/access_control/services/acl_service.clj
+++ access-control-app/src/cmr/access_control/services/acl_service.clj
@@ -73,9 +73,9 @@
                   acl)
             legacy-guid (:legacy-guid acl)]
         (when-not (= existing-legacy-guid legacy-guid)
-          (errors/throw-service-error)
-          :invalid-data (format "ACL legacy guid cannot be updated, was [%s] and now [%s]"
-                                existing-legacy-guid legacy-guid))
+          (errors/throw-service-error :invalid-data
+                                      (format "ACL legacy guid cannot be updated, was [%s] and now [%s]"
+                                              existing-legacy-guid legacy-guid)))
         (let [new-concept (merge (acl-util/acl->base-concept context acl)
                                 {:concept-id concept-id
                                   :native-id (:native-id existing-concept)})


Changed twitter link to www

Changed twitter link to www

--- src/skidskytte/views.clj
+++ src/skidskytte/views.clj
@@ -12,7 +12,7 @@
   fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));</script>")

-(def tweet-button "Tweeta
+(def tweet-button "Tweeta
 ")

 (def google-analytics "


Added support for grouping rows (Gitlab Issues) by tags (Gitlab Issue Labels). NOTE:  * Groups and columns are currently declared at top of "labradoodle.core" namespace.  * TODO: replace hardcoded groups and columns definition with runtime config (config.edn).

--- src/labradoodle/excel.clj
+++ src/labradoodle/excel.clj
@@ -1,5 +1,7 @@
 (ns labradoodle.excel
-  (:use [dk.ative.docjure.spreadsheet]))
+  (:use [dk.ative.docjure.spreadsheet])
+  (:require [clojure.string :as s :refer [trim join split]])
+  (:import (clojure.lang ISeq)))

 ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ;; Referenced while coding this ns:
@@ -8,7 +10,28 @@
 ;;  - http://stackoverflow.com/questions/1676891/mapping-a-function-on-the-values-of-a-map-in-clojure
 ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-(def columns (array-map :title "Task", :state "Status", [:milestone :title] "Milestone", [:assignee :name] "Assigned To"))
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+;; Cell Data Definition
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+(def columns (array-map :group ""
+                        :id "ID"
+                        :title "Outstanding Item",
+                        :description "Notes",
+                        :labels "Tags"
+                        [:milestone :title] "Milestone",
+                        :state "Status",
+                        [:assignee :name] "Assigned To"))
+
+; groups are based on Issue labels
+(def groups [{:display "Development" :label "dev"},
+             {:display "Ops" :label "ops"},
+             {:display "Demo Prep" :label "demo"},
+             {:display "Documentation" :label "docs"}])
+
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+;; Data Transformation functions
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 (defn fmap [f m]
   "Based on corresponding multi-method in https://github.com/clojure/algo.generic"
@@ -43,26 +66,79 @@
       [k (get-in v (ks->path colk) v)]
       entry)))

+(defn render [v]
+  "Renders value based on type"
+  (cond
+    (instance? ISeq v) (join ", " v)
+    :else (str v)))
+
 (defn issues->rows [cols issues]
   "Produces rows array, with shape like this:
   [{:name \"Foo Widget\" :price 100}
    {:name \"Bar Widget\" :price 200}]"
   ; Create rows by transforming  issue objects as follows:
-  ; (A) only contain keys from cols map;
-  ; (B) resolves nested values for path keys (e.g. replaces milestone object with title if key is [:milestone :title])
-  ; (C) values are all strings
-  ; (D) entries are in same order as cols entries
+  ; (A) add placeholder key for group column
+  ; (B) only contain keys from cols map;
+  ; (C) resolves nested values for path keys (e.g. replaces milestone object with title if key is [:milestone :title])
+  ; (D) render values (by default converts to strings)
+  ; (E) entries are in same order as cols entries
   (let [topkeys (cols->topkeys cols)
-        transform-issue (comp
-                          #(into (sorted-map-by (partial idx-comparator topkeys)) %)
-                          ;#(into (sorted-map) %)
-                          #(fmap str %)
-                          #(map (partial resolve-nested-val cols) %)
-                          #(select-keys % topkeys))
-        rows (map transform-issue issues)]
+        transform-issue-fn (comp
+                             #(into (sorted-map-by (partial idx-comparator topkeys)) %)
+                             ;#(into (sorted-map) %)
+                             #(fmap render %)
+                             #(map (partial resolve-nested-val cols) %)
+                             #(select-keys % topkeys)
+                             #(merge % {:group ""}))
+        rows (map transform-issue-fn issues)]
     (println "---------------")
     (clojure.pprint/pprint rows)
     rows))
+
+(defn any-label? [labels row]
+  "return true if one of row :labels contains any items from labels set, otherwise return false"
+  (let [row-labels (map trim (split (:labels row) #","))]
+    (some labels row-labels)))
+
+(defn has-label? [label row]
+  "return true if one of row :labels is label, otherwise return false"
+  (any-label? #{label} row))
+
+(defn group-rows [groups rows]
+  "Transforms rows vector into new vector with rows re-arranged (and possibly duplicated)
+  per groups definition. Each group of rows is demarcated by a group-header-row containing
+  a single group-header object."
+  (let [reduce-fn (fn [grouped-rows {:keys [label display :as group]}]
+                    (let [group-header-row (vector {:group display})
+                          group-rows (filter #(has-label? label %) rows)]
+                      (-> grouped-rows
+                          (into group-header-row)
+                          (into group-rows))))
+        group-labels (set (map :label groups))
+        misc (filter #(not (any-label? group-labels %)) rows)]
+    (-> (reduce reduce-fn [] groups)
+        (into (vector {:group "Misc"}))
+        (into misc))))
+
+(defn group-fixed-rows [rows]
+  "Groups rows by labels: dev, ops, demo, docs. Include any ungrouped rows under a misc group."
+  {:deprecated "This fn hardcodes the groups; use the more flexible group-rows fn instead."}
+  (let [dev (filter #(has-label? "dev" %) rows)
+        ops (filter #(has-label? "ops" %) rows)
+        demo (filter #(has-label? "demo" %) rows)
+        docs (filter #(has-label? "docs" %) rows)
+        misc (filter #(not (any-label? #{"dev", "ops", "demo", "docs"} %)) rows)]
+    (-> []
+        (into (vector {:group "Development"}))
+        (into dev)
+        (into (vector {:group "Ops"}))
+        (into ops)
+        (into (vector {:group "Demo Prep"}))
+        (into demo)
+        (into (vector {:group "Documentation"}))
+        (into docs)
+        (into (vector {:group "Misc"}))
+        (into misc))))

 (defn issues->celldata [issues]
   "Create celldata array, with shape like this:
@@ -71,10 +147,16 @@
    [\"Bar Widget\" 200]]"
   (let [cols columns
         rows (issues->rows cols issues)
-        data (into [(vals cols)] (map vals rows)) ]
+        groups (group-rows groups rows)
+        data (into [(vals cols)] (map vals groups)) ]
     (println "---------------")
     (clojure.pprint/pprint data)
     data))
+
+
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+;; Workbook Manipulation fuctions
+;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 (defn issues->wb [proj issues]
   "Creates a spreadsheet containing data from issues"


Failed to to introduce blocking thread pool to go macro. We need to patch channels as well

--- core/src/clj/hellhound/async.clj
+++ core/src/clj/hellhound/async.clj
@@ -1,11 +1,13 @@
-(ns hellhound.async)
-(:require
- [clojure.core.async.impl.ioc-macros :as ioc]
- ;; TODO Replace tp with our own implementation.
- [clojure.core.async.impl.exec.threadpool :as tp]
- [hellhound.async.dispatch :as dispatch])
+(ns hellhound.async
+  (:require
+   [clojure.core.async.impl.ioc-macros :as ioc]
+   ;; TODO Replace tp with our own implementation.
+   [clojure.core.async.impl.exec.threadpool :as tp]
+   ;; TODO: Remove the async requirement here
+   [clojure.core.async :refer [chan <!]]
+   [hellhound.async.dispatch :as dispatch]))

-(defonce executor (tp/thread-pool-executor))
+(def executor1 (delay (tp/thread-pool-executor)))

 (defmacro go-block
   "Asynchronously executes the given `body` in a thread pool dedicated
@@ -21,8 +23,12 @@
   completed."
   [& body]
   (let [crossing-env (zipmap (keys &env) (repeatedly gensym))]
+    (println "xxxxxxxxxxxxxxxxxxx")
+    (clojure.pprint/pprint crossing-env)
     `(let [c# (chan 1)
            captured-bindings# (clojure.lang.Var/getThreadBindingFrame)]
+
+       (println "yyyyyyyyyyy")
        (dispatch/run
          (^:once fn* []
           (let [~@(mapcat (fn [[l sym]] [sym `(^:once fn* [] ~(vary-meta l dissoc :tag))]) crossing-env)
@@ -31,5 +37,10 @@
                            (ioc/aset-all! ioc/USER-START-IDX c#
                                           ioc/BINDINGS-IDX captured-bindings#))]
             (ioc/run-state-machine-wrapped state#)))
-         executor)
+         executor1)
        c#)))
+
+
+
+(let [b (chan 1)
+      a (go-block (<! b))])


Add cpu bursting support to K8s pod specs (#572)

--- waiter/src/waiter/scheduler/kubernetes.clj
+++ waiter/src/waiter/scheduler/kubernetes.clj
@@ -734,8 +734,7 @@
                                                                :failureThreshold 1
                                                                :periodSeconds health-check-interval-secs
                                                                :timeoutSeconds 1}
-                                              :resources {:limits {:cpu cpus
-                                                                   :memory memory}
+                                              :resources {:limits {:memory memory}
                                                           :requests {:cpu cpus
                                                                      :memory memory}}
                                               :volumeMounts [{:mountPath work-path
@@ -757,7 +756,7 @@
            :imagePullPolicy "IfNotPresent"
            :name "waiter-fileserver"
            :ports [{:containerPort port}]
-           :resources {:limits {:cpu cpu :memory memory}
+           :resources {:limits {:memory memory}
                        :requests {:cpu cpu :memory memory}}
            :volumeMounts [{:mountPath "/srv/www"
                            :name "user-home"}]


Disable Totp-step in multi-factor-auth

Disable Totp-step in multi-factor-auth

--- src/cylon/impl/authentication.clj
+++ src/cylon/impl/authentication.clj
@@ -301,7 +301,8 @@
     (path-for req ::GET-totp-form)
     )
   (step-required? [this req]
-    (let [identity (get-session-value req cookie-id (:session-store this) :cylon/identity)]
+    false
+    #_(let [identity (get-session-value req cookie-id (:session-store this) :cylon/identity)]
       (not (nil? (get-totp-secret (:user-domain this) identity))))))

 (defn new-authentication-totp-form [& {:as opts}]


Added ajudicators to GUI

Added ajudicators to GUI

--- src/tango/cljs/main.cljs
+++ src/tango/cljs/main.cljs
@@ -319,6 +319,39 @@
    0
    class-result))

+(defn adjudictors-component []
+  [:div
+   [:h3 "Domare"]
+   [:table.table
+    [:thead
+     [:tr
+      [:th {:with "20"} "#"]
+      [:th {:with "200"} "Name"]
+      [:th {:with "20"} "Country"]]]
+    [:tbody
+     (for [adjudicator (sort-by :adjudicator/id (:competition/adjudicators (:competition @app-state)))]
+       ^{:key adjudicator}
+       [:tr
+        [:td (:adjudicator/id adjudicator)]
+        [:td (:adjudicator/name adjudicator)]
+        [:td (:adjudicator/country adjudicator)]])]]])
+
+
+(defn adjudictor-panels-component []
+  [:div
+   [:h3 "Domare"]
+   [:table.table
+    [:thead
+     [:tr
+      [:th {:with "20"} "#"]
+      [:th {:with "200"} "Domare"]]]
+    [:tbody
+     (for [adjudicator-panel (sort-by :panel/id (:competition/adjudicator-panels (:competition @app-state)))]
+       ^{:key adjudicator-panel}
+       [:tr
+        [:td (:panel/id adjudicator-panel)]
+        [:td (clojure.string/join ", " (mapcat vals (:panel/adjudicators adjudicator-panel)))]])]]])
+
 (defn dp-classes-component []
   [:div
    [:h3 "Klasser"]
@@ -357,7 +390,11 @@
    [:input.btn.btn-default {:type "button" :value "Classes"
                             :on-click #(dispatch [:select-page :classes])}]
    [:input.btn.btn-default {:type "button" :value "Time Schedule"
-                            :on-click #(dispatch [:select-page :events])}]])
+                            :on-click #(dispatch [:select-page :events])}]
+   [:input.btn.btn-default {:type "button" :value "Adjudicators"
+                            :on-click #(dispatch [:select-page :adjudicators])}]
+   [:input.btn.btn-default {:type "button" :value "Adjudicator panels"
+                            :on-click #(dispatch [:select-page :adjudicator-panels])}]])

 (defn events-component []
   [:div
@@ -453,7 +490,10 @@
      [navigation-component]
      (condp = (:selected-page @app-state)
        :classes [dp-classes-component]
-       :events [events-component])]))
+       :events [events-component]
+       :adjudicators [adjudictors-component]
+       :adjudicator-panels [adjudictor-panels-component]
+       )]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Application


Testing game-width and game-height

Testing game-width and game-height

--- test/civs/model_test.clj
+++ test/civs/model_test.clj
@@ -25,6 +25,14 @@
 (deftest test-alive?
   (is (= true  (alive?  (Tribe. nil nil nil (Population. 1 2 3 4 5) nil nil))))
   (is (= false (alive?  (Tribe. nil nil nil (Population. 0 0 0 0 0) nil nil)))))
+
+(deftest test-game-width
+  (let [g (create-game w77)]
+    (is (= 512 (game-width g)))))
+
+(deftest test-game-height
+  (let [g (create-game w77)]
+    (is (= 512 (game-height g)))))

 (deftest test-create-tribe
   (let [g (create-game nil)


Deleting redundant code

Deleting redundant code

--- src/kixi/hecuba/web/resources.clj
+++ src/kixi/hecuba/web/resources.clj
@@ -54,11 +54,3 @@
                (case mt
                  "text/html" (html [:h1 (:hecuba/name project)])
                  project)))
-
-(defn create-routes [querier commander]
-  (let [project (project-resource querier)
-        projects (projects-resource querier commander project)]
-    [""
-     [["projects/" projects]
-      ["projects" (->Redirect 307 projects)]
-      [["project/" :id] project]]]))


add some test about clojure function

add some test about clojure function

--- src/learnclojure/chapt1/core5.clj
+++ src/learnclojure/chapt1/core5.clj
@@ -1,4 +1,69 @@
-(ns learnclojure.chapt1.core5)
+(ns learnclojure.chapt1.core5
+  (:import (java.util Date UUID)))
+;;一个简单函数的定义
 (fn [x]
   (+ x 10))
-
+;;函数定义的参数和调用函数实际传递的参数之间的定义是通过参数位置定义的
+((fn [x]
+   (+ x 10)) 8)
+;;上面的代码相当于
+(let [x 8]
+  (+ x 10))
+;;多个参数的函数
+((fn [x y z]
+   (+ x y z))
+  3 4 12)
+;;等价于
+(let [x 3 y 4 z 12]
+  (+ x y z))
+;;函数可以有多个参数列表
+(def strange-adder (fn adder-self-reference
+                     ([x] (adder-self-reference x 1))
+                     ([x y] (+ x y))))
+;;等价于下面的代码，defn是一个封装了def和fn功能的宏，比较常用
+(defn strange-adder
+  ([x] (strange-adder x 1))
+  ([x y] (+ x y)))
+(strange-adder 1)
+(strange-adder 1 2)
+;;letfn可以定义同时定义多个具名函数，并且这些函数可以互相引用
+(letfn [(odd? [n]
+              (even? (- n 2)))
+        (even? [n]
+               (or (zero? n)
+                   (odd? (- n 2))))]
+  (even? 4))
+;;可变参函数，下面函数中的rest被称为剩余参数
+(defn concat-rest
+  [x & rest]
+  (apply str (butlast rest)))
+(concat-rest 1 2 3 4)
+;;剩余参数可以像其他序列那样解构
+(defn make-user1
+  [& [user-id user-name]]
+  {:user-id   (or user-id
+                  (str (UUID/randomUUID)))
+   :user-name (or user-name
+                  (str (rand-int 10)))})
+;;(make-user)
+(make-user1 "ef2f2a")
+;;关键字参数。可以让函数使用者不必按某个特定的顺序传参
+(defn make-user2
+  [username & {:keys [email join-date]
+               :or   {join-date (Date.)}}]
+  {:user-name username
+   :join-date join-date
+   :email     email
+   ;;2.592e9 -> one month in ms
+   :exp-date  (Date. (long (+ 2.592e9 (.getTime join-date))))
+   })
+(make-user2 "Zijunjie")
+(make-user2 "Zijunjie"
+            :join-date (Date. 111 0 1)
+            :email "zjjblue@126.com")
+;;关键字参数是利用let的map解构的特性实现的，所以关键字的参数名字理论上可以是任何类型的值
+;;比如字符串 数字 甚至集合 但最好是用关键字来作为map的key的名字。
+(defn foo
+  [& {k ["z" 1]}]
+  (inc k))
+(foo ["z" 1] 5)


不能内存化的函数 内存化的注意点

不能内存化的函数
内存化的注意点

--- src/learnclojure/chapt2/core3.clj
+++ src/learnclojure/chapt2/core3.clj
@@ -82,6 +82,15 @@
 (let [m-prime? (memoize prime?)]
 (time (m-prime? 1125899906842679))
 (time (m-prime? 1125899906842679)))
-(rand-int 2)
+;;有副作用的函数就不是引用透明的，所以不能内存化
+;;如果内存化rand-int，会如何？
+(repeatedly 10 (partial rand-int 10))
+;=(6 4 5 1 2 2 9 1 9 8)
+(repeatedly 10 (partial (memoize rand-int) 10))
+;=(8 8 8 8 8 8 8 8 8 8),rand-int不再是产生随机数
+;;memoize会保存所以调用参数和返回值的映射，不会被回收
+;;所以一个函数取值范围很广，或者参数、返回值很占内存的话，会导致内存泄漏
+;;解决方法1.不要把它们定义成顶层函数，而是放在顶层函数内部，只在需要的时候调用
+;;2.使用core.memoize库


remove comments pertaining to which version the example was tested with

--- examples/bells.clj
+++ examples/bells.clj
@@ -1,8 +1,5 @@
-(ns examples.bells
+(ns examples.bells
   (:use [overtone.live]))
-
-;;tested in Overtone 0.6-dev
-;;add [overtone.sc.machinery.defcgen] to ns :use clause for 0.5.0

 ;;http://computermusicresource.com/Simple.bell.tutorial.html
 (def dull-partials


Fix and use max-pool-size.

Fix and use max-pool-size.

--- src/poky/kv/jdbc/util.clj
+++ src/poky/kv/jdbc/util.clj
@@ -1,6 +1,7 @@
 (ns poky.kv.jdbc.util
   (:require [clojure.java.jdbc :as sql]
-            [clojure.string :as string])
+            [clojure.string :as string]
+            [environ.core :refer [env]])
   (:import com.mchange.v2.c3p0.ComboPooledDataSource))

 (def ^:private default-min-pool-size 3)
@@ -28,14 +29,15 @@

 (defn pool
   "Create a connection pool."
-  [spec &{:keys [min-pool-size] :or {min-pool-size default-min-pool-size}}]
+  [spec &{:keys [min-pool-size max-pool-size]
+          :or {min-pool-size default-min-pool-size max-pool-size default-max-pool-size}}]
   (let [cpds (doto (ComboPooledDataSource.)
                (.setDriverClass (:classname spec))
                (.setJdbcUrl (str "jdbc:" (:subprotocol spec) ":" (:subname spec)))
                (.setUser (:user spec))
                (.setPassword (:password spec))
                (.setMinPoolSize min-pool-size)
-               (.setMaxPoolSize default-max-pool-size)
+               (.setMaxPoolSize max-pool-size)
                (.setMaxIdleTimeExcessConnections (* 30 60))
                (.setMaxIdleTime (* 3 60 60)))]
       {:datasource cpds}))
@@ -43,7 +45,7 @@
 (defn create-connection
   "Create a connection and delay it."
   [dsn]
-  (delay (pool (create-db-spec dsn))))
+  (delay (pool (create-db-spec dsn) :max-pool-size (env :max-pool-size default-max-pool-size))))

 (defn close-connection
   "Close the connection of a JdbcKeyValue object."


also add throw

also add throw

use of (js/throw ...) otherwise adds externs for throw causing
the closure compiler to complain. should be (throw ...) but no
reason to break if not.

--- src/main/shadow/build/closure.clj
+++ src/main/shadow/build/closure.clj
@@ -276,6 +276,7 @@
          postMessage
          process
          require
+         throw
          undefined
          WebSocket
          Worker


Log JSON requests

Log JSON requests

--- src/org/spootnik/cyanite/http.clj
+++ src/org/spootnik/cyanite/http.clj
@@ -24,11 +24,17 @@
   (fn [request]
     (handler (assoc request :local-params params))))

+(defn- log-request
+  [title request]
+  (info title (if-let [json-params (:json-params request)]
+                json-params
+                (:query-string request))))
+
 (defn paths-handler [response-channel {{:keys [query tenant]}  :params
                                        {:keys [index]} :local-params
                                        :as request}]
   (debug "query now: " query)
-  (info "Paths request:" (str (:uri request) "?" (:query-string request)))
+  (log-request "Paths request:" request)
   (enqueue
     response-channel
     (try
@@ -64,7 +70,7 @@
                        {{:keys [index store rollup-finder]} :local-params
                         {:keys [from to path agg tenant]} :params :as request}]
   (debug "fetching paths: " path)
-  (info "Metrics request:" (str (:uri request) "?" (:query-string request)))
+  (log-request "Metrics request:" request)
   (enqueue
    response-channel
     (try


made it easier to switch type of scramble

--- src/scramblyzer/stats.clj
+++ src/scramblyzer/stats.clj
@@ -4,6 +4,7 @@

 (def number-of-scramble-lengths 10)
 (def scrambles-to-use 1)
+(def scramble-dir "scrambles/5gen")

 (defn- average
   [values]
@@ -13,7 +14,7 @@
   [length]
   (take scrambles-to-use
         (split
-          (slurp (str "scrambles/6gen/len_" length))
+          (slurp (str scramble-dir "/len_" length))
           #"\n"
           -1)))


Exercise 1.22

Exercise 1.22


Fix bug where dropdown stays open on blur

--- src/reabledit/cells/dropdown.cljs
+++ src/reabledit/cells/dropdown.cljs
@@ -86,7 +86,10 @@
            :value ""
            :on-key-down #(handle-key-down % state options k commit!)
            :on-change #(handle-on-change % state options k)
-           :on-blur #(if-not (= k (:selected @state)) (commit!))
+
+           ;; A hack. Should use relatedTarget, but Firefox
+           ;; does not support it yet. Fix in the future.
+           :on-blur #(if (:edit? @state) (js/setTimeout commit! 100))
            :on-copy #(util/set-clipboard-data % v)
            :on-paste #(handle-paste % state options commit!)
            :on-cut #(util/set-clipboard-data % v)}]


Make the dropdown cell onblur timeout even bigger

--- src/reabledit/cells/dropdown.cljs
+++ src/reabledit/cells/dropdown.cljs
@@ -89,7 +89,7 @@

            ;; A hack. Should use relatedTarget, but Firefox
            ;; does not support it yet. Fix in the future.
-           :on-blur #(if (:edit? @state) (js/setTimeout commit! 100))
+           :on-blur #(if (:edit? @state) (js/setTimeout commit! 500))
            :on-copy #(util/set-clipboard-data % v)
            :on-paste #(handle-paste % state options commit!)
            :on-cut #(util/set-clipboard-data % v)}]


Don't try to extract map when simple schema

--- src/diglett.clj
+++ src/diglett.clj
@@ -8,7 +8,7 @@
            [org.jsoup.nodes Element]
            [org.jsoup.select Elements]))

-(declare ->schema schema->fn pull pull? spec ->spec)
+(declare ->schema schema->fn schema? pull spec ->spec)

 (s/def ::schema #(satisfies? schema/Schema (->schema %)))

@@ -36,6 +36,8 @@

 (defrecord Spec [schema extr])

+(defrecord Schema [schema])
+
 (defprotocol Extractable
   (extract [_ _])
   (text [_])
@@ -53,14 +55,16 @@
       (condp get (type (:schema spec))
         #{clojure.lang.PersistentArrayMap
           clojure.lang.PersistentHashMap}
-        (filter-keys identity
-                     (map-kv (fn [k v]
-                               (let [v (extract v (->node nodes))]
-                                 (if (instance? schema.core.OptionalKey k)
-                                   (when v
-                                     [(:k k) v])
-                                   [k v])))
-                             (:schema spec)))
+        (if (some schema? (vals (:schema spec)))
+          (filter-keys identity
+                       (map-kv (fn [k v]
+                                 (let [v (extract v (->node nodes))]
+                                   (if (instance? schema.core.OptionalKey k)
+                                     (when v
+                                       [(:k k) v])
+                                     [k v])))
+                               (:schema spec)))
+          (pull (->node nodes) fns))

         #{clojure.lang.PersistentVector}
         (map #(extract (first (:schema spec)) %) nodes)
@@ -122,11 +126,17 @@
       'maybe (schema->fn (:schema schema))
       nil)))

+(defn schema? [x]
+  (:schema x))
+
 (defn pull [x fns]
   ((apply comp (reverse fns)) x))

 (defn spec [schema & extr]
   (Spec. schema extr))
+
+(defn schema [schema]
+  (Schema. schema))

 (def ->spec spec)


One cleanup.

One cleanup.

--- experiment/src/cortex/experiment/train.clj
+++ experiment/src/cortex/experiment/train.clj
@@ -141,7 +141,6 @@
   [network train-ds test-ds
    & {:keys [batch-size epoch-count
              network-filestem
-             best-network-fn
              optimizer
              reset-score
              force-gpu?


adding monochord

adding monochord

--- src/temperaments/core.clj
+++ src/temperaments/core.clj
@@ -65,7 +65,7 @@
 ;;   (o/connect-external-server 57110)
 ;; )
 (if (not (o/server-connected?))
-  (let [portstr (input "What port should we try?"
+  (let [portstr (input "Which port should we try?"
                        :value 57110)
         port (read-string portstr)]
     (o/connect-external-server port)
@@ -98,38 +98,38 @@
 ;; IMPORTANT: requires the mda-piano ugen to be available on your system

 ;; modified from repo to take freq rather than note
-;; (o/definst piano [freq 220
-;;                   gate 1
-;;                   vel 100
-;;                   decay 0.8
-;;                   release 0.8
-;;                   hard 0.8
-;;                   velhard 0.8
-;;                   muffle 0.8
-;;                   velmuff 0.8
-;;                   velcurve 0.8
-;;                   stereo 0.2
-;;                   tune 0.5
-;;                   random 0.1
-;;                   stretch 0
-;;                   sustain 0]
-;;   (let [snd (o/mda-piano {:freq freq
-;;                           :gate gate
-;;                           :vel vel
-;;                           :decay decay
-;;                           :release release
-;;                           :hard hard
-;;                           :velhard velhard
-;;                           :muffle muffle
-;;                           :velmuff velmuff
-;;                           :velcurve velcurve
-;;                           :stereo stereo
-;;                           :tune tune
-;;                           :random random
-;;                           :stretch stretch
-;;                           :sustain sustain})]
-;;                                         ;(o/detect-silence snd 0.05 :action o/FREE)
-;;     snd))
+(o/definst piano [freq 220
+                  gate 1
+                  vel 100
+                  decay 0.8
+                  release 0.8
+                  hard 0.8
+                  velhard 0.8
+                  muffle 0.8
+                  velmuff 0.8
+                  velcurve 0.8
+                  stereo 0.2
+                  tune 0.5
+                  random 0.1
+                  stretch 0
+                  sustain 0]
+  (let [snd (o/mda-piano {:freq freq
+                          :gate gate
+                          :vel vel
+                          :decay decay
+                          :release release
+                          :hard hard
+                          :velhard velhard
+                          :muffle muffle
+                          :velmuff velmuff
+                          :velcurve velcurve
+                          :stereo stereo
+                          :tune tune
+                          :random random
+                          :stretch stretch
+                          :sustain sustain})]
+                                        ;(o/detect-silence snd 0.05 :action o/FREE)
+    snd))

 ;; modified from repo to take freq rather than note
 (o/definst mooger
@@ -160,7 +160,7 @@
         filt       (o/moog-ff (+ s1 s2) (* cutoff f-env) 3)]
     (* amp filt)))

-(def instruments ["Flute" ;"Piano"
+(def instruments ["Flute" "Piano"
                   "Mooger" "CS80" "SSaw" "Ticker" "Ping"])

 (def inst-cur flute)
@@ -182,7 +182,7 @@
 (defn str->instr [str]
   (case str
     "Flute"   flute,
-    ;"Piano"   piano,
+    "Piano"   piano,
     "Mooger"  mooger,
     "CS80"    cs80,
     "SSaw"    ssaw,
@@ -479,12 +479,18 @@
         (swap! score conj part)))
     [@score, totaltime]))

+(defn play-score
+  ([score] (play-score true))
+  ([score midiq]
+   (let [metro (o/metronome @tempo)]
+     (doseq [[instr & part] score]
+       (play metro (str->instr instr) part {:midi midiq})))))
+
 (defn play-melody [e]
   (let [[score len] (if @melody
                       [@melody 20]
                       (make-score))
-        metro (o/metronome @tempo)
-        endseq (atom '())]
+        metro (o/metronome @tempo)]
     (doseq [[instr & part] score]
       (play metro (str->instr instr) part {:midi true}))
     (o/apply-at (metro len) #(if @repetition (play-melody nil)))
@@ -712,6 +718,53 @@
       (-> f pack! show!)
       f)))

+
+(defn make-mono-panel [id]
+  (let [prefix (s/join ["monochord-" (str id) "-"])
+        tonic-kw (keyword (s/join [prefix "tonic"]))
+        tonic-box (combobox :model keyboard)
+        note-label (label "Ratio: ")
+        note-ratio (text :text "" :editable? true)
+        note-bar (horizontal-panel :items [note-label note-ratio])
+        mode-button (button :text "Consecutive"
+                            :listen [:action (fn [e]
+                                               (let [src (.getSource e)
+                                                     curval (value src)]
+                                                 (if (= curval "Consecutive")
+                                                   (config! src :text "Simultaneous")
+                                                   (config! src :text "Consecutive"))))])
+        play-button (button :text "Play"
+                            :listen [:action
+                                     (fn [e]
+                                       (let [ton (str->midi (value tonic-box))
+                                             tonfreq (midi->freq ton)
+                                             ratiostr (value note-ratio)
+                                             ratio (read-string ratiostr)
+                                             notefreq (* tonfreq ratio)
+                                             tonvec [tonfreq 1]
+                                             notevec [notefreq 1]
+                                             simul (= "Simultaneous"
+                                                      (value mode-button))
+                                             score (if simul
+                                                     [["Default" tonvec]
+                                                      ["Default" notevec]]
+                                                     [["Default" tonvec
+                                                       notevec]])
+                                             metro (o/metronome @tempo)]
+                                         (play-score score false)))])
+        pan (vertical-panel :id :monochord
+                            :size [100 :by 200]
+                            :items [tonic-box note-bar mode-button play-button])
+        f (frame :title (s/join ["Monochord " (str id)])
+                 :id (s/join ["mono-" (str id)])
+                 :content pan)]
+    (-> f pack! show!)))
+
+(defn new-mono [e]
+  (swap! counter inc)
+  (make-mono-panel @counter))
+
+
 (defn make-circles-hash [id]
   (let [root (get-in @melody-map [id :root])
         panel (select root [:#kb])
@@ -823,6 +876,9 @@
                            (button :id :newPanel
                                    :text "New Panel"
                                    :listen [:action new-panel])
+                           (button :id :monoChord
+                                   :text "Monochord"
+                                   :listen [:action new-mono])
                            (button :id :saveButt
                                    :text "Save"
                                    :listen [:action save-pattern])
@@ -862,7 +918,7 @@
                                      :listen [:action melody-chooser])
                            ])))

-(config! control-frame :on-close :exit)
+;(config! control-frame :on-close :exit)

 (defn -main [& args]
   (-> control-frame pack! show!)


Fix missing )

Fix missing )

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -23,7 +23,7 @@

 ; Routes
 (defn- not-found [thing]
-  (route/not-found (str "No thing '" thing "' found"))
+  (route/not-found (str "No thing '" thing "' found")))

 (defn- list-images-route [request bucket]
   (let [json-list-response (json-list-response-builder request)


Wrap reply exceptions

Wrap reply exceptions

--- src/taoensso/carmine/protocol.clj
+++ src/taoensso/carmine/protocol.clj
@@ -159,11 +159,14 @@
                (.readFully in payload 0 payload-size)
                (.readFully in (byte-array 2) 0 2) ; Discard final crlf

-               (case type
-                 :str (String. payload 0 payload-size charset)
-                 :clj (nippy/thaw-from-bytes payload)
-                 :bin [payload payload-size]
-                 :raw payload))))
+               (try
+                 (case type
+                   :str (String. payload 0 payload-size charset)
+                   :clj (nippy/thaw-from-bytes payload)
+                   :bin [payload payload-size]
+                   :raw payload)
+                 (catch Exception e
+                   (Exception. (str "Bad reply data: " (.getMessage e)) e))))))

       \* (let [bulk-count (Integer/parseInt (.readLine in))]
            (utils/repeatedly* bulk-count #(get-basic-reply! in raw?)))


routes changes

routes changes

--- src/handler.clj
+++ src/handler.clj
@@ -25,8 +25,8 @@
            (GET "/login" [:as req] v/login)
            (POST "/login" [req] v/post-login)

-           (GET "/:category-slug" [category-slug] (v/category category-slug))
-           (GET "/:category-slug/:ad-id" [category-slug ad-id] (v/ad category-slug ad-id))
+           (GET "/:category-slug" [category-slug :as req] (v/category category-slug req))
+           (GET "/:category-slug/:ad-id" [category-slug ad-id :as req] (v/ad category-slug ad-id req))


♻ Minimize number of mutations

♻ Minimize number of mutations

--- src/territory_bro/permissions.clj
+++ src/territory_bro/permissions.clj
@@ -9,13 +9,14 @@
 (defn grant [state user-id permission]
   (update-in state [::permissions user-id (second permission)] conj-set (first permission)))

-(defn- revoke-impl [m ks v]
+(defn- disj-in [m ks to-be-removed]
   (if (empty? ks)
-    (disj m v)
-    (let [m (update m (first ks) revoke-impl (rest ks) v)]
-      (if (empty? (get m (first ks)))
-        (dissoc m (first ks))
-        m))))
+    (disj m to-be-removed)
+    (let [k (first ks)
+          v (disj-in (get m k) (rest ks) to-be-removed)]
+      (if (empty? v)
+        (dissoc m k)
+        (assoc m k v)))))

 (defn revoke [state user-id permission]
-  (revoke-impl state [::permissions user-id (second permission)] (first permission)))
+  (disj-in state [::permissions user-id (second permission)] (first permission)))


Removed unused require

Removed unused require

--- collectors/jenkins/src/jenkins_collector/main.clj
+++ collectors/jenkins/src/jenkins_collector/main.clj
@@ -3,7 +3,6 @@
             [clojure.string :as string]
             [cheshire.core :refer :all]
             [clojure.tools.logging :as log]
-            [clojure.tools.cli :refer [parse-opts]]
             [kuona-core.metric.store :as store]
             [kuona-core.util :as util]
             [kuona-core.cli :as cli]


Indentation

Indentation

--- server/src/bond/views/redis.clj
+++ server/src/bond/views/redis.clj
@@ -25,39 +25,39 @@
 ;; learning the language and the idioms.

 (ns bond.views.redis
-  (:require [bond.views.common :as common]
-            [clj-redis.client :as redis])
-  (:use [noir.core :only [defpage]]
-        [cheshire.core]
-        [clojure.set]
-        [clj-time.core :only [now minus plus days date-time year month day]]
-        [hiccup.core :only [html]]))
+    (:require [bond.views.common :as common]
+     [clj-redis.client :as redis])
+    (:use [noir.core :only [defpage]]
+     [cheshire.core]
+     [clojure.set]
+     [clj-time.core :only [now minus plus days date-time year month day]]
+     [hiccup.core :only [html]]))

 ;; ---------------------------------------------------------------------------

 (def db (redis/init {:url (load-string (slurp "bond.config"))}))

 (defn hgetall [key]
-    "Retrieve a Redis hash"
+  "Retrieve a Redis hash"
   (into {}
         (for [[k v] (redis/hgetall db key)]
-        [(keyword k) v])))
+             [(keyword k) v])))

 (defn get-hit-list [num]
   "Get all hits from Redis up to `num`."
-    (loop [count num result '()]
+  (loop [count num result '()]
         (if (zero? count)
-            result
-            (recur
-                (dec count)
-                (cons (hgetall (str "hit:" (Integer/toString count))) result)))))
+          result
+          (recur
+            (dec count)
+            (cons (hgetall (str "hit:" (Integer/toString count))) result)))))

 (defn date-to-string [d]
   "Convert a clj-time datetime object to string."
   (str
-        (year d)
-        (if (< (month d) 10) (str "0" (month d)) (month d))
-        (if (< (day d) 10) (str "0" (day d)) (day d))
+    (year d)
+    (if (< (month d) 10) (str "0" (month d)) (month d))
+    (if (< (day d) 10) (str "0" (day d)) (day d))
     ))

 (defn get-last-month [now-now]
@@ -78,26 +78,26 @@
   ;; ({:added 20120526 :count 2})

   (map (fn [m]
-        {:added m :count (count (get user-items m))})
+           {:added m :count (count (get user-items m))})
        (reverse last-month-items)))

 (defn get-all-data [sorted-hits last-month]
   "Prepare data for serialization"
-    (letfn [(make-timeline [uid]
-                (make-user-timeline (group-by :added (get sorted-hits uid))
-                                    last-month))]
-        (into {} (map (juxt keyword make-timeline)
-                    (keys sorted-hits)))))
+  (letfn [(make-timeline [uid]
+                         (make-user-timeline (group-by :added (get sorted-hits uid))
+                                             last-month))]
+         (into {} (map (juxt keyword make-timeline)
+                       (keys sorted-hits)))))

 ;; Views ---------------------------------------------------------------------

 (defpage "/" []
-    (let [x             (Integer/parseInt (redis/get db "hits"))
-          last-month    (map date-to-string (get-last-month (plus (now) (days 2))))
-          sorted-hits   (sort-hits (get-hit-list x))]
+         (let [x             (Integer/parseInt (redis/get db "hits"))
+               last-month    (map date-to-string (get-last-month (plus (now) (days 2))))
+               sorted-hits   (sort-hits (get-hit-list x))]

-        (common/layout
-            (common/json
-                (generate-string
-                    (get-all-data sorted-hits last-month))))))
+           (common/layout
+             (common/json
+               (generate-string
+                 (get-all-data sorted-hits last-month))))))


Add riemann clojure client dependency

Add riemann clojure client dependency

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -67,6 +67,7 @@
                                org.clojure/clojure]]
                  [io.dropwizard.metrics/metrics-graphite "3.1.2"]
                  [com.aphyr/metrics3-riemann-reporter "0.4.0"]
+                 [riemann-clojure-client "0.4.1"]

                  ;;External system integrations
                  [me.raynes/conch "0.5.2"]


CMR-4247 - Added metedata-db int test for variable cascade deletes.

--- metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/delete_test.clj
+++ metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/delete_test.clj
@@ -32,23 +32,40 @@
 (deftest delete-group-general
   (cd-spec/general-delete-test :access-group ["REG_PROV" "SMAL_PROV" "CMR"]))

-;; test tag delete cascades to tag associations
-(deftest tag-delete-cascades-to-tag-associations
-  (let [tag-collection (util/create-and-save-collection "REG_PROV" 1)
-        tag (util/create-and-save-tag 1)
-        tag-association (util/create-and-save-tag-association tag-collection tag 1 1)
-        tag-association-id (:concept-id tag-association)
-        {status :status tag-association-concept :concept} (util/get-concept-by-id tag-association-id)
-        _ (util/delete-concept (:concept-id tag))
-        {tombstone-status :status tombstone :concept} (util/get-concept-by-id tag-association-id)]
+(deftest tag-delete-cascades-associations
+  (testing "delete cascades to tag associations"
+    (let [tag-collection (util/create-and-save-collection "REG_PROV" 1)
+          tag (util/create-and-save-tag 1)
+          tag-association (util/create-and-save-tag-association tag-collection tag 1 1)
+          tag-association-id (:concept-id tag-association)
+          {status :status tag-association-concept :concept} (util/get-concept-by-id tag-association-id)
+          _ (util/delete-concept (:concept-id tag))
+          {tombstone-status :status tombstone :concept} (util/get-concept-by-id tag-association-id)]
+      (testing "tag association was saved and is not a tombstone"
+        (is (= 200 status))
+        (is (not (:deleted tag-association-concept))))
+      (testing "tag association is tombstoned after tag is deleted"
+        (is (= 200 tombstone-status))
+        (is (:deleted tombstone))))))

-    (testing "tag association was saved and is not a tombstone"
-      (is (= 200 status))
-      (is (not (:deleted tag-association-concept))))
-
-    (testing "tag association is tombstoned after tag is deleted"
-      (is (= 200 tombstone-status))
-      (is (:deleted tombstone)))))
+(deftest variable-delete-cascades-associations
+  (testing "delete cascades to variable associations"
+    (let [variable-collection (util/create-and-save-collection "REG_PROV" 1)
+          variable (util/create-and-save-variable "REG_PROV" 1)
+          variable-association (util/create-and-save-variable-association
+                                variable-collection variable 1 1)
+          variable-association-id (:concept-id variable-association)
+          {status :status variable-association-concept :concept} (util/get-concept-by-id
+                                                                  variable-association-id)
+          _ (util/delete-concept (:concept-id variable))
+          {tombstone-status :status tombstone :concept} (util/get-concept-by-id
+                                                         variable-association-id)]
+      (testing "variable association was saved and is not a tombstone"
+        (is (= 200 status))
+        (is (not (:deleted variable-association-concept))))
+      (testing "variable association is tombstoned after variable is deleted"
+        (is (= 200 tombstone-status))
+        (is (:deleted tombstone))))))

 ;; collections must be tested separately to make sure granules are deleted as well
 (deftest delete-collection-using-delete-end-point-test


CMR-1195: Refactor and finish unit tests for entry-title constraint

--- metadata-db-app/test/cmr/metadata_db/test/services/concept_constraints.clj
+++ metadata-db-app/test/cmr/metadata_db/test/services/concept_constraints.clj
@@ -87,24 +87,31 @@

 (deftest entry-title-unique-constraint-test
   (let [test-concept (make-coll-concept "PROV1" "C1-PROV1" 5 {:entry-title "ET1"})
-        is-valid (partial assert-valid cc/entry-title-unique-constraint test-concept)
+        is-valid (partial assert-valid cc/entry-title-unique-constraint)
         not-valid #(apply assert-invalid %1 cc/entry-title-unique-constraint test-concept %2)]

     (testing "valid cases"
       (testing "with empty database"
-        (is-valid))
+        (is-valid test-concept))
       (testing "another collection with entry title that is deleted is valid"
         (let [other-tombstone (make-coll-tombstone "PROV1" "C2-PROV1" 2 {:entry-title "ET1"})]
-          (is-valid other-tombstone)))
+          (is-valid test-concept other-tombstone)))
       (testing "another provider with the same entry title is valid "
         (let [other-concept (make-coll-concept "PROV2" "C1-PROV1" 5 {:entry-title "ET1"})]
-          (is-valid other-concept)))
+          (is-valid test-concept other-concept)))
       (testing "same concept id but earlier revision id is valid"
         (let [other-concept (make-coll-concept "PROV1" "C1-PROV1" 4 {:entry-title "ET1"})]
-          (is-valid other-concept)))
+          (is-valid test-concept other-concept)))
       (testing "different entry titles are valid"
         (let [other-concept (make-coll-concept "PROV1" "C1-PROV1" 5 {:entry-title "ET2"})]
-          (is-valid other-concept))))
+          (is-valid test-concept other-concept)))
+      (testing "multiple valid concepts are still valid"
+        (is-valid test-concept
+                  (make-coll-concept "PROV1" "C2-PROV1" 1 {:entry-title "ET1"})
+                  (make-coll-tombstone "PROV1" "C2-PROV1" 2 {:entry-title "ET1"})
+                  (make-coll-concept "PROV2" "C1-PROV1" 5 {:entry-title "ET1"})
+                  (make-coll-concept "PROV1" "C1-PROV1" 4 {:entry-title "ET1"})
+                  (make-coll-concept "PROV1" "C1-PROV1" 5 {:entry-title "ET2"}))))

     (testing "invalid cases"
       (testing "same entry title"


Custom stacktrace printing

Custom stacktrace printing

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -137,6 +137,24 @@
                                                 (cljson->clj
                                                   (js/REPLETE_LOAD "cljs/core.js.map")))})))

+(defn unmunge-core-fn [munged-name]
+  (s/replace munged-name #"^cljs\$core\$" "cljs.core/"))
+
+(defn mapped-stacktrace-str
+  "Given a vector representing the canonicalized JavaScript stacktrace and a map
+  of library names to decoded source maps, print the ClojureScript stacktrace .
+  See mapped-stacktrace."
+  ([stacktrace sms]
+   (mapped-stacktrace-str stacktrace sms nil))
+  ([stacktrace sms opts]
+   (with-out-str
+     (doseq [{:keys [function file line column]}
+             (st/mapped-stacktrace stacktrace sms opts)]
+       (println
+         (str (when function (str (unmunge-core-fn function) " "))
+           "(" file (when line (str ":" line))
+           (when column (str ":" column)) ")"))))))
+
 (defn print-error [error]
   (let [cause (.-cause error)]
     (println (.-message cause))
@@ -147,7 +165,7 @@
                                  {:ua-product :safari}
                                  {:output-dir "file://(/goog/..)?"})]
       (println
-        (st/mapped-stacktrace-str
+        (mapped-stacktrace-str
           canonical-stacktrace
           (or (:source-maps @st) {})
           nil)))))


Remove commented code

Remove commented code

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -191,56 +191,3 @@
                  (print-error error))))
            (catch :default e
              (print-error e))))))))
-
-#_(defn read-eval-print-form [form env]
-  (let [_ (when DEBUG (prn "form:" form))]
-    (if (repl-special? form)
-      (case (first form)
-        in-ns (reset! current-ns (second (second form)))
-        doc (if (repl-specials (second form))
-              (repl/print-doc (repl-special-doc (second form)))
-              (repl/print-doc
-               (let [sym (second form)
-                     var (resolve env sym)]
-                 (update (:meta var)
-                         :doc (if (user-interface-idiom-ipad?)
-                                identity
-                                reflow))))))
-      (let [_ (when DEBUG (prn "form:" form))
-            ast (ana/analyze env form)
-            _ (when DEBUG (prn "ast:" ast))
-            js (with-out-str
-                 (ensure
-                  (c/emit ast)))
-            _ (when DEBUG (prn "js:" js))]
-        (try (prn (let [ret (js/eval js)]
-                    (when-not
-                        (or ('#{*1 *2 *3 *e} form)
-                            (ns-form? form))
-                      (set! *3 *2)
-                      (set! *2 *1)
-                      (set! *1 ret))
-                    (reset! current-ns ana/*cljs-ns*)
-                    ret))
-             (catch js/Error e
-               (set! *e e)
-               (print (.-message e) "\n" (first (s/split (.-stack e) #"eval code")))))))))
-
-#_(defn ^:export read-eval-print-orig [lines]
-  (binding [ana/*cljs-ns* @current-ns
-            *ns* (create-ns @current-ns)
-            r/*data-readers* tags/*cljs-data-readers*]
-    (with-compiler-env cenv
-      (let [env (assoc (ana/empty-env) :context :expr
-                                       :ns {:name @current-ns}
-                                       :def-emits-var true)]
-        (try
-          (let [infile (string-push-back-reader lines)
-                eof (js-obj)]
-            (loop []
-              (let [form (r/read {:eof eof :read-cond :allow :features #{:cljs}} infile)]
-                (when-not (identical? eof form)
-                  (read-eval-print-form form env)
-                  (recur)))))
-          (catch js/Error e
-            (println (.-message e))))))))


(TK-369) Use when-let instead of (let [] (when

--- src/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers.clj
@@ -59,8 +59,7 @@
   (proxy [HandlerWrapper] []
     (handle [^String target ^Request base-request
              ^HttpServletRequest request ^HttpServletResponse response]
-      (let [handler (proxy-super getHandler)]
-        (when handler
+      (when-let [handler (proxy-super getHandler)]
           (if-let [normalized-uri
                    (try
                      (normalize-uri-path request)
@@ -79,7 +78,7 @@
              (HttpServletRequestWithAlternateRequestUri.
               request
               normalized-uri)
-             response)))))))
+           response))))))

 (schema/defn ^:always-validate normalized-uri-filter :- Filter
   "Create a servlet filter which provides a normalized request URI on to its


bug fix, mod test case for new schema type

--- test/neb/test/defrag.clj
+++ test/neb/test/defrag.clj
@@ -33,7 +33,7 @@
                  (scan-trunk-and-defragment trunk) => anything)
            (fact "space reclaimed"
                  (< (.getAppendHeaderValue trunk) frag-append-head) => true
-                 (- (.getAppendHeaderValue trunk) frag-append-head) => -54))
+                 (- (.getAppendHeaderValue trunk) frag-append-head) => -60))
          (fact "data did not corrupted"
                (read-cell trunk 1) => (contains a-d)
                (read-cell trunk 4) => (contains a-d)


CI may need more than 2 seconds here

CI may need more than 2 seconds here

--- integration-tests/apps/tx/test/tx/test/listen.clj
+++ integration-tests/apps/tx/test/tx/test/listen.clj
@@ -26,7 +26,7 @@

 (deftest transactional-writes-in-listener-should-work
   (trigger-listener)
-  (is (= "kiwi" (imsg/receive "/queue/test" :timeout 2000)))
+  (is (= "kiwi" (imsg/receive "/queue/test" :timeout 10000)))
   (is (= "starfruit" (imsg/receive "/queue/remote-test")))
   (is (= 1 (:a core/cache))))


use clojure-style names in Coyote docstring.

--- src/overtone/sc/machinery/ugen/metadata/extras/bat.clj
+++ src/overtone/sc/machinery/ugen/metadata/extras/bat.clj
@@ -28,7 +28,7 @@
                   onsets, fast smoother output will exceed the slow
                   smoother and trigger an onset report. If you want to
                   tweak the sensitivity of the tracking, you should try
-                  tweaking this value first. Higher values(approaching
+                  tweaking this value first. Higher values (approaching
                   to 1) makes the tracking more sensitive." }

            {:name "thresh"
@@ -50,31 +50,31 @@

           Coyote compares three different analysis results in parallel
           and tries to report an onset event in the signal. The first
-          phase is amplitude tracking. The trackFall argument is the
+          phase is amplitude tracking. The track-fall argument is the
           60dB convergence time of the decaying signal(the attack time
-          is constant: 0.001, the process is the same with the Amplitude
-          UGen, trackFall is the releaseTime). The output of this
+          is constant: 0.001, the process is the same with the amplitude
+          UGen, track-fall is the release-time). The output of this
           tracking is divided to 3 inputs inside. The first two are
-          smoothers(lowpass filters) with different lag times. slowLag
-          is the lag time of the slow smoother, and the fastLag is the
+          smoothers (lowpass filters) with different lag times. slow-lag
+          is the lag time of the slow smoother, and the fast-lag is the
           lag time of the fast one. The fast smoother is multiplied by a
-          value(fastMul argument) which should be between 0 and 0.9 so
+          value(fast-mul argument) which should be between 0 and 0.9 so
           its output is always below the slow smoother, except in
           onsets. So when an onset occurs, the fast smoother output
           rises quicker than the slow smoother, and when the fast one
-          exceeds the slower at an instant(occurs only at onsets), a
+          exceeds the slower at an instant (occurs only at onsets), a
           trigger is sent to the output from the UGen. For the next
           trigger to happen, a specified time should pass which is
-          defined by the minDur parameter. So minDur defines the minimum
+          defined by the minDur parameter. So min-dur defines the minimum
           time between events/triggers.

-          This approach is extremely fast in response(compared to FFT
+          This approach is extremely fast in response (compared to FFT
           based detectors) when detecting onsets and works well on most
-          contexts(guitar, percussion, etc...). But it has a drawback
+          contexts (guitar, percussion, etc...). But it has a drawback
           when there are sustaining sounds present from the same
           instrument at the moment of an onset, so there is a third unit
           inside that averages the input beginning from the last trigger
-          whose output is also smoothed by a smoother(lag time is also
+          whose output is also smoothed by a smoother (lag time is also
           set to slowLag) and it too is compared with the output of fast
           smoother to make the tracking work better when there are
           sustaining sounds present at the moment of an onset.


In progress work, learning core library

In progress work, learning core library

--- Clojure-Core/clojure_core.clj
+++ Clojure-Core/clojure_core.clj
@@ -1,5 +1,3 @@
 ; Clojure Core Library - Exploring the `clojure.core`, in detail

 ; Ref: https://clojuredocs.org/core-library
-
-;


CMR-5677: Change localcontext to singlethread.

--- dev-system/project.clj
+++ dev-system/project.clj
@@ -69,8 +69,7 @@
                            (println (slurp "resources/text/loading.txt")))}
   :jvm-opts ["-XX:-OmitStackTraceInFastThrow"
              "-Dclojure.compiler.direct-linking=true"
-             ;; Avoid race conditions when creating jruby context.
-             "-Dorg.jruby.embed.localcontext.scope=concurrent"]
+             "-Dorg.jruby.embed.localcontext.scope=singlethread"]
              ;; Uncomment to enable logging in jetty.
              ; "-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StrErrLog"
              ; "-Dorg.eclipse.jetty.LEVEL=INFO"


good so far

good so far

--- test/epicea/vfibers/core_test.clj
+++ test/epicea/vfibers/core_test.clj
@@ -107,3 +107,7 @@
   (is (= (make-node (test-add (dnum 3) (dnum 4)) [3 4 5])
          '(clojure.core/+ 3 4 5))))

+(deftest binding-test
+  (is (not (bind? (dnum 3))))
+  (is (not (bind? (dnum '(+ 4 5))))))
+


Test version of create-graphics. Issue #87.

--- test/snippets/image/rendering.clj
+++ test/snippets/image/rendering.clj
@@ -31,5 +31,10 @@
     (with-graphics gr
       (background 127)
       (ellipse 50 50 80 40))
-    (image gr 0 0)
-    (image gr 120 120)))
+    (image gr 0 0))
+  (let [gr (create-graphics 100 100 :java2d)]
+    (with-graphics gr
+      (background 127)
+      (ellipse 50 50 40 80))
+    (image gr 100 100)))
+


Create graph constant

Create graph constant

--- test/tensorflow_clj/core_test.clj
+++ test/tensorflow_clj/core_test.clj
@@ -24,3 +24,12 @@
                 (.setAttr "shape" (org.tensorflow.Shape/scalar))
                 (.build))]
         x))))
+
+(deftest graph-constant
+  (testing "Graph constant"
+    (let [g (org.tensorflow.Graph.)
+          t (org.tensorflow.Tensor/create 123.0)]
+      (-> (.opBuilder g "Const" "k")
+        (.setAttr "dtype" (.dataType t))
+        (.setAttr "value" t)
+        (.build)))))


[frontend]: Fix visible components sub

[frontend]: Fix visible components sub

--- frontend/src/warehouse/subs.cljs
+++ frontend/src/warehouse/subs.cljs
@@ -10,8 +10,8 @@
  :visible-components
  (fn
    [db _]
-   (if (search/filter-active?)
-     (select-keys (:components db) (map #(get % "ref") (search/filter-search)))
+   (if (search/filter-active? db)
+     (select-keys (:components db) (map #(get % "ref") (search/filter-search db)))
      (:components db))))

 (reg-sub


fix error message on integrations page

fix error message on integrations page

--- frontend/components/stories.cljs
+++ frontend/components/stories.cljs
@@ -87,7 +87,7 @@
              :class (when loading? "disabled")
              :on-click #(do (if-not (seq email)
                               (om/set-state! owner [:notice] {:type "error"
-                                                              :message "Name and email are required."})
+                                                              :message "Email is required."})
                               (do
                                 (om/set-state! owner [:loading?] true)
                                 (go (let [resp (<! (marketo/submit-munchkin-form 1022 {:FirstName first-name


Tidy up

Tidy up

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -81,21 +81,29 @@
               (dom/td #js {:className "well"})
               (dom/td #js {:className "well" :colSpan 12}
                       (dom/div #js {:className "row"}
-                               (dom/div #js {:className "col-md-4"} "Evolves to:")
-                               (dom/div #js {:className "col-md-8"} (if (lib/pokemon-evolution pokemon)
-                                                                      (lib/pokemon-evolution pokemon)
-                                                                      "None")))
-                      (dom/div #js {:className "row"}
-                               (dom/div #js {:className "col-md-4"} "Available Candy:")
-                               (dom/div #js {:className "col-md-8"} (:candy pokemon)))
-                      (dom/div #js {:className "row"}
-                               (dom/div #js {:className "col-md-4"} "Available Evolutions:")
-                               (dom/div #js {:className "col-md-2"} (lib/calc-evolutions pokemon))
-                               (if (not= (lib/calc-evolutions pokemon) 0)
-                                 (dom/div #js {:className "col-md-6"} (dom/button #js {:className "btn btn-sm btn-info"
-                                                                                :type      "button"
-                                                                                :onClick   #(evolutions/evolve (:id pokemon))}
-                                                                                "Evolve!")))))))))
+                               (dom/div #js {:className "col-md-6"}
+                                        (dom/div #js {:className "row"}
+                                                 (dom/div #js {:className "col-md-4"} "Health:")
+                                                 (dom/div #js {:className "col-md-8"} (:health pokemon)))
+                                        (dom/div #js {:className "row"}
+                                                 (dom/div #js {:className "col-md-4"} "Evolves to:")
+                                                 (dom/div #js {:className "col-md-8"} (if (lib/pokemon-evolution pokemon)
+                                                                                (lib/pokemon-evolution pokemon)
+                                                                                "None")))
+                                        (dom/div #js {:className "row"}
+                                                 (dom/div #js {:className "col-md-4"} "Available Candy:")
+                                                 (dom/div #js {:className "col-md-8"} (:candy pokemon)))
+                                        (dom/div #js {:className "row"}
+                                                 (dom/div #js {:className "col-md-4"} "Available Evolutions:")
+                                                 (dom/div #js {:className "col-md-2"} (lib/calc-evolutions pokemon))))
+                               (dom/div #js {:className "col-md-6"}
+                                        (dom/div #js {:className "row"}
+                                                 (dom/div #js {:className "col-md-12"}
+                                                          (if (not= (lib/calc-evolutions pokemon) 0)
+                                                            (dom/button #js {:className "btn btn-sm btn-info"
+                                                                             :type      "button"
+                                                                             :onClick   #(evolutions/evolve (:id pokemon))}
+                                                                        "Evolve!")))))))))))
 (def poketable-entry-details (om/factory PokeTableEntryDetails {}))

 (defui PokeTableEntry


Add search command placeholder to tool.

Add search command placeholder to tool.

--- tool/vault/tool/main.clj
+++ tool/vault/tool/main.clj
@@ -90,7 +90,13 @@
       (command "update <entity> <type> [args]"
         "Apply an update to an existing object."

-        (action not-yet-implemented)))))
+        (action not-yet-implemented)))
+
+
+    (command "search <query>"
+      "Search entity attributes for properties."
+
+      (action not-yet-implemented))))

 (defn -main [& args]


Fix accessing js state in optimized build

--- test/reagenttest/testreagent.cljs
+++ test/reagenttest/testreagent.cljs
@@ -1282,7 +1282,7 @@
                                                             ;; "Expensive" calculation based on the props
                                                             #js {:v (string/join " " (repeat (inc (:value props)) "foo"))})
                             :render (fn [this]
-                                      (r/as-element [:p "Value " (.-v (.-state this))]))})
+                                      (r/as-element [:p "Value " (gobj/get (.-state this) "v")]))})
           component (fn []
                       [pure-component {:value @prop}])]
       (with-mounted-component [component]