squash! Fix != false filtering in MySQL :scream_cat: #1680

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -400,14 +400,20 @@
     aggregate count of places
     filter = liked false))

+(defn- int->bool [x]
+  (condp = x
+    0 false
+    1 true
+      x))
+
 ;;; filter = true
 (datasets/expect-with-all-engines
   [[1 true "Tempest"]
    [2 true "Bullit"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter = liked true
-     return rows))
+     filter = liked true, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;;; filter != false
 (datasets/expect-with-all-engines
@@ -415,16 +421,16 @@
    [2 true "Bullit"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter != liked false
-     return rows))
+     filter != liked false, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;;; filter != true
 (datasets/expect-with-all-engines
   [[3 false "The Dentist"]]
   (Q dataset places-cam-likes
      aggregate rows of places
-     filter != liked true
-     return rows))
+     filter != liked true, order id+
+     return rows (format-rows-by [int int->bool str])))

 ;; ### FILTER -- "BETWEEN", single subclause (neither "AND" nor "OR")


:bulb:

:bulb:

--- src/mantra/core.cljs
+++ src/mantra/core.cljs
@@ -160,5 +160,6 @@
       they can be restarted when 'unmuted'
     - a generic `play` function that will do the right thing, depending on the types of the arguments
         e.g. multiple arguments are treated as a sequence of notes, a collection of notes is treated as a chord
+    - higher-level abstractions for pitch and duration, i.e. a G#5 half note at 100 bpm
 ")


Upgrade some plugin deps.

Upgrade some plugin deps.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,4 +1,4 @@
-{:user {:dependencies [[clj-stacktrace "0.2.5"]
+{:user {:dependencies [[clj-stacktrace "0.2.7"]
                        [org.clojure/tools.trace "0.7.6"]
                        [org.clojure/tools.namespace "0.2.4"]
                        [redl "0.2.2"]
@@ -16,11 +16,11 @@
                   [lein-clojars "0.9.1"]
                   [lein-pprint "1.1.1"]
                   [lein-expectations "0.0.7"]
-                  [com.cemerick/austin "0.1.3"]
                   [lein-ring "0.8.0"]
-                  [lein-cljsbuild "0.3.2"]
+                  [lein-cljsbuild "1.0.3"]
                   [lein-deps-tree "0.1.2"]
                   [mvxcvi/whidbey "0.3.2"]
+                  [lein-typed "0.3.5"]
                   [lein-marginalia "0.7.1"]]
         ; printing options are customizable:
         :puget-options {}


update nrepl

update nrepl

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -13,4 +13,4 @@
   :dependencies
   [[alembic "0.3.2"]
    [criterium "0.4.3"]
-   [org.clojure/tools.nrepl "0.2.7"]]}}
+   [org.clojure/tools.nrepl "0.2.10"]]}}


remove old deps and add local storage to :documents-changed reactions

--- src/app/cljs/one/sample/model.cljs
+++ src/app/cljs/one/sample/model.cljs
@@ -1,9 +1,8 @@
 (ns ^{:doc "Contains client-side state, validators for input fields
   and functions which react to changes made to the input fields."}
   one.sample.model
- (:require [one.dispatch              :as dispatch]
-           [goog.editor.SeamlessField :as editor-div]
-           [goog.editor.Field         :as editor-iframe]))
+  (:require [one.dispatch :as dispatch]
+            [local        :as local]))
 ;; Note: ns aliases for goog.editor.Field and goog.editor.SeamlessField do not
 ;; work due to there being no goog/editor/editor.js file that provides goog.editor
 ;; in the Google Closure Library.
@@ -21,6 +20,10 @@
 (add-watch docs :documents-state-key
            (fn [k r o n]
              (dispatch/fire :documents-changed n)))
+
+(dispatch/react-to #{:documents-changed}
+                   (fn [_ d]
+                     (local/set-item "docs" d)))

 (defn uuid []
   (let [chars "0123456789abcdef"
@@ -55,4 +58,5 @@
                              snapshot)))
         :redo          (let [snapshot (nth @history (dec @cursor))]
                          (swap! cursor dec)
-                         snapshot)))))+                         snapshot)))))
+


Fixed Postgres bug

Fixed Postgres bug

Use JDBC connection to make postgres triggers

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -41,6 +41,7 @@

 (Class/forName "oracle.jdbc.driver.OracleDriver")
+(Class/forName "org.postgresql.Driver")

@@ -448,7 +449,12 @@

     (if (not coils-trigger-exists)
       (let [
-             jdbc-conn    (. java.sql.DriverManager getConnection  (str "jdbc:oracle:thin:" *database-user* "/" *database-password* "@" *database-server* ":1521:" *database-name*)  *database-user*  *database-password*)
+             jdbc-conn        (cond
+                                (= *database-type* "postgres" )
+                                (. java.sql.DriverManager getConnection  (str "jdbc:postgresql://" *database-server* ":5432/" *database-name*)  *database-user*  *database-password*)
+
+                                (= *database-type* "oracle" )
+                                (. java.sql.DriverManager getConnection  (str "jdbc:oracle:thin:" *database-user* "/" *database-password* "@" *database-server* ":1521:" *database-name*)  *database-user*  *database-password*))
              statement    (. jdbc-conn createStatement)

              ]


First attempt at designing a parser like Haskell Parser, this is rather not usable right now

--- src/clj/algorithms_clj/parsing.clj
+++ src/clj/algorithms_clj/parsing.clj
@@ -36,3 +36,62 @@
   (let [p (word-parser (terminal))]                         ;; TODO - A runParser method would be much nicer
     (println (on-success p [] "my first sentence"))
     ))
+
+
+;; -------------------------------------------------------
+;; Another attempt of design
+;; -------------------------------------------------------
+
+(defrecord ParseFailure [^String explanation])
+
+(defrecord ParseInput [^String str ^int cursor])
+
+(defrecord ParseSuccess [^ParseInput input result])
+
+;; A parser is a function of type Input -> Failure | Success Input Result
+
+(defprotocol ParseMonad
+  (bind [mvalue mfunction] "The bind operator of Haskell"))
+
+(defn run-parser [parser input]
+  (parser input))
+
+(extend-type ParseFailure
+  ParseMonad
+  (bind [mvalue _] mvalue))
+
+(extend-type ParseSuccess
+  ParseMonad
+  (bind [{:keys [input result]} mfunction]
+    (run-parser (mfunction result) input)
+    ))
+
+;; Trying the example out
+
+(defn pure [a]
+  (fn [input]
+    (ParseSuccess. input a)
+    ))
+
+(defn parse-word
+  [{:keys [str cursor]}]
+  (let [next-cursor (str/index-of str " " cursor)]
+    (ParseSuccess.
+      (ParseInput. str (inc next-cursor))
+      (subs str cursor next-cursor))
+    ))
+
+(defn mparsing-test []
+  (bind
+    (run-parser parse-word (ParseInput. "my first sentence" 0))
+    (fn [lhs]
+      (fn [input]
+        (bind (parse-word input)
+          (fn [rhs]
+            (pure (str/join "," [lhs rhs]))
+            ))
+        ))
+    ))
+
+
+


Add queue init that accepts zk client object

Application can choose to add custom watchers to handle events on a
zookeeper connection e.g. handling session expired event. Current
implementation doesn't support this usecase.

Adding a new queue initialization `init-queue-with-zk-client` that will
accept a `ZooKeeper` client object directly to return a queue
object. Now application can include it's own logic to retry on `Expired`
or `Disconnected` keeper-state events.

Note: If you are using `blocking-dequeue` in your code and retry zk
connection after it is disconnected/expired then you will have to create
new queue object using `init-queue-with-zk-client` and call
`blocking-dequeue` again.

--- src/clj/com/helpshift/zk_queue.clj
+++ src/clj/com/helpshift/zk_queue.clj
@@ -1,6 +1,7 @@
 (ns ^{:doc "A thin clojure wrapper over Zookeeper Queue Recipe"
       :author "Kiran Kulkarni <kk.questworld@gmail.com>"}
   com.helpshift.zk-queue
+  (:refer-clojure :exclude [peek])
   (:require [clojure.string :as cs]
             [com.helpshift.zk-queue.utils :refer [to-byte-array]])
   (:import (org.apache.zookeeper ZooKeeper WatchedEvent Watcher)
@@ -49,6 +50,9 @@
     (when (.await latch conn-timeout TimeUnit/SECONDS)
       client)))

+(def valid-path?
+  (some-fn nil? #(.startsWith ^String % "/")))
+

 (defn init-queue!
   "Give queue-path and zookeeper-nodes.
@@ -56,13 +60,28 @@
    Returns queue object"
   [zk-queue-path & zk-nodes]
   {:pre [(every? :host zk-nodes)
-         (seq zk-queue-path)]}
+         (seq zk-queue-path)
+         (valid-path? zk-queue-path)]}
   (if-let [zk-client (zk-connect! zk-nodes)]
     (DistributedQueue. zk-client
                        zk-queue-path
                        nil)
     (throw (ex-info "Failed to Connect to zookeeper"
                     {:nodes zk-nodes}))))
+
+
+
+(defn init-queue-with-zk-client
+  "Give queue-path and zookeeper client.
+   Returns queue object"
+  [zk-client zk-queue-path]
+  (assert (instance? ZooKeeper zk-client)
+          "Must provide a org.apache.zookeeper.ZooKeeper instance")
+  (assert (valid-path? zk-queue-path)
+          "Path must start with / character")
+  (DistributedQueue. zk-client
+                     (or zk-queue-path "/")
+                     nil))

 (defn close!


slt endpoint secured

slt endpoint secured

--- src/clj/swarmpit/authorization.clj
+++ src/clj/swarmpit/authorization.clj
@@ -53,6 +53,8 @@
              :handler any-access}
             {:pattern #"^/initialize$"
              :handler any-access}
+            {:pattern #"^/slt"
+             :handler authenticated-access}
             {:pattern #"^/$"
              :handler any-access}
             {:pattern        #"^/api/registries/(dockerhub|v2)/[a-zA-Z0-9]*/repositories$"
@@ -68,7 +70,7 @@
              :request-method #{:get :delete :post}
              :handler        {:and [authenticated-access owner-access]}}
             {:pattern #"^/api/.*"
-             :handler {:and [authenticated-access]}}])
+             :handler authenticated-access}])

 (defn- rules-error
   [_ val]


RR: clean imports

RR: clean imports

--- src/cljs/hatti/views/overview.cljs
+++ src/cljs/hatti/views/overview.cljs
@@ -1,7 +1,6 @@
 (ns hatti.views.overview
-  (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om :include-macros true]
-            [sablono.core :as html :refer-macros [html]]
+            [sablono.core :refer-macros [html]]
             [hatti.views :refer [overview-page]]))


func to get both test/train data

func to get both test/train data

--- src/clojure/zensols/dataset/db.clj
+++ src/clojure/zensols/dataset/db.clj
@@ -63,7 +63,7 @@
         * **id** the unique identifier of the data point
         * **instance** is the data set instance (can be an `N`-deep map)
         * **class-label** the label of the class (can be nominal, double, integer)
-        * **set-type** either `:test` or `:train` used to presort the data
+        * **set-type** either `:test`, `:train`, `:train-test` (all) used to presort the data
         with [[divide-by-preset]]; note that it isn't necessary to
         call [[divide-by-preset]] for the first invocation of [[instances-load]]

