Substitute un-displayable characters for Push.

Trying to display effect names which contained Unicode characters was
crashing. Now they get replaced by ellipses.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -313,12 +313,22 @@
   ;; And record the new state for next time
   (reset! (:last-text-buttons controller) @(:next-text-buttons controller)))

+(defn get-safe-text-byte
+  "Converts a character to be displayed to a byte, but if it is
+  outside the range that can be displayed by the Push, like Unicode,
+  then change it to a byte representing an ellipsis."
+  [c]
+  (let [i (int c)]
+    (if (> i 127)
+      (:ellipsis special-symbols)
+      i)))
+
 (defn write-display-text
   "Update a batch of characters within the display to be rendered on
   the next update."
   [controller row start text]
   {:pre [(<= 0 row 3) (<= 0 start 67)]}
-  (let [bytes (take (- 68 start) (map int text))]
+  (let [bytes (map get-safe-text-byte text)]
     (doseq [[i val] (map-indexed vector bytes)]
       (aset (get (:next-display controller) row) (+ start i) (util/ubyte val)))))

@@ -327,7 +337,7 @@
   display to be rendered on the next update."
   [controller row cell text]
   {:pre [(<= 0 row 3) (<= 0 cell 3)]}
-  (let [bytes (take 17 (concat (map int text) (repeat 32)))]
+  (let [bytes (take 17 (concat (map get-safe-text-byte text) (repeat 32)))]
     (doseq [[i val] (map-indexed vector bytes)]
       (aset (get (:next-display controller) row) (+ (* cell 17) i) (util/ubyte val)))))


Don't wait for compilation to finish when showing code of existing sketch.

--- src/clj/quil_site/controllers/sketches.clj
+++ src/clj/quil_site/controllers/sketches.clj
@@ -93,7 +93,7 @@
         size (extract-size parsed)
         id (future (or id (get-id-for-source source)))]
     {:cljs source
-     :js @js
+     :js js
      :size size
      :id @id}))

@@ -142,6 +142,7 @@

 (defn sketch-js [id]
   (-> (:js (get-sketch id))
+      deref
       (resp/response)
       (resp/content-type "application/javascript")))


fixes on audio core specs

fixes on audio core specs

--- src/cljs/daveconservatoire/audio/core.cljs
+++ src/cljs/daveconservatoire/audio/core.cljs
@@ -125,33 +125,6 @@
 (s/fdef play
   :args (s/cat :sound ::sound-point
                :tracker (s/? #(instance? Atom %))))
-
-;; node-spec
-
-;(defmulti node-spec-type first)
-;(defmulti spec->node first)
-;
-;(defmethod node-spec-type :buffer [_]
-;  (s/cat :name keyword?
-;         :buffer ::buffer))
-;
-;(defmethod spec->node :buffer [s]
-;  (let [{:keys [buffer]} (s/conform ::node-spec s)]
-;    (buffer-node buffer)))
-;
-;(defmethod node-spec-type :out [_]
-;  (s/cat :name keyword?))
-;
-;(defmethod spec->node :out [_] (output))
-;
-;(defmethod node-spec-type :gain [_]
-;  (s/cat :name keyword? :value number?))
-;
-;(defmethod spec->node :gain [s]
-;  (let [{:keys [value]} (s/conform ::node-spec s)]
-;    (gain-node value)))
-;
-;(s/def ::node-spec (s/multi-spec node-spec-type first))

 (defn loop-chan [items start chan]
   {:pre [(s/valid? ::items-list items)
@@ -241,7 +214,7 @@
                 #(s/gen ALL-NOTES)))
 (s/def ::semitone (s/and integer? #(<= 0 % 87)))

-(s/def ::sound (s/or ::note ::semitone))
+(s/def ::sound (s/or :note ::note :semitone ::semitone))

 (declare semitone->note)

@@ -288,7 +261,7 @@
           :let [st (+ base (MAJOR-STEPS p))]]
       (chord st (MAJOR-ARRANGEMENTS p)))))

-(s/def ::scale-position #{0 1 2 3 4 5 6})
+(s/def ::scale-position (s/int-in 0 7))

 (s/fdef major-chord-progression
-  :args (s/cat :base ::sound :progression ()))
+  :args (s/cat :base ::sound :progression (s/coll-of ::scale-position [])))


docstrings!

docstrings!

--- src/cljx/jamesmacaulay/zelkova/signal.cljx
+++ src/cljx/jamesmacaulay/zelkova/signal.cljx
@@ -7,8 +7,7 @@
             [clojure.core.async.impl.protocols :as impl]
             [clojure.core.async.impl.channels :as channels]
             [jamesmacaulay.async-tools.core :as tools]
-            [alandipert.kahn :as kahn]
-            [clojure.pprint :refer [pprint]]))
+            [alandipert.kahn :as kahn]))

 #+cljs
 (ns jamesmacaulay.zelkova.signal
@@ -22,31 +21,42 @@
             [alandipert.kahn :as kahn])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

+; Events come in from "the outside world" and get transformed into Messages by input signal nodes
 (defrecord Event
   [topic value])

 (defprotocol Message
-  (fresh? [msg]))
-
+  "Messages are propagated through the signal graph, and can either be \"fresh\" or \"cached\"."
+  (fresh? [msg] "returns `true` if the message represents a fresh value, `false` otherwise"))
+
+; a box for a "fresh" value
 (defrecord Fresh
   [value]
   Message
   (fresh? [_] true))

