CMR-621: Added additional test.

CMR-621: Added additional test.

--- test/cmr/system_int_test/search/collection_search_format_test.clj
+++ test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -226,7 +226,7 @@
                [:status :results]))))))

 (deftest atom-has-score-for-keyword-search
-  (let [coll1 (d/ingest "PROV1" (dc/collection {:long-name "ABC!XYZ"}))]
+  (let [coll1 (d/ingest "PROV1" (dc/collection {:long-name "ABC!XYZ" :entry-title "Foo"}))]

     (index/refresh-elastic-index)

@@ -235,5 +235,12 @@
                                    (map :score (get-in (search/find-concepts-atom :collection
                                                                                {:keyword keyword-str})
                                                        [:results :entries])))
-           "ABC" [1.4]))))
-
+           "ABC" [1.4]
+           "ABC Foo" [1.0]))
+    (testing "Atom has no score field for non-keyword search."
+      (are [title-str scores] (= scores
+                                   (map :score (get-in (search/find-concepts-atom :collection
+                                                                                {:entry-title title-str})
+                                                       [:results :entries])))
+           "Foo" [nil]))))
+


if either cat-set or pred-set exists, use that rather than falling back to get-lex

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -109,7 +109,15 @@
                        (and (not (= :top pred)) (not-empty pred-set)
                             (not (= :top cat)) (not-empty cat-set))
                        (intersection-with-identity pred-set cat-set)
-                       true (get-lex parent :head (:index language-model)))]
+
+                       (and (not (= :top cat)) (not-empty cat-set))
+                       cat-set
+
+                       (and (not (= :top pred)) (not-empty pred-set))
+                       pred-set
+
+                       true
+                       (get-lex parent :head (:index language-model)))]
                  (over/overh parent (lazy-shuffle subset))))
              parents))
           phrasal ;; 2. generate list of all phrases where the head child of each parent is itself a phrase.


improve logging on and handling of unification failure

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -16,6 +16,9 @@

 ;; use map or pmap.
 (def ^:const mapfn map)
+
+(def ^:const exception-on-unify-fail
+  false)

 ;; deterministic generation:
 ;;(def ^:const shufflefn (fn [x] x))
@@ -277,10 +280,17 @@
         (log/warn (str "  b: " ((:morph-ps model) b)))
         (log/debug (str "  ser a: (def a (dag_unify.core/deserialize '(" (string/join "" (:dag_unify.core/serialized a)) ")))"))
         (log/debug (str "  ser b: (def b (dag_unify.core/deserialize '(" (string/join "" (:dag_unify.core/serialized b)) ")))"))
-        (log/warn (str ") => fail@" (fail-path a b))))
+        (log/warn (str ") => fail@" (fail-path a b)))
+        (let [message (str "failed to unify:( "
+                           "  a: " ((:morph-ps model) a) ","
+                           "  b: " ((:morph-ps model) b)
+                           "  morph a: " ((:morph model) a) ","
+                           "  b: " (keys b)
+                           ") => fail@" (fail-path a b))]
+          (if exception-on-unify-fail (throw (Exception. message))
+              (log/warn message))))
+
       (log/debug (str "unify(" ((:morph-ps model) a)
                       " , " ((:morph-ps model) b) ") => "
                       ((:morph-ps model) result))))))

-
-


variable-renaming, TODO comments, and s/defn/defn-/ where appropriate

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -165,7 +165,7 @@
          (phrases-with-phrasal-head)
          (parent-with-head-1 spec depth (rest parent-rules)))))))

-(defn get-lexemes
+(defn- get-lexemes
   "Get lexemes matching the spec. Use index, where the index
    is a function that we call with _spec_ to get a set of lexemes
    that matches the given _spec_."
@@ -178,25 +178,27 @@
    (filter #(not (= :fail %)))
    (map #(u/assoc-in! % [::done?] true))))

-(defn assoc-each-default [tree children f]
+;; TODO: use recur: should be more efficient(?)
+(defn- assoc-each-default [tree children path]
   (if (not (empty? children))
     (lazy-cat
      (let [child (first children)
-           tree-with-child (u/assoc-in tree f child)]
+           tree-with-child (u/assoc-in tree path child)]
        (-> tree-with-child
            (u/assoc-in!
-            (concat (butlast f) [::done?])
+            (concat (butlast path) [::done?])
             true)
-           (u/dissoc-paths (if truncate? [f] []))
+           (u/dissoc-paths (if truncate? [path] []))
            (default-fn)))
-     (assoc-each-default tree (rest children) f))))
-
-(defn assoc-children [tree children f]
+     (assoc-each-default tree (rest children) path))))
+
+;; TODO: use recur: should be more efficient(?)
+(defn- assoc-children [tree children path]
   (if (not (empty? children))
     (let [child (first children)]
       (lazy-cat
        (if (= true (u/get-in child [::done?]))
-         (assoc-each-default tree (default-fn child) f)
-         [(u/assoc-in tree f child)])
-       (assoc-children tree (rest children) f)))))
-
+         (assoc-each-default tree (default-fn child) path)
+         [(u/assoc-in tree path child)])
+       (assoc-children tree (rest children) path)))))
+


+(defn morph-ps)

+(defn morph-ps)

--- src/babel/italiano.cljc
+++ src/babel/italiano.cljc
@@ -18,6 +18,10 @@

 (defn fo-ps [expression]
   (morph/fo-ps1 expression))
+
+(defn morph-ps [tree]
+  "print a concise one-line representation of the tree"
+  ((:morph-ps @medium) tree))

 (def lexicon (:lexicon @medium))
 (def infinitives


add launcher to the root inducers

add launcher to the root inducers

--- src/bract/core/main.clj
+++ src/bract/core/main.clj
@@ -22,6 +22,7 @@
    core-inducer/read-context         ; read context file if present
    core-inducer/set-verbosity        ; set user-preferred verbosity
    core-inducer/run-context-inducers ; run context inducers
+   core-inducer/invoke-launcher      ; launch application
    ])


Expose all secretbox_easy variants

Expose all secretbox_easy variants

--- src/caesium/binding.clj
+++ src/caesium/binding.clj
@@ -41,187 +41,182 @@
   This has to be a vec and not a map, because the same key (symbol,
   method name) might occur with multiple values (e.g. when binding the
   same char* fn with different JVM byte types)."
