Hiding GA migration notice for orgs on a trial plan.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -506,7 +506,9 @@
           [:div.osx-plans {:data-component `osx-plans-list-ga}
            [:fieldset
             [:legend (str "OS X Plans")]
-            (when (and (pm/osx? plan) (not (pm/osx-ga-plan? plan)))
+            (when (and (pm/osx? plan)
+                       (not (pm/osx-trial-plan? plan))
+                       (not (pm/osx-ga-plan? plan)))
               (om/build limited-release-notice plan))
             [:p "Your selection below only applies to OS X service and will not affect Linux Containers."]
             (when (and (pm/osx-trial-plan? plan) (not (pm/osx-trial-active? plan)))


added a click event for the osx trial

added a click event for the osx trial

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -399,14 +399,21 @@
                                                                                :plan plan-id}}))}))

               (when (and trial-starts-here? (not (pm/osx? plan)))
-                [:div.start-trial "or "
-                 (forms/managed-button
-                   [:a
-                    {:data-success-text "Success!"
-                     :data-loading-text "Starting..."
-                     :data-failed-text "Failed"
-                     :on-click #(raise! owner [:activate-plan-trial {:osx {:template "osx-trial"}}])}
-                    "start a 2 week free trial"])])]]
+                (let [template "osx-trial"
+                      plan-type :osx]
+                  [:div.start-trial "or "
+                   (forms/managed-button
+                     [:a
+                      {:data-success-text "Success!"
+                       :data-loading-text "Starting..."
+                       :data-failed-text "Failed"
+                       :on-click #(do
+                                    (raise! owner [:activate-plan-trial {plan-type {:template template}}])
+                                    (analytics/track {:event-type :start-trial-clicked
+                                                      :owner owner
+                                                      :properties {:plan-type plan-type
+                                                                   :template template}}))}
+                      "start a 2 week free trial"])]))]]
             (cond
               trial-starts-here?
               [:div.bottom "Free Trial Starts Here"]


correct docs

correct docs

--- sidecar/src/figwheel_sidecar/auto_builder.clj
+++ sidecar/src/figwheel_sidecar/auto_builder.clj
@@ -114,7 +114,7 @@
           (clean-build)     ;; deletes compiled cljs target files
     Docs: (doc function-name-here)
     Exit: Control+C or :cljs/quit
- Results: Stored in vars *1, *2, *3, an exception in *e")
+ Results: Stored in vars *1, *2, *3")

 (defn autobuild-repl [{:keys [builds figwheel-server] :as opts}]
   (let [builds' (mapv auto/prep-build builds)


lexical refactoring

lexical refactoring

--- src/clojure/com/zensol/cisql/process_query.clj
+++ src/clojure/com/zensol/cisql/process_query.clj
@@ -11,24 +11,6 @@
 (def ^{:private true
        :dynamic true}
   *query* nil)
-
-(def ^:private config-variable-pattern
-  #"^\s*cf\s+([^\s]+)\s(.+?)$")
-
-(def ^:private show-variable-pattern
-  #"^\s*sh(?:\s+([^ ]+))?\s*$")
-
-(def ^:private toggle-variable-pattern
-  #"^\s*tg\s+([^\s]+)\s*$")
-
-(def ^:private show-tables-pattern
-  #"^\s*shtab(?:\s+([^\s]+))?\s*$")
-
-(def ^:private orphan-pattern
-  #"^\s*orph(?:\s+([^\s]+))?\s*$")
-
-(def ^:private config-catalog-pattern
-  #"^\s*cfcat\s+([^\s]+)\s*$")

 (def ^:private input-rules
   '([has-end-tok :linesep false :end-query]
@@ -64,13 +46,13 @@
       {:dir directive})))

 (defn- config-setting [line]
-  (let [[_ key val] (re-find config-variable-pattern line)]
+  (let [[_ key val] (re-find #"^\s*cf\s+([^\s]+)\s(.+?)$" line)]
     (if key
       {:dir :setting
        :settings [(keyword key) val]})))

 (defn- show-setting [line]
-  (let [[_ key] (re-find show-variable-pattern line)]
+  (let [[_ key] (re-find #"^\s*sh(?:\s+([^ ]+))?\s*$" line)]
     (if _
      {:dir :show
       :key (if key
@@ -78,13 +60,13 @@
              'show)})))

 (defn- toggle-setting [line]
-  (let [[_ key] (re-find toggle-variable-pattern line)]
+  (let [[_ key] (re-find #"^\s*tg\s+([^\s]+)\s*$" line)]
     (if key
      {:dir :toggle
       :key (keyword key)})))

 (defn- show-tables [line]
-  (let [[_ table] (re-find show-tables-pattern line)]
+  (let [[_ table] (re-find #"^\s*shtab(?:\s+([^\s]+))?\s*$" line)]
     (if _
      {:dir :show-table
       :key (if table
@@ -92,7 +74,7 @@
              (if _ 'show-all))})))

 (defn- orphan-frame [line]
-  (let [[_ table] (re-find orphan-pattern line)]
+  (let [[_ table] (re-find #"^\s*orph(?:\s+([^\s]+))?\s*$" line)]
     (if _
       {:dir :orphan-frame
        :key (if table
@@ -100,7 +82,7 @@
               (if _ 'default-label))})))

 (defn- config-catalog [line]
-  (let [[_ catalog] (re-find config-catalog-pattern line)]
+  (let [[_ catalog] (re-find #"^\s*cfcat\s+([^\s]+)\s*$" line)]
     (if _
      {:dir :config-catalog
       :catalog catalog})))


Fix typo in wrap-multipart-params docstring

--- ring-core/src/ring/middleware/multipart_params.clj
+++ ring-core/src/ring/middleware/multipart_params.clj
@@ -157,7 +157,7 @@
                        Has no effect if :encoding is also set.

   :store             - a function that stores a file upload. The function
-                       should expect a map with :filename, content-type and
+                       should expect a map with :filename, :content-type and
                        :stream keys, and its return value will be used as the
                        value for the parameter in the multipart parameter map.
                        The default storage function is the temp-file-store.


Remove unnecessary with-meta expressions

datatype constructors accept metadata argument

--- src/main/clojure/com/stuartsierra/lazytest.clj
+++ src/main/clojure/com/stuartsierra/lazytest.clj
@@ -144,8 +144,7 @@
       (let [after-fn (when after
                        `(fn ~(vec (concat (first after) locals))
                           ~@after))]
