Remove unused code, adjust some comments and move smart constructors closer to records.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -14,20 +14,15 @@
   `(and (not= ~ocr ::match/not-found) (re-matches ~(:regex pat) ~ocr)))

 (define-record-type Pattern
-  (make-pattern name clauses) pattern?
-  [name pattern-name
-   clauses pattern-clauses])
+  (make-pattern clauses) pattern?
+  [clauses pattern-clauses])

 (defn pattern
   "Takes a name and some `clauses` and returns a [[Pattern]]."
   [& clauses]
-  (make-pattern (str (gensym "pattern-")) clauses))
-
-(defn named-pattern
-  [pattern the-name]
-  (lens/shove pattern pattern-name the-name))
-
-;;    We differentiate between three kinds of matchers:
+  (make-pattern clauses))
+
+;; We differentiate between three kinds of matchers:
 ;; 1. Constant: Match on exactly one value. The value must be equatable.
 ;; 2. Regex: Match on a regex. The value must be a String.
 ;; 3. Existence: Match on the existence. That is, not nil.
@@ -68,7 +63,6 @@
   OptionsMatcher
   (make-options-matcher options)
   options-matcher?
-  ;; TODO Perhaps this should allow for matchers recursively?
   [options options-matcher-options])

 (defn match-options
@@ -101,7 +95,9 @@
     (or (options-matcher? matcher) (existence-matcher? matcher) (predicate-matcher? matcher))
     nil))

-;;    There are four kinds of clauses
+(def path? "Is something a valid path?" (some-fn list? vector?))
+
+;; There are different kinds of clauses
 ;; 1. Assert the existence of a value in a map for a key.
 ;;    - without binding - with binding
 ;;    - optional:  without binding - with binding
@@ -122,6 +118,11 @@
   key-exists-without-binding-clause?
   [key key-exists-without-binding-clause-key])

+(defn key-exists-without-binding-clause
+  "Returns a clause that asserts the existence of a non-nil value at `key`."
+  [key]
+  (make-key-exists-without-binding-clause key))
+
 (define-record-type KeyExistsWithBindingClause
   ^{:doc "A clause that asserts the existence of a non-nil value in a map at the `key`. When evaluated, binds it's result to `binding`."}
   (make-key-exists-with-binding-clause key binding)
@@ -129,11 +130,21 @@
   [key key-exists-with-binding-clause-key
    binding key-exists-with-binding-clause-binding])

+(defn key-exists-with-binding-clause
+  "Returns a clause that asserts the existence of a non-nil value at `key`."
+  [key binding]
+  (make-key-exists-with-binding-clause key binding))
+
 (define-record-type OptionalKeyExistsWithoutBindingClause
   ^{:doc "An optional clause that asserts the existence of a non-nil value in a map at the `key`."}
   (make-optional-key-exists-without-binding-clause key)
   optional-key-exists-without-binding-clause?
   [key optional-key-exists-without-binding-clause-key])
+
+(defn optional-key-exists-without-binding-clause
+  "Returns an optional clause that asserts the existence of a non-nil value at `key`."
+  [key]
+  (make-optional-key-exists-without-binding-clause key))

 (define-record-type OptionalKeyExistsWithBindingClause
   ^{:doc "An optional clause that asserts the existence of a non-nil value in a map at the `key`. When evaluated, binds it's result to `binding`."}
@@ -142,116 +153,79 @@
   [key optional-key-exists-with-binding-clause-key
    binding optional-key-exists-with-binding-clause-binding])

-(defn key-exists-without-binding-clause
-  "Returns a clause that asserts the existence of a non-nil value at `key`."
-  [key]
-  (make-key-exists-without-binding-clause key))
-
-(defn key-exists-with-binding-clause
-  "Returns a clause that asserts the existence of a non-nil value at `key`."
-  [key bind]
-  (make-key-exists-with-binding-clause key bind))
-
-(defn optional-key-exists-without-binding-clause
-  "Returns an optional clause that asserts the existence of a non-nil value at `key`."
-  [key]
-  (make-optional-key-exists-without-binding-clause key))
-
 (defn optional-key-exists-with-binding-clause
   "Returns an optional clause that asserts the existence of a non-nil value at `key`."
   [key bind]
   (make-optional-key-exists-with-binding-clause key bind))

 ;; 2.
-(define-record-type
+(define-record-type PathExistsWithoutBindingClause
   ^{:doc "A clause that asserts the existence of a non-nil value in a map at the `path`."}
-  PathExistsWithoutBindingClause
   (make-path-exists-without-binding-clause path)
   path-exists-without-binding-clause?
   [path path-exists-without-binding-clause-path])

-(define-record-type
+(defn path-exists-without-binding-clause
+  "Returns a clause that asserts the existence of a non-nil value at `key`."
+  [path]
+  (make-path-exists-without-binding-clause path))
+
+(define-record-type PathExistsWithBindingClause
   ^{:doc "A clause that asserts the existence of a non-nil value in a map at the `path`. When evaluated, binds it's result to `binding`."}
-  PathExistsWithBindingClause
   (make-path-exists-with-binding-clause path binding)
   path-exists-with-binding-clause?
   [path path-exists-with-binding-clause-path
    binding path-exists-with-binding-clause-binding])

-(define-record-type
+(defn path-exists-with-binding-clause
+  "Returns a clause that asserts the existence of a non-nil value at `key`."
+  [path bind]
+  (make-path-exists-with-binding-clause path bind))
+
+(define-record-type OptionalPathExistsWithoutBindingClause
   ^{:doc "An optional clause that asserts the existence of a non-nil value in a map at the `path`."}
-  OptionalPathExistsWithoutBindingClause
   (make-optional-path-exists-without-binding-clause path)
   optional-path-exists-without-binding-clause?
   [path optional-path-exists-without-binding-clause-path])

-(define-record-type
+(defn optional-path-exists-without-binding-clause
+  "Returns an optional clause that asserts the existence of a non-nil value at `key`."
+  [path]
+  (make-optional-path-exists-without-binding-clause path))
+
+(define-record-type OptionalPathExistsWithBindingClause
   ^{:doc "An optional clause that asserts the existence of a non-nil value in a map at the `path`. When evaluated, binds it's result to `binding`."}
-  OptionalPathExistsWithBindingClause
   (make-optional-path-exists-with-binding-clause path binding)
   optional-path-exists-with-binding-clause?
   [path optional-path-exists-with-binding-clause-path
    binding optional-path-exists-with-binding-clause-binding])

-(defn path-exists-without-binding-clause
-  "Returns a clause that asserts the existence of a non-nil value at `key`."
-  [path]
-  (make-path-exists-without-binding-clause path))
-
-(defn path-exists-with-binding-clause
-  "Returns a clause that asserts the existence of a non-nil value at `key`."
-  [path bind]
-  (make-path-exists-with-binding-clause path bind))
-
-(defn optional-path-exists-without-binding-clause
-  "Returns an optional clause that asserts the existence of a non-nil value at `key`."
-  [path]
-  (make-optional-path-exists-without-binding-clause path))
-
 (defn optional-path-exists-with-binding-clause
   "Returns an optional clause that asserts the existence of a non-nil value at `key`."
   [path bind]
   (make-optional-path-exists-with-binding-clause path bind))

 ;; 3.
-(define-record-type
+(define-record-type KeyMatchesWithoutBindingClause
   ^{:doc "A clause that matches the value of `key` of a map using `matcher`."}
-  KeyMatchesWithoutBindingClause
   (make-key-matches-without-binding-clause key matcher)
   key-matches-without-binding-clause?
   [key key-matches-without-binding-clause-key
    matcher key-matches-without-binding-clause-matcher])

-(define-record-type
+(defn key-matches-without-binding-clause
+  "Returns a clause that matches a `key` with a certain `matcher`."
+  [key matcher]
+  {:pre [(matcher? matcher)]}
+  (make-key-matches-without-binding-clause key matcher))
+
+(define-record-type KeyMatchesWithBindingClause
   ^{:doc "A clause that matches the value of `key` of a map using `matcher`. When evaluated, binds it's result to `binding`."}
-  KeyMatchesWithBindingClause
   (make-key-matches-with-binding-clause key matcher binding)
   key-matches-with-binding-clause?
   [key key-matches-with-binding-clause-key
    matcher key-matches-with-binding-clause-matcher
    binding key-matches-with-binding-clause-binding])
-
-(define-record-type
-  ^{:doc "An optional clause that matches the value of `key`."}
-  OptionalKeyMatchesWithoutBindingClause
-  (make-optional-key-matches-without-binding-clause key)
-  optional-key-matches-without-binding-clause?
-  [key optional-key-matches-without-binding-clause-key])
-
-(define-record-type
-  ^{:doc "An optional clause with a default value for `key`. When evaluated, binds it's result to `binding`. If `key` does not exist, binds to `default-value`."}
-  OptionalKeyWithDefaultBindingClause
-  (make-optional-key-with-default-binding-clause key default-value binding)
-  optional-key-with-default-binding-clause?
-  [key optional-key-with-default-binding-clause-key
-   default-value optional-key-with-default-binding-clause-default-value
-   binding optional-key-with-default-binding-clause])
-
-(defn key-matches-without-binding-clause
-  "Returns a clause that matches a `key` with a certain `matcher`."
-  [key matcher]
-  {:pre [(matcher? matcher)]}
-  (make-key-matches-without-binding-clause key matcher))

 (defn key-matches-with-binding-clause
   "Returns a clause that matches a `key` with a certain `matcher`, binding the
@@ -260,10 +234,24 @@
   {:pre [(matcher? matcher)]}
   (make-key-matches-with-binding-clause key matcher bind))

-(defn optional-key-matches-without-binding-clause
+(define-record-type OptionalKeyMatchesWithoutBindingClause
+  ^{:doc "An optional clause that matches the value of `key`."}
+  (make-optional-key-without-binding-clause key)
+  optional-key-without-binding-clause?
+  [key optional-key-without-binding-clause-key])
+
+(defn optional-key-without-binding-clause
   "Returns an optional clause that matches a `key` with a certain `matcher`."
   [key]
-  (make-optional-key-matches-without-binding-clause key))
+  (make-optional-key-without-binding-clause key))
+
+(define-record-type OptionalKeyWithDefaultBindingClause
+  ^{:doc "An optional clause with a default value for `key`. When evaluated, binds it's result to `binding`. If `key` does not exist, binds to `default-value`."}
+  (make-optional-key-with-default-binding-clause key default-value binding)
+  optional-key-with-default-binding-clause?
+  [key optional-key-with-default-binding-clause-key
+   default-value optional-key-with-default-binding-clause-default-value
+   binding optional-key-with-default-binding-clause])

 (defn optional-key-with-default-binding-clause
   "Returns an optional clause that matches a `key`, binding the
@@ -272,77 +260,77 @@
   (make-optional-key-with-default-binding-clause key default-value bind))

 ;; 4.
-(define-record-type
+(define-record-type PathMatchesWithoutBindingClause
   ^{:doc "A clause that matches the value of a map at the `path` using a `matcher`."}
-  PathMatchesWithoutBindingClause
   (make-path-matches-without-binding-clause path matcher)
   path-matches-without-binding-clause?
   [path path-matches-without-binding-clause-path
    matcher path-matches-without-binding-clause-matcher])

-(define-record-type
+(defn path-matches-without-binding-clause
+  [path matcher]
+  {:pre [(and (path? path) (matcher? matcher))]}
+  (make-path-matches-without-binding-clause path matcher))
+
+(define-record-type PathMatchesWithBindingClause
   ^{:doc "A clause that matches the value of a map at the `path` using a `matcher`. When evaluated, binds it's result to `binding`."}
-  PathMatchesWithBindingClause
   (make-path-matches-with-binding-clause path matcher binding)
   path-matches-with-binding-clause?
   [path path-matches-with-binding-clause-path
    matcher path-matches-with-binding-clause-matcher
    binding path-matches-with-binding-clause-binding])

-(define-record-type
+(defn path-matches-with-binding-clause
+  [path matcher bind]
+  {:pre [(and (path? path) (matcher? matcher))]}
+  (make-path-matches-with-binding-clause path matcher bind))
+
+(define-record-type OptionalPathMatchesWithoutBindingClause
   ^{:doc "An optional clause that matches the value of a map at the `path` using a `matcher`."}
-  OptionalPathMatchesWithoutBindingClause
-  (make-optional-path-matches-without-binding-clause path)
-  optional-path-matches-without-binding-clause?
-  [path optional-path-matches-without-binding-clause-path])
-
-(define-record-type
+  (make-optional-path-without-binding-clause path)
+  optional-path-without-binding-clause?
+  [path optional-path-without-binding-clause-path])
+
+(defn optional-path-without-binding-clause
+  [path]
+  {:pre [(path? path)]}
+  (make-optional-path-without-binding-clause path))
+
+(define-record-type OptionalPathWithDefaultBindingClause
   ^{:doc "An optional clause with a default value at the `path`. When evaluated, binds it's result to `binding`. If `path` does not exist, binds to `default-value`."}
-  OptionalPathWithDefaultBindingClause
   (make-optional-path-with-default-binding-clause path default-value binding)
   optional-path-with-default-binding-clause?
   [path optional-path-with-default-binding-clause-path
    default-value optional-path-with-default-binding-clause-default-value
    binding optional-path-with-default-binding-clause-binding])

-(def path? "Is something a valid path?" (some-fn list? vector?))
-
-(defn path-matches-without-binding-clause
-  [path matcher]
-  {:pre [(and (path? path) (matcher? matcher))]}
-  (make-path-matches-without-binding-clause path matcher))
-
-(defn path-matches-with-binding-clause
-  [path matcher bind]
-  {:pre [(and (path? path) (matcher? matcher))]}
-  (make-path-matches-with-binding-clause path matcher bind))
-
-(defn optional-path-matches-without-binding-clause
-  [path]
-  {:pre [(path? path)]}
-  (make-optional-path-matches-without-binding-clause path))
-
 (defn optional-path-with-default-binding-clause
   [path default-value bind]
   {:pre [(path? path)]}
   (make-optional-path-with-default-binding-clause path default-value bind))

-(def clause? (some-fn key-exists-without-binding-clause?
-                      key-exists-with-binding-clause?
-                      optional-key-exists-without-binding-clause?
-                      optional-key-exists-with-binding-clause?
-                      path-exists-without-binding-clause?
-                      path-exists-with-binding-clause?
-                      optional-path-exists-without-binding-clause?
-                      optional-path-exists-with-binding-clause?
-                      key-matches-without-binding-clause?
-                      key-matches-with-binding-clause?
-                      optional-key-matches-without-binding-clause?
-                      optional-key-with-default-binding-clause?
-                      path-matches-without-binding-clause?
-                      path-matches-with-binding-clause?
-                      optional-path-matches-without-binding-clause?
-                      optional-path-with-default-binding-clause?))
+;; Predicates for clauses
+(def mandatory-clause?
+  (some-fn key-exists-without-binding-clause?
+           key-exists-with-binding-clause?
+           path-exists-without-binding-clause?
+           path-exists-with-binding-clause?
+           key-matches-without-binding-clause?
+           key-matches-with-binding-clause?
+           path-matches-without-binding-clause?
+           path-matches-with-binding-clause?))
+
+(def optional-clause?
+  (some-fn optional-key-exists-without-binding-clause?
+           optional-key-exists-with-binding-clause?
+           optional-path-exists-without-binding-clause?
+           optional-path-exists-with-binding-clause?
+           optional-key-without-binding-clause?
+           optional-key-with-default-binding-clause?
+           optional-path-without-binding-clause?
+           optional-path-with-default-binding-clause?))
+
+(def clause? (some-fn mandatory-clause? optional-clause?))

 ;;;; Parse
 ;; Translate pattern expressions for `active.clojure.match` to clauses
@@ -381,6 +369,7 @@

 (s/def ::qmark #{'?})

+;; FIXME: represent optionals as full-fledged terminal symbols in this grammar
 (s/def ::key-exists-without-binding
   (s/or :required (s/or :flat ::key
                         :list (s/cat :key ::key))
@@ -500,7 +489,7 @@
           :key-matches-without-binding
           (let [k (make-key (:key body))]
             (if (optional? mode)
-              `(optional-key-matches-without-binding-clause ~k)
+              `(optional-key-without-binding-clause ~k)
               `(key-matches-without-binding-clause ~k (match-value->matcher ~(:match-value body)))))

           :key-matches-with-binding