-  '[[^int sodium_init []]
-    [^String sodium_version_string []]
-
-    [^void randombytes
-     [^bytes ^{Pinned {}} buf
-      ^long ^{LongLong {}} buflen]]
-
-    [^long ^{size_t {}} crypto_secretbox_keybytes []]
-    [^long ^{size_t {}} crypto_secretbox_noncebytes []]
-    [^long ^{size_t {}} crypto_secretbox_macbytes []]
-    [^String crypto_secretbox_primitive []]
-
-    [^int crypto_secretbox_easy
-     [^bytes ^{Pinned {}} c
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-    [^int crypto_secretbox_easy
-     [^java.nio.ByteBuffer ^{Pinned {}} c
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-    [^int crypto_secretbox_open_easy
-     [^bytes ^{Pinned {}} m
-      ^bytes ^{Pinned {}} c
-      ^long ^{LongLong {}} clen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-    [^int crypto_secretbox_open_easy
-     [^bytes ^{Pinned {}} m
-      ^java.nio.ByteBuffer ^{Pinned {}} c
-      ^long ^{LongLong {}} clen
-      ^java.nio.ByteBuffer ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-    [^int crypto_secretbox_detached
-     [^bytes ^{Pinned {}} c
-      ^bytes ^{Pinned {}} mac
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-    [^int crypto_secretbox_open_detached
-     [^bytes ^{Pinned {}} m
-      ^bytes ^{Pinned {}} c
-      ^bytes ^{Pinned {}} mac
-      ^long ^{LongLong {}} clen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} k]]
-
-    [^long ^{size_t {}} crypto_box_seedbytes []]
-    [^long ^{size_t {}} crypto_box_publickeybytes []]
-    [^long ^{size_t {}} crypto_box_secretkeybytes []]
-    [^long ^{size_t {}} crypto_box_noncebytes []]
-    [^long ^{size_t {}} crypto_box_macbytes []]
-    [^String ^{size_t {}} crypto_box_primitive []]
-
-    [^int crypto_box_seed_keypair
-     [^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk
-      ^bytes ^{Pinned {}} seed]]
-    [^int crypto_box_keypair
-     [^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk]]
-    [^int crypto_box_easy
-     [^bytes ^{Pinned {}} c
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk]]
-    [^int crypto_box_open_easy
-     [^bytes ^{Pinned {}} m
-      ^bytes ^{Pinned {}} c
-      ^long ^{LongLong {}} clen
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk]]
-
-    [^long ^{size_t {}} crypto_sign_bytes []]
-    [^long ^{size_t {}} crypto_sign_seedbytes []]
-    [^long ^{size_t {}} crypto_sign_publickeybytes []]
-    [^long ^{size_t {}} crypto_sign_secretkeybytes []]
-    [^String crypto_sign_primitive []]
-
-    [^int crypto_sign_keypair
-     [^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk]]
-    [^int crypto_sign_seed_keypair
-     [^bytes ^{Pinned {}} pk
-      ^bytes ^{Pinned {}} sk
-      ^bytes ^{Pinned {}} seed]]
-    [^int crypto_sign
-     [^bytes ^{Pinned {}} sm
-      ^jnr.ffi.byref.LongLongByReference smlen_p
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} sk]]
-    [^int crypto_sign_open
-     [^bytes ^{Pinned {}} m
-      ^jnr.ffi.byref.LongLongByReference mlen_p
-      ^bytes ^{Pinned {}} sm
-      ^long ^{LongLong {}} smlen
-      ^bytes ^{Pinned {}} pk]]
-    [^int crypto_sign_detached
-     [^bytes ^{Pinned {}} sig
-      ^jnr.ffi.byref.LongLongByReference siglen_p
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} sk]]
-    [^int crypto_sign_verify_detached
-     [^bytes ^{Pinned {}} sig
-      ^bytes ^{Pinned {}} m
-      ^long ^{LongLong {}} mlen
-      ^bytes ^{Pinned {}} pk]]
-
-    [^long ^{size_t {}} crypto_generichash_bytes_min []]
-    [^long ^{size_t {}} crypto_generichash_bytes_max []]
-    [^long ^{size_t {}} crypto_generichash_bytes []]
-    [^long ^{size_t {}} crypto_generichash_keybytes_min []]
-    [^long ^{size_t {}} crypto_generichash_keybytes_max []]
-    [^long ^{size_t {}} crypto_generichash_keybytes []]
-    [^String crypto_generichash_primitive []]
-    [^int crypto_generichash
-     [^bytes ^{Pinned {}} buf
-      ^long ^{LongLong {}} buflen
-      ^bytes ^{Pinned {}} msg
-      ^long ^{LongLong {}} msglen
-      ^bytes ^{Pinned {}} key
-      ^long ^{LongLong {}} keylen]]
-
-    [^long ^{size_t {}} crypto_generichash_blake2b_bytes_min []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_bytes_max []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_bytes []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_keybytes_min []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_keybytes_max []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_keybytes []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_saltbytes []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_personalbytes []]
-    [^long ^{size_t {}} crypto_generichash_blake2b_statebytes []]
-    [^int crypto_generichash_blake2b
-     [^bytes ^{Pinned {}} buf
-      ^long ^{LongLong {}} buflen
-      ^bytes ^{Pinned {}} msg
-      ^long ^{LongLong {}} msglen
-      ^bytes ^{Pinned {}} key
-      ^long ^{LongLong {}} keylen]]
-    [^int crypto_generichash_blake2b_salt_personal
-     [^bytes ^{Pinned {}} buf
-      ^long ^{LongLong {}} buflen
-      ^bytes ^{Pinned {}} msg
-      ^long ^{LongLong {}} msglen
-      ^bytes ^{Pinned {}} key
-      ^long ^{LongLong {}} keylen
-      ^bytes ^{Pinned {}} salt
-      ^bytes ^{Pinned {}} personal]]
-
-    [^long ^{size_t {}} crypto_hash_sha256_bytes []]
-    [^int crypto_hash_sha256
-     [^bytes ^{Pinned {}} buf
-      ^bytes ^{Pinned {}} msg
-      ^long ^{LongLong {}} msglen]]
-
-    [^long ^{size_t {}} crypto_hash_sha512_bytes []]
-    [^int crypto_hash_sha512
-     [^bytes ^{Pinned {}} buf
-      ^bytes ^{Pinned {}} msg
-      ^long ^{LongLong {}} msglen]]
-
-    [^long ^{size_t {}} crypto_scalarmult_bytes []]
-    [^long ^{size_t {}} crypto_scalarmult_scalarbytes []]
-    [^String crypto_scalarmult_primitive []]
-
-    [^int crypto_scalarmult_base
-     [^bytes ^{Pinned {}} q
-      ^bytes ^{Pinned {}} n]]
-    [^int crypto_scalarmult
-     [^bytes ^{Pinned {}} q
-      ^bytes ^{Pinned {}} n
-      ^bytes ^{Pinned {}} p]]])
+  (concat
+   '[[^int sodium_init []]
+     [^String sodium_version_string []]
+
+     [^void randombytes
+      [^bytes ^{Pinned {}} buf
+       ^long ^{LongLong {}} buflen]]
+
+     [^long ^{size_t {}} crypto_secretbox_keybytes []]
+     [^long ^{size_t {}} crypto_secretbox_noncebytes []]
+     [^long ^{size_t {}} crypto_secretbox_macbytes []]
+     [^String crypto_secretbox_primitive []]]
+   (permuted-byte-types
+    '[^int crypto_secretbox_easy
+      [^bytes ^{Pinned {}} c
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} k]])
+   '[[^int crypto_secretbox_open_easy
+      [^bytes ^{Pinned {}} m
+       ^bytes ^{Pinned {}} c
+       ^long ^{LongLong {}} clen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} k]]
+     [^int crypto_secretbox_open_easy
+      [^bytes ^{Pinned {}} m
+       ^java.nio.ByteBuffer ^{Pinned {}} c
+       ^long ^{LongLong {}} clen
+       ^java.nio.ByteBuffer ^{Pinned {}} n
+       ^bytes ^{Pinned {}} k]]
+     [^int crypto_secretbox_detached
+      [^bytes ^{Pinned {}} c
+       ^bytes ^{Pinned {}} mac
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} k]]
+     [^int crypto_secretbox_open_detached
+      [^bytes ^{Pinned {}} m
+       ^bytes ^{Pinned {}} c
+       ^bytes ^{Pinned {}} mac
+       ^long ^{LongLong {}} clen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} k]]
+
+     [^long ^{size_t {}} crypto_box_seedbytes []]
+     [^long ^{size_t {}} crypto_box_publickeybytes []]
+     [^long ^{size_t {}} crypto_box_secretkeybytes []]
+     [^long ^{size_t {}} crypto_box_noncebytes []]
+     [^long ^{size_t {}} crypto_box_macbytes []]
+     [^String ^{size_t {}} crypto_box_primitive []]
+
+     [^int crypto_box_seed_keypair
+      [^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk
+       ^bytes ^{Pinned {}} seed]]
+     [^int crypto_box_keypair
+      [^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk]]
+     [^int crypto_box_easy
+      [^bytes ^{Pinned {}} c
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk]]
+     [^int crypto_box_open_easy
+      [^bytes ^{Pinned {}} m
+       ^bytes ^{Pinned {}} c
+       ^long ^{LongLong {}} clen
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk]]
+
+     [^long ^{size_t {}} crypto_sign_bytes []]
+     [^long ^{size_t {}} crypto_sign_seedbytes []]
+     [^long ^{size_t {}} crypto_sign_publickeybytes []]
+     [^long ^{size_t {}} crypto_sign_secretkeybytes []]
+     [^String crypto_sign_primitive []]
+
+     [^int crypto_sign_keypair
+      [^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk]]
+     [^int crypto_sign_seed_keypair
+      [^bytes ^{Pinned {}} pk
+       ^bytes ^{Pinned {}} sk
+       ^bytes ^{Pinned {}} seed]]
+     [^int crypto_sign
+      [^bytes ^{Pinned {}} sm
+       ^jnr.ffi.byref.LongLongByReference smlen_p
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} sk]]
+     [^int crypto_sign_open
+      [^bytes ^{Pinned {}} m
+       ^jnr.ffi.byref.LongLongByReference mlen_p
+       ^bytes ^{Pinned {}} sm
+       ^long ^{LongLong {}} smlen
+       ^bytes ^{Pinned {}} pk]]
+     [^int crypto_sign_detached
+      [^bytes ^{Pinned {}} sig
+       ^jnr.ffi.byref.LongLongByReference siglen_p
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} sk]]
+     [^int crypto_sign_verify_detached
+      [^bytes ^{Pinned {}} sig
+       ^bytes ^{Pinned {}} m
+       ^long ^{LongLong {}} mlen
+       ^bytes ^{Pinned {}} pk]]
+
+     [^long ^{size_t {}} crypto_generichash_bytes_min []]
+     [^long ^{size_t {}} crypto_generichash_bytes_max []]
+     [^long ^{size_t {}} crypto_generichash_bytes []]
+     [^long ^{size_t {}} crypto_generichash_keybytes_min []]
+     [^long ^{size_t {}} crypto_generichash_keybytes_max []]
+     [^long ^{size_t {}} crypto_generichash_keybytes []]
+     [^String crypto_generichash_primitive []]
+     [^int crypto_generichash
+      [^bytes ^{Pinned {}} buf
+       ^long ^{LongLong {}} buflen
+       ^bytes ^{Pinned {}} msg
+       ^long ^{LongLong {}} msglen
+       ^bytes ^{Pinned {}} key
+       ^long ^{LongLong {}} keylen]]
+
+     [^long ^{size_t {}} crypto_generichash_blake2b_bytes_min []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_bytes_max []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_bytes []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_keybytes_min []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_keybytes_max []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_keybytes []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_saltbytes []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_personalbytes []]
+     [^long ^{size_t {}} crypto_generichash_blake2b_statebytes []]
+     [^int crypto_generichash_blake2b
+      [^bytes ^{Pinned {}} buf
+       ^long ^{LongLong {}} buflen
+       ^bytes ^{Pinned {}} msg
+       ^long ^{LongLong {}} msglen
+       ^bytes ^{Pinned {}} key
+       ^long ^{LongLong {}} keylen]]
+     [^int crypto_generichash_blake2b_salt_personal
+      [^bytes ^{Pinned {}} buf
+       ^long ^{LongLong {}} buflen
+       ^bytes ^{Pinned {}} msg
+       ^long ^{LongLong {}} msglen
+       ^bytes ^{Pinned {}} key
+       ^long ^{LongLong {}} keylen
+       ^bytes ^{Pinned {}} salt
+       ^bytes ^{Pinned {}} personal]]
+
+     [^long ^{size_t {}} crypto_hash_sha256_bytes []]
+     [^int crypto_hash_sha256
+      [^bytes ^{Pinned {}} buf
+       ^bytes ^{Pinned {}} msg
+       ^long ^{LongLong {}} msglen]]
+
+     [^long ^{size_t {}} crypto_hash_sha512_bytes []]
+     [^int crypto_hash_sha512
+      [^bytes ^{Pinned {}} buf
+       ^bytes ^{Pinned {}} msg
+       ^long ^{LongLong {}} msglen]]
+
+     [^long ^{size_t {}} crypto_scalarmult_bytes []]
+     [^long ^{size_t {}} crypto_scalarmult_scalarbytes []]
+     [^String crypto_scalarmult_primitive []]
+
+     [^int crypto_scalarmult_base
+      [^bytes ^{Pinned {}} q
+       ^bytes ^{Pinned {}} n]]
+     [^int crypto_scalarmult
+      [^bytes ^{Pinned {}} q
+       ^bytes ^{Pinned {}} n
+       ^bytes ^{Pinned {}} p]]]))

 (defmacro ^:private defsodium
   []


Using when-let.

Using when-let.

--- src/cbfg/world-net.cljs
+++ src/cbfg/world-net.cljs
@@ -18,13 +18,12 @@

 (defn server-accept-loop [actx accept-ch]
   (ago-loop server-accept-loop actx [num-accepts 0]
-            (let [a (atake server-accept-loop accept-ch)]
-              (when a
-                (let [[server-send-ch server-recv-ch close-server-recv-ch] a]
-                  (server-conn-loop server-accept-loop
-                                    server-send-ch
-                                    server-recv-ch)
-                (recur (inc num-accepts)))))))
+            (when-let [[server-send-ch server-recv-ch close-server-recv-ch]
+                       (atake server-accept-loop accept-ch)]
+              (server-conn-loop server-accept-loop
+                                server-send-ch
+                                server-recv-ch)
+              (recur (inc num-accepts)))))

 (defn client-loop [actx cmd-ch client-hist client-send-ch client-recv-ch vis-chs world-vis-init el-prefix]
   (ago-loop client-loop actx [num-requests 0 num-responses 0]


Remove unused require statement

Remove unused require statement

--- src/main/workflo/macros/specs/parsed_query.cljc
+++ src/main/workflo/macros/specs/parsed_query.cljc
@@ -3,7 +3,6 @@
                :clj  [clojure.spec :as s])
             #?(:cljs [cljs.spec.impl.gen :as gen]
                :clj  [clojure.spec.gen :as gen])
