Added layzee.adapters.twitter.firehose/filter overload

--- src/layzee/adapters/twitter/firehose.clj
+++ src/layzee/adapters/twitter/firehose.clj
@@ -70,13 +70,17 @@
      {}
      callback)))

-(defn filter[oauth-credential callback] ;; https://dev.twitter.com/streaming/reference/post/statuses/filter
-  (let [url "https://stream.twitter.com/1.1/statuses/filter.json" body { "track" "lazyweb,kanye,xero" }]
-    (println (format "Connecting to <%s> with body <%s> (See https://dev.twitter.com/streaming/reference/post/statuses/filter)" url body))
-    (listen
-     url
-     :post
-     { "Authorization" (oauth/sign url "POST" body oauth-credential)}
-     body
-     callback)))
+(defn filter
+  ([oauth-credential callback]
+     (filter oauth-credential callback ["lazyweb" "kanye", "xero"]))
+
+  ([oauth-credential callback track] ;; https://dev.twitter.com/streaming/reference/post/statuses/filter
+     (let [url "https://stream.twitter.com/1.1/statuses/filter.json" body { "track" (clojure.string/join "," track) }]
+       (println (format "Connecting to <%s> with body <%s> (See https://dev.twitter.com/streaming/reference/post/statuses/filter)" url body))
+       (listen
+        url
+        :post
+        { "Authorization" (oauth/sign url "POST" body oauth-credential)}
+        body
+        callback))))


Fix call to lein/pom

Fix call to lein/pom

--- src/leiningen/pallet_release/release.clj
+++ src/leiningen/pallet_release/release.clj
@@ -84,7 +84,7 @@
   (println)
   (git/release-start new-version)
   (lein/update-versions project old-version new-version)
-  (lein/pom)                        ; checks for snapshot dependencies
+  (lein/pom project) ; checks for snapshot dependencies
   (update-release-notes old-version new-version)
   (spit ".pallet-release" new-version)
   (println)


Add tests for secretbox consts

Add tests for secretbox consts

--- test/caesium/crypto/secretbox_test.clj
+++ test/caesium/crypto/secretbox_test.clj
@@ -4,6 +4,12 @@
    [caesium.util :as u]
    [caesium.vectors :as v]
    [clojure.test :refer :all]))
+
+(deftest const-tests
+  (is (= 32 s/keybytes))
+  (is (= 24 s/noncebytes))
+  (is (= 16 s/macbytes))
+  (is (= "xsalsa20poly1305" s/primitive)))

 (def ptext (v/hex-resource "vectors/secretbox/plaintext"))
 (def secret-key (byte-array (range 32)))


indenting

indenting

--- test/celestial/integration/proxmox.clj
+++ test/celestial/integration/proxmox.clj
@@ -1,23 +1,23 @@
 (ns celestial.integration.proxmox
   "Integration tests assume a proxmox vm with local address make sure to configure it"
   (:require
-     [hypervisors.networking :refer (clear-range initialize-networking)]
-     [supernal.sshj :refer (execute)]
-     [flatland.useful.map :refer (dissoc-in*)]
-     [celestial.common :refer (slurp-edn)]
-     [celestial.fixtures.core :refer (with-defaults with-conf) :as f]
-     [celestial.fixtures.data :as d]
-     [celestial.model :refer (vconstruct)])
+   [hypervisors.networking :refer (clear-range initialize-networking)]
+   [supernal.sshj :refer (execute)]
+   [flatland.useful.map :refer (dissoc-in*)]
+   [celestial.common :refer (slurp-edn)]
+   [celestial.fixtures.core :refer (with-defaults with-conf) :as f]
+   [celestial.fixtures.data :as d]
+   [celestial.model :refer (vconstruct)])
   (:use midje.sweet proxmox.provider))

 (def fake-id (update-in d/redis-prox-spec [:proxmox :vmid] (fn [o] 190)))

 (with-defaults
-  (fact "stoping and deleting missing clients" :integration :proxmox
-         (let [ct (vconstruct fake-id)]
-           (.stop ct)
-           (.delete ct))))
+ (fact "stoping and deleting missing clients" :integration :proxmox
+       (let [ct (vconstruct fake-id)]
+         (.stop ct)
+         (.delete ct))))

 (defn running-seq [{:keys [network] :as ct}]
   (.stop ct)
@@ -31,28 +31,28 @@
     (.delete ct*)))

 (with-defaults
-  (with-state-changes [(before :facts (do (clear-range :proxmox) (initialize-networking)))]
+ (with-state-changes [(before :facts (do (clear-range :proxmox) (initialize-networking)))]
     (fact "non generated ip" :integration :proxmox :generators
-          (running-seq (vconstruct d/redis-prox-spec)))
+       (running-seq (vconstruct d/redis-prox-spec)))

-    (fact "ip and vmid generated" :integration :proxmox :generators
-          (running-seq
-            (vconstruct (-> d/redis-prox-spec (dissoc-in* [:machine :ip]) (dissoc-in* [:proxmox :vmid])))))
+     (fact "ip and vmid generated" :integration :proxmox :generators
+       (running-seq
+         (vconstruct (-> d/redis-prox-spec (dissoc-in* [:machine :ip]) (dissoc-in* [:proxmox :vmid])))))

-    (fact "bridged address" :integration :proxmox :bridge
-          (running-seq (vconstruct d/redis-bridged-prox)))
+     (fact "bridged address" :integration :proxmox :bridge
+       (running-seq (vconstruct d/redis-bridged-prox)))

-    (fact "cluster" :integration :proxmox :bridge :cluster
-          (with-conf d/clustered-prox
-            (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:proxmox :node] "proxmox-b")))))
+     (fact "cluster" :integration :proxmox :bridge :cluster
+       (with-conf d/clustered-prox
+         (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:proxmox :node] "proxmox-b")))))

-    #_(fact "proxmox 3" :integration :proxmox-3
-            (with-conf d/proxmox-3
-              (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:proxmox :node] "proxmox-3")))))
+     (fact "proxmox 3" :integration :proxmox-3
+       (with-conf d/proxmox-3
+         (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:proxmox :node] "proxmox-3")))))

-    (fact "centos bridge" :integration :proxmox :bridge :centos
-          (with-conf d/clustered-prox
-            (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:machine :os] :centos-6)))))))
+     (fact "centos bridge" :integration :proxmox :bridge :centos
+       (with-conf d/clustered-prox
+         (running-seq (vconstruct (assoc-in d/redis-bridged-prox [:machine :os] :centos-6)))))))


Add a simple test that in-memory databases are isolated.

--- test/datomish/promise_sqlite_test.cljs
+++ test/datomish/promise_sqlite_test.cljs
@@ -84,3 +84,15 @@
           (finally
             (<? (s/close db))))
         ))))
+
+(deftest test-tests-are-isolated
+  (go-pair
+    (let [conn-1 (<? (s/<sqlite-connection ""))
+          conn-2 (<? (s/<sqlite-connection ""))]
+      (is (not (= conn-1 conn-2)))
+      (<? (s/execute! conn-1 ["CREATE TABLE foo (x INTEGER)"]))
+      (<? (s/execute! conn-2 ["CREATE TABLE foo (x INTEGER)"]))
+      (<? (s/execute! conn-1 ["INSERT INTO foo (x) VALUES (5)"]))
+      (is (empty? (<? (s/all-rows conn-2 ["SELECT x FROM foo"]))))
+      (s/close conn-1)
+      (s/close conn-2))))


fix compiler warning

fix compiler warning

--- src/main/clojure/org/dada/core.clj
+++ src/main/clojure/org/dada/core.clj
@@ -56,10 +56,8 @@
    view
    '()
    '()
-   (map
-    #(Update. % nil)
-    (.deregisterView model view))
-   view))
+   (map #(Update. % nil) (.deregisterView model view)))
+   view)

 (defn collection [& args]
   (let [array-list (ArrayList. #^Integer (count args))]


RS | 6 | Update journey tests to include unsharing profile card

--- test/stonecutter_journey_test/test.clj
+++ test/stonecutter_journey_test/test.clj
@@ -48,8 +48,13 @@
 (def stonecutter-register-password-input ".func--password__input")
 (def stonecutter-register-confirm-password-input ".func--confirm-password__input")
 (def stonecutter-register-create-profile-button ".func--create-profile__button")
+(def stonecutter-profile-page-body ".func--profile-page")
+(def stonecutter-profile-unshare-profile-card-link ".func--app-item__unshare-link")
 (def stonecutter-profile-created-page-body ".func--profile-created-page")
 (def stonecutter-profile-created-next-link ".func--profile-created-next__button")
+(def stonecutter-profile-deleted-page-body ".func--profile-deleted-page")
+(def stonecutter-unshare-profile-card-page-body ".func--unshare-profile-card-page")
+(def stonecutter-unshare-profile-card-button ".func--unshare-profile-card__button")
 (def stonecutter-authorise-page-body ".func--authorise-page")
 (def stonecutter-authorise-failure-body ".func--authorise-failure-page")
 (def stonecutter-authorise-cancel-link ".func--authorise-cancel__link")
@@ -57,7 +62,6 @@
 (def stonecutter-authorise-share-profile-button ".func--authorise-share-profile__button")
 (def stonecutter-delete-account-page-body ".func--delete-account-page")
 (def stonecutter-delete-account-button ".func--delete-account__button")
-(def stonecutter-profile-deleted-page-body ".func--profile-deleted-page")

 (def client-home-page-body ".func--home-page")
 (def client-poll-page-body ".func--poll-page")
@@ -88,12 +92,13 @@
     (go-to-delete-account)
     (confirm-delete-account)))

-(defn logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-again []
+(defn logout-of-client-and-click-sign-in-to-vote []
   (wd/click client-logout-link)
   (wait-for-selector client-home-page-body)
-  (wd/click "button")
-  (wait-for-selector stonecutter-authorise-page-body)
-  (wd/click stonecutter-authorise-share-profile-button)
+  (wd/click "button"))
+
+(defn logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-or-authorise-app-again []
+  (logout-of-client-and-click-sign-in-to-vote)
   (wait-for-selector client-poll-page-body))

 (against-background
@@ -167,12 +172,39 @@
           (wd/current-url) => (contains "stonecutter-client.herokuapp.com/voting")
           (wd/page-source) => (contains "stonecutter-journey-test@tw.com"))

-    (fact "logging out in client app and logging in again will skip sign in page (repeats twice as there was a bug)"
-          (logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-again)
+    (fact "logging out in client app and logging in again will skip sign in page
+          and authorise page (repeats twice as there was a bug)"
+          (logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-or-authorise-app-again)
           (wd/current-url) => (contains "stonecutter-client.herokuapp.com/voting")
           (wd/page-source) => (contains "stonecutter-journey-test@tw.com")

-          (logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-again)
+          (logout-of-client-and-go-through-auth-flow-again-without-having-to-sign-in-or-authorise-app-again)
+          (wd/current-url) => (contains "stonecutter-client.herokuapp.com/voting")
+          (wd/page-source) => (contains "stonecutter-journey-test@tw.com"))
+
+    (fact "can unshare profile card and then logging in to client app will require authorising the app again"
+          ;; unshare profile card
+          (wd/to "https://stonecutter.herokuapp.com/profile")
+          (wait-for-selector stonecutter-profile-page-body)
+          (screenshot "stonecutter_profile_with_client_app")
+          (wd/click stonecutter-profile-unshare-profile-card-link)
+          (wait-for-selector stonecutter-unshare-profile-card-page-body)
+          (screenshot "stonecutter_unshare_profile_card")
+          (wd/click stonecutter-unshare-profile-card-button)
+          (wait-for-selector stonecutter-profile-page-body)
+          (screenshot "stonecutter_profile_without_client_app")
+
+          ;; login to client app
+          (wd/to "https://stonecutter-client.herokuapp.com")
+          (logout-of-client-and-click-sign-in-to-vote)
+          (wait-for-selector stonecutter-authorise-page-body)
+          (screenshot "stonecutter_authorisation_form_again")
+          (wd/current-url) => (contains "stonecutter.herokuapp.com/authorisation")
+
+          ;; authorise client app
+          (wd/click stonecutter-authorise-share-profile-button)
+          (wait-for-selector client-poll-page-body)
+          (screenshot "client_voting_page_again")
           (wd/current-url) => (contains "stonecutter-client.herokuapp.com/voting")
           (wd/page-source) => (contains "stonecutter-journey-test@tw.com"))

@@ -187,8 +219,7 @@

     (fact "can continue to authorise app even when registering a new account"
           (wd/to "https://stonecutter-client.herokuapp.com")
-          (wait-for-selector client-home-page-body)
-          (wd/click "button")
+          (logout-of-client-and-click-sign-in-to-vote)
           (wait-for-selector stonecutter-sign-in-page-body)
           (wd/click stonecutter-sign-in-page-register-link)
           (wait-for-selector stonecutter-register-page-body)
@@ -216,4 +247,5 @@
           (wd/current-url) => (contains "stonecutter.herokuapp.com/profile-deleted"))

     (catch Exception e
-      (screenshot "ERROR"))))
+      (screenshot "ERROR")
+      (throw e))))