@@ -513,7 +502,7 @@
           :path-matches-without-binding
           (let [path (mapv make-key (:path body))]
             (if (optional? mode)
-              `(optional-path-matches-without-binding-clause ~path)
+              `(optional-path-without-binding-clause ~path)
               `(path-matches-without-binding-clause ~path (match-value->matcher ~(:match-value body)))))

           :path-matches-with-binding
@@ -674,12 +663,10 @@
         ~rhs)]))

 (defmacro parse-pattern
-  "Parse the argument to `defpattern` as a [[Pattern]].
-  Optionally accepts a `name` (String) that names the pattern. If none is
-  provided, automatically assigns a name."
+  "Parse the argument to `defpattern` as a [[Pattern]]."
   [pattern]
   (if (vector? pattern)
-    `(make-pattern ~(str (gensym "pattern-")) (parse-clauses ~pattern))
+    `(make-pattern (parse-clauses ~pattern))
     pattern))

 ;; Match
@@ -810,7 +797,7 @@
         `({~key ~'_} :guard ~(match-value message [key]))
         `{~key ~(match-value message [key])}))

-    (optional-key-matches-without-binding-clause? clause)
+    (optional-key-without-binding-clause? clause)
     {}

     (optional-key-with-default-binding-clause? clause)
@@ -832,12 +819,11 @@
         `(~(fold-path path '_) :guard ~(match-value message path))
         (fold-path path (match-value message path))))

-    (optional-path-matches-without-binding-clause? clause)
+    (optional-path-without-binding-clause? clause)
     {}

     (optional-path-with-default-binding-clause? clause)
     {}))
-

 (defn reduce-lhs
   [lhss]
@@ -864,7 +850,6 @@
           {}
           lhss))

-
 (defn pattern->lhs
   [message pattern]
   (->> pattern
@@ -905,7 +890,7 @@
     (key-matches-with-binding-clause? clause)
     (conj bindings (key-matches-with-binding-clause->rhs-match message clause))

-    (optional-key-matches-without-binding-clause? clause)
+    (optional-key-without-binding-clause? clause)
     (conj bindings `[])

     (optional-key-with-default-binding-clause? clause)
@@ -917,7 +902,7 @@
     (path-matches-with-binding-clause? clause)
     (conj bindings (path-matches-with-binding-clause->rhs-match message clause))

-    (optional-path-matches-without-binding-clause? clause)
+    (optional-path-without-binding-clause? clause)
     (conj bindings `[])

     (optional-path-with-default-binding-clause? clause)


DSDEEPB-2226: Full filtering on method table

--- src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
@@ -253,9 +253,11 @@
       :else
       [table/Table
        {:columns [{:header "Type" :starting-width 100}
-                  {:header "Item" :starting-width 450 :as-text #(% "name")
+                  {:header "Item" :starting-width 450
                    :sort-by (fn [m]
                               [(m "namespace") (m "name") (int (m "snapshotId"))])
+                   :filter-by (fn [m]
+                                (clojure.string/join "/" (map #(m %) ["namespace" "name" "snapshotId"])))
                    :sort-initial :asc
                    :content-renderer
                    (fn [item]


Fix tests

Fix tests

Now that archiving doesn't require the flags column

--- test/mdr2/test/archive.clj
+++ test/mdr2/test/archive.clj
@@ -46,8 +46,7 @@
              :aktion "save",
              :transaktions_status "pending",
              :abholer "NN",
-             :archivar "NN",
-             :flags "x"}]))))
+             :archivar "NN"}]))))

 (deftest add-iso-to-db
   (testing "add iso to db"
@@ -61,8 +60,7 @@
              :aktion "save",
              :transaktions_status "pending",
              :abholer "NN",
-             :archivar "NN",
-             :flags "x"}]))))
+             :archivar "NN"}]))))

 (deftest book-single
   (testing "archiving a book with a single volume"
@@ -78,15 +76,13 @@
                         :transaktions_status "pending"
                         :abholer "NN"
                         :archivar "NN"
-                        :verzeichnis "dam14"
-                        :flags "x"}
+                        :verzeichnis "dam14"}
                        {:verzeichnis "ds15"
                         :sektion "cdimage"
                         :aktion "save"
                         :transaktions_status "pending"
                         :abholer "NN"
-                        :archivar "NN"
-                        :flags "x"}]))
+                        :archivar "NN"}]))
       (are [file] (fs/exists? file)
            ;; check if the master has been copied
            (fs/file spool-dir dam-number "produkt" "aud001.wav")
@@ -112,15 +108,13 @@
                         :transaktions_status "pending"
                         :abholer "NN"
                         :archivar "NN"
-                        :verzeichnis "dam14"
-                        :flags "x"}
+                        :verzeichnis "dam14"}
                        {:verzeichnis "ds15"
                         :sektion "cdimage"
                         :aktion "save"
                         :transaktions_status "pending"
                         :abholer "NN"
-                        :archivar "NN"
-                        :flags "x"}]))
+                        :archivar "NN"}]))
       (are [file] (fs/exists? file)
            ;; check if the master has been copied
            (fs/file spool-dir dam-number "produkt" "aud001.wav")


Minor test cleanup.

Minor test cleanup.

--- test/onyx/log/log_test.clj
+++ test/onyx/log/log_test.clj
@@ -16,48 +16,42 @@

 (def peer-config (assoc (:peer-config config) :onyx/id onyx-id))

-(def env (onyx.api/start-env env-config))
-
 (def scheduler :onyx.job-scheduler/balanced)

-(try
-  (extensions/write-chunk (:log env) :job-scheduler {:job-scheduler scheduler} nil)
-  (extensions/write-chunk (:log env) :messaging {:onyx.messaging/impl :dummy-messaging} nil)
+(let [env (onyx.api/start-env env-config)]
+  (try
+    (extensions/write-chunk (:log env) :job-scheduler {:job-scheduler scheduler} nil)
+    (extensions/write-chunk (:log env) :messaging {:onyx.messaging/impl :dummy-messaging} nil)

-  (facts
-    "We can write to the log and read the entries back out"
-    (doseq [n (range 10)]
-      (extensions/write-log-entry (:log env) {:n n}))
+    (facts
+      "We can write to the log and read the entries back out"
+      (doseq [n (range 10)]
+        (extensions/write-log-entry (:log env) {:n n}))

-    (fact (count (map (fn [n] (extensions/read-log-entry (:log env) n)) (range 10))) => 10))
-  (finally
-    (onyx.api/shutdown-env env)))
+      (fact (count (map (fn [n] (extensions/read-log-entry (:log env) n)) (range 10))) => 10))
+    (finally
+      (onyx.api/shutdown-env env))))

+(let [env (onyx.api/start-env env-config)
+      entries 10000
+      ch (chan entries)]
+  (try
+    (extensions/write-chunk (:log env) :job-scheduler {:job-scheduler scheduler} nil)
+    (extensions/write-chunk (:log env) :messaging {:onyx.messaging/impl :dummy-messaging} nil)

-(def env (onyx.api/start-env env-config))
+    (extensions/subscribe-to-log (:log env) ch)

-(try
-  (extensions/write-chunk (:log env) :job-scheduler {:job-scheduler scheduler} nil)
-  (extensions/write-chunk (:log env) :messaging {:onyx.messaging/impl :dummy-messaging} nil)
+    (future
+      (try
+        (doseq [n (range entries)]
+          (extensions/write-log-entry (:log env) {:n n}))
+        (catch Exception e
+          (.printStackTrace e))))

-  (def entries 10000)
-
-  (def ch (chan entries))
-
-  (extensions/subscribe-to-log (:log env) ch)
-
-  (future
-    (try
-      (doseq [n (range entries)]
-        (extensions/write-log-entry (:log env) {:n n}))
-      (catch Exception e
-        (.printStackTrace e))))
-
-  (facts
-    "We can asynchronously write log entries and read them back in order"
-    (fact (count (map (fn [n] (<!! ch) (extensions/read-log-entry (:log env) n))
-                      (range entries)))
-          => entries))
-  (finally
-    (onyx.api/shutdown-env env)))
-
+    (facts
+      "We can asynchronously write log entries and read them back in order"
+      (fact (count (map (fn [n] (<!! ch) (extensions/read-log-entry (:log env) n))
+                        (range entries)))
+            => entries))
+    (finally
+      (onyx.api/shutdown-env env))))


Let the implementation of Uwes algorithm use minimum-set-covers

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

--- src/conexp/contrib/experimental/ryssel_algorithm.clj
+++ src/conexp/contrib/experimental/ryssel_algorithm.clj
@@ -12,65 +12,6 @@
         conexp.fca.implications))

 (ns-doc "An implementation of Ryssels Algorithm")
