Switch to boot-sim

Switch to boot-sim

--- build.boot
+++ build.boot
@@ -5,6 +5,7 @@

                   ;; Simulant & Friends
                   [com.datomic/simulant "0.1.7" :exclusions [com.datomic/datomic-free]]
+                  [io.homegrown/boot-sim "0.2.2"]
                   [org.craigandera/causatum "0.3.0"]

                   ;; Datomic & Friends
@@ -32,239 +33,35 @@
 (#'clojure.core/load-data-readers)
 (set! *data-readers* (.getRawRoot #'*data-readers*))

+(require '[io.homegrown.boot-sim :refer :all])

-(require '[datomic.api :as d])
+(def datomic-uri "datomic:free://localhost:4334/sample-sim")

-(deftask bootstrap
-  "Bootstrap a Datomic database with simulation schema."
-  [d uri          URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f bootstrap-fn FN  sym "Fully-qualified database bootstrap function that takes a single URI argument (e.g. simulation.db/bootstrap!)"]
-  (if (and uri bootstrap-fn)
-    (do
-      (require (symbol (namespace bootstrap-fn)))
-      ((resolve bootstrap-fn) uri))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not bootstrap-fn (boot.util/fail "The --bootstrap-fn option is required!\n"))
-      (*usage*))))
+;; Setup boot-sim for interacting with sims from the command-line
+(task-options!
+  bootstrap       {:uri datomic-uri
+                   :bootstrap-fn 'simulation.db/bootstrap!}
+  create-model    {:uri datomic-uri
+                   :create-fn 'simulation.model/create-model!
+                   :type :model.type/sample}
+  list-models     {:uri datomic-uri
+                   :list-fn 'simulation.model/list-models}
+  create-test     {:uri datomic-uri
+                   :create-fn 'simulation.test/create-test!
+                   :host-name "http://dockerhost:8080"
+                   :duration 1
+                   :concurrency 1}
+  list-tests      {:uri datomic-uri
+                   :list-fn 'simulation.test/list-tests}
+  run-sim         {:uri datomic-uri
+                   :run-fn 'simulation.sim/run-sim!
+                   :processes 1
+                   :speed 1}
+  list-sims       {:uri datomic-uri
+                   :list-fn 'simulation.sim/list-sims}
+  validate-sim    {:uri datomic-uri
+                   :validate-fn 'simulation.validations/validate}
+  validate-latest {:uri datomic-uri
+                   :validate-fn 'simulation.validations/validate
+                   :lookup-fn 'simulation.sim/latest-sim})

-(deftask create-model
-  "Create a model to generate a test against."
-  [d uri         URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f create-fn   FN  sym "Fully-qualified model create function that takes four options; uri, name, description and type (e.g. simulation.model/create-model!)."
-   n name        VAL str "Model name."
-   t type        KW  kw  "Fully-qualified model type (e.g. :model.type/sample)."
-   _ description VAL str "Description of model (optional)."]
-  (if (and uri create-fn name type)
-    (do
-      (require (symbol (namespace create-fn)))
-      ((resolve create-fn) uri name description type))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not create-fn (boot.util/fail "The --create-fn option is required!\n"))
-      (if-not name (boot.util/fail "The --name option is required!\n"))
-      (if-not type (boot.util/fail "The --type option is required!\n"))
-      (*usage*))))
-
-(deftask list-models
-  "List the available models in the database."
-  [d uri    URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f list-fn FN  sym "Fully qualified function that returns model entities (takes: db)"]
-  (if (and uri list-fn)
-    (let [db     (d/db (d/connect uri))
-          _      (require (symbol (namespace list-fn)))
-          models (->> ((resolve list-fn) db)
-                      (map #(select-keys % [:model/name])))]
-      (if (seq models)
-        (clojure.pprint/print-table models)
-        (println "No models in database.")))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not list-fn (boot.util/fail "The --list-fn option is required!\n"))
-      (*usage*))))
-
-(deftask create-test
-  "Create a test from a given model."
-  [d uri         URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f create-fn   FN  sym "Fully qualified function that creates a test (takes: uri, model-name, test-name, duration, agent-count)"
-   m model-name  VAL str "The model name to generate the test from"
-   n test-name   VAL str "The name of the test"
-   u host-name   URI str "URI of the target system (e.g. http://dockerhost:8080)"
-   t duration    MIN int "The number of minutes to run"
-   c concurrency N   int "The number of agents to run simultaneously"]
-  (if (and uri model-name test-name host-name duration concurrency)
-    (do
-      (require (symbol (namespace create-fn)))
-      ((resolve create-fn) uri model-name test-name host-name duration concurrency))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not create-fn (boot.util/fail "The --create-fn option is required!\n"))
-      (if-not model-name (boot.util/fail "The --model-name option is required!\n"))
-      (if-not test-name (boot.util/fail "The --test-name option is required!\n"))
-      (if-not host-name (boot.util/fail "The --host-name option is required!\n"))
-      (if-not duration (boot.util/fail "The --duration option is required!\n"))
-      (if-not concurrency (boot.util/fail "The --concurrency option is required!\n"))
-      (*usage*))))
-
-(deftask list-tests
-  "List the available tests in the database."
-  [d uri    URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f list-fn FN  sym "Fully qualified function that returns test entities (takes: db)"]
-  (if (and uri list-fn)
-    (let [db     (d/db (d/connect uri))
-          _      (require (symbol (namespace list-fn)))
-          tests (->> ((resolve list-fn) db)
-                      (map #(select-keys % [:test/name])))]
-      (if (seq tests)
-        (clojure.pprint/print-table tests)
-        (println "No tests in database.")))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not list-fn (boot.util/fail "The --list-fn option is required!\n"))
-      (*usage*))))
-
-(deftask run-sim
-  "Run a sim from a given test."
-  [d uri         URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f run-fn      FN  sym "Fully-qualified function that runs a sim (takes: uri, test-name, processes, acceleration-factor)."
-   n test-name   VAL str "Test name to simulate."
-   p processes   N   int "How many Clojure agents will host the sim agents?"
-   s speed       N   int "Speed to run the sim at (e.g. '2' means 2x as fast). "]
-  (if (and uri run-fn test-name processes speed)
-    (do
-     (require (symbol (namespace run-fn)))
-     ((resolve run-fn) uri test-name processes speed))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not run-fn (boot.util/fail "The --run-fn option is required!\n"))
-      (if-not test-name (boot.util/fail "The --test-name option is required!\n"))
-      (if-not processes (boot.util/fail "The --processes option is required!\n"))
-      (if-not speed (boot.util/fail "The --speed option is required!\n"))
-      (*usage*))))
-
-(deftask list-sims
-  "List the available sims in the database."
-  [d uri       URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f list-fn   FN  sym "Fully qualified function that returns sim entities (takes: db, test-query <may be nil>)"
-   n test-name VAL str "Test name to limit results by."]
-  (if (and uri list-fn)
-    (let [db     (d/db (d/connect uri))
-          _      (require (symbol (namespace list-fn)))
-          sims   (->> ((resolve list-fn) db test-name)
-                      (sort-by :created))]
-      (if (seq sims)
-        (clojure.pprint/print-table [:sim :test-name :created] sims)
-        (println (str "No sims in database"
-                      (if test-name
-                        (str "(for test " test-name ").")
-                        ".")))))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not list-fn (boot.util/fail "The --list-fn option is required!\n"))
-      (*usage*))))
-
-(deftask validate-sim
-  "Validate a given sim."
-  [d uri         URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f validate-fn FN  sym "Fully-qualified function that validates a sim (takes: uri, sim-id)."
-   s sim-id      N   int "ID of the simulation"]
-  (if (and uri validate-fn sim-id)
-    (do
-      (require (symbol (namespace validate-fn)))
-      (let [errors ((resolve validate-fn) uri sim-id)]
-        (if (seq errors)
-          (do
-            (println (str "Sim " sim-id " had validation errors:"))
-            (clojure.pprint/pprint errors))
-          (println (str "Sim " sim-id " had no validation errors.")))))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not validate-fn (boot.util/fail "The --validate-fn option is required!\n"))
-      (if-not sim-id (boot.util/fail "The --sim-id option is required!\n"))
-      (*usage*))))
-
-
-(deftask validate-latest
-  "Validate the latest sim for a given test-name."
-  [d uri         URI str "Datomic database URI (e.g. \"datomic:free://localhost:4334/sample-sim\")"
-   f validate-fn FN  sym "Fully-qualified function that validates a sim (takes: uri, sim-id)."
-   n test-name   VAL str "Test name to look-up sims by."
-   l lookup-fn   FN  sym "Fully-qualified function that looks up latest sim for test-name (takes: db, test-name)." ]
-  (if (and uri validate-fn test-name lookup-fn)
-    (do
-      (require (symbol (namespace validate-fn)))
-      (let [db     (d/db (d/connect uri))
-            sim-id ((resolve lookup-fn) db test-name)
-            errors ((resolve validate-fn) uri sim-id)]
-        (if (seq errors)
-          (do
-            (println (str "Sim " sim-id " had validation errors:"))
-            (clojure.pprint/pprint errors))
-          (println (str "Sim " sim-id " had no validation errors.")))))
-    (do
-      (if-not uri (boot.util/fail "The --uri option is required!\n"))
-      (if-not validate-fn (boot.util/fail "The --validate-fn option is required!\n"))
-      (if-not test-name (boot.util/fail "The --test-name option is required!\n"))
-      (if-not lookup-fn (boot.util/fail "The --lookup-fn option is required!\n"))
-      (*usage*))))
-
-
-(comment
-  (bootstrap
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.db/bootstrap!"
-    )
-
-  (create-model
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.model/create-model!"
-    "-n" "Sample Model"
-    "-t" "model.type/sample"
-    )
-
-  (list-models
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.model/list-models"
-    )
-
-  (create-test
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.test/create-test!"
-    "-m" "Sample Model"
-    "-n" "Sample Test"
-    "-u" "http://dockerhost:8080"
-    "-t" "1"
-    "-c" "1"
-    )
-
-  (list-tests
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.test/list-tests"
-    )
-
-  (run-sim
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.sim/run-sim!"
-    "-n" "Sample Test"
-    "-p" "1"
-    "-s" "1"
-    )
-
-  (list-sims
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.sim/list-sims"
-    )
-
-  (validate-sim
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.validations/validate"
-    "-s" "457396837156256"
-    )
-
-  (validate-latest
-    "-d" "datomic:free://localhost:4334/sample-sim"
-    "-f" "simulation.validations/validate"
-    "-l" "simulation.sim/latest-sim"
-    "-n" "Sample Test"
-    )
-  )


Refactor dependencies and requires

Refactor dependencies and requires

Now the deps are explicitely def-ed and required exactly where it is necessary.

--- build.boot
+++ build.boot
@@ -1,7 +1,6 @@
 ;; Copyright © 2016, JUXT LTD.

 (set-env!
- :target-path "target/dev"
  :source-paths #{"sass" "src"}
  :resource-paths #{"resources"}
  :asset-paths #{"assets"}
@@ -9,8 +8,10 @@
  '[[io.dominic/boot-cljs "1.7.228-3" :scope "test"]
    [adzerk/boot-cljs-repl "0.3.0" :scope "test"]
    [adzerk/boot-reload "0.4.0" :scope "test"]
-   [deraen/boot-less "0.5.0"]
+   [deraen/boot-less "0.5.0" :scope "test"]
    [mathias/boot-sassc "0.1.5" :scope "test"]
+   [pandeiro/boot-http "0.7.3" :scope "test"]
+
    [org.clojure/clojure "1.8.0"]
    [org.clojure/tools.nrepl "0.2.12"]
    [org.clojure/tools.logging "0.3.1"]
@@ -24,20 +25,13 @@
    [weasel "0.7.0" :scope "test"];; Websocket Server
    [io.dominic/boot-snippets "0.1.0" :scope "test"]])

-(require '[adzerk.boot-cljs :refer [cljs]]
-         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
-         '[adzerk.boot-reload :refer [reload]]
-         '[boot.pod :as pod]
-         '[clojure.java.shell :as sh]
-         '[mathias.boot-sassc :refer [sass]]
-         '[io.dominic.boot-snippets :refer [with-env]])
-
 (def server-deps
   '[[aleph "0.4.1-beta3"]
     [bidi "1.24.0"]
     [hiccup "1.0.5"]
     [org.omcljs/om "1.0.0-alpha28"]
-    [yada "1.1.0-20160126.014942-13"]
+    [yada "1.1.11"]
+    [aero "1.0.0-beta2"]

     [com.stuartsierra/component "0.3.1"]

@@ -50,10 +44,16 @@
     [org.slf4j/jcl-over-slf4j "1.7.13"]
     [org.slf4j/jul-to-slf4j "1.7.13"]
     [org.slf4j/log4j-over-slf4j "1.7.13"]
-    [ch.qos.logback/logback-classic "1.1.3"
-     :exclusions [org.slf4j/slf4j-api]]
+    [ch.qos.logback/logback-classic "1.1.3" :exclusions [org.slf4j/slf4j-api]]

     [org.clojure/tools.namespace "0.2.10"]])
+
+(def frontend-deps
+  '[[org.omcljs/om "1.0.0-alpha28"]
+    [org.clojure/core.async "0.2.374"]])
+
+(require '[boot.pod :as pod]
+         '[io.dominic.boot-snippets :refer [with-env]])

 (deftask server
   "Develop the server backend"
@@ -83,30 +83,27 @@
 (deftask frontend
   "Simple alias to run frontend application"
   []
+  (require 'adzerk.boot-cljs
+           'adzerk.boot-cljs-repl
+           'adzerk.boot-reload
+           'mathias.boot-sassc)
   (let [reload (resolve 'adzerk.boot-reload/reload)
         cljs-repl (resolve 'adzerk.boot-cljs-repl/cljs-repl)
         cljs (resolve 'adzerk.boot-cljs/cljs)
         cljs-build-deps (resolve 'adzerk.boot-cljs/deps)
         sass (resolve 'mathias.boot-sassc/sass)

-        ;; Front-end dependencies
-        cljs-deps '[[org.omcljs/om "1.0.0-alpha28"]
-                    [org.clojure/core.async "0.2.374"]]
-
-        remove-unneeded-deps
-        (fn [deps]
-          ;; # Reasons to keep each:
-          ;; - adzerk/boot-cljs     The impl stuff needs this as a dep
-          ;; - adzerk/boot-reload   Reloading requires that the cljs namespace of this is pulled in
-          ;; - weasel               Websocket client
-          (filter (comp #{'weasel 'adzerk/boot-cljs 'adzerk/boot-reload 'io.dominic/boot-cljs 'org.clojure/clojurescript} first) deps))
-        cljs-env
-        {:dependencies (-> (boot.core/get-env :dependencies)
-                           remove-unneeded-deps
-                           (concat @@(resolve 'adzerk.boot-cljs/deps))
-                           (concat cljs-deps)
-                           vec)
-         :directories #{"src" "resources"}}]
+        remove-unneeded-deps (fn [deps]
+                               ;; # Reasons to keep each:
+                               ;; - adzerk/boot-cljs     The impl stuff needs this as a dep
+                               ;; - adzerk/boot-reload   Reloading requires that the cljs namespace of this is pulled in
+                               ;; - weasel               Websocket client
+                               (filter (comp #{'weasel 'adzerk/boot-cljs 'adzerk/boot-reload 'io.dominic/boot-cljs 'org.clojure/clojurescript} first) deps))
+        cljs-env {:dependencies (-> (boot.core/get-env :dependencies)
+                                    remove-unneeded-deps
+                                    (concat @@(resolve 'adzerk.boot-cljs/deps))
+                                    (concat frontend-deps)
+                                    vec)}]
     (comp
      (watch)
      (speak)
@@ -121,6 +118,9 @@
      (with-env
        cljs-env
        (cljs :ids #{"edge"} :optimizations :none))
+     (if (> @boot.util/*verbosity* 1)
+       (show :fileset true)
+       identity)
      (target :dir #{"target/dev"}))))

 (deftask dev


Adapt tests to the little api change on crypto interface.

--- test/buddy/test_buddy_core_crypto.clj
+++ test/buddy/test_buddy_core_crypto.clj
@@ -20,7 +20,7 @@
         block6  (hex->bytes "221122112211")]

     (testing "Twofish in CRT mode."
-      (let [engine    (cr/engine :twofish :ctr)
+      (let [engine    (cr/block-cipher :twofish :ctr)
             expected1 (into-array Byte/TYPE [87 -1 115 -99 77 -55 44 27 -41 -4 1 112 12 -56 33 -59])
             expected2 (into-array Byte/TYPE [35 -47 36 126 -1 76 -88 -53 -77 120 -33 17 -125 105 -126 -76])]

@@ -41,7 +41,7 @@
           (is (bytes/equals? result2 block16)))))

     (testing "Aes in :cbc mode"
-      (let [engine   (cr/engine :aes :cbc)
+      (let [engine   (cr/block-cipher :aes :cbc)
             expected (into-array Byte/TYPE [-121 104 86 98 109 -110 53 104 119 -94
                                             -124 -105 92 39 -30 -30])]
         ;; Encrypt
@@ -55,18 +55,18 @@
           (is (bytes/equals? result block16)))))

     (testing "ChaCha Streaming Cipher"
-      (let [engine    (cr/stream-engine :chacha)
+      (let [engine    (cr/stream-cipher :chacha)
             expected1 (into-array Byte/TYPE [14, 37, 45])
             expected2 (into-array Byte/TYPE [-5, 46, -80, -91, 19, -12])]
         (cr/initialize! engine {:iv iv8 :key key :op :encrypt})
-        (let [result1 (cr/process-bytes! engine block3)
-              result2 (cr/process-bytes! engine block6)]
+        (let [result1 (cr/process-block! engine block3)
+              result2 (cr/process-block! engine block6)]
           (is (bytes/equals? result1 expected1))
           (is (bytes/equals? result2 expected2)))

         (cr/initialize! engine {:iv iv8 :key key :op :decrypt})
-        (let [result1 (cr/process-bytes! engine expected1)
-              result2 (cr/process-bytes! engine expected2)]
+        (let [result1 (cr/process-block! engine expected1)
+              result2 (cr/process-block! engine expected2)]
           (is (bytes/equals? result1 block3))
           (is (bytes/equals? result2 block6)))))
 ))


Test test-job-name->version-2

Test test-job-name->version-2

--- test/emender_jenkins/results_test.clj
+++ test/emender_jenkins/results_test.clj
@@ -198,7 +198,7 @@
             "Red Hat Enterprise Linux" (job-name->product-name "test-Red_Hat_Enterprise_Linux-6.2-Book_Name_1-en-US (preview)")
             "Red Hat Enterprise Linux" (job-name->product-name "test-Red_Hat_Enterprise_Linux-7-Book_Name_1-en-US (preview)"))))

-(deftest test-job-name->version
+(deftest test-job-name->version-1
     "Check the emender-jenkins.results/job-name->version function."
     (testing "the emender-jenkins.results/job-name->version function."
         (are [x y] (= x y)
@@ -207,6 +207,15 @@
             "6.2" (job-name->version "test-Red_Hat_Enterprise_Linux-6.2-Book_Name_1-en-US (preview)")
             "7"   (job-name->version "test-Red_Hat_Enterprise_Linux-7-Book_Name_1-en-US (preview)"))))

+(deftest test-job-name->version-2
+    "Check the emender-jenkins.results/job-name->version function."
+    (testing "the emender-jenkins.results/job-name->version function."
+        (are [x y] (= x y)
+            "unknown" (job-name->version "test-Product-Book1-en-US (preview)")
+            "unknown" (job-name->version "test-Product_Name-bad-Book1-en-US (preview)")
+            "unknown" (job-name->version "test-Red_Hat_Enterprise_Linux-6.beta-Book_Name_1-en-US (preview)")
+            "unknown" (job-name->version "test-Red_Hat_Enterprise_Linux-Book_Name_1-en-US (preview)"))))
+
 (deftest test-job-name->book-name
     "Check the emender-jenkins.results/job-name->book-name function."
     (testing "the emender-jenkins.results/job-name->book-name function."


Add tests for compound event queries via HTTP endpoint

--- test/com/puppetlabs/puppetdb/test/http/experimental/event.clj
+++ test/com/puppetlabs/puppetdb/test/http/experimental/event.clj
@@ -106,4 +106,30 @@
                 expected (expected-resource-events-response
                             (utils/select-values basic-events [3])
                             report-hash)]
-            (response-equal? response expected munge-event-values)))))))
+            (response-equal? response expected munge-event-values)))))
+
+    (testing "compound queries"
+      (doseq [[query matches]
+              [[["and"
+                  ["or"
+                    ["=" "resource-title" "hi"]
+                    ["=" "resource-title" "notify, yo"]]
+                  ["=" "status" "success"]]                       [1]]
+               [["or"
+                  ["and"
+                    ["=" "resource-title" "hi"]
+                    ["=" "status" "success"]]
+                  ["and"
+                    ["=" "resource-type" "Notify"]
+                    ["=" "property" "message"]]]                  [1 2]]
+               [["and"
+                  ["=" "status" "success"]
+                  ["<" "timestamp" "2011-01-01T12:00:02-03:00"]]  [1]]
+               [["or"
+                  ["=" "status" "skipped"]
+                  ["<" "timestamp" "2011-01-01T12:00:02-03:00"]]  [1 3]]]]
+        (let [response  (get-response query)
+              expected  (expected-resource-events-response
+                          (utils/select-values basic-events matches)
+                          report-hash)]
+          (response-equal? response expected munge-event-values))))))


Factor out rand-note.

Factor out rand-note.

--- src/osmosis/core.clj
+++ src/osmosis/core.clj
@@ -43,10 +43,14 @@
         :down 0
         0))))

+(defn rand-note
+  [from to]
+  (find-note-name (rand-nth
+                    (range (note from)
+                           (note to)))))
+
 (defnk random-seq-degree-in-key
-  [{root (find-note-name (rand-nth
-                           (range (note :A2)
-                                  (note :A4))))}
+  [{root (rand-note :A2 :B4)}
    {degree (rand-int 8)}
    {direction :closest}]
   (seq-degree-in-key


suppression d'une cle en double dans une map litterale

--- src/paredit/core.clj
+++ src/paredit/core.clj
@@ -552,7 +552,6 @@
                  "hello-\n|  world" "hello-|world"
                  "({:foo :bar}| {:baz :fooz})" "({:foo :bar| :baz :fooz})"
                  "({:foo :bar} |{:baz :fooz})" "({:foo :bar |:baz :fooz})"
-                 "({:foo :bar}| {:baz :fooz})" "({:foo :bar| :baz :fooz})"
                  "({:foo :bar} {|:baz :fooz})" "({:foo :bar} {|:baz :fooz})"
                  "({:baz :fooz|} {:foo :bar})" "({:baz :fooz|} {:foo :bar})"
                  }]


Correct import.

Correct import.

--- src/podload/core.clj
+++ src/podload/core.clj
@@ -3,6 +3,7 @@
             [clojure.edn :as edn]
             [clojure.tools.trace :as trace]
             [taoensso.timbre :as log]
+            [utilza.java :as ujava]
             [environ.core :as env]
             [podload.downloader :as dl])
   (:gen-class))
@@ -37,7 +38,7 @@

 (defn revision-info
   []
-  (let [{:keys [version revision]} (utilza.java/get-project-properties "podload" "podload")]
+  (let [{:keys [version revision]} (ujava/get-project-properties "podload" "podload")]
     (format "Version: %s, Revision %s" version revision)))


Changed appengine-prepare to copy all AOT-compiled classes into WEB-INF/classes. This fixes deployment problems with code using defprotocol.

--- src/leiningen/appengine_prepare.clj
+++ src/leiningen/appengine_prepare.clj
@@ -26,15 +26,10 @@
     (lancet/mkdir {:dir target-classes-dir})
     (lancet/mkdir {:dir target-lib-dir})
     (lancet/copy {:todir (.getPath target-classes-dir)}
-                 (lancet/fileset
-                  {:dir *compile-path*
-                   :includes (str (dash_ prj-application) "/**")}))
+                 (lancet/fileset {:dir *compile-path* :includes "**"}))
     ;; copy important dependencies into WEB-INF/lib
     (lancet/copy {:todir (.getPath target-lib-dir)}
-                 (lancet/fileset
-                  {:dir lib-dir
-                   :includes "*"
-                   :excludes "dev"}))
+                 (lancet/fileset {:dir lib-dir :includes "*" :excludes "dev"}))
     (lancet/copy {:todir (.getPath target-lib-dir)}
                  (lancet/fileset
                   {:dir lib-dev-dir


Tidy imports

Tidy imports

--- src/leiningen/new/cljskel/setup.clj
+++ src/leiningen/new/cljskel/setup.clj
@@ -1,14 +1,13 @@
 (ns {{name}}.setup
   (:require [{{name}}.web :as web]
+            [clojure.java.io :as io]
             [environ.core :refer [env]]
-            [clojure.java.io :as io]
             [nokia.adapter.instrumented-jetty :as instrumented])
-  (:import (java.lang Integer)
-           (java.util.logging LogManager)
-           (com.ovi.common.metrics.graphite GraphiteReporterFactory GraphiteName ReporterState)
-           (com.ovi.common.metrics HostnameFactory)
-           (org.slf4j.bridge SLF4JBridgeHandler)
-           (java.util.concurrent TimeUnit))
+  (:import [com.ovi.common.metrics.graphite GraphiteReporterFactory GraphiteName ReporterState]
+           [com.ovi.common.metrics HostnameFactory]
+           [java.util.concurrent TimeUnit]
+           [java.util.logging LogManager]
+           [org.slf4j.bridge SLF4JBridgeHandler])
   (:gen-class))

 (defn read-file-to-properties [file-name]


CMR-4216 - Make the collection data for directory unlimited in number.

--- search-app/src/cmr/search/site/data.clj
+++ search-app/src/cmr/search/site/data.clj
@@ -31,12 +31,13 @@
 (defn collection-data
   "Get the collection data associated with a provider and tag."
   [context tag provider-id]
-  (->> {:tag-key tag
-        :provider provider-id
-        :result-format {:format :umm-json-results}}
-       (query-svc/make-concepts-query context :collection)
-       (query-exec/execute-query context)
-       :items))
+  (as-> {:tag-key tag
+         :provider provider-id
+         :result-format {:format :umm-json-results}} data
+        (query-svc/make-concepts-query context :collection data)
+        (assoc data :page-size :unlimited)
+        (query-exec/execute-query context data)
+        (:items data)))

 (defn provider-data
   "Create a provider data structure suitable for template iteration to


Fix docstring typo

Fix docstring typo

--- library/src/doo/core.clj
+++ library/src/doo/core.clj
@@ -250,7 +250,7 @@
              to aid debugging
     :paths - a map from runners (keywords) to string commands for bash.
     :exec-dir - a directory path (file) from where runner should be
-                exectuted. Defaults to nil which resolves to the current dir"
+                executed. Defaults to nil which resolves to the current dir"
   ([js-env compiler-opts]
    (run-script js-env compiler-opts {}))
   ([js-env compiler-opts opts]


Formatting

Formatting

--- src/re_view/core.clj
+++ src/re_view/core.clj
@@ -133,7 +133,9 @@

   (def greeting
     (component
-      {:get-initial-state (fn [this] {:first-name "Herbert"})
+      {:get-initial-state
+       (fn [this] {:first-name "Herbert"})
+
        :render
        (fn [this]
          (let [{:keys [first-name]} (view/state this)]


#99 fix formatting

#99 fix formatting

--- benchmarks/cheshire/test/benchmark.clj
+++ benchmarks/cheshire/test/benchmark.clj
@@ -1,12 +1,12 @@
 (ns cheshire.test.benchmark
   (:use [clojure.test])
-    (:require [cheshire.core :as core]
-      [cheshire.custom :as old]
-      [cheshire.generate :as custom]
-      [clojure.data.json :as cj]
-      [clojure.java.io :refer [file input-stream resource]]
-      [clj-json.core :as clj-json]
-      [criterium.core :as bench] [cheshire.core :as core])
+  (:require [cheshire.core :as core]
+            [cheshire.custom :as old]
+            [cheshire.generate :as custom]
+            [clojure.data.json :as cj]
+            [clojure.java.io :refer [file input-stream resource]]
+            [clj-json.core :as clj-json]
+            [criterium.core :as bench])
   (:import (java.util.zip GZIPInputStream)))

 ;; These tests just print out results, nothing else, they also
@@ -69,36 +69,36 @@
   (custom/add-encoder java.net.URL custom/encode-str)
   (is (= "\"http://foo.com\"" (core/encode (java.net.URL. "http://foo.com"))))
   (let [custom-obj (assoc test-obj "url" (java.net.URL. "http://foo.com"))]
-       (println "[+] Custom, all custom fields:")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/decode (core/encode custom-obj)) :verbose)))
+    (println "[+] Custom, all custom fields:")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/decode (core/encode custom-obj)) :verbose)))
   (println "-------------------------------------"))

 (deftest t-bench-custom-kw-coercion
   (println "---- Custom keyword-fn Benchmarks ---")
   (let [t (core/encode test-obj)]
-       (println "[+] (fn [k] (keyword k)) decode")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/decode t (fn [k] (keyword k)))))
-       (println "[+] basic 'true' keyword-fn decode")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/decode t true)))
-       (println "[+] no keyword-fn decode")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/decode t)))
-       (println "[+] (fn [k] (name k)) encode")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/encode test-obj {:key-fn (fn [k] (name k))})))
-       (println "[+] no keyword-fn encode")
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/encode test-obj))))
+    (println "[+] (fn [k] (keyword k)) decode")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/decode t (fn [k] (keyword k)))))
+    (println "[+] basic 'true' keyword-fn decode")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/decode t true)))
+    (println "[+] no keyword-fn decode")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/decode t)))
+    (println "[+] (fn [k] (name k)) encode")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/encode test-obj {:key-fn (fn [k] (name k))})))
+    (println "[+] no keyword-fn encode")
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/encode test-obj))))
   (println "-------------------------------------"))

 (deftest t-large-array
   (println "-------- Large array parsing --------")
   (let [test-array-json (core/encode (range 1024))]
-       (bench/with-progress-reporting
-         (bench/bench (pr-str (core/decode test-array-json)))))
+    (bench/with-progress-reporting
+      (bench/bench (pr-str (core/decode test-array-json)))))
   (println "-------------------------------------"))

 (deftest t-large-geojson-object
@@ -111,6 +111,6 @@
     (bench/quick-bench (core/encode big-test-obj)))
   (println "[+] large geojson decode")
   (let [s (core/encode big-test-obj)]
-       (bench/with-progress-reporting
-         (bench/quick-bench (core/decode s))))
+    (bench/with-progress-reporting
+      (bench/quick-bench (core/decode s))))
   (println "-------------------------------------"))


Disable scientific notation for latency measurement output.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -379,7 +379,7 @@
                          "out:" out "k;"
                          "in-delta:" (delta-cntr :in in) "k/s;"
                          "out-delta:" (delta-cntr :out out) "k/s;"
-                         "latency:" (.getMean latency-probe-collector))
+                         "latency:" (format "%.0f" (.getMean latency-probe-collector)))
                        (.reset latency-probe-collector)
                        (if (not (nil? pipeline))
                          (let [counts (get-counts pipeline)]


Fix thread info fn.

Fix thread info fn.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -77,7 +77,8 @@
                       (in-fn in-data)
                       (.inc in-cntr))
                     (fn []
-                      (.inc in-cntr))))]
+                      (.inc in-cntr))))
+        thread-info-fn (create-thread-info-fn)]
     (.start in-loop)
-    (run-repeat (executor) (fn [] (stats-fn) ((create-thread-info-fn)) (println)) 1000)))
+    (run-repeat (executor) (fn [] (stats-fn) (thread-info-fn) (println)) 1000)))


note for lated

note for lated

--- corpusmaker.clj
+++ corpusmaker.clj
@@ -14,6 +14,10 @@
               [clojure.contrib.lazy-xml :as lxml]
               [clojure.contrib.zip-filter.xml :as zfx]))

+; TODO: rewrite this using http://github.com/marktriggs/xml-picker-seq since
+; using a zipper keeps all the parsed elements in memory which is not suitable
+; for large XML chunks
+
 (defn parse-xml
   "Zipable XML content from any common source"
   [src] (zip/xml-zip (lxml/parse-trim src)))


range in core.cljs, WIP

range in core.cljs, WIP

--- src/core.cljs
+++ src/core.cljs
@@ -290,3 +290,26 @@
   ([x] (lazy-seq (cons x (repeat x))))
   ([n x] (take n (repeat x))))

+(defn range
+  "Returns a lazy seq of nums from start (inclusive) to end
+  (exclusive), by step, where start defaults to 0, step to 1, and end to
+  infinity. When step is equal to 0, returns an infinite sequence of
+  start. When start is equal to end, returns empty list."
+  ([] (range 0 (.MAX_VALUE js/Number)))
+  ([end] (range 0 end 1))
+  ([start end] (range start end 1))
+  ([start end step]
+   (lazy-seq
+    (let [b (chunk-buffer 32)
+          comp (cond (or (zero? step) (= start end)) not=
+                     (pos? step) <
+                     (neg? step) >)]
+      (loop [i start]
+        (if (and (< (count b) 32)
+                 (comp i end))
+          (do
+            (chunk-append b i)
+            (recur (+ i step)))
+          (chunk-cons (chunk b)
+                      (when (comp i end)
+                        (range i end step)))))))))


repl/start-server! now takes a hash-map instead of a vector.

This is what the rest of the code expects. Previously, this would cause a crash:

(repl-server :host "0.0.0.0")

--- src/riemann/repl.clj
+++ src/riemann/repl.clj
@@ -23,8 +23,7 @@
   :port (default 5557)"
   [opts]
   (stop-server!)
-  (let [opts (merge {:port 5557 :host "127.0.0.1"}
-                    (apply hash-map opts))]
+  (let [opts (merge {:port 5557 :host "127.0.0.1"} opts)]
     (def server (nrepl/start-server
                   :port (:port opts)
                   :bind (:host opts)))


Cleanup

Cleanup

--- src/obb_api/core/turn_processor.clj
+++ src/obb_api/core/turn_processor.clj
@@ -27,7 +27,6 @@
         new-game (assoc game :board (dissoc new-board :action-results))]
     (battle-gateway/update-battle new-game)
     (-> new-game
-        (simplify/clean-result)
         (assoc :success (sresult :success)))))

 (defn turn-error-response


Fix arguments error in collect-key-value aggregation.

--- src/onyx/windowing/aggregation.cljc
+++ src/onyx/windowing/aggregation.cljc
@@ -50,7 +50,7 @@
 (defn collect-key-value-aggregation-fn-init [window]
   [])

-(defn collect-key-value-aggregation-fn [window state segment]
+(defn collect-key-value-aggregation-fn [window segment]
   (get segment (second (:window/aggregation window))))

 (defn collect-key-value-super-aggregation [window state-1 state-2]


Simplify dev and prod builds

Simplify dev and prod builds

--- build.boot
+++ build.boot
@@ -18,31 +18,14 @@
  '[adzerk.boot-reload :refer [reload]]
  '[pandeiro.boot-http :refer [serve]])

-(deftask build []
-  (cljs))
-
-(deftask run []
+(deftask dev []
   (comp (serve)
         (watch)
+        (speak)
         (reload)
-        (speak)
-        (build)))
+        (cljs :optimizations :none :source-map true)
+        (target)))

-(deftask production []
-  (task-options! cljs {:optimizations :advanced})
-   identity)
-
-(deftask development []
-  (task-options! cljs {:optimizations :none
-                       :unified-mode true
-                       :source-map true}
-                 reload {:on-jsload 'app.app/init})
-   identity)
-
-(deftask dev []
-  (comp (development)
-        (run)))
-
-(deftask produce []
-  (comp (production)
-        (build)))
+(deftask prod []
+  (comp (cljs :optimizations :advanced)
+        (target)))


cleaning up with-temp-files macro :tada:

--- plugins/matross/tasks/temp_file.clj
+++ plugins/matross/tasks/temp_file.clj
@@ -25,13 +25,13 @@
   "Evaluate the body with the names bound to temp file paths on the target machine. After the
    body has been evaluated, delete the temp files from the target machine."
   [conn bindings & body]
-  (cond (some #(= conn %1) bindings)
-        (throw (IllegalArgumentException. "Collission between conn and tempfile bindings."))
-
-        :else
-        `(let [~@(interleave bindings
-                             (map (fn [b] `(get-in (run-task ~conn {:type :temp-file}) [:data :path])) bindings))]
-           (try
-             ~@body
+  (cond
+    (some #(= conn %1) bindings)
+      (throw (IllegalArgumentException. "Collission between conn and tempfile bindings."))
+    :else
+      (let [get-tmpfile (fn [_] `(-> (run-task ~conn {:type :temp-file}) (get-in [:data :path])))]
+        `(let [~@(interleave bindings (map get-tmpfile bindings))
+               cleanup# (str "/bin/rm -f " (clojure.string/join " " ~bindings))]
+           (try ~@body
              (finally
-               (run-task ~conn {:type :command :command (str "/bin/rm -f " (clojure.string/join " " ~bindings))}))))))
+               (run-task ~conn {:type :command :command cleanup#})))))))


Version 0.5.0-SNAPSHOT

Version 0.5.0-SNAPSHOT

--- metlog-vault/project.clj
+++ metlog-vault/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-vault "0.4.0"
+(defproject metlog-vault "0.5.0-SNAPSHOT"
   :description "Repository for long term storage of series data."

   :license {:name "Eclipse Public License"


quoted lemma

quoted lemma

--- src/latte/core.clj
+++ src/latte/core.clj
@@ -139,7 +139,7 @@
   (let [[def-name definition metadata] (handle-defthm :lemma args)]
     `(do
        (def ~def-name ~definition)
-       (alter-meta! (var ~def-name) #(merge % ~metadata))
+       (alter-meta! (var ~def-name) #(merge % (quote ~metadata)))
        [:declared :lemma (quote ~def-name)])))

 ;;{


adding :final-type option to execute-pipeline to create view of result buffer (only useful when result buffer is byte buffer)

--HG--
branch : develop

--- src/simplecl/ops.clj
+++ src/simplecl/ops.clj
@@ -197,12 +197,17 @@
       :verbose - pprint compiled queue and execution time (default false)
       :release - automatic release of all buffers (default true)"
   [{:keys [queue buffers final-out final-size]} &
-   {:keys [final-size verbose release] :or {release true}}]
+   {:keys [final-size final-type verbose release] :or {release true}}]
   (if verbose
     (do (pprint queue) (time (apply cl/enqueue queue)))
     (apply cl/enqueue queue))
   (if final-out
     (let [^Buffer nb (cl/nio-buffer final-out)
+          nb (condp = final-type
+               :int (.asIntBuffer nb)
+               :float (.asFloatBuffer nb)
+               :double (.asDoubleBuffer nb)
+               nb)
           final-size (or final-size (.capacity nb))
           ^Buffer result (cl/slice nb final-size)]
       (when release (apply cl/release buffers))


feat(ccw.e4.model): added :workbench keyword for context lookup

--- ccw.core.e4/src/clj/ccw/e4/model.clj
+++ ccw.core.e4/src/clj/ccw/e4/model.clj
@@ -68,6 +68,7 @@
    :mpart            MPart
    :part             MPart
    :event-broker     IEventBroker
+   :workbench        org.eclipse.ui.IWorkbench
    })

 (defn context-key


added option for openshift host

added option for openshift host

--- src/blog/web_server/web_server_impl.clj
+++ src/blog/web_server/web_server_impl.clj
@@ -154,12 +154,14 @@

 ;;; lifecycle methods, start/stop

-(defn start [{old-server :server port :port ssl :ssl :as this}]
+(defn start [{old-server :server port :port host :host ssl :ssl :as this}]
   (if old-server
     this
     (let [handler (make-handler this)
           options (merge {:port (or port 80)
                           :join? false}
+                         (if host
+                           {:host host})
                          (if (and ssl (not (:via-reverse-proxy? ssl)))
                            (-> (select-keys ssl #{:ssl-port :keystore :key-password})
                                (assoc :ssl? true))))


clean up nomenclature

clean up nomenclature

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10337 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- plugins/SlideExplorer2/src/slide_explorer/view.clj
+++ plugins/SlideExplorer2/src/slide_explorer/view.clj
@@ -187,7 +187,7 @@
       (paint-tiles overlay-tiles-atom screen-state [tile-width tile-height])
       enable-anti-aliasing
       (.setTransform original-transform)
-      (show-mouse-pos screen-state)
+      ;(show-mouse-pos screen-state)
       (.setColor Color/WHITE)
       (.drawString (str (select-keys screen-state [:mouse :x :y :zoom])) 10 20)
       (.drawString (str (absolute-mouse-position screen-state)) 10 40))))
@@ -195,6 +195,7 @@
 ;; Loading visible tiles

 (defn overlay-loader
+  "Creates overlay tiles for visible monochrome tiles in memory."
   [screen-state-atom memory-tile-atom overlay-tiles-atom]
   (let [visible-tile-positions (tiles-in-pixel-rectangle
                                  (screen-rectangle @screen-state-atom)
@@ -211,8 +212,8 @@
                                (multi-color-tile memory-tile-atom tile
                                                  (:channels @screen-state-atom)))))))

-(defn visible-loader
-  "Loads tiles needed for drawing."
+(defn monochrome-loader
+  "Loads monochrome tiles needed for drawing."
   [screen-state-atom memory-tile-atom acquired-images]
   (let [visible-tile-positions (tiles-in-pixel-rectangle
                                  (screen-rectangle @screen-state-atom)
@@ -231,23 +232,23 @@
   "Runs visible-loader whenever screen-state-atom changes."
   [screen-state-atom memory-tile-atom
    overlay-tiles-atom acquired-images]
-  (let [react-mem-fn (fn [_ _] (visible-loader screen-state-atom memory-tile-atom
+  (let [react-monochrome (fn [_ _] (monochrome-loader screen-state-atom memory-tile-atom
                                            acquired-images))
-        react-vis-fn (fn [_ _] (overlay-loader screen-state-atom memory-tile-atom
+        react-overlay (fn [_ _] (overlay-loader screen-state-atom memory-tile-atom
                                                overlay-tiles-atom))
         agent (agent {})]
     (def agent1 agent)
     (reactive/handle-update
       memory-tile-atom
-      react-vis-fn
+      react-overlay
       agent)
     (reactive/handle-update
       screen-state-atom
-      react-mem-fn
+      react-monochrome
       agent)
     (reactive/handle-update
       acquired-images
-      react-mem-fn
+      react-monochrome
       agent)
     ))


Don't need to quote load-facts arguments.

--- src/midje/repl.clj
+++ src/midje/repl.clj
@@ -94,16 +94,9 @@
           (map str namespaces)))

-(defn load-facts
-  "Load given namespaces, described with symbols or strings.
-   If none are given, all the namespaces in the project.clj's
-   :test-paths and :source-paths will be loaded.
-   But if there's no project.clj, all namespaces under \"test\"
-   will be loaded.
-
-   A partial namespace ending in a `*` will load all sub-namespaces.
-   Example: (load-facts 'rose.ideas.*)"
-  [ & args]
+(defn load-facts*
+  "Functional form of `load-facts`."
+  [args]
   (let [[print-level args] (separate-verbosity args)
         desired-namespaces (if (empty? args)
                              (mapcat namespaces-in-dir (paths-to-load))
@@ -116,6 +109,20 @@
     (report-summary print-level)
     nil))

+(defmacro load-facts
+  "Load given namespaces, described with unquoted symbols, as in:
+     (load-facts midje.t-sweet)
+   If no namespaces are given, all the namespaces in the project.clj's
+   :test-paths and :source-paths will be loaded.
+   But if there's no project.clj, all namespaces under \"test\"
+   will be loaded.
+
+   A partial namespace ending in a `*` will load all sub-namespaces.
+   Example: (load-facts midje.ideas.*)"
+  [& args]
+  (let [error-fixed (map #(if (form/quoted? %) (second %) %)
+                         args)]
+    `(load-facts* '~error-fixed)))

                                 ;;; Fetching facts


Make some stuff private

Make some stuff private

--- src/cljs/cglossa/search_inputs/cwb.cljs
+++ src/cljs/cglossa/search_inputs/cwb.cljs
@@ -2,9 +2,9 @@
   (:require [clojure.string :as str]
             [reagent.core :as reagent]))

-(def headword-query-prefix "<headword>")
-(def headword-query-suffix-more-words "[]{0,}")
-(def headword-query-suffix-tag "</headword>")
+(def ^:private headword-query-prefix "<headword>")
+(def ^:private headword-query-suffix-more-words "[]{0,}")
+(def ^:private headword-query-suffix-tag "</headword>")

 (defn- ->headword-query [query]
   (str headword-query-prefix
@@ -18,7 +18,7 @@
       (subs s prefix-len)
       s)))

-(defn without-suffix [s suffix]
+(defn- without-suffix [s suffix]
   (let [suffix-start (- (count s) (count suffix))]
     (if (= (subs s suffix-start) suffix)
       (subs s 0 suffix-start)


Speed up emitting events

Speed up emitting events

Avoid many nested calls by let binding the queues state before looping
over all events.

--- src/cljs/chocolatier/engine/events.cljs
+++ src/cljs/chocolatier/engine/events.cljs
@@ -32,18 +32,19 @@
   (loop [selectors selectors-coll
          accum (array)]
     (let [sel (first selectors)]
-      (if sel
-        (recur (rest selectors)
-               ;; Implicitely add the entity ID to
-               ;; the end of the selectors, this ensures messages
-               ;; are only for the entity
-               (loop [evs (get-in queue [sel entity-id])
-                      acc accum]
-                 (let [e (first evs)]
-                   (if e
-                     (recur (rest evs) (do (.push acc e) acc))
-                     acc))))
-        accum))))
+      (if (nil? sel)
+        accum
+        (recur
+         (rest selectors)
+         ;; Implicitely add the entity ID to
+         ;; the end of the selectors, this ensures messages
+         ;; are only for the entity
+         (loop [evs (get-in queue [sel entity-id] nil)
+                acc accum]
+           (let [e (first evs)]
+             (if (nil? e)
+               acc
+               (recur (rest evs) (do (.push acc e) acc))))))))))

 (defn mk-event
   "Takes message and selectors and formats them for the event representation.
@@ -54,15 +55,24 @@
 (defn emit-event
   "Enqueues an event onto the queue"
   [state msg selectors]
+  (assert (every? keyword? selectors) (str "Invalid selectors: " selectors))
   (let [event (mk-event msg selectors)
         path (into queue-path selectors)]
-    (assert (every? keyword? selectors))
     (update-in state path conj event)))

 (defn emit-events
   "Emits a collection of events at the same time. Returns update game state."
   [state events]
-  (reduce #(emit-event %1 (:msg %2) (:selectors %2)) state events))
+  (let [all-queues (get-in state queue-path)]
+    (assoc-in
+     state
+     queue-path
+     (loop [queues all-queues
+            events events]
+       (let [{:keys [selectors msg] :as event} (first events)]
+         (if (nil? event)
+           queues
+           (recur (update-in queues selectors conj event) (rest events))))))))

 (defn batch-emit-events
   "Batch add events with the same selectors. Events should be a hashmap of id,


Check for current-user loaded in db

Check for current-user loaded in db

--- src/cljs/wombats_web_client/routes.cljs
+++ src/cljs/wombats_web_client/routes.cljs
@@ -3,15 +3,15 @@
     (:require [secretary.core :as secretary]
               [pushy.core :as pushy]
               [re-frame.core :as re-frame]
-              [wombats-web-client.utils.local-storage :refer [get-token]]
-              [wombats-web-client.utils.auth :refer [user-is-coordinator?]]))
+              [wombats-web-client.utils.auth :refer [get-current-user-id
+                                                     user-is-coordinator?]]))

 (defonce history (pushy/pushy secretary/dispatch!
                               (fn [x]
                                 (when (secretary/locate-route x) x))))

 (defn logged-in-checker [logged-in-dispatch]
-  (if (get-token)
+  (if (get-current-user-id)
     (logged-in-dispatch)
     (pushy/set-token! history "/welcome")))


Fix reloading issue registering key listener again

Defonce needs to set var to a truthly value apparently;
https://figwheel.org/docs/reloadable_code.html#page-initialization

--- src/tetris/core.cljs
+++ src/tetris/core.cljs
@@ -164,13 +164,6 @@

 (defonce world-atom (r/atom (new-block empty-world)))

-(defonce key-listener
-  (.addEventListener (.-body js/document) "keydown"
-                     (fn [e]
-                       (when-let [direction ({37 :left, 38 :up, 39 :right, 40 :down}
-                                             (.-keyCode e))]
-                         (move! world-atom direction)))))
-
 (defn tick! []
   (move! world-atom :down)
   (let [tick-frequency (max (- initial-tick-frequency
@@ -178,8 +171,15 @@
                             min-tick-frequency)]
     (js/setTimeout tick! tick-frequency)))

-(defonce game-loop
-  (tick!))
+(defonce initialize
+  (do
+    (.addEventListener (.-body js/document) "keydown"
+                       (fn [e]
+                         (when-let [direction ({37 :left, 38 :up, 39 :right, 40 :down}
+                                               (.-keyCode e))]
+                           (move! world-atom direction))))
+    (tick!)
+    true))

 (defn ^:export run []
   (r/render-component [main-component world-atom]


Deal with state vars in the IR (esp. null state variables)

--- src/pamela/htn.clj
+++ src/pamela/htn.clj
@@ -1313,10 +1313,10 @@
 ;; walk ir, look for pclasses that have non-empty methods
 (defn transform-htn [ir pargs]
   (doseq [[pclass-name v] (seq ir)]
-    (assert pclass-name "Found a nil pclass in the IR")
-    (let [{:keys [type methods]} v]
-      (dbg-println :info "TRANSFORM-HTN" pclass-name)
-      (when (= type :pclass) ;;Could it be anything else?
+    (when (= (:type v) :pclass)
+      (assert pclass-name "Found a nil pclass in the IR")
+      (let [{:keys [type methods]} v]
+        (dbg-println :info "TRANSFORM-HTN" pclass-name)
         (doseq [[mname method-mdefs] (seq methods)]
           (if mname ;; else (dbg-println :debug "no more methods")
             (loop [mi 0 mdef (first method-mdefs) more (rest method-mdefs)]
@@ -1324,14 +1324,14 @@
                 (let [{:keys [temporal-constraints args primitive display-name
                               display-args body]} mdef]
                   (dbg-println :info "  METHOD" mname "MI" mi
-                    "PRIMITIVE" primitive "ARGS" args
-                    "DISPLAY-NAME" display-name "DISPLAY-ARGS" display-args)
+                               "PRIMITIVE" primitive "ARGS" args
+                               "DISPLAY-NAME" display-name "DISPLAY-ARGS" display-args)
                   (when (and (not primitive) body)
                     (if (and (= 1 (count body))
-                          (= :choose (get-in body [0 :type])))
+                             (= :choose (get-in body [0 :type])))
                       (dbg-println :info "  TOP LEVEL CHOOSE!"))
                     (make-htn-methods ir pargs true pclass-name mname mi
-                      display-name display-args args body)))
+                                      display-name display-args args body)))
                 (recur (inc mi) (first more) (rest more))))))))))

 ;; consider memoizing or caching result


start over with new db b/c of schema changes

--- src/pc/datomic.clj
+++ src/pc/datomic.clj
@@ -3,7 +3,7 @@
             [datomic.api :refer [db q] :as d])
   (:import java.util.UUID))

-(def default-uri "datomic:free://localhost:4334/pc")
+(def default-uri "datomic:free://localhost:4334/pc2")

 (defn conn [& {:keys [uri]}]
   (d/connect (or uri default-uri)))


tooltips for actions

tooltips for actions

--- src/whatsoup/web.clj
+++ src/whatsoup/web.clj
@@ -39,7 +39,8 @@
   ([action icon]
    (render-action action icon nil))
   ([action icon idx]
-   [:a {:href (str "/" (name action) (when idx (str "/" idx)))}
+   [:a {:title (str (name action) (when idx " ingredient"))
+        :href  (str "/" (name action) (when idx (str "/" idx)))}
     [(keyword (str "i.fa.fa-" icon))]]))

 (defn zero-to-many-constraint [ingredient]


Remove todo

Remove todo

--- src/discuss/references/integration.cljs
+++ src/discuss/references/integration.cljs
@@ -30,7 +30,7 @@
       (tooltip/hide))))

 (let [clicks (listen (.getElementById js/document "discuss-text") "click")]
-  (go (while true                                           ;; TODO Set a reasonable timeout
+  (go (while true
         (<! clicks)
         (save-selected-text))))


Fix experiment

Fix experiment

--- src/edu/berkeley/ai/scripts/z09_aij.clj
+++ src/edu/berkeley/ai/scripts/z09_aij.clj
@@ -54,7 +54,7 @@
       (cond (= (:type m) :hierarchy)
 	      `(alts/alt-node (hierarchies/get-hierarchy nav-switch/*nav-switch-hierarchy* (strips/constant-predicate-simplify (apply nav-switch/make-nav-switch-strips-env '~(get-ns-args (:size m) (:switches m) (:run m))))))
 	      (= (:type m) :flat-hierarchy)
-	      `(alts/alt-node (hierarchies/get-flat-strips-hierarchy (strips/constant-predicate-simplify (apply nav-switch/make-nav-switch-strips-env '~(get-ns-args (:size m) (:switches m) (:run m)))) (nav-switch/make-flat-nav-switch-heuristic [0 ~(dec (:size m))])))
+	      `(alts/alt-node (strips-hierarchies/get-flat-strips-hierarchy (strips/constant-predicate-simplify (apply nav-switch/make-nav-switch-strips-env '~(get-ns-args (:size m) (:switches m) (:run m)))) (nav-switch/make-flat-nav-switch-heuristic [0 ~(dec (:size m))])))
 	      (= (:type m) :strips)
 	      `(search/ss-node (strips/constant-predicate-simplify (apply nav-switch/make-nav-switch-strips-env '~(get-ns-args (:size m) (:switches m) (:run m)))) (nav-switch/make-flat-nav-switch-heuristic [0 ~(dec (:size m))]))
 	      :else (throw (Exception.))))


alternative burst stuff

alternative burst stuff

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@6990 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/sequence_generator.clj
+++ acqEngine/src/org/micromanager/sequence_generator.clj
@@ -175,40 +175,44 @@
   (if-not (empty? dim) (range (count dim)) '(0)))

 (defn generate-channels-and-slices [settings]
-  (let [{:keys [channels slices slices-first]} settings]
+  (let [{:keys [channels slices slices-first]} settings
+        create-event
+          (fn [c s]
+             {:channel (nth channels c nil)
+              :slice (nth slices s nil)
+              :channel-index c
+              :slice-index s})]
     (if slices-first
       (for [c (index channels)
             s (index slices)]
-        {:channel (nth channels c nil)
-         :slice (nth slices s nil)
-         :channel-index c
-         :slice-index s})
+        (create-event c s))
       (for [s (index slices)
             c (index channels)]
-        {:channel (nth channels nil)
-         :slice (nth slices nil)
-         :channel-index c
-         :slice-index s}))))
+        (create-event c s)))))

 (defn generate-positions-and-frames [settings]
-  (let [{:keys [positions frames time-first]} settings]
+  (let [{:keys [positions frames time-first]} settings
+        create-event
+          (fn [p f]
+            {:position (nth positions p nil)
+             :frame (nth frames f nil)
+             :position-index p
+             :frame-index f})]
     (if time-first
       (for [p (index positions)
             f (index frames)]
-        {:position (nth positions p nil)
-         :frame (nth frames f nil)
-         :position-index p
-         :frame-index f})
+        (create-event p f))
       (for [f (index frames)
             p (index positions)]
-        {:position (nth positions p nil)
-         :frame (nth frames f nil)
-         :position-index p
-         :frame-index f}))))
+        (create-event p f)))))

 (defn merge-layers [positions-and-frames channels-and-slices]
   (for [pf positions-and-frames cs channels-and-slices]
     (merge pf cs)))
+
+(defn sieve [multiples nmax]
+  (take-while #(< % nmax)
+    (for [n (range) :when (some #(zero? (mod n %)) multiples)] n)))

 ; Testing:


Move all database URLs in `regarde.db` to environment variables.

- If it exists. If not, try a hardcoded version.

--- src/regarde/db.clj
+++ src/regarde/db.clj
@@ -4,25 +4,24 @@
             [ragtime.sql.files]))

 (defn db-name [env]
-  (cond
-   (= env :development) "regarde_dev"
-   (= env :test) "regarde_test"
-   (= env :production) "regarde_prod"))
+  (if-let [env-database (env :database-url)]
+    env-database
+    (str "jdbc:postgresql://localhost:5432/"
+         (cond
+          (= env :development) "regarde_dev"
+          (= env :test) "regarde_test"
+          (= env :production) "regarde_prod"))))

 (defn setup [env]
-  (let [name (db-name env)]
-    (sql/defdb database
-      (sql/postgres {:db name
-                     :user "postgres"
-                     :password ""}))))
+  (sql/defdb database (db-name env)))

 (defn perform-migration [env]
-  (let [connection (connection (str "jdbc:postgresql://localhost:5432/" (db-name env)))
+  (let [connection (connection (db-name env))
         migrations (ragtime.sql.files/migrations)]
     (migrate-all connection migrations)))

 (defn teardown [env]
-  (let [connection (connection (str "jdbc:postgresql://localhost:5432/" (db-name env)))
+  (let [connection (connection (db-name env))
         applied-migrations (reverse (applied-migrations connection))
         migrations (ragtime.sql.files/migrations)]
     (when (> (count applied-migrations) 0)


Add unit tests for collection_update

Add unit tests for collection_update

--- test/fcms/unit/resources/collection/collection_update.clj
+++ test/fcms/unit/resources/collection/collection_update.clj
@@ -0,0 +1,146 @@
+(ns fcms.unit.resources.collection.collection-update
+  (:require [midje.sweet :refer :all]
+            [clj-time.core :refer (before?)]
+            [fcms.lib.resources :refer :all]
+            [fcms.lib.check :refer (about-now?)]
+            [fcms.resources.collection :refer :all]
+            [fcms.resources.common :as common]))
+
+;; ----- Fixtures -----
+
+(def new-name (str ascii-name unicode-name))
+
+;; ----- Utilities -----
+
+(defn- delete-all-collections []
+  (doseq [coll (all-collections)]
+    (delete-collection (:slug coll))))
+
+;; ----- Tests -----
+
+(with-state-changes [(before :facts (do
+                                      (reset-collection e)
+                                      (delete-collection c)
+                                      (create-collection c {:custom foo})))
+                      (after :facts (delete-all-collections))]
+
+  (facts "about checking validity of invalid collection updates"
+
+    (fact "when the specified collection doesn't exist"
+      (doseq [coll-slug (conj bad-strings "not-here")]
+        (valid-collection-update coll-slug {}) => :bad-collection))
+
+    (fact "when updating with an invalid slug"
+      (valid-collection-update e {:slug unicode-name}) => :invalid-slug)
+
+    (fact "when updating with the same slug"
+      (valid-collection-update c {:slug e}) => :slug-conflict))
+
+  (facts "about checking validity of valid collection updates"
+
+    (fact "it's valid with no properties"
+      (valid-collection-update e {}) => true)
+
+    (fact "it's valid when updating the name"
+      (valid-collection-update e {:name new-name}) => true)
+
+    (fact "it's valid when updating the slug"
+      (valid-collection-update e {:slug slug}) => true)
+
+    (fact "it's valid when updating a custom property"
+      (valid-collection-update e {:custom bar}) => true)
+
+    (fact "it's valid when adding new custom properties"
+      (valid-collection-update e {:custom2 foo "custom3" bar}) => true)
+
+    (fact "it's valid when updating many things at once"
+      (valid-collection-update e {
+        :name new-name
+        :slug slug
+        :custom bar
+        :custom2 foo}) => true))
+
+  (facts "about collection update failures"
+
+    (fact "when the specified collection doesn't exist"
+      (doseq [coll-slug (conj bad-strings "not-here")]
+        (update-collection coll-slug {}) => :bad-collection))
+
+    (fact "it fails with a provided slug that is invalid"
+      (update-collection e {:slug "i I"}) => :invalid-slug)
+
+    (fact "it fails with a provided slug that is already used"
+      (update-collection e {:slug c}) => :slug-conflict))
+
+  (facts "about updating collections"
+
+    (fact "when updating with no properties"
+      (let [collection (get-collection c)]
+        (:custom collection) => foo
+        (:version collection) => 1)
+      (update-collection c {})
+      (let [collection (get-collection c)]
+        (:custom collection) => nil
+        (:version collection) => 2))
+
+    (fact "when updating the name"
+      (let [collection (get-collection c)]
+        (:name collection) => c
+        (:version collection) => 1)
+      (update-collection c {:name new-name})
+      (let [collection (get-collection c)]
+        (:name collection) => new-name
+        (:version collection) => 2))
+
+    (fact "when updating the slug"
+      (let [collection (get-collection c)]
+        (:slug collection) => c
+        (:version collection) => 1)
+      (update-collection c {:slug slug})
+      ; can no longer retrieve the collection by the old slug
+      (get-collection c) => nil
+      (let [collection (get-collection slug)]
+        (:slug collection) => slug
+        (:version collection) => 2))
+
+    (fact "when updating a custom property"
+      (let [collection (get-collection c)]
+        (:custom collection) => foo
+        (:version collection) => 1)
+      (update-collection c {:custom bar})
+      (let [collection (get-collection c)]
+        (:custom collection) => bar
+        (:version collection) => 2))
+
+    (fact "when updating with new custom properties"
+      (let [collection (get-collection c)]
+        (:custom collection) => foo
+        (:version collection) => 1)
+      (update-collection c {:custom2 foo "custom3" bar})
+      (let [collection (get-collection c)]
+        (:custom2 collection) => foo
+        (:custom3 collection) => bar
+        (:version collection) => 2))
+
+    (fact "when updating with multiple updates"
+      (let [collection (get-collection c)]
+        (:custom collection) => foo
+        (:version collection) => 1)
+      (update-collection c {:name new-name :slug slug :custom2 foo "custom3" bar}) => truthy
+      (let [collection (get-collection slug)]
+        (:name collection) => new-name
+        (:slug collection) => slug
+        (:custom collection) => nil ; drops out because it wasn't in update
+        (:custom2 collection) => foo
+        (:custom3 collection) => bar
+        (:version collection) => 2))
+
+    (fact "about changes to the collection's timestamps"
+      (Thread/sleep 1000) ; delay 1 second since timestamps are at second resolution
+      (update-collection c {})
+      (let [collection (get-collection c)]
+        (instance? timestamp (:created-at collection)) => true
+        (instance? timestamp (:updated-at collection)) => true
+        (about-now? (:updated-at collection)) => true
+        (before? (:created-at collection) (:updated-at collection)) => true
+        (:created-at (get-collection c)) =not=> (:updated-at (get-collection c))))))


Keep reading past the first form by keeping the same stream around

--- src/reply/core.clj
+++ src/reply/core.clj
@@ -43,14 +43,12 @@
            (concat (repeat (- (count (get-prompt *ns*)) 2) \space)
                    [\| \space]))))

+(def jline-pushback-reader (atom nil))
+
 (defn jline-read [request-prompt request-exit]
   (try
     (.setPrompt @jline-reader (get-prompt *ns*))
-    (let [input-stream (clojure.lang.LineNumberingPushbackReader.
-                         (JlineInputReader.
-                           {:jline-reader @jline-reader
-                            :set-empty-prompt set-empty-prompt})
-                         1)]
+    (let [input-stream @jline-pushback-reader]
         (do
           (Thread/interrupted) ; just to clear the status
           (actual-read input-stream request-prompt request-exit)))
@@ -66,7 +64,12 @@
 (defn -main [& args]
   (set-break-handler! handle-ctrl-c)
   (reset! jline-reader (make-reader))
-
+  (reset! jline-pushback-reader
+    (clojure.lang.LineNumberingPushbackReader.
+      (JlineInputReader.
+        {:jline-reader @jline-reader
+         :set-empty-prompt set-empty-prompt})
+      1))
   (repl :read jline-read
         :prompt (fn [] false)
         :need-prompt (fn [] false))


Update the rails AMI

Update the rails AMI

* Add apt configuration so apt-get doesn't prompt for input. Fixes #59
* Add several ubuntu packages so customers don't need to specify them. Fixes #66

--- src/circle/backend/build/inference/gems_map.clj
+++ src/circle/backend/build/inference/gems_map.clj
@@ -3,5 +3,5 @@
 (def gem-package-map
   ;; this is a map of rubygems to the ubuntu packages necessary for this gem to install. Incomplete.
   {"memcached" #{"libmemcached-dev" "libsasl2-dev"}
-   "cdamian-geoip_city" #{"libgeoip-dev"}}
-  )+   "cdamian-geoip_city" #{"libgeoip-dev"}
+   "capybara-webkit" #{"libqtwebkit-dev"}})


rename params for clarity; use unify rather than unifyc where possible

--- src/babel/lexiconfn.cljc
+++ src/babel/lexiconfn.cljc
@@ -864,19 +864,18 @@
                        (list val))))
              vals))))

-;; TODO: s/unifyc/unify/ for performance
-(defn constrain-vals [lexicon if-has-with-fn unify-with-fn]
+(defn constrain-vals [lexicon if-fn then-fn]
   (into {}
         (map (fn [k]
                [k
                 (map
                  (fn [val]
-                   (let [result (unifyc val (if-has-with-fn val))]
+                   (let [result (unifyc val (if-fn val))]
                      (cond (not (fail? result))
                            (do
-                             (log/debug (str val ": matches: if-has-with-fn: "
-                                             if-has-with-fn " then " unify-with-fn))
-                             (unifyc val (unify-with-fn val)))
+                             (log/debug (str val ": matches: constrain-vals:"
+                                             (if-fn val)))
+                             (unify val (then-fn val)))
                            true
                            val)))
                  (get lexicon k))])


add comments

add comments

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -199,6 +199,7 @@
        (string? (get-in word '(:masc :plur))))
       (get-in word '(:masc :plur))

+      ;; <regular adjective morphology rules>
       (and
        (string? (get-in word [:italiano]))
        (or (= (get-in word [:agr :gender]) :masc)
@@ -222,7 +223,8 @@
        (re-find #"e$" (get-in word [:italiano])))
       (string/replace (get-in word [:italiano])
                       #"[e]$" "i") ;; difficile => difficili
-
+      ;; </regular adjective morphology rules>
+
       ;; handle lexical exceptions (plural nouns):
       (and
        (= (get-in word '(:agr :number)) :plur)


cleanup

cleanup

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -802,22 +802,3 @@
                   (unify v
                           {:italiano {:italiano k}}))
                 vals)])))
-
-;; TODO: remove: using phonize2 now instead.
-(defn phonize [a-map a-string]
-  (let [common {:phrasal false}]
-    (cond (or (vector? a-map) (seq? a-map))
-          (map (fn [each-entry]
-                 (phonize each-entry a-string))
-               a-map)
-
-          (and (map? a-map)
-               (not (= :no-italiano (get-in a-map [:italiano] :no-italiano))))
-          (unify {:italiano {:italiano a-string}}
-                  common
-                  a-map)
-
-          true
-          (unify a-map
-                  {:italiano a-string}
-                  common))))


(maint) Make shell-utils/validate-command! public

In some cases it would be advantageous to log a warning at application
startup (or fail to start entirely) if a command is invalid for some
reason. This is not possible while validate-command! is a private
function, so this commit removes the private annotation and moves it
into the public section of shell-utils.

--- src/clj/puppetlabs/puppetserver/shell_utils.clj
+++ src/clj/puppetlabs/puppetserver/shell_utils.clj
@@ -32,8 +32,16 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Internal

-(schema/defn ^:private ^:always-validate
-  validate-command!
+(def default-execution-options
+  {:args []
+   :env nil
+   :in nil})
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Public
+
+(schema/defn ^:always-validate
+validate-command!
   "Checks the command string to ensure that it is an absolute path, executable
   and that the file exists. An exception is thrown if any of those are not the
   case."
@@ -53,14 +61,6 @@
       (not (.canExecute command-file))
       (throw (IllegalArgumentException.
               (trs "The referenced command ''{0}'' is not executable" command))))))
-
-(def default-execution-options
-  {:args []
-   :env nil
-   :in nil})
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Public

 (schema/defn ^:always-validate
   execute-command-streamed :- ExecutionResultStreamed


Removed indenting of xml output

Removed indenting of xml output

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

--- src/main/clojure/conexp/io/contexts.clj
+++ src/main/clojure/conexp/io/contexts.clj
@@ -7,7 +7,7 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.io.contexts
-  (:use conexp.util.xml
+  (:use [conexp.util.xml :only (prxml)]
         conexp.base
         conexp.fca.contexts
         conexp.io.util
@@ -213,12 +213,11 @@

 (define-context-output-format :conexp
   [ctx file]
-  (binding [*prxml-indent* 2]
-    (with-out-writer file
-      (prxml [:decl! {:version "1.0"}])
-      (prxml [:ConceptualSystem
-              [:Version {:MajorNumber "1", :MinorNumber "0"}]
-              [:Contexts (ctx->xml-vector ctx 0)]]))))
+  (with-out-writer file
+    (prxml [:decl! {:version "1.0"}])
+    (prxml [:ConceptualSystem
+            [:Version {:MajorNumber "1", :MinorNumber "0"}]
+            [:Contexts (ctx->xml-vector ctx 0)]])))

 ;; Galicia (.bin.xml)
@@ -238,20 +237,19 @@

         atts-vector (sort #(< (atts %1) (atts %2)) (attributes ctx))
         objs-vector (sort #(< (objs %1) (objs %2)) (objects ctx))]
-    (binding [*prxml-indent* 2]
-      (with-out-writer file
-        (prxml [:decl! {:vecsion "1.0"}])
-        (prxml [:Galicia_Document
-                [:BinaryContext {:numberObj (str (count objs-vector)),
-                                 :numberAtt (str (count atts-vector))}
-                 [:Name "conexp-clj generated context"]
-                 (for [obj objs-vector]
-                   [:raw! (str "\n    <Object>" obj "</Object>")])
-                 (for [att atts-vector]
-                   [:raw! (str "\n    <Attribute>" att "</Attribute>")])
-                 (for [[g m] (incidence-relation ctx)]
-                   [:BinRel {:idxO (str (objs g)),
-                             :idxA (str (atts m))}])]])))))
+    (with-out-writer file
+      (prxml [:decl! {:vecsion "1.0"}])
+      (prxml [:Galicia_Document
+              [:BinaryContext {:numberObj (str (count objs-vector)),
+                               :numberAtt (str (count atts-vector))}
+               [:Name "conexp-clj generated context"]
+               (for [obj objs-vector]
+                 [:raw! (str "\n    <Object>" obj "</Object>")])
+               (for [att atts-vector]
+                 [:raw! (str "\n    <Attribute>" att "</Attribute>")])
+               (for [[g m] (incidence-relation ctx)]
+                 [:BinRel {:idxO (str (objs g)),
+                           :idxA (str (atts m))}])]]))))

 (define-context-input-format :galicia
   [file]


CMR-4396 - Re-enabled :cli, but now only used by CLI (not jobs).

--- search-app/src/cmr/search/site/data.clj
+++ search-app/src/cmr/search/site/data.clj
@@ -35,11 +35,11 @@
   request context which contains the state of a running CMR."
   :execution-context)

-;; (defmethod get-providers :cli
-;;   [context]
-;;   (let [providers-url (format "%sproviders"
-;;                               (config/application-public-root-url :ingest))]
-;;     (util/endpoint-get providers-url {:accept mt/json})))
+(defmethod get-providers :cli
+  [context]
+  (let [providers-url (format "%sproviders"
+                              (config/application-public-root-url :ingest))]
+    (util/endpoint-get providers-url {:accept mt/json})))

 (defmethod get-providers :default
   [context]
@@ -55,16 +55,16 @@
   request context which contains the state of a running CMR."
   (fn [context & args] (:execution-context context)))

-;; (defmethod collection-data :cli
-;;   [context tag provider-id]
-;;   (as-> (config/application-public-root-url :search) data
-;;         (format "%scollections" data)
-;;         (util/endpoint-get data {:accept mt/umm-json-results
-;;                                  :query-params {:provider provider-id
-;;                                                 :tag-key tag
-;;                                                 :page-size 2000}})
-;;         (:items data)
-;;         (sort-by #(get-in % [:umm :EntryTitle]) data)))
+(defmethod collection-data :cli
+  [context tag provider-id]
+  (as-> (config/application-public-root-url :search) data
+        (format "%scollections" data)
+        (util/endpoint-get data {:accept mt/umm-json-results
+                                 :query-params {:provider provider-id
+                                                :tag-key tag
+                                                :page-size 2000}})
+        (:items data)
+        (sort-by #(get-in % [:umm :EntryTitle]) data)))

 (defmethod collection-data :default
   [context tag provider-id]


removal of margins

removal of margins

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/attribute_editor.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/attribute_editor.cljs
@@ -14,8 +14,7 @@
   [:div {:style {:padding "1em 0 2em 0"}} children])

 (defn view-attributes [state refs]
-  [:div {:style {:margin "45px 25px"
-                 :display "inline-block"}}
+  [:div {:style {:display "inline-block"}}
    (style/create-section-header "Workspace Attributes")
    (create-section
      (when (or (:saving? @state) (:deleting? @state))


improve syntax checking for defpath

improve syntax checking for defpath

--- src/clj/com/rpl/specter/macros.clj
+++ src/clj/com/rpl/specter/macros.clj
@@ -113,10 +113,10 @@
   with other selectors without knowing the parameters. When precompiled with other
   selectors, the resulting selector takes in parameters for all selectors in the path
   that needed parameters (in the order in which they were declared)."
-  [params & impls]
+  [params impl1 impl2]
   (let [num-params (count params)
         retrieve-params (make-param-retrievers params)]
-    (paramspath* retrieve-params num-params impls)
+    (paramspath* retrieve-params num-params [impl1 impl2])
     ))

 (defmacro paramsfn [params [structure-sym] & impl]
@@ -153,7 +153,7 @@
    paths as input. Those selector paths may require late-bound params, so this helper
    will create a parameterized selector if that is the case. If no late-bound params
    are required, then the result is executable."
-  [bindings & impls]
+  [bindings impl1 impl2]
   (let [bindings (partition 2 bindings)
         paths (mapv second bindings)
         names (mapv first bindings)
@@ -165,14 +165,14 @@
       latefns-sym
       [latefn-syms latefns-sym]
       (mapcat (fn [n l] [n `(~l ~PARAMS-SYM ~PARAMS-IDX-SYM)]) names latefn-syms)
-      impls)))
+      [impl1 impl2])))

 (defmacro variable-pathed-path
   "This helper is used to define selectors that take in a variable number of other selector
    paths as input. Those selector paths may require late-bound params, so this helper
    will create a parameterized selector if that is the case. If no late-bound params
    are required, then the result is executable."
-  [[latepaths-seq-sym paths-seq] & impls]
+  [[latepaths-seq-sym paths-seq] impl1 impl2]
   (let [latefns-sym (gensym "latefns")]
     (pathed-path*
       paramspath*
@@ -181,7 +181,7 @@
       []
       [latepaths-seq-sym `(map (fn [l#] (l# ~PARAMS-SYM ~PARAMS-IDX-SYM))
                                ~latefns-sym)]
-      impls
+      [impl1 impl2]
       )))

 (defmacro pathed-collector


fix typo in docstring

fix typo in docstring

--- src/clj/com/rpl/specter/macros.clj
+++ src/clj/com/rpl/specter/macros.clj
@@ -603,7 +603,7 @@
   "Return a reducible object that traverses over `structure` to every element
    specified by the path.
    This macro will attempt to do inline factoring and caching of the path, falling
-   back to compiling the path on every invocation it it's not possible to
+   back to compiling the path on every invocation if it's not possible to
    factor/cache the path."
   [apath structure]
   `(i/do-compiled-traverse (path ~apath) ~structure))


Remove console logs :P

Remove console logs :P

--- src/cljs/openslack/views/room.cljs
+++ src/cljs/openslack/views/room.cljs
@@ -75,7 +75,6 @@

 (defn message
   [state owner event]
-  (console/log 33333 (pr-str event))
   (reify
     om/IDisplayName
     (display-name [_] "room-message")


Integrate with Imgur galleries

Integrate with Imgur galleries

--- src/cljs/openslack/views/text.cljs
+++ src/cljs/openslack/views/text.cljs
@@ -61,12 +61,18 @@

 (defmulti convert-http-url
   (fn [url]
-    (.getDomain (Uri. url))))
-
-(defmethod convert-http-url "imgur.com"
+    (keyword (.getDomain (Uri. url)))))
+
+(defmethod convert-http-url :imgur.com
   [url]
-  (let [uri (Uri. url)]
-    (make-image-message (str "http://i.imgur.com" (.getPath uri) ".jpg"))))
+  (let [uri (Uri. url)
+        rpath (.getPath uri)
+        domain "http://i.imgur.com"
+        path (if (str/startswith? rpath "/gallery")
+               (str "/" (str/ltrim rpath "/gallery"))
+               rpath)]
+    (make-image-message (str domain path ".jpg"))))
+

 (defmethod convert-http-url :default
   [url]


refactor baord

refactor baord

--- src/cljs/tictactoe/view/board.cljs
+++ src/cljs/tictactoe/view/board.cljs
@@ -5,15 +5,14 @@
     [tictactoe.view.svg.utils :as utils]))

-(defn render-cell
+(defn- render-cell
   "Dispatch the rendering of the cell based on the player"
-  [type cell-pos options]
-  (let [renderer
-        (case type
-          :cell/empty cell/render-square
-          :cell/cross cell/render-cross
-          :cell/circle cell/render-circle)]
-    (renderer cell-pos options)))
+  [type coord on-move-event]
+  (let [renderer (case type
+                   :cell/empty cell/render-square
+                   :cell/cross cell/render-cross
+                   :cell/circle cell/render-circle)]
+    (renderer coord {:on-click #(on-move-event coord)})))

 (defn render-board
@@ -24,6 +23,5 @@
   (into
     (utils/square-svg-panel board)
     (for [[coord owner] (board/get-cells board)]
-      [render-cell owner coord
-       {:on-click #(on-move-event coord)}]
+      [render-cell owner coord on-move-event]
       )))


Fix bug in recursive deletion after renaming a file

--- src/clojure/nightcode/projects.clj
+++ src/clojure/nightcode/projects.clj
@@ -139,7 +139,7 @@
         (editors/remove-editors selected-path)
         (.mkdirs (.getParentFile new-file))
         (.renameTo (io/file selected-path) new-file)
-        (utils/delete-file-recursively project-path selected-path)
+        (utils/delete-file-recursively @ui/tree-projects selected-path)
         (ui/update-project-tree new-path)))))

 (defn import-project


Tidied up a bit

Tidied up a bit

Default grid is now just kenny and the ground


Genius brain wave!

Genius brain wave!

No more jumping - kenny bounces all the time :)

--- src/cljs/kenny/core.cljs
+++ src/cljs/kenny/core.cljs
@@ -16,14 +16,14 @@

 (def grid-content [
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-           [0 0 0 0 1 0 9 0 0 0 0 0 1 0 0 0 0 0 0 0]
+           [0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0]
            [0 0 0 0 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0]
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
            [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-           [0 1 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 1 0]
+           [9 1 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 1 0]
            [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
            ])

@@ -48,14 +48,14 @@
   )

 (def app-state (atom {:text "Hello Chestnut!"
-                      :hero {:move false
-                             :dx 0
+                      :hero {:dx 0
                              :dy 0
                              :life 100
                              :position (hero-start-position grid-content)
-                             :jump {:time nil :bottom nil}
+                             :bounce 10
                              }
                       :game-over false
+                      :design-game false
                       :grid grid-content}))

 (defn ceil [i]
@@ -102,6 +102,14 @@
         app @app-state]
     (some #{1} [(get-in app (into [:grid] left)) (get-in app (into [:grid] right))]
          )))
+
+(defn on-supporting-block? [position]
+  (let [[left right] (hero-feet-coords position)
+        app @app-state
+        below-left (update-in left [0] + 1)
+        below-right (update-in right [0] + 1)]
+    (some #{1} [(get-in app (into [:grid] left)) (get-in app (into [:grid] right))]
+          )))

 (defn beneath-1px [position]
   (let [{:keys [left bottom]} position]
@@ -171,39 +179,10 @@
       hero
       )))

-(defn gravity [current-vertical jump-time hero]
-  (let [last-bottom (get-in hero [:position :bottom])
-        initial-bottom (get-in hero [:jump :bottom])
-        dt (/ (- (.getTime (js/Date.)) jump-time) 1000)
-        vforce (* 1000 dt)
-        gforce (/ (* 2000 dt dt) 2)
-        height (+ (- vforce gforce) initial-bottom)
-        ]
-      (update-in hero [:position :bottom] (fn [_] height))
-
-      )
-  )
-
-(defn move-vertically [hero]
-  (let [current-vertical (get-in hero [:position :bottom])
-        jump-time (get-in hero [:jump :start])]
-    (if jump-time
-      (gravity current-vertical jump-time hero)
-      hero
-      )
-    )
-  )
-
-(defn ground-resistance [hero]
-  (let [position (get-in hero [:position])
-        coord-y (vertical-coord position)
-        current-tiles (blocks position)]
-    (if (some #{1} current-tiles)
-      (let [new-hero (update-in hero [:position :bottom] (fn [_] (* (+ 1 coord-y) 70)))]
-        (update-in new-hero [:jump :start] (fn [_] nil)))
-      hero
-      )
-    ))
+
+
+
+

 (defn block-resistance [hero]
   (let [position (get-in hero [:position])
@@ -227,80 +206,53 @@
 (defn off-screen [hero]
   hero)

-(defn stop-if-blocked [original-hero new-hero]
-  (let [new-hero-coords (blocks (new-hero :position))]
-    (if (moving? new-hero)
-      (if (> 0 (new-hero :dx))
-        ;; moving left
-        (if (= 1 (first new-hero-coords))
-          (update-in new-hero [:position :left] (fn [_] (get-in original-hero [:position :left])))
-          new-hero
-          )
-        (if (= 1 (last new-hero-coords))
-          (update-in new-hero [:position :left] (fn [_] (get-in original-hero [:position :left])))
-          new-hero
-          )
+(defn bounce [hero]
+  (update-in hero [:position :bottom] + (get-in hero [:bounce]))
+  )
+
+(defn grav [hero]
+  (let [new-hero (update-in hero [:dy] - 0.75)]
+    (update-in new-hero [:position :bottom] + (new-hero :dy))
+    )
+  )
+
+(defn vertical-block [original-hero new-hero]
+  (let [original-bottom (get-in original-hero [:position :bottom])
+        supported (on-supporting-block? (update-in (original-hero :position) [:bottom] - 1))]
+    (if supported
+      (let [nearest-vertical-border (* (ceil (/ original-bottom 70)) 70)
+            newer-hero (update-in new-hero [:position :bottom] (fn [_] nearest-vertical-border))]
+        (update-in newer-hero [:dy] (fn [_] 0))
         )
       new-hero
-      )
-    )
-  )
-
-(defn grav [hero]
-  (let [supported (most-supportive-block (hero :position))]
-    ;;(console-log supported)
-    ;;(console-log (hero :position))
-    (if (= 0 supported)
-      (let [new-hero (update-in hero [:dy] - 5)]
-        (update-in hero [:position :bottom] + (new-hero :dy))
         )
-      hero
-      )))
+      ))
+
+(defn logger [key hero]
+  ;;(console-log {key (get-in hero [:position :left])})
+  hero
+  )

 (defn hero [app owner]
   (reify
     om/IWillMount
     (will-mount [_]
+      (console-log "mounting...")
       (if (>= 0 (get-in @app [:hero :life]))
         (om/update! app [:game-over] true)
         (go-loop []
+          (<! (timeout 30))

           (let [original-hero (get-in @app [:hero])
                 new-hero (-> original-hero
+                             grav
+                             ((partial vertical-block original-hero))
                              move-horizontally
-                             ((partial stop-if-blocked original-hero))
-                             grav
-                             ;; move-vertically
-                             ;; lava-damage
-                             ;; spike-damage
-                             ;; off-screen
-                             ;; ground-resistance
-                             ;; block-resistance
-
-
-                             ;;((partial partial-check original-hero))
+                             bounce
                              )]

-            ;;(console-log (new-hero :jump))
-            (om/update! app [:hero] new-hero)
+            (om/transact! app [:hero] (fn [hero] (merge hero new-hero)))
             )
-
-
-          ;; (om/update! app [:hero :position :bottom] (vertical-position app))
-          ;; (when (= :left (get-in @app [:hero :move]))
-          ;;   (when (can-move :left @app)
-          ;;     (when (in-lava @app)
-          ;;       (om/transact! app [:hero :life] (fn [old] (- old 1)))
-          ;;       )
-          ;;     (om/transact! app [:hero :position :left] (fn [old] (- old 5)))))
-          ;; (when (= :right (get-in @app [:hero :move]))
-          ;;   (when (can-move :right @app)
-          ;;     (when (in-lava @app)
-          ;;       (om/transact! app [:hero :life] (fn [old] (- old 1)))
-          ;;       )
-          ;;     (om/transact! app [:hero :position :left] (fn [old] (+ old 5)))))
-
-          (<! (timeout (/ 1000 60)))
           (recur)
           )
         )
@@ -354,11 +306,8 @@

 (defn start-moving [e app]
   (condp = (aget e "keyCode")
-    88 (om/update! app [:hero :dx] 5)
-    90 (om/update! app [:hero :dx] -5)
-    32 (when (and (on-solid-ground? (get-in @app [:hero :position])) (nil? (get-in @app [:hero :jump :start])))
-         (om/update! app [:hero :jump :start] (.getTime (js/Date.)))
-         (om/update! app [:hero :jump :bottom] (get-in @app [:hero :position :bottom])))
+    88 (om/update! app [:hero :dx] 10)
+    90 (om/update! app [:hero :dx] -10)
     nil
     )
   )
@@ -379,11 +328,12 @@
         (render [_]
           (if (>= 0 (get-in app [:hero :life]))
             (dom/h1 nil "GAME OVER")
-            (dom/div #js {:className "grid" :tabIndex 0 :onKeyUp (fn [e] (stop-moving e app)) :onKeyDown (fn [e] (start-moving e app) (.preventDefault e))}
-                   (om/build status-bar (:hero app))
-                   (om/build hero app)
-                   (om/build grid (:grid app))
-                   )
+            (dom/div nil
+                     (om/build status-bar (:hero app))
+                     (dom/div #js {:className "grid" :tabIndex 0 :onKeyUp (fn [e] (stop-moving e app)) :onKeyDown (fn [e] (start-moving e app) (.preventDefault e))}
+                              (om/build hero app)
+                              (om/build grid (:grid app))
+                              ))
             )
           )))
     app-state


Revert "Confirmation before removing environment variable [CIRCLE-302]"

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -407,34 +407,6 @@
            [:hr]
            (clear-cache-button "source" project-data owner)]]]))))

-(defn remove-env-var-button [{:keys [env-var project-id]} owner]
-  (reify
-    om/IInitState
-    (init-state [_]
-      {:show-modal? false})
-    om/IRenderState
-    (render-state [_ {:keys [show-modal?]}]
-      (html
-       [:span
-        (table/action-button
-         "Remove"
-         (icon/delete)
-         #(om/set-state! owner :show-modal? true))
-        (when show-modal?
-          (let [close-fn #(om/set-state! owner :show-modal? false)]
-            (modal/modal-dialog {:title "Are you sure?"
-                                 :body (html
-                                        [:span
-                                         "Are you sure you want to remove the environment variable \""
-                                         (:name env-var)
-                                         "\"?"])
-                                 :actions [(button/button {:on-click close-fn} "Cancel")
-                                           (button/button {:primary? true
-                                                           :on-click #(raise! owner [:deleted-env-var {:project-id project-id
-                                                                                :env-var-name (:name env-var)}])}
-                                                          "Delete")]
-                                 :close-fn close-fn})))]))))
-
 (defn env-vars [project-data owner]
   (reify
     om/IRender
@@ -445,55 +417,58 @@
             new-env-var-value (:new-env-var-value inputs)
             project-id (project-model/id project)]
         (html
-         [:section
-          [:article
-           [:h2 "Environment Variables for " (vcs-url/project-name (:vcs_url project))]
-           [:div
-            [:p
-             "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
-             "The values can be any bash expression and can reference other variables, such as setting "
-             [:code "M2_MAVEN"] " to " [:code "${HOME}/.m2)"] "."]
-
-            [:p
-             " To disable string substitution you need to escape the " [:code "$"]
-             " characters by prefixing them with " [:code "\\"] "."
-             " For example, a value like " [:code "usd$"] " would be entered as " [:code "usd\\$"] "." ]
-            [:form
-             [:div.form-group
-              [:label "Name"]
-              [:input.form-control#env-var-name
-               {:required true, :type "text", :value new-env-var-name
-                :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-name) %)}]]
-             [:div.form-group
-              [:label "Value"]
-              [:input.form-control#env-var-value
-               {:required true
-                :type "text"
-                :value new-env-var-value
-                :auto-complete "off"
-                :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-value) %)}]]
-
-             [:div.form-group
-              (forms/managed-button
-               [:input.btn.btn-primary {:data-failed-text "Failed",
-                                        :data-success-text "Added",
-                                        :data-loading-text "Adding...",
-                                        :value "Add Variable",
-                                        :type "submit"
-                                        :on-click #(raise! owner [:created-env-var {:project-id project-id}])}])]]
-            (when-let [env-vars (seq (:envvars project-data))]
-              (om/build table/table
-                        {:rows env-vars
-                         :columns [{:header "Name"
-                                    :cell-fn :name}
-                                   {:header "Value"
-                                    :cell-fn :value}
-                                   {:header "Remove"
-                                    :type #{:shrink :right}
-                                    :cell-fn
-                                    (fn [env-var]
-                                      (om/build remove-env-var-button {:env-var env-var
-                                                                       :project-id project-id}))}]}))]]])))))
+          [:section
+           [:article
+            [:h2 "Environment Variables for " (vcs-url/project-name (:vcs_url project))]
+            [:div
+             [:p
+              "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
+              "The values can be any bash expression and can reference other variables, such as setting "
+              [:code "M2_MAVEN"] " to " [:code "${HOME}/.m2)"] "."]
+
+             [:p
+              " To disable string substitution you need to escape the " [:code "$"]
+              " characters by prefixing them with " [:code "\\"] "."
+              " For example, a value like " [:code "usd$"] " would be entered as " [:code "usd\\$"] "." ]
+             [:form
+              [:div.form-group
+               [:label "Name"]
+               [:input.form-control#env-var-name
+                {:required true, :type "text", :value new-env-var-name
+                 :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-name) %)}]]
+              [:div.form-group
+               [:label "Value"]
+               [:input.form-control#env-var-value
+                {:required true
+                 :type "text"
+                 :value new-env-var-value
+                 :auto-complete "off"
+                 :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-value) %)}]]
+
+              [:div.form-group
+               (forms/managed-button
+                 [:input.btn.btn-primary {:data-failed-text "Failed",
+                                          :data-success-text "Added",
+                                          :data-loading-text "Adding...",
+                                          :value "Add Variable",
+                                          :type "submit"
+                                          :on-click #(raise! owner [:created-env-var {:project-id project-id}])}])]]
+             (when-let [env-vars (seq (:envvars project-data))]
+               (om/build table/table
+                         {:rows env-vars
+                          :columns [{:header "Name"
+                                     :cell-fn :name}
+                                    {:header "Value"
+                                     :cell-fn :value}
+                                    {:header "Remove"
+                                     :type #{:shrink :right}
+                                     :cell-fn
+                                     (fn [env-var]
+                                       (table/action-button
+                                        "Remove"
+                                        (icon/delete)
+                                        #(raise! owner [:deleted-env-var {:project-id project-id
+                                                                          :env-var-name (:name env-var)}])))}]}))]]])))))

 (defn advance [project-data owner]
   (reify


require com.kaicode.Famous

require com.kaicode.Famous

--- src/com/kaicode/infamous/core.cljs
+++ src/com/kaicode/infamous/core.cljs
@@ -1,8 +1,8 @@
 (ns ^:figwheel-always com.kaicode.infamous.core
   (:require-macros [cljs.core.async.macros :refer [go]])
-  (:require [cljs.core.async :refer [put! chan]]
-            [datascript :as d]
-            [com.famous.Famous]))
+  (:require [com.kaicode.Famous]
+            [cljs.core.async :refer [put! chan]]
+            [datascript :as d]))

 (enable-console-print!)

@@ -35,10 +35,10 @@
                             :Align      (.. famous -components -Align)})

 (defn- famous-compare [x y]
-      "Compare famous javascript objects. See https://github.com/tonsky/datascript/issues/69"
-      (let [str-x (.. js/JSON (stringify x))
-            str-y (.. js/JSON (stringify y))]
-           (compare str-x str-y)))
+       "Compare famous javascript objects. See https://github.com/tonsky/datascript/issues/69"
+       (let [str-x (.. js/JSON (stringify x))
+             str-y (.. js/JSON (stringify y))]
+            (compare str-x str-y)))

 (extend-protocol IComparable
                  FamousBox (^number -compare [x y]


make state atom

make state atom

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -311,7 +311,6 @@
 (def vis-conf {:width 1300
                :height 360})

-
-;; we can play with this data now. we have a sequence of [string-index
-;; fret-index] or an empty seq if nothing is played
-(take 50 (parse-guitar-tab fast-car-tab))
+;; create an atom for our visualizer's play state
+(def vis-state (atom {:play-list (take 50 (parse-guitar-tab fast-car-tab))
+                      :index 0}))


So long as a letter exists, zone names can now be any length

--- src/hphelper/scengen/generator.clj
+++ src/hphelper/scengen/generator.clj
@@ -222,7 +222,7 @@
   [{zone :zone :as scenRec}]
   (if (and zone
            (string? zone)
-           (= (count zone) 3))
+           (> (count zone) 0))
     scenRec
     (assoc-in scenRec [:zone] (sql/create-random-zone-name))))