Story ID: RPC-236 Summary: simple varargs mocking test

--- test/untangled_spec/provided_spec.cljc
+++ test/untangled_spec/provided_spec.cljc
@@ -168,6 +168,8 @@

 (defn my-square [x] (* x x))

+(defn my-varargs-sum [n & nums] (apply + n nums))
+
 (specification "provided and when-mocking macros"
                (behavior "cause stubbing to work"
                          (provided "that functions are mocked the correct number of times, with the correct output values."
@@ -205,6 +207,14 @@
                                    )
                          )

+               (provided "we can mock a var args function"
+                 (my-varargs-sum x y) =1x=> [x y]
+                 (my-varargs-sum x y z) => [x y z]
+                 (assertions
+                   (my-varargs-sum 1 2) => [1 2]
+                   (my-varargs-sum 1 2 3) => [1 2 3]
+                   ))
+
                (provided "allow stubs to throw exceptions"
                          (my-square n) => (throw (ex-info "throw!" {}))
                          (is (thrown? #?(:clj ExceptionInfo


Use :uberjar profile

Use :uberjar profile

--- resources/leiningen/new/play_cljc/project.clj
+++ resources/leiningen/new/play_cljc/project.clj
@@ -3,29 +3,29 @@
                              :sign-releases false}]]
   :clean-targets ^{:protect false} ["target"]
   :dependencies [[org.clojure/clojure "1.10.1"]
-                 [edna "1.6.0"]
-                 [play-cljc "0.8.4"]
-                 [org.lwjgl/lwjgl "3.2.3"]
-                 [org.lwjgl/lwjgl-glfw "3.2.3"]
-                 [org.lwjgl/lwjgl-opengl "3.2.3"]
-                 [org.lwjgl/lwjgl-stb "3.2.3"]
-                 [org.lwjgl/lwjgl "3.2.3" :classifier "natives-linux"]
-                 [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-linux"]
-                 [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-linux"]
-                 [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-linux"]
-                 [org.lwjgl/lwjgl "3.2.3" :classifier "natives-macos"]
-                 [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-macos"]
-                 [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-macos"]
-                 [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-macos"]
-                 [org.lwjgl/lwjgl "3.2.3" :classifier "natives-windows"]
-                 [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-windows"]
-                 [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-windows"]
-                 [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-windows"]]
+                 [edna "1.6.0"]]
   ; on Mac OS, you need to uncomment this!
   ;:jvm-opts ["-XstartOnFirstThread"]
   :profiles {:dev {:main {{name}}.start-dev
                    :dependencies [[paravim "RELEASE"]
                                   [orchestra "2018.12.06-2"]
-                                  [expound "0.7.2"]]}}
-  :main {{name}}.start
-  :aot [{{name}}.start])
+                                  [expound "0.7.2"]]}
+             :uberjar {:main {{name}}.start
+                       :aot [{{name}}.start]
+                       :dependencies [[play-cljc "0.8.4"]
+                                      [org.lwjgl/lwjgl "3.2.3"]
+                                      [org.lwjgl/lwjgl-glfw "3.2.3"]
+                                      [org.lwjgl/lwjgl-opengl "3.2.3"]
+                                      [org.lwjgl/lwjgl-stb "3.2.3"]
+                                      [org.lwjgl/lwjgl "3.2.3" :classifier "natives-linux"]
+                                      [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-linux"]
+                                      [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-linux"]
+                                      [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-linux"]
+                                      [org.lwjgl/lwjgl "3.2.3" :classifier "natives-macos"]
+                                      [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-macos"]
+                                      [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-macos"]
+                                      [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-macos"]
+                                      [org.lwjgl/lwjgl "3.2.3" :classifier "natives-windows"]
+                                      [org.lwjgl/lwjgl-glfw "3.2.3" :classifier "natives-windows"]
+                                      [org.lwjgl/lwjgl-opengl "3.2.3" :classifier "natives-windows"]
+                                      [org.lwjgl/lwjgl-stb "3.2.3" :classifier "natives-windows"]]}})


cleaned up namespace.

cleaned up namespace.

--- src/clj/forma/source/fire.clj
+++ src/clj/forma/source/fire.clj
@@ -1,6 +1,6 @@
 (ns forma.source.fire
   (:use cascalog.api
-        [forma.date-time :only (datetime->period current-period)]
+        [forma.date-time :only (datetime->period)]
         [clojure.string :only (split)]
         [forma.source.modis :only (latlon->modis
                                    hv->tilestring)])


output a map instead of vec

output a map instead of vec

--- src/clj/hdfs_cleaner/hdfs.clj
+++ src/clj/hdfs_cleaner/hdfs.clj
@@ -3,4 +3,7 @@
            (org.apache.hadoop.fs Path)))

 (defn scan [^String path]
-  (into [] (HDFS/scan (Path. (str hdfs-cleaner.config/hdfs-server path)))))+  (let [start-time (System/currentTimeMillis)]
+    {:result (into [] (HDFS/scan (Path. (str hdfs-cleaner.config/hdfs-server path))))
+     :start-time start-time
+     :end-time (System/currentTimeMillis)}))


test for invalid surge target - no token this turn

--- src/clj/test/cards-events.clj
+++ src/clj/test/cards-events.clj
@@ -129,4 +129,16 @@

 (deftest surge-target-no-token-this-turn
   "Don't fire surge if target does not have virus counter flag set"
-  )+  (do-game
+    (new-game (default-corp)
+              (default-runner [(qty "Imp" 1) (qty "Surge" 1)]))
+    (take-credits state :corp)
+    (play-from-hand state :runner "Imp")
+    (let [imp (get-in @state [:runner :rig :program 0])]
+      (is (= 2 (get-in imp [:counter])))
+      (take-credits state :runner 2)
+      (take-credits state :corp)
+      (play-from-hand state :runner "Surge")
+      (prompt-select :runner imp)
+      (is (= 2 (get-in (refresh imp) [:counter])))
+      )))


New colors default to white

New colors default to white

--- src/cljs/koeeoadi/parser.cljs
+++ src/cljs/koeeoadi/parser.cljs
@@ -161,7 +161,7 @@
      (let [st      @state
            new-id  (new-color-id (:colors/list st))]
        (reset! state (-> @state
-                       (assoc-in [:colors/by-id new-id] {:color/id new-id})
+                       (assoc-in [:colors/by-id new-id] {:color/id new-id :color/rgb "#FFFFFF"})
                        (update :colors/list conj [:colors/by-id new-id])))))})

 (defmethod mutate 'color/remove


Fix an issue with the tests

Fix an issue with the tests

--- src/clojure/fault/service.clj
+++ src/clojure/fault/service.clj
@@ -74,13 +74,19 @@
   (submit-action [this action-fn timeout-millis]
     (submit-action this action-fn nil timeout-millis))
   (submit-action [_ action-fn callback timeout-millis]
-    (try (f/->CLJResilientFuture
-           (.promise ^ResilientFuture (.submitAction executor
-                                                     ^ResilientAction (wrap-action-fn action-fn)
-                                                     ^ResilientCallback (wrap-callback-fn callback)
-                                                     ^long (long timeout-millis))))
-         (catch RejectedActionException e
-           (f/rejected-action-future (.reason e)))))
+    (try
+      (f/->CLJResilientFuture
+        (.promise ^ResilientFuture
+                  (if callback
+                    (.submitAction executor
+                                   ^ResilientAction (wrap-action-fn action-fn)
+                                   ^ResilientCallback (wrap-callback-fn callback)
+                                   ^long (long timeout-millis))
+                    (.submitAction executor
+                                   ^ResilientAction (wrap-action-fn action-fn)
+                                   ^long (long timeout-millis)))))
+      (catch RejectedActionException e
+        (f/rejected-action-future (.reason e)))))
   (perform-action [_ action-fn]
     (try (f/->CLJResilientFuture
            ^ResilientPromise (.performAction executor (wrap-action-fn action-fn)))


Added printing of genome sizes

Added printing of genome sizes

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -245,6 +245,7 @@
       :ifs (println "IFS-error:" (:weighted-error best))
       nil)
     (when print-history (println "History:" (not-lazy (:history best))))
+    (println "Genome size:" (count (:genome best)))
     (println "Size:" (count-points (:program best)))
     (printf "Percent parens: %.3f\n" (double (/ (count-parens (:program best)) (count-points (:program best))))) ;Number of (open) parens / points
     (println "--- Population Statistics ---")
@@ -261,6 +262,9 @@
     (when print-errors (println "Error minima by case:"
                                 (apply map (fn [& args] (apply min args))
                                        (map :errors population))))
+    (println "Average genome size in population (length):"
+             (*' 1.0 (/ (reduce +' (map count (map :genome sorted)))
+                        (count population))))
     (println "Average program size in population (points):"
              (*' 1.0 (/ (reduce +' (map count-points (map :program sorted)))
                         (count population))))


Cleaned up printing of training cases.

Cleaned up printing of training cases.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -38,9 +38,11 @@

 (defn print-params [push-argmap]
   (doseq [[param val] push-argmap]
-    (if (= param :random-seed)
-      (println (name param) "=" (random/seed-to-string val))
-      (println (name param) "=" val))))
+    (println (name param) "="
+             (cond
+               (= param :random-seed) (random/seed-to-string val)
+               (= param :training-cases) (pr-str val)
+               :else val))))

 (defn print-genome
   [individual argmap]
@@ -356,6 +358,11 @@
         sorted (sort-by err-fn < population)
         err-fn-best (if (not= parent-selection :downsampled-lexicase)
                       (first sorted)
+                      ; This tests each individual that passes current generation's subsampled training
+                      ; cases on all training cases, and only treats it as winner if it
+                      ; passes all of those as well. Otherwise, just returns first individual
+                      ; if none pass all subsampled cases, or random individual that passes
+                      ; all subsampled cases but not all training cases.
                       (error-function
                        (loop [sorted-individuals sorted]
                          (if (empty? (rest sorted-individuals))


added slash to All url as in reference TodoMVC; added error log and fallback to All visibility on unknown tokens

--- src/frontend/todos.cljs
+++ src/frontend/todos.cljs
@@ -130,16 +130,22 @@

 ;;;;;;;;;;;;;;;;;;;;;;;; View model
 (def -visibility-spec
-  [{:key :all :title "All" :href "#" :token ""}
-   {:key :active :title "Active" :href "#/active" :token "/active"}
-   {:key :completed :title "Completed" :href "#/completed" :token "/completed"}])
+  ; multiple tokens are supported mostly for :all case:
+  ; on navigating to base url the token is "", but on clicking the link the token becomes "/"
+  [{:key :all :title "All" :href "#/" :tokens #{"" "/"}}
+   {:key :active :title "Active" :href "#/active" :tokens #{"/active"}}
+   {:key :completed :title "Completed" :href "#/completed" :tokens #{"/completed"}}])

 (defn -visibility
   [model]
-  (->> -visibility-spec
-       (filter #(= (:token %) (::routing/token model)))
-       first
-       :key))
+  (if-let [result (->> -visibility-spec
+                    (filter #(contains? (:tokens %) (::routing/token model)))
+                    first
+                    :key)]
+    result
+    (do
+      (.error js/console "Could not determine visibility for token" (pr-str (::routing/token model)))
+      (-> -visibility-spec first :key))))

 (defn view-model
   [model]


Changed 'chapter' page to display various actions

--- src/hurvinek/html_renderer.clj
+++ src/hurvinek/html_renderer.clj
@@ -101,7 +101,9 @@
                 [:table {:style "border-collapse: separate; border-spacing: 10px;"}
                     (for [chapter chapter-list]
                         [:tr
-                            [:td [:a {:href (str "?product-id=" product-id "&chapter-id=" (:id chapter))} (:name chapter)]]])
+                            [:td (:name chapter)]
+                            [:td [:a {:href (str "?product-id=" product-id "&chapter-id=" (:id chapter) "&action=rename-chapter")} "rename"]]
+                            [:td [:a {:href (str "?product-id=" product-id "&chapter-id=" (:id chapter) "&action=grouplist")} "group list"]]])
                 ]]
                 (render-html-footer)
             ] ; </div class="container">


update embedded youtube video id

update embedded youtube video id

--- src/norman_sicily_static/index.clj
+++ src/norman_sicily_static/index.clj
@@ -6,4 +6,4 @@
    [:div {:class "row"}
     [:div {:class "col-lg-12"}
      [:div {:class "center-block", :style "width:712px;height:400px;"}
-      [:iframe {:style "overflow:hidden;height:100%;width:100%", :width "100%", :height "100%", :src "http://www.youtube.com/embed/65v2GR6SCd0?rel=0&modestbranding=1&showinfo=0", :frameborder "0", :allowfullscreen true}]]]]])
+      [:iframe {:style "overflow:hidden;height:100%;width:100%", :width "100%", :height "100%", :src "http://www.youtube.com/embed/0brgzGyg59s?rel=0&modestbranding=1&showinfo=0", :frameborder "0", :allowfullscreen true}]]]]])


