adding users

adding users

--- test/celestial/integration/puppet.clj
+++ test/celestial/integration/puppet.clj
@@ -14,6 +14,7 @@

 (defn run-cycle [spec type]
   (clear-all)
+  (add-users)
   (p/add-type type)
   (let [id (s/add-system spec)]
     (try


Bulk format

Bulk format

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -72,9 +72,9 @@
                                  paren-mode/format-text
                                  indent-mode/format-text)
                                 text (calc-x-line text pos 0)))
-        formatted-pos  (if enter-pressed?
-                         (first-non-space-pos-after formatted-text pos)
-                         pos)]
+        formatted-pos (if enter-pressed?
+                        (first-non-space-pos-after formatted-text pos)
+                        pos)]
     #js [formatted-text formatted-pos]))

 (def current-ns (atom 'cljs.user))
@@ -254,8 +254,8 @@
              r/*data-readers* tags/*cljs-data-readers*]
      (let [expression-form (and expression? (repl-read-string source))]
        (if (repl-special? expression-form)
-         (let [env      (assoc (ana/empty-env) :context :expr
-                                               :ns {:name @current-ns})
+         (let [env (assoc (ana/empty-env) :context :expr
+                                          :ns {:name @current-ns})
                argument (second expression-form)]
            (case (first expression-form)
              in-ns (process-in-ns argument)


Added another two tests into irc-bot-test module

--- test/emender_jenkins/irc_bot_test.clj
+++ test/emender_jenkins/irc_bot_test.clj
@@ -37,3 +37,13 @@
     (testing "if the emender-jenkins.irc-bot/message-for-me? definition exists."
         (is (callable? 'emender-jenkins.irc-bot/message-for-me?))))

+(deftest test-create-reply
+    "Check that the emender-jenkins.irc-bot/create-reply definition exists."
+    (testing "if the emender-jenkins.irc-bot/create-reply definition exists."
+        (is (callable? 'emender-jenkins.irc-bot/create-reply))))
+
+(deftest test-prepare-reply-text
+    "Check that the emender-jenkins.irc-bot/prepare-reply-text definition exists."
+    (testing "if the emender-jenkins.irc-bot/prepare-reply-text definition exists."
+        (is (callable? 'emender-jenkins.irc-bot/prepare-reply-text))))
+


Fix sources downloading for dependencies with exclusions

--- ccw.core/src/clj/ccw/leiningen/classpath_container.clj
+++ ccw.core/src/clj/ccw/leiningen/classpath_container.clj
@@ -109,7 +109,7 @@

 (defn- artifacts-entry
   [dep repositories]
-  (let [main (resolve-artifact dep repositories)
+  (let [main (resolve-artifact (take 2 dep) repositories)
         source (try-resolve-sources-artifact! dep repositories)]
     (if source [(-> main meta :file)
                 (-> source meta :file)]


align navigation

align navigation

--- src/site/core.clj
+++ src/site/core.clj
@@ -18,9 +18,10 @@
                 :$padding 1}]]]
      [:.sign-in {:$color :blue
                  :$border [:solid 2  :blue]
+                 :$push-left 1
                  :$padding [0.3 2.2]
                  :border-radius "20px"}]
-     [:.navigation {:$flex-row [:beseline :stretch]}] ]]
+     [:.navigation {:$flex-row [:baseline :space-between]}] ]]
    [:div.container.navigation
     [:div.brand
      [:a {:href "index"} (get-in data [:text :title])]]


CMR-1885 modified science keywords XML Parsing to pickup actual science keywords

--- umm-spec-lib/src/cmr/umm_spec/xml_to_umm_mappings/serf.clj
+++ umm-spec-lib/src/cmr/umm_spec/xml_to_umm_mappings/serf.clj
@@ -236,7 +236,10 @@
     {:Category (value-of sk "Science_Category")
      :Topic (value-of sk "Science_Topic")
      :Term (value-of sk "Science_Term")
-     :ServiceSpecificName (value-of sk "Service_Specific_Name")}))
+     :VariableLevel1 (value-of sk "Science_Variable_Level_1")
+     :VariableLevel2 (value-of sk "Science_Variable_Level_2")
+     :VariableLevel3 (value-of sk "Science_Variable_Level_3")
+     :DetailedVariable (value-of sk "Science_Detailed_Variable")}))

 (defn parse-serf-xml
   "Returns collection map from a SERF XML document."


CMR-2318: Added another docstring

CMR-2318: Added another docstring

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -63,6 +63,8 @@
              (parse-iso19115-projects-keywords metadata-xml))))))

 (defn- generate-and-validate-xml
+  "Generates collection XML for the given format based on the provided UMM record. Performs
+  schema validation against the generated XML and returns any validation errors."
   [format record]
   (core/validate-xml :collection format
                      (core/generate-metadata :collection format record)))


Feature/dynamic server load (#830)

Feature/dynamic server load (#830)

* streamline build; avoid uberjars; add deps directly to rpm

* load server dynamically

--- ssclj/jar/src/com/sixsq/slipstream/ssclj/app/main.clj
+++ ssclj/jar/src/com/sixsq/slipstream/ssclj/app/main.clj
@@ -1,15 +1,18 @@
 (ns com.sixsq.slipstream.ssclj.app.main
-  (:gen-class)
-  (:require
-    [com.sixsq.slipstream.ssclj.app.server :as server]))
+  (:gen-class))

 (def ^:const default-port 8200)
+
+(def ^:const server-ns 'com.sixsq.slipstream.ssclj.app.server)

 (defn- hook
   "A JVM shutdown hook is just a Thread that runs a function
    in the 'run' method."
   [stop-fn]
-  (proxy [Thread] [] (run [] (server/stop stop-fn))))
+  (proxy [Thread] [] (run [] (try
+                               (and stop-fn (stop-fn))
+                               (catch Exception e
+                                 (println (str e)))))))

 (defn register-shutdown-hook
   "Registers a shutdown hook in the JVM to shutdown the application
@@ -32,10 +35,14 @@
   "Starts the application container using the given port (as a string)
    or the default port."
   [& [port]]
-  (-> (parse-port port)
-      (or default-port)
-      (server/start)
-      (register-shutdown-hook))
+  (require server-ns)
+  (let [start-fn (-> server-ns
+                     find-ns
+                     (ns-resolve 'start-server))]
+    (-> (parse-port port)
+        (or default-port)
+        start-fn
+        register-shutdown-hook))

   ;; The server (started as a daemon thread) will exit immediately
   ;; if the main thread is allowed to terminate.  To avoid this,


Use position! instead of orthographic! to set the y position of the camera

--- super-koalio/desktop/src-common/super_koalio/core.clj
+++ super-koalio/desktop/src-common/super_koalio/core.clj
@@ -13,7 +13,7 @@
   [screen entities]
   (doseq [{:keys [x y height me? to-destroy]} entities]
     (when me?
-      (x! screen x)
+      (position! screen x (/ u/vertical-tiles 2))
       (when (< y (- height))
         (set-screen! super-koalio main-screen text-screen)))
     (when-let [[tile-x tile-y] to-destroy]
@@ -43,11 +43,7 @@
          (update-screen! screen)))
   :on-resize
   (fn [{:keys [width height] :as screen} entities]
-    (orthographic! screen
-                   :set-to-ortho
-                   false
-                   (* u/vertical-tiles (/ width height))
-                   u/vertical-tiles)))
+    (height! screen u/vertical-tiles)))

 (defscreen text-screen
   :on-show


Add error-boundary to demo site

Add error-boundary to demo site

--- demo/reagentdemo/core.cljs
+++ demo/reagentdemo/core.cljs
@@ -1,5 +1,6 @@
 (ns reagentdemo.core
-  (:require [sitetools.core :as tools :refer [link]]
+  (:require [reagent.core :as r]
+            [sitetools.core :as tools :refer [link]]
             [reagentdemo.intro :as intro]
             [reagentdemo.news :as news]))

@@ -17,17 +18,36 @@

 (tools/register-page index-page [#'intro/main] title)

+(defn error-boundary [& children]
+  (let [error (r/atom nil)]
+    (r/create-class
+      {:constructor (fn [this props])
+       :component-did-catch (fn [this e info])
+       :get-derived-state-from-error (fn [e]
+                                       (reset! error e)
+                                       #js {})
+       :reagent-render (fn [& children]
+                         (if @error
+                           [:div
+                            "Something went wrong."
+                            [:input
+                             {:type "button"
+                              :on-click #(reset! error nil)
+                              :value "Try again"}]]
+                           (into [:<>] children)))})))
+
 (defn demo [& [test-component]]
-  [:div
-   [:div.nav>ul.nav
-    [:li.brand [link {:href index-page} "Reagent:"]]
-    [:li [link {:href index-page} "Intro"]]
-    [:li [link {:href news/url} "News"]]
-    [:li>a github "GitHub"]
-    [:li [:a {:href "http://reagent-project.github.io/docs/master/"} "API"]]]
-   [:div test-component]
-   [tools/main-content]
-   [github-badge]])
+  [error-boundary
+   [:div
+    [:div.nav>ul.nav
+     [:li.brand [link {:href index-page} "Reagent:"]]
+     [:li [link {:href index-page} "Intro"]]
+     [:li [link {:href news/url} "News"]]
+     [:li>a github "GitHub"]
+     [:li [:a {:href "http://reagent-project.github.io/docs/master/"} "API"]]]
+    [:div test-component]
+    [tools/main-content]
+    [github-badge]]])

 (defn init! [& [test-component]]
   (tools/start! {:body [#'demo test-component]


Fixed and cleaned up adler32 implementation

--- src/longshi/fressian/byte_stream.cljs
+++ src/longshi/fressian/byte_stream.cljs
@@ -5,18 +5,22 @@
 (defn adler32
   ([ba] (adler32 ba 1))
   ([ba adler]
-    (let [ba-len (.-length ba)
+    (let [ba-len (alength ba)
           sums (js/Uint32Array. 2)]
       (do
         (aset sums (bit-and adler 0xffff) 0)
         (aset sums (bit-and (unsigned-bit-shift-right adler 16) 0xffff) 1)
-        (loop [i 0]
+        (loop [i 0 adler-chunk 0]
           (when (< i ba-len)
             (do
               (aset sums 0 (+ (aget ba i) (aget sums 0)))
               (aset sums 1 (+ (aget sums 0) (aget sums 1)))
-              (recur (inc i))
-              )))
+              (if (== adler-chunk 5552)
+                (do
+                  (aset sums 0 (js-mod (aget sums 0) 65521))
+                  (aset sums 1 (js-mod (aget sums 1) 65521))
+                  (recur (inc i) 0))
+                (recur (inc i) (inc adler-chunk))))))
         (aset sums 0 (js-mod (aget sums 0) 65521))
         (aset sums 1 (js-mod (aget sums 1) 65521))
         (unsigned-bit-shift-right (bit-or (bit-shift-left (aget sums 1) 16) (aget sums 0)) 0)))))


Base the channel count used for encoding on the actual input data

--- src/main/audio_utils/mp3_encoder.cljs
+++ src/main/audio_utils/mp3_encoder.cljs
@@ -14,7 +14,8 @@
     (let [int-data (mapv (fn [samples]
                            (into-array (map #(* 32768 %) samples)))
                          data)
-          encoder  (js/lamejs.Mp3Encoder. 2 sample-rate bit-rate)
+          encoder  (js/lamejs.Mp3Encoder. (count data) sample-rate
+                                          bit-rate)
           encoded  #js []]
       (doto encoded
         (.push (apply (aget encoder "encodeBuffer") int-data))


Fix repl namespace checking

Fix repl namespace checking

--- src/main/clojure/vimclojure/nails.clj
+++ src/main/clojure/vimclojure/nails.clj
@@ -225,7 +225,7 @@
   "Usage: ng vimclojure.nails.Repl [options]"
   [[id i "The id of the repl to act on."]]
   (let [id (Integer/parseInt id)]
-    (get (get @repl/*repls* :id {:ns "user"}) :ns)))
+    (get (get @repl/*repls* id {:ns "user"}) :ns)))

 (defnail CheckSyntax
   "Usage: ng vimclojure.nails.CheckSyntax"


Make the ttl test a bit more robust.

Make the ttl test a bit more robust.

--- modules/messaging/src/test/clojure/wunderboss/messaging_tests.clj
+++ modules/messaging/src/test/clojure/wunderboss/messaging_tests.clj
@@ -328,12 +328,16 @@
         (is (= "response-25" (.body (.get response3))))))))

 (deftest request-response-with-ttl
-  (let [queue (create-queue "rr-queue")]
+  (let [queue (create-queue "rr-queue")
+        latch (java.util.concurrent.CountDownLatch. 1)]
     (with-open [listener (.respond queue
-                           (handler identity)
+                           (handler (fn [m]
+                                      (.countDown latch)
+                                      m))
                            codecs
                            (coerce-respond-options {:ttl 1}))]
       (let [response (.request queue "nope" None/INSTANCE codecs nil)]
+        (.await latch 10 TimeUnit/SECONDS)
         (Thread/sleep 100)
         (is (thrown? java.util.concurrent.TimeoutException
               (.get response 1 TimeUnit/MILLISECONDS)))))))


Use explicit ns aliases

Use explicit ns aliases

--- src/caesium/randombytes.clj
+++ src/caesium/randombytes.clj
@@ -1,8 +1,8 @@
 (ns caesium.randombytes
   "Utilities for producing cryptographically random bytes, suitable
   for use as a key or other input entropy."
-  (:require [caesium.binding :refer [sodium]]
-            [caesium.byte-bufs :refer [buflen]])
+  (:require [caesium.binding :as b]
+            [caesium.byte-bufs :as bb])
   (:import (java.nio ByteBuffer)))

 (defn random-to-byte-array!
@@ -14,9 +14,9 @@

   If n is not given, populates the entire array."
   ([^bytes arr]
-   (random-to-byte-array! arr (buflen arr)))
+   (random-to-byte-array! arr (bb/buflen arr)))
   ([^bytes arr n]
-   (.randombytes sodium arr (long n))
+   (.randombytes b/sodium arr (long n))
    arr))

 (defn random-to-byte-buffer!
@@ -30,7 +30,7 @@
   ([^ByteBuffer buf]
    (random-to-byte-buffer! buf (.remaining buf)))
   ([^ByteBuffer buf n]
-   (.randombytes sodium buf (long n))
+   (.randombytes b/sodium buf (long n))
    buf))

 (defn randombytes


Cleanup

Cleanup

--- src/cljs/kindness/game.cljs
+++ src/cljs/kindness/game.cljs
@@ -269,8 +269,7 @@
    }"
         container (utils/create-element-if-not-exist "fontcss" "style" "head")]
     (set! (.-type container) "text/css")
-    (set! (.-innerHTML container) contents))
-  )
+    (set! (.-innerHTML container) contents)))

 (defn setup-game-audio
   "Insert nodes into the dom such that the game audio tracks will be
@@ -285,8 +284,7 @@
     (set! (.-src source-ogg) "music/soundtrack.ogg")
     (set! (.-type source-ogg) "audio/ogg; codecs=\"vorbis\"")
     (set! (.-src source-mp3) "music/soundtrack.mp3")
-    (set! (.-type source-mp3) "audio/mpeg; codecs=\"mp3\"")
-))
+    (set! (.-type source-mp3) "audio/mpeg; codecs=\"mp3\"")))

 (defmulti draw (fn [_ _ e] (:shape (utils/find-component :renderable e))))
 (defmethod draw :circle
@@ -323,6 +321,7 @@
   (let [image (:image (utils/find-component :renderable e))
         img (utils/find-image image)
         [x y] (:position (utils/find-component :positionable e))]
+    ;; need width + height
     (.drawImage surface img x y)))
 (defmethod draw :text
   [surface canvas e]


Refactoring - the goal is to associate cell strength to AI

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -241,13 +241,12 @@
         count-wall (count walls)]
     (+ 1 (* count-wall count-wall 0.25))))

-(defn with-cells-strength
+(defn compute-cells-strength
   "Adds to a given game the strength of each of its cells"
-  [{:keys [board] :as game}]
-  (assoc game :cells-strength
-    (reduce
-      #(assoc %1 %2 (compute-cell-strength board %2))
-      {} all-positions)))
+  [board]
+  (reduce
+    #(assoc %1 %2 (compute-cell-strength board %2))
+    {} all-positions))

 (defn- move-strength
   "Compute the strength of a move, based on the converted cells"
@@ -296,10 +295,11 @@
 ;; -----------------------------------------

 (defn new-game []
-  (with-available-moves
-    (with-cells-strength
-      {:board (new-board)
+  (let [board (new-board)]
+    (with-available-moves
+      {:board board
        :player (rand-nth players)
+       :cells-strength (compute-cells-strength board)
        :moves {}
        :help false
        :scores


update

update


Remove old version of no-recent-error-change-meta-error

--- src/clojush/meta_errors.clj
+++ src/clojush/meta_errors.clj
@@ -109,19 +109,6 @@
               (apply = hist))
         1000000
         (dec (count (take-while #(= % (first hist)) (rest hist))))))))
-
-#_(defn no-recent-error-change-meta-error
-  [ind evaluated-population argmap]
-  (if (not (:print-history argmap))
-    (throw
-      (Exception.
-        ":print-history must be true for :no-recent-error-change"))
-    (let [hist (:history ind)
-          limit (:error-change-recency-limit argmap)]
-      (if (and (>= (count hist) limit)
-               (apply = (take limit hist)))
-        1
-        0))))

 (defn no-recent-error-change-meta-error
   [ind evaluated-population argmap]


CMR-5060 Test fix.

CMR-5060 Test fix.

--- umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
@@ -54,7 +54,7 @@
     :access-value 42
     :data-granule (umm-lib-g/map->DataGranule
                    {:day-night "Unspecified"
-                    :producer-granule-id "SMAP_L3_SM_P_20150407_R13080_001.h5"
+                    :producer-gran-id "SMAP_L3_SM_P_20150407_R13080_001.h5"
                     :production-date-time (p/parse-datetime "2018-07-19T12:01:01.000Z")
                     :size 23})
     :temporal (umm-lib-g/map->GranuleTemporal


Fix flash message that indicated wrong type was deleted

--- src/cljs/early_vote_site/early_vote_site_detail/events.cljs
+++ src/cljs/early_vote_site/early_vote_site_detail/events.cljs
@@ -198,7 +198,7 @@
 (defn delete-schedule-success
   [{:keys [db]} [_ early-vote-site-id]]
   {:db db
-   :dispatch-n [[:flash/message "Early vote site deleted"]
+   :dispatch-n [[:flash/message "Schedule deleted"]
                 [:schedules-list/get]]})

 (def events


Doubled max points

Doubled max points

--- src/clojush/problems/boolean/digital_multiplier.clj
+++ src/clojush/problems/boolean/digital_multiplier.clj
@@ -129,7 +129,7 @@
      :atom-generators (dm-atom-generators num-bits-n)
      :population-size 1000
      :max-generations 500
-     :max-points 800
+     :max-points 1600
      :max-genome-size-in-initial-program 200
      :evalpush-limit 400
      :epigenetic-markers []


Cleaned up repeated and unused utilities.

--- src/clj/elephantdb/common/util.clj
+++ src/clj/elephantdb/common/util.clj
@@ -8,13 +8,17 @@
   (= s2 (first (sort [s1 s2]))))

 (defmacro safe-assert
+  "TODO: Fix my version comparison."
   ([x] `(safe-assert ~x ""))
   ([x msg]
      (if (>=s (clojure-version) "1.3.0")
        `(assert ~x ~msg)
        `(assert ~x))))

-(defn sleep [len]
+(defn sleep
+  "Sleeps for the supplied length of time. Negative numbers are
+  treated as zero."
+  [len]
   (when (pos? len)
     (Thread/sleep len)))

@@ -22,31 +26,16 @@
   (-> (Runtime/getRuntime)
       (.addShutdownHook (Thread. shutdown-func))))

-(defn find-first-next [pred aseq]
-  (loop [[curr & restseq] aseq]
-    (if (pred curr)
-      [curr restseq]
-      (recur restseq))))
-
 (defn repeat-seq
   [amt aseq]
   (apply concat (repeat amt aseq)))

+;; TODO: Remove.
 (defn flattened-count [xs]
   (reduce + (map count xs)))

 (defmacro dofor [bindings & body]
   `(doall (for ~bindings (do ~@body))))
-
-(defmacro dofor [bindings & body]
-  `(doall (for ~bindings (do ~@body))))
-
-(defmacro as-futures [[a args] & body]
-  (let [parts          (partition-by #{'=>} body)
-        [acts _ [res]] (partition-by #{:as} (first parts))
-        [_ _ task]     parts]
-    `(let [~res (for [~a ~args] (future ~@acts))]
-       ~@task)))

 (defmacro p-dofor [bindings & body]
   `(let [futures# (dofor ~bindings
@@ -89,19 +78,10 @@
 (defn prioritize [pred coll]
   (apply concat (separate pred coll)))

+;; TODO: Remove
 (defn remove-val [v aseq]
   (filter (partial not= v)
           aseq))
-
-(defn third [aseq]
-  (nth aseq 2))
-
-(defn parallel-exec [funcs]
-  (if (empty? funcs)
-    []
-    (let [[thisfn & restfns] funcs
-          future-rest (dofor [f restfns] (future-call f))]
-      (cons (thisfn) (map deref future-rest)))))

 (defn mk-rw-lock []
   (ReentrantReadWriteLock.))


fix browser REPL `*loaded-libs*` initialization, only include visited namespaces

--- src/cljs/clojure/browser/repl.cljs
+++ src/cljs/clojure/browser/repl.cljs
@@ -110,7 +110,13 @@
           "none")))
     ;; Monkey-patch goog.require if running under optimizations :none - David
     (when-not js/COMPILED
-      (set! *loaded-libs* (into #{} (js-keys (.. js/goog -dependencies_ -nameToPath))))
+      (set! *loaded-libs*
+        (let [gntp (.. js/goog -dependencies_ -nameToPath)]
+          (into #{}
+            (filter
+              (fn [name]
+                (aget (.. js/goog -dependencies_ -visited) (aget gntp name)))
+              (js-keys gntp)))))
       (set! (.-isProvided_ js/goog) (fn [_] false))
       (set! (.-require js/goog)
         (fn [name reload]


Add autocomplete that queries serverside card master

--- src/cljs/decktouch/card-input.cljs
+++ src/cljs/decktouch/card-input.cljs
@@ -1,11 +1,6 @@
 (ns decktouch.card-input
   (:require [reagent.core :as reagent :refer [atom]]
             [ajax.core :refer [GET]]))
-
-(def llist
-     [{:name "foo"}
-      {:name "bar"}
-      {:name "lol"}])

 (defn card-input [the-cards]
   (let [get-val #(.-value (.getElementById js/document "the-input"))
@@ -26,9 +21,13 @@
         [:input#the-input {:type "text"}]]]))

 (defn ^:export card-input-did-mount []
-  (let [things (map :name llist)]
+  (let [query-card-master
+        (fn [request response]
+          (let [query-url (str "../data/input/" (.-term request))]
+            (GET query-url {:handler #(response (.parse js/JSON %))})))]
     (.autocomplete (js/$ "#the-input")
-                   (cljs.core/js-obj "source" (clj->js things)))))
+                   (cljs.core/js-obj "source" query-card-master
+                                     "minLength" 2))))

 (defn component [the-cards]
   (reagent/create-class {:render #(card-input the-cards)


Add cljs-ajax ns

Add cljs-ajax ns

--- src/cljs/decktouch/card-input.cljs
+++ src/cljs/decktouch/card-input.cljs
@@ -1,5 +1,6 @@
 (ns decktouch.card-input
-  (:require [reagent.core :as reagent :refer [atom]]))
+  (:require [reagent.core :as reagent :refer [atom]]
+            [ajax.core :refer [GET]]))

 (def llist
      [{:name "foo"}


Cleanup

Cleanup

--- src/cljs/github_profile/views.cljs
+++ src/cljs/github_profile/views.cljs
@@ -4,86 +4,11 @@

 (enable-console-print!)

-(defn loading-throbber
-  []
-  (let [loading? (re-frame/subscribe [:loading?])]
-    (when @loading?
-      [:div.loading
-       [:div.three-quarters-loader "Loading..."]])))
-
-(defn github-id-input
-  []
-  (let [loading? (re-frame/subscribe [:loading?])
-        error? (re-frame/subscribe [:error?])
-        github-id (reagent/atom "")
-        on-click (fn [_]
-                   (when-not (empty? @github-id)
-                     (println "on-click" "@github-id" @github-id)
-                     (re-frame/dispatch [:set-github-id @github-id])
-                     (reset! github-id "")))]
-    (fn []
-      [:div
-       [:div.input-group
-        [:input.form-control {:type "text"
-                              :placeholder "Enter Github ID"
-                              :on-change #(reset! github-id (-> % .-target .-value))}]
-        [:span.input-group-btn
-         [:button.btn.btn-default {:type "button"
-                                   :on-click #(when-not @loading? (on-click %))}
-          "Go"]
-         ]]
-       (when @error?
-         [:p.error-text.text-danger "¯\\_(ツ)_/¯  Bad github handle or rate limited!"])])))
-
-(defn user-name-and-avatar
-  []
-  (fn []
-    (let [user-profile (re-frame/subscribe [:user-profile])]
-      [:div.user-details
-       [:img.img-circle {:src (get @user-profile "avatar_url")}]
-       [:h5.text-center (get @user-profile "name")]])))
-
-(defn user-repos-list
-  []
-  (let [user-repos (re-frame/subscribe [:user-repos])]
-    (fn []
-      [:ul.list-group
-       (map-indexed (fn [i repo]
-                      (vector :li.list-group-item {:key i}
-                              [:h4.list-group-item-heading (get repo "name")]
-                              [:p.list-group-item-text (get repo "description")]))
-                    @user-repos)])))
-;; home
-(defn home-panel []
-  (let []
-    (fn []
-      [:div
-       [:div.topbar
-        [:div.container
-         [:div.row
-          [:div.col-lg-6.col-lg-offset-3
-           [github-id-input]]]]]
-       [:div.main-content
-        [:div.container
-         [:div.row
-          [:div.col-lg-6.col-lg-offset-3
-           [user-repos-list]]]]]
-       ])))
-
-
-;; profile
-
-(defn profile-panel []
-  (fn []
-    [:div "This is the Profile Page."
-     [:div [:a {:href "#/"} "go to Home Page"]]
-     ]))
-
 (defn thead-row []
   (fn []
     [:tr
      [:th "th-0"]
-     [:th "th-val-1"]]))
+     [:th "th-1"]]))

 (defn tbody-row []
   (fn []
@@ -112,19 +37,7 @@
          [tbody-row]]
         ]])))

-;; main
-
-(defmulti panels identity)
-(defmethod panels :home-panel [] [home-panel])
-(defmethod panels :profile-panel [] [profile-panel])
-(defmethod panels :default [] [:div])
-
 (defn main-panel []
-  (let [active-panel (re-frame/subscribe [:active-panel])]
-    (fn []
-      [:div
-       [table]
-       #_[loading-throbber]
-       #_[user-name-and-avatar]
-       #_(panels @active-panel)
-       ])))
+  (fn []
+    [:div
+     [table]]))


Minor: also display colour overlay when window is resized, as well as on zoom

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -24,7 +24,7 @@
   []
   (swap! app-state :assoc :rendering-data initial-rendering-data))

-(defn make-canvases-fill-window!
+(defn set-canvas-dimensions!
   "Sets the rendering canvas and the overlay canvas to the same
    size as the enclosing window"
   []
@@ -68,7 +68,7 @@

   (println render-state)

-  (make-canvases-fill-window!)
+  (set-canvas-dimensions!)

   (let [max-iterations        (int (* 10 (Math/log scale))) ; Sensible?
         start                 (.getTime (js/Date.))
@@ -115,6 +115,15 @@
                                           (aget e "pageY")
                                           :clear? true
                                           :color "green"))))
+
+(defn re-render!
+  [new-state]
+  (add-overlay-rectangle!
+   0 0
+   (aget overlay-canvas "width") (aget overlay-canvas "height")
+   :opacity 0.2 :color "green" :clear? true :type :fill)
+
+  (.setTimeout js/window #(render-mandelbrot! new-state) 50))

 (defn zoom-to-enclose-rectangle!
@@ -174,19 +183,13 @@

 (set! (.-onmouseup overlay-canvas) handle-mouseup)

-(set! (.-onresize js/window) (fn [] (render-mandelbrot! @app-state)))
+(set! (.-onresize js/window) (fn [] (re-render! @app-state)))

 (add-watch app-state :state-changed
            (fn [_ _ old-state new-state]
              (when-not (= (:rendering-data old-state)
                           (:rendering-data new-state))
-
-               (add-overlay-rectangle!
-                0 0
-                (aget overlay-canvas "width") (aget overlay-canvas "height")
-                :opacity 0.2 :color "green" :clear? true :type :fill)
-
-               (.setTimeout js/window #(render-mandelbrot! new-state) 10))))
+               (re-render! new-state))))

 (render-mandelbrot! @app-state)


refactoring

refactoring

--- src/cljs/salava/badge/ui/info.cljs
+++ src/cljs/salava/badge/ui/info.cljs
@@ -40,7 +40,7 @@
     (fn [] (swap! state assoc :permission "error")))
   )

-(defn toggle-visibility [state]
+#_(defn toggle-visibility [state]
   (let [id (:id @state)
         new-value (if (= (:visibility @state) "private") "public" "private")]
     (ajax/POST
@@ -48,14 +48,14 @@
       {:params {:visibility new-value}
        :handler (fn [] (swap! state assoc :visibility new-value))})))

-(defn toggle-recipient-name [id show-recipient-name-atom]
+#_(defn toggle-recipient-name [id show-recipient-name-atom]
   (let [new-value (not (pos? @show-recipient-name-atom))]
     (ajax/POST
       (path-for (str "/obpv1/badge/toggle_recipient_name/" id))
       {:params {:show_recipient_name new-value}
        :handler (fn [] (reset! show-recipient-name-atom new-value))})))

-(defn toggle-evidence [state]
+#_(defn toggle-evidence [state]
   (let [id (:id @state)
         new-value (not (:show_evidence @state))]
     (ajax/POST
@@ -63,7 +63,7 @@
       {:params {:show_evidence new-value}
        :handler (fn [] (swap! state assoc :show_evidence new-value))})))

-(defn show-settings-dialog [badge-id state init-data]
+#_(defn show-settings-dialog [badge-id state init-data]
   (ajax/GET
     (path-for (str "/obpv1/badge/settings/" badge-id) true)
     {:handler (fn [data]
@@ -78,7 +78,7 @@
      :handler (fn []
                 (init-data state id))}))

-(defn congratulate [state]
+#_(defn congratulate [state]
   (ajax/POST
     (path-for (str "/obpv1/badge/congratulate/" (:id @state)))
     {:handler (fn [] (swap! state assoc :congratulated? true))}))
@@ -135,7 +135,7 @@
      [m/modal-window]
      [:div.panel
       [:div.panel-body
-       (if (and owner? (not expired?) (not revoked))
+       #_(if (and owner? (not expired?) (not revoked))
          [:div {:class "row" :id "badge-share-inputs"}
           (if-not (private?)
             [:div.pull-left
@@ -181,7 +181,7 @@
            [:img {:src (str "/" image_file)}]]]
          (if (and qr_code (= visibility "public"))
            [:img#print-qr-code {:src (str "data:image/png;base64," qr_code)}])
-         (if owner?
+         #_(if owner?
            [:div.row {:id "badge-rating"}
             [:div.col-xs-12
              [:div.rating
@@ -196,14 +196,14 @@
                 (= view_count 1) (t :badge/Viewedonce)
                 (> view_count 1) (str (t :badge/Viewed) " " view_count " " (t :badge/times))
                 :else            (t :badge/Badgeisnotviewedyet))]]])
-         (if (> recipient_count 1)
+         #_(if (> recipient_count 1)
            [:div.row {:id "badge-views"}
             [:div.col-xs-12
              [:a.link {:href     "#"
                        :on-click #(do
                                     (mo/open-modal [:gallery :badges] {:badge-id badge_id})
                                     (.preventDefault %))} (t :badge/Otherrecipients)]]])
-         [:div.row
+         #_[:div.row
           [:div.col-xs-12 {:id "badge-congratulated"}
            (if (and user-logged-in? (not owner?))
              (if congratulated?
@@ -224,12 +224,14 @@
         [:div {:class "col-md-9 badge-info"}
          [:div.row
           [:div {:class "col-md-12"}
-           (content-language-selector selected-language (:content @state))
+           #_(content-language-selector selected-language (:content @state))
            (if revoked
              [:div.revoked (t :badge/Revoked)])
            (if expired?
              [:div.expired [:label (t :badge/Expiredon) ": "] (date-from-unix-time (* 1000 expires_on))])
            [:h1.uppercase-header name]
+           (if (< 1 (count (:content @state)))
+             [:div.inline [:label (t :core/Languages)": "](content-language-selector selected-language (:content @state))])
            (bm/issuer-modal-link issuer_content_id issuer_content_name)
            (bm/creator-modal-link creator_content_id creator_name)


Resize Nix according to the view height.

--- src/mash_commander/nix/character.cljs
+++ src/mash_commander/nix/character.cljs
@@ -14,37 +14,37 @@
     (render-state [_ state]
       (let [state (:state cursor)
             eye-height (condp = state
-                         :resting "35px"
-                         :blinking "5px")]
-        (dom/svg #js {:style #js {:width "500px"
-                                  :height "800px"
+                         :resting "2.1vh"
+                         :blinking ".3vh")]
+        (dom/svg #js {:style #js {:width "30.0vh"
+                                  :height "48.0vh"
                                   :float "right"}}
-                 (dom/rect #js {:style #js {:x "5px"
-                                            :y "35px"
-                                            :width "450px"
-                                            :height "700px"
-                                            :rx "80px"
-                                            :ry "80px"
+                 (dom/rect #js {:style #js {:x ".3.vh"
+                                            :y "2.1vh"
+                                            :width "27.0vh"
+                                            :height "42.0vh"
+                                            :rx "4.8vh"
+                                            :ry "4.8vh"
                                             :stroke "black"
                                             :fill "white"
-                                            :strokeWidth "8px"}})
-                 (dom/rect #js {:style #js {:x "45px"
-                                            :y "75px"
-                                            :width "370px"
-                                            :height "480px"
-                                            :rx "45px"
-                                            :ry "45px"
+                                            :strokeWidth ".5vh"}})
+                 (dom/rect #js {:style #js {:x "2.7vh"
+                                            :y "4.5vh"
+                                            :width "22.0vh"
+                                            :height "28.0vh"
+                                            :rx "2.7vh"
+                                            :ry "2.7vh"
                                             :stroke "black"
                                             :fill "#f4f9ff"
-                                            :strokeWidth "8px"}})
-                 (dom/ellipse #js {:style #js {:cx "160px"
-                                               :cy "210px"
-                                               :rx "13px"
+                                            :strokeWidth ".5vh"}})
+                 (dom/ellipse #js {:style #js {:cx "9.6vh"
+                                               :cy "12.6vh"
+                                               :rx ".8vh"
                                                :ry eye-height
                                                :fill "#0e3487"}})
-                 (dom/ellipse #js {:style #js {:cx "295px"
-                                               :cy "210px"
-                                               :rx "13px"
+                 (dom/ellipse #js {:style #js {:cx "17.7vh"
+                                               :cy "12.6vh"
+                                               :rx ".8vh"
                                                :ry eye-height
                                                :fill "#0e3487"}}))))
     om/IDidMount


Added add-scrollbars to c.c.draw.scenes

Added add-scrollbars to c.c.draw.scenes

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

--- src/conexp/contrib/draw/scenes.clj
+++ src/conexp/contrib/draw/scenes.clj
@@ -14,6 +14,7 @@
 	   [java.io File]
 	   [java.awt.image BufferedImage]
 	   [javax.imageio ImageIO]
+           [javax.swing JScrollBar]
 	   [no.geosoft.cc.graphics GWindow GScene GStyle GWorldExtent]))

 (ns-doc "Namespace for scene abstraction.")
@@ -165,6 +166,11 @@
 			GScene/ANNOTATION_VISIBLE
 			GScene/ANNOTATION_INVISIBLE)))

+(defn add-scrollbars
+  "Adds given scrollbars for scene."
+  [^GScene scene, ^JScrollBar horizontal-scrollbar, ^JScrollBar vertical-scrollbar]
+  (.installScrollHandler scene horizontal-scrollbar vertical-scrollbar))
+
 ;;;

 nil


Automatically select first midi in

Automatically select first midi in

--- src/fugue/midi_monitor.cljs
+++ src/fugue/midi_monitor.cljs
@@ -7,9 +7,11 @@
 (defn midi-selector [midi-ctx on-change]
   [:div
    (if-let [mctx @midi-ctx]
-     [:select {:on-change #(on-change ((::midi/ins mctx) (.. % -target -value)))}
-      (for [[in-name] (::midi/ins mctx)]
-        [:option {:value in-name} in-name])]
+     (do
+       (on-change (second (first (::midi/ins mctx))))
+       [:select {:on-change #(on-change ((::midi/ins mctx) (.. % -target -value)))}
+        (for [[in-name] (::midi/ins mctx)]
+          [:option {:value in-name} in-name])])
      "no midi ctx")])

 (defn note-monitor [in-mult]


limit each poller to the worker_tasks belonging to its math_env

--- src/polismath/components/postgres.clj
+++ src/polismath/components/postgres.clj
@@ -271,6 +271,7 @@
          :from [:worker_tasks]
          :where [:and
                  [:> :created last-timestamp]
+                 [:= :math_env (name (-> postgres :config :math-env))]
                  [:= :finished_time nil]]}))
     (map (fn [task-record]
            (-> task-record


Get rid of old asserts in pepa.data.

Get rid of old asserts in pepa.data.

--- src-cljs/pepa/data.cljs
+++ src-cljs/pepa/data.cljs
@@ -153,61 +153,3 @@
       :ui/sidebars
       (om/ref-cursor)))

-;; TODO: Simulation Testing
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:bar]
-                 :after :bla)
-           [:foo :baz :bla :bar]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:bar]
-                 :before :bla)
-           [:foo :baz :bar :bla]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar]
-                 :before :bla)
-           [:baz :foo :bar :bla]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar]
-                 :before nil)
-           [:baz :bla :foo :bar]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar]
-                 :after nil)
-           [:baz :bla :foo :bar]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar :baz :bla]
-                 :before nil)
-           [:foo :bar :baz :bla]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar :baz]
-                 :after :bla)
-           [:bla :foo :bar :baz]))
-
-(assert (= (move-pages [:foo :bar :baz :bla]
-                 [:foo :bar :baz]
-                 :before :bla)
-           [:foo :bar :baz :bla]))
-
-(comment
-  ;; Extend ICursor to nil
-  (deftype NilCursor [state path]
-    om/ICursor
-    (-path [_] path)
-    (-state [_] state))
-
-  (extend-type nil
-    om/IToCursor
-    (-to-cursor [value state]
-      (om/-to-cursor value state nil))
-    (-to-cursor [_ state path]
-      (NilCursor. state path))
-
-    ICloneable
-    (-clone [_] nil)))


Give the unschedule more time to work.

Give the unschedule more time to work.

--- integration-tests/apps/jobs/test/jobs/cron.clj
+++ integration-tests/apps/jobs/test/jobs/cron.clj
@@ -73,6 +73,7 @@
       (is (msg/receive q :timeout 10000))
       (require '[immutant.jobs :as job] :reload-all)
       (job/unschedule "a-job")
+      (Thread/sleep 5000)
       (let [curval (.get aint)]
-        (Thread/sleep 5000)
+        (Thread/sleep 2000)
         (is (= curval (.get aint)))))))


Fix illegal exemplar

Fix illegal exemplar

--- test/exemplar.clj
+++ test/exemplar.clj
@@ -221,7 +221,7 @@
   (write-exemplar
     "maps_unrecognized_keys"
     "Vector of maps with keys with unrecognized encodings"
-    [{"`~#unrecognized" :anything} {"`~#X" :anything-else}])
+    [{"`~#abcde" :anything} {"`~#fghij" :anything-else}])

   (write-exemplar
     "map_unrecognized_vals"


Fix tests

Fix tests

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -414,31 +414,29 @@
     PRIMARY KEY((a, b), c, d))"
          (normalize-string
           (create-table :foo
-                        (column-definitions {:a :int
-                                             :b :varchar
-                                             :c :int
-                                             :d :int
-                                             :e :int
-                                             :primary-key [[:a :b] :c :d]}))
-
-          )))
+                        (column-definitions (array-map :a :int
+                                                       :b :varchar
+                                                       :c :int
+                                                       :d :int
+                                                       :e :int
+                                                       :primary-key [[:a :b] :c :d]))))))

   (is (= "
   CREATE TABLE foo(
     a int,
     c int,
     d int,
+    b varchar,
     e int,
-    b varchar,
     PRIMARY KEY(a, c, d))"
          (normalize-string
           (create-table :foo
-                        (column-definitions {:a :int
-                                             :b :varchar
-                                             :c :int
-                                             :d :int
-                                             :e :int
-                                             :primary-key [:a :c :d]})))))
+                        (column-definitions (array-map :a :int
+                                                       :c :int
+                                                       :d :int
+                                                       :b :varchar
+                                                       :e :int
+                                                       :primary-key [:a :c :d]))))))

   (is (= "
@@ -451,11 +449,11 @@
   WITH COMPACT STORAGE"
          (normalize-string
           (create-table :foo
-                        (column-definitions {:a :varchar
-                                             :b :varchar
-                                             :c :varchar
-                                             :d :varchar
-                                             :primary-key [[:a :b] :c :d]})
+                        (column-definitions (array-map :a :varchar
+                                                       :b :varchar
+                                                       :c :varchar
+                                                       :d :varchar
+                                                       :primary-key [[:a :b] :c :d]))
                         (with-options {:compact-storage true})
                         ))))

@@ -466,9 +464,9 @@
     PRIMARY KEY(a))"
          (normalize-string
           (create-table :foo
-                        (column-definitions {:a :int
-                                             :b (map-type :varchar :varchar)
-                                             :primary-key [:a]})))))
+                        (column-definitions (array-map :a :int
+                                                       :b (map-type :varchar :varchar)
+                                                       :primary-key [:a]))))))

   (is (= "
   CREATE TABLE IF NOT EXISTS foo(
@@ -477,9 +475,9 @@
     PRIMARY KEY(a))"
          (normalize-string
           (create-table :foo
-                        (column-definitions {:a :int
-                                             :b :varchar
-                                             :primary-key [:a]})
+                        (column-definitions (array-map :a :int
+                                                       :b :varchar
+                                                       :primary-key [:a]))
                         (if-not-exists)
                         ))))


added viewport meta tag for iPhone display

--- src/instapapure/servlet.clj
+++ src/instapapure/servlet.clj
@@ -52,7 +52,8 @@
       [:title title]
       (include-js "public/j/jquery.js"
                   "public/j/instapapure.js")
-      (include-css "public/s/instapapure.css")]
+      (include-css "public/s/instapapure.css")
+      "<meta name=viewport content='initial-scale=1.0'>"]
     [:body
       (header title)
       body


feature #1805 refactored protocol listeners

--- src/status_im/protocol/listeners.cljs
+++ src/status_im/protocol/listeners.cljs
@@ -6,70 +6,91 @@
             [taoensso.timbre :as log]
             [status-im.utils.hex :as i]))

-(defn create-error [description]
-  (log/debug :parse-payload-error description)
+(defn empty-public-key? [public-key]
+  (or (= "0x0" public-key)
+      (= "" public-key)
+      (nil? public-key)))
+
+(defn create-error [step description]
+  (when (not= description :silent)
+    (log/debug step description))
   {:error description})

-(defn- parse-payload [payload]
+(defn init-scope [js-error js-message options]
+  (if js-error
+    (create-error :init-scope-error (-> js-error js->clj str))
+    {:message (js->clj js-message :keywordize-keys true)
+     :options options}))
+
+(defn parse-payload [{:keys [message error options] :as scope}]
   (log/debug :parse-payload)
-  (try
-    ;; todo figure why we have to call to-utf8 twice
-    (let [payload'   (u/to-utf8 payload)
-          payload''  (r/read-string payload')
-          payload''' (if (map? payload'')
-                       payload''
-                       (r/read-string (u/to-utf8 payload')))]
-      (if (map? payload''')
-        {:payload payload'''}
-        (create-error (str "Invalid payload type " (type payload''')))))
-    (catch :default err
-      (create-error err))))
+  (if error
+    scope
+    (try
+      ;; todo figure why we sometimes have to call to-utf8 twice and sometimes only once
+      (let [payload    (:payload message)
+            payload'   (u/to-utf8 payload)
+            payload''  (r/read-string payload')
+            payload''' (if (map? payload'')
+                         payload''
+                         (r/read-string (u/to-utf8 payload')))]
+        (if (map? payload''')
+          {:message (assoc message :payload payload''')
+           :options options}
+          (create-error :parse-payload-error (str "Invalid payload type " (type payload''')))))
+      (catch :default err
+        (create-error :parse-payload-error  err)))))

-(defn- decrypt [key content]
-  (try
-    {:content (r/read-string (e/decrypt key content))}
-    (catch :default err
-      (log/debug :decrypt-error err)
-      {:error err})))
+(defn filter-messages-from-same-user [{:keys [message error options] :as scope}]
+  (if error
+    scope
+    (if (or (not= (i/normalize-hex (:identity options))
+                  (i/normalize-hex (:sig message)))
+            ;; allow user to receive his own discoveries
+            (= type :discover))
+      scope
+      (create-error :filter-messages-error :silent))))

-(defn- parse-content [key {:keys [content]} was-encrypted?]
-  (log/debug :parse-content
-         "Key exists:" (not (nil? key))
-         "Content exists:" (not (nil? content)))
-  (if (and (not was-encrypted?) key content)
-    (decrypt key content)
-    {:content content}))
+(defn parse-content [{:keys [message error options] :as scope}]
+  (if error
+    scope
+    (try
+      (let [to             (:recipientPublicKey message)
+            from           (:sig message)
+            key            (get-in options [:keypair :private])
+            raw-content    (get-in message [:payload :content])
+            encrypted?     (and (empty-public-key? to) key raw-content)
+            content        (if encrypted?
+                             (r/read-string (e/decrypt key raw-content))
+                             raw-content)]
+        (log/debug :parse-content
+                   "Key exists:" (not (nil? key))
+                   "Content exists:" (not (nil? raw-content)))
+        {:message (-> message
+                      (assoc-in [:payload :content] content)
+                      (assoc :to to
+                             :from from))
+         :options options})
+      (catch :default err
+        (create-error :parse-content-error err)))))
+
+(defn handle-message [{:keys [message error options] :as scope}]
+  (if error
+    scope
+    (let [{:keys [web3 identity callback]} options
+          {:keys [payload sig]}            message
+          ack?                            (get-in message [:payload :ack?])]
+      (log/debug :handle-message message)
+      (callback (if ack? :ack (:type payload)) message)
+      (ack/check-ack! web3 sig payload identity))))

 (defn message-listener
-  [{:keys [web3 identity callback keypair]}]
-  (fn [error js-message]
-    ;; todo handle error
-    (when error
-      (log/debug :listener-error error))
-    (when-not error
-      (log/debug :message-received (js->clj js-message))
-      (let [{:keys [sig payload recipientPublicKey] :as message}
-            (js->clj js-message :keywordize-keys true)
+  "Valid options are: web3, identity, callback, keypair"
+  [options]
+  (fn [js-error js-message]
+    (-> (init-scope js-error js-message options)
+        parse-payload
+        filter-messages-from-same-user
+        parse-content
+        handle-message)))

-            {{:keys [type ack?] :as payload'} :payload
-             payload-error                    :error}
-            (parse-payload payload)]
-        (when (and (not payload-error)
-                   (or (not= (i/normalize-hex identity)
-                             (i/normalize-hex sig))
-                       ;; allow user to receive his own discoveries
-                       (= type :discover)))
-          (let [{:keys [content error]} (parse-content (:private keypair)
-                                                       payload'
-                                                       (and (not= "0x0" recipientPublicKey)
-                                                            (not= "" recipientPublicKey)
-                                                            (not (nil? recipientPublicKey))))]
-            (if error
-              (log/debug :failed-to-handle-message error)
-              (let [payload'' (assoc payload' :content content)
-                    message'  (assoc message :payload payload''
-                                             :to recipientPublicKey
-                                             :from sig)]
-                (callback (if ack? :ack type) message')
-                (ack/check-ack! web3 sig payload'' identity)))))))))
-


Create de_ch.cljs

Create de_ch.cljs

--- src/status_im/translations/de_ch.cljs
+++ src/status_im/translations/de_ch.cljs
@@ -60,7 +60,7 @@

    ;profile
    :profile                               "Profil"
-   :report-user                           "BENUTZER MELDEN"
+   :report-user                           "Benutzer melden"
    :message                               "Nachricht"
    :username                              "Benutzername"
    :not-specified                         "Nicht spezifiziert"
@@ -68,7 +68,7 @@
    :phone-number                          "Telefonnummer"
    :email                                 "Email"
    :profile-no-status                     "Kein Status"
-   :add-to-contacts                       "Zu den Kontakten hinzufügen"
+   :add-to-contacts                       "Zu Kontakten hinzufügen"
    :error-incorrect-name                  "Bitte wähle einen anderen Namen"
    :error-incorrect-email                 "Inkorrekte E-mail"

@@ -80,17 +80,17 @@

    ;sign-up
    :contacts-syncronized                  "Deine Kontakte wurden synchronisiert"
-   :confirmation-code                     (str "Vielen Dank! Wir haben Dir eine SMS mit einer Bestätigung zugesandt"
-                                               "code. Bitte gebe diesen Code zur Bestätigung deiner Telefonnummer an")
+   :confirmation-code                     (str "Vielen Dank! Wir haben Dir eine SMS mit einem Bestätigungcode"
+                                               "zugesandt. Bitte gebe diesen Code zur Bestätigung deiner Telefonnummer ein")
    :incorrect-code                        (str "Leider ist der Code nicht korrekt. Bitte versuche es nochmals")
-   :generate-passphrase                   (str "Ich generiere eine Passphrase für dich, so dass du deine wiederherstellen kannst "
-                                               "Zugriff oder Anmelden von einem anderen Gerät")
+   :generate-passphrase                   (str "Ich generiere eine Passphrase für dich, so dass du dein Zugriff wiederherstellen kannst "
+                                               "Zugriff und Anmeldung von einem anderen Gerät")
    :phew-here-is-your-passphrase          "*Phew* das war hart, hier ist deine Passphrase, *Schreibe diese auf und bewahre diese sicher auf!* Du benötigst diese, um dein Konto wiederherzustellen."
    :here-is-your-passphrase               "Hier ist deine Passphrase, *Schreibe diese auf und bewahre diese sicher auf!* Du benötigst diese, um dein Konto wiederherzustellen."
    :written-down                          "Stelle sicher, dass du diese aufgeschrieben hast!"
    :phone-number-required                 "Klicke hier, um deine Telefonnummer einzugeben & Ich finde deine Freunde für dich"
    :intro-status                          "Chat mit mir, damit ich dein Konto einrichten und deine Einstellungen ändern kann!"
-   :intro-message1                        "Willkommen zu Status\nTap diese Nachricht um Passwort einzurichten & loszulegen!"
+   :intro-message1                        "Willkommen zu Status\nTap diese Nachricht um dein Passwort einzurichten & loszulegen!"
    :account-generation-message            "Gib mir eine Sekunde, Ich muss wie verrückt etwas berechnen um dein Konto zu generieren!"

    ;chats
@@ -99,7 +99,7 @@
    :new-group-chat                        "Neuer Gruppenchat"

    ;discover
-   :discover                             "Entdeckung"
+   :discover                             "Entdecken"
    :none                                  "Keine"
    :search-tags                           "Gebe hier deine Suchbegriffe ein"
    :popular-tags                          "Beliebte Suchbegriffe"
@@ -112,15 +112,15 @@
    ;contacts
    :contacts                              "Kontakte"
    :new-contact                           "Neuer Kontakt"
-   :show-all                              "ZEIGE ALLES"
+   :show-all                              "Alle Kontakte anzeigen"
    :contacts-group-dapps                  "ÐApps"
    :contacts-group-people                 "Leute"
-   :contacts-group-new-chat               "Starte neuer Chat"
+   :contacts-group-new-chat               "Starte neuen Gruppenchat"
    :no-contacts                           "Noch keine Kontakte"
-   :show-qr                               "Zeige QR"
+   :show-qr                               "QR-Code anzeigen"

    ;group-settings
-   :remove                                "Entferne"
+   :remove                                "Entfernen"
    :save                                  "Speichern"
    :change-color                          "Farbe ändern"
    :clear-history                         "Verlauf löschen"
@@ -173,7 +173,7 @@
    :name                                  "Name"
    :whisper-identity                      "Identität flüstern"
    :address-explication                   "Vielleicht sollte hier ein Text stehen der erklärt, was eine Adresse ist und wo man suchen soll"
-   :enter-valid-address                   "Bitte gebe eine gültige Adresse ein oder scannen den QR-Code"
+   :enter-valid-address                   "Bitte gebe eine gültige Adresse ein oder scanne den QR-Code"
    :contact-already-added                 "Der Kontakt wurde bereits hinzugefügt"
    :can-not-add-yourself                  "Du kannst dich nicht selbst hinzufügen"
    :unknown-address                       "Unbekannte Adresse"
@@ -215,8 +215,8 @@
    :pending-confirmation                  "Konfirmation ausstehend"
    :recipient                             "Empfänger"
    :one-more-item                         "Noch ein Element"
-   :fee                                   "Gebühr"
+   :fee                                   "Gebühren"
    :value                                 "Valuta"

    ;:webview
-   :web-view-error                        "oops, Fehler"})+   :web-view-error                        "oops, Fehler"})


Stream name as part of app name

Stream name as part of app name

--- src/kinesis_logger/core.clj
+++ src/kinesis_logger/core.clj
@@ -7,7 +7,7 @@

 (def config
   {:kinesis-client   {:region      "eu-west-1"
-                      :app-name    "kinesis-logger"
+                      :app-name    (str "kinesis-logger-" (env :stream-name))
                       :stream-name (env :stream-name)}
    :logentries-token (env :logentries-token)})


functions formatting improved

functions formatting improved

--- src/leiningen/fore_prob.clj
+++ src/leiningen/fore_prob.clj
@@ -19,12 +19,19 @@
     (if (re-find r t)
       (spit fn (cs/replace t r "")))))

+(defn- desc->comments
+  "format a problem description as Clojure comments with one level of
+   indentation"
+  [desc]
+  (str "  ;; " (cs/replace #"\r?\n" "\n  ;; ")))
+
 (defn- add-stub [project prob]
   (let [src (io/file "src" (ns->path (project :group)) "core.clj")]
     (if-not (re-find (re-pattern (str "(?m)^\\(defn " prob)) (slurp src))
       (spit src
             (str "\n(defn " prob "-solution [] ; Update args as needed!\n"
-                 "nil\n)\n")
+                 (-> project :description desc->comments)
+                 "nil)\n")
             :append true))))

 (defn- no-test-yet [fn prob]
@@ -45,13 +52,13 @@
 (defn- write-tests [project problem]
   (let [prob      (title->fn (problem :title))
         test-file (io/file
-                    "test" (ns->path (project :group)) "test" "core.clj")]
+                    "test" (ns->path (project :group)) "core_test.clj")]
     (add-stub project prob)
     (drop-replace-me test-file)
     (if (no-test-yet test-file prob)
       (spit test-file
             (str "\n(deftest can-" prob "\n"
-                 (expand-prob prob (problem :tests)) "\n)\n")
+                 (expand-prob prob (problem :tests)) ")\n")
             :append true)
       true)))


its getting better

its getting better

--- src/leiningen/pre_types.clj
+++ src/leiningen/pre_types.clj
@@ -7,13 +7,12 @@

 (def cols [[:id "foo"] [:fooname "foo"]])
-;-> [{:colname id} {:colname "fooname"}]

 (t/ann mapf [(t/HSequential [Keyword t/Any *]) -> (t/HMap :mandatory {:colname String})])
 (defn mapf [v]
   {:colname (name (first v))})

-;(t/ann conv [(t/NonEmptyVec (t/HVec [t/Kw t/Any *]))
-;             -> (t/NonEmptyVec (t/HMap :mandatory {:colname String}))])
-;(defn conv [cols]
-;  (mapv mapf cols))
+(t/ann conv [(t/NonEmptyVec (t/HSequential [t/Kw t/Any *]))
+             -> (t/NonEmptyVec (t/HMap :mandatory {:colname String}))])
+(defn conv [cols]
+  (mapv mapf cols))


starting on abstracted layer model

starting on abstracted layer model

--- src/thinktopic/cortex/autoencoder.clj
+++ src/thinktopic/cortex/autoencoder.clj
@@ -16,6 +16,49 @@
   (cost [this activation target])
   (delta [this activation z target]))

+(defrecord SequentialNetwork [layers config]
+  NeuralLayer
+  (forward [this input]
+    (reduce (fn [activation layer]
+              (forward layer activation))
+            input layers))
+
+  (backward [this input output-gradient]
+    ))
+
+(defn network
+  [layers & opts]
+  {:n-layers (count layers)
+   :biases (map rand-vector (next layer-sizes))
+   :weights (map weight-matrix (rest layer-sizes) (drop-last layer-sizes))
+   :cost-fn (get opts :cost-fn (QuadraticCost.))})
+
+(defrecord LinearLayer [weights biases]
+  NeuralLayer
+  (forward [this input]
+    (assoc this :output (mat/add (mat/mmul weights input) biases)))
+
+  (backward [this input output-gradient]
+    ))
+
+(reduce
+  (fn [[activations zs] [layer-biases layer-weights]]
+    )
+  [[input] []] ; initialize zs to nil so it's the same shape as activations
+  (map vector biases weights))
+
+(defn feed-forward
+  [{:keys [biases weights] :as net} input]
+  (when (and biases weights)
+    (loop [biases biases
+           weights weights
+           activation input]
+      (if biases
+        (let [z (mat/add (mat/mmul (first weights) activation)
+                         (first biases))
+              activation (sigmoid z)]
+          (recur (next biases) (next weights) activation))
+        activation))))
 ;; Helpers
 (defn exp
   [a]
@@ -132,13 +175,6 @@
 ;       (v = velocity, m = momentum, n=learning rate)

 ; TODO: switch to passing layer-specs that have size and activation fn
-(defn network
-  [layer-sizes & opts]
-  {:n-layers (count layer-sizes)
-   :layer-sizes layer-sizes
-   :biases (map rand-vector (next layer-sizes))
-   :weights (map weight-matrix (rest layer-sizes) (drop-last layer-sizes))
-   :cost-fn (get opts :cost-fn (QuadraticCost.))})

 (defn feed-forward
   [{:keys [biases weights] :as net} input]
@@ -173,7 +209,7 @@
 ;; 4) update weights
 ;;  * multiply gradient by the learning-rate to smooth out jitter in updates.
 (defn backprop
-  [{:keys [biases weights cost-fn layer-sizes] :as net} input expected-output]
+  [{:keys [biases weights cost-fn n-layers] :as net} input expected-output]
   (let [bias-gradients (map #(mat/zero-array (mat/shape %)) biases)
         weight-gradients (map #(mat/zero-array (mat/shape %)) weights)
         [activations zs] (reduce
@@ -195,7 +231,7 @@
         weight-gradients [(mat/outer-product output-delta layer-activations)]

         ;; Now compute deltas and gradients for the hidden layers
-        layer-indices (reverse (range 1 (dec (count layer-sizes))))
+        layer-indices (reverse (range 1 (dec n-layers)))
         [_ bias-gradients weight-gradients]
         (reduce
           (fn [[delta bias-grads weight-grads] i]


adding refresh button on citizens page and changing if statement to when at error msg

--- citizen_cljs/rrm/citizen.cljs
+++ citizen_cljs/rrm/citizen.cljs
@@ -218,6 +218,26 @@
                         vid mn fp sp po
                         kknum so2 st knum so4 so6)"&pageIndex=0&pageSize=10") onres)))))

+(defn get-all-click [event]
+  (set-key-value :mutations nil)
+  (set-key-value :total-pages nil)
+  (set-key-value :is-searched-results false)
+  (set-key-value :message-client nil)
+  (set-key-value :message-server nil)
+  (set! (.-value (dom/getElement "mutationnumber")) "")
+  (set! (.-value (dom/getElement "stitle")) "")
+  (set! (.-value (dom/getElement "src-vill")) 0)
+  (set! (.-value (dom/getElement "src-sub")) 0)
+  (set! (.-value (dom/getElement "src-dist")) 0)
+  (set! (.-value (dom/getElement "svillagename")) "")
+  (set! (.-value (dom/getElement "so2number")) "")
+  (set! (.-value (dom/getElement "so4number")) "")
+  (set! (.-value (dom/getElement "so6number")) "")
+  (set! (.-value (dom/getElement "skhasranumber")) "")
+  (set! (.-value (dom/getElement "skhatakhatuninumber")) "")
+  (set! (.-value (dom/getElement "snameofthefirstparty")) "")
+  (set! (.-value (dom/getElement "snameofthesecondparty")) "")
+  (r/render [render-mutations (get-value! :mutations)]  (.getElementById js/document "app1")))

 (defn get-data [val]
   (let [res (fn [json]
@@ -314,16 +334,15 @@
                               :placeholder "Khata Khatuni Number"}]]]]
      [:div.form-group
       [:div.row
+       [:div.col-sm-4
+        [button-tool-bar
+         [button {:bs-style "primary"  :on-click search } "Search"]
+         [button {:id "getall" :bs-style "primary" :on-click get-all-click} "Refresh"]]]
        [:div.col-sm-4
-        [button {:bs-style "primary" :on-click search } "Search"]]
-       [:div.col-sm-4
-        (if (:message-client @citizen-storage)
-          [:div.alert.alert-danger [:b [:i.icon.fa.fa-ban] (str (:message-client @citizen-storage))]]
-          [:div])
-        (if (:message-server @citizen-storage)
-          [:div.alert.alert-danger [:b [:i.icon.fa.fa-ban] (str (:message-server @citizen-storage))]]
-          [:div])
-        ]]]
+        (when (:message-client @citizen-storage)
+          [:div.alert.alert-danger [:center  [:b [:i.icon.fa.fa-ban] (str (:message-client @citizen-storage))]]])
+        (when (:message-server @citizen-storage)
+          [:div.alert.alert-danger [:center  [:b [:i.icon.fa.fa-ban] (str (:message-server @citizen-storage))]]])]]]
      ]]

    [:div.box


use a different lambda gateway

use a different lambda gateway

--- src/metabase/util/stats.clj
+++ src/metabase/util/stats.clj
@@ -11,7 +11,7 @@
             [metabase.public-settings :as public-settings]
             [metabase.util :as u]))

-(def ^:private ^:const ^String metabase-usage-url "https://kqatai1z3c.execute-api.us-east-1.amazonaws.com/prod/ServerStatsCollector")
+(def ^:private ^:const ^String metabase-usage-url "https://xuq0fbkk0j.execute-api.us-east-1.amazonaws.com/prod")

 (def ^:private ^:const ^Integer anonymous-id
   "Generate an anonymous id. Don't worry too much about hash collisions or localhost cases, etc.
@@ -128,7 +128,7 @@
    :email_configured      ((resolve 'metabase.email/email-configured?))
    :slack_configured      ((resolve 'metabase.integrations.slack/slack-configured?))
    :sso_configured        (boolean ((resolve 'metabase.api.session/google-auth-client-id)))
-   :instance_started      instance-start-date
+   :instance_started      (instance-start-date)
    :has_sample_data       (db/exists? 'Database, :is_sample true)})

 ;; util function
@@ -302,7 +302,7 @@
   "send stats to Metabase tracking server"
   [stats]
    (try
-     (print (client/post metabase-usage-url {:form-params stats :content-type :json :throw-entire-message? true}))
+      (client/post metabase-usage-url {:form-params stats :content-type :json :throw-entire-message? true})
       (catch Throwable e
        (log/error "Sending usage stats FAILED: " (.getMessage e)))))

@@ -311,4 +311,5 @@
   "Collect usage stats and phone them home"
   []
   (when (anon-tracking-enabled?)
-      (send-stats! (get-anonymous-usage-stats))))+    (let [stats (get-anonymous-usage-stats)]
+      (send-stats! stats))))


letfn approach wasn't working in this file, back to defn-

--- src/midje/ideas/tabular.clj
+++ src/midje/ideas/tabular.clj
@@ -19,72 +19,72 @@

 (def #^:private deprecation-hack:file-position (atom ""))

-(letfn [(remove-pipes+where [table]
-          (when (and false (#{:where 'where} (first table)))
-            (println "The `where` syntactic sugar for tabular facts is deprecated and will be removed in Midje 1.4."
-              @deprecation-hack:file-position))
+(defn- remove-pipes+where [table]
+  (when (and false (#{:where 'where} (first table)))
+    (println "The `where` syntactic sugar for tabular facts is deprecated and will be removed in Midje 1.4."
+      @deprecation-hack:file-position))

-          (when (and false (some #(= % '|) table))
-            (println "The `|` syntactic sugar for tabular facts is deprecated and will be removed in Midje 1.4."
-              @deprecation-hack:file-position))
+  (when (and false (some #(= % '|) table))
+    (println "The `|` syntactic sugar for tabular facts is deprecated and will be removed in Midje 1.4."
+      @deprecation-hack:file-position))

-          (letfn [(strip-off-where [x] (if (#{:where 'where} (first x)) (rest x) x))]
-            (->> table strip-off-where (remove #(= % '|)))))
+  (letfn [(strip-off-where [x] (if (#{:where 'where} (first x)) (rest x) x))]
+    (->> table strip-off-where (remove #(= % '|)))))

-        (table-variable? [locals s]
-          (and (symbol? s)
-            (not (metaconstant-symbol? s))
-            (not (resolve s))
-            (not ((set locals) s))))
+(defn- table-variable? [locals s]
+  (and (symbol? s)
+    (not (metaconstant-symbol? s))
+    (not (resolve s))
+    (not ((set locals) s))))

-        (headings-rows+values [table locals]
-          (split-with (partial table-variable? locals) (remove-pipes+where table)))]
+(defn- headings-rows+values [table locals]
+  (split-with (partial table-variable? locals) (remove-pipes+where table)))

-  (defn- ^{:testable true } table-binding-maps [table locals]
-    (let [[headings-row values] (headings-rows+values table locals)
-          value-rows (partition (count headings-row) values)]
-      (map (partial ordered-zipmap headings-row) value-rows)))
+(defn- ^{:testable true } table-binding-maps [table locals]
+  (let [[headings-row values] (headings-rows+values table locals)
+        value-rows (partition (count headings-row) values)]
+    (map (partial ordered-zipmap headings-row) value-rows)))

-  (defn- ^{:testable true } add-binding-note
-    [expect-containing-form ordered-binding-map]
-    (translate-zipper expect-containing-form
-      expect?
-      (fn [loc] (skip-to-rightmost-leaf
-                  (above-arrow-sequence__add-key-value__at-arrow
-                    :binding-note (pr-str ordered-binding-map) loc)))))
+(defn- ^{:testable true } add-binding-note
+  [expect-containing-form ordered-binding-map]
+  (translate-zipper expect-containing-form
+    expect?
+    (fn [loc] (skip-to-rightmost-leaf
+                (above-arrow-sequence__add-key-value__at-arrow
+                  :binding-note (pr-str ordered-binding-map) loc)))))

-  (defn tabular* [locals form]
-    (letfn [(macroexpander-for [fact-form]
-              (comp macroexpand
-                (partial form-with-copied-line-numbers fact-form)
-                (partial unify/substitute fact-form)))]
+(defn tabular* [locals form]
+  (letfn [(macroexpander-for [fact-form]
+            (comp macroexpand
+              (partial form-with-copied-line-numbers fact-form)
+              (partial unify/substitute fact-form)))]

-      (valid-let [[description? fact-form table] (validate form locals)
-                  _ (swap! deprecation-hack:file-position
-                           (constantly (midje-position-string (form-position fact-form))))
-                  ordered-binding-maps (table-binding-maps table locals)
-                  expect-forms (map (macroexpander-for fact-form) ordered-binding-maps)
-                  expect-forms-with-binding-notes (map add-binding-note
-          expect-forms
-          ordered-binding-maps)]
-        `(within-fact-context ~description?
-           ~@expect-forms-with-binding-notes))))
+    (valid-let [[description? fact-form table] (validate form locals)
+                _ (swap! deprecation-hack:file-position
+                         (constantly (midje-position-string (form-position fact-form))))
+                ordered-binding-maps (table-binding-maps table locals)
+                expect-forms (map (macroexpander-for fact-form) ordered-binding-maps)
+                expect-forms-with-binding-notes (map add-binding-note
+        expect-forms
+        ordered-binding-maps)]
+      `(within-fact-context ~description?
+         ~@expect-forms-with-binding-notes))))

-  (defmethod validate "tabular" [[_tabular_ & form] locals]
-    (let [[[description? & _] [fact-form & table]] (split-with string? form)
-          [headings-row values] (headings-rows+values table locals)]
-      (cond (empty? table)
-            (simple-report-validation-error form
-              "There's no table. (Misparenthesized form?)")
-
-            (empty? values)
-            (simple-report-validation-error form
-              "It looks like the table has headings, but no values:")
-
-            (empty? headings-row)
-            (simple-report-validation-error form
-              "It looks like the table has no headings, or perhaps you"
-              "tried to use a non-literal string for the doc-string?:")
-
-            :else
-            [description? fact-form table]))))+(defmethod validate "tabular" [[_tabular_ & form] locals]
+  (let [[[description? & _] [fact-form & table]] (split-with string? form)
+        [headings-row values] (headings-rows+values table locals)]
+    (cond (empty? table)
+          (simple-report-validation-error form
+            "There's no table. (Misparenthesized form?)")
+
+          (empty? values)
+          (simple-report-validation-error form
+            "It looks like the table has headings, but no values:")
+
+          (empty? headings-row)
+          (simple-report-validation-error form
+            "It looks like the table has no headings, or perhaps you"
+            "tried to use a non-literal string for the doc-string?:")
+
+          :else
+          [description? fact-form table])))


updated piggieback version

updated piggieback version


Make remove-all-handlers private as using it totally kills Overtone

--- src/overtone/libs/event.clj
+++ src/overtone/libs/event.clj
@@ -164,7 +164,7 @@
   (log-event "Removing event handler associated with key: " key)
   (handlers/remove-handler! handler-pool key))

-(defn remove-all-handlers
+(defn- remove-all-handlers
   "Remove all handlers."
   []
   (let [[old new] (swap-returning-prev! lossy-workers* (fn [_] {}))]


CMR-2562: Fixing the cache api test for cache changes.

--- system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
+++ system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
@@ -68,52 +68,52 @@
         coll1 (d/ingest "PROV1" (dc/collection {:entry-title "coll1"}))]
     (testing "list caches"
       (are [url caches]
-           (let [response (list-caches-for-app url admin-read-token)]
-             (is (= (set caches) (set response))))
-
-           (url/indexer-read-caches-url) ["acls" "general" "token-imp" "kms"]
-           (url/index-set-read-caches-url) ["token-imp"]
-           (url/mdb-read-caches-url) ["token-imp"]
-           (url/ingest-read-caches-url) ["token-imp" "providers" "acls" "token-user-ids" "kms"]
-           (url/search-read-caches-url) ["acls"
-                                         "collections-for-gran-acls"
-                                         "has-granules-map"
-                                         "index-names"
-                                         "token-imp"
-                                         "token-sid"
-                                         "xsl-transformer-templates"
-                                         "kms"])
-      (s/only-with-real-database
-        (testing "list caches for bootstrap"
-          (let [response (list-caches-for-app (url/bootstrap-read-caches-url) admin-read-token)]
-            (is (= ["token-imp" "kms"] response))))))
+        (let [response (list-caches-for-app url admin-read-token)]
+          (is (= (set caches) (set response))))
+
+        (url/indexer-read-caches-url) ["acls" "indexer-index-set-cache" "token-imp" "kms"]
+        (url/index-set-read-caches-url) ["token-imp"]
+        (url/mdb-read-caches-url) ["token-imp"]
+        (url/ingest-read-caches-url) ["token-imp" "providers" "acls" "token-user-ids" "kms"]
+        (url/search-read-caches-url) ["acls"
+                                      "collections-for-gran-acls"
+                                      "has-granules-map"
+                                      "index-names"
+                                      "token-imp"
+                                      "token-sid"
+                                      "xsl-transformer-templates"
+                                      "kms"])
+      (s/only-with-real-database
+       (testing "list caches for bootstrap"
+         (let [response (list-caches-for-app (url/bootstrap-read-caches-url) admin-read-token)]
+           (is (= ["token-imp" "kms"] response))))))

     (testing "normal user cannot access cache list API"
       (are [url]
-           (let [response (client/request {:url url
-                                           :method :get
-                                           :query-params {:token normal-user-token}
-                                           :connection-manager (s/conn-mgr)
-                                           :throw-exceptions false})
-                 errors (:errors (json/decode (:body response) true))]
-             (is (= 401 (:status response)))
-             (is (= ["You do not have permission to perform that action."] errors)))
-           (url/indexer-read-caches-url)
-           (url/index-set-read-caches-url)
-           (url/mdb-read-caches-url)
-           (url/ingest-read-caches-url)
-           (url/search-read-caches-url))
-      (s/only-with-real-database
-        (testing "normal user cannot access cache list API for bootstrap"
-          (let [response (client/request {:url (url/bootstrap-read-caches-url)
-                                          :method :get
-                                          :query-params {:token normal-user-token}
-                                          :connection-manager (s/conn-mgr)
-                                          :throw-exceptions false})
-                errors (:errors (json/decode (:body response) true))]
-            (is (= 401 (:status response)))
-            (is (= ["You do not have permission to perform that action."] errors))))))
+        (let [response (client/request {:url url
+                                        :method :get
+                                        :query-params {:token normal-user-token}
+                                        :connection-manager (s/conn-mgr)
+                                        :throw-exceptions false})
+              errors (:errors (json/decode (:body response) true))]
+          (is (= 401 (:status response)))
+          (is (= ["You do not have permission to perform that action."] errors)))
+        (url/indexer-read-caches-url)
+        (url/index-set-read-caches-url)
+        (url/mdb-read-caches-url)
+        (url/ingest-read-caches-url)
+        (url/search-read-caches-url))
+      (s/only-with-real-database
+       (testing "normal user cannot access cache list API for bootstrap"
+         (let [response (client/request {:url (url/bootstrap-read-caches-url)
+                                         :method :get
+                                         :query-params {:token normal-user-token}
+                                         :connection-manager (s/conn-mgr)
+                                         :throw-exceptions false})
+               errors (:errors (json/decode (:body response) true))]
+           (is (= 401 (:status response)))
+           (is (= ["You do not have permission to perform that action."] errors))))))

     (testing "retrieval of keys for non-existent cache results in a 404"
       (let [response (client/request {:url (str (url/indexer-read-caches-url) "/INVALID-CACHE-ABC")
@@ -126,88 +126,88 @@

     (testing "normal user cannot retrieve cache keys"
       (are [url]
-           (let [response (client/request {:url url
-                                           :method :get
-                                           :query-params {:token normal-user-token}
-                                           :connection-manager (s/conn-mgr)
-                                           :throw-exceptions false})
-                 errors (:errors (json/decode (:body response) true))]
-             (is (= 401 (:status response)))
-             (is (= ["You do not have permission to perform that action."] errors)))
-           (str (url/indexer-read-caches-url) "/acls")
-           (str (url/index-set-read-caches-url) "/acls")
-           (str (url/mdb-read-caches-url) "/acls")
-           (str (url/ingest-read-caches-url) "/acls")
-           (str (url/search-read-caches-url) "/acls"))
-      (s/only-with-real-database
-        (testing "normal user cannot retrieve cache keys for bootstrap"
-          (let [response (client/request {:url (url/bootstrap-read-caches-url)
-                                          :method :get
-                                          :query-params {:token normal-user-token}
-                                          :connection-manager (s/conn-mgr)
-                                          :throw-exceptions false})
-                errors (:errors (json/decode (:body response) true))]
-            (is (= 401 (:status response)))
-            (is (= ["You do not have permission to perform that action."] errors))))))
+        (let [response (client/request {:url url
+                                        :method :get
+                                        :query-params {:token normal-user-token}
+                                        :connection-manager (s/conn-mgr)
+                                        :throw-exceptions false})
+              errors (:errors (json/decode (:body response) true))]
+          (is (= 401 (:status response)))
+          (is (= ["You do not have permission to perform that action."] errors)))
+        (str (url/indexer-read-caches-url) "/acls")
+        (str (url/index-set-read-caches-url) "/acls")
+        (str (url/mdb-read-caches-url) "/acls")
+        (str (url/ingest-read-caches-url) "/acls")
+        (str (url/search-read-caches-url) "/acls"))
+      (s/only-with-real-database
+       (testing "normal user cannot retrieve cache keys for bootstrap"
+         (let [response (client/request {:url (url/bootstrap-read-caches-url)
+                                         :method :get
+                                         :query-params {:token normal-user-token}
+                                         :connection-manager (s/conn-mgr)
+                                         :throw-exceptions false})
+               errors (:errors (json/decode (:body response) true))]
+           (is (= 401 (:status response)))
+           (is (= ["You do not have permission to perform that action."] errors))))))

     (testing "list cache keys"
       (are [url cache cache-keys]
-           (let [response (list-cache-keys url cache admin-read-token)]
-             (is (= (set cache-keys) (set response))))
-
-           (url/indexer-read-caches-url) "acls" ["acls"]
-           (url/indexer-read-caches-url) "general" ["concept-indices" "concept-mapping-types"]
-           (url/indexer-read-caches-url) "token-imp" [["ABC-2" "read"] ["ABC-1" "read"]]
-           (url/index-set-read-caches-url) "token-imp" [["mock-echo-system-token" "update"]
-                                                        ["mock-echo-system-token" "read"]
-                                                        ["ABC-1" "read"]
-                                                        ["ABC-2" "read"]]
-           (url/mdb-read-caches-url) "token-imp" [["mock-echo-system-token" "update"]
+        (let [response (list-cache-keys url cache admin-read-token)]
+          (is (= (set cache-keys) (set response))))
+
+        (url/indexer-read-caches-url) "acls" ["acls"]
+        (url/indexer-read-caches-url) "indexer-index-set-cache" ["concept-indices" "concept-mapping-types"]
+        (url/indexer-read-caches-url) "token-imp" [["ABC-2" "read"] ["ABC-1" "read"]]
+        (url/index-set-read-caches-url) "token-imp" [["mock-echo-system-token" "update"]
+                                                     ["mock-echo-system-token" "read"]
+                                                     ["ABC-1" "read"]
+                                                     ["ABC-2" "read"]]
+        (url/mdb-read-caches-url) "token-imp" [["mock-echo-system-token" "update"]
+                                               ["ABC-1" "read"]
+                                               ["ABC-2" "read"]]
+        (url/ingest-read-caches-url) "token-imp" [[nil "update"]
                                                   ["ABC-1" "read"]
                                                   ["ABC-2" "read"]]
-           (url/ingest-read-caches-url) "token-imp" [[nil "update"]
-                                                     ["ABC-1" "read"]
-                                                     ["ABC-2" "read"]]
-           (url/search-read-caches-url) "acls" ["acls"]
-           (url/search-read-caches-url) "collections-for-gran-acls" []
-           (url/search-read-caches-url) "has-granules-map" []
-           (url/search-read-caches-url) "index-names" []
-           (url/search-read-caches-url) "token-imp" [["ABC-1" "read"] ["ABC-2" "read"]]
-           (url/search-read-caches-url) "token-sid" []
-           (url/search-read-caches-url) "xsl-transformer-templates" [])
-      (s/only-with-real-database
-        (testing "list cache keys for bootstrap"
-          (let [response (list-cache-keys (url/bootstrap-read-caches-url) "token-imp" admin-read-token)]
-            (is (every? (set response)
-                        [["ABC-1" "read"]
-                         ["ABC-2" "read"]]))))))
+        (url/search-read-caches-url) "acls" ["acls"]
+        (url/search-read-caches-url) "collections-for-gran-acls" []
+        (url/search-read-caches-url) "has-granules-map" []
+        (url/search-read-caches-url) "index-names" []
+        (url/search-read-caches-url) "token-imp" [["ABC-1" "read"] ["ABC-2" "read"]]
+        (url/search-read-caches-url) "token-sid" []
+        (url/search-read-caches-url) "xsl-transformer-templates" [])
+      (s/only-with-real-database
+       (testing "list cache keys for bootstrap"
+         (let [response (list-cache-keys (url/bootstrap-read-caches-url) "token-imp" admin-read-token)]
+           (is (every? (set response)
+                       [["ABC-1" "read"]
+                        ["ABC-2" "read"]]))))))

     (testing "normal user cannot retrieve cache values"
       (are [url]
-           (let [response (client/request {:url url
-                                           :method :get
-                                           :query-params {:token normal-user-token}
-                                           :connection-manager (s/conn-mgr)
-                                           :throw-exceptions false})
-                 errors (:errors (json/decode (:body response) true))]
-             (is (= 401 (:status response)))
-             (is (= ["You do not have permission to perform that action."] errors)))
-           (str (url/indexer-read-caches-url) "/acls/acls")
-           (str (url/index-set-read-caches-url) "/acls/acls")
-           (str (url/mdb-read-caches-url) "/acls/acls")
-           (str (url/ingest-read-caches-url) "/acls/acls")
-           (str (url/search-read-caches-url) "/acls/acls"))
-      (s/only-with-real-database
-        (testing "normal user cannot retrieve cache values for bootstrap"
-          (let [response (client/request {:url (url/bootstrap-read-caches-url)
-                                          :method :get
-                                          :query-params {:token normal-user-token}
-                                          :connection-manager (s/conn-mgr)
-                                          :throw-exceptions false})
-                errors (:errors (json/decode (:body response) true))]
-            (is (= 401 (:status response)))
-            (is (= ["You do not have permission to perform that action."] errors))))))
+        (let [response (client/request {:url url
+                                        :method :get
+                                        :query-params {:token normal-user-token}
+                                        :connection-manager (s/conn-mgr)
+                                        :throw-exceptions false})
+              errors (:errors (json/decode (:body response) true))]
+          (is (= 401 (:status response)))
+          (is (= ["You do not have permission to perform that action."] errors)))
+        (str (url/indexer-read-caches-url) "/acls/acls")
+        (str (url/index-set-read-caches-url) "/acls/acls")
+        (str (url/mdb-read-caches-url) "/acls/acls")
+        (str (url/ingest-read-caches-url) "/acls/acls")
+        (str (url/search-read-caches-url) "/acls/acls"))
+      (s/only-with-real-database
+       (testing "normal user cannot retrieve cache values for bootstrap"
+         (let [response (client/request {:url (url/bootstrap-read-caches-url)
+                                         :method :get
+                                         :query-params {:token normal-user-token}
+                                         :connection-manager (s/conn-mgr)
+                                         :throw-exceptions false})
+               errors (:errors (json/decode (:body response) true))]
+           (is (= 401 (:status response)))
+           (is (= ["You do not have permission to perform that action."] errors))))))

     (testing "retrieval of value for non-existent key results in a 404"
       (let [response (client/request {:url (str (url/indexer-read-caches-url)
@@ -221,9 +221,11 @@

     (testing "lookup value for cache key"
       (are [url cache cache-key value]
-           (let [response (get-cache-value url cache cache-key admin-read-token)]
-             (is (= (set value) (set response))))
-           (url/indexer-read-caches-url) "general" "concept-mapping-types" {:collection "collection"
-                                                                            :granule "granule"
-                                                                            :tag "tag"}))))
-
+        (let [response (get-cache-value url cache cache-key admin-read-token)]
+          (is (= (set value) (set response))))
+        (url/indexer-read-caches-url) "indexer-index-set-cache"
+        "concept-mapping-types"
+        {:collection "collection"
+         :granule "granule"
+         :tag "tag"}))))
+


Add floats and Floats at the beginning.

Add floats and Floats at the beginning.

--- test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
+++ test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
@@ -16,6 +16,7 @@
   (fact (= Short   java.lang.Short)   => true)
   (fact (= Integer java.lang.Integer) => true)
   (fact (= Long    java.lang.Long)    => true)
+  (fact (= Float   java.lang.Float)   => true)
   (fact (= Double  java.lang.Double)  => true))

 (fact "Some of Clojure's numeric types are from java.math"
@@ -23,7 +24,7 @@
   (fact (= BigInteger java.math.BigInteger) => true))

 (fact "Some of Clojure's numeric types are from clojure.lang"
-  ;; These are not available without the clojure.lang. prefix
+  ;; These are not available without the clojure.lang. prefix.
   (fact clojure.lang.BigInt => clojure.lang.BigInt)
   (fact clojure.lang.Ratio  => clojure.lang.Ratio))

@@ -34,16 +35,18 @@
   (fact (type 2.0M)  => BigDecimal)
   (fact (type 2M)    => BigDecimal)
   (fact (type 2.0)   => Double)
-  (fact (type (Byte. (byte 2)))   => Byte)
-  (fact (type (Short. (short 2))) => Short)
-  (fact (type (Integer. (int 2))) => Integer)
-  (fact (type (BigInteger. "2"))  => BigInteger))
-
-(fact "Autoboxing"
-  (fact (type (byte 2))  => Byte)
-  (fact (type (short 2)) => Short)
-  (fact (type (int 2))   => Integer)
-  (fact (type (long 2))  => Long))
+  (fact (type (Byte. (byte 2)))     => Byte)
+  (fact (type (Short. (short 2)))   => Short)
+  (fact (type (Integer. (int 2)))   => Integer)
+  (fact (type (BigInteger. "2"))    => BigInteger)
+  (fact (type (Float. (float 2.0))) => Float))
+
+(fact "Autoboxing when calling a function"
+  (fact (type (byte 2))    => Byte)
+  (fact (type (short 2))   => Short)
+  (fact (type (int 2))     => Integer)
+  (fact (type (long 2))    => Long)
+  (fact (type (float 2.0)) => Float))

 (fact "Ratios are turned into Longs if possible"
   (type 4/2) => Long)


Remove extraneous behavior

Remove extraneous behavior

--- src/lt/objs/sidebar/workspace.cljs
+++ src/lt/objs/sidebar/workspace.cljs
@@ -606,13 +606,6 @@
                             {:label "Delete Workspace"
                              :click (fn [] (object/raise this :delete!))})))

-(behavior ::sidebar-recents-menu
-          :triggers #{:recents.menu!}
-          :reaction (fn [this r e]
-                      (-> (menu [{:label "Remove"
-                                  :click (fn [] (object/raise this :recent.remove! r))}])
-                          (show-menu (.-clientX e) (.-clientY e)))))
-
 (behavior ::workspace.open-on-start
           :triggers #{:init}
           :type :user


lose superfluous method body

lose superfluous method body

--- src/main/clojure/org/dada/core.clj
+++ src/main/clojure/org/dada/core.clj
@@ -471,16 +471,12 @@
      )
     ))

-;; does this need the type arg ?
-(defn do-reduce-count
-  ([#^Model model key-value #^Metadata tgt-metadata]
-   (let [strategy (make-count-reducer-strategy (.getMetadata model) tgt-metadata)
+;TODO - pass plural values all way through
+
+(defn do-reduce-count [#^Model model #^Collection [value] #^Metadata tgt-metadata count-key]
+  (let [strategy (make-count-reducer-strategy (.getMetadata model) tgt-metadata)
 	view-name-fn (fn [arg] "count()")]
-     (make-reducer model :count4 key-value strategy tgt-metadata view-name-fn)))
-  ([#^Model model #^Collection [value] #^Metadata tgt-metadata count-key] ;TODO - pass plural values all way through
-   (let [strategy (make-count-reducer-strategy (.getMetadata model) tgt-metadata)
-	view-name-fn (fn [arg] "count()")]
-     (make-reducer model count-key value strategy tgt-metadata view-name-fn))))
+    (make-reducer model count-key value strategy tgt-metadata view-name-fn)))

 ;;----------------------------------------
 ;; refactored to here


refactor to use start/stop for sente server

--- src/main/clojure/trellis/sente.clj
+++ src/main/clojure/trellis/sente.clj
@@ -1,6 +1,7 @@
 (ns trellis.sente
   (:require
     [clojure.tools.logging :as log]
+    [clojure.core.async :as async :refer []]
     [com.stuartsierra.component :as component]
     [taoensso.sente :as sente]
     ))
@@ -10,20 +11,36 @@
                         ajax-post-fn
                         ajax-get-or-ws-handshake-fn
                         connected-uids]
-  )
+  component/Lifecycle
+	  (start [s]
+	    (if (:ch-recv s)
+         s
+         (do ;; start sente component
+           (let [csr (sente/make-channel-socket! {})]
+            (merge s csr)))))
+	  (stop [s]
+	    (if (:ch-recv s)
+        (do ;; stop sente component
+          (sente-server))
+        s)))

 (defn sente-server
   "Returns a sente server-side component.
    The ajax functions are intented to be used as ring handlers. " []
-  (let [{:keys [ch-recv ; ChannelSocket's receive channel
-                send-fn ; ChannelSocket's send API fn
-                ajax-post-fn ; function for Ring handler POST
-                ajax-get-or-ws-handshake-fn ; function for Ring handler GET
-                connected-uids ; Watchable, read-only atom
-                ]}
-        (sente/make-channel-socket! {})]
-     (SenteServer. ch-recv
-                   send-fn
-                   ajax-post-fn
-                   ajax-get-or-ws-handshake-fn
-                   connected-uids)))+  (SenteServer. nil nil nil nil nil))
+
+;(defn sente-server
+;  "Returns a sente server-side component.
+;   The ajax functions are intented to be used as ring handlers. " []
+;  (let [{:keys [ch-recv ; ChannelSocket's receive channel
+;                send-fn ; ChannelSocket's send API fn
+;                ajax-post-fn ; function for Ring handler POST
+;                ajax-get-or-ws-handshake-fn ; function for Ring handler GET
+;                connected-uids ; Watchable, read-only atom
+;                ] :as csr}
+;        (sente/make-channel-socket! {})]
+;     (SenteServer. ch-recv
+;                   send-fn
+;                   ajax-post-fn
+;                   ajax-get-or-ws-handshake-fn
+;                   connected-uids)))


Finish spec

Finish spec


Turned off topology debug. Was creating strange implementation not found errors for :vectorz

--- src/polismath/stormspec.clj
+++ src/polismath/stormspec.clj
@@ -119,13 +119,13 @@
   (let [cluster (LocalCluster.)]
     (.submitTopology cluster
                      "online-pca"
-                     {TOPOLOGY-DEBUG true}
+                     {TOPOLOGY-DEBUG false}
                      (mk-topology sim write))))

 (defn submit-topology! [name {sim :sim write :write}]
   (StormSubmitter/submitTopology name
-    {TOPOLOGY-DEBUG true
+    {TOPOLOGY-DEBUG false
      TOPOLOGY-WORKERS 3}
     (mk-topology sim write)))


Better explanations of overflow.

Better explanations of overflow.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -127,20 +127,35 @@
 (fact (=-and-same-type 2N 2N) => true)

 ;;;; ___________________________________________________________________________
-;;;; ---- Bigger than longs ----
+;;;; ---- Going from longs/Longs to bigger or smaller ----

 (def max-long-plus-1 9223372036854775808N)

-(fact (inc Long/MAX_VALUE) => (throws ArithmeticException))
-(fact (inc (bigint Long/MAX_VALUE)) => max-long-plus-1)
+(fact "The 'ordinary' operators throw exceptions on overflow"
+  (inc Long/MAX_VALUE) => (throws ArithmeticException "integer overflow"))

-(fact (inc' Long/MAX_VALUE) => max-long-plus-1)
-(fact (=-and-same-type (inc' 1) 2) => true)
+(fact "We can avoid overflow exception by coercing to BigInt first"
+  (inc (bigint Long/MAX_VALUE)) => max-long-plus-1)

-(fact (unchecked-inc Long/MAX_VALUE) => Long/MIN_VALUE)
+(fact "The xxx' operators"
+  (fact "...auto-promote"
+    (inc' Long/MAX_VALUE) => max-long-plus-1)
+  (fact "...only change the type if necessary"
+    (=-and-same-type (inc' 1) 2) => true))

-(do
-  (def max-long Long/MAX_VALUE)
-  (fact (unchecked-inc max-long) => (throws ArithmeticException)) ; **** Huh?
-  (fact (let [max-long Long/MAX_VALUE] (unchecked-inc max-long))
-    => Long/MIN_VALUE))
+(def boxed-max-long Long/MAX_VALUE)
+
+(fact "The unchecked-xxx operators"
+  (fact "...don't check for overflow"
+    (unchecked-inc Long/MAX_VALUE) => Long/MIN_VALUE)
+  (fact "...only do what you expect on longs, not Longs"
+    ;; The doc strings for unchecked operations only define what happens
+    ;; for (unboxed) longs, not for (boxed) Longs.
+    ;; - See https://groups.google.com/d/msg/clojure/1tefVmYKmpc/2hKlXU-c13sJ
+    (fact "...with a boxed value it seems weird"
+      (unchecked-inc boxed-max-long) => (throws ArithmeticException
+                                                "integer overflow"))
+    (fact "...but with an unboxed value it's as you'd expect"
+      (let [unboxed-max-long Long/MAX_VALUE]
+        (unchecked-inc unboxed-max-long))
+      => Long/MIN_VALUE)))


Moved message regex util to cmr-common-lib.

--- test/cmr/search/test/services/legacy_parameters.clj
+++ test/cmr/search/test/services/legacy_parameters.clj
@@ -7,7 +7,7 @@
             [cmr.search.services.messages.attribute-messages :as a-msg]
             [cmr.common.test.test-check-ext :as tc :refer [defspec]]
             [clojure.string :as s]
-            [cmr.metadata-db.test.util :as tu])
+            [cmr.common.dev.util :as cu])
   (import clojure.lang.ExceptionInfo))

@@ -59,7 +59,7 @@

 ;; Tests that all generated legacy-psa attribute stings can be converted to cmr format.
-(defspec legacy-psa->cmr-test 1
+(defspec legacy-psa->cmr-test 100
   (for-all [legacy-psa (such-that not-empty (gen/vector legacy-psa-maps))]
     (let [legacy-query (legacy-psa-maps->legacy-psa-query legacy-psa)
           cmr-psa-query (legacy-psa-maps->cmr-psa-query legacy-psa)
@@ -78,7 +78,7 @@

 ;; Test for mixed parameters
 (deftest mixed-paramter-types
-  (is (thrown-with-msg? ExceptionInfo (tu/message->regex (a-msg/mixed-legacy-and-cmr-style-parameters-msg))
+  (is (thrown-with-msg? ExceptionInfo (cu/message->regex (a-msg/mixed-legacy-and-cmr-style-parameters-msg))
                         (lp/process-legacy-psa {:attribute ["string,abc,xyz"
                                                             {:name "PDQ"}
                                                             {:type "string"}