-            [workflo.macros.query.util :as util]
             [workflo.macros.specs.query]))

 (s/def :property/type


CMR-4907 test fix.

CMR-4907 test fix.

--- system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -339,7 +339,7 @@
         "DIF .native extension" [c3-dif c4-dif] :dif "native" nil
         "ISO MENDS .native extension" [c5-iso c6-iso] :iso19115 "native" nil
         "SMAP ISO .native extension" [c7-smap] :iso-smap "native" nil
-        "UMM JSON .native extension" [c10-umm-json] {:format :umm-json, :version "1.12"} "native" nil
+        "UMM JSON .native extension" [c10-umm-json] {:format :umm-json, :version "1.13"} "native" nil
         "ECHO10 accept application/metadata+xml" [c1-echo c2-echo] :echo10 nil "application/metadata+xml"
         "DIF accept application/metadata+xml" [c3-dif c4-dif] :dif nil "application/metadata+xml"
         "ISO MENDS accept application/metadata+xml" [c5-iso c6-iso] :iso19115 nil "application/metadata+xml"


Remove renamed file that wasn't removed before

--- src/vip/data_processor/validation/xml/xpath.clj
+++ src/vip/data_processor/validation/xml/xpath.clj
@@ -1,106 +0,0 @@
-(ns vip.data-processor.validation.xml.spec
-  (:import [javax.xml.parsers DocumentBuilder DocumentBuilderFactory]
-           [javax.xml.xpath XPathFactory XPathConstants])
-  (:require [clojure.java.io :as io]))
-
-(defn spec-resource [version]
-  (let [path (str "specs/vip_spec_v" version ".xsd")]
-    (io/resource path)))
-
-(def doc-builder-factory (doto (DocumentBuilderFactory/newInstance)
-                           (.setNamespaceAware true)))
-(def doc-builder (.newDocumentBuilder doc-builder-factory))
-
-(defn parse-spec-by-version [version]
-  (with-open [is (io/input-stream (spec-resource version))]
-                (.parse doc-builder is)))
-
-(def spec-docs
-  (let [versions ["3.0" "5.0"]]
-    (zipmap versions
-            (map parse-spec-by-version versions))))
-
-(def xpath-factory (XPathFactory/newInstance))
-
-(defn query-spec
-  "Given an XPath expression and a specification version returns all
-  nodes that match."
-  [path version]
-  (let [xpath (.newXPath xpath-factory)
-        expr (.compile xpath path)
-        spec-doc (spec-docs version)]
-    (.evaluate expr spec-doc XPathConstants/NODESET)))
-
-(defn nodeset->seq* [nodeset length i]
-  (if (< i length)
-    (lazy-seq
-     (cons (.item nodeset i)
-           (nodeset->seq* nodeset length (inc i))))
-    nil))
-
-(defn nodeset->seq [nodeset]
-  (nodeset->seq* nodeset (.getLength nodeset) 0))
-
-(defn ancestry
-  "Returns a list of all ancestors (except the 'document') for the
-  element."
-  [element]
-  (loop [ancestors nil
-         ancestor element]
-    (if ancestor
-      (recur (conj ancestors ancestor)
-             (.getParentNode ancestor))
-      ;; drop the "document" element
-      (drop 1 ancestors))))
-
-(defn type->elements
-  "Query a spec for all elements of the type."
-  [type version]
-  (let [type-query-expr (str "//*[@type='" type "']")]
-    (-> type-query-expr
-        (query-spec version)
-        nodeset->seq)))
-
-(declare paths-for-type)
-
-(defn paths-for-element [element version]
-  (let [ancestors (ancestry element)]
-    (reduce (fn [paths ancestor]
-              (case (.getTagName ancestor)
-                "xs:element" (conj paths (.getAttribute ancestor "name"))
-                "xs:complexType" (if-let [type-paths (seq (paths-for-type (.getAttribute ancestor "name") version))]
-                                   (conj paths type-paths)
-                                   paths)
-                paths))
-            nil ancestors)))
-
-(defn paths-for-type [type version]
-  (let [elements (type->elements type version)]
-    (map #(paths-for-element % version) elements)))
-
-(defn explode-paths [paths]
-  (loop [lqueries [[]]
-         [x & xs] paths]
-    (cond
-      (nil? x) (map flatten lqueries)
-      (string? x) (recur (map #(conj % x) lqueries)
-                         xs)
-      :else (let [forked-paths (map explode-paths x)]
-              (recur (map #(concat lqueries %) forked-paths)
-                     xs)))))
-
-(defn path->lquery [path]
-  (->> path
-       (interleave (repeat "*{1}"))
-       (interpose ".")
-       reverse
-       (apply str)))
-
-(defn type->lqueries
-  "Generates a list of lqueries to find all elements of type in the
-  version of the specification."
-  [type version]
-  {:pre [(contains? spec-docs version)]}
-  (->> (paths-for-type type version)
-       (mapcat explode-paths)
-       (map path->lquery)))


Fix port

Fix port

--- test/icecap/e2e/http_test.clj
+++ test/icecap/e2e/http_test.clj
@@ -16,9 +16,15 @@
    :headers {"content-type" "text/plain"}
    :body "xyzzy"})

+(def http-server-port
+  8378) ;; 8378 => TEST
+(def http-server-base-url
+  (str "http://localhost:" http-server-port))
+
 (defn ^:private http-server-fixture
   [f]
-  (binding [http-server (http/start-server handler {:port 0})]
+  (binding [http-server (http/start-server handler
+                                           {:port http-server-port})]
     (f)
     (.close http-server)))


DXML-35 alternate approach to newline after preamble

this avoids an IllegalArgumentException

--- src/main/clojure/clojure/data/xml/jvm/pprint.clj
+++ src/main/clojure/clojure/data/xml/jvm/pprint.clj
@@ -14,11 +14,11 @@

 (defn ^Transformer indenting-transformer []
   (doto (-> (TransformerFactory/newInstance) .newTransformer)
-    (.setOutputProperty (OutputKeys/INDENT) "yes")
-    (.setOutputProperty (OutputKeys/METHOD) "xml")
+    (.setOutputProperty OutputKeys/INDENT "yes")
+    (.setOutputProperty OutputKeys/METHOD "xml")
     (.setOutputProperty "{http://xml.apache.org/xslt}indent-amount" "2")
-    ;; print newline after preamble https://bugs.openjdk.java.net/browse/JDK-7150637
-    (.setOutputProperty "http://www.oracle.com/xml/is-standalone" "yes")))
+    ;; print newline after preamble
+    (.setOutputProperty OutputKeys/DOCTYPE_PUBLIC "yes")))

 (defn indent-xml
   [xml-str ^Writer writer]


(PDB-5022) Unnest (enable) ast-fact-value-resource-title-join test

--- test/puppetlabs/puppetdb/http/index_test.clj
+++ test/puppetlabs/puppetdb/http/index_test.clj
@@ -418,9 +418,9 @@
                              ["extract" ["name" "value"]
                               ["in" ["value"]
                                ["extract" ["value"]
-                                ["select_facts"]]]]])))))))))
-
-  (deftest ast-fact-value-resource-title-join
+                                ["select_facts"]]]]]))))))))))
+
+(deftest ast-fact-value-resource-title-join
     (let [certname "foo.local"
           environment "dev"
           right-now (now)
@@ -431,7 +431,8 @@
                           "bar" 2
                           "baz" 3}
                  :timestamp right-now
-                 :producer_timestamp right-now}
+                 :producer_timestamp right-now
+                 :producer "foo1"}
           resource {:type "File"
                     :title "/etc/apache/apache2.conf"
                     :exported false
@@ -473,4 +474,4 @@
                                   ["in" ["title"]
                                    ["extract" ["value"]
                                     ["select_facts"
-                                     ["=" "name" "apache_conf"]]]]]]))))))))))))
+                                     ["=" "name" "apache_conf"]]]]]])))))))))))


Added reference benchmark results.

Added reference benchmark results.

--- benchmarks/benchmarks.clj
+++ benchmarks/benchmarks.clj
@@ -30,7 +30,9 @@
             (dorun) ; Wait for all the threads to complete
             )
        (/ (double (- (System/nanoTime) start-time#)) 1000000.0)
-       (catch Exception e# (println "Exception: " e#) "DNF"))))
+       (catch Exception e# (println "Exception: " e#) "DNF")
+       (finally (Thread/sleep 500)) ; Let server rest
+       )))

 (comment (time-requests (make-benching-options {:requests 9
                                                 :clients  3})
@@ -138,14 +140,19 @@
   (bench-redis-clojure (opts :requests 1000 :clients 1 :data-size 100))
   ;; {:ping 201.87, :set 268.725, :get 241.736}

+  ;; ./redis-benchmark -n 1000 -d 100 -c 1
+  ;; PING-INLINE 1000 requests completed in 0.05 seconds
+  ;; SET         1000 requests completed in 0.05 seconds
+  ;; GET         1000 requests completed in 0.05 seconds
+
   ;; Comparisons
   (bench-and-compare-clients
-   (assoc std-opts :requests 1000 :clients 1 :data-size 10)
+   (assoc shared-opts :requests 1000 :clients 1 :data-size 100)
    :carmine       bench-carmine
    :redis-clojure bench-redis-clojure
-   ;; :clj-redis     bench-clj-redis
-   ;; :accession     bench-accession ; WARNING: Doesn't seem to close sockets!
+   :clj-redis     bench-clj-redis
+   :accession     bench-accession ; WARNING: Doesn't seem to close sockets!

-   ;; Reference benchmark ; TODO
+   ;; Reference benchmark
    :redis-benchmark
-   (constantly {:ping 100 :get 100 :set 100})))+   (constantly {:ping 50 :get 50 :set 50})))


added list generation and iteration test


minor cleanup

minor cleanup


properly format result fields

properly format result fields

--- src/metabase/driver/query_processor/annotate.clj
+++ src/metabase/driver/query_processor/annotate.clj
@@ -241,13 +241,22 @@
   (if fields-is-implicit fail
       (membero field fields-fields)))

