Remove outdated SQL statement

Remove outdated SQL statement

--- src/circleci/repl.clj
+++ src/circleci/repl.clj
@@ -11,7 +11,5 @@
              '[clojure.zip :as zip]
              '[clojure.contrib.zip-filter.xml :as zf-xml]
              '[clojure.xml :as xml])
-    (require '[clojure.contrib.sql :as sql])
-
     (use '[circleci.db :only (with-conn)]))
   (println "repl/init done"))


Added prop lookup to defrecord ctor identity check

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -282,8 +282,8 @@
 		  `(~'-hash [this#] (hash-coll this#))
 		  'IEquiv
 		  `(~'-equiv [this# other#]
-         (and (identical? (.constructor this#) ;; TODO: change for prop lookup
-                          (.constructor other#))
+         (and (identical? (.-constructor this#)
+                          (.-constructor other#))
               (equiv-map this# other#)))
 		  'IMeta
 		  `(~'-meta [this#] ~'__meta)


* src/clj/cljs/core.clj: inline nil?

* src/clj/cljs/core.clj: inline nil?

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -15,7 +15,7 @@
                             memfn ns or proxy proxy-super pvalues refer-clojure reify sync time
                             when when-first when-let when-not while with-bindings with-in-str
                             with-loading-context with-local-vars with-open with-out-str with-precision with-redefs
-                            satisfies? identical? true? false?
+                            satisfies? identical? true? false? nil?

                             aget aset
                             + - * / < <= > >= == zero? pos? neg? inc dec max min mod
@@ -41,6 +41,9 @@
   if-let if-not let letfn loop
   or
   when when-first when-let when-not while])
+
+(defmacro nil? [x]
+  `(identical? ~x nil))

 (defmacro true? [x]
   (list 'js* "~{} === true" x))


inline (make-array size)

inline (make-array size)

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -16,6 +16,7 @@
                             when when-first when-let when-not while with-bindings with-in-str
                             with-loading-context with-local-vars with-open with-out-str with-precision with-redefs
                             satisfies? identical? true? false? number? nil? instance? symbol? str get
+                            make-array

                             aget aset
                             + - * / < <= > >= == zero? pos? neg? inc dec max min mod
@@ -1150,6 +1151,10 @@
     (list 'js* (core/str "[" xs-str "]"))
     rest)))

+(defmacro make-array
+  [size]
+  `(js/Array. ~size))
+
 (defmacro js-obj [& rest]
   (let [kvs-str (->> (repeat "~{}:~{}")
                      (take (quot (count rest) 2))


`cljs.repl/find-doc` needs to include :macro & :url

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -914,7 +914,7 @@
                (fn [ns]
                  (map
                    (fn [m]
-                     (update-in (select-keys m [:ns :name :doc :forms :arglists])
+                     (update-in (select-keys m [:ns :name :doc :forms :arglists :macro :url])
                        [:name] clojure.core/name))
                    (sort-by :name (vals (ana-api/ns-interns ns)))))
                (ana-api/all-ns))


deliberately return nil

deliberately return nil

Otherwise it returns the agent.  This is just a small change to
prevent unexpected behavior later if io/log is used as the last call
in a function.

--- src/clj/runbld/io.clj
+++ src/clj/runbld/io.clj
@@ -23,7 +23,8 @@
    (.startsWith os "WINDOWS")))

 (defn log [& x]
-  (send-off logger (fn [_] (apply println "runbld>>>" x))))
+  (send-off logger (fn [_] (apply println "runbld>>>" x)))
+  nil)

 (defmacro try-log [& body]
   `(try


Changed copyright text & added comments to core module.

--- src/clouseau/core.clj
+++ src/clouseau/core.clj
@@ -3,18 +3,18 @@
 ;;;
 ;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
 ;;;
-;;; Bytecode synth is free software; you can redistribute it and/or modify
+;;; Clouseau is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
 ;;; the Free Software Foundation; either version 2, or (at your option)
 ;;; any later version.
 ;;;
-;;; Bytecode synth is distributed in the hope that it will be useful, but
+;;; Clouseau is distributed in the hope that it will be useful, but
 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;;; General Public License for more details.
 ;;;
 ;;; You should have received a copy of the GNU General Public License
-;;; along with Bytecode synth; see the file COPYING.  If not, write to the
+;;; along with Clouseau; see the file COPYING.  If not, write to the
 ;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ;;; 02110-1301 USA.
 ;;;
@@ -36,7 +36,8 @@
 ;;; exception statement from your version.
 ;;;

-(ns clouseau.core)
+(ns clouseau.core
+    "Core module that contains -main function called by Leiningen to start the application.")

 (require '[ring.adapter.jetty      :as jetty])
 (require '[ring.middleware.params  :as http-params])


Maintenance - Added missing doall; should prevent further non-determinate test results.

--- system-int-test/test/cmr/system_int_test/search/collection_humanized_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_humanized_search_test.clj
@@ -109,9 +109,10 @@
   (testing "Humanizer report batches"
     (let [report-lines (str/split (search/get-humanizers-report) #"\n")]
       (is (= (count report-lines) (+ 2 (hrs/humanizer-report-collection-batch-size))))
-      (for [actual-line (rest report-lines)
-            n (inc hrs/humanizer-report-collection-batch-size)]
-        (is (= actual-line) (str "PROV1,C1200000001-PROV1,B,"n",AM-1,Terra"))))))
+      (doall
+        (for [actual-line (rest report-lines)
+              n (inc hrs/humanizer-report-collection-batch-size)]
+          (is (= actual-line) (str "PROV1,C1200000001-PROV1,B,"n",AM-1,Terra")))))))

 (deftest search-by-platform-humanized
   (let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection 1 {:Platforms [(data-umm-cmn/platform {:ShortName "TERRA"})]}))


identifies candidates for pagination and other stuff

--- src/crawler/model.clj
+++ src/crawler/model.clj
@@ -8,3 +8,9 @@
   [a-model-file]
   (with-open [rdr (io/reader a-model-file)]
     (-> rdr PushbackReader. read)))
+
+(defn identify-paging-filter-candidates
+  [{model :model corpus :corpus}]
+  (group-by
+   first
+   (map first model)))


cleanup

cleanup

--- pigpen-core/src/main/clojure/pigpen/cascading.clj
+++ pigpen-core/src/main/clojure/pigpen/cascading.clj
@@ -90,26 +90,12 @@
       (update-in flowdef [:pipes pipe] #(Every. % (PigPenBuffer. (str init) (str func) fields) Fields/RESULTS))
       (update-in flowdef [:pipes pipe] #(Each. % (PigPenFunction. (str init) (str func) fields) Fields/RESULTS)))))

-(defn- get-cogroup-fields
-  "Pig does something like [k, v1], [k, v2] > [group, v1, v2], while cascading
-  does [k, v1], [k, v2] > [k, v1, k_copy, v2], where the number of fields of
-  the combined stream must match the sum of the streams being joined, but the field
-  names are arbitrary."
-  [fields]
-  (cons (first fields) (nthrest fields 2)))
-
 (defmethod command->flowdef :group
            [{:keys [id keys fields join-types ancestors opts]} flowdef]
   {:pre [id keys fields join-types ancestors]}
-  (println "flowdef" flowdef)
-  (println "keys" keys)
-  (println "fields" fields)
-  (println "ancestors" ancestors)
-  (println "join-types" join-types)
   (update-in flowdef [:pipes] (partial merge {id (CoGroup. (str id)
                                                            (into-array Pipe (map (:pipes flowdef) ancestors))
                                                            (into-array (map #(Fields. (into-array (map str %))) keys))
-                                                           ;(Fields. (into-array (map str (get-cogroup-fields fields))))
                                                            Fields/NONE
                                                            (BufferJoin.)
                                                            )})))


organize transforms

organize transforms

--- pedestal-app/app/src/semtag_web/behavior.clj
+++ pedestal-app/app/src/semtag_web/behavior.clj
@@ -54,21 +54,26 @@
 (def app
   {:version 2
    ;; [:page] msg path used to trigger on screen load effects since :set-focus can't do it
-   :transform [[:set-value [:page] set-value]
-               [:set-value [:* :search-title] set-value]
-               [:map-value [:search] map-value]
+   :transform [;; general
+               [:set-value [:page] set-value]
+               [:set-value [:alert-error] set-value]
+
+               ;; specific effects
                [:set-value [:create-url] set-value]
                [:set-value [:types-results] set-value]
                [:set-value [:tags-results] set-value]
                [:set-value [:tag-stats-results] set-value]
                [:set-value [:all-results] set-value]
-               [:set-value [:alert-error] set-value]
+
+               ;; search
+               [:map-value [:search] map-value]
+               [:set-value [:* :search-title] set-value]
                [:set-value [:* :search-results] set-value]]
    :effect #{[#{[:page] [:search] [:create-url]} publish-message]}
    :emit [{:init init-home}
-          [#{[:tags-results]} (app/default-emitter [:app-model :search-form])]

           {:init search-form-deltas}
+          [#{[:tags-results]} (app/default-emitter [:app-model :search-form])]

           {:init init-types}
           [#{[:types-results]} (app/default-emitter [:app-model :types])]


Allow with-pre/post-wrap bindings to be introduced in square brackets (fixes #179)

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -709,15 +709,16 @@

   where ... are the given body expressions."
   [bind & body]
-  `(fn [next-task#]
-     (fn [fileset#]
-       (assert (tmpd/tmpfileset? fileset#)
-               "argument to task handler not a fileset")
-       (let [~bind fileset#
-             result# (do ~@body)]
-         (assert (tmpd/tmpfileset? result#)
-                 "task handler must return a fileset")
-         (next-task# result#)))))
+  (let [bind (if (vector? bind) (first bind) bind)]
+    `(fn [next-task#]
+       (fn [fileset#]
+         (assert (tmpd/tmpfileset? fileset#)
+                 "argument to task handler not a fileset")
+         (let [~bind fileset#
+               result# (do ~@body)]
+           (assert (tmpd/tmpfileset? result#)
+                   "task handler must return a fileset")
+           (next-task# result#))))))

 (defmacro with-post-wrap
   [bind & body]
@@ -733,16 +734,17 @@
             binding)))

   where ... are the given body expressions."
-  `(fn [next-task#]
-     (fn [fileset#]
-       (assert (tmpd/tmpfileset? fileset#)
-               "argument to task handler not a fileset")
-       (let [result# (next-task# fileset#)
-             ~bind   result#]
-         (assert (tmpd/tmpfileset? result#)
-                 "task handler must return a fileset")
-         ~@body
-         result#))))
+  (let [bind (if (vector? bind) (first bind) bind)]
+    `(fn [next-task#]
+       (fn [fileset#]
+         (assert (tmpd/tmpfileset? fileset#)
+                 "argument to task handler not a fileset")
+         (let [result# (next-task# fileset#)
+               ~bind   result#]
+           (assert (tmpd/tmpfileset? result#)
+                   "task handler must return a fileset")
+           ~@body
+           result#)))))

 (defmacro fileset-reduce
   "Given a fileset, a function get-files that selects files from the fileset,


Make the text input placeholder show a more informative message

--- web-app/src/cljs/potato/core.cljs
+++ web-app/src/cljs/potato/core.cljs
@@ -48,7 +48,7 @@
 (def nonbreak-space     "\u00a0")
 (def message-deleted    "message deleted")
 (def message-updated    "updated")
-(def placeholder        "Hello from ClojureScript")
+(def placeholder        "Type something, or drag a file here")
 (def channels-text      "Channels")
 (def private-text       "Conversations")
 (def users-text         "Users")


[scamp] Add 'update-self and 'get-node-from-world

--- modules/scamp/src/scamp/core.clj
+++ modules/scamp/src/scamp/core.clj
@@ -312,6 +312,21 @@
   [world :- WorldSchema
    new-messages :- [MessageEnvelopeSchema]]
   (update-in world [:message-envelopes] concatv new-messages))
+
+(s/defn update-self :- WorldSchema
+  "Given world and 'self, update self with 'f and 'args."
+  [world :- WorldSchema
+   self :- NetworkedNodeSchema
+   f & args]
+  (let [self-id (get-in self [:self :id])]
+    (update-in world
+               [:network self-id]
+               #(apply f % args))))
+
+(s/defn get-node-from-world :- NetworkedNodeSchema
+  [world :- WorldSchema
+   node-contact-address :- NodeContactAddressSchema]
+  (get-in world [:network node-contact-address]))

 (s/defn subscribe :- WorldSchema
   "Given 'world, a 'new-node-contact-address for the node that is


Remove active Add tab and Clone From select

--- src/cljs/elevent_client/pages/events/id/edit.cljs
+++ src/cljs/elevent_client/pages/events/id/edit.cljs
@@ -106,21 +106,26 @@
            "Explore"]
           [:a.item {:href (routes/events-owned)}
            "Owned"]
-          [:a.active.item {:href (routes/event-add)}
+          [:a.item {:href (routes/event-add) :class (when-not event-id :active)}
            "Add"]]
          [:div.ui.bottom.attached.segment
-          (prn-str @form)
           [:form.ui.form
            [:div.ui.vertical.segment
             [:h2.ui.dividing.header (if event-id "Edit" "Add") " an Event"]
-            [:div.two.fields
-             [:div.required.field {:class (when (and Name (:Name errors))
-                                            :error)}
-              [:label "Name"]
-              [input/component :text {} (r/wrap Name swap! form assoc :Name)]]
-             [:div.field
-              [:label "Clone From"]
-              [input/component :select {} clonable-events clone-id]]]
+            (let [name-field [:div.required.field
+                              {:class (when (and Name (:Name errors)) :error)}
+                              [:label "Name"]
+                              [input/component
+                               :text
+                               {}
+                               (r/wrap Name swap! form assoc :Name)]]]
+              (if event-id
+                name-field
+                [:div.two.fields
+                 name-field
+                 [:div.field
+                  [:label "Clone From"]
+                  [input/component :select {} clonable-events clone-id]]]))
             [:div.two.fields
              [:div.required.field
               [:label "Organization"]


use -Dport to configure the port number

use -Dport to configure the port number

--- src/evalback/core.clj
+++ src/evalback/core.clj
@@ -201,19 +201,21 @@
       (wrap-file-info)
       wrap-params))

+(def port (let [p (System/getProperty "port")]
+            (if p (Integer/parseInt p) 9000)))
+
 (defn start-server
   "used for starting the server in development mode from REPL"
-  [& [port]]
-  (let [port (if port (Integer/parseInt port) 3000)]
-    (reset! server
-            (serve (get-handler)
-                   {:port port
-                    :init init
-                    :open-browser? false
-                    :stacktraces? false
-                    :auto-reload? false
-                    :destroy destroy
-                    :join? true}))))
+  []
+  (reset! server
+          (serve (get-handler)
+                 {:port port
+                  :init init
+                  :open-browser? false
+                  :stacktraces? false
+                  :auto-reload? false
+                  :destroy destroy
+                  :join? true})))

 (defn stop-server []
   (.stop @server)


Revert "Start adding forbidden again, running all tests"

This reverts commit 5a96a7cfba4e9e2c1e3f9fe93a03fb9dce44e00e.

--- src/dependable/core_resolve.clj
+++ src/dependable/core_resolve.clj
@@ -58,7 +58,7 @@
                    present-package (get present-packages id)]
                (cond
                  (not (nil? present-package))
-                   (if
+                   (when
                        (or (and (= status :absent)
                                 (not (safe-spec-call spec present-package)))
                            (and (= status :present)
@@ -68,8 +68,7 @@
                       present-packages
                       found-packages
                       absent-specs
-                      rclauses)
-                     [:forbidden id])
+                      rclauses))
                  (= status :absent)
                  (resolve-deps
                   repo


Cache with age associated

Cache with age associated

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -20,6 +20,7 @@
 (require '[clojure.tools.logging       :as log])

 (require '[emender-jenkins.config      :as config])
+(require '[emender-jenkins.time-utils  :as time-utils])
 (use     '[emender-jenkins.utils])

 (def results (atom nil))
@@ -261,22 +262,14 @@
         (some #(= job-name (:jobName %)) @results)))

 (def currently-building-jobs                  (atom nil))
+(def currently-building-jobs-jenkins-response (atom nil))
+(def currently-building-jobs-cache-timestamp(atom nil))
+
 (def jobs-in-queue                            (atom nil))
-(def currently-building-jobs-jenkins-response (atom nil))
 (def jobs-in-queue-jenkins-response           (atom nil))
+(def jobs-in-queue-cache-timestamp          (atom nil))
+
 (def running-jobs                             (atom nil))
-
-(defn get-currently-building-jobs
-    []
-    @currently-building-jobs)
-
-(defn get-jobs-in-queue
-    []
-    @jobs-in-queue)
-
-(defn get-running-jobs
-    []
-    @running-jobs)

 (defn get-building-jobs-url
     "Construct URL used to read all jobs that are currently building."
@@ -372,6 +365,71 @@
           (reset! running-jobs
           (if (and jobs-in-queue building-jobs) (create-running-jobs-response jobs-in-queue building-jobs)))))

+(defn update-timestamp
+    [atom-name]
+    (reset! atom-name (time-utils/ms->seconds (System/currentTimeMillis))))
+
+(defn update-cache
+    "Returns true if update was performed."
+    [cache-name cache-timestamp max-age function-to-call configuration]
+    (let [cache-age (time-utils/elapsed-time @cache-timestamp)]
+        (if (not cache-age)
+            (do
+                (log/info (str cache-name " cache will be read for the first time"))
+                (function-to-call configuration)
+                (update-timestamp cache-timestamp)
+                true)
+            (when (> cache-age max-age)
+                (log/info (str "Updating " cache-name " (the cache is " cache-age "ms old, max age is set to " max-age "ms"))
+                (function-to-call configuration)
+                (update-timestamp cache-timestamp)
+                true))))
+
+(defn update-currently-building-jobs-cache
+    "Updates currently building jobs cache if its age is too old."
+    [configuration]
+    (update-cache "currenty building jobs"
+                  currently-building-jobs-cache-timestamp
+                  (-> configuration :fetcher :currently-building-jobs-cache-max-age)
+                  read-currently-building-jobs
+                  configuration))
+
+(defn update-jobs-in-queue-cache
+    "Updates jobs in queue cache if its age is too old."
+    [configuration]
+    (update-cache "jobs in queue"
+                  jobs-in-queue-cache-timestamp
+                  (-> configuration :fetcher :jobs-in-queue-cache-max-age)
+                  read-jobs-in-queue
+                  configuration))
+
+(defn update-running-jobs-cache
+    "Updates running jobs cache if its age is too old."
+    [configuration]
+    ; we need to use local vars here to avoid short-circuit evaluation!
+    (let [cache1-updated (update-currently-building-jobs-cache configuration)
+          cache2-updated (update-jobs-in-queue-cache configuration)]
+         (if (or cache1-updated cache2-updated)
+             (read-running-jobs configuration))))
+
+(defn get-currently-building-jobs
+    "Get the content of currently building jobs cache, cache is re-read if needed."
+    [configuration]
+    (update-currently-building-jobs-cache configuration)
+    @currently-building-jobs)
+
+(defn get-jobs-in-queue
+    "Get the content of jobs in queue cache, cache is re-read if needed."
+    [configuration]
+    (update-jobs-in-queue-cache configuration)
+    @jobs-in-queue)
+
+(defn get-running-jobs
+    "Get the content of running jobs cache, cache is re-read if needed."
+    [configuration]
+    (update-running-jobs-cache configuration)
+    @running-jobs)
+
 ; REPL testing
 ; (require '[clojure.pprint :as pprint])
 ; (require '[clojure.edn])


Use proper metadata-like format for get_jobs

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -179,31 +179,35 @@
 (defn select-results-for-book
     "Select results for given book and return them as a map with results separated for preview, stage, prod."
     [product version book-name results]
-    {:preview (job-for-environment product version book-name :preview results)
-     :stage   (job-for-environment product version book-name :stage   results)
-     :prod    (job-for-environment product version book-name :prod    results)})
+    {:jobs
+        {:preview (job-for-environment product version book-name :preview results)
+         :stage   (job-for-environment product version book-name :stage   results)
+         :prod    (job-for-environment product version book-name :prod    results)}})

 (defn select-results-for-product-version
     "Select results for all books for given product and version."
     [product version results]
-    (into {}
-          (for [book (books-for-product-version results product version)]
-               [book (select-results-for-book product version book results)])))
+    {:books
+        (into {}
+              (for [book (books-for-product-version results product version)]
+                   [book (select-results-for-book product version book results)]))})

 (defn select-results-for-product
     "Select results for all books for given product."
     [product results]
-    (into {}
-          (for [version (versions-per-products product results)]
-               [version (select-results-for-product-version product version results)])))
+    {:versions
+        (into {}
+              (for [version (versions-per-products product results)]
+                   [version (select-results-for-product-version product version results)]))})

 (defn get-job-results
     [product version]
     (let [results  (read-job-results product version)
           products (all-products results)] ; set of all products read from test results
-          (into {}
-                (for [product products]
-                     [product (select-results-for-product product results)]))))
+          {:products
+              (into {}
+                    (for [product products]
+                         [product (select-results-for-product product results)]))}))

 (defn find-job-with-name
     [job-name]
@@ -215,5 +219,11 @@
         (some #(= job-name (:job-name %)) @results)))

 ; REPL testing
-;(def results (atom (clojure.edn/read-string (slurp "x.edn"))))
-
+; (require '[clojure.pprint :as pprint])
+; (require '[clojure.edn])
+; (def results (atom (clojure.edn/read-string (slurp "x.edn"))))
+
+; (clojure.pprint/pprint
+; (get-job-results "Red Hat Enterprise Linux" "6")
+; )
+


remove expectations

remove expectations

--- ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/common/utils_expectations_test.clj
+++ ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/common/utils_expectations_test.clj
@@ -1,43 +1,40 @@
 (ns com.sixsq.slipstream.ssclj.resources.common.utils-expectations-test
   (:require
+    [clojure.test :refer [deftest are is]]
     [com.sixsq.slipstream.ssclj.resources.common.utils :refer :all]
-    [expectations :refer :all]
     [com.sixsq.slipstream.ssclj.resources.common.utils :as u]))

-;;
-;; Base64 encoding
-;;
+(deftest check-encoding
+  (let [round-trip (comp decode-base64 encode-base64)
+        values ["alpha"
+                2
+                true
+                3.14
+                {:alpha "alpha"}]]

-(let [round-trip (comp decode-base64 encode-base64)
-      values     ["alpha"
-                  2
-                  true
-                  3.14
-                  {:alpha "alpha"}]]
+    (doseq [v values]
+           (is (= v (round-trip v))))))

-  (expect (from-each [v values]
-                     (= v (round-trip v)))))
-
-(expect "" (u/de-camelcase ""))
-(expect "abc" (u/de-camelcase "Abc"))
-(expect "abc-def" (u/de-camelcase "AbcDef"))
+(deftest check-de-camelcase
+  (are [expect arg] (= expect (u/de-camelcase arg))
+                    "" ""
+                    "abc" "Abc"
+                    "abc-def" "AbcDef"))

 ;; given string must be lisp-cased, if not empty string returned
-(expect "" (u/lisp-to-camelcase "Abc"))
-(expect "" (u/lisp-to-camelcase "-"))
-(expect "" (u/lisp-to-camelcase "abc-"))
-(expect "" (u/lisp-to-camelcase "abc--def"))
-(expect "" (u/lisp-to-camelcase "abc-Def-ghi"))
-(expect "" (u/lisp-to-camelcase ""))
+(deftest check-list-to-camelcase
+  (are [expect arg] (= expect (u/lisp-to-camelcase arg))
+                    "" "Abc"
+                    "" "-"
+                    "" "abc-"
+                    "" "abc--def"
+                    "" "abc-Def-ghi"
+                    "" ""
+                    "Abc" "abc"
+                    "AbcDef" "abc-def"))

-(expect "Abc" (u/lisp-to-camelcase "abc"))
-(expect "AbcDef" (u/lisp-to-camelcase "abc-def"))
-
-(expect "{\"http:\\/\\/example.org\\/a\\/b.json\":\"truc\"}\n"
-        (u/serialize {:http://example.org/a/b.json "truc"}))
-
-(expect "{\"http:\\/\\/example.org\\/a\\/b.json\":\"truc\"}\n"
-        (u/serialize {"http://example.org/a/b.json" "truc"}))
-
-(run-all-tests)
-
+(deftest check-serialize
+  (is (= "{\"http:\\/\\/example.org\\/a\\/b.json\":\"truc\"}\n"
+         (u/serialize {:http://example.org/a/b.json "truc"})))
+  (is (= "{\"http:\\/\\/example.org\\/a\\/b.json\":\"truc\"}\n"
+         (u/serialize {"http://example.org/a/b.json" "truc"}))))


In `pmap` unexpectedness, 32 could be the size of a thread pool

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_050_pmap_etc.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_050_pmap_etc.clj
@@ -71,9 +71,11 @@
 (demo-pmap-like-fun pmap
                     range)

-;;; Time increases when we have more than 32 things, which is the chunk size
-;;; in Clojure.
-;;; This is not as expected:
+;;; Time increases when we have more than 32 things.
+;;; This is not as expected.
+;;; What's the 32?
+;;; - Maybe it's the size of the thread pool that's being used.
+;;; - It's the chunk size of chunked sequences, so it could be that.
 ;;;
 ;;; 0 Expected time ~= 0.0  "Elapsed time: 0.018093 msecs"
 ;;; 2 Expected time ~= 5.0  "Elapsed time: 5.189774 msecs"


RDC - Remove embarassing comma.

RDC - Remove embarassing comma.

--- src/icfp2015/unit.clj
+++ src/icfp2015/unit.clj
@@ -18,7 +18,7 @@

 (defn rotate
   "Rotate a unit around a pivot point"
-  [rotation, [[pi pj]]]
+  [[[pivot-row p-col]] rotation]
   nil)

 (def rotations


Tweaked Python code so tiles are in order


force Leela ability to the front of the prompt queue during multi-access

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -236,6 +236,7 @@
                            (update! state side (assoc card :bounce-hq true)))}}
     :abilities [{:req (req (:bounce-hq card))
                  :choices {:req #(and (not (:rezzed %)) (= (:side %) "Corp"))} :player :runner
+                 :priority true
                  :msg (msg "add " (card-str state target) " to HQ")
                  :effect (effect (move :corp target :hand)
                                  (update! (dissoc (get-card state card) :bounce-hq)))}]}


Ever wondered why kittens can all be different colours and look so different from their mums? The fact is that one in four pregnant cats carries kittens fathered by more than one mate. A fertile female may mate with several tom-cats, which fertilise different eggs each time.

--- src/clj/quiz_site/routes/quiz.clj
+++ src/clj/quiz_site/routes/quiz.clj
@@ -6,6 +6,10 @@
             [org.tobereplaced.mapply :refer [mapply]]
             [matchbox.core :as m]
             [compojure.core :refer :all]))
+
+(def root (m/connect "https://quiz-site-fdc3a.firebaseio.com"))
+
+(m/auth-anon root)

 (defn get-quiz
   [& {:keys[quiz-id] :as args}]


remove trace content

remove trace content

--- src/clj_money/web/attachments.clj
+++ src/clj_money/web/attachments.clj
@@ -64,7 +64,6 @@
    (with-layout "New attachment" {}
      [:div.row
       [:div.col-md-6
-       [:pre (prn-str attachment)]
        (form (format "/transactions/%s/attachments"
                      (:transaction-id attachment)) {:enctype "multipart/form-data"}
              (text-input-field attachment :caption {:autofocus true})


fix protocol typo, event/EventType -> event/IEventType

--- src/cljs/clojure/browser/net.cljs
+++ src/cljs/clojure/browser/net.cljs
@@ -58,7 +58,7 @@
        (.send this uri method content headers)))

-  event/EventType
+  event/IEventType
   (event-types [this]
     (into {}
           (map


Regular function services (not external tools!) are not cmds! fix cmd.config bug...

--- src/aerobio/pgmgraph.clj
+++ src/aerobio/pgmgraph.clj
@@ -248,8 +248,10 @@
                                        :func func :src src :repeat repeat
                                        :tool (v :path)}
                                       v
-                                      {:args (merge-arg-sets
-                                              argcard (v :args) args)})])))
+                                      {:args (if (= (name (v :type)) "func")
+                                               (vec (v :args))
+                                               (merge-arg-sets
+                                                argcard (v :args) args))})])))
                    (into {}))
         edges (or (graph :edges) {})
         ins (edges->ins edges)


minor fix

minor fix

--- src/latte/classic.clj
+++ src/latte/classic.clj
@@ -34,7 +34,7 @@
          (have (a) (==> (==> A A)
                         (==> (not A) A)
                         A) :by ((em) A))
-         (have (b) _ :by (impl-refl A))
+         (have (b) (==> A A) :by (impl-refl A))
          (have (c) (==> (==> (not A) A)
                         A) :by ((a) (b)))
          (assume [z (not A)]


Fixes exception on refresh when in external window

Fixes #234 and potentially #209.

--- src/day8/re_frame_10x/events.cljs
+++ src/day8/re_frame_10x/events.cljs
@@ -284,8 +284,13 @@
                                (str "width=" width ",height=" height ",left=" left ",top=" top
                                     ",resizable=yes,scrollbars=yes,status=no,directories=no,toolbar=no,menubar=no"))]
       (let [d (.-document w)]
-        (when-let [el (.getElementById d "--re-frame-10x--")]
-          (r/unmount-component-at-node el))
+        ;; We had to comment out the following unmountComponentAtNode as it causes a React exception we assume
+        ;; because React says el is not a root container that it knows about.
+        ;; In theory by not freeing up the resources associated with this container (e.g. event handlers) we may be
+        ;; creating memory leaks. However with observation of the heap in developer tools we cannot see any significant
+        ;; unbounded growth in memory usage.
+        ;(when-let [el (.getElementById d "--re-frame-10x--")]
+        ;  (r/unmount-component-at-node el)))
         (.open d)
         (.write d new-window-html)
         (goog.object/set w "onload" #(mount w d))


fn -> core/fn, when* -> core/when*

fn -> core/fn, when* -> core/when*

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -41,6 +41,7 @@
             clojure.set
             cljs.compiler
             [cljs.env :as env]
+            #?(:cljs [cljs.core :as core])
             #?(:cljs [cljs.analyzer :as ana])))

 #?(:clj (alias 'core 'clojure.core))
@@ -99,14 +100,14 @@
          (core/let [form (first forms)
                     threaded (if (seq? form)
                                (with-meta `(~(first form) ~x ~@(next form)) (meta form))
-                               (list form x))]
+                               (core/list form x))]
            (recur threaded (next forms)))
          x))))

 (core/defn- ^{:dynamic true} assert-valid-fdecl
   "A good fdecl looks like (([a] ...) ([a b] ...)) near the end of defn."
   [fdecl]
-  (when (empty? fdecl)
+  (core/when (empty? fdecl)
     (throw
       #?(:clj  (IllegalArgumentException. "Parameter declaration missing")
          :cljs (js/Error. "Parameter declaration missing"))))
@@ -133,7 +134,7 @@
                                   "\" should be a vector"))))))
                fdecl)
              bad-args (seq (remove #(vector? %) argdecls))]
-    (when bad-args
+    (core/when bad-args
       (throw
         #?(:clj (IllegalArgumentException.
                   (core/str "Parameter declaration \"" (first bad-args)
@@ -145,23 +146,23 @@
 (def
   ^{:private true}
   sigs
-  (fn [fdecl]
+  (core/fn [fdecl]
     (assert-valid-fdecl fdecl)
     (core/let [asig
-          (fn [fdecl]
-            (core/let [arglist (first fdecl)
-                  ;elide implicit macro args
-                  arglist (if #?(:clj (clojure.lang.Util/equals '&form (first arglist))
-                                 :cljs (= '&form (first arglist)))
-                            #?(:clj (clojure.lang.RT/subvec arglist 2 (clojure.lang.RT/count arglist))
-                               :cljs (subvec arglist 2 (count arglist)))
-                            arglist)
-                  body (next fdecl)]
-              (if (map? (first body))
-                (if (next body)
-                  (with-meta arglist (conj (if (meta arglist) (meta arglist) {}) (first body)))
-                  arglist)
-                arglist)))]
+               (core/fn [fdecl]
+                 (core/let [arglist (first fdecl)
+                            ;elide implicit macro args
+                            arglist (if #?(:clj (clojure.lang.Util/equals '&form (first arglist))
+                                           :cljs (= '&form (first arglist)))
+                                      #?(:clj (clojure.lang.RT/subvec arglist 2 (clojure.lang.RT/count arglist))
+                                         :cljs (subvec arglist 2 (count arglist)))
+                                      arglist)
+                            body (next fdecl)]
+                   (if (map? (first body))
+                     (if (next body)
+                       (with-meta arglist (conj (if (meta arglist) (meta arglist) {}) (first body)))
+                       arglist)
+                     arglist)))]
       (if (seq? (first fdecl))
         (core/loop [ret [] fdecls fdecl]
           (if fdecls
@@ -178,20 +179,20 @@
                  (throw (IllegalArgumentException.
                           ~(core/str fnname " requires " (second pairs)))))
                ~(core/let [more (nnext pairs)]
-                  (when more
+                  (core/when more
                     (list* `assert-args fnname more))))
      :cljs `(do (when-not ~(first pairs)
                   (throw (js/Error.
                            ~(core/str fnname " requires " (second pairs)))))
                 ~(core/let [more (nnext pairs)]
-                   (when more
+                   (core/when more
                      (list* `assert-args fnname more))))))

 (core/defn destructure [bindings]
   (core/let [bents (partition 2 bindings)
-         pb (fn pb [bvec b v]
+         pb (core/fn pb [bvec b v]
               (core/let [pvec
-                     (fn [bvec b val]
+                     (core/fn [bvec b val]
                        (core/let [gvec (gensym "vec__")]
                          (core/loop [ret (-> bvec (conj gvec) (conj val))
                                      n 0
@@ -215,17 +216,17 @@
                                                 seen-rest?))))
                              ret))))
                      pmap
-                     (fn [bvec b v]
+                     (core/fn [bvec b v]
                        (core/let [gmap (gensym "map__")
                                   defaults (:or b)]
                          (core/loop [ret (-> bvec (conj gmap) (conj v)
                                              (conj gmap) (conj `(if (seq? ~gmap) (apply core/hash-map ~gmap) ~gmap))
-                                             ((fn [ret]
+                                             ((core/fn [ret]
                                                 (if (:as b)
                                                   (conj ret (:as b) gmap)
                                                   ret))))
                                      bes (reduce
-                                          (fn [bes entry]
+                                          (core/fn [bes entry]
                                             (reduce #(assoc %1 %2 ((val entry) %2))
                                                     (dissoc bes (key entry))
                                                     ((key entry) bes)))
@@ -249,7 +250,7 @@
                       :else (throw
                               #?(:clj (new Exception (core/str "Unsupported binding form: " b))
                                  :cljs (new js/Error (core/str "Unsupported binding form: " b)))))))
-         process-entry (fn [bvec b] (pb bvec (first b) (second b)))]
+         process-entry (core/fn [bvec b] (pb bvec (first b) (second b)))]
         (if (every? core/symbol? (map first bents))
           bindings
           (if-let [kwbs (seq (filter #(core/keyword? (first %)) bents))]
@@ -283,8 +284,8 @@
       `(loop* ~bindings ~@body)
       (core/let [vs (take-nth 2 (drop 1 bindings))
                  bs (take-nth 2 bindings)
-                 gs (map (fn [b] (if (core/symbol? b) b (gensym))) bs)
-                 bfs (reduce (fn [ret [b v g]]
+                 gs (map (core/fn [b] (if (core/symbol? b) b (gensym))) bs)
+                 bfs (reduce (core/fn [ret [b v g]]
                                (if (core/symbol? b)
                                  (conj ret g v)
                                  (conj ret g v b g)))
@@ -305,7 +306,7 @@
                  ITransientAssociative ITransientMap ITransientVector ITransientSet
                  IMultiFn IChunkedSeq IChunkedNext IComparable INamed ICloneable IAtom
                  IReset ISwap])
-          (iterate (fn [[p b]]
+          (iterate (core/fn [[p b]]
                      (if (core/== 2147483648 b)
                        [(core/inc p) 1]
                        [p (core/bit-shift-left b 1)]))
@@ -810,21 +811,21 @@
   (symbol (core/str "-" sym)))

 (core/defn- warn-and-update-protocol [p type env]
-  (when-not (= 'Object p)
+  (core/when-not (= 'Object p)
     (if-let [var (cljs.analyzer/resolve-existing-var (dissoc env :locals) p)]
       (do
-        (when-not (:protocol-symbol var)
+        (core/when-not (:protocol-symbol var)
           (cljs.analyzer/warning :invalid-protocol-symbol env {:protocol p}))
-        (when (core/and (:protocol-deprecated cljs.analyzer/*cljs-warnings*)
+        (core/when (core/and (:protocol-deprecated cljs.analyzer/*cljs-warnings*)
                 (-> var :deprecated)
                 (not (-> p meta :deprecation-nowarn)))
           (cljs.analyzer/warning :protocol-deprecated env {:protocol p}))
-        (when (:protocol-symbol var)
+        (core/when (:protocol-symbol var)
           (swap! env/*compiler* update-in [:cljs.analyzer/namespaces]
-            (fn [ns]
+            (core/fn [ns]
               (update-in ns [(:ns var) :defs (symbol (name p)) :impls]
                 conj type)))))
-      (when (:undeclared cljs.analyzer/*cljs-warnings*)
+      (core/when (:undeclared cljs.analyzer/*cljs-warnings*)
         (cljs.analyzer/warning :undeclared-protocol-symbol env {:protocol p})))))

 (core/defn- resolve-var [env sym]
@@ -847,12 +848,12 @@
              pfn-prefix (subs (core/str psym) 0
                           (clojure.core/inc (.indexOf (core/str psym) "/")))]
     (cons `(aset ~psym ~type true)
-      (map (fn [[f & meths :as form]]
+      (map (core/fn [[f & meths :as form]]
              `(aset ~(symbol (core/str pfn-prefix f))
                 ~type ~(with-meta `(fn ~@meths) (meta form))))
         sigs))))

-(core/defmulti extend-prefix (fn [tsym sym] (-> tsym meta :extend)))
+(core/defmulti extend-prefix (core/fn [tsym sym] (-> tsym meta :extend)))

 (core/defmethod extend-prefix :instance
   [tsym sym] `(.. ~tsym ~(to-property sym)))
@@ -883,7 +884,7 @@
        ~@body)))

 (core/defn- add-obj-methods [type type-sym sigs]
-  (map (fn [[f & meths :as form]]
+  (map (core/fn [[f & meths :as form]]
          (core/let [[f meths] (if (vector? (first meths))
                                 [f [(rest form)]]
                                 [f meths])]
@@ -893,7 +894,7 @@

 (core/defn- ifn-invoke-methods [type type-sym [f & meths :as form]]
   (map
-    (fn [meth]
+    (core/fn [meth]
       (core/let [arity (count (first meth))]
         `(set! ~(extend-prefix type-sym (symbol (core/str "cljs$core$IFn$_invoke$arity$" arity)))
            ~(with-meta `(fn ~meth) (meta form)))))
@@ -921,7 +922,7 @@
       (core/let [meth meths]
         [`(set! ~(extend-prefix type-sym (core/str pf "$arity$" (count (first meth))))
             ~(with-meta `(fn ~@(adapt-proto-params type meth)) (meta form)))])
-      (map (fn [[sig & body :as meth]]
+      (map (core/fn [[sig & body :as meth]]
              `(set! ~(extend-prefix type-sym (core/str pf "$arity$" (count sig)))
                 ~(with-meta `(fn ~(adapt-proto-params type meth)) (meta form))))
         meths))))
@@ -934,47 +935,47 @@
     (if (= p 'Object)
       (add-obj-methods type type-sym sigs)
       (concat
-        (when-not (skip-flag psym)
+        (core/when-not (skip-flag psym)
           [`(set! ~(extend-prefix type-sym pprefix) true)])
         (mapcat
-          (fn [sig]
+          (core/fn [sig]
             (if (= psym 'cljs.core/IFn)
               (add-ifn-methods type type-sym sig)
               (add-proto-methods* pprefix type type-sym sig)))
           sigs)))))

 (core/defn- validate-impl-sigs [env p method]
-  (when-not (= p 'Object)
+  (core/when-not (= p 'Object)
     (core/let [var (ana/resolve-var (dissoc env :locals) p)
                minfo (-> var :protocol-info :methods)
                [fname sigs] (if (core/vector? (second method))
                               [(first method) [(second method)]]
                               [(first method) (map first (rest method))])
                decmeths (core/get minfo fname ::not-found)]
-      (when (= decmeths ::not-found)
+      (core/when (= decmeths ::not-found)
         (ana/warning :protocol-invalid-method env {:protocol p :fname fname :no-such-method true}))
       (core/loop [sigs sigs seen #{}]
-        (when (seq sigs)
+        (core/when (seq sigs)
           (core/let [sig (first sigs)
                      c   (count sig)]
-            (when (contains? seen c)
+            (core/when (contains? seen c)
               (ana/warning :protocol-duped-method env {:protocol p :fname fname}))
-            (when (core/and (not= decmeths ::not-found) (not (some #{c} (map count decmeths))))
+            (core/when (core/and (not= decmeths ::not-found) (not (some #{c} (map count decmeths))))
               (ana/warning :protocol-invalid-method env {:protocol p :fname fname :invalid-arity c}))
             (recur (next sigs) (conj seen c))))))))

 (core/defn- validate-impls [env impls]
   (core/loop [protos #{} impls impls]
-    (when (seq impls)
+    (core/when (seq impls)
       (core/let [proto   (first impls)
                  methods (take-while seq? (next impls))
                  impls   (drop-while seq? (next impls))]
-        (when (contains? protos proto)
+        (core/when (contains? protos proto)
           (ana/warning :protocol-multiple-impls env {:protocol proto}))
         (core/loop [seen #{} methods methods]
-          (when (seq methods)
+          (core/when (seq methods)
             (core/let [[fname :as method] (first methods)]
-              (when (contains? seen fname)
+              (core/when (contains? seen fname)
                 (ana/warning :extend-type-invalid-method-shape env
                   {:protocol proto :method fname}))
               (validate-impl-sigs env proto method)
@@ -1000,7 +1001,7 @@
              [type assign-impls] (if-let [type (base-type type-sym)]
                                    [type base-assign-impls]
                                    [(resolve type-sym) proto-assign-impls])]
-    (when (core/and (:extending-base-js-type cljs.analyzer/*cljs-warnings*)
+    (core/when (core/and (:extending-base-js-type cljs.analyzer/*cljs-warnings*)
             (js-base-type type-sym))
       (cljs.analyzer/warning :extending-base-js-type env
         {:current-symbol type-sym :suggested-symbol (js-base-type type-sym)}))
@@ -1024,7 +1025,7 @@
                          (into {}
                            (map (juxt key (comp (partial reduce core/bit-or) val))
                              parts)))]
-        [fpps (reduce (fn [ps p] (update-in ps [p] (fnil identity 0)))
+        [fpps (reduce (core/fn [ps p] (update-in ps [p] (core/fnil identity 0)))
                 parts
                 (range fast-path-protocol-partitions-count))]))))

@@ -1067,7 +1068,7 @@

 (core/defn- validate-fields
   [case name fields]
-  (when-not (vector? fields)
+  (core/when-not (vector? fields)
     (throw
       #?(:clj (AssertionError. (core/str case " " name ", no fields vector given."))
          :cljs (js/Error. (core/str case " " name ", no fields vector given."))))))
@@ -1175,7 +1176,7 @@
                         `(~'-lookup [this# k#] (-lookup this# k# nil))
                         `(~'-lookup [this# ~ksym else#]
                            (case ~ksym
-                             ~@(mapcat (fn [f] [(keyword f) f]) base-fields)
+                             ~@(mapcat (core/fn [f] [(keyword f) f]) base-fields)
                              (get ~'__extmap ~ksym else#)))
                         'ICounted
                         `(~'-count [this#] (+ ~(count base-fields) (count ~'__extmap)))
@@ -1189,7 +1190,7 @@
                         'IAssociative
                         `(~'-assoc [this# k# ~gs]
                            (condp keyword-identical? k#
-                             ~@(mapcat (fn [fld]
+                             ~@(mapcat (core/fn [fld]
                                          [(keyword fld) (list* `new tagname (replace {fld gs '__hash nil} fields))])
                                  base-fields)
                              (new ~tagname ~@(remove #{'__extmap '__hash} fields) (assoc ~'__extmap k# ~gs) nil)))
@@ -1225,7 +1226,7 @@
                        (assoc (meta rsym) :factory :map))
              ms (gensym)
              ks (map keyword fields)
-             getters (map (fn [k] `(~k ~ms)) ks)]
+             getters (map (core/fn [k] `(~k ~ms)) ks)]
     `(defn ~fn-name [~ms]
        (new ~rname ~@getters nil (dissoc ~ms ~@ks) nil))))

@@ -1347,10 +1348,10 @@
                     :doc doc
                     :protocol-symbol true)
              ns-name (-> &env :ns :name)
-             fqn (fn [n] (symbol (core/str ns-name "." n)))
+             fqn (core/fn [n] (symbol (core/str ns-name "." n)))
              prefix (protocol-prefix p)
              _ (core/doseq [[mname & arities] methods]
-                 (when (some #{0} (map count (filter vector? arities)))
+                 (core/when (some #{0} (map count (filter vector? arities)))
                    (throw
                      #?(:clj (Exception.
                                (core/str "Invalid protocol, " psym
@@ -1358,7 +1359,7 @@
                         :cljs (js/Error.
                                 (core/str "Invalid protocol, " psym
                                   " defines method " mname " with arity 0"))))))
-             expand-sig (fn [fname slot sig]
+             expand-sig (core/fn [fname slot sig]
                           `(~sig
                              (if (and ~(first sig) (. ~(first sig) ~(symbol (core/str "-" slot)))) ;; Property access needed here.
                                (. ~(first sig) ~slot ~@sig)
@@ -1372,23 +1373,23 @@
              psym   (vary-meta psym assoc-in [:protocol-info :methods]
                       (into {}
                         (map
-                          (fn [[fname & sigs]]
+                          (core/fn [[fname & sigs]]
                             (core/let [doc (as-> (last sigs) doc
-                                             (when (core/string? doc) doc))
+                                             (core/when (core/string? doc) doc))
                                        sigs (take-while vector? sigs)]
                               [(vary-meta fname assoc :doc doc)
                                (vec sigs)]))
                           methods)))
-             method (fn [[fname & sigs]]
+             method (core/fn [[fname & sigs]]
                       (core/let [doc (as-> (last sigs) doc
-                                       (when (core/string? doc) doc))
+                                       (core/when (core/string? doc) doc))
                                  sigs (take-while vector? sigs)
                                  slot (symbol (core/str prefix (name fname)))
                                  fname (vary-meta fname assoc
                                          :protocol p
                                          :doc doc)]
                         `(defn ~fname
-                           ~@(map (fn [sig]
+                           ~@(map (core/fn [sig]
                                     (expand-sig fname
                                       (symbol (core/str slot "$arity$" (count sig)))
                                       sig))
@@ -1471,7 +1472,7 @@
              tempnames (map (comp gensym name) names)
              binds (map core/vector names vals)
              resets (reverse (map core/vector names tempnames))
-             bind-value (fn [[k v]] (core/list 'set! k v))]
+             bind-value (core/fn [[k v]] (core/list 'set! k v))]
     `(let [~@(interleave tempnames names)]
        ~@(map bind-value binds)
        (try
@@ -1516,7 +1517,7 @@
   [pred expr & clauses]
   (core/let [gpred (gensym "pred__")
              gexpr (gensym "expr__")
-             emit (fn emit [pred expr args]
+             emit (core/fn emit [pred expr args]
                     (let [[[a b c :as clause] more]
                           (split-at (if (= :>> (second args)) 3 2) args)
                           n (count clause)]
@@ -1540,13 +1541,13 @@
       #?(:clj (clojure.core/IllegalArgumentException.
                 (core/str "Duplicate case test constant '"
                   test "'"
-                  (when (:line env)
+                  (core/when (:line env)
                     (core/str " on line " (:line env) " "
                       cljs.analyzer/*cljs-file*))))
          :cljs (js/Error.
                  (core/str "Duplicate case test constant '"
                    test "'"
-                   (when (:line env)
+                   (core/when (:line env)
                      (core/str " on line " (:line env) " "
                        cljs.analyzer/*cljs-file*))))))
     (assoc m test expr)))
@@ -1587,11 +1588,11 @@
                             (core/str "No matching clause: " ~e))))
              env     &env
              pairs   (reduce
-                       (fn [m [test expr]]
+                       (core/fn [m [test expr]]
                          (core/cond
                            (seq? test)
                            (reduce
-                             (fn [m test]
+                             (core/fn [m test]
                                (let [test (if (core/symbol? test)
                                             (core/list 'quote test)
                                             test)]
@@ -1624,20 +1625,20 @@
       :else
       `(let [~esym ~e]
          (cond
-           ~@(mapcat (fn [[m c]] `((cljs.core/= ~m ~esym) ~c)) pairs)
+           ~@(mapcat (core/fn [[m c]] `((cljs.core/= ~m ~esym) ~c)) pairs)
            :else ~default)))))

 (core/defmacro assert
   "Evaluates expr and throws an exception if it does not evaluate to
   logical true."
   ([x]
-     (when *assert*
-       `(when-not ~x
+     (core/when *assert*
+       `(core/when-not ~x
           (throw (js/Error.
                   (cljs.core/str "Assert failed: " (cljs.core/pr-str '~x)))))))
   ([x message]
-     (when *assert*
-       `(when-not ~x
+     (core/when *assert*
+       `(core/when-not ~x
           (throw (js/Error.
                   (cljs.core/str "Assert failed: " ~message "\n" (cljs.core/pr-str '~x))))))))

@@ -1655,18 +1656,18 @@
   (assert-args for
     (vector? seq-exprs) "a vector for its binding"
     (even? (count seq-exprs)) "an even number of forms in binding vector")
-  (core/let [to-groups (fn [seq-exprs]
-                         (reduce (fn [groups [k v]]
+  (core/let [to-groups (core/fn [seq-exprs]
+                         (reduce (core/fn [groups [k v]]
                                    (if (core/keyword? k)
                                      (conj (pop groups) (conj (peek groups) [k v]))
                                      (conj groups [k v])))
                            [] (partition 2 seq-exprs)))
-             err (fn [& msg] (throw (ex-info (apply core/str msg) {})))
-             emit-bind (fn emit-bind [[[bind expr & mod-pairs]
+             err (core/fn [& msg] (throw (ex-info (apply core/str msg) {})))
+             emit-bind (core/fn emit-bind [[[bind expr & mod-pairs]
                                        & [[_ next-expr] :as next-groups]]]
                          (core/let [giter (gensym "iter__")
                                     gxs (gensym "s__")
-                                    do-mod (fn do-mod [[[k v :as pair] & etc]]
+                                    do-mod (core/fn do-mod [[[k v :as pair] & etc]]
                                              (core/cond
                                                (= k :let) `(let ~v ~(do-mod etc))
                                                (= k :while) `(when ~v ~(do-mod etc))
@@ -1687,12 +1688,12 @@
                              `(fn ~giter [~gxs]
                                 (lazy-seq
                                   (loop [~gxs ~gxs]
-                                    (when-first [~bind ~gxs]
+                                    (core/when-first [~bind ~gxs]
                                       ~(do-mod mod-pairs)))))
                              #_"inner-most loop"
                              (core/let [gi (gensym "i__")
                                         gb (gensym "b__")
-                                        do-cmod (fn do-cmod [[[k v :as pair] & etc]]
+                                        do-cmod (core/fn do-cmod [[[k v :as pair] & etc]]
                                                   (core/cond
                                                     (= k :let) `(let ~v ~(do-cmod etc))
                                                     (= k :while) `(when ~v ~(do-cmod etc))
@@ -1736,8 +1737,8 @@
   (assert-args doseq
     (vector? seq-exprs) "a vector for its binding"
     (even? (count seq-exprs)) "an even number of forms in binding vector")
-  (core/let [err (fn [& msg] (throw (ex-info (apply core/str msg) {})))
-             step (fn step [recform exprs]
+  (core/let [err (core/fn [& msg] (throw (ex-info (apply core/str msg) {})))
+             step (core/fn step [recform exprs]
                     (if-not exprs
                       [true `(do ~@body)]
                       (core/let [k (first exprs)
@@ -1752,11 +1753,11 @@
                           (= k :let) [needrec `(let ~v ~subform)]
                           (= k :while) [false `(when ~v
                                                  ~subform
-                                                 ~@(when needrec [recform]))]
+                                                 ~@(core/when needrec [recform]))]
                           (= k :when) [false `(if ~v
                                                 (do
                                                   ~subform
-                                                  ~@(when needrec [recform]))
+                                                  ~@(core/when needrec [recform]))
                                                 ~recform)]
                           (core/keyword? k) (err "Invalid 'doseq' keyword" k)
                           :else (let [chunksym (with-meta (gensym "chunk__")
@@ -1773,15 +1774,15 @@
                                            (if (coercive-boolean (< ~isym ~countsym))
                                              (let [~k (-nth ~chunksym ~isym)]
                                                ~subform-chunk
-                                               ~@(when needrec [recform-chunk]))
-                                             (when-let [~seqsym (seq ~seqsym)]
+                                               ~@(core/when needrec [recform-chunk]))
+                                             (core/when-let [~seqsym (seq ~seqsym)]
                                                (if (chunked-seq? ~seqsym)
                                                  (let [c# (chunk-first ~seqsym)]
                                                    (recur (chunk-rest ~seqsym) c#
                                                      (count c#) 0))
                                                  (let [~k (first ~seqsym)]
                                                    ~subform
-                                                   ~@(when needrec [recform]))))))])))))]
+                                                   ~@(core/when needrec [recform]))))))])))))]
     (nth (step nil (seq seq-exprs)) 1)))

 (core/defmacro array [& rest]
@@ -1861,10 +1862,10 @@
       assoc :tag 'object)))

 (core/defmacro js-obj [& rest]
-  (core/let [sym-or-str? (fn [x] (core/or (core/symbol? x) (core/string? x)))
-             filter-on-keys (fn [f coll]
+  (core/let [sym-or-str? (core/fn [x] (core/or (core/symbol? x) (core/string? x)))
+             filter-on-keys (core/fn [f coll]
                               (->> coll
-                                (filter (fn [[k _]] (f k)))
+                                (filter (core/fn [[k _]] (f k)))
                                 (into {})))
              kvs (into {} (map vec (partition 2 rest)))
              sym-pairs (filter-on-keys core/symbol? kvs)
@@ -1874,8 +1875,8 @@
              obj (gensym "obj")]
     `(let [~@(apply concat (clojure.set/map-invert expr->local))
            ~obj ~(js-obj* (filter-on-keys core/string? kvs))]
-       ~@(map (fn [[k v]] `(aset ~obj ~k ~v)) sym-pairs)
-       ~@(map (fn [[k v]] `(aset ~obj ~v ~(core/get kvs k))) expr->local)
+       ~@(map (core/fn [[k v]] `(aset ~obj ~k ~v)) sym-pairs)
+       ~@(map (core/fn [[k v]] `(aset ~obj ~v ~(core/get kvs k))) expr->local)
        ~obj)))

 (core/defmacro alength [a]
@@ -1927,7 +1928,7 @@
   "Throws an exception if the given option map contains keys not listed
   as valid, else returns nil."
   [options & valid-keys]
-  (when (seq (apply disj (apply core/hash-set (keys options)) valid-keys))
+  (core/when (seq (apply disj (apply core/hash-set (keys options)) valid-keys))
     (throw
       (apply core/str "Only these options are valid: "
         (first valid-keys)
@@ -1963,7 +1964,7 @@
                            (conj (meta mm-name) m)
                            m)
              mm-ns (-> &env :ns :name core/str)]
-    (when (= (count options) 1)
+    (core/when (= (count options) 1)
       (throw
         #?(:clj (Exception. "The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)")
            :cljs (js/Error. "The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)"))))
@@ -2073,7 +2074,7 @@
     "Argument to ns-interns must be a quoted symbol")
   `(into {}
      [~@(map
-          (fn [[sym _]]
+          (core/fn [[sym _]]
             `[(symbol ~(name sym)) (var ~(symbol (name ns) (name sym)))])
           (get-in @env/*compiler* [:cljs.analyzer/namespaces ns :defs]))]))

@@ -2153,7 +2154,7 @@
        `(do
           (set! (. ~sym ~(get-delegate-prop))
             (fn (~(vec sig) ~@body)))
-          ~@(when solo
+          ~@(core/when solo
               `[(set! (. ~sym ~'-cljs$lang$maxFixedArity)
                   ~(core/dec (count sig)))])
           (set! (. ~sym ~'-cljs$lang$applyTo)
@@ -2161,7 +2162,7 @@

 (core/defn- variadic-fn [name meta [[arglist & body :as method] :as fdecl]]
   (letfn [(dest-args [c]
-            (map (fn [n] `(aget (js-arguments) ~n))
+            (map (core/fn [n] `(aget (js-arguments) ~n))
               (range c)))]
     (core/let [rname (symbol (core/str ana/*cljs-ns*) (core/str name))
                sig   (remove '#{&} arglist)
@@ -2194,7 +2195,7 @@

 (core/defn- multi-arity-fn [name meta fdecl]
   (letfn [(dest-args [c]
-            (map (fn [n] `(aget (js-arguments) ~n))
+            (map (core/fn [n] `(aget (js-arguments) ~n))
               (range c)))
           (fixed-arity [rname sig]
             (let [c (count sig)]
@@ -2256,13 +2257,13 @@
   )

 (def
-  ^{:doc "Same as (def name (fn [params* ] exprs*)) or (def
-    name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
+  ^{:doc "Same as (def name (core/fn [params* ] exprs*)) or (def
+    name (core/fn ([params* ] exprs*)+)) with any doc-string or attrs added
     to the var metadata. prepost-map defines a map with optional keys
     :pre and :post that contain collections of pre or post conditions."
     :arglists '([name doc-string? attr-map? [params*] prepost-map? body]
                  [name doc-string? attr-map? ([params*] prepost-map? body)+ attr-map?])}
-  defn (fn defn [&form &env name & fdecl]
+  defn (core/fn defn [&form &env name & fdecl]
          ;; Note: Cannot delegate this check to def because of the call to (with-meta name ..)
          (if (core/instance? clojure.lang.Symbol name)
            nil
@@ -2326,7 +2327,7 @@
     :arglists '([name doc-string? attr-map? [params*] body]
                 [name doc-string? attr-map? ([params*] body)+ attr-map?])
     :macro true}
-  defmacro (fn [&form &env
+  defmacro (core/fn [&form &env
                 name & args]
              (core/let [prefix (core/loop [p (core/list (vary-meta name assoc :macro true)) args args]
                                  (core/let [f (first args)]
@@ -2344,10 +2345,10 @@
                         fdecl (if (vector? (first fdecl))
                                 (core/list fdecl)
                                 fdecl)
-                        add-implicit-args (fn [fd]
+                        add-implicit-args (core/fn [fd]
                                             (core/let [args (first fd)]
                                               (cons (vec (cons '&form (cons '&env args))) (next fd))))
-                        add-args (fn [acc ds]
+                        add-args (core/fn [acc ds]
                                    (if (core/nil? ds)
                                      acc
                                      (core/let [d (first ds)]


creating the aws credentials map reading in the variables from the environment

--- src/bitfondue/config.clj
+++ src/bitfondue/config.clj
@@ -7,3 +7,9 @@
 ;; Authentication & Authorization
 (def token-secret
   (env :token-secret))
+
+;; AWS credentials
+(def aws-credentials
+  {:access-key (env :aws-key)
+   :secret-key (env :aws-secret)
+   :bucket     (env :aws-bucket)})


Call .replace instead of str-replace. Don't create lib or classes, just ignore.

--- src/leiningen/new.clj
+++ src/leiningen/new.clj
@@ -6,9 +6,6 @@
   (:use [clojure.contrib.duck-streams :only [spit]]
         [clojure.contrib.java-utils :only [file]]
         [clojure.contrib.str-utils :only [str-join]]))
-
-(defn str-replace [subs s]
-  (apply str (replace subs s)))

 (defn new [project-name & [project-dir]]
   (println project-name project-dir)
@@ -25,22 +22,19 @@
                                         "1.1.0-alpha-SNAPSHOT"]
                                        ['org.clojure/clojure-contrib
                                         "1.0-SNAPSHOT"]])))
-    (let [starter-clj-ns   (str-replace {\/ \.} (str project-name))
-          starter-clj (str (str-replace {\- \_ \. \/} starter-clj-ns) ".clj")
-          starter-clj-dir  (.getParent (file starter-clj))]
-      (doseq [d [(str "src/" starter-clj-dir) "test" "lib" "classes"]]
-        (.mkdirs (file project-dir d)))
-      ;; maybe keep this somewhere else?
-      (spit (file project-dir "src" starter-clj)
-            (str "(ns " starter-clj-ns ")\n"))
+    (let [project-ns  (.replace (str project-name) "/" ".")
+          project-clj (str (.replace (str project-name) "-" "_") ".clj")]
+      (.mkdirs (file project-dir "test"))
+      (.mkdirs (.getParentFile (file project-dir "src" project-clj)))
+      (spit (file project-dir "src" project-clj)
+            (str "(ns " project-ns ")\n"))
       (spit (file project-dir ".gitignore")
             (str-join "\n" ["pom-generated.xml"
                             "Manifest.txt"
-                            (str artifact-id ".jar")]))
-      (spit (file project-dir "lib" ".gitignore") "*")
-      (spit (file project-dir "classes" ".gitignore") "*")
+                            (str artifact-id ".jar")
+                            "lib" "classes"]))
       (spit (file project-dir "README")
-            (str-join "\n\n" [(str "# " project-name)
+            (str-join "\n\n" [(str "# " artifact-id)
                               "FIXME: write description"
                               "## Usage" "FIXME: write"
                               "## Installation" "FIXME: write"


Add dispatch fn for items

Add dispatch fn for items

--- src/discuss/components/items.cljs
+++ src/discuss/components/items.cljs
@@ -5,7 +5,19 @@
             [discuss.communication.lib :as comlib]
             [discuss.translations :refer [translate] :rename {translate t}]
             [discuss.utils.common :as lib]
-            [discuss.utils.views :as vlib]))
+            [discuss.utils.views :as vlib]
+            [cljs.spec.alpha :as s]))
+
+(defn- dispatch-click-fn
+  "Dispatch which function should be applied if there is a click on an item."
+  [url]
+  (case url
+    "login" (lib/change-view-next! :login)
+    "back" (.log js/console "Not yet implemented")
+    (comlib/ajax-get url nil comlib/process-discussion-step)))
+
+(s/fdef dispatch-click-fn
+  :args (s/cat :url string?))

 (defui Item
   static om/IQuery
@@ -18,7 +30,7 @@
                     [:input {:type "radio"
                              :className (lib/prefix-name "dialog-items")
                              :name (lib/prefix-name "dialog-items-group")
-                             :onClick #(comlib/ajax-get url nil comlib/process-discussion-step)
+                             :onClick (partial dispatch-click-fn url)
                              :value url}]
                     " "
                     (vlib/safe-html (string/join (str " <i>" (t :common :and) "</i> ") htmls))]]))))


abstract over get API

abstract over get API

--- src/chessground/api.cljs
+++ src/chessground/api.cljs
@@ -8,31 +8,28 @@
 (defn build
   "Creates JavaScript functions that push to the channel"
   [chan]
-  (letfn [(push [function data] (common/push! chan [function data]))]
+  (letfn [(tell [function data] (common/push! chan [function data]))
+          (ask [question callback]
+            (let [response-chan (a/chan)]
+              (am/go (a/>! chan [question response-chan])
+                     (callback (clj->js (a/<! response-chan)))
+                     (a/close! response-chan))))]
     (clj->js
-      {:toggleOrientation #(push :toggle-orientation nil)
-       :setOrientation    #(push :set-orientation %)
-       :getOrientation    (fn [callback]
-                            (let [response-chan (a/chan)]
-                              (am/go (a/>! chan [:get-orientation response-chan])
-                                     (callback (a/<! response-chan))
-                                     (a/close! response-chan))))
-       :getPosition       (fn [callback]
-                            (let [response-chan (a/chan)]
-                              (am/go (a/>! chan [:get-position response-chan])
-                                     (callback (clj->js (a/<! response-chan)))
-                                     (a/close! response-chan))))
-       :setFen            #(push :set-fen %)
-       :setStartPos       #(push :set-fen "start")
-       :clear             #(push :clear nil)
-       :move              #(push :api-move [%1 %2])
-       :setLastMove       #(push :set-last-move [%1 %2])
-       :setCheck          #(push :set-check %)
+      {:toggleOrientation #(tell :toggle-orientation nil)
+       :setOrientation    #(tell :set-orientation %)
+       :getOrientation    #(ask :get-orientation %)
+       :getPosition       #(ask :get-position %)
+       :setFen            #(tell :set-fen %)
+       :setStartPos       #(tell :set-fen "start")
+       :clear             #(tell :clear nil)
+       :move              #(tell :api-move [%1 %2])
+       :setLastMove       #(tell :set-last-move [%1 %2])
+       :setCheck          #(tell :set-check %)
        :setPieces         (fn [pieces]
-                            (push :set-pieces (common/map-values
+                            (tell :set-pieces (common/map-values
                                                 common/keywordize-keys
                                                 (js->clj pieces {:keywordize-keys true}))))
-       :setDests          #(push :set-dests (js->clj %))})))
+       :setDests          #(tell :set-dests (js->clj %))})))
 ; "setFen"            (fn [fen] (push-in :set-fen fen))
 ; "startPos"          (fn [] (push-in :set-fen "start"))
 ; "setDests"          (fn [dests] (push-in :set-dests (js->clj dests)))


Enable DB migration

Enable DB migration

--- src/clj/dbquery/core.clj
+++ src/clj/dbquery/core.clj
@@ -324,7 +324,7 @@
       (wrap-defaults (assoc site-defaults :security {:anti-forgery false}))))
 ;;
 (defn start-server [port]
-  ;; (sync-db "dev")
+  (model/upgrade-db)
   (add-encoders)
   (run-server (reload/wrap-reload #'app)
               {:port port :thread 50}))


added /lists and /board urls.

added /lists and /board urls.

--- src/clj/dekk/handler.clj
+++ src/clj/dekk/handler.clj
@@ -12,6 +12,10 @@
            (GET "/" [] (render-file "templates/index.html" {:dev (env :dev?)}))
            (GET "/cards" []
              (pr-str (base-access/cards)))
+           (GET "/lists" []
+             (pr-str (base-access/lists)))
+           (GET "/board" []
+             (pr-str (base-access/board)))
            (resources "/")
            (not-found "Not Found"))


moved flip archives effect to the confirmed part of /rez-all

--- src/clj/game/core-io.clj
+++ src/clj/game/core-io.clj
@@ -95,10 +95,10 @@
                    {:title "/counter command"} nil))

 (defn command-rezall [state side value]
-  (swap! state update-in [:corp :discard] #(map (fn [c] (assoc c :seen true)) %))
   (resolve-ability state side
     {:optional {:prompt "Rez all cards and turn cards in archives faceup?"
                 :yes-ability {:effect (req
+                                        (swap! state update-in [:corp :discard] #(map (fn [c] (assoc c :seen true)) %))
                                         (doseq [c (all-installed state side)]
                                           (when-not (:rezzed c)
                                             (rez state side c {:ignore-cost :all-costs}))))}}}


Send plain text alerts.

Send plain text alerts.

--- src/clj/medusa/alert.clj
+++ src/clj/medusa/alert.clj
@@ -11,7 +11,7 @@
     (ses/send-email :destination {:to-addresses destinations}
                     :source "telemetry-alerts@mozilla.com"
                     :message {:subject subject
-                              :body {:html (str "" body "")}})))
+                              :body {:text body}})))

 (defn notify-subscribers [{:keys [metric_id date emails]}]
   (let [{:keys [hostname]} @config/state


Removing the use of new

Removing the use of new

--- src/cljs/go/compiler.clj
+++ src/cljs/go/compiler.clj
@@ -185,9 +185,9 @@

 (defmethod emit-constant java.util.regex.Pattern [x]
   (if (= "" (str x))
-    (emits "(new js.RegExp(\"\"))")
+    (emits "(js.RegExp{\"\"})")
     (let [[_ flags pattern] (re-find #"^(?:\(\?([idmsux]*)\))?(.*)" (str x))]
-      (emits \/ (.replaceAll (re-matcher #"/" pattern) "\\\\/") \/ flags))))
+      (emits "(js.RegExp{\"" (.replaceAll (re-matcher #"/" pattern) "\\\\/") ", " flags "\"}"))))

 (defmethod emit-constant clojure.lang.Keyword [x]
   (if (-> @env/*compiler* :opts :emit-constants)
@@ -195,7 +195,7 @@
       (emits "cljs.core." value))
     (let [ns   (namespace x)
           name (name x)]
-      (emits "new cljs.core.Keyword(")
+      (emits "cljs.core.Keyword{")
       (emit-constant ns)
       (emits ",")
       (emit-constant name)
@@ -205,7 +205,7 @@
                        name))
       (emits ",")
       (emit-constant (hash x))
-      (emits ")"))))
+      (emits "}"))))

 (defmethod emit-constant clojure.lang.Symbol [x]
   (let [ns     (namespace x)
@@ -213,7 +213,7 @@
         symstr (if-not (nil? ns)
                  (str ns "/" name)
                  name)]
-    (emits "new cljs.core.Symbol(")
+    (emits "cljs.core.Symbol{")
     (emit-constant ns)
     (emits ",")
     (emit-constant name)
@@ -223,15 +223,15 @@
     (emit-constant (hash x))
     (emits ",")
     (emit-constant nil)
-    (emits ")")))
+    (emits "}")))

 ;; tagged literal support

 (defmethod emit-constant java.util.Date [^java.util.Date date]
-  (emits "new js.Date(" (.getTime date) ")"))
+  (emits "js.Date{" (.getTime date) "}"))

 (defmethod emit-constant java.util.UUID [^java.util.UUID uuid]
-  (emits "new cljs.core.UUID(\"" (.toString uuid) "\")"))
+  (emits "cljs.core.UUID{\"" (.toString uuid) "\"}"))

 (defmacro emit-wrap [env & body]
   `(let [env# ~env]
@@ -279,10 +279,10 @@

         (<= (count keys) array-map-threshold)
         (if (distinct-keys? keys)
-          (emits "new cljs.core.PersistentArrayMap(null, " (count keys) ", ["
+          (emits "cljs.core.PersistentArrayMap{null, " (count keys) ", ["
             (comma-sep (interleave keys vals))
-            "], null)")
-          (emits "new cljs.core.PersistentArrayMap.fromArray(["
+            "], null}")
+          (emits "cljs.core.PersistentArrayMap.fromArray(["
             (comma-sep (interleave keys vals))
             "], true, false)"))

@@ -307,8 +307,8 @@
       (emits "cljs.core.PersistentVector.EMPTY")
       (let [cnt (count items)]
         (if (< cnt 32)
-          (emits "new cljs.core.PersistentVector(null, " cnt
-            ", 5, cljs.core.PersistentVector.EMPTY_NODE, ["  (comma-sep items) "], null)")
+          (emits "cljs.core.PersistentVector{null, " cnt
+            ", 5, cljs.core.PersistentVector.EMPTY_NODE, ["  (comma-sep items) "], null}")
           (emits "cljs.core.PersistentVector.fromArray([" (comma-sep items) "], true)"))))))

 (defn distinct-constants? [items]
@@ -323,8 +323,8 @@
       (emits "cljs.core.PersistentHashSet.EMPTY")

       (distinct-constants? items)
-      (emits "new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, " (count items) ", ["
-        (comma-sep (interleave items (repeat "null"))) "], null), null)")
+      (emits "cljs.core.PersistentHashSet{null, cljs.core.PersistentArrayMap{null, " (count items) ", ["
+        (comma-sep (interleave items (repeat "null"))) "], null}, null}")

       :else (emits "cljs.core.PersistentHashSet.fromArray([" (comma-sep items) "], true)"))))

@@ -591,7 +591,7 @@
                 (emitln "return " n ".call(this" (if (zero? pcnt) nil
                                                      (list "," (comma-sep (take pcnt maxparams)))) ");"))))
           (emitln "}")
-          (emitln "panic(new js.Error('Invalid arity: ' + arguments.length));")
+          (emitln "panic(js.Error{'Invalid arity: ' + arguments.length});")
           (emitln "};")
           (when variadic
             (emitln mname ".cljs$lang$maxFixedArity = " max-fixed-arity ";")
@@ -767,9 +767,9 @@
 (defmethod emit* :new
   [{:keys [ctor args env]}]
   (emit-wrap env
-             (emits "(new " ctor "("
+             (emits "(" ctor "{"
                     (comma-sep args)
-                    "))")))
+                    "})")))

 (defmethod emit* :set!
   [{:keys [target val env]}]
@@ -1073,7 +1073,7 @@
   (doseq [[keyword value] table]
     (let [ns   (namespace keyword)
           name (name keyword)]
-      (emits "cljs.core." value " = new cljs.core.Keyword(")
+      (emits "cljs.core." value " = cljs.core.Keyword{")
       (emit-constant ns)
       (emits ",")
       (emit-constant name)
@@ -1081,7 +1081,7 @@
       (emit-constant (if ns
                        (str ns "/" name)
                        name))
-      (emits ");\n"))))
+      (emits "};\n"))))

 (defn emit-constants-table-to-file [table dest]
   (with-open [out ^java.io.Writer (io/make-writer dest {})]


0.5 is best for :reproductive-fidelity and :reproductive-consistency meta-errors.

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -52,15 +52,17 @@
                           ;
                           (= cat :reproductive-fidelity)
                           (let [g (:genome ind)]
-                            (sequence-similarity
-                              g
-                              (produce-child-genome-by-autoconstruction g g argmap)))
+                            (#(Math/abs (- % 0.5))
+                              (sequence-similarity
+                                g
+                                (produce-child-genome-by-autoconstruction g g argmap))))
                           ;
                           (= cat :reproductive-consistency)
                           (let [g (:genome ind)]
-                            (sequence-similarity
-                              (produce-child-genome-by-autoconstruction g g argmap)
-                              (produce-child-genome-by-autoconstruction g g argmap)))
+                            (#(Math/abs (- % 0.5))
+                              (sequence-similarity
+                                (produce-child-genome-by-autoconstruction g g argmap)
+                                (produce-child-genome-by-autoconstruction g g argmap))))
                           :else (throw (Exception. (str "Unrecognized meta category: " cat)))))]
     (doall (map meta-error-fn meta-error-categories))))


Revert "CMR-183: Renamed function to use -> convention and replace doall + map with doseq."

This reverts commit 5d60b715371acc8c0db4bdbcde0e21312e043a2e.

--- src/cmr/common/cache.clj
+++ src/cmr/common/cache.clj
@@ -8,7 +8,7 @@
   "The key used to store the general cache in the system cache map."
   :general)

-(defn context->cache
+(defn cache-from-context
   "Get the cache for the given key from the context"
   [context cache-key]
   (get-in context [:system :caches cache-key]))
@@ -65,13 +65,13 @@
 (defn reset-caches
   "Clear all caches."
   [context]
-  (doseq [[k v] (get-in context [:system :caches])]
-    (fn [[k v]]
-      (debug "Clearing cache " k)
-      (reset-cache v))))
+  (doall (map (fn [[k v]]
+                (debug "Clearing cache " k)
+                (reset-cache v))
+              (get-in context [:system :caches]))))

 (defn update-cache
-  "Update the cache contents with the output of the given function, f. f takes the
+  "Update the cache contents with the output of the given funciton, f. f takes the
   current cache as its input and returns the new cache."
   [cmr-cache f]
   (swap! (:atom cmr-cache) f)


minor: fix unit tests

minor: fix unit tests

--- ssclj/jar/src/test/clojure/com/sixsq/slipstream/ssclj/usage/summary_test.clj
+++ ssclj/jar/src/test/clojure/com/sixsq/slipstream/ssclj/usage/summary_test.clj
@@ -31,7 +31,7 @@
   (defentity usage-records)
   (defentity usage-summaries)
   (delete usage-records)
-  ; (delete usage-summaries)
+  (delete usage-summaries)
   (log/debug "All usage-records deleted")
   (log/debug "usage records " (select usage-records))
   (log/debug "usage summaries " (select usage-summaries))


missing commits

missing commits

--- src/ontrail/group.clj
+++ src/ontrail/group.clj
@@ -63,14 +63,14 @@
 ;; marrasputki
 (def min-jog-time (* 25 60 100)) ; 25 minutes

-(defn november-stats-query [users]
+(defn november-stats-query [users last-day]
   {:sport "Juoksu" "$or" (mapv (partial assoc {} :user) users) :duration {"$gte" min-jog-time}
    "$and" [{:creationDate {"$gte" (time/date-time 2012 11 1 0 0)}}
-           {:creationDate {"$lte" (time/date-time 2012 12 1 0 0)}}]
+           {:creationDate {"$lte" (time/date-time 2012 11 last-day 0 0)}}]
    })

-(defn jogs-from-beginning-of-november [users]
-  (let [query (november-stats-query users)]
+(defn jogs-from-beginning-of-november [users last-day]
+  (let [query (november-stats-query users last-day)]
     (mq/with-collection EXERCISE
        (mq/find query)
        (mq/fields [:creationDate :duration :user])
@@ -80,12 +80,13 @@
   (let [results (filter #(= user (:user %)) all-results)
         dates (set (map (comp (partial time/day) :creationDate) results))
         has-all (every? identity (map (partial contains? dates) days))
-        jog-count (count dates)]
+        jog-count (count results)]
     {:user user :isGood has-all :jogCount jog-count}))

 (defn november-race-stats-with-day [day-now users]
-  (let [days (range 1 (inc day-now))
-        all-results (jogs-from-beginning-of-november users)]
+  (let [last-day (inc day-now)
+        days (range 1 last-day)
+        all-results (jogs-from-beginning-of-november users last-day)]
     (mapv (partial analyze-jogs all-results days) users)))

 (def november-race-stats


Make scroll detection bi-lateral

Make scroll detection bi-lateral

* Before, would only detect scroll if touch moved fast enough in y axis.  Now, uses  Pythagorean distance for detection.  But still only looks at y distance to decide actual scroll distance.

--- src/playmary/one.cljs
+++ src/playmary/one.cljs
@@ -196,11 +196,18 @@
     (-> instrument
         (assoc :notes (map (fn [n] (if (note-off? n) (assoc n :off playhead) n)) notes))
         (->> (reduce-val->> stop-piano-key (->> notes (filter note-off?) (map :freq)))))))
+(defn x-distance
+  [{{end-x :x} :position :as t} instrument]
+  (- (get-in instrument [:cur-touches (t :touch-id) :position :x]) end-x))
+
+(defn y-distance
+  [{{end-y :y} :position :as t} instrument]
+  (- (get-in instrument [:cur-touches (t :touch-id) :position :y]) end-y))

 (defn distance
   [t instrument]
-  (- (get-in instrument [:cur-touches (t :touch-id) :position :y])
-     (-> t :position :y)))
+  (.sqrt js/Math (+ (.pow js/Math (x-distance t instrument) 2)
+                    (.pow js/Math (y-distance t instrument) 2))))

 (defn filter-scroll-touches
   [touches instrument]
@@ -219,12 +226,12 @@

 (defn scroll
   [scroll-touches {playhead :playhead px-per-ms :px-per-ms :as instrument}]
-  (if-let [scroll-touch (first (sort (fn [a b] (max (.abs js/Math (distance a instrument))
-                                                    (.abs js/Math (distance b instrument))))
+  (if-let [scroll-touch (first (sort (fn [a b] (max (.abs js/Math (y-distance a instrument))
+                                                    (.abs js/Math (y-distance b instrument))))
                                      scroll-touches))]
     (-> instrument
         (assoc :scrolling? true)
-        (assoc :playhead (+ playhead (/ (distance scroll-touch instrument) px-per-ms))))
+        (assoc :playhead (+ playhead (/ (y-distance scroll-touch instrument) px-per-ms))))
     (assoc instrument :scrolling? false)))

 (defn delete-scrolled-notes


Make more functions which depend on the site-map accept it as an argument.

This allows us to constrain state to a very small area. In this case, the current
site map value is determine in 'compile-content!'.

--- src/pubhouse/core.clj
+++ src/pubhouse/core.clj
@@ -16,16 +16,14 @@

 (def ^:dynamic *meta-sep*
   "The separator that splits each content file into meta and content sections."
-
   "===")

 (def ^:dynamic *block-sep*
   "Separator used in content files to denote line-oriented preprocessing
   blocks."
-
   "$$$")

-(defn mk-file-record
+(defn mk-page-record
   [file lines]
   (merge (->> lines (take-while #(not= % *meta-sep*)) (join " ") (read-string))
          {:path (.getPath file) :mod-time (fs/mod-time file)}))
@@ -34,14 +32,13 @@
   [lines]
   (->> lines (drop-while #(not= % *meta-sep*)) (drop 1)))

-(defn file-record? [x] (and (coll? x) (contains? x :mod-time)))
+(defn page-record? [x] (and (coll? x) (contains? x :mod-time)))

 (defn build-file!
   "Merge the hash from the meta-information lines of `file` with useful
   file-system information, such as the path and url relative to the root."
-
   [file lines]
-  [(mk-file-record file lines)
+  [(mk-page-record file lines)
    (content-section lines)])

 (defn build-files!
@@ -52,15 +49,14 @@
 ;; change.

 (defn conj-site-map
-  [site-map file-record]
+  [site-map page-record]
   (assoc-in site-map
-            (map keyword (fs/split (:path file-record)))
-            file-record))
+            (map keyword (fs/split (:path page-record)))
+            page-record))

 (defn build-site-map!
   "Creates a nested persistent map where the keys are filenames and directory
   names, and entries are maps of the same type, or file records."
-
   [root-dir]
   (reset! *site-map*
           (let [root-part (first (fs/split root-dir))]
@@ -74,37 +70,32 @@
   (if-let [e (fs/extension s)] (clojure.string/replace s e "") s))

 (defn strip-file-info
-  [file-record]
-  (dissoc file-record :path :mod-time))
+  [page-record]
+  (dissoc page-record :path :mod-time))

-(defn get-site-map
-  []
-  (deref *site-map*))
-
 (defn humane-site-map
-  []
+  [site-map]
   (clojure.walk/postwalk (fn [form]
-                           (cond (file-record? form)
+                           (cond (page-record? form)
                                  (strip-file-info form)

                                  (keyword? form)
                                  (-> form name strip-extension keyword)

                                  :default form))
-                         (get-site-map)))
+                         site-map))

 (defmulti render-file
   "Takes as its first argument a map of the type returned by `build-file!`,
   and as its second argument a lazy sequence of the lines of the corresponding
   file. Should return a string which will be written to the output file."
-
   (comp fs/extension :path))

 (defmethod render-file ".md"
-  [file-record content-lines]
+  [page-record content-lines]
   (hiccup/html
    [:html
-    [:head [:title (:title file-record)]]
+    [:head [:title (:title page-record)]]
     [:body (md-to-html-string (join "\n" content-lines))]]))

 (defn mk-output
@@ -113,20 +104,24 @@
    (str (join "/" (cons root (drop 2 (fs/split (strip-extension path)))))
         ".html")))

+(defn navigate-site-map
+  [site-map page-record]
+  (assoc (humane-site-map site-map)
+         :current-page
+         (strip-file-info page-record)))
+
 (defn compile-file!
-  [build-path [file-record lines]]
-  (let [output (mk-output build-path (:path file-record))]
+  [site-map build-path [page-record lines]]
+  (let [output (mk-output build-path (:path page-record))]
     (with-parent-dir output
       (fn []
         (with-open [writer (clojure.java.io/writer output)]
-          (binding [site (assoc (humane-site-map)
-                                :current-page
-                                (strip-file-info file-record))]
-            (.write writer (render-file file-record lines))))))))
+          (binding [site (navigate-site-map site-map page-record)]
+            (.write writer (render-file page-record lines))))))))

 (defn compile-content!
-  [content-root build-path]
-  (do-directory! (comp (partial compile-file! build-path)
+  [site-map content-root build-path]
+  (do-directory! (comp (partial compile-file! site-map build-path)
                        build-file!)
                  (complement fs/directory?)
                  content-root))
@@ -138,4 +133,4 @@
                         (join "/" (concat (fs/split root-dir)
                                           (list "content"))))]
       (build-site-map! content-root)
-      (compile-content! content-root build-root))))
+      (compile-content! @*site-map* content-root build-root))))


raf polyfill

raf polyfill

--- src/re_view/core.cljs
+++ src/re_view/core.cljs
@@ -38,10 +38,23 @@
                  (.error js/console e)))))))

 (def to-render (atom #{}))
+
+(defn raf-polyfill []
+  (if-not (js-get js/window "requestAnimationFrame")
+    (aset js/window "requestAnimationFrame"
+          (or
+            (js-get js/window "webkitRequestAnimationFrame")
+            (js-get js/window "mozRequestAnimationFrame")
+            (js-get js/window "oRequestAnimationFrame")
+            (js-get js/window "msRequestAnimationFrame")
+            (fn [cb]
+              (js-call js/window "setTimeout" cb (/ 1000 60)))))))
+
+(raf-polyfill)
+
 (defn render-loop
   []
   (let [components @to-render]
-
     (when-not (empty? components)
       (reset! to-render #{})
       (doseq [c components]


(TK-3) Add multiserver shutdown test

(TK-3) Add multiserver shutdown test

Add multiserver shutdown test. This test throws an error in the
startup function for a service that depends on the Jetty service
and has a multi-server setup. It ensures that all the servers
are successfully shut down after the error is thrown.

--- test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj
+++ test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj
@@ -275,13 +275,21 @@
     [service jetty9-service]
     jetty-plaintext-config))

+(defn boot-service-and-jetty-with-multiserver-config
+  [service]
+  (tk-core/boot-services-with-config
+    [service jetty9-service]
+    jetty-multiserver-plaintext-config))
+
 (defn get-jetty-server-from-app-context
-  [app]
-  (-> (tk-app/get-service app :WebserverService)
-      (tk-services/service-context)
-      (:jetty9-servers)
-      (:default)
-      (:server)))
+  ([app]
+   (get-jetty-server-from-app-context app :default))
+  ([app server-id]
+   (-> (tk-app/get-service app :WebserverService)
+       (tk-services/service-context)
+       (:jetty9-servers)
+       (server-id)
+       (:server))))

 (deftest jetty-and-dependent-service-shutdown-after-service-error
   (testing (str "jetty and any dependent services are shutdown after a"
@@ -312,6 +320,42 @@
            "Service shutdown was not called.")
        (is (.isStopped jetty-server)
            "Jetty server was not stopped after call to run-app."))))
+  (testing (str "jetty and any dependent services are shutdown after a"
+                "service throws an error from its start function"
+                "in a multi-server set-up")
+    (with-test-logging
+      (let [shutdown-called? (atom false)
+            test-service     (tk-services/service
+                               [[:WebserverService]]
+                               (start [this context]
+                                      (throw (Throwable. "oops"))
+                                      context)
+                               (stop [this context]
+                                     (reset! shutdown-called? true)
+                                     context))
+            app              (boot-service-and-jetty-with-multiserver-config
+                               test-service)
+            jetty-server1     (get-jetty-server-from-app-context app :ziggy)
+            jetty-server2     (get-jetty-server-from-app-context app :jareth)]
+        (is (.isStarted jetty-server1)
+            "First Jetty server was never started before call to run-app")
+        (is (.isStarted jetty-server2)
+            "Second Jetty server was never started before call to run-app")
+        (is (not (.isStopped jetty-server1))
+            "First Jetty server was stopped before call to run-app")
+        (is (not (.isStopped jetty-server2))
+            "Second Jetty server was stopped before call to run-app")
+        (is (thrown-with-msg?
+              Throwable
+              #"oops"
+              (tk-core/run-app app))
+            "tk run-app did not die with expected exception.")
+        (is (true? @shutdown-called?)
+            "Service shutdown was not called.")
+        (is (.isStopped jetty-server1)
+            "First Jetty server was not stopped after call to run-app.")
+        (is (.isStopped jetty-server2)
+            "Second Jetty server was not stopped after call to run-app."))))
   (testing (str "jetty server instance never attached to the service context "
                 "and dependent services are shutdown after a service throws "
                 "an error from its init function")


It's the function itself that might not be defined, not the return.

--- src/klangmeister/sound/music.cljs
+++ src/klangmeister/sound/music.cljs
@@ -2,7 +2,7 @@
   (:require [leipzig.temperament :as temperament]
             [klangmeister.sound.synthesis :as synthesis]))

-(defonce context (or (js/window.AudioContext.) (js/window.webkitAudioContext.)))
+(defonce context ((or js/window.AudioContext. js/window.webkitAudioContext.)))

 (defn play! [notes]
   (doseq [{:keys [time duration instrument] :as note} notes]


Make hyphenation consistent

Make hyphenation consistent

--- src/play_clj/core_listeners.clj
+++ src/play_clj/core_listeners.clj
@@ -51,7 +51,7 @@
     (pinch [this ip1 ip2 p1 p2]
       (execute-fn! on-pinch
                    :initial-pointer-1 ip1 :initial-pointer-2 ip2
-                   :pointer1 p1 :pointer2 p2)
+                   :pointer-1 p1 :pointer-2 p2)
       false)
     (tap [this x y c b]
       (execute-fn! on-tap :input-x x :input-y y :count c :button b)


WIP: table of results for POSTing URL encoded data.

--- src/posthere/cljs/posthere.cljs
+++ src/posthere/cljs/posthere.cljs
@@ -70,6 +70,20 @@
     [:td key]
     [:td val]])

+(defn body-table-map-content [body]
+  [:tr]) ; TODO Hiccup table of URL encoded name/values
+
+(defn- body-table-string-content [body]
+  [:tr
+    [:td.text-left [:pre [:code
+      (html-escape body)]]]])
+
+(defn- body-table-content [result]
+  (let [body (aget result "body")]
+    (if false ; TODO conditional if this is a JSON map
+      (body-table-map-content body)
+      (body-table-string-content body))))
+
 (defhtml body-table
   "HTML for a 2 row table, containing a body label row and the body content that was POSTed."
   [result]
@@ -78,9 +92,7 @@
       [:tbody
         [:tr
           [:th.text-center {:colspan 2} "Body"]]
-        [:tr
-          [:td.text-left [:pre [:code
-            (html-escape (aget result "body"))]]]]]]])
+        (body-table-content result)]]])

 (defhtml headers-table
   "HTML for a table with all the HTTP header name/value pairs."


fix directory copying for catalog commits (close #111)

--- src/main/cljs_api_gen/catalog.clj
+++ src/main/cljs_api_gen/catalog.clj
@@ -213,7 +213,9 @@
                                   new-loc (str *output-dir* "/" filename)]
                               (if (file? f)
                                 (copy f new-loc)
-                                (copy-dir f new-loc)))))]
+                                (do
+                                  (delete-dir new-loc)
+                                  (copy-dir f new-loc))))))]

       (if catalog?


Update repl expression comments.

Update repl expression comments.

--- src/cavm/core.clj
+++ src/cavm/core.clj
@@ -167,8 +167,8 @@
                        (flush))))
    x))

-; (def testdb (create-xenadb "test;TRACE_LEVEL_FILE=3"))
-; (def testdb (create-xenadb "/inside/home/craft/xena/database;TRACE_LEVEL_FILE=3"))
+; (def testdb (h2/create-xenadb "test;TRACE_LEVEL_FILE=3"))
+; (def testdb (h2/create-xenadb "/inside/home/craft/xena/database;TRACE_LEVEL_FILE=3"))
 ; (def testdetector (apply cr/detector "/inside/home/craft/xena/files" detectors))
 ; (def testloader (cl/loader-agent testdb testdetector "/inside/home/craft/xena/files"))
 ;            (watch (partial file-changed #'testloader docroot-default) docroot-default)