Fix per https://github.com/MastodonC/kixi.hecuba/pull/638#discussion_r39143752

--- src/cljs/kixi/hecuba/widgets/datetimepicker_small.cljs
+++ src/cljs/kixi/hecuba/widgets/datetimepicker_small.cljs
@@ -29,20 +29,23 @@
               :id id-for
               :type "date"}]]))

+(def std-formatter
+  (tf/formatter "yyyy-MM-dd"))
+
 (defmulti calculate-new-date (fn [event _] event))

 (defmethod calculate-new-date :day-minus [event current-date]
   (let [d (tf/parse current-date)]
-    (tf/unparse (tf/formatter "yyyy-MM-dd") (t/minus d (t/days 1)))))
+    (tf/unparse std-formatter (t/minus d (t/days 1)))))
 (defmethod calculate-new-date :day-plus [event current-date]
   (let [d (tf/parse current-date)]
-    (tf/unparse (tf/formatter "yyyy-MM-dd") (t/plus d (t/days 1)))))
+    (tf/unparse std-formatter (t/plus d (t/days 1)))))
 (defmethod calculate-new-date :week-minus [event current-date]
   (let [d (tf/parse current-date)]
-    (tf/unparse (tf/formatter "yyyy-MM-dd") (t/minus d (t/weeks 1)))))
+    (tf/unparse std-formatter (t/minus d (t/weeks 1)))))
 (defmethod calculate-new-date :week-plus [event current-date]
   (let [d (tf/parse current-date)]
-    (tf/unparse (tf/formatter "yyyy-MM-dd") (t/plus d (t/weeks 1)))))
+    (tf/unparse std-formatter (t/plus d (t/weeks 1)))))

 (defn control [cursor owner]
   (reify
@@ -64,14 +67,16 @@
             {:class (str "col-md-1 fa fa-fast-backward " (if inactive? "disabled" "datemover"))
              :title "- 1 Week"
              :style icon-style
-             :on-click (fn [_] (when-not inactive?
-                                 (put! event-chan {:event :date-selected :value (calculate-new-date :week-minus date)})))}]
+             :on-click (fn [e] (when-not inactive?
+                                 (put! event-chan {:event :date-selected :value (calculate-new-date :week-minus date)})
+                                 (.preventDefault e)))}]
            [:div
             {:class (str "col-md-1 fa fa-step-backward " (if inactive? "disabled" "datemover"))
              :style icon-style
              :title "- 1 Day"
-             :on-click (fn [_] (when-not inactive?
-                                 (put! event-chan {:event :date-selected :value (calculate-new-date :day-minus date)})))}]]
+             :on-click (fn [e] (when-not inactive?
+                                 (put! event-chan {:event :date-selected :value (calculate-new-date :day-minus date)})
+                                 (.preventDefault e)))}]]

           ;; input
           [:div {:style {:display "inline-block" :margin-left "-8px"}}
@@ -82,14 +87,16 @@
             {:class (str "col-md-1 fa fa-step-forward " (if inactive? "disabled" "datemover"))
              :style icon-style
              :title "+ 1 Day"
-             :on-click (fn [_] (when-not inactive?
-                                 (put! event-chan {:event :date-selected :value (calculate-new-date :day-plus date)})))}]
+             :on-click (fn [e] (when-not inactive?
+                                 (put! event-chan {:event :date-selected :value (calculate-new-date :day-plus date)})
+                                 (.preventDefault e)))}]
            [:div
             {:class (str "col-md-1 fa fa-fast-forward " (if inactive? "disabled" "datemover"))
              :style (merge icon-style {:margin-left "-6px"})
              :title "+ 1 Week"
-             :on-click (fn [_] (when-not inactive?
-                                 (put! event-chan {:event :date-selected :value (calculate-new-date :week-plus date)})))}]]
+             :on-click (fn [e] (when-not inactive?
+                                 (put! event-chan {:event :date-selected :value (calculate-new-date :week-plus date)})
+                                 (.preventDefault e)))}]]

           [:div {:style {:display "inline-block"}}
            [:button.btn.btn-primary


fix docstring formatting of code snippets

--- src/re_frame/std_interceptors.cljc
+++ src/re_frame/std_interceptors.cljc
@@ -29,11 +29,11 @@
   can be slow. So, you won't want this interceptor present in production
   code. So condition it out like this :

-    (re-frame.core/reg-event-db
-       :evt-id
-       [(when ^boolean goog.DEBUG re-frame.core/debug)]  ;; <-- conditional
-       (fn [db v]
-         ...))
+      (re-frame.core/reg-event-db
+         :evt-id
+         [(when ^boolean goog.DEBUG re-frame.core/debug)]  ;; <-- conditional
+         (fn [db v]
+           ...))

   To make this code fragment work, you'll also have to set goog.DEBUG to
   false in your production builds - look in `project.clj` of /examples/todomvc.
@@ -95,8 +95,8 @@

   These handlers take two arguments;  `db` and `event`, and they return `db`.

-  (fn [db event]
-     ....)
+      (fn [db event]
+         ....)

   So, the interceptor wraps the given handler:
      1. extracts two `:coeffects` keys: db and event
@@ -127,9 +127,9 @@

   These handlers take two arguments;  `coeffects` and `event`, and they return `effects`.

-  (fn [coeffects event]
-     {:db ...
-      :dispatch ...})
+      (fn [coeffects event]
+         {:db ...
+          :dispatch ...})

    Wrap handler in an interceptor so it can be added to (the RHS) of a chain:
      1. extracts `:coeffects`
@@ -157,8 +157,9 @@
   "Returns an interceptor which wraps the kind of event handler given to `reg-event-ctx`.
   These advanced handlers take one argument: `context` and they return a modified `context`.
   Example:
-     (fn [context]
-        (enqueue context [more interceptors]))"
+
+      (fn [context]
+         (enqueue context [more interceptors]))"
   [handler-fn]
   (->interceptor
     :id     :ctx-handler
@@ -187,18 +188,19 @@
   you might give to clojure's `update-in`.

   Examples:
-    (path :some :path)
-    (path [:some :path])
-    (path [:some :path] :to :here)
-    (path [:some :path] [:to] :here)
+
+      (path :some :path)
+      (path [:some :path])
+      (path [:some :path] :to :here)
+      (path [:some :path] [:to] :here)

   Example Use:

-    (reg-event-db
-      :event-id
-      (path [:a :b])  ;; used here, in interceptor chain
-      (fn [b v]       ;; 1st arg is now not db. Is the value from path [:a :b] within db
-        ... new-b))   ;; returns a new value for that path (not the entire db)
+      (reg-event-db
+        :event-id
+        (path [:a :b])  ;; used here, in interceptor chain
+        (fn [b v]       ;; 1st arg is now not db. Is the value from path [:a :b] within db
+          ... new-b))   ;; returns a new value for that path (not the entire db)

   Notes:
     1. `path` may appear more than once in an interceptor chain. Progressive narrowing.
@@ -323,11 +325,11 @@

   Usage:

-  (defn my-f
-    [a-val b-val]
-    ... some computation on a and b in here)
-
-  (on-changes my-f [:c]  [:a] [:b])
+      (defn my-f
+        [a-val b-val]
+        ... some computation on a and b in here)
+
+      (on-changes my-f [:c]  [:a] [:b])

   Put this Interceptor on the right handlers (ones which might change :a or :b).
   It will:


Added check for capital letters to define-dl

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

--- src/conexp/contrib/dl/framework/syntax.clj
+++ src/conexp/contrib/dl/framework/syntax.clj
@@ -123,6 +123,9 @@
   "Defines a DL."
   [name concept-names role-names constructors & options]
   (let [options (apply hash-map options)]
+    (when (exists [name (concat concept-names role-names)]
+	    (not (Character/isUpperCase (first (str name)))))
+      (illegal-argument "Concept and role names must start with a capital letter."))
     `(do
        (def ~name (make-language '~concept-names '~role-names '~constructors))


Fix typo in on-verify-pin-success

Fix typo in on-verify-pin-success

Signed-off-by: Vitaliy Vlasov <e49d0217baed7632d034fb41cd352d74cf7c0ec8@gmail.com>

--- src/status_im/hardwallet/core.cljs
+++ src/status_im/hardwallet/core.cljs
@@ -1151,8 +1151,8 @@
   (let [on-verified (get-in db [:hardwallet :pin :on-verified])
         pairing (get-pairing db)]
     (fx/merge cofx
-              {:db (update-in [:hardwallet :pin] merge {:status      nil
-                                                        :error-label nil})}
+              {:db (update-in db [:hardwallet :pin] merge {:status      nil
+                                                           :error-label nil})}
               (clear-on-card-connected)
               (when-not (contains? #{:hardwallet/unpair
                                      :hardwallet/generate-and-load-key


make capitalization consistent (#933)

make capitalization consistent (#933)

* make capitalization consistent

--- src/status_im/translations/en.cljs
+++ src/status_im/translations/en.cljs
@@ -15,7 +15,7 @@
    :invite-friends                        "Invite friends"
    :faq                                   "FAQ"
    :switch-users                          "Switch users"
-   :feedback                              "Got Feedback?\nShake your phone!"
+   :feedback                              "Got feedback?\nShake your phone!"

    ;chat
    :is-typing                             "is typing"
@@ -70,7 +70,7 @@
    :message                               "Message"
    :username                              "Username"
    :not-specified                         "Not specified"
-   :public-key                            "Public Key"
+   :public-key                            "Public key"
    :phone-number                          "Phone number"
    :email                                 "Email"
    :profile-no-status                     "No status"


Implement much neater archive thinner.

Implement much neater archive thinner.

--- src/algebolic/algorithms/spea2.clj
+++ src/algebolic/algorithms/spea2.clj
@@ -1,6 +1,9 @@
 (ns algebolic.algorithms.spea2
-  "An implementation of the SPEA2 algorithm of Zitzler et al. Nearly. See the archive thinner functions
-  for details of the difference.
+  "An implementation of the SPEA2 algorithm of Zitzler et al. Well, almost. There's a very slight
+  difference in way the archive is constructed. Using my technique you can replicate SPEA2 exactly, but
+  it runs slowly. You can approximate the behaviour of SPEA2 and have it run pretty fast. I've tested
+  the approximation on a few problems and it doesn't seem to make any real difference. See the archive
+  thinner functions for details of the difference.

   This code is currently limited to two objectives, but the API is arranged so that should be easy to
   generalise if needed."
@@ -81,47 +84,61 @@

 ;; * Archive construction functions *

-(defn- remove-one-item-simple
-  [goals tree-and-archive]
+(defn- k-nearest-distances
+  "Returns the distances to the k nearest neighbours, in ascending order. The first neighbour is really
+  a neighbour, not the point itself."
+  [tree k-max p]
+  ;; the rest drops the distance from the point to itself, which is always zero
+  (apply vector (rest (sort < (map #(Math/sqrt (:dist-squared %)) (kdtree/nearest-neighbor tree p k-max))))))
+
+(defn- remove-one-item
+  "One step of the archive thinning routine, removes one individual from the archive."
+  [goals comparison-depth tree-and-archive]
   (let [tree (:tree tree-and-archive)
         oversized-archive (:archive tree-and-archive)
-        measured-archive (map #(assoc % :spea2-distance
-                                        (kth-nearest-distance tree 2 (coords-from-individual goals %)))
+        measured-archive (map #(assoc % :spea2-distances
+                                        (k-nearest-distances tree comparison-depth (coords-from-individual goals %)))
                               oversized-archive)
-        sorted-archive (sort-by :spea2-distance < measured-archive)]
+        ;; this next step relies on the sort being done lexicographically on the distance arrays.
+        ;; That `sort-by` does this isn't mentioned in the docstring, but is explicitly stated
+        ;; here http://clojure.org/data_structures
+        sorted-archive (sort-by :spea2-distances measured-archive)]
     {:archive (rest sorted-archive)
      :tree    (kdtree/delete tree (coords-from-individual goals (first sorted-archive)))}))

-(defn simple-archive-thinner
+(defn thin-archive
   "SPEA2 has a fairly complicated prescription for thinning out the archive if it's oversized. It specifies
   that one should look for the individual who has the least distance to its nearest neighbour. If this doesn't
   yield a unique individual, then we should rank on distance to the second nearest neighbour, recursing until
   the tie is broken. We remove this individual from the population and repeat until we have thinned the archive
   to the desired size.

-  We implement a simplified version of this algorithm (and it's unknown how this affects the performance, as I
-  haven't compared it with the full SPEA2 thinner). We do the same as the SPEA2 prescription, except if
-  individuals are tied on nearest neighbour distance then we break the tie arbitrarily, rather than on second
-  nearest neighbour etc."
-  [goals oversized-archive target-size]
+  We implement a modification of this algorithm. Instead we calculate for each point the distance to its
+  `comparison-depth` nearest neighbours. We then sort the points lexicographically by these distance lists
+  and drop the first item. Then we recalculate the distances and repeat to drop the desired number of items.
+  If `comparison-depth` is the same as the archive size then this is equivalent to the SPEA2 technique,
+  although spectacularly inefficient. Experiments have shown that using a `comparison-depth` of 5 does not
+  give appreciably different results than SPEA2 for common problems."
+  [goals oversized-archive comparison-depth target-size]
   (let [coords (map (partial coords-from-individual goals) oversized-archive)
         tree (kdtree/build-tree coords)
         thinned-tree-and-archive (nth (iterate
-                                        (partial remove-one-item-simple goals)
+                                        (partial remove-one-item goals comparison-depth)
                                         {:tree tree :archive oversized-archive})
                                       (- (count oversized-archive) target-size))]
     (:archive thinned-tree-and-archive)))

+
 (defn make-new-archive
   "Implements the core step of the SPEA2 algorithm which is constructing a new archive of elite
   individuals from the old archive and a population of new individuals."
-  [goals archive-size population old-archive]
+  [goals comparison-depth archive-size population old-archive]
   (let [pool (into population old-archive)
         scored-pool (calculate-fitnesses goals pool)
         ;; individuals that are non-dominated will have a fitness less than 1
         new-elites (filter #(< (:spea2-fitness %) 1.0) scored-pool)
         new-size (count new-elites)
-        _ (println "New archive raw size: " new-size)
+        ;;_ (println "New archive raw size: " new-size)
         ]
     ;; there are three cases here: either the new archive is exactly the right size, too big, or too small
     (cond
@@ -132,7 +149,7 @@
       ;; is to just sort and select from the pool.
       (< new-size archive-size) (take archive-size (sort-by :spea2-fitness < scored-pool))
       ;; and finally, if we've got too many non-dominated individuals then some of them are for the chop
-      (> new-size archive-size) (simple-archive-thinner goals new-elites archive-size))))
+      (> new-size archive-size) (thin-archive goals new-elites comparison-depth archive-size))))

 ;; * algebolic.evolution.core configuration *
@@ -148,8 +165,8 @@
   if there are too few. Finally, a new generation is bred from the archived individuals, using binary
   tournament selection on the :spea2-fitness, and the cycle begins again."
   [config]
-  (let [{:keys [unary-ops binary-ops goals archive-size]} config]
-    {:elite-selector       (fn [rabble elite] (make-new-archive goals archive-size rabble elite))
+  (let [{:keys [unary-ops binary-ops goals archive-size comparison-depth] :or {comparison-depth 5}} config]
+    {:elite-selector       (fn [rabble elite] (make-new-archive goals comparison-depth archive-size rabble elite))
      :mating-pool-selector (fn [_ elite] elite)
      :reproduction-config  {:selector   (partial selection/tournament-selector 2 :spea2-fitness)
                             :unary-ops  unary-ops


+(def patterns)

+(def patterns)

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -21,6 +21,8 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unify)]))
+
+(def patterns [[#"(c)[i] è" "$1'è"]])

 ;; TODO: move this to morphology/prepositions.edn,
 ;; following example in morphology/determiners.edn.


Document ByteArray requirement

Document ByteArray requirement

--- src/caesium/crypto/generichash.clj
+++ src/caesium/crypto/generichash.clj
@@ -48,6 +48,8 @@
   "Hashes a message using BLAKE2b into the given buffer. Optionally
   takes key, salt and personal.

+  All buffers must be `ByteArray`.
+
   You only want this to manage the output byte array yourself. Otherwise, you
   want [[blake2b]]."
   ([buf msg]


Actually the default key is *empty*!

Actually the default key is *empty*!

--- src/caesium/crypto/generichash.clj
+++ src/caesium/crypto/generichash.clj
@@ -9,5 +9,6 @@
   ([message]
      (.blake2 (new Hash) message))
   ([message & {salt :salt key :key personal :personal
-               :or {salt sixteen-nuls key sixteen-nuls personal sixteen-nuls}}]
-     (.blake2 (new Hash) message salt key personal)))
+               :or {salt sixteen-nuls
+                    personal sixteen-nuls
+                    key (byte-array 0)}}]


Simplify code (data abstraction)

Simplify code (data abstraction)

--- src/clj/algorithms_clj/huffman.clj
+++ src/clj/algorithms_clj/huffman.clj
@@ -18,12 +18,8 @@
 (defn is-node? [node] (= (first node) ::node))

 (defn leaf-val [node] {:pre (is-leaf? node)} (second node))
-(defn lhs-node [node] {:pre (is-node? node)} (nth node 1))
-(defn rhs-node [node] {:pre (is-node? node)} (nth node 2))
-;; TODO
-;; Better use of data abstraction: return children as "(rest node)"
-;; It would allow to use the (nth children input) as decoding
-;; !!! Make the distinction between the need for get/set and absence of std data structure
+(defn children [node] {:pre (is-node? node)} (rest node))
+(defn child-at [node n] {:pre (is-node? node)} (nth node (inc n)))

 ;; -----------------------------------------------------------
@@ -71,9 +67,7 @@
   (defn go [path node] ;; TODO - optimize this by removing the recursion
     (cond
       (is-leaf? node) [(leaf-val node) path]
-      (is-node? node) (into
-                        (go (conj path 0) (lhs-node node))
-                        (go (conj path 1) (rhs-node node)))
+      (is-node? node) (mapcat #(go (conj path %) (child-at node %)) [0 1])
       ))
   (apply hash-map (go [] tree))) ;; TODO - Test check: verify that there are no code prefix of another

@@ -96,10 +90,6 @@
 ;; Decoding
 ;; -----------------------------------------------------------

-(defn- next-node
-  [node input]
-  (if (zero? input) (lhs-node node) (rhs-node node)))
-
 (defn- huffman-xf
   "Transducer step function to decode a huffman stream of values"
   [huffman-tree] ;; TODO - Try to replace this by a prefix tree - or search in map?
@@ -109,7 +99,7 @@
         ([] (xf))
         ([result] (xf result))
         ([result input]
-          (let [next-branch (next-node @branch input)]
+          (let [next-branch (child-at @branch input)]
             (if (is-leaf? next-branch)
               (do
                 (vreset! branch huffman-tree)
@@ -134,7 +124,6 @@
 (def t (make-huffman-tree m))

 (defn tests []
-  ;; TODO - Symetric testings with test.checks
   (prn (encode-with t [:a :b :c :d :e]))
   (prn (second (encode [:a :b :c :d :e])))
   (prn (decode t [0 0 0 0 0 1 0 1 1 0 1 1]))


Add netflix to who uses clojure

Add netflix to who uses clojure

--- src/clj/clojuredocs/site/intro.clj
+++ src/clj/clojuredocs/site/intro.clj
@@ -74,22 +74,20 @@
               :url "http://www.akamai.com/"}
              {:src "http://www.climate.com/preso/assets/imgs/shared/logos/tcc_logo_marcom.png"
               :url "http://www.climate.com/"}
+             {:src "http://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Netflix_logo.svg/200px-Netflix_logo.svg.png"
+              :url "https://www.netflix.com"}
              {:src "http://www.factual.com/assets/factual_logo_small-9d5ae614ae5422b251648ca62d6b4e51.png"
               :url "http://www.factual.com"}
-             {:src "https://d1lpkba4w1baqt.cloudfront.net/heroku-logo-light-234x60.png"
-              :url "https://www.heroku.com"}
              {:src "https://www.simple.com/img/logo-a2236763875.png"
               :url "https://simple.com"}
              {:src "http://upload.wikimedia.org/wikipedia/commons/c/cc/Groupon_logo.png"
               :url "http://www.groupon.com/"}
+             {:src "https://d1lpkba4w1baqt.cloudfront.net/heroku-logo-light-234x60.png"
+              :url "https://www.heroku.com"}
              {:src "http://img.brightcove.com/logo-corporate-new.png"
               :url "http://www.brightcove.com"}
              {:src "http://f.cl.ly/items/3D0u2W0H322U1V2Z2u0P/80x50_orange.png"
-              :url "https://soundcloud.com"}
-             {:src "https://d36r1a7iisq7tk.cloudfront.net/img/rfz_logo@2x__Vdbaeec7636c1e9aa5b7951ae71b2a7e8__.png"
-              :url "https://www.readyforzero.com/"}
-             {:src "http://a.disquscdn.com/dotcom/d-2d5f885/img/brand/disqus-social-icon-blue-transparent.png"
-              :url "http://disqus.com/"}]]
+              :url "https://soundcloud.com"}]]
         [:li [:a {:href url} [:img {:src src}]]])]]]
    [:div.row
     [:div.col-md-6


Destructuring fix

Destructuring fix

--- src/clj/salava/badge/assertion.clj
+++ src/clj/salava/badge/assertion.clj
@@ -24,7 +24,7 @@
          :conn-timeout   30000}))

     (catch :status e
-      (let [{:keys [:status :body]} e
+      (let [{:keys [status body]} e
             body-map (try+
                        (json/read-str body :key-fn keyword)
                        (catch Object _


Use HQ utils API.

Use HQ utils API.

--- test/onyx/plugin/datomic_test.clj
+++ test/onyx/plugin/datomic_test.clj
@@ -3,41 +3,11 @@
             [midje.sweet :refer :all]
             [datomic.api :as d]
             [onyx.plugin.datomic]
+            [onyx.queue.hornetq-utils :as hq-utils]
             [onyx.api])
   (:import [org.hornetq.api.core.client HornetQClient]
            [org.hornetq.api.core TransportConfiguration HornetQQueueExistsException]
            [org.hornetq.core.remoting.impl.netty NettyConnectorFactory]))
-
-(defn create-queue [session queue-name]
-  (try
-    (.createQueue session queue-name queue-name true)
-    (catch Exception e)))
-
-(defn consume-queue! [config queue-name echo]
-  (let [tc (TransportConfiguration. (.getName NettyConnectorFactory) config)
-        locator (HornetQClient/createServerLocatorWithoutHA (into-array [tc]))
-        session-factory (.createSessionFactory locator)
-        session (.createTransactedSession session-factory)]
-
-    (create-queue session queue-name)
-
-    (let [consumer (.createConsumer session queue-name)
-          results (atom [])]
-      (.start session)
-      (while (not= (last @results) :done)
-        (when (zero? (mod (count @results) echo))
-          (prn (format "[HQ Util] Read %s segments" (count @results))))
-        (let [message (.receive consumer)]
-          (when message
-            (.acknowledge message)
-            (swap! results conj (fressian/read (.toByteBuffer (.getBodyBuffer message)))))))
-
-      (prn "[HQ Util] Done reading")
-      (.commit session)
-      (.close consumer)
-      (.close session)
-
-      @results)))

 (def db-uri (str "datomic:mem://" (java.util.UUID/randomUUID)))

@@ -157,7 +127,7 @@

 (onyx.api/submit-job conn {:catalog catalog :workflow workflow})

-(def results (consume-queue! hq-config out-queue 1))
+(def results (hq-utils/consume-queue! hq-config out-queue 1))

 (doseq [v-peer v-peers]
   (try


Multiply a matrix using the graph

Multiply a matrix using the graph

--- test/tensorflow_clj/core_test.clj
+++ test/tensorflow_clj/core_test.clj
@@ -55,3 +55,10 @@
         (is (= org.tensorflow.Tensor (type t)))
         (is (= [] (vec (.shape t))))
         (is (= 369.0 (.floatValue t)))))))
+
+(deftest matrix-feed
+  (testing "Matrix fed to loaded graph"
+    (with-graph-file "misc/addconst.pb"
+      (let [t (run-graph {:Placeholder (tensor [[1 2] [3 4]])} :mul)]
+        (is (= org.tensorflow.Tensor (type t)))
+        (is (= [2 2] (vec (.shape t))))))))


Abstracted out the construction of the melody a bit more.


pre-expand-heap function

pre-expand-heap function

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

--- acqEngine/src/org/micromanager/test.clj
+++ acqEngine/src/org/micromanager/test.clj
@@ -119,8 +119,6 @@

 (def pop-lock (Object.))

-
-
 (defn pop-next-image [image-queue]
   (when-let [image
              (locking pop-lock
@@ -167,10 +165,17 @@

 (defn memory []
   (let [runtime (Runtime/getRuntime)
-        mb (* 1024 1024.)]
-    {:total (/ (.totalMemory runtime) mb)
-     :free (/ (.freeMemory runtime) mb)
-     :max (/ (.maxMemory runtime) mb)}))
-
+        ->mb #(/ % 1024 1024.)]
+    {:total (->mb (.totalMemory runtime))
+     :free (->mb (.freeMemory runtime))
+     :max (->mb (.maxMemory runtime))}))
+
+(defn pre-expand-heap
+  "Generates a queue of empty image arrays, as a way to pre-expand
+   the JVM's heap."
+  [image-size n]
+  (let [q (LinkedBlockingQueue.)]
+    (dotimes [_ n]
+      (.add q (byte-array image-size)))))


Store orbit ascending crossing lon to be able to compute polygons for orbits

--- src/cmr/indexer/data/index_set.clj
+++ src/cmr/indexer/data/index_set.clj
@@ -291,7 +291,7 @@
                    :end-coordinate-2 double-field-mapping

                    ;; Used for orbit search
-                   :orbit-asc-crossing-lon double-field-mapping
+                   :orbit-asc-crossing-lon (stored double-field-mapping)
                    :orbit-start-clat double-field-mapping
                    :orbit-end-clat double-field-mapping

@@ -425,5 +425,3 @@
   [context]
   (let [cache-atom (-> context :system :caches :general)]
     (cache/cache-lookup cache-atom :concept-mapping-types (partial fetch-concept-mapping-types context))))
-
-


CMR-149: Updated for transmit changes.

CMR-149: Updated for transmit changes.

--- src/cmr/indexer/data/index_set.clj
+++ src/cmr/indexer/data/index_set.clj
@@ -9,6 +9,7 @@
             [cmr.transmit.metadata-db :as meta-db]
             [cmr.transmit.index-set :as index-set]
             [cmr.transmit.config :as transmit-config]
+            [cmr.transmit.connection :as transmit-conn]
             [cmr.common.cache :as cache]
             [cmr.system-trace.core :refer [deftracefn]]))

@@ -201,7 +202,8 @@
 (defn reset
   "Reset configured elastic indexes"
   [context]
-  (let [index-set-root-url (transmit-config/context->app-root-url context :index-set)
+  (let [index-set-root-url (transmit-conn/root-url
+                             (transmit-config/context->app-connection context :index-set))
         index-set-reset-url (format "%s/reset" index-set-root-url)]
     (client/request
       {:method :post
@@ -212,7 +214,8 @@
 (defn create
   "Submit a request to create index-set"
   [context index-set]
-  (let [index-set-root-url (transmit-config/context->app-root-url context :index-set)
+  (let [index-set-root-url (transmit-conn/root-url
+                             (transmit-config/context->app-connection context :index-set))
         index-set-url (format "%s/index-sets" index-set-root-url)
         response (client/request
                    {:method :post


corrected missing format specifier in wrap-request-debug

--- src/lcmap/clownfish/middleware.clj
+++ src/lcmap/clownfish/middleware.clj
@@ -17,7 +17,7 @@
   "Logs request at DEBUG level"
   [handler]
   (fn [request]
-    (log/debug "request-debug: %s" request)
+    (log/debugf "request-debug: %s" request)
     (handler request)))

 (defn wrap-authenticate


add :tooling-config and :external-config to cache affecting options

its bad practice to do side-effects in macros but some macros
are controlled by these setting and cache did not pick up changes

--- src/main/shadow/build/compiler.clj
+++ src/main/shadow/build/compiler.clj
@@ -177,8 +177,8 @@

                               reader/*alias-map*
                               (merge reader/*alias-map*
-                                     (:requires ns-info)
-                                     (:require-macros ns-info))]
+                                (:requires ns-info)
+                                (:require-macros ns-info))]
                       (reader/read opts in))]

                 (if (identical? form eof-sentinel)
@@ -436,6 +436,11 @@
    [:compiler-options :fn-invoke-direct]
    [:compiler-options :elide-asserts]
    [:compiler-options :reader-features]
+   ;; some community macros seem to use this
+   ;; hard to track side-effecting macros but even more annoying to run into caching bugs
+   ;; so just let any change invalidate everything for safety reasons
+   [:compiler-options :tooling-config]
+   [:compiler-options :external-config]
    ;; doesn't affect output but affects compiler env
    [:compiler-options :infer-externs]
    ;; these should basically never be changed
@@ -480,7 +485,7 @@
           (when (and (= cache-key-map (:cache-keys cache-data))
                      (every?
                        #(= (get-in state %)
-                           (get-in cache-data [:compiler-options %]))
+                          (get-in cache-data [:compiler-options %]))
                        cache-affecting-options))

             (util/log state {:type :cache-read :resource-id resource-id :resource-name resource-name})
@@ -639,12 +644,12 @@

                               (and data line column)
                               (assoc :source-excerpt
-                                (warnings/get-source-excerpt
-                                  ;; FIXME: this is a bit ugly but compilation failed so the source is not in state
-                                  ;; but the warnings extractor wants to access it
-                                  (assoc-in state [:output resource-id] {:source source})
-                                  rc
-                                  {:line line :column column}))))]
+                                     (warnings/get-source-excerpt
+                                       ;; FIXME: this is a bit ugly but compilation failed so the source is not in state
+                                       ;; but the warnings extractor wants to access it
+                                       (assoc-in state [:output resource-id] {:source source})
+                                       rc
+                                       {:line line :column column}))))]

                     (throw (ex-info (format "failed to compile resource: %s" resource-id) err-data e)))))]


DM + AB #59 - Fix retrieving entities by global id

--- src/objective8/storage/storage.clj
+++ src/objective8/storage/storage.clj
@@ -80,11 +80,11 @@

 (defn pg-retrieve-entity-by-global-id [global-id]
   (let [entity-query (-> (korma/exec-raw ["
-SELECT _id, 'objective' AS entity FROM objectives WHERE global_id=?
+SELECT _id, 'objective' AS entity FROM objective8.objectives WHERE global_id=?

 UNION

-SELECT _id, 'draft' AS entity FROM drafts WHERE global_id=?
+SELECT _id, 'draft' AS entity FROM objective8.drafts WHERE global_id=?
 " [global-id, global-id]] :results)
                          first
                          (update-in [:entity] keyword))]


Fix for issue #97

Fix for issue #97

Change timbre to log to standard out by default

--- src/onyx/logging_configuration.clj
+++ src/onyx/logging_configuration.clj
@@ -14,13 +14,13 @@
           [:appenders :rotor]
           {:min-level :info
            :enabled? true
-           :async? false
+           :async? false
            :max-message-per-msecs nil
            :fn rotor/appender-fn})
         (timbre/set-config!
           [:shared-appender-config :rotor]
           {:path file :max-size (* 512 10240) :backlog 5})
-        (timbre/set-config! [:appenders :standard-out :enabled?] false)
+        (timbre/set-config! [:appenders :standard-out :enabled?] true)
         (timbre/set-config! [:appenders :spit :enabled?] false)))

     (info "Starting Logging Configuration")


[#3158] Refactor

[#3158] Refactor

--- backend/src/akvo/lumen/lib/data_group.clj
+++ backend/src/akvo/lumen/lib/data_group.clj
@@ -88,7 +88,6 @@
     {:table-name t-name :columns (or all-columns columns)}))

 (defn- main-metadata
-  "data-groups persistent view needs at least metadata or main for the following joins"
   [all-data-groups]
   (first (or (seq (filter #(= "metadata" (:group-id %)) all-data-groups))
              (seq (filter #(= "main" (:group-id %)) all-data-groups)))))
@@ -99,7 +98,7 @@
   (into #{(main-metadata all-data-groups)}
         (mapv (partial datagroup-by-column all-data-groups) cols)))

-(defn- response-with-updated-persisted-view
+(defn- temp-view-response-with-selected-data-groups
   [tenant-conn viz-id dataset-version-id all-data-groups cols]
   (let [data-groups-selected* (data-groups-selected all-data-groups cols)]
     (response tenant-conn
@@ -114,6 +113,6 @@
                                        (map #(update % :columns (comp walk/keywordize-keys vec)))))]
     (let [dataset-version-id (:dataset-version-id (first all-data-groups))]
       (if viz-id
-        (response-with-updated-persisted-view tenant-conn viz-id dataset-version-id all-data-groups cols)
+        (temp-view-response-with-selected-data-groups tenant-conn viz-id dataset-version-id all-data-groups cols)
         (response tenant-conn all-data-groups
                   (view-table-name (:dataset-version-id (first all-data-groups))))))))


Add missing require

Add missing require

--- backend/src/circle/backend/action/vcs.clj
+++ backend/src/circle/backend/action/vcs.clj
@@ -8,6 +8,7 @@
   (:require [circle.sh :as sh])
   (:use [circle.backend.action.bash :only (remote-bash-build)])
   (:require [circle.backend.build :as build])
+  (:require fs)
   (:use midje.sweet)
   (:use [circle.backend.action.user :only (home-dir)]))


Fix: sort throws when fed with objects of different type

--- frontend/src/faceboard/views/boards/people.cljs
+++ frontend/src/faceboard/views/boards/people.cljs
@@ -326,7 +326,11 @@
   (render [_]
     (let [{:keys [ui anims]} data
           people (get-in data [:content :people])
-          sorted-people (sort #(compare (get-in %1 [:bio :name]) (get-in %2 [:bio :name])) people)
+          people-comparator (fn [p1 p2]
+                              (let [name1 (str (get-in p1 [:bio :name]))
+                                    name2 (str (get-in p2 [:bio :name]))]
+                                (compare name1 name2)))
+          sorted-people (sort people-comparator people)
           extended-set (:extended-set ui)
           active-filters (get-in ui [:filters :active])
           filter-predicates (build-filter-predicates active-filters data)


tweak run params and aot the source

tweak run params and aot the source

--- cjmt/project.clj
+++ cjmt/project.clj
@@ -5,5 +5,6 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.5.1"]]
   :main cjmt.core
-  :jvm-opts ["-Xmx1g" "-server"]
+  :aot :all
+  :jvm-opts ^:replace ["-server" "-Xmx2g"]
   :target-path "target/%s")


Delete the obsolete constants-test ns.

Delete the obsolete constants-test ns.

The functionality it was testing is gone and not coming back.

--- test/frereth_cp/constants_test.clj
+++ test/frereth_cp/constants_test.clj
@@ -1,20 +0,0 @@
-(ns frereth-cp.constants-test
-  (:require [frereth-cp.shared.constants :as K]
-            [clojure.test :refer (deftest is testing)]))
-
-(deftest test-initiate-message-length-filter
-  ;; It's been replaced by
-  ;; (K/legal-vouch-message-length? msg-bytes)
-  ;; which gets called from
-  ;; frereth-cp.client.message/filter-initial-message-bytes
-  ;; That trusts the message loop to get his part
-  ;; correct.
-  (throw (RuntimeException. "This has gone away"))
-  (testing "Under 640 rounds down to nearest 16"
-    (is (= (K/initiate-message-length-filter 15) 0))
-    (is (= (K/initiate-message-length-filter 639) 624)))
-  (testing "640 is 640"
-    (is (= (K/initiate-message-length-filter 640) 640)))
-  (testing "Over 640 is still 640"
-    (is (= (K/initiate-message-length-filter 651) 640))
-    (is (= (K/initiate-message-length-filter 6510) 640))))


Removing hard-coded url

Removing hard-coded url

--- test/time_tracker/test_helpers.clj
+++ test/time_tracker/test_helpers.clj
@@ -50,7 +50,7 @@
   "Opens a connection and completes the auth handshake."
   [google-id]
   (let [response-chan (chan 5)
-        socket        (ws/connect "ws://localhost:8000/api/timers/ws-connect/"
+        socket        (ws/connect (settings :ws-url)
                                 :on-receive (fn on-receive
                                               [data]
                                               (log/debug {:event ::received-ws-data


Made CSV export MS SQL bulk load compatible (NULLs as empty strings, RL+LF line endings)

--- taxi-rides-clj/src/taxi_rides_clj/core.clj
+++ taxi-rides-clj/src/taxi_rides_clj/core.clj
@@ -235,13 +235,13 @@
   (let [file-out (string/replace file "/data/" "/data_out/")
         file-tmp (string/replace file-out #"$" ".tmp")
         n-docs   (atom 0)]
-    (with-open [in  (-> file io/file clojure.java.io/input-stream java.util.zip.GZIPInputStream.)
+    (with-open [in  (-> file     io/file clojure.java.io/input-stream java.util.zip.GZIPInputStream.)
                 out (-> file-tmp io/file clojure.java.io/output-stream java.util.zip.GZIPOutputStream. io/writer)]
       (let [_            (u/my-println-f "started")
             cols         (-> fields keys set (disj :pickup-pos :dropoff-pos) sort)
             docs         (parse-trips file in)
             dt-format   #(let [[y1 y2 m d h i s] (->> % (remove #{\T \Z}) (partition 2) (map (partial apply str)))] (str y1 y2 \- m \- d \space h \: i \: s))
-            get-cols    #(map (fn [col] (or (col %) "NULL")) cols)
+            get-cols    #(map (fn [col] (or (col %) "")) cols)
             _            (csv/write-csv out
                            (concat
                              [(for [col cols] (-> col str (subs 1)))]
@@ -250,7 +250,8 @@
                                    (-> doc
                                        (update :pickup-dt  dt-format)
                                        (update :dropoff-dt dt-format)
-                                       get-cols)))))]))
+                                       get-cols))))
+                           :newline :cr+lf)]))
     (.renameTo (java.io.File. file-tmp) (java.io.File. file-out))
     (u/my-println-f (str "finished, " @n-docs " rows"))
     {:generated @n-docs}))


user-creds mappings fix

user-creds mappings fix

--- ssclj/jar/src/com/sixsq/slipstream/ssclj/migrate/user_cred.clj
+++ ssclj/jar/src/com/sixsq/slipstream/ssclj/migrate/user_cred.clj
@@ -187,5 +187,4 @@
                                    :username (environ/env :dbmigration-user) ;;export DBMIGRATION_USER="super"

                                    :password (environ/env :dbmigration-password)})]
-    (doall (map (partial add-credentials client) (map #(first (keys %)) mappings-exoscale ;mappings
-                                                      )))))
+    (doall (map (partial add-credentials client) (map #(first (keys %)) mappings)))))


Whole bunch of tests

Whole bunch of tests

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -3,6 +3,7 @@
             [caesium.crypto.secretbox :as s]
             [caesium.crypto.secretbox-test :as st]
             [clojure.test :refer [deftest is]]
+            [caesium.randombytes :as r]
             [caesium.util :as u]))

 (deftest xor-test
@@ -18,10 +19,43 @@

 (deftest secretbox-pfx-test
   (let [nonce (byte-array (range s/noncebytes))
-        ctext (ms/secretbox-pfx st/ptext nonce st/secret-key)]
-    (is (= (+ s/noncebytes
-              (alength ^bytes st/ptext)
-              s/macbytes)
+        ctext (ms/secretbox-pfx st/ptext nonce st/secret-key)
+        ptextlen (alength ^bytes st/ptext)]
+    (is (= (+ s/noncebytes ptextlen s/macbytes)
            (alength ^bytes ctext)))
     (is (= (range s/noncebytes)
-           (take s/noncebytes ctext)))))
+           (take s/noncebytes ctext)))
+
+    (let [out (byte-array ptextlen)]
+      (ms/decrypt-to-buf! out st/secret-key ctext)
+      (is (u/array-eq st/ptext out)))
+
+    (let [out (byte-array ptextlen)
+          forgery (r/randombytes (alength ^bytes out))]
+      (is (thrown-with-msg?
+           RuntimeException #"Ciphertext verification failed"
+           (ms/decrypt-to-buf! out st/secret-key forgery))))
+
+    (is (u/array-eq st/ptext (ms/decrypt st/secret-key ctext)))
+
+    (let [forgery (r/randombytes (alength ^bytes out))]
+      (is (thrown-with-msg
+           RuntimeException #"Ciphertext verification failed"
+           (ms/decrypt st/secret-key forgery))))
+
+    (let [out (byte-array ptextlen)]
+      (ms/open-to-buf! out ctext st/secret-key)
+      (is (u/array-eq st/ptext out)))
+
+    (let [out (byte-array ptextlen)
+          forgery (r/randombytes (alength ^bytes out))]
+      (is (thrown-with-msg?
+           RuntimeException #"Ciphertext verification failed"
+           (ms/open-to-buf! out forgery st/secret-key))))
+
+    (is (u/array-eq st/ptext (ms/open ctext st/secret-key)))
+
+    (let [forgery (r/randombytes (alength ^bytes out))]
+      (is (thrown-with-msg
+           RuntimeException #"Ciphertext verification failed"
+           (ms/open forgery st/secret-key))))))


Simplify IND and RI

Simplify IND and RI

--- src/cljs/asciinema_player/vt.cljs
+++ src/cljs/asciinema_player/vt.cljs
@@ -96,8 +96,7 @@

 (defn move-cursor-down [{:keys [bottom-margin height] {y :y} :cursor :as vt}]
   (let [last-row (dec height)]
-    (cond (< y bottom-margin) (move-cursor-to-row vt (inc y))
-          (= y bottom-margin) (scroll-up vt)
+    (cond (= y bottom-margin) (scroll-up vt)
           (< y last-row) (move-cursor-to-row vt (inc y))
           :else vt)))

@@ -149,8 +148,7 @@
     vt))

 (defn execute-ri [{:keys [top-margin] {y :y} :cursor :as vt}]
-  (cond (> y top-margin) (move-cursor-to-row vt (dec y))
-        (= y top-margin) (scroll-down vt)
+  (cond (= y top-margin) (scroll-down vt)
         (> y 0) (move-cursor-to-row vt (dec y))
         :else vt))


fix issue with run arrow on remote servers

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -307,8 +307,10 @@
           (for [ice ices]
             (om/build card-view ice {:opts {:flipped (not (:rezzed ice))}}))])
        [:div.content {:class (when (= (count content) 1) "center")}
-        (for [card (reverse content)] (om/build card-view card {:opts {:flipped (not (:rezzed card))}}))
-        (when content (om/build label content {:opts opts}))]]))))
+        (for [card (reverse content)]
+          (om/build card-view card {:opts {:flipped (not (:rezzed card))}}))
+        (when content
+          (om/build label content {:opts opts}))]]))))

 (defmulti board-view #(get-in % [:player :identity :side]))

@@ -316,14 +318,20 @@
   (om/component
    (sab/html
     (let [servers (:servers player)
-          run-server (first (:server run))]
+          s (:server run)
+          server-type (first s)]
+      (.log js/console (clj->js s))
       [:div.corp-board
-       (om/build server-view {:server (:archives servers) :run (when (= run-server "archives") run)})
-       (om/build server-view {:server (:rd servers) :run (when (= run-server "rd") run)})
-       (om/build server-view {:server (:hq servers) :run (when (= run-server "hq") run)})
-       (map-indexed (fn [i server]
-                      (om/build server-view {:server server :run run} {:opts {:name (str "Server " i)}}))
-                    (:remote servers))]))))
+       (om/build server-view {:server (:archives servers) :run (when (= server-type "archives") run)})
+       (om/build server-view {:server (:rd servers) :run (when (= server-type "rd") run)})
+       (om/build server-view {:server (:hq servers) :run (when (= server-type "hq") run)})
+       (map-indexed
+        (fn [i server]
+          (om/build server-view {:server server
+                                 :run (when (and (= server-type "remote")
+                                                 (= (js/parseInt (second s)) i)) run)}
+                    {:opts {:name (str "Server " i)}}))
+        (:remote servers))]))))

 (defmethod board-view "Runner" [{:keys [player run]}]
   (om/component


Fix typo

Fix typo

--- src/cljs/times_tables/canvas.cljs
+++ src/cljs/times_tables/canvas.cljs
@@ -53,8 +53,8 @@
     (.stroke)))

 (defn draw-lines [{:keys [dctx r dots times]}]
-  (aset dctx "stokeStyle" (u/rgb 192 32 32))
-  (aset dctx "stokeWidth" 2)
+  (aset dctx "strokeStyle" (u/rgb 128 128 128))
+  (aset dctx "lineWidth" 1)
   (let [dots-value (:value dots)
         times-value (:value times)
         da (/ PIx2 dots-value)]


Make sure dialogs are centered

Make sure dialogs are centered

--- src/clojure/nightcode/dialogs.clj
+++ src/clojure/nightcode/dialogs.clj
@@ -5,6 +5,11 @@
             [seesaw.core :as s]
             [seesaw.icon :as icon])
   (:import [javax.swing JRadioButton]))
+
+(defn center!
+  [dialog]
+  (.setLocationRelativeTo dialog nil)
+  dialog)

 (defn show-remove-dialog!
   [is-project?]
@@ -19,6 +24,7 @@
                  (s/button :text (utils/get-string :cancel)
                            :listen [:action #(s/return-from-dialog % false)])])
       s/pack!
+      center!
       s/show!))

 (defn show-file-path-dialog!
@@ -33,6 +39,7 @@
                    (s/button :text (utils/get-string :cancel)
                              :listen [:action #(s/return-from-dialog % nil)])])
         s/pack!
+        center!
         s/show!)))

 (defn show-project-clj-dialog!
@@ -45,6 +52,7 @@
                                     :listen [:action
                                              #(s/return-from-dialog % false)])])
       s/pack!
+      center!
       s/show!))

 (defn show-project-type-dialog!
@@ -100,6 +108,7 @@
                               :listen [:action #(s/return-from-dialog
                                                   % (finish))])])
         s/pack!
+        center!
         s/show!)))

 (defn show-shut-down-dialog!
@@ -117,4 +126,5 @@
                                     :listen [:action
                                              #(s/return-from-dialog % false)])])
       s/pack!
+      center!
       s/show!))


start work on delete - lhs

start work on delete - lhs

--- dada2-core/src/test/clojure/org/dada2/test_join_model.clj
+++ dada2-core/src/test/clojure/org/dada2/test_join_model.clj
@@ -34,7 +34,6 @@
     state
     (permute (mapcat (fn [i] (map (fn [j] (conj i j)) head)) state) tail)))

-
 (deftest test-permute
   (is (=
        [[:a1 :b1 :c1] [:a1 :b2 :c1] [:a1 :b3 :c1] [:a2 :b1 :c1] [:a2 :b2 :c1] [:a2 :b3 :c1]]
@@ -58,11 +57,26 @@
       (first indeces)
       lhs-fk-keys))))

+(defn- dissoc-in [seq [k1 k2] _]
+  (assoc seq k1 (dissoc (seq k1) k2)))
+
+(defn- lhs-dissoc [indeces lhs-pk-key lhs-fk-keys lhs]
+  "associate a new lhs with existing index"
+  (assoc
+   indeces
+   0
+   (let [lhs-pk (lhs-pk-key lhs)]
+     (mapv
+      (fn [lhs-index lhs-fk-key] (dissoc-in lhs-index [(lhs-fk-key lhs) lhs-pk] lhs))
+      (first indeces)
+      lhs-fk-keys))))
+
 (deftest test-lhs-access
   (let [before [[{}]]
 	after  [[{String {3 "xxx"}}]]]
     (is (= after (lhs-assoc before count [type] "xxx")))
     (is (= '("xxx") (lhses-get (first after) 0 String)))
+    (is (= [[{String {}}]] (lhs-dissoc after count [type] "xxx")))
     ))

 ;;--------------------------------------------------------------------------------
@@ -97,8 +111,12 @@
 	joins (derive-joins (rest new-indeces) lhs-fk-keys lhs join-fn)]
     [new-indeces (fn [_] (on-upserts joined-model joins))]))

+(defn- lhs-delete [old-indeces lhs-pk-key lhs-fk-keys lhs join-fn joined-model]
+  (let [new-indeces (lhs-dissoc old-indeces lhs-pk-key lhs-fk-keys lhs)
+	joins (derive-joins (rest new-indeces) lhs-fk-keys lhs join-fn)]
+    [new-indeces (fn [_] (on-deletes joined-model joins))]))
+
 ;;; TODO
-(defn- lhs-delete [old-indeces i ks v join-fn])
 (defn- lhs-upserts [old-indeces i ks vs join-fn])
 (defn- lhs-deletes [old-indeces i ks vs join-fn])

@@ -107,7 +125,7 @@
    View
    ;; singleton changes
    (on-upsert [_ upsertion] ((swap*! indeces lhs-upsert lhs-pk-key lhs-fk-keys upsertion join-fn joined-model) []) nil) ;TODO - pass in views to notifier
-   (on-delete [_ deletion]  (swap! indeces lhs-delete lhs-fk-keys deletion join-fn) nil)
+   (on-delete [_ deletion]  ((swap*! indeces lhs-delete  lhs-pk-key lhs-fk-keys deletion join-fn joined-model) []) nil) ;TODO - pass in views to notifier
    ;; batch changes
    (on-upserts [_ upsertions] (swap! indeces lhs-upserts lhs-fk-keys upsertions join-fn) nil)
    (on-deletes [_ deletions]  (swap! indeces lhs-deletes lhs-fk-keys deletions join-fn) nil)))
@@ -325,6 +343,19 @@
 	   }
 	   (data joined-model)))

+    ;; join - new lhs - a2
+    (on-delete as a2)
+    (is (= [[{:b {:a1 a1v1}}{:c {:a1 a1v1}}]
+	    {:b {:b1 b1v1 :b2 b2}} {:c {:c1 c1v1 :c2 c2}}] (data join)))
+    (is (= {
+	   [:a1 :b1 :c1] (->ABC [:a1 :b1 :c1] [1 1 1] "b1v1-data" "c1v1-data")
+	   [:a1 :b2 :c1] (->ABC [:a1 :b2 :c1] [1 0 1] "b2-data" "c1v1-data")
+	   [:a1 :b1 :c2] (->ABC [:a1 :b1 :c2] [1 1 0] "b1v1-data" "c2-data")
+	   [:a1 :b2 :c2] (->ABC [:a1 :b2 :c2] [1 0 0] "b2-data" "c2-data")
+	   }
+	   (data joined-model)))
+
+
     ;; TODO:
     ;;  amend in/out
     ;;  delete


partition.clj: implemented IFn and IPersistentCollection

--- clojure/org/gavrog/clojure/partition.clj
+++ clojure/org/gavrog/clojure/partition.clj
@@ -33,16 +33,25 @@
                       (let [root (pfind self x)]
                         (assoc b root (conj (or (b root) #{}) x))))
              blocks (reduce add-in {} (apply concat parent))]
-         (vals blocks))))
+         (vals blocks)))
+  clojure.lang.IFn
+  (invoke [self] self)
+  (invoke [self x] (pfind self x))
+  (applyTo [self args] (clojure.lang.AFn/applyToHelper self args))
+  clojure.lang.IPersistentCollection
+  (count [self] (count (into #{} (apply concat parent))))
+  (empty [self] (Partition. {} {}))
+  (cons [self [a b]] (punion self a b))
+  (equiv [self obj]
+         (= (seq self) (if (extends? IPartition (type obj)) (seq obj) obj))))

 (def pempty (Partition. {} {}))

+(defn pmake [& xs] (into pempty (partition 2 xs)))
+
 ;; === Tests

-(def ^{:private true} p
-  (-> pempty
-    (punion 1 2) (punion 3 4) (punion 2 4)
-    (punion 1 5) (punion 6 7) (punion 8 8)))
+(def ^{:private true} p (pmake 1 2, 3 4, 2 4, 1 5, 6 7, 8 8))

 (deftest partition-test
   (testing "find"


Removing mistakenly added character.

Removing mistakenly added character.

--- common-lib/test/cmr/common/test/util.clj
+++ common-lib/test/cmr/common/test/util.clj
@@ -82,7 +82,7 @@
     (testing "multi arity"
     (let [counter (atom 0)
           counter-fn #(swap! counter inc)]
-      (is (= 3 (test-timed-multi-arity counter-fnf)))))))
+      (is (= 3 (test-timed-multi-arity counter-fn)))))))

 (deftest build-validator-test
   (let [error-type :not-found


CMR-4152: Request logs are still logging the incorrect time in NGAP. (#105)

* CMR-4152: Request logs are still logging the incorrect time in NGAP. Explicitly set the time zone via configuration.

* CMR-4152: Add more info to the docstring.

--- common-lib/src/cmr/common/api/web_server.clj
+++ common-lib/src/cmr/common/api/web_server.clj
@@ -9,7 +9,6 @@
    [ring.adapter.jetty :as jetty])
   (:import
    (java.io ByteArrayInputStream InputStream)
-   (java.util TimeZone)
    (org.eclipse.jetty.server Server NCSARequestLog Connector HttpConnectionFactory)
    (org.eclipse.jetty.server.handler RequestLogHandler)
    (org.eclipse.jetty.servlets.gzip GzipHandler)))
@@ -42,9 +41,9 @@
   ONE_MB)

 (def MAX_REQUEST_BODY_SIZE
- "The maximum size of a request to body. This is set to 500KB prevent large requests coming in
+ "The maximum size of a request to body. This is set to 5 MB prevent large requests coming in
   that cause out of memory exceptions. A large ISO document like AST_L1A can be 120K characters which
-  would take up about 240KB in Java. This value is set to 5 MB."
+  would take up about 240KB in Java."
  (* 5 ONE_MB))

 (defn- routes-fn-verify-size
@@ -86,6 +85,19 @@
                                                  (+ total-bytes-read bytes-read)))))
               (recur (+ total-bytes-read bytes-read)))))))))

+(defconfig time-zone
+  "The time zone where the web server is running. Needed because getting the time zone using
+   java.util.TimeZone is not returning the correct information on EC2 instances running in NGAP.
+
+   The default value of \"America/New_York\" will work for all of our NGAP EC2 instances (they are
+   all in US_EAST_1) and for developers working on the east coast.
+
+   If you enable access logging locally and need to set a different time zone you can figure out
+   the string to set by running:
+
+   (.getID (java.util.TimeZone/getDefault)))"
+  {:default "America/New_York"})
+
 (defn create-access-log-handler
   "Setup access logging for each application. Access log entries will go to stdout similar to
   application logging. As a result the access log entries will be in the same log as the
@@ -96,6 +108,7 @@
     (.setRequestLog
       (doto (NCSARequestLog.)
         (.setLogLatency true)
+        (.setLogTimeZone (time-zone))
         (.setLogDateFormat "yyyy-MM-dd hh:mm:ss.SSS")))))

 (defn- create-gzip-handler


Accept test with 1 node.

Accept test with 1 node.

--- test/onyx/log/accept_join_cluster_test.clj
+++ test/onyx/log/accept_join_cluster_test.clj
@@ -27,3 +27,27 @@
   (fact diff => {:observer :d :subject :a})
   (fact (rep-reactions old-replica new-replica diff {}) => []))

+(def entry
+  (create-log-entry :accept-join-cluster
+                    {:accepted {:observer :d
+                                :subject :a}
+                     :updated-watch {:observer :a
+                                     :subject :d}}))
+
+(def f (partial extensions/apply-log-entry entry))
+
+(def rep-diff (partial extensions/replica-diff entry))
+
+(def rep-reactions (partial extensions/reactions entry))
+
+(def old-replica {:pairs {} :accepted {:d :a} :peers [:a]})
+
+(let [new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)]
+  (fact (get-in new-replica [:pairs :d]) => :a)
+  (fact (get-in new-replica [:pairs :a]) => :d)
+  (fact (get-in new-replica [:accepted]) => {})
+  (fact (last (get-in new-replica [:peers])) => :d)
+  (fact diff => {:observer :d :subject :a})
+  (fact (rep-reactions old-replica new-replica diff {}) => []))
+


CW |69| make test reflect the use of redirect uri

--- test/stonecutter/test/controller/oauth.clj
+++ test/stonecutter/test/controller/oauth.clj
@@ -176,10 +176,10 @@

 (facts "about token endpoint"
        (let [user (user/store-user! user-email "password")
-             client-details (cl-client/register-client "MYAPP" "myapp.com")
-             auth-code (cl-auth-code/create-auth-code client-details user "callback")
+             client-details (cl-client/register-client "MYAPP" "http://myapp.com")
+             auth-code (cl-auth-code/create-auth-code client-details user "http://myapp.com/callback")
              request (-> (create-request :get (routes/path :validate-token) {:grant_type   "authorization_code"
-                                                                             :redirect_uri "callback"
+                                                                             :redirect_uri  "http://myapp.com/callback"
                                                                              :code         (:code auth-code)})
                          (create-auth-header client-details))
              response (oauth/validate-token request)


Use new shape entities

Use new shape entities

--- dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
+++ dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
@@ -93,28 +93,13 @@
       (input! :set-cursor-image (:attack-cursor screen) 0 0)
       (input! :set-cursor-image nil 0 0))))

-(defscreen player-health-screen
-  :on-show
-  (fn [screen entities]
-    (update! screen :renderer (shape))
-    nil)
-  :on-render
-  (fn [screen entities]
-    (let [me (u/get-player (-> main-screen :entities deref))
-          pct (/ (:health me) (+ (:health me) (:wounds me)))]
-      (render-shapes! screen :filled
-                      :set-color (color :red)
-                      :rect u/bar-x u/bar-y u/bar-w u/bar-h
-                      :set-color (color :green)
-                      :rect u/bar-x u/bar-y u/bar-w (* u/bar-h pct)))))
-
 (defscreen npc-health-screen
   :on-show
   (fn [screen entities]
     (update! screen
-             :renderer (shape)
+             :renderer (-> main-screen :screen deref :renderer)
              :camera (-> main-screen :screen deref :camera))
-    nil)
+    (shape :filled))
   :on-render
   (fn [screen entities]
     (when-let [e (u/get-entity-at-cursor (-> main-screen :screen deref)
@@ -125,24 +110,35 @@
             bar-y (+ (:y e) (:height e))
             bar-w (:width e)
             pct (/ (:health e) (+ (:health e) (:wounds e)))]
-        (render-shapes! screen :filled
-                        :set-color (color :red)
-                        :rect bar-x bar-y bar-w u/npc-bar-h
-                        :set-color (color :green)
-                        :rect bar-x bar-y (* bar-w pct) u/npc-bar-h)))))
+        (->> (shape (first entities)
+                    :set-color (color :red)
+                    :rect bar-x bar-y bar-w u/npc-bar-h
+                    :set-color (color :green)
+                    :rect bar-x bar-y (* bar-w pct) u/npc-bar-h)
+             vector
+             (render! screen))))))

-(defscreen text-screen
+(defscreen overlay-screen
   :on-show
   (fn [screen entities]
     (update! screen :camera (orthographic) :renderer (stage))
-    (assoc (label "0" (color :white))
-           :id :fps
-           :x 5))
+    [(assoc (label "0" (color :white))
+            :id :fps
+            :x 5)
+     (assoc (shape :filled)
+            :id :bar)])
   :on-render
   (fn [screen entities]
     (->> (for [entity entities]
            (case (:id entity)
              :fps (doto entity (label! :set-text (str (game :fps))))
+             :bar (let [me (u/get-player (-> main-screen :entities deref))
+                        pct (/ (:health me) (+ (:health me) (:wounds me)))]
+                    (shape entity
+                           :set-color (color :red)
+                           :rect u/bar-x u/bar-y u/bar-w u/bar-h
+                           :set-color (color :green)
+                           :rect u/bar-x u/bar-y u/bar-w (* u/bar-h pct)))
              entity))
          (render! screen)))
   :on-resize
@@ -152,5 +148,4 @@
 (defgame dungeon-crawler
   :on-create
   (fn [this]
-    (set-screen! this main-screen
-                 player-health-screen npc-health-screen text-screen)))
+    (set-screen! this main-screen npc-health-screen overlay-screen)))


Add the ability to zoom using mouse wheel.

--- src/uxbox/ui/workspace/canvas.cljs
+++ src/uxbox/ui/workspace/canvas.cljs
@@ -99,12 +99,20 @@
             (on-mouse-up [event]
               (dom/stop-propagation event)
               (uuc/release-action! "ui.shape"
-                                   "ui.selrect"))]
+                                   "ui.selrect"))
+            (on-wheel [event]
+              (when (kbd/ctrl? event)
+                (dom/prevent-default event)
+                (dom/stop-propagation event)
+                (if (pos? (.-deltaY event))
+                  (rs/emit! (dw/increase-zoom))
+                  (rs/emit! (dw/decrease-zoom)))))]
       (html
        [:svg.viewport {:width uuwb/viewport-width
                        :height uuwb/viewport-height
                        :ref "viewport"
                        :class (when drawing? "drawing")
+                       :on-wheel on-wheel
                        :on-mouse-down on-mouse-down
                        :on-mouse-up on-mouse-up}
         [:g.zoom {:transform (str "scale(" zoom ", " zoom ")")}


adding click handlers and new game button

--- cartagena-web/src/cartagena_web/main.cljs
+++ cartagena-web/src/cartagena_web/main.cljs
@@ -236,10 +236,14 @@
    {:x 450 :y 210}
    ;; ship
    {:x 400 :y 240}
- ])
+   ])

 (defn pirate-click [game-state color from-space-index]
-  (println "clicked pirate:" color from-space-index))
+  (if-let [selected-card (:selected-card @app-state)]
+    (do
+      (println "moving" color "from" from-space-index "to" selected-card "; call the server and get the new game state back")
+      (reset! app-state (dissoc @app-state :selected-card)))
+    (println "moving" color "from" from-space-index "backward; call the server and get the new game state back")))

 (defn jail []
   (when-let [jail (get-in @app-state [:board 0])]
@@ -314,64 +318,80 @@
   (first (filter #(= (:current-player game-state) (:name %)) (:players game-state))))

 (defn card-click [game-state card]
-  (println "card-click" card))
+  (do
+    (println "card-click" card)
+    (reset! app-state (assoc @app-state :selected-card card))))
+
+(defn on-error [{:keys [status status-text]}]
+  (.log js/console (str "ERROR [" status "] " status-text)))
+
+(defn on-new-game [response]
+  (println "on-new-game" response)
+  (reset! app-state response))
+
+(defn new-game! []
+  (ajax/POST "http://localhost:3000/new-game"
+             {:params {:players [{:name "tanya" :color :orange} {:name "rusty" :color :black}]}
+              :handler on-new-game
+              :error-handler on-error}))

 (defn main-view []
   [:center
-   [:h1 "CARTAGENA"
-    [:div
-     (-> [:svg
-          {:view-box (str "0 0 " (to-scale 501) " " (to-scale 301))
-           :width (to-scale 501)
-           :height (to-scale 301)}]
-         (into (static-board))
-         (into (jail))
-         (into (normal-spaces))
-         (into (ship))
-         )]
-    (let [{:keys [color cards] player-name :name} (active-player @app-state)
-          card-groups (frequencies cards)]
-      [:div
-       [:table
+   [:h1 "CARTAGENA"]
+   [:div
+    [:button
+     {:class "button"
+      :on-click (fn button-click [e]
+                  (new-game!))}
+     "New Game"]]
+   [:div
+    (-> [:svg
+         {:view-box (str "0 0 " (to-scale 501) " " (to-scale 301))
+          :width (to-scale 501)
+          :height (to-scale 301)}]
+        (into (static-board))
+        (into (jail))
+        (into (normal-spaces))
+        (into (ship))
+        )]
+   (let [{:keys [color cards] player-name :name} (active-player @app-state)
+         card-groups (frequencies cards)]
+     [:div
+      [:table
+       {:class "t1"}
+       [:tbody
         [:tr
          [:td "Player"]
-         [:td player-name]]
-        [:tr
-         [:td "Color"]
-         [:td
-          [:svg
-           {:width (to-scale 20)
-            :height (to-scale 20)}
-           [:circle
-            {:cx (to-scale 10)
-             :cy (to-scale 10)
-             :r (to-scale 7)
-             :fill (name color)}]]
-          [:span {:style {:color (name color)}} (name color)]]]
-        [:tr
-         [:td "Cards"]
-         [:td (for [[card num] card-groups]
-                ^{:key card}
-                [:span {:style {:float "left"}}
-                 [:figure
-                  [:img
-                   {:src (card icon-images)
-                    :width (to-scale 30)
-                    :height (to-scale 30)
-                    :on-click (fn ship-click [e]
-                                   (card-click @app-state card))}]
-                  [:center [:figcaption num]]]])]]]])]])
-
-(defn on-error [{:keys [status status-text]}]
-  (.log js/console (str "ERROR [" status "] " status-text)))
-
-(defn on-new-game [response]
-  (reset! app-state response))
-
-(defn new-game! []
-  (ajax/GET "http://localhost:3000/fake-game"
-            {:handler on-new-game
-             :error-handler on-error}))
+         [:td player-name]]]
+       [:tr
+        [:td "Color"]
+        [:td
+         [:svg
+          {:width (to-scale 20)
+           :height (to-scale 20)}
+          [:circle
+           {:cx (to-scale 10)
+            :cy (to-scale 10)
+            :r (to-scale 7)
+            :fill (name color)}]]
+         [:span {:style {:color (name color)}} (name color)]]]
+       [:tr
+        [:td "Actions Remaining"]
+        [:td (:actions-remaining @app-state)]]
+       [:tr
+        [:td "Cards"]
+        [:td (for [[card num] card-groups]
+               ^{:key card}
+               [:span {:style {:float "left"}}
+                [:figure
+                 [:img
+                  {:src (card icon-images)
+                   :width (to-scale 30)
+                   :height (to-scale 30)
+                   :on-click (fn ship-click [e]
+                               (card-click @app-state card))}]
+                 [:center [:figcaption num]]]])]]]])])
+

 (defn ^:export main []
   (when-let [app (. js/document (getElementById "app"))]


remove no longer referenced map-fn from data-init

--- src/zooniverse_live/data_init.cljs
+++ src/zooniverse_live/data_init.cljs
@@ -48,10 +48,8 @@
 (defn initial-load
   [app]
   (let [classifications-fn (fn [response] (swap! app assoc :classifications response))
-        projects-fn (fn [response] (swap! app assoc :projects (project-list->map response)))
-        map-fn (fn [response] (swap! app assoc :map-data response))]
+        projects-fn (fn [response] (swap! app assoc :projects (project-list->map response)))]
     (request "https://api.zooniverse.org/projects/list" projects-fn)
-    (request "./resources/countries.geo.json" map-fn :clojurize false)
     (request "http://event.zooniverse.org/classifications/galaxy_zoo?per_page=7" classifications-fn)))

 (defn data-init


Dont concat backwards

Dont concat backwards

--- src/lt/plugins/auto_complete.cljs
+++ src/lt/plugins/auto_complete.cljs
@@ -146,11 +146,10 @@
                                :key text|completion})
                 (object/add-tags [:hinter])))

-
 (object/behavior* ::textual-hints
                   :triggers #{:hints+}
                   :reaction (fn [this hints]
-                              (concat hints (::hints @this))))
+                              (concat (::hints @this) hints)))

 (object/behavior* ::escape!
                   :triggers #{:escape!}


Rename some things.

Rename some things.

--- modules/clojure/src/main/clojure/wunderboss/ring.clj
+++ modules/clojure/src/main/clojure/wunderboss/ring.clj
@@ -44,46 +44,46 @@
         (.addAll to-headers k v)
         (.add to-headers k v)))))

-(defprotocol BodyCoercion
-  (coerce-body [body exchange]))
+(defprotocol BodyWriter
+  (write-body [body exchange]))

-(extend-protocol BodyCoercion
+(extend-protocol BodyWriter

   Object
-  (coerce-body [body _]
+  (write-body [body _]
     (throw (IllegalStateException. (str "Can't coerce body of type " (class body)))))

   nil
-  (coerce-body [_ _]
+  (write-body [_ _]
     (throw (IllegalStateException. "Can't coerce nil body")))

   String
-  (coerce-body [body ^OutputStream os]
+  (write-body [body ^OutputStream os]
     (.write os (.getBytes body)))

   ISeq
-  (coerce-body [body ^OutputStream os]
+  (write-body [body ^OutputStream os]
     (doseq [fragment body]
-      (coerce-body fragment os)))
+      (write-body fragment os)))

   File
-  (coerce-body [body ^OutputStream os]
+  (write-body [body ^OutputStream os]
     (io/copy body os))

   InputStream
-  (coerce-body [body ^OutputStream os]
+  (write-body [body ^OutputStream os]
     (with-open [body body]
       (io/copy body os))))

-(defn- populate-response [^HttpServerExchange exchange {:keys [status headers body]}]
+(defn- write-response [^HttpServerExchange exchange {:keys [status headers body]}]
   (when status
     (.setResponseCode exchange status))
   (merge-headers (.getResponseHeaders exchange) headers)
-  (coerce-body body (.getOutputStream exchange)))
+  (write-body body (.getOutputStream exchange)))

 (defn handle-request [f ^HttpServerExchange exchange]
   (.startBlocking exchange)
   (with-open [output-stream (.getOutputStream exchange)]
     (if-let [response (f (ring-request exchange))]
-      (populate-response exchange response)
+      (write-response exchange response)
       (throw (NullPointerException. "Ring handler returned nil")))))


*cough* include node_modules in ::single-file zip

--- plugin/src/leiningen/cljs_lambda/zip_tedium.clj
+++ plugin/src/leiningen/cljs_lambda/zip_tedium.clj
@@ -69,7 +69,8 @@
   (zip-entry zip-stream (io/file index-path) "index.js")
   (zip-entry zip-stream (io/file output-to))
   (when (string? source-map)
-    (zip-entry zip-stream (io/file source-map))))
+    (zip-entry zip-stream (io/file source-map)))
+  (zip-below zip-stream (io/file "node_modules")))

 (defn write-zip [{:keys [output-dir] :as compiler-opts}
                  {:keys [project-name zip-name resource-dirs] :as spec}]


fix :dump-closure-inputs debug option

fix :dump-closure-inputs debug option

--- src/main/shadow/build/closure.clj
+++ src/main/shadow/build/closure.clj
@@ -1089,7 +1089,7 @@
     (spit opts-file (str compiler-options)))

   (doseq [js-mod js-mods]
-    (let [mod-file (data/cache-file state "closure-inputs" (.getName js-mod))]
+    (let [mod-file (data/cache-file state "closure-inputs" (str (.getName js-mod) ".js"))]
       (io/make-parents mod-file)
       (spit mod-file
         (->> (.getInputs js-mod)


add id to request

add id to request

--- src/org/spootnik/fleet/engine.clj
+++ src/org/spootnik/fleet/engine.clj
@@ -58,6 +58,7 @@
                     (request this
                              {:script_name "ping"
                               :script ["ping"]
+                              :id (str (java.util.UUID/randomUUID))
                               :timeout 1000}
                              (chan (a/dropping-buffer 0)))
                     (recur))))))))


[#1205] Use double quotes for unique values in cartocss

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -28,7 +28,7 @@
       (format "[ %s = %s ] { marker-fill: %s }"
               point-color-column
               (if (string? value)
-                (format "'%s'" value)
+                (format "\"%s\"" value)
                 value)
               (pr-str color)))))


fixing type persisty

fixing type persisty

--- test/celestial/integration/aws.clj
+++ test/celestial/integration/aws.clj
@@ -12,7 +12,7 @@

 (fact "aws full scenario works" :ec2 :integration
       (clear-all)
-      (p/add-type "redis" redis-type)
+      (p/add-type redis-type)
       (let [system-id (p/add-system redis-ec2-spec)
             instance (vconstruct (assoc redis-ec2-spec :system-id system-id))
             hostname (get-in redis-ec2-spec [:machine :hostname])]


Add some failing schema tests

Add some failing schema tests

Refs #14.

--- test/icecap/handlers/http_test.clj
+++ test/icecap/handlers/http_test.clj
@@ -7,13 +7,22 @@
             [aleph.http :as h]
             [clojure.test :refer :all]))

+(def url
+  "http://www.example.com")
+
 (def step
-  {:type :http :url "http://www.example.com"})
+  {:type :http :url url})

 (deftest schema-tests
   (testing "valid steps"
-         step)))
     (are [s] (nil? (check-plan s))
+         step))
+  (testing "invalid steps"
+    (are [s expected] (= (check-plan (merge {:type :http} s))
+                         expected)
+         {} '{:url missing-required-key}
+         {:uri url} '{:uri disallowed-key
+                      :url missing-required-key})))

 (def fake-response
   {})


Add error handling for missing moves, support Ditto, see #91

--- frontend/src/cruncher/moves/main.cljs
+++ frontend/src/cruncher/moves/main.cljs
@@ -11,7 +11,9 @@
 (defn get-move
   "Return complete move by its id."
   [id]
-  (get data/all id))
+  (if-let [move (get data/all id)]
+    move
+    {:id -1, :vfx-name "not_found", :name (str "Not found: " id), :type "dummy", :unique-id "V0000_DUMMY", :energy-delta -1, :accuracy-change -1, :duration-ms -1, :power -1, :animation-id -1,:damage-window-end-ms -1, :trainer-level-min 1, :critical-chance 0}))

 (defn get-move-dps
   "Return the Damage per Second value for the quick move of the Pokmeon."


the image shape should be channels not classes (#55)

--- examples/suite-classification/src/suite_classification/core.clj
+++ examples/suite-classification/src/suite_classification/core.clj
@@ -238,7 +238,7 @@
     (imagez/show test-img)
     (infer/classify-one-observation (:network-description
                                      (suite-io/read-nippy-file "trained-network.nippy"))
-                                    observation (ds/create-image-shape mnist-num-classes
+                                    observation (ds/create-image-shape mnist-num-channels
                                                                        mnist-image-size
                                                                        mnist-image-size)
                                     mnist-datatype (classification/get-class-names-from-directory "mnist/testing"))))


Add education component

Add education component

--- app/src/cljs/app/components.cljs
+++ app/src/cljs/app/components.cljs
@@ -2,8 +2,9 @@

 (defn section-component
   [content]
-  [:div.ressection
-   content])
+  [:div.singlecard
+   [:div.mdl-card.mdl-shadow--2dp.ressection
+    content]])

 (defn about-component
   [description]
@@ -86,3 +87,25 @@
    [section-component
     (into [:div.emploment] (map #(single-employment-component %) employments))]])

+(defn single-education-component
+  [education]
+  [:div.education.mdl-card
+   [:div.education--period--institution.mdl-card__title
+    [:div.mdl-card__title-text
+     [:h4 (:period education)]]
+    [:div.mdl-card__title-text
+     [:h4 (:institution education)]]]
+   [:div.education--degree.mdl-card__supporting-text
+    [:div.degree
+     [:h4 (:degree education)]]]
+   [:div.educaton--details.mdl-card__supporting-text
+    [:div.details
+     [:h4 (:details education)]]]])
+
+(defn education-component
+  [educationlist]
+  [:div#educaton
+   [section-component
+    (into [:div.edu]
+          (map #(single-education-component %) educationlist))]])
+


Fix syntax problem in the editor

Fix syntax problem in the editor

--- frontend/src-editor/editor/views/editor.cljs
+++ frontend/src-editor/editor/views/editor.cljs
@@ -127,7 +127,7 @@
                         :lineWrapping      true
                         :foldGutter        true
                         :gutters           #js ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-                        :viewportMargin:   Infinity})
+                        :viewportMargin    Infinity})
           char-width (.call (aget editor "defaultCharWidth") editor)
           base-padding 4]
       (.call (aget editor "on") editor "renderLine" (fn [cm, line, elt]


Move ajax call to top

Move ajax call to top

--- frontend/src/cruncher/utils/status.cljs
+++ frontend/src/cruncher/utils/status.cljs
@@ -22,11 +22,11 @@
   Object
   (render [this]
     (let [{:keys [connected?]} (om/props this)]
+      (when (nil? connected?)
+        (com/ajax-get (:api-status config/api) success-handler error-handler false))
       (dom/div nil
                (vlib/button (fn [] (com/ajax-get (:api-status config/api) success-handler error-handler false))
                             true "Test API" "btn-default btn-xs")
-               (when (nil? connected?)
-                 (com/ajax-get (:api-status config/api) success-handler error-handler false))
                (if connected?
                  (dom/span #js {:className "label label-success"} "API connected")
                  (dom/span #js {:className "label label-warning"} "API not connected"))))))


ARM: at91: properly sort dtb files in Makefile.boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <9fc55922e47e21cb004bb878f69efa10ab51cf02@jcrosoft.com>
Signed-off-by: Nicolas Ferre <45b517be0e5ec6dc3a39715767c1d18e090d39b4@atmel.com>

--- arch/arm/mach-at91/Makefile.boot
+++ arch/arm/mach-at91/Makefile.boot
@@ -13,5 +13,10 @@
 initrd_phys-y	:= 0x20410000
 endif

-dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb usb_a9g20.dtb
+# Keep dtb files sorted alphabetically for each SoC
+# sam9g20
+dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb
+# sam9g45
+dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb
+# sam9x5
 dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb


Eliminate unused require

Eliminate unused require

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -9,7 +9,6 @@
             [cljs.compiler :as c]
             [cljs.env :as env]
             [cljs.repl :as repl]
-            [cljs.reader :as edn]
             [clojure.string :as s]))

 (def DEBUG false)


Chop about 20s off this test

Chop about 20s off this test

--- integration-tests/apps/jobs/test/jobs/at.clj
+++ integration-tests/apps/jobs/test/jobs/at.clj
@@ -22,34 +22,34 @@
   (let [q (random-queue)]
     (with-job #(msg/publish q "ping") []
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (not (msg/receive q :timeout 5000))))))
+      (is (not (msg/receive q :timeout 1000))))))

 (deftest in-should-fire-once-in-x-ms
   (let [q (random-queue)]
-    (with-job #(msg/publish q "ping") [:in 5000]
-      (is (not (msg/receive q :timeout 4000)))
+    (with-job #(msg/publish q "ping") [:in 2000]
+      (is (not (msg/receive q :timeout 1000)))
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (not (msg/receive q :timeout 5000))))))
+      (is (not (msg/receive q :timeout 1000))))))

 (deftest at-as-a-date-should-fire-once-then
   (let [q (random-queue)]
-    (with-job  #(msg/publish q "ping") [:at (Date. (+ 5000 (System/currentTimeMillis)))]
-      (is (not (msg/receive q :timeout 4000)))
+    (with-job  #(msg/publish q "ping") [:at (Date. (+ 2000 (System/currentTimeMillis)))]
+      (is (not (msg/receive q :timeout 1000)))
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (not (msg/receive q :timeout 5000))))))
+      (is (not (msg/receive q :timeout 1000))))))

 (deftest at-as-a-long-should-fire-once-then
   (let [q (random-queue)]
-    (with-job  #(msg/publish q "ping") [:at (+ 5000 (System/currentTimeMillis))]
-      (is (not (msg/receive q :timeout 4000)))
+    (with-job  #(msg/publish q "ping") [:at (+ 2000 (System/currentTimeMillis))]
+      (is (not (msg/receive q :timeout 1000)))
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (not (msg/receive q :timeout 5000))))))
+      (is (not (msg/receive q :timeout 1000))))))

 (deftest every-should-fire-immediately-and-continuously
   (let [q (random-queue)]
     (with-job #(msg/publish q "ping") [:every 500]
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (= ["ping" "ping" "ping"] (take 3 (msg/message-seq q :timeout 550)))))))
+      (is (= ["ping" "ping" "ping"] (take 3 (msg/message-seq q :timeout 650)))))))

 (deftest every-with-repeat-should-fire-immediately-x-times
   (let [q (random-queue)]
@@ -59,16 +59,16 @@

 (deftest at-with-every-should-fire-immediately-and-continuously-starting-at-at
   (let [q (random-queue)]
-    (with-job #(msg/publish q "ping") [:at (+ 5000 (System/currentTimeMillis)) :every 500]
-      (is (not (msg/receive q :timeout 4000)))
+    (with-job #(msg/publish q "ping") [:at (+ 2000 (System/currentTimeMillis)) :every 500]
+      (is (not (msg/receive q :timeout 1000)))
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (= ["ping" "ping" "ping"] (take 3 (msg/message-seq q :timeout 550)))))))
+      (is (= ["ping" "ping" "ping"] (take 3 (msg/message-seq q :timeout 650)))))))

 (deftest until-with-every-should-repeat-until-until
   (let [q (random-queue)]
-    (with-job #(msg/publish q "ping") [:until (+ 1999 (System/currentTimeMillis)) :every 500]
+    (with-job #(msg/publish q "ping") [:until (+ 2000 (System/currentTimeMillis)) :every 500]
       (is (= "ping" (msg/receive q :timeout 10000)))
-      (is (= ["ping" "ping" "ping" nil] (take 4 (msg/message-seq q :timeout 550)))))))
+      (is (= ["ping" "ping" "ping" nil] (take 4 (msg/message-seq q :timeout 650)))))))

 (deftest at-with-in-should-throw
   (is (thrown?


build,boot: Regen ./boot/myocamlbuild.boot (Unix lib is not an ocamlbuild dependency in partial mode).

git-svn-id: e7e61699ce1738538ffebb75374fbea0924bc775@8700 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02


fix other registries repository handler

fix other registries repository handler

--- src/cljs/swarmpit/component/service/create_image_other.cljs
+++ src/cljs/swarmpit/component/service/create_image_other.cljs
@@ -42,7 +42,7 @@
        :onChange (fn [_ _ v]
                    (state/update-value [:data] [] cursor)
                    (state/update-value [:registry] v cursor)
-                   (repository-handler registry))}
+                   (repository-handler v))}
       (->> registries
            (map #(comp/menu-item
                    {:key         %


(SERVER-977) remove now unnecessary destructuring from delete-certificate!

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -1212,7 +1212,7 @@
 (schema/defn ^:always-validate delete-certificate!
   "Delete the certificate for the given subject.
    Note this does not revoke the certificate."
-  [{:keys [csrdir signeddir]} :- CaSettings
+  [{signeddir :signeddir} :- CaSettings
    subject :- schema/Str]
   (let [cert (path-to-cert signeddir subject)]
     (when (fs/exists? cert)


Improve test

Improve test

--- test/clj/introspect/core_test.clj
+++ test/clj/introspect/core_test.clj
@@ -4,11 +4,13 @@
             [introspect.core :refer :all]
             [introspect.helpers.simple-functions :as h1]))

-(deftest a-test
+(deftest t-test
   (h1/constant-return-value-fn 1 1)
   (h1/constant-return-value-fn "1" "1")

-  (is (= "(java.lang.Long -> java.lang.String -> java.lang.String)
-(java.lang.Long -> java.lang.Long -> java.lang.Long)\n"
-         (with-out-str
-           (t h1/constant-return-value-fn)))))
+  (let [types (set
+               (clojure.string/split (with-out-str
+                                       (t h1/constant-return-value-fn))
+                                     #"\n"))]
+    (not (nil? (get types  "(java.lang.Long -> java.lang.Long -> java.lang.Long)")))
+    (not (nil? (get types  "(java.lang.Long -> java.lang.String -> java.lang.String)")))))


Create keys that have hash collision

Create keys that have hash collision

Previously lean-map used keys that had no hash collisions. No a datatype is used that hash only a single hashcode

--- test/cljs/lean_map/test/core.cljs
+++ test/cljs/lean_map/test/core.cljs
@@ -5,8 +5,21 @@
     [clojure.test.check.generators :as gen]
     [cljs.lean-map.core :as lean-map.core]))

-(def gen-element
+(defrecord BadHashNumber [num])
+
+(extend-protocol IHash
+  BadHashNumber
+  (-hash [_]
+    1))
+
+(def gen-bad-hash
+  (gen/fmap (partial apply ->BadHashNumber) (gen/tuple gen/int)))
+
+(def gen-key
+  (gen/tuple (gen/frequency [[9 gen/int] [1 gen-bad-hash]])))
+
+(def gen-value
   (gen/tuple gen/int))

 (deftest assert-lean-map-core-map-like
-  (cc/assert-map-like 100 (.-EMPTY lean-map.core/PersistentHashMap) gen-element gen-element))
+  (cc/assert-map-like 100 (.-EMPTY lean-map.core/PersistentHashMap) gen-key gen-value))


Removed obsolete reference to «iceberg-intent-seq»

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

--- src/conexp/contrib/tests/algorithms/titanic.clj
+++ src/conexp/contrib/tests/algorithms/titanic.clj
@@ -37,7 +37,7 @@
 (deftest test-titanic-iceberg-intent-seq
   (forall [minsupp [0.0 0.2 0.5 0.7 0.9 1.0]]
     (with-testing-data [ctx testing-data]
-      (= (set (iceberg-intent-seq ctx minsupp))
+      (= (set (frequent-closed-itemsets ctx minsupp))
          (set (titanic-iceberg-intent-seq ctx minsupp)))))
   (with-testing-data [ctx testing-data]
     (= (set (titanic-intents ctx))


More tests

More tests

--- test/structural_typing/mechanics/fm_compile.clj
+++ test/structural_typing/mechanics/fm_compile.clj
@@ -48,17 +48,51 @@

   (fact "An optional value"
     (let [odd-if-exists (subject/compile-type (canonicalize {} {:a odd?}))]
-      (run/messages (odd-if-exists {})) =future=> empty?
+      (run/messages (odd-if-exists {})) => empty?
       (run/messages (odd-if-exists {:a 2})) => (just ":a should be `odd?`; it is `2`")
-      (run/messages (odd-if-exists {:a 3})) => empty?))
+      (run/messages (odd-if-exists {:a 3})) => empty?)

-  (future-fact "a path")
+    (fact "Note the difference from a required value"
+      (let [odd-and-exists (subject/compile-type (canonicalize {} [:a] {:a odd?}))]
+        (run/messages (odd-and-exists {})) => (just ":a must exist and be non-nil")
+        (run/messages (odd-and-exists {:a 2})) => (just ":a should be `odd?`; it is `2`")
+        (run/messages (odd-and-exists {:a 3})) => empty?)))

-  (future-fact "a path with multiple values (ALL)")
+  (fact "a path"
+    (let [odd-and-exists (subject/compile-type (canonicalize {} [[:a :b]] {:a {:b odd?}}))]
+      (run/messages (odd-and-exists {})) => (just "[:a :b] must exist and be non-nil")
+      (run/messages (odd-and-exists {:a "hi"})) => (just "[:a :b] must exist and be non-nil")
+      (run/messages (odd-and-exists {:a {:b 2}})) => (just "[:a :b] should be `odd?`; it is `2`")
+      (run/messages (odd-and-exists {:a {:b 3}})) => empty?))
+
+  (fact "a path"
+    (let [odd-and-exists (subject/compile-type (canonicalize {} [[:a :b]] {:a {:b odd?}}))]
+      (run/messages (odd-and-exists {})) => (just "[:a :b] must exist and be non-nil")
+      (run/messages (odd-and-exists {:a "hi"})) => (just "[:a :b] must exist and be non-nil")
+      (run/messages (odd-and-exists {:a {:b 2}})) => (just "[:a :b] should be `odd?`; it is `2`")
+      (run/messages (odd-and-exists {:a {:b 3}})) => empty?))
+
+  (fact "a path with multiple values (ALL)"
+    (let [type (subject/compile-type (canonicalize {} [[:points path/ALL :x]]
+                                                   {[:points path/ALL :x] even?}))]
+      (run/messages (type {:points [{:x 1} {:x 2} {:x 3} {:y 1}]}))
+      => (just "[:points ALL :x] should be `even?`; it is `1`"
+               "[:points ALL :x] should be `even?`; it is `3`"
+               "[:points ALL :x] must exist and be non-nil"
+               :in-any-order)))
+

-  (future-fact "multiple paths in the type")
-
-
-
-
-)
+  (fact "multiple paths in the type"
+    (let [type (subject/compile-type (canonicalize {} {:color string?
+                                                       :point {:x integer?
+                                                               :y integer?}}))]
+      (run/messages (type {})) => empty? ; all optional
+      (run/messages (type {:color "green"})) => empty?
+      (run/messages (type {:color 1})) => (just ":color should be `string?`; it is `1`")
+      (run/messages (type {:color "green"
+                           :point {:x "1"
+                                   :y "2"}}))
+      => (just "[:point :x] should be `integer?`; it is `\"1\"`"
+               "[:point :y] should be `integer?`; it is `\"2\"`"
+               :in-any-order))))
+