-
-;;; Searching for minimum covers
-
-(defn- covers? [sets base-set]
-  (if (empty? base-set)
-    true
-    (loop [rest (transient base-set),
-           sets sets]
-      (if-not sets
-        false
-        (let [new-rest (reduce disj! rest (first sets))]
-          (if (zero? (count new-rest))
-            true
-            (recur new-rest (next sets))))))))
-
-(defn- redundant? [base-set cover count]
-  (exists [set cover]
-    (forall [x set]
-      (=> (contains? base-set x)
-          (<= 2 (get count x))))))
-
-(defn- minimum-covers [base-set sets]
-  (let [result  (atom []),
-        search  (fn search [rest-base-set current-cover cover-count sets]
-                  (cond
-                   (redundant? base-set current-cover cover-count)
-                   nil,
-
-                   (empty? rest-base-set)
-                   (swap! result conj current-cover),
-
-                   (empty? sets)
-                   nil,
-
-                   :else
-                   (when (covers? sets rest-base-set)
-                     (let [counts (map-by-fn #(count (intersection rest-base-set %))
-                                             sets),
-                           sets   (sort #(>= (counts %1) (counts %2))
-                                        sets)],
-                       (search (difference rest-base-set (first sets))
-                               (conj current-cover (first sets))
-                               (reduce! (fn [map x]
-                                          (if (contains? base-set x)
-                                            (assoc! map x (inc (get map x)))
-                                            map))
-                                        cover-count
-                                        (first sets))
-                               (rest sets))
-                       (search rest-base-set
-                               current-cover
-                               cover-count
-                               (rest sets))))))]
-    (search base-set
-            #{}
-            (map-by-fn (constantly 0) base-set)
-            sets)
-    @result))
-

 ;;; Collapsing implications with equal premise

@@ -87,8 +28,9 @@
 ;;; The actual algorithm

 (defn- cover [base-set candidates A]
-  (let [object-covers (minimum-covers (difference base-set A)
-                                      (set-of (difference base-set N) | N candidates))]
+  (let [object-covers (minimum-set-covers
+                       (difference base-set A)
+                       (set-of (difference base-set N) | N candidates))]
     (map (fn [cover]
            (map #(difference base-set %) cover))
          object-covers)))


Documentation tweaks.

Documentation tweaks.

--- web/src/immutant/web/async.clj
+++ web/src/immutant/web/async.clj
@@ -18,15 +18,15 @@
   (:import [org.projectodd.wunderboss.web.async Channel$OnComplete HttpChannel]
            [org.projectodd.wunderboss.web.async.websocket WebsocketChannel]))

-(defn ^:internal streaming-body? [body]
+(defn ^:internal ^:no-doc streaming-body? [body]
   (instance? HttpChannel body))

-(defn ^:internal open-stream [^HttpChannel channel headers]
+(defn ^:internal ^:no-doc open-stream [^HttpChannel channel headers]
   (.notifyOpen channel nil))

-(defmulti ^:internal initialize-stream :handler-type)
+(defmulti ^:internal ^:no-doc initialize-stream :handler-type)

-(defmulti ^:internal initialize-websocket :handler-type)
+(defmulti ^:internal ^:no-doc initialize-websocket :handler-type)

 (defprotocol WebsocketHandshake
   "Reflects the state of the initial websocket upgrade request"
@@ -49,7 +49,7 @@
   (handshake [ch]
     "Returns a [[WebsocketHandshake]] for `ch` if `ch` is a WebSocket channel.")
   (send* [ch message close? on-complete]
-    "See [[send!]]."))
+    "Implementation detail. See [[send!]]."))

 (defn send!
   "Send a message to the channel, asynchronously.


Connect websocket on port 80.

Connect websocket on port 80.

--- client/src/client/core.cljs
+++ client/src/client/core.cljs
@@ -36,7 +36,7 @@

 (defn connect [owner]
   (go
-    (let [addr (str "ws://" (.-hostname js/location) ":8080/ws/owner/" (js/encodeURI owner))
+    (let [addr (str "ws://" (.-hostname js/location) ":80/ws/owner/" (js/encodeURI owner))
           {:keys [ws-channel error]} (<! (ws-ch addr {:format :json}))]
       (if error
         (print error)


adhere to the spec

adhere to the spec

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/runtime/core.cljs
+++ src/aurora/runtime/core.cljs
@@ -204,7 +204,8 @@
                                          (> {:name "todo-editing" :id ent} {:editing? "true"}))

                                    (rule {:name :ui/onBlur :entity ent}
-                                         {:name "todo-editing" :id ent :editing? "true"}
+                                         {:name :todo/edit-text :value v}
+                                         (> {:name "todo" :id ent} {:text v})
                                          (> {:name "todo-editing" :id ent} {:editing? "false"}))

                                    (rule {:name :ui/onChange :id "todo-editor" :value v}
@@ -246,9 +247,8 @@
                                          ^editing {:name "todo-editing" :id id}
                                          (- todo)
                                          (- done)
-                                         (- editing))
-
-                                   ]
+                                         (- editing))]
+
                       :rules [[(rule {:name "todo" :id id}
                                      {:name :todo/filter :value "all"}
                                      (+ {:name :todo/displayed :id id}))


Tests for both internal and external connections [IMMUTANT-479]

--- modules/transactions/src/test/clojure/wunderboss/transactions_test.clj
+++ modules/transactions/src/test/clojure/wunderboss/transactions_test.clj
@@ -18,7 +18,7 @@
            [org.projectodd.wunderboss.caching Caching Caching$CreateOption]
            [org.projectodd.wunderboss.transactions Transaction]
            [org.projectodd.wunderboss.codecs Codecs None]
-           [org.projectodd.wunderboss.messaging Messaging
+           [org.projectodd.wunderboss.messaging Messaging Connection
             Destination$ReceiveOption Destination$MessageOpOption
             Messaging$CreateConnectionOption Messaging$CreateQueueOption]))

@@ -37,23 +37,43 @@
 ;;; Clear cache before each test
 (use-fixtures :each (fn [f] (.clear cache) (f)))

-(defn attempt-transaction [& [f]]
+(defn attempt-transaction-external [& [f]]
   (try
     (with-open [conn (.createConnection msg (Options. {Messaging$CreateConnectionOption/XA true}))]
       (.required tx
         (fn []
           (.send queue "kiwi" None/INSTANCE (Options. {Destination$MessageOpOption/CONNECTION conn}))
           (.put cache :a 1)
-          (if f (f))  )))
+          (if f (f)))))
     (catch Exception e
       (-> e .getCause .getMessage))))

-(deftest verify-transaction-success
-  (is (nil? (attempt-transaction)))
+(defn attempt-transaction-internal [& [f]]
+  (try
+    (.required tx
+      (fn []
+        (.send queue "kiwi" None/INSTANCE (Options. {Destination$MessageOpOption/CONNECTION Connection/XA}))
+        (.put cache :a 1)
+        (if f (f))))
+    (catch Exception e
+      (-> e .getCause .getMessage))))
+
+(deftest verify-transaction-success-external
+  (is (nil? (attempt-transaction-external)))
   (is (= "kiwi" (.body (.receive queue codecs (Options. {Destination$ReceiveOption/TIMEOUT 1000})))))
   (is (= 1 (:a cache))))

-(deftest verify-transaction-failure
-  (is (= "force rollback" (attempt-transaction #(throw (Exception. "force rollback")))))
+(deftest verify-transaction-failure-external
+  (is (= "force rollback" (attempt-transaction-external #(throw (Exception. "force rollback")))))
   (is (nil? (.receive queue codecs (Options. {Destination$ReceiveOption/TIMEOUT 1000}))))
   (is (nil? (:a cache))))
+
+(deftest verify-transaction-success-internal
+  (is (nil? (attempt-transaction-internal)))
+  (is (= "kiwi" (.body (.receive queue codecs (Options. {Destination$ReceiveOption/TIMEOUT 1000})))))
+  (is (= 1 (:a cache))))
+
+(deftest verify-transaction-failure-internal
+  (is (= "force rollback" (attempt-transaction-internal #(throw (Exception. "force rollback")))))
+  (is (nil? (.receive queue codecs (Options. {Destination$ReceiveOption/TIMEOUT 1000}))))
+  (is (nil? (:a cache))))


needs a litte time to be able to read balance, still being weird about existing funds, tho

--- src/bitsplit_cli/client.cljs
+++ src/bitsplit_cli/client.cljs
@@ -1,6 +1,6 @@
 (ns bitsplit-cli.client
     (:use
-        [cljs.core.async :only (chan put!)]
+        [cljs.core.async :only (chan put! close!)]
         [bitsplit.client.protocol :only
         (Queries addresses unspent-amounts unspent-channel
          Operations send-amounts! new-address!)]
@@ -19,8 +19,14 @@
                             (into-array args))))))))

 (defn account->amount [account]
+    (println (.getAddress account) (.balance account))
     {(.getAddress account)
      (-> account .balance js/Number)})
+
+(defn empty-chan []
+    (let [c (chan)]
+        (close! c)
+        c))

 (defrecord Client [coin]
     Queries
@@ -38,14 +44,17 @@
                 (fn []
                     (let [unspent (unspent-amounts this)]
                         (put! return unspent)))
-                1000)
+                10000)
             return))
     Operations
     (send-amounts! [this amounts]
+        (println (unspent-amounts this))
+        (println amounts)
         ((comp chans->chan  map)
             (fn [[address amount]]
-                (println address amount)
-                (call-method coin "sendTo" address amount))
+                (if (= amount 0)
+                    (empty-chan)
+                    (call-method coin "sendTo" address amount)))
             amounts))
     (new-address! [this]
         (-> coin


return a File object from relative-to

return a File object from relative-to

this fixes https://github.com/boot-clj/boot/issues/85

The callers call .getPath on the return value of this function so it
shouldn't matter.

however tmpdir's dir->tree calls str on the return value. It may need to
be adapted...

--- boot/pod/src/boot/file.clj
+++ boot/pod/src/boot/file.clj
@@ -75,9 +75,9 @@
          parts []]
     (if base
       (if (parent? base f)
-        (URI. (str (apply io/file (concat parts [(str (.relativize (.toURI base) (.toURI f)))]))))
+        (apply io/file (concat parts [(str (.relativize (.toURI base) (.toURI f)))]))
         (recur (parent base) (conj parts "..")))
-      (URI. (str (apply io/file (concat parts (split-path f))))))))
+      (apply io/file (concat parts (split-path f))))))

 (defn lockfile
   [f]


Update to tools.reader 1.0.0

Update to tools.reader 1.0.0

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -11,7 +11,7 @@
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.9.562"]
                  [org.clojure/test.check "0.10.0-alpha1"]
-                 [org.clojure/tools.reader "1.0.0-RC1"]
+                 [org.clojure/tools.reader "1.0.0"]
                  [com.cognitect/transit-clj "0.8.300"]
                  [com.cognitect/transit-cljs "0.8.239"]
                  [fipp "0.6.8"]


fetch failed action logs when the build loads

--- frontend/controllers/post_api.cljs
+++ frontend/controllers/post_api.cljs
@@ -2,6 +2,7 @@
   (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
             [clojure.string :as string]
             [frontend.intercom :as intercom]
+            [frontend.models.action :as action-model]
             [frontend.models.project :as project-model]
             [frontend.models.repo :as repo-model]
             [frontend.routes :as routes]
@@ -37,6 +38,19 @@
 (defmethod post-api-event! [:default :finished]
   [target message status args previous-state current-state]
   (mlog "No post-api for: " [message status]))
+
+(defmethod post-api-event! [:build :success]
+  [target message status args previous-state current-state]
+  (let [{:keys [build-num project-name]} (:context args)]
+    ;; This is slightly different than the api-event because we don't want to have to
+    ;; convert the build from steps to containers again.
+    (when (and (= build-num (get-in args [:resp :build_num]))
+               (= project-name (vcs-url/project-name (get-in args [:resp :vcs_url]))))
+      (doseq [action (mapcat :actions (get-in current-state [:current-build :containers]))
+              :when (action-model/failed? action)]
+        ;; XXX: should this fetch the action logs itself creating controls events?
+        (put! (get-in current-state [:comms :controls])
+              [:action-log-output-toggled (select-keys action [:step :index])])))))

 (defmethod post-api-event! [:followed-repo :success]
   [target message status args previous-state current-state]


[frontend]: Fix formatting

[frontend]: Fix formatting

--- frontend/src/warehouse/events.cljs
+++ frontend/src/warehouse/events.cljs
@@ -144,8 +144,6 @@
            (dispatch [:components-loaded {:components components
                                           :count (count components)}
                       offset]))))))