-(defn- aggregate-fieldo [{{ag-type :aggregation-type} :aggregation} field]
+{:base_type :IntegerField, :special_type :category, :id nil, :table_id nil, :description nil, :extra_info {}, :target nil, :name "sum"}
+
+(defn- aggregate-fieldo [{{ag-type :aggregation-type, ag-field :field} :aggregation} field]
   (all (membero ag-type [:count :avg :sum :stddev])
-    (fresh [field-name]
-      (== field {:field-name field-name})
-      (membero field-name [:count :avg :sum :stddev])
-      (conde [(== ag-type field-name)]
-             [(== ag-type :distinct) (== field-name :count)]))))
+       (if-not ag-field
+         (do (assert (= ag-type :count))
+             (== field {:base-type    :IntegerField
+                        :field-name   :count
+                        :special-type :number}))
+         (fresh [field-name]
+           (== field (assoc (select-keys ag-field [:base-type :special-type])
+                            :field-name field-name))
+           (membero field-name [:count :avg :sum :stddev])
+           (conde
+            ((== ag-type field-name))
+            ((== ag-type :distinct) (== field-name :count)))))))

 (defn- valid-nameo [{:keys [result-keys]} field]
   (fresh [field-name]
@@ -317,15 +326,17 @@

 (defn- format-col [col]
   (println (u/pprint-to-str 'cyan col))
-  (-> col
-      (set/rename-keys  {:base-type    :base_type
-                         :field-id     :id
-                         :field-name   :name
-                         :special-type :special_type
-                         :table-id     :table_id})
-      (dissoc :parent :parent-id :position)
-      ;; TODO - actually fetch this (!)
-      (assoc :description nil)))
+  (let [defaults {:description nil   ; TODO - actually fetch this
+                  :id          nil
+                  :table_id    nil}]
+    (merge defaults
+           (-> col
+               (set/rename-keys  {:base-type    :base_type
+                                  :field-id     :id
+                                  :field-name   :name
+                                  :special-type :special_type
+                                  :table-id     :table_id})
+               (dissoc :parent :parent-id :position)))))

 (defn post-annotate [qp]
   (fn [query]
@@ -350,5 +361,5 @@
     (metabase.driver/process-query {:database 67
                                     :type     :query
                                     :query    {:source_table (id :venues)
-                                               :aggregation  ["rows"]
+                                               :aggregation  ["sum" (id :venues :price)]
                                                :limit        10}})))


Fixing org overview settings tests.

Fixing org overview settings tests.

--- test-cljs/frontend/components/test_org_settings.cljs
+++ test-cljs/frontend/components/test_org_settings.cljs
@@ -73,17 +73,17 @@
     (testing "plans have the correct number of containers"
       (is-re #"Builds will run in a single container."
              (overview (example-plan :free) "circleci"))
-      (is-re #"Builds will be distributed across 4 containers."
+      (is-re #"All non-iOS builds will be distributed across 4 containers."
              (overview (example-plan :paid) "circleci"))
-      (is-re #"Builds will be distributed across 6 containers."
+      (is-re #"All non-iOS builds will be distributed across 6 containers."
              (overview (example-plan :trial) "circleci"))
-      (is-re #"Builds will be distributed across 7 containers."
+      (is-re #"All non-iOS builds will be distributed across 7 containers."
              (overview (example-plan :free :trial) "circleci"))
-      (is-re #"Builds will be distributed across 6 containers."
+      (is-re #"All non-iOS builds will be distributed across 6 containers."
              (overview (example-plan :trial :paid) "circleci"))
-      (is-re #"Builds will be distributed across 5 containers."
+      (is-re #"All non-iOS builds will be distributed across 5 containers."
              (overview (example-plan :free :paid) "circleci"))
-      (is-re #"Builds will be distributed across 7 containers."
+      (is-re #"All non-iOS builds will be distributed across 7 containers."
              (overview (example-plan :free :paid :trial) "circleci")))
     (testing "trials are described appropriately"
       (is-re #"5 more days" (overview (example-plan :trial) "circleci")))


Add basic integration of interactions form.

Nothing working only the basic interactions of the
"interactions form".

--- src/uxbox/main/ui/workspace/sidebar/interactions.cljs
+++ src/uxbox/main/ui/workspace/sidebar/interactions.cljs
@@ -6,82 +6,542 @@
 ;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>

 (ns uxbox.main.ui.workspace.sidebar.options.interactions
-  (:require [sablono.core :as html :refer-macros [html]]
+  (:require [sablono.core :refer-macros [html]]
             [rum.core :as rum]
             [lentes.core :as l]
-            [uxbox.locales :refer (tr)]
-            [uxbox.router :as r]
-            [uxbox.rstore :as rs]
-            [uxbox.state :as st]
-            [uxbox.library :as library]
-            [uxbox.data.shapes :as uds]
-            [uxbox.data.lightbox :as udl]
-            [uxbox.ui.icons :as i]
-            [uxbox.ui.mixins :as mx]
+            [uxbox.common.i18n :refer (tr)]
+            [uxbox.common.router :as r]
+            [uxbox.common.rstore :as rs]
+            [uxbox.common.ui.mixins :as mx]
+            [uxbox.main.state :as st]
+            [uxbox.main.library :as library]
+            [uxbox.main.data.shapes :as uds]
+            [uxbox.main.data.lightbox :as udl]
+            [uxbox.main.ui.workspace.sidebar.sitemap :refer (pages-l)]
+            [uxbox.main.ui.icons :as i]
+            [uxbox.main.ui.lightbox :as lbx]
+            [uxbox.main.ui.colorpicker :as cp]
             [uxbox.util.dom :as dom]
             [uxbox.util.data :refer (parse-int parse-float read-string)]))

+;; --- Helpers
+
+(defn- on-change
+  ([form attr event]
+   (dom/prevent-default event)
+   (let [value (dom/event->value event)
+         value (read-string value)]
+     (swap! form assoc attr value)))
+  ([form attr keep event]
+   (let [data (select-keys @form keep)]
+     (reset! form data)
+     (on-change form attr event))))
+
+(def show-elements-input?
+  #{:show :hide :toggle :moveto :moveby
+    :opacity :size :color :rotate :scrolltoelement})
+
+(def show-animation-input?
+  #{:show :hide :toggle})
+
+(def show-only-easing-input?
+  (complement show-animation-input?))
+
+;; --- Interactions List
+
+(defn- interactions-list-render
+  [own]
+  (html
+   [:ul.element-list
+    [:li
+     [:div.list-icon i/action]
+     [:span "Hover"]
+     [:div.list-actions
+      [:a {:href "#"} i/pencil]
+      [:a {:href "#"} i/trash]]]
+    [:li
+     [:div.list-icon i/action]
+     [:span "Mouse in"]
+     [:div.list-actions
+      [:a {:href "#"} i/pencil]
+      [:a {:href "#"} i/trash]]]]))
+
+(def interactions-list
+  (mx/component
+   {:render interactions-list-render
+    :name "interactions-list"
+    :mixins [mx/static]}))
+
+;; --- Trigger Input
+
+(defn- trigger-input-render
+  [own form-ref]
+  (when-not (:trigger @form-ref)
+    (swap! form-ref assoc :trigger :click))
+  (html
+   [:div
+    [:span "Trigger"]
+    [:div.row-flex
+     [:select.input-select {:placeholder "Choose a trigger"
+                            :on-change (partial on-change form-ref :trigger)
+                            :value (pr-str (:trigger @form-ref))}
+      [:option {:value ":click"} "Click"]
+      [:option {:value ":doubleclick"} "Double-click"]
+      [:option {:value ":rightclick"} "Right-click"]
+      [:option {:value ":hover"} "Hover"]
+      [:option {:value ":mousein"} "Mouse in"]
+      [:option {:value ":mousein"} "Mouse out"]
+      [:option {:value ":mousein"} "Swipe right"]
+      [:option {:value ":mousein"} "Swipe left"]
+      [:option {:value ":mousein"} "Swipe dpwn"]
+      [:option {:value ":mousein"} "Touch and hold"]
+      [:option {:value ":mousein"} "Hold release"]
+      [:option {:value ":keypress"} "Key press"]
+      [:option {:value ":pageisloaded"} "Page is loaded"]
+      [:option {:value ":windowscroll"} "Window is scrolled to"]]]]))
+
+(def trigger-input
+  (mx/component
+   {:render trigger-input-render
+    :name "trigger-input"
+    :mixins [mx/static]}))
+
+;; --- URL Input
+
+(defn- url-input-render
+  [own form-ref]
+  (html
+   [:div
+    [:span "Url"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "http://"
+       :on-change (partial on-change form-ref :url)
+       :type "url"}]]]))
+
+(def url-input
+  (mx/component
+   {:render url-input-render
+    :name "url-input"}))
+
+;; --- Elements Input
+
+(defn- collect-shapes
+  [state page]
+  (let [shapes-by-id (:shapes-by-id state)
+        shapes (get-in state [:pages-by-id page :shapes])]
+    (letfn [(resolve-shape [acc id]
+              (let [shape (get shapes-by-id id)]
+                (if (= (:type shape) :group)
+                  (reduce resolve-shape (conj acc shape) (:items shape))
+                  (conj acc shape))))]
+      (reduce resolve-shape [] shapes))))
+
+(defn- elements-input-render
+  [own page form-ref]
+  (let [shapes (collect-shapes @st/state page)]
+    (html
+     [:div
+      [:span "Element"]
+      [:div.row-flex
+       [:select.input-select
+        {:placeholder "Choose an element"
+         :on-change (partial on-change form-ref :element)
+         :value (pr-str (:element @form-ref))}
+        [:option {:value "nil"} "---"]
+        (for [shape shapes
+              :let [key (pr-str (:id shape))]]
+          [:option {:key key :value key} (:name shape)])]]])))
+
+(def elements-input
+  (mx/component
+   {:render elements-input-render
+    :name "elements-input"}))
+
+;; --- Page Input
+
+(defn- pages-input-render
+  [own form-ref path]
+  (let [pages @pages-l]
+    (when (and (not (:page @form-ref))
+               (pos? (count pages)))
+      (swap! form-ref assoc :page (:id (first pages))))
+    (html
+     [:div
+      [:span "Page"]
+      [:div.row-flex
+       [:select.input-select {:placeholder "Choose a page"
+                              :on-change (partial on-change form-ref :page)
+                              :value (pr-str (:page @form-ref))}
+        (for [page pages
+              :let [key (pr-str (:id page))]]
+          [:option {:key key :value key} (:name page)])]]])))
+
+(def pages-input
+  (mx/component
+   {:render pages-input-render
+    :name "pages-input"}))
+
+;; --- Animation
+
+(defn- animation-input-render
+  [own form-ref]
+  (when-not (:action @form-ref)
+    (swap! form-ref assoc :animation :none))
+  (html
+   [:div
+    [:span "Animation"]
+    [:div.row-flex
+     [:select.input-select
+      {:placeholder "Animation"
+       :on-change (partial on-change form-ref :animation)
+       :value (pr-str (:animation @form-ref))}
+      [:option {:value ":none"} "None"]
+      [:option {:value ":fade"} "Fade"]
+      [:option {:value ":slide"} "Slide"]]]]))
+
+(def animation-input
+  (mx/component
+   {:render animation-input-render
+    :name "animation-input"}))
+
+;; --- MoveTo Input
+
+(defn- moveto-input-render
+  [own form-ref]
+  (when-not (:moveto-x @form-ref)
+    (swap! form-ref assoc :moveto-x 0))
+  (when-not (:moveto-y @form-ref)
+    (swap! form-ref assoc :moveto-y 0))
+  (html
+   [:div
+    [:span "Move to position (px)"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "X"
+       :on-change (partial on-change form-ref :moveto-x)
+       :type "number"
+       :value (:moveto-x @form-ref)}]
+     [:input.input-text
+      {:placeholder "Y"
+       :on-change (partial on-change form-ref :moveto-y)
+       :type "number"
+       :value (:moveto-y @form-ref)}]]]))
+
+(def moveto-input
+  (mx/component
+   {:render moveto-input-render
+    :name "moveto-input"}))
+
+;; --- Opacity Input
+
+(defn- opacity-input-render
+  [own form-ref]
+  (when-not (:opacity @form-ref)
+    (swap! form-ref assoc :opacity 100))
+  (html
+   [:div
+    [:span "Opacity (%)"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "%"
+       :on-change (partial on-change form-ref :opacity)
+       :min "0"
+       :max "100"
+       :type "number"
+       :value (:opacity @form-ref)}]]]))
+
+(def opacity-input
+  (mx/component
+   {:render opacity-input-render
+    :name "opacity-input"}))
+
+;; --- Rotate Input
+
+(defn rotate-input-render
+  [own form-ref]
+  (html
+   [:div
+    [:span "Rotate (dg)"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "px"
+       :on-change (partial on-change form-ref :rotate)
+       :type "number"
+       :value ""}]]]))
+
+(def rotate-input
+  (mx/component
+   {:render rotate-input-render
+    :name "rotate-input"}))
+
+;; --- Resize Input
+
+(defn- resize-input-render
+  [own form-ref]
+  (html
+   [:div
+    [:span "Resize (px)"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "Width"
+       :on-change (partial on-change form-ref :resize-width)
+       :type "number"
+       :value ""}]
+     [:input.input-text
+      {:placeholder "Height"
+       :on-change (partial on-change form-ref :resize-height)
+       :type "number"
+       :value ""}]]]))
+
+(def resize-input
+  (mx/component
+   {:render resize-input-render
+    :name "resize-input"}))
+
+;; --- Color Input
+
+(defn- colorpicker-render
+  [own {:keys [x y on-change value]}]
+  (let [left (- x 260)
+        top (- y 50)]
+    (html
+     [:div.colorpicker-tooltip
+      {:style {:left (str left "px")
+               :top (str top "px")}}
+
+      (cp/colorpicker
+       :theme :small
+       :value value
+       :on-change on-change)])))
+
+(def ^:private colorpicker
+  (mx/component
+   {:render colorpicker-render
+    :name "colorpicker"
+    :mixins [rum/reactive mx/static]}))
+
+(defmethod lbx/render-lightbox :interactions/colorpicker
+  [params]
+  (colorpicker params))
+
+(defn- color-input-render
+  [own form-ref]
+  (when-not (:fill-color @form-ref)
+    (swap! form-ref assoc :fill-color "#000000"))
+  (when-not (:stroke-color @form-ref)
+    (swap! form-ref assoc :stroke-color "#000000"))
+  (letfn [(on-change [attr color]
+            (swap! form-ref assoc attr color))
+          (show-picker [attr event]
+            (let [x (.-clientX event)
+                  y (.-clientY event)
+                  opts {:x x :y y
+                        :on-change (partial on-change attr)
+                        :value (get @form-ref attr)
+                        :transparent? true}]
+              (udl/open! :interactions/colorpicker opts)))]
+    (let [stroke-color (:stroke-color @form-ref)
+          fill-color (:fill-color @form-ref)]
+      (html
+       [:div
+        [:div.row-flex
+         [:div.column-half
+          [:span "Fill"]
+          [:div.color-data
+           [:span.color-th
+            {:style {:background-color fill-color}
+             :on-click (partial show-picker :fill-color)}]
+           [:div.color-info
+            [:span fill-color]]]]
+         [:div.column-half
+          [:span "Stroke"]
+          [:div.color-data
+           [:span.color-th
+            {:style {:background-color stroke-color}
+             :on-click (partial show-picker :stroke-color)}]
+           [:div.color-info
+            [:span stroke-color]]]]]]))))
+
+(def color-input
+  (mx/component
+   {:render color-input-render
+    :name "color-input"}))
+
+;; --- Easing Input
+
+(defn- easing-input-render
+  [own form-ref]
+  (when-not (:easing @form-ref)
+    (swap! form-ref assoc :easing :none))
+  (html
+   [:div
+    [:span "Easing"]
+    [:div.row-flex
+     [:select.input-select
+      {:placeholder "Easing"
+       :on-change (partial on-change form-ref :easing)
+       :value (pr-str (:easing @form-ref))}
+      [:option {:value ":none"} "None"]
+      [:option {:value ":linear"} "Linear"]
+      [:option {:value ":easein"} "Ease in"]
+      [:option {:value ":easeout"} "Ease out"]
+      [:option {:value ":easeinout"} "Ease in out"]]]]))
+
+(def easing-input
+  (mx/component
+   {:render easing-input-render
+    :name "easing-input"}))
+
+;; --- Duration Input
+
+(defn- duration-input-render
+  [own form-ref]
+  (when-not (:duration @form-ref)
+    (swap! form-ref assoc :duration 300))
+  (when-not (:delay @form-ref)
+    (swap! form-ref assoc :delay 0))
+  (html
+   [:div
+    [:span "Duration  |  Delay (ms)"]
+    [:div.row-flex
+     [:input.input-text
+      {:placeholder "Duration"
+       :type "number"
+       :on-change (partial on-change form-ref :duration)
+       :value (pr-str (:duration @form-ref))}]
+     [:input.input-text {:placeholder "Delay"
+                         :type "number"
+                         :on-change (partial on-change form-ref :delay)
+                         :value (pr-str (:delay @form-ref))}]]]))
+
+(def duration-input
+  (mx/component
+   {:render duration-input-render
+    :name "duration-input"}))
+
+;; --- Action Input
+
+(defn- action-input-render
+  [own page form-ref]
+  (println "action-input" @form-ref)
+  (when-not (:action @form-ref)
+    (swap! form-ref assoc :action :show))
+
+  (let [form @form-ref
+        simple? #{:gotourl :gotopage}
+        elements? (complement simple?)
+        animation? #{:show :hide :toggle}
+        only-easing? (complement animation?)]
+    (html
+     [:div
+      [:span "Action"]
+      [:div.row-flex
+       [:select.input-select
+        {:placeholder "Choose an action"
+         :on-change (partial on-change form-ref :action [:trigger])
+         :value (pr-str (:action form))}
+        [:option {:value ":show"} "Show"]
+        [:option {:value ":hide"} "Hide"]
+        [:option {:value ":toggle"} "Toggle"]
+        [:option {:value ":moveto"} "Move to"]
+        #_[:option {:value ":moveby"} "Move by"]
+        [:option {:value ":opacity"} "Opacity"]
+        [:option {:value ":size"} "Size"]
+        [:option {:value ":color"} "Color"]
+        [:option {:value ":rotate"} "Rotate"]
+        [:option {:value ":gotopage"} "Go to page"]
+        [:option {:value ":gotourl"} "Go to URL"]
+        #_[:option {:value ":goback"} "Go back"]
+        [:option {:value ":scrolltoelement"} "Scroll to element"]]]
+
+      (case (:action form)
+        :gotourl (url-input form-ref)
+        :gotopage (pages-input form-ref)
+        :color (color-input form-ref)
+        :rotate (rotate-input form-ref)
+        :size (resize-input form-ref)
+        :moveto (moveto-input form-ref)
+        :opacity (opacity-input form-ref)
+        nil)
+
+      (when (elements? (:action form))
+        (elements-input page form-ref))
+
+      (when (and (animation? (:action form))
+                 (:element @form-ref))
+        (animation-input form-ref))
+
+      (when (or (not= (:animation form :none) :none)
+                (and (only-easing? (:action form))
+                     (:element form)))
+        (mx/concat
+         (easing-input form-ref)
+         (duration-input form-ref)))
+      ])))
+
+(def action-input
+  (mx/component
+   {:render action-input-render
+    :name "action-input"}))
+
+;; --- Form
+
+(defn- interactions-form-render
+  [own shape form-ref]
+  ;; (println "interactions-form" @form-ref)
+  (html
+   [:form
+    (trigger-input form-ref)
+    (action-input (:page shape) form-ref)
+    [:div.row-flex
+     [:input.btn-primary.btn-small.save-btn {:value "Save" :type "submit"}]
+     [:a.cancel-btn {:href "#"} "Cancel"]]]))
+
+(def interactions-form
+  (mx/component
+   {:render interactions-form-render
+    :name "interactions-form"}))
+
+;; --- Interactions Menu
+
 (defn- interactions-menu-render
   [own menu shape]
+  (let [local (:rum/local own)
+        form (l/derive (l/key :form) local)
+        interactions (:interactions shape)]
     (html
      [:div.element-set {:key (str (:id menu))}
       [:div.element-set-title (:name menu)]
-
       [:div.element-set-content
-
-       [:span "Trigger"]
-       [:div.row-flex
-        [:select#style.input-select {:placeholder "Choose a trigger"
-                                     :value ""}
-         [:option {:value ":click"} "Click"]
-         [:option {:value ":doubleclick"} "Double-click"]
-         [:option {:value ":rightclick"} "Right-click"]
-         [:option {:value ":hover"} "Hover"]
-         [:option {:value ":mousein"} "Mouse in"]]]
-
-       [:span "Action"]
-       [:div.row-flex
-        [:select#style.input-select {:placeholder "Choose an action"
-                                     :value ""}
-         [:option {:value ":show"} "Show"]
-         [:option {:value ":hide"} "Hide"]
-         [:option {:value ":toggle"} "Toggle"]
-         [:option {:value ":moveto"} "Move to"]
-         [:option {:value ":moveby"} "Move by"]]]
-
-       [:span "Element"]
-       [:div.row-flex
-        [:select#style.input-select {:placeholder "Choose an element"
-                                     :value ""}
-         [:option {:value ":1"} "Box 1"]
-         [:option {:value ":2"} "Circle 1"]
-         [:option {:value ":3"} "Circle 2"]
-         [:option {:value ":4"} "Icon 1"]
-         [:option {:value ":5"} "Icon 2"]]]
-
-       [:span "Page"]
-       [:div.row-flex
-        [:select#style.input-select {:placeholder "Choose a page"
-                                     :value ""}
-         [:option {:value ":1"} "page 1"]
-         [:option {:value ":2"} "page 2"]
-         [:option {:value ":3"} "page 3"]
-         [:option {:value ":4"} "page 4"]
-         [:option {:value ":5"} "page 5"]]]
-
-       [:span "Key"]
-       [:div.row-flex
-        [:select#style.input-select {:placeholder "Choose a key"
-                                     :value ""}
-         [:option {:value ":1"} "key 1"]
-         [:option {:value ":2"} "key 2"]
-         [:option {:value ":3"} "key 3"]
-         [:option {:value ":4"} "key 4"]
-         [:option {:value ":5"} "key 5"]]]]
-         ]))
+       (if (and (not @form)
+                (not (empty? interactions)))
+         [:div
+          (interactions-list interactions)
+          [:input.btn-primary.btn-small {:value "New interaction" :type "submit"}]]
+         (interactions-form shape form))]])))

 (def interactions-menu
   (mx/component
    {:render interactions-menu-render
     :name "interactions-menu"
-    :mixed [mx/static]}))
+    :mixins [mx/static (mx/local)]}))
+
+
+;; --- Not implemented stuff
+
+;;      [:span "Key"]
+;;      [:div.row-flex
+;;       [:select.input-select {:placeholder "Choose a key"
+;;                              :value ""}
+;;        [:option {:value ":1"} "key 1"]
+;;        [:option {:value ":2"} "key 2"]
+;;        [:option {:value ":3"} "key 3"]
+;;        [:option {:value ":4"} "key 4"]
+;;        [:option {:value ":5"} "key 5"]]]
+
+;;      [:span "Scrolled to (px)"]
+;;      [:div.row-flex
+;;       [:input.input-text {:placeholder "px"
+;;                           :type "number"
+;;                           :value ""}]]