nil inspect so it doesn't throw

nil inspect so it doesn't throw

--- src/main/shadow/remote/runtime/obj_support.cljc
+++ src/main/shadow/remote/runtime/obj_support.cljc
@@ -274,7 +274,13 @@
 (extend-protocol p/Inspectable
   #?(:clj Object :cljs default)
   (describe [o opts]
-    (default-describe o opts)))
+    (default-describe o opts))
+
+  nil
+  (describe [o opts]
+    {:data nil
+     :summary {:data-type :nil :obj-type "nil"}
+     :handlers {}}))

 (comment
   (p/describe


user creating a system for another user

user creating a system for another user

--- test/celestial/integration/persistency/persmissions.clj
+++ test/celestial/integration/persistency/persmissions.clj
@@ -70,5 +70,8 @@
          (s/add-system (assoc redis-prox-spec :user "foo")) =>
            (throws ExceptionInfo (is-type? :celestial.persistency.systems/persmission-violation))
          (provided
-           (current-user) => {:username "ronen"} :times 2)))))
+           (current-user) => {:username "ronen"} :times 2)
+         (s/add-system (assoc redis-prox-spec :user "ronen")) => 1
+         (provided
+           (current-user) => {:username "admin"} :times 6)))))


Improve styling of date divider

Improve styling of date divider

