render cancel and pause properly

render cancel and pause properly

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -74,14 +74,16 @@
 (defn user-upload-progress [data]
   (let [upload (first data)
         upload-info (second data)]
+    (println "DATAQ" data)
     (dom/div #js {:className "track-view"}
              (when-not (nil? upload)
+               (list
                (dom/button #js {:onClick #(core/cancel-upload (.-id upload-info))}       "CANCEL")
                  (if (:paused? ((:uploads @app-state/app-state) (:id upload)))
                    (dom/button #js {:onClick #(core/resume-upload!  (:id upload))} "RESUME")
                    (dom/button #js {:onClick #(core/pause-upload!   (:id upload))} "PAUSE"))
                  (when-not (:started? upload)
-                   "STOPPED!"))
+                   "STOPPED!")))
              (((:users @app-state/app-state) (.-uploaderid upload-info)) "name")
              " - " (* 100 (/ (.-bytesreceived upload-info) (.-totalsize upload-info))) "% - "
              (.-filename upload-info))))


Added forest xml filtering example

Added forest xml filtering example

--- src/tupelo/x_forest.cljc
+++ src/tupelo/x_forest.cljc
@@ -732,7 +732,7 @@
    path-pred :- s/Any] ; #todo how func spec?
   (let [paths-found (find-paths root-spec tgt-path)
         keepers     (keep-if path-pred paths-found)]
-       keepers))
+    keepers))

 (s/defn find-hids-with
   [root-spec :- HID
@@ -741,7 +741,7 @@
   (let [paths-found (find-paths root-spec tgt-path)
         hids-found  (mapv last paths-found)
         hids-keep   (keep-if hid-pred hids-found)]
-       hids-keep))
+    hids-keep))

 (defn find-hids     ; #todo need test
   [root-spec tgt-path]


Explicitly check prevent-scrolling-in-table-view? value is equal to true since it can also be null

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -565,7 +565,9 @@
           (when active?
             (html
              [:div.table-view
-              {:style (when prevent-scrolling-in-table-view?
+             ;; Check if prevent-scrolling-in-table-view? value is equal to true
+             ;; since it can also be null
+              {:style (when (= true prevent-scrolling-in-table-view?)
                         {:height (or table-view-height
                                      (get-table-view-height))
                          :overflow "hidden"})}


Switched order of expected and actual args to = for clearer test failure messages

--- exercises/clock/test/clock_test.clj
+++ exercises/clock/test/clock_test.clj
@@ -6,112 +6,112 @@

   (testing "on the hour"
     (let [test-clock (clock->string (clock 8 0))]
-      (is (= test-clock "08:00"))))
+      (is (= "08:00" test-clock))))
   (testing "past the hour"
     (let [test-clock (clock->string (clock 11 9))]
-      (is (= test-clock "11:09"))))
+      (is (= "11:09" test-clock))))
   (testing "midnight is zero hours"
     (let [test-clock (clock->string (clock 24 0))]
-      (is (= test-clock "00:00"))))
+      (is (= "00:00" test-clock))))
   (testing "hour rolls over"
     (let [test-clock (clock->string (clock 25 0))]
-      (is (= test-clock "01:00"))))
+      (is (= "01:00" test-clock))))
   (testing "hour rolls over continuously"
     (let [test-clock (clock->string (clock 100 0))]
-      (is (= test-clock "04:00"))))
+      (is (= "04:00" test-clock))))
   (testing "sixty minutes is next hour"
     (let [test-clock (clock->string (clock 1 60))]
-      (is (= test-clock "02:00"))))
+      (is (= "02:00" test-clock))))
   (testing "minutes roll over"
     (let [test-clock (clock->string (clock 0 160))]
-      (is (= test-clock "02:40"))))
+      (is (= "02:40" test-clock))))
   (testing "minutes roll over continuously"
     (let [test-clock (clock->string (clock 0 1723))]
-      (is (= test-clock "04:43"))))
+      (is (= "04:43" test-clock))))
   (testing "hour and minutes roll over"
     (let [test-clock (clock->string (clock 25 160))]
-      (is (= test-clock "03:40"))))
+      (is (= "03:40" test-clock))))
   (testing "hour and minutes roll over continuously"
     (let [test-clock (clock->string (clock 201 3001))]
-      (is (= test-clock "11:01"))))
+      (is (= "11:01" test-clock))))
   (testing "hour and minutes roll over to exactly midnight"
     (let [test-clock (clock->string (clock 72 8640))]
-      (is (= test-clock "00:00"))))
+      (is (= "00:00" test-clock))))
   (testing "negative hour"
     (let [test-clock (clock->string (clock -1 15))]
-      (is (= test-clock "23:15"))))
+      (is (= "23:15" test-clock))))
   (testing "negative hour rolls over"
     (let [test-clock (clock->string (clock -25 0))]
-      (is (= test-clock "23:00"))))
+      (is (= "23:00" test-clock))))
   (testing "negative hour rolls over continuously"
     (let [test-clock (clock->string (clock -91 0))]
-      (is (= test-clock "05:00"))))
+      (is (= "05:00" test-clock))))
   (testing "negative minutes"
     (let [test-clock (clock->string (clock 1 -40))]
-      (is (= test-clock "00:20"))))
+      (is (= "00:20" test-clock))))
   (testing "negative minutes roll over"
     (let [test-clock (clock->string (clock 1 -160))]
-      (is (= test-clock "22:20"))))
+      (is (= "22:20" test-clock))))
   (testing "negative minutes roll over continuously"
     (let [test-clock (clock->string (clock 1 -4820))]
-      (is (= test-clock "16:40"))))
+      (is (= "16:40" test-clock))))
   (testing "negative hour and minutes both roll over"
     (let [test-clock (clock->string (clock -25 -160))]
-      (is (= test-clock "20:20"))))
+      (is (= "20:20" test-clock))))
   (testing "negative hour and minutes both roll over continuously"
     (let [test-clock (clock->string (clock -121 -5810))]
-      (is (= test-clock "22:10")))))
+      (is (= "22:10" test-clock)))))

 (deftest add-time-test

   (testing "add minutes"
     (let [test-clock (clock->string (add-time (clock 10 0) 3))]
-      (is (= test-clock "10:03"))))
+      (is (= "10:03" test-clock))))
   (testing "add no minutes"
     (let [test-clock (clock->string (add-time (clock 6 41) 0))]
-      (is (= test-clock "06:41"))))
+      (is (= "06:41" test-clock))))
   (testing "add to next hour"
     (let [test-clock (clock->string (add-time (clock 0 45) 40))]
-      (is (= test-clock "01:25"))))
+      (is (= "01:25" test-clock))))
   (testing "add more than one hour"
     (let [test-clock (clock->string (add-time (clock 10 0) 61))]
-      (is (= test-clock "11:01"))))
+      (is (= "11:01" test-clock))))
   (testing "add more than two hours with carry"
     (let [test-clock (clock->string (add-time (clock 0 45) 160))]
-      (is (= test-clock "03:25"))))
+      (is (= "03:25" test-clock))))
   (testing "add across midnight"
     (let [test-clock (clock->string (add-time (clock 23 59) 2))]
-      (is (= test-clock "00:01"))))
+      (is (= "00:01" test-clock))))
   (testing "add more than one day (1500 min = 25 hrs)"
     (let [test-clock (clock->string (add-time (clock 5 32) 1500))]
-      (is (= test-clock "06:32"))))
+      (is (= "06:32" test-clock))))
   (testing "add more than two days"
     (let [test-clock (clock->string (add-time (clock 1 1) 3500))]
-      (is (= test-clock "11:21"))))
+      (is (= "11:21" test-clock))))
   (testing "subtract minutes"
     (let [test-clock (clock->string (add-time (clock 10 3) -3))]
-      (is (= test-clock "10:00"))))
+      (is (= "10:00" test-clock))))
   (testing "subtract to previous hour"
     (let [test-clock (clock->string (add-time (clock 10 3) -30))]
-      (is (= test-clock "09:33"))))
+      (is (= "09:33" test-clock))))
   (testing "subtract more than an hour"
     (let [test-clock (clock->string (add-time (clock 10 3) -70))]
-      (is (= test-clock "08:53"))))
+      (is (= "08:53" test-clock))))
   (testing "subtract across midnight"
     (let [test-clock (clock->string (add-time (clock 0 3) -4))]
-      (is (= test-clock "23:59"))))
+      (is (= "23:59" test-clock))))
   (testing "subtract more than two hours"
     (let [test-clock (clock->string (add-time (clock 0 0) -160))]
-      (is (= test-clock "21:20"))))
+      (is (= "21:20" test-clock))))
   (testing "subtract more than two hours with borrow"
     (let [test-clock (clock->string (add-time (clock 6 15) -160))]
-      (is (= test-clock "03:35"))))
+      (is (= "03:35" test-clock))))
   (testing "subtract more than one day (1500 min = 25 hrs)"
     (let [test-clock (clock->string (add-time (clock 5 32) -1500))]
-      (is (= test-clock "04:32"))))
+      (is (= "04:32" test-clock))))
   (testing "subtract more than two days"
     (let [test-clock (clock->string (add-time (clock 2 20) -3000))]
-      (is (= test-clock "00:20")))))
+      (is (= "00:20" test-clock)))))

 (deftest equal-clock-test
   (testing "clocks with same time"


Refactor the main repo impl.

Refactor the main repo impl.

--- src/uxbox/repo/core.cljs
+++ src/uxbox/repo/core.cljs
@@ -26,11 +26,25 @@
     (assoc response :body (t/decode body))
     response))

+(defrecord Ok [status payload])
+(defrecord ServerError [status paylpad])
+(defrecord ClientError [status payload])
+(defrecord NotFound [payload])
+
 (defn- handle-http-status
-  [response]
-  (if (http.status/success? response)
-    (p/resolved response)
-    (p/rejected response)))
+  [{:keys [body status] :as response}]
+  (cond
+    (http.status/success? response)
+    (rx/of (->Ok status body))
+
+    (http.status/client-error? response)
+    (rx/throw
+     (if (= status 404)
+       (->NotFound body)
+       (->ClientError status body)))
+
+    (http.status/server-error? response)
+    (rx/throw (->ServerError status body))))

 (def ^:private ^:const +headers+
   {"content-type" "application/transit+json"})