CMR-3193: Define a constant for the Earth Science category string.

--- search-app/src/cmr/search/services/query_execution/facets/hierarchical_v2_facets.clj
+++ search-app/src/cmr/search/services/query_execution/facets/hierarchical_v2_facets.clj
@@ -237,6 +237,10 @@
                      base-url query-params param-name search-term nil)]]
      (v2h/generate-hierarchical-filter-node search-term 0 link nil)))

+(def earth-science-category-string
+  "Constant for the string used for the Earth Science category within humanized science keywords."
+  "Earth Science")
+
 (defn- remove-non-earth-science-keywords
   "V2 facets only include science keyword facets which have a category of Earth Science. Removes
   any science keywords facets that have any other category."
@@ -244,7 +248,7 @@
   (if (= :science-keywords-h field)
     (let [updated-facet (update hierarchical-facet :children
                                 (fn [children]
-                                  (filter #(= "Earth Science" (:title %)) children)))]
+                                  (filter #(= earth-science-category-string (:title %)) children)))]
       (when-let [earth-science-facets (first (:children updated-facet))]
         ;; Do not return the Earth Science category facet itself, just return the topics below
         (assoc updated-facet :children (:children earth-science-facets))))


Showing off for @timball

Showing off for @timball

--- test/parmenides/core_test.clj
+++ test/parmenides/core_test.clj
@@ -100,7 +100,7 @@
                            :test/id-1 a
                            :test/id-2 b})
                         ids))
-
+     (/ 1 0)
      (unleash-the-cupids! conn)
      (= outcome
         (characteristics (d/db conn))))))


Actually, only close the body if we're absolutely sure we're going to redirect

--- src/clj_http/client.clj
+++ src/clj_http/client.clj
@@ -154,11 +154,11 @@
   request."
   [client {:keys [uri url scheme server-name server-port] :as req}
    {:keys [trace-redirects body] :as resp}]
-  (try (.close body) (catch Exception _))
   (let [url (or url (str (name scheme) "://" server-name
                          (when server-port (str ":" server-port)) uri))]
     (if-let [raw-redirect (get-in resp [:headers "location"])]
       (let [redirect (str (URL. (URL. url) raw-redirect))]
+        (try (.close body) (catch Exception _))
         ((wrap-redirects client) (-> req
                                      (merge (parse-url redirect))
                                      (dissoc :query-params)


remove flooring from nth logic, not present in Clojure, significant perf boost for nth

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -880,7 +880,7 @@
      (when-not (nil? coll)
        (cond
          (satisfies? IIndexed coll false)
-         (-nth ^not-native coll (.floor js/Math n))
+         (-nth ^not-native coll n)

          (array? coll)
          (when (< n (.-length coll))
@@ -895,7 +895,7 @@

          :else
          (if (satisfies? ISeq coll)
-           (linear-traversal-nth coll (.floor js/Math n))
+           (linear-traversal-nth coll n)
            (throw
              (js/Error.
                (str "nth not supported on this type "
@@ -904,7 +904,7 @@
      (if-not (nil? coll)
        (cond
          (satisfies? IIndexed coll false)
-         (-nth ^not-native coll (.floor js/Math n) not-found)
+         (-nth ^not-native coll n not-found)

          (array? coll)
          (if (< n (.-length coll))
@@ -921,7 +921,7 @@

          :else
          (if (satisfies? ISeq coll)
-           (linear-traversal-nth coll (.floor js/Math n) not-found)
+           (linear-traversal-nth coll n not-found)
            (throw
              (js/Error.
                (str "nth not supported on this type "


Reduce impl, fix all multiple arity fn defs, including in protocols at header.

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -21,16 +21,14 @@
     (-index [coll]))

 (defprotocol IIndexed
-  (-nth [coll n])
-  (-nth [coll n not-found]))
+  (-nth [coll n] [coll n not-found]) )

 (defprotocol ISeq
   (-first [coll])
   (-rest [coll]))

 (defprotocol ILookup
-  (-lookup [o k])
-  (-lookup [o k not-found]))
+  (-lookup [o k] [o k not-found]))

 (defprotocol IAssociative
   #_(-contains-key? [coll k])
@@ -67,8 +65,7 @@
   (-with-meta [o meta]))

 (defprotocol IReduce
-  (-reduce [coll f])
-  (-reduce [coll f start]))
+  (-reduce [coll f] [coll f start]))

 (defprotocol IEquiv
   (-equiv [o other]))
@@ -355,33 +352,58 @@

 (extend-protocol IIndexed
   goog.global.String
-  (-nth [string n] (if (< n (-count string)) (.charAt string n)))
-  (-nth [string n not-found]
-    (if (< n (-count string)) (.charAt string n)
-        not-found))
+  (-nth
+    ([string n]
+       (if (< n (-count string)) (.charAt string n)))
+    ([string n not-found]
+       (if (< n (-count string)) (.charAt string n)
+           not_found)))

   goog.global.Array
-  (-nth [array n] (if (< n (-count array)) (aget array n)))
-  (-nth [array n not-found]
-    (if (< n (-count array)) (aget array n)
-        not-found)))
+  (-nth
+    ([array n]
+       (if (< n (-count array)) (aget array n)))
+    ([array n not_found]
+       (if (< n (-count array)) (aget array n)
+           not_found))))

 (extend-protocol ILookup
   goog.global.String
-  (-lookup [string k] (-nth string k))
-  (-lookup [string k not-found] (-nth string k not-found))
-
+  (-lookup
+    ([string k]
+       (-nth string k))
+    ([string k not_found]
+       (-nth string k not_found)))
+
   goog.global.Array
-  (-lookup [array k] (-nth array k))
-  (-lookup [array k not-found] (-nth array k not-found)))
-
-;; (extend-protocol IReduce
-;;   goog.global.Array
-;;   (-reduce [array f]
-;;     (loop [val (-nth array 0), n 1)]
-;;       (if (< n (-count array))
-;;         (recur (f val (-nth array n)) (inc n))
-;;         val)))
+  (-lookup
+    ([array k]
+       (-nth array k))
+    ([array k not-found]
+       (-nth array k not-found))))
+
+(defn- ci-reduce
+  "Accepts any collection which satisfies the ICount and IIndexed protocols and
+reduces them without incurring seq initialization"
+  ([cicoll f val n]
+     (loop [val val, n n]
+         (if (< n (-count cicoll))
+           (recur (f val (-nth cicoll n)) (inc n))
+           val))))
+
+(extend-protocol IReduce
+  goog.global.String
+  (-reduce
+    ([string f]
+       (ci-reduce string f (-nth string 0) 1))
+    ([string f start]
+       (ci-reduce string f start 0)))
+  goog.global.Array
+  (-reduce
+    ([array f]
+       (ci-reduce array f (-nth array 0) 1))
+    ([array f start]
+       (ci-reduce array f start 0))))

 (defn cons
   "Returns a new seq where x is the first element and seq is the rest."
@@ -897,3 +919,4 @@
 (defn disj
   [coll v]
   (when coll (-disjoin coll v)))
+


add missing doc strings for transient support fns

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2489,50 +2489,67 @@

 ;;; Transients

-(defn transient [coll]
+(defn transient
+  "Returns a new, transient version of the collection, in constant time."
+  [coll]
   (-as-transient coll))

-(defn persistent! [tcoll]
+(defn persistent!
+  "Returns a new, persistent version of the transient collection, in
+  constant time. The transient collection cannot be used after this
+  call, any such use will throw an exception."
+  [tcoll]
   (-persistent! tcoll))

 (defn conj!
+  "Adds x to the transient collection, and return coll. The 'addition'
+  may happen at different 'places' depending on the concrete type."
   ([tcoll val]
-   (-conj! tcoll val))
+    (-conj! tcoll val))
   ([tcoll val & vals]
-   (let [ntcoll (-conj! tcoll val)]
-     (if vals
-       (recur ntcoll (first vals) (next vals))
-       ntcoll))))
+    (let [ntcoll (-conj! tcoll val)]
+      (if vals
+        (recur ntcoll (first vals) (next vals))
+        ntcoll))))

 (defn assoc!
+  "When applied to a transient map, adds mapping of key(s) to
+  val(s). When applied to a transient vector, sets the val at index.
+  Note - index must be <= (count vector). Returns coll."
   ([tcoll key val]
-   (-assoc! tcoll key val))
+    (-assoc! tcoll key val))
   ([tcoll key val & kvs]
-   (let [ntcoll (-assoc! tcoll key val)]
-     (if kvs
-       (recur ntcoll (first kvs) (second kvs) (nnext kvs))
-       ntcoll))))
+    (let [ntcoll (-assoc! tcoll key val)]
+      (if kvs
+        (recur ntcoll (first kvs) (second kvs) (nnext kvs))
+        ntcoll))))

 (defn dissoc!
+  "Returns a transient map that doesn't contain a mapping for key(s)."
   ([tcoll key]
-   (-dissoc! tcoll key))
+    (-dissoc! tcoll key))
   ([tcoll key & ks]
-   (let [ntcoll (-dissoc! tcoll key)]
-     (if ks
-       (recur ntcoll (first ks) (next ks))
-       ntcoll))))
-
-(defn pop! [tcoll]
+    (let [ntcoll (-dissoc! tcoll key)]
+      (if ks
+        (recur ntcoll (first ks) (next ks))
+        ntcoll))))
+
+(defn pop!
+  "Removes the last item from a transient vector. If
+  the collection is empty, throws an exception. Returns coll"
+  [tcoll]
   (-pop! tcoll))

 (defn disj!
+  "disj[oin]. Returns a transient set of the same (hashed/sorted) type, that
+  does not contain key(s)."
   ([tcoll val]
-   (-disjoin! tcoll val))
+    (-disjoin! tcoll val))
   ([tcoll val & vals]
-   (let [ntcoll (-disjoin! tcoll val)]
-     (if vals
-       (recur ntcoll (first vals) (next vals))
-       ntcoll))))
+    (let [ntcoll (-disjoin! tcoll val)]
+      (if vals
+        (recur ntcoll (first vals) (next vals))
+        ntcoll))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; apply ;;;;;;;;;;;;;;;;


*print-fn* is now dynamic to support with-out-str

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -18,7 +18,7 @@
 (def
   ^{:doc "Each runtime environment provides a diffenent way to print output.
   Whatever function *print-fn* is bound to will be passed any
-  Strings which should be printed."}
+  Strings which should be printed." :dynamic true}
   *print-fn*
   (fn [_]
     (throw (js/Error. "No *print-fn* fn set for evaluation environment"))))


use clearier font for links

use clearier font for links

--- src/cljs/paren/app.cljs
+++ src/cljs/paren/app.cljs
@@ -121,7 +121,7 @@
         [paren-box focus?]
         [:p "- OR -"]
         [:a {:href "#"
-             :style {:font-family "'Amatic SC', cursive"
+             :style {:font-family "Helvetica, Arial"
                      :font-weight "bold"}
              :on-click #(swap! flipped? not)}
           "Just show me everyting"]])))
@@ -171,7 +171,7 @@
                    :style {:width (str (min (- (:w @viewport) 10) 400) "px") :height "100%"}
                    :alt (-> @app-state :events last :location)}]])]
       [:a {:href "#"
-           :style {:font-family "'Amatic SC', cursive"
+           :style {:font-family "Helvetica, Arial"
                    :font-weight "bold"
                    :margin-top "10px"}
            :on-click #(swap! flipped? not)}


Add D20 function

Add D20 function

This function will role N d20's for you, and return the result in a
human readable format

--- src/clojurebot/core.clj
+++ src/clojurebot/core.clj
@@ -103,6 +103,17 @@
           (str "Error: No symbol for " sym-name))
         "Error: No arguments provided")))