@@ -148,7 +148,8 @@
 (defn set-default-set-type
   "Set the default bucket (training or testing) to get data.

-  * **:set-type** is either `:train` or `:test` (`:train` if not set)
+  * **:set-type** is either `:train` (default) or `:test`;
+  see [[elasticsearch-connection]]

   See [[ids]]"
   [set-type]
@@ -279,7 +280,7 @@

   Keys
   ----
-  * **:set-type** is either `:train` or `:test` and defaults
+  * **:set-type** is either `:train`, `:test`, `:train-test` (all) and defaults
   to [[set-default-set-type]] or `:train` if not set"
   [& {:keys [set-type] :or {set-type nil}}]
   (use-connection
@@ -287,7 +288,9 @@
       (when (es/exists?)
         (let [set-type (or set-type @default-set-type)
               {:keys [train-test]} (id-list-data)]
-          (get train-test set-type))))))
+          (if (= set-type :train-test)
+            (apply concat (vals train-test))
+            (get train-test set-type)))))))

 (defn instances
   "Return all instance data based on the *dataset split* (see class docs).


actually remove backends

actually remove backends

--- src/merlion/core.clj
+++ src/merlion/core.clj
@@ -272,8 +272,8 @@
   (let [existing (keys backends)
         wanted (keys (:backends config))
         unwanted (set/difference (set existing) (set wanted))]
-    (run! close! (map #(:chan (get backends %)) unwanted))
     (debug ["unwanted " unwanted])
+    (run! #(async/put! % :quit) (map #(:chan (get backends %)) unwanted))
     (reduce (fn [m [n v]]
               (let [a (parse-address (:listen-address v))]
                 (assoc m


Reformat day8.re-frame-10x.view.fx ns

Reformat day8.re-frame-10x.view.fx ns

--- src/day8/re_frame_10x/view/fx.cljs
+++ src/day8/re_frame_10x/view/fx.cljs
@@ -32,7 +32,7 @@
      [:.code-fragment__result
       {:visibility "visible"}]]
     [:.code-fragment__button
-     {:display "none"
+     {:display      "none"
       :padding-left "6px"
       :margin-left  "6px"
       :border-left  "1px solid #cdd8df"
@@ -40,8 +40,8 @@
       :color        common/blue-modern-color}]
     [:&:hover
      [:.code-fragment__button
-      {:display "grid"}]]
-    ]])
+      {:display "grid"}]]]])
+

 ;; Terminology:
 ;; Form: a single Clojure form (may have nested children)
@@ -54,8 +54,8 @@
    :class "event-section"
    :children
    [[rc/h-box
-     :class    "event-section--header app-db-path--header"
-     :align    :center
+     :class "event-section--header app-db-path--header"
+     :align :center
      :children [[:h2 title]]]
     [components/simple-render data [title] "event-section--data app-db-path--pod-border"]]])


Highlight lines on hover

Highlight lines on hover

--- src/gigrig/components/diagram.cljs
+++ src/gigrig/components/diagram.cljs
@@ -3,16 +3,22 @@
             [gigrig.components.boxes :as boxes]
             [gigrig.geometry.line :as line]
             [gigrig.zipper :as gzip]
+            [reagent.core :as reagent]
             [clojure.zip :as zip :refer [children]]))

 (declare tree)

 (defn- lines
   "Renders an svg group of lines for each line in lines."
-  [lines]
-  [:g {:stroke "black"
-       :stroke-linecap "round"}
-   (for [l lines] ^{:key (line/react-key l)} [:line l])])
+  []
+  (let [highlight (reagent/atom false)]
+    (fn [lines]
+      [:g {:stroke (if @highlight "gold" "black")
+           :stroke-linecap "round"}
+       (for [l lines] ^{:key (line/react-key l)} [:line (merge
+                                                         {:on-mouse-enter #(reset! highlight true)
+                                                          :on-mouse-leave #(reset! highlight false)}
+                                                         l)])])))

 (defn- node
   "Renders the node. If it's a branch, it recursively render a new


:use -> :require/:refer

:use -> :require/:refer

--- src/leiningen/ancient/projects.clj
+++ src/leiningen/ancient/projects.clj
@@ -1,9 +1,9 @@
 (ns ^{:doc "Project Map Inspection for lein-ancient"
       :author "Yannick Scherer"}
   leiningen.ancient.projects
-  (:use [leiningen.ancient.version :only [version-map]]
-        [leiningen.ancient.maven-metadata :only [metadata-retriever]])
-  (:require [leiningen.core.project :as project :only [defaults]]))
+  (:require [leiningen.ancient.version :refer [version-map]]
+            [leiningen.ancient.maven-metadata :refer [metadata-retriever]]
+            [leiningen.core.project :as project :only [defaults]]))

 (defn collect-metadata-retrievers
   "Get Retriever Functions from Project."


more tests for chomp

more tests for chomp

--- test/str/core_test.clj
+++ test/str/core_test.clj
@@ -35,6 +35,16 @@
 (defspec chomp-removes-carriage-return-line-feed 100
   (prop/for-all [s gen/string]
     (= (.length (str/chomp (str s "\r\n"))) (.length s))))
+
+(deftest chomp
+  (are [expected actual] (= expected actual)
+    "" (str/chomp "" "")
+    "" (str/chomp "foo" "foo")
+    "foo"(str/chomp "foobar" "bar")
+    "foo" (str/chomp "foo\n")
+    "foo" (str/chomp "foo\r")
+    "foo" (str/chomp "foo\r\n")
+    "foo\n" (str/chomp "foo\n\r")))

 (defspec ends-with?-acts-like-endsWith 100
   (prop/for-all [s gen/string


Serving depending on the host

Serving depending on the host

--- zambuko-back/src/zambuko_back/routes/default.clj
+++ zambuko-back/src/zambuko_back/routes/default.clj
@@ -1,10 +1,27 @@
 (ns zambuko-back.routes.default
-  (:require [compojure.response :as response]))
+  (:require [compojure.response :as response]
+            [ring.middleware.file-info :as f]
+            [ring.middleware.content-type :as c]
+            [ring.middleware.head :as h]
+            [ring.util.response :as r]
+            [org.jclouds.blobstore2 :as bs]
+            [zambuko-back.data.sites :as sites]))

 (defn resources [db bstore]
   (fn [request]
-    (let [host (get-in request [:headers "host"] "default")]
-      (println host)
-      (response/render "Hola" request))))
+    (let [host (get-in request [:headers "host"] "default")
+          uri  (get request :uri)
+          site (sites/site @db host)
+          site-id (:_id site "default")
+          full-path (str site-id uri)
+          stream (and (bs/blob-exists? @bstore "sites" full-path)
+                      (bs/get-blob-stream @bstore "sites" full-path))]
+      (if stream
+        (let [stream-fn (-> stream
+                            (r/response)
+                            (constantly)
+                            (c/wrap-content-type)
+                            (f/wrap-file-info)
+                            (h/wrap-head))]
+          (stream-fn request))))))

-


CMR-2283: Removed capture-all

CMR-2283: Removed capture-all

--- ingest-app/src/cmr/ingest/services/business_rule_validation.clj
+++ ingest-app/src/cmr/ingest/services/business_rule_validation.clj
@@ -22,7 +22,6 @@
   "Validates the concept delete-time.
   Returns error if the delete time exists and is before one minute from the current time."
   [_ concept]
-  (cmr.common.dev.capture-reveal/capture-all)
   (let [delete-time (get-in concept [:extra-fields :delete-time])]
     (when (some-> delete-time
                   p/parse-datetime


change round time to 5 minutes

change round time to 5 minutes

--- src/server/core.cljs
+++ src/server/core.cljs
@@ -110,7 +110,7 @@

     ; Emit a message for every second left until game over.
     (if (= mode :time)
-      (loop [s 60]
+      (loop [s (* 5 60)]

         (util/js-log "time left:" s)


Change power-bar position

Change power-bar position

--- src/obb_demo/views/many_games.cljs
+++ src/obb_demo/views/many_games.cljs
@@ -32,5 +32,5 @@
       [:div.col-lg-12
        (for [game-data datas]
         [:div.col-lg-4 {:key (rand-int 10000)}
-         [boardground/render {} game-data]
-         (power-bar/render (:game game-data))])]]))
+         (power-bar/render (:game game-data))
+         [boardground/render {} game-data]])]]))


In progress commit

In progress commit

--- src/shokunin/cmr.clj
+++ src/shokunin/cmr.clj
@@ -1,28 +1,51 @@
 (ns shokunin.cmr
   (:require [clj-http.client :as client]
-            [clojure.data.json :as json]))
+            [clojure.data.json :as json]
+            [clojure.string :as string]))

-(defn search [url opts]
+(defn search [url params]
   (let [defaults {:accept :json }
-        opts+    (merge-with merge defaults opts)
-        resp     (client/get url opts+)
+        params+  (merge-with merge defaults params)
+        resp     (client/get url params+)
         body     (client/json-decode (resp :body))]
     body))

-(-> (search url opts) (get-in ["feed" "entry"] first))
+(defn hits
+  ""
+  [url params]
+  (let [response (client/head url params)
+        cmr-hits (get-in response [:headers "CMR-hits"])]
+    (or (Integer/parseInt cmr-hits) 0)))

-(defn http-seq [url opts]
-  (let [entries (-> (search url opts) (get-in ["feed" "entry"]))]
-    ; the last item in the seq should somehow invoke
-    ; a subsequent call to get more items if more
-    ; results exist. however, the search function only
-    ; returns a body... there is no information about
-    ; where in the result list we actually are. hmm.
-    entries))
+(defn search
+  ""
+  [url params]
+  (let [defaults {:accept :json }
+        params+  (merge-with merge defaults params)
+        resp     (client/get url params+)
+        body     (client/json-decode (resp :body))]
+    body))

-(comment
-  ; an example
-  (def opts { :query-params {:short-name "MOD09A1" :page-num 1 :page-size 5}})
-  (def url "https://cmr.earthdata.nasa.gov/search/granules")
-  (def s (http-seq url opts))
-  (count s))
+(defn http-seq
+  ""
+  ;; this doesn't *set* defaults in the map... careful.
+  ([url {{:keys [page-num page-size]} :query-params
+          :or {page-num 1 page-size 10}
+          :as params}]
+     (let [last-page (int (Math/ceil (/ (hits url params) page-size)))
+           opts {:last-page last-page}]
+       (http-seq url params opts)))
+  ([url {{:keys [page-num page-size]} :query-params :as params}
+        {:keys [last-page] :as opts}]
+       (let [entries     (get-in (search url params) ["feed" "entries"])
+             next-params (update-in params [:query-params :page-num] inc)]
+         (<= page-num last-page)
+         (concat entries (lazy-seq (http-seq url next-params opts))))))
+
+; an example
+(def params { :query-params {:short-name "MOD09A1" :page-num 1 :page-size 10}})
+(def opts {:last-page 10})
+(def url "https://cmr.earthdata.nasa.gov/search/granules")
+(def result (http-seq url params opts))
+(map #(get % "title") (take 2 result))
+


text to scroll and font preloader channel render!

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -58,6 +58,26 @@
                                     "DUMMY"
                                     :weight 100
                                     :fill "#ffffff"))
+(defonce test-text (font/make-text "100 24px Indie Flower"
+                                    "-=retrogradeorbit=-\n"
+                                    :weight 100
+                                    :fill "#ff00ff"))
+(defonce scroll-text
+  (font/make-text "100 24px Indie Flower"
+                  ". .. ... This will eventually be the index page for my game jam submissions. \"Alien Forest Explorer\" from Global Game Jam, and \"Marty Funk\" and \"Monster Simulator?\" from ludum dare competitions. These HTML5 games were all developed with free and open source software on a linux platform. I use pixi.js as the underlying framework but target it through infinitelives.pixi using clojurescript. If you haven't tried clojure or clojurescript you should definitely try them. This of course wouldn't have been possible without the work of so many other people. Those involved in the creation of clojure and clojurescript, in pixi.js and in the many tools I use, like grafx2, impulse tracker and sfxr. Best wishes to everyone out there and enjoy! ...  .. .\n")
+
+)
+
+(defonce render! (go
+                   (<! (events/wait-time 1500))
+                   (sprite/set-pos! dummy-text -100000 -10000)
+                   (sprite/set-pos! test-text 0 0)
+                   (.addChild (-> canvas :layer :ui) dummy-text)
+                   (<! (events/next-frame))
+                   (.removeChild (-> canvas :layer :ui) dummy-text)
+                   (<! (events/next-frame))))
+
+
 (defn main []
   (go
     (<! (resources/load-resources


Fix error messages being swallowed causing timeouts

--- src/refactor_nrepl/ns/clean_ns.clj
+++ src/refactor_nrepl/ns/clean_ns.clj
@@ -60,9 +60,12 @@
     (let [ns (some-> path clean-ns pprint-ns)]
       (transport/send transport (response-for msg :ns ns :status :done)))
     (catch IllegalArgumentException e
-      (response-for msg :error (.getMessage e) :status :done))
+      (transport/send
+       transport (response-for msg :error (.getMessage e) :status :done)))
     (catch IllegalStateException e
-      (response-for msg :error (.getMessage e) :status :done))
+      (transport/send
+       transport
+       (response-for msg :error (.getMessage e) :status :done)))
     (catch Exception e
       (transport/send transport
                       (response-for msg (err-info e :clean-ns-error))))))


Fix some indenting.

Fix some indenting.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -30,8 +30,8 @@
                               (map #(entry-rep/render-entry-for-collection org-slug slug
                                       (get selected-entries %) (:access-level ctx))
                                 topic-slugs))