--- src/braid/core/client/ui/styles/thread.cljs
+++ src/braid/core/client/ui/styles/thread.cljs
@@ -76,20 +76,25 @@
     {:text-align "center"
      :height "1em"
      :color "#999"
-     :padding "0 0.5rem 0.5rem"}
+     :padding "0 0.5rem 0.5rem"
+     :position "relative"}

     [:>.date
      {:display "inline-block"
       :padding "0 0.5em"
       :background "white"
-      :letter-spacing "0.02em"}]
-
-    [:&:after
+      :letter-spacing "0.02em"
+      ;; so that it gets a z-index
+      :position "relative"}]
+
+    [:&:before
      {:content "\"\""
       :border-bottom "1px solid #ccc"
-      :margin-top "-0.5em"
+      :margin-top "-1px"
       :width "100%"
-      :display "block"}]]])
+      :display "block"
+      :position "absolute"
+      :top "50%"}]]])

 (defn thread [pad]
   [:>.thread


fixed other registry image mapping

fixed other registry image mapping

--- src/clj/swarmpit/docker/mapper/outbound.clj
+++ src/clj/swarmpit/docker/mapper/outbound.clj
@@ -70,15 +70,16 @@
 (defn ->service-update-config
   [service]
   (let [deployment (:deployment service)]
-    {:Parallelism    (:parallelism deployment)
-     :Delay          (:delay deployment)
+    {:Parallelism   (:parallelism deployment)
+     :Delay         (:delay deployment)
      :FailureAction (:failureAction deployment)}))

 (defn ->service-image-registry
   [service registry]
   (let [image (get-in service [:repository :imageName])
-        tag (get-in service [:repository :imageTag])]
-    (str (:url registry) "/" image ":" tag)))
+        tag (get-in service [:repository :imageTag])
+        url (second (str/split (:url registry) #"//"))]
+    (str url "/" image ":" tag)))

 (defn ->service-image
   [service]


Make sure each package always has a unique id

--- src/cljs/ikea_clojure_cup/select_items.cljs
+++ src/cljs/ikea_clojure_cup/select_items.cljs
@@ -156,7 +156,7 @@
          ^{:key (:id item)}
          [trolley-item item
           (partial remove-item-from-trolley trolley-state (:id item))
-          #(swap! trolley-state update-in [:items] conj item)
+          #(swap! trolley-state update-in [:items] conj (assoc item :packages (transform-packages (:packages item))))
           #(swap! trolley-state assoc-in [::flatpack-item] (when % (:id item)))])
        (group-items (:items @trolley-state))))]])


