fix test ignorance

fix test ignorance

--- test/etaoin/api_test2.clj
+++ test/etaoin/api_test2.clj
@@ -31,14 +31,17 @@
         (is (= ["geckodriver" "--port" 1234 "--marionette-port" 2821]
                (:args @driver)))))))

-#_(deftest test-chrome-profile
-    (let [profile-path (str (Files/createTempDirectory
-                              "chrome-profile"
-                              (into-array FileAttribute [])))]
-      (with-chrome-headless {:profile profile-path :args ["--no-sandbox"]} driver
-        (go driver "chrome://version")
-        (is profile-path
-            (get-element-text driver :profile_path)))))
+
+;; TODO: https://github.com/igrishaev/etaoin/issues/296
+#_
+(deftest test-chrome-profile
+  (let [profile-path (str (Files/createTempDirectory
+                           "chrome-profile"
+                           (into-array FileAttribute [])))]
+    (with-chrome-headless {:profile profile-path :args ["--no-sandbox"]} driver
+      (go driver "chrome://version")
+      (is profile-path
+          (get-element-text driver :profile_path)))))

 (deftest test-fail-run-driver
   (is (thrown-with-msg?


Expose require errors

Expose require errors

Former-commit-id: 544950a456272288aee55ef9b4dc8422569bb4ca

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -133,21 +133,29 @@
         (recur (next extensions)))
       (cb nil))))

