Separated out assign positions into own func.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -138,6 +138,16 @@
   ; (swap! positions (fn [x] (merge {id (count x)} x)))
   (swap! positions #(update-in % [id] (fn [v] (if v v (count %))))))

+(defn assign-positions [vis actx positions actx-ch-ch-infos parent-closed]
+  (let [actx-id (last actx)
+        actx-info (get-in vis [:actxs actx])]
+    (assign-position positions actx-id)
+    (doseq [[ch ch-info] (get actx-ch-ch-infos actx)]
+      (assign-position positions (:id ch-info)))
+    (doseq [child-actx (sort #(compare (last %1) (last %2))
+                             (keys (:children actx-info)))]
+      (assign-positions vis child-actx positions
+                        actx-ch-ch-infos (:closed actx-info)))))
 ;; ------------------------------------------------

 (defn vis-html-ch [vis ch]
@@ -158,11 +168,10 @@
                                           "]"]
              :default [name " " (if val val "nil")]))))

-(defn vis-html-actx [vis actx positions actx-ch-ch-infos]
+(defn vis-html-actx [vis actx actx-ch-ch-infos parent-closed]
   (let [actx-id (last actx)
         actx-info (get-in vis [:actxs actx])
         children (:children actx-info)]
-    (assign-position positions actx-id)
     ["
"
      "<button class='toggle' id='toggle-" actx-id "'>"
      (if (:closed actx-info) "▶" "▼")
@@ -173,12 +182,12 @@
      (mapv (fn [ch-ch-info]
              (let [ch-info (second ch-ch-info)
                    ch-id (:id ch-info)]
-               (assign-position positions ch-id)
                ["
" ch-id ": " (:msgs ch-info) "
"]))
            (get actx-ch-ch-infos actx))
      "

"
      ["
" (mapv (fn [child-actx]
-                     ["
" (vis-html-actx vis child-actx positions actx-ch-ch-infos)
+                     ["
" (vis-html-actx vis child-actx
+                                            actx-ch-ch-infos (:closed actx-info))
                       "
"])
                    (sort #(compare (last %1) (last %2)) (keys children)))
       "
"]
@@ -298,9 +307,10 @@
                                                                deltas :prev))))
           (when (> @event-delay 0) (<! (timeout @event-delay)))
           (when (< @event-delay 0) (<! step-ch)))
+        (assign-positions @vis @root-actx vis-positions actx-ch-ch-infos false)
         (set-el-innerHTML (str el-prefix "-html")
-                          (apply str (flatten (vis-html-actx @vis @root-actx vis-positions
-                                                             actx-ch-ch-infos))))
+                          (apply str (flatten (vis-html-actx @vis @root-actx
+                                                             actx-ch-ch-infos false))))
         (set-el-innerHTML (str el-prefix "-svg")
                           (apply str (flatten (vis-svg-actxs @vis @vis-positions
                                                              deltas :curr))))


More work on download supervisor.

More work on download supervisor.

--- src/clj/elephantdb/loader.clj
+++ src/clj/elephantdb/loader.clj
@@ -89,7 +89,8 @@

 (defn supervise-downloads [amount-shards max-kbs interval-ms ^DownloadState state]
   (let [shard-states (:shard-states state)
-        finished-loaders (:finished-loaders state)]
+        finished-loaders (:finished-loaders state)
+        max-kbs-per-shard (/ max-kbs amount-shards)]
     (loop []
       (when (< @finished-loaders amount-shards)
         (log-message "Download supervisor - "
@@ -100,12 +101,13 @@
                 do-download (:do-download s)
                 sleep-interval (:sleep-interval s)]
             (Thread/sleep interval-ms)
-            (let [dl-kb @downloaded-kb]
-              (if (>= dl-kb max-kbs)
+            (let [dl-kb @downloaded-kb
+                  sleep-ms (rand 1000)] ;; sleep random amount of time up to 1s
+              (if (>= dl-kb max-kbs-per-shard)
                 (do
-                  (log-message "Download throttle exceeded: " dl-kb " (" max-kbs " allowed) - Waiting for: " interval-ms "ms")
+                  (log-message "Download throttle exceeded: " dl-kb " (" max-kbs-per-shard " allowed) - Waiting for: " sleep-ms "ms")
                   (reset! do-download false)
-                  (reset! sleep-interval (rand 1000)) ;; sleep random amount of time up to 1s
+                  (reset! sleep-interval sleep-ms)
                   (reset! downloaded-kb 0))
                 (do
                   (reset! do-download true)


implement Corporate Scandal

implement Corporate Scandal

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -89,6 +89,11 @@
                            :choices (req (filter #(is-type? % "Program") (:deck runner)))
                            :effect (effect (install-cost-bonus [:credit (* -3 (count (get-in corp [:servers :rd :ices])))])
                                            (runner-install target) (tag-runner 1) (shuffle! :deck))}} card))}
+
+   "Corporate Scandal"
+   {:msg "give the Corp 1 additional bad publicity"
+    :effect (req (swap! state update-in [:corp :has-bad-pub] inc))
+    :leave-play (req (swap! state update-in [:corp :has-bad-pub] dec))}

    "Cyber Threat"
    {:prompt "Choose a server" :choices (req runnable-servers)


implement Windfall

implement Windfall

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -497,4 +497,17 @@
                         :choices (req (map str (range 1 (inc (:click runner)))))
                         :effect (req (let [n (Integer/parseInt target)]
                                        (when (pay state :runner card :click n)
-                                         (trash-cards state :corp (take n (shuffle (:hand corp)))))))}} card))}})
+                                         (trash-cards state :corp (take n (shuffle (:hand corp)))))))}} card))}
+
+   "Windfall"
+   {:effect (req (shuffle! state :runner :deck)
+                 (let [topcard (first (:deck runner))
+				               cost (:cost topcard)]
+				           (if (= (:type topcard) "Event")
+				             (do (trash state side topcard)
+					               (system-msg state side (str "shuffles their Stack and trashes "
+                          (:title topcard) " to gain 0 [Credits]")))
+                     (do (gain state side :credit cost)
+					               (trash state side topcard)
+					               (system-msg state side (str "shuffles their Stack and trashes "
+                          (:title topcard) " to gain " cost " [Credits]"))))))}})


Don't eval if instarepl isn't enabled

Don't eval if instarepl isn't enabled

--- src/clj/nightcode/editors.clj
+++ src/clj/nightcode/editors.clj
@@ -120,7 +120,10 @@
                        (catch Exception e (.printStackTrace e))))
                    (onenter [this text])
                    (oneval [this code]
-                     (when eval-fn
+                     (when (and eval-fn
+                                (-> pane
+                                    (.lookup "#instarepl")
+                                    .isSelected))
                        (try
                          (eval-fn code)
                          (catch Exception e (.printStackTrace e))))))]


Let npcs step on wall dart triggers

Let npcs step on wall dart triggers

--- src/cljc/robinson/update.cljc
+++ src/cljc/robinson/update.cljc
@@ -2671,7 +2671,8 @@
                                                          ;; ruined temple
                                                          :moss-corridor
                                                          :white-corridor
-                                                         :crushing-wall-trigger}
+                                                         :crushing-wall-trigger
+                                                         :wall-darts-trigger}
                                                        (get-type x y)))))
           traversable?           (cond
                                    (and npc-can-move-in-water


Update Hello World Message

Update Hello World Message

--- src/cljs/babelfeesh/core.cljs
+++ src/cljs/babelfeesh/core.cljs
@@ -4,7 +4,7 @@

 (enable-console-print!)

-(defonce app-state (atom {:text "Hello Babelfeesh!! Woooo! Again!"}))
+(defonce app-state (atom {:text "Hello Babelfeesh!!"}))

 (defn main []
   (om/root


expand data model

expand data model

--- src/cljs/takarabako/core.cljs
+++ src/cljs/takarabako/core.cljs
@@ -21,8 +21,17 @@

 (enable-console-print!)

+
+                                        ; HELPERS
+
 (defn pprint [s & args]
   (.log js/console (apply pr-str s args)))
+
+
+(defn target-val [e]
+  (.. e -target -value))
+
+                                        ; REPLIKATIV

 (def stream-eval-fns
   {'assoc (fn [a new]
@@ -54,7 +63,9 @@
              :stream stream
              :peer local-peer})))

+
 (declare client-state)
+

 (defn add-transaction! [app-state tx]
   (s/assoc! (:stage client-state)
@@ -62,11 +73,21 @@
             (uuid tx)
             [['assoc tx]]))

-(defn target-val [e]
-  (.. e -target -value))
+                                        ; QUERIES

-(def reconciler
-  (om/reconciler {:state val-atom}))
+(defmulti read (fn [env key params] key))
+
+(defmethod read :default
+  [{:keys [state] :as env} key params]
+  (let [st @state]
+    (if-let [[_ value] (find st key)]
+      {:value value}
+      {:value :not-found})))
+
+
+
+
+                                        ; VIEWS

 (defn input-widget [component placeholder local-key type]
   [:input {:value (get (om/get-state component) local-key)
@@ -75,6 +96,7 @@
            :on-change (fn [e]
                         (om/update-state! component assoc local-key (target-val e)))}])

+
 (defn transactions-widget [transactions]
   [:div
    [:h3 "Transactions"]
@@ -82,46 +104,80 @@
     [:tr
      [:th "Description"]
      [:th "Date"]
+     [:th "Type"]
      [:th "Value"]]
     (mapv
-     (fn [{:keys [description value date] :as tx}]
+     (fn [{:keys [description value type date] :as tx}]
        [:tr {:key (uuid tx)}
         [:td description]
         [:td (str (js/Date. date))]
+        [:td (str type)]
         [:td value]])
      (sort-by :date > transactions))]])
+
+
+(defn transaction-add-button [component]
+  (let [app-state (om/props component)
+        {:keys [input-description input-value input-date input-type-toggle]} (om/get-state component)]
+      [:button
+       {:on-click (fn [e]
+                    (do
+                      (add-transaction!
+                       app-state
+                       {:description input-description
+                        :created (.getTime (js/Date.))
+                        :date (.getTime input-date)
+                        :type (if input-type-toggle :expense :income)
+                        :value input-value})
+                      (om/update-state! component assoc :input-value nil)
+                      (om/update-state! component assoc :input-date nil)
+                      (om/update-state! component assoc :input-type-toggle true)
+                      (om/update-state! component assoc :input-description "")))}
+       "Add"]))
+
+
+(defn type-toggle-widget [component]
+  (let [toggle-state (:input-type-toggle (om/get-state component))]
+    [:label.switch
+     [:input {:type "checkbox"
+              :checked toggle-state
+              :on-click (fn [_] (om/update-state! component update :input-type-toggle not))}]
+     (if toggle-state "Expense" "Income")]))
+

 (defui App
   Object
   (componentWillMount [this]
-    (om/set-state! this {:input-description "" :input-value nil}))
+    (om/set-state! this {:input-description ""
+                         :input-type-toggle true
+                         :input-date nil
+                         :input-value nil}))
   (render [this]
-    (let [app-state (om/props this)
-          {:keys [input-description input-value]} (om/get-state this)]
+    (let [app-state (om/props this)]
       (html
        [:div
-        [:h3 "New Transaction"]
-        (input-widget this "Description" :input-description :text)
-        (input-widget this "Value" :input-value :number)
-        [:button
-         {:on-click (fn [e]
-                      (do
-                        (add-transaction!
-                         app-state
-                         {:description input-description
-                          :date (.getTime (js/Date.))
-                          :value input-value})
-                        (om/update-state! this assoc :input-value nil)
-                        (om/update-state! this assoc :input-description "")))}
-         "Add"]
+        [:div
+         [:h3 "New Transaction"]
+         (input-widget this "Description" :input-description :text)
+         (input-widget this "Value" :input-value :number)
+         (input-widget this "Date" :input-date :time)
+         (type-toggle-widget this)
+         (transaction-add-button this)]
         (transactions-widget (vals (:transactions app-state)))]))))
+

 (defn main [& args]
   (go-try S
           (def client-state (<? S (setup-replikativ)))
           (.error js/console "INITIATED")))

+
+(def reconciler
+  (om/reconciler {:state val-atom}))
+
+
 (om/add-root! reconciler App (.getElementById js/document "app"))
+

 (comment


Fix test

Fix test

--- test/meins/store_test.clj
+++ test/meins/store_test.clj
@@ -115,7 +115,7 @@
             "handler emits saved message"
             (let [entry-saved-msg (first emit-msg)
                   saved-msg (second entry-saved-msg)]
-              (is (= [:cmd/schedule-new
+              (is (= [:schedule/new
                       {:id      :generate-opts
                        :message [:options/gen]
                        :timeout 5000}]
@@ -197,7 +197,7 @@
             "handler emits updated message"
             (let [entry-saved-msg (first emit-msg)
                   saved-msg (second entry-saved-msg)]
-              (is (= [:cmd/schedule-new
+              (is (= [:schedule/new
                       {:id      :generate-opts
                        :message [:options/gen]
                        :timeout 5000}]


massaged ugen specs. updated ugene_definition.mdml. deleted extra ops.clj, where did that come from?

--- src/overtone/core/ugens/ops.clj
+++ src/overtone/core/ugens/ops.clj
@@ -1,93 +0,0 @@
-(ns overtone.ops)
-
-(def UNARY-OPS
-  {"neg" 0
-   "bitNot" 4
-   "abs" 5
-   "asFloat" 6
-   "ceil" 8
-   "floor" 9
-   "frac" 10
-   "sign" 11
-   "squared" 12
-   "cubed" 13
-   "sqrt" 14
-   "exp" 15
-   "reciprocal" 16
-   "midicps" 17
-   "cpsmidi" 18
-   "midiratio" 19
-   "ratiomidi" 20
-   "dbamp" 21
-   "ampdb" 22
-   "octcps" 23
-   "cpsoct" 24
-   "log" 25
-   "log2" 26
-   "log10" 27
-   "sin" 28
-   "cos" 29
-   "tam" 30
-   "asin" 31
-   "acos" 32
-   "atan" 33
-   "sinh" 34
-   "cosh" 35
-   "tanh" 36
-   "rand" 37
-   "rand2" 38
-   "linrand" 39
-   "bilinrand" 40
-   "sum3rand" 41
-   "distort" 42
-   "softclip" 43
-   "coin" 44
-   "rectWindow" 48
-   "hanWindow" 49
-   "welWindow" 50
-   "triWindow" 51
-   "ramp" 52
-   "scurve" 53})
-
-(def BINARY-OPS
-  (apply hash-map ["+" 0
-   "-" 1
-   "*" 2
-   "div" 3
-   "/" 4
-   "mod" 5
-   "<=" 10
-   ">=" 11
-   "minimum" 12
-   "maximum" 13
-   "lcm" 17
-   "gcd" 18
-   "round" 19
-   "roundUp" 20
-   "trunc" 21
-   "atan2" 22
-   "hypot" 23
-   "hypotApx" 24
-   "pow" 25
-   "leftShift" 26
-   "rightShift" 27
-   "unsignedRightShift" 28
-   "ring1" 30
-   "ring2" 31
-   "ring3" 32
-   "ring4" 33
-   "difsqr" 34
-   "sumsqr" 35
-   "sqrsum" 36
-   "sqrdif" 37
-   "absdif" 38
-   "thresh" 39
-   "amclip" 40
-   "scaleneg" 41
-   "clip2" 42
-   "excess" 43
-   "fold2" 44
-   "wrap2" 45
-   "rrand" 47
-   "exprand" 48]))
-


Using goog.object to get and set mapbox props

--- src/pasmo_gigi/geo/ui/core.cljs
+++ src/pasmo_gigi/geo/ui/core.cljs
@@ -3,6 +3,7 @@
             [cljs.core.async :refer [<!]]
             [reagent.core :as reagent]
             [re-frame.core :as re-frame]
+            [goog.object :as gob]
             [pasmo-gigi.geo.ui.navigation.nav-handlers]
             [pasmo-gigi.geo.ui.navigation.nav-subscriptions]
             [pasmo-gigi.geo.ui.navigation.nav-views :as nav-views]
@@ -13,15 +14,15 @@

 (defn setup-mapbox [mapbox-api]
-
   (.log js/console "mapbox api: " mapbox-api)
-
-  (let [mapbox (.-mapbox mapbox-api)]
+  (let [mapbox (gob/get mapbox-api "mapbox")]
     (.log js/console "mapbox prop from api: " mapbox)
     (set! (.-accessToken mapbox) "pk.eyJ1IjoidXJpczc3IiwiYSI6InRuYTZRa3MifQ._Bo-JRcA7QVGocCJvdSoJg")
+    (gob/set mapbox "accessToken" "pk.eyJ1IjoidXJpczc3IiwiYSI6InRuYTZRa3MifQ._Bo-JRcA7QVGocCJvdSoJg")
     (swap! db/settings assoc :mapbox-api mapbox-api))

-  (.log js/console "set: " (.-accessToken (.-mapbox (:mapbox-api @db/settings)))))
+  (.log js/console "set: " (.-accessToken (.-mapbox (:mapbox-api @db/settings))))
+  (:mapbox-api @db/settings))

 (defn mount-root
   []


Cleanup

Cleanup


Added new test for the main function

Added new test for the main function

--- test/zg/core_test.clj
+++ test/zg/core_test.clj
@@ -132,3 +132,10 @@
             (is (= {:port 65537}   (start-server "65537")))
             (is (= {:port 1000000} (start-server "1000000"))))))

+(deftest test-main-1
+    "Check the function zg.core/main."
+    (testing "the function zg.core/main.")
+        ; use mock instead of jetty/run-jetty
+        (with-redefs [jetty/run-jetty (fn [app port] port)]
+            (is (= {:port 3000} (-main)))))
+


Bump version

Bump version

--- frontend/project.clj
+++ frontend/project.clj
@@ -1,4 +1,4 @@
-(defproject cruncher "0.1.0-SNAPSHOT"
+(defproject cruncher "0.2.1"
   :description "FIXME: write this!"
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"


ARM: Kirkwood: fix Makefile.boot

ARM: Kirkwood: fix Makefile.boot

While building the dtbs target, one is getting:

make dtbs
make[1]: *** No rule to make target `arch/arm/boot/kirkwood-qnap-ts219.dtb', needed by `arch/arm/boot/dtbs'.  Stop.
make: *** [dtbs] Error 2

The reason is that there's no kirkwood-qnap-ts219.dts file. Update Makefile.boot
to reflect the dts files present.

Signed-off-by: Arnaud Patard <792745173c1ee81f4d7d786155d4c148b6e57204@rtp-net.org>
Acked-by: Andrew Lunn <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@lunn.ch>
Signed-off-by: Jason Cooper <68c46a606457643eab92053c1c05574abb26f861@lakedaemon.net>

--- arch/arm/mach-kirkwood/Makefile.boot
+++ arch/arm/mach-kirkwood/Makefile.boot
@@ -7,7 +7,8 @@
 dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
 dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
 dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
-dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-qnap-ts219.dtb
+dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-ts219-6281.dtb
+dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-ts219-6282.dtb
 dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
 dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
 dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb


ARM: mach-shmobile: Add compilation support for dtbs using 'make dtbs'

Add compilation support for dtbs using 'make dtbs'

Cc: Nobuhiro Iwamatsu <2b8440e189956f325e301c8d8c76bd30356b2f9f@renesas.com>
Cc: Kuninori Morimoto <a3b51ccb87d18302c1692defcfbf83319d1737eb@renesas.com>
Cc: Simon Horman <a105fd58f578dea0be108941d4c59d15396e1855@verge.net.au>
Signed-off-by: Tetsuyuki Kobayashi <f11af612650f474cce319970f68085816c4c9a70@kmckk.co.jp>
Signed-off-by: Simon Horman <a105fd58f578dea0be108941d4c59d15396e1855@verge.net.au>

--- arch/arm/mach-shmobile/Makefile.boot
+++ arch/arm/mach-shmobile/Makefile.boot
@@ -7,3 +7,7 @@
 #
 #params_phys-y (Instead: Pass atags pointer in r2)
 #initrd_phys-y (Instead: Use compiled-in initramfs)
+
+dtb-$(CONFIG_MACH_KZM9G) += sh73a0-kzm9g.dtb
+dtb-$(CONFIG_MACH_KZM9D) += emev2-kzm9d.dtb
+dtb-$(CONFIG_MACH_ARMADILLO800EVA) += r8a7740-armadillo800eva.dtb


Need to add the refname field for new mapfiles to accommodate multi-tnseq

--- services/bowtie1-make-maps.clj
+++ services/bowtie1-make-maps.clj
@@ -30,6 +30,7 @@
                           "\t"
                           [(-> (rec 0) (str/split #"-") second)
                            (rec 1)
+                           (rec 2)
                            (rec 3)
                            (count (rec 4))])]
                    (.write ot l)


Update lein variants to 2.9.10

Update lein variants to 2.9.10

--- src/docker_clojure/config.clj
+++ src/docker_clojure/config.clj
@@ -51,7 +51,7 @@
 (def distros
   "Map of base image name to set of distro tags to use, namespaced by Linux
   distro type. :default key is a fallback for base images not o/w specified."
-  {:default  #{:alpine/alpine :ubuntu/focal :ubuntu/jammy}})
+  {:default #{:alpine/alpine :ubuntu/focal :ubuntu/jammy}})

 (def default-architectures
   #{"amd64" "arm64v8"})
@@ -67,16 +67,14 @@
   {:default :ubuntu/jammy})

 (def build-tools
-  {"lein"       "2.9.8"
+  {"lein"       "2.9.10"
    "boot"       "2.8.3"
    "tools-deps" "1.11.1.1149"})

 (def default-build-tool "tools-deps")

 (def installer-hashes
-  {"lein"       {"2.9.6" "094b58e2b13b42156aaf7d443ed5f6665aee27529d9512f8d7282baa3cc01429"
-                 "2.9.7" "f78f20d1931f028270e77bc0f0c00a5a0efa4ecb7a5676304a34ae4f469e281d"
-                 "2.9.8" "9952cba539cc6454c3b7385ebce57577087bf2b9001c3ab5c55d668d0aeff6e9"}
+  {"lein"       {"2.9.10" "dbb84d13d6df5b85bbf7f89a39daeed103133c24a4686d037fe6bd65e38e7f32"}
    "boot"       {"2.8.3" "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3"}
    "tools-deps" {"1.11.1.1113" "7677bb1179ebb15ebf954a87bd1078f1c547673d946dadafd23ece8cd61f5a9f"
                  "1.11.1.1124" "9c7d226ae1c08b6dbb7f10c9ca1ab8c80f8d5021b6a1e535b5dd92ba3ff062db"


Improve tailing

Improve tailing

--- test/com/nomistech/clojure_the_language/c_920_io/tailing.clj
+++ test/com/nomistech/clojure_the_language/c_920_io/tailing.clj
@@ -56,23 +56,47 @@

 (fact (let [delay-ms        100
             sleep-ms        (+ delay-ms 10)
-            lines-s         [["I met" "her in" "a" "pool" "room"]
-                             ["Her" " name" "I" "didn't" "catch"]
-                             ["She" "looked" " like" "something" "special"]]
+            lines-s         [["I met her in a pool room"
+                              "Her name I didn't catch"
+                              "She looked like something special"
+                              "The kind who'd understand"
+                              "The room was almost spinning"]
+                             ["She pulled another smile"
+                              "She had the grace like pleasure"
+                              "She had a certain style"
+                              "Sunlight on the lino"
+                              "Woke me with a shake"]
+                             ["I looked around to find her"
+                              "But she'd gone"
+                              "Goodbye girl"
+                              "Goodbye girl"
+                              "Goodbye girl"]]
             f               (let [f (File. "test/_work-dir/plop.log")]
                               ;; Setting up some initial content makes things
                               ;; work as I expect; without this my first line
                               ;; is lost.
                               ;; jsk-2016-10-29
-                              (spit f "this will be ignored\n")
+                              (spit f "this will be ignored this will be ignored this will be ignored this will be ignored\n")
                               f)
             t-and-c         (tailer-and-channel f delay-ms)
             result-ch       (a/thread (doall (tailer-and-channel->seq t-and-c)))]
         (spit-lines-s f lines-s sleep-ms)
         (stop-tailer-and-channel t-and-c)
         (a/<!! result-ch)
-        => ["I met" "her in" "a" "pool" "room"
-            "Her" " name" "I" "didn't" "catch"
-            "She" "looked" " like" "something" "special"]))
+        => ["I met her in a pool room"
+            "Her name I didn't catch"
+            "She looked like something special"
+            "The kind who'd understand"
+            "The room was almost spinning"
+            "She pulled another smile"
+            "She had the grace like pleasure"
+            "She had a certain style"
+            "Sunlight on the lino"
+            "Woke me with a shake"
+            "I looked around to find her"
+            "But she'd gone"
+            "Goodbye girl"
+            "Goodbye girl"
+            "Goodbye girl"]))

 ;; TODO Check that bug: https://issues.apache.org/jira/browse/IO-399


(SERVER-303) Fix version-check-test

(SERVER-303) Fix version-check-test

Fix an issue wherein the version-check-test would fail on Travis,
as the test was not using a test-dir and so the master was trying
to create files in a directory that did not exist.

--- test/unit/puppetlabs/services/master/master_service_test.clj
+++ test/unit/puppetlabs/services/master/master_service_test.clj
@@ -78,37 +78,43 @@
     (let [version-check-params  (atom {})
           version-check-test-fn (fn [request-values update-server-url]
                                   (swap! version-check-params #(assoc % :request-values request-values
-                                                                        :update-server-url update-server-url)))]
-      (with-redefs
-        [version-check/check-for-updates! version-check-test-fn
-         ; Redefine the CA functions to ensure that the master does not create
-         ; any SSL files
-         ca/retrieve-ca-cert! (fn [_ _])
-         ca/retrieve-ca-crl! (fn [_ _])
-         ca/initialize-master-ssl! (fn [_ _ _])]
-        (logutils/with-test-logging
-          (tk-testutils/with-app-with-config
-            app
+                                                                        :update-server-url update-server-url)))
+          test-dir (doto "target/master-service-test" fs/mkdir)]
+      (try
+        (with-redefs
+          [version-check/check-for-updates! version-check-test-fn
+           ; Redefine the CA functions to ensure that the master does not create
+           ; any SSL files
+           ca/retrieve-ca-cert! (fn [_ _])
+           ca/retrieve-ca-crl! (fn [_ _])
+           ca/initialize-master-ssl! (fn [_ _ _])]
+          (logutils/with-test-logging
+            (tk-testutils/with-app-with-config
+              app

-            [master-service
-             puppet-server-config-service
-             jruby/jruby-puppet-pooled-service
-             jetty9-service
-             webrouting-service
-             request-handler-service
-             profiler/puppet-profiler-service
-             certificate-authority-service]
+              [master-service
+               puppet-server-config-service
+               jruby/jruby-puppet-pooled-service
+               jetty9-service
+               webrouting-service
+               request-handler-service
+               profiler/puppet-profiler-service
+               certificate-authority-service]

-            (-> (jruby-testutils/jruby-puppet-tk-config
-                  (jruby-testutils/jruby-puppet-config {:max-active-instances 1}))
-                (assoc :webserver {:port 8081})
-                (assoc :web-router-service
-                       {:puppetlabs.services.ca.certificate-authority-service/certificate-authority-service ""
-                        :puppetlabs.services.master.master-service/master-service                           {:master-routes       "/puppet"
-                                                                                :invalid-in-puppet-4 "/"}})
-                (assoc :product {:update-server-url "http://notarealurl/"
-                                 :name              {:group-id    "puppets"
-                                                     :artifact-id "yoda"}}))
-            (is (= {:group-id "puppets" :artifact-id "yoda"}
-                   (get-in @version-check-params [:request-values :product-name])))
-            (is (= "http://notarealurl/" (:update-server-url @version-check-params)))))))))
+              (-> (jruby-testutils/jruby-puppet-tk-config
+                    (jruby-testutils/jruby-puppet-config {:max-active-instances 1}))
+                  (assoc-in [:jruby-puppet :master-conf-dir]
+                            "dev-resources/puppetlabs/services/master/master_service_test/conf")
+                  (assoc :webserver {:port 8081})
+                  (assoc :web-router-service
+                         {:puppetlabs.services.ca.certificate-authority-service/certificate-authority-service ""
+                          :puppetlabs.services.master.master-service/master-service                           {:master-routes       "/puppet"
+                                                                                :invalid-in-puppet-4 "/"}})
+                  (assoc :product {:update-server-url "http://notarealurl/"
+                                   :name              {:group-id    "puppets"
+                                                       :artifact-id "yoda"}}))
+              (is (= {:group-id "puppets" :artifact-id "yoda"}
+                     (get-in @version-check-params [:request-values :product-name])))
+              (is (= "http://notarealurl/" (:update-server-url @version-check-params))))))
+        (finally
+          (fs/delete-dir test-dir))))))


Improve messaging a little

Improve messaging a little

--- src/foreclojure/solutions.clj
+++ src/foreclojure/solutions.clj
@@ -22,7 +22,7 @@
            (cond (seq scores) (str "Scored " (first (vals scores))
                                    ", before 4clojure started storing solutions."),

-                 (some #{problem-id} solved) "Solved before 4clojure started scoring solutions")))))
+                 (some #{problem-id} solved) "Solved before 4clojure started saving solutions")))))

 (defn save-solution [user-id problem-id code]
   (update! :solutions


refactor up play-it fn

refactor up play-it fn

--- src/functional_music/repl.clj
+++ src/functional_music/repl.clj
@@ -27,7 +27,7 @@

 ;; other synths to try
 (comment
-  (synth/daf-bass)
+  (synth/daf-bass) ;; WARNING it's loud!
   (synth/buzz)
   (synth/cs80lead)
   (synth/ticker)
@@ -39,47 +39,46 @@

   (stop))

-;; now let's play a little melody
 ;; NOTE: this fn is a hack and needs tidying up
+(defn play-it
+  "play-it plays notes recursively"
+  ([interval instrument values]
+   (play-it (now) interval instrument values 0))
+  ([time interval instrument values counter]
+   (when (= (mod counter 4) 0)
+     (ctl instrument :gate 0))
+   (if-not (empty? values)
+     (let [value (first values)
+           next-time (+ time interval)]
+       (when value
+         (at time (instrument value)))
+       (apply-at next-time
+                 play-it [next-time interval instrument (rest values) (inc counter)])))))
+
 (comment
+  ;; now let's play a little melody
   (let [beat-ms      250
         base-line    [:D3 :A2 :A#2 :C3
                       :D3 :F3 :G3 :C4
                       :D4 :A3 :F3 :C3
                       :D3 :F2 :G2 :A#2]
         num-measures (count base-line)]
+    ;; baseline plays once per 4 notes
+    (play-it (* 4 beat-ms)
+             synth/vintage-bass
+             ;; cycle the base line forever (but in reality, just for
+             ;; `num-measures` times)
+             (take num-measures (cycle (map note base-line))))

-    ;; first, define a recursive note player
-    (letfn [(play-it
-              ([interval instrument values]
-               (play-it (now) interval instrument values 0))
-              ([time interval instrument values counter]
-               (when (= (mod counter 4) 0)
-                 (ctl instrument :gate 0))
-               (if-not (empty? values)
-                 (let [value (first values)
-                       next-time (+ time interval)]
-                   (when value
-                     (at time (instrument value)))
-                   (apply-at next-time
-                             play-it [next-time interval instrument (rest values) (inc counter)])))))]
+    (play-it beat-ms
+             sampled-piano
+             ;; concat the sets-of-4-note-chords into a single
+             ;; seq of notes to send to play-it
+             (apply concat
+                    (take num-measures
+                          ;; for each root note, use overtone's rand-chord
+                          ;; to construct a 4-note chord that spans up to
+                          ;; 24 degrees
+                          (map (fn [root-note] (rand-chord root-note :major 4 24))
+                               (cycle base-line)))))))

-      ;; baseline plays once per 4 notes
-      (play-it (* 4 beat-ms)
-        synth/vintage-bass
-        ;; cycle the base line forever (but in reality, just for
-        ;; `num-measures` times)
-        (take num-measures (cycle (map note base-line))))
-
-      (play-it beat-ms
-        sampled-piano
-        ;; concat the sets-of-4-note-chords into a single
-        ;; seq of notes to send to play-it
-        (apply concat
-               (take num-measures
-                     ;; for each root note, use overtone's rand-chord
-                     ;; to construct a 4-note chord that spans up to
-                     ;; 24 degrees
-                     (map (fn [root-note] (rand-chord root-note :major 4 24))
-                          (cycle base-line))))))))
-


multi-method added for finding chunks of html based on either the fact that it contains a specific attribute (like :data-toggle) or if an attribute's value is a specific value.

--- scraper/src/scraper/core.clj
+++ scraper/src/scraper/core.clj
@@ -20,8 +20,15 @@
                   [])
                 (mapcat #(by-fn %1 pred?) (children html-tree)))))

-(defn by-attribute [html-tree x]
-      (by-fn html-tree #(map-contains-map? (attributes %) x)))
+;(defn by-attribute [html-tree x]
+;      (by-fn html-tree #(map-contains-map? (attributes %) x)))
+(defmulti by-attribute (fn [_ x] (class x)))
+(defmethod by-attribute clojure.lang.IPersistentMap
+           [html-tree x]
+           (by-fn html-tree #(map-contains-map? (attributes %) x)))
+(defmethod by-attribute clojure.lang.Keyword
+           [html-tree x]
+           (by-fn html-tree #(contains? (attributes %) x)))

 (defn by-tag [html-tree x]
       (by-fn html-tree #(= (tag %) x)))


Fix typo

Fix typo

--- src/io/aviso/rook/swagger.clj
+++ src/io/aviso/rook/swagger.clj
@@ -28,7 +28,7 @@
   (let [[_ ^String indent] (re-matches #"(\s*).*" input)]
     [(.length indent) input]))

-(defn ^:no-doccle cleanup-indentation-for-markdown
+(defn ^:no-doc cleanup-indentation-for-markdown
   "Fixes the indentation of a :doc or :documentation string to be valid for (extended) Markdown."
   [input]
   (cond-let


More logging.

More logging.

--- src/kixi/hecuba/data/misc.clj
+++ src/kixi/hecuba/data/misc.clj
@@ -229,6 +229,7 @@
   [store sensor measurements page]
   (db/with-session [session (:hecuba-session store)]
     (doseq [batch (partition-all page measurements)]
+      (log/debugf "Measurement Batch: %s" (vec batch))
       (let [{:keys [min-date max-date]} (min-max-dates batch)]
         (log/debugf "Inserting %s records for dates between %s and %s for batch for Sensor: %s" (count batch) min-date max-date sensor)
         (insert-batch session batch)


Fix typo in socket-server docstring

Fix typo in socket-server docstring

Incorrectly said the file was `.server-port` in the example `nc` command.

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -520,7 +520,7 @@

   The REPL can be accessed with the command

-     $ nc localhost $(cat .server-port)"
+     $ nc localhost $(cat .socket-port)"

   [b bind ADDR      str    "The address server listens on."
    p port PORT      int    "The port to listen to."


Dernière version en clojure pour le contest mean-max (1636/2512, league bronze atteinte)

--- clojure/codingame/competition/mean-max/src/mean_max/core.clj
+++ clojure/codingame/competition/mean-max/src/mean_max/core.clj
@@ -131,19 +131,6 @@
       (let [my-reaper (first (filter-my-units (filter-reapers @units)))
             my-destroyer (first (filter-my-units (filter-destroyers @units)))
             my-doof (first (filter-my-units (filter-doofs @units)))]
-        ;(binding [*out* *err*] (println "wrecks : " (string/join " " (map #(into {} %) wrecks))))
-        ;                       (println "wrecks with water: " (string/join " " (map #(into {} %) wrecks-with-water)))
-        ;                       (println "tankers : " (string/join " " (map #(into {} %) tankers)))
-        ;                       (println "reapers : " (string/join " " (map #(into {} %) reapers)))
-        ;                       (println "destroyers : " (string/join " " (map #(into {} %) destroyers)))
-        ;                       (println "enemy reapers: " (string/join " " (map #(into {} %) enemy-reapers)))
-        ;                       (println "enemy destroyers: " (string/join " " (map #(into {} %) enemy-destroyers)))
-        ;                       (println "my reaper : " (string/join " " my-reaper))
-        ;                       (println "my destroyer : " (string/join " " my-destroyer))
-        ;                       (println "my doof : " (string/join " " my-doof)))
-        ;;(println (compute-reaper-action my-reaper wrecks-with-water tankers))
-        ;;(println (compute-destroyer-action my-destroyer tankers enemy-reapers my-rage))
-        ;;(println (compute-doof-action my-doof enemy-reapers my-rage))
         ;(binding [*out* *err*] (println "my reaper : " (string/join " " my-reaper))
         ;                       (println "my destroyer : " (string/join " " my-destroyer))
         ;                       (println "my doof : " (string/join " " my-doof)))


Revert "Revert "Merge pull request #122 from circleci/use-om2""

This reverts commit 9c6032af6d5c5c8e9577f4cbc87128a0f388f23c.

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -92,9 +92,6 @@
               [:a {:on-click #(raise! owner [:set-user-session-setting {:setting :use-local-assets
                                                                         :value (not use-local-assets)}])}
                "local assets " (if use-local-assets "off " "on ")])
-            [:a {:on-click #(raise! owner [:set-user-session-setting {:setting :use-om
-                                                                      :value false}])}
-             "om off "]
             (let [current-build-id (get user-session-settings :om_build_id "dev")]
               (for [build-id (remove (partial = current-build-id) ["dev" "whitespace" "production"])]
                 [:a.menu-item


Remove whitespace on shapes data ns.

Remove whitespace on shapes data ns.

--- src/uxbox/main/data/shapes.cljs
+++ src/uxbox/main/data/shapes.cljs
@@ -493,7 +493,6 @@
        (->> (get-in state [:workspace :selected])
             (map #(update-stroke-attrs % opts)))))))

-
 (defn move-selected-layer
   [loc]
   (reify


filter more assets types so they are not parsed as JS

--- src/main/shadow/build/npm.clj
+++ src/main/shadow/build/npm.clj
@@ -414,7 +414,11 @@

 (def asset-exts
   #{"css"
+    "scss"
+    "sass"
+    "less"
     "png"
+    "gif"
     "jpg"
     "jpeg"
     "svg"})


replace the references to app.css.less

replace the references to app.css.less

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -287,7 +287,7 @@
         old-link (->> (sel [:head :link])
                       (filter is-app-css?)
                       first)]
-        (dommy/append! (sel1 :head) [:link {:rel "stylesheet" :href "/assets/css/app.css.less"}])
+        (dommy/append! (sel1 :head) [:link {:rel "stylesheet" :href "/assets/css/app.css"}])
         (dommy/remove! old-link)))

 (defn update-ui! []


Rearrange the CA functions a bit.

Rearrange the CA functions a bit.

--- src/algebolic/expression/algebra.clj
+++ src/algebolic/expression/algebra.clj
@@ -3,7 +3,10 @@
 ;;;; Not for distribution.

 (ns algebolic.expression.algebra
-  "This namespace implements some basic computer algebra operations on algebolic expressions."
+  "This namespace implements some basic computer algebra operations on algebolic expressions. And by 'basic'
+  I really mean basic. The functions here make no attempt at being a complete computer algebra system, but
+  rather offer a few useful transformations that can be used both in the EA, and also by hand for
+  understanding expressions."
   (:require [algebolic.expression.core :as expression]
             [clojure.core.match :as match]
             [clojure.walk :as walk]
@@ -13,10 +16,29 @@
   [x]
   (not (number? x)))

-(defn expand
+
+(defn- operate-tree
+  "Takes an expression and applies the given operation to every sub-expression, including the
+  expression itself."
+  [op expr]
+  (if (expression/non-terminal? expr)
+    (op (expression/make-expression (first expr) (map (partial operate-tree op) (rest expr))))
+    expr))
+
+(defn- operate-full
+  "Repeatedly applies the operation to the expression, and its sub-expressions, until the
+  result no longer changes. Beware of infinte loops!"
+  [op expr]
+  (let [new-exp (operate-tree op expr)]
+    (if (= expr new-exp)
+      new-exp
+      (recur op new-exp))))
+
+(defn- expand-expr
+  "Tries to expand an expression as much as possible, and transform it to a canonical form."
   [expr]
   (match/match [expr]
-               ;; distribute plus through times
+               ;; distribute plus and minus through times
                [[:times a [:plus b c]]] [:plus [:times a b] [:times a c]]
                [[:times [:plus a b] c]] [:plus [:times a c] [:times b c]]
                [[:times a [:minus b c]]] [:minus [:times a b] [:times a c]]
@@ -25,9 +47,6 @@
                [[:plus a [:plus b c]]] [:plus [:plus a b] c]
                [[:minus a [:minus b c]]] [:minus [:minus a b] c]
                [[:times a [:times b c]]] [:times [:times a b] c]
-               ;; times to the right
-               ;;[[:times [:times a b] c]] [:times a [:times b c]]
-               ;;[[:plus [:plus a b] c]] [:plus a [:plus b c]]
                ;; always move numbers to the left
                [[:plus (a :guard not-number?) (b :guard number?)]] [:plus b a]
                [[:minus (a :guard not-number?) (b :guard number?)]] [:minus b a]
@@ -43,15 +62,7 @@
                [x] x
                ))

-(defn expand-tree
+(defn expand-full
+  "Tries to expand an expression as much as possible, and transform it to a canonical form."
   [expr]
-  (if (expression/non-terminal? expr)
-    (expand (expression/make-expression (first expr) (map expand-tree (rest expr))))
-    expr))
-
-(defn expand-full
-  [expr]
-  (let [new-exp (expand-tree expr)]
-    (if (= expr new-exp)
-      new-exp
-      (recur new-exp))))+  (operate-full expand-expr expr))


deal with snaps

deal with snaps

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

--- clojure/acq_engine.clj
+++ clojure/acq_engine.clj
@@ -27,6 +27,9 @@
     (reduce #(apply rekey %1 %2)
       m (partition 2 (conj ks knew kold)))))

+(defn select-and-rekey [m & ks]
+    (apply rekey (select-keys m (apply concat (partition 1 2 ks))) ks))
+
 ;; mm utils
 (defn get-default-devices []
   {:camera          (. mmc getCameraDevice)
@@ -48,16 +51,14 @@
 (defn ChannelSpec-to-map [^ChannelSpec chan]
   (-> chan
     (data-object-to-map)
-    (rekey
+    (select-and-rekey
       :config_                 :name
       :exposure_               :exposure
       :zOffset_                :z-offset
       :doZStack_               :use-z-stack
       :skipFactorFrame_        :skip-frames
       :useChannel_             :use-channel
-      :color_                  :color
     )
-    (dissoc :name_ :contrast16_ :contrast8_ :min_ :max_)
     (assoc :properties (get-config (. mmc getChannelGroup) (.config_ chan)))))

 (defn MultiStagePosition-to-map [^MultiStagePosition msp]
@@ -71,75 +72,7 @@
               2 [(.x stage-pos) (.y stage-pos)])])))})

 ;; acq-engine
-
-(defn set-stage-position
-  ([stage-dev z] (. mmc setPosition stage-dev z))
-  ([stage-dev x y] (. mmc setXYPosition stage-dev x y)))
-
-(def device-agents
-  (let [devs (seq (. mmc getLoadedDevices))]
-    (zipmap devs (repeatedly (count devs) #(agent nil)))))
-
-(defn create-presnap-actions [event]
-  (into {} (concat
-    (for [[axis pos] (get-in event [:position :axes])]
-      [axis #(apply set-stage-position axis pos)])
-    (for [prop (get-in event [:channel :properties])]
-      [(prop 0) #(apply* .setProperty mmc prop)]))))
-
-(defn send-device-action [dev action]
-  (send-off (device-agents dev) (fn [_] (action))))
-
-(defn run-actions [action-map]
-  (doseq [[dev action] action-map]
-    (send-device-action dev action))
-  (doseq [dev (keys action-map)]
-    (send-device-action dev #(. mmc waitForDevice dev)))
-  (apply await-for 10000 (vals device-agents)))
-
-(defn snap-image [event auto-shutter]
-  (if (and auto-shutter (. mmc getShutterOpen))
-    (. mmc setShutterOpen true)
-    (. mmc waitForDevice (. mmc getShutterDevice)))
-  (. mmc snapImage)
-  (if (and auto-shutter (event :close-shutter))
-     (. mmc setShutterOpen false))
-  (. mmc getImage))
-
-(defn start-burst [n-images]
-  (. mmc startSequenceAcquisition n-images 0 false))
-
-(defn collect-burst-image []
-  (while (zero? (. mmc remainingImageCount))
-    (Thread/sleep 5))
-  (. mmc popNextImage))
-
-(defn update-channel [event]
-  (when-let [channel (event :channel)]
-    (let [channel-group (. mmc getChannelGroup)
-          config (.config channel)]
-      (. mmc setConfig channel-group config))))
-
-(defn update-slice [event]
-  (when-let [slice (event :slice)]
-    (when-let [focusDevice (. mmc getFocusDevice)]
-      (. mmc setPosition focusDevice slice))))
-
-(defn get-stage-positions [^MultiStagePosition msp]
-  (map #(.get msp %) (range (.size msp))))
-
-(defn update-position [event]
-  (when-let [position (event :position)]
-    (for [sp (get-stage-positions position)]
-      (let [stage (.stageName sp)]
-        (condp = (.numAxes sp)
-          1 (. mmc setPosition stage (.x sp))
-          2 (. mmc setXYPosition stage (.x sp) (.y sp)))))))
-
-(defn run-autofocus [event]
-  (when (event :use-autofocus)
-    (.. gui getAutofocusManager getDevice fullFocus)))
-
+
 (defn clock-ms []
   (quot (System/nanoTime) 1000000))

@@ -149,38 +82,63 @@
                      (clock-ms))]
     (when (pos? sleep-time)
       (Thread/sleep sleep-time)))
-  (clock-ms))
+  (clock-ms))
+
+(def device-agents
+  (let [devs (seq (. mmc getLoadedDevices))]
+    (zipmap devs (repeatedly (count devs) #(agent nil)))))
+
+(defn set-stage-position
+  ([stage-dev z] (. mmc setPosition stage-dev z))
+  ([stage-dev x y] (. mmc setXYPosition stage-dev x y)))
+
+(defn set-property
+  ([dev prop] (. mmc setProperty (prop 0) (prop 1) (prop 2))))

-(defn wait-for-devices [event]
-  (. mmc waitForDevice (. mmc getFocusDevice))
-  ;; more
-  )
+(defn send-device-action [dev action]
+  (send-off (device-agents dev) (fn [_] (action))))
+
+(defn create-presnap-actions [event]
+  (into {} (concat
+    (for [[axis pos] (get-in event [:position :axes])]
+      [axis #(apply set-stage-position axis pos)])
+    (for [prop (get-in event [:channel :properties])]
+      [(prop 0) #(.setProperty mmc (prop 0) (prop 1) (prop 2))]))))
+
+(defn run-actions [action-map]
+  (doseq [[dev action] action-map]
+    (send-device-action dev action))
+  (doseq [dev (keys action-map)]
+    (send-device-action dev #(. mmc waitForDevice dev)))
+  (doall (map (partial await-for 10000) (vals device-agents))))
+
+(defn snap-image [open-before close-after]
+  (if open-before
+    (. mmc setShutterOpen true)
+    (. mmc waitForDevice (. mmc getShutterDevice)))
+  (. mmc snapImage)
+  (if close-after
+    (. mmc setShutterOpen false))
+    (. mmc waitForDevice (. mmc getShutterDevice)))
+
+(defn collect-image [event]
+  (. mmc getImage))

-(defn run-event [event last-wake-time]
-  (update-channel event)
-  (update-position event)
-  (let [new-wake-time (acq-sleep event last-wake-time)]
-    (run-autofocus event)
-    (update-slice event)
-    (wait-for-devices event)
-    (snap-image event)
-    new-wake-time))
-
-(defn run-events [events]
-  (doall (map run-event events)))
+(defn run-event [event]
+  (run-actions (create-presnap-actions event))
+  (await-for 10000 (device-agents (. mmc getCameraDevice)))
+  (snap-image true true)
+  (send-device-action (. mmc getCameraDevice) #(collect-image event)))

 (defn run-acquisition [settings]
   (def acq-settings settings)
   (let [acq-seq (generate-acq-sequence settings)]
      (def acq-sequence acq-seq)
-     (doall (map println acq-seq))))
+     (map run-event acq-seq)))

 (defn convert-settings [^SequenceSettings settings]
   (-> settings
     (data-object-to-map)
-    (assoc :frames (range (.numFrames settings))
-           :channels (filter :use-channel (map ChannelSpec-to-map (.channels settings)))
-           :positions (map MultiStagePosition-to-map (.positions settings)))
     (rekey
       :slicesFirst             :slices-first
       :timeFirst               :time-first
@@ -190,12 +148,16 @@
       :skipAutofocusCount      :autofocus-skip
       :relativeZSlice          :relative-slices
       :intervalMs              :interval-ms
-    )))
+      :slices                  :slices
+    )
+    (assoc :frames (range (.numFrames settings))
+           :channels (filter :use-channel (map ChannelSpec-to-map (.channels settings)))
+           :positions (map MultiStagePosition-to-map (.positions settings)))))

 (defn run-acquisition-from-settings [^SequenceSettings settings]
   (println settings)
   (def orig-settings settings)
-  (run-acquisition (convert-settings settings)))
+  (println (run-acquisition (convert-settings settings))))

 (defn create-acq-eng []
   (doto
@@ -209,6 +171,5 @@
 (defn test-dialog [eng]
   (.show (AcqControlDlg. eng (Preferences/userNodeForPackage (.getClass gui)) gui)))

-


run-autofocus

run-autofocus

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

--- clojure/acq_engine.clj
+++ clojure/acq_engine.clj
@@ -163,9 +163,8 @@
       (doseq [[dev action] action-map]
         (action) (. mmc waitForDevice dev)))))

-(defn run-autofocus [event]
-  (when (event :autofocus)
-    (.. gui getAutofocusManager getDevice fullFocus)))
+(defn run-autofocus []
+  (.. gui getAutofocusManager getDevice fullFocus))

 (defn snap-image [open-before close-after]
   (if open-before
@@ -191,7 +190,8 @@
   (await-for 10000 (device-agents (. mmc getCameraDevice)))
   (when-let [wait-time-ms (event :wait-time-ms)]
     (swap! last-wake-time acq-sleep wait-time-ms))
-  (run-autofocus event)
+  (when (event :autofocus)
+    (run-autofocus))
   (snap-image true true)
   (collect-image event out-queue))
   ;(send-device-action (. mmc getCameraDevice)


Fix var name.

Fix var name.

--- src/oc/storage/components.clj
+++ src/oc/storage/components.clj
@@ -97,7 +97,7 @@

   (start [component]
     (timbre/info "[storage-notification] starting...")
-    (storage-notification/start component)
+    (storage-notif/start component)
     (timbre/info "[storage-notification] started")
     (assoc component :storage-notification true))


Fix bookkeeper server shutdown

Fix bookkeeper server shutdown

--- src/onyx/state/bookkeeper.clj
+++ src/onyx/state/bookkeeper.clj
@@ -53,15 +53,15 @@
                                  :journal-dir journal-dir
                                  :ledger-dir ledger-dir}))
                             ports)]
-              (.addShutdownHook (Runtime/getRuntime)
-                                (Thread. (fn []
-                                           (cleanup-dirs servers))))
-              (assoc component :servers servers)))
-      component))
+          (.addShutdownHook (Runtime/getRuntime)
+                            (Thread. (fn []
+                                       (cleanup-dirs servers))))
+          (assoc component :servers servers))
+        component)))
   (component/stop [{:keys [servers] :as component}]
     (doseq [server servers]
       (info "Stopping BookKeeper server")
-      (.stop server))
+      (.shutdown (:server server)))
     (cleanup-dirs servers)
     (assoc component :servers nil)))


Add handy file downloading fns

Add handy file downloading fns

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -2,9 +2,11 @@
     ^{:doc "Useful file manipulation fns"
       :author "Sam Aaron"}
   overtone.helpers.file
+  (:import [java.net URL])
   (:use [clojure.java.io]
         [overtone.helpers.string])
-  (:require [org.satta.glob :as satta-glob]))
+  (:require [org.satta.glob :as satta-glob]
+            [clojure.java.io :as io]))

 (defn- files->abs-paths
   "Given a seq of java.io.File objects, returns a seq of absolute paths for each
@@ -104,3 +106,40 @@
   [pattern]
   (let [pattern (resolve-tilde-path pattern)]
     (satta-glob/glob pattern)))
+
+(defn- download-file-without-timeout
+  "Downloads remote file at url to local file specified by target path. Has
+  potential to block current thread whilst reading data from remote host. See
+  download-file-with-timeout for a non-blocking version."
+  [url target-path]
+  (let [target-path (resolve-tilde-path target-path)]
+    (with-open [in  (io/input-stream url)
+                out (io/output-stream target-path)]
+      (io/copy in out))))
+
+(defn- download-file-with-timeout
+  "Downloads remote file at url to local file specified by target path. If data
+  transfer stalls for more than timeout ms, throws a
+  java.net.SocketTimeoutException"
+  [url target-path timeout]
+  (let [target-path (resolve-tilde-path target-path)
+        url (URL. url)
+        con  (.openConnection url)]
+    (.setReadTimeout con timeout)
+    (with-open [in (.getInputStream con)
+                out (io/output-stream target-path)]
+      (io/copy in out))))
+
+(defn download-file
+  "Downloads the file pointed to by URI to local path target-path. If no timeout
+  is specified will use blocking io to transfer data. If timeout is specified,
+  transfer will block for at most timeout ms before throwing a
+  java.net.SocketTimeoutException if data transfer has stalled."
+  ([url target-path] (download-file-without-timeout url target-path))
+  ([url target-path timeout] (download-file-with-timeout url target-path timeout)))
+
+(defn file-size
+  "Returns the size of the file pointed to by path in bytes"
+  [path]
+  (let [path (resolve-tilde-path path)]
+    (.length (file path))))


Revert "update"

Revert "update"

This reverts commit 22d53e97c42da973a593448dda2147f3286dbe52.

--- src/clojure/nossal/coupons.clj
+++ src/clojure/nossal/coupons.clj
@@ -23,9 +23,9 @@
              :description "💲 Ganhe R$20,00 de desconto em 2 primeiras viagens! ✅"
              :text [:p "Ganhe " [:span.value "R$10,00"]" de desconto nas suas " [:strong "2 primeiras"] " corridas! " [:ruby "🎉 " [:rt "ta-da!"]]
                      [:small "Este cupom pode ser utilizado duas vezes por pessoa, nas suas primeiras viagens. São " [:span.value "R$20,00"] " de desconto em duas viagens."]]}
-   "uber-1" {:code "uvejzn"
+   "uber-1" {:code "0018f1"
              :title ["Uber" "#2"]
-             :url "https://www.uber.com/invite/uvejzn"
+             :url "https://www.uber.com/invite/0018f1"
              :description "💲 Ganhe R$10,00 de desconto em 2 primeiras viagens! ✅"
              :text [:p "Ganhe " [:span.value "R$10,00"]" de desconto nas suas " [:strong "2 primeiras"] " corridas! " [:ruby "🎉 " [:rt "ta-da!"]]
                      [:small "Este cupom pode ser utilizado duas vezes por pessoa, nas suas primeiras viagens. São " [:span.value "R$20,00"] " de desconto em duas viagens."]]}


parsed identifiers sort

parsed identifiers sort

--- src/be/ac/ua/aspchecker/transformation.clj
+++ src/be/ac/ua/aspchecker/transformation.clj
@@ -30,12 +30,6 @@

 (defn logical-operator? [op]
   (or
-    (= op "==")
-    (= op "!=")
-    (= op ">")
-    (= op ">=")
-    (= op "<")
-    (= op "<=")
     (= op "&&")
     (= op "||")))

@@ -49,6 +43,14 @@
     (= op "%")))

+(defn comparison-operator? [op]
+  (or
+    (= op ">")
+    (= op ">=")
+    (= op "<")
+    (= op "<=")))
+
+
 (defn unary-operator? [op]
   (or
     (= op "++")
@@ -73,10 +75,24 @@
     (logical-operator? (.getText (.getChild exp 1)))))

+(defn comparison-expression? [exp]
+  (and
+    (= (.getChildCount exp) 3)
+    (comparison-operator? (.getText (.getChild exp 1)))))
+
+
 (defn arithmetic-expression? [exp]
   (and
     (= (.getChildCount exp) 3)
     (arithmetic-operator? (.getText (.getChild exp 1)))))
+
+
+(defn equality-expression? [exp]
+  (and
+    (= (.getChildCount exp) 3)
+    (or
+      (= "==" (.getText (.getChild exp 1)))
+      (= "!=" (.getText (.getChild exp 1))))))

 (defn unary? [exp]
@@ -233,6 +249,8 @@
     (parentheses-expression? rule) (dump-parentheses rule)
     (logical-expression? rule) (visit-infix-expression rule)
     (arithmetic-expression? rule) (visit-infix-expression rule)
+    (comparison-expression? rule) (visit-infix-expression rule)
+    (equality-expression? rule) (visit-infix-expression rule)
     (unary? rule) (visit-unary rule)
     (ternary? rule) (visit-ternary rule)
     (method-call? rule) (visit-method-call rule)
@@ -248,6 +266,8 @@

 ;Sort retrieval
+(declare descendent-infer-type)
+

 (defn creates-identifier? [rule]
   (or
@@ -259,15 +279,78 @@
     (vector-access? rule)))

-(defn infer-type [rule])
-
-
-;Get the type of the other element of the binary relationship
+(defn creates-logic-result? [rule]
+  (or
+    (logical-expression? rule)
+    (comparison-expression? rule)))
+
+
+(defn match-inferior-type [rule]
+  (cond
+    (logical-expression? rule) :bool
+    (comparison-expression? rule) :real
+    (arithmetic-expression? rule) :real
+    :else nil))
+
+
+(defn match-literal-type [term]
+  (cond
+    (.contains (.toString (.getPayload term)) "<53>") :bool
+    (.contains (.toString (.getPayload term)) "<54>") :uninterpreted
+    (.contains (.toString (.getPayload term)) "<52>") :real
+    (.contains (.toString (.getPayload term)) "<51>") :real
+    (.contains (.toString (.getPayload term)) "<55>") :uninterpreted
+    (.contains (.toString (.getPayload term)) "<56>") :uninterpreted))
+
+
+;Get the type of the opposite element of the binary relationship
 (defn match-symmetric-type [rule]
   (if
     (= (.getChild (.getParent rule) 0) rule)
-    (infer-type (.getChild (.getParent rule) 2))
-    (infer-type (.getChild (.getParent rule) 0))))
+    (descendent-infer-type (.getChild (.getParent rule) 2))
+    (descendent-infer-type (.getChild (.getParent rule) 0))))
+
+
+(defn match-unary [rule]
+  (let [fst (.getChild rule 0)
+        sec (.getChild rule 1)
+        fsttext (.getText fst)]
+    (if
+      (unary-operator? fsttext)
+      (descendent-infer-type sec)
+      (descendent-infer-type fst))))
+
+
+(defn ascendent-infer-type [rule]
+  (loop [ru rule
+         vad (.getParent ru)]
+    (cond
+      ;Top-level boolean expression
+      (nil? vad) :bool
+      ;Return the reached type
+      (match-inferior-type vad) (match-inferior-type vad)
+      (and
+        (ternary? vad)
+        (= (.getChild vad 0) ru)) :bool
+      ;Go down on the symmetric type
+      (equality-expression? vad) (match-symmetric-type ru)
+      ;Keep ascending
+      :else (recur vad (.getParent vad)))))
+
+
+(defn descendent-infer-type [rule]
+  (loop [ru rule]
+    (cond
+      ;Last level expression
+      (terminal? ru) (match-literal-type ru)
+      ;Give boolean result
+      (creates-logic-result? ru) :bool
+      (arithmetic-expression? ru) :real
+      (creates-identifier? ru) :uninterpreted
+      ;Keep descending
+      (unary? ru) (match-unary ru)
+      (ternary? ru) (recur (.getChild ru 2))
+      :else (recur (.getChild ru 0)))))

 (defn retrieve-sorts [root]
@@ -280,8 +363,18 @@
       (let [cur (.getChild root i)]
         (cond
           ;adds the identifier and keep iterating children
-          (creates-identifier? cur) (recur (conj result (visit-rule cur)) (+ i 1) max)
+          (creates-identifier? cur) (recur
+                                      (conj
+                                        result
+                                        (hash-map
+                                          :identifier (visit-rule cur)
+                                          :type (ascendent-infer-type cur)))
+                                      (+ i 1)
+                                      max)
           ;skips terminal
-          (terminal? cur) (recur result (+ i 1) max)
+          (terminal? cur) (recur
+                            result
+                            (+ i 1)
+                            max)
           ;keeps going down on the tree
           :else (recur (into [] (concat result (retrieve-sorts cur))) (+ i 1) max))))))


use a regex for builds route

use a regex for builds route

we only want to dispatch on numerical build_nums

--- frontend/routes.cljs
+++ frontend/routes.cljs
@@ -39,8 +39,8 @@
       (open-to-dashboard! nav-ch params))
     (defroute v1-project-branch-dashboard "/gh/:org/:repo/tree/:branch" {:as params}
       (open-to-dashboard! nav-ch params))
-    (defroute v1-inspect-build "/gh/:org-id/:repo-id/:build-num"
-      [org-id repo-id build-num]
+    (defroute v1-inspect-build #"/gh/[^/]+/[^/]+/\d+"
+      [[org-id repo-id build-num]]
       (open-build-inspector! app nav-ch org-id repo-id build-num))
     (defroute v1-add-projects "/add-projects" []
       (open-to-add-projects! nav-ch))


Created a test case that breaks the current sort.

--- test/blutwurst/planner_test.clj
+++ test/blutwurst/planner_test.clj
@@ -1,6 +1,7 @@
 (ns blutwurst.planner-test
   (:require [clojure.test :refer :all]
             [blutwurst.logging-fixture :refer :all]
+            [taoensso.timbre :as timbre :refer [trace]]
             [blutwurst.planner :refer :all]))

 (use-fixtures :each logging-fixture)
@@ -19,16 +20,22 @@
     ))

   (testing "Planning should account for foreign key relationships when buidling out a plan."
-   (let [city-table-definition {:name "CITY" :schema "ASDF" :columns '({:name "STATE"})
+   (let [city-table-definition {:name "CITY" :schema "ASDF" :columns '({:name "STATE"} {:name "COUNTRY"} {:name "NAME"})
                                         :dependencies [
                                           { :dependency-name "D1" :target-name "STATE"
                                             :target-schema "ASDF" :links {"STATE" "NAME"}}
+                                          { :dependency-name "D2" :target-name "COUNTRY"
+                                            :target-schema "ASDF" :links {"COUNTRY" "NAME"}}
                                         ]}
+         country-table-definition {:name "COUNTRY" :schema "ASDF" :columns '({:name "NAME"})}
          state-table-definition {:name "STATE" :schema "ASDF" :columns '({:name "NAME"})
                                         :dependencies []}
-         foreign-key-schema {:tables (list city-table-definition state-table-definition)}]
+         foreign-key-schema {:tables (list country-table-definition city-table-definition state-table-definition)}
+         result (create-data-generation-plan foreign-key-schema)]

-     (is (= (list state-table-definition city-table-definition)
-            (create-data-generation-plan foreign-key-schema)
+     (trace "Table order: " (pr-str (seq (map #(str (:schema %) "." (:name %)) result))))
+
+     (is (= (list country-table-definition state-table-definition city-table-definition)
+            result
          )))
   ))


pre-get the user context

pre-get the user context

--- src/clj/backtype/storm/daemon/executor.clj
+++ src/clj/backtype/storm/daemon/executor.clj
@@ -243,6 +243,7 @@
   (let [^KryoTupleDeserializer deserializer (:deserializer executor-data)
         report-error-and-die (:report-error-and-die executor-data)]
     (fn [[task-id msg] sequence-id end-of-batch?]
+      ;; TODO: optimize by batching emits onto the transfer queue
       (with-error-reaction report-error-and-die
         ;;(log-debug "Processing message " msg)
         (let [^Tuple tuple (if (instance? Tuple msg) msg (.deserialize deserializer msg))]
@@ -410,6 +411,7 @@
     (doseq [[task-id task-data] task-datas
             :let [^IBolt bolt-obj (:object task-data)
                   tasks-fn (:tasks-fn task-data)
+                  user-context (:user-context task-data)
                   bolt-emit (fn [stream anchors values task]
                               (let [out-tasks (if task
                                                 (tasks-fn task stream values)
@@ -433,7 +435,7 @@
                                 (or out-tasks [])))]]
       (.prepare bolt-obj
                 storm-conf
-                (:user-context task-data)
+                user-context
                 (OutputCollector.
                   (reify IOutputCollector
                      (emit [this stream anchors values]
@@ -448,7 +450,7 @@
                                                  [root (bit-xor id ack-val)])
                            ))
                        (let [delta (tuple-time-delta! tuple-start-times tuple)]
-                         (task/apply-hooks (:user-context task-data) .boltAck (BoltAckInfo. tuple delta))
+                         (task/apply-hooks user-context .boltAck (BoltAckInfo. tuple delta))
                          (when (sampler)
                            (stats/bolt-acked-tuple! executor-stats
                                                     (.getSourceComponent tuple)
@@ -462,7 +464,7 @@
                                                ACKER-FAIL-STREAM-ID
                                                [root]))
                        (let [delta (tuple-time-delta! tuple-start-times tuple)]
-                         (task/apply-hooks (:user-context task-data) .boltFail (BoltFailInfo. tuple delta))
+                         (task/apply-hooks user-context .boltFail (BoltFailInfo. tuple delta))
                          (when (sampler)
                            (stats/bolt-failed-tuple! executor-stats
                                                      (.getSourceComponent tuple)


setup function of cassandra component refactored

--- src/clj/hellhound/components/cassandra.clj
+++ src/clj/hellhound/components/cassandra.clj
@@ -58,6 +58,26 @@
   []
   (:cassandra (:db (hellhound/application-config))))

+(defn create-keyspace
+  [session name replication]
+  (alia/execute session
+                (hayt/create-keyspace name
+                                      (hayt/if-exists false)
+                                      (hayt/with replication))))
+
+(def table-schema
+  {:name :varchar
+                                  ;; int because we use epoch time
+                                  :timestamp :int
+                                  :applies :Boolean
+                                  :primary-key [:name :timestamp]})
+(defn create-table
+  [session name]
+  (alia/execute
+   session
+   (hayt/create-table name
+                      (hayt/if-exists false)
+                      (hayt/column-definitions table-schema))))

 (defn make-cassandra-client
   "Create an instance of `Cassandra` record to be used with a `component`
@@ -92,21 +112,27 @@
     ;; Connect to the cluster and select the default keyspace
     (let [[cluster session]          (connect options)
           keyspace         (:name (:keyspace options))]
+
+      ;; Select the keyspace if it exists.
       (select-keyspace session keyspace)
+
       (logger/info "Connected to cassandra cluster.")
+
       (assoc this
+             :options options
              :cluster cluster
              :session session
              :keyspace keyspace)))

   (stop [this]
     (if (:session this)
-      (do
+      (let [session (:session this)
+            cluster (:cluster this)]
         (logger/info "Disconnecting from Cassandra cluster...")
         ;; Shutting down the connection to cluster
-        (alia/shutdown (:session this))
-        (alia/shutdown (:cluster this))
-        (dissoc this :session :keyspace))
+        (alia/shutdown session)
+        (alia/shutdown cluster)
+        (dissoc this :session :cluster :keyspace))
       this))

   ;; DatabaseLifecycle implementation. Allow the migration system to operate
@@ -114,33 +140,19 @@
   protocols/DatabaseLifecycle

   (setup [this storage-name]
-    (let [session (:session this)]
-      (check-session session "Cassandra")
+    (check-session (:session this) "Cassandra")
+    (let [session         (:session this)
+          keyspace-config (:keyspace    (:options this))
+          replication     {:replication (:replication keyspace-config)}]

-      (let [keyspace-config (:keyspace (:options this))
-            replication     {:replication (:replication keyspace-config)}]
+      (logger/info "Creating the keyspace...")
+      (create-keyspace session (:name keyspace-config) replication)

-        (logger/info "Creating the keyspace...")
-        (alia/execute
-         session
-         (hayt/create-keyspace (:name keyspace-config)
-                               (hayt/if-exists false)
-                               (hayt/with replication)))
+      (logger/info "Creating migration storage...")
+      (create-table session storage-name)

-        (logger/info "Creating migration storage...")
-        (alia/execute
-         session
-         (hayt/create-table
-          storage-name
-          (hayt/if-exists false)
-          (hayt/column-definitions {:name :varchar
-                                    ;; int because we use epoch time
-                                    :timestamp :int
-                                    :applies :Boolean
-                                    :primary-key [:name :timestamp]})))
-
-        (logger/info "Migration storage created.")
-        (assoc this :keyspace (:name keyspace-config)))))
+      (logger/info "Migration storage created.")
+      (assoc this :keyspace (:name keyspace-config))))

   (teardown [this])
   (submit-migration [this record]))


only show results in debug mode

only show results in debug mode

--- src/cljs/early_vote_site/flash/events.cljs
+++ src/cljs/early_vote_site/flash/events.cljs
@@ -1,17 +1,20 @@
 (ns early-vote-site.flash.events
-  (:require [re-frame.core :as re-frame]))
+  (:require [early-vote-site.config :as config]
+            [re-frame.core :as re-frame]))

 (defn flash-message
   [{:keys [db]} [_ message]]
   {:db (assoc-in db [:flash :message] message)
    :dispatch-later [{:ms 2000 :dispatch [:flash/clear-message]}]})

-(enable-console-print!)
-
 (defn flash-error
   [{:keys [db]} [_ message result]]
-  {:db (assoc-in db [:flash :error] (str message (pr-str result)))
-   :dispatch-later [{:ms 5000 :dispatch [:flash/clear-error]}]})
+  (let [msg (if config/debug?
+              (str message (pr-str result))
+              message)
+        close-delay (if config/debug? 10000 4000)]
+    {:db (assoc-in db [:flash :error] msg)
+     :dispatch-later [{:ms close-delay :dispatch [:flash/clear-error]}]}))

 (defn clear-message
   [db _]


import resources

import resources

--- src/cljs/infinitelives/pixi/resources.cljs
+++ src/cljs/infinitelives/pixi/resources.cljs
@@ -4,6 +4,7 @@
             [infinitelives.utils.string :as string]
             [infinitelives.utils.sound :as sound]
             [infinitelives.utils.events :as events]
+            [infinitelives.utils.resources :as resources]
             [infinitelives.utils.console :refer [log]]
             [cljs.core.async :refer [chan put! <! timeout close!]])
   (:require-macros [cljs.core.async.macros :refer [go]]))


Katalog.

Katalog.

--- src/clojure/kamituel/ngm_toc/data/ngm.cljc
+++ src/clojure/kamituel/ngm_toc/data/ngm.cljc
@@ -8,7 +8,20 @@
 ;;       druga z 2-gim krajem, trzecia z lokalizacją.

 (def ngm
-  [{:year 2018 :month 10
+  [{:year 2019 :month 6 :vol 237
+    :articles [{:title "Zooturystyka"
+                :description "Kontakt z dzikimi zwierzętami bywa dla ludzi źródłem euforycznych doznań. Ale za pięknymi fotografiami prezentowanymi w mediach społecznościowych kryje się przemysł pełen okrucieństwa i brutalnej eksploatacji zwierząt."
+                :places [{:country "Tajlandia"}
+                         {:country "Rosja"}]}
+               {:title "Strażniczki"
+                :description "W Zimbabwe kobiety, które same były ofiarami przemocy, sprawdzają się w roli strażniczek dzikiej natury w walce z kłusownictwem."
+                :places [{:country "Zimbabwe" :coords [-16.161136 29.500340]}]}
+               {:title "Morskie winogrona"
+                :description "Tajemnicze Morze Sargassowe to jedyna w swoim rodzaju, pełna życia \"oceaniczna sawanna\"."
+                :places [{:coords [28 -66] :tags ["Morze Sargassowe"]}]}
+               {:title "Łuskowce"
+                :description "Łuski, zbudowane ze zwykłej kreatyny, ale mające rzekomo cudowne właściwości, stały się dla tych ssaków przekleństwem."}]}
+   {:year 2018 :month 10 :vol 229
     :articles [{:title "Kazimierz Wielki"
                 :description "Król Kazimierz był wielki. Dla Polaków to fakt tak domyślnie oczywisty, że nawet nie jesteśmy w stanie mówić o tym władcy w jakikolwiek inny sposób. Dlaczego jako jedyny władca Polski zyskał ten przydomek? I czy słusznie? Na okładce jest Andrzej Hausner, odtwórca roli Kazimierza III Wielkiego w drugim sezonie serialu Telewizji Polskiej pt. „Korona królów”."
                 :places [{:country "Polska"}
@@ -35,6 +48,47 @@
                {:title "Szwedzka Laponia"
                 :description "Niewiele jest w Europie krain równie dziewiczych."
                 :places [{:country "Szwecja" :tags ["kraina laponii"] :coords [67.4 17.3]}]}]}
+   {:year 2018 :month 6 :vol 225
+    :articles [{:title "Plastik"
+                :description "Stworzyliśmy go. Jesteśmy od niego uzależnieni. Nieświadomie wypełniliśmy nim oceany. Miliardy ton plastikowych odpadów będą się rozkładać przez wieki, jeśli nie tysiąclecia. Aby ograniczyć ten potok musimy zwiększać wtórne wykorzystanie surowców i zużywać ich znacznie mniej. Czy możemy jednocześnie cieszyć się zaletami plastiku i mieć czyste środowisko?"}
+               {:title "Kaszmir"
+                :description "Śrutówki służb bezpieczeństwa oślepiają ludzi – i podgrzewają trwający od dekad indyjsko-pakistański konflikt. Władze stosują je, aby tłumić zamieszki, nie zabijając ludzi, jednak śrut okalecza przypadkowe ofiary."
+                :places [{:country "Indie" :coords [33.8 76.1]}
+                         {:country "Pakistan" :coords [33.8 76.1]}]}
+               {:title "Afryka"
+                :description "Nowe technologie i gospodarka naturalna - takie kontrasty tylko a Afryce."
+                :places [{:tags ["Afryka"]}]}
+               {:title "Papugi"
+                :description "Budzą wielkie zainteresowanie ludzi, bo bardziej niż inne ptaki przypominają nas samych."}
+               {:title "Dzika Alaska"
+                :description "Ostatniej prawdziwie dzikiej połaci Ameryki zagrażają znajdujące się pod nią złoża ropy."
+                :places [{:country "USA" :tags ["Alaska"] :coords [69.7  -143.6]}]}]}
+   {:year 2018 :month 5 :vol 224
+    :articles [{:title "Pablo Picasso"
+                :description "To nazwisko zna chyba każdy. Nie tylko ze względu na znaczenie tej postaci w sztukach plastycznych, ale też świadome budowanie przez nią \"marki\" . Wielka samoświadomość, siła woli, obsesyjne poświęcenie się pracy i spora doza bezwzględności - oto co stworzyło geniusza."}
+               {:title "Być muzułmaninem w Ameryce"
+                :description "Jest ich 3,45 mln. Są imigrantami z ponad 75 krajów. Choć często funkcjonują w otoczeniu im niechętnym, organizują się, budują meczety - i rosną w siłę."
+                :places [{:country "USA"}]}
+               {:title "Dinozaury, które nie wyginęły"
+                :description "Skąd się wzięły ptaki? W prostej linii od dinozaurów. Niedobitków, które przetrwały uderzenie asteroidy sprzed 66 mln lat."}
+               {:title "Śmierć dla życia"
+                :description "Atol Fakarava na Polinezji Francuskiej w czerwcu oferuje rzadki spektakl: amory populacji garników pod okiem bezwzględnego rekiniego stada."
+                :places [{:country "Francja" :coords [-16.3 -145.633333] :tags ["Atol Fakarava" "Polinezja Francuska"]}]}]}
+   {:year 2018 :month 4 :vol 223
+    :articles [{:title "Pozory mylą"
+                :description "Przez wiele lat koncepcja wyższości jednych ras nad innymi znajdowała sprzymierzeńców w środowiskach naukowych. Aktualne wyniki badań DNA potwierdzają, że nie ma stałych cech kojarzonych z określonymi lokalizacjami geograficznymi. Wbrew pozorom wszyscy jesteśmy bardzo do siebie podobni."}
+               {:title "Co nas dzieli"
+                :description "Człowiek ma niezwykłą zdolność do budowania swej tożsamości w opozycji do innych. Czy jesteśmy więc skazani na wieczny konflikt My kontra Oni?"}
+               {:title "Granica"
+                :description "500 kilometrową granicę pomiędzy Republiką Irlandii a Irlandią Północną nie oddziela żaden mur. Mimo to pamięć o trwającym 30 lat konflikcie pomiędzy republikanami a zwolennikami pozostania w granicach Wielkiej Brytanii jest wciąż żywa. Rozmowy toczące się wokół Brexitu zostały w Irlandii Północnej przyjęte ze strachem i gniewem – burzą one kruchą równowagę społeczną w regionie."
+                :places [{:country "Irlandia Północna"}]}
+               {:title "Jane i Szympansy"
+                :description "Jane Goodall ma status ikony National Geographic, a jej badania nad szympansami w rezerwacie Gombe Stream stanowiły przedmiot licznych filmów, reportaży oraz wystąpień. Niepublikowane dotąd zdjęcia autorstwa Hugo van Lawicka stały się pretekstem, aby tę historię opowiedzieć jeszcze raz: bardzo szczerze, intymnie i od początku."
+                :places [{:country "Tanzania" :tags ["Park narodowy Gombe"] :coords [-4.7 29.65]}]}
+               {:title "Komplikacje życia"
+                :description "Przez 3 mld lat życie na Ziemi miało formę prostych, jednokomórkowych organizmów. Aż w pewnym momencie zaczęło się mocno komplikować."}
+               {:title "Czarny opór"
+                :description "Jak pokazać światową historię walki czarnych o swoje prawa? Omar Victor Diop znalazł na to oryginalny fotograficzny sposób."}]}
    {:year 2018 :month 2 :vol 221
     :articles [{:title "Tęgie głowy"
                 :description "Wyrażenie „ptasi móżdżek” na określenie intelektualnego deficytu ma niewiele wspólnego z prawdą. Niektóre ptaki dysponują bowiem możliwościami, o jakie nigdy byśmy ich nie podejrzewali. Artykuł powstał w ramach kampanii National Geographic „2018 ROK PTAKÓW” koncentrującej się na znaczeniu oraz ochronie ptaków."}
@@ -1758,10 +1812,116 @@
                {:title "Georgia Południowa"
                 :description "Wyspa zdołała się odrodzić mimo rzezi, jaką tutejszej faunie urządził człowiek. Dziś jej wielotysięczne kolonie przywodzą na myśl świat w stanie pierwotnym."
                 :places [{:country "Wielka Brytania" :region "Georgia Południowa" :coords [-54.3 -36.7]}]}]}
-    {:year 2010 :month 12 :vol 135
+    #_{:year 2010 :month 12 :vol 135
      :articles [{:title "Wywiad"
                  :description "Wywiad z archeologiem Andrzejem Pydynem, który opowiada o tym, jak szuka się skarbów kultury pod wodą, a także co można tam znaleźć."}
                 {:title "Aztekowie"
                  :description " Ich imperium spływało krwią i opinia ta nie jest jedynie czarnym PR-em konkwistadorów. Azteckie bóstwa domagały się ofiar z ludzi, więc zdobywanie jeńców było w istocie nakazem religijnym. Do czego doprowadziło to okrucieństwo bogów?"
                  :places [{:country "Meksyk" :city "Meksyk" :coords [19.4321 -99.1331]}]}
-                #_{:title "Kostka "}]}])
+                #_{:title "Kostka "}]}
+   {:year 2010 :month 6 :vol 129
+    :articles [{:title "Bronisław Malinowski"
+                :description "Dzienniki nie pozostawiają wątpliwości: ten gigant antropologii, badacz tubylczego seksu, miał paskudny charakter. Mimo to zdołał wejść między „dzikich” i wykazać, że człowiek cywilizowany niewiele się od nich różni."
+                :places [{:tags ["melanezja"] :coords [-7 131]}]}
+               {:title "Las Foja"
+                :description "Nowogwinejskie góry wystające ponad porośnięte dżunglą równiny są jak dziewicze wyspy. Badacze, którzy tam dotarli jako pierwsi, mogli się poczuć niczym XIX-wieczni odkrywcy nowych ziem i gatunków zwierząt."
+                :places [{:country "Indonezja" :tags ["Góry Foja"] :coords [-2.6 139.083333]}]}
+               {:title "Sen"
+                :description "Człowiek bez snu żyć nie może, choć nauka wciąż nie potrafi wyjaśnić, do czego tak naprawdę jest mu potrzebny. Co więcej, bezsenność staje się cywilizacyjną plagą. Badania nad snem mają zatem kolosalną przyszłość."}
+               {:title "Grenlandia"
+                :description "Ogromna wyspa przykryta lądolodem długo była niegościnna i jałowa. Globalne ocieplenie zmienia jednak sytuację, a mieszkańcy patrzą na ten proces z nadzieją. Czy Grenlandia, zgodnie z nazwą, zazieleni się?"
+                :places [{:country "Grenlandia" :coords [72 -40]}]}
+               {:title "St. Helens"
+                :description "Wulkan, który eksplodował w 1980 r., zniszczył życie na 600 km2, ale zarazem
+stworzył ogromne laboratorium, gdzie naukowcy mogą obserwować procesy odbudowy zniszczonych ekosystemów."
+                :places [{:country "USA" :tags ["Washington"] :coords [46.1912 -122.1944]}]}
+               {:title "Energia słoneczna"
+                :description "Słońce wysyła na Ziemię miliony razy więcej energii, niż nam potrzeba. Opracowanie technologii skutecznego jej chwytania oznacza więc niewyczerpane, czyste źródło darmowego prądu."}]}
+   {:year 2010 :month 5 :vol 128
+    :articles [{:title "Bionika"
+                :description "Proteza ręki reagująca na sygnały płynące z mózgu całkiem jak prawdziwa? Tak, to już możliwe. Co zatem czeka nas w niedalekiej przyszłości? Jakie „techniczne zamienniki” naszych układów możemy wyprodukować?"}
+               {:title "Herbaciany szlak"
+                :description "Przez tysiąc lat herbata z Syczuanu wędrowała do Tybetu na grzbietach mułów i tragarzy. Setki kilometrów wąskim szlakiem wiodącym przez górskie przełęcze. Co dziś pozostało po starej handlowej drodze?"
+                :places [{:country "Chiny" :city "Lhasa" :tags ["Tybet"] :coords [29.621177 91.177558]}
+                         {:country "Chiny" :city "Ya'an" :coords [29.989022 103.012993]}]}
+               {:title "Zimorodki"
+                :description "Ten oszałamiającymi barwami ptak jest w naszym umiarkowanym klimacie niczym tchnienie tropików. Szybki jak błyskawica, żyje intensywnie. Skrzydlaty błękitny rybak na pewno was zachwyci."}
+               {:title "Meksyk"
+                :description "Rzeczywistość kraju wstrząsanego krwawymi ekscesami narkotykowych karteli bywa trudna do zniesienia. Ludzie pociechy szukają więc w osobliwych kultach – Świętej Śmierci lub bandytów-Robin Hoodów."
+                :places [{:country "Meksyk"}]}
+               {:title "Ptolemais"
+                :description "Polscy archeolodzy od lat odkopują starożytne miasto w Libii. Zachowane równie dobrze jak Pompeje, pozwala nam poznać codzienne życie w rzymskim imperium."
+                :places [{:country "Libia" :city "Ptolemais" :coords [32.705789 20.953973]}]}
+               {:title "Libia"
+                :description "Były okresy, gdy Sahara się zieleniła. Wraz z deszczami pojawiała się roślinność, a wraz z nią – zwierzęta i ludzie. Być może tym korytarzem człowiek kolonizował świat. Zajrzyjmy więc do kroniki pustyni."
+                :places [{:country "Libia"}]}]}
+   {:year 2010 :month 4 :vol 127
+    :articles [{:title "Woda życia"
+                :description "Zasoby H2O krążącej w ziemskich ekosystemach teoretycznie zawsze są takie same. Tyle że potrzeby ludzkości rosną, a dostęp do wody przestał być oczywisty. Żeby uporać się z tym problemem, musimy zacząć traktować wodę jak dobro wspólne."}
+               {:title "Topnienie Tybetu"
+                :description "Jangcy, Mekong, Ganges, Huang He – największe rzeki Azji, gaszące pragnienie setek milionów ludzi, biorą początek na Dachu Świata, a zasilają je wody z tamtejszych lodowców. Co się stanie, gdy tybetańskie wieczne lody stopnieją?"
+                :places [{:country "Chiny" :tags ["Tybet" "Wyżyna Tybetańska"]}]}
+               {:title "Święte wody"
+                :description "Rzeki, mające swój początek i rozpływające się w oceanie, symbolizują przemijanie, wędrówkę, życiową drogę. Woda przenika wszystko, co żyje. Nic zatem dziwnego, że w wielu kulturach wody rzek trafiły do sfery sacrum."
+                :places [{:country "Meksyk" :tags ["studnia xkeken" "jukatan"] :coords [20.660792 -88.242748]}
+                         {:country "Laos" :tags ["mekong"]}
+                         {:country "Indie" :city "Haridwar" :tags ["święto ganga dussehra" "hinduizm"] :coords [29.943021 78.163676]}
+                         {:country "Francja" :city "Lourdes" :coords [43.1 -0.05]}
+                         {:country "Turcja" :city "Istambuł" :tags ["meczet beyazit"] :coords [41.010207 28.965253]}]}
+               {:title "Etiopia"
+                :description "W wielu rejonach biednych, trapionych suszą krajów najbardziej pracochłonnym zajęciem kobiet i dziewcząt jest... zapewnienie rodzinie wody. Na inną aktywność nie mają już czasu. Dlatego wydajna studnia w takiej społeczności to rewolucja."
+                :places [{:country "Etiopia"}
+                         {:country "Kenia"}]}
+               {:title "Cisza strumieni"
+                :description "Słodkie wody są siedliskiem życia niewiarygodnej liczby gatunków żywych stworzeń. Człowiek, zanieczyszczając wody bez opamiętania, zabija w nich życie, eksterminując,
+czasami bezwiednie, całe gatunki."}
+               {:title "Jordan"
+                :description "Z potężnej rzeki, w której wodach ochrzcił się Chrystus, pozostał ściek. Transgraniczny Jordan w suchym, skonfliktowanym regionie świata jest obiektem rywalizacji, narzędziem presji,
+ale też symbolem konieczności porozumienia."
+                :places [{:country "Izrael" :tags ["jezioro galilejskie"] :coords [32.808655 35.586966]}
+                         {:country "Jordan"}]}]}
+   {:year 2010 :month 3 :vol 126
+    :articles [{:title "Nazca"
+                :description "Ogromne rysunki na peruwiańskiej pustyni długo były tak tajemnicze, że ich autorstwo chętnie przypisywano kosmitom. Okazuje się jednak, że pochodzenie rytów można racjonalnie wyjaśnić."
+                :places [{:country "Peru" :coords [-14.742139 -75.128758]}]}
+               {:title "Rośliny mięsożerne"
+                :description "Kwiat zastawiający pułapkę na owada, a potem rozkładający go na substancje pokarmowe, wydaje się zjawiskiem przeczącym porządkowi natury. I właśnie dlatego jest ono tak fascynujące."}
+               {:title "Szanghaj"
+                :description "Chiny przygotowują się do objęcia roli największego supermocarstwa. A Szanghaj zamierza być tej potęgi najważniejszą metropolią."
+                :places [{:country "Chiny" :city "Szanghaj" :coords [31.2 121.4]}]}
+               {:title "Szympansy"
+                :description "Są jeszcze na świecie (a przynajmniej były do niedawna) wielkie małpy, które nigdy nie widziały człowieka. Co odkryli prymatolodzy, którzy się na nie natknęli?"
+                :places [{:country "Kongo" :tags ["trójkąt goualougo" "park narodowy nouabale-ndoki"] :coords [2.16 16.51]}]}
+               {:title "Góra Waszyngtona"
+                :description "Nie jest przesadnie wysoka, ale wietrzna jak diabli. Średnio 120 dni w roku powyżej progowej prędkości huraganu – to robi wrażenie!"
+                :places [{:country "USA" :tags ["new hampshire"] :coords [44.270531 -71.303395]}]}
+               {:title "Dystrykt mody"
+                :description "Nowojorskie fabryki odzieży ubierały kiedyś całe Stany Zjednoczone, dając zatrudnienie milionom emigrantów. Dziś modowy przemysł, jeden z symboli miasta, usiłuje sprostać wyzwaniom globalizacji."
+                :places [{:country "USA" :city "Nowy Jork" :tags ["manhattan"] :coords [40.753617 -73.992429]}]}]}
+   {:year 2010 :month 2 :vol 125
+    :articles [{:title "Poligamia"
+;l zxcvbm
+                ';lmnbvcxz  micxikru8`       :description "Mormońska sekta na amerykańskim Zachodzie wciąż praktykuje – nielegalną w Stanach – poligamię. Co sprawia, że mimo nacisków otoczenia fundamentaliści utrzymują trwałość swoich ogromnych „niebiańskich rodzin”?"
+                 :tags ["Fundamentalistyczny Kościół Jezusa Chrystusa Świętych w Dniach Ostatnich" "FLDS"]
+≥i9so                 :places [{:country "USA" :city "Hildale" :tags ["Utah"] :coords [37.00 -112.97]}
+                         {:country "USA" :city "Colorado City" :tags ["Arizona"] :coords [36.99 -112.98]}
+                         {:country "USA" :city "Pony Springs" :tags ["Nevada"] :coords [39.981572 -115.169210]}]}
+               {:title "Pacyficzny łosoś"
+                :description "Te ryby pokonują tysiące kilometrów, by wrócić do znajomej rzeki, złożyć tam ikrę i... zginąć. Kłusownicy zabijają je, nim wypełnią tę misję."
+                :places [{:country "Rosja" :tags ["półwysep kamczacki" "kamczatka"] :coords [53.06 158.47]}]}
+               {:title "Wrak"
+                :description "Przed wiekami wyładowany złotem okręt w drodze po bogactwa Indii rozbił się o skały wybrzeża diamentów. Jakby dla ilustracji tezy, że życie bywa przewrotne."
+                :places [{:country "Nambia" :tags ["park narodowy sperrgebiet"] :coords [-28.37 16.1]}]}
+               {:title "Hubble"
+                :description "Zasłużony (i wysłużony) kosmiczny teleskop przeszedł gruntowny remont i teraz widzi ostrzej, niż kiedykolwiek przedtem."}
+               {:title "Licheń"
+                :description "Największa konkurencja dla Częstochowy jest sanktuarium nowego typu. To kombinat, w którym potrzeby religijne mieszają się z turystyczno-rozrywkowymi."
+                :places [{:country "Polska" :city "Licheń" :coords [52.321843 18.356509]}]}
+               {:title "Podziemia USA"
+                :description "Amerykańskie stany Tennessee, Alabama i Georgia są podziurawione jak sito. Kilkanaście tysięcy jaskiń tworzy raj dla speleologów."
+                :places [{:country "USA" :tags ["jaskinia rumblings falls" "tennessee"] :coords [35.73 -85.41]}
+                         {:country "USA" :tags ["jaskinia iron hoop" "alabama"] :coords [34.916940 -86.031670]}
+                         {:country "USA" :tags ["jaskinia stephens gap" "alabama"] :coords [34.670629 -86.217744]}
+                         {:country "USA" :tags ["jaskinia sub-solomon" "tennessee"] :coords [35.22750000 -85.95111111]}
+                         {:country "USA" :tags ["jaskinia thunder hole" "alabama"]}
+                         {:country "USA" :tags ["jaskinia ellison's" "georgia"] :coords [34.664927 -85.363722]}]}]}])


Implement seqable.

Implement seqable.

--- src/clj/elephantdb/common/domain.clj
+++ src/clj/elephantdb/common/domain.clj
@@ -207,7 +207,12 @@

 (deftype Domain
     [localStore remoteStore serializer throttle rwLock
-     hostname status domainData shardIndex]
+     hostname status domainData shardIndex]
+  clojure.lang.Seqable
+  (seq [this]
+    (when-let [data (domain-data this)]
+      (mapcat #(lazy-seq (.iterator %))
+              (vals (:shards data)))))

   Shutdownable
   (shutdown [this]
@@ -263,7 +268,7 @@
              (u/mk-rw-lock)
              (u/local-hostname)
              (atom (KeywordStatus. :loading))
-             (atom {})
+             (atom nil)
              index)))

 ;; ## Domain Updater Logic


send info to factory

send info to factory

--- src/clj/salava/badge/endorsement.clj
+++ src/clj/salava/badge/endorsement.clj
@@ -7,7 +7,7 @@

 (defqueries "sql/badge/main.sql")

-(defn external-id []
+(defn generate-external-id []
   (str "urn:uuid:" (java.util.UUID/randomUUID)))

 (defn badge-owner? [ctx badge-id user-id]
@@ -25,7 +25,7 @@
     (if (badge-owner? ctx user-badge-id user-id)
       (throw+ {:status "error" :message "User cannot endorse himself"})
       (when-let [id (->> (insert-user-badge-endorsement<! {:user_badge_id user-badge-id
-                                                           :external_id (external-id)
+                                                           :external_id (generate-external-id)
                                                            :endorser_id user-id
                                                            :content content} (get-db ctx))
                          :generated_key)]
@@ -37,7 +37,9 @@
 (defn delete! [ctx user-badge-id endorsement-id user-id]
   (try+
     (if (or (endorsement-owner? ctx endorsement-id user-id) (badge-owner? ctx user-badge-id user-id ))
-      (do (delete-user-badge-endorsement! {:id endorsement-id} (get-db ctx))
+      (do
+        (delete-user-badge-endorsement! {:id endorsement-id} (get-db ctx))
+        (send-badge-info-to-obf ctx user-badge-id user-id)
         {:status "success"})
       {:status "error"}
       )
@@ -52,9 +54,8 @@
       (update-endorsement-status! {:id endorsement-id :status status} (get-db ctx))
       (case status
         "accepted" (send-badge-info-to-obf ctx user-badge-id user-id)
-        "declined" (do
-                     (delete! ctx user-badge-id endorsement-id user-id)
-                     (send-badge-info-to-obf ctx user-badge-id user-id)))
+        "declined" (delete! ctx user-badge-id endorsement-id user-id)
+        nil)
       {:status "success"})
     (catch Object _
       (log/error _)


Add a way of declaring multi components (all must match) for a system

--- src/cljs/chocolatier/engine/ces.cljs
+++ src/cljs/chocolatier/engine/ces.cljs
@@ -55,6 +55,12 @@
   [entities component-id]
   (map first
        (filter #(boolean (some #{component-id} (second %))) entities)))
+
+(defn entities-with-multi-component
+  "Takes a hashmap and returns all keys whose values has all component-ids"
+  [entities component-ids]
+  (map first
+       (filter #(boolean (some #{component-ids} (second %))) entities)))

 (defn mk-entity
   "Adds entity with uid that has component-ids into state"
@@ -181,6 +187,13 @@
      (let [entities (entities-with-component (:entities state) component-id)
            component-fns (get-component-fns state component-id)
            updated-state (f state component-fns entities)]
+       (ev/clear-inbox updated-state entities component-id))))
+  ([f component-id & component-ids]
+   (fn [state]
+     (let [ids (conj component-ids component-id)
+           entities (entities-with-multi-components (:entities state) ids)
+           component-fns (get-component-fns state component-id)
+           updated-state (f state component-fns entities)]
        (ev/clear-inbox updated-state entities component-id)))))

 (defn mk-system


Add loading indicators for the before and after subscriptions

--- src/cljs/comic_reader/ui/reader.cljs
+++ src/cljs/comic_reader/ui/reader.cljs
@@ -1,7 +1,8 @@
 (ns comic-reader.ui.reader
   (:require [re-frame.core :as re-frame]
             [comic-reader.ui.image :as image]
-            [comic-reader.api :as api]))
+            [comic-reader.api :as api]
+            [comic-reader.ui.base :as base]))

 (defn partitioned-locations [images current-location]
   (if (seq images)
@@ -158,13 +159,18 @@
 (defn comic-location-list [set-current-location locations]
   [:div (map #(make-comic-image set-current-location %) locations)])

-(defn reader [set-current-location locations]
-  [comic-location-list #(re-frame/dispatch [:set-current-location %]) locations])
+(defn reader [set-current-location locations loading-before loading-after]
+  [:div
+   (when loading-before [base/loading])
+   [comic-location-list #(re-frame/dispatch [:set-current-location %]) locations]
+   (when loading-before [base/loading])])

 (defn view []
   (let [current-locations (re-frame/subscribe [:current-locations])
         loading-before (re-frame/subscribe [:loading-before-buffer])
         loading-after  (re-frame/subscribe [:loading-after-buffer])]
-    @loading-before
-    @loading-after
-    [reader #(re-frame/dispatch [:set-current-location %]) @current-locations]))
+    [reader
+     #(re-frame/dispatch [:set-current-location %])
+     @current-locations
+     @loading-before
+     @loading-after]))


english

english

--- src/cljs/just_married/home/gift.cljs
+++ src/cljs/just_married/home/gift.cljs
@@ -17,12 +17,11 @@
          :sort-code "09-01-29"}})

 (def gift-dict
-  {:en {:gift   "Your company in this special day will be the greatest gift. If you would like to contribute to our Honeymoon at the Seychelles you can do use these bank coordinates:"
+  {:en {:gift   "Your company in this special day will be the greatest gift. If you would like to contribute to our Honeymoon trip to the Seychelles you can do use these bank coordinates:"
         :pounds "British Pounds"
         :title  "Contribute"}

-   :it {:gift   "La vostra presenza in questo giorno speciale sarà il regalo più importante.
-Se vorrete contribuire al nostro viaggio di nozze alle Seychelles potrete farlo usando queste coordinate bancarie:"
+   :it {:gift   "La vostra presenza in questo giorno speciale sarà il regalo più importante. Se vorrete contribuire al nostro viaggio di nozze alle Seychelles potrete farlo usando queste coordinate bancarie:"
         :pounds "Sterline"
         :title  "Contributo"}})


comments

comments

--- src/cljs/triboard/ai/strategies.cljs
+++ src/cljs/triboard/ai/strategies.cljs
@@ -10,8 +10,9 @@
 ;; We want to count the number of transitions available for the player

 (defn- eval-next-score-of
-  "Evaluate the score of a leaf turn by looking at its transition
-   In effect, it will look the score one level after"
+  "Perform a last minimax step on the next scores following the turn
+   * Allows to see one level deeper for simple scoring strategies
+   * While being fast (the transition does not need to be followed)"
   [ai {:keys [scores] :as turn} players]
   (minimax/minimax-step ai turn
     (fn [_ transition]