+(reg-commend
+ "d20"
+ (fn [n]
+     (if (< n 0)
+       "You can't roll a negative amount of dice, man"
+       (str "You rolled a "
+            (->> #(+ (rand-int 20) 1)
+                 (repeatedly)
+                 (take n)
+                 (string/join " and a "))))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Entry point
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -120,4 +131,3 @@
     (doseq [chan (:channels config)]
       (irc/join conn chan)
       (irc/message conn chan (:greeting config)))))
-


Add test for map key local variable resolution (#160). (#162)

--- test/sablono/core_test.cljs
+++ test/sablono/core_test.cljs
@@ -1315,3 +1315,10 @@
             :attributes
             {:style "margin-left:2rem;"}
             :content []}))))
+
+(deftest test-issue-160
+  (let [k :data-foo]
+    (is (= (html-data [:div {k "bar"}])
+           {:tag :div
+            :attributes {:data-foo "bar"}
+            :content []}))))


Fixing CMR-4210 changing the character separator to the Unicode Character 'SYMBOL FOR GROUP SEPARATOR'

--- umm-spec-lib/src/cmr/umm_spec/validation/platform.clj
+++ umm-spec-lib/src/cmr/umm_spec/validation/platform.clj
@@ -37,7 +37,7 @@
    with the model number. So the short name is not specific enough to identify
    specific platform instances. Therefore we are adding Characteristic names and values
    so that specific aircraft tail numbers, or boat IDS, etc. can be specified with the
-   short name. The |-| string is also added as a delimiter between the fields. This is used
+   short name. The Unicode Character 'SYMBOL FOR GROUP SEPARATOR' \u241D character is added as a delimiter between the fields. This is used
    in the getErrorString parameter-parser to parse out the different fields, so that a
    meaningful error string can be suppplied back to the user."
   [values unique-fields]
@@ -45,16 +45,16 @@
     (map (fn [value]
            (apply str
                  (ShortName value)
-                 "|-|"
-                 (map #(str (Name %) "|-|" (Value %)) (Characteristics value))))
+                 "\u241D"
+                 (map #(str (Name %) "\u241D" (Value %)) (Characteristics value))))
          values)))

 (defn- getErrorString
   "Creates the error string for platforms depending on which elements (ShortName, Characteristic/Name, Characteristic/Value) are present.
-   The element order is ShortName, Name, Value. The values are separated by the |-| string."
+   The element order is ShortName, Name, Value. The values are separated by the Unicode Character 'SYMBOL FOR GROUP SEPARATOR' \u241D character."
   [duplicate-name]
   (when duplicate-name
-    (let [platform-elements (clojure.string/split duplicate-name #"\|-\|")
+    (let [platform-elements (clojure.string/split duplicate-name #"\u241D")
           platform-counts (count platform-elements)
           shortname (first platform-elements)
           characteristic-name (second platform-elements)


Try to accommodate older dynapath versions, which noir drags in.

--- modules/web/src/main/clojure/immutant/web/middleware.clj
+++ modules/web/src/main/clojure/immutant/web/middleware.clj
@@ -38,7 +38,7 @@
   "Default reload-paths to all directories in the classpath, whether
   they exist at time of deployment or not"
   [options]
-  (let [cp (map io/file (dynapath.util/all-classpath-urls))
+  (let [cp (map io/file (dynapath.util/all-classpath-urls (clojure.lang.RT/baseLoader)))
         dirs (map str (remove #(and (.exists %) (not (.isDirectory %))) cp))]
     (:reload-paths options dirs)))


A keyword may get in here if no :project exists

--- namespaces/common/src/main/clojure/immutant/registry.clj
+++ namespaces/common/src/main/clojure/immutant/registry.clj
@@ -28,9 +28,11 @@

 (defn ^{:private true} get-from-msc [name]
   (if @msc-registry
-    (let [key (if (string? name) (ServiceName/parse name) name)
-          controller (.getService @msc-registry key)]
-      (and controller (.getValue controller)))))
+    (try
+      (let [key (if (string? name) (ServiceName/parse name) name)
+            controller (.getService @msc-registry key)]
+        (and controller (.getValue controller)))
+      (catch ClassCastException _))))

 (defn put
   "Store a value in the registry."


STORM-1890: use pure clojure to detect html files from root path

--- storm-core/src/clj/org/apache/storm/ui/helpers.clj
+++ storm-core/src/clj/org/apache/storm/ui/helpers.clj
@@ -22,7 +22,6 @@
   (:use [org.apache.storm config log])
   (:use [org.apache.storm.util :only [clojurify-structure defnk not-nil?]])
   (:use [clj-time coerce format])
-  (:import [org.apache.commons.lang StringUtils])
   (:import [org.apache.storm.generated ExecutorInfo ExecutorSummary]
            [org.apache.storm.ui UIHelpers]
            [org.apache.storm.metric StormMetricsRegistry])
@@ -57,7 +56,7 @@
       ;; check that the response is html and that the path is for a root page: a single / in the path
       ;; then we know we don't want it cached (e.g. /index.html)
       (if (and (= content-type "text/html")
-               (= 1 (StringUtils/countMatches uri "/")))
+               (= 1 (count (re-seq #"/" uri))))
         ;; response for html page in root directory, no-cache
         (response/header res "Cache-Control" "no-cache")
         ;; else, carry on


fixed merge

fixed merge

--- test-cljs/complico/test/dom.cljs
+++ test-cljs/complico/test/dom.cljs
@@ -49,3 +49,7 @@

 (deftest replace-price-case-2
   (is (= (complico/replace-price "£300") "£XXX")))
+
+(deftest replace-price-should-not-change-text-without-price
+  (is (= (complico/replace-price "text without price") "text without price")))
+


Remove white spaces

Remove white spaces

--- test/clj_gatling/report_test.clj
+++ test/clj_gatling/report_test.clj
@@ -4,12 +4,12 @@
   (:require [clj-gatling.report :as report]
             [clj-containment-matchers.clojure-test :refer [contains-exactly?]]))

-(def scenario-result
+(def scenario-result
   [{:name "Test scenario" :id 1 :start 1391936496814 :end 1391936496814
-    :requests [{:id 1 :name "Request1" :start 1391936496853 :end 1391936497299 :result true}
+    :requests [{:id 1 :name "Request1" :start 1391936496853 :end 1391936497299 :result true}
                {:id 1 :name "Request2" :start 1391936497299 :end 1391936497996 :result true}]}
    {:name "Test scenario" :id 0 :start 1391936496808 :end 1391936496808
-    :requests [{:id 0 :name "Request1" :start 1391936497998 :end 1391936498426 :result true}
+    :requests [{:id 0 :name "Request1" :start 1391936497998 :end 1391936498426 :result true}
                {:id 0 :name "Request2" :start 1391936498430 :end 1391936498450 :result false}]}
    {:name "Test scenario2" :id 0 :start 1391936496808 :end 1391936496808
     :requests [{:id 0 :name "Request1" :start 1391936497998 :end 1391936498426 :result true}]}])


Changed spatial search so that it is no longer nested.

--- src/cmr/search/data/complex_to_simple_converters/spatial.clj
+++ src/cmr/search/data/complex_to_simple_converters/spatial.clj
@@ -11,7 +11,7 @@
 (defn- shape->script-cond
   [shape]
   (qm/map->ScriptCondition {:name "spatial"
-                            :params {:ords (str/join "," (srl/shape->stored-ords shape))}}))
+                            :params {:ords (str/join "," (:ords (srl/shape->stored-ords shape)))}}))

 (defn- br->cond
   [prefix {:keys [west north east south] :as br}]
@@ -56,6 +56,4 @@
           mbr-cond (br->cond "mbr" (srl/shape->mbr shape))
           lr-cond (br->cond "lr" (srl/shape->lr shape))
           spatial-script (shape->script-cond shape)]
-      (qm/nested-condition
-        :geometries
-        (qm/and-conds [mbr-cond (qm/or-conds [lr-cond spatial-script])])))))+      (qm/and-conds [mbr-cond (qm/or-conds [lr-cond spatial-script])]))))


Fixed project-clj-deps function

Fixed project-clj-deps function

Fix omission of om dependency when http-kit option was invoked

--- src/leiningen/new/chestnut.clj
+++ src/leiningen/new/chestnut.clj
@@ -37,11 +37,10 @@
     ["ring.adapter.jetty :refer [run-jetty]"]))

 (defn project-clj-deps [opts]
-  (cond
-    (http-kit? opts) ["http-kit \"2.1.19\""]
-    (reagent? opts)  ["reagent \"0.5.1\""]
-    (om? opts)       ["org.omcljs/om \"1.0.0-alpha31\""]
-    :else            []))
+  (cond-> []
+    (http-kit? opts) (conj "http-kit \"2.1.19\"")
+    (reagent? opts)  (conj "reagent \"0.5.1\"")
+    (om? opts)       (conj "org.omcljs/om \"1.0.0-alpha31\"")))

 (defn project-plugins [opts]
   (cond-> []


Change medium min-size predicate.

Change medium min-size predicate.

It used to admit anything not a thumbnail, but there are some pretty
small things that don't have the thumbnail image types. Change it to
only admit things that have a width or height >= 400 pixels.

--- src/mars_ogler/views/index.clj
+++ src/mars_ogler/views/index.clj
@@ -14,7 +14,10 @@

 (def min-size->pred
   {:thumb (constantly true)
-   :medium (fn [img] (not (thumbnail? img)))
+   :medium (fn [img]
+             (and (not (thumbnail? img))
+                  (or (>= (:w img) 400)
+                      (>= (:h img) 400))))
    :full (fn [img]
            (let [cam-max-size (-> img
                                 image->camera, :cam, cams/cam->max-size)]


Added clarifying notes on :votes-base component of conv-update

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -214,7 +214,8 @@
       ;; returns {tid {
       ;;           :agree [0 4 2 0 6 0 0 1]
       ;;           :disagree [3 0 0 1 0 23 0 ]}
-      ;; where the indices in the arrays are bids
+      ;; where the indices in the arrays correspond NOT directly to the bid, but to the index of the
+      ;; corresponding bid in a hypothetically sorted list of the base cluster ids
       :votes-base (plmb/fnk [bid-to-pid rating-mat]
                      (time2 "votes-base"
                        (->> rating-mat


richer feedback (#1198)

richer feedback (#1198)

--- test/ctia/http/generative/fulltext_search_test.clj
+++ test/ctia/http/generative/fulltext_search_test.clj
@@ -339,42 +339,43 @@
                                                   login {})
                                                  :data)]
                                      (testing (str "query: " query)
-                                       (is (check-fn res) desc)))
+                                       (check-fn res desc)))
           "base query matches expected data"
           {:full-text [{:query "intrusion event 3\\:19187\\:7 incident"}]}
-          (fn [res]
-            (and
-             (= 1 (count res))
-             (-> res first
-                 (select-keys (keys expected))
-                 (= expected))))
+          (fn [res desc]
+            (is (= 1 (count res)) desc)
+            (is (= expected
+                   (-> res first
+                       (select-keys (keys expected))))
+                desc))

           "querying all, matches generated incidents, minus selected fields in each entity"
           {:full-text [{:query "*"}]}
-          (fn [res]
+          (fn [res desc]
             (let [norm (fn [data] (->> data (map #(apply dissoc % ignore-ks)) set))]
-              (= (-> bundle :incidents norm)
-                 (-> res norm))))
+              (is (= (-> bundle :incidents norm)
+                     (-> res norm))
+                  desc)))

           "using 'title' and 'source' fields + a stop word"
           {:full-text [{:query "that intrusion event 3\\:19187\\:7 incident"}]
            :fields ["title" "source"]}
-          (fn [res]
-            (and
-             (= 1 (count res))
-             (-> res first
-                 (select-keys (keys expected))
-                 (= expected))))
+          (fn [res desc]
+            (is (= 1 (count res)) desc)
+            (is (= expected
+                   (-> res first
+                       (select-keys (keys expected))))
+                desc))

           "using double-quotes at the end of the query"
           {:full-text [{:query "intrusion event 3\\:19187\\:7 incident \"\""}]
            :fields ["title" "source"]}
-          (fn [res]
-            (and
-             (= 1 (count res))
-             (-> res first
-                 (select-keys (keys expected))
-                 (= expected))))))))))
+          (fn [res desc]
+            (is (= 1 (count res)) desc)
+            (is (= expected
+                   (-> res first
+                       (select-keys (keys expected))))
+                desc))))))))

 (def enforced-fields-flag-query-params (atom nil))


All test test cases have been fixed

All test test cases have been fixed

--- core/test/clj/hellhound/system_test.clj
+++ core/test/clj/hellhound/system_test.clj
@@ -3,7 +3,8 @@
             [clojure.test :as t :refer [deftest testing is are]]
             [hellhound.component :as hcomp]
             [hellhound.system  :as system]
-            [hellhound.streams :as stream]))
+            [hellhound.streams :as stream]
+            [hellhound.utils :refer [todo]]))

 ;; System tests --------------------------------------------