-
-

 (reg-event-fx
  :components-loaded


Switch from atom to mutable-cell

Switch from atom to mutable-cell

--- src/clj/com/rpl/specter.cljx
+++ src/clj/com/rpl/specter.cljx
@@ -266,10 +266,10 @@
     (transform* [this structure next-fn]
       (let [select-result (compiled-select late structure)
             transformed (next-fn select-result)
-            values-to-insert (atom transformed)]
+            values-to-insert (i/mutable-cell transformed)]
         (compiled-transform late
-                            (fn [_] (let [next-val (first @values-to-insert)]
-                                      (swap! values-to-insert rest)
+                            (fn [_] (let [next-val (first (i/get-cell values-to-insert))]
+                                      (i/update-cell! values-to-insert rest)
                                       next-val))
                             structure)))))


navbar responsive as well

navbar responsive as well

--- src/clj/just_married/css.clj
+++ src/clj/just_married/css.clj
@@ -44,6 +44,44 @@
    :mobile (merge common-grid-options {:grid-template-columns "auto"
                                        :grid-template-rows "auto auto auto auto"})})

+(def ^:private navbar-grid-config
+  {:desktop {:background-color (:dark-red COLOR-PALLETTE)
+             :font-weight "bolder"
+             :display "grid"
+             :font-size "1.2em"
+             :grid-template-columns "repeat(5, 1fr)"
+             :grid-auto-rows "auto"
+             :grid-gap "1em"
+             :align-items "center"
+             :text-align "center"
+             :text-decoration "none"
+             :color (:gold COLOR-PALLETTE)
+             :margin-bottom "50px"
+             :position "sticky"
+             :top "0"
+             ;; to avoid making it go behind the map
+             :z-index 100}
+
+   :mobile {:background-color (:dark-red COLOR-PALLETTE)
+            :font-weight "bolder"
+            :display "grid"
+            :font-size "2em"
+            :grid-template-columns "auto"
+            :grid-template-rows "repeat(4, 1fr)"
+            :grid-auto-rows "auto"
+            :grid-gap "1em"
+            :align-items "left"
+            :text-align "left"
+            :text-decoration "none"
+            :color (:gold COLOR-PALLETTE)
+            :margin-bottom "50px"
+            :padding-top "10px"
+            :padding-left "10px"
+            :position "sticky"
+            :top "0"
+            ;; to avoid making it go behind the map
+            :z-index 100}})
+
 ;; define various font styles that can be used here

 ;; the base path in this case refers to where the css will be
@@ -116,22 +154,7 @@
            :box-shadow "10px 10px 20px #999"
            :border-radius "10px"}]

-   [:.navbar__container {:background-color (:dark-red COLOR-PALLETTE)
-                         :font-weight "bolder"
-                         :display "grid"
-                         :font-size "1.2em"
-                         :grid-template-columns "repeat(5, 1fr)"
-                         :grid-auto-rows "auto"
-                         :grid-gap "1em"
-                         :align-items "center"
-                         :text-align "center"
-                         :text-decoration "none"
-                         :color (:gold COLOR-PALLETTE)
-                         :margin-bottom "50px"
-                         :position "sticky"
-                         :top "0"
-                         ;; to avoid making it go behind the map
-                         :z-index 100}
+   [:.navbar__container (:desktop navbar-grid-config)

     ;; FIXME: should be less generic here
     [:a {:color (:white COLOR-PALLETTE)}]
@@ -174,6 +197,7 @@
   [[(at-media {:screen true
                :max-device-width max-width-mobile}

+              [:.navbar__container (:mobile navbar-grid-config)]
               [:.container (:mobile grid-config)])]])

 (defstyles screen


remove twotimepads

remove twotimepads

--- src/clj/xl/two_time_pads.clj
+++ src/clj/xl/two_time_pads.clj
@@ -1,85 +0,0 @@
-(ns xl.two-time-pads)
-
-"
-Many Time Pad
-
-Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts
-that are the result of encrypting eleven plaintexts with a stream cipher, all with the same stream cipher key.
-Your goal is to decrypt the last ciphertext, and submit the secret message within it as solution.
-
-Hint: XOR the ciphertexts together, and consider what happens when a space is XORed with a character in [a-zA-Z].
-
-ciphertext #1:
-
-315c4eeaa8b5f8aaf9174145bf43e1784b8fa00dc71d885a804e5ee9fa40b16349c146fb778cdf2d3aff021dfff5b403b510d0d0455468aeb98622b137dae857553ccd8883a7bc37520e06e515d22c954eba5025b8cc57ee59418ce7dc6bc41556bdb36bbca3e8774301fbcaa3b83b220809560987815f65286764703de0f3d524400a19b159610b11ef3e
-
-ciphertext #2:
-
-234c02ecbbfbafa3ed18510abd11fa724fcda2018a1a8342cf064bbde548b12b07df44ba7191d9606ef4081ffde5ad46a5069d9f7f543bedb9c861bf29c7e205132eda9382b0bc2c5c4b45f919cf3a9f1cb74151f6d551f4480c82b2cb24cc5b028aa76eb7b4ab24171ab3cdadb8356f
-
-ciphertext #3:
-
-32510ba9a7b2bba9b8005d43a304b5714cc0bb0c8a34884dd91304b8ad40b62b07df44ba6e9d8a2368e51d04e0e7b207b70b9b8261112bacb6c866a232dfe257527dc29398f5f3251a0d47e503c66e935de81230b59b7afb5f41afa8d661cb
-
-ciphertext #4:
-
-32510ba9aab2a8a4fd06414fb517b5605cc0aa0dc91a8908c2064ba8ad5ea06a029056f47a8ad3306ef5021eafe1ac01a81197847a5c68a1b78769a37bc8f4575432c198ccb4ef63590256e305cd3a9544ee4160ead45aef520489e7da7d835402bca670bda8eb775200b8dabbba246b130f040d8ec6447e2c767f3d30ed81ea2e4c1404e1315a1010e7229be6636aaa
-
-ciphertext #5:
-
-3f561ba9adb4b6ebec54424ba317b564418fac0dd35f8c08d31a1fe9e24fe56808c213f17c81d9607cee021dafe1e001b21ade877a5e68bea88d61b93ac5ee0d562e8e9582f5ef375f0a4ae20ed86e935de81230b59b73fb4302cd95d770c65b40aaa065f2a5e33a5a0bb5dcaba43722130f042f8ec85b7c2070
-
-ciphertext #6:
-
-32510bfbacfbb9befd54415da243e1695ecabd58c519cd4bd2061bbde24eb76a19d84aba34d8de287be84d07e7e9a30ee714979c7e1123a8bd9822a33ecaf512472e8e8f8db3f9635c1949e640c621854eba0d79eccf52ff111284b4cc61d11902aebc66f2b2e436434eacc0aba938220b084800c2ca4e693522643573b2c4ce35050b0cf774201f0fe52ac9f26d71b6cf61a711cc229f77ace7aa88a2f19983122b11be87a59c355d25f8e4
-
-ciphertext #7:
-
-32510bfbacfbb9befd54415da243e1695ecabd58c519cd4bd90f1fa6ea5ba47b01c909ba7696cf606ef40c04afe1ac0aa8148dd066592ded9f8774b529c7ea125d298e8883f5e9305f4b44f915cb2bd05af51373fd9b4af511039fa2d96f83414aaaf261bda2e97b170fb5cce2a53e675c154c0d9681596934777e2275b381ce2e40582afe67650b13e72287ff2270abcf73bb028932836fbdecfecee0a3b894473c1bbeb6b4913a536ce4f9b13f1efff71ea313c8661dd9a4ce
-
-ciphertext #8:
-
-315c4eeaa8b5f8bffd11155ea506b56041c6a00c8a08854dd21a4bbde54ce56801d943ba708b8a3574f40c00fff9e00fa1439fd0654327a3bfc860b92f89ee04132ecb9298f5fd2d5e4b45e40ecc3b9d59e9417df7c95bba410e9aa2ca24c5474da2f276baa3ac325918b2daada43d6712150441c2e04f6565517f317da9d3
-
-ciphertext #9:
-
-271946f9bbb2aeadec111841a81abc300ecaa01bd8069d5cc91005e9fe4aad6e04d513e96d99de2569bc5e50eeeca709b50a8a987f4264edb6896fb537d0a716132ddc938fb0f836480e06ed0fcd6e9759f40462f9cf57f4564186a2c1778f1543efa270bda5e933421cbe88a4a52222190f471e9bd15f652b653b7071aec59a2705081ffe72651d08f822c9ed6d76e48b63ab15d0208573a7eef027
-
-ciphertext #10:
-
-466d06ece998b7a2fb1d464fed2ced7641ddaa3cc31c9941cf110abbf409ed39598005b3399ccfafb61d0315fca0a314be138a9f32503bedac8067f03adbf3575c3b8edc9ba7f537530541ab0f9f3cd04ff50d66f1d559ba520e89a2cb2a83
-
-target ciphertext (decrypt this one):
-
-32510ba9babebbbefd001547a810e67149caee11d945cd7fc81a05e9f85aac650e9052ba6a8cd8257bf14d13e6f0a803b54fde9e77472dbff89d71b57bddef121336cb85ccb8f3315f4b52e301d16e9f52f904
-
-"
-
-(def ciphers = [
-                "315c4eeaa8b5f8aaf9174145bf43e1784b8fa00dc71d885a804e5ee9fa40b16349c146fb778cdf2d3aff021dfff5b403b510d0d0455468aeb98622b137dae857553ccd8883a7bc37520e06e515d22c954eba5025b8cc57ee59418ce7dc6bc41556bdb36bbca3e8774301fbcaa3b83b220809560987815f65286764703de0f3d524400a19b159610b11ef3e"
-                "234c02ecbbfbafa3ed18510abd11fa724fcda2018a1a8342cf064bbde548b12b07df44ba7191d9606ef4081ffde5ad46a5069d9f7f543bedb9c861bf29c7e205132eda9382b0bc2c5c4b45f919cf3a9f1cb74151f6d551f4480c82b2cb24cc5b028aa76eb7b4ab24171ab3cdadb8356f"
-                "32510ba9a7b2bba9b8005d43a304b5714cc0bb0c8a34884dd91304b8ad40b62b07df44ba6e9d8a2368e51d04e0e7b207b70b9b8261112bacb6c866a232dfe257527dc29398f5f3251a0d47e503c66e935de81230b59b7afb5f41afa8d661cb"
-                "32510ba9aab2a8a4fd06414fb517b5605cc0aa0dc91a8908c2064ba8ad5ea06a029056f47a8ad3306ef5021eafe1ac01a81197847a5c68a1b78769a37bc8f4575432c198ccb4ef63590256e305cd3a9544ee4160ead45aef520489e7da7d835402bca670bda8eb775200b8dabbba246b130f040d8ec6447e2c767f3d30ed81ea2e4c1404e1315a1010e7229be6636aaa"
-                "3f561ba9adb4b6ebec54424ba317b564418fac0dd35f8c08d31a1fe9e24fe56808c213f17c81d9607cee021dafe1e001b21ade877a5e68bea88d61b93ac5ee0d562e8e9582f5ef375f0a4ae20ed86e935de81230b59b73fb4302cd95d770c65b40aaa065f2a5e33a5a0bb5dcaba43722130f042f8ec85b7c2070"
-                "32510bfbacfbb9befd54415da243e1695ecabd58c519cd4bd2061bbde24eb76a19d84aba34d8de287be84d07e7e9a30ee714979c7e1123a8bd9822a33ecaf512472e8e8f8db3f9635c1949e640c621854eba0d79eccf52ff111284b4cc61d11902aebc66f2b2e436434eacc0aba938220b084800c2ca4e693522643573b2c4ce35050b0cf774201f0fe52ac9f26d71b6cf61a711cc229f77ace7aa88a2f19983122b11be87a59c355d25f8e4"
-                "32510bfbacfbb9befd54415da243e1695ecabd58c519cd4bd90f1fa6ea5ba47b01c909ba7696cf606ef40c04afe1ac0aa8148dd066592ded9f8774b529c7ea125d298e8883f5e9305f4b44f915cb2bd05af51373fd9b4af511039fa2d96f83414aaaf261bda2e97b170fb5cce2a53e675c154c0d9681596934777e2275b381ce2e40582afe67650b13e72287ff2270abcf73bb028932836fbdecfecee0a3b894473c1bbeb6b4913a536ce4f9b13f1efff71ea313c8661dd9a4ce"
-                "315c4eeaa8b5f8bffd11155ea506b56041c6a00c8a08854dd21a4bbde54ce56801d943ba708b8a3574f40c00fff9e00fa1439fd0654327a3bfc860b92f89ee04132ecb9298f5fd2d5e4b45e40ecc3b9d59e9417df7c95bba410e9aa2ca24c5474da2f276baa3ac325918b2daada43d6712150441c2e04f6565517f317da9d3"
-                "271946f9bbb2aeadec111841a81abc300ecaa01bd8069d5cc91005e9fe4aad6e04d513e96d99de2569bc5e50eeeca709b50a8a987f4264edb6896fb537d0a716132ddc938fb0f836480e06ed0fcd6e9759f40462f9cf57f4564186a2c1778f1543efa270bda5e933421cbe88a4a52222190f471e9bd15f652b653b7071aec59a2705081ffe72651d08f822c9ed6d76e48b63ab15d0208573a7eef027"
-                "466d06ece998b7a2fb1d464fed2ced7641ddaa3cc31c9941cf110abbf409ed39598005b3399ccfafb61d0315fca0a314be138a9f32503bedac8067f03adbf3575c3b8edc9ba7f537530541ab0f9f3cd04ff50d66f1d559ba520e89a2cb2a83"
-                "32510ba9babebbbefd001547a810e67149caee11d945cd7fc81a05e9f85aac650e9052ba6a8cd8257bf14d13e6f0a803b54fde9e77472dbff89d71b57bddef121336cb85ccb8f3315f4b52e301d16e9f52f904"
-                ])
-
-(defn to-nums [ss]
-  (sequence (comp (partition-all 2)  (map (fn [chs] (str "0x" (apply str chs)))) (map read-string) ) (seq ss))
-  )
-
-(defn xor [s1 s2]
-  (let [[nums1 nums2] (map to-nums [s1 s2])
-        min-len (min (count nums1) (count nums2))]
-    )
-  )
-
-
-(defn decrypt []
-
-  )


Refactor card list a bit

Refactor card list a bit

--- src/cljs/decktouch/core.cljs
+++ src/cljs/decktouch/core.cljs
@@ -9,9 +9,18 @@

 ;; -------------------------
 ;; Views
+(defn card-in-list [card]
+  [:li
+   (str card)])
+
+(defn card-list [cards]
+  [:ul
+   (for [card cards]
+     ^{:key card} (card-in-list (:name card)))])

 (defn home-page []
   [:div [:h2 "Welcome to decktouch"]
+   [:div [card-list @card-data/cards]]
    [:div [:a {:href "#/about"} "go to about page"]]])

 (defn about-page []


Rewrite filter function wip

Rewrite filter function wip

--- src/day8/re_frame/trace.cljs
+++ src/day8/re_frame/trace.cljs
@@ -136,10 +136,33 @@
                                     (reset! val ""))
                                nil)}])))

