Fixed duplicate holidays

Fixed duplicate holidays

--- resources/languages/it/rules/time.clj
+++ resources/languages/it/rules/time.clj
@@ -154,70 +154,6 @@
   "immacolata concezione"
   #"(?i)(all')?immacolata( concezione)?"
   (month-day 12 8)
-
-  "santo stefano"
-  #"(?i)santo stefano"
-  (month-day 12 26)
-
-  "Mother's Day";second Sunday in May.
-  #"(?i)festa della mamma"
-  (intersect (day-of-week 7) (month 5) (cycle-nth-after :week 1 (month-day 5 1)))
-
-  "christmas"
-  #"(?i)((il )?giorno di )?natale"
-  (month-day 12 25)
-
-  "christmas eve"
-  #"(?i)(la )?vigilia di natale"
-  (month-day 12 24)
-
-  "new year's eve"
-  #"(?i)((la )?vigilia di capodanno|san silvestro)"
-  (month-day 12 31)
-
-  "new year's day"
-  #"(?i)(capodanno|primo dell' ?anno)"
-  (month-day 1 1)
-
-  "epifania"
-  #"(?i)(epifania|befana)"
-  (month-day 1 6)
-
-  "valentine's day"
-  #"(?i)san valentino"
-  (month-day 2 14)
-
-  "festa del papà"
-  #"(?i)festa del pap[aà]|(festa di )?san giuseppe"
-  (month-day 3 19)
-
-  "festa della liberazione"
-  #"(?i)((festa|anniversario) della|la) liberazione"
-  (month-day 4 25)
-
-  "festa del lavoro"
-  #"(?i)festa del lavoro|(festa|giorno) dei lavoratori"
-  (month-day 5 1)
-
-  "festa della repubblica"
-  #"(?i)festa della repubblica"
-  (month-day 6 2)
-
-  "ferragosto"
-  #"(?i)ferragosto|assunzione"
-  (month-day 8 15)
-
-  "halloween day"
-  #"(?i)hall?owe?en"
-  (month-day 10 31)
-
-  "ognissanti"
-  #"(?i)(tutti i |ognis)santi"
-  (month-day 11 1)
-
-  "commemorazione dei defunti"
-  #"(?i)(giorno dei|commemorazione dei) (morti|defunti)"
-  (month-day 11 2)

   "santo stefano"
   #"(?i)santo stefano"


Finish function doc strings

Finish function doc strings

--- src/themis/core.clj
+++ src/themis/core.clj
@@ -17,16 +17,24 @@
   [coordinate-vec (validation-fn t (navigate t coordinate-vec) opt-map)])

 (defn validate-vec
+  "Given a single validation query/rule,
+  pull apart the constituents and apply a `raw-validation`,
+  returning back the validation result vector"
   [t validation-vec]
   (let [[coordinates validations] validation-vec
         [validation-fn opt-map] validations
         opt-map (or opt-map {})]
     (raw-validation t coordinates validation-fn opt-map)))