-                                 archived-entries (clojure.set/difference (set (keys entries)) (set topic-slugs))
-                                 archived (map #(identity {:slug % :title (:title (get entries %))}) archived-entries)
+                                archived-entries (clojure.set/difference (set (keys entries)) (set topic-slugs))
+                                archived (map #(identity {:slug % :title (:title (get entries %))}) archived-entries)
         authors (:authors board)
         author-reps (map #(board-rep/render-author-for-collection org-slug slug %) authors)
         viewers (:viewers board)


[Fixes #6665] Wrap view child elements when needed

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/extensions/core.cljs
+++ src/status_im/extensions/core.cljs
@@ -172,11 +172,6 @@
     :on-press #(re-frame/dispatch [:browser.ui/message-link-pressed uri])}
    uri])

-(defn text [o & children]
-  (if (map? o)
-    [react/text o children]
-    (into [react/text {} o] children)))
-
 (defn list [{:keys [data item-view]}]
   [list/flat-list {:data data :key-fn (fn [_ i] (str i)) :render-fn item-view}])

@@ -186,8 +181,21 @@
                        :style           {:padding 0}
                        :on-value-change #(re-frame/dispatch (on-change {:value %}))}]])

+(defn text [o & children]
+  (if (map? o)
+    [react/text o children]
+    (into [react/text {} o] children)))
+
+(defn- wrap-view-child [child]
+  (if (vector? child) child [text {} child]))
+
+(defn view [o & children]
+  (if (map? o)
+    [react/view o (map wrap-view-child children)]
+    (into [react/view {} (wrap-view-child o)] (map wrap-view-child children))))
+
 (def capacities
-  {:components {'view               {:value react/view}
+  {:components {'view               {:value view}
                 'text               {:value text}
                 'touchable-opacity  {:value touchable-opacity :properties {:on-press :event}}
                 'image              {:value image :properties {:uri :string}}


Fix incorrect message

Fix incorrect message

--- src/time_tracker/timers/pubsub.clj
+++ src/time_tracker/timers/pubsub.clj
@@ -103,7 +103,7 @@
         (timers.db/start! connection timer-id started-time)]
     (broadcast-to! google-id
                    {:type         :create
-                    :timer-id     timer-id
+                    :id           timer-id
                     :project-id   project-id
                     :started-time started-time
                     :duration     duration})))


Remove comment.

Remove comment.

--- src/uxbox/ui/dashboard/colors.cljs
+++ src/uxbox/ui/dashboard/colors.cljs
@@ -160,7 +160,6 @@
 ;; Lightbox
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-;; TODO: implement proper form validation
 (def ^:static +color-form-schema+
   {:hex [sc/required sc/color]})


change label and shortcut to main interactions

--- src/uxbox/ui/workspace/header.cljs
+++ src/uxbox/ui/workspace/header.cljs
@@ -36,13 +36,13 @@
        [:span (:name page)]]
       [:div.workspace-options
        [:ul.options-btn
-        [:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
+        [:li.tooltip.tooltip-bottom {:alt "Shapes (Ctrl + Shift + S)"}
          i/shapes]
-        [:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
+        [:li.tooltip.tooltip-bottom {:alt "Elements (Ctrl + Shift + E)"}
          i/puzzle]
-        [:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
+        [:li.tooltip.tooltip-bottom {:alt "Icons (Ctrl + Shift + I)"}
          i/icon-set]
-        [:li.tooltip.tooltip-bottom {:alt "Redo (Ctrl + Shift + Z)"}
+        [:li.tooltip.tooltip-bottom {:alt "Layers (Ctrl + Shift + L)"}
          i/layers]]
        [:ul.options-btn
         [:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}


make dispatch-command a pure function

make dispatch-command a pure function

--- cljs/sledge/core.cljs
+++ cljs/sledge/core.cljs
@@ -489,25 +489,26 @@
         (om/build audio-el (:audio-el (:player state)))
         ]))))

-(defmulti dispatch-command (fn  [command & args] command))
-
-(defmethod dispatch-command :enqueue [_ track]
-  (swap! app-state #(update-in % [:player :queue] enqueue-track track)))
-
-(defmethod dispatch-command :toggle-pause [_]
-  (swap! app-state #(update-in % [:player :want-play] not)))
-
-(defmethod dispatch-command :next-track [_]
-  (swap! app-state #(update-in % [:player :queue] advance-queue)))
+(defmulti dispatch-command (fn  [val command & args] command))
+
+(defmethod dispatch-command :enqueue [val _ track]
+  (update-in val [:player :queue] enqueue-track track))
+
+(defmethod dispatch-command :toggle-pause [val _]
+  (update-in val [:player :want-play] not))
+
+(defmethod dispatch-command :next-track [val _]
+  (update-in val [:player :queue] advance-queue))

 ;; still to add: [dequeue previous-track delete-queue]
+

 (defn command-loop []
   (let [ch (chan)]
     (go
       (loop []
         (let [command (<! ch)]
-          (apply dispatch-command command)
+          (swap! app-state #(apply dispatch-command % command))
           (recur))))
     ch))


Upgrade Mockito to a recent version.

Upgrade Mockito to a recent version.

--- clstreams/project.clj
+++ clstreams/project.clj
@@ -30,7 +30,7 @@
                              [org.apache.kafka/kafka-clients "0.11.0.0" :classifier "test"]
                              [org.clojure/java.classpath "0.2.3"]
                              [org.clojure/tools.namespace "0.3.0-alpha3"]
-                             [org.mockito/mockito-core "1.10.19"]]
+                             [org.mockito/mockito-core "2.11.0"]]
               :main ^:skip-aot user}

              :uberjar


Fix flaky test (#1154)

Fix flaky test (#1154)

Close https://github.com/advthreat/iroh/issues/5863

Would be cleaner to use a time service, but we don't have one.

[§](#qa) QA
============================

No QA is needed.

[§](#release-notes) Release Notes
=============================================================

```
intern: Fix flaky test
```

[§](#squashed-commits) Squashed Commits
======================================================================

--- test/ctia/domain/entities_test.clj
+++ test/ctia/domain/entities_test.clj
@@ -36,7 +36,7 @@
       (is (= (:modified realized-create)
              (:created realized-create)
              (:timestamp realized-create))))
-
+    (Thread/sleep 1) ;; allow time to pass so :modified != :created below
     (testing "realized fn with a previous object shall preserve previous stored field and update modified"
       (let [new-sighting-maximal (assoc (dissoc sighting-maximal :id)
                                         :source "update")


recycle byte buffers in acquire-and-write-parallel

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

--- acqEngine/src/org/micromanager/test/saving.clj
+++ acqEngine/src/org/micromanager/test/saving.clj
@@ -6,42 +6,6 @@
            (java.nio.channels FileChannel$MapMode))
   (:require [org.micromanager.mm :as mm])
   (:use [org.micromanager.mm :only (core)]))
-
-;; bucket brigade
-
-(defn bucket-node [input-queue function output-queue]
-  (future
-    (loop []
-      (let [item (.take input-queue)]
-        (if (= item input-queue)
-          (.put output-queue output-queue)
-          (do (.put output-queue (function item))
-              (recur)))))))
-
-(defn first-node [n function output-queue]
-  (future
-    (dotimes [i n]
-      (.put output-queue (function)))
-    (.put output-queue output-queue)))
-
-(defn last-node [input-queue function]
-  (loop []
-    (let [item (.take input-queue)]
-      (when (not= item input-queue)
-        (function item)
-        (recur)))))
-
-
-(defn bucket-brigade [n & functions]
-  (let [first-queue (LinkedBlockingQueue.)
-        first-node (first-node n (first functions) first-queue)]
-    (loop [remaining-functions (rest functions) input-queue first-queue]
-      (let [f (first remaining-functions)]
-        (if-let [n (next remaining-functions)]
-          (let [output-queue (LinkedBlockingQueue.)]
-            (bucket-node input-queue f output-queue)
-            (recur n output-queue))
-          (last-node input-queue f))))))

 (defn queuify
   "Runs zero-arg function n times on another thread. Returns
@@ -89,6 +53,8 @@
   (.. ByteBuffer (allocateDirect size-bytes)
       (order (ByteOrder/nativeOrder))))

+(def byte-buffer-memo (memoize byte-buffer))
+
 (defn image-to-byte-buffer
   "Store 16-bit image pixel array data in a
    pre-existing byte buffer instance."
@@ -112,9 +78,8 @@
 (def corePop-memo (memoize #(core popNextImage)))

 (defn acquire-and-write-to-disk [num-images]
-  (let [filename (str "E:/acquisition/deleteMe" (rand-int 100000) ".dat")]
-    (println filename)
-    ;(run-sequence-acquisition num-images false)
+  (let [filename (str "D:/AcquisitionData/deleteMe" (rand-int 100000) ".dat")]
+    (println "\nto disk:" filename)
     (with-open [file (RandomAccessFile. filename "rw")]
                (time (let [channel (.getChannel file)
                            image-queue (queuify num-images 5 #(core getImage))
@@ -125,46 +90,44 @@
                        (dotimes [_ num-images]
                          (write-buf channel (.take filled-buffer-queue))))))))

+
+(defn write-test [num-images]
+  (let [filename (str "D:/AcquisitionData/deleteMe" (rand-int 100000) ".dat")
+        buf (image-to-byte-buffer (core getImage) (byte-buffer (* 2 n)))]
+    (println "\nparallel:" filename)
+    (with-open [file (RandomAccessFile. filename "rw")]
+               (time (let [channel (.getChannel file)]
+                       (dotimes [_ num-images]
+                         (write-buf channel buf)))))))
+
 (defn acquire-and-write-parallel [num-images]
-  (let [filename (str "E:/acquisition/deleteMe" (rand-int 100000) ".dat")]
-    (println filename)
-    ;(run-sequence-acquisition num-images false)
+  (let [filename (str "D:/AcquisitionData/deleteMe" (rand-int 100000) ".dat")]
+    (println "\nparallel:" filename)
     (with-open [file (RandomAccessFile. filename "rw")]
                (time (let [channel (.getChannel file)
+                           n (count (core getImage))
                            image-queue (queuify num-images 5 #(core getImage))
-                           empty-buffer-queue (queuify num-images 5 #(byte-buffer (* 2 n)))
+                           empty-buffer-queue (queuify 10 10 #(byte-buffer (* 2 n)))
                            filled-buffer-queue (queuify num-images 5 #(image-to-byte-buffer
                                                                         (.take image-queue)
                                                                         (.take empty-buffer-queue)))
                            ]
                        ;(println image-queue empty-buffer-queue filled-buffer-queue)
                        (dotimes [_ num-images]
-                         (write-buf channel (.take filled-buffer-queue))))))))
+                         (let [buf (.take filled-buffer-queue)]
+                           (write-buf channel buf)
+                           (.offer empty-buffer-queue buf))))))))

 ;; other tests
-
-(defn test-write [num-images]
-  (let [buffer (byte-buffer (* 2560 2160 2))
-        filename (str "D:/AcquisitionData/test" (rand-int 100000) ".dat")
-        file (RandomAccessFile. filename "rw")
-        channel (.getChannel file)]
-    (println filename)
-    (try
-      (dotimes [i num-images]; 100
-                     (.rewind buffer)
-        (.write channel buffer))
-      (catch Exception e (println e))
-      (finally
-        (.close file)))))

 (defn monitor-circular-buffer []
   (while (not (core isSequenceRunning))
     (Thread/sleep 100))
   (while (core isSequenceRunning)
     (println (core getRemainingImageCount))
-    (Thread/sleep 250)))
+    (Thread/sleep 1000)))

 (defn drain-queue [blocking-queue]
   (future (loop [i 0]


config project

config project

--- logging-macro-demo/project.clj
+++ logging-macro-demo/project.clj
@@ -1,9 +1,7 @@
 (defproject logging-macro-demo "0.1.0-SNAPSHOT"
-  :description "FIXME: write description"
-  :url "http://example.com/FIXME"
-  :license {:name "Eclipse Public License"
-            :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.8.0"]]
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [org.clojure/math.numeric-tower "0.0.4"]
+                 [clojurewerkz/money "1.9.0"]]
   :main ^:skip-aot logging-macro-demo.core
   :target-path "target/%s"
   :profiles {:uberjar {:aot :all}})


Move $ga-script-tag above usage

Move $ga-script-tag above usage

--- src/clj/clojuredocs/site/common.clj
+++ src/clj/clojuredocs/site/common.clj
@@ -8,6 +8,16 @@
 (def gh-auth-url (gh/auth-redirect-url
                    (merge config/gh-creds
                           {:redirect-uri (config/url "/gh-callback")})))
+
+(defn $ga-script-tag [ga-tracking-id]
+  (when ga-tracking-id
+    [:script "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', '" ga-tracking-id "', 'auto');
+  ga('send', 'pageview');"]))

 (defn $user-area [user]
   [:li.user-area
@@ -195,13 +205,3 @@
        [:h1 "404"]
        [:a.four-oh-four {:href "http://emareaf.deviantart.com/art/Rich-Hickey-321501046"}
         [:img.four-oh-four {:src "http://fc04.deviantart.net/fs70/f/2012/229/a/6/rich_hickey_by_emareaf-d5bevsm.png"}]]]]}))
-
-(defn $ga-script-tag [ga-tracking-id]
-  (when ga-tracking-id
-    [:script "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-  ga('create', '" ga-tracking-id "', 'auto');
-  ga('send', 'pageview');"]))


BIG commit, updating forma.clj to reflect the most recent code that works _all the way through_.

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -1,45 +1,75 @@
 (ns forma.hadoop.jobs.forma
-  (:use cascalog.api)
+  (:use cascalog.api
+        [forma.hadoop.pail :only (split-chunk-tap)])
   (:require [cascalog.ops :as c]
             [forma.matrix.walk :as w]
             [forma.reproject :as r]
             [forma.date-time :as date]
             [forma.schema :as schema]
+            [forma.thrift :as thrift]
             [forma.hadoop.predicate :as p]
             [forma.trends.analysis :as a]
             [forma.ops.classify :as log]
             [forma.trends.filter :as f]))

-;; We're mapping across two sequences at the end, there; the
-;; long-series and the t-stat-series.
-
-(def get-loc
-  (<- [?chunk :> ?s-res ?mod-h ?mod-v ?sample ?line ?val]
-      (schema/extract-location ?chunk :> ?loc)
-      (schema/extract-chunk-value ?chunk :> ?val)
-      (schema/unpack-pixel-location ?loc :> ?s-res ?mod-h ?mod-v ?sample ?line)))
+(defn consolidate-static
+  "Due to an issue with Pail, we consolidate separate sequence files
+   of static data with one big join"
+  [vcf-limit vcf-src gadm-src hansen-src ecoid-src border-src]
+  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?vcf ?gadm ?ecoid ?hansen ?coast-dist]
+      (vcf-src    ?s-res ?mod-h ?mod-v ?sample ?line ?vcf)
+      (hansen-src ?s-res ?mod-h ?mod-v ?sample ?line ?hansen)
+      (ecoid-src  ?s-res ?mod-h ?mod-v ?sample ?line ?ecoid)
+      (gadm-src   ?s-res ?mod-h ?mod-v ?sample ?line ?gadm)
+      (border-src ?s-res ?mod-h ?mod-v ?sample ?line ?coast-dist)
+      (>= ?vcf vcf-limit)))
+
+(defn within-tileset?
+  [tile-set h v]
+  (let [tile [h v]]
+    (contains? tile-set tile)))
+
+(defn screen-by-tileset
+  [src tile-set]
+  (<- [?pail-path ?pixel-chunk]
+      (src ?pail-path ?pixel-chunk)
+      (thrift/unpack ?pixel-chunk :> _ ?pixel-loc _ _ _)
+      (thrift/unpack ?pixel-loc :> _ ?h ?v _ _)
+      (within-tileset? tile-set ?h ?v)))

 (defn fire-tap
   "Accepts an est-map and a query source of fire timeseries. Note that
   this won't work, pulling directly from the pail!"
   [est-map fire-src]
-  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?fire-series]
-      (fire-src ?chunk)
-      (get-loc ?chunk :> ?s-res ?mod-h ?mod-v ?sample ?line ?f-series)
-      (schema/adjust-fires est-map ?f-series :> ?fire-series)
-      (:distinct true)))
+  (<- [?s-res ?h ?v ?sample ?line ?adjusted-ts]
+      (fire-src ?pixel-chunk)
+      (thrift/unpack ?pixel-chunk :> _ ?pixel-loc ?ts _ _)
+      (thrift/unpack ?pixel-loc :> ?s-res ?h ?v ?sample ?line)
+      (schema/adjust-fires est-map ?ts :> ?adjusted-ts)))
+
+(defn ts-unpacking
+  [ts-src]
+  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start-idx ?series]
+      (ts-src _ ?ts-chunk)
+      ;; unpack ts object
+      (thrift/unpack ?ts-chunk :> _ ?ts-loc ?ts-data _ _)
+      (thrift/unpack ?ts-data :> ?start-idx _ ?ts-array)
+      (thrift/unpack* ?ts-array :> ?series)
+      (thrift/unpack ?ts-loc :> ?s-res ?mod-h ?mod-v ?sample ?line)))

 (defn filter-query
-  "Note that the ?ts here is an ArrayList of one of the items inside
-  of ArrayValue."
   [vcf-src vcf-limit chunk-src]
-  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start ?vals]
+  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start-idx ?series]
       (chunk-src _ ?ts-chunk)
-      (vcf-src _ ?vcf-chunk)
-      (get-loc ?ts-chunk :> ?s-res ?mod-h ?mod-v ?sample ?line ?series)
-      (schema/unpack-timeseries ?series :> ?start _ ?ts)
-      (schema/get-vals-wrap ?ts :> ?vals)
-      (p/blossom-chunk ?vcf-chunk :> ?s-res ?mod-h ?mod-v ?sample ?line ?vcf)
+      (vcf-src ?s-res ?mod-h ?mod-v ?sample ?line ?vcf)
+
+      ;; unpack ts object
+       (thrift/unpack ?ts-chunk :> _ ?ts-loc ?ts-data _ _)
+       (thrift/unpack ?ts-data :> ?start-idx _ ?ts-array)
+       (thrift/unpack* ?ts-array :> ?series)
+       (thrift/unpack ?ts-loc :> ?s-res ?mod-h ?mod-v ?sample ?line)
+
+      ;; filter on vcf-limit
       (>= ?vcf vcf-limit)))

 (defn dynamic-filter
@@ -55,9 +85,9 @@
                      :> ?start-idx ?precl-ts ?ndvi-ts ?reli-ts)))

 (defmapcatop tele-clean
-  "Return clean timeseries with telescoping window, nil if no (or not enough) good training data"
-  [{:keys [est-start est-end t-res]}
-   good-set bad-set start-period val-ts reli-ts]
+  "Return clean timeseries with telescoping window, nil if no (or not
+  enough) good training data"
+  [{:keys [est-start est-end t-res]} good-set bad-set start-period val-ts reli-ts]
   (let [reli-thresh 0.1
         freq (date/res->period-count t-res)
         [start-idx end-idx] (date/relative-period t-res start-period
@@ -66,10 +96,18 @@
         training-reli-set (set training-reli)
         clean-fn (comp vector (partial f/make-clean freq good-set bad-set))]
     (if (f/reliable? good-set reli-thresh training-reli)
-      (map clean-fn
-           (f/tele-ts start-idx end-idx val-ts)
-           (f/tele-ts start-idx end-idx reli-ts))
+      (vec (map vector (f/tele-ts start-idx end-idx val-ts)))
+      ;;  (map clean-fn
+      ;;     (f/tele-ts start-idx end-idx val-ts)
+      ;;     (f/tele-ts start-idx end-idx reli-ts)
       [[nil]])))
+
+(defmapcatop telescope-ts
+  [{:keys [est-start est-end t-res]}
+   start-period val-ts]
+  (let [[start-idx end-idx] (date/relative-period t-res start-period
+                                                  [est-start est-end])]
+    (vec (map (comp vector vec) (f/tele-ts start-idx end-idx val-ts)))))

 (defn dynamic-clean
   "Accepts an est-map, and sources for ndvi and rain timeseries and
@@ -79,11 +117,15 @@
   occur before the analysis. Note that all variable names within this
   query are TIMESERIES, not individual values."
   [est-map dynamic-src]
-  (let [good-set #{0 1}
-        bad-set #{2 3 255}]
-    (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start ?clean-ndvi]
-        (dynamic-src ?s-res ?mod-h ?mod-v ?sample ?line ?start ?ndvi _ ?reli)
-        (tele-clean est-map good-set bad-set ?start ?ndvi ?reli :> ?clean-ndvi))))
+  (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start ?tele-ndvi ?precl]
+      (dynamic-src ?s-res ?mod-h ?mod-v ?sample ?line ?start ?ndvi ?precl _)
+      (telescope-ts est-map ?start ?ndvi :> ?tele-ndvi)
+      (:distinct false)))
+
+(defmapop series-end
+  [series start]
+  (let [length (count series)]
+    (dec (+ start length))))

 (defn analyze-trends
   "Accepts an est-map, and sources for ndvi and rain timeseries and
@@ -92,35 +134,82 @@
   We break this apart from dynamic-filter to force the filtering to
   occur before the analysis. Note that all variable names within this
   query are TIMESERIES, not individual values."
-  [est-map clean-src rain-src]
+  [est-map clean-src]
   (let [long-block (:long-block est-map)
         short-block (:window est-map)]
-    (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start ?short ?long ?t-stat ?break]
-        (rain-src ?s-res ?mod-h ?mod-v ?sample ?line ?start _ ?precl _)
+    (<- [?s-res ?mod-h ?mod-v ?sample ?line ?start ?end ?short ?long ?t-stat ?break]
+        (clean-src ?s-res ?mod-h ?mod-v ?sample ?line ?start ?ndvi ?precl)
         (f/shorten-ts ?ndvi ?precl :> ?short-precl)
-        (clean-src ?s-res ?mod-h ?mod-v ?sample ?line ?start ?ndvi)
         (a/short-stat long-block short-block ?ndvi :> ?short)
         (a/long-stats ?ndvi ?short-precl :> ?long ?t-stat)
-        (a/hansen-stat ?ndvi :> ?break))))
+        (a/hansen-stat ?ndvi :> ?break)
+        (series-end ?ndvi ?start :> ?end)
+        (:distinct false))))
+
+(defn count-series
+  [series]
+  (count (first series)))
+
+(defbufferop consolidator
+  [tuples]
+  [[[(vec (map first tuples))]
+    [(vec (map #(nth % 1) (sort-by first tuples)))]
+    [(vec (map #(nth % 2) (sort-by first tuples)))]
+    [(vec (map #(nth % 3) (sort-by first tuples)))]
+    [(vec (map #(nth % 4) (sort-by first tuples)))]]])
+
+(defn get-max-period
+  [series]
+  (reduce max (first series)))
+
+(defn consolidate-trends
+  [trends-src]
+  (<- [?s-res ?mh ?mv ?s ?l ?start ?end-seq ?short-ts ?long-ts ?t-stat-ts ?break-ts]
+      (trends-src ?s-res ?mh ?mv ?s ?l ?start ?end ?short ?long ?t-stat ?break)
+      (consolidator ?end ?short ?long ?t-stat ?break :> ?end-seq ?short-ts ?long-ts ?t-stat-ts ?break-ts)))
+
+(defn unnest-series
+  "Remove extraneous vectors from around a series"
+  [series]
+  (vec (flatten series)))
+
+(defn unnest-all
+  "Unnest series coming out of trends-cleanup of form
+   [[\"500\" 28 8 0 0 693 694 [[0.1 0.1]] [[0.2 0.2]] [[0.3 0.3]] [[0.4 0.4]]]]"
+  [& series]
+  (map unnest-series series))
+
+(defn trends-cleanup
+  [trends-src]
+  (let [consolidated-tap (consolidate-trends trends-src)]
+    (<- [?s-res ?mh ?mv ?s ?l ?start ?end ?short-v ?long-v ?t-stat-v ?break-v]
+        (consolidated-tap ?s-res ?mh ?mv ?s ?l ?start ?end-seq ?short ?long ?t-stat ?break)
+        (unnest-all ?short ?long ?t-stat ?break :> ?short-v ?long-v ?t-stat-v ?break-v)
+        (get-max-period ?end-seq :> ?end))))

 (defn forma-tap
-  "Accepts an est-map and sources for ndvi, rain, and fire timeseries,
-  plus a source of static vcf pixels.
-
-  Note that all values internally discuss timeseries."
-  [dynamic-src fire-src]
-  (<- [?s-res ?period ?mh ?mv ?s ?l ?forma-val]
-      (fire-src ?s-res ?mh ?mv ?s ?l !!fire)
-      (dynamic-src ?s-res ?mh ?mv ?s ?l ?start ?short ?break ?long ?t-stat)
-      (schema/forma-seq !!fire ?short ?break ?long ?t-stat :> ?forma-seq)
-      (p/index ?forma-seq :zero-index ?start :> ?period ?forma-val)))
+  "Accepts an est-map and sources for
+
+  Note that all values internally discuss timeseries.
+
+  Also note that !!fire is an ungrounding variable, and triggers a
+  left join with the trend result variables."
+  [t-res est-map dynamic-src fire-src]
+  (let [start (date/datetime->period t-res (:est-start est-map))]
+    (<- [?s-res ?period ?mh ?mv ?s ?l ?forma-val]
+        (fire-src ?s-res ?mh ?mv ?s ?l !!fire)
+        (dynamic-src ?s-res ?mh ?mv ?s ?l _ ?end ?short ?long ?t-stat ?break)
+        (schema/forma-seq !!fire ?short ?long ?t-stat ?break :> ?forma-seq)
+        (p/index ?forma-seq :zero-index start :> ?period ?forma-val)
+        (:distinct false))))

 (defmapcatop [process-neighbors [num-neighbors]]
   "Processes all neighbors... Returns the index within the chunk, the
-value, and the aggregate of the neighbors."
+  value, and the aggregate of the neighbors."
   [window]
-  (for [[idx [val neighbors]] (->> (w/neighbor-scan num-neighbors window)
-                                   (map-indexed vector))
+  (for [[idx [val neighbors]]
+        (->> (w/neighbor-scan num-neighbors window)
+             (map-indexed vector))
         :when val]
     [idx val (->> neighbors
                   (apply concat)
@@ -142,18 +231,43 @@
         (process-neighbors [neighbors] ?window :> ?win-idx ?val ?neighbor-val)
         (r/tile-position cols rows ?win-col ?win-row ?win-idx :> ?sample ?line))))

-(defn beta-generator
-  "query to return the beta vector associated with each ecoregion"
-  [{:keys [t-res est-start ridge-const convergence-thresh max-iterations min-coast-dist]}
-   dynamic-src static-src]
+(defn gen-static-sources
+  [pail-path out-dir dataset-str]
+  (let [out-path (str out-dir "/" dataset-str)
+        src (split-chunk-tap pail-path [dataset-str])]
+    (<- [?s-res ?h ?v ?s ?l ?val]
+        (src _ ?x)
+        (thrift/unpack ?x :> _ ?loc ?obj _ _)
+        (thrift/unpack ?loc :> ?s-res ?h ?v ?s ?l)
+        (thrift/get-field-value ?obj :> ?val))))
+
+(defn read-static-sources
+  [seq-dir name-vec]
+  (let [gen-path (fn [name] (str seq-dir "/" name))
+        static-paths (map gen-path name-vec)]
+   (map hfs-seqfile static-paths)))
+
+(defn beta-data-prep
+  "for example, static-path can equal this on dan's local machine:
+   \"/mnt/hgfs/Dropbox/local/static-out\""
+  [{:keys [t-res est-start min-coast-dist]} dynamic-src static-src]
   (let [first-idx (date/datetime->period t-res est-start)]
-    (<- [?s-res ?eco ?beta]
+    (<- [?s-res ?pd ?mod-h ?mod-v ?s ?l ?val ?neighbor-val ?eco ?hansen]
         (dynamic-src ?s-res ?pd ?mod-h ?mod-v ?s ?l ?val ?neighbor-val)
         (static-src ?s-res ?mod-h ?mod-v ?s ?l _ _ ?eco ?hansen ?coast-dist)
         (= ?pd first-idx)
         (>= ?coast-dist min-coast-dist)
+        (:distinct false))))
+
+(defn beta-gen
+  "query to return the beta vector associated with each ecoregion"
+  [{:keys [t-res est-start ridge-const convergence-thresh max-iterations min-coast-dist]} src]
+  (let [first-idx (date/datetime->period t-res est-start)]
+    (<- [?s-res ?eco ?beta]
+        (src ?s-res ?pd ?mod-h ?mod-v ?s ?l ?val ?neighbor-val ?eco ?hansen)
         (log/logistic-beta-wrap [ridge-const convergence-thresh max-iterations]
-                                ?hansen ?val ?neighbor-val :> ?beta))))
+                                ?hansen ?val ?neighbor-val :> ?beta)
+        (:distinct false))))

 (defmapop [apply-betas [betas]]
   [eco val neighbor-val]
@@ -163,48 +277,11 @@
 (defn forma-estimate
   "query to end all queries: estimate the probabilities for each
   period after the training period."
-  [beta-src dynamic-src static-src trap-tap period]
+  [beta-src dynamic-src static-src]
   (let [betas (log/beta-dict beta-src)]
     (<- [?s-res ?mod-h ?mod-v ?s ?l ?prob-series]
         (dynamic-src ?s-res ?pd ?mod-h ?mod-v ?s ?l ?val ?neighbor-val)
         (static-src ?s-res ?mod-h ?mod-v ?s ?l _ _ ?eco _ _)
         (apply-betas [betas] ?eco ?val ?neighbor-val :> ?prob)
         (log/mk-timeseries ?pd ?prob :> ?prob-series)
-        (:trap trap-tap))))
-
-(comment
-  (let [m {:est-start "2005-12-31"
-           :est-end "2010-01-17"
-           :s-res "500"
-           :t-res "16"
-           :neighbors 1
-           :window-dims [600 600]
-           :vcf-limit 25
-           :long-block 30
-           :window 10
-           :ridge-const 1e-8
-           :convergence-thresh 1e-10
-           :max-iterations 500}
-        ndvi-src [[1 (schema/chunk-value
-                      "ndvi" "32" nil
-                      (schema/pixel-location "500" 8 6 0 0)
-                      (schema/timeseries-value 693 (concat ndvi ndvi)))]]
-        reli-src [[1 (schema/chunk-value
-                      "reli" "32" nil
-                      (schema/pixel-location "500" 8 6 0 0)
-                      (schema/timeseries-value 693 (concat reli reli)))]]
-        rain-src [[2 (schema/chunk-value
-                      "precl" "32" nil
-                      (schema/pixel-location "500" 8 6 0 0)
-                      (schema/timeseries-value 693 (concat rain-raw rain-raw)))]]
-        vcf-src  [[3 (schema/chunk-value
-                      "vcf" "00" nil
-                      (schema/chunk-location "500" 8 6 0 24000)
-                      (into [] (repeat 156 30)))]]
-        fire-src [[(schema/chunk-value
-                    "precl" "32" nil
-                    (schema/pixel-location "500" 8 6 0 0)
-                    (schema/timeseries-value
-                     693 (repeat 312 (schema/fire-value
-                                      1 1 1 1))))]]]
-    (??- (forma-tap m ndvi-src reli-src rain-src vcf-src fire-src))))
+        (:distinct false))))


cleaned up comments

cleaned up comments

--- src/clj/onyx_java/utils/map_fns.clj
+++ src/clj/onyx_java/utils/map_fns.clj
@@ -8,7 +8,8 @@
   (let [ent (OnyxMap.)
         ks (keys m) ]
     (reduce
-      ; Strip keywords, convert everything else to a string.
+      ; Strip keywords, pass everything else
+      ; through untouched.
       (fn [ent k]
         (let [n (if (keyword? k)
                   (name k)


Better function names

Better function names

--- src/cljs/asciinema_player/view.cljs
+++ src/cljs/asciinema_player/view.cljs
@@ -131,14 +131,14 @@

 (defn player-style [] {})

-(defn handle-event [f dispatch dom-event]
-  (when-let [[event-name & _ :as event] (f dom-event)]
+(defn handle-dom-event [dispatch event-mapper dom-event]
+  (when-let [[event-name & _ :as event] (event-mapper dom-event)]
     (.preventDefault dom-event)
     (if (= event-name :toggle-fullscreen) ; has to be processed synchronously
       (fullscreen/toggle (.-currentTarget dom-event))
       (dispatch event))))

-(defn map-key-press [dom-event]
+(defn key-press->event [dom-event]
   (case (.-key dom-event)
     " " [:toggle-play]
     "f" [:toggle-fullscreen]
@@ -154,7 +154,7 @@
     "9" [:seek 0.9]
     nil))

-(defn map-key-down [dom-event]
+(defn key-down->event [dom-event]
   (case (.-which dom-event)
     37 [:rewind]
     39 [:fast-forward]
@@ -162,8 +162,8 @@

 (defn player [state dispatch]
   (let [{:keys [font-size theme lines stop-playback-chan current-time duration loading frames]} @state
-        on-key-press (partial handle-event map-key-press dispatch)
-        on-key-down (partial handle-event map-key-down dispatch)
+        on-key-press (partial handle-dom-event dispatch key-press->event)
+        on-key-down (partial handle-dom-event dispatch key-down->event)
         class-name (player-class-name theme)
         playing? (boolean stop-playback-chan)]
     [:div.asciinema-player-wrapper {:tab-index -1 :on-key-press on-key-press :on-key-down on-key-down}


changed return value of definition?

changed return value of definition?

--- src/cljs/lisp_interpreter/core.cljs
+++ src/cljs/lisp_interpreter/core.cljs
@@ -155,7 +155,7 @@
   (js/console.log "the exp is " exp)
   (cond (self-evaluating? exp) exp
         (definition? exp)  (do (eval-definition exp env)
-                               ((keyword (first (rest exp))) @env))
+                               :ok #_((keyword (first (rest exp))) @env))
         (variable? exp) (lookup-variable exp env)
         (lookup? exp) (eval-lookup exp env)
         (lambda? exp) (make-proc (lambda-params exp) (lambda-body exp) env)


Add crypto-suite interface

Add crypto-suite interface

--- src/clojure_fabric/crypto_suite.clj
+++ src/clojure_fabric/crypto_suite.clj
@@ -24,6 +24,19 @@
 ;; Add provider!
 (Security/addProvider (BouncyCastleProvider.))

+;;;
+;;; Interface
+;;;
+(defrecord CryptoSuite [security-provider key-algorithm curve-name hash-algorithm])
+(defn make-crypto-suite
+  [& {:keys [security-provider key-algorithm curve-name hash-algorithm]
+      :or {security-provider BouncyCastleProvider/PROVIDER_NAME
+           key-algorithm :ECDSA
+           curve-name :secp256r1
+           hash-algorithm :sha3-384}}]
+  (->CryptoSuite security-provider key-algorithm curve-name hash-algorithm))
+
+
 ;; (defonce key-store (atom nil))

 ;; TBD
@@ -41,10 +54,10 @@
         “ephemeral”.
   Returns
         Result (Key): The key object"
-  [{:keys [algorithm curve ephemeral]}]
+  [{:keys [algorithm curve ephemeral ^String security-provider]}]
   (let [generator (-> algorithm
                       name
-                      (KeyPairGenerator/getInstance BouncyCastleProvider/PROVIDER_NAME))
+                      (KeyPairGenerator/getInstance security-provider))
         param-specs (-> curve name ECNamedCurveTable/getParameterSpec)]
     (.initialize generator param-specs (SecureRandom.))
     (.generateKeyPair generator)))
@@ -134,7 +147,7 @@
         opts (Object)
   Returns
         (Key) An instance of the Key class wrapping the raw key bytes"
-  [k {:keys [algorithm curve ephemeral type]}]
+  [k {:keys [algorithm curve ephemeral type ^String security-provider]}]
   (let [curve-name (name curve)
         parameter-spec (ECNamedCurveTable/getParameterSpec curve-name)
         curve (.getCurve parameter-spec)
@@ -147,7 +160,7 @@
         key-size (count k-byte-array)]
     (if (= curve-size key-size)
       (let [middle (int (/ key-size 2))
-            kf (KeyFactory/getInstance (name algorithm) BouncyCastleProvider/PROVIDER_NAME)
+            kf (KeyFactory/getInstance (name algorithm) security-provider)
             spec (ECPublicKeySpec. (ECPoint. (java.math.BigInteger. 1 (Arrays/copyOfRange k-byte-array (int 0) middle))
                                              (java.math.BigInteger. 1 (Arrays/copyOfRange k-byte-array middle key-size)))
                                    (ECNamedCurveSpec. curve-name curve (.getG parameter-spec) (.getN parameter-spec)
@@ -257,7 +270,7 @@
         (bool): verification successful or not"
   [pub-key signature ^bytes digest {:keys [algorithm]}]
   (doto (Signature/getInstance (name algorithm))
-    (.initVerify pub-key) ;; pub-key type is unknown :(
+    (.initVerify pub-key) ;; Reflection warning! - pub-key type is unknown :(
     (.update digest)
     (.verify signature)))


Improve attribute spec

Improve attribute spec

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -19,8 +19,8 @@

 (s/def ::sym symbol?)
 (s/def ::sym-set (s/coll-of ::sym :kind set?))
-(s/def ::attribute ::p/attribute)
-(s/def ::attributes-set (s/coll-of ::attribute :kind set?))
+(s/def ::attribute (s/or :attribute ::p/attribute :set ::attributes-set))
+(s/def ::attributes-set (s/coll-of ::p/attribute :kind set?))
 (s/def ::batch? boolean?)

 (s/def ::resolve fn?)


Match up seq test.

Match up seq test.

--- test/onyx/peer/sequential_test.clj
+++ test/onyx/peer/sequential_test.clj
@@ -63,7 +63,7 @@
           :hornetq/host (:host (:non-clustered (:hornetq config)))
           :hornetq/port (:port (:non-clustered (:hornetq config)))
           :onyx/batch-size batch-size}]
-        conn (onyx.api/connect (str "onyx:memory//localhost/" id) coord-opts)
+        conn (onyx.api/connect :memory coord-opts)
         v-peers (onyx.api/start-peers conn 1 peer-opts)]

     (hq-util/create-queue! hq-config in-queue)


Switch back to seq plugin, as core.async plugin is still broken for recovery

--- test/onyx/peer/stuck_peer_test.clj
+++ test/onyx/peer/stuck_peer_test.clj
@@ -53,7 +53,7 @@
                            :onyx.peer/publisher-liveness-timeout-ms publisher-liveness-timeout)]
     (with-test-env [test-env [3 env-config peer-config]]
       (let [batch-size 10
-            catalog [{:onyx/name :in
+            catalog [#_{:onyx/name :in
                       :onyx/plugin :onyx.plugin.core-async/input
                       :onyx/type :input
                       :onyx/medium :core.async
@@ -74,19 +74,17 @@
                       :onyx/max-peers 1
                       :onyx/doc "Writes segments to a core.async channel"}]
             workflow [[:in :inc] [:inc :out]]
-            lifecycles [{:lifecycle/task :in
+            lifecycles [#_{:lifecycle/task :in
                          :lifecycle/calls ::in-calls}
                         {:lifecycle/task :out
                          :lifecycle/calls ::out-calls}]
-            input (map (fn [n]
-                         {:n n})
-                       (range n-messages))
+            input (map (fn [n] {:n n}) (range n-messages))
             job (-> {:catalog catalog
                      :workflow workflow
                      :lifecycles lifecycles
                      :task-scheduler :onyx.task-scheduler/balanced
                      :metadata {:job-name :click-stream}}
-                    #_(add-task (onyx.tasks.seq/input-serialized :in
+                    (add-task (onyx.tasks.seq/input-serialized :in
                                                                {:onyx/batch-size batch-size
                                                                 :onyx/n-peers 1}
                                                                input)))


Rename link fn args for clarity (fixes #178)

--- boot/pod/src/boot/file.clj
+++ boot/pod/src/boot/file.clj
@@ -111,12 +111,12 @@
     (mapv #(.delete %) (reverse (rest (file-seq (io/file dir)))))))

 (defn hard-link
-  [from-file to-file]
-  (Files/createLink (.toPath to-file) (.toPath from-file)))
+  [existing-file link-file]
+  (Files/createLink (.toPath link-file) (.toPath existing-file)))

 (defn sym-link
-  [from-file to-file]
-  (Files/createSymbolicLink (.toPath to-file) (.toPath from-file) (make-array FileAttribute 0)))
+  [target-file link-file]
+  (Files/createSymbolicLink (.toPath link-file) (.toPath target-file) (make-array FileAttribute 0)))

 (defn copy-with-lastmod
   [src-file dst-file]


CMR-4493: As a Client User, I want deletion of collection to propagate to service association.

--- metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/delete_test.clj
+++ metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/delete_test.clj
@@ -33,59 +33,46 @@
 (deftest delete-group-general
   (cd-spec/general-delete-test :access-group ["REG_PROV" "SMAL_PROV" "CMR"]))

+(defn- is-association-tombstone?
+  "Returns true if the latest revision of the given association is a tombstone."
+  [association]
+  (let [{:keys [status concept]} (util/get-concept-by-id (:concept-id association))]
+    ;; make sure the call succeeded
+    (is (= 200 status))
+    (:deleted concept)))
+
 (deftest tag-delete-cascades-associations
   (testing "delete cascades to tag associations"
     (let [tag-collection (util/create-and-save-collection "REG_PROV" 1)
           tag (util/create-and-save-tag 1)
-          tag-association (util/create-and-save-tag-association tag-collection tag 1 1)
-          tag-association-id (:concept-id tag-association)
-          {status :status tag-association-concept :concept} (util/get-concept-by-id tag-association-id)
-          _ (util/delete-concept (:concept-id tag))
-          {tombstone-status :status tombstone :concept} (util/get-concept-by-id tag-association-id)]
+          tag-association (util/create-and-save-tag-association tag-collection tag 1 1)]
       (testing "tag association was saved and is not a tombstone"
-        (is (= 200 status))
-        (is (not (:deleted tag-association-concept))))
+        (is (= false (is-association-tombstone? tag-association))))
       (testing "tag association is tombstoned after tag is deleted"
-        (is (= 200 tombstone-status))
-        (is (:deleted tombstone))))))
+        (util/delete-concept (:concept-id tag))
+        (is (= true (is-association-tombstone? tag-association)))))))

 (deftest variable-delete-cascades-associations
   (testing "delete cascades to variable associations"
-    (let [variable-collection (util/create-and-save-collection "REG_PROV" 1)
+    (let [coll (util/create-and-save-collection "REG_PROV" 1)
           variable (util/create-and-save-variable "REG_PROV" 1)
-          variable-association (util/create-and-save-variable-association
-                                variable-collection variable 1 1)
-          variable-association-id (:concept-id variable-association)
-          {status :status variable-association-concept :concept} (util/get-concept-by-id
-                                                                  variable-association-id)
-          _ (util/delete-concept (:concept-id variable))
-          {tombstone-status :status tombstone :concept} (util/get-concept-by-id
-                                                         variable-association-id)]
+          variable-association (util/create-and-save-variable-association coll variable 1 1)]
       (testing "variable association was saved and is not a tombstone"
-        (is (= 200 status))
-        (is (not (:deleted variable-association-concept))))
+        (is (= false (is-association-tombstone? variable-association))))
       (testing "variable association is tombstoned after variable is deleted"
-        (is (= 200 tombstone-status))
-        (is (:deleted tombstone))))))
+        (util/delete-concept (:concept-id variable))
+        (is (= true (is-association-tombstone? variable-association)))))))

 (deftest service-delete-cascades-associations
   (testing "delete cascades to service associations"
     (let [coll (util/create-and-save-collection "REG_PROV" 1)
           service (util/create-and-save-service "REG_PROV" 1)
-          service-association (util/create-and-save-service-association
-                                coll service 1 1)
-          service-association-id (:concept-id service-association)
-          {status :status service-association-concept :concept} (util/get-concept-by-id
-                                                                  service-association-id)
-          _ (util/delete-concept (:concept-id service))
-          {tombstone-status :status tombstone :concept} (util/get-concept-by-id
-                                                         service-association-id)]
+          service-association (util/create-and-save-service-association coll service 1 1)]
       (testing "service association was saved and is not a tombstone"
-        (is (= 200 status))
-        (is (not (:deleted service-association-concept))))
+        (is (= false (is-association-tombstone? service-association))))
       (testing "service association is tombstoned after service is deleted"
-        (is (= 200 tombstone-status))
-        (is (:deleted tombstone))))))
+        (util/delete-concept (:concept-id service))
+        (is (= true (is-association-tombstone? service-association)))))))

 ;; collections must be tested separately to make sure granules are deleted as well
 (deftest delete-collection-using-delete-end-point-test
@@ -94,33 +81,52 @@
           gran1 (util/create-and-save-granule provider-id coll1 1 2)
           coll2 (util/create-and-save-collection provider-id 2)
           gran3 (util/create-and-save-granule provider-id coll2 2)
-          {:keys [status revision-id] :as tombstone} (util/delete-concept (:concept-id coll1))
-          deleted-coll1 (:concept (util/get-concept-by-id-and-revision (:concept-id coll1) revision-id))
-          saved-coll1 (:concept (util/get-concept-by-id-and-revision (:concept-id coll1) (dec revision-id)))]
-      (is (= {:status 201
-              :revision-id 4}
-             {:status status
-              :revision-id revision-id}))
-
-      (is (= (dissoc (assoc saved-coll1
-                            :deleted true
-                            :metadata ""
-                            :revision-id revision-id
-                            :user-id nil)
-                     :revision-date :transaction-id)
-             (dissoc deleted-coll1 :revision-date :transaction-id)))
-
-      ;; Make sure that a deleted collection gets it's own unique revision date
-      (is (t/after? (:revision-date deleted-coll1) (:revision-date saved-coll1))
-          "The deleted collection revision date should be after the previous revisions revision date.")
-
-      ;; Verify granule was deleted
-      (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 1)))
-      (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 2)))
-
-      ;; Other data left in database
-      (util/verify-concept-was-saved coll2)
-      (util/verify-concept-was-saved gran3))))
+          variable (util/create-and-save-variable "REG_PROV" 1)
+          variable-association (util/create-and-save-variable-association coll1 variable 1 1)
+          service (util/create-and-save-service provider-id 1)
+          service-association (util/create-and-save-service-association coll1 service 1 1)]
+
+      ;; variable association is not a tombstone before collection is deleted
+      (is (= false (is-association-tombstone? variable-association)))
+      ;; service association is not a tombstone before collection is deleted
+      (is (= false (is-association-tombstone? service-association)))
+
+      ;; now delete coll1
+      (let [{:keys [status revision-id]} (util/delete-concept (:concept-id coll1))
+            deleted-coll1 (:concept (util/get-concept-by-id-and-revision
+                                     (:concept-id coll1) revision-id))
+            saved-coll1 (:concept (util/get-concept-by-id-and-revision
+                                   (:concept-id coll1) (dec revision-id)))]
+
+        (is (= {:status 201
+                :revision-id 4}
+               {:status status
+                :revision-id revision-id}))
+
+        (is (= (dissoc (assoc saved-coll1
+                              :deleted true
+                              :metadata ""
+                              :revision-id revision-id
+                              :user-id nil)
+                       :revision-date :transaction-id)
+               (dissoc deleted-coll1 :revision-date :transaction-id)))
+
+        ;; Make sure that a deleted collection gets it's own unique revision date
+        (is (t/after? (:revision-date deleted-coll1) (:revision-date saved-coll1))
+            "The deleted collection revision date should be after the previous revisions revision date.")
+
+        ;; Verify granule was deleted
+        (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 1)))
+        (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 2)))
+
+        ;; verify variable association is deleted
+        (is (= true (is-association-tombstone? variable-association)))
+        ;; verify service association is deleted
+        (is (= true (is-association-tombstone? service-association)))
+
+        ;; Other data left in database
+        (util/verify-concept-was-saved coll2)
+        (util/verify-concept-was-saved gran3)))))

 (deftest delete-collection-using-save-end-point-test
   (doseq [provider-id ["REG_PROV" "SMAL_PROV"]]
@@ -128,41 +134,59 @@
           gran1 (util/create-and-save-granule provider-id coll1 1 2)
           coll2 (util/create-and-save-collection provider-id 2)
           gran3 (util/create-and-save-granule provider-id coll2 2)
-
-          {:keys [status revision-id]} (util/save-concept {:concept-id (:concept-id coll1)
-                                                           :deleted true
-                                                           :user-id "user101"})
-          deleted-coll1 (:concept (util/get-concept-by-id-and-revision (:concept-id coll1) revision-id))
-          saved-coll1 (:concept (util/get-concept-by-id-and-revision (:concept-id coll1) (dec revision-id)))]
-      (is (= {:status 201
-              :revision-id 4}
-             {:status status
-              :revision-id revision-id}))
-
-      ;; Make sure that the saved tombstone has expected concept-id, revision-id, empty metadata,
-      ;; and deleted = true.
-      (is (= (dissoc (assoc saved-coll1
-                            :deleted true
-                            :metadata ""
-                            :revision-id revision-id
-                            :user-id "user101")
-                     :revision-date :transaction-id)
-             (dissoc deleted-coll1 :revision-date :transaction-id)))
-
-      ;; make sure that a deleted collection gets it's own unique transaction-id
-      (is (> (:transaction-id deleted-coll1) (:transaction-id saved-coll1)))
-
-      ;; Make sure that a deleted collection gets it's own unique revision date
-      (is (t/after? (:revision-date deleted-coll1) (:revision-date saved-coll1))
-          "The deleted collection revision date should be after the previous revisions revision date.")
-
-      ;; Verify granule was deleted
-      (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 1)))
-      (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 2)))
-
-      ;; Other data left in database
-      (util/verify-concept-was-saved coll2)
-      (util/verify-concept-was-saved gran3))))
+          variable (util/create-and-save-variable "REG_PROV" 1)
+          variable-association (util/create-and-save-variable-association coll1 variable 1 1)
+          service (util/create-and-save-service provider-id 1)
+          service-association (util/create-and-save-service-association coll1 service 1 1)]
+
+      ;; variable association is not a tombstone before collection is deleted
+      (is (= false (is-association-tombstone? variable-association)))
+      ;; service association is not a tombstone before collection is deleted
+      (is (= false (is-association-tombstone? service-association)))
+
+      ;; now delete coll1
+      (let [{:keys [status revision-id]} (util/save-concept {:concept-id (:concept-id coll1)
+                                                             :deleted true
+                                                             :user-id "user101"})
+            deleted-coll1 (:concept (util/get-concept-by-id-and-revision
+                                     (:concept-id coll1) revision-id))
+            saved-coll1 (:concept (util/get-concept-by-id-and-revision
+                                   (:concept-id coll1) (dec revision-id)))]
+
+        (is (= {:status 201
+                :revision-id 4}
+               {:status status
+                :revision-id revision-id}))
+
+        ;; Make sure that the saved tombstone has expected concept-id, revision-id, empty metadata,
+        ;; and deleted = true.
+        (is (= (dissoc (assoc saved-coll1
+                              :deleted true
+                              :metadata ""
+                              :revision-id revision-id
+                              :user-id "user101")
+                       :revision-date :transaction-id)
+               (dissoc deleted-coll1 :revision-date :transaction-id)))
+
+        ;; make sure that a deleted collection gets it's own unique transaction-id
+        (is (> (:transaction-id deleted-coll1) (:transaction-id saved-coll1)))
+
+        ;; Make sure that a deleted collection gets it's own unique revision date
+        (is (t/after? (:revision-date deleted-coll1) (:revision-date saved-coll1))
+            "The deleted collection revision date should be after the previous revisions revision date.")
+
+        ;; Verify granule was deleted
+        (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 1)))
+        (is (= {:status 404} (util/get-concept-by-id-and-revision (:concept-id gran1) 2)))
+
+        ;; verify variable association is deleted
+        (is (= true (is-association-tombstone? variable-association)))
+        ;; verify service association is deleted
+        (is (= true (is-association-tombstone? service-association)))
+
+        ;; Other data left in database
+        (util/verify-concept-was-saved coll2)
+        (util/verify-concept-was-saved gran3)))))

 (deftest delete-concept-failure-cases
   (let [coll-reg-prov (util/create-and-save-collection "REG_PROV" 1)


Use the correct location for getting CSS

--- src/day8/re_frame/trace/styles.cljs
+++ src/day8/re_frame/trace/styles.cljs
@@ -1,4 +1,4 @@
 (ns day8.re-frame.trace.styles
   (:require-macros [day8.re-frame.trace.macros :as macros]))

-(def panel-styles (macros/slurp-macro "day8/re_frame/css/main.css"))
+(def panel-styles (macros/slurp-macro "day8/re_frame/trace/main.css"))


moved b/c clojure needs to have definitions beforehand. argle

--- src/hivewing_core/worker_config.clj
+++ src/hivewing_core/worker_config.clj
@@ -58,6 +58,21 @@
       ;;result)
     (catch clojure.lang.ExceptionInfo e false)))