@@ -93,13 +94,13 @@
             (is (stream/stream? output1))
             (is (stream/stream? output2))

+            (todo "Replace these tests with splitter tests!")
             ;; (is (= (second (first (stream/downstream input1))) output1))
             ;; (is (= (second (first (stream/downstream input2))) output2))
             ;; (is (= (second (first (stream/downstream input3))) output3))
             ;; (is (= (second (first (stream/downstream output1))) input2))
             ;; (is (= (second (first (stream/downstream output2))) input3))
-            (stream/do-async
-             (is (true? (stream/try-put! input1 10 1000))))))))
+            (is (true? @(stream/try-put! input1 10 1000)))))))

     (system/stop!)))


Add test for compare-bytes

Add test for compare-bytes

--- test/flatland/useful/io_test.clj
+++ test/flatland/useful/io_test.clj
@@ -23,3 +23,25 @@
            (do (.get buffer a 0 (alength a))
                (apply str (map char a)))))
     (close)))
+
+(deftest test-compare-bytes
+  (letfn [(bytes [& xs]
+            (byte-array (map unchecked-byte xs)))]
+    (is (neg? (compare-bytes (bytes 1 2 3)
+                             (bytes 3))))
+    (is (neg? (compare-bytes (bytes 1 2 3)
+                             (bytes 1 2 3 4))))
+    (is (zero? (compare-bytes (bytes 1 2 3)
+                              (bytes 1 2 3))))
+    (is (pos? (compare-bytes (bytes 1 2 -3)
+                             (bytes 1 2 3))))
+    (is (pos? (compare-bytes (bytes 1 2 -3)
+                             (bytes 1 2 -4))))
+    (is (neg? (compare-bytes (bytes 100)
+                             (bytes -100))))
+    (is (pos? (compare-bytes (bytes -100)
+                             (bytes 100))))
+    (is (pos? (compare-bytes (bytes -1)
+                             (bytes 0))))
+    (is (neg? (compare-bytes (bytes 0)
+                             (bytes -128))))))


Add preferred_day entries to events_test

--- test/herder/web/events_tests.clj
+++ test/herder/web/events_tests.clj
@@ -57,6 +57,7 @@
               :name "Foo"
               :convention_id con_uuid
               :preferred_slot_id nil
+              :preferred_day nil
               :event_count 1
               :event_type 1}
              (first (kc/select db/events (kc/where {:id event_uuid})))))
@@ -72,6 +73,7 @@
                      :convention_id str_con_uuid
                      :persons (-> [(str person_uuid) (str second_person)] sort vec)
                      :preferred_slot_id nil
+                     :preferred_day nil
                      :event_count 1
                      :event_type "single"}
               :status 200}
@@ -112,6 +114,7 @@
                :convention_id (str con_uuid)
                :persons []
                :preferred_slot_id nil
+               :preferred_day nil
                :event_count 1
                :event_type "single"}
               :status 200}
@@ -127,6 +130,7 @@
                      :convention_id (str con_uuid)
                      :persons [(str second_person)]
                      :preferred_slot_id nil
+                     :preferred_day nil
                      :event_count 1
                      :event_type "single"}
               :status 200}
@@ -150,6 +154,7 @@
              :name "Foo"
              :persons [(str person_uuid)]
              :preferred_slot_id nil
+             :preferred_day nil
              :event_count 1
              :event_type "single"}
             :status 200}


did you check in without running tests? Bad programmer! Bad!

--- test/midje/t_semi_sweet_test.clj
+++ test/midje/t_semi_sweet_test.clj
@@ -227,13 +227,15 @@
 			 :actual 2
 			 :actual-processor #'inc
 			 :processed-actual 3