@@ -48,23 +62,12 @@
                        (when auth (auth-headers)))
         request (merge (assoc request :headers headers)
                        (when body {:body (t/encode body)}))]
-    (-> (http/send! request)
-        (p/catch (fn [err]
-                   (println "[error]:" err)
-                   (throw err)))
-        (p/then conditional-decode)
-        (p/then handle-http-status))))
-
-(defn- req!
-  [request]
-  (let [on-success #(p/resolved (:body %))
-        on-error #(if (map? %)
-                    (p/rejected (:body %))
-                    (p/rejected %))]
-
-    (-> (send! request)
-        (p/then on-success)
-        (p/catch on-error))))
+    (->> (http/send! request)
+         (rx/from-promise)
+         (rx/map conditional-decode)
+         (rx/mapcat handle-http-status)
+         (rx/tap #(println "tt:" %)))))
+ ;; "tt: "))))

 (defmulti -do
   (fn [type data] type))


Improvements to example main to run in cloud.

--- examples/movie-lens-recommender/src/movie_lens/main.clj
+++ examples/movie-lens-recommender/src/movie_lens/main.clj
@@ -3,6 +3,7 @@
   (:require
     [blocks.core :as block]
     [blocks.store.file]
+    [blocks.store.s3]
     [clojure.string :as str]
     [clojure.tools.cli :as cli]
     [clojure.tools.logging :as log]
@@ -18,7 +19,8 @@
     [multihash.core :as multihash]
     [sparkling.conf :as conf]
     [sparkling.core :as spark]
-    [sparkling.destructuring :as sde]))
+    [sparkling.destructuring :as sde]
+    [sparkling.serialization]))

 (def cli-options
@@ -26,8 +28,8 @@
     :default "file://data/db/blocks"]
    ["-r" "--refs URL" "Location of backing ref tracker"
     :default "file://data/db/refs.tsv"]
-   ["-m" "--master URL" "Spark master connection URL"
-    :default "local"]
+   ["-m" "--master URL" "Spark master connection URL"]
+   [nil  "--no-prompt" "Disable the prompt for user input before exiting"]
    ["-h" "--help"]])

@@ -41,8 +43,9 @@
   [cfg]
   (fn init
     []
+    (require 'blocks.store.s3)
     (mdag/init-store
-      :encoding [:mdag :gzip :edn]
+      :encoding [:mdag :gzip :cbor]
       :store (block/->store (:blocks-url cfg))
       :cache {:total-size-limit (:cache-size cfg (* 32 1024 1024))}
       :types merkle-db.graph/codec-types)))
@@ -168,7 +171,8 @@
   "Main entry point for example."
   [& raw-args]
   (let [{:keys [options arguments summary errors]} (cli/parse-opts raw-args cli-options)
-        command (first arguments)]
+        command (first arguments)
+        success? (atom true)]
     (when errors
       (binding [*out* *err*]
         (doseq [err errors]
@@ -194,14 +198,20 @@
           elapsed (delay (/ (- (System/currentTimeMillis) start) 1e3))]
       (spark/with-context spark-ctx (-> (conf/spark-conf)
                                         (conf/app-name "movie-lens-recommender")
-                                        (conf/master (:master options)))
+                                        (cond->
+                                          (:master options)
+                                            (conf/master (:master options))))
         (try
           (command-fn spark-ctx options (rest arguments))
           (catch Throwable err
             (log/error err "Command failed!")
             (when-let [err (ex-data err)]
+              (reset! success? false)
               (u/pprint err))))
-        (println "\nCommand finished in" (u/duration-str @elapsed))
-        (println "Press RETURN to exit")
-        (flush)
-        (read-line)))))
+        (when-not (:no-prompt options)
+          (println "\nCommand finished in" (u/duration-str @elapsed))
+          (println "Press RETURN to exit")
+          (flush)
+          (read-line)))
+      (when-not @success?
+        (System/exit 1)))))


CMR-2435: Fixed typo.

CMR-2435: Fixed typo.

--- search-app/src/cmr/search/services/tagging_service.clj
+++ search-app/src/cmr/search/services/tagging_service.clj
@@ -206,30 +206,30 @@
   (tv/validate-collections-json collections-json)
   (json/parse-string collections-json true))

-(defn- validate-collection-concpet-ids
+(defn- validate-collection-concept-ids
   "Validates the collection concept-ids are valid,
   i.e. all collections for the given concept-ids exist and are viewable by the token."
   [context coll-concept-ids]
   (let [query (cqm/query {:concept-type :collection
-                      :condition (cqm/string-conditions :concept-id coll-concept-ids true)
-                      :page-size :unlimited
-                         :result-format :query-specified
-                         :fields [:concept-id]
-                         :skip-acls? false})
+                          :condition (cqm/string-conditions :concept-id coll-concept-ids true)
+                          :page-size :unlimited
+                          :result-format :query-specified
+                          :fields [:concept-id]
+                          :skip-acls? false})
         concept-ids (->> (qe/execute-query context query)
-                              :items
-                              (map :concept-id))
+                         :items
+                         (map :concept-id))
         inaccessible-concept-ids (set/difference (set coll-concept-ids) (set concept-ids))]
     (when (seq inaccessible-concept-ids)
-       (errors/throw-service-error
-         :invalid-data (msg/inaccessible-collections inaccessible-concept-ids)))))
+      (errors/throw-service-error
+        :invalid-data (msg/inaccessible-collections inaccessible-concept-ids)))))

 (defn associate-tag-to-collections
   "Associates a tag to the given list of collections."
   [context concept-id collections-json]
   (let [coll-concept-ids (->> (collections-json->collections collections-json)
                               (map :concept-id))]
-    (validate-collection-concpet-ids context coll-concept-ids)
+    (validate-collection-concept-ids context coll-concept-ids)
     (update-tag-association-to-collections context concept-id coll-concept-ids :insert)))

 (defn disassociate-tag-to-collections
@@ -237,7 +237,7 @@
   [context concept-id collections-json]
   (let [coll-concept-ids (->> (collections-json->collections collections-json)
                               (map :concept-id))]
-    (validate-collection-concpet-ids context coll-concept-ids)
+    (validate-collection-concept-ids context coll-concept-ids)
     (update-tag-association-to-collections context concept-id coll-concept-ids :delete)))

 (defn associate-tag-by-query


made url update

made url update

--- src/cljs/wombats_web_client/constants/urls.cljs
+++ src/cljs/wombats_web_client/constants/urls.cljs
@@ -1,13 +1,12 @@
 (ns wombats-web-client.constants.urls)

-(def base-ws-url "//54.145.152.66")
-(def base-api-url "http://dev.wombats.io")
+(def base-api-url "//dev.wombats.io")

 (def self-url (str base-api-url "/api/v1/self"))
 (def github-signout-url (str base-api-url "/api/v1/auth/github/signout"))
 (def github-signin-url (str base-api-url "/api/v1/auth/github/signin"))

-(def game-url (str "ws:" base-ws-url "/ws/game"))
+(def game-url (str "ws:" base-api-url "/ws/game"))

 (defn my-wombats-url
   [id]


[clojure] clean up lein profile

[clojure] clean up lein profile

--- etc/repl.clj
+++ etc/repl.clj
@@ -4,7 +4,6 @@
             [clojure.repl :as repl]
             [kaocha.repl]
             clojure.pprint
-            [cemerick.pomegranate]
             [clojure.tools.namespace.find :as ns.find]
             [clojure.tools.namespace.repl :as ns.repl]
             [clojure.java.io :as io])
@@ -106,14 +105,4 @@
   (let [sys (sys)]
     (get sys component-name)))

-(defn add-dependency
-  "Adds dependencies within a running REPL
-  Stolen from https://clojureverse.org/t/how-to-use-a-dependency-from-clojure-repl-without-starting-a-lein-project/1596/5
-  Usage: (add-dependency ['cheshire \"5.8.1\"])"
-  [dep-vec]
-  (cemerick.pomegranate/add-dependencies
-   :coordinates [dep-vec]
-   :repositories (merge @(resolve 'cemerick.pomegranate.aether/maven-central)
-                        {"clojars" "https://clojars.org/repo"})))
-
 (init!)


organize/partition elements/functions of the page

--- src/cljs/early_vote_site/elections/events.cljs
+++ src/cljs/early_vote_site/elections/events.cljs
@@ -7,23 +7,25 @@
             [early-vote-site.utils :as utils]
             [re-frame.core :as re-frame]))

-(enable-console-print!)
+;; Navigation

 (defn navigate
   [{:keys [db]} [_]]
   {:db (assoc db :active-panel :elections/main)
    :dispatch [:elections-list/get]})

+(defn select-election [{:keys [db]} [_ election-id]]
+  {:db (assoc-in db [:selected-election-id] election-id)
+   :dispatch [:navigate/election-detail]})
+
+;; Create/Edit Forms
+
 (defn update-form [db [_ id keyword newval]]
   (-> db
     (assoc-in [:elections :forms id keyword] newval)
     (update-in [:elections :errors id] dissoc keyword)))

-(defn select-election [{:keys [db]} [_ election-id]]
-  {:db (assoc-in db [:selected-election-id] election-id)
-   :dispatch [:navigate/election-detail]})
-
-(defn create-params [db id]
+(defn election-params [db id]
   {:state_fips (get-in db [:elections :forms id :state])
    :election_date (get-in db [:elections :forms id :date])})

@@ -44,6 +46,31 @@
   (if (= :new id)
     :post
     :put))
+
+(defn save-election
+  [{:keys [db]} [_ id]]
+  (if-let [errors (form-errors db id)]
+    {:db (assoc-in db [:elections :errors id] errors)}
+    (let [data (election-params db id)]
+      {:db db
+       :http-xhrio {:method          (save-method id)
+                    :uri             (save-url db id)
+                    :params          data
+                    :timeout         8000
+                    :format          (ajax/json-request-format)
+                    :response-format (ajax/json-response-format)
+                    :on-success [:election-save/success id]
+                    :on-failure [:authorization/check [:election-save/failure]]}})))
+
+(defn save-election-success
+  [{:keys [db]} [_ id result]]
+  {:db (-> db
+           (assoc-in [:elections :forms id] db/fresh-election-form)
+           (update-in [:elections :errors] dissoc id))
+   :dispatch-n [[:flash/message "Election saved"]
+                [:elections-list/get]]})
+
+;; Delete Election

 (defn initiate-delete
   [db [_ election]]
@@ -66,28 +93,14 @@
                 :on-success [:election-delete/success]
                 :on-failure [:election-delete/failure]}})