+(defn worker-config-get-tasks
+  "Get the tasks for this worker"
+  [worker-uuid]
+  (let [
+        sql   (str "SELECT * "
+                        " FROM worker_configs "
+                        " WHERE worker_uuid = ? "
+                        " AND key LIKE ?")
+        items (jdbc/query sql-db [ sql (ensure-uuid worker-uuid) (tasks-key "%")])
+        kv-pairs (map #(vector (clojure.string/replace (get % :key) (tasks-key "") "")
+                               (get % :data)) items)
+        result (into {} kv-pairs) ]
+    result
+  ))
+
 (defn worker-config-get-tracing
   [worker-uuid]
   (let [task-names (keys (worker-config-get-tasks worker-uuid))]
@@ -74,21 +89,6 @@
         all-tasks-hash (into {} (map #(vector % (get from-db %)) task-names))
         ]
       all-tasks-hash)))
-
-(defn worker-config-get-tasks
-  "Get the tasks for this worker"
-  [worker-uuid]
-  (let [
-        sql   (str "SELECT * "
-                        " FROM worker_configs "
-                        " WHERE worker_uuid = ? "
-                        " AND key LIKE ?")
-        items (jdbc/query sql-db [ sql (ensure-uuid worker-uuid) (tasks-key "%")])
-        kv-pairs (map #(vector (clojure.string/replace (get % :key) (tasks-key "") "")
-                               (get % :data)) items)
-        result (into {} kv-pairs) ]
-    result
-  ))

 (defn worker-config-delete
   "Deletes all the keys and such for a given worker. The worker was deleted


CMR-2061: Adding commented out test for when we fix CMR-2061.

--- system-int-test/test/cmr/system_int_test/ingest/collection_update_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_update_test.clj
@@ -512,6 +512,31 @@
            coll-cartesian-with-grans {:gsr :geodetic} "CARTESIAN" "GEODETIC"
            coll-orbit-with-grans {:gsr :geodetic} "ORBIT" "GEODETIC"
            coll-no-spatial-with-grans {:gsr :geodetic} "NO_SPATIAL" "GEODETIC"))))