Revert "try to speed up with pmap"

Revert "try to speed up with pmap"

This reverts commit 988f739be6c36f41369471e08503f23b5d988476.

--- src/leiningen/leinsync/commands.clj
+++ src/leiningen/leinsync/commands.clj
@@ -11,7 +11,7 @@

 (defn pull-rebase-all! [_ projects _]
   (-> #(u/run-command-on (pr/->target-project-path %) git/pull-rebase! %)
-      (pmap projects)
+      (map projects)
       (git/log-git-status)))

 (defn push-all! [_ projects _]
@@ -32,25 +32,26 @@
                         (u/ask-user))
         projects-desc (pr/read-all-target-project-clj projects)]
     (-> #(u/run-command-on (pr/->target-project-path %) git/commit-project! % commit-msg ((keyword %) projects-desc))
-        (pmap projects)
+        (map projects)
         (git/log-git-status "\n*To push        : lein sync" projects-str "--push"))))

 (defn status-all [_ projects _]
   (let [projects-desc (pr/read-all-target-project-clj projects)]
     (-> #(u/run-command-on (pr/->target-project-path %) git/details-status % ((keyword %) projects-desc))
-        (pmap projects)
+        (map projects)
         (git/log-git-status))))

 (defn reset-all! [_ projects _]
   (-> #(u/run-command-on (pr/->target-project-path %) git/reset-project! %)
-      (pmap projects)
+      (map projects)
       (git/log-git-status)))

 (defn list [_ target-projects {source-project :name}]
   (let [all-projects-desc (-> target-projects
                               (conj source-project)
                               (pr/read-all-target-project-clj))]
-    (pmap #(l/list-resources all-projects-desc %) [ns/namespace-def ns/resource-def])))
+    (l/list-resources all-projects-desc ns/namespace-def)
+    (l/list-resources all-projects-desc ns/resource-def)))

 (defn update-projects! [_ target-projects source-project-desc]
   (let [target-projects-desc (pr/read-all-target-project-clj target-projects)
@@ -63,9 +64,11 @@
   (let [all-projects-desc (-> target-projects
                               (conj source-project)
                               (pr/read-all-target-project-clj))]
-    (cond
-      (= :global arg) (deps/check-dependencies-of all-projects-desc [:dependencies])
-      :else (deps/check-dependencies-of all-projects-desc [:profiles arg :dependencies]))))
+    (cond (= :global arg)
+          (deps/check-dependencies-of all-projects-desc [:dependencies])
+
+          :else
+          (deps/check-dependencies-of all-projects-desc [:profiles arg :dependencies]))))

 (def SYNC-COMMANDS {:default {:update "" :test ""}
                     :deps    deps


Modified expired-session? to handle change in cljs-ajax text-status

--- src-cljs/arcis/utils.cljs
+++ src-cljs/arcis/utils.cljs
@@ -1,6 +1,6 @@
 ;;      Filename: utils.cljs
 ;; Creation Date: Sunday, 05 July 2015 06:42 PM AEST
-;; Last Modified: Saturday, 05 September 2015 09:21 PM AEST
+;; Last Modified: Saturday, 05 September 2015 10:11 PM AEST
 ;;        Author: Tim Cross <theophilusx AT gmail.com>
 ;;   Description:
 ;;
@@ -67,7 +67,8 @@
   (.log js/console (str "expired-session? status = " status
                         " text = " status-text))
   (and (= 419 status)
-       (= "session-timeout" status-text)))
+       (or (= "session-timeout" status-text)
+           (= "419" status-text))))

 (defn active-tab []
   (session/get-in [(session/get :page) :tab]))


fix supervisor test failures

fix supervisor test failures

--- storm-core/test/clj/backtype/storm/supervisor_test.clj
+++ storm-core/test/clj/backtype/storm/supervisor_test.clj
@@ -261,6 +261,7 @@
                                 (str "-Dstorm.id=" mock-storm-id)
                                 (str "-Dworker.id=" mock-worker-id)
                                 (str "-Dworker.port=" mock-port)
+                               "-Dstorm.log.dir=/logs"
                                "-Dlog4j.configurationFile=/log4j2/worker.xml"
                                "backtype.storm.LogWriter"]
                                [(supervisor/java-cmd) "-server"]
@@ -392,6 +393,7 @@
                                 " '-Dstorm.id=" mock-storm-id "'"
                                 " '-Dworker.id=" mock-worker-id "'"
                                 " '-Dworker.port=" mock-port "'"
+                                " '-Dstorm.log.dir=/logs'"
                                 " '-Dlog4j.configurationFile=/log4j2/worker.xml'"
                                 " 'backtype.storm.LogWriter'"
                                 " 'java' '-server'"


Get numeric cue var gauges working.

Get numeric cue var gauges working.

Remaining: Boolean, color, and perhaps the new menu idea, which will
work for metronome sync selection.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -1054,10 +1054,10 @@
           (draw-encoder-button-label controller (inc (* x 2)) 1
                                      (best-cue-variable-name controller (second cue-vars) 1) white-color))))))

-(defn- fit-cue-variable-value
-  "Truncates the current value of a cue variable to fit available
-  space."
-  [controller cue v len effect-id]
+(defn- format-cue-variable-value
+  "Translates a cue variable to a string format that will look good
+  and be meaningful on the display."
+  [controller cue v effect-id]
   (let [val (cues/get-cue-variable cue v :show (:show controller) :when-id effect-id)
         formatted (if (some? val)
                     (cond
@@ -1075,21 +1075,59 @@
                       (double val))

                     ;; We got no value, display an ellipsis
-                    "...")
-        padding (clojure.string/join (repeat len " "))]
-    (clojure.string/join (take len (str formatted padding)))))
-
-(defn- cue-variable-values
-  "Formats the current values of the adjustable variables to display
-  under an active cue."
-  [controller cue effect-id]
+                    "…")]
+    (str formatted)))
+
+(defn- draw-cue-variable-values
+  "Displays the current values of the adjustable variables currently
+  assigned to the encoders over an active cue."
+  [controller x cue effect-id]
   (let [cue-vars (cue-vars-for-encoders (:variables cue) (get @(:cue-var-offsets controller) effect-id 0))]
-    (if (seq cue-vars)
+    (when (seq cue-vars)
       (if (= (count (:variables cue)) 1)
-        (fit-cue-variable-value controller cue (first cue-vars) 17 effect-id)
-        (str (fit-cue-variable-value controller cue (first cue-vars) 8 effect-id) " "
-             (fit-cue-variable-value controller cue (second cue-vars) 8 effect-id)))
-      "")))
+        (draw-cue-variable-value controller (* x 2) 2
+                                 (format-cue-variable-value controller cue (first cue-vars) effect-id) white-color)
+        (do
+          (draw-cue-variable-value controller (* x 2) 1
+                                   (format-cue-variable-value controller cue (first cue-vars) effect-id) white-color)
+          (draw-cue-variable-value controller (inc (* x 2)) 1
+                                   (format-cue-variable-value controller cue (second cue-vars) effect-id)
+                                   white-color))))))
+
+(defn draw-cue-variable-gauge
+  "Draw an appropriate gauge for a cue variable given its type and
+  value."
+  [controller index encoder-count cue cue-var effect-id]
+  (let [cur-val (cues/get-cue-variable cue cue-var :show (:show controller) :when-id effect-id)]
+    (cond
+      (or (number? cur-val) (#{:integer :double} (:type cue-var :double)))
+      (if (:centered cue-var)
+        (draw-pan-gauge controller index encoder-count cur-val :lowest (min cur-val (:min cue-var))
+                    :highest (max cur-val (:max cue-var)))
+        (draw-gauge controller index encoder-count cur-val :lowest (min cur-val (:min cue-var))
+                    :highest (max cur-val (:max cue-var))))
+
+      (or (= (type cur-val) :com.evocomputing.colors/color) (= (:type cue-var) :color))
+      nil ;; TODO: Implement based on this:
+      #_(controllers/add-overlay (:overlays controller)
+                               (build-color-adjustment-overlay controller note cue cue-var effect info))
+
+      (or (= (type cur-val) Boolean) (= (:type cue-var) :boolean))
+      nil ;; TODO: Implement based on this:
+      #_(controllers/add-overlay (:overlays controller)
+                               (build-boolean-adjustment-overlay controller note cue cue-var effect info)))))
+
+(defn draw-cue-variable-gauges
+  "Displays the appropriate style of adjustment gauge for variables
+  currently assigned to the encoders over an active cue."
+  [controller x cue effect-id]
+  (let [cue-vars (cue-vars-for-encoders (:variables cue) (get @(:cue-var-offsets controller) effect-id 0))]
+    (when (seq cue-vars)
+      (if (= (count (:variables cue)) 1)
+        (draw-cue-variable-gauge controller (* x 2) 2 cue (first cue-vars) effect-id)
+        (do
+          (draw-cue-variable-gauge controller (* x 2) 1 cue (first cue-vars) effect-id)
+          (draw-cue-variable-gauge controller (inc (* x 2)) 1 cue (second cue-vars) effect-id))))))

 (defn- room-for-effects
   "Determine how many display cells are available for displaying
@@ -1161,7 +1199,8 @@
                                   (when (not= cur-vals (:starting-vars info))
                                     :save)))]
               (draw-cue-variable-names controller x cue (:id info))
-              (write-display-cell controller 1 x (cue-variable-values controller cue (:id info)))
+              (draw-cue-variable-values controller x cue (:id info))
+              (draw-cue-variable-gauges controller x cue (:id info))
               (set-graphics-color graphics color)
               (.fillRect graphics (+ left (/ button-cell-margin 2.0)) (- Wayang/DISPLAY_HEIGHT 38)
                          (- width button-cell-margin) 20)
@@ -1934,7 +1973,7 @@
   [note]
   (+ note 71))