+; a box for a "cached" value
 (defrecord Cached
   [value]
   Message
   (fresh? [_] false))

 (defprotocol SignalProtocol
-  (signal-deps [s])
-  (message-emitter [s]))
+  (signal-deps [s] "returns the set of \"parent\" signal which this signal depends on")
+  (message-emitter [s]
+    "returns a map with two entries:
+     * `:sources` is a vector of signals from which to get messages
+     * `:msg-fn` is a function which takes two arguments:
+       - the previous message emitted by this signal
+       - a sequence of new messages emitted by the corresponding signals listed in `:sources`"))

 (defn signal?
+  "returns `true` if the argument satisfies `SignalProtocol`, `false` otherwise"
   [x]
   (satisfies? SignalProtocol x))

 (defn- event-relay
+  "takes a sequence of topics, and returns an input signal which relays matching events as messages to its children"
   [topics]
   (let [topics (if (set? topics) topics (set topics))]
     {:sources [:events]
@@ -64,12 +74,19 @@
           (or deps (:sources message-emitter))))
   (message-emitter [_] message-emitter))

-(defmulti value-source->events-fn
-  (fn [src topic]
+(defmulti ^:private value-source->events-fn
+  "Takes some asynchronous `source` of values, plus an event `topic`, and returns
+  an event-source function. `source` may be one of the following:
+    * a function taking a live graph and an options map, and returns a channel of values
+    * a channel of values
+    * a mult of some such value channel
+  The returned event-source function has the same signature as the functions that can
+  be supplied for the `source` argument, but the values are wrapped as Events."
+  (fn [source topic]
     (cond
-      (satisfies? async/Mult src) :mult
-      (satisfies? impl/ReadPort src) :readport
-      (ifn? src) :ifn)))
+      (satisfies? async/Mult source) :mult
+      (satisfies? impl/ReadPort source) :readport
+      (ifn? source) :ifn)))

 (defmethod value-source->events-fn :ifn
   [src-fn topic]
@@ -88,18 +105,26 @@
                            topic))

 (defn input
+  "Returns an input signal with initial value `init`. The signal propagates values
+  from events which match some `topic`. An asynchronous `value-source` may be provided,
+  which will be used as the default value source for the given event `topic`. `value-source`
+  may take the following forms:
+    * a function taking a live graph and an options map, and returns a channel of values
+    * a channel of values
+    * a mult of some such value channel"
   ([init] (input init (keyword (gensym))))
   ([init topic]
    (map->Signal {:init init
                  :message-emitter (event-relay #{topic})}))
-  ([init topic value-channel-or-fn-or-mult]
-   (let [event-channel-fn (value-source->events-fn value-channel-or-fn-or-mult
+  ([init topic value-source]
+   (let [event-channel-fn (value-source->events-fn value-source
                                                    topic)]
      (map->Signal {:init init
                    :message-emitter (event-relay #{topic})
                    :event-sources {topic event-channel-fn}}))))

 (defn constant
+  "Returns a constant signal of the given value."
   [x]
   (let [cached (->Cached x)]
     (map->Signal {:init x
@@ -107,6 +132,17 @@
                                     :msg-fn (constantly cached)}})))

 (defn pipeline
+  "Takes a transducer `xform`, a fallback value `base`, and a signal `sig`.
+  Returns a new signal which pipes values from `sig` through `xform`. Because
+  transducers may filter out values, you must provide a `base` which will be
+  used as the derived signal's initial value if the initial value of `sig` ends
+  up being filtered. If multiple values are emitted from the transduction of the
+  initial value of `sig`, then the initial value of the new signal will be the
+  _last_ of those emitted. Stateful transducers carry state starting from the
+  computation of the new signal's initial value. So for example a `(drop 3)`
+  transducer will mean that the initial value will be filtered, `base` will
+  be used as a fallback, and then two more values will be dropped before fresh
+  values start being emitted."
   [xform base sig]
   (let [reducer ((comp (core/map :value)
                        xform
@@ -124,6 +160,8 @@
                                     :msg-fn msg-fn}})))

 (defn mapseq
+  "Takes a mapping function `f` and a sequence of signal `sources`, and returns a
+  signal of values obtained by applying `f` to the values from the source signals."
   [f sources]
   (if (empty? sources)
     (constant (f))
@@ -139,10 +177,15 @@
                                       :msg-fn emit-message}}))))

 (defn map
+  "Takes a mapping function `f` and any number of signal `sources`, and returns a
+  signal of values obtained by applying `f` to the values from the source signals."
   [f & sources]
   (mapseq f sources))

 (defn template
+  "Takes a map whose values are signals, to be used as a template. Returns a new
+  signal whose values are maps of the same form as `signal-map`, but with the current
+  value of each signal in place of the signal itself."
   [signal-map]
   (let [ks (keys signal-map)]
     (mapseq (fn [& values]
@@ -150,6 +193,11 @@
              (vals signal-map))))

 (defn foldp
+  "Create a past-dependent signal (\"fold into the past\"). The values of a `foldp`
+  signal are obtained by calling `f` with two arguments: the current value of the
+  `source` signal, and the previous value of the new `foldp` signal (acting as the
+  \"accumulator\"). `init` provides the initial value of the new signal, and
+  therefore acts as the seed accumulator."
   [f init source]
   (map->Signal {:init init
                 :message-emitter {:sources [source]
@@ -158,7 +206,25 @@
                                               (->Fresh (f (:value message)
                                                           (:value acc)))))}}))

+(defn reducep
+  "Create a past-dependent signal like `foldp`, but calls `f` with the arguments
+  reversed to align with Clojure's `reduce`: the first argument is the accumulator,
+  and the second is the current value of `source`. If `init` is omitted, the initial
+  value of the new signal will be obtained by calling `f` with no arguments."
+  ([f source] (reducep f (f) source))
+  ([f init source]
+   (->> source
+        (foldp (fn [val acc] (f acc val)) init)
+        drop-repeats)))
+
+(defn transducep
+  "Like `reducep`, but transforms the reducing function `f` with transducer `xform`."
+  ([xform f source] (reducep (xform f) (f) source))
+  ([xform f init source]
+   (reducep (xform f) init source)))
+
 (defn drop-repeats
+  "Returns a signal which relays values of `sig`, but drops repeated equal values."
   [sig]
   (map->Signal {:init (:init sig)
                 :message-emitter {:sources [sig]
@@ -167,20 +233,12 @@
                                                        (not= (:value msg) (:value prev)))
                                               msg))}}))

-
-(defn reducep
-  ([f source] (reducep f (f) source))
-  ([f init source]
-   (->> source
-        (foldp (fn [val acc] (f acc val)) init)
-        drop-repeats)))
-
-(defn transducep
-  ([xform f source] (reducep (xform f) (f) source))
-  ([xform f init source]
-   (reducep (xform f) init source)))
-
 (defn async
+  "Returns an \"asynchronous\" version of `source`, splitting off a new subgraph which
+  does not maintain consistent event ordering relative to the main graph. In exchange,
+  signals which depend on an `async` signal don't have to wait for the `source` to finish
+  computing new values. This function is mainly useful in multithreaded environments when
+  you don't want a slow computation to block the whole graph."
   [source]
   (let [topic source
         msgs->events (comp cat
@@ -196,6 +254,11 @@
                   :message-emitter (event-relay #{topic})})))

 (defn mergeseq
+  "Takes a sequence of signals `sigs`, and returns a new signal which relays fresh
+  values from all of the source signals. When more than one source has fresh values
+  at the same time, the first (leftmost) signal in `sigs` will take precedence and
+  the other values will be discarded. The initial value of the returned signal is
+  equal to the initial value of the first source signal."
   [sigs]
   (map->Signal {:init (:init (first sigs))
                 :message-emitter {:sources sigs
@@ -203,14 +266,24 @@
                                             (first (filter fresh? messages)))}}))

 (defn merge
+  "Takes any number of source signals `sigs`, and returns a new signal which relays
+  fresh values from all of the source signals. When more than one source has fresh values
+  at the same time, the first (leftmost) signal will take precedence and the other values
+  will be discarded. The initial value of the returned signal is equal to the initial
+  value of the first source signal."
   [& sigs]
   (mergeseq sigs))

 (defn combine
+  "Combines a sequence of signals into a signal of vectors. Equivalent to
+  `(signal/map vector sig1, sig2, ...)`"
   [sigs]
   (mapseq vector sigs))

 (defn sample-on
+  "Sample the current value of `value-sig` every time `sampler-sig` updates with a
+  fresh value. For example, `(sample-on mouse/clicks mouse/position)` returns a signal
+  of click positions."
   [sampler-sig value-sig]
   (map->Signal {:init (:init value-sig)
                 :message-emitter {:sources [sampler-sig value-sig]
@@ -219,10 +292,16 @@
                                               (->Fresh (:value value-msg))))}}))

 (defn count
+  "Returns a signal whose values are the number of fresh values emitted so far from
+  `sig`. Repeated equal values will be counted so long as they are fresh, so if you
+  don't want to count repeats then you need to `(count (drop-repeats sig))` instead."
   [sig]
   (foldp #(inc %2) 0 sig))

 (defn count-if
+  "Like `count`, but only increments the counter if the fresh value emitted from `sig`
+  satisfies the predicate funtion `pred`. For example, `(count-if odd? numbers)` returns
+  a signal of how many times the `numbers` signal emitted an odd number."
   [pred sig]
   (foldp (fn [v c]
            (if (pred v) (inc c) c))
@@ -230,6 +309,10 @@
          sig))

 (defn keep-if
+  "Returns a signal which relays values from `sig`, but discards any which don't match
+  the given predicate function `pred`. A `base` value must be provided in case the initial
+  value of `sig` does not match the predicate, in which case `base` is used as the initial
+  value of the new signal."
   [pred base sig]
   (map->Signal {:init (if (pred (:init sig))
                         (:init sig)
@@ -241,10 +324,13 @@
                                               (->Fresh (:value msg))))}}))

 (defn drop-if
+  "Like `keep-if`, but drops values which match the predicate."
   [pred base sig]
   (keep-if (complement pred) base sig))

 (defn keep-when
+  "Returns a new signal which relays values from `value-sig`, but only when the current
+  value of `switch-sig` is truthy."
   [switch-sig base value-sig]
   (->> value-sig
        (map vector (sample-on value-sig switch-sig))
@@ -252,29 +338,35 @@
        (map second)))

 (defn drop-when
+  "Like `keep-when`, but only relays values when `switch-sig` is falsy."
   [switch-sig base value-sig]
   (keep-when (map not switch-sig) base value-sig))

 (defn log
+  "A little convenience helper which logs signal values with `pr` before propagating them unchanged."
   [sig]
   (map (fn [x] (pr x) x) sig))

 ; helpers:

-(def fresh-values (comp cat
-                        (filter fresh?)
-                        (core/map :value)))
+(def ^{:doc "A transducer which takes in batches of signal graph messages and pipes out fresh values."}
+  fresh-values
+  (comp cat
+        (filter fresh?)
+        (core/map :value)))

 ; compiling graphs:

-(defn node-graph-zipper
+(defn- node-graph-zipper
+  "Takes a signal and returns a zipper which can be used to traverse the signal graph."
   [output-node]
   (zip/zipper (constantly true)
               (comp seq signal-deps)
               nil
               output-node))

-(defn skip-subtree
+(defn- skip-subtree
+  "Returns a new zipper location that skips the whole subtree at `loc`."
   [loc]
   (or (zip/right loc)
       (loop [p loc]
@@ -284,6 +376,7 @@
           [(zip/node p) :end]))))

 (defn output-node->dependency-map
+  "Takes a signal and returns a map of signals to sets of signal dependencies."
   [output-node]
   (loop [deps {}
          loc (node-graph-zipper output-node)]
@@ -301,6 +394,7 @@
                (zip/next loc))))))

 (defn topsort
+  "Takes a signal and returns a topologically sorted sequence of all signals in its graph."
   [output]
   (-> output
       output-node->dependency-map
@@ -311,6 +405,7 @@
   [output-signal sorted-signals])

 (defn compile-graph
+  "Calculate the topological sort of the given signal and return a `CompiledGraph`."
   [output-signal]
   (let [sorted-signals (topsort output-signal)]
     (->CompiledGraph output-signal sorted-signals)))
@@ -318,31 +413,44 @@
 ; dealing with multiple outputs:

 (defn- ensure-sequential
-  [x-or-xs]
+  "Wraps `x` in a vector, if necessary, returning an empty vector if `x` is `nil`."
+  [x]
   (cond
-    (sequential? x-or-xs) x-or-xs
-    (nil? x-or-xs) []
-    :else [x-or-xs]))
+    (sequential? x) x
+    (nil? x) []
+    :else [x]))

 (defn- pad
-  [msg-lists]
-  (if (>= 1 (core/count msg-lists))
-    msg-lists
-    (let [max-count (reduce max (core/map core/count msg-lists))
+  "Takes a collection of message batches, presumably from some corresponding collection
+  of signals. Pads each batch, when necessary, with cached versions of the last message
+  in the batch, such that the returned batches are all the same size."
+  [msg-batches]
+  (if (>= 1 (core/count msg-batches))
+    msg-batches
+    (let [max-count (reduce max (core/map core/count msg-batches))
           pad (fn [msgs]
                 (->> [msgs (-> msgs last :value ->Cached repeat)]
                      (into [] (comp cat (take max-count)))))]
-      (core/map pad msg-lists))))
+      (core/map pad msg-batches))))

 (defn- transpose
-  [msg-lists]
-  (apply core/map vector msg-lists))
+  "Takes a collection of message batches and returns a sequence of vectors of corresponding
+  messages from each batch."
+  [msg-batches]
+  (apply core/map vector msg-batches))

 (defn- wrap-msg-fn
+  "Takes a signal's `msg-fn` and wraps it to provide various behaviours:
+    * return values are turned into sequences with `ensure-sequential`
+    * message batches from each signal are padded and transposed, and `msg-fn` is called
+      once for each vector of messages in the resulting series, as if each were the result
+      of a separate event.
+    * when `msg-fn` returns `nil` or an empty sequence, the previous value is returned as a
+      cached value."
   [msg-fn]
   (let [msg-fn (comp ensure-sequential msg-fn)]
-    (fn [prev msg-payloads]
-      (let [input-series (-> msg-payloads pad transpose)
+    (fn [prev msg-batches]
+      (let [input-series (-> msg-batches pad transpose)
             output-series (->> input-series
                                (reductions msg-fn prev)
                                (into [] (comp cat (drop 1))))]
@@ -451,10 +559,17 @@
     (pipe-to-atom* (spawn* s nil) atm ks)))

 (defn spawn
+  "Take an inert signal and produce a live, running graph."
   ([g] (spawn* g nil))
   ([g opts] (spawn* g opts)))

 (defn pipe-to-atom
+  "Pipes fresh values from a live graph into an atom. If `x` is a signal, it is `spawn`ed
+  as a live graph first. If no atom is provided, then a new atom is created which takes its
+  initial value from that of the given signal or graph. If an existing atom is provided along
+  with a sequence of keys `ks`, then fresh values will be inserted into the atom's value using
+  `swap!` with `assoc-in`. If `ks` is not present, then the whole atom value is replaced with
+  `reset!`."
   ([x]
    (let [live-graph (spawn x)]
      (pipe-to-atom live-graph


Set value for spinner in Freese-Layout in Main Swing Thread

for otherwise stupid things seem to happen

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

--- src/conexp/contrib/draw/control/freese.clj
+++ src/conexp/contrib/draw/control/freese.clj
@@ -37,7 +37,8 @@
                                                                         (cycle (range 0 (* 2 Math/PI) 0.05))),
                                                       :while @rotate-thread]
                                                 (Thread/sleep 50)
-                                                (.setValue spn angle)))))
+                                                (do-swing
+                                                 (.setValue spn angle))))))
                            (.start ^Thread @rotate-thread)),
         stop-rotate     #(when @rotate-thread
                            (.stop ^Thread @rotate-thread)


Actually pass the branch name in to setup-branch.