-        `(def ~name (with-meta (Context ~contexts ~before-fn ~after-fn)
-                      '~m))))))
+        `(def ~name (Context ~contexts ~before-fn ~after-fn '~m nil))))))

 ;;; TEST RUNNING STRATEGIES
@@ -231,20 +230,20 @@
           contexts (vec (map (comp coerce-context second) (partition 2 bindings)))]
       (assert (every? symbol locals))
       `(def ~name
-            (with-meta (TestCase ~contexts
-                                 ~(loop [r [], as assertions]
-                                    (if (seq as)
-                                      (if (string? (first as))
-                                        (recur (conj r `(with-meta (fn ~locals ~(second as))
-                                                          {:doc ~(first as), :form '~(second as),
-                                                           :file *file*, :line @Compiler/LINE}))
-                                               (nnext as))
-                                        (recur (conj r `(with-meta (fn ~locals ~(first as))
-                                                          {:form '~(first as),
-                                                           :file *file*, :line @Compiler/LINE}))
-                                               (next as)))
-                                      r)))
-              '~m)))))
+            (TestCase ~contexts
+                      ~(loop [r [], as assertions]
+                         (if (seq as)
+                           (if (string? (first as))
+                             (recur (conj r `(with-meta (fn ~locals ~(second as))
+                                               {:doc ~(first as), :form '~(second as),
+                                                :file *file*, :line @Compiler/LINE}))
+                                    (nnext as))
+                             (recur (conj r `(with-meta (fn ~locals ~(first as))
+                                               {:form '~(first as),
+                                                :file *file*, :line @Compiler/LINE}))
+                                    (next as)))
+                           r))
+                      '~m nil)))))

 (defmacro defsuite
   "Defines a test suite containing other test cases or suites.
@@ -256,8 +255,7 @@
         contexts (first decl)
         children (next decl)]
     (assert (vector? contexts))
-    `(def ~name (with-meta (TestCase ~contexts ~(vec children))
-                  '~m))))
+    `(def ~name (TestCase ~contexts ~(vec children) '~m nil))))

 ;;; TEST RESULT HANDLING


Comment out the defsketch function

Comment out the defsketch function

--- spectacles/src/spectacles/fireflies.clj
+++ spectacles/src/spectacles/fireflies.clj
@@ -123,12 +123,12 @@
            :on (into [] (map update-on (:on state)))
            )))

-(q/defsketch practice
-  :title "Fireflies"
-  :size :fullscreen
-  :setup setup
-  :draw draw
-  :update update
-  :features [:keep-on-top]
-  :middleware [m/fun-mode])
+;; (q/defsketch practice
+;;   :title "Fireflies"
+;;   :size :fullscreen
+;;   :setup setup
+;;   :draw draw
+;;   :update update
+;;   :features [:keep-on-top]
+;;   :middleware [m/fun-mode])


Fix telephone number in /press

Fix telephone number in /press

--- src-cljs/frontend/components/press.cljs
+++ src-cljs/frontend/components/press.cljs
@@ -211,7 +211,7 @@
              "For media and market research analysts, please contact Laura Franzese at "
              [:a {:href "mailto:laura@circleci.com"} "laura@circleci.com"]
              " or "
-             [:a {:href "tel:+14155359076"} "415.535.9076"]
+             [:a {:href "tel:+18005857075"} "800.585.7075"]
              [:br]
              "Fast Facts - Founded in 2011 - "
              [:a {:href "/contact"} "HQ"]


Store sidebar widths in local-storage.

Store sidebar widths in local-storage.

--- src-cljs/pepa/components/draggable.cljs
+++ src-cljs/pepa/components/draggable.cljs
@@ -7,8 +7,11 @@
             [pepa.style :as css]

             [clojure.browser.event :as bevent]
-            [goog.dom :as gdom])
-  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
+            [goog.dom :as gdom]
+            [cljs.reader :refer [read-string]])
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
+  (:import goog.storage.Storage
+           goog.storage.mechanism.HTML5LocalStorage))

 (defn ^:private resize-mouse-down [owner sidebar e]
   ;; Only handle 'main' mouse button
@@ -68,13 +71,33 @@
 (defn shared-data []
   {::events (async/chan)})

+(def ^:private +save-timeout+ (* 0.5 1000))
+
+(let [storage (Storage. (HTML5LocalStorage.))]
+  (defn ^:private save-sidebar-state! [sidebars]
+    (println "saving sidebar state")
+    (.set storage (str ::sidebars) (pr-str sidebars)))
+
+  (defn ^:private read-sidebar-state []
+    (println "saving sidebar state")
+    (read-string (.get storage (str ::sidebars)))))
+
 (defn resize-handle-loop [root-owner]
-  (go-loop []
-    (when-let [event (<! (om/get-shared root-owner ::events))]
-      #_(println "got resize-event" (pr-str event))
-      (let [[sidebar pos] event]
-        (om/transact! (data/ui-sidebars)
-                      (fn [sidebars]
-                        (assoc sidebars sidebar
-                               (pos->width sidebars sidebar pos)))))
-      (recur))))
+  ;; Read sizes from local storage
+  (om/update! (data/ui-sidebars) (read-sidebar-state))
+  (go-loop [changed? false]
+    (let [resizes (om/get-shared root-owner ::events)
+          timeout (async/timeout +save-timeout+)
+          [event port] (alts! [resizes timeout])]
+      (cond
+        (and event (= port resizes))
+        (let [[sidebar pos] event]
+          (om/transact! (data/ui-sidebars)
+                        (fn [sidebars]
+                          (assoc sidebars sidebar
+                                 (pos->width sidebars sidebar pos))))
+          (recur true))
+        (= port timeout)
+        (do
+          (when changed? (save-sidebar-state! @(data/ui-sidebars)))
+          (recur false))))))


A TODO is added.

A TODO is added.

--- src-cljx/polyomino_enclosure/engine.cljx
+++ src-cljx/polyomino_enclosure/engine.cljx
@@ -187,3 +187,6 @@
 (defn score
   [result]
   (area-size (apply board result) :search-8-way? true))
+
+;; TODO: area-sizeをパフォーマンス・チューニングする。Paintアルゴリズムの応用が効くはず。
+


PR comments.

PR comments.


Fix queries ending in a space

Fix queries ending in a space

--- src/cljs/cglossa/search_inputs/cwb.cljs
+++ src/cljs/cglossa/search_inputs/cwb.cljs
@@ -35,10 +35,10 @@
         chinese-ch "[\u4E00-\u9FFF\u3400-\u4DFF\uF900-\uFAFF]"
         ; Surround every Chinese character by space when constructing a cqp query,
         ; to treat it as if it was an individual word:
-        phrase     (str/replace phrase
+        p1         (str/replace phrase
                                 (re-pattern (str "(" chinese-ch ")"))
                                 " $1 ")
-        phrase     (as-> (str/split phrase #"\s") $
+        p2         (as-> (str/split p1 #"\s") $
                          (map #(if (= % "")
                                 ""
                                 (str "[" attr "=\"" % "\" %c]"))
@@ -48,10 +48,15 @@
                                       (re-pattern (str "\\s(\\[\\w+=\""
                                                        chinese-ch
                                                        "\"(?:\\s+%c)?\\])\\s"))
-                                      "$1"))]
-    (if (str/blank? phrase)
+                                      "$1")
+                         ;; NOTE: In JavaScript, "han ".split(/\s/) yields the array
+                         ;; ["han", " "], but in ClojureScript (str/split "han " #"\s")
+                         ;; only yields ["han"]. Hence, in the CLJS version we need to
+                         ;; add the extra element if the query ends in a space.
+                         (if (= \space (last (seq p1))) (str $ " ") $))]
+    (if (str/blank? p2)
       (str "[" attr "=\".*\" %c]")
-      phrase)))
+      p2)))

 (defn- search! [query-cursor]
   (.log js/console "soker"))


when xhandle and yhandle are unset on a container, do nothing with the origins at all.

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -199,7 +199,7 @@
               buttonmode particle particle-opts]
        :or {children []
             x 0 y 0
-            xhandle 0.5 yhandle 0.5
+            xhandle nil yhandle nil
             scale 1
             alpha 1
             visible true
@@ -246,8 +246,8 @@

     (doseq [child children] (.addChild container child))
-    (when (pos? (count children))
-      (update-handle! container xhandle yhandle))
+    (when (and (or xhandle yhandle) (pos? (count children)))
+         (update-handle! container (or xhandle 0) (or yhandle 0)))

     container))


Reorder imports and requires on poly1305 ns.

--- src/clojure/buddy/core/mac/poly1305.clj
+++ src/clojure/buddy/core/mac/poly1305.clj
@@ -25,6 +25,11 @@
   Poly1305-AES offers also cipher replaceability. If anything does
   go wrong with AES, it can be substituted with identical security
   guarantee."
+  (:require [buddy.core.hash :refer [sha3-256]]
+            [buddy.core.mac.proto :as proto]
+            [buddy.core.codecs :refer :all]
+            [buddy.core.keys :refer [make-random-bytes]]
+            [clojure.java.io :as io])
   (:import org.bouncycastle.crypto.generators.Poly1305KeyGenerator
            org.bouncycastle.crypto.macs.Poly1305
            org.bouncycastle.crypto.params.KeyParameter
@@ -35,11 +40,8 @@
            org.bouncycastle.crypto.BlockCipher
            clojure.lang.IFn
            clojure.lang.Keyword
-           buddy.Arrays)
-  (:require [buddy.core.hash :refer [sha3-256]]
-            [buddy.core.codecs :refer :all]
-            [buddy.core.keys :refer [make-random-bytes]]
-            [clojure.java.io :as io]))
+           buddy.Arrays))
+

 (def ^{:doc "Default engine factories."
        :dynamic true}


Using IPC

Using IPC

--- jvm-runner/project.clj
+++ jvm-runner/project.clj
@@ -31,5 +31,5 @@
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
   :env {:timeout "10000"
-        :zmq-socket "tcp://127.0.0.1:12349"}
+        :zmq-socket "ipc:///tmp/codewars"}
   :main codewars.core)


refactor

refactor

--- Assets/game/core.clj
+++ Assets/game/core.clj
@@ -15,13 +15,20 @@
   (UnityEngine.Resources/Load name))

 ;(def cards-parent (UnityEngine.GameObject. "Cards"))
+
 (def canvas (object-named "Canvas"))
 (def card-prefab (resource "card"))

-(child+ canvas
-        (instantiate card-prefab (v3 -100 0 0)))
-(child+ canvas
-        (instantiate card-prefab (v3 100 0 0)))
+(defn card-add [i]
+  (let [position (v3 (+ (- 300) (* i 100)) 0 0)
+        card (instantiate card-prefab position)]
+         (child+ canvas card)))
+
+(defn generate-level [no]
+  (dotimes [i (* 2 no)]
+    (card-add i)))
+
+(generate-level 2)

 (defn card [] (object-tagged "Card"))
 (defn cards [] (objects-tagged "Card"))
@@ -43,9 +50,7 @@
 (defn rand-card-face []
   (rand-nth card-faces))

-;; (keyword (rand-card-face))
-
-(card-set-face-texture! (card) (rand-card-face))
+;; (card-set-face-texture! (card) (rand-card-face))

 ;; (UnityEngine.Resources/Load "roboty-drogowe")
 ;; (UnityEngine.Resources/Load
@@ -60,7 +65,7 @@
 ;(remove-state! card-prefab :rotate?)
 (do-cards #(do
              (set-state! % :flipped? false)
-             (set-state! % :type :default)))
+             (set-state! % :type :robot)))

 (do-cards #(println (state %)))
 ;(set-state! card-prefab :flipped? false)


Alura, Introdução a Programação Funcional com Clojure, Aula 3

--- alura/clojure/forca/src/forca/core.clj
+++ alura/clojure/forca/src/forca/core.clj
@@ -4,13 +4,22 @@
 (def total-de-vidas 6)

 (defn perdeu [] (print "Você perdeu"))
+(defn ganhou [] (print "Você ganhou!"))

-(defn jogo [vidas]
+(defn letras-faltantes [palavra acertos]
+  (remove (fn [letra] (contains? acertos (str letra))) palavra)
+)
+
+(defn acertou-a-palavra-toda? [palavra acertos]
+  (empty? (letras-faltantes palavra acertos))
+)
+
+(defn jogo [vidas palavra acertos]
   (if (= vidas 0)
     (perdeu)
-    (do
-      (print vidas)
-      (jogo (dec vidas))
+    (if (acertou-a-palavra-toda? palavra acertos)
+      (ganhou)
+      (print "Chuta, amigo!")
     )
   )
 )


use linebreak 0 for minify-assets in dev

--- src/leiningen/new/reagent_liveedit/project.clj
+++ src/leiningen/new/reagent_liveedit/project.clj
@@ -55,11 +55,10 @@
   {:dev
    {:assets {"resources/public/css/site.min.css" ["resources/dev/css/site.css"
                                                   "resources/dev/css/dev.css"]}
-    :options {:optimizations :none}}
+    :options {:linebreak 0}}

    :production
-   {:assets {"resources/public/css/site.min.css" "resources/dev/css/site.css"}
-    :options {:optimizations :advanced}}}
+   {:assets {"resources/public/css/site.min.css" "resources/dev/css/site.css"}}}

   :aliases {"fig"      ["exec" "-pe" "(use 'tic-tac-toe.server.services) (start-figwheel)"]
             "server"   ["ring" "server"]


first stub at cljs-env->env

first stub at cljs-env->env

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -33,8 +33,10 @@
             [clojure.tools.analyzer.js.utils
              :refer [desugar-ns-specs validate-ns-specs ns-resource ns->relpath res-path]]
             [cljs
+             [analyzer :as cljs.ana]
              [tagged-literals :as tags]
              [js-deps :as deps]]
+            [clojure.string :as s]
             [clojure.java.io :as io]
             [clojure.tools.reader :as reader]
             [clojure.tools.reader.reader-types :as readers])
@@ -363,7 +365,10 @@
         core-macro-mappings (apply dissoc (core-macros) (:exclude refer-clojure))
         macro-mappings (reduce (fn [m [ns {:keys [refer]}]]
                                  (c.c/require ns)
-                                 (reduce #(assoc %1 %2 (ns-resolve ns (name %2))) m refer))
+                                 (reduce #(let [m (ns-resolve ns (name %2))]
+                                            (if (:macro (meta m))
+                                              (assoc %1 %2 m)
+                                              %1)) m refer))
                                {} require-macros)]

     (swap! *env* assoc-in [:namespaces ns-name]
@@ -532,7 +537,7 @@
   (reset! core-env
           (reader/read-string (slurp (io/resource "tools.analyzer.js/cached-env.res")))))

-(defn setup-rt []
+(defn setup-rt! []
   (require 'cljs.core)
   (when-not (or (seq @core-env)
                 (seq (restore-env)))
@@ -541,4 +546,35 @@
       (analyze '(ns cljs.user))
       (reset! core-env (select-keys (:namespaces (env/deref-env)) '[cljs.core cljs.user])))))

-(setup-rt)
+(defn cljs-env->env []
+  (throw (Exception. "not implemented"))
+  (reduce (fn [m {:keys [name excludes uses requires use-macros require-macros imports defs]}]
+            (let [imports (reduce-kv (fn [m k v]
+                                       (assoc m k (let [s (s/split (name v) #"\.")]
+                                                    {:op   :js-var
+                                                     :ns   (symbol (s/join "." (butlast s)))
+                                                     :name (symbol (last s))}))) {} imports)
+                  parse-requires (fn [r] (reduce-kv (fn [m k v] (if (not= k v)
+                                                                (assoc m k v)
+                                                                m)) {} r))
+                  core-mappings (apply dissoc (get-in (env/deref-env) [:namespaces 'cljs.core :mappings]) excludes)
+                  core-macro-mappings (apply dissoc (core-macros) excludes)
+                  js-namespaces (reduce (fn [m ns] (assoc m ns {:ns ns :js-namespace true})) {} (set (keys requires)))
+                  mappings (reduce-kv (fn [m k v] {:op   (if (js-namespaces v) :js-var :var)
+                                                  :name k
+                                                  :ns   v}) uses)
+                  macro-mappings (reduce-kv (fn [m k v]
+                                              (let [macro (ns-resolve v k)]
+                                                (if (:macro (meta macro))
+                                                  (assoc m k macro)
+                                                  m))) uses)]
+              ;; todo defs
+              (merge m js-namespaces
+                     {name {:ns             name
+                            :mappings       (merge imports core-mappings mappings)
+                            :macro-mappings (merge core-macro-mappings macro-mappings)
+                            :aliases        (parse-requires requires)
+                            :macro-aliases  (parse-requires require-macros)}})))
+          (vals @(cljs.ana/namespaces))))
+
+(setup-rt!)


fix typo

fix typo

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -423,7 +423,7 @@
     (if (and meta (= :map (:op meta)))
       (let [const-map (zipmap (mapv const-val (:keys meta))
                               (mapv const-val (:vals meta)))]
-        (assoc-in ast [:meta] (ana/-analyze-const const-map env)))
+        (assoc-in ast [:meta] (ana/analyze-const const-map env)))
       ast)))

 (def default-passes


Main for template renderer.

Main for template renderer.

--- dev-src/lib_onyx/render_server_api.clj
+++ dev-src/lib_onyx/render_server_api.clj
@@ -11,4 +11,5 @@
    (render-resource "replica_query_server_template.md"
                     {:endpoints annotated-routes})))

-#_(generate-docs)
+(defn -main [& args]
+  (generate-docs))


Android tabbar replace elevation with border

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

--- src/status_im/ui/components/tabbar/styles.cljs
+++ src/status_im/ui/components/tabbar/styles.cljs
@@ -3,10 +3,7 @@
             [status-im.ui.components.colors :as colors]
             [status-im.utils.platform :as platform]))

-(def tabs-height
-  (cond
-    platform/android? 52
-    platform/ios?     52))
+(def tabs-height 52)

 (def minimized-tabs-height 36)

@@ -48,18 +45,17 @@
    :height tabs-height})

 (def tab-container
-  {:flex            1
-   :height          tabs-height
-   :align-items     :center
-   :justify-content :space-between
-   :padding-top     6
-   :padding         4})
+  {:flex           1
+   :height         tabs-height
+   :align-items    :center
+   :padding-top    6
+   :padding-bottom 5})

 (def icon-container
-  {:height          24
-   :width           42
-   :align-items     :center
-   :justify-content :center})
+  {:height           24
+   :width            42
+   :align-items      :center
+   :justify-content  :center})

 (defn icon [active?]
   {:color  (if active? colors/blue colors/gray)
@@ -68,30 +64,35 @@

 (def tab-title-container
   {:align-self      :stretch
-   :height          14
+   :height          13
+   :margin-top      4
    :align-items     :center
    :justify-content :center})

 (defn tab-title [active?]
-  {:color     (if active? colors/blue colors/gray)
-   :font-size 11})
+  {:color       (if active? colors/blue colors/gray)
+   :line-height 13
+   :font-size   11})

 (defn animated-container [visible? inset]
-  {:flex-direction   :row
-   :shadow-radius    4
-   :shadow-offset    {:width 0 :height -5}
-   :shadow-opacity   0.3
-   :shadow-color     (if (colors/dark?)
-                       "rgba(0, 0, 0, 0.75)"
-                       "rgba(0, 9, 26, 0.12)")
-   :elevation        8
-   :background-color colors/white
-   :position         :absolute
-   :left             0
-   :right            0
-   :height           tabs-height
-   :bottom           inset
-   :transform        [{:translateY (animated/mix visible? tabs-diff 0)}]})
+  (merge
+   {:flex-direction   :row
+    :background-color colors/white
+    :position         :absolute
+    :left             0
+    :right            0
+    :height           tabs-height
+    :bottom           inset
+    :transform        [{:translateY (animated/mix visible? tabs-diff 0)}]}
+   (if platform/android?
+     {:border-top-width 1
+      :border-top-color colors/gray-lighter}
+     {:shadow-radius  4
+      :shadow-offset  {:width 0 :height -5}
+      :shadow-opacity 0.3
+      :shadow-color   (if (colors/dark?)
+                        "rgba(0, 0, 0, 0.75)"
+                        "rgba(0, 9, 26, 0.12)")})))

 (defn ios-titles-cover [inset]
   {:background-color colors/white
@@ -104,7 +105,6 @@

 (defn tabs-wrapper [keyboard visible]
   (merge {:padding-horizontal 8
-          :elevation          8
           :left               0
           :right              0
           :bottom             0


lol fix test

lol fix test


Remove component that's not quite ready yet.

--- frontend/components/documentation.cljs
+++ frontend/components/documentation.cljs
@@ -1,43 +0,0 @@
-(ns frontend.components.documentation
-  (:require [om.core :as om :include-macros true]
-            [om.dom :as dom :include-macros true]
-            [frontend.docs :as docs]
-            [sablono.core :as html :refer-macros [html]])
-  (:require-macros [frontend.utils :refer [defrender]]))
-
-(defrender documentation [app owner opts]
-  (html [:div.docs.page
-         [:div.banner
-          [:div.container
-           [:h1 "Documentation"]]
-          [:div.container.content
-           [:div.row
-            [:aside.span3 "Categories placeholder"]
-            [:div.span8.offset1
-             "Docs search form"
-             [:article
-              "Docs title"
-              "Search form"
-              "Article list or article slug"]]]]]]))
-
-(defrender docpage [app owner opts]
-  (html
-   [:div "Woop"]))
-
-(defrender article-list-item [article]
-  (html
-   [:li "Hi!"]))
-
-(defrender article-list [app owner opts]
-  (let [articles []]
-    (html
-     [:ul.article_list
-      (map #(article-list-item %) articles)])))
-
-(defrender categories [app owner opts]
-  (let [categories (document-sitemap @registered-docs)]
-    (html [:ul.articles
-           [:li
-            [:h4
-             [:a {:href (:url category)} (:title category)]
-             (map #(category-child %) (:children category))]]])))


Formatting

Formatting

--- src/clojure/clojurewerkz/cassaforte/query.clj
+++ src/clojure/clojurewerkz/cassaforte/query.clj
@@ -15,8 +15,8 @@
 (ns clojurewerkz.cassaforte.query
   "Functions for building dynamic CQL queries, in case you feel
    that `cql` namespace is too limiting for you."
-  (:require [qbits.hayt.dsl.statement :as statement]
-            [qbits.hayt.dsl.clause :as clause]
+  (:require [qbits.hayt.dsl.statement        :as statement]
+            [qbits.hayt.dsl.clause           :as clause]
             [clojurewerkz.cassaforte.aliases :refer :all]))

 (doseq [module '(dsl.clause fns utils)]


Dummy test case for canonical-base implementation

To detect regressions as early as possible

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

--- src/conexp/contrib/tests/algorithms.clj
+++ src/conexp/contrib/tests/algorithms.clj
@@ -14,7 +14,7 @@
         conexp.contrib.algorithms))

-;;;
+;;; Concept Calculations

 (defn- add-if-not-exists [invalids program-name keyword]
   (when-not (program-exists? program-name)
@@ -39,6 +39,18 @@
             (is false))
         (is true)))))

+;;; Canonical Base Computation
+
+(deftest test-canonical-base
+  (dotimes [_ test-runs]
+    (let [ctx    (cm/rand-context (cm/set-of-range (rand 15)) (rand)),
+          base-1 (canonical-base ctx)
+          base-2 (cm/canonical-base ctx)]
+      (if-not (= base-1 base-2)
+        (do (println "canonical-base returned different result for\n" ctx)
+            (is false))
+        (is true)))))
+
 ;;;

 (tests-to-run conexp.contrib.tests.algorithms.titanic)


Refactor deployment error creation (#1574)

--- waiter/src/waiter/scheduler/kubernetes.clj
+++ waiter/src/waiter/scheduler/kubernetes.clj
@@ -78,10 +78,11 @@
   (get-in k8s-error-response [:body :message] "Unknown reason - check logs"))

 (defn create-service-deployment-error
-  "Transforms the deployment error message to be more user friendly"
-  [k8s-error-response response->deployment-error-msg-fn]
-  {:service-deployment-error-details {:k8s-response-body (get-in k8s-error-response [:body])}
-   :service-deployment-error-msg (response->deployment-error-msg-fn k8s-error-response)})
+  "Creates a deployment error object containing a user-friendly message, details, and source"
+  [source-name source-object source-object->deployment-error-msg-fn source-object->deployment-error-details-fn]
+  {:service-deployment-error-details (source-object->deployment-error-details-fn source-object)
+   :service-deployment-error-msg (source-object->deployment-error-msg-fn source-object)
+   :service-deployment-error-source source-name})

 (defn- use-short-service-hash? [k8s-max-name-length]
   ;; This is fairly arbitrary, but if we have at least 48 characters for the app name,
@@ -798,7 +799,9 @@
           (catch Object response
             ; Don't create deployment error for http-409-conflict (replicaset already exists)
             (when-not (= (:status response) http-409-conflict)
-              (let [deployment-error (create-service-deployment-error response response->deployment-error-msg-fn)]
+              (let [response->deployment-error-details-fn (fn [k8s-response] {:k8s-response-body (get-in k8s-response [:body])})
+                    deployment-error (create-service-deployment-error "create-service" response
+                                                                      response->deployment-error-msg-fn response->deployment-error-details-fn)]
                 (log/info "creating deployment error for service" {:deployment-error deployment-error
                                                                    :service-id service-id})
                 (cu/cache-put! service-id->deployment-error-cache service-id deployment-error)))


Fix unbounded fn error

Fix unbounded fn error

--- src/clj/sbsk/components/admin.clj
+++ src/clj/sbsk/components/admin.clj
@@ -85,10 +85,10 @@
     (swap! cache update :playlists dissoc playlist-id)
     (log/info "Deleteing playlist" playlist-id)
     (write-playlists! db bucket playlists-key cache)
-    {:status 202})
+    {:status 202}))

 (defn move-playlist!
-  [dir req db bucket playlists-key cache]
+  [req dir db bucket playlists-key cache]
   (let [playlist-id (get-in req [:params :id])]
     (when (empty? (:playlists @cache))
       (swap! cache assoc :playlists (load-playlists! db bucket playlists-key)))
@@ -98,7 +98,7 @@
                (reduce #(assoc %1 (:id %2) %2) {} moved-pls))))
     (log/info "Moving playlist" playlist-id dir)
     (write-playlists! db bucket playlists-key cache)
-    {:status 200})))
+    {:status 200}))

 (defn fetch-video-meta
   [id db metadata-bucket cache]
@@ -148,9 +148,9 @@
              (DELETE "/playlist/:id" request
                      (delete-playlist! request database public-bucket playlists-key cache))
              (PUT "/playlist/:id/up" request
-                  (move-playlist! :up request database public-bucket playlists-key cache))
+                  (move-playlist! request :up database public-bucket playlists-key cache))
              (PUT "/playlist/:id/down" request
-                  (move-playlist! :down request database public-bucket playlists-key cache))
+                  (move-playlist! request :down database public-bucket playlists-key cache))
              (POST "/video/:id/metadata" request
                    (save-video-meta! request database metadata-bucket cache))
              (GET  "/video/:id/metadata" [id]


Add action-button component that will show loading icon during API call

--- src/cljs/elevent_client/core.cljs
+++ src/cljs/elevent_client/core.cljs
@@ -469,6 +469,20 @@
      :component-did-update #(.qrcode (js/jQuery (r/dom-node %))
                                      (clj->js options))
      :reagent-render (constantly [:div])}))
+
+; action must be a function that takes a callback for the API call as a param
+(defn action-button [options text action & [alt-text]]
+  (let [loading-text [:i.spinner.loading.icon]
+        button-text  (atom text)]
+    (fn [options text action & [alt-text alt-action]]
+      [:div.ui.button
+       (merge options
+              {:on-click (fn []
+                           (reset! button-text loading-text)
+                           (if alt-text
+                             (action #(reset! button-text alt-text))
+                             (action #(reset! button-text text))))})
+       @button-text])))

 ;; Compenents
@@ -1239,13 +1253,14 @@
                        @organizations-db))

             create-event
-            (fn [e form]
-              (when (empty? errors)
-                (.preventDefault e)
-                (events-endpoint :create
-                                 form
-                                 #(set! js/window.location
-                                        (events-explore-route)))))]
+            (fn [form]
+              (fn [callback]
+                (when (empty? errors)
+                  (events-endpoint :create
+                                   form
+                                   #(do
+                                      (callback)
+                                      (js/location.replace (events-explore-route)))))))]
         [:div.sixteen.wide.column
          [:div.ui.top.attached.tabular.menu
           [:a.item {:href (events-route)}
@@ -1319,10 +1334,11 @@
              [:label "Description"]
              [input-atom :textarea
               (r/wrap Description swap! form assoc :Description)]]
-            [:button.ui.primary.button {:class (when (seq errors) "disabled")
-                                        :type :submit
-                                        :on-click #(create-event % @form)}
-             "Add"]]]]]))))
+            [action-button
+             {:class (str "primary" (when (seq errors) " disabled"))
+              :type :submit}
+             "Add"
+             (create-event @form)]]]]]))))

 (defn event-activity-edit-page [event-id & [activity-id]]
   (let [form (atom {:EventId event-id})
@@ -1364,18 +1380,20 @@
                              event-id)))

             create-activity
-            (fn [e form]
-              (when (empty? errors)
-                (.preventDefault e)
-                (activities-endpoint :create
-                                     (let [start-time (:StartTime form)
-                                           end-time   (:EndTime form)]
-                                       (assoc form
-                                         :StartTime (unparse (:date-hour-minute-second formatters)
-                                                             (from-string start-time))
-                                         :EndTime (unparse (:date-hour-minute-second formatters)
-                                                           (from-string end-time))))
-                                     #(reset-form!))))]
+            (fn [form]
+              (fn [callback]
+                (when (empty? errors)
+                  (activities-endpoint :create
+                                       (let [start-time (:StartTime form)
+                                             end-time   (:EndTime form)]
+                                         (assoc form
+                                           :StartTime (unparse (:date-hour-minute-second formatters)
+                                                               (from-string start-time))
+                                           :EndTime (unparse (:date-hour-minute-second formatters)
+                                                             (from-string end-time))))
+                                       #(do
+                                          (callback)
+                                          (reset-form!))))))]
         (when (seq event)
           [:div.sixteen.wide.column
            [:div.ui.segment
@@ -1418,10 +1436,11 @@
                [:label "Description"]
                [input-atom :textarea
                 (r/wrap Description swap! form assoc :Description)]]
-              [:button.ui.primary.button {:class (when (seq errors) "disabled")
-                                          :type :submit
-                                          :on-click #(create-activity % @form)}
-               "Add"]]]
+              [action-button
+               {:class (str "primary" (when (seq errors) " disabled"))
+                :type :submit}
+               "Add"
+               (create-activity @form)]]]
             [:div.ui.vertical.segment
              [:h2.ui.header
               "Activities"]
@@ -1445,8 +1464,7 @@

 (defn event-attendee-page [event-id attendee-id]
   (let [check-in-or-out
-        (fn [op url init callback]
-          (init)
+        (fn [op url callback]
           (op (str api-url url)
               {:format :json
                :keywords? true
@@ -1457,25 +1475,23 @@
                  {})
                :handler callback
                :error-handler (fn []
-                                (swap! messages conj [:error "Check in failed. Please try again."]))}))
-
-        button-loading? (atom false)]
+                                (swap! messages conj [:error "Check in failed. Please try again."]))}))]
     (fn [event-id attendee-id]
       (let [event (into {} (d/entity @events-db event-id))

             attendee
-            (atom (into {} (first (map (fn [[user-id attendee-id]]
-                                         (merge (into {} (d/entity @users-db
-                                                                   user-id))
-                                                (into {} (d/entity @attendees-db
-                                                                   attendee-id))))
-                                       (d/q '[:find ?e ?a
-                                              :in $ ?attendee-id
-                                              :where
-                                              [?a :AttendeeId ?attendee-id]
-                                              [?a :UserId ?e]]
-                                            @attendees-db
-                                            attendee-id)))))
+            (into {} (first (map (fn [[user-id attendee-id]]
+                                   (merge (into {} (d/entity @users-db
+                                                             user-id))
+                                          (into {} (d/entity @attendees-db
+                                                             attendee-id))))
+                                 (d/q '[:find ?e ?a
+                                        :in $ ?attendee-id
+                                        :where
+                                        [?a :AttendeeId ?attendee-id]
+                                        [?a :UserId ?e]]
+                                      @attendees-db
+                                      attendee-id))))

             attendee-activities
             (d/q '[:find ?schedule-id ?activity-id
@@ -1491,58 +1507,48 @@
                  @attendees-db
                  event-id
                  attendee-id)]
-        (let [button-text (atom (if @button-loading?
-                                  [:i.spinner.loading.icon]
-                                  (if (:CheckinTime @attendee)
-                                    "Check out"
-                                    "Check in")))
-
-              check-in
+        (let [check-in
               (fn [attendee-id]
-                (check-in-or-out PUT
-                                 (str "/attendees/" attendee-id "/checkin")
-                                 #(reset! button-loading? true)
-                                 (fn []
-                                   (prn "Checked in!")
-                                   (attendees-endpoint :read nil #(reset! button-loading? false)))))
+                (fn [callback]
+                  (check-in-or-out PUT
+                                   (str "/attendees/" attendee-id "/checkin")
+                                   (fn []
+                                     (prn "Checked in!")
+                                     (attendees-endpoint :read nil callback)))))

               check-out
               (fn [attendee-id]
-                (check-in-or-out DELETE
-                                 (str "/attendees/" attendee-id "/checkin")
-                                 #(reset! button-loading? true)
-                                 (fn []
-                                   (prn "Checked out!")
-                                   (attendees-endpoint :read nil #(reset! button-loading? false)))))
+                (fn [callback]
+                  (check-in-or-out DELETE
+                                   (str "/attendees/" attendee-id "/checkin")
+                                   (fn []
+                                     (prn "Checked out!")
+                                     (attendees-endpoint :read nil callback)))))

               activity-check-in
-              (fn [schedule-id checked-in callback]
-                (check-in-or-out PUT
-                                 (str "/schedules/" schedule-id "/checkin")
-                                 #()
-                                 (fn []
-                                   (prn "Checked in!")
-                                   (schedules-endpoint :read nil #(do
-                                                                    ;(reset! checked-in true)
-                                                                    (callback))))))
+              (fn [schedule-id checked-in]
+                (fn [callback]
+                  (check-in-or-out PUT
+                                   (str "/schedules/" schedule-id "/checkin")
+                                   (fn []
+                                     (prn "Checked in!")
+                                     (schedules-endpoint :read nil callback)))))

               activity-check-out
-              (fn [schedule-id checked-in callback]
-                (check-in-or-out DELETE
-                                 (str "/schedules/" schedule-id "/checkin")
-                                 #()
-                                 (fn []
-                                   (prn "Checked out!")
-                                   (schedules-endpoint :read nil #(do
-                                                                    ;(reset! checked-in false)
-                                                                    (callback))))))]
-          (when (seq event)
+              (fn [schedule-id checked-in]
+                (fn [callback]
+                  (check-in-or-out DELETE
+                                   (str "/schedules/" schedule-id "/checkin")
+                                   (fn []
+                                     (prn "Checked out!")
+                                     (schedules-endpoint :read nil callback)))))]
+          (when (and (seq event) (seq attendee))
             [:div.sixteen.wide.column
              [:div.ui.segment
               [:div
                [:div.ui.vertical.segment
                 [:h1.ui.header
-                 (str (:FirstName @attendee) " " (:LastName @attendee))]]
+                 (str (:FirstName attendee) " " (:LastName attendee))]]
                [:div.ui.vertical.segment
                 [:div.ui.divided.items
                  [:div.item
@@ -1564,11 +1570,17 @@
                    [:div.description
                     (:Description event)]
                    [:div.extra
-                    [:div.ui.right.floated.button
-                     {:on-click #(if (:CheckinTime @attendee)
-                                   (check-out attendee-id)
-                                   (check-in attendee-id))}
-                     @button-text]]]]]]
+                    [action-button
+                     {:class "right floated"}
+                     (if (:CheckinTime attendee)
+                       "Check out"
+                       "Check in")
+                     (if (:CheckinTime attendee)
+                       (check-out attendee-id)
+                       (check-in attendee-id))
+                     (if (:CheckinTime attendee)
+                       "Check in"
+                       "Check out")]]]]]]
                [:div.ui.vertical.segment
                 [:h3.ui.header
                  "Attendee Info"]
@@ -1576,7 +1588,7 @@
                  [:tbody
                   [:tr
                    [:td "Email"]
-                   [:td (:Email @attendee)]]]]]
+                   [:td (:Email attendee)]]]]]
                [:div.ui.vertical.segment
                 [:h3.ui.header
                  "Attendee Schedule"]
@@ -1598,8 +1610,7 @@
                           (when schedule-id
                             (d/entity @schedules-db schedule-id))]
                       (let
-                        [checked-in (atom (not (nil? (:CheckinTime schedule))))
-                         checking-in (atom false)]
+                        [checked-in (atom (not (nil? (:CheckinTime schedule))))]
                         [:tr
                          [:td {:noWrap true}
                           (when activity
@@ -1612,17 +1623,17 @@
                          [:td (:Name activity)]
                          [:td (:Location activity)]
                          [:td.right.aligned {:noWrap true}
-                          [:div.ui.button
-                           {:on-click (fn []
-                                        (reset! checking-in true)
-                                        (if @checked-in
-                                          (activity-check-out schedule-id checked-in #(reset! checking-in false))
-                                          (activity-check-in schedule-id checked-in #(reset! checking-in false))))}
-                           (if @checking-in
-                             [:i.spinner.loading.icon] ; todo: not working
-                             (if @checked-in
-                               "Check out"
-                               "Check in"))]]])))]]]]]]))))))
+                          [action-button
+                           {}
+                           (if @checked-in
+                             "Check out"
+                             "Check in")
+                           (if @checked-in
+                             (activity-check-out schedule-id checked-in)
+                             (activity-check-in schedule-id checked-in))
+                           (if @checked-in
+                             "Check in"
+                             "Check out")]]])))]]]]]]))))))

 (defn event-register-page [event-id]
   (let [form (atom {:Email (get-in @session [:user :Email])
@@ -1644,22 +1655,26 @@

             register
             (fn [form]
-              (when (empty? errors)
-                ; TODO: maybe this logic is wrong?MIght want to buy ticket even if not required
-                (if (:RequiresPayment event)
-                  (renew-stripe-token!
-                    (fn [] (attendees-endpoint :create
-                                               {:UserId (get-in @session [:user :UserId])
-                                                :EventId event-id
-                                                :Token (:stripe-token @session)
-                                                :Amount (:TicketPrice event)}
-                                               #(do
-                                                  (swap! session dissoc :stripe-token)
-                                                  (js/location.replace (events-route))))))
-                  (attendees-endpoint :create
-                                      {:UserId (get-in @session [:user :UserId])
-                                       :EventId event-id}
-                                      #(js/location.replace (events-route))))))]
+              (fn [callback]
+                (when (empty? errors)
+                  ; TODO: maybe this logic is wrong?MIght want to buy ticket even if not required
+                  (if (:RequiresPayment event)
+                    (renew-stripe-token!
+                      (fn [] (attendees-endpoint :create
+                                                 {:UserId (get-in @session [:user :UserId])
+                                                  :EventId event-id
+                                                  :Token (:stripe-token @session)
+                                                  :Amount (:TicketPrice event)}
+                                                 #(do
+                                                    (callback)
+                                                    (swap! session dissoc :stripe-token)
+                                                    (js/location.replace (events-route))))))
+                    (attendees-endpoint :create
+                                        {:UserId (get-in @session [:user :UserId])
+                                         :EventId event-id}
+                                        #(do
+                                           (callback)
+                                           (js/location.replace (events-route))))))))]
         (when (seq event)
           [:div.ui.stackable.page.grid
            [:div.sixteen.wide.column
@@ -1703,14 +1718,14 @@
                (when (:RequiresPayment event)
                  [payments-component])]
               [:div.ui.divider]
-              [:button.ui.primary.button
-               {:type :submit
-                :class (when (or (seq errors)
-                                 (and (:RequiresPayment event)
-                                      (nil? (:payment-info @session))))
-                         "disabled")
-                :on-click #(register @form)}
-               "Register"]]]]])))))
+              [action-button
+               {:class (str "primary" (when (or (seq errors)
+                                                (and (:RequiresPayment event)
+                                                     (nil? (:payment-info @session))))
+                                        " disabled"))
+                :type :submit}
+               "Register"
+               (register @form)]]]]])))))

 (defn event-schedule-page [event-id]
   (let [cart-activities (atom #{})
@@ -1997,12 +2012,13 @@
       (let [{:keys [Name]} @form
             errors (validator @form)
             create-organization
-            (fn [e form]
-              (.preventDefault e)
-              (organizations-endpoint :create
-                                      form
-                                      #(set! js/window.location
-                                             (organizations-route))))]
+            (fn [form]
+              (fn [callback]
+                (organizations-endpoint :create
+                                        form
+                                        #(do
+                                           (callback)
+                                           (js/location.replace (organizations-route))))))]
         [:div.sixteen.wide.column
          [:div.ui.segment
           [:form.ui.form
@@ -2014,11 +2030,11 @@
                                             "error")}
               [:label "Organization Name"]
               [input-atom :text (r/wrap Name swap! form assoc :Name)]]]
-            [:button.ui.primary.button
-             {:type :submit
-              :class (when (seq errors) "disabled")
-              :on-click #(create-organization % @form)}
-             "Add"]]]]]))))
+            [action-button
+             {:class (str "primary" (when (seq errors) " disabled"))
+              :type :submit}
+             "Add"
+             (create-organization @form)]]]]]))))

 (defn calendar-page []
   (let [user-activities


fix server list refresh issue

fix server list refresh issue

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -125,8 +125,8 @@
         [:form {:on-submit #(send-msg % owner)}
          [:input {:ref "msg-input" :placeholder "Say something"}]]]))))

-(defn remote-list []
-  (map #(str "Server " %) (-> (get-in @game-state [:corp :servers :remote]) count range reverse)))
+(defn remote-list [remotes]
+  (map #(str "Server " %) (-> remotes count range reverse)))

 (defn handle-dragstart [e cursor]
   (-> e .-target js/$ (.addClass "dragged"))
@@ -138,7 +138,7 @@
     (send-command "move" {:card card :server server})))

 (defn card-view [{:keys [zone code type abilities counter advance-counter advancementcost subtype
-                         advanceable rezzed strength current-strength title] :as cursor}
+                         advanceable rezzed strength current-strength title remotes] :as cursor}
                  owner {:keys [flipped] :as opts}]
   (om/component
    (when code
@@ -162,7 +162,7 @@
        (when current-strength [:div.darkbg.strength current-strength])
        (when (and (= zone ["hand"]) (#{"Agenda" "Asset" "ICE" "Upgrade"} type))
          (let [centrals ["HQ" "R&D" "Archives"]
-               remotes (conj (remote-list) "New remote")
+               remotes (conj (remote-list remotes) "New remote")
                servers (case type
                          ("Upgrade" "ICE") (concat remotes centrals)
                          ("Agenda" "Asset") remotes)]
@@ -210,23 +210,23 @@
       [:div.header {:class (when (> (count cursor) 0) "darkbg")}
        (str (:name opts) " (" (fn cursor) ")")]))))

-(defn hand-view [{:keys [identity hand max-hand-size user] :as cursor}]
-  (om/component
-   (sab/html
-    (let [side (:side identity)
-          size (count hand)
+(defn hand-view [{:keys [player remotes] :as cursor}]
+  (om/component
+   (sab/html
+    (let [side (get-in player [:identity :side])
+          size (count (:hand player))
           name (if (= side "Corp") "HQ" "Grip")]
       [:div.panel.blue-shade.hand
        (drop-area (:side @game-state) name {:class (when (> size 6) "squeeze")})
-       (om/build label hand {:opts {:name name}})
+       (om/build label (:hand player) {:opts {:name name}})
        (map-indexed (fn [i card]
                       (sab/html
                        [:div.card-wrapper {:class (if (playable? card) "playable" "")
                                            :style {:left (* (/ 320 (dec size)) i)}}
-                        (if (= user (:user @app-state))
-                          (om/build card-view card)
+                        (if (= (:user player) (:user @app-state))
+                          (om/build card-view (assoc card :remotes remotes))
                           [:img.card {:src (str "/img/" (.toLowerCase side) ".png")}])]))
-                    hand)]))))
+                    (:hand player))]))))

 (defn show-deck [event owner ref]
   (-> (om/get-node owner (str ref "-content")) js/$ .fadeIn)
@@ -432,15 +432,15 @@
                [:div.card-wrapper {:class (when (playable? c) "playable")}
                 (om/build card-view c)])])])))

-(defn zones [cursor]
+(defn zones [{:keys [player remotes]} cursor]
   (om/component
    (sab/html
     [:div.dashboard
-     (om/build hand-view cursor)
-     (om/build discard-view cursor)
-     (om/build deck-view cursor)
+     (om/build hand-view {:player player :remotes remotes})
+     (om/build discard-view player)
+     (om/build deck-view player)
      [:div.panel.blue-shade.identity
-      (om/build card-view (:identity cursor))]])))
+      (om/build card-view (:identity player))]])))

 (defn cond-button [text cond f]
   (sab/html
@@ -472,7 +472,7 @@
                opponent ((if (= side :corp) :runner :corp) cursor)]
            [:div.gameboard
             [:div.mainpane
-             (om/build zones opponent)
+             (om/build zones {:player me :remotes (get-in cursor [:corp :servers :remote])})
              [:div.centralpane
               [:div.leftpane
                [:div
@@ -530,7 +530,8 @@
                          [:div.run-button
                           (cond-button "Run" (>= (:click me) 1)
                                        #(-> (om/get-node owner "servers") js/$ .toggle))
-                          (let [servers (concat (remote-list) ["HQ" "R&D" "Archives"])]
+                          (let [remotes (get-in cursor [:corp :servers :remote])
+                                servers (concat (remote-list remotes) ["HQ" "R&D" "Archives"])]
                             [:div.blue-shade.panel.servers-menu {:ref "servers"}
                              (map (fn [label]
                                     [:div {:on-click #(do (send-command "run" {:server label})
@@ -545,7 +546,7 @@
               [:div.board
                (om/build board-view {:player opponent :run run})
                (om/build board-view {:player me :run run})]]
-             (om/build zones me)]
+             (om/build zones {:player me :remotes (get-in cursor [:corp :servers :remote])})]
             [:div.rightpane {}
              [:div.card-zoom
               (when-let [card (om/get-state owner :zoom)]


[#12919] Allowing adding emoji in status input even if it exceeds limit

--- src/status_im/ui/screens/status/new/views.cljs
+++ src/status_im/ui/screens/status/new/views.cljs
@@ -12,7 +12,8 @@
             [status-im.ui.components.icons.icons :as icons]
             [quo.components.animated.pressable :as pressable]
             [status-im.ui.screens.status.views :as status.views]
-            [status-im.ui.screens.status.new.styles :as styles]))
+            [status-im.ui.screens.status.new.styles :as styles]
+            [status-im.utils.platform :as platform]))

 (defn buttons []
   [react/view styles/buttons
@@ -43,7 +44,7 @@
         ^{:key (str "image" img)}
         [image-preview img])]]))

-(def message-max-lenght 600)
+(def message-max-length 600)

 (defn my-status []
   (let [images-opened (reagent/atom false)
@@ -53,7 +54,8 @@
         input-text (re-frame/subscribe [:chats/timeline-chat-input-text])
         sending-image (re-frame/subscribe [:chats/timeline-sending-image])]
     (fn []
-      (let [{:keys [uri]} (first (vals @sending-image))]
+      (let [{:keys [uri]} (first (vals @sending-image))
+            text-length (count @input-text)]
         [kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
          [:<>
           [react/scroll-view {:style                        {:flex 1}
@@ -65,7 +67,10 @@
             {:style                  {:margin 16}
              :scroll-enabled         false
              :accessibility-label    :my-status-input
-             :max-length             message-max-lenght
+             :max-length             (if platform/android?
+                                       message-max-length
+                                       (when (>= text-length message-max-length)
+                                         text-length))
              :auto-focus             true
              :multiline              true
              :on-selection-change    (fn [args]
@@ -100,11 +105,14 @@
                {:accessibility-label :send-my-status-button
                 :type                :secondary
                 :after               :main-icon/send
-                :disabled            (and (string/blank? @input-text) (not uri))
+                :disabled            (or (> text-length message-max-length)
+                                         (and (string/blank? @input-text) (not uri)))
                 :on-press            #(do
                                         (re-frame/dispatch [:profile.ui/send-my-status-message])
                                         (re-frame/dispatch [:navigate-back]))}
                (i18n/label :t/wallet-send)]}]
             [react/view styles/count-container
-             [react/text {:style {:color colors/gray}}
-              (str (count @input-text) " / " message-max-lenght)]]]]]]))))
+             [react/text {:style {:color (if (> text-length message-max-length)
+                                           colors/red
+                                           colors/gray)}}
+              (str text-length " / " message-max-length)]]]]]]))))


refactored

refactored

--- src/ardoq/swagger/map_openapi_3_spec.clj
+++ src/ardoq/swagger/map_openapi_3_spec.clj
@@ -41,7 +41,7 @@
   (reduce
     (fn [data object-spec]
       (if (map-entry? object-spec)
-        (apply transform-object-fn [(name (key object-spec)) parent-key data (val object-spec) spec-type])
+        (apply transform-object-fn [(key object-spec) parent-key data (val object-spec) spec-type])
         (apply transform-object-fn [(or (:name object-spec) (name spec-type)) parent-key data object-spec spec-type])))
     data
     param-spec))
@@ -127,14 +127,13 @@
    :tokenUrl
    :refreshUrl])

-(defn transform-oauth-flow-object [parameter-name parent-key data oauth-flow-object-spec spec-type]
-  (prn "oauth flow" parameter-name)
-  (let [key (str parent-key "/" parameter-name)
+(defn transform-oauth-flow-object [flow-key parent-key data oauth-flow-object-spec spec-type]
+  (let [key (str parent-key "/" (name flow-key))
         scopes-spec (:scopes oauth-flow-object-spec)
         scopes-md (common/render-resource-strings "templates/oauth-scopes.tpl" scopes-spec (keys scopes-spec))
         oauth-flow-object-spec (assoc oauth-flow-object-spec :scopesMd scopes-md)]
     (-> data
-        (update-in [:swagger-object key] assoc :name parameter-name)
+        (update-in [:swagger-object key] assoc :name (name flow-key))
         (update-in [:swagger-object key] assoc :type spec-type)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/oauth-flow-object.tpl" oauth-flow-object-spec oauth-flow-fields)))))
@@ -147,13 +146,13 @@
    :bearerFormat
    :openIdConnectUrl])

-(defn transform-security-scheme-object [parameter-name parent-key data security-scheme-object-spec spec-type]
+(defn transform-security-scheme-object [scheme-key parent-key data security-scheme-object-spec spec-type]
   (if-let [ref (:$ref security-scheme-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)]
-      (-> data
-          (update-in [:swagger-object key] assoc :name parameter-name)
+    (let [key (str parent-key "/" (name scheme-key))]
+      (-> data
+          (update-in [:swagger-object key] assoc :name (name scheme-key))
           (update-in [:swagger-object key] assoc :type spec-type)
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/security-scheme-object.tpl" security-scheme-object-spec security-scheme-fields))
@@ -161,15 +160,15 @@

-(defn transform-example-object [parameter-name parent-key data example-object-spec spec-type]
+(defn transform-example-object [encoding-key parent-key data example-object-spec spec-type]
   (if-let [ref (:$ref example-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)
+    (let [key (str parent-key "/" (name encoding-key))
           example-object-spec (assoc example-object-spec :hasValue (some? (:value example-object-spec)))
           example-object-spec (assoc example-object-spec :hasExternalValue (some? (:externalValue example-object-spec)))]
       (-> data
-          (update-in [:swagger-object key] assoc :name parameter-name)
+          (update-in [:swagger-object key] assoc :name (name encoding-key))
           (update-in [:swagger-object key] assoc :type spec-type)
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/example-object.tpl" example-object-spec []))))))
@@ -181,10 +180,10 @@
    :explode
    :allowReserved])

-(defn transform-encoding-object [parameter-name parent-key data encoding-object-spec spec-type]
-  (let [key (str parent-key "/" parameter-name)]
-    (-> data
-        (update-in [:swagger-object key] assoc :name parameter-name)
+(defn transform-encoding-object [encoding-key parent-key data encoding-object-spec spec-type]
+  (let [key (str parent-key "/" (name encoding-key))]
+    (-> data
+        (update-in [:swagger-object key] assoc :name (name encoding-key))
         (update-in [:swagger-object key] assoc :type spec-type)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/encoding-object.tpl" encoding-object-spec encoding-table-fields))
@@ -195,16 +194,16 @@
    :operationId
    :requestBody])

-(defn transform-link-object [parameter-name parent-key data link-object-spec spec-type]
+(defn transform-link-object [link-key parent-key data link-object-spec spec-type]
   (if-let [ref (:$ref link-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)
+    (let [key (str parent-key "/" (name link-key))
           link-parameters (:parameters link-object-spec)
           link-parameters-md (common/render-resource-strings "templates/link-parameters.tpl" link-parameters (keys link-parameters))
           link-object-spec (assoc link-object-spec :linkParameters link-parameters-md)]
       (-> data
-          (update-in [:swagger-object key] assoc :name parameter-name)
+          (update-in [:swagger-object key] assoc :name (name link-key))
           (update-in [:swagger-object key] assoc :type spec-type)
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/link-object.tpl" link-object-spec link-table-fields))
@@ -212,10 +211,10 @@
               (transform-server-object % server-object-spec)
               %))))))

-(defn transform-media-type-object [parameter-name parent-key data media-type-object-spec spec-type]
-  (let [key (str parent-key "/" parameter-name)]
-    (-> data
-        (update-in [:swagger-object key] assoc :name parameter-name)
+(defn transform-media-type-object [media-type-key parent-key data media-type-object-spec spec-type]
+  (let [key (str parent-key "/" (name media-type-key))]
+    (-> data
+        (update-in [:swagger-object key] assoc :name (name media-type-key))
         (update-in [:swagger-object key] assoc :type spec-type)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/media-type-object.tpl" media-type-object-spec []))
@@ -229,13 +228,13 @@
 (def request-body-fields
   [:required])

-(defn transform-request-body-object [parameter-name parent-key data request-body-object-spec spec-type]
+(defn transform-request-body-object [request-body-key parent-key data request-body-object-spec spec-type]
   (if-let [ref (:$ref request-body-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)]
-      (-> data
-          (update-in [:swagger-object key] assoc :name parameter-name)
+    (let [key (str parent-key "/" (name request-body-key))]
+      (-> data
+          (update-in [:swagger-object key] assoc :name (name request-body-key))
           (update-in [:swagger-object key] assoc :type spec-type)
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/request-body-object.tpl" request-body-object-spec request-body-fields))
@@ -253,13 +252,13 @@
    :example])

-(defn transform-parameter-object [parameter-name parent-key data parameter-object-spec spec-type]
+(defn transform-parameter-object [parameter-key parent-key data parameter-object-spec spec-type]
   (if-let [ref (:$ref parameter-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)]
-      (-> data
-          (update-in [:swagger-object key] assoc :name parameter-name)
+    (let [key (str parent-key "/" (name parameter-key))]
+      (-> data
+          (update-in [:swagger-object key] assoc :name (name parameter-key))
           (update-in [:swagger-object key] assoc :type spec-type)
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/parameter-object.tpl" parameter-object-spec parameter-table-fields))
@@ -293,14 +292,14 @@
    :operationId
    :deprecated])

-(defn transform-operation-object [parent-key data [operation-object-key operation-object-spec]]
-  (let [key (str parent-key "/" (name operation-object-key))
+(defn transform-operation-object [operation-key parent-key data operation-object-spec spec-type]
+  (let [key (str parent-key "/" (name operation-key))
         security-requirements (:security operation-object-spec)
         operation-object-spec (assoc operation-object-spec :securityMd (render-security-requirements-object security-requirements))
         operation-object-spec (assoc operation-object-spec :hasExternalDocs (some? (:externalDocs operation-object-spec)))]
     (-> data
-        (update-in [:swagger-object key] assoc :name (name operation-object-key))
-        (update-in [:swagger-object key] assoc :type :OpenAPI-Operation)
+        (update-in [:swagger-object key] assoc :name (name operation-key))
+        (update-in [:swagger-object key] assoc :type spec-type)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/operation-object.tpl" operation-object-spec operation-fields))
         (transform-objects transform-parameter-object (:parameters operation-object-spec) key :OpenAPI-Parameter)
@@ -311,34 +310,19 @@
         (transform-objects transform-response-object (:responses operation-object-spec) key :OpenAPI-Response))))

-(defn transform-operation-objects [data path-spec parent-key]
-  (reduce
-    (partial transform-operation-object parent-key)
-    data
-    (select-keys path-spec [:get :put :post :delete :options :head :patch :trace])))
-
-
-(defn transform-path-object [data [path-object-key path-object-spec]]
-  (let [parent-key "#/paths"
-        key (str parent-key "/" (name path-object-key))
+(defn transform-path-object [path-key parent-key data path-object-spec spec-type]
+  (let [key (str parent-key "/" (name path-key))
         data (-> data
-                 (update-in [:swagger-object key] assoc :name (subs (str path-object-key) 1))
+                 (update-in [:swagger-object key] assoc :name (subs (str path-key) 1))
                  (update-in [:swagger-object key] assoc :type :OpenAPI-Path)
                  (update-in [:swagger-object key] assoc :parent parent-key)
                  (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/path-object.tpl" path-object-spec))
-                 (transform-operation-objects path-object-spec key)
+                 (transform-objects transform-operation-object (select-keys path-object-spec [:get :put :post :delete :options :head :patch :trace]) key :OpenAPI-Operation)
                  (transform-objects transform-parameter-object (:parameters path-object-spec) key :OpenAPI-Parameter))]
-    (name path-object-key)
     (if-let [ref (:$ref path-object-spec)]
       (-> data
           (update-in [:references] conj {:source-path key :target-path ref}))
       data)))
-
-(defn transform-paths-object [data spec]
-  (reduce
-    transform-path-object
-    data
-    (:paths spec)))

 (defn transform-components-object [data spec]
@@ -355,6 +339,7 @@
         )))

+
 (def server-variable-fields [:enum :default])

 (defn transform-server-variable [var-name var-spec]
@@ -381,6 +366,7 @@
         (update-in [:swagger-object key] assoc :type :OpenAPI-Server)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/server-object.tpl" render-data)))))
+

 (defn transform-servers-object [data spec]
   (reduce
@@ -441,7 +427,7 @@
     (->
       data
       (create-scaffolding)
-      (transform-paths-object spec)
+      (transform-objects transform-path-object (:paths spec) "#/paths" :OpenAPI-Path)
       (transform-servers-object spec)
       (transform-components-object spec))))


Add blurb about code-signing feature flag

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -380,6 +380,11 @@
                                    "If this option is selected, then CircleCI will run builds for this project "
                                    "on Mac OSX rather than Linux. Select this if you have an iOS application "
                                    "that you want to build using CircleCI."]})
+            (describe-flag {:flag :osx-code-signing-enabled
+                            :title "Code Signing Support"
+                            :blurb [:p
+                                    "Enable automatic importing of code-signing identities and provisioning "
+                                    "profiles into the system keychain to simplify the code-signing process."]})

            (when (feature/enabled? :enable-trusty-setting)
              (describe-flag {:flag :trusty-beta


best fit series works

best fit series works


Update CodeDeploy regions

Update CodeDeploy regions

Data pulled from
https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1876,8 +1876,17 @@
                                   :on-change #(utils/edit-input owner (conj state/project-path :aws :services :codedeploy app-name :region) %)}
             [:option {:value ""} "Choose AWS Region..."]
             [:option {:disabled "disabled"} "-----"]
-            [:option {:value "us-east-1"} "us-east-1"]
-            [:option {:value "us-west-2"} "us-west-2"]]
+            [:option {:value "us-east-1"} "us-east-1"]  ;; Virginia
+            [:option {:value "us-west-1"} "us-west-1"]  ;; Northern California
+            [:option {:value "us-west-2"} "us-west-2"]  ;; Oregon
+            [:option {:value "sa-east-1"} "sa-east-1"]  ;; Sao Paulo
+            [:option {:value "eu-west-1"} "eu-west-1"]  ;; Ireland
+            [:option {:value "eu-central-1"} "eu-central-1"]  ;; Frankfurt
+            [:option {:value "ap-northeast-1"} "ap-northeast-1"]  ;; Tokyo
+            [:option {:value "ap-northeast-2"} "ap-northeast-2"]  ;; Seoul
+            [:option {:value "ap-southeast-1"} "ap-southeast-1"]  ;; Singapore
+            [:option {:value "ap-southeast-2"} "ap-southeast-2"]  ;; Sydney
+            [:option {:value "ap-south-1"} "ap-south-1"]] ;; Mumbai

            [:div.input-with-help
             [:input#application-root


CodeDeploy regions

CodeDeploy regions

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1874,19 +1874,24 @@
                                   :value (or aws-region "")
                                   ;; Updates the project cursor in order to trigger a re-render
                                   :on-change #(utils/edit-input owner (conj state/project-path :aws :services :codedeploy app-name :region) %)}
+            ;; From http://docs.aws.amazon.com/general/latest/gr/rande.html#codedeploy_region
             [:option {:value ""} "Choose AWS Region..."]
             [:option {:disabled "disabled"} "-----"]
-            [:option {:value "us-east-1"} "us-east-1"]  ;; Virginia
-            [:option {:value "us-west-1"} "us-west-1"]  ;; Northern California
-            [:option {:value "us-west-2"} "us-west-2"]  ;; Oregon
-            [:option {:value "sa-east-1"} "sa-east-1"]  ;; Sao Paulo
-            [:option {:value "eu-west-1"} "eu-west-1"]  ;; Ireland
-            [:option {:value "eu-central-1"} "eu-central-1"]  ;; Frankfurt
-            [:option {:value "ap-northeast-1"} "ap-northeast-1"]  ;; Tokyo
-            [:option {:value "ap-northeast-2"} "ap-northeast-2"]  ;; Seoul
-            [:option {:value "ap-southeast-1"} "ap-southeast-1"]  ;; Singapore
-            [:option {:value "ap-southeast-2"} "ap-southeast-2"]  ;; Sydney
-            [:option {:value "ap-south-1"} "ap-south-1"]] ;; Mumbai
+            [:option {:value "us-east-1"} "us-east-1"]  ;; US East (N. Virginia)
+            [:option {:value "us-east-2"} "us-east-2"]  ;; US East (Ohio)
+            [:option {:value "us-west-1"} "us-west-1"]  ;; US West (N. California)
+            [:option {:value "us-west-2"} "us-west-2"]  ;; US West (Oregon)
+            [:option {:value "ca-central-1"} "ca-central-1"]  ;; Canada (Central)
+            [:option {:value "ap-south-1"} "ap-south-1"]] ;; Asia Pacific (Mumbai)
+            [:option {:value "sa-east-1"} "sa-east-1"]  ;; South America (São Paulo)
+            [:option {:value "eu-west-1"} "eu-west-1"]  ;; EU (Ireland)
+            [:option {:value "eu-west-2"} "eu-west-2"]  ;; EU (London)
+            [:option {:value "eu-central-1"} "eu-central-1"]  ;; EU (Frankfurt)
+            [:option {:value "ap-northeast-1"} "ap-northeast-1"]  ;; Asia Pacific (Tokyo)
+            [:option {:value "ap-northeast-2"} "ap-northeast-2"]  ;; Asia Pacific (Seoul)
+            [:option {:value "ap-southeast-1"} "ap-southeast-1"]  ;; Asia Pacific (Singapore)
+            [:option {:value "ap-southeast-2"} "ap-southeast-2"]  ;; Asia Pacific (Sydney)
+            [:option {:value "cn-north-1"} "cn-north-1"]  ;; China (Beijing)

            [:div.input-with-help
             [:input#application-root


refactor to use  .. interop macro

refactor to use  .. interop macro

--- examples/src/famous_examples/core.cljs
+++ examples/src/famous_examples/core.cljs
@@ -25,7 +25,7 @@
            (clj->js {"origin"    [0.5 0.5]
                      "align"     [0.5 0.5]
                      "transform" (fn []
-                                     (let [theta (* .002 (- (.now js/Date) initialTime))]
+                                     (let [theta (* .002 (- (.. js/Date now) initialTime))]
                                           (.. Transform (rotateY theta))))})))


Fix 404 error and point now in new docs URL

--- examples/todomvc/src/todomvc/subs.cljs
+++ examples/todomvc/src/todomvc/subs.cljs
@@ -4,7 +4,7 @@
 ;; -------------------------------------------------------------------------------------
 ;; Layer 2
 ;;
-;; See https://github.com/day8/re-frame/blob/master/docs/SubscriptionInfographic.md
+;; See https://day8.github.io/re-frame/subscriptions/
 ;;
 ;; Layer 2 query functions are "extractors". They take from `app-db`
 ;; and don't do any further computation on the extracted values. Any further
@@ -30,7 +30,7 @@
 ;; -------------------------------------------------------------------------------------
 ;; Layer 3
 ;;
-;; See https://github.com/day8/re-frame/blob/master/docs/SubscriptionInfographic.md
+;; See https://day8.github.io/re-frame/subscriptions/
 ;;
 ;; A subscription handler is a function which is re-run when its input signals
 ;; change. Each time it is rerun, it produces a new output (return value).


fixed volume options outbound mapping

fixed volume options outbound mapping

--- src/clj/swarmpit/docker/engine/mapper/outbound.clj
+++ src/clj/swarmpit/docker/engine/mapper/outbound.clj
@@ -70,7 +70,7 @@
   (when (some? service-volume)
     {:Labels       (:labels service-volume)
      :DriverConfig {:Name    (get-in service-volume [:driver :name])
-                    :Options (get-in service-volume [:driver :options])}}))
+                    :Options (name-value->map (get-in service-volume [:driver :options]))}}))

 (defn ->service-mounts
   [service]


Add profile screen in profile stack

Add profile screen in profile stack

Fixes #7437

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

--- src/status_im/ui/screens/routing/profile_stack.cljs
+++ src/status_im/ui/screens/routing/profile_stack.cljs
@@ -3,6 +3,7 @@
             [status-im.ui.screens.profile.user.views :as profile.user]
             [status-im.ui.screens.ens.views :as ens]
             [status-im.ui.screens.contacts-list.views :as contacts-list]
+            [status-im.ui.screens.profile.contact.views :as profile.contact]
             [status-im.ui.screens.profile.photo-capture.views :as photo-capture]
             [status-im.ui.screens.bootnodes-settings.edit-bootnode.views
              :as
@@ -63,6 +64,8 @@
      :component ens/name-details}
     {:name      :blocked-users-list
      :component contacts-list/blocked-users-list}
+    {:name      :profile
+     :component profile.contact/profile}
     {:name      :profile-photo-capture
      :component photo-capture/profile-photo-capture}
     {:name      :bootnodes-settings


- separate webscript specific and framework namespaces

--- src/test/resources/webscripts/test/clojure1.get.clj
+++ src/test/resources/webscripts/test/clojure1.get.clj
@@ -1,3 +1,5 @@
 (ns test.alfresco)

+(def model (var-get (ns-resolve 'spring.surf.webscript 'model)))
+
 (assoc! model :clojureVal "SUCCESS")


Start coping with substratum changes

Start coping with substratum changes

Specifically the way the "platform" is installed.

Completely and totally untested.

--- src/com/frereth/admin/db/core.clj
+++ src/com/frereth/admin/db/core.clj
@@ -1,7 +1,7 @@
 (ns com.frereth.admin.db.core
   "Fundamental 12-factor rule: admin functions should be completely separate from standard user's interface"
   (:require [clojure.spec :as s]
-            [com.jimrthy.substratum.platform :as db-schema]
+            [com.jimrthy.substratum.installer :as schema-installer]
             [com.stuartsierra.component :as component]
             [hara.event :refer (raise)]
             [taoensso.timbre :as log]))
@@ -27,11 +27,11 @@
         :args (s/cat :this :db-owner)
         ;; Q: What does this return on success?
         :ret any?)
-(defn configure-base-schema
+(defn configure-base-schema!
   [system]
   (let [connection-string (-> system :database-uri :connection-string)]
     (log/info "Running schema installation transaction")
     (let [result
-          (db-schema/install-schema! (:database-schema system) connection-string)]
+          (schema-installer/install-platform! connection-string)]
       (log/info "Schema installed")
       result)))


Support multiple timers in wrap-with-metrics middleware

Normalization functions can now return more than one metric name. If so,
then each of those metrics are updated when the request is executed.

--- src/com/puppetlabs/middleware.clj
+++ src/com/puppetlabs/middleware.clj
@@ -4,6 +4,7 @@
   (:require [com.puppetlabs.utils :as utils]
             [com.puppetlabs.http :as pl-http]
             [ring.util.response :as rr]
+            [clojure.string :as s]
             [clojure.tools.logging :as log])
   (:use [metrics.timers :only (timer time!)]
         [metrics.meters :only (meter mark!)]))
@@ -120,20 +121,30 @@
   metric."
   [app prefix storage normalize-uri]
   (fn [req]
-    (let [metric-root (str (normalize-uri (:uri req)))
-          timer-key   [:timers metric-root]]
-      (when-not (get-in @storage timer-key)
+    (let [metric-roots (let [s (normalize-uri (:uri req))]
+                         (if (string? s) [s] s))
+          metric-roots (map #(s/replace % #"[:,=]" "_") metric-roots)]
+
+      ;; Create timer objects for each metric the user has requested
+      (doseq [metric-root metric-roots
+              :let [timer-key [:timers metric-root]]
+              :when (not (get-in @storage timer-key))]
         (swap! storage assoc-in timer-key (timer [prefix metric-root "service-time"])))

-      (time! (get-in @storage timer-key)
+      (let [timers (map #(get-in @storage [:timers %]) metric-roots)]
+        (utils/multitime! timers
+           (let [response  (app req)
+                 status    (:status response)]

-             (let [response  (app req)
-                   status    (:status response)
-                   meter-key [:meters metric-root status]]
-               (when-not (get-in @storage meter-key)
-                 (swap! storage assoc-in meter-key (meter [prefix metric-root (str status)] "reqs/s")))
-               (mark! (get-in @storage meter-key))
-               response)))))
+             ;; Create meter objects for each metric the user has
+             ;; requested
+             (doseq [metric-root metric-roots
+                     :let [meter-key [:meters metric-root status]]
+                     :when (not (get-in @storage meter-key))]
+               (swap! storage assoc-in meter-key (meter [prefix metric-root (str status)] "reqs/s"))
+               (mark! (get-in @storage meter-key)))
+
+             response))))))

 (defmacro wrap-with-metrics
   "Ring middleware that will tack performance counters for each URL.
@@ -159,10 +170,15 @@
   `storage`: An atom that will be used to hold references to all
   created metrics.

-  `normalize-uri`: A function that takes a URI, and returns a
-  transformed string. The result will be used to organize the metrics:
-  URI's with the same normalized representation will share timers and
-  meters. To have all URIs share the same metrics, use `identity`."
+  `normalize-uri`: A function that takes a URI, and returns a string
+  or collection of strings. For each string returned, a timer and
+  meter will be created if they don't already exist. To have multiple
+  URLs share the same timer/meter, `normalize-uri` should return some
+  of the same strings for each URL.
+
+  Metric names (and thus, the strings returned by `normalize-uri`
+  cannot contain ':', '=', or ',' characters. They will be replaced
+  with '_'."
   [app storage normalize-uri]
   `(let [prefix# ~(str *ns*)]
      (wrap-with-metrics* ~app prefix# ~storage ~normalize-uri)))


Use clojure style

Use clojure style

--- test/clj/clojurewerkz/statistiker/metrics_test.clj
+++ test/clj/clojurewerkz/statistiker/metrics_test.clj
@@ -34,16 +34,16 @@
     (is (almost= (mutual-information [0 0 'docid2' 'docid'] [0 99 87 0]) 0.6931471805599453 tol))
     (is (almost= (mutual-information [0 1 2 0] [0 1 2 3]) 1.0397207708399179 tol))))

-(deftest adjusted_mutual-information-values
+(deftest adjusted-mutual-information-values
   (testing "adjusted mututal information calculations"
-    (is (= (adjusted_mutual-information [1 2 3] [1 2 3])
-           (adjusted_mutual-information [3 2 1] [1 2 3])
-           (adjusted_mutual-information [1 2 3] [:a :b 2])
+    (is (= (adjusted-mutual-information [1 2 3] [1 2 3])
+           (adjusted-mutual-information [3 2 1] [1 2 3])
+           (adjusted-mutual-information [1 2 3] [:a :b 2])
            1.0))
-  	(is (= (adjusted_mutual-information [] []) 1.0))
-    (is (==(adjusted_mutual-information [1 2 3 4] [1 1 1 1]) 0.0))
-    (is (= (adjusted_mutual-information [:a :a :a :a] [1 1 1 1]) 1.0))   ;special limit case
-    (is (= (adjusted_mutual-information [:a 6 :d :f] [1 2 3 4]) 1.0))
-    (is (= (adjusted_mutual-information [0 0 :c2 :c1] [0 0 87 99]) 1.0))
-    (is (almost= (adjusted_mutual-information [0 0 'docid2' 'docid'] [0 99 87 0]) -0.20000000000000023 tol))
-    (is (= (adjusted_mutual-information [0 1 2 0] [0 1 2 3]) 0.0))))
+  	(is (= (adjusted-mutual-information [] []) 1.0))
+    (is (==(adjusted-mutual-information [1 2 3 4] [1 1 1 1]) 0.0))
+    (is (= (adjusted-mutual-information [:a :a :a :a] [1 1 1 1]) 1.0))   ;special limit case
+    (is (= (adjusted-mutual-information [:a 6 :d :f] [1 2 3 4]) 1.0))
+    (is (= (adjusted-mutual-information [0 0 :c2 :c1] [0 0 87 99]) 1.0))
+    (is (almost= (adjusted-mutual-information [0 0 'docid2' 'docid'] [0 99 87 0]) -0.20000000000000023 tol))
+    (is (= (adjusted-mutual-information [0 1 2 0] [0 1 2 3]) 0.0))))


+comment

+comment

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -159,7 +159,7 @@
                                               :mod head-synsem}}
                               :head {:phrasal false
                                      :synsem {:propernoun propernoun
-                                              :modified false}} ;; TODO: document what purpose :modified serves (if any: if none, remove).
+                                              :modified false}} ;; TODO: document what purpose :modified serves (if any: if none, remove): clue: probably (was intended|is needed for) for rathole prevention.
                               :rule "nbar"
                               :synsem head-synsem}))


