Added newline back

Added newline back

--- test/com/rpl/specter/core_test.cljx
+++ test/com/rpl/specter/core_test.cljx
@@ -777,4 +777,4 @@
                (= l1 l2)
                (seq? l2)                                    ;; Transformed lists are only guaranteed to impelment ISeq
                (= q1 q2)
-               (= (type q1) (type q2))))))+               (= (type q1) (type q2))))))


format (play-it)

format (play-it)

--- src/functional_music/core.clj
+++ src/functional_music/core.clj
@@ -10,21 +10,22 @@
 ;; Clojure's doc func
 ;(doc odoc)

-;; 'odoc' is from overtone, get documentation for synth/ping
-(odoc synth/ping)
-
-;; so `synth` contains a bunch of instrument definitions that you can
-;; use already. you can try them by calling e.g.
-(synth/ping)
-
-;; some of them will fade away after a while.
-(synth/rise-fall-pad)
-
-;; some of them don't
-(synth/vintage-bass)
-
-;; switches off all sounds
-(stop)
+(comment
+  ;; 'odoc' is from overtone, get documentation for synth/ping
+  (odoc synth/ping)
+
+  ;; so `synth` contains a bunch of instrument definitions that you can
+  ;; use already. you can try them by calling e.g.
+  (synth/ping)
+
+  ;; some of them will fade away after a while.
+  (synth/rise-fall-pad)
+
+  ;; some of them don't
+  (synth/vintage-bass)
+
+  ;; switches off all sounds
+  (stop))

 ;; other synths to try
 (comment
@@ -41,61 +42,55 @@
   (stop))

 ;; now let's play a little melody