(#15388) Add redirect from '/' to the dashboard

Prior to this commit, if you started up puppetdb and
then attempted to browse to "/", you'd get an error
message that might lead you to believe that the
server wasn't actually running (depending on your
browser).

This commit simply adds a redirect from "/" to
the dashboard index page.

--- src/com/puppetlabs/puppetdb/http/server.clj
+++ src/com/puppetlabs/puppetdb/http/server.clj
@@ -16,7 +16,8 @@
         [com.puppetlabs.utils :only (uri-segments)]
         [net.cgrand.moustache :only (app)]
         [ring.middleware.resource :only (wrap-resource)]
-        [ring.middleware.params :only (wrap-params)]))
+        [ring.middleware.params :only (wrap-params)]
+        [ring.util.response :only (redirect)]))

 (def routes
   (app
@@ -40,7 +41,10 @@
    {:get status-app}

    ["metrics" &]
-   {:get metrics-app}))
+   {:get metrics-app}
+
+   [""]
+   {:get (constantly (redirect "/dashboard/index.html"))}))

 (defn build-app
   "Generate a Ring application that handles PuppetDB requests


fix desugar-import

fix desugar-import

--- src/main/clojure/clojure/tools/analyzer/js/utils.clj
+++ src/main/clojure/clojure/tools/analyzer/js/utils.clj
@@ -35,7 +35,7 @@
 (defn desugar-import [imports]
   (reduce (fn [imports import]
             (if (symbol? import)
-              (let [s (s/split (name import) ".")]
+              (let [s (s/split (name import) #"\.")]
                 (assoc imports (symbol (s/join "." (butlast s))) #{(symbol (last s))}))
               (assoc imports (first import) (set (rest import)))))
           {} imports))


Changed namespace declaration for mv-contexts

to hopefully eliminate a mysterious bug when implementing the Context
protocol for Many-Valued-Contexts.

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

--- src/main/clojure/conexp/fca/many_valued_contexts.clj
+++ src/main/clojure/conexp/fca/many_valued_contexts.clj
@@ -8,8 +8,8 @@

 (ns conexp.fca.many-valued-contexts
   "Many-Valued-Contexts and some functions for scaling."
-  (:use conexp.base
-        conexp.fca.contexts))
+  (:require [conexp.base :refer :all]
+            [conexp.fca.contexts :refer :all]))

 ;;;

@@ -20,7 +20,7 @@
   (hashCode [this]
     (hash-combine-hash Many-Valued-Context objects attributes incidence))
   ;;
-  conexp.fca.contexts/Context
+  Context
   (objects [this] objects)
   (attributes [this] attributes)
   (incidence [this] incidence))


CMR-5056 Fixes quality flag mapping for nil flags.

--- umm-spec-lib/src/cmr/umm_spec/umm_g/measured_parameters.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_g/measured_parameters.clj
@@ -74,10 +74,11 @@

 (defn sanitize-quality-flag
   [flag-type flag-value]
-  (if (some #(= % flag-value)
-            (flag-enum flag-type))
-    flag-value
-    enum-default-value))
+  (when flag-value
+    (if (some #(= % flag-value)
+              (flag-enum flag-type))
+      flag-value
+      enum-default-value)))

 (defn- QAFlags->umm-g-qa-flags
   "Returns umm-lib QAFlags from given UMM-G QAFlags."


lein debugging and env vars

lein debugging and env vars

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,3 +1,23 @@
-{:user {:plugins [[lein-midje "3.0.0"]]
-         :dependencies [[slamhound "1.5.0"]]
-         :aliases {"slamhound" ["run" "-m" "slam.hound"]}}
+{:user {:plugins [[lein-midje "3.0.0"]
+                  [lein-environ "0.4.0"]]
+        :dependencies [[slamhound "RELEASE"]
+                       [org.clojars.gjahad/debug-repl "0.3.3"]]
+        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
+        :injections [(defn contextual-eval [ctx expr]
+                       (eval
+                         `(let [~@(mapcat (fn [[k v]] [k `'~v]) ctx)] ~expr)))
+                     (defmacro local-context []
+                       (let [symbols (keys &env)]
+                         (zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))
+                     (defn readr [prompt exit-code]
+                       (let [input (clojure.main/repl-read prompt exit-code)]
+                         (if (= input ::tl)
+                           exit-code
+                           input)))
+                     ;;make a break point
+                     (defmacro break []
+                       `(clojure.main/repl
+                         :prompt #(print "debug=> ")
+                         :read readr
+                         :eval (partial contextual-eval (local-context))))
+                     ]}}


lein: eastwood bump

lein: eastwood bump

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -1,7 +1,7 @@
 {:user {:plugins [
                   [lein-ring "0.8.13"]
                   [lein-ancient "0.5.5"]
-                  [jonase/eastwood "0.2.0"]
+                  [jonase/eastwood "0.2.1"]
                   [cider/cider-nrepl "0.8.2"]
                   ]}}
 {:dev {:dependencies


trying to revert the indexed change

trying to revert the indexed change

--- src/mafia_votecount/scraper/team_liquid.clj
+++ src/mafia_votecount/scraper/team_liquid.clj
@@ -158,7 +158,7 @@

 (defn- cycle-changes [indexed hosts]
   (filter #(and (is-host? % hosts) (is-cycle-change? (:message (val %))))
-          indexed))
+          (rest indexed)))

 (defn- dec-or-nil [num]
   (if (nil? num)


No longer accurate - tests are a better indicator of sample lines

--- src/aeolian/parser.clj
+++ src/aeolian/parser.clj
@@ -1,7 +1,4 @@
 (ns aeolian.parser)
-
-; Sample metric line - last field (complexity) is optional.
-; /home/amarks/Code/aeolian/resources/Notification.java#203 82 3

 (defn- metric-line-to-bits [metric]
 	(clojure.string/split metric #"\s+"))


Adjust args order for render-activity-for-collection.

--- src/oc/storage/representations/activity.clj
+++ src/oc/storage/representations/activity.clj
@@ -91,7 +91,7 @@

 (defn render-activity-for-collection
   "Create a map of the activity for use in a collection in the API"
-  [org activity comments reactions board user-id]
+  [org board activity comments reactions user-id]
   (entry-rep/render-entry-for-collection org board activity comments reactions (select-keys board [:access-level :role :premium?]) user-id))

 (defn render-activity-list
@@ -157,9 +157,9 @@
                      :total-count (:total-count activity)
                      :items (map (fn [entry]
                                    (render-activity-for-collection org entry
+                                                                   (get boards-by-uuid (:board-uuid entry))
                                                                    (entry-rep/comments entry)
                                                                    (reaction-res/aggregate-reactions (entry-rep/reactions entry))
-                                                                   (get boards-by-uuid (:board-uuid entry))
                                                                    (:user-id user)))
                                  (:activity activity))})}
       {:pretty config/pretty?})))