+(declare print-error)
+
 (defn require [macros-ns? sym reload]
   (cljs/require
-    {:*compiler*     st
-     :*load-fn*      load
-    sym
-    reload
-    {:macros-ns  macros-ns?
-     :verbose    (:verbose @app-env)
-     :source-map true}
-    (fn [res]
-      #_(println "require result:" res))))
+   {:*compiler*     st
+    :*load-fn*      load}
+   sym
+   reload
+   {:macros-ns  macros-ns?
+    :verbose    (:verbose @app-env)
+    :source-map true}
+   (fn [{:keys [error value] :as res}]
+     (cond error (print-error error)
+           (not value) (print-error (js/Error. (str "Unable to load " (second sym))))))))
+
+(defn valid-require? [[ns-form require]]
+  (and (list? ns-form) (= (first ns-form) 'quote)))

 (defn require-destructure [macros-ns? args]
-  (let [[[_ sym] reload] args]
-    (require macros-ns? sym reload)))
+  (if (valid-require? args)
+    (let [[[_ sym] reload] args]
+      (require macros-ns? sym reload))
+    (print-error (js/Error. (str "Invalid require form: " (pr-str (cons 'require args)))))))

 (defn ^:export run-main [main-ns args]
   (let [main-args (js->clj args)]


negative example

negative example


fixed #71

fixed #71

--- src/server/rooms.cljs
+++ src/server/rooms.cljs
@@ -1,5 +1,4 @@
-(ns moomoo.rooms
-  (:require [cljs.nodejs :as nodejs]
+(ns moomoo.rooms (:require [cljs.nodejs :as nodejs]
             [cljs.reader :as reader]
             [clojure.string :as string]
             [cognitect.transit :as transit]))
@@ -112,7 +111,7 @@
 (defn init-room [room callback]
   (.set redis-client (redis-room-prefix room "current-track") 0
     (fn []
-      (.set redis-client (redis-room-prefix room "playing?") "false"
+      (.set redis-client (redis-room-prefix room "playing?") "true"
         (fn []
           (callback))))))


Only show one party at a time, fix contact issue

--- src/app/core.cljs
+++ src/app/core.cljs
@@ -109,7 +109,7 @@
 (defn reset-all! [owner]
   (reset-search! owner)
   (reset-selection! owner)
-  #_(reset-response! owner))
+  (reset-response! owner))

 (defn nav-view [{:keys [selected rsvp-search]} owner]
   (reify om/IRender
@@ -236,65 +236,59 @@
           (om/update! response :contact (:contact party)))

         (html
-         [:div
-          [:main
-           [:h1 "Selection"]
-           [:code (with-out-str (cljs.pprint/pprint selection))]
-           [:h1 "Response"]
-           [:code (with-out-str (cljs.pprint/pprint response))]]
-          [:main
-           [:h2 "RSVP"]
-           [:form {:id "rsvpsubmit"
-                   :onSubmit (fn [e]
-                               (.preventDefault e)
-                               (go (let [[result data] (<! (send-rsvps! selection response))]
-                                     (condp = result
-                                       :success (om/update! response :sent true)
-                                       :failure (js/console.error "Error sending response to Parse:" data)))))}
-            [:section {:class "guests"}
-             (map-indexed
-              (fn [idx {id :id, original-name :name :as info}]
-                [:div
-                 [:input {:type "text"
-                          :class "guestname"
-                          :value (or (get-in infos [id :corrected-name]) original-name)
-                          :ref (str id "name")
-                          :onChange #(om/update! response [:infos id :corrected-name] (.-value (om/get-node owner (str id "name"))))}]
-                 [:fieldset
-                  [:div
-                   (let [radio-name (str "guest" idx "rsvp")]
-                     (map (fn [[label for-str val]]
-                            (let [input-id (str "guest" idx for-str)]
-                              [:div
-                               [:input (cond-> {:type "radio"
-                                                :id input-id
-                                                :name radio-name
-                                                :onChange #(om/update! response [:infos id :attending] val)}
-                                         (= val (get-in infos [id :attending]))
-                                         (assoc :checked true))]
-                               [:label {:for input-id}
-                                label]]))
-                          (partition 3 ["Will attend"   "yes" true
-                                        "Sends regrets" "no" false])))]]])
-              guests)
-             [:p {:class "small"}
-              "(If we've gotten anyone's name wrong, we apologize! Please correct it here so that we can stop embarrassing ourselves.)"]]
-            [:section {:class "addendums"}
-             [:label {:for "foodpref", :class "small"}
-              "We are planning on serving a buffet style meal that will be suitable for both meat eaters and vegetarians. Do you have any dietary restrictions or allergies that we should be aware of?"]
-             [:textarea {:name "foodpref"
-                         :ref "food-preferences"
-                         :value food-preferences
-                         :onChange #(om/update! response :food-preferences (.-value (om/get-node owner "food-preferences")))}]
-
-             [:label {:for "contact" :class "small"}
-              "If we need to contact you with any last-minute information, is this a good email address to use?"]
-             [:input {:type "text"
-                      :ref "contact"
-                      :value contact
-                      :onChange #(om/update! response :contact (.-value (om/get-node owner "contact")))}]
-
-             [:button {:type "submit"} "RSVP"]]]]])))))
+         [:main
+          [:h2 "RSVP"]
+          [:form {:id "rsvpsubmit"
+                  :onSubmit (fn [e]
+                              (.preventDefault e)
+                              (go (let [[result data] (<! (send-rsvps! selection response))]
+                                    (condp = result
+                                      :success (om/update! response :sent true)
+                                      :failure (js/console.error "Error sending response to Parse:" data)))))}
+           [:section {:class "guests"}
+            (map-indexed
+             (fn [idx {id :id, original-name :name :as info}]
+               [:div
+                [:input {:type "text"
+                         :class "guestname"
+                         :value (or (get-in infos [id :corrected-name]) original-name)
+                         :ref (str id "name")
+                         :onChange #(om/update! response [:infos id :corrected-name] (.-value (om/get-node owner (str id "name"))))}]
+                [:fieldset
+                 [:div
+                  (let [radio-name (str "guest" idx "rsvp")]
+                    (map (fn [[label for-str val]]
+                           (let [input-id (str "guest" idx for-str)]
+                             [:div
+                              [:input (cond-> {:type "radio"
+                                               :id input-id
+                                               :name radio-name
+                                               :onChange #(om/update! response [:infos id :attending] val)}
+                                        (= val (get-in infos [id :attending]))
+                                        (assoc :checked true))]
+                              [:label {:for input-id}
+                               label]]))
+                         (partition 3 ["Will attend"   "yes" true
+                                       "Sends regrets" "no" false])))]]])
+             guests)
+            [:p {:class "small"}
+             "(If we've gotten anyone's name wrong, we apologize! Please correct it here so that we can stop embarrassing ourselves.)"]]
+           [:section {:class "addendums"}
+            [:label {:for "foodpref", :class "small"}
+             "We are planning on serving a buffet style meal that will be suitable for both meat eaters and vegetarians. Do you have any dietary restrictions or allergies that we should be aware of?"]
+            [:textarea {:name "foodpref"
+                        :ref "food-preferences"
+                        :value food-preferences
+                        :onChange #(om/update! response :food-preferences (.-value (om/get-node owner "food-preferences")))}]
+
+            [:label {:for "contact" :class "small"}
+             "If we need to contact you with any last-minute information, is this a good email address to use?"]
+            [:input {:type "text"
+                     :ref "contact"
+                     :value contact
+                     :onChange #(om/update! response :contact (.-value (om/get-node owner "contact")))}]
+
+            [:button {:type "submit"} "RSVP"]]]])))))

 (defn rsvp-multiple-results-view [{:keys [name results] :as data} owner]
   (reify
@@ -310,7 +304,9 @@
                          [:button
                           {:onClick #(select-party! owner party)}
                           "Select"]])
-                      results)]
+                      (->> results
+                           (group-by #(get-in % [:party :id]))
+                           (map (fn [[_ v]] (first v)))))]
         [:p "Can't find your RSVP? "
          [:a {:onClick #(do (.preventDefault %)
                             (reset-search! owner)


minor fix

minor fix

--- test/selmer/core_test.clj
+++ test/selmer/core_test.clj
@@ -33,7 +33,7 @@
   (let [s "{{blah}} a b c d"]
     (is (= " a b c d" (render s {}))))
   (let [s "{{blah}} a b c d"]
-    (is (= "blah a b c d" (render-string s {:blah "blah"}))))
+    (is (= "blah a b c d" (render s {:blah "blah"}))))
   ;; Invalid tags are now ignored ;)
   (let [s "{a b c} \nd"]
     (is (= s (render s {})))))


Changed write-json to json

Changed write-json to json

--- modules/javascript/json.clj
+++ modules/javascript/json.clj
@@ -1,16 +1,16 @@
-(def write-json)
+(def json)

 (defn- json-array
   [coll]
-  (str "[" (str-join (map write-json coll) ", ") "]"))
+  (str "[" (str-join (map json coll) ", ") "]"))

 (defn- json-object
   [hash]
   (let [pair (fn [[k v]]
-               (str (write-json k) ": " (write-json v)))]
+               (str (json k) ": " (json v)))]
     (str "{" (str-join (map pair hash) ", ") "}")))

-(defn write-json
+(defn json
   [x]
   (cond
     (nil? x)             "null"


Added mouse-x, mouse-y

Added mouse-x, mouse-y

--- rosado/processing/processing.clj
+++ rosado/processing/processing.clj
@@ -440,6 +440,10 @@
 ;; $$nfc
 ;; $$nfp
 ;; $$nfs
+
+(defn mouse-x [] (.mouseX *applet*))
+
+(defn mouse-y [] (.mouseY *applet*))

 (defn no-cursor [] (.noCursor *applet*))


start playing with multibind macro

start playing with multibind macro

--- src/splash/macros.clj
+++ src/splash/macros.clj
@@ -12,3 +12,14 @@
      (.addChild (-> ~canvas :layer ~layer) ~symb)
      (do ~@body)
      (.removeChild (-> ~canvas :layer ~layer) ~symb)))
+
+;; todo: reqrite these two macros recursively
+(defmacro with-sprites [canvas layer binds & body]
+  (let [symbols (map first (partition 2 binds))]
+    (list 'let binds
+          (concat (map (fn [symb] `(.addChild (-> ~canvas :layer ~layer) ~symb)) symbols)
+                  [(cons 'do body)]
+                  (map (fn [symb] `(.removeChild (-> ~canvas :layer ~layer) ~symb)) (reverse symbols))))))
+
+
+(macroexpand '(with-sprites canv lay [a my-a b my-b] (do1) (do2)))


Updated to initialize the game world for play.

--- src/startrek/core.clj
+++ src/startrek/core.clj
@@ -1,13 +1,29 @@
 (ns startrek.core
   (:require [clojure.data.generators :as gen]
             [clojure.core.reducers :as r]))
-; The global game datastructure
+
+; The global game data structure
 (def game-state (atom 0))

-(defn fill-test [x]
-  (+ 50 x))
-
-(defn get-klingons []
+(def enterprise-id 1)
+(def klingon-id 2)
+(def base-id 3)
+(def star-id 4)
+
+(defn gen-1-8 [] (gen/uniform 1 9))
+
+(defn init-sector-item
+  "Assign an item in a sector to a location."
+  [sector value]
+  (loop []
+    (let [x (gen-1-8) y (gen-1-8)]
+      (if (> (aget sector x y ) 0)
+        (recur)
+       (aset sector x y value)))))
+
+(defn get-klingons
+ "Returns 0-3 klingons in a sector based on a uniform distribution."
+ []
   (let [chance (gen/double)]
     (cond
       (> chance 0.98) 3
@@ -15,37 +31,73 @@
       (> chance 0.8)  1
       :else 0)))

-(def red-test  (r/filter #(> 0  (:klingon %))))
-
-(defn get-starbases []
+(defn get-starbases
+ "Returns 0-1 starbases in a sector based on a uniform distribution."
+  []
   (let [chance (gen/double)]
     (cond
       (> chance 0.96) 1
       :else 0)))

-(defn get-stars [] (gen/uniform 1 9))
-
-(defn quadrant-klingon-count [quadrants]
+(defn get-stars
+  "Returns 1-9 stars for each sector based on a uniform distribution."
+  [] (gen/uniform 1 9))
+
+(defn remaining-klingon-count
+  "Returns the number of klingon ships left in the game."
+  [quadrants]
   (reduce + (flatten (map #(map :klingons %) quadrants))))
-(defn quadrant-starbase-count [quadrants]
+
+(defn remaining-starbase-count
+  "Returns the number of starbases remaining in the game."
+  [quadrants]
   (reduce + (flatten (map #(map :bases %) quadrants))))

-(defn create-quadrants []
-  (to-array-2d
-    (partition  9
-               (for  [y  (range 1 10) x  (range 1 10)]
-                 {:x x :y y :klingons (get-klingons) :stars (get-stars) :bases (get-starbases)}))))
-
-(defn reset-quadrants []
+(defn reset-quadrants
+  "Returns a new quadrants 2d-array that is guaranteed to have at least 1 klingon and 1 starbase."
+  []
+  (defn create-quadrants []
+    (to-array-2d
+      (partition  9
+                 (for  [y  (range 1 10) x  (range 1 10)]
+                   {:x x :y y :klingons (get-klingons) :stars (get-stars) :bases (get-starbases)}))))
+
   (loop []
   (let [quadrants (create-quadrants)]
     (cond
-      (<= (quadrant-klingon-count quadrants) 0) (recur)
-      (<= (quadrant-starbase-count quadrants) 0) (recur)
+      (<= (remaining-klingon-count quadrants) 0) (recur)
+      (<= (remaining-starbase-count quadrants) 0) (recur)
       :else quadrants))))

-; reset enterprise state
-(defn reset-enterprise []
+(defn init-sector
+  "Initialize a sector with the right amount of game related items."
+  []
+  (defn create-empty-sector []
+    (to-array-2d
+      (partition  9
+                 (for  [y  (range 1 10) x  (range 1 10)]  0))))
+  (def quad (aget (:quads @game-state) (:x (:quadrant @game-state)) (:y (:quadrant @game-state))))
+
+  (let [sector (create-empty-sector)]
+    (aset sector (:x (:sector @game-state)) (:y (:sector @game-state)) enterprise-id)
+    (loop [k (:klingons quad)]
+      (when (> k 0)
+        (init-sector-item sector klingon-id)
+        (recur (- k 1))))
+    (loop [k (:bases quad)]
+      (when (> k 0)
+        (init-sector-item sector base-id)
+        (recur (- k 1))))
+    (loop [k (:stars quad)]
+      (when (> k 0)
+        (init-sector-item sector star-id)
+        (recur (- k 1))))
+    (swap! game-state assoc-in [:current-sector] sector)))
+
+
+(defn reset-enterprise
+ "Returns a new instance of the enterprise in the default (repaired) state."
+ []
   {:damage
    {:short_range_sensors 0
     :computer_display 0
@@ -60,15 +112,23 @@
    })

 ; fetch default game state
-(defn new-game-state []
-  (defn gen-0-8 [] (gen/uniform 0 8))
+(defn new-game-state
+  "Create a new world game state. Resets the enterprise and the quadrants."
+  []
   (defn gen-stardate [] (* 100 (+ 20 (gen/uniform 1 21))))

+  (reset! game-state
   {:enterprise (reset-enterprise)
-  :quadrant (reset-quadrants)
-  :sector {:x (gen-0-8) :y (gen-0-8)}
-  :stardate {:start (gen-stardate) :end 30}}
-  )
+  :quadrant {:x (gen-1-8) :y (gen-1-8)}
+  :sector {:x (gen-1-8) :y (gen-1-8)}
+  :quads (reset-quadrants)
+  :current-sector {}
+  :stardate {:start (gen-stardate) :end 30}}))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; All of these methods are used to check or update game state.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+

 (defn print-instructions []
   (println "INSTRUCTIONS"))


Added optionally *opts* destructuring to deftask.

--- src/cake/core.clj
+++ src/cake/core.clj
@@ -75,6 +75,7 @@
    be broken up among multiple deftask calls and even multiple files:
    (deftask foo #{bar baz} ; a set of prerequisites for this task
      \"Documentation for task.\"
+     {foo :foo} ; destructuring of *opts*
      (do-something)
      (do-something-else))"
   [name & body]
@@ -82,8 +83,11 @@
   (let [[deps body] (if (set? (first body))
                       [(first body) (rest body)]
                       [#{} body])
-        [doc actions] (split-with string? body)
-        actions (vec (map #(list 'fn [] %) actions))]
+        [doc body] (split-with string? body)
+        [destruct actions] (if (map? (first body))
+                             [(first body) (rest body)]
+                             [{} body])
+        actions (vec (map #(list 'fn [destruct] %) actions))]
     `(swap! tasks update '~name update-task '~deps '~doc ~actions)))

 (defmacro undeftask [& names]
@@ -103,7 +107,7 @@
           (set! run? (assoc run? name :in-progress))
           (doseq [dep (:deps task)] (run-task dep))
           (binding [*current-task* name]
-            (doseq [action (:actions task)] (action)))
+            (doseq [action (:actions task)] (action *opts*)))
           (set! run? (assoc run? name true)))))))

 (defmacro invoke [name & [opts]]


catch errors reading result line in bake*

--- src/cake/core.clj
+++ src/cake/core.clj
@@ -151,7 +151,9 @@
         (when-not (or (nil? line) (= ":bake.core/result" line))
           (println line)
           (recur (.readLine reader))))
-      (let [result (read-string (.readLine reader))]
+      (let [line   (.readLine reader)
+            result (try (read-string line)
+                        (catch Exception e, line))]
         (flush)
         (.close socket)
         result))))


more cleanups

more cleanups

--- src/midje/internal_ideas/fakes.clj
+++ src/midje/internal_ideas/fakes.clj
@@ -212,14 +212,14 @@

     (let [action (counting-nested-calls (best-call-action function-var actual-args fakes))]
       (pred-cond action
-        nil?          (clojure.test/report {:type :mock-argument-match-failure
-                                            :var function-var
-                                            :actual actual-args
-                                            :position (:position (first fakes))})
         extended-fn?  (apply action actual-args)
-        :else         (do
+        map?          (do
                         (swap! (:call-count-atom action) inc)
-                        ((:result-supplier action )))))))
+                        ((:result-supplier action )))
+        :else (clojure.test/report {:type :mock-argument-match-failure
+                                    :var function-var
+                                    :actual actual-args
+                                    :position (:position (first fakes))})))))

 ;; Binding map related


cleanups

cleanups

--- src/midje/internal_ideas/fakes.clj
+++ src/midje/internal_ideas/fakes.clj
@@ -28,8 +28,8 @@
   (:midje/faked-function (meta function)))

 (defn fake? [form]
-  (some true? (map (partial first-named? form)
-                   ["fake" "data-fake"])))
+  (or (first-named? form "fake")
+      (first-named? form "data-fake")))

 (defn- fake-form-funcall-arglist
   [[fake funcall => value & overrides :as _fake-form_]]


Parallelize data normalization algorithm

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -228,10 +228,10 @@
           (let [min-point  (:time (first data))
                 max-point  (-> to (quot rollup) (* rollup))
                 nil-points (->> (range min-point (inc max-point) rollup)
-                                (map (fn [time] {time [{:time time}]}))
+                                (pmap (fn [time] {time [{:time time}]}))
                                 (reduce merge {}))
                 by-path    (->> (group-by :path data)
-                                (map (partial fill-in nil-points))
+                                (pmap (partial fill-in nil-points))
                                 (reduce merge {}))]
             {:from min-point
              :to   max-point


Remove 'doall'

Remove 'doall'

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -130,7 +130,6 @@
                                                     from to]
                                            :fetch-size Integer/MAX_VALUE
                                            }))]
-                           (doall rows)
                            (when rows
                              (doseq [row rows]
                                (let [time (long (:time row))


Tell ClojureScript One to reload from library source dir

--- sample-app/src/app/clj/one/sample/config.clj
+++ sample-app/src/app/clj/one/sample/config.clj
@@ -8,7 +8,7 @@
                   (html/substitute (html/html-snippet ""))))

 (def ^{:doc "Configuration for the sample application."}
-  config {:src-root "src"
+  config {:src-root "../src"
           :app-root "src/app/cljs"
           :top-level-package "one"
           :js "public/javascripts"


Lint error..

Lint error..

--- src/cljs/wombats_web_client/events/bootstrap.cljs
+++ src/cljs/wombats_web_client/events/bootstrap.cljs
@@ -8,9 +8,10 @@
             [wombats-web-client.socket-dispatcher :as sd]
             [wombats-web-client.events.spritesheet :refer [get-spritesheet]]
             [wombats-web-client.utils.local-storage :refer [remove-token!]]
-            [wombats-web-client.utils.bootstrap :refer [bootstrap-failure
-                                                        token-from-url
-                                                        redirect-unauthenticated]]
+            [wombats-web-client.utils.bootstrap
+             :refer [bootstrap-failure
+                     token-from-url
+                     redirect-unauthenticated]]
             [wombats-web-client.constants.urls :refer [self-url]]
             [wombats-web-client.socket-dispatcher :as sd]
             [wombats-web-client.utils.auth :refer [add-auth-header]])


Introduce code for eastwood warning.

Introduce code for eastwood warning.

--- src/tiny_clj/core.clj
+++ src/tiny_clj/core.clj
@@ -6,6 +6,8 @@
             [ring.adapter.jetty :as jetty]
             [environ.core :refer [env]]
             [net.cgrand.enlive-html :as html]))
+
+(= 1)

 (html/deftemplate base "templates/main.html"
   [title h1]


Remove derived state Filtered data can be derived from other state and properties, so it should not be saved.

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -24,15 +24,20 @@
   {:get-current-slice
    (fn [{:keys [state]}]
      [(:current-page @state) (:rows-per-page @state)])
+   :set-num-rows-visible
+   (fn [{:keys [state]} n]
+     (when (not= n (:num-rows-visible @state))
+       (swap! state assoc :num-rows-visible n :current-page 1)))
    :get-initial-state
-   (fn []
+   (fn [{:keys [props]}]
      {:rows-per-page initial-rows-per-page
-      :current-page 1})
+      :current-page 1
+      :num-rows-visible (:num-total-rows props)})
    :render
    (fn [{:keys [props state refs]}]
      (let [rows-per-page (:rows-per-page @state)
            current-page (:current-page @state)
-           num-rows-visible (:num-rows-visible props)
+           num-rows-visible (:num-rows-visible @state)
            num-pages (js/Math.ceil (/ num-rows-visible rows-per-page))
            allow-prev (> current-page 1)
            allow-next (< current-page num-pages)
@@ -43,19 +48,21 @@

          [:div {:style {:float "left" :display "inline-block" :width "33.33%" :padding "2.15em 0em"
                         :verticalAlign "middle"}}
-          [:b {} (str left-num " - " right-num)] (str " of " (pluralize num-rows-visible " result")
-                                                   (when-not (= num-rows-visible (:num-total-rows props))
-                                                     (str " (filtered from " (:num-total-rows props) " total)")))]
-
-         (style/create-unselectable :div {:style {:float "left" :display "inline-block" :width "33.33%"
-                                                  :padding "1.6em 0em" :verticalAlign "middle" :textAlign "center"}}
+          [:b {} (str left-num " - " right-num)]
+          (str " of " (pluralize num-rows-visible " result")
+               (when-not (= num-rows-visible (:num-total-rows props))
+                 (str " (filtered from " (:num-total-rows props) " total)")))]
+         (style/create-unselectable
+          :div {:style {:float "left" :display "inline-block" :width "33.33%"
+                        :padding "1.6em 0em" :verticalAlign "middle" :textAlign "center"}}
            [:div {:style {:display "inline-block" :padding "0.55em 0.9em"
-                          :color (if allow-prev (:button-blue style/colors) (:border-gray style/colors))
+                          :color (if allow-prev
+                                   (:button-blue style/colors)
+                                   (:border-gray style/colors))
                           :cursor (when allow-prev "pointer")}
                   :onClick (when allow-prev #(swap! state update-in [:current-page] dec))}
             (icons/font-icon {:style {:fontSize "70%"}} :angle-left)
             [:span {:style {:paddingLeft "1em"}} "Prev"]]
-
            [:span {}
             (map (fn [n]
                    (let [selected? (= n current-page)]
@@ -67,27 +74,31 @@
                             :onClick (when-not selected? #(swap! state assoc :current-page n))}
                       n]))
               (create-page-range current-page num-pages))]
-
            [:div {:style {:display "inline-block" :padding "0.55em 0.9em"
-                          :color (if allow-next (:button-blue style/colors) (:border-gray style/colors))
+                          :color (if allow-next
+                                   (:button-blue style/colors)
+                                   (:border-gray style/colors))
                           :cursor (when allow-next "pointer")}
                   :onClick (when allow-next #(swap! state update-in [:current-page] inc))}
             [:span {:style {:paddingRight "1em"}} "Next"]
             (icons/font-icon {:style {:fontSize "70%"}} :angle-right)])
-
          [:div {:style {:float "left" :display "inline-block" :width "33.33%"
                         :padding "2.15em 0em" :textAlign "right"}}
           "Display"
-          (style/create-select {:style {:width 60 :margin "0em 1em"} :ref "numRows"
-                                :onChange #(swap! state assoc
-                                            :rows-per-page (-> (@refs "numRows") .getDOMNode .-value)
-                                            :current-page 1)}
+          (style/create-select
+           {:style {:width 60 :margin "0em 1em"} :ref "numRows"
+            :onChange #(swap! state assoc
+                              :rows-per-page (js/parseInt
+                                              (-> (@refs "numRows") .getDOMNode .-value))
+                              :current-page 1)}
             [10 25 100 500])
           "rows per page"]
          (common/clear-both)]]))
    :component-did-update
-   (fn [{:keys [props]}]
-     ((:onChange props)))})
+   (fn [{:keys [props state prev-state]}]
+     (when-not (and (apply = (map :rows-per-page [prev-state @state]))
+                    (apply = (map :current-page [prev-state @state])))
+       ((:onChange props))))})

 (defn- render-cell [{:keys [width onResizeMouseDown onSortClick sortOrder] :as props}]
@@ -192,7 +203,10 @@

 (react/defc Filterer
-  {:get-initial-state
+  {:get-filter-text
+   (fn [{:keys [refs]}]
+     (-> (@refs "filter-field") .getDOMNode .-value trim))
+   :get-initial-state
    (fn [] {:initial true :synced true})
    :render
    (fn [{:keys [state this]}]
@@ -210,9 +224,9 @@
      (when-not (:initial @state)
        (swap! state assoc :synced false)))
    :apply-filter
-   (fn [{:keys [state props refs]}]
+   (fn [{:keys [this state props refs]}]
      (swap! state assoc :synced true)
-     (let [text (-> (@refs "filter-field") .getDOMNode .-value trim)]
+     (let [text (react/call :get-filter-text this)]
        (when (empty? text) (swap! state assoc :initial true))
        ((:onFilter props) text)))})

@@ -272,6 +286,21 @@
                :style {:borderTop (when (= i (:drop-index @state)) "1px solid gray")}}])])})

+(defn- filter-data [data columns filter-text]
+  (if (empty? filter-text)
+    data
+    (filter (fn [row]
+              (utils/matches-filter-text
+               (apply str (map-indexed
+                           (fn [i column]
+                             (if-let [f (:filter-by column)]
+                               (if (= f :none) "" (f (nth row i)))
+                               (str (nth row i))))
+                           columns))
+               filter-text))
+            data)))
+
+
 (react/defc Table
   {:get-default-props
    (fn []
@@ -284,26 +313,26 @@
    :get-initial-state
    (fn [{:keys [props]}]
      {:ordered-columns (vec (map-indexed
-                              (fn [index col] (assoc col :index index :showing? true
-                                                         :width (or (:starting-width col) 100)
-                                                         :starting-width (or (:starting-width col) 100)))
-                              (:columns props)))
-      :dragging? false
-      :filtered-data (:data props)})
+                             (fn [index col]
+                               (assoc col
+                                      :index index :showing? true
+                                      :width (or (:starting-width col) 100)
+                                      :starting-width (or (:starting-width col) 100)))
+                             (:columns props)))
+      :dragging? false})
    :render
    (fn [{:keys [this state props refs]}]
      (let [paginator-above (= :above (:paginator props))
            paginator-below (= :below (:paginator props))
            paginator [Paginator {:ref "paginator"
-                                 :num-rows-visible (count (:filtered-data @state))
                                  :num-total-rows (count (:data props))
-                                 :onChange #(react/call :handle-pagination-change this)}]]
+                                 :onChange #(react/call :set-body-rows this)}]]
        [:div {}
         (when (or (:filterable? props) (:reorderable-columns? props))
           [:div {:style {:padding "0 0 1em 1em"}}
            (when (:filterable? props)
              [:div {:style {:float "left" :marginRight "1em"}}
-              [Filterer {:ref "filterer" :onFilter (fn [text] (react/call :filter-data this text))}]])
+              [Filterer {:ref "filterer" :onFilter #(react/call :set-body-rows this)}]])
            (when (:reorderable-columns? props)
              [:div {:style {:float "left"}}
               [comps/Button {:icon :gear :title-text "Select Columns..." :ref "col-edit-button"
@@ -319,45 +348,34 @@
         (when paginator-above [:div {:style {:paddingBottom (:paginator-space props)}} paginator])
         [:div {:style {:overflowX "auto"}}
          [:div {:style {:position "relative"
-                        :minWidth (reduce + (map :width (filter :showing? (:ordered-columns @state))))
+                        :minWidth (reduce
+                                   + (map :width (filter :showing? (:ordered-columns @state))))
                         :cursor (when (:dragging? @state) "col-resize")}}
           (render-header state props)
           [Body (assoc props
                   :ref "body"
                   :columns (filter :showing? (:ordered-columns @state))
-                  :initial-rows (react/call :get-sliced-data this true))]]]
+                  :initial-rows (react/call :get-body-rows this (:data props) true))]]]
         (when paginator-below [:div {:style {:paddingTop (:paginator-space props)}} paginator])]))
-   :get-sliced-data
-   (fn [{:keys [state refs]} & [initial-render?]]
+   :get-filtered-data
+   (fn [{:keys [props state refs]}]
+     (filter-data (:data props) (:columns props)
+                  (react/call :get-filter-text (@refs "filterer"))))
+   :get-body-rows
+   (fn [{:keys [props state refs]} filtered-data & [initial-render?]]
      (let [[n c] (if initial-render?
                    [1 initial-rows-per-page]
                    (react/call :get-current-slice (@refs "paginator")))
-           filtered-data (:filtered-data @state)
            sorted-data (if-let [keyfn (:key-fn @state)] (sort-by keyfn filtered-data) filtered-data)
            ordered-data (if (= :desc (:sort-order @state)) (reverse sorted-data) sorted-data)]
        (take c (drop (* (dec n) c) ordered-data))))
-   :filter-data
-   (fn [{:keys [state props]} & [filter-text]]
-     (let [filtered-data
-           (if (empty? filter-text)
-             (:data props)
-             (filter (fn [row]
-                       (utils/matches-filter-text
-                         (apply str (map-indexed
-                                      (fn [i column]
-                                        (if-let [f (:filter-by column)]
-                                          (if (= f :none) "" (f (nth row i)))
-                                          (str (nth row i))))
-                                      (:columns props)))
-                         filter-text))
-               (:data props)))]
-       (swap! state assoc :filtered-data filtered-data)))
-   :handle-pagination-change
+   :set-body-rows
    (fn [{:keys [this refs]}]
-     (react/call :set-rows (@refs "body") (react/call :get-sliced-data this)))
+     (let [rows (react/call :get-filtered-data this)]
+       (react/call :set-rows (@refs "body") (react/call :get-body-rows this rows))
+       (react/call :set-num-rows-visible (@refs "paginator") (count rows))))
    :component-will-receive-props
    (fn [{:keys [state next-props refs]}]
-     (swap! state assoc :filtered-data (:data next-props))
      (react/call :make-desynced (@refs "filterer")))
    :component-did-mount
    (fn [{:keys [this state]}]


Update compliment in template

Update compliment in template

--- src/clojure/leiningen/new/game_clojure/android-project.clj
+++ src/clojure/leiningen/new/game_clojure/android-project.clj
@@ -8,7 +8,7 @@
   :repositories [["sonatype"
                   "https://oss.sonatype.org/content/repositories/snapshots/"]]
   :profiles {:dev {:dependencies [[android/tools.nrepl "0.2.0-bigstack"]
-                                  [compliment "0.0.2"]]
+                                  [compliment "0.0.3"]]
                    :android {:aot :all-with-unused}}
              :release {:android
                        {;; Specify the path to your private


Basic UCT implementation

Basic UCT implementation

--- src/ulam/connect4.clj
+++ src/ulam/connect4.clj
@@ -37,8 +37,8 @@

 (defn check-north [pos bits]
   (and (< pos 21)
-    (= 3 (count (clojure.set/intersection bits
-                                          #{(+ pos 7) (+ pos 14) (+ pos 21)})))))
+       (= 3 (count (clojure.set/intersection bits
+                                             #{(+ pos 7) (+ pos 14) (+ pos 21)})))))

 (defn check-ne [pos bits]
   (and
@@ -74,6 +74,65 @@
       (update-in [(:active state)] #(conj % move))
       (assoc :active (if (= :p1 (:active state)) :p2 :p1))))

+
+(defn add-node [move state]
+  {:state state :unvisited (set (valid-moves state)) :action move :visited 0 :score 0 :children {}}
+  )
+
+(add-node nil (init))
+
+(def tree {:visited 0
+           :score 0
+           :moves #{}
+           :children {:move
+                       {:visited 0 :score 0 :children {}}
+                       }})
+
+(defn uct [node parent-visits]
+  (+ (/ (:score node)
+        (:visited node))
+     (Math/sqrt (/ (* 2 (Math/log parent-visits))
+                   (:visited node)))))
+
+#_(crit/quick-bench (uct {:score 3.0 :visited 10} 100))
+
+(defn update-node [root path result]
+  (-> root
+      (update-in (concat (interleave (repeat :children) path) [:visited]) inc)
+      (update-in (concat (interleave (repeat :children) path) [:score]) #(+ % result))))
+
+
+
+(defn backprop [root path result]
+  (if-not (empty? path)
+    (recur (update-node root path result)
+           (butlast path)
+           result)
+    (update-node root [] result)))
+
+(backprop {:visited 0 :score 0 :children {0 {:visited 0 :score 0}}}
+             [0]
+             15)
+
+
+
+(defn process [mtcs node]
+  (if-not (empty? (:unvisited node))
+    (let [move (rand-nth (vec (:unvisited node)))
+          new-node (add-node move (perform-move (:state node) move))
+          result (simulate-step (perform-move (:state node) move))
+          ]
+      (recur (-> mtcs
+                 (update-in [:unvisited] disj move)
+                 (assoc-in [:children move] new-node)
+                 (backprop [move] result)
+               ) mtcs))
+    (map #(uct % (:visited node))
+         (vals (:children node)))))
+
+(let [root (add-node :root (init))]
+  (process root root))
+
 (defn simulate-step [state]
   (cond (check-win (:p1 state)) 1
         (check-win (:p2 state)) -1
@@ -96,5 +155,5 @@
                    (update-in [random-move :n] inc)
                    (update-in [random-move :total] #(+ % result))))))))

-(simulate (init))
+#_(simulate {:active :p2 :p1 #{3} :p2 #{}})


Bumps version to 1.51.3-SNAPSHOT

Bumps version to 1.51.3-SNAPSHOT

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


Update to FR translation (#1311)

Update to FR translation (#1311)

Create fr.cljs

--- src/status_im/translations/fr.cljs
+++ src/status_im/translations/fr.cljs
@@ -4,16 +4,28 @@
   {
    ;common
    :members-title                         "Membres"
-   :not-implemented                       "! non mis en œuvre"
+   :not-implemented                       "! Pas disponible"
    :chat-name                             "Pseudo"
    :notifications-title                   "Notifications et sons"
    :offline                               "Hors ligne"
+   :search-for                            "Rechercher..."
+   :cancel                                "Annuler"
+   :next                                  "Suivant"
+   :type-a-message                        "Saisissez un message..."
+   :type-a-command                        "Saisissez une commande..."
+   :error                                 "Erreur"
+
+   :camera-access-error                   "Merci d'aller dans vos paramètres système et de vous assurer que Status > Caméra est sélectionné afin d'accorder la permission d'utiliser votre caméra."
+   :photos-access-error                   "Merci d'aller dans vos paramètres système et de vous assurer que Status > Photos est sélectionné afin d'accorder la permission d'utiliser vos photos."

    ;drawer
    :invite-friends                        "Inviter des amis"
    :faq                                   "FAQ"
    :switch-users                          "Changer d'utilisateur"
-
+   :feedback                              "Des remarques?\nSecouez votre téléphone!"
+   :view-all                              "Voir tout"
+   :current-network                       "Le réseau actuel"
+
    ;chat
    :is-typing                             "écrit..."
    :and-you                               "et vous"
@@ -24,27 +36,31 @@
    :members-active                        {:one   "1 membre, 1 actif"
                                            :other "{{count}} membres, {{count}} actifs"
                                            :zero  "Aucun membre"}
+   :public-group-status                   "Public"
    :active-online                         "En ligne"
    :active-unknown                        "Inconnu"
    :available                             "Disponible"
    :no-messages                           "Pas de messages"
    :suggestions-requests                  "Demandes"
    :suggestions-commands                  "Commandes"
+   :faucet-success                        "La demande de Faucet a été reçue"
+   :faucet-error                          "Erreur avec la demande de Faucet"

    ;sync
    :sync-in-progress                      "Synchronisation en cours..."
-   :sync-synced                           "En synchronisation"
+   :sync-synced                           "Synchronisé"

    ;messages
    :status-sending                        "Envoi en cours..."
-   :status-pending                        "En attendant..."
+   :status-pending                        "En attente..."
    :status-sent                           "Envoyé"
    :status-seen-by-everyone               "Vu par tout le monde"
    :status-seen                           "Vu"
-   :status-delivered                      "Livré"
+   :status-delivered                      "Délivré"
    :status-failed                         "Échec"

    ;datetime
+   :datetime-ago-format                   "{{number}} {{time-intervals}} {{ago}}"
    :datetime-second                       {:one   "seconde"
                                            :other "secondes"}
    :datetime-minute                       {:one   "minute"
@@ -60,6 +76,7 @@

    ;profile
    :profile                               "Profil"
+   :edit-profile                          "Modifier profil"
    :report-user                           "DÉNONCER UN UTILISATEUR"
    :message                               "Message"
    :username                              "Nom d'utilisateur"
@@ -67,8 +84,15 @@
    :public-key                            "Clé publique"
    :phone-number                          "Numéro de téléphone"
    :email                                 "Adresse e-mail"
-   :profile-no-status                     "Pas de statut"
+   :update-status                         "Actualisez votre statut..."
+   :add-a-status                          "Ajoutez un statut..."
+   :status-prompt                         "Créez un nouveau statut pour partager vos intérêts avec tout le monde. Vous pouvez aussi utiliser les #hashtags."
    :add-to-contacts                       "Ajouter aux contacts"
+   :in-contacts                           "Dans les contacts"
+   :remove-from-contacts                  "Supprimer des contacts"
+   :start-conversation                    "Débuter une conversation"
+   :send-transaction                      "Envoyer une transaction"
+   :share-qr                              "Partager QR"
    :error-incorrect-name                  "Veuillez choisir un autre nom"
    :error-incorrect-email                 "Adresse e-mail incorrecte"

@@ -78,52 +102,90 @@
    :image-source-gallery                  "Sélectionner dans la galerie"
    :image-source-cancel                   "Annuler"

+   ;;sharing
+   :sharing-copy-to-clipboard             "Copier vers le presse-papiers"
+   :sharing-share                         "Partagez..."
+   :sharing-cancel                        "Annuler"
+
+   :browsing-title                        "Naviguer"
+   :browsing-browse                       "@naviguer"
+   :browsing-open-in-web-browser          "Ouvrir dans le navigateur"
+   :browsing-cancel                       "Annuler"
+
    ;sign-up
    :contacts-syncronized                  "Vos contacts ont été synchronisés"
    :confirmation-code                     (str "Merci ! Nous vous avons envoyé un message texte contenant le code "
                                                "de confirmation. Veuillez fournir ce code pour confirmer votre numéro de téléphone")
    :incorrect-code                        (str "Désolé, le code est incorrect. Veuillez le saisir à nouveau.")
-   :generate-passphrase                   (str "Je vais créer une phrase de passe pour vous permettre de restaurer votre "
+   :generate-passphrase                   (str "Je vais créer une phrase secrète pour vous permettre de restaurer votre "
                                                "accès ou de vous connecter depuis un autre périphérique")
-   :phew-here-is-your-passphrase          "*Ouf* c'était dur, voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour récupérer votre compte."
-   :here-is-your-passphrase               "Voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour récupérer votre compte."
+   :phew-here-is-your-passphrase          "*Ouf* c'était dur, voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour restaurer votre compte."
+   :here-is-your-passphrase               "Voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour restaurer votre compte."
    :written-down                          "Assurez-vous de l'avoir bien écrite"
    :phone-number-required                 "Appuyez ici pour entrer votre numéro de téléphone et je vais trouver vos amis"
+   :shake-your-phone                      "Vous avez trouvé un bug ou alors avez une suggestion? ~Secouez~ simplement votre téléphone!"
    :intro-status                          "Chattez avec moi pour configurer votre compte et modifier vos paramètres !"
-   :intro-message1                        "Bienvenue dans Status\nAppuyez sur ce message pour définir votre mot de passe et commencer !"
+   :intro-message1                        "Bienvenue dans Status\nTapez sur ce message pour définir votre mot de passe et commencer !"
    :account-generation-message            "Donnez-moi une seconde, je dois faire quelques calculs de ouf pour générer votre compte !"
+   :move-to-internal-failure-message      "Nous devons déplacer des fichiers importants depuis un stockage extérieur vers un stockage local. Afin de faire cela, nous avons besoin de votre permission. Nous n'utiliserons plus de stockage extérieur dans nos futures versions."
+   :debug-enabled                         "Le serveur Debug a été lancé! Vous pouvez désormais utiliser *status-dev-cli scan* pour trouver le serveur depuis votre ordinateur sur le même réseau."
+
+   ;phone types
+   :phone-e164                            "International 1"
+   :phone-international                   "International 2"
+   :phone-national                        "National"
+   :phone-significant                     "Significatif"

    ;chats
    :chats                                 "Chats"
    :new-chat                              "Nouveau chat"
+   :delete-chat                           "Supprimer chat"
    :new-group-chat                        "Nouveau chat de groupe"
+   :new-public-group-chat                 "Rejoindre chat public"
+   :edit-chats                            "Modifier chats"
+   :search-chats                          "Rechercher chats"
+   :empty-topic                           "Sujet indéfini"
+   :topic-format                          "Mauvais format [a-z0-9\\-]+"
+   :public-group-topic                    "Sujet"

    ;discover
-   :discover                             "Découverte"
+   :discover                              "Découvrir"
    :none                                  "Aucun"
-   :search-tags                           "Entrez vos mots clés de"
+   :search-tags                           "Entrez vos mots clés ici"
    :popular-tags                          "Mots-clés populaires"
    :recent                                "Récent"
    :no-statuses-discovered                "Aucun statut découvert"
-
+   :no-statuses-found                     "Aucun statut trouvé"
+
    ;settings
    :settings                              "Paramètres"

    ;contacts
    :contacts                              "Contacts"
    :new-contact                           "Nouveau contact"
+   :delete-contact                        "Supprimer contact"
+   :delete-contact-confirmation           "Ce contact sera supprimé de vos contacts"
+   :remove-from-group                     "Supprimer ce groupe"
+   :edit-contacts                         "Modifier contacts"
+   :search-contacts                       "Rechercher contacts"
    :show-all                              "TOUT AFFICHER"
    :contacts-group-dapps                  "ÐApps"
    :contacts-group-people                 "Personnes"
    :contacts-group-new-chat               "Démarrer un nouveau chat"
-   :no-contacts                           "Pas de contacts encore"
+   :choose-from-contacts                  "Ajouter depuis mes contacts"
+   :no-contacts                           "Pas encore de contacts"
    :show-qr                               "Afficher le QR"
-
+   :enter-address                         "Entrez Addresse"
+   :more                                  "plus"
+
    ;group-settings
    :remove                                "Retirer"
    :save                                  "Sauvegarder"
+   :delete                                "Supprimer"
    :change-color                          "Changer la couleur"
    :clear-history                         "Effacer l'historique"
+   :mute-notifications                    "Couper le son des notifications"
+   :leave-chat                            "Quitter le chat"
    :delete-and-leave                      "Supprimer et quitter"
    :chat-settings                         "Paramètres de chat"
    :edit                                  "Modifier"
@@ -153,14 +215,23 @@
    :group-chat-name                       "Pseudo"
    :empty-group-chat-name                 "Veuillez saisir un nom"
    :illegal-group-chat-name               "Veuillez choisir un autre nom"
-
+   :new-group                             "Nouveau groupe"
+   :reorder-groups                        "Réarranger les groupes"
+   :group-name                            "Nom du groupe"
+   :edit-group                            "Modifier groupe"
+   :delete-group                          "Supprimer group"
+   :delete-group-confirmation             "Ce groupe sera enlevé de vos groupes. Cela n'affectera pas vos contacts"
+   :delete-group-prompt                   "Cela n'affectera pas vos contacts"
+   :group-members                         "Membres du groupe"
+   :contact-s                             {:one   "contact"
+                                           :other "contacts"}
    ;participants
    :add-participants                      "Ajouter des participants"
    :remove-participants                   "Supprimer des participants"

    ;protocol
    :received-invitation                   "invitation de chat reçue"
-   :removed-from-chat                     "vous a retiré du chat de groupe"
+   :removed-from-chat                     "vous avez été retiré du chat de groupe"
    :left                                  "est parti(e)"
    :invited                               "invité"
    :removed                               "supprimé"
@@ -170,10 +241,12 @@
    :add-new-contact                       "Ajouter un nouveau contact"
    :import-qr                             "Importer"
    :scan-qr                               "Scanner le QR"
+   :swow-qr                               "Montrer le QR"
    :name                                  "Nom"
    :whisper-identity                      "Murmurer l'identité"
    :address-explication                   "Peut-être qu'ici devrait se trouver un texte expliquant ce qu'est une adresse et où la chercher"
    :enter-valid-address                   "Veuillez saisir une adresse valide ou scanner un code QR"
+   :enter-valid-public-key                "Veuillez saisir une clé publique valide ou scanner un code QR"
    :contact-already-added                 "Le contact a déjà été ajouté"
    :can-not-add-yourself                  "Vous ne pouvez pas vous ajouter vous-même"
    :unknown-address                       "Adresse inconnue"
@@ -184,19 +257,23 @@
    :address                               "Adresse"
    :password                              "Mot de passe"
    :login                                 "Connexion"
+   :sign-in-to-status                     "S'inscrire à Status"
+   :sign-in                               "Inscription"
    :wrong-password                        "Mot de passe incorrect"

    ;recover
-   :recover-from-passphrase               "Récupérer avec la phrase secrète"
-   :recover-explain                       "Veuillez saisir la phrase secrète de votre mot de passe pour restaurer votre accès"
+   :recover-from-passphrase               "Restaurer avec la phrase secrète"
+   :recover-explain                       "Veuillez saisir la phrase secrète correspondant à votre mot de passe pour restaurer votre accès"
    :passphrase                            "Phrase secrète"
-   :recover                               "Récupérer"
+   :recover                               "Restaurer"
    :enter-valid-passphrase                "Veuillez saisir une phrase secrète"
    :enter-valid-password                  "Veuillez saisir un mot de passe"
-
+   :twelve-words-in-correct-order         "12 mots dans l'ordre"
+
    ;accounts
-   :recover-access                        "Récupérer l'accès"
+   :recover-access                        "Restaurer l'accès"
    :add-account                           "Ajouter un compte"
+   :create-new-account                    "Créer un nouveau compte"

    ;wallet-qr-code
    :done                                  "Terminé"
@@ -208,15 +285,30 @@
    :not-enough-eth                        (str "Pas assez d'ETH sur le solde "
                                                "({{balance}} ETH)")
    ;transactions
+   :confirm                               "Confirmer"
    :confirm-transactions                  {:one   "Confirmer la transaction"
                                            :other "Confirmer {{count}} transactions"
                                            :zero  "Aucune transaction"}
+   :transactions-confirmed                {:one   "Transaction confirmée"
+                                           :other "{{count}} transactions confirmées"
+                                           :zero  "Aucune transaction confirmée"}
+   :transaction                           "Transaction"
+   :unsigned-transactions                 "Transactions non signées"
+   :no-unsigned-transactions              "Aucune transaction non signée"
+   :enter-password-transactions           {:one   "Confirmez la transaction en saisissant votre mot de passe"
+                                           :other "Confirmez les transactions en saisissant votre mot de passe"}
    :status                                "Statut"
    :pending-confirmation                  "Confirmation en attente"
    :recipient                             "Destinataire"
    :one-more-item                         "Encore un élément"
    :fee                                   "Frais"
+   :estimated-fee                         "Frais Estimés"
    :value                                 "Valeur"
-
+   :to                                    "à"
+   :from                                  "de"
+   :data                                  "Données"
+   :got-it                                "Compris"
+   :contract-creation                     "Création du contrat"
+
    ;:webview
    :web-view-error                        "Oops, erreur"})


Cosmetic changes on rect shapes components.

--- src/uxbox/main/ui/shapes/rect.cljs
+++ src/uxbox/main/ui/shapes/rect.cljs
@@ -5,9 +5,7 @@
 ;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

 (ns uxbox.main.ui.shapes.rect
-  (:require [sablono.core :refer-macros [html]]
-            [rum.core :as rum]
-            [uxbox.main.ui.shapes.common :as common]
+  (:require [uxbox.main.ui.shapes.common :as common]
             [uxbox.main.ui.shapes.attrs :as attrs]
             [uxbox.util.mixins :as mx :include-macros true]
             [uxbox.main.geom :as geom]
@@ -17,26 +15,21 @@

 (declare rect-shape)

-(defn- rect-component-render
-  [own shape]
+(mx/defc rect-component
+  {:mixins [mx/reactive mx/static]}
+  [shape]
   (let [{:keys [id x y width height group]} shape
         selected (mx/react common/selected-ref)
         selected? (contains? selected id)
         on-mouse-down #(common/on-mouse-down % shape selected)]
-    (html
-     [:g.shape {:class (when selected? "selected")
-                :on-mouse-down on-mouse-down}
-      (rect-shape shape identity)])))
-
-(def rect-component
-  (mx/component
-   {:render rect-component-render
-    :name "rect-component"
-    :mixins [mx/static mx/reactive]}))
+    [:g.shape {:class (when selected? "selected")
+               :on-mouse-down on-mouse-down}
+     (rect-shape shape identity)]))

 ;; --- Rect Shape

 (mx/defc rect-shape
+  {:mixins [mx/static]}
   [{:keys [id x1 y1] :as shape}]
   (let [key (str "shape-" id)
         rfm (geom/transformation-matrix shape)


Add spec-related keywords for completions

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -455,7 +455,9 @@
    :default
    :else
    :gen-class
-   :keywordize-keys])
+   :keywordize-keys
+   :req :req-un :opt :opt-un
+   :args :ret :fn])

 (def ^:private namespace-completion-exclusions
   '[planck.from.io.aviso.ansi


Show tracks in a table

Show tracks in a table

--- src/airhead_cljs/components.cljs
+++ src/airhead_cljs/components.cljs
@@ -38,6 +38,17 @@
      (str " " (:artist track) " - " (:title track))
      "-")])

+(defn tracks-table [tracks button-component]
+  [:table.tracks-table
+    [:thead
+     [:tr
+      [:th] [:th  "Title"] [:th "Artist"] [:th "Album"]]]
+    [:tbody
+     (for [track tracks]
+       [:tr
+        [button-component]
+        [:td (track :title)] [:td (track :artist)] [:td (track :album)]])]])
+
 (defn now-playing-component []
   [:p
    [:span "Now playing:"]
@@ -45,18 +56,13 @@

 (defn next-component []
   [:section
-   [:span "Next:"]
-   [:ul
-    (for [track (@app-state :playlist)]
-      [:li
-       [playlist-remove-component track]
-       [track-component track]])]])
+   [tracks-table (@app-state :playlist) playlist-remove-component]])

 (defn playlist-component []
   [:section#playlist
    [:h2 "Playlist"]
    [now-playing-component]
-   [next-component]])
+   [tracks-table (@app-state :playlist) playlist-remove-component]])

 (defn on-query-change [e]
   ;(get-library!)
@@ -75,10 +81,7 @@
   [:section#library
    [:h2 "Library"]
    [search-component]
-   [:ul (for [track (@app-state :library)]
-          [:li
-           [playlist-add-component track]
-           [track-component track]])]])
+   [tracks-table (@app-state :library) playlist-remove-component]])

 (defn page-component []
   [:main


Allow rules that operate over arbitrary predicates

--- src/aurora/compiler/datalog.cljs
+++ src/aurora/compiler/datalog.cljs
@@ -67,10 +67,14 @@
       #{}
       (match/vars clause))))

+(defn name? [x]
+  (or (string? x) (keyword? x)))
+
 (defn pred-name [clause]
-  (or (and (map? clause) (:name clause))
-      (and (vector? clause) (first clause))
-      ::any))
+  (cond
+   (and (map? clause) (name? (:name clause))) (:name clause)
+   (and (vector? clause) (name? (first clause))) (first clause)
+   :else ::any))

 (defn preds-in [clause]
   ;; TODO check not nil


make extract-*-ids fns public, don't use app-state

Functions don't need to be private, prefer to use store functions
instead of directly accessing store/app-state

--- src/braid/client/dispatcher.cljs
+++ src/braid/client/dispatcher.cljs
@@ -10,19 +10,21 @@
             [braid.client.xhr :refer [edn-xhr]]
             [braid.client.desktop.notify :as notify]))

-(defn- extract-tag-ids [text]
+(defn extract-tag-ids
+  [text]
   (let [mentioned-names (->> (re-seq util/sigiled-tag-name-re text)
                              (map second))]
     (->> mentioned-names
          (map store/name->open-tag-id)
          (remove nil?))))

-(defn- extract-user-ids [text]
+(defn extract-user-ids
+  [text]
   (let [mentioned-names (->> (re-seq util/sigiled-nickname-re text)
                              (map second))
-        nick->id (reduce (fn [m [id {:keys [nickname]}]] (assoc m nickname id))
+        nick->id (reduce (fn [m {:keys [id nickname]}] (assoc m nickname id))
                          {}
-                         (@store/app-state :users))]
+                         (store/all-users))]
     (->> mentioned-names
          (map nick->id)
          (filter store/user-in-open-group?)


show filesystem, path and error for errors in listdir

--- src/brainbot/nozzle/fsworker.clj
+++ src/brainbot/nozzle/fsworker.clj
@@ -79,7 +79,7 @@
                  {:directory path
                   :entries (vfs/listdir-and-stat fs path)}
                  (catch Exception err
-                   (logging/error "error in listdir" err)
+                   (logging/error "error in listdir" {:path path, :fsid (:fsid fs), :error err})
                    nil))]
     (publish "get_permissions" arg)))


Serve static assets from the /public folder

This lets boot-reload work better with the js. For some reason it puts
the /public extension on the files...

--- src/clj/comic_reader/web_app.clj
+++ src/clj/comic_reader/web_app.clj
@@ -40,15 +40,15 @@
   (page/html5
    `[:head
      ~@head
-     ~(page/include-css "css/normalize.css"
-                        "css/foundation.min.css"
-                        "css/app.css")
+     ~(page/include-css "/public/css/normalize.css"
+                        "/public/css/foundation.min.css"
+                        "/public/css/app.css")
      ~@css
-     ~(page/include-js "js/vendor/modernizr.js")]
+     ~(page/include-js "/public/js/vendor/modernizr.js")]
    `[:body ~@content
-     ~(page/include-js "js/vendor/jquery.js"
-                       "js/vendor/fastclick.js"
-                       "js/foundation.min.js")
+     ~(page/include-js "/public/js/vendor/jquery.js"
+                       "/public/js/vendor/fastclick.js"
+                       "/public/js/foundation.min.js")
      ~@js]))

 (defn- make-routes [repository testing?]
@@ -59,7 +59,7 @@
        [[:div.row
          [:div#app.small-12.columns]]
         [:input#history_state {:type "hidden"}]]
-       :js [(page/include-js "js/main.js")]))
+       :js [(page/include-js "/public/js/main.js")]))

     (c/GET "/devcards" []
       (render-page
@@ -69,7 +69,7 @@
        :css [[:style (garden/css
                       [:.com-rigsomelight-devcards_rendered-card
                        [:a.button {:color "#FFF !important"}]])]]
-       :js [(page/include-js "js/devcards.js")]))
+       :js [(page/include-js "/public/js/devcards.js")]))

     (c/context "/api/v1" []
       (cond-> (make-api-routes repository)
@@ -77,7 +77,7 @@
         :always wrap-edn-params
         (not testing?) wrap-edn-body))

-    (route/resources "/")))
+    (route/resources "/public")))

 (defrecord WebApp [config routes repository]
   component/Lifecycle


add message in log when Runner opts to use Globalsec Security Clearance

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -179,8 +179,9 @@
    "Globalsec Security Clearance"
    {:req (req (> (:link runner) 1))
     :events {:runner-turn-begins
-             {:optional {:prompt "Use Globalsec Security Clearance to lose [Click]?" :msg "lose [Click]"
-                         :yes-ability {:effect (effect (lose :click 1)
+             {:optional {:prompt "Use Globalsec Security Clearance to lose [Click]?"
+                         :yes-ability {:msg "lose [Click] and look at the top card of R&D"
+                                       :effect (effect (lose :click 1)
                                                        (prompt! card (str "The top card of R&D is "
                                                                           (:title (first (:deck corp)))) ["OK"] {}))}}}}}


Avoid the following React.js warning: "Returning `false` from an event handler is deprecated and will be ignored in a future release. Instead, manually call e.stopPropagation() or e.preventDefault(), as appropriate."

--- src/cljs/idealist/event-bus.cljs
+++ src/cljs/idealist/event-bus.cljs
@@ -73,7 +73,6 @@
   ([new-methods]
     (extend-pure-methods om/pure-methods new-methods))
   ([methods new-methods]
-    (println (seq new-methods))
     (loop [methods' methods [[new-method-name new-method-fn] & new-methods'] (seq new-methods)]
       (if new-method-name
         (recur (around-method new-method-name methods' new-method-fn) new-methods')
@@ -123,5 +122,8 @@
   "Sends an event from the component down through its parent components."
   [owner event]
   (let [event-send-fn (om/get-state owner ::trigger-fn)]
-    (event-send-fn event)))
+    (event-send-fn event))
+  nil) ;; Avoid the following React.js warning: "Returning `false` from an event handler is deprecated
+       ;; and will be ignored in a future release. Instead, manually call e.stopPropagation() or e.preventDefault(),
+       ;; as appropriate."


moved letter-status logic to the letter component

--- src/cljs/passa_paraula/core.cljs
+++ src/cljs/passa_paraula/core.cljs
@@ -129,12 +129,7 @@

 (defn change-letter-status [letter-id status]
-  (let [color (get status-colors status)
-        letter (.getElementById js/document letter-id)]
-    (set! (.-fill (.-style letter)) color)
-    (set! (.-stroke (.-style letter)) letter-color)
-    (set! (.-strokeWidth (.-style letter)) letter-width)
-    (swap! app-state update-in [:status letter-id] (fn [_] status))))
+  (swap! app-state update-in [:status letter-id] (fn [_] status)))

 (defn jump-next-letter []
@@ -177,7 +172,7 @@
       107 (handle-letter (cur-letter-id) :failed)
       (.log js/console (str "key pressed not valid" key)))))

-(defn hook-keyboard-listener
+(defn hook-keyboard-listener
   []
    (.addEventListener js/window "keypress" handle-keys))


Cleaned up comments

Cleaned up comments

--- src/clojure/freactive/macros.clj
+++ src/clojure/freactive/macros.clj
@@ -42,26 +42,6 @@
     (fn [~bind-sym] ~body)
     ~keyset-cursor ~opts))

-;; (defmacro defsubtype [t fields supertype & impls]
-;;   (let [env &env
-;;         r (:name (cljs.analyzer/resolve-var (dissoc env :locals) t))
-;;         impls (cons 'Object impls)]
-;;     `(do
-;;        (deftype* ~t ~fields nil nil)
-;;        (let [tmp# (fn [])]
-;;          (set! (.-prototype tmp#) (.-prototype ~supertype))
-;;          (set! (.-prototype ~t) (new tmp#)))
-;;        (extend-type ~t ~@(cljs.core/dt->et t impls fields))
-;;        (set! (.-getBasis ~t) (fn [] '[~@fields]))
-;;        (let [basis# (set (.getBasis ~t))]
-;;          (doseq [pf# (.getBasis ~supertype)]
-;;            (assert (contains? basis# pf#) "Sub-types fields not compatible with parent fields")))
-;;        (set! (.-cljs$lang$type ~t) true)
-;;        (set! (.-cljs$lang$ctorStr ~t) ~(str r))
-;;        (set! (.-cljs$lang$ctorPrWriter ~t) (fn [this# writer# opt#] (cljs.core/-write writer# ~(str r))))
-;;        ~t)))
-
-
 (defmacro defsubtype [t fields supertype & impls]
   (let [env &env
         r (:name (cljs.analyzer/resolve-var (dissoc env :locals) t))
@@ -69,15 +49,4 @@
     `(do
        (deftype ~t ~fields ~@impls)
        (freactive.util/inherit! ~t ~supertype)
-       ;; (if (.-setPrototypeOf js/Object)
-       ;;   (.setPrototypeOf js/Object (.-prototype ~t) (.-prototype ~supertype))
-       ;;   (goog.object/forEach
-       ;;    (.-prototype ~supertype)
-       ;;    (let [proto# (.-prototype ~t)]
-       ;;      (fn [val# key# obj#]
-       ;;        (when-not (.hasOwnProperty proto# key#)
-       ;;          (aset proto# key# val#))))))
-       ;; (let [basis# (set (.getBasis ~t))]
-       ;;   (doseq [pf# (.getBasis ~supertype)]
-       ;;     (assert (contains? basis# pf#) "Sub-types fields not compatible with parent fields")))
        ~t)))


CMR-3453: Log warning when "validating that exactly one matching concept is found" fails with zero entry returned           due to encoding mismatching issue.

--- metadata-db-app/src/cmr/metadata_db/services/concept_constraints.clj
+++ metadata-db-app/src/cmr/metadata_db/services/concept_constraints.clj
@@ -1,11 +1,13 @@
 (ns cmr.metadata-db.services.concept-constraints
   "Functions for enforcing constraint checks just after a concept has been saved."
-  (:require [cmr.common.services.errors :as errors]
-            [cmr.metadata-db.data.concepts :as c]
-            [cmr.common.config :refer [defconfig]]
-            [cmr.metadata-db.services.messages :as msg]
-            [cmr.common.util :as util]
-            [clojure.set :as set]))
+  (:require
+    [clojure.set :as set]
+    [cmr.common.config :refer [defconfig]]
+    [cmr.common.log :as log :refer (warn)]
+    [cmr.common.services.errors :as errors]
+    [cmr.common.util :as util]
+    [cmr.metadata-db.data.concepts :as c]
+    [cmr.metadata-db.services.messages :as msg]))

 (defconfig enforce-granule-ur-constraint
   "Configuration to allow enabling and disabling of the granule UR uniqueness constraint"
@@ -29,7 +31,7 @@
   (let [num-concepts (count concepts)]
     (cond
       (zero? num-concepts)
-      (errors/internal-error!
+      (warn
         (format "Unable to find saved concept for provider [%s] and %s [%s]"
                 (:provider-id concept)
                 (name field)


Fix rpc call to pull the request message out of the request parameter

--- sherpa-clojure/src/main/clojure/sherpa/sherpa_server.clj
+++ sherpa-clojure/src/main/clojure/sherpa/sherpa_server.clj
@@ -67,8 +67,12 @@
                      (reify MessageResponder
                             (respond [this msg request]
                                      (try
-                                       (let [msg-name (.getName msg)]
-                                         (sherpa-rpc msg-name listener (.get request msg-name)))
+                                       (let [msg-name (.getName msg)
+                                             response (sherpa-rpc msg-name listener (.get request msg-name))]
+                                         (let [fields (map #(.name %) (.. response getSchema getFields))]
+                                           (doseq [field fields]
+                                             (println "response key=" field "v class=" (class (.get response field)))))
+                                         response)
                                        (catch Throwable t
                                          (do (.printStackTrace t)
                                              (error-response t))))))))


Temporarily disable other formats in translation tests

--- system-int-test/test/cmr/system_int_test/ingest/translation_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/translation_test.clj
@@ -11,11 +11,12 @@
 (def valid-formats
   [
    :umm-json
-   :iso-smap
    :iso19115
-   :dif
-   :dif10
-   :echo10
+   ;; the following formats will be re-enabled once ISO support is complete
+   ;; :iso-smap
+   ;; :dif
+   ;; :dif10
+   ;; :echo10
    ])

 (defn assert-translate-failure


make the pbt stronger

make the pbt stronger

--- test/cljs/tictactoe/game_test.cljs
+++ test/cljs/tictactoe/game_test.cljs
@@ -121,6 +121,7 @@
         old-board (logic/get-board old-game)]
     (and
       (not= old-player new-player)
+      (= :cell/empty (get old-board move))
       (= old-player (get new-board move))
       (= (dissoc old-board move) (dissoc new-board move))
       )))


Matching :none test.

Matching :none test.

--- test/onyx/generative/flow_conditions_gen_test.clj
+++ test/onyx/generative/flow_conditions_gen_test.clj
@@ -125,6 +125,7 @@
          event {:onyx.core/compiled-norm-fcs compiled}
          results (t/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} target-tasks) (into #{} (:flow results))))
+     (is (not (seq (:exclusions results))))
      (is (nil? (:action results))))))

 (deftest no-false-predicate-picks
@@ -147,6 +148,7 @@
          event {:onyx.core/compiled-norm-fcs compiled}
          results (t/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (mapcat :flow/to true-fcs)) (into #{} (:flow results))))
+     (is (not (seq (:exclusions results))))
      (is (nil? (:action results))))))

 (deftest short-circuit
@@ -182,6 +184,7 @@
          event {:onyx.core/compiled-norm-fcs compiled}
          results (t/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (:flow/to (first true-1))) (into #{} (:flow results))))
+     (is (not (seq (:exclusions results))))
      (is (nil? (:action results))))))

 (deftest retry-action
@@ -228,6 +231,7 @@
          event {:onyx.core/compiled-norm-fcs compiled}
          results (t/route-data event nil nil flow-conditions downstream)]
      (is (not (seq (:flow results))))
+     (is (not (seq (:exclusions results))))
      (is (= :retry (:action results))))))

 (deftest key-exclusion
@@ -253,3 +257,71 @@
      (prn excluded-keys)
      (is (into #{} excluded-keys) (:exclusions results))
      (is (nil? (:action results))))))
+
+(deftest matching-all
+  (checking
+   "A :flow/to of :all that passes its predicate matches everything"
+   (times 30)
+   [false-all
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-all-gen)
+                     (false-flow-condition-gen)))
+    true-all
+    (gen/not-empty
+     (gen/vector (->> :a
+                      (flow-condition-gen)
+                      (flow-to-all-gen)
+                      (true-flow-condition-gen))))
+    mixed-all
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-all-gen)
+                     (maybe-predicate)))
+    mixed-none
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-none-gen)
+                     (maybe-predicate)))]
+   (let [fcs [false-all true-all mixed-all mixed-none]
+         downstream (mapcat :flow/to fcs)
+         compiled (c/compile-fc-norms fcs :a)
+         event {:onyx.core/compiled-norm-fcs compiled}
+         results (t/route-data event nil nil fcs downstream)]
+     (is (= (into #{} downstream) (into #{} (:flow/to results))))
+     (is (not (seq (:exclusions results))))
+     (is (nil? (:action results))))))
+
+(deftest matching-none
+  (checking
+   "A :flow/to of :none that passes its pred matches nothing"
+   (times 30)
+   [false-none
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-none-gen)
+                     (false-flow-condition-gen)))
+    true-none
+    (gen/not-empty
+     (gen/vector (->> :a
+                      (flow-condition-gen)
+                      (flow-to-none-gen)
+                      (true-flow-condition-gen))))
+    mixed-none
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-none-gen)
+                     (maybe-predicate)))
+    mixed
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-tasks-gen)
+                     (maybe-predicate)))]
+   (let [fcs [false-none true-none mixed-none mixed]
+         downstream (mapcat :flow/to fcs)
+         compiled (c/compile-fc-norms fcs :a)
+         event {:onyx.core/compiled-norm-fcs compiled}
+         results (t/route-data event nil nil fcs downstream)]
+     (is (not (seq (:flow/to results))))
+     (is (not (seq (:exclusions results))))
+     (is (nil? (:action results))))))


tidy up docstring

tidy up docstring

--- examples/wobble.clj
+++ examples/wobble.clj
@@ -2,7 +2,8 @@
   (:use [overtone.live]))

 (defcgen wobble
-  "wobble an input source to a specified wobble val (which is designed to be remotely modulated"
+  "wobble an input source to a specified wobble val (which is designed
+  to be remotely modulated"
   [src {:doc "input source"}
    wobble-amount {:doc "Amount of wobble to apply (-1 to 1)" :default 0}
    min {:doc "minimum freq to always let through" :default 40}


adding use and asserting non nullness of input

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -6,19 +6,21 @@
     [celestial.core :only (Provision)]
     [celestial.ssh :only (copy execute)]
     [taoensso.timbre :only (debug info error warn)]
-    [slingshot.slingshot :only  [throw+ try+]]))
+    ))

 (defn step [n & steps] (with-meta steps {:step n}))

 (defn copy-module [{:keys [host]} {:keys [src name]}]
-  "Copy a puppet module into server"
-  (copy host src  "/tmp"))
+  {:pre [host src name] }
+  "Copy a opsk module into server"
+  (copy host src "/tmp"))

-(defrecord Standalone [server module]
+(defrecord Standalone [machine module]
   Provision
   (apply- [this]
-    (copy-module server module)
-    (execute server
+    (use 'celestial.puppet-standalone)
+    (copy-module machine module)
+    (execute machine
       (step :extract "cd /tmp" (<< "tar -xzf ~(:name module).tar.gz"))
       (step :run (<< "cd /tmp/~(:name module)") "./scripts/run.sh ")
       (step :cleanup "cd /tmp" (<< "rm -rf ~(:name module)*")))))


Fix meta that wasn't meta.

Fix meta that wasn't meta.

--- src/clj/com/draines/postal/core.clj
+++ src/clj/com/draines/postal/core.clj
@@ -15,15 +15,15 @@
     (sendmail-send msg)))

 (defn stress [profile]
-  (let [defaults {:host "localhost"
-                  :port 25
-                  :from "foo@lolz.dom"
-                  :to "bar@lolz.dom"
-                  :num 1
-                  :delay 100
-                  :threads 1}
+  (let [defaults #^{:host "localhost"
+                    :port 25
+                    :num 1
+                    :delay 100
+                    :threads 1}
+                 {:from "foo@lolz.dom"
+                  :to "bar@lolz.dom"}
         {:keys [host port from to num delay threads]}
-        (merge defaults profile)]
+        (merge (meta defaults) defaults profile)]
     (println (format "sent %s msgs to %s:%s"
                      (spam host port from to num delay threads)
                      host port))))


Keep one function to create synth sensors

--- src/clj/kixi/hecuba/api/devices.clj
+++ src/clj/kixi/hecuba/api/devices.clj
@@ -128,34 +128,25 @@
   [sensors period]
   (filter #(= period (:period %)) sensors))

-(defn create-synth-sensors-new
+(defn create-synth-sensors
   "Added to fix the absence of some synthetic sensors."
   [sensors]
-  (let [cumulative-sensors (get-sensor sensors "CUMULATIVE")]
-    (let [pulse-sensors (map #(ext-type % "differenceSeries")
-                             cumulative-sensors)
-          calc-sensors (map #(calculated-sensor %) pulse-sensors)]
-      (vector cumulative-sensors pulse-sensors calc-sensors))))
-
-(defn create-synth-sensors-default
-  "The original way of creating synthetic sensors.
-  It called throughout the api."
-  [sensors]
-  (concat sensors (map #(case (:period %)
-                          "CUMULATIVE" (ext-type % "differenceSeries")
-                          "PULSE"      (calculated-sensor %)
-                          "INSTANT"    nil
-                          nil) sensors)))
+  (let [cumulative-sensors (get-sensor sensors "CUMULATIVE")
+        pulse-sensors (get-sensor sensors "PULSE")
+        instant-sensors (get-sensor sensors "INSTANT")
+        calc-sensors (map #(calculated-sensor %) pulse-sensors)
+        new-pulse-sensors (map #(ext-type % "differenceSeries")
+                               cumulative-sensors)
+        new-calc-sensors (map #(calculated-sensor %) new-pulse-sensors)]
+    (vector cumulative-sensors pulse-sensors instant-sensors calc-sensors
+            new-pulse-sensors new-calc-sensors)))

 (defn create-default-sensors
   "Creates default sensors whenever new device is added: *_differenceSeries for CUMULATIVE,
    and *_co2 for kwh PULSE, etc."
   [body]
   (let [sensors        (:readings body)
-        new-sensors (if (and (have-sensor? sensors "CUMULATIVE")
-                             (not (have-sensor? sensors "PULSE")))
-                      (create-synth-sensors-new sensors)
-                      (create-synth-sensors-default sensors))]
+        new-sensors (create-synth-sensors sensors)]
     (update-in body [:readings] (fn [readings] (into [] (remove nil? (flatten new-sensors)))))))

 (defn index-post! [store ctx]


Add a handler for scrolling that loads images

--- src/cljs/comic_reader/handlers.cljs
+++ src/cljs/comic_reader/handlers.cljs
@@ -61,6 +61,21 @@
          get-next-image)))

   (rf/register-handler
+   :scroll
+   (fn [db _]
+     (if (= (:page db)
+            :read)
+       (let [scroll-y (.-scrollY js/window)
+             window-height (.-innerHeight js/window)
+             screen-bottom (+ scroll-y window-height)
+             document-height (.-clientHeight js/document)]
+         (if (> screen-bottom
+                (* 0.75 document-height))
+           (get-next-image db)
+           db))
+       db)))
+
+  (rf/register-handler
    :next-image
    (fn [db [_ img-tag]]
      (-> db


toLocaleFormat is a non-standard method which didn't work on android, toLocaleString is better

--- src/eatme/client/date_utils.cljs
+++ src/eatme/client/date_utils.cljs
@@ -1,7 +1,7 @@
 (ns eatme.date-utils)

 (defn humanise [timestamp]
-  (.toLocaleFormat (js/Date. timestamp)))
+  (.toLocaleString (js/Date. timestamp)))

 (defn friendly-age [timestamp]
   (let [seconds (/ (- (js/Date.) (js/Date. timestamp)) 1000)


update import rename

update import rename

--- util/clojure-cli/src/commcare_cli/form_player.clj
+++ util/clojure-cli/src/commcare_cli/form_player.clj
@@ -14,7 +14,7 @@
             FormEntrySessionReplayer FormEntrySessionReplayer$ReplayError]
            [org.javarosa.model.xform XFormSerializingVisitor]
            [org.javarosa.xpath XPathNodeset XPathParseTool]
-           [org.javarosa.xpath.expr XPathFuncExpr]
+           [org.javarosa.xpath.expr FunctionUtils]
            [org.javarosa.xpath.parser XPathSyntaxException]))

 (def debug-mode? (atom false))
@@ -116,8 +116,8 @@

 (defn print-result [value in-debug-mode? eval-ctx]
   (println (if (instance? XPathNodeset value)
-             (XPathFuncExpr/getSerializedNodeset (cast XPathNodeset value))
-             (XPathFuncExpr/toString value)))
+             (FunctionUtils/getSerializedNodeset (cast XPathNodeset value))
+             (FunctionUtils/toString value)))
   (when (and in-debug-mode? (not (nil? (.getEvaluationTrace eval-ctx))))
     (println (.serializeEvaluationLevels
                (StringEvaluationTraceSerializer.)


Add gray background to the X-axis ruler.

Signed-off-by: Sean Loughman <d7e19930cc1f42c2d0781f4d9e6f1fe5891bf9cf@studiospring.com.au>

--- frontend/src/uxbox/main/ui/workspace/rules.cljs
+++ frontend/src/uxbox/main/ui/workspace/rules.cljs
@@ -139,6 +139,9 @@
     [:svg.horizontal-rule
      {:width c/viewport-width
       :height 20}
+     [:rect {:height 20
+             :width c/viewport-width
+             :fill "rgb(233, 234, 235)"}]
      [:g {:transform (str "translate(" translate-x ", 0)")}
       (horizontal-rule-ticks zoom)]]))


We do, however, need to call init at some point.

--- gpu-compute/src/think/compute/cuda_driver.clj
+++ gpu-compute/src/think/compute/cuda_driver.clj
@@ -162,6 +162,7 @@
 (defn- local-create-context
   [device-id]
   (let [retval (cuda$CUctx_st.)]
+    (cuda-call (cuda/cuInit 0))
     (let [device-id (or device-id (first-valid-device))]
       (cuda-call (cuda/cuCtxCreate retval 0 device-id))
       retval)))


fixed typo in comment

fixed typo in comment

--- scheduler/src/cook/mesos/api.clj
+++ scheduler/src/cook/mesos/api.clj
@@ -48,7 +48,7 @@
   "A schema for a job"
   {:uuid (s/pred #(instance? UUID %) 'uuid?)
    :command s/Str
-   ;; Make sure the job name is a vaild string which can only contain '.', '_', '-' or any word characters and has
+   ;; Make sure the job name is a valid string which can only contain '.', '_', '-' or any word characters and has
    ;; length at most 128.
    :name (s/both s/Str (s/pred #(re-matches #"[\.a-zA-Z0-9_-]{0,128}" %) 'under-128-characters-and-alphanum?))
    :priority (s/both s/Int (s/pred #(<= 0 % 100) 'between-0-and-100))


rm unused dir

rm unused dir

--- test/pw/core_test.clj
+++ test/pw/core_test.clj
@@ -1,7 +0,0 @@
-(ns pw.core-test
-  (:require [clojure.test :refer :all]
-            [pw.core :refer :all]))
-
-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))


Report all schema errors at the end of the migration process (#710)

* Report all schema errors at the end of the migration process and return the -1 status code if an error occurs.

* Changes based on feedback

--- src/ctia/task/migrate_es_stores.clj
+++ src/ctia/task/migrate_es_stores.clj
@@ -257,6 +257,21 @@
                      (:type target-store)
                      checked-count))))))

+(defn check-store-index
+  [[sk sr :as store] batch-size]
+  (try
+    (log/infof "checking store: %s" sk)
+    (check-store sr batch-size)
+    (catch Exception e
+      (if-let [errors (some->> (ex-data e) :error (remove nil?))]
+        (let [message (format (str "The store %s is invalid, certainly a coercion issue "
+                                   "errors: %s")
+                              sk
+                              (pr-str errors))]
+          (log/error message)
+          message)
+        (throw e)))))
+
 (defn check-store-indexes
   "check all new es store indexes"
   [batch-size prefix]
@@ -268,18 +283,7 @@

     (log/infof "checking stores: %s" (keys current-stores))
     (log/infof "set batch size: %s" batch-size)
-
-    (doseq [[sk sr] target-stores]
-      (log/infof "checking store: %s" sk)
-      (try
-        (check-store sr batch-size)
-        (catch Exception e
-          (if-let [errors (some->> (ex-data e) :error (remove nil?))]
-            (log/errorf (str "The store %s is invalid, value cannot be coerced "
-                             "to match schema, errors: %s")
-                        sk
-                        (pr-str errors))
-            (log/errorf e "Invalid store %s" sr)))))))
+    (keep #(check-store-index % batch-size) target-stores)))

 (defn -main
   "invoke with lein run -m ctia.task.migrate-es-stores <prefix> <migrations> <batch-size> <confirm?>"
@@ -297,7 +301,10 @@
                              batch-size
                              confirm?)
       (when confirm?
-        (check-store-indexes batch-size prefix))
+        (when-let [errors (seq (check-store-indexes batch-size prefix))]
+          (log/errorf "Schema errors during migration: %s"
+                      (pr-str errors))
+          (System/exit -1)))
       (log/info "migration complete")
       (catch Exception e
         (log/error e "Unexpected error during migration")


Create a protocol for converting an attribute value (String, Number, or Keyword) to a string value

--- src/main/clojure/cascade/dom.clj
+++ src/main/clojure/cascade/dom.clj
@@ -61,21 +61,29 @@
     (if (= s out) s out)))

-(defmulti to-attr-string
+(defprotocol ToAttributeValueString
   "Converts an attribute value to a string. It is not necessary to apply quotes (those come at a later stage)."
-  class)
-
-(defmethod to-attr-string String
-  [str-value]
-  (encode-string str-value))
-
-(defmethod to-attr-string Number
-  [^Number numeric-value]
-  (.toString numeric-value))
-
-(defmethod to-attr-string Keyword
-  [kw]
-  (encode-string (name kw)))
+  (to-attribute-value-string [value]
+    "Converts the value to a string that can be safely streamed as an attribute value."))
+
+(extend String
+  ToAttributeValueString
+  {
+    :to-attribute-value-string encode-string
+    })
+
+(extend Number
+  ToAttributeValueString
+  {
+    :to-attribute-value-string (fn [num] (.toString num))
+    })
+
+(extend Keyword
+  ToAttributeValueString
+  {
+    :to-attribute-value-string (fn [kw] (encode-string (name kw)))
+    })
+

 (defn- write
   "Write a number of strings to the writer."
@@ -109,7 +117,7 @@
       (doseq [[attr-name attr-value] attributes]
         (if-not (nil? attr-value)
           (write out
-            " " (clojure.core/name attr-name) "=" attr-quote (to-attr-string attr-value) attr-quote)))
+            " " (clojure.core/name attr-name) "=" attr-quote (to-attribute-value-string attr-value) attr-quote)))

       (if (empty? content)
         ((strategy :write-empty-element-close) element-name out)


fix text

fix text

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -35,7 +35,7 @@
                              (:zf (:camera state)))})
       (maybe-add-selected layer selected-eids)
       (clj->js)
-      (dom/text)))
+      (dom/text (:layer/text layer))))

 (defmethod svg-element :layer.type/line
   [state selected-eids cast! layer]


CMR-6886: forced realization of lazy sequence in cleanup job.

--- metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj
+++ metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj
@@ -589,9 +589,9 @@
          stmt [sql (cr/to-sql-time tombstone-cut-off-date)]
          result (su/query conn stmt)]
      ;; create tuples of concept-id/revision-id to remove
-     (map (fn [{:keys [concept_id revision_id]}]
-            [concept_id revision_id])
-          result))))
+     (doall (map (fn [{:keys [concept_id revision_id]}]
+                   [concept_id revision_id])
+                 result)))))

 (defn get-old-concept-revisions
   [this provider concept-type max-revisions limit]


Fixing project URL.

Fixing project URL.


Update cljs version.

Update cljs version.


defscreen docs: Update docs to the new sections form

--- src/docs/workflo/macros/docs/screen.cljs
+++ src/docs/workflo/macros/docs/screen.cljs
@@ -22,21 +22,21 @@
   (url "users")
   (navigation
    {:title "Users"})
-  (layout
+  (sections
    {:content user-list}))

 (defscreen user
   (url "users/:user-id")
   (navigation
    {:title "User"})
-  (layout
+  (sections
    {:content user-profile}))

 (defscreen user-settings
   (url "users/:user-id/settings")
   (navigation
    {:title "User Settings"})
-  (layout
+  (sections
    {:content user-settings}))

 (defcard
@@ -47,21 +47,21 @@
      (url \"users\")
      (navigation
       (title \"Users\"))
-     (layout
+     (sections
       {:content user-list}))

    (defscreen user
      (url \"user\")
      (navigation
       (title \"User\"))
-     (layout
+     (sections
       {:content user-profile}))

    (defscreen user-settings
      (url \"users/:user-id/settings\")
      (navigation
       (title \"User Settings\"))
-     (layout
+     (sections
       {:content user-settings}))
    ```"
   (screen/registered-screens))


Delete job support in jenkins-api

Delete job support in jenkins-api

--- src/emender_jenkins/jenkins_api.clj
+++ src/emender_jenkins/jenkins_api.clj
@@ -89,3 +89,7 @@
     [jenkins-url jenkins-auth job-name]
     (job-related-command jenkins-url jenkins-auth job-name "disable"))

+(defn delete-job
+    [jenkins-url jenkins-auth job-name]
+    (job-related-command jenkins-url jenkins-auth job-name "doDelete"))
+


connect to amqp_url from fscrawler section

also pass around an options object, which currently contains the
amqp-url and the max-size parameter.

--- src/fscrawler_tika_convert/core.clj
+++ src/fscrawler_tika_convert/core.clj
@@ -105,10 +105,13 @@
     queue-name))

 (defn run-with-connection
-  [filesystem]
-  (let [conn       (rmq/connect)
-        ch         (lch/open conn)
-        queue-name (initialize-rabbitmq-structures ch "extract_content" "nextbot" filesystem)]
+  [filesystem options]
+  (let [rmq-settings (rmq/settings-from (:amqp-url options))
+        conn         (do
+                       (logging/info "connecting to rabbitmq" (:amqp-url options) rmq-settings)
+                       (rmq/connect rmq-settings))
+        ch           (lch/open conn)
+        queue-name   (initialize-rabbitmq-structures ch "extract_content" "nextbot" filesystem)]

     ;; (lq/declare ch queue-name :exclusive false :auto-delete true)
     ;; (lq/bind    ch queue-name "nextbot")
@@ -162,10 +165,10 @@

 (defn handle-command-for-filesystem
-  [filesystem]
+  [filesystem options]
   (while true
     (try
-      (run-with-connection filesystem)
+      (run-with-connection filesystem options)
       (catch Exception err
         (logging/error "got exception" err)
         (trace/print-stack-trace err)
@@ -203,7 +206,8 @@
         section (or (config inisection)
                     (die (str "section " inisection " missing in " iniconfig)))
         fscrawler-section (or (config "fscrawler") {})
-        max-size (Integer. (fscrawler-section "max_size"))
+        options {:max-size (Integer. (fscrawler-section "max_size")),
+                 :amqp-url (get fscrawler-section "amqp_url" "amqp://localhost/%2f")}
         filesystems (trimmed-lines-from-string (section "filesystems"))]
     (when (zero? (count filesystems))
       (die (str "no filesystems defined in section " inisection " in " iniconfig)))
@@ -211,7 +215,7 @@
     (reap/start-watching-futures!)

     (doseq [filesystem filesystems]
-      (reap/register-future! (future (handle-command-for-filesystem filesystem))
+      (reap/register-future! (future (handle-command-for-filesystem filesystem options))
                              die-on-exit-or-error die-on-exit-or-error)))


fundamental.clj: implemented fundamental group

--- clojure/org/gavrog/clojure/fundamental.clj
+++ clojure/org/gavrog/clojure/fundamental.clj
@@ -59,20 +59,20 @@
   "Returns the list of inner edges for a fundamental domain."
   (second (glue-recursively ds (initial-boundary ds) (initial-todo ds))))

-(defn- trace-word [ds edge2word D i j]
+(defn- trace-word [ds edge2word i j D]
   (loop [w [], E (s ds i D), k j]
-    (if (= [E k] [D i])
-      w
-      (let [f (or (edge2word [E k]) (inverse (edge2word [(s ds k E) k])) [])]
+    (let [f (or (edge2word [E k]) (inverse (edge2word [(s ds k E) k])) [])]
+      (if (= [E k] [D i])
+        (-* w f)
         (recur (-* w f) (s ds k E) (other i j k))))))

 (defn- glue-generator [ds [_ opposite :as boundary] edge2word gen2edge D i]
-  (let [gen (count gen2edge)
+  (let [gen (inc (count gen2edge))
         gen2edge (conj gen2edge [gen [D i]])
         [boundary glued] (glue-recursively ds boundary [[D i nil]])
         edge2word (reduce (fn [e2w [D i j]]
                             (conj e2w
-                                  [[D i] (inverse (trace-word ds e2w D i j))]))
+                                  [[D i] (inverse (trace-word ds e2w i j D))]))
                           (conj edge2word [[D i] [gen]])
                           (rest glued))]
     [boundary edge2word gen2edge]))
@@ -97,5 +97,25 @@
     [(add-inverses ds e2w) g2e]))

 (defn fundamental-group [ds]
-  (let [[edge2word, gen2edge] (find-generators ds)]
-    ))
+  (let [[edge2word, gen2edge] (find-generators ds)
+        orbits (for [i (indices ds), j (indices ds), :when (> j i)
+                     D (orbit-reps ds [i j])
+                     :let [w (trace-word ds edge2word i j D)]
+                     :when (seq w)]
+                 [D i j w (v ds i j D)])]
+    {:generators (keys gen2edge)
+     :relators (for [[D i j w v] orbits] (-** w v))
+     :axes (for [[D i j w v] orbits, :when (> v 1)] [w v])
+     :gen-to-edge gen2edge
+     :edge-to-word edge2word
+     }))
+
+(comment
+  A test symbol.
+
+(def ds (dsymbol
+          (str "24:2 4 6 8 10 12 14 16 18 20 22 24,"
+               "16 3 5 7 9 11 13 15 24 19 21 23,"
+               "10 9 18 17 14 13 20 19 22 21 24 23:"
+               "8 4,3 3 3 3")))
+)


Remove icon from button

Remove icon from button

--- src-cljs/frontend/components/pages/team.cljs
+++ src-cljs/frontend/components/pages/team.cljs
@@ -222,8 +222,7 @@
                                                                                :org-name (:name selected-org)}])
                                                                                (close-fn))
                                                                        :disabled (= 0 count-selected)}
-                                              (invite-button-text count-selected)
-                                              [:i.fa.fa-envelope-o]])]
+                                              (invite-button-text count-selected)])]
                                   :close-fn close-fn})))])))))

 (defn- main-content [app owner]


Log retry messages to help track down test issue.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -178,11 +178,12 @@
   (doseq [result results]
     (when (seq (filter (fn [leaf] (= :retry (:action (:routes leaf)))) (:leaves result)))
       (let [link (operation/peer-link event (:completion-id (:root result)))]
+        (taoensso.timbre/info (format "Sending retry message: " (:id (:root result))))
         (extensions/internal-retry-message
-         (:onyx.core/messenger event)
-         event
-         (:id (:root result))
-         link))))
+          (:onyx.core/messenger event)
+          event
+          (:id (:root result))
+          link))))
   event)

 (defn inject-batch-resources [event]