-(defn render-traces [padding slower-than-bold-int showing-traces]
+(defn construct-string [trace]
+  (clojure.string/lower-case (str (:operation trace) " " (:op-type trace))))
+
+(defn has-word [traces q]
+  (filter #(clojure.string/includes? (construct-string %) (:query q)) traces))
+
+(defn has-duration [traces q]
+  (filter #(< (js/parseInt (:query q)) (:duration %)) traces))
+
+(defn filter-by-word [traces queries]
+  (mapcat (partial has-word traces) queries))
+
+(defn filter-by-duration [traces queries]
+  (mapcat (partial has-duration traces) queries))
+
+(defn run-all-filters [traces queries]
+  (let [[word-queries duration-queries] (vals (group-by #(= (:filter-type %) "contains") queries))
+        traces-filtered-by-words      (filter-by-word traces word-queries)]
+    (if duration-queries
+      (filter-by-duration traces-filtered-by-words duration-queries)
+      traces-filtered-by-words)))
+
+(defn render-traces [showing-traces]
   (doall
     (for [{:keys [op-type id operation tags duration] :as trace} showing-traces]
-      (let [row-style (merge padding {:border-top (case op-type :event "1px solid lightgrey" nil)})
+      (let [padding   {:padding "0px 5px 0px 5px"}
+            row-style (merge padding {:border-top (case op-type :event "1px solid lightgrey" nil)})
             #_#__ (js/console.log (devtools/header-api-call tags))]

         (list [:tr {:key   id
@@ -157,6 +180,7 @@
                                                          "bold"
                                                          "")
                                           :white-space "nowrap"})}
+
                 (.toFixed duration 1) " ms"]]
               (when true
                 [:tr {:key (str id "-details")}
@@ -168,19 +192,11 @@
 (defn render-trace-panel []
   (let [filter-input     (r/atom "")
         filter-items     (r/atom [])
-        slower-than-ms   (r/atom "")
-        slower-than-bold (r/atom "")
         filter-type      (r/atom "contains")]
     (fn []
-      (let [slower-than-ms-int   (js/parseInt @slower-than-ms)
-            slower-than-bold-int (js/parseInt @slower-than-bold)
-            op-filter            (when-not (str/blank? @filter-input)
-                                   (filter #(str/includes? (str/lower-case (str (:operation %) " " (:op-type %))) @filter-input)))
-            ms-filter            (when-not (str/blank? @slower-than-ms)
-                                   (filter #(< slower-than-ms-int (:duration %))))
-            transducers          (apply comp (remove nil? [ms-filter op-filter]))
-            showing-traces       (sequence transducers @traces)
-            padding              {:padding "0px 5px 0px 5px"}
+      (let [showing-traces       (if (= @filter-items [])
+                                   @traces
+                                   (run-all-filters @traces @filter-items))
             save-query           (fn [_]
                                    (swap! filter-items conj {:id (random-uuid)
                                                              :query (str/lower-case @filter-input)
@@ -225,7 +241,7 @@
              (when (pos? (count @traces))
                [:span "(" [:button.text-button {:on-click #(do (trace/reset-tracing!) (reset! traces []))} "clear"] ")"])]
            [:th "meta"]]
-          [:tbody (render-traces padding slower-than-bold-int showing-traces)]]]))))
+          [:tbody (render-traces showing-traces)]]]))))

 (defn resizer-style [draggable-area]
   {:position "absolute" :z-index 2 :opacity 0


carry-reagent: use alpha reagent

carry-reagent: use alpha reagent

--- contrib/reagent/project.clj
+++ contrib/reagent/project.clj
@@ -9,7 +9,7 @@

                  [carry "0.1.0" :scope "provided"]

-                 [reagent "0.6.0-SNAPSHOT" :exclusions [cljsjs/react] :scope "provided"]
+                 [reagent "0.6.0-alpha" :exclusions [cljsjs/react] :scope "provided"]
                  [cljsjs/react-with-addons "15.0.2-0" :scope "provided"]]

   :pedantic? :abort


Remove debugging println

Remove debugging println

--- src/braid/client/ui/views/embed.cljs
+++ src/braid/client/ui/views/embed.cljs
@@ -54,7 +54,6 @@
 (defn embed-view [url embed-update-chan]
   (let [content (r/atom {})
         set-content! (fn [response]
-                       (println "Response" response)
                        (reset! content response))
         fetch-content! (fn [url]
                          (when (some? url)


Fix dev tile-spec create function

Fix dev tile-spec create function

--- dev/lcmap/aardvark/dev.clj
+++ dev/lcmap/aardvark/dev.clj
@@ -24,8 +24,7 @@
          :checksum "2e8f29fb6cc66d5162a043a9a2c7eba5"})

 (def tile-spec-opts {:data_shape [128 128]
-                     :keyspace_name "lcmap_landsat_dev"
-                     :table_name "conus"})
+                     :name "conus"})

 (defn load-tile-spec []
   (tile-spec/process L5 tile-spec-opts)


fix indenting

fix indenting

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -66,30 +66,29 @@
                    :keywords? true})
    app-state))

-   (re-frame/register-pure-handler
-    :process-phone-detail-response
-    (fn
-      [app-state [_ [phone-id response]]]
-      (assoc-in app-state [:phone-details (keyword phone-id)] response)))
-
-   (re-frame/register-pure-handler
-    :process-phone-detail-bad-response
-    (fn
-      [app-state [_ [phone-id response]]]
-      (println "Error getting phone detail for id: " phone-id)
-      (println response)
-      app-state))
-
-   (re-frame/register-pure-handler
-    :load-phone-detail
-    (fn
-      [app-state [_ phone-id]]
-      (ajax/GET (str "phones/" phone-id ".json")
-                {:handler #(re-frame/dispatch [:process-phone-detail-response [phone-id %1]])
-                 :error-handler #(re-frame/dispatch [:process-phone-detail-bad-response [phone-id %1]])
-                 :response-format :json
-                 :keywords? true})))
-
+(re-frame/register-pure-handler
+ :process-phone-detail-response
+ (fn
+   [app-state [_ [phone-id response]]]
+   (assoc-in app-state [:phone-details (keyword phone-id)] response)))
+
+(re-frame/register-pure-handler
+ :process-phone-detail-bad-response
+ (fn
+   [app-state [_ [phone-id response]]]
+   (println "Error getting phone detail for id: " phone-id)
+   (println response)
+   app-state))
+
+(re-frame/register-pure-handler
+ :load-phone-detail
+ (fn
+   [app-state [_ phone-id]]
+   (ajax/GET (str "phones/" phone-id ".json")
+             {:handler #(re-frame/dispatch [:process-phone-detail-response [phone-id %1]])
+              :error-handler #(re-frame/dispatch [:process-phone-detail-bad-response [phone-id %1]])
+              :response-format :json
+              :keywords? true})))

 (re-frame/register-pure-handler
    :initialise-db             ;; usage: (dispatch [:initialise-db])


Fix escape and numberpad keys

Fix escape and numberpad keys

--- src/cljs/robinson/webglterminal.cljs
+++ src/cljs/robinson/webglterminal.cljs
@@ -3,8 +3,8 @@
   (:require ;[robinson.common :as rc :refer [error warn info debug trace]]
             [vec3]
             [mat4]
-            [robinson.log :as log]
-            ;[shodan.console :as log :include-macros true]
+            ;[robinson.log :as log]
+            [shodan.console :as log :include-macros true]
             [robinson.aterminal :as rat]
             [cljs.core.async :as async]
             [goog.dom :as dom]
@@ -37,28 +37,33 @@
 (def char-width 9)
 (def char-height 16)

-(events/listen js/document event-type/KEYPRESS (fn [ev]
+(events/listen js/document event-type/KEYDOWN (fn [ev]
   (let [kc (.-keyCode ev)]
-    (log/info "Got key" kc)
+    (log/info "Got keydown" kc (char kc))
     (when-let [kc (cond
                     (= kc key-codes/ENTER)      :enter
                     (= kc key-codes/ESC)        :escape
                     (= kc key-codes/SPACE)      :space
                     (= kc key-codes/BACKSPACE)  :backspace
-                    (= kc key-codes/NUMPAD1)    :numpad1
-                    (= kc key-codes/NUMPAD2)    :numpad2
-                    (= kc key-codes/NUMPAD3)    :numpad3
-                    (= kc key-codes/NUMPAD4)    :numpad4
-                    (= kc key-codes/NUMPAD5)    :numpad5
-                    (= kc key-codes/NUMPAD6)    :numpad6
-                    (= kc key-codes/NUMPAD7)    :numpad7
-                    (= kc key-codes/NUMPAD8)    :numpad8
-                    (= kc key-codes/NUMPAD9)    :numpad9
-                    true (when (or (<= \a (char kc) \z)
-                                   (<= \A (char kc) \Z)
-                                   (<= \0 (char kc) \9)
-                                   (contains? #{\, \. \? \;} (char kc)))
-                           (char kc)))]
+                    (= kc key-codes/NUM_ONE)    :numpad1
+                    (= kc key-codes/NUM_TWO)    :numpad2
+                    (= kc key-codes/NUM_THREE)  :numpad3
+                    (= kc key-codes/NUM_FOUR)   :numpad4
+                    (= kc key-codes/NUM_FIVE)   :numpad5
+                    (= kc key-codes/NUM_SIX)    :numpad6
+                    (= kc key-codes/NUM_SEVEN)  :numpad7
+                    (= kc key-codes/NUM_EIGHT)  :numpad8
+                    (= kc key-codes/NUM_NINE)   :numpad9)]
+      (go
+        (async/>! key-chan kc))))))
+
+(events/listen js/document event-type/KEYPRESS (fn [ev]
+  (let [kc (.-keyCode ev)]
+    (log/info "Got keypress" kc (char kc))
+    (when-let [kc (when (or (<= \a (char kc) \z)
+                            (<= \A (char kc) \Z)
+                            (contains? #{\, \. \? \;} (char kc)))
+                    (char kc))]
       (go
         (async/>! key-chan kc))))))


validation on initial startup

validation on initial startup

--- src/cljs/western_music/handlers.cljs
+++ src/cljs/western_music/handlers.cljs
@@ -1,10 +1,19 @@
 (ns western-music.handlers
   (:require [western-music.data :refer [initial-data]]
-            [re-frame.core :refer [def-event path debug]]
-            [western-music.spec :as spec]))
+            [re-frame.core :refer [def-event path after debug]]
+            [western-music.spec :as spec]
+            [clojure.spec :as s]))
+
+(defn check-and-throw
+  "throw an exception if db doesn't match the spec."
+  [spec data]
+  (when-not (s/valid? spec data)
+    (throw (ex-info (str "spec check failed: " (s/explain-str spec data))
+                    {:problems (s/explain-data spec data) }))))

 (def-event
   :initialize-data
+  (after (comp (partial check-and-throw (s/coll-of ::spec/composition)) :raw))
   (constantly {:raw initial-data
                :ui {:player {:queue []
                              :paused true}


Fixed bulk index test to have unique granule ur.

--- system-int-test/test/cmr/system_int_test/bootstrap/bulk_index_test.clj
+++ system-int-test/test/cmr/system_int_test/bootstrap/bulk_index_test.clj
@@ -117,7 +117,7 @@
                                                             :provider-id "PROV1"
                                                             :native-id (str "gran-" pid "-" x)
                                                             :extra-fields {:parent-collection-id pid
-                                                                           :granule-ur (str "ur" x)}
+                                                                           :granule-ur (str "gran-" pid "-" x)}
                                                             :format "application/echo10+xml"
                                                             :metadata xml}
                                                {:keys [concept-id revision-id]} (ingest/save-concept concept-map)]


Figlet header FTW!

Figlet header FTW!

--- src/aeolian/core.clj
+++ src/aeolian/core.clj
@@ -22,6 +22,13 @@
       (log/info (str "Generated " notation-file-name)))))

 (defn -main [& args]
+	(println "                      lll iii     ")
+	(println "  aa aa   eee   oooo  lll       aa aa nn nnn  ")
+	(println " aa aaa ee   e oo  oo lll iii  aa aaa nnn  nn ")
+	(println "aa  aaa eeeee  oo  oo lll iii aa  aaa nn   nn ")
+	(println " aaa aa  eeeee  oooo  lll iii  aaa aa nn   nn ")
+	(println "")
+
   (if-let [metrics-file-name (first args)]
     (if (.exists (io/as-file metrics-file-name))
       (let [duplicate-metrics (read-string (second args))]


per language-model default-fn rules should apply to parsing as well as generation

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -36,7 +36,7 @@
         (if (= cache-value :none) nil
             cache-value)))))

-(defn over [grammar left right morph]
+(defn over [grammar left right morph default-fn]
   "opportunity for additional logging before calling the real (over)"
   (log/trace (str "parse/over: grammar size: " (count grammar)))
   (log/debug (str "parse/over: "
@@ -44,8 +44,12 @@
                   "; right: " (vec (set (map morph right)))))

   (log/debug (str "over: rules: " (string/join ","
-                                               (map :rule grammar))))
-  (over/over grammar left right))
+                                               (map :rule grammar)) " with default-fn:" default-fn))
+  (if default-fn
+    (->>
+     (over/over grammar left right)
+     (map default-fn))
+    (over/over grammar left right)))

 (defn square-cross-product [x]
   (mapcat (fn [each-x]
@@ -175,8 +179,9 @@
                                                       (:morph model))
                                            ;; fallback to (:morph model) if
                                            ;; (:morph-ps is not available)
-                                           parents (over (:grammar model) left-signs right-signs morph-ps)
-                                           truncated-parents
+                                           trees (over (:grammar model) left-signs right-signs morph-ps
+                                                       (:default-fn model))
+                                           truncated-trees
                                            (if parse-with-truncate
                                              (map-fn (fn [parent]
                                                        (conj
@@ -185,19 +190,19 @@
                                                         (truncate parent [[:comp]
                                                                           [:head]]
                                                                   model)))
-                                                  parents))]
-                                       (if (not (empty? parents))
-                                         (log/debug (str "parse/parses: parents: "
+                                                  trees))]
+                                       (if (not (empty? trees))
+                                         (log/debug (str "parse/parses: trees: "
                                                          (string/join ","
-                                                                      (map #(morph-ps %) parents))))
-                                         (log/debug (str "no parents found for left/right:")))
+                                                                      (map #(morph-ps %) trees))))
+                                         (log/debug (str "no trees found for left/right:")))
                                        (log/debug (str " left: "
                                                        (string/join ","
                                                                     (map #(morph-ps %) left-signs))))
                                        (log/debug (str " right: "
                                                        (string/join ","
                                                                     (map #(morph-ps %) right-signs))))
-                                       (if parse-with-truncate truncated-parents parents)))
+                                       (if parse-with-truncate truncated-trees trees)))
                                    ;; TODO: explain why we can use (first) here for the left- and right-strings.
                                    ;; Throw an exception if (> 1 (count left-strings)) or (> 1 (count right-strings))
                                    [(string/join " " [(first left-strings) (first right-strings)])]))


(defn generate-question-and-correct-set-dynamic)

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -1,6 +1,7 @@
 (ns babel.reader
   [:refer-clojure :exclude [get-in resolve]]
   [:require
+   [babel.engine :as engine]
    [babel.korma :as korma]
    [clojure.string :as string]
    [clojure.data.json :as json :refer [read-str write-str]]
@@ -69,6 +70,17 @@
                              :results)]
     (if (not (empty? results))
       (deserialize (read-string (:structure (first results)))))))
+
+(defn generate-question-and-correct-set-dynamic [target-spec source-language source-locale
+                                                 target-language target-local
+                                                 source-model target-model]
+  (let [target-expression (engine/generate target-spec :model target-model)
+        source-expression (engine/generate {:synsem {:sem (get-in target-expression [:synsem :sem])}}
+                                           :model source-model)]
+        {:source ((:fo source-model) source-expression)
+         :targets [(:fo target-model) target-expression]
+         :target-spec target-spec
+         :target-semantics {:synsem {:sem (get-in target-expression [:synsem :sem])}}}))

 (defn generate-question-and-correct-set [target-spec source-language source-locale
                                          target-language target-locale]


do not dereference target-language-model

--- src/babel/writer.clj
+++ src/babel/writer.clj
@@ -126,7 +126,7 @@
                       (= source-language-surface ""))
                 (let [message (str "Could not generate a sentence in source language '" source-language
                                    "' for this semantics: " semantics "; target language was: " (:language target-language-model)
-                                   "; target expression was: '" ((:morph  @target-language-model) target-language-sentence) "'"
+                                   "; target expression was: '" ((:morph  target-language-model) target-language-sentence) "'"
                                    "; target rule was: '" (:rule target-language-sentence) "'"
                                    "; target head rule was: '" (:rule (:head target-language-sentence)) "'"
                                    ;; TODO: add partial parses for more diagnostics:


Updated slider description

Updated slider description

--- src/css-guide/styles/components.cljs
+++ src/css-guide/styles/components.cljs
@@ -1188,7 +1188,7 @@

 (defexample slider
   "### Simple
-  Click this example to see it's active state which is a simple `:checked` attribute on `.c-switch__input`."
+  "
   (let [active (boolean (om/get-state this :active))
         ]
     (dom/div nil


made peek-char and unread nil-safe

made peek-char and unread nil-safe

--- src/blind/reader.clj
+++ src/blind/reader.clj
@@ -133,12 +133,14 @@
         (char c))))

   (peek-char [rdr]
-    (let [c (read-char rdr)]
+    (when-let [c (read-char rdr)]
       (unread rdr c)
       c))

   IPushbackReader
-  (unread [rdr c] (.unread ^java.io.PushbackReader rdr (int c))))
+  (unread [rdr c]
+    (when c
+      (.unread ^java.io.PushbackReader rdr (int c)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; predicates


Fix swank ports - "case" is not "cond".

Fix swank ports - "case" is not "cond".

--- src/circle/swank.clj
+++ src/circle/swank.clj
@@ -3,7 +3,7 @@
   (:require [circle.env :as env]))

 (defn port []
-  (case
+  (cond
       (env/test?) 5004
       :else 4005))


not sure why this url is like this

not sure why this url is like this

--- src/client/chat.cljs
+++ src/client/chat.cljs
@@ -15,7 +15,7 @@
 (hiccups/defhtml chat-html []
 	[:div#inner-container
     [:div.chat-logo-e38e3
-      [:img {:src "/../../img/t3tr0s_logo_200w.png" :width "160px"}]
+      [:img {:src "/img/t3tr0s_logo_200w.png" :width "160px"}]
       [:span.span-4e536.time-left-8a651 "Waiting to play..."]]
     [:div#chat-messages]
     [:div#chat-input


[Add] post-condition

[Add] post-condition

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -11,7 +11,7 @@
   "The signum function for a real number x."
   ([x]
    {:pre [(number? x)]
-    :post [(< (Math/abs %) 2)]}
+    :post [(<= (Math/abs %) 1)]}
    (cond
      (> x 0) 1
      (= x 0) 0
@@ -21,23 +21,26 @@
   "Make a d-dimension-random-feature vector. d is number of dimention of
    feature. All elements are in [-1,1]"
   ([d]
-   {:pre [(integer? d)]}
+   {:pre [(integer? d)]
+    :post [(coll? %)]}
    (take d (repeatedly #(dec (rand 2))))))

 (defn make-ass
   ([d L]
-   {:pre [(integer? d) (integer? L)]}
+   {:pre [(integer? d) (integer? L)]
+    :post [(coll? %) (coll? (first %)) (float? (first (first %)))]}
    (take L (repeatedly #(make-weights d)))))

 (defn make-bs
   ([L]
-   {:pre (integer? L)}
+   {:pre [(integer? L)]
+    :post [(coll? %) (float? (first %))]}
    (take L (repeatedly #(first (make-weights 1))))))

 (defn standard-sigmoid
   ([x]
    {:pre [(number? x)]
-    :post [(number? %)]}
+    :post [(float? %)]}
    (/ 1 (+ 1 (Math/exp (- x))))))

 (defn bipolar-sigmoid


check valid options for public functions

--- src/control/core.clj
+++ src/control/core.clj
@@ -15,6 +15,17 @@
 (def ^:private bash-greenbold "\033[1;32m")
 ;;Global options for ssh,scp and rsync
 (def ^{:dynamic true :private true} *global-options* (atom {}))
+
+(defn ^:private check-valid-options
+  "Throws an exception if the given option map contains keys not listed
+  as valid, else returns nil."
+  [options & valid-keys]
+  (when (seq (apply disj (apply hash-set (keys options)) valid-keys))
+    (throw
+     (IllegalArgumentException.
+      (apply str "Only these options are valid: "
+             (first valid-keys)
+             (map #(str ", " %) (rest valid-keys)))))))

 (defmacro ^:private cli-bash-bold [& content]
   `(if *enable-color*
@@ -90,8 +101,10 @@

   "
   [key value & kvs]
-  (swap! *global-options* #(apply assoc (list* % key value kvs))))
-
+  (let [options (apply hash-map key value kvs)]
+    (check-valid-options options :user :ssh-options :scp-options :rsync-options)
+    (swap! *global-options* merge options)))
+
 (defn clear-options!
   "Clear global options"
   []
@@ -115,6 +128,7 @@
               (str "sudo " cmd)
               cmd)
         ssh-options (or (:ssh-options m) (find-client-options host user cluster :ssh-options))]
+    (check-valid-options m :sudo :ssh-options :mode :scp-options)
 	(log-with-tag host "ssh" ssh-options cmd)
 	(exec host
           user
@@ -134,6 +148,7 @@
   [host user cluster src dst & opts]
   (let [m (apply hash-map opts)
         rsync-options (or (:rsync-options m) (find-client-options host user cluster :rsync-options))]
+    (check-valid-options m :rsync-options)
     (log-with-tag host "rsync" rsync-options (str src " ==>" dst))
     (exec host
           user
@@ -166,6 +181,7 @@
         tmp (if use-tmp
               (or *tmp-dir* (str "/tmp/control-" (System/currentTimeMillis) "/"))
               remote)]
+    (check-valid-options m :scp-options :sudo :mode :ssh-options)
     (log-with-tag host "scp" scp-options
       (join " " (concat files [ " ==> " tmp])))
     (if use-tmp
@@ -300,6 +316,7 @@
                    includes (:includes cluster)
                    debug (:debug cluster)
                    log (:log cluster)]
+               (check-valid-options cluster :user :clients :addresses :parallel :includes :debug :log)
                (when-exit (nil? task)
                           (str "No task named " (name task-name)))
                (when-exit (and (empty? addresses)


Add more repl util code.

Add more repl util code.

--- dev/user.clj
+++ dev/user.clj
@@ -98,6 +98,8 @@

 (defn gen-update!
+  "Generate an example update case for the given set of fields, families, and
+  number of contextual records."
   [field-keys families n]
   (let [record-keys (map (partial key/encode key/long-lexicoder) (range n))
         extant-keys (sample-subset 0.5 record-keys)
@@ -155,5 +157,19 @@
      'updated-root
      root'
      'updated-tablets
-     (mdag/get-data store (get-in root' [::part/tablets :base]))
-     (mdag/get-data store (get-in root' [::part/tablets :bc]))]))
+     (mdag/get-data store (meta root') "0/base")
+     (mdag/get-data store (meta root') "0/bc")
+     (mdag/get-data store (meta root') "1/base")
+     (mdag/get-data store (meta root') "1/bc")
+     #_ (mdag/get-data store (get-in root' [::part/tablets :base]))
+     #_ (mdag/get-data store (get-in root' [::part/tablets :bc]))]))
+
+
+(def promote-reuse-example
+  {:families {:bc #{:b :c}}
+   :records {(key/create [0]) {:a 0 :b 0 :c 0}
+             (key/create [1]) {:a 1, :c 1}
+             (key/create [2]) {:a 2, :b 2, :d 2}}
+   :changes {(key/create [5]) {:a 5}
+             (key/create [6]) {:x 6}
+             (key/create [7]) {:y 7}}})


oops

oops

--- dev/user.clj
+++ dev/user.clj
@@ -21,7 +21,6 @@
             [clojento.magento.db :as mage-db]
             [clojento.magento.db.products :as mage-db-products]
             [clojento.magento.t_db :as mage-db-test]
-            [clojento.mount.logging :refer [with-logging-status]]
             [ragtime.jdbc]
             [ragtime.repl]
             [mount.lite :as mount :refer [defstate]]))
@@ -34,7 +33,6 @@

 (defn start []
   (log/info "*** START ***")
-  (with-logging-status)
   (mount/start))

 ; (mount/start #'app.conf/config


First functions for ajax calls

First functions for ajax calls

--- frontend/src/crunsher/communication/main.cljs
+++ frontend/src/crunsher/communication/main.cljs
@@ -1 +1,33 @@
-(ns crunsher.communication.main)
+(ns crunsher.communication.main
+  (:require [ajax.core :refer [GET POST]]
+            [crunsher.communication.utils :as clib]
+            [crunsher.utils.lib :as lib]))
+
+;;;; Generic helpers
+(defn process-response
+  "Generic success handler, which sets error handling and returns a cljs-compatible response."
+  [response]
+  (lib/json->clj response))
+
+;;;; Handlers
+(defn error-handler
+  "Generic error handler for ajax requests."
+  [{:keys [status status-text]}]
+  (.log js/console (str "I feel a disturbance in the Force... " status " " status-text)))
+
+(defn success-handler
+  "React on response after sending a new statement. Reset atom and call newly received url."
+  [response]
+  (let [res (process-response response)]
+    (println res)))
+
+
+;;;; Requests
+(defn ajax-get
+  "Make ajax call to dialogue based argumentation system."
+  ([url handler]
+   (GET (clib/make-url url)
+        {:handler       handler
+         :error-handler error-handler}))
+  ([url]
+   (ajax-get url success-handler)))


increased the maximal font size in wordclouds

--- src/mastersign/wordcloud.clj
+++ src/mastersign/wordcloud.clj
@@ -23,7 +23,7 @@
    :precision 0.4
    :font (Font. "Calibri" Font/BOLD (float 30))
    :min-font-size 14
-   :max-font-size 60
+   :max-font-size 80
    :max-test-radius 350
    :order-priority 0.7
    :padding 4


CM - add refer to header 'sign-in'

CM - add refer to header 'sign-in'

--- src/objective8/responses.clj
+++ src/objective8/responses.clj
@@ -77,7 +77,8 @@
   )

 (html/defsnippet user-navigation-signed-out
-  "templates/user-navigation/signed-out.html" [[:#clj-user-navigation]] [{:keys [translations]}]
+  "templates/user-navigation/signed-out.html" [[:#clj-user-navigation]] [{:keys [translations ring-request] :as context}]
+  [:a] #(assoc-in % [:attrs :href] (str "/sign-in?refer=" (:uri ring-request)))
   [:#clj-user-navigation html/any-node] (html/replace-vars translations))

 ;BASE TEMPLATE


Correct workflow depth calculation

Correct workflow depth calculation

--- src/onyx/static/planning.clj
+++ src/onyx/static/planning.clj
@@ -75,7 +75,7 @@
 (defn workflow-depth [workflow]
   (let [edges (set (reduce into [] workflow))
         g (to-dependency-graph workflow)]
-    (apply max (map #(max-depth g %) edges))))
+    (inc (apply max (map #(max-depth g %) edges)))))

 (defn remove-dupes [coll]
   (map last (vals (group-by :name coll))))


add invert-reverse-map to Clojure source map support

--- src/main/clojure/cljs/source_map.clj
+++ src/main/clojure/cljs/source_map.clj
@@ -309,6 +309,24 @@
           (assoc new-lines line new-cols)))
       new-lines)))

+;; -----------------------------------------------------------------------------
+;; Reverse Source Map Inversion
+
+(defn invert-reverse-map
+  "Given a ClojureScript to JavaScript source map, invert it. Useful when
+   mapping JavaScript stack traces when environment support is unavailable."
+  [reverse-map]
+  (let [inverted (atom (sorted-map))]
+    (doseq [[line columns] reverse-map]
+      (doseq [[column column-info] columns]
+        (doseq [{:keys [gline gcol name]} column-info]
+          (swap! inverted update-in [gline]
+            (fnil (fn [columns]
+                    (update-in columns [column] (fnil conj [])
+                      {:line line :col column :name name}))
+              (sorted-map))))))
+    @inverted))
+
 (comment
   ;; INSTRUCTIONS:


do not re-check table on every recur

do not re-check table on every recur

--- src/irmgard/core.clj
+++ src/irmgard/core.clj
@@ -16,8 +16,6 @@
 (defn clear-registry []
   (reset! registry         {})
   (reset! indexed-registry {}))
-
-;; (clear-registry)

 (defn register-listener [listener-name dbname schema-name table-name f]
   (swap! registry assoc listener-name {:dbname dbname
@@ -66,8 +64,7 @@
    true
    (catch java.sql.SQLException ex
      ;; did not get the lock
-     false))
-  )
+     false)))

 (defn group-row-updates [recs]
   (reduce (fn [acc r]
@@ -79,7 +76,7 @@
 (defn process-row-changes [conf conn]
   ;; obtain mutex, nowait
   ;; TODO: handle failure to get lock (probably an exception)
-  (let [dbname        (-> conf :dbconf :subname)]
+  (let [dbname        (-> conf :conf :subname)]
     (jdbc/transaction
      (if (obtain-mutex conf conn)
        (do
@@ -99,12 +96,15 @@
        (log/infof "did not get lock on irmgard.process_log, another process is working with the table."))
      :ok)))

-(defn dispatch-notifications [conf conn]
+(defn dispatch-notifications [conf conn force-check-table?]
   ;; this select is purely for side-effect
   (exec-sql "SELECT 1" [])
-  (let [dbname        (-> conf :dbname :subname)
+  ;; NB: also, just check the table to see if it contains anything
+  (let [dbname        (-> conf :conf :subname)
         notifications (.getNotifications conn)]
-    (when (not (nil? notifications))
+    (when (or (not (nil? notifications))
+              (and force-check-table?
+                   (not (empty? (exec-sql "SELECT * FROM irmgard.row_changes LIMIT 1" [])))))
       (log/infof "dispatch-notifications[%s]: %s notifications" dbname (count notifications))
       (process-row-changes conf conn))))

@@ -120,16 +120,18 @@
   ;;    close database connection, ensure we do that in a finally block
   (jdbc/with-connection (db-conn-info (:dbconf conf))
     (jdbc/do-commands "LISTEN irmgard")
-    (let [conn       (jdbc/find-connection)
-          dbname     (-> conf :dbconf :subname)
-          sleep-time (:sleep-time conf 1000)]
+    (let [conn                (jdbc/find-connection)
+          dbname              (-> conf :dbconf :subname)
+          sleep-time          (:sleep-time conf 1000)
+          table-check-every-n (:table-check-every-n conf 10)]
       (loop [conf     conf
-             continue (.get (:continue conf))]
+             continue (.get (:continue conf))
+             times    0]
         (if continue
           (do
-            (log/infof "db-watcher[%s] polling" dbname)
+            (log/infof "db-watcher[%s] polling (delay=%s)" dbname sleep-time)
             (try
-             (dispatch-notifications conf conn)
+             (dispatch-notifications conf conn (zero? (mod times table-check-every-n)))
              (catch Exception e
                (log/errorf e "Error dispatching notifications.  Some updates failed to propigate! Retry will occurr on next NOTIFY.  Error: %s" e)))
             (try
@@ -137,7 +139,9 @@
              (catch Exception e
                ;; do nothing. sleep interrupted by notify
                ))
-            (recur conf (.get (:continue conf))))
+            (recur conf
+                   (.get (:continue conf))
+                   (inc times)))
           (do
             (log/infof "db-watcher[%s] terminating" dbname)))))))

@@ -147,7 +151,8 @@
         watcher-config {:conf     conf
                         :error    (atom nil)
                         :continue control-atom
-                        :dbconf   conf}
+                        :dbconf   conf
+                        :sleep-time (:sleep-time conf)}
         watcher-thread (Thread. (fn [] (db-watcher watcher-config)))]
     (swap! db-watchers assoc wname (assoc watcher-config :thread watcher-thread))
     (.start watcher-thread)))


add a little note

add a little note

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -294,7 +294,8 @@
                     (map (fn [[k v]] [k (if v
                                          [string-index v]
                                          [])])
-                         (parse-guitar-tab-line tab-line)))))))))
-
-
-)
+                         (parse-guitar-tab-line tab-line))))))))))
+
+;; ok, listening to the version on youtube, we realize that the song is
+;; in a different key. we're not accounting for the Capo in the tab.
+;; that... is left as an exercise


Make the commit hook work.

Make the commit hook work.

--- src/circle/web/views/github_commit_hook.clj
+++ src/circle/web/views/github_commit_hook.clj
@@ -68,11 +68,12 @@
     (fail-email build build-result)))

 (defn process-json [github-json]
-  (when (= (-> github-json :repository :name "CircleCI"))
+  (def last-json github-json)
+  (when (= "CircleCI" (-> github-json :repository :name))
     (let [build (merge circle/circle-deploy
                        {:vcs-type :git
                         :vcs-url (-> github-json :repository :url)
-                        :vcs-revision (-> github-json :commits first)})
+                        :vcs-revision (-> github-json :commits last :id)})
           result (build/run-build build)]
       (email/send :to (-> github-json :owner :email)
                   :subject (email-subject result)
@@ -80,6 +81,7 @@

 (defpage [:post "/github-commit"] []
   (infof "github post: %s" *request*)
-  (let [body (-> *request* :body)
-        github-json (json/decode body)]
-    (future (process-json github-json))))+  (def last-request *request*)
+  (let [github-json (json/decode (-> *request* :params :payload))]
+    (future (process-json github-json))
+    {:status 200 :body ""}))


comments and ideas

comments and ideas

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -564,9 +564,6 @@
 ;; - Everything is done at compile time (and can be tested)
 ;; --------------------------------------------------------

-;; TODO - factorize the walks (start by showing this factoring)
-;; TODO - optimize the expression
-
 (def computation-tree [+ :a [* :b :c]])

 (defn keyword->symbol [k] (-> k name symbol))
@@ -615,8 +612,11 @@
     (vector? node) (apply (first node) (rest node))
     :else node))

-;; Phase 2: optimizing the code and creating types
-;; for commonly used expressions.
+;; Phase 2:
+;; Optimizing and creating types for commonly used expressions.
+;; - We can compile the expression
+;; - TODO: we can optimize it first
+;; Explain the link with expression templates

 (defn compile-eval-expr
   "Compile the expression in optimal code"


Improve pause-on-error middleware by printing stacktrace on screen in addition to printing it in REPL.

--- src/clj/quil/middlewares/pause_on_error.clj
+++ src/clj/quil/middlewares/pause_on_error.clj
@@ -25,9 +25,10 @@
       (q/text-size 15)
       (let [{:keys [name exception time]} @pause
             str [(format "Sketch was paused due to an exception thrown in %s" name)
-                 (str "Check REPL or console for stacktrace")
                  (str "Time: " time)
-                 (str "Fix the error and then press any key to unpause sketch.")]]
+                 (str "Fix the error and then press any key to unpause sketch.")
+                 (str "Stacktrace (or check REPL output):")
+                 (with-out-str (print-cause-trace exception))]]
         (q/text (join \newline str) 10 20))
       (q/pop-style))
     (q/set-image 0 0 error)))


Fix url raw productionˆ

Fix url raw productionˆ

--- src/clj_simple_chart/ncs/raw_production.clj
+++ src/clj_simple_chart/ncs/raw_production.clj
@@ -42,7 +42,7 @@
 (defn prev-12-months-num-days [s]
   (apply + (mapv #(.lengthOfMonth %) (mapv year-month (prev-12-months s)))))

-(def field-monthly-production-url "http://factpages.npd.no/ReportServer?/FactPages/TableView/field_production_monthly&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=80.213.237.130&CultureCode=en")
+(def field-monthly-production-url "https://factpages.npd.no/ReportServer_npdpublic?/FactPages/TableView/field_production_monthly&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.220.29.120&CultureCode=en")
 (defonce raw-data (-> field-monthly-production-url
                       (client/get)
                       (:body)


Add cycle detection at find ancestor

Add cycle detection at find ancestor

--- src/com/wsscode/pathom/connect/planner.cljc
+++ src/com/wsscode/pathom/connect/planner.cljc
@@ -749,11 +749,16 @@
 (defn find-first-ancestor
   "Traverse node after-node chain and returns the most distant ancestor node id."
   [graph node-id]
-  (loop [node-id node-id]
-    (let [{::keys [after-node]} (get-node graph node-id)]
-      (if after-node
-        (recur after-node)
-        node-id))))
+  (loop [node-id' node-id
+         visited  #{}]
+    (if (contains? visited node-id')
+      (do
+        (println "Ancestors Cycle detected" visited node-id')
+        node-id)
+      (let [{::keys [after-node]} (get-node graph node-id')]
+        (if after-node
+          (recur after-node (conj visited node-id'))
+          node-id')))))

 (defn push-root-to-ancestor [graph node-id]
   (set-root-node graph (find-first-ancestor graph node-id)))


fix link

fix link

--- src-cljs/room/core.cljs
+++ src-cljs/room/core.cljs
@@ -120,7 +120,7 @@
              author (:author message)]
          [:div.message {:key id}
           [:a.avatar {:href (:name author)}
-           [:img {:src (str "www.gravatar.com/avatar/" (:hash author) "?s=30")}]]
+           [:img {:src (str "//www.gravatar.com/avatar/" (:hash author) "?s=30")}]]
           [:div.message-body
            [:a.username {:href (:name author)} (:name author)]
            [:span.time (.format (.local (.utc js/moment (:time message))) "h:mm a")]


Catch unrecoverable peer group errors. Exit for recovery speed.

--- src/onyx/peer/peer_group_manager.clj
+++ src/onyx/peer/peer_group_manager.clj
@@ -360,12 +360,11 @@
                                (-> next-state
                                    (action [:apply-log-entry])
                                    (action [:monitor])))))]
-       (when (and new-state (not= ch shutdown-ch))
+       (if (and new-state (not= ch shutdown-ch))
          (recur new-state))))
-      (catch Exception t
-        (error t (format "Error caught in PeerGroupManager loop. Parking for % ms and restarting peer group." peer-group-error-backoff-ms))
-        (LockSupport/parkNanos (ms->ns peer-group-error-backoff-ms))
-        (peer-group-manager-loop (action state [:restart-peer-group])))))
+   (catch Exception t
+     (error t (format "Unrecoverable error caught in PeerGroupManager loop. Exiting."))
+     (System/exit 1))))

 (defrecord PeerGroupManager [peer-config onyx-vpeer-system-fn]
   component/Lifecycle


Cleanup core ns form

Cleanup core ns form

--- ClojureScript/src/clik_clak_joe/core.cljs
+++ ClojureScript/src/clik_clak_joe/core.cljs
@@ -1,2 +1 @@
-(ns clik-clak-joe.core
-  #_(:require [reactnative :as rn]))
+(ns clik-clak-joe.core)


fns for adding and editing book reviews

fns for adding and editing book reviews

--- src/myshelf/core.clj
+++ src/myshelf/core.clj
@@ -190,3 +190,33 @@
          :content
          (map element->map)
          (map (comp (juxt :title :id :author) :best_book :work)))))
+
+(defn add-book-review
+  [consumer access-token book-id rating & [review-text]]
+  (let [review-url "https://www.goodreads.com/review"
+        params (merge {:format "xml"
+                       :book_id book-id
+                       (keyword "review[rating") rating
+                       :shelf "read"}
+                      (when review-text
+                        {(keyword "review[review]") review-text}))]
+    (make-auth-request-POST consumer
+                            access-token
+                            review-url
+                            params)))
+
+(defn edit-book-review
+  [consumer access-token review-id new-rating & [review-text]]
+  (let [review-url (str "https://www.goodreads.com/review/"
+                        review-id
+                        ".xml")
+        params (merge {:id review-id
+                       (keyword "review[rating]") new-rating
+                       :finished true
+                       :shelf "read"}
+                      (when review-text
+                        {(keyword "review[review]") review-text}))]
+    (make-auth-request-PUT consumer
+                           access-token
+                           review-url
+                           params)))


Overridable host.

Overridable host.

--- src/riemann/jvm_profiler.clj
+++ src/riemann/jvm_profiler.clj
@@ -3,22 +3,21 @@
             [riemann.client.http :as client])
   (:import (java.lang StackTraceElement)))

-(defn http-client
-  [& args]
-  (apply client/client args))
+(def http-client client/client)
+(def localhost client/localhost)

-(def tags
-  ["jvm" "profile"])
+(def tags ["jvm" "profile"])

 (defn report
   "Send information about stack statistics to Riemann."
-  [client dt prefix stats]
+  [client dt host prefix stats]
   (let [{:keys [rate sample]} stats]
     (->> sample
          stack/hotspots
          (map (fn [[^StackTraceElement frame
                     {:keys [self-time top-trace top-trace-time]}]]
-                {:service     (str prefix "profiler fn "
+                {:host        (or host (client/localhost))
+                 :service     (str prefix "profiler fn "
                                    (.getClassName frame) " "
                                    (.getMethodName frame))
                  :file        (.getFileName frame)
@@ -28,7 +27,8 @@
                  :metric      self-time
                  :ttl         (* 2 dt)
                  :tags        tags}))
-         (concat [{:service (str prefix "profiler rate")
+         (concat [{:host    host
+                   :service (str prefix "profiler rate")
                    :state   "ok"
                    :metric  rate
                    :ttl     (* 2 dt)
@@ -47,6 +47,7 @@
               breaking Hadoop. Shoot me a PR?
   :prefix     Service prefix for distinguishing this telemetry from other apps
               (default \"\")
+  :host       Override the hostname (default: nil; calls (localhost))
   :dt         How often to send telemetry events to Riemann, in seconds
               (default 5)
   :load       Target fraction of one core's CPU time to use for profiling
@@ -56,7 +57,10 @@
   (let [dt (or (:dt opts) 5)]
     (stack/start (or (:load opts) 0.02)
                  dt
-                 (partial report (:client opts) dt (or (:prefix opts) "")))))
+                 (partial report (:client opts)
+                          dt
+                          (:host opts)
+                          (or (:prefix opts) "")))))

 (defn stop!
   "Stop profiling."


Re-implement core to gain performance and simplify code #44 - removed references to obsolete namespaces

--- src/flatgui/samples/forms/bookpanelmain.clj
+++ src/flatgui/samples/forms/bookpanelmain.clj
@@ -28,7 +28,7 @@
 ;    "flatgui.skins.smooth"))

 (def bookpanel
-  (flatgui._old_app/defroot
+  (fg/defroot
     (fg/defcomponent panel/panel :main
       {:clip-size (m/defpoint 25 19 0)
        :background (awt/color 0 38 70)


FIX <

FIX <

--- src/oi_lang/obj.cljs
+++ src/oi_lang/obj.cljs
@@ -116,8 +116,9 @@
 (defn oi-number [n]
   {:type  :number
    :value n
-   :slots {"<" (fn [{:keys [value]}]
-                 (oi-boolean (< n value)))}
+   :slots {"<" (fn [param]
+                 (println n "<" param)
+                 (oi-boolean (< n (:value param))))}
    :proto initial})

 (defn oi-string [s]
@@ -135,7 +136,7 @@
   ([name args]
    {:type  :message
     :value name
-    :slots {:args args}
+    :slots {:args (vec args)}
     :proto initial}))

 (defn oi-send [target msg]
@@ -153,7 +154,7 @@
     [:boolean b]
     (oi-boolean (= b "true"))
     [:send target msg]
-    (oi-send target (ast->runtime msg))
+    (oi-send (ast->runtime target) (ast->runtime msg))
     [:message name]
     (oi-message name)
     [:message name [:arglist & args]]
@@ -174,10 +175,22 @@
     {:type :number :value n} {:env env :result n}
     {:type :string :value s} {:env env :result (str \" s \")}
     {:type :boolean :value b} {:env env :result b}
+    {:type :send :slots {:target target :message {:type :message :value slot-name :slots {:args args}}}}
+    (do
+      (println "send" target slot-name args)
+      (activate target (lookup-slot target slot-name) args))
+    {:type :send :slots {:target target :message {:type :message :value slot-name}}}
+    (do
+      (println "send-without-args" target slot-name)
+      (activate target (lookup-slot target slot-name) []))
     {:type :message :value slot-name :slots {:args args}}
-    (activate env (lookup-slot env slot-name) args)
+    (do
+      (println "message" slot-name args)
+      (activate env (lookup-slot env slot-name) args))
     {:type :message :value slot-name}
-    (activate env (lookup-slot env slot-name) [])))
+    (do
+      (println "message-without-args" slot-name)
+      (activate env (lookup-slot env slot-name) []))))

 (defn eval*
   ([env exprs] (:result (reduce eval {:env env :result nil} exprs)))


CMR-2905: Removing proto repl saved values call.

--- access-control-app/src/cmr/access_control/data/access_control_index.clj
+++ access-control-app/src/cmr/access_control/data/access_control_index.clj
@@ -233,7 +233,6 @@
   (let [acl (edn/read-string (:metadata concept-map))
         permitted-groups (acl->permitted-groups acl)
         provider-id (acls/acl->provider-id acl)]
-    (proto-repl.saved-values/save 3)
     (assoc (select-keys concept-map [:concept-id :revision-id])
            :display-name (acl->display-name acl)
            :identity-type (acl->identity-type acl)


Fixed encoding of strings to only occur when writing files as json in response to Dan's code review.

--- src/pamela/utils.clj
+++ src/pamela/utils.clj
@@ -80,7 +80,7 @@
                             (if (fs/absolute? filename)
                               (fs/file filename)
                               (fs/file (get-cwd) filename)))
-          data (encode-ir-tokens-as-strings data)
+          data (if (= file-format "json") (encode-ir-tokens-as-strings data) data) ; Only for JSON files
           data (if (map? data)
                  ;; (if (= file-format "edn-mixed")
                  ;;   (sort-mixed-map data)