+TODO

+TODO

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2239,6 +2239,8 @@
    })

 (def lexicon (promise))
+
+;; TODO: allow a filter of lexemes
 (defn deliver-lexicon []
   (if (not (realized? lexicon))
     (deliver lexicon


added apagar

added apagar

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -109,7 +109,7 @@
                         :sem {:pred :add}}}

    "apagar" {:synsem {:cat :verb
-                      :sem {:pred :}
+                      :sem {:pred :turn-off}

    "apoyar" {:synsem {:cat :verb
                       :sem {:pred :support}}}


added dettare

added dettare

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -752,7 +752,8 @@
       "desiderare"  {:synsem {:cat :verb
                               :sem {:pred :desire}}}

-
+      "dettare" {:synsem {:cat :verb
+                         :sem {:pred :dictate}}}

       "di"
       {:synsem {:cat :prep


Add more OOXML namespace constants.

Add more OOXML namespace constants.

--- src/bakyeono/litedocx/wpml.clj
+++ src/bakyeono/litedocx/wpml.clj
@@ -7,10 +7,12 @@
 ;;; OOXML Namespaces
 (def ^:const ^{:private true} xmlns-a "http://schemas.openxmlformats.org/drawingml/2006/main")
 (def ^:const ^{:private true} xmlns-bibliography "http://schemas.openxmlformats.org/officeDocument/2006/bibliography")
+(def ^:const ^{:private true} xmlns-c "http://schemas.openxmlformats.org/drawingml/2006/chart")
 (def ^:const ^{:private true} xmlns-cdr "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing")
 (def ^:const ^{:private true} xmlns-characteristics "http://schemas.openxmlformats.org/officeDocument/2006/characteristics")
 (def ^:const ^{:private true} xmlns-custom-properties "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties")
 (def ^:const ^{:private true} xmlns-customXml "http://schemas.openxmlformats.org/officeDocument/2006/customXml")
+(def ^:const ^{:private true} xmlns-dgm "http://schemas.openxmlformats.org/drawingml/2006/diagram")
 (def ^:const ^{:private true} xmlns-docPropsVTypes "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes")
 (def ^:const ^{:private true} xmlns-draw-chart "http://schemas.openxmlformats.org/drawingml/2006/chart")
 (def ^:const ^{:private true} xmlns-draw-compat "http://schemas.openxmlformats.org/drawingml/2006/compatibility")
@@ -18,19 +20,36 @@
 (def ^:const ^{:private true} xmlns-draw-lc "http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas")
 (def ^:const ^{:private true} xmlns-draw-pic "http://schemas.openxmlformats.org/drawingml/2006/picture")
 (def ^:const ^{:private true} xmlns-draw-ssdraw "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing")
+(def ^:const ^{:private true} xmlns-dsp "http://schemas.microsoft.com/office/drawing/2008/diagram")
 (def ^:const ^{:private true} xmlns-extended-properties "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties")
 (def ^:const ^{:private true} xmlns-m "http://schemas.openxmlformats.org/officeDocument/2006/math")
+(def ^:const ^{:private true} xmlns-ns11 "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing")
+(def ^:const ^{:private true} xmlns-ns13 "urn:schemas-microsoft-com:office:excel")
+(def ^:const ^{:private true} xmlns-ns17 "urn:schemas-microsoft-com:office:powerpoint")
+(def ^:const ^{:private true} xmlns-ns24 "http://schemas.openxmlformats.org/officeDocument/2006/bibliography")
+(def ^:const ^{:private true} xmlns-ns25 "http://schemas.openxmlformats.org/drawingml/2006/compatibility")
+(def ^:const ^{:private true} xmlns-ns26 "http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas")
+(def ^:const ^{:private true} xmlns-ns6 "http://schemas.openxmlformats.org/schemaLibrary/2006/main")
+(def ^:const ^{:private true} xmlns-ns8 "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing")
 (def ^:const ^{:private true} xmlns-o "urn:schemas-microsoft-com:office:office")
+(def ^:const ^{:private true} xmlns-odc "http://opendope.org/conditions")
+(def ^:const ^{:private true} xmlns-odgm "http://opendope.org/SmartArt/DataHierarchy")
+(def ^:const ^{:private true} xmlns-odi "http://opendope.org/components")
+(def ^:const ^{:private true} xmlns-odq "http://opendope.org/questions")
+(def ^:const ^{:private true} xmlns-odx "http://opendope.org/xpaths")
 (def ^:const ^{:private true} xmlns-p "http://schemas.openxmlformats.org/presentationml/2006/main")
+(def ^:const ^{:private true} xmlns-pic "http://schemas.openxmlformats.org/drawingml/2006/picture")
 (def ^:const ^{:private true} xmlns-ppt "urn:schemas-microsoft-com:office:powerpoint")
 (def ^:const ^{:private true} xmlns-r "http://schemas.openxmlformats.org/officeDocument/2006/relationships")
 (def ^:const ^{:private true} xmlns-sl "http://schemas.openxmlformats.org/schemaLibrary/2006/main")
 (def ^:const ^{:private true} xmlns-ssml "http://schemas.openxmlformats.org/spreadsheetml/2006/main")
 (def ^:const ^{:private true} xmlns-v "urn:schemas-microsoft-com:vml")
 (def ^:const ^{:private true} xmlns-w "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
+(def ^:const ^{:private true} xmlns-w10 "urn:schemas-microsoft-com:office:word")
 (def ^:const ^{:private true} xmlns-wp "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing")
 (def ^:const ^{:private true} xmlns-wvml "urn:schemas-microsoft-com:office:word")
 (def ^:const ^{:private true} xmlns-x "urn:schemas-microsoft-com:office:excel")
+

 ;;; e -> clojure.data.xml/element
 ;;; Since clojure.data.xml/element is used so much,


[base] Expose cqrs/dispatch

[base] Expose cqrs/dispatch

Which just wraps tada/do!

--- src/braid/base/server/cqrs.clj
+++ src/braid/base/server/cqrs.clj
@@ -3,6 +3,9 @@
     [tada.events.core :as tada]
     [braid.core.hooks :as hooks]
     [taoensso.timbre :as timbre]))
+
+(defn dispatch [command-id args]
+  (tada/do! command-id args))

 (defonce commands (hooks/register! (atom [])))

@@ -10,7 +13,7 @@
   (fn [{:keys [user-id ?data ?reply-fn]}]
     (timbre/debug "Command:" (:id command) ?data)
     (try
-      (tada/do! (:id command)
+      (dispatch (:id command)
                 (assoc ?data
                   :user-id user-id))
       (?reply-fn :braid/ok)


convert date to numbers so we can take max

--- src/braid/server/db/thread.clj
+++ src/braid/server/db/thread.clj
@@ -1,7 +1,7 @@
 (ns braid.server.db.thread
   (:require [datomic.api :as d]
             [clj-time.core :as t]
-            [clj-time.coerce :refer [to-date-time]]
+            [clj-time.coerce :refer [to-date-time to-long]]
             [braid.server.db.common :refer :all]
             [braid.server.db.tag :as tag]))

@@ -163,7 +163,7 @@
              (comp (filter (comp (partial user-can-see-thread? conn user-id) :id))
                    (map (comp db->thread first))
                    (map #(thread-add-last-open-at conn % user-id))))
-       (sort-by (fn [t] (apply max (map :created-at (t :messages))))
+       (sort-by (fn [t] (apply max (map (comp to-long :created-at) (t :messages))))
                 #(compare %2 %1))
        (take 10)))