-(defn save-election
-  [{:keys [db]} [_ id]]
-  (if-let [errors (form-errors db id)]
-    {:db (assoc-in db [:elections :errors id] errors)}
-    (let [data (create-params db id)]
-      {:db db
-       :http-xhrio {:method          (save-method id)
-                    :uri             (save-url db id)
-                    :params          data
-                    :timeout         8000
-                    :format          (ajax/json-request-format)
-                    :response-format (ajax/json-response-format)
-                    :on-success [:election-save/success id]
-                    :on-failure [:authorization/check [:election-save/failure]]}})))
+(defn election-delete-success
+  [{:keys [db]} [_ id result]]
+  {:db db
+   :dispatch-n [[:flash/message "Election deleted"]
+                [:close-modal]
+                [:elections-list/get]]})

-(defn save-election-success
-  [{:keys [db]} [_ id result]]
-  {:db (-> db
-           (assoc-in [:elections :forms id] db/fresh-election-form)
-           (update-in [:elections :errors] dissoc id))
-   :dispatch-n [[:flash/message "Election saved"]
-                [:elections-list/get]]})
+;; Elections List

 (defn list-elections-params
   [db]
@@ -122,6 +135,8 @@
   (assoc-in db [:elections :list]
             (map election-json->clj result)))

+;; Edit Mode
+
 (defn election->form
   [election]
   {:id (:id election)
@@ -141,12 +156,7 @@
     (update-in [:elections :editing] disj id)
     (update-in [:elections :forms] dissoc id)))

