add many missing docstrings to the standard lib

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -95,10 +95,14 @@
   [x]
   (coercive-= x nil))

-(defn ^boolean array? [x]
+(defn ^boolean array?
+  "Returns true if x is a JavaScript array."
+  [x]
   (cljs.core/array? x))

-(defn ^boolean number? [n]
+(defn ^boolean number?
+  "Returns true if x is a JavaScript number."
+  [n]
   (cljs.core/number? n))

 (defn ^boolean not
@@ -109,12 +113,16 @@
   "Returns true if x is not nil, false otherwise."
   [x] (not (nil? x)))

-(defn ^boolean object? [x]
+(defn ^boolean object?
+  "Returns true if x's constructor is Object"
+  [x]
   (if-not (nil? x)
     (identical? (.-constructor x) js/Object)
     false))

-(defn ^boolean string? [x]
+(defn ^boolean string?
+  "Returns true if x is a JavaScript string."
+  [x]
   (goog/isString x))

 (set! *unchecked-if* true)
@@ -138,7 +146,9 @@
   argv as arguments"}
   *main-cli-fn* nil)

-(defn type [x]
+(defn type
+  "Return x's constructor."
+  [x]
   (when-not (nil? x)
     (.-constructor x)))

@@ -169,6 +179,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; arrays ;;;;;;;;;;;;;;;;

 (defn ^array make-array
+  "Construct a JavaScript array of specified size. Accepts ignored type
+  argument for compatibility with Clojure."
   ([size]
      (js/Array. size))
   ([type size]
@@ -219,6 +231,8 @@
 (declare reduce)

 (defn ^array into-array
+  "Returns an array with components set to the values in aseq. Optional type
+  argument accepted for compatibility with Clojure."
   ([aseq]
      (into-array nil aseq))
   ([type aseq]
@@ -544,7 +558,10 @@
       h
       (add-to-string-hash-cache k))))

-(defn hash [o]
+(defn hash
+  "Returns the hash code of its argument. Note this is the hash code
+   consistent with =."
+  [o]
   (cond
     (implements? IHash o)
     (-hash ^not-native o)
@@ -574,10 +591,15 @@
       (bit-shift-left seed 6)
       (bit-shift-right seed 2))))

-(defn ^boolean instance? [t o]
+(defn ^boolean instance?
+  "Evaluates x and tests if it is an instance of the type
+  c. Returns true or false"
+  [t o]
   (cljs.core/instance? t o))

-(defn ^boolean symbol? [x]
+(defn ^boolean symbol?
+  "Return true if x is a Symbol"
+  [x]
   (instance? Symbol x))

 (defn- hash-symbol [sym]
@@ -698,13 +720,19 @@

 (declare array-seq prim-seq IndexedSeq)

-(defn iterable? [x]
+(defn iterable?
+  "Return true if x implements IIterable protocol."
+  [x]
   (satisfies? IIterable x))

-(defn clone [value]
+(defn clone
+  "Clone the supplied value which must implement ICloneable."
+  [value]
   (-clone value))

-(defn cloneable? [value]
+(defn cloneable?
+  "Return true if x implements ICloneable protocol."
+  [value]
   (satisfies? ICloneable value))

 (defn ^seq seq
@@ -791,7 +819,9 @@
         #js {:value x :done false})
       #js {:value nil :done true})))

-(defn es6-iterator [coll]
+(defn es6-iterator
+  "EXPERIMENTAL: Return a ES2015 compatible iterator for coll."
+  [coll]
   (ES6Iterator. (seq coll)))

 (declare es6-iterator-seq)
@@ -806,7 +836,9 @@
       (set! _rest (es6-iterator-seq iter)))
     _rest))

-(defn es6-iterator-seq [iter]
+(defn es6-iterator-seq
+  "EXPERIMENTAL: Given an ES2015 compatible iterator return a seq."
+  [iter]
   (let [v (.next iter)]
     (if (.-done v)
       ()
@@ -922,6 +954,10 @@
 ;; generic to all refs
 ;; (but currently hard-coded to atom!)
 (defn deref
+  "Also reader macro: @var/@atom/@delay. Returns the
+   most-recently-committed value of ref. When applied to a var
+   or atom, returns its current state. When applied to a delay, forces
+   it if not already forced. See also - realized?."
   [o]
   (-deref o))

@@ -1079,6 +1115,7 @@
 (es6-iterable IndexedSeq)

 (defn prim-seq
+  "Create seq from a primitive JavaScript Array-like."
   ([prim]
      (prim-seq prim 0))
   ([prim i]
@@ -1086,6 +1123,7 @@
        (IndexedSeq. prim i))))

 (defn array-seq
+  "Create a seq from a JavaScript array."
   ([array]
      (prim-seq array 0))
   ([array i]
@@ -1398,7 +1436,9 @@
           (recur ret (first ks) (next ks))
           ret)))))

-(defn ^boolean fn? [f]
+(defn ^boolean fn?
+  "Return true if f is a JavaScript function or satisfies the Fn protocol."
+  [f]
   (or ^boolean (goog/isFunction f) (satisfies? Fn f)))

 (deftype MetaFn [afn meta]
@@ -1549,21 +1589,28 @@
 (declare ChunkedCons ChunkedSeq)

 (defn ^boolean chunked-seq?
+  "Return true if x is satisfies IChunkedSeq."
   [x] (implements? IChunkedSeq x))

 ;;;;;;;;;;;;;;;;;;;; js primitives ;;;;;;;;;;;;
 (defn js-obj
+  "Create JavaSript object from an even number arguments representing
+  interleaved keys and values."
   ([]
      (cljs.core/js-obj))
   ([& keyvals]
      (apply gobject/create keyvals)))

-(defn js-keys [obj]
+(defn js-keys
+  "Return the JavaScript keys for an object."
+  [obj]
   (let [keys (array)]
     (goog.object/forEach obj (fn [val key obj] (.push keys key)))
     keys))

-(defn js-delete [obj key]
+(defn js-delete
+  "Delete a property from a JavaScript object."
+  [obj key]
   (cljs.core/js-delete obj key))

 (defn- array-copy
@@ -1594,7 +1641,9 @@
   "Returns true if x is the value true, false otherwise."
   [x] (cljs.core/true? x))

-(defn ^boolean undefined? [x]
+(defn ^boolean undefined?
+  "Returns true if x identical to the JavaScript undefined value."
+  [x]
   (cljs.core/undefined? x))

 (defn ^boolean seq?
@@ -1609,10 +1658,14 @@
   [s]
   (satisfies? ISeqable s))

-(defn ^boolean boolean [x]
+(defn ^boolean boolean
+  "Coerce to boolean"
+  [x]
   (if x true false))

-(defn ^boolean ifn? [f]
+(defn ^boolean ifn?
+  "Returns true if f returns true for fn? or satisfies IFn."
+  [f]
   (or (fn? f) (satisfies? IFn f)))

 (defn ^boolean integer?
@@ -1815,9 +1868,14 @@
       (-kv-reduce coll f init)
       init)))

-(defn identity [x] x)
+(defn identity
+  "Returns its argument."
+  [x] x)

 (defn completing
+  "Takes a reducing function f of 2 args and returns a fn suitable for
+  transduce by adding an arity-1 signature that calls cf (default -
+  identity) on the result argument."
   ([f] (completing f identity))
   ([f cf]
     (fn
@@ -1974,10 +2032,14 @@
   ([x y] (cljs.core/unchecked-add-int x y))
   ([x y & more] (reduce unchecked-add-int (cljs.core/unchecked-add-int x y) more)))

-(defn unchecked-dec [x]
+(defn unchecked-dec
+  "Returns a number one less than x, an int."
+  [x]
   (cljs.core/unchecked-dec x))

-(defn unchecked-dec-int [x]
+(defn unchecked-dec-int
+  "Returns a number one less than x, an int."
+  [x]
   (cljs.core/unchecked-dec-int x))

 (defn ^number unchecked-divide-int
@@ -2176,7 +2238,9 @@
   "Returns true if num is greater than zero, else false"
   [n] (cljs.core/pos? n))

-(defn ^boolean zero? [n]
+(defn ^boolean zero?
+  "Returns true if num is zero, else false"
+  [n]
   (cljs.core/zero? n))

 (defn ^boolean neg?
@@ -2392,10 +2456,15 @@

 (es6-iterable EmptyList)

-(defn ^boolean reversible? [coll]
+(defn ^boolean reversible?
+  "Returns true if coll satisfies? IReversible."
+  [coll]
   (satisfies? IReversible coll))

-(defn ^seq rseq [coll]
+(defn ^seq rseq
+  "Returns, in constant time, a seq of the items in rev (which
+  can be a vector or sorted-map), in reverse order. If rev is empty returns nil"
+  [coll]
   (-rseq coll))

 (defn reverse
@@ -2405,7 +2474,9 @@
     (rseq coll)
     (reduce conj () coll)))

-(defn list [& xs]
+(defn list
+  "Creates a new list containing the items."
+  [& xs]
   (let [arr (if (and (instance? IndexedSeq xs) (zero? (.-i xs)))
               (.-arr xs)
               (let [arr (array)]
@@ -2477,7 +2548,9 @@
     (Cons. nil x coll nil)
     (Cons. nil x (seq coll) nil)))

-(defn ^boolean list? [x]
+(defn ^boolean list?
+  "Returns true if x implements IList"
+  [x]
   (satisfies? IList x))

 (defn hash-keyword [k]
@@ -2523,10 +2596,14 @@
   IPrintWithWriter
   (-pr-writer [o writer _] (-write writer (str ":" fqn))))

-(defn ^boolean keyword? [x]
+(defn ^boolean keyword?
+  "Return true if x is a Keyword"
+  [x]
   (instance? Keyword x))

-(defn ^boolean keyword-identical? [x y]
+(defn ^boolean keyword-identical?
+  "Efficient test to determine that two keywords are identical."
+  [x y]
   (if (identical? x y)
     true
     (if (and (keyword? x)
@@ -2783,6 +2860,8 @@
       ret))

 (defn int-array
+  "Creates an array of ints. Does not coerce array, provided for compatibility
+  with Clojure."
   ([size-or-seq]
      (if (number? size-or-seq)
        (int-array size-or-seq nil)
@@ -2803,6 +2882,8 @@
            a)))))

 (defn long-array
+  "Creates an array of longs. Does not coerce array, provided for compatibility
+  with Clojure."
   ([size-or-seq]
      (if (number? size-or-seq)
        (long-array size-or-seq nil)
@@ -2823,6 +2904,8 @@
            a)))))

 (defn double-array
+  "Creates an array of doubles. Does not coerce array, provided for compatibility
+  with Clojure."
   ([size-or-seq]
      (if (number? size-or-seq)
        (double-array size-or-seq nil)
@@ -2843,6 +2926,8 @@
            a)))))

 (defn object-array
+  "Creates an array of objects. Does not coerce array, provided for compatibility
+  with Clojure."
   ([size-or-seq]
      (if (number? size-or-seq)
        (object-array size-or-seq nil)
@@ -4478,7 +4563,10 @@

 (es6-iterable PersistentVector)

-(defn vec [coll]
+(defn vec
+  "Creates a new vector containing the contents of coll. JavaScript arrays
+  will be aliased and should not be modified."
+  [coll]
   (if (array? coll)
     (.fromArray PersistentVector coll true)
     (-persistent!
@@ -4486,7 +4574,9 @@
         (-as-transient (.-EMPTY PersistentVector))
         coll))))

-(defn vector [& args]
+(defn vector
+  "Creates a new vector containing the args."
+  [& args]
   (if (and (instance? IndexedSeq args) (zero? (.-i args)))
     (.fromArray PersistentVector (.-arr args) true)
     (vec args)))
@@ -7604,6 +7694,8 @@
           (-persistent! out))))))

 (defn hash-set
+  "Returns a new hash set with supplied keys.  Any equal keys are
+  handled as if by repeated uses of conj."
   ([] #{})
   ([& keys] (set keys)))

@@ -7661,7 +7753,9 @@
       (step coll #{}))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defn butlast [s]
+(defn butlast
+  "Return a seq of all but the last item in coll, in linear time"
+  [s]
   (loop [ret [] s s]
     (if (next s)
       (recur (conj ret (first s)) (next s))
@@ -8062,8 +8156,10 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;; Regular Expressions ;;;;;;;;;;

-(defn regexp? [o]
-  (instance? js/RegExp o))
+(defn regexp?
+  "Returns true if x is a JavaScript RegExp instance."
+  [x]
+  (instance? js/RegExp x))

 (defn re-matches
   "Returns the result of (re-find re s) if re fully matches s."


Alias for mappend

Alias for mappend

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -421,3 +421,5 @@
   the inner value of a container."
   [v]
   (p/extract v))
+
+(def <> mappend)


Fix broken API links.

Fix broken API links.

--- src/cljx/quil/core.cljx
+++ src/cljx/quil/core.cljx
@@ -1223,8 +1223,8 @@

 (defn
   ^{:requires-bindings true
-    :processing-name "fillColor()"
-    :processing-link "http://processing.org/reference/javadoc/core/processing/core/PGraphics.html#fillColor"
+    :processing-name "PGraphics.fillColor"
+    :processing-link "http://processing.github.io/processing-javadocs/core/processing/core/PGraphics.html#fillColor"
     :category "Color"
     :subcategory "Creating & Reading"}
   current-fill
@@ -1234,8 +1234,8 @@

 (defn
   ^{:requires-bindings true
-    :processing-name "strokeColor()"
-    :processing-link "http://processing.org/reference/javadoc/core/processing/core/PGraphics.html#strokeColor"
+    :processing-name "PGraphics.strokeColor"
+    :processing-link "http://processing.github.io/processing-javadocs/core/processing/core/PGraphics.html#strokeColor"
     :category "Color"
     :subcategory "Creating & Reading"}
   current-stroke


Allowing coordinate system to be set on geodetic and cartesian rings. This allows them to 'change' their coordinate system.

--- src/cmr/umm/spatial.clj
+++ src/cmr/umm/spatial.clj
@@ -4,9 +4,13 @@
             [cmr.spatial.point :as p]
             [cmr.spatial.polygon]
             [cmr.spatial.line-string]
+            [cmr.spatial.geodetic-ring :as gr]
+            [cmr.spatial.cartesian-ring :as cr]
             [cmr.common.services.errors :as errors]
             [cmr.common.dev.record-pretty-printer :as record-pretty-printer])
   (:import cmr.spatial.polygon.Polygon
+           cmr.spatial.geodetic_ring.GeodeticRing
+           cmr.spatial.cartesian_ring.CartesianRing
            cmr.spatial.line_string.LineString))

 ;; Represents a ring in which the coordinate system is not known at the time the data is constructed/
@@ -50,6 +54,14 @@
   [coordinate-system line]
   (assoc line :coordinate-system coordinate-system))

+(defmethod set-coordinate-system GeodeticRing
+  [coordinate-system {:keys [points]}]
+  (rr/ring coordinate-system points))
+
+(defmethod set-coordinate-system CartesianRing
+  [coordinate-system {:keys [points]}]
+  (rr/ring coordinate-system points))
+
 (defmethod set-coordinate-system GenericRing
   [coordinate-system {:keys [points]}]
   (rr/ring coordinate-system points))


Increased timeout for client's requests.

--- client/src/ipogudin/collie/client/events.cljs
+++ client/src/ipogudin/collie/client/events.cljs
@@ -47,7 +47,7 @@
      :http-xhrio  {:method          :post
                    :uri             (:api-root @configuration/configuration)
                    :params          (p/request [(p/get-entities-command type ::p/resolved-dependencies true)])
-                   :timeout         1000
+                   :timeout         30000
                    :format          (ajax/edn-request-format)
                    :response-format (ajax/edn-response-format)
                    :on-success      [:set-selected-entities]
@@ -84,7 +84,7 @@
          :http-xhrio  {:method          :post
                        :uri             (:api-root @configuration/configuration)
                        :params          (p/request commands)
-                       :timeout         1000
+                       :timeout         30000
                        :format          (ajax/edn-request-format)
                        :response-format (ajax/edn-response-format)
                        :on-success      [:set-dependencies-for-entity]
@@ -133,7 +133,7 @@
      :http-xhrio  {:method          :post
                    :uri             (:api-root @configuration/configuration)
                    :params          (p/request [(p/upsert-command entity)])
-                   :timeout         1000
+                   :timeout         30000
                    :format          (ajax/edn-request-format)
                    :response-format (ajax/edn-response-format)
                    :on-success      [:complete-editing]
@@ -151,7 +151,7 @@
        :http-xhrio  {:method          :post
                      :uri             (:api-root @configuration/configuration)
                      :params          (p/request [(p/delete-command t pk)])
-                     :timeout         1000
+                     :timeout         30000
                      :format          (ajax/edn-request-format)
                      :response-format (ajax/edn-response-format)
                      :on-success      [:complete-editing]


Fix add-step-definition for :after to add to After hooks

--- clojure/src/main/clj/cucumber/runtime/clj.clj
+++ clojure/src/main/clj/cucumber/runtime/clj.clj
@@ -105,7 +105,7 @@
                                  (filter #(= "invoke" (.getName %)))
                                  (map #(count (.getParameterTypes %)))
                                  (apply max))]
-    (.addBeforeHook
+    (.addAfterHook
      @glue
      (reify
        HookDefinition


Fix test

Fix test

--- test/asciinema_player/core_test.cljs
+++ test/asciinema_player/core_test.cljs
@@ -46,6 +46,6 @@
     (is (= (c/next-frames frames 12) []))
     (is (= (c/next-frames frames 13) []))))

-(deftest frames-json->clj-test
-  (let [frames [[1.2 {"lines" {"0" [["foo" {"fg" 1}]] "1" [["bar" {"bg" 2}]]} "cursor" {"x" 1 "y" 2 "visible" false}}]]]
-    (is (= (c/frames-json->clj frames) [[1.2 {:lines {0 [["foo" {:fg 1}]] 1 [["bar" {:bg 2}]]} :cursor {:x 1 :y 2 :visible false}}]]))))
+(deftest fix-frames-test
+  (let [frames [[1.2 {:lines {:0 [["foo" {:fg 1}]] :1 [["bar" {:bg 2}]]} :cursor {:x 1 :y 2 :visible false}}]]]
+    (is (= (c/fix-frames frames) [[1.2 {:lines {0 [["foo" {:fg 1}]] 1 [["bar" {:bg 2}]]} :cursor {:x 1 :y 2 :visible false}}]]))))


Add detailed assertions to concurrency distribution function test case

--- test/clj_gatling/simulation_test.clj
+++ test/clj_gatling/simulation_test.clj
@@ -498,6 +498,8 @@
       (is (= {:value 1} @context-to-fn)))
     (testing "Progress goes from 0 to 1"
       (is (every? #(and (>= % 0.0) (<= % 1.0)) @progress-distribution))
+      (is #{0.1} @progress-distribution)
+      (is #{1.0} @progress-distribution)
       (is (= (sort @progress-distribution) @progress-distribution)))))

 (deftest scenario-weight


draw nodes based on delta from previous state, instead of redrawing entire state each time

--- src/viz/core.cljs
+++ src/viz/core.cljs
@@ -44,15 +44,15 @@

 (defn- new-state []
   (-> {:frame-rate 30
-       :color-cycle-period 1
+       :color-cycle-period 3
        :background-color 0xFFFFFFFF
        :tail-length 7
        :frame 0
-       :grid-width 45 ; from the center
+       :grid-width 100 ; from the center
        :forest (forest/new-forest grid/isometric)
        }
       (set-grid-size)
-      (add-ghost {:start-pos [-10 -10]
+      (add-ghost {:start-pos [-1 -1]
                   :color-fn (fn [state]
                               (let [frames-per-color-cycle
                                     (* (:color-cycle-period state) (:frame-rate state))]
@@ -65,6 +65,7 @@

 (defn setup []
   (let [state (new-state)]
+    (q/smooth 0)
     (q/color-mode :hsb 1 1 1)
     (q/frame-rate (:frame-rate state))
     (q/background (:background-color state))
@@ -98,12 +99,12 @@
   (q/sqrt (dist-from-sqr pos1 pos2)))

 (defn take-adj-poss [grid-width pos adj-poss]
-  (let [dist-from-center (dist-from [0 0] pos)
-        width grid-width
+  (let [dist-from-center (dist-from-sqr [0 0] pos)
+        width (* grid-width grid-width)
         dist-ratio (/ (- width dist-from-center) width)
         ]
     (take
-      (int (* (q/map-range (rand) 0 1 0.75 1)
+      (int (* (q/map-range (rand) 0 1 0.1 1)
               dist-ratio
               (count adj-poss)))
       adj-poss)))
@@ -130,13 +131,20 @@
     (assoc state :ghosts (reverse ghosts) :forest forest)))

 (defn- ghost-incr [state poss-fn]
-  (update-ghost-forest state #(ghost/incr %1 %2 poss-fn)))
+  (let [state (update-ghost-forest state #(ghost/incr %1 %2 poss-fn))
+        forest (:forest state)
+        new-nodes (reduce (fn [new-nodes id]
+                            (conj new-nodes (forest/get-node forest id)))
+                          #{} (apply concat (map :active-node-ids (:ghosts state))))]
+    (assoc-in state [:delta-state :add-nodes] new-nodes)))

 (defn- rm-old-tails [state]
   (if (>= (:tail-length state) (:frame state)) state
-    (let [node-ids (map :id (forest/roots (:forest state)))]
-      (update-in state [:forest]
-                 #(reduce forest/remove-node % node-ids)))))
+    (let [nodes (forest/roots (:forest state))
+          node-ids (map :id nodes)]
+      (-> state
+          (update-in [:forest] #(reduce forest/remove-node % node-ids))
+          (assoc-in [:delta-state :rm-nodes] nodes)))))

 (defn- ghost-set-color [state]
   (update-ghost-forest state (fn [ghost forest]
@@ -161,11 +169,7 @@
         scaled-size (map int (scale-fn size))]
     (apply q/ellipse (concat scaled-pos scaled-size))))

-(defn- in-line? [& nodes]
-  (apply = (map #(apply map - %1)
-                (partition 2 1 (map :pos nodes)))))
-
-(defn- draw-node [node active? scale-fn]
+(defn- draw-node [node scale-fn]
   (let [pos (:pos node)
         stroke (get-in node [:meta :color])
         ]
@@ -173,62 +177,27 @@
     (q/fill stroke)
     (draw-ellipse pos [1 1] scale-fn)))

-(defn- draw-line [node parent scale-fn]
-  (let [node-color (get-in node [:meta :color])
-        parent-color (get-in node [:meta :color])
-        color (q/lerp-color node-color parent-color 0.5)
-        ]
-    (q/stroke color)
-    (q/stroke-weight 1)
-    (apply q/line (map scale-fn (map :pos (list parent node))))))
-
-(defn- draw-tree [forest parent node scale-fn]
-  "Draws the lines of all children leading from the node, recursively"
-  (draw-node node false scale-fn)
-  (let [children (map #(forest/get-node forest %) (:child-ids node))]
-    (doseq [child children] (draw-tree forest node child scale-fn))))
-
-(defn draw-dial [state dial posL posR]
-  (let [dial-norm (q/norm (:val dial) (:min dial) (:max dial))
-        dial-pos (map #(q/lerp %1 %2 dial-norm) posL posR)]
-    (q/stroke 0xFF000000)
-    (q/stroke-weight 1)
-    (q/fill   0xFF000000)
-    (apply q/line (concat posL posR))
-    (apply q/ellipse (concat dial-pos [5 5]))
-    ))
+(defn- clear-node [node bg-color scale-fn]
+  (let [pos (:pos node)]
+    (q/stroke bg-color)
+    (q/fill bg-color)
+    (draw-ellipse pos [1.5 1.5] scale-fn)))

 (defn draw-state [state]
   ; Clear the sketch by filling it with light-grey color.
-  (q/background (:background-color state))
   (q/with-translation window-half-size

     (let [grid-size (:grid-size state)
           scale-fn #(scale grid-size %)
-          ghost (:ghost state)
-          forest (:forest state)
-          roots (forest/roots forest)
           ]

-      (doseq [root roots]
-        (draw-tree forest nil root scale-fn))
-
-      (doseq [ghost (:ghosts state)]
-        (doseq [active-node (map #(forest/get-node forest %)
-                                 (:active-node-ids ghost))]
-          (draw-node active-node true scale-fn)))
+      (doseq [node (get-in state [:delta-state :rm-nodes])]
+        (clear-node node (:background-color state) scale-fn))
+
+      (doseq [node (get-in state [:delta-state :add-nodes])]
+        (draw-node node scale-fn))

       ))
-
-    ;(draw-dial state (:dial state) [30 30] [100 30])
-
-    ;(q/text (clojure.string/join
-    ;          "\n"
-    ;          (list
-    ;            (gstring/format "frame:%d" (:frame state))
-    ;            (gstring/format "second:%f" (curr-second state))
-    ;            (gstring/format "spawn-chance:%d" (spawn-chance state))))
-    ;        30 30)
   )

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Simplified corpus-to-tf-idf-data by using destructuring.

--- project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
+++ project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
@@ -54,10 +54,9 @@
   [corpus]
   (let [document-names (map #(% "item-name") corpus)
         document-texts (map #(% "item-text") corpus)
-        tf-idf-corpus (tf-idf (map to-terms document-texts))]
-    (concat
-      [(:idf tf-idf-corpus) (:all-terms tf-idf-corpus) document-names]
-      (:tf-idf tf-idf-corpus))))
+        {:keys [idf all-terms]
+         tf-idf-data :tf-idf} (tf-idf (map to-terms document-texts))]
+    (concat [idf all-terms document-names] tf-idf-data)))

 (defn csv-corpus-to-tf-idf-data!
   "Transform a csv containing a corpus of documents into a file of tf-idf


Use an MD5 hash for ETags

Use an MD5 hash for ETags

--- src/yada/etag.clj
+++ src/yada/etag.clj
@@ -1,4 +1,6 @@
-(ns yada.etag)
+(ns yada.etag
+  (:require
+   [yada.util :refer [md5-hash]]))

 (defprotocol ETag
   "The version function returns material that becomes the ETag response
@@ -11,6 +13,6 @@
 (extend-protocol ETag
   Object
   (to-etag [o rep]
-    (str (hash {:value o :representation rep})))
+    (md5-hash (str (hash {:value o :representation rep}))))
   nil
   (to-etag [o rep] nil))


instrument specs

instrument specs

--- test/id3_test.clj
+++ test/id3_test.clj
@@ -1,9 +1,13 @@
 (ns id3-test
 	(:import [java.io ByteArrayInputStream ByteArrayOutputStream])
 	(:require
+		[clojure.spec.test.alpha :as stest]
 		[clojure.test :refer :all]
 		[id3 :refer :all]
-		[id3.common :refer :all]))
+		[id3.common :refer :all]
+		[id3.spec]))
+
+(stest/instrument)

 (defn write-tag-to-bytes [tag & opts]
 	(let [buf (ByteArrayOutputStream.)]


♻ Rename example events to match event type

--- test/territory_bro/db_admin_test.clj
+++ test/territory_bro/db_admin_test.clj
@@ -14,45 +14,45 @@
 (def cong-id (UUID. 0 1))
 (def user-id (UUID. 0 2))
 (def test-time (Instant/ofEpochSecond 42))
-(def cong-created-event {:event/type :congregation.event/congregation-created
-                         :event/version 1
-                         :congregation/id cong-id
-                         :congregation/name "Cong1 Name"
-                         :congregation/schema-name "cong1_schema"})
-(def user-created-event {:event/type :congregation.event/gis-user-created
-                         :event/version 1
-                         :congregation/id cong-id
-                         :user/id user-id
-                         :gis-user/username "username123"
-                         :gis-user/password "password123"})
-(def user-deleted-event {:event/type :congregation.event/gis-user-deleted
-                         :event/version 1
-                         :congregation/id cong-id
-                         :user/id user-id
-                         :gis-user/username "username123"})
-(def schema-is-present-event {:event/type :db-admin.event/gis-schema-is-present
-                              :event/version 1
-                              :event/transient? true
-                              :event/system "test"
-                              :event/time test-time
-                              :congregation/id cong-id
-                              :congregation/schema-name "cong1_schema"})
-(def user-is-present-event {:event/type :db-admin.event/gis-user-is-present
+(def congregation-created {:event/type :congregation.event/congregation-created
+                           :event/version 1
+                           :congregation/id cong-id
+                           :congregation/name "Cong1 Name"
+                           :congregation/schema-name "cong1_schema"})
+(def gis-user-created {:event/type :congregation.event/gis-user-created
+                       :event/version 1
+                       :congregation/id cong-id
+                       :user/id user-id
+                       :gis-user/username "username123"
+                       :gis-user/password "password123"})
+(def gis-user-deleted {:event/type :congregation.event/gis-user-deleted
+                       :event/version 1
+                       :congregation/id cong-id
+                       :user/id user-id
+                       :gis-user/username "username123"})
+(def gis-schema-is-present {:event/type :db-admin.event/gis-schema-is-present
                             :event/version 1
                             :event/transient? true
                             :event/system "test"
                             :event/time test-time
                             :congregation/id cong-id
-                            :user/id user-id
-                            :gis-user/username "username123"})
-(def user-is-absent-event {:event/type :db-admin.event/gis-user-is-absent
-                           :event/version 1
-                           :event/transient? true
-                           :event/system "test"
-                           :event/time test-time
-                           :congregation/id cong-id
-                           :user/id user-id
-                           :gis-user/username "username123"})
+                            :congregation/schema-name "cong1_schema"})
+(def gis-user-is-present {:event/type :db-admin.event/gis-user-is-present
+                          :event/version 1
+                          :event/transient? true
+                          :event/system "test"
+                          :event/time test-time
+                          :congregation/id cong-id
+                          :user/id user-id
+                          :gis-user/username "username123"})
+(def gis-user-is-absent {:event/type :db-admin.event/gis-user-is-absent
+                         :event/version 1
+                         :event/transient? true
+                         :event/system "test"
+                         :event/time test-time
+                         :congregation/id cong-id
+                         :user/id user-id
+                         :gis-user/username "username123"})

 (defn- apply-events [events]
   (testutil/apply-events db-admin/projection events))
@@ -64,7 +64,7 @@

 (deftest generate-commands-test
   (testing "congregation created"
-    (let [events [cong-created-event]]
+    (let [events [congregation-created]]
       (is (= [{:command/type :db-admin.command/migrate-tenant-schema
                :command/time test-time
                :command/system "territory-bro.db-admin"
@@ -73,12 +73,12 @@
              (generate-commands events)))

       (testing "> GIS schema is present"
-        (let [events (conj events schema-is-present-event)]
+        (let [events (conj events gis-schema-is-present)]
           (is (empty? (generate-commands events)))

           ;; TODO: there could be a different process manager for dealing with GIS users
           (testing "> GIS user created"
-            (let [events (conj events user-created-event)]
+            (let [events (conj events gis-user-created)]
               (is (= [{:command/type :db-admin.command/ensure-gis-user-present
                        :command/time test-time
                        :command/system "territory-bro.db-admin"
@@ -90,11 +90,11 @@
                      (generate-commands events)))

               (testing "> GIS user is present"
-                (let [events (conj events user-is-present-event)]
+                (let [events (conj events gis-user-is-present)]
                   (is (empty? (generate-commands events)))

                   (testing "> GIS user password changed"
-                    (let [events (conj events (assoc user-created-event :gis-user/password "new password"))]
+                    (let [events (conj events (assoc gis-user-created :gis-user/password "new password"))]
                       (is (= [{:command/type :db-admin.command/ensure-gis-user-present
                                :command/time test-time
                                :command/system "territory-bro.db-admin"
@@ -106,7 +106,7 @@
                              (generate-commands events)))))

                   (testing "> GIS user deleted"
-                    (let [events (conj events user-deleted-event)]
+                    (let [events (conj events gis-user-deleted)]
                       (is (= [{:command/type :db-admin.command/ensure-gis-user-absent
                                :command/time test-time
                                :command/system "territory-bro.db-admin"
@@ -117,14 +117,14 @@
                              (generate-commands events)))

                       (testing "> GIS user is absent"
-                        (let [events (conj events user-is-absent-event)]
+                        (let [events (conj events gis-user-is-absent)]
                           (is (empty? (generate-commands events))))))))))))))))

 (deftest migrate-tenant-schema-test
   (let [spy (spy/spy)
         injections {:now (constantly test-time)
                     :migrate-tenant-schema! (spy/fn spy :migrate-tenant-schema!)}]
-    (is (= [schema-is-present-event]
+    (is (= [gis-schema-is-present]
            (db-admin/handle-command! {:command/type :db-admin.command/migrate-tenant-schema
                                       :command/time test-time
                                       :command/system "test"
@@ -138,7 +138,7 @@
   (let [spy (spy/spy)
         injections {:now (constantly test-time)
                     :ensure-gis-user-present! (spy/fn spy :ensure-gis-user-present!)}]
-    (is (= [user-is-present-event]
+    (is (= [gis-user-is-present]
            (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-present
                                       :command/time test-time
                                       :command/system "test"
@@ -157,7 +157,7 @@
   (let [spy (spy/spy)
         injections {:now (constantly test-time)
                     :ensure-gis-user-absent! (spy/fn spy :ensure-gis-user-absent!)}]
-    (is (= [user-is-absent-event]
+    (is (= [gis-user-is-absent]
            (db-admin/handle-command! {:command/type :db-admin.command/ensure-gis-user-absent
                                       :command/time test-time
                                       :command/system "test"


Changed the query structure.

Changed the query structure.

--- web/src/sound_effector/models/sound_effect.clj
+++ web/src/sound_effector/models/sound_effect.clj
@@ -14,7 +14,7 @@
   (loop [hits (:hits (:hits (esd/search (esr/connect es-spec)
                                         "sound_effector"
                                         "sound_effect"
-                                        :query (esq/term :title query))))
+                                        :query (esq/query-string {:query query}))))
          result []]
     (if (empty? hits)
       result


[Feature] MVP - Program accomplishes main task

--- folder-monitor/src/folder_monitor/core.clj
+++ folder-monitor/src/folder_monitor/core.clj
@@ -1,39 +1,42 @@
+; clojure-watch is a simple wrapper around the Java 7 WatchEvent API
+; clojure.java.io is the clojure wrapper around the Java filesystem API
 (ns folder-monitor.core
   (:gen-class)
-  (:require [clojure-watch.core :refer [start-watch]]))
+  (:require [clojure-watch.core :refer [start-watch]])
+  (:require [clojure.java.io :as io]))

 ; regex for identifying misnamed sookasa files
 ; also includes capturing groups so that filenames can be rearranged programatically
-(def sookasa-regex #"([^.]*)(\..*)(\(.*conflicted copy \d{4}-\d{2}-\d{2}\))\.sookasa")
+(def sookasa-regex #"([^.]*)(\..+)(\(.*conflicted copy \d{4}-\d{2}-\d{2}\))\.sookasa")

+; callback function is called everytime a file is created or modified
 (defn rename-file
   "Renames incorrectly named files to their proper form"
   [event filename]
   ; print the event and filename to the console - change this to a log file
   (println event filename)

-  ; destructuring to break apart regex groups
-  ; full-filename is the full filename
-  ; short-filename is the name of the file without the conflict parens and extensions
-  ; extension is the files extension (other than .sookasa)
-  ; conflict-string is the (users conflicted copy...) string
-  (let [[full-filename short-filename extension conflict-string]
-         (re-matches sookasa-regex filename)]
-    (println short-filename)
-    (println extension)
-    (println conflict-string)))
+  ; only do something if the regex pattern is found
+  (if (re-matches sookasa-regex filename)
+    ; destructuring to break apart regex groups
+    ; full-filename is the full filename
+    ; short-filename is the name of the file without the conflict parens and extensions
+    ; extension is the files extension (other than .sookasa)
+    ; conflict-string is the (users conflicted copy...) string
+    (let [[full-filename short-filename extension conflict-string]
+           (re-matches sookasa-regex filename)]
+      (def file-to-create (str short-filename conflict-string extension ".sookasa"))
+      ; rename the file
+      (.renameTo (io/file full-filename)
+                 (io/file file-to-create)))))

-  ; see if the modified files name matches the incorrect pattern
-  ; (println
-  ;   (re-matches sookasa-regex filename)))
-
+; main function that gets invoked when application starts
 (defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (println "Hello, World!")
-  ; Starst watching the folder and listening for changes
-  (start-watch [{:path "/home/richie/Desktop/sookasa"
-                 :event-types [:create :modify :delete]
+  ; expects one argument: Which path to watch for file changes
+  [watch-folder & args]
+  ; Starts watching the folder and listening for changes
+  (start-watch [{:path watch-folder
+                 :event-types [:create :modify]
                  :bootstrap (fn [path] (println "Starting to watch " path))
                  :callback rename-file
                  :options {:recursive true}}]))


Add subsystem fixture to test-utils

Add subsystem fixture to test-utils

--- lib/edge.test-utils/src/edge/test/system.clj
+++ lib/edge.test-utils/src/edge/test/system.clj
@@ -8,8 +8,9 @@
 (def ^:dynamic *system* nil)

 (defmacro ^:private with-system
-  [system & body]
-  `(let [s# (ig/init ~system)]
+  [system ks & body]
+  `(let [system# ~system
+         s# (ig/init system# (or ~ks (keys system#)))]
      (try
        (binding [*system* s#]
          ~@body)
@@ -28,3 +29,11 @@
    (fn [f]
      (with-system (system) nil
        (f)))))
+
+(defn with-subsystem-fixture
+  ([ks]
+   (with-subsystem-fixture default-system))
+  ([system ks]
+   (fn [f]
+     (with-system (system) ks
+       (f)))))


Clean up testing utils

Clean up testing utils

--- test/jest/utils.clj
+++ test/jest/utils.clj
@@ -4,6 +4,13 @@

 ;;(import 'jest.grammar.JestParser)
 ;;(import 'jest.grammar.JestCompiler)
+
+
+(defn compare-code
+  [x y]
+  (println x y)
+  (is (= x y)))
+

 (defn test-code
   "Test that the given jest code
@@ -15,10 +22,7 @@
     (println "Clojure: ")
     (doall (map println code-list))
     (println "")
-    (doall (map #(do (println %1 %2) (is (= %1 %2))) clojure code-list))))
-;;    (map vector clojure code-list doseq [x clojure
-;;            y code-list]
-;;      (is (= x y)))))
+    (doall (map compare-code clojure code-list))))


PROC bug test added

PROC bug test added


Tidy up postgres spec namespaces

Tidy up postgres spec namespaces

--- backend/specs/akvo/lumen/specs/postgres.clj
+++ backend/specs/akvo/lumen/specs/postgres.clj
@@ -1,13 +1,7 @@
 (ns akvo.lumen.specs.postgres
-  (:require [akvo.lumen.specs :as lumen.s :refer (sample)]
-            [akvo.lumen.specs.db :as db.s]
-            [akvo.lumen.postgres :as postgres]
+  (:require [akvo.lumen.postgres :as postgres]
             [akvo.lumen.postgres.filter :as postgres.filter]
-            [akvo.lumen.util :as u]
-            [clojure.spec.alpha :as s]
-            [clojure.spec.gen.alpha :as gen]
-            [clojure.string :as string]
-            [clojure.tools.logging :as log]))
+            [clojure.spec.alpha :as s]))

 (alias 'db.dsv 'akvo.lumen.specs.db.dataset-version)


java interop example

java interop example

--- src/main/clj/clojure_club/x113_making_data_dance/java_interop.clj
+++ src/main/clj/clojure_club/x113_making_data_dance/java_interop.clj
@@ -1,6 +1,6 @@
 (ns clojure-club.x113-making-data-dance.java-interop
   (:require [clojure.string :as cs])
-  (:import (javax.swing JFrame JTable JScrollPane JMenuBar JMenu JMenuItem Action AbstractAction JFileChooser UIManager JLabel)
+  (:import (javax.swing JFrame JTable JScrollPane JMenuBar JMenu JMenuItem Action AbstractAction JFileChooser UIManager JLabel SwingUtilities)
            (java.awt BorderLayout Color)
            (javax.swing.table AbstractTableModel DefaultTableCellRenderer TableCellRenderer)
            (java.awt.event ActionEvent)))
@@ -77,12 +77,14 @@
     (.setVisible true)))

 ;(def state (atom {:data [[1 2] [3 4][1 2] [3 4]]}))
-;(launch-app state)
+;(def app (launch-app state))
+;(.setSize app 300 300)
+;(swap! state assoc :data [["Hi" "There"] ["I" "like"] ["Clojure" "!"]])

 ;;Poking around
 ;(bean (JFrame.))
 ;(parents JFrame) ;Immediate - classes and derived hierarchies
-;(base JFrame) ;Immediate - classes only
+;(bases JFrame) ;Immediate - classes only
 ;(ancestors JFrame) ;Also works for derived hierarchies
 ;(supers JFrame) ;classes only
 ;(ancestors (class {}))


[#2772] Adapt error message with no auth

--- backend/src/akvo/lumen/lib/import/flow.clj
+++ backend/src/akvo/lumen/lib/import/flow.clj
@@ -2,6 +2,7 @@
   (:require [akvo.commons.psql-util :as pg]
             [akvo.lumen.lib.import.common :as import]
             [akvo.lumen.component.flow :as c.flow]
+            [cheshire.core :as json]
             [akvo.lumen.protocols :as p]
             [akvo.lumen.lib.import.flow-common :as flow-common]
             [akvo.lumen.lib.import.flow-v2 :as v2]
@@ -34,10 +35,15 @@
             (if-let [ex-d (ex-data e)]
               (do
                 (log/error e)
-                (throw (ex-info (or (:cause e) (str "Null cause from instance: " instance))
-                                (assoc ex-d
-                                       :instance instance
-                                       :flow-urls (read-flow-urls flow-api)))))
+                (let [message (if (= 403 (:status ex-d))
+                                (format "Unauthorized flow user: %s"
+                                        (let [body (json/parse-string (:body ex-d) keyword)]
+                                          (:email  body "User doesn't exist in flow")))
+                                (or (:cause e) (str "Null cause from instance: " instance)))]
+                  (throw (ex-info message
+                                  (assoc ex-d
+                                         :instance instance
+                                         :flow-urls (read-flow-urls flow-api))))))
               (throw e)))))
       (records [this]
         (try


Fix non-idiomatic usage.

Fix non-idiomatic usage.

--- src/afterglow/show.clj
+++ src/afterglow/show.clj
@@ -224,7 +224,7 @@
   {:pre [(some? *show*) (some? midi-device-name) (number? min) (number? max) (not= min max)
          (integer? channel) (<= 0 channel 15) (integer? control-number) (<= 0 control-number 127) (some? variable)]}
   (let [show *show*  ; Bind so we can pass it to update function running on another thread
-        calc-fn (cond (and (= min 0) (= max 127))
+        calc-fn (cond (and (zero? min) (= max 127))
                       (fn [midi-val] midi-val)
                       (< min max)
                       (let [range (- max min)]


Coffee stays fresh for 5 min

Coffee stays fresh for 5 min

--- src/cljs/mokkameister/brew_status.cljs
+++ src/cljs/mokkameister/brew_status.cljs
@@ -1,12 +1,14 @@
 (ns mokkameister.brew-status
   (:require [mokkameister.loading :refer [loading-gif]]))
+
+(def ^:private fresh-coffee-minutes 5)

 (defn- fresh-brew? [brew]
   (let [duration (:brew-time brew)
         start    (:created brew)]
     (-> (js/moment start)
         (.add duration "m")
-        (.add 2 "m")
+        (.add fresh-coffee-minutes "m")
         (.isAfter (js/moment)))))

 (defn- isbrewing? [brew]


Add improved way to handle routes by http method.

--- src/clojure/catacumba/impl/routing.clj
+++ src/clojure/catacumba/impl/routing.clj
@@ -24,6 +24,15 @@
   (let [callback #(reduce attach-route % handlers)]
     (.prefix chain path ^Action (helpers/action callback))))

+(defmethod attach-route :method
+  [^Chain chain [_ ^String path & handlers]]
+  (let [callback #(reduce attach-route % handlers)
+        handler (fn [context]
+                  (let [^Context ctx (:catacumba/context context)]
+                    (.byMethod ctx (helpers/action callback))))
+        handler (handlers/adapter handler)]
+    (.handler chain path handler)))
+
 (defmethod attach-route :error
   [^Chain chain [_ error-handler]]
   (letfn [(on-register [^RegistrySpec rspec]
@@ -37,7 +46,7 @@
     (.register chain ^Action (helpers/action on-register))))

 (defmethod attach-route :default
-  [^Chain chain [method & handlers-and-path]]
+  [chain [method & handlers-and-path]]
   (let [path (first handlers-and-path)]
     (if (string? path)
       (let [^Handler handler (-> (map handlers/adapter (rest handlers-and-path))
@@ -50,7 +59,7 @@
           :patch (.patch chain path handler)
           :delete (.delete chain path handler)))
       (let [^Handler handler (-> (map handlers/adapter handlers-and-path)
-                                (Handlers/chain))]
+                                 (Handlers/chain))]
         (case method
           :all (.handler chain handler)
           :get (.get chain handler)


Remove log-exception function from vso-api namespace as logger now passed in

--- src/build_mon/vso_api.clj
+++ src/build_mon/vso_api.clj
@@ -9,12 +9,6 @@

 (defn- get-json-body [get-fn url]
   (-> url get-fn validate-200-response :body (json/parse-string true)))
-
-(defn- log-exception [message exception]
-  (prn "=========   ERROR   ==========")
-  (prn message)
-  (prn exception)
-  (prn "=============================="))

 (defn- retrieve-commit-message [vso-api-data build]
   (let [{:keys [get-fn account logger]} vso-api-data


add comments about (preprocess)

add comments about (preprocess)

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -58,12 +58,12 @@
      (if result
        (conj {:surface (fo result)}
              result)))))
-
-;; e.g.
-;; babel.english> (preprocess "the womens' hats and the cats' pyjamas")
-;; "the women 's  hats and the cats 's pyjamas"
-;;
 (defn preprocess [input]
+  "arbitrary regexp replacements to convert English orthography into a parsable whitespace-delimited expression"
+  ;; e.g.
+  ;; (preprocess "the womens' hats and the cats' pyjamas")
+  ;;  => "the women 's  hats and the cats 's pyjamas"
+  ;;
   (string/replace (string/replace input #"(men)s'(\s*)" "$1 's $2") #"(\S)s'" "$1s 's"))

 (defn parse


CMR-3839 Update documentation

CMR-3839 Update documentation

--- search-app/src/cmr/search/api/request_context_user_augmenter.clj
+++ search-app/src/cmr/search/api/request_context_user_augmenter.clj
@@ -1,6 +1,6 @@
 (ns cmr.search.api.request-context-user-augmenter
  "Adds data to the context for the current user for performance improvements. Adds user id and sids
- as well as caches those."
+ as well as caches for those. "
  (:require
   [cmr.acl.core :as acl]
   [cmr.common.cache :as cache]
@@ -60,7 +60,9 @@
      (errors/throw-service-error :unauthorized token-required-message)))))

 (defn- add-user-id-and-sids-to-context
-  "Adds information to the context including the user is and sids"
+  "Adds information to the context including the user is and sids. Lazy assoc with a delay so we don't
+  do the expensive work until we need the sids or user id. This is called for every search api
+  call, so don't want this to affect performance."
   [context params headers]
   (def context context)
   (-> context


CMR-1436 Adds nREPL to index-set-app

CMR-1436 Adds nREPL to index-set-app

--- index-set-app/src/cmr/index_set/system.clj
+++ index-set-app/src/cmr/index_set/system.clj
@@ -4,6 +4,7 @@
   http://stuartsierra.com/2013/09/15/lifecycle-composition and related posts."
   (:require [cmr.common.lifecycle :as lifecycle]
             [cmr.common.log :as log :refer (debug info warn error)]
+            [cmr.common.nrepl :as nrepl]
             [cmr.index-set.api.routes :as routes]
             [cmr.common.api.web-server :as web]
             [cmr.system-trace.context :as context]
@@ -17,10 +18,15 @@
   "Port index-set application listens on."
   {:default 3005 :type Long})

+(defconfig index-set-nrepl-port
+  "Port to listen for nREPL connections"
+  {:default nil
+   :parser cfg/maybe-long})
+
 (def
   ^{:doc "Defines the order to start the components."
     :private true}
-  component-order [:log :index :web])
+  component-order [:log :index :web :nrepl])

 (defn create-system
   "Returns a new instance of the whole application."
@@ -28,6 +34,7 @@
   (let [sys {:log (log/create-logger)
              :index (es/create-elasticsearch-store (es-config/elastic-config))
              :web (web/create-web-server (index-set-port) routes/make-api)
+             :nrepl (nrepl/create-nrepl-if-configured (index-set-nrepl-port))
              :caches {acl/token-imp-cache-key (acl/create-token-imp-cache)}
              :zipkin (context/zipkin-config "index-set" false)
              :relative-root-url (transmit-config/index-set-relative-root-url)}]


refactor for clarity

refactor for clarity

--- src/c4_arena/c4_rules.clj
+++ src/c4_arena/c4_rules.clj
@@ -16,15 +16,15 @@
     [(assoc state-val i side) i]))

 (defn state-from-moves [moves]
-  (:state
-   (reduce
-    (fn [{:keys [state side] :as input} move]
-      (if-let [state1 (first (make-move state move side))]
-        (let [side1 ({1 2 2 1} side)]
-          {:state state1 :side side1})
-        input))
-    {:state (vec (repeat (* ncols nrows) 0)) :side 1}
-    moves)))
+  (->> moves
+       (reduce
+        (fn [{:keys [state side] :as input} move]
+          (if-let [state1 (first (make-move state move side))]
+            (let [side1 ({1 2 2 1} side)]
+              {:state state1 :side side1})
+            input))
+        {:state (vec (repeat (* ncols nrows) 0)) :side 1})
+       :state))

 (defn states-from-moves [moves]
   (->> moves


fix bug that only draws part of board on dashboard

--- src/client/dashboard.cljs
+++ src/client/dashboard.cljs
@@ -98,7 +98,7 @@
   (.getElementById js/document id))

 (defn- create-board-if-needed! [id]
-  (if-not (by-id id)
+  (when-not (by-id id)
     (.append ($ "#boardsContainer") (board id))
     (size-canvas! (str "canvas-" id) empty-board cell-size rows-cutoff)
     ))


Added character support to compiler. Refs #18

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -87,6 +87,7 @@
 (defmethod emit-constant Double [x] (print x))
 (defmethod emit-constant String [x] (pr x))
 (defmethod emit-constant Boolean [x] (print (if x "true" "false")))
+(defmethod emit-constant Character [x] (pr (str x)))

 (defmethod emit-constant clojure.lang.PersistentList$EmptyList [x]
   (print 'cljs.core.List.EMPTY))


* src/clj/cljs/compiler.clj: switch *position* to a map

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -235,12 +235,12 @@
       (map? x) (emit x)
       (seq? x) (apply emits x)
       (fn? x)  (x)
-      :else (do
-              (let [s (print-str x)]
-                (when *position*
-                  (swap! *position* (fn [[line column]]
-                                      [line (+ column (count s))])))
-                (print s)))))
+      :else (let [s (print-str x)]
+              (when *position*
+                (swap! *position*
+                  (fn [{:keys [line col]}]
+                    {:line line :col (+ col (count s))})))
+              (print s))))
   nil)

 (defn ^String emit-str [expr]
@@ -254,8 +254,9 @@
   ;    (print (apply str (concat (repeat (- 120 column) \space) ["// " (inc line)])))))
   (println)
   (when *position*
-    (swap! *position* (fn [[line column]]
-                        [(inc line) 0])))
+    (swap! *position*
+      (fn [{:keys [line col]}]
+        {:line (inc line) :col 0})))
   nil)

 (defmulti emit-constant class)
@@ -1583,7 +1584,7 @@
       (binding [*out* out
                 *cljs-ns* 'cljs.user
                 *cljs-file* (.getPath ^java.io.File src)
-                *position* (atom [0 0])]
+                *position* (atom {:line 0 :col 0})]
         (loop [forms (forms-seq src)
                ns-name nil
                deps nil]


tweak prod port

tweak prod port

--- src/clj/starcity/core.clj
+++ src/clj/starcity/core.clj
@@ -18,7 +18,7 @@
                  [:datomic]))))

 (def config
-  {:web-port 8080
+  {:web-port 8082
    :db       {:uri        "datomic:mem://localhost:4334/starcity"
               :schema-dir "resources/datomic/schemas"}})


log success for debug purpose

log success for debug purpose

--- src/clj/swarmpit/http.clj
+++ src/clj/swarmpit/http.clj
@@ -2,7 +2,7 @@
   (:require [cheshire.core :refer [parse-string parse-stream generate-string]]
             [clj-http.client :as http]
             [taoensso.encore :as enc]
-            [taoensso.timbre :refer [error]]
+            [taoensso.timbre :refer [error debug]]
             [swarmpit.log :refer [pretty-print pretty-print-ex]])
   (:import (java.util.concurrent TimeoutException ExecutionException)
            (java.io IOException)
@@ -54,6 +54,17 @@
     (catch Exception _
       response-data)))

+(defn- log-success [{:keys [method url options scope] :as request} res]
+  (let [request-headers (:headers options)
+        request-body (:body options)]
+    (debug
+      (str
+        "Request execution OK! Scope: " scope
+        enc/system-newline "|> " (name method) " " url
+        enc/system-newline "|> Headers: " (pretty-print request-headers)
+        enc/system-newline "|> Payload: " (pretty-print request-body)
+        enc/system-newline "|< Response: "  (pretty-print res)))))
+
 (defn- log-error [{:keys [method url options scope] :as request} ex]
   (let [request-headers (:headers options)
         request-body (:body options)]
@@ -79,6 +90,7 @@
             response-headers (-> response :headers)
             response-status (-> response :status)
             response-body (ok-response response-body)]
+        ;(log-success request response-body)
         {:status  response-status
          :headers response-headers
          :body    response-body})


DRY up mailers

DRY up mailers

--- src/clj_money/mailers.clj
+++ src/clj_money/mailers.clj
@@ -6,22 +6,35 @@
             [selmer.parser :refer [render]]
             [clj-money.models.users :as users]))

+(defn- alt-body
+  [parts context]
+  (concat
+    [:alternative]
+    (map #(-> %
+              (assoc :content (-> (:template-path %)
+                                  slurp ; will this work on heroku?
+                                  (render context)))
+              (dissoc :template-path))
+         parts)))
+
+(def ^:private invite-user-parts
+  [{:type "text/plain"
+    :template-path "resources/templates/mailers/invite_user.txt"}
+   {:type "text/html"
+    :template-path "resources/templates/mailers/invite_user.html"}])
+
+(defn- invite-user-context
+  [to-user from-user]
+  {:recipient-first-name (:first-name to-user)
+   :sender-full-name (users/full-name from-user)
+   :app-name "clj-money"
+   :url "http://clj-money.com/users/abcdef"})
+
 (defn invite-user
   [to-user from-user]
-  (let [context {:recipient-first-name (:first-name to-user)
-                 :sender-full-name (users/full-name from-user)
-                 :app-name "clj-money"
-                 :url "http://clj-money.com/users/abcdef"}]
-    (send-message {:host (env :mailer-host)}
-                  {:to (:email to-user)
-                   :from (env :mailer-from)
-                   :subject "Invitation to clj-money"
-                   :body [:alternative
-                          {:type "text/plain"
-                           :content (-> "resources/templates/mailers/invite_user.txt"
-                                        slurp ; will this work on heroku?
-                                        (render context))}
-                          {:type "text/html"
-                           :content (-> "resources/templates/mailers/invite_user.html"
-                                        slurp ; will this work on heroku?
-                                        (render context))}]})))
+  (send-message {:host (env :mailer-host)}
+                {:to (:email to-user)
+                 :from (env :mailer-from)
+                 :subject "Invitation to clj-money"
+                 :body (alt-body invite-user-parts
+                                 (invite-user-context to-user from-user))}))


only try to render if we have some data

only try to render if we have some data

--- src/cljs/greffe/core.cljs
+++ src/cljs/greffe/core.cljs
@@ -54,9 +54,12 @@
         (render [_]
           (dom/div nil
             (dom/h1 nil "Greffe")
-            (dom/div #js {:id "edit"}
-              (om/build dc/element-component (:body app)))
-            (dom/div #js {:id "xml"}
-              (om/build dc/xml-display (:body app)))))))
+            (when (:body app)
+              (dom/div #js {:id "edit"}
+                (om/build dc/element-component (:body app))))
+
+            (when (:body app)
+              (dom/div #js {:id "xml"}
+                (om/build dc/xml-display (:body app))))))))
     app-state
     {:target (. js/document (getElementById "app"))}))


emacs old buffer saving floppy to flappy. problem solved

--- src/cljs/neat/floppy.cljs
+++ src/cljs/neat/floppy.cljs
@@ -9,7 +9,7 @@

 (def settings
   {:stale-species 15
-   :population 300
+   :population 50
    :inputs 301
    :outputs 1
    :max-nodes 600
@@ -39,5 +39,7 @@
    :commands i/commands
    :wait 500})

-(if (js/document.getElementById "floppy")
+(def floppy? (js/document.getElementById "floppy"))
+
+(if floppy?
   (defonce run!! (r/runner (p/pool settings) interactions)))


Upgrate make-sketch to support :middleware option.

--- src/cljs/quil/sketch.cljs
+++ src/cljs/quil/sketch.cljs
@@ -1,6 +1,7 @@
 (ns quil.sketch
   (:require [clojure.browser.dom  :as dom]
-            [quil.util :refer [no-fn resolve-constant-key]])
+            [quil.util :refer [no-fn resolve-constant-key]]
+            [quil.middlewares.deprecated-options :refer [deprecated-options]])
   (:use-macros [quil.sketch :only [with-sketch]]
                [quil.helpers.tools :only [bind-handlers]]
                [quil.util :only [generate-quil-constants]]))
@@ -25,8 +26,14 @@
     (.size (current-applet) (int width) (int height) (resolve-constant-key mode rendering-modes))))

-(defn make-sketch [opts]
-  (let [draw-fn         (or (:draw opts) no-fn)
+(defn make-sketch [options]
+  (let [opts            (->> (:middleware options [])
+                          (cons deprecated-options)
+                          (apply comp)
+                          (#(% options))
+                          (merge {:size [500 300]}))
+
+        draw-fn         (or (:draw opts) no-fn)
         setup-fn        (or (:setup opts) no-fn)

         sketch-size     (or (:size opts) [200 200])


CMR-183: Refactored to use cmr-common-lib functionality.

--- src/cmr/acl/acl_cache.clj
+++ src/cmr/acl/acl_cache.clj
@@ -18,17 +18,12 @@
   []
   (cache/create-cache))

-(defn context->acl-cache
-  "Gets the acl cache from the context"
-  [context]
-  (get-in context [:system :caches :acls]))
-
 (defn refresh-acl-cache
   "Refreshes the acls stored in the cache. This should be called from a background job on a timer
   to keep the cache fresh. This will throw an exception if there is a problem fetching ACLs. The
   caller is responsible for catching and logging the exception."
   [context]
-  (let [acl-cache (context->acl-cache context)
+  (let [acl-cache (cache/context->cache context acl-cache-key)
         updated-acls (echo-acls/get-acls-by-type context "CATALOG_ITEM")]
     (cache/update-cache
       acl-cache
@@ -37,7 +32,7 @@
 (defn get-acls
   "Gets the current cached acls."
   [context]
-  (let [acl-cache (context->acl-cache context)]
+  (let [acl-cache (context->cache context acl-cache-key)]
     (cache/cache-lookup
       acl-cache
       :acls


Updating to use the time keeper.

Updating to use the time keeper.

--- src/cmr/acl/acl_cache.clj
+++ src/cmr/acl/acl_cache.clj
@@ -4,6 +4,7 @@
   the acls."
   (:require [cmr.common.services.errors :as errors]
             [clj-time.core :as t]
+            [cmr.common.time-keeper :as tk]
             [cmr.common.jobs :refer [defjob]]
             [cmr.transmit.echo.acls :as echo-acls]
             [cmr.common.log :as log :refer (debug info warn error)]))
@@ -36,7 +37,7 @@
   [context]
   (let [acl-cache-atom (context->acl-cache context)]
     (reset! acl-cache-atom {:acls (echo-acls/get-acls-by-type context "CATALOG_ITEM")
-                            :last-updated (t/now)})))
+                            :last-updated (tk/now)})))

 (defn get-acls
   "Gets the current cached acls."


CMR-610: Add documentation string to relative-root-url

--- src/cmr/ingest/system.clj
+++ src/cmr/ingest/system.clj
@@ -24,7 +24,12 @@
   "Required for jobs"
   (atom nil))

-(def relative-root-url (cfg/config-value-fn :ingest-relative-root-url ""))
+(def relative-root-url
+  "Defines a root path that will appear on all requests sent to this application. For example if
+  the relative-root-url is '/cmr-app' and the path for a URL is '/foo' then the full url would be
+  http://host:port/cmr-app/foo. This should be set when this application is deployed in an
+  environment where it is accessed through a VIP."
+  (cfg/config-value-fn :ingest-relative-root-url ""))

 (defn create-system
   "Returns a new instance of the whole application."


persist public chat

persist public chat

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/ui/screens/add_new/new_public_chat/view.cljs
+++ src/status_im/ui/screens/add_new/new_public_chat/view.cljs
@@ -69,7 +69,8 @@
       [react/text {:style styles/section-title
                    :font  :medium}
        (i18n/label :t/selected)]]
-     [list/flat-list {:data               default-public-chats
-                      :key-fn             identity
-                      :render-fn          render-topic
-                      :default-separator? true}]]))
+     [list/flat-list {:data                         default-public-chats
+                      :key-fn                       identity
+                      :render-fn                    render-topic
+                      :keyboard-should-persist-taps :always
+                      :default-separator?           true}]]))


plan to remove re-selects

plan to remove re-selects

--- src/er_cassandra/model/alia/upsert.clj
+++ src/er_cassandra/model/alia/upsert.clj
@@ -281,6 +281,17 @@

             record (t/run-callbacks session entity :before-save record opts)

+            ;; TODO 20170926 plan to remove unnecessary re-selects.
+            ;;
+            ;; only re-select if the entity has-lookups? and some of the lookup
+            ;; columns are included in the record.
+            ;;
+            ;; provide any re-selected record to the upsert-primary-record-and-update-unique-keys
+            ;;
+            ;; return with either [a] just the upserted record if there were no
+            ;; affected lookups or [b] the re-selected record modified by the upserted
+            ;; record if there were affected lookups
+
             ;; don't need the old record if there are no lookups
             old-record (if (has-lookups? entity)
                          (r/select-one


Fix bug where uri-context duplicated

Fix bug where uri-context duplicated

--- modules/bidi/src/modular/bidi.clj
+++ modules/bidi/src/modular/bidi.clj
@@ -61,7 +61,7 @@
   WebService
   (request-handlers [_] {})
   (routes [component]
-    [uri-context (:target component)])
+    ["" (:target component)])
   (uri-context [_] uri-context))

 (def new-static-resource-service-schema


visibility is now computed dynamically in view-model instead of reconcile

--- src/frontend/todos.cljs
+++ src/frontend/todos.cljs
@@ -19,12 +19,11 @@

 (defn init
   []
-  {:field      ""
-   :visibility :all
+  {:field   ""
    ; list of maps
-   :todos      (list (-init-todo 1 "Finish this project")
-                     (-init-todo 2 "Take a bath"))
-   :next-id    3})
+   :todos   (list (-init-todo 1 "Finish this project")
+                  (-init-todo 2 "Take a bath"))
+   :next-id 3})

 (defn -update-todos*
   [model pred f & args]
@@ -55,25 +54,13 @@
   (-remove-todos model #(= (:id %) id)))

 ;;;;;;;;;;;;;;;;;;;;;;;; Control
-(def -visibility-spec
-  [{:key :all :title "All" :href "#" :token ""}
-   {:key :active :title "Active" :href "#/active" :token "/active"}
-   {:key :completed :title "Completed" :href "#/completed" :token "/completed"}])
-
 (defn control
   [_model_ signal dispatch]
   (match signal
          :on-connect (dispatch :sample-action)

          ; will come from router middleware
-         [::routing/on-navigate token]
-         (do
-           ;(println "    token =" (pr-str token))
-           (when-let [match (->> -visibility-spec
-                               (filter #(= (:token %) token))
-                               first)]
-             ;(println "      route match =" (pr-str match))
-             (dispatch [:set-visibility (:key match)])))
+         [::routing/on-navigate token] nil

          ; will come from devtools
          ::devtools/on-did-replay nil
@@ -96,9 +83,6 @@
          ; do nothing, only for a demo
          :sample-action model

-         [:set-visibility key]
-         (assoc model :visibility key)
-
          [:update-field val]
          (assoc model :field val)

@@ -147,16 +131,29 @@
          (-remove-todos model :completed?)))

 ;;;;;;;;;;;;;;;;;;;;;;;; View model
+(def -visibility-spec
+  [{:key :all :title "All" :href "#" :token ""}
+   {:key :active :title "Active" :href "#/active" :token "/active"}
+   {:key :completed :title "Completed" :href "#/completed" :token "/completed"}])
+
+(defn -visibility
+  [model]
+  (->> -visibility-spec
+       (filter #(= (:token %) (::routing/token model)))
+       first
+       :key))
+
 (defn view-model
   [model]
   ; reactions are extracted for better perfromance, e.g.:
   ; when input field changes most reactions will not be recalculated,
   ; because todos stay the same
   (let [todos (reaction (:todos @model))
-        visibility (reaction (:visibility @model))]
+        visibility (reaction (-visibility @model))]
     (-> model
-        (ui/track-keys [:field :visibility])
-        (assoc :has-todos? (reaction (-> @todos count pos?))
+        (ui/track-keys [:field])
+        (assoc :visibility visibility
+               :has-todos? (reaction (-> @todos count pos?))
                :todos (reaction (filter (case @visibility
                                           :all (constantly true)
                                           :active (complement :completed?)


Use letfn to simplify

Use letfn to simplify

--- src/advent_2018/day_08.cljc
+++ src/advent_2018/day_08.cljc
@@ -6,16 +6,14 @@
 (def input (-> "advent_2018/day_08/input" io/resource slurp))

 (defn parse-license [input]
-  (let [node+more (fn node+more [[child-count metadata-count & more]]
-                    (let [[children more] (-> (iterate (fn [[children more]]
-                                                          (let [[child more] (node+more more)]
-                                                            [(conj children child) more]))
-                                                 [[] more])
-                                            (nth child-count))
-                          [metadata more] (split-at metadata-count more)]
-                      [{:children children, :metadata metadata} more]))
-        nums      (map read-string (re-seq #"\d+" input))]
-    (first (node+more nums))))
+  (letfn [(parse-node [[child-count metadata-count & more]]
+            (let [[children more] (nth (iterate parse-child [[] more]) child-count)
+                  [metadata more] (split-at metadata-count more)]
+              [{:children children, :metadata metadata} more]))
+          (parse-child [[children more]]
+            (let [[child more] (parse-node more)]
+              [(conj children child) more]))]
+    (first (parse-node (map read-string (re-seq #"\d+" input))))))

 (defn part-1 []
   (->> (tree-seq (comp seq :children) :children (parse-license input))
@@ -23,11 +21,11 @@
     (reduce +)))

 (defn part-2 []
-  (let [node-value (fn node-value [{:keys [children metadata]}]
-                     (if (empty? children)
-                       (reduce + metadata)
-                       (->> metadata
-                         (keep #(get children (dec %)))
-                         (map node-value)
-                         (reduce +))))]
+  (letfn [(node-value [{:keys [children metadata]}]
+            (if (empty? children)
+              (reduce + metadata)
+              (->> metadata
+                (keep #(get children (dec %)))
+                (map node-value)
+                (reduce +))))]
     (node-value (parse-license input))))


Redirecting System.out to a string for testing purposes

--- jvm-runner/test/codewars/runner/java_test.clj
+++ jvm-runner/test/codewars/runner/java_test.clj
@@ -2,7 +2,17 @@
   (:require [clojure.test :refer :all]
             [codewars.core :refer [-main]]
             [cheshire.core :as json]
-            [codewars.runner :refer [run]]))
+            [codewars.runner :refer [run]])
+  (:import [org.apache.commons.io.output WriterOutputStream]
+           [java.io PrintStream ByteArrayOutputStream]))
+
+(defmacro with-java-out-str [& body]
+  `(let [original-out# (PrintStream. (. System out))
+         byte-out# (ByteArrayOutputStream.)]
+     (-> byte-out# (PrintStream.) System/setOut)
+     ~@body
+     (System/setOut original-out#)
+     (.toString byte-out#)))

 (deftest java-basic
   (testing "-main can handle a very basic java solution and fixture"
@@ -20,3 +30,12 @@
        {:language "java"
         :solution "public class FooFighters {public static int main() {return 1;}}"})
       (is (= 1 (-main))))))
+
+
+(deftest java-solution-print
+  (testing "-main can handle a java solution that prints to standard out"
+    (with-in-str
+      (json/generate-string
+       {:language "java"
+        :solution "public class Hello {public static void main() {System.out.print(\"Hellooo!\");}}"})
+      (is (= "Hellooo!" (with-java-out-str (-main)))))))


c2.maths.irange shouldn't return end if it's not evenly stepped.

--- src/cljx/c2/maths.cljx
+++ src/cljx/c2/maths.cljx
@@ -70,7 +70,12 @@
   "Inclusive range; same as core/range, but includes the end."
   ([start] (range start))
   ([start end] (concat (range start end) [end]))
-  ([start end step] (concat (range start end step) [end])))
+  ([start end step]
+     (let [r (range start end step)]
+       (if (== (mod (first r) step)
+               (mod end step))
+         (concat r [end])
+         r))))

 (defn within?
   "Checks if bottom <= x <= top."


you can't read cars

you can't read cars

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -139,6 +139,7 @@

    {:pred :car}      {:artifact true
                       :consumable false
+                      :legible false
                       :place false}

    {:pred :house}    {:artifact true


get demo working again

get demo working again

--- src/babel/english/demo.cljc
+++ src/babel/english/demo.cljc
@@ -1,12 +1,12 @@
 (ns babel.english.demo
   (:require
    [babel.english :refer [generate]]
-   [babel.english.grammar :refer [few-rules medium small-lexicon]]
+   [babel.english.grammar :refer [medium]]
    [babel.english.morphology :refer [fo]]
    #?(:cljs [babel.logjs :as log])
    [clojure.string :as string]
    #?(:clj [clojure.tools.logging :as log])
-   [dag_unify.core :refer [unifyc]]))
+   [dag_unify.core :refer [unify]]))

 (declare run-demo-with)

@@ -35,7 +35,8 @@
                    :sem {:subj {:pred :cat
                                 :mod {:pred :yellow}
                                 :spec {:def :genitive
-                                       :of {:pred :luisa}}}}}}
+                                       :of {:pred :luisa}}}
+                         :obj {:pred :top}}}}

          {:demo "Women who read books"
           :synsem {:cat :verb
@@ -45,7 +46,8 @@

          {:demo "Thinking"
           :synsem {:cat :verb
-                   :sem {:pred :think}}}
+                   :sem {:pred :think
+                         :obj {:pred :top}}}}

          ]]

@@ -76,8 +78,8 @@
   "print out _n_ generated sentences to stdout."
   (let [n (if n (Integer. n)
               10)
-        spec (if spec (unifyc spec
-                              {:modified false})
+        spec (if spec (unify spec
+                             {:modified false})
                  {:modified false})]
     (filter #(not (nil? %))
             (if timings?


Small comment fix.

Small comment fix.

--- src/cmr/common/log.clj
+++ src/cmr/common/log.clj
@@ -20,7 +20,7 @@
   (t/set-config! [:appenders :spit :enabled?] true)
   (t/set-config! [:shared-appender-config :spit-filename] file)

-  ;; Log current thread.
+  ;; Set the format for logging.
   (t/set-config! [:fmt-output-fn]
                  (fn [{:keys [level throwable message timestamp hostname ns]}
                       ;; Any extra appender-specific opts:


Fix request defaults syntax

Fix request defaults syntax

--- src/leiningen/new/cljskel/web_unit.clj
+++ src/leiningen/new/cljskel/web_unit.clj
@@ -13,8 +13,8 @@
   "Creates a compojure request map and applies it to our routes.
    Accepets method, resource and optionally an extended map"
   [method resource & [{:keys [params body content-type headers]
-                       :or {:params {}
-                            :headers {}}}]]
+                       :or {params {}
+                            headers {}}}]]
   (let [{:keys [body] :as res}
         (app (merge {:request-method method
                      :uri resource


Print status info in reverse chronological order - latest first

--- src/aerobio/server.clj
+++ src/aerobio/server.clj
@@ -386,7 +386,8 @@
     #_(infof "STATUS %s" params)
     (let [jinfo (hc/get-db (atom (valuefy @job-db)) [user eid action])
           result (if (seq jinfo)
-                   (->> jinfo (sort-by #(-> % :request :timestamp))
+                   (->> jinfo (sort-by #(-> % :request :timestamp)
+                                       austr/string-greater?)
                         (mapv #(vector (-> % :request :timestamp)
                                        (% :status)
                                        (% :result))))


Refactoring of server routes, starting

Refactoring of server routes, starting


removed duplicate verbose message.

removed duplicate verbose message.

--- src/ancient_clj/io.clj
+++ src/ancient_clj/io.clj
@@ -48,7 +48,6 @@
                                            url-or-map
                                            {:url url-or-map})
          u (build-metadata-url url group-id artifact-id file-name)]
-     (verbose "  Trying to retrieve " u " ...")
      (when-let [xml (fetch-url! u username password)]
        (verbose "  Got " (count xml) " byte(s) of data.")
        xml))))


Introducing the withPackageName protocol, renaming the modifiersProtocol to withModifiers

--- src/app/javaparser.clj
+++ src/app/javaparser.clj
@@ -1,5 +1,6 @@
 (import japa.parser.JavaParser)
 (import japa.parser.ast.CompilationUnit)
+(import japa.parser.ast.Node)
 (import japa.parser.ast.body.ClassOrInterfaceDeclaration)
 (import japa.parser.ast.body.EnumDeclaration)
 (import japa.parser.ast.body.ConstructorDeclaration)
@@ -55,18 +56,18 @@
 ; Modifiers
 ; ============================================

-(defprotocol modifiersProtocol
+(defprotocol withModifiers
   (getModifiers [this]))

-(extend-protocol modifiersProtocol
+(extend-protocol withModifiers
   TypeDeclaration
   (getModifiers [this] (.getModifiers this)))

-(extend-protocol modifiersProtocol
+(extend-protocol withModifiers
   MethodDeclaration
   (getModifiers [this] (.getModifiers this)))

-(extend-protocol modifiersProtocol
+(extend-protocol withModifiers
   FieldDeclaration
   (getModifiers [this] (.getModifiers this)))

@@ -110,26 +111,30 @@
 ; ============================================

 (defrecord SingleFieldDeclaration [field variable]
-  modifiersProtocol
+  withModifiers
     (getModifiers [this] (getModifiers field)))

 ; ============================================
 ; Model
 ; ============================================

-(defn packageName [n]
-  (if (instance? CompilationUnit n)
+(defprotocol withPackageName
+  (packageName [this]))
+
+(extend-protocol withPackageName
+  CompilationUnit
+  (packageName [this]
     (let
-      [p (.getPackage n)]
+      [p (.getPackage this)]
       (if (nil? p)
         ""
-        (.toString (.getName p))))
-    (try
-      (let [pn (.getParentNode n)]
-        (if (nil? pn)
-          ""
-          (packageName pn)))
-      (catch Exception e (str "STR PN " (nil? (.getParentNode n)) e) ))))
+        (.toString (.getName p))))))
+
+(extend-protocol withPackageName
+  Node
+  (packageName [this]
+    (let [pn (.getParentNode this)]
+      (packageName pn))))

 (defn getName [el]
   (if


Reset key

Reset key

--- src/asteroids/core.clj
+++ src/asteroids/core.clj
@@ -37,6 +37,7 @@
               (int \D) {:rotation turn-speed}
               (int \W) {:acceleration 1}
               (int \K) {:shoot true}
+              (int \R) {:reset true}
               })

 ; END: constants
@@ -303,6 +304,12 @@
 ; Actions
 ; ----------------------------------------------------------------------

+(defn reset-ship [ship]
+  "Repair method while input keys f*** up at start-up"
+  (assoc ship :rotation-speed 0
+              :acceleration 0
+              :shooting? false))
+
 (defn shoot [{:keys [shooting? shots millis-since-last-shot] :as ship}]
   #_(prn "shoot" position size direction speed)
   (let [millis-since-last-shot (+ turn-millis millis-since-last-shot)
@@ -373,10 +380,11 @@
       (ref-set asteroids asteroids*))))

 (defn do-action!
-  ([ship {:keys [rotation acceleration shoot] :as action} modifier]
+  ([ship {:keys [rotation acceleration shoot reset] :as action} modifier]
    (when rotation (dosync (alter ship turn (* modifier rotation))))
    (when acceleration (dosync (alter ship accelerate (* modifier acceleration))))
    (when shoot (dosync (alter ship toggle-shooting (> modifier 0))))
+   (when reset (dosync (alter ship reset-ship)))
     #_(prn "update" dir modifier "speed:" (:rotation-speed @ship) "acceleration:" (:acceleration @ship)))
   ([ship action]
    (do-action! ship action 1))


Harden the things imp'l some

Harden the things imp'l some

--- src/grimoire/things.clj
+++ src/grimoire/things.clj
@@ -131,10 +131,10 @@
   {:pre [(thing? t)]}
   (or (::url t)
       (->> t
-           (iterate :parent)
+           (iterate thing->parent)
            (take-while identity)
            (reverse)
-           (map :name)
+           (map thing->name)
            (interpose "/")
            (apply str))))

@@ -183,20 +183,21 @@
 ;;--------------------------------------------------------------------
 (defn thing->relative-path [t thing]
   (->> thing
-       (iterate :parent)
-       (take-while #(not= (:type %1) t))
+       (iterate thing->parent)
+       (take-while identity)
+       (take-while #(not= (v/tag %1) t))
        (reverse)
-       (map :name)
+       (map thing->name)
        (interpose "/")
        (apply str)))

 (defn thing->root-to [t thing]
   (->> thing
-       (iterate :parent)
+       (iterate thing->parent)
        (take-while identity)
        (reverse)
-       (take-while #(not= (:type %1) t))
-       (map :name)
+       (take-while #(not= (v/tag %1) t))
+       (map thing->name)
        (interpose "/")
        (apply str)))


add preprocessing step

add preprocessing step

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -51,12 +51,19 @@
 (defn lightning-bolt [spec]
   (generate/lightning-bolt (:grammar medium) (:lexicon medium) spec 0 (:index medium) nil (:morph medium) 0))

+;; e.g.
+;; babel.english> (preprocess "the womens' hats and the cats' pyjamas")
+;; "the women 's  hats and the cats 's pyjamas"
+;;
+(defn preprocess [input]
+  (string/replace (string/replace input #"(men)s'(\s*)" "$1 's $2") #"(\S)s'" "$1s 's"))
+
 (defn parse
   "parse a string in English into zero or more (hopefully more) phrase structure trees"

   ([input]
-   (parse input medium))
+   (parse (preprocess input) medium))

   ([input model]
-   (parse/parse input model)))
+   (parse/parse (preprocess input) model)))


added the option to not install vbox-guest

--- main/src/dda/pallet/dda_managed_vm/domain.clj
+++ main/src/dda/pallet/dda_managed_vm/domain.clj
@@ -44,7 +44,7 @@
   (merge
     DdaVmUser
     DdaVmBookmarks
-    {:type (s/enum :desktop-minimal :desktop-office :remote)}))
+    {:type (s/enum :desktop-minimal :desktop-office :desktop-novbox :remote)}))

 (def DdaVmDomainResolvedConfig
   "The convention configuration for managed vms crate."
@@ -105,6 +105,12 @@
           (= type :desktop-minimal)
           {:settings
             #{:install-virtualbox-guest :install-analysis}}
+          (= type :desktop-novbox)
+          {:settings
+            #{:install-libreoffice :install-spellchecking
+              :install-open-jdk-8
+              :install-analysis :install-git :install-keymgm
+              :install-password-store :install-desktop-wiki}}
           (= type :desktop-office)
           {:settings
             #{:install-virtualbox-guest


Fixing CMR-3945 Change the ISO MENDS generated record to use schema location so that the file can be validated on its own.

--- umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso19115_2.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso19115_2.clj
@@ -21,20 +21,20 @@
    [cmr.umm-spec.util :as su :refer [char-string]]))

 (def iso19115-2-xml-namespaces
-  {:xmlns:xs "http://www.w3.org/2001/XMLSchema"
-   :xmlns:gmx "http://www.isotc211.org/2005/gmx"
-   :xmlns:gss "http://www.isotc211.org/2005/gss"
+  {:xmlns:eos "http://earthdata.nasa.gov/schema/eos"
    :xmlns:gco "http://www.isotc211.org/2005/gco"
-   :xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance"
    :xmlns:gmd "http://www.isotc211.org/2005/gmd"
    :xmlns:gmi "http://www.isotc211.org/2005/gmi"
    :xmlns:gml "http://www.opengis.net/gml/3.2"
+   :xmlns:gmx "http://www.isotc211.org/2005/gmx"
+   :xmlns:gsr "http://www.isotc211.org/2005/gsr"
+   :xmlns:gss "http://www.isotc211.org/2005/gss"
+   :xmlns:gts "http://www.isotc211.org/2005/gts"
+   :xmlns:srv "http://www.isotc211.org/2005/srv"
    :xmlns:xlink "http://www.w3.org/1999/xlink"
-   :xmlns:eos "http://earthdata.nasa.gov/schema/eos"
-   :xmlns:srv "http://www.isotc211.org/2005/srv"
-   :xmlns:gts "http://www.isotc211.org/2005/gts"
-   :xmlns:swe "http://schemas.opengis.net/sweCommon/2.0/"
-   :xmlns:gsr "http://www.isotc211.org/2005/gsr"})
+   :xmlns:xs "http://www.w3.org/2001/XMLSchema"
+   :xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance"
+   :xsi:schemaLocation "http://earthdata.nasa.gov/schema/eos https://cdn.earthdata.nasa.gov/iso/eos/1.0/eos.xsd http://www.isotc211.org/2005/gco https://cdn.earthdata.nasa.gov/iso/gco/1.0/gco.xsd http://www.isotc211.org/2005/gmd https://cdn.earthdata.nasa.gov/iso/gmd/1.0/gmd.xsd http://www.isotc211.org/2005/gmi https://cdn.earthdata.nasa.gov/iso/gmi/1.0/gmi.xsd http://www.opengis.net/gml/3.2 https://cdn.earthdata.nasa.gov/iso/gml/1.0/gml.xsd http://www.isotc211.org/2005/gmx https://cdn.earthdata.nasa.gov/iso/gmx/1.0/gmx.xsd http://www.isotc211.org/2005/gsr https://cdn.earthdata.nasa.gov/iso/gsr/1.0/gsr.xsd http://www.isotc211.org/2005/gss https://cdn.earthdata.nasa.gov/iso/gss/1.0/gss.xsd http://www.isotc211.org/2005/gts https://cdn.earthdata.nasa.gov/iso/gts/1.0/gts.xsd http://www.isotc211.org/2005/srv https://cdn.earthdata.nasa.gov/iso/srv/1.0/srv.xsd"})

 (def iso-topic-categories
   #{"farming"


Add a web resource for fetching the latest value stored in a given series.

--- metlog-vault/src-server/metlog_vault/core.clj
+++ metlog-vault/src-server/metlog_vault/core.clj
@@ -59,6 +59,21 @@
    :headers {"Content-Type" "application/edn"}
    :body (pr-str data)})

+(defn get-series-id [ series-name ]
+  (query-scalar *db* [(str "SELECT series_id"
+                           " FROM series"
+                           " WHERE series_name=?")
+                      series-name]))
+
+(defn get-latest-data-for-series-name [ series-name ]
+  (let [ series-id (get-series-id series-name) ]
+    (edn-response
+     (query-all *db* [(str "SELECT sample.series_id, sample.t, sample.val"
+                           " FROM sample"
+                           " WHERE sample.series_id = ?"
+                           "   AND sample.t = (SELECT MAX(t) FROM sample WHERE series_id=?)")
+                      series-id series-id]))))
+
 (defn get-data-for-series-name [ series-name ]
   (edn-response
    (query-all *db* [(str "SELECT sample.t, sample.val"
@@ -84,6 +99,9 @@
   (GET "/data/:series-name" [ series-name ]
     (get-data-for-series-name series-name))

+  (GET "/latest/:series-name" [ series-name ]
+    (get-latest-data-for-series-name series-name))
+
   (POST "/data" req
     (store-data-samples (edn/read-string (slurp (:body req))))
     "Incoming data accepted.")


use store fn instead of deref'ing app state

--- src/chat/client/routes.cljs
+++ src/chat/client/routes.cljs
@@ -49,7 +49,7 @@
     (go-to! (inbox-page-path {:group-id group-id}))))

 (defn current-group []
-  (get-in @store/app-state [:open-group-id]))
+  (store/open-group-id))

 (defn current-path? [path]
   (= path (.getPath (.parse Uri js/window.location))))


moving backet style back to what it was

moving backet style back to what it was

--- umm-spec-lib/src/cmr/umm_spec/models/umm_common_models.clj
+++ umm-spec-lib/src/cmr/umm_spec/models/umm_common_models.clj
@@ -20,7 +20,8 @@
    ;; have to be unique across platforms.
    Characteristics

-   Instruments])
+   Instruments
+  ])

 (record-pretty-printer/enable-record-pretty-printing PlatformType)

@@ -44,7 +45,8 @@
    StartDate

    ;; The ending data of the campaign.
-   EndDate])
+   EndDate
+  ])

 (record-pretty-printer/enable-record-pretty-printing ProjectType)

@@ -74,7 +76,8 @@
    ComposedOf

    ;; The operation mode applied on the instrument when acquiring the granule data.
-   OperationalModes])
+   OperationalModes
+  ])

 (record-pretty-printer/enable-record-pretty-printing InstrumentType)

@@ -85,14 +88,16 @@
    ;; grid coordinate system.
    ZoneIdentifier

-   Geometry])
+   Geometry
+  ])

 (record-pretty-printer/enable-record-pretty-printing HorizontalSpatialDomainType)

 ;; Contains the excluded boundaries from the GPolygon.
 (defrecord ExclusiveZoneType
   [
-   Boundaries])
+   Boundaries
+  ])

 (record-pretty-printer/enable-record-pretty-printing ExclusiveZoneType)

@@ -103,7 +108,8 @@

    Coordinate1

-   Coordinate2])
+   Coordinate2
+  ])

 (record-pretty-printer/enable-record-pretty-printing TilingIdentificationSystemType)

@@ -121,7 +127,8 @@

    OrbitParameters

-   GranuleSpatialRepresentation])
+   GranuleSpatialRepresentation
+  ])

 (record-pretty-printer/enable-record-pretty-printing SpatialExtentType)

@@ -142,7 +149,8 @@
    ContactMechanisms

    ;; Contact addresses.
-   Addresses])
+   Addresses
+  ])

 (record-pretty-printer/enable-record-pretty-printing ContactInformationType)

@@ -161,7 +169,8 @@
    ContactInformation

    ;; This is the contact group name.
-   GroupName])
+   GroupName
+  ])

 (record-pretty-printer/enable-record-pretty-printing ContactGroupType)

@@ -188,7 +197,8 @@
    ContactPersons

    ;; This is the contact information of the data center.
-   ContactInformation])
+   ContactInformation
+  ])

 (record-pretty-printer/enable-record-pretty-printing DataCenterType)

@@ -206,7 +216,8 @@
    DistributionFormat

    ;; The fee for ordering the collection data. The fee is entered as a number, in US Dollars.
-   Fees])
+   Fees
+  ])

 (record-pretty-printer/enable-record-pretty-printing DistributionType)

@@ -253,7 +264,8 @@
    Version

    ;; Additional free-text citation information.
-   OtherCitationDetails])
+   OtherCitationDetails
+  ])

 (record-pretty-printer/enable-record-pretty-printing ResourceCitationType)

@@ -264,7 +276,8 @@
    Authority

    ;; The Digitial Object Identifier.
-   DOI])
+   DOI
+  ])

 (record-pretty-printer/enable-record-pretty-printing DoiType)

@@ -275,7 +288,8 @@
    BeginningDateTime

    ;; The time when the temporal coverage period being described ended.
-   EndingDateTime])
+   EndingDateTime
+  ])

 (record-pretty-printer/enable-record-pretty-printing RangeDateTimeType)

@@ -287,13 +301,15 @@

    EastBoundingCoordinate

-   SouthBoundingCoordinate])
+   SouthBoundingCoordinate
+  ])

 (record-pretty-printer/enable-record-pretty-printing BoundingRectangleType)

 (defrecord LineType
   [
-   Points])
+   Points
+  ])

 (record-pretty-printer/enable-record-pretty-printing LineType)

@@ -307,7 +323,8 @@

    ;; This is the contact phone number, email address, Facebook address, or Twitter handle
    ;; associated with the contact method.
-   Value])
+   Value
+  ])

 (record-pretty-printer/enable-record-pretty-printing ContactMechanismType)

@@ -328,7 +345,8 @@

    VariableLevel3

-   DetailedVariable])
+   DetailedVariable
+  ])

 (record-pretty-printer/enable-record-pretty-printing ScienceKeywordType)

@@ -376,7 +394,8 @@
    ParameterRangeEnd

    ;; Data type of the values of the additional attribute.
-   DataType])
+   DataType
+  ])

 (record-pretty-printer/enable-record-pretty-printing AdditionalAttributeType)

@@ -394,7 +413,8 @@
    ;; collection. For example, a provider might specify a collection level ACL that hides all
    ;; collections with a value element set to 15. In ECHO, this field is called RestrictionFlag.
    ;; This field does not exist in DIF.
-   Value])
+   Value
+  ])

 (record-pretty-printer/enable-record-pretty-printing AccessConstraintsType)

@@ -407,7 +427,8 @@
    ;; accompanied by an Altitude Encoding Method description. The datatype for this attribute is the
    ;; value of the attribute VerticalSpatialDomainType. The unit for this attribute is the value of
    ;; either DepthDistanceUnits or AltitudeDistanceUnits.
-   Value])
+   Value
+  ])

 (record-pretty-printer/enable-record-pretty-printing VerticalSpatialDomainType)

@@ -421,7 +442,8 @@

    GPolygons

-   Lines])
+   Lines
+  ])

 (record-pretty-printer/enable-record-pretty-printing GeometryType)

@@ -440,7 +462,8 @@
    ;; The expanded name of the primary sensory instrument. (e.g. Advanced Spaceborne Thermal
    ;; Emission and Reflective Radiometer, Clouds and the Earth's Radiant Energy System, Human
    ;; Observation).
-   Technique])
+   Technique
+  ])

 (record-pretty-printer/enable-record-pretty-printing InstrumentChildType)

@@ -449,7 +472,8 @@
   [
    Longitude

-   Latitude])
+   Latitude
+  ])

 (record-pretty-printer/enable-record-pretty-printing PointType)

@@ -499,7 +523,8 @@
    Issue

    ;; The pubication place of the publication.
-   PublicationPlace])
+   PublicationPlace
+  ])

 (record-pretty-printer/enable-record-pretty-printing PublicationReferenceType)

@@ -520,7 +545,8 @@
    EntryId

    ;; The version of the target metadata record that is associated with this collection record.
-   Version])
+   Version
+  ])

 (record-pretty-printer/enable-record-pretty-printing MetadataAssociationType)

@@ -531,7 +557,8 @@
    Size

    ;; Unit of information, together with Size determines total size in bytes of the data.
-   Unit])
+   Unit
+  ])

 (record-pretty-printer/enable-record-pretty-printing FileSizeType)

@@ -540,7 +567,8 @@
   [
    MinimumValue

-   MaximumValue])
+   MaximumValue
+  ])

 (record-pretty-printer/enable-record-pretty-printing TilingCoordinateType)

@@ -548,7 +576,8 @@
   [
    Boundary

-   ExclusiveZone])
+   ExclusiveZone
+  ])

 (record-pretty-printer/enable-record-pretty-printing GPolygonType)

@@ -557,7 +586,8 @@
 ;; order and closed (the first and last vertices are the same).
 (defrecord BoundaryType
   [
-   Points])
+   Points
+  ])

 (record-pretty-printer/enable-record-pretty-printing BoundaryType)

@@ -582,7 +612,8 @@
    MiddleName

    ;; Last name of the individual.
-   LastName])
+   LastName
+  ])

 (record-pretty-printer/enable-record-pretty-printing ContactPersonType)

@@ -594,7 +625,8 @@

    ;; This is the type of event associated with the date. For example, Creation, Last Revision. Type
    ;; is chosen from a picklist.
-   Type])
+   Type
+  ])

 (record-pretty-printer/enable-record-pretty-printing DateType)

@@ -614,7 +646,8 @@
    Unit

    ;; The datatype of the Characteristic/attribute.
-   DataType])
+   DataType
+  ])

 (record-pretty-printer/enable-record-pretty-printing CharacteristicType)

@@ -643,7 +676,8 @@
    ;; Temporal information about a collection having granules collected at a regularly occurring
    ;; period. Information includes the start and end dates of the period, duration unit and value,
    ;; and cycle duration unit and value.
-   PeriodicDateTimes])
+   PeriodicDateTimes
+  ])

 (record-pretty-printer/enable-record-pretty-printing TemporalExtentType)

@@ -666,7 +700,8 @@
     Description

     ;; The function of the online resource.
-    Function])
+    Function
+   ])

 (record-pretty-printer/enable-record-pretty-printing OnlineResourceType)

@@ -689,7 +724,8 @@
    MimeType

    ;; The estimated or average size of a file downloaded from this site.
-   FileSize])
+   FileSize
+  ])

 (record-pretty-printer/enable-record-pretty-printing RelatedUrlType)

@@ -712,7 +748,8 @@
    ;; The latitude start of the orbit relative to the equator. This is used by the backtrack search
    ;; algorithm to treat the orbit as if it starts from the specified latitude. This is optional and
    ;; will default to 0 if not specified.
-   StartCircularLatitude])
+   StartCircularLatitude
+  ])

 (record-pretty-printer/enable-record-pretty-printing OrbitParametersType)

@@ -744,7 +781,8 @@
    ;; The unit specification of the period cycle duration.
    PeriodCycleDurationUnit

-   PeriodCycleDurationValue])
+   PeriodCycleDurationValue
+  ])

 (record-pretty-printer/enable-record-pretty-printing PeriodicDateTimeType)

@@ -765,6 +803,7 @@
    Country

    ;; The zip or other postal code portion of the physical address.
-   PostalCode])
+   PostalCode
+  ])

 (record-pretty-printer/enable-record-pretty-printing AddressType)


CMR-2274: Changed test slightly to be more idiomatic

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -50,7 +50,7 @@
   to valid XML in the given format."
   [record metadata-format concept-type]
   (let [metadata-xml (core/generate-metadata concept-type metadata-format record)]
-    (vec (core/validate-xml concept-type metadata-format metadata-xml))))
+    (core/validate-xml concept-type metadata-format metadata-xml)))

 (deftest roundrobin-collection-example-record
   (doseq [[origin-format filename] format-examples
@@ -59,7 +59,7 @@
           dest-format destination-formats
           :when (not= origin-format dest-format)]
     (testing (str origin-format " to " dest-format)
-      (is (= [] (generate-and-validate-xml umm-c-record dest-format :collection))))))
+      (is (empty? (generate-and-validate-xml umm-c-record dest-format :collection))))))

 (deftest roundtrip-example-record
   (doseq [metadata-format tested-formats]


PDOK-2699: Add projection to API. This is optional, when the property is not supplied no reprojection is done (similar as running from the command-line

--- src/main/clojure/pdok/featured/api.clj
+++ src/main/clojure/pdok/featured/api.clj
@@ -48,7 +48,8 @@
                                          :options [(s/enum "no-visualization")]}]
    (s/optional-key :callback) URI
    (s/optional-key :no-timeline) boolean
-   (s/optional-key :no-state) boolean})
+   (s/optional-key :no-state) boolean
+   (s/optional-key :projection) s/Str})

 (def ExtractRequest
   "A schema for a JSON extract request"
@@ -102,7 +103,8 @@
   (swap! stats assoc-in [:processing] request)
   (let [persistence (if (:no-state request) (persistence/make-no-state) (config/persistence))
         projectors (cond-> [(config/projectors persistence
-                                       :no-visualization (collections-with-option "no-visualization" (:processingOptions request)))]
+                                               :projection (:projection request)
+                                               :no-visualization (collections-with-option "no-visualization" (:processingOptions request)))]
                     (not (:no-timeline request)) (conj (config/timeline persistence)))
         processor (processor/create (:dataset request) persistence projectors)
         zipped? (= (:format request) "zip")


base commit id as repo id

base commit id as repo id

--- src/clj/geschichte/repo.clj
+++ src/clj/geschichte/repo.clj
@@ -32,13 +32,12 @@
   [description author schema is-public value]
   (let [val-id (*id-fn* value)
         ts (*date-fn*)]
-    {:meta {:id (*id-fn*)
+    {:meta {:id val-id
             :description description
             :schema {:type "http://github.com/ghubber/geschichte"
                      :version 1}
             :public is-public
-            :causal-order {val-id #{}
-                           :root val-id}
+            :causal-order {val-id #{}}
             :branches {"master" #{val-id}}
             :head "master"
             :last-update ts
@@ -103,6 +102,7 @@
   [meta branch]
   (> (count ((:branches meta) branch)) 1))

+
 (defn merge-necessary?
   "Determines whether branch-head is ancestor."
   [cut branch-head]
@@ -136,11 +136,11 @@

 (defn pull
   "Pull all commits into branch from remote-tip (only its ancestors)."
-  ([meta branch remote-meta remote-tip]
-     (let [branch-heads ((:branches meta) branch)
-           lcas (lowest-common-ancestors (:causal-order meta) branch-heads
-                                         (:causal-order remote-meta) #{remote-tip})]
-       (pull-lcas meta branch remote-tip lcas))))
+  [meta branch remote-meta remote-tip]
+  (let [branch-heads ((:branches meta) branch)
+        lcas (lowest-common-ancestors (:causal-order meta) branch-heads
+                                      (:causal-order remote-meta) #{remote-tip})]
+    (pull-lcas meta branch remote-tip lcas)))

 (defn merge-lcas
@@ -153,11 +153,12 @@
                 (set/union source-heads target-heads)
                 value)))

+
 (defn merge-heads
   "Merge source and target heads into source branch with value as commit."
-  ([author schema branch source-meta source-heads target-meta target-heads value]
-     (merge-lcas author schema branch source-meta source-heads target-heads value
-                 (lowest-common-ancestors (:causal-order source-meta)
-                                          source-heads
-                                          (:causal-order target-meta)
-                                          target-heads))))
+  [author schema branch source-meta source-heads target-meta target-heads value]
+  (merge-lcas author schema branch source-meta source-heads target-heads value
+              (lowest-common-ancestors (:causal-order source-meta)
+                                       source-heads
+                                       (:causal-order target-meta)
+                                       target-heads)))