this is embarassing, we've been sharing previous state this whole time!

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -425,11 +425,11 @@
                                                  {:mouse-position (cameras/screen->point (:camera current-state) x y)}))])))

 (defmethod post-control-event! :text-layer-edited
-  [browser-state message _ current-state previous-state]
+  [browser-state message _ previous-state current-state]
   (maybe-notify-subscribers! current-state nil nil))

 (defmethod post-control-event! :mouse-moved
-  [browser-state message [x y] current-state previous-state]
+  [browser-state message [x y] previous-state current-state]
   (maybe-notify-subscribers! current-state x y))

 (defn finalize-layer [state]


Revert some previous changes.

Revert some previous changes.

--- src/datoteka/storages/local.clj
+++ src/datoteka/storages/local.clj
@@ -1,4 +1,4 @@
-;; Copyright (c) 2015-2017 Andrey Antukh <niwi@niwi.nz>
+;; Copyright (c) 2015-2019 Andrey Antukh <niwi@niwi.nz>
 ;; All rights reserved.
 ;;
 ;; Redistribution and use in source and binary forms, with or without
@@ -51,19 +51,10 @@
                         {:path (str path)})))
       fullpath)))

-(defn- normalize-filename
-  [^Path path options]
-  (let [transform (:transform-filename options)
-        transform (if (fn? transform) transform identity)
-        parent (fs/parent path)
-        [name ext] (fs/split-ext (fs/name path))]
-    (fs/path parent (str (transform name) ext))))
-
 (defn- save
-  [this base path content]
+  [base path content]
   (let [^Path path (pt/-path path)
-        ^Path fullpath (-> (normalize-path base path)
-                           (normalize-filename (:options this)))]
+        ^Path fullpath (normalize-path base path)]
     (when-not (fs/exists? (.getParent fullpath))
       (fs/create-dir (.getParent fullpath)))
     (loop [iteration nil]
@@ -77,7 +68,7 @@
             (fs/relativize candidate base)))))))

 (defn- delete
-  [this base path]
+  [base path]
   (let [path (->> (pt/-path path)
                   (normalize-path base))]
     (try
@@ -91,21 +82,19 @@
   (let [supplier (reify Supplier (get [_] (func)))]
      (CompletableFuture/supplyAsync supplier executor)))

-
 (defrecord LocalFileSystemBackend [^Path base
                                    ^URI baseuri
-                                   ^ExecutorService executor
-                                   options]
+                                   ^ExecutorService executor]
   pt/IPublicStorage
   (-public-uri [_ path]
     (.resolve baseuri (str path)))

   pt/IStorage
-  (-save [this path content]
-    (submit executor #(save this base path content)))
+  (-save [_ path content]
+    (submit executor #(save base path content)))

-  (-delete [this path]
-    (submit executor #(delete this base path)))
+  (-delete [_ path]
+    (submit executor #(delete base path)))

   (-exists? [this path]
     (try
@@ -142,7 +131,6 @@
   - `:basedir`: a fisical directory on your local machine
   - `:baseuri`: a base uri used for resolve the files
   - `:executor`: an executor instance (optional)
-  - `:transform-filename`: a function responsible to transform filename (optional)
   "
   [{:keys [basedir baseuri executor]
     :or {executor (ForkJoinPool/commonPool)}
@@ -156,5 +144,4 @@
     (when-not (fs/exists? basepath)
       (fs/create-dir basepath))

-    (->LocalFileSystemBackend basepath baseuri executor
-                              (dissoc options :baseuri :basedir :executor))))
+    (->LocalFileSystemBackend basepath baseuri executor)))


Delete unused file.

Delete unused file.

--- src/main/clojure/uk/org/il2ssd/event.clj
+++ src/main/clojure/uk/org/il2ssd/event.clj
@@ -1,20 +0,0 @@
-;;;;
-;;;; Input event handling
-;;;;
-(ns uk.org.il2ssd.event
-    (:require [uk.org.il2ssd.jfx :as jfx])
-    (:import (javafx.application Platform)
-             (javafx.stage WindowEvent)
-             (javafx.scene.input KeyEvent)))
-
-(defn nothing []
-    (jfx/event-handler [_] ()))
-
-(defn close []
-    (jfx/event-handler [windowevent] (do (.consume windowevent)
-                                         (println "Exiting...")
-                                         (Platform/exit))))
-
-(defn enter-command []
-    (jfx/event-handler [keyevent] (if (= (-> keyevent (.getCode) (.getName)) "Enter")
-                                      (println "Enter"))))


GET /api/setup/admin_checklist endpoint :watermelon:

--- src/metabase/api/setup.clj
+++ src/metabase/api/setup.clj
@@ -1,10 +1,12 @@
 (ns metabase.api.setup
-  (:require [compojure.core :refer [defroutes POST]]
+  (:require [compojure.core :refer [defroutes GET POST]]
             (metabase.api [common :refer :all]
                           [database :refer [annotation:DBEngine]])
             (metabase [db :as db]
                       [driver :as driver]
+                      [email :as email]
                       [events :as events])
+            [metabase.integrations.slack :as slack]
             (metabase.models [database :refer [Database]]
                              [session :refer [Session]]
                              [setting :as setting]
@@ -86,4 +88,78 @@
       (catch Throwable e
         (response-invalid :general (.getMessage e))))))

+
+(defn- admin-checklist []
+  (let [has-dbs?           (db/exists? Database)
+        has-dashboards?    (db/exists? 'Dashboard)
+        has-pulses?        (db/exists? 'Pulse)
+        has-labels?        (db/exists? 'Label)
+        has-hidden-tables? (db/exists? 'Table, :visibility_type [:in ["hidden" "technical" "cruft"]])
+        has-metrics?       (db/exists? 'Metric)
+        has-segments?      (db/exists? 'Segment)
+        num-tables         (db/select-one-count 'Table)
+        num-cards          (db/select-one-count 'Card)
+        num-users          (db/select-one-count 'User)]
+    [{:name        "Add a database"
+      :description "TODO - Write something good here"
+      :completed   has-dbs?
+      :triggered   :always}
+     {:name        "Set email credentials"
+      :description "TODO - Write something good here"
+      :completed   (email/email-configured?)
+      :triggered   :always}
+     {:name        "Set slack credentials"
+      :description "TODO - Write something good here"
+      :completed   (slack/slack-configured?)
+      :triggered   :always}
+     {:name        "Invite other users"
+      :description "TODO - Write something good here"
+      :completed   (> num-users 1)
+      :triggered   (or has-dashboards?
+                       has-pulses?
+                       (> num-cards 5))}
+     {:name        "Hide tables"
+      :description "TODO - Write something good here"
+      :completed   has-hidden-tables?
+      :triggered   (> num-tables 20)}
+     {:name        "Organize questions"
+      :description "TODO - Write something good here"
+      :completed   (not has-labels?)
+      :triggered   (> num-cards 30)}
+     {:name        "Create metrics"
+      :description "TODO - Write something good here"
+      :completed   has-metrics?
+      :triggered   (> num-cards 30)}
+     {:name        "Create segments"
+      :description "TODO - Write something good here"
+      :completed   has-segments?
+      :triggered   (> num-cards 30)}
+     {:name        "Create getting started guide"
+      :description "TODO - Write something good here"
+      :completed   false                               ; TODO - how do we determine this?
+      :triggered   (and (> num-cards 10)
+                        (> num-users 5))}]))
+
+(defn- add-next-step-info
+  "Add `is_next_step` key to all the STEPS from `admin-checklist`.
+  The next step if the *first* step where `:triggered` is `true` and `:completed` is `false`."
+  [steps]
+  (loop [acc [], found-next-step? false, [step & more] steps]
+    (if-not step
+      acc
+      (let [is-next-step? (boolean (and (not found-next-step?)
+                                        (:triggered step)
+                                        (not (:completed step))))
+            step          (assoc step :is_next_step is-next-step?)]
+        (recur (conj acc step)
+               (or found-next-step? is-next-step?)
+               more)))))
+
+(defendpoint GET "/admin_checklist"
+  "Return a map of various \"admin checklist\" steps and whether they've been completed. You must be a superuser to see this!"
+  []
+  (check-superuser)
+  (add-next-step-info (admin-checklist)))
+
+
 (define-routes)


clojure.test->midje.

clojure.test->midje.

--- test/elephantdb/cascading/integration_test.clj
+++ test/elephantdb/cascading/integration_test.clj
@@ -1,7 +1,6 @@
 (ns elephantdb.cascading.integration-test
-  (:use clojure.test
-        midje.sweet
-        elephantdb.common.testing
+  (:use midje.sweet
+        elephantdb.test.common
         [clojure.string :only (join)])
   (:require [elephantdb.keyval.testing :as t])
   (:import [cascading.pipe Pipe]
@@ -90,15 +89,16 @@
     (doall (for [wrapper (iterator-seq it)]
              (into [] (.getTuple wrapper))))))

-(deftest connect-test
-  (are [xs]
-       (with-fs-tmp [_ src-tmp sink-tmp]
-         (let [sink (ElephantDBTap. sink-tmp
-                                    (DomainSpec. (JavaBerkDB.) (HashModScheme.) 4)
-                                    (mk-options))]
-           (fill-domain sink xs)))
-       [[1 2] [3 4]]
-       [["key" "val"] ["ham" "burger"]]))
+(tabular
+ (fact "connect-test"
+   (with-fs-tmp [_ src-tmp sink-tmp]
+     (let [sink (ElephantDBTap. sink-tmp
+                                (DomainSpec. (JavaBerkDB.) (HashModScheme.) 4)
+                                (mk-options))]
+       (fill-domain sink ?xs))))
+ ?xs
+ [[1 2] [3 4]]
+ [["key" "val"] ["ham" "burger"]])

 (defn read-etap-with-flow [path]
   (with-fs-tmp [fs tmp-path]
@@ -110,13 +110,12 @@
 (defn check-results
   "TODO: Move over to edb proper."
   [dpath pairs]
-  (is (= (set (read-etap-with-flow dpath))
-         (set pairs))))
+  (fact pairs => (just (read-etap-with-flow dpath) :in-any-order)))

 ;; TODO: Invalid. Doesn't belong in this project; this makes far too
 ;; many assumptions about a thrift interface, etc. All we're concerned
 ;; about here is getting data in and out of edb w/ cascading.
-(deftest test-basic
+(fact "test basic"
   (with-fs-tmp [fs tmp]
     (let [spec (DomainSpec. (JavaBerkDB.) (HashModScheme.) 4)
           sink (ElephantDBTap. tmp spec (mk-options :indexer nil))
@@ -139,7 +138,7 @@
 ;; TODO: Invalid. Doesn't belong in this project; this makes far too
 ;; many assumptions about a thrift interface, etc. All we're concerned
 ;; about here is getting data in and out of edb w/ cascading.
-(deftest test-incremental
+(fact "test-incremental"
   (with-fs-tmp [fs tmp]
     (let [spec (DomainSpec. (JavaBerkDB.) (HashModScheme.) 2)
           sink (ElephantDBTap. tmp spec (mk-options (IdentityIndexer.)))
@@ -157,7 +156,7 @@
       (fill-domain sink data2)
       (check-results tmp data3))))

-(deftest test-source
+(fact "test-source"
   (with-fs-tmp [fs tmp]
     (let [pairs [[(barr 0) (barr 0 2)]
                  [(barr 1) (barr 1 1)]
@@ -174,7 +173,8 @@
                               {:num-shards 6
                                :persistence-factory (JavaBerkDB.)}
                               pairs]
-        (is (t/kv-pairs= pairs (read-etap-with-flow dpath)))))))
+        (fact
+          (t/kv-pairs= pairs (read-etap-with-flow dpath)) => true)))))

 ;; Example of how to do stuff now.
 (def spec
@@ -182,14 +182,14 @@
                (HashModScheme.)
                4))

-(defn populate [idx]
-  (with-open [shard (.createShard spec "/Users/sritchie/Desktop/helper" idx)]
+(defn populate [root idx]
+  (with-open [shard (.createShard spec root idx)]
     (doseq [x (range 1000)]
       (.index shard (KeyValDocument. x 10)))))

 ;; or, you can create a domain store directly:
-(def store
-  (DomainStore. "/Users/sritchie/Desktop/helper"
-                (DomainSpec. (JavaBerkDB.)
-                             (HashModScheme.)
-                             4)))
+(defn store []
+  (with-fs-tmp [_ tmp]
+    (DomainStore. tmp (DomainSpec. (JavaBerkDB.)
+                                   (HashModScheme.)
+                                   4))))


Two new tests: test-minutes-to-seconds and test-seconds-to-ms

--- test/emender_jenkins/job_data_fetcher_test.clj
+++ test/emender_jenkins/job_data_fetcher_test.clj
@@ -77,3 +77,24 @@
     (testing "if the emender-jenkins.job-data-fetcher/run-fetcher-in-thread definition exists."
         (is (callable? 'emender-jenkins.job-data-fetcher/run-fetcher-in-thread))))

+;
+; Function behaviours
+;
+
+(deftest test-minutes-to-seconds
+    "Check the function emender-jenkins.job-data-fetcher/minutes-to-seconds."
+    (testing "the function emender-jenkins.job-data-fetcher/minutes-to-seconds."
+        (are [x y] (= x y)
+               0 (minutes-to-seconds 0)
+              60 (minutes-to-seconds 1)
+             120 (minutes-to-seconds 2)
+            3600 (minutes-to-seconds 60))))
+
+(deftest test-seconds-to-ms
+    "Check the function emender-jenkins.job-data-fetcher/seconds-to-ms."
+    (testing "the function emender-jenkins.job-data-fetcher/seconds-to-ms."
+        (are [x y] (= x y)
+               0 (seconds-to-ms 0)
+            1000 (seconds-to-ms 1)
+            2000 (seconds-to-ms 2))))
+


fix nrepl port getting lost

fix nrepl port getting lost

--- src/main/shadow/cljs/devtools/server.clj
+++ src/main/shadow/cljs/devtools/server.clj
@@ -106,7 +106,8 @@
   (do-shutdown (socket-repl/stop cli-repl))

   (when nrepl
-    (do-shutdown (nrepl)))
+    (let [stop (::stop nrepl)]
+      (do-shutdown (stop))))

   (do-shutdown (undertow/stop (:server http)))

@@ -237,7 +238,7 @@
                 (nrepl-start (:nrepl config))]

             ;; return a generic stop fn
-            #(nrepl-stop server))
+            (assoc server ::stop #(nrepl-stop server)))
           (catch Exception e
             (log/warn e "failed to start nrepl server")
             nil))


Name node correctly

Name node correctly

--- src/squelch/nodes/script_processor.cljs
+++ src/squelch/nodes/script_processor.cljs
@@ -8,8 +8,8 @@
   "Read only.
   Returns an integer representing both the input and output buffer size. It's
   value can be a power of 2 value in the range 256–16384."
-  [buffer-source]
-  (.-bufferSize buffer-source))
+  [processor]
+  (.-bufferSize processor))

 ; ---------------
 ; Event handlers:
@@ -19,9 +19,9 @@
   "Represents the EventHandler to be called. Instead of receiving the raw audio
   event the function receives input and output audio buffers. The signature of
   the handler should be [input-buffer output-buffer]."
-  [buffer-source audio-process-fn]
+  [processor audio-process-fn]
   (let [process-proxy (fn [audio-event]
                         (let [input-buffer (.-inputBuffer audio-event)
                               output-buffer (.-outputBuffer audio-event)]
                           (audio-process-fn input-buffer output-buffer)))]
-    (set! (.-onaudioprocess buffer-source) process-proxy)))
+    (set! (.-onaudioprocess processor) process-proxy)))


Refactor: stepdown rule

Refactor: stepdown rule

--- src/layzee/adapters/web/api.clj
+++ src/layzee/adapters/web/api.clj
@@ -2,7 +2,8 @@
   (:require [clojure.data.json :as json]
             [layzee.adapters.twitter.search :refer :all :as twitter]
             [layzee.adapters.settings :as settings]
-            [layzee.use-cases.lazy-web :as lazy-web]))
+            [layzee.use-cases.lazy-web :as lazy-web]
+            [layzee.adapters.twitter.replies :as replies]))

 (def content-type-plain-text {"Content-Type" "text/plain"})
 (def content-type-json {"Content-Type" "application/json"})
@@ -23,9 +24,14 @@
   (fn [opts]
     (twitter/lazy-web settings/oauth-credential opts)))

-(defn- xxx[]
+;;(replies/to {:id "636840679272873984" :screen-name "iamkey"})
+
+(defn- search[]
+  (lazy-web/run { :search-adapter-fn lazy-web-search }))
+
+(defn- reply-core[]
   (try
-   (let [reply (lazy-web/run { :search-adapter-fn lazy-web-search })]
+   (let [reply (search)]
      (ok { "X-Timestamp" (str (:timestamp reply))} (:result reply)))
    (catch Exception e (err (str "caught exception: " (.getMessage e))))))

@@ -48,5 +54,5 @@
   ([request]
      (reply request {}))
   ([request opts]
-     (xxx)))
+     (reply-core)))


RS | #64 | Use html-content in project-status page-content

--- src/objective8/templates/project_status.clj
+++ src/objective8/templates/project_status.clj
@@ -17,4 +17,4 @@
                       [:.l8n-project-status-heading] (html/content (translations :project-status/page-title))

                       [:.l8n-project-status-lede] (html/content (translations :project-status/page-intro))
-                      [:.l8n-project-status-detail] (html/content (translations :project-status/page-content)))))))
+                      [:.l8n-project-status-detail] (html/html-content (translations :project-status/page-content)))))))


(maint) trs a few more strings

(maint) trs a few more strings

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -138,7 +138,7 @@
 (defn gc-packages! [ttl db]
   {:pre [(map? db)]}
   (try
-    (kitchensink/demarcate "package gc"
+    (kitchensink/demarcate (trs "package gc")
       (jdbc/with-transacted-connection db
         (scf-store/delete-unassociated-packages!)))
     (catch Exception e
@@ -152,7 +152,7 @@
   {:pre [(map? db)]}
   (try
     (kitchensink/demarcate
-      "database garbage collection"
+      (trs "database garbage collection")
       (scf-store/garbage-collect! db))
     (catch Exception e
       (log/error e (trs "Error during garbage collection")))))


add wavetable format converter

add wavetable format converter

--- src/overtone/sc/buffer.clj
+++ src/overtone/sc/buffer.clj
@@ -185,3 +185,25 @@
 (defn num-frames
   [buf]
   (:size  buf))
+
+(defn data->wavetable
+  "Convert a sequence of floats into wavetable format. Result will be twice the
+  size of source data. Length of ource data must be a power of 2 for SC
+  compatability."
+  [data]
+  (let [v   (vec data)
+        cnt (count v)
+        res (float-array (* 2 cnt))]
+    (dorun
+     (map (fn [idx]
+           (let [a (get v idx)
+                 b (get v (inc idx))
+                 r-idx (* 2 idx)]
+             (aset-float res r-idx (-  (* 2 a) b))
+             (aset-float res (inc r-idx) (- b a))))
+         (range (dec cnt))))
+    (let [a (get v (dec cnt))
+          b (get v 0)]
+      (aset-float res (* 2 (dec cnt)) (- (* 2 a) b))
+      (aset-float res (inc (* 2 (dec cnt))) (- b a)))
+    (seq res)))


fix bug in queue-message-batch (remove bad/broken plubming.core/?> in new plumbing.core)

--- src/polismath/conv_man.clj
+++ src/polismath/conv_man.clj
@@ -80,6 +80,7 @@
    ;; Note: we let all other key-value pairs pass through
    s/Keyword            s/Any})

+;; Should rename this not to conflict with clojure.core/update... poor form
 (defn update
   "This function is what actually gets sent to the conv-actor. In addition to the conversation and vote batches
   up in the channel, we also take an error-callback. Eventually we'll want to pass opts through here as well."
@@ -304,9 +305,15 @@
               {:as split-msgs :keys [votes moderation]} (split-batches msgs)
               error-handler (build-update-error-handler conv-man message-chan conv)
               _ (log/info "About to run updaters")
-              conv (-> conv
-                       (pc/?> moderation conv/mod-update moderation)
-                       (pc/?> votes (partial update conv-man) votes error-handler))]
+              ;; TODO Oh... is this how we're failing to get moderation affecting repness? We're presently only updating mongo
+              ;; (via `update`) if there are also votes. (see below)
+              conv (if moderation
+                     (conv/mod-update conv moderation)
+                     conv)
+              ;; Should extracct the stateful bits here till the very end, so even if there are just mods it updates
+              conv (if votes
+                     (update conv-man conv votes error-handler)
+                     conv)]
           (log/info "Completed computing conversation zid:" zid)
           (swap! conversations assoc-in [zid :conv] conv)
           (doseq [[k f] @listeners] (try (f conv) (catch Exception e (log/error "Listener error") (.printStackTrace e))))


Remove comments.

Remove comments.

--- src/oc/storage/db/common.clj
+++ src/oc/storage/db/common.clj
@@ -39,7 +39,6 @@
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
-           ;; Merge in last-activity-at, last-seen-at and sort-value
         (r/merge query (r/fn [post-row]
            (let [sort-field (r/default (r/get-field post-row :published-at)
                                        (r/get-field post-row :created-at))
@@ -96,7 +95,6 @@
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
-           ;; Merge in last-activity-at, last-seen-at and sort-value
         (r/merge query (r/fn [post-row]
           (let [sort-field (-> (r/get-field post-row [:bookmarks])
                               (r/filter {:user-id user-id})
@@ -156,7 +154,6 @@
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
-           ;; Merge in last-activity-at, last-seen-at and sort-value
         (r/merge query (r/fn [post-row]
            (let [last-activity-at (-> (r/table relation-table-name)
                                        (r/get-all [[(r/get-field post-row :uuid) true]] {:index :resource-uuid-comment})
@@ -230,7 +227,6 @@
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
-           ;; Merge in last-activity-at, last-seen-at and sort-value
         (r/merge query (r/fn [post-row]
          (let [can-pin-to-container? (r/and (r/default (r/get-field post-row [:pins fixed-container-id]) nil)
                                              (r/or (r/ne container-id config/seen-home-container-id)
@@ -310,7 +306,6 @@
     (db-common/with-timeout db-common/default-timeout
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
-           ;; Merge in last-activity-at, last-seen-at and sort-value
         (r/merge query (r/fn [post-row]
           {;; The real value used for the sort
            :sort-value (r-millis (r/get-field post-row :published-at))}))


Add token symbol to balance load fail error message

Signed-off-by: Pedro Pombeiro <f8c34e1c5d363d76a4b9e8313641f62c1029c3e7@users.noreply.github.com>

--- src/status_im/ui/screens/wallet/events.cljs
+++ src/status_im/ui/screens/wallet/events.cljs
@@ -67,7 +67,7 @@
                            :contract   contract
                            :account-id account-id
                            :on-success #(re-frame/dispatch [success-event symbol %])
-                           :on-error   #(re-frame/dispatch [error-event %])})))))
+                           :on-error   #(re-frame/dispatch [error-event symbol %])})))))

 (reg-fx
  :get-transactions
@@ -211,8 +211,8 @@

 (handlers/register-handler-db
  :update-token-balance-fail
- (fn [db [_ err]]
-   (log/debug "Unable to get token balance: " err)
+ (fn [db [_ symbol err]]
+   (log/debug "Unable to get token " symbol "balance: " err)
    (-> db
        (assoc-error-message :balance-update err)
        (assoc-in [:wallet :balance-loading?] false))))


better logs

better logs

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -213,21 +213,27 @@
   [fct-name arg-list arg-values]
   (str
     "Entering the function " fct-name " with args "
-    (mapv vector arg-list arg-values)))
+    (vec (mapcat vector arg-list arg-values))))
+
+(defn compile-log-expression
+  [form bindings]
+  (let [fct-name (-> form first str)]
+    `(println (log-enter-message ~fct-name (quote ~bindings) ~bindings))
+    ))

 (defmacro defn-log
   [name bindings body]
-  (let [fct-name (-> &form first str)]
+  (let [log-stmt (compile-log-expression &form bindings)]
     `(defn ~name
        ~bindings
-       (println (log-enter-message ~fct-name (quote ~bindings) ~bindings))
+       ~log-stmt
        ~body)))

 (defn-log add-with-log
   [a b]
   (+ a b))

-(defn test-add-log
+(defn test-add-with-log
   []
   (add-with-log 1 2))


add log based on compile time options

add log based on compile time options

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -230,10 +230,33 @@
   (reset! logger default-logger))

 ;; --------------------------------------------------------
-;; Example 4-b: Adding logs based on compile time option (no overhead)
-;; --------------------------------------------------------
-
-;; TODO
+;; Example 4-c: Adding logs based on compile time option (no overhead)
+;; --------------------------------------------------------
+
+(defn logger-on []
+  ;; The thing here, is that we could read a config file
+  false)
+
+(defmacro defn-log-3
+  [name bindings body]
+  (if (logger-on)
+    `(defn ~name
+       ~bindings
+       (if-let [log-fct# @logger]
+         (log-fct# "Entering the function with args:" ~@bindings))
+       ~body)
+    `(defn ~name
+       ~bindings
+       ~body)))
+
+(defn-log-3 add-log-3
+  [a b]
+  (+ a b))
+
+(defn test-add-log-3
+  []
+  (reset! logger default-logger)
+  (println (add-log-3 1 2)))

 ;; --------------------------------------------------------
 ;; Example 5: Generating some code based on data structure
@@ -251,8 +274,8 @@
     (let [r1 (* h h)]
       (if (> r1 1)
         (let [r2 (* r1 2)]
-          (recur ...)) ;; with accumulatin
-        (recur ...) ;; no accumulation
+          (recur ...))                                      ;; with accumulatin
+        (recur ...)                                         ;; no accumulation
         )))


4clojure:: impl the find-perf-numbers? predicate + WIP: power-set function

--- src/clojure_learning/4clojure-exercises.clj
+++ src/clojure_learning/4clojure-exercises.clj
@@ -2364,3 +2364,104 @@
   (let [xs (map #(Integer. %) (clojure.string/split s #","))
         p? (fn [x] (some #(= x (* % %)) (range 2 x)))]
     (clojure.string/join "," (filter p? xs))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Perfect Numbers
+;; Difficulty:	Medium
+;; A number is "perfect" if the sum of its divisors equal the number itself. 6 is a perfect number because 1+2+3=6
+;; (= (__ 6) true)
+;; (= (__ 7) false)
+;; (= (__ 496) true)
+;; 1) find divisors of a number, including 1. 2) apply sum of them 3) check reduced sum with the number itself
+(defn find-divisors
+  [x]
+  (let [possible-divs (take (quot x 2) (iterate inc 1))]
+    (filter (fn [each] (zero? (rem x each))) possible-divs)))
+
+(find-divisors 6) ;; (1 2 3)
+(find-divisors 11) ;; (1)
+(find-divisors 10) ;; (1 2 5)
+(quot 13 2) ;; 6
+
+(defn perf-number?
+  [x]
+  (letfn [(find-divisors [x]
+            (let [possible-divs (take (quot x 2) (iterate inc 1))]
+              (filter #(zero? (rem x %)) possible-divs)))]
+    (= x (reduce + (find-divisors x)))))
+
+(perf-number? 6) ;; true
+(perf-number? 7) ;; false
+(perf-number? 496) ;; true
+
+;;;;;;;;;;;;;;;;;;;;;;;;
+;; Power Set
+;; Difficulty:	Medium
+;; Topics:	set-theory
+;; Write a function which generates the power set of a given set.
+;; The power set of a set x is the set of all subsets of x, including the empty set and x itself.
+;; (= (__ #{1 :a}) #{#{1 :a} #{:a} #{} #{1}})
+;; (= (__ #{1 2 3})
+;;    #{#{} #{1} #{2} #{3} #{1 2} #{1 3} #{2 3} #{1 2 3}}
+;; 1) build the binary representation of all the possible numbers: 2 power(count set)
+;; 2) bind: x y z -> to 0 1 1; whereas x = 0, y = z = 1 -> #{y z} -> yields one set
+(defn binary-representation
+  [exp]
+  (letfn [(left-padding-seq
+            [how-many padded]
+             (take how-many (lazy-cat (reverse (seq padded)) (repeat how-many 0))))
+          (to-binary
+             [x]
+             (map #(Integer/valueOf (str %)) (seq (Integer/toBinaryString x))))
+          (gen-bit-combinations
+             [x]
+             (let [bin-val (Math/pow 2 exp)]
+                (map
+                   (fn [x] (->> x
+                               to-binary
+                               (left-padding-seq exp)))
+                   (range 1 (inc bin-val)))))]
+
+    (gen-bit-combinations exp)))
+
+(binary-representation 3)
+;; (1 0 0) (0 1 0) (1 1 0) (0 0 1) (1 0 1) (0 1 1) (1 1 1) (0 0 0)
+
+(binary-representation 2)
+;; ((1 0) (0 1) (1 1) (0 0))
+
+(count (binary-representation 10)) ;; 1024 -> OK 2 power 10 -> 1024
+
+;; stepping fw to how to replace the actual positional-1-s with the actual bound values
+;; (1 0 1) -> (:a 0 :b)
+;; Step2:
+(defn assoc-entries
+  [x-set]
+  (letfn [(left-padding-seq
+            [how-many padded]
+             (take how-many (lazy-cat (reverse (seq padded)) (repeat how-many 0))))
+          (to-binary
+             [x]
+             (map #(Integer/valueOf (str %)) (seq (Integer/toBinaryString x))))
+          (gen-bit-combinations
+             [x]
+             (let [bin-val (Math/pow 2 (count x-set))]
+                (map
+                   (fn [x] (->> x
+                               to-binary
+                               (left-padding-seq (count x-set))))
+                   (range 1 (inc bin-val)))))
+          (map-to-vals
+             [x-set]
+             (map (fn [bit-pair]
+                    (apply hash-map (interleave (seq x-set) bit-pair)))
+                  (gen-bit-combinations (count x-set))))]
+    (map-to-vals x-set)
+    ))
+
+(assoc-entries #{:a :b :c})
+;; {:c 1, :b 0, :a 0}
+;; {:c 0, :b 1, :a 0}
+;; {:c 1, :b 1, :a 0}
+;; {:c 0, :b 0, :a 1} .....
+;; next step: filter 0-keys


Added cascade delete.

Added cascade delete.

--- src/cmr/graph/queries/neo4j/collections.clj
+++ src/cmr/graph/queries/neo4j/collections.clj
@@ -4,6 +4,8 @@

 (def get-all "MATCH (collection:Collection) RETURN collection;")
 (def delete-all "MATCH (collection:Collection) DELETE collection;")
+(def delete-all-cascade "MATCH (collection:Collection) DETATCH DELETE collection;")
+
 (defn get-urls-by-concept-id
   [concept-id]
   (format "match (c:Collection)-[:HAS]->(u:URL) where c.ConceptId='%s' return u.Href;"


Moved endpoints under an /api/v1 route context.

--- src/org/ocremix/api/core.clj
+++ src/org/ocremix/api/core.clj
@@ -20,5 +20,7 @@
       wrap-params))

 (def app
-  (site-handler routes/api-routes))
+  (site-handler
+   (context "/api/v1" []
+            routes/api-routes)))


remove weighted-bins and choose-weighted in pitch.clj - we now have weighted-choose in chance.clj

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -438,67 +438,9 @@
      (case tuning
            :equal-tempered (nth-equal-tempered-freq base-freq (nth-interval n mode)))))

-(defn- weighted-bins
-  "Creates N bins where N is the smallest power of two greater than the number
-  of elements to be chosen from.  Elements are placed into bins according to
-  how much weight they are assigned, and each bin contains either one key if it
-  fills the bin or a pair of keys split according to how much of each key sits
-  in that bin.
-
-  Look here for a vague description of this algorithm:
-  http://stackoverflow.com/questions/352670/weighted-random-selection-with-and-without-replacement"
-  [pairs]
-  (let [pairs      (apply hash-map pairs)
-        sum        (float (apply + (vals pairs)))
-        normalized (map #(/ % sum) (vals pairs))
-        elems      (zipmap (keys pairs) normalized)
-        n-bins     (first (filter #(> % (count pairs)) (iterate #(* 2 %) 2)))
-        bin-size   (/ 1.0 n-bins)]
-    (loop [[cur-k cur-v]  (first elems)
-           elems (next elems)
-           space bin-size
-           bins []
-           cur-bin []
-           i 0]
-      (if (and cur-k
-               (< i 10))
-        (let [amount  (min space cur-v)
-              new-pair [cur-k amount]
-              space (- space amount)
-              new-bin (conj cur-bin new-pair)
-              new-bins (if (zero? space)
-                         (conj bins new-bin)
-                         bins)
-              new-bin (if (zero? space) [] new-bin)
-              new-space (if (zero? space) bin-size space)
-              new-v (- cur-v amount)
-              new-elem (if (zero? new-v) (first elems) [cur-k new-v])
-              new-elems (if (zero? new-v) (next elems) elems)]
-          (recur new-elem new-elems new-space new-bins new-bin (inc i)))
-        bins))))
-
 (defn- log2 [x]
   (/ (Math/log x)
      (Math/log 2)))
-
-(defn choose-weighted [& pairs]
-  (let [bins (weighted-bins pairs)
-        shift (log2 (count bins))
-        ;index (bit-shift-left (rand) shift)  ; Damn!
-        index (first (drop shift (iterate #(* % 2) (rand))))
-        int-index (min (dec (count bins)) (max 0 (int index)))
-        leftover (- index int-index)
-        bin (nth bins int-index)]
-    (if (= 2 (count bin))
-      (if (<= leftover (second (first bin)))
-        (ffirst bin)
-        (first (second bin)))
-      (ffirst bin))))
-
-; Hmmmm...  It doesn't seeem to be producing what we would expect:
-;(mapcat (fn [[k v]] [k (/ v 1000000.0)]) (frequencies (take 1000000
-;      (repeatedly #(choose-weighted :a 20 :b 50 :c 30)))))
-
 ;; * shufflers (randomize a sequence, or notes within a scale, etc.)
 ;; *
 ;;* Sequence generators


Add support for bespoke envelope curve lists

--- src/overtone/sc/envelope.clj
+++ src/overtone/sc/envelope.clj
@@ -14,7 +14,7 @@
   (:use [overtone util]
         [overtone.sc ugen]))

-(def ENV-CURVES
+(def ENV-SHAPES
   {:step        0
    :lin         1
    :linear      1
@@ -30,19 +30,27 @@
    :cubed       7
    })

-(defn- curve-to-shapes
-  "Create the shapes list corresponding to either a curve type or a set of curve types."
+(defn- shape->id
+  "Create a repeating shapes list corresponding to a specific curve type.
+  Looks curve c up in ENV-SHAPES and if not found used curve id 5.
+  Mirrors *shapeNumber in supercollider/SCClassLibrary/Common/Audio/Env.sc"
   [c]
   (cond
-    (keyword? c) (repeat (c ENV-CURVES))
+   (keyword? c) (repeat (c ENV-SHAPES))
+
     (or
-      (seq? c)
+      (sequential? c)
       (number? c))  (repeat 5)))

-(defn- curve-to-curves
-  "Create the curves list for this curve type."
+(defn- curve-value
+  "Create the curves list for this curve type.
+  Mirrors curveValue in supercollider/SCClassLibrary/Common/Audio/Env.sc"
+  ;;
   [c]
-  (repeat (if (number? c) c 0)))
+  (cond
+   (sequential? c)  c
+   (number? c) (repeat c)
+   :else (repeat 0)))

 ;; Envelope specs describe a series of segments of a line, which can be used to automate
 ;; control values in synths.
@@ -57,12 +65,13 @@

 (defn envelope
   "Create an envelope curve description array suitable for the EnvGen ugen."
+  ;;See prAsArray in supercollider/SCClassLibrary/Common/Audio/Env.sc
   [levels durations & [curve release-node loop-node]]
   (let [curve (or curve :linear)
         reln  (or release-node -99)
         loopn (or loop-node -99)
-        shapes (curve-to-shapes curve)
-        curves (curve-to-curves curve)]
+        shapes (shape->id curve)
+        curves (curve-value curve)]
     (apply vector
            (concat [(first levels) (count durations) reln loopn]
                    (interleave (rest levels) durations shapes curves)))))


Add postconditions to one case of facts query

--- src/com/puppetlabs/puppetdb/query/facts.clj
+++ src/com/puppetlabs/puppetdb/query/facts.clj
@@ -48,6 +48,8 @@

 (defmethod compile-term "="
   [[op path value :as term]]
+  {:post [(map? %)
+          (:where %)]}
   (let [count (count term)]
     (when (not= 3 count)
       (throw (IllegalArgumentException.


(PDB-1448) GC values that swap paths correctly

Make sure that the values GC in replace-facts also considers value
references that are established by any swapping of paths in the current
call.

For example, in cases where replace-facts was replacing these
facts (factset path value):

  (0 "x" 1)
  (0 "y" 2)

with these:

  (0 "x" 2)
  (0 "y" 1)

and there were no other paths referring to to the values 1 and 2 in the
database, the replace-facts values GC would fail with a postgresql
constraint violation similar to this:

  ERROR:  update or delete on table "fact_values" violates foreign key constraint "fact_value_id_fk" on table "facts"
  DETAIL:  Key (id)=(1) is still referenced from table "facts".
  STATEMENT:  DELETE FROM fact_values fv
                     WHERE fv.id in ($1,$2)
                       AND NOT EXISTS (SELECT 1 FROM facts f
                                        WHERE f.fact_value_id in ($3,$4)
                                          AND f.fact_value_id = fv.id
                                          AND (f.factset_id, f.fact_path_id) NOT in (($5,$6),($7,$8)))

because the final AND clause excludes all paths referring to 1 and 2
from consideration as live references, when it should only be excluding
the specific references that are being deleted.  In this example the
exclusions should be (0 "x" 1) and (0 "y" 2), instead of just (0 "x")
and (0 "y").

Include the value in the final clause, i.e. (factset_id, fact_path_id,
fact_value_id), to make the exclusion appropriately specific and fix the
problem.

cf. 797cff7d201d968006b0b3092aa2316b554f5811

--- src/com/puppetlabs/puppetdb/scf/storage.clj
+++ src/com/puppetlabs/puppetdb/scf/storage.clj
@@ -779,11 +779,9 @@
   [factset-id removed-pid-vid-pairs]
   (when-let [removed-pid-vid-pairs (seq removed-pid-vid-pairs)]
     (let [vids (map second removed-pid-vid-pairs)
-          fp-id-pairs (map vector
-                           (repeat factset-id )
-                           (map first removed-pid-vid-pairs))
+          rm-facts (map cons (repeat factset-id) removed-pid-vid-pairs)
           in-vids (jdbc/in-clause vids)
-          in-fp-id-pairs (jdbc/in-clause-multi fp-id-pairs 2)]
+          in-rm-facts (jdbc/in-clause-multi rm-facts 3)]
       (sql/do-prepared
        (format
         "DELETE FROM fact_values fv
@@ -791,9 +789,11 @@
              AND NOT EXISTS (SELECT 1 FROM facts f
                                WHERE f.fact_value_id %s
                                  AND f.fact_value_id = fv.id
-                                 AND (f.factset_id, f.fact_path_id) NOT %s)"
-        in-vids in-vids in-fp-id-pairs)
-       (flatten [vids vids fp-id-pairs])))))
+                                 AND (f.factset_id,
+                                      f.fact_path_id,
+                                      f.fact_value_id) NOT %s)"
+        in-vids in-vids in-rm-facts)
+       (flatten [vids vids rm-facts])))))

 (defn-validated delete-orphaned-paths! :- s/Int
   "Deletes up to n paths that are no longer mentioned by any factsets,


Handle version numbers

Handle version numbers

--- frontend/utils/docs.cljs
+++ frontend/utils/docs.cljs
@@ -14,6 +14,14 @@
          #js {"__html"  ((aget (aget js/window "HAML") template-name)
                          (clj->js (merge {"include_article" include-article} args)))}}])

+(defn replace-variables [html]
+  (let [re (js/RegExp. "{{\\s*([\\S]*)\\s*}}" "g")]
+    (.replace html re (fn [s match]
+                        (let [[name & path] (string/split match #"\.")
+                              var (case name
+                                        "versions" (.-Versions js/CI))]
+                          (apply aget var path))))))
+
 (defn replace-asset-paths [html]
   (let [re (js/RegExp. "\"asset:/(.*?)\"" "g")]
     (.replace html re (fn [s match]
@@ -23,7 +31,8 @@
   (when input
     (-> input
         js/marked
-        replace-asset-paths)))
+        replace-asset-paths
+        replace-variables)))

 (defn new-context []
   (let [context (js/Object.)]


Added help key

Added help key

--- src/sparql_to_csv/spec.clj
+++ src/sparql_to_csv/spec.clj
@@ -55,4 +55,4 @@

 (s/def ::config (s/keys :req [::endpoint ::input ::input-delimiter ::max-retries
                               ::output ::output-delimiter ::page-size ::sleep ::start-from]
-                        :opt [::auth ::extend? ::parallel? ::skip-sparql-validation?]))
+                        :opt [::auth ::extend? ::help? ::parallel? ::skip-sparql-validation?]))


added my fizzbuzz solution in clojure

added my fizzbuzz solution in clojure

--- prob0001.clj
+++ prob0001.clj
@@ -3,3 +3,18 @@
       (= 0 (mod n 5))))

 (reduce + (filter multiple-of-3-or-5? (range 1000)))
+
+;; let's do the traditional FizzBuzz exercise for fun too!
+(defn fizzbuzz
+  "prints FizzBuzz results for a range of 1-num"
+  [num]
+  (let [nums (range 1 (inc num))]
+    (map
+     #(cond
+        (zero? (mod % 15)) (print-str "FizzBuzz")
+        (zero? (mod % 5))  (print-str "Buzz")
+        (zero? (mod % 3))  (print-str "Fizz")
+        :else              (print-str %))
+     nums)))
+
+(fizzbuzz 100)


Formatting cleanup

Formatting cleanup

--- src/metabase/email/messages.clj
+++ src/metabase/email/messages.clj
@@ -18,18 +18,17 @@
 (defn send-new-user-email
   "Format and Send an welcome email for newly created users."
   [invited invitor join-url]
-  (let [data-quote (rand-nth q/quotations)
-        company (or (setting/get :site-name)
-                    "Unknown")
-        message-body (->> {:invitedName (:first_name invited)
-                           :invitorName (:first_name invitor)
-                           :invitorEmail (:email invitor)
-                           :company company
-                           :joinUrl join-url
-                           :quotation (:quote data-quote)
-                           :quotationAuthor (:author data-quote)
-                           :today (u/format-date "MMM' 'dd,' 'yyyy" (System/currentTimeMillis))}
-                          (stencil/render-file "metabase/email/new_user_invite"))]
+  (let [data-quote   (rand-nth q/quotations)
+        company      (or (setting/get :site-name) "Unknown")
+        message-body (stencil/render-file "metabase/email/new_user_invite"
+                                          {:invitedName (:first_name invited)
+                                           :invitorName (:first_name invitor)
+                                           :invitorEmail (:email invitor)
+                                           :company company
+                                           :joinUrl join-url
+                                           :quotation (:quote data-quote)
+                                           :quotationAuthor (:author data-quote)
+                                           :today (u/format-date "MMM' 'dd,' 'yyyy" (System/currentTimeMillis))})]
     (email/send-message
       :subject     (str "You're invited to join " company "'s Metabase")
       :recipients   [(:email invited)]
@@ -43,9 +42,9 @@
          (u/is-email? email)
          (string? hostname)
          (string? password-reset-url)]}
-  (let [message-body (->> {:hostname hostname
-                           :passwordResetUrl password-reset-url}
-                          (stencil/render-file "metabase/email/password_reset"))]
+  (let [message-body (stencil/render-file "metabase/email/password_reset"
+                                          {:hostname hostname
+                                           :passwordResetUrl password-reset-url})]
     (email/send-message
      :subject      "[Metabase] Password Reset Request"
      :recipients   [email]
@@ -65,17 +64,17 @@
 (defn render-pulse-email
   "Take a pulse object and list of results, returns an array of attachment objects for an email"
   [pulse results]
-  (let [images (atom [])
-        render-img (fn [bytes] (reset! images (conj @images bytes)) (str "cid:IMAGE_" (-> @images count dec)))
-        body (apply vector :div (mapv (partial render-pulse-section render-img) results))
-        data-quote (rand-nth q/quotations)
-        message-body (->> {:pulse (html body)
-                           :pulseName (:name pulse)
-                           :sectionStype p/section-style
-                           :colorGrey4 p/color-grey-4
-                           :quotation (:quote data-quote)
-                           :quotationAuthor (:author data-quote)}
-                          (stencil/render-file "metabase/email/pulse"))]
+  (let [images       (atom [])
+        render-img   (fn [bytes] (reset! images (conj @images bytes)) (str "cid:IMAGE_" (-> @images count dec)))
+        body         (apply vector :div (mapv (partial render-pulse-section render-img) results))
+        data-quote   (rand-nth q/quotations)
+        message-body (stencil/render-file "metabase/email/pulse"
+                                          {:pulse (html body)
+                                           :pulseName (:name pulse)
+                                           :sectionStype p/section-style
+                                           :colorGrey4 p/color-grey-4
+                                           :quotation (:quote data-quote)
+                                           :quotationAuthor (:author data-quote)})]
     (apply vector {:type "text/html" :content message-body}
                   (map-indexed (fn [idx bytes] {:type :inline
                                                 :content-id (str "IMAGE_" idx)


Extra dox for Settings :page_facing_up:

Extra dox for Settings :page_facing_up:

--- src/metabase/models/setting.clj
+++ src/metabase/models/setting.clj
@@ -132,6 +132,18 @@

 ;;; ## DEFSETTING

+(defn- setting-extra-dox
+  "Generate some extra documentation for a `Setting`."
+  [symb default-value]
+  (str (format "`%s` is a `Setting`. You can get its value by calling\n\n" symb)
+       (format  "    (%s)\n\n" symb)
+       "and set its value by calling\n\n"
+       (format "    (%s <new-value>)\n\n" symb)
+       "Clear its value by calling\n\n"
+       (format "    (%s nil)." symb)
+       (when default-value
+         (format "\n\nIts default value is `%s`." default-value))))
+
 (defmacro defsetting
   "Defines a new `Setting` that will be added to the DB at some point in the future.
    Conveniently can be used as a getter/setter as well:
@@ -156,7 +168,7 @@
          (string? description)]}
   (let [setting-key (keyword nm)
         value       (gensym "value")]
-    `(defn ~nm ~description
+    `(defn ~nm ~(str description "\n\n" (setting-extra-dox nm default-value))
        {::is-setting?   true
         ::default-value ~default-value
         ::options       ~options}


Clean up logging.

Clean up logging.

--- src/onyx/peer/task_pipeline.clj
+++ src/onyx/peer/task_pipeline.clj
@@ -326,50 +326,50 @@
                       :complete-ch complete-ch}))

 (dire/with-post-hook! #'munge-open-session
-  (fn [{:keys [id]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] created new tx session" id))))
+  (fn [{:keys []}]
+    (taoensso.timbre/info (format "[Pipeline] Created new tx session"))))

 (dire/with-post-hook! #'munge-strip-sentinel
-  (fn [{:keys [id decompressed]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Stripped sentinel. %s segments left" id (count decompressed)))))
+  (fn [{:keys [decompressed]}]
+    (taoensso.timbre/info (format "[Pipeline] Stripped sentinel. %s segments left" (count decompressed)))))

 (dire/with-post-hook! #'munge-requeue-sentinel
-  (fn [{:keys [id tail-batch?]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Requeueing sentinel value: %s" id tail-batch?))))
+  (fn [{:keys [tail-batch?]}]
+    (taoensso.timbre/info (format "[Pipeline] Requeueing sentinel value: %s" tail-batch?))))

 (dire/with-post-hook! #'munge-read-batch
-  (fn [{:keys [id batch]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Read %s segments" id (count batch)))))
+  (fn [{:keys [batch]}]
+    (taoensso.timbre/info (format "[Pipeline] Read %s segments" (count batch)))))

 (dire/with-post-hook! #'munge-decompress-batch
-  (fn [{:keys [id decompressed batch]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Decompressed %s segments" id (count decompressed)))))
+  (fn [{:keys [decompressed batch]}]
+    (taoensso.timbre/info (format "[Pipeline] Decompressed %s segments" (count decompressed)))))

 (dire/with-post-hook! #'munge-apply-fn
-  (fn [{:keys [id results]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Applied fn to %s segments" id (count results)))))
+  (fn [{:keys [results]}]
+    (taoensso.timbre/info (format "[Pipeline] Applied fn to %s segments" (count results)))))

 (dire/with-post-hook! #'munge-compress-batch
-  (fn [{:keys [id compressed]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Compressed fn to %s segments" id (count compressed)))))
+  (fn [{:keys [compressed]}]
+    (taoensso.timbre/info (format "[Pipeline] Compressed %s segments" (count compressed)))))

 (dire/with-post-hook! #'munge-write-batch
-  (fn [{:keys [id]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Wrote batch" id))))
+  (fn [{:keys []}]
+    (taoensso.timbre/info (format "[Pipeline] Wrote batch"))))

 (dire/with-post-hook! #'munge-status-check
-  (fn [{:keys [id status-node]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Checked the status node" id))))
+  (fn [{:keys [status-node]}]
+    (taoensso.timbre/info (format "[Pipeline] Checked the status node"))))

 (dire/with-post-hook! #'munge-ack
-  (fn [{:keys [id acked]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Acked %s segments" id acked))))
+  (fn [{:keys [acked]}]
+    (taoensso.timbre/info (format "[Pipeline] Acked %s segments" acked))))

 (dire/with-post-hook! #'munge-commit-tx
-  (fn [{:keys [id commit?]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Committed transaction? %s" id commit?))))
+  (fn [{:keys [commit?]}]
+    (taoensso.timbre/info (format "[Pipeline] Committed transaction? %s" commit?))))

 (dire/with-post-hook! #'munge-close-resources
-  (fn [{:keys [id]}]
-    (taoensso.timbre/info (format "[Pipeline] [%s] Closed resources" id))))
-
+  (fn [{:keys []}]
+    (taoensso.timbre/info (format "[Pipeline] Closed resources"))))
+


counter-devcards: fix build error on "min" build

--- examples/counter-devcards/project.clj
+++ examples/counter-devcards/project.clj
@@ -8,7 +8,7 @@

                  [org.clojure/core.match "0.3.0-alpha4"]

-                 [devcards "0.2.1-7"]]
+                 [devcards "0.2.1-7" :exclusions [cljsjs/react cljsjs/react-dom]]]

   :pedantic? :abort


use serializaed context in transaction tests

--- test/clj_money/models/transactions_test.clj
+++ test/clj_money/models/transactions_test.clj
@@ -20,40 +20,34 @@

 (use-fixtures :each (partial reset-db storage-spec))

-(def user (users/create storage-spec (factory :user)))
-(def entity (entities/create storage-spec
-                             (assoc (factory :entity) :user-id (:id user))))
-
-(def account-defs
-  [{:name "Checking"
-    :type :asset}
-   {:name "Salary"
-    :type :income}
-   {:name "Groceries"
-    :type :expense}])
-
-(defn test-context
-  "Returns a context containing related models necessary to run the tests"
-  []
-  (let [accounts (zipmap [:checking :salary :groceries]
-                         (->> account-defs
-                              (map #(assoc % :entity-id (:id entity)))
-                              (map #(accounts/create storage-spec %))))]
-    {:accounts accounts
-     :attributes {:transaction-date (t/local-date 2016 3 2)
-                  :description "Paycheck"
-                  :entity-id (:id entity)
-                  :items [{:account-id (-> accounts :checking :id)
-                           :action :debit
-                           :amount (bigdec 1000)}
-                          {:account-id (-> accounts :salary :id)
-                           :action :credit
-                           :amount (bigdec 1000)}]}}))
+(def create-context
+  {:users [(factory :user, {:email "john@doe.com"})]
+   :entities [{:name "Personal"}]
+   :accounts [{:name "Checking"
+               :type :asset }
+              {:name "Salary"
+               :type :income}
+              {:name "Groceries"
+               :type :expense}]})
+
+(defn attributes
+  [context]
+  (let [[checking
+         salary
+         groceries] (:accounts context)]
+    {:transaction-date (t/local-date 2016 3 2)
+     :description "Paycheck"
+     :entity-id (-> context :entities first :id)
+     :items [{:account-id (:id checking)
+              :action :debit
+              :amount (bigdec 1000)}
+             {:account-id (:id salary)
+              :action :credit
+              :amount (bigdec 1000)}]}))

 (deftest create-a-transaction
-  (let [context (test-context)
-        attributes (:attributes context)
-        transaction (transactions/create storage-spec attributes)]
+  (let [context (serialization/realize storage-spec create-context)
+        transaction (transactions/create storage-spec (attributes context))]
     (testing "return value includes the new id"
       (is (validation/valid? transaction))
       (is (number? (:id transaction)) "A map with the new ID is returned"))
@@ -67,82 +61,82 @@
             "The transaction date is correct")))))

 (deftest create-a-transaction-us-string-date
-  (let [context (test-context)
-        attributes (assoc (:attributes context) :transaction-date "3/2/2016")
-        transaction (transactions/create storage-spec attributes)]
+  (let [context (serialization/realize storage-spec create-context)
+        transaction (transactions/create storage-spec (-> (attributes context)
+                                                          (assoc :transaction-date "3/2/2016")))]
     (is (validation/valid? transaction) "The transaction is valid")
     (is (= (t/local-date 2016 3 2) (:transaction-date transaction)) "The transaction date is parsed correctly")))

 (deftest transaction-date-is-required
-  (let [context (test-context)
-        attributes (:attributes context)
-        transaction (transactions/create storage-spec (dissoc attributes :transaction-date))]
+  (let [context (serialization/realize storage-spec create-context)
+        transaction (transactions/create storage-spec (-> (attributes context)
+                                                          (dissoc :transaction-date)))]
     (is (validation/has-error? transaction :transaction-date))))

 (deftest entity-id-is-required
-  (let [context (test-context)
-        attributes (:attributes context)
-        transaction (transactions/create storage-spec (dissoc attributes :entity-id))]
+  (let [context (serialization/realize storage-spec create-context)
+        transaction (transactions/create storage-spec (-> (attributes context)
+                                                          (dissoc :entity-id)))]
     (is (validation/has-error? transaction :entity-id))))

 (deftest item-account-id-is-required
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(dissoc % :account-id)))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(dissoc % :account-id))))]
     (is (validation/has-error? transaction :items))))

 (deftest item-amount-is-required
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(dissoc % :amount)))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(dissoc % :amount))))]
     (is (validation/has-error? transaction :items) "Validation error should be present")))

 (deftest item-amount-must-be-greater-than-zero
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(assoc % :amount (bigdec -1000))))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(assoc % :amount (bigdec -1000)))))]
     (is (validation/has-error? transaction :items) "Validation error should be present")))

 (deftest item-action-is-required
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(dissoc % :action)))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(dissoc % :action))))]
     (is (validation/has-error? transaction :items) "Validation error should be present")))

 (deftest item-action-must-be-debit-or-created
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(assoc % :action :not-valid)))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(assoc % :action :not-valid))))]
     (is (validation/has-error? transaction :items) "Validation error should be present")))

 (deftest sum-of-debits-must-equal-sum-of-credits
-  (let [context (test-context)
-        attributes (:attributes context)
+  (let [context (serialization/realize storage-spec create-context)
         transaction (transactions/create
                       storage-spec
-                      (update-in attributes
-                                 [:items 0]
-                                 #(assoc % :amount (bigdec 1001))))]
+                      (-> (attributes context)
+                          (update-in
+                            [:items 0]
+                            #(assoc % :amount (bigdec 1001)))))]
     (is (validation/has-error? transaction :items) "Validation error should be present")))

 (def balance-context
@@ -467,7 +461,7 @@
                            {:index 0 :amount (bigdec 1000)    :balance (bigdec 1000)}]
         actual-checking (->> (:id checking)
                              (transactions/items-by-account storage-spec)
-                             (map #(select-keys % [:index :amount :balance])))
+                             (map #(select-keys % [:index :amount :balance])))
         expected-groceries [{:index 1 :amount (bigdec 102)    :balance (bigdec 201.99)}
                             {:index 0 :amount (bigdec  99.99) :balance (bigdec  99.99)}]
         actual-groceries (->> (:id groceries)
@@ -501,7 +495,7 @@
                            {:index 0 :amount (bigdec 1000) :balance (bigdec 1000)}]
         actual-checking (->> (:id checking)
                              (transactions/items-by-account storage-spec)
-                             (map #(select-keys % [:index :amount :balance])))
+                             (map #(select-keys % [:index :amount :balance])))
         expected-groceries [{:index 1 :amount (bigdec 101) :balance (bigdec 203)}
                             {:index 0 :amount (bigdec 102) :balance (bigdec 102)}]
         actual-groceries (->> (:id groceries)


New tests: test-properties->map-1/2

New tests: test-properties->map-1/2

--- test/emender_jenkins/config_loader_test.clj
+++ test/emender_jenkins/config_loader_test.clj
@@ -164,17 +164,31 @@
         -1e10 (parse-float "-1e10")))

 (deftest test-parse-float-min-value
-    "Check the behaviour of function zg.config/parse-int."
+    "Check the behaviour of function emender-jenkins.config/parse-int."
     (is (== Float/MIN_VALUE (parse-float "0x0.000002P-126f"))))

 (deftest test-parse-float-max-value
-    "Check the behaviour of function zg.config/parse-int."
+    "Check the behaviour of function emender-jenkins.config/parse-int."
     (is (== Float/MAX_VALUE (parse-float "0x1.fffffeP+127f"))))

 (deftest test-parse-float-bad-input
-    "Check the behaviour of function zg.config/parse-float."
+    "Check the behaviour of function emender-jenkins.config/parse-float."
     (are [x] (thrown? NumberFormatException x)
         (parse-float "")
         (parse-float "xyzzy")
         (parse-float "-1xyzzy")))

+(deftest test-properties->map-1
+    "Check the behaviour of function emender-jenkins/properties->map."
+    (let [property (doto (new java.util.Properties)
+                         (.setProperty "a" "A")
+                         (.setProperty "b" "B"))]
+        (is (= {:a 'A :b 'B} (properties->map property)))))
+
+(deftest test-properties->map-2
+    "Check the behaviour of function emender-jenkins/properties->map."
+    (let [property (doto (new java.util.Properties)
+                         (.setProperty "propertyA" "property_a")
+                         (.setProperty "propertyB" "property_b"))]
+        (is (= {:propertyA 'property_a :propertyB 'property_b} (properties->map property)))))
+


Fix trigger sync signature.

Fix trigger sync signature.

--- test/onyx/windowing/window_session_test.clj
+++ test/onyx/windowing/window_session_test.clj
@@ -60,7 +60,7 @@

 (def test-state (atom []))

-(defn update-atom! [event window-id lower-bound upper-bound state]
+(defn update-atom! [event window trigger {:keys [window-id upper-bound lower-bound]} state]
   (swap! test-state conj
          [(java.util.Date. lower-bound)
           (java.util.Date. upper-bound)


simplify fn ast-stats

simplify fn ast-stats

--- src/refactor_nrepl/analyzer.clj
+++ src/refactor_nrepl/analyzer.clj
@@ -89,16 +89,9 @@
     (interleave (keys asts)
                 (->> (vals asts)
                      (mapcat vals)
-                     (map #(cond
-                             (and (instance? Throwable %)
-                                  (config/get-opt :debug))
-                             (interleave (keys %) (vals %))
-
-                             (instance? Throwable %)
-                             (.getMessage %)
-
-                             :default
-                             (count %)))))))
+                     (map #(if (instance? Throwable %)
+                             (list "error" (.getMessage %))
+                             "OK"))))))

 (defn warm-ast-cache []
   (doseq [f (util/find-clojure-sources-in-project)]


util.form: Handle irregular form args and bodies in form->defn

--- src/main/workflo/macros/util/form.cljc
+++ src/main/workflo/macros/util/form.cljc
@@ -77,11 +77,16 @@

 (defn make-defn
   ([name args body]
-   `(~'defn ~name ~args
-     ~@body))
+   `(~'defn ~name
+     ~(cond-> args
+        (not (vector? args)) vec)
+     ~@(cond-> body (not (sequential? body)) vector)))
   ([prefix name args body]
-   `(~'defn ~(prefixed-form-name name prefix) ~args
-     ~@body)))
+   `(~'defn ~(prefixed-form-name name prefix)
+     ~(cond-> args
+        (not (sequential? args)) vector
+        (not (vector? args)) vec)
+     ~@(cond-> body (not (sequential? body)) vector))))

 (s/fdef form->defn
   :args (s/cat :form ::conforming-form)


wrap *out* in a PrintWriter for tests, fixes with-out-str bug

--- dev/bake/test.clj
+++ dev/bake/test.clj
@@ -7,7 +7,7 @@
         [bake.reload :only [last-reloaded last-modified reload]]
         [bake.notify :only [notify]]
         [bake.clj-stacktrace])
-  (:import [java.io StringWriter IOException]))
+  (:import [java.io StringWriter IOException PrintWriter]))

 (defn test-vars [nses {:keys [tags functions namespaces]}]
   (let [run? (fn [ns]
@@ -29,11 +29,13 @@
                                     (ns-publics ns)))))
             {} nses)))

-(def ^:dynamic *ns-results*)
-(def ^:dynamic *current-test*)
+(def ^{:dynamic true} *ns-results*)
+(def ^{:dynamic true} *current-test*)
+(def ^{:dynamic true} *string-writer*)

 (defn reset-streams! []
-  (set! *out* (StringWriter.))
+  (set! *string-writer* (StringWriter.))
+  (set! *out* (PrintWriter. *string-writer* true))
   (set! *err* *out*))

 (defn unprintable? [obj]
@@ -56,20 +58,20 @@
 (defmulti my-report :type)

 (defmethod my-report :pass [m]
-  (update-results *out* (dissoc m :actual)))
+  (update-results *string-writer* (dissoc m :actual)))

 (defmethod my-report :fail [m]
-  (update-results *out* m))
+  (update-results *string-writer* m))

 (defmethod my-report :error [m]
-  (update-results *out* (update-in m [:actual] parse-exception)))
+  (update-results *string-writer* (update-in m [:actual] parse-exception)))

 (defmethod my-report :begin-test-var [m]
   (set! *current-test* (:name (meta (:var m))))
   (reset-streams!))

 (defmethod my-report :end-test-var [m]
-  (update-results *out*)
+  (update-results *string-writer*)
   (set! *current-test* nil))

 (defn run-ns-tests [ns tests]
@@ -81,6 +83,7 @@
               *test-out* (StringWriter.)
               *out* *out* ;; this is so it gets restored
               *err* *err*
+              *string-writer* nil
               *report-counters* (ref *initial-report-counters*)
               *ns-results* (atom {})
               *current-test* nil]


fix divertirse

fix divertirse

--- babel/espanol/lexicon.clj
+++ babel/espanol/lexicon.clj
@@ -112,20 +112,8 @@
    "desear" {:synsem {:cat :verb
                       :sem {:pred :desire}}}

-   "divertirse" {:espanol {:boot-stem "diviert"}}
    (let [subject-semantics (ref {:animate true})
                     subject-agr (ref :top)]
-                {:synsem {:cat :verb
-                          :sem {:pred :have-fun
-                                :reflexive true
-                                :subj subject-semantics
-                                :obj subject-semantics}
-                          :subcat {:1 {:agr subject-agr
-                                       :sem subject-semantics}
-                                   :2 {:agr subject-agr
-                                       :pronoun true
-                                       :reflexive true
-                                       :sem subject-semantics}}}})

    "dormir" {:espanol {:boot-stem "duerm"
                        :pret-stem "durm"}


A soupçon of test cleanup.

A soupçon of test cleanup.

--- test/midje/midje_forms/t_translating.clj
+++ test/midje/midje_forms/t_translating.clj
@@ -144,12 +144,12 @@
   (unfolding-step '[...] '[(blah)] {}) => [ '[... (blah)] [] {} ]

   "unfolding a plain fake does nothing in particular"
-  (unfolding-step '[...] '[(midje.semi-sweet/fake (f 1) arrow 4) ...] {})
-  => [ '[... (midje.semi-sweet/fake (f 1) arrow 4)] '[...] {} ]
+  (unfolding-step '[...] '[(midje.semi-sweet/fake (f 1) =test=> 4) ...] {})
+  => [ '[... (midje.semi-sweet/fake (f 1) =test=> 4)] '[...] {} ]

   "unfolding a fake that should be unfolded adds a new fake"
-  (let [original '(midje.semi-sweet/fake (f (h 1)) arrow 4 ...overrides...)
-        flattened '(midje.semi-sweet/fake (f ...h-1...) arrow 4 ...overrides...)
+  (let [original '(midje.semi-sweet/fake (f (h 1)) =test=> 4 ...overrides...)
+        flattened '(midje.semi-sweet/fake (f ...h-1...) =test=> 4 ...overrides...)
         generated '(midje.semi-sweet/fake (h 1) => ...h-1... ...overrides...)]
     (unfolding-step '[...]
                     [original '...]
@@ -170,7 +170,6 @@
   "Which means that already-existing substitutions are reused"
   (augment-substitutions {'(h 1) ...h-1...} '(fake (f (h 1)))) => '{ (h 1) ...h-1... })

-(println "replace arrow with dummy arrow")
 (fact "fakes are flattened by making substitutions"
   (flatten-fake '(fake (f (g 1) 2 (h 3)) =test=> 33 ...overrides...)
                 '{ (g 1) ...g-1..., (h 3) ...h-1... })


Fix assertion in test

Fix assertion in test

Assertion was wrong because it was modified to check for failing test
outcomes and then commited by accident.

--- test/pva_parrot/backend/service_test.clj
+++ test/pva_parrot/backend/service_test.clj
@@ -5,4 +5,4 @@
 (deftest backend-service
   (testing "Event Handling"
     (testing "file import"
-      (is (= 3 (event-msg-handler {:id :pva-parrot/import-file}))))))
+      (is (= nil (event-msg-handler {:id :pva-parrot/import-file}))))))


Search components are added

Search components are added

--- src_cljs/rrm/corecljs.cljs
+++ src_cljs/rrm/corecljs.cljs
@@ -282,9 +282,6 @@

 (defn o6-click [event]
   (secretary/dispatch! "/o6register"))
-
-
-

 ;;.............. End of Tab Events ......

@@ -527,67 +524,104 @@
    [:div {:class "box"}
     [:div {:class "box-header"}
      [:h3 "List of Mutations"]]
-    [:div.row
-     [:div.col-md-12
-      [:div.form-group
+      [:div.col-md-12
        ;; [:div.col-sm-2 [:input.form-control {:id "dt1" :type "date"}]]
        ;; [:div.col-sm-2 [:input.form-control {:id "dt2" :type "date"}]]
-       [:div.col-sm-2 "Mutation Number"  [:input.form-control {:id "mutationnumber" :type "text"
-                                                               :placeholder "Enter search by mutationnumber"}]]
-
-       [:div.col-sm-2 [:input.form-control {:id "dt" :type "text"
-                                            :placeholder "Enter search text.."}]]
-       [:input {:type "button" :value "Search"
-                :class "btn btn-primary" :on-click search}]
-       [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click add}]
-       ;; (url-format "#/documents/add" "Document")
-       [:input {:id "getall" :type "button" :value "Refresh"
-                :class "btn btn-primary" :on-click get-all-click}]]
-      [:div {:class "box-body"}
-
-       [:table {:class "table table-bordered table-striped dataTable"}
-        [:thead
-         [:tr
-          [:th "Mutation Number"]
-          [:th "Name of the FirstParty"]
-          [:th "Name of The SecondParty"]
-          [:th "Date of Institution"]
-          [:th "Name of P.O"]
-          [:th "Name of Districts"]
-          [:th "Name of Village"]
-          [:th "SubDivisionName"]
-          [:th " "]
-          [:th " "]
-          ]]
-        [:tbody
-         (for [mt mutations]
-           ^{:key (.-id mt)} [:tr
-                              [:td (.-mutationnumber mt)]
-                              [:td (.-nameofthefirstparty mt)]
-                              [:td (.-nameofthesecondparty mt)]
-                              ;;  [:td  (f/unparse (f/formatter "dd-MMM-yyyy")(f/parse (.-dateofinstitution dn)))]
-                              [:td (.-dateofinstitution mt)]
-                              [:td (.-nameofpo mt)]
-                              [:td (.-districtname mt)]
-                              [:td (.-villagename mt)]
-                              [:td (.-subdivisionname mt)]
-                              ;; [:td [:input {:type "button" :on-click #(click-update(.-id dn))
-                              ;;               :class "glyphicon glyphicon-edit" :value "Update"}
-                              ;;       ]]
-                              [:td [:a {:href "javascript:;" :on-click  #(click-update (.-id mt))  :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]]
-                              ;; [:td [:input {:type "button" :on-click #(delete(.-id dn))
-                              ;;               :class "glyphicon glyphicon-remove"  :value "Delete"}]]
-                              [:td  [:a {:href "javascript:;" :on-click #(delete(.-id mt))  :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}] ]
-
-                              ])]]
-       [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]
-       ]
-      ]]]
-   ;; [:div.padding]
-   ;;  [:div.page-footer [:h4 "Copyright All Rights Reserved © 2016 TechnoIdentity Solutions Pvt.Ltd"]]
-   ])
-
+       [:div.form-group
+        [:div.row
+         [:div.col-sm-2 "Mutation Number"
+          [:input.form-control {:id "mutationnumber"
+                              :type "text"
+                                :placeholder "Enter search by mutationnumber"}]]
+         [:div.col-sm-2 "Enter Search Text"
+          [:input.form-control {:id "dt" :type "text"
+                                               :placeholder "Enter search text.."}]]]]
+       [:div.form-group
+        [:div.row
+         [:div.col-sm-2 "Title"
+          [:input.form-control {:id "stitle"
+                                :type "text"
+                                :placeholder "Title"}]]
+         [:div.col-sm-2 "District Name"
+          [:input.form-control {:id "sdistrictname"
+                                :list "combo"
+                                :placeholder "District Name"}[datalist] ]]
+         [:div.col-sm-2 "Sub Division Name"
+          [:input.form-control {:id "ssubdivisionname"
+                                :list "combo"
+                                :placeholder "Sub Division Name"}[datalist]]]
+         [:div.col-sm-2 "Village Name"
+          [:input.form-control {:id "svillagename"
+                                :list "combo"
+                                :placeholder "Village Name"}[datalist]]]
+         [:div.col-sm-2 "Name Of P.O"
+          [:input.form-control {:id "svillagename"
+                                :list "combo"
+                                :placeholder "Name Of P.O"}[datalist]]]]]
+       [:div.form-group
+        [:div.row
+         [:div.col-sm-2 "O2 Number"
+          [:input.form-control {:id "so2number"
+                                :type "text"
+                                :placeholder "O2 Number"}]]
+         [:div.col-sm-2 "Khasra Number"
+          [:input.form-control {:id "skhasranumber"
+                                :type "text"
+                                :placeholder "Khasra Number"} ]]
+         [:div.col-sm-2 "Khata khatuni Number"
+          [:input.form-control {:id "skhatakhatuninumber"
+                                :type "text"
+                                :placeholder "Khata Khatuni Number"}]]
+         [:div.col-sm-2 "Name of the First Party"
+          [:input.form-control {:id "snameofthefirstparty"
+                                :type "text"
+                                :placeholder "Name of the First Party"}]]
+         [:div.col-sm-2 "Name of the Second Party"
+          [:input.form-control {:id "snameofthesecondparty"
+                                :type "text"
+                                :placeholder "Name of the Second Party"}]]]
+        [:div.form-group
+         [:div.row
+          [:div.col-sm-2.col-md-offset-5 {:style {:padding-top "20px"}}
+           [:input.btn.btn-primary {:type "button" :value "Search" :on-click search}]
+           [:input.btn.btn-primary {:type "button" :value "Add" :on-click add}]
+           [:input.btn.btn-primary {:id "getall" :type "button" :value "Refresh":on-click get-all-click}]]]]]]
+
+    [:div {:class "box-body"}
+     [:table {:class "table table-bordered table-striped dataTable"}
+      [:thead
+       [:tr
+        [:th "Mutation Number"]
+        [:th "Name of the FirstParty"]
+        [:th "Name of The SecondParty"]
+        [:th "Date of Institution"]
+        [:th "Name of P.O"]
+        [:th "Name of Districts"]
+        [:th "Name of Village"]
+        [:th "SubDivisionName"]
+        [:th " "]
+        [:th " "]
+        ]]
+      [:tbody
+       (for [mt mutations]
+         ^{:key (.-id mt)} [:tr
+                            [:td (.-mutationnumber mt)]
+                            [:td (.-nameofthefirstparty mt)]
+                            [:td (.-nameofthesecondparty mt)]
+                            ;;  [:td  (f/unparse (f/formatter "dd-MMM-yyyy")(f/parse (.-dateofinstitution dn)))]
+                            [:td (.-dateofinstitution mt)]
+                            [:td (.-nameofpo mt)]
+                            [:td (.-districtname mt)]
+                            [:td (.-villagename mt)]
+                            [:td (.-subdivisionname mt)]
+                            ;; [:td [:input {:type "button" :on-click #(click-update(.-id dn))
+                            ;;               :class "glyphicon glyphicon-edit" :value "Update"}
+                            ;;       ]]
+                            [:td [:a {:href "javascript:;" :on-click  #(click-update (.-id mt))  :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]]
+                            ;; [:td [:input {:type "button" :on-click #(delete(.-id dn))
+                            ;;               :class "glyphicon glyphicon-remove"  :value "Delete"}]]
+                            [:td  [:a {:href "javascript:;" :on-click #(delete(.-id mt))  :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}] ]])]]
+       [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]])

 (defroute mutations-list "/mutations" []
   (let [onres (fn [json]


Message queue: add a default worker monitor

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -115,7 +115,7 @@
     \"eoq-backoff\" - If circle uninitialized or end-of-circle marker reached.
     [<mid> <mcontent> <attempt-count>] - If message should be (re)handled now."
   [qname & [{:keys [lock-ms eoq-backoff-ms]
-             :or   {lock-ms (* 60 60 1000)
+             :or   {lock-ms (* 1000 60 60)
                     eoq-backoff-ms 2000}}]]
   (car/lua
    "if redis.call('exists', _:qk-eoq-backoff) == 1 then
@@ -243,6 +243,21 @@
   java.io.Closeable
   (close [this] (stop this)))

+(defn monitor-fn
+  "Returns a worker monitor fn that warns when queue's mid-circle exceeds
+  the prescribed size. A backoff timeout can be provided to rate-limit this
+  warning."
+  [qname max-circle-size warn-backoff-ms]
+  (let [udt-last-warning (atom nil)]
+    (fn [{:keys [mid-circle-size]}]
+      (let [instant (System/currentTimeMillis)]
+        (when (and (> mid-circle-size max-circle-size)
+                   (> (- instant (or @udt-last-warning 0))
+                      (or warn-backoff-ms 0)))
+          (reset! udt-last-warning instant)
+          (timbre/warnf "Message queue size warning: %s (mid-circle-size: %s)"
+                        qname max-circle-size))))))
+
 (defn worker
   "Returns a threaded worker to poll for and handle messages `enqueue`'d to
   named queue. Options:
@@ -252,6 +267,7 @@
                                  :backoff-ms <retry-backoff-ms}.
    :monitor        - (fn [{:keys [mid-circle-len ndry-runs]}]) called on each
                      worker loop iteration. Useful for queue monitoring/logging.
+                     See also `monitor-fn`.
    :lock-ms        - Max time handler may keep a message before handler
                      considered fatally stalled and message re-queued. Must be
                      sufficiently high to prevent double handling.
@@ -264,7 +280,8 @@
                   :or   {handler (fn [{:keys [message attempt]}]
                                    (timbre/info qname message attempt)
                                    {:status :success})
-                         lock-ms        (* 60 60 1000)
+                         monitor (monitor-fn qname 1000 (* 1000 60 60))
+                         lock-ms        (* 1000 60 60)
                          throttle-ms    200
                          eoq-backoff-ms (fn [ndruns] (exp-backoff ndruns {:max 10000}))
                          auto-start?    true}}]]


Update :1.8 profile with clojure 1.8.0-RC5.

--- profiles.clj
+++ profiles.clj
@@ -47,7 +47,7 @@
                         "-Xms4g"]
    :main ^:skip-aot bench}]

- :1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC4"]]}
+ :1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC5"]]}

  ;; Examples
  :examples


rename test-var to test-nginx-var

rename test-var to test-nginx-var

--- test/clojure/nginx/clojure/test_all.clj
+++ test/clojure/nginx/clojure/test_all.clj
@@ -447,7 +447,7 @@
   )
 ;)

-(deftest test-var
+(deftest test-nginx-var
   (testing "simple nginx var"
            (let [r (client/get (str "http://" *host* ":" *port* "/vartest") {:follow-redirects false})
                  h (:headers r)


Improved docstrings for take-rows/drop-rows

--- src/tabular/grafter/tabular.clj
+++ src/tabular/grafter/tabular.clj
@@ -206,12 +206,12 @@
           (with-meta (meta dataset))))))

 (defn drop-rows
-  "Drops the first n rows from the dataset."
+  "Drops the first n rows from the dataset, retaining the rest."
   [dataset n]
   (tabc/pass-rows dataset (partial drop n)))

 (defn take-rows
-  "Drops the first n rows from the dataset."
+  "Takes only the first n rows from the dataset, discarding the rest."
   [dataset n]
   (tabc/pass-rows dataset (partial take n)))


tweak clojure-test tests to print output of each test run from the ns hook

--- test/simple_check/clojure_test_test.clj
+++ test/simple_check/clojure_test_test.clj
@@ -22,32 +22,41 @@
     [(gen/vector gen/int)]
     vector-elements-are-unique*))

-(defspec failing-spec 100 vector-elements-are-unique)
+(defspec this-is-supposed-to-fail 100 vector-elements-are-unique)
+
+(defn- capture-test-var
+  [v]
+  (doto (with-out-str (binding [*test-out* *out*] (test-var v)))
+    println))

 (defn test-ns-hook
   []
-  (is (-> (with-out-str (binding [*test-out* *out*] (test-var #'trial-counts)))
-             read-string
-             (select-keys [:test-var :result :num-tests])
-             (= {:test-var 'trial-counts, :result true, :num-tests 5000})))
+  (is (-> (capture-test-var #'default-trial-counts)
+          read-string
+          :num-tests
+          (= ct/*default-test-count*)))
+
+  (is (-> (capture-test-var #'trial-counts)
+          read-string
+          (select-keys [:test-var :result :num-tests])
+          (= {:test-var 'trial-counts, :result true, :num-tests 5000})))

   (binding [ct/*report-trials* true]
-     (let [output (with-out-str (test-var #'trial-counts))]
+     (let [output (capture-test-var #'trial-counts)]
        (is (re-matches #"(?s)\.{5}.+" output))))

   (binding [ct/*report-trials* ct/trial-report-periodic
             ct/*trial-report-period* 500]
     (is (re-seq
           #"(Passing trial \d{3} / 1000 for .+\n)+"
-           (with-out-str (binding [*test-out* *out*] (test-var #'long-running-spec))))))
+           (capture-test-var #'long-running-spec))))

   (let [[report-counters stdout]
         (binding [ct/*report-shrinking* true
-                  ; need to keep the failure of failing-spec from affecting the
-                  ; simple-check test run
+                  ; need to keep the failure of this-is-supposed-to-fail from
+                  ; affecting the simple-check test run
                   *report-counters* (ref *initial-report-counters*)]
-          [*report-counters*
-           (with-out-str (binding [*test-out* *out*] (test-var #'failing-spec)))])]
+          [*report-counters* (capture-test-var #'this-is-supposed-to-fail)])]
     (is (== 1 (:fail @report-counters)))
     (is (re-seq
           #"(?s)Shrinking vector-elements-are-unique starting with parameters \[\[.+"


[#146] Tests wait for GAE dev server to start

--- api/test/clojure/org/akvo/flow_api/fixtures.clj
+++ api/test/clojure/org/akvo/flow_api/fixtures.clj
@@ -1,12 +1,36 @@
 (ns org.akvo.flow-api.fixtures
   (:require [clojure.test :refer :all]
             [com.stuartsierra.component :as component]
+            clj-http.client
             [duct.util.system :as duct]))

 (def ^:dynamic *system*)

+(defmacro try-for [msg how-long & body]
+  `(let [start-time# (System/currentTimeMillis)]
+     (loop []
+       (let [[status# return#] (try
+                                 (let [result# (do ~@body)]
+                                   [(if result# ::ok ::fail) result#])
+                                 (catch Throwable e# [::error e#]))
+             more-time# (> (* ~how-long 1000)
+                          (- (System/currentTimeMillis) start-time#))]
+         (cond
+           (= status# ::ok) return#
+           more-time# (do (Thread/sleep 1000) (recur))
+           (= status# ::fail) (throw (ex-info (str "Failed: " ~msg) {:last-result return#}))
+           (= status# ::error) (throw (RuntimeException. (str "Failed: " ~msg) return#)))))))
+
+(defn wait-for-server [url]
+  (try-for (str "Not 200 for " url) 60
+    (= 200 (:status (clj-http.client/get url)))))
+
+(defn check-servers-up []
+  (wait-for-server "http://localhost:8888/_ah/admin"))
+
 (defn system [system]
   (fn [f]
     (binding [*system* (component/start (duct/build-system system))]
+      (check-servers-up)
       (f)
       (component/stop system))))


Add :image-type to routes and update handling

Add :image-type to the window-crop* routes. Re-added the route handling
logic back to app-routes.

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -45,8 +45,9 @@
                   :height size-regex}))

 (def window-crop-route
-  (route-compile "/:wikia/:top-dir/:middle-dir/:original/revision/:revision/window-crop/width/:width/x-offset/:x-offset/y-offset/:y-offset/window-width/:window-width/window-height/:window-height"
+  (route-compile "/:wikia:image-type/:top-dir/:middle-dir/:original/revision/:revision/window-crop/width/:width/x-offset/:x-offset/y-offset/:y-offset/window-width/:window-width/window-height/:window-height"
                  {:wikia wikia-regex
+                  :image-type image-type-regex
                   :top-dir top-dir-regex
                   :middle-dir middle-dir-regex
                   :original original-regex
@@ -58,8 +59,9 @@
                   :window-height size-regex}))

 (def window-crop-fixed-route
-  (route-compile "/:wikia/:top-dir/:middle-dir/:original/revision/:revision/window-crop/width/:width/height/:height/x-offset/:x-offset/y-offset/:y-offset/window-width/:window-width/window-height/:window-height"
+  (route-compile "/:wikia:image-type/:top-dir/:middle-dir/:original/revision/:revision/window-crop/width/:width/height/:height/x-offset/:x-offset/y-offset/:y-offset/window-width/:window-width/window-height/:window-height"
                  {:wikia wikia-regex
+                  :image-type image-type-regex
                   :top-dir top-dir-regex
                   :middle-dir middle-dir-regex
                   :original original-regex
@@ -133,6 +135,21 @@
                (if-let [thumb (u/get-or-generate-thumbnail system image-params)]
                  (create-image-response thumb)
                  (error-response 404 image-params))))
+        (GET window-crop-route
+             request
+             (let [route-params (image-params request :thumbnail)
+                   image-params (assoc route-params :thumbnail-mode "window-crop"
+                                                    :height :auto)]
+               (if-let [thumb (u/get-or-generate-thumbnail system image-params)]
+                 (create-image-response thumb)
+                 (error-response 404 image-params))))
+        (GET window-crop-fixed-route
+             request
+             (let [route-params (image-params request :thumbnail)
+                   image-params (assoc route-params :thumbnail-mode "window-crop-fixed")]
+               (if-let [thumb (u/get-or-generate-thumbnail system image-params)]
+                 (create-image-response thumb)
+                 (error-response 404 image-params))))
         (GET thumbnail-route
              request
              (let [image-params (image-params request :thumbnail)]


Combining two delegates

Combining two delegates

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -194,11 +194,7 @@
     (when (empty? ($ info-box))
       (show-info!))))

-(delegate $body "#info-close" :click
-  (fn [e]
-    (hide-info!)))
-
-(delegate $body "#info-container" :click
+(delegate $body "#info-close,#info-container" :click
   (fn [e]
     (hide-info!)))


update-wishlist-rem

update-wishlist-rem

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -105,7 +105,7 @@
 (defn wishlist-title-changer []
   (delegate $header wishlist-title :change
     (fn [e]
-      (update-wishlist-rem))))
+      (update-wishlist-title-rem))))

 (defn wishlist-wish-description-changer []
   (delegate $content ".description" :change


Unused code

Unused code

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -53,15 +53,6 @@
 (defn title-from-html []
   (val (find $header ".title")))

-(defn wishes-from-html []
-  (for [el ($ wish-li)]
-    {:description (val (find el ".description"))
-     :url (val (find el ".url"))}))
-
-(defn wishlist-from-html []
-  {:title  (title-from-html)
-   :wish   (wishes-from-html)
-   :code   (get-path)})

 (defn value-changed?! [$this]
   (if (= (data $this :old-val) (val $this))


collection functions

collection functions

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

--- acqEngine/src/org/micromanager/control.clj
+++ acqEngine/src/org/micromanager/control.clj
@@ -49,9 +49,9 @@
    :camera-exposures
    {\"Camera\" exposure}}"
   [{:keys [properties stage-positions camera-exposures] :as state}]
-  (future (set-properties! properties))
-  (future (set-stage-positions! stage-positions))
-  (future (set-camera-exposures! camera-exposures))
+  (set-properties! properties)
+  (set-stage-positions! stage-positions)
+  (set-camera-exposures! camera-exposures)
   nil)

 (defn new-values
@@ -71,6 +71,23 @@
                           (update-hardware-state! old-state new-state))]
     (doto (atom {})
       (add-watch update-function update-function))))
+
+(defn sleep-until [target-time-ms]
+  "Sleep until a designated time on the system clock."
+  (let [interval (- target-time-ms (System/currentTimeMillis))]
+    (when (pos? interval)
+      (Thread/sleep interval))))
+
+(defn collect-snap [tags out-queue]
+  (mm/core snapImage)
+  (future (dotimes [i (mm/core getNumberOfCameraChannels)]
+            (.put queue (mm/core getTaggedImage i)))
+          queue))
+
+(defn acquire-event [{:keys [state acquire-time expose-fn]} out-queue]
+  (swap! hardware-state-atom merge state)
+  (sleep-until acquire-time)
+  (expose-fn out-queue))

 ;; testing

@@ -94,4 +111,4 @@
    {"Z" 5.0
     "XY" [30 10]}
    :camera-exposures
-   {"Camera" 20}})+   {"Camera" 20}})


Fix clojurescript build configuration

Fix clojurescript build configuration

Signed-off-by: Etienne Spillemaeker <ae16a3dd121198c452fcd6f2724da10d504b391c@af83.com>

--- profiles.clj
+++ profiles.clj
@@ -20,7 +20,7 @@
                   {:id "funnel-front dev"
                    :source-paths ["dev-resources/tools/repl"]
                    :compiler {
-                              :output-to "dev-resources/publick/js/funnel-front.js"
+                              :output-to "dev-resources/public/js/funnel_front.js"
                               :output-dir "dev-resources/public/js/out"
                               :optimizations :none
                               :source-map true


run compile before jar, but do nothing if build/native exists

--- tasks.clj
+++ tasks.clj
@@ -28,34 +28,33 @@
               rpath "-Wl,-R,'$$ORIGIN'"]
           (ant Replace {:file (file src "Makefile") :token token :value (str token " " rpath)}))))

-(deftask compile-native #{clean}
-  (log (format "Compiling tokyocabinet for %s/%s" (os-name) (os-arch)))
-  (let [dest    (.getPath (file "build" "native"))
-        prefix  (str "--prefix=" dest)
-        classes (file "classes")
-        arch    (case (os-arch) "x86_64" "-m64" "x86" "-m32" "")]
-    (let [src (file "src" tokyocabinet)]
-      (ant ExecTask {:executable "./configure" :dir src :failonerror true}
-           (args prefix)
-           (env {"CFLAGS" arch "LDFLAGS" arch}))
-      (fix-install-path src "tokyocabinet")
-      (ant ExecTask {:executable "make" :dir src :failonerror true})
-      (ant ExecTask {:executable "make" :dir src :failonerror true}
-           (args "install")))
-    (let [cflags (format " %s -I%s/include -L%s/lib " arch dest dest)
-          src    (file "src" tokyocabinet-java)]
-      (ant ExecTask {:executable "./configure" :dir src :failonerror true}
-           (args prefix)
-           (env {"JAVA_HOME" (System/getProperty "java.home") "CFLAGS" cflags}))
-      (let [token "\nCFLAGS ="] ; hack because configure doesn't set CFLAGS correctly in Makefile
-        (ant Replace {:file (file src "Makefile") :token token :value (str token " " cflags)}))
-      (fix-install-path src "jtokyocabinet")
-      (ant ExecTask {:executable "make" :dir src :failonerror true})
-      (ant ExecTask {:executable "make" :dir src :failonerror true}
-           (args "install")))
-    (ant Copy {:todir classes}
-         (add-zipfileset {:src (str dest "/lib/tokyocabinet.jar") :includes "**/*.class"}))
-    (rm (file dest "lib/tokyocabinet.jar"))
-    (rmdir (file dest "lib/pkgconfig"))))
-
-(remove-dep! jar compile)+(deftask compile-native
+  (when-not (.exists (file "build" "native"))
+    (log (format "Compiling tokyocabinet for %s/%s" (os-name) (os-arch)))
+    (let [dest    (.getPath (file "build" "native"))
+          prefix  (str "--prefix=" dest)
+          classes (file "classes")
+          arch    (case (os-arch) "x86_64" "-m64" "x86" "-m32" "")]
+      (let [src (file "src" tokyocabinet)]
+        (ant ExecTask {:executable "./configure" :dir src :failonerror true}
+             (args prefix)
+             (env {"CFLAGS" arch "LDFLAGS" arch}))
+        (fix-install-path src "tokyocabinet")
+        (ant ExecTask {:executable "make" :dir src :failonerror true})
+        (ant ExecTask {:executable "make" :dir src :failonerror true}
+             (args "install")))
+      (let [cflags (format " %s -I%s/include -L%s/lib " arch dest dest)
+            src    (file "src" tokyocabinet-java)]
+        (ant ExecTask {:executable "./configure" :dir src :failonerror true}
+             (args prefix)
+             (env {"JAVA_HOME" (System/getProperty "java.home") "CFLAGS" cflags}))
+        (let [token "\nCFLAGS ="]  ; hack because configure doesn't set CFLAGS correctly in Makefile
+          (ant Replace {:file (file src "Makefile") :token token :value (str token " " cflags)}))
+        (fix-install-path src "jtokyocabinet")
+        (ant ExecTask {:executable "make" :dir src :failonerror true})
+        (ant ExecTask {:executable "make" :dir src :failonerror true}
+             (args "install")))
+      (ant Copy {:todir classes}
+           (add-zipfileset {:src (str dest "/lib/tokyocabinet.jar") :includes "**/*.class"}))
+      (rm (file dest "lib/tokyocabinet.jar"))
+      (rmdir (file dest "lib/pkgconfig")))))


allow a remote spec which is different than a local spec to overrride

--- elephantdb-server/src/clj/elephantdb/common/domain.clj
+++ elephantdb-server/src/clj/elephantdb/common/domain.clj
@@ -45,7 +45,8 @@

 (defmethod mk-local-store DomainStore
   [local-path remote-vs]
-  (DomainStore. local-path (.getSpec remote-vs)))
+  ;; Ignore a local spec if it's different than the remote spec.
+  (DomainStore. local-path (.getSpec remote-vs) true))

 (defmethod mk-local-store DomainSpec
   [local-path spec]


Check if script file is present on execute call

--- worker/src/clinicico/worker/pirate/core.clj
+++ worker/src/clinicico/worker/pirate/core.clj
@@ -9,6 +9,8 @@
             [crypto.random :as crypto])
   (:import (org.rosuda.REngine REngineException)
            (org.rosuda.REngine.Rserve RConnection)))
+
+(def script-file (atom nil))

 (def ^:private default-packages ["RJSONIO" "Cairo"])

@@ -26,7 +28,6 @@
         bootstrap (str (format bootstrap-template wrapper) (join "\n" commands))]
     (spit (io/resource "bootstrap.R") bootstrap)))

-(def script-file (atom ""))
 (defn initialize
   "Generates a bootstrap.R file and executes scripts/start.sh in a shell
    Typically starting a new RServe with the generated file 'sourced'"
@@ -67,6 +68,7 @@
   (with-open [R (pirate/connect)]
     (try
       (do
+        (compare-and-set! script-file nil (io/as-file file))
         (source-file! R @script-file)
         (pirate/assign R "params" params)
         (pirate/assign R "files" [])


Fix int->nonce test

Fix int->nonce test

--- test/caesium/crypto/secretbox_test.clj
+++ test/caesium/crypto/secretbox_test.clj
@@ -32,7 +32,8 @@

 (deftest int->nonce-test
   (testing "Turning numbers into nonces works"
-    (are [n nonce] (u/array-eq (s/int->nonce n) nonce)
+    (are [n expected] (u/array-eq expected (s/int->nonce n))
       0 (byte-array 24)
       0M (byte-array 24)
-      1000000000000 (byte-array (into (repeat 19 0) [0 -24 -44 -91 16])))))
+      1000000000000 (byte-array (into (vec (repeat 19 0))
+                                      [-24 -44 -91 16 0])))))


fixed uberjar AST error

fixed uberjar AST error

--- resources/leiningen/new/enslin/project.clj
+++ resources/leiningen/new/enslin/project.clj
@@ -8,4 +8,4 @@
                  [stencil "0.5.0"]]
   :local-repo ".m2/repository"
   :main ^:skip-aot {{name}}.core
-  :profiles {:uberjar {:aot :all :omit-source true}})
+  :profiles {:uberjar {:aot :all}})


CMR-1341: Addressing code review comments

--- common-lib/src/cmr/common/services/mime_types_helper.clj
+++ common-lib/src/cmr/common/services/mime_types_helper.clj
@@ -1,10 +0,0 @@
-(ns cmr.common.services.mime-types-helper
-  "This namespace provides service functions for working with mime-types."
-  (:require [cmr.common.services.errors :as errors]))
-
-(defn validate-request-mime-type
-  "Validates the requested mime type is supported."
-  [mime-type supported-types]
-  (when-not (get supported-types mime-type)
-    (errors/throw-service-error
-      :bad-request (format "The mime type [%s] is not supported." mime-type))))