-(defn- draw-variable-gauge
+(defn- ^:deprecated draw-variable-gauge
   "Display the value of a variable being adjusted in the effect list."
   [controller cell width offset cue v effect-id]
   (let [value (or (cues/get-cue-variable cue v :show (:show controller) :when-id effect-id) 0)
@@ -2066,7 +2105,7 @@

   Also suppresses the ability to scroll through the cue variables
   while the encoder is being held."
-  [controller note cue v effect info]
+  [controller note cue cue-var effect info]
   (let [x (quot note 2)
         var-index (rem note 2)]
     (if (> (count (:variables cue)) 1)
@@ -2076,20 +2115,25 @@
         (captured-notes [this] #{note})
         (adjust-interface [this _]
           (when (same-effect-active controller cue (:id info))
-            (draw-variable-gauge controller x 8 (* 9 var-index) cue v (:id info))
+            (let [cur-val (or (cues/get-cue-variable cue cue-var :show (:show controller) :when-id (:id info)) 0)]
+              (if (:centered cue-var)
+                (draw-pan-gauge controller note 1 cur-val :lowest (min cur-val (:min cue-var))
+                                :highest (max cur-val (:max cue-var)) :active-color white-color)
+                (draw-gauge controller note 1 cur-val :lowest (min cur-val (:min cue-var))
+                            :highest (max cur-val (:max cue-var)) :active-color white-color)))
             (swap! (:next-top-pads controller) assoc (inc (* 2 x)) off-color)
-            (calculate-touch-strip-value controller cue v (:id info))
+            (calculate-touch-strip-value controller cue cue-var (:id info))
             true))
         (handle-control-change [this message]
           (when (= (:note message) (control-for-top-encoder-note note))
-            (adjust-variable-value controller message cue v (:id info)))
+            (adjust-variable-value controller message cue cue-var (:id info)))
           true)
         (handle-note-on [this message])
         (handle-note-off [this message]
           :done)
         (handle-aftertouch [this message])
         (handle-pitch-bend [this message]
-          (bend-variable-value controller message cue v (:id info))
+          (bend-variable-value controller message cue cue-var (:id info))
           true))

       ;; Just one variable, take full cell, using either encoder,
@@ -2100,13 +2144,13 @@
           (captured-notes [this] #{note paired-note})
           (adjust-interface [this _]
             (when (same-effect-active controller cue (:id info))
-              (draw-variable-gauge controller x 17 0 cue v (:id info))
+              (draw-variable-gauge controller x 17 0 cue cue-var (:id info))
               (swap! (:next-top-pads controller) assoc (inc (* 2 x)) off-color)
-              (calculate-touch-strip-value controller cue v (:id info))
+              (calculate-touch-strip-value controller cue cue-var (:id info))
               true))
           (handle-control-change [this message]
             (when (= (:note message) (control-for-top-encoder-note note))
-              (adjust-variable-value controller message cue v (:id info)))
+              (adjust-variable-value controller message cue cue-var (:id info)))
             true)
           (handle-note-on [this message]
             true)
@@ -2115,7 +2159,7 @@
               :done))
           (handle-aftertouch [this message])
           (handle-pitch-bend [this message]
-            (bend-variable-value controller message cue v (:id info))
+            (bend-variable-value controller message cue cue-var (:id info))
             true))))))

 (def ^:private color-picker-grid


Updated logo path

Updated logo path

--- src/css-guide/guideui/ui.cljs
+++ src/css-guide/guideui/ui.cljs
@@ -248,7 +248,7 @@

         (dom/div #js {:className (str "c-drawer" (when drawer " is-open"))}
           (dom/div #js {:className "c-drawer__header"}
-            (dom/img #js {:src "/img/logo.png" :height "35" :width "35"})
+            (dom/img #js {:src "img/logo.png" :height "35" :width "35"})
             (dom/h1 nil "Untangled " (dom/strong #js {:className "is-primary"} "UI")))
           (dom/a #js {:className "c-drawer__action" :href "guide.html"}
             (e/ui-icon {:glyph :check_box}) "Components Guide")


Fix problem of repeating data when reading a sequencefile

--- src/main/clojure/powderkeg/core.clj
+++ src/main/clojure/powderkeg/core.clj
@@ -330,31 +330,56 @@
   ([src options]
     (-rdd src (:sc options *sc*) options)))

+(defn- iterator
+  "Iterator transducing context"
+  [xform ^java.util.Iterator src-iterator]
+  (let [NULL (Object.)
+        dq (java.util.ArrayDeque. 32)
+        rf (xform (fn ([acc] acc) ([acc x] (.push dq (if (some? x) x NULL)) acc)))
+        vopen (volatile! true)
+        ensure-next #(or (some? (.peek dq))
+                       (if (and @vopen (.hasNext src-iterator))
+                         (let [acc (rf nil (.next src-iterator))]
+                           (when (reduced? acc) (vreset! vopen false))
+                           (recur))
+                         false))]
+    (reify java.util.Iterator
+      (hasNext [_]
+        (ensure-next))
+      (next [_]
+        (if (ensure-next)
+          (let [x (.poll dq)]
+            (if (identical? NULL x) nil x))
+          (throw (java.util.NoSuchElementException.)))))))
+
 (defn ^org.apache.spark.api.java.JavaRDD rdd*
   "Like rdd without the mixed varargs."
   [src xform options-map]
   (let [{:keys [preserve-partitioning] :or {preserve-partitioning false} :as options} options-map
         rdd (ensure-rdd src options)
-        df (barrier-fn (fn [it] (eduction (comp may-unmap-tuple2 xform may-map-tuple2) (iterator-seq it))))
+        df (barrier-fn (fn [it] (iterator (comp may-unmap-tuple2 xform may-map-tuple2) it)))
         rdd (.mapPartitions rdd
               (reify org.apache.spark.api.java.function.FlatMapFunction ; todo: skip api.java.* go to spark
                 (call [_ it]
                   (compile-cond
                     (has-method? org.apache.spark.api.java.function.FlatMapFunction '[java.util.Iterator "call" [?]])
-                    (.iterator ((df) it))
+                    ((df) it)
                     (has-method? org.apache.spark.api.java.function.FlatMapFunction '[java.lang.Iterable "call" [?]])
-                    ((df) it))))
+                    (reify java.util.Iterable
+                      (iterator [_] ((df) it))))))
               preserve-partitioning)]
     rdd))

-(def ^:private sink
-  (x/kvrf ([] nil) ([_] nil) ([_ _] nil) ([_ _ _] nil) ([_ _ _ _] nil)))
+(defn- consume-iterator [^java.util.Iterator it]
+  (when (.hasNext it)
+    (.next it)
+    (recur it)))

 (defn do-rdd*
   "Like rdd* but for forcing computation."
   [src xform options]
   (let [rdd (ensure-rdd src options)
-        df (barrier-fn (fn [it] (transduce (comp may-unmap-tuple2 xform) sink (iterator-seq it))))
+        df (barrier-fn (fn [it] (consume-iterator (iterator (comp may-unmap-tuple2 xform) it))))
         rdd (.foreachPartition rdd
               (reify org.apache.spark.api.java.function.VoidFunction ; todo: skip api.java.* go to spark
                 (call [_ it] ((df) it))))]


db/download_log.clj: use S3 and db.data instead of SimpleDB

--- src/org/altlaw/db/download_log.clj
+++ src/org/altlaw/db/download_log.clj
@@ -1,28 +1,43 @@
 (ns org.altlaw.db.download-log
-  (:require [org.altlaw.util.simpledb :as db])
-  (:import (java.util Date)
+  (:require [org.altlaw.db.data :as data])
+  (:import (java.util Date Calendar)
            (org.altlaw.util DateUtils)))

-(def #^{:private true} *domain* "DownloadLog")
+(defn get-download-log []
+  (data/get-data "download-log"))

-(defn download-date [url]
-  (let [attrs (db/get-attrs *domain* url)]
-    (when-let [date-string (get attrs "download_date")]
-      (DateUtils/parseDateISO8601 date-string))))
+(defn create-download-log []
+  (data/create-data "download-log" {}))

-(defn downloaded? [url]
-  (if (download-date url) true false))
+(defn save-download-log []
+  (data/save-data "download-log"))

-(defn enqueue-download [url]
-  (db/put-attrs *domain* url
-                {:queue_date (DateUtils/timestamp)}))
+(defn- check-date-format
+  "If date is a Date or Calendar object, convert to an ISO-8601
+  string.  If it is a string, check that it is in ISO-8601 format.
+  Returns an ISO-8601 string or throws exception on bad input."
+  [date]
+  (cond
+   (string? date) (DateUtils/dateToISO8601
+                   (DateUtils/parseDateISO8601 date))
+   (instance? Date date) (DateUtils/dateToISO8601 date)
+   (instance? Calendar date) (DateUtils/calendarToISO8601 date)
+   :else (throw (Exception. "date must be an ISO-8601 String, a Date, or a Calendar"))))

-(defn record-download
+(defn log-download
+  "Logs a download of the URL (a String). If date (Date object or
+  ISO-8601 date/time string) is not given, assume current date/time."
   ([url]
-     (db/put-attrs *domain* url
-                   {:download_date (DateUtils/timestamp)}))
-  ([url #^Date date]
-     (db/put-attrs *domain* url
-                   {:download_date
-                    (.format DateUtils/ISO8601_GMT date)})))
+     (assert (string? url))
+     (dosync (alter (get-download-log)
+                    assoc url (DateUtils/timestamp))))
+  ([url date]
+     (assert (string? url))
+     (dosync (alter (get-download-log)
+                    assoc url (check-date-format date)))))

+(defn downloaded?
+  "Returns true if the URL (a String) has already been downloaded."
+  [url]
+  (assert (string? url))
+  (contains? @(get-download-log) url))


Added log line when a worker is started

Added log line when a worker is started

--- src/org/gensym/viddy/workerrun.clj
+++ src/org/gensym/viddy/workerrun.clj
@@ -20,5 +20,6 @@
 (defn -main []
   (let [db-spec (dbconn/db-spec  (System/getenv "DATABASE_URL"))]
     (start db-spec)
+    (println "Worker started.")
     (.start (Thread. #()))))


CMR-2153 I broke some things.

CMR-2153 I broke some things.

--- system-int-test/src/cmr/system_int_test/data2/core.clj
+++ system-int-test/src/cmr/system_int_test/data2/core.clj
@@ -32,18 +32,20 @@

 (defn item->concept
   "Returns a concept map from a UMM item or tombstone. Default provider-id to PROV1 if not present."
-  [item format-key]
-  (let [format (mime-types/format->mime-type format-key)
-        concept-type (legacy/item->concept-type item)]
-    (merge {:concept-type concept-type
-            :provider-id (or (:provider-id item) "PROV1")
-            :native-id (or (:native-id item) (item->native-id item))
-            :metadata (when-not (:deleted item) (generate-metadata (dissoc item :provider-id) concept-type format-key))
-            :format format}
-           (when (:concept-id item)
-             {:concept-id (:concept-id item)})
-           (when (:revision-id item)
-             {:revision-id (:revision-id item)}))))
+  ([item]
+   (item->concept item :echo10))
+  ([item format-key]
+   (let [format (mime-types/format->mime-type format-key)
+         concept-type (legacy/item->concept-type item)]
+     (merge {:concept-type concept-type
+             :provider-id (or (:provider-id item) "PROV1")
+             :native-id (or (:native-id item) (item->native-id item))
+             :metadata (when-not (:deleted item) (generate-metadata (dissoc item :provider-id) concept-type format-key))
+             :format format}
+            (when (:concept-id item)
+              {:concept-id (:concept-id item)})
+            (when (:revision-id item)
+              {:revision-id (:revision-id item)})))))

 (defn ingest
   "Ingests the catalog item. Returns it with concept-id, revision-id, and provider-id set on it.


Make more things vectors.

Make more things vectors.

--- src/clojush/problems/classification/penn.clj
+++ src/clojush/problems/classification/penn.clj
@@ -30,7 +30,7 @@
     (println "Total number of data lines:" (count lines))
     (mapv #(mapv read-string %) lines)))

-(def training-proportion 0.5) ;; proportion of training cases to use each generation
+(def training-proportion 0.1) ;; proportion of training cases to use each generation

 (defn define-fitness-cases
   "Returns a map with two keys: train and test. Train maps to a
@@ -41,13 +41,13 @@
         target-column (.indexOf (mapv clojure.string/upper-case (mapv name (first raw-data)))
                                 "CLASS")
         inputs (fn [row]
-                 (concat (take target-column row)
-                         (drop (inc target-column) row)))
+                 (vec (concat (take target-column row)
+                              (drop (inc target-column) row))))
         target (fn [row] (str (nth row target-column))) ;; target classes are strings
-        fitness-cases-shuffled (shuffle (map (fn [row]
-                                               {:inputs (inputs row)
-                                                :target (target row)})
-                                             (rest raw-data)))
+        fitness-cases-shuffled (shuffle (mapv (fn [row]
+                                                {:inputs (inputs row)
+                                                 :target (target row)})
+                                              (rest raw-data)))
         train-num (int (* 0.5 (count fitness-cases-shuffled)))
         all-training-cases (subvec fitness-cases-shuffled 0 train-num)
         all-testing-cases (subvec fitness-cases-shuffled train-num)]
@@ -107,13 +107,13 @@
   (println ";;******************************"))

 (def penn-atom-generators
-  (concat (distinct (mapv :target (:all-train @penn-fitness-cases))) ;; classes, for output
-          ;(list (tag-instruction-erc [:exec :integer :boolean :string] 1000)
-          ;      (tagged-instruction-erc 1000))
-          (for [n (map inc
-                       (range (count (:inputs (first (:train @penn-fitness-cases))))))]
-            (symbol (str "in" n)))
-          (registered-for-stacks [:exec :integer :boolean])))
+  (vec (concat (distinct (mapv :target (:all-train @penn-fitness-cases))) ;; classes, for output
+               ;(list (tag-instruction-erc [:exec :integer :boolean :string] 1000)
+               ;      (tagged-instruction-erc 1000))
+               (for [n (map inc
+                            (range (count (:inputs (first (:train @penn-fitness-cases))))))]
+                 (symbol (str "in" n)))
+               (registered-for-stacks [:exec :integer :boolean]))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Main call


Fix help

Fix help

--- src/puppeteer/domain/usecase/message.clj
+++ src/puppeteer/domain/usecase/message.clj
@@ -11,7 +11,7 @@
         :text ":dolls:"
         :attachments [(map->Attachment
                         {:text (str ":rocket: Deploy: @alc deploy <user-name> <repository-name> <branch-name>" "\n"
-                                    ":wastebasket: RoundUp: @alc round-up <user-name> <repository-name> <branch-name>")})]}
+                                    ":wastebasket: RoundUp: @alc roundup <user-name> <repository-name> <branch-name>")})]}
        map->Message
        (r/send-message message-repository)))


range fix for pali

range fix for pali

--- resources/languages/my/rules/numbers.clj
+++ resources/languages/my/rules/numbers.clj
@@ -17,7 +17,7 @@
                (:text %1))}

-  "integer (1..10) - pali"
+  "integer (1..3) - pali"
   #"ပထမ|ဒုတိယ|တတိယ"
   {:dim :number
    :integer true


type hinting

type hinting

--- dada-core/src/test/clojure/org/dada/core/test_dql2.clj
+++ dada-core/src/test/clojure/org/dada/core/test_dql2.clj
@@ -6,6 +6,8 @@
     (:import
      [org.dada.core
       Attribute
+      Creator
+      Metadata
       Metadata$VersionComparator
       Model
       Result])
@@ -40,18 +42,18 @@
      (proxy [Metadata$VersionComparator][]
 	    (compareTo [lhs rhs] (- (.getVersion lhs) (.getVersion rhs)))))

-(def whale-metadata (custom-metadata "org.dada.core.tmp.Whale"
-				     Object
-				     [:id]
-				     [:version]
-				     int-version-comparator
-				     whale-attributes))
+(def ^Metadata whale-metadata (custom-metadata "org.dada.core.tmp.Whale"
+					       Object
+					       [:id]
+					       [:version]
+					       int-version-comparator
+					       whale-attributes))

 (def whales (model "Whales" whale-metadata))
 (insert *metamodel* whales)

 ;;(insert-n whales whale-data)
-(let [creator (.getCreator whale-metadata)]
+(let [^Creator creator (.getCreator whale-metadata)]
       (insert-n
        whales
        (map (fn [datum] (.create creator (into-array Object datum))) whale-data)))


dd Project link to BB and GH org/user

dd Project link to BB and GH org/user

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -48,15 +48,16 @@
      [:img.avatar {:src (gh-utils/make-avatar-url org :size 50)
             :height 50}]
      [:div.orgname login]
-     [:div.org-icon
-      [:a {:href (str (case vcs-type
-                        "github" (gh-utils/http-endpoint)
-                        "bitbucket" (bitbucket/http-endpoint))
-                      "/" login)
-           :target "_blank"}
-       (case vcs-type
-         "github" [:i.octicon.octicon-mark-github]
-         "bitbucket" [:i.fa.fa-bitbucket])]]]))
+     (if vcs-type
+       [:div.org-icon
+        [:a {:href (str (case vcs-type
+                          "github" (gh-utils/http-endpoint)
+                          "bitbucket" (bitbucket/http-endpoint))
+                        "/" login)
+             :target "_blank"}
+         (case vcs-type
+           "github" [:i.octicon.octicon-mark-github]
+           "bitbucket" [:i.fa.fa-bitbucket])]])]))

 (defn missing-org-info
   "A message explaining how to enable organizations which have disallowed CircleCI on GitHub."


Explain trial plans.

Explain trial plans.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -887,6 +887,11 @@
             (:org_name plan) "'s plan."]])
         [:p
          (str "Builds will be distributed across " (pm/usable-containers plan) " containers.")]