+
+
+;; TODO uncomment with CMR-2061 and add more tests for other fields.
+; (deftest collection-update-ids-test
+;   (let [coll1 (d/ingest "PROV1" (dc/collection {:entry-title "Dataset1"
+;                                                 :native-id "coll1"}))
+;         collNoGranule (d/ingest "PROV1" (dc/collection {:entry-title "Dataset-No-Granule"
+;                                                         :native-id "coll2"}))
+;         gran1 (d/ingest "PROV1" (dg/granule coll1 {:granule-ur "Granule1"}))
+;         gran2 (d/ingest "PROV1" (dg/granule coll1 {:granule-ur "Granule2"}))]
+;     (index/wait-until-indexed)
+
+;     (testing "Update collection successful cases"
+;       (let [response (d/ingest "PROV1" (dc/collection {:entry-title "New Entry Title"
+;                                                        :native-id "coll2"}))
+;             {:keys [status errors]} response]
+;         (= [200 nil] [status errors])))
+
+;     (testing "Update collection failure cases"
+;       (let [response (d/ingest "PROV1" (dc/collection {:entry-title "New Entry Title"
+;                                                        :native-id "coll1"})
+;                                {:allow-failure? true})
+;             {:keys [status errors]} response]
+;         (is (= [400 ["TODO change this to a reasonable error message"]]
+;                [status errors]))))))

 (deftest collection-update-temporal-test
   (let [coll1 (d/ingest "PROV1" (dc/collection {:entry-title "Dataset1"


Fix helper not returning state in certain situations

--- src/braid/client/state/helpers.cljs
+++ src/braid/client/state/helpers.cljs
@@ -56,12 +56,14 @@
       (assoc-in state [:notifications :window-visible?] visible?)))

 (defn maybe-increment-unread [state]
-  (when-not (get-in state [:notifications :window-visible?])
-    ; TODO this should be done with a subscription
-    ; TODO should store time when went away and recalculate unread-count instead of maintaing an unread-count in state
-    (set! (.-title js/document)
-          (str "Chat (" (inc (get-in state [:notifications :unread-count])) ")"))
-    (update-in state [:notifications :unread-count] inc)))
+  (if-not (get-in state [:notifications :window-visible?])
+    (do
+      ; TODO this should be done with a subscription
+      ; TODO should store time when went away and recalculate unread-count instead of maintaing an unread-count in state
+      (set! (.-title js/document)
+            (str "Chat (" (inc (get-in state [:notifications :unread-count])) ")"))
+      (update-in state [:notifications :unread-count] inc))
+    state))

 ; error


clojure.string/split unused

clojure.string/split unused

--- src/buddy/auth/backends/session.clj
+++ src/buddy/auth/backends/session.clj
@@ -16,8 +16,7 @@
   "The session based authentication and authorization backend."
   (:require [buddy.auth.protocols :as proto]
             [buddy.auth.http :as http]
-            [buddy.auth :refer [authenticated?]]
-            [clojure.string :refer [split]]))
+            [buddy.auth :refer [authenticated?]]))

 (defn session-backend
   [& [{:keys [unauthorized-handler authfn] :or {authfn identity}}]]


Remove dead, misleading code

Remove dead, misleading code

--- src/circle/backend/nodes/circle.clj
+++ src/circle/backend/nodes/circle.clj
@@ -26,20 +26,6 @@
             [circle.backend.pallet :as circle-pallet])
   (:require [circle.backend.nodes.rails :as rails])
   (:use [circle.util.except :only (eat)]))