-			 :expected '( (chatty-checker (> (inc actual) expected)) 33)} ])))
+			 :expected '( (chatty-checker (> (inc actual) expected)) 33)} ]))))
+
+(declare chatty-prerequisite)
+(defn chatty-fut [x] (chatty-prerequisite x))
+(deftest chatty-functions-can-be-used-in-fake-args
   (one-case "chatty checkers can be used in fakes"
-    (let [faked 'unimportant
-	  function-under-test (fn [x] (faked x))]
-      (expect (function-under-test 5) => "hello"
-	      (fake (faked (actual-plus-one-is-greater-than 5))) => "hello"))
-     (is (no-failures?))))
+	    (expect (chatty-fut 5) => "hello"
+		    (fake (chatty-prerequisite (actual-plus-one-is-greater-than 5)) => "hello"))
+	    (is (no-failures?))))

 (deftest fake-function-from-other-ns
@@ -267,3 +269,7 @@
 (deftest entire-trees-are-eagerly-evaluated
   (expect (lazy-seq-not-at-top-level) => '((32))
 	  (fake (testfun 1) => 32)))
+
+;; (deftest obeys-clojure-test-load-tests-var
+;;   (binding [clojure.test/*load-tests* false]
+;;     (expect (+ 1 1) => 333)))


detect hostname

detect hostname

--- frontend/src/leftover/core.cljs
+++ frontend/src/leftover/core.cljs
@@ -14,18 +14,20 @@
 (def app-state (atom {:state :loading
                       :data {}}))

+(def base-url (str "http://" (.. js/document -location -hostname) ":8000"))
+
 (go (loop []
       (let [action (<! actions)]
         (case (:type action)
           :enter-payment (swap! app-state assoc :state :enter-payment)
           :view-history (swap! app-state assoc :state :view-history)
-          :add-payment (net/POST "http://localhost:8000/conn/foo" (clj->js action)))
+          :add-payment (net/POST (str base-url "/conn/foo") (clj->js action)))
         (recur))))

 (go
   (loop []
     (util/log "getting more data")
-    (let [json (<! (net/GET "http://localhost:8000/conn/foo/baz"))
+    (let [json (<! (net/GET (str base-url "/conn/foo/bar")))
           cleaned (util/json->clj json)]
       (util/log (clj->js cleaned))
       (if (seq cleaned)


'predicate' key has been renamed to 'filter' in workflow catalog

--- core/src/cljc/hellhound/system/impl/splitter.cljc
+++ core/src/cljc/hellhound/system/impl/splitter.cljc
@@ -9,7 +9,7 @@
 (def ^:private default-node
   ;; TODO: Remove this binding and refactor the connect function
   ;;       To not use it
-  {:hellhound.workflow/predicate #(identity %)
+  {:hellhound.workflow/filter   #(identity %)
    :hellhound.workflow/map      #(identity %)})

@@ -20,7 +20,7 @@
   ;; TODO: Create a protocol for extracting data from Node.
   ;;       I don't like to extract data using keys. this
   ;;       function knows too much.
-  (let [filter-fn (or (:hellhound.workflow/predicate node)
+  (let [filter-fn (or (:hellhound.workflow/filter node)
                       #(identity %))
         map-fn (or (:hellhound.workflow/map node)
                    #(identity %))]


Use a voltage in Norwegian parrot nailed test.

--- Clojure/test/parrot_refactoring/core_test.clj
+++ Clojure/test/parrot_refactoring/core_test.clj
@@ -43,7 +43,7 @@

     (parrot/speed {:type :norwegian-blue-parrot
                    :num-coconuts 0
-                   :voltage 0.0
+                   :voltage 1.5
                    :nailed true}) => 0.0)

   (fact


cleanup

cleanup

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/ts_chart.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/ts_chart.cljs
@@ -17,11 +17,11 @@
           :on-mouse-leave #(reset! label {})}])

 (defn barchart [indexed mx cnt w]
-    (let [gap (/ (/ ts-w 20) cnt)]
-      [:svg {:width ts-w :height ts-h}
-       [:g
-         (for [[idx [k v]] indexed]
-           [bar (* idx w) ts-h (* (/ v mx) ts-h) (- w gap) idx])]]))
+  (let [gap (/ (/ ts-w 20) cnt)]
+    [:svg {:width ts-w :height ts-h}
+     [:g
+      (for [[idx [k v]] indexed]
+        ^{:key k} [bar (* idx w) ts-h (* (/ v mx) ts-h) (- w gap) idx])]]))

 (defn labels [bars mx cnt w]
   (when-not (empty? @label)


Updating docstrings

Updating docstrings

--- src/midje/parsing/3_from_lexical_maps/from_fake_maps.clj
+++ src/midje/parsing/3_from_lexical_maps/from_fake_maps.clj
@@ -17,8 +17,7 @@
     (fn [actual] (extended-= actual expected))))

 (defn mkfn:arg-matchers
-  "Based on an expected value, generates a function that returns
-  true if the actual value matches it."
+  "Generates a function that returns true if all the matchers return true for the actual args its passed."
   [matchers]
   (fn [actual-args]
     (let [arg-matchers (map mkfn:arg-matcher matchers)]
@@ -26,6 +25,7 @@
             (extended-list-= actual-args arg-matchers)))))

 (defn mkfn:arity-arg-matchers [matchers]
+  "Generates a function that returns true if all the matchers return true but it ignores arity matching."
   (fn [actual-args]
     (let [arg-matchers (map mkfn:arg-matcher matchers)]
        (extended-list-= actual-args arg-matchers))))


Add removed, added, and changed diff functions

- These functions, and the diff function itself, now take optional
  arguments following the two filesets. These arguments can be :time or
  :hash, or both. This will cause the diff to be computed with respect
  to the last modified times or md5 hashes of the files, or both. The
  default is both.

--- boot/pod/src/boot/tmpdir.clj
+++ boot/pod/src/boot/tmpdir.clj
@@ -108,9 +108,43 @@
   [x]
   (instance? TmpFileSet x))

-(defn diff [this fileset]
-  (if-not this
-    fileset
-    (let [t1 (:tree this)
-          t2 (:tree fileset)]
-      (->> (data/diff t1 t2) second keys (select-keys t2) (assoc fileset :tree)))))
+(defn- diff-tree
+  [tree props]
+  (let [->map #(-> {:hash (id %)
+                    :time (time %)}
+                   (select-keys props))]
+    (reduce-kv #(assoc %1 %2 (->map %3)) {} tree)))
+
+(defn- diff*
+  [before after props]
+  (if-not before
+    {:added   after
+     :removed (assoc after :tree {})
+     :changed (assoc after :tree {})}
+    (let [props   (or (seq props) [:time :hash])
+          t1      (:tree before)
+          t2      (:tree after)
+          d1      (diff-tree t1 props)
+          d2      (diff-tree t2 props)
+          [x y _] (map (comp set keys) (data/diff d1 d2))]
+      {:added   (->> (set/difference   y x) (select-keys t2) (assoc after :tree))
+       :removed (->> (set/difference   x y) (select-keys t1) (assoc after :tree))
+       :changed (->> (set/intersection x y) (select-keys t2) (assoc after :tree))})))
+
+(defn diff
+  [before after & props]
+  (let [{:keys [added changed]}
+        (diff* before after props)]
+    (update-in added [:tree] merge (:tree changed))))
+
+(defn removed
+  [before after & props]
+  (:removed (diff* before after props)))
+
+(defn added
+  [before after & props]
+  (:added (diff* before after props)))
+
+(defn changed
+  [before after & props]
+  (:changed (diff* before after props)))


Handle extra trigger from camera in acquisition engine. Looks for an "ExtraTriggers" property in the camera.

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -319,13 +319,41 @@
 (defn first-trigger-missing? []
   (= "1" (get-property-value (core getCameraDevice) "OutputTriggerFirstMissing")))

+(defn extra-triggers []
+  (if-let [trigger-str (get-property-value (core getCameraDevice) "ExtraTriggers")]
+    (Long/parseLong trigger-str)
+    0))
+
+(defn offset-cycle [offset coll]
+  (when coll
+    (let [n (count coll)
+          to-drop (mod (+ n offset) n)]
+      (->> (cycle coll)
+           (drop to-drop)
+           (take n)))))
+
+(defn offset-if-extra-trigger [coll]
+  (offset-cycle (- (extra-triggers)) coll))
+
+(defn compensate-for-extra-trigger [slices]
+  (when slices
+    (concat (repeat (extra-triggers) (first slices)) slices)))
+
+(defn apply-to-map-vals [f m]
+  (into {}
+        (for [[k v] m]
+          [k (f v)])))
+
 (defn init-burst [length trigger-sequence relative-z]
   (core setAutoShutter (@state :init-auto-shutter))
-  (load-property-sequences (:properties trigger-sequence))
-  (let [absolute-slices (load-slice-sequence (:slices trigger-sequence) relative-z)]
+  (load-property-sequences
+    (apply-to-map-vals offset-if-extra-trigger (:properties trigger-sequence)))
+  (let [absolute-slices (load-slice-sequence
+                          (compensate-for-extra-trigger (:slices trigger-sequence))
+                           relative-z)]
     (start-property-sequences (:properties trigger-sequence))
     (when absolute-slices
-      (start-slice-sequence (:slice trigger-sequence)))
+      (start-slice-sequence (:slices trigger-sequence)))
     (core startSequenceAcquisition (if (first-trigger-missing?) (inc length) length) 0 true)
     (swap! state assoc-in [:last-stage-positions (core getFocusDevice)]
            (last absolute-slices))))
@@ -341,7 +369,8 @@
       (if-let [image (pop-tagged-image)]
         image
         (if (< timeout-ms (- (System/currentTimeMillis) start-time))
-          (throw-exception "Timed out waiting for image\nto arrive from camera.")
+          (throw-exception (str (- (System/currentTimeMillis) start-time)
+                                " Timed out waiting for image\nto arrive from camera."))
           (do (when (core isBufferOverflowed)
                 (throw-exception "Circular buffer overflowed."))
               (Thread/sleep 1)
@@ -383,7 +412,7 @@
     m))

 (defn show [x]
-  (do (println x)
+  (do (prn x)
       x))

 (defn tag-burst-image [image burst-events camera-channel-names camera-index-tag]


fix stupid new bug that sent z stage back to zero after an acquisition

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -227,7 +227,7 @@
       (zipmap devs (repeatedly (count devs) #(agent nil))))))

 (defn get-z-stage-position [stage]
-  (when-not (empty? stage) (core getPosition stage) 0))
+  (if-not (empty? stage) (core getPosition stage) 0))

 (defn set-z-stage-position [stage pos]
   (when (core isContinuousFocusEnabled)


Add additional deps: clj-time

Add additional deps: clj-time

--- project.clj
+++ project.clj
@@ -15,7 +15,8 @@
                  [prone "0.8.0"]
                  [com.novemberain/monger "2.0.1"]
                  [lib-noir "0.9.5"]
-                 [crypto-password "0.1.3"]]
+                 [crypto-password "0.1.3"]
+                 [clj-time "0.9.0"]]
   :uberjar-name "clojournal.jar"
   :repl-options {:init-ns clojournal.repl}
   :jvm-opts ["-server"]


add senta library

add senta library

--- project.clj
+++ project.clj
@@ -28,7 +28,10 @@
                  [markdown-clj "0.9.54"]
                  [cljs-http "0.1.16"]
                  [om "0.7.3"]
-                 [http-kit "2.1.19"]]
+                 [http-kit "2.1.19"]
+
+                 ;; Both CLJ and CLJS
+                 [com.taoensso/sente "1.2.0"]]

   :profiles {:dev {:dependencies [[com.h2database/h2 "1.4.181"]
                                   [net.mikera/cljunit "0.3.1"]]


exclude prismatic/schema from pedestal-api and explicitly depend on a newer version

--- project.clj
+++ project.clj
@@ -3,7 +3,8 @@
   :min-lein-version  "2.4.0" ;; due to lein-immutant
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [ephemeris "0.0.1"]
-                 [pedestal-api "0.3.1"]
+                 [prismatic/schema "1.1.4"]
+                 [pedestal-api "0.3.1" :exclusions [prismatic/schema]]
                  [io.pedestal/pedestal.service "0.5.2"]
                  [io.pedestal/pedestal.jetty "0.5.2"] ;; for dev
                  [io.pedestal/pedestal.immutant "0.5.2"] ;; for prod


Updated to line up with https://github.com/lambdalf/lein-amp/issues/9

--- project.clj
+++ project.clj
@@ -17,7 +17,10 @@
 ;    Carlo Sciolla - initial implementation
 ;    Peter Monks   - contributor

-(def alfresco-version "5.0.a")
+; Make sure these line up to those provided in the specified Alfresco version or weird things can happen...
+(def alfresco-version    "5.0.a")
+(def spring-version      "3.0.5.RELEASE")
+(def spring-surf-version "1.2.0")

 (defproject org.clojars.lambdalf/lambdalf "2.0.0-SNAPSHOT"
   :title            "lambdalf"
@@ -30,31 +33,29 @@
                   ["alfresco.public" "https://artifacts.alfresco.com/nexus/content/groups/public/"]
                 ]
   :dependencies [
+                  ; Dependencies that will be included in the AMP - other dependencies should go in the appropriate profile below
                   [org.clojure/clojure     "1.6.0"]
                   [org.clojure/tools.nrepl "0.2.4"]
-                  ; WARNING: do _not_ add test, provided or runtime dependencies here as they will be included in the uberjar,
-                  ; regardless of scope.  See https://github.com/technomancy/leiningen/issues/741 for an explanation of why
-                  ; this occurs.
                 ]
-  :profiles {:dev      { :plugins [[lein-amp "0.3.0"]] }
-             :uberjar  { :aot :all }
+  :profiles {:dev      { :plugins [[lein-amp "0.4.0-SNAPSHOT"]] }
              :test     { :dependencies [
-                                         [clj-http                       "0.9.2"           :scope "test"]
-                                         [tk.skuro.alfresco/h2-support   "1.6"             :scope "test"]
-                                         [com.h2database/h2              "1.3.174"         :scope "test"]
-                                         [org.eclipse.jetty/jetty-runner "9.2.1.v20140609" :scope "test"]
+                                         [clj-http                       "1.0.0"]
+                                         [tk.skuro.alfresco/h2-support   "1.6"]
+                                         [com.h2database/h2              "1.4.181"]
+                                         [org.eclipse.jetty/jetty-runner "9.2.2.v20140723" :exclusions [org.eclipse.jetty/jetty-jsp]]
                                        ] }
              :provided { :dependencies [
-                                         [org.alfresco/alfresco-core                            ~alfresco-version :scope "provided"]
-                                         [org.alfresco/alfresco-data-model                      ~alfresco-version :scope "provided"]
-                                         [org.alfresco/alfresco-mbeans                          ~alfresco-version :scope "provided"]
-                                         [org.alfresco/alfresco-remote-api                      ~alfresco-version :scope "provided"]
-                                         [org.alfresco/alfresco-repository                      ~alfresco-version :scope "provided"]
-                                         [org.springframework/spring-context                    "3.0.5.RELEASE"  :scope "provided"]
-                                         [org.springframework/spring-beans                      "3.0.5.RELEASE"  :scope "provided"]
-                                         [org.springframework.extensions.surf/spring-webscripts "1.2.0"          :scope "provided"]
+                                         [org.alfresco/alfresco-core                            ~alfresco-version]
+                                         [org.alfresco/alfresco-data-model                      ~alfresco-version]
+                                         [org.alfresco/alfresco-mbeans                          ~alfresco-version]
+                                         [org.alfresco/alfresco-remote-api                      ~alfresco-version]
+                                         [org.alfresco/alfresco-repository                      ~alfresco-version]
+                                         [org.springframework/spring-context                    ~spring-version]
+                                         [org.springframework/spring-beans                      ~spring-version]
+                                         [org.springframework.extensions.surf/spring-webscripts ~spring-surf-version]
                                        ] }
             }
+  :aot               [alfresco]
   :source-paths      ["src/clojure"]
   :java-source-paths ["src/java"]
   :resource-paths    ["src/resource"]