+        (when (pm/in-trial? plan)
+          [:p
+           (str (pm/trial-containers plan) " of these are provided by a trial. They'll be around for "
+                (pluralize (pm/days-left-in-trial plan) "more day")
+                ".")])
         (when (pm/paid? plan)
           [:p
            (str (pm/paid-containers plan) " of these are paid, at $" (pm/stripe-cost plan) "/month. ")


Update FAQs layout

Update FAQs layout

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -334,13 +334,14 @@
     om/IRender
     (render [_]
       (let [[first-half second-half] (split-at (quot (count items) 2) items)]
-       (html
-         [:fieldset.faq {:data-component `faq}
-          [:legend "FAQs"]
+      (html
+        [:fieldset.faq {:data-component `faq}
+         [:legend "FAQs"]
+         [:div.columns
           [:div.column
-           (om/build-all faq-item first-half)]
-          [:div.column
-           (om/build-all faq-item second-half)]])))))
+          (om/build-all faq-item first-half)]
+         [:div.column
+          (om/build-all faq-item second-half)]]])))))

 (defn plan-payment-button [{:keys [text loading-text disabled? on-click-fn]} owner]
   (reify


cleanup

cleanup

--- src/babel/italiano/morphology/adjectives.cljc
+++ src/babel/italiano/morphology/adjectives.cljc
@@ -42,5 +42,3 @@
     :unify-with {:synsem {:cat :adjective
                           :agr {:gender :fem
                                 :number :plur}}}}})
-
-


shows first proper ratings from dummy data

--- src/cljs/conference_rating/rating/rating.cljs
+++ src/cljs/conference_rating/rating/rating.cljs
@@ -1,13 +1,12 @@
 (ns conference-rating.rating.rating
   (:require [conference-rating.panel :as panel]))

-(defn display-rating []
-  (let [rating single-rating]
-     [:div {:class "row bg-light"}
-      [:div {:class "col-lg-12 col-md-12"}
-        (if (:recommended rating) [:p "I would go again!"])
-        [:p (get-in rating [:comment :name])]
-        [:p (get-in rating [:comment :comment])]]]))
+(defn display-rating [rating]
+   [:div {:class "row bg-light"}
+    [:div {:class "col-lg-12 col-md-12"}
+      (if (:recommended rating) [:p "I would go again!"])
+      [:p (get-in rating [:comment :name])]
+      [:p (get-in rating [:comment :comment])]]])

 (defn display-ratings [conference-ratings]
-  [:div (map display-rating conference-ratings)])
+  [:div {:class "container-fluid pad-top"} (map display-rating conference-ratings)])


Daemonize futures

Daemonize futures