-(defn election-delete-success
-  [{:keys [db]} [_ id result]]
-  {:db db
-   :dispatch-n [[:flash/message "Election deleted"]
-                [:close-modal]
-                [:elections-list/get]]})
+;; File Generation

 (defn file-generation
   [{:keys [db]} [_ election-id]]


Changed execute handler to send execute_reply after a raised exception.

--- src/clojupyter/kernel/handle_event/execute.clj
+++ src/clojupyter/kernel/handle_event/execute.clj
@@ -159,9 +159,7 @@
              (s*a-l (send-step :iopub_port msgs/EXECUTE-RESULT
                                (msgs/execute-result-content (u/parse-json-str (:result result) true) exe-count))))))
        (s*when final-segment?
-         (if ename
-           (s*a-l (send-step req-port msgs/ERROR reply))
-           (s*a-l (send-step req-port msgs/EXECUTE-REPLY reply))))
+         (s*a-l (send-step req-port msgs/EXECUTE-REPLY reply)))
        (s*when (and store-history? final-segment?)
          (s*a-l (step [`state/add-history! code]
                       {:op :add-history, :data code})))
@@ -222,4 +220,3 @@
                                    (ops/set-leave-action (action nil)))
                                [ic*provide-input ops/enter-action-interceptor])))
          ctx')))))
-


Cosmetics

Cosmetics

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -6,8 +6,7 @@
            [com.datastax.driver.core.policies
             LoadBalancingPolicy DCAwareRoundRobinPolicy RoundRobinPolicy TokenAwarePolicy
             LoggingRetryPolicy DefaultRetryPolicy DowngradingConsistencyRetryPolicy FallthroughRetryPolicy
-            RetryPolicy ConstantReconnectionPolicy ExponentialReconnectionPolicy
-            ]))
+            RetryPolicy ConstantReconnectionPolicy ExponentialReconnectionPolicy]))

 (def ^:dynamic *default-cluster*)
 (def ^:dynamic *default-session*)
@@ -16,7 +15,7 @@

 (defn connect!
   "Connects and sets *default-cluster* and *default-session* for default cluster and session, that
-   cql/execute is going to use"
+   cql/execute is going to use."
   [hosts & {:as options}]
   (let [cluster (-> (Cluster/builder)
                     (copt/set-cluster-options! (assoc options :contact-points hosts))
@@ -36,16 +35,16 @@

 (defn get-hosts
   "Returns all hosts for connected cluster"
-  [^Session client]
+  [^Session session]
   (map (fn [^Host host]
          {:datacenter (.getDatacenter host)
           :address    (.getHostAddress (.getAddress host))
-          :rack       (.getRack host)})
-       (-> client
+          :rack       (.getRack host)
+          :is-up      (.isUp (.getMonitor host))})
+       (-> session
            (.getCluster)
            (.getMetadata)
            (.getAllHosts))))
-

 ;; defn get-replicas
 ;; defn get-cluster-name
@@ -95,13 +94,17 @@
 (defn exponential-reconnection-policy
   "Reconnection policy that waits exponentially longer between each
 reconnection attempt (but keeps a constant delay once a maximum delay is
-reached)."
+reached).
+
+   Delays should be given in milliseconds"
   [base-delay-ms max-delay-ms]
   (ExponentialReconnectionPolicy. base-delay-ms max-delay-ms))

 (defn constant-reconnection-policy
   "Reconnection policy that waits constantly longer between each
 reconnection attempt (but keeps a constant delay once a maximum delay is
-reached)."
+reached).
+
+   Delay should be given in milliseconds"
   [delay-ms]
   (ConstantReconnectionPolicy. delay-ms))


use wss in UI when loaded over ssl

use wss in UI when loaded over ssl

--- src/main/shadow/cljs/ui/app.cljs
+++ src/main/shadow/cljs/ui/app.cljs
@@ -287,7 +287,11 @@
         (async/chan 10 (map util/transit-str))

         ws-url
-        (str "ws://" js/document.location.host "/api/ws")
+        (str "ws"
+             (if (= "https:" js/document.location.protocol) "s" "")
+             "://"
+             js/document.location.host
+             "/api/ws")

         graph-url
         "/api/graph"


Front page is divided into whitelist and blacklist parts

--- src/zg/html_renderer.clj
+++ src/zg/html_renderer.clj
@@ -122,34 +122,66 @@
         [:body
             [:div {:class "container"}
                 (render-navigation-bar-section user-name url-prefix title mode)
-
-                (if zw-mode
-                    (form/form-to [:post (str url-prefix "add-word")]
-                            [:table {:style "border-collapse: separate; border-spacing: 10px;"}
-                                [:tr [:td [:div {:class "label label-primary"} "New word"]]
-                                     [:td " "]
-                                     [:td (form/text-field {:size "30"} "new-word")]]
-                                [:tr [:td [:div {:class "label label-default"} "Description (optional)"]]
-                                     [:td " "]
-                                     [:td (form/text-field {:size "60"} "description")]]
-                                [:tr [:td " "]
-                                     [:td " "]
-                                     [:td (form/submit-button {:class "btn btn-danger"} "Add new word")]]]
-                            [:br]
-                    )
-                    (form/form-to [:post (str url-prefix "add-words")]
-                            [:div {:class "label label-primary"} "New words"]
-                            " "
-                            [:div {:class "label label-warning"} "(please use spaces or commas as separators)"]
-                            [:br]
-                            (form/text-area {:cols "120" :rows "8"} "new-words")
-                            [:br]
-                            (form/submit-button {:class "btn btn-danger"} "Add new words")
-                            [:br]
-                        ))
-
-                        [:br]
-                        [:br]
+            (if (= mode :whitelist)
+                [:div {:class "container-fluid"}
+                        [:div {:class "row"}
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "all-words-in-whitelist") :class "navbar-brand"} "All words"]
+                            ] ; ./navbar-header
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "active-words-in-whitelist") :class "navbar-brand"} "Active words"]
+                            ] ; ./navbar-header
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "deleted-words-in-whitelist") :class "navbar-brand"} "Deleted words"]
+                            ] ; ./navbar-header
+                        [:div {:style "width:80%"}
+                            (render-search-field word url-prefix)
+                        ]
+                        ]
+                        [:br]
+                        [:br]
+                        (form/form-to [:post (str url-prefix "add-words-to-whitelist")]
+                                [:div {:class "label label-primary"} "New words"]
+                                " "
+                                [:div {:class "label label-warning"} "(please use spaces or commas as separators)"]
+                                [:br]
+                                (form/text-area {:cols "80" :rows "8"} "new-words")
+                                [:br]
+                                (form/submit-button {:class "btn btn-danger"} "Add new words")
+                                [:br]
+                            )
+                    ]
+                [:div {:class "container-fluid"}
+                        [:div {:class "row"}
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "all-words-in-blacklist") :class "navbar-brand"} "All words"]
+                            ] ; ./navbar-header
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "active-words-in-blacklist") :class "navbar-brand"} "Active words"]
+                            ] ; ./navbar-header
+                            [:div {:class "navbar-header"}
+                                [:a {:href (str url-prefix "deleted-words-in-blacklist") :class "navbar-brand"} "Deleted words"]
+                            ] ; ./navbar-header
+                        [:div {:style "width:80%"}
+                            (render-search-field word url-prefix)
+                        ]
+                        ]
+                        [:br]
+                        [:br]
+                        (form/form-to [:post (str url-prefix "add-word-to-blacklist")]
+                                [:table {:style "border-collapse: separate; border-spacing: 10px;"}
+                                    [:tr [:td [:div {:class "label label-primary"} "New word"]]
+                                         [:td " "]
+                                         [:td (form/text-field {:size "30"} "new-word")]]
+                                    [:tr [:td [:div {:class "label label-default"} "Description (optional)"]]
+                                         [:td " "]
+                                         [:td (form/text-field {:size "50"} "description")]]
+                                    [:tr [:td " "]
+                                         [:td " "]
+                                         [:td (form/submit-button {:class "btn btn-danger"} "Add new word")]]]
+                                [:br]
+                    )])
+
                 (if message
                     [:div {:class "label label-warning"} message ]
                 )


Fix wrong arg count :cry:

Fix wrong arg count :cry:

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -187,7 +187,7 @@
 (defn- post-process-native
   ([^QueryResponse response]
    (post-process-native response query-default-timeout-seconds))
-  ([^QueryResponse response, ^Integer timeout-seconds, should-retry?]
+  ([^QueryResponse response, ^Integer timeout-seconds]
    (if-not (.getJobComplete response)
      ;; 99% of the time by the time this is called `.getJobComplete` will return `true`. On the off chance it doesn't, wait a few seconds for the job to finish.
      (do


Make sure BigQuery driver declares :basic-aggregations feature [ci drivers]

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -419,9 +419,9 @@
           ;; people can manually specifiy "foreign key" relationships in admin and everything should work correctly.
           ;; Since we can't infer any "FK" relationships during sync our normal FK tests are not appropriate for BigQuery, so they're disabled for the time being.
           ;; TODO - either write BigQuery-speciifc tests for FK functionality or add additional code to manually set up these FK relationships for FK tables
-          :features              (constantly (when-not config/is-test?
-                                               ;; during unit tests don't treat bigquery as having FK support
-                                               #{:foreign-keys}))
+          :features              (constantly (set/union #{:basic-aggregations} (when-not config/is-test?
+                                                                                ;; during unit tests don't treat bigquery as having FK support
+                                                                                #{:foreign-keys})))
           :field-values-lazy-seq (u/drop-first-arg field-values-lazy-seq)
           :mbql->native          (u/drop-first-arg mbql->native)}))


Enable connection pooling by default in ning-client

--- src/engulf/ning_client.clj
+++ src/engulf/ning_client.clj
@@ -42,7 +42,8 @@

 (def default-client-options
      {:max-conns-per-host 4
-      :timeout 90000})
+      :timeout 90000
+      :connection-pooling true})

 (defn create-client
   (^AsyncHttpClient
@@ -51,12 +52,14 @@
   (^AsyncHttpClient
    [arg-opts]
    (let [opts (merge default-client-options arg-opts)
-         {:keys [max-conns-per-host timeout]} opts]
+         {:keys [max-conns-per-host
+                 timeout
+                 connection-pooling]} opts]
     (-> (AsyncHttpClientConfig$Builder.)
         (.setMaximumConnectionsPerHost max-conns-per-host)
         (.setConnectionTimeoutInMs timeout)
         (.setRequestTimeoutInMs timeout)
-        (.setAllowPoolingConnection false)
+        (.setAllowPoolingConnection connection-pooling)
         (.setMaxRequestRetry 0)
         (.setFollowRedirects false)
         (.build)


Refactor some code suggested by kibit

Refactor some code suggested by kibit

--- src/env_logger/grabber.clj
+++ src/env_logger/grabber.clj
@@ -16,9 +16,7 @@
   "Parses and returns temperature and cloud cover information from the XML
   document body. It is assumed that there only one set of data in the body."
   [xml-body]
-  (if (not= (count xml-body) 2)
-    ;; Invalid data
-    nil
+  (when-not (not= (count xml-body) 2)
     (let [data (for [elem xml-body]
                  (map #(->> %
                             :content


aviary-ship: Stop showing boring errors.

--- aviary-ship/src/main/aviary/ship/git.clj
+++ aviary-ship/src/main/aviary/ship/git.clj
@@ -25,10 +25,6 @@

 (defn git [& args]
   (let [{:keys [out err exit]} (apply sh "git" args)]
-    (when (not= exit 0)
-      (console/error :git/error (str args
-                                     " " [:out out]
-                                     " " [:err err])))
     (when (= exit 0) out)))

 (defn root-dir


Inline fetch-todos

Inline fetch-todos

--- src/client/clojure_template/components/todos/main.cljs
+++ src/client/clojure_template/components/todos/main.cljs
@@ -5,10 +5,9 @@
             [clojure-template.components.todos.add :refer [add-component]]
             [clojure-template.components.todos.body :refer [body-component]]))

-(lb/fetch-todos)
-
 (defn todos-component []
   (let [todos (rf/subscribe [lb/todos-subscription])]
+    (lb/fetch-todos)
     (fn []
       [:div.container
        [:div.row


add support for newer nREPL config files

allow disabling the automatic add of the default cider middleware

--- src/main/shadow/cljs/devtools/server/nrepl04.clj
+++ src/main/shadow/cljs/devtools/server/nrepl04.clj
@@ -7,7 +7,9 @@
     [nrepl.middleware :as middleware]
     [nrepl.transport :as transport]
     [nrepl.server :as server]
+    [nrepl.config :as nrepl-config]
     [shadow.jvm-log :as log]
+    [shadow.build.api :refer (deep-merge)]
     [shadow.cljs.repl :as repl]
     [shadow.cljs.devtools.api :as api]
     [shadow.cljs.devtools.server.fake-piggieback04 :as fake-piggieback]
@@ -310,12 +312,14 @@
     (catch Exception e
       [])))

-(defn make-middleware-stack [extra-middleware]
+(defn make-middleware-stack [{:keys [cider middleware] :as config}]
   (-> []
-      (into (->> extra-middleware
+      (into (->> middleware
                  (map middleware-load)
                  (remove nil?)))
-      (into (get-cider-middleware))
+      (cond->
+        (not (false? cider))
+        (into (get-cider-middleware)))
       (into [#'nrepl.middleware/wrap-describe
              #'nrepl.middleware.interruptible-eval/interruptible-eval
              #'nrepl.middleware.load-file/wrap-load-file
@@ -334,17 +338,22 @@
              #'nrepl.middleware.session/session])
       (middleware/linearize-middleware-stack)))

-(defn start
-  [{:keys [host port middleware]
-    :or {host "0.0.0.0"
-         port 0}
-    :as config}]
-
-  (let [middleware-stack
-        (make-middleware-stack middleware)
+(defn start [config]
+  (let [merged-config
+        (deep-merge nrepl-config/config config)
+
+        middleware-stack
+        (make-middleware-stack merged-config)

         handler-fn
-        ((apply comp (reverse middleware-stack)) server/unknown-op)]
+        ((apply comp (reverse middleware-stack)) server/unknown-op)
+
+        {:keys [host port]
+         :or {host "0.0.0.0"
+              port 0}}
+        merged-config]
+
+    (log/debug ::config merged-config)

     (server/start-server
       :bind host


fixed current track highlighting

fixed current track highlighting

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -116,7 +116,7 @@
   (defn update-state []
     (let [state (om/get-state owner)
           playing? (:playing? state)
-          track-id (.-id data)
+          track-id data
           current-track-id (:current-track-id @core/app-state)]
       (if (= track-id current-track-id)
         (if-not playing?


Fixes wrong key in map.

Fixes wrong key in map.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -71,7 +71,7 @@
   (let [rets (lc/invoke-start-task (:onyx.core/compiled event) event)]
     (when-not (:onyx.core/start-lifecycle? rets)
       (logger/task-log-info
-       (:onyx.core/task-information (:onyx.core/compiled event))
+       (:onyx.core/task-information event)
        "Peer chose not to start the task yet. Backing off and retrying..."))
     rets))


Make Eastwood happy. Thanks Eastwood!

Make Eastwood happy. Thanks Eastwood!

--- src/open_company/util/import.clj
+++ src/open_company/util/import.clj
@@ -13,8 +13,6 @@
             [oc.lib.rethinkdb.pool :as db]
             [open-company.resources.common :as common]
             [open-company.resources.company :as company]
-            [open-company.resources.section :as section]
-            [open-company.resources.stakeholder-update :as su]
             [open-company.config :as c])
   (:gen-class))


people count in stats

people count in stats

--- iwaswhere-web/src/cljs/iwaswhere_web/journal.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/journal.cljs
@@ -88,8 +88,8 @@
               ^{:key (:timestamp entry)}
               [journal-entry entry temp-entry hashtags mentions put-fn show-map? editable? show-all-maps? show-tags?]))))
       (when-let [stats (:stats store-snapshot)]
-        [:div.pure-u-1 (:node-count stats) " nodes, " (:edge-count stats) " edges, " (count hashtags) " hashtags"])]]))
-
+        [:div.pure-u-1 (:node-count stats) " nodes, " (:edge-count stats) " edges, " (count hashtags) " hashtags, "
+         (count mentions) " people"])]]))

 (defn cmp-map
   [cmp-id]


Add ambi-rand tweak

Add ambi-rand tweak

--- src/overtone_workspace/beats.clj
+++ src/overtone_workspace/beats.clj
@@ -255,6 +255,7 @@
     ;;(swap! *fn-beats assoc rand-latchbell [_])
     ;;(swap! *fn-beats assoc rand-laser [_])
     (swap! *fn-beats assoc ambi-rand (vec (repeat 16 1)))
+    ;;(swap! *fn-beats assoc ambi-rand (take 64 (cycle [1 0 1 0 1 1])))
     ;;(swap! *fn-beats assoc ambi-rand (vec (repeat 1 _)))
     (swap! *fn-beats assoc prob-kick (take 32 (cycle [10 0 2 0 6 0 2 0 3 0 6 0 1.1 0 2 4])))
     (swap! *fn-beats assoc prob-sd (take 32 (cycle [0 0 1.1 0 1.1 0 6 0 6 0 1.1 0 1.1 0 6 0])))


reorder and uncomment functions into the correct order

--- src/otp_api_proxy/core.clj
+++ src/otp_api_proxy/core.clj
@@ -224,51 +224,19 @@
     (http-client/get test-otp-url {:as :json})))

-(when false ;; for debugging
-  (defn demo-itineraries
-    []
-    (-> test-data/otp-response-2
-        otp-response->remove-trace
-        otp-response->plan
-        plan->merge-similar
-        :itineraries))
-
-  ;; reduce example
-  (reduce (fn [acc i]
-            (update-in acc
-                       [(even? i)]
-                       #((fnil conj []) % i)))
-          {}
-          [1 2 3 4])
-  ;(map :walkDistance (demo-plan->merge-similar))
-  ;(map count-legs (demo-plan->merge-similar))
-  ;(map transit-routes (demo-itineraries))
-
-  (for [a [[1] [2 3 4] [5 6 7 8 9]]] (let [b (count a)] b))
-
-  (defn count-legs
-    [itin]
-    (let [legs (:legs itin)]
-      {:count-legs (count legs)}))
-
-
-  (defn transit-routes
-    "transit routes for each leg of itinerary itin, in order.
-    non-transit legs are ignored."
-    [itin]
-    (let [legs (:legs itin)
-          legs-with-routeid (remove #(nil? (:routeId %))
+(defn transit-route-sequence
+  "transit routes for each leg of itinerary itin, in order.
+  non-transit legs are ignored."
+  [itin]
+  (let [legs (:legs itin)
+        legs-with-routeid (remove #(nil? (:routeId %))
                                     legs)]
-      (into [] (map :routeId legs-with-routeid))))
-
-  (map (juxt :duration :minDuration :maxDuration :countWithThisRouteSequence)
-       (summarize-collection (collect-by-route-sequence (demo-itineraries)))))
-
+    (into [] (map :routeId legs-with-routeid))))

 (defn collect-by-route-sequence [itins]
   (reduce (fn [acc itin]
             (update-in acc
-                       [(transit-routes itin)]
+                       [(transit-route-sequence itin)]
                        (fn [itins]
                          ((fnil conj [])
                           itins itin))))
@@ -307,6 +275,40 @@

  (comment see java.util.Comparator docs )

+(when false ;; for debugging
+  (defn demo-itineraries
+    []
+    (-> test-data/otp-response-2
+        otp-response->remove-trace
+        otp-response->plan
+        plan->merge-similar
+        :itineraries))
+
+  ;; reduce example
+  (reduce (fn [acc i]
+            (update-in acc
+                       [(even? i)]
+                       #((fnil conj []) % i)))
+          {}
+          [1 2 3 4])
+  ;(map :walkDistance (demo-plan->merge-similar))
+  ;(map count-legs (demo-plan->merge-similar))
+  ;(map transit-routes (demo-itineraries))
+
+  (for [a [[1] [2 3 4] [5 6 7 8 9]]] (let [b (count a)] b))
+
+  (defn count-legs
+    [itin]
+    (let [legs (:legs itin)]
+      {:count-legs (count legs)}))
+
+
+
+  (map (juxt :duration :minDuration :maxDuration :countWithThisRouteSequence)
+       (summarize-collection (collect-by-route-sequence (demo-itineraries)))))
+
+
+
 ;; Fixme: verify agency-id along with stop code
 (defn plan->add-text2go
   "add text2go codes into the stopCode field of an OTP Itinerary"
@@ -379,7 +381,7 @@
   :available-media-types ["application/json" "text/plain"]
   :handle-ok (pretty-json
                (-> (otp-request-live get-params)
-                   otp-response->itinerary
+                   otp-response->plan
                    plan->merge-similar
                    plan->add-text2go
                    plan->add-route-url
@@ -391,7 +393,7 @@
   :handle-ok (pretty-json
                (-> (otp-request-live get-params)
                ;; (-> (simple-otp-request-live)
-                   otp-response->itinerary
+                   otp-response->plan
                    plan->add-text2go
                    plan->add-route-url
                    plan->add-route-span


Update buffers to make use of defrecord.

* created a defrecord for each with-meta type.
* ::buffer becomes Buffer, etc.
* added the new types to our isa heirarchy.

--- src/overtone/sc/buffer.clj
+++ src/overtone/sc/buffer.clj
@@ -8,6 +8,8 @@
         [overtone.sc.machinery.server comms connection]
         [overtone.helpers.audio-file]
         [overtone.sc.util :only [id-mapper]]))
+
+(defrecord BufferInfo [id size n-channels rate n-samples rate-scale duration])

 (defn buffer-info
   "Fetch the information for buffer associated with buf-id (either an integer or
@@ -33,31 +35,37 @@
           num-samples                (* n-frames n-chans)
           rate-scale                 (/ rate (server-sample-rate))
           duration                   (/ n-frames rate)]
-      (with-meta     {:size n-frames
-                      :n-channels n-chans
-                      :rate rate
-                      :n-samples num-samples
-                      :rate-scale rate-scale
-                      :duration duration
-                      :id id}
-        {:type ::buffer-info}))))
+
+      (map->BufferInfo
+       {:id id
+        :size n-frames
+        :n-channels n-chans
+        :rate rate
+        :n-samples num-samples
+        :rate-scale rate-scale
+        :duration duration}))))
+
+(defrecord Buffer [id size n-channels rate allocated-on-server])

 (defn buffer
   "Synchronously allocate a new zero filled buffer for storing audio data with
   the specified size and num-channels."
   ([size] (buffer size 1))
   ([size num-channels]
-     (let [id   (with-server-self-sync (fn [uid]
-                                         (alloc-id :audio-buffer
-                                                   1
-                                                   (fn [id]
-                                                     (snd "/b_alloc" id size num-channels)
-                                                     (server-sync uid)))))
+     (let [id   (with-server-self-sync
+                  (fn [uid]
+                    (alloc-id :audio-buffer
+                              1
+                              (fn [id]
+                                (snd "/b_alloc" id size num-channels)
+                                (server-sync uid)))))
            info (buffer-info id)]
-       (with-meta
-         (merge info
-                {:allocated-on-server (atom true)})
-         {:type ::buffer}))))
+
+       (map->Buffer
+        (assoc info
+          :allocated-on-server (atom true))))))
+
+(defrecord BufferFile [id size n-channels rate allocated-on-server path])

 (defn buffer-alloc-read
   "Synchronously allocates a buffer with the same number of channels as the
@@ -81,10 +89,14 @@
            (when (every? zero? [size rate n-channels])
              (free-id :audio-buffer id)
              (throw (Exception. (str "Unable to read file - perhaps path is not a valid audio file: " path))))
-           (with-meta
-             (merge info
-                    {:allocated-on-server (atom true)})
-             {:type ::file-buffer}))))))
+
+           (map->BufferFile
+            (assoc info
+              :allocated-on-server (atom true))))))))
+
+(derive BufferInfo ::buffer-info)
+(derive Buffer     ::buffer)
+(derive BufferFile ::file-buffer)

 (derive ::buffer ::buffer-info)
 (derive ::file-buffer ::buffer)
@@ -234,6 +246,8 @@
                     n-frames start-frame 0)
     :done))

+(defrecord BufferOutStream [id size n-channels rate allocated-on-server path open?])
+
 (defn buffer-stream
   "Returns a buffer-stream which is similar to a regular buffer but may be used
   with the disk-out ugen to stream to a specific file on disk.
@@ -259,19 +273,19 @@
   (let [path    (resolve-tilde-path path)
         f-ext   (file-extension path)
         arg-map (merge {:n-chans 2
-                         :size 65536
-                         :header (or f-ext "wav")
-                         :samples "int16"}
-                        (apply hash-map args))
+                        :size 65536
+                        :header (or f-ext "wav")
+                        :samples "int16"}
+                       (apply hash-map args))
         {:keys [n-chans size header samples]} arg-map
         buf (buffer size n-chans)]
     (snd "/b_write" (:id buf) path header samples -1 0 1)
-    (with-meta
-      (assoc buf
-        :path path
-        :open? (atom true))
-      {:type ::buffer-out-stream})))
-
+    (map->BufferOutStream
+     (assoc buf
+       :path path
+       :open? (atom true)))))
+
+(derive BufferOutStream ::buffer-out-stream)
 (derive ::buffer-out-stream ::file-buffer)

 (defn buffer-out-stream?
@@ -290,6 +304,8 @@
   (buffer-free buf-stream)
   (reset! (:open? buf-stream) false)
   (:path buf-stream))
+
+(defrecord BufferInStream [id size n-channels rate allocated-on-server path open?])

 (defn buffer-cue
   "Returns a buffer-cue which is similar to a regular buffer but may be used
@@ -314,13 +330,13 @@
         {:keys [start size]} arg-map
         buf (buffer-alloc-read path start size)]
     (snd "/b_read" (:id buf) path start -1 0 1)
-    (with-meta
+    (map->BufferInStream
       (assoc buf
         :path path
         :start start
-        :open? (atom true))
-      {:type ::buffer-in-stream})))
-
+        :open? (atom true)))))
+
+(derive BufferInStream ::buffer-in-stream)
 (derive ::buffer-in-stream ::file-buffer)

 (defn buffer-in-stream?


(PDB-5022) jdbc/query: remove incorrect :arglists

--- src/puppetlabs/puppetdb/jdbc.clj
+++ src/puppetlabs/puppetdb/jdbc.clj
@@ -213,15 +213,6 @@

 (defn query
   "Calls clojure.jdbc/query after adding (jdbc/db) as the first argument."
-  {:arglists '([sql-and-params
-                :as-arrays? false :identifiers clojure.string/lower-case
-                :result-set-fn doall :row-fn identity]
-               [sql-and-params
-                :as-arrays? true :identifiers clojure.string/lower-case
-                :result-set-fn vec :row-fn identity]
-               [[sql-string & params]]
-               [[stmt & params]]
-               [[option-map sql-string & params]])}
   [sql-params & remainder]
   (apply sql/query *db* sql-params remainder))


Add test-all-ns, reformat protocol methods

--- src/main/clojure/com/stuartsierra/lazytest.clj
+++ src/main/clojure/com/stuartsierra/lazytest.clj
@@ -65,8 +65,9 @@
   (invoke [] (run-test-case this))
   (invoke [strategy] (run-test-case this strategy))
   (invoke [strategy active] (run-test-case this strategy active))
-  TestInvokable (invoke-test [states strategy active]
-                             (run-test-case this strategy active)))
+  TestInvokable
+  (invoke-test [states strategy active]
+    (run-test-case this strategy active)))

 ;; TestResult represents the result of executing a TestCase.  source
 ;; is the TestCase.  children is a sequence of results from child
@@ -79,10 +80,6 @@
 ;; source is the TestCase, error is the java.lang.Throwable.
 (deftype TestThrown [source error]
   TestSuccess (success? [] false))
-
-;; TODO: fix source field: should be the assertion (optionally
-;; compiled as a fn) with :doc, :name, :line, :file metadata, not the
-;; source form of the assertion.

 ;; AssertionPassed is returned by an Assertion whose expression
 ;; evaluates logical true.
@@ -287,10 +284,11 @@
         (:test (meta v))

         (fn? (:test (meta v)))
-        (with-meta (TestCase [] [(:test (meta v))])
-          {:doc "Var :test metadata function."
-           :name (:name (meta v))
-           :ns (:ns (meta v))})
+        (TestCase [] [(:test (meta v))]
+                  {:doc "Var :test metadata function."
+                   :name (:name (meta v))
+                   :ns (:ns (meta v))}
+                  nil)

         :else nil))

@@ -303,21 +301,28 @@
   "Returns a TestCase for a Namespace.  If the namespace's :test
   metadata is a TestCase, returns that.  If the namespace's :test
   metadata is another namespace, recurses on that.  If the
-  namespace's :test metadata is a function, generates a TestCase with
-  an assertion that calls the function.  If none of these are true,
-  returns nil."  [n]
-  (cond (= ::TestCase (type (:test (meta n))))
-        (:test (meta n))
-
-        (instance? clojure.lang.Namespace (:test (meta n)))
-        (ns-test-case (:test (meta n)))
-
-        (fn? (:test (meta n)))
-        (with-meta (TestCase [] [(:test (meta n))])
-          {:doc "Namespace :test metadata function."
-           :name (ns-name n)})
-
-        :else nil))
+  namespace's :test metadata is a symbol, require's that namespace and
+  recurses.  If the namespace's :test metadata is a function,
+  generates a TestCase with an assertion that calls the function.  If
+  none of these are true, returns nil."  [n]
+  (let [t (:test (meta n))]
+    (cond (= ::TestCase (type t))
+          t
+
+          (instance? clojure.lang.Namespace t)
+          (ns-test-case t)
+
+          (symbol? t)
+          (do (require t)
+              (ns-test-case (the-ns t)))
+
+          (fn? t)
+          (TestCase [] [t]
+                    {:doc "Namespace :test metadata function."
+                     :name (ns-name n)}
+                    nil)
+
+          :else nil)))

 (defn test-ns
   "Finds and runs a TestCase for the namespace."
@@ -327,3 +332,11 @@
 (extend ::TestCase Testable {:run-tests run-test-case})
 (extend clojure.lang.Var Testable {:run-tests test-var})
 (extend clojure.lang.Namespace Testable {:run-tests test-ns})
+
+(defn all-ns-test-case
+  "Returns a TestCase for all Namespaces."
+  []
+  (TestCase [] (vec (map (fn [n] (ns-test-case n)) (all-ns)))
+            {:name 'all-ns-tests,
+             :doc "Generated by all-ns-test-case"}
+            nil))


CLJS-1433: cljs.js/*eval-fn* passed nil :cache

Need to deref the env/*compiler* atom

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -690,7 +690,7 @@
                                     :name   name
                                     :path   (ns->relpath name)
                                     :source js-source
-                                    :cache  (get-in env/*compiler* [::ana/namespaces name])}
+                                    :cache  (get-in @env/*compiler* [::ana/namespaces name])}
                          complete  (fn [res]
                                      (if (:error res)
                                        (cb res)


fix rn code-split not working in dev builds

--- src/main/shadow/build/targets/react_native.clj
+++ src/main/shadow/build/targets/react_native.clj
@@ -50,27 +50,28 @@
       [:compiler-options :closure-defines 'shadow.cljs.devtools.client.env/server-host]
       (str server-addr))))

-(defn normalize-chunk-def [x]
-  (cond
-    (qualified-symbol? x)
-    {:depends-on #{:index}
-     :entries [(output/ns-only x)]
-     :append-js (str "\nmodule.exports = " (cljs-comp/munge x) ";\n")}
-
-    (and (map? x)
-         (qualified-symbol? (:exports x)))
-    (-> x
-        (update :depends-on util/set-conj :index)
-        (assoc :entries [(output/ns-only x)])
-        (update :append-js str "\nmodule.exports = " (cljs-comp/munge x) ";\n"))
-
-    :else
-    (throw (ex-info "invalid :chunks config" {:x x}))))
-
-(defn add-chunk-modules [modules chunks]
+(defn normalize-chunk-def [mode x]
+  (let [append-key (if (= :dev mode) :append :append-js)]
+    (cond
+      (qualified-symbol? x)
+      {:depends-on #{:index}
+       :entries [(output/ns-only x)]
+       append-key (str "\nmodule.exports = " (cljs-comp/munge x) ";\n")}
+
+      (and (map? x)
+           (qualified-symbol? (:exports x)))
+      (-> x
+          (update :depends-on util/set-conj :index)
+          (assoc :entries [(output/ns-only x)])
+          (update append-key str "\nmodule.exports = " (cljs-comp/munge x) ";\n"))
+
+      :else
+      (throw (ex-info "invalid :chunks config" {:x x})))))
+
+(defn add-chunk-modules [modules mode chunks]
   (reduce-kv
     (fn [modules chunk-id chunk-def]
-      (let [chunk-def (normalize-chunk-def chunk-def)]
+      (let [chunk-def (normalize-chunk-def mode chunk-def)]
         (assoc modules chunk-id chunk-def)))
     modules
     chunks))
@@ -91,7 +92,7 @@
             (cond->
               (seq chunks)
               (-> (update :index assoc :prepend "var $APP = global.$APP = {};\n")
-                  (add-chunk-modules chunks))))]
+                  (add-chunk-modules mode chunks))))]

     (io/make-parents output-file)


Add follow-up media type.

Add follow-up media type.

--- src/oc/storage/representations/media_types.clj
+++ src/oc/storage/representations/media_types.clj
@@ -20,6 +20,7 @@
 (def entry-collection-media-type "application/vnd.collection+vnd.open-company.entry+json;version=1")
 (def share-request-media-type "application/vnd.open-company.share-request.v1+json")
 (def revert-request-media-type "application/vnd.open-company.revert-request.v1+json")
+(def follow-up-media-type "application/vnd.open-company.follow-up.v1+json")

 ;; Interaction media types
 (def comment-media-type "application/vnd.open-company.comment.v1+json")


Validate peer-config in log component

Validate peer-config in log component

--- src/onyx/log/zookeeper.clj
+++ src/onyx/log/zookeeper.clj
@@ -8,7 +8,9 @@
             [onyx.compression.nippy :refer [zookeeper-compress zookeeper-decompress]]
             [onyx.log.replica :as replica]
             [onyx.monitoring.measurements :refer [measure-latency]]
-            [onyx.log.entry :refer [create-log-entry]])
+            [onyx.log.entry :refer [create-log-entry]]
+            [onyx.schema :as os]
+            [schema.core :as s])
   (:import [org.apache.curator.test TestingServer]
            [org.apache.log4j BasicConfigurator]
            [org.apache.zookeeper KeeperException$NoNodeException KeeperException$NodeExistsException]))
@@ -16,6 +18,7 @@
 (def root-path "/onyx")

 (defn prefix-path [prefix]
+  (assert prefix "Prefix must be supplied. Has :onyx/tenancy-id been supplied?")
   (str root-path "/" prefix))

 (defn pulse-path [prefix]
@@ -96,6 +99,7 @@
   component/Lifecycle

   (start [component]
+    (s/validate os/PeerClientConfig config)
     (taoensso.timbre/info "Starting ZooKeeper" (if (:zookeeper/server? config) "server" "client connection. If Onyx hangs here it may indicate a difficulty connecting to ZooKeeper."))
     (BasicConfigurator/configure)
     (let [onyx-id (:onyx/tenancy-id config)


* Seperate compute servers and floating ips objects * Waiting for stop to finish * nicer renaming for let values

--- src/openstack/provider.clj
+++ src/openstack/provider.clj
@@ -14,7 +14,7 @@
     [slingshot.slingshot :refer  [throw+]]
     [celestial.persistency.systems :as s]
     [celestial.common :refer (import-logging)]
-    [openstack.networking :refer (first-ip update-ip assoc-floating dissoc-ip)]
+    [openstack.networking :refer (first-ip update-ip assoc-floating dissoc-floating)]
     [clojure.java.data :refer [from-java]]
     [celestial.provider :refer (wait-for wait-for-ssh)]
     [openstack.validations :refer (provider-validation)]
@@ -41,15 +41,18 @@
    [nets]
   (mapv #(hypervisor :openstack :networks %) nets))

-(defn servers [tenant]
+(defn compute [tenant]
   (let [{:keys [username password endpoint]} (hypervisor :openstack)]
     (-> (OSFactory/builder)
         (.endpoint endpoint)
         (.credentials username password)
         (.tenantName tenant)
         (.authenticate)
-        (.compute)
-        (.servers))))
+        (.compute))))
+
+(defn servers [tenant] (-> (compute tenant) (.servers)))
+
+(defn floating-ips [tenant] (-> (compute tenant) (.floatingIps)))

 (defn model [{:keys [machine openstack] :as spec}]
   (-> (Builders/server)
@@ -60,9 +63,9 @@
     (.networks (openstack :network-ids))
     (.build)))

-(defn wait-for-ip  [compute id network timeout]
+(defn wait-for-ip  [servers' id network timeout]
   "Wait for an ip to be avilable"
-  (wait-for {:timeout timeout} #(not (nil? (first-ip (.get compute id) network)))
+  (wait-for {:timeout timeout} #(not (nil? (first-ip (.get servers' id) network)))
     {:type ::openstack:status-failed :timeout timeout}
       "Timed out on waiting for ip to be available"))

@@ -71,8 +74,15 @@
 (defn wait-for-start [this timeout]
   "Wait for an ip to be avilable"
   (wait-for {:timeout timeout} #(running? this)
-    {:type ::openstack:status-failed :timeout timeout}
+    {:type ::openstack:start-failed :timeout timeout}
       "Timed out on waiting for ip to be available"))
+
+(defn wait-for-stop [this timeout]
+  "Wait for an ip to be avilable"
+  (wait-for {:timeout timeout} #(not (running? this))
+    {:type ::openstack:stop-failed :timeout timeout}
+      "Timed out on waiting for ip to be available"))
+

 (defn system-val
   "grabbing instance id of spec"
@@ -98,19 +108,17 @@
   [(provider-validation spec)]
   Vm
   (create [this]
-    (let [compute (servers tenant)
-          server (.boot compute (model spec))
-          id (:id (from-java server))
-          network (first (get-in spec [:openstack :networks]))]
+    (let [servers' (servers tenant) server (.boot servers' (model spec))
+          id (:id (from-java server)) network (first (get-in spec [:openstack :networks]))]
        (update-id spec id)
        (debug "waiting for" id "to get an ip on" network)
-       (wait-for-ip compute id network [5 :minute])
-       (let [ip (first-ip (.get compute id) network)]
+       (wait-for-ip servers' id network [5 :minute])
+       (let [ip (first-ip (.get servers' id) network)]
          (update-ip spec ip)
          (debug "waiting for ssh to be available at" ip)
          (wait-for-ssh ip (get-in spec [:machine :user]) [5 :minute]))
-       (when-let [floating (get-in spec [:openstack :floating-ip])]
-         (assoc-floating compute server floating))
+       (when-let [ip (get-in spec [:openstack :floating-ip])]
+         (assoc-floating (floating-ips tenant) server ip))
        this))

   (start [this]
@@ -125,15 +133,16 @@
   (delete [this]
      (with-instance-id
        (debug "deleting" instance-id)
-       (let [compute (servers tenant)]
-         (when-let [floating (get-in spec [:openstack :floating-ip])]
-           (dissoc-ip compute (.get compute instance-id) floating))
-         (.delete compute instance-id))))
+       (let [servers' (servers tenant)]
+         (when-let [ip (get-in spec [:openstack :floating-ip])]
+           (dissoc-floating (floating-ips tenant) (.get servers' instance-id) ip))
+         (.delete servers' instance-id))))

   (stop [this]
      (with-instance-id
        (debug "stopping" instance-id )
-       (.action (servers tenant) instance-id Action/STOP)))
+       (.action (servers tenant) instance-id Action/STOP)
+       (wait-for-stop this [5 :minute])))

   (status [this]
      (if-let [instance-id (instance-id* spec)]
@@ -155,13 +164,5 @@
 (defmethod vconstruct :openstack [spec]
   (apply ->Instance (translate spec)))

-(comment
-  (use 'celestial.fixtures.data 'celestial.fixtures.core )
-  (def m (vconstruct redis-openstack))
-  (with-conf local-conf (with-admin (.create m)))
-  (with-admin (with-conf local-conf (.status m)))
-  (clojure.pprint/pprint
-    (ip (from-java (.get (servers "skywind") "9a7e1ceb-cccd-44b9-b1bc-148a39e913c4")) "playtech-int-2"))
-  (.start m)
-  )

+


tune the idea editor animations

tune the idea editor animations

--- src/parinfer/vcr_data.cljs
+++ src/parinfer/vcr_data.cljs
@@ -1050,7 +1050,8 @@
    :recording? false})

 (def idea-nest
-  '{:timescale 2
+  '{:loop-delay 1000
+    :timescale 2
     :changes
     [{:selections ({:anchor {:line 1, :ch 0}, :head {:line 1, :ch 0}}),
       :dt 0}
@@ -1108,7 +1109,8 @@
   )

 (def idea-wide-nest
-  '{:timescale 2
+  '{:loop-delay 1000
+    :timescale 2
     :changes
     [{:change
       {:from {:line 1, :ch 0},
@@ -1121,43 +1123,43 @@
        :to {:line 1, :ch 1},
        :text (" "),
        :origin "+input"},
-      :dt 554}
+      :dt 186}
      {:change
       {:from {:line 1, :ch 2},
        :to {:line 1, :ch 2},
        :text (" "),
        :origin "+input"},
-      :dt 762}
+      :dt 799}
      {:change
       {:from {:line 1, :ch 3},
        :to {:line 1, :ch 3},
        :text (" "),
        :origin "+input"},
-      :dt 203}
+      :dt 212}
      {:change
       {:from {:line 1, :ch 4},
        :to {:line 1, :ch 4},
        :text (" "),
        :origin "+input"},
-      :dt 314}
+      :dt 204}
      {:change
       {:from {:line 1, :ch 5},
        :to {:line 1, :ch 5},
        :text (" "),
        :origin "+input"},
-      :dt 261}
+      :dt 236}
      {:change
       {:from {:line 1, :ch 6},
        :to {:line 1, :ch 6},
        :text (" "),
        :origin "+input"},
-      :dt 1022}
+      :dt 754}
      {:change
       {:from {:line 1, :ch 7},
        :to {:line 1, :ch 7},
        :text (" "),
        :origin "+input"},
-      :dt 191}
+      :dt 213}
      {:change
       {:from {:line 1, :ch 8},
        :to {:line 1, :ch 8},
@@ -1169,68 +1171,71 @@
        :to {:line 1, :ch 9},
        :text (""),
        :origin "+delete"},
-      :dt 1697}
+      :dt 1270}
      {:change
       {:from {:line 1, :ch 7},
        :to {:line 1, :ch 8},
        :text (""),
        :origin "+delete"},
-      :dt 203}
+      :dt 225}
      {:change
       {:from {:line 1, :ch 6},
        :to {:line 1, :ch 7},
        :text (""),
        :origin "+delete"},
-      :dt 224}
+      :dt 230}
      {:change
       {:from {:line 1, :ch 5},
        :to {:line 1, :ch 6},
        :text (""),
        :origin "+delete"},
-      :dt 1294}
+      :dt 749}
      {:change
       {:from {:line 1, :ch 4},
        :to {:line 1, :ch 5},
        :text (""),
        :origin "+delete"},
-      :dt 236}
+      :dt 225}
      {:change
       {:from {:line 1, :ch 3},
        :to {:line 1, :ch 4},
        :text (""),
        :origin "+delete"},
-      :dt 226}
+      :dt 217}
      {:change
       {:from {:line 1, :ch 2},
        :to {:line 1, :ch 3},
        :text (""),
        :origin "+delete"},
-      :dt 258}
+      :dt 266}
      {:change
       {:from {:line 1, :ch 1},
        :to {:line 1, :ch 2},
        :text (""),
        :origin "+delete"},
-      :dt 1227}
+      :dt 1006}
 {:change
  {:from {:line 1, :ch 0},
   :to {:line 1, :ch 1},
   :text (""),
   :origin "+delete"},
- :dt 236}],
+ :dt 176}],
 :init-value "(let [m {:foo 1}])\n:bar 2",
-:last-time 1444086232249,
-:recording? false})
+:last-time 1444141621667,
+:recording? false,
+})

 (def idea-deep-nest
   '{:timescale 2
     :changes
-    [{:change
+    [{:selections ({:anchor {:line 3, :ch 9}, :head {:line 3, :ch 9}}),
+      :dt 0}
+     {:change
       {:from {:line 3, :ch 9},
        :to {:line 3, :ch 9},
        :text ("  "),
        :origin "+input"},
-      :dt 0}
+      :dt 1000}
      {:change
       {:from {:line 3, :ch 11},
        :to {:line 3, :ch 11},


thru rm_lm_reportable_prod_keyword

thru rm_lm_reportable_prod_keyword

--- src/pg_demo/table_defs.clj
+++ src/pg_demo/table_defs.clj
@@ -4673,6 +4673,342 @@
               PRIMARY KEY (ENTERPRISE_ID,MEDICAL_DEVICE_INFO_ID)
           ); " }

+    { "rm_lm_medical_status"
+          "CREATE TABLE rm_lm_medical_status (
+              ENTERPRISE_ID numeric NOT NULL,
+              MED_STATUS_ID numeric NOT NULL,
+              SEQ_NUM numeric,
+              LABEL varchar(40) NOT NULL,
+              PROTECTED numeric,
+              DISPLAY numeric,
+              LABEL_J varchar(40),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,MED_STATUS_ID)
+          ); " }
+
+    { "rm_lm_mfr_eval_reason"
+          "CREATE TABLE rm_lm_mfr_eval_reason (
+              ENTERPRISE_ID numeric NOT NULL,
+              MFR_EVAL_ID numeric NOT NULL,
+              MFR_EVAL_REASON varchar(100),
+              DISPLAY numeric,
+              PROTECTED numeric,
+              DELETED timestamp,
+              MFR_EVAL_CODE numeric NOT NULL,
+              MFR_EVAL_REASON_J varchar(100),
+              PRIMARY KEY (ENTERPRISE_ID,MFR_EVAL_ID)
+          ); " }
+
+    { "rm_lm_occupations"
+          "CREATE TABLE rm_lm_occupations (
+              ENTERPRISE_ID numeric NOT NULL,
+              OCCUPATION_ID numeric NOT NULL,
+              OCCUPATION varchar(40) NOT NULL,
+              ICH numeric,
+              OCCUPATION_J varchar(40),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,OCCUPATION_ID)
+          ); " }
+
+    { "rm_lm_pack_units"
+          "CREATE TABLE rm_lm_pack_units (
+              ENTERPRISE_ID numeric NOT NULL,
+              ID numeric NOT NULL,
+              DESCRIPTION varchar(20) NOT NULL,
+              DISPLAY numeric(4),
+              PROTECTED numeric(4),
+              DESCRIPTION_J varchar(20),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,ID)
+          ); " }
+
+    { "rm_lm_pf_ingredients"
+          "CREATE TABLE rm_lm_pf_ingredients (
+              ENTERPRISE_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              FAMILY_ID numeric NOT NULL,
+              INGREDIENT_ID numeric NOT NULL,
+              ACTIVE numeric(4),
+              DELETED timestamp,
+              SORT_ID numeric,
+              PRIMARY KEY (ENTERPRISE_ID,SEQ_NUM)
+          ); " }
+
+    { "rm_lm_pmda_device_clasfication"
+          "CREATE TABLE rm_lm_pmda_device_clasfication (
+              ENTERPRISE_ID numeric NOT NULL,
+              CLASSIFICATION_ID numeric NOT NULL,
+              CLASSIFICATION_TYPE numeric,
+              CLASSIFICATION varchar(50),
+              CLASSIFICATION_J varchar(50),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,CLASSIFICATION_ID)
+          ); " }
+
+    { "rm_lm_product"
+          "CREATE TABLE rm_lm_product (
+              ENTERPRISE_ID numeric NOT NULL,
+              PRODUCT_ID numeric NOT NULL,
+              PROD_NAME varchar(70),
+              FAMILY_ID numeric,
+              FORMULATION_ID numeric,
+              MANUFACTURER_ID numeric,
+              CONCENTRATION varchar(10),
+              CONC_UNIT_ID numeric,
+              INDICATION_ID varchar(50),
+              CODE_DICT numeric,
+              INDICATION_TEXT varchar(250),
+              INTL_BIRTH_DATE timestamp,
+              MODEL_NO varchar(20),
+              DRL_ID varchar(45),
+              DRUG_CODE varchar(20),
+              DELETED timestamp,
+              PROD_GENERIC_NAME text,
+              PROD_GENERIC_NAME_J text,
+              IND_LLT_CODE varchar(50),
+              IND_LLT varchar(250),
+              IND_HLT_CODE varchar(50),
+              IND_HLT varchar(250),
+              IND_HLGT_CODE varchar(50),
+              IND_HLGT varchar(250),
+              IND_SOC_CODE varchar(50),
+              IND_SOC varchar(250),
+              IND_SYN_CODE numeric,
+              IND_CODE_STATUS numeric,
+              MEDICINAL_PROD_ID varchar(10),
+              PROD_NAME_ABBRV varchar(5),
+              DEVICE_CODE varchar(50),
+              PSUR_GROUP_NAME varchar(50),
+              COMMENTS varchar(1000),
+              IND_CODED varchar(250),
+              IND_REPTD varchar(250),
+              DRL_ID_J varchar(45),
+              DRUG_CODE_J varchar(20),
+              DRUG_CODE_TYPE_J numeric,
+              INDICATION_TEXT_J varchar(250),
+              IND_CODE_STATUS_J numeric,
+              IND_HLGT_J varchar(250),
+              IND_HLT_J varchar(250),
+              IND_LLT_CODE_J varchar(50),
+              IND_LLT_J varchar(250),
+              IND_SOC_J varchar(250),
+              PROD_NAME_J varchar(70),
+              IND_SYN_CODE_J numeric,
+              IND_CODED_J varchar(250),
+              IND_REPTD_J varchar(250),
+              DEV_INTL_BIRTH_DATE timestamp,
+              COMMENTS_J varchar(1000),
+              PRIMARY KEY (ENTERPRISE_ID,PRODUCT_ID)
+          ); " }
+
+    { "rm_lm_product_concentrations"
+          "CREATE TABLE rm_lm_product_concentrations (
+              ENTERPRISE_ID numeric NOT NULL,
+              PRODUCT_ID numeric NOT NULL,
+              INGREDIENT_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              CONCENTRATION varchar(10),
+              CONC_UNIT_ID numeric,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,PRODUCT_ID,INGREDIENT_ID,SEQ_NUM)
+          ); " }
+
+    { "rm_lm_product_family"
+          "CREATE TABLE rm_lm_product_family (
+              ENTERPRISE_ID numeric NOT NULL,
+              FAMILY_ID numeric NOT NULL,
+              NAME varchar(40),
+              PRIMARY_VIEW numeric,
+              DELETED timestamp,
+              PRODUCT_GROUP_ID numeric,
+              COMMENTS varchar(1000),
+              SEARCH_EQUATION_NUMBER varchar(10),
+              NAME_J varchar(40),
+              COMMENTS_J varchar(1000),
+              PRIMARY KEY (ENTERPRISE_ID,FAMILY_ID)
+          ); " }
+
+    { "rm_lm_product_group"
+          "CREATE TABLE rm_lm_product_group (
+              ENTERPRISE_ID numeric NOT NULL,
+              PRODUCT_GROUP_ID numeric NOT NULL,
+              NAME varchar(70),
+              DISPLAY numeric,
+              NAME_J varchar(70),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,PRODUCT_GROUP_ID)
+          ); " }
+
+    { "rm_lm_product_lots"
+          "CREATE TABLE rm_lm_product_lots (
+              ENTERPRISE_ID numeric NOT NULL,
+              LOT_ID numeric NOT NULL,
+              PRODUCT_ID numeric NOT NULL,
+              LOT_NO varchar(35),
+              EXT_LOT_ID varchar(50),
+              EXPIRATION_DATE timestamp,
+              EXPIRATION_DATE_RES numeric,
+              EXPIRATION_DATE_PARTIAL varchar(20),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,LOT_ID)
+          ); " }
+
+    { "rm_lm_protocols"
+          "CREATE TABLE rm_lm_protocols (
+              ENTERPRISE_ID numeric NOT NULL,
+              PROTOCOL_ID numeric NOT NULL,
+              PROTOCOL_DESC varchar(40),
+              DELETED timestamp,
+              DISPLAY numeric,
+              PROTOCOL_DESC_J varchar(40),
+              PRIMARY KEY (ENTERPRISE_ID,PROTOCOL_ID)
+          ); " }
+
+    { "rm_lm_purchased_with"
+          "CREATE TABLE rm_lm_purchased_with (
+              ENTERPRISE_ID numeric NOT NULL,
+              PURCHASE_ID numeric NOT NULL,
+              PURCHASE varchar(40),
+              PURCHASE_J varchar(40),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,PURCHASE_ID)
+          ); " }
+
+    { "rm_lm_recipient"
+          "CREATE TABLE rm_lm_recipient (
+              ENTERPRISE_ID numeric NOT NULL,
+              RECIPIENT_ID numeric NOT NULL,
+              NAME varchar(30),
+              TITLE varchar(50),
+              ADDRESS varchar(50),
+              CITY varchar(30),
+              PHONE varchar(15),
+              EMAIL varchar(100),
+              STATE varchar(10),
+              POSTAL_CODE varchar(10),
+              FAX varchar(50),
+              PREFERRED numeric(1),
+              COUNTRY varchar(50),
+              COUNTRY_ID numeric,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,RECIPIENT_ID)
+          ); " }
+
+    { "rm_lm_ref_types"
+          "CREATE TABLE rm_lm_ref_types (
+              ENTERPRISE_ID numeric NOT NULL,
+              REF_TYPE_ID numeric NOT NULL,
+              TYPE_DESC varchar(25) NOT NULL,
+              PROTECTED numeric,
+              DISPLAY numeric,
+              TYPE_DESC_J varchar(25),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,REF_TYPE_ID)
+          ); " }
+
+    { "rm_lm_regulatory_contact"
+          "CREATE TABLE rm_lm_regulatory_contact (
+              ENTERPRISE_ID numeric NOT NULL,
+              AGENCY_ID numeric NOT NULL,
+              AGENCY_NAME varchar(40),
+              REG_NUM varchar(10),
+              CONTACT_NAME varchar(40),
+              TITLE varchar(40),
+              ADDRESS varchar(120),
+              CITY varchar(35),
+              STATE varchar(40),
+              POST_CODE varchar(15),
+              COUNTRY numeric,
+              PHONE varchar(20),
+              FAX varchar(50),
+              EMAIL varchar(100),
+              OFF_LINE numeric,
+              PREF_METHOD numeric,
+              DEPARTMENT varchar(60),
+              FIRST_NAME varchar(35),
+              MIDDLE_NAME varchar(15),
+              TEL_EXT varchar(10),
+              TEL_CONT_CODE varchar(3),
+              FAX_EXT varchar(10),
+              FAX_CONT_CODE varchar(3),
+              MAX_E2B_RPT numeric,
+              VIEW_PRINT_METHOD numeric,
+              RECEIVER_TYPE numeric,
+              SENDER_TYPE numeric,
+              CONT_COUNTRY_ID numeric,
+              CONT_COMPANY_NAME varchar(40),
+              CONT_NAME varchar(40),
+              CONT_TITLE varchar(40),
+              CONT_ADDRESS varchar(120),
+              CONT_CITY varchar(35),
+              CONT_STATE varchar(40),
+              CONT_POSTCODE varchar(15),
+              CONT_PHONE varchar(20),
+              CONT_FAX varchar(50),
+              CONT_DEPARTMENT varchar(60),
+              CONT_FIRST_NAME varchar(35),
+              CONT_MIDDLE_NAME varchar(15),
+              CONT_TEL_EXT varchar(10),
+              CONT_TEL_CONT_CODE varchar(3),
+              CONT_FAX_EXT varchar(10),
+              CONT_FAX_CONT_CODE varchar(3),
+              SENDER_EMAIL varchar(100),
+              FAX_MAIN varchar(50),
+              TERM_SELECTION numeric,
+              FAX_COVER varchar(255),
+              RULE_MARKETED numeric(2) NOT NULL,
+              RULE_INVESTIGATIONAL numeric(2) NOT NULL,
+              REPORTS_PER_EMAIL numeric(10),
+              SINGLE_ATTACHMENT numeric(1),
+              EMAIL_BODY_TYPE numeric(1),
+              DELETED timestamp,
+              CONT_LAB_CODE varchar(30),
+              CONTACT_TYPE numeric(1),
+              AWARE_SELECTION_ID numeric(1),
+              SUSAR_REPORTING numeric,
+              SMTP_FROM_EMAIL varchar(100),
+              SMTP_CC_EMAIL varchar(1000),
+              SMTP_BCC_EMAIL varchar(1000),
+              SMTP_READ_RECEIPT_FLAG numeric,
+              SMTP_DELIVERY_RECEIPT_FLAG numeric,
+              AUTO_ACCEPT_ICSR numeric NOT NULL,
+              TRANSMIT_E2B_ATTACHMENT numeric NOT NULL,
+              SUPPRESS_DUPLICATE_REPORTS numeric,
+              SUPPRESS_LICENSE_TYPE numeric,
+              AUTO_ACCEPT_ICSR_TYPE numeric(1),
+              USE_JPN_AWARE_DATE varchar(1),
+              MULT_RPT_MKT_DRUGS varchar(1),
+              MULT_RPT_INVEST_DRUGS varchar(1),
+              ADJUST_DUE_DT_FOR_HOLIDAYS numeric(1),
+              AGENCY_NAME_J varchar(40),
+              CONT_COMPANY_NAME_J varchar(40),
+              EMAIL_BODY text,
+              FAX_HEADER_J numeric,
+              PRIMARY KEY (ENTERPRISE_ID,AGENCY_ID)
+          ); " }
+
+    { "rm_lm_relation"
+          "CREATE TABLE rm_lm_relation (
+              ENTERPRISE_ID numeric NOT NULL,
+              ID numeric NOT NULL,
+              DESCRIPTION varchar(50),
+              DESCRIPTION_J varchar(50),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,ID)
+          ); " }
+
+    { "rm_lm_reportable_prod_keyword"
+          "CREATE TABLE rm_lm_reportable_prod_keyword (
+              ENTERPRISE_ID numeric NOT NULL,
+              KEYWORD_ID numeric NOT NULL,
+              KEYWORD varchar(100),
+              FAMILY_ID numeric,
+              ACTIVATE numeric(1),
+              PROTECTED numeric(1),
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,KEYWORD_ID)
+          ); " }
+
   ] ))

 (def dummy