-(let [beat-ms 250
-      base-line [:D3 :A2 :A#2 :C3
-                 :D3 :F3 :G3 :C4
-                 :D4 :A3 :F3 :C3
-                 :D3 :F2 :G2 :A#2]
-      num-measures (* 1 (count base-line))]
-  (stop)
-
-  ;; first, define a recursive note player
-  (letfn [(play-it
-            ([interval instrument values]
-             (play-it (now) interval instrument values 0))
-            ([time interval instrument values counter]
-             ;; the counter is only used for this hack:
-             ;; because vintage bass "plays" forever...
-             ;; close the instrument's play envelope.
-             ;; you can try commenting this out and hear
-             ;; what happens.
-             (when (= (mod counter 4) 0)
-               (ctl instrument :gate 0))
-             (if-not (empty? values)
-               (let [value (first values)
-                     next-time (+ time interval)]
-                 (when value
-                   ;; at() is basically overtone's scheduler
-                   (at time (instrument value)))
-                 ;; after the note plays, schedule another call at the
-                 ;; later time
-                 (apply-at next-time
-                           play-it [next-time interval instrument (rest values) (inc counter)])))))]
-
-    ;; baseline plays once per 4 notes
-    (play-it (* 4 beat-ms)
-      synth/vintage-bass
-      ;; cycle the base line forever (but in reality, just for
-      ;; `num-measures` times)
-      (take num-measures (cycle (map note base-line))))
-
-    (play-it beat-ms
-      sampled-piano
-      ;; concat the sets-of-4-note-chords into a single
-      ;; seq of notes to send to play-it
-      (apply concat
-             (take num-measures
-                   ;; for each root note, use overtone's rand-chord
-                   ;; to construct a 4-note chord that spans up to
-                   ;; 24 degrees
-                   (map (fn [root-note] (rand-chord root-note :major 4 24))
-                        (cycle base-line)))))))
+;; NOTE: this fn is a hack and needs tidying up
+(comment
+  (let [beat-ms      250
+        base-line    [:D3 :A2 :A#2 :C3
+                      :D3 :F3 :G3 :C4
+                      :D4 :A3 :F3 :C3
+                      :D3 :F2 :G2 :A#2]
+        num-measures (count base-line)]
+
+    ;; first, define a recursive note player
+    (letfn [(play-it
+              ([interval instrument values]
+               (play-it (now) interval instrument values 0))
+              ([time interval instrument values counter]
+               (when (= (mod counter 4) 0)
+                 (ctl instrument :gate 0))
+               (if-not (empty? values)
+                 (let [value (first values)
+                       next-time (+ time interval)]
+                   (when value
+                     (at time (instrument value)))
+                   (apply-at next-time
+                             play-it [next-time interval instrument (rest values) (inc counter)])))))]
+
+      ;; baseline plays once per 4 notes
+      (play-it (* 4 beat-ms)
+        synth/vintage-bass
+        ;; cycle the base line forever (but in reality, just for
+        ;; `num-measures` times)
+        (take num-measures (cycle (map note base-line))))
+
+      (play-it beat-ms
+        sampled-piano
+        ;; concat the sets-of-4-note-chords into a single
+        ;; seq of notes to send to play-it
+        (apply concat
+               (take num-measures
+                     ;; for each root note, use overtone's rand-chord
+                     ;; to construct a 4-note chord that spans up to
+                     ;; 24 degrees
+                     (map (fn [root-note] (rand-chord root-note :major 4 24))
+                          (cycle base-line))))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; ok, let's get back to more basics and build up to other exciting things.

 ;; playing with the guitar synth
-(guitar-pick (guitar) 0 0) ;; String 0 (Low E) Fret 0 (open)
+(comment
+  (guitar-pick (guitar) 0 0)) ;; String 0 (Low E) Fret 0 (open)

 ;; we need a function that will play a sequence of notes; notes will
 ;; contain an arbitrarily long sequence of pairs of numbers denoting
@@ -132,7 +127,8 @@
 ")

 ;; now we can play multiple notes at the same time
-(playguitar320 [[0 3, 3 0, 4 0, 5 3]])
+(comment
+  (playguitar320 [[0 3, 3 0, 4 0, 5 3]]))

 ;; we're going to fetch the tab from
 ;; http://tabs.ultimate-guitar.com/t/tracy_chapman/fast_car_ver8_tab.htm
@@ -274,5 +270,6 @@
     (play!
      (parse-guitar-tab guitar-tab))))

-(play-tab fast-car-tab)
-
+(comment
+  (play-tab fast-car-tab))
+


fix pages.errors namespace

fix pages.errors namespace

--- src/greybear/pages/errors.clj
+++ src/greybear/pages/errors.clj
@@ -1,4 +1,4 @@
-(ns greybear.errors
+(ns greybear.pages.errors
   (:use [hiccup.page :only [html5]]))

 (def failed-authentication


Remove log message

Remove log message

--- dev/user.clj
+++ dev/user.clj
@@ -12,9 +12,7 @@
           {:overrides overrides
            :component-subset component-subset}))
   ([config-location profile options]
-   (let [{:keys [overrides component-subset
-                 ;;TODO ADD OPTION TO MESS WITH CONFIG TO DISABLE THE VERBOSE LOGGING SOMEHOW
-                 ]} options]
+   (let [{:keys [overrides component-subset]} options]
      (when-not @app/system
        (reset! app/profile (keyword (env :system-profile profile)))
        (reset! app/config-location config-location)


Fix whitespace in user.clj

Fix whitespace in user.clj

--- dev/user.clj
+++ dev/user.clj
@@ -10,21 +10,23 @@
 						[ring.mock.request :refer :all]
 						[ring.middleware.reload :as reload]
 						[wikia.common.logger :as log]
+						[pandora.domain.article :as article-domain]
 						[pandora.service.article :as article-service]
 						[pandora.http.routes :as r]
 						[pandora.gateway.mediawiki.mercury :as mercury]
+						[pandora.util.mediatype.hal :as mt-hal]
 						[pandora.vars :as vars])
   (:use [environ.core]))

 (def server (atom nil))

 (defn run
-  ([app system port]
-   (run-server
-     (app system)
-     {:port port}))
-  ([app system]
-   (run app system vars/default-port)))
+	([app system port]
+	 (run-server
+		 (app system)
+		 {:port port}))
+	([app system]
+	 (run app system vars/default-port)))

 (defn start
 	([port]


Refactor: Extract condition for arity check

--- src/midje/parsing/3_from_lexical_maps/from_fake_maps.clj
+++ src/midje/parsing/3_from_lexical_maps/from_fake_maps.clj
@@ -30,8 +30,11 @@
     (let [arg-matchers (map mkfn:arg-matcher matchers)]
        (extended-list-= actual-args arg-matchers))))

+(defn- ignore-arity-matcher? [args]
+  (= (first args) (symbol "&")))
+
 (defn mkfn:arg-matchers [arg-matchers]
-  (if (= (first arg-matchers) (symbol "&"))
+  (if (ignore-arity-matcher? arg-matchers)
     `(mkfn:arg-matchers-without-arity ~(vec (rest arg-matchers)))
     `(mkfn:arg-matchers-with-arity    ~(vec arg-matchers))))


Remove redundand space, preffix and suffix

--- src/re_natal_esp32control_app/views/ble_control.cljs
+++ src/re_natal_esp32control_app/views/ble_control.cljs
@@ -43,7 +43,7 @@
       [control-button "back"          {:lb 255 :rb 255}]
       [control-button "back right"    {:lb 255}]]]))

-(defn calc-rate-x-y [p-x p-y view-x view-y view-w view-h]
+(defn rate-x-y [p-x p-y view-x view-y view-w view-h]
   (let [harf-w (/ view-w 2)
         harf-h (/ view-h 2)
         rate-x (/ (- p-x view-x harf-w) harf-w)
@@ -59,11 +59,11 @@
         update-view-x-y #(.measure @joystick-ref (fn [fx fy w h px py]
                                                    (reset! view-x px)
                                                    (reset! view-y py)))
-        action-after-calc (fn [evt]
-                            (-> (calc-rate-x-y (.-pageX (.-nativeEvent evt))
-                                               (.-pageY (.-nativeEvent evt))
-                                               @view-x @view-y view-w view-h)
-                                (on-move)))]
+        action (fn [evt]
+                 (-> (rate-x-y (.-pageX (.-nativeEvent evt))
+                               (.-pageY (.-nativeEvent evt))
+                               @view-x @view-y view-w view-h)
+                     (on-move)))]
     (r/create-class
      {:reagent-render
       (fn []
@@ -79,8 +79,8 @@
            :on-layout #(update-view-x-y)
            :on-start-should-set-responder (fn [] true)
            :on-move-should-set-responder (fn [] true)
-           :on-responder-grant #(action-after-calc %)
-           :on-responder-move #(action-after-calc %)
+           :on-responder-grant #(action %)
+           :on-responder-move #(action %)
            :on-responder-release #(on-release)}]])

       :component-did-mount
@@ -102,9 +102,9 @@
 (defn all-range-action [{:keys [x y]}]
   (when (and x y)
     (let [f (rate->byte (- y))
-          b (rate->byte  y)
+          b (rate->byte y)
           l (rate->byte (- x))
-          r (rate->byte  x)
+          r (rate->byte x)
           lf (max 0 (- f l))
           rf (max 0 (- f r))
           lb (max 0 (- b l))


using a proper ip

using a proper ip

--- test/celestial/integration/workflows/proxmox.clj
+++ test/celestial/integration/workflows/proxmox.clj
@@ -27,7 +27,7 @@
     (fact "proxmox clone workflows" :integration :proxmox :workflow
         (wf/create (spec)) => nil
         (wf/clone
-          {:system-id 1 :hostname "bar" :owner "ronen" :machine {:ip "192.168.21.253"}}) => nil
+          {:system-id 1 :hostname "bar" :owner "ronen" :machine {:ip "192.168.3.199"}}) => nil
         (wf/destroy (assoc (s/get-system 2) :system-id 2)) => nil
         (wf/destroy (spec)) => nil)
     ))


CMR-585: Removed debug output.

CMR-585: Removed debug output.

--- test/cmr/system_int_test/transformer/granule.clj
+++ test/cmr/system_int_test/transformer/granule.clj
@@ -38,8 +38,6 @@
         g2 (dg/granule col1)
         g2-1 (d/ingest "PROV1" g2)
         g2-2 (d/ingest "PROV1" g2)]
-    (println "----------------------------")
-    (println g2-2)
     (testing "transform latest revision of granules to echo10"
       (are [v]
            (= (t/expected-response (map #(nth % 1) v) :echo10)


Some `future-facts` for the elusive ALL ALL case

--- test/structural_typing/use/f_path_mismatches.clj
+++ test/structural_typing/use/f_path_mismatches.clj
@@ -48,10 +48,25 @@
   (type! :X {[ALL ALL] [required-path even?]})
   (fact "non-collections: impossible"
     (check-for-explanations :X 1) =>   (just (err:bad-all-target [ALL ALL] 1 1))
-    (check-for-explanations :X [1]) => (just (err:bad-all-target [ALL ALL] [1] 1)))
-  (fact "nested missing or nil values: truncated"
-    (check-for-explanations :X [     ]) =future=> (just (err:required [0 ALL])))
+    (check-for-explanations :X [1]) => (just (err:bad-all-target [ALL ALL] [1] 1))))

+(future-fact "Two ALLs in a row implies that the first should be a SOME"
+  (check-for-explanations {[ALL ALL] required-path} [     ]) =future=> (just (err:required [0 ALL]))
+  (check-for-explanations {[:x ALL ALL] required-path} {:x [     ]}) =future=> (just "message")
+  (check-for-explanations {[ALL :x ALL ALL] [even? required-path]}
+                          [{:x [[2]]}
+                           {:x [[2 1] [3]]}
+                           {:x [     ]}])
+  =future=> (just "message")
+  (check-for-explanations {[ALL :x ALL ALL :z] [even? required-path]}
+                          [{:x [[{:z 2}]]}
+                           {:x [[{:z 1}]]}
+                           {:x [[{:notz 2}]]}
+                           {:x [     ]}])
+  =future=> (just "message"))
+
+
+(fact "nested missing or nil values: truncated"
   (type! :X {[:x ALL] [required-path even?]})
   (fact "as before, non-collections: impossible"
     (check-for-explanations :X {:x 1}) =>   (just (err:bad-all-target [:x ALL] {:x 1} 1)))


refactor quicklinks

refactor quicklinks

--- src/cljs/salava/extra/application/ui/routes.cljs
+++ src/cljs/salava/extra/application/ui/routes.cljs
@@ -1,7 +1,7 @@
 (ns salava.extra.application.ui.routes
    (:require [salava.core.ui.layout :as layout]
              [salava.core.i18n :as i18n :refer [t]]
-             [salava.core.ui.helper :refer [base-path]]
+             [salava.core.ui.helper :refer [base-path path-for]]
              [salava.extra.application.ui.application :as a]
              [salava.extra.application.ui.modal :as advertmodal]))

@@ -15,3 +15,7 @@
 (defn ^:export navi [context]
   {(str (base-path context) "/badge/application") {:weight 45 :title (t :extra-application/Application)  :site-navi true :breadcrumb (t :badge/Badges " / " :extra-application/Application)}})

+(defn ^:export quicklinks []
+  [{:title [:p (t :social/Iwanttoearnnewbadges)]
+    :url (str (path-for "/badge/application"))
+    :weight 5}])


[#670] Fixed bugs after PR feedback

[#670] Fixed bugs after PR feedback

--- backend/src/akvo/lumen/admin/add_tenant.clj
+++ backend/src/akvo/lumen/admin/add_tenant.clj
@@ -91,9 +91,9 @@
   [v]
   (let [url (URL. v)]
     (if (= (:kc-url env) "http://localhost:8080")
-      (when (= (.getProtocol v) "https")
+      (when (= (.getProtocol url) "https")
         (throw (ex-info "Use http in development mode" {:url v})))
-      (when (= (.getProtocol v) "https")
+      (when (= (.getProtocol url) "https")
         (throw (ex-info "Url should use https" {:url v}))))
     (format "%s://%s" (.getProtocol url) (.getHost url))))

@@ -281,8 +281,8 @@
 (defn -main [url title email]
   (try
     (check-env-vars)
-    (let [{keys [email label title url]} (conform-input url title email)]
-      (setup-database label title)
+    (let [{:keys [email label title url]} (conform-input url title email)]
+      #_(setup-database label title)
       (let [user-creds (setup-tenant-in-keycloak label email url)]
         (println "Credentials:")
         (pprint user-creds)))


Improved session example.

Improved session example.

--- examples/sessionexample/src/sessionexample/core.clj
+++ examples/sessionexample/src/sessionexample/core.clj
@@ -12,59 +12,85 @@
             [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]])
   (:gen-class))

-;; This macro works as decorator
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Controllers                                      ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defmacro authentication-required
-  [handler]
-  `(fn [request#]
-     (if (authenticated? request#)
-       (~handler request#)
-       (throw-unauthorized {:msg "Valid user is required"}))))
+(defn home-ctrl
+  [request]
+  ;; This is a simple example of using a unauthorized exception
+  ;; and how is captured by authorization backend and the default
+  ;; unauthorized request handler redirects a user to login page.
+  (if-not (authenticated? request)
+    (throw-unauthorized)
+    (response (slurp (io/resource "index.html")))))

-;; Views
+(defn login-ctrl
+  [request]
+  (cond
+   (= (:request-method request) :get)
+   (render (slurp (io/resource "login.html")) request)

-(defn home-view
-  [request]
-  (response (slurp (io/resource "index.html"))))
+   (= (:request-method request) :post)
+   (let [username  (get-in request [:form-params "username"])
+         session   (-> (:session request)
+                       (assoc :identity (keyword username)))]
+     (-> (redirect (get-in request [:query-params :next] "/"))
+         (assoc :session session)))))

-(defn login-view
-  [t request]
-  (if (= t :get)
-    (render (slurp (io/resource "login.html")) request)
-    (let [username  (get (:form-params request) "username")
-          session   (assoc (:session request) :identity (keyword username))]
-      (-> (redirect (get (:query-params request) :next "/"))
-          (assoc :session session)))))
-
-(defn logout-view
+(defn logout-ctrl
   [request]
   (-> (redirect "/login")
       (assoc :session {})))

-;; Routes
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Routes and Middlewares                           ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; User defined application routes
+;; using compojure routing library
+;; Note: no any middleware for authorization,
+;; all authorization system is totally decoupled
+;; from main routes.

 (defroutes app
-  (GET "/" [] (authentication-required home-view))
-  (GET "/login" [] (partial login-view :get))
-  (POST "/login" [] (partial login-view :post))
-  (GET "/logout" [] logout-view))
+  (GET "/" [] home-ctrl)
+  (ANY "/login" [] login-ctrl)
+  (GET "/logout" [] logout-ctrl))
+

 ;; Self defined unauthorized handler

 (defn unauthorized-handler
   [request metadata]
   (if (authenticated? request)
-    (render (slurp (io/resource "error.html")) request)
+
+    ;; If request is authenticated, raise 403 instead
+    ;; of 401 (because user is authenticated but permission
+    ;; denied is raised).
+    (-> (render (slurp (io/resource "error.html")) request)
+        (assoc :status 403))
+
+    ;; Else, redirect it to login with link of current url
+    ;; for post login redirect user to current url.
     (let [current-url (:uri request)]
       (redirect (format "/login?next=%s" current-url)))))

 (defn -main
   [& args]
-  (let [backend (session-backend :unauthorized-handler unauthorized-handler)
-        handler (-> app
-                    (wrap-params)
+  (let [;; Create new backend overwriting the default exception
+        ;; handler for authorization handler.
+        backend (session-backend :unauthorized-handler unauthorized-handler)
+
+        ;; Wrap a routers handler with some middlewares
+        ;; such as authorization, authentication, params
+        ;; and session.
+        app     (-> app
                     (wrap-authorization backend)
                     (wrap-authentication backend)
+                    (wrap-params)
                     (wrap-session))]
+
+    ;; Use jetty adapter for run this example.
     (println "Now listening on: http://127.0.0.1:9090/")
-    (jetty/run-jetty handler {:port 9090})))
+    (jetty/run-jetty app {:port 9090})))


removes version for token (#1349)

removes version for token (#1349)

--- waiter/integration/waiter/token_request_test.clj
+++ waiter/integration/waiter/token_request_test.clj
@@ -1976,7 +1976,7 @@
           token-2 (create-token-name waiter-url ".")
           token-description (retrieve-service-mapping-parameters service-name "invalid")]
       (try
-        (let [token-parameters (-> token-description (dissoc :cmd :cmd-type) (assoc :service-mapping "legacy" :token token-1))
+        (let [token-parameters (-> token-description (dissoc :cmd :cmd-type :version) (assoc :service-mapping "legacy" :token token-1))
               response (post-token waiter-url token-parameters)]
           (assert-response-status response http-200-ok))
         (try


Remove race condition in test

Remove race condition in test

Because the scheduler runs on a different thread than the test, we must
ensure that we deliver the promise *after* the job has been deleted. We
do that by registering another trigger handler that runs *after* the
housekeeper registered in the default QuartzScheduling instance.

--- modules/scheduling/src/test/clojure/wunderboss/scheduling_tests.clj
+++ modules/scheduling/src/test/clojure/wunderboss/scheduling_tests.clj
@@ -16,6 +16,7 @@
   (:require [clojure.test :refer :all])
   (:import [org.projectodd.wunderboss Option WunderBoss]
            [org.projectodd.wunderboss.scheduling Scheduling Scheduling$ScheduleOption]
+           org.quartz.listeners.TriggerListenerSupport
            org.quartz.TriggerUtils
            java.util.Date))

@@ -221,7 +222,16 @@
   (is (empty? (.scheduledJobs default)))
   (let [p (promise)
         id "auto-unschedule"]
-    (.schedule default id #(deliver p :success) {})
+    (-> (.scheduler default)
+      .getListenerManager
+      (.addTriggerListener (proxy [TriggerListenerSupport] []
+                             (getName [] id)
+                             (triggerComplete [_ _ _]
+                               (deliver p :success)))))
+    (.schedule default id #() {})
     (is (= :success (deref p 1000 :failure)))
-    (is (false? (.unschedule default id))))
-  (is (empty? (.scheduledJobs default))))
+    (is (false? (.unschedule default id)))
+    (is (empty? (.scheduledJobs default)))
+    (-> (.scheduler default)
+      .getListenerManager
+      (.removeTriggerListener id))))


edit command as an line separated array

edit command as an line separated array

--- src/cljs/swarmpit/component/service/form_settings.cljs
+++ src/cljs/swarmpit/component/service/form_settings.cljs
@@ -143,7 +143,7 @@
      :InputLabelProps {:shrink true}
      :onChange        (fn [event]
                         (let [value (-> event .-target .-value)]
-                          (state/update-value [:command] (when (< 0 (count value)) (str/split value #" ")) form-value-cursor)))}))
+                          (state/update-value [:command] (when (< 0 (count value)) (str/split value #"\n")) form-value-cursor)))}))

 (defn tags-handler
   [repository]
@@ -190,4 +190,4 @@
       (comp/grid
         {:item true
          :xs   12}
-        (form-command (str/join " " command))))))
+        (form-command (str/join "\n" command))))))


add real copy to info

add real copy to info

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -126,11 +126,11 @@
                   (common/icon :times)]
                  [:article {:on-click #(.stopPropagation :overlay-info-toggled)}
                   [:h1 "What's this?"]
-                  [:p "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-                      Nulla non magna tincidunt, malesuada felis in, feugiat tellus "
-                      [:a {:href "#"} "feugiat tellus"]
-                      ". Ut interdum scelerisque purus, et condimentum libero vehicula in.
-                      Fusce sapien libero, iaculis fermentum erat et.
-                      Praesent lacinia accumsan eros sed euismod."]
+                  [:p "Precursor is a collaborative idea tool.
+                      Think of it as a notebook with infinite pages – use it to create rapid sketches, prototypes, notes, and everything in between.
+                      Collaborate by sharing your URL, and you'll instantly have multiple people working in the same document.
+                      It's still a work in progress, so if you have feedback or a great idea for us sketch it up and ping "
+                      [:a {:role "button"} "@precursor"]
+                      " in the chat."]
                   [:button.info-okay {:on-click #(cast! :overlay-info-toggled)}
                    "Okay, sounds good."]]]]])))))


indenting

indenting

--- src/celestial/persistency/systems.clj
+++ src/celestial/persistency/systems.clj
@@ -97,7 +97,7 @@
      (if (map? (first args))
       (let [id (apply f args) spec (first args)]
         (es/put (str id) spec) id)
-       (apply f args)))
+      (apply f args)))

 (defn es-delete
    "reducing usage quotas for owning user on delete"


address some static code analysis problems

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -75,16 +75,16 @@

 (defn- delay-balances?
   [entity-id]
-  true
   (get-in @ambient-settings [entity-id :delay-balances?]))

 (defn- before-save-item
   "Makes pre-save adjustments for a transaction item"
   [item]
-  (cond-> item
-    true (update-in [:action] name)
-    (and (string? (:memo item))
-         (empty? (:memo item))) (dissoc :memo)))
+  (let [updated (update-in item [:action] name)]
+    (if (and (string? (:memo item))
+             (empty? (:memo item)))
+      (dissoc updated :memo)
+      updated)))

 (defn polarize-item-amount
   [item account]
@@ -96,10 +96,12 @@
   ([item] (after-item-read item nil))
   ([item account]
    (if (map? item)
-     (cond-> item
-       true (update-in [:action] keyword)
-       true (assoc :reconciled? (= "completed" (:reconciliation-status item)))
-       account (polarize-item-amount account))
+     (let [updated (-> item
+                       (update-in [:action] keyword)
+                       (assoc :reconciled? (= "completed" (:reconciliation-status item))))]
+       (if account
+         (polarize-item-amount updated account)
+         updated))
      item)))

 (defn- item-value-sum
@@ -129,18 +131,25 @@

 (defn- before-item-validation
   [item]
-  (cond-> item
-    true (update-in [:value] #(or % (:amount item)))
-    true (assoc :balance (bigdec 0))
-    true (update-in [:index] (fnil identity (Integer/MAX_VALUE)))
-    (string? (:account-id item)) (update-in [:account-id] #(Integer. %))
-    (nil? (:id item)) (dissoc :id)
+  (cond->
+    (-> item
+        (update-in [:value] #(or % (:amount item)))
+        (assoc :balance (bigdec 0))
+        (update-in [:index] (fnil identity (Integer/MAX_VALUE))))
+
+    (string? (:account-id item))
+    (update-in [:account-id] #(Integer. %))
+
+    (or (nil? (:id item))
+        (and
+          (string? (:id item))
+          (empty? (:id item))))
+    (dissoc :id)
+
     (and
       (string? (:id item))
-      (empty? (:id item))) (dissoc :id)
-    (and
-      (string? (:id item))
-      (not (empty? (:id item)))) (update-in [:id] #(UUID/fromString %))))
+      (not (empty? (:id item))))
+    (update-in [:id] #(UUID/fromString %)))) ; TODO: use coercion rule for this

 (def ^:private coercion-rules
   [(coercion/rule :uuid [:id])
@@ -269,22 +278,6 @@
                      :items []
                      :storage storage}
                     sorted-items))))
-
-(defn- calculate-balances-and-indexes
-  "Updates transaction item and account balances resulting from the
-  specified transaction.
-
-  The balance for each transaction item is the sum of the balance of
-  the previous transaction item and the polarized transaction amount.
-
-  The polarized transaction amount is the positive or negative change
-  on the balance of the associated account and is dependant on the action
-  (debit or credit) and the account type (asset, liability, equity,
-  income, or expense)"
-  [storage items]
-  (->> items
-       (group-by :account-id)
-       (mapcat #(add-item-balance-and-index storage %))))

 (defn- subsequent-items
   "Returns items in the specified account on or after the specified
@@ -580,20 +573,20 @@
 (defn- create-transaction-and-adjust-balances
   [storage transaction]
   (let [created (link-lots storage (create-transaction* storage transaction))]
-    (->> (:items transaction)
-
-         ; create database records
-         (map #(assoc % :transaction-id (:id created)))
-         (map #(create-transaction-item* storage %))
-
-         ; process indexes and balances, update affected accounts
-         (group-by :account-id)
-         (map second)
-         (map #(sort-by :index %))
-         (map first)
-         (map #(get-previous-item storage %))
-         (map #(recalculate-account-items storage %))
-         (mapv #(recalculate-account-items storage %)))
+    (doall (->> (:items transaction)
+
+                ; create database records
+                (map #(assoc % :transaction-id (:id created)))
+                (map #(create-transaction-item* storage %))
+
+                ; process indexes and balances, update affected accounts
+                (group-by :account-id)
+                (map second)
+                (map #(sort-by :index %))
+                (map first)
+                (map #(get-previous-item storage %))
+                (map #(recalculate-account-items storage %))
+                (map #(recalculate-account-items storage %))))
     (reload storage created)))

 (defn create


repair display of availability

repair display of availability

--- src/cljs/phonecat_re_frame/views.cljs
+++ src/cljs/phonecat_re_frame/views.cljs
@@ -117,8 +117,7 @@
    [:span "Availability and Networks"]
    [:dl
     [:dt "Availability"]
-    (for [availability @availability]
-      availability)]])
+    (for [availability @availability] availability)]])

 (defn battery
   [battery]
@@ -198,7 +197,7 @@
   "component for displaying the specs of the phone"
   [phone]
   [:ul {:class "specs"}
-   [availability (reaction (:availiability @phone))]
+   [availability (reaction (:availability @phone))]
    [battery (reaction (:battery @phone))]
    [storage-and-memory (reaction (:storage @phone))]
    [connectivity (reaction (:connectivity @phone))]


Fix typo

Fix typo

--- src/obb_rules/actions/auto_deploy.clj
+++ src/obb_rules/actions/auto_deploy.clj
@@ -1,5 +1,6 @@
 (ns obb-rules.actions.auto-deploy
-  "Auto deploys units to the battleground, based on predifined templates"
+  "Auto deploys units to the battleground, based on predefined templates"
+  ^{:added "1.5" :author "Pedro Santos"}
   (:require [obb-rules.result :as result]))

 (defn build-auto-deploy


skip team/realm checks on missing tokeninfo

--- src/org/zalando/stups/friboo/user.clj
+++ src/org/zalando/stups/friboo/user.clj
@@ -58,14 +58,22 @@
 (defn require-internal-user
   "Makes sure the user is either a service user, or an employee.
    In the latter case the user must belong to at least one team."
-  [request]
-  (let [realm (require-realms #{"employees" "services"} request)]
-    (when (= realm "employees")
-      (require-teams request))))
-
+  [{:keys [tokeninfo] :as request}]
+  (when tokeninfo
+    ((let [realm (require-realms #{"employees" "services"} request)]
+       (when (= realm "employees")
+         (require-teams request))))))

 (defn require-internal-team
   "Makes sure the user is an employee and belongs to the given team."
-  [team request]
-  (require-realms #{"employees"} request)
-  (require-team team request))+  [team {:keys [tokeninfo] :as request}]
+  (when tokeninfo
+    (require-realms #{"employees"} request)
+    (require-team team request)))
+
+(defn require-any-internal-team
+  "Makes sure the user is an employee and belongs to any team."
+  [{:keys [tokeninfo] :as request}]
+  (when tokeninfo
+    (require-realms #{"employees"} request)
+    (require-teams request)))


Add github-component#get-tarball for download .tar.gz

--- src/puppeteer/infra/client/github.clj
+++ src/puppeteer/infra/client/github.clj
@@ -9,6 +9,13 @@
   (some->> (assoc base-opt :ref ref)
            (repos/contents user repo path)
            :content))
+
+(defn get-tarball
+  [{:keys [base-opt]}
+   {:keys [user repo ref]}]
+  (core/raw-api-call :get "repos/%s/%s/tarball/%s"
+                     [user repo ref]
+                     base-opt))

 (defrecord GithubComponent [github-oauth-token base-opt]
   component/Lifecycle


(PDB-4636) core: move argument parsing to a separate function

It's logically independent (e.g. it's the only code that needs to know
about TK's command line error exceptions), and this will support the
upcoming custom exit status work.

--- src/puppetlabs/trapperkeeper/core.clj
+++ src/puppetlabs/trapperkeeper/core.clj
@@ -158,6 +158,21 @@
     (run-app app)
     (swap! internal/tk-apps (partial remove #{app}))))

+(defn- parse-args [args]
+  (let [quit (fn [status msg stream]
+               (binding [*out* stream]
+                 (println msg)
+                 (flush))
+               (System/exit status))]
+    (try
+      (internal/parse-cli-args! (or args ()))
+      (catch ExceptionInfo ex
+        (let [{:keys [kind msg] :as data} (ex-data ex)]
+          (case (some-> kind without-ns)
+            :cli-error (quit 1 msg *err*)
+            :cli-help (quit 0 msg *out*)
+            (throw ex)))))))
+
 (defn main
   "Launches the trapperkeeper framework. This function blocks until
   trapperkeeper is shut down. This may be called directly, but is also called by
@@ -166,17 +181,8 @@
   [& args]
   {:pre [((some-fn sequential? nil?) args)
          (every? string? args)]}
-  (let [quit (fn [status msg stream]
-               (binding [*out* stream] (println msg) (flush))
-               (System/exit status))]
-    (try
-      (run (internal/parse-cli-args! (or args '())))
-      (catch ExceptionInfo ex
-        (let [{:keys [kind msg] :as data} (ex-data ex)]
-          (case (some-> kind without-ns)
-            :cli-error (quit 1 msg *err*)
-            :cli-help (quit 0 msg *out*)
-            (throw ex))))
-      (finally
-        (log/debug (i18n/trs "Finished TK main lifecycle, shutting down Clojure agent threads."))
-        (shutdown-agents)))))
+  (try
+    (run (parse-args args))
+    (finally
+      (log/debug (i18n/trs "Finished TK main lifecycle, shutting down Clojure agent threads."))
+      (shutdown-agents))))


Switch to parseLong instead of parseInt due to length constraints

--- src/rsvp_backend/handlers/invitee.clj
+++ src/rsvp_backend/handlers/invitee.clj
@@ -10,7 +10,7 @@
   [request]
   (let [query (:query (:params request))
         keywordized-req-body (clj-walk/keywordize-keys (:body request))
-        code (Integer/parseInt (:code keywordized-req-body))
+        code (Long/parseLong (:code keywordized-req-body))
         updated-req-body (assoc keywordized-req-body :code code)
         resp (db/create-invitee updated-req-body)]
     (if (= resp "AWS_ERROR")
@@ -20,7 +20,7 @@
 (defn get-invitee
   [request]
   (let [code (:code (:route-params request))
-        data (db/get-invitee (Integer/parseInt code))]
+        data (db/get-invitee (Long/parseLong code))]
     (cond
       (nil? data) (res/status (res/response {:status "NOT_FOUND"}) 404)
       (= data "AWS_ERROR") (res/status (res/response {:status "AWS_ERROR"}) 500)
@@ -29,7 +29,7 @@

 (defn update-metadata
   [request]
-  (let [code (Integer/parseInt (:code (:route-params request)))
+  (let [code (Long/parseLong (:code (:route-params request)))
         keywordized-req-body (clj-walk/keywordize-keys (:body request))
         resp (db/update-invitee-metadata code keywordized-req-body)]
     (if (= resp "AWS_ERROR")
@@ -38,7 +38,7 @@

 (defn update-rsvp
   [request]
-  (let [code (Integer/parseInt (:code (:route-params request)))
+  (let [code (Long/parseLong (:code (:route-params request)))
         user-response (:response (clj-walk/keywordize-keys (:body request)))
         resp (db/update-rsvp-status code user-response)]
     (if (= resp "AWS_ERROR")
@@ -47,7 +47,7 @@

 (defn update-details
   [request]
-  (let [code (Integer/parseInt (:code (:route-params request)))
+  (let [code (Long/parseLong (:code (:route-params request)))
         keywordized-req-body (clj-walk/keywordize-keys (:body request))
         resp (db/update-invitee-details code keywordized-req-body)]
     (if (= resp "AWS_ERROR")
@@ -56,7 +56,7 @@

 (defn update-additional-invitees
   [request]
-  (let [code (Integer/parseInt (:code (:route-params request)))
+  (let [code (Long/parseLong (:code (:route-params request)))
         keywordized-request-body (clj-walk/keywordize-keys (:body request))
         resp (db/update-additional-invitees code (:additional_invitees keywordized-request-body))]
     (if (= resp "AWS_ERROR")
@@ -65,7 +65,7 @@

 (defn update-optional-info
   [request]
-  (let [code (Integer/parseInt (:code (:route-params request)))
+  (let [code (Long/parseLong (:code (:route-params request)))
         keywordized-req-body (clj-walk/keywordize-keys (:body request))
         resp (db/update-optional-info code keywordized-req-body)]
     (if (= resp "AWS_ERROR")


Adding MAP enumeration type to umm-spec-lib/src/cmr/umm_spec/util.clj for CMR-4219

--- umm-spec-lib/src/cmr/umm_spec/util.clj
+++ umm-spec-lib/src/cmr/umm_spec/util.clj
@@ -69,7 +69,7 @@
                                      "WEB MAP FOR TIME SERIES"
                                      "WEB MAP SERVICE (WMS)"
                                      "WORKFLOW (SERVICE CHAIN)"]}
-   "VisualizationURL" {"GET RELATED VISUALIZATION" ["GIBS" "GIOVANNI"]}
+   "VisualizationURL" {"GET RELATED VISUALIZATION" ["GIBS" "GIOVANNI" "MAP"]}
    "CollectionURL" {"DATA SET LANDING PAGE" []
                     "DOI" []
                     "EXTENDED METADATA" []


fix API endpoint

fix API endpoint

--- src/metabase/api/revision.clj
+++ src/metabase/api/revision.clj
@@ -24,8 +24,8 @@

 (defendpoint POST "/revert"
   "Revert an object to a prior revision."
-  [entity id revision-id]
-  {entity Entity, id Integer, revision-id Integer}
-  (revision/revert :entity entity, :id id, :revision-id revision-id))
+  [:as {{:keys [entity id revision_id]} :body}]
+  {entity Entity, id Integer, revision_id Integer}
+  (revision/revert :entity entity, :id id, :revision-id revision_id))

 (define-routes)


STORM-403: heartbeats-to-nimbus in supervisor-test failed due to unintentional worker launch

--- storm-core/test/clj/backtype/storm/supervisor_test.clj
+++ storm-core/test/clj/backtype/storm/supervisor_test.clj
@@ -229,16 +229,16 @@
                        {"1" (thrift/mk-spout-spec (TestPlannerSpout. true) :parallelism-hint 4)}
                        {}))
       ;; prevent them from launching by capturing them
-      (capture-changed-workers (submit-local-topology (:nimbus cluster) "test" {TOPOLOGY-WORKERS 2} topology))
-      (advance-cluster-time cluster 3)
-      (check-heartbeat cluster "sup" 3)
-      (advance-cluster-time cluster 3)
-      (check-heartbeat cluster "sup" 3)
-      (advance-cluster-time cluster 3)
-      (check-heartbeat cluster "sup" 3)
-      (advance-cluster-time cluster 20)
-      (check-heartbeat cluster "sup" 3)
-
+      (capture-changed-workers
+       (submit-local-topology (:nimbus cluster) "test" {TOPOLOGY-WORKERS 2} topology)
+       (advance-cluster-time cluster 3)
+       (check-heartbeat cluster "sup" 3)
+       (advance-cluster-time cluster 3)
+       (check-heartbeat cluster "sup" 3)
+       (advance-cluster-time cluster 3)
+       (check-heartbeat cluster "sup" 3)
+       (advance-cluster-time cluster 20)
+       (check-heartbeat cluster "sup" 3))
       )))

 (deftest test-worker-launch-command


branchings2d.clj: the generator works

branchings2d.clj: the generator works

--- clojure/org/gavrog/clojure/branchings2d.clj
+++ clojure/org/gavrog/clojure/branchings2d.clj
@@ -3,14 +3,21 @@
           [generators :only [make-backtracker results]]
           [delaney])))

-(defn canonical? [ds]
-  (= (zipmap (elements ds) (elements ds))
-     (into {} (.getMapToCanonical (java-dsymbol ds)))))
-
 (defn branchings [d-set min-face-degree min-vert-degree min-curvature]
-  (make-backtracker
-    {:root (let [orbs (for [i [0 1], D (orbit-reps d-set [i (inc i)])] [i D])]
-             [d-set (into #{} orbs) {}])
-     :extract (fn [[ds unused spins]]
-                (when (and (empty? unused) (canonical? ds)) ds))
-     :children (fn [[]])}))
+  (let [ds (canonical d-set)
+        good-degree (fn [i D v]
+                      (cond (= 0 i) (<= min-face-degree (* v (r ds 0 1 D)))
+                            (= 1 i) (<= min-vert-degree (* v (r ds 1 2 D)))))]
+    (make-backtracker
+      {:root (let [orbs (for [i [0 1], D (orbit-reps ds [i (inc i)])] [i D])]
+               [ds (into #{} orbs)])
+       :extract (fn [[ds unused]]
+                  (when (and (empty? unused)
+                             (canonical? ds)
+                             (<= min-curvature (curvature ds)))
+                    ds))
+       :children (fn [[ds unused]]
+                   (when-let [[i D] (first unused)]
+                     (for [v [1 2 3 4 6]
+                           :when (good-degree i D v)]
+                       [(spin ds i (inc i) D v) (disj unused [i D])])))})))


Bump boot-reload to solve the css reloading problem

--- resources/leiningen/new/lambone/common/build.boot
+++ resources/leiningen/new/lambone/common/build.boot
@@ -55,7 +55,7 @@
                            [adzerk/cljs-console "0.1.1" :exclusions [adzerk/env] :scope "test"]
                            ;; dev only
                            [adzerk/boot-cljs "1.7.228-1" :scope "test"]
-                           [adzerk/boot-reload "0.4.8" :scope "test"]
+                           [adzerk/boot-reload "0.4.9" :scope "test"]
                            [deraen/boot-sass "0.2.1" :scope "test"]
                            [crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT" :scope "test"]
                            [org.slf4j/slf4j-nop "1.7.21" :scope "test"]


Fix namespace prefix.

Fix namespace prefix.

--- test/onyx/flow_conditions/flow_conditions_gen_test.clj
+++ test/onyx/flow_conditions/flow_conditions_gen_test.clj
@@ -5,7 +5,7 @@
             [clojure.test :refer :all]
             [com.gfredericks.test.chuck :refer [times]]
             [com.gfredericks.test.chuck.clojure-test :refer [checking]]
-            [onyx.peer.task-lifecycle :as t]
+            [onyx.flow-conditions.fc-routing :as r]
             [onyx.peer.task-compile :as c]
             [onyx.api]))

@@ -104,7 +104,7 @@
 (deftest nil-flow-conditions
   "No flow condition routes to all downstream tasks"
   (let [downstream [:a :b]
-        route (t/route-data nil nil nil nil downstream)]
+        route (r/route-data nil nil nil nil downstream)]
     (is (= downstream (:flow route)))
     (is (nil? (:action route)))))

@@ -113,7 +113,7 @@
   (let [e (ex-info "hih" {})
         wrapped-e (ex-info "" {:exception e})]
     (is (thrown? clojure.lang.ExceptionInfo
-                 (t/route-data nil nil wrapped-e nil [:a :b])))))
+                 (r/route-data nil nil wrapped-e nil [:a :b])))))

 (deftest conj-downstream-tasks-together
   (checking
@@ -130,7 +130,7 @@
          target-tasks (mapcat :flow/to flow-conditions)
          downstream (into other-downstream-tasks target-tasks)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil flow-conditions downstream)]
+         results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} target-tasks) (into #{} (:flow results))))
      (is (nil? (:action results))))))

@@ -152,7 +152,7 @@
          downstream (mapcat :flow/to true-fcs false-fcs)
          compiled (c/compile-fc-norms flow-conditions :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil flow-conditions downstream)]
+         results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (mapcat :flow/to true-fcs)) (into #{} (:flow results))))
      (is (nil? (:action results))))))

@@ -187,7 +187,7 @@
          downstream (mapcat :flow/to flow-conditions)
          compiled (c/compile-fc-norms flow-conditions :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil flow-conditions downstream)]
+         results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (:flow/to (first true-1))) (into #{} (:flow results))))
      (is (nil? (:action results))))))

@@ -233,7 +233,7 @@
          downstream (mapcat :flow/to flow-conditions)
          compiled (c/compile-fc-norms flow-conditions :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil flow-conditions downstream)]
+         results (r/route-data event nil nil flow-conditions downstream)]
      (is (not (seq (:flow results))))
      (is (= :retry (:action results))))))

@@ -254,7 +254,7 @@
    (let [downstream (mapcat :flow/to mixed)
          compiled (c/compile-fc-norms mixed :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil mixed downstream)
+         results (r/route-data event nil nil mixed downstream)
          matches (filter :pred/val mixed)
          excluded-keys (mapcat :flow/exclude-keys matches)]
      (is (into #{} excluded-keys) (:exclusions results))
@@ -289,7 +289,7 @@
          downstream (mapcat :flow/to fcs)
          compiled (c/compile-fc-norms fcs :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil fcs downstream)]
+         results (r/route-data event nil nil fcs downstream)]
      (is (= (into #{} downstream) (into #{} (:flow/to results))))
      (is (nil? (:action results))))))

@@ -322,7 +322,7 @@
          downstream (mapcat :flow/to fcs)
          compiled (c/compile-fc-norms fcs :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil fcs downstream)]
+         results (r/route-data event nil nil fcs downstream)]
      (is (not (seq (:flow/to results))))
      (is (nil? (:action results))))))

@@ -354,7 +354,7 @@
          downstream (mapcat :flow/to fcs)
          compiled (c/compile-fc-norms fcs :a)
          event {:onyx.core/compiled-norm-fcs compiled}
-         results (t/route-data event nil nil fcs downstream)
+         results (r/route-data event nil nil fcs downstream)
          xform (:flow/post-transformation (first true-xform))]
      (is (= xform (:post-transformation results)))
      (is (nil? (:action results))))))


Add `ctx-handler->interceptor`

Add `ctx-handler->interceptor`

--- src/re_frame/interceptor.cljc
+++ src/re_frame/interceptor.cljc
@@ -340,6 +340,7 @@
                      (assoc context :effects))))))

+(defn ctx-handler->interceptor

 ;; -- Interceptors Factories -  PART 2 ------------------------------------------------------------
 ;;


Improved error reporting.

Improved error reporting.

--- src/uxbox/frontend/errors.clj
+++ src/uxbox/frontend/errors.clj
@@ -27,9 +27,9 @@
 (defmethod handler clojure.lang.ExceptionInfo
   [context err]
   (let [message (.getMessage err)
-        data (ex-data err)]
-    (-> (ufc/rsp {:message message
-                  :payload data})
+        response {:type :error
+                  :code message}]
+    (-> (ufc/rsp (merge response (ex-data err)))
         (http/bad-request))))

 (defmethod handler org.jooq.exception.DataAccessException
@@ -39,7 +39,8 @@
         message (.getMessage err)]
     (case state
       "P0002"
-      (-> (ufc/rsp {:message message
+      (-> (ufc/rsp {:type :error
+                    :message message
                     :code "errors.api.occ"})
           (http/bad-request))

@@ -51,6 +52,7 @@
   [context err]
   (println "????" (class err))
   (let [message (.getMessage err)]
-    (-> (ufc/rsp {:message message
+    (-> (ufc/rsp {:type :error
+                  :message message
                   :code "errors.api.unexpected"})
         (http/internal-server-error))))


Call a single meetup function per exercism/exercism.io#950

- Per https://github.com/exercism/xclojure/issues/21 we don't want to be doing metaprogramming at this point (Or in the example code's case, dynamically creating functions)

--- meetup/meetup_test.clj
+++ meetup/meetup_test.clj
@@ -4,276 +4,276 @@
 (load-file "meetup.clj")

 (deftest monteenth-of-may-2013
-  (is (= [2013 5 13] (meetup/monteenth 5 2013))))
+  (is (= [2013 5 13] (meetup/meetup 5 2013 :monday :teenth))))

 (deftest monteenth-of-august-2013
-  (is (= [2013 8 19] (meetup/monteenth 8 2013))))
+  (is (= [2013 8 19] (meetup/meetup 8 2013 :monday :teenth))))

 (deftest monteenth-of-september-2013
-  (is (= [2013 9 16] (meetup/monteenth 9 2013))))
+  (is (= [2013 9 16] (meetup/meetup 9 2013 :monday :teenth))))

 (deftest tuesteenth-of-march-2013
-  (is (= [2013 3 19] (meetup/tuesteenth 3 2013))))
+  (is (= [2013 3 19] (meetup/meetup 3 2013 :tuesday :teenth))))

 (deftest tuesteenth-of-april-2013
-  (is (= [2013 4 16] (meetup/tuesteenth 4 2013))))
+  (is (= [2013 4 16] (meetup/meetup 4 2013 :tuesday :teenth))))

 (deftest tuesteenth-of-august-2013
-  (is (= [2013 8 13] (meetup/tuesteenth 8 2013))))
+  (is (= [2013 8 13] (meetup/meetup 8 2013 :tuesday :teenth))))

 (deftest wednesteenth-of-january-2013
-  (is (= [2013 1 16] (meetup/wednesteenth 1 2013))))
+  (is (= [2013 1 16] (meetup/meetup 1 2013 :wednesday :teenth))))

 (deftest wednesteenth-of-february-2013
-  (is (= [2013 2 13] (meetup/wednesteenth 2 2013))))
+  (is (= [2013 2 13] (meetup/meetup 2 2013 :wednesday :teenth))))

 (deftest wednesteenth-of-june-2013
-  (is (= [2013 6 19] (meetup/wednesteenth 6 2013))))
+  (is (= [2013 6 19] (meetup/meetup 6 2013 :wednesday :teenth))))

 (deftest thursteenth-of-may-2013
-  (is (= [2013 5 16] (meetup/thursteenth 5 2013))))
+  (is (= [2013 5 16] (meetup/meetup 5 2013 :thursday :teenth))))

 (deftest thursteenth-of-june-2013
-  (is (= [2013 6 13] (meetup/thursteenth 6 2013))))
+  (is (= [2013 6 13] (meetup/meetup 6 2013 :thursday :teenth))))

 (deftest thursteenth-of-september-2013
-  (is (= [2013 9 19] (meetup/thursteenth 9 2013))))
+  (is (= [2013 9 19] (meetup/meetup 9 2013 :thursday :teenth))))

 (deftest friteenth-of-april-2013
-  (is (= [2013 4 19] (meetup/friteenth 4 2013))))
+  (is (= [2013 4 19] (meetup/meetup 4 2013 :friday :teenth))))

 (deftest friteenth-of-august-2013
-  (is (= [2013 8 16] (meetup/friteenth 8 2013))))
+  (is (= [2013 8 16] (meetup/meetup 8 2013 :friday :teenth))))

 (deftest friteenth-of-september-2013
-  (is (= [2013 9 13] (meetup/friteenth 9 2013))))
+  (is (= [2013 9 13] (meetup/meetup 9 2013 :friday :teenth))))

 (deftest saturteenth-of-february-2013
-  (is (= [2013 2 16] (meetup/saturteenth 2 2013))))
+  (is (= [2013 2 16] (meetup/meetup 2 2013 :saturday :teenth))))

 (deftest saturteenth-of-april-2013
-  (is (= [2013 4 13] (meetup/saturteenth 4 2013))))
+  (is (= [2013 4 13] (meetup/meetup 4 2013 :saturday :teenth))))

 (deftest saturteenth-of-october-2013
-  (is (= [2013 10 19] (meetup/saturteenth 10 2013))))
+  (is (= [2013 10 19] (meetup/meetup 10 2013 :saturday :teenth))))

 (deftest sunteenth-of-map-2013
-  (is (= [2013 5 19] (meetup/sunteenth 5 2013))))
+  (is (= [2013 5 19] (meetup/meetup 5 2013 :sunday :teenth))))

 (deftest sunteenth-of-june-2013
-  (is (= [2013 6 16] (meetup/sunteenth 6 2013))))
+  (is (= [2013 6 16] (meetup/meetup 6 2013 :sunday :teenth))))

 (deftest sunteenth-of-october-2013
-  (is (= [2013 10 13] (meetup/sunteenth 10 2013))))
+  (is (= [2013 10 13] (meetup/meetup 10 2013 :sunday :teenth))))

 (deftest first-monday-of-march-2013
-  (is (= [2013 3 4] (meetup/first-monday 3 2013))))
+  (is (= [2013 3 4] (meetup/meetup 3 2013 :monday :first))))

 (deftest first-monday-of-april-2013
-  (is (= [2013 4 1] (meetup/first-monday 4 2013))))
+  (is (= [2013 4 1] (meetup/meetup 4 2013 :monday :first))))

 (deftest first-tuesday-of-may-2013
-  (is (= [2013 5 7] (meetup/first-tuesday 5 2013))))
+  (is (= [2013 5 7] (meetup/meetup 5 2013 :tuesday :first))))

 (deftest first-tuesday-of-june-2013
-  (is (= [2013 6 4] (meetup/first-tuesday 6 2013))))
+  (is (= [2013 6 4] (meetup/meetup 6 2013 :tuesday :first))))

 (deftest first-wednesday-of-july-2013
-  (is (= [2013 7 3] (meetup/first-wednesday 7 2013))))
+  (is (= [2013 7 3] (meetup/meetup 7 2013 :wednesday :first))))

 (deftest first-wednesday-of-august-2013
-  (is (= [2013 8 7] (meetup/first-wednesday 8 2013))))
+  (is (= [2013 8 7] (meetup/meetup 8 2013 :wednesday :first))))

 (deftest first-thursday-of-september-2013
-  (is (= [2013 9 5] (meetup/first-thursday 9 2013))))
+  (is (= [2013 9 5] (meetup/meetup 9 2013 :thursday :first))))

 (deftest first-thursday-of-october-2013
-  (is (= [2013 10 3] (meetup/first-thursday 10 2013))))
+  (is (= [2013 10 3] (meetup/meetup 10 2013 :thursday :first))))

 (deftest first-friday-of-november-2013
-  (is (= [2013 11 1] (meetup/first-friday 11 2013))))
+  (is (= [2013 11 1] (meetup/meetup 11 2013 :friday :first))))

 (deftest first-friday-of-december-2013
-  (is (= [2013 12 6] (meetup/first-friday 12 2013))))
+  (is (= [2013 12 6] (meetup/meetup 12 2013 :friday :first))))

 (deftest first-saturday-of-january-2013
-  (is (= [2013 1 5] (meetup/first-saturday 1 2013))))
+  (is (= [2013 1 5] (meetup/meetup 1 2013 :saturday :first))))

 (deftest first-saturday-of-february-2013
-  (is (= [2013 2 2] (meetup/first-saturday 2 2013))))
+  (is (= [2013 2 2] (meetup/meetup 2 2013 :saturday :first))))

 (deftest first-sunday-of-march-2013
-  (is (= [2013 3 3] (meetup/first-sunday 3 2013))))
+  (is (= [2013 3 3] (meetup/meetup 3 2013 :sunday :first))))

 (deftest first-sunday-of-april-2013
-  (is (= [2013 4 7] (meetup/first-sunday 4 2013))))
+  (is (= [2013 4 7] (meetup/meetup 4 2013 :sunday :first))))

 (deftest second-monday-of-march-2013
-  (is (= [2013 3 11] (meetup/second-monday 3 2013))))
+  (is (= [2013 3 11] (meetup/meetup 3 2013 :monday :second))))

 (deftest second-monday-of-april-2013
-  (is (= [2013 4 8] (meetup/second-monday 4 2013))))
+  (is (= [2013 4 8] (meetup/meetup 4 2013 :monday :second))))

 (deftest second-tuesday-of-may-2013
-  (is (= [2013 5 14] (meetup/second-tuesday 5 2013))))
+  (is (= [2013 5 14] (meetup/meetup 5 2013 :tuesday :second))))

 (deftest second-tuesday-of-june-2013
-  (is (= [2013 6 11] (meetup/second-tuesday 6 2013))))
+  (is (= [2013 6 11] (meetup/meetup 6 2013 :tuesday :second))))

 (deftest second-wednesday-of-july-2013
-  (is (= [2013 7 10] (meetup/second-wednesday 7 2013))))
+  (is (= [2013 7 10] (meetup/meetup 7 2013 :wednesday :second))))

 (deftest second-wednesday-of-august-2013
-  (is (= [2013 8 14] (meetup/second-wednesday 8 2013))))
+  (is (= [2013 8 14] (meetup/meetup 8 2013 :wednesday :second))))

 (deftest second-thursday-of-september-2013
-  (is (= [2013 9 12] (meetup/second-thursday 9 2013))))
+  (is (= [2013 9 12] (meetup/meetup 9 2013 :thursday :second))))

 (deftest second-thursday-of-october-2013
-  (is (= [2013 10 10] (meetup/second-thursday 10 2013))))
+  (is (= [2013 10 10] (meetup/meetup 10 2013 :thursday :second))))

 (deftest second-friday-of-november-2013
-  (is (= [2013 11 8] (meetup/second-friday 11 2013))))
+  (is (= [2013 11 8] (meetup/meetup 11 2013 :friday :second))))

 (deftest second-friday-of-december-2013
-  (is (= [2013 12 13] (meetup/second-friday 12 2013))))
+  (is (= [2013 12 13] (meetup/meetup 12 2013 :friday :second))))

 (deftest second-saturday-of-january-2013
-  (is (= [2013 1 12] (meetup/second-saturday 1 2013))))
+  (is (= [2013 1 12] (meetup/meetup 1 2013 :saturday :second))))

 (deftest second-saturday-of-february-2013
-  (is (= [2013 2 9] (meetup/second-saturday 2 2013))))
+  (is (= [2013 2 9] (meetup/meetup 2 2013 :saturday :second))))

 (deftest second-sunday-of-march-2013
-  (is (= [2013 3 10] (meetup/second-sunday 3 2013))))
+  (is (= [2013 3 10] (meetup/meetup 3 2013 :sunday :second))))

 (deftest second-sunday-of-april-2013
-  (is (= [2013 4 14] (meetup/second-sunday 4 2013))))
+  (is (= [2013 4 14] (meetup/meetup 4 2013 :sunday :second))))

 (deftest third-monday-of-march-2013
-  (is (= [2013 3 18] (meetup/third-monday 3 2013))))
+  (is (= [2013 3 18] (meetup/meetup 3 2013 :monday :third))))

 (deftest third-monday-of-april-2013
-  (is (= [2013 4 15] (meetup/third-monday 4 2013))))
+  (is (= [2013 4 15] (meetup/meetup 4 2013 :monday :third))))

 (deftest third-tuesday-of-may-2013
-  (is (= [2013 5 21] (meetup/third-tuesday 5 2013))))
+  (is (= [2013 5 21] (meetup/meetup 5 2013 :tuesday :third))))

 (deftest third-tuesday-of-june-2013
-  (is (= [2013 6 18] (meetup/third-tuesday 6 2013))))
+  (is (= [2013 6 18] (meetup/meetup 6 2013 :tuesday :third))))

 (deftest third-wednesday-of-july-2013
-  (is (= [2013 7 17] (meetup/third-wednesday 7 2013))))
+  (is (= [2013 7 17] (meetup/meetup 7 2013 :wednesday :third))))

 (deftest third-wednesday-of-august-2013
-  (is (= [2013 8 21] (meetup/third-wednesday 8 2013))))
+  (is (= [2013 8 21] (meetup/meetup 8 2013 :wednesday :third))))

 (deftest third-thursday-of-september-2013
-  (is (= [2013 9 19] (meetup/third-thursday 9 2013))))
+  (is (= [2013 9 19] (meetup/meetup 9 2013 :thursday :third))))

 (deftest third-thursday-of-october-2013
-  (is (= [2013 10 17] (meetup/third-thursday 10 2013))))
+  (is (= [2013 10 17] (meetup/meetup 10 2013 :thursday :third))))

 (deftest third-friday-of-november-2013
-  (is (= [2013 11 15] (meetup/third-friday 11 2013))))
+  (is (= [2013 11 15] (meetup/meetup 11 2013 :friday :third))))

 (deftest third-friday-of-december-2013
-  (is (= [2013 12 20] (meetup/third-friday 12 2013))))
+  (is (= [2013 12 20] (meetup/meetup 12 2013 :friday :third))))

 (deftest third-saturday-of-january-2013
-  (is (= [2013 1 19] (meetup/third-saturday 1 2013))))
+  (is (= [2013 1 19] (meetup/meetup 1 2013 :saturday :third))))

 (deftest third-saturday-of-february-2013
-  (is (= [2013 2 16] (meetup/third-saturday 2 2013))))
+  (is (= [2013 2 16] (meetup/meetup 2 2013 :saturday :third))))

 (deftest third-sunday-of-march-2013
-  (is (= [2013 3 17] (meetup/third-sunday 3 2013))))
+  (is (= [2013 3 17] (meetup/meetup 3 2013 :sunday :third))))

 (deftest third-sunday-of-april-2013
-  (is (= [2013 4 21] (meetup/third-sunday 4 2013))))
+  (is (= [2013 4 21] (meetup/meetup 4 2013 :sunday :third))))

 (deftest fourth-monday-of-march-2013
-  (is (= [2013 3 25] (meetup/fourth-monday 3 2013))))
+  (is (= [2013 3 25] (meetup/meetup 3 2013 :monday :fourth))))

 (deftest fourth-monday-of-april-2013
-  (is (= [2013 4 22] (meetup/fourth-monday 4 2013))))
+  (is (= [2013 4 22] (meetup/meetup 4 2013 :monday :fourth))))

 (deftest fourth-tuesday-of-may-2013
-  (is (= [2013 5 28] (meetup/fourth-tuesday 5 2013))))
+  (is (= [2013 5 28] (meetup/meetup 5 2013 :tuesday :fourth))))

 (deftest fourth-tuesday-of-june-2013
-  (is (= [2013 6 25] (meetup/fourth-tuesday 6 2013))))
+  (is (= [2013 6 25] (meetup/meetup 6 2013 :tuesday :fourth))))

 (deftest fourth-wednesday-of-july-2013
-  (is (= [2013 7 24] (meetup/fourth-wednesday 7 2013))))
+  (is (= [2013 7 24] (meetup/meetup 7 2013 :wednesday :fourth))))

 (deftest fourth-wednesday-of-august-2013
-  (is (= [2013 8 28] (meetup/fourth-wednesday 8 2013))))
+  (is (= [2013 8 28] (meetup/meetup 8 2013 :wednesday :fourth))))

 (deftest fourth-thursday-of-september-2013
-  (is (= [2013 9 26] (meetup/fourth-thursday 9 2013))))
+  (is (= [2013 9 26] (meetup/meetup 9 2013 :thursday :fourth))))

 (deftest fourth-thursday-of-october-2013
-  (is (= [2013 10 24] (meetup/fourth-thursday 10 2013))))
+  (is (= [2013 10 24] (meetup/meetup 10 2013 :thursday :fourth))))

 (deftest fourth-friday-of-november-2013
-  (is (= [2013 11 22] (meetup/fourth-friday 11 2013))))
+  (is (= [2013 11 22] (meetup/meetup 11 2013 :friday :fourth))))

 (deftest fourth-friday-of-december-2013
-  (is (= [2013 12 27] (meetup/fourth-friday 12 2013))))
+  (is (= [2013 12 27] (meetup/meetup 12 2013 :friday :fourth))))

 (deftest fourth-saturday-of-january-2013
-  (is (= [2013 1 26] (meetup/fourth-saturday 1 2013))))
+  (is (= [2013 1 26] (meetup/meetup 1 2013 :saturday :fourth))))

 (deftest fourth-saturday-of-february-2013
-  (is (= [2013 2 23] (meetup/fourth-saturday 2 2013))))
+  (is (= [2013 2 23] (meetup/meetup 2 2013 :saturday :fourth))))

 (deftest fourth-sunday-of-march-2013
-  (is (= [2013 3 24] (meetup/fourth-sunday 3 2013))))
+  (is (= [2013 3 24] (meetup/meetup 3 2013 :sunday :fourth))))

 (deftest fourth-sunday-of-april-2013
-  (is (= [2013 4 28] (meetup/fourth-sunday 4 2013))))
+  (is (= [2013 4 28] (meetup/meetup 4 2013 :sunday :fourth))))

 (deftest last-monday-of-march-2013
-  (is (= [2013 3 25] (meetup/last-monday 3 2013))))
+  (is (= [2013 3 25] (meetup/meetup 3 2013 :monday :last))))

 (deftest last-monday-of-april-2013
-  (is (= [2013 4 29] (meetup/last-monday 4 2013))))
+  (is (= [2013 4 29] (meetup/meetup 4 2013 :monday :last))))

 (deftest last-tuesday-of-may-2013
-  (is (= [2013 5 28] (meetup/last-tuesday 5 2013))))
+  (is (= [2013 5 28] (meetup/meetup 5 2013 :tuesday :last))))

 (deftest last-tuesday-of-june-2013
-  (is (= [2013 6 25] (meetup/last-tuesday 6 2013))))
+  (is (= [2013 6 25] (meetup/meetup 6 2013 :tuesday :last))))

 (deftest last-wednesday-of-july-2013
-  (is (= [2013 7 31] (meetup/last-wednesday 7 2013))))
+  (is (= [2013 7 31] (meetup/meetup 7 2013 :wednesday :last))))

 (deftest last-wednesday-of-august-2013
-  (is (= [2013 8 28] (meetup/last-wednesday 8 2013))))
+  (is (= [2013 8 28] (meetup/meetup 8 2013 :wednesday :last))))

 (deftest last-thursday-of-september-2013
-  (is (= [2013 9 26] (meetup/last-thursday 9 2013))))
+  (is (= [2013 9 26] (meetup/meetup 9 2013 :thursday :last))))

 (deftest last-thursday-of-october-2013
-  (is (= [2013 10 31] (meetup/last-thursday 10 2013))))
+  (is (= [2013 10 31] (meetup/meetup 10 2013 :thursday :last))))

 (deftest last-friday-of-november-2013
-  (is (= [2013 11 29] (meetup/last-friday 11 2013))))
+  (is (= [2013 11 29] (meetup/meetup 11 2013 :friday :last))))

 (deftest last-friday-of-december-2013
-  (is (= [2013 12 27] (meetup/last-friday 12 2013))))
+  (is (= [2013 12 27] (meetup/meetup 12 2013 :friday :last))))

 (deftest last-saturday-of-january-2013
-  (is (= [2013 1 26] (meetup/last-saturday 1 2013))))
+  (is (= [2013 1 26] (meetup/meetup 1 2013 :saturday :last))))

 (deftest last-saturday-of-february-2013
-  (is (= [2013 2 23] (meetup/last-saturday 2 2013))))
+  (is (= [2013 2 23] (meetup/meetup 2 2013 :saturday :last))))

 (deftest last-sunday-of-march-2013
-  (is (= [2013 3 31] (meetup/last-sunday 3 2013))))
+  (is (= [2013 3 31] (meetup/meetup 3 2013 :sunday :last))))

 (deftest last-sunday-of-april-2013
-  (is (= [2013 4 28] (meetup/last-sunday 4 2013))))
+  (is (= [2013 4 28] (meetup/meetup 4 2013 :sunday :last))))

 (run-tests)


Disabling dynamic scripting in the embedded elastic search.

--- src/cmr/elastic_utils/embedded_elastic_server.clj
+++ src/cmr/elastic_utils/embedded_elastic_server.clj
@@ -22,6 +22,9 @@
       (put "http.port" (str http-port))
       (put "transport.tcp.port" (str transport-port))
       (put "index.store.type" "memory")
+      ;; Disable dynamic scripting to prevent attacks on developer machines
+      ;; See http://bouk.co/blog/elasticsearch-rce/
+      (put "script.disable_dynamic" "true")
       build))

 (defn- build-node


[CS] Clean up zip file after it's uploaded to S3

--- src/vip/data_processor/s3.clj
+++ src/vip/data_processor/s3.clj
@@ -51,11 +51,14 @@
   "Uploads the generated xml file to the specified S3 bucket."
   [ctx]
   (let [zip-name (str (zip-filename ctx) ".zip")
-        xml-file (-> ctx :xml-output-file .toFile)
-        zip-file (ZipFile. zip-name)
+        zip-file (File. zip-name)
+        zip (ZipFile. zip-name)
         zip-params (doto (ZipParameters.)
                      (.setCompressionLevel
-                      Zip4jConstants/DEFLATE_LEVEL_NORMAL))]
-    (.createZipFile zip-file xml-file zip-params)
-    (put-object zip-name (File. zip-name))
-    (assoc ctx :generated-xml-filename zip-name)))
+                      Zip4jConstants/DEFLATE_LEVEL_NORMAL))
+        xml-file (-> ctx :xml-output-file .toFile)]
+    (.createZipFile zip xml-file zip-params)
+    (put-object zip-name zip-file)
+    (-> ctx
+        (assoc :generated-xml-filename zip-name)
+        (update :to-be-cleaned conj zip-file))))


Remove useless macro 'go-forever'

Remove useless macro 'go-forever'

--- src/whisper2cyanite/utils.clj
+++ src/whisper2cyanite/utils.clj
@@ -13,10 +13,6 @@
   `(go
      (while ~test
        ~body)))
-
-(defmacro go-forever
-  [body]
-  `(go-while true ~body))

 (defn partition-or-time
   "Returns a channel that will either contain vectors of n items taken from ch or


testing with core.logic on entity maps

testing with core.logic on entity maps

--- sample/src/sample/core.clj
+++ sample/src/sample/core.clj
@@ -116,6 +116,30 @@

+(defn etest []
+  (cldb/db-rel person p)
+  (cldb/db-rel address a)
+  (cldb/db-rel person->address p a)
+
+  (let [facts1 [(address {:id 100
+                          :type :address
+                          :street "street 1"})
+                (address {:id 101
+                          :type :address
+                          :street "street 2"})
+                (person {:id 200
+                         :type :person
+                         :name "hans 1"
+                         :address_id 100})]]
+    (cldb/with-db (cldb/db facts1)
+      (cl/run* [q]
+        (cl/fresh [p]
+          (person {:id 100}))))))
+
+;;; (etest)
+
+
+
 (defn xftest []
   (let [r (range 50000000)
         f1 #(+ % %)


Add more CSS classes to the markup

Add more CSS classes to the markup

--- doclet/src/clojure/play_clj_doclet/html.clj
+++ doclet/src/clojure/play_clj_doclet/html.clj
@@ -11,34 +11,36 @@
            (for [g groups]
              [:div {:class "name"} (:name g)])))])

-(defn param
+(defn java-param
   [[type-name param-name]]
-  (html [:span {}
-         [:span {:class "type-name"} "^" type-name]
+  (html [:span {:class "j-arg"}
+         [:span {:class "j-type"} "^" type-name]
          " "
          param-name]))

-(defn item
+(defn java-item
   [{:keys [name text type args]}]
-  [:div {:class "item"}
-   [:span {:class "item-name"}
+  [:div {:class "j-item"}
+   [:span {:class "j-name"}
     (str name)]
-   [:span {:class "item-args"}
-    (string/join ", " (map param args))]
+   [:span {:class "j-args"}
+    (string/join ", " (map java-param args))]
    (when text
-     [:div {:class "item-doc"} text])])
+     [:div {:class "j-doc"} text])])

 (defn content
   [parsed-files]
   [:div {:class "content"}
    (for [{:keys [ns groups] :as pf} parsed-files]
      (for [{:keys [name docstring java] :as g} groups]
-       (concat [[:div {:class "header"} name]
-                [:div {:class "doc"} docstring]]
-               (for [[item-name items] java]
-                 (cons (when (not= name item-name)
-                         [:div {:class "sub-header"} item-name])
-                       (map item items))))))])
+       (list [:div {:class "clj"}
+              [:div {:class "c-header"} name]
+              [:div {:class "c-doc"} docstring]]
+             [:div {:class "java"}
+              (for [[item-name items] java]
+                (cons (when (not= name item-name)
+                        [:div {:class "j-header"} item-name])
+                      (map java-item items)))])))])

 (defn create
   [parsed-files]


fix delay ugen arg names

fix delay ugen arg names

--- src/overtone/sc/machinery/ugen/metadata/delay.clj
+++ src/overtone/sc/machinery/ugen/metadata/delay.clj
@@ -5,12 +5,12 @@

   [
    ;; Delay1 : UGen {
-   ;; 	*ar { arg in = 0.0, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('audio', in).madd(mul, add)
-   ;; 	}
-   ;; 	*kr { arg in = 0.0, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('control', in).madd(mul, add)
-   ;; 	}
+   ;;   *ar { arg in = 0.0, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('audio', in).madd(mul, add)
+   ;;   }
+   ;;   *kr { arg in = 0.0, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('control', in).madd(mul, add)
+   ;;   }
    ;; }

    {:name "Delay1",
@@ -25,18 +25,18 @@
    ;; these delays use real time allocated memory.

    ;; DelayN : UGen {
-   ;; 	*ar { arg in = 0.0, maxdelaytime = 0.2, delaytime = 0.2, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('audio', in.asAudioRateInput, maxdelaytime, delaytime).madd(mul, add)
-   ;; 	}
-   ;; 	*kr { arg in = 0.0, maxdelaytime = 0.2, delaytime = 0.2, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('control', in, maxdelaytime, delaytime).madd(mul, add)
-   ;; 	}
+   ;;   *ar { arg in = 0.0, maxdelaytime = 0.2, delaytime = 0.2, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('audio', in.asAudioRateInput, maxdelaytime, delaytime).madd(mul, add)
+   ;;   }
+   ;;   *kr { arg in = 0.0, maxdelaytime = 0.2, delaytime = 0.2, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('control', in, maxdelaytime, delaytime).madd(mul, add)
+   ;;   }
    ;; }

    {:name "DelayN",
     :args [{:name "in", :default 0.0, :mode :as-ar :doc "the input signal"}
-           {:name "maxdelaytime", :default 0.2 :doc "the maximum delay time in seconds. used to initialize the delay buffer size"}
-           {:name "delaytime", :default 0.2 :doc "delay time in seconds"}]
+           {:name "max-delay-time", :default 0.2 :doc "the maximum delay time in seconds. Used to initialize the delay buffer size"}
+           {:name "delay-time", :default 0.2 :doc "delay time in seconds"}]
     :doc "simple delay line, no interpolation. See also DelayL which uses linear interpolation, and DelayC which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate."}

    ;; DelayL : DelayN {}
@@ -60,9 +60,9 @@

    {:name "CombN",
     :args [{:name "in", :default 0.0, :mode :as-ar :doc "the input signal"}
-           {:name "maxdelaytime", :default 0.2 :doc "the maximum delay time in seconds. used to initialize the delay buffer size"}
-           {:name "delaytime", :default 0.2 :doc "delay time in seconds"}
-           {:name "decaytime", :default 1.0 :doc "time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower."}]
+           {:name "max-delay-time", :default 0.2 :doc "the maximum delay time in seconds. Used to initialize the delay buffer size"}
+           {:name "delay-time", :default 0.2 :doc "delay time in seconds"}
+           {:name "decay-time", :default 1.0 :doc "time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower."}]
     :doc "comb delay line, no interpolation. See also CombL which uses linear interpolation, and CombC which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate."}

    {:name "CombL" :extends "CombN"
@@ -83,18 +83,18 @@
    ;; these delays use shared buffers.

    ;; BufDelayN : UGen {
-   ;; 	*ar { arg buf = 0, in = 0.0, delaytime = 0.2, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('audio', buf, in.asAudioRateInput, delaytime).madd(mul, add)
-   ;; 	}
-   ;; 	*kr { arg buf = 0, in = 0.0, delaytime = 0.2, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('control', buf, in, delaytime).madd(mul, add)
-   ;; 	}
+   ;;   *ar { arg buf = 0, in = 0.0, delaytime = 0.2, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('audio', buf, in.asAudioRateInput, delaytime).madd(mul, add)
+   ;;   }
+   ;;   *kr { arg buf = 0, in = 0.0, delaytime = 0.2, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('control', buf, in, delaytime).madd(mul, add)
+   ;;   }
    ;; }

    {:name "BufDelayN",
     :args [{:name "buf", :default 0.0 :doc "buffer number"}
            {:name "in", :default 0.0 :mode :as-ar :doc "the input signal"}
-           {:name "delaytime", :default 0.2 :doc "delay time in seconds"}]
+           {:name "delay-time", :default 0.2 :doc "delay time in seconds"}]
     :doc "buffer based simple delay line with no interpolation. See also BufDelayL which uses linear interpolation, and BufDelayC which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate."}

    ;; BufDelayL : BufDelayN {}
@@ -108,16 +108,16 @@
     :doc "buffer based simple delay line with cubic interpolation"}

    ;; BufCombN : UGen {
-   ;; 	*ar { arg buf = 0, in = 0.0, delaytime = 0.2, decaytime = 1.0, mul = 1.0, add = 0.0;
-   ;; 		^this.multiNew('audio', buf, in.asAudioRateInput, delaytime, decaytime).madd(mul, add)
-   ;; 	}
+   ;;   *ar { arg buf = 0, in = 0.0, delaytime = 0.2, decaytime = 1.0, mul = 1.0, add = 0.0;
+   ;;           ^this.multiNew('audio', buf, in.asAudioRateInput, delaytime, decaytime).madd(mul, add)
+   ;;   }
    ;; }

    {:name "BufCombN",
     :args [{:name "buf", :default 0 :doc "buffer number"}
            {:name "in", :default 0.0, :mode :as-ar :doc "the input signal"}
-           {:name "delaytime", :default 0.2 :doc "delay time in seconds"}
-           {:name "decaytime", :default 1.0 :doc "time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower."}],
+           {:name "delay-time", :default 0.2 :doc "delay time in seconds"}
+           {:name "decay-time", :default 1.0 :doc "time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower."}],
     :rates #{:ar}
     :doc "buffer based comb delay line with no interpolation. See also [BufCombL] which uses linear interpolation, and BufCombC which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate."}


Bring batch tests back in cql

Bring batch tests back in cql

--- test/clojure/clojurewerkz/cassaforte/cql_test.clj
+++ test/clojure/clojurewerkz/cassaforte/cql_test.clj
@@ -477,3 +477,22 @@
                      (client/prepare *session* "INSERT INTO users (name, city, age) VALUES (?, ?, ?);")
                      ["Alex" "Munich" nil]))
     (is (= r (first (select *session* :users))))))
+
+(deftest test-insert-batch-plain-without-prepared-statements
+  (let [input [{:name "Alex" :city "Munich" :age (int 19)}
+               {:name "Robert" :city "Berlin" :age (int 25)}]]
+    (insert-batch *session* :users input)
+    (is (= (sort-by :name input)
+           (sort-by :name (select *session* :users))))))
+
+(deftest test-insert-with-atomic-batch-without-prepared-statements
+  (client/execute *session*
+   (new-query-api/unlogged-batch
+    (new-query-api/queries
+     (new-query-api/insert :users
+                           {:name "Alex" :city "Munich" :age (int 19)})
+     (new-query-api/insert :users
+                           {:name "Fritz" :city "Hamburg" :age (int 28)}))))
+  (is (= [{:name "Alex" :city "Munich" :age (int 19)}
+          {:name "Fritz" :city "Hamburg" :age (int 28)}]
+         (sort-by :name (select *session* :users)))))


[#2385] Rework retry code and change defaults

--- backend/src/akvo/lumen/lib/import/flow_common.clj
+++ backend/src/akvo/lumen/lib/import/flow_common.clj
@@ -12,38 +12,35 @@
 ;; only use this value from a different thread/future
 (def ^:private http-client-req-defaults (http.client/req-opts 60000))

-(def retry-policy
+
+(dh/defretrypolicy retry-policy
   {:retry-on Exception
-   :delay-ms 5000
-   :max-retries 6})
+   :backoff-ms [1500 30000 4.0]
+   :max-retries 3
+   :on-retry (fn [_ ex]
+               (log/info ::retry (.getMessage ex)))})

 (defn survey-definition
   [api-root headers-fn instance survey-id]
-  (dh/with-retry
-    {:policy
-     (assoc retry-policy
-            :on-retry (fn [_ e]
-                        (log/info ::survey-definition*-retry e))
-            :on-success (fn [{:keys [body]}]
-                          body))}
-    (-> (format "%s/orgs/%s/surveys/%s" api-root instance survey-id)
-        (http.client/get* (merge http-client-req-defaults
-                                 {:headers (headers-fn)
-                                  :as :json})))))
+  (-> (dh/with-retry
+        {:policy retry-policy}
+        (-> (format "%s/orgs/%s/surveys/%s" api-root instance survey-id)
+            (http.client/get* (merge http-client-req-defaults
+                                     {:headers (headers-fn)
+                                      :as :json}))))
+      :body))

 (defn form-instances* [headers-fn url]
-  (dh/with-retry
-    {:policy
-     (assoc retry-policy
-            :on-retry (fn [_ e]
-                        (log/info ::form-instances*-retry e))
-            :on-success (fn [{{:strs [formInstances nextPageUrl]} :body}]
-                          (lazy-cat formInstances
-                                    (when-let [url nextPageUrl]
-                                      (form-instances* headers-fn url)))))}
-    (http.client/get* url (merge http-client-req-defaults
-                                 {:headers (headers-fn)
-                                  :as :json-string-keys}))))
+  (let [http-opts (merge http-client-req-defaults
+                         {:headers (headers-fn)
+                          :as :json-string-keys})
+        response (dh/with-retry
+                   {:policy retry-policy}
+                   (http.client/get* url http-opts))
+        {{:strs [formInstances nextPageUrl]} :body} response]
+    (lazy-cat formInstances
+              (when-let [url nextPageUrl]
+                (form-instances* headers-fn url)))))

 (defn form-instances
   "Returns a lazy sequence of form instances"
@@ -53,16 +50,12 @@

 (defn data-points*
   [headers-fn url]
-  (dh/with-retry
-    {:policy
-     (assoc retry-policy
-            :on-retry (fn [_ e]
-                        (log/info ::data-points*-retry e))
-            :on-success (fn [{:keys [body]}]
-                          body))}
-    (http.client/get* url (merge http-client-req-defaults
-                                 {:headers (headers-fn)
-                                  :as :json-string-keys}))))
+  (-> (dh/with-retry
+        {:policy retry-policy}
+        (http.client/get* url (merge http-client-req-defaults
+                                     {:headers (headers-fn)
+                                      :as :json-string-keys})))
+      :body))

 (defn data-points
   "Returns all survey data points"


Minor cleanup of Clojure example.

Minor cleanup of Clojure example.

Cleaned up some formatting and spacing. Used future-cancel. Future
subscriptions were not being returned properly. Replaced use of #_ with
comment form. Fixed rest args usage for hello example.

--- rxjava-examples/src/main/clojure/rx/examples/clojure/rx_examples.clj
+++ rxjava-examples/src/main/clojure/rx/examples/clojure/rx_examples.clj
@@ -13,50 +13,51 @@
 ; --------------------------------------------------

 (defn hello
-  [&rest]
-  (-> (Observable/toObservable &rest)
+  [& args]
+  (-> (Observable/toObservable args)
     (.subscribe #(println (str "Hello " % "!")))))

 ; To see output
-#_(hello ["Ben" "George"])
+(comment
+  (hello "Ben" "George"))

 ; --------------------------------------------------
 ; Create Observable from Existing Data
 ; --------------------------------------------------
-
+
 (defn existingDataFromNumbers []
-    (Observable/toObservable [1 2 3 4 5 6]))
+  (Observable/toObservable [1 2 3 4 5 6]))

 (defn existingDataFromNumbersUsingFrom []
-    (Observable/from [1 2 3 4 5 6]))
+  (Observable/from [1 2 3 4 5 6]))

 (defn existingDataFromObjects []
-    (Observable/toObservable ["a" "b" "c"]))
-
+  (Observable/toObservable ["a" "b" "c"]))
+
 (defn existingDataFromObjectsUsingFrom []
-    (Observable/from ["a" "b" "c"]))
+  (Observable/from ["a" "b" "c"]))

 (defn existingDataFromList []
-    (let [list [5, 6, 7, 8]]
-      (Observable/toObservable list)))
-
+  (let [list [5, 6, 7, 8]]
+    (Observable/toObservable list)))
+
 (defn existingDataFromListUsingFrom []
   (let [list [5, 6, 7, 8]]
     (Observable/from list)))

 (defn existingDataWithJust []
-    (Observable/just "one object"))
+  (Observable/just "one object"))

 ; --------------------------------------------------
 ; Custom Observable
 ; --------------------------------------------------

 (defn customObservableBlocking []
-  "This example shows a custom Observable that blocks
+  "This example shows a custom Observable that blocks
    when subscribed to (does not spawn an extra thread).
-
+
   returns Observable<String>"
-  (Observable/create
+  (Observable/create
     (fn [observer]
       (doseq [x (range 50)] (-> observer (.onNext (str "value_" x))))
       ; after sending all values we complete the sequence
@@ -66,46 +67,47 @@
       (Observable/noOpSubscription))))

 ; To see output
-#_(.subscribe (customObservableBlocking) #(println %))
+(comment
+  (.subscribe (customObservableBlocking) println))

 (defn customObservableNonBlocking []
-  "This example shows a custom Observable that does not block
-   when subscribed to as it spawns a separate thread.
-
+  "This example shows a custom Observable that does not block
+  when subscribed to as it spawns a separate thread.
+
   returns Observable<String>"
-  (Observable/create
-    (fn [observer]
-      (let [f (future
-                (doseq [x (range 50)] (-> observer (.onNext (str "anotherValue_" x))))
+  (Observable/create
+    (fn [observer]
+      (let [f (future
+                (doseq [x (range 50)]
+                  (-> observer (.onNext (str "anotherValue_" x))))
                 ; after sending all values we complete the sequence
-                (-> observer .onCompleted))
-            ; a subscription that cancels the future if unsubscribed
-            subscription (Observable/createSubscription #(-> f (.cancel true)))]
-        ))
-      ))
-
-; To see output
-#_(.subscribe (customObservableNonBlocking) #(println %))
+                (-> observer .onCompleted))]
+        ; return a subscription that cancels the future
+        (Observable/createSubscription #(future-cancel f))))))
+
+; To see output
+(comment
+  (.subscribe (customObservableNonBlocking) println))

 (defn fetchWikipediaArticleAsynchronously [wikipediaArticleNames]
   "Fetch a list of Wikipedia articles asynchronously.
-
+
    return Observable<String> of HTML"
-  (Observable/create
+  (Observable/create
     (fn [observer]
       (let [f (future
                 (doseq [articleName wikipediaArticleNames]
                   (-> observer (.onNext (http/get (str "http://en.wikipedia.org/wiki/" articleName)))))
                 ; after sending response to onnext we complete the sequence
-                (-> observer .onCompleted))
-            ; a subscription that cancels the future if unsubscribed
-            subscription (Observable/createSubscription #(-> f (.cancel true)))]
-        ))))
-
-; To see output
-#_(-> (fetchWikipediaArticleAsynchronously ["Tiger" "Elephant"])
-  (.subscribe #(println "--- Article ---\n" (subs (:body %) 0 125) "...")))
+                (-> observer .onCompleted))]
+        ; a subscription that cancels the future if unsubscribed
+        (Observable/createSubscription #(future-cancel f))))))
+
+; To see output
+(comment
+  (-> (fetchWikipediaArticleAsynchronously ["Tiger" "Elephant"])
+    (.subscribe #(println "--- Article ---\n" (subs (:body %) 0 125) "..."))))

 ; --------------------------------------------------
@@ -115,7 +117,7 @@
 (defn simpleComposition []
   "Asynchronously calls 'customObservableNonBlocking' and defines
    a chain of operators to apply to the callback sequence."
-  (->
+  (->
     (customObservableNonBlocking)
     (.skip 10)
     (.take 5)
@@ -123,7 +125,8 @@
     (.subscribe #(println "onNext =>" %))))

 ; To see output
-#_(simpleComposition)
+(comment
+  (simpleComposition))

 ; --------------------------------------------------
@@ -132,102 +135,107 @@

 (defn getUser [userId]
   "Asynchronously fetch user data
+
   return Observable<Map>"
-  (Observable/create
-      (fn [observer]
-        (let [f (future
-          (try
-            ; simulate fetching user data via network service call with latency
-            (Thread/sleep 60)
-            (-> observer (.onNext {:user-id userId :name "Sam Harris"
-                                   :preferred-language (if (= 0 (rand-int 2)) "en-us" "es-us") }))
-            (-> observer .onCompleted)
-          (catch Exception e (-> observer (.onError e)))))
-          ; a subscription that cancels the future if unsubscribed
-          subscription (Observable/createSubscription #(-> f (.cancel true)))]
-      ))))
+  (Observable/create
+    (fn [observer]
+      (let [f (future
+                (try
+                  ; simulate fetching user data via network service call with latency
+                  (Thread/sleep 60)
+                  (-> observer (.onNext {:user-id userId
+                                         :name "Sam Harris"
+                                         :preferred-language (if (= 0 (rand-int 2)) "en-us" "es-us") }))
+                  (-> observer .onCompleted)
+                  (catch Exception e (-> observer (.onError e))))) ]
+        ; a subscription that cancels the future if unsubscribed
+        (Observable/createSubscription #(future-cancel f))))))

 (defn getVideoBookmark [userId, videoId]
   "Asynchronously fetch bookmark for video
+
   return Observable<Integer>"
-  (Observable/create
-      (fn [observer]
-        (let [f (future
-          (try
-            ; simulate fetching user data via network service call with latency
-            (Thread/sleep 20)
-            (-> observer (.onNext {:video-id videoId
-                           ; 50/50 chance of giving back position 0 or 0-2500
-                           :position (if (= 0 (rand-int 2)) 0 (rand-int 2500))}))
-            (-> observer .onCompleted)
-          (catch Exception e (-> observer (.onError e)))))
-          ; a subscription that cancels the future if unsubscribed
-          subscription (Observable/createSubscription #(-> f (.cancel true)))]
-      ))))
+  (Observable/create
+    (fn [observer]
+      (let [f (future
+                (try
+                  ; simulate fetching user data via network service call with latency
+                  (Thread/sleep 20)
+                  (-> observer (.onNext {:video-id videoId
+                                         ; 50/50 chance of giving back position 0 or 0-2500
+                                         :position (if (= 0 (rand-int 2)) 0 (rand-int 2500))}))
+                  (-> observer .onCompleted)
+                  (catch Exception e (-> observer (.onError e)))))]
+        ; a subscription that cancels the future if unsubscribed
+        (Observable/createSubscription #(future-cancel f))))))

 (defn getVideoMetadata [videoId, preferredLanguage]
   "Asynchronously fetch movie metadata for a given language
   return Observable<Map>"
-  (Observable/create
-      (fn [observer]
-        (let [f (future
-          (try
-            ; simulate fetching video data via network service call with latency
-            (Thread/sleep 50)
-            ; contrived metadata for en-us or es-us
-            (if (= "en-us" preferredLanguage)
-              (-> observer (.onNext {:video-id videoId :title "House of Cards: Episode 1"
-                                   :director "David Fincher" :duration 3365})))
-            (if (= "es-us" preferredLanguage)
-              (-> observer (.onNext {:video-id videoId :title "Cámara de Tarjetas: Episodio 1"
-                                   :director "David Fincher" :duration 3365})))
-            (-> observer .onCompleted)
-          (catch Exception e (-> observer (.onError e)))))
-          ; a subscription that cancels the future if unsubscribed
-          subscription (Observable/createSubscription #(-> f (.cancel true)))]
-      ))))
-
-
+  (Observable/create
+    (fn [observer]
+      (let [f (future
+                (try
+                  ; simulate fetching video data via network service call with latency
+                  (Thread/sleep 50)
+                  ; contrived metadata for en-us or es-us
+                  (if (= "en-us" preferredLanguage)
+                    (-> observer (.onNext {:video-id videoId
+                                           :title "House of Cards: Episode 1"
+                                           :director "David Fincher"
+                                           :duration 3365})))
+                  (if (= "es-us" preferredLanguage)
+                    (-> observer (.onNext {:video-id videoId
+                                           :title "Cámara de Tarjetas: Episodio 1"
+                                           :director "David Fincher"
+                                           :duration 3365})))
+                  (-> observer .onCompleted)
+                  (catch Exception e (-> observer (.onError e))))) ]
+        ; a subscription that cancels the future if unsubscribed
+        (Observable/createSubscription #(future-cancel f))))))
+
+
 (defn getVideoForUser [userId videoId]
   "Get video metadata for a given userId
-   - video metadata
-   - video bookmark position
-   - user data
+  - video metadata
+  - video bookmark position
+  - user data
   return Observable<Map>"
-    (let [user-observable (-> (getUser userId)
-              (.map (fn [user] {:user-name (:name user) :language (:preferred-language user)})))
-          bookmark-observable (-> (getVideoBookmark userId videoId)
-              (.map (fn [bookmark] {:viewed-position (:position bookmark)})))
-          ; getVideoMetadata requires :language from user-observable so nest inside map function
-          video-metadata-observable (-> user-observable
-              (.mapMany
-                ; fetch metadata after a response from user-observable is received
-                (fn [user-map]
-                  (getVideoMetadata videoId (:language user-map)))))]
-          ; now combine 3 async sequences using zip
-          (-> (Observable/zip bookmark-observable video-metadata-observable user-observable
-                (fn [bookmark-map metadata-map user-map]
-                  {:bookmark-map bookmark-map
-                  :metadata-map metadata-map
-                  :user-map user-map}))
-            ; and transform into a single response object
-            (.map (fn [data]
-                  {:video-id videoId
-                   :video-metadata (:metadata-map data)
-                   :user-id userId
-                   :language (:language (:user-map data))
-                   :bookmark (:viewed-position (:bookmark-map data))
-                  })))))
-
+  (let [user-observable           (-> (getUser userId)
+                                    (.map (fn [user] {:user-name (:name user)
+                                                      :language (:preferred-language user)})))
+        bookmark-observable       (-> (getVideoBookmark userId videoId)
+                                    (.map (fn [bookmark] {:viewed-position (:position bookmark)})))
+        ; getVideoMetadata requires :language from user-observable so nest inside map function
+        video-metadata-observable (-> user-observable
+                                    (.mapMany
+                                      ; fetch metadata after a response from user-observable is received
+                                      (fn [user-map]
+                                        (getVideoMetadata videoId (:language user-map)))))]
+    ; now combine 3 async sequences using zip
+    (-> (Observable/zip bookmark-observable video-metadata-observable user-observable
+                        (fn [bookmark-map metadata-map user-map]
+                          {:bookmark-map bookmark-map
+                           :metadata-map metadata-map
+                           :user-map user-map}))
+      ; and transform into a single response object
+      (.map (fn [data]
+              {:video-id       videoId
+               :video-metadata (:metadata-map data)
+               :user-id        userId
+               :language       (:language (:user-map data))
+               :bookmark       (:viewed-position (:bookmark-map data)) })))))
+
 ; To see output like this:
-;    {:video-id 78965, :video-metadata {:video-id 78965, :title Cámara de Tarjetas: Episodio 1,
+;    {:video-id 78965, :video-metadata {:video-id 78965, :title Cámara de Tarjetas: Episodio 1,
 ;      :director David Fincher, :duration 3365}, :user-id 12345, :language es-us, :bookmark 0}
 ;
-#_(-> (getVideoForUser 12345 78965)
-        (.subscribe
-          (fn [x] (println "--- Object ---\n" x))
-          (fn [e] (println "--- Error ---\n" e))
-          (fn [] (println "--- Completed ---"))))
+(comment
+  (-> (getVideoForUser 12345 78965)
+    (.subscribe
+      (fn [x] (println "--- Object ---\n" x))
+      (fn [e] (println "--- Error ---\n" e))
+      (fn [] (println "--- Completed ---")))))

 ; --------------------------------------------------
@@ -237,26 +245,25 @@
 (defn fetchWikipediaArticleAsynchronouslyWithErrorHandling [wikipediaArticleNames]
   "Fetch a list of Wikipedia articles asynchronously
    with proper error handling.
-
+
    return Observable<String> of HTML"
-  (Observable/create
-    (fn [observer]
-      (let [f (future
-                (try
-                (doseq [articleName wikipediaArticleNames]
-                  (-> observer (.onNext (http/get (str "http://en.wikipedia.org/wiki/" articleName)))))
-                ;(catch Exception e (prn "exception")))
-                (catch Exception e (-> observer (.onError e))))
-                ; after sending response to onnext we complete the sequence
-                (-> observer .onCompleted))
-            ; a subscription that cancels the future if unsubscribed
-            subscription (Observable/createSubscription #(-> f (.cancel true)))]
-        ))))
-
-; To see output
-#_(-> (fetchWikipediaArticleAsynchronouslyWithErrorHandling ["Tiger" "NonExistentTitle" "Elephant"])
-  (.subscribe
-    #(println "--- Article ---\n" (subs (:body %) 0 125) "...")
-    #(println "--- Error ---\n" (.getMessage %))))
-
-  +  (Observable/create
+    (fn [observer]
+      (let [f (future
+                (try
+                  (doseq [articleName wikipediaArticleNames]
+                    (-> observer (.onNext (http/get (str "http://en.wikipedia.org/wiki/" articleName)))))
+                  ;(catch Exception e (prn "exception")))
+                  (catch Exception e (-> observer (.onError e))))
+                ; after sending response to onNext we complete the sequence
+                (-> observer .onCompleted))]
+        ; a subscription that cancels the future if unsubscribed
+        (Observable/createSubscription #(future-cancel f))))))
+
+; To see output
+(comment
+  (-> (fetchWikipediaArticleAsynchronouslyWithErrorHandling ["Tiger" "NonExistentTitle" "Elephant"])
+    (.subscribe #(println "--- Article ---\n" (subs (:body %) 0 125) "...")
+                #(println "--- Error ---\n" (.getMessage %)))))
+
+


Only show search placeholder text when latest searched query string is blank (all indexed templates are loaded).

--- src/cljs/clj_templates/pages/templates/page.cljs
+++ src/cljs/clj_templates/pages/templates/page.cljs
@@ -26,9 +26,9 @@
        [:img {:src lein-logo :width "20px"}])
      [:img {:src boot-logo :width "23px"}]]]])

-(defn search-input [hit-count]
+(defn search-input [hit-count query-string]
   [:input.search-input {:type        "text"
-                        :placeholder (str "Search " hit-count " templates")
+                        :placeholder (when (str/blank? query-string) (str "Search " hit-count " templates"))
                         :on-change   #(dispatch [:templates/delayed-search (target-value %)])}])

 (defn pagination-link [page current-page-index]
@@ -84,7 +84,7 @@
         error? (listen [:templates/error?])]
     [:div.templates
      [intro-text]
-     [search-input hit-count]
+     [search-input hit-count query-string]
      (when (pos? page-count) [pagination page-count])
      [results-for-text templates query-string hit-count]
      [results templates query-string error?]


Removed query builder from constants file

--- src/cljs/wombats_web_client/constants/games.cljs
+++ src/cljs/wombats_web_client/constants/games.cljs
@@ -5,6 +5,3 @@
 (defonce active-intermission "active-intermission")
 (defonce active "active")
 (defonce closed "closed")
-
-(defn build-status-query [statuses]
-  (clojure.string/join "&status=" statuses))


(SERVER-876) Only fail catalog requests without environment

A previous commit threw an exception if any request was missing the
environment, when the intention was to only enforce that for catalog
requests. This commit makes that change.

--- src/clj/puppetlabs/services/request_handler/request_handler_core.clj
+++ src/clj/puppetlabs/services/request_handler/request_handler_core.clj
@@ -321,12 +321,12 @@

 (defn with-code-id
   [current-code-id request]
-  (let [env (get-environment-from-request request)]
-    (when-not env
-      (throw (IllegalStateException. "Environment is required in a catalog request.")))
-    (if (:assoc-code-id request)
-      (assoc-in request [:params "code_id"] (current-code-id env))
-      request)))
+  (if (:assoc-code-id request)
+    (let [env (get-environment-from-request request)]
+      (when-not env
+        (throw (IllegalStateException. "Environment is required in a catalog request.")))
+      (assoc-in request [:params "code_id"] (current-code-id env)))
+    request))

 (defn jruby-request-handler
   "Build a request handler fn that processes a request using a JRubyPuppet instance"


Add test for f op in interactive mode

Add test for f op in interactive mode

--- test/app/test/interactive.clj
+++ test/app/test/interactive.clj
@@ -91,3 +91,18 @@
                  classesAndSingletonTypeOp
                  (:cus javaparser-cus)
                  nil)))))
+
+(deftest can-execute-f-operation
+  (let [javaparser-cus {:cus (take 2 (cus javaparser-cus-path))}
+        command-sequence ["f" "quit"]
+        input-string (command-sequence->input-str command-sequence)]
+    (with-in-str
+      input-string
+      (mocking [println print flush printOperation]
+               (interactive javaparser-cus)
+               (verify-call-times-for printOperation 1)
+               (verify-first-call-args-for
+                 printOperation
+                 finalizersOp
+                 (:cus javaparser-cus)
+                 nil)))))


Stop info'ing

Stop info'ing

--- test/caesium/binding_test.clj
+++ test/caesium/binding_test.clj
@@ -78,7 +78,6 @@
            Integer/TYPE)
          (.getGenericReturnType method)))
   (doseq [param params]
-    (info param)
     (is (= (condp (fn [x y] (x y)) (.getParameterizedType ^Parameter param)
              #{ByteArray ByteBuffer} #{Pinned}
              #{Long/TYPE}  #{LongLong}