--- src/riemann/jvm_profiler/stack.clj
+++ src/riemann/jvm_profiler/stack.clj
@@ -150,6 +150,9 @@
   [agg-sample target-load]
   (let [running (promise)]
     (future
+      (doto (Thread/currentThread)
+        (.setDaemon true)
+        (.setName "riemann-jvm-profiler sampler"))
       (loop [last-t0 (System/nanoTime)]
         (when (deref running 0 true)
           (recur
@@ -182,6 +185,9 @@
   (let [anchor  (measure/linear-time)
         running (promise)]
     (future
+      (doto (Thread/currentThread)
+        (.setDaemon true)
+        (.setName "riemann-jvm-profiler reporter"))
       (loop []
         (when (deref running
                      (* 1000 (- dt (mod (- (measure/linear-time) anchor) dt)))


New web style

New web style

--- src/kixi/hecuba/web.clj
+++ src/kixi/hecuba/web.clj
@@ -15,7 +15,7 @@
 (def base-media-types ["application/json"])

 (defn index [req]
-  {:status 200 :body (slurp (io/resource "hecuba/index.html"))})
+  {:status 200 :body (slurp (io/resource "sb-admin/index.html"))})

 (defn index-om [req]
   {:status 200 :body (slurp (io/resource "hecuba/index-om.html"))})
@@ -34,7 +34,7 @@

 (defn make-routes [producer-config querier commander]
   ["/"
-   [["" (->Redirect 307 index-om)]
+   [["" (->Redirect 307 index)]
     ["overview.html" index]
     ["overview-om.html" index-om]
     ["chart.html" chart]
@@ -44,9 +44,11 @@
     (kixi.hecuba.web.device/create-routes producer-config)
     (kixi.hecuba.web.project/create-routes querier commander)

+    ["" (->Resources {:prefix "sb-admin/"})]
+
     ;; Static resources
-    [(->Alternates ["stylesheets/" "images/" "javascripts/"])
-     (->Resources {:prefix "hecuba/"
+    #_[(->Alternates ["stylesheets/" "images/" "javascripts/"])
+       (->Resources {:prefix "hecuba/"
                    :mime-types {"map" "text/javascript"}})]]])

 (deftype Website [config]


[l.droid] Remove deprecated release task

--- src/leiningen/droid.clj
+++ src/leiningen/droid.clj
@@ -46,19 +46,12 @@
     (doseq [task build-steps]
       (execute-subtask project task device-args))))

-(defn release
-  "DEPRECATED. Metatask. Builds, packs and deploys the release version of the
-  project."
-  [project & args]
-  (abort (str "\"release\" subtask is deprecated, "
-              "please use 'lein with-profile release droid doall'")))
-
 (defn ^{:no-project-needed true
         :subtasks [#'new #'init #'code-gen #'compile #'create-dex
                    #'crunch-resources #'package-resources
                    #'create-apk #'sign-apk #'zipalign-apk
                    #'install #'run #'forward-port #'repl
-                   #'build #'apk #'deploy #'doall #'release #'help
+                   #'build #'apk #'deploy #'doall #'help #'local-test
                    #'gather-dependencies #'jar #'pprint]}
   droid
   "Supertask for Android-related tasks (see `lein droid` for list)."
@@ -101,7 +94,6 @@
     "apk" (apk project)
     "deploy" (apply deploy project args)
     "doall" (apply doall project args)
-    "release" (apply release project args)
     "jar" (jar project)

     ;; Help tasks


reuse clipboard fns in editor

reuse clipboard fns in editor

--- src/lt/objs/editor.cljs
+++ src/lt/objs/editor.cljs
@@ -8,14 +8,14 @@
             [lt.objs.menu :as menu]
             [lt.util.events :as ev]
             [lt.util.dom :as dom]
-            [lt.util.load :as load])
+            [lt.util.load :as load]
+            [lt.objs.platform :as platform])
   (:use [lt.util.dom :only [remove-class add-class]]
         [lt.object :only [object* behavior*]]
         [lt.util.cljs :only [js->clj]])
   (:require-macros [lt.macros :refer [behavior]]))

 (def gui (js/require "nw.gui"))
-(def clipboard (.Clipboard.get gui))

 ;;*********************************************************
 ;; commands
@@ -240,14 +240,14 @@
   (.redo (->cm-ed e)))

 (defn copy [e]
-  (.set clipboard (selection e) "text"))
+  (platform/copy (selection e)))

 (defn cut [e]
   (copy e)
   (replace-selection e ""))

 (defn paste [e]
-  (replace-selection e (.get clipboard "text")))
+  (replace-selection e (platform/paste)))

 (defn select-all [e]
   (set-selection e
@@ -617,7 +617,7 @@
                                       (cut this))}
                             {:label "Paste"
                              :order 3
-                             :enabled (boolean (not (empty? (.get clipboard "text"))))
+                             :enabled (boolean (not (empty? (platform/paste))))
                              :click (fn []
                                       (paste this))}
                             {:type "separator"


Removes extraneous expression that was used as a watch.

--- src/lt/plugins/css.cljs
+++ src/lt/plugins/css.cljs
@@ -80,8 +80,6 @@
                             code (if-not client-path
                                    (:code info)
                                    (preprocess (files/parent file-path) client-path (:code info)))]
-
-                        code
                         (clients/send client
                                       :editor.eval.css
                                       (assoc info :code code)


warning fix

warning fix

--- src/node/game/core.cljs
+++ src/node/game/core.cljs
@@ -317,12 +317,14 @@
   (when (>= (get-in @state [side :agenda-point]) (get-in @state [side :agenda-point-req]))
     (system-msg state side "wins the game")))

-(defn trash [state side {:keys [zone] :as card} cross]
-  (let [cdef (card-def card)
-        moved-card (move state (to-keyword (:side card)) card :discard false cross)]
-    (when-let [trash-effect (:trash-effect cdef)]
-      (resolve-ability state side trash-effect moved-card nil))
-    (trigger-event state side :trash moved-card)))
+(defn trash
+  ([state side card] (trash state side card false))
+  ([state side {:keys [zone] :as card} cross]
+     (let [cdef (card-def card)
+           moved-card (move state (to-keyword (:side card)) card :discard false cross)]
+       (when-let [trash-effect (:trash-effect cdef)]
+         (resolve-ability state side trash-effect moved-card nil))
+       (trigger-event state side :trash moved-card))))

 (defn pump
   ([state side card n] (pump state side card n false))
@@ -376,7 +378,7 @@
           (let [card (assoc c :seen true)]
             (optional-ability state side card (str "Pay " trash-cost "[Credits] to trash " name "?")
                               {:cost [:credit trash-cost]
-                               :effect (effect (trash :corp card false)
+                               :effect (effect (trash :corp card)
                                                (system-msg (str "pays " trash-cost "[Credits] to trash "
                                                                 (:title card))))} nil))
           (when-not (= (:type c) "Agenda")
@@ -550,7 +552,7 @@
             (when (#{"Asset" "Agenda"} (:type c))
               (doseq [installed-card (get-in @state (cons :corp slot))]
                 (when (#{"Asset" "Agenda"} (:type installed-card))
-                  (trash state side installed-card false)
+                  (trash state side installed-card)
                   (system-msg state side (str "trash a card in " server)))))
             (system-msg state side (str "installs a card in " server))
             (let [moved-card (move state side c slot)]


correct units

correct units

--- src/ontrail/formats.clj
+++ src/ontrail/formats.clj
@@ -33,7 +33,7 @@
   (let [{:keys [duration distance avghr]} exercise
         {:keys [resthr]} profile]
     (if (positive-numbers? (list resthr duration distance avghr))
-        (format "%.2f b/m" (/ distance (* (- avghr resthr) duration (double (/ 1 6000))))))))
+        (format "%.2f m/b" (/ distance (* (- avghr resthr) duration (double (/ 1 6000))))))))

 (defn to-human-distance [distance]
   (if (= nil distance)


Properly use ready-job-entities

Properly use ready-job-entities

--- src/overseer/worker.clj
+++ src/overseer/worker.clj
@@ -94,7 +94,7 @@
    returning nil if the queue is empty"
   [{:keys [config conn] :as system} job-handlers]
   (fn []
-    (let [jobs (status/jobs-ready (d/db conn))]
+    (let [jobs (ready-job-entities (d/db conn) job-handlers)]
       (when-not (empty? jobs)
         (timbre/info (count jobs) "handleable job(s) found.")
         (if-let [job (select-and-reserve system jobs conn)]


add kludgy way of testing for byte-arrays could we have byte-array? please

--- src/overtone/sc/osc.clj
+++ src/overtone/sc/osc.clj
@@ -81,7 +81,7 @@
                       :validator (fn [val] (string? val))}

    :bytes            {:desc "a buffer of bytes"
-                      :validator (fn [val] true)}
+                      :validator (fn [val] (= (type (byte-array 0)) (type val)))}

    :zero-to-three    {:desc "an integer in the range 0 -> 3 inclusive"
                       :validator (fn [val] (and (integer? val)


recreate gear svg on reload, and stop using '..' notation for clarity

--- src/parinfer/gears.cljs
+++ src/parinfer/gears.cljs
@@ -71,9 +71,9 @@

 (defn tick-svg!
   [svg]
-  (.. svg
-      (selectAll ".gear-path")
-      (attr "transform"
+  (-> svg
+      (.selectAll ".gear-path")
+      (.attr "transform"
             (fn [d]
               (set! (.-angle d) (+ (.-angle d) (.-speed d)))
               (let [degrees (* (.-angle d) (/ 180 Math/PI))]
@@ -87,14 +87,17 @@

 (defn create-gears!
   [selector {:keys [gears anims]} {:keys [width height] :as svg-opts}]
-  (.. (js/$ selector)
-      (on "mousedown" (fn [e] (.. e -originalEvent (preventDefault)))))
-  (let [svg (.. js/d3
-                (select selector)
-                (append "svg")
-                (attr "viewbox" (str "0 0 " width " " height))
-                (attr "width" width)
-                (attr "height" height))
+  (-> (js/$ selector)
+      (.on "mousedown" (fn [e] (-> e .-originalEvent (.preventDefault)))))
+  (let [container (js/d3.select selector)
+        _ (-> container
+              (.select "svg")
+              (.remove))
+        svg (-> container
+                (.append "svg")
+                (.attr "viewbox" (str "0 0 " width " " height))
+                (.attr "width" width)
+                (.attr "height" height))
         gear-array #js []
         drag-behavior (js/Gear.dragBehaviour gear-array svg)
         gear-objs (for [[name- opts] gears]


Further work on layouts -> spliter change

--- src/re_demo/splits.cljs
+++ src/re_demo/splits.cljs
@@ -10,7 +10,7 @@
                            :border-radius    "4px"
                            :padding          "0px 20px 0px 20px"}))

-(defn layout-panel-title
+(defn spliter-panel-title
   [text]
   [title
    :label text
@@ -22,7 +22,7 @@
   [box
    :size "auto"
    :child [:div {:style rounded-panel}
-           [layout-panel-title [:code ":panel-1"]]]])
+           [spliter-panel-title [:code ":panel-1"]]]])

 (defn right-panel
@@ -30,7 +30,7 @@
   [box
    :size "auto"
    :child [:div {:style rounded-panel}
-           [layout-panel-title [:code ":panel-2"]]]])
+           [spliter-panel-title [:code ":panel-2"]]]])

 (defn top-panel
@@ -38,7 +38,7 @@
   [box
    :size "auto"
    :child [:div {:style rounded-panel}
-           [layout-panel-title [:code ":panel-1"]]]])
+           [spliter-panel-title [:code ":panel-1"]]]])

 (defn bottom-panel
@@ -46,7 +46,7 @@
   [box
    :size "auto"
    :child [:div {:style rounded-panel}
-           [layout-panel-title [:code ":panel-2"]]]])
+           [spliter-panel-title [:code ":panel-2"]]]])

 (defn panel
@@ -55,8 +55,8 @@
    :size     "auto"
    :gap      "10px"
    :children [[panel-title "Spliter Components"
-                            "src/re_com/layout.cljs"
-                            "src/re_demo/layouts.cljs"]
+                            "src/re_com/splits.cljs"
+                            "src/re_demo/splits.cljs"]

               [h-box
                :gap      "100px"


Fix more annotations

Fix more annotations

--- src/robinson/common.clj
+++ src/robinson/common.clj
@@ -25,12 +25,13 @@
        (println ~msg)
        result#)))

-(t/ann log-io (t/All [x y ...] [String [y ... y -> x] -> [y ... y -> x]]))
+(t/ann log-io (t/All [a x y ...]
+                [String [a y ... y -> x] -> [a (t/U nil (t/I (t/CountRange 1) (t/HSeq (y ... y)))) -> x]]))
 (defn log-io
   "Log function inputs and outputs by wrapping an function f."
   [msg f]
-  (fn [& args]
-    (let [result (apply f args)]
+    (fn [a & args]
+    (let [result (apply f a args)]
       (println (format "(%s %s)=>%s" msg (str args) (str result)))
       result)))

@@ -70,7 +71,7 @@
     [arg [sym] condition form else-form]
     (arg-if- 'clojure.core/-> arg sym condition form else-form)))

-(t/ann vec-match? [(t/Vec t/Any) (t/Vec t/Any) -> Boolean])
+(t/ann ^:no-check vec-match? [(t/Vec t/Any) (t/Vec t/Any) -> Boolean])
 (defn vec-match?
   [test-expr expr]
   (let [arg-match? (t/fn [[test-term term] :- (t/I (t/Vec t/Any) (t/ExactCount 2))] :- Boolean
@@ -86,37 +87,38 @@
   `(condp vec-match? ~match
      ~@body))

-(t/ann noun->indefinite-article (t/Pred String))
+(t/ann noun->indefinite-article [String -> String])
 (defn noun->indefinite-article [noun] (if (contains? #{\a \e \i \o \u} (first noun))
                                         "an"
                                         "a"))
-(t/defalias Pos (t/HMap :mandatory {:x Integer :y Integer}))
-
-(t/ann pos->xy (t/IFn [Pos -> (t/Vec Number)]))
+
+(t/defalias Pos (t/HMap :mandatory {:x Integer :y Integer} :complete? true))
+
+(t/ann pos->xy [Pos -> (t/I (t/Vec Number)(t/ExactCount 2))])
 (defn pos->xy
   [{x :x y :y}]
   [x y])

-(t/ann xy->pos (t/IFn [Number Number -> Pos]))
+(t/ann xy->pos [Integer Integer -> Pos])
 (defn xy->pos
   [x y]
   {:x x :y y})

-(t/ann chebyshev-distance (t/IFn [Pos Pos -> Number]))
+(t/ann chebyshev-distance [Pos Pos -> Number])
 (defn chebyshev-distance
   "Chebyshev/chessboard distance between 2 points"
   [p1 p2]
-  (max (Math/abs (- (:x p1) (:x p2)))
-       (Math/abs (- (:y p1) (:y p2)))))
-
-(t/ann distance-sq (t/IFn [Pos Pos -> Number]))
+  (max (Math/abs (- (get p1 :x) (get p2 :x)))
+       (Math/abs (- (get p1 :y) (get p2 :y)))))
+
+(t/ann distance-sq [Pos Pos -> Number])
 (defn distance-sq
   [p1 p2]
-  (let [sq (fn [x] (* x x))]
+  (let [sq (t/fn [x :- Number] :- Number (* x x))]
   (+ (sq (- (:x p1) (:x p2)))
      (sq (- (:y p1) (:y p2))))))

-(t/ann distance (t/IFn [Pos Pos -> Number]))
+(t/ann distance [Pos Pos -> Double])
 (defn distance
   "Euclidean distance between 2 points"
   [p1 p2]
@@ -128,10 +130,10 @@
   [p1 p2 l]
   (> (distance-sq p1 p2) (* l l)))

-(t/ann fill-missing (t/All [x y z] (t/IFn [(t/Pred x)
-                                           (t/IFn [x y -> z])
-                                           (t/Seq y)
-                                           (t/Seq x) -> (t/Seq z)])))
+(t/ann fill-missing (t/All [x y z] [(t/Pred x)
+                                   (t/IFn [x y -> z])
+                                   (t/Seq y)
+                                   (t/Seq x) -> (t/Seq z)]))

 (defn fill-missing
   "For each item in coll for which (pred item) returns true, replace that
@@ -162,15 +164,15 @@
     (if (empty? coll)
           coll
           (let [x  (first coll)
-                          xs (rest coll)
-                          y  (first vcoll)
-                          ys (rest vcoll)]
+                xs (next coll)
+                y  (first vcoll)
+                ys (next vcoll)]
                   (if (pred x)
                             (cons (f x y) (if (empty? xs) [] (fill-missing pred f ys xs)))
                             (cons x (if (empty? xs) [] (fill-missing pred f vcoll xs)))))))

-(t/ann fn-in (t/All[x]
-               [[t/Any x -> t/Any] (t/Map t/Any t/Any) (t/Vec t/Any) -> x]))
+(t/ann fn-in (t/All[x y]
+               [[t/Any x -> t/Any] (t/Vec t/Any) x -> y]))
 (defn fn-in
   "Applies a function to a value in a nested associative structure and an input value.
    ks sequence of keys and v is the second arguement to f. The nested value will be


cleanup

cleanup

--- src/aws/provider.clj
+++ src/aws/provider.clj
@@ -138,14 +138,9 @@
   (apply ->Instance (translate spec)))

 (comment
-  (use 'celestial.fixtures.data 'celestial.fixtures.core )
-  (def m (vconstruct redis-ec2-spec))
-  (with-admin (with-conf local-conf (.status m)))
-  (with-conf local-conf (with-admin (.create m)))
-  (.start m)
   (clojure.pprint/pprint
     (celestial.model/set-env :dev
-     (first (:addresses (describe-eip "ec2.ap-southeast-2.amazonaws.com" "i-9fc092de")))))
+     (first (:addresses (describe-eip "ec2.eu-west-1.amazonaws.com" "i-ba1b0111")))))
   )


adding block device support

adding block device support

--- src/aws/provider.clj
+++ src/aws/provider.clj
@@ -50,7 +50,7 @@
 (defn creation-keys [aws]
   (clojure.set/subset? (into #{} (keys aws))
     #{:volumes :min-count :max-count :instance-type :ebs-optimized
-      :key-name :placement :security-groups}))
+      :key-name :placement :security-groups :block-device-mappings}))

 (defn create-instance
    "creates instance from aws"
@@ -127,7 +127,10 @@
   [{:keys [aws machine] :as spec}]
   (cond-> (merge-with merge (dissoc-in* spec [:aws :endpoint]) defaults)
     :availability-zone
-      (map-key [:aws :availability-zone] [:aws :placement :availability-zone])))
+      (map-key [:aws :availability-zone] [:aws :placement :availability-zone])
+     :block-devices
+      (map-key [:aws :block-devices] [:aws :block-device-mappings])
+    ))

 (defmethod translate :aws [{:keys [aws machine] :as spec}]
   [(aws :endpoint) (aws-spec spec) (or (machine :user) "root")])


sort (:require)s

sort (:require)s

--- src/babel/forest.clj
+++ src/babel/forest.clj
@@ -1,13 +1,13 @@
 (ns babel.forest
   (:refer-clojure :exclude [get-in deref resolve find future parents])
   (:require
+   [babel.cache :refer (build-lex-sch-cache get-comp-phrases-of get-head-phrases-of get-lex
+                                            get-parent-phrases-for-spec)]
+   [babel.over :as over]
    [clojure.core :as core]
    [clojure.set :refer :all]
    [clojure.string :as string]
    [clojure.tools.logging :as log]
-   [babel.cache :refer (build-lex-sch-cache get-comp-phrases-of get-head-phrases-of get-lex
-                                            get-parent-phrases-for-spec)]
-   [babel.over :as over]
    [dag-unify.core :refer (dissoc-paths get-in fail? fail-path-between lazy-shuffle ref? remove-false
                                         remove-top-values-log strip-refs show-spec unifyc)]))

@@ -20,29 +20,31 @@
 (declare lightning-bolt)
 (declare generate-all)

-(defn generate [spec grammar lexicon index]
-  (first (take 1 (generate-all spec grammar lexicon index))))
+(defn generate [spec grammar lexicon index morph]
+  (first (take 1 (generate-all spec grammar lexicon index morph))))

 (defn generate-all-with-model [spec {grammar :grammar
                                      index :index
-                                     lexicon :lexicon}]
+                                     lexicon :lexicon
+                                     morph :morph}]
   (let [index (if (future? index) @index index)
         lexicon (if (future? lexicon) @lexicon lexicon)]
     (log/info (str "using grammar of size: " (.size grammar)))
     (log/info (str "using index of size: " (.size index)))
     (if (seq? spec)
-      (map generate-all spec grammar lexicon index)
+      (map generate-all spec grammar lexicon index morph)
       (generate spec grammar
                 (flatten (vals lexicon))
-                index))))
+                index
+                morph))))

-(defn generate-all [spec grammar lexicon index]
+(defn generate-all [spec grammar lexicon index morph]
   (filter #(not (fail? %))
           (cond (and (or (seq? spec)
                          (vector? spec))
                      (not (empty? spec)))
-                (lazy-cat (generate-all (first spec) grammar lexicon index)
-                          (generate-all (rest spec) grammar lexicon index))
+                (lazy-cat (generate-all (first spec) grammar lexicon index morph)
+                          (generate-all (rest spec) grammar lexicon index morph))
                 true
                 (do
                   (log/debug (str "generate-all with semantics: " (show-spec (remove-false (get-in spec [:synsem :sem])))))
@@ -51,10 +53,10 @@
                                       lexicon
                                       spec 0 index)
                       ;; TODO: allow more than a fixed maximum depth of generation (here, 4 levels from top of tree).
-                      (add-complements-to-bolts [:head :head :head :comp] :top grammar lexicon index)
-                      (add-complements-to-bolts [:head :head :comp]       :top grammar lexicon index)
-                      (add-complements-to-bolts [:head :comp]             :top grammar lexicon index)
-                      (add-complements-to-bolts [:comp]                   :top grammar lexicon index))))))
+                      (add-complements-to-bolts [:head :head :head :comp] :top grammar lexicon index morph)
+                      (add-complements-to-bolts [:head :head :comp]       :top grammar lexicon index morph)
+                      (add-complements-to-bolts [:head :comp]             :top grammar lexicon index morph)
+                      (add-complements-to-bolts [:comp]                   :top grammar lexicon index morph))))))

 ;; TODO: add usage of rule-to-lexicon cache (rather than using lexicon directly)
 (defn lightning-bolt [grammar lexicon spec & [ depth index parent]]
@@ -104,7 +106,7 @@
           (lazy-cat lexical phrasal)
           (lazy-cat phrasal lexical))))))

-(defn add-complement [bolt path spec grammar lexicon cache]
+(defn add-complement [bolt path spec grammar lexicon cache morph]
   (let [input-spec spec
         cache (if (future? cache) @cache cache)
         from-bolt bolt ;; so we can show what (add-complement) did to the input bolt, for logging.
@@ -151,7 +153,7 @@
                                (if is-fail? :fail result)))

                            ;; lazy-sequence of phrasal complements to pass one-by-one to the above (map)'s function.
-                           (let [phrasal-complements (generate-all spec grammar lexicon cache)]
+                           (let [phrasal-complements (generate-all spec grammar lexicon cache morph)]
                              (if (= (rand-int 2) 0)
                                (lazy-cat shuffled-candidate-lexical-complements phrasal-complements)
                                (lazy-cat phrasal-complements shuffled-candidate-lexical-complements)))))]
@@ -160,7 +162,10 @@

               ;; else, no complements could be added to this bolt.
               (do
-                (log/warn (str " add-complement took " run-time " msec, but found no lexical complements for " from-bolt ". Complements tried were: " complement-candidate-lexemes))
+                (log/warn (str " add-complement took " run-time " msec, but found no lexical complements for "
+                               (morph from-bolt) "(rule: " (:rule from-bolt) ")"
+                               ". Complements tried were: " (morph complement-candidate-lexemes)))
+
                 ;; TODO: show warn about not finding ny phrasal complements, as well as not finding any lexical complements.
                 (log/debug (str " fail-paths:"))
                 (vec (map (fn [lexeme]
@@ -175,10 +180,10 @@
       (do
         (list bolt)))))

-(defn add-complements-to-bolts [bolts path spec grammar lexicon cache]
+(defn add-complements-to-bolts [bolts path spec grammar lexicon cache morph]
   (if (seq bolts)
-    (lazy-cat (add-complement (first bolts) path spec grammar lexicon cache)
-              (add-complements-to-bolts (rest bolts) path spec grammar lexicon cache))))
+    (lazy-cat (add-complement (first bolts) path spec grammar lexicon cache morph)
+              (add-complements-to-bolts (rest bolts) path spec grammar lexicon cache morph))))

 (defn path-to-map [path val]
   (let [feat (first path)]


add indices

add indices

--- src/babel/latin.cljc
+++ src/babel/latin.cljc
@@ -1,6 +1,7 @@
 (ns babel.latin
   (:refer-clojure :exclude [get-in])
   (:require
+   [babel.index :refer [build-lex-sch-index create-indices lookup-spec]]
    [babel.latin.morphology :as morph]
    [babel.lexiconfn :refer [default listify map-function-on-map-vals
                             verb-pred-defaults]]
@@ -9,6 +10,11 @@
    [clojure.repl :refer [doc]]
    [clojure.tools.logging :as log]
    [dag_unify.core :refer [fail? get-in strip-refs unifyc]]))
+
+(def index-lexicon-on-paths
+  [[:synsem :cat]
+   [:synsem :aux]
+   [:synsem :sem :pred]])

 (defn edn2lexicon [resource]
   (-> (read-string (slurp resource)) ;; read .edn file into a Clojure map.
@@ -45,8 +51,10 @@
                                 :2 '()}
                        :sem {:obj :unspec}}})

-            (verb-pred-defaults encyc/verb-pred-defaults))]
+            (verb-pred-defaults encyc/verb-pred-defaults))
+        indices (create-indices lexicon index-lexicon-on-paths)]
     {:lexicon lexicon
+     :index-fn (fn [spec] (lookup-spec spec indices index-lexicon-on-paths))
      :morph morph
      :generate-fn generate}))


revert changes to parsing that removed caching

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

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

 (defn square-cross-product [x]
   (mapcat (fn [each-x]
@@ -183,8 +167,9 @@
                                       right-lexemes (mapcat (fn [string]
                                                               (lookup model string))
                                                             right-strings)
-                                      left-signs (vec (lazy-cat left-lexemes (filter map? left)))
-                                      right-signs (vec (lazy-cat right-lexemes (filter map? right)))]
+                                      left-signs (lazy-cat left-lexemes (filter map? left))
+                                      right-signs (lazy-cat right-lexemes (filter map? right))
+                                      ]
                                   (lazy-cat
                                    (if (and (not (empty? left-signs))
                                             (not (empty? right-signs)))
@@ -273,7 +258,6 @@
                                    (map (fn [i] [(nth tokens i)])
                                         token-count-range))]
              (log/debug (str "input map:" input-map))
-;;             (println (str "input map:" input-map))
              (let [all-parses
                    (parses input-map token-count model
                            (span-map token-count) parse-with-truncate)


handle visibility param and default to public

--- server/src/gratefulplace/db/maprules.clj
+++ server/src/gratefulplace/db/maprules.clj
@@ -41,6 +41,9 @@
   (attr :title :topic/title)
   (attr :post-count (ref-count :post/topic))
   (attr :author-id (comp :db/id :content/author))
+  (attr :visibility #(clojure.string/replace (str (:topic/visibility %))
+                                             #":visibility/"
+                                             ""))
   (attr :last-posted-to-at (comp format-date :topic/last-posted-to-at))
   (has-one :first-post
            :rules gratefulplace.db.maprules/ent->post
@@ -127,6 +130,10 @@
   (attr :topic/title :title)
   (attr :topic/first-post :post-id)
   (attr :topic/last-posted-to-at nowfn)
+  (attr :topic/visibility (fn [topic]
+                            (if-let [visibility (:visibility topic)]
+                              (symbol (str ":visibility/" visibility))
+                              :visibility/public)))
   (attr :content/author :author-id)
   (attr :content/deleted (constantly false)))


Improve argument name.

Improve argument name.

--- src/afterglow/effects.clj
+++ src/afterglow/effects.clj
@@ -320,13 +320,13 @@
   is true when fading between effects that do not include all the same
   fixtures, or affect different aspects of fixtures."
   {:doc/format :markdown}
-  [effect-name from-effect to-effect phase]
-  {:pre [(some? *show*) (some? effect-name) (satisfies? IEffect from-effect) (satisfies? IEffect to-effect)]}
+  [fade-name from-effect to-effect phase]
+  {:pre [(some? *show*) (some? fade-name) (satisfies? IEffect from-effect) (satisfies? IEffect to-effect)]}
   (params/validate-param-type phase Number)
   (let [snapshot (rhythm/metro-snapshot (:metronome *show*))
         phase (params/resolve-unless-frame-dynamic phase *show* snapshot)]
     ;; Could optimize for a non-dymanic phase, but that seems unlikely to be useful.
-    (Effect. effect-name
+    (Effect. fade-name
              always-active
              (fn [show snapshot]
                (let [v (params/resolve-param phase show snapshot)]


CLJ-2220 Fix ns :use spec regarding prefix lists

Signed-off-by: Alex Miller <99328387f8334f68433c424d2dfd83062f62754b@cognitect.com>

--- src/main/clojure/clojure/core/specs/alpha.clj
+++ src/main/clojure/clojure/core/specs/alpha.clj
@@ -148,17 +148,23 @@
                  :lib simple-symbol?
                  :filters ::filters)))

+;; same as ::prefix-list, but with ::use-libspec instead
 (s/def ::use-prefix-list
   (s/spec
     (s/cat :prefix simple-symbol?
-           :suffix (s/* (s/alt :lib simple-symbol? :prefix-list ::use-prefix-list))
-           :filters ::filters)))
+           :libspecs (s/+ ::use-libspec))))
+
+;; same as ::libspec, but also supports the ::filters options in the libspec
+(s/def ::use-libspec
+  (s/alt :lib simple-symbol?
+         :lib+opts (s/spec (s/cat :lib simple-symbol?
+                                  :options (s/keys* :opt-un [::as ::refer ::exclude ::only ::rename])))))

 (s/def ::ns-use
   (s/spec (s/cat :clause #{:use}
-            :libs (s/* (s/alt :lib simple-symbol?
-                              :prefix-list ::use-prefix-list
-                              :flag #{:reload :reload-all :verbose})))))
+                 :libs (s/+ (s/alt :libspec ::use-libspec
+                                   :prefix-list ::use-prefix-list
+                                   :flag #{:reload :reload-all :verbose})))))

 (s/def ::ns-load
   (s/spec (s/cat :clause #{:load}


predicates for conversion pattern recognition

--- src/clj/sol/core.clj
+++ src/clj/sol/core.clj
@@ -8,7 +8,29 @@
    [:core 5]
    [:wormhole 1]])

+(def layer-cells
+  (into {} sol-layers))
+
+(def layer-names
+  (map first sol-layers))
+
 (def sol-epsilon 0.013)
+
+(defn layer-index
+  [layer]
+  (.indexOf layer-names layer))
+
+(defn diff-ns
+  [ns]
+  (loop [prev (first ns)
+         ns (rest ns)
+         diffs []]
+    (if (empty? ns)
+      diffs
+      (recur
+       (first ns)
+       (rest ns)
+       (conj diffs (- (first ns) prev))))))

 (defn radial-before
   [n limit]
@@ -252,3 +274,52 @@

      :else (move-ship game color from to))))

+(defn harvest-pattern?
+  [board cells [layer cell]]
+  (and
+   (= 2 (count cells))
+   (= 1 (count (set (cons layer (map first cells)))))
+   (let [[[_ a-cell] [_ b-cell]] cells
+         cells-in-layer (get layer-cells layer)
+         before (radial-before cell cells-in-layer)
+         after (radial-after cell cells-in-layer)]
+     (= (sort [a-cell b-cell]) (sort [before after])))))
+
+(defn build-pattern?
+  [board cells [layer cell]]
+  (and
+   (= 2 (count cells))
+   (= 1 (count (set (cons layer (map first cells)))))
+   (let [[[_ a-cell] [_ b-cell]] cells
+         cells-in-layer (get layer-cells layer)
+         before (radial-before cell cells-in-layer)
+         after (radial-after cell cells-in-layer)
+         signature (sort [a-cell b-cell])]
+     (or
+      (= signature (sort [cell after]))
+      (= signature (sort [cell before]))))))
+
+(defn bridge-pattern?
+  [board cells to]
+  (and
+   (= 2 (count cells))
+   (let [[a b] (sort-by (comp layer-index first) cells)
+         layer-order (map (comp layer-index first) (concat [a b] [to]))
+         diffs (diff-ns layer-order)]
+     (and
+      (= diffs (list 1 1))
+      (adjacent-cells? board a b)
+      (adjacent-cells? board b to)))))
+
+(defn transmit-pattern?
+  [board cells [layer cell]]
+  (and
+   (= 3 (count cells))
+   (let [[a b c] cells])))
+
+(defn pattern-present?
+  [game color at type]
+  ())
+
+(defn convert-action
+  [game color at type])


Refine to code expression to pileup without option

--- src/cljam/pileup.clj
+++ src/cljam/pileup.clj
@@ -16,7 +16,7 @@

 (defn pileup
   ([bam-reader rname]
-   (plp/pileup bam-reader rname))
+   (pileup bam-reader rname {}))
   ([bam-reader rname option]
    (pileup bam-reader rname -1 -1 option))
   ([bam-reader rname start end option]


removing debug

removing debug

--- src/clojure/core.clj
+++ src/clojure/core.clj
@@ -264,9 +264,6 @@
         totals (reduce
                 (fn [acc frame]
                   (let [frame-stats (first (vals frame))]
-                    (println :frame frame-stats)
-                    (println fields)
-                    (println acc)
                     (reduce
                      (fn [local-acc field]
                        (let [v (get frame-stats field)]


Extracting spectrum calculation

Extracting spectrum calculation

--- src/clojure/core.clj
+++ src/clojure/core.clj
@@ -134,9 +134,33 @@
     file-sample-rate))

 (defn extract-fundemental-frequency [wave-data block-size sample-rate]
-  (let [r (double-array 1)]
-    (xtract/xtract_wavelet_f0 wave-data block-size (xtract-args sample-rate) r)
-    (first r)))
+    (let [r (double-array 1)]
+      (xtract/xtract_wavelet_f0 wave-data block-size (xtract-args sample-rate) r)
+      (first r)))
+
+(defn extract-spectrum
+  ([windowed-data block-size sample-ratio spectrum-type]
+   (extract-spectrum windowed-data block-size sample-ratio spectrum-type 0.0 0.0))
+  ([windowed-data block-size sample-ratio spectrum-type db-component normalised]
+
+   (let [spectrum (c-double block-size)]
+     (xtract/xtract_spectrum windowed-data
+                             block-size (xtract-args sample-ratio
+                                                     spectrum-type
+                                                     db-component
+                                                     normalised)
+                             spectrum)
+     spectrum)))
+
+(defn extract-fft-spectrum [wave-data block-size sample-rate full-window]
+  (let [windowed (c-double block-size)]
+    (xtract/xtract_windowed wave-data block-size (xtract/doublea_to_voidp full-window) windowed)
+    (xtract/xtract_init_fft block-size xtract-spectrum)
+
+    (let [spectrum (extract-spectrum windowed block-size (/ sample-rate block-size) xtract-spectrum-magnitude)]
+      (xtract/xtract_free_fft)
+      (xtract/delete_double_array windowed)
+      spectrum)))

 (defn raise-errors [result]
     (cond
@@ -202,20 +226,9 @@
                       midi     (if (> f0 0.0)
                                  (Integer/parseInt (format "%.0f" (/ cents 100)))
                                  0)
-
-                      windowed (c-double block-size)
-                      spectrum (c-double block-size)
                       peaks    (c-double block-size)

-                      wa (c-double 1)]
-
-                  ;;(xtract/double_array_setitem wa 0 0.0)
-
-                  (xtract/xtract_windowed wav-data block-size (xtract/doublea_to_voidp full-window) windowed)
-                  (xtract/xtract_init_fft block-size xtract-spectrum)
-                  (xtract/xtract_spectrum windowed block-size (xtract-args SAMPLE_RATE_RATIO xtract-spectrum-magnitude 0.0 0.0)
-                                          spectrum)
-                  (xtract/xtract_free_fft)
+                      spectrum (extract-fft-spectrum wav-data block-size SAMPLE_RATE full-window)]

                   (xtract/xtract_peak_spectrum spectrum
                                                half-block-size
@@ -269,7 +282,6 @@

                       ;;TODO: More memory, probably slower... Re-using variables faster but sad
                       (xtract/delete_double_array wav-data)
-                      (xtract/delete_double_array windowed)
                       (xtract/delete_double_array spectrum)
                       (xtract/delete_double_array peaks)


just returning the first 30 chunks in the json format via the /chunks route

--- src/bitfondue/handler.clj
+++ src/bitfondue/handler.clj
@@ -14,12 +14,17 @@
             [buddy.auth.backends.token :refer [jwe-backend]]
             [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
             [bitfondue.config :as config]
-            (bitfondue.models [users :as users]))
+            (bitfondue.models [users :as users]
+                              [chunks :as chunks]))
   (:use [ring.adapter.jetty :as ring])
   (:gen-class))

 (defn ok [d] {:status 200 :body d})
 (defn bad-request [d] {:status 400 :body d})
+
+(defn chunks
+  [request]
+  (ok {:chunks (chunks/get-chunks)}))

 (defn home
   [request]
@@ -48,6 +53,7 @@
 (defroutes app-routes
   (GET "/" [] "Success!")
   (GET "/dashboard" [] home)
+  (GET "/chunks" [] chunks)
   (POST "/login" [] login)
   (route/resources "/")
   (route/not-found "Not Found"))


Document byte bufs fns

Document byte bufs fns

--- src/caesium/byte_bufs.clj
+++ src/caesium/byte_bufs.clj
@@ -4,10 +4,25 @@
   (:import (java.nio ByteBuffer)))

 (defn ^ByteBuffer ->indirect-byte-buf
+  "Convert buffer to a [[ByteBuffer]].
+
+  If the input is not a byte buffer already, will be converted to an
+  indirect byte buffer. For example, a byte array will just be
+  wrapped. If the input is already a byte buffer, return it
+  unmodified, *even if it was a direct byte buffer*. (This might seem
+  confusing, but is generally what callers of this API want.)"
   [x]
   (bs/convert x ByteBuffer {:direct? false}))

 (defn ^ByteBuffer ->direct-byte-buf
+  "Convert buffer to a [[ByteBuffer]].
+
+  If the input is not a byte buffer already, will be converted to a
+  direct byte buffer. For example, a byte array will be copied into a
+  newly allocated direct byte buffer. If the input is already a byte
+  buffer, return it unmodified, *even if it was an indirect byte
+  buffer*. (This might seem confusing, but is generally what callers
+  of this API want.)"
   [x]
   (bs/convert x ByteBuffer {:direct? true}))


CLJS-334: produce sane error message when ctor arg to new is not a symbol

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -526,6 +526,7 @@

 (defmethod parse 'new
   [_ env [_ ctor & args :as form] _]
+  (assert (symbol? ctor) "First arg to new must be a symbol")
   (disallowing-recur
    (let [enve (assoc env :context :expr)
          ctorexpr (analyze enve ctor)


change cljs.compiler/with-core-cljs so it may take no arguments or just options

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -860,11 +860,13 @@

 (defn with-core-cljs
   "Ensure that core.cljs has been loaded."
-  [opts body]
-  (do
-    (when-not (get-in @env/*compiler* [::ana/namespaces 'cljs.core :defs])
-      (ana/analyze-file "cljs/core.cljs" opts))
-    (body)))
+  ([] (with-core-cljs nil))
+  ([opts] (with-core-cljs opts (fn [])))
+  ([opts body]
+     (do
+       (when-not (get-in @env/*compiler* [::ana/namespaces 'cljs.core :defs])
+         (ana/analyze-file "cljs/core.cljs" opts))
+       (body))))

 (defn url-path [^File f]
   (.getPath (.toURL (.toURI f))))