--- src/incise/deploy/workflows/git_branch.clj
+++ src/incise/deploy/workflows/git_branch.clj
@@ -87,7 +87,7 @@
   (with-repo path
     (let [{source-commit-hash :id} (head-info)
           output-files (once-in-out-dir)]
-      (setup-branch)
+      (setup-branch branch)
       (->> output-files
           (map move-to-work-dir)
           (add-files))


Added run demo#.

Added run demo#.

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -11,7 +11,7 @@

 (defn demo# [pitches]
   (let [start (now)
-        note-length 400
+        note-length 300
         end (+ start (* note-length (count pitches)))
         notes (map vector (range start end note-length) pitches)]
     (play# notes)))
@@ -57,6 +57,10 @@
         (up-or-down a (first bs))
         (run bs))
       [a])))
+
+;(demo# (map g-major
+;            (run [0 3 1 3 -1 0])
+;            ))

 (def melody
   (let [repeats (partial mapcat (partial apply repeat))


Spawn ennemies at the right level

Spawn ennemies at the right level

--- desktop/src-common/con_world/entity-enemy.clj
+++ desktop/src-common/con_world/entity-enemy.clj
@@ -65,7 +65,7 @@

 (defn spawn-enemy [screen entities]
   (let [{:keys [level]} (find-cell entities)
-        index (+ level 1 (u/rand-sign 1))
+        index (inc (rand-int (inc level)))
         [size nb-sprite] (enemy-index index)
         {en-images :sprites stand :first} (image->sprite (str "entities/ennemi" index ".png") size size nb-sprite)
         width (u/pixels->world size)]


Add cljs-only version of find-var for compat

--- src/irresponsible/oolong/util.cljc
+++ src/irresponsible/oolong/util.cljc
@@ -9,6 +9,19 @@
 ;; ## Utility functions
 ;;
 ;; General purpose utility functions
+
+#?(:cljs
+   ;; clojure has this built in but it returns a var or throws.
+   ;; we return an atom so deref works and nil inside if it is not found
+   (defn find-var
+     "Replacement for clojure function which returns a var by name or throws
+      Returns an atom (whose content is nil on failure) so deref works
+      args: [sym]
+      returns: atom"
+     [sym]
+     (try (-> sym str (.replace "/" ".") (.replace "-" "_") js/eval atom)
+        (catch js/Object e
+          (fatal "Could not find var by symbol" {:got sym})))))

 (def qualisym?
   "True if provided arg is a namespace-qualified symbol"


First shot at sequential safety range creation.

--- test/onyx/coordinator/sim_test_utils.clj
+++ test/onyx/coordinator/sim_test_utils.clj
@@ -49,12 +49,23 @@
         (when-not (impl/completed-task? task-node)
           (fact (impl/task-complete? sync task-node) => true))))))

+(defn peer-stack-sequentially-safe?
+  ([state-stack-nodes]
+     (sequential-safety-test
+      (drop-while #(not= (:state %) :acking) state-stack-nodes) [] nil))
+  ([[node & nodes] ranges start]
+     (cond (seq nodes) ranges
+           (nil? start) (if (= (:state node) :acking)
+                          (recur nodes ranges node)
+                          (recur nodes ranges nil))
+           :else (if (some #{(:state node)} #{:idle :revoked :dead})
+                   (recur nodes (conj ranges [start node]) nil)
+                   (recur nodes ranges nil)))))
+
 (defn sequential-safety [sync]
   (doseq [state-path (extensions/bucket sync :peer-state)]
-    (let [states (extensions/children sync state-path)
-          state-data (map (partial extensions/read-place sync) states)
-          active-states (filter #(= (:state %) :active) state-data)]
-      )))
+    (let [states (sort (extensions/children sync state-path))
+          state-data (map (partial extensions/read-place sync) states)])))

 (defn peer-liveness [sync]
   (doseq [state-path (extensions/bucket sync :peer-state)]
@@ -146,3 +157,4 @@
     (let [peer (extensions/create (:sync components) :peer)]
       (swap! cluster assoc peer (create-peer model components peer)))))

+


Add global stub and before contexts to multimethods example

--- src/test/clojure/examples/multimethods.clj
+++ src/test/clojure/examples/multimethods.clj
@@ -12,7 +12,7 @@
   Sodomka, Robert Lachlan, and Stuart Halloway."
   (:use lazytest.describe
 	lazytest.expect.thrown
-	[lazytest.context.stub :only (stub)])
+	[lazytest.context.stub :only (global-stub)])
   (:require [clojure.set :as set]))

 (defn hierarchy-tags
@@ -119,24 +119,22 @@
     (it "...but not its superclasses!"
       (not (isa? h java.util.Collection ::map)))))

-;; Not yet adequate support for this:
-#_(describe "The global hierarchy"
-  (using-once [_ (stub #'clojure.core/global-hierarchy (make-hierarchy))]
+(describe "The global hierarchy"
+  (using-once [_ (global-stub #'clojure.core/global-hierarchy (make-hierarchy))]
     (is-valid-hierarchy @#'clojure.core/global-hierarchy)
-    (testing "when you add some derivations..."
-      (derive ::lion ::cat)
-      (derive ::manx ::cat)
-      (is-valid-hierarchy @#'clojure.core/global-hierarchy))
-    (testing "...isa? sees the derivations"
-      (it (isa? ::lion ::cat))
-      (it (not (isa? ::cat ::lion))))
-    (testing "... you can traverse the derivations"
-      (it (= #{::manx ::lion} (descendants ::cat)))
-      (it (= #{::cat} (parents ::manx)))
-      (it (= #{::cat} (ancestors ::manx))))
-    (testing "then, remove a derivation..."
-      (underive ::manx ::cat))
-    (testing "... traversals update accordingly"
-      (it (= #{::lion} (descendants ::cat)))
-      (it (nil? (parents ::manx)))
-      (it (nil? (ancestors ::manx))))))
+    (using-once "when you add some derivations..."
+		[_ (before (derive ::lion ::cat)
+			   (derive ::manx ::cat))]
+		(testing "...isa? sees the derivations"
+		  (it (isa? ::lion ::cat))
+		  (it (not (isa? ::cat ::lion))))
+		(testing "... you can traverse the derivations"
+		  (it (= #{::manx ::lion} (descendants ::cat)))
+		  (it (= #{::cat} (parents ::manx)))
+		  (it (= #{::cat} (ancestors ::manx))))
+		(using-once "then, remove a derivation..."
+			    [_ (before (underive ::manx ::cat))]
+			    (testing "... traversals update accordingly"
+			      (it (= #{::lion} (descendants ::cat)))
+			      (it (nil? (parents ::manx)))
+			      (it (nil? (ancestors ::manx))))))))


fixed an argument order bug with send

fixed an argument order bug with send

--- src/untangled/client/impl/application.cljc
+++ src/untangled/client/impl/application.cljc
@@ -32,7 +32,7 @@
 (defn real-send
   "Do a properly-plumbed network send. This function recursively strips ui attributes from the tx and pushes the tx over
   the network. It installs the given on-load and on-error handlers to deal with the network response."
-  [net tx on-load on-error on-done]
+  [net tx on-done on-error on-load]
   ; server-side rendering doesn't do networking. Don't care.
   (if #?(:clj  false
          :cljs (implements? net/ProgressiveTransfer net))
@@ -128,9 +128,12 @@
     (let [queue            (get send-queues remote)
           network          (get networking remote)
           response-channel (get response-channels remote)
-          send-complete    (fn [] (go (async/>! response-channel :complete)))]
+          send-complete    (fn []
+                             (log/info "Send complete")
+                             (go (async/>! response-channel :complete)))]
       (go
         (loop [payload (async/<! queue)]
+          (log/info "Payload pulled")
           (send-payload network payload send-complete)      ; async call. Calls send-complete when done
           (async/<! response-channel)                       ; block until send-complete
           (recur (async/<! queue)))))))


- Added way to match type patterns re-using aspectJ's type-matcher

--- damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
+++ damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
@@ -12,12 +12,13 @@
   (:import
     [org.eclipse.ajdt.core.model AJProjectModelFacade AJRelationshipType AJRelationshipManager]
     [org.aspectj.weaver.model AsmRelationshipProvider]
-    [org.aspectj.weaver.patterns Pointcut AndPointcut Declare DeclarePrecedence DeclareAnnotation DeclareErrorOrWarning DeclareParents DeclarePrecedence DeclareSoft DeclareTypeErrorOrWarning]
+    [org.aspectj.weaver.patterns Pointcut AndPointcut Declare DeclarePrecedence DeclareAnnotation DeclareErrorOrWarning DeclareParents DeclarePrecedence DeclareSoft DeclareTypeErrorOrWarning PatternParser]
     [damp.ekeko EkekoModel]
     [damp.ekeko.aspectj AspectJProjectModel]
     [org.aspectj.weaver AnnotationAJ Advice AdviceKind World ResolvedTypeMunger ConcreteTypeMunger ReferenceType UnresolvedType ResolvedType  Member ResolvedMemberImpl]
     [org.aspectj.asm AsmManager IProgramElement IProgramElement$Kind IHierarchy ]
     [org.aspectj.weaver.bcel BcelTypeMunger]
+    [org.aspectj.weaver.tools StandardPointcutParser TypePatternMatcher]
     [org.aspectj.apache.bcel.classfile.annotation ElementValue AnnotationElementValue ArrayElementValue ClassElementValue EnumElementValue SimpleElementValue]
     ))

@@ -2299,4 +2300,20 @@
     (method ?method)
     (equals ?name (.getName ?method))))

-
+;;pointcut type matching
+
+(defn
+  match-type|pattern
+  "non relational match to a type given a type pattern"
+  [?type ?pat]
+  (fresh
+    [?pattern ?parsedPat ?w]
+    (v+ ?pat)
+    (type ?type)
+    (weaverworld ?w)
+    (equals ?pattern (.parseTypePattern (new PatternParser ?pat)))
+    (equals (lvar) (.resolve ?pattern ?w)) ;;Witness the horror (How do you invoke void methods?)
+    (equals true (.matchesStatically ?pattern ?type))))
+
+
+


improve (add-complement) performance slightly

--- src/babel/forest.cljc
+++ src/babel/forest.cljc
@@ -8,9 +8,9 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [clojure.string :as string]
-   [dag_unify.core :refer (dissoc-paths get-in fail? fail-path-between lazy-shuffle
+   [dag_unify.core :refer (copy dissoc-paths get-in fail? fail-path-between lazy-shuffle
                                         ref? remove-false remove-top-values-log
-                                        strip-refs show-spec unifyc)]))
+                                        strip-refs show-spec unify unifyc)]))
 (def concurrent false)
 (declare path-to-map)
 (declare add-complement)
@@ -213,9 +213,9 @@
                                                          (morph bolt) "]: trying lexical complement:" (morph complement)
                                                          ))
                                    result
-                                   (unifyc bolt
+                                   (unify  (copy bolt)
                                            (path-to-map path
-                                                        complement))
+                                                        (copy complement)))
                                    is-fail? (fail? result)]
                                (if is-fail?
                                  (do


updated error message to reflect the mistake I made personally

--- src/midje/internal_ideas/fakes.clj
+++ src/midje/internal_ideas/fakes.clj
@@ -66,7 +66,8 @@
     (throw throwable)))

 (defmethod make-result-supplier* :default [arrow result-stream]
-  (throw (user-error "It's likely you misparenthesized your metaconstant prerequisite.")))
+  (throw (user-error "It's likely you misparenthesized your metaconstant prerequisite,"
+                     "or that you forgot to use an arrow in your provided form.")))

 (defmacro make-result-supplier [arrow rhs]
   (if (= (name =streams=>) (name arrow))


reserved slug must-read

reserved slug must-read

--- src/oc/storage/resources/board.clj
+++ src/oc/storage/resources/board.clj
@@ -62,7 +62,7 @@

 ;; ----- Board Slug -----

-(def reserved-slugs #{"create-board" "settings" "boards" "all-posts" "drafts"})
+(def reserved-slugs #{"create-board" "settings" "boards" "all-posts" "drafts" "must-read"})

 (declare list-boards-by-org)
 (defn taken-slugs


Get all relevant information from marc21

- source-date
- braille-grade
- producer_brief
- rucksackbuch-number
- etc

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -16,32 +16,36 @@
   {:record-id [:controlfield (attr= :tag "001")]
    :title [:datafield (attr= :tag "245") :subfield (attr= :code "a")]
    :subtitle [:datafield (attr= :tag "245") :subfield (attr= :code "b")]
+   :name-of-part [:datafield (attr= :tag "245") :subfield (attr= :code "p")] ; Bandangabe
    :creator [:datafield (attr= :tag "100") :subfield] ; autor
    :source [:datafield (attr= :tag "020") :subfield] ; isbn
    :description [:datafield (attr= :tag "520") :subfield] ; abstract
-   :volume [:datafield (attr= :tag "520") :fixme] ; Bandangabe
+   :volumes [:datafield (attr= :tag "300") :subfield (attr= :code "9")] ; Anzahl Medien
    :source_publisher [:datafield (attr= :tag "534") :subfield (attr= :code "c")] ; Verlag
-   :source_date [:datafield (attr= :tag "534") :subfield (attr= :code "d")] ; Erscheinungsjahr
+   :source-date [:datafield (attr= :tag "534") :subfield (attr= :code "d")] ; Erscheinungsjahr
    :language [:datafield (attr= :tag "041") :subfield (attr= :code "a")] ; Sprache
-   :general-note [:datafield (attr= :tag "500") :subfield (attr= :code "a")]
+   :general-note [:datafield (attr= :tag "500") :subfield (attr= :code "a")] ; Land, Erscheinungsjahr (des Originalfilms)
+   :accompanying_material [:datafield (attr= :tag "300") :subfield (attr= :code "e")] ; Begleitmaterial
    :personel-name [:datafield (attr= :tag "700") :subfield (attr= :code "a")] ; Regie oder Darsteller
    :personel-relator-term [:datafield (attr= :tag "700") :subfield (attr= :code "e")]
    :narrator [:datafield (attr= :tag "709") :subfield (attr= :code "a")] ; Sprecher
    :duration [:datafield (attr= :tag "391") :subfield (attr= :code "a")] ; Spieldauer
+   :braille-grade-raw [:datafield (attr= :tag "392") :subfield (attr= :code "a")] ; Schriftart Braille
+   :braille-music-grade-raw [:datafield (attr= :tag "393") :subfield (attr= :code "a")] ; Schriftart Braille
    :producer [:datafield (attr= :tag "260") :subfield (attr= :code "b")] ; Produzent
    :producer-raw [:datafield (attr= :tag "260") :subfield (attr= :code "9")] ; a number that determines Produzent Kürzel und Stadt
    :producer_place [:datafield (attr= :tag "260") :subfield (attr= :code "a")] ; Produzent Stadt
    :produced_date [:datafield (attr= :tag "260") :subfield (attr= :code "c")]
-   :produced_commercially [:datafield (attr= :tag "260") :subfield (attr= :code "d")] ; kommerziell?
-   :rucksackbuch [:datafield (attr= :tag "260") :subfield (attr= :code "d")] ; rucksackbuch?
+   :produced_commercially? [:datafield (attr= :tag "260") :subfield (attr= :code "d")] ; kommerziell?
+   :series-title-raw [:datafield (attr= :tag "830") :subfield (attr= :code "a")] ; u.a. Rucksackbuch
+   :series-volume-raw [:datafield (attr= :tag "830") :subfield (attr= :code "v")]
    :format-raw [:datafield (attr= :tag "091") :subfield (attr= :code "c")]
    :genre-raw [:datafield (attr= :tag "099") :subfield (attr= :code "b")]
+   :genre-code [:datafield (attr= :tag "099") :subfield (attr= :code "a")] ; used for movie genre i.e. Filmkategorie
    :library_signature [:datafield (attr= :tag "091") :subfield (attr= :code "a")] ; Signaturen
    :price [:datafield (attr= :tag "024") :subfield (attr= :code "c")] ; Preis
-   :contraction [:datafield (attr= :tag "024") :fixme] ; Schriftart
-   :movie_country [:datafield (attr= :tag "024") :fixme] ; Film Land
-   :movie_category [:datafield (attr= :tag "024") :fixme] ; Filmkategorie
    :game_category [:datafield (attr= :tag "024") :fixme] ; Spiel-Systematikgruppe
+   :game_description [:datafield (attr= :tag "300") :subfield (attr= :code "a")] ; Beschreibung von Spielen
    :game_materials [:datafield (attr= :tag "024") :fixme] ; Spiel-Materialdetails
    })

@@ -115,6 +119,17 @@
    50 "BSVÖ, Wien"
    103 "Paderborn"})

+(def genre-code-to-genre
+  "Mapping between genre-code and genre. Used for movies"
+  {"I1" :spielfilm
+   "I2" :dokumentarfilm
+   "I3" :mundartfilm})
+
+(def braille-grade-raw-to-braille-grade
+  "Mapping between braille-grade-raw and braille-grade"
+  {"kr" :kurzschrift
+   "vd" :vollschrift})
+
 (def CatalogItem
   {:record-id s/Str
    :title s/Str
@@ -122,7 +137,7 @@
    :creator s/Str
    (s/optional-key :description) s/Str
    :source_publisher s/Str
-   :source_date s/Inst
+   :source-date s/Inst
    :language (apply s/enum (conj (vals iso-639-2-to-iso-639-1) "und"))
    (s/optional-key :genre) (apply s/enum (vals genre-raw-to-genre))
    (s/optional-key :subgenre) (apply s/enum (vals genre-raw-to-subgenre))
@@ -143,19 +158,38 @@
   [record path]
   (some-> (apply xml1-> record path) text))

+(defn get-year
+  "Grab the date year out of a string. Return nil if `s` cannot be
+  parsed."
+  [s]
+  (when-let [year (and s (re-find #"\d{4}" s))]
+    (time.coerce/to-date
+     (time.format/parse (time.format/formatters :year) year))))
+
 (defn clean-raw-item
   "Return a proper production based on a raw item, i.e.
   translate the language tag into proper ISO 639-1 codes"
-  [{:keys [genre-raw language format-raw producer-raw] :as item :or {genre-raw "x01"}}]
+  [{:keys [genre-raw genre-code language format-raw producer-raw
+           produced_commercially? source-date general-note
+           series-title-raw series-volume-raw braille-grade-raw] :as item
+    :or {genre-raw "x01"}}]
   (-> item
       (assoc-some
        :language (iso-639-2-to-iso-639-1 language)
-       :genre (genre-raw-to-genre (subs genre-raw 0 1))
+       :genre (or (genre-raw-to-genre (subs genre-raw 0 1))
+                  (genre-code-to-genre (subs genre-code 0 2)))
        :sub-genre (genre-raw-to-subgenre (subs genre-raw 0 3))
        :format (format-raw-to-format format-raw)
-       :producer_brief (producer-raw-to-producer (Integer/parseInt producer-raw)
-                                                 (format "FIXME: %s" producer-raw)))
-      (dissoc :genre-raw :format-raw producer-raw)))
+       :producer_brief (producer-raw-to-producer (Integer/parseInt producer-raw))
+       :produced_commercially? (some? produced_commercially?)
+       :rucksackbuch-number (when (and series-title-raw
+                                       (re-find #"^Rucksackbuch" series-title-raw))
+                              (Integer/parseInt series-volume-raw))
+       :braille-grade (braille-grade-raw-to-braille-grade braille-grade-raw)
+       :source-date (get-year source-date)
+       :movie_country (when general-note (second (re-find #"^Originalversion: (.*)$" general-note))))
+      (dissoc :genre-raw :genre-code :format-raw :producer-raw
+              :series-title-raw :series-volume-raw)))

 (defn order-and-group [items]
   (->>


Emitting output word-wrapped.

Emitting output word-wrapped.

--- src/cbfg/zgo/core.clj
+++ src/cbfg/zgo/core.clj
@@ -1,8 +1,17 @@
 (ns cbfg.zgo.core
   (:gen-class)
-  (:require [clojure.tools.reader :as r]
+  (:require [clojure.string :as string]
+            [clojure.tools.reader :as r]
             [clojure.tools.reader.reader-types :as rt]
             [clojure.pprint :refer [pprint]]))
+
+(def OUT-WIDTH 50)
+
+(defn word-wrap [width s]
+  (re-seq (re-pattern (str ".{0," width "}\\s")) s))
+
+(defn ljust [width s]
+  (format (str "%-" width "s:") s))

 (defn pprintm [x]
   (binding [*print-meta* true]
@@ -36,11 +45,14 @@
     [(or (:line (meta form)) MAX-LINE)
      (or (:end-line (meta form)) MIN-LINE)]))

+(defn j [v]
+  (string/join " " (flatten v)))
+
 (defn process-top-level-form [smodel form]
   (let [[op name & rest] form]
     (case (str op)
-      "ns" [["package" name] (line-range form)]
-      "defn" [["func" name] (line-range form)]
+      "ns" [(j ["package" name]) (line-range form)]
+      "defn" [(j ["func" name form]) (line-range form)]
       "UNKNOWN-TOP-LEVEL-FORM")))

 (defn process-top-level-forms [smodel]
@@ -53,9 +65,19 @@
        (subvec lines (dec beg) end)))

 (defn emit-merged-lines [out numbered-slines]
-  (doseq [[i line] numbered-slines]
-    (println "//" i line))
-  (println "out>>>" out))
+  (loop [olines (word-wrap (dec OUT-WIDTH) out)
+         slines numbered-slines]
+    (let [oline (first olines)
+          [i sline] (first slines)]
+      (cond
+       (and oline sline) (do (println (ljust OUT-WIDTH oline) "//" i sline)
+                             (recur (rest olines) (rest slines)))
+       (seq oline) (do (println oline)
+                       (recur (rest olines) (rest slines)))
+
+       (seq sline) (do (println (ljust OUT-WIDTH "") "//" i sline)
+                       (recur (rest olines) (rest slines)))
+       :done nil))))

 (defn emit [slines pmodel-in]
   (loop [last-line 0


Added c2g and process-fn placeholder.

Added c2g and process-fn placeholder.

--- src/cbfg/zgo/core.clj
+++ src/cbfg/zgo/core.clj
@@ -43,11 +43,24 @@

 (defn j [v] (string/join " " (flatten v)))

+(defn c2g [sym]
+  (string/replace (str sym) "-" "_"))
+
+(defn process-fn-body [params body]
+  body)
+
+(defn process-fn [params body]
+  ["func" ["(" (interpose "," (map c2g params)) ")"]
+   "{" (process-fn-body params body) "}"])
+
+(defn process-defn [name params body]
+  ["func" (c2g name) (rest (process-fn params body))])
+
 (defn process-top-level-form [smodel form]
-  (let [[op name & rest] form]
+  (let [[op name & more] form]
     (case (str op)
       "ns" [(j ["package" name]) (line-range form)]
-      "defn" [(j ["func" name form]) (line-range form)]
+      "defn" [(j (process-defn name (first more) (rest more))) (line-range form)]
       "UNKNOWN-TOP-LEVEL-FORM")))

 (defn process-top-level-forms [smodel]


adding sql predicates

adding sql predicates

--- src/chazel/chazel.clj
+++ src/chazel/chazel.clj
@@ -4,6 +4,7 @@
             [clojure.tools.logging :refer [warn]])
   (:import [java.util Collection Map]
            [com.hazelcast.core Hazelcast IMap]
+           [com.hazelcast.query SqlPredicate]
            [com.hazelcast.client HazelcastClient]
            [com.hazelcast.client.impl HazelcastClientProxy]
            [com.hazelcast.client.config ClientConfig]
@@ -120,3 +121,6 @@
    (add-index m index false))
   ([^IMap m index ordered?]
    (.addIndex m index ordered?)))
+
+(defn select [m where]
+  (.values m (SqlPredicate. where)))


* src/clj/cljs/core.clj: tweak reify macro

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -304,18 +304,20 @@

 (defmacro reify [& impls]
   (let [t      (gensym "t")
+        meta-sym (gensym "meta")
+        this-sym (gensym "_")
         locals (keys (:locals &env))
         ns     (-> &env :ns :name)
         munge  cljs.compiler/munge
         ns-t   (list 'js* (core/str (munge ns) "." (munge t)))]
     `(do
        (when (undefined? ~ns-t)
-         (deftype ~t [~@locals __meta#]
+         (deftype ~t [~@locals ~meta-sym]
            IWithMeta
-           (~'-with-meta [_# __meta#]
-             (new ~t ~@locals __meta#))
+           (~'-with-meta [~this-sym ~meta-sym]
+             (new ~t ~@locals ~meta-sym))
            IMeta
-           (~'-meta [_#] __meta#)
+           (~'-meta [~this-sym] ~meta-sym)
            ~@impls))
        (new ~t ~@locals nil))))


CLJS-622: better error reporting for zero arity protocol methods

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -1008,6 +1008,9 @@
         fqn (fn [n] (symbol (core/str ns-name "." n)))
         prefix (protocol-prefix p)
         methods (if (core/string? (first doc+methods)) (next doc+methods) doc+methods)
+        _ (core/doseq [[mname & arities] methods]
+            (when (some #{0} (map count arities))
+              (throw (Exception. (core/str "Invalid protocol, " psym " defines method " mname " with arity 0")))))
         expand-sig (fn [fname slot sig]
                      `(~sig
                        (if (and ~(first sig) (. ~(first sig) ~(symbol (core/str "-" slot)))) ;; Property access needed here.


Pass the card dealing damage to the :pre-damage event.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -449,10 +449,10 @@

 (defn damage
   ([state side type n] (damage state side type n nil))
-  ([state side type n {:keys [unpreventable unboostable] :as args}]
+  ([state side type n {:keys [unpreventable unboostable card] :as args}]
     (swap! state update-in [:damage :damage-bonus] dissoc type)
     (swap! state update-in [:damage :damage-prevent] dissoc type)
-    (trigger-event state side :pre-damage type)
+    (trigger-event state side :pre-damage type card)
     (let [n (damage-count state side type n args)]
          (let [prevent (get-in @state [:damage :prevent type])]
               (if (and (not unpreventable) prevent (> (count prevent) 0))


adding windows auth

adding windows auth

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -11,7 +11,7 @@
                             HttpEntityEnclosingRequest
                             HttpResponse Header HttpHost
                             HttpResponseInterceptor)
-           (org.apache.http.auth UsernamePasswordCredentials AuthScope)
+           (org.apache.http.auth UsernamePasswordCredentials AuthScope NTCredentials)
            (org.apache.http.params CoreConnectionPNames)
            (org.apache.http.client HttpClient HttpRequestRetryHandler)
            (org.apache.http.client.methods HttpDelete
@@ -213,7 +213,7 @@
   [{:keys [request-method scheme server-name server-port uri query-string
            headers body multipart socket-timeout conn-timeout proxy-host
            proxy-ignore-hosts proxy-port proxy-user proxy-pass as cookie-store
-           retry-handler response-interceptor digest-auth connection-manager
+           retry-handler response-interceptor digest-auth ntml-auth connection-manager
            client-params]
     :as req}]
   (let [^ClientConnectionManager conn-mgr
@@ -244,6 +244,12 @@
        (.getCredentialsProvider http-client)
        (AuthScope. nil -1 nil)
        (UsernamePasswordCredentials. user pass)))
+    (when-let [[user password host domain] ntml-auth]
+      (.setCredentials
+       (.getCredentialsProvider http-client)
+       (AuthScope. nil -1 nil)
+       (NTCredentials. user pass host domain)))
+
     (when (and proxy-user proxy-pass)
       (let [authscope (AuthScope. proxy-host proxy-port)
             creds (UsernamePasswordCredentials. proxy-user proxy-pass)]


pipeline

pipeline

--- test/celestial/integration/persistency.clj
+++ test/celestial/integration/persistency.clj
@@ -47,7 +47,7 @@
         (with-redefs [p/curr-user (fn [] "foo")]
           (p/add-user {:username "foo" :password "bla" :roles {}})
           (p/add-quota (assoc-in user-quota [:quotas :proxmox :used] nil))
-          (p/increase-use 1 redis-prox-spec) => nil
+          (p/increase-use 1 redis-prox-spec) => "OK"
           (:quotas (p/get-quota "foo"))  => (contains {:proxmox {:limit 2 :used #{1}}})
           (p/increase-use 2  redis-prox-spec)
           (:quotas (p/get-quota "foo"))  => (contains {:proxmox {:limit 2 :used #{1 2}}})


reset *print-length* dynamic var to ensure all data is printed out

--- src/overtone/config/file_store.clj
+++ src/overtone/config/file_store.clj
@@ -21,7 +21,8 @@
 (defmethod write-file-store :file
   [path data]
   (locking F-LOCK
-    (spit path (with-out-str (pprint data)))))
+    (with-binding [*print-length* nil]
+      (spit path (with-out-str (pprint data))))))

 (defmethod read-file-store :file
   [path]


js for replaceprices and test

js for replaceprices and test

--- src/complico/core.clj
+++ src/complico/core.clj
@@ -9,23 +9,31 @@
 (defn request-url-page [url]
   (:body (client/get url)))

-(defn create-link-greasing-js [server port]
+(defn create-js [server port]
   (str "
   "))

 (def start-page-html
   "Show prices")
 (def price-page-html
- "
XXX
")
+ "
3
")

 (defroutes my-handler
   (GET "/test_start_page" []
@@ -33,7 +41,7 @@
   (GET "/test_page_with_prices" []
     price-page-html)
   (GET "/convert" {params :query-params server :server-name port :server-port}
-    (str (request-url-page (params "url")) (create-link-greasing-js server port))))
+    (str (request-url-page (params "url")) (create-js server port))))

 ; needed to gain access to query parameters in my-handler
 (def app


Correct the `:id` given to `on-change` interceptor  (ie. fix cut and paste typo)

--- src/re_frame/std_interceptors.cljc
+++ src/re_frame/std_interceptors.cljc
@@ -270,7 +270,7 @@
   "
   [f out-path & in-paths]
   (->interceptor
-    :id    :enrich
+    :id    :on-changes
     :after (fn on-change-after
              [context]
              (let [new-db   (get-effect context :db)


JWT authenticated users have write capabilities (#622)

--- src/ctia/auth/jwt.clj
+++ src/ctia/auth/jwt.clj
@@ -2,6 +2,11 @@
   (:require [ctia.auth :as auth]
             [clj-momo.lib.set :refer [as-set]]
             [clojure.set :as set]))
+
+(def ^:private write-capabilities
+  (set/difference auth/all-capabilities
+                  #{:specify-id
+                    :developer}))

 (defrecord Identity [jwt]
   auth/IIdentity
@@ -12,7 +17,7 @@
   (groups [_]
     (remove nil? [(:business_guid jwt)]))
   (allowed-capabilities [_]
-    (:user auth/default-capabilities))
+    write-capabilities)
   (capable? [this required-capabilities]
     (set/subset? (as-set required-capabilities)
                  (auth/allowed-capabilities this))))


adding inspect adding start params

adding inspect adding start params

--- src/docker/client.clj
+++ src/docker/client.clj
@@ -16,7 +16,7 @@
    :attach-stderr true :port-specs nil :tty false
    :open-stdin false :stdin-once false :env nil
    :dns nil :volumes {} :volumes-from ""
-   :working-dir "" :exposed-ports { "22/tcp" {}}})
+   :working-dir "" :exposed-ports {}})

 (defn create
    "Create a new container instance"
@@ -24,54 +24,76 @@
   {:pre [(every? (partial contains? spec) [:image :memory] )]}
   (r/docker-post node "containers/create" (merge defaults spec)))

+(defn to-params
+   "converts a map into a url params"
+   [m]
+  (s/join "&" (map (fn [[k v]] (<< "~(name k)=~(str v)")) m)))
+
 (defn start
    "Start a new container instance"
-   [node id]
-  (r/docker-post node (<< "containers/~{id}/start") {}))
+   [node id m]
+  (r/docker-post node (<< "containers/~{id}/start") m))

 (defn stop
    "Start a new container instance"
   ([node id] (stop node id 5))
   ([node id timeout] (r/docker-post node (<< "containers/~{id}/stop?t~{timeout}") {})))

-(defn to-params
-   "converts a map into a url params"
-   [m]
-  (reduce (fn [r [k v]] (<< "~{r}&~(name k)=~(str v)")) ""
-    (update-in m [:config] r/camelize)))
-
 (defn commit
   "Commit a container into an image"
   [node id m]
   {:pre [(every? (partial contains? m) [:m :repo])]}
-  (r/docker-post node (<< "commit?container=~{id}~(to-params m)") {}))
+  (let [args (update-in (assoc m :container id) [:config] r/camelize)]
+    (r/docker-post node (<< "commit?~(to-params args)") {})))

 (defn delete
-  "Delete a container"
-  [node id]
-  (r/docker-delete node "containers/~{id}?v=1"))
+  "Delete a container (optionaly clearing volumes)"
+  ([node id] (delete node id true))
+  ([node id clear-vs] (r/docker-delete node (<< "containers/~{id}?v=~{clear-vs}"))))
+
+(defn inspect
+   "retuns container status"
+   [node id]
+   (r/docker-get node (<< "containers/~{id}/json")))

 (defn find-image
   "find image id from tags, a tag has the form ubuntu:precise"
   [node tag]
   (find-first (fn [{:keys [repo-tags]}] (find-first #{tag} repo-tags))
-              (r/docker-get node "images/json?all=0")))
+    (r/docker-get node "images/json?all=0")))

 (defn list-containers
   "list all containers"
-  [node]
-  (r/docker-get node "containers/json?all=0"))
+  [node m]
+  (r/docker-get node (<< "containers/json?~(to-params m)")))
+
+(comment
+  (defmacro trace-error [call]
+   `(try
+      ~call
+     (catch Throwable e# (println e#)))
+    )
+
+  (def id "1901ac2149b30bc39c3e7357455bb8929318e67ba4f7e09ffb51ed3adde2480e")
+
+  (list-containers :local {:all false})
+
+  (create :local {:image "narkisr:latest" :memory 0 :args ["-d" "-n"]})
+
+  (trace-error
+    (start :local id
+     {:binds ["/tmp:/tmp"]
+      :port-bindings {"22/tcp" [{ :host-port "2222" }]}}))
+
+  (stop :local id)
+  (delete :local id)
+
+  (commit :local id
+     {:m "latest changes" :tag "v1" :author "ronen" :repo "narkisr"
+      :config {:cmd ["cat" "/world"] :port-specs ["22"]}})
+
+  (find-image :local "narkisr/latest")
+  (clojure.pprint/pprint (:config (inspect :local )))
+  )

-(comment
-  (-> (list-containers :local) first :id)
-  (start :local "0870ab0ded8a260cd18021151399a58c7b65e1351e83348b544aa05f623c1307")
-  (commit :local "0870ab0ded8a260cd18021151399a58c7b65e1351e83348b544aa05f623c1307"
-     {:m "latest changes" :tag "v1" :author "ronen" :repo "narkisr"
-      :config {:cmd ["cat" "/world"] :port-specs ["22"]}})
-  (create :local {:image "b36f06432104" :memory 0 :args ["-d" "-n"]})
-  (stop :local "")
-  (delete :local "")
-  (find-image :local "narkisr/sshd:latest"))
-
-


Comment for focus manager

Comment for focus manager

--- src/flatgui/focus.clj
+++ src/flatgui/focus.clj
@@ -91,7 +91,12 @@
         (sort-lines-by-y (sort-each-line-by-x lines) line-y1)))))

 ;;; Sorts focusable components so that they are traversed in left->right, up->down direction.
-;;; To make such ad order, arranges components in a vector of horizontal "lines"
+;;; To make such an order, arranges components in a vector of horizontal "lines".
+;;;
+;;;  NOTE:
+;;; This implementation is slow. For containers that have frequenlty moving children, it's better
+;;; to wrap it into another function that would call this one in rare cases (e.g. only when :children
+;;; change)
 (fg/defevolverfn :focus-traversal-order
   (let [accepting-children (get-accepting-children component)]
     (if (pos? (count accepting-children))


Fixed how the server starts after generalising to authentication level

--- src/freecoin/core.clj
+++ src/freecoin/core.clj
@@ -181,9 +181,14 @@
                                 {:ttl-password-recovery (config/ttl-password-recovery config-m)})
             blockchain         (blockchain/new-mongo stores-m)
             email-conf         (clojure.edn/read-string (slurp (:email-config config-m)))
-            email-authenticator    (just-auth.messaging/->AccountActivator email-conf (:account-store stores-m))
-            email-authenticator (just-auth.messaging/->PasswordRecoverer email-conf (:password-recovery-store stores-m))
-            server             (-> (create-app config-m stores-m blockchain email-authenticator email-authenticator)
+            account-activator    (just-auth.messaging/->AccountActivator email-conf (:account-store stores-m))
+            password-recoverer (just-auth.messaging/->PasswordRecoverer email-conf (:password-recovery-store stores-m))
+            email-authenticator (just-auth.core/new-email-based-authentication
+                                 (select-keys stores-m [:account-store :password-recovery-store])
+                                 account-activator password-recoverer
+                                 {:hash-fn buddy.hashers/derive :hash-check-fn buddy.hashers/check})
+            server             (-> (create-app (assoc config-m
+                                                      :admin-email "aspra@dyne.org") stores-m blockchain email-authenticator)
                                    (server/run-server {:port (config/port config-m)
                                                        :host (config/host config-m)}))]
         (assoc app-state
@@ -223,7 +228,10 @@
                        blockchain         (blockchain/new-mongo stores-m)
                        account-activator (just-auth.messaging/->AccountActivator email-conf (:account-store stores-m))
                        password-recoverer (just-auth.messaging/->PasswordRecoverer email-conf (:password-recovery-store stores-m))
-                       email-authenticator (just-auth.core/new-email-based-authentication stores-m account-activator password-recoverer {:hash-fn buddy.hashers/derive :hash-check-fn buddy.hashers/check})]
+                       email-authenticator (just-auth.core/new-email-based-authentication
+                                            (select-keys stores-m [:account-store :password-recovery-store])
+                                            account-activator password-recoverer
+                                            {:hash-fn buddy.hashers/derive :hash-check-fn buddy.hashers/check})]
                    (prn "Restarting server....")
                    (create-app config-m stores-m blockchain email-authenticator)))))


Fix path ID

Fix path ID

--- src/whisper2cyanite/path_store.clj
+++ src/whisper2cyanite/path_store.clj
@@ -5,6 +5,11 @@
             [clojurewerkz.elastisch.rest.document :as esrd]
             [clojure.tools.logging :as log]
             [whisper2cyanite.logging :as wlog]))
+
+(defprotocol PathStore
+  (insert [this tenant path])
+  (exist? [this tenant path])
+  (shutdown [this]))

 (def ^:const default-es-index "cyanite_paths")
 (def ^:const es-def-type "path")
@@ -15,7 +20,7 @@
                 :properties {:tenant {:type "string" :index "not_analyzed"}
                              :path {:type "string" :index "not_analyzed"}}}})

-(defn get-all-paths
+(defn- get-all-paths
   "Get all paths."
   [tenant path]
   (let [parts (str/split path #"\.")
@@ -27,10 +32,10 @@
             :leaf (= depth parts-count)})
          (range 1 (inc parts-count)))))

-(defprotocol PathStore
-  (insert [this tenant path])
-  (exist? [this path])
-  (shutdown [this]))
+(defn- constuct-id
+  "Construct ID."
+  [path tenant]
+  (str path "_" tenant))

 (defn elasticsearch-metric-store
   "Elasticsearch path store."
@@ -51,14 +56,15 @@
       PathStore
       (insert [this tenant path]
         (try
-          (dorun (map #(when-not (exists-fn (:path %))
-                         (update-fn (:path %) %))
+          (dorun (map #(let [id (constuct-id (:tenant %) (:path %))]
+                         (when-not (exists-fn id)
+                           (update-fn id %)))
                       (get-all-paths tenant path)))
           (catch Exception e
             (wlog/error "Path store error: " e))))
-      (exist? [this path]
+      (exist? [this tenant path]
         (try
-          (exists-fn path)
+          (exists-fn (constuct-id tenant path))
           (catch Exception e
             (wlog/error "Path store error: " e))))
       (shutdown [this]


Work on 11174

Work on 11174

--- src/clj_simple_chart/ssb/data/sal_av_petroleumsprodukt_11174.clj
+++ src/clj_simple_chart/ssb/data/sal_av_petroleumsprodukt_11174.clj
@@ -1,8 +1,24 @@
 (ns clj-simple-chart.ssb.data.sal-av-petroleumsprodukt-11174
-  (:require [clj-simple-chart.ssb.data.ssb-pull :as sf]))
+  (:require [clj-simple-chart.ssb.data.ssb-api :as ssb]
+            [clojure.test :as test]
+            [clj-simple-chart.csv.csvmap :as csv]))

-(def data (sf/pull-parse 11174 {"ContentsCode" "Salg"
+; 11174: Salg av petroleumsprodukter, etter kjøpegruppe og produkttype (mill. liter). Foreløpige tall (F) 2010M01 - 2017M12
+;
+; https://www.ssb.no/statbank/table/11174?rxid=49a52ff4-5d3c-4264-aa49-95134312070d
+
+(def raw-data (ssb/fetch 11174 {"ContentsCode" "Salg"
                                 "Region" "Hele landet"
                                 "PetroleumProd" ["Autodiesel" "Bilbensin"]
                                 "Kjopegrupper" "Alle kjøpegrupper"
                                 "Tid" "*"}))
+
+(test/is (= [:kjøpegruppe :petroleumsprodukt :region :salg] (:columns raw-data)))
+
+(def data (->> (:data raw-data)
+               (sort-by :dato)
+               (csv/number-or-throw-columns [:salg])
+               (map #(dissoc % :kjøpegruppe))
+               (map #(dissoc % :region))))
+
+(test/is (= "2010-01" (:dato (first data))))


Fix clblast/vector-rotm typo.

Fix clblast/vector-rotm typo.

--- src/clojure/uncomplicate/neanderthal/internal/device/clblast.clj
+++ src/clojure/uncomplicate/neanderthal/internal/device/clblast.clj
@@ -104,7 +104,7 @@
      (with-check error
        (~method (.dim ~x)
         (cl-mem (.buffer ~x)) (.offset ~x) (.stride ~x)
-        (cl-men (.buffer ~y)) (.offset ~y) (.stride ~y)
+        (cl-mem (.buffer ~y)) (.offset ~y) (.stride ~y)
         (cl-mem (.buffer ~param)) (.offset ~param)
         ~queue nil)
        ~param)


Correct Link

Correct Link

--- modules/reitit-dev/src/reitit/dev/pretty.cljc
+++ modules/reitit-dev/src/reitit/dev/pretty.cljc
@@ -357,5 +357,5 @@
     [:break]
     (edn right {:margin 3})]
    [:break]
-   (color :white "https://cljdoc.org/d/metosin/reitit/0.3.1/doc/basics/route-data")
+   (color :white "https://cljdoc.org/d/metosin/reitit/CURRENT/doc/basics/route-data")
    [:break]])


fix typo ("execption" -> "exception")

fix typo ("execption" -> "exception")

--- test/clj_http/test/client_test.clj
+++ test/clj_http/test/client_test.clj
@@ -133,10 +133,10 @@
 (defn is-passed-async [middleware req]
   (let [client (middleware async-identity-client)
         resp (promise)
-        execption (promise)
-        _ (client req resp execption)]
+        exception (promise)
+        _ (client req resp exception)]
     (is (= req @resp))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (defn is-applied [middleware req-in req-out]
   (let [client (middleware identity)]
@@ -145,10 +145,10 @@
 (defn is-applied-async [middleware req-in req-out]
   (let [client (middleware async-identity-client)
         resp (promise)
-        execption (promise)
-        _ (client req-in resp execption)]
+        exception (promise)
+        _ (client req-in resp exception)]
     (is (= req-out @resp))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest redirect-on-get
   (let [client (fn [req]
@@ -234,14 +234,14 @@
   (let [client (fn [req respond raise] (respond {:status 200 :req req}))
         r-client (-> client client/wrap-redirects)
         resp (promise)
-        execption (promise)
+        exception (promise)
         _ (r-client {:scheme :http :server-name "example.com" :uri "/"
-                     :request-method :get} resp execption)]
+                     :request-method :get} resp exception)]
     (is (= 200 (:status @resp)))
     (is (= :get (:request-method (:req @resp))))
     (is (= :http (:scheme (:req @resp))))
     (is (= [] (:trace-redirects @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest redirect-without-location-header
   (let [client (fn [req]
@@ -258,13 +258,13 @@
                  (respond {:status 302 :body "no redirection here"}))
         r-client (-> client client/wrap-url client/wrap-redirects)
         resp (promise)
-        execption (promise)
+        exception (promise)
         _ (r-client {:server-name "example.com" :url "http://example.com"
-                     :request-method :get} resp execption)]
+                     :request-method :get} resp exception)]
     (is (= 302 (:status @resp)))
     (is (= ["http://example.com"] (:trace-redirects @resp)))
     (is (= "no redirection here" (:body @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest redirect-with-query-string
   (let [client (fn [req]
@@ -293,10 +293,10 @@
                              :req req})))
         r-client (-> client client/wrap-url client/wrap-redirects)
         resp (promise)
-        execption (promise)
+        exception (promise)
         _ (r-client {:server-name "example.com" :url "http://example.com"
                      :request-method :get :query-params {:x "z"}}
-                    resp execption)]
+                    resp exception)]
     (is (= 200 (:status @resp)))
     (is (= :get (:request-method (:req @resp))))
     (is (= :http (:scheme (:req @resp))))
@@ -305,7 +305,7 @@
     (is (= "/bat" (:uri (:req @resp))))
     (is (= "x=y" (:query-string (:req @resp))))
     (is (nil? (:query-params (:req @resp))))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest max-redirects
   (let [client (fn [req]
@@ -330,14 +330,14 @@
                              :req req})))
         r-client (-> client client/wrap-url client/wrap-redirects)
         resp (promise)
-        execption (promise)
+        exception (promise)
         _ (r-client {:server-name "example.com" :url "http://example.com"
                      :request-method :get :max-redirects 0}
-                    resp execption)]
+                    resp exception)]
     (is (= 302 (:status @resp)))
     (is (= ["http://example.com"] (:trace-redirects @resp)))
     (is (= "http://example.net/bat" (get (:headers @resp) "location")))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest redirect-303-to-get-on-any-method
   (doseq [method [:get :head :post :delete :put :option]]
@@ -366,16 +366,16 @@
                                :req req})))
           r-client (-> client client/wrap-url client/wrap-redirects)
           resp (promise)
-          execption (promise)
+          exception (promise)
           _ (r-client {:server-name "example.com" :url "http://example.com"
                        :request-method method}
-                      resp execption)]
+                      resp exception)]
       (is (= 200 (:status @resp)))
       (is (= :get (:request-method (:req @resp))))
       (is (= :http (:scheme (:req @resp))))
       (is (= ["http://example.com" "http://example.net/bat"] (:trace-redirects @resp)))
       (is (= "/bat" (:uri (:req @resp))))
-      (is (not (realized? execption))))))
+      (is (not (realized? exception))))))

 (deftest pass-on-non-redirect
   (let [client (fn [req] {:status 200 :body (:body req)})
@@ -390,12 +390,12 @@
                  (respond {:status 200 :body (:body req)}))
         r-client (client/wrap-redirects client)
         resp (promise)
-        execption (promise)
-        _ (r-client {:body "ok" :url "http://example.com"} resp execption)]
+        exception (promise)
+        _ (r-client {:body "ok" :url "http://example.com"} resp exception)]
     (is (= 200 (:status @resp)))
     (is (= ["http://example.com"] (:trace-redirects @resp)))
     (is (= "ok" (:body @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest pass-on-non-redirectable-methods
   (doseq [method [:put :post :delete]
@@ -418,14 +418,14 @@
                              :headers {"location" "http://example.com/bat"}}))
           r-client (client/wrap-redirects client)
           resp (promise)
-          execption (promise)
+          exception (promise)
           _ (r-client {:body "ok" :url "http://example.com"
-                       :request-method method} resp execption)]
+                       :request-method method} resp exception)]
       (is (= status (:status @resp)))
       (is (= ["http://example.com"] (:trace-redirects @resp)))
       (is (= {"location" "http://example.com/bat"} (:headers @resp)))
       (is (= "ok" (:body @resp)))
-      (is (not (realized? execption))))))
+      (is (not (realized? exception))))))

 (deftest force-redirects-on-non-redirectable-methods
   (doseq [method [:put :post :delete]
@@ -457,15 +457,15 @@
                                :headers {"location" "http://example.com/bat"}})))
           r-client (client/wrap-redirects client)
           resp (promise)
-          execption (promise)
+          exception (promise)
           _ (r-client {:body "ok" :url "http://example.com"
                        :request-method method
-                       :force-redirects true} resp execption)]
+                       :force-redirects true} resp exception)]
       (is (= 200 (:status @resp)))
       (is (= ["http://example.com" "http://example.com/bat"] (:trace-redirects @resp)))
       (is (= "ok" (:body @resp)))
       (is (= expected-method (:request-method (:req @resp))))
-      (is (not (realized? execption))))))
+      (is (not (realized? exception))))))

 (deftest pass-on-follow-redirects-false
   (let [client (fn [req] {:status 302 :body (:body req)})
@@ -480,12 +480,12 @@
                  (respond {:status 302 :body (:body req)}))
         r-client (client/wrap-redirects client)
         resp (promise)
-        execption (promise)
-        _ (r-client {:body "ok" :follow-redirects false} resp execption)]
+        exception (promise)
+        _ (r-client {:body "ok" :follow-redirects false} resp exception)]
     (is (= 302 (:status @resp)))
     (is (= "ok" (:body @resp)))
     (is (nil? (:trace-redirects @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest throw-on-exceptional
   (let [client (fn [req] {:status 500})
@@ -541,10 +541,10 @@
   (let [client (fn [req respond raise] (respond {:status 200}))
         e-client (client/wrap-exceptions client)
         resp (promise)
-        execption (promise)
-        _ (e-client {} resp execption)]
+        exception (promise)
+        _ (e-client {} resp exception)]
     (is (= 200 (:status @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest pass-on-exceptional-when-surpressed
   (let [client (fn [req] {:status 500})
@@ -608,8 +608,8 @@
                            :headers {"content-encoding" "deflate"}}))
         c-client (client/wrap-decompression client)
         resp (promise)
-        execption (promise)
-        _ (c-client {} resp execption)]
+        exception (promise)
+        _ (c-client {} resp exception)]
     (is (= "barbarbar" (-> @resp :body util/force-byte-array util/utf8-string))
         "string correctly inflated")
     (is (= "deflate" (:orig-content-encoding @resp)))
@@ -716,10 +716,10 @@
                  (respond {:body (util/utf8-bytes "foo")}))
         o-client (client/wrap-output-coercion client)
         resp (promise)
-        execption (promise)
-        _ (o-client {:uri "/foo"} resp execption)]
+        exception (promise)
+        _ (o-client {:uri "/foo"} resp exception)]
     (is (= "foo" (:body @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest pass-on-no-output-coercion
   (let [client (fn [req] {:body nil})
@@ -898,8 +898,8 @@
 (deftest apply-on-method-async
   (let [m-client (client/wrap-method async-identity-client)
         echo (promise)
-        execption (promise)
-        _ (m-client {:key :val :method :post} echo execption)]
+        exception (promise)
+        _ (m-client {:key :val :method :post} echo exception)]
     (is (= :val (:key @echo)))
     (is (= :post (:request-method @echo)))
     (is (not (:method @echo)))))
@@ -922,15 +922,15 @@
 (deftest apply-on-url
   (let [u-client (client/wrap-url async-identity-client)
         resp (promise)
-        execption (promise)
+        exception (promise)
         _ (u-client {:url "http://google.com:8080/baz foo?bar=bat bit?"}
-                    resp execption)]
+                    resp exception)]
     (is (= :http (:scheme @resp)))
     (is (= "google.com" (:server-name @resp)))
     (is (= 8080 (:server-port @resp)))
     (is (= "/baz%20foo" (:uri @resp)))
     (is (= "bar=bat%20bit?" (:query-string @resp)))
-    (is (not (realized? execption)))))
+    (is (not (realized? exception)))))

 (deftest pass-on-no-url
   (let [u-client (client/wrap-url identity)
@@ -1169,14 +1169,14 @@
                         {:ignore-unknown-host? true}))))

 (deftest t-ignore-unknown-host-async
-  (let [resp (promise) execption (promise)]
+  (let [resp (promise) exception (promise)]
     (client/get "http://example.invalid"
-                {:async? true} resp execption)
-    (is (thrown? UnknownHostException (throw @execption))))
-  (let [resp (promise) execption (promise)]
+                {:async? true} resp exception)
+    (is (thrown? UnknownHostException (throw @exception))))
+  (let [resp (promise) exception (promise)]
     (client/get "http://example.invalid"
                 {:ignore-unknown-host? true
-                 :async? true} resp execption)
+                 :async? true} resp exception)
     (is (nil? @resp))))

 (deftest test-status-predicates


Use the current year for the README

Use the current year for the README

--- src/leiningen/new.clj
+++ src/leiningen/new.clj
@@ -2,7 +2,8 @@
   "Create a new project skeleton."
   (:use [leiningen.core :only [ns->path]]
         [clojure.java.io :only [file]]
-        [clojure.string :only [join]]))
+        [clojure.string :only [join]])
+  (:import (java.util Calendar)))

 (defn write-project [project-dir project-name]
   (.mkdirs (file project-dir))
@@ -26,12 +27,15 @@
              "(deftest replace-me ;; FIXME: write\n  (is false "
              "\"No tests have been written.\"))\n")))

+(defn- year []
+  (.get (Calendar/getInstance) Calendar/YEAR))
+
 (defn write-readme [project-dir artifact-id]
   (spit (file project-dir "README")
         (join "\n\n" [(str "# " artifact-id)
                       "FIXME: write description"
                       "## Usage" "FIXME: write"
-                      "## License" "Copyright (C) 2010 FIXME"
+                      "## License" (str "Copyright (C) " (year) " FIXME")
                       (str "Distributed under the Eclipse Public"
                            " License, the same as Clojure.\n")])))


add in provided? to for plugin loading check

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

--- src/lt/util/load.cljs
+++ src/lt/util/load.cljs
@@ -1,4 +1,5 @@
-(ns lt.util.load)
+(ns lt.util.load
+  (:require [clojure.string :as string]))

 (def fpath (js/require "path"))
 (def fs (js/require "fs"))
@@ -38,3 +39,10 @@
      (js/document.head.appendChild link)
      link))

+(defn provided? [s]
+  (loop [parts (string/split s ".")
+         cur js/window]
+    (if-not (first parts)
+      true
+      (if-let [cur (aget cur (first parts))]
+        (recur (rest parts) cur)))))


fix race condition after importing env vars (#1939)

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -595,11 +595,14 @@

 (defmethod api-event [:project-envvar :success]
   [target message status {:keys [resp context]} state]
-  (if-not (= (:project-name context) (:project-settings-project-name state))
-    state
-    (assoc-in state
-              state/project-envvars-path
-              (into {} (map (juxt :name :value)) resp))))
+  (let [{:keys [project-name on-success]} context]
+    (if-not (= project-name (:project-settings-project-name state))
+      state
+      (-> state
+          (assoc-in state/project-envvars-path
+                    (into {} (map (juxt :name :value)) resp))
+          (cond->
+            on-success (on-success state))))))

 (defmethod api-event [:update-project-parallelism :success]
@@ -667,13 +670,6 @@
 (defmethod post-api-event! [:create-env-var :success]
   [target message status {:keys [context]} previous-state current-state comms]
   ((:on-success context)))
-
-(defmethod api-event [:import-env-vars :success]
-  [target message status {:keys [resp context]} state]
-  (when (= (:dest-vcs-url context) (:vcs_url (get-in state state/project-path)))
-    (if-not (-> resp :unauthorized-projects seq)
-      (state/add-flash-notification state "You’ve successfully imported your environment variables.")
-      (state/add-flash-notification state "Oh no! We weren't able to import your variables! Please check that you have the permissions to do so."))))

 (defmethod api-event [:import-env-vars :failed]
@@ -690,7 +686,8 @@
                (gstring/format "/api/v1.1/project/%s/%s/envvar" vcs-type project-name)
                :project-envvar
                (:api comms)
-               :context {:project-name project-name})
+               :context {:project-name project-name
+                         :on-success #(state/add-flash-notification % "You’ve successfully imported your environment variables.")})
     ((:on-success context))))

 (defmethod api-event [:delete-env-var :success]


formatting

formatting

--- examples/_common/middleware/devtools.cljs
+++ examples/_common/middleware/devtools.cljs
@@ -404,7 +404,7 @@
 (defn -actions-view
   [action-events signal-id dispatch]
   [:div
-   (for [{:keys [id enabled? for-replay? action]} (filter #(= (:signal-id %) signal-id)
+   (for [{:keys [id action enabled? for-replay?]} (filter #(= (:signal-id %) signal-id)
                                                           action-events)]
      ^{:key id}
      [:div {:style    {:display     "flex"
@@ -523,12 +523,12 @@
     [-menu @replay-mode? @toggle-visibility-shortcut dispatch]

     [-autoscrollable-div
-     {:style {:position "absolute"
-              :top      "2.5em"
-              :bottom   0
-              :left     0
-              :right    0
-              :overflow "auto"
+     {:style {:position   "absolute"
+              :top        "2.5em"
+              :bottom     0
+              :left       0
+              :right      0
+              :overflow   "auto"
               :border-top "thin solid grey"}}
      [-initial-model-view @initial-model]
      [-signals-view @signal-events @action-events dispatch]]]])


schedule post for Wednesday at 9am

schedule post for Wednesday at 9am

--- src/pc/views/blog.clj
+++ src/pc/views/blog.clj
@@ -40,7 +40,8 @@
    Be careful for daylight savings time!"
   [
    {:slug "clojure-is-a-product-design-tool"
-    :display-in-overview true}
+    :display-in-overview true
+    :scheduled-time (clj-time.format/parse "Wed, 11 Mar 2015 09:00:00 -0800")}
    {:slug "optimizing-om-apps"
     :display-in-overview true}
    {:slug "blue-ocean-made-of-ink"


Define the screen methods as top-level vars to allow refreshing when namespace is reloaded

--- src/play_clj/core.clj
+++ src/play_clj/core.clj
@@ -17,7 +17,7 @@
 (load "core_global")
 (load "core_render")

-(defn- dummy [_])
+(defn- dummy [& args])

 (defn defscreen*
   [{:keys [on-show on-render on-hide on-pause on-resize on-resume]
@@ -44,8 +44,13 @@
       (resume [] (on-resume @screen)))))

 (defmacro defscreen
-  [name & {:keys [] :as options}]
-  `(defonce ~name (defscreen* ~options)))
+  [n & {:keys [] :as options}]
+  `(->> (for [[k# v#] ~options]
+          [k# (intern *ns* (symbol (str '~n "-" (name k#))) v#)])
+        flatten
+        (apply hash-map)
+        defscreen*
+        (def ~n)))

 (defn defgame*
   [{:keys [on-create] :or {on-create dummy}}]


Snapshot version

Snapshot version

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.16.0"
+(defproject cook "1.16.1-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Bumps version to 1.57.2-SNAPSHOT

Bumps version to 1.57.2-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.57.1"
+(defproject cook "1.57.2-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Make compositions async by default in jvm platform.

--- src/promesa/core.cljc
+++ src/promesa/core.cljc
@@ -111,20 +111,22 @@

      p/IFuture
      (-map [it cb]
-       (.thenApply it (reify Function
-                        (apply [_ v]
-                          (let [result (cb v)]
-                            result)))))
+       (.thenApplyAsync it (reify Function
+                             (apply [_ v]
+                               (let [result (cb v)]
+                                 result)))
+                        *executor*))

      (-bind [it cb]
-       (.thenCompose it (reify Function
-                          (apply [_ v]
-                            (let [result (cb v)]
-                              (if-not (instance? CompletionStage result)
-                                (let [p (CompletableFuture.)]
-                                  (.complete p result)
-                                  p)
-                                result))))))
+       (.thenComposeAsync it (reify Function
+                               (apply [_ v]
+                                 (let [result (cb v)]
+                                   (if-not (instance? CompletionStage result)
+                                     (let [p (CompletableFuture.)]
+                                       (.complete p result)
+                                       p)
+                                     result))))
+                          *executor*))

      (-catch [it cb]
        (.exceptionally it (reify Function


Properly handle nil/Object instances on `then`

--- src/promesa/impl.cljc
+++ src/promesa/impl.cljc
@@ -245,6 +245,9 @@
      (-bind
        ([it f] (pt/-bind (pt/-promise it) f))
        ([it f e] (pt/-bind (pt/-promise it) f e)))
+     (-then
+       ([it f] (pt/-then (pt/-promise it) f))
+       ([it f e] (pt/-then (pt/-promise it) f e)))
      (-handle
        ([it f] (pt/-handle (pt/-promise it) f))
        ([it f e] (pt/-handle (pt/-promise it) f e)))
@@ -265,6 +268,9 @@
      (-bind
        ([it f] (pt/-bind (pt/-promise it) f))
        ([it f e] (pt/-bind (pt/-promise it) f e)))
+     (-then
+       ([it f] (pt/-then (pt/-promise it) f))
+       ([it f e] (pt/-then (pt/-promise it) f e)))
      (-mapErr
        ([it f] (pt/-mapErr (pt/-promise it) f))
        ([it f e] (pt/-mapErr (pt/-promise it) f e)))


change ping to healthcheck

change ping to healthcheck

--- resources/default.clj
+++ resources/default.clj
@@ -3,7 +3,7 @@
                       :InstancePort 8080
                       :Protocol "http"
                       :InstanceProtocol "http"})
-(def elb-healthcheck-ping {:Target "HTTP:8080/1.x/ping"
+(def elb-healthcheck-ping {:Target "HTTP:8080/healthcheck"
                            :HealthyThreshold 2
                            :UnhealthyThreshold 4
                            :Interval 12


Another change related to layouts -> splits

--- src/re_demo/core.cljs
+++ src/re_demo/core.cljs
@@ -33,7 +33,7 @@
             [re-demo.selection-list        :as    selection-list]
             [re-demo.input-time            :as    input-time]
             [re-demo.layout                :as    layout]
-            [re-demo.layouts               :as    layouts]
+            [re-demo.splits               :as     splits]
             [re-demo.tour                  :as    tour]
             [re-demo.modal-panel           :as    modal-panel]
             [re-demo.h-box                 :as    h-box]
@@ -59,7 +59,7 @@
    {:id :line                   :level :minor :label "Line"               :panel line/panel}
    {:id :scroller               :level :minor :label "Scroller"           :panel scroller/panel}
    {:id :border                 :level :minor :label "Border"             :panel border/panel}
-   {:id :layouts                :level :minor :label "Layouts"            :panel layouts/panel}
+   {:id :splits                 :level :minor :label "Splits"             :panel splits/panel}

    {:id :buttons                :level :major :label "Buttons"}
    {:id :button                 :level :minor :label "Basic Button"       :panel button/panel}


WIP on tabs.  Content is now taller.  Shows another issue.

--- src/re_demo/tabs.cljs
+++ src/re_demo/tabs.cljs
@@ -104,22 +104,27 @@
                                        {:id ::3 :label "3"}])
         selected-tab-id (reagent/atom (:id (first @tab-defs)))]
     (fn []
-      [:div
-       [:h3.page-header "Dynamic Tabs"]
-       [button
-         :label "Add"
-         :on-click (fn []
-                     (let [c (str (inc (count @tab-defs)))]
-                          (swap! tab-defs conj {:id (keyword c) :label c})))]
-       [:div.col-md-4
-        [:div.h4 "Notes:"]
-        [:ul
-         [:li "Click  \"Add\" for more tabs."]]]
+      [v-box
+       :children [[title "Dynamic Tabs"]
+                  [h-box
+                   :gap "50px"
+                   :children [[v-box
+                               :margin  "20px 0px 0px 0px"       ;; TODO:  i supplied "start" (string) instead of :start and got runtime errors ... better protection
+                               :children [[button
+                                           :label "Add"
+                                           :on-click (fn []
+                                                       (let [c (str (inc (count @tab-defs)))]
+                                                         (swap! tab-defs conj {:id (keyword c) :label c})))]
+                                          [:div.h4 "Notes:"]
+                                          [:ul
+                                           [:li "Click  \"Add\" for more tabs."]]]]

-       [:div.col-md-7.col-md-offset-1
-        [tabs/horizontal-tabs
-         :model  selected-tab-id
-         :tabs  tab-defs]]])))
+                              [v-box
+                               :gap     "30px"
+                               :margin  "20px 0px 0px 0px"       ;; TOD0:  decide would we prefer to use :top-margin??
+                               :children [[tabs/horizontal-tabs
+                                           :model  selected-tab-id
+                                           :tabs  tab-defs]]]]]]])))

 (defn vertical-tabs-demo
   []
@@ -136,8 +141,7 @@
 (defn panel
   []
   [v-box
-   ;; :gap "10px"
    :children [[horizontal-tabs-demo]
               [remembers-demo]
-              #_[adding-tabs-demo]
+              [adding-tabs-demo]
               #_[vertical-tabs-demo]]])


Add proper codeblocks to docstrings

Add proper codeblocks to docstrings

--- src/reagent/core.cljs
+++ src/reagent/core.cljs
@@ -23,12 +23,16 @@
   that any Reagent hiccup forms must be processed with as-element. For example
   like this:

-    (r/create-element \"div\" #js{:className \"foo\"}
-       \"Hi \" (r/as-element [:strong \"world!\"])
+  ```cljs
+  (r/create-element \"div\" #js{:className \"foo\"}
+    \"Hi \" (r/as-element [:strong \"world!\"])
+  ```

   which is equivalent to

-    [:div.foo \"Hi\" [:strong \"world!\"]]"
+  ```cljs
+  [:div.foo \"Hi\" [:strong \"world!\"]]
+  ```"
   ([type]
    (create-element type nil))
   ([type props]
@@ -103,15 +107,17 @@
   "Create a component, React style. Should be called with a map,
   looking like this:

-    {:get-initial-state (fn [this])
-     :component-will-receive-props (fn [this new-argv])
-     :should-component-update (fn [this old-argv new-argv])
-     :component-will-mount (fn [this])
-     :component-did-mount (fn [this])
-     :component-will-update (fn [this new-argv])
-     :component-did-update (fn [this old-argv])
-     :component-will-unmount (fn [this])
-     :reagent-render (fn [args....])}   ;; or :render (fn [this])
+  ```cljs
+  {:get-initial-state (fn [this])
+   :component-will-receive-props (fn [this new-argv])
+   :should-component-update (fn [this old-argv new-argv])
+   :component-will-mount (fn [this])
+   :component-did-mount (fn [this])
+   :component-will-update (fn [this new-argv])
+   :component-did-update (fn [this old-argv])
+   :component-will-unmount (fn [this])
+   :reagent-render (fn [args....])}   ;; or :render (fn [this])
+  ```

   Everything is optional, except either :reagent-render or :render."
   [spec]
@@ -119,7 +125,7 @@

 (defn current-component
-  "Returns the current React component (a.k.a this) in a component
+  "Returns the current React component (a.k.a `this`) in a component
   function."
   []
   comp/*current-component*)
@@ -132,14 +138,14 @@

 (defn state
   "Returns the state of a component, as set with replace-state or set-state.
-  Equivalent to (deref (r/state-atom this))"
+  Equivalent to `(deref (r/state-atom this))`"
   [this]
   (assert-component this)
   (deref (state-atom this)))

 (defn replace-state
   "Set state of a component.
-  Equivalent to (reset! (state-atom this) new-state)"
+  Equivalent to `(reset! (state-atom this) new-state)`"
   [this new-state]
   (assert-component this)
   (assert-new-state new-state)
@@ -147,7 +153,7 @@

 (defn set-state
   "Merge component state with new-state.
-  Equivalent to (swap! (state-atom this) merge new-state)"
+  Equivalent to `(swap! (state-atom this) merge new-state)`"
   [this new-state]
   (assert-component this)
   (assert-new-state new-state)
@@ -219,8 +225,8 @@
   Reagent atoms (or track, etc), the value will be updated whenever
   the atom changes.

-  In other words, @(track foo bar) will produce the same result
-  as (foo bar), but foo will only be called again when the atoms it
+  In other words, `@(track foo bar)` will produce the same result
+  as `(foo bar)`, but foo will only be called again when the atoms it
   depends on changes, and will only trigger updates of components when
   its result changes.

@@ -254,8 +260,10 @@

   Use for example like this:

+  ```cljs
   (wrap (:foo @state)
         swap! state assoc :foo)
+  ```

   Probably useful only for passing to child components."
   [value reset-fn & args]
@@ -270,18 +278,23 @@

   Behaves like a Reagent atom but focuses updates and derefs to
   the specified path within the wrapped Reagent atom. e.g.,
-    (let [c (cursor ra [:nested :content])]
-      ... @c ;; equivalent to (get-in @ra [:nested :content])
-      ... (reset! c 42) ;; equivalent to (swap! ra assoc-in [:nested :content] 42)
-      ... (swap! c inc) ;; equivalence to (swap! ra update-in [:nested :content] inc)
-      )
+
+  ```cljs
+  (let [c (cursor ra [:nested :content])]
+    ... @c ;; equivalent to (get-in @ra [:nested :content])
+    ... (reset! c 42) ;; equivalent to (swap! ra assoc-in [:nested :content] 42)
+    ... (swap! c inc) ;; equivalence to (swap! ra update-in [:nested :content] inc)
+    )
+  ```

   The first parameter can also be a function, that should look
   something like this:

-    (defn set-get
-      ([k] (get-in @state k))
-      ([k v] (swap! state assoc-in k v)))
+  ```cljs
+  (defn set-get
+    ([k] (get-in @state k))
+    ([k v] (swap! state assoc-in k v)))
+  ```

   The function will be called with one argument – the path passed to
   cursor – when the cursor is deref'ed, and two arguments (path and
@@ -289,7 +302,7 @@

   Given that set-get function, (and that state is a Reagent atom, or
   another cursor) these cursors are equivalent:
-  (cursor state [:foo]) and (cursor set-get [:foo]).
+  `(cursor state [:foo])` and `(cursor set-get [:foo])`.

   Note that a cursor is lazy: its value will not change until it is
   used. This may be noticed with add-watch."
@@ -300,7 +313,7 @@
 ;; Utilities

 (defn rswap!
-  "Swaps the value of a to be (apply f current-value-of-atom args).
+  "Swaps the value of a to be `(apply f current-value-of-atom args)`.

   rswap! works like swap!, except that recursive calls to rswap! on
   the same atom are allowed – and it always returns nil."


Bump commons-fileupload to 1.3.3

Bump commons-fileupload to 1.3.3

Version 1.3.3 patches a code execution exploit:
http://www.cvedetails.com/cve/CVE-2016-1000031/

The release notes for 1.3.3. states that no client code will need
changing to accommodate this bugfix.

--- ring-core/project.clj
+++ ring-core/project.clj
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.5.1"]
                  [ring/ring-codec "1.0.1"]
                  [commons-io "2.5"]
-                 [commons-fileupload "1.3.2"]
+                 [commons-fileupload "1.3.3"]
                  [clj-time "0.11.0"]
                  [crypto-random "1.2.0"]
                  [crypto-equality "1.0.0"]]


Two more doc link renames that I missed before

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -1166,7 +1166,7 @@
                        {:html true :delay 0 :animation false
                         :placement "right" :title "Revision Location: Key Pattern"
                         :content (node [:p "A template used to construct S3 keys for storing application revisions."
-                                           "You can use " [:a {:href "/docs/continuous-deployment-with-amazon-codedeploy#key-patterns"} "substitution variables"]
+                                           "You can use " [:a {:href "/docs/continuous-deployment-with-aws-codedeploy#key-patterns"} "substitution variables"]
                                            " in the Key Pattern to generate a unique key for each build."])})))
     om/IRender
     (render [_]
@@ -1255,7 +1255,7 @@
          [:div.aws-codedeploy
           [:h2 "CodeDeploy application settings for " (vcs-url/project-name (:vcs_url project))]
           [:p "CodeDeploy is an AWS service for deploying to your EC2 instances. "
-              "Check out our " [:a {:href "/docs/continuous-deployment-with-amazon-codedeploy"} "getting started with CodeDeploy"]
+              "Check out our " [:a {:href "/docs/continuous-deployment-with-aws-codedeploy"} "getting started with CodeDeploy"]
               " guide for detailed information on getting set up."]
           [:div.aws-page-inner
             [:div.aws-codedeploy-step


Fix classpath / lack of generalization in config.

The old code only worked if you were in the correct dir, even if you
were running from a jar.

Now it works both from the repl and jar, but the error messages are less
helpful. deal with it...

--- src/clj/kixi/hecuba/application/system.clj
+++ src/clj/kixi/hecuba/application/system.clj
@@ -14,9 +14,7 @@
    [kixi.hecuba.email :refer (new-email)]

    ;; Misc
-   clojure.tools.reader
-   [clojure.pprint :refer (pprint)]
-   [clojure.tools.reader.reader-types :refer (indexing-push-back-reader source-logging-push-back-reader)]
+   [clojure.edn :as edn]
    [clojure.java.io :as io]))

 (defn combine
@@ -34,26 +32,14 @@
   ([m1 m2 & more]
     (apply combine (combine m1 m2) more)))

+(defn- pushback-reader [x]
+  (java.io.PushbackReader. (io/reader x)))
+
 (defn config []
   (let [f (io/file (System/getProperty "user.home") ".hecuba.edn")]
-    (when (.exists f)
-      (combine
-       (clojure.tools.reader/read
-        (indexing-push-back-reader
-         (java.io.PushbackReader. (io/reader "default.hecuba.edn"))))
-       (clojure.tools.reader/read
-        (indexing-push-back-reader
-         (java.io.PushbackReader. (io/reader f))))))))
-
-
-(defn message [state message]
-  (println message)
-  state)
-
-(defn spy [x]
-  (println "System map is now")
-  (pprint x)
-  x)
+    (combine (edn/read (pushback-reader (io/resource "default.hecuba.edn")))
+             (when (.exists f)
+               (edn/read (pushback-reader (io/input-stream f)))))))

 (defn new-system []
   (let [cfg (config)]


fix typo

fix typo

--- src/clj/traveler/datomic/output_models.clj
+++ src/clj/traveler/datomic/output_models.clj
@@ -4,7 +4,7 @@
   "Define template for user map"
   [:user/can-masquerade
    :user/istest
-   :user/polocies-assent-date
+   :user/policies-assent-date
    :user/privilege
    :user/email
    :user/lastname


add dates to transaction search criteria

--- src/cljs/clj_money/views/transactions.cljs
+++ src/cljs/clj_money/views/transactions.cljs
@@ -86,13 +86,16 @@

 (defn load-unreconciled-items
   [page-state]
-  (let [account (:view-account @page-state)]
+  (let [account (:view-account @page-state)
+        criteria {:account-id (:id account)
+                  :transaction-date [:between (:earliest-transaction-date account)
+                                     (:latest-transaction-date account)]
+                  :unreconciled true
+                  :include-children (:include-children? @page-state)}]
     (transaction-items/search
-     {:account-id (:id account)
-      :unreconciled true
-      :include-children (:include-children? @page-state)}
-     #(swap! page-state assoc :items %)
-     (notify/danger-fn "Unable to load the unreconciled items: %s"))))
+      criteria
+      #(swap! page-state assoc :items %)
+      (notify/danger-fn "Unable to load the unreconciled items: %s"))))

 (defn- load-attachments
   [page-state]


Selfie badges

Selfie badges

--- src/cljs/salava/badgeIssuer/ui/routes.cljs
+++ src/cljs/salava/badgeIssuer/ui/routes.cljs
@@ -17,7 +17,7 @@
    (str (base-path context) "/selfie") [[["/criteria/" :id] criteria/handler]]})

 (defn ^:export navi [context]
-  {(str (base-path context) "/badge/selfie") {:weight 46 :title (t :badgeIssuer/IssueBadges) :site-navi true :breadcrumb (t :badge/Badge " / " :badgeIssuer/IssueBadges)}
+  {(str (base-path context) "/badge/selfie") {:weight 100 :title (t :badgeIssuer/IssueBadges) :site-navi true :breadcrumb (t :badge/Badge " / " :badgeIssuer/IssueBadges)}
    (str (base-path context) "/badge/selfie/create") {:weight 101 :title (t :badgeIssuer/Createselfiebadges) :site-navi false :breadcrumb (t :badge/Badge " / " :badgeIssuer/Createselfiebadge)}
    (str (base-path context) "/badge/selfie/create/\\S+")  {:breadcrumb (t :badge/Badge " / " :badgeIssuer/Editselfiebadge)}})