-
-;; this is our "memoized" circle box
-(def circle-group
-  (pallet.core/group-spec
-   "circle"
-   :circle-node-spec {:ami "ami-3bb46152"
-                      :name "www"
-                      :availability-zone "us-east-1a"
-                      :instance-type "m1.small"
-                      :keypair-name "www"
-                      :security-groups ["www" "allow-DB"]
-                      :username "ubuntu"
-                      :public-key (eat (slurp "secret/www.id_rsa.pub"))
-                      :private-key (eat (slurp "secret/www.id_rsa"))}))

 ;; The configuration to build the circle box from scratch
 (def circle-raw-group


Adds a 1px white border around bars to more easily distinguish when bar stacking does the wrong thing

--- src/cljc/gyptis/vega_templates.cljc
+++ src/cljc/gyptis/vega_templates.cljc
@@ -218,7 +218,9 @@
                                     :width {:scale "x" :band true :offset -1}
                                     :y     {:scale "y" :field "layout_start"}
                                     :y2    {:scale "y" :field "layout_end"}
-                                    :fill  {:scale "fill" :field fill}}}}
+                                    :fill  {:scale "fill" :field fill}
+                                    :stroke {:value "white"}
+                                    :strokeWidth {:value 1}}}}
         sum_y_data {:name      "stats"
                     :source    "table"
                     :transform [{:type      "aggregate"
@@ -275,7 +277,9 @@
    :properties
          {:update
           {:x     {:scale "x", :field x},
-           :width {:scale "x", :band true}}
+           :width {:scale "x", :band true}
+           :stroke {:value "white"}
+           :strokeWidth {:value 1}}
           },
    :marks
          [{:name "dodged-bars",


revoked or expired badge view

revoked or expired badge view

--- src/cljs/salava/badge/ui/modal.cljs
+++ src/cljs/salava/badge/ui/modal.cljs
@@ -203,21 +203,25 @@
     ))

 (defn modal-navi [state]
-  (let [selected-language (cursor state [:content-language])
-        data (content-setter @selected-language (:content @state))]
+  (let [expired? (bh/badge-expired? (:expires_on @state))
+        revoked (pos? (:revoked @state))
+        selected-language (cursor state [:content-language])
+        data (content-setter @selected-language (:content @state))
+        disabled (or revoked expired?)
+        disable-link (if disabled "btn disabled")]
     [:div.col-md-9.badge-modal-navi
      [:ul {:class "nav nav-tabs wrap-grid"}
-      [:li.nav-item{:class (if (or (nil? (:tab-no @state))(= 1 (:tab-no @state))) "active")}
+      [:li.nav-item{:class  (if (or (nil? (:tab-no @state))(= 1 (:tab-no @state))) "active")}
        [:a.nav-link {:href "#" :on-click #(swap! state assoc :tab [badge-content state] :tab-no 1 )}
         [:div  [:i.nav-icon {:class "fa fa-eye fa-lg"}] (t :page/View)  ]]]
       [:li.nav-item {:class (if (= 2 (:tab-no @state)) "active")}
-       [:a.nav-link {:href "#" :on-click #(show-settings-dialog (:id @state) state init-data "settings")}
+       [:a.nav-link {:class disable-link :href "#" :on-click #(show-settings-dialog (:id @state) state init-data "settings")}
         [:div  [:i.nav-icon {:class "fa fa-cogs fa-lg"}] (t :page/Settings)  ]]]
       [:li.nav-item {:class (if (= 3 (:tab-no @state)) "active")}
-       [:a.nav-link {:href "#" :on-click #(show-settings-dialog (:id @state) state init-data "share")}
+       [:a.nav-link {:class disable-link :href "#" :on-click #(show-settings-dialog (:id @state) state init-data "share")}
         [:div  [:i.nav-icon {:class "fa fa-share-alt fa-lg"}] (t :badge/Share)  ]]]
       [:li.nav-item {:class (if (= 4 (:tab-no @state)) "active")}
-       [:a.nav-link {:href "#" :on-click #(swap! state assoc :tab [se/download-tab-content (assoc data :assertion_url (:assertion_url @state)
+       [:a.nav-link {:class disable-link :href "#" :on-click #(swap! state assoc :tab [se/download-tab-content (assoc data :assertion_url (:assertion_url @state)
                                                                                :obf_url (:obf_url @state)) state] :tab-no 4)}
         [:div  [:i.nav-icon {:class "fa fa-download fa-lg"}] (t :core/Download)  ]]]
       [:li.nav-item {:class (if (= 5 (:tab-no @state)) "active")}


when bootstrapped cljs.analyzer/core-name? needs to check for cljs.core$macros not cljs.core

--- src/main/clojure/cljs/analyzer.cljc
+++ src/main/clojure/cljs/analyzer.cljc
@@ -513,7 +513,7 @@
   (and (or (get-in @env/*compiler* [::namespaces 'cljs.core :defs sym])
            (when-let [mac (get-expander sym env)]
              (let [^Namespace ns (-> mac meta :ns)]
-               (= (.getName ns) 'cljs.core))))
+               (= (.getName ns) #?(:clj 'cljs.core :cljs 'cljs.core$macros)))))
        (not (contains? (-> env :ns :excludes) sym))))

 (defn resolve-var


make signature matching more expressive

make signature matching more expressive

--- src/main/clojure/powderkeg/core.clj
+++ src/main/clojure/powderkeg/core.clj
@@ -13,30 +13,74 @@
     [clojure.core.reducers :as r]
     [net.cgrand.xforms :as x]))

-(defprotocol TypeToClj (->clj [t]))
-
-(extend-protocol TypeToClj
-  java.lang.reflect.ParameterizedType
-  (->clj [t] (mapv ->clj (clj/into [(.getRawType t)] (.getActualTypeArguments t))))
-  java.lang.reflect.TypeVariable
-  (->clj [t] (.getName t))
-  java.lang.Class
-  (->clj [t] (.getName t)))
+(defn- generic-type [t]
+  (condp instance? t
+    java.lang.Class (symbol (.getName t))
+    java.lang.reflect.TypeVariable (if-some [bounds (seq (remove #{Object} (.getBounds t)))]
+                                     (list* 'extends (keyword (.getName t))
+                                       (map generic-type bounds))
+                                     (keyword (.getName t)))
+    java.lang.reflect.WildcardType (if-some [bounds (seq (remove #{Object} (.getUpperBounds t)))]
+                                     (list* 'extends '? (map generic-type bounds))
+                                     (if-some [bounds (seq (.getLowerBounds t))]
+                                       (list* 'super '? (map generic-type bounds))
+                                       '?))
+    java.lang.reflect.ParameterizedType (clj/into [(generic-type (.getRawType t))]
+                                          (map generic-type)
+                                          (.getActualTypeArguments t))
+    java.lang.reflect.GenericArrayType (list 'array-of (generic-type (.getGenericComponentType t)))
+    (throw (IllegalArgumentException. (pr-str t)))))
+
+(defn- type-order [t]
+  (cond
+    (nil? t) [-1 0]
+    (= t '?) [0 0]
+    (keyword? t) [1 t]
+    (symbol? t) [2 t]
+    (vector? t) [3 (mapv type-order t)]
+    :else (case (first t)
+            super [4 (type-order (second t))]
+            extends [5 (mapv type-order t)]
+            array-of [6 (type-order (second t))])))
+
+(defn- lookup [s k]
+  (if-some [x (s k)]
+    (if (keyword? x)
+      (recur s x)
+      x)
+    k))
+
+(defn- unify-types
+  ([a b]
+    (unify-types {} a b))
+  ([s a b]
+    ; todo: most advanced stuff (bounds) is skipped
+    (let [[a b] (sort-by type-order (map #(lookup s %) [a b]))]
+      (if (= a b)
+        s
+        (cond
+          (nil? a) nil
+          (= a '?) s
+          (keyword? a) (assoc s a b)
+          (symbol? a) (when (vector? b) (recur s a (first b)))
+          (vector? a) (when (and (vector? b) (= (count a) (count b)))
+                        (reduce (fn [s [a b]]
+                                  (or (unify-types s a b)
+                                    (reduced nil))) s (map vector a b))))))))
+
+(defn- unify-sigs [[ra na aa] [rb nb ab]]
+  (when (= na nb)
+    (some-> (unify-types ra rb) (unify-types aa ab))))

 (defn- sig [x]
   (cond
     (instance? java.lang.reflect.Method x)
-    [(.getReturnType x) (.getName x) (vec (.getParameterTypes x))]
+    [(generic-type (.getGenericReturnType x)) (.getName x) (clj/into [] (map generic-type) (.getGenericParameterTypes x))]
     (instance? java.lang.reflect.Constructor x)
-    [nil "<init>" (vec (.getParameterTypes x))]))
-
-(defn- sig-matches? [msig x]
-  (cond
-    (vector? msig) (= msig (sig x))
-    (fn? msig)     (msig x)))
+    [nil "<init>" (clj/into [] (map generic-type) (.getGenericParameterTypes x))]))

 (defn- has-method? [^Class class msig]
-  (some (partial sig-matches? msig) (concat (.getMethods class) (.getConstructors class))))
+  (some #(unify-sigs msig (sig %)) (concat (.getMethods class) (.getConstructors class))))

 (defmacro ^:private compile-cond [& choices]
   (let [x (Object.)
@@ -296,9 +340,9 @@
               (reify org.apache.spark.api.java.function.FlatMapFunction ; todo: skip api.java.* go to spark
                 (call [_ it]
                   (compile-cond
-                    (has-method? org.apache.spark.api.java.function.FlatMapFunction [java.util.Iterator "call" [Object]])
+                    (has-method? org.apache.spark.api.java.function.FlatMapFunction '[java.util.Iterator "call" [?]])
                     (.iterator ((df) it))
-                    (has-method? org.apache.spark.api.java.function.FlatMapFunction [Iterable "call" [Object]])
+                    (has-method? org.apache.spark.api.java.function.FlatMapFunction '[Iterable "call" [?]])
                     ((df) it))))
               preserve-partitioning)]
     rdd))
@@ -391,13 +435,6 @@
       (let [xform (x/by-key (-> xform (cond-> post (comp post)) (cond->> pre (comp pre))))]
         (rdd* src xform options)))))

-(defn left-outer-join-optional [class-name method]
-  (and (-> method .getName (= "leftOuterJoin"))
-       (-> method
-           .getGenericReturnType
-           ->clj
-           (= ["org.apache.spark.api.java.JavaPairRDD" "K" ["scala.Tuple2" "V" [class-name "W"]]]))))
-
 (defn- default-left
   "Returns a stateless transducer on pairs which expects Optionals in key position, unwraps their values or return not-found when no value."
   [not-found]
@@ -407,13 +444,15 @@
         ([] (rf))
         ([acc] (rf acc))
         ([acc left right] (rf acc (.or (compile-cond
-                                        (has-method? org.apache.spark.api.java.JavaPairRDD
-                                                     (partial left-outer-join-optional "org.apache.spark.api.java.Optional"))
-                                        ^org.apache.spark.api.java.Optional left
-                                        (has-method? org.apache.spark.api.java.JavaPairRDD
-                                                     (partial left-outer-join-optional "com.google.common.base.Optional"))
-                                        ^com.google.common.base.Optional left)
-                                       not-found) right))))))
+                                         (has-method? org.apache.spark.api.java.JavaPairRDD
+                                           '[[org.apache.spark.api.java.JavaPairRDD ? [scala.Tuple2 ? org.apache.spark.api.java.Optional]]
+                                             "leftOuterJoin" [?]])
+                                         ^org.apache.spark.api.java.Optional left
+                                         (has-method? org.apache.spark.api.java.JavaPairRDD
+                                           '[[org.apache.spark.api.java.JavaPairRDD ? [scala.Tuple2 ? com.google.common.base.Optional]]
+                                             "leftOuterJoin" [?]])
+                                         ^com.google.common.base.Optional left)
+                                    not-found) right))))))

 (defn- default-right
   "Returns a stateless transducer on pairs which expects Optionals in value position, unwraps their values or return not-found when no value."
@@ -424,13 +463,15 @@
        ([] (rf))
        ([acc] (rf acc))
        ([acc left right] (rf acc left (.or (compile-cond
-                                            (has-method? org.apache.spark.api.java.JavaPairRDD
-                                                         (partial left-outer-join-optional "org.apache.spark.api.java.Optional"))
-                                            ^org.apache.spark.api.java.Optional right
-                                            (has-method? org.apache.spark.api.java.JavaPairRDD
-                                                         (partial left-outer-join-optional "com.google.common.base.Optional"))
-                                            ^com.google.common.base.Optional right)
-                                           not-found)))))))
+                                             (has-method? org.apache.spark.api.java.JavaPairRDD
+                                               '[[org.apache.spark.api.java.JavaPairRDD ? [scala.Tuple2 ? org.apache.spark.api.java.Optional]]
+                                                 "leftOuterJoin" [?]])
+                                             ^org.apache.spark.api.java.Optional right
+                                             (has-method? org.apache.spark.api.java.JavaPairRDD
+                                               '[[org.apache.spark.api.java.JavaPairRDD ? [scala.Tuple2 ? com.google.common.base.Optional]]
+                                                 "leftOuterJoin" [?]])
+                                             ^com.google.common.base.Optional right)
+                                        not-found)))))))

 (defn ^org.apache.spark.api.java.JavaRDD join
   "Performs a join between two rdds, each rdd may be followed by ':or default-value'.
@@ -475,12 +516,12 @@
         partitioner (org.apache.spark.Partitioner/defaultPartitioner
                      rdd (scala-seq rdds))]
     (by-key (compile-cond
-              (has-method? org.apache.spark.rdd.CoGroupedRDD [nil "<init>" [scala.collection.Seq org.apache.spark.Partitioner scala.reflect.ClassTag]] )
+              (has-method? org.apache.spark.rdd.CoGroupedRDD '[nil "<init>" [scala.collection.Seq org.apache.spark.Partitioner scala.reflect.ClassTag]] )
               (org.apache.spark.rdd.CoGroupedRDD.
               (scala-seq (cons rdd rdds))
               partitioner
               (.AnyRef scala.reflect.ClassTag$/MODULE$))
-              (has-method? org.apache.spark.rdd.CoGroupedRDD [nil "<init>" [scala.collection.Seq org.apache.spark.Partitioner]] )
+              (has-method? org.apache.spark.rdd.CoGroupedRDD '[nil "<init>" [scala.collection.Seq org.apache.spark.Partitioner]] )
               (org.apache.spark.rdd.CoGroupedRDD.
               (scala-seq (cons rdd rdds))
               partitioner))


Remove unused pages from tryisla home page.

--- src/tryclojure/views/home.clj
+++ src/tryclojure/views/home.clj
@@ -37,10 +37,4 @@
   (root-html))

 (defpage "/home" []
-  (home-html))
-
-(defpage "/about" []
-  (about-html))
-
-(defpage "/links" []
-  (links))
+  (home-html))


[#2439] To verify add failing backend test

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -11,6 +11,9 @@

 (use-fixtures :once (partial system-fixture "endpoints-test.edn")
   tenant-conn-fixture error-tracker-fixture tu/spec-instrument)
+
+(deftest failing-test
+  (is (= 1 2)))

 (deftest handler-test
   (let [h (:handler (:akvo.lumen.component.handler/handler *system*))]