-(defn validation-seq [t normalized-query]
+(defn validation-seq
+  "Create a lazy sequence of validating a given data structure
+  against the a normalized validation query vector/seq"
+  [t normalized-query]
   (map #(validate-vec t %) normalized-query))

 (defn validation
+  "Validate a data structure, `t`,
+  against a normalized validation query/rule-set"
   ([t normalized-query]
    ;; For some reason `doall` doesn't work here
    (apply hash-map (into [] (mapcat identity (validation-seq t normalized-query)))))


Aero is no longer in beta

Aero is no longer in beta

--- build.boot
+++ build.boot
@@ -29,7 +29,7 @@
    [com.cemerick/piggieback "0.2.1" :scope "test"]

    ;; Server deps
-   [aero "1.0.0-beta5"]
+   [aero "1.0.0"]
    [aleph "0.4.1"]
    [bidi "2.0.10"]
    [com.stuartsierra/component "0.3.1"]


Start 2.5.6-SNAPSHOT

Start 2.5.6-SNAPSHOT

--- build.boot
+++ build.boot
@@ -18,7 +18,7 @@
 (task-options!
   sift {:include #{#"\.jar$"}}
   pom {:project 'nightcode
-       :version "2.5.5"
+       :version "2.5.6-SNAPSHOT"
        :description "An IDE for Clojure"
        :url "https://github.com/oakes/Nightcode"
        :license {"Public Domain" "http://unlicense.org/UNLICENSE"}


move style and script transforms to bottom

--- src/timber/core.clj
+++ src/timber/core.clj
@@ -23,36 +23,41 @@
                         [:li :a] (html/content menu-name)
                         [:li :a] (html/set-attr :href menu-url)))

-(html/defsnippet extra-styles
-  "timber/templates/tags/link.html"
-  [:link]
+
+(defn extra-styles
+  "Get the first link tag in the template and clone it"
   [stylesheet-uris]
-  [:link] (html/clone-for [uri stylesheet-uris]
-                          [:link] (html/set-attr :href uri)))
+  (html/transform
+   (select/first-of-type :link "base.html")
+   [:link] (html/clone-for [uri stylesheet-uris]
+                           [:link] (html/set-attr :href uri))))

-(html/defsnippet extra-scripts
-  "timber/templates/tags/script.html"
-  [:script]
+
+(defn extra-scripts
+  "Get the first script tag in the template and clone it"
   [script-uris]
-  [:script] (html/clone-for [uri script-uris]
-                            [:script] (html/set-attr :src uri)))
+  (html/transform
+   (select/first-of-type :script "base.html")
+   [:script] (html/clone-for [uri script-uris]
+                             [:script] (html/set-attr :src uri))))

 (html/deftemplate
-  base-page
-  "timber/templates/base.html"
-  [{:keys [page-name brand asset-uri-path user-name main-menu
-           user-menu page-content extra-styles extra-scripts
-           ng-app] :as opts}]
+ base-page
+ "timber/templates/base.html"
+ [{:keys [page-name brand asset-uri-path user-name main-menu
+          user-menu page-content extra-styles extra-scripts
+          ng-app] :as opts}]

-  select/html            (html/set-attr :ng-app (or ng-app (str "")))
-  select/head            (html/append extra-styles)
-  select/body            (html/append extra-scripts)
+ select/html            (html/set-attr :ng-app (or ng-app (str "")))

-  select/title           (html/content page-name)
-  select/brand-title     (html/content (or brand page-name))
-  select/link-asset      (asset/transform-link asset-uri-path)
-  select/js-asset        (asset/transform-script-src asset-uri-path)
-  select/main-menu       (html/content main-menu)
-  select/user-menu       (html/content user-menu)
-  select/user-name       (html/content user-name)
-  select/content         (html/content page-content))
+ select/title           (html/content page-name)
+ select/brand-title     (html/content (or brand page-name))
+ select/link-asset      (asset/transform-link asset-uri-path)
+ select/js-asset        (asset/transform-script-src asset-uri-path)
+ select/main-menu       (html/content main-menu)
+ select/user-menu       (html/content user-menu)
+ select/user-name       (html/content user-name)
+ select/content         (html/content page-content)
+
+ select/head            (html/append extra-styles)
+ select/body            (html/append extra-scripts))


Define *in*, *out*, *err*

Define *in*, *out*, *err*

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -1,4 +1,22 @@
 (ns planck.io)
+
+(defonce
+  ^{:doc "Represents standard input for read operations."
+    :dynamic true}
+  *in*
+  nil)
+
+(defonce
+  ^{:doc "Represents standard output for print operations."
+    :dynamic true}
+  *out*
+  nil)
+
+(defonce
+  ^{:doc "Represents standard error for print operations."
+    :dynamic true}
+  *err*
+  nil)

 (defn slurp
   "Slurps a file"


remove duplicate calls to jail

remove duplicate calls to jail

--- src/status_im/native_module/impl/module.cljs
+++ src/status_im/native_module/impl/module.cljs
@@ -55,7 +55,7 @@
     (call-module
       (fn []
         (let [init-js (str js-res/status-js "I18n.locale = '" rn-dependencies/i18n.locale "';")]
-            (.initJail status init-js #(log/debug "jail initialized")))))))
+          (.initJail status init-js #(log/debug "jail initialized")))))))

 (defonce listener-initialized (atom false))

@@ -147,7 +147,7 @@
   (when status
     (call-module #(.parseJail status chat-id file callback))))

-(defn call-jail [{:keys [jail-id path params callback]}]
+(defn execute-call [{:keys [jail-id path params callback]}]
   (when status
     (call-module
       #(do
@@ -166,6 +166,51 @@
                              (log/debug (str "VM console(" type ") - " message)))
                            (callback r')))]
            (.callJail status jail-id (types/clj->json path) (types/clj->json params') cb))))))
+
+;; TODO(rasom): temporal solution, should be fixed on status-go side
+(def check-raw-calls-interval 400)
+(def interval-between-calls 100)
+;; contains all calls to jail before with duplicates
+(def raw-jail-calls (atom '()))
+;; contains only calls that passed duplication check
+(def jail-calls (atom '()))
+
+(defn remove-duplicate-calls
+  "Removes duplicates by [jail path] keys, remains the last one."
+  [[all-keys calls] {:keys [jail-id path] :as call}]
+  (if (contains? all-keys [jail-id path])
+    [all-keys calls]
+    [(conj all-keys [jail-id path])
+     (conj calls call)]))
+
+(defn check-raw-calls-loop!
+  "Only the last call with [jail path] key is added to jail-calls list
+  from raw-jail-calls"
+  []
+  (go-loop [_ nil]
+    (let [[_ new-calls] (reduce remove-duplicate-calls [#{} '()] @raw-jail-calls)]
+      (reset! raw-jail-calls '())
+      (swap! jail-calls (fn [old-calls]
+                           (concat new-calls old-calls))))
+    (recur (<! (timeout check-raw-calls-interval)))))
+
+(defn execute-calls-loop!
+  "Calls to jail are executed ne by one with interval-between-calls,
+  which reduces chances of response shuffling"
+  []
+  (go-loop [_ nil]
+    (let [next-call (last @jail-calls)]
+      (swap! jail-calls butlast)
+      (when next-call
+        (execute-call next-call)))
+    (recur (<! (timeout interval-between-calls)))))
+
+(check-raw-calls-loop!)
+(execute-calls-loop!)
+
+(defn call-jail [call]
+  (swap! raw-jail-calls conj call))
+;; TODO(rasom): end of sick magic, should be removed ^

 (defn call-function!
   [{:keys [chat-id function callback] :as opts}]


Fix tooltip position in gas input

Fix tooltip position in gas input

Fixes #10834

Signed-off-by: Gheorghe Pinzaru <742a0a3885ab52ea1795e48e261ec4223e194612@gmail.com>

--- src/status_im/ui/screens/signing/sheets.cljs
+++ src/status_im/ui/screens/signing/sheets.cljs
@@ -19,6 +19,7 @@
         [quo/text-input
          {:on-change-text  #(re-frame/dispatch [:signing.edit-fee.ui/edit-value :gas %])
           :label           (i18n/label :t/gas-limit)
+          :bottom-value    0
           :error           (:error gas-edit)
           :default-value   (:value gas-edit)
           :keyboard-type   :numeric
@@ -31,6 +32,7 @@
         [quo/text-input
          {:label           (i18n/label :t/gas-price)
           :on-change-text  #(re-frame/dispatch [:signing.edit-fee.ui/edit-value :gasPrice %])
+          :bottom-value    0
           :error           (:error gas-price-edit)
           :default-value   (:value gas-price-edit)
           :keyboard-type   :numeric


Add export and import of db.

Add export and import of db.

--- src/topiq/core.cljs
+++ src/topiq/core.cljs
@@ -94,7 +94,6 @@
     om/IRenderState
     (render-state [this {:keys [selected-topiq stage] :as state}]
       (let [user (get-in @stage [:config :user])
-            _ (println "NEW VAL" app)
             val (om/value app)]
         (cond (= (type val) replikativ.crdt.cdvcs.realize/Conflict) ;; TODO implement with protocol dispatch
               (do
@@ -218,6 +217,21 @@
    {:target (. js/document (getElementById "topiq-container"))}))

+;; prototype helpers to reimport DB on schema changes etc.
+;; TODO serialize datascript/DB properly with incognito
+(defn ^:export print-db []
+  (println (pr-str @val-atom)))
+
+(defn ^:export read-db [db-str]
+  (go
+    (.info js/console (<! (sc/transact stage ["eve@topiq.es" #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"]
+                                       '(fn [old params] (d/db-with old params))
+                                       (mapv (fn [datom] (into [:db/add] datom))
+                                             (read-string db-str)))))
+    (.info js/console (<! (sc/commit! stage {"eve@topiq.es" #{#uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"}})))))
+
+
+
 (comment
   ;; jack in figwheel cljs REPL
   (require 'figwheel-sidecar.repl-api)
@@ -231,6 +245,8 @@
   (get-in @stage ["banana@joe.com" #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5" :state :heads])

   (get-in @stage [:config])
+
+

   ;; recreate database
   (sc/create-cdvcs! stage
@@ -263,6 +279,4 @@
         (<! (timeout 100)))
       (def benchmark (- (js/Date.) start))))

-  (-> @stage :volatile :peer deref :volatile :store :state deref keys)
-
-  )
+  (-> @stage :volatile :peer deref :volatile :store :state deref keys))


optionally pass temp-file options to with-temp-files

--- plugins/matross/tasks/temp_file.clj
+++ plugins/matross/tasks/temp_file.clj
@@ -25,15 +25,19 @@
   "Evaluate the body with the symbols in `bindings` bound to temp file paths on the target machine. Once the
    body has been evaluated, the temp files are deleted from the target machine."

-  [conn bindings & body]
+  [conn & args]

-  (cond
-    (some #(= conn %1) bindings)
+  (let [[opts args] (if (map? (first args))
+                      [(first args) (rest args)]
+                      [nil args])
+        [bindings body] [(first args) (rest args)]]
+    (cond
+      (some #(= conn %1) bindings)
       (throw (IllegalArgumentException. "Collission between conn and tempfile bindings."))
-    :else
-      (let [get-tmpfile (fn [_] `(-> (run-task ~conn {:type :temp-file}) (get-in [:data :path])))]
+      :else
+      (let [get-tmpfile (fn [_] `(-> (run-task ~conn (merge ~opts {:type :temp-file})) (get-in [:data :path])))]
         `(let [~@(interleave bindings (map get-tmpfile bindings))
                cleanup# (str "/bin/rm -f " (clojure.string/join " " ~bindings))]
            (try ~@body
-             (finally
-               (run-task ~conn {:type :command :command cleanup#})))))))
+                (finally
+                  (run-task ~conn {:type :command :command cleanup#}))))))))


break a couple of line

break a couple of line

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -133,12 +133,14 @@
 ;;----------------------------------------

 (let [half-max-length (/ max-length 2)]
-  (def longer-whales (do-filter (str "length>" half-max-length) whales '(:length) #(> % half-max-length))))
+  (def longer-whales
+       (do-filter (str "length>" half-max-length) whales '(:length) #(> % half-max-length))))

 (insert *metamodel* longer-whales)

 (let [half-max-weight (/ max-weight 2)]
-  (def heavier-whales (do-filter (str "weight>" half-max-weight)  whales '(:weight) #(> % half-max-weight))))
+  (def heavier-whales
+       (do-filter (str "weight>" half-max-weight)  whales '(:weight) #(> % half-max-weight))))

 (insert *metamodel* heavier-whales)


implement line-chart refresh from data

implement line-chart refresh from data

--- src-cljs/frontend/components/insights/project.cljs
+++ src-cljs/frontend/components/insights/project.cljs
@@ -54,24 +54,32 @@

 (defn build-time-line-chart [builds owner]
   (reify
+    om/IDidUpdate
+    (did-update [_ _ _]
+      (let [chart (om/get-state owner :chart)
+            build-times (daily-median-build-time builds)]
+        (.load chart (clj->js {:x "date"
+                               :columns [(concat ["date"] (map first build-times))
+                                         (concat ["Median Build Time"] (map last build-times))]}))))
     om/IDidMount
     (did-mount [_]
       (let [el (om/get-node owner)
             build-times (daily-median-build-time builds)]
-        (js/c3.generate (clj->js {:bindto el
-                                  :padding {:top 10
-                                            :right 20}
-                                  :data {:x "date"
-                                         :columns [(concat ["date"] (map first build-times))
-                                                   (concat ["Median Build Time"] (map last build-times))]}
-                                  :legend {:hide true}
-                                  :grid {:y {:show true}}
-                                  :axis {:x {:padding {:left "0"}
-                                             :type "timeseries"
-                                             :tick {:format "%m/%d"}
-                                                    :fit "true"}
-                                         :y {:min 0
-                                             :tick {:format #(str (quot % 60000) "m")}}}}))))
+        (om/set-state! owner :chart
+                       (js/c3.generate (clj->js {:bindto el
+                                                 :padding {:top 10
+                                                           :right 20}
+                                                 :data {:x "date"
+                                                        :columns [(concat ["date"] (map first build-times))
+                                                                  (concat ["Median Build Time"] (map last build-times))]}
+                                                 :legend {:hide true}
+                                                 :grid {:y {:show true}}
+                                                 :axis {:x {:padding {:left "0"}
+                                                            :type "timeseries"
+                                                            :tick {:format "%m/%d"}
+                                                            :fit "true"}
+                                                        :y {:min 0
+                                                            :tick {:format #(str (quot % 60000) "m")}}}})))))
     om/IRender
     (render [_]
       (html


Add autocancel option to advanced settings

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -550,6 +550,14 @@
                               :blurb [:p
                                       "By default, we will build all the commits for this project. Once turned on, we will only build branches "
                                       "that have associated pull requests open. Note: For your default branch, we will always build all commits."]}))
+            ;; TODO remove the LD flag once shipped
+            (when (feature/enabled? :autocancel-builds)
+              (describe-flag {:flag :autocancel-builds
+                              :title "Auto-cancel builds"
+                              :blurb [:p
+                                      "With the exception of your default branch, we will automatically cancel any queued or running builds on "
+                                      "a branch when a newer build is triggered on that same branch. This feature will only apply to builds "
+                                      "triggered by pushes to GitHub."]}))
             (describe-flag {:flag :osx-code-signing-enabled
                             :title "Code Signing Support"
                             :blurb [:p


Remove duplicate entry on view app state.

--- src/uxbox/view.cljs
+++ src/uxbox/view.cljs
@@ -16,8 +16,7 @@
    :pages nil
    :page nil
    :flags #{:sitemap}
-   :shapes {}
-   :pages {}})
+   :shapes {}})

 (defn ^:export init
   []


use ints instead of floats for a couple of attributes -  I was seeing rounding issues

--- dada-demo/src/main/clojure/org/dada/demo/whales.clj
+++ dada-demo/src/main/clojure/org/dada/demo/whales.clj
@@ -9,6 +9,9 @@
  (:import
   [clojure.lang
    Keyword]
+  [java.math
+   BigDecimal
+   ]
   [java.util
    Collection
    Date
@@ -72,8 +75,8 @@
      ^{:tag String}                  reporter
      ^{:tag clojure.lang.Keyword :immutable true} type
      ^{:tag String}                  ocean
-     ^{:tag float}                   length
-     ^{:tag float}                   weight]
+     ^{:tag int}                     length
+     ^{:tag int}                     weight]
     (fn [^Integer lhs ^Integer rhs] (- (int lhs) (int rhs))))

 (def ^Model whales-model (model "Whales" whale-metadata))
@@ -321,8 +324,8 @@
        (rnd reporters)
        (rnd types)
        (rnd oceans)
-       (float (/ (rand-int max-length-x-100) 100))
-       (float (/ (rand-int max-weight-x-100) 100)))))
+       (int (/ (rand-int max-length-x-100) 100))
+       (int (/ (rand-int max-weight-x-100) 100)))))

 ;; (def some-whales
@@ -351,8 +354,8 @@
     [^{:tag int :primary-key true}   id
      ^{:tag int :version-key true}   version
      ^{:tag clojure.lang.Keyword :immutable true} type
-     ^{:tag float}                   length
-     ^{:tag float}                   weight
+     ^{:tag int}                     length
+     ^{:tag int}                     weight
      ^{:tag String}                  ocean
      ^{:tag int}                     ocean-area
      ^{:tag int}                     ocean-max-depth]
@@ -366,8 +369,8 @@
   (^int id [this] id)
   (^int version [this] version)
   (^clojure.lang.Keyword type [this] (.type whale))
-  (^float length [this] (.length whale))
-  (^float weight [this] (.weight whale))
+  (^int length [this] (.length whale))
+  (^int weight [this] (.weight whale))
   (^String ocean [this] (.id ocean))
   (^int ocean-area [this] (.area ocean))
   (^int ocean-max-depth [this] (.max-depth ocean)))


fixed failure action mapping

fixed failure action mapping

--- src/clj/swarmpit/docker/mapper/outbound.clj
+++ src/clj/swarmpit/docker/mapper/outbound.clj
@@ -72,7 +72,7 @@
   (let [deployment (:deployment service)]
     {:Parallelism    (:parallelism deployment)
      :Delay          (:delay deployment)
-     ::FailureAction (:failureAction deployment)}))
+     :FailureAction (:failureAction deployment)}))

 (defn ->service-image-registry
   [service registry]


fix player log

fix player log

--- src/cljs/foosball/locations/player-log.cljs
+++ src/cljs/foosball/locations/player-log.cljs
@@ -12,7 +12,6 @@
   (let [player-id (first args)]
     (data/ensure-player-data app)
     (om/update! app :player-log-player ())
-    (om/update! app :players nil)
     (om/update! app :player-log nil)
     (when player-id
       (do


Add :db.schema/version and :db.schema/attribute.

--- src/common/datomish/transact/bootstrap.cljc
+++ src/common/datomish/transact/bootstrap.cljc
@@ -38,6 +38,15 @@
                           :db/cardinality :db.cardinality/one}
    :db.alter/attribute   {:db/valueType   :db.type/ref
                           :db/cardinality :db.cardinality/many}
+
+   :db.schema/version    {:db/valueType   :db.type/long
+                          :db/cardinality :db.cardinality/one}
+
+   ;; unique-value because an attribute can only belong to a single
+   ;; schema fragment.
+   :db.schema/attribute  {:db/valueType   :db.type/ref
+                          :db/unique      :db.unique/value
+                          :db/cardinality :db.cardinality/many}
    })

 (def idents
@@ -76,6 +85,8 @@
    :db.unique/value      33
    :db.unique/identity   34
    :db/doc               35
+   :db.schema/version    36    ; Fragment -> version.
+   :db.schema/attribute  37    ; Fragment -> attribute.
    })

 (def parts


Fix arity bug in initialize-pod-watch (#1220)

--- scheduler/src/cook/kubernetes/api.clj
+++ scheduler/src/cook/kubernetes/api.clj
@@ -135,7 +135,7 @@
             (log/error e "Error during watch"))
           (finally
             (.close watch)
-            (initialize-pod-watch api-client all-pods-atom cook-pod-callback))))))))
+            (initialize-pod-watch api-client compute-cluster-name all-pods-atom cook-pod-callback))))))))

 (defn initialize-node-watch
   "Initialize the node watch. This fills current-nodes-atom with data and invokes the callback on pod changes."


update component state management

update component state management

--- src/cljs/wombats_web_client/components/navbar.cljs
+++ src/cljs/wombats_web_client/components/navbar.cljs
@@ -2,8 +2,6 @@
   (:require [re-frame.core :as re-frame]
             [reagent.core :as reagent]
             [wombats-web-client.constants.urls :refer [github-signin-url]]))
-
-(def selected (reagent/atom "open-games"))

 (defn login []
   [:a {:href github-signin-url} "Login"])
@@ -12,39 +10,44 @@
   [:a {:href "#/"} [:img.wombat-logo {:src "/images/img-logo-horizontal.svg"}]])

 (defn nav-link
-  [{:keys [id class on-click link title]}]
+  [{:keys [id class on-click link title current]}]
   [:li {:id id
         :class class
         :on-click on-click}
-   [:a {:class (if (= @selected id) "active")
+   [:a {:class (if (= current id) "active")
         :href link} title]])

 (defn nav-links
-  [user]
-  [:ul.navbar
-   [nav-link {:id "open-games"
-              :class "regular-link"
-              :on-click #(reset! selected "open-games")
-              :link "#/"
-              :title "OPEN GAMES"}]
-   [nav-link {:id "my-games"
-              :class "regular-link"
-              :on-click #(reset! selected "my-games")
-              :link "#/my-games"
-              :title "MY GAMES"}]
-   (if (nil? user)
-     [:li {:class "regular-link account"}
-      [:a {:href github-signin-url} "LOGIN"]]
-     [nav-link {:id "account"
-                :class "regular-link account"
-                :on-click #(reset! selected "account")
-                :link "#/account"
-                :title "MY WOMBATS"}])])
+  [user state]
+  (let [current-selected (get @state :selected)]
+    [:ul.navbar
+     [nav-link {:id "open-games"
+                :class "regular-link"
+                :on-click #(swap! state assoc :selected "open-games")
+                :link "#/"
+                :title "OPEN GAMES"
+                :current current-selected}]
+     [nav-link {:id "my-games"
+                :class "regular-link"
+                :on-click #(swap! state assoc :selected "my-games")
+                :link "#/my-games"
+                :title "MY GAMES"
+                :current current-selected}]
+     (if-not user
+       [:li {:class "regular-link account"}
+        [:a {:href github-signin-url} "LOGIN"]]
+       [nav-link {:id "account"
+                  :class "regular-link account"
+                  :on-click #(swap! state assoc :selected "account")
+                  :link "#/account"
+                  :title "MY WOMBATS"
+                  :current current-selected}])]))

 (defn root
   []
-  (let [current-user (re-frame/subscribe [:current-user])]
+  (let [current-user (re-frame/subscribe [:current-user])
+        state (reagent/atom {:selected "open-games"})]
     (fn []
       [:div.navbar-component
        [wombat-logo]
-       [nav-links @current-user]])))
+       [nav-links @current-user state]])))


Return driver exceptions as is

Return driver exceptions as is

--- src/clojure/clojurewerkz/cassaforte/conversion.clj
+++ src/clojure/clojurewerkz/cassaforte/conversion.clj
@@ -49,8 +49,8 @@
     (into [] input))

   DriverException
-  (to-clj [^DriverException error]
-    (Exception. (.getMessage error))))
+  (to-clj [^DriverException e]
+    e))

 ;;
 ;; C* Types


require enlive-html and the clojure.string namespace

--- src/watney/core.clj
+++ src/watney/core.clj
@@ -1,5 +1,6 @@
 (ns watney.core
-  (:require [net.cgrand.enlive-html :as html]))
+  (:require [net.cgrand.enlive-html :as html]
+            [clojure.string :as str]))

 (defn ^:private parse
   "Parse the given HTML using Enlive and return the tree"


(PE-2865) Explicit not nil preconditions

--- src/main/clojure/puppetlabs/jvm/certificate_authority/core.clj
+++ src/main/clojure/puppetlabs/jvm/certificate_authority/core.clj
@@ -84,7 +84,7 @@

   See `obj->pem!` to PEM-encode a certification signing request."
   [pem]
-  {:pre  [pem]
+  {:pre  [(not (nil? pem))]
    :post [(instance? PKCS10CertificationRequest %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/pemToCertificationRequest r)))
@@ -102,7 +102,7 @@
   PEM-encoded objects and returns a collection of objects of the corresponding
   type from `java.security`."
   [pem]
-  {:pre  [pem]
+  {:pre  [(not (nil? pem))]
    :post [(coll? %)]}
   (with-open [r (reader pem)]
     (let [objs (seq (CertificateUtils/pemToObjects r))]
@@ -119,8 +119,8 @@

   `pem`: the file path to write the PEM output to (or any other type supported by clojure's `writer`)"
   [obj pem]
-  {:pre  [obj
-          pem]
+  {:pre  [(not (nil? obj))
+          (not (nil? pem))]
    :post [(nil? %)]}
   (with-open [w (writer pem)]
     (CertificateUtils/writeToPEM obj w)))
@@ -129,7 +129,7 @@
   "Given the path to a PEM file (or some other object supported by clojure's `reader`),
   decodes the contents into a collection of `X509Certificate` instances."
   [pem]
-  {:pre  [pem]
+  {:pre  [(not (nil? pem))]
    :post [(every? (fn [x] (instance? X509Certificate x)) %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/pemToCerts r)))
@@ -137,7 +137,7 @@
 (defn obj->private-key
   "Decodes the given object (read from a .PEM file via `pem->objs`) into an instance of `PrivateKey`."
   [obj]
-  {:pre  [obj]
+  {:pre  [(not (nil? obj))]
    :post [(instance? PrivateKey %)]}
   (CertificateUtils/objectToPrivateKey obj))

@@ -145,7 +145,7 @@
   "Given the path to a PEM file (or some other object supported by clojure's `reader`),
   decodes the contents into a collection of `PrivateKey` instances."
   [pem]
-  {:pre  [pem]
+  {:pre  [(not (nil? pem))]
    :post [(every? (fn [x] (instance? PrivateKey x)) %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/pemToPrivateKeys r)))
@@ -156,7 +156,7 @@
   are found in the PEM.
   See `key->pem!` and `pem->private-keys` to write/read keys."
   [pem]
-  {:pre  [pem]
+  {:pre  [(not (nil? pem))]
    :post [(instance? PrivateKey %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/pemToPrivateKey r)))
@@ -169,7 +169,7 @@
   `pem`: the file path to write the PEM output to (or some other object supported by clojure's `writer`)"
   [key pem]
   {:pre  [(instance? Key key)
-          pem]
+          (not (nil? pem))]
    :post [(nil? %)]}
   (with-open [w (writer pem)]
     (CertificateUtils/writeToPEM key w)))
@@ -198,7 +198,7 @@
   [keystore prefix pem]
   {:pre  [(instance? KeyStore keystore)
           (string? prefix)
-          pem]
+          (not (nil? pem))]
    :post [(instance? KeyStore %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/associateCertsFromReader keystore prefix r)))
@@ -240,7 +240,7 @@
   [keystore alias pem-private-key pw pem-cert]
   {:pre  [(instance? KeyStore keystore)
           (string? alias)
-          pem-private-key
+          (not (nil? pem-private-key))
           (string? pw)]
    :post [(instance? KeyStore %)]}
   (with-open [key-reader  (reader pem-private-key)
@@ -265,9 +265,9 @@
   `:keystore-pw` - a string containing a dynamically generated password for the KeyStore
   `:truststore`  - an instance of KeyStore containing the CA cert."
   [cert private-key ca-cert]
-  {:pre  [cert
-          private-key
-          ca-cert]
+  {:pre  [(not (nil? cert))
+          (not (nil? private-key))
+          (not (nil? ca-cert))]
    :post [(map? %)
           (= #{:keystore :truststore :keystore-pw} (-> % keys set))
           (instance? KeyStore (:keystore %))
@@ -310,9 +310,9 @@

   Returns the SSLContext instance."
   [cert private-key ca-cert]
-  {:pre  [cert
-          private-key
-          ca-cert]
+  {:pre  [(not (nil? cert))
+          (not (nil? private-key))
+          (not (nil? ca-cert))]
    :post [(instance? SSLContext %)]}
   (with-open [cert-reader    (reader cert)
               key-reader     (reader private-key)


use a promise instead of an asyc channel

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -18,25 +18,21 @@
    [strictly-specking-standalone.ansi-util :refer [with-color-when color]]   )
   (:import [clojure.lang IExceptionInfo]))

-(defn eval-js [{:keys [browser-callbacks repl-eval-timeout] :as figwheel-server} js]
-  (let [out (chan)
-        repl-timeout (or repl-eval-timeout 8000)
-        callback (fn [result]
-                   (put! out result)
-                   (go
-                     (<! (timeout 2000))
-                     (close! out)))]
-    (server/send-message-with-callback figwheel-server
-                                       (:build-id figwheel-server)
-                                       {:msg-name :repl-eval
-                                        :code js}
-                                       callback)
-    (let [[v ch] (alts!! [out (timeout repl-timeout)])]
-      (if (= ch out)
-        v
-        {:status :exception
-         :value "Eval timed out!"
-         :stacktrace "No stacktrace available."}))))
+(let [timeout-val (Object.)]
+  (defn eval-js [{:keys [browser-callbacks repl-eval-timeout] :as figwheel-server} js]
+    (let [out (promise)
+          repl-timeout (or repl-eval-timeout 8000)]
+      (server/send-message-with-callback figwheel-server
+                                         (:build-id figwheel-server)
+                                         {:msg-name :repl-eval
+                                          :code js}
+                                         (partial deliver out))
+      (let [v (deref out repl-timeout timeout-val)]
+        (if (= timeout-val v)
+          {:status :exception
+           :value "Eval timed out!"
+           :stacktrace "No stacktrace available."}
+          v)))))

 (defn connection-available?
   [figwheel-server build-id]


Changed syntax

Changed syntax


tweak

tweak

--- labs/architecture-examples/om/src/todomvc/item.cljs
+++ labs/architecture-examples/om/src/todomvc/item.cljs
@@ -53,9 +53,10 @@
     (did-update [_ _ _ _]
       (when (and (:editing todo)
                  (om/get-state owner :needs-focus))
-        (let [node (om/get-node owner "editField")]
+        (let [node (om/get-node owner "editField")
+              len  (.. node -value -length)]
           (.focus node)
-          (.setSelectionRange node (.. node -value -length) (.. node -value -length)))
+          (.setSelectionRange node len len))
         (om/set-state! owner :needs-focus nil)))
     om/IRender
     (render [_]


Separate new, close and change in timeline code

--- src/main/clojure/pdok/featured/timeline.clj
+++ src/main/clojure/pdok/featured/timeline.clj
@@ -341,50 +341,59 @@
     (let [[collection id] (feature-key feature)
           batched-new (batched new-batch flush-fn)
           cache-batched-new (with-cache feature-cache batched-new cache-store-key cache-value)
-          cache-batched-update (batched-updater this)
           cached-get-current (use-cache feature-cache cache-use-key)
-          batched-append-changelog (batched changelog-batch flush-fn)]
-      (if-let [current (cached-get-current collection id)]
-        (when (util/uuid> (:version feature) (:_version current))
-          (let [new-current (merge current feature)]
-            (if (= (:action feature) :close)
-              (let [closed-or-new-current (sync-valid-to new-current feature)]
-                (cache-batched-update (:_version current) (:_valid_from current)
-                                      (:_valid_to current) closed-or-new-current)
-                (batched-append-changelog (changelog-close-entry (:_version current) closed-or-new-current)))
-              (if (t/before? (:_valid_from current) (:validity feature))
-                (let [closed-current (sync-valid-to current feature)
-                      ;; reset valid-to for new-current.
-                      new-current+ (reset-valid-to (sync-valid-from new-current feature))]
-                  (cache-batched-update (:_version current) (:_valid_from current)
-                                        (:_valid_to current) closed-current)
-                  (cache-batched-new new-current+)
-                  (batched-append-changelog (changelog-close-entry (:_version current) closed-current))
-                  (batched-append-changelog (changelog-new-entry new-current+)))
-                (let [new-current+ (reset-valid-to (sync-valid-from new-current feature))]
-                  ;; reset valid-to because it might be closed because of nested features.
-                  (cache-batched-update (:_version current) (:_valid_from current)
-                                        (:_valid_to current) new-current+)
-                  (batched-append-changelog (changelog-change-entry (:_version current) new-current+)))))))
+          batched-append-changelog (batched changelog-batch flush-fn)
+          current (cached-get-current collection id)]
+      (when (not current) ;; Check idempotency
         (let [nw (sync-valid-from (merge (init-root collection id) feature) feature)]
           (cache-batched-new nw)
           (batched-append-changelog (changelog-new-entry nw))))))
   (proj/change-feature [this feature]
-    ;; change can be the same, because a new nested feature validity change will also result in a new validity
-    ;(println "CHANGE")
-    (proj/new-feature this feature))
+    (let [[collection id] (feature-key feature)
+          batched-new (batched new-batch flush-fn)
+          cache-batched-new (with-cache feature-cache batched-new cache-store-key cache-value)
+          cache-batched-update (batched-updater this)
+          cached-get-current (use-cache feature-cache cache-use-key)
+          batched-append-changelog (batched changelog-batch flush-fn)
+          current (cached-get-current collection id)]
+      (when (and current (util/uuid> (:version feature) (:_version current))) ;; Check idempotency
+        (let [new-current (merge current feature)]
+          (if (t/before? (:_valid_from current) (:validity feature))
+            (let [closed-current (sync-valid-to current feature)
+                  ;; reset valid-to for new-current.
+                  new-current+ (reset-valid-to (sync-valid-from new-current feature))]
+              (cache-batched-update (:_version current) (:_valid_from current)
+                                    (:_valid_to current) closed-current)
+              (cache-batched-new new-current+)
+              (batched-append-changelog (changelog-close-entry (:_version current) closed-current))
+              (batched-append-changelog (changelog-new-entry new-current+)))
+            (let [new-current+ (reset-valid-to (sync-valid-from new-current feature))]
+              ;; reset valid-to because it might be closed because of nested features.
+              (cache-batched-update (:_version current) (:_valid_from current)
+                                    (:_valid_to current) new-current+)
+              (batched-append-changelog (changelog-change-entry (:_version current) new-current+))))))))
   (proj/close-feature [this feature]
-    (proj/new-feature this feature))
+    (let [[collection id] (feature-key feature)
+          cache-batched-update (batched-updater this)
+          cached-get-current (use-cache feature-cache cache-use-key)
+          batched-append-changelog (batched changelog-batch flush-fn)
+          current (cached-get-current collection id)]
+      (when (and current (util/uuid> (:version feature) (:_version current))) ;; Check idempotency
+        (let [new-current (merge current feature)
+              closed-or-new-current (sync-valid-to new-current feature)]
+          (cache-batched-update (:_version current) (:_valid_from current)
+                                (:_valid_to current) closed-or-new-current)
+          (batched-append-changelog (changelog-close-entry (:_version current) closed-or-new-current))))))
   (proj/delete-feature [this feature]
     (let [[collection id] (feature-key feature)
           cache-batched-delete (batched-deleter this)
           cached-get-current (use-cache feature-cache cache-use-key)
-          batched-append-changelog (batched changelog-batch flush-fn)]
-      (when-let [current (cached-get-current collection id)]
-        (when (util/uuid> (:version feature) (:_version current))
-          (cache-batched-delete current)
-          (doseq [v (:_all_versions current)] ;; TODO is all versions still necessary?
-            (batched-append-changelog (changelog-delete-entry (:_collection current) (:_id current) v)))))))
+          batched-append-changelog (batched changelog-batch flush-fn)
+          current (cached-get-current collection id)]
+      (when (and current (util/uuid> (:version feature) (:_version current))) ;; Check idempotency
+        (cache-batched-delete current)
+        (doseq [v (:_all_versions current)] ;; TODO is all versions still necessary?
+          (batched-append-changelog (changelog-delete-entry (:_collection current) (:_id current) v))))))
   (proj/accept? [_ feature] true)
   (proj/close [this]
     (proj/flush this)


Handle "fixed" job status

Handle "fixed" job status

--- src-cljs/frontend/send.cljs
+++ src-cljs/frontend/send.cljs
@@ -28,7 +28,8 @@
     ch))

 (defn adapt-to-job [job-response]
-  (let [status->job-run-status {"success" :job-run-status/succeeded
+  (let [status->job-run-status {"fixed" :job-run-status/succeeded
+                                "success" :job-run-status/succeeded
                                 "failed" :job-run-status/failed
                                 "canceled" :job-run-status/canceled
                                 "running" :job-run-status/running


Empty nil test

Empty nil test


hide command button if there are no commands

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/chat/views/input/input.cljs
+++ src/status_im/chat/views/input/input.cljs
@@ -151,14 +151,16 @@
         [seq-input {:command-width   width
                     :container-width container-width}]]])))

-(defn commands-button []
-  [react/touchable-highlight
-   {:on-press            #(do (re-frame/dispatch [:set-chat-input-text constants/command-char])
-                              (re-frame/dispatch [:chat-input-focus :input-ref]))
-    :accessibility-label :chat-commands-button}
-   [react/view
-    [vi/icon :icons/input-commands {:container-style style/input-commands-icon
-                                    :color           :dark}]]])
+(defview commands-button []
+  (letsubs [commands-responses [:get-available-commands-responses]]
+    (when (seq commands-responses)
+      [react/touchable-highlight
+       {:on-press            #(do (re-frame/dispatch [:set-chat-input-text constants/command-char])
+                                  (re-frame/dispatch [:chat-input-focus :input-ref]))
+        :accessibility-label :chat-commands-button}
+       [react/view
+        [vi/icon :icons/input-commands {:container-style style/input-commands-icon
+                                        :color           :dark}]]])))

 (defview input-container []
   (letsubs [margin     [:chat-input-margin]


Implement morphic (partially)

Implement morphic (partially)

--- src-cljs/cljs_workspace/om_morph.cljs
+++ src-cljs/cljs_workspace/om_morph.cljs
@@ -7,7 +7,7 @@
             [om.dom :as dom :include-macros true]
             [goog.style :as gstyle]
             [goog.dom :as gdom]
-            [cljs-workspace.draggable :as draggable]
+            [cljs-workspace.draggable :as draggable :refer [clicked-morph]]
             ; [clojure.browser.repl :as repl]
             )
   (:import [goog.events EventType]))
@@ -92,7 +92,7 @@
 (defn handle-input [e owner app]
   (let [span (om/get-node owner "myInput")]
     (prn (.-innerText span))
-    (om/update! app [:morph :TextString] (.-innerText span))))
+    (om/update! app [:morph :TextString] (.-innerText span) :update)))

 (defn save-input [e owner app]
   (prn (.-key e))
@@ -101,7 +101,7 @@
 (defn create-text-node [app owner]
     (dom/div #js {:className "visible Selection"
                   :contentEditable true
-                  :onMouseDown #(swap! clicked-morph (@app :id))
+                  :onMouseDown #(swap! clicked-morph (fn [_] @app :id))
                   :onInput #(handle-input % owner app)
                   ; :onKeyDown #(when (.-metaKey %) (save-input % owner app))} (dom/span #js {
                     :ref "myInput"} (get-in app [:morph :TextString])))


flesh out a right-click menu

flesh out a right-click menu

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -70,4 +70,16 @@
                  [:object
                   (common/icon :tool-line)
                   [:span "Line"]]]
-                [:div.radial-menu-nub]]]]))))
+                [:div.radial-menu-nub]]
+               [:div.right-click-menu
+                [:button "Cut"]
+                [:button "Copy"]
+                [:button "Paste"]
+                [:hr]
+                [:button "Align"]
+                [:button "Transform"]
+                [:button "Distribute"]
+                [:hr]
+                [:button "Lock"]
+                [:button "Group"]
+                [:button "Arrange"]]]]))))


Formatting change

Formatting change

missing space

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -1123,11 +1123,11 @@
   (do
     (println (str "*******COLTYPE:" column-type ":"))
     (cond
-    (= column-type "integer")                     "INTEGER"
-    (= column-type"character")                    "TEXT"
-    (= column-type"character varying")            "TEXT"
-
-    :else                                         "integer"
+    (= column-type "integer")                      "INTEGER"
+    (= column-type "character")                    "TEXT"
+    (= column-type "character varying")            "TEXT"
+
+    :else                                          "integer"
     )
   ))


Try a workaround due to the unavailability of libc on Windows

--- src/overtone/sc/machinery/server/native.clj
+++ src/overtone/sc/machinery/server/native.clj
@@ -18,6 +18,8 @@
 (declare world-options)
 (declare reply-callback)
 (declare sound-buffer)
+
+(defn fflush [_] nil)

 (defonce __LOAD_SCSYNTH_NATIVE_LIB__
   (do
@@ -158,8 +160,10 @@
           (world-send-packet World_SendPacket [void* i32 byte* reply-callback] byte)
           (world-copy-sound-buffer World_CopySndBuf [void* i32 sound-buffer* byte byte*] i32)))

-      (loadlib libc)
+      (when-not (windows-os?)
+        (loadlib libc))
       (loadlib lib-scsynth)
+
       (defonce flusher (at-at/every 500 #(fflush nil) INTERNAL-POOL :desc "Flush stdout")))))

 (defn flush-all


Fixed chat log to show most recent lines, not oldest.


Updated Kibit version

Updated Kibit version

--- link/.lein/profiles.clj
+++ link/.lein/profiles.clj
@@ -2,7 +2,7 @@
         :plugins [[cider/cider-nrepl "0.8.2"]
                   [lein-pprint "1.1.1"]
                   [lein-bikeshed "0.1.7"]
-                  [lein-kibit "0.0.8"]]
+                  [lein-kibit "0.1.2"]]
         :source-paths ["/home/vagrant/.lein/src"]
         :injections [;; humane-test-output makes clojure.test output more better
                      (require 'pjstadig.humane-test-output)


small fix to avoid holding onto head.

small fix to avoid holding onto head.

--- suite/src/cortex/suite/classification.clj
+++ suite/src/cortex/suite/classification.clj
@@ -91,7 +91,9 @@
                                   [data (label->vec label)])
                                 %)
          cv-epoch-seq (map seq-transform-fn cv-epoch-seq)
-         holdout-epoch-seq (map seq-transform-fn holdout-epoch-seq)
+         holdout-epoch-seq (if (identical? cv-epoch-seq holdout-epoch-seq)
+                             cv-epoch-seq
+                             (map seq-transform-fn holdout-epoch-seq))
          training-epoch-seq (map seq-transform-fn training-epoch-seq)
          dataset (ds/create-infinite-dataset [[:data data-shape]
                                               [:labels (count class-names)]]


[CS] Remove tracing on a fn called once at startup

--- src/vip/data_processor/validation/csv/file_set.clj
+++ src/vip/data_processor/validation/csv/file_set.clj
@@ -2,8 +2,7 @@
   (:require [vip.data-processor.validation.csv :as csv]
             [vip.data-processor.validation.data-spec :as data-spec]
             [clojure.string :as str]
-            [clojure.walk :as walk]
-            [com.climate.newrelic.trace :refer [defn-traced]]))
+            [clojure.walk :as walk]))

 (defn- build-dependency-pred [ctx-sym dependencies]
   (walk/postwalk
@@ -162,7 +161,7 @@
     (validator ctx)
     ctx))

-(defn-traced validate-dependencies
+(defn validate-dependencies
   "Create a validator that validates that the dependencies of each
   file included in the context is met. file-dependencies should be
   built with build-dependencies."


copy full address when signing tx

copy full address when signing tx

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/signing/views.cljs
+++ src/status_im/ui/screens/signing/views.cljs
@@ -37,7 +37,7 @@

 (defn contact-item [title contact]
   [copyable-text/copyable-text-view
-   {:copied-text (displayed-name contact)}
+   {:copied-text (:address contact)}
    [quo/list-item
     {:title              title
      :title-prefix-width 45


CMR-3309: Removed check for existing index alias

--- elastic-utils-lib/src/cmr/elastic_utils/index_util.clj
+++ elastic-utils-lib/src/cmr/elastic_utils/index_util.clj
@@ -200,6 +200,4 @@
 (defn create-index-alias
   "Creates the alias for the collections index if it does not already exist."
   [conn index alias]
-  (let [aliases (esi/get-aliases conn index)]
-    (when-not (seq (:aliases aliases))
-     (esi/update-aliases conn [{:add {:index index :alias alias}}]))))
+  (esi/update-aliases conn [{:add {:index index :alias alias}}]))


enforce paging on bulk denorm tests

enforce paging on bulk denorm tests

--- test/er_cassandra/model/alia/relationship_test.clj
+++ test/er_cassandra/model/alia/relationship_test.clj
@@ -156,7 +156,10 @@
         sbrs (map (fn [sbid v] {:idb sbid :value v}) sbids (iterate inc 1))
         pstep (+ (quot bcnt acnt) (if (> (mod bcnt acnt) 0) 1 0))
         ;; bcnt records divided into acnt partitions
-        sbrs-parts (partition pstep pstep nil sbrs)]
+        sbrs-parts (partition pstep pstep nil sbrs)
+
+        ;; make sure we page
+        fetch-size (max 1 (quot bcnt 10))]

     (testing "write initial records"
       (let [trs (flatten
@@ -183,7 +186,12 @@
             a-denorms (->> isars
                            (s/buffer 5)
                            (s/map (fn [isar]
-                                    (rel/denormalize cassandra sa isar :upsert (ts/default-timestamp-opt))))
+                                    (rel/denormalize cassandra
+                                                     sa
+                                                     isar
+                                                     :upsert
+                                                     (ts/default-timestamp-opt
+                                                      {:fetch-size fetch-size}))))
                            (s/realize-each)
                            (s/reduce conj [])
                            deref)
@@ -203,7 +211,12 @@
             b-denorms (->> isbrs
                            (s/buffer 5)
                            (s/map (fn [isbr]
-                                    (rel/denormalize cassandra sb isbr :upsert (ts/default-timestamp-opt))))
+                                    (rel/denormalize cassandra
+                                                     sb
+                                                     isbr
+                                                     :upsert
+                                                     (ts/default-timestamp-opt
+                                                      {:fetch-size fetch-size}))))
                            (s/realize-each)
                            (s/reduce conj [])
                            deref)
@@ -228,13 +241,23 @@
             a-denorms-d (->> isars
                              (s/buffer 5)
                              (s/map (fn [isar]
-                                      (rel/denormalize cassandra sa isar :upsert (ts/default-timestamp-opt))))
+                                      (rel/denormalize cassandra
+                                                       sa
+                                                       isar
+                                                       :upsert
+                                                       (ts/default-timestamp-opt
+                                                        {:fetch-size fetch-size}))))
                              (s/realize-each)
                              (s/reduce conj []))
             b-denorms-d (->> isbrs
                              (s/buffer 5)
                              (s/map (fn [isbr]
-                                      (rel/denormalize cassandra sb isbr :upsert (ts/default-timestamp-opt))))
+                                      (rel/denormalize cassandra
+                                                       sb
+                                                       isbr
+                                                       :upsert
+                                                       (ts/default-timestamp-opt
+                                                        {:fetch-size fetch-size}))))
                              (s/realize-each)
                              (s/reduce conj []))

@@ -248,9 +271,7 @@

         (is (= (* acnt bcnt) (count ftr)))
         (is (= (* 3 acnt bcnt) (->> ftr (map :factor) (reduce +))))
-        (is (= (* acnt (- (* (/ (+ 2 bcnt) 2) (+ 3 bcnt)) 3)) (->> ftr (map :value) (reduce +))))))
-
-    ))
+        (is (= (* acnt (- (* (/ (+ 2 bcnt) 2) (+ 3 bcnt)) 3)) (->> ftr (map :value) (reduce +))))))))


Remove unused def

Remove unused def

--- test/github_changelog/formatters/markdown_test.clj
+++ test/github_changelog/formatters/markdown_test.clj
@@ -26,7 +26,6 @@

 (def expected-change (str "new something " (markdown/link "#1" "http://example.com/")))

-(def grouped (group-by :scope [change change]))
 (def expected-scope (markdown/emphasis "scope:"))
 (def expected-changes (join (map markdown/li [expected-change expected-change])))


Fix bug

Fix bug

--- src/antlion_clojure/bot.clj
+++ src/antlion_clojure/bot.clj
@@ -437,7 +437,7 @@
             channel-id
             last-state
             (> max-ppm last-state)
-            (< (:value co2) max-ppm))
+            (> (:value co2) max-ppm))
       (dynamodb/set-lemming-last-state co2)
       (slack/reaction! slack
         (map->Payload


Fix typo.

Fix typo.

--- test/workshop/jobs/challenge_6_0_test.clj
+++ test/workshop/jobs/challenge_6_0_test.clj
@@ -35,7 +35,7 @@
 ;; http://www.onyxplatform.org/docs/user-guide/latest/triggers.html

 ;; You'll notice that in this example, we use more stateful constructs like
-;; atoms and promises. Some of this is used to coordindate knowledge of
+;; atoms and promises. Some of this is used to coordinate knowledge of
 ;; completion. We'll explain what we're doing in each step for this challenge,
 ;; since we understand that it increases the level of complexity as a learner.
 ;; If you get stuck reading any particular part, keep moving. You might see


Use a mutable test file in root dir

Use a mutable test file in root dir

--- test/yetibot/core/test/config_mutable.clj
+++ test/yetibot/core/test/config_mutable.clj
@@ -5,7 +5,7 @@
     [schema.core :as s]
     [clojure.test :refer :all]))

-(def test-config-path "config/test-config-mutable.edn")
+(def test-config-path "test-config-mutable.edn")

 (defn wrap [f]
   ;; ensure config exists


Cursors!

Cursors!

--- src/aurora/interpreter.cljs
+++ src/aurora/interpreter.cljs
@@ -1,6 +1,8 @@
 (ns aurora.interpreter)

 ;; interpreter
+
+(defrecord Cursor [path value])

 (defn run-pipe [program node inputs stack]
   (let [vars #js {}
@@ -24,18 +26,22 @@
     :ref (run-ref program node inputs stack)))

 (defn run-data [program node inputs stack]
+  (assert (empty? inputs))
+  (Cursor. [] (run-data* program node inputs stack)))
+
+(defn run-data* [program node inputs stack]
   (case (:kind node)
     :value (:value node)
     :vector (into []
                   (for [value (:value node)]
-                    (run-data program value inputs stack)))
+                    (run-data* program value inputs stack)))
     :map (into {}
                (for [[key value] (:value node)]
-                 [(run-data program key inputs stack) (run-data program value inputs stack)]))))
+                 [(run-data* program key inputs stack) (run-data* program value inputs stack)]))))

 (defn run-ref [program node inputs stack]
   (case (:kind node)
-    :cljs (apply (:fn node) inputs)
+    :cljs (Cursor. [] (apply (:fn node) (map :value inputs)))
     :pipe (run-pipe program (get program (:id node)) inputs stack)))

 (defrecord MatchFailure [])
@@ -50,31 +56,31 @@
       (if-let [[{:keys [pattern inputs node]} & branches] (seq branches)]
         (try
           (let [vars #js {}]
-            (run-match-pattern program pattern input stack vars)
+            (run-match-pattern program pattern (:path input) (:value input) stack vars)
             (run-node program node (map #(aget vars %) inputs) stack))
           (catch MatchFailure _
             (recur branches)))
         (throw (MatchFailure.))))))

-(defn run-match-pattern [program pattern input stack vars]
+(defn run-match-pattern [program pattern input-path input-value stack vars]
   (condp = (:type pattern)
     :match/any nil
-    :match/bind (do (aset vars (:var pattern) input)
-                  (run-match-pattern program (:pattern pattern) input stack vars))
+    :match/bind (do (aset vars (:var pattern) (Cursor. input-path input-value))
+                  (run-match-pattern program (:pattern pattern) input-path input-value stack vars))
     :data (case (:kind pattern)
-            :value (check (= input (:value pattern)))
+            :value (check (= input-value (:value pattern)))
             :vector (let [value (:value pattern)]
-                      (check (vector? input))
-                      (check (= (count input) (count value)))
+                      (check (vector? input-value))
+                      (check (= (count input-value) (count value)))
                       (dotimes [i (count value)]
-                        (run-match-pattern program (nth value i) (nth input i) stack vars)))
+                        (run-match-pattern program (nth value i) (conj input-path i) (nth input-value i) stack vars)))
             :map (let [value (:value pattern)]
-                   (check (map? input))
+                   (check (map? input-value))
                    (doseq [key-pattern (keys value)]
                      (let [key (:value key-pattern)]
-                       (check (contains? input key))
-                       (run-match-pattern program (get value key-pattern) (get input key) stack vars)))))
-    (check (run-node program pattern [input] stack))))
+                       (check (contains? input-value key))
+                       (run-match-pattern program (get value key-pattern) (conj input-path key) (get input-value key) stack vars)))))
+    (check (:value (run-node program pattern [(Cursor. input-path input-value)] stack)))))

 ;; ast

@@ -157,8 +163,10 @@
   (let [stack #js []
         program (into {} (for [pipe example] [(:id pipe) pipe]))]
     (try
-      [(run-pipe program (get program "root") inputs stack) (aget stack 0)]
+      [(run-pipe program (get program "root") (map #(Cursor. [] %) inputs) stack) (aget stack 0)]
       (catch :default e [e (aget stack 0)]))))
+
+(set! *print-meta* true)

 (run-example example-a [1 4 2])

@@ -172,8 +180,6 @@
 (run-example example-c [1])
 (run-example example-c [7])
 (run-example example-c [10])
-
-(.join (make-array 10) " ")

 (defn print-stack
   ([frame]


Scope + recursion

Scope + recursion

--- src/aurora/interpreter.cljs
+++ src/aurora/interpreter.cljs
@@ -1,24 +1,26 @@
 (ns aurora.interpreter)

-(defn run-node [node inputs actions]
+(defn run-node [program node inputs actions]
+  (prn node inputs)
   (case (:type node)
-    :value (run-value node inputs actions)
-    :cljs (run-cljs node inputs actions)
-    :match (run-match node inputs actions)
-    :pipe (run-pipe node inputs actions)))
+    :match (run-match program node inputs actions)
+    :ref (run-ref program node inputs actions)
+    :pipe (run-pipe program node inputs actions)))

-(defn run-value [node inputs actions]
-  (:value node))
+(defn run-ref [program node inputs actions]
+  (case (:kind node)
+    :value (:value node)
+    :cljs (apply (:fn node) inputs)
+    :aurora (run-node program (get program (:id node)) inputs actions)))

-(defn run-cljs [node inputs actions]
-  (apply (:fn node) inputs))
-
-(defn run-pipe [node inputs actions]
+(defn run-pipe [program node inputs actions]
   (let [vars #js {}]
     (doseq [[id value] (map vector (:inputs node) inputs)]
       (aset vars id value))
     (doseq [{:keys [id inputs node]} (:nodes node)]
-      (aset vars id (run-node node (map #(aget vars %) inputs) actions)))
+      (assert (not= :pipe (:type node)) "No inline pipes")
+      (aset vars id (run-node program node (map #(aget vars %) inputs) actions))
+      (prn vars))
     (aget vars (-> node :nodes last :id))))

 (defrecord MatchFailure [])
@@ -26,68 +28,98 @@
 (defn check [bool]
   (when-not bool (throw (MatchFailure.))))

-(defn run-match [node inputs actions]
+(defn run-match [program node inputs actions]
   (assert (= 1 (count inputs)))
   (let [input (first inputs)]
     (loop [branches (:branches node)]
       (if-let [[{:keys [pattern inputs node]} & branches] (seq branches)]
         (try
           (let [vars #js {}]
-            (run-match-pattern pattern input actions vars)
-            (run-node node (map #(aget vars %) inputs) actions))
+            (run-match-pattern program pattern input actions vars)
+            (run-node program node (map #(aget vars %) inputs) actions))
           (catch MatchFailure _
             (recur branches)))
         (throw (MatchFailure.))))))

-(defn run-match-pattern [pattern input actions vars]
+(defn run-match-pattern [program pattern input actions vars]
   (cond
    (= (:type pattern) :match/bind) (do (aset vars (:var pattern) input)
-                                    (run-match-pattern (:pattern pattern) input actions vars))
-   (:type pattern) (check (run-node pattern [input] actions))
+                                    (run-match-pattern program (:pattern pattern) input actions vars))
+   (:type pattern) (check (run-node program pattern [input] actions))
    (or (number? pattern) (string? pattern)) (check (= pattern input))
    (or (nil? pattern) (sequential? pattern)) (if-let [[first-pattern & rest-pattern] (seq pattern)]
                                              (do (check (and (sequential? input) (seq input)))
                                                (let [[first-input & rest-input] input]
-                                                 (run-match-pattern first-pattern first-input actions vars)
-                                                 (run-match-pattern rest-pattern rest-input actions vars)))
+                                                 (run-match-pattern program first-pattern first-input actions vars)
+                                                 (run-match-pattern program rest-pattern rest-input actions vars)))
                                              (check (empty? input)))
    (map? pattern) (do (check (map? input))
                    (doseq [[key val] pattern]
                      (check (contains? input key))
-                     (run-match-pattern val (get input key) actions vars)))
+                     (run-match-pattern program val (get input key) actions vars)))
    :otherwise (assert false)))
-
-(def example-a
-  {:type :pipe
-   :inputs ["a" "b" "c"]
-   :nodes [{:id "b-squared" :inputs ["b" "b"] :node {:type :cljs :fn *}}
-           {:id "four" :inputs [] :node {:type :value :value 4}}
-           {:id "four-a-c" :inputs ["four" "a" "c"] :node {:type :cljs :fn *}}
-           {:id "result" :inputs ["b-squared" "four-a-c"] :node {:type :cljs :fn -}}]})

 (defn bind [var pattern]
   {:type :match/bind
    :var var
    :pattern pattern})

+(def example-a
+  {"root" {:type :pipe
+           :inputs ["a" "b" "c"]
+           :nodes [{:id "b-squared" :inputs ["b" "b"] :node {:type :ref :kind :cljs :name *}}
+                   {:id "four" :inputs [] :node {:type :ref :kind :value :value 4}}
+                   {:id "four-a-c" :inputs ["four" "a" "c"] :node {:type :ref :kind :cljs :fn *}}
+                   {:id "result" :inputs ["b-squared" "four-a-c"] :node {:type :ref :kind :cljs :fn -}}]}})
+
 (def example-b
-  {:type :match
-   :branches [{:pattern {"a" (bind "a" {:type :cljs :fn number?}) "b" (bind "b" {:type :cljs :fn number?})}
-               :inputs ["a" "b"]
-               :node {:type :cljs :fn -}}
-              {:pattern [(bind "x" {:type :value :value true}) "foo"]
-               :inputs ["x" "y"]
-               :node {:type :cljs :fn identity}}]})
+  {"root" {:type :match
+           :branches [{:pattern {"a" (bind "a" {:type :ref :kind :cljs :fn number?}) "b" (bind "b" {:type :ref :kind :cljs :fn number?})}
+                       :inputs ["a" "b"]
+                       :node {:type :ref :kind :cljs :fn -}}
+                      {:pattern [(bind "x" {:type :ref :kind :value :value true}) "foo"]
+                       :inputs ["x" "y"]
+                       :node {:type :ref :kind :cljs :fn identity}}]}})
+
+(def example-c
+  {"root" {:type :ref :kind :aurora :id "even?"}
+   "even?" {:type :match
+            :branches [{:pattern 0
+                        :inputs []
+                        :node {:type :ref :kind :value :value true}}
+                       {:pattern (bind "x" {:type :ref :kind :value :value true})
+                        :inputs ["x"]
+                        :node {:type :ref :kind :aurora :id "even?not-0"}}]}
+   "even?not-0" {:type :pipe
+                 :inputs ["x"]
+                 :nodes [{:id "one" :inputs [] :node {:type :ref :kind :value :value 1}}
+                         {:id "x-1" :inputs ["x" "one"] :node {:type :ref :kind :cljs :fn -}}
+                         {:id "result" :inputs ["x-1"] :node {:type :ref :kind :aurora :id "odd?"}}]}
+   "odd?" {:type :match
+           :branches [{:pattern 0
+                       :inputs []
+                       :node {:type :ref :kind :value :value false}}
+                      {:pattern (bind "x" {:type :ref :kind :value :value true})
+                       :inputs ["x"]
+                       :node {:type :ref :kind :aurora :id "odd?not-0"}}]}
+   "odd?not-0" {:type :pipe
+                :inputs ["x"]
+                :nodes [{:id "one" :inputs [] :node {:type :ref :kind :value :value 1}}
+                        {:id "x-1" :inputs ["x" "one"] :node {:type :ref :kind :cljs :fn -}}
+                        {:id "result" :inputs ["x-1"] :node {:type :ref :kind :aurora :id "even?"}}]}})

 (defn run-example [example inputs]
   (try
-    (run-node example inputs nil)
+    (run-node example (get example "root") inputs nil)
     (catch MatchFailure e e)))

-(run-node example-a [1 4 2] nil)
+(run-example example-a [1 4 2])

 (run-example example-b [{"a" 1 "b" 2}])
 (run-example example-b [{"a" 1 "c" 2}])
 (run-example example-b [{"a" 1 "b" "foo"}])
 (run-example example-b [[1 "foo"]])
 (run-example example-b [[1 2]])
+
+(run-example example-c [0])
+(run-example example-c [1])


[uploads] Fix links in messages (and embeds) for uploads

--- src/braid/uploads/core.cljc
+++ src/braid/uploads/core.cljc
@@ -30,7 +30,7 @@
       {:href url
        :target "_blank"
        :rel "noopener noreferrer"}
-      [:img {:src (upload/->path url)}]]))
+      [:img {:src url}]]))

 (defn ->s3config [config]
   {:api-secret (config :aws-secret-key)
@@ -83,19 +83,18 @@

        (chat/register-message-transform!
          (fn [node]
-           (println node)
            (if (and (string? node) (upload/upload-path? node))
              (let [url node]
-               [:a.upload {:href url
-                             :title url
-                             :style {:background-color (color/url->color url)
-                                     :border-color (color/url->color url)}
-                             :on-click (fn [e] (.stopPropagation e))
-                             :target "_blank"
-                             ; rel to address vuln caused by target=_blank
-                             ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
-                             :rel "noopener noreferrer"
-                             :tab-index -1}
+               [:a.upload {:href (upload/->path url)
+                           :title url
+                           :style {:background-color (color/url->color url)
+                                   :border-color (color/url->color url)}
+                           :on-click (fn [e] (.stopPropagation e))
+                           :target "_blank"
+                           ; rel to address vuln caused by target=_blank
+                           ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
+                           :rel "noopener noreferrer"
+                           :tab-index -1}
                 (last (string/split url #"/"))])
              node)))

@@ -122,7 +121,7 @@
                                 (some (fn [url]
                                         (re-matches #".*(png|jpg|jpeg|gif)$" url)))
                                 first)]
-              [image-embed-view url]))
+              [image-embed-view (upload/->path url)]))

           :styles
           [:>.image.upload


Added countries and fixed all with scatter.

--- src/clj/forma/hadoop/jobs/scatter.clj
+++ src/clj/forma/hadoop/jobs/scatter.clj
@@ -122,31 +122,30 @@
                                                  "2011-06-01"
                                                  country-seq))))))

-;; [[103] [158]]
-
+;; TODO: Note that if we go from tap to tap, we have no reducers
+;; involved.
 (defn bucket-forma
   "TODO: Get these country numbers turned into codes! Then uncomment
   code below, and remove that final `src`. Accept countries to
   bucket "
-  [unbucketed-path bucketed-path & country-num-seq]
-  (let [keep-countries (into [] (map vector country-num-seq))
+  [unbucketed-path bucketed-path country-code-seq]
+  (let [keep-countries (into [] (map vector country-code-seq))
         template-fields ["?s-res" "?country" "?datestring"]
         data-fields     ["?mod-h" "?mod-v" "?sample" "?line" "?text"]
         forma-fields    (concat template-fields data-fields)
         src (hfs-seqfile unbucketed-path)]
     (?- (hfs-textline bucketed-path
-                      :sink-template "%s/%s/%s/"
+                      :sinkmode :replace
+                      :sink-template "%s/%s/"
                       :outfields data-fields
                       :templatefields template-fields
-                      :sinkparts 3
-                      :sinkmode :replace)
-        (if country-num-seq
+                      :sinkparts 3)
+        (if country-code-seq
           (<- forma-fields
               (src :>> forma-fields)
               (keep-countries ?country :> true))
           (name-vars src forma-fields)))))

-;; TODO: call read-string on countries.
 (defmain RunForma
   [pail-path ts-pail-path results-path run-key & countries]
   (let [countries (->> (or countries [":IDN" ":MYS"])
@@ -155,9 +154,8 @@
     (process-forma pail-path ts-pail-path temp-path run-key countries)
     (bucket-forma temp-path results-path)))

-(defmain BucketForma [results-path]
-  (let [temp-path "s3n://formares/unbucketed"]
-    (bucket-forma temp-path results-path)))
+(defmain BucketForma [source-path results-path & codes]
+  (bucket-forma source-path results-path codes))

 ;; ## Rain Processing, for Dan
 ;;


link perameters indacations

link perameters indacations

--- src/clj/morpheus/models/edge/core.clj
+++ src/clj/morpheus/models/edge/core.clj
@@ -37,7 +37,7 @@
        ~@body)))

 (deflink
-  link! [v2 & args]
+  link!* [v2 & args]
   (let [v2-id (:*id* v2)
         edge-cell-vertex-fields (eb/edge-cell-vertex-fields v1-id v2-id)]
     (assert v1-id "id for vertex 1 missing")
@@ -58,8 +58,11 @@
              {:*id* edge-cell-id
               :*ep* edge-schema}))))

+(defn link! [v1 group v2 & args]
+  (apply link!* v1 group v2 args))
+
 (deflink
-  link-group! [& v2-list]
+  link-group!* [& v2-list]
   (assert v1-id "id for vertex 1 missing")
   (when type-body-sticker
     (assert (= type-body-sticker (:body edge-schema))
@@ -91,6 +94,9 @@
              (doall))
         v1-list-cell-row-id (eb/vertex-edge-list v1-id v1-e-field edge-schema-id)]
     (eb/append-cids-to-list v1-list-cell-row-id v1-remotes)))
+
+(defn link-group! [v1 group & v2-list]
+  (apply link-group!* v1 group v2-list))

 (def opposite-direction-mapper
   {:*outbounds* #{:*end*}


Memoize dissect url

Memoize dissect url


burst fix

burst fix

--- src/clj/neb/durability/serv/trunk.clj
+++ src/clj/neb/durability/serv/trunk.clj
@@ -52,7 +52,7 @@
 (defn recover [file-path]
   (let [^InputStream reader (io/input-stream file-path)
         seg-size (read-int-from-stream reader)
-        thread-size (min (* 15 (count (ds/get-server-list @ds/node-server-group))) (cp/ncpus))
+        thread-size (cp/ncpus)
         recover-seg-pool (cp/threadpool thread-size :name "Recover-Seg")
         recover-seg-semaphore (Semaphore. (int thread-size))]
     (try
@@ -60,10 +60,10 @@
         (let [seg-append-header (read-int-from-stream reader)
               seg-data (read-bytes reader seg-size)
               seg-mem (malloc-bytes seg-data)]
+          (.acquire recover-seg-semaphore)
           (cp/future
             recover-seg-pool
             (try
-              (.acquire recover-seg-semaphore)
               (loop [pointer 0]
                 (when-not (>= pointer seg-append-header)
                   (let [{:keys [partition hash cell-length cell-type version]} (read-header